decord/source/actions/SurveyActionCreators.tsx

126 lines
3.7 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 4600
// Function ID: 4601
2026-07-20 16:05:17 +00:00
// Name: overrideSurvey
2026-08-25 06:04:03 +00:00
// Dependencies: [4599, 676, 709, 698, 4601, 503, 1404, 530, 2]
2026-07-20 16:05:17 +00:00
// Exports: overrideSurvey, surveyFetch, surveyHide, surveySeen
2026-08-25 06:04:03 +00:00
// Module 4600 (overrideSurvey)
2026-08-24 06:08:38 +00:00
import encodeProperties from "encodeProperties" /* 503 */;
import sendRequest from "sendRequest" /* 530 */;
import expandEventPropertiesDefault from "expandEventProperties" /* 698 */;
import dispatcherDefault from "dispatcher" /* 709 */;
2026-08-25 06:04:03 +00:00
import _modDef4601 from "module_4601" /* 4601 */;
import closure_3 from "fetchSurveyIfNeeded" /* 4599 */;
import { SURVEY_REFETCH_INTERVAL } from "fetchSurveyIfNeeded" /* 4599 */;
2026-08-24 06:08:38 +00:00
import ME from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
({ AnalyticEvents: c5, NoticeTypes: closure_6, Endpoints: error } = ME);
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("actions/SurveyActionCreators.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export const overrideSurvey = function overrideSurvey(id) {
2026-08-24 06:08:38 +00:00
let obj = dispatcherDefault;
2026-07-29 08:29:29 +00:00
obj = { type: "SURVEY_OVERRIDE", id };
2026-07-20 16:05:17 +00:00
obj.dispatch(obj);
};
2026-07-29 08:29:29 +00:00
export const surveyHide = function surveyHide(key, arg1) {
2026-08-24 06:08:38 +00:00
let obj = dispatcherDefault;
2026-07-20 16:05:17 +00:00
obj = { type: "SURVEY_HIDE", key };
obj.dispatch(obj);
2026-08-24 06:08:38 +00:00
const track = expandEventPropertiesDefault.track;
2026-07-29 08:29:29 +00:00
if (arg1) {
obj = { notice_type: null, survey_id: null, dismissed: null };
obj[0] = constants.SURVEY;
obj[1] = key;
obj[2] = arg1;
2026-07-20 16:05:17 +00:00
track(tmp3.APP_NOTICE_CLOSED, obj);
} else {
2026-08-24 06:08:38 +00:00
obj1 = { notice_type: null };
2026-07-29 08:29:29 +00:00
obj1[0] = constants.SURVEY;
2026-07-20 16:05:17 +00:00
track(tmp3.APP_NOTICE_PRIMARY_CTA_OPENED, obj1);
}
};
export const surveyFetch = function surveyFetch(surveyOverride, disable_auto_seen) {
let obj = {};
if (null != surveyOverride) {
obj.survey_override = surveyOverride;
}
if (null != disable_auto_seen) {
obj.disable_auto_seen = disable_auto_seen;
}
2026-07-29 08:29:29 +00:00
obj = { url: closure_7.USER_SURVEY, query: obj, trackedActionData: null, rejectWithError: null };
2026-07-20 16:05:17 +00:00
obj = {
2026-08-24 06:08:38 +00:00
event: encodeProperties.NetworkActionNames.USER_SURVEY_FETCH,
2026-07-20 16:05:17 +00:00
properties(body) {
let survey;
2026-07-29 08:29:29 +00:00
if (body != null) {
2026-07-20 16:05:17 +00:00
body = body.body;
2026-07-29 08:29:29 +00:00
if (body != null) {
2026-07-20 16:05:17 +00:00
survey = body.survey;
}
}
let key;
2026-07-29 08:29:29 +00:00
if (survey != null) {
2026-07-20 16:05:17 +00:00
key = survey.key;
}
2026-08-11 06:20:06 +00:00
return callback(1404).exact({ key });
2026-07-20 16:05:17 +00:00
}
};
2026-07-29 08:29:29 +00:00
obj[2] = obj;
2026-08-25 06:04:03 +00:00
const obj2 = _modDef4601;
2026-08-24 06:08:38 +00:00
obj[3] = sendRequest.rejectWithMigratedError();
2026-07-20 16:05:17 +00:00
const value = obj2.get(obj);
return value.then((body) => {
let survey;
2026-07-29 08:29:29 +00:00
if (body != null) {
2026-07-20 16:05:17 +00:00
body = body.body;
2026-07-29 08:29:29 +00:00
if (body != null) {
2026-07-20 16:05:17 +00:00
survey = body.survey;
}
}
2026-07-29 08:29:29 +00:00
callback2(709).dispatch({ type: "SURVEY_FETCHED", survey });
2026-07-20 16:05:17 +00:00
let survey1;
2026-07-29 08:29:29 +00:00
if (body != null) {
2026-07-20 16:05:17 +00:00
const body2 = body.body;
2026-07-29 08:29:29 +00:00
if (body2 != null) {
2026-07-20 16:05:17 +00:00
survey1 = body2.survey;
}
}
return survey1;
}, () => {
2026-07-29 08:29:29 +00:00
callback2(709).dispatch({ type: "SURVEY_FETCHED", survey: null });
2026-07-20 16:05:17 +00:00
});
};
export const surveySeen = function surveySeen(key) {
2026-07-23 10:11:24 +00:00
const _require = key;
lastSeenTimestamp = lastSeenTimestamp.getLastSeenTimestamp();
2026-07-20 16:05:17 +00:00
if (null !== lastSeenTimestamp) {
if (null != lastSeenTimestamp) {
const _Date = Date;
}
}
2026-08-24 06:08:38 +00:00
let obj = dispatcherDefault;
2026-07-20 16:05:17 +00:00
obj = { type: "SURVEY_SEEN", key };
obj.dispatch(obj);
2026-07-29 08:29:29 +00:00
obj = { url: closure_7.USER_SURVEY_SEEN(key), trackedActionData: null, rejectWithError: null };
2026-08-25 06:04:03 +00:00
const obj3 = _modDef4601;
2026-07-29 08:29:29 +00:00
obj[1] = {
event: _require(503).NetworkActionNames.USER_SURVEY_SEEN,
2026-07-20 16:05:17 +00:00
properties() {
2026-08-24 06:08:38 +00:00
let obj = key(closure_1_2[6]);
2026-07-23 10:11:24 +00:00
obj = { key };
2026-07-20 16:05:17 +00:00
return obj.exact(obj);
}
};
2026-08-24 06:08:38 +00:00
obj1 = {
2026-07-29 08:29:29 +00:00
event: _require(503).NetworkActionNames.USER_SURVEY_SEEN,
2026-07-20 16:05:17 +00:00
properties() {
2026-08-24 06:08:38 +00:00
let obj = key(closure_1_2[6]);
2026-07-23 10:11:24 +00:00
obj = { key };
2026-07-20 16:05:17 +00:00
return obj.exact(obj);
}
};
2026-07-29 08:29:29 +00:00
obj[2] = _require(530).rejectWithMigratedError();
2026-07-20 16:05:17 +00:00
return obj3.post(obj);
};