lt-business-component 1.0.85 → 1.0.86

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.
@@ -1402,6 +1402,19 @@ module.exports = function (argument) {
1402
1402
  };
1403
1403
 
1404
1404
 
1405
+ /***/ }),
1406
+
1407
+ /***/ 1296:
1408
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
1409
+
1410
+ "use strict";
1411
+
1412
+ var NATIVE_SYMBOL = __webpack_require__(4495);
1413
+
1414
+ /* eslint-disable es/no-symbol -- safe */
1415
+ module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor;
1416
+
1417
+
1405
1418
  /***/ }),
1406
1419
 
1407
1420
  /***/ 1385:
@@ -1540,6 +1553,37 @@ $({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
1540
1553
  });
1541
1554
 
1542
1555
 
1556
+ /***/ }),
1557
+
1558
+ /***/ 1510:
1559
+ /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
1560
+
1561
+ "use strict";
1562
+
1563
+ var $ = __webpack_require__(6518);
1564
+ var getBuiltIn = __webpack_require__(7751);
1565
+ var hasOwn = __webpack_require__(9297);
1566
+ var toString = __webpack_require__(655);
1567
+ var shared = __webpack_require__(5745);
1568
+ var NATIVE_SYMBOL_REGISTRY = __webpack_require__(1296);
1569
+
1570
+ var StringToSymbolRegistry = shared('string-to-symbol-registry');
1571
+ var SymbolToStringRegistry = shared('symbol-to-string-registry');
1572
+
1573
+ // `Symbol.for` method
1574
+ // https://tc39.es/ecma262/#sec-symbol.for
1575
+ $({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
1576
+ 'for': function (key) {
1577
+ var string = toString(key);
1578
+ if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
1579
+ var symbol = getBuiltIn('Symbol')(string);
1580
+ StringToSymbolRegistry[string] = symbol;
1581
+ SymbolToStringRegistry[symbol] = string;
1582
+ return symbol;
1583
+ }
1584
+ });
1585
+
1586
+
1543
1587
  /***/ }),
1544
1588
 
1545
1589
  /***/ 1625:
@@ -1711,6 +1755,18 @@ module.exports = function (object, names) {
1711
1755
  };
1712
1756
 
1713
1757
 
1758
+ /***/ }),
1759
+
1760
+ /***/ 1951:
1761
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1762
+
1763
+ "use strict";
1764
+
1765
+ var wellKnownSymbol = __webpack_require__(8227);
1766
+
1767
+ exports.f = wellKnownSymbol;
1768
+
1769
+
1714
1770
  /***/ }),
1715
1771
 
1716
1772
  /***/ 1955:
@@ -2398,6 +2454,21 @@ module.exports = function (iterable, unboundFunction, options) {
2398
2454
  };
2399
2455
 
2400
2456
 
2457
+ /***/ }),
2458
+
2459
+ /***/ 2675:
2460
+ /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
2461
+
2462
+ "use strict";
2463
+
2464
+ // TODO: Remove this module from `core-js@4` since it's split to modules listed below
2465
+ __webpack_require__(6761);
2466
+ __webpack_require__(1510);
2467
+ __webpack_require__(7812);
2468
+ __webpack_require__(3110);
2469
+ __webpack_require__(9773);
2470
+
2471
+
2401
2472
  /***/ }),
2402
2473
 
2403
2474
  /***/ 2744:
@@ -16308,6 +16379,26 @@ module.exports = function (key, value) {
16308
16379
  };
16309
16380
 
16310
16381
 
16382
+ /***/ }),
16383
+
16384
+ /***/ 5749:
16385
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
16386
+
16387
+ "use strict";
16388
+
16389
+ var path = __webpack_require__(9167);
16390
+ var hasOwn = __webpack_require__(9297);
16391
+ var wrappedWellKnownSymbolModule = __webpack_require__(1951);
16392
+ var defineProperty = (__webpack_require__(4913).f);
16393
+
16394
+ module.exports = function (NAME) {
16395
+ var Symbol = path.Symbol || (path.Symbol = {});
16396
+ if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, {
16397
+ value: wrappedWellKnownSymbolModule.f(NAME)
16398
+ });
16399
+ };
16400
+
16401
+
16311
16402
  /***/ }),
16312
16403
 
16313
16404
  /***/ 5826:
@@ -17128,6 +17219,277 @@ module.exports = function (object, key, method) {
17128
17219
  };
17129
17220
 
17130
17221
 
17222
+ /***/ }),
17223
+
17224
+ /***/ 6761:
17225
+ /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
17226
+
17227
+ "use strict";
17228
+
17229
+ var $ = __webpack_require__(6518);
17230
+ var globalThis = __webpack_require__(4576);
17231
+ var call = __webpack_require__(9565);
17232
+ var uncurryThis = __webpack_require__(9504);
17233
+ var IS_PURE = __webpack_require__(6395);
17234
+ var DESCRIPTORS = __webpack_require__(3724);
17235
+ var NATIVE_SYMBOL = __webpack_require__(4495);
17236
+ var fails = __webpack_require__(9039);
17237
+ var hasOwn = __webpack_require__(9297);
17238
+ var isPrototypeOf = __webpack_require__(1625);
17239
+ var anObject = __webpack_require__(8551);
17240
+ var toIndexedObject = __webpack_require__(5397);
17241
+ var toPropertyKey = __webpack_require__(6969);
17242
+ var $toString = __webpack_require__(655);
17243
+ var createPropertyDescriptor = __webpack_require__(6980);
17244
+ var nativeObjectCreate = __webpack_require__(2360);
17245
+ var objectKeys = __webpack_require__(1072);
17246
+ var getOwnPropertyNamesModule = __webpack_require__(8480);
17247
+ var getOwnPropertyNamesExternal = __webpack_require__(298);
17248
+ var getOwnPropertySymbolsModule = __webpack_require__(3717);
17249
+ var getOwnPropertyDescriptorModule = __webpack_require__(7347);
17250
+ var definePropertyModule = __webpack_require__(4913);
17251
+ var definePropertiesModule = __webpack_require__(6801);
17252
+ var propertyIsEnumerableModule = __webpack_require__(8773);
17253
+ var defineBuiltIn = __webpack_require__(6840);
17254
+ var defineBuiltInAccessor = __webpack_require__(2106);
17255
+ var shared = __webpack_require__(5745);
17256
+ var sharedKey = __webpack_require__(6119);
17257
+ var hiddenKeys = __webpack_require__(421);
17258
+ var uid = __webpack_require__(3392);
17259
+ var wellKnownSymbol = __webpack_require__(8227);
17260
+ var wrappedWellKnownSymbolModule = __webpack_require__(1951);
17261
+ var defineWellKnownSymbol = __webpack_require__(5749);
17262
+ var defineSymbolToPrimitive = __webpack_require__(8242);
17263
+ var setToStringTag = __webpack_require__(687);
17264
+ var InternalStateModule = __webpack_require__(1181);
17265
+ var $forEach = (__webpack_require__(9213).forEach);
17266
+
17267
+ var HIDDEN = sharedKey('hidden');
17268
+ var SYMBOL = 'Symbol';
17269
+ var PROTOTYPE = 'prototype';
17270
+
17271
+ var setInternalState = InternalStateModule.set;
17272
+ var getInternalState = InternalStateModule.getterFor(SYMBOL);
17273
+
17274
+ var ObjectPrototype = Object[PROTOTYPE];
17275
+ var $Symbol = globalThis.Symbol;
17276
+ var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
17277
+ var RangeError = globalThis.RangeError;
17278
+ var TypeError = globalThis.TypeError;
17279
+ var QObject = globalThis.QObject;
17280
+ var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
17281
+ var nativeDefineProperty = definePropertyModule.f;
17282
+ var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
17283
+ var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
17284
+ var push = uncurryThis([].push);
17285
+
17286
+ var AllSymbols = shared('symbols');
17287
+ var ObjectPrototypeSymbols = shared('op-symbols');
17288
+ var WellKnownSymbolsStore = shared('wks');
17289
+
17290
+ // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
17291
+ var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
17292
+
17293
+ // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
17294
+ var fallbackDefineProperty = function (O, P, Attributes) {
17295
+ var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
17296
+ if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
17297
+ nativeDefineProperty(O, P, Attributes);
17298
+ if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
17299
+ nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
17300
+ }
17301
+ };
17302
+
17303
+ var setSymbolDescriptor = DESCRIPTORS && fails(function () {
17304
+ return nativeObjectCreate(nativeDefineProperty({}, 'a', {
17305
+ get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
17306
+ })).a !== 7;
17307
+ }) ? fallbackDefineProperty : nativeDefineProperty;
17308
+
17309
+ var wrap = function (tag, description) {
17310
+ var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
17311
+ setInternalState(symbol, {
17312
+ type: SYMBOL,
17313
+ tag: tag,
17314
+ description: description
17315
+ });
17316
+ if (!DESCRIPTORS) symbol.description = description;
17317
+ return symbol;
17318
+ };
17319
+
17320
+ var $defineProperty = function defineProperty(O, P, Attributes) {
17321
+ if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
17322
+ anObject(O);
17323
+ var key = toPropertyKey(P);
17324
+ anObject(Attributes);
17325
+ if (hasOwn(AllSymbols, key)) {
17326
+ if (!Attributes.enumerable) {
17327
+ if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, nativeObjectCreate(null)));
17328
+ O[HIDDEN][key] = true;
17329
+ } else {
17330
+ if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
17331
+ Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
17332
+ } return setSymbolDescriptor(O, key, Attributes);
17333
+ } return nativeDefineProperty(O, key, Attributes);
17334
+ };
17335
+
17336
+ var $defineProperties = function defineProperties(O, Properties) {
17337
+ anObject(O);
17338
+ var properties = toIndexedObject(Properties);
17339
+ var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
17340
+ $forEach(keys, function (key) {
17341
+ if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]);
17342
+ });
17343
+ return O;
17344
+ };
17345
+
17346
+ var $create = function create(O, Properties) {
17347
+ return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
17348
+ };
17349
+
17350
+ var $propertyIsEnumerable = function propertyIsEnumerable(V) {
17351
+ var P = toPropertyKey(V);
17352
+ var enumerable = call(nativePropertyIsEnumerable, this, P);
17353
+ if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false;
17354
+ return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P]
17355
+ ? enumerable : true;
17356
+ };
17357
+
17358
+ var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
17359
+ var it = toIndexedObject(O);
17360
+ var key = toPropertyKey(P);
17361
+ if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return;
17362
+ var descriptor = nativeGetOwnPropertyDescriptor(it, key);
17363
+ if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) {
17364
+ descriptor.enumerable = true;
17365
+ }
17366
+ return descriptor;
17367
+ };
17368
+
17369
+ var $getOwnPropertyNames = function getOwnPropertyNames(O) {
17370
+ var names = nativeGetOwnPropertyNames(toIndexedObject(O));
17371
+ var result = [];
17372
+ $forEach(names, function (key) {
17373
+ if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key);
17374
+ });
17375
+ return result;
17376
+ };
17377
+
17378
+ var $getOwnPropertySymbols = function (O) {
17379
+ var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
17380
+ var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
17381
+ var result = [];
17382
+ $forEach(names, function (key) {
17383
+ if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {
17384
+ push(result, AllSymbols[key]);
17385
+ }
17386
+ });
17387
+ return result;
17388
+ };
17389
+
17390
+ // `Symbol` constructor
17391
+ // https://tc39.es/ecma262/#sec-symbol-constructor
17392
+ if (!NATIVE_SYMBOL) {
17393
+ $Symbol = function Symbol() {
17394
+ if (isPrototypeOf(SymbolPrototype, this)) throw new TypeError('Symbol is not a constructor');
17395
+ var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);
17396
+ var tag = uid(description);
17397
+ var setter = function (value) {
17398
+ var $this = this === undefined ? globalThis : this;
17399
+ if ($this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value);
17400
+ if (hasOwn($this, HIDDEN) && hasOwn($this[HIDDEN], tag)) $this[HIDDEN][tag] = false;
17401
+ var descriptor = createPropertyDescriptor(1, value);
17402
+ try {
17403
+ setSymbolDescriptor($this, tag, descriptor);
17404
+ } catch (error) {
17405
+ if (!(error instanceof RangeError)) throw error;
17406
+ fallbackDefineProperty($this, tag, descriptor);
17407
+ }
17408
+ };
17409
+ if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
17410
+ return wrap(tag, description);
17411
+ };
17412
+
17413
+ SymbolPrototype = $Symbol[PROTOTYPE];
17414
+
17415
+ defineBuiltIn(SymbolPrototype, 'toString', function toString() {
17416
+ return getInternalState(this).tag;
17417
+ });
17418
+
17419
+ defineBuiltIn($Symbol, 'withoutSetter', function (description) {
17420
+ return wrap(uid(description), description);
17421
+ });
17422
+
17423
+ propertyIsEnumerableModule.f = $propertyIsEnumerable;
17424
+ definePropertyModule.f = $defineProperty;
17425
+ definePropertiesModule.f = $defineProperties;
17426
+ getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
17427
+ getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
17428
+ getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
17429
+
17430
+ wrappedWellKnownSymbolModule.f = function (name) {
17431
+ return wrap(wellKnownSymbol(name), name);
17432
+ };
17433
+
17434
+ if (DESCRIPTORS) {
17435
+ // https://tc39.es/ecma262/#sec-symbol.prototype.description
17436
+ defineBuiltInAccessor(SymbolPrototype, 'description', {
17437
+ configurable: true,
17438
+ get: function description() {
17439
+ return getInternalState(this).description;
17440
+ }
17441
+ });
17442
+ if (!IS_PURE) {
17443
+ defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
17444
+ }
17445
+ }
17446
+ }
17447
+
17448
+ $({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
17449
+ Symbol: $Symbol
17450
+ });
17451
+
17452
+ $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
17453
+ defineWellKnownSymbol(name);
17454
+ });
17455
+
17456
+ $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
17457
+ useSetter: function () { USE_SETTER = true; },
17458
+ useSimple: function () { USE_SETTER = false; }
17459
+ });
17460
+
17461
+ $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
17462
+ // `Object.create` method
17463
+ // https://tc39.es/ecma262/#sec-object.create
17464
+ create: $create,
17465
+ // `Object.defineProperty` method
17466
+ // https://tc39.es/ecma262/#sec-object.defineproperty
17467
+ defineProperty: $defineProperty,
17468
+ // `Object.defineProperties` method
17469
+ // https://tc39.es/ecma262/#sec-object.defineproperties
17470
+ defineProperties: $defineProperties,
17471
+ // `Object.getOwnPropertyDescriptor` method
17472
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
17473
+ getOwnPropertyDescriptor: $getOwnPropertyDescriptor
17474
+ });
17475
+
17476
+ $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
17477
+ // `Object.getOwnPropertyNames` method
17478
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
17479
+ getOwnPropertyNames: $getOwnPropertyNames
17480
+ });
17481
+
17482
+ // `Symbol.prototype[@@toPrimitive]` method
17483
+ // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
17484
+ defineSymbolToPrimitive();
17485
+
17486
+ // `Symbol.prototype[@@toStringTag]` property
17487
+ // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
17488
+ setToStringTag($Symbol, SYMBOL);
17489
+
17490
+ hiddenKeys[HIDDEN] = true;
17491
+
17492
+
17131
17493
  /***/ }),
17132
17494
 
17133
17495
  /***/ 6801:
@@ -18406,6 +18768,32 @@ defineIterator(String, 'String', function (iterated) {
18406
18768
  });
18407
18769
 
18408
18770
 
18771
+ /***/ }),
18772
+
18773
+ /***/ 7812:
18774
+ /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
18775
+
18776
+ "use strict";
18777
+
18778
+ var $ = __webpack_require__(6518);
18779
+ var hasOwn = __webpack_require__(9297);
18780
+ var isSymbol = __webpack_require__(757);
18781
+ var tryToString = __webpack_require__(6823);
18782
+ var shared = __webpack_require__(5745);
18783
+ var NATIVE_SYMBOL_REGISTRY = __webpack_require__(1296);
18784
+
18785
+ var SymbolToStringRegistry = shared('symbol-to-string-registry');
18786
+
18787
+ // `Symbol.keyFor` method
18788
+ // https://tc39.es/ecma262/#sec-symbol.keyfor
18789
+ $({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
18790
+ keyFor: function keyFor(sym) {
18791
+ if (!isSymbol(sym)) throw new TypeError(tryToString(sym) + ' is not a symbol');
18792
+ if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
18793
+ }
18794
+ });
18795
+
18796
+
18409
18797
  /***/ }),
18410
18798
 
18411
18799
  /***/ 7829:
@@ -18690,6 +19078,35 @@ module.exports = function (name) {
18690
19078
  };
18691
19079
 
18692
19080
 
19081
+ /***/ }),
19082
+
19083
+ /***/ 8242:
19084
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
19085
+
19086
+ "use strict";
19087
+
19088
+ var call = __webpack_require__(9565);
19089
+ var getBuiltIn = __webpack_require__(7751);
19090
+ var wellKnownSymbol = __webpack_require__(8227);
19091
+ var defineBuiltIn = __webpack_require__(6840);
19092
+
19093
+ module.exports = function () {
19094
+ var Symbol = getBuiltIn('Symbol');
19095
+ var SymbolPrototype = Symbol && Symbol.prototype;
19096
+ var valueOf = SymbolPrototype && SymbolPrototype.valueOf;
19097
+ var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
19098
+
19099
+ if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {
19100
+ // `Symbol.prototype[@@toPrimitive]` method
19101
+ // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
19102
+ // eslint-disable-next-line no-unused-vars -- required for .length
19103
+ defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {
19104
+ return call(valueOf, this);
19105
+ }, { arity: 1 });
19106
+ }
19107
+ };
19108
+
19109
+
18693
19110
  /***/ }),
18694
19111
 
18695
19112
  /***/ 8265:
@@ -27726,6 +28143,57 @@ module.exports = function (argument) {
27726
28143
  };
27727
28144
 
27728
28145
 
28146
+ /***/ }),
28147
+
28148
+ /***/ 9391:
28149
+ /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
28150
+
28151
+ "use strict";
28152
+
28153
+ var $ = __webpack_require__(6518);
28154
+ var IS_PURE = __webpack_require__(6395);
28155
+ var NativePromiseConstructor = __webpack_require__(550);
28156
+ var fails = __webpack_require__(9039);
28157
+ var getBuiltIn = __webpack_require__(7751);
28158
+ var isCallable = __webpack_require__(4901);
28159
+ var speciesConstructor = __webpack_require__(2293);
28160
+ var promiseResolve = __webpack_require__(3438);
28161
+ var defineBuiltIn = __webpack_require__(6840);
28162
+
28163
+ var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
28164
+
28165
+ // Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829
28166
+ var NON_GENERIC = !!NativePromiseConstructor && fails(function () {
28167
+ // eslint-disable-next-line unicorn/no-thenable -- required for testing
28168
+ NativePromisePrototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });
28169
+ });
28170
+
28171
+ // `Promise.prototype.finally` method
28172
+ // https://tc39.es/ecma262/#sec-promise.prototype.finally
28173
+ $({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
28174
+ 'finally': function (onFinally) {
28175
+ var C = speciesConstructor(this, getBuiltIn('Promise'));
28176
+ var isFunction = isCallable(onFinally);
28177
+ return this.then(
28178
+ isFunction ? function (x) {
28179
+ return promiseResolve(C, onFinally()).then(function () { return x; });
28180
+ } : onFinally,
28181
+ isFunction ? function (e) {
28182
+ return promiseResolve(C, onFinally()).then(function () { throw e; });
28183
+ } : onFinally
28184
+ );
28185
+ }
28186
+ });
28187
+
28188
+ // makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then`
28189
+ if (!IS_PURE && isCallable(NativePromiseConstructor)) {
28190
+ var method = getBuiltIn('Promise').prototype['finally'];
28191
+ if (NativePromisePrototype['finally'] !== method) {
28192
+ defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true });
28193
+ }
28194
+ }
28195
+
28196
+
27729
28197
  /***/ }),
27730
28198
 
27731
28199
  /***/ 9432:
@@ -27864,6 +28332,74 @@ module.exports = function (nextHandler, IS_ITERATOR, RETURN_HANDLER_RESULT) {
27864
28332
  };
27865
28333
 
27866
28334
 
28335
+ /***/ }),
28336
+
28337
+ /***/ 9463:
28338
+ /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
28339
+
28340
+ "use strict";
28341
+ // `Symbol.prototype.description` getter
28342
+ // https://tc39.es/ecma262/#sec-symbol.prototype.description
28343
+
28344
+ var $ = __webpack_require__(6518);
28345
+ var DESCRIPTORS = __webpack_require__(3724);
28346
+ var globalThis = __webpack_require__(4576);
28347
+ var uncurryThis = __webpack_require__(9504);
28348
+ var hasOwn = __webpack_require__(9297);
28349
+ var isCallable = __webpack_require__(4901);
28350
+ var isPrototypeOf = __webpack_require__(1625);
28351
+ var toString = __webpack_require__(655);
28352
+ var defineBuiltInAccessor = __webpack_require__(2106);
28353
+ var copyConstructorProperties = __webpack_require__(7740);
28354
+
28355
+ var NativeSymbol = globalThis.Symbol;
28356
+ var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
28357
+
28358
+ if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
28359
+ // Safari 12 bug
28360
+ NativeSymbol().description !== undefined
28361
+ )) {
28362
+ var EmptyStringDescriptionStore = {};
28363
+ // wrap Symbol constructor for correct work with undefined description
28364
+ var SymbolWrapper = function Symbol() {
28365
+ var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);
28366
+ var result = isPrototypeOf(SymbolPrototype, this)
28367
+ // eslint-disable-next-line sonarjs/inconsistent-function-call -- ok
28368
+ ? new NativeSymbol(description)
28369
+ // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
28370
+ : description === undefined ? NativeSymbol() : NativeSymbol(description);
28371
+ if (description === '') EmptyStringDescriptionStore[result] = true;
28372
+ return result;
28373
+ };
28374
+
28375
+ copyConstructorProperties(SymbolWrapper, NativeSymbol);
28376
+ SymbolWrapper.prototype = SymbolPrototype;
28377
+ SymbolPrototype.constructor = SymbolWrapper;
28378
+
28379
+ var NATIVE_SYMBOL = String(NativeSymbol('description detection')) === 'Symbol(description detection)';
28380
+ var thisSymbolValue = uncurryThis(SymbolPrototype.valueOf);
28381
+ var symbolDescriptiveString = uncurryThis(SymbolPrototype.toString);
28382
+ var regexp = /^Symbol\((.*)\)[^)]+$/;
28383
+ var replace = uncurryThis(''.replace);
28384
+ var stringSlice = uncurryThis(''.slice);
28385
+
28386
+ defineBuiltInAccessor(SymbolPrototype, 'description', {
28387
+ configurable: true,
28388
+ get: function description() {
28389
+ var symbol = thisSymbolValue(this);
28390
+ if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
28391
+ var string = symbolDescriptiveString(symbol);
28392
+ var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');
28393
+ return desc === '' ? undefined : desc;
28394
+ }
28395
+ });
28396
+
28397
+ $({ global: true, constructor: true, forced: true }, {
28398
+ Symbol: SymbolWrapper
28399
+ });
28400
+ }
28401
+
28402
+
27867
28403
  /***/ }),
27868
28404
 
27869
28405
  /***/ 9504:
@@ -28024,6 +28560,33 @@ module.exports = {
28024
28560
  };
28025
28561
 
28026
28562
 
28563
+ /***/ }),
28564
+
28565
+ /***/ 9773:
28566
+ /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
28567
+
28568
+ "use strict";
28569
+
28570
+ var $ = __webpack_require__(6518);
28571
+ var NATIVE_SYMBOL = __webpack_require__(4495);
28572
+ var fails = __webpack_require__(9039);
28573
+ var getOwnPropertySymbolsModule = __webpack_require__(3717);
28574
+ var toObject = __webpack_require__(8981);
28575
+
28576
+ // V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
28577
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3443
28578
+ var FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); });
28579
+
28580
+ // `Object.getOwnPropertySymbols` method
28581
+ // https://tc39.es/ecma262/#sec-object.getownpropertysymbols
28582
+ $({ target: 'Object', stat: true, forced: FORCED }, {
28583
+ getOwnPropertySymbols: function getOwnPropertySymbols(it) {
28584
+ var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
28585
+ return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];
28586
+ }
28587
+ });
28588
+
28589
+
28027
28590
  /***/ }),
