/* Metro module 13258; source: modules/auth_sessions/AuthSessionsUtils.tsx; dependencies: [31, 1226, 13259, 566, 1244, 3738, 2] */ import AuthenticationStore from '../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */ import AuthSessionsStore from './AuthSessionsStore.tsx'; /* Metro dependency 13259 */ 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 */ function _fun101091(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#101091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13448:6, offset: 0x02207ea6, size: 166 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); (FileImportTrackerModule).fileFinishedImporting('modules/auth_sessions/AuthSessionsUtils.tsx'); exports.useAuthSessions = useAuthSessions; exports.formatDate = formatDate_101097; function useAuthSessions() { // fn#101092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13448:223, offset: 0x02207f4c, size: 94 bytes, params: 1, frame: 15 return ReactModule.useMemo(_fun101094, [(require(566) /* metro dependency 566: flux */).useStateFromStoresObject([AuthSessionsStore], function() { return AuthSessionsStore.getSessions(); })]); function _fun101094() { // fn#101094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13448:334, offset: 0x02207fbd, size: 136 bytes, params: 1, frame: 17 var environment; var r2; const binding = env0_0; const items2 = []; arraySpread(items2, binding, 0, undefined); let value = environment.__proto__; value = AuthenticationStore.getAuthSessionIdHash(); const value2 = null; if (value2 != value) { value = items2.findIndex(_fun101095); r2 = value >= 0 ? items2.splice(value, 1)[0] : value2; } else { r2 = value2; } items2.sort(function(a0, a1) { return a1.approx_last_used_time.valueOf() - a0.approx_last_used_time.valueOf(); }); return {currentSession: r2, otherSessions: items2}; function _fun101095({id_hash}) { // fn#101095, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13448:417, offset: 0x02208045, size: 22 bytes, params: 2, frame: 2 return id_hash === env0_0; } } } function formatDate_101097(a0) { // fn#101097, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13448:611, offset: 0x02208085, size: 167 bytes, params: 2, frame: 15 var r0; var intl; const Date = global.Date; let value = Date.now(); value -= a0.valueOf(); if (value / 1000 / 60 / 60 < 1) { intl = (require(1244) /* metro dependency 1244: indexNative */).intl; r0 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.TXCmfL); } else { value = (importDefault(3738) /* metro dependency 3738 */)(a0); value = value.fromNow(); r0 = value; } return r0; } } global.__d(_fun101091, 13258, [31, 1226, 13259, 566, 1244, 3738, 2]) /* metro module 13258, dependencies: [31, 1226, 13259, 566, 1244, 3738, 2] */;