238 lines
12 KiB
TypeScript
238 lines
12 KiB
TypeScript
/* Metro module 4604; source: modules/changelog/ChangelogStore.tsx; dependencies: [6, 7, 15, 17, 18, 1949, 1348, 1933, 587, 3829, 566, 694, 2] */
|
|
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import UserSettingsProtoStore from '../user_settings/UserSettingsProtoStore.tsx'; /* Metro dependency 1348 */
|
|
import LocaleStore from '../user_settings/LocaleStore.tsx'; /* Metro dependency 1949 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as StorageModule from '../../external/discord_common/js/packages/storage/Storage.tsx'; /* Metro dependency 587 */
|
|
import * as ChangelogConstantsModule from './ChangelogConstants.tsx'; /* Metro dependency 1933 */
|
|
|
|
function _fun39121(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#39121, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4782:6, offset: 0x010d8bc4, size: 478 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const handleUserSettingsProtoStoreChange = function() {
|
|
var LastReceivedChangelogId = require(dependencyMap[9]).LastReceivedChangelogId;
|
|
env0_16 = LastReceivedChangelogId.getSetting();
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_11 = {};
|
|
const env0_12 = {};
|
|
const Set = global.Set;
|
|
let set = new Set();
|
|
const Store = (Flux).Store;
|
|
_fun39126(Store).displayName = 'ChangelogStore';
|
|
set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {CHANGE_LOG_LOCK: CHANGE_LOG_LOCK,
|
|
CHANGE_LOG_UNLOCK: CHANGE_LOG_UNLOCK, CHANGE_LOG_SET_CONFIG: function(a0) {
|
|
var config = a0.config;
|
|
env0_13 = a0.latestChangelogId;
|
|
env0_15 = config;
|
|
}, CHANGE_LOG_FETCH_SUCCESS: CHANGE_LOG_FETCH_SUCCESS, CHANGE_LOG_FETCH_FAILED: CHANGE_LOG_FETCH_FAILED,
|
|
CHANGE_LOG_SET_OVERRIDE: function(a0) {
|
|
env0_14 = a0.id;
|
|
}, CHANGE_LOG_MARK_SEEN: function({changelogDate}) {
|
|
var Date = global.Date;
|
|
env0_17 = new Date(changelogDate);
|
|
var Storage = require(dependencyMap[8]).Storage;
|
|
Storage.set('lastChangeLogDate', changelogDate);
|
|
}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/changelog/ChangelogStore.tsx');
|
|
exports.default = set;
|
|
function _isNativeReflectConstruct_39122() { // fn#39122, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4782:215, offset: 0x010d8da2, size: 94 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_39122_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun39126(a0) { // fn#39126, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4782:588, offset: 0x010d8e2f, size: 302 bytes, params: 2, frame: 16
|
|
const ChangelogStore2 = ChangelogStore;
|
|
Inherits(ChangelogStore2, a0);
|
|
return CreateClass(ChangelogStore2, [{key: 'initialize', value: value_39128}, {key: 'getChangelog', value: value_39130},
|
|
{key: 'latestChangelogId', value: value_39131}, {key: 'getChangelogLoadStatus', value: value_39132},
|
|
{key: 'hasLoadedConfig', value: value_39133}, {key: 'getConfig', value: value_39134}, {key: 'overrideId',
|
|
value: value_39135}, {key: 'lastSeenChangelogId', value: value_39136}, {key: 'lastSeenChangelogDate',
|
|
value: value_39137}, {key: 'getStateForDebugging', value: value_39138}, {key: 'isLocked', value: value_39139}]);
|
|
function ChangelogStore() { // fn#39127, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4782:600, offset: 0x00ef1a6c, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_2(this, ChangelogStore);
|
|
const value3 = env1_5(ChangelogStore);
|
|
return env1_4(this, _isNativeReflectConstruct_39122() ? global.Reflect.construct(value3, arguments,
|
|
env1_5(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_39128() { // fn#39128, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4782:888, offset: 0x010d8f5d, size: 207 bytes, params: 1, frame: 17
|
|
var Date;
|
|
var prototype;
|
|
var value3;
|
|
var date;
|
|
var value4;
|
|
var error;
|
|
const waitFor = this.waitFor;
|
|
const localeStoreBinding = LocaleStore;
|
|
const userSettingsProtoStoreBinding = UserSettingsProtoStore;
|
|
Reflect.apply(waitFor, this, [localeStoreBinding, userSettingsProtoStoreBinding]);
|
|
this.syncWith([localeStoreBinding], function() {
|
|
return true;
|
|
});
|
|
this.syncWith([userSettingsProtoStoreBinding], handleUserSettingsProtoStoreChange);
|
|
const Storage = (StorageModule).Storage;
|
|
const value2 = Storage.get('lastChangeLogDate');
|
|
if (value2 != null) {
|
|
try {
|
|
Date = global.Date;
|
|
prototype = Date.prototype;
|
|
value3 = Object.create(prototype, {constructor: {value: Date}});
|
|
date = new Date(value2);
|
|
value4 = date instanceof Object ? date : value3;
|
|
env1_17 = value4;
|
|
} catch (error) {
|
|
Storage.remove('lastChangeLogDate');
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_39130(a0, a1) { // fn#39130, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4782:1121, offset: 0x010d902c, size: 46 bytes, params: 3, frame: 4
|
|
let value = environment.__proto__;
|
|
const property = env1_11[a0];
|
|
value = null;
|
|
const r1 = value == property ? undefined : property[a1];
|
|
return value != r1 ? r1 : value;
|
|
}
|
|
|
|
function value_39131() { // fn#39131, offset: 0x00e2f9d5, size: 9 bytes, params: 1, frame: 1
|
|
return env1_13;
|
|
}
|
|
|
|
function value_39132(a0, a1) { // fn#39132, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4782:1285, offset: 0x010d905a, size: 48 bytes, params: 3, frame: 5
|
|
let r0 = env1_12[a0]?.[a1];
|
|
r0 = r0 ?? ChangelogLoadState.NOT_LOADED;
|
|
return r0;
|
|
}
|
|
|
|
function value_39133() { // fn#39133, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4782:1397, offset: 0x010d908a, size: 15 bytes, params: 1, frame: 2
|
|
return env1_15 != null;
|
|
}
|
|
|
|
function value_39134() { // fn#39134, offset: 0x00df0e8b, size: 9 bytes, params: 1, frame: 1
|
|
return env1_15;
|
|
}
|
|
|
|
function value_39135() { // fn#39135, offset: 0x00df0f5a, size: 9 bytes, params: 1, frame: 1
|
|
return env1_14;
|
|
}
|
|
|
|
function value_39136() { // fn#39136, offset: 0x00df0e94, size: 9 bytes, params: 1, frame: 1
|
|
return env1_16;
|
|
}
|
|
|
|
function value_39137() { // fn#39137, offset: 0x00e07553, size: 9 bytes, params: 1, frame: 1
|
|
return env1_17;
|
|
}
|
|
|
|
function value_39138() { // fn#39138, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4782:1662, offset: 0x010d9099, size: 47 bytes, params: 1, frame: 3
|
|
return {changelogConfig: env1_15, loadedChangelogs: env1_12, lastSeenChangelogId: env1_16,
|
|
lastSeenChangelogDate: env1_17};
|
|
}
|
|
|
|
function value_39139() { // fn#39139, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4782:1788, offset: 0x010d90c8, size: 20 bytes, params: 1, frame: 2
|
|
return env1_18.size > 0;
|
|
}
|
|
|
|
}
|
|
|
|
function CHANGE_LOG_LOCK({key}) { // fn#39140, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4782:1905, offset: 0x010d90dc, size: 82 bytes, params: 2, frame: 13
|
|
let binding = env0_18;
|
|
if (binding.has(key)) {
|
|
return false;
|
|
}
|
|
const Set = global.Set;
|
|
binding = env0_18;
|
|
const value2 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
const set = new Set(binding);
|
|
(set instanceof Object ? set : value2).add(key);
|
|
}
|
|
|
|
function CHANGE_LOG_UNLOCK({key}) { // fn#39141, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4782:2005, offset: 0x010d912e, size: 82 bytes, params: 2, frame: 13
|
|
var Set;
|
|
var value2;
|
|
var set;
|
|
let binding = env0_18;
|
|
if (binding.has(key)) {
|
|
Set = global.Set;
|
|
binding = env0_18;
|
|
value2 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
set = new Set(binding);
|
|
(set instanceof Object ? set : value2).delete(key);
|
|
return undefined;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function CHANGE_LOG_FETCH_SUCCESS({id, changelog}) { // fn#39143, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4782:2203, offset: 0x010d919e, size: 199 bytes, params: 2, frame: 10
|
|
if (env0_11[id] == null) {
|
|
env0_11[id] = {};
|
|
}
|
|
let property = env0_11[id];
|
|
let locale = changelog.locale;
|
|
const asset_type = changelog.asset_type;
|
|
const YOUTUBE_VIDEO_ID = AssetType.YOUTUBE_VIDEO_ID;
|
|
property[locale] = {id: id, date: changelog.date, body: changelog.content, revision: 1, locale: changelog.locale,
|
|
[asset_type !== YOUTUBE_VIDEO_ID ? 'image' : 'youtube_video_id']: changelog.asset};
|
|
if (env0_12[id] == null) {
|
|
env0_12[id] = {};
|
|
}
|
|
property = env0_12[id];
|
|
locale = changelog.locale;
|
|
const LOADED_SUCCESS = ChangelogLoadState.LOADED_SUCCESS;
|
|
property[locale] = LOADED_SUCCESS;
|
|
}
|
|
|
|
function CHANGE_LOG_FETCH_FAILED({id, locale}) { // fn#39144, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4782:2501, offset: 0x010d9265, size: 99 bytes, params: 2, frame: 5
|
|
if (env0_11[id] == null) {
|
|
if (env0_12[id] == null) {
|
|
env0_12[id] = {};
|
|
}
|
|
env0_12[id][locale] = ChangelogLoadState.LOADED_FAILURE;
|
|
} else {
|
|
if (env0_11[id][locale] != null) {
|
|
return false;
|
|
}
|
|
if (env0_12[id] == null) {
|
|
env0_12[id] = {};
|
|
}
|
|
env0_12[id][locale] = ChangelogLoadState.LOADED_FAILURE;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun39121, 4604, [6, 7, 15, 17, 18, 1949, 1348, 1933, 587, 3829, 566, 694,
|
|
2]) /* metro module 4604, dependencies: [6, 7, 15, 17, 18, 1949, 1348, 1933, 587, 3829, 566, 694, 2] */;
|