28028
28591
 
28029
28592
  /***/ 9791:
@@ -28184,6 +28747,10 @@ __webpack_require__.d(common_utils_namespaceObject, {
28184
28747
  origin: function() { return origin; }
28185
28748
  });
28186
28749
 
28750
+ // NAMESPACE OBJECT: ./node_modules/lodash-es/lodash.js
28751
+ var lodash_namespaceObject = {};
28752
+ __webpack_require__.r(lodash_namespaceObject);
28753
+
28187
28754
  ;// ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
28188
28755
  /* eslint-disable no-var */
28189
28756
  // This file is imported into lib/wc client bundles.
@@ -47482,6 +48049,13 @@ var jquery_default = /*#__PURE__*/__webpack_require__.n(jquery);
47482
48049
 
47483
48050
 
47484
48051
 
48052
+
48053
+
48054
+
48055
+ var $axios = lib_axios;
48056
+
48057
+
48058
+
47485
48059
  var commonMethods_locale = vue_i18n/* useI18n */.s9.locale,
47486
48060
  commonMethods_t = vue_i18n/* useI18n */.s9.t;
47487
48061
  var GuidID = function GuidID() {
@@ -47605,6 +48179,102 @@ var getLocalDate = function getLocalDate(value, showTime) {
47605
48179
  var ss = (dt.getUTCSeconds() + '').padStart(2, '0');
47606
48180
  return showTime ? "".concat(y, "-").concat(m, "-").concat(d, " ").concat(hh, ":").concat(mm, ":").concat(ss) : "".concat(y, "-").concat(m, "-").concat(d);
47607
48181
  };
48182
+ var loadProfile = /*#__PURE__*/function () {
48183
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(name) {
48184
+ var list, baseURL, modelName, i, files, j, path, _name, ps, url, _j;
48185
+ return _regenerator().w(function (_context) {
48186
+ while (1) switch (_context.n) {
48187
+ case 0:
48188
+ list = [];
48189
+ baseURL = location.protocol + "//" + location.host + "/";
48190
+ modelName = ({"NODE_ENV":"production","BASE_URL":"/"}).VUE_APP_NAME;
48191
+ if (typeof name == "string") {
48192
+ list.push("/" + name + ".json");
48193
+ } else {
48194
+ for (i in name) {
48195
+ list.push("/" + name[i] + ".json");
48196
+ }
48197
+ }
48198
+ if (false) // removed by dead control flow
48199
+ {}
48200
+ files = [];
48201
+ for (j = 0; j < list.length; j++) {
48202
+ path = list[j].substr(0, list[j].lastIndexOf("/"));
48203
+ _name = list[j].substr(list[j].lastIndexOf("/") + 1);
48204
+ files.push({
48205
+ model: modelName + path,
48206
+ fileName: _name
48207
+ });
48208
+ }
48209
+ return _context.a(2, $axios.post("".concat(baseURL, "cfg?") + new Date().getTime(), files).then(function (response) {
48210
+ var res = response.data;
48211
+ var resCfg = [];
48212
+ for (var locvar = 0; locvar < list.length; locvar++) {
48213
+ var resvar = 0;
48214
+ for (; resvar < res.length; resvar++) {
48215
+ if (res[resvar].model + "/" + res[resvar].fileName == modelName + list[locvar]) {
48216
+ try {
48217
+ resCfg.push(JSON.parse(res[resvar].context));
48218
+ } catch (_unused) {
48219
+ message.warning("无法解析配置文件:" + list[locvar]);
48220
+ }
48221
+ break;
48222
+ }
48223
+ }
48224
+ if (resvar == res.length) {
48225
+ message.warning("文件" + [list[locvar]] + "解析失败");
48226
+ resCfg.push({});
48227
+ }
48228
+ }
48229
+ if (typeof name == "string") {
48230
+ return resCfg[0];
48231
+ } else {
48232
+ return resCfg;
48233
+ }
48234
+ }).catch(function (e) {
48235
+ message.warning(e);
48236
+ }));
48237
+ case 1:
48238
+ ps = [];
48239
+ url = window.__POWERED_BY_QIANKUN__ ? "http://localhost:".concat(LtConfig.port, "/script/") : baseURL + "script";
48240
+ for (_j = 0; _j < list.length; _j++) {
48241
+ (function (fname) {
48242
+ ps.push($axios.get(url + fname + "?" + new Date().getTime()).then(function (response) {
48243
+ return response.data;
48244
+ }).catch(function () {
48245
+ message.warning("文件" + fname + "解析失败");
48246
+ }));
48247
+ })(list[_j]);
48248
+ }
48249
+ return _context.a(2, $axios.all(ps).then(function (res) {
48250
+ if (typeof name == "string") {
48251
+ return res[0];
48252
+ } else {
48253
+ return res;
48254
+ }
48255
+ }));
48256
+ case 2:
48257
+ return _context.a(2);
48258
+ }
48259
+ }, _callee);
48260
+ }));
48261
+ return function loadProfile(_x) {
48262
+ return _ref.apply(this, arguments);
48263
+ };
48264
+ }();
48265
+ var hasRight = function hasRight(name) {
48266
+ if (typeof name == "undefined" || name == null || name == "") {
48267
+ return true;
48268
+ }
48269
+ if (LtConfig && LtConfig.Relations) {
48270
+ for (var i = 0; i < LtConfig.Relations.length; i++) {
48271
+ if (LtConfig.Relations[i].Relation === name) {
48272
+ return true;
48273
+ }
48274
+ }
48275
+ }
48276
+ return false;
48277
+ };
47608
48278
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.slice.js
47609
48279
  var es_array_slice = __webpack_require__(4782);
47610
48280
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.splice.js
@@ -72784,7 +73454,4152 @@ const top_menu_src_main_exports_ = top_menu_src_mainvue_type_script_setup_true_l
72784
73454
  top_menu_src_main.name = "top-menu";
72785
73455
  var ltTopMenu = withInstall(top_menu_src_main);
72786
73456
  /* harmony default export */ var top_menu = (ltTopMenu);
