235 lines
9.6 KiB
TypeScript
235 lines
9.6 KiB
TypeScript
/* Metro module 10991; source: modules/markup/useFormattedTimestamp.tsx; dependencies: [57, 31, 672, 7055, 3738, 6641, 2] */
|
|
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as Module07055Module from '../../by-id/module-07055.js'; /* Metro dependency 7055 */
|
|
|
|
function _fun84108(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84108, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11177:6, offset: 0x01f39555, size: 464 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_84111 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
|
|
let MINUTE = Seconds.MINUTE;
|
|
items2 = [2 * MINUTE];
|
|
Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
|
|
const SECOND = Seconds.SECOND;
|
|
items2[1] = SECOND;
|
|
const items3 = [items2];
|
|
Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
|
|
MINUTE = Seconds.MINUTE;
|
|
items2 = [5 * MINUTE];
|
|
Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
|
|
MINUTE = Seconds.MINUTE;
|
|
items2[1] = MINUTE;
|
|
items3[1] = items2;
|
|
Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
|
|
MINUTE = Seconds.MINUTE;
|
|
items2 = [45 * MINUTE];
|
|
Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
|
|
MINUTE = Seconds.MINUTE;
|
|
items2[1] = 2 * MINUTE;
|
|
items3[2] = items2;
|
|
Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
|
|
let HOUR = Seconds.HOUR;
|
|
items2 = [21 * HOUR];
|
|
Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
|
|
MINUTE = Seconds.MINUTE;
|
|
items2[1] = 5 * MINUTE;
|
|
items3[3] = items2;
|
|
Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
|
|
HOUR = Seconds.HOUR;
|
|
const env0_6 = 2 * HOUR;
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/markup/useFormattedTimestamp.tsx');
|
|
exports.default = useFormattedTimestamp;
|
|
function _createForOfIteratorHelperLoose_84109(a0, a1) { // fn#84109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11177:121, offset: 0x01f39725, size: 372 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun84110;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_84111(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_84111(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_84111(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun84110;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
function _fun84110() { // fn#84110, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11177:692, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
|
|
return env0_1 >= env0_0.length ? {done: true} : {done: false,
|
|
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
|
|
}
|
|
|
|
}
|
|
|
|
function useFormattedTimestamp(a0) { // fn#84112, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11177:1354, offset: 0x01f39899, size: 163 bytes, params: 2, frame: 17
|
|
var r0;
|
|
var TIMESTAMP_FORMATS;
|
|
const env0_0 = a0;
|
|
ReactModule.useEffect(_fun84113, [(Module07055Module).useForceUpdate(), a0.format, a0.parsed]);
|
|
if (a0.format === 'R') {
|
|
TIMESTAMP_FORMATS = (require(6641) /* metro dependency 6641: TimestampUtils */).TIMESTAMP_FORMATS;
|
|
r0 = TIMESTAMP_FORMATS.R(a0.parsed);
|
|
} else {
|
|
r0 = a0.formatted;
|
|
}
|
|
return r0;
|
|
function _fun84113() { // fn#84113, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11177:1440, offset: 0x01f3993c, size: 235 bytes, params: 1, frame: 25
|
|
var environment;
|
|
var r7;
|
|
var r3;
|
|
var value2;
|
|
var value3;
|
|
var Math;
|
|
var abs;
|
|
var parsed;
|
|
var value4;
|
|
var value5;
|
|
var done;
|
|
var value6;
|
|
var value7;
|
|
var property;
|
|
var property2;
|
|
var value8;
|
|
var value;
|
|
if (env0_0.format === 'R') {
|
|
value2 = environment.__proto__;
|
|
value3 = 1000 * env1_6;
|
|
Math = global.Math;
|
|
abs = Math.abs;
|
|
parsed = env0_0.parsed;
|
|
value = Reflect.apply(abs, Math, [parsed.diff((importDefault(3738) /* metro dependency 3738 */)())]);
|
|
value4 = _createForOfIteratorHelperLoose_84109(env1_5);
|
|
value5 = value4();
|
|
done = value5.done;
|
|
if (done) {
|
|
r3 = value3;
|
|
} else {
|
|
r7 = value5;
|
|
loopExit3: while (true) {
|
|
value6 = r7.value;
|
|
value7 = env1_3(value6, 2);
|
|
property = value7[0];
|
|
property2 = value7[1];
|
|
if (value < 1000 * property) {
|
|
value = 1000 * property2;
|
|
r3 = value;
|
|
break loopExit3;
|
|
}
|
|
value8 = value4();
|
|
done = value8.done;
|
|
if (done) {
|
|
r3 = value3;
|
|
break loopExit3;
|
|
}
|
|
r7 = value8;
|
|
continue;
|
|
}
|
|
}
|
|
var env0_0 = global.setInterval(_fun84114, r3);
|
|
return _fun84115;
|
|
}
|
|
function _fun84114() { // fn#84114, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11177:1655, offset: 0x0102a566, size: 15 bytes, params: 1, frame: 9
|
|
env1_1();
|
|
}
|
|
|
|
function _fun84115() { // fn#84115, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11177:1675, offset: 0x013378b1, size: 24 bytes, params: 1, frame: 11
|
|
return global.clearInterval(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun84108, 10991, [57, 31, 672, 7055, 3738, 6641,
|
|
2]) /* metro module 10991, dependencies: [57, 31, 672, 7055, 3738, 6641, 2] */;
|