@fox-js/fox 3.1.1-31 → 3.1.1-33
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 +1 -1
- package/libs/index.esm.js +694 -648
- package/libs/index.umd.js +1 -1
- package/package.json +1 -1
package/libs/index.esm.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as $r, effectScope as
|
|
2
|
-
var
|
|
1
|
+
import { defineComponent as $r, effectScope as us, getCurrentScope as Kr, h as ue, hasInjectionContext as xe, inject as L, onActivated as fs, onDeactivated as cs, onScopeDispose as Pe, provide as Z, reactive as hs, readonly as ys, ref as ds, shallowReactive as vs, shallowRef as jr, toRaw as Ot, watch as ms } from "vue";
|
|
2
|
+
var Re = typeof window < "u", F = function() {
|
|
3
3
|
return window;
|
|
4
|
-
},
|
|
4
|
+
}, Ve = function() {
|
|
5
5
|
return window.document;
|
|
6
6
|
};
|
|
7
|
-
function
|
|
7
|
+
function ft(e, t, r, s = !1) {
|
|
8
8
|
e.addEventListener ? e.addEventListener(t, r, s) : e.attachEvent ? e.attachEvent(`on${t}`, r) : e[`on${t}`] = r;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function Xt(e, t, r) {
|
|
11
11
|
e.removeEventListener ? e.removeEventListener(t, r) : e.detachEvent ? e.detachEvent(`on${t}`, r) : e[`on${t}`] = null;
|
|
12
12
|
}
|
|
13
|
-
var
|
|
13
|
+
var We = (e, t, r) => {
|
|
14
14
|
t = t ?? {
|
|
15
15
|
bubbles: !1,
|
|
16
16
|
cancelable: !1,
|
|
@@ -20,11 +20,11 @@ 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,
|
|
24
|
-
function
|
|
25
|
-
return e.__esModule ||
|
|
23
|
+
}, sr = Array.isArray, ji = (e) => Qt(e) === "[object Map]", ki = (e) => Qt(e) === "[object Set]", Ti = (e) => e instanceof Date, b = (e) => typeof e == "function", Mi = (e) => typeof e == "string", Li = (e) => typeof e == "symbol", ps = (e) => e !== null && typeof e == "object", Ii = (e) => ps(e) && b(e.then) && b(e.catch), Be = (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
|
+
function Zt(e) {
|
|
25
|
+
return e.__esModule || bs && e[Symbol.toStringTag] === "Module";
|
|
26
26
|
}
|
|
27
|
-
var
|
|
27
|
+
var Rs = typeof Promise < "u" && Promise.toString().indexOf("[native code]") !== -1;
|
|
28
28
|
function q(...e) {
|
|
29
29
|
let t = e[0] !== void 0 && e[0] !== null ? e[0] : {}, r = 1, s = e.length, i = !1;
|
|
30
30
|
for (typeof t == "boolean" && (i = t, t = e[r] ?? {}, r++), typeof t != "object" && (t = {}); r < s; r++) if (e[r] !== null && e[r] !== void 0) {
|
|
@@ -47,7 +47,7 @@ function kr(e, t, r = !1) {
|
|
|
47
47
|
let i = e[s], n = t[s];
|
|
48
48
|
if (i !== n)
|
|
49
49
|
if (typeof n == "object") {
|
|
50
|
-
if (!Array.isArray(n) && !
|
|
50
|
+
if (!Array.isArray(n) && !ws(n)) continue;
|
|
51
51
|
i = kr(i, n, r), e[s] = i;
|
|
52
52
|
} else {
|
|
53
53
|
if (typeof n == "function") continue;
|
|
@@ -56,27 +56,27 @@ function kr(e, t, r = !1) {
|
|
|
56
56
|
}
|
|
57
57
|
return e;
|
|
58
58
|
}
|
|
59
|
-
var
|
|
59
|
+
var Oe = class Ht {
|
|
60
60
|
static seed = (/* @__PURE__ */ new Date()).getTime();
|
|
61
61
|
static get() {
|
|
62
|
-
let t = ++
|
|
63
|
-
return t >= Number.MAX_VALUE && (
|
|
62
|
+
let t = ++Ht.seed;
|
|
63
|
+
return t >= Number.MAX_VALUE && (Ht.seed = 0), t;
|
|
64
64
|
}
|
|
65
|
-
},
|
|
66
|
-
function
|
|
67
|
-
|
|
65
|
+
}, pt = Rs ? Promise.resolve() : null;
|
|
66
|
+
function He(e, ...t) {
|
|
67
|
+
pt !== null ? t && t.length > 0 ? pt.then(() => {
|
|
68
68
|
e(t);
|
|
69
|
-
}) :
|
|
69
|
+
}) : pt.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 Oi(e) {
|
|
77
77
|
return typeof e == "number" ? e : Number(e);
|
|
78
78
|
}
|
|
79
|
-
var
|
|
79
|
+
var Ss = {
|
|
80
80
|
"[object Boolean]": "boolean",
|
|
81
81
|
"[object Number]": "number",
|
|
82
82
|
"[object String]": "string",
|
|
@@ -88,7 +88,7 @@ var Rs = {
|
|
|
88
88
|
};
|
|
89
89
|
function ir(e) {
|
|
90
90
|
let t = Object.prototype.toString.call(e);
|
|
91
|
-
return e == null ? String(e) :
|
|
91
|
+
return e == null ? String(e) : Ss[t] || "object";
|
|
92
92
|
}
|
|
93
93
|
function nr(e, t) {
|
|
94
94
|
if (e == t) return !0;
|
|
@@ -120,12 +120,12 @@ var Mr = (e) => {
|
|
|
120
120
|
s && !Array.isArray(s) && typeof s == "object" && (s = Mr(s)), typeof r == "symbol" ? t[String(r)] = s : t[r] = s;
|
|
121
121
|
}
|
|
122
122
|
return t;
|
|
123
|
-
},
|
|
123
|
+
}, xs = /^Symbol\((.*)\)$/, Lr = (e) => {
|
|
124
124
|
const t = {};
|
|
125
125
|
for (let r of Reflect.ownKeys(e)) {
|
|
126
126
|
let s = e[r];
|
|
127
127
|
s && !Array.isArray(s) && typeof s == "object" && (s = Lr(s));
|
|
128
|
-
const i =
|
|
128
|
+
const i = xs.exec(r);
|
|
129
129
|
if (i && i[1]) {
|
|
130
130
|
const n = Symbol.for(i[1]);
|
|
131
131
|
t[n] = s;
|
|
@@ -144,19 +144,19 @@ function Ir(e, t) {
|
|
|
144
144
|
var or = /* @__PURE__ */ Symbol("idKey"), ce = /* @__PURE__ */ Symbol("valueKey"), S = /* @__PURE__ */ Symbol("childrenKey"), W = /* @__PURE__ */ Symbol("growKey"), Or = class {
|
|
145
145
|
[W] = !0;
|
|
146
146
|
[or];
|
|
147
|
-
[ce] =
|
|
147
|
+
[ce] = ds();
|
|
148
148
|
[S] = /* @__PURE__ */ new Map();
|
|
149
149
|
constructor(e) {
|
|
150
150
|
this[or] = e;
|
|
151
151
|
}
|
|
152
|
-
},
|
|
152
|
+
}, Ps = class {
|
|
153
153
|
get(e, t) {
|
|
154
154
|
if (t == "value") return e[ce].value;
|
|
155
155
|
if (t === "grow") return e[W];
|
|
156
156
|
let r = e[S].get(t);
|
|
157
|
-
if (r) return
|
|
157
|
+
if (r) return Ne(r);
|
|
158
158
|
if (e[W])
|
|
159
|
-
return r =
|
|
159
|
+
return r = er(t), r[W] = e[W], e[S].set(t, r), Ne(r);
|
|
160
160
|
}
|
|
161
161
|
set(e, t, r) {
|
|
162
162
|
return t == "value" ? (e[ce].value = r, !0) : t === "grow" ? (e[W] = Tr(r), !0) : r == null ? (e[S].delete(t), !0) : (console.error(`[Fox]illegal property:${t}`), !1);
|
|
@@ -164,22 +164,22 @@ var or = /* @__PURE__ */ Symbol("idKey"), ce = /* @__PURE__ */ Symbol("valueKey"
|
|
|
164
164
|
deleteProperty(e, t) {
|
|
165
165
|
return t === "value" || t == "grow" ? (console.error(`[Fox]can not delete property:${String(t)}`), !1) : (e[S].delete(t), !0);
|
|
166
166
|
}
|
|
167
|
-
},
|
|
168
|
-
function
|
|
167
|
+
}, Yt = "__proxy__";
|
|
168
|
+
function er(e) {
|
|
169
169
|
const t = new Or(e);
|
|
170
|
-
return Reflect.set(t,
|
|
170
|
+
return Reflect.set(t, Yt, new Proxy(t, new Ps())), t;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
173
|
-
return Reflect.get(e,
|
|
172
|
+
function Ne(e) {
|
|
173
|
+
return Reflect.get(e, Yt);
|
|
174
174
|
}
|
|
175
|
-
var
|
|
175
|
+
var _s = class {
|
|
176
176
|
name = "";
|
|
177
177
|
persistPolicy = "memory";
|
|
178
178
|
storage;
|
|
179
179
|
initFlag = !1;
|
|
180
180
|
state = {};
|
|
181
181
|
constructor(e = {}, t) {
|
|
182
|
-
if (e.persistPolicy && e.persistPolicy !== "memory" &&
|
|
182
|
+
if (e.persistPolicy && e.persistPolicy !== "memory" && Be(e.name)) throw new Error("name can not be empty, where persistPolicy is not memory.");
|
|
183
183
|
this.name = e.name ?? "", this.persistPolicy = e.persistPolicy ?? "memory", this.storage = e.storage, t && typeof t == "object" && Object.assign(this.state, t);
|
|
184
184
|
}
|
|
185
185
|
init(e) {
|
|
@@ -189,7 +189,7 @@ var Ps = 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 (
|
|
192
|
+
else if (Re) {
|
|
193
193
|
const t = F();
|
|
194
194
|
e = this.persistPolicy === "session" ? t.sessionStorage : t.localStorage;
|
|
195
195
|
}
|
|
@@ -254,7 +254,7 @@ var Ps = 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 _s(e, t), this._persistHandler.init(this);
|
|
258
258
|
}
|
|
259
259
|
put(...e) {
|
|
260
260
|
let t = e.length;
|
|
@@ -263,7 +263,7 @@ var Ps = class {
|
|
|
263
263
|
let r = this;
|
|
264
264
|
for (let s = 0; s < t - 1; s++) {
|
|
265
265
|
let i = e[s], n;
|
|
266
|
-
r[S].has(i) ? n = r[S].get(i) : (n =
|
|
266
|
+
r[S].has(i) ? n = r[S].get(i) : (n = er(i), r[S].set(i, n)), r = n;
|
|
267
267
|
}
|
|
268
268
|
return r[ce].value = e[t - 1], this._persistHandler.put(e), !0;
|
|
269
269
|
}
|
|
@@ -305,7 +305,7 @@ var Ps = class {
|
|
|
305
305
|
clear() {
|
|
306
306
|
this[S].clear(), this._persistHandler.clear();
|
|
307
307
|
}
|
|
308
|
-
},
|
|
308
|
+
}, Fs = [
|
|
309
309
|
"put",
|
|
310
310
|
"get",
|
|
311
311
|
"contains",
|
|
@@ -314,9 +314,9 @@ var Ps = class {
|
|
|
314
314
|
"_persistHandler"
|
|
315
315
|
];
|
|
316
316
|
function lr(e) {
|
|
317
|
-
return
|
|
317
|
+
return Fs.includes(e);
|
|
318
318
|
}
|
|
319
|
-
var
|
|
319
|
+
var Cs = class {
|
|
320
320
|
get(e, t) {
|
|
321
321
|
if (t == "value") return e[ce].value;
|
|
322
322
|
if (t === "grow") return e[W];
|
|
@@ -324,9 +324,9 @@ var Fs = class {
|
|
|
324
324
|
if (typeof t == "string" && lr(t)) return e[t];
|
|
325
325
|
const r = String(t);
|
|
326
326
|
let s = e[S].get(r);
|
|
327
|
-
if (s) return
|
|
327
|
+
if (s) return Ne(s);
|
|
328
328
|
if (e[W])
|
|
329
|
-
return s =
|
|
329
|
+
return s = er(r), s[W] = e[W], e[S].set(r, s), Ne(s);
|
|
330
330
|
}
|
|
331
331
|
set(e, t, r) {
|
|
332
332
|
return t == "value" ? (e[ce].value = r, !0) : t === "grow" ? (e[W] = Tr(r), !0) : lr(t) ? !1 : r == null ? (e[S].delete(t), !0) : (console.error(`[Fox]illegal property:${t}`), !1);
|
|
@@ -335,26 +335,26 @@ var Fs = class {
|
|
|
335
335
|
return t === "value" || t == "grow" ? (console.error(`[Fox]can not delete property:${String(t)}`), !1) : (e[S].delete(t), !0);
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
|
-
function
|
|
339
|
-
const r = new Hr(e, t), s = new
|
|
340
|
-
return Reflect.set(r,
|
|
338
|
+
function Es(e, t) {
|
|
339
|
+
const r = new Hr(e, t), s = new Cs(), i = new Proxy(r, s);
|
|
340
|
+
return Reflect.set(r, Yt, i), r;
|
|
341
341
|
}
|
|
342
342
|
var ar = new Proxy(Hr, { construct(e, t) {
|
|
343
343
|
const r = t[0] ?? {}, s = t[1];
|
|
344
|
-
return
|
|
345
|
-
} }),
|
|
344
|
+
return Ne(Es(r, s));
|
|
345
|
+
} }), Dt = /* @__PURE__ */ new WeakMap(), tr = (e) => !e || typeof e != "object" ? !0 : Reflect.ownKeys(e).length === 0, Dr = class {
|
|
346
346
|
name = "";
|
|
347
347
|
persistPolicy = "memory";
|
|
348
348
|
storage;
|
|
349
349
|
constructor(e = {}) {
|
|
350
|
-
if (e.persistPolicy && e.persistPolicy !== "memory" &&
|
|
350
|
+
if (e.persistPolicy && e.persistPolicy !== "memory" && Be(e.name)) throw new Error("name can not be empty, where persistPolicy is not memory.");
|
|
351
351
|
this.name = e.name ?? "", this.persistPolicy = e.persistPolicy ?? "memory", this.storage = e.storage;
|
|
352
352
|
}
|
|
353
353
|
getStorage() {
|
|
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 (
|
|
357
|
+
else if (Re) {
|
|
358
358
|
const t = F();
|
|
359
359
|
e = this.persistPolicy === "session" ? t.sessionStorage : t.localStorage;
|
|
360
360
|
}
|
|
@@ -363,7 +363,7 @@ var ar = new Proxy(Hr, { construct(e, t) {
|
|
|
363
363
|
saveState(e) {
|
|
364
364
|
if (!this.persistPolicy || this.persistPolicy === "memory") return;
|
|
365
365
|
let t = this.getStorage();
|
|
366
|
-
if (t === null ||
|
|
366
|
+
if (t === null || tr(e)) return;
|
|
367
367
|
const r = `_state_${this.name}`, s = JSON.stringify(e ?? {});
|
|
368
368
|
t.setItem(r, s);
|
|
369
369
|
}
|
|
@@ -389,42 +389,51 @@ function Nr(e, t, r) {
|
|
|
389
389
|
const s = new Dr(r);
|
|
390
390
|
s.restore(t);
|
|
391
391
|
const i = (a) => {
|
|
392
|
-
const u =
|
|
392
|
+
const u = Ot(a), f = {};
|
|
393
393
|
for (let c in u) {
|
|
394
394
|
const h = u[c];
|
|
395
|
-
|
|
395
|
+
Be(h) || (f[c] = h);
|
|
396
396
|
}
|
|
397
|
-
|
|
397
|
+
tr(f) ? s.removeState() : s.saveState(f);
|
|
398
398
|
};
|
|
399
399
|
let n = null;
|
|
400
|
-
r && r.debounce === !1
|
|
401
|
-
|
|
400
|
+
if (r && r.debounce === !1) n = i;
|
|
401
|
+
else {
|
|
402
|
+
const a = r && r.debounceDelay ? r.debounceDelay : 250;
|
|
403
|
+
n = Ir(i, a);
|
|
404
|
+
}
|
|
405
|
+
const o = e ? vs(t) : hs(t), l = us(!0);
|
|
402
406
|
return l.run(() => {
|
|
403
|
-
|
|
404
|
-
const u =
|
|
407
|
+
ms(o, (a) => {
|
|
408
|
+
const u = Ot(a);
|
|
405
409
|
n(u);
|
|
406
410
|
});
|
|
407
|
-
}),
|
|
411
|
+
}), Dt.set(o, l), o;
|
|
408
412
|
}
|
|
409
|
-
function
|
|
413
|
+
function Hi(e, t) {
|
|
410
414
|
return Nr(!1, e, t);
|
|
411
415
|
}
|
|
412
|
-
function
|
|
416
|
+
function Di(e, t) {
|
|
413
417
|
return Nr(!0, e, t);
|
|
414
418
|
}
|
|
415
|
-
function
|
|
419
|
+
function As(e, t) {
|
|
416
420
|
const r = new Dr(t);
|
|
417
421
|
r.restore(e);
|
|
418
422
|
const s = (n) => {
|
|
419
|
-
const o =
|
|
423
|
+
const o = Ot(n), l = {};
|
|
420
424
|
for (let a in o) {
|
|
421
425
|
const u = o[a];
|
|
422
|
-
|
|
426
|
+
Be(u) || (l[a] = u);
|
|
423
427
|
}
|
|
424
|
-
|
|
428
|
+
tr(l) ? r.removeState() : r.saveState(l);
|
|
425
429
|
};
|
|
426
430
|
let i = null;
|
|
427
|
-
|
|
431
|
+
if (t && t.debounce === !1) i = s;
|
|
432
|
+
else {
|
|
433
|
+
const n = t && t.debounceDelay ? t.debounceDelay : 250;
|
|
434
|
+
i = Ir(s, n);
|
|
435
|
+
}
|
|
436
|
+
return new Proxy(e, {
|
|
428
437
|
get(n, o) {
|
|
429
438
|
return n[o];
|
|
430
439
|
},
|
|
@@ -433,22 +442,22 @@ function Es(e, t) {
|
|
|
433
442
|
}
|
|
434
443
|
});
|
|
435
444
|
}
|
|
436
|
-
function
|
|
437
|
-
return
|
|
445
|
+
function Ni(e, t) {
|
|
446
|
+
return As(e, t);
|
|
438
447
|
}
|
|
439
|
-
function
|
|
440
|
-
const t =
|
|
441
|
-
t && (
|
|
448
|
+
function Ui(e) {
|
|
449
|
+
const t = Dt.get(e);
|
|
450
|
+
t && (Dt.delete(e), t.stop());
|
|
442
451
|
}
|
|
443
|
-
var
|
|
452
|
+
var ze = /* @__PURE__ */ (function(e) {
|
|
444
453
|
return e[e.Static = 0] = "Static", e[e.Param = 1] = "Param", e[e.Group = 2] = "Group", e;
|
|
445
|
-
})({}),
|
|
454
|
+
})({}), qs = {
|
|
446
455
|
type: 0,
|
|
447
456
|
value: ""
|
|
448
|
-
},
|
|
449
|
-
function
|
|
457
|
+
}, $s = /[a-zA-Z0-9_]/;
|
|
458
|
+
function Ks(e) {
|
|
450
459
|
if (!e) return [[]];
|
|
451
|
-
if (e === "/") return [[
|
|
460
|
+
if (e === "/") return [[qs]];
|
|
452
461
|
if (!e.startsWith("/")) throw new Error(`Invalid path "${e}"`);
|
|
453
462
|
function t(y) {
|
|
454
463
|
throw new Error(`ERR (${r})/"${u}": ${y}`);
|
|
@@ -488,7 +497,7 @@ function $s(e) {
|
|
|
488
497
|
h(), r = s;
|
|
489
498
|
break;
|
|
490
499
|
case 1:
|
|
491
|
-
a === "(" ? r = 2 :
|
|
500
|
+
a === "(" ? r = 2 : $s.test(a) ? h() : (c(), r = 0, a !== "*" && a !== "?" && a !== "+" && l--);
|
|
492
501
|
break;
|
|
493
502
|
case 2:
|
|
494
503
|
a === ")" ? f[f.length - 1] == "\\" ? f = f.slice(0, -1) + a : r = 3 : f += a;
|
|
@@ -498,19 +507,18 @@ function $s(e) {
|
|
|
498
507
|
break;
|
|
499
508
|
default:
|
|
500
509
|
t("Unknown state");
|
|
501
|
-
break;
|
|
502
510
|
}
|
|
503
511
|
}
|
|
504
512
|
return r === 2 && t(`Unfinished custom RegExp for param "${u}"`), c(), o(), i;
|
|
505
513
|
}
|
|
506
|
-
var ur = "[^/]+?",
|
|
514
|
+
var ur = "[^/]+?", js = {
|
|
507
515
|
sensitive: !1,
|
|
508
516
|
strict: !1,
|
|
509
517
|
start: !0,
|
|
510
518
|
end: !0
|
|
511
|
-
},
|
|
512
|
-
function
|
|
513
|
-
const r = q(!0, {},
|
|
519
|
+
}, ks = /[.+*?^${}()[\]/\\]/g;
|
|
520
|
+
function Ts(e, t) {
|
|
521
|
+
const r = q(!0, {}, js, t), s = [];
|
|
514
522
|
let i = r.start ? "^" : "";
|
|
515
523
|
const n = [];
|
|
516
524
|
for (const u of e) {
|
|
@@ -519,26 +527,26 @@ function ks(e, t) {
|
|
|
519
527
|
for (let c = 0; c < u.length; c++) {
|
|
520
528
|
const h = u[c];
|
|
521
529
|
let y = 40 + (r.sensitive ? 0.25 : 0);
|
|
522
|
-
if (h.type ===
|
|
523
|
-
c || (i += "/"), i += h.value.replace(
|
|
524
|
-
else if (h.type ===
|
|
525
|
-
const { value: d, repeatable: v, optional: w, regexp:
|
|
530
|
+
if (h.type === ze.Static)
|
|
531
|
+
c || (i += "/"), i += h.value.replace(ks, "\\$&"), y += 40;
|
|
532
|
+
else if (h.type === ze.Param) {
|
|
533
|
+
const { value: d, repeatable: v, optional: w, regexp: m } = h;
|
|
526
534
|
n.push({
|
|
527
535
|
name: d,
|
|
528
536
|
repeatable: v,
|
|
529
537
|
optional: w
|
|
530
538
|
});
|
|
531
|
-
const
|
|
532
|
-
if (
|
|
539
|
+
const p = m || ur;
|
|
540
|
+
if (p !== ur) {
|
|
533
541
|
y += 10;
|
|
534
542
|
try {
|
|
535
|
-
new RegExp(`(${
|
|
543
|
+
new RegExp(`(${p})`);
|
|
536
544
|
} catch (K) {
|
|
537
|
-
throw new Error(`Invalid custom RegExp for param "${d}" (${
|
|
545
|
+
throw new Error(`Invalid custom RegExp for param "${d}" (${p}): ` + K.message);
|
|
538
546
|
}
|
|
539
547
|
}
|
|
540
|
-
let $ = v ? `((?:${
|
|
541
|
-
c || ($ = w && u.length < 2 ? `(?:/${$})` : "/" + $), w && ($ += "?"), i += $, y += 20, w && (y += -8), v && (y += -20),
|
|
548
|
+
let $ = v ? `((?:${p})(?:/(?:${p}))*)` : `(${p})`;
|
|
549
|
+
c || ($ = w && u.length < 2 ? `(?:/${$})` : "/" + $), w && ($ += "?"), i += $, y += 20, w && (y += -8), v && (y += -20), p === ".*" && (y += -50);
|
|
542
550
|
}
|
|
543
551
|
f.push(y);
|
|
544
552
|
}
|
|
@@ -563,15 +571,16 @@ function ks(e, t) {
|
|
|
563
571
|
let f = "", c = !1;
|
|
564
572
|
for (const h of e) {
|
|
565
573
|
(!c || !f.endsWith("/")) && (f += "/"), c = !1;
|
|
566
|
-
for (const y of h) if (y.type ===
|
|
567
|
-
else if (y.type ===
|
|
568
|
-
const { value: d, repeatable: v, optional: w } = y,
|
|
569
|
-
if (sr(
|
|
570
|
-
const
|
|
571
|
-
if (!
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
574
|
+
for (const y of h) if (y.type === ze.Static) f += y.value;
|
|
575
|
+
else if (y.type === ze.Param) {
|
|
576
|
+
const { value: d, repeatable: v, optional: w } = y, m = d in u ? u[d] : "";
|
|
577
|
+
if (sr(m) && !v) throw new Error(`Provided param "${d}" is an array but it is not repeatable (* or + modifiers)`);
|
|
578
|
+
const p = sr(m) ? m.join("/") : m;
|
|
579
|
+
if (!p)
|
|
580
|
+
if (w)
|
|
581
|
+
h.length < 2 && (f.endsWith("/") ? f = f.slice(0, -1) : c = !0);
|
|
582
|
+
else throw new Error(`Missing required param "${d}"`);
|
|
583
|
+
f += p;
|
|
575
584
|
}
|
|
576
585
|
}
|
|
577
586
|
return f || "/";
|
|
@@ -584,8 +593,8 @@ function ks(e, t) {
|
|
|
584
593
|
stringify: a
|
|
585
594
|
};
|
|
586
595
|
}
|
|
587
|
-
function
|
|
588
|
-
const r =
|
|
596
|
+
function Ms(e, t) {
|
|
597
|
+
const r = Ts(Ks(e), t);
|
|
589
598
|
return function(s) {
|
|
590
599
|
const i = r.parse(s);
|
|
591
600
|
return i ? {
|
|
@@ -602,11 +611,11 @@ function fr(e) {
|
|
|
602
611
|
return t = !0, Reflect.apply(e, {}, r);
|
|
603
612
|
};
|
|
604
613
|
}
|
|
605
|
-
function
|
|
614
|
+
function Ls(e) {
|
|
606
615
|
let t = e.src;
|
|
607
616
|
return new Promise((r, s) => {
|
|
608
617
|
const i = fr((l) => {
|
|
609
|
-
|
|
618
|
+
Zt(l) && (l = l.default), e.component = l, console.debug("success load async module"), r();
|
|
610
619
|
}), n = fr((l) => {
|
|
611
620
|
`${l}`, console.debug("reject load async module"), s(l);
|
|
612
621
|
});
|
|
@@ -616,14 +625,15 @@ function Ms(e) {
|
|
|
616
625
|
} catch (l) {
|
|
617
626
|
n(l);
|
|
618
627
|
}
|
|
619
|
-
if (o)
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
628
|
+
if (o)
|
|
629
|
+
if (typeof o.then == "function") o.then(i, n);
|
|
630
|
+
else {
|
|
631
|
+
const l = o.component;
|
|
632
|
+
l && typeof l.then == "function" && l.then(i, n);
|
|
633
|
+
}
|
|
624
634
|
});
|
|
625
635
|
}
|
|
626
|
-
var
|
|
636
|
+
var Is = class {
|
|
627
637
|
name;
|
|
628
638
|
level;
|
|
629
639
|
rootName;
|
|
@@ -631,7 +641,7 @@ var Ls = class {
|
|
|
631
641
|
constructor(e, t, r, s) {
|
|
632
642
|
this.name = e, this.level = t, this.rootName = r, this.rootIndex = s;
|
|
633
643
|
}
|
|
634
|
-
},
|
|
644
|
+
}, Je = class Vr {
|
|
635
645
|
to;
|
|
636
646
|
routeModel;
|
|
637
647
|
from;
|
|
@@ -646,7 +656,7 @@ var Ls = class {
|
|
|
646
656
|
static clear(t) {
|
|
647
657
|
for (let r in t) t[r] = void 0;
|
|
648
658
|
}
|
|
649
|
-
}, R = class
|
|
659
|
+
}, R = class Nt {
|
|
650
660
|
path;
|
|
651
661
|
get fullPath() {
|
|
652
662
|
const t = this.path ?? `${this.name}`;
|
|
@@ -672,7 +682,7 @@ var Ls = class {
|
|
|
672
682
|
active;
|
|
673
683
|
slot;
|
|
674
684
|
static clone(t, r) {
|
|
675
|
-
let s = new
|
|
685
|
+
let s = new Nt();
|
|
676
686
|
return kr(s, t, r), s;
|
|
677
687
|
}
|
|
678
688
|
static isSame(t, r) {
|
|
@@ -682,7 +692,7 @@ var Ls = class {
|
|
|
682
692
|
return !t || !r ? !1 : t === r || t.path && r.path && t.path === r.path ? !0 : !!(t.name && r.name && t.name === r.name);
|
|
683
693
|
}
|
|
684
694
|
static from(t) {
|
|
685
|
-
let r = new
|
|
695
|
+
let r = new Nt();
|
|
686
696
|
if (t == null) return r;
|
|
687
697
|
let s = r;
|
|
688
698
|
for (let n in t) s[n] = t[n];
|
|
@@ -690,24 +700,24 @@ var Ls = class {
|
|
|
690
700
|
if (Array.isArray(i) && i.length > 0) for (let n of i) s[n] = t[n];
|
|
691
701
|
return r;
|
|
692
702
|
}
|
|
693
|
-
},
|
|
703
|
+
}, Os = class {
|
|
694
704
|
id;
|
|
695
705
|
name;
|
|
696
706
|
props;
|
|
697
707
|
src;
|
|
698
708
|
component;
|
|
699
709
|
constructor(e, t, r) {
|
|
700
|
-
this.id =
|
|
710
|
+
this.id = Oe.get(), this.name = e, this.src = t, typeof t != "function" && (this.component = t), this.props = r;
|
|
701
711
|
}
|
|
702
712
|
get isResolved() {
|
|
703
713
|
return this.component !== void 0;
|
|
704
714
|
}
|
|
705
715
|
resolve() {
|
|
706
|
-
return
|
|
716
|
+
return Ls(this);
|
|
707
717
|
}
|
|
708
718
|
}, cr = class {
|
|
709
719
|
models = [];
|
|
710
|
-
},
|
|
720
|
+
}, gt = class {
|
|
711
721
|
path;
|
|
712
722
|
match;
|
|
713
723
|
redirect;
|
|
@@ -717,9 +727,9 @@ var Ls = class {
|
|
|
717
727
|
layers = [];
|
|
718
728
|
}, _ = /* @__PURE__ */ (function(e) {
|
|
719
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;
|
|
720
|
-
})({}),
|
|
730
|
+
})({}), wt = /* @__PURE__ */ (function(e) {
|
|
721
731
|
return e[e.Part = 0] = "Part", e[e.All = 1] = "All", e;
|
|
722
|
-
})({}), V = /* @__PURE__ */ Symbol("rootKey"), B = /* @__PURE__ */ Symbol("rootNodeKey"), fe = /* @__PURE__ */ Symbol("parentNodeKey"),
|
|
732
|
+
})({}), V = /* @__PURE__ */ Symbol("rootKey"), B = /* @__PURE__ */ Symbol("rootNodeKey"), fe = /* @__PURE__ */ Symbol("parentNodeKey"), ut = /* @__PURE__ */ Symbol("nameKey"), Y = class {
|
|
723
733
|
model;
|
|
724
734
|
route;
|
|
725
735
|
active = !0;
|
|
@@ -727,7 +737,7 @@ var Ls = class {
|
|
|
727
737
|
constructor(e, t, r = 0, s = !0) {
|
|
728
738
|
this.route = e, this.model = t, this.index = r, this.active = s;
|
|
729
739
|
}
|
|
730
|
-
},
|
|
740
|
+
}, Ce = class {
|
|
731
741
|
_slots;
|
|
732
742
|
get slots() {
|
|
733
743
|
return this._slots == null && (this._slots = jr([])), this._slots;
|
|
@@ -735,15 +745,15 @@ var Ls = class {
|
|
|
735
745
|
get empty() {
|
|
736
746
|
return this._slots == null || this._slots.value.length == 0;
|
|
737
747
|
}
|
|
738
|
-
[
|
|
748
|
+
[ut];
|
|
739
749
|
[V];
|
|
740
750
|
[B] = null;
|
|
741
751
|
[fe] = null;
|
|
742
752
|
get name() {
|
|
743
|
-
return this[
|
|
753
|
+
return this[ut];
|
|
744
754
|
}
|
|
745
755
|
constructor(e, t, r) {
|
|
746
|
-
this[
|
|
756
|
+
this[ut] = e, this[V] = t, r && (this[B] = r);
|
|
747
757
|
}
|
|
748
758
|
}, I = class {
|
|
749
759
|
view;
|
|
@@ -759,16 +769,16 @@ var Ls = class {
|
|
|
759
769
|
}
|
|
760
770
|
return !1;
|
|
761
771
|
}
|
|
762
|
-
},
|
|
772
|
+
}, bt = class {
|
|
763
773
|
views = [];
|
|
764
|
-
}, Os = class {
|
|
765
|
-
layers = [];
|
|
766
774
|
}, Hs = class {
|
|
775
|
+
layers = [];
|
|
776
|
+
}, Ds = class {
|
|
767
777
|
time;
|
|
768
778
|
route;
|
|
769
|
-
},
|
|
779
|
+
}, Ns = class {
|
|
770
780
|
forbidTime = 300;
|
|
771
|
-
submitRecorder = new
|
|
781
|
+
submitRecorder = new Ds();
|
|
772
782
|
isSameRoute(e, t) {
|
|
773
783
|
return e == null || t == null ? !1 : e.name === t.name && e.path === t.path && e.root === t.root;
|
|
774
784
|
}
|
|
@@ -783,29 +793,29 @@ var Ls = class {
|
|
|
783
793
|
release(e) {
|
|
784
794
|
this.submitRecorder.time === e && (this.submitRecorder.route = void 0);
|
|
785
795
|
}
|
|
786
|
-
}, O = /* @__PURE__ */ Symbol("chainKey"), T = /* @__PURE__ */ Symbol("cursorKey"),
|
|
796
|
+
}, O = /* @__PURE__ */ Symbol("chainKey"), T = /* @__PURE__ */ Symbol("cursorKey"), Rt = /* @__PURE__ */ Symbol("$persistentModeKey"), P = /* @__PURE__ */ Symbol("statusKey"), J = /* @__PURE__ */ Symbol("argsKey"), Ge = /* @__PURE__ */ Symbol("exArgsKey"), de = /* @__PURE__ */ Symbol("successFnsKey"), Ee = /* @__PURE__ */ Symbol("errorFnsKey"), ie = /* @__PURE__ */ Symbol("sessionKey"), G = /* @__PURE__ */ Symbol("_go"), ct = class {
|
|
787
797
|
[O] = [];
|
|
788
798
|
[T] = 0;
|
|
789
|
-
[
|
|
799
|
+
[Rt] = !1;
|
|
790
800
|
[P] = "Free";
|
|
791
801
|
[J] = [];
|
|
792
|
-
[
|
|
793
|
-
[
|
|
794
|
-
[
|
|
802
|
+
[Ge] = [];
|
|
803
|
+
[de] = [];
|
|
804
|
+
[Ee] = [];
|
|
795
805
|
[ie];
|
|
796
806
|
get session() {
|
|
797
807
|
return this[ie];
|
|
798
808
|
}
|
|
799
809
|
constructor(e, t = !1) {
|
|
800
|
-
this[ie] = e, this[
|
|
810
|
+
this[ie] = e, this[Rt] = t;
|
|
801
811
|
}
|
|
802
812
|
[G](e, ...t) {
|
|
803
813
|
let r = this[P];
|
|
804
814
|
if (this[P] = "Busy", this[T] += e, this[T] < 0 && (this[T] = 0), this[J] = t, r === "Exception" || r === "Reject") {
|
|
805
|
-
let n = [{ session: this[ie] }, ...this[
|
|
806
|
-
for (; this[
|
|
807
|
-
let o = this[
|
|
808
|
-
typeof o == "function" &&
|
|
815
|
+
let n = [{ session: this[ie] }, ...this[Ge]];
|
|
816
|
+
for (; this[Ee].length > 0; ) try {
|
|
817
|
+
let o = this[Ee].shift();
|
|
818
|
+
typeof o == "function" && He(() => {
|
|
809
819
|
Reflect.apply(o, {}, n);
|
|
810
820
|
});
|
|
811
821
|
} catch (o) {
|
|
@@ -814,9 +824,9 @@ var Ls = class {
|
|
|
814
824
|
return this[P] = r, this[O] = [], this[T] = 0, this;
|
|
815
825
|
} else if (r === "Finished" || this[T] >= this[O].length) {
|
|
816
826
|
let n = [{ session: this[ie] }, ...this[J]];
|
|
817
|
-
for (; this[
|
|
818
|
-
let o = this[
|
|
819
|
-
typeof o == "function" &&
|
|
827
|
+
for (; this[de].length > 0; ) {
|
|
828
|
+
let o = this[de].shift();
|
|
829
|
+
typeof o == "function" && He(() => {
|
|
820
830
|
Reflect.apply(o, {}, n);
|
|
821
831
|
});
|
|
822
832
|
}
|
|
@@ -825,7 +835,7 @@ var Ls = class {
|
|
|
825
835
|
if (this[T] >= this[O].length)
|
|
826
836
|
return this[P] = "Free", this;
|
|
827
837
|
let s = this[O][this[T]];
|
|
828
|
-
this[
|
|
838
|
+
this[Rt] || (this[O].splice(0, this[T] + 1), this[T] = -1);
|
|
829
839
|
let i = this[T] + 1;
|
|
830
840
|
try {
|
|
831
841
|
let n = !1, o = {
|
|
@@ -843,7 +853,7 @@ var Ls = class {
|
|
|
843
853
|
},
|
|
844
854
|
session: this[ie]
|
|
845
855
|
};
|
|
846
|
-
|
|
856
|
+
He(() => {
|
|
847
857
|
Reflect.apply(s, {}, [o, ...this[J]]);
|
|
848
858
|
});
|
|
849
859
|
} catch (n) {
|
|
@@ -858,17 +868,17 @@ var Ls = class {
|
|
|
858
868
|
return this[P] = "Finished", this[J] = e, Reflect.apply(this[G], this, [0]);
|
|
859
869
|
}
|
|
860
870
|
reject(...e) {
|
|
861
|
-
return this[P] = "Reject", this[
|
|
871
|
+
return this[P] = "Reject", this[Ge] = e, Reflect.apply(this[G], this, [0]);
|
|
862
872
|
}
|
|
863
873
|
throw(...e) {
|
|
864
|
-
return this[P] = "Exception", this[
|
|
874
|
+
return this[P] = "Exception", this[Ge] = e, Reflect.apply(this[G], this, [0]);
|
|
865
875
|
}
|
|
866
876
|
reset(...e) {
|
|
867
877
|
this[P] = "Busy", this[J] = e, this[O] = [], this[T] = 0;
|
|
868
878
|
let t = [{ session: this[ie] }, ...this[J]];
|
|
869
|
-
for (; this[
|
|
870
|
-
let r = this[
|
|
871
|
-
|
|
879
|
+
for (; this[de].length > 0; ) {
|
|
880
|
+
let r = this[de].shift();
|
|
881
|
+
He(() => {
|
|
872
882
|
Reflect.apply(r, this, t);
|
|
873
883
|
});
|
|
874
884
|
}
|
|
@@ -878,22 +888,22 @@ var Ls = class {
|
|
|
878
888
|
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));
|
|
879
889
|
}
|
|
880
890
|
wait(e, t) {
|
|
881
|
-
return e && typeof e == "function" && this[
|
|
891
|
+
return e && typeof e == "function" && this[de].push(e), t && typeof t == "function" && this[Ee].push(t), this[P] === "Busy" ? this : (Reflect.apply(this[G], this, [0, ...this[J]]), this);
|
|
882
892
|
}
|
|
883
893
|
exception(e) {
|
|
884
|
-
return e && typeof e == "function" && this[
|
|
894
|
+
return e && typeof e == "function" && this[Ee].push(e), this[P] === "Busy" ? this : Reflect.apply(this[G], this, [0, ...this[J]]);
|
|
885
895
|
}
|
|
886
896
|
isFinish() {
|
|
887
897
|
return this[P] == "Reject" || this[P] == "Free" && this[T] >= this[O].length;
|
|
888
898
|
}
|
|
889
|
-
},
|
|
899
|
+
}, we = /* @__PURE__ */ Symbol("_notifyChange"), St = class {
|
|
890
900
|
currentRoute;
|
|
891
901
|
routes;
|
|
892
902
|
constructor(e, t) {
|
|
893
903
|
this.currentRoute = e, this.routes = t;
|
|
894
904
|
}
|
|
895
|
-
}, ne = /* @__PURE__ */ Symbol("historyChangeConsumerKey"), hr = /* @__PURE__ */ Symbol("_navigateFirstRoute"),
|
|
896
|
-
function
|
|
905
|
+
}, ne = /* @__PURE__ */ Symbol("historyChangeConsumerKey"), hr = /* @__PURE__ */ Symbol("_navigateFirstRoute"), Xe = /* @__PURE__ */ Symbol("_getRouteMark"), xt = /* @__PURE__ */ Symbol("_getUrlSearch"), Pt = /* @__PURE__ */ Symbol("_generateLocation"), Qe = /* @__PURE__ */ Symbol("_setRouteMarkRecorder"), Ae = /* @__PURE__ */ Symbol("beforeRestoreFiltersKey"), yr = /* @__PURE__ */ Symbol("_beforeRestore"), dr = "Symbol(_fox_restore_point)";
|
|
906
|
+
function Ze(e, ...t) {
|
|
897
907
|
return typeof e == "function" ? Reflect.apply(e, null, [...t]) : e;
|
|
898
908
|
}
|
|
899
909
|
function vr(e) {
|
|
@@ -913,7 +923,7 @@ var Wr = class {
|
|
|
913
923
|
changeHandler;
|
|
914
924
|
historyChange;
|
|
915
925
|
[ne] = !1;
|
|
916
|
-
[
|
|
926
|
+
[Ae] = new Array();
|
|
917
927
|
backTimeout = 320;
|
|
918
928
|
constructor(e = "hash", t = "", r = "", s = !0, i = !0, n = !1, o, l) {
|
|
919
929
|
this.mode = e, this.base = t, this.query = r, this.firstNavigate = s, this.historyMonitor = i, this.traceless = n, this.storage = o ?? F().sessionStorage, this.backTimeout = l ?? 320;
|
|
@@ -928,25 +938,28 @@ var Wr = class {
|
|
|
928
938
|
this[ne] = !1;
|
|
929
939
|
return;
|
|
930
940
|
}
|
|
931
|
-
if (
|
|
941
|
+
if (Ze(this.historyMonitor)) {
|
|
932
942
|
const r = t.history.state;
|
|
933
|
-
this[
|
|
943
|
+
this[we](r);
|
|
934
944
|
try {
|
|
935
945
|
let s = [];
|
|
936
946
|
if (typeof r == "string" ? s = JSON.parse(r) : s = r, Array.isArray(s) && s.length > 0) {
|
|
937
|
-
const i = this[
|
|
938
|
-
this[
|
|
947
|
+
const i = this[Xe]() ?? "/";
|
|
948
|
+
this[Qe](i, s);
|
|
939
949
|
}
|
|
940
950
|
} catch {
|
|
941
951
|
}
|
|
942
952
|
}
|
|
943
|
-
}),
|
|
953
|
+
}), ft(t, "popstate", this.historyChange), this.firstNavigate && e && this[hr](), Promise.resolve();
|
|
944
954
|
}
|
|
945
955
|
destroy() {
|
|
946
|
-
|
|
956
|
+
if (this.historyChange) {
|
|
957
|
+
const e = F();
|
|
958
|
+
Xt(e, "popstate", this.historyChange);
|
|
959
|
+
}
|
|
947
960
|
}
|
|
948
961
|
[yr](e, t, r, s) {
|
|
949
|
-
for (let i of this[
|
|
962
|
+
for (let i of this[Ae]) try {
|
|
950
963
|
const n = Reflect.apply(i, {}, [
|
|
951
964
|
e,
|
|
952
965
|
t,
|
|
@@ -960,21 +973,21 @@ var Wr = class {
|
|
|
960
973
|
return !0;
|
|
961
974
|
}
|
|
962
975
|
beforeRestoreEach(e) {
|
|
963
|
-
this[
|
|
976
|
+
this[Ae].push(e);
|
|
964
977
|
}
|
|
965
978
|
removeBeforeRestoreEach(e) {
|
|
966
|
-
const t = this[
|
|
967
|
-
return t !== -1 ? (this[
|
|
979
|
+
const t = this[Ae].indexOf(e);
|
|
980
|
+
return t !== -1 ? (this[Ae].splice(t, 1), !0) : !1;
|
|
968
981
|
}
|
|
969
982
|
[hr]() {
|
|
970
|
-
const e = this[
|
|
983
|
+
const e = this[Xe]() ?? "/", t = this.storage.getItem(dr);
|
|
971
984
|
if (t) try {
|
|
972
985
|
const n = JSON.parse(t);
|
|
973
986
|
if (n.mark === e && Array.isArray(n.routes) && n.routes.length > 0) {
|
|
974
987
|
const o = n.routes.filter((l, a) => (l.params = l.params ? Lr(l.params) : {}, this[yr](l, a, e, n.routes)));
|
|
975
988
|
if (o.length > 0) {
|
|
976
|
-
const l = this[
|
|
977
|
-
o[a].query = l || o[a].query, this[
|
|
989
|
+
const l = this[xt](), a = o.length - 1;
|
|
990
|
+
o[a].query = l || o[a].query, this[we](o);
|
|
978
991
|
return;
|
|
979
992
|
}
|
|
980
993
|
}
|
|
@@ -984,9 +997,9 @@ var Wr = class {
|
|
|
984
997
|
let s;
|
|
985
998
|
r != -1 ? s = e.substring(r + 1) : s = e;
|
|
986
999
|
const i = new R();
|
|
987
|
-
i.path = s, i.query = this[
|
|
1000
|
+
i.path = s, i.query = this[xt](), this[we]([i]);
|
|
988
1001
|
}
|
|
989
|
-
[
|
|
1002
|
+
[Qe](e, t) {
|
|
990
1003
|
try {
|
|
991
1004
|
t.forEach((s) => {
|
|
992
1005
|
s.params = s.params ? Mr(s.params) : {};
|
|
@@ -1001,13 +1014,13 @@ var Wr = class {
|
|
|
1001
1014
|
}
|
|
1002
1015
|
}
|
|
1003
1016
|
setRestorePoint(e) {
|
|
1004
|
-
const t = this[
|
|
1005
|
-
this[
|
|
1017
|
+
const t = this[Xe]() ?? "/";
|
|
1018
|
+
this[Qe](t, e);
|
|
1006
1019
|
}
|
|
1007
|
-
[
|
|
1020
|
+
[we](e) {
|
|
1008
1021
|
typeof this.changeHandler == "function" && this.changeHandler(e);
|
|
1009
1022
|
}
|
|
1010
|
-
[
|
|
1023
|
+
[Xe]() {
|
|
1011
1024
|
const e = F();
|
|
1012
1025
|
if (this.mode === "path") {
|
|
1013
1026
|
let t = e.location.pathname;
|
|
@@ -1018,7 +1031,7 @@ var Wr = class {
|
|
|
1018
1031
|
}
|
|
1019
1032
|
return null;
|
|
1020
1033
|
}
|
|
1021
|
-
[
|
|
1034
|
+
[xt]() {
|
|
1022
1035
|
let e = F().location.search;
|
|
1023
1036
|
return e.length > 0 && e.indexOf("?") === 0 && (e = e.substring(1)), e;
|
|
1024
1037
|
}
|
|
@@ -1060,7 +1073,7 @@ var Wr = class {
|
|
|
1060
1073
|
let y = !1;
|
|
1061
1074
|
for (let d = f - 1; d >= 0; d--) {
|
|
1062
1075
|
const v = R.from(u[d]);
|
|
1063
|
-
if (!(v.traceless === !0 ||
|
|
1076
|
+
if (!(v.traceless === !0 || Ze(this.traceless, v)) && R.isSame(v, e)) {
|
|
1064
1077
|
y = !0;
|
|
1065
1078
|
break;
|
|
1066
1079
|
}
|
|
@@ -1077,17 +1090,17 @@ var Wr = class {
|
|
|
1077
1090
|
}
|
|
1078
1091
|
setRouteMark(e) {
|
|
1079
1092
|
const t = e.currentRoute.fullPath;
|
|
1080
|
-
this[
|
|
1093
|
+
this[Qe](t, e.routes);
|
|
1081
1094
|
}
|
|
1082
1095
|
push(e) {
|
|
1083
|
-
const t = this[
|
|
1084
|
-
e.currentRoute.historyUpdatePolicy !== "traceless" && !
|
|
1096
|
+
const t = this[Pt](e.currentRoute);
|
|
1097
|
+
e.currentRoute.historyUpdatePolicy !== "traceless" && !Ze(this.traceless, e.currentRoute) && F().history.pushState(e.routes, "", t), this.setRouteMark(e);
|
|
1085
1098
|
}
|
|
1086
1099
|
replace(e) {
|
|
1087
|
-
const t = this[
|
|
1088
|
-
(e.currentRoute.historyUpdatePolicy !== "traceless" || !
|
|
1100
|
+
const t = this[Pt](e.currentRoute);
|
|
1101
|
+
(e.currentRoute.historyUpdatePolicy !== "traceless" || !Ze(this.traceless, e.currentRoute)) && F().history.replaceState(e.routes, "", t), this.setRouteMark(e);
|
|
1089
1102
|
}
|
|
1090
|
-
[
|
|
1103
|
+
[Pt](e) {
|
|
1091
1104
|
const t = F();
|
|
1092
1105
|
let r = "";
|
|
1093
1106
|
if (e.query) {
|
|
@@ -1106,13 +1119,13 @@ var Wr = class {
|
|
|
1106
1119
|
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}`;
|
|
1107
1120
|
}
|
|
1108
1121
|
};
|
|
1109
|
-
function
|
|
1122
|
+
function Bi(e = !0, t = null, r = "", s = !0, i = !1, n) {
|
|
1110
1123
|
return t !== null && (t = F().location.pathname), t && t.endsWith("/") && (t = t.substring(0, t.length - 1)), new Wr("path", t ?? "", r, e, s, i, n);
|
|
1111
1124
|
}
|
|
1112
|
-
function
|
|
1125
|
+
function Us(e = !0, t = "", r = !0, s = !1, i) {
|
|
1113
1126
|
return new Wr("hash", "", t, e, r, s, i);
|
|
1114
1127
|
}
|
|
1115
|
-
var
|
|
1128
|
+
var Bs = class {
|
|
1116
1129
|
maxSize = 50;
|
|
1117
1130
|
cursor = -1;
|
|
1118
1131
|
queue = [];
|
|
@@ -1137,7 +1150,7 @@ var Us = class {
|
|
|
1137
1150
|
listen(e) {
|
|
1138
1151
|
this.changeHandler = e;
|
|
1139
1152
|
}
|
|
1140
|
-
[
|
|
1153
|
+
[we](e) {
|
|
1141
1154
|
typeof this.changeHandler == "function" && this.changeHandler(e);
|
|
1142
1155
|
}
|
|
1143
1156
|
go(e, t = !1) {
|
|
@@ -1148,7 +1161,7 @@ var Us = class {
|
|
|
1148
1161
|
let s = !1;
|
|
1149
1162
|
if (typeof t == "function" ? s = t() : s = t, !s) {
|
|
1150
1163
|
const i = this.queue[r];
|
|
1151
|
-
this[
|
|
1164
|
+
this[we](i.routes);
|
|
1152
1165
|
}
|
|
1153
1166
|
}
|
|
1154
1167
|
}
|
|
@@ -1179,51 +1192,51 @@ var Us = class {
|
|
|
1179
1192
|
setRestorePoint(e) {
|
|
1180
1193
|
}
|
|
1181
1194
|
};
|
|
1182
|
-
function
|
|
1183
|
-
return new
|
|
1195
|
+
function Vs(e = "", t = 50) {
|
|
1196
|
+
return new Bs(e, t);
|
|
1184
1197
|
}
|
|
1185
|
-
var
|
|
1186
|
-
function
|
|
1198
|
+
var Ye = /* @__PURE__ */ Symbol("_constructRouteModel"), et = /* @__PURE__ */ Symbol("_findRouteModel"), _t = /* @__PURE__ */ Symbol("_findRootView"), Ws = /* @__PURE__ */ Symbol("_getFirstView"), oe = /* @__PURE__ */ Symbol("_removeView"), mr = /* @__PURE__ */ Symbol("_buildPage"), pr = /* @__PURE__ */ Symbol("_resolveComponent"), gr = /* @__PURE__ */ Symbol("_update"), ee = /* @__PURE__ */ Symbol("_merge"), Ft = /* @__PURE__ */ Symbol("_handleHistoryChange"), le = /* @__PURE__ */ Symbol("_handleRouteUpdated"), tt = /* @__PURE__ */ Symbol("routeUpdatedCallback"), qe = /* @__PURE__ */ Symbol("currentRoute"), g = /* @__PURE__ */ Symbol("currentRoutes"), rt = /* @__PURE__ */ Symbol("routeSessionCacheKey"), wr = /* @__PURE__ */ Symbol("_addRouteRecorder"), $e = /* @__PURE__ */ Symbol("_removeRouteRecorder"), Ke = /* @__PURE__ */ Symbol("_cloneRouteRecorder"), A = /* @__PURE__ */ Symbol("_handleError"), st = /* @__PURE__ */ Symbol("errorCallback"), H = /* @__PURE__ */ Symbol("registerKey"), it = /* @__PURE__ */ Symbol("notFoundKey"), Ct = /* @__PURE__ */ Symbol("notFoundPathKey"), U = /* @__PURE__ */ Symbol("forestKey"), x = /* @__PURE__ */ Symbol("historyKey"), je = /* @__PURE__ */ Symbol("beforeFiltersKey"), ke = /* @__PURE__ */ Symbol("afterFiltersKey"), Te = /* @__PURE__ */ Symbol("destroyFiltersKey"), Et = /* @__PURE__ */ Symbol("propsFilterKey"), ve = /* @__PURE__ */ Symbol("mainDispatcherKey"), nt = /* @__PURE__ */ Symbol("initKey"), ae = /* @__PURE__ */ Symbol("readyKey"), ot = /* @__PURE__ */ Symbol("readyHandlersKey"), lt = /* @__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"), Le = /* @__PURE__ */ Symbol("routerGuardKey");
|
|
1199
|
+
function zs(e) {
|
|
1187
1200
|
return e.layers.length == 0 || e.layers[0].views.length == 0;
|
|
1188
1201
|
}
|
|
1189
|
-
var
|
|
1202
|
+
var Js = class {
|
|
1190
1203
|
[H] = new Array();
|
|
1191
|
-
[
|
|
1192
|
-
[
|
|
1204
|
+
[it];
|
|
1205
|
+
[Ct] = "*";
|
|
1193
1206
|
[ae] = !1;
|
|
1194
|
-
[
|
|
1195
|
-
[U] = new
|
|
1207
|
+
[ot] = [];
|
|
1208
|
+
[U] = new Hs();
|
|
1196
1209
|
[x];
|
|
1197
|
-
[
|
|
1198
|
-
[
|
|
1199
|
-
[
|
|
1200
|
-
[
|
|
1201
|
-
[
|
|
1202
|
-
[Ke] = new Array();
|
|
1210
|
+
[g] = new Array();
|
|
1211
|
+
[qe] = jr(null);
|
|
1212
|
+
[rt] = /* @__PURE__ */ new WeakMap();
|
|
1213
|
+
[st] = null;
|
|
1214
|
+
[tt] = null;
|
|
1203
1215
|
[je] = new Array();
|
|
1204
1216
|
[ke] = new Array();
|
|
1205
|
-
[
|
|
1206
|
-
[
|
|
1207
|
-
[
|
|
1208
|
-
[
|
|
1217
|
+
[Te] = new Array();
|
|
1218
|
+
[Et] = null;
|
|
1219
|
+
[ve] = new ct();
|
|
1220
|
+
[Le] = new Ns();
|
|
1221
|
+
[nt] = !1;
|
|
1209
1222
|
get currentRoute() {
|
|
1210
|
-
return
|
|
1223
|
+
return ys(this[qe]);
|
|
1211
1224
|
}
|
|
1212
1225
|
options;
|
|
1213
1226
|
constructor(e) {
|
|
1214
1227
|
this.options = e ?? {}, this.options.notFoundPath && this.setNotFoundPath(this.options.notFoundPath);
|
|
1215
1228
|
let t = this.options.routes || [];
|
|
1216
|
-
this.addRoutes(t), this.options.notFound && this.setNotFoundRoute(this.options.notFound), e.history ? this[x] = e.history : this[x] =
|
|
1229
|
+
this.addRoutes(t), this.options.notFound && this.setNotFoundRoute(this.options.notFound), e.history ? this[x] = e.history : this[x] = Re ? Us() : Vs(), this[x]?.listen(async (r) => {
|
|
1217
1230
|
let s = !0;
|
|
1218
1231
|
try {
|
|
1219
1232
|
if (typeof r == "string") {
|
|
1220
1233
|
const i = this[M](r);
|
|
1221
|
-
i && await this[
|
|
1222
|
-
} else await this[
|
|
1234
|
+
i && await this[Ft]([i]);
|
|
1235
|
+
} else await this[Ft](r);
|
|
1223
1236
|
} catch (i) {
|
|
1224
1237
|
console.error(i.message, i), s = !1;
|
|
1225
1238
|
}
|
|
1226
|
-
this[ae] === !1 && this[
|
|
1239
|
+
this[ae] === !1 && this[lt](s);
|
|
1227
1240
|
});
|
|
1228
1241
|
}
|
|
1229
1242
|
[A](e = "error", t) {
|
|
@@ -1231,48 +1244,48 @@ var zs = class {
|
|
|
1231
1244
|
t.error(e);
|
|
1232
1245
|
} catch {
|
|
1233
1246
|
}
|
|
1234
|
-
if (typeof this[
|
|
1235
|
-
this[
|
|
1247
|
+
if (typeof this[st] == "function") try {
|
|
1248
|
+
this[st](e, t);
|
|
1236
1249
|
} catch {
|
|
1237
1250
|
}
|
|
1238
1251
|
console.error(e);
|
|
1239
1252
|
}
|
|
1240
1253
|
init() {
|
|
1241
|
-
this[
|
|
1254
|
+
this[nt] !== !0 && (this[x]?.init(!this[ae]), this[nt] = !0);
|
|
1242
1255
|
}
|
|
1243
1256
|
destroy() {
|
|
1244
|
-
this[x]?.destroy(), this[
|
|
1257
|
+
this[x]?.destroy(), this[nt] = !1;
|
|
1245
1258
|
}
|
|
1246
1259
|
isReady() {
|
|
1247
1260
|
return this[ae] ? Promise.resolve() : new Promise((e, t) => {
|
|
1248
|
-
this[
|
|
1261
|
+
this[ot].push([e, t]);
|
|
1249
1262
|
});
|
|
1250
1263
|
}
|
|
1251
|
-
[
|
|
1252
|
-
this[ae] = !0, this[
|
|
1264
|
+
[lt](e) {
|
|
1265
|
+
this[ae] = !0, this[ot].forEach(([t, r]) => {
|
|
1253
1266
|
try {
|
|
1254
1267
|
e ? t() : r();
|
|
1255
1268
|
} catch (s) {
|
|
1256
1269
|
console.error(s.message, s);
|
|
1257
1270
|
}
|
|
1258
|
-
}), this[
|
|
1271
|
+
}), this[ot] = [];
|
|
1259
1272
|
}
|
|
1260
|
-
[
|
|
1273
|
+
[Ft](e) {
|
|
1261
1274
|
try {
|
|
1262
1275
|
if (!e) {
|
|
1263
|
-
let n = [...this[
|
|
1264
|
-
return this[
|
|
1276
|
+
let n = [...this[g]].reverse();
|
|
1277
|
+
return this[Me](n), Re && F().location.reload(), Promise.resolve();
|
|
1265
1278
|
}
|
|
1266
1279
|
let t = null, r = [], s = [], i = 0;
|
|
1267
|
-
for (; i < e.length && i < this[
|
|
1268
|
-
e[i].active === !0 && e[i].active !== this[
|
|
1280
|
+
for (; i < e.length && i < this[g].length && R.isSame(e[i], this[g][i]); i++)
|
|
1281
|
+
e[i].active === !0 && e[i].active !== this[g][i].active && (t = e[i]);
|
|
1269
1282
|
if (i < e.length) r = e.slice(i);
|
|
1270
|
-
else if (i === e.length) for (; i < this[
|
|
1271
|
-
r.push(this[
|
|
1272
|
-
if (i < this[
|
|
1283
|
+
else if (i === e.length) for (; i < this[g].length && this[g][i].historyUpdatePolicy === "traceless"; i++)
|
|
1284
|
+
r.push(this[g][i]), t = e[i];
|
|
1285
|
+
if (i < this[g].length && (s = this[g].slice(i).reverse()), s.length === 0 && r.length === 0) {
|
|
1273
1286
|
if (t !== null) return this.restore([t]);
|
|
1274
1287
|
} else if (s.length > 0) {
|
|
1275
|
-
if (this[
|
|
1288
|
+
if (this[Me](s)) {
|
|
1276
1289
|
if (r.length > 0) return this.restore(r);
|
|
1277
1290
|
if (t !== null) return this.restore([t]);
|
|
1278
1291
|
}
|
|
@@ -1283,55 +1296,55 @@ var zs = class {
|
|
|
1283
1296
|
return Promise.resolve();
|
|
1284
1297
|
}
|
|
1285
1298
|
[le](e = null) {
|
|
1286
|
-
if (this[
|
|
1287
|
-
this[
|
|
1299
|
+
if (this[qe].value = e, typeof this[tt] == "function") try {
|
|
1300
|
+
this[tt](e);
|
|
1288
1301
|
} catch {
|
|
1289
1302
|
}
|
|
1290
1303
|
}
|
|
1291
1304
|
[wr](e, t) {
|
|
1292
1305
|
if (e.opsType === _.Open) {
|
|
1293
1306
|
let r = !1;
|
|
1294
|
-
const s = this[
|
|
1307
|
+
const s = this[g].length - 1;
|
|
1295
1308
|
for (let i = s; i >= 0; i--) {
|
|
1296
|
-
const n = this[
|
|
1309
|
+
const n = this[g][i];
|
|
1297
1310
|
if (e.root == n.root) {
|
|
1298
1311
|
if (e.path === n.path) {
|
|
1299
|
-
this[
|
|
1312
|
+
this[g].splice(i, 1, e), r = !0;
|
|
1300
1313
|
continue;
|
|
1301
1314
|
}
|
|
1302
1315
|
e.active && (n.active = !1);
|
|
1303
1316
|
}
|
|
1304
1317
|
}
|
|
1305
|
-
r || this[
|
|
1306
|
-
} else this[
|
|
1307
|
-
this[
|
|
1318
|
+
r || this[g].push(e);
|
|
1319
|
+
} else this[g].push(e);
|
|
1320
|
+
this[rt].set(e, t), this[le](e);
|
|
1308
1321
|
}
|
|
1309
|
-
[
|
|
1322
|
+
[Ke]() {
|
|
1310
1323
|
let e = [];
|
|
1311
|
-
for (let t of this[
|
|
1324
|
+
for (let t of this[g]) {
|
|
1312
1325
|
let r = R.clone(t, !0);
|
|
1313
1326
|
e.push(r);
|
|
1314
1327
|
}
|
|
1315
1328
|
return e;
|
|
1316
1329
|
}
|
|
1317
|
-
[
|
|
1318
|
-
if (!this[
|
|
1330
|
+
[$e](e) {
|
|
1331
|
+
if (!this[g]) {
|
|
1319
1332
|
this[le](null);
|
|
1320
1333
|
return;
|
|
1321
1334
|
}
|
|
1322
1335
|
let t = -1;
|
|
1323
|
-
for (let r = 0; r < this[
|
|
1336
|
+
for (let r = 0; r < this[g].length; r++) if (R.isSame(this[g][r], e)) {
|
|
1324
1337
|
t = r;
|
|
1325
1338
|
break;
|
|
1326
1339
|
}
|
|
1327
1340
|
if (t != -1) {
|
|
1328
|
-
const r = this[
|
|
1329
|
-
this[
|
|
1330
|
-
const s = this[
|
|
1331
|
-
if (this[
|
|
1332
|
-
const i = this[
|
|
1333
|
-
this[le](this[
|
|
1334
|
-
} else this[
|
|
1341
|
+
const r = this[g][t];
|
|
1342
|
+
this[g].splice(t, 1);
|
|
1343
|
+
const s = this[rt].get(r);
|
|
1344
|
+
if (this[rt].delete(r), this[Rr](r, s), r.opsType === _.Append) {
|
|
1345
|
+
const i = this[g].length - 1;
|
|
1346
|
+
this[le](this[g][i] ?? null);
|
|
1347
|
+
} else this[qe].value && R.isSame(this[qe].value, e) && this[le](null);
|
|
1335
1348
|
} else this[le](null);
|
|
1336
1349
|
}
|
|
1337
1350
|
set historyMonitor(e) {
|
|
@@ -1347,41 +1360,41 @@ var zs = class {
|
|
|
1347
1360
|
return this[x]?.traceless ?? !1;
|
|
1348
1361
|
}
|
|
1349
1362
|
set propsFilter(e) {
|
|
1350
|
-
this[
|
|
1363
|
+
this[Et] = e;
|
|
1351
1364
|
}
|
|
1352
1365
|
get propsFilter() {
|
|
1353
|
-
return this[
|
|
1366
|
+
return this[Et];
|
|
1354
1367
|
}
|
|
1355
1368
|
setRestorePoint() {
|
|
1356
|
-
const e = this[
|
|
1369
|
+
const e = this[Ke]();
|
|
1357
1370
|
this[x]?.setRestorePoint(e);
|
|
1358
1371
|
}
|
|
1359
1372
|
onRouteUpdated(e) {
|
|
1360
|
-
this[
|
|
1373
|
+
this[tt] = e;
|
|
1361
1374
|
}
|
|
1362
1375
|
onError(e) {
|
|
1363
|
-
this[
|
|
1376
|
+
this[st] = e;
|
|
1364
1377
|
}
|
|
1365
1378
|
beforeEach(e) {
|
|
1366
|
-
this[
|
|
1379
|
+
this[je].push(e);
|
|
1367
1380
|
}
|
|
1368
1381
|
removeBeforeEach(e) {
|
|
1369
|
-
const t = this[
|
|
1370
|
-
return t !== -1 ? (this[
|
|
1382
|
+
const t = this[je].indexOf(e);
|
|
1383
|
+
return t !== -1 ? (this[je].splice(t, 1), !0) : !1;
|
|
1371
1384
|
}
|
|
1372
1385
|
afterEach(e) {
|
|
1373
|
-
this[
|
|
1386
|
+
this[ke].push(e);
|
|
1374
1387
|
}
|
|
1375
1388
|
removeAfterEach(e) {
|
|
1376
|
-
const t = this[
|
|
1377
|
-
return t !== -1 ? (this[
|
|
1389
|
+
const t = this[ke].indexOf(e);
|
|
1390
|
+
return t !== -1 ? (this[ke].splice(t, 1), !0) : !1;
|
|
1378
1391
|
}
|
|
1379
1392
|
destroyEach(e) {
|
|
1380
|
-
this[
|
|
1393
|
+
this[Te].push(e);
|
|
1381
1394
|
}
|
|
1382
1395
|
removeDestroyEach(e) {
|
|
1383
|
-
const t = this[
|
|
1384
|
-
return t !== -1 ? (this[
|
|
1396
|
+
const t = this[Te].indexOf(e);
|
|
1397
|
+
return t !== -1 ? (this[Te].splice(t, 1), !0) : !1;
|
|
1385
1398
|
}
|
|
1386
1399
|
beforeRestoreEach(e) {
|
|
1387
1400
|
this[x]?.beforeRestoreEach(e);
|
|
@@ -1393,11 +1406,11 @@ var zs = class {
|
|
|
1393
1406
|
for (let t of e) this.addRoute(t);
|
|
1394
1407
|
}
|
|
1395
1408
|
addRoute(e, t = -1) {
|
|
1396
|
-
if (e.path === this[
|
|
1409
|
+
if (e.path === this[Ct]) {
|
|
1397
1410
|
this.setNotFoundRoute(e);
|
|
1398
1411
|
return;
|
|
1399
1412
|
}
|
|
1400
|
-
const r = this[
|
|
1413
|
+
const r = this[Ye](e);
|
|
1401
1414
|
if (t == -1) this[H] = [...this[H], ...r];
|
|
1402
1415
|
else for (let s = r.length - 1; s >= 0; s--) this[H].splice(t, 0, r[s]);
|
|
1403
1416
|
}
|
|
@@ -1421,21 +1434,21 @@ var zs = class {
|
|
|
1421
1434
|
}) !== -1;
|
|
1422
1435
|
}
|
|
1423
1436
|
setNotFoundPath(e) {
|
|
1424
|
-
this[
|
|
1437
|
+
this[Ct] = e;
|
|
1425
1438
|
}
|
|
1426
1439
|
setNotFoundRoute(e) {
|
|
1427
|
-
const t = this[
|
|
1428
|
-
this[
|
|
1440
|
+
const t = this[Ye](e);
|
|
1441
|
+
this[it] = t[0];
|
|
1429
1442
|
}
|
|
1430
1443
|
getRoutes() {
|
|
1431
1444
|
return [...this[H]];
|
|
1432
1445
|
}
|
|
1433
|
-
[
|
|
1446
|
+
[Ye](e) {
|
|
1434
1447
|
let t = e.path ?? "";
|
|
1435
1448
|
t.length > 0 && t.charAt(0) !== "/" && (t = `/${t}`);
|
|
1436
1449
|
let r = e.components ?? (e.component && { "": e.component });
|
|
1437
1450
|
if (!r) {
|
|
1438
|
-
const l = new
|
|
1451
|
+
const l = new gt();
|
|
1439
1452
|
return l.path = t, l.redirect = e.redirect, [l];
|
|
1440
1453
|
}
|
|
1441
1454
|
const s = new R();
|
|
@@ -1444,14 +1457,14 @@ var zs = class {
|
|
|
1444
1457
|
for (let l in r) {
|
|
1445
1458
|
const a = r[l];
|
|
1446
1459
|
l.length === 0 && (l = Ur);
|
|
1447
|
-
const u = new
|
|
1460
|
+
const u = new Os(l, a, e.props);
|
|
1448
1461
|
i.push(u);
|
|
1449
1462
|
}
|
|
1450
1463
|
let n = !1, o = [];
|
|
1451
1464
|
if (e.children) for (let l of e.children) {
|
|
1452
|
-
const a = this[
|
|
1465
|
+
const a = this[Ye](l);
|
|
1453
1466
|
for (let u of a) {
|
|
1454
|
-
let f = new
|
|
1467
|
+
let f = new gt();
|
|
1455
1468
|
f.name = u.name, u.path && u.path.length > 0 ? t !== "/" ? f.path = `${t}${u.path}` : f.path = u.path : (n = !0, f.path = t);
|
|
1456
1469
|
let c = new cr();
|
|
1457
1470
|
c.models = [...i], f.layers = [c, ...u.layers], f.matchedRoutes = [s, ...u.matchedRoutes ?? []], o.push(f);
|
|
@@ -1460,19 +1473,19 @@ var zs = class {
|
|
|
1460
1473
|
if (!n) {
|
|
1461
1474
|
const l = new cr();
|
|
1462
1475
|
l.models = i;
|
|
1463
|
-
const a = new
|
|
1476
|
+
const a = new gt();
|
|
1464
1477
|
a.name = e.name, a.path = t, a.matchedRoutes = [s], a.layers = [l], o.splice(0, 0, a);
|
|
1465
1478
|
}
|
|
1466
1479
|
return o;
|
|
1467
1480
|
}
|
|
1468
|
-
[
|
|
1481
|
+
[et](e) {
|
|
1469
1482
|
const t = e.route;
|
|
1470
1483
|
try {
|
|
1471
1484
|
for (let r of this[H]) {
|
|
1472
1485
|
const s = t.path ? t.template ?? t.path : null, i = t.name ? t.template ?? t.name : null;
|
|
1473
1486
|
if (s && r.path) {
|
|
1474
1487
|
let n = r.match;
|
|
1475
|
-
n || (n = r.match =
|
|
1488
|
+
n || (n = r.match = Ms(r.path));
|
|
1476
1489
|
const o = n(s);
|
|
1477
1490
|
if (!o) continue;
|
|
1478
1491
|
if (r.redirect) {
|
|
@@ -1482,7 +1495,7 @@ var zs = class {
|
|
|
1482
1495
|
route: l,
|
|
1483
1496
|
find: void 0
|
|
1484
1497
|
};
|
|
1485
|
-
return this[
|
|
1498
|
+
return this[et](a) ? (e.route = a.route, e.find = a.find, t.template && e.find && (e.find = { ...e.find }, e.find.path = t.path), !0) : !1;
|
|
1486
1499
|
}
|
|
1487
1500
|
if (t.params = t.params ?? {}, q(!0, t.params, o.params), t.query) {
|
|
1488
1501
|
const l = t.query;
|
|
@@ -1539,16 +1552,16 @@ var zs = class {
|
|
|
1539
1552
|
}
|
|
1540
1553
|
remove(e, t) {
|
|
1541
1554
|
return new Promise((r) => {
|
|
1542
|
-
this[
|
|
1555
|
+
this[ve].post((s) => {
|
|
1543
1556
|
try {
|
|
1544
|
-
if (this[
|
|
1557
|
+
if (this[g].length === 0) {
|
|
1545
1558
|
s.resolve(), r(!1);
|
|
1546
1559
|
return;
|
|
1547
1560
|
}
|
|
1548
|
-
let i = -1, n = null, o = [], l = this[
|
|
1561
|
+
let i = -1, n = null, o = [], l = this[g].length - 1, a = l !== -1 ? this[g][l] : null;
|
|
1549
1562
|
if (e) {
|
|
1550
1563
|
if (n = e.root ?? "default", e.all) for (let f = l; f > 0; f--) {
|
|
1551
|
-
const c = this[
|
|
1564
|
+
const c = this[g][f];
|
|
1552
1565
|
if (c.opsType === _.Append) {
|
|
1553
1566
|
const h = c.root ?? "default";
|
|
1554
1567
|
if (n && n !== h) continue;
|
|
@@ -1556,7 +1569,7 @@ var zs = class {
|
|
|
1556
1569
|
}
|
|
1557
1570
|
}
|
|
1558
1571
|
else if (e.until) for (let f = l; f > 0; f--) {
|
|
1559
|
-
let c = this[
|
|
1572
|
+
let c = this[g][f];
|
|
1560
1573
|
if (c.opsType === _.Append && c.root === n) {
|
|
1561
1574
|
if (e.until.charAt(0) === "/" && e.until === c.path) {
|
|
1562
1575
|
i = f;
|
|
@@ -1569,7 +1582,7 @@ var zs = class {
|
|
|
1569
1582
|
}
|
|
1570
1583
|
}
|
|
1571
1584
|
else if (e.to) for (let f = l; f > 0; f--) {
|
|
1572
|
-
const c = this[
|
|
1585
|
+
const c = this[g][f];
|
|
1573
1586
|
if (c.opsType === _.Append) {
|
|
1574
1587
|
const h = c.root ?? "default";
|
|
1575
1588
|
if (n && n !== h) continue;
|
|
@@ -1583,7 +1596,7 @@ var zs = class {
|
|
|
1583
1596
|
}
|
|
1584
1597
|
}
|
|
1585
1598
|
} else for (let f = l; f > 0; f--) {
|
|
1586
|
-
let c = this[
|
|
1599
|
+
let c = this[g][f];
|
|
1587
1600
|
if (c.opsType === _.Append) {
|
|
1588
1601
|
o.push(c), i = f - 1;
|
|
1589
1602
|
break;
|
|
@@ -1594,15 +1607,16 @@ var zs = class {
|
|
|
1594
1607
|
console.warn(f), s.resolve(f), r(!1);
|
|
1595
1608
|
return;
|
|
1596
1609
|
}
|
|
1597
|
-
const u = i !== -1 ? this[
|
|
1598
|
-
if (this[
|
|
1610
|
+
const u = i !== -1 ? this[g][i] : null;
|
|
1611
|
+
if (this[Me](o)) {
|
|
1599
1612
|
if (t === !1)
|
|
1600
1613
|
return s.resolve(), r(!0), !0;
|
|
1601
|
-
const f = () => (s.resolve(), r(!0), !0), c = this[
|
|
1602
|
-
if (u && R.isSame(u, this[
|
|
1614
|
+
const f = () => (s.resolve(), r(!0), !0), c = this[g].length;
|
|
1615
|
+
if (u && R.isSame(u, this[g][c - 1])) {
|
|
1603
1616
|
if (a?.historyUpdatePolicy === "traceless") {
|
|
1604
|
-
|
|
1605
|
-
|
|
1617
|
+
let h = R.clone(u, !0);
|
|
1618
|
+
const y = new St(h, this[Ke]());
|
|
1619
|
+
this[x]?.replace(y), f();
|
|
1606
1620
|
} else this[x]?.goBack(u, f);
|
|
1607
1621
|
return;
|
|
1608
1622
|
}
|
|
@@ -1619,7 +1633,7 @@ var zs = class {
|
|
|
1619
1633
|
return t ? (t.opsType = _.Open, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "push", this.to(t)) : (this[A]("resolve route fail", t), this);
|
|
1620
1634
|
}
|
|
1621
1635
|
close(e) {
|
|
1622
|
-
return this[
|
|
1636
|
+
return this[ve].post((t) => {
|
|
1623
1637
|
try {
|
|
1624
1638
|
let r = this[M](e);
|
|
1625
1639
|
if (!r) {
|
|
@@ -1627,8 +1641,8 @@ var zs = class {
|
|
|
1627
1641
|
return;
|
|
1628
1642
|
}
|
|
1629
1643
|
let s = [];
|
|
1630
|
-
for (let i = 0; i < this[
|
|
1631
|
-
let n = this[
|
|
1644
|
+
for (let i = 0; i < this[g].length; i++) {
|
|
1645
|
+
let n = this[g][i];
|
|
1632
1646
|
if (n.root === r.root) {
|
|
1633
1647
|
if (!r.path && !r.name) {
|
|
1634
1648
|
s.push(n);
|
|
@@ -1647,7 +1661,7 @@ var zs = class {
|
|
|
1647
1661
|
t.resolve();
|
|
1648
1662
|
return;
|
|
1649
1663
|
}
|
|
1650
|
-
this[
|
|
1664
|
+
this[Me](s), t.resolve();
|
|
1651
1665
|
} catch (r) {
|
|
1652
1666
|
this[A](r), t.resolve();
|
|
1653
1667
|
}
|
|
@@ -1657,29 +1671,30 @@ var zs = class {
|
|
|
1657
1671
|
const t = this[M](e);
|
|
1658
1672
|
if (!t)
|
|
1659
1673
|
return this[A]("resolve route fail", t), this;
|
|
1660
|
-
const r = this[
|
|
1661
|
-
return r == null ? (this[A]("route forbid", t), this) : (this[
|
|
1674
|
+
const r = this[Le].acquire(t);
|
|
1675
|
+
return r == null ? (this[A]("route forbid", t), this) : (this[ve].post((s) => {
|
|
1662
1676
|
try {
|
|
1663
|
-
let i = this[
|
|
1664
|
-
this[
|
|
1677
|
+
let i = this[At](t);
|
|
1678
|
+
this[qt](i), this[Kt](i), this[$t](i), i.wait((n, o) => {
|
|
1665
1679
|
const l = n.session.to;
|
|
1666
1680
|
if (n.session.updateResult && n.session.updateResult.status === "success") try {
|
|
1667
|
-
|
|
1668
|
-
|
|
1681
|
+
let a = R.clone(l, !0);
|
|
1682
|
+
const u = new St(a, this[Ke]());
|
|
1683
|
+
l.historyUpdatePolicy === "replace" ? this[x]?.replace(u) : l.historyUpdatePolicy === "traceless" ? this[x]?.setRouteMark(u) : this[x]?.push(u);
|
|
1669
1684
|
} catch (a) {
|
|
1670
1685
|
console.error(a.message, a);
|
|
1671
1686
|
}
|
|
1672
|
-
if (
|
|
1687
|
+
if (Je.clear(n.session), this[Le].release(r), typeof t.success == "function") try {
|
|
1673
1688
|
Reflect.apply(t.success, {}, []);
|
|
1674
1689
|
} catch (a) {
|
|
1675
1690
|
console.error(a.message, a);
|
|
1676
1691
|
}
|
|
1677
|
-
this[ae] === !1 && this[
|
|
1692
|
+
this[ae] === !1 && this[lt](!0), i = null, s.resolve();
|
|
1678
1693
|
}, (n, o) => {
|
|
1679
|
-
this[
|
|
1694
|
+
this[Le].release(r), o !== null && this[A](o, t), this[ae] === !1 && this[lt](!1), Je.clear(n.session), i = null, s.resolve();
|
|
1680
1695
|
});
|
|
1681
1696
|
} catch (i) {
|
|
1682
|
-
this[
|
|
1697
|
+
this[Le].release(r), this[A](i, t), s.resolve();
|
|
1683
1698
|
}
|
|
1684
1699
|
}), this);
|
|
1685
1700
|
}
|
|
@@ -1701,24 +1716,24 @@ var zs = class {
|
|
|
1701
1716
|
e.session.redirect = !1, e.resolve();
|
|
1702
1717
|
};
|
|
1703
1718
|
}
|
|
1704
|
-
[
|
|
1705
|
-
const t =
|
|
1719
|
+
[At](e) {
|
|
1720
|
+
const t = this[g].length > 0 ? this[g][this[g].length - 1] : void 0, r = new Je(e, t), s = {
|
|
1706
1721
|
route: e,
|
|
1707
1722
|
find: null
|
|
1708
1723
|
};
|
|
1709
|
-
if (this[
|
|
1710
|
-
|
|
1711
|
-
const
|
|
1712
|
-
if (Array.isArray(
|
|
1713
|
-
const
|
|
1714
|
-
|
|
1724
|
+
if (this[et](s), s.find) {
|
|
1725
|
+
r.routeModel = s.find, e.matched = s.find.matchedRoutes ?? [];
|
|
1726
|
+
const i = {};
|
|
1727
|
+
if (Array.isArray(s.find?.matchedRoutes)) for (let n = 0; n < s.find.matchedRoutes.length; n++) {
|
|
1728
|
+
const o = s.find.matchedRoutes[n];
|
|
1729
|
+
o.meta && typeof o.meta == "object" && Object.assign(i, o.meta);
|
|
1715
1730
|
}
|
|
1716
|
-
e.meta && typeof e.meta == "object" && Object.assign(
|
|
1731
|
+
e.meta && typeof e.meta == "object" && Object.assign(i, e.meta), e.meta = i;
|
|
1717
1732
|
}
|
|
1718
|
-
return new
|
|
1733
|
+
return new ct(r);
|
|
1719
1734
|
}
|
|
1720
|
-
[
|
|
1721
|
-
for (let t of this[
|
|
1735
|
+
[qt](e) {
|
|
1736
|
+
for (let t of this[je]) e.post((r) => {
|
|
1722
1737
|
const s = this[br](r);
|
|
1723
1738
|
Reflect.apply(t, {}, [
|
|
1724
1739
|
r.session.to,
|
|
@@ -1728,9 +1743,9 @@ var zs = class {
|
|
|
1728
1743
|
]);
|
|
1729
1744
|
});
|
|
1730
1745
|
}
|
|
1731
|
-
[
|
|
1746
|
+
[$t](e) {
|
|
1732
1747
|
e.post((t) => {
|
|
1733
|
-
for (let r of this[
|
|
1748
|
+
for (let r of this[ke]) try {
|
|
1734
1749
|
Reflect.apply(r, {}, [
|
|
1735
1750
|
t.session.to,
|
|
1736
1751
|
t.session.from,
|
|
@@ -1743,14 +1758,14 @@ var zs = class {
|
|
|
1743
1758
|
});
|
|
1744
1759
|
}
|
|
1745
1760
|
[Rr](e, t) {
|
|
1746
|
-
for (let r of this[
|
|
1761
|
+
for (let r of this[Te]) try {
|
|
1747
1762
|
Reflect.apply(r, {}, [e, t]);
|
|
1748
1763
|
} catch (s) {
|
|
1749
1764
|
console.error(s.message, s);
|
|
1750
1765
|
}
|
|
1751
1766
|
typeof e.destroy == "function" && Reflect.apply(e.destroy, e, []);
|
|
1752
1767
|
}
|
|
1753
|
-
[
|
|
1768
|
+
[Kt](e) {
|
|
1754
1769
|
e.post((t) => {
|
|
1755
1770
|
const r = t.session.to;
|
|
1756
1771
|
let s = t.session.routeModel;
|
|
@@ -1759,14 +1774,15 @@ var zs = class {
|
|
|
1759
1774
|
route: r,
|
|
1760
1775
|
find: null
|
|
1761
1776
|
};
|
|
1762
|
-
if (this[
|
|
1763
|
-
|
|
1777
|
+
if (this[et](n))
|
|
1778
|
+
s = n.find, t.session.routeModel = s;
|
|
1779
|
+
else if (this[it]) s = this[it];
|
|
1764
1780
|
else {
|
|
1765
1781
|
t.reject(`not find route model, path:${r.path ?? r.name}`);
|
|
1766
1782
|
return;
|
|
1767
1783
|
}
|
|
1768
1784
|
}
|
|
1769
|
-
const i =
|
|
1785
|
+
const i = Je.from(t.session);
|
|
1770
1786
|
this[mr](r, s, i).then((n) => {
|
|
1771
1787
|
this[U], t.session.updateResult = n ?? {
|
|
1772
1788
|
status: "success",
|
|
@@ -1777,11 +1793,11 @@ var zs = class {
|
|
|
1777
1793
|
});
|
|
1778
1794
|
});
|
|
1779
1795
|
}
|
|
1780
|
-
[
|
|
1796
|
+
[Me](e) {
|
|
1781
1797
|
if (e.length == 0) return !0;
|
|
1782
1798
|
let t = this[U], r = [];
|
|
1783
1799
|
for (let s of e) {
|
|
1784
|
-
let i = this[
|
|
1800
|
+
let i = this[_t](t, s);
|
|
1785
1801
|
i != null && r.push({
|
|
1786
1802
|
...i,
|
|
1787
1803
|
route: s
|
|
@@ -1795,14 +1811,14 @@ var zs = class {
|
|
|
1795
1811
|
}, [s.route.index ?? 0], !0);
|
|
1796
1812
|
return !0;
|
|
1797
1813
|
}
|
|
1798
|
-
[
|
|
1814
|
+
[_t](e, t) {
|
|
1799
1815
|
const r = t.root ?? "default";
|
|
1800
1816
|
let s;
|
|
1801
1817
|
for (let i = 0; i < e.layers.length; i++) {
|
|
1802
1818
|
const n = e.layers[i];
|
|
1803
1819
|
for (let o = n.views.length - 1; o >= 0; o--) {
|
|
1804
1820
|
const l = n.views[o];
|
|
1805
|
-
if (l[V] && l[
|
|
1821
|
+
if (l[V] && l[ut] === r)
|
|
1806
1822
|
return s = {
|
|
1807
1823
|
x: o,
|
|
1808
1824
|
y: i
|
|
@@ -1811,7 +1827,7 @@ var zs = class {
|
|
|
1811
1827
|
}
|
|
1812
1828
|
return null;
|
|
1813
1829
|
}
|
|
1814
|
-
[
|
|
1830
|
+
[Ws](e) {
|
|
1815
1831
|
return e.layers.length > 0 && e.layers[0].views.length > 0 ? e.layers[0].views[0] : null;
|
|
1816
1832
|
}
|
|
1817
1833
|
[oe](e, t, r = null, s = !0) {
|
|
@@ -1819,9 +1835,10 @@ var zs = class {
|
|
|
1819
1835
|
let i = e.layers[t.y].views[t.x], n = !1, o = [], l = !1, a = [...i.slots.value];
|
|
1820
1836
|
for (let f = a.length - 1; f >= 0; f--) {
|
|
1821
1837
|
let c = a[f];
|
|
1822
|
-
(!r || r.indexOf(c.index) != -1) && (c.route && i[V] && (this[
|
|
1838
|
+
(!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));
|
|
1823
1839
|
}
|
|
1824
|
-
if (a.length == 0)
|
|
1840
|
+
if (a.length == 0)
|
|
1841
|
+
s ? i.slots.value = a : e.layers[t.y].views.splice(t.x, 1);
|
|
1825
1842
|
else {
|
|
1826
1843
|
if (l) {
|
|
1827
1844
|
let f = a[a.length - 1];
|
|
@@ -1839,7 +1856,7 @@ var zs = class {
|
|
|
1839
1856
|
let d = y.slots.value;
|
|
1840
1857
|
for (let v = d.length - 1; v >= 0; v--) {
|
|
1841
1858
|
let w = d[v];
|
|
1842
|
-
w.route && y[V] && this[
|
|
1859
|
+
w.route && y[V] && this[$e](w.route), c.push(new I(y, w.index, u)), d.splice(v, 1);
|
|
1843
1860
|
}
|
|
1844
1861
|
e.layers[u].views.splice(h, 1);
|
|
1845
1862
|
}
|
|
@@ -1854,31 +1871,31 @@ var zs = class {
|
|
|
1854
1871
|
let r = t.layers[0].views;
|
|
1855
1872
|
r.length > 0 && (r[0].slots.value = []);
|
|
1856
1873
|
}
|
|
1857
|
-
return this[
|
|
1874
|
+
return this[g] = [], this[le](null), Promise.resolve();
|
|
1858
1875
|
} else return new Promise((t, r) => {
|
|
1859
1876
|
let s = null, i = !1;
|
|
1860
1877
|
for (let n = 0; n < e.length; n++) {
|
|
1861
1878
|
const o = e[n];
|
|
1862
|
-
this[
|
|
1863
|
-
const a = this[
|
|
1864
|
-
this[
|
|
1879
|
+
this[ve].post((l) => {
|
|
1880
|
+
const a = this[At](o);
|
|
1881
|
+
this[qt](a), this[Kt](a), this[$t](a), a.wait((u, f) => {
|
|
1865
1882
|
s = u.session.to, i = u.session.redirect, l.resolve();
|
|
1866
1883
|
}, (u, f) => {
|
|
1867
1884
|
s = null, f !== null && this[A](f), l.resolve();
|
|
1868
1885
|
});
|
|
1869
1886
|
});
|
|
1870
1887
|
}
|
|
1871
|
-
this[
|
|
1888
|
+
this[ve].post((n) => {
|
|
1872
1889
|
if (s && i === !0) {
|
|
1873
|
-
const o =
|
|
1874
|
-
this[x]?.replace(
|
|
1890
|
+
const o = R.clone(s, !0), l = new St(o, this[Ke]());
|
|
1891
|
+
this[x]?.replace(l);
|
|
1875
1892
|
}
|
|
1876
1893
|
n.resolve(), t();
|
|
1877
1894
|
});
|
|
1878
1895
|
});
|
|
1879
1896
|
}
|
|
1880
1897
|
async [mr](e, t, r) {
|
|
1881
|
-
const s = e.updateType ??
|
|
1898
|
+
const s = e.updateType ?? wt.Part;
|
|
1882
1899
|
await this[pr](t);
|
|
1883
1900
|
const i = this[gr](t, e, r, s);
|
|
1884
1901
|
if (i.status === "error") throw Error(i.message);
|
|
@@ -1901,51 +1918,56 @@ var zs = class {
|
|
|
1901
1918
|
message: "illegal route structure(multi root node)"
|
|
1902
1919
|
};
|
|
1903
1920
|
const i = e.layers[0].models[0];
|
|
1904
|
-
let n = this[U], o =
|
|
1905
|
-
!o && s ==
|
|
1921
|
+
let n = this[U], o = zs(n), l = t.root ?? "default", a;
|
|
1922
|
+
!o && s == wt.Part && (a = this[_t](n, t));
|
|
1906
1923
|
let u, f = 0;
|
|
1907
|
-
if (a == null || a == null)
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
}
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1924
|
+
if (a == null || a == null)
|
|
1925
|
+
if (o || s === wt.All) {
|
|
1926
|
+
if (n.layers.length == 0 && (n.layers[0] = new bt()), n.layers[0].views.length == 0) {
|
|
1927
|
+
let c = t.root ?? "default";
|
|
1928
|
+
u = new Ce(c, !0, null), n.layers[0].views = [u];
|
|
1929
|
+
} else u = n.layers[0].views[0];
|
|
1930
|
+
a = {
|
|
1931
|
+
x: 0,
|
|
1932
|
+
y: 0
|
|
1933
|
+
};
|
|
1934
|
+
} else {
|
|
1935
|
+
let c = t.slot;
|
|
1936
|
+
if (!c) return {
|
|
1937
|
+
status: "error",
|
|
1938
|
+
message: "can not rebuild view(because not route slot)"
|
|
1939
|
+
};
|
|
1940
|
+
let h = c.level;
|
|
1941
|
+
if (h > n.layers.length) return {
|
|
1942
|
+
status: "error",
|
|
1943
|
+
message: "can not insert view(override level)"
|
|
1944
|
+
};
|
|
1945
|
+
let y;
|
|
1946
|
+
if (c.rootName) {
|
|
1947
|
+
let d = n.layers[h - 1];
|
|
1948
|
+
for (let v of d.views) {
|
|
1949
|
+
if (v[V] && v.name === c.rootName) {
|
|
1950
|
+
y = new I(v, c.rootIndex ?? 0, h - 1);
|
|
1951
|
+
break;
|
|
1952
|
+
}
|
|
1953
|
+
if (v[B] && v[B].view.name === c.rootName && v[B].index === c.rootIndex) {
|
|
1954
|
+
y = v[B];
|
|
1955
|
+
break;
|
|
1956
|
+
}
|
|
1934
1957
|
}
|
|
1935
1958
|
}
|
|
1959
|
+
if (!y) return {
|
|
1960
|
+
status: "error",
|
|
1961
|
+
message: "can not insert view(not find root node ref)"
|
|
1962
|
+
};
|
|
1963
|
+
u = new Ce(l, !0, y), n.layers[h].views.push(u), a = {
|
|
1964
|
+
x: n.layers[h].views.length - 1,
|
|
1965
|
+
y: h
|
|
1966
|
+
};
|
|
1936
1967
|
}
|
|
1937
|
-
if (!y) return {
|
|
1938
|
-
status: "error",
|
|
1939
|
-
message: "can not insert view(not find root node ref)"
|
|
1940
|
-
};
|
|
1941
|
-
u = new Fe(l, !0, y), n.layers[h].views.push(u), a = {
|
|
1942
|
-
x: n.layers[h].views.length - 1,
|
|
1943
|
-
y: h
|
|
1944
|
-
};
|
|
1945
|
-
}
|
|
1946
1968
|
else u = n.layers[a.y].views[a.x];
|
|
1947
1969
|
if (f = a.y, u[V] = !0, t.opsType === _.Append) {
|
|
1948
|
-
t.index = t.index ??
|
|
1970
|
+
t.index = t.index ?? Oe.get(), t.active = !0;
|
|
1949
1971
|
let c = u.slots.value;
|
|
1950
1972
|
if (c.length > 0) {
|
|
1951
1973
|
let w = c[c.length - 1];
|
|
@@ -1971,89 +1993,89 @@ var zs = class {
|
|
|
1971
1993
|
d.route && (d.route.active = d.active);
|
|
1972
1994
|
}
|
|
1973
1995
|
if (!y) {
|
|
1974
|
-
t.index = t.index ??
|
|
1996
|
+
t.index = t.index ?? Oe.get(), t.active = h;
|
|
1975
1997
|
let d = new Y(t, i, t.index, h);
|
|
1976
1998
|
c.push(d);
|
|
1977
|
-
let v = f + 1, w = 1,
|
|
1978
|
-
this[ee](n, v, e, w,
|
|
1999
|
+
let v = f + 1, w = 1, m = new I(u, t.index, f);
|
|
2000
|
+
this[ee](n, v, e, w, m);
|
|
1979
2001
|
}
|
|
1980
2002
|
u.slots.value = [...c];
|
|
1981
2003
|
} else {
|
|
1982
2004
|
let c = u.slots.value;
|
|
1983
2005
|
if (c.length == 0) {
|
|
1984
|
-
t.index = t.index ??
|
|
2006
|
+
t.index = t.index ?? Oe.get(), t.active = !0, u.slots.value = [new Y(t, i, t.index)];
|
|
1985
2007
|
let h = f + 1, y = 1, d = new I(u, t.index, f);
|
|
1986
2008
|
this[ee](n, h, e, y, d);
|
|
1987
2009
|
} else {
|
|
1988
2010
|
let h = c[0];
|
|
1989
2011
|
if (h.model !== i) {
|
|
1990
|
-
this[oe](n, a, null, !0), t.index = t.index ??
|
|
2012
|
+
this[oe](n, a, null, !0), t.index = t.index ?? Oe.get(), t.active = !0, u.slots.value = [new Y(t, i, t.index)];
|
|
1991
2013
|
let y = f + 1, d = 1, v = new I(u, t.index, f);
|
|
1992
2014
|
this[ee](n, y, e, d, v);
|
|
1993
2015
|
} else {
|
|
1994
|
-
h.route !== null && this[
|
|
2016
|
+
h.route !== null && this[$e](h.route);
|
|
1995
2017
|
let y = !1;
|
|
1996
2018
|
const d = t.active ?? !0;
|
|
1997
2019
|
h.active !== d && (h.active = d, y = !0), t.active = d, t.index = h.index, h.route = t;
|
|
1998
2020
|
let v = [];
|
|
1999
2021
|
for (let K = 1; K < c.length; K++) v.push(c[K].index);
|
|
2000
2022
|
v.length > 0 ? this[oe](n, a, v, !0) : y && (u.slots.value = [...c]);
|
|
2001
|
-
let w = [new I(u, t.index, f)],
|
|
2002
|
-
for (; w.length > 0 &&
|
|
2023
|
+
let w = [new I(u, t.index, f)], m = f + 1, p = 1, $ = new I(u, t.index, f);
|
|
2024
|
+
for (; w.length > 0 && m < n.layers.length && p < e.layers.length; m++, p++) {
|
|
2003
2025
|
let K = [];
|
|
2004
|
-
for (let j = 0; j < n.layers[
|
|
2005
|
-
let E = n.layers[
|
|
2026
|
+
for (let j = 0; j < n.layers[m].views.length; j++) {
|
|
2027
|
+
let E = n.layers[m].views[j];
|
|
2006
2028
|
E[fe] && I.include(w, E[fe]) && K.unshift(j);
|
|
2007
2029
|
}
|
|
2008
|
-
let
|
|
2030
|
+
let _e = [];
|
|
2009
2031
|
for (let j of K) {
|
|
2010
|
-
let E = n.layers[
|
|
2032
|
+
let E = n.layers[m].views[j], se = e.layers[p].models, Q;
|
|
2011
2033
|
for (let k = 0; k < se.length; k++) if (E.name === se[k].name) {
|
|
2012
2034
|
Q = se[k];
|
|
2013
2035
|
break;
|
|
2014
2036
|
}
|
|
2015
2037
|
if (!Q) this[oe](n, {
|
|
2016
2038
|
x: j,
|
|
2017
|
-
y:
|
|
2039
|
+
y: m
|
|
2018
2040
|
}, null, !1);
|
|
2019
2041
|
else {
|
|
2020
2042
|
let k = E.slots.value;
|
|
2021
2043
|
if (k.length == 0) {
|
|
2022
2044
|
let z = 0;
|
|
2023
2045
|
E.slots.value = [new Y(null, Q, z)];
|
|
2024
|
-
let D =
|
|
2046
|
+
let D = m + 1, N = p + 1;
|
|
2025
2047
|
this[ee](n, D, e, N, $);
|
|
2026
2048
|
} else {
|
|
2027
2049
|
let z = k[0];
|
|
2028
2050
|
if (z.model !== Q) {
|
|
2029
2051
|
this[oe](n, {
|
|
2030
2052
|
x: j,
|
|
2031
|
-
y:
|
|
2053
|
+
y: m
|
|
2032
2054
|
}, null, !0), E.slots.value = [new Y(null, Q, 0)];
|
|
2033
|
-
let D =
|
|
2055
|
+
let D = m + 1, N = p + 1;
|
|
2034
2056
|
this[ee](n, D, e, N, $);
|
|
2035
2057
|
} else {
|
|
2036
|
-
E[V] && z.route !== null && this[
|
|
2058
|
+
E[V] && z.route !== null && this[$e](z.route);
|
|
2037
2059
|
let D = [];
|
|
2038
2060
|
for (let N = 1; N < k.length; N++) D.push(k[N].index);
|
|
2039
2061
|
D.length > 0 && this[oe](n, {
|
|
2040
2062
|
x: j,
|
|
2041
|
-
y:
|
|
2042
|
-
}, D, !0),
|
|
2063
|
+
y: m
|
|
2064
|
+
}, D, !0), _e.push(new I(E, z.index, m));
|
|
2043
2065
|
}
|
|
2044
2066
|
}
|
|
2045
2067
|
E[V] = !1;
|
|
2046
2068
|
}
|
|
2047
2069
|
}
|
|
2048
|
-
w =
|
|
2070
|
+
w = _e;
|
|
2049
2071
|
}
|
|
2050
|
-
this[ee](n,
|
|
2072
|
+
this[ee](n, m, e, p, $);
|
|
2051
2073
|
}
|
|
2052
2074
|
}
|
|
2053
2075
|
}
|
|
2054
2076
|
if (u && u[B]) {
|
|
2055
2077
|
let c = u[B];
|
|
2056
|
-
c && (t.slot = new
|
|
2078
|
+
c && (t.slot = new Is(l, f, c?.view.name, c?.index ?? 0));
|
|
2057
2079
|
}
|
|
2058
2080
|
return r.to = void 0, r.routeModel = void 0, this[wr](t, r), {
|
|
2059
2081
|
status: "success",
|
|
@@ -2065,15 +2087,15 @@ var zs = class {
|
|
|
2065
2087
|
for (; o < e.layers.length && n < r.layers.length; o++, n++) {
|
|
2066
2088
|
let l = e.layers[o].views;
|
|
2067
2089
|
for (let a of r.layers[n].models) {
|
|
2068
|
-
let u = new
|
|
2090
|
+
let u = new Ce(a.name, !1, i), f = new Y(null, a);
|
|
2069
2091
|
u.slots.value = [f], l.push(u);
|
|
2070
2092
|
}
|
|
2071
2093
|
}
|
|
2072
2094
|
for (; n < r.layers.length; n++) {
|
|
2073
|
-
let l = new
|
|
2095
|
+
let l = new bt();
|
|
2074
2096
|
l.views = [];
|
|
2075
2097
|
for (let a of r.layers[n].models) {
|
|
2076
|
-
let u = new
|
|
2098
|
+
let u = new Ce(a.name, !1, i), f = new Y(null, a);
|
|
2077
2099
|
u.slots.value = [f], l.views.push(u);
|
|
2078
2100
|
}
|
|
2079
2101
|
e.layers.push(l);
|
|
@@ -2106,97 +2128,97 @@ var zs = class {
|
|
|
2106
2128
|
index: n,
|
|
2107
2129
|
level: t - 1
|
|
2108
2130
|
});
|
|
2109
|
-
let a = new
|
|
2131
|
+
let a = new Ce(e, !0, o);
|
|
2110
2132
|
if (a[fe] = l, t == this[U].layers.length) {
|
|
2111
|
-
let u = new
|
|
2133
|
+
let u = new bt();
|
|
2112
2134
|
u.views = [a], this[U].layers.push(u);
|
|
2113
2135
|
} else this[U].layers[t].views.push(a);
|
|
2114
2136
|
return a;
|
|
2115
2137
|
}
|
|
2116
|
-
},
|
|
2117
|
-
[
|
|
2118
|
-
[
|
|
2138
|
+
}, Ue = /* @__PURE__ */ Symbol("rk"), jt = /* @__PURE__ */ Symbol("vd"), Sr = /* @__PURE__ */ Symbol("rv"), kt = /* @__PURE__ */ Symbol("rvi"), xr = /* @__PURE__ */ Symbol("pv"), Tt = /* @__PURE__ */ Symbol("pvi"), Ie = /* @__PURE__ */ Symbol("registerKey"), Mt = /* @__PURE__ */ Symbol("parentKey"), Ut = /* @__PURE__ */ Symbol("lc"), Gs = class {
|
|
2139
|
+
[Ie] = /* @__PURE__ */ new Map();
|
|
2140
|
+
[Mt] = null;
|
|
2119
2141
|
get parent() {
|
|
2120
|
-
return this[
|
|
2142
|
+
return this[Mt]?.deref() ?? null;
|
|
2121
2143
|
}
|
|
2122
2144
|
set parent(e) {
|
|
2123
|
-
this[
|
|
2145
|
+
this[Mt] = e ? new WeakRef(e) : null;
|
|
2124
2146
|
}
|
|
2125
2147
|
constructor() {
|
|
2126
2148
|
}
|
|
2127
2149
|
set(e, t) {
|
|
2128
|
-
this[
|
|
2150
|
+
this[Ie].set(e, t);
|
|
2129
2151
|
}
|
|
2130
2152
|
get(e) {
|
|
2131
|
-
return this[
|
|
2153
|
+
return this[Ie].get(e);
|
|
2132
2154
|
}
|
|
2133
2155
|
has(e) {
|
|
2134
|
-
return this[
|
|
2156
|
+
return this[Ie].has(e);
|
|
2135
2157
|
}
|
|
2136
2158
|
delete(e) {
|
|
2137
|
-
return this[
|
|
2159
|
+
return this[Ie].delete(e);
|
|
2138
2160
|
}
|
|
2139
|
-
}, re = /* @__PURE__ */ new WeakMap(),
|
|
2140
|
-
function
|
|
2161
|
+
}, re = /* @__PURE__ */ new WeakMap(), De = [];
|
|
2162
|
+
function at(e, t = !1) {
|
|
2141
2163
|
let r = e ? re.get(e) ?? null : null;
|
|
2142
2164
|
if (t && !r) {
|
|
2143
|
-
r = new
|
|
2165
|
+
r = new Gs(), e && re.set(e, r), Pe(() => {
|
|
2144
2166
|
e && re.delete(e);
|
|
2145
2167
|
});
|
|
2146
|
-
const s = L(
|
|
2147
|
-
s && (r.parent = s), Z(
|
|
2168
|
+
const s = L(Ut, null);
|
|
2169
|
+
s && (r.parent = s), Z(Ut, r);
|
|
2148
2170
|
}
|
|
2149
2171
|
return r;
|
|
2150
2172
|
}
|
|
2151
|
-
function
|
|
2173
|
+
function yt(e) {
|
|
2152
2174
|
let t = e ? re.get(e) ?? null : null;
|
|
2153
|
-
if (!t &&
|
|
2154
|
-
const r =
|
|
2155
|
-
t =
|
|
2175
|
+
if (!t && xe() && (t = L(Ut, null)), !t && De.length > 0) {
|
|
2176
|
+
const r = De.length - 1;
|
|
2177
|
+
t = De[r];
|
|
2156
2178
|
}
|
|
2157
2179
|
return t;
|
|
2158
2180
|
}
|
|
2159
|
-
async function
|
|
2160
|
-
|
|
2181
|
+
async function Xs(e, t) {
|
|
2182
|
+
De.push(e);
|
|
2161
2183
|
try {
|
|
2162
2184
|
return await t();
|
|
2163
2185
|
} finally {
|
|
2164
|
-
|
|
2186
|
+
De.pop();
|
|
2165
2187
|
}
|
|
2166
2188
|
}
|
|
2167
|
-
function
|
|
2189
|
+
function Vi(e) {
|
|
2168
2190
|
const t = Kr();
|
|
2169
2191
|
if (!t) return !1;
|
|
2170
|
-
const r =
|
|
2192
|
+
const r = yt();
|
|
2171
2193
|
if (!r) return !1;
|
|
2172
2194
|
if (re.set(t, r), Array.isArray(e))
|
|
2173
2195
|
for (let s = 0; s < e.length; s++) e[s] && typeof e[s] == "object" && re.set(e[s], r);
|
|
2174
|
-
return
|
|
2196
|
+
return Pe(() => {
|
|
2175
2197
|
if (re.delete(t), Array.isArray(e))
|
|
2176
2198
|
for (let s = 0; s < e.length; s++) e[s] && typeof e[s] == "object" && re.delete(e[s]);
|
|
2177
2199
|
}), !0;
|
|
2178
2200
|
}
|
|
2179
2201
|
function zr(e, t) {
|
|
2180
|
-
const r =
|
|
2202
|
+
const r = yt(e);
|
|
2181
2203
|
if (!r) return null;
|
|
2182
2204
|
let s = r;
|
|
2183
2205
|
for (; s && !s.has(t); ) s = s.parent;
|
|
2184
2206
|
return s?.get(t) ?? null;
|
|
2185
2207
|
}
|
|
2186
|
-
function Vi(e, t, r) {
|
|
2187
|
-
ht(e)?.set(t, r);
|
|
2188
|
-
}
|
|
2189
2208
|
function Wi(e, t, r) {
|
|
2190
|
-
|
|
2209
|
+
yt(e)?.set(t, r);
|
|
2210
|
+
}
|
|
2211
|
+
function zi(e, t, r) {
|
|
2212
|
+
yt(e)?.delete(t);
|
|
2191
2213
|
}
|
|
2192
|
-
var
|
|
2193
|
-
function
|
|
2194
|
-
let t = e.get(
|
|
2195
|
-
t || (t = [], e.set(
|
|
2214
|
+
var ht = /* @__PURE__ */ Symbol("hooksKey");
|
|
2215
|
+
function Qs(e) {
|
|
2216
|
+
let t = e.get(ht);
|
|
2217
|
+
t || (t = [], e.set(ht, t));
|
|
2196
2218
|
}
|
|
2197
2219
|
function Pr(e, t) {
|
|
2198
|
-
const r = e.get(
|
|
2199
|
-
r != null &&
|
|
2220
|
+
const r = e.get(ht);
|
|
2221
|
+
r != null && Xs(e, async () => {
|
|
2200
2222
|
for (let s = r.length - 1; s >= 0; s--) {
|
|
2201
2223
|
let i = r[s];
|
|
2202
2224
|
if (i.type === t)
|
|
@@ -2210,18 +2232,18 @@ function Pr(e, t) {
|
|
|
2210
2232
|
}
|
|
2211
2233
|
var _r = /* @__PURE__ */ (function(e) {
|
|
2212
2234
|
return e.INACTIVATED = "ia", e.ACTIVATED = "a", e;
|
|
2213
|
-
})({}),
|
|
2235
|
+
})({}), Zs = class {
|
|
2214
2236
|
type;
|
|
2215
2237
|
hook;
|
|
2216
2238
|
constructor(e, t) {
|
|
2217
2239
|
this.hook = t, this.type = e;
|
|
2218
2240
|
}
|
|
2219
2241
|
};
|
|
2220
|
-
function
|
|
2221
|
-
const s = new
|
|
2242
|
+
function Ys(e, t, r) {
|
|
2243
|
+
const s = new Zs(t, r);
|
|
2222
2244
|
return e.push(s), !0;
|
|
2223
2245
|
}
|
|
2224
|
-
function
|
|
2246
|
+
function ei(e, t, r) {
|
|
2225
2247
|
let s = -1;
|
|
2226
2248
|
for (let i = 0; i < e.length; i++) {
|
|
2227
2249
|
const n = e[i];
|
|
@@ -2234,16 +2256,16 @@ function Ys(e, t, r) {
|
|
|
2234
2256
|
}
|
|
2235
2257
|
function Jr(e) {
|
|
2236
2258
|
return (t) => {
|
|
2237
|
-
const r = zr(null,
|
|
2238
|
-
r && (
|
|
2239
|
-
|
|
2240
|
-
}),
|
|
2259
|
+
const r = zr(null, ht);
|
|
2260
|
+
r && (Pe(() => {
|
|
2261
|
+
ei(r, e, t);
|
|
2262
|
+
}), Ys(r, e, t));
|
|
2241
2263
|
};
|
|
2242
2264
|
}
|
|
2243
|
-
var
|
|
2244
|
-
|
|
2245
|
-
},
|
|
2246
|
-
|
|
2265
|
+
var Ji = function(e) {
|
|
2266
|
+
fs(e), Jr("a")(e);
|
|
2267
|
+
}, Gi = function(e) {
|
|
2268
|
+
cs(e), Jr("ia")(e);
|
|
2247
2269
|
}, Gr = /* @__PURE__ */ Symbol("routeKey");
|
|
2248
2270
|
function Fr(e, t) {
|
|
2249
2271
|
e.set(Gr, t);
|
|
@@ -2252,7 +2274,7 @@ function Cr(e) {
|
|
|
2252
2274
|
const t = zr(e ?? null, Gr);
|
|
2253
2275
|
return typeof t == "function" ? t() : t;
|
|
2254
2276
|
}
|
|
2255
|
-
var
|
|
2277
|
+
var ti = "FoxBeforeEnter", ri = "FoxEnter", si = "FoxLeave", ii = "FoxLeave", Bt = "FoxLeaveEnd";
|
|
2256
2278
|
function Xr(e, t = !1) {
|
|
2257
2279
|
let r = null;
|
|
2258
2280
|
return t ? r = e.showFromClass ?? e.enterFromClass : r = e.enterFromClass, r || (r = e.transitionName, r ? t ? `${r}-show-from` : `${r}-enter-from` : null);
|
|
@@ -2261,7 +2283,7 @@ function Qr(e, t = !1) {
|
|
|
2261
2283
|
let r = null;
|
|
2262
2284
|
return t ? r = e.showActiveClass ?? e.enterActiveClass : r = e.enterActiveClass, r || (r = e.transitionName, r ? t ? `${r}-show-active` : `${r}-enter-active` : null);
|
|
2263
2285
|
}
|
|
2264
|
-
function
|
|
2286
|
+
function ni(e, t = !1) {
|
|
2265
2287
|
let r = null;
|
|
2266
2288
|
return t ? r = e.showToClass ?? e.enterToClass : r = e.enterToClass, r || (r = e.transitionName, r ? t ? `${r}-show-to` : `${r}-enter-to` : null);
|
|
2267
2289
|
}
|
|
@@ -2273,43 +2295,43 @@ function Yr(e, t = !1) {
|
|
|
2273
2295
|
let r = null;
|
|
2274
2296
|
return t ? r = e.hideActiveClass ?? e.leaveActiveClass : r = e.leaveActiveClass, r || (r = e.transitionName, r ? t ? `${r}-hide-active` : `${r}-leave-active` : null);
|
|
2275
2297
|
}
|
|
2276
|
-
function
|
|
2298
|
+
function oi(e, t = !1) {
|
|
2277
2299
|
let r = null;
|
|
2278
2300
|
return t ? r = e.hideToClass ?? e.leaveToClass : r = e.leaveToClass, r || (r = e.transitionName, r ? t ? `${r}-hide-to` : `${r}-leave-to` : null);
|
|
2279
2301
|
}
|
|
2280
|
-
function
|
|
2302
|
+
function li(e, t = !1) {
|
|
2281
2303
|
let r = null;
|
|
2282
2304
|
return t ? r = e.beforeShow ?? e.beforeEnter : r = e.beforeEnter, r;
|
|
2283
2305
|
}
|
|
2284
|
-
function
|
|
2306
|
+
function ai(e, t = !1) {
|
|
2285
2307
|
let r = null;
|
|
2286
2308
|
return t ? r = e.show ?? e.enter : r = e.enter, r;
|
|
2287
2309
|
}
|
|
2288
|
-
function
|
|
2310
|
+
function ui(e, t = !1) {
|
|
2289
2311
|
let r = null;
|
|
2290
2312
|
return t ? r = e.afterShow ?? e.afterEnter : r = e.afterEnter, r;
|
|
2291
2313
|
}
|
|
2292
|
-
function
|
|
2314
|
+
function fi(e, t = !1) {
|
|
2293
2315
|
let r = null;
|
|
2294
2316
|
return t ? r = e.showCancelled ?? e.enterCancelled : r = e.enterCancelled, r;
|
|
2295
2317
|
}
|
|
2296
|
-
function
|
|
2318
|
+
function ci(e, t = !1) {
|
|
2297
2319
|
let r = null;
|
|
2298
2320
|
return t ? r = e.beforeHide ?? e.beforeLeave : r = e.beforeLeave, r;
|
|
2299
2321
|
}
|
|
2300
|
-
function
|
|
2322
|
+
function hi(e, t = !1) {
|
|
2301
2323
|
let r = null;
|
|
2302
2324
|
return t ? r = e.hide ?? e.leave : r = e.leave, r;
|
|
2303
2325
|
}
|
|
2304
|
-
function
|
|
2326
|
+
function yi(e, t = !1) {
|
|
2305
2327
|
let r = null;
|
|
2306
2328
|
return t ? r = e.afterHide ?? e.afterLeave : r = e.afterLeave, r;
|
|
2307
2329
|
}
|
|
2308
|
-
function
|
|
2330
|
+
function di(e, t = !1) {
|
|
2309
2331
|
let r = null;
|
|
2310
2332
|
return t ? r = e.hideCancelled ?? e.leaveCancelled : r = e.leaveCancelled, r;
|
|
2311
2333
|
}
|
|
2312
|
-
function
|
|
2334
|
+
function rr(e) {
|
|
2313
2335
|
let t, r = e.transitionDuration;
|
|
2314
2336
|
return typeof r == "object" ? t = {
|
|
2315
2337
|
enter: r.enter ?? -1,
|
|
@@ -2323,15 +2345,15 @@ function tr(e) {
|
|
|
2323
2345
|
hide: r
|
|
2324
2346
|
}), t;
|
|
2325
2347
|
}
|
|
2326
|
-
function
|
|
2348
|
+
function Se(e, t) {
|
|
2327
2349
|
e.classList.contains(t) || e.classList.add(t);
|
|
2328
2350
|
}
|
|
2329
|
-
function
|
|
2351
|
+
function be(e, t) {
|
|
2330
2352
|
e.classList.remove(t);
|
|
2331
2353
|
}
|
|
2332
|
-
var
|
|
2333
|
-
function
|
|
2334
|
-
|
|
2354
|
+
var vi = Re && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : setTimeout;
|
|
2355
|
+
function dt(e) {
|
|
2356
|
+
vi(e);
|
|
2335
2357
|
}
|
|
2336
2358
|
function C(e, t) {
|
|
2337
2359
|
b(e) && Reflect.apply(e, null, t);
|
|
@@ -2339,7 +2361,7 @@ function C(e, t) {
|
|
|
2339
2361
|
function es(e, t, r = -1, s, i, n) {
|
|
2340
2362
|
let o = [];
|
|
2341
2363
|
const l = () => {
|
|
2342
|
-
for (let a of o)
|
|
2364
|
+
for (let a of o) Xt(e, a.type, a.listener);
|
|
2343
2365
|
o = [];
|
|
2344
2366
|
};
|
|
2345
2367
|
if (b(i)) {
|
|
@@ -2356,7 +2378,7 @@ function es(e, t, r = -1, s, i, n) {
|
|
|
2356
2378
|
const a = [
|
|
2357
2379
|
"animationend",
|
|
2358
2380
|
"transitionend",
|
|
2359
|
-
|
|
2381
|
+
Bt
|
|
2360
2382
|
], u = (f) => {
|
|
2361
2383
|
(f.target || f.srcElement) === f.currentTarget && (l(), Reflect.apply(i, null, [
|
|
2362
2384
|
e,
|
|
@@ -2365,7 +2387,7 @@ function es(e, t, r = -1, s, i, n) {
|
|
|
2365
2387
|
]));
|
|
2366
2388
|
};
|
|
2367
2389
|
a.forEach((f) => {
|
|
2368
|
-
|
|
2390
|
+
ft(e, f, u), o.push({
|
|
2369
2391
|
type: f,
|
|
2370
2392
|
listener: u
|
|
2371
2393
|
});
|
|
@@ -2379,21 +2401,21 @@ function es(e, t, r = -1, s, i, n) {
|
|
|
2379
2401
|
r
|
|
2380
2402
|
]));
|
|
2381
2403
|
};
|
|
2382
|
-
|
|
2404
|
+
ft(e, a, u), o.push({
|
|
2383
2405
|
type: a,
|
|
2384
2406
|
listener: u
|
|
2385
2407
|
});
|
|
2386
2408
|
}
|
|
2387
2409
|
}
|
|
2388
|
-
function
|
|
2389
|
-
return !
|
|
2410
|
+
function vt(e) {
|
|
2411
|
+
return !Re || e === null ? !1 : e.opsType === _.Append || e.opsType === _.Open;
|
|
2390
2412
|
}
|
|
2391
2413
|
function ts(e, t, r = {}, s, i = -1) {
|
|
2392
|
-
if (e ||
|
|
2414
|
+
if (e || vt(s)) {
|
|
2393
2415
|
const n = Xr(r, e);
|
|
2394
|
-
n &&
|
|
2416
|
+
n && Se(t, n);
|
|
2395
2417
|
const o = Qr(r, e);
|
|
2396
|
-
o &&
|
|
2418
|
+
o && Se(t, o), C(li(r, e), [
|
|
2397
2419
|
t,
|
|
2398
2420
|
e,
|
|
2399
2421
|
s,
|
|
@@ -2402,18 +2424,18 @@ function ts(e, t, r = {}, s, i = -1) {
|
|
|
2402
2424
|
}
|
|
2403
2425
|
}
|
|
2404
2426
|
function rs(e, t, r = {}, s, i, n, o) {
|
|
2405
|
-
if (!
|
|
2427
|
+
if (!vt(i) && !e) {
|
|
2406
2428
|
b(o) && o(o, [t]);
|
|
2407
2429
|
return;
|
|
2408
2430
|
}
|
|
2409
|
-
const l = Xr(r, e), a = Qr(r, e), u =
|
|
2431
|
+
const l = Xr(r, e), a = Qr(r, e), u = ni(r, e), f = ai(r, e), c = ui(r, e), h = fi(r, e);
|
|
2410
2432
|
if (!l && !a && !u && !f) {
|
|
2411
2433
|
b(o) && o(o, [t]);
|
|
2412
2434
|
return;
|
|
2413
2435
|
}
|
|
2414
|
-
|
|
2436
|
+
dt(() => {
|
|
2415
2437
|
es(t, i, n, s, () => {
|
|
2416
|
-
a &&
|
|
2438
|
+
a && be(t, a), u && be(t, u), b(c) && C(c, [
|
|
2417
2439
|
t,
|
|
2418
2440
|
e,
|
|
2419
2441
|
i,
|
|
@@ -2426,7 +2448,7 @@ function rs(e, t, r = {}, s, i, n, o) {
|
|
|
2426
2448
|
i,
|
|
2427
2449
|
n
|
|
2428
2450
|
]);
|
|
2429
|
-
}), l &&
|
|
2451
|
+
}), l && be(t, l), u && Se(t, u), b(f) && C(f, [
|
|
2430
2452
|
t,
|
|
2431
2453
|
e,
|
|
2432
2454
|
i,
|
|
@@ -2435,11 +2457,11 @@ function rs(e, t, r = {}, s, i, n, o) {
|
|
|
2435
2457
|
});
|
|
2436
2458
|
}
|
|
2437
2459
|
function ss(e, t, r = {}, s, i = -1) {
|
|
2438
|
-
if (e ||
|
|
2460
|
+
if (e || vt(s)) {
|
|
2439
2461
|
const n = Zr(r, e);
|
|
2440
|
-
n &&
|
|
2462
|
+
n && Se(t, n);
|
|
2441
2463
|
const o = Yr(r, e);
|
|
2442
|
-
o &&
|
|
2464
|
+
o && Se(t, o), C(ci(r, e), [
|
|
2443
2465
|
t,
|
|
2444
2466
|
e,
|
|
2445
2467
|
s,
|
|
@@ -2448,19 +2470,19 @@ function ss(e, t, r = {}, s, i = -1) {
|
|
|
2448
2470
|
}
|
|
2449
2471
|
}
|
|
2450
2472
|
function is(e, t, r = {}, s, i, n, o, l) {
|
|
2451
|
-
if (!
|
|
2473
|
+
if (!vt(n) && !e) {
|
|
2452
2474
|
b(l) && C(l, [t]), !e && b(i) && i();
|
|
2453
2475
|
return;
|
|
2454
2476
|
}
|
|
2455
|
-
const a = Zr(r, e), u = Yr(r, e), f =
|
|
2477
|
+
const a = Zr(r, e), u = Yr(r, e), f = oi(r, e), c = hi(r, e), h = yi(r, e), y = di(r, e);
|
|
2456
2478
|
if (!a && !u && !f && !c) {
|
|
2457
2479
|
b(l) && C(l, [t]), !e && b(i) && i();
|
|
2458
2480
|
return;
|
|
2459
2481
|
}
|
|
2460
|
-
|
|
2482
|
+
dt(() => {
|
|
2461
2483
|
es(t, n, o, s, () => {
|
|
2462
2484
|
try {
|
|
2463
|
-
u &&
|
|
2485
|
+
u && be(t, u), f && be(t, f), b(h) && C(h, [
|
|
2464
2486
|
t,
|
|
2465
2487
|
e,
|
|
2466
2488
|
n,
|
|
@@ -2480,7 +2502,7 @@ function is(e, t, r = {}, s, i, n, o, l) {
|
|
|
2480
2502
|
} finally {
|
|
2481
2503
|
!e && b(i) && i();
|
|
2482
2504
|
}
|
|
2483
|
-
}), a &&
|
|
2505
|
+
}), a && be(t, a), f && Se(t, f), b(c) && C(c, [
|
|
2484
2506
|
t,
|
|
2485
2507
|
e,
|
|
2486
2508
|
n,
|
|
@@ -2488,8 +2510,8 @@ function is(e, t, r = {}, s, i, n, o, l) {
|
|
|
2488
2510
|
]);
|
|
2489
2511
|
});
|
|
2490
2512
|
}
|
|
2491
|
-
function
|
|
2492
|
-
const i = t.mode ?? "default", n =
|
|
2513
|
+
function Vt(e, t = {}, r, s = -1) {
|
|
2514
|
+
const i = t.mode ?? "default", n = rr(t);
|
|
2493
2515
|
return {
|
|
2494
2516
|
mode: i,
|
|
2495
2517
|
persisted: !1,
|
|
@@ -2504,34 +2526,34 @@ function Bt(e, t = {}, r, s = -1) {
|
|
|
2504
2526
|
e.transition = null;
|
|
2505
2527
|
});
|
|
2506
2528
|
},
|
|
2507
|
-
clone: (o) =>
|
|
2529
|
+
clone: (o) => Vt(e, t, r, s)
|
|
2508
2530
|
};
|
|
2509
2531
|
}
|
|
2510
2532
|
function ns(e) {
|
|
2511
2533
|
return e.el;
|
|
2512
2534
|
}
|
|
2513
|
-
function
|
|
2535
|
+
function mi(e, t = {}, r, s, i, n) {
|
|
2514
2536
|
if (i === !0) {
|
|
2515
2537
|
const o = ns(e);
|
|
2516
2538
|
if (o == null) return;
|
|
2517
|
-
const l =
|
|
2539
|
+
const l = rr(t);
|
|
2518
2540
|
ts(!0, o, t, r, s), rs(!0, o, t, l.show, r, s, (a) => {
|
|
2519
2541
|
b(n) && C(n, [a]);
|
|
2520
2542
|
});
|
|
2521
2543
|
} else b(n) && C(n, []);
|
|
2522
2544
|
}
|
|
2523
|
-
function
|
|
2545
|
+
function pi(e, t = {}, r, s, i, n) {
|
|
2524
2546
|
if (i === !0) {
|
|
2525
2547
|
const o = ns(e);
|
|
2526
2548
|
if (o == null) return;
|
|
2527
|
-
const l =
|
|
2549
|
+
const l = rr(t);
|
|
2528
2550
|
ss(!0, o, t, r, s), is(!0, o, t, l.hide, null, r, s, (a) => {
|
|
2529
2551
|
b(n) && C(n, [a]);
|
|
2530
2552
|
});
|
|
2531
2553
|
} else b(n) && C(n, []);
|
|
2532
2554
|
}
|
|
2533
|
-
function
|
|
2534
|
-
|
|
2555
|
+
function gi(e) {
|
|
2556
|
+
dt(() => {
|
|
2535
2557
|
for (let t = 0; t < e.length; t++) Reflect.apply(e[t], null, []);
|
|
2536
2558
|
});
|
|
2537
2559
|
}
|
|
@@ -2540,17 +2562,17 @@ function os(e, t = {}, r, s = -1) {
|
|
|
2540
2562
|
mode: t.mode ?? "default",
|
|
2541
2563
|
persisted: !1,
|
|
2542
2564
|
beforeEnter: (i) => {
|
|
2543
|
-
|
|
2565
|
+
We(ti, {}, i);
|
|
2544
2566
|
},
|
|
2545
2567
|
enter: (i) => {
|
|
2546
|
-
|
|
2568
|
+
We(ri, {}, i);
|
|
2547
2569
|
},
|
|
2548
2570
|
leave: (i, n) => {
|
|
2549
|
-
|
|
2571
|
+
We(si, {}, i), dt(() => {
|
|
2550
2572
|
const o = (l) => {
|
|
2551
|
-
(l.target || l.srcElement) === l.currentTarget && (
|
|
2573
|
+
(l.target || l.srcElement) === l.currentTarget && (Xt(i, Bt, o), n && Reflect.apply(n, null, []), e.transition = null);
|
|
2552
2574
|
};
|
|
2553
|
-
|
|
2575
|
+
ft(i, Bt, o), We(ii, {}, i);
|
|
2554
2576
|
});
|
|
2555
2577
|
},
|
|
2556
2578
|
clone: (i) => os(e, t, r, s)
|
|
@@ -2559,21 +2581,21 @@ function os(e, t = {}, r, s = -1) {
|
|
|
2559
2581
|
function te(e, t, r) {
|
|
2560
2582
|
return typeof e == "function" ? Reflect.apply(e, {}, [t, r]) : e;
|
|
2561
2583
|
}
|
|
2562
|
-
function
|
|
2584
|
+
function Lt(e, t) {
|
|
2563
2585
|
if (!e) return null;
|
|
2564
2586
|
const r = e(t);
|
|
2565
2587
|
return r.length === 1 ? r[0] : r;
|
|
2566
2588
|
}
|
|
2567
|
-
function
|
|
2589
|
+
function me(e, t) {
|
|
2568
2590
|
return typeof t == "function" ? t(e) : e;
|
|
2569
2591
|
}
|
|
2570
|
-
var
|
|
2592
|
+
var wi = class {
|
|
2571
2593
|
node;
|
|
2572
2594
|
state;
|
|
2573
2595
|
constructor(e, t) {
|
|
2574
2596
|
this.node = e, this.state = t;
|
|
2575
2597
|
}
|
|
2576
|
-
},
|
|
2598
|
+
}, Wt = $r({
|
|
2577
2599
|
name: "RouterView",
|
|
2578
2600
|
inheritAttrs: !1,
|
|
2579
2601
|
props: {
|
|
@@ -2763,26 +2785,26 @@ var gi = class {
|
|
|
2763
2785
|
}
|
|
2764
2786
|
},
|
|
2765
2787
|
setup(e, t) {
|
|
2766
|
-
const r = Kr(), s = e.multi === !0, i = L(
|
|
2788
|
+
const r = Kr(), s = e.multi === !0, i = L(Ue, null), n = L(jt, 0), o = L(Sr, null), l = L(kt, -1);
|
|
2767
2789
|
let a = null, u = e.modelSlot ?? null;
|
|
2768
2790
|
if (u) {
|
|
2769
|
-
if (Z(
|
|
2791
|
+
if (Z(jt, n + 1), Z(kt, u.index), Z(Tt, u.index), !u.route) {
|
|
2770
2792
|
console.warn("[Fox]child view render error, route not exist");
|
|
2771
2793
|
return;
|
|
2772
2794
|
}
|
|
2773
|
-
const c =
|
|
2774
|
-
c && (
|
|
2795
|
+
const c = at(u, !0);
|
|
2796
|
+
c && (Qs(c), Fr(c, () => u?.route ?? null));
|
|
2775
2797
|
} else {
|
|
2776
2798
|
if (i == null) {
|
|
2777
2799
|
console.error("[Fox]router is not been injected");
|
|
2778
2800
|
return;
|
|
2779
2801
|
}
|
|
2780
|
-
const c = e.name, h = L(xr, null), y = L(
|
|
2802
|
+
const c = e.name, h = L(xr, null), y = L(Tt, 0);
|
|
2781
2803
|
if (a = i[Br](c, n, o, l, h, y), a === null) return;
|
|
2782
2804
|
Z(xr, a);
|
|
2783
2805
|
const d = a[V] === !0;
|
|
2784
|
-
if (d && Z(Sr, a), !s && (Z(
|
|
2785
|
-
const v =
|
|
2806
|
+
if (d && Z(Sr, a), !s && (Z(kt, -1), Z(jt, n + 1), Z(Tt, -1), d && r)) {
|
|
2807
|
+
const v = at(r, !0);
|
|
2786
2808
|
v && Fr(v, () => {
|
|
2787
2809
|
const w = a?.slots.value ?? [];
|
|
2788
2810
|
return w.length > 0 ? w[0].route : null;
|
|
@@ -2790,7 +2812,7 @@ var gi = class {
|
|
|
2790
2812
|
}
|
|
2791
2813
|
}
|
|
2792
2814
|
const f = { value: /* @__PURE__ */ new Map() };
|
|
2793
|
-
return
|
|
2815
|
+
return Pe(() => {
|
|
2794
2816
|
if (f.value && f.value.clear(), u) {
|
|
2795
2817
|
const c = u;
|
|
2796
2818
|
c.route = null, c.model = null, c.instance = null, u = null;
|
|
@@ -2798,45 +2820,60 @@ var gi = class {
|
|
|
2798
2820
|
}), () => {
|
|
2799
2821
|
if (s) {
|
|
2800
2822
|
const c = /* @__PURE__ */ new Map(), h = [], y = a?.slots.value, d = [];
|
|
2801
|
-
for (let
|
|
2802
|
-
const
|
|
2823
|
+
for (let m = 0; m < y.length; m++) {
|
|
2824
|
+
const p = y[m], $ = `${e.name}_${p.index}`, K = te(e.transition, p.route, m) ?? !0, _e = { modelSlot: p };
|
|
2803
2825
|
let j;
|
|
2804
|
-
t.slots.default ? j = ue(
|
|
2805
|
-
const E = {}, se = te(e.viewClass,
|
|
2826
|
+
t.slots.default ? j = ue(Wt, _e, { default: t.slots.default }) : j = ue(Wt, _e);
|
|
2827
|
+
const E = {}, se = te(e.viewClass, p.route, m);
|
|
2806
2828
|
typeof se == "string" && se.length > 0 && (E[se] = !0);
|
|
2807
|
-
const Q = te(e.viewActiveClass,
|
|
2808
|
-
if (typeof Q == "string" && Q.length > 0 && (E[Q] =
|
|
2809
|
-
const
|
|
2810
|
-
|
|
2811
|
-
const
|
|
2812
|
-
const
|
|
2813
|
-
|
|
2829
|
+
const Q = te(e.viewActiveClass, p.route, m), k = te(e.viewInactiveClass, p.route, m), z = f.value.get($);
|
|
2830
|
+
if (typeof Q == "string" && Q.length > 0 && (E[Q] = p.active), typeof k == "string" && k.length > 0 && (E[k] = !p.active), z && p.active !== z.state) {
|
|
2831
|
+
const ye = z.node;
|
|
2832
|
+
p.active ? d.unshift(() => {
|
|
2833
|
+
const mt = () => {
|
|
2834
|
+
const Fe = at(p);
|
|
2835
|
+
Fe != null && Pr(Fe, _r.ACTIVATED);
|
|
2814
2836
|
};
|
|
2815
|
-
|
|
2837
|
+
mi(ye, e, p.route, m, K, mt);
|
|
2816
2838
|
}) : d.push(() => {
|
|
2817
|
-
const
|
|
2818
|
-
const
|
|
2819
|
-
|
|
2839
|
+
const mt = () => {
|
|
2840
|
+
const Fe = at(p);
|
|
2841
|
+
Fe != null && Pr(Fe, _r.INACTIVATED);
|
|
2820
2842
|
};
|
|
2821
|
-
|
|
2843
|
+
pi(ye, e, p.route, m, K, mt);
|
|
2822
2844
|
});
|
|
2823
2845
|
}
|
|
2824
2846
|
const D = {
|
|
2825
2847
|
class: E,
|
|
2826
2848
|
key: $
|
|
2827
|
-
}, N = te(e.viewTagProps,
|
|
2828
|
-
N !== null && typeof N == "object"
|
|
2829
|
-
|
|
2830
|
-
|
|
2849
|
+
}, N = te(e.viewTagProps, p.route, m);
|
|
2850
|
+
if (N !== null && typeof N == "object") {
|
|
2851
|
+
const ye = me(N, i?.propsFilter);
|
|
2852
|
+
q(!0, D, ye);
|
|
2853
|
+
}
|
|
2854
|
+
if (p.route?.viewTagAttrs && typeof p.route?.viewTagAttrs == "object") {
|
|
2855
|
+
const ye = me(p.route.viewTagAttrs, i?.propsFilter);
|
|
2856
|
+
q(!0, D, ye);
|
|
2857
|
+
}
|
|
2858
|
+
const as = te(e.viewTag, p.route, m), he = ue(as, D, { default: () => [j] });
|
|
2859
|
+
c.set($, new wi(he, p.active)), f.value.delete($), K === !0 ? he.transition = Vt(he, e, p.route, m) : K === "custom" && (he.transition = os(he, e, p.route, m)), h.push(he);
|
|
2831
2860
|
}
|
|
2832
|
-
f.value = c,
|
|
2861
|
+
f.value = c, gi(d);
|
|
2833
2862
|
const v = te(e.tag, null, -1), w = {};
|
|
2834
2863
|
return Object.assign(w, t.attrs), ue(v, w, { default: () => h });
|
|
2835
2864
|
} else if (u != null) {
|
|
2836
2865
|
const c = u.model, h = {};
|
|
2837
|
-
|
|
2866
|
+
if (c.props) {
|
|
2867
|
+
if (typeof c.props == "object") {
|
|
2868
|
+
const d = me(c.props, i?.propsFilter);
|
|
2869
|
+
q(!1, h, d);
|
|
2870
|
+
} else if (c.props === !0 && typeof u.route?.params == "object") {
|
|
2871
|
+
const d = me(u.route.params, i?.propsFilter);
|
|
2872
|
+
q(!1, h, d);
|
|
2873
|
+
}
|
|
2874
|
+
}
|
|
2838
2875
|
const y = ue(c.component, h);
|
|
2839
|
-
return
|
|
2876
|
+
return Lt(t.slots.default, {
|
|
2840
2877
|
Component: y,
|
|
2841
2878
|
route: u.route
|
|
2842
2879
|
}) ?? y;
|
|
@@ -2844,18 +2881,26 @@ var gi = class {
|
|
|
2844
2881
|
const c = a?.slots.value ?? [];
|
|
2845
2882
|
if (c.length > 0) {
|
|
2846
2883
|
const h = c[0], y = h.route, d = h.model, v = {};
|
|
2847
|
-
|
|
2884
|
+
if (d.props) {
|
|
2885
|
+
if (typeof d.props == "object") {
|
|
2886
|
+
const m = me(d.props, i?.propsFilter);
|
|
2887
|
+
q(!1, v, m);
|
|
2888
|
+
} else if (d.props === !0 && typeof y?.params == "object") {
|
|
2889
|
+
const m = me(y.params, i?.propsFilter);
|
|
2890
|
+
q(!1, v, m);
|
|
2891
|
+
}
|
|
2892
|
+
}
|
|
2848
2893
|
const w = ue(d.component, v);
|
|
2849
|
-
return (te(e.transition, y, -1) ?? !0) && (w.transition =
|
|
2894
|
+
return (te(e.transition, y, -1) ?? !0) && (w.transition = Vt(w, e, y, -1)), Lt(t.slots.default, {
|
|
2850
2895
|
Component: w,
|
|
2851
2896
|
route: y
|
|
2852
2897
|
}) ?? w;
|
|
2853
|
-
} else return
|
|
2898
|
+
} else return Lt(t.slots.fallback, {});
|
|
2854
2899
|
}
|
|
2855
2900
|
};
|
|
2856
2901
|
}
|
|
2857
2902
|
});
|
|
2858
|
-
function
|
|
2903
|
+
function bi(e) {
|
|
2859
2904
|
if (!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && !e.defaultPrevented && !(e.button != null && e.button !== 0)) {
|
|
2860
2905
|
if (e.currentTarget && e.currentTarget.getAttribute) {
|
|
2861
2906
|
const t = e.currentTarget.getAttribute("target");
|
|
@@ -2864,13 +2909,13 @@ function wi(e) {
|
|
|
2864
2909
|
return e.preventDefault && e.preventDefault(), !0;
|
|
2865
2910
|
}
|
|
2866
2911
|
}
|
|
2867
|
-
function
|
|
2912
|
+
function Ri(e, t) {
|
|
2868
2913
|
return e == null || t == null ? !1 : !!(e.path && t.path && t.path.startsWith(e.path) || e.name && e.name == t.name);
|
|
2869
2914
|
}
|
|
2870
|
-
function
|
|
2915
|
+
function pe(e, t) {
|
|
2871
2916
|
return typeof e == "function" ? Reflect.apply(e, {}, [t]) : e;
|
|
2872
2917
|
}
|
|
2873
|
-
var
|
|
2918
|
+
var Si = $r({
|
|
2874
2919
|
name: "RouterLink",
|
|
2875
2920
|
inheritAttrs: !1,
|
|
2876
2921
|
props: {
|
|
@@ -2917,23 +2962,23 @@ var Ri = $r({
|
|
|
2917
2962
|
}
|
|
2918
2963
|
},
|
|
2919
2964
|
setup(e, t) {
|
|
2920
|
-
const r = L(
|
|
2965
|
+
const r = L(Ue, null);
|
|
2921
2966
|
return () => {
|
|
2922
|
-
let s =
|
|
2967
|
+
let s = pe(e.to, null), i = pe(e.tag, s);
|
|
2923
2968
|
if (i == null) {
|
|
2924
2969
|
console.warn("[Fox]can not resolve link tag");
|
|
2925
2970
|
return;
|
|
2926
2971
|
}
|
|
2927
2972
|
let n = null, o = null;
|
|
2928
2973
|
r !== null && (n = r[M](s), e.root && (n.root = e.root), o = r.currentRoute.value);
|
|
2929
|
-
let l = {}, a =
|
|
2930
|
-
if (typeof a == "string" && a.length > 0 && (l[a] =
|
|
2931
|
-
let c =
|
|
2974
|
+
let l = {}, a = pe(e.activeClass, n);
|
|
2975
|
+
if (typeof a == "string" && a.length > 0 && (l[a] = Ri(n, o)), pe(e.exact, n) === !0) {
|
|
2976
|
+
let c = pe(e.exactActiveClass, n);
|
|
2932
2977
|
typeof c == "string" && c.length > 0 && (l[c] = R.isSamePathForRoute(n, o));
|
|
2933
2978
|
}
|
|
2934
2979
|
let u = { class: l };
|
|
2935
2980
|
(i === "a" || i === "A") && (u.href = n?.path ?? n?.name ?? "#"), q(!0, u, t.attrs);
|
|
2936
|
-
const f =
|
|
2981
|
+
const f = pe(e.event, n);
|
|
2937
2982
|
if (typeof f == "string") {
|
|
2938
2983
|
const c = (h) => {
|
|
2939
2984
|
if (r == null) {
|
|
@@ -2944,33 +2989,33 @@ var Ri = $r({
|
|
|
2944
2989
|
console.warn("[Fox]route is not been resolved");
|
|
2945
2990
|
return;
|
|
2946
2991
|
}
|
|
2947
|
-
|
|
2992
|
+
bi(h) && r.to(n);
|
|
2948
2993
|
};
|
|
2949
2994
|
u[f] = c;
|
|
2950
2995
|
}
|
|
2951
2996
|
return ue(i, u, t.slots);
|
|
2952
2997
|
};
|
|
2953
2998
|
}
|
|
2954
|
-
}),
|
|
2999
|
+
}), ge = /* @__PURE__ */ Symbol("registerKey"), xi = class {
|
|
2955
3000
|
policy;
|
|
2956
3001
|
callback;
|
|
2957
3002
|
constructor(e, t) {
|
|
2958
3003
|
this.callback = e, this.policy = t;
|
|
2959
3004
|
}
|
|
2960
3005
|
}, Er = class {
|
|
2961
|
-
[
|
|
3006
|
+
[ge] = /* @__PURE__ */ new Map();
|
|
2962
3007
|
constructor() {
|
|
2963
3008
|
}
|
|
2964
3009
|
on(e, t, r = !1) {
|
|
2965
|
-
let s = this[
|
|
2966
|
-
s || (s = new Array(), this[
|
|
2967
|
-
let i = new
|
|
3010
|
+
let s = this[ge].get(e);
|
|
3011
|
+
s || (s = new Array(), this[ge].set(e, s));
|
|
3012
|
+
let i = new xi(t, r === !0 ? 1 : 0);
|
|
2968
3013
|
return s.push(i), this;
|
|
2969
3014
|
}
|
|
2970
3015
|
off(e, t) {
|
|
2971
3016
|
if (!t)
|
|
2972
|
-
return this[
|
|
2973
|
-
let r = this[
|
|
3017
|
+
return this[ge].delete(e), this;
|
|
3018
|
+
let r = this[ge].get(e);
|
|
2974
3019
|
if (r) {
|
|
2975
3020
|
for (let s = 0; s < r.length; s++) if (r[s].callback === t) {
|
|
2976
3021
|
r.splice(s, 1);
|
|
@@ -3001,12 +3046,12 @@ var Ri = $r({
|
|
|
3001
3046
|
return this;
|
|
3002
3047
|
}
|
|
3003
3048
|
emit(e, ...t) {
|
|
3004
|
-
let r = this[
|
|
3049
|
+
let r = this[ge].get(e);
|
|
3005
3050
|
if (!r) return this;
|
|
3006
3051
|
for (let s = 0; s < r.length; ) {
|
|
3007
3052
|
let i = r[s];
|
|
3008
3053
|
if (i.policy == 1 ? r.splice(s, 1) : s++, typeof i.callback == "function") try {
|
|
3009
|
-
|
|
3054
|
+
He(() => {
|
|
3010
3055
|
Reflect.apply(i.callback, {}, t);
|
|
3011
3056
|
});
|
|
3012
3057
|
} catch (n) {
|
|
@@ -3018,15 +3063,15 @@ var Ri = $r({
|
|
|
3018
3063
|
trigger(e, ...t) {
|
|
3019
3064
|
return Reflect.apply(this.emit, this, [e, ...t]);
|
|
3020
3065
|
}
|
|
3021
|
-
},
|
|
3066
|
+
}, Pi = "FoxRouterView", _i = "FoxRouterLink", X = /* @__PURE__ */ (function(e) {
|
|
3022
3067
|
return e[e.Loading = 0] = "Loading", e[e.Loaded = 1] = "Loaded", e[e.Defining = 2] = "Defining", e[e.Defined = 3] = "Defined", e;
|
|
3023
3068
|
})({});
|
|
3024
|
-
function
|
|
3069
|
+
function Fi(e) {
|
|
3025
3070
|
return e == 1 || e === 3;
|
|
3026
3071
|
}
|
|
3027
3072
|
var Ar = /* @__PURE__ */ (function(e) {
|
|
3028
3073
|
return e[e.normal = 0] = "normal", e[e.factory = 1] = "factory", e;
|
|
3029
|
-
})({}),
|
|
3074
|
+
})({}), Ci = class {
|
|
3030
3075
|
register = /* @__PURE__ */ new Map();
|
|
3031
3076
|
regExpRegisters = [];
|
|
3032
3077
|
constructor() {
|
|
@@ -3064,16 +3109,16 @@ var Ar = /* @__PURE__ */ (function(e) {
|
|
|
3064
3109
|
clear() {
|
|
3065
3110
|
this.register.clear(), this.regExpRegisters = [];
|
|
3066
3111
|
}
|
|
3067
|
-
},
|
|
3112
|
+
}, It = [
|
|
3068
3113
|
"require",
|
|
3069
3114
|
"exports",
|
|
3070
3115
|
"module"
|
|
3071
3116
|
];
|
|
3072
|
-
async function
|
|
3117
|
+
async function Ei(e) {
|
|
3073
3118
|
return await new Function("url", "return import(url)")(e);
|
|
3074
3119
|
}
|
|
3075
3120
|
var qr = class {
|
|
3076
|
-
moduleManager = new
|
|
3121
|
+
moduleManager = new Ci();
|
|
3077
3122
|
_alias = {};
|
|
3078
3123
|
set alias(e) {
|
|
3079
3124
|
this._alias = e;
|
|
@@ -3103,7 +3148,7 @@ var qr = class {
|
|
|
3103
3148
|
return this._query;
|
|
3104
3149
|
}
|
|
3105
3150
|
get head() {
|
|
3106
|
-
return
|
|
3151
|
+
return Ve().head;
|
|
3107
3152
|
}
|
|
3108
3153
|
_cssMountPoint = null;
|
|
3109
3154
|
set cssMountPoint(e) {
|
|
@@ -3132,7 +3177,7 @@ var qr = class {
|
|
|
3132
3177
|
}
|
|
3133
3178
|
getModuleExports(e) {
|
|
3134
3179
|
const t = this.moduleManager.get(e);
|
|
3135
|
-
return t &&
|
|
3180
|
+
return t && Fi(t.status) ? t.type === Ar.factory && typeof t.exports == "function" ? t.exports() : t.exports : null;
|
|
3136
3181
|
}
|
|
3137
3182
|
exposeRequire(e = "__foxRequire", t, r) {
|
|
3138
3183
|
const s = t ?? F();
|
|
@@ -3143,7 +3188,7 @@ var qr = class {
|
|
|
3143
3188
|
}
|
|
3144
3189
|
resloveResource(e) {
|
|
3145
3190
|
if (typeof e == "string") {
|
|
3146
|
-
if (
|
|
3191
|
+
if (It.includes(e)) return e;
|
|
3147
3192
|
if (e = this.alias?.[e] ?? e, typeof this.resourceParser == "function") {
|
|
3148
3193
|
const r = this.resloveResource(e);
|
|
3149
3194
|
if (!r) return r;
|
|
@@ -3185,7 +3230,7 @@ var qr = class {
|
|
|
3185
3230
|
const u = this.resloveResource(e[a]);
|
|
3186
3231
|
s.push(u);
|
|
3187
3232
|
}
|
|
3188
|
-
const o = new
|
|
3233
|
+
const o = new Ai(s.length, (a, u) => {
|
|
3189
3234
|
if (o.isOK()) try {
|
|
3190
3235
|
typeof n == "function" && Reflect.apply(n, {}, u), t(u);
|
|
3191
3236
|
} catch (f) {
|
|
@@ -3196,9 +3241,9 @@ var qr = class {
|
|
|
3196
3241
|
} catch (f) {
|
|
3197
3242
|
console.error(f), r(f);
|
|
3198
3243
|
}
|
|
3199
|
-
}), l = new
|
|
3244
|
+
}), l = new ct();
|
|
3200
3245
|
for (let a = 0; a < s.length; a++) {
|
|
3201
|
-
const u = new
|
|
3246
|
+
const u = new qi(a, s[a], o);
|
|
3202
3247
|
this.mount(l, u);
|
|
3203
3248
|
}
|
|
3204
3249
|
return this;
|
|
@@ -3239,7 +3284,7 @@ var qr = class {
|
|
|
3239
3284
|
return;
|
|
3240
3285
|
}
|
|
3241
3286
|
if (typeof t.resource == "string") {
|
|
3242
|
-
if (
|
|
3287
|
+
if (It.includes(t.resource)) {
|
|
3243
3288
|
e.post((i) => {
|
|
3244
3289
|
t.progress.work(!0, t.index, t.resource), i.resolve();
|
|
3245
3290
|
});
|
|
@@ -3254,11 +3299,12 @@ var qr = class {
|
|
|
3254
3299
|
}
|
|
3255
3300
|
}
|
|
3256
3301
|
const r = t.resource;
|
|
3257
|
-
if (r.type === "js")
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3302
|
+
if (r.type === "js")
|
|
3303
|
+
if (r.format === "es") this.mountCJS(e, t);
|
|
3304
|
+
else {
|
|
3305
|
+
const s = this.jsMountPoint ?? this.head;
|
|
3306
|
+
this.mountJS(e, t, s);
|
|
3307
|
+
}
|
|
3262
3308
|
else {
|
|
3263
3309
|
const s = this.cssMountPoint ?? this.head;
|
|
3264
3310
|
this.mountCSS(e, t, s);
|
|
@@ -3271,7 +3317,7 @@ var qr = class {
|
|
|
3271
3317
|
t.progress.work(!0, t.index, n), s.resolve();
|
|
3272
3318
|
return;
|
|
3273
3319
|
}
|
|
3274
|
-
const o =
|
|
3320
|
+
const o = Ve(), l = o.createElement("link"), a = "onload" in l;
|
|
3275
3321
|
a && (l.onload = () => {
|
|
3276
3322
|
l.onload = null, l.onerror = null, t.progress.work(!0, t.index, i.path), s.resolve();
|
|
3277
3323
|
}, l.onerror = () => {
|
|
@@ -3299,7 +3345,7 @@ var qr = class {
|
|
|
3299
3345
|
status: X.Loading
|
|
3300
3346
|
};
|
|
3301
3347
|
this.moduleManager.set(i.path, o);
|
|
3302
|
-
const l =
|
|
3348
|
+
const l = Ve().createElement("script");
|
|
3303
3349
|
if ("onload" in l)
|
|
3304
3350
|
l.onload = () => {
|
|
3305
3351
|
l.onload = null, l.onerror = null, o.status === X.Loading && (o.status = X.Loaded, t.progress.work(!0, t.index, i.path)), s.resolve();
|
|
@@ -3335,8 +3381,8 @@ var qr = class {
|
|
|
3335
3381
|
return;
|
|
3336
3382
|
}
|
|
3337
3383
|
try {
|
|
3338
|
-
let n = await
|
|
3339
|
-
if (
|
|
3384
|
+
let n = await Ei(s.path);
|
|
3385
|
+
if (Zt(n) && (n = n.default ?? n), Be(n)) {
|
|
3340
3386
|
t.progress.work(!1, t.index, n), r.resolve();
|
|
3341
3387
|
return;
|
|
3342
3388
|
}
|
|
@@ -3355,7 +3401,7 @@ var qr = class {
|
|
|
3355
3401
|
unmount(e) {
|
|
3356
3402
|
let t = "", r = "";
|
|
3357
3403
|
typeof e == "string" ? (this.moduleManager.remove(e), r = this.getResourcePathSuffix(e), t = e) : (this.moduleManager.remove(e.path), r = e.type === "css" ? "css" : e.format ?? "", t = e.path);
|
|
3358
|
-
const s =
|
|
3404
|
+
const s = Ve();
|
|
3359
3405
|
if (r === "umd") {
|
|
3360
3406
|
let i = s.getElementById(t);
|
|
3361
3407
|
i || (i = s.querySelector(`script[src="${t}"]`)), i && i.remove();
|
|
@@ -3407,7 +3453,7 @@ var qr = class {
|
|
|
3407
3453
|
}
|
|
3408
3454
|
constructResourceUri(e) {
|
|
3409
3455
|
try {
|
|
3410
|
-
if (
|
|
3456
|
+
if (It.includes(e) || !this.query) return e;
|
|
3411
3457
|
const t = this.createSearch(this.query);
|
|
3412
3458
|
return e.indexOf("?") == -1 ? e += `?${t}` : t.length > 0 && (e += `&${t}`), e;
|
|
3413
3459
|
} catch (t) {
|
|
@@ -3431,7 +3477,7 @@ var qr = class {
|
|
|
3431
3477
|
let r = e.lastIndexOf(".", t);
|
|
3432
3478
|
return r == -1 ? "" : e.substring(r + 1, t);
|
|
3433
3479
|
}
|
|
3434
|
-
},
|
|
3480
|
+
}, Ai = class {
|
|
3435
3481
|
finalCallback;
|
|
3436
3482
|
callback;
|
|
3437
3483
|
values;
|
|
@@ -3453,16 +3499,16 @@ var qr = class {
|
|
|
3453
3499
|
isOK() {
|
|
3454
3500
|
return this.status;
|
|
3455
3501
|
}
|
|
3456
|
-
},
|
|
3502
|
+
}, qi = class {
|
|
3457
3503
|
index;
|
|
3458
3504
|
resource;
|
|
3459
3505
|
progress;
|
|
3460
3506
|
constructor(e, t, r) {
|
|
3461
3507
|
this.index = e, this.resource = t, this.progress = r;
|
|
3462
3508
|
}
|
|
3463
|
-
},
|
|
3464
|
-
function
|
|
3465
|
-
const t = new
|
|
3509
|
+
}, zt = /* @__PURE__ */ Symbol("fk"), Jt = /* @__PURE__ */ Symbol("fbk"), Gt = /* @__PURE__ */ Symbol("fepk");
|
|
3510
|
+
function Xi(e = {}) {
|
|
3511
|
+
const t = new Js(e), r = new ar(), s = new Er(), i = new qr(), n = {
|
|
3466
3512
|
get router() {
|
|
3467
3513
|
return t;
|
|
3468
3514
|
},
|
|
@@ -3479,7 +3525,7 @@ function Gi(e = {}) {
|
|
|
3479
3525
|
return s;
|
|
3480
3526
|
},
|
|
3481
3527
|
get EventChain() {
|
|
3482
|
-
return
|
|
3528
|
+
return ct;
|
|
3483
3529
|
},
|
|
3484
3530
|
get Require() {
|
|
3485
3531
|
return qr;
|
|
@@ -3488,10 +3534,10 @@ function Gi(e = {}) {
|
|
|
3488
3534
|
return i;
|
|
3489
3535
|
},
|
|
3490
3536
|
get isESModule() {
|
|
3491
|
-
return
|
|
3537
|
+
return Zt;
|
|
3492
3538
|
},
|
|
3493
3539
|
install(o, l = {}) {
|
|
3494
|
-
o.provide(
|
|
3540
|
+
o.provide(Ue, t), o.provide(zt, n), o.provide(Jt, r), o.provide(Gt, s), l.install !== !1 && (o.component(Pi, Wt), o.component(_i, Si)), l.optionsApi !== !1 && (Reflect.defineProperty(o.config.globalProperties, "$fox", { get() {
|
|
3495
3541
|
return n;
|
|
3496
3542
|
} }), Reflect.defineProperty(o.config.globalProperties, "$router", { get() {
|
|
3497
3543
|
return t;
|
|
@@ -3517,34 +3563,34 @@ function Gi(e = {}) {
|
|
|
3517
3563
|
let f = s;
|
|
3518
3564
|
Reflect.apply(f.trigger, f, [a, ...u]);
|
|
3519
3565
|
}, o.mixin({ computed: { $route() {
|
|
3520
|
-
return
|
|
3566
|
+
return $i(this);
|
|
3521
3567
|
} } })), t.init();
|
|
3522
3568
|
}
|
|
3523
3569
|
};
|
|
3524
3570
|
return n;
|
|
3525
3571
|
}
|
|
3526
3572
|
function ls(e) {
|
|
3527
|
-
return
|
|
3573
|
+
return xe() ? L(Ue, null) : e ? e.$?.appContext?.provides?.[Ue] ?? null : null;
|
|
3528
3574
|
}
|
|
3529
|
-
function
|
|
3575
|
+
function $i(e) {
|
|
3530
3576
|
let t = Cr(e);
|
|
3531
|
-
if (!t && e && !
|
|
3577
|
+
if (!t && e && !xe()) {
|
|
3532
3578
|
let r = e;
|
|
3533
3579
|
for (r = r.$parent; r && (t = Cr(r), !t); )
|
|
3534
3580
|
r = r.$parent;
|
|
3535
3581
|
}
|
|
3536
3582
|
return t;
|
|
3537
3583
|
}
|
|
3538
|
-
function Xi(e) {
|
|
3539
|
-
return Se() ? L(Wt, null) : e ? e.$?.appContext?.provides?.[Wt] ?? null : null;
|
|
3540
|
-
}
|
|
3541
3584
|
function Qi(e) {
|
|
3542
|
-
return
|
|
3585
|
+
return xe() ? L(zt, null) : e ? e.$?.appContext?.provides?.[zt] ?? null : null;
|
|
3543
3586
|
}
|
|
3544
3587
|
function Zi(e) {
|
|
3545
|
-
return
|
|
3588
|
+
return xe() ? L(Jt, null) : e ? e.$?.appContext?.provides?.[Jt] ?? null : null;
|
|
3546
3589
|
}
|
|
3547
3590
|
function Yi(e) {
|
|
3591
|
+
return xe() ? L(Gt, null) : e ? e.$?.appContext?.provides?.[Gt] ?? null : null;
|
|
3592
|
+
}
|
|
3593
|
+
function en(e) {
|
|
3548
3594
|
const t = ls();
|
|
3549
3595
|
if (!t) {
|
|
3550
3596
|
console.error("[Fox]router is not exist.");
|
|
@@ -3558,11 +3604,11 @@ function Yi(e) {
|
|
|
3558
3604
|
}
|
|
3559
3605
|
n();
|
|
3560
3606
|
};
|
|
3561
|
-
t?.beforeEach(r),
|
|
3607
|
+
t?.beforeEach(r), Pe(() => {
|
|
3562
3608
|
t?.removeBeforeEach(r);
|
|
3563
3609
|
});
|
|
3564
3610
|
}
|
|
3565
|
-
function
|
|
3611
|
+
function tn(e) {
|
|
3566
3612
|
const t = ls();
|
|
3567
3613
|
if (!t) {
|
|
3568
3614
|
console.error("[Fox]router is not exist.");
|
|
@@ -3576,63 +3622,63 @@ function en(e) {
|
|
|
3576
3622
|
}
|
|
3577
3623
|
n();
|
|
3578
3624
|
};
|
|
3579
|
-
t?.afterEach(r),
|
|
3625
|
+
t?.afterEach(r), Pe(() => {
|
|
3580
3626
|
t?.removeAfterEach(r);
|
|
3581
3627
|
});
|
|
3582
3628
|
}
|
|
3583
3629
|
export {
|
|
3584
3630
|
ar as Bus,
|
|
3585
|
-
|
|
3631
|
+
ct as EventChain,
|
|
3586
3632
|
Er as EventProxy,
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3633
|
+
ti as FoxBeforeEnter,
|
|
3634
|
+
si as FoxBeforeLeave,
|
|
3635
|
+
ri as FoxEnter,
|
|
3636
|
+
ii as FoxLeave,
|
|
3637
|
+
Bt as FoxLeaveEnd,
|
|
3592
3638
|
_ as OperationType,
|
|
3593
3639
|
R as Route,
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3640
|
+
Js as Router,
|
|
3641
|
+
Si as RouterLink,
|
|
3642
|
+
Wt as RouterView,
|
|
3643
|
+
Vi as bindLifecycleContextToCurrentScope,
|
|
3644
|
+
Xi as createFox,
|
|
3645
|
+
Vs as createMemoryHistory,
|
|
3646
|
+
Us as createWebHashHistory,
|
|
3647
|
+
Bi as createWebHistory,
|
|
3648
|
+
zi as deleteContextValue,
|
|
3649
|
+
Ui as destroyState,
|
|
3604
3650
|
q as extend,
|
|
3605
3651
|
zr as injectContextValue,
|
|
3606
|
-
|
|
3652
|
+
yt as injectLifecycleContext,
|
|
3607
3653
|
sr as isArray,
|
|
3608
|
-
|
|
3609
|
-
|
|
3654
|
+
Ti as isDate,
|
|
3655
|
+
Zt as isESModule,
|
|
3610
3656
|
nr as isEqual,
|
|
3611
3657
|
b as isFunction,
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3658
|
+
ji as isMap,
|
|
3659
|
+
Be as isNil,
|
|
3660
|
+
ps as isObject,
|
|
3661
|
+
ws as isPlainObject,
|
|
3662
|
+
Ii as isPromise,
|
|
3663
|
+
ki as isSet,
|
|
3664
|
+
Mi as isString,
|
|
3665
|
+
Li as isSymbol,
|
|
3666
|
+
tn as onAfterRouteUpdate,
|
|
3667
|
+
en as onBeforeRouteUpdate,
|
|
3668
|
+
Ji as onFoxActivated,
|
|
3669
|
+
Gi as onFoxInactivated,
|
|
3670
|
+
Wi as provideContextValue,
|
|
3671
|
+
Ni as rawState,
|
|
3672
|
+
Hi as reactiveState,
|
|
3673
|
+
Di as shallowReactiveState,
|
|
3628
3674
|
Tr as toBoolean,
|
|
3629
|
-
|
|
3630
|
-
|
|
3675
|
+
Oi as toNumber,
|
|
3676
|
+
Qt as toTypeString,
|
|
3631
3677
|
ir as typeOf,
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3678
|
+
Zi as useBus,
|
|
3679
|
+
Yi as useEventProxy,
|
|
3680
|
+
Qi as useFox,
|
|
3681
|
+
$i as useRoute,
|
|
3636
3682
|
ls as useRouter,
|
|
3637
|
-
|
|
3683
|
+
Xs as withLifecycleContext
|
|
3638
3684
|
};
|