@fox-js/fox 3.1.1-3 → 3.1.1-4
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 +2 -2
- package/libs/index.esm.d.ts +6 -45
- package/libs/index.esm.js +448 -431
- package/libs/index.umd.js +3 -3
- package/package.json +1 -1
package/libs/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as ss, shallowReactive as ns, reactive as is, effectScope as os, watch as ls, toRaw as Ot, getCurrentInstance as Dt, onUnmounted as ut, shallowRef as as, defineComponent as Sr, inject as Q, provide as se, h as he } from "vue";
|
|
2
2
|
/*!
|
|
3
|
-
* fox v3.1.0
|
|
3
|
+
* fox v3.1.0 Mon May 27 2024 00:54:44 GMT+0800 (中国标准时间)
|
|
4
4
|
*/
|
|
5
5
|
const me = typeof window < "u", _ = function() {
|
|
6
6
|
return window;
|
|
@@ -11,16 +11,16 @@ function us(s) {
|
|
|
11
11
|
let e = s, t = e.lastIndexOf("/");
|
|
12
12
|
return t > 0 && t < e.length - 1 ? e = e.substring(0, t + 1) : t === 0 && e.indexOf(".") !== -1 ? e = "/" : t === -1 && (e.indexOf(".") == -1 ? e = `/${e}/` : e = "/"), e.indexOf("/") !== 0 && (e = `/${e}`), e;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function mt() {
|
|
15
15
|
if (!me)
|
|
16
16
|
return "/";
|
|
17
17
|
let s = _().location, e = `${s.protocol}//${s.host}`;
|
|
18
18
|
return e += us(s.pathname), e;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function it(s, e, t, r = !1) {
|
|
21
21
|
s.addEventListener ? s.addEventListener(e, t, r) : s.attachEvent ? s.attachEvent(`on${e}`, t) : s[`on${e}`] = t;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function kt(s, e, t) {
|
|
24
24
|
s.removeEventListener ? s.removeEventListener(e, t) : s.detachEvent ? s.detachEvent(`on${e}`, t) : s[`on${e}`] = null;
|
|
25
25
|
}
|
|
26
26
|
const Ue = (s, e, t) => {
|
|
@@ -34,8 +34,8 @@ const Ue = (s, e, t) => {
|
|
|
34
34
|
for (let a in e)
|
|
35
35
|
a === "bubbles" ? n = !!e[a] : a === "cancelable" ? i = !!e[a] : r[a] = e[a];
|
|
36
36
|
r.initEvent(s, n, i), (t ?? document).dispatchEvent(r);
|
|
37
|
-
}, Cn = Array.isArray, Fn = (s) => Ut(s) === "[object Map]", An = (s) => Ut(s) === "[object Set]", _n = (s) => s instanceof Date, x = (s) => typeof s == "function", Tn = (s) => typeof s == "string", Kn = (s) => typeof s == "symbol", fs = (s) => s !== null && typeof s == "object", $n = (s) => fs(s) && x(s.then) && x(s.catch),
|
|
38
|
-
function
|
|
37
|
+
}, Cn = Array.isArray, Fn = (s) => Ut(s) === "[object Map]", An = (s) => Ut(s) === "[object Set]", _n = (s) => s instanceof Date, x = (s) => typeof s == "function", Tn = (s) => typeof s == "string", Kn = (s) => typeof s == "symbol", fs = (s) => s !== null && typeof s == "object", $n = (s) => fs(s) && x(s.then) && x(s.catch), ft = (s) => s == null, cs = Object.prototype.toString, Ut = (s) => cs.call(s), hs = (s) => Ut(s) === "[object Object]", ys = typeof Symbol == "function" && typeof Symbol.toStringTag == "symbol";
|
|
38
|
+
function Pr(s) {
|
|
39
39
|
return s.__esModule || ys && s[Symbol.toStringTag] === "Module";
|
|
40
40
|
}
|
|
41
41
|
const ds = typeof Promise < "u" && Promise.toString().indexOf("[native code]") !== -1;
|
|
@@ -92,15 +92,15 @@ class le {
|
|
|
92
92
|
return e >= Number.MAX_VALUE && (le.seed = 0), e;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
const
|
|
95
|
+
const pt = ds ? Promise.resolve() : null;
|
|
96
96
|
function Ne(s, ...e) {
|
|
97
|
-
|
|
97
|
+
pt !== null ? e && e.length > 0 ? pt.then(() => {
|
|
98
98
|
s(e);
|
|
99
|
-
}) :
|
|
99
|
+
}) : pt.then(s) : e && e.length > 0 ? setTimeout(() => {
|
|
100
100
|
s(e);
|
|
101
101
|
}) : setTimeout(s);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function Er(s) {
|
|
104
104
|
return s == null ? !1 : typeof s == "boolean" ? s : typeof s == "string" ? s.toLocaleLowerCase() === "true" : !!s;
|
|
105
105
|
}
|
|
106
106
|
function qn(s) {
|
|
@@ -150,18 +150,18 @@ function Yt(s, e) {
|
|
|
150
150
|
}
|
|
151
151
|
return !1;
|
|
152
152
|
}
|
|
153
|
-
const
|
|
153
|
+
const Cr = (s) => {
|
|
154
154
|
const e = {};
|
|
155
155
|
for (let t of Reflect.ownKeys(s)) {
|
|
156
156
|
let r = s[t];
|
|
157
|
-
r && !Array.isArray(r) && typeof r == "object" && (r =
|
|
157
|
+
r && !Array.isArray(r) && typeof r == "object" && (r = Cr(r)), typeof t == "symbol" ? e[String(t)] = r : e[t] = r;
|
|
158
158
|
}
|
|
159
159
|
return e;
|
|
160
|
-
}, ps = /^Symbol\((.*)\)$/,
|
|
160
|
+
}, ps = /^Symbol\((.*)\)$/, Fr = (s) => {
|
|
161
161
|
const e = {};
|
|
162
162
|
for (let t of Reflect.ownKeys(s)) {
|
|
163
163
|
let r = s[t];
|
|
164
|
-
r && !Array.isArray(r) && typeof r == "object" && (r =
|
|
164
|
+
r && !Array.isArray(r) && typeof r == "object" && (r = Fr(r));
|
|
165
165
|
const n = ps.exec(t);
|
|
166
166
|
if (n && n[1]) {
|
|
167
167
|
const i = Symbol.for(n[1]);
|
|
@@ -171,7 +171,7 @@ const Fr = (s) => {
|
|
|
171
171
|
}
|
|
172
172
|
return e;
|
|
173
173
|
};
|
|
174
|
-
function
|
|
174
|
+
function Ar(s, e) {
|
|
175
175
|
let t = null;
|
|
176
176
|
return function(...r) {
|
|
177
177
|
t && clearTimeout(t), t = setTimeout(() => {
|
|
@@ -180,7 +180,7 @@ function _r(s, e) {
|
|
|
180
180
|
};
|
|
181
181
|
}
|
|
182
182
|
const Zt = Symbol("idKey"), pe = Symbol("valueKey"), R = Symbol("childrenKey"), X = Symbol("growKey");
|
|
183
|
-
class
|
|
183
|
+
class _r {
|
|
184
184
|
/**
|
|
185
185
|
* 自动创建解决策略
|
|
186
186
|
*/
|
|
@@ -192,7 +192,7 @@ class Tr {
|
|
|
192
192
|
/**
|
|
193
193
|
* value
|
|
194
194
|
*/
|
|
195
|
-
[pe] =
|
|
195
|
+
[pe] = ss();
|
|
196
196
|
/**
|
|
197
197
|
* children
|
|
198
198
|
*/
|
|
@@ -205,7 +205,7 @@ class Tr {
|
|
|
205
205
|
this[Zt] = e;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
class
|
|
208
|
+
class gs {
|
|
209
209
|
/**
|
|
210
210
|
* 拦截get操作
|
|
211
211
|
* @param target
|
|
@@ -218,9 +218,9 @@ class vs {
|
|
|
218
218
|
return e[X];
|
|
219
219
|
let r = e[R].get(t);
|
|
220
220
|
if (r)
|
|
221
|
-
return
|
|
221
|
+
return De(r);
|
|
222
222
|
if (e[X])
|
|
223
|
-
return r = Wt(t), r[X] = e[X], e[R].set(t, r),
|
|
223
|
+
return r = Wt(t), r[X] = e[X], e[R].set(t, r), De(r);
|
|
224
224
|
}
|
|
225
225
|
/**
|
|
226
226
|
* 拦截set操作
|
|
@@ -230,7 +230,7 @@ class vs {
|
|
|
230
230
|
* @returns
|
|
231
231
|
*/
|
|
232
232
|
set(e, t, r) {
|
|
233
|
-
return t == "value" ? (e[pe].value = r, !0) : t === "grow" ? (e[X] =
|
|
233
|
+
return t == "value" ? (e[pe].value = r, !0) : t === "grow" ? (e[X] = Er(r), !0) : r == null ? (e[R].delete(t), !0) : (console.error(`illegal property:${t}`), !1);
|
|
234
234
|
}
|
|
235
235
|
/**
|
|
236
236
|
* 拦截删除property属性
|
|
@@ -244,13 +244,13 @@ class vs {
|
|
|
244
244
|
}
|
|
245
245
|
const Vt = "__proxy__";
|
|
246
246
|
function Wt(s) {
|
|
247
|
-
const e = new
|
|
248
|
-
return Reflect.set(e, Vt, new Proxy(e, new
|
|
247
|
+
const e = new _r(s);
|
|
248
|
+
return Reflect.set(e, Vt, new Proxy(e, new gs())), e;
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function De(s) {
|
|
251
251
|
return Reflect.get(s, Vt);
|
|
252
252
|
}
|
|
253
|
-
let
|
|
253
|
+
let vs = class {
|
|
254
254
|
/**
|
|
255
255
|
* 名称
|
|
256
256
|
*/
|
|
@@ -278,7 +278,7 @@ let gs = class {
|
|
|
278
278
|
* @param defaultValue
|
|
279
279
|
*/
|
|
280
280
|
constructor(e = {}, t) {
|
|
281
|
-
if (e.persistPolicy && e.persistPolicy !== "memory" &&
|
|
281
|
+
if (e.persistPolicy && e.persistPolicy !== "memory" && ft(e.name))
|
|
282
282
|
throw new Error("name can not be empty, where persistPolicy is not memory.");
|
|
283
283
|
this.name = e.name ?? "", this.persistPolicy = e.persistPolicy ?? "memory", this.storage = e.storage, t && typeof t == "object" && Object.assign(this.state, t);
|
|
284
284
|
}
|
|
@@ -389,7 +389,7 @@ let gs = class {
|
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
391
|
};
|
|
392
|
-
class
|
|
392
|
+
class Tr extends _r {
|
|
393
393
|
/**
|
|
394
394
|
* 持久化处理器
|
|
395
395
|
*/
|
|
@@ -398,7 +398,7 @@ class Kr extends Tr {
|
|
|
398
398
|
* 默认构造函数
|
|
399
399
|
*/
|
|
400
400
|
constructor(e = {}, t) {
|
|
401
|
-
super("__root__"), this._persistHandler = new
|
|
401
|
+
super("__root__"), this._persistHandler = new vs(e, t), this._persistHandler.init(this);
|
|
402
402
|
}
|
|
403
403
|
/**
|
|
404
404
|
* 加入数据
|
|
@@ -504,9 +504,9 @@ class bs {
|
|
|
504
504
|
const r = String(t);
|
|
505
505
|
let n = e[R].get(r);
|
|
506
506
|
if (n)
|
|
507
|
-
return
|
|
507
|
+
return De(n);
|
|
508
508
|
if (e[X])
|
|
509
|
-
return n = Wt(r), n[X] = e[X], e[R].set(r, n),
|
|
509
|
+
return n = Wt(r), n[X] = e[X], e[R].set(r, n), De(n);
|
|
510
510
|
}
|
|
511
511
|
/**
|
|
512
512
|
* 拦截set操作
|
|
@@ -516,7 +516,7 @@ class bs {
|
|
|
516
516
|
* @returns
|
|
517
517
|
*/
|
|
518
518
|
set(e, t, r) {
|
|
519
|
-
return t == "value" ? (e[pe].value = r, !0) : t === "grow" ? (e[X] =
|
|
519
|
+
return t == "value" ? (e[pe].value = r, !0) : t === "grow" ? (e[X] = Er(r), !0) : er(t) ? !1 : r == null ? (e[R].delete(t), !0) : (console.error(`illegal property:${t}`), !1);
|
|
520
520
|
}
|
|
521
521
|
/**
|
|
522
522
|
* 拦截删除property属性
|
|
@@ -529,10 +529,10 @@ class bs {
|
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
531
|
function xs(s, e) {
|
|
532
|
-
const t = new
|
|
532
|
+
const t = new Tr(s, e), r = new bs(), n = new Proxy(t, r);
|
|
533
533
|
return Reflect.set(t, Vt, n), t;
|
|
534
534
|
}
|
|
535
|
-
const tr = new Proxy(
|
|
535
|
+
const tr = new Proxy(Tr, {
|
|
536
536
|
/**
|
|
537
537
|
* 拦截构造函数
|
|
538
538
|
* @param target
|
|
@@ -541,10 +541,10 @@ const tr = new Proxy(Kr, {
|
|
|
541
541
|
*/
|
|
542
542
|
construct(s, e) {
|
|
543
543
|
const t = e[0] ?? {}, r = e[1], n = xs(t, r);
|
|
544
|
-
return
|
|
544
|
+
return De(n);
|
|
545
545
|
}
|
|
546
546
|
}), zt = (s) => !s || typeof s != "object" ? !0 : Reflect.ownKeys(s).length === 0;
|
|
547
|
-
class
|
|
547
|
+
class Kr {
|
|
548
548
|
/**
|
|
549
549
|
* 名称
|
|
550
550
|
*/
|
|
@@ -564,7 +564,7 @@ class $r {
|
|
|
564
564
|
* @param defaultValue
|
|
565
565
|
*/
|
|
566
566
|
constructor(e = {}) {
|
|
567
|
-
if (e.persistPolicy && e.persistPolicy !== "memory" &&
|
|
567
|
+
if (e.persistPolicy && e.persistPolicy !== "memory" && ft(e.name))
|
|
568
568
|
throw new Error("name can not be empty, where persistPolicy is not memory.");
|
|
569
569
|
this.name = e.name ?? "", this.persistPolicy = e.persistPolicy ?? "memory", this.storage = e.storage;
|
|
570
570
|
}
|
|
@@ -624,14 +624,14 @@ class $r {
|
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
function
|
|
628
|
-
const r = new
|
|
627
|
+
function $r(s, e, t) {
|
|
628
|
+
const r = new Kr(t);
|
|
629
629
|
r.restore(e);
|
|
630
630
|
const n = (l) => {
|
|
631
|
-
const u =
|
|
631
|
+
const u = Ot(l), f = {};
|
|
632
632
|
for (let c in u) {
|
|
633
633
|
const h = u[c];
|
|
634
|
-
|
|
634
|
+
ft(h) || (f[c] = h);
|
|
635
635
|
}
|
|
636
636
|
zt(f) ? r.removeState() : r.saveState(f);
|
|
637
637
|
};
|
|
@@ -640,30 +640,30 @@ function qr(s, e, t) {
|
|
|
640
640
|
i = n;
|
|
641
641
|
else {
|
|
642
642
|
const l = t && t.debounceDelay ? t.debounceDelay : 250;
|
|
643
|
-
i =
|
|
643
|
+
i = Ar(n, l);
|
|
644
644
|
}
|
|
645
645
|
const o = s ? ns(e) : is(e);
|
|
646
|
-
return os().run(() => {
|
|
646
|
+
return os(!0).run(() => {
|
|
647
647
|
ls(o, (l) => {
|
|
648
|
-
const u =
|
|
648
|
+
const u = Ot(l);
|
|
649
649
|
i(u);
|
|
650
650
|
});
|
|
651
651
|
}), o;
|
|
652
652
|
}
|
|
653
653
|
function Ln(s, e) {
|
|
654
|
-
return
|
|
654
|
+
return $r(!1, s, e);
|
|
655
655
|
}
|
|
656
656
|
function On(s, e) {
|
|
657
|
-
return
|
|
657
|
+
return $r(!0, s, e);
|
|
658
658
|
}
|
|
659
659
|
function Rs(s, e) {
|
|
660
|
-
const t = new
|
|
660
|
+
const t = new Kr(e);
|
|
661
661
|
t.restore(s);
|
|
662
662
|
const r = (a) => {
|
|
663
|
-
const l =
|
|
663
|
+
const l = Ot(a), u = {};
|
|
664
664
|
for (let f in l) {
|
|
665
665
|
const c = l[f];
|
|
666
|
-
|
|
666
|
+
ft(c) || (u[f] = c);
|
|
667
667
|
}
|
|
668
668
|
zt(u) ? t.removeState() : t.saveState(u);
|
|
669
669
|
};
|
|
@@ -672,7 +672,7 @@ function Rs(s, e) {
|
|
|
672
672
|
n = r;
|
|
673
673
|
else {
|
|
674
674
|
const a = e && e.debounceDelay ? e.debounceDelay : 250;
|
|
675
|
-
n =
|
|
675
|
+
n = Ar(r, a);
|
|
676
676
|
}
|
|
677
677
|
const i = {
|
|
678
678
|
/**
|
|
@@ -699,7 +699,7 @@ function Rs(s, e) {
|
|
|
699
699
|
function Mn(s, e) {
|
|
700
700
|
return Rs(s, e);
|
|
701
701
|
}
|
|
702
|
-
const te = "default",
|
|
702
|
+
const te = "default", qr = Symbol("sync"), H = Symbol("resolveRoute");
|
|
703
703
|
function rr(s) {
|
|
704
704
|
let e = !1;
|
|
705
705
|
return function(...t) {
|
|
@@ -711,7 +711,7 @@ function Ss(s) {
|
|
|
711
711
|
let e = s.src;
|
|
712
712
|
return new Promise((t, r) => {
|
|
713
713
|
const n = rr((a) => {
|
|
714
|
-
|
|
714
|
+
Pr(a) && (a = a.default), s.component = a, console.debug("success load async module"), t();
|
|
715
715
|
}), i = rr((a) => {
|
|
716
716
|
console.debug("reject load async module"), r(a);
|
|
717
717
|
});
|
|
@@ -757,7 +757,7 @@ class Ps {
|
|
|
757
757
|
this.name = e, this.level = t, this.rootName = r, this.rootIndex = n;
|
|
758
758
|
}
|
|
759
759
|
}
|
|
760
|
-
class
|
|
760
|
+
class He {
|
|
761
761
|
/**
|
|
762
762
|
* 目标路由
|
|
763
763
|
*/
|
|
@@ -788,9 +788,17 @@ class ot {
|
|
|
788
788
|
* @returns
|
|
789
789
|
*/
|
|
790
790
|
static from(e) {
|
|
791
|
-
|
|
791
|
+
const t = new He(e.to, e.from), r = e.data ?? {};
|
|
792
792
|
return $(!0, t.data, r), t;
|
|
793
793
|
}
|
|
794
|
+
/**
|
|
795
|
+
* 清空session
|
|
796
|
+
* @param src
|
|
797
|
+
*/
|
|
798
|
+
static clear(e) {
|
|
799
|
+
for (let t in e)
|
|
800
|
+
e[t] = void 0;
|
|
801
|
+
}
|
|
794
802
|
}
|
|
795
803
|
class S {
|
|
796
804
|
/**
|
|
@@ -880,10 +888,6 @@ class S {
|
|
|
880
888
|
* 插槽(用于历史还原)
|
|
881
889
|
*/
|
|
882
890
|
slot;
|
|
883
|
-
/**
|
|
884
|
-
* session(router执行链路session)
|
|
885
|
-
*/
|
|
886
|
-
session;
|
|
887
891
|
/**
|
|
888
892
|
* 克隆
|
|
889
893
|
* @param target
|
|
@@ -1010,8 +1014,8 @@ class gt {
|
|
|
1010
1014
|
layers = [];
|
|
1011
1015
|
}
|
|
1012
1016
|
var q = /* @__PURE__ */ ((s) => (s[s.Push = 0] = "Push", s[s.Replace = 1] = "Replace", s[s.Put = 2] = "Put", s[s.Append = 3] = "Append", s[s.Open = 4] = "Open", s))(q || {});
|
|
1013
|
-
const Cs = "FoxBeforeEnter", Fs = "FoxEnter", As = "FoxLeave", _s = "FoxLeave",
|
|
1014
|
-
class
|
|
1017
|
+
const Cs = "FoxBeforeEnter", Fs = "FoxEnter", As = "FoxLeave", _s = "FoxLeave", Mt = "FoxLeaveEnd", k = Symbol("chainKey"), N = Symbol("cursorKey"), vt = Symbol("$persistentModeKey"), A = Symbol("statusKey"), Z = Symbol("argsKey"), Be = Symbol("exArgsKey"), ve = Symbol("successFnsKey"), Ae = Symbol("errorFnsKey"), ae = Symbol("sessionKey"), ee = Symbol("_go");
|
|
1018
|
+
class ot {
|
|
1015
1019
|
/**
|
|
1016
1020
|
* 事件链路
|
|
1017
1021
|
*/
|
|
@@ -1023,7 +1027,7 @@ class lt {
|
|
|
1023
1027
|
/**
|
|
1024
1028
|
* 是否持久模式(该状态为true的情况,已经执行的任务会继续保存在队列中)
|
|
1025
1029
|
*/
|
|
1026
|
-
[
|
|
1030
|
+
[vt] = !1;
|
|
1027
1031
|
/**
|
|
1028
1032
|
* 状态
|
|
1029
1033
|
*/
|
|
@@ -1061,7 +1065,7 @@ class lt {
|
|
|
1061
1065
|
* @param persistentMode
|
|
1062
1066
|
*/
|
|
1063
1067
|
constructor(e, t = !1) {
|
|
1064
|
-
this[ae] = e, this[
|
|
1068
|
+
this[ae] = e, this[vt] = t;
|
|
1065
1069
|
}
|
|
1066
1070
|
/**
|
|
1067
1071
|
* 触发链路的下一个任务
|
|
@@ -1099,7 +1103,7 @@ class lt {
|
|
|
1099
1103
|
if (this[N] >= this[k].length)
|
|
1100
1104
|
return this[A] = "Free", this;
|
|
1101
1105
|
let n = this[k][this[N]];
|
|
1102
|
-
this[
|
|
1106
|
+
this[vt] || (this[k].splice(0, this[N] + 1), this[N] = -1);
|
|
1103
1107
|
let i = this[N] + 1;
|
|
1104
1108
|
try {
|
|
1105
1109
|
let o = !1, a = {
|
|
@@ -1209,7 +1213,7 @@ class lt {
|
|
|
1209
1213
|
return this[A] == "Reject" || this[A] == "Free" && this[N] >= this[k].length;
|
|
1210
1214
|
}
|
|
1211
1215
|
}
|
|
1212
|
-
const
|
|
1216
|
+
const we = Symbol("registerKey");
|
|
1213
1217
|
class Ts {
|
|
1214
1218
|
/**
|
|
1215
1219
|
* 事件策略
|
|
@@ -1232,7 +1236,7 @@ class nr {
|
|
|
1232
1236
|
/**
|
|
1233
1237
|
* 注册表
|
|
1234
1238
|
*/
|
|
1235
|
-
[
|
|
1239
|
+
[we] = /* @__PURE__ */ new Map();
|
|
1236
1240
|
/**
|
|
1237
1241
|
* 构造函数
|
|
1238
1242
|
*/
|
|
@@ -1246,8 +1250,8 @@ class nr {
|
|
|
1246
1250
|
* @returns
|
|
1247
1251
|
*/
|
|
1248
1252
|
on(e, t, r = !1) {
|
|
1249
|
-
let n = this[
|
|
1250
|
-
n || (n = new Array(), this[
|
|
1253
|
+
let n = this[we].get(e);
|
|
1254
|
+
n || (n = new Array(), this[we].set(e, n));
|
|
1251
1255
|
let i = r === !0 ? 1 : 0, o = new Ts(t, i);
|
|
1252
1256
|
return n.push(o), this;
|
|
1253
1257
|
}
|
|
@@ -1259,8 +1263,8 @@ class nr {
|
|
|
1259
1263
|
*/
|
|
1260
1264
|
off(e, t) {
|
|
1261
1265
|
if (!t)
|
|
1262
|
-
return this[
|
|
1263
|
-
let r = this[
|
|
1266
|
+
return this[we].delete(e), this;
|
|
1267
|
+
let r = this[we].get(e);
|
|
1264
1268
|
if (r) {
|
|
1265
1269
|
for (let n = 0; n < r.length; n++)
|
|
1266
1270
|
if (r[n].callback === t) {
|
|
@@ -1322,7 +1326,7 @@ class nr {
|
|
|
1322
1326
|
* @param value
|
|
1323
1327
|
*/
|
|
1324
1328
|
emit(e, ...t) {
|
|
1325
|
-
let r = this[
|
|
1329
|
+
let r = this[we].get(e);
|
|
1326
1330
|
if (!r)
|
|
1327
1331
|
return this;
|
|
1328
1332
|
for (let n = 0; n < r.length; ) {
|
|
@@ -1393,7 +1397,7 @@ class Ks {
|
|
|
1393
1397
|
}
|
|
1394
1398
|
}
|
|
1395
1399
|
const de = Symbol("lc");
|
|
1396
|
-
function
|
|
1400
|
+
function lt(s, e = !1) {
|
|
1397
1401
|
let t = s;
|
|
1398
1402
|
if (Reflect.has(t, de))
|
|
1399
1403
|
return t[de];
|
|
@@ -1403,17 +1407,17 @@ function at(s, e = !1) {
|
|
|
1403
1407
|
}
|
|
1404
1408
|
return null;
|
|
1405
1409
|
}
|
|
1406
|
-
function
|
|
1410
|
+
function jr(s, e = !1) {
|
|
1407
1411
|
let t = null, r = s;
|
|
1408
1412
|
for (; r && !(Reflect.has(r, de) && (t = r[de], t)); )
|
|
1409
1413
|
r = r.$parent;
|
|
1410
1414
|
if (!t && e) {
|
|
1411
1415
|
const n = s;
|
|
1412
|
-
n && n.$parent && (t =
|
|
1416
|
+
n && n.$parent && (t = lt(n.$parent, e));
|
|
1413
1417
|
}
|
|
1414
1418
|
return t;
|
|
1415
1419
|
}
|
|
1416
|
-
function
|
|
1420
|
+
function Lr(s, e) {
|
|
1417
1421
|
let t = s;
|
|
1418
1422
|
for (; t; ) {
|
|
1419
1423
|
if (Reflect.has(t, de)) {
|
|
@@ -1426,26 +1430,26 @@ function Or(s, e) {
|
|
|
1426
1430
|
return null;
|
|
1427
1431
|
}
|
|
1428
1432
|
function In(s, e, t) {
|
|
1429
|
-
|
|
1433
|
+
jr(s, !0)?.set(e, t);
|
|
1430
1434
|
}
|
|
1431
1435
|
function Nn(s, e) {
|
|
1432
|
-
|
|
1436
|
+
jr(s, !0)?.delete(e);
|
|
1433
1437
|
}
|
|
1434
1438
|
function ir(s) {
|
|
1435
1439
|
if (Array.isArray(s.children) && s.children.length > 0) {
|
|
1436
1440
|
let e = s.children[0];
|
|
1437
1441
|
if (e != null && e.component != null && e.component.proxy != null)
|
|
1438
|
-
return
|
|
1442
|
+
return lt(e.component.proxy, !1);
|
|
1439
1443
|
}
|
|
1440
1444
|
return null;
|
|
1441
1445
|
}
|
|
1442
|
-
const
|
|
1446
|
+
const at = Symbol("hooksKey");
|
|
1443
1447
|
function $s(s) {
|
|
1444
|
-
let e = s.get(
|
|
1445
|
-
e || (e = [], s.set(
|
|
1448
|
+
let e = s.get(at);
|
|
1449
|
+
e || (e = [], s.set(at, e));
|
|
1446
1450
|
}
|
|
1447
1451
|
function or(s, e) {
|
|
1448
|
-
let t = s.get(
|
|
1452
|
+
let t = s.get(at);
|
|
1449
1453
|
if (t != null)
|
|
1450
1454
|
for (let r = t.length - 1; r >= 0; r--) {
|
|
1451
1455
|
let n = t[r];
|
|
@@ -1457,7 +1461,7 @@ function or(s, e) {
|
|
|
1457
1461
|
}
|
|
1458
1462
|
}
|
|
1459
1463
|
}
|
|
1460
|
-
var
|
|
1464
|
+
var It = /* @__PURE__ */ ((s) => (s.DEACTIVATED = "da", s.ACTIVATED = "a", s))(It || {});
|
|
1461
1465
|
class qs {
|
|
1462
1466
|
/**
|
|
1463
1467
|
* 类型
|
|
@@ -1496,44 +1500,44 @@ function Ls(s, e, t, r) {
|
|
|
1496
1500
|
}
|
|
1497
1501
|
return n != -1 ? (s.splice(n, 1), !0) : !1;
|
|
1498
1502
|
}
|
|
1499
|
-
function
|
|
1503
|
+
function Or(s) {
|
|
1500
1504
|
return (e, t) => {
|
|
1501
1505
|
let r;
|
|
1502
1506
|
if (t)
|
|
1503
1507
|
r = t;
|
|
1504
1508
|
else {
|
|
1505
|
-
const i =
|
|
1509
|
+
const i = Dt();
|
|
1506
1510
|
if (i == null || i.proxy == null) {
|
|
1507
1511
|
console.error("can not get current instance or proxy");
|
|
1508
1512
|
return;
|
|
1509
1513
|
}
|
|
1510
1514
|
r = i.proxy;
|
|
1511
1515
|
}
|
|
1512
|
-
const n =
|
|
1516
|
+
const n = Lr(r, at);
|
|
1513
1517
|
if (n == null) {
|
|
1514
1518
|
console.warn("hooks context not found");
|
|
1515
1519
|
return;
|
|
1516
1520
|
}
|
|
1517
|
-
|
|
1521
|
+
ut(() => {
|
|
1518
1522
|
Ls(n, s, e, r);
|
|
1519
1523
|
}), js(n, s, e, r);
|
|
1520
1524
|
};
|
|
1521
1525
|
}
|
|
1522
|
-
const Hn =
|
|
1526
|
+
const Hn = Or(
|
|
1523
1527
|
"a"
|
|
1524
1528
|
/* ACTIVATED */
|
|
1525
|
-
), Dn =
|
|
1529
|
+
), Dn = Or(
|
|
1526
1530
|
"da"
|
|
1527
1531
|
/* DEACTIVATED */
|
|
1528
|
-
),
|
|
1532
|
+
), Mr = Symbol("routeKey");
|
|
1529
1533
|
function lr(s, e) {
|
|
1530
|
-
s.set(
|
|
1534
|
+
s.set(Mr, e);
|
|
1531
1535
|
}
|
|
1532
1536
|
function Jt(s) {
|
|
1533
|
-
let e =
|
|
1537
|
+
let e = Lr(s, Mr);
|
|
1534
1538
|
return typeof e == "function" ? e() : e ?? null;
|
|
1535
1539
|
}
|
|
1536
|
-
const
|
|
1540
|
+
const ct = Symbol("rk"), wt = Symbol("vd"), ar = Symbol("rv"), bt = Symbol("rvi"), ur = Symbol("pv"), xt = Symbol("pvi");
|
|
1537
1541
|
function Os(s) {
|
|
1538
1542
|
for (var e = [], t = 0; t < s.length; ) {
|
|
1539
1543
|
var r = s[t];
|
|
@@ -1602,7 +1606,7 @@ function Os(s) {
|
|
|
1602
1606
|
}
|
|
1603
1607
|
return e.push({ type: "END", index: t, value: "" }), e;
|
|
1604
1608
|
}
|
|
1605
|
-
function
|
|
1609
|
+
function Ir(s, e) {
|
|
1606
1610
|
e === void 0 && (e = {});
|
|
1607
1611
|
for (var t = Os(s), r = e.prefixes, n = r === void 0 ? "./" : r, i = "[^".concat(Se(e.delimiter || "/#?"), "]+?"), o = [], a = 0, l = 0, u = "", f = function(F) {
|
|
1608
1612
|
if (l < t.length && t[l].type === F)
|
|
@@ -1630,14 +1634,14 @@ function Nr(s, e) {
|
|
|
1630
1634
|
});
|
|
1631
1635
|
continue;
|
|
1632
1636
|
}
|
|
1633
|
-
var
|
|
1634
|
-
if (
|
|
1635
|
-
u +=
|
|
1637
|
+
var g = y || f("ESCAPED_CHAR");
|
|
1638
|
+
if (g) {
|
|
1639
|
+
u += g;
|
|
1636
1640
|
continue;
|
|
1637
1641
|
}
|
|
1638
1642
|
u && (o.push(u), u = "");
|
|
1639
|
-
var
|
|
1640
|
-
if (
|
|
1643
|
+
var v = f("OPEN");
|
|
1644
|
+
if (v) {
|
|
1641
1645
|
var m = h(), T = f("NAME") || "", b = f("PATTERN") || "", K = h();
|
|
1642
1646
|
c("CLOSE"), o.push({
|
|
1643
1647
|
name: T || (b ? a++ : ""),
|
|
@@ -1653,7 +1657,7 @@ function Nr(s, e) {
|
|
|
1653
1657
|
return o;
|
|
1654
1658
|
}
|
|
1655
1659
|
function Ms(s, e) {
|
|
1656
|
-
return Is(
|
|
1660
|
+
return Is(Ir(s, e), e);
|
|
1657
1661
|
}
|
|
1658
1662
|
function Is(s, e) {
|
|
1659
1663
|
e === void 0 && (e = {});
|
|
@@ -1695,15 +1699,15 @@ function Is(s, e) {
|
|
|
1695
1699
|
continue;
|
|
1696
1700
|
}
|
|
1697
1701
|
if (!y) {
|
|
1698
|
-
var
|
|
1699
|
-
throw new TypeError('Expected "'.concat(c.name, '" to be ').concat(
|
|
1702
|
+
var g = d ? "an array" : "a string";
|
|
1703
|
+
throw new TypeError('Expected "'.concat(c.name, '" to be ').concat(g));
|
|
1700
1704
|
}
|
|
1701
1705
|
}
|
|
1702
1706
|
return u;
|
|
1703
1707
|
};
|
|
1704
1708
|
}
|
|
1705
1709
|
function Ns(s, e) {
|
|
1706
|
-
var t = [], r =
|
|
1710
|
+
var t = [], r = Nr(s, t, e);
|
|
1707
1711
|
return Hs(r, t, e);
|
|
1708
1712
|
}
|
|
1709
1713
|
function Hs(s, e, t) {
|
|
@@ -1749,49 +1753,49 @@ function Ds(s, e) {
|
|
|
1749
1753
|
}
|
|
1750
1754
|
function ks(s, e, t) {
|
|
1751
1755
|
var r = s.map(function(n) {
|
|
1752
|
-
return
|
|
1756
|
+
return Nr(n, e, t).source;
|
|
1753
1757
|
});
|
|
1754
1758
|
return new RegExp("(?:".concat(r.join("|"), ")"), Gt(t));
|
|
1755
1759
|
}
|
|
1756
1760
|
function Us(s, e, t) {
|
|
1757
|
-
return Bs(
|
|
1761
|
+
return Bs(Ir(s, t), e, t);
|
|
1758
1762
|
}
|
|
1759
1763
|
function Bs(s, e, t) {
|
|
1760
1764
|
t === void 0 && (t = {});
|
|
1761
1765
|
for (var r = t.strict, n = r === void 0 ? !1 : r, i = t.start, o = i === void 0 ? !0 : i, a = t.end, l = a === void 0 ? !0 : a, u = t.encode, f = u === void 0 ? function(M) {
|
|
1762
1766
|
return M;
|
|
1763
|
-
} : u, c = t.delimiter, h = c === void 0 ? "/#?" : c, y = t.endsWith, d = y === void 0 ? "" : y, p = "[".concat(Se(d), "]|$"), m = "[".concat(Se(h), "]"),
|
|
1764
|
-
var b = T[
|
|
1767
|
+
} : u, c = t.delimiter, h = c === void 0 ? "/#?" : c, y = t.endsWith, d = y === void 0 ? "" : y, p = "[".concat(Se(d), "]|$"), m = "[".concat(Se(h), "]"), g = o ? "^" : "", v = 0, T = s; v < T.length; v++) {
|
|
1768
|
+
var b = T[v];
|
|
1765
1769
|
if (typeof b == "string")
|
|
1766
|
-
|
|
1770
|
+
g += Se(f(b));
|
|
1767
1771
|
else {
|
|
1768
1772
|
var K = Se(f(b.prefix)), F = Se(f(b.suffix));
|
|
1769
1773
|
if (b.pattern)
|
|
1770
1774
|
if (e && e.push(b), K || F)
|
|
1771
1775
|
if (b.modifier === "+" || b.modifier === "*") {
|
|
1772
1776
|
var P = b.modifier === "*" ? "?" : "";
|
|
1773
|
-
|
|
1777
|
+
g += "(?:".concat(K, "((?:").concat(b.pattern, ")(?:").concat(F).concat(K, "(?:").concat(b.pattern, "))*)").concat(F, ")").concat(P);
|
|
1774
1778
|
} else
|
|
1775
|
-
|
|
1779
|
+
g += "(?:".concat(K, "(").concat(b.pattern, ")").concat(F, ")").concat(b.modifier);
|
|
1776
1780
|
else
|
|
1777
|
-
b.modifier === "+" || b.modifier === "*" ?
|
|
1781
|
+
b.modifier === "+" || b.modifier === "*" ? g += "((?:".concat(b.pattern, ")").concat(b.modifier, ")") : g += "(".concat(b.pattern, ")").concat(b.modifier);
|
|
1778
1782
|
else
|
|
1779
|
-
|
|
1783
|
+
g += "(?:".concat(K).concat(F, ")").concat(b.modifier);
|
|
1780
1784
|
}
|
|
1781
1785
|
}
|
|
1782
1786
|
if (l)
|
|
1783
|
-
n || (
|
|
1787
|
+
n || (g += "".concat(m, "?")), g += t.endsWith ? "(?=".concat(p, ")") : "$";
|
|
1784
1788
|
else {
|
|
1785
1789
|
var E = s[s.length - 1], W = typeof E == "string" ? m.indexOf(E[E.length - 1]) > -1 : E === void 0;
|
|
1786
|
-
n || (
|
|
1790
|
+
n || (g += "(?:".concat(m, "(?=").concat(p, "))?")), W || (g += "(?=".concat(m, "|").concat(p, ")"));
|
|
1787
1791
|
}
|
|
1788
|
-
return new RegExp(
|
|
1792
|
+
return new RegExp(g, Gt(t));
|
|
1789
1793
|
}
|
|
1790
|
-
function
|
|
1794
|
+
function Nr(s, e, t) {
|
|
1791
1795
|
return s instanceof RegExp ? Ds(s, e) : Array.isArray(s) ? ks(s, e, t) : Us(s, e, t);
|
|
1792
1796
|
}
|
|
1793
|
-
var
|
|
1794
|
-
const G = Symbol("rootKey"), J = Symbol("rootNodeKey"), ye = Symbol("parentNodeKey"),
|
|
1797
|
+
var rt = /* @__PURE__ */ ((s) => (s[s.Part = 0] = "Part", s[s.All = 1] = "All", s))(rt || {});
|
|
1798
|
+
const G = Symbol("rootKey"), J = Symbol("rootNodeKey"), ye = Symbol("parentNodeKey"), st = Symbol("nameKey");
|
|
1795
1799
|
class ne {
|
|
1796
1800
|
/**
|
|
1797
1801
|
* 实例
|
|
@@ -1844,7 +1848,7 @@ class Te {
|
|
|
1844
1848
|
/**
|
|
1845
1849
|
* name
|
|
1846
1850
|
*/
|
|
1847
|
-
[
|
|
1851
|
+
[st];
|
|
1848
1852
|
/**
|
|
1849
1853
|
* 是否分支根节点标志(true/false)
|
|
1850
1854
|
*/
|
|
@@ -1861,7 +1865,7 @@ class Te {
|
|
|
1861
1865
|
* 名称
|
|
1862
1866
|
*/
|
|
1863
1867
|
get name() {
|
|
1864
|
-
return this[
|
|
1868
|
+
return this[st];
|
|
1865
1869
|
}
|
|
1866
1870
|
/**
|
|
1867
1871
|
* 构造函数
|
|
@@ -1870,7 +1874,7 @@ class Te {
|
|
|
1870
1874
|
* @param rootNodeRef
|
|
1871
1875
|
*/
|
|
1872
1876
|
constructor(e, t, r) {
|
|
1873
|
-
this[
|
|
1877
|
+
this[st] = e, this[G] = t, r && (this[J] = r);
|
|
1874
1878
|
}
|
|
1875
1879
|
}
|
|
1876
1880
|
class U {
|
|
@@ -1909,7 +1913,7 @@ class U {
|
|
|
1909
1913
|
return !1;
|
|
1910
1914
|
}
|
|
1911
1915
|
}
|
|
1912
|
-
class
|
|
1916
|
+
class Rt {
|
|
1913
1917
|
/**
|
|
1914
1918
|
* 节点(view集合)
|
|
1915
1919
|
*/
|
|
@@ -1984,7 +1988,7 @@ class fr {
|
|
|
1984
1988
|
this.currentRoute = e, this.routes = t;
|
|
1985
1989
|
}
|
|
1986
1990
|
}
|
|
1987
|
-
const ue = Symbol("historyChangeConsumerKey"), cr = Symbol("_navigateFirstRoute"), Ve = Symbol("_getRouteMark"),
|
|
1991
|
+
const ue = Symbol("historyChangeConsumerKey"), cr = Symbol("_navigateFirstRoute"), Ve = Symbol("_getRouteMark"), St = Symbol("_getUrlSearch"), Pt = Symbol("_generateLocation"), We = Symbol("_setRouteMarkRecorder"), Ke = Symbol("beforeRestoreFiltersKey"), hr = Symbol("_beforeRestore"), yr = "Symbol(_fox_restore_point)";
|
|
1988
1992
|
function $e(s, ...e) {
|
|
1989
1993
|
return typeof s == "function" ? Reflect.apply(s, null, [...e]) : s;
|
|
1990
1994
|
}
|
|
@@ -1996,7 +2000,7 @@ function dr(s) {
|
|
|
1996
2000
|
const e = s[0];
|
|
1997
2001
|
return !!(Reflect.has(e, "path") && Reflect.has(e, "root"));
|
|
1998
2002
|
}
|
|
1999
|
-
class
|
|
2003
|
+
class Hr {
|
|
2000
2004
|
/**
|
|
2001
2005
|
* 基础路径
|
|
2002
2006
|
*/
|
|
@@ -2087,7 +2091,7 @@ class Dr {
|
|
|
2087
2091
|
} catch {
|
|
2088
2092
|
}
|
|
2089
2093
|
}
|
|
2090
|
-
}),
|
|
2094
|
+
}), it(t, "popstate", this.historyChange), this.firstNavigate && e && this[cr](), Promise.resolve();
|
|
2091
2095
|
}
|
|
2092
2096
|
/**
|
|
2093
2097
|
* 销毁
|
|
@@ -2095,7 +2099,7 @@ class Dr {
|
|
|
2095
2099
|
destroy() {
|
|
2096
2100
|
if (this.historyChange) {
|
|
2097
2101
|
const e = _();
|
|
2098
|
-
|
|
2102
|
+
kt(e, "popstate", this.historyChange);
|
|
2099
2103
|
}
|
|
2100
2104
|
}
|
|
2101
2105
|
/**
|
|
@@ -2141,9 +2145,9 @@ class Dr {
|
|
|
2141
2145
|
try {
|
|
2142
2146
|
const o = JSON.parse(t);
|
|
2143
2147
|
if (o.mark === e && Array.isArray(o.routes) && o.routes.length > 0) {
|
|
2144
|
-
const a = o.routes.filter((l, u) => (l.params = l.params ?
|
|
2148
|
+
const a = o.routes.filter((l, u) => (l.params = l.params ? Fr(l.params) : {}, this[hr](l, u, e, o.routes)));
|
|
2145
2149
|
if (a.length > 0) {
|
|
2146
|
-
const l = this[
|
|
2150
|
+
const l = this[St](), u = a.length - 1;
|
|
2147
2151
|
a[u].query = l || a[u].query, this[Pe](a);
|
|
2148
2152
|
return;
|
|
2149
2153
|
}
|
|
@@ -2154,7 +2158,7 @@ class Dr {
|
|
|
2154
2158
|
let n;
|
|
2155
2159
|
r != -1 ? n = e.substring(r + 1) : n = e;
|
|
2156
2160
|
const i = new S();
|
|
2157
|
-
i.path = n, i.query = this[
|
|
2161
|
+
i.path = n, i.query = this[St](), this[Pe]([i]);
|
|
2158
2162
|
}
|
|
2159
2163
|
/**
|
|
2160
2164
|
* 设置当前route mark的记录
|
|
@@ -2164,7 +2168,7 @@ class Dr {
|
|
|
2164
2168
|
[We](e, t) {
|
|
2165
2169
|
try {
|
|
2166
2170
|
t.forEach((i) => {
|
|
2167
|
-
i.params = i.params ?
|
|
2171
|
+
i.params = i.params ? Cr(i.params) : {};
|
|
2168
2172
|
});
|
|
2169
2173
|
const n = JSON.stringify({
|
|
2170
2174
|
mark: e,
|
|
@@ -2208,7 +2212,7 @@ class Dr {
|
|
|
2208
2212
|
/**
|
|
2209
2213
|
* 获取当前search
|
|
2210
2214
|
*/
|
|
2211
|
-
[
|
|
2215
|
+
[St]() {
|
|
2212
2216
|
let t = _().location.search;
|
|
2213
2217
|
return t.length > 0 && t.indexOf("?") === 0 && (t = t.substring(1)), t;
|
|
2214
2218
|
}
|
|
@@ -2263,8 +2267,8 @@ class Dr {
|
|
|
2263
2267
|
if (h > 0) {
|
|
2264
2268
|
let p = !1;
|
|
2265
2269
|
for (let m = h - 1; m >= 0; m--) {
|
|
2266
|
-
const
|
|
2267
|
-
if (!(
|
|
2270
|
+
const g = S.from(c[m]);
|
|
2271
|
+
if (!(g.traceless === !0 || $e(this.traceless, g)) && S.isSame(g, e)) {
|
|
2268
2272
|
p = !0;
|
|
2269
2273
|
break;
|
|
2270
2274
|
}
|
|
@@ -2293,7 +2297,7 @@ class Dr {
|
|
|
2293
2297
|
* @param record
|
|
2294
2298
|
*/
|
|
2295
2299
|
push(e) {
|
|
2296
|
-
const t = this[
|
|
2300
|
+
const t = this[Pt](e.currentRoute);
|
|
2297
2301
|
e.currentRoute.historyUpdatePolicy !== "traceless" && !$e(this.traceless, e.currentRoute) && _().history.pushState(e.routes, "", t), this.setRouteMark(e);
|
|
2298
2302
|
}
|
|
2299
2303
|
/**
|
|
@@ -2301,14 +2305,14 @@ class Dr {
|
|
|
2301
2305
|
* @param record
|
|
2302
2306
|
*/
|
|
2303
2307
|
replace(e) {
|
|
2304
|
-
const t = this[
|
|
2308
|
+
const t = this[Pt](e.currentRoute);
|
|
2305
2309
|
(e.currentRoute.historyUpdatePolicy !== "traceless" || !$e(this.traceless, e.currentRoute)) && _().history.replaceState(e.routes, "", t), this.setRouteMark(e);
|
|
2306
2310
|
}
|
|
2307
2311
|
/**
|
|
2308
2312
|
* 生成Location
|
|
2309
2313
|
* @param route
|
|
2310
2314
|
*/
|
|
2311
|
-
[
|
|
2315
|
+
[Pt](e) {
|
|
2312
2316
|
const t = _();
|
|
2313
2317
|
let r = "";
|
|
2314
2318
|
if (e.query) {
|
|
@@ -2330,10 +2334,10 @@ class Dr {
|
|
|
2330
2334
|
}
|
|
2331
2335
|
}
|
|
2332
2336
|
function kn(s = !0, e = null, t = "", r = !0, n = !1, i) {
|
|
2333
|
-
return e !== null && (e = _().location.pathname), e && e.endsWith("/") && (e = e.substring(0, e.length - 1)), new
|
|
2337
|
+
return e !== null && (e = _().location.pathname), e && e.endsWith("/") && (e = e.substring(0, e.length - 1)), new Hr("path", e ?? "", t, s, r, n, i);
|
|
2334
2338
|
}
|
|
2335
2339
|
function Js(s = !0, e = "", t = !0, r = !1, n) {
|
|
2336
|
-
return new
|
|
2340
|
+
return new Hr("hash", "", e, s, t, r, n);
|
|
2337
2341
|
}
|
|
2338
2342
|
class Gs {
|
|
2339
2343
|
/**
|
|
@@ -2487,7 +2491,7 @@ class Gs {
|
|
|
2487
2491
|
function Qs(s = "", e = 50) {
|
|
2488
2492
|
return new Gs(s, e);
|
|
2489
2493
|
}
|
|
2490
|
-
const ze = Symbol("_constructRouteModel"), Je = Symbol("_findRouteModel"),
|
|
2494
|
+
const ze = Symbol("_constructRouteModel"), Je = Symbol("_findRouteModel"), Et = Symbol("_findRootView"), mr = Symbol("_getFirstView"), fe = Symbol("_removeView"), pr = Symbol("_buildPage"), gr = Symbol("_resolveComponent"), vr = Symbol("_update"), ie = Symbol("_merge"), Ct = Symbol("_handleHistoryChange"), Ge = Symbol("_handleRouteUpdated"), Qe = Symbol("routeUpdatedCallback"), w = Symbol("currentRoutes"), Xe = Symbol("routeSessionCacheKey"), wr = Symbol("_addRouteRecorder"), qe = Symbol("_removeRouteRecorder"), Ye = Symbol("_cloneRouteRecorder"), L = Symbol("_handleError"), Ze = Symbol("errorCallback"), B = Symbol("registerKey"), et = Symbol("notFoundKey"), Ft = Symbol("notFoundPathKey"), V = Symbol("forestKey"), C = Symbol("historyKey"), je = Symbol("beforeFiltersKey"), Le = Symbol("afterFiltersKey"), Oe = Symbol("destroyFiltersKey"), At = Symbol("propsFilterKey"), be = Symbol("mainDispatcherKey"), _t = Symbol("initKey"), ce = Symbol("readyKey"), Tt = Symbol("readyHandlersKey"), tt = Symbol("_markReady"), br = Symbol("_createNextFn"), Kt = Symbol("_start"), $t = Symbol("_before"), qt = Symbol("_after"), xr = Symbol("_destroy"), jt = Symbol("_load"), Me = Symbol("_unload"), Ie = Symbol("routerGuardKey");
|
|
2491
2495
|
function Xs(s) {
|
|
2492
2496
|
return s.layers.length == 0 || s.layers[0].views.length == 0;
|
|
2493
2497
|
}
|
|
@@ -2512,11 +2516,11 @@ class Zs {
|
|
|
2512
2516
|
/**
|
|
2513
2517
|
* not found route
|
|
2514
2518
|
*/
|
|
2515
|
-
[
|
|
2519
|
+
[et];
|
|
2516
2520
|
/**
|
|
2517
2521
|
* not found route path
|
|
2518
2522
|
*/
|
|
2519
|
-
[
|
|
2523
|
+
[Ft] = "*";
|
|
2520
2524
|
/**
|
|
2521
2525
|
* ready
|
|
2522
2526
|
*/
|
|
@@ -2524,7 +2528,7 @@ class Zs {
|
|
|
2524
2528
|
/**
|
|
2525
2529
|
* ready handlers
|
|
2526
2530
|
*/
|
|
2527
|
-
[
|
|
2531
|
+
[Tt] = [];
|
|
2528
2532
|
/**
|
|
2529
2533
|
* 页面根节点
|
|
2530
2534
|
*/
|
|
@@ -2537,10 +2541,14 @@ class Zs {
|
|
|
2537
2541
|
* 当前路由集合
|
|
2538
2542
|
*/
|
|
2539
2543
|
[w] = new Array();
|
|
2544
|
+
/**
|
|
2545
|
+
* route sessin key
|
|
2546
|
+
*/
|
|
2547
|
+
[Xe] = /* @__PURE__ */ new WeakMap();
|
|
2540
2548
|
/**
|
|
2541
2549
|
* 错误回调
|
|
2542
2550
|
*/
|
|
2543
|
-
[
|
|
2551
|
+
[Ze] = null;
|
|
2544
2552
|
/**
|
|
2545
2553
|
* 全局route更新监听器
|
|
2546
2554
|
*/
|
|
@@ -2560,11 +2568,11 @@ class Zs {
|
|
|
2560
2568
|
/**
|
|
2561
2569
|
* 属性传递过滤器
|
|
2562
2570
|
*/
|
|
2563
|
-
[
|
|
2571
|
+
[At] = null;
|
|
2564
2572
|
/**
|
|
2565
2573
|
* 主任务分发器
|
|
2566
2574
|
*/
|
|
2567
|
-
[be] = new
|
|
2575
|
+
[be] = new ot();
|
|
2568
2576
|
/**
|
|
2569
2577
|
* 路由守护者
|
|
2570
2578
|
*/
|
|
@@ -2572,16 +2580,13 @@ class Zs {
|
|
|
2572
2580
|
/**
|
|
2573
2581
|
* 是否初始化
|
|
2574
2582
|
*/
|
|
2575
|
-
[
|
|
2576
|
-
/**
|
|
2577
|
-
* 当前最新路由
|
|
2578
|
-
*/
|
|
2579
|
-
[we] = Sr(null);
|
|
2583
|
+
[_t] = !1;
|
|
2580
2584
|
/**
|
|
2581
2585
|
* 获取当前最新route
|
|
2582
2586
|
*/
|
|
2583
2587
|
get current() {
|
|
2584
|
-
|
|
2588
|
+
const e = this[w].length;
|
|
2589
|
+
return e > 0 ? this[w][e - 1] : null;
|
|
2585
2590
|
}
|
|
2586
2591
|
//属性
|
|
2587
2592
|
options;
|
|
@@ -2597,13 +2602,13 @@ class Zs {
|
|
|
2597
2602
|
try {
|
|
2598
2603
|
if (typeof r == "string") {
|
|
2599
2604
|
const i = this[H](r);
|
|
2600
|
-
i && await this[
|
|
2605
|
+
i && await this[Ct]([i]);
|
|
2601
2606
|
} else
|
|
2602
|
-
await this[
|
|
2607
|
+
await this[Ct](r);
|
|
2603
2608
|
} catch (i) {
|
|
2604
2609
|
console.error(i.message, i), n = !1;
|
|
2605
2610
|
}
|
|
2606
|
-
this[ce] === !1 && this[
|
|
2611
|
+
this[ce] === !1 && this[tt](n);
|
|
2607
2612
|
});
|
|
2608
2613
|
}
|
|
2609
2614
|
/**
|
|
@@ -2611,15 +2616,15 @@ class Zs {
|
|
|
2611
2616
|
* @param error
|
|
2612
2617
|
* @param route
|
|
2613
2618
|
*/
|
|
2614
|
-
[
|
|
2619
|
+
[L](e = "error", t) {
|
|
2615
2620
|
if (t && typeof t.error == "function")
|
|
2616
2621
|
try {
|
|
2617
2622
|
t.error(e);
|
|
2618
2623
|
} catch {
|
|
2619
2624
|
}
|
|
2620
|
-
if (typeof this[
|
|
2625
|
+
if (typeof this[Ze] == "function")
|
|
2621
2626
|
try {
|
|
2622
|
-
this[
|
|
2627
|
+
this[Ze](e, t);
|
|
2623
2628
|
} catch {
|
|
2624
2629
|
}
|
|
2625
2630
|
console.error(e);
|
|
@@ -2628,21 +2633,21 @@ class Zs {
|
|
|
2628
2633
|
* 初始化
|
|
2629
2634
|
*/
|
|
2630
2635
|
init() {
|
|
2631
|
-
this[
|
|
2636
|
+
this[_t] !== !0 && (this[C]?.init(!this[ce]), this[_t] = !0);
|
|
2632
2637
|
}
|
|
2633
2638
|
/**
|
|
2634
2639
|
* 第一次导航是否完成
|
|
2635
2640
|
*/
|
|
2636
2641
|
isReady() {
|
|
2637
2642
|
return this[ce] ? Promise.resolve() : new Promise((e, t) => {
|
|
2638
|
-
this[
|
|
2643
|
+
this[Tt].push([e, t]);
|
|
2639
2644
|
});
|
|
2640
2645
|
}
|
|
2641
2646
|
/**
|
|
2642
2647
|
* 设置第一导航完成
|
|
2643
2648
|
*/
|
|
2644
|
-
[
|
|
2645
|
-
this[ce] = !0, this[
|
|
2649
|
+
[tt](e) {
|
|
2650
|
+
this[ce] = !0, this[Tt].forEach(([t, r]) => {
|
|
2646
2651
|
try {
|
|
2647
2652
|
e ? t() : r();
|
|
2648
2653
|
} catch (n) {
|
|
@@ -2654,7 +2659,7 @@ class Zs {
|
|
|
2654
2659
|
* 处理历史记录
|
|
2655
2660
|
* @param record
|
|
2656
2661
|
*/
|
|
2657
|
-
[
|
|
2662
|
+
[Ct](e) {
|
|
2658
2663
|
try {
|
|
2659
2664
|
if (!e) {
|
|
2660
2665
|
let o = [...this[w]].reverse();
|
|
@@ -2676,7 +2681,7 @@ class Zs {
|
|
|
2676
2681
|
} else
|
|
2677
2682
|
return this.restore(r);
|
|
2678
2683
|
} catch (t) {
|
|
2679
|
-
this[
|
|
2684
|
+
this[L](t);
|
|
2680
2685
|
}
|
|
2681
2686
|
return Promise.resolve();
|
|
2682
2687
|
}
|
|
@@ -2684,16 +2689,10 @@ class Zs {
|
|
|
2684
2689
|
* 处理route updated事件
|
|
2685
2690
|
* @param route
|
|
2686
2691
|
*/
|
|
2687
|
-
[Ge](e) {
|
|
2688
|
-
if (e)
|
|
2689
|
-
this[we].value = e;
|
|
2690
|
-
else {
|
|
2691
|
-
let t = this[w].length;
|
|
2692
|
-
t > 0 ? this[we].value = this[w][t - 1] : this[we].value = null;
|
|
2693
|
-
}
|
|
2694
|
-
if (typeof this[Qe] == "function")
|
|
2692
|
+
[Ge](e = null) {
|
|
2693
|
+
if (e || (e = this.current), typeof this[Qe] == "function")
|
|
2695
2694
|
try {
|
|
2696
|
-
this[Qe](
|
|
2695
|
+
this[Qe](e);
|
|
2697
2696
|
} catch {
|
|
2698
2697
|
}
|
|
2699
2698
|
}
|
|
@@ -2701,29 +2700,30 @@ class Zs {
|
|
|
2701
2700
|
* 加入路由记录
|
|
2702
2701
|
* @param route
|
|
2703
2702
|
*/
|
|
2704
|
-
[wr](e) {
|
|
2703
|
+
[wr](e, t) {
|
|
2705
2704
|
if (e.opsType === q.Open) {
|
|
2706
|
-
let
|
|
2707
|
-
const
|
|
2708
|
-
for (let
|
|
2709
|
-
const
|
|
2710
|
-
if (e.root ==
|
|
2711
|
-
if (e.path ===
|
|
2712
|
-
this[w].splice(
|
|
2705
|
+
let r = !1;
|
|
2706
|
+
const n = this[w].length - 1;
|
|
2707
|
+
for (let i = n; i >= 0; i--) {
|
|
2708
|
+
const o = this[w][i];
|
|
2709
|
+
if (e.root == o.root) {
|
|
2710
|
+
if (e.path === o.path) {
|
|
2711
|
+
this[w].splice(i, 1, e), r = !0;
|
|
2713
2712
|
continue;
|
|
2714
2713
|
}
|
|
2715
|
-
e.active && (
|
|
2714
|
+
e.active && (o.active = !1);
|
|
2716
2715
|
}
|
|
2717
2716
|
}
|
|
2718
|
-
|
|
2717
|
+
r || this[w].push(e);
|
|
2719
2718
|
} else
|
|
2720
2719
|
this[w].push(e);
|
|
2720
|
+
this[Xe].set(e, t);
|
|
2721
2721
|
}
|
|
2722
2722
|
/**
|
|
2723
2723
|
* 克隆路由记录
|
|
2724
2724
|
* @returns
|
|
2725
2725
|
*/
|
|
2726
|
-
[
|
|
2726
|
+
[Ye]() {
|
|
2727
2727
|
let e = [];
|
|
2728
2728
|
for (let t of this[w]) {
|
|
2729
2729
|
let r = S.clone(t, !0);
|
|
@@ -2747,7 +2747,9 @@ class Zs {
|
|
|
2747
2747
|
}
|
|
2748
2748
|
if (t != -1) {
|
|
2749
2749
|
let r = this[w][t];
|
|
2750
|
-
this[w].splice(t, 1)
|
|
2750
|
+
this[w].splice(t, 1);
|
|
2751
|
+
const n = this[Xe].get(r);
|
|
2752
|
+
this[Xe].delete(r), this[xr](r, n);
|
|
2751
2753
|
}
|
|
2752
2754
|
}
|
|
2753
2755
|
/**
|
|
@@ -2778,20 +2780,20 @@ class Zs {
|
|
|
2778
2780
|
* 设置属性传递过滤器
|
|
2779
2781
|
*/
|
|
2780
2782
|
set propsFilter(e) {
|
|
2781
|
-
this[
|
|
2783
|
+
this[At] = e;
|
|
2782
2784
|
}
|
|
2783
2785
|
/**
|
|
2784
2786
|
* 获取属性传递过滤器
|
|
2785
2787
|
*/
|
|
2786
2788
|
get propsFilter() {
|
|
2787
|
-
return this[
|
|
2789
|
+
return this[At];
|
|
2788
2790
|
}
|
|
2789
2791
|
/**
|
|
2790
2792
|
* 设置还原点
|
|
2791
2793
|
*
|
|
2792
2794
|
*/
|
|
2793
2795
|
setRestorePoint() {
|
|
2794
|
-
const e = this[
|
|
2796
|
+
const e = this[Ye]();
|
|
2795
2797
|
this[C]?.setRestorePoint(e);
|
|
2796
2798
|
}
|
|
2797
2799
|
/**
|
|
@@ -2806,7 +2808,7 @@ class Zs {
|
|
|
2806
2808
|
* @param callback
|
|
2807
2809
|
*/
|
|
2808
2810
|
onError(e) {
|
|
2809
|
-
this[
|
|
2811
|
+
this[Ze] = e;
|
|
2810
2812
|
}
|
|
2811
2813
|
/**
|
|
2812
2814
|
* 添加before filter
|
|
@@ -2884,7 +2886,7 @@ class Zs {
|
|
|
2884
2886
|
* @param index
|
|
2885
2887
|
*/
|
|
2886
2888
|
addRoute(e, t = -1) {
|
|
2887
|
-
if (e.path === this[
|
|
2889
|
+
if (e.path === this[Ft]) {
|
|
2888
2890
|
this.setNotFoundRoute(e);
|
|
2889
2891
|
return;
|
|
2890
2892
|
}
|
|
@@ -2930,7 +2932,7 @@ class Zs {
|
|
|
2930
2932
|
* @param path
|
|
2931
2933
|
*/
|
|
2932
2934
|
setNotFoundPath(e) {
|
|
2933
|
-
this[
|
|
2935
|
+
this[Ft] = e;
|
|
2934
2936
|
}
|
|
2935
2937
|
/**
|
|
2936
2938
|
* 配置not found路由配置
|
|
@@ -2938,7 +2940,7 @@ class Zs {
|
|
|
2938
2940
|
*/
|
|
2939
2941
|
setNotFoundRoute(e) {
|
|
2940
2942
|
const t = this[ze](e);
|
|
2941
|
-
this[
|
|
2943
|
+
this[et] = t[0];
|
|
2942
2944
|
}
|
|
2943
2945
|
/**
|
|
2944
2946
|
* 返回目前加载的routes
|
|
@@ -3066,7 +3068,7 @@ class Zs {
|
|
|
3066
3068
|
*/
|
|
3067
3069
|
push(...e) {
|
|
3068
3070
|
const t = this[H](e);
|
|
3069
|
-
return t ? (t.opsType = q.Push, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "push", this.to(t)) : (this[
|
|
3071
|
+
return t ? (t.opsType = q.Push, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "push", this.to(t)) : (this[L]("resolve route fail", t), this);
|
|
3070
3072
|
}
|
|
3071
3073
|
/**
|
|
3072
3074
|
* 路由跳转(operation类型为Put)
|
|
@@ -3074,7 +3076,7 @@ class Zs {
|
|
|
3074
3076
|
*/
|
|
3075
3077
|
put(...e) {
|
|
3076
3078
|
const t = this[H](e);
|
|
3077
|
-
return t ? (t.opsType = q.Put, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "traceless", this.to(t)) : (this[
|
|
3079
|
+
return t ? (t.opsType = q.Put, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "traceless", this.to(t)) : (this[L]("resolve route fail", t), this);
|
|
3078
3080
|
}
|
|
3079
3081
|
/**
|
|
3080
3082
|
* 路由跳转(operation类型为Replace)
|
|
@@ -3082,7 +3084,7 @@ class Zs {
|
|
|
3082
3084
|
*/
|
|
3083
3085
|
replace(...e) {
|
|
3084
3086
|
const t = this[H](e);
|
|
3085
|
-
return t ? (t.opsType = q.Replace, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "replace", this.to(t)) : (this[
|
|
3087
|
+
return t ? (t.opsType = q.Replace, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "replace", this.to(t)) : (this[L]("resolve route fail", t), this);
|
|
3086
3088
|
}
|
|
3087
3089
|
/**
|
|
3088
3090
|
* 路由跳转(operation类型为Append)
|
|
@@ -3090,7 +3092,7 @@ class Zs {
|
|
|
3090
3092
|
*/
|
|
3091
3093
|
append(...e) {
|
|
3092
3094
|
const t = this[H](e);
|
|
3093
|
-
return t ? (t.opsType = q.Append, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "push", this.to(t)) : (this[
|
|
3095
|
+
return t ? (t.opsType = q.Append, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "push", this.to(t)) : (this[L]("resolve route fail", t), this);
|
|
3094
3096
|
}
|
|
3095
3097
|
/**
|
|
3096
3098
|
* 移除
|
|
@@ -3155,7 +3157,7 @@ class Zs {
|
|
|
3155
3157
|
u();
|
|
3156
3158
|
}
|
|
3157
3159
|
} catch (i) {
|
|
3158
|
-
this[
|
|
3160
|
+
this[L](i), n.resolve(), r(!1);
|
|
3159
3161
|
}
|
|
3160
3162
|
});
|
|
3161
3163
|
});
|
|
@@ -3166,7 +3168,7 @@ class Zs {
|
|
|
3166
3168
|
*/
|
|
3167
3169
|
open(...e) {
|
|
3168
3170
|
let t = this[H](e);
|
|
3169
|
-
return t ? (t.opsType = q.Open, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "push", this.to(t)) : (this[
|
|
3171
|
+
return t ? (t.opsType = q.Open, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "push", this.to(t)) : (this[L]("resolve route fail", t), this);
|
|
3170
3172
|
}
|
|
3171
3173
|
/**
|
|
3172
3174
|
* 关闭路由跳转的页面
|
|
@@ -3203,7 +3205,7 @@ class Zs {
|
|
|
3203
3205
|
}
|
|
3204
3206
|
this[Me](n) && this[Ge](), t.resolve();
|
|
3205
3207
|
} catch (r) {
|
|
3206
|
-
this[
|
|
3208
|
+
this[L](r), t.resolve();
|
|
3207
3209
|
}
|
|
3208
3210
|
}), this;
|
|
3209
3211
|
}
|
|
@@ -3214,36 +3216,36 @@ class Zs {
|
|
|
3214
3216
|
to(...e) {
|
|
3215
3217
|
let t = this[H](e);
|
|
3216
3218
|
if (!t)
|
|
3217
|
-
return this[
|
|
3219
|
+
return this[L]("resolve route fail", t), this;
|
|
3218
3220
|
let r = this[Ie].acquire(t);
|
|
3219
|
-
return r == null ? (this[
|
|
3221
|
+
return r == null ? (this[L]("route forbid", t), this) : (this[be].post((n) => {
|
|
3220
3222
|
try {
|
|
3221
|
-
let i = this[
|
|
3222
|
-
this[
|
|
3223
|
+
let i = this[Kt](t);
|
|
3224
|
+
this[$t](i), this[jt](i), this[qt](i), i.wait(
|
|
3223
3225
|
(o, a) => {
|
|
3224
3226
|
const l = o.session.to;
|
|
3225
3227
|
if (o.session.updateResult && o.session.updateResult.status === "success")
|
|
3226
3228
|
try {
|
|
3227
3229
|
let u = S.clone(l, !0);
|
|
3228
|
-
const f = new fr(u, this[
|
|
3230
|
+
const f = new fr(u, this[Ye]());
|
|
3229
3231
|
l.historyUpdatePolicy === "replace" ? this[C]?.replace(f) : l.historyUpdatePolicy === "traceless" ? this[C]?.setRouteMark(f) : this[C]?.push(f);
|
|
3230
3232
|
} catch (u) {
|
|
3231
3233
|
console.error(u.message, u);
|
|
3232
3234
|
}
|
|
3233
|
-
if (this[Ie].release(r), this[Ge](l), typeof t.success == "function")
|
|
3235
|
+
if (He.clear(o.session), this[Ie].release(r), this[Ge](l), typeof t.success == "function")
|
|
3234
3236
|
try {
|
|
3235
3237
|
Reflect.apply(t.success, {}, []);
|
|
3236
3238
|
} catch (u) {
|
|
3237
3239
|
console.error(u.message, u);
|
|
3238
3240
|
}
|
|
3239
|
-
this[ce] === !1 && this[
|
|
3241
|
+
this[ce] === !1 && this[tt](!0), i = null, n.resolve();
|
|
3240
3242
|
},
|
|
3241
3243
|
(o, a) => {
|
|
3242
|
-
this[Ie].release(r), a !== null && this[
|
|
3244
|
+
this[Ie].release(r), a !== null && this[L](a, t), this[ce] === !1 && this[tt](!1), n.resolve();
|
|
3243
3245
|
}
|
|
3244
3246
|
);
|
|
3245
3247
|
} catch (i) {
|
|
3246
|
-
this[Ie].release(r), this[
|
|
3248
|
+
this[Ie].release(r), this[L](i, t), n.resolve();
|
|
3247
3249
|
}
|
|
3248
3250
|
}), this);
|
|
3249
3251
|
}
|
|
@@ -3277,20 +3279,20 @@ class Zs {
|
|
|
3277
3279
|
* @param route
|
|
3278
3280
|
* @returns {EventChain}
|
|
3279
3281
|
*/
|
|
3280
|
-
[
|
|
3281
|
-
|
|
3282
|
+
[Kt](e) {
|
|
3283
|
+
const t = this[w].length > 0 ? this[w][0] : void 0, r = new He(e, t), n = {
|
|
3282
3284
|
//路由
|
|
3283
3285
|
route: e,
|
|
3284
3286
|
//查找结果
|
|
3285
3287
|
find: null
|
|
3286
3288
|
};
|
|
3287
|
-
return this[Je](n), n.find && (r.routeModel = n.find, e.matched = Ys(n.find), Array.isArray(e.matched) && e.matched.length > 0 && (e.meta = n.find.layers[0].models[0].meta)), new
|
|
3289
|
+
return this[Je](n), n.find && (r.routeModel = n.find, e.matched = Ys(n.find), Array.isArray(e.matched) && e.matched.length > 0 && (e.meta = n.find.layers[0].models[0].meta)), new ot(r);
|
|
3288
3290
|
}
|
|
3289
3291
|
/**
|
|
3290
3292
|
* 执行before事件
|
|
3291
3293
|
* @param chain
|
|
3292
3294
|
*/
|
|
3293
|
-
[
|
|
3295
|
+
[$t](e) {
|
|
3294
3296
|
for (let t of this[je])
|
|
3295
3297
|
e.post((r) => {
|
|
3296
3298
|
const n = this[br](r);
|
|
@@ -3301,7 +3303,7 @@ class Zs {
|
|
|
3301
3303
|
* 执行after事件
|
|
3302
3304
|
* @param chain
|
|
3303
3305
|
*/
|
|
3304
|
-
[
|
|
3306
|
+
[qt](e) {
|
|
3305
3307
|
e.post((t) => {
|
|
3306
3308
|
for (let r of this[Le])
|
|
3307
3309
|
try {
|
|
@@ -3330,9 +3332,10 @@ class Zs {
|
|
|
3330
3332
|
* 加载路由
|
|
3331
3333
|
* @param chain
|
|
3332
3334
|
*/
|
|
3333
|
-
[
|
|
3335
|
+
[jt](e) {
|
|
3334
3336
|
e.post((t) => {
|
|
3335
|
-
|
|
3337
|
+
const r = t.session.to;
|
|
3338
|
+
let n = t.session.routeModel;
|
|
3336
3339
|
if (n == null) {
|
|
3337
3340
|
let o = {
|
|
3338
3341
|
//路由
|
|
@@ -3342,14 +3345,14 @@ class Zs {
|
|
|
3342
3345
|
};
|
|
3343
3346
|
if (this[Je](o))
|
|
3344
3347
|
n = o.find, t.session.routeModel = n;
|
|
3345
|
-
else if (this[
|
|
3346
|
-
n = this[
|
|
3348
|
+
else if (this[et])
|
|
3349
|
+
n = this[et];
|
|
3347
3350
|
else {
|
|
3348
3351
|
t.reject(`not find route model, path:${r.path ?? r.name}`);
|
|
3349
3352
|
return;
|
|
3350
3353
|
}
|
|
3351
3354
|
}
|
|
3352
|
-
|
|
3355
|
+
const i = He.from(t.session);
|
|
3353
3356
|
this[pr](r, n, i).then(
|
|
3354
3357
|
(o) => {
|
|
3355
3358
|
this[V], t.session.updateResult = o ?? {
|
|
@@ -3373,14 +3376,14 @@ class Zs {
|
|
|
3373
3376
|
return !0;
|
|
3374
3377
|
let t = this[V], r = [];
|
|
3375
3378
|
for (let n of e) {
|
|
3376
|
-
let i = this[
|
|
3379
|
+
let i = this[Et](t, n);
|
|
3377
3380
|
i != null && r.push({
|
|
3378
3381
|
...i,
|
|
3379
3382
|
route: n
|
|
3380
3383
|
});
|
|
3381
3384
|
}
|
|
3382
3385
|
if (r.length == 0)
|
|
3383
|
-
return this[
|
|
3386
|
+
return this[L]("can not find view index"), !1;
|
|
3384
3387
|
for (let n of r.reverse())
|
|
3385
3388
|
this[fe](t, { x: n.x, y: n.y }, [n.route.index ?? 0], !0);
|
|
3386
3389
|
return !0;
|
|
@@ -3390,14 +3393,14 @@ class Zs {
|
|
|
3390
3393
|
* @param page
|
|
3391
3394
|
* @param route
|
|
3392
3395
|
*/
|
|
3393
|
-
[
|
|
3396
|
+
[Et](e, t) {
|
|
3394
3397
|
const r = t.root ?? te;
|
|
3395
3398
|
let n;
|
|
3396
3399
|
for (let i = 0; i < e.layers.length; i++) {
|
|
3397
3400
|
const o = e.layers[i];
|
|
3398
3401
|
for (let a = o.views.length - 1; a >= 0; a--) {
|
|
3399
3402
|
const l = o.views[a];
|
|
3400
|
-
if (l[G] && l[
|
|
3403
|
+
if (l[G] && l[st] === r)
|
|
3401
3404
|
return n = { x: a, y: i }, n;
|
|
3402
3405
|
}
|
|
3403
3406
|
}
|
|
@@ -3443,8 +3446,8 @@ class Zs {
|
|
|
3443
3446
|
if (d[ye] && (o || U.include(a, d[ye]))) {
|
|
3444
3447
|
let p = d.slots.value;
|
|
3445
3448
|
for (let m = p.length - 1; m >= 0; m--) {
|
|
3446
|
-
let
|
|
3447
|
-
|
|
3449
|
+
let g = p[m];
|
|
3450
|
+
g.route && d[G] && this[qe](g.route), h.push(new U(d, g.index, f)), p.splice(m, 1);
|
|
3448
3451
|
}
|
|
3449
3452
|
e.layers[f].views.splice(y, 1);
|
|
3450
3453
|
}
|
|
@@ -3472,20 +3475,20 @@ class Zs {
|
|
|
3472
3475
|
for (let a = 0; a < e.length; a++) {
|
|
3473
3476
|
const l = e[a];
|
|
3474
3477
|
this[be].post((u) => {
|
|
3475
|
-
const f = this[
|
|
3476
|
-
this[
|
|
3478
|
+
const f = this[Kt](l);
|
|
3479
|
+
this[$t](f), this[jt](f), this[qt](f), f.wait(
|
|
3477
3480
|
(c, h) => {
|
|
3478
3481
|
i = c.session.to, o = c.session.redirect, u.resolve();
|
|
3479
3482
|
},
|
|
3480
3483
|
(c, h) => {
|
|
3481
|
-
i = null, h !== null && this[
|
|
3484
|
+
i = null, h !== null && this[L](h), u.resolve();
|
|
3482
3485
|
}
|
|
3483
3486
|
);
|
|
3484
3487
|
});
|
|
3485
3488
|
}
|
|
3486
3489
|
this[be].post((a) => {
|
|
3487
3490
|
if (i && o === !0) {
|
|
3488
|
-
const l = S.clone(i, !0), u = new fr(l, this[
|
|
3491
|
+
const l = S.clone(i, !0), u = new fr(l, this[Ye]());
|
|
3489
3492
|
this[C]?.replace(u);
|
|
3490
3493
|
}
|
|
3491
3494
|
a.resolve(), r();
|
|
@@ -3499,9 +3502,9 @@ class Zs {
|
|
|
3499
3502
|
* @returns
|
|
3500
3503
|
*/
|
|
3501
3504
|
[pr](e, t, r) {
|
|
3502
|
-
const n = e.updateType ??
|
|
3503
|
-
return this[
|
|
3504
|
-
const o = this[
|
|
3505
|
+
const n = e.updateType ?? rt.Part;
|
|
3506
|
+
return this[gr](t).then(() => {
|
|
3507
|
+
const o = this[vr](t, e, r, n);
|
|
3505
3508
|
if (o.status === "error")
|
|
3506
3509
|
throw Error(o.message);
|
|
3507
3510
|
return o;
|
|
@@ -3510,7 +3513,7 @@ class Zs {
|
|
|
3510
3513
|
/**
|
|
3511
3514
|
* 解析组件
|
|
3512
3515
|
*/
|
|
3513
|
-
[
|
|
3516
|
+
[gr](e) {
|
|
3514
3517
|
let t = [];
|
|
3515
3518
|
for (let r = 0; r < e.layers.length; r++) {
|
|
3516
3519
|
let n = e.layers[r];
|
|
@@ -3529,7 +3532,7 @@ class Zs {
|
|
|
3529
3532
|
* @param updateType
|
|
3530
3533
|
* @returns
|
|
3531
3534
|
*/
|
|
3532
|
-
[
|
|
3535
|
+
[vr](e, t, r, n) {
|
|
3533
3536
|
if (e.layers[0].models.length !== 1)
|
|
3534
3537
|
return {
|
|
3535
3538
|
status: "error",
|
|
@@ -3537,11 +3540,11 @@ class Zs {
|
|
|
3537
3540
|
};
|
|
3538
3541
|
const i = e.layers[0].models[0];
|
|
3539
3542
|
let o = this[V], a = Xs(o), l = t.root ?? te, u;
|
|
3540
|
-
!a && n ==
|
|
3543
|
+
!a && n == rt.Part && (u = this[Et](o, t));
|
|
3541
3544
|
let f, c = 0;
|
|
3542
3545
|
if (u == null || u == null)
|
|
3543
|
-
if (a || n ===
|
|
3544
|
-
if (o.layers.length == 0 && (o.layers[0] = new
|
|
3546
|
+
if (a || n === rt.All) {
|
|
3547
|
+
if (o.layers.length == 0 && (o.layers[0] = new Rt()), o.layers[0].views.length == 0) {
|
|
3545
3548
|
let h = t.root ?? te;
|
|
3546
3549
|
f = new Te(h, !0, null), o.layers[0].views = [f];
|
|
3547
3550
|
} else
|
|
@@ -3587,8 +3590,8 @@ class Zs {
|
|
|
3587
3590
|
t.index = t.index ?? le.get(), t.active = !0;
|
|
3588
3591
|
let h = f.slots.value;
|
|
3589
3592
|
if (h.length > 0) {
|
|
3590
|
-
let
|
|
3591
|
-
|
|
3593
|
+
let g = h[h.length - 1];
|
|
3594
|
+
g.active = !1, g.route && (g.route.active = g.active);
|
|
3592
3595
|
}
|
|
3593
3596
|
let y = new ne(t, i, t.index, !0);
|
|
3594
3597
|
f.slots.value = [...h, y];
|
|
@@ -3614,8 +3617,8 @@ class Zs {
|
|
|
3614
3617
|
t.index = t.index ?? le.get(), t.active = y;
|
|
3615
3618
|
let p = new ne(t, i, t.index, y);
|
|
3616
3619
|
h.push(p);
|
|
3617
|
-
let m = c + 1,
|
|
3618
|
-
this[ie](o, m, e,
|
|
3620
|
+
let m = c + 1, g = 1, v = new U(f, t.index, c);
|
|
3621
|
+
this[ie](o, m, e, g, v);
|
|
3619
3622
|
}
|
|
3620
3623
|
f.slots.value = [...h];
|
|
3621
3624
|
} else {
|
|
@@ -3639,50 +3642,50 @@ class Zs {
|
|
|
3639
3642
|
for (let K = 1; K < h.length; K++)
|
|
3640
3643
|
m.push(h[K].index);
|
|
3641
3644
|
m.length > 0 ? this[fe](o, u, m, !0) : d && (f.slots.value = [...h]);
|
|
3642
|
-
let
|
|
3643
|
-
for (;
|
|
3645
|
+
let g = [new U(f, t.index, c)], v = c + 1, T = 1, b = new U(f, t.index, c);
|
|
3646
|
+
for (; g.length > 0 && v < o.layers.length && T < e.layers.length; v++, T++) {
|
|
3644
3647
|
let K = [];
|
|
3645
|
-
for (let P = 0; P < o.layers[
|
|
3646
|
-
let E = o.layers[
|
|
3647
|
-
E[ye] && U.include(
|
|
3648
|
+
for (let P = 0; P < o.layers[v].views.length; P++) {
|
|
3649
|
+
let E = o.layers[v].views[P];
|
|
3650
|
+
E[ye] && U.include(g, E[ye]) && K.unshift(P);
|
|
3648
3651
|
}
|
|
3649
3652
|
let F = [];
|
|
3650
3653
|
for (let P of K) {
|
|
3651
|
-
let E = o.layers[
|
|
3654
|
+
let E = o.layers[v].views[P], W = e.layers[T].models, M;
|
|
3652
3655
|
for (let I = 0; I < W.length; I++)
|
|
3653
3656
|
if (E.name === W[I].name) {
|
|
3654
3657
|
M = W[I];
|
|
3655
3658
|
break;
|
|
3656
3659
|
}
|
|
3657
3660
|
if (!M)
|
|
3658
|
-
this[fe](o, { x: P, y:
|
|
3661
|
+
this[fe](o, { x: P, y: v }, null, !1);
|
|
3659
3662
|
else {
|
|
3660
3663
|
let I = E.slots.value;
|
|
3661
3664
|
if (I.length == 0) {
|
|
3662
3665
|
let Y = 0;
|
|
3663
3666
|
E.slots.value = [new ne(null, M, Y)];
|
|
3664
|
-
let z =
|
|
3667
|
+
let z = v + 1, re = T + 1;
|
|
3665
3668
|
this[ie](o, z, e, re, b);
|
|
3666
3669
|
} else {
|
|
3667
3670
|
let Y = I[0];
|
|
3668
3671
|
if (Y.model !== M) {
|
|
3669
|
-
this[fe](o, { x: P, y:
|
|
3670
|
-
let z =
|
|
3672
|
+
this[fe](o, { x: P, y: v }, null, !0), E.slots.value = [new ne(null, M, 0)];
|
|
3673
|
+
let z = v + 1, re = T + 1;
|
|
3671
3674
|
this[ie](o, z, e, re, b);
|
|
3672
3675
|
} else {
|
|
3673
3676
|
E[G] && Y.route !== null && this[qe](Y.route);
|
|
3674
3677
|
let z = [];
|
|
3675
3678
|
for (let re = 1; re < I.length; re++)
|
|
3676
3679
|
z.push(I[re].index);
|
|
3677
|
-
z.length > 0 && this[fe](o, { x: P, y:
|
|
3680
|
+
z.length > 0 && this[fe](o, { x: P, y: v }, z, !0), F.push(new U(E, Y.index, v));
|
|
3678
3681
|
}
|
|
3679
3682
|
}
|
|
3680
3683
|
E[G] = !1;
|
|
3681
3684
|
}
|
|
3682
3685
|
}
|
|
3683
|
-
|
|
3686
|
+
g = F;
|
|
3684
3687
|
}
|
|
3685
|
-
this[ie](o,
|
|
3688
|
+
this[ie](o, v, e, T, b);
|
|
3686
3689
|
}
|
|
3687
3690
|
}
|
|
3688
3691
|
}
|
|
@@ -3690,7 +3693,7 @@ class Zs {
|
|
|
3690
3693
|
let h = f[J];
|
|
3691
3694
|
h && (t.slot = new Ps(l, c, h?.view.name, h?.index ?? 0));
|
|
3692
3695
|
}
|
|
3693
|
-
return r.to = void 0, r.routeModel = void 0,
|
|
3696
|
+
return r.to = void 0, r.routeModel = void 0, this[wr](t, r), {
|
|
3694
3697
|
status: "success",
|
|
3695
3698
|
message: ""
|
|
3696
3699
|
};
|
|
@@ -3713,7 +3716,7 @@ class Zs {
|
|
|
3713
3716
|
}
|
|
3714
3717
|
}
|
|
3715
3718
|
for (; o < r.layers.length; o++) {
|
|
3716
|
-
let l = new
|
|
3719
|
+
let l = new Rt();
|
|
3717
3720
|
l.views = [];
|
|
3718
3721
|
for (let u of r.layers[o].models) {
|
|
3719
3722
|
let f = new Te(u.name, !1, i), c = new ne(null, u);
|
|
@@ -3732,7 +3735,7 @@ class Zs {
|
|
|
3732
3735
|
* @param parentViewIndex
|
|
3733
3736
|
* @returns
|
|
3734
3737
|
*/
|
|
3735
|
-
[
|
|
3738
|
+
[qr](e, t, r, n, i, o) {
|
|
3736
3739
|
if (t < 0 || t > this[V].layers.length)
|
|
3737
3740
|
return null;
|
|
3738
3741
|
if (t < this[V].layers.length) {
|
|
@@ -3763,7 +3766,7 @@ class Zs {
|
|
|
3763
3766
|
});
|
|
3764
3767
|
let u = new Te(e, !0, a);
|
|
3765
3768
|
if (u[ye] = l, t == this[V].layers.length) {
|
|
3766
|
-
let f = new
|
|
3769
|
+
let f = new Rt();
|
|
3767
3770
|
f.views = [u], this[V].layers.push(f);
|
|
3768
3771
|
} else
|
|
3769
3772
|
this[V].layers[t].views.push(u);
|
|
@@ -3771,11 +3774,11 @@ class Zs {
|
|
|
3771
3774
|
}
|
|
3772
3775
|
}
|
|
3773
3776
|
const en = "fox-router-view", tn = "fox-router-link";
|
|
3774
|
-
function
|
|
3777
|
+
function Dr(s, e = !1) {
|
|
3775
3778
|
let t = null;
|
|
3776
3779
|
return e ? t = s.showFromClass ?? s.enterFromClass : t = s.enterFromClass, t || (t = s.transitionName, t ? e ? `${t}-show-from` : `${t}-enter-from` : null);
|
|
3777
3780
|
}
|
|
3778
|
-
function
|
|
3781
|
+
function kr(s, e = !1) {
|
|
3779
3782
|
let t = null;
|
|
3780
3783
|
return e ? t = s.showActiveClass ?? s.enterActiveClass : t = s.enterActiveClass, t || (t = s.transitionName, t ? e ? `${t}-show-active` : `${t}-enter-active` : null);
|
|
3781
3784
|
}
|
|
@@ -3783,11 +3786,11 @@ function rn(s, e = !1) {
|
|
|
3783
3786
|
let t = null;
|
|
3784
3787
|
return e ? t = s.showToClass ?? s.enterToClass : t = s.enterToClass, t || (t = s.transitionName, t ? e ? `${t}-show-to` : `${t}-enter-to` : null);
|
|
3785
3788
|
}
|
|
3786
|
-
function
|
|
3789
|
+
function Ur(s, e = !1) {
|
|
3787
3790
|
let t = null;
|
|
3788
3791
|
return e ? t = s.hideFromClass ?? s.leaveFromClass : t = s.leaveFromClass, t || (t = s.transitionName, t ? e ? `${t}-hide-from` : `${t}-leave-from` : null);
|
|
3789
3792
|
}
|
|
3790
|
-
function
|
|
3793
|
+
function Br(s, e = !1) {
|
|
3791
3794
|
let t = null;
|
|
3792
3795
|
return e ? t = s.hideActiveClass ?? s.leaveActiveClass : t = s.leaveActiveClass, t || (t = s.transitionName, t ? e ? `${t}-hide-active` : `${t}-leave-active` : null);
|
|
3793
3796
|
}
|
|
@@ -3848,13 +3851,19 @@ function Ee(s, e) {
|
|
|
3848
3851
|
s.classList.remove(e);
|
|
3849
3852
|
}
|
|
3850
3853
|
const yn = me && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : setTimeout;
|
|
3851
|
-
function
|
|
3854
|
+
function ht(s) {
|
|
3852
3855
|
yn(s);
|
|
3853
3856
|
}
|
|
3854
|
-
function
|
|
3857
|
+
function j(s, e, t) {
|
|
3855
3858
|
x(e) && (s == null && (s = {}), Reflect.apply(e, s, t));
|
|
3856
3859
|
}
|
|
3857
|
-
function
|
|
3860
|
+
function Vr(s, e, t, r = -1, n, i, o, a) {
|
|
3861
|
+
let l = [];
|
|
3862
|
+
const u = () => {
|
|
3863
|
+
for (let f of l)
|
|
3864
|
+
kt(e, f.type, f.listener);
|
|
3865
|
+
l = [];
|
|
3866
|
+
};
|
|
3858
3867
|
if (x(i)) {
|
|
3859
3868
|
if (n !== void 0 && n >= 0) {
|
|
3860
3869
|
setTimeout(() => {
|
|
@@ -3862,171 +3871,177 @@ function Wr(s, e, t, r = -1, n, i, o, a) {
|
|
|
3862
3871
|
}, n);
|
|
3863
3872
|
return;
|
|
3864
3873
|
}
|
|
3865
|
-
const
|
|
3866
|
-
const
|
|
3867
|
-
|
|
3868
|
-
it(e, y, u);
|
|
3869
|
-
}), Reflect.apply(i, s, [e, t, r]));
|
|
3874
|
+
const f = ["animationend", "transitionend", Mt], c = (h) => {
|
|
3875
|
+
const y = h.target || h.srcElement, d = h.currentTarget;
|
|
3876
|
+
y === d && (u(), Reflect.apply(i, s, [e, t, r]));
|
|
3870
3877
|
};
|
|
3871
|
-
|
|
3872
|
-
|
|
3878
|
+
f.forEach((h) => {
|
|
3879
|
+
it(e, h, c), l.push({
|
|
3880
|
+
type: h,
|
|
3881
|
+
listener: c
|
|
3882
|
+
});
|
|
3873
3883
|
});
|
|
3874
3884
|
}
|
|
3875
3885
|
if (x(o)) {
|
|
3876
|
-
const
|
|
3877
|
-
const
|
|
3878
|
-
|
|
3886
|
+
const f = "animationcancel", c = (h) => {
|
|
3887
|
+
const y = h.target || h.srcElement, d = h.currentTarget;
|
|
3888
|
+
y === d && (u(), Reflect.apply(o, s, [e, t, r]));
|
|
3879
3889
|
};
|
|
3880
|
-
|
|
3890
|
+
it(e, f, c), l.push({
|
|
3891
|
+
type: f,
|
|
3892
|
+
listener: c
|
|
3893
|
+
});
|
|
3881
3894
|
}
|
|
3882
3895
|
}
|
|
3883
|
-
function
|
|
3896
|
+
function yt(s) {
|
|
3884
3897
|
return !me || s === null ? !1 : s.opsType === q.Append || s.opsType === q.Open;
|
|
3885
3898
|
}
|
|
3886
|
-
function
|
|
3887
|
-
if (e ||
|
|
3888
|
-
const o =
|
|
3899
|
+
function Wr(s, e, t, r = {}, n, i = -1) {
|
|
3900
|
+
if (e || yt(n)) {
|
|
3901
|
+
const o = Dr(r, e);
|
|
3889
3902
|
o && Ce(t, o);
|
|
3890
|
-
const a =
|
|
3903
|
+
const a = kr(r, e);
|
|
3891
3904
|
a && Ce(t, a);
|
|
3892
3905
|
const l = nn(r, e);
|
|
3893
|
-
|
|
3906
|
+
j(s, l, [t, e, n, i]);
|
|
3894
3907
|
}
|
|
3895
3908
|
}
|
|
3896
|
-
function
|
|
3897
|
-
if (!
|
|
3909
|
+
function zr(s, e, t, r = {}, n, i, o, a) {
|
|
3910
|
+
if (!yt(i) && !e) {
|
|
3898
3911
|
x(a) && a(s, a, [t]);
|
|
3899
3912
|
return;
|
|
3900
3913
|
}
|
|
3901
|
-
const l =
|
|
3914
|
+
const l = Dr(r, e), u = kr(r, e), f = rn(r, e), c = on(r, e), h = ln(r, e), y = an(r, e);
|
|
3902
3915
|
if (!l && !u && !f && !c) {
|
|
3903
3916
|
x(a) && a(s, a, [t]);
|
|
3904
3917
|
return;
|
|
3905
3918
|
}
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
u && Ee(t, u), f && Ee(t, f), x(h) &&
|
|
3919
|
+
ht(() => {
|
|
3920
|
+
Vr(s, t, i, o, n, () => {
|
|
3921
|
+
u && Ee(t, u), f && Ee(t, f), x(h) && j(s, h, [t, e, i, o]), x(a) && a(s, a, [t]);
|
|
3909
3922
|
}, () => {
|
|
3910
|
-
x(y) &&
|
|
3911
|
-
}), l && Ee(t, l), f && Ce(t, f), x(c) &&
|
|
3923
|
+
x(y) && j(s, y, [t, e, i, o]);
|
|
3924
|
+
}), l && Ee(t, l), f && Ce(t, f), x(c) && j(s, c, [t, e, i, o]);
|
|
3912
3925
|
});
|
|
3913
3926
|
}
|
|
3914
|
-
function
|
|
3915
|
-
if (e ||
|
|
3916
|
-
const o =
|
|
3927
|
+
function Jr(s, e, t, r = {}, n, i = -1) {
|
|
3928
|
+
if (e || yt(n)) {
|
|
3929
|
+
const o = Ur(r, e);
|
|
3917
3930
|
o && Ce(t, o);
|
|
3918
|
-
const a =
|
|
3931
|
+
const a = Br(r, e);
|
|
3919
3932
|
a && Ce(t, a);
|
|
3920
3933
|
const l = un(r, e);
|
|
3921
|
-
|
|
3934
|
+
j(s, l, [t, e, n, i]);
|
|
3922
3935
|
}
|
|
3923
3936
|
}
|
|
3924
|
-
function
|
|
3925
|
-
if (!
|
|
3926
|
-
!e && x(i) && i();
|
|
3937
|
+
function Gr(s, e, t, r = {}, n, i, o, a, l) {
|
|
3938
|
+
if (!yt(o) && !e) {
|
|
3939
|
+
x(l) && j(s, l, [t]), !e && x(i) && i();
|
|
3927
3940
|
return;
|
|
3928
3941
|
}
|
|
3929
|
-
const u =
|
|
3942
|
+
const u = Ur(r, e), f = Br(r, e), c = sn(r, e), h = fn(r, e), y = cn(r, e), d = hn(r, e);
|
|
3930
3943
|
if (!u && !f && !c && !h) {
|
|
3931
|
-
!e && x(i) && i();
|
|
3944
|
+
x(l) && j(s, l, [t]), !e && x(i) && i();
|
|
3932
3945
|
return;
|
|
3933
3946
|
}
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
f && Ee(t, f), c && Ee(t, c), x(y) &&
|
|
3947
|
+
ht(() => {
|
|
3948
|
+
Vr(s, t, o, a, n, () => {
|
|
3949
|
+
f && Ee(t, f), c && Ee(t, c), x(y) && j(s, y, [t, e, o, a]), x(l) && j(s, l, [t]), !e && x(i) && i();
|
|
3937
3950
|
}, () => {
|
|
3938
|
-
x(d) &&
|
|
3939
|
-
}), u && Ee(t, u), c && Ce(t, c), x(h) &&
|
|
3951
|
+
x(d) && j(s, d, [t, e, o, a]), x(l) && j(s, l, [t]), !e && x(i) && i();
|
|
3952
|
+
}), u && Ee(t, u), c && Ce(t, c), x(h) && j(s, h, [t, e, o, a]);
|
|
3940
3953
|
});
|
|
3941
3954
|
}
|
|
3942
|
-
function
|
|
3943
|
-
const
|
|
3955
|
+
function Nt(s, e, t = {}, r, n = -1) {
|
|
3956
|
+
const i = t.mode ?? "default", o = Qt(t);
|
|
3944
3957
|
return {
|
|
3945
3958
|
//mode
|
|
3946
|
-
mode:
|
|
3959
|
+
mode: i,
|
|
3947
3960
|
//如果是 true,表示这是一个不真实插入/删除元素的转换,而是切换显示/隐藏状态
|
|
3948
3961
|
persisted: !1,
|
|
3949
3962
|
//before enter
|
|
3950
|
-
beforeEnter: (
|
|
3951
|
-
|
|
3963
|
+
beforeEnter: (l) => {
|
|
3964
|
+
Wr(s, !1, l, t, r, n);
|
|
3952
3965
|
},
|
|
3953
3966
|
//enter
|
|
3954
|
-
enter: (
|
|
3955
|
-
|
|
3967
|
+
enter: (l) => {
|
|
3968
|
+
zr(s, !1, l, t, o.enter, r, n);
|
|
3956
3969
|
},
|
|
3957
3970
|
//leave
|
|
3958
|
-
leave: (
|
|
3959
|
-
|
|
3971
|
+
leave: (l, u) => {
|
|
3972
|
+
Jr(s, !1, l, t, r, n), Gr(s, !1, l, t, o.leave, u, r, n, () => {
|
|
3973
|
+
e.transition = null, e = null;
|
|
3974
|
+
});
|
|
3960
3975
|
},
|
|
3961
3976
|
//clone
|
|
3962
|
-
clone: (
|
|
3977
|
+
clone: (l) => Nt(s, e, t, r, n)
|
|
3963
3978
|
};
|
|
3964
3979
|
}
|
|
3965
|
-
function
|
|
3980
|
+
function Qr(s) {
|
|
3966
3981
|
return s.el;
|
|
3967
3982
|
}
|
|
3968
3983
|
function dn(s, e, t = {}, r, n, i, o) {
|
|
3969
3984
|
if (i === !0) {
|
|
3970
|
-
const a =
|
|
3985
|
+
const a = Qr(e);
|
|
3971
3986
|
if (a == null)
|
|
3972
3987
|
return;
|
|
3973
3988
|
const l = Qt(t);
|
|
3974
|
-
|
|
3975
|
-
x(o) &&
|
|
3989
|
+
Wr(s, !0, a, t, r, n), zr(s, !0, a, t, l.show, r, n, (u) => {
|
|
3990
|
+
x(o) && j(s, o, [u]);
|
|
3976
3991
|
});
|
|
3977
3992
|
} else
|
|
3978
|
-
x(o) &&
|
|
3993
|
+
x(o) && j(s, o, []);
|
|
3979
3994
|
}
|
|
3980
3995
|
function mn(s, e, t = {}, r, n, i, o) {
|
|
3981
3996
|
if (i === !0) {
|
|
3982
|
-
const a =
|
|
3997
|
+
const a = Qr(e);
|
|
3983
3998
|
if (a == null)
|
|
3984
3999
|
return;
|
|
3985
4000
|
const l = Qt(t);
|
|
3986
|
-
|
|
3987
|
-
x(o) &&
|
|
4001
|
+
Jr(s, !0, a, t, r, n), Gr(s, !0, a, t, l.hide, null, r, n, (u) => {
|
|
4002
|
+
x(o) && j(s, o, [u]);
|
|
3988
4003
|
});
|
|
3989
4004
|
} else
|
|
3990
|
-
x(o) &&
|
|
4005
|
+
x(o) && j(s, o, []);
|
|
3991
4006
|
}
|
|
3992
4007
|
function pn(s, e = {}) {
|
|
3993
|
-
|
|
4008
|
+
ht(() => {
|
|
3994
4009
|
for (let t = 0; t < s.length; t++)
|
|
3995
4010
|
Reflect.apply(s[t], e, []);
|
|
3996
4011
|
});
|
|
3997
4012
|
}
|
|
3998
|
-
function
|
|
4013
|
+
function Xr(s, e, t = {}, r, n = -1) {
|
|
3999
4014
|
return {
|
|
4000
4015
|
//mode
|
|
4001
|
-
mode:
|
|
4016
|
+
mode: t.mode ?? "default",
|
|
4002
4017
|
//如果是 true,表示这是一个不真实插入/删除元素的转换,而是切换显示/隐藏状态
|
|
4003
4018
|
persisted: !1,
|
|
4004
4019
|
//before enter
|
|
4005
|
-
beforeEnter: (
|
|
4006
|
-
Ue(Cs, {},
|
|
4020
|
+
beforeEnter: (a) => {
|
|
4021
|
+
Ue(Cs, {}, a);
|
|
4007
4022
|
},
|
|
4008
4023
|
//enter
|
|
4009
|
-
enter: (
|
|
4010
|
-
Ue(Fs, {},
|
|
4024
|
+
enter: (a) => {
|
|
4025
|
+
Ue(Fs, {}, a);
|
|
4011
4026
|
},
|
|
4012
4027
|
//leave
|
|
4013
|
-
leave: (
|
|
4014
|
-
Ue(As, {},
|
|
4015
|
-
const
|
|
4016
|
-
const
|
|
4017
|
-
|
|
4028
|
+
leave: (a, l) => {
|
|
4029
|
+
Ue(As, {}, a), ht(() => {
|
|
4030
|
+
const u = (f) => {
|
|
4031
|
+
const c = f.target || f.srcElement, h = f.currentTarget;
|
|
4032
|
+
c === h && (kt(a, Mt, u), l && Reflect.apply(l, s, []), e.transition = null, e = null);
|
|
4018
4033
|
};
|
|
4019
|
-
|
|
4034
|
+
it(a, Mt, u), Ue(_s, {}, a);
|
|
4020
4035
|
});
|
|
4021
4036
|
},
|
|
4022
4037
|
//clone
|
|
4023
|
-
clone: (
|
|
4038
|
+
clone: (a) => Xr(s, t, r, n)
|
|
4024
4039
|
};
|
|
4025
4040
|
}
|
|
4026
4041
|
function oe(s, e, t) {
|
|
4027
4042
|
return typeof s == "function" ? Reflect.apply(s, {}, [e, t]) : s;
|
|
4028
4043
|
}
|
|
4029
|
-
function
|
|
4044
|
+
function Lt(s, e) {
|
|
4030
4045
|
if (!s)
|
|
4031
4046
|
return null;
|
|
4032
4047
|
const t = s(e);
|
|
@@ -4035,7 +4050,7 @@ function Ot(s, e) {
|
|
|
4035
4050
|
function xe(s, e) {
|
|
4036
4051
|
return typeof e == "function" ? e(s) : s;
|
|
4037
4052
|
}
|
|
4038
|
-
class
|
|
4053
|
+
class gn {
|
|
4039
4054
|
/**
|
|
4040
4055
|
* vue node
|
|
4041
4056
|
*/
|
|
@@ -4051,7 +4066,7 @@ class vn {
|
|
|
4051
4066
|
this.node = e, this.state = t;
|
|
4052
4067
|
}
|
|
4053
4068
|
}
|
|
4054
|
-
const
|
|
4069
|
+
const Ht = Sr({
|
|
4055
4070
|
//名称
|
|
4056
4071
|
name: "RouterView",
|
|
4057
4072
|
//继承特性
|
|
@@ -4264,33 +4279,32 @@ const Dt = Pr({
|
|
|
4264
4279
|
},
|
|
4265
4280
|
//setup
|
|
4266
4281
|
setup(s, e) {
|
|
4267
|
-
const t =
|
|
4282
|
+
const t = Dt();
|
|
4268
4283
|
if (t === null || t.proxy === null) {
|
|
4269
4284
|
console.error("instance or instance.proxy not exist");
|
|
4270
4285
|
return;
|
|
4271
4286
|
}
|
|
4272
|
-
const r = s.multi === !0, n = Q(
|
|
4273
|
-
let l = null;
|
|
4274
|
-
const u = s.modelSlot;
|
|
4287
|
+
const r = s.multi === !0, n = Q(ct, null), i = Q(wt, 0), o = Q(ar, null), a = Q(bt, -1);
|
|
4288
|
+
let l = null, u = s.modelSlot;
|
|
4275
4289
|
if (u) {
|
|
4276
|
-
if (se(
|
|
4290
|
+
if (se(wt, i + 1), se(bt, u.index), se(xt, u.index), !u.route) {
|
|
4277
4291
|
console.warn("child view render error, route not exist");
|
|
4278
4292
|
return;
|
|
4279
4293
|
}
|
|
4280
|
-
const h =
|
|
4281
|
-
$s(h), lr(h, () => u
|
|
4294
|
+
const h = lt(t.proxy, !0);
|
|
4295
|
+
$s(h), lr(h, () => u?.route ?? null);
|
|
4282
4296
|
} else {
|
|
4283
4297
|
if (n == null) {
|
|
4284
4298
|
console.error("router is not been injected");
|
|
4285
4299
|
return;
|
|
4286
4300
|
}
|
|
4287
|
-
const c = s.name, h = Q(ur, null), y = Q(
|
|
4288
|
-
if (l = n[
|
|
4301
|
+
const c = s.name, h = Q(ur, null), y = Q(xt, 0);
|
|
4302
|
+
if (l = n[qr](c, i, o, a, h, y), l === null)
|
|
4289
4303
|
return;
|
|
4290
4304
|
se(ur, l);
|
|
4291
4305
|
const d = l[G] === !0;
|
|
4292
|
-
if (d && se(ar, l), !r && (se(
|
|
4293
|
-
const p =
|
|
4306
|
+
if (d && se(ar, l), !r && (se(bt, -1), se(wt, i + 1), se(xt, -1), d)) {
|
|
4307
|
+
const p = lt(t.proxy, !0);
|
|
4294
4308
|
lr(p, () => {
|
|
4295
4309
|
const m = l.slots.value;
|
|
4296
4310
|
return m.length > 0 ? m[0].route : null;
|
|
@@ -4298,55 +4312,58 @@ const Dt = Pr({
|
|
|
4298
4312
|
}
|
|
4299
4313
|
}
|
|
4300
4314
|
const f = { value: /* @__PURE__ */ new Map() };
|
|
4301
|
-
return
|
|
4302
|
-
f.value && f.value.clear()
|
|
4315
|
+
return ut(() => {
|
|
4316
|
+
if (f.value && f.value.clear(), u) {
|
|
4317
|
+
const c = u;
|
|
4318
|
+
c.route = null, c.model = null, c.instance = null, u = void 0;
|
|
4319
|
+
}
|
|
4303
4320
|
}), () => {
|
|
4304
4321
|
if (r) {
|
|
4305
4322
|
const c = /* @__PURE__ */ new Map(), h = [], y = l?.slots.value, d = [];
|
|
4306
|
-
for (let
|
|
4307
|
-
const
|
|
4323
|
+
for (let g = 0; g < y.length; g++) {
|
|
4324
|
+
const v = y[g], T = `${s.name}_${v.index}`, b = oe(s.transition, v.route, g) ?? !0, K = { modelSlot: v };
|
|
4308
4325
|
let F;
|
|
4309
|
-
e.slots.default ? F = he(
|
|
4310
|
-
const P = {}, E = oe(s.viewClass,
|
|
4326
|
+
e.slots.default ? F = he(Ht, K, { default: e.slots.default }) : F = he(Ht, K);
|
|
4327
|
+
const P = {}, E = oe(s.viewClass, v.route, g);
|
|
4311
4328
|
typeof E == "string" && E.length > 0 && (P[E] = !0);
|
|
4312
|
-
const W = oe(s.viewActiveClass,
|
|
4313
|
-
if (typeof W == "string" && W.length > 0 && (P[W] =
|
|
4329
|
+
const W = oe(s.viewActiveClass, v.route, g), M = oe(s.viewInactiveClass, v.route, g), I = f.value.get(T);
|
|
4330
|
+
if (typeof W == "string" && W.length > 0 && (P[W] = v.active), typeof M == "string" && M.length > 0 && (P[M] = !v.active), I && v.active !== I.state) {
|
|
4314
4331
|
const D = I.node;
|
|
4315
|
-
|
|
4316
|
-
const
|
|
4332
|
+
v.active ? d.unshift(() => {
|
|
4333
|
+
const dt = () => {
|
|
4317
4334
|
let Fe = ir(D);
|
|
4318
|
-
Fe != null && or(Fe,
|
|
4335
|
+
Fe != null && or(Fe, It.ACTIVATED);
|
|
4319
4336
|
};
|
|
4320
|
-
dn(t, D, s,
|
|
4337
|
+
dn(t, D, s, v.route, g, b, dt);
|
|
4321
4338
|
}) : d.push(() => {
|
|
4322
|
-
const
|
|
4339
|
+
const dt = () => {
|
|
4323
4340
|
const Fe = ir(D);
|
|
4324
|
-
Fe != null && or(Fe,
|
|
4341
|
+
Fe != null && or(Fe, It.DEACTIVATED);
|
|
4325
4342
|
};
|
|
4326
|
-
mn(t, D, s,
|
|
4343
|
+
mn(t, D, s, v.route, g, b, dt);
|
|
4327
4344
|
});
|
|
4328
4345
|
}
|
|
4329
4346
|
const Y = {
|
|
4330
4347
|
class: P,
|
|
4331
4348
|
key: T
|
|
4332
|
-
}, z = oe(s.viewTagProps,
|
|
4349
|
+
}, z = oe(s.viewTagProps, v.route, g);
|
|
4333
4350
|
if (z !== null && typeof z == "object") {
|
|
4334
4351
|
const D = xe(z, n?.propsFilter);
|
|
4335
4352
|
$(!0, Y, D);
|
|
4336
4353
|
}
|
|
4337
|
-
if (
|
|
4338
|
-
const D = xe(
|
|
4354
|
+
if (v.route?.viewTagAttrs && typeof v.route?.viewTagAttrs == "object") {
|
|
4355
|
+
const D = xe(v.route.viewTagAttrs, n?.propsFilter);
|
|
4339
4356
|
$(!0, Y, D);
|
|
4340
4357
|
}
|
|
4341
|
-
const re = oe(s.viewTag,
|
|
4342
|
-
if (c.set(T, new
|
|
4343
|
-
const D =
|
|
4344
|
-
|
|
4358
|
+
const re = oe(s.viewTag, v.route, g), ge = he(re, Y, { default: () => [F] });
|
|
4359
|
+
if (c.set(T, new gn(ge, v.active)), f.value.delete(T), b === !0) {
|
|
4360
|
+
const D = Nt(t, ge, s, v.route, g);
|
|
4361
|
+
ge.transition = D;
|
|
4345
4362
|
} else if (b === "custom") {
|
|
4346
|
-
const D =
|
|
4347
|
-
|
|
4363
|
+
const D = Xr(t, ge, s, v.route, g);
|
|
4364
|
+
ge.transition = D;
|
|
4348
4365
|
}
|
|
4349
|
-
h.push(
|
|
4366
|
+
h.push(ge);
|
|
4350
4367
|
}
|
|
4351
4368
|
f.value = c, pn(d, t);
|
|
4352
4369
|
const p = oe(s.tag, null, -1), m = {};
|
|
@@ -4363,33 +4380,33 @@ const Dt = Pr({
|
|
|
4363
4380
|
}
|
|
4364
4381
|
}
|
|
4365
4382
|
const y = he(c.component, h);
|
|
4366
|
-
return
|
|
4383
|
+
return Lt(e.slots.default, { Component: y, route: u.route }) ?? y;
|
|
4367
4384
|
} else {
|
|
4368
4385
|
const c = l.slots.value;
|
|
4369
4386
|
if (c.length > 0) {
|
|
4370
4387
|
const h = c[0], y = h.route ?? (t.proxy && Jt(t.proxy)) ?? null, d = h.model, p = {};
|
|
4371
4388
|
if (d.props) {
|
|
4372
4389
|
if (typeof d.props == "object") {
|
|
4373
|
-
const
|
|
4374
|
-
$(!1, p,
|
|
4390
|
+
const v = xe(d.props, n?.propsFilter);
|
|
4391
|
+
$(!1, p, v);
|
|
4375
4392
|
} else if (d.props === !0 && typeof y?.params == "object") {
|
|
4376
|
-
const
|
|
4377
|
-
$(!1, p,
|
|
4393
|
+
const v = xe(y.params, n?.propsFilter);
|
|
4394
|
+
$(!1, p, v);
|
|
4378
4395
|
}
|
|
4379
4396
|
}
|
|
4380
4397
|
const m = he(d.component, p);
|
|
4381
4398
|
if (oe(s.transition, y, -1) ?? !0) {
|
|
4382
|
-
const
|
|
4383
|
-
m.transition =
|
|
4399
|
+
const v = Nt(t, m, s, y, -1);
|
|
4400
|
+
m.transition = v;
|
|
4384
4401
|
}
|
|
4385
|
-
return
|
|
4402
|
+
return Lt(e.slots.default, { Component: m, route: y }) ?? m;
|
|
4386
4403
|
} else
|
|
4387
|
-
return
|
|
4404
|
+
return Lt(e.slots.fallback, {});
|
|
4388
4405
|
}
|
|
4389
4406
|
};
|
|
4390
4407
|
}
|
|
4391
4408
|
});
|
|
4392
|
-
function
|
|
4409
|
+
function vn(s) {
|
|
4393
4410
|
if (!(s.metaKey || s.altKey || s.ctrlKey || s.shiftKey) && !s.defaultPrevented && !(s.button != null && s.button !== 0)) {
|
|
4394
4411
|
if (s.currentTarget && s.currentTarget.getAttribute) {
|
|
4395
4412
|
const e = s.currentTarget.getAttribute("target");
|
|
@@ -4408,7 +4425,7 @@ function bn(s, e) {
|
|
|
4408
4425
|
function Re(s, e) {
|
|
4409
4426
|
return typeof s == "function" ? Reflect.apply(s, {}, [e]) : s;
|
|
4410
4427
|
}
|
|
4411
|
-
let xn =
|
|
4428
|
+
let xn = Sr({
|
|
4412
4429
|
//名称
|
|
4413
4430
|
name: "RouterLink",
|
|
4414
4431
|
//继承特性
|
|
@@ -4456,7 +4473,7 @@ let xn = Pr({
|
|
|
4456
4473
|
},
|
|
4457
4474
|
//setup
|
|
4458
4475
|
setup(s, e) {
|
|
4459
|
-
const t = Q(
|
|
4476
|
+
const t = Q(ct, null);
|
|
4460
4477
|
return () => {
|
|
4461
4478
|
let r = Re(s.to, null), n = Re(s.tag, r);
|
|
4462
4479
|
if (n == null) {
|
|
@@ -4485,7 +4502,7 @@ let xn = Pr({
|
|
|
4485
4502
|
console.warn("route is not been resolved");
|
|
4486
4503
|
return;
|
|
4487
4504
|
}
|
|
4488
|
-
|
|
4505
|
+
vn(y) && t.to(i);
|
|
4489
4506
|
};
|
|
4490
4507
|
f[c] = h;
|
|
4491
4508
|
}
|
|
@@ -4493,7 +4510,7 @@ let xn = Pr({
|
|
|
4493
4510
|
};
|
|
4494
4511
|
}
|
|
4495
4512
|
});
|
|
4496
|
-
var
|
|
4513
|
+
var O = /* @__PURE__ */ ((s) => (s[s.Loading = 0] = "Loading", s[s.Loaded = 1] = "Loaded", s[s.Defining = 2] = "Defining", s[s.Defined = 3] = "Defined", s))(O || {}), nt = /* @__PURE__ */ ((s) => (s[s.normal = 0] = "normal", s[s.factory = 1] = "factory", s))(nt || {});
|
|
4497
4514
|
class Rn {
|
|
4498
4515
|
/**
|
|
4499
4516
|
* 注册表
|
|
@@ -4635,9 +4652,9 @@ class Rr {
|
|
|
4635
4652
|
const r = {
|
|
4636
4653
|
id: e,
|
|
4637
4654
|
src: "",
|
|
4638
|
-
status:
|
|
4655
|
+
status: O.Defined
|
|
4639
4656
|
};
|
|
4640
|
-
typeof t == "function" ? (r.exports = t, r.type =
|
|
4657
|
+
typeof t == "function" ? (r.exports = t, r.type = nt.factory) : r.exports = t, this.moduleManager.set(e, r);
|
|
4641
4658
|
}
|
|
4642
4659
|
/**
|
|
4643
4660
|
* 移除module
|
|
@@ -4679,7 +4696,7 @@ class Rr {
|
|
|
4679
4696
|
} catch (f) {
|
|
4680
4697
|
console.error(f.message, f);
|
|
4681
4698
|
}
|
|
4682
|
-
}), a = new
|
|
4699
|
+
}), a = new ot();
|
|
4683
4700
|
for (let l = 0; l < t.length; l++) {
|
|
4684
4701
|
const u = new Pn(l, t[l], n, o);
|
|
4685
4702
|
this.mount(a, u);
|
|
@@ -4755,8 +4772,8 @@ class Rr {
|
|
|
4755
4772
|
mountCSS(e, t, r) {
|
|
4756
4773
|
e.post((n) => {
|
|
4757
4774
|
const i = t.src, o = this.moduleManager.get(i);
|
|
4758
|
-
if (o && (o.status ==
|
|
4759
|
-
o.type ===
|
|
4775
|
+
if (o && (o.status == O.Defined || o.status == O.Loaded) && o.exports) {
|
|
4776
|
+
o.type === nt.factory && typeof o.exports == "function" ? t.progress.work(!0, t.index, o.exports()) : t.progress.work(!0, t.index, o.exports), n.resolve();
|
|
4760
4777
|
return;
|
|
4761
4778
|
}
|
|
4762
4779
|
const a = ke(), l = a.createElement("link");
|
|
@@ -4792,7 +4809,7 @@ class Rr {
|
|
|
4792
4809
|
}
|
|
4793
4810
|
};
|
|
4794
4811
|
setTimeout(() => {
|
|
4795
|
-
|
|
4812
|
+
Yr(l, c);
|
|
4796
4813
|
}, 1);
|
|
4797
4814
|
}
|
|
4798
4815
|
let f = a.getElementById(i);
|
|
@@ -4810,9 +4827,9 @@ class Rr {
|
|
|
4810
4827
|
e.post((n) => {
|
|
4811
4828
|
const i = t.src;
|
|
4812
4829
|
let o = this.moduleManager.get(i);
|
|
4813
|
-
if (o && (o.status ==
|
|
4830
|
+
if (o && (o.status == O.Defined || o.status == O.Loaded)) {
|
|
4814
4831
|
if (o.exports) {
|
|
4815
|
-
o.type ===
|
|
4832
|
+
o.type === nt.factory && typeof o.exports == "function" ? t.progress.work(!0, t.index, o.exports()) : t.progress.work(!0, t.index, o.exports), n.resolve();
|
|
4816
4833
|
return;
|
|
4817
4834
|
}
|
|
4818
4835
|
if (document.querySelector(`script[src='${i}`)) {
|
|
@@ -4825,13 +4842,13 @@ class Rr {
|
|
|
4825
4842
|
// ID
|
|
4826
4843
|
src: i,
|
|
4827
4844
|
// resource path
|
|
4828
|
-
status:
|
|
4845
|
+
status: O.Loading
|
|
4829
4846
|
// 状态
|
|
4830
4847
|
}, this.moduleManager.set(i, o);
|
|
4831
4848
|
const l = ke().createElement("script");
|
|
4832
4849
|
if ("onload" in l)
|
|
4833
4850
|
l.onload = () => {
|
|
4834
|
-
l.onload = null, l.onerror = null, o.status ===
|
|
4851
|
+
l.onload = null, l.onerror = null, o.status === O.Loading && (o.status = O.Loaded, t.progress.work(!0, t.index, i)), n.resolve();
|
|
4835
4852
|
}, l.onerror = () => {
|
|
4836
4853
|
try {
|
|
4837
4854
|
r.removeChild(l);
|
|
@@ -4843,7 +4860,7 @@ class Rr {
|
|
|
4843
4860
|
else {
|
|
4844
4861
|
const c = l;
|
|
4845
4862
|
c.onreadystatechange = () => {
|
|
4846
|
-
/loaded|complete/.test(c.readyState) && (c.onreadystatechange = null, o.status ==
|
|
4863
|
+
/loaded|complete/.test(c.readyState) && (c.onreadystatechange = null, o.status == O.Loading && (o.status = O.Loaded, t.progress.work(!0, t.index, i)), n.resolve());
|
|
4847
4864
|
};
|
|
4848
4865
|
}
|
|
4849
4866
|
l.defer = !0, l.src = i;
|
|
@@ -4887,7 +4904,7 @@ class Rr {
|
|
|
4887
4904
|
*/
|
|
4888
4905
|
createDefine(e, t) {
|
|
4889
4906
|
const r = this, n = function(...i) {
|
|
4890
|
-
e.status =
|
|
4907
|
+
e.status = O.Defining;
|
|
4891
4908
|
let o, a, l, u = i.length;
|
|
4892
4909
|
u === 1 ? (l = i[0], o = void 0) : u === 2 ? (l = i[1], Array.isArray(i[0]) ? (a = r.trimEmptyElement(i[0]), o = void 0) : a = void 0) : (o = i[0], a = r.trimEmptyElement(i[1]), l = i[2]), o && (e.id = o, r.options.alias[o] = e.src), a && a.length > 0 ? r.ensure(a, (...f) => {
|
|
4893
4910
|
const c = f.map((h) => h === "exports" ? ((!e.exports || typeof e.exports != "object") && (e.exports = {}), e.exports) : h === "module" ? e : h);
|
|
@@ -4896,8 +4913,8 @@ class Rr {
|
|
|
4896
4913
|
h && typeof h == "object" && (e.exports = h);
|
|
4897
4914
|
} else
|
|
4898
4915
|
e.exports = l;
|
|
4899
|
-
e.status =
|
|
4900
|
-
}) : (typeof l == "function" ? e.exports = Reflect.apply(l, e, []) : e.exports = l, e.status =
|
|
4916
|
+
e.status = O.Defined, t.progress.work(!0, t.index, e.exports);
|
|
4917
|
+
}) : (typeof l == "function" ? e.exports = Reflect.apply(l, e, []) : e.exports = l, e.status = O.Defined, t.progress.work(!0, t.index, e.exports));
|
|
4901
4918
|
};
|
|
4902
4919
|
return n.amd = !0, n;
|
|
4903
4920
|
}
|
|
@@ -4972,9 +4989,9 @@ class Rr {
|
|
|
4972
4989
|
if (e.indexOf("http://") == 0 || e.indexOf("https://") == 0 || e.indexOf("file:///") == 0)
|
|
4973
4990
|
return e;
|
|
4974
4991
|
if (e.indexOf("/") == 0)
|
|
4975
|
-
return `${
|
|
4992
|
+
return `${mt()}${e.slice(1)}`;
|
|
4976
4993
|
if (e.indexOf("./") == 0)
|
|
4977
|
-
return `${
|
|
4994
|
+
return `${mt()}${e.slice(2)}`;
|
|
4978
4995
|
if (e.indexOf("//") == 0)
|
|
4979
4996
|
return `${_().location.protocol}${e}`;
|
|
4980
4997
|
if (t) {
|
|
@@ -4990,10 +5007,10 @@ class Rr {
|
|
|
4990
5007
|
}
|
|
4991
5008
|
return this.parserPath(n, !1);
|
|
4992
5009
|
}
|
|
4993
|
-
return `${
|
|
5010
|
+
return `${mt()}${e}`;
|
|
4994
5011
|
}
|
|
4995
5012
|
}
|
|
4996
|
-
function
|
|
5013
|
+
function Yr(s, e) {
|
|
4997
5014
|
let t = s.sheet, r = !1;
|
|
4998
5015
|
if (e.isOldWebKit)
|
|
4999
5016
|
t && (r = !0);
|
|
@@ -5004,7 +5021,7 @@ function Zr(s, e) {
|
|
|
5004
5021
|
n.name === "NS_ERROR_DOM_SECURITY_ERR" && (r = !0);
|
|
5005
5022
|
}
|
|
5006
5023
|
setTimeout(() => {
|
|
5007
|
-
e.time += 20, r ? e.success() : e.timeout > e.timeout ? e.error() :
|
|
5024
|
+
e.time += 20, r ? e.success() : e.timeout > e.timeout ? e.error() : Yr(s, e);
|
|
5008
5025
|
}, 20);
|
|
5009
5026
|
}
|
|
5010
5027
|
class Sn {
|
|
@@ -5083,7 +5100,7 @@ class Pn {
|
|
|
5083
5100
|
this.index = e, this.src = t, this.params = r, this.progress = n;
|
|
5084
5101
|
}
|
|
5085
5102
|
}
|
|
5086
|
-
const
|
|
5103
|
+
const Zr = Symbol("fk"), es = Symbol("fbk"), ts = Symbol("fepk");
|
|
5087
5104
|
function Un(s = {}) {
|
|
5088
5105
|
const e = new Zs(s), t = new tr(), r = new nr(), n = new Rr(), i = {
|
|
5089
5106
|
/**
|
|
@@ -5120,7 +5137,7 @@ function Un(s = {}) {
|
|
|
5120
5137
|
* 返回event chain类型
|
|
5121
5138
|
*/
|
|
5122
5139
|
get EventChain() {
|
|
5123
|
-
return
|
|
5140
|
+
return ot;
|
|
5124
5141
|
},
|
|
5125
5142
|
/**
|
|
5126
5143
|
* 返回Require构造函数
|
|
@@ -5150,13 +5167,13 @@ function Un(s = {}) {
|
|
|
5150
5167
|
* 判断是否为es模块
|
|
5151
5168
|
*/
|
|
5152
5169
|
get isESModule() {
|
|
5153
|
-
return
|
|
5170
|
+
return Pr;
|
|
5154
5171
|
},
|
|
5155
5172
|
/**
|
|
5156
5173
|
* 安装
|
|
5157
5174
|
*/
|
|
5158
5175
|
install(o) {
|
|
5159
|
-
o.provide(
|
|
5176
|
+
o.provide(ct, e), o.provide(Zr, i), o.provide(es, t), o.provide(ts, r), o.component(en, Ht), o.component(tn, xn), Reflect.defineProperty(o.config.globalProperties, "$fox", {
|
|
5160
5177
|
get() {
|
|
5161
5178
|
return i;
|
|
5162
5179
|
}
|
|
@@ -5204,23 +5221,23 @@ function Un(s = {}) {
|
|
|
5204
5221
|
};
|
|
5205
5222
|
return i;
|
|
5206
5223
|
}
|
|
5207
|
-
function
|
|
5208
|
-
return s ? s.$router : Q(
|
|
5224
|
+
function rs(s) {
|
|
5225
|
+
return s ? s.$router : Q(ct);
|
|
5209
5226
|
}
|
|
5210
5227
|
function Bn(s) {
|
|
5211
|
-
return s || (s =
|
|
5228
|
+
return s || (s = Dt()?.proxy ?? void 0), s ? Jt(s) : null;
|
|
5212
5229
|
}
|
|
5213
5230
|
function Vn(s) {
|
|
5214
|
-
return s ? s.$fox : Q(
|
|
5231
|
+
return s ? s.$fox : Q(Zr);
|
|
5215
5232
|
}
|
|
5216
5233
|
function Wn(s) {
|
|
5217
|
-
return s ? s.$bus : Q(
|
|
5234
|
+
return s ? s.$bus : Q(es);
|
|
5218
5235
|
}
|
|
5219
5236
|
function zn(s) {
|
|
5220
|
-
return s ? s.$eventProxy : Q(
|
|
5237
|
+
return s ? s.$eventProxy : Q(ts);
|
|
5221
5238
|
}
|
|
5222
5239
|
function Jn(s) {
|
|
5223
|
-
const e =
|
|
5240
|
+
const e = rs(), t = (r, n, i) => {
|
|
5224
5241
|
try {
|
|
5225
5242
|
Reflect.apply(s, {}, [r, n]);
|
|
5226
5243
|
} catch (o) {
|
|
@@ -5228,12 +5245,12 @@ function Jn(s) {
|
|
|
5228
5245
|
}
|
|
5229
5246
|
i();
|
|
5230
5247
|
};
|
|
5231
|
-
e.beforeEach(t),
|
|
5248
|
+
e.beforeEach(t), ut(() => {
|
|
5232
5249
|
e.removeBeforeEach(t);
|
|
5233
5250
|
});
|
|
5234
5251
|
}
|
|
5235
5252
|
function Gn(s) {
|
|
5236
|
-
const e =
|
|
5253
|
+
const e = rs(), t = (r, n, i) => {
|
|
5237
5254
|
try {
|
|
5238
5255
|
Reflect.apply(s, {}, [r, n]);
|
|
5239
5256
|
} catch (o) {
|
|
@@ -5241,19 +5258,19 @@ function Gn(s) {
|
|
|
5241
5258
|
}
|
|
5242
5259
|
i();
|
|
5243
5260
|
};
|
|
5244
|
-
e.afterEach(t),
|
|
5261
|
+
e.afterEach(t), ut(() => {
|
|
5245
5262
|
e.removeAfterEach(t);
|
|
5246
5263
|
});
|
|
5247
5264
|
}
|
|
5248
5265
|
export {
|
|
5249
5266
|
tr as Bus,
|
|
5250
|
-
|
|
5267
|
+
ot as EventChain,
|
|
5251
5268
|
nr as EventProxy,
|
|
5252
5269
|
Cs as FoxBeforeEnter,
|
|
5253
5270
|
As as FoxBeforeLeave,
|
|
5254
5271
|
Fs as FoxEnter,
|
|
5255
5272
|
_s as FoxLeave,
|
|
5256
|
-
|
|
5273
|
+
Mt as FoxLeaveEnd,
|
|
5257
5274
|
q as OperationType,
|
|
5258
5275
|
S as Route,
|
|
5259
5276
|
Bt as clone,
|
|
@@ -5263,17 +5280,17 @@ export {
|
|
|
5263
5280
|
kn as createWebHistory,
|
|
5264
5281
|
Nn as deleteContextValue,
|
|
5265
5282
|
$ as extend,
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5283
|
+
es as foxBusKey,
|
|
5284
|
+
ts as foxEventProxyKey,
|
|
5285
|
+
Zr as foxKey,
|
|
5286
|
+
Lr as injectContextValue,
|
|
5270
5287
|
Cn as isArray,
|
|
5271
5288
|
_n as isDate,
|
|
5272
|
-
|
|
5289
|
+
Pr as isESModule,
|
|
5273
5290
|
Yt as isEqual,
|
|
5274
5291
|
x as isFunction,
|
|
5275
5292
|
Fn as isMap,
|
|
5276
|
-
|
|
5293
|
+
ft as isNil,
|
|
5277
5294
|
fs as isObject,
|
|
5278
5295
|
hs as isPlainObject,
|
|
5279
5296
|
$n as isPromise,
|
|
@@ -5289,7 +5306,7 @@ export {
|
|
|
5289
5306
|
Ln as reactiveState,
|
|
5290
5307
|
ae as sessionKey,
|
|
5291
5308
|
On as shallowReactiveState,
|
|
5292
|
-
|
|
5309
|
+
Er as toBoolean,
|
|
5293
5310
|
qn as toNumber,
|
|
5294
5311
|
Ut as toTypeString,
|
|
5295
5312
|
Xt as typeOf,
|
|
@@ -5297,5 +5314,5 @@ export {
|
|
|
5297
5314
|
zn as useEventProxy,
|
|
5298
5315
|
Vn as useFox,
|
|
5299
5316
|
Bn as useRoute,
|
|
5300
|
-
|
|
5317
|
+
rs as useRouter
|
|
5301
5318
|
};
|