/* Metro module 1520; source: unknown; dependencies: [65, 57, 1521, 1522, 1523] */ import Module00057 from './module-00057.js'; /* Metro dependency 57 */ import Module00065 from './module-00065.js'; /* Metro dependency 65 */ import Module01522 from './module-01522.js'; /* Metro dependency 1522 */ function _fun17209(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#17209, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1647:6, offset: 0x00e66642, size: 149 bytes, params: 8, frame: 18 const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const getParamName = function(a0) { return a0.replace(RegExp('^:', ''), '').replace(RegExp('\\?$', ''), ''); }; exports.default = getPathFromState; function getActiveRoute(a0) { // fn#17210, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1647:118, offset: 0x00e666d7, size: 96 bytes, params: 2, frame: 12 const r1 = typeof a0.index === 'number' ? a0.routes[a0.index] : a0.routes[a0.routes.length - 1]; return r1.state ? getActiveRoute(r1.state) : r1; } function joinPaths() { // fn#17212, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1647:329, offset: 0x00e66772, size: 143 bytes, params: 1, frame: 18 var r1; var value5; let value = arguments.length; const Array = global.Array; const array = new Array(value); const value4 = 0; if (value4 < value) { for (r1 = value4; true; r1 = value5) { array[r1] = arguments[r1]; value5 = typeof r1 === 'bigint' ? r1 + 1n : +r1 + 1; if (!(value5 < value)) { break; } } } const items2 = []; const concat = items2.concat; const filter = concat.apply(items2, Module00065(array.map(function(a0) { return a0.split('/'); }))).filter; const Boolean = global.Boolean; value = Reflect.apply(filter, value, [Boolean]); return value.join('/'); } function createConfigItem(a0, a1) { // fn#17214, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1647:527, offset: 0x00e66814, size: 285 bytes, params: 3, frame: 18 var path; var r2; var r6; var r1; var joinPathsBinding; var value10; let value = a0; const value2 = a1; if (typeof value === 'string') { if (value2) { value = joinPaths(value2, value); r1 = value; } else { r1 = value; } return {pattern: r1}; } if (value.exact) { if (value.path === undefined) { throw new global.Error("A 'path' needs to be specified when specifying 'exact: true'. If you don't want this screen in the URL, specify it as empty string, e.g. `path: ''`."); } } if (value.exact !== true) { joinPathsBinding = joinPaths; r2 = value2 || ''; path = value.path; path = !path ? '' : path; r6 = joinPathsBinding(r2, path); } else { path = value.path; path = !path ? '' : path; r6 = path; } const screens = value.screens; const value8 = undefined; r1 = screens ? createNormalizedConfigs_17215(value.screens, r6) : value8; if (r6 == null) { r2 = value8; } else { value10 = r6.split('/'); r2 = value10.filter(global.Boolean).join('/'); } return {pattern: r2, stringify: value.stringify, screens: r1}; } function createNormalizedConfigs_17215(a0, a1) { // fn#17215, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1647:1004, offset: 0x00e66931, size: 78 bytes, params: 3, frame: 14 const env0_0 = a1; const Object = global.Object; const value2 = Object.entries(a0); return Module01522(value2.map(_fun17216)); function _fun17216(a0) { // fn#17216, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1647:1080, offset: 0x00e6697f, size: 65 bytes, params: 2, frame: 14 const value2 = env1_4(a0, 2); const property = value2[0]; const property2 = value2[1]; const items2 = [property]; items2[1] = createConfigItem(property2, require); return items2; } } function getPathFromState(a0, a1) { // fn#17217, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1647:1151, offset: 0x00e669c0, size: 256 bytes, params: 3, frame: 17 var environment; var screens; var r2; var value; var createNormalizedConfigs_17215Binding; const env0_0 = a0; if (a0 == null) { throw global.Error("Got 'undefined' for the navigation state. You must pass a valid state object."); } reducibleJoin3: while (true) { if (a1) { value = environment; (importDefault(1521) /* metro dependency 1521 */)(a1); break reducibleJoin3; } break reducibleJoin3; } reducibleJoin9: while (true) { reducibleJoin5: while (true) { if (a1 == null) { break reducibleJoin5; } screens = a1.screens; if (screens) { value = environment; createNormalizedConfigs_17215Binding = createNormalizedConfigs_17215; value = undefined; reducibleJoin8: while (true) { if (a1 == null) { screens = value; break reducibleJoin8; } screens = a1.screens; break reducibleJoin8; } value = createNormalizedConfigs_17215Binding(screens); r2 = value; break reducibleJoin9; } break reducibleJoin5; } r2 = {}; break reducibleJoin9; } let env0_2 = '/'; const env0_3 = a0; const env0_4 = {}; if (a0) { reducibleLoop10: while (true) { getPathFromState_loop(); if (env0_3) { continue reducibleLoop10; } break reducibleLoop10; } } value = env0_2.replace(RegExp('\\/+', 'g'), '/'); env0_2 = value; return value.length > 1 ? env0_2.replace(RegExp('\\/$', ''), '') : env0_2; function getPathFromState_loop() { // fn#17218, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1647:1377, owner: getPathFromState._loop, offset: 0x00e66ac0, size: 516 bytes, params: 1, frame: 21 var r7; var value6; var propertyName; var propertyName2; var moduleValue; var stringify; var value7; let index = env0_3Binding.index; index = typeof index !== 'number' ? 0 : env0_3Binding.index; let env0_2 = index; var env0_3Binding = env0_3.routes[index]; const activeRoute = getActiveRoute(env0_0); const env0_13 = env0_1; const env0_7 = true; const _loop_loop22 = _loop_loop2; let name = env0_3Binding.name; if (name in env0_13) { if (env0_7) { while (true) { _loop_loop22(); name = env0_3Binding.name; if (!(name in env0_13)) { break; } if (env0_7) { continue; } break; } } } env0_0 = env0_0 === undefined ? [].join('/') : env0_0; let binding = env0_13; if (binding[env0_3Binding.name] !== undefined) { binding = env0_2; value6 = env0_0.split('/').map(_fun17223); env0_2 = binding + value6.join('/'); } else { env0_2 = env0_2 + global.encodeURIComponent(env0_3Binding.name); } env0_1 = !env0_1 ? activeRoute.params : env0_1; let state = env0_3Binding.state; if (state) { env0_2 += '/'; } else if (env0_1) { binding = env0_1; for (propertyName in binding) { if (env0_1[propertyName] !== 'undefined') { r7 = propertyName2; continue; } delete env0_1[propertyName]; r7 = propertyName2; } moduleValue = importAll(1523) /* metro dependency 1523 */; stringify = moduleValue.stringify; binding = env0_1; value7 = Reflect.apply(stringify, moduleValue, [binding, {sort: false}]); if (value7) { env0_2 = env0_2 + ('?' + value7); } } state = env0_3Binding.state; function _loop_loop2() { // fn#17219, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1647:1480, owner: getPathFromState._loop._loop2, offset: 0x00e66cc4, size: 506 bytes, params: 1, frame: 18 var environment; var r0; var property; var value3; var defaultImport; var Object; var value4; var value5; var assign; var value6; var state; let binding = env0_5; env0_0 = binding[env0_3.name].pattern; binding = env0_6; binding.push(env0_3.name); if (env0_3.params) { binding = env0_5; var env0_0 = binding[env0_3.name]?.stringify; value3 = environment.__proto__.__proto__; defaultImport = importDefault(1522) /* metro dependency 1522 */; Object = global.Object; value4 = Object.entries(env0_3.params); value5 = defaultImport(value4.map(_fun17220)); if (env0_0) { Object = global.Object; assign = Object.assign; value6 = environment.__proto__; Reflect.apply(assign, Object, [env1_4, value5]); } binding = env0_4; if (binding === env0_3) { env0_1 = global.Object.assign({}, value5); binding = env0_0; if (binding != null) { binding.split('/').filter(function(a0) { return a0.startsWith(':'); }).forEach(_fun17222); } } } let screens = env0_5[env0_3.name].screens; if (screens) { state = env0_3.state; if (state !== undefined) { state = env0_3.state; r0 = typeof state.index === 'number' ? env0_3.state.index : env0_3.state.routes.length - 1; state = env0_3.state; property = state.routes[r0]; screens = env0_5[env0_3.name].screens; if (screens) { if (property.name in screens) { } } } } function _fun17220(a0) { // fn#17220, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1647:1635, offset: 0x00e66ebe, size: 100 bytes, params: 2, frame: 16 let value = environment.__proto__.__proto__.__proto__; value = env3_4(a0, 2); const property = value[0]; const property2 = value[1]; const items2 = [property]; items2[1] = stringify == null ? global.String(property2) : stringify[property] ? stringify[property](property2) : global.String(property2); return items2; } function _fun17222(a0) { // fn#17222, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1647:1856, offset: 0x00e66f36, size: 37 bytes, params: 2, frame: 12 const value = environment.__proto__.__proto__.__proto__; if (params) { delete params[getParamName(a0)]; } } } function _fun17223(a0) { // fn#17223, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1647:2184, offset: 0x00e66f5b, size: 126 bytes, params: 2, frame: 13 var value2; var property; let value = environment.__proto__.__proto__; value = getParamName(a0); if (a0 === '*') { value = environment; return env0_3.name; } if (a0.startsWith(':')) { value2 = environment.__proto__; property = env1_4[value]; return property !== undefined ? global.encodeURIComponent(property) : a0.endsWith('?') ? '' : global.encodeURIComponent(property); } return global.encodeURIComponent(a0); } } } } global.__d(_fun17209, 1520, [65, 57, 1521, 1522, 1523]) /* metro module 1520, dependencies: [65, 57, 1521, 1522, 1523] */;