72787
- ;// ./packages/index.ts
73457
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.js
73458
+ var es_symbol = __webpack_require__(2675);
73459
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.description.js
73460
+ var es_symbol_description = __webpack_require__(9463);
73461
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.finally.js
73462
+ var es_promise_finally = __webpack_require__(9391);
73463
+ ;// ./node_modules/vue-router/dist/vue-router.mjs
73464
+ /*!
73465
+ * vue-router v4.5.1
73466
+ * (c) 2025 Eduardo San Martin Morote
73467
+ * @license MIT
73468
+ */
73469
+
73470
+
73471
+
73472
+ const vue_router_isBrowser = typeof document !== 'undefined';
73473
+
73474
+ /**
73475
+ * Allows differentiating lazy components from functional components and vue-class-component
73476
+ * @internal
73477
+ *
73478
+ * @param component
73479
+ */
73480
+ function isRouteComponent(component) {
73481
+ return (typeof component === 'object' ||
73482
+ 'displayName' in component ||
73483
+ 'props' in component ||
73484
+ '__vccOpts' in component);
73485
+ }
73486
+ function isESModule(obj) {
73487
+ return (obj.__esModule ||
73488
+ obj[Symbol.toStringTag] === 'Module' ||
73489
+ // support CF with dynamic imports that do not
73490
+ // add the Module string tag
73491
+ (obj.default && isRouteComponent(obj.default)));
73492
+ }
73493
+ const vue_router_assign = Object.assign;
73494
+ function applyToParams(fn, params) {
73495
+ const newParams = {};
73496
+ for (const key in params) {
73497
+ const value = params[key];
73498
+ newParams[key] = vue_router_isArray(value)
73499
+ ? value.map(fn)
73500
+ : fn(value);
73501
+ }
73502
+ return newParams;
73503
+ }
73504
+ const vue_router_noop = () => { };
73505
+ /**
73506
+ * Typesafe alternative to Array.isArray
73507
+ * https://github.com/microsoft/TypeScript/pull/48228
73508
+ */
73509
+ const vue_router_isArray = Array.isArray;
73510
+
73511
+ function vue_router_warn(msg) {
73512
+ // avoid using ...args as it breaks in older Edge builds
73513
+ const args = Array.from(arguments).slice(1);
73514
+ console.warn.apply(console, ['[Vue Router warn]: ' + msg].concat(args));
73515
+ }
73516
+
73517
+ /**
73518
+ * Encoding Rules (␣ = Space)
73519
+ * - Path: ␣ " < > # ? { }
73520
+ * - Query: ␣ " < > # & =
73521
+ * - Hash: ␣ " < > `
73522
+ *
73523
+ * On top of that, the RFC3986 (https://tools.ietf.org/html/rfc3986#section-2.2)
73524
+ * defines some extra characters to be encoded. Most browsers do not encode them
73525
+ * in encodeURI https://github.com/whatwg/url/issues/369, so it may be safer to
73526
+ * also encode `!'()*`. Leaving un-encoded only ASCII alphanumeric(`a-zA-Z0-9`)
73527
+ * plus `-._~`. This extra safety should be applied to query by patching the
73528
+ * string returned by encodeURIComponent encodeURI also encodes `[\]^`. `\`
73529
+ * should be encoded to avoid ambiguity. Browsers (IE, FF, C) transform a `\`
73530
+ * into a `/` if directly typed in. The _backtick_ (`````) should also be
73531
+ * encoded everywhere because some browsers like FF encode it when directly
73532
+ * written while others don't. Safari and IE don't encode ``"<>{}``` in hash.
73533
+ */
73534
+ // const EXTRA_RESERVED_RE = /[!'()*]/g
73535
+ // const encodeReservedReplacer = (c: string) => '%' + c.charCodeAt(0).toString(16)
73536
+ const HASH_RE = /#/g; // %23
73537
+ const AMPERSAND_RE = /&/g; // %26
73538
+ const SLASH_RE = /\//g; // %2F
73539
+ const EQUAL_RE = /=/g; // %3D
73540
+ const IM_RE = /\?/g; // %3F
73541
+ const PLUS_RE = /\+/g; // %2B
73542
+ /**
73543
+ * NOTE: It's not clear to me if we should encode the + symbol in queries, it
73544
+ * seems to be less flexible than not doing so and I can't find out the legacy
73545
+ * systems requiring this for regular requests like text/html. In the standard,
73546
+ * the encoding of the plus character is only mentioned for
73547
+ * application/x-www-form-urlencoded
73548
+ * (https://url.spec.whatwg.org/#urlencoded-parsing) and most browsers seems lo
73549
+ * leave the plus character as is in queries. To be more flexible, we allow the
73550
+ * plus character on the query, but it can also be manually encoded by the user.
73551
+ *
73552
+ * Resources:
73553
+ * - https://url.spec.whatwg.org/#urlencoded-parsing
73554
+ * - https://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20
73555
+ */
73556
+ const ENC_BRACKET_OPEN_RE = /%5B/g; // [
73557
+ const ENC_BRACKET_CLOSE_RE = /%5D/g; // ]
73558
+ const ENC_CARET_RE = /%5E/g; // ^
73559
+ const ENC_BACKTICK_RE = /%60/g; // `
73560
+ const ENC_CURLY_OPEN_RE = /%7B/g; // {
73561
+ const ENC_PIPE_RE = /%7C/g; // |
73562
+ const ENC_CURLY_CLOSE_RE = /%7D/g; // }
73563
+ const ENC_SPACE_RE = /%20/g; // }
73564
+ /**
73565
+ * Encode characters that need to be encoded on the path, search and hash
73566
+ * sections of the URL.
73567
+ *
73568
+ * @internal
73569
+ * @param text - string to encode
73570
+ * @returns encoded string
73571
+ */
73572
+ function commonEncode(text) {
73573
+ return encodeURI('' + text)
73574
+ .replace(ENC_PIPE_RE, '|')
73575
+ .replace(ENC_BRACKET_OPEN_RE, '[')
73576
+ .replace(ENC_BRACKET_CLOSE_RE, ']');
73577
+ }
73578
+ /**
73579
+ * Encode characters that need to be encoded on the hash section of the URL.
73580
+ *
73581
+ * @param text - string to encode
73582
+ * @returns encoded string
73583
+ */
73584
+ function encodeHash(text) {
73585
+ return commonEncode(text)
73586
+ .replace(ENC_CURLY_OPEN_RE, '{')
73587
+ .replace(ENC_CURLY_CLOSE_RE, '}')
73588
+ .replace(ENC_CARET_RE, '^');
73589
+ }
73590
+ /**
73591
+ * Encode characters that need to be encoded query values on the query
73592
+ * section of the URL.
73593
+ *
73594
+ * @param text - string to encode
73595
+ * @returns encoded string
73596
+ */
73597
+ function encodeQueryValue(text) {
73598
+ return (commonEncode(text)
73599
+ // Encode the space as +, encode the + to differentiate it from the space
73600
+ .replace(PLUS_RE, '%2B')
73601
+ .replace(ENC_SPACE_RE, '+')
73602
+ .replace(HASH_RE, '%23')
73603
+ .replace(AMPERSAND_RE, '%26')
73604
+ .replace(ENC_BACKTICK_RE, '`')
73605
+ .replace(ENC_CURLY_OPEN_RE, '{')
73606
+ .replace(ENC_CURLY_CLOSE_RE, '}')
73607
+ .replace(ENC_CARET_RE, '^'));
73608
+ }
73609
+ /**
73610
+ * Like `encodeQueryValue` but also encodes the `=` character.
73611
+ *
73612
+ * @param text - string to encode
73613
+ */
73614
+ function encodeQueryKey(text) {
73615
+ return encodeQueryValue(text).replace(EQUAL_RE, '%3D');
73616
+ }
73617
+ /**
73618
+ * Encode characters that need to be encoded on the path section of the URL.
73619
+ *
73620
+ * @param text - string to encode
73621
+ * @returns encoded string
73622
+ */
73623
+ function encodePath(text) {
73624
+ return commonEncode(text).replace(HASH_RE, '%23').replace(IM_RE, '%3F');
73625
+ }
73626
+ /**
73627
+ * Encode characters that need to be encoded on the path section of the URL as a
73628
+ * param. This function encodes everything {@link encodePath} does plus the
73629
+ * slash (`/`) character. If `text` is `null` or `undefined`, returns an empty
73630
+ * string instead.
73631
+ *
73632
+ * @param text - string to encode
73633
+ * @returns encoded string
73634
+ */
73635
+ function encodeParam(text) {
73636
+ return text == null ? '' : encodePath(text).replace(SLASH_RE, '%2F');
73637
+ }
73638
+ /**
73639
+ * Decode text using `decodeURIComponent`. Returns the original text if it
73640
+ * fails.
73641
+ *
73642
+ * @param text - string to decode
73643
+ * @returns decoded string
73644
+ */
73645
+ function decode(text) {
73646
+ try {
73647
+ return decodeURIComponent('' + text);
73648
+ }
73649
+ catch (err) {
73650
+ ( false) && 0;
73651
+ }
73652
+ return '' + text;
73653
+ }
73654
+
73655
+ const TRAILING_SLASH_RE = /\/$/;
73656
+ const removeTrailingSlash = (path) => path.replace(TRAILING_SLASH_RE, '');
73657
+ /**
73658
+ * Transforms a URI into a normalized history location
73659
+ *
73660
+ * @param parseQuery
73661
+ * @param location - URI to normalize
73662
+ * @param currentLocation - current absolute location. Allows resolving relative
73663
+ * paths. Must start with `/`. Defaults to `/`
73664
+ * @returns a normalized history location
73665
+ */
73666
+ function parseURL(parseQuery, location, currentLocation = '/') {
73667
+ let path, query = {}, searchString = '', hash = '';
73668
+ // Could use URL and URLSearchParams but IE 11 doesn't support it
73669
+ // TODO: move to new URL()
73670
+ const hashPos = location.indexOf('#');
73671
+ let searchPos = location.indexOf('?');
73672
+ // the hash appears before the search, so it's not part of the search string
73673
+ if (hashPos < searchPos && hashPos >= 0) {
73674
+ searchPos = -1;
73675
+ }
73676
+ if (searchPos > -1) {
73677
+ path = location.slice(0, searchPos);
73678
+ searchString = location.slice(searchPos + 1, hashPos > -1 ? hashPos : location.length);
73679
+ query = parseQuery(searchString);
73680
+ }
73681
+ if (hashPos > -1) {
73682
+ path = path || location.slice(0, hashPos);
73683
+ // keep the # character
73684
+ hash = location.slice(hashPos, location.length);
73685
+ }
73686
+ // no search and no query
73687
+ path = resolveRelativePath(path != null ? path : location, currentLocation);
73688
+ // empty path means a relative query or hash `?foo=f`, `#thing`
73689
+ return {
73690
+ fullPath: path + (searchString && '?') + searchString + hash,
73691
+ path,
73692
+ query,
73693
+ hash: decode(hash),
73694
+ };
73695
+ }
73696
+ /**
73697
+ * Stringifies a URL object
73698
+ *
73699
+ * @param stringifyQuery
73700
+ * @param location
73701
+ */
73702
+ function stringifyURL(stringifyQuery, location) {
73703
+ const query = location.query ? stringifyQuery(location.query) : '';
73704
+ return location.path + (query && '?') + query + (location.hash || '');
73705
+ }
73706
+ /**
73707
+ * Strips off the base from the beginning of a location.pathname in a non-case-sensitive way.
73708
+ *
73709
+ * @param pathname - location.pathname
73710
+ * @param base - base to strip off
73711
+ */
73712
+ function stripBase(pathname, base) {
73713
+ // no base or base is not found at the beginning
73714
+ if (!base || !pathname.toLowerCase().startsWith(base.toLowerCase()))
73715
+ return pathname;
73716
+ return pathname.slice(base.length) || '/';
73717
+ }
73718
+ /**
73719
+ * Checks if two RouteLocation are equal. This means that both locations are
73720
+ * pointing towards the same {@link RouteRecord} and that all `params`, `query`
73721
+ * parameters and `hash` are the same
73722
+ *
73723
+ * @param stringifyQuery - A function that takes a query object of type LocationQueryRaw and returns a string representation of it.
73724
+ * @param a - first {@link RouteLocation}
73725
+ * @param b - second {@link RouteLocation}
73726
+ */
73727
+ function isSameRouteLocation(stringifyQuery, a, b) {
73728
+ const aLastIndex = a.matched.length - 1;
73729
+ const bLastIndex = b.matched.length - 1;
73730
+ return (aLastIndex > -1 &&
73731
+ aLastIndex === bLastIndex &&
73732
+ isSameRouteRecord(a.matched[aLastIndex], b.matched[bLastIndex]) &&
73733
+ isSameRouteLocationParams(a.params, b.params) &&
73734
+ stringifyQuery(a.query) === stringifyQuery(b.query) &&
73735
+ a.hash === b.hash);
73736
+ }
73737
+ /**
73738
+ * Check if two `RouteRecords` are equal. Takes into account aliases: they are
73739
+ * considered equal to the `RouteRecord` they are aliasing.
73740
+ *
73741
+ * @param a - first {@link RouteRecord}
73742
+ * @param b - second {@link RouteRecord}
73743
+ */
73744
+ function isSameRouteRecord(a, b) {
73745
+ // since the original record has an undefined value for aliasOf
73746
+ // but all aliases point to the original record, this will always compare
73747
+ // the original record
73748
+ return (a.aliasOf || a) === (b.aliasOf || b);
73749
+ }
73750
+ function isSameRouteLocationParams(a, b) {
73751
+ if (Object.keys(a).length !== Object.keys(b).length)
73752
+ return false;
73753
+ for (const key in a) {
73754
+ if (!isSameRouteLocationParamsValue(a[key], b[key]))
73755
+ return false;
73756
+ }
73757
+ return true;
73758
+ }
73759
+ function isSameRouteLocationParamsValue(a, b) {
73760
+ return vue_router_isArray(a)
73761
+ ? isEquivalentArray(a, b)
73762
+ : vue_router_isArray(b)
73763
+ ? isEquivalentArray(b, a)
73764
+ : a === b;
73765
+ }
73766
+ /**
73767
+ * Check if two arrays are the same or if an array with one single entry is the
73768
+ * same as another primitive value. Used to check query and parameters
73769
+ *
73770
+ * @param a - array of values
73771
+ * @param b - array of values or a single value
73772
+ */
73773
+ function isEquivalentArray(a, b) {
73774
+ return vue_router_isArray(b)
73775
+ ? a.length === b.length && a.every((value, i) => value === b[i])
73776
+ : a.length === 1 && a[0] === b;
73777
+ }
73778
+ /**
73779
+ * Resolves a relative path that starts with `.`.
73780
+ *
73781
+ * @param to - path location we are resolving
73782
+ * @param from - currentLocation.path, should start with `/`
73783
+ */
73784
+ function resolveRelativePath(to, from) {
73785
+ if (to.startsWith('/'))
73786
+ return to;
73787
+ if (false) // removed by dead control flow
73788
+ {}
73789
+ if (!to)
73790
+ return from;
73791
+ const fromSegments = from.split('/');
73792
+ const toSegments = to.split('/');
73793
+ const lastToSegment = toSegments[toSegments.length - 1];
73794
+ // make . and ./ the same (../ === .., ../../ === ../..)
73795
+ // this is the same behavior as new URL()
73796
+ if (lastToSegment === '..' || lastToSegment === '.') {
73797
+ toSegments.push('');
73798
+ }
73799
+ let position = fromSegments.length - 1;
73800
+ let toPosition;
73801
+ let segment;
73802
+ for (toPosition = 0; toPosition < toSegments.length; toPosition++) {
73803
+ segment = toSegments[toPosition];
73804
+ // we stay on the same position
73805
+ if (segment === '.')
73806
+ continue;
73807
+ // go up in the from array
73808
+ if (segment === '..') {
73809
+ // we can't go below zero, but we still need to increment toPosition
73810
+ if (position > 1)
73811
+ position--;
73812
+ // continue
73813
+ }
73814
+ // we reached a non-relative path, we stop here
73815
+ else
73816
+ break;
73817
+ }
73818
+ return (fromSegments.slice(0, position).join('/') +
73819
+ '/' +
73820
+ toSegments.slice(toPosition).join('/'));
73821
+ }
73822
+ /**
73823
+ * Initial route location where the router is. Can be used in navigation guards
73824
+ * to differentiate the initial navigation.
73825
+ *
73826
+ * @example
73827
+ * ```js
73828
+ * import { START_LOCATION } from 'vue-router'
73829
+ *
73830
+ * router.beforeEach((to, from) => {
73831
+ * if (from === START_LOCATION) {
73832
+ * // initial navigation
73833
+ * }
73834
+ * })
73835
+ * ```
73836
+ */
73837
+ const START_LOCATION_NORMALIZED = {
73838
+ path: '/',
73839
+ // TODO: could we use a symbol in the future?
73840
+ name: undefined,
73841
+ params: {},
73842
+ query: {},
73843
+ hash: '',
73844
+ fullPath: '/',
73845
+ matched: [],
73846
+ meta: {},
73847
+ redirectedFrom: undefined,
73848
+ };
73849
+
73850
+ var NavigationType;
73851
+ (function (NavigationType) {
73852
+ NavigationType["pop"] = "pop";
73853
+ NavigationType["push"] = "push";
73854
+ })(NavigationType || (NavigationType = {}));
73855
+ var NavigationDirection;
73856
+ (function (NavigationDirection) {
73857
+ NavigationDirection["back"] = "back";
73858
+ NavigationDirection["forward"] = "forward";
73859
+ NavigationDirection["unknown"] = "";
73860
+ })(NavigationDirection || (NavigationDirection = {}));
73861
+ /**
73862
+ * Starting location for Histories
73863
+ */
73864
+ const START = '';
73865
+ // Generic utils
73866
+ /**
73867
+ * Normalizes a base by removing any trailing slash and reading the base tag if
73868
+ * present.
73869
+ *
73870
+ * @param base - base to normalize
73871
+ */
73872
+ function normalizeBase(base) {
73873
+ if (!base) {
73874
+ if (vue_router_isBrowser) {
73875
+ // respect <base> tag
73876
+ const baseEl = document.querySelector('base');
73877
+ base = (baseEl && baseEl.getAttribute('href')) || '/';
73878
+ // strip full URL origin
73879
+ base = base.replace(/^\w+:\/\/[^\/]+/, '');
73880
+ }
73881
+ else {
73882
+ base = '/';
73883
+ }
73884
+ }
73885
+ // ensure leading slash when it was removed by the regex above avoid leading
73886
+ // slash with hash because the file could be read from the disk like file://
73887
+ // and the leading slash would cause problems
73888
+ if (base[0] !== '/' && base[0] !== '#')
73889
+ base = '/' + base;
73890
+ // remove the trailing slash so all other method can just do `base + fullPath`
73891
+ // to build an href
73892
+ return removeTrailingSlash(base);
73893
+ }
73894
+ // remove any character before the hash
73895
+ const BEFORE_HASH_RE = /^[^#]+#/;
73896
+ function createHref(base, location) {
73897
+ return base.replace(BEFORE_HASH_RE, '#') + location;
73898
+ }
73899
+
73900
+ function getElementPosition(el, offset) {
73901
+ const docRect = document.documentElement.getBoundingClientRect();
73902
+ const elRect = el.getBoundingClientRect();
73903
+ return {
73904
+ behavior: offset.behavior,
73905
+ left: elRect.left - docRect.left - (offset.left || 0),
73906
+ top: elRect.top - docRect.top - (offset.top || 0),
73907
+ };
73908
+ }
73909
+ const computeScrollPosition = () => ({
73910
+ left: window.scrollX,
73911
+ top: window.scrollY,
73912
+ });
73913
+ function scrollToPosition(position) {
73914
+ let scrollToOptions;
73915
+ if ('el' in position) {
73916
+ const positionEl = position.el;
73917
+ const isIdSelector = typeof positionEl === 'string' && positionEl.startsWith('#');
73918
+ /**
73919
+ * `id`s can accept pretty much any characters, including CSS combinators
73920
+ * like `>` or `~`. It's still possible to retrieve elements using
73921
+ * `document.getElementById('~')` but it needs to be escaped when using
73922
+ * `document.querySelector('#\\~')` for it to be valid. The only
73923
+ * requirements for `id`s are them to be unique on the page and to not be
73924
+ * empty (`id=""`). Because of that, when passing an id selector, it should
73925
+ * be properly escaped for it to work with `querySelector`. We could check
73926
+ * for the id selector to be simple (no CSS combinators `+ >~`) but that
73927
+ * would make things inconsistent since they are valid characters for an
73928
+ * `id` but would need to be escaped when using `querySelector`, breaking
73929
+ * their usage and ending up in no selector returned. Selectors need to be
73930
+ * escaped:
73931
+ *
73932
+ * - `#1-thing` becomes `#\31 -thing`
73933
+ * - `#with~symbols` becomes `#with\\~symbols`
73934
+ *
73935
+ * - More information about the topic can be found at
73936
+ * https://mathiasbynens.be/notes/html5-id-class.
73937
+ * - Practical example: https://mathiasbynens.be/demo/html5-id
73938
+ */
73939
+ if (false) // removed by dead control flow
73940
+ {}
73941
+ const el = typeof positionEl === 'string'
73942
+ ? isIdSelector
73943
+ ? document.getElementById(positionEl.slice(1))
73944
+ : document.querySelector(positionEl)
73945
+ : positionEl;
73946
+ if (!el) {
73947
+ ( false) &&
73948
+ 0;
73949
+ return;
73950
+ }
73951
+ scrollToOptions = getElementPosition(el, position);
73952
+ }
73953
+ else {
73954
+ scrollToOptions = position;
73955
+ }
73956
+ if ('scrollBehavior' in document.documentElement.style)
73957
+ window.scrollTo(scrollToOptions);
73958
+ else {
73959
+ window.scrollTo(scrollToOptions.left != null ? scrollToOptions.left : window.scrollX, scrollToOptions.top != null ? scrollToOptions.top : window.scrollY);
73960
+ }
73961
+ }
73962
+ function getScrollKey(path, delta) {
73963
+ const position = history.state ? history.state.position - delta : -1;
73964
+ return position + path;
73965
+ }
73966
+ const scrollPositions = new Map();
73967
+ function saveScrollPosition(key, scrollPosition) {
73968
+ scrollPositions.set(key, scrollPosition);
73969
+ }
73970
+ function getSavedScrollPosition(key) {
73971
+ const scroll = scrollPositions.get(key);
73972
+ // consume it so it's not used again
73973
+ scrollPositions.delete(key);
73974
+ return scroll;
73975
+ }
73976
+ // TODO: RFC about how to save scroll position
73977
+ /**
73978
+ * ScrollBehavior instance used by the router to compute and restore the scroll
73979
+ * position when navigating.
73980
+ */
73981
+ // export interface ScrollHandler<ScrollPositionEntry extends HistoryStateValue, ScrollPosition extends ScrollPositionEntry> {
73982
+ // // returns a scroll position that can be saved in history
73983
+ // compute(): ScrollPositionEntry
73984
+ // // can take an extended ScrollPositionEntry
73985
+ // scroll(position: ScrollPosition): void
73986
+ // }
73987
+ // export const scrollHandler: ScrollHandler<ScrollPosition> = {
73988
+ // compute: computeScroll,
73989
+ // scroll: scrollToPosition,
73990
+ // }
73991
+
73992
+ let createBaseLocation = () => location.protocol + '//' + location.host;
73993
+ /**
73994
+ * Creates a normalized history location from a window.location object
73995
+ * @param base - The base path
73996
+ * @param location - The window.location object
73997
+ */
73998
+ function createCurrentLocation(base, location) {
73999
+ const { pathname, search, hash } = location;
74000
+ // allows hash bases like #, /#, #/, #!, #!/, /#!/, or even /folder#end
74001
+ const hashPos = base.indexOf('#');
74002
+ if (hashPos > -1) {
74003
+ let slicePos = hash.includes(base.slice(hashPos))
74004
+ ? base.slice(hashPos).length
74005
+ : 1;
74006
+ let pathFromHash = hash.slice(slicePos);
74007
+ // prepend the starting slash to hash so the url starts with /#
74008
+ if (pathFromHash[0] !== '/')
74009
+ pathFromHash = '/' + pathFromHash;
74010
+ return stripBase(pathFromHash, '');
74011
+ }
74012
+ const path = stripBase(pathname, base);
74013
+ return path + search + hash;
74014
+ }
74015
+ function useHistoryListeners(base, historyState, currentLocation, replace) {
74016
+ let listeners = [];
74017
+ let teardowns = [];
74018
+ // TODO: should it be a stack? a Dict. Check if the popstate listener
74019
+ // can trigger twice
74020
+ let pauseState = null;
74021
+ const popStateHandler = ({ state, }) => {
74022
+ const to = createCurrentLocation(base, location);
74023
+ const from = currentLocation.value;
74024
+ const fromState = historyState.value;
74025
+ let delta = 0;
74026
+ if (state) {
74027
+ currentLocation.value = to;
74028
+ historyState.value = state;
74029
+ // ignore the popstate and reset the pauseState
74030
+ if (pauseState && pauseState === from) {
74031
+ pauseState = null;
74032
+ return;
74033
+ }
74034
+ delta = fromState ? state.position - fromState.position : 0;
74035
+ }
74036
+ else {
74037
+ replace(to);
74038
+ }
74039
+ // Here we could also revert the navigation by calling history.go(-delta)
74040
+ // this listener will have to be adapted to not trigger again and to wait for the url
74041
+ // to be updated before triggering the listeners. Some kind of validation function would also
74042
+ // need to be passed to the listeners so the navigation can be accepted
74043
+ // call all listeners
74044
+ listeners.forEach(listener => {
74045
+ listener(currentLocation.value, from, {
74046
+ delta,
74047
+ type: NavigationType.pop,
74048
+ direction: delta
74049
+ ? delta > 0
74050
+ ? NavigationDirection.forward
74051
+ : NavigationDirection.back
74052
+ : NavigationDirection.unknown,
74053
+ });
74054
+ });
74055
+ };
74056
+ function pauseListeners() {
74057
+ pauseState = currentLocation.value;
74058
+ }
74059
+ function listen(callback) {
74060
+ // set up the listener and prepare teardown callbacks
74061
+ listeners.push(callback);
74062
+ const teardown = () => {
74063
+ const index = listeners.indexOf(callback);
74064
+ if (index > -1)
74065
+ listeners.splice(index, 1);
74066
+ };
74067
+ teardowns.push(teardown);
74068
+ return teardown;
74069
+ }
74070
+ function beforeUnloadListener() {
74071
+ const { history } = window;
74072
+ if (!history.state)
74073
+ return;
74074
+ history.replaceState(vue_router_assign({}, history.state, { scroll: computeScrollPosition() }), '');
74075
+ }
74076
+ function destroy() {
74077
+ for (const teardown of teardowns)
74078
+ teardown();
74079
+ teardowns = [];
74080
+ window.removeEventListener('popstate', popStateHandler);
74081
+ window.removeEventListener('beforeunload', beforeUnloadListener);
74082
+ }
74083
+ // set up the listeners and prepare teardown callbacks
74084
+ window.addEventListener('popstate', popStateHandler);
74085
+ // TODO: could we use 'pagehide' or 'visibilitychange' instead?
74086
+ // https://developer.chrome.com/blog/page-lifecycle-api/
74087
+ window.addEventListener('beforeunload', beforeUnloadListener, {
74088
+ passive: true,
74089
+ });
74090
+ return {
74091
+ pauseListeners,
74092
+ listen,
74093
+ destroy,
74094
+ };
74095
+ }
74096
+ /**
74097
+ * Creates a state object
74098
+ */
74099
+ function buildState(back, current, forward, replaced = false, computeScroll = false) {
74100
+ return {
74101
+ back,
74102
+ current,
74103
+ forward,
74104
+ replaced,
74105
+ position: window.history.length,
74106
+ scroll: computeScroll ? computeScrollPosition() : null,
74107
+ };
74108
+ }
74109
+ function useHistoryStateNavigation(base) {
74110
+ const { history, location } = window;
74111
+ // private variables
74112
+ const currentLocation = {
74113
+ value: createCurrentLocation(base, location),
74114
+ };
74115
+ const historyState = { value: history.state };
74116
+ // build current history entry as this is a fresh navigation
74117
+ if (!historyState.value) {
74118
+ changeLocation(currentLocation.value, {
74119
+ back: null,
74120
+ current: currentLocation.value,
74121
+ forward: null,
74122
+ // the length is off by one, we need to decrease it
74123
+ position: history.length - 1,
74124
+ replaced: true,
74125
+ // don't add a scroll as the user may have an anchor, and we want
74126
+ // scrollBehavior to be triggered without a saved position
74127
+ scroll: null,
74128
+ }, true);
74129
+ }
74130
+ function changeLocation(to, state, replace) {
74131
+ /**
74132
+ * if a base tag is provided, and we are on a normal domain, we have to
74133
+ * respect the provided `base` attribute because pushState() will use it and
74134
+ * potentially erase anything before the `#` like at
74135
+ * https://github.com/vuejs/router/issues/685 where a base of
74136
+ * `/folder/#` but a base of `/` would erase the `/folder/` section. If
74137
+ * there is no host, the `<base>` tag makes no sense and if there isn't a
74138
+ * base tag we can just use everything after the `#`.
74139
+ */
74140
+ const hashIndex = base.indexOf('#');
74141
+ const url = hashIndex > -1
74142
+ ? (location.host && document.querySelector('base')
74143
+ ? base
74144
+ : base.slice(hashIndex)) + to
74145
+ : createBaseLocation() + base + to;
74146
+ try {
74147
+ // BROWSER QUIRK
74148
+ // NOTE: Safari throws a SecurityError when calling this function 100 times in 30 seconds
74149
+ history[replace ? 'replaceState' : 'pushState'](state, '', url);
74150
+ historyState.value = state;
74151
+ }
74152
+ catch (err) {
74153
+ if ((false)) // removed by dead control flow
74154
+ {}
74155
+ else {
74156
+ console.error(err);
74157
+ }
74158
+ // Force the navigation, this also resets the call count
74159
+ location[replace ? 'replace' : 'assign'](url);
74160
+ }
74161
+ }
74162
+ function replace(to, data) {
74163
+ const state = vue_router_assign({}, history.state, buildState(historyState.value.back,
74164
+ // keep back and forward entries but override current position
74165
+ to, historyState.value.forward, true), data, { position: historyState.value.position });
74166
+ changeLocation(to, state, true);
74167
+ currentLocation.value = to;
74168
+ }
74169
+ function push(to, data) {
74170
+ // Add to current entry the information of where we are going
74171
+ // as well as saving the current position
74172
+ const currentState = vue_router_assign({},
74173
+ // use current history state to gracefully handle a wrong call to
74174
+ // history.replaceState
74175
+ // https://github.com/vuejs/router/issues/366
74176
+ historyState.value, history.state, {
74177
+ forward: to,
74178
+ scroll: computeScrollPosition(),
74179
+ });
74180
+ if (false) // removed by dead control flow
74181
+ {}
74182
+ changeLocation(currentState.current, currentState, true);
74183
+ const state = vue_router_assign({}, buildState(currentLocation.value, to, null), { position: currentState.position + 1 }, data);
74184
+ changeLocation(to, state, false);
74185
+ currentLocation.value = to;
74186
+ }
74187
+ return {
74188
+ location: currentLocation,
74189
+ state: historyState,
74190
+ push,
74191
+ replace,
74192
+ };
74193
+ }
74194
+ /**
74195
+ * Creates an HTML5 history. Most common history for single page applications.
74196
+ *
74197
+ * @param base -
74198
+ */
74199
+ function createWebHistory(base) {
74200
+ base = normalizeBase(base);
74201
+ const historyNavigation = useHistoryStateNavigation(base);
74202
+ const historyListeners = useHistoryListeners(base, historyNavigation.state, historyNavigation.location, historyNavigation.replace);
74203
+ function go(delta, triggerListeners = true) {
74204
+ if (!triggerListeners)
74205
+ historyListeners.pauseListeners();
74206
+ history.go(delta);
74207
+ }
74208
+ const routerHistory = vue_router_assign({
74209
+ // it's overridden right after
74210
+ location: '',
74211
+ base,
74212
+ go,
74213
+ createHref: createHref.bind(null, base),
74214
+ }, historyNavigation, historyListeners);
74215
+ Object.defineProperty(routerHistory, 'location', {
74216
+ enumerable: true,
74217
+ get: () => historyNavigation.location.value,
74218
+ });
74219
+ Object.defineProperty(routerHistory, 'state', {
74220
+ enumerable: true,
74221
+ get: () => historyNavigation.state.value,
74222
+ });
74223
+ return routerHistory;
74224
+ }
74225
+
74226
+ /**
74227
+ * Creates an in-memory based history. The main purpose of this history is to handle SSR. It starts in a special location that is nowhere.
74228
+ * It's up to the user to replace that location with the starter location by either calling `router.push` or `router.replace`.
74229
+ *
74230
+ * @param base - Base applied to all urls, defaults to '/'
74231
+ * @returns a history object that can be passed to the router constructor
74232
+ */
74233
+ function createMemoryHistory(base = '') {
74234
+ let listeners = [];
74235
+ let queue = [[START, {}]];
74236
+ let position = 0;
74237
+ base = normalizeBase(base);
74238
+ function setLocation(location, state = {}) {
74239
+ position++;
74240
+ if (position !== queue.length) {
74241
+ // we are in the middle, we remove everything from here in the queue
74242
+ queue.splice(position);
74243
+ }
74244
+ queue.push([location, state]);
74245
+ }
74246
+ function triggerListeners(to, from, { direction, delta }) {
74247
+ const info = {
74248
+ direction,
74249
+ delta,
74250
+ type: NavigationType.pop,
74251
+ };
74252
+ for (const callback of listeners) {
74253
+ callback(to, from, info);
74254
+ }
74255
+ }
74256
+ const routerHistory = {
74257
+ // rewritten by Object.defineProperty
74258
+ location: START,
74259
+ // rewritten by Object.defineProperty
74260
+ state: {},
74261
+ base,
74262
+ createHref: createHref.bind(null, base),
74263
+ replace(to, state) {
74264
+ // remove current entry and decrement position
74265
+ queue.splice(position--, 1);
74266
+ setLocation(to, state);
74267
+ },
74268
+ push(to, state) {
74269
+ setLocation(to, state);
74270
+ },
74271
+ listen(callback) {
74272
+ listeners.push(callback);
74273
+ return () => {
74274
+ const index = listeners.indexOf(callback);
74275
+ if (index > -1)
74276
+ listeners.splice(index, 1);
74277
+ };
74278
+ },
74279
+ destroy() {
74280
+ listeners = [];
74281
+ queue = [[START, {}]];
74282
+ position = 0;
74283
+ },
74284
+ go(delta, shouldTrigger = true) {
74285
+ const from = this.location;
74286
+ const direction =
74287
+ // we are considering delta === 0 going forward, but in abstract mode
74288
+ // using 0 for the delta doesn't make sense like it does in html5 where
74289
+ // it reloads the page
74290
+ delta < 0 ? NavigationDirection.back : NavigationDirection.forward;
74291
+ position = Math.max(0, Math.min(position + delta, queue.length - 1));
74292
+ if (shouldTrigger) {
74293
+ triggerListeners(this.location, from, {
74294
+ direction,
74295
+ delta,
74296
+ });
74297
+ }
74298
+ },
74299
+ };
74300
+ Object.defineProperty(routerHistory, 'location', {
74301
+ enumerable: true,
74302
+ get: () => queue[position][0],
74303
+ });
74304
+ Object.defineProperty(routerHistory, 'state', {
74305
+ enumerable: true,
74306
+ get: () => queue[position][1],
74307
+ });
74308
+ return routerHistory;
74309
+ }
74310
+
74311
+ /**
74312
+ * Creates a hash history. Useful for web applications with no host (e.g. `file://`) or when configuring a server to
74313
+ * handle any URL is not possible.
74314
+ *
74315
+ * @param base - optional base to provide. Defaults to `location.pathname + location.search` If there is a `<base>` tag
74316
+ * in the `head`, its value will be ignored in favor of this parameter **but note it affects all the history.pushState()
74317
+ * calls**, meaning that if you use a `<base>` tag, it's `href` value **has to match this parameter** (ignoring anything
74318
+ * after the `#`).
74319
+ *
74320
+ * @example
74321
+ * ```js
74322
+ * // at https://example.com/folder
74323
+ * createWebHashHistory() // gives a url of `https://example.com/folder#`
74324
+ * createWebHashHistory('/folder/') // gives a url of `https://example.com/folder/#`
74325
+ * // if the `#` is provided in the base, it won't be added by `createWebHashHistory`
74326
+ * createWebHashHistory('/folder/#/app/') // gives a url of `https://example.com/folder/#/app/`
74327
+ * // you should avoid doing this because it changes the original url and breaks copying urls
74328
+ * createWebHashHistory('/other-folder/') // gives a url of `https://example.com/other-folder/#`
74329
+ *
74330
+ * // at file:///usr/etc/folder/index.html
74331
+ * // for locations with no `host`, the base is ignored
74332
+ * createWebHashHistory('/iAmIgnored') // gives a url of `file:///usr/etc/folder/index.html#`
74333
+ * ```
74334
+ */
74335
+ function createWebHashHistory(base) {
74336
+ // Make sure this implementation is fine in terms of encoding, specially for IE11
74337
+ // for `file://`, directly use the pathname and ignore the base
74338
+ // location.pathname contains an initial `/` even at the root: `https://example.com`
74339
+ base = location.host ? base || location.pathname + location.search : '';
74340
+ // allow the user to provide a `#` in the middle: `/base/#/app`
74341
+ if (!base.includes('#'))
74342
+ base += '#';
74343
+ if (false) // removed by dead control flow
74344
+ {}
74345
+ return createWebHistory(base);
74346
+ }
74347
+
74348
+ function isRouteLocation(route) {
74349
+ return typeof route === 'string' || (route && typeof route === 'object');
74350
+ }
74351
+ function isRouteName(name) {
74352
+ return typeof name === 'string' || typeof name === 'symbol';
74353
+ }
74354
+
74355
+ const NavigationFailureSymbol = Symbol(( false) ? 0 : '');
74356
+ /**
74357
+ * Enumeration with all possible types for navigation failures. Can be passed to
74358
+ * {@link isNavigationFailure} to check for specific failures.
74359
+ */
74360
+ var NavigationFailureType;
74361
+ (function (NavigationFailureType) {
74362
+ /**
74363
+ * An aborted navigation is a navigation that failed because a navigation
74364
+ * guard returned `false` or called `next(false)`
74365
+ */
74366
+ NavigationFailureType[NavigationFailureType["aborted"] = 4] = "aborted";
74367
+ /**
74368
+ * A cancelled navigation is a navigation that failed because a more recent
74369
+ * navigation finished started (not necessarily finished).
74370
+ */
74371
+ NavigationFailureType[NavigationFailureType["cancelled"] = 8] = "cancelled";
74372
+ /**
74373
+ * A duplicated navigation is a navigation that failed because it was
74374
+ * initiated while already being at the exact same location.
74375
+ */
74376
+ NavigationFailureType[NavigationFailureType["duplicated"] = 16] = "duplicated";
74377
+ })(NavigationFailureType || (NavigationFailureType = {}));
74378
+ // DEV only debug messages
74379
+ const ErrorTypeMessages = {
74380
+ [1 /* ErrorTypes.MATCHER_NOT_FOUND */]({ location, currentLocation }) {
74381
+ return `No match for\n ${JSON.stringify(location)}${currentLocation
74382
+ ? '\nwhile being at\n' + JSON.stringify(currentLocation)
74383
+ : ''}`;
74384
+ },
74385
+ [2 /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */]({ from, to, }) {
74386
+ return `Redirected from "${from.fullPath}" to "${stringifyRoute(to)}" via a navigation guard.`;
74387
+ },
74388
+ [4 /* ErrorTypes.NAVIGATION_ABORTED */]({ from, to }) {
74389
+ return `Navigation aborted from "${from.fullPath}" to "${to.fullPath}" via a navigation guard.`;
74390
+ },
74391
+ [8 /* ErrorTypes.NAVIGATION_CANCELLED */]({ from, to }) {
74392
+ return `Navigation cancelled from "${from.fullPath}" to "${to.fullPath}" with a new navigation.`;
74393
+ },
74394
+ [16 /* ErrorTypes.NAVIGATION_DUPLICATED */]({ from, to }) {
74395
+ return `Avoided redundant navigation to current location: "${from.fullPath}".`;
74396
+ },
74397
+ };
74398
+ /**
74399
+ * Creates a typed NavigationFailure object.
74400
+ * @internal
74401
+ * @param type - NavigationFailureType
74402
+ * @param params - { from, to }
74403
+ */
74404
+ function createRouterError(type, params) {
74405
+ // keep full error messages in cjs versions
74406
+ if (false) // removed by dead control flow
74407
+ {}
74408
+ else {
74409
+ return vue_router_assign(new Error(), {
74410
+ type,
74411
+ [NavigationFailureSymbol]: true,
74412
+ }, params);
74413
+ }
74414
+ }
74415
+ function isNavigationFailure(error, type) {
74416
+ return (error instanceof Error &&
74417
+ NavigationFailureSymbol in error &&
74418
+ (type == null || !!(error.type & type)));
74419
+ }
74420
+ const propertiesToLog = ['params', 'query', 'hash'];
74421
+ function stringifyRoute(to) {
74422
+ if (typeof to === 'string')
74423
+ return to;
74424
+ if (to.path != null)
74425
+ return to.path;
74426
+ const location = {};
74427
+ for (const key of propertiesToLog) {
74428
+ if (key in to)
74429
+ location[key] = to[key];
74430
+ }
74431
+ return JSON.stringify(location, null, 2);
74432
+ }
74433
+
74434
+ // default pattern for a param: non-greedy everything but /
74435
+ const BASE_PARAM_PATTERN = '[^/]+?';
74436
+ const BASE_PATH_PARSER_OPTIONS = {
74437
+ sensitive: false,
74438
+ strict: false,
74439
+ start: true,
74440
+ end: true,
74441
+ };
74442
+ // Special Regex characters that must be escaped in static tokens
74443
+ const REGEX_CHARS_RE = /[.+*?^${}()[\]/\\]/g;
74444
+ /**
74445
+ * Creates a path parser from an array of Segments (a segment is an array of Tokens)
74446
+ *
74447
+ * @param segments - array of segments returned by tokenizePath
74448
+ * @param extraOptions - optional options for the regexp
74449
+ * @returns a PathParser
74450
+ */
74451
+ function tokensToParser(segments, extraOptions) {
74452
+ const options = vue_router_assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);
74453
+ // the amount of scores is the same as the length of segments except for the root segment "/"
74454
+ const score = [];
74455
+ // the regexp as a string
74456
+ let pattern = options.start ? '^' : '';
74457
+ // extracted keys
74458
+ const keys = [];
74459
+ for (const segment of segments) {
74460
+ // the root segment needs special treatment
74461
+ const segmentScores = segment.length ? [] : [90 /* PathScore.Root */];
74462
+ // allow trailing slash
74463
+ if (options.strict && !segment.length)
74464
+ pattern += '/';
74465
+ for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {
74466
+ const token = segment[tokenIndex];
74467
+ // resets the score if we are inside a sub-segment /:a-other-:b
74468
+ let subSegmentScore = 40 /* PathScore.Segment */ +
74469
+ (options.sensitive ? 0.25 /* PathScore.BonusCaseSensitive */ : 0);
74470
+ if (token.type === 0 /* TokenType.Static */) {
74471
+ // prepend the slash if we are starting a new segment
74472
+ if (!tokenIndex)
74473
+ pattern += '/';
74474
+ pattern += token.value.replace(REGEX_CHARS_RE, '\\$&');
74475
+ subSegmentScore += 40 /* PathScore.Static */;
74476
+ }
74477
+ else if (token.type === 1 /* TokenType.Param */) {
74478
+ const { value, repeatable, optional, regexp } = token;
74479
+ keys.push({
74480
+ name: value,
74481
+ repeatable,
74482
+ optional,
74483
+ });
74484
+ const re = regexp ? regexp : BASE_PARAM_PATTERN;
74485
+ // the user provided a custom regexp /:id(\\d+)
74486
+ if (re !== BASE_PARAM_PATTERN) {
74487
+ subSegmentScore += 10 /* PathScore.BonusCustomRegExp */;
74488
+ // make sure the regexp is valid before using it
74489
+ try {
74490
+ new RegExp(`(${re})`);
74491
+ }
74492
+ catch (err) {
74493
+ throw new Error(`Invalid custom RegExp for param "${value}" (${re}): ` +
74494
+ err.message);
74495
+ }
74496
+ }
74497
+ // when we repeat we must take care of the repeating leading slash
74498
+ let subPattern = repeatable ? `((?:${re})(?:/(?:${re}))*)` : `(${re})`;
74499
+ // prepend the slash if we are starting a new segment
74500
+ if (!tokenIndex)
74501
+ subPattern =
74502
+ // avoid an optional / if there are more segments e.g. /:p?-static
74503
+ // or /:p?-:p2
74504
+ optional && segment.length < 2
74505
+ ? `(?:/${subPattern})`
74506
+ : '/' + subPattern;
74507
+ if (optional)
74508
+ subPattern += '?';
74509
+ pattern += subPattern;
74510
+ subSegmentScore += 20 /* PathScore.Dynamic */;
74511
+ if (optional)
74512
+ subSegmentScore += -8 /* PathScore.BonusOptional */;
74513
+ if (repeatable)
74514
+ subSegmentScore += -20 /* PathScore.BonusRepeatable */;
74515
+ if (re === '.*')
74516
+ subSegmentScore += -50 /* PathScore.BonusWildcard */;
74517
+ }
74518
+ segmentScores.push(subSegmentScore);
74519
+ }
74520
+ // an empty array like /home/ -> [[{home}], []]
74521
+ // if (!segment.length) pattern += '/'
74522
+ score.push(segmentScores);
74523
+ }
74524
+ // only apply the strict bonus to the last score
74525
+ if (options.strict && options.end) {
74526
+ const i = score.length - 1;
74527
+ score[i][score[i].length - 1] += 0.7000000000000001 /* PathScore.BonusStrict */;
74528
+ }
74529
+ // TODO: dev only warn double trailing slash
74530
+ if (!options.strict)
74531
+ pattern += '/?';
74532
+ if (options.end)
74533
+ pattern += '$';
74534
+ // allow paths like /dynamic to only match dynamic or dynamic/... but not dynamic_something_else
74535
+ else if (options.strict && !pattern.endsWith('/'))
74536
+ pattern += '(?:/|$)';
74537
+ const re = new RegExp(pattern, options.sensitive ? '' : 'i');
74538
+ function parse(path) {
74539
+ const match = path.match(re);
74540
+ const params = {};
74541
+ if (!match)
74542
+ return null;
74543
+ for (let i = 1; i < match.length; i++) {
74544
+ const value = match[i] || '';
74545
+ const key = keys[i - 1];
74546
+ params[key.name] = value && key.repeatable ? value.split('/') : value;
74547
+ }
74548
+ return params;
74549
+ }
74550
+ function stringify(params) {
74551
+ let path = '';
74552
+ // for optional parameters to allow to be empty
74553
+ let avoidDuplicatedSlash = false;
74554
+ for (const segment of segments) {
74555
+ if (!avoidDuplicatedSlash || !path.endsWith('/'))
74556
+ path += '/';
74557
+ avoidDuplicatedSlash = false;
74558
+ for (const token of segment) {
74559
+ if (token.type === 0 /* TokenType.Static */) {
74560
+ path += token.value;
74561
+ }
74562
+ else if (token.type === 1 /* TokenType.Param */) {
74563
+ const { value, repeatable, optional } = token;
74564
+ const param = value in params ? params[value] : '';
74565
+ if (vue_router_isArray(param) && !repeatable) {
74566
+ throw new Error(`Provided param "${value}" is an array but it is not repeatable (* or + modifiers)`);
74567
+ }
74568
+ const text = vue_router_isArray(param)
74569
+ ? param.join('/')
74570
+ : param;
74571
+ if (!text) {
74572
+ if (optional) {
74573
+ // if we have more than one optional param like /:a?-static we don't need to care about the optional param
74574
+ if (segment.length < 2) {
74575
+ // remove the last slash as we could be at the end
74576
+ if (path.endsWith('/'))
74577
+ path = path.slice(0, -1);
74578
+ // do not append a slash on the next iteration
74579
+ else
74580
+ avoidDuplicatedSlash = true;
74581
+ }
74582
+ }
74583
+ else
74584
+ throw new Error(`Missing required param "${value}"`);
74585
+ }
74586
+ path += text;
74587
+ }
74588
+ }
74589
+ }
74590
+ // avoid empty path when we have multiple optional params
74591
+ return path || '/';
74592
+ }
74593
+ return {
74594
+ re,
74595
+ score,
74596
+ keys,
74597
+ parse,
74598
+ stringify,
74599
+ };
74600
+ }
74601
+ /**
74602
+ * Compares an array of numbers as used in PathParser.score and returns a
74603
+ * number. This function can be used to `sort` an array
74604
+ *
74605
+ * @param a - first array of numbers
74606
+ * @param b - second array of numbers
74607
+ * @returns 0 if both are equal, < 0 if a should be sorted first, > 0 if b
74608
+ * should be sorted first
74609
+ */
74610
+ function compareScoreArray(a, b) {
74611
+ let i = 0;
74612
+ while (i < a.length && i < b.length) {
74613
+ const diff = b[i] - a[i];
74614
+ // only keep going if diff === 0
74615
+ if (diff)
74616
+ return diff;
74617
+ i++;
74618
+ }
74619
+ // if the last subsegment was Static, the shorter segments should be sorted first
74620
+ // otherwise sort the longest segment first
74621
+ if (a.length < b.length) {
74622
+ return a.length === 1 && a[0] === 40 /* PathScore.Static */ + 40 /* PathScore.Segment */
74623
+ ? -1
74624
+ : 1;
74625
+ }
74626
+ else if (a.length > b.length) {
74627
+ return b.length === 1 && b[0] === 40 /* PathScore.Static */ + 40 /* PathScore.Segment */
74628
+ ? 1
74629
+ : -1;
74630
+ }
74631
+ return 0;
74632
+ }
74633
+ /**
74634
+ * Compare function that can be used with `sort` to sort an array of PathParser
74635
+ *
74636
+ * @param a - first PathParser
74637
+ * @param b - second PathParser
74638
+ * @returns 0 if both are equal, < 0 if a should be sorted first, > 0 if b
74639
+ */
74640
+ function comparePathParserScore(a, b) {
74641
+ let i = 0;
74642
+ const aScore = a.score;
74643
+ const bScore = b.score;
74644
+ while (i < aScore.length && i < bScore.length) {
74645
+ const comp = compareScoreArray(aScore[i], bScore[i]);
74646
+ // do not return if both are equal
74647
+ if (comp)
74648
+ return comp;
74649
+ i++;
74650
+ }
74651
+ if (Math.abs(bScore.length - aScore.length) === 1) {
74652
+ if (isLastScoreNegative(aScore))
74653
+ return 1;
74654
+ if (isLastScoreNegative(bScore))
74655
+ return -1;
74656
+ }
74657
+ // if a and b share the same score entries but b has more, sort b first
74658
+ return bScore.length - aScore.length;
74659
+ // this is the ternary version
74660
+ // return aScore.length < bScore.length
74661
+ // ? 1
74662
+ // : aScore.length > bScore.length
74663
+ // ? -1
74664
+ // : 0
74665
+ }
74666
+ /**
74667
+ * This allows detecting splats at the end of a path: /home/:id(.*)*
74668
+ *
74669
+ * @param score - score to check
74670
+ * @returns true if the last entry is negative
74671
+ */
74672
+ function isLastScoreNegative(score) {
74673
+ const last = score[score.length - 1];
74674
+ return score.length > 0 && last[last.length - 1] < 0;
74675
+ }
74676
+
74677
+ const ROOT_TOKEN = {
74678
+ type: 0 /* TokenType.Static */,
74679
+ value: '',
74680
+ };
74681
+ const VALID_PARAM_RE = /[a-zA-Z0-9_]/;
74682
+ // After some profiling, the cache seems to be unnecessary because tokenizePath
74683
+ // (the slowest part of adding a route) is very fast
74684
+ // const tokenCache = new Map<string, Token[][]>()
74685
+ function tokenizePath(path) {
74686
+ if (!path)
74687
+ return [[]];
74688
+ if (path === '/')
74689
+ return [[ROOT_TOKEN]];
74690
+ if (!path.startsWith('/')) {
74691
+ throw new Error(( false)
74692
+ ? 0
74693
+ : `Invalid path "${path}"`);
74694
+ }
74695
+ // if (tokenCache.has(path)) return tokenCache.get(path)!
74696
+ function crash(message) {
74697
+ throw new Error(`ERR (${state})/"${buffer}": ${message}`);
74698
+ }
74699
+ let state = 0 /* TokenizerState.Static */;
74700
+ let previousState = state;
74701
+ const tokens = [];
74702
+ // the segment will always be valid because we get into the initial state
74703
+ // with the leading /
74704
+ let segment;
74705
+ function finalizeSegment() {
74706
+ if (segment)
74707
+ tokens.push(segment);
74708
+ segment = [];
74709
+ }
74710
+ // index on the path
74711
+ let i = 0;
74712
+ // char at index
74713
+ let char;
74714
+ // buffer of the value read
74715
+ let buffer = '';
74716
+ // custom regexp for a param
74717
+ let customRe = '';
74718
+ function consumeBuffer() {
74719
+ if (!buffer)
74720
+ return;
74721
+ if (state === 0 /* TokenizerState.Static */) {
74722
+ segment.push({
74723
+ type: 0 /* TokenType.Static */,
74724
+ value: buffer,
74725
+ });
74726
+ }
74727
+ else if (state === 1 /* TokenizerState.Param */ ||
74728
+ state === 2 /* TokenizerState.ParamRegExp */ ||
74729
+ state === 3 /* TokenizerState.ParamRegExpEnd */) {
74730
+ if (segment.length > 1 && (char === '*' || char === '+'))
74731
+ crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);
74732
+ segment.push({
74733
+ type: 1 /* TokenType.Param */,
74734
+ value: buffer,
74735
+ regexp: customRe,
74736
+ repeatable: char === '*' || char === '+',
74737
+ optional: char === '*' || char === '?',
74738
+ });
74739
+ }
74740
+ else {
74741
+ crash('Invalid state to consume buffer');
74742
+ }
74743
+ buffer = '';
74744
+ }
74745
+ function addCharToBuffer() {
74746
+ buffer += char;
74747
+ }
74748
+ while (i < path.length) {
74749
+ char = path[i++];
74750
+ if (char === '\\' && state !== 2 /* TokenizerState.ParamRegExp */) {
74751
+ previousState = state;
74752
+ state = 4 /* TokenizerState.EscapeNext */;
74753
+ continue;
74754
+ }
74755
+ switch (state) {
74756
+ case 0 /* TokenizerState.Static */:
74757
+ if (char === '/') {
74758
+ if (buffer) {
74759
+ consumeBuffer();
74760
+ }
74761
+ finalizeSegment();
74762
+ }
74763
+ else if (char === ':') {
74764
+ consumeBuffer();
74765
+ state = 1 /* TokenizerState.Param */;
74766
+ }
74767
+ else {
74768
+ addCharToBuffer();
74769
+ }
74770
+ break;
74771
+ case 4 /* TokenizerState.EscapeNext */:
74772
+ addCharToBuffer();
74773
+ state = previousState;
74774
+ break;
74775
+ case 1 /* TokenizerState.Param */:
74776
+ if (char === '(') {
74777
+ state = 2 /* TokenizerState.ParamRegExp */;
74778
+ }
74779
+ else if (VALID_PARAM_RE.test(char)) {
74780
+ addCharToBuffer();
74781
+ }
74782
+ else {
74783
+ consumeBuffer();
74784
+ state = 0 /* TokenizerState.Static */;
74785
+ // go back one character if we were not modifying
74786
+ if (char !== '*' && char !== '?' && char !== '+')
74787
+ i--;
74788
+ }
74789
+ break;
74790
+ case 2 /* TokenizerState.ParamRegExp */:
74791
+ // TODO: is it worth handling nested regexp? like :p(?:prefix_([^/]+)_suffix)
74792
+ // it already works by escaping the closing )
74793
+ // https://paths.esm.dev/?p=AAMeJbiAwQEcDKbAoAAkP60PG2R6QAvgNaA6AFACM2ABuQBB#
74794
+ // is this really something people need since you can also write
74795
+ // /prefix_:p()_suffix
74796
+ if (char === ')') {
74797
+ // handle the escaped )
74798
+ if (customRe[customRe.length - 1] == '\\')
74799
+ customRe = customRe.slice(0, -1) + char;
74800
+ else
74801
+ state = 3 /* TokenizerState.ParamRegExpEnd */;
74802
+ }
74803
+ else {
74804
+ customRe += char;
74805
+ }
74806
+ break;
74807
+ case 3 /* TokenizerState.ParamRegExpEnd */:
74808
+ // same as finalizing a param
74809
+ consumeBuffer();
74810
+ state = 0 /* TokenizerState.Static */;
74811
+ // go back one character if we were not modifying
74812
+ if (char !== '*' && char !== '?' && char !== '+')
74813
+ i--;
74814
+ customRe = '';
74815
+ break;
74816
+ default:
74817
+ crash('Unknown state');
74818
+ break;
74819
+ }
74820
+ }
74821
+ if (state === 2 /* TokenizerState.ParamRegExp */)
74822
+ crash(`Unfinished custom RegExp for param "${buffer}"`);
74823
+ consumeBuffer();
74824
+ finalizeSegment();
74825
+ // tokenCache.set(path, tokens)
74826
+ return tokens;
74827
+ }
74828
+
74829
+ function createRouteRecordMatcher(record, parent, options) {
74830
+ const parser = tokensToParser(tokenizePath(record.path), options);
74831
+ // warn against params with the same name
74832
+ if ((false)) // removed by dead control flow
74833
+ {}
74834
+ const matcher = vue_router_assign(parser, {
74835
+ record,
74836
+ parent,
74837
+ // these needs to be populated by the parent
74838
+ children: [],
74839
+ alias: [],
74840
+ });
74841
+ if (parent) {
74842
+ // both are aliases or both are not aliases
74843
+ // we don't want to mix them because the order is used when
74844
+ // passing originalRecord in Matcher.addRoute
74845
+ if (!matcher.record.aliasOf === !parent.record.aliasOf)
74846
+ parent.children.push(matcher);
74847
+ }
74848
+ return matcher;
74849
+ }
74850
+
74851
+ /**
74852
+ * Creates a Router Matcher.
74853
+ *
74854
+ * @internal
74855
+ * @param routes - array of initial routes
74856
+ * @param globalOptions - global route options
74857
+ */
74858
+ function createRouterMatcher(routes, globalOptions) {
74859
+ // normalized ordered array of matchers
74860
+ const matchers = [];
74861
+ const matcherMap = new Map();
74862
+ globalOptions = mergeOptions({ strict: false, end: true, sensitive: false }, globalOptions);
74863
+ function getRecordMatcher(name) {
74864
+ return matcherMap.get(name);
74865
+ }
74866
+ function addRoute(record, parent, originalRecord) {
74867
+ // used later on to remove by name
74868
+ const isRootAdd = !originalRecord;
74869
+ const mainNormalizedRecord = normalizeRouteRecord(record);
74870
+ if ((false)) // removed by dead control flow
74871
+ {}
74872
+ // we might be the child of an alias
74873
+ mainNormalizedRecord.aliasOf = originalRecord && originalRecord.record;
74874
+ const options = mergeOptions(globalOptions, record);
74875
+ // generate an array of records to correctly handle aliases
74876
+ const normalizedRecords = [mainNormalizedRecord];
74877
+ if ('alias' in record) {
74878
+ const aliases = typeof record.alias === 'string' ? [record.alias] : record.alias;
74879
+ for (const alias of aliases) {
74880
+ normalizedRecords.push(
74881
+ // we need to normalize again to ensure the `mods` property
74882
+ // being non enumerable
74883
+ normalizeRouteRecord(vue_router_assign({}, mainNormalizedRecord, {
74884
+ // this allows us to hold a copy of the `components` option
74885
+ // so that async components cache is hold on the original record
74886
+ components: originalRecord
74887
+ ? originalRecord.record.components
74888
+ : mainNormalizedRecord.components,
74889
+ path: alias,
74890
+ // we might be the child of an alias
74891
+ aliasOf: originalRecord
74892
+ ? originalRecord.record
74893
+ : mainNormalizedRecord,
74894
+ // the aliases are always of the same kind as the original since they
74895
+ // are defined on the same record
74896
+ })));
74897
+ }
74898
+ }
74899
+ let matcher;
74900
+ let originalMatcher;
74901
+ for (const normalizedRecord of normalizedRecords) {
74902
+ const { path } = normalizedRecord;
74903
+ // Build up the path for nested routes if the child isn't an absolute
74904
+ // route. Only add the / delimiter if the child path isn't empty and if the
74905
+ // parent path doesn't have a trailing slash
74906
+ if (parent && path[0] !== '/') {
74907
+ const parentPath = parent.record.path;
74908
+ const connectingSlash = parentPath[parentPath.length - 1] === '/' ? '' : '/';
74909
+ normalizedRecord.path =
74910
+ parent.record.path + (path && connectingSlash + path);
74911
+ }
74912
+ if (false) // removed by dead control flow
74913
+ {}
74914
+ // create the object beforehand, so it can be passed to children
74915
+ matcher = createRouteRecordMatcher(normalizedRecord, parent, options);
74916
+ if (false)
74917
+ // removed by dead control flow
74918
+ {}
74919
+ // if we are an alias we must tell the original record that we exist,
74920
+ // so we can be removed
74921
+ if (originalRecord) {
74922
+ originalRecord.alias.push(matcher);
74923
+ if ((false)) // removed by dead control flow
74924
+ {}
74925
+ }
74926
+ else {
74927
+ // otherwise, the first record is the original and others are aliases
74928
+ originalMatcher = originalMatcher || matcher;
74929
+ if (originalMatcher !== matcher)
74930
+ originalMatcher.alias.push(matcher);
74931
+ // remove the route if named and only for the top record (avoid in nested calls)
74932
+ // this works because the original record is the first one
74933
+ if (isRootAdd && record.name && !isAliasRecord(matcher)) {
74934
+ if ((false)) // removed by dead control flow
74935
+ {}
74936
+ removeRoute(record.name);
74937
+ }
74938
+ }
74939
+ // Avoid adding a record that doesn't display anything. This allows passing through records without a component to
74940
+ // not be reached and pass through the catch all route
74941
+ if (isMatchable(matcher)) {
74942
+ insertMatcher(matcher);
74943
+ }
74944
+ if (mainNormalizedRecord.children) {
74945
+ const children = mainNormalizedRecord.children;
74946
+ for (let i = 0; i < children.length; i++) {
74947
+ addRoute(children[i], matcher, originalRecord && originalRecord.children[i]);
74948
+ }
74949
+ }
74950
+ // if there was no original record, then the first one was not an alias and all
74951
+ // other aliases (if any) need to reference this record when adding children
74952
+ originalRecord = originalRecord || matcher;
74953
+ // TODO: add normalized records for more flexibility
74954
+ // if (parent && isAliasRecord(originalRecord)) {
74955
+ // parent.children.push(originalRecord)
74956
+ // }
74957
+ }
74958
+ return originalMatcher
74959
+ ? () => {
74960
+ // since other matchers are aliases, they should be removed by the original matcher
74961
+ removeRoute(originalMatcher);
74962
+ }
74963
+ : vue_router_noop;
74964
+ }
74965
+ function removeRoute(matcherRef) {
74966
+ if (isRouteName(matcherRef)) {
74967
+ const matcher = matcherMap.get(matcherRef);
74968
+ if (matcher) {
74969
+ matcherMap.delete(matcherRef);
74970
+ matchers.splice(matchers.indexOf(matcher), 1);
74971
+ matcher.children.forEach(removeRoute);
74972
+ matcher.alias.forEach(removeRoute);
74973
+ }
74974
+ }
74975
+ else {
74976
+ const index = matchers.indexOf(matcherRef);
74977
+ if (index > -1) {
74978
+ matchers.splice(index, 1);
74979
+ if (matcherRef.record.name)
74980
+ matcherMap.delete(matcherRef.record.name);
74981
+ matcherRef.children.forEach(removeRoute);
74982
+ matcherRef.alias.forEach(removeRoute);
74983
+ }
74984
+ }
74985
+ }
74986
+ function getRoutes() {
74987
+ return matchers;
74988
+ }
74989
+ function insertMatcher(matcher) {
74990
+ const index = findInsertionIndex(matcher, matchers);
74991
+ matchers.splice(index, 0, matcher);
74992
+ // only add the original record to the name map
74993
+ if (matcher.record.name && !isAliasRecord(matcher))
74994
+ matcherMap.set(matcher.record.name, matcher);
74995
+ }
74996
+ function resolve(location, currentLocation) {
74997
+ let matcher;
74998
+ let params = {};
74999
+ let path;
75000
+ let name;
75001
+ if ('name' in location && location.name) {
75002
+ matcher = matcherMap.get(location.name);
75003
+ if (!matcher)
75004
+ throw createRouterError(1 /* ErrorTypes.MATCHER_NOT_FOUND */, {
75005
+ location,
75006
+ });
75007
+ // warn if the user is passing invalid params so they can debug it better when they get removed
75008
+ if ((false)) // removed by dead control flow
75009
+ {}
75010
+ name = matcher.record.name;
75011
+ params = vue_router_assign(
75012
+ // paramsFromLocation is a new object
75013
+ paramsFromLocation(currentLocation.params,
75014
+ // only keep params that exist in the resolved location
75015
+ // only keep optional params coming from a parent record
75016
+ matcher.keys
75017
+ .filter(k => !k.optional)
75018
+ .concat(matcher.parent ? matcher.parent.keys.filter(k => k.optional) : [])
75019
+ .map(k => k.name)),
75020
+ // discard any existing params in the current location that do not exist here
75021
+ // #1497 this ensures better active/exact matching
75022
+ location.params &&
75023
+ paramsFromLocation(location.params, matcher.keys.map(k => k.name)));
75024
+ // throws if cannot be stringified
75025
+ path = matcher.stringify(params);
75026
+ }
75027
+ else if (location.path != null) {
75028
+ // no need to resolve the path with the matcher as it was provided
75029
+ // this also allows the user to control the encoding
75030
+ path = location.path;
75031
+ if (false) // removed by dead control flow
75032
+ {}
75033
+ matcher = matchers.find(m => m.re.test(path));
75034
+ // matcher should have a value after the loop
75035
+ if (matcher) {
75036
+ // we know the matcher works because we tested the regexp
75037
+ params = matcher.parse(path);
75038
+ name = matcher.record.name;
75039
+ }
75040
+ // location is a relative path
75041
+ }
75042
+ else {
75043
+ // match by name or path of current route
75044
+ matcher = currentLocation.name
75045
+ ? matcherMap.get(currentLocation.name)
75046
+ : matchers.find(m => m.re.test(currentLocation.path));
75047
+ if (!matcher)
75048
+ throw createRouterError(1 /* ErrorTypes.MATCHER_NOT_FOUND */, {
75049
+ location,
75050
+ currentLocation,
75051
+ });
75052
+ name = matcher.record.name;
75053
+ // since we are navigating to the same location, we don't need to pick the
75054
+ // params like when `name` is provided
75055
+ params = vue_router_assign({}, currentLocation.params, location.params);
75056
+ path = matcher.stringify(params);
75057
+ }
75058
+ const matched = [];
75059
+ let parentMatcher = matcher;
75060
+ while (parentMatcher) {
75061
+ // reversed order so parents are at the beginning
75062
+ matched.unshift(parentMatcher.record);
75063
+ parentMatcher = parentMatcher.parent;
75064
+ }
75065
+ return {
75066
+ name,
75067
+ path,
75068
+ params,
75069
+ matched,
75070
+ meta: mergeMetaFields(matched),
75071
+ };
75072
+ }
75073
+ // add initial routes
75074
+ routes.forEach(route => addRoute(route));
75075
+ function clearRoutes() {
75076
+ matchers.length = 0;
75077
+ matcherMap.clear();
75078
+ }
75079
+ return {
75080
+ addRoute,
75081
+ resolve,
75082
+ removeRoute,
75083
+ clearRoutes,
75084
+ getRoutes,
75085
+ getRecordMatcher,
75086
+ };
75087
+ }
75088
+ function paramsFromLocation(params, keys) {
75089
+ const newParams = {};
75090
+ for (const key of keys) {
75091
+ if (key in params)
75092
+ newParams[key] = params[key];
75093
+ }
75094
+ return newParams;
75095
+ }
75096
+ /**
75097
+ * Normalizes a RouteRecordRaw. Creates a copy
75098
+ *
75099
+ * @param record
75100
+ * @returns the normalized version
75101
+ */
75102
+ function normalizeRouteRecord(record) {
75103
+ const normalized = {
75104
+ path: record.path,
75105
+ redirect: record.redirect,
75106
+ name: record.name,
75107
+ meta: record.meta || {},
75108
+ aliasOf: record.aliasOf,
75109
+ beforeEnter: record.beforeEnter,
75110
+ props: normalizeRecordProps(record),
75111
+ children: record.children || [],
75112
+ instances: {},
75113
+ leaveGuards: new Set(),
75114
+ updateGuards: new Set(),
75115
+ enterCallbacks: {},
75116
+ // must be declared afterwards
75117
+ // mods: {},
75118
+ components: 'components' in record
75119
+ ? record.components || null
75120
+ : record.component && { default: record.component },
75121
+ };
75122
+ // mods contain modules and shouldn't be copied,
75123
+ // logged or anything. It's just used for internal
75124
+ // advanced use cases like data loaders
75125
+ Object.defineProperty(normalized, 'mods', {
75126
+ value: {},
75127
+ });
75128
+ return normalized;
75129
+ }
75130
+ /**
75131
+ * Normalize the optional `props` in a record to always be an object similar to
75132
+ * components. Also accept a boolean for components.
75133
+ * @param record
75134
+ */
75135
+ function normalizeRecordProps(record) {
75136
+ const propsObject = {};
75137
+ // props does not exist on redirect records, but we can set false directly
75138
+ const props = record.props || false;
75139
+ if ('component' in record) {
75140
+ propsObject.default = props;
75141
+ }
75142
+ else {
75143
+ // NOTE: we could also allow a function to be applied to every component.
75144
+ // Would need user feedback for use cases
75145
+ for (const name in record.components)
75146
+ propsObject[name] = typeof props === 'object' ? props[name] : props;
75147
+ }
75148
+ return propsObject;
75149
+ }
75150
+ /**
75151
+ * Checks if a record or any of its parent is an alias
75152
+ * @param record
75153
+ */
75154
+ function isAliasRecord(record) {
75155
+ while (record) {
75156
+ if (record.record.aliasOf)
75157
+ return true;
75158
+ record = record.parent;
75159
+ }
75160
+ return false;
75161
+ }
75162
+ /**
75163
+ * Merge meta fields of an array of records
75164
+ *
75165
+ * @param matched - array of matched records
75166
+ */
75167
+ function mergeMetaFields(matched) {
75168
+ return matched.reduce((meta, record) => vue_router_assign(meta, record.meta), {});
75169
+ }
75170
+ function mergeOptions(defaults, partialOptions) {
75171
+ const options = {};
75172
+ for (const key in defaults) {
75173
+ options[key] = key in partialOptions ? partialOptions[key] : defaults[key];
75174
+ }
75175
+ return options;
75176
+ }
75177
+ function isSameParam(a, b) {
75178
+ return (a.name === b.name &&
75179
+ a.optional === b.optional &&
75180
+ a.repeatable === b.repeatable);
75181
+ }
75182
+ /**
75183
+ * Check if a path and its alias have the same required params
75184
+ *
75185
+ * @param a - original record
75186
+ * @param b - alias record
75187
+ */
75188
+ function checkSameParams(a, b) {
75189
+ for (const key of a.keys) {
75190
+ if (!key.optional && !b.keys.find(isSameParam.bind(null, key)))
75191
+ return vue_router_warn(`Alias "${b.record.path}" and the original record: "${a.record.path}" must have the exact same param named "${key.name}"`);
75192
+ }
75193
+ for (const key of b.keys) {
75194
+ if (!key.optional && !a.keys.find(isSameParam.bind(null, key)))
75195
+ return vue_router_warn(`Alias "${b.record.path}" and the original record: "${a.record.path}" must have the exact same param named "${key.name}"`);
75196
+ }
75197
+ }
75198
+ /**
75199
+ * A route with a name and a child with an empty path without a name should warn when adding the route
75200
+ *
75201
+ * @param mainNormalizedRecord - RouteRecordNormalized
75202
+ * @param parent - RouteRecordMatcher
75203
+ */
75204
+ function checkChildMissingNameWithEmptyPath(mainNormalizedRecord, parent) {
75205
+ if (parent &&
75206
+ parent.record.name &&
75207
+ !mainNormalizedRecord.name &&
75208
+ !mainNormalizedRecord.path) {
75209
+ vue_router_warn(`The route named "${String(parent.record.name)}" has a child without a name and an empty path. Using that name won't render the empty path child so you probably want to move the name to the child instead. If this is intentional, add a name to the child route to remove the warning.`);
75210
+ }
75211
+ }
75212
+ function checkSameNameAsAncestor(record, parent) {
75213
+ for (let ancestor = parent; ancestor; ancestor = ancestor.parent) {
75214
+ if (ancestor.record.name === record.name) {
75215
+ throw new Error(`A route named "${String(record.name)}" has been added as a ${parent === ancestor ? 'child' : 'descendant'} of a route with the same name. Route names must be unique and a nested route cannot use the same name as an ancestor.`);
75216
+ }
75217
+ }
75218
+ }
75219
+ function checkMissingParamsInAbsolutePath(record, parent) {
75220
+ for (const key of parent.keys) {
75221
+ if (!record.keys.find(isSameParam.bind(null, key)))
75222
+ return vue_router_warn(`Absolute path "${record.record.path}" must have the exact same param named "${key.name}" as its parent "${parent.record.path}".`);
75223
+ }
75224
+ }
75225
+ /**
75226
+ * Performs a binary search to find the correct insertion index for a new matcher.
75227
+ *
75228
+ * Matchers are primarily sorted by their score. If scores are tied then we also consider parent/child relationships,
75229
+ * with descendants coming before ancestors. If there's still a tie, new routes are inserted after existing routes.
75230
+ *
75231
+ * @param matcher - new matcher to be inserted
75232
+ * @param matchers - existing matchers
75233
+ */
75234
+ function findInsertionIndex(matcher, matchers) {
75235
+ // First phase: binary search based on score
75236
+ let lower = 0;
75237
+ let upper = matchers.length;
75238
+ while (lower !== upper) {
75239
+ const mid = (lower + upper) >> 1;
75240
+ const sortOrder = comparePathParserScore(matcher, matchers[mid]);
75241
+ if (sortOrder < 0) {
75242
+ upper = mid;
75243
+ }
75244
+ else {
75245
+ lower = mid + 1;
75246
+ }
75247
+ }
75248
+ // Second phase: check for an ancestor with the same score
75249
+ const insertionAncestor = getInsertionAncestor(matcher);
75250
+ if (insertionAncestor) {
75251
+ upper = matchers.lastIndexOf(insertionAncestor, upper - 1);
75252
+ if (false) // removed by dead control flow
75253
+ {}
75254
+ }
75255
+ return upper;
75256
+ }
75257
+ function getInsertionAncestor(matcher) {
75258
+ let ancestor = matcher;
75259
+ while ((ancestor = ancestor.parent)) {
75260
+ if (isMatchable(ancestor) &&
75261
+ comparePathParserScore(matcher, ancestor) === 0) {
75262
+ return ancestor;
75263
+ }
75264
+ }
75265
+ return;
75266
+ }
75267
+ /**
75268
+ * Checks if a matcher can be reachable. This means if it's possible to reach it as a route. For example, routes without
75269
+ * a component, or name, or redirect, are just used to group other routes.
75270
+ * @param matcher
75271
+ * @param matcher.record record of the matcher
75272
+ * @returns
75273
+ */
75274
+ function isMatchable({ record }) {
75275
+ return !!(record.name ||
75276
+ (record.components && Object.keys(record.components).length) ||
75277
+ record.redirect);
75278
+ }
75279
+
75280
+ /**
75281
+ * Transforms a queryString into a {@link LocationQuery} object. Accept both, a
75282
+ * version with the leading `?` and without Should work as URLSearchParams
75283
+
75284
+ * @internal
75285
+ *
75286
+ * @param search - search string to parse
75287
+ * @returns a query object
75288
+ */
75289
+ function parseQuery(search) {
75290
+ const query = {};
75291
+ // avoid creating an object with an empty key and empty value
75292
+ // because of split('&')
75293
+ if (search === '' || search === '?')
75294
+ return query;
75295
+ const hasLeadingIM = search[0] === '?';
75296
+ const searchParams = (hasLeadingIM ? search.slice(1) : search).split('&');
75297
+ for (let i = 0; i < searchParams.length; ++i) {
75298
+ // pre decode the + into space
75299
+ const searchParam = searchParams[i].replace(PLUS_RE, ' ');
75300
+ // allow the = character
75301
+ const eqPos = searchParam.indexOf('=');
75302
+ const key = decode(eqPos < 0 ? searchParam : searchParam.slice(0, eqPos));
75303
+ const value = eqPos < 0 ? null : decode(searchParam.slice(eqPos + 1));
75304
+ if (key in query) {
75305
+ // an extra variable for ts types
75306
+ let currentValue = query[key];
75307
+ if (!vue_router_isArray(currentValue)) {
75308
+ currentValue = query[key] = [currentValue];
75309
+ }
75310
+ currentValue.push(value);
75311
+ }
75312
+ else {
75313
+ query[key] = value;
75314
+ }
75315
+ }
75316
+ return query;
75317
+ }
75318
+ /**
75319
+ * Stringifies a {@link LocationQueryRaw} object. Like `URLSearchParams`, it
75320
+ * doesn't prepend a `?`
75321
+ *
75322
+ * @internal
75323
+ *
75324
+ * @param query - query object to stringify
75325
+ * @returns string version of the query without the leading `?`
75326
+ */
75327
+ function stringifyQuery(query) {
75328
+ let search = '';
75329
+ for (let key in query) {
75330
+ const value = query[key];
75331
+ key = encodeQueryKey(key);
75332
+ if (value == null) {
75333
+ // only null adds the value
75334
+ if (value !== undefined) {
75335
+ search += (search.length ? '&' : '') + key;
75336
+ }
75337
+ continue;
75338
+ }
75339
+ // keep null values
75340
+ const values = vue_router_isArray(value)
75341
+ ? value.map(v => v && encodeQueryValue(v))
75342
+ : [value && encodeQueryValue(value)];
75343
+ values.forEach(value => {
75344
+ // skip undefined values in arrays as if they were not present
75345
+ // smaller code than using filter
75346
+ if (value !== undefined) {
75347
+ // only append & with non-empty search
75348
+ search += (search.length ? '&' : '') + key;
75349
+ if (value != null)
75350
+ search += '=' + value;
75351
+ }
75352
+ });
75353
+ }
75354
+ return search;
75355
+ }
75356
+ /**
75357
+ * Transforms a {@link LocationQueryRaw} into a {@link LocationQuery} by casting
75358
+ * numbers into strings, removing keys with an undefined value and replacing
75359
+ * undefined with null in arrays
75360
+ *
75361
+ * @param query - query object to normalize
75362
+ * @returns a normalized query object
75363
+ */
75364
+ function normalizeQuery(query) {
75365
+ const normalizedQuery = {};
75366
+ for (const key in query) {
75367
+ const value = query[key];
75368
+ if (value !== undefined) {
75369
+ normalizedQuery[key] = vue_router_isArray(value)
75370
+ ? value.map(v => (v == null ? null : '' + v))
75371
+ : value == null
75372
+ ? value
75373
+ : '' + value;
75374
+ }
75375
+ }
75376
+ return normalizedQuery;
75377
+ }
75378
+
75379
+ /**
75380
+ * RouteRecord being rendered by the closest ancestor Router View. Used for
75381
+ * `onBeforeRouteUpdate` and `onBeforeRouteLeave`. rvlm stands for Router View
75382
+ * Location Matched
75383
+ *
75384
+ * @internal
75385
+ */
75386
+ const matchedRouteKey = Symbol(( false) ? 0 : '');
75387
+ /**
75388
+ * Allows overriding the router view depth to control which component in
75389
+ * `matched` is rendered. rvd stands for Router View Depth
75390
+ *
75391
+ * @internal
75392
+ */
75393
+ const viewDepthKey = Symbol(( false) ? 0 : '');
75394
+ /**
75395
+ * Allows overriding the router instance returned by `useRouter` in tests. r
75396
+ * stands for router
75397
+ *
75398
+ * @internal
75399
+ */
75400
+ const routerKey = Symbol(( false) ? 0 : '');
75401
+ /**
75402
+ * Allows overriding the current route returned by `useRoute` in tests. rl
75403
+ * stands for route location
75404
+ *
75405
+ * @internal
75406
+ */
75407
+ const routeLocationKey = Symbol(( false) ? 0 : '');
75408
+ /**
75409
+ * Allows overriding the current route used by router-view. Internally this is
75410
+ * used when the `route` prop is passed.
75411
+ *
75412
+ * @internal
75413
+ */
75414
+ const routerViewLocationKey = Symbol(( false) ? 0 : '');
75415
+
75416
+ /**
75417
+ * Create a list of callbacks that can be reset. Used to create before and after navigation guards list
75418
+ */
75419
+ function useCallbacks() {
75420
+ let handlers = [];
75421
+ function add(handler) {
75422
+ handlers.push(handler);
75423
+ return () => {
75424
+ const i = handlers.indexOf(handler);
75425
+ if (i > -1)
75426
+ handlers.splice(i, 1);
75427
+ };
75428
+ }
75429
+ function reset() {
75430
+ handlers = [];
75431
+ }
75432
+ return {
75433
+ add,
75434
+ list: () => handlers.slice(),
75435
+ reset,
75436
+ };
75437
+ }
75438
+
75439
+ function registerGuard(record, name, guard) {
75440
+ const removeFromList = () => {
75441
+ record[name].delete(guard);
75442
+ };
75443
+ onUnmounted(removeFromList);
75444
+ onDeactivated(removeFromList);
75445
+ onActivated(() => {
75446
+ record[name].add(guard);
75447
+ });
75448
+ record[name].add(guard);
75449
+ }
75450
+ /**
75451
+ * Add a navigation guard that triggers whenever the component for the current
75452
+ * location is about to be left. Similar to {@link beforeRouteLeave} but can be
75453
+ * used in any component. The guard is removed when the component is unmounted.
75454
+ *
75455
+ * @param leaveGuard - {@link NavigationGuard}
75456
+ */
75457
+ function onBeforeRouteLeave(leaveGuard) {
75458
+ if (false) // removed by dead control flow
75459
+ {}
75460
+ const activeRecord = inject(matchedRouteKey,
75461
+ // to avoid warning
75462
+ {}).value;
75463
+ if (!activeRecord) {
75464
+ ( false) &&
75465
+ 0;
75466
+ return;
75467
+ }
75468
+ registerGuard(activeRecord, 'leaveGuards', leaveGuard);
75469
+ }
75470
+ /**
75471
+ * Add a navigation guard that triggers whenever the current location is about
75472
+ * to be updated. Similar to {@link beforeRouteUpdate} but can be used in any
75473
+ * component. The guard is removed when the component is unmounted.
75474
+ *
75475
+ * @param updateGuard - {@link NavigationGuard}
75476
+ */
75477
+ function onBeforeRouteUpdate(updateGuard) {
75478
+ if (false) // removed by dead control flow
75479
+ {}
75480
+ const activeRecord = inject(matchedRouteKey,
75481
+ // to avoid warning
75482
+ {}).value;
75483
+ if (!activeRecord) {
75484
+ ( false) &&
75485
+ 0;
75486
+ return;
75487
+ }
75488
+ registerGuard(activeRecord, 'updateGuards', updateGuard);
75489
+ }
75490
+ function guardToPromiseFn(guard, to, from, record, name, runWithContext = fn => fn()) {
75491
+ // keep a reference to the enterCallbackArray to prevent pushing callbacks if a new navigation took place
75492
+ const enterCallbackArray = record &&
75493
+ // name is defined if record is because of the function overload
75494
+ (record.enterCallbacks[name] = record.enterCallbacks[name] || []);
75495
+ return () => new Promise((resolve, reject) => {
75496
+ const next = (valid) => {
75497
+ if (valid === false) {
75498
+ reject(createRouterError(4 /* ErrorTypes.NAVIGATION_ABORTED */, {
75499
+ from,
75500
+ to,
75501
+ }));
75502
+ }
75503
+ else if (valid instanceof Error) {
75504
+ reject(valid);
75505
+ }
75506
+ else if (isRouteLocation(valid)) {
75507
+ reject(createRouterError(2 /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */, {
75508
+ from: to,
75509
+ to: valid,
75510
+ }));
75511
+ }
75512
+ else {
75513
+ if (enterCallbackArray &&
75514
+ // since enterCallbackArray is truthy, both record and name also are
75515
+ record.enterCallbacks[name] === enterCallbackArray &&
75516
+ typeof valid === 'function') {
75517
+ enterCallbackArray.push(valid);
75518
+ }
75519
+ resolve();
75520
+ }
75521
+ };
75522
+ // wrapping with Promise.resolve allows it to work with both async and sync guards
75523
+ const guardReturn = runWithContext(() => guard.call(record && record.instances[name], to, from, ( false) ? 0 : next));
75524
+ let guardCall = Promise.resolve(guardReturn);
75525
+ if (guard.length < 3)
75526
+ guardCall = guardCall.then(next);
75527
+ if (false) // removed by dead control flow
75528
+ {}
75529
+ guardCall.catch(err => reject(err));
75530
+ });
75531
+ }
75532
+ function canOnlyBeCalledOnce(next, to, from) {
75533
+ let called = 0;
75534
+ return function () {
75535
+ if (called++ === 1)
75536
+ vue_router_warn(`The "next" callback was called more than once in one navigation guard when going from "${from.fullPath}" to "${to.fullPath}". It should be called exactly one time in each navigation guard. This will fail in production.`);
75537
+ // @ts-expect-error: we put it in the original one because it's easier to check
75538
+ next._called = true;
75539
+ if (called === 1)
75540
+ next.apply(null, arguments);
75541
+ };
75542
+ }
75543
+ function extractComponentsGuards(matched, guardType, to, from, runWithContext = fn => fn()) {
75544
+ const guards = [];
75545
+ for (const record of matched) {
75546
+ if (false) // removed by dead control flow
75547
+ {}
75548
+ for (const name in record.components) {
75549
+ let rawComponent = record.components[name];
75550
+ if ((false)) // removed by dead control flow
75551
+ {}
75552
+ // skip update and leave guards if the route component is not mounted
75553
+ if (guardType !== 'beforeRouteEnter' && !record.instances[name])
75554
+ continue;
75555
+ if (isRouteComponent(rawComponent)) {
75556
+ // __vccOpts is added by vue-class-component and contain the regular options
75557
+ const options = rawComponent.__vccOpts || rawComponent;
75558
+ const guard = options[guardType];
75559
+ guard &&
75560
+ guards.push(guardToPromiseFn(guard, to, from, record, name, runWithContext));
75561
+ }
75562
+ else {
75563
+ // start requesting the chunk already
75564
+ let componentPromise = rawComponent();
75565
+ if (false) // removed by dead control flow
75566
+ {}
75567
+ guards.push(() => componentPromise.then(resolved => {
75568
+ if (!resolved)
75569
+ throw new Error(`Couldn't resolve component "${name}" at "${record.path}"`);
75570
+ const resolvedComponent = isESModule(resolved)
75571
+ ? resolved.default
75572
+ : resolved;
75573
+ // keep the resolved module for plugins like data loaders
75574
+ record.mods[name] = resolved;
75575
+ // replace the function with the resolved component
75576
+ // cannot be null or undefined because we went into the for loop
75577
+ record.components[name] = resolvedComponent;
75578
+ // __vccOpts is added by vue-class-component and contain the regular options
75579
+ const options = resolvedComponent.__vccOpts || resolvedComponent;
75580
+ const guard = options[guardType];
75581
+ return (guard &&
75582
+ guardToPromiseFn(guard, to, from, record, name, runWithContext)());
75583
+ }));
75584
+ }
75585
+ }
75586
+ }
75587
+ return guards;
75588
+ }
75589
+ /**
75590
+ * Ensures a route is loaded, so it can be passed as o prop to `<RouterView>`.
75591
+ *
75592
+ * @param route - resolved route to load
75593
+ */
75594
+ function loadRouteLocation(route) {
75595
+ return route.matched.every(record => record.redirect)
75596
+ ? Promise.reject(new Error('Cannot load a route that redirects.'))
75597
+ : Promise.all(route.matched.map(record => record.components &&
75598
+ Promise.all(Object.keys(record.components).reduce((promises, name) => {
75599
+ const rawComponent = record.components[name];
75600
+ if (typeof rawComponent === 'function' &&
75601
+ !('displayName' in rawComponent)) {
75602
+ promises.push(rawComponent().then(resolved => {
75603
+ if (!resolved)
75604
+ return Promise.reject(new Error(`Couldn't resolve component "${name}" at "${record.path}". Ensure you passed a function that returns a promise.`));
75605
+ const resolvedComponent = isESModule(resolved)
75606
+ ? resolved.default
75607
+ : resolved;
75608
+ // keep the resolved module for plugins like data loaders
75609
+ record.mods[name] = resolved;
75610
+ // replace the function with the resolved component
75611
+ // cannot be null or undefined because we went into the for loop
75612
+ record.components[name] = resolvedComponent;
75613
+ return;
75614
+ }));
75615
+ }
75616
+ return promises;
75617
+ }, [])))).then(() => route);
75618
+ }
75619
+
75620
+ // TODO: we could allow currentRoute as a prop to expose `isActive` and
75621
+ // `isExactActive` behavior should go through an RFC
75622
+ /**
75623
+ * Returns the internal behavior of a {@link RouterLink} without the rendering part.
75624
+ *
75625
+ * @param props - a `to` location and an optional `replace` flag
75626
+ */
75627
+ function useLink(props) {
75628
+ const router = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)(routerKey);
75629
+ const currentRoute = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)(routeLocationKey);
75630
+ let hasPrevious = false;
75631
+ let previousTo = null;
75632
+ const route = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
75633
+ const to = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(props.to);
75634
+ if (false) // removed by dead control flow
75635
+ {}
75636
+ return router.resolve(to);
75637
+ });
75638
+ const activeRecordIndex = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
75639
+ const { matched } = route.value;
75640
+ const { length } = matched;
75641
+ const routeMatched = matched[length - 1];
75642
+ const currentMatched = currentRoute.matched;
75643
+ if (!routeMatched || !currentMatched.length)
75644
+ return -1;
75645
+ const index = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));
75646
+ if (index > -1)
75647
+ return index;
75648
+ // possible parent record
75649
+ const parentRecordPath = getOriginalPath(matched[length - 2]);
75650
+ return (
75651
+ // we are dealing with nested routes
75652
+ length > 1 &&
75653
+ // if the parent and matched route have the same path, this link is
75654
+ // referring to the empty child. Or we currently are on a different
75655
+ // child of the same parent
75656
+ getOriginalPath(routeMatched) === parentRecordPath &&
75657
+ // avoid comparing the child with its parent
75658
+ currentMatched[currentMatched.length - 1].path !== parentRecordPath
75659
+ ? currentMatched.findIndex(isSameRouteRecord.bind(null, matched[length - 2]))
75660
+ : index);
75661
+ });
75662
+ const isActive = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => activeRecordIndex.value > -1 &&
75663
+ includesParams(currentRoute.params, route.value.params));
75664
+ const isExactActive = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => activeRecordIndex.value > -1 &&
75665
+ activeRecordIndex.value === currentRoute.matched.length - 1 &&
75666
+ isSameRouteLocationParams(currentRoute.params, route.value.params));
75667
+ function navigate(e = {}) {
75668
+ if (guardEvent(e)) {
75669
+ const p = router[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(props.replace) ? 'replace' : 'push']((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(props.to)
75670
+ // avoid uncaught errors are they are logged anyway
75671
+ ).catch(vue_router_noop);
75672
+ if (props.viewTransition &&
75673
+ typeof document !== 'undefined' &&
75674
+ 'startViewTransition' in document) {
75675
+ document.startViewTransition(() => p);
75676
+ }
75677
+ return p;
75678
+ }
75679
+ return Promise.resolve();
75680
+ }
75681
+ // devtools only
75682
+ if (false) // removed by dead control flow
75683
+ {}
75684
+ /**
75685
+ * NOTE: update {@link _RouterLinkI}'s `$slots` type when updating this
75686
+ */
75687
+ return {
75688
+ route,
75689
+ href: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => route.value.href),
75690
+ isActive,
75691
+ isExactActive,
75692
+ navigate,
75693
+ };
75694
+ }
75695
+ function preferSingleVNode(vnodes) {
75696
+ return vnodes.length === 1 ? vnodes[0] : vnodes;
75697
+ }
75698
+ const RouterLinkImpl = /*#__PURE__*/ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
75699
+ name: 'RouterLink',
75700
+ compatConfig: { MODE: 3 },
75701
+ props: {
75702
+ to: {
75703
+ type: [String, Object],
75704
+ required: true,
75705
+ },
75706
+ replace: Boolean,
75707
+ activeClass: String,
75708
+ // inactiveClass: String,
75709
+ exactActiveClass: String,
75710
+ custom: Boolean,
75711
+ ariaCurrentValue: {
75712
+ type: String,
75713
+ default: 'page',
75714
+ },
75715
+ viewTransition: Boolean,
75716
+ },
75717
+ useLink,
75718
+ setup(props, { slots }) {
75719
+ const link = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(useLink(props));
75720
+ const { options } = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)(routerKey);
75721
+ const elClass = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => ({
75722
+ [getLinkClass(props.activeClass, options.linkActiveClass, 'router-link-active')]: link.isActive,
75723
+ // [getLinkClass(
75724
+ // props.inactiveClass,
75725
+ // options.linkInactiveClass,
75726
+ // 'router-link-inactive'
75727
+ // )]: !link.isExactActive,
75728
+ [getLinkClass(props.exactActiveClass, options.linkExactActiveClass, 'router-link-exact-active')]: link.isExactActive,
75729
+ }));
75730
+ return () => {
75731
+ const children = slots.default && preferSingleVNode(slots.default(link));
75732
+ return props.custom
75733
+ ? children
75734
+ : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('a', {
75735
+ 'aria-current': link.isExactActive
75736
+ ? props.ariaCurrentValue
75737
+ : null,
75738
+ href: link.href,
75739
+ // this would override user added attrs but Vue will still add
75740
+ // the listener, so we end up triggering both
75741
+ onClick: link.navigate,
75742
+ class: elClass.value,
75743
+ }, children);
75744
+ };
75745
+ },
75746
+ });
75747
+ // export the public type for h/tsx inference
75748
+ // also to avoid inline import() in generated d.ts files
75749
+ /**
75750
+ * Component to render a link that triggers a navigation on click.
75751
+ */
75752
+ const RouterLink = (/* unused pure expression or super */ null && (RouterLinkImpl));
75753
+ function guardEvent(e) {
75754
+ // don't redirect with control keys
75755
+ if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)
75756
+ return;
75757
+ // don't redirect when preventDefault called
75758
+ if (e.defaultPrevented)
75759
+ return;
75760
+ // don't redirect on right click
75761
+ if (e.button !== undefined && e.button !== 0)
75762
+ return;
75763
+ // don't redirect if `target="_blank"`
75764
+ // @ts-expect-error getAttribute does exist
75765
+ if (e.currentTarget && e.currentTarget.getAttribute) {
75766
+ // @ts-expect-error getAttribute exists
75767
+ const target = e.currentTarget.getAttribute('target');
75768
+ if (/\b_blank\b/i.test(target))
75769
+ return;
75770
+ }
75771
+ // this may be a Weex event which doesn't have this method
75772
+ if (e.preventDefault)
75773
+ e.preventDefault();
75774
+ return true;
75775
+ }
75776
+ function includesParams(outer, inner) {
75777
+ for (const key in inner) {
75778
+ const innerValue = inner[key];
75779
+ const outerValue = outer[key];
75780
+ if (typeof innerValue === 'string') {
75781
+ if (innerValue !== outerValue)
75782
+ return false;
75783
+ }
75784
+ else {
75785
+ if (!vue_router_isArray(outerValue) ||
75786
+ outerValue.length !== innerValue.length ||
75787
+ innerValue.some((value, i) => value !== outerValue[i]))
75788
+ return false;
75789
+ }
75790
+ }
75791
+ return true;
75792
+ }
75793
+ /**
75794
+ * Get the original path value of a record by following its aliasOf
75795
+ * @param record
75796
+ */
75797
+ function getOriginalPath(record) {
75798
+ return record ? (record.aliasOf ? record.aliasOf.path : record.path) : '';
75799
+ }
75800
+ /**
75801
+ * Utility class to get the active class based on defaults.
75802
+ * @param propClass
75803
+ * @param globalClass
75804
+ * @param defaultClass
75805
+ */
75806
+ const getLinkClass = (propClass, globalClass, defaultClass) => propClass != null
75807
+ ? propClass
75808
+ : globalClass != null
75809
+ ? globalClass
75810
+ : defaultClass;
75811
+
75812
+ const RouterViewImpl = /*#__PURE__*/ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
75813
+ name: 'RouterView',
75814
+ // #674 we manually inherit them
75815
+ inheritAttrs: false,
75816
+ props: {
75817
+ name: {
75818
+ type: String,
75819
+ default: 'default',
75820
+ },
75821
+ route: Object,
75822
+ },
75823
+ // Better compat for @vue/compat users
75824
+ // https://github.com/vuejs/router/issues/1315
75825
+ compatConfig: { MODE: 3 },
75826
+ setup(props, { attrs, slots }) {
75827
+ ( false) && 0;
75828
+ const injectedRoute = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)(routerViewLocationKey);
75829
+ const routeToDisplay = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => props.route || injectedRoute.value);
75830
+ const injectedDepth = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)(viewDepthKey, 0);
75831
+ // The depth changes based on empty components option, which allows passthrough routes e.g. routes with children
75832
+ // that are used to reuse the `path` property
75833
+ const depth = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
75834
+ let initialDepth = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(injectedDepth);
75835
+ const { matched } = routeToDisplay.value;
75836
+ let matchedRoute;
75837
+ while ((matchedRoute = matched[initialDepth]) &&
75838
+ !matchedRoute.components) {
75839
+ initialDepth++;
75840
+ }
75841
+ return initialDepth;
75842
+ });
75843
+ const matchedRouteRef = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => routeToDisplay.value.matched[depth.value]);
75844
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)(viewDepthKey, (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => depth.value + 1));
75845
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)(matchedRouteKey, matchedRouteRef);
75846
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)(routerViewLocationKey, routeToDisplay);
75847
+ const viewRef = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
75848
+ // watch at the same time the component instance, the route record we are
75849
+ // rendering, and the name
75850
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => [viewRef.value, matchedRouteRef.value, props.name], ([instance, to, name], [oldInstance, from, oldName]) => {
75851
+ // copy reused instances
75852
+ if (to) {
75853
+ // this will update the instance for new instances as well as reused
75854
+ // instances when navigating to a new route
75855
+ to.instances[name] = instance;
75856
+ // the component instance is reused for a different route or name, so
75857
+ // we copy any saved update or leave guards. With async setup, the
75858
+ // mounting component will mount before the matchedRoute changes,
75859
+ // making instance === oldInstance, so we check if guards have been
75860
+ // added before. This works because we remove guards when
75861
+ // unmounting/deactivating components
75862
+ if (from && from !== to && instance && instance === oldInstance) {
75863
+ if (!to.leaveGuards.size) {
75864
+ to.leaveGuards = from.leaveGuards;
75865
+ }
75866
+ if (!to.updateGuards.size) {
75867
+ to.updateGuards = from.updateGuards;
75868
+ }
75869
+ }
75870
+ }
75871
+ // trigger beforeRouteEnter next callbacks
75872
+ if (instance &&
75873
+ to &&
75874
+ // if there is no instance but to and from are the same this might be
75875
+ // the first visit
75876
+ (!from || !isSameRouteRecord(to, from) || !oldInstance)) {
75877
+ (to.enterCallbacks[name] || []).forEach(callback => callback(instance));
75878
+ }
75879
+ }, { flush: 'post' });
75880
+ return () => {
75881
+ const route = routeToDisplay.value;
75882
+ // we need the value at the time we render because when we unmount, we
75883
+ // navigated to a different location so the value is different
75884
+ const currentName = props.name;
75885
+ const matchedRoute = matchedRouteRef.value;
75886
+ const ViewComponent = matchedRoute && matchedRoute.components[currentName];
75887
+ if (!ViewComponent) {
75888
+ return normalizeSlot(slots.default, { Component: ViewComponent, route });
75889
+ }
75890
+ // props from route configuration
75891
+ const routePropsOption = matchedRoute.props[currentName];
75892
+ const routeProps = routePropsOption
75893
+ ? routePropsOption === true
75894
+ ? route.params
75895
+ : typeof routePropsOption === 'function'
75896
+ ? routePropsOption(route)
75897
+ : routePropsOption
75898
+ : null;
75899
+ const onVnodeUnmounted = vnode => {
75900
+ // remove the instance reference to prevent leak
75901
+ if (vnode.component.isUnmounted) {
75902
+ matchedRoute.instances[currentName] = null;
75903
+ }
75904
+ };
75905
+ const component = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(ViewComponent, vue_router_assign({}, routeProps, attrs, {
75906
+ onVnodeUnmounted,
75907
+ ref: viewRef,
75908
+ }));
75909
+ if (false) // removed by dead control flow
75910
+ {}
75911
+ return (
75912
+ // pass the vnode to the slot as a prop.
75913
+ // h and <component :is="..."> both accept vnodes
75914
+ normalizeSlot(slots.default, { Component: component, route }) ||
75915
+ component);
75916
+ };
75917
+ },
75918
+ });
75919
+ function normalizeSlot(slot, data) {
75920
+ if (!slot)
75921
+ return null;
75922
+ const slotContent = slot(data);
75923
+ return slotContent.length === 1 ? slotContent[0] : slotContent;
75924
+ }
75925
+ // export the public type for h/tsx inference
75926
+ // also to avoid inline import() in generated d.ts files
75927
+ /**
75928
+ * Component to display the current route the user is at.
75929
+ */
75930
+ const RouterView = (/* unused pure expression or super */ null && (RouterViewImpl));
75931
+ // warn against deprecated usage with <transition> & <keep-alive>
75932
+ // due to functional component being no longer eager in Vue 3
75933
+ function warnDeprecatedUsage() {
75934
+ const instance = getCurrentInstance();
75935
+ const parentName = instance.parent && instance.parent.type.name;
75936
+ const parentSubTreeType = instance.parent && instance.parent.subTree && instance.parent.subTree.type;
75937
+ if (parentName &&
75938
+ (parentName === 'KeepAlive' || parentName.includes('Transition')) &&
75939
+ typeof parentSubTreeType === 'object' &&
75940
+ parentSubTreeType.name === 'RouterView') {
75941
+ const comp = parentName === 'KeepAlive' ? 'keep-alive' : 'transition';
75942
+ vue_router_warn(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.\n` +
75943
+ `Use slot props instead:\n\n` +
75944
+ `<router-view v-slot="{ Component }">\n` +
75945
+ ` <${comp}>\n` +
75946
+ ` <component :is="Component" />\n` +
75947
+ ` </${comp}>\n` +
75948
+ `</router-view>`);
75949
+ }
75950
+ }
75951
+
75952
+ /**
75953
+ * Copies a route location and removes any problematic properties that cannot be shown in devtools (e.g. Vue instances).
75954
+ *
75955
+ * @param routeLocation - routeLocation to format
75956
+ * @param tooltip - optional tooltip
75957
+ * @returns a copy of the routeLocation
75958
+ */
75959
+ function formatRouteLocation(routeLocation, tooltip) {
75960
+ const copy = vue_router_assign({}, routeLocation, {
75961
+ // remove variables that can contain vue instances
75962
+ matched: routeLocation.matched.map(matched => vue_router_omit(matched, ['instances', 'children', 'aliasOf'])),
75963
+ });
75964
+ return {
75965
+ _custom: {
75966
+ type: null,
75967
+ readOnly: true,
75968
+ display: routeLocation.fullPath,
75969
+ tooltip,
75970
+ value: copy,
75971
+ },
75972
+ };
75973
+ }
75974
+ function vue_router_formatDisplay(display) {
75975
+ return {
75976
+ _custom: {
75977
+ display,
75978
+ },
75979
+ };
75980
+ }
75981
+ // to support multiple router instances
75982
+ let routerId = 0;
75983
+ function addDevtools(app, router, matcher) {
75984
+ // Take over router.beforeEach and afterEach
75985
+ // make sure we are not registering the devtool twice
75986
+ if (router.__hasDevtools)
75987
+ return;
75988
+ router.__hasDevtools = true;
75989
+ // increment to support multiple router instances
75990
+ const id = routerId++;
75991
+ setupDevtoolsPlugin({
75992
+ id: 'org.vuejs.router' + (id ? '.' + id : ''),
75993
+ label: 'Vue Router',
75994
+ packageName: 'vue-router',
75995
+ homepage: 'https://router.vuejs.org',
75996
+ logo: 'https://router.vuejs.org/logo.png',
75997
+ componentStateTypes: ['Routing'],
75998
+ app,
75999
+ }, api => {
76000
+ if (typeof api.now !== 'function') {
76001
+ console.warn('[Vue Router]: You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.');
76002
+ }
76003
+ // display state added by the router
76004
+ api.on.inspectComponent((payload, ctx) => {
76005
+ if (payload.instanceData) {
76006
+ payload.instanceData.state.push({
76007
+ type: 'Routing',
76008
+ key: '$route',
76009
+ editable: false,
76010
+ value: formatRouteLocation(router.currentRoute.value, 'Current Route'),
76011
+ });
76012
+ }
76013
+ });
76014
+ // mark router-link as active and display tags on router views
76015
+ api.on.visitComponentTree(({ treeNode: node, componentInstance }) => {
76016
+ if (componentInstance.__vrv_devtools) {
76017
+ const info = componentInstance.__vrv_devtools;
76018
+ node.tags.push({
76019
+ label: (info.name ? `${info.name.toString()}: ` : '') + info.path,
76020
+ textColor: 0,
76021
+ tooltip: 'This component is rendered by &lt;router-view&gt;',
76022
+ backgroundColor: PINK_500,
76023
+ });
76024
+ }
76025
+ // if multiple useLink are used
76026
+ if (vue_router_isArray(componentInstance.__vrl_devtools)) {
76027
+ componentInstance.__devtoolsApi = api;
76028
+ componentInstance.__vrl_devtools.forEach(devtoolsData => {
76029
+ let label = devtoolsData.route.path;
76030
+ let backgroundColor = ORANGE_400;
76031
+ let tooltip = '';
76032
+ let textColor = 0;
76033
+ if (devtoolsData.error) {
76034
+ label = devtoolsData.error;
76035
+ backgroundColor = RED_100;
76036
+ textColor = RED_700;
76037
+ }
76038
+ else if (devtoolsData.isExactActive) {
76039
+ backgroundColor = LIME_500;
76040
+ tooltip = 'This is exactly active';
76041
+ }
76042
+ else if (devtoolsData.isActive) {
76043
+ backgroundColor = BLUE_600;
76044
+ tooltip = 'This link is active';
76045
+ }
76046
+ node.tags.push({
76047
+ label,
76048
+ textColor,
76049
+ tooltip,
76050
+ backgroundColor,
76051
+ });
76052
+ });
76053
+ }
76054
+ });
76055
+ watch(router.currentRoute, () => {
76056
+ // refresh active state
76057
+ refreshRoutesView();
76058
+ api.notifyComponentUpdate();
76059
+ api.sendInspectorTree(routerInspectorId);
76060
+ api.sendInspectorState(routerInspectorId);
76061
+ });
76062
+ const navigationsLayerId = 'router:navigations:' + id;
76063
+ api.addTimelineLayer({
76064
+ id: navigationsLayerId,
76065
+ label: `Router${id ? ' ' + id : ''} Navigations`,
76066
+ color: 0x40a8c4,
76067
+ });
76068
+ // const errorsLayerId = 'router:errors'
76069
+ // api.addTimelineLayer({
76070
+ // id: errorsLayerId,
76071
+ // label: 'Router Errors',
76072
+ // color: 0xea5455,
76073
+ // })
76074
+ router.onError((error, to) => {
76075
+ api.addTimelineEvent({
76076
+ layerId: navigationsLayerId,
76077
+ event: {
76078
+ title: 'Error during Navigation',
76079
+ subtitle: to.fullPath,
76080
+ logType: 'error',
76081
+ time: api.now(),
76082
+ data: { error },
76083
+ groupId: to.meta.__navigationId,
76084
+ },
76085
+ });
76086
+ });
76087
+ // attached to `meta` and used to group events
76088
+ let navigationId = 0;
76089
+ router.beforeEach((to, from) => {
76090
+ const data = {
76091
+ guard: vue_router_formatDisplay('beforeEach'),
76092
+ from: formatRouteLocation(from, 'Current Location during this navigation'),
76093
+ to: formatRouteLocation(to, 'Target location'),
76094
+ };
76095
+ // Used to group navigations together, hide from devtools
76096
+ Object.defineProperty(to.meta, '__navigationId', {
76097
+ value: navigationId++,
76098
+ });
76099
+ api.addTimelineEvent({
76100
+ layerId: navigationsLayerId,
76101
+ event: {
76102
+ time: api.now(),
76103
+ title: 'Start of navigation',
76104
+ subtitle: to.fullPath,
76105
+ data,
76106
+ groupId: to.meta.__navigationId,
76107
+ },
76108
+ });
76109
+ });
76110
+ router.afterEach((to, from, failure) => {
76111
+ const data = {
76112
+ guard: vue_router_formatDisplay('afterEach'),
76113
+ };
76114
+ if (failure) {
76115
+ data.failure = {
76116
+ _custom: {
76117
+ type: Error,
76118
+ readOnly: true,
76119
+ display: failure ? failure.message : '',
76120
+ tooltip: 'Navigation Failure',
76121
+ value: failure,
76122
+ },
76123
+ };
76124
+ data.status = vue_router_formatDisplay('❌');
76125
+ }
76126
+ else {
76127
+ data.status = vue_router_formatDisplay('✅');
76128
+ }
76129
+ // we set here to have the right order
76130
+ data.from = formatRouteLocation(from, 'Current Location during this navigation');
76131
+ data.to = formatRouteLocation(to, 'Target location');
76132
+ api.addTimelineEvent({
76133
+ layerId: navigationsLayerId,
76134
+ event: {
76135
+ title: 'End of navigation',
76136
+ subtitle: to.fullPath,
76137
+ time: api.now(),
76138
+ data,
76139
+ logType: failure ? 'warning' : 'default',
76140
+ groupId: to.meta.__navigationId,
76141
+ },
76142
+ });
76143
+ });
76144
+ /**
76145
+ * Inspector of Existing routes
76146
+ */
76147
+ const routerInspectorId = 'router-inspector:' + id;
76148
+ api.addInspector({
76149
+ id: routerInspectorId,
76150
+ label: 'Routes' + (id ? ' ' + id : ''),
76151
+ icon: 'book',
76152
+ treeFilterPlaceholder: 'Search routes',
76153
+ });
76154
+ function refreshRoutesView() {
76155
+ // the routes view isn't active
76156
+ if (!activeRoutesPayload)
76157
+ return;
76158
+ const payload = activeRoutesPayload;
76159
+ // children routes will appear as nested
76160
+ let routes = matcher.getRoutes().filter(route => !route.parent ||
76161
+ // these routes have a parent with no component which will not appear in the view
76162
+ // therefore we still need to include them
76163
+ !route.parent.record.components);
76164
+ // reset match state to false
76165
+ routes.forEach(resetMatchStateOnRouteRecord);
76166
+ // apply a match state if there is a payload
76167
+ if (payload.filter) {
76168
+ routes = routes.filter(route =>
76169
+ // save matches state based on the payload
76170
+ isRouteMatching(route, payload.filter.toLowerCase()));
76171
+ }
76172
+ // mark active routes
76173
+ routes.forEach(route => markRouteRecordActive(route, router.currentRoute.value));
76174
+ payload.rootNodes = routes.map(formatRouteRecordForInspector);
76175
+ }
76176
+ let activeRoutesPayload;
76177
+ api.on.getInspectorTree(payload => {
76178
+ activeRoutesPayload = payload;
76179
+ if (payload.app === app && payload.inspectorId === routerInspectorId) {
76180
+ refreshRoutesView();
76181
+ }
76182
+ });
76183
+ /**
76184
+ * Display information about the currently selected route record
76185
+ */
76186
+ api.on.getInspectorState(payload => {
76187
+ if (payload.app === app && payload.inspectorId === routerInspectorId) {
76188
+ const routes = matcher.getRoutes();
76189
+ const route = routes.find(route => route.record.__vd_id === payload.nodeId);
76190
+ if (route) {
76191
+ payload.state = {
76192
+ options: formatRouteRecordMatcherForStateInspector(route),
76193
+ };
76194
+ }
76195
+ }
76196
+ });
76197
+ api.sendInspectorTree(routerInspectorId);
76198
+ api.sendInspectorState(routerInspectorId);
76199
+ });
76200
+ }
76201
+ function modifierForKey(key) {
76202
+ if (key.optional) {
76203
+ return key.repeatable ? '*' : '?';
76204
+ }
76205
+ else {
76206
+ return key.repeatable ? '+' : '';
76207
+ }
76208
+ }
76209
+ function formatRouteRecordMatcherForStateInspector(route) {
76210
+ const { record } = route;
76211
+ const fields = [
76212
+ { editable: false, key: 'path', value: record.path },
76213
+ ];
76214
+ if (record.name != null) {
76215
+ fields.push({
76216
+ editable: false,
76217
+ key: 'name',
76218
+ value: record.name,
76219
+ });
76220
+ }
76221
+ fields.push({ editable: false, key: 'regexp', value: route.re });
76222
+ if (route.keys.length) {
76223
+ fields.push({
76224
+ editable: false,
76225
+ key: 'keys',
76226
+ value: {
76227
+ _custom: {
76228
+ type: null,
76229
+ readOnly: true,
76230
+ display: route.keys
76231
+ .map(key => `${key.name}${modifierForKey(key)}`)
76232
+ .join(' '),
76233
+ tooltip: 'Param keys',
76234
+ value: route.keys,
76235
+ },
76236
+ },
76237
+ });
76238
+ }
76239
+ if (record.redirect != null) {
76240
+ fields.push({
76241
+ editable: false,
76242
+ key: 'redirect',
76243
+ value: record.redirect,
76244
+ });
76245
+ }
76246
+ if (route.alias.length) {
76247
+ fields.push({
76248
+ editable: false,
76249
+ key: 'aliases',
76250
+ value: route.alias.map(alias => alias.record.path),
76251
+ });
76252
+ }
76253
+ if (Object.keys(route.record.meta).length) {
76254
+ fields.push({
76255
+ editable: false,
76256
+ key: 'meta',
76257
+ value: route.record.meta,
76258
+ });
76259
+ }
76260
+ fields.push({
76261
+ key: 'score',
76262
+ editable: false,
76263
+ value: {
76264
+ _custom: {
76265
+ type: null,
76266
+ readOnly: true,
76267
+ display: route.score.map(score => score.join(', ')).join(' | '),
76268
+ tooltip: 'Score used to sort routes',
76269
+ value: route.score,
76270
+ },
76271
+ },
76272
+ });
76273
+ return fields;
76274
+ }
76275
+ /**
76276
+ * Extracted from tailwind palette
76277
+ */
76278
+ const PINK_500 = 0xec4899;
76279
+ const BLUE_600 = 0x2563eb;
76280
+ const LIME_500 = 0x84cc16;
76281
+ const CYAN_400 = 0x22d3ee;
76282
+ const ORANGE_400 = 0xfb923c;
76283
+ // const GRAY_100 = 0xf4f4f5
76284
+ const DARK = 0x666666;
76285
+ const RED_100 = 0xfee2e2;
76286
+ const RED_700 = 0xb91c1c;
76287
+ function formatRouteRecordForInspector(route) {
76288
+ const tags = [];
76289
+ const { record } = route;
76290
+ if (record.name != null) {
76291
+ tags.push({
76292
+ label: String(record.name),
76293
+ textColor: 0,
76294
+ backgroundColor: CYAN_400,
76295
+ });
76296
+ }
76297
+ if (record.aliasOf) {
76298
+ tags.push({
76299
+ label: 'alias',
76300
+ textColor: 0,
76301
+ backgroundColor: ORANGE_400,
76302
+ });
76303
+ }
76304
+ if (route.__vd_match) {
76305
+ tags.push({
76306
+ label: 'matches',
76307
+ textColor: 0,
76308
+ backgroundColor: PINK_500,
76309
+ });
76310
+ }
76311
+ if (route.__vd_exactActive) {
76312
+ tags.push({
76313
+ label: 'exact',
76314
+ textColor: 0,
76315
+ backgroundColor: LIME_500,
76316
+ });
76317
+ }
76318
+ if (route.__vd_active) {
76319
+ tags.push({
76320
+ label: 'active',
76321
+ textColor: 0,
76322
+ backgroundColor: BLUE_600,
76323
+ });
76324
+ }
76325
+ if (record.redirect) {
76326
+ tags.push({
76327
+ label: typeof record.redirect === 'string'
76328
+ ? `redirect: ${record.redirect}`
76329
+ : 'redirects',
76330
+ textColor: 0xffffff,
76331
+ backgroundColor: DARK,
76332
+ });
76333
+ }
76334
+ // add an id to be able to select it. Using the `path` is not possible because
76335
+ // empty path children would collide with their parents
76336
+ let id = record.__vd_id;
76337
+ if (id == null) {
76338
+ id = String(routeRecordId++);
76339
+ record.__vd_id = id;
76340
+ }
76341
+ return {
76342
+ id,
76343
+ label: record.path,
76344
+ tags,
76345
+ children: route.children.map(formatRouteRecordForInspector),
76346
+ };
76347
+ }
76348
+ // incremental id for route records and inspector state
76349
+ let routeRecordId = 0;
76350
+ const EXTRACT_REGEXP_RE = /^\/(.*)\/([a-z]*)$/;
76351
+ function markRouteRecordActive(route, currentRoute) {
76352
+ // no route will be active if matched is empty
76353
+ // reset the matching state
76354
+ const isExactActive = currentRoute.matched.length &&
76355
+ isSameRouteRecord(currentRoute.matched[currentRoute.matched.length - 1], route.record);
76356
+ route.__vd_exactActive = route.__vd_active = isExactActive;
76357
+ if (!isExactActive) {
76358
+ route.__vd_active = currentRoute.matched.some(match => isSameRouteRecord(match, route.record));
76359
+ }
76360
+ route.children.forEach(childRoute => markRouteRecordActive(childRoute, currentRoute));
76361
+ }
76362
+ function resetMatchStateOnRouteRecord(route) {
76363
+ route.__vd_match = false;
76364
+ route.children.forEach(resetMatchStateOnRouteRecord);
76365
+ }
76366
+ function isRouteMatching(route, filter) {
76367
+ const found = String(route.re).match(EXTRACT_REGEXP_RE);
76368
+ route.__vd_match = false;
76369
+ if (!found || found.length < 3) {
76370
+ return false;
76371
+ }
76372
+ // use a regexp without $ at the end to match nested routes better
76373
+ const nonEndingRE = new RegExp(found[1].replace(/\$$/, ''), found[2]);
76374
+ if (nonEndingRE.test(filter)) {
76375
+ // mark children as matches
76376
+ route.children.forEach(child => isRouteMatching(child, filter));
76377
+ // exception case: `/`
76378
+ if (route.record.path !== '/' || filter === '/') {
76379
+ route.__vd_match = route.re.test(filter);
76380
+ return true;
76381
+ }
76382
+ // hide the / route
76383
+ return false;
76384
+ }
76385
+ const path = route.record.path.toLowerCase();
76386
+ const decodedPath = decode(path);
76387
+ // also allow partial matching on the path
76388
+ if (!filter.startsWith('/') &&
76389
+ (decodedPath.includes(filter) || path.includes(filter)))
76390
+ return true;
76391
+ if (decodedPath.startsWith(filter) || path.startsWith(filter))
76392
+ return true;
76393
+ if (route.record.name && String(route.record.name).includes(filter))
76394
+ return true;
76395
+ return route.children.some(child => isRouteMatching(child, filter));
76396
+ }
76397
+ function vue_router_omit(obj, keys) {
76398
+ const ret = {};
76399
+ for (const key in obj) {
76400
+ if (!keys.includes(key)) {
76401
+ // @ts-expect-error
76402
+ ret[key] = obj[key];
76403
+ }
76404
+ }
76405
+ return ret;
76406
+ }
76407
+
76408
+ /**
76409
+ * Creates a Router instance that can be used by a Vue app.
76410
+ *
76411
+ * @param options - {@link RouterOptions}
76412
+ */
76413
+ function createRouter(options) {
76414
+ const matcher = createRouterMatcher(options.routes, options);
76415
+ const parseQuery$1 = options.parseQuery || parseQuery;
76416
+ const stringifyQuery$1 = options.stringifyQuery || stringifyQuery;
76417
+ const routerHistory = options.history;
76418
+ if (false)
76419
+ // removed by dead control flow
76420
+ {}
76421
+ const beforeGuards = useCallbacks();
76422
+ const beforeResolveGuards = useCallbacks();
76423
+ const afterGuards = useCallbacks();
76424
+ const currentRoute = shallowRef(START_LOCATION_NORMALIZED);
76425
+ let pendingLocation = START_LOCATION_NORMALIZED;
76426
+ // leave the scrollRestoration if no scrollBehavior is provided
76427
+ if (vue_router_isBrowser && options.scrollBehavior && 'scrollRestoration' in history) {
76428
+ history.scrollRestoration = 'manual';
76429
+ }
76430
+ const normalizeParams = applyToParams.bind(null, paramValue => '' + paramValue);
76431
+ const encodeParams = applyToParams.bind(null, encodeParam);
76432
+ const decodeParams =
76433
+ // @ts-expect-error: intentionally avoid the type check
76434
+ applyToParams.bind(null, decode);
76435
+ function addRoute(parentOrRoute, route) {
76436
+ let parent;
76437
+ let record;
76438
+ if (isRouteName(parentOrRoute)) {
76439
+ parent = matcher.getRecordMatcher(parentOrRoute);
76440
+ if (false) // removed by dead control flow
76441
+ {}
76442
+ record = route;
76443
+ }
76444
+ else {
76445
+ record = parentOrRoute;
76446
+ }
76447
+ return matcher.addRoute(record, parent);
76448
+ }
76449
+ function removeRoute(name) {
76450
+ const recordMatcher = matcher.getRecordMatcher(name);
76451
+ if (recordMatcher) {
76452
+ matcher.removeRoute(recordMatcher);
76453
+ }
76454
+ else if ((false)) // removed by dead control flow
76455
+ {}
76456
+ }
76457
+ function getRoutes() {
76458
+ return matcher.getRoutes().map(routeMatcher => routeMatcher.record);
76459
+ }
76460
+ function hasRoute(name) {
76461
+ return !!matcher.getRecordMatcher(name);
76462
+ }
76463
+ function resolve(rawLocation, currentLocation) {
76464
+ // const resolve: Router['resolve'] = (rawLocation: RouteLocationRaw, currentLocation) => {
76465
+ // const objectLocation = routerLocationAsObject(rawLocation)
76466
+ // we create a copy to modify it later
76467
+ currentLocation = vue_router_assign({}, currentLocation || currentRoute.value);
76468
+ if (typeof rawLocation === 'string') {
76469
+ const locationNormalized = parseURL(parseQuery$1, rawLocation, currentLocation.path);
76470
+ const matchedRoute = matcher.resolve({ path: locationNormalized.path }, currentLocation);
76471
+ const href = routerHistory.createHref(locationNormalized.fullPath);
76472
+ if ((false)) // removed by dead control flow
76473
+ {}
76474
+ // locationNormalized is always a new object
76475
+ return vue_router_assign(locationNormalized, matchedRoute, {
76476
+ params: decodeParams(matchedRoute.params),
76477
+ hash: decode(locationNormalized.hash),
76478
+ redirectedFrom: undefined,
76479
+ href,
76480
+ });
76481
+ }
76482
+ if (false) // removed by dead control flow
76483
+ {}
76484
+ let matcherLocation;
76485
+ // path could be relative in object as well
76486
+ if (rawLocation.path != null) {
76487
+ if (false) // removed by dead control flow
76488
+ {}
76489
+ matcherLocation = vue_router_assign({}, rawLocation, {
76490
+ path: parseURL(parseQuery$1, rawLocation.path, currentLocation.path).path,
76491
+ });
76492
+ }
76493
+ else {
76494
+ // remove any nullish param
76495
+ const targetParams = vue_router_assign({}, rawLocation.params);
76496
+ for (const key in targetParams) {
76497
+ if (targetParams[key] == null) {
76498
+ delete targetParams[key];
76499
+ }
76500
+ }
76501
+ // pass encoded values to the matcher, so it can produce encoded path and fullPath
76502
+ matcherLocation = vue_router_assign({}, rawLocation, {
76503
+ params: encodeParams(targetParams),
76504
+ });
76505
+ // current location params are decoded, we need to encode them in case the
76506
+ // matcher merges the params
76507
+ currentLocation.params = encodeParams(currentLocation.params);
76508
+ }
76509
+ const matchedRoute = matcher.resolve(matcherLocation, currentLocation);
76510
+ const hash = rawLocation.hash || '';
76511
+ if (false) // removed by dead control flow
76512
+ {}
76513
+ // the matcher might have merged current location params, so
76514
+ // we need to run the decoding again
76515
+ matchedRoute.params = normalizeParams(decodeParams(matchedRoute.params));
76516
+ const fullPath = stringifyURL(stringifyQuery$1, vue_router_assign({}, rawLocation, {
76517
+ hash: encodeHash(hash),
76518
+ path: matchedRoute.path,
76519
+ }));
76520
+ const href = routerHistory.createHref(fullPath);
76521
+ if ((false)) // removed by dead control flow
76522
+ {}
76523
+ return vue_router_assign({
76524
+ fullPath,
76525
+ // keep the hash encoded so fullPath is effectively path + encodedQuery +
76526
+ // hash
76527
+ hash,
76528
+ query:
76529
+ // if the user is using a custom query lib like qs, we might have
76530
+ // nested objects, so we keep the query as is, meaning it can contain
76531
+ // numbers at `$route.query`, but at the point, the user will have to
76532
+ // use their own type anyway.
76533
+ // https://github.com/vuejs/router/issues/328#issuecomment-649481567
76534
+ stringifyQuery$1 === stringifyQuery
76535
+ ? normalizeQuery(rawLocation.query)
76536
+ : (rawLocation.query || {}),
76537
+ }, matchedRoute, {
76538
+ redirectedFrom: undefined,
76539
+ href,
76540
+ });
76541
+ }
76542
+ function locationAsObject(to) {
76543
+ return typeof to === 'string'
76544
+ ? parseURL(parseQuery$1, to, currentRoute.value.path)
76545
+ : vue_router_assign({}, to);
76546
+ }
76547
+ function checkCanceledNavigation(to, from) {
76548
+ if (pendingLocation !== to) {
76549
+ return createRouterError(8 /* ErrorTypes.NAVIGATION_CANCELLED */, {
76550
+ from,
76551
+ to,
76552
+ });
76553
+ }
76554
+ }
76555
+ function push(to) {
76556
+ return pushWithRedirect(to);
76557
+ }
76558
+ function replace(to) {
76559
+ return push(vue_router_assign(locationAsObject(to), { replace: true }));
76560
+ }
76561
+ function handleRedirectRecord(to) {
76562
+ const lastMatched = to.matched[to.matched.length - 1];
76563
+ if (lastMatched && lastMatched.redirect) {
76564
+ const { redirect } = lastMatched;
76565
+ let newTargetLocation = typeof redirect === 'function' ? redirect(to) : redirect;
76566
+ if (typeof newTargetLocation === 'string') {
76567
+ newTargetLocation =
76568
+ newTargetLocation.includes('?') || newTargetLocation.includes('#')
76569
+ ? (newTargetLocation = locationAsObject(newTargetLocation))
76570
+ : // force empty params
76571
+ { path: newTargetLocation };
76572
+ // @ts-expect-error: force empty params when a string is passed to let
76573
+ // the router parse them again
76574
+ newTargetLocation.params = {};
76575
+ }
76576
+ if (false) // removed by dead control flow
76577
+ {}
76578
+ return vue_router_assign({
76579
+ query: to.query,
76580
+ hash: to.hash,
76581
+ // avoid transferring params if the redirect has a path
76582
+ params: newTargetLocation.path != null ? {} : to.params,
76583
+ }, newTargetLocation);
76584
+ }
76585
+ }
76586
+ function pushWithRedirect(to, redirectedFrom) {
76587
+ const targetLocation = (pendingLocation = resolve(to));
76588
+ const from = currentRoute.value;
76589
+ const data = to.state;
76590
+ const force = to.force;
76591
+ // to could be a string where `replace` is a function
76592
+ const replace = to.replace === true;
76593
+ const shouldRedirect = handleRedirectRecord(targetLocation);
76594
+ if (shouldRedirect)
76595
+ return pushWithRedirect(vue_router_assign(locationAsObject(shouldRedirect), {
76596
+ state: typeof shouldRedirect === 'object'
76597
+ ? vue_router_assign({}, data, shouldRedirect.state)
76598
+ : data,
76599
+ force,
76600
+ replace,
76601
+ }),
76602
+ // keep original redirectedFrom if it exists
76603
+ redirectedFrom || targetLocation);
76604
+ // if it was a redirect we already called `pushWithRedirect` above
76605
+ const toLocation = targetLocation;
76606
+ toLocation.redirectedFrom = redirectedFrom;
76607
+ let failure;
76608
+ if (!force && isSameRouteLocation(stringifyQuery$1, from, targetLocation)) {
76609
+ failure = createRouterError(16 /* ErrorTypes.NAVIGATION_DUPLICATED */, { to: toLocation, from });
76610
+ // trigger scroll to allow scrolling to the same anchor
76611
+ handleScroll(from, from,
76612
+ // this is a push, the only way for it to be triggered from a
76613
+ // history.listen is with a redirect, which makes it become a push
76614
+ true,
76615
+ // This cannot be the first navigation because the initial location
76616
+ // cannot be manually navigated to
76617
+ false);
76618
+ }
76619
+ return (failure ? Promise.resolve(failure) : navigate(toLocation, from))
76620
+ .catch((error) => isNavigationFailure(error)
76621
+ ? // navigation redirects still mark the router as ready
76622
+ isNavigationFailure(error, 2 /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */)
76623
+ ? error
76624
+ : markAsReady(error) // also returns the error
76625
+ : // reject any unknown error
76626
+ triggerError(error, toLocation, from))
76627
+ .then((failure) => {
76628
+ if (failure) {
76629
+ if (isNavigationFailure(failure, 2 /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */)) {
76630
+ if (false) // removed by dead control flow
76631
+ {}
76632
+ return pushWithRedirect(
76633
+ // keep options
76634
+ vue_router_assign({
76635
+ // preserve an existing replacement but allow the redirect to override it
76636
+ replace,
76637
+ }, locationAsObject(failure.to), {
76638
+ state: typeof failure.to === 'object'
76639
+ ? vue_router_assign({}, data, failure.to.state)
76640
+ : data,
76641
+ force,
76642
+ }),
76643
+ // preserve the original redirectedFrom if any
76644
+ redirectedFrom || toLocation);
76645
+ }
76646
+ }
76647
+ else {
76648
+ // if we fail we don't finalize the navigation
76649
+ failure = finalizeNavigation(toLocation, from, true, replace, data);
76650
+ }
76651
+ triggerAfterEach(toLocation, from, failure);
76652
+ return failure;
76653
+ });
76654
+ }
76655
+ /**
76656
+ * Helper to reject and skip all navigation guards if a new navigation happened
76657
+ * @param to
76658
+ * @param from
76659
+ */
76660
+ function checkCanceledNavigationAndReject(to, from) {
76661
+ const error = checkCanceledNavigation(to, from);
76662
+ return error ? Promise.reject(error) : Promise.resolve();
76663
+ }
76664
+ function runWithContext(fn) {
76665
+ const app = installedApps.values().next().value;
76666
+ // support Vue < 3.3
76667
+ return app && typeof app.runWithContext === 'function'
76668
+ ? app.runWithContext(fn)
76669
+ : fn();
76670
+ }
76671
+ // TODO: refactor the whole before guards by internally using router.beforeEach
76672
+ function navigate(to, from) {
76673
+ let guards;
76674
+ const [leavingRecords, updatingRecords, enteringRecords] = extractChangingRecords(to, from);
76675
+ // all components here have been resolved once because we are leaving
76676
+ guards = extractComponentsGuards(leavingRecords.reverse(), 'beforeRouteLeave', to, from);
76677
+ // leavingRecords is already reversed
76678
+ for (const record of leavingRecords) {
76679
+ record.leaveGuards.forEach(guard => {
76680
+ guards.push(guardToPromiseFn(guard, to, from));
76681
+ });
76682
+ }
76683
+ const canceledNavigationCheck = checkCanceledNavigationAndReject.bind(null, to, from);
76684
+ guards.push(canceledNavigationCheck);
76685
+ // run the queue of per route beforeRouteLeave guards
76686
+ return (runGuardQueue(guards)
76687
+ .then(() => {
76688
+ // check global guards beforeEach
76689
+ guards = [];
76690
+ for (const guard of beforeGuards.list()) {
76691
+ guards.push(guardToPromiseFn(guard, to, from));
76692
+ }
76693
+ guards.push(canceledNavigationCheck);
76694
+ return runGuardQueue(guards);
76695
+ })
76696
+ .then(() => {
76697
+ // check in components beforeRouteUpdate
76698
+ guards = extractComponentsGuards(updatingRecords, 'beforeRouteUpdate', to, from);
76699
+ for (const record of updatingRecords) {
76700
+ record.updateGuards.forEach(guard => {
76701
+ guards.push(guardToPromiseFn(guard, to, from));
76702
+ });
76703
+ }
76704
+ guards.push(canceledNavigationCheck);
76705
+ // run the queue of per route beforeEnter guards
76706
+ return runGuardQueue(guards);
76707
+ })
76708
+ .then(() => {
76709
+ // check the route beforeEnter
76710
+ guards = [];
76711
+ for (const record of enteringRecords) {
76712
+ // do not trigger beforeEnter on reused views
76713
+ if (record.beforeEnter) {
76714
+ if (vue_router_isArray(record.beforeEnter)) {
76715
+ for (const beforeEnter of record.beforeEnter)
76716
+ guards.push(guardToPromiseFn(beforeEnter, to, from));
76717
+ }
76718
+ else {
76719
+ guards.push(guardToPromiseFn(record.beforeEnter, to, from));
76720
+ }
76721
+ }
76722
+ }
76723
+ guards.push(canceledNavigationCheck);
76724
+ // run the queue of per route beforeEnter guards
76725
+ return runGuardQueue(guards);
76726
+ })
76727
+ .then(() => {
76728
+ // NOTE: at this point to.matched is normalized and does not contain any () => Promise<Component>
76729
+ // clear existing enterCallbacks, these are added by extractComponentsGuards
76730
+ to.matched.forEach(record => (record.enterCallbacks = {}));
76731
+ // check in-component beforeRouteEnter
76732
+ guards = extractComponentsGuards(enteringRecords, 'beforeRouteEnter', to, from, runWithContext);
76733
+ guards.push(canceledNavigationCheck);
76734
+ // run the queue of per route beforeEnter guards
76735
+ return runGuardQueue(guards);
76736
+ })
76737
+ .then(() => {
76738
+ // check global guards beforeResolve
76739
+ guards = [];
76740
+ for (const guard of beforeResolveGuards.list()) {
76741
+ guards.push(guardToPromiseFn(guard, to, from));
76742
+ }
76743
+ guards.push(canceledNavigationCheck);
76744
+ return runGuardQueue(guards);
76745
+ })
76746
+ // catch any navigation canceled
76747
+ .catch(err => isNavigationFailure(err, 8 /* ErrorTypes.NAVIGATION_CANCELLED */)
76748
+ ? err
76749
+ : Promise.reject(err)));
76750
+ }
76751
+ function triggerAfterEach(to, from, failure) {
76752
+ // navigation is confirmed, call afterGuards
76753
+ // TODO: wrap with error handlers
76754
+ afterGuards
76755
+ .list()
76756
+ .forEach(guard => runWithContext(() => guard(to, from, failure)));
76757
+ }
76758
+ /**
76759
+ * - Cleans up any navigation guards
76760
+ * - Changes the url if necessary
76761
+ * - Calls the scrollBehavior
76762
+ */
76763
+ function finalizeNavigation(toLocation, from, isPush, replace, data) {
76764
+ // a more recent navigation took place
76765
+ const error = checkCanceledNavigation(toLocation, from);
76766
+ if (error)
76767
+ return error;
76768
+ // only consider as push if it's not the first navigation
76769
+ const isFirstNavigation = from === START_LOCATION_NORMALIZED;
76770
+ const state = !vue_router_isBrowser ? {} : history.state;
76771
+ // change URL only if the user did a push/replace and if it's not the initial navigation because
76772
+ // it's just reflecting the url
76773
+ if (isPush) {
76774
+ // on the initial navigation, we want to reuse the scroll position from
76775
+ // history state if it exists
76776
+ if (replace || isFirstNavigation)
76777
+ routerHistory.replace(toLocation.fullPath, vue_router_assign({
76778
+ scroll: isFirstNavigation && state && state.scroll,
76779
+ }, data));
76780
+ else
76781
+ routerHistory.push(toLocation.fullPath, data);
76782
+ }
76783
+ // accept current navigation
76784
+ currentRoute.value = toLocation;
76785
+ handleScroll(toLocation, from, isPush, isFirstNavigation);
76786
+ markAsReady();
76787
+ }
76788
+ let removeHistoryListener;
76789
+ // attach listener to history to trigger navigations
76790
+ function setupListeners() {
76791
+ // avoid setting up listeners twice due to an invalid first navigation
76792
+ if (removeHistoryListener)
76793
+ return;
76794
+ removeHistoryListener = routerHistory.listen((to, _from, info) => {
76795
+ if (!router.listening)
76796
+ return;
76797
+ // cannot be a redirect route because it was in history
76798
+ const toLocation = resolve(to);
76799
+ // due to dynamic routing, and to hash history with manual navigation
76800
+ // (manually changing the url or calling history.hash = '#/somewhere'),
76801
+ // there could be a redirect record in history
76802
+ const shouldRedirect = handleRedirectRecord(toLocation);
76803
+ if (shouldRedirect) {
76804
+ pushWithRedirect(vue_router_assign(shouldRedirect, { replace: true, force: true }), toLocation).catch(vue_router_noop);
76805
+ return;
76806
+ }
76807
+ pendingLocation = toLocation;
76808
+ const from = currentRoute.value;
76809
+ // TODO: should be moved to web history?
76810
+ if (vue_router_isBrowser) {
76811
+ saveScrollPosition(getScrollKey(from.fullPath, info.delta), computeScrollPosition());
76812
+ }
76813
+ navigate(toLocation, from)
76814
+ .catch((error) => {
76815
+ if (isNavigationFailure(error, 4 /* ErrorTypes.NAVIGATION_ABORTED */ | 8 /* ErrorTypes.NAVIGATION_CANCELLED */)) {
76816
+ return error;
76817
+ }
76818
+ if (isNavigationFailure(error, 2 /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */)) {
76819
+ // Here we could call if (info.delta) routerHistory.go(-info.delta,
76820
+ // false) but this is bug prone as we have no way to wait the
76821
+ // navigation to be finished before calling pushWithRedirect. Using
76822
+ // a setTimeout of 16ms seems to work but there is no guarantee for
76823
+ // it to work on every browser. So instead we do not restore the
76824
+ // history entry and trigger a new navigation as requested by the
76825
+ // navigation guard.
76826
+ // the error is already handled by router.push we just want to avoid
76827
+ // logging the error
76828
+ pushWithRedirect(vue_router_assign(locationAsObject(error.to), {
76829
+ force: true,
76830
+ }), toLocation
76831
+ // avoid an uncaught rejection, let push call triggerError
76832
+ )
76833
+ .then(failure => {
76834
+ // manual change in hash history #916 ending up in the URL not
76835
+ // changing, but it was changed by the manual url change, so we
76836
+ // need to manually change it ourselves
76837
+ if (isNavigationFailure(failure, 4 /* ErrorTypes.NAVIGATION_ABORTED */ |
76838
+ 16 /* ErrorTypes.NAVIGATION_DUPLICATED */) &&
76839
+ !info.delta &&
76840
+ info.type === NavigationType.pop) {
76841
+ routerHistory.go(-1, false);
76842
+ }
76843
+ })
76844
+ .catch(vue_router_noop);
76845
+ // avoid the then branch
76846
+ return Promise.reject();
76847
+ }
76848
+ // do not restore history on unknown direction
76849
+ if (info.delta) {
76850
+ routerHistory.go(-info.delta, false);
76851
+ }
76852
+ // unrecognized error, transfer to the global handler
76853
+ return triggerError(error, toLocation, from);
76854
+ })
76855
+ .then((failure) => {
76856
+ failure =
76857
+ failure ||
76858
+ finalizeNavigation(
76859
+ // after navigation, all matched components are resolved
76860
+ toLocation, from, false);
76861
+ // revert the navigation
76862
+ if (failure) {
76863
+ if (info.delta &&
76864
+ // a new navigation has been triggered, so we do not want to revert, that will change the current history
76865
+ // entry while a different route is displayed
76866
+ !isNavigationFailure(failure, 8 /* ErrorTypes.NAVIGATION_CANCELLED */)) {
76867
+ routerHistory.go(-info.delta, false);
76868
+ }
76869
+ else if (info.type === NavigationType.pop &&
76870
+ isNavigationFailure(failure, 4 /* ErrorTypes.NAVIGATION_ABORTED */ | 16 /* ErrorTypes.NAVIGATION_DUPLICATED */)) {
76871
+ // manual change in hash history #916
76872
+ // it's like a push but lacks the information of the direction
76873
+ routerHistory.go(-1, false);
76874
+ }
76875
+ }
76876
+ triggerAfterEach(toLocation, from, failure);
76877
+ })
76878
+ // avoid warnings in the console about uncaught rejections, they are logged by triggerErrors
76879
+ .catch(vue_router_noop);
76880
+ });
76881
+ }
76882
+ // Initialization and Errors
76883
+ let readyHandlers = useCallbacks();
76884
+ let errorListeners = useCallbacks();
76885
+ let ready;
76886
+ /**
76887
+ * Trigger errorListeners added via onError and throws the error as well
76888
+ *
76889
+ * @param error - error to throw
76890
+ * @param to - location we were navigating to when the error happened
76891
+ * @param from - location we were navigating from when the error happened
76892
+ * @returns the error as a rejected promise
76893
+ */
76894
+ function triggerError(error, to, from) {
76895
+ markAsReady(error);
76896
+ const list = errorListeners.list();
76897
+ if (list.length) {
76898
+ list.forEach(handler => handler(error, to, from));
76899
+ }
76900
+ else {
76901
+ if ((false)) // removed by dead control flow
76902
+ {}
76903
+ console.error(error);
76904
+ }
76905
+ // reject the error no matter there were error listeners or not
76906
+ return Promise.reject(error);
76907
+ }
76908
+ function isReady() {
76909
+ if (ready && currentRoute.value !== START_LOCATION_NORMALIZED)
76910
+ return Promise.resolve();
76911
+ return new Promise((resolve, reject) => {
76912
+ readyHandlers.add([resolve, reject]);
76913
+ });
76914
+ }
76915
+ function markAsReady(err) {
76916
+ if (!ready) {
76917
+ // still not ready if an error happened
76918
+ ready = !err;
76919
+ setupListeners();
76920
+ readyHandlers
76921
+ .list()
76922
+ .forEach(([resolve, reject]) => (err ? reject(err) : resolve()));
76923
+ readyHandlers.reset();
76924
+ }
76925
+ return err;
76926
+ }
76927
+ // Scroll behavior
76928
+ function handleScroll(to, from, isPush, isFirstNavigation) {
76929
+ const { scrollBehavior } = options;
76930
+ if (!vue_router_isBrowser || !scrollBehavior)
76931
+ return Promise.resolve();
76932
+ const scrollPosition = (!isPush && getSavedScrollPosition(getScrollKey(to.fullPath, 0))) ||
76933
+ ((isFirstNavigation || !isPush) &&
76934
+ history.state &&
76935
+ history.state.scroll) ||
76936
+ null;
76937
+ return nextTick()
76938
+ .then(() => scrollBehavior(to, from, scrollPosition))
76939
+ .then(position => position && scrollToPosition(position))
76940
+ .catch(err => triggerError(err, to, from));
76941
+ }
76942
+ const go = (delta) => routerHistory.go(delta);
76943
+ let started;
76944
+ const installedApps = new Set();
76945
+ const router = {
76946
+ currentRoute,
76947
+ listening: true,
76948
+ addRoute,
76949
+ removeRoute,
76950
+ clearRoutes: matcher.clearRoutes,
76951
+ hasRoute,
76952
+ getRoutes,
76953
+ resolve,
76954
+ options,
76955
+ push,
76956
+ replace,
76957
+ go,
76958
+ back: () => go(-1),
76959
+ forward: () => go(1),
76960
+ beforeEach: beforeGuards.add,
76961
+ beforeResolve: beforeResolveGuards.add,
76962
+ afterEach: afterGuards.add,
76963
+ onError: errorListeners.add,
76964
+ isReady,
76965
+ install(app) {
76966
+ const router = this;
76967
+ app.component('RouterLink', RouterLink);
76968
+ app.component('RouterView', RouterView);
76969
+ app.config.globalProperties.$router = router;
76970
+ Object.defineProperty(app.config.globalProperties, '$route', {
76971
+ enumerable: true,
76972
+ get: () => unref(currentRoute),
76973
+ });
76974
+ // this initial navigation is only necessary on client, on server it doesn't
76975
+ // make sense because it will create an extra unnecessary navigation and could
76976
+ // lead to problems
76977
+ if (vue_router_isBrowser &&
76978
+ // used for the initial navigation client side to avoid pushing
76979
+ // multiple times when the router is used in multiple apps
76980
+ !started &&
76981
+ currentRoute.value === START_LOCATION_NORMALIZED) {
76982
+ // see above
76983
+ started = true;
76984
+ push(routerHistory.location).catch(err => {
76985
+ if ((false))
76986
+ // removed by dead control flow
76987
+ {}
76988
+ });
76989
+ }
76990
+ const reactiveRoute = {};
76991
+ for (const key in START_LOCATION_NORMALIZED) {
76992
+ Object.defineProperty(reactiveRoute, key, {
76993
+ get: () => currentRoute.value[key],
76994
+ enumerable: true,
76995
+ });
76996
+ }
76997
+ app.provide(routerKey, router);
76998
+ app.provide(routeLocationKey, shallowReactive(reactiveRoute));
76999
+ app.provide(routerViewLocationKey, currentRoute);
77000
+ const unmountApp = app.unmount;
77001
+ installedApps.add(app);
77002
+ app.unmount = function () {
77003
+ installedApps.delete(app);
77004
+ // the router is not attached to an app anymore
77005
+ if (installedApps.size < 1) {
77006
+ // invalidate the current navigation
77007
+ pendingLocation = START_LOCATION_NORMALIZED;
77008
+ removeHistoryListener && removeHistoryListener();
77009
+ removeHistoryListener = null;
77010
+ currentRoute.value = START_LOCATION_NORMALIZED;
77011
+ started = false;
77012
+ ready = false;
77013
+ }
77014
+ unmountApp();
77015
+ };
77016
+ // TODO: this probably needs to be updated so it can be used by vue-termui
77017
+ if (false) // removed by dead control flow
77018
+ {}
77019
+ },
77020
+ };
77021
+ // TODO: type this as NavigationGuardReturn or similar instead of any
77022
+ function runGuardQueue(guards) {
77023
+ return guards.reduce((promise, guard) => promise.then(() => runWithContext(guard)), Promise.resolve());
77024
+ }
77025
+ return router;
77026
+ }
77027
+ function extractChangingRecords(to, from) {
77028
+ const leavingRecords = [];
77029
+ const updatingRecords = [];
77030
+ const enteringRecords = [];
77031
+ const len = Math.max(from.matched.length, to.matched.length);
77032
+ for (let i = 0; i < len; i++) {
77033
+ const recordFrom = from.matched[i];
77034
+ if (recordFrom) {
77035
+ if (to.matched.find(record => isSameRouteRecord(record, recordFrom)))
77036
+ updatingRecords.push(recordFrom);
77037
+ else
77038
+ leavingRecords.push(recordFrom);
77039
+ }
77040
+ const recordTo = to.matched[i];
77041
+ if (recordTo) {
77042
+ // the type doesn't matter because we are comparing per reference
77043
+ if (!from.matched.find(record => isSameRouteRecord(record, recordTo))) {
77044
+ enteringRecords.push(recordTo);
77045
+ }
77046
+ }
77047
+ }
77048
+ return [leavingRecords, updatingRecords, enteringRecords];
77049
+ }
77050
+
77051
+ /**
77052
+ * Returns the router instance. Equivalent to using `$router` inside
77053
+ * templates.
77054
+ */
77055
+ function useRouter() {
77056
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)(routerKey);
77057
+ }
77058
+ /**
77059
+ * Returns the current route location. Equivalent to using `$route` inside
77060
+ * templates.
77061
+ */
77062
+ function useRoute(_name) {
77063
+ return inject(routeLocationKey);
77064
+ }
77065
+
77066
+
77067
+
77068
+ ;// ./node_modules/lodash-es/lodash.js
77069
+ /**
77070
+ * @license
77071
+ * Lodash (Custom Build) <https://lodash.com/>
77072
+ * Build: `lodash modularize exports="es" -o ./`
77073
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
77074
+ * Released under MIT license <https://lodash.com/license>
77075
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
77076
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
77077
+ */
77078
+
77079
+
77080
+
77081
+
77082
+
77083
+
77084
+
77085
+
77086
+
77087
+
77088
+
77089
+
77090
+
77091
+
77092
+
77093
+
77094
+
77095
+
77096
+
77097
+
77098
+
77099
+
77100
+
77101
+
77102
+
77103
+
77104
+
77105
+
77106
+
77107
+
77108
+
77109
+
77110
+
77111
+
77112
+
77113
+
77114
+
77115
+
77116
+
77117
+
77118
+
77119
+
77120
+
77121
+
77122
+
77123
+
77124
+
77125
+
77126
+
77127
+
77128
+
77129
+
77130
+
77131
+
77132
+
77133
+
77134
+
77135
+
77136
+
77137
+
77138
+
77139
+
77140
+
77141
+
77142
+
77143
+
77144
+
77145
+
77146
+
77147
+
77148
+
77149
+
77150
+
77151
+
77152
+
77153
+
77154
+
77155
+
77156
+
77157
+
77158
+
77159
+
77160
+
77161
+
77162
+
77163
+
77164
+
77165
+
77166
+
77167
+
77168
+
77169
+
77170
+
77171
+
77172
+
77173
+
77174
+
77175
+
77176
+
77177
+
77178
+
77179
+
77180
+
77181
+
77182
+
77183
+
77184
+
77185
+
77186
+
77187
+
77188
+
77189
+
77190
+
77191
+
77192
+
77193
+
77194
+
77195
+
77196
+
77197
+
77198
+
77199
+
77200
+
77201
+
77202
+
77203
+
77204
+
77205
+
77206
+
77207
+
77208
+
77209
+
77210
+
77211
+
77212
+
77213
+
77214
+
77215
+
77216
+
77217
+
77218
+
77219
+
77220
+
77221
+
77222
+
77223
+
77224
+
77225
+
77226
+
77227
+
77228
+
77229
+
77230
+
77231
+
77232
+
77233
+
77234
+
77235
+
77236
+
77237
+
77238
+
77239
+
77240
+
77241
+
77242
+
77243
+
77244
+
77245
+
77246
+
77247
+
77248
+
77249
+
77250
+
77251
+
77252
+
77253
+
77254
+
77255
+
77256
+
77257
+
77258
+
77259
+
77260
+
77261
+
77262
+
77263
+
77264
+
77265
+
77266
+
77267
+
77268
+
77269
+
77270
+
77271
+
77272
+
77273
+
77274
+
77275
+
77276
+
77277
+
77278
+
77279
+
77280
+
77281
+
77282
+
77283
+
77284
+
77285
+
77286
+
77287
+
77288
+
77289
+
77290
+
77291
+
77292
+
77293
+
77294
+
77295
+
77296
+
77297
+
77298
+
77299
+
77300
+
77301
+
77302
+
77303
+
77304
+
77305
+
77306
+
77307
+
77308
+
77309
+
77310
+
77311
+
77312
+
77313
+
77314
+
77315
+
77316
+
77317
+
77318
+
77319
+
77320
+
77321
+
77322
+
77323
+
77324
+
77325
+
77326
+
77327
+
77328
+
77329
+
77330
+
77331
+
77332
+
77333
+
77334
+
77335
+
77336
+
77337
+
77338
+
77339
+
77340
+
77341
+
77342
+
77343
+
77344
+
77345
+
77346
+
77347
+
77348
+
77349
+
77350
+
77351
+
77352
+
77353
+
77354
+
77355
+
77356
+
77357
+
77358
+
77359
+
77360
+
77361
+
77362
+
77363
+
77364
+
77365
+
77366
+
77367
+
77368
+
77369
+
77370
+
77371
+
77372
+
77373
+
77374
+
77375
+
77376
+
77377
+
77378
+
77379
+
77380
+
77381
+
77382
+
77383
+
77384
+
77385
+
77386
+
77387
+
77388
+
77389
+
77390
+
77391
+
77392
+
77393
+
77394
+
77395
+
77396
+
77397
+
77398
+
77399
+
77400
+
77401
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-42.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./packages/components/main-list/src/main.vue?vue&type=script&setup=true&lang=tsx
77402
+
77403
+
77404
+
77405
+
77406
+
77407
+
77408
+
77409
+
77410
+
77411
+
77412
+
77413
+
77414
+
77415
+
77416
+ var mainvue_type_script_setup_true_lang_tsx_hoisted_1 = ["onClick"];
77417
+
77418
+
77419
+
77420
+
77421
+
77422
+
77423
+ /* harmony default export */ var src_mainvue_type_script_setup_true_lang_tsx = ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
77424
+ __name: 'main',
77425
+ props: {
77426
+ fileName: {
77427
+ type: String
77428
+ },
77429
+ dataSource: {
77430
+ type: Array
77431
+ }
77432
+ },
77433
+ setup: function setup(__props) {
77434
+ var _useI18n = (0,vue_i18n/* useI18n */.s9)(),
77435
+ locale = _useI18n.locale;
77436
+ var currentInstance = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.getCurrentInstance)();
77437
+ var router = useRouter();
77438
+ var localDataList = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)([]);
77439
+ var initLoading = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(false);
77440
+ var isShowList = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(false);
77441
+ var props = __props;
77442
+ var showLocalList = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(function () {
77443
+ if (typeof props.fileName != "undefined" && props.fileName != "" && props.fileName != null) {
77444
+ return localDataList.value;
77445
+ } else {
77446
+ return props.dataSource;
77447
+ }
77448
+ });
77449
+ var formatShowListData = function formatShowListData(data) {
77450
+ localDataList.value = getListByRight(lodash_es_cloneDeep(data));
77451
+ };
77452
+ var getListByRight = function getListByRight(data) {
77453
+ var tempData = lodash_es_cloneDeep(data);
77454
+ for (var i = 0; i < tempData.length; i++) {
77455
+ for (var j = 0; j < tempData[i].Children.length; j++) {
77456
+ if (typeof tempData[i].Children[j].Right == "undefined" || hasRight(tempData[i].Children[j].Right) == true) {
77457
+ continue;
77458
+ } else {
77459
+ tempData[i].Children.splice(j, 1);
77460
+ j--;
77461
+ }
77462
+ }
77463
+ }
77464
+ var showData = tempData.filter(function (item) {
77465
+ return item.Children.length > 0;
77466
+ });
77467
+ return showData;
77468
+ };
77469
+ var getAndCols = /*#__PURE__*/function () {
77470
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
77471
+ return _regenerator().w(function (_context) {
77472
+ while (1) switch (_context.n) {
77473
+ case 0:
77474
+ initLoading.value = true;
77475
+ _context.n = 1;
77476
+ return loadProfile("main/main-list").then(function (res) {
77477
+ initLoading.value = false;
77478
+ formatShowListData(res.List);
77479
+ isShowList.value = true;
77480
+ }).finally(function () {
77481
+ initLoading.value = false;
77482
+ });
77483
+ case 1:
77484
+ return _context.a(2);
77485
+ }
77486
+ }, _callee);
77487
+ }));
77488
+ return function getAndCols() {
77489
+ return _ref.apply(this, arguments);
77490
+ };
77491
+ }();
77492
+ var geRouteByItem = function geRouteByItem(path) {
77493
+ if (!window.__POWERED_BY_QIANKUN__) {
77494
+ router.push(path);
77495
+ } else {
77496
+ if (currentInstance) currentInstance.appContext.config.globalProperties.$parentRouter.push(path);
77497
+ }
77498
+ };
77499
+ var handleClick = function handleClick(item) {
77500
+ if (!(0,lodash_namespaceObject.isNULL)(item.Router)) {
77501
+ geRouteByItem(item.Router);
77502
+ }
77503
+ };
77504
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
77505
+ return _regenerator().w(function (_context2) {
77506
+ while (1) switch (_context2.n) {
77507
+ case 0:
77508
+ _context2.n = 1;
77509
+ return getAndCols();
77510
+ case 1:
77511
+ return _context2.a(2);
77512
+ }
77513
+ }, _callee2);
77514
+ })));
77515
+ return function (_ctx, _cache) {
77516
+ var _component_a_list_item_meta = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)("a-list-item-meta");
77517
+ var _component_a_list_item = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)("a-list-item");
77518
+ var _component_a_list = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)("a-list");
77519
+ var _component_a_layout_content = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)("a-layout-content");
77520
+ var _component_a_layout = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)("a-layout");
77521
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createBlock)(_component_a_layout, null, {
77522
+ default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(function () {
77523
+ return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createVNode)(_component_a_layout_content, null, {
77524
+ default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(function () {
77525
+ return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createVNode)(_component_a_list, {
77526
+ loading: initLoading.value,
77527
+ "item-layout": "vertical",
77528
+ "data-source": showLocalList.value
77529
+ }, {
77530
+ renderItem: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(function (_ref3) {
77531
+ var item = _ref3.item;
77532
+ return [((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createBlock)(_component_a_list_item, {
77533
+ key: item.title
77534
+ }, {
77535
+ actions: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(function () {
77536
+ return [((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(true), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)(external_commonjs_vue_commonjs2_vue_root_Vue_.Fragment, null, (0,external_commonjs_vue_commonjs2_vue_root_Vue_.renderList)(item.Children, function (list, index) {
77537
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("span", {
77538
+ key: index,
77539
+ style: {
77540
+ "cursor": "pointer"
77541
+ },
77542
+ class: "hover-effect",
77543
+ onClick: function onClick($event) {
77544
+ return handleClick(list);
77545
+ }
77546
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("i", {
77547
+ class: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeClass)(list.icon),
77548
+ style: {
77549
+ "margin-left": "8px"
77550
+ }
77551
+ }, null, 2), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createTextVNode)(" " + (0,external_commonjs_vue_commonjs2_vue_root_Vue_.toDisplayString)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(locale) == "zh" ? list.NameZH : list.NameEN), 1)], 8, mainvue_type_script_setup_true_lang_tsx_hoisted_1);
77552
+ }), 128))];
77553
+ }),
77554
+ default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(function () {
77555
+ return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createVNode)(_component_a_list_item_meta, {
77556
+ description: item.description
77557
+ }, {
77558
+ title: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(function () {
77559
+ return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("a", null, (0,external_commonjs_vue_commonjs2_vue_root_Vue_.toDisplayString)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(locale) == "zh" ? item.NameZH : item.NameEN), 1)];
77560
+ }),
77561
+ _: 2
77562
+ }, 1032, ["description"]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createTextVNode)(" " + (0,external_commonjs_vue_commonjs2_vue_root_Vue_.toDisplayString)(item.content), 1)];
77563
+ }),
77564
+ _: 2
77565
+ }, 1024))];
77566
+ }),
77567
+ _: 1
77568
+ }, 8, ["loading", "data-source"])];
77569
+ }),
77570
+ _: 1
77571
+ })];
77572
+ }),
77573
+ _: 1
77574
+ });
77575
+ };
77576
+ }
77577
+ }));
77578
+ ;// ./packages/components/main-list/src/main.vue?vue&type=script&setup=true&lang=tsx
77579
+
77580
+ ;// ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-12.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./packages/components/main-list/src/main.vue?vue&type=style&index=0&id=17ac636f&lang=css
77581
+ // extracted by mini-css-extract-plugin
77582
+
77583
+ ;// ./packages/components/main-list/src/main.vue?vue&type=style&index=0&id=17ac636f&lang=css
77584
+
77585
+ ;// ./packages/components/main-list/src/main.vue
77586
+
77587
+
77588
+
77589
+ ;
77590
+
77591
+ const main_list_src_main_exports_ = src_mainvue_type_script_setup_true_lang_tsx;
77592
+
77593
+ /* harmony default export */ var main_list_src_main = (main_list_src_main_exports_);
77594
+ ;// ./packages/components/main-list/index.ts
77595
+
77596
+
77597
+
77598
+ main_list_src_main.name = "home-list";
77599
+ var ltHomeList = withInstall(main_list_src_main);
77600
+ /* harmony default export */ var main_list = (ltHomeList);
77601
+ ;// ./packages/index.ts
77602
+
72788
77603
 
72789
77604
 
72790
77605
 
@@ -72793,7 +77608,7 @@ var ltTopMenu = withInstall(top_menu_src_main);
72793
77608
 
72794
77609
 
72795
77610
 
72796
- var components = [lt_common_list, lt_common_form, components_custom_split_panel, header_title, top_filter, top_menu];
77611
+ var components = [lt_common_list, lt_common_form, components_custom_split_panel, header_title, top_filter, top_menu, main_list];
72797
77612
  var packages_install = function install(app) {
72798
77613
  components.forEach(function (component) {
72799
77614
  app.component(component.name, component);
@@ -72806,7 +77621,8 @@ var packages_install = function install(app) {
72806
77621
  ltCustomSplitPanel: components_custom_split_panel,
72807
77622
  ltHeadTitle: header_title,
72808
77623
  ltTopFilter: top_filter,
72809
- ltTopMenu: top_menu
77624
+ ltTopMenu: top_menu,
77625
+ ltHomeList: main_list
72810
77626
  });
72811
77627
  ;// ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
72812
77628