@amazon-devices/react-navigation__routers 2.0.9000000000 → 2.0.9000000001

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3487 +0,0 @@
1
- var __BUNDLE_START_TIME__=this.nativePerformanceNow?nativePerformanceNow():Date.now(),__DEV__=false,process=this.process||{},__METRO_GLOBAL_PREFIX__='';process.env=process.env||{};process.env.NODE_ENV=process.env.NODE_ENV||"production";
2
- (function (global) {
3
- /**
4
- * Copyright (c) Meta Platforms, Inc. and affiliates.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- *
9
- * @format
10
- *
11
- * @nolint
12
- * @polyfill
13
- */
14
-
15
- 'use client';
16
-
17
- /* eslint-disable no-shadow, eqeqeq, no-unused-vars, no-control-regex */
18
-
19
- /**
20
- * This pipes all of our console logging functions to native logging so that
21
- * JavaScript errors in required modules show up in Xcode via NSLog.
22
- */
23
- var inspect = function () {
24
- // Copyright Joyent, Inc. and other Node contributors.
25
- //
26
- // Permission is hereby granted, free of charge, to any person obtaining a
27
- // copy of this software and associated documentation files (the
28
- // "Software"), to deal in the Software without restriction, including
29
- // without limitation the rights to use, copy, modify, merge, publish,
30
- // distribute, sublicense, and/or sell copies of the Software, and to permit
31
- // persons to whom the Software is furnished to do so, subject to the
32
- // following conditions:
33
- //
34
- // The above copyright notice and this permission notice shall be included
35
- // in all copies or substantial portions of the Software.
36
- //
37
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
38
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
39
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
40
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
41
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
42
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
43
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
44
- //
45
- // https://github.com/joyent/node/blob/master/lib/util.js
46
-
47
- function inspect(obj, opts) {
48
- var ctx = {
49
- seen: [],
50
- formatValueCalls: 0,
51
- stylize: stylizeNoColor
52
- };
53
- return formatValue(ctx, obj, opts.depth);
54
- }
55
- function stylizeNoColor(str, styleType) {
56
- return str;
57
- }
58
- function arrayToHash(array) {
59
- var hash = {};
60
- array.forEach(function (val, idx) {
61
- hash[val] = true;
62
- });
63
- return hash;
64
- }
65
- function formatValue(ctx, value, recurseTimes) {
66
- ctx.formatValueCalls++;
67
- if (ctx.formatValueCalls > 200) {
68
- return `[TOO BIG formatValueCalls ${ctx.formatValueCalls} exceeded limit of 200]`;
69
- }
70
-
71
- // Primitive types cannot have properties
72
- var primitive = formatPrimitive(ctx, value);
73
- if (primitive) {
74
- return primitive;
75
- }
76
-
77
- // Look up the keys of the object.
78
- var keys = Object.keys(value);
79
- var visibleKeys = arrayToHash(keys);
80
-
81
- // IE doesn't make error fields non-enumerable
82
- // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
83
- if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
84
- return formatError(value);
85
- }
86
-
87
- // Some type of object without properties can be shortcutted.
88
- if (keys.length === 0) {
89
- if (isFunction(value)) {
90
- var name = value.name ? ': ' + value.name : '';
91
- return ctx.stylize('[Function' + name + ']', 'special');
92
- }
93
- if (isRegExp(value)) {
94
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
95
- }
96
- if (isDate(value)) {
97
- return ctx.stylize(Date.prototype.toString.call(value), 'date');
98
- }
99
- if (isError(value)) {
100
- return formatError(value);
101
- }
102
- }
103
- var base = '',
104
- array = false,
105
- braces = ['{', '}'];
106
-
107
- // Make Array say that they are Array
108
- if (isArray(value)) {
109
- array = true;
110
- braces = ['[', ']'];
111
- }
112
-
113
- // Make functions say that they are functions
114
- if (isFunction(value)) {
115
- var n = value.name ? ': ' + value.name : '';
116
- base = ' [Function' + n + ']';
117
- }
118
-
119
- // Make RegExps say that they are RegExps
120
- if (isRegExp(value)) {
121
- base = ' ' + RegExp.prototype.toString.call(value);
122
- }
123
-
124
- // Make dates with properties first say the date
125
- if (isDate(value)) {
126
- base = ' ' + Date.prototype.toUTCString.call(value);
127
- }
128
-
129
- // Make error with message first say the error
130
- if (isError(value)) {
131
- base = ' ' + formatError(value);
132
- }
133
- if (keys.length === 0 && (!array || value.length == 0)) {
134
- return braces[0] + base + braces[1];
135
- }
136
- if (recurseTimes < 0) {
137
- if (isRegExp(value)) {
138
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
139
- } else {
140
- return ctx.stylize('[Object]', 'special');
141
- }
142
- }
143
- ctx.seen.push(value);
144
- var output;
145
- if (array) {
146
- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
147
- } else {
148
- output = keys.map(function (key) {
149
- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
150
- });
151
- }
152
- ctx.seen.pop();
153
- return reduceToSingleString(output, base, braces);
154
- }
155
- function formatPrimitive(ctx, value) {
156
- if (isUndefined(value)) return ctx.stylize('undefined', 'undefined');
157
- if (isString(value)) {
158
- var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, '').replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
159
- return ctx.stylize(simple, 'string');
160
- }
161
- if (isNumber(value)) return ctx.stylize('' + value, 'number');
162
- if (isBoolean(value)) return ctx.stylize('' + value, 'boolean');
163
- // For some reason typeof null is "object", so special case here.
164
- if (isNull(value)) return ctx.stylize('null', 'null');
165
- }
166
- function formatError(value) {
167
- return '[' + Error.prototype.toString.call(value) + ']';
168
- }
169
- function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
170
- var output = [];
171
- for (var i = 0, l = value.length; i < l; ++i) {
172
- if (hasOwnProperty(value, String(i))) {
173
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true));
174
- } else {
175
- output.push('');
176
- }
177
- }
178
- keys.forEach(function (key) {
179
- if (!key.match(/^\d+$/)) {
180
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));
181
- }
182
- });
183
- return output;
184
- }
185
- function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
186
- var name, str, desc;
187
- desc = Object.getOwnPropertyDescriptor(value, key) || {
188
- value: value[key]
189
- };
190
- if (desc.get) {
191
- if (desc.set) {
192
- str = ctx.stylize('[Getter/Setter]', 'special');
193
- } else {
194
- str = ctx.stylize('[Getter]', 'special');
195
- }
196
- } else {
197
- if (desc.set) {
198
- str = ctx.stylize('[Setter]', 'special');
199
- }
200
- }
201
- if (!hasOwnProperty(visibleKeys, key)) {
202
- name = '[' + key + ']';
203
- }
204
- if (!str) {
205
- if (ctx.seen.indexOf(desc.value) < 0) {
206
- if (isNull(recurseTimes)) {
207
- str = formatValue(ctx, desc.value, null);
208
- } else {
209
- str = formatValue(ctx, desc.value, recurseTimes - 1);
210
- }
211
- if (str.indexOf('\n') > -1) {
212
- if (array) {
213
- str = str.split('\n').map(function (line) {
214
- return ' ' + line;
215
- }).join('\n').slice(2);
216
- } else {
217
- str = '\n' + str.split('\n').map(function (line) {
218
- return ' ' + line;
219
- }).join('\n');
220
- }
221
- }
222
- } else {
223
- str = ctx.stylize('[Circular]', 'special');
224
- }
225
- }
226
- if (isUndefined(name)) {
227
- if (array && key.match(/^\d+$/)) {
228
- return str;
229
- }
230
- name = JSON.stringify('' + key);
231
- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
232
- name = name.slice(1, name.length - 1);
233
- name = ctx.stylize(name, 'name');
234
- } else {
235
- name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
236
- name = ctx.stylize(name, 'string');
237
- }
238
- }
239
- return name + ': ' + str;
240
- }
241
- function reduceToSingleString(output, base, braces) {
242
- var numLinesEst = 0;
243
- var length = output.reduce(function (prev, cur) {
244
- numLinesEst++;
245
- if (cur.indexOf('\n') >= 0) numLinesEst++;
246
- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
247
- }, 0);
248
- if (length > 60) {
249
- return braces[0] + (base === '' ? '' : base + '\n ') + ' ' + output.join(',\n ') + ' ' + braces[1];
250
- }
251
- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
252
- }
253
-
254
- // NOTE: These type checking functions intentionally don't use `instanceof`
255
- // because it is fragile and can be easily faked with `Object.create()`.
256
- function isArray(ar) {
257
- return Array.isArray(ar);
258
- }
259
- function isBoolean(arg) {
260
- return typeof arg === 'boolean';
261
- }
262
- function isNull(arg) {
263
- return arg === null;
264
- }
265
- function isNumber(arg) {
266
- return typeof arg === 'number';
267
- }
268
- function isString(arg) {
269
- return typeof arg === 'string';
270
- }
271
- function isUndefined(arg) {
272
- return arg === undefined;
273
- }
274
- function isRegExp(re) {
275
- return isObject(re) && objectToString(re) === '[object RegExp]';
276
- }
277
- function isObject(arg) {
278
- return typeof arg === 'object' && arg !== null;
279
- }
280
- function isDate(d) {
281
- return isObject(d) && objectToString(d) === '[object Date]';
282
- }
283
- function isError(e) {
284
- return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error);
285
- }
286
- function isFunction(arg) {
287
- return typeof arg === 'function';
288
- }
289
- function objectToString(o) {
290
- return Object.prototype.toString.call(o);
291
- }
292
- function hasOwnProperty(obj, prop) {
293
- return Object.prototype.hasOwnProperty.call(obj, prop);
294
- }
295
- return inspect;
296
- }();
297
- var INDEX_COLUMN_NAME = '(index)';
298
- var LOG_LEVELS = {
299
- trace: 0,
300
- info: 1,
301
- warn: 2,
302
- error: 3
303
- };
304
- function getNativeLogFunction(level) {
305
- return function () {
306
- var str;
307
- if (arguments.length === 1 && typeof arguments[0] === 'string') {
308
- str = arguments[0];
309
- } else {
310
- str = Array.prototype.map.call(arguments, function (arg) {
311
- return inspect(arg, {
312
- depth: 10
313
- });
314
- }).join(', ');
315
- }
316
-
317
- // TRICKY
318
- // If more than one argument is provided, the code above collapses them all
319
- // into a single formatted string. This transform wraps string arguments in
320
- // single quotes (e.g. "foo" -> "'foo'") which then breaks the "Warning:"
321
- // check below. So it's important that we look at the first argument, rather
322
- // than the formatted argument string.
323
- var firstArg = arguments[0];
324
- var logLevel = level;
325
- if (typeof firstArg === 'string' && firstArg.slice(0, 9) === 'Warning: ' && logLevel >= LOG_LEVELS.error) {
326
- // React warnings use console.error so that a stack trace is shown,
327
- // but we don't (currently) want these to show a redbox
328
- // (Note: Logic duplicated in ExceptionsManager.js.)
329
- logLevel = LOG_LEVELS.warn;
330
- }
331
- if (groupStack.length) {
332
- str = groupFormat('', str);
333
- }
334
- global.nativeLoggingHook(str, logLevel);
335
- };
336
- }
337
- function repeat(element, n) {
338
- return Array.apply(null, Array(n)).map(function () {
339
- return element;
340
- });
341
- }
342
- function formatCellValue(cell, key) {
343
- if (key === INDEX_COLUMN_NAME) {
344
- return cell[key];
345
- }
346
- if (cell.hasOwnProperty(key)) {
347
- var cellValue = cell[key];
348
- switch (typeof cellValue) {
349
- case 'function':
350
- return 'ƒ';
351
- case 'string':
352
- return "'" + cellValue + "'";
353
- case 'object':
354
- return cellValue == null ? 'null' : '{…}';
355
- }
356
- return String(cellValue);
357
- }
358
- return '';
359
- }
360
- function consoleTablePolyfill(data, columns) {
361
- var rows;
362
-
363
- // convert object -> array
364
- if (Array.isArray(data)) {
365
- rows = data.map(function (row, index) {
366
- var processedRow = {};
367
- processedRow[INDEX_COLUMN_NAME] = String(index);
368
- Object.assign(processedRow, row);
369
- return processedRow;
370
- });
371
- } else {
372
- rows = [];
373
- for (var key in data) {
374
- if (data.hasOwnProperty(key)) {
375
- var processedRow = {};
376
- processedRow[INDEX_COLUMN_NAME] = key;
377
- Object.assign(processedRow, data[key]);
378
- rows.push(processedRow);
379
- }
380
- }
381
- }
382
- if (rows.length === 0) {
383
- global.nativeLoggingHook('', LOG_LEVELS.info);
384
- return;
385
- }
386
- if (Array.isArray(columns)) {
387
- columns = [INDEX_COLUMN_NAME].concat(columns);
388
- } else {
389
- columns = Array.from(rows.reduce(function (columnSet, row) {
390
- Object.keys(row).forEach(function (key) {
391
- return columnSet.add(key);
392
- });
393
- return columnSet;
394
- }, new Set()));
395
- }
396
- var stringRows = [];
397
- var columnWidths = [];
398
-
399
- // Convert each cell to a string. Also
400
- // figure out max cell width for each column
401
- columns.forEach(function (k, i) {
402
- columnWidths[i] = k.length;
403
- for (var j = 0; j < rows.length; j++) {
404
- var cellStr = formatCellValue(rows[j], k);
405
- stringRows[j] = stringRows[j] || [];
406
- stringRows[j][i] = cellStr;
407
- columnWidths[i] = Math.max(columnWidths[i], cellStr.length);
408
- }
409
- });
410
-
411
- // Join all elements in the row into a single string with | separators
412
- // (appends extra spaces to each cell to make separators | aligned)
413
- function joinRow(row, space) {
414
- var cells = row.map(function (cell, i) {
415
- var extraSpaces = repeat(' ', columnWidths[i] - cell.length).join('');
416
- return cell + extraSpaces;
417
- });
418
- space = space || ' ';
419
- return '| ' + cells.join(space + '|' + space) + ' |';
420
- }
421
- var separators = columnWidths.map(function (columnWidth) {
422
- return repeat('-', columnWidth).join('');
423
- });
424
- var separatorRow = joinRow(separators);
425
- var header = joinRow(columns);
426
- var table = [header, separatorRow];
427
- for (var i = 0; i < rows.length; i++) {
428
- table.push(joinRow(stringRows[i]));
429
- }
430
-
431
- // Notice extra empty line at the beginning.
432
- // Native logging hook adds "RCTLog >" at the front of every
433
- // logged string, which would shift the header and screw up
434
- // the table
435
- global.nativeLoggingHook('\n' + table.join('\n'), LOG_LEVELS.info);
436
- }
437
- var GROUP_PAD = "\u2502"; // Box light vertical
438
- var GROUP_OPEN = "\u2510"; // Box light down+left
439
- var GROUP_CLOSE = "\u2518"; // Box light up+left
440
-
441
- var groupStack = [];
442
- function groupFormat(prefix, msg) {
443
- // Insert group formatting before the console message
444
- return groupStack.join('') + prefix + ' ' + (msg || '');
445
- }
446
- function consoleGroupPolyfill(label) {
447
- global.nativeLoggingHook(groupFormat(GROUP_OPEN, label), LOG_LEVELS.info);
448
- groupStack.push(GROUP_PAD);
449
- }
450
- function consoleGroupCollapsedPolyfill(label) {
451
- global.nativeLoggingHook(groupFormat(GROUP_CLOSE, label), LOG_LEVELS.info);
452
- groupStack.push(GROUP_PAD);
453
- }
454
- function consoleGroupEndPolyfill() {
455
- groupStack.pop();
456
- global.nativeLoggingHook(groupFormat(GROUP_CLOSE), LOG_LEVELS.info);
457
- }
458
- function consoleAssertPolyfill(expression, label) {
459
- if (!expression) {
460
- global.nativeLoggingHook('Assertion failed: ' + label, LOG_LEVELS.error);
461
- }
462
- }
463
- function stub() {}
464
- if (global.nativeLoggingHook) {
465
- var originalConsole = global.console;
466
- // Preserve the original `console` as `originalConsole`
467
-
468
- global.console = Object.assign({
469
- time: stub,
470
- timeEnd: stub,
471
- timeStamp: stub,
472
- count: stub,
473
- countReset: stub
474
- }, originalConsole != null ? originalConsole : {}, {
475
- error: getNativeLogFunction(LOG_LEVELS.error),
476
- info: getNativeLogFunction(LOG_LEVELS.info),
477
- log: getNativeLogFunction(LOG_LEVELS.info),
478
- warn: getNativeLogFunction(LOG_LEVELS.warn),
479
- trace: getNativeLogFunction(LOG_LEVELS.trace),
480
- debug: getNativeLogFunction(LOG_LEVELS.trace),
481
- table: consoleTablePolyfill,
482
- group: consoleGroupPolyfill,
483
- groupEnd: consoleGroupEndPolyfill,
484
- groupCollapsed: consoleGroupCollapsedPolyfill,
485
- assert: consoleAssertPolyfill
486
- });
487
-
488
- // TODO(T206796580): This was copy-pasted from ExceptionsManager.js
489
- // Delete the copy there after the c++ pipeline is rolled out everywhere.
490
- if (global.RN$useAlwaysAvailableJSErrorHandling === true) {
491
- var stringifySafe = function stringifySafe(arg) {
492
- return inspect(arg, {
493
- depth: 10
494
- }).replace(/\n\s*/g, ' ');
495
- };
496
- var originalConsoleError = console.error;
497
- console.reportErrorsAsExceptions = true;
498
- console.error = function () {
499
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
500
- args[_key] = arguments[_key];
501
- }
502
- originalConsoleError.apply(this, args);
503
- if (!console.reportErrorsAsExceptions) {
504
- return;
505
- }
506
- if (global.RN$inExceptionHandler != null && global.RN$inExceptionHandler()) {
507
- return;
508
- }
509
- var error;
510
- var firstArg = args[0];
511
- if (firstArg != null && firstArg.stack) {
512
- // RN$handleException will console.error this with high enough fidelity.
513
- error = firstArg;
514
- } else {
515
- if (typeof firstArg === 'string' && firstArg.startsWith('Warning: ')) {
516
- // React warnings use console.error so that a stack trace is shown, but
517
- // we don't (currently) want these to show a redbox
518
- return;
519
- }
520
- var message = args.map(function (arg) {
521
- return typeof arg === 'string' ? arg : stringifySafe(arg);
522
- }).join(' ');
523
- error = new Error(message);
524
- error.name = 'console.error';
525
- }
526
- var isFatal = false;
527
- var reportToConsole = false;
528
- global.RN$handleException(error, isFatal, reportToConsole);
529
- };
530
- }
531
- Object.defineProperty(console, '_isPolyfilled', {
532
- value: true,
533
- enumerable: false
534
- });
535
-
536
- // If available, also call the original `console` method since that is
537
- // sometimes useful. Ex: on OS X, this will let you see rich output in
538
- // the Safari Web Inspector console.
539
- } else if (!global.console) {
540
- var log = global.print || stub;
541
- global.console = {
542
- debug: log,
543
- error: log,
544
- info: log,
545
- log: log,
546
- trace: log,
547
- warn: log,
548
- assert: function assert(expression, label) {
549
- if (!expression) {
550
- log('Assertion failed: ' + label);
551
- }
552
- },
553
- clear: stub,
554
- count: stub,
555
- countReset: stub,
556
- dir: stub,
557
- dirxml: stub,
558
- group: stub,
559
- groupCollapsed: stub,
560
- groupEnd: stub,
561
- profile: stub,
562
- profileEnd: stub,
563
- table: stub,
564
- time: stub,
565
- timeEnd: stub,
566
- timeStamp: stub
567
- };
568
- Object.defineProperty(console, '_isPolyfilled', {
569
- value: true,
570
- enumerable: false
571
- });
572
- }
573
- })(typeof globalThis !== 'undefined' ? globalThis : typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this);
574
- (function (global) {
575
- var _inGuard = 0;
576
- var _globalHandler = global.RN$useAlwaysAvailableJSErrorHandling === true ? global.RN$handleException : function (e, isFatal) {
577
- throw e;
578
- };
579
- var ErrorUtils = {
580
- setGlobalHandler: function setGlobalHandler(fun) {
581
- _globalHandler = fun;
582
- },
583
- getGlobalHandler: function getGlobalHandler() {
584
- return _globalHandler;
585
- },
586
- reportError: function reportError(error) {
587
- _globalHandler && _globalHandler(error, false);
588
- },
589
- reportFatalError: function reportFatalError(error) {
590
- _globalHandler && _globalHandler(error, true);
591
- },
592
- applyWithGuard: function applyWithGuard(fun, context, args, unused_onError, unused_name) {
593
- try {
594
- _inGuard++;
595
- return fun.apply(context, args);
596
- } catch (e) {
597
- ErrorUtils.reportError(e);
598
- } finally {
599
- _inGuard--;
600
- }
601
- return null;
602
- },
603
- applyWithGuardIfNeeded: function applyWithGuardIfNeeded(fun, context, args) {
604
- if (ErrorUtils.inGuard()) {
605
- return fun.apply(context, args);
606
- } else {
607
- ErrorUtils.applyWithGuard(fun, context, args);
608
- }
609
- return null;
610
- },
611
- inGuard: function inGuard() {
612
- return !!_inGuard;
613
- },
614
- guard: function guard(fun, name, context) {
615
- var _ref;
616
- if (typeof fun !== 'function') {
617
- console.warn('A function must be passed to ErrorUtils.guard, got ', fun);
618
- return null;
619
- }
620
- var guardName = (_ref = name != null ? name : fun.name) != null ? _ref : '<generated guard>';
621
- function guarded() {
622
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
623
- args[_key] = arguments[_key];
624
- }
625
- return ErrorUtils.applyWithGuard(fun, context != null ? context : this, args, null, guardName);
626
- }
627
- return guarded;
628
- }
629
- };
630
- global.ErrorUtils = ErrorUtils;
631
- })(typeof globalThis !== 'undefined' ? globalThis : typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this);
632
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
633
- "use strict";
634
-
635
- Object.defineProperty(exports, "__esModule", {
636
- value: true
637
- });
638
- exports.default = undefined;
639
- /**
640
- * Base router object that can be used when writing custom routers.
641
- * This provides few helper methods to handle common actions such as `RESET`.
642
- */
643
- var BaseRouter = {
644
- getStateForAction: function getStateForAction(state, action) {
645
- switch (action.type) {
646
- case 'SET_PARAMS':
647
- {
648
- var index = action.source ? state.routes.findIndex(function (r) {
649
- return r.key === action.source;
650
- }) : state.index;
651
- if (index === -1) {
652
- return null;
653
- }
654
- return Object.assign({}, state, {
655
- routes: state.routes.map(function (r, i) {
656
- return i === index ? Object.assign({}, r, {
657
- params: Object.assign({}, r.params, action.payload.params)
658
- }) : r;
659
- })
660
- });
661
- }
662
- case 'RESET':
663
- {
664
- var nextState = action.payload;
665
- if (nextState.routes.length === 0 || nextState.routes.some(function (route) {
666
- return !state.routeNames.includes(route.name);
667
- })) {
668
- return null;
669
- }
670
- if (nextState.stale === false) {
671
- if (state.routeNames.length !== nextState.routeNames.length || nextState.routeNames.some(function (name) {
672
- return !state.routeNames.includes(name);
673
- })) {
674
- return null;
675
- }
676
- return Object.assign({}, nextState, {
677
- routes: nextState.routes.map(function (route) {
678
- return route.key ? route : Object.assign({}, route, {
679
- key: `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[0]).nanoid)()}`
680
- });
681
- })
682
- });
683
- }
684
- return nextState;
685
- }
686
- default:
687
- return null;
688
- }
689
- },
690
- shouldActionChangeFocus: function shouldActionChangeFocus(action) {
691
- return action.type === 'NAVIGATE';
692
- }
693
- };
694
- var _default = exports.default = BaseRouter;
695
- },"ed52cec8d045963ef690",["e03db9aacb1ee503cd26"]);
696
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
697
- Object.defineProperty(exports, "__esModule", {
698
- value: true
699
- });
700
- exports.nanoid = exports.customAlphabet = undefined;
701
- // This alphabet uses `A-Za-z0-9_-` symbols. The genetic algorithm helped
702
- // optimize the gzip compression for this alphabet.
703
- var urlAlphabet = 'ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW';
704
- var customAlphabet = exports.customAlphabet = function customAlphabet(alphabet, size) {
705
- return function () {
706
- var id = '';
707
- // A compact alternative for `for (var i = 0; i < step; i++)`.
708
- var i = size;
709
- while (i--) {
710
- // `| 0` is more compact and faster than `Math.floor()`.
711
- id += alphabet[Math.random() * alphabet.length | 0];
712
- }
713
- return id;
714
- };
715
- };
716
- var nanoid = exports.nanoid = function nanoid() {
717
- var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 21;
718
- var id = '';
719
- // A compact alternative for `for (var i = 0; i < step; i++)`.
720
- var i = size;
721
- while (i--) {
722
- // `| 0` is more compact and faster than `Math.floor()`.
723
- id += urlAlphabet[Math.random() * 64 | 0];
724
- }
725
- return id;
726
- };
727
- },"e03db9aacb1ee503cd26",[]);
728
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
729
- "use strict";
730
-
731
- Object.defineProperty(exports, "__esModule", {
732
- value: true
733
- });
734
- exports.goBack = goBack;
735
- exports.navigate = navigate;
736
- exports.reset = reset;
737
- exports.setParams = setParams;
738
- function goBack() {
739
- return {
740
- type: 'GO_BACK'
741
- };
742
- }
743
-
744
- // eslint-disable-next-line no-redeclare
745
-
746
- // eslint-disable-next-line no-redeclare
747
- function navigate() {
748
- if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'string') {
749
- return {
750
- type: 'NAVIGATE',
751
- payload: {
752
- name: arguments.length <= 0 ? undefined : arguments[0],
753
- params: arguments.length <= 1 ? undefined : arguments[1]
754
- }
755
- };
756
- } else {
757
- var payload = (arguments.length <= 0 ? undefined : arguments[0]) || {};
758
- if (!payload.hasOwnProperty('key') && !payload.hasOwnProperty('name')) {
759
- throw new Error('You need to specify name or key when calling navigate with an object as the argument. See https://reactnavigation.org/docs/navigation-actions#navigate for usage.');
760
- }
761
- return {
762
- type: 'NAVIGATE',
763
- payload: payload
764
- };
765
- }
766
- }
767
- function reset(state) {
768
- return {
769
- type: 'RESET',
770
- payload: state
771
- };
772
- }
773
- function setParams(params) {
774
- return {
775
- type: 'SET_PARAMS',
776
- payload: {
777
- params: params
778
- }
779
- };
780
- }
781
- },"753e4ea4136d8a647a48",[]);
782
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
783
- "use strict";
784
-
785
- var _excluded = ["defaultStatus"];
786
- Object.defineProperty(exports, "__esModule", {
787
- value: true
788
- });
789
- exports.DrawerActions = undefined;
790
- exports.default = DrawerRouter;
791
- var _TabRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0]));
792
- function _interopRequireWildcard(e, t) {
793
- if ("function" == typeof WeakMap) var r = new WeakMap(),
794
- n = new WeakMap();
795
- return (_interopRequireWildcard = function _interopRequireWildcard(e, t) {
796
- if (!t && e && e.__esModule) return e;
797
- var o,
798
- i,
799
- f = {
800
- __proto__: null,
801
- default: e
802
- };
803
- if (null === e || "object" != typeof e && "function" != typeof e) return f;
804
- if (o = t ? n : r) {
805
- if (o.has(e)) return o.get(e);
806
- o.set(e, f);
807
- }
808
- for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]);
809
- return f;
810
- })(e, t);
811
- }
812
- var DrawerActions = exports.DrawerActions = Object.assign({}, _TabRouter.TabActions, {
813
- openDrawer: function openDrawer() {
814
- return {
815
- type: 'OPEN_DRAWER'
816
- };
817
- },
818
- closeDrawer: function closeDrawer() {
819
- return {
820
- type: 'CLOSE_DRAWER'
821
- };
822
- },
823
- toggleDrawer: function toggleDrawer() {
824
- return {
825
- type: 'TOGGLE_DRAWER'
826
- };
827
- }
828
- });
829
- function DrawerRouter(_ref) {
830
- var _ref$defaultStatus = _ref.defaultStatus,
831
- defaultStatus = _ref$defaultStatus === undefined ? 'closed' : _ref$defaultStatus,
832
- rest = _$$_REQUIRE(_dependencyMap[1])(_ref, _excluded);
833
- var router = (0, _TabRouter.default)(rest);
834
- var isDrawerInHistory = function isDrawerInHistory(state) {
835
- var _state$history;
836
- return Boolean((_state$history = state.history) === null || _state$history === undefined ? undefined : _state$history.some(function (it) {
837
- return it.type === 'drawer';
838
- }));
839
- };
840
- var addDrawerToHistory = function addDrawerToHistory(state) {
841
- if (isDrawerInHistory(state)) {
842
- return state;
843
- }
844
- return Object.assign({}, state, {
845
- history: [].concat(_$$_REQUIRE(_dependencyMap[2])(state.history), [{
846
- type: 'drawer',
847
- status: defaultStatus === 'open' ? 'closed' : 'open'
848
- }])
849
- });
850
- };
851
- var removeDrawerFromHistory = function removeDrawerFromHistory(state) {
852
- if (!isDrawerInHistory(state)) {
853
- return state;
854
- }
855
- return Object.assign({}, state, {
856
- history: state.history.filter(function (it) {
857
- return it.type !== 'drawer';
858
- })
859
- });
860
- };
861
- var openDrawer = function openDrawer(state) {
862
- if (defaultStatus === 'open') {
863
- return removeDrawerFromHistory(state);
864
- }
865
- return addDrawerToHistory(state);
866
- };
867
- var closeDrawer = function closeDrawer(state) {
868
- if (defaultStatus === 'open') {
869
- return addDrawerToHistory(state);
870
- }
871
- return removeDrawerFromHistory(state);
872
- };
873
- return Object.assign({}, router, {
874
- type: 'drawer',
875
- getInitialState: function getInitialState(_ref2) {
876
- var routeNames = _ref2.routeNames,
877
- routeParamList = _ref2.routeParamList,
878
- routeGetIdList = _ref2.routeGetIdList;
879
- var state = router.getInitialState({
880
- routeNames: routeNames,
881
- routeParamList: routeParamList,
882
- routeGetIdList: routeGetIdList
883
- });
884
- return Object.assign({}, state, {
885
- default: defaultStatus,
886
- stale: false,
887
- type: 'drawer',
888
- key: `drawer-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`
889
- });
890
- },
891
- getRehydratedState: function getRehydratedState(partialState, _ref3) {
892
- var routeNames = _ref3.routeNames,
893
- routeParamList = _ref3.routeParamList,
894
- routeGetIdList = _ref3.routeGetIdList;
895
- if (partialState.stale === false) {
896
- return partialState;
897
- }
898
- var state = router.getRehydratedState(partialState, {
899
- routeNames: routeNames,
900
- routeParamList: routeParamList,
901
- routeGetIdList: routeGetIdList
902
- });
903
- if (isDrawerInHistory(partialState)) {
904
- // Re-sync the drawer entry in history to correct it if it was wrong
905
- state = removeDrawerFromHistory(state);
906
- state = addDrawerToHistory(state);
907
- }
908
- return Object.assign({}, state, {
909
- default: defaultStatus,
910
- type: 'drawer',
911
- key: `drawer-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`
912
- });
913
- },
914
- getStateForRouteFocus: function getStateForRouteFocus(state, key) {
915
- var result = router.getStateForRouteFocus(state, key);
916
- return closeDrawer(result);
917
- },
918
- getStateForAction: function getStateForAction(state, action, options) {
919
- switch (action.type) {
920
- case 'OPEN_DRAWER':
921
- return openDrawer(state);
922
- case 'CLOSE_DRAWER':
923
- return closeDrawer(state);
924
- case 'TOGGLE_DRAWER':
925
- if (isDrawerInHistory(state)) {
926
- return removeDrawerFromHistory(state);
927
- }
928
- return addDrawerToHistory(state);
929
- case 'JUMP_TO':
930
- case 'NAVIGATE':
931
- {
932
- var result = router.getStateForAction(state, action, options);
933
- if (result != null && result.index !== state.index) {
934
- return closeDrawer(result);
935
- }
936
- return result;
937
- }
938
- case 'GO_BACK':
939
- if (isDrawerInHistory(state)) {
940
- return removeDrawerFromHistory(state);
941
- }
942
- return router.getStateForAction(state, action, options);
943
- default:
944
- return router.getStateForAction(state, action, options);
945
- }
946
- },
947
- actionCreators: DrawerActions
948
- });
949
- }
950
- },"e439c281fd8214dde054",["51bc6144a204648d7f40","a2c8e692f78bae5b8b98","838d7a057beeb5db50df","e03db9aacb1ee503cd26"]);
951
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
952
- "use strict";
953
-
954
- Object.defineProperty(exports, "__esModule", {
955
- value: true
956
- });
957
- exports.TabActions = undefined;
958
- exports.default = TabRouter;
959
- var _BaseRouter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[0]));
960
- function _interopRequireDefault(e) {
961
- return e && e.__esModule ? e : {
962
- default: e
963
- };
964
- }
965
- var TYPE_ROUTE = 'route';
966
- var TabActions = exports.TabActions = {
967
- jumpTo: function jumpTo(name, params) {
968
- return {
969
- type: 'JUMP_TO',
970
- payload: {
971
- name: name,
972
- params: params
973
- }
974
- };
975
- }
976
- };
977
- var getRouteHistory = function getRouteHistory(routes, index, backBehavior, initialRouteName) {
978
- var history = [{
979
- type: TYPE_ROUTE,
980
- key: routes[index].key
981
- }];
982
- var initialRouteIndex;
983
- switch (backBehavior) {
984
- case 'order':
985
- for (var i = index; i > 0; i--) {
986
- history.unshift({
987
- type: TYPE_ROUTE,
988
- key: routes[i - 1].key
989
- });
990
- }
991
- break;
992
- case 'firstRoute':
993
- if (index !== 0) {
994
- history.unshift({
995
- type: TYPE_ROUTE,
996
- key: routes[0].key
997
- });
998
- }
999
- break;
1000
- case 'initialRoute':
1001
- initialRouteIndex = routes.findIndex(function (route) {
1002
- return route.name === initialRouteName;
1003
- });
1004
- initialRouteIndex = initialRouteIndex === -1 ? 0 : initialRouteIndex;
1005
- if (index !== initialRouteIndex) {
1006
- history.unshift({
1007
- type: TYPE_ROUTE,
1008
- key: routes[initialRouteIndex].key
1009
- });
1010
- }
1011
- break;
1012
- case 'history':
1013
- // The history will fill up on navigation
1014
- break;
1015
- }
1016
- return history;
1017
- };
1018
- var changeIndex = function changeIndex(state, index, backBehavior, initialRouteName) {
1019
- var history;
1020
- if (backBehavior === 'history') {
1021
- var currentKey = state.routes[index].key;
1022
- history = state.history.filter(function (it) {
1023
- return it.type === 'route' ? it.key !== currentKey : false;
1024
- }).concat({
1025
- type: TYPE_ROUTE,
1026
- key: currentKey
1027
- });
1028
- } else {
1029
- history = getRouteHistory(state.routes, index, backBehavior, initialRouteName);
1030
- }
1031
- return Object.assign({}, state, {
1032
- index: index,
1033
- history: history
1034
- });
1035
- };
1036
- function TabRouter(_ref) {
1037
- var initialRouteName = _ref.initialRouteName,
1038
- _ref$backBehavior = _ref.backBehavior,
1039
- backBehavior = _ref$backBehavior === undefined ? 'firstRoute' : _ref$backBehavior;
1040
- var router = Object.assign({}, _BaseRouter.default, {
1041
- type: 'tab',
1042
- getInitialState: function getInitialState(_ref2) {
1043
- var routeNames = _ref2.routeNames,
1044
- routeParamList = _ref2.routeParamList;
1045
- var index = initialRouteName !== undefined && routeNames.includes(initialRouteName) ? routeNames.indexOf(initialRouteName) : 0;
1046
- var routes = routeNames.map(function (name) {
1047
- return {
1048
- name: name,
1049
- key: `${name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
1050
- params: routeParamList[name]
1051
- };
1052
- });
1053
- var history = getRouteHistory(routes, index, backBehavior, initialRouteName);
1054
- return {
1055
- stale: false,
1056
- type: 'tab',
1057
- key: `tab-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
1058
- index: index,
1059
- routeNames: routeNames,
1060
- history: history,
1061
- routes: routes
1062
- };
1063
- },
1064
- getRehydratedState: function getRehydratedState(partialState, _ref3) {
1065
- var _ref4, _ref5;
1066
- var routeNames = _ref3.routeNames,
1067
- routeParamList = _ref3.routeParamList;
1068
- var _state$routes, _state$history;
1069
- var state = partialState;
1070
- if (state.stale === false) {
1071
- return state;
1072
- }
1073
- var routes = routeNames.map(function (name) {
1074
- var route = state.routes.find(function (r) {
1075
- return r.name === name;
1076
- });
1077
- return Object.assign({}, route, {
1078
- name: name,
1079
- key: route && route.name === name && route.key ? route.key : `${name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
1080
- params: routeParamList[name] !== undefined ? Object.assign({}, routeParamList[name], route ? route.params : undefined) : route ? route.params : undefined
1081
- });
1082
- });
1083
- var index = Math.min(Math.max(routeNames.indexOf((_state$routes = state.routes[(_ref4 = state === null || state === undefined ? undefined : state.index) != null ? _ref4 : 0]) === null || _state$routes === undefined ? undefined : _state$routes.name), 0), routes.length - 1);
1084
- var history = (_ref5 = (_state$history = state.history) === null || _state$history === undefined ? undefined : _state$history.filter(function (it) {
1085
- return routes.find(function (r) {
1086
- return r.key === it.key;
1087
- });
1088
- })) != null ? _ref5 : [];
1089
- return changeIndex({
1090
- stale: false,
1091
- type: 'tab',
1092
- key: `tab-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
1093
- index: index,
1094
- routeNames: routeNames,
1095
- history: history,
1096
- routes: routes
1097
- }, index, backBehavior, initialRouteName);
1098
- },
1099
- getStateForRouteNamesChange: function getStateForRouteNamesChange(state, _ref6) {
1100
- var routeNames = _ref6.routeNames,
1101
- routeParamList = _ref6.routeParamList,
1102
- routeKeyChanges = _ref6.routeKeyChanges;
1103
- var routes = routeNames.map(function (name) {
1104
- return state.routes.find(function (r) {
1105
- return r.name === name && !routeKeyChanges.includes(r.name);
1106
- }) || {
1107
- name: name,
1108
- key: `${name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
1109
- params: routeParamList[name]
1110
- };
1111
- });
1112
- var index = Math.max(0, routeNames.indexOf(state.routes[state.index].name));
1113
- var history = state.history.filter(
1114
- // Type will always be 'route' for tabs, but could be different in a router extending this (e.g. drawer)
1115
- function (it) {
1116
- return it.type !== 'route' || routes.find(function (r) {
1117
- return r.key === it.key;
1118
- });
1119
- });
1120
- if (!history.length) {
1121
- history = getRouteHistory(routes, index, backBehavior, initialRouteName);
1122
- }
1123
- return Object.assign({}, state, {
1124
- history: history,
1125
- routeNames: routeNames,
1126
- routes: routes,
1127
- index: index
1128
- });
1129
- },
1130
- getStateForRouteFocus: function getStateForRouteFocus(state, key) {
1131
- var index = state.routes.findIndex(function (r) {
1132
- return r.key === key;
1133
- });
1134
- if (index === -1 || index === state.index) {
1135
- return state;
1136
- }
1137
- return changeIndex(state, index, backBehavior, initialRouteName);
1138
- },
1139
- getStateForAction: function getStateForAction(state, action, _ref7) {
1140
- var routeParamList = _ref7.routeParamList,
1141
- routeGetIdList = _ref7.routeGetIdList;
1142
- switch (action.type) {
1143
- case 'JUMP_TO':
1144
- case 'NAVIGATE':
1145
- {
1146
- var index = -1;
1147
- if (action.type === 'NAVIGATE' && action.payload.key) {
1148
- index = state.routes.findIndex(function (route) {
1149
- return route.key === action.payload.key;
1150
- });
1151
- } else {
1152
- index = state.routes.findIndex(function (route) {
1153
- return route.name === action.payload.name;
1154
- });
1155
- }
1156
- if (index === -1) {
1157
- return null;
1158
- }
1159
- return changeIndex(Object.assign({}, state, {
1160
- routes: state.routes.map(function (route, i) {
1161
- if (i !== index) {
1162
- return route;
1163
- }
1164
- var getId = routeGetIdList[route.name];
1165
- var currentId = getId === null || getId === undefined ? undefined : getId({
1166
- params: route.params
1167
- });
1168
- var nextId = getId === null || getId === undefined ? undefined : getId({
1169
- params: action.payload.params
1170
- });
1171
- var key = currentId === nextId ? route.key : `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`;
1172
- var params;
1173
- if (action.type === 'NAVIGATE' && action.payload.merge && currentId === nextId) {
1174
- params = action.payload.params !== undefined || routeParamList[route.name] !== undefined ? Object.assign({}, routeParamList[route.name], route.params, action.payload.params) : route.params;
1175
- } else {
1176
- params = routeParamList[route.name] !== undefined ? Object.assign({}, routeParamList[route.name], action.payload.params) : action.payload.params;
1177
- }
1178
- var path = action.type === 'NAVIGATE' && action.payload.path != null ? action.payload.path : route.path;
1179
- return params !== route.params || path !== route.path ? Object.assign({}, route, {
1180
- key: key,
1181
- path: path,
1182
- params: params
1183
- }) : route;
1184
- })
1185
- }), index, backBehavior, initialRouteName);
1186
- }
1187
- case 'GO_BACK':
1188
- {
1189
- if (state.history.length === 1) {
1190
- return null;
1191
- }
1192
- var previousKey = state.history[state.history.length - 2].key;
1193
- var _index = state.routes.findIndex(function (route) {
1194
- return route.key === previousKey;
1195
- });
1196
- if (_index === -1) {
1197
- return null;
1198
- }
1199
- return Object.assign({}, state, {
1200
- history: state.history.slice(0, -1),
1201
- index: _index
1202
- });
1203
- }
1204
- default:
1205
- return _BaseRouter.default.getStateForAction(state, action);
1206
- }
1207
- },
1208
- shouldActionChangeFocus: function shouldActionChangeFocus(action) {
1209
- return action.type === 'NAVIGATE';
1210
- },
1211
- actionCreators: TabActions
1212
- });
1213
- return router;
1214
- }
1215
- },"51bc6144a204648d7f40",["ed52cec8d045963ef690","e03db9aacb1ee503cd26"]);
1216
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
1217
- function _objectWithoutProperties(e, t) {
1218
- if (null == e) return {};
1219
- var o,
1220
- r,
1221
- i = _$$_REQUIRE(_dependencyMap[0])(e, t);
1222
- if (Object.getOwnPropertySymbols) {
1223
- var n = Object.getOwnPropertySymbols(e);
1224
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
1225
- }
1226
- return i;
1227
- }
1228
- module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
1229
- },"a2c8e692f78bae5b8b98",["5927789db7c756c318ed"]);
1230
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
1231
- function _objectWithoutPropertiesLoose(r, e) {
1232
- if (null == r) return {};
1233
- var t = {};
1234
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
1235
- if (-1 !== e.indexOf(n)) continue;
1236
- t[n] = r[n];
1237
- }
1238
- return t;
1239
- }
1240
- module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
1241
- },"5927789db7c756c318ed",[]);
1242
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
1243
- function _toConsumableArray(r) {
1244
- return _$$_REQUIRE(_dependencyMap[0])(r) || _$$_REQUIRE(_dependencyMap[1])(r) || _$$_REQUIRE(_dependencyMap[2])(r) || _$$_REQUIRE(_dependencyMap[3])();
1245
- }
1246
- module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
1247
- },"838d7a057beeb5db50df",["a425fd4fe3cf47759e99","67d028b72bb61755baea","e7044bb724c5bd68e2cc","b4810fa44dd496b7d9f5"]);
1248
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
1249
- function _arrayWithoutHoles(r) {
1250
- if (Array.isArray(r)) return _$$_REQUIRE(_dependencyMap[0])(r);
1251
- }
1252
- module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
1253
- },"a425fd4fe3cf47759e99",["378be3062418cfac9327"]);
1254
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
1255
- function _arrayLikeToArray(r, a) {
1256
- (null == a || a > r.length) && (a = r.length);
1257
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
1258
- return n;
1259
- }
1260
- module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
1261
- },"378be3062418cfac9327",[]);
1262
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
1263
- function _iterableToArray(r) {
1264
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
1265
- }
1266
- module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
1267
- },"67d028b72bb61755baea",[]);
1268
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
1269
- function _unsupportedIterableToArray(r, a) {
1270
- if (r) {
1271
- if ("string" == typeof r) return _$$_REQUIRE(_dependencyMap[0])(r, a);
1272
- var t = {}.toString.call(r).slice(8, -1);
1273
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _$$_REQUIRE(_dependencyMap[0])(r, a) : undefined;
1274
- }
1275
- }
1276
- module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
1277
- },"e7044bb724c5bd68e2cc",["378be3062418cfac9327"]);
1278
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
1279
- function _nonIterableSpread() {
1280
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1281
- }
1282
- module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
1283
- },"b4810fa44dd496b7d9f5",[]);
1284
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
1285
- "use strict";
1286
-
1287
- Object.defineProperty(exports, "__esModule", {
1288
- value: true
1289
- });
1290
- exports.StackActions = undefined;
1291
- exports.default = StackRouter;
1292
- var _BaseRouter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[0]));
1293
- function _interopRequireDefault(e) {
1294
- return e && e.__esModule ? e : {
1295
- default: e
1296
- };
1297
- }
1298
- var StackActions = exports.StackActions = {
1299
- replace: function replace(name, params) {
1300
- return {
1301
- type: 'REPLACE',
1302
- payload: {
1303
- name: name,
1304
- params: params
1305
- }
1306
- };
1307
- },
1308
- push: function push(name, params) {
1309
- return {
1310
- type: 'PUSH',
1311
- payload: {
1312
- name: name,
1313
- params: params
1314
- }
1315
- };
1316
- },
1317
- pop: function pop() {
1318
- var count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
1319
- return {
1320
- type: 'POP',
1321
- payload: {
1322
- count: count
1323
- }
1324
- };
1325
- },
1326
- popToTop: function popToTop() {
1327
- return {
1328
- type: 'POP_TO_TOP'
1329
- };
1330
- }
1331
- };
1332
- function StackRouter(options) {
1333
- var router = Object.assign({}, _BaseRouter.default, {
1334
- type: 'stack',
1335
- getInitialState: function getInitialState(_ref) {
1336
- var routeNames = _ref.routeNames,
1337
- routeParamList = _ref.routeParamList;
1338
- var initialRouteName = options.initialRouteName !== undefined && routeNames.includes(options.initialRouteName) ? options.initialRouteName : routeNames[0];
1339
- return {
1340
- stale: false,
1341
- type: 'stack',
1342
- key: `stack-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
1343
- index: 0,
1344
- routeNames: routeNames,
1345
- routes: [{
1346
- key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
1347
- name: initialRouteName,
1348
- params: routeParamList[initialRouteName]
1349
- }]
1350
- };
1351
- },
1352
- getRehydratedState: function getRehydratedState(partialState, _ref2) {
1353
- var routeNames = _ref2.routeNames,
1354
- routeParamList = _ref2.routeParamList;
1355
- var state = partialState;
1356
- if (state.stale === false) {
1357
- return state;
1358
- }
1359
- var routes = state.routes.filter(function (route) {
1360
- return routeNames.includes(route.name);
1361
- }).map(function (route) {
1362
- return Object.assign({}, route, {
1363
- key: route.key || `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
1364
- params: routeParamList[route.name] !== undefined ? Object.assign({}, routeParamList[route.name], route.params) : route.params
1365
- });
1366
- });
1367
- if (routes.length === 0) {
1368
- var initialRouteName = options.initialRouteName !== undefined ? options.initialRouteName : routeNames[0];
1369
- routes.push({
1370
- key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
1371
- name: initialRouteName,
1372
- params: routeParamList[initialRouteName]
1373
- });
1374
- }
1375
- return {
1376
- stale: false,
1377
- type: 'stack',
1378
- key: `stack-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
1379
- index: routes.length - 1,
1380
- routeNames: routeNames,
1381
- routes: routes
1382
- };
1383
- },
1384
- getStateForRouteNamesChange: function getStateForRouteNamesChange(state, _ref3) {
1385
- var routeNames = _ref3.routeNames,
1386
- routeParamList = _ref3.routeParamList,
1387
- routeKeyChanges = _ref3.routeKeyChanges;
1388
- var routes = state.routes.filter(function (route) {
1389
- return routeNames.includes(route.name) && !routeKeyChanges.includes(route.name);
1390
- });
1391
- if (routes.length === 0) {
1392
- var initialRouteName = options.initialRouteName !== undefined && routeNames.includes(options.initialRouteName) ? options.initialRouteName : routeNames[0];
1393
- routes.push({
1394
- key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
1395
- name: initialRouteName,
1396
- params: routeParamList[initialRouteName]
1397
- });
1398
- }
1399
- return Object.assign({}, state, {
1400
- routeNames: routeNames,
1401
- routes: routes,
1402
- index: Math.min(state.index, routes.length - 1)
1403
- });
1404
- },
1405
- getStateForRouteFocus: function getStateForRouteFocus(state, key) {
1406
- var index = state.routes.findIndex(function (r) {
1407
- return r.key === key;
1408
- });
1409
- if (index === -1 || index === state.index) {
1410
- return state;
1411
- }
1412
- return Object.assign({}, state, {
1413
- index: index,
1414
- routes: state.routes.slice(0, index + 1)
1415
- });
1416
- },
1417
- getStateForAction: function getStateForAction(state, action, options) {
1418
- var routeParamList = options.routeParamList;
1419
- switch (action.type) {
1420
- case 'REPLACE':
1421
- {
1422
- var index = action.target === state.key && action.source ? state.routes.findIndex(function (r) {
1423
- return r.key === action.source;
1424
- }) : state.index;
1425
- if (index === -1) {
1426
- return null;
1427
- }
1428
- var _action$payload = action.payload,
1429
- name = _action$payload.name,
1430
- key = _action$payload.key,
1431
- params = _action$payload.params;
1432
- if (!state.routeNames.includes(name)) {
1433
- return null;
1434
- }
1435
- return Object.assign({}, state, {
1436
- routes: state.routes.map(function (route, i) {
1437
- return i === index ? {
1438
- key: key !== undefined ? key : `${name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
1439
- name: name,
1440
- params: routeParamList[name] !== undefined ? Object.assign({}, routeParamList[name], params) : params
1441
- } : route;
1442
- })
1443
- });
1444
- }
1445
- case 'PUSH':
1446
- if (state.routeNames.includes(action.payload.name)) {
1447
- var getId = options.routeGetIdList[action.payload.name];
1448
- var id = getId === null || getId === undefined ? undefined : getId({
1449
- params: action.payload.params
1450
- });
1451
- var route = id ? state.routes.find(function (route) {
1452
- return route.name === action.payload.name && id === (getId === null || getId === undefined ? undefined : getId({
1453
- params: route.params
1454
- }));
1455
- }) : undefined;
1456
- var routes;
1457
- if (route) {
1458
- routes = state.routes.filter(function (r) {
1459
- return r.key !== route.key;
1460
- });
1461
- routes.push(Object.assign({}, route, {
1462
- params: routeParamList[action.payload.name] !== undefined ? Object.assign({}, routeParamList[action.payload.name], action.payload.params) : action.payload.params
1463
- }));
1464
- } else {
1465
- routes = [].concat(_$$_REQUIRE(_dependencyMap[2])(state.routes), [{
1466
- key: `${action.payload.name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
1467
- name: action.payload.name,
1468
- params: routeParamList[action.payload.name] !== undefined ? Object.assign({}, routeParamList[action.payload.name], action.payload.params) : action.payload.params
1469
- }]);
1470
- }
1471
- return Object.assign({}, state, {
1472
- index: routes.length - 1,
1473
- routes: routes
1474
- });
1475
- }
1476
- return null;
1477
- case 'POP':
1478
- {
1479
- var _index = action.target === state.key && action.source ? state.routes.findIndex(function (r) {
1480
- return r.key === action.source;
1481
- }) : state.index;
1482
- if (_index > 0) {
1483
- var count = Math.max(_index - action.payload.count + 1, 1);
1484
- var _routes = state.routes.slice(0, count).concat(state.routes.slice(_index + 1));
1485
- return Object.assign({}, state, {
1486
- index: _routes.length - 1,
1487
- routes: _routes
1488
- });
1489
- }
1490
- return null;
1491
- }
1492
- case 'POP_TO_TOP':
1493
- return router.getStateForAction(state, {
1494
- type: 'POP',
1495
- payload: {
1496
- count: state.routes.length - 1
1497
- }
1498
- }, options);
1499
- case 'NAVIGATE':
1500
- if (action.payload.name !== undefined && !state.routeNames.includes(action.payload.name)) {
1501
- return null;
1502
- }
1503
- if (action.payload.key || action.payload.name) {
1504
- var _action$payload$path;
1505
- // If the route already exists, navigate to that
1506
- var _index2 = -1;
1507
- var _getId =
1508
- // `getId` and `key` can't be used together
1509
- action.payload.key === undefined && action.payload.name !== undefined ? options.routeGetIdList[action.payload.name] : undefined;
1510
- var _id = _getId === null || _getId === undefined ? undefined : _getId({
1511
- params: action.payload.params
1512
- });
1513
- if (_id) {
1514
- _index2 = state.routes.findIndex(function (route) {
1515
- return route.name === action.payload.name && _id === (_getId === null || _getId === undefined ? undefined : _getId({
1516
- params: route.params
1517
- }));
1518
- });
1519
- } else if (state.routes[state.index].name === action.payload.name && action.payload.key === undefined || state.routes[state.index].key === action.payload.key) {
1520
- _index2 = state.index;
1521
- } else {
1522
- for (var i = state.routes.length - 1; i >= 0; i--) {
1523
- if (state.routes[i].name === action.payload.name && action.payload.key === undefined || state.routes[i].key === action.payload.key) {
1524
- _index2 = i;
1525
- break;
1526
- }
1527
- }
1528
- }
1529
- if (_index2 === -1 && action.payload.key && action.payload.name === undefined) {
1530
- return null;
1531
- }
1532
- if (_index2 === -1 && action.payload.name !== undefined) {
1533
- var _action$payload$key;
1534
- var _routes2 = [].concat(_$$_REQUIRE(_dependencyMap[2])(state.routes), [{
1535
- key: (_action$payload$key = action.payload.key) != null ? _action$payload$key : `${action.payload.name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
1536
- name: action.payload.name,
1537
- path: action.payload.path,
1538
- params: routeParamList[action.payload.name] !== undefined ? Object.assign({}, routeParamList[action.payload.name], action.payload.params) : action.payload.params
1539
- }]);
1540
- return Object.assign({}, state, {
1541
- routes: _routes2,
1542
- index: _routes2.length - 1
1543
- });
1544
- }
1545
- var _route = state.routes[_index2];
1546
- var _params;
1547
- if (action.payload.merge) {
1548
- _params = action.payload.params !== undefined || routeParamList[_route.name] !== undefined ? Object.assign({}, routeParamList[_route.name], _route.params, action.payload.params) : _route.params;
1549
- } else {
1550
- _params = routeParamList[_route.name] !== undefined ? Object.assign({}, routeParamList[_route.name], action.payload.params) : action.payload.params;
1551
- }
1552
- return Object.assign({}, state, {
1553
- index: _index2,
1554
- routes: [].concat(_$$_REQUIRE(_dependencyMap[2])(state.routes.slice(0, _index2)), [_params !== _route.params || action.payload.path && action.payload.path !== _route.path ? Object.assign({}, _route, {
1555
- path: (_action$payload$path = action.payload.path) != null ? _action$payload$path : _route.path,
1556
- params: _params
1557
- }) : state.routes[_index2]])
1558
- });
1559
- }
1560
- return null;
1561
- case 'GO_BACK':
1562
- if (state.index > 0) {
1563
- return router.getStateForAction(state, {
1564
- type: 'POP',
1565
- payload: {
1566
- count: 1
1567
- },
1568
- target: action.target,
1569
- source: action.source
1570
- }, options);
1571
- }
1572
- return null;
1573
- default:
1574
- return _BaseRouter.default.getStateForAction(state, action);
1575
- }
1576
- },
1577
- actionCreators: StackActions
1578
- });
1579
- return router;
1580
- }
1581
- },"b9c3076b2184de60772e",["ed52cec8d045963ef690","e03db9aacb1ee503cd26","838d7a057beeb5db50df"]);
1582
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
1583
- "use strict";
1584
-
1585
- Object.defineProperty(exports, "__esModule", {
1586
- value: true
1587
- });
1588
- var _exportNames = {
1589
- CommonActions: true,
1590
- BaseRouter: true,
1591
- DrawerActions: true,
1592
- DrawerRouter: true,
1593
- StackActions: true,
1594
- StackRouter: true,
1595
- TabActions: true,
1596
- TabRouter: true
1597
- };
1598
- Object.defineProperty(exports, "BaseRouter", {
1599
- enumerable: true,
1600
- get: function get() {
1601
- return _BaseRouter.default;
1602
- }
1603
- });
1604
- exports.CommonActions = undefined;
1605
- Object.defineProperty(exports, "DrawerActions", {
1606
- enumerable: true,
1607
- get: function get() {
1608
- return _DrawerRouter.DrawerActions;
1609
- }
1610
- });
1611
- Object.defineProperty(exports, "DrawerRouter", {
1612
- enumerable: true,
1613
- get: function get() {
1614
- return _DrawerRouter.default;
1615
- }
1616
- });
1617
- Object.defineProperty(exports, "StackActions", {
1618
- enumerable: true,
1619
- get: function get() {
1620
- return _StackRouter.StackActions;
1621
- }
1622
- });
1623
- Object.defineProperty(exports, "StackRouter", {
1624
- enumerable: true,
1625
- get: function get() {
1626
- return _StackRouter.default;
1627
- }
1628
- });
1629
- Object.defineProperty(exports, "TabActions", {
1630
- enumerable: true,
1631
- get: function get() {
1632
- return _TabRouter.TabActions;
1633
- }
1634
- });
1635
- Object.defineProperty(exports, "TabRouter", {
1636
- enumerable: true,
1637
- get: function get() {
1638
- return _TabRouter.default;
1639
- }
1640
- });
1641
- var CommonActions = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0]));
1642
- exports.CommonActions = CommonActions;
1643
- var _BaseRouter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1]));
1644
- var _DrawerRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2]));
1645
- var _StackRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3]));
1646
- var _TabRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4]));
1647
- Object.keys(_$$_REQUIRE(_dependencyMap[5])).forEach(function (key) {
1648
- if (key === "default" || key === "__esModule") return;
1649
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
1650
- if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[5])[key]) return;
1651
- Object.defineProperty(exports, key, {
1652
- enumerable: true,
1653
- get: function get() {
1654
- return _$$_REQUIRE(_dependencyMap[5])[key];
1655
- }
1656
- });
1657
- });
1658
- function _interopRequireDefault(e) {
1659
- return e && e.__esModule ? e : {
1660
- default: e
1661
- };
1662
- }
1663
- function _interopRequireWildcard(e, t) {
1664
- if ("function" == typeof WeakMap) var r = new WeakMap(),
1665
- n = new WeakMap();
1666
- return (_interopRequireWildcard = function _interopRequireWildcard(e, t) {
1667
- if (!t && e && e.__esModule) return e;
1668
- var o,
1669
- i,
1670
- f = {
1671
- __proto__: null,
1672
- default: e
1673
- };
1674
- if (null === e || "object" != typeof e && "function" != typeof e) return f;
1675
- if (o = t ? n : r) {
1676
- if (o.has(e)) return o.get(e);
1677
- o.set(e, f);
1678
- }
1679
- for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]);
1680
- return f;
1681
- })(e, t);
1682
- }
1683
- },"ecba6c88b265e5561955",["753e4ea4136d8a647a48","ed52cec8d045963ef690","e439c281fd8214dde054","b9c3076b2184de60772e","51bc6144a204648d7f40","b49427bde5b4a88de1e7"]);
1684
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
1685
- "use strict";
1686
-
1687
- Object.defineProperty(exports, "__esModule", {
1688
- value: true
1689
- });
1690
- },"b49427bde5b4a88de1e7",[]);
1691
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
1692
- Object.defineProperty(exports, "__esModule", {
1693
- value: true
1694
- });
1695
- exports.default = undefined;
1696
- /**
1697
- * Base router object that can be used when writing custom routers.
1698
- * This provides few helper methods to handle common actions such as `RESET`.
1699
- */
1700
- var BaseRouter = {
1701
- getStateForAction: function getStateForAction(state, action) {
1702
- switch (action.type) {
1703
- case 'SET_PARAMS':
1704
- {
1705
- var index = action.source ? state.routes.findIndex(function (r) {
1706
- return r.key === action.source;
1707
- }) : state.index;
1708
- if (index === -1) {
1709
- return null;
1710
- }
1711
- return Object.assign({}, state, {
1712
- routes: state.routes.map(function (r, i) {
1713
- return i === index ? Object.assign({}, r, {
1714
- params: Object.assign({}, r.params, action.payload.params)
1715
- }) : r;
1716
- })
1717
- });
1718
- }
1719
- case 'RESET':
1720
- {
1721
- var nextState = action.payload;
1722
- if (nextState.routes.length === 0 || nextState.routes.some(function (route) {
1723
- return !state.routeNames.includes(route.name);
1724
- })) {
1725
- return null;
1726
- }
1727
- if (nextState.stale === false) {
1728
- if (state.routeNames.length !== nextState.routeNames.length || nextState.routeNames.some(function (name) {
1729
- return !state.routeNames.includes(name);
1730
- })) {
1731
- return null;
1732
- }
1733
- return Object.assign({}, nextState, {
1734
- routes: nextState.routes.map(function (route) {
1735
- return route.key ? route : Object.assign({}, route, {
1736
- key: `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[0]).nanoid)()}`
1737
- });
1738
- })
1739
- });
1740
- }
1741
- return nextState;
1742
- }
1743
- default:
1744
- return null;
1745
- }
1746
- },
1747
- shouldActionChangeFocus: function shouldActionChangeFocus(action) {
1748
- return action.type === 'NAVIGATE';
1749
- }
1750
- };
1751
- var _default = exports.default = BaseRouter;
1752
- },"95ae28b023658c6d2aff",["e03db9aacb1ee503cd26"]);
1753
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
1754
- Object.defineProperty(exports, "__esModule", {
1755
- value: true
1756
- });
1757
- exports.goBack = goBack;
1758
- exports.navigate = navigate;
1759
- exports.reset = reset;
1760
- exports.setParams = setParams;
1761
- function goBack() {
1762
- return {
1763
- type: 'GO_BACK'
1764
- };
1765
- }
1766
-
1767
- // eslint-disable-next-line no-redeclare
1768
-
1769
- // eslint-disable-next-line no-redeclare
1770
- function navigate() {
1771
- if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'string') {
1772
- return {
1773
- type: 'NAVIGATE',
1774
- payload: {
1775
- name: arguments.length <= 0 ? undefined : arguments[0],
1776
- params: arguments.length <= 1 ? undefined : arguments[1]
1777
- }
1778
- };
1779
- } else {
1780
- var payload = (arguments.length <= 0 ? undefined : arguments[0]) || {};
1781
- if (!payload.hasOwnProperty('key') && !payload.hasOwnProperty('name')) {
1782
- throw new Error('You need to specify name or key when calling navigate with an object as the argument. See https://reactnavigation.org/docs/navigation-actions#navigate for usage.');
1783
- }
1784
- return {
1785
- type: 'NAVIGATE',
1786
- payload: payload
1787
- };
1788
- }
1789
- }
1790
- function reset(state) {
1791
- return {
1792
- type: 'RESET',
1793
- payload: state
1794
- };
1795
- }
1796
- function setParams(params) {
1797
- return {
1798
- type: 'SET_PARAMS',
1799
- payload: {
1800
- params: params
1801
- }
1802
- };
1803
- }
1804
- },"f1e0b3318f7f12bf2431",[]);
1805
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
1806
- Object.defineProperty(exports, "__esModule", {
1807
- value: true
1808
- });
1809
- exports.DrawerActions = undefined;
1810
- exports.default = DrawerRouter;
1811
- var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1]));
1812
- var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2]));
1813
- var _TabRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3]));
1814
- var _excluded = ["defaultStatus"];
1815
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
1816
- var DrawerActions = exports.DrawerActions = Object.assign({}, _TabRouter.TabActions, {
1817
- openDrawer: function openDrawer() {
1818
- return {
1819
- type: 'OPEN_DRAWER'
1820
- };
1821
- },
1822
- closeDrawer: function closeDrawer() {
1823
- return {
1824
- type: 'CLOSE_DRAWER'
1825
- };
1826
- },
1827
- toggleDrawer: function toggleDrawer() {
1828
- return {
1829
- type: 'TOGGLE_DRAWER'
1830
- };
1831
- }
1832
- });
1833
- function DrawerRouter(_ref) {
1834
- var _ref$defaultStatus = _ref.defaultStatus,
1835
- defaultStatus = _ref$defaultStatus === undefined ? 'closed' : _ref$defaultStatus,
1836
- rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
1837
- var router = (0, _TabRouter.default)(rest);
1838
- var isDrawerInHistory = function isDrawerInHistory(state) {
1839
- var _state$history;
1840
- return Boolean((_state$history = state.history) === null || _state$history === undefined ? undefined : _state$history.some(function (it) {
1841
- return it.type === 'drawer';
1842
- }));
1843
- };
1844
- var addDrawerToHistory = function addDrawerToHistory(state) {
1845
- if (isDrawerInHistory(state)) {
1846
- return state;
1847
- }
1848
- return Object.assign({}, state, {
1849
- history: [].concat((0, _toConsumableArray2.default)(state.history), [{
1850
- type: 'drawer',
1851
- status: defaultStatus === 'open' ? 'closed' : 'open'
1852
- }])
1853
- });
1854
- };
1855
- var removeDrawerFromHistory = function removeDrawerFromHistory(state) {
1856
- if (!isDrawerInHistory(state)) {
1857
- return state;
1858
- }
1859
- return Object.assign({}, state, {
1860
- history: state.history.filter(function (it) {
1861
- return it.type !== 'drawer';
1862
- })
1863
- });
1864
- };
1865
- var openDrawer = function openDrawer(state) {
1866
- if (defaultStatus === 'open') {
1867
- return removeDrawerFromHistory(state);
1868
- }
1869
- return addDrawerToHistory(state);
1870
- };
1871
- var closeDrawer = function closeDrawer(state) {
1872
- if (defaultStatus === 'open') {
1873
- return addDrawerToHistory(state);
1874
- }
1875
- return removeDrawerFromHistory(state);
1876
- };
1877
- return Object.assign({}, router, {
1878
- type: 'drawer',
1879
- getInitialState: function getInitialState(_ref2) {
1880
- var routeNames = _ref2.routeNames,
1881
- routeParamList = _ref2.routeParamList,
1882
- routeGetIdList = _ref2.routeGetIdList;
1883
- var state = router.getInitialState({
1884
- routeNames: routeNames,
1885
- routeParamList: routeParamList,
1886
- routeGetIdList: routeGetIdList
1887
- });
1888
- return Object.assign({}, state, {
1889
- default: defaultStatus,
1890
- stale: false,
1891
- type: 'drawer',
1892
- key: `drawer-${(0, _$$_REQUIRE(_dependencyMap[4]).nanoid)()}`
1893
- });
1894
- },
1895
- getRehydratedState: function getRehydratedState(partialState, _ref3) {
1896
- var routeNames = _ref3.routeNames,
1897
- routeParamList = _ref3.routeParamList,
1898
- routeGetIdList = _ref3.routeGetIdList;
1899
- if (partialState.stale === false) {
1900
- return partialState;
1901
- }
1902
- var state = router.getRehydratedState(partialState, {
1903
- routeNames: routeNames,
1904
- routeParamList: routeParamList,
1905
- routeGetIdList: routeGetIdList
1906
- });
1907
- if (isDrawerInHistory(partialState)) {
1908
- // Re-sync the drawer entry in history to correct it if it was wrong
1909
- state = removeDrawerFromHistory(state);
1910
- state = addDrawerToHistory(state);
1911
- }
1912
- return Object.assign({}, state, {
1913
- default: defaultStatus,
1914
- type: 'drawer',
1915
- key: `drawer-${(0, _$$_REQUIRE(_dependencyMap[4]).nanoid)()}`
1916
- });
1917
- },
1918
- getStateForRouteFocus: function getStateForRouteFocus(state, key) {
1919
- var result = router.getStateForRouteFocus(state, key);
1920
- return closeDrawer(result);
1921
- },
1922
- getStateForAction: function getStateForAction(state, action, options) {
1923
- switch (action.type) {
1924
- case 'OPEN_DRAWER':
1925
- return openDrawer(state);
1926
- case 'CLOSE_DRAWER':
1927
- return closeDrawer(state);
1928
- case 'TOGGLE_DRAWER':
1929
- if (isDrawerInHistory(state)) {
1930
- return removeDrawerFromHistory(state);
1931
- }
1932
- return addDrawerToHistory(state);
1933
- case 'JUMP_TO':
1934
- case 'NAVIGATE':
1935
- {
1936
- var result = router.getStateForAction(state, action, options);
1937
- if (result != null && result.index !== state.index) {
1938
- return closeDrawer(result);
1939
- }
1940
- return result;
1941
- }
1942
- case 'GO_BACK':
1943
- if (isDrawerInHistory(state)) {
1944
- return removeDrawerFromHistory(state);
1945
- }
1946
- return router.getStateForAction(state, action, options);
1947
- default:
1948
- return router.getStateForAction(state, action, options);
1949
- }
1950
- },
1951
- actionCreators: DrawerActions
1952
- });
1953
- }
1954
- },"4344b53816d7b780f3dd",["277a84013d7e1a1ace05","838d7a057beeb5db50df","a2c8e692f78bae5b8b98","20cc2f3e0ac4154b79f0","e03db9aacb1ee503cd26"]);
1955
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
1956
- function _interopRequireDefault(e) {
1957
- return e && e.__esModule ? e : {
1958
- "default": e
1959
- };
1960
- }
1961
- module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
1962
- },"277a84013d7e1a1ace05",[]);
1963
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
1964
- Object.defineProperty(exports, "__esModule", {
1965
- value: true
1966
- });
1967
- exports.TabActions = undefined;
1968
- exports.default = TabRouter;
1969
- var _BaseRouter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1]));
1970
- var TYPE_ROUTE = 'route';
1971
- var TabActions = exports.TabActions = {
1972
- jumpTo: function jumpTo(name, params) {
1973
- return {
1974
- type: 'JUMP_TO',
1975
- payload: {
1976
- name: name,
1977
- params: params
1978
- }
1979
- };
1980
- }
1981
- };
1982
- var getRouteHistory = function getRouteHistory(routes, index, backBehavior, initialRouteName) {
1983
- var history = [{
1984
- type: TYPE_ROUTE,
1985
- key: routes[index].key
1986
- }];
1987
- var initialRouteIndex;
1988
- switch (backBehavior) {
1989
- case 'order':
1990
- for (var i = index; i > 0; i--) {
1991
- history.unshift({
1992
- type: TYPE_ROUTE,
1993
- key: routes[i - 1].key
1994
- });
1995
- }
1996
- break;
1997
- case 'firstRoute':
1998
- if (index !== 0) {
1999
- history.unshift({
2000
- type: TYPE_ROUTE,
2001
- key: routes[0].key
2002
- });
2003
- }
2004
- break;
2005
- case 'initialRoute':
2006
- initialRouteIndex = routes.findIndex(function (route) {
2007
- return route.name === initialRouteName;
2008
- });
2009
- initialRouteIndex = initialRouteIndex === -1 ? 0 : initialRouteIndex;
2010
- if (index !== initialRouteIndex) {
2011
- history.unshift({
2012
- type: TYPE_ROUTE,
2013
- key: routes[initialRouteIndex].key
2014
- });
2015
- }
2016
- break;
2017
- case 'history':
2018
- // The history will fill up on navigation
2019
- break;
2020
- }
2021
- return history;
2022
- };
2023
- var changeIndex = function changeIndex(state, index, backBehavior, initialRouteName) {
2024
- var history;
2025
- if (backBehavior === 'history') {
2026
- var currentKey = state.routes[index].key;
2027
- history = state.history.filter(function (it) {
2028
- return it.type === 'route' ? it.key !== currentKey : false;
2029
- }).concat({
2030
- type: TYPE_ROUTE,
2031
- key: currentKey
2032
- });
2033
- } else {
2034
- history = getRouteHistory(state.routes, index, backBehavior, initialRouteName);
2035
- }
2036
- return Object.assign({}, state, {
2037
- index: index,
2038
- history: history
2039
- });
2040
- };
2041
- function TabRouter(_ref) {
2042
- var initialRouteName = _ref.initialRouteName,
2043
- _ref$backBehavior = _ref.backBehavior,
2044
- backBehavior = _ref$backBehavior === undefined ? 'firstRoute' : _ref$backBehavior;
2045
- var router = Object.assign({}, _BaseRouter.default, {
2046
- type: 'tab',
2047
- getInitialState: function getInitialState(_ref2) {
2048
- var routeNames = _ref2.routeNames,
2049
- routeParamList = _ref2.routeParamList;
2050
- var index = initialRouteName !== undefined && routeNames.includes(initialRouteName) ? routeNames.indexOf(initialRouteName) : 0;
2051
- var routes = routeNames.map(function (name) {
2052
- return {
2053
- name: name,
2054
- key: `${name}-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
2055
- params: routeParamList[name]
2056
- };
2057
- });
2058
- var history = getRouteHistory(routes, index, backBehavior, initialRouteName);
2059
- return {
2060
- stale: false,
2061
- type: 'tab',
2062
- key: `tab-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
2063
- index: index,
2064
- routeNames: routeNames,
2065
- history: history,
2066
- routes: routes
2067
- };
2068
- },
2069
- getRehydratedState: function getRehydratedState(partialState, _ref3) {
2070
- var _ref4, _ref5;
2071
- var routeNames = _ref3.routeNames,
2072
- routeParamList = _ref3.routeParamList;
2073
- var _state$routes, _state$history;
2074
- var state = partialState;
2075
- if (state.stale === false) {
2076
- return state;
2077
- }
2078
- var routes = routeNames.map(function (name) {
2079
- var route = state.routes.find(function (r) {
2080
- return r.name === name;
2081
- });
2082
- return Object.assign({}, route, {
2083
- name: name,
2084
- key: route && route.name === name && route.key ? route.key : `${name}-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
2085
- params: routeParamList[name] !== undefined ? Object.assign({}, routeParamList[name], route ? route.params : undefined) : route ? route.params : undefined
2086
- });
2087
- });
2088
- var index = Math.min(Math.max(routeNames.indexOf((_state$routes = state.routes[(_ref4 = state === null || state === undefined ? undefined : state.index) != null ? _ref4 : 0]) === null || _state$routes === undefined ? undefined : _state$routes.name), 0), routes.length - 1);
2089
- var history = (_ref5 = (_state$history = state.history) === null || _state$history === undefined ? undefined : _state$history.filter(function (it) {
2090
- return routes.find(function (r) {
2091
- return r.key === it.key;
2092
- });
2093
- })) != null ? _ref5 : [];
2094
- return changeIndex({
2095
- stale: false,
2096
- type: 'tab',
2097
- key: `tab-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
2098
- index: index,
2099
- routeNames: routeNames,
2100
- history: history,
2101
- routes: routes
2102
- }, index, backBehavior, initialRouteName);
2103
- },
2104
- getStateForRouteNamesChange: function getStateForRouteNamesChange(state, _ref6) {
2105
- var routeNames = _ref6.routeNames,
2106
- routeParamList = _ref6.routeParamList,
2107
- routeKeyChanges = _ref6.routeKeyChanges;
2108
- var routes = routeNames.map(function (name) {
2109
- return state.routes.find(function (r) {
2110
- return r.name === name && !routeKeyChanges.includes(r.name);
2111
- }) || {
2112
- name: name,
2113
- key: `${name}-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
2114
- params: routeParamList[name]
2115
- };
2116
- });
2117
- var index = Math.max(0, routeNames.indexOf(state.routes[state.index].name));
2118
- var history = state.history.filter(
2119
- // Type will always be 'route' for tabs, but could be different in a router extending this (e.g. drawer)
2120
- function (it) {
2121
- return it.type !== 'route' || routes.find(function (r) {
2122
- return r.key === it.key;
2123
- });
2124
- });
2125
- if (!history.length) {
2126
- history = getRouteHistory(routes, index, backBehavior, initialRouteName);
2127
- }
2128
- return Object.assign({}, state, {
2129
- history: history,
2130
- routeNames: routeNames,
2131
- routes: routes,
2132
- index: index
2133
- });
2134
- },
2135
- getStateForRouteFocus: function getStateForRouteFocus(state, key) {
2136
- var index = state.routes.findIndex(function (r) {
2137
- return r.key === key;
2138
- });
2139
- if (index === -1 || index === state.index) {
2140
- return state;
2141
- }
2142
- return changeIndex(state, index, backBehavior, initialRouteName);
2143
- },
2144
- getStateForAction: function getStateForAction(state, action, _ref7) {
2145
- var routeParamList = _ref7.routeParamList,
2146
- routeGetIdList = _ref7.routeGetIdList;
2147
- switch (action.type) {
2148
- case 'JUMP_TO':
2149
- case 'NAVIGATE':
2150
- {
2151
- var index = -1;
2152
- if (action.type === 'NAVIGATE' && action.payload.key) {
2153
- index = state.routes.findIndex(function (route) {
2154
- return route.key === action.payload.key;
2155
- });
2156
- } else {
2157
- index = state.routes.findIndex(function (route) {
2158
- return route.name === action.payload.name;
2159
- });
2160
- }
2161
- if (index === -1) {
2162
- return null;
2163
- }
2164
- return changeIndex(Object.assign({}, state, {
2165
- routes: state.routes.map(function (route, i) {
2166
- if (i !== index) {
2167
- return route;
2168
- }
2169
- var getId = routeGetIdList[route.name];
2170
- var currentId = getId === null || getId === undefined ? undefined : getId({
2171
- params: route.params
2172
- });
2173
- var nextId = getId === null || getId === undefined ? undefined : getId({
2174
- params: action.payload.params
2175
- });
2176
- var key = currentId === nextId ? route.key : `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`;
2177
- var params;
2178
- if (action.type === 'NAVIGATE' && action.payload.merge && currentId === nextId) {
2179
- params = action.payload.params !== undefined || routeParamList[route.name] !== undefined ? Object.assign({}, routeParamList[route.name], route.params, action.payload.params) : route.params;
2180
- } else {
2181
- params = routeParamList[route.name] !== undefined ? Object.assign({}, routeParamList[route.name], action.payload.params) : action.payload.params;
2182
- }
2183
- var path = action.type === 'NAVIGATE' && action.payload.path != null ? action.payload.path : route.path;
2184
- return params !== route.params || path !== route.path ? Object.assign({}, route, {
2185
- key: key,
2186
- path: path,
2187
- params: params
2188
- }) : route;
2189
- })
2190
- }), index, backBehavior, initialRouteName);
2191
- }
2192
- case 'GO_BACK':
2193
- {
2194
- if (state.history.length === 1) {
2195
- return null;
2196
- }
2197
- var previousKey = state.history[state.history.length - 2].key;
2198
- var _index = state.routes.findIndex(function (route) {
2199
- return route.key === previousKey;
2200
- });
2201
- if (_index === -1) {
2202
- return null;
2203
- }
2204
- return Object.assign({}, state, {
2205
- history: state.history.slice(0, -1),
2206
- index: _index
2207
- });
2208
- }
2209
- default:
2210
- return _BaseRouter.default.getStateForAction(state, action);
2211
- }
2212
- },
2213
- shouldActionChangeFocus: function shouldActionChangeFocus(action) {
2214
- return action.type === 'NAVIGATE';
2215
- },
2216
- actionCreators: TabActions
2217
- });
2218
- return router;
2219
- }
2220
- },"20cc2f3e0ac4154b79f0",["277a84013d7e1a1ace05","95ae28b023658c6d2aff","e03db9aacb1ee503cd26"]);
2221
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
2222
- Object.defineProperty(exports, "__esModule", {
2223
- value: true
2224
- });
2225
- exports.StackActions = undefined;
2226
- exports.default = StackRouter;
2227
- var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1]));
2228
- var _BaseRouter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2]));
2229
- var StackActions = exports.StackActions = {
2230
- replace: function replace(name, params) {
2231
- return {
2232
- type: 'REPLACE',
2233
- payload: {
2234
- name: name,
2235
- params: params
2236
- }
2237
- };
2238
- },
2239
- push: function push(name, params) {
2240
- return {
2241
- type: 'PUSH',
2242
- payload: {
2243
- name: name,
2244
- params: params
2245
- }
2246
- };
2247
- },
2248
- pop: function pop() {
2249
- var count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
2250
- return {
2251
- type: 'POP',
2252
- payload: {
2253
- count: count
2254
- }
2255
- };
2256
- },
2257
- popToTop: function popToTop() {
2258
- return {
2259
- type: 'POP_TO_TOP'
2260
- };
2261
- }
2262
- };
2263
- function StackRouter(options) {
2264
- var router = Object.assign({}, _BaseRouter.default, {
2265
- type: 'stack',
2266
- getInitialState: function getInitialState(_ref) {
2267
- var routeNames = _ref.routeNames,
2268
- routeParamList = _ref.routeParamList;
2269
- var initialRouteName = options.initialRouteName !== undefined && routeNames.includes(options.initialRouteName) ? options.initialRouteName : routeNames[0];
2270
- return {
2271
- stale: false,
2272
- type: 'stack',
2273
- key: `stack-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
2274
- index: 0,
2275
- routeNames: routeNames,
2276
- routes: [{
2277
- key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
2278
- name: initialRouteName,
2279
- params: routeParamList[initialRouteName]
2280
- }]
2281
- };
2282
- },
2283
- getRehydratedState: function getRehydratedState(partialState, _ref2) {
2284
- var routeNames = _ref2.routeNames,
2285
- routeParamList = _ref2.routeParamList;
2286
- var state = partialState;
2287
- if (state.stale === false) {
2288
- return state;
2289
- }
2290
- var routes = state.routes.filter(function (route) {
2291
- return routeNames.includes(route.name);
2292
- }).map(function (route) {
2293
- return Object.assign({}, route, {
2294
- key: route.key || `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
2295
- params: routeParamList[route.name] !== undefined ? Object.assign({}, routeParamList[route.name], route.params) : route.params
2296
- });
2297
- });
2298
- if (routes.length === 0) {
2299
- var initialRouteName = options.initialRouteName !== undefined ? options.initialRouteName : routeNames[0];
2300
- routes.push({
2301
- key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
2302
- name: initialRouteName,
2303
- params: routeParamList[initialRouteName]
2304
- });
2305
- }
2306
- return {
2307
- stale: false,
2308
- type: 'stack',
2309
- key: `stack-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
2310
- index: routes.length - 1,
2311
- routeNames: routeNames,
2312
- routes: routes
2313
- };
2314
- },
2315
- getStateForRouteNamesChange: function getStateForRouteNamesChange(state, _ref3) {
2316
- var routeNames = _ref3.routeNames,
2317
- routeParamList = _ref3.routeParamList,
2318
- routeKeyChanges = _ref3.routeKeyChanges;
2319
- var routes = state.routes.filter(function (route) {
2320
- return routeNames.includes(route.name) && !routeKeyChanges.includes(route.name);
2321
- });
2322
- if (routes.length === 0) {
2323
- var initialRouteName = options.initialRouteName !== undefined && routeNames.includes(options.initialRouteName) ? options.initialRouteName : routeNames[0];
2324
- routes.push({
2325
- key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
2326
- name: initialRouteName,
2327
- params: routeParamList[initialRouteName]
2328
- });
2329
- }
2330
- return Object.assign({}, state, {
2331
- routeNames: routeNames,
2332
- routes: routes,
2333
- index: Math.min(state.index, routes.length - 1)
2334
- });
2335
- },
2336
- getStateForRouteFocus: function getStateForRouteFocus(state, key) {
2337
- var index = state.routes.findIndex(function (r) {
2338
- return r.key === key;
2339
- });
2340
- if (index === -1 || index === state.index) {
2341
- return state;
2342
- }
2343
- return Object.assign({}, state, {
2344
- index: index,
2345
- routes: state.routes.slice(0, index + 1)
2346
- });
2347
- },
2348
- getStateForAction: function getStateForAction(state, action, options) {
2349
- var routeParamList = options.routeParamList;
2350
- switch (action.type) {
2351
- case 'REPLACE':
2352
- {
2353
- var index = action.target === state.key && action.source ? state.routes.findIndex(function (r) {
2354
- return r.key === action.source;
2355
- }) : state.index;
2356
- if (index === -1) {
2357
- return null;
2358
- }
2359
- var _action$payload = action.payload,
2360
- name = _action$payload.name,
2361
- key = _action$payload.key,
2362
- params = _action$payload.params;
2363
- if (!state.routeNames.includes(name)) {
2364
- return null;
2365
- }
2366
- return Object.assign({}, state, {
2367
- routes: state.routes.map(function (route, i) {
2368
- return i === index ? {
2369
- key: key !== undefined ? key : `${name}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
2370
- name: name,
2371
- params: routeParamList[name] !== undefined ? Object.assign({}, routeParamList[name], params) : params
2372
- } : route;
2373
- })
2374
- });
2375
- }
2376
- case 'PUSH':
2377
- if (state.routeNames.includes(action.payload.name)) {
2378
- var getId = options.routeGetIdList[action.payload.name];
2379
- var id = getId === null || getId === undefined ? undefined : getId({
2380
- params: action.payload.params
2381
- });
2382
- var route = id ? state.routes.find(function (route) {
2383
- return route.name === action.payload.name && id === (getId === null || getId === undefined ? undefined : getId({
2384
- params: route.params
2385
- }));
2386
- }) : undefined;
2387
- var routes;
2388
- if (route) {
2389
- routes = state.routes.filter(function (r) {
2390
- return r.key !== route.key;
2391
- });
2392
- routes.push(Object.assign({}, route, {
2393
- params: routeParamList[action.payload.name] !== undefined ? Object.assign({}, routeParamList[action.payload.name], action.payload.params) : action.payload.params
2394
- }));
2395
- } else {
2396
- routes = [].concat((0, _toConsumableArray2.default)(state.routes), [{
2397
- key: `${action.payload.name}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
2398
- name: action.payload.name,
2399
- params: routeParamList[action.payload.name] !== undefined ? Object.assign({}, routeParamList[action.payload.name], action.payload.params) : action.payload.params
2400
- }]);
2401
- }
2402
- return Object.assign({}, state, {
2403
- index: routes.length - 1,
2404
- routes: routes
2405
- });
2406
- }
2407
- return null;
2408
- case 'POP':
2409
- {
2410
- var _index = action.target === state.key && action.source ? state.routes.findIndex(function (r) {
2411
- return r.key === action.source;
2412
- }) : state.index;
2413
- if (_index > 0) {
2414
- var count = Math.max(_index - action.payload.count + 1, 1);
2415
- var _routes = state.routes.slice(0, count).concat(state.routes.slice(_index + 1));
2416
- return Object.assign({}, state, {
2417
- index: _routes.length - 1,
2418
- routes: _routes
2419
- });
2420
- }
2421
- return null;
2422
- }
2423
- case 'POP_TO_TOP':
2424
- return router.getStateForAction(state, {
2425
- type: 'POP',
2426
- payload: {
2427
- count: state.routes.length - 1
2428
- }
2429
- }, options);
2430
- case 'NAVIGATE':
2431
- if (action.payload.name !== undefined && !state.routeNames.includes(action.payload.name)) {
2432
- return null;
2433
- }
2434
- if (action.payload.key || action.payload.name) {
2435
- var _action$payload$path;
2436
- // If the route already exists, navigate to that
2437
- var _index2 = -1;
2438
- var _getId =
2439
- // `getId` and `key` can't be used together
2440
- action.payload.key === undefined && action.payload.name !== undefined ? options.routeGetIdList[action.payload.name] : undefined;
2441
- var _id = _getId === null || _getId === undefined ? undefined : _getId({
2442
- params: action.payload.params
2443
- });
2444
- if (_id) {
2445
- _index2 = state.routes.findIndex(function (route) {
2446
- return route.name === action.payload.name && _id === (_getId === null || _getId === undefined ? undefined : _getId({
2447
- params: route.params
2448
- }));
2449
- });
2450
- } else if (state.routes[state.index].name === action.payload.name && action.payload.key === undefined || state.routes[state.index].key === action.payload.key) {
2451
- _index2 = state.index;
2452
- } else {
2453
- for (var i = state.routes.length - 1; i >= 0; i--) {
2454
- if (state.routes[i].name === action.payload.name && action.payload.key === undefined || state.routes[i].key === action.payload.key) {
2455
- _index2 = i;
2456
- break;
2457
- }
2458
- }
2459
- }
2460
- if (_index2 === -1 && action.payload.key && action.payload.name === undefined) {
2461
- return null;
2462
- }
2463
- if (_index2 === -1 && action.payload.name !== undefined) {
2464
- var _action$payload$key;
2465
- var _routes2 = [].concat((0, _toConsumableArray2.default)(state.routes), [{
2466
- key: (_action$payload$key = action.payload.key) != null ? _action$payload$key : `${action.payload.name}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
2467
- name: action.payload.name,
2468
- path: action.payload.path,
2469
- params: routeParamList[action.payload.name] !== undefined ? Object.assign({}, routeParamList[action.payload.name], action.payload.params) : action.payload.params
2470
- }]);
2471
- return Object.assign({}, state, {
2472
- routes: _routes2,
2473
- index: _routes2.length - 1
2474
- });
2475
- }
2476
- var _route = state.routes[_index2];
2477
- var _params;
2478
- if (action.payload.merge) {
2479
- _params = action.payload.params !== undefined || routeParamList[_route.name] !== undefined ? Object.assign({}, routeParamList[_route.name], _route.params, action.payload.params) : _route.params;
2480
- } else {
2481
- _params = routeParamList[_route.name] !== undefined ? Object.assign({}, routeParamList[_route.name], action.payload.params) : action.payload.params;
2482
- }
2483
- return Object.assign({}, state, {
2484
- index: _index2,
2485
- routes: [].concat((0, _toConsumableArray2.default)(state.routes.slice(0, _index2)), [_params !== _route.params || action.payload.path && action.payload.path !== _route.path ? Object.assign({}, _route, {
2486
- path: (_action$payload$path = action.payload.path) != null ? _action$payload$path : _route.path,
2487
- params: _params
2488
- }) : state.routes[_index2]])
2489
- });
2490
- }
2491
- return null;
2492
- case 'GO_BACK':
2493
- if (state.index > 0) {
2494
- return router.getStateForAction(state, {
2495
- type: 'POP',
2496
- payload: {
2497
- count: 1
2498
- },
2499
- target: action.target,
2500
- source: action.source
2501
- }, options);
2502
- }
2503
- return null;
2504
- default:
2505
- return _BaseRouter.default.getStateForAction(state, action);
2506
- }
2507
- },
2508
- actionCreators: StackActions
2509
- });
2510
- return router;
2511
- }
2512
- },"94f0b8bb0225084df7a9",["277a84013d7e1a1ace05","838d7a057beeb5db50df","95ae28b023658c6d2aff","e03db9aacb1ee503cd26"]);
2513
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
2514
- Object.defineProperty(exports, "__esModule", {
2515
- value: true
2516
- });
2517
- var _exportNames = {
2518
- CommonActions: true,
2519
- BaseRouter: true,
2520
- DrawerActions: true,
2521
- DrawerRouter: true,
2522
- StackActions: true,
2523
- StackRouter: true,
2524
- TabActions: true,
2525
- TabRouter: true
2526
- };
2527
- Object.defineProperty(exports, "BaseRouter", {
2528
- enumerable: true,
2529
- get: function get() {
2530
- return _BaseRouter.default;
2531
- }
2532
- });
2533
- exports.CommonActions = undefined;
2534
- Object.defineProperty(exports, "DrawerActions", {
2535
- enumerable: true,
2536
- get: function get() {
2537
- return _DrawerRouter.DrawerActions;
2538
- }
2539
- });
2540
- Object.defineProperty(exports, "DrawerRouter", {
2541
- enumerable: true,
2542
- get: function get() {
2543
- return _DrawerRouter.default;
2544
- }
2545
- });
2546
- Object.defineProperty(exports, "StackActions", {
2547
- enumerable: true,
2548
- get: function get() {
2549
- return _StackRouter.StackActions;
2550
- }
2551
- });
2552
- Object.defineProperty(exports, "StackRouter", {
2553
- enumerable: true,
2554
- get: function get() {
2555
- return _StackRouter.default;
2556
- }
2557
- });
2558
- Object.defineProperty(exports, "TabActions", {
2559
- enumerable: true,
2560
- get: function get() {
2561
- return _TabRouter.TabActions;
2562
- }
2563
- });
2564
- Object.defineProperty(exports, "TabRouter", {
2565
- enumerable: true,
2566
- get: function get() {
2567
- return _TabRouter.default;
2568
- }
2569
- });
2570
- var CommonActions = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0]));
2571
- exports.CommonActions = CommonActions;
2572
- var _BaseRouter = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2]));
2573
- var _DrawerRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3]));
2574
- var _StackRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4]));
2575
- var _TabRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5]));
2576
- Object.keys(_$$_REQUIRE(_dependencyMap[6])).forEach(function (key) {
2577
- if (key === "default" || key === "__esModule") return;
2578
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
2579
- if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[6])[key]) return;
2580
- Object.defineProperty(exports, key, {
2581
- enumerable: true,
2582
- get: function get() {
2583
- return _$$_REQUIRE(_dependencyMap[6])[key];
2584
- }
2585
- });
2586
- });
2587
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
2588
- },"36fad61dee5e550281f1",["f1e0b3318f7f12bf2431","277a84013d7e1a1ace05","95ae28b023658c6d2aff","4344b53816d7b780f3dd","94f0b8bb0225084df7a9","20cc2f3e0ac4154b79f0","e32e355e493ded18598c"]);
2589
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
2590
- Object.defineProperty(exports, "__esModule", {
2591
- value: true
2592
- });
2593
- },"e32e355e493ded18598c",[]);
2594
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
2595
- Object.defineProperty(exports, "__esModule", {
2596
- value: true
2597
- });
2598
- exports.default = undefined;
2599
- /**
2600
- * Base router object that can be used when writing custom routers.
2601
- * This provides few helper methods to handle common actions such as `RESET`.
2602
- */
2603
- var BaseRouter = {
2604
- getStateForAction: function getStateForAction(state, action) {
2605
- switch (action.type) {
2606
- case 'SET_PARAMS':
2607
- {
2608
- var index = action.source ? state.routes.findIndex(function (r) {
2609
- return r.key === action.source;
2610
- }) : state.index;
2611
- if (index === -1) {
2612
- return null;
2613
- }
2614
- return Object.assign({}, state, {
2615
- routes: state.routes.map(function (r, i) {
2616
- return i === index ? Object.assign({}, r, {
2617
- params: Object.assign({}, r.params, action.payload.params)
2618
- }) : r;
2619
- })
2620
- });
2621
- }
2622
- case 'RESET':
2623
- {
2624
- var nextState = action.payload;
2625
- if (nextState.routes.length === 0 || nextState.routes.some(function (route) {
2626
- return !state.routeNames.includes(route.name);
2627
- })) {
2628
- return null;
2629
- }
2630
- if (nextState.stale === false) {
2631
- if (state.routeNames.length !== nextState.routeNames.length || nextState.routeNames.some(function (name) {
2632
- return !state.routeNames.includes(name);
2633
- })) {
2634
- return null;
2635
- }
2636
- return Object.assign({}, nextState, {
2637
- routes: nextState.routes.map(function (route) {
2638
- return route.key ? route : Object.assign({}, route, {
2639
- key: `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[0]).nanoid)()}`
2640
- });
2641
- })
2642
- });
2643
- }
2644
- return nextState;
2645
- }
2646
- default:
2647
- return null;
2648
- }
2649
- },
2650
- shouldActionChangeFocus: function shouldActionChangeFocus(action) {
2651
- return action.type === 'NAVIGATE';
2652
- }
2653
- };
2654
- var _default = exports.default = BaseRouter;
2655
- },"58153a28fc8e098e8bbf",["e03db9aacb1ee503cd26"]);
2656
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
2657
- Object.defineProperty(exports, "__esModule", {
2658
- value: true
2659
- });
2660
- exports.goBack = goBack;
2661
- exports.navigate = navigate;
2662
- exports.reset = reset;
2663
- exports.setParams = setParams;
2664
- function goBack() {
2665
- return {
2666
- type: 'GO_BACK'
2667
- };
2668
- }
2669
-
2670
- // eslint-disable-next-line no-redeclare
2671
-
2672
- // eslint-disable-next-line no-redeclare
2673
- function navigate() {
2674
- if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'string') {
2675
- return {
2676
- type: 'NAVIGATE',
2677
- payload: {
2678
- name: arguments.length <= 0 ? undefined : arguments[0],
2679
- params: arguments.length <= 1 ? undefined : arguments[1]
2680
- }
2681
- };
2682
- } else {
2683
- var payload = (arguments.length <= 0 ? undefined : arguments[0]) || {};
2684
- if (!payload.hasOwnProperty('key') && !payload.hasOwnProperty('name')) {
2685
- throw new Error('You need to specify name or key when calling navigate with an object as the argument. See https://reactnavigation.org/docs/navigation-actions#navigate for usage.');
2686
- }
2687
- return {
2688
- type: 'NAVIGATE',
2689
- payload: payload
2690
- };
2691
- }
2692
- }
2693
- function reset(state) {
2694
- return {
2695
- type: 'RESET',
2696
- payload: state
2697
- };
2698
- }
2699
- function setParams(params) {
2700
- return {
2701
- type: 'SET_PARAMS',
2702
- payload: {
2703
- params: params
2704
- }
2705
- };
2706
- }
2707
- },"44010d2886624e71e726",[]);
2708
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
2709
- Object.defineProperty(exports, "__esModule", {
2710
- value: true
2711
- });
2712
- exports.DrawerActions = undefined;
2713
- exports.default = DrawerRouter;
2714
- var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1]));
2715
- var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2]));
2716
- var _TabRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3]));
2717
- var _excluded = ["defaultStatus"];
2718
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
2719
- var DrawerActions = exports.DrawerActions = Object.assign({}, _TabRouter.TabActions, {
2720
- openDrawer: function openDrawer() {
2721
- return {
2722
- type: 'OPEN_DRAWER'
2723
- };
2724
- },
2725
- closeDrawer: function closeDrawer() {
2726
- return {
2727
- type: 'CLOSE_DRAWER'
2728
- };
2729
- },
2730
- toggleDrawer: function toggleDrawer() {
2731
- return {
2732
- type: 'TOGGLE_DRAWER'
2733
- };
2734
- }
2735
- });
2736
- function DrawerRouter(_ref) {
2737
- var _ref$defaultStatus = _ref.defaultStatus,
2738
- defaultStatus = _ref$defaultStatus === undefined ? 'closed' : _ref$defaultStatus,
2739
- rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
2740
- var router = (0, _TabRouter.default)(rest);
2741
- var isDrawerInHistory = function isDrawerInHistory(state) {
2742
- var _state$history;
2743
- return Boolean((_state$history = state.history) == null ? undefined : _state$history.some(function (it) {
2744
- return it.type === 'drawer';
2745
- }));
2746
- };
2747
- var addDrawerToHistory = function addDrawerToHistory(state) {
2748
- if (isDrawerInHistory(state)) {
2749
- return state;
2750
- }
2751
- return Object.assign({}, state, {
2752
- history: [].concat((0, _toConsumableArray2.default)(state.history), [{
2753
- type: 'drawer',
2754
- status: defaultStatus === 'open' ? 'closed' : 'open'
2755
- }])
2756
- });
2757
- };
2758
- var removeDrawerFromHistory = function removeDrawerFromHistory(state) {
2759
- if (!isDrawerInHistory(state)) {
2760
- return state;
2761
- }
2762
- return Object.assign({}, state, {
2763
- history: state.history.filter(function (it) {
2764
- return it.type !== 'drawer';
2765
- })
2766
- });
2767
- };
2768
- var openDrawer = function openDrawer(state) {
2769
- if (defaultStatus === 'open') {
2770
- return removeDrawerFromHistory(state);
2771
- }
2772
- return addDrawerToHistory(state);
2773
- };
2774
- var closeDrawer = function closeDrawer(state) {
2775
- if (defaultStatus === 'open') {
2776
- return addDrawerToHistory(state);
2777
- }
2778
- return removeDrawerFromHistory(state);
2779
- };
2780
- return Object.assign({}, router, {
2781
- type: 'drawer',
2782
- getInitialState: function getInitialState(_ref2) {
2783
- var routeNames = _ref2.routeNames,
2784
- routeParamList = _ref2.routeParamList,
2785
- routeGetIdList = _ref2.routeGetIdList;
2786
- var state = router.getInitialState({
2787
- routeNames: routeNames,
2788
- routeParamList: routeParamList,
2789
- routeGetIdList: routeGetIdList
2790
- });
2791
- return Object.assign({}, state, {
2792
- default: defaultStatus,
2793
- stale: false,
2794
- type: 'drawer',
2795
- key: `drawer-${(0, _$$_REQUIRE(_dependencyMap[4]).nanoid)()}`
2796
- });
2797
- },
2798
- getRehydratedState: function getRehydratedState(partialState, _ref3) {
2799
- var routeNames = _ref3.routeNames,
2800
- routeParamList = _ref3.routeParamList,
2801
- routeGetIdList = _ref3.routeGetIdList;
2802
- if (partialState.stale === false) {
2803
- return partialState;
2804
- }
2805
- var state = router.getRehydratedState(partialState, {
2806
- routeNames: routeNames,
2807
- routeParamList: routeParamList,
2808
- routeGetIdList: routeGetIdList
2809
- });
2810
- if (isDrawerInHistory(partialState)) {
2811
- // Re-sync the drawer entry in history to correct it if it was wrong
2812
- state = removeDrawerFromHistory(state);
2813
- state = addDrawerToHistory(state);
2814
- }
2815
- return Object.assign({}, state, {
2816
- default: defaultStatus,
2817
- type: 'drawer',
2818
- key: `drawer-${(0, _$$_REQUIRE(_dependencyMap[4]).nanoid)()}`
2819
- });
2820
- },
2821
- getStateForRouteFocus: function getStateForRouteFocus(state, key) {
2822
- var result = router.getStateForRouteFocus(state, key);
2823
- return closeDrawer(result);
2824
- },
2825
- getStateForAction: function getStateForAction(state, action, options) {
2826
- switch (action.type) {
2827
- case 'OPEN_DRAWER':
2828
- return openDrawer(state);
2829
- case 'CLOSE_DRAWER':
2830
- return closeDrawer(state);
2831
- case 'TOGGLE_DRAWER':
2832
- if (isDrawerInHistory(state)) {
2833
- return removeDrawerFromHistory(state);
2834
- }
2835
- return addDrawerToHistory(state);
2836
- case 'JUMP_TO':
2837
- case 'NAVIGATE':
2838
- {
2839
- var result = router.getStateForAction(state, action, options);
2840
- if (result != null && result.index !== state.index) {
2841
- return closeDrawer(result);
2842
- }
2843
- return result;
2844
- }
2845
- case 'GO_BACK':
2846
- if (isDrawerInHistory(state)) {
2847
- return removeDrawerFromHistory(state);
2848
- }
2849
- return router.getStateForAction(state, action, options);
2850
- default:
2851
- return router.getStateForAction(state, action, options);
2852
- }
2853
- },
2854
- actionCreators: DrawerActions
2855
- });
2856
- }
2857
- },"68ee2377a6ca7029997f",["277a84013d7e1a1ace05","838d7a057beeb5db50df","a2c8e692f78bae5b8b98","46e9b616ece3d5066957","e03db9aacb1ee503cd26"]);
2858
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
2859
- Object.defineProperty(exports, "__esModule", {
2860
- value: true
2861
- });
2862
- exports.TabActions = undefined;
2863
- exports.default = TabRouter;
2864
- var _BaseRouter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1]));
2865
- var TYPE_ROUTE = 'route';
2866
- var TabActions = exports.TabActions = {
2867
- jumpTo: function jumpTo(name, params) {
2868
- return {
2869
- type: 'JUMP_TO',
2870
- payload: {
2871
- name: name,
2872
- params: params
2873
- }
2874
- };
2875
- }
2876
- };
2877
- var getRouteHistory = function getRouteHistory(routes, index, backBehavior, initialRouteName) {
2878
- var history = [{
2879
- type: TYPE_ROUTE,
2880
- key: routes[index].key
2881
- }];
2882
- var initialRouteIndex;
2883
- switch (backBehavior) {
2884
- case 'order':
2885
- for (var i = index; i > 0; i--) {
2886
- history.unshift({
2887
- type: TYPE_ROUTE,
2888
- key: routes[i - 1].key
2889
- });
2890
- }
2891
- break;
2892
- case 'firstRoute':
2893
- if (index !== 0) {
2894
- history.unshift({
2895
- type: TYPE_ROUTE,
2896
- key: routes[0].key
2897
- });
2898
- }
2899
- break;
2900
- case 'initialRoute':
2901
- initialRouteIndex = routes.findIndex(function (route) {
2902
- return route.name === initialRouteName;
2903
- });
2904
- initialRouteIndex = initialRouteIndex === -1 ? 0 : initialRouteIndex;
2905
- if (index !== initialRouteIndex) {
2906
- history.unshift({
2907
- type: TYPE_ROUTE,
2908
- key: routes[initialRouteIndex].key
2909
- });
2910
- }
2911
- break;
2912
- case 'history':
2913
- // The history will fill up on navigation
2914
- break;
2915
- }
2916
- return history;
2917
- };
2918
- var changeIndex = function changeIndex(state, index, backBehavior, initialRouteName) {
2919
- var history;
2920
- if (backBehavior === 'history') {
2921
- var currentKey = state.routes[index].key;
2922
- history = state.history.filter(function (it) {
2923
- return it.type === 'route' ? it.key !== currentKey : false;
2924
- }).concat({
2925
- type: TYPE_ROUTE,
2926
- key: currentKey
2927
- });
2928
- } else {
2929
- history = getRouteHistory(state.routes, index, backBehavior, initialRouteName);
2930
- }
2931
- return Object.assign({}, state, {
2932
- index: index,
2933
- history: history
2934
- });
2935
- };
2936
- function TabRouter(_ref) {
2937
- var initialRouteName = _ref.initialRouteName,
2938
- _ref$backBehavior = _ref.backBehavior,
2939
- backBehavior = _ref$backBehavior === undefined ? 'firstRoute' : _ref$backBehavior;
2940
- var router = Object.assign({}, _BaseRouter.default, {
2941
- type: 'tab',
2942
- getInitialState: function getInitialState(_ref2) {
2943
- var routeNames = _ref2.routeNames,
2944
- routeParamList = _ref2.routeParamList;
2945
- var index = initialRouteName !== undefined && routeNames.includes(initialRouteName) ? routeNames.indexOf(initialRouteName) : 0;
2946
- var routes = routeNames.map(function (name) {
2947
- return {
2948
- name: name,
2949
- key: `${name}-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
2950
- params: routeParamList[name]
2951
- };
2952
- });
2953
- var history = getRouteHistory(routes, index, backBehavior, initialRouteName);
2954
- return {
2955
- stale: false,
2956
- type: 'tab',
2957
- key: `tab-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
2958
- index: index,
2959
- routeNames: routeNames,
2960
- history: history,
2961
- routes: routes
2962
- };
2963
- },
2964
- getRehydratedState: function getRehydratedState(partialState, _ref3) {
2965
- var _state$routes, _state$index, _state$history$filter, _state$history;
2966
- var routeNames = _ref3.routeNames,
2967
- routeParamList = _ref3.routeParamList;
2968
- var state = partialState;
2969
- if (state.stale === false) {
2970
- return state;
2971
- }
2972
- var routes = routeNames.map(function (name) {
2973
- var route = state.routes.find(function (r) {
2974
- return r.name === name;
2975
- });
2976
- return Object.assign({}, route, {
2977
- name: name,
2978
- key: route && route.name === name && route.key ? route.key : `${name}-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
2979
- params: routeParamList[name] !== undefined ? Object.assign({}, routeParamList[name], route ? route.params : undefined) : route ? route.params : undefined
2980
- });
2981
- });
2982
- var index = Math.min(Math.max(routeNames.indexOf((_state$routes = state.routes[(_state$index = state == null ? undefined : state.index) != null ? _state$index : 0]) == null ? undefined : _state$routes.name), 0), routes.length - 1);
2983
- var history = (_state$history$filter = (_state$history = state.history) == null ? undefined : _state$history.filter(function (it) {
2984
- return routes.find(function (r) {
2985
- return r.key === it.key;
2986
- });
2987
- })) != null ? _state$history$filter : [];
2988
- return changeIndex({
2989
- stale: false,
2990
- type: 'tab',
2991
- key: `tab-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
2992
- index: index,
2993
- routeNames: routeNames,
2994
- history: history,
2995
- routes: routes
2996
- }, index, backBehavior, initialRouteName);
2997
- },
2998
- getStateForRouteNamesChange: function getStateForRouteNamesChange(state, _ref4) {
2999
- var routeNames = _ref4.routeNames,
3000
- routeParamList = _ref4.routeParamList,
3001
- routeKeyChanges = _ref4.routeKeyChanges;
3002
- var routes = routeNames.map(function (name) {
3003
- return state.routes.find(function (r) {
3004
- return r.name === name && !routeKeyChanges.includes(r.name);
3005
- }) || {
3006
- name: name,
3007
- key: `${name}-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
3008
- params: routeParamList[name]
3009
- };
3010
- });
3011
- var index = Math.max(0, routeNames.indexOf(state.routes[state.index].name));
3012
- var history = state.history.filter(
3013
- // Type will always be 'route' for tabs, but could be different in a router extending this (e.g. drawer)
3014
- function (it) {
3015
- return it.type !== 'route' || routes.find(function (r) {
3016
- return r.key === it.key;
3017
- });
3018
- });
3019
- if (!history.length) {
3020
- history = getRouteHistory(routes, index, backBehavior, initialRouteName);
3021
- }
3022
- return Object.assign({}, state, {
3023
- history: history,
3024
- routeNames: routeNames,
3025
- routes: routes,
3026
- index: index
3027
- });
3028
- },
3029
- getStateForRouteFocus: function getStateForRouteFocus(state, key) {
3030
- var index = state.routes.findIndex(function (r) {
3031
- return r.key === key;
3032
- });
3033
- if (index === -1 || index === state.index) {
3034
- return state;
3035
- }
3036
- return changeIndex(state, index, backBehavior, initialRouteName);
3037
- },
3038
- getStateForAction: function getStateForAction(state, action, _ref5) {
3039
- var routeParamList = _ref5.routeParamList,
3040
- routeGetIdList = _ref5.routeGetIdList;
3041
- switch (action.type) {
3042
- case 'JUMP_TO':
3043
- case 'NAVIGATE':
3044
- {
3045
- var index = -1;
3046
- if (action.type === 'NAVIGATE' && action.payload.key) {
3047
- index = state.routes.findIndex(function (route) {
3048
- return route.key === action.payload.key;
3049
- });
3050
- } else {
3051
- index = state.routes.findIndex(function (route) {
3052
- return route.name === action.payload.name;
3053
- });
3054
- }
3055
- if (index === -1) {
3056
- return null;
3057
- }
3058
- return changeIndex(Object.assign({}, state, {
3059
- routes: state.routes.map(function (route, i) {
3060
- if (i !== index) {
3061
- return route;
3062
- }
3063
- var getId = routeGetIdList[route.name];
3064
- var currentId = getId == null ? undefined : getId({
3065
- params: route.params
3066
- });
3067
- var nextId = getId == null ? undefined : getId({
3068
- params: action.payload.params
3069
- });
3070
- var key = currentId === nextId ? route.key : `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`;
3071
- var params;
3072
- if (action.type === 'NAVIGATE' && action.payload.merge && currentId === nextId) {
3073
- params = action.payload.params !== undefined || routeParamList[route.name] !== undefined ? Object.assign({}, routeParamList[route.name], route.params, action.payload.params) : route.params;
3074
- } else {
3075
- params = routeParamList[route.name] !== undefined ? Object.assign({}, routeParamList[route.name], action.payload.params) : action.payload.params;
3076
- }
3077
- var path = action.type === 'NAVIGATE' && action.payload.path != null ? action.payload.path : route.path;
3078
- return params !== route.params || path !== route.path ? Object.assign({}, route, {
3079
- key: key,
3080
- path: path,
3081
- params: params
3082
- }) : route;
3083
- })
3084
- }), index, backBehavior, initialRouteName);
3085
- }
3086
- case 'GO_BACK':
3087
- {
3088
- if (state.history.length === 1) {
3089
- return null;
3090
- }
3091
- var previousKey = state.history[state.history.length - 2].key;
3092
- var _index = state.routes.findIndex(function (route) {
3093
- return route.key === previousKey;
3094
- });
3095
- if (_index === -1) {
3096
- return null;
3097
- }
3098
- return Object.assign({}, state, {
3099
- history: state.history.slice(0, -1),
3100
- index: _index
3101
- });
3102
- }
3103
- default:
3104
- return _BaseRouter.default.getStateForAction(state, action);
3105
- }
3106
- },
3107
- shouldActionChangeFocus: function shouldActionChangeFocus(action) {
3108
- return action.type === 'NAVIGATE';
3109
- },
3110
- actionCreators: TabActions
3111
- });
3112
- return router;
3113
- }
3114
- },"46e9b616ece3d5066957",["277a84013d7e1a1ace05","58153a28fc8e098e8bbf","e03db9aacb1ee503cd26"]);
3115
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
3116
- Object.defineProperty(exports, "__esModule", {
3117
- value: true
3118
- });
3119
- exports.StackActions = undefined;
3120
- exports.default = StackRouter;
3121
- var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1]));
3122
- var _BaseRouter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2]));
3123
- var StackActions = exports.StackActions = {
3124
- replace: function replace(name, params) {
3125
- return {
3126
- type: 'REPLACE',
3127
- payload: {
3128
- name: name,
3129
- params: params
3130
- }
3131
- };
3132
- },
3133
- push: function push(name, params) {
3134
- return {
3135
- type: 'PUSH',
3136
- payload: {
3137
- name: name,
3138
- params: params
3139
- }
3140
- };
3141
- },
3142
- pop: function pop() {
3143
- var count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
3144
- return {
3145
- type: 'POP',
3146
- payload: {
3147
- count: count
3148
- }
3149
- };
3150
- },
3151
- popToTop: function popToTop() {
3152
- return {
3153
- type: 'POP_TO_TOP'
3154
- };
3155
- }
3156
- };
3157
- function StackRouter(options) {
3158
- var router = Object.assign({}, _BaseRouter.default, {
3159
- type: 'stack',
3160
- getInitialState: function getInitialState(_ref) {
3161
- var routeNames = _ref.routeNames,
3162
- routeParamList = _ref.routeParamList;
3163
- var initialRouteName = options.initialRouteName !== undefined && routeNames.includes(options.initialRouteName) ? options.initialRouteName : routeNames[0];
3164
- return {
3165
- stale: false,
3166
- type: 'stack',
3167
- key: `stack-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
3168
- index: 0,
3169
- routeNames: routeNames,
3170
- routes: [{
3171
- key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
3172
- name: initialRouteName,
3173
- params: routeParamList[initialRouteName]
3174
- }]
3175
- };
3176
- },
3177
- getRehydratedState: function getRehydratedState(partialState, _ref2) {
3178
- var routeNames = _ref2.routeNames,
3179
- routeParamList = _ref2.routeParamList;
3180
- var state = partialState;
3181
- if (state.stale === false) {
3182
- return state;
3183
- }
3184
- var routes = state.routes.filter(function (route) {
3185
- return routeNames.includes(route.name);
3186
- }).map(function (route) {
3187
- return Object.assign({}, route, {
3188
- key: route.key || `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
3189
- params: routeParamList[route.name] !== undefined ? Object.assign({}, routeParamList[route.name], route.params) : route.params
3190
- });
3191
- });
3192
- if (routes.length === 0) {
3193
- var initialRouteName = options.initialRouteName !== undefined ? options.initialRouteName : routeNames[0];
3194
- routes.push({
3195
- key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
3196
- name: initialRouteName,
3197
- params: routeParamList[initialRouteName]
3198
- });
3199
- }
3200
- return {
3201
- stale: false,
3202
- type: 'stack',
3203
- key: `stack-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
3204
- index: routes.length - 1,
3205
- routeNames: routeNames,
3206
- routes: routes
3207
- };
3208
- },
3209
- getStateForRouteNamesChange: function getStateForRouteNamesChange(state, _ref3) {
3210
- var routeNames = _ref3.routeNames,
3211
- routeParamList = _ref3.routeParamList,
3212
- routeKeyChanges = _ref3.routeKeyChanges;
3213
- var routes = state.routes.filter(function (route) {
3214
- return routeNames.includes(route.name) && !routeKeyChanges.includes(route.name);
3215
- });
3216
- if (routes.length === 0) {
3217
- var initialRouteName = options.initialRouteName !== undefined && routeNames.includes(options.initialRouteName) ? options.initialRouteName : routeNames[0];
3218
- routes.push({
3219
- key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
3220
- name: initialRouteName,
3221
- params: routeParamList[initialRouteName]
3222
- });
3223
- }
3224
- return Object.assign({}, state, {
3225
- routeNames: routeNames,
3226
- routes: routes,
3227
- index: Math.min(state.index, routes.length - 1)
3228
- });
3229
- },
3230
- getStateForRouteFocus: function getStateForRouteFocus(state, key) {
3231
- var index = state.routes.findIndex(function (r) {
3232
- return r.key === key;
3233
- });
3234
- if (index === -1 || index === state.index) {
3235
- return state;
3236
- }
3237
- return Object.assign({}, state, {
3238
- index: index,
3239
- routes: state.routes.slice(0, index + 1)
3240
- });
3241
- },
3242
- getStateForAction: function getStateForAction(state, action, options) {
3243
- var routeParamList = options.routeParamList;
3244
- switch (action.type) {
3245
- case 'REPLACE':
3246
- {
3247
- var index = action.target === state.key && action.source ? state.routes.findIndex(function (r) {
3248
- return r.key === action.source;
3249
- }) : state.index;
3250
- if (index === -1) {
3251
- return null;
3252
- }
3253
- var _action$payload = action.payload,
3254
- name = _action$payload.name,
3255
- key = _action$payload.key,
3256
- params = _action$payload.params;
3257
- if (!state.routeNames.includes(name)) {
3258
- return null;
3259
- }
3260
- return Object.assign({}, state, {
3261
- routes: state.routes.map(function (route, i) {
3262
- return i === index ? {
3263
- key: key !== undefined ? key : `${name}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
3264
- name: name,
3265
- params: routeParamList[name] !== undefined ? Object.assign({}, routeParamList[name], params) : params
3266
- } : route;
3267
- })
3268
- });
3269
- }
3270
- case 'PUSH':
3271
- if (state.routeNames.includes(action.payload.name)) {
3272
- var getId = options.routeGetIdList[action.payload.name];
3273
- var id = getId == null ? undefined : getId({
3274
- params: action.payload.params
3275
- });
3276
- var route = id ? state.routes.find(function (route) {
3277
- return route.name === action.payload.name && id === (getId == null ? undefined : getId({
3278
- params: route.params
3279
- }));
3280
- }) : undefined;
3281
- var routes;
3282
- if (route) {
3283
- routes = state.routes.filter(function (r) {
3284
- return r.key !== route.key;
3285
- });
3286
- routes.push(Object.assign({}, route, {
3287
- params: routeParamList[action.payload.name] !== undefined ? Object.assign({}, routeParamList[action.payload.name], action.payload.params) : action.payload.params
3288
- }));
3289
- } else {
3290
- routes = [].concat((0, _toConsumableArray2.default)(state.routes), [{
3291
- key: `${action.payload.name}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
3292
- name: action.payload.name,
3293
- params: routeParamList[action.payload.name] !== undefined ? Object.assign({}, routeParamList[action.payload.name], action.payload.params) : action.payload.params
3294
- }]);
3295
- }
3296
- return Object.assign({}, state, {
3297
- index: routes.length - 1,
3298
- routes: routes
3299
- });
3300
- }
3301
- return null;
3302
- case 'POP':
3303
- {
3304
- var _index = action.target === state.key && action.source ? state.routes.findIndex(function (r) {
3305
- return r.key === action.source;
3306
- }) : state.index;
3307
- if (_index > 0) {
3308
- var _count = Math.max(_index - action.payload.count + 1, 1);
3309
- var _routes = state.routes.slice(0, _count).concat(state.routes.slice(_index + 1));
3310
- return Object.assign({}, state, {
3311
- index: _routes.length - 1,
3312
- routes: _routes
3313
- });
3314
- }
3315
- return null;
3316
- }
3317
- case 'POP_TO_TOP':
3318
- return router.getStateForAction(state, {
3319
- type: 'POP',
3320
- payload: {
3321
- count: state.routes.length - 1
3322
- }
3323
- }, options);
3324
- case 'NAVIGATE':
3325
- if (action.payload.name !== undefined && !state.routeNames.includes(action.payload.name)) {
3326
- return null;
3327
- }
3328
- if (action.payload.key || action.payload.name) {
3329
- var _action$payload$path;
3330
- // If the route already exists, navigate to that
3331
- var _index2 = -1;
3332
- var _getId =
3333
- // `getId` and `key` can't be used together
3334
- action.payload.key === undefined && action.payload.name !== undefined ? options.routeGetIdList[action.payload.name] : undefined;
3335
- var _id = _getId == null ? undefined : _getId({
3336
- params: action.payload.params
3337
- });
3338
- if (_id) {
3339
- _index2 = state.routes.findIndex(function (route) {
3340
- return route.name === action.payload.name && _id === (_getId == null ? undefined : _getId({
3341
- params: route.params
3342
- }));
3343
- });
3344
- } else if (state.routes[state.index].name === action.payload.name && action.payload.key === undefined || state.routes[state.index].key === action.payload.key) {
3345
- _index2 = state.index;
3346
- } else {
3347
- for (var i = state.routes.length - 1; i >= 0; i--) {
3348
- if (state.routes[i].name === action.payload.name && action.payload.key === undefined || state.routes[i].key === action.payload.key) {
3349
- _index2 = i;
3350
- break;
3351
- }
3352
- }
3353
- }
3354
- if (_index2 === -1 && action.payload.key && action.payload.name === undefined) {
3355
- return null;
3356
- }
3357
- if (_index2 === -1 && action.payload.name !== undefined) {
3358
- var _action$payload$key;
3359
- var _routes2 = [].concat((0, _toConsumableArray2.default)(state.routes), [{
3360
- key: (_action$payload$key = action.payload.key) != null ? _action$payload$key : `${action.payload.name}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
3361
- name: action.payload.name,
3362
- path: action.payload.path,
3363
- params: routeParamList[action.payload.name] !== undefined ? Object.assign({}, routeParamList[action.payload.name], action.payload.params) : action.payload.params
3364
- }]);
3365
- return Object.assign({}, state, {
3366
- routes: _routes2,
3367
- index: _routes2.length - 1
3368
- });
3369
- }
3370
- var _route = state.routes[_index2];
3371
- var _params;
3372
- if (action.payload.merge) {
3373
- _params = action.payload.params !== undefined || routeParamList[_route.name] !== undefined ? Object.assign({}, routeParamList[_route.name], _route.params, action.payload.params) : _route.params;
3374
- } else {
3375
- _params = routeParamList[_route.name] !== undefined ? Object.assign({}, routeParamList[_route.name], action.payload.params) : action.payload.params;
3376
- }
3377
- return Object.assign({}, state, {
3378
- index: _index2,
3379
- routes: [].concat((0, _toConsumableArray2.default)(state.routes.slice(0, _index2)), [_params !== _route.params || action.payload.path && action.payload.path !== _route.path ? Object.assign({}, _route, {
3380
- path: (_action$payload$path = action.payload.path) != null ? _action$payload$path : _route.path,
3381
- params: _params
3382
- }) : state.routes[_index2]])
3383
- });
3384
- }
3385
- return null;
3386
- case 'GO_BACK':
3387
- if (state.index > 0) {
3388
- return router.getStateForAction(state, {
3389
- type: 'POP',
3390
- payload: {
3391
- count: 1
3392
- },
3393
- target: action.target,
3394
- source: action.source
3395
- }, options);
3396
- }
3397
- return null;
3398
- default:
3399
- return _BaseRouter.default.getStateForAction(state, action);
3400
- }
3401
- },
3402
- actionCreators: StackActions
3403
- });
3404
- return router;
3405
- }
3406
- },"97533916e76df342b455",["277a84013d7e1a1ace05","838d7a057beeb5db50df","58153a28fc8e098e8bbf","e03db9aacb1ee503cd26"]);
3407
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
3408
- Object.defineProperty(exports, "__esModule", {
3409
- value: true
3410
- });
3411
- var _exportNames = {
3412
- CommonActions: true,
3413
- BaseRouter: true,
3414
- DrawerActions: true,
3415
- DrawerRouter: true,
3416
- StackActions: true,
3417
- StackRouter: true,
3418
- TabActions: true,
3419
- TabRouter: true
3420
- };
3421
- Object.defineProperty(exports, "BaseRouter", {
3422
- enumerable: true,
3423
- get: function get() {
3424
- return _BaseRouter.default;
3425
- }
3426
- });
3427
- exports.CommonActions = undefined;
3428
- Object.defineProperty(exports, "DrawerActions", {
3429
- enumerable: true,
3430
- get: function get() {
3431
- return _DrawerRouter.DrawerActions;
3432
- }
3433
- });
3434
- Object.defineProperty(exports, "DrawerRouter", {
3435
- enumerable: true,
3436
- get: function get() {
3437
- return _DrawerRouter.default;
3438
- }
3439
- });
3440
- Object.defineProperty(exports, "StackActions", {
3441
- enumerable: true,
3442
- get: function get() {
3443
- return _StackRouter.StackActions;
3444
- }
3445
- });
3446
- Object.defineProperty(exports, "StackRouter", {
3447
- enumerable: true,
3448
- get: function get() {
3449
- return _StackRouter.default;
3450
- }
3451
- });
3452
- Object.defineProperty(exports, "TabActions", {
3453
- enumerable: true,
3454
- get: function get() {
3455
- return _TabRouter.TabActions;
3456
- }
3457
- });
3458
- Object.defineProperty(exports, "TabRouter", {
3459
- enumerable: true,
3460
- get: function get() {
3461
- return _TabRouter.default;
3462
- }
3463
- });
3464
- var CommonActions = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0]));
3465
- exports.CommonActions = CommonActions;
3466
- var _BaseRouter = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2]));
3467
- var _DrawerRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3]));
3468
- var _StackRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4]));
3469
- var _TabRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5]));
3470
- Object.keys(_$$_REQUIRE(_dependencyMap[6])).forEach(function (key) {
3471
- if (key === "default" || key === "__esModule") return;
3472
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
3473
- if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[6])[key]) return;
3474
- Object.defineProperty(exports, key, {
3475
- enumerable: true,
3476
- get: function get() {
3477
- return _$$_REQUIRE(_dependencyMap[6])[key];
3478
- }
3479
- });
3480
- });
3481
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
3482
- },"c7ce5eb5541f78e249bf",["44010d2886624e71e726","277a84013d7e1a1ace05","58153a28fc8e098e8bbf","68ee2377a6ca7029997f","97533916e76df342b455","46e9b616ece3d5066957","9c8c9b182c731effad0e"]);
3483
- __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
3484
- Object.defineProperty(exports, "__esModule", {
3485
- value: true
3486
- });
3487
- },"9c8c9b182c731effad0e",[]);