119 lines
7.1 KiB
TypeScript
119 lines
7.1 KiB
TypeScript
/* Metro module 9537; source: actions/SurveyActionCreators.tsx; dependencies: [9536, 661, 694, 683, 5046, 480, 1392, 2] */
|
|
import AnalyticsUtils from '../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
|
|
import Dispatcher from '../Dispatcher.tsx'; /* Metro dependency 694 */
|
|
import TrackedHTTPUtils from '../utils/TrackedHTTPUtils.tsx'; /* Metro dependency 5046 */
|
|
import SurveyStore from '../stores/SurveyStore.tsx'; /* Metro dependency 9536 */
|
|
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as AnalyticsUtilsModule from '../external/discord_common/js/packages/analytics-utils/AnalyticsUtils.tsx'; /* Metro dependency 480 */
|
|
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as TypeUtilsModule from '../external/discord_common/js/packages/type-utils/TypeUtils.tsx'; /* Metro dependency 1392 */
|
|
import * as SurveyStoreModule from '../stores/SurveyStore.tsx'; /* Metro dependency 9536 */
|
|
|
|
function _fun74410(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74410, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9723:6, offset: 0x01d8ce03, size: 218 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('actions/SurveyActionCreators.tsx');
|
|
exports.overrideSurvey = overrideSurvey;
|
|
exports.surveyHide = surveyHide;
|
|
exports.surveyFetch = surveyFetch;
|
|
exports.surveySeen = surveySeen;
|
|
function overrideSurvey(a0) { // fn#74411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9723:282, offset: 0x01d8cedd, size: 54 bytes, params: 2, frame: 13
|
|
(Dispatcher).dispatch({type: 'SURVEY_OVERRIDE', id: a0});
|
|
}
|
|
|
|
function surveyHide(a0, a1) { // fn#74412, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9723:371, offset: 0x01d8cf13, size: 163 bytes, params: 3, frame: 19
|
|
(Dispatcher).dispatch({type: 'SURVEY_HIDE', key: a0});
|
|
const defaultImport2 = AnalyticsUtils;
|
|
const track = defaultImport2.track;
|
|
if (a1) {
|
|
Reflect.apply(track, defaultImport2, [AnalyticEvents.APP_NOTICE_CLOSED, {notice_type: NoticeTypes.SURVEY,
|
|
survey_id: a0, dismissed: a1}]);
|
|
} else {
|
|
Reflect.apply(track, defaultImport2, [AnalyticEvents.APP_NOTICE_PRIMARY_CTA_OPENED,
|
|
{notice_type: NoticeTypes.SURVEY}]);
|
|
}
|
|
}
|
|
|
|
function surveyFetch(a0, a1) { // fn#74413, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9723:610, offset: 0x01d8cfb6, size: 177 bytes, params: 3, frame: 18
|
|
const object = {};
|
|
if (a0 != null) {
|
|
object.survey_override = a0;
|
|
}
|
|
if (a1 != null) {
|
|
object.disable_auto_seen = a1;
|
|
}
|
|
const defaultImport = TrackedHTTPUtils;
|
|
const get = defaultImport.get;
|
|
const object2 = {};
|
|
const USER_SURVEY = Endpoints.USER_SURVEY;
|
|
object2.url = USER_SURVEY;
|
|
object2.query = object;
|
|
const NetworkActionNames = (AnalyticsUtilsModule).NetworkActionNames;
|
|
const USER_SURVEY_FETCH = NetworkActionNames.USER_SURVEY_FETCH;
|
|
object2.trackedActionData = {event: USER_SURVEY_FETCH, properties: function(a0) {
|
|
var r4;
|
|
var value = undefined;
|
|
r4 = a0 == null || a0.body == null ? value : a0.body.survey;
|
|
var moduleValue = require(dependencyMap[6]);
|
|
return moduleValue.exact({key: r4 == null ? value : r4.key});
|
|
}};
|
|
object2.rejectWithError = false;
|
|
return Reflect.apply(get, defaultImport, [object2]).then(_fun74415, _fun74416);
|
|
function _fun74415(a0) { // fn#74415, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9723:968, offset: 0x01d8d0c3, size: 117 bytes, params: 2, frame: 17
|
|
let value = environment.__proto__;
|
|
value = undefined;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SURVEY_FETCHED',
|
|
survey: a0 == null || a0.body == null ? value : a0.body.survey});
|
|
return a0 == null || a0.body == null ? value : a0.body.survey;
|
|
}
|
|
|
|
function _fun74416() { // fn#74416, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9723:1123, offset: 0x01d8d138, size: 51 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__;
|
|
(Dispatcher).dispatch({'type': 'SURVEY_FETCHED', 'survey': null});
|
|
}
|
|
|
|
}
|
|
|
|
function surveySeen(a0) { // fn#74417, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9723:1199, offset: 0x01d8d16b, size: 223 bytes, params: 2, frame: 18
|
|
var object;
|
|
var defaultImport2;
|
|
var post;
|
|
const NetworkActionNames = (AnalyticsUtilsModule).NetworkActionNames;
|
|
const env0_0 = a0;
|
|
const lastSeenTimestamp = SurveyStore.getLastSeenTimestamp();
|
|
if (lastSeenTimestamp === null) {
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SURVEY_SEEN', key: a0});
|
|
defaultImport2 = importDefault(5046) /* metro dependency 5046: TrackedHTTPUtils */;
|
|
post = defaultImport2.post;
|
|
object = {};
|
|
object.url = Endpoints.USER_SURVEY_SEEN(a0);
|
|
object.trackedActionData = {event: NetworkActionNames.USER_SURVEY_SEEN, properties: properties_74418};
|
|
object.rejectWithError = false;
|
|
return Reflect.apply(post, defaultImport2, [object]);
|
|
}
|
|
if (lastSeenTimestamp != null) {
|
|
var Date = global.Date;
|
|
if (Date.now() - lastSeenTimestamp >= SURVEY_REFETCH_INTERVAL) {
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SURVEY_SEEN', key: a0});
|
|
defaultImport2 = importDefault(5046) /* metro dependency 5046: TrackedHTTPUtils */;
|
|
post = defaultImport2.post;
|
|
object = {};
|
|
object.url = Endpoints.USER_SURVEY_SEEN(a0);
|
|
object.trackedActionData = {event: NetworkActionNames.USER_SURVEY_SEEN, properties: properties_74418};
|
|
object.rejectWithError = false;
|
|
return Reflect.apply(post, defaultImport2, [object]);
|
|
}
|
|
}
|
|
function surveySeenProperties() { // fn#74418, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9723:1463, owner: surveySeen.properties, offset: 0x01d8d24a, size: 51 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__;
|
|
return (TypeUtilsModule).exact({key: env0_0});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun74410, 9537, [9536, 661, 694, 683, 5046, 480, 1392,
|
|
2]) /* metro module 9537, dependencies: [9536, 661, 694, 683, 5046, 480, 1392, 2] */;
|