@fox-js/fox 3.1.5 → 3.1.7
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.
- package/libs/index.cjs.js +1 -1
- package/libs/index.esm.d.ts +10 -8
- package/libs/index.esm.js +559 -548
- package/libs/index.umd.js +1 -1
- package/package.json +1 -1
package/libs/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as $r, effectScope as us, getCurrentScope as Kr, h as
|
|
2
|
-
var
|
|
1
|
+
import { defineComponent as $r, effectScope as us, getCurrentScope as Kr, h as fe, hasInjectionContext as Pe, inject as L, onActivated as fs, onDeactivated as cs, onScopeDispose as Ce, provide as Z, reactive as hs, readonly as ys, ref as ds, shallowReactive as ms, shallowRef as jr, toRaw as Ot, watch as vs } from "vue";
|
|
2
|
+
var Se = typeof window < "u", C = function() {
|
|
3
3
|
return window;
|
|
4
4
|
}, Be = function() {
|
|
5
5
|
return window.document;
|
|
@@ -20,7 +20,7 @@ var Ve = (e, t, r) => {
|
|
|
20
20
|
let i = !0, n = !0;
|
|
21
21
|
for (let o in t) o === "bubbles" ? i = !!t[o] : o === "cancelable" ? n = !!t[o] : s[o] = t[o];
|
|
22
22
|
s.initEvent(e, i, n), (r ?? document).dispatchEvent(s);
|
|
23
|
-
}, sr = Array.isArray,
|
|
23
|
+
}, sr = Array.isArray, Ki = (e) => Qt(e) === "[object Map]", ji = (e) => Qt(e) === "[object Set]", ki = (e) => e instanceof Date, b = (e) => typeof e == "function", Ti = (e) => typeof e == "string", Mi = (e) => typeof e == "symbol", ps = (e) => e !== null && typeof e == "object", Li = (e) => ps(e) && b(e.then) && b(e.catch), Ue = (e) => e == null, gs = Object.prototype.toString, Qt = (e) => gs.call(e), ws = (e) => Qt(e) === "[object Object]", bs = typeof Symbol == "function" && typeof Symbol.toStringTag == "symbol";
|
|
24
24
|
function Zt(e) {
|
|
25
25
|
return e.__esModule || bs && e[Symbol.toStringTag] === "Module";
|
|
26
26
|
}
|
|
@@ -62,18 +62,18 @@ var Ie = class Ht {
|
|
|
62
62
|
let t = ++Ht.seed;
|
|
63
63
|
return t >= Number.MAX_VALUE && (Ht.seed = 0), t;
|
|
64
64
|
}
|
|
65
|
-
},
|
|
65
|
+
}, vt = Rs ? Promise.resolve() : null;
|
|
66
66
|
function Oe(e, ...t) {
|
|
67
|
-
|
|
67
|
+
vt !== null ? t && t.length > 0 ? vt.then(() => {
|
|
68
68
|
e(t);
|
|
69
|
-
}) :
|
|
69
|
+
}) : vt.then(e) : t && t.length > 0 ? setTimeout(() => {
|
|
70
70
|
e(t);
|
|
71
71
|
}) : setTimeout(e);
|
|
72
72
|
}
|
|
73
73
|
function Tr(e) {
|
|
74
74
|
return e == null ? !1 : typeof e == "boolean" ? e : typeof e == "string" ? e.toLocaleLowerCase() === "true" : !!e;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function Ii(e) {
|
|
77
77
|
return typeof e == "number" ? e : Number(e);
|
|
78
78
|
}
|
|
79
79
|
var Ss = {
|
|
@@ -141,17 +141,17 @@ function Ir(e, t) {
|
|
|
141
141
|
}, t);
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
-
var or = /* @__PURE__ */ Symbol("idKey"),
|
|
144
|
+
var or = /* @__PURE__ */ Symbol("idKey"), he = /* @__PURE__ */ Symbol("valueKey"), R = /* @__PURE__ */ Symbol("childrenKey"), W = /* @__PURE__ */ Symbol("growKey"), Or = class {
|
|
145
145
|
[W] = !0;
|
|
146
146
|
[or];
|
|
147
|
-
[
|
|
147
|
+
[he] = ds();
|
|
148
148
|
[R] = /* @__PURE__ */ new Map();
|
|
149
149
|
constructor(e) {
|
|
150
150
|
this[or] = e;
|
|
151
151
|
}
|
|
152
152
|
}, Ps = class {
|
|
153
153
|
get(e, t) {
|
|
154
|
-
if (t == "value") return e[
|
|
154
|
+
if (t == "value") return e[he].value;
|
|
155
155
|
if (t === "grow") return e[W];
|
|
156
156
|
let r = e[R].get(t);
|
|
157
157
|
if (r) return De(r);
|
|
@@ -159,7 +159,7 @@ var or = /* @__PURE__ */ Symbol("idKey"), fe = /* @__PURE__ */ Symbol("valueKey"
|
|
|
159
159
|
return r = er(t), r[W] = e[W], e[R].set(t, r), De(r);
|
|
160
160
|
}
|
|
161
161
|
set(e, t, r) {
|
|
162
|
-
return t == "value" ? (e[
|
|
162
|
+
return t == "value" ? (e[he].value = r, !0) : t === "grow" ? (e[W] = Tr(r), !0) : r == null ? (e[R].delete(t), !0) : (console.error(`[Fox]illegal property:${t}`), !1);
|
|
163
163
|
}
|
|
164
164
|
deleteProperty(e, t) {
|
|
165
165
|
return t === "value" || t == "grow" ? (console.error(`[Fox]can not delete property:${String(t)}`), !1) : (e[R].delete(t), !0);
|
|
@@ -172,7 +172,7 @@ function er(e) {
|
|
|
172
172
|
function De(e) {
|
|
173
173
|
return Reflect.get(e, Yt);
|
|
174
174
|
}
|
|
175
|
-
var
|
|
175
|
+
var Cs = class {
|
|
176
176
|
name = "";
|
|
177
177
|
persistPolicy = "memory";
|
|
178
178
|
storage;
|
|
@@ -189,8 +189,8 @@ var _s = class {
|
|
|
189
189
|
if (!this.persistPolicy || this.persistPolicy === "memory") return null;
|
|
190
190
|
let e = null;
|
|
191
191
|
if (this.persistPolicy === "custom") e = this.storage;
|
|
192
|
-
else if (
|
|
193
|
-
const t =
|
|
192
|
+
else if (Se) {
|
|
193
|
+
const t = C();
|
|
194
194
|
e = this.persistPolicy === "session" ? t.sessionStorage : t.localStorage;
|
|
195
195
|
}
|
|
196
196
|
return e;
|
|
@@ -254,7 +254,7 @@ var _s = class {
|
|
|
254
254
|
}, Hr = class extends Or {
|
|
255
255
|
_persistHandler;
|
|
256
256
|
constructor(e = {}, t) {
|
|
257
|
-
super("__root__"), this._persistHandler = new
|
|
257
|
+
super("__root__"), this._persistHandler = new Cs(e, t), this._persistHandler.init(this);
|
|
258
258
|
}
|
|
259
259
|
put(...e) {
|
|
260
260
|
let t = e.length;
|
|
@@ -265,7 +265,7 @@ var _s = class {
|
|
|
265
265
|
let i = e[s], n;
|
|
266
266
|
r[R].has(i) ? n = r[R].get(i) : (n = er(i), r[R].set(i, n)), r = n;
|
|
267
267
|
}
|
|
268
|
-
return r[
|
|
268
|
+
return r[he].value = e[t - 1], this._persistHandler.put(e), !0;
|
|
269
269
|
}
|
|
270
270
|
get(...e) {
|
|
271
271
|
let t = e.length;
|
|
@@ -276,7 +276,7 @@ var _s = class {
|
|
|
276
276
|
if (r[R].has(i)) r = r[R].get(i);
|
|
277
277
|
else return;
|
|
278
278
|
}
|
|
279
|
-
return r[
|
|
279
|
+
return r[he].value;
|
|
280
280
|
}
|
|
281
281
|
remove(...e) {
|
|
282
282
|
let t = e.length;
|
|
@@ -305,7 +305,7 @@ var _s = class {
|
|
|
305
305
|
clear() {
|
|
306
306
|
this[R].clear(), this._persistHandler.clear();
|
|
307
307
|
}
|
|
308
|
-
},
|
|
308
|
+
}, _s = [
|
|
309
309
|
"put",
|
|
310
310
|
"get",
|
|
311
311
|
"contains",
|
|
@@ -314,11 +314,11 @@ var _s = class {
|
|
|
314
314
|
"_persistHandler"
|
|
315
315
|
];
|
|
316
316
|
function lr(e) {
|
|
317
|
-
return
|
|
317
|
+
return _s.includes(e);
|
|
318
318
|
}
|
|
319
|
-
var
|
|
319
|
+
var Fs = class {
|
|
320
320
|
get(e, t) {
|
|
321
|
-
if (t == "value") return e[
|
|
321
|
+
if (t == "value") return e[he].value;
|
|
322
322
|
if (t === "grow") return e[W];
|
|
323
323
|
if (t === R) return e[R];
|
|
324
324
|
if (typeof t == "string" && lr(t)) return e[t];
|
|
@@ -329,14 +329,14 @@ var Cs = class {
|
|
|
329
329
|
return s = er(r), s[W] = e[W], e[R].set(r, s), De(s);
|
|
330
330
|
}
|
|
331
331
|
set(e, t, r) {
|
|
332
|
-
return t == "value" ? (e[
|
|
332
|
+
return t == "value" ? (e[he].value = r, !0) : t === "grow" ? (e[W] = Tr(r), !0) : lr(t) ? !1 : r == null ? (e[R].delete(t), !0) : (console.error(`[Fox]illegal property:${t}`), !1);
|
|
333
333
|
}
|
|
334
334
|
deleteProperty(e, t) {
|
|
335
335
|
return t === "value" || t == "grow" ? (console.error(`[Fox]can not delete property:${String(t)}`), !1) : (e[R].delete(t), !0);
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
338
|
function Es(e, t) {
|
|
339
|
-
const r = new Hr(e, t), s = new
|
|
339
|
+
const r = new Hr(e, t), s = new Fs(), i = new Proxy(r, s);
|
|
340
340
|
return Reflect.set(r, Yt, i), r;
|
|
341
341
|
}
|
|
342
342
|
var ar = new Proxy(Hr, { construct(e, t) {
|
|
@@ -354,8 +354,8 @@ var ar = new Proxy(Hr, { construct(e, t) {
|
|
|
354
354
|
if (!this.persistPolicy || this.persistPolicy === "memory") return null;
|
|
355
355
|
let e = null;
|
|
356
356
|
if (this.persistPolicy === "custom") e = this.storage;
|
|
357
|
-
else if (
|
|
358
|
-
const t =
|
|
357
|
+
else if (Se) {
|
|
358
|
+
const t = C();
|
|
359
359
|
e = this.persistPolicy === "session" ? t.sessionStorage : t.localStorage;
|
|
360
360
|
}
|
|
361
361
|
return e;
|
|
@@ -402,18 +402,18 @@ function Nr(e, t, r) {
|
|
|
402
402
|
const a = r && r.debounceDelay ? r.debounceDelay : 250;
|
|
403
403
|
n = Ir(i, a);
|
|
404
404
|
}
|
|
405
|
-
const o = e ?
|
|
405
|
+
const o = e ? ms(t) : hs(t), l = us(!0);
|
|
406
406
|
return l.run(() => {
|
|
407
|
-
|
|
407
|
+
vs(o, (a) => {
|
|
408
408
|
const u = Ot(a);
|
|
409
409
|
n(u);
|
|
410
410
|
});
|
|
411
411
|
}), Dt.set(o, l), o;
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function Oi(e, t) {
|
|
414
414
|
return Nr(!1, e, t);
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function Hi(e, t) {
|
|
417
417
|
return Nr(!0, e, t);
|
|
418
418
|
}
|
|
419
419
|
function As(e, t) {
|
|
@@ -442,10 +442,10 @@ function As(e, t) {
|
|
|
442
442
|
}
|
|
443
443
|
});
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function Di(e, t) {
|
|
446
446
|
return As(e, t);
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function Ni(e) {
|
|
449
449
|
const t = Dt.get(e);
|
|
450
450
|
t && (Dt.delete(e), t.stop());
|
|
451
451
|
}
|
|
@@ -459,8 +459,8 @@ function Ks(e) {
|
|
|
459
459
|
if (!e) return [[]];
|
|
460
460
|
if (e === "/") return [[qs]];
|
|
461
461
|
if (!e.startsWith("/")) throw new Error(`Invalid path "${e}"`);
|
|
462
|
-
function t(
|
|
463
|
-
throw new Error(`ERR (${r})/"${u}": ${
|
|
462
|
+
function t(d) {
|
|
463
|
+
throw new Error(`ERR (${r})/"${u}": ${d}`);
|
|
464
464
|
}
|
|
465
465
|
let r = 0, s = r;
|
|
466
466
|
const i = [];
|
|
@@ -526,29 +526,29 @@ function Ts(e, t) {
|
|
|
526
526
|
r.strict && !u.length && (i += "/");
|
|
527
527
|
for (let c = 0; c < u.length; c++) {
|
|
528
528
|
const h = u[c];
|
|
529
|
-
let
|
|
529
|
+
let d = 40 + (r.sensitive ? 0.25 : 0);
|
|
530
530
|
if (h.type === We.Static)
|
|
531
|
-
c || (i += "/"), i += h.value.replace(ks, "\\$&"),
|
|
531
|
+
c || (i += "/"), i += h.value.replace(ks, "\\$&"), d += 40;
|
|
532
532
|
else if (h.type === We.Param) {
|
|
533
|
-
const { value:
|
|
533
|
+
const { value: y, repeatable: m, optional: w, regexp: p } = h;
|
|
534
534
|
n.push({
|
|
535
|
-
name:
|
|
536
|
-
repeatable:
|
|
535
|
+
name: y,
|
|
536
|
+
repeatable: m,
|
|
537
537
|
optional: w
|
|
538
538
|
});
|
|
539
|
-
const
|
|
540
|
-
if (
|
|
541
|
-
|
|
539
|
+
const g = p || ur;
|
|
540
|
+
if (g !== ur) {
|
|
541
|
+
d += 10;
|
|
542
542
|
try {
|
|
543
|
-
new RegExp(`(${
|
|
543
|
+
new RegExp(`(${g})`);
|
|
544
544
|
} catch (K) {
|
|
545
|
-
throw new Error(`Invalid custom RegExp for param "${
|
|
545
|
+
throw new Error(`Invalid custom RegExp for param "${y}" (${g}): ` + K.message);
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
|
-
let $ =
|
|
549
|
-
c || ($ = w && u.length < 2 ? `(?:/${$})` : "/" + $), w && ($ += "?"), i += $,
|
|
548
|
+
let $ = m ? `((?:${g})(?:/(?:${g}))*)` : `(${g})`;
|
|
549
|
+
c || ($ = w && u.length < 2 ? `(?:/${$})` : "/" + $), w && ($ += "?"), i += $, d += 20, w && (d += -8), m && (d += -20), g === ".*" && (d += -50);
|
|
550
550
|
}
|
|
551
|
-
f.push(
|
|
551
|
+
f.push(d);
|
|
552
552
|
}
|
|
553
553
|
s.push(f);
|
|
554
554
|
}
|
|
@@ -562,8 +562,8 @@ function Ts(e, t) {
|
|
|
562
562
|
const f = u.match(o), c = {};
|
|
563
563
|
if (!f) return null;
|
|
564
564
|
for (let h = 1; h < f.length; h++) {
|
|
565
|
-
const
|
|
566
|
-
c[
|
|
565
|
+
const d = f[h] || "", y = n[h - 1];
|
|
566
|
+
c[y.name] = d && y.repeatable ? d.split("/") : d;
|
|
567
567
|
}
|
|
568
568
|
return c;
|
|
569
569
|
}
|
|
@@ -571,16 +571,16 @@ function Ts(e, t) {
|
|
|
571
571
|
let f = "", c = !1;
|
|
572
572
|
for (const h of e) {
|
|
573
573
|
(!c || !f.endsWith("/")) && (f += "/"), c = !1;
|
|
574
|
-
for (const
|
|
575
|
-
else if (
|
|
576
|
-
const { value:
|
|
577
|
-
if (sr(
|
|
578
|
-
const
|
|
579
|
-
if (!
|
|
574
|
+
for (const d of h) if (d.type === We.Static) f += d.value;
|
|
575
|
+
else if (d.type === We.Param) {
|
|
576
|
+
const { value: y, repeatable: m, optional: w } = d, p = y in u ? u[y] : "";
|
|
577
|
+
if (sr(p) && !m) throw new Error(`Provided param "${y}" is an array but it is not repeatable (* or + modifiers)`);
|
|
578
|
+
const g = sr(p) ? p.join("/") : p;
|
|
579
|
+
if (!g)
|
|
580
580
|
if (w)
|
|
581
581
|
h.length < 2 && (f.endsWith("/") ? f = f.slice(0, -1) : c = !0);
|
|
582
|
-
else throw new Error(`Missing required param "${
|
|
583
|
-
f +=
|
|
582
|
+
else throw new Error(`Missing required param "${y}"`);
|
|
583
|
+
f += g;
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
586
|
return f || "/";
|
|
@@ -725,11 +725,11 @@ var Is = class {
|
|
|
725
725
|
meta;
|
|
726
726
|
matchedRoutes;
|
|
727
727
|
layers = [];
|
|
728
|
-
},
|
|
728
|
+
}, _ = /* @__PURE__ */ (function(e) {
|
|
729
729
|
return e[e.Push = 0] = "Push", e[e.Replace = 1] = "Replace", e[e.Put = 2] = "Put", e[e.Append = 3] = "Append", e[e.Open = 4] = "Open", e;
|
|
730
730
|
})({}), gt = /* @__PURE__ */ (function(e) {
|
|
731
731
|
return e[e.Part = 0] = "Part", e[e.All = 1] = "All", e;
|
|
732
|
-
})({}), V = /* @__PURE__ */ Symbol("rootKey"), B = /* @__PURE__ */ Symbol("rootNodeKey"),
|
|
732
|
+
})({}), V = /* @__PURE__ */ Symbol("rootKey"), B = /* @__PURE__ */ Symbol("rootNodeKey"), ce = /* @__PURE__ */ Symbol("parentNodeKey"), at = /* @__PURE__ */ Symbol("nameKey"), Y = class {
|
|
733
733
|
model;
|
|
734
734
|
route;
|
|
735
735
|
active = !0;
|
|
@@ -737,7 +737,7 @@ var Is = class {
|
|
|
737
737
|
constructor(e, t, r = 0, s = !0) {
|
|
738
738
|
this.route = e, this.model = t, this.index = r, this.active = s;
|
|
739
739
|
}
|
|
740
|
-
},
|
|
740
|
+
}, Ee = class {
|
|
741
741
|
_slots;
|
|
742
742
|
get slots() {
|
|
743
743
|
return this._slots == null && (this._slots = jr([])), this._slots;
|
|
@@ -748,7 +748,7 @@ var Is = class {
|
|
|
748
748
|
[at];
|
|
749
749
|
[V];
|
|
750
750
|
[B] = null;
|
|
751
|
-
[
|
|
751
|
+
[ce] = null;
|
|
752
752
|
get name() {
|
|
753
753
|
return this[at];
|
|
754
754
|
}
|
|
@@ -777,44 +777,40 @@ var Is = class {
|
|
|
777
777
|
time;
|
|
778
778
|
route;
|
|
779
779
|
}, Ns = class {
|
|
780
|
-
|
|
780
|
+
submitCooldownTime = 300;
|
|
781
781
|
submitRecorder = new Ds();
|
|
782
782
|
isSameRoute(e, t) {
|
|
783
783
|
return e == null || t == null ? !1 : e.name === t.name && e.path === t.path && e.root === t.root;
|
|
784
784
|
}
|
|
785
785
|
acquire(e) {
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
this.submitRecorder.time = t;
|
|
789
|
-
return;
|
|
790
|
-
}
|
|
791
|
-
return this.submitRecorder.route = e, this.submitRecorder.time = t, t;
|
|
786
|
+
const t = (/* @__PURE__ */ new Date()).getTime();
|
|
787
|
+
return this.isSameRoute(e, this.submitRecorder.route) && this.submitRecorder.time && t - this.submitRecorder.time <= this.submitCooldownTime ? (this.submitRecorder.time = t, null) : (this.submitRecorder.route = e, this.submitRecorder.time = t, t);
|
|
792
788
|
}
|
|
793
789
|
release(e) {
|
|
794
790
|
this.submitRecorder.time === e && (this.submitRecorder.route = void 0);
|
|
795
791
|
}
|
|
796
|
-
}, O = /* @__PURE__ */ Symbol("chainKey"), T = /* @__PURE__ */ Symbol("cursorKey"), bt = /* @__PURE__ */ Symbol("$persistentModeKey"), P = /* @__PURE__ */ Symbol("statusKey"), J = /* @__PURE__ */ Symbol("argsKey"), Je = /* @__PURE__ */ Symbol("exArgsKey"),
|
|
792
|
+
}, O = /* @__PURE__ */ Symbol("chainKey"), T = /* @__PURE__ */ Symbol("cursorKey"), bt = /* @__PURE__ */ Symbol("$persistentModeKey"), P = /* @__PURE__ */ Symbol("statusKey"), J = /* @__PURE__ */ Symbol("argsKey"), Je = /* @__PURE__ */ Symbol("exArgsKey"), me = /* @__PURE__ */ Symbol("successFnsKey"), Ae = /* @__PURE__ */ Symbol("errorFnsKey"), ne = /* @__PURE__ */ Symbol("sessionKey"), G = /* @__PURE__ */ Symbol("_go"), ft = class {
|
|
797
793
|
[O] = [];
|
|
798
794
|
[T] = 0;
|
|
799
795
|
[bt] = !1;
|
|
800
796
|
[P] = "Free";
|
|
801
797
|
[J] = [];
|
|
802
798
|
[Je] = [];
|
|
803
|
-
[
|
|
804
|
-
[
|
|
805
|
-
[
|
|
799
|
+
[me] = [];
|
|
800
|
+
[Ae] = [];
|
|
801
|
+
[ne];
|
|
806
802
|
get session() {
|
|
807
|
-
return this[
|
|
803
|
+
return this[ne];
|
|
808
804
|
}
|
|
809
805
|
constructor(e, t = !1) {
|
|
810
|
-
this[
|
|
806
|
+
this[ne] = e, this[bt] = t;
|
|
811
807
|
}
|
|
812
808
|
[G](e, ...t) {
|
|
813
809
|
let r = this[P];
|
|
814
810
|
if (this[P] = "Busy", this[T] += e, this[T] < 0 && (this[T] = 0), this[J] = t, r === "Exception" || r === "Reject") {
|
|
815
|
-
let n = [{ session: this[
|
|
816
|
-
for (; this[
|
|
817
|
-
let o = this[
|
|
811
|
+
let n = [{ session: this[ne] }, ...this[Je]];
|
|
812
|
+
for (; this[Ae].length > 0; ) try {
|
|
813
|
+
let o = this[Ae].shift();
|
|
818
814
|
typeof o == "function" && Oe(() => {
|
|
819
815
|
Reflect.apply(o, {}, n);
|
|
820
816
|
});
|
|
@@ -823,9 +819,9 @@ var Is = class {
|
|
|
823
819
|
}
|
|
824
820
|
return this[P] = r, this[O] = [], this[T] = 0, this;
|
|
825
821
|
} else if (r === "Finished" || this[T] >= this[O].length) {
|
|
826
|
-
let n = [{ session: this[
|
|
827
|
-
for (; this[
|
|
828
|
-
let o = this[
|
|
822
|
+
let n = [{ session: this[ne] }, ...this[J]];
|
|
823
|
+
for (; this[me].length > 0; ) {
|
|
824
|
+
let o = this[me].shift();
|
|
829
825
|
typeof o == "function" && Oe(() => {
|
|
830
826
|
Reflect.apply(o, {}, n);
|
|
831
827
|
});
|
|
@@ -851,7 +847,7 @@ var Is = class {
|
|
|
851
847
|
insert: (l) => {
|
|
852
848
|
n || (this[O].splice(i, 0, l), i++);
|
|
853
849
|
},
|
|
854
|
-
session: this[
|
|
850
|
+
session: this[ne]
|
|
855
851
|
};
|
|
856
852
|
Oe(() => {
|
|
857
853
|
Reflect.apply(s, {}, [o, ...this[J]]);
|
|
@@ -875,9 +871,9 @@ var Is = class {
|
|
|
875
871
|
}
|
|
876
872
|
reset(...e) {
|
|
877
873
|
this[P] = "Busy", this[J] = e, this[O] = [], this[T] = 0;
|
|
878
|
-
let t = [{ session: this[
|
|
879
|
-
for (; this[
|
|
880
|
-
let r = this[
|
|
874
|
+
let t = [{ session: this[ne] }, ...this[J]];
|
|
875
|
+
for (; this[me].length > 0; ) {
|
|
876
|
+
let r = this[me].shift();
|
|
881
877
|
Oe(() => {
|
|
882
878
|
Reflect.apply(r, this, t);
|
|
883
879
|
});
|
|
@@ -888,25 +884,25 @@ var Is = class {
|
|
|
888
884
|
return this[P] === "Reject" || this[P] === "Exception" ? this : (Array.isArray(e) ? this[O] = [...this[O], ...e] : this[O].push(e), this[P] === "Busy" ? this : (Reflect.apply(this[G], this, [0, ...this[J]]), this));
|
|
889
885
|
}
|
|
890
886
|
wait(e, t) {
|
|
891
|
-
return e && typeof e == "function" && this[
|
|
887
|
+
return e && typeof e == "function" && this[me].push(e), t && typeof t == "function" && this[Ae].push(t), this[P] === "Busy" ? this : (Reflect.apply(this[G], this, [0, ...this[J]]), this);
|
|
892
888
|
}
|
|
893
889
|
exception(e) {
|
|
894
|
-
return e && typeof e == "function" && this[
|
|
890
|
+
return e && typeof e == "function" && this[Ae].push(e), this[P] === "Busy" ? this : Reflect.apply(this[G], this, [0, ...this[J]]);
|
|
895
891
|
}
|
|
896
892
|
isFinish() {
|
|
897
893
|
return this[P] == "Reject" || this[P] == "Free" && this[T] >= this[O].length;
|
|
898
894
|
}
|
|
899
|
-
},
|
|
895
|
+
}, be = /* @__PURE__ */ Symbol("_notifyChange"), Rt = class {
|
|
900
896
|
currentRoute;
|
|
901
897
|
routes;
|
|
902
898
|
constructor(e, t) {
|
|
903
899
|
this.currentRoute = e, this.routes = t;
|
|
904
900
|
}
|
|
905
|
-
},
|
|
901
|
+
}, oe = /* @__PURE__ */ Symbol("historyChangeConsumerKey"), hr = /* @__PURE__ */ Symbol("_navigateFirstRoute"), Ge = /* @__PURE__ */ Symbol("_getRouteMark"), St = /* @__PURE__ */ Symbol("_getUrlSearch"), xt = /* @__PURE__ */ Symbol("_generateLocation"), Xe = /* @__PURE__ */ Symbol("_setRouteMarkRecorder"), qe = /* @__PURE__ */ Symbol("beforeRestoreFiltersKey"), yr = /* @__PURE__ */ Symbol("_beforeRestore"), dr = "Symbol(_fox_restore_point)";
|
|
906
902
|
function Qe(e, ...t) {
|
|
907
903
|
return typeof e == "function" ? Reflect.apply(e, null, [...t]) : e;
|
|
908
904
|
}
|
|
909
|
-
function
|
|
905
|
+
function mr(e) {
|
|
910
906
|
if (!Array.isArray(e)) return !1;
|
|
911
907
|
if (e.length === 0) return !0;
|
|
912
908
|
const t = e[0];
|
|
@@ -922,25 +918,25 @@ var Wr = class {
|
|
|
922
918
|
traceless = !1;
|
|
923
919
|
changeHandler;
|
|
924
920
|
historyChange;
|
|
925
|
-
[
|
|
926
|
-
[
|
|
921
|
+
[oe] = !1;
|
|
922
|
+
[qe] = new Array();
|
|
927
923
|
backTimeout = 320;
|
|
928
924
|
constructor(e = "hash", t = "", r = "", s = !0, i = !0, n = !1, o, l) {
|
|
929
|
-
this.mode = e, this.base = t, this.query = r, this.firstNavigate = s, this.historyMonitor = i, this.traceless = n, this.storage = o ??
|
|
925
|
+
this.mode = e, this.base = t, this.query = r, this.firstNavigate = s, this.historyMonitor = i, this.traceless = n, this.storage = o ?? C().sessionStorage, this.backTimeout = l ?? 320;
|
|
930
926
|
}
|
|
931
927
|
init(e = !0) {
|
|
932
|
-
const t =
|
|
928
|
+
const t = C();
|
|
933
929
|
return typeof this.historyChange != "function" && (this.historyChange = () => {
|
|
934
|
-
if (typeof this[
|
|
935
|
-
const r = this[
|
|
936
|
-
if (this[
|
|
937
|
-
} else if (this[
|
|
938
|
-
this[
|
|
930
|
+
if (typeof this[oe] == "function") {
|
|
931
|
+
const r = this[oe]();
|
|
932
|
+
if (this[oe] = !1, r) return;
|
|
933
|
+
} else if (this[oe] === !0) {
|
|
934
|
+
this[oe] = !1;
|
|
939
935
|
return;
|
|
940
936
|
}
|
|
941
937
|
if (Qe(this.historyMonitor)) {
|
|
942
938
|
const r = t.history.state;
|
|
943
|
-
this[
|
|
939
|
+
this[be](r);
|
|
944
940
|
try {
|
|
945
941
|
let s = [];
|
|
946
942
|
if (typeof r == "string" ? s = JSON.parse(r) : s = r, Array.isArray(s) && s.length > 0) {
|
|
@@ -954,12 +950,12 @@ var Wr = class {
|
|
|
954
950
|
}
|
|
955
951
|
destroy() {
|
|
956
952
|
if (this.historyChange) {
|
|
957
|
-
const e =
|
|
953
|
+
const e = C();
|
|
958
954
|
Xt(e, "popstate", this.historyChange);
|
|
959
955
|
}
|
|
960
956
|
}
|
|
961
957
|
[yr](e, t, r, s) {
|
|
962
|
-
for (let i of this[
|
|
958
|
+
for (let i of this[qe]) try {
|
|
963
959
|
const n = Reflect.apply(i, {}, [
|
|
964
960
|
e,
|
|
965
961
|
t,
|
|
@@ -973,11 +969,11 @@ var Wr = class {
|
|
|
973
969
|
return !0;
|
|
974
970
|
}
|
|
975
971
|
beforeRestoreEach(e) {
|
|
976
|
-
this[
|
|
972
|
+
this[qe].push(e);
|
|
977
973
|
}
|
|
978
974
|
removeBeforeRestoreEach(e) {
|
|
979
|
-
const t = this[
|
|
980
|
-
return t !== -1 ? (this[
|
|
975
|
+
const t = this[qe].indexOf(e);
|
|
976
|
+
return t !== -1 ? (this[qe].splice(t, 1), !0) : !1;
|
|
981
977
|
}
|
|
982
978
|
[hr]() {
|
|
983
979
|
const e = this[Ge]() ?? "/", t = this.storage.getItem(dr);
|
|
@@ -987,7 +983,7 @@ var Wr = class {
|
|
|
987
983
|
const o = n.routes.filter((l, a) => (l.params = l.params ? Lr(l.params) : {}, this[yr](l, a, e, n.routes)));
|
|
988
984
|
if (o.length > 0) {
|
|
989
985
|
const l = this[St](), a = o.length - 1;
|
|
990
|
-
o[a].query = l || o[a].query, this[
|
|
986
|
+
o[a].query = l || o[a].query, this[be](o);
|
|
991
987
|
return;
|
|
992
988
|
}
|
|
993
989
|
}
|
|
@@ -997,7 +993,7 @@ var Wr = class {
|
|
|
997
993
|
let s;
|
|
998
994
|
r != -1 ? s = e.substring(r + 1) : s = e;
|
|
999
995
|
const i = new x();
|
|
1000
|
-
i.path = s, i.query = this[St](), this[
|
|
996
|
+
i.path = s, i.query = this[St](), this[be]([i]);
|
|
1001
997
|
}
|
|
1002
998
|
[Xe](e, t) {
|
|
1003
999
|
try {
|
|
@@ -1017,11 +1013,11 @@ var Wr = class {
|
|
|
1017
1013
|
const t = this[Ge]() ?? "/";
|
|
1018
1014
|
this[Xe](t, e);
|
|
1019
1015
|
}
|
|
1020
|
-
[
|
|
1016
|
+
[be](e) {
|
|
1021
1017
|
typeof this.changeHandler == "function" && this.changeHandler(e);
|
|
1022
1018
|
}
|
|
1023
1019
|
[Ge]() {
|
|
1024
|
-
const e =
|
|
1020
|
+
const e = C();
|
|
1025
1021
|
if (this.mode === "path") {
|
|
1026
1022
|
let t = e.location.pathname;
|
|
1027
1023
|
return this.base && t.indexOf(this.base) === 0 && (t = t.substring(this.base.length)), t;
|
|
@@ -1032,19 +1028,19 @@ var Wr = class {
|
|
|
1032
1028
|
return null;
|
|
1033
1029
|
}
|
|
1034
1030
|
[St]() {
|
|
1035
|
-
let e =
|
|
1031
|
+
let e = C().location.search;
|
|
1036
1032
|
return e.length > 0 && e.indexOf("?") === 0 && (e = e.substring(1)), e;
|
|
1037
1033
|
}
|
|
1038
1034
|
listen(e) {
|
|
1039
1035
|
this.changeHandler = e;
|
|
1040
1036
|
}
|
|
1041
1037
|
go(e, t = !1) {
|
|
1042
|
-
const r =
|
|
1043
|
-
this[
|
|
1038
|
+
const r = C();
|
|
1039
|
+
this[oe] = t, r.history.go(e);
|
|
1044
1040
|
}
|
|
1045
1041
|
goBack(e, t) {
|
|
1046
|
-
const r =
|
|
1047
|
-
if (
|
|
1042
|
+
const r = C(), s = r.history.state;
|
|
1043
|
+
if (mr(s) && s.length > 0) {
|
|
1048
1044
|
let i = !1;
|
|
1049
1045
|
for (let u = s.length - 1; u >= 0; u--) {
|
|
1050
1046
|
const f = x.from(s[u]);
|
|
@@ -1063,22 +1059,22 @@ var Wr = class {
|
|
|
1063
1059
|
r.history.go(-1), o = setTimeout(l, n);
|
|
1064
1060
|
}, a = () => {
|
|
1065
1061
|
clearTimeout(o);
|
|
1066
|
-
const u =
|
|
1067
|
-
if (
|
|
1062
|
+
const u = C().history.state;
|
|
1063
|
+
if (mr(u) && u.length > 0) {
|
|
1068
1064
|
let f = u.length;
|
|
1069
1065
|
const c = u[f - 1], h = x.from(c);
|
|
1070
1066
|
if (x.isSame(h, e))
|
|
1071
1067
|
return t(), !0;
|
|
1072
1068
|
if (f > 0) {
|
|
1073
|
-
let
|
|
1074
|
-
for (let
|
|
1075
|
-
const
|
|
1076
|
-
if (!(
|
|
1077
|
-
|
|
1069
|
+
let d = !1;
|
|
1070
|
+
for (let y = f - 1; y >= 0; y--) {
|
|
1071
|
+
const m = x.from(u[y]);
|
|
1072
|
+
if (!(m.traceless === !0 || Qe(this.traceless, m)) && x.isSame(m, e)) {
|
|
1073
|
+
d = !0;
|
|
1078
1074
|
break;
|
|
1079
1075
|
}
|
|
1080
1076
|
}
|
|
1081
|
-
return
|
|
1077
|
+
return d ? (setTimeout(() => {
|
|
1082
1078
|
o = setTimeout(l, n), this.go(-1, a);
|
|
1083
1079
|
}, 0), !0) : (t(), !0);
|
|
1084
1080
|
}
|
|
@@ -1094,14 +1090,14 @@ var Wr = class {
|
|
|
1094
1090
|
}
|
|
1095
1091
|
push(e) {
|
|
1096
1092
|
const t = this[xt](e.currentRoute);
|
|
1097
|
-
e.currentRoute.historyUpdatePolicy !== "traceless" && !Qe(this.traceless, e.currentRoute) &&
|
|
1093
|
+
e.currentRoute.historyUpdatePolicy !== "traceless" && !Qe(this.traceless, e.currentRoute) && C().history.pushState(e.routes, "", t), this.setRouteMark(e);
|
|
1098
1094
|
}
|
|
1099
1095
|
replace(e) {
|
|
1100
1096
|
const t = this[xt](e.currentRoute);
|
|
1101
|
-
(e.currentRoute.historyUpdatePolicy !== "traceless" || !Qe(this.traceless, e.currentRoute)) &&
|
|
1097
|
+
(e.currentRoute.historyUpdatePolicy !== "traceless" || !Qe(this.traceless, e.currentRoute)) && C().history.replaceState(e.routes, "", t), this.setRouteMark(e);
|
|
1102
1098
|
}
|
|
1103
1099
|
[xt](e) {
|
|
1104
|
-
const t =
|
|
1100
|
+
const t = C();
|
|
1105
1101
|
let r = "";
|
|
1106
1102
|
if (e.query) {
|
|
1107
1103
|
let o = "";
|
|
@@ -1119,8 +1115,8 @@ var Wr = class {
|
|
|
1119
1115
|
return r ? this.mode == "path" ? i.indexOf("/") === 0 ? n = `${this.base}${i}${r}` : n = `${this.base}/${i}${r}` : n = `${s.pathname}${r}#${i}` : this.mode == "path" ? i.indexOf("/") === 0 ? n = `${this.base}${i}` : n = `${this.base}/${i}` : n = `${s.pathname}#${i}`, `${s.origin}${n}`;
|
|
1120
1116
|
}
|
|
1121
1117
|
};
|
|
1122
|
-
function
|
|
1123
|
-
return t !== null && (t =
|
|
1118
|
+
function Ui(e = !0, t = null, r = "", s = !0, i = !1, n) {
|
|
1119
|
+
return t !== null && (t = C().location.pathname), t && t.endsWith("/") && (t = t.substring(0, t.length - 1)), new Wr("path", t ?? "", r, e, s, i, n);
|
|
1124
1120
|
}
|
|
1125
1121
|
function Us(e = !0, t = "", r = !0, s = !1, i) {
|
|
1126
1122
|
return new Wr("hash", "", t, e, r, s, i);
|
|
@@ -1150,7 +1146,7 @@ var Bs = class {
|
|
|
1150
1146
|
listen(e) {
|
|
1151
1147
|
this.changeHandler = e;
|
|
1152
1148
|
}
|
|
1153
|
-
[
|
|
1149
|
+
[be](e) {
|
|
1154
1150
|
typeof this.changeHandler == "function" && this.changeHandler(e);
|
|
1155
1151
|
}
|
|
1156
1152
|
go(e, t = !1) {
|
|
@@ -1161,7 +1157,7 @@ var Bs = class {
|
|
|
1161
1157
|
let s = !1;
|
|
1162
1158
|
if (typeof t == "function" ? s = t() : s = t, !s) {
|
|
1163
1159
|
const i = this.queue[r];
|
|
1164
|
-
this[
|
|
1160
|
+
this[be](i.routes);
|
|
1165
1161
|
}
|
|
1166
1162
|
}
|
|
1167
1163
|
}
|
|
@@ -1195,48 +1191,48 @@ var Bs = class {
|
|
|
1195
1191
|
function Vs(e = "", t = 50) {
|
|
1196
1192
|
return new Bs(e, t);
|
|
1197
1193
|
}
|
|
1198
|
-
var Ze = /* @__PURE__ */ Symbol("_constructRouteModel"), Ye = /* @__PURE__ */ Symbol("_findRouteModel"), Pt = /* @__PURE__ */ Symbol("_findRootView"),
|
|
1199
|
-
function
|
|
1200
|
-
return e.layers.length
|
|
1194
|
+
var Ze = /* @__PURE__ */ Symbol("_constructRouteModel"), Ye = /* @__PURE__ */ Symbol("_findRouteModel"), Pt = /* @__PURE__ */ Symbol("_findRootView"), le = /* @__PURE__ */ Symbol("_removeView"), vr = /* @__PURE__ */ Symbol("_buildPage"), pr = /* @__PURE__ */ Symbol("_resolveComponent"), gr = /* @__PURE__ */ Symbol("_update"), ee = /* @__PURE__ */ Symbol("_merge"), Ct = /* @__PURE__ */ Symbol("_handleHistoryChange"), ae = /* @__PURE__ */ Symbol("_handleRouteUpdated"), et = /* @__PURE__ */ Symbol("routeUpdatedCallback"), _t = /* @__PURE__ */ Symbol("currentRoute"), v = /* @__PURE__ */ Symbol("currentRoutes"), tt = /* @__PURE__ */ Symbol("routeSessionCacheKey"), wr = /* @__PURE__ */ Symbol("_addRouteRecorder"), $e = /* @__PURE__ */ Symbol("_removeRouteRecorder"), Ke = /* @__PURE__ */ Symbol("_cloneRouteRecorder"), A = /* @__PURE__ */ Symbol("_handleError"), rt = /* @__PURE__ */ Symbol("errorCallback"), H = /* @__PURE__ */ Symbol("registerKey"), st = /* @__PURE__ */ Symbol("notFoundKey"), Ft = /* @__PURE__ */ Symbol("notFoundPathKey"), U = /* @__PURE__ */ Symbol("forestKey"), S = /* @__PURE__ */ Symbol("historyKey"), je = /* @__PURE__ */ Symbol("beforeFiltersKey"), ke = /* @__PURE__ */ Symbol("afterFiltersKey"), Te = /* @__PURE__ */ Symbol("destroyFiltersKey"), Et = /* @__PURE__ */ Symbol("propsFilterKey"), ve = /* @__PURE__ */ Symbol("mainDispatcherKey"), it = /* @__PURE__ */ Symbol("initKey"), ue = /* @__PURE__ */ Symbol("readyKey"), nt = /* @__PURE__ */ Symbol("readyHandlersKey"), ot = /* @__PURE__ */ Symbol("_markReady"), br = /* @__PURE__ */ Symbol("_createNextFn"), At = /* @__PURE__ */ Symbol("_start"), qt = /* @__PURE__ */ Symbol("_before"), $t = /* @__PURE__ */ Symbol("_after"), Rr = /* @__PURE__ */ Symbol("_destroy"), Kt = /* @__PURE__ */ Symbol("_load"), Me = /* @__PURE__ */ Symbol("_unload"), te = /* @__PURE__ */ Symbol("routerGuardKey");
|
|
1195
|
+
function Ws(e) {
|
|
1196
|
+
return e.layers.length === 0 || e.layers[0].views.length === 0;
|
|
1201
1197
|
}
|
|
1202
|
-
var
|
|
1198
|
+
var zs = class {
|
|
1203
1199
|
[H] = new Array();
|
|
1204
1200
|
[st];
|
|
1205
|
-
[
|
|
1206
|
-
[
|
|
1201
|
+
[Ft] = "*";
|
|
1202
|
+
[ue] = !1;
|
|
1207
1203
|
[nt] = [];
|
|
1208
1204
|
[U] = new Hs();
|
|
1209
1205
|
[S];
|
|
1210
|
-
[
|
|
1211
|
-
[
|
|
1206
|
+
[v] = new Array();
|
|
1207
|
+
[_t] = jr(null);
|
|
1212
1208
|
[tt] = /* @__PURE__ */ new WeakMap();
|
|
1213
1209
|
[rt] = null;
|
|
1214
1210
|
[et] = null;
|
|
1215
|
-
[Ke] = new Array();
|
|
1216
1211
|
[je] = new Array();
|
|
1217
1212
|
[ke] = new Array();
|
|
1213
|
+
[Te] = new Array();
|
|
1218
1214
|
[Et] = null;
|
|
1219
1215
|
[ve] = new ft();
|
|
1220
|
-
[
|
|
1216
|
+
[te] = new Ns();
|
|
1221
1217
|
[it] = !1;
|
|
1222
1218
|
get currentRoute() {
|
|
1223
|
-
return ys(this[
|
|
1219
|
+
return ys(this[_t]);
|
|
1224
1220
|
}
|
|
1225
1221
|
options;
|
|
1226
1222
|
constructor(e) {
|
|
1227
1223
|
this.options = e ?? {}, this.options.notFoundPath && this.setNotFoundPath(this.options.notFoundPath);
|
|
1228
1224
|
let t = this.options.routes || [];
|
|
1229
|
-
this.addRoutes(t), this.options.notFound && this.setNotFoundRoute(this.options.notFound), e.history ? this[S] = e.history : this[S] =
|
|
1225
|
+
this.addRoutes(t), this.options.notFound && this.setNotFoundRoute(this.options.notFound), e.history ? this[S] = e.history : this[S] = Se ? Us() : Vs(), this[S]?.listen(async (r) => {
|
|
1230
1226
|
let s = !0;
|
|
1231
1227
|
try {
|
|
1232
1228
|
if (typeof r == "string") {
|
|
1233
1229
|
const i = this[M](r);
|
|
1234
|
-
i && await this[
|
|
1235
|
-
} else await this[
|
|
1230
|
+
i && await this[Ct]([i]);
|
|
1231
|
+
} else await this[Ct](r);
|
|
1236
1232
|
} catch (i) {
|
|
1237
1233
|
console.error(i.message, i), s = !1;
|
|
1238
1234
|
}
|
|
1239
|
-
this[
|
|
1235
|
+
this[ue] === !1 && this[ot](s);
|
|
1240
1236
|
});
|
|
1241
1237
|
}
|
|
1242
1238
|
[A](e = "error", t) {
|
|
@@ -1251,18 +1247,18 @@ var Js = class {
|
|
|
1251
1247
|
console.error(e);
|
|
1252
1248
|
}
|
|
1253
1249
|
init() {
|
|
1254
|
-
this[it] !== !0 && (this[S]?.init(!this[
|
|
1250
|
+
this[it] !== !0 && (this[S]?.init(!this[ue]), this[it] = !0);
|
|
1255
1251
|
}
|
|
1256
1252
|
destroy() {
|
|
1257
1253
|
this[S]?.destroy(), this[it] = !1;
|
|
1258
1254
|
}
|
|
1259
1255
|
isReady() {
|
|
1260
|
-
return this[
|
|
1256
|
+
return this[ue] ? Promise.resolve() : new Promise((e, t) => {
|
|
1261
1257
|
this[nt].push([e, t]);
|
|
1262
1258
|
});
|
|
1263
1259
|
}
|
|
1264
1260
|
[ot](e) {
|
|
1265
|
-
this[
|
|
1261
|
+
this[ue] = !0, this[nt].forEach(([t, r]) => {
|
|
1266
1262
|
try {
|
|
1267
1263
|
e ? t() : r();
|
|
1268
1264
|
} catch (s) {
|
|
@@ -1270,22 +1266,22 @@ var Js = class {
|
|
|
1270
1266
|
}
|
|
1271
1267
|
}), this[nt] = [];
|
|
1272
1268
|
}
|
|
1273
|
-
[
|
|
1269
|
+
[Ct](e) {
|
|
1274
1270
|
try {
|
|
1275
1271
|
if (!e) {
|
|
1276
|
-
let n = [...this[
|
|
1277
|
-
return this[
|
|
1272
|
+
let n = [...this[v]].reverse();
|
|
1273
|
+
return this[Me](n), Se && C().location.reload(), Promise.resolve();
|
|
1278
1274
|
}
|
|
1279
1275
|
let t = null, r = [], s = [], i = 0;
|
|
1280
|
-
for (; i < e.length && i < this[
|
|
1281
|
-
e[i].active === !0 && e[i].active !== this[
|
|
1276
|
+
for (; i < e.length && i < this[v].length && x.isSame(e[i], this[v][i]); i++)
|
|
1277
|
+
e[i].active === !0 && e[i].active !== this[v][i].active && (t = e[i]);
|
|
1282
1278
|
if (i < e.length) r = e.slice(i);
|
|
1283
|
-
else if (i === e.length) for (; i < this[
|
|
1284
|
-
r.push(this[
|
|
1285
|
-
if (i < this[
|
|
1279
|
+
else if (i === e.length) for (; i < this[v].length && this[v][i].historyUpdatePolicy === "traceless"; i++)
|
|
1280
|
+
r.push(this[v][i]), t = e[i];
|
|
1281
|
+
if (i < this[v].length && (s = this[v].slice(i).reverse()), s.length === 0 && r.length === 0) {
|
|
1286
1282
|
if (t !== null) return this.restore([t]);
|
|
1287
1283
|
} else if (s.length > 0) {
|
|
1288
|
-
if (this[
|
|
1284
|
+
if (this[Me](s)) {
|
|
1289
1285
|
if (r.length > 0) return this.restore(r);
|
|
1290
1286
|
if (t !== null) return this.restore([t]);
|
|
1291
1287
|
}
|
|
@@ -1295,60 +1291,48 @@ var Js = class {
|
|
|
1295
1291
|
}
|
|
1296
1292
|
return Promise.resolve();
|
|
1297
1293
|
}
|
|
1298
|
-
[
|
|
1299
|
-
if (this[
|
|
1294
|
+
[ae](e = null) {
|
|
1295
|
+
if (this[_t].value = e, typeof this[et] == "function") try {
|
|
1300
1296
|
this[et](e);
|
|
1301
1297
|
} catch {
|
|
1302
1298
|
}
|
|
1303
1299
|
}
|
|
1304
1300
|
[wr](e, t) {
|
|
1305
|
-
if (e.opsType ===
|
|
1301
|
+
if (e.opsType === _.Open) {
|
|
1306
1302
|
let r = !1;
|
|
1307
|
-
const s = this[
|
|
1303
|
+
const s = this[v].length - 1;
|
|
1308
1304
|
for (let i = s; i >= 0; i--) {
|
|
1309
|
-
const n = this[
|
|
1310
|
-
if (e.root == n.root) {
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
continue;
|
|
1314
|
-
}
|
|
1315
|
-
e.active && (n.active = !1);
|
|
1305
|
+
const n = this[v][i];
|
|
1306
|
+
if (e.root == n.root && e.path === n.path) {
|
|
1307
|
+
this[v].splice(i, 1, e), r = !0;
|
|
1308
|
+
continue;
|
|
1316
1309
|
}
|
|
1317
1310
|
}
|
|
1318
|
-
r || this[
|
|
1319
|
-
} else this[
|
|
1320
|
-
this[tt].set(e, t)
|
|
1311
|
+
r || this[v].push(e);
|
|
1312
|
+
} else this[v].push(e);
|
|
1313
|
+
this[tt].set(e, t);
|
|
1321
1314
|
}
|
|
1322
|
-
[
|
|
1315
|
+
[Ke]() {
|
|
1323
1316
|
let e = [];
|
|
1324
|
-
for (let t of this[
|
|
1317
|
+
for (let t of this[v]) {
|
|
1325
1318
|
let r = x.clone(t, !0);
|
|
1326
1319
|
e.push(r);
|
|
1327
1320
|
}
|
|
1328
1321
|
return e;
|
|
1329
1322
|
}
|
|
1330
|
-
[
|
|
1331
|
-
if (!this[
|
|
1332
|
-
this[de](null);
|
|
1333
|
-
return;
|
|
1334
|
-
}
|
|
1323
|
+
[$e](e) {
|
|
1324
|
+
if (!this[v]) return;
|
|
1335
1325
|
let t = -1;
|
|
1336
|
-
for (let
|
|
1337
|
-
t =
|
|
1326
|
+
for (let r = 0; r < this[v].length; r++) if (x.isSame(this[v][r], e)) {
|
|
1327
|
+
t = r;
|
|
1338
1328
|
break;
|
|
1339
1329
|
}
|
|
1340
1330
|
if (t != -1) {
|
|
1341
|
-
const
|
|
1342
|
-
this[
|
|
1343
|
-
const
|
|
1344
|
-
this[tt].delete(
|
|
1345
|
-
}
|
|
1346
|
-
let r = -1;
|
|
1347
|
-
for (let s = this[g].length - 1; s >= 0; s--) if (this[g][s].active === !0) {
|
|
1348
|
-
r = s;
|
|
1349
|
-
break;
|
|
1331
|
+
const r = this[v][t];
|
|
1332
|
+
this[v].splice(t, 1);
|
|
1333
|
+
const s = this[tt].get(r);
|
|
1334
|
+
this[tt].delete(r), this[Rr](r, s);
|
|
1350
1335
|
}
|
|
1351
|
-
r !== -1 ? this[de](this[g][r]) : this[de](null);
|
|
1352
1336
|
}
|
|
1353
1337
|
set historyMonitor(e) {
|
|
1354
1338
|
this[S] && (this[S].historyMonitor = e);
|
|
@@ -1362,6 +1346,12 @@ var Js = class {
|
|
|
1362
1346
|
get traceless() {
|
|
1363
1347
|
return this[S]?.traceless ?? !1;
|
|
1364
1348
|
}
|
|
1349
|
+
set submitCooldownTime(e) {
|
|
1350
|
+
this[te] && (this[te].submitCooldownTime = e);
|
|
1351
|
+
}
|
|
1352
|
+
get submitCooldownTime() {
|
|
1353
|
+
return this[te]?.submitCooldownTime ?? 0;
|
|
1354
|
+
}
|
|
1365
1355
|
set propsFilter(e) {
|
|
1366
1356
|
this[Et] = e;
|
|
1367
1357
|
}
|
|
@@ -1369,7 +1359,7 @@ var Js = class {
|
|
|
1369
1359
|
return this[Et];
|
|
1370
1360
|
}
|
|
1371
1361
|
setRestorePoint() {
|
|
1372
|
-
const e = this[
|
|
1362
|
+
const e = this[Ke]();
|
|
1373
1363
|
this[S]?.setRestorePoint(e);
|
|
1374
1364
|
}
|
|
1375
1365
|
onRouteUpdated(e) {
|
|
@@ -1379,25 +1369,25 @@ var Js = class {
|
|
|
1379
1369
|
this[rt] = e;
|
|
1380
1370
|
}
|
|
1381
1371
|
beforeEach(e) {
|
|
1382
|
-
this[
|
|
1372
|
+
this[je].push(e);
|
|
1383
1373
|
}
|
|
1384
1374
|
removeBeforeEach(e) {
|
|
1385
|
-
const t = this[
|
|
1386
|
-
return t !== -1 ? (this[
|
|
1375
|
+
const t = this[je].indexOf(e);
|
|
1376
|
+
return t !== -1 ? (this[je].splice(t, 1), !0) : !1;
|
|
1387
1377
|
}
|
|
1388
1378
|
afterEach(e) {
|
|
1389
|
-
this[
|
|
1379
|
+
this[ke].push(e);
|
|
1390
1380
|
}
|
|
1391
1381
|
removeAfterEach(e) {
|
|
1392
|
-
const t = this[
|
|
1393
|
-
return t !== -1 ? (this[
|
|
1382
|
+
const t = this[ke].indexOf(e);
|
|
1383
|
+
return t !== -1 ? (this[ke].splice(t, 1), !0) : !1;
|
|
1394
1384
|
}
|
|
1395
1385
|
destroyEach(e) {
|
|
1396
|
-
this[
|
|
1386
|
+
this[Te].push(e);
|
|
1397
1387
|
}
|
|
1398
1388
|
removeDestroyEach(e) {
|
|
1399
|
-
const t = this[
|
|
1400
|
-
return t !== -1 ? (this[
|
|
1389
|
+
const t = this[Te].indexOf(e);
|
|
1390
|
+
return t !== -1 ? (this[Te].splice(t, 1), !0) : !1;
|
|
1401
1391
|
}
|
|
1402
1392
|
beforeRestoreEach(e) {
|
|
1403
1393
|
this[S]?.beforeRestoreEach(e);
|
|
@@ -1409,7 +1399,7 @@ var Js = class {
|
|
|
1409
1399
|
for (let t of e) this.addRoute(t);
|
|
1410
1400
|
}
|
|
1411
1401
|
addRoute(e, t = -1) {
|
|
1412
|
-
if (e.path === this[
|
|
1402
|
+
if (e.path === this[Ft]) {
|
|
1413
1403
|
this.setNotFoundRoute(e);
|
|
1414
1404
|
return;
|
|
1415
1405
|
}
|
|
@@ -1437,7 +1427,7 @@ var Js = class {
|
|
|
1437
1427
|
}) !== -1;
|
|
1438
1428
|
}
|
|
1439
1429
|
setNotFoundPath(e) {
|
|
1440
|
-
this[
|
|
1430
|
+
this[Ft] = e;
|
|
1441
1431
|
}
|
|
1442
1432
|
setNotFoundRoute(e) {
|
|
1443
1433
|
const t = this[Ze](e);
|
|
@@ -1533,47 +1523,47 @@ var Js = class {
|
|
|
1533
1523
|
let r = t.path.indexOf("?");
|
|
1534
1524
|
r !== -1 && r < t.path.length - 1 && (t.query = t.path.substring(r + 1), t.path = t.path.substring(0, r));
|
|
1535
1525
|
}
|
|
1536
|
-
t.root = t.root ?? "default", t.opsType = t.opsType ?? this.options.defaultOperationType ??
|
|
1526
|
+
t.root = t.root ?? "default", t.opsType = t.opsType ?? this.options.defaultOperationType ?? _.Push, t.traceless && !t.historyUpdatePolicy && (t.historyUpdatePolicy = "traceless");
|
|
1537
1527
|
}
|
|
1538
1528
|
return t;
|
|
1539
1529
|
}
|
|
1540
1530
|
push(...e) {
|
|
1541
1531
|
const t = this[M](e);
|
|
1542
|
-
return t ? (t.opsType =
|
|
1532
|
+
return t ? (t.opsType = _.Push, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "push", this.to(t)) : (this[A]("resolve route fail", t), this);
|
|
1543
1533
|
}
|
|
1544
1534
|
put(...e) {
|
|
1545
1535
|
const t = this[M](e);
|
|
1546
|
-
return t ? (t.opsType =
|
|
1536
|
+
return t ? (t.opsType = _.Put, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "traceless", this.to(t)) : (this[A]("resolve route fail", t), this);
|
|
1547
1537
|
}
|
|
1548
1538
|
replace(...e) {
|
|
1549
1539
|
const t = this[M](e);
|
|
1550
|
-
return t ? (t.opsType =
|
|
1540
|
+
return t ? (t.opsType = _.Replace, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "replace", this.to(t)) : (this[A]("resolve route fail", t), this);
|
|
1551
1541
|
}
|
|
1552
1542
|
append(...e) {
|
|
1553
1543
|
const t = this[M](e);
|
|
1554
|
-
return t ? (t.opsType =
|
|
1544
|
+
return t ? (t.opsType = _.Append, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "push", this.to(t)) : (this[A]("resolve route fail", t), this);
|
|
1555
1545
|
}
|
|
1556
1546
|
remove(e, t) {
|
|
1557
1547
|
return new Promise((r) => {
|
|
1558
1548
|
this[ve].post((s) => {
|
|
1559
1549
|
try {
|
|
1560
|
-
if (this[
|
|
1550
|
+
if (this[v].length === 0) {
|
|
1561
1551
|
s.resolve(), r(!1);
|
|
1562
1552
|
return;
|
|
1563
1553
|
}
|
|
1564
|
-
let i = -1, n = null, o = [], l = this[
|
|
1554
|
+
let i = -1, n = null, o = [], l = this[v].length - 1, a = l !== -1 ? this[v][l] : null;
|
|
1565
1555
|
if (e) {
|
|
1566
1556
|
if (n = e.root ?? "default", e.all) for (let f = l; f > 0; f--) {
|
|
1567
|
-
const c = this[
|
|
1568
|
-
if (c.opsType ===
|
|
1557
|
+
const c = this[v][f];
|
|
1558
|
+
if (c.opsType === _.Append) {
|
|
1569
1559
|
const h = c.root ?? "default";
|
|
1570
1560
|
if (n && n !== h) continue;
|
|
1571
1561
|
o.splice(0, 0, c), i = f - 1;
|
|
1572
1562
|
}
|
|
1573
1563
|
}
|
|
1574
1564
|
else if (e.until) for (let f = l; f > 0; f--) {
|
|
1575
|
-
let c = this[
|
|
1576
|
-
if (c.opsType ===
|
|
1565
|
+
let c = this[v][f];
|
|
1566
|
+
if (c.opsType === _.Append && c.root === n) {
|
|
1577
1567
|
if (e.until.charAt(0) === "/" && e.until === c.path) {
|
|
1578
1568
|
i = f;
|
|
1579
1569
|
break;
|
|
@@ -1585,8 +1575,8 @@ var Js = class {
|
|
|
1585
1575
|
}
|
|
1586
1576
|
}
|
|
1587
1577
|
else if (e.to) for (let f = l; f > 0; f--) {
|
|
1588
|
-
const c = this[
|
|
1589
|
-
if (c.opsType ===
|
|
1578
|
+
const c = this[v][f];
|
|
1579
|
+
if (c.opsType === _.Append) {
|
|
1590
1580
|
const h = c.root ?? "default";
|
|
1591
1581
|
if (n && n !== h) continue;
|
|
1592
1582
|
if (o.splice(0, 0, c), e.to.charAt(0) === "/" && e.to === c.path) {
|
|
@@ -1599,8 +1589,8 @@ var Js = class {
|
|
|
1599
1589
|
}
|
|
1600
1590
|
}
|
|
1601
1591
|
} else for (let f = l; f > 0; f--) {
|
|
1602
|
-
let c = this[
|
|
1603
|
-
if (c.opsType ===
|
|
1592
|
+
let c = this[v][f];
|
|
1593
|
+
if (c.opsType === _.Append) {
|
|
1604
1594
|
o.push(c), i = f - 1;
|
|
1605
1595
|
break;
|
|
1606
1596
|
}
|
|
@@ -1610,20 +1600,32 @@ var Js = class {
|
|
|
1610
1600
|
console.warn(f), s.resolve(f), r(!1);
|
|
1611
1601
|
return;
|
|
1612
1602
|
}
|
|
1613
|
-
const u = i !== -1 ? this[
|
|
1614
|
-
if (this[
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1603
|
+
const u = i !== -1 ? this[v][i] : null;
|
|
1604
|
+
if (this[Me](o)) {
|
|
1605
|
+
let f = null, c = null;
|
|
1606
|
+
const h = this[v].length;
|
|
1607
|
+
if (u && x.isSame(u, this[v][h - 1]) && (f = u, c = u), !c && h > 0) {
|
|
1608
|
+
for (let y = h - 1; y >= 0; y--) {
|
|
1609
|
+
const m = this[v][y];
|
|
1610
|
+
if (m?.active === !0) {
|
|
1611
|
+
c = m;
|
|
1612
|
+
break;
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
c = c ?? this[v][h - 1] ?? null;
|
|
1625
1616
|
}
|
|
1626
|
-
|
|
1617
|
+
const d = () => (s.resolve(), r(!0), !0);
|
|
1618
|
+
if (t === !1)
|
|
1619
|
+
return this[ae](c), d(), !0;
|
|
1620
|
+
if (f)
|
|
1621
|
+
if (this[ae](c), a?.historyUpdatePolicy === "traceless") {
|
|
1622
|
+
let y = x.clone(f, !0);
|
|
1623
|
+
const m = new Rt(y, this[Ke]());
|
|
1624
|
+
this[S]?.replace(m), d();
|
|
1625
|
+
} else this[S]?.goBack(f, d);
|
|
1626
|
+
else
|
|
1627
|
+
this[ae](c), d();
|
|
1628
|
+
return !0;
|
|
1627
1629
|
}
|
|
1628
1630
|
} catch (i) {
|
|
1629
1631
|
this[A](i), s.resolve(), r(!1);
|
|
@@ -1633,7 +1635,7 @@ var Js = class {
|
|
|
1633
1635
|
}
|
|
1634
1636
|
open(...e) {
|
|
1635
1637
|
const t = this[M](e);
|
|
1636
|
-
return t ? (t.opsType =
|
|
1638
|
+
return t ? (t.opsType = _.Open, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "push", this.to(t)) : (this[A]("resolve route fail", t), this);
|
|
1637
1639
|
}
|
|
1638
1640
|
close(e) {
|
|
1639
1641
|
return this[ve].post((t) => {
|
|
@@ -1644,8 +1646,8 @@ var Js = class {
|
|
|
1644
1646
|
return;
|
|
1645
1647
|
}
|
|
1646
1648
|
let s = [];
|
|
1647
|
-
for (let i = 0; i < this[
|
|
1648
|
-
let n = this[
|
|
1649
|
+
for (let i = 0; i < this[v].length; i++) {
|
|
1650
|
+
let n = this[v][i];
|
|
1649
1651
|
if (n.root === r.root) {
|
|
1650
1652
|
if (!r.path && !r.name) {
|
|
1651
1653
|
s.push(n);
|
|
@@ -1664,7 +1666,19 @@ var Js = class {
|
|
|
1664
1666
|
t.resolve();
|
|
1665
1667
|
return;
|
|
1666
1668
|
}
|
|
1667
|
-
this[
|
|
1669
|
+
if (this[Me](s)) {
|
|
1670
|
+
const i = this[v].length;
|
|
1671
|
+
let n = null;
|
|
1672
|
+
for (let o = i - 1; o >= 0; o--) {
|
|
1673
|
+
const l = this[v][o];
|
|
1674
|
+
if (l?.active === !0) {
|
|
1675
|
+
n = l;
|
|
1676
|
+
break;
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
n = n ?? this[v][i - 1] ?? null, this[ae](n);
|
|
1680
|
+
}
|
|
1681
|
+
t.resolve();
|
|
1668
1682
|
} catch (r) {
|
|
1669
1683
|
this[A](r), t.resolve();
|
|
1670
1684
|
}
|
|
@@ -1674,32 +1688,32 @@ var Js = class {
|
|
|
1674
1688
|
const t = this[M](e);
|
|
1675
1689
|
if (!t)
|
|
1676
1690
|
return this[A]("resolve route fail", t), this;
|
|
1677
|
-
const r = this[
|
|
1678
|
-
return r
|
|
1691
|
+
const r = this[te].acquire(t);
|
|
1692
|
+
return r ? (this[ve].post((s) => {
|
|
1679
1693
|
try {
|
|
1680
1694
|
let i = this[At](t);
|
|
1681
1695
|
this[qt](i), this[Kt](i), this[$t](i), i.wait((n, o) => {
|
|
1682
1696
|
const l = n.session.to;
|
|
1683
1697
|
if (n.session.updateResult && n.session.updateResult.status === "success") try {
|
|
1684
1698
|
let a = x.clone(l, !0);
|
|
1685
|
-
const u = new Rt(a, this[
|
|
1699
|
+
const u = new Rt(a, this[Ke]());
|
|
1686
1700
|
l.historyUpdatePolicy === "replace" ? this[S]?.replace(u) : l.historyUpdatePolicy === "traceless" ? this[S]?.setRouteMark(u) : this[S]?.push(u);
|
|
1687
1701
|
} catch (a) {
|
|
1688
1702
|
console.error(a.message, a);
|
|
1689
1703
|
}
|
|
1690
|
-
if (ze.clear(n.session), this[
|
|
1704
|
+
if (ze.clear(n.session), this[te].release(r), typeof t.success == "function") try {
|
|
1691
1705
|
Reflect.apply(t.success, {}, []);
|
|
1692
1706
|
} catch (a) {
|
|
1693
1707
|
console.error(a.message, a);
|
|
1694
1708
|
}
|
|
1695
|
-
this[
|
|
1709
|
+
this[ue] === !1 && this[ot](!0), i = null, s.resolve();
|
|
1696
1710
|
}, (n, o) => {
|
|
1697
|
-
this[
|
|
1711
|
+
this[te].release(r), o !== null && this[A](o, t), this[ue] === !1 && this[ot](!1), ze.clear(n.session), i = null, s.resolve();
|
|
1698
1712
|
});
|
|
1699
1713
|
} catch (i) {
|
|
1700
|
-
this[
|
|
1714
|
+
this[te].release(r), this[A](i, t), s.resolve();
|
|
1701
1715
|
}
|
|
1702
|
-
}), this);
|
|
1716
|
+
}), this) : (this[A]("route forbid", t), this);
|
|
1703
1717
|
}
|
|
1704
1718
|
back(e = 1) {
|
|
1705
1719
|
this[S]?.go(-e, !1);
|
|
@@ -1720,7 +1734,7 @@ var Js = class {
|
|
|
1720
1734
|
};
|
|
1721
1735
|
}
|
|
1722
1736
|
[At](e) {
|
|
1723
|
-
const t = this[
|
|
1737
|
+
const t = this[v].length > 0 ? this[v][this[v].length - 1] : void 0, r = new ze(e, t), s = {
|
|
1724
1738
|
route: e,
|
|
1725
1739
|
find: null
|
|
1726
1740
|
};
|
|
@@ -1736,7 +1750,7 @@ var Js = class {
|
|
|
1736
1750
|
return new ft(r);
|
|
1737
1751
|
}
|
|
1738
1752
|
[qt](e) {
|
|
1739
|
-
for (let t of this[
|
|
1753
|
+
for (let t of this[je]) e.post((r) => {
|
|
1740
1754
|
const s = this[br](r);
|
|
1741
1755
|
Reflect.apply(t, {}, [
|
|
1742
1756
|
r.session.to,
|
|
@@ -1748,7 +1762,7 @@ var Js = class {
|
|
|
1748
1762
|
}
|
|
1749
1763
|
[$t](e) {
|
|
1750
1764
|
e.post((t) => {
|
|
1751
|
-
for (let r of this[
|
|
1765
|
+
for (let r of this[ke]) try {
|
|
1752
1766
|
Reflect.apply(r, {}, [
|
|
1753
1767
|
t.session.to,
|
|
1754
1768
|
t.session.from,
|
|
@@ -1761,7 +1775,7 @@ var Js = class {
|
|
|
1761
1775
|
});
|
|
1762
1776
|
}
|
|
1763
1777
|
[Rr](e, t) {
|
|
1764
|
-
for (let r of this[
|
|
1778
|
+
for (let r of this[Te]) try {
|
|
1765
1779
|
Reflect.apply(r, {}, [e, t]);
|
|
1766
1780
|
} catch (s) {
|
|
1767
1781
|
console.error(s.message, s);
|
|
@@ -1786,7 +1800,7 @@ var Js = class {
|
|
|
1786
1800
|
}
|
|
1787
1801
|
}
|
|
1788
1802
|
const i = ze.from(t.session);
|
|
1789
|
-
this[
|
|
1803
|
+
this[vr](r, s, i).then((n) => {
|
|
1790
1804
|
this[U], t.session.updateResult = n ?? {
|
|
1791
1805
|
status: "success",
|
|
1792
1806
|
message: ""
|
|
@@ -1796,8 +1810,8 @@ var Js = class {
|
|
|
1796
1810
|
});
|
|
1797
1811
|
});
|
|
1798
1812
|
}
|
|
1799
|
-
[
|
|
1800
|
-
if (e.length
|
|
1813
|
+
[Me](e) {
|
|
1814
|
+
if (e.length === 0) return !0;
|
|
1801
1815
|
let t = this[U], r = [];
|
|
1802
1816
|
for (let s of e) {
|
|
1803
1817
|
let i = this[Pt](t, s);
|
|
@@ -1806,9 +1820,9 @@ var Js = class {
|
|
|
1806
1820
|
route: s
|
|
1807
1821
|
});
|
|
1808
1822
|
}
|
|
1809
|
-
if (r.length
|
|
1823
|
+
if (r.length === 0)
|
|
1810
1824
|
return this[A]("can not find view index"), !1;
|
|
1811
|
-
for (let s of r.reverse()) this[
|
|
1825
|
+
for (let s of r.reverse()) this[le](t, {
|
|
1812
1826
|
x: s.x,
|
|
1813
1827
|
y: s.y
|
|
1814
1828
|
}, [s.route.index ?? 0], !0);
|
|
@@ -1830,17 +1844,14 @@ var Js = class {
|
|
|
1830
1844
|
}
|
|
1831
1845
|
return null;
|
|
1832
1846
|
}
|
|
1833
|
-
[
|
|
1834
|
-
return e.layers.length > 0 && e.layers[0].views.length > 0 ? e.layers[0].views[0] : null;
|
|
1835
|
-
}
|
|
1836
|
-
[oe](e, t, r = null, s = !0) {
|
|
1847
|
+
[le](e, t, r = null, s = !0) {
|
|
1837
1848
|
if (t.y >= e.layers.length || t.x >= e.layers[t.y].views.length) return;
|
|
1838
1849
|
let i = e.layers[t.y].views[t.x], n = !1, o = [], l = !1, a = [...i.slots.value];
|
|
1839
1850
|
for (let f = a.length - 1; f >= 0; f--) {
|
|
1840
1851
|
let c = a[f];
|
|
1841
|
-
(!r || r.indexOf(c.index) != -1) && (c.route && i[V] && (this[
|
|
1852
|
+
(!r || r.indexOf(c.index) != -1) && (c.route && i[V] && (this[$e](c.route), c.active === !0 && c.route.opsType == _.Append && (l = !0)), o.push(new I(i, c.index, t.y)), a.splice(f, 1));
|
|
1842
1853
|
}
|
|
1843
|
-
if (a.length
|
|
1854
|
+
if (a.length === 0)
|
|
1844
1855
|
s ? i.slots.value = a : e.layers[t.y].views.splice(t.x, 1);
|
|
1845
1856
|
else {
|
|
1846
1857
|
if (l) {
|
|
@@ -1849,32 +1860,32 @@ var Js = class {
|
|
|
1849
1860
|
}
|
|
1850
1861
|
i.slots.value = a;
|
|
1851
1862
|
}
|
|
1852
|
-
e.layers[t.y].views.length
|
|
1863
|
+
e.layers[t.y].views.length === 0 && (n = !0);
|
|
1853
1864
|
let u = t.y + 1;
|
|
1854
1865
|
for (; u < e.layers.length; u++) {
|
|
1855
1866
|
let f = e.layers[u].views, c = [];
|
|
1856
1867
|
for (let h = f.length - 1; (n || o.length > 0) && h >= 0; h--) {
|
|
1857
|
-
let
|
|
1858
|
-
if (
|
|
1859
|
-
let
|
|
1860
|
-
for (let
|
|
1861
|
-
let w =
|
|
1862
|
-
w.route &&
|
|
1868
|
+
let d = f[h];
|
|
1869
|
+
if (d[ce] && (n || I.include(o, d[ce]))) {
|
|
1870
|
+
let y = d.slots.value;
|
|
1871
|
+
for (let m = y.length - 1; m >= 0; m--) {
|
|
1872
|
+
let w = y[m];
|
|
1873
|
+
w.route && d[V] && this[$e](w.route), c.push(new I(d, w.index, u)), y.splice(m, 1);
|
|
1863
1874
|
}
|
|
1864
1875
|
e.layers[u].views.splice(h, 1);
|
|
1865
1876
|
}
|
|
1866
1877
|
}
|
|
1867
|
-
o = c, e.layers[u].views.length
|
|
1878
|
+
o = c, e.layers[u].views.length === 0 && (n = !0);
|
|
1868
1879
|
}
|
|
1869
1880
|
}
|
|
1870
1881
|
restore(e) {
|
|
1871
|
-
if (!e || this[H].length
|
|
1882
|
+
if (!e || this[H].length === 0) {
|
|
1872
1883
|
let t = this[U];
|
|
1873
1884
|
if (t.layers.length > 0) {
|
|
1874
1885
|
let r = t.layers[0].views;
|
|
1875
1886
|
r.length > 0 && (r[0].slots.value = []);
|
|
1876
1887
|
}
|
|
1877
|
-
return this[
|
|
1888
|
+
return this[v] = [], this[ae](null), Promise.resolve();
|
|
1878
1889
|
} else return new Promise((t, r) => {
|
|
1879
1890
|
let s = null, i = !1;
|
|
1880
1891
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -1890,14 +1901,14 @@ var Js = class {
|
|
|
1890
1901
|
}
|
|
1891
1902
|
this[ve].post((n) => {
|
|
1892
1903
|
if (s && i === !0) {
|
|
1893
|
-
const o = x.clone(s, !0), l = new Rt(o, this[
|
|
1904
|
+
const o = x.clone(s, !0), l = new Rt(o, this[Ke]());
|
|
1894
1905
|
this[S]?.replace(l);
|
|
1895
1906
|
}
|
|
1896
1907
|
n.resolve(), t();
|
|
1897
1908
|
});
|
|
1898
1909
|
});
|
|
1899
1910
|
}
|
|
1900
|
-
async [
|
|
1911
|
+
async [vr](e, t, r) {
|
|
1901
1912
|
const s = e.updateType ?? gt.Part;
|
|
1902
1913
|
await this[pr](t);
|
|
1903
1914
|
const i = this[gr](t, e, r, s);
|
|
@@ -1921,14 +1932,14 @@ var Js = class {
|
|
|
1921
1932
|
message: "illegal route structure(multi root node)"
|
|
1922
1933
|
};
|
|
1923
1934
|
const i = e.layers[0].models[0];
|
|
1924
|
-
let n = this[U], o =
|
|
1935
|
+
let n = this[U], o = Ws(n), l = t.root ?? "default", a;
|
|
1925
1936
|
!o && s == gt.Part && (a = this[Pt](n, t));
|
|
1926
1937
|
let u, f = 0;
|
|
1927
|
-
if (a == null
|
|
1938
|
+
if (a == null)
|
|
1928
1939
|
if (o || s === gt.All) {
|
|
1929
|
-
if (n.layers.length
|
|
1940
|
+
if (n.layers.length === 0 && (n.layers[0] = new wt()), n.layers[0].views.length === 0) {
|
|
1930
1941
|
let c = t.root ?? "default";
|
|
1931
|
-
u = new
|
|
1942
|
+
u = new Ee(c, !0, null), n.layers[0].views = [u];
|
|
1932
1943
|
} else u = n.layers[0].views[0];
|
|
1933
1944
|
a = {
|
|
1934
1945
|
x: 0,
|
|
@@ -1945,31 +1956,31 @@ var Js = class {
|
|
|
1945
1956
|
status: "error",
|
|
1946
1957
|
message: "can not insert view(override level)"
|
|
1947
1958
|
};
|
|
1948
|
-
let
|
|
1959
|
+
let d;
|
|
1949
1960
|
if (c.rootName) {
|
|
1950
|
-
let
|
|
1951
|
-
for (let
|
|
1952
|
-
if (
|
|
1953
|
-
|
|
1961
|
+
let y = n.layers[h - 1];
|
|
1962
|
+
for (let m of y.views) {
|
|
1963
|
+
if (m[V] && m.name === c.rootName) {
|
|
1964
|
+
d = new I(m, c.rootIndex ?? 0, h - 1);
|
|
1954
1965
|
break;
|
|
1955
1966
|
}
|
|
1956
|
-
if (
|
|
1957
|
-
|
|
1967
|
+
if (m[B] && m[B].view.name === c.rootName && m[B].index === c.rootIndex) {
|
|
1968
|
+
d = m[B];
|
|
1958
1969
|
break;
|
|
1959
1970
|
}
|
|
1960
1971
|
}
|
|
1961
1972
|
}
|
|
1962
|
-
if (!
|
|
1973
|
+
if (!d) return {
|
|
1963
1974
|
status: "error",
|
|
1964
1975
|
message: "can not insert view(not find root node ref)"
|
|
1965
1976
|
};
|
|
1966
|
-
u = new
|
|
1977
|
+
u = new Ee(l, !0, d), n.layers[h].views.push(u), a = {
|
|
1967
1978
|
x: n.layers[h].views.length - 1,
|
|
1968
1979
|
y: h
|
|
1969
1980
|
};
|
|
1970
1981
|
}
|
|
1971
1982
|
else u = n.layers[a.y].views[a.x];
|
|
1972
|
-
if (f = a.y, u[V] = !0, t.opsType ===
|
|
1983
|
+
if (f = a.y, u[V] = !0, t.opsType === _.Append) {
|
|
1973
1984
|
t.index = t.index ?? Ie.get(), t.active = !0;
|
|
1974
1985
|
let c = u.slots.value;
|
|
1975
1986
|
if (c.length > 0) {
|
|
@@ -1978,93 +1989,93 @@ var Js = class {
|
|
|
1978
1989
|
}
|
|
1979
1990
|
let h = new Y(t, i, t.index, !0);
|
|
1980
1991
|
u.slots.value = [...c, h];
|
|
1981
|
-
let
|
|
1982
|
-
this[ee](n,
|
|
1983
|
-
} else if (t.opsType ===
|
|
1992
|
+
let d = f + 1, y = 1, m = new I(u, t.index, f);
|
|
1993
|
+
this[ee](n, d, e, y, m);
|
|
1994
|
+
} else if (t.opsType === _.Open) {
|
|
1984
1995
|
let c = u.slots.value;
|
|
1985
1996
|
const h = t.active ?? !0;
|
|
1986
|
-
let
|
|
1987
|
-
for (let
|
|
1988
|
-
if (
|
|
1989
|
-
if (
|
|
1990
|
-
return t.index =
|
|
1997
|
+
let d = !1;
|
|
1998
|
+
for (let y of c) {
|
|
1999
|
+
if (y.route !== null && x.isSamePathForRoute(y.route, t)) {
|
|
2000
|
+
if (y.active === h)
|
|
2001
|
+
return t.index = y.index, t.active = h, y.route = t, {
|
|
1991
2002
|
status: "noChange",
|
|
1992
2003
|
message: ""
|
|
1993
2004
|
};
|
|
1994
|
-
|
|
1995
|
-
} else h && (
|
|
1996
|
-
|
|
2005
|
+
y.active = h, d = !0, t.index = y.index, t.active = h, y.route = t;
|
|
2006
|
+
} else h && (y.active = !1);
|
|
2007
|
+
y.route && (y.route.active = y.active);
|
|
1997
2008
|
}
|
|
1998
|
-
if (!
|
|
2009
|
+
if (!d) {
|
|
1999
2010
|
t.index = t.index ?? Ie.get(), t.active = h;
|
|
2000
|
-
let
|
|
2001
|
-
c.push(
|
|
2002
|
-
let
|
|
2003
|
-
this[ee](n,
|
|
2011
|
+
let y = new Y(t, i, t.index, h);
|
|
2012
|
+
c.push(y);
|
|
2013
|
+
let m = f + 1, w = 1, p = new I(u, t.index, f);
|
|
2014
|
+
this[ee](n, m, e, w, p);
|
|
2004
2015
|
}
|
|
2005
2016
|
u.slots.value = [...c];
|
|
2006
2017
|
} else {
|
|
2007
2018
|
let c = u.slots.value;
|
|
2008
|
-
if (c.length
|
|
2019
|
+
if (c.length === 0) {
|
|
2009
2020
|
t.index = t.index ?? Ie.get(), t.active = !0, u.slots.value = [new Y(t, i, t.index)];
|
|
2010
|
-
let h = f + 1,
|
|
2011
|
-
this[ee](n, h, e,
|
|
2021
|
+
let h = f + 1, d = 1, y = new I(u, t.index, f);
|
|
2022
|
+
this[ee](n, h, e, d, y);
|
|
2012
2023
|
} else {
|
|
2013
2024
|
let h = c[0];
|
|
2014
2025
|
if (h.model !== i) {
|
|
2015
|
-
this[
|
|
2016
|
-
let
|
|
2017
|
-
this[ee](n,
|
|
2026
|
+
this[le](n, a, null, !0), t.index = t.index ?? Ie.get(), t.active = !0, u.slots.value = [new Y(t, i, t.index)];
|
|
2027
|
+
let d = f + 1, y = 1, m = new I(u, t.index, f);
|
|
2028
|
+
this[ee](n, d, e, y, m);
|
|
2018
2029
|
} else {
|
|
2019
|
-
h.route !== null && this[
|
|
2020
|
-
let
|
|
2021
|
-
const
|
|
2022
|
-
h.active !==
|
|
2023
|
-
let
|
|
2024
|
-
for (let K = 1; K < c.length; K++)
|
|
2025
|
-
|
|
2026
|
-
let w = [new I(u, t.index, f)],
|
|
2027
|
-
for (; w.length > 0 &&
|
|
2030
|
+
h.route !== null && this[$e](h.route);
|
|
2031
|
+
let d = !1;
|
|
2032
|
+
const y = t.active ?? !0;
|
|
2033
|
+
h.active !== y && (h.active = y, d = !0), t.active = y, t.index = h.index, h.route = t;
|
|
2034
|
+
let m = [];
|
|
2035
|
+
for (let K = 1; K < c.length; K++) m.push(c[K].index);
|
|
2036
|
+
m.length > 0 ? this[le](n, a, m, !0) : d && (u.slots.value = [...c]);
|
|
2037
|
+
let w = [new I(u, t.index, f)], p = f + 1, g = 1, $ = new I(u, t.index, f);
|
|
2038
|
+
for (; w.length > 0 && p < n.layers.length && g < e.layers.length; p++, g++) {
|
|
2028
2039
|
let K = [];
|
|
2029
|
-
for (let j = 0; j < n.layers[
|
|
2030
|
-
let E = n.layers[
|
|
2031
|
-
E[
|
|
2040
|
+
for (let j = 0; j < n.layers[p].views.length; j++) {
|
|
2041
|
+
let E = n.layers[p].views[j];
|
|
2042
|
+
E[ce] && I.include(w, E[ce]) && K.unshift(j);
|
|
2032
2043
|
}
|
|
2033
2044
|
let _e = [];
|
|
2034
2045
|
for (let j of K) {
|
|
2035
|
-
let E = n.layers[
|
|
2036
|
-
for (let k = 0; k <
|
|
2037
|
-
Q =
|
|
2046
|
+
let E = n.layers[p].views[j], ie = e.layers[g].models, Q;
|
|
2047
|
+
for (let k = 0; k < ie.length; k++) if (E.name === ie[k].name) {
|
|
2048
|
+
Q = ie[k];
|
|
2038
2049
|
break;
|
|
2039
2050
|
}
|
|
2040
|
-
if (!Q) this[
|
|
2051
|
+
if (!Q) this[le](n, {
|
|
2041
2052
|
x: j,
|
|
2042
|
-
y:
|
|
2053
|
+
y: p
|
|
2043
2054
|
}, null, !1);
|
|
2044
2055
|
else {
|
|
2045
2056
|
let k = E.slots.value;
|
|
2046
|
-
if (k.length
|
|
2057
|
+
if (k.length === 0) {
|
|
2047
2058
|
let z = 0;
|
|
2048
2059
|
E.slots.value = [new Y(null, Q, z)];
|
|
2049
|
-
let D =
|
|
2060
|
+
let D = p + 1, N = g + 1;
|
|
2050
2061
|
this[ee](n, D, e, N, $);
|
|
2051
2062
|
} else {
|
|
2052
2063
|
let z = k[0];
|
|
2053
2064
|
if (z.model !== Q) {
|
|
2054
|
-
this[
|
|
2065
|
+
this[le](n, {
|
|
2055
2066
|
x: j,
|
|
2056
|
-
y:
|
|
2067
|
+
y: p
|
|
2057
2068
|
}, null, !0), E.slots.value = [new Y(null, Q, 0)];
|
|
2058
|
-
let D =
|
|
2069
|
+
let D = p + 1, N = g + 1;
|
|
2059
2070
|
this[ee](n, D, e, N, $);
|
|
2060
2071
|
} else {
|
|
2061
|
-
E[V] && z.route !== null && this[
|
|
2072
|
+
E[V] && z.route !== null && this[$e](z.route);
|
|
2062
2073
|
let D = [];
|
|
2063
2074
|
for (let N = 1; N < k.length; N++) D.push(k[N].index);
|
|
2064
|
-
D.length > 0 && this[
|
|
2075
|
+
D.length > 0 && this[le](n, {
|
|
2065
2076
|
x: j,
|
|
2066
|
-
y:
|
|
2067
|
-
}, D, !0), _e.push(new I(E, z.index,
|
|
2077
|
+
y: p
|
|
2078
|
+
}, D, !0), _e.push(new I(E, z.index, p));
|
|
2068
2079
|
}
|
|
2069
2080
|
}
|
|
2070
2081
|
E[V] = !1;
|
|
@@ -2072,7 +2083,7 @@ var Js = class {
|
|
|
2072
2083
|
}
|
|
2073
2084
|
w = _e;
|
|
2074
2085
|
}
|
|
2075
|
-
this[ee](n,
|
|
2086
|
+
this[ee](n, p, e, g, $);
|
|
2076
2087
|
}
|
|
2077
2088
|
}
|
|
2078
2089
|
}
|
|
@@ -2080,7 +2091,7 @@ var Js = class {
|
|
|
2080
2091
|
let c = u[B];
|
|
2081
2092
|
c && (t.slot = new Is(l, f, c?.view.name, c?.index ?? 0));
|
|
2082
2093
|
}
|
|
2083
|
-
return r.to = void 0, r.routeModel = void 0, this[wr](t, r), {
|
|
2094
|
+
return r.to = void 0, r.routeModel = void 0, this[wr](t, r), this[ae](t), {
|
|
2084
2095
|
status: "success",
|
|
2085
2096
|
message: ""
|
|
2086
2097
|
};
|
|
@@ -2090,7 +2101,7 @@ var Js = class {
|
|
|
2090
2101
|
for (; o < e.layers.length && n < r.layers.length; o++, n++) {
|
|
2091
2102
|
let l = e.layers[o].views;
|
|
2092
2103
|
for (let a of r.layers[n].models) {
|
|
2093
|
-
let u = new
|
|
2104
|
+
let u = new Ee(a.name, !1, i), f = new Y(null, a);
|
|
2094
2105
|
u.slots.value = [f], l.push(u);
|
|
2095
2106
|
}
|
|
2096
2107
|
}
|
|
@@ -2098,7 +2109,7 @@ var Js = class {
|
|
|
2098
2109
|
let l = new wt();
|
|
2099
2110
|
l.views = [];
|
|
2100
2111
|
for (let a of r.layers[n].models) {
|
|
2101
|
-
let u = new
|
|
2112
|
+
let u = new Ee(a.name, !1, i), f = new Y(null, a);
|
|
2102
2113
|
u.slots.value = [f], l.views.push(u);
|
|
2103
2114
|
}
|
|
2104
2115
|
e.layers.push(l);
|
|
@@ -2111,7 +2122,7 @@ var Js = class {
|
|
|
2111
2122
|
for (let c of u.views) {
|
|
2112
2123
|
let h = !1;
|
|
2113
2124
|
if (r !== null ? (h = c.name === e && c[B]?.view === r, h && s !== -1 && (h = c[B]?.index === s)) : h = c.name === e, !!h) {
|
|
2114
|
-
i !== null && (c[
|
|
2125
|
+
i !== null && (c[ce] = {
|
|
2115
2126
|
view: i,
|
|
2116
2127
|
index: n,
|
|
2117
2128
|
level: t - 1
|
|
@@ -2131,14 +2142,14 @@ var Js = class {
|
|
|
2131
2142
|
index: n,
|
|
2132
2143
|
level: t - 1
|
|
2133
2144
|
});
|
|
2134
|
-
let a = new
|
|
2135
|
-
if (a[
|
|
2145
|
+
let a = new Ee(e, !0, o);
|
|
2146
|
+
if (a[ce] = l, t == this[U].layers.length) {
|
|
2136
2147
|
let u = new wt();
|
|
2137
2148
|
u.views = [a], this[U].layers.push(u);
|
|
2138
2149
|
} else this[U].layers[t].views.push(a);
|
|
2139
2150
|
return a;
|
|
2140
2151
|
}
|
|
2141
|
-
}, Ne = /* @__PURE__ */ Symbol("rk"), jt = /* @__PURE__ */ Symbol("vd"), Sr = /* @__PURE__ */ Symbol("rv"), kt = /* @__PURE__ */ Symbol("rvi"), xr = /* @__PURE__ */ Symbol("pv"), Tt = /* @__PURE__ */ Symbol("pvi"), Le = /* @__PURE__ */ Symbol("registerKey"), Mt = /* @__PURE__ */ Symbol("parentKey"), Ut = /* @__PURE__ */ Symbol("lc"),
|
|
2152
|
+
}, Ne = /* @__PURE__ */ Symbol("rk"), jt = /* @__PURE__ */ Symbol("vd"), Sr = /* @__PURE__ */ Symbol("rv"), kt = /* @__PURE__ */ Symbol("rvi"), xr = /* @__PURE__ */ Symbol("pv"), Tt = /* @__PURE__ */ Symbol("pvi"), Le = /* @__PURE__ */ Symbol("registerKey"), Mt = /* @__PURE__ */ Symbol("parentKey"), Ut = /* @__PURE__ */ Symbol("lc"), Js = class {
|
|
2142
2153
|
[Le] = /* @__PURE__ */ new Map();
|
|
2143
2154
|
[Mt] = null;
|
|
2144
2155
|
get parent() {
|
|
@@ -2161,12 +2172,12 @@ var Js = class {
|
|
|
2161
2172
|
delete(e) {
|
|
2162
2173
|
return this[Le].delete(e);
|
|
2163
2174
|
}
|
|
2164
|
-
},
|
|
2175
|
+
}, se = /* @__PURE__ */ new WeakMap(), He = [];
|
|
2165
2176
|
function lt(e, t = !1) {
|
|
2166
|
-
let r = e ?
|
|
2177
|
+
let r = e ? se.get(e) ?? null : null;
|
|
2167
2178
|
if (t && !r) {
|
|
2168
|
-
r = new
|
|
2169
|
-
e &&
|
|
2179
|
+
r = new Js(), e && se.set(e, r), Ce(() => {
|
|
2180
|
+
e && se.delete(e);
|
|
2170
2181
|
});
|
|
2171
2182
|
const s = L(Ut, null);
|
|
2172
2183
|
s && (r.parent = s), Z(Ut, r);
|
|
@@ -2174,14 +2185,14 @@ function lt(e, t = !1) {
|
|
|
2174
2185
|
return r;
|
|
2175
2186
|
}
|
|
2176
2187
|
function ht(e) {
|
|
2177
|
-
let t = e ?
|
|
2178
|
-
if (!t &&
|
|
2188
|
+
let t = e ? se.get(e) ?? null : null;
|
|
2189
|
+
if (!t && Pe() && (t = L(Ut, null)), !t && He.length > 0) {
|
|
2179
2190
|
const r = He.length - 1;
|
|
2180
2191
|
t = He[r];
|
|
2181
2192
|
}
|
|
2182
2193
|
return t;
|
|
2183
2194
|
}
|
|
2184
|
-
async function
|
|
2195
|
+
async function Gs(e, t) {
|
|
2185
2196
|
He.push(e);
|
|
2186
2197
|
try {
|
|
2187
2198
|
return await t();
|
|
@@ -2189,16 +2200,16 @@ async function Xs(e, t) {
|
|
|
2189
2200
|
He.pop();
|
|
2190
2201
|
}
|
|
2191
2202
|
}
|
|
2192
|
-
function
|
|
2203
|
+
function Bi(e) {
|
|
2193
2204
|
const t = Kr();
|
|
2194
2205
|
if (!t) return !1;
|
|
2195
2206
|
const r = ht();
|
|
2196
2207
|
if (!r) return !1;
|
|
2197
|
-
if (
|
|
2198
|
-
for (let s = 0; s < e.length; s++) e[s] && typeof e[s] == "object" &&
|
|
2199
|
-
return
|
|
2200
|
-
if (
|
|
2201
|
-
for (let s = 0; s < e.length; s++) e[s] && typeof e[s] == "object" &&
|
|
2208
|
+
if (se.set(t, r), Array.isArray(e))
|
|
2209
|
+
for (let s = 0; s < e.length; s++) e[s] && typeof e[s] == "object" && se.set(e[s], r);
|
|
2210
|
+
return Ce(() => {
|
|
2211
|
+
if (se.delete(t), Array.isArray(e))
|
|
2212
|
+
for (let s = 0; s < e.length; s++) e[s] && typeof e[s] == "object" && se.delete(e[s]);
|
|
2202
2213
|
}), !0;
|
|
2203
2214
|
}
|
|
2204
2215
|
function zr(e, t) {
|
|
@@ -2208,20 +2219,20 @@ function zr(e, t) {
|
|
|
2208
2219
|
for (; s && !s.has(t); ) s = s.parent;
|
|
2209
2220
|
return s?.get(t) ?? null;
|
|
2210
2221
|
}
|
|
2211
|
-
function
|
|
2222
|
+
function Vi(e, t, r) {
|
|
2212
2223
|
ht(e)?.set(t, r);
|
|
2213
2224
|
}
|
|
2214
|
-
function
|
|
2225
|
+
function Wi(e, t, r) {
|
|
2215
2226
|
ht(e)?.delete(t);
|
|
2216
2227
|
}
|
|
2217
2228
|
var ct = /* @__PURE__ */ Symbol("hooksKey");
|
|
2218
|
-
function
|
|
2229
|
+
function Xs(e) {
|
|
2219
2230
|
let t = e.get(ct);
|
|
2220
2231
|
t || (t = [], e.set(ct, t));
|
|
2221
2232
|
}
|
|
2222
2233
|
function Pr(e, t) {
|
|
2223
2234
|
const r = e.get(ct);
|
|
2224
|
-
r != null &&
|
|
2235
|
+
r != null && Gs(e, async () => {
|
|
2225
2236
|
for (let s = r.length - 1; s >= 0; s--) {
|
|
2226
2237
|
let i = r[s];
|
|
2227
2238
|
if (i.type === t)
|
|
@@ -2233,20 +2244,20 @@ function Pr(e, t) {
|
|
|
2233
2244
|
}
|
|
2234
2245
|
});
|
|
2235
2246
|
}
|
|
2236
|
-
var
|
|
2247
|
+
var Cr = /* @__PURE__ */ (function(e) {
|
|
2237
2248
|
return e.INACTIVATED = "ia", e.ACTIVATED = "a", e;
|
|
2238
|
-
})({}),
|
|
2249
|
+
})({}), Qs = class {
|
|
2239
2250
|
type;
|
|
2240
2251
|
hook;
|
|
2241
2252
|
constructor(e, t) {
|
|
2242
2253
|
this.hook = t, this.type = e;
|
|
2243
2254
|
}
|
|
2244
2255
|
};
|
|
2245
|
-
function
|
|
2246
|
-
const s = new
|
|
2256
|
+
function Zs(e, t, r) {
|
|
2257
|
+
const s = new Qs(t, r);
|
|
2247
2258
|
return e.push(s), !0;
|
|
2248
2259
|
}
|
|
2249
|
-
function
|
|
2260
|
+
function Ys(e, t, r) {
|
|
2250
2261
|
let s = -1;
|
|
2251
2262
|
for (let i = 0; i < e.length; i++) {
|
|
2252
2263
|
const n = e[i];
|
|
@@ -2260,24 +2271,24 @@ function ei(e, t, r) {
|
|
|
2260
2271
|
function Jr(e) {
|
|
2261
2272
|
return (t) => {
|
|
2262
2273
|
const r = zr(null, ct);
|
|
2263
|
-
r && (
|
|
2264
|
-
|
|
2265
|
-
}),
|
|
2274
|
+
r && (Ce(() => {
|
|
2275
|
+
Ys(r, e, t);
|
|
2276
|
+
}), Zs(r, e, t));
|
|
2266
2277
|
};
|
|
2267
2278
|
}
|
|
2268
|
-
var
|
|
2279
|
+
var zi = function(e) {
|
|
2269
2280
|
fs(e), Jr("a")(e);
|
|
2270
|
-
},
|
|
2281
|
+
}, Ji = function(e) {
|
|
2271
2282
|
cs(e), Jr("ia")(e);
|
|
2272
2283
|
}, Gr = /* @__PURE__ */ Symbol("routeKey");
|
|
2273
|
-
function
|
|
2284
|
+
function _r(e, t) {
|
|
2274
2285
|
e.set(Gr, t);
|
|
2275
2286
|
}
|
|
2276
|
-
function
|
|
2287
|
+
function Fr(e) {
|
|
2277
2288
|
const t = zr(e ?? null, Gr);
|
|
2278
2289
|
return typeof t == "function" ? t() : t;
|
|
2279
2290
|
}
|
|
2280
|
-
var
|
|
2291
|
+
var ei = "FoxBeforeEnter", ti = "FoxEnter", ri = "FoxLeave", si = "FoxLeave", Bt = "FoxLeaveEnd";
|
|
2281
2292
|
function Xr(e, t = !1) {
|
|
2282
2293
|
let r = null;
|
|
2283
2294
|
return t ? r = e.showFromClass ?? e.enterFromClass : r = e.enterFromClass, r || (r = e.transitionName, r ? t ? `${r}-show-from` : `${r}-enter-from` : null);
|
|
@@ -2286,7 +2297,7 @@ function Qr(e, t = !1) {
|
|
|
2286
2297
|
let r = null;
|
|
2287
2298
|
return t ? r = e.showActiveClass ?? e.enterActiveClass : r = e.enterActiveClass, r || (r = e.transitionName, r ? t ? `${r}-show-active` : `${r}-enter-active` : null);
|
|
2288
2299
|
}
|
|
2289
|
-
function
|
|
2300
|
+
function ii(e, t = !1) {
|
|
2290
2301
|
let r = null;
|
|
2291
2302
|
return t ? r = e.showToClass ?? e.enterToClass : r = e.enterToClass, r || (r = e.transitionName, r ? t ? `${r}-show-to` : `${r}-enter-to` : null);
|
|
2292
2303
|
}
|
|
@@ -2298,39 +2309,39 @@ function Yr(e, t = !1) {
|
|
|
2298
2309
|
let r = null;
|
|
2299
2310
|
return t ? r = e.hideActiveClass ?? e.leaveActiveClass : r = e.leaveActiveClass, r || (r = e.transitionName, r ? t ? `${r}-hide-active` : `${r}-leave-active` : null);
|
|
2300
2311
|
}
|
|
2301
|
-
function
|
|
2312
|
+
function ni(e, t = !1) {
|
|
2302
2313
|
let r = null;
|
|
2303
2314
|
return t ? r = e.hideToClass ?? e.leaveToClass : r = e.leaveToClass, r || (r = e.transitionName, r ? t ? `${r}-hide-to` : `${r}-leave-to` : null);
|
|
2304
2315
|
}
|
|
2305
|
-
function
|
|
2316
|
+
function oi(e, t = !1) {
|
|
2306
2317
|
let r = null;
|
|
2307
2318
|
return t ? r = e.beforeShow ?? e.beforeEnter : r = e.beforeEnter, r;
|
|
2308
2319
|
}
|
|
2309
|
-
function
|
|
2320
|
+
function li(e, t = !1) {
|
|
2310
2321
|
let r = null;
|
|
2311
2322
|
return t ? r = e.show ?? e.enter : r = e.enter, r;
|
|
2312
2323
|
}
|
|
2313
|
-
function
|
|
2324
|
+
function ai(e, t = !1) {
|
|
2314
2325
|
let r = null;
|
|
2315
2326
|
return t ? r = e.afterShow ?? e.afterEnter : r = e.afterEnter, r;
|
|
2316
2327
|
}
|
|
2317
|
-
function
|
|
2328
|
+
function ui(e, t = !1) {
|
|
2318
2329
|
let r = null;
|
|
2319
2330
|
return t ? r = e.showCancelled ?? e.enterCancelled : r = e.enterCancelled, r;
|
|
2320
2331
|
}
|
|
2321
|
-
function
|
|
2332
|
+
function fi(e, t = !1) {
|
|
2322
2333
|
let r = null;
|
|
2323
2334
|
return t ? r = e.beforeHide ?? e.beforeLeave : r = e.beforeLeave, r;
|
|
2324
2335
|
}
|
|
2325
|
-
function
|
|
2336
|
+
function ci(e, t = !1) {
|
|
2326
2337
|
let r = null;
|
|
2327
2338
|
return t ? r = e.hide ?? e.leave : r = e.leave, r;
|
|
2328
2339
|
}
|
|
2329
|
-
function
|
|
2340
|
+
function hi(e, t = !1) {
|
|
2330
2341
|
let r = null;
|
|
2331
2342
|
return t ? r = e.afterHide ?? e.afterLeave : r = e.afterLeave, r;
|
|
2332
2343
|
}
|
|
2333
|
-
function
|
|
2344
|
+
function yi(e, t = !1) {
|
|
2334
2345
|
let r = null;
|
|
2335
2346
|
return t ? r = e.hideCancelled ?? e.leaveCancelled : r = e.leaveCancelled, r;
|
|
2336
2347
|
}
|
|
@@ -2348,17 +2359,17 @@ function rr(e) {
|
|
|
2348
2359
|
hide: r
|
|
2349
2360
|
}), t;
|
|
2350
2361
|
}
|
|
2351
|
-
function
|
|
2362
|
+
function xe(e, t) {
|
|
2352
2363
|
e.classList.contains(t) || e.classList.add(t);
|
|
2353
2364
|
}
|
|
2354
|
-
function
|
|
2365
|
+
function Re(e, t) {
|
|
2355
2366
|
e.classList.remove(t);
|
|
2356
2367
|
}
|
|
2357
|
-
var
|
|
2368
|
+
var di = Se && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : setTimeout;
|
|
2358
2369
|
function yt(e) {
|
|
2359
|
-
|
|
2370
|
+
di(e);
|
|
2360
2371
|
}
|
|
2361
|
-
function
|
|
2372
|
+
function F(e, t) {
|
|
2362
2373
|
b(e) && Reflect.apply(e, null, t);
|
|
2363
2374
|
}
|
|
2364
2375
|
function es(e, t, r = -1, s, i, n) {
|
|
@@ -2411,14 +2422,14 @@ function es(e, t, r = -1, s, i, n) {
|
|
|
2411
2422
|
}
|
|
2412
2423
|
}
|
|
2413
2424
|
function dt(e) {
|
|
2414
|
-
return !
|
|
2425
|
+
return !Se || e === null ? !1 : e.opsType === _.Append || e.opsType === _.Open;
|
|
2415
2426
|
}
|
|
2416
2427
|
function ts(e, t, r = {}, s, i = -1) {
|
|
2417
2428
|
if (e || dt(s)) {
|
|
2418
2429
|
const n = Xr(r, e);
|
|
2419
|
-
n &&
|
|
2430
|
+
n && xe(t, n);
|
|
2420
2431
|
const o = Qr(r, e);
|
|
2421
|
-
o &&
|
|
2432
|
+
o && xe(t, o), F(oi(r, e), [
|
|
2422
2433
|
t,
|
|
2423
2434
|
e,
|
|
2424
2435
|
s,
|
|
@@ -2431,27 +2442,27 @@ function rs(e, t, r = {}, s, i, n, o) {
|
|
|
2431
2442
|
b(o) && o(o, [t]);
|
|
2432
2443
|
return;
|
|
2433
2444
|
}
|
|
2434
|
-
const l = Xr(r, e), a = Qr(r, e), u =
|
|
2445
|
+
const l = Xr(r, e), a = Qr(r, e), u = ii(r, e), f = li(r, e), c = ai(r, e), h = ui(r, e);
|
|
2435
2446
|
if (!l && !a && !u && !f) {
|
|
2436
2447
|
b(o) && o(o, [t]);
|
|
2437
2448
|
return;
|
|
2438
2449
|
}
|
|
2439
2450
|
yt(() => {
|
|
2440
2451
|
es(t, i, n, s, () => {
|
|
2441
|
-
a &&
|
|
2452
|
+
a && Re(t, a), u && Re(t, u), b(c) && F(c, [
|
|
2442
2453
|
t,
|
|
2443
2454
|
e,
|
|
2444
2455
|
i,
|
|
2445
2456
|
n
|
|
2446
2457
|
]), b(o) && o(o, [t]);
|
|
2447
2458
|
}, () => {
|
|
2448
|
-
b(h) &&
|
|
2459
|
+
b(h) && F(h, [
|
|
2449
2460
|
t,
|
|
2450
2461
|
e,
|
|
2451
2462
|
i,
|
|
2452
2463
|
n
|
|
2453
2464
|
]);
|
|
2454
|
-
}), l &&
|
|
2465
|
+
}), l && Re(t, l), u && xe(t, u), b(f) && F(f, [
|
|
2455
2466
|
t,
|
|
2456
2467
|
e,
|
|
2457
2468
|
i,
|
|
@@ -2462,9 +2473,9 @@ function rs(e, t, r = {}, s, i, n, o) {
|
|
|
2462
2473
|
function ss(e, t, r = {}, s, i = -1) {
|
|
2463
2474
|
if (e || dt(s)) {
|
|
2464
2475
|
const n = Zr(r, e);
|
|
2465
|
-
n &&
|
|
2476
|
+
n && xe(t, n);
|
|
2466
2477
|
const o = Yr(r, e);
|
|
2467
|
-
o &&
|
|
2478
|
+
o && xe(t, o), F(fi(r, e), [
|
|
2468
2479
|
t,
|
|
2469
2480
|
e,
|
|
2470
2481
|
s,
|
|
@@ -2474,38 +2485,38 @@ function ss(e, t, r = {}, s, i = -1) {
|
|
|
2474
2485
|
}
|
|
2475
2486
|
function is(e, t, r = {}, s, i, n, o, l) {
|
|
2476
2487
|
if (!dt(n) && !e) {
|
|
2477
|
-
b(l) &&
|
|
2488
|
+
b(l) && F(l, [t]), !e && b(i) && i();
|
|
2478
2489
|
return;
|
|
2479
2490
|
}
|
|
2480
|
-
const a = Zr(r, e), u = Yr(r, e), f =
|
|
2491
|
+
const a = Zr(r, e), u = Yr(r, e), f = ni(r, e), c = ci(r, e), h = hi(r, e), d = yi(r, e);
|
|
2481
2492
|
if (!a && !u && !f && !c) {
|
|
2482
|
-
b(l) &&
|
|
2493
|
+
b(l) && F(l, [t]), !e && b(i) && i();
|
|
2483
2494
|
return;
|
|
2484
2495
|
}
|
|
2485
2496
|
yt(() => {
|
|
2486
2497
|
es(t, n, o, s, () => {
|
|
2487
2498
|
try {
|
|
2488
|
-
u &&
|
|
2499
|
+
u && Re(t, u), f && Re(t, f), b(h) && F(h, [
|
|
2489
2500
|
t,
|
|
2490
2501
|
e,
|
|
2491
2502
|
n,
|
|
2492
2503
|
o
|
|
2493
|
-
]), b(l) &&
|
|
2504
|
+
]), b(l) && F(l, [t]);
|
|
2494
2505
|
} finally {
|
|
2495
2506
|
!e && b(i) && i();
|
|
2496
2507
|
}
|
|
2497
2508
|
}, () => {
|
|
2498
2509
|
try {
|
|
2499
|
-
b(
|
|
2510
|
+
b(d) && F(d, [
|
|
2500
2511
|
t,
|
|
2501
2512
|
e,
|
|
2502
2513
|
n,
|
|
2503
2514
|
o
|
|
2504
|
-
]), b(l) &&
|
|
2515
|
+
]), b(l) && F(l, [t]);
|
|
2505
2516
|
} finally {
|
|
2506
2517
|
!e && b(i) && i();
|
|
2507
2518
|
}
|
|
2508
|
-
}), a &&
|
|
2519
|
+
}), a && Re(t, a), f && xe(t, f), b(c) && F(c, [
|
|
2509
2520
|
t,
|
|
2510
2521
|
e,
|
|
2511
2522
|
n,
|
|
@@ -2541,21 +2552,21 @@ function mi(e, t = {}, r, s, i, n) {
|
|
|
2541
2552
|
if (o == null) return;
|
|
2542
2553
|
const l = rr(t);
|
|
2543
2554
|
ts(!0, o, t, r, s), rs(!0, o, t, l.show, r, s, (a) => {
|
|
2544
|
-
b(n) &&
|
|
2555
|
+
b(n) && F(n, [a]);
|
|
2545
2556
|
});
|
|
2546
|
-
} else b(n) &&
|
|
2557
|
+
} else b(n) && F(n, []);
|
|
2547
2558
|
}
|
|
2548
|
-
function
|
|
2559
|
+
function vi(e, t = {}, r, s, i, n) {
|
|
2549
2560
|
if (i === !0) {
|
|
2550
2561
|
const o = ns(e);
|
|
2551
2562
|
if (o == null) return;
|
|
2552
2563
|
const l = rr(t);
|
|
2553
2564
|
ss(!0, o, t, r, s), is(!0, o, t, l.hide, null, r, s, (a) => {
|
|
2554
|
-
b(n) &&
|
|
2565
|
+
b(n) && F(n, [a]);
|
|
2555
2566
|
});
|
|
2556
|
-
} else b(n) &&
|
|
2567
|
+
} else b(n) && F(n, []);
|
|
2557
2568
|
}
|
|
2558
|
-
function
|
|
2569
|
+
function pi(e) {
|
|
2559
2570
|
yt(() => {
|
|
2560
2571
|
for (let t = 0; t < e.length; t++) Reflect.apply(e[t], null, []);
|
|
2561
2572
|
});
|
|
@@ -2565,23 +2576,23 @@ function os(e, t = {}, r, s = -1) {
|
|
|
2565
2576
|
mode: t.mode ?? "default",
|
|
2566
2577
|
persisted: !1,
|
|
2567
2578
|
beforeEnter: (i) => {
|
|
2568
|
-
Ve(
|
|
2579
|
+
Ve(ei, {}, i);
|
|
2569
2580
|
},
|
|
2570
2581
|
enter: (i) => {
|
|
2571
|
-
Ve(
|
|
2582
|
+
Ve(ti, {}, i);
|
|
2572
2583
|
},
|
|
2573
2584
|
leave: (i, n) => {
|
|
2574
|
-
Ve(
|
|
2585
|
+
Ve(ri, {}, i), yt(() => {
|
|
2575
2586
|
const o = (l) => {
|
|
2576
2587
|
(l.target || l.srcElement) === l.currentTarget && (Xt(i, Bt, o), n && Reflect.apply(n, null, []), e.transition = null);
|
|
2577
2588
|
};
|
|
2578
|
-
ut(i, Bt, o), Ve(
|
|
2589
|
+
ut(i, Bt, o), Ve(si, {}, i);
|
|
2579
2590
|
});
|
|
2580
2591
|
},
|
|
2581
2592
|
clone: (i) => os(e, t, r, s)
|
|
2582
2593
|
};
|
|
2583
2594
|
}
|
|
2584
|
-
function
|
|
2595
|
+
function re(e, t, r) {
|
|
2585
2596
|
return typeof e == "function" ? Reflect.apply(e, {}, [t, r]) : e;
|
|
2586
2597
|
}
|
|
2587
2598
|
function Lt(e, t) {
|
|
@@ -2589,10 +2600,10 @@ function Lt(e, t) {
|
|
|
2589
2600
|
const r = e(t);
|
|
2590
2601
|
return r.length === 1 ? r[0] : r;
|
|
2591
2602
|
}
|
|
2592
|
-
function
|
|
2603
|
+
function pe(e, t) {
|
|
2593
2604
|
return typeof t == "function" ? t(e) : e;
|
|
2594
2605
|
}
|
|
2595
|
-
var
|
|
2606
|
+
var gi = class {
|
|
2596
2607
|
node;
|
|
2597
2608
|
state;
|
|
2598
2609
|
constructor(e, t) {
|
|
@@ -2796,114 +2807,114 @@ var wi = class {
|
|
|
2796
2807
|
return;
|
|
2797
2808
|
}
|
|
2798
2809
|
const c = lt(u, !0);
|
|
2799
|
-
c && (
|
|
2810
|
+
c && (Xs(c), _r(c, () => u?.route ?? null));
|
|
2800
2811
|
} else {
|
|
2801
2812
|
if (i == null) {
|
|
2802
2813
|
console.error("[Fox]router is not been injected");
|
|
2803
2814
|
return;
|
|
2804
2815
|
}
|
|
2805
|
-
const c = e.name, h = L(xr, null),
|
|
2806
|
-
if (a = i[Br](c, n, o, l, h,
|
|
2816
|
+
const c = e.name, h = L(xr, null), d = L(Tt, 0);
|
|
2817
|
+
if (a = i[Br](c, n, o, l, h, d), a === null) return;
|
|
2807
2818
|
Z(xr, a);
|
|
2808
|
-
const
|
|
2809
|
-
if (
|
|
2810
|
-
const
|
|
2811
|
-
|
|
2819
|
+
const y = a[V] === !0;
|
|
2820
|
+
if (y && Z(Sr, a), !s && (Z(kt, -1), Z(jt, n + 1), Z(Tt, -1), y && r)) {
|
|
2821
|
+
const m = lt(r, !0);
|
|
2822
|
+
m && _r(m, () => {
|
|
2812
2823
|
const w = a?.slots.value ?? [];
|
|
2813
2824
|
return w.length > 0 ? w[0].route : null;
|
|
2814
2825
|
});
|
|
2815
2826
|
}
|
|
2816
2827
|
}
|
|
2817
2828
|
const f = { value: /* @__PURE__ */ new Map() };
|
|
2818
|
-
return
|
|
2829
|
+
return Ce(() => {
|
|
2819
2830
|
if (f.value && f.value.clear(), u) {
|
|
2820
2831
|
const c = u;
|
|
2821
2832
|
c.route = null, c.model = null, c.instance = null, u = null;
|
|
2822
2833
|
}
|
|
2823
2834
|
}), () => {
|
|
2824
2835
|
if (s) {
|
|
2825
|
-
const c = /* @__PURE__ */ new Map(), h = [],
|
|
2826
|
-
for (let
|
|
2827
|
-
const
|
|
2836
|
+
const c = /* @__PURE__ */ new Map(), h = [], d = a?.slots.value, y = [];
|
|
2837
|
+
for (let p = 0; p < d.length; p++) {
|
|
2838
|
+
const g = d[p], $ = `${e.name}_${g.index}`, K = re(e.transition, g.route, p) ?? !0, _e = { modelSlot: g };
|
|
2828
2839
|
let j;
|
|
2829
|
-
t.slots.default ? j =
|
|
2830
|
-
const E = {},
|
|
2831
|
-
typeof
|
|
2832
|
-
const Q =
|
|
2833
|
-
if (typeof Q == "string" && Q.length > 0 && (E[Q] =
|
|
2834
|
-
const
|
|
2835
|
-
|
|
2836
|
-
const
|
|
2837
|
-
const Fe = lt(
|
|
2838
|
-
Fe != null && Pr(Fe,
|
|
2840
|
+
t.slots.default ? j = fe(Wt, _e, { default: t.slots.default }) : j = fe(Wt, _e);
|
|
2841
|
+
const E = {}, ie = re(e.viewClass, g.route, p);
|
|
2842
|
+
typeof ie == "string" && ie.length > 0 && (E[ie] = !0);
|
|
2843
|
+
const Q = re(e.viewActiveClass, g.route, p), k = re(e.viewInactiveClass, g.route, p), z = f.value.get($);
|
|
2844
|
+
if (typeof Q == "string" && Q.length > 0 && (E[Q] = g.active), typeof k == "string" && k.length > 0 && (E[k] = !g.active), z && g.active !== z.state) {
|
|
2845
|
+
const de = z.node;
|
|
2846
|
+
g.active ? y.unshift(() => {
|
|
2847
|
+
const mt = () => {
|
|
2848
|
+
const Fe = lt(g);
|
|
2849
|
+
Fe != null && Pr(Fe, Cr.ACTIVATED);
|
|
2839
2850
|
};
|
|
2840
|
-
mi(
|
|
2841
|
-
}) :
|
|
2842
|
-
const
|
|
2843
|
-
const Fe = lt(
|
|
2844
|
-
Fe != null && Pr(Fe,
|
|
2851
|
+
mi(de, e, g.route, p, K, mt);
|
|
2852
|
+
}) : y.push(() => {
|
|
2853
|
+
const mt = () => {
|
|
2854
|
+
const Fe = lt(g);
|
|
2855
|
+
Fe != null && Pr(Fe, Cr.INACTIVATED);
|
|
2845
2856
|
};
|
|
2846
|
-
|
|
2857
|
+
vi(de, e, g.route, p, K, mt);
|
|
2847
2858
|
});
|
|
2848
2859
|
}
|
|
2849
2860
|
const D = {
|
|
2850
2861
|
class: E,
|
|
2851
2862
|
key: $
|
|
2852
|
-
}, N =
|
|
2863
|
+
}, N = re(e.viewTagProps, g.route, p);
|
|
2853
2864
|
if (N !== null && typeof N == "object") {
|
|
2854
|
-
const
|
|
2855
|
-
q(!0, D,
|
|
2865
|
+
const de = pe(N, i?.propsFilter);
|
|
2866
|
+
q(!0, D, de);
|
|
2856
2867
|
}
|
|
2857
|
-
if (
|
|
2858
|
-
const
|
|
2859
|
-
q(!0, D,
|
|
2868
|
+
if (g.route?.viewTagAttrs && typeof g.route?.viewTagAttrs == "object") {
|
|
2869
|
+
const de = pe(g.route.viewTagAttrs, i?.propsFilter);
|
|
2870
|
+
q(!0, D, de);
|
|
2860
2871
|
}
|
|
2861
|
-
const as =
|
|
2862
|
-
c.set($, new
|
|
2872
|
+
const as = re(e.viewTag, g.route, p), ye = fe(as, D, { default: () => [j] });
|
|
2873
|
+
c.set($, new gi(ye, g.active)), f.value.delete($), K === !0 ? ye.transition = Vt(ye, e, g.route, p) : K === "custom" && (ye.transition = os(ye, e, g.route, p)), h.push(ye);
|
|
2863
2874
|
}
|
|
2864
|
-
f.value = c,
|
|
2865
|
-
const
|
|
2866
|
-
return Object.assign(w, t.attrs),
|
|
2875
|
+
f.value = c, pi(y);
|
|
2876
|
+
const m = re(e.tag, null, -1), w = {};
|
|
2877
|
+
return Object.assign(w, t.attrs), fe(m, w, { default: () => h });
|
|
2867
2878
|
} else if (u != null) {
|
|
2868
2879
|
const c = u.model, h = {};
|
|
2869
2880
|
if (c.props) {
|
|
2870
2881
|
if (typeof c.props == "object") {
|
|
2871
|
-
const
|
|
2872
|
-
q(!1, h,
|
|
2882
|
+
const y = pe(c.props, i?.propsFilter);
|
|
2883
|
+
q(!1, h, y);
|
|
2873
2884
|
} else if (c.props === !0 && typeof u.route?.params == "object") {
|
|
2874
|
-
const
|
|
2875
|
-
q(!1, h,
|
|
2885
|
+
const y = pe(u.route.params, i?.propsFilter);
|
|
2886
|
+
q(!1, h, y);
|
|
2876
2887
|
}
|
|
2877
2888
|
}
|
|
2878
|
-
const
|
|
2889
|
+
const d = fe(c.component, h);
|
|
2879
2890
|
return Lt(t.slots.default, {
|
|
2880
|
-
Component:
|
|
2891
|
+
Component: d,
|
|
2881
2892
|
route: u.route
|
|
2882
|
-
}) ??
|
|
2893
|
+
}) ?? d;
|
|
2883
2894
|
} else {
|
|
2884
2895
|
const c = a?.slots.value ?? [];
|
|
2885
2896
|
if (c.length > 0) {
|
|
2886
|
-
const h = c[0],
|
|
2887
|
-
if (
|
|
2888
|
-
if (typeof
|
|
2889
|
-
const
|
|
2890
|
-
q(!1,
|
|
2891
|
-
} else if (
|
|
2892
|
-
const
|
|
2893
|
-
q(!1,
|
|
2897
|
+
const h = c[0], d = h.route, y = h.model, m = {};
|
|
2898
|
+
if (y.props) {
|
|
2899
|
+
if (typeof y.props == "object") {
|
|
2900
|
+
const p = pe(y.props, i?.propsFilter);
|
|
2901
|
+
q(!1, m, p);
|
|
2902
|
+
} else if (y.props === !0 && typeof d?.params == "object") {
|
|
2903
|
+
const p = pe(d.params, i?.propsFilter);
|
|
2904
|
+
q(!1, m, p);
|
|
2894
2905
|
}
|
|
2895
2906
|
}
|
|
2896
|
-
const w =
|
|
2897
|
-
return (
|
|
2907
|
+
const w = fe(y.component, m);
|
|
2908
|
+
return (re(e.transition, d, -1) ?? !0) && (w.transition = Vt(w, e, d, -1)), Lt(t.slots.default, {
|
|
2898
2909
|
Component: w,
|
|
2899
|
-
route:
|
|
2910
|
+
route: d
|
|
2900
2911
|
}) ?? w;
|
|
2901
2912
|
} else return Lt(t.slots.fallback, {});
|
|
2902
2913
|
}
|
|
2903
2914
|
};
|
|
2904
2915
|
}
|
|
2905
2916
|
});
|
|
2906
|
-
function
|
|
2917
|
+
function wi(e) {
|
|
2907
2918
|
if (!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && !e.defaultPrevented && !(e.button != null && e.button !== 0)) {
|
|
2908
2919
|
if (e.currentTarget && e.currentTarget.getAttribute) {
|
|
2909
2920
|
const t = e.currentTarget.getAttribute("target");
|
|
@@ -2912,13 +2923,13 @@ function bi(e) {
|
|
|
2912
2923
|
return e.preventDefault && e.preventDefault(), !0;
|
|
2913
2924
|
}
|
|
2914
2925
|
}
|
|
2915
|
-
function
|
|
2926
|
+
function bi(e, t) {
|
|
2916
2927
|
return e == null || t == null ? !1 : !!(e.path && t.path && t.path.startsWith(e.path) || e.name && e.name == t.name);
|
|
2917
2928
|
}
|
|
2918
|
-
function
|
|
2929
|
+
function ge(e, t) {
|
|
2919
2930
|
return typeof e == "function" ? Reflect.apply(e, {}, [t]) : e;
|
|
2920
2931
|
}
|
|
2921
|
-
var
|
|
2932
|
+
var Ri = $r({
|
|
2922
2933
|
name: "RouterLink",
|
|
2923
2934
|
inheritAttrs: !1,
|
|
2924
2935
|
props: {
|
|
@@ -2967,21 +2978,21 @@ var Si = $r({
|
|
|
2967
2978
|
setup(e, t) {
|
|
2968
2979
|
const r = L(Ne, null);
|
|
2969
2980
|
return () => {
|
|
2970
|
-
let s =
|
|
2981
|
+
let s = ge(e.to, null), i = ge(e.tag, s);
|
|
2971
2982
|
if (i == null) {
|
|
2972
2983
|
console.warn("[Fox]can not resolve link tag");
|
|
2973
2984
|
return;
|
|
2974
2985
|
}
|
|
2975
2986
|
let n = null, o = null;
|
|
2976
2987
|
r !== null && (n = r[M](s), e.root && (n.root = e.root), o = r.currentRoute.value);
|
|
2977
|
-
let l = {}, a =
|
|
2978
|
-
if (typeof a == "string" && a.length > 0 && (l[a] =
|
|
2979
|
-
let c =
|
|
2988
|
+
let l = {}, a = ge(e.activeClass, n);
|
|
2989
|
+
if (typeof a == "string" && a.length > 0 && (l[a] = bi(n, o)), ge(e.exact, n) === !0) {
|
|
2990
|
+
let c = ge(e.exactActiveClass, n);
|
|
2980
2991
|
typeof c == "string" && c.length > 0 && (l[c] = x.isSamePathForRoute(n, o));
|
|
2981
2992
|
}
|
|
2982
2993
|
let u = { class: l };
|
|
2983
2994
|
(i === "a" || i === "A") && (u.href = n?.path ?? n?.name ?? "#"), q(!0, u, t.attrs);
|
|
2984
|
-
const f =
|
|
2995
|
+
const f = ge(e.event, n);
|
|
2985
2996
|
if (typeof f == "string") {
|
|
2986
2997
|
const c = (h) => {
|
|
2987
2998
|
if (r == null) {
|
|
@@ -2992,33 +3003,33 @@ var Si = $r({
|
|
|
2992
3003
|
console.warn("[Fox]route is not been resolved");
|
|
2993
3004
|
return;
|
|
2994
3005
|
}
|
|
2995
|
-
|
|
3006
|
+
wi(h) && r.to(n);
|
|
2996
3007
|
};
|
|
2997
3008
|
u[f] = c;
|
|
2998
3009
|
}
|
|
2999
|
-
return
|
|
3010
|
+
return fe(i, u, t.slots);
|
|
3000
3011
|
};
|
|
3001
3012
|
}
|
|
3002
|
-
}),
|
|
3013
|
+
}), we = /* @__PURE__ */ Symbol("registerKey"), Si = class {
|
|
3003
3014
|
policy;
|
|
3004
3015
|
callback;
|
|
3005
3016
|
constructor(e, t) {
|
|
3006
3017
|
this.callback = e, this.policy = t;
|
|
3007
3018
|
}
|
|
3008
3019
|
}, Er = class {
|
|
3009
|
-
[
|
|
3020
|
+
[we] = /* @__PURE__ */ new Map();
|
|
3010
3021
|
constructor() {
|
|
3011
3022
|
}
|
|
3012
3023
|
on(e, t, r = !1) {
|
|
3013
|
-
let s = this[
|
|
3014
|
-
s || (s = new Array(), this[
|
|
3015
|
-
let i = new
|
|
3024
|
+
let s = this[we].get(e);
|
|
3025
|
+
s || (s = new Array(), this[we].set(e, s));
|
|
3026
|
+
let i = new Si(t, r === !0 ? 1 : 0);
|
|
3016
3027
|
return s.push(i), this;
|
|
3017
3028
|
}
|
|
3018
3029
|
off(e, t) {
|
|
3019
3030
|
if (!t)
|
|
3020
|
-
return this[
|
|
3021
|
-
let r = this[
|
|
3031
|
+
return this[we].delete(e), this;
|
|
3032
|
+
let r = this[we].get(e);
|
|
3022
3033
|
if (r) {
|
|
3023
3034
|
for (let s = 0; s < r.length; s++) if (r[s].callback === t) {
|
|
3024
3035
|
r.splice(s, 1);
|
|
@@ -3049,7 +3060,7 @@ var Si = $r({
|
|
|
3049
3060
|
return this;
|
|
3050
3061
|
}
|
|
3051
3062
|
emit(e, ...t) {
|
|
3052
|
-
let r = this[
|
|
3063
|
+
let r = this[we].get(e);
|
|
3053
3064
|
if (!r) return this;
|
|
3054
3065
|
for (let s = 0; s < r.length; ) {
|
|
3055
3066
|
let i = r[s];
|
|
@@ -3066,15 +3077,15 @@ var Si = $r({
|
|
|
3066
3077
|
trigger(e, ...t) {
|
|
3067
3078
|
return Reflect.apply(this.emit, this, [e, ...t]);
|
|
3068
3079
|
}
|
|
3069
|
-
},
|
|
3080
|
+
}, xi = "FoxRouterView", Pi = "FoxRouterLink", X = /* @__PURE__ */ (function(e) {
|
|
3070
3081
|
return e[e.Loading = 0] = "Loading", e[e.Loaded = 1] = "Loaded", e[e.Defining = 2] = "Defining", e[e.Defined = 3] = "Defined", e;
|
|
3071
3082
|
})({});
|
|
3072
|
-
function
|
|
3083
|
+
function Ci(e) {
|
|
3073
3084
|
return e == 1 || e === 3;
|
|
3074
3085
|
}
|
|
3075
3086
|
var Ar = /* @__PURE__ */ (function(e) {
|
|
3076
3087
|
return e[e.normal = 0] = "normal", e[e.factory = 1] = "factory", e;
|
|
3077
|
-
})({}),
|
|
3088
|
+
})({}), _i = class {
|
|
3078
3089
|
register = /* @__PURE__ */ new Map();
|
|
3079
3090
|
regExpRegisters = [];
|
|
3080
3091
|
constructor() {
|
|
@@ -3117,11 +3128,11 @@ var Ar = /* @__PURE__ */ (function(e) {
|
|
|
3117
3128
|
"exports",
|
|
3118
3129
|
"module"
|
|
3119
3130
|
];
|
|
3120
|
-
async function
|
|
3131
|
+
async function Fi(e) {
|
|
3121
3132
|
return await new Function("url", "return import(url)")(e);
|
|
3122
3133
|
}
|
|
3123
3134
|
var qr = class {
|
|
3124
|
-
moduleManager = new
|
|
3135
|
+
moduleManager = new _i();
|
|
3125
3136
|
_alias = {};
|
|
3126
3137
|
set alias(e) {
|
|
3127
3138
|
this._alias = e;
|
|
@@ -3180,10 +3191,10 @@ var qr = class {
|
|
|
3180
3191
|
}
|
|
3181
3192
|
getModuleExports(e) {
|
|
3182
3193
|
const t = this.moduleManager.get(e);
|
|
3183
|
-
return t &&
|
|
3194
|
+
return t && Ci(t.status) ? t.type === Ar.factory && typeof t.exports == "function" ? t.exports() : t.exports : null;
|
|
3184
3195
|
}
|
|
3185
3196
|
exposeRequire(e = "__foxRequire", t, r) {
|
|
3186
|
-
const s = t ??
|
|
3197
|
+
const s = t ?? C();
|
|
3187
3198
|
return s && typeof s == "object" ? (s[e] = (i) => {
|
|
3188
3199
|
const n = this.getModuleExports(i);
|
|
3189
3200
|
return r && !n && console.error(`[Fox] module:${i}, not found!`), n;
|
|
@@ -3233,7 +3244,7 @@ var qr = class {
|
|
|
3233
3244
|
const u = this.resloveResource(e[a]);
|
|
3234
3245
|
s.push(u);
|
|
3235
3246
|
}
|
|
3236
|
-
const o = new
|
|
3247
|
+
const o = new Ei(s.length, (a, u) => {
|
|
3237
3248
|
if (o.isOK()) try {
|
|
3238
3249
|
typeof n == "function" && Reflect.apply(n, {}, u), t(u);
|
|
3239
3250
|
} catch (f) {
|
|
@@ -3246,7 +3257,7 @@ var qr = class {
|
|
|
3246
3257
|
}
|
|
3247
3258
|
}), l = new ft();
|
|
3248
3259
|
for (let a = 0; a < s.length; a++) {
|
|
3249
|
-
const u = new
|
|
3260
|
+
const u = new Ai(a, s[a], o);
|
|
3250
3261
|
this.mount(l, u);
|
|
3251
3262
|
}
|
|
3252
3263
|
return this;
|
|
@@ -3368,7 +3379,7 @@ var qr = class {
|
|
|
3368
3379
|
}
|
|
3369
3380
|
const a = this.constructResourceUri(i.path);
|
|
3370
3381
|
l.defer = !0, l.src = a;
|
|
3371
|
-
const u =
|
|
3382
|
+
const u = C(), f = this.createRequireLoad();
|
|
3372
3383
|
u.__require = u.__require ?? u.require, u.require = f;
|
|
3373
3384
|
const c = this.createDefine(o, f, t);
|
|
3374
3385
|
u.__define = u.__define ?? u.define, u.define = c, typeof t.progress.finalCallback != "function" && (t.progress.finalCallback = function() {
|
|
@@ -3384,7 +3395,7 @@ var qr = class {
|
|
|
3384
3395
|
return;
|
|
3385
3396
|
}
|
|
3386
3397
|
try {
|
|
3387
|
-
let n = await
|
|
3398
|
+
let n = await Fi(s.path);
|
|
3388
3399
|
if (Zt(n) && (n = n.default ?? n), Ue(n)) {
|
|
3389
3400
|
t.progress.work(!1, t.index, n), r.resolve();
|
|
3390
3401
|
return;
|
|
@@ -3480,7 +3491,7 @@ var qr = class {
|
|
|
3480
3491
|
let r = e.lastIndexOf(".", t);
|
|
3481
3492
|
return r == -1 ? "" : e.substring(r + 1, t);
|
|
3482
3493
|
}
|
|
3483
|
-
},
|
|
3494
|
+
}, Ei = class {
|
|
3484
3495
|
finalCallback;
|
|
3485
3496
|
callback;
|
|
3486
3497
|
values;
|
|
@@ -3502,7 +3513,7 @@ var qr = class {
|
|
|
3502
3513
|
isOK() {
|
|
3503
3514
|
return this.status;
|
|
3504
3515
|
}
|
|
3505
|
-
},
|
|
3516
|
+
}, Ai = class {
|
|
3506
3517
|
index;
|
|
3507
3518
|
resource;
|
|
3508
3519
|
progress;
|
|
@@ -3510,8 +3521,8 @@ var qr = class {
|
|
|
3510
3521
|
this.index = e, this.resource = t, this.progress = r;
|
|
3511
3522
|
}
|
|
3512
3523
|
}, zt = /* @__PURE__ */ Symbol("fk"), Jt = /* @__PURE__ */ Symbol("fbk"), Gt = /* @__PURE__ */ Symbol("fepk");
|
|
3513
|
-
function
|
|
3514
|
-
const t = new
|
|
3524
|
+
function Gi(e = {}) {
|
|
3525
|
+
const t = new zs(e), r = new ar(), s = new Er(), i = new qr(), n = {
|
|
3515
3526
|
get router() {
|
|
3516
3527
|
return t;
|
|
3517
3528
|
},
|
|
@@ -3540,7 +3551,7 @@ function Xi(e = {}) {
|
|
|
3540
3551
|
return Zt;
|
|
3541
3552
|
},
|
|
3542
3553
|
install(o, l = {}) {
|
|
3543
|
-
o.provide(Ne, t), o.provide(zt, n), o.provide(Jt, r), o.provide(Gt, s), l.install !== !1 && (o.component(
|
|
3554
|
+
o.provide(Ne, t), o.provide(zt, n), o.provide(Jt, r), o.provide(Gt, s), l.install !== !1 && (o.component(xi, Wt), o.component(Pi, Ri)), l.optionsApi !== !1 && (Reflect.defineProperty(o.config.globalProperties, "$fox", { get() {
|
|
3544
3555
|
return n;
|
|
3545
3556
|
} }), Reflect.defineProperty(o.config.globalProperties, "$router", { get() {
|
|
3546
3557
|
return t;
|
|
@@ -3566,34 +3577,34 @@ function Xi(e = {}) {
|
|
|
3566
3577
|
let f = s;
|
|
3567
3578
|
Reflect.apply(f.trigger, f, [a, ...u]);
|
|
3568
3579
|
}, o.mixin({ computed: { $route() {
|
|
3569
|
-
return
|
|
3580
|
+
return qi(this);
|
|
3570
3581
|
} } })), t.init();
|
|
3571
3582
|
}
|
|
3572
3583
|
};
|
|
3573
3584
|
return n;
|
|
3574
3585
|
}
|
|
3575
3586
|
function ls(e) {
|
|
3576
|
-
return
|
|
3587
|
+
return Pe() ? L(Ne, null) : e ? e.$?.appContext?.provides?.[Ne] ?? null : null;
|
|
3577
3588
|
}
|
|
3578
|
-
function
|
|
3579
|
-
let t =
|
|
3580
|
-
if (!t && e && !
|
|
3589
|
+
function qi(e) {
|
|
3590
|
+
let t = Fr(e);
|
|
3591
|
+
if (!t && e && !Pe()) {
|
|
3581
3592
|
let r = e;
|
|
3582
|
-
for (r = r.$parent; r && (t =
|
|
3593
|
+
for (r = r.$parent; r && (t = Fr(r), !t); )
|
|
3583
3594
|
r = r.$parent;
|
|
3584
3595
|
}
|
|
3585
3596
|
return t;
|
|
3586
3597
|
}
|
|
3598
|
+
function Xi(e) {
|
|
3599
|
+
return Pe() ? L(zt, null) : e ? e.$?.appContext?.provides?.[zt] ?? null : null;
|
|
3600
|
+
}
|
|
3587
3601
|
function Qi(e) {
|
|
3588
|
-
return
|
|
3602
|
+
return Pe() ? L(Jt, null) : e ? e.$?.appContext?.provides?.[Jt] ?? null : null;
|
|
3589
3603
|
}
|
|
3590
3604
|
function Zi(e) {
|
|
3591
|
-
return
|
|
3605
|
+
return Pe() ? L(Gt, null) : e ? e.$?.appContext?.provides?.[Gt] ?? null : null;
|
|
3592
3606
|
}
|
|
3593
3607
|
function Yi(e) {
|
|
3594
|
-
return xe() ? L(Gt, null) : e ? e.$?.appContext?.provides?.[Gt] ?? null : null;
|
|
3595
|
-
}
|
|
3596
|
-
function en(e) {
|
|
3597
3608
|
const t = ls();
|
|
3598
3609
|
if (!t) {
|
|
3599
3610
|
console.error("[Fox]router is not exist.");
|
|
@@ -3607,11 +3618,11 @@ function en(e) {
|
|
|
3607
3618
|
}
|
|
3608
3619
|
n();
|
|
3609
3620
|
};
|
|
3610
|
-
t?.beforeEach(r),
|
|
3621
|
+
t?.beforeEach(r), Ce(() => {
|
|
3611
3622
|
t?.removeBeforeEach(r);
|
|
3612
3623
|
});
|
|
3613
3624
|
}
|
|
3614
|
-
function
|
|
3625
|
+
function en(e) {
|
|
3615
3626
|
const t = ls();
|
|
3616
3627
|
if (!t) {
|
|
3617
3628
|
console.error("[Fox]router is not exist.");
|
|
@@ -3625,7 +3636,7 @@ function tn(e) {
|
|
|
3625
3636
|
}
|
|
3626
3637
|
n();
|
|
3627
3638
|
};
|
|
3628
|
-
t?.afterEach(r),
|
|
3639
|
+
t?.afterEach(r), Ce(() => {
|
|
3629
3640
|
t?.removeAfterEach(r);
|
|
3630
3641
|
});
|
|
3631
3642
|
}
|
|
@@ -3633,55 +3644,55 @@ export {
|
|
|
3633
3644
|
ar as Bus,
|
|
3634
3645
|
ft as EventChain,
|
|
3635
3646
|
Er as EventProxy,
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3647
|
+
ei as FoxBeforeEnter,
|
|
3648
|
+
ri as FoxBeforeLeave,
|
|
3649
|
+
ti as FoxEnter,
|
|
3650
|
+
si as FoxLeave,
|
|
3640
3651
|
Bt as FoxLeaveEnd,
|
|
3641
|
-
|
|
3652
|
+
_ as OperationType,
|
|
3642
3653
|
x as Route,
|
|
3643
|
-
|
|
3644
|
-
|
|
3654
|
+
zs as Router,
|
|
3655
|
+
Ri as RouterLink,
|
|
3645
3656
|
Wt as RouterView,
|
|
3646
|
-
|
|
3647
|
-
|
|
3657
|
+
Bi as bindLifecycleContextToCurrentScope,
|
|
3658
|
+
Gi as createFox,
|
|
3648
3659
|
Vs as createMemoryHistory,
|
|
3649
3660
|
Us as createWebHashHistory,
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3661
|
+
Ui as createWebHistory,
|
|
3662
|
+
Wi as deleteContextValue,
|
|
3663
|
+
Ni as destroyState,
|
|
3653
3664
|
q as extend,
|
|
3654
3665
|
zr as injectContextValue,
|
|
3655
3666
|
ht as injectLifecycleContext,
|
|
3656
3667
|
sr as isArray,
|
|
3657
|
-
|
|
3668
|
+
ki as isDate,
|
|
3658
3669
|
Zt as isESModule,
|
|
3659
3670
|
nr as isEqual,
|
|
3660
3671
|
b as isFunction,
|
|
3661
|
-
|
|
3672
|
+
Ki as isMap,
|
|
3662
3673
|
Ue as isNil,
|
|
3663
3674
|
ps as isObject,
|
|
3664
3675
|
ws as isPlainObject,
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3676
|
+
Li as isPromise,
|
|
3677
|
+
ji as isSet,
|
|
3678
|
+
Ti as isString,
|
|
3679
|
+
Mi as isSymbol,
|
|
3680
|
+
en as onAfterRouteUpdate,
|
|
3681
|
+
Yi as onBeforeRouteUpdate,
|
|
3682
|
+
zi as onFoxActivated,
|
|
3683
|
+
Ji as onFoxInactivated,
|
|
3684
|
+
Vi as provideContextValue,
|
|
3685
|
+
Di as rawState,
|
|
3686
|
+
Oi as reactiveState,
|
|
3687
|
+
Hi as shallowReactiveState,
|
|
3677
3688
|
Tr as toBoolean,
|
|
3678
|
-
|
|
3689
|
+
Ii as toNumber,
|
|
3679
3690
|
Qt as toTypeString,
|
|
3680
3691
|
ir as typeOf,
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3692
|
+
Qi as useBus,
|
|
3693
|
+
Zi as useEventProxy,
|
|
3694
|
+
Xi as useFox,
|
|
3695
|
+
qi as useRoute,
|
|
3685
3696
|
ls as useRouter,
|
|
3686
|
-
|
|
3697
|
+
Gs as withLifecycleContext
|
|
3687
3698
|
};
|