@fox-js/fox 3.1.4 → 3.1.6
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 +9 -1
- package/libs/index.esm.js +471 -466
- package/libs/index.umd.js +1 -1
- package/package.json +2 -2
package/libs/index.esm.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as $r, effectScope as us, getCurrentScope as Kr, h as ue, hasInjectionContext as
|
|
2
|
-
var
|
|
1
|
+
import { defineComponent as $r, effectScope as us, getCurrentScope as Kr, h as ue, hasInjectionContext as Pe, inject as L, onActivated as fs, onDeactivated as cs, onScopeDispose as Ce, provide as Z, reactive as hs, readonly as ys, ref as ds, shallowReactive as ms, shallowRef as jr, toRaw as Ot, watch as vs } from "vue";
|
|
2
|
+
var Se = typeof window < "u", C = function() {
|
|
3
3
|
return window;
|
|
4
|
-
},
|
|
4
|
+
}, Be = function() {
|
|
5
5
|
return window.document;
|
|
6
6
|
};
|
|
7
|
-
function
|
|
7
|
+
function ut(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
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 Ve = (e, t, r) => {
|
|
14
14
|
t = t ?? {
|
|
15
15
|
bubbles: !1,
|
|
16
16
|
cancelable: !1,
|
|
@@ -20,7 +20,7 @@ var We = (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, 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),
|
|
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), Ue = (e) => e == null, gs = Object.prototype.toString, Qt = (e) => gs.call(e), ws = (e) => Qt(e) === "[object Object]", bs = typeof Symbol == "function" && typeof Symbol.toStringTag == "symbol";
|
|
24
24
|
function Zt(e) {
|
|
25
25
|
return e.__esModule || bs && e[Symbol.toStringTag] === "Module";
|
|
26
26
|
}
|
|
@@ -56,17 +56,17 @@ function kr(e, t, r = !1) {
|
|
|
56
56
|
}
|
|
57
57
|
return e;
|
|
58
58
|
}
|
|
59
|
-
var
|
|
59
|
+
var Ie = class Ht {
|
|
60
60
|
static seed = (/* @__PURE__ */ new Date()).getTime();
|
|
61
61
|
static get() {
|
|
62
62
|
let t = ++Ht.seed;
|
|
63
63
|
return t >= Number.MAX_VALUE && (Ht.seed = 0), t;
|
|
64
64
|
}
|
|
65
|
-
},
|
|
66
|
-
function
|
|
67
|
-
|
|
65
|
+
}, vt = Rs ? Promise.resolve() : null;
|
|
66
|
+
function Oe(e, ...t) {
|
|
67
|
+
vt !== null ? t && t.length > 0 ? vt.then(() => {
|
|
68
68
|
e(t);
|
|
69
|
-
}) :
|
|
69
|
+
}) : vt.then(e) : t && t.length > 0 ? setTimeout(() => {
|
|
70
70
|
e(t);
|
|
71
71
|
}) : setTimeout(e);
|
|
72
72
|
}
|
|
@@ -141,11 +141,11 @@ function Ir(e, t) {
|
|
|
141
141
|
}, t);
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
-
var or = /* @__PURE__ */ Symbol("idKey"), ce = /* @__PURE__ */ Symbol("valueKey"),
|
|
144
|
+
var or = /* @__PURE__ */ Symbol("idKey"), ce = /* @__PURE__ */ Symbol("valueKey"), R = /* @__PURE__ */ Symbol("childrenKey"), W = /* @__PURE__ */ Symbol("growKey"), Or = class {
|
|
145
145
|
[W] = !0;
|
|
146
146
|
[or];
|
|
147
147
|
[ce] = ds();
|
|
148
|
-
[
|
|
148
|
+
[R] = /* @__PURE__ */ new Map();
|
|
149
149
|
constructor(e) {
|
|
150
150
|
this[or] = e;
|
|
151
151
|
}
|
|
@@ -153,33 +153,33 @@ var or = /* @__PURE__ */ Symbol("idKey"), ce = /* @__PURE__ */ Symbol("valueKey"
|
|
|
153
153
|
get(e, t) {
|
|
154
154
|
if (t == "value") return e[ce].value;
|
|
155
155
|
if (t === "grow") return e[W];
|
|
156
|
-
let r = e[
|
|
157
|
-
if (r) return
|
|
156
|
+
let r = e[R].get(t);
|
|
157
|
+
if (r) return De(r);
|
|
158
158
|
if (e[W])
|
|
159
|
-
return r = er(t), r[W] = e[W], e[
|
|
159
|
+
return r = er(t), r[W] = e[W], e[R].set(t, r), De(r);
|
|
160
160
|
}
|
|
161
161
|
set(e, t, r) {
|
|
162
|
-
return t == "value" ? (e[ce].value = r, !0) : t === "grow" ? (e[W] = Tr(r), !0) : r == null ? (e[
|
|
162
|
+
return t == "value" ? (e[ce].value = r, !0) : t === "grow" ? (e[W] = Tr(r), !0) : r == null ? (e[R].delete(t), !0) : (console.error(`[Fox]illegal property:${t}`), !1);
|
|
163
163
|
}
|
|
164
164
|
deleteProperty(e, t) {
|
|
165
|
-
return t === "value" || t == "grow" ? (console.error(`[Fox]can not delete property:${String(t)}`), !1) : (e[
|
|
165
|
+
return t === "value" || t == "grow" ? (console.error(`[Fox]can not delete property:${String(t)}`), !1) : (e[R].delete(t), !0);
|
|
166
166
|
}
|
|
167
167
|
}, Yt = "__proxy__";
|
|
168
168
|
function er(e) {
|
|
169
169
|
const t = new Or(e);
|
|
170
170
|
return Reflect.set(t, Yt, new Proxy(t, new Ps())), t;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function De(e) {
|
|
173
173
|
return Reflect.get(e, Yt);
|
|
174
174
|
}
|
|
175
|
-
var
|
|
175
|
+
var Cs = class {
|
|
176
176
|
name = "";
|
|
177
177
|
persistPolicy = "memory";
|
|
178
178
|
storage;
|
|
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" && Ue(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,8 +189,8 @@ var _s = class {
|
|
|
189
189
|
if (!this.persistPolicy || this.persistPolicy === "memory") return null;
|
|
190
190
|
let e = null;
|
|
191
191
|
if (this.persistPolicy === "custom") e = this.storage;
|
|
192
|
-
else if (
|
|
193
|
-
const t =
|
|
192
|
+
else if (Se) {
|
|
193
|
+
const t = C();
|
|
194
194
|
e = this.persistPolicy === "session" ? t.sessionStorage : t.localStorage;
|
|
195
195
|
}
|
|
196
196
|
return e;
|
|
@@ -254,7 +254,7 @@ var _s = class {
|
|
|
254
254
|
}, Hr = class extends Or {
|
|
255
255
|
_persistHandler;
|
|
256
256
|
constructor(e = {}, t) {
|
|
257
|
-
super("__root__"), this._persistHandler = new
|
|
257
|
+
super("__root__"), this._persistHandler = new Cs(e, t), this._persistHandler.init(this);
|
|
258
258
|
}
|
|
259
259
|
put(...e) {
|
|
260
260
|
let t = e.length;
|
|
@@ -263,7 +263,7 @@ var _s = 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[
|
|
266
|
+
r[R].has(i) ? n = r[R].get(i) : (n = er(i), r[R].set(i, n)), r = n;
|
|
267
267
|
}
|
|
268
268
|
return r[ce].value = e[t - 1], this._persistHandler.put(e), !0;
|
|
269
269
|
}
|
|
@@ -273,7 +273,7 @@ var _s = class {
|
|
|
273
273
|
let r = this;
|
|
274
274
|
for (let s = 0; s < t; s++) {
|
|
275
275
|
let i = e[s];
|
|
276
|
-
if (r[
|
|
276
|
+
if (r[R].has(i)) r = r[R].get(i);
|
|
277
277
|
else return;
|
|
278
278
|
}
|
|
279
279
|
return r[ce].value;
|
|
@@ -284,11 +284,11 @@ var _s = class {
|
|
|
284
284
|
let r = this;
|
|
285
285
|
for (let i = 0; i < t - 1; i++) {
|
|
286
286
|
const n = e[i];
|
|
287
|
-
if (r[
|
|
287
|
+
if (r[R].has(n)) r = r[R].get(n);
|
|
288
288
|
else return !1;
|
|
289
289
|
}
|
|
290
290
|
const s = e[t - 1];
|
|
291
|
-
return r[
|
|
291
|
+
return r[R].has(s) ? (r[R].delete(s), this._persistHandler.remove(e), !0) : !1;
|
|
292
292
|
}
|
|
293
293
|
contains(...e) {
|
|
294
294
|
const t = e.length;
|
|
@@ -296,16 +296,16 @@ var _s = class {
|
|
|
296
296
|
let r = this;
|
|
297
297
|
for (let i = 0; i < t - 1; i++) {
|
|
298
298
|
let n = e[i];
|
|
299
|
-
if (r[
|
|
299
|
+
if (r[R].has(n)) r = r[R].get(n);
|
|
300
300
|
else return !1;
|
|
301
301
|
}
|
|
302
302
|
const s = e[t - 1];
|
|
303
|
-
return r[
|
|
303
|
+
return r[R].has(s);
|
|
304
304
|
}
|
|
305
305
|
clear() {
|
|
306
|
-
this[
|
|
306
|
+
this[R].clear(), this._persistHandler.clear();
|
|
307
307
|
}
|
|
308
|
-
},
|
|
308
|
+
}, _s = [
|
|
309
309
|
"put",
|
|
310
310
|
"get",
|
|
311
311
|
"contains",
|
|
@@ -314,48 +314,48 @@ var _s = class {
|
|
|
314
314
|
"_persistHandler"
|
|
315
315
|
];
|
|
316
316
|
function lr(e) {
|
|
317
|
-
return
|
|
317
|
+
return _s.includes(e);
|
|
318
318
|
}
|
|
319
|
-
var
|
|
319
|
+
var Fs = class {
|
|
320
320
|
get(e, t) {
|
|
321
321
|
if (t == "value") return e[ce].value;
|
|
322
322
|
if (t === "grow") return e[W];
|
|
323
|
-
if (t ===
|
|
323
|
+
if (t === R) return e[R];
|
|
324
324
|
if (typeof t == "string" && lr(t)) return e[t];
|
|
325
325
|
const r = String(t);
|
|
326
|
-
let s = e[
|
|
327
|
-
if (s) return
|
|
326
|
+
let s = e[R].get(r);
|
|
327
|
+
if (s) return De(s);
|
|
328
328
|
if (e[W])
|
|
329
|
-
return s = er(r), s[W] = e[W], e[
|
|
329
|
+
return s = er(r), s[W] = e[W], e[R].set(r, s), De(s);
|
|
330
330
|
}
|
|
331
331
|
set(e, t, r) {
|
|
332
|
-
return t == "value" ? (e[ce].value = r, !0) : t === "grow" ? (e[W] = Tr(r), !0) : lr(t) ? !1 : r == null ? (e[
|
|
332
|
+
return t == "value" ? (e[ce].value = r, !0) : t === "grow" ? (e[W] = Tr(r), !0) : lr(t) ? !1 : r == null ? (e[R].delete(t), !0) : (console.error(`[Fox]illegal property:${t}`), !1);
|
|
333
333
|
}
|
|
334
334
|
deleteProperty(e, t) {
|
|
335
|
-
return t === "value" || t == "grow" ? (console.error(`[Fox]can not delete property:${String(t)}`), !1) : (e[
|
|
335
|
+
return t === "value" || t == "grow" ? (console.error(`[Fox]can not delete property:${String(t)}`), !1) : (e[R].delete(t), !0);
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
338
|
function Es(e, t) {
|
|
339
|
-
const r = new Hr(e, t), s = new
|
|
339
|
+
const r = new Hr(e, t), s = new Fs(), i = new Proxy(r, s);
|
|
340
340
|
return Reflect.set(r, Yt, i), r;
|
|
341
341
|
}
|
|
342
342
|
var ar = new Proxy(Hr, { construct(e, t) {
|
|
343
343
|
const r = t[0] ?? {}, s = t[1];
|
|
344
|
-
return
|
|
344
|
+
return De(Es(r, s));
|
|
345
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" && Ue(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 (
|
|
358
|
-
const t =
|
|
357
|
+
else if (Se) {
|
|
358
|
+
const t = C();
|
|
359
359
|
e = this.persistPolicy === "session" ? t.sessionStorage : t.localStorage;
|
|
360
360
|
}
|
|
361
361
|
return e;
|
|
@@ -392,7 +392,7 @@ function Nr(e, t, r) {
|
|
|
392
392
|
const u = Ot(a), f = {};
|
|
393
393
|
for (let c in u) {
|
|
394
394
|
const h = u[c];
|
|
395
|
-
|
|
395
|
+
Ue(h) || (f[c] = h);
|
|
396
396
|
}
|
|
397
397
|
tr(f) ? s.removeState() : s.saveState(f);
|
|
398
398
|
};
|
|
@@ -402,9 +402,9 @@ function Nr(e, t, r) {
|
|
|
402
402
|
const a = r && r.debounceDelay ? r.debounceDelay : 250;
|
|
403
403
|
n = Ir(i, a);
|
|
404
404
|
}
|
|
405
|
-
const o = e ?
|
|
405
|
+
const o = e ? ms(t) : hs(t), l = us(!0);
|
|
406
406
|
return l.run(() => {
|
|
407
|
-
|
|
407
|
+
vs(o, (a) => {
|
|
408
408
|
const u = Ot(a);
|
|
409
409
|
n(u);
|
|
410
410
|
});
|
|
@@ -423,7 +423,7 @@ function As(e, t) {
|
|
|
423
423
|
const o = Ot(n), l = {};
|
|
424
424
|
for (let a in o) {
|
|
425
425
|
const u = o[a];
|
|
426
|
-
|
|
426
|
+
Ue(u) || (l[a] = u);
|
|
427
427
|
}
|
|
428
428
|
tr(l) ? r.removeState() : r.saveState(l);
|
|
429
429
|
};
|
|
@@ -449,7 +449,7 @@ function Ui(e) {
|
|
|
449
449
|
const t = Dt.get(e);
|
|
450
450
|
t && (Dt.delete(e), t.stop());
|
|
451
451
|
}
|
|
452
|
-
var
|
|
452
|
+
var We = /* @__PURE__ */ (function(e) {
|
|
453
453
|
return e[e.Static = 0] = "Static", e[e.Param = 1] = "Param", e[e.Group = 2] = "Group", e;
|
|
454
454
|
})({}), qs = {
|
|
455
455
|
type: 0,
|
|
@@ -527,16 +527,16 @@ function Ts(e, t) {
|
|
|
527
527
|
for (let c = 0; c < u.length; c++) {
|
|
528
528
|
const h = u[c];
|
|
529
529
|
let y = 40 + (r.sensitive ? 0.25 : 0);
|
|
530
|
-
if (h.type ===
|
|
530
|
+
if (h.type === We.Static)
|
|
531
531
|
c || (i += "/"), i += h.value.replace(ks, "\\$&"), y += 40;
|
|
532
|
-
else if (h.type ===
|
|
533
|
-
const { value: d, repeatable:
|
|
532
|
+
else if (h.type === We.Param) {
|
|
533
|
+
const { value: d, repeatable: m, optional: w, regexp: v } = h;
|
|
534
534
|
n.push({
|
|
535
535
|
name: d,
|
|
536
|
-
repeatable:
|
|
536
|
+
repeatable: m,
|
|
537
537
|
optional: w
|
|
538
538
|
});
|
|
539
|
-
const p =
|
|
539
|
+
const p = v || ur;
|
|
540
540
|
if (p !== ur) {
|
|
541
541
|
y += 10;
|
|
542
542
|
try {
|
|
@@ -545,8 +545,8 @@ function Ts(e, t) {
|
|
|
545
545
|
throw new Error(`Invalid custom RegExp for param "${d}" (${p}): ` + K.message);
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
|
-
let $ =
|
|
549
|
-
c || ($ = w && u.length < 2 ? `(?:/${$})` : "/" + $), w && ($ += "?"), i += $, y += 20, w && (y += -8),
|
|
548
|
+
let $ = m ? `((?:${p})(?:/(?:${p}))*)` : `(${p})`;
|
|
549
|
+
c || ($ = w && u.length < 2 ? `(?:/${$})` : "/" + $), w && ($ += "?"), i += $, y += 20, w && (y += -8), m && (y += -20), p === ".*" && (y += -50);
|
|
550
550
|
}
|
|
551
551
|
f.push(y);
|
|
552
552
|
}
|
|
@@ -571,11 +571,11 @@ function Ts(e, t) {
|
|
|
571
571
|
let f = "", c = !1;
|
|
572
572
|
for (const h of e) {
|
|
573
573
|
(!c || !f.endsWith("/")) && (f += "/"), c = !1;
|
|
574
|
-
for (const y of h) if (y.type ===
|
|
575
|
-
else if (y.type ===
|
|
576
|
-
const { value: d, repeatable:
|
|
577
|
-
if (sr(
|
|
578
|
-
const p = sr(
|
|
574
|
+
for (const y of h) if (y.type === We.Static) f += y.value;
|
|
575
|
+
else if (y.type === We.Param) {
|
|
576
|
+
const { value: d, repeatable: m, optional: w } = y, v = d in u ? u[d] : "";
|
|
577
|
+
if (sr(v) && !m) throw new Error(`Provided param "${d}" is an array but it is not repeatable (* or + modifiers)`);
|
|
578
|
+
const p = sr(v) ? v.join("/") : v;
|
|
579
579
|
if (!p)
|
|
580
580
|
if (w)
|
|
581
581
|
h.length < 2 && (f.endsWith("/") ? f = f.slice(0, -1) : c = !0);
|
|
@@ -641,7 +641,7 @@ var Is = class {
|
|
|
641
641
|
constructor(e, t, r, s) {
|
|
642
642
|
this.name = e, this.level = t, this.rootName = r, this.rootIndex = s;
|
|
643
643
|
}
|
|
644
|
-
},
|
|
644
|
+
}, ze = class Vr {
|
|
645
645
|
to;
|
|
646
646
|
routeModel;
|
|
647
647
|
from;
|
|
@@ -656,7 +656,7 @@ var Is = class {
|
|
|
656
656
|
static clear(t) {
|
|
657
657
|
for (let r in t) t[r] = void 0;
|
|
658
658
|
}
|
|
659
|
-
},
|
|
659
|
+
}, x = class Nt {
|
|
660
660
|
path;
|
|
661
661
|
get fullPath() {
|
|
662
662
|
const t = this.path ?? `${this.name}`;
|
|
@@ -707,7 +707,7 @@ var Is = class {
|
|
|
707
707
|
src;
|
|
708
708
|
component;
|
|
709
709
|
constructor(e, t, r) {
|
|
710
|
-
this.id =
|
|
710
|
+
this.id = Ie.get(), this.name = e, this.src = t, typeof t != "function" && (this.component = t), this.props = r;
|
|
711
711
|
}
|
|
712
712
|
get isResolved() {
|
|
713
713
|
return this.component !== void 0;
|
|
@@ -717,7 +717,7 @@ var Is = class {
|
|
|
717
717
|
}
|
|
718
718
|
}, cr = class {
|
|
719
719
|
models = [];
|
|
720
|
-
},
|
|
720
|
+
}, pt = class {
|
|
721
721
|
path;
|
|
722
722
|
match;
|
|
723
723
|
redirect;
|
|
@@ -727,9 +727,9 @@ var Is = class {
|
|
|
727
727
|
layers = [];
|
|
728
728
|
}, _ = /* @__PURE__ */ (function(e) {
|
|
729
729
|
return e[e.Push = 0] = "Push", e[e.Replace = 1] = "Replace", e[e.Put = 2] = "Put", e[e.Append = 3] = "Append", e[e.Open = 4] = "Open", e;
|
|
730
|
-
})({}),
|
|
730
|
+
})({}), gt = /* @__PURE__ */ (function(e) {
|
|
731
731
|
return e[e.Part = 0] = "Part", e[e.All = 1] = "All", e;
|
|
732
|
-
})({}), V = /* @__PURE__ */ Symbol("rootKey"), B = /* @__PURE__ */ Symbol("rootNodeKey"), fe = /* @__PURE__ */ Symbol("parentNodeKey"),
|
|
732
|
+
})({}), V = /* @__PURE__ */ Symbol("rootKey"), B = /* @__PURE__ */ Symbol("rootNodeKey"), fe = /* @__PURE__ */ Symbol("parentNodeKey"), at = /* @__PURE__ */ Symbol("nameKey"), Y = class {
|
|
733
733
|
model;
|
|
734
734
|
route;
|
|
735
735
|
active = !0;
|
|
@@ -737,7 +737,7 @@ var Is = class {
|
|
|
737
737
|
constructor(e, t, r = 0, s = !0) {
|
|
738
738
|
this.route = e, this.model = t, this.index = r, this.active = s;
|
|
739
739
|
}
|
|
740
|
-
},
|
|
740
|
+
}, Ee = class {
|
|
741
741
|
_slots;
|
|
742
742
|
get slots() {
|
|
743
743
|
return this._slots == null && (this._slots = jr([])), this._slots;
|
|
@@ -745,15 +745,15 @@ var Is = class {
|
|
|
745
745
|
get empty() {
|
|
746
746
|
return this._slots == null || this._slots.value.length == 0;
|
|
747
747
|
}
|
|
748
|
-
[
|
|
748
|
+
[at];
|
|
749
749
|
[V];
|
|
750
750
|
[B] = null;
|
|
751
751
|
[fe] = null;
|
|
752
752
|
get name() {
|
|
753
|
-
return this[
|
|
753
|
+
return this[at];
|
|
754
754
|
}
|
|
755
755
|
constructor(e, t, r) {
|
|
756
|
-
this[
|
|
756
|
+
this[at] = e, this[V] = t, r && (this[B] = r);
|
|
757
757
|
}
|
|
758
758
|
}, I = class {
|
|
759
759
|
view;
|
|
@@ -769,7 +769,7 @@ var Is = class {
|
|
|
769
769
|
}
|
|
770
770
|
return !1;
|
|
771
771
|
}
|
|
772
|
-
},
|
|
772
|
+
}, wt = class {
|
|
773
773
|
views = [];
|
|
774
774
|
}, Hs = class {
|
|
775
775
|
layers = [];
|
|
@@ -777,45 +777,41 @@ var Is = class {
|
|
|
777
777
|
time;
|
|
778
778
|
route;
|
|
779
779
|
}, Ns = class {
|
|
780
|
-
|
|
780
|
+
submitCooldownTime = 300;
|
|
781
781
|
submitRecorder = new Ds();
|
|
782
782
|
isSameRoute(e, t) {
|
|
783
783
|
return e == null || t == null ? !1 : e.name === t.name && e.path === t.path && e.root === t.root;
|
|
784
784
|
}
|
|
785
785
|
acquire(e) {
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
this.submitRecorder.time = t;
|
|
789
|
-
return;
|
|
790
|
-
}
|
|
791
|
-
return this.submitRecorder.route = e, this.submitRecorder.time = t, t;
|
|
786
|
+
const t = (/* @__PURE__ */ new Date()).getTime();
|
|
787
|
+
return this.isSameRoute(e, this.submitRecorder.route) && this.submitRecorder.time && t - this.submitRecorder.time <= this.submitCooldownTime ? (this.submitRecorder.time = t, null) : (this.submitRecorder.route = e, this.submitRecorder.time = t, t);
|
|
792
788
|
}
|
|
793
789
|
release(e) {
|
|
794
790
|
this.submitRecorder.time === e && (this.submitRecorder.route = void 0);
|
|
795
791
|
}
|
|
796
|
-
}, O = /* @__PURE__ */ Symbol("chainKey"), T = /* @__PURE__ */ Symbol("cursorKey"),
|
|
792
|
+
}, O = /* @__PURE__ */ Symbol("chainKey"), T = /* @__PURE__ */ Symbol("cursorKey"), bt = /* @__PURE__ */ Symbol("$persistentModeKey"), P = /* @__PURE__ */ Symbol("statusKey"), J = /* @__PURE__ */ Symbol("argsKey"), Je = /* @__PURE__ */ Symbol("exArgsKey"), de = /* @__PURE__ */ Symbol("successFnsKey"), Ae = /* @__PURE__ */ Symbol("errorFnsKey"), ne = /* @__PURE__ */ Symbol("sessionKey"), G = /* @__PURE__ */ Symbol("_go"), ft = class {
|
|
797
793
|
[O] = [];
|
|
798
794
|
[T] = 0;
|
|
799
|
-
[
|
|
795
|
+
[bt] = !1;
|
|
800
796
|
[P] = "Free";
|
|
801
797
|
[J] = [];
|
|
802
|
-
[
|
|
798
|
+
[Je] = [];
|
|
803
799
|
[de] = [];
|
|
804
|
-
[
|
|
805
|
-
[
|
|
800
|
+
[Ae] = [];
|
|
801
|
+
[ne];
|
|
806
802
|
get session() {
|
|
807
|
-
return this[
|
|
803
|
+
return this[ne];
|
|
808
804
|
}
|
|
809
805
|
constructor(e, t = !1) {
|
|
810
|
-
this[
|
|
806
|
+
this[ne] = e, this[bt] = t;
|
|
811
807
|
}
|
|
812
808
|
[G](e, ...t) {
|
|
813
809
|
let r = this[P];
|
|
814
810
|
if (this[P] = "Busy", this[T] += e, this[T] < 0 && (this[T] = 0), this[J] = t, r === "Exception" || r === "Reject") {
|
|
815
|
-
let n = [{ session: this[
|
|
816
|
-
for (; this[
|
|
817
|
-
let o = this[
|
|
818
|
-
typeof o == "function" &&
|
|
811
|
+
let n = [{ session: this[ne] }, ...this[Je]];
|
|
812
|
+
for (; this[Ae].length > 0; ) try {
|
|
813
|
+
let o = this[Ae].shift();
|
|
814
|
+
typeof o == "function" && Oe(() => {
|
|
819
815
|
Reflect.apply(o, {}, n);
|
|
820
816
|
});
|
|
821
817
|
} catch (o) {
|
|
@@ -823,10 +819,10 @@ var Is = class {
|
|
|
823
819
|
}
|
|
824
820
|
return this[P] = r, this[O] = [], this[T] = 0, this;
|
|
825
821
|
} else if (r === "Finished" || this[T] >= this[O].length) {
|
|
826
|
-
let n = [{ session: this[
|
|
822
|
+
let n = [{ session: this[ne] }, ...this[J]];
|
|
827
823
|
for (; this[de].length > 0; ) {
|
|
828
824
|
let o = this[de].shift();
|
|
829
|
-
typeof o == "function" &&
|
|
825
|
+
typeof o == "function" && Oe(() => {
|
|
830
826
|
Reflect.apply(o, {}, n);
|
|
831
827
|
});
|
|
832
828
|
}
|
|
@@ -835,7 +831,7 @@ var Is = class {
|
|
|
835
831
|
if (this[T] >= this[O].length)
|
|
836
832
|
return this[P] = "Free", this;
|
|
837
833
|
let s = this[O][this[T]];
|
|
838
|
-
this[
|
|
834
|
+
this[bt] || (this[O].splice(0, this[T] + 1), this[T] = -1);
|
|
839
835
|
let i = this[T] + 1;
|
|
840
836
|
try {
|
|
841
837
|
let n = !1, o = {
|
|
@@ -851,9 +847,9 @@ var Is = class {
|
|
|
851
847
|
insert: (l) => {
|
|
852
848
|
n || (this[O].splice(i, 0, l), i++);
|
|
853
849
|
},
|
|
854
|
-
session: this[
|
|
850
|
+
session: this[ne]
|
|
855
851
|
};
|
|
856
|
-
|
|
852
|
+
Oe(() => {
|
|
857
853
|
Reflect.apply(s, {}, [o, ...this[J]]);
|
|
858
854
|
});
|
|
859
855
|
} catch (n) {
|
|
@@ -868,17 +864,17 @@ var Is = class {
|
|
|
868
864
|
return this[P] = "Finished", this[J] = e, Reflect.apply(this[G], this, [0]);
|
|
869
865
|
}
|
|
870
866
|
reject(...e) {
|
|
871
|
-
return this[P] = "Reject", this[
|
|
867
|
+
return this[P] = "Reject", this[Je] = e, Reflect.apply(this[G], this, [0]);
|
|
872
868
|
}
|
|
873
869
|
throw(...e) {
|
|
874
|
-
return this[P] = "Exception", this[
|
|
870
|
+
return this[P] = "Exception", this[Je] = e, Reflect.apply(this[G], this, [0]);
|
|
875
871
|
}
|
|
876
872
|
reset(...e) {
|
|
877
873
|
this[P] = "Busy", this[J] = e, this[O] = [], this[T] = 0;
|
|
878
|
-
let t = [{ session: this[
|
|
874
|
+
let t = [{ session: this[ne] }, ...this[J]];
|
|
879
875
|
for (; this[de].length > 0; ) {
|
|
880
876
|
let r = this[de].shift();
|
|
881
|
-
|
|
877
|
+
Oe(() => {
|
|
882
878
|
Reflect.apply(r, this, t);
|
|
883
879
|
});
|
|
884
880
|
}
|
|
@@ -888,25 +884,25 @@ var Is = class {
|
|
|
888
884
|
return this[P] === "Reject" || this[P] === "Exception" ? this : (Array.isArray(e) ? this[O] = [...this[O], ...e] : this[O].push(e), this[P] === "Busy" ? this : (Reflect.apply(this[G], this, [0, ...this[J]]), this));
|
|
889
885
|
}
|
|
890
886
|
wait(e, t) {
|
|
891
|
-
return e && typeof e == "function" && this[de].push(e), t && typeof t == "function" && this[
|
|
887
|
+
return e && typeof e == "function" && this[de].push(e), t && typeof t == "function" && this[Ae].push(t), this[P] === "Busy" ? this : (Reflect.apply(this[G], this, [0, ...this[J]]), this);
|
|
892
888
|
}
|
|
893
889
|
exception(e) {
|
|
894
|
-
return e && typeof e == "function" && this[
|
|
890
|
+
return e && typeof e == "function" && this[Ae].push(e), this[P] === "Busy" ? this : Reflect.apply(this[G], this, [0, ...this[J]]);
|
|
895
891
|
}
|
|
896
892
|
isFinish() {
|
|
897
893
|
return this[P] == "Reject" || this[P] == "Free" && this[T] >= this[O].length;
|
|
898
894
|
}
|
|
899
|
-
},
|
|
895
|
+
}, be = /* @__PURE__ */ Symbol("_notifyChange"), Rt = class {
|
|
900
896
|
currentRoute;
|
|
901
897
|
routes;
|
|
902
898
|
constructor(e, t) {
|
|
903
899
|
this.currentRoute = e, this.routes = t;
|
|
904
900
|
}
|
|
905
|
-
},
|
|
906
|
-
function
|
|
901
|
+
}, oe = /* @__PURE__ */ Symbol("historyChangeConsumerKey"), hr = /* @__PURE__ */ Symbol("_navigateFirstRoute"), Ge = /* @__PURE__ */ Symbol("_getRouteMark"), St = /* @__PURE__ */ Symbol("_getUrlSearch"), xt = /* @__PURE__ */ Symbol("_generateLocation"), Xe = /* @__PURE__ */ Symbol("_setRouteMarkRecorder"), qe = /* @__PURE__ */ Symbol("beforeRestoreFiltersKey"), yr = /* @__PURE__ */ Symbol("_beforeRestore"), dr = "Symbol(_fox_restore_point)";
|
|
902
|
+
function Qe(e, ...t) {
|
|
907
903
|
return typeof e == "function" ? Reflect.apply(e, null, [...t]) : e;
|
|
908
904
|
}
|
|
909
|
-
function
|
|
905
|
+
function mr(e) {
|
|
910
906
|
if (!Array.isArray(e)) return !1;
|
|
911
907
|
if (e.length === 0) return !0;
|
|
912
908
|
const t = e[0];
|
|
@@ -922,44 +918,44 @@ var Wr = class {
|
|
|
922
918
|
traceless = !1;
|
|
923
919
|
changeHandler;
|
|
924
920
|
historyChange;
|
|
925
|
-
[
|
|
926
|
-
[
|
|
921
|
+
[oe] = !1;
|
|
922
|
+
[qe] = new Array();
|
|
927
923
|
backTimeout = 320;
|
|
928
924
|
constructor(e = "hash", t = "", r = "", s = !0, i = !0, n = !1, o, l) {
|
|
929
|
-
this.mode = e, this.base = t, this.query = r, this.firstNavigate = s, this.historyMonitor = i, this.traceless = n, this.storage = o ??
|
|
925
|
+
this.mode = e, this.base = t, this.query = r, this.firstNavigate = s, this.historyMonitor = i, this.traceless = n, this.storage = o ?? C().sessionStorage, this.backTimeout = l ?? 320;
|
|
930
926
|
}
|
|
931
927
|
init(e = !0) {
|
|
932
|
-
const t =
|
|
928
|
+
const t = C();
|
|
933
929
|
return typeof this.historyChange != "function" && (this.historyChange = () => {
|
|
934
|
-
if (typeof this[
|
|
935
|
-
const r = this[
|
|
936
|
-
if (this[
|
|
937
|
-
} else if (this[
|
|
938
|
-
this[
|
|
930
|
+
if (typeof this[oe] == "function") {
|
|
931
|
+
const r = this[oe]();
|
|
932
|
+
if (this[oe] = !1, r) return;
|
|
933
|
+
} else if (this[oe] === !0) {
|
|
934
|
+
this[oe] = !1;
|
|
939
935
|
return;
|
|
940
936
|
}
|
|
941
|
-
if (
|
|
937
|
+
if (Qe(this.historyMonitor)) {
|
|
942
938
|
const r = t.history.state;
|
|
943
|
-
this[
|
|
939
|
+
this[be](r);
|
|
944
940
|
try {
|
|
945
941
|
let s = [];
|
|
946
942
|
if (typeof r == "string" ? s = JSON.parse(r) : s = r, Array.isArray(s) && s.length > 0) {
|
|
947
|
-
const i = this[
|
|
948
|
-
this[
|
|
943
|
+
const i = this[Ge]() ?? "/";
|
|
944
|
+
this[Xe](i, s);
|
|
949
945
|
}
|
|
950
946
|
} catch {
|
|
951
947
|
}
|
|
952
948
|
}
|
|
953
|
-
}),
|
|
949
|
+
}), ut(t, "popstate", this.historyChange), this.firstNavigate && e && this[hr](), Promise.resolve();
|
|
954
950
|
}
|
|
955
951
|
destroy() {
|
|
956
952
|
if (this.historyChange) {
|
|
957
|
-
const e =
|
|
953
|
+
const e = C();
|
|
958
954
|
Xt(e, "popstate", this.historyChange);
|
|
959
955
|
}
|
|
960
956
|
}
|
|
961
957
|
[yr](e, t, r, s) {
|
|
962
|
-
for (let i of this[
|
|
958
|
+
for (let i of this[qe]) try {
|
|
963
959
|
const n = Reflect.apply(i, {}, [
|
|
964
960
|
e,
|
|
965
961
|
t,
|
|
@@ -973,21 +969,21 @@ var Wr = class {
|
|
|
973
969
|
return !0;
|
|
974
970
|
}
|
|
975
971
|
beforeRestoreEach(e) {
|
|
976
|
-
this[
|
|
972
|
+
this[qe].push(e);
|
|
977
973
|
}
|
|
978
974
|
removeBeforeRestoreEach(e) {
|
|
979
|
-
const t = this[
|
|
980
|
-
return t !== -1 ? (this[
|
|
975
|
+
const t = this[qe].indexOf(e);
|
|
976
|
+
return t !== -1 ? (this[qe].splice(t, 1), !0) : !1;
|
|
981
977
|
}
|
|
982
978
|
[hr]() {
|
|
983
|
-
const e = this[
|
|
979
|
+
const e = this[Ge]() ?? "/", t = this.storage.getItem(dr);
|
|
984
980
|
if (t) try {
|
|
985
981
|
const n = JSON.parse(t);
|
|
986
982
|
if (n.mark === e && Array.isArray(n.routes) && n.routes.length > 0) {
|
|
987
983
|
const o = n.routes.filter((l, a) => (l.params = l.params ? Lr(l.params) : {}, this[yr](l, a, e, n.routes)));
|
|
988
984
|
if (o.length > 0) {
|
|
989
|
-
const l = this[
|
|
990
|
-
o[a].query = l || o[a].query, this[
|
|
985
|
+
const l = this[St](), a = o.length - 1;
|
|
986
|
+
o[a].query = l || o[a].query, this[be](o);
|
|
991
987
|
return;
|
|
992
988
|
}
|
|
993
989
|
}
|
|
@@ -996,10 +992,10 @@ var Wr = class {
|
|
|
996
992
|
const r = e.indexOf("!");
|
|
997
993
|
let s;
|
|
998
994
|
r != -1 ? s = e.substring(r + 1) : s = e;
|
|
999
|
-
const i = new
|
|
1000
|
-
i.path = s, i.query = this[
|
|
995
|
+
const i = new x();
|
|
996
|
+
i.path = s, i.query = this[St](), this[be]([i]);
|
|
1001
997
|
}
|
|
1002
|
-
[
|
|
998
|
+
[Xe](e, t) {
|
|
1003
999
|
try {
|
|
1004
1000
|
t.forEach((s) => {
|
|
1005
1001
|
s.params = s.params ? Mr(s.params) : {};
|
|
@@ -1014,14 +1010,14 @@ var Wr = class {
|
|
|
1014
1010
|
}
|
|
1015
1011
|
}
|
|
1016
1012
|
setRestorePoint(e) {
|
|
1017
|
-
const t = this[
|
|
1018
|
-
this[
|
|
1013
|
+
const t = this[Ge]() ?? "/";
|
|
1014
|
+
this[Xe](t, e);
|
|
1019
1015
|
}
|
|
1020
|
-
[
|
|
1016
|
+
[be](e) {
|
|
1021
1017
|
typeof this.changeHandler == "function" && this.changeHandler(e);
|
|
1022
1018
|
}
|
|
1023
|
-
[
|
|
1024
|
-
const e =
|
|
1019
|
+
[Ge]() {
|
|
1020
|
+
const e = C();
|
|
1025
1021
|
if (this.mode === "path") {
|
|
1026
1022
|
let t = e.location.pathname;
|
|
1027
1023
|
return this.base && t.indexOf(this.base) === 0 && (t = t.substring(this.base.length)), t;
|
|
@@ -1031,24 +1027,24 @@ var Wr = class {
|
|
|
1031
1027
|
}
|
|
1032
1028
|
return null;
|
|
1033
1029
|
}
|
|
1034
|
-
[
|
|
1035
|
-
let e =
|
|
1030
|
+
[St]() {
|
|
1031
|
+
let e = C().location.search;
|
|
1036
1032
|
return e.length > 0 && e.indexOf("?") === 0 && (e = e.substring(1)), e;
|
|
1037
1033
|
}
|
|
1038
1034
|
listen(e) {
|
|
1039
1035
|
this.changeHandler = e;
|
|
1040
1036
|
}
|
|
1041
1037
|
go(e, t = !1) {
|
|
1042
|
-
const r =
|
|
1043
|
-
this[
|
|
1038
|
+
const r = C();
|
|
1039
|
+
this[oe] = t, r.history.go(e);
|
|
1044
1040
|
}
|
|
1045
1041
|
goBack(e, t) {
|
|
1046
|
-
const r =
|
|
1047
|
-
if (
|
|
1042
|
+
const r = C(), s = r.history.state;
|
|
1043
|
+
if (mr(s) && s.length > 0) {
|
|
1048
1044
|
let i = !1;
|
|
1049
1045
|
for (let u = s.length - 1; u >= 0; u--) {
|
|
1050
|
-
const f =
|
|
1051
|
-
if (
|
|
1046
|
+
const f = x.from(s[u]);
|
|
1047
|
+
if (x.isSame(f, e)) {
|
|
1052
1048
|
i = !0;
|
|
1053
1049
|
break;
|
|
1054
1050
|
}
|
|
@@ -1063,17 +1059,17 @@ var Wr = class {
|
|
|
1063
1059
|
r.history.go(-1), o = setTimeout(l, n);
|
|
1064
1060
|
}, a = () => {
|
|
1065
1061
|
clearTimeout(o);
|
|
1066
|
-
const u =
|
|
1067
|
-
if (
|
|
1062
|
+
const u = C().history.state;
|
|
1063
|
+
if (mr(u) && u.length > 0) {
|
|
1068
1064
|
let f = u.length;
|
|
1069
|
-
const c = u[f - 1], h =
|
|
1070
|
-
if (
|
|
1065
|
+
const c = u[f - 1], h = x.from(c);
|
|
1066
|
+
if (x.isSame(h, e))
|
|
1071
1067
|
return t(), !0;
|
|
1072
1068
|
if (f > 0) {
|
|
1073
1069
|
let y = !1;
|
|
1074
1070
|
for (let d = f - 1; d >= 0; d--) {
|
|
1075
|
-
const
|
|
1076
|
-
if (!(
|
|
1071
|
+
const m = x.from(u[d]);
|
|
1072
|
+
if (!(m.traceless === !0 || Qe(this.traceless, m)) && x.isSame(m, e)) {
|
|
1077
1073
|
y = !0;
|
|
1078
1074
|
break;
|
|
1079
1075
|
}
|
|
@@ -1090,18 +1086,18 @@ var Wr = class {
|
|
|
1090
1086
|
}
|
|
1091
1087
|
setRouteMark(e) {
|
|
1092
1088
|
const t = e.currentRoute.fullPath;
|
|
1093
|
-
this[
|
|
1089
|
+
this[Xe](t, e.routes);
|
|
1094
1090
|
}
|
|
1095
1091
|
push(e) {
|
|
1096
|
-
const t = this[
|
|
1097
|
-
e.currentRoute.historyUpdatePolicy !== "traceless" && !
|
|
1092
|
+
const t = this[xt](e.currentRoute);
|
|
1093
|
+
e.currentRoute.historyUpdatePolicy !== "traceless" && !Qe(this.traceless, e.currentRoute) && C().history.pushState(e.routes, "", t), this.setRouteMark(e);
|
|
1098
1094
|
}
|
|
1099
1095
|
replace(e) {
|
|
1100
|
-
const t = this[
|
|
1101
|
-
(e.currentRoute.historyUpdatePolicy !== "traceless" || !
|
|
1096
|
+
const t = this[xt](e.currentRoute);
|
|
1097
|
+
(e.currentRoute.historyUpdatePolicy !== "traceless" || !Qe(this.traceless, e.currentRoute)) && C().history.replaceState(e.routes, "", t), this.setRouteMark(e);
|
|
1102
1098
|
}
|
|
1103
|
-
[
|
|
1104
|
-
const t =
|
|
1099
|
+
[xt](e) {
|
|
1100
|
+
const t = C();
|
|
1105
1101
|
let r = "";
|
|
1106
1102
|
if (e.query) {
|
|
1107
1103
|
let o = "";
|
|
@@ -1120,7 +1116,7 @@ var Wr = class {
|
|
|
1120
1116
|
}
|
|
1121
1117
|
};
|
|
1122
1118
|
function Bi(e = !0, t = null, r = "", s = !0, i = !1, n) {
|
|
1123
|
-
return t !== null && (t =
|
|
1119
|
+
return t !== null && (t = C().location.pathname), t && t.endsWith("/") && (t = t.substring(0, t.length - 1)), new Wr("path", t ?? "", r, e, s, i, n);
|
|
1124
1120
|
}
|
|
1125
1121
|
function Us(e = !0, t = "", r = !0, s = !1, i) {
|
|
1126
1122
|
return new Wr("hash", "", t, e, r, s, i);
|
|
@@ -1150,7 +1146,7 @@ var Bs = class {
|
|
|
1150
1146
|
listen(e) {
|
|
1151
1147
|
this.changeHandler = e;
|
|
1152
1148
|
}
|
|
1153
|
-
[
|
|
1149
|
+
[be](e) {
|
|
1154
1150
|
typeof this.changeHandler == "function" && this.changeHandler(e);
|
|
1155
1151
|
}
|
|
1156
1152
|
go(e, t = !1) {
|
|
@@ -1161,7 +1157,7 @@ var Bs = class {
|
|
|
1161
1157
|
let s = !1;
|
|
1162
1158
|
if (typeof t == "function" ? s = t() : s = t, !s) {
|
|
1163
1159
|
const i = this.queue[r];
|
|
1164
|
-
this[
|
|
1160
|
+
this[be](i.routes);
|
|
1165
1161
|
}
|
|
1166
1162
|
}
|
|
1167
1163
|
}
|
|
@@ -1171,7 +1167,7 @@ var Bs = class {
|
|
|
1171
1167
|
if (e === null) r = this.cursor + 1;
|
|
1172
1168
|
else for (let s = this.cursor; s >= 0; s--) {
|
|
1173
1169
|
const i = this.queue[s];
|
|
1174
|
-
if (
|
|
1170
|
+
if (x.isSame(i.currentRoute, e)) break;
|
|
1175
1171
|
r++;
|
|
1176
1172
|
}
|
|
1177
1173
|
if (r === 0) {
|
|
@@ -1195,48 +1191,48 @@ var Bs = class {
|
|
|
1195
1191
|
function Vs(e = "", t = 50) {
|
|
1196
1192
|
return new Bs(e, t);
|
|
1197
1193
|
}
|
|
1198
|
-
var
|
|
1194
|
+
var Ze = /* @__PURE__ */ Symbol("_constructRouteModel"), Ye = /* @__PURE__ */ Symbol("_findRouteModel"), Pt = /* @__PURE__ */ Symbol("_findRootView"), Ws = /* @__PURE__ */ Symbol("_getFirstView"), le = /* @__PURE__ */ Symbol("_removeView"), vr = /* @__PURE__ */ Symbol("_buildPage"), pr = /* @__PURE__ */ Symbol("_resolveComponent"), gr = /* @__PURE__ */ Symbol("_update"), ee = /* @__PURE__ */ Symbol("_merge"), Ct = /* @__PURE__ */ Symbol("_handleHistoryChange"), me = /* @__PURE__ */ Symbol("_handleRouteUpdated"), et = /* @__PURE__ */ Symbol("routeUpdatedCallback"), _t = /* @__PURE__ */ Symbol("currentRoute"), g = /* @__PURE__ */ Symbol("currentRoutes"), tt = /* @__PURE__ */ Symbol("routeSessionCacheKey"), wr = /* @__PURE__ */ Symbol("_addRouteRecorder"), $e = /* @__PURE__ */ Symbol("_removeRouteRecorder"), Ke = /* @__PURE__ */ Symbol("_cloneRouteRecorder"), A = /* @__PURE__ */ Symbol("_handleError"), rt = /* @__PURE__ */ Symbol("errorCallback"), H = /* @__PURE__ */ Symbol("registerKey"), st = /* @__PURE__ */ Symbol("notFoundKey"), Ft = /* @__PURE__ */ Symbol("notFoundPathKey"), U = /* @__PURE__ */ Symbol("forestKey"), S = /* @__PURE__ */ Symbol("historyKey"), je = /* @__PURE__ */ Symbol("beforeFiltersKey"), ke = /* @__PURE__ */ Symbol("afterFiltersKey"), Te = /* @__PURE__ */ Symbol("destroyFiltersKey"), Et = /* @__PURE__ */ Symbol("propsFilterKey"), ve = /* @__PURE__ */ Symbol("mainDispatcherKey"), it = /* @__PURE__ */ Symbol("initKey"), ae = /* @__PURE__ */ Symbol("readyKey"), nt = /* @__PURE__ */ Symbol("readyHandlersKey"), ot = /* @__PURE__ */ Symbol("_markReady"), br = /* @__PURE__ */ Symbol("_createNextFn"), At = /* @__PURE__ */ Symbol("_start"), qt = /* @__PURE__ */ Symbol("_before"), $t = /* @__PURE__ */ Symbol("_after"), Rr = /* @__PURE__ */ Symbol("_destroy"), Kt = /* @__PURE__ */ Symbol("_load"), Me = /* @__PURE__ */ Symbol("_unload"), te = /* @__PURE__ */ Symbol("routerGuardKey");
|
|
1199
1195
|
function zs(e) {
|
|
1200
1196
|
return e.layers.length == 0 || e.layers[0].views.length == 0;
|
|
1201
1197
|
}
|
|
1202
1198
|
var Js = class {
|
|
1203
1199
|
[H] = new Array();
|
|
1204
|
-
[
|
|
1205
|
-
[
|
|
1200
|
+
[st];
|
|
1201
|
+
[Ft] = "*";
|
|
1206
1202
|
[ae] = !1;
|
|
1207
|
-
[
|
|
1203
|
+
[nt] = [];
|
|
1208
1204
|
[U] = new Hs();
|
|
1209
|
-
[
|
|
1205
|
+
[S];
|
|
1210
1206
|
[g] = new Array();
|
|
1211
|
-
[
|
|
1212
|
-
[
|
|
1213
|
-
[
|
|
1214
|
-
[
|
|
1207
|
+
[_t] = jr(null);
|
|
1208
|
+
[tt] = /* @__PURE__ */ new WeakMap();
|
|
1209
|
+
[rt] = null;
|
|
1210
|
+
[et] = null;
|
|
1215
1211
|
[je] = new Array();
|
|
1216
1212
|
[ke] = new Array();
|
|
1217
1213
|
[Te] = new Array();
|
|
1218
1214
|
[Et] = null;
|
|
1219
|
-
[ve] = new
|
|
1220
|
-
[
|
|
1221
|
-
[
|
|
1215
|
+
[ve] = new ft();
|
|
1216
|
+
[te] = new Ns();
|
|
1217
|
+
[it] = !1;
|
|
1222
1218
|
get currentRoute() {
|
|
1223
|
-
return ys(this[
|
|
1219
|
+
return ys(this[_t]);
|
|
1224
1220
|
}
|
|
1225
1221
|
options;
|
|
1226
1222
|
constructor(e) {
|
|
1227
1223
|
this.options = e ?? {}, this.options.notFoundPath && this.setNotFoundPath(this.options.notFoundPath);
|
|
1228
1224
|
let t = this.options.routes || [];
|
|
1229
|
-
this.addRoutes(t), this.options.notFound && this.setNotFoundRoute(this.options.notFound), e.history ? this[
|
|
1225
|
+
this.addRoutes(t), this.options.notFound && this.setNotFoundRoute(this.options.notFound), e.history ? this[S] = e.history : this[S] = Se ? Us() : Vs(), this[S]?.listen(async (r) => {
|
|
1230
1226
|
let s = !0;
|
|
1231
1227
|
try {
|
|
1232
1228
|
if (typeof r == "string") {
|
|
1233
1229
|
const i = this[M](r);
|
|
1234
|
-
i && await this[
|
|
1235
|
-
} else await this[
|
|
1230
|
+
i && await this[Ct]([i]);
|
|
1231
|
+
} else await this[Ct](r);
|
|
1236
1232
|
} catch (i) {
|
|
1237
1233
|
console.error(i.message, i), s = !1;
|
|
1238
1234
|
}
|
|
1239
|
-
this[ae] === !1 && this[
|
|
1235
|
+
this[ae] === !1 && this[ot](s);
|
|
1240
1236
|
});
|
|
1241
1237
|
}
|
|
1242
1238
|
[A](e = "error", t) {
|
|
@@ -1244,40 +1240,40 @@ var Js = class {
|
|
|
1244
1240
|
t.error(e);
|
|
1245
1241
|
} catch {
|
|
1246
1242
|
}
|
|
1247
|
-
if (typeof this[
|
|
1248
|
-
this[
|
|
1243
|
+
if (typeof this[rt] == "function") try {
|
|
1244
|
+
this[rt](e, t);
|
|
1249
1245
|
} catch {
|
|
1250
1246
|
}
|
|
1251
1247
|
console.error(e);
|
|
1252
1248
|
}
|
|
1253
1249
|
init() {
|
|
1254
|
-
this[
|
|
1250
|
+
this[it] !== !0 && (this[S]?.init(!this[ae]), this[it] = !0);
|
|
1255
1251
|
}
|
|
1256
1252
|
destroy() {
|
|
1257
|
-
this[
|
|
1253
|
+
this[S]?.destroy(), this[it] = !1;
|
|
1258
1254
|
}
|
|
1259
1255
|
isReady() {
|
|
1260
1256
|
return this[ae] ? Promise.resolve() : new Promise((e, t) => {
|
|
1261
|
-
this[
|
|
1257
|
+
this[nt].push([e, t]);
|
|
1262
1258
|
});
|
|
1263
1259
|
}
|
|
1264
|
-
[
|
|
1265
|
-
this[ae] = !0, this[
|
|
1260
|
+
[ot](e) {
|
|
1261
|
+
this[ae] = !0, this[nt].forEach(([t, r]) => {
|
|
1266
1262
|
try {
|
|
1267
1263
|
e ? t() : r();
|
|
1268
1264
|
} catch (s) {
|
|
1269
1265
|
console.error(s.message, s);
|
|
1270
1266
|
}
|
|
1271
|
-
}), this[
|
|
1267
|
+
}), this[nt] = [];
|
|
1272
1268
|
}
|
|
1273
|
-
[
|
|
1269
|
+
[Ct](e) {
|
|
1274
1270
|
try {
|
|
1275
1271
|
if (!e) {
|
|
1276
1272
|
let n = [...this[g]].reverse();
|
|
1277
|
-
return this[Me](n),
|
|
1273
|
+
return this[Me](n), Se && C().location.reload(), Promise.resolve();
|
|
1278
1274
|
}
|
|
1279
1275
|
let t = null, r = [], s = [], i = 0;
|
|
1280
|
-
for (; i < e.length && i < this[g].length &&
|
|
1276
|
+
for (; i < e.length && i < this[g].length && x.isSame(e[i], this[g][i]); i++)
|
|
1281
1277
|
e[i].active === !0 && e[i].active !== this[g][i].active && (t = e[i]);
|
|
1282
1278
|
if (i < e.length) r = e.slice(i);
|
|
1283
1279
|
else if (i === e.length) for (; i < this[g].length && this[g][i].historyUpdatePolicy === "traceless"; i++)
|
|
@@ -1295,9 +1291,9 @@ var Js = class {
|
|
|
1295
1291
|
}
|
|
1296
1292
|
return Promise.resolve();
|
|
1297
1293
|
}
|
|
1298
|
-
[
|
|
1299
|
-
if (this[
|
|
1300
|
-
this[
|
|
1294
|
+
[me](e = null) {
|
|
1295
|
+
if (this[_t].value = e, typeof this[et] == "function") try {
|
|
1296
|
+
this[et](e);
|
|
1301
1297
|
} catch {
|
|
1302
1298
|
}
|
|
1303
1299
|
}
|
|
@@ -1317,47 +1313,56 @@ var Js = class {
|
|
|
1317
1313
|
}
|
|
1318
1314
|
r || this[g].push(e);
|
|
1319
1315
|
} else this[g].push(e);
|
|
1320
|
-
this[
|
|
1316
|
+
this[tt].set(e, t), this[me](e);
|
|
1321
1317
|
}
|
|
1322
1318
|
[Ke]() {
|
|
1323
1319
|
let e = [];
|
|
1324
1320
|
for (let t of this[g]) {
|
|
1325
|
-
let r =
|
|
1321
|
+
let r = x.clone(t, !0);
|
|
1326
1322
|
e.push(r);
|
|
1327
1323
|
}
|
|
1328
1324
|
return e;
|
|
1329
1325
|
}
|
|
1330
1326
|
[$e](e) {
|
|
1331
1327
|
if (!this[g]) {
|
|
1332
|
-
this[
|
|
1328
|
+
this[me](null);
|
|
1333
1329
|
return;
|
|
1334
1330
|
}
|
|
1335
1331
|
let t = -1;
|
|
1336
|
-
for (let
|
|
1337
|
-
t =
|
|
1332
|
+
for (let s = 0; s < this[g].length; s++) if (x.isSame(this[g][s], e)) {
|
|
1333
|
+
t = s;
|
|
1338
1334
|
break;
|
|
1339
1335
|
}
|
|
1340
1336
|
if (t != -1) {
|
|
1341
|
-
const
|
|
1337
|
+
const s = this[g][t];
|
|
1342
1338
|
this[g].splice(t, 1);
|
|
1343
|
-
const
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1339
|
+
const i = this[tt].get(s);
|
|
1340
|
+
this[tt].delete(s), this[Rr](s, i);
|
|
1341
|
+
}
|
|
1342
|
+
let r = -1;
|
|
1343
|
+
for (let s = this[g].length - 1; s >= 0; s--) if (this[g][s].active === !0) {
|
|
1344
|
+
r = s;
|
|
1345
|
+
break;
|
|
1346
|
+
}
|
|
1347
|
+
r !== -1 ? this[me](this[g][r]) : this[me](null);
|
|
1349
1348
|
}
|
|
1350
1349
|
set historyMonitor(e) {
|
|
1351
|
-
this[
|
|
1350
|
+
this[S] && (this[S].historyMonitor = e);
|
|
1352
1351
|
}
|
|
1353
1352
|
get historyMonitor() {
|
|
1354
|
-
return this[
|
|
1353
|
+
return this[S] ? this[S].historyMonitor : !1;
|
|
1355
1354
|
}
|
|
1356
1355
|
set traceless(e) {
|
|
1357
|
-
this[
|
|
1356
|
+
this[S] && (this[S].traceless = e);
|
|
1358
1357
|
}
|
|
1359
1358
|
get traceless() {
|
|
1360
|
-
return this[
|
|
1359
|
+
return this[S]?.traceless ?? !1;
|
|
1360
|
+
}
|
|
1361
|
+
set submitCooldownTime(e) {
|
|
1362
|
+
this[te] && (this[te].submitCooldownTime = e);
|
|
1363
|
+
}
|
|
1364
|
+
get submitCooldownTime() {
|
|
1365
|
+
return this[te]?.submitCooldownTime ?? 0;
|
|
1361
1366
|
}
|
|
1362
1367
|
set propsFilter(e) {
|
|
1363
1368
|
this[Et] = e;
|
|
@@ -1367,13 +1372,13 @@ var Js = class {
|
|
|
1367
1372
|
}
|
|
1368
1373
|
setRestorePoint() {
|
|
1369
1374
|
const e = this[Ke]();
|
|
1370
|
-
this[
|
|
1375
|
+
this[S]?.setRestorePoint(e);
|
|
1371
1376
|
}
|
|
1372
1377
|
onRouteUpdated(e) {
|
|
1373
|
-
this[
|
|
1378
|
+
this[et] = e;
|
|
1374
1379
|
}
|
|
1375
1380
|
onError(e) {
|
|
1376
|
-
this[
|
|
1381
|
+
this[rt] = e;
|
|
1377
1382
|
}
|
|
1378
1383
|
beforeEach(e) {
|
|
1379
1384
|
this[je].push(e);
|
|
@@ -1397,20 +1402,20 @@ var Js = class {
|
|
|
1397
1402
|
return t !== -1 ? (this[Te].splice(t, 1), !0) : !1;
|
|
1398
1403
|
}
|
|
1399
1404
|
beforeRestoreEach(e) {
|
|
1400
|
-
this[
|
|
1405
|
+
this[S]?.beforeRestoreEach(e);
|
|
1401
1406
|
}
|
|
1402
1407
|
removeBeforeRestoreEach(e) {
|
|
1403
|
-
return this[
|
|
1408
|
+
return this[S]?.removeBeforeRestoreEach(e) ?? !1;
|
|
1404
1409
|
}
|
|
1405
1410
|
addRoutes(e) {
|
|
1406
1411
|
for (let t of e) this.addRoute(t);
|
|
1407
1412
|
}
|
|
1408
1413
|
addRoute(e, t = -1) {
|
|
1409
|
-
if (e.path === this[
|
|
1414
|
+
if (e.path === this[Ft]) {
|
|
1410
1415
|
this.setNotFoundRoute(e);
|
|
1411
1416
|
return;
|
|
1412
1417
|
}
|
|
1413
|
-
const r = this[
|
|
1418
|
+
const r = this[Ze](e);
|
|
1414
1419
|
if (t == -1) this[H] = [...this[H], ...r];
|
|
1415
1420
|
else for (let s = r.length - 1; s >= 0; s--) this[H].splice(t, 0, r[s]);
|
|
1416
1421
|
}
|
|
@@ -1434,24 +1439,24 @@ var Js = class {
|
|
|
1434
1439
|
}) !== -1;
|
|
1435
1440
|
}
|
|
1436
1441
|
setNotFoundPath(e) {
|
|
1437
|
-
this[
|
|
1442
|
+
this[Ft] = e;
|
|
1438
1443
|
}
|
|
1439
1444
|
setNotFoundRoute(e) {
|
|
1440
|
-
const t = this[
|
|
1441
|
-
this[
|
|
1445
|
+
const t = this[Ze](e);
|
|
1446
|
+
this[st] = t[0];
|
|
1442
1447
|
}
|
|
1443
1448
|
getRoutes() {
|
|
1444
1449
|
return [...this[H]];
|
|
1445
1450
|
}
|
|
1446
|
-
[
|
|
1451
|
+
[Ze](e) {
|
|
1447
1452
|
let t = e.path ?? "";
|
|
1448
1453
|
t.length > 0 && t.charAt(0) !== "/" && (t = `/${t}`);
|
|
1449
1454
|
let r = e.components ?? (e.component && { "": e.component });
|
|
1450
1455
|
if (!r) {
|
|
1451
|
-
const l = new
|
|
1456
|
+
const l = new pt();
|
|
1452
1457
|
return l.path = t, l.redirect = e.redirect, [l];
|
|
1453
1458
|
}
|
|
1454
|
-
const s = new
|
|
1459
|
+
const s = new x();
|
|
1455
1460
|
s.path = t, s.name = e.name, s.meta = e.meta;
|
|
1456
1461
|
let i = [];
|
|
1457
1462
|
for (let l in r) {
|
|
@@ -1462,9 +1467,9 @@ var Js = class {
|
|
|
1462
1467
|
}
|
|
1463
1468
|
let n = !1, o = [];
|
|
1464
1469
|
if (e.children) for (let l of e.children) {
|
|
1465
|
-
const a = this[
|
|
1470
|
+
const a = this[Ze](l);
|
|
1466
1471
|
for (let u of a) {
|
|
1467
|
-
let f = new
|
|
1472
|
+
let f = new pt();
|
|
1468
1473
|
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);
|
|
1469
1474
|
let c = new cr();
|
|
1470
1475
|
c.models = [...i], f.layers = [c, ...u.layers], f.matchedRoutes = [s, ...u.matchedRoutes ?? []], o.push(f);
|
|
@@ -1473,12 +1478,12 @@ var Js = class {
|
|
|
1473
1478
|
if (!n) {
|
|
1474
1479
|
const l = new cr();
|
|
1475
1480
|
l.models = i;
|
|
1476
|
-
const a = new
|
|
1481
|
+
const a = new pt();
|
|
1477
1482
|
a.name = e.name, a.path = t, a.matchedRoutes = [s], a.layers = [l], o.splice(0, 0, a);
|
|
1478
1483
|
}
|
|
1479
1484
|
return o;
|
|
1480
1485
|
}
|
|
1481
|
-
[
|
|
1486
|
+
[Ye](e) {
|
|
1482
1487
|
const t = e.route;
|
|
1483
1488
|
try {
|
|
1484
1489
|
for (let r of this[H]) {
|
|
@@ -1489,13 +1494,13 @@ var Js = class {
|
|
|
1489
1494
|
const o = n(s);
|
|
1490
1495
|
if (!o) continue;
|
|
1491
1496
|
if (r.redirect) {
|
|
1492
|
-
const l = new
|
|
1497
|
+
const l = new x();
|
|
1493
1498
|
q(!0, l, t), l.path = r.redirect;
|
|
1494
1499
|
const a = {
|
|
1495
1500
|
route: l,
|
|
1496
1501
|
find: void 0
|
|
1497
1502
|
};
|
|
1498
|
-
return this[
|
|
1503
|
+
return this[Ye](a) ? (e.route = a.route, e.find = a.find, t.template && e.find && (e.find = { ...e.find }, e.find.path = t.path), !0) : !1;
|
|
1499
1504
|
}
|
|
1500
1505
|
if (t.params = t.params ?? {}, q(!0, t.params, o.params), t.query) {
|
|
1501
1506
|
const l = t.query;
|
|
@@ -1522,9 +1527,9 @@ var Js = class {
|
|
|
1522
1527
|
[M](e) {
|
|
1523
1528
|
let t = null;
|
|
1524
1529
|
if (Array.isArray(e))
|
|
1525
|
-
if (t = new
|
|
1530
|
+
if (t = new x(), typeof e[0] == "object") t = x.from(e[0]);
|
|
1526
1531
|
else for (let r = 0; r < e.length; r++) r === 0 ? e[r].charAt(0) === "/" ? t.path = e[r] : t.name = e[r] : r === 1 ? t.params = e[r] : r === 2 ? t.root = e[r] : r === 3 && q(!1, t, e[r]);
|
|
1527
|
-
else typeof e == "object" ? t =
|
|
1532
|
+
else typeof e == "object" ? t = x.from(e) : typeof e == "string" && (t = new x(), e.charAt(0) == "/" ? t.path = e : t.name = e);
|
|
1528
1533
|
if (t) {
|
|
1529
1534
|
if (t.path) {
|
|
1530
1535
|
let r = t.path.indexOf("?");
|
|
@@ -1612,12 +1617,12 @@ var Js = class {
|
|
|
1612
1617
|
if (t === !1)
|
|
1613
1618
|
return s.resolve(), r(!0), !0;
|
|
1614
1619
|
const f = () => (s.resolve(), r(!0), !0), c = this[g].length;
|
|
1615
|
-
if (u &&
|
|
1620
|
+
if (u && x.isSame(u, this[g][c - 1])) {
|
|
1616
1621
|
if (a?.historyUpdatePolicy === "traceless") {
|
|
1617
|
-
let h =
|
|
1618
|
-
const y = new
|
|
1619
|
-
this[
|
|
1620
|
-
} else this[
|
|
1622
|
+
let h = x.clone(u, !0);
|
|
1623
|
+
const y = new Rt(h, this[Ke]());
|
|
1624
|
+
this[S]?.replace(y), f();
|
|
1625
|
+
} else this[S]?.goBack(u, f);
|
|
1621
1626
|
return;
|
|
1622
1627
|
}
|
|
1623
1628
|
f();
|
|
@@ -1671,35 +1676,35 @@ var Js = class {
|
|
|
1671
1676
|
const t = this[M](e);
|
|
1672
1677
|
if (!t)
|
|
1673
1678
|
return this[A]("resolve route fail", t), this;
|
|
1674
|
-
const r = this[
|
|
1675
|
-
return r
|
|
1679
|
+
const r = this[te].acquire(t);
|
|
1680
|
+
return r ? (this[ve].post((s) => {
|
|
1676
1681
|
try {
|
|
1677
1682
|
let i = this[At](t);
|
|
1678
1683
|
this[qt](i), this[Kt](i), this[$t](i), i.wait((n, o) => {
|
|
1679
1684
|
const l = n.session.to;
|
|
1680
1685
|
if (n.session.updateResult && n.session.updateResult.status === "success") try {
|
|
1681
|
-
let a =
|
|
1682
|
-
const u = new
|
|
1683
|
-
l.historyUpdatePolicy === "replace" ? this[
|
|
1686
|
+
let a = x.clone(l, !0);
|
|
1687
|
+
const u = new Rt(a, this[Ke]());
|
|
1688
|
+
l.historyUpdatePolicy === "replace" ? this[S]?.replace(u) : l.historyUpdatePolicy === "traceless" ? this[S]?.setRouteMark(u) : this[S]?.push(u);
|
|
1684
1689
|
} catch (a) {
|
|
1685
1690
|
console.error(a.message, a);
|
|
1686
1691
|
}
|
|
1687
|
-
if (
|
|
1692
|
+
if (ze.clear(n.session), this[te].release(r), typeof t.success == "function") try {
|
|
1688
1693
|
Reflect.apply(t.success, {}, []);
|
|
1689
1694
|
} catch (a) {
|
|
1690
1695
|
console.error(a.message, a);
|
|
1691
1696
|
}
|
|
1692
|
-
this[ae] === !1 && this[
|
|
1697
|
+
this[ae] === !1 && this[ot](!0), i = null, s.resolve();
|
|
1693
1698
|
}, (n, o) => {
|
|
1694
|
-
this[
|
|
1699
|
+
this[te].release(r), o !== null && this[A](o, t), this[ae] === !1 && this[ot](!1), ze.clear(n.session), i = null, s.resolve();
|
|
1695
1700
|
});
|
|
1696
1701
|
} catch (i) {
|
|
1697
|
-
this[
|
|
1702
|
+
this[te].release(r), this[A](i, t), s.resolve();
|
|
1698
1703
|
}
|
|
1699
|
-
}), this);
|
|
1704
|
+
}), this) : (this[A]("route forbid", t), this);
|
|
1700
1705
|
}
|
|
1701
1706
|
back(e = 1) {
|
|
1702
|
-
this[
|
|
1707
|
+
this[S]?.go(-e, !1);
|
|
1703
1708
|
}
|
|
1704
1709
|
[br](e) {
|
|
1705
1710
|
return (t, r) => {
|
|
@@ -1717,11 +1722,11 @@ var Js = class {
|
|
|
1717
1722
|
};
|
|
1718
1723
|
}
|
|
1719
1724
|
[At](e) {
|
|
1720
|
-
const t = this[g].length > 0 ? this[g][this[g].length - 1] : void 0, r = new
|
|
1725
|
+
const t = this[g].length > 0 ? this[g][this[g].length - 1] : void 0, r = new ze(e, t), s = {
|
|
1721
1726
|
route: e,
|
|
1722
1727
|
find: null
|
|
1723
1728
|
};
|
|
1724
|
-
if (this[
|
|
1729
|
+
if (this[Ye](s), s.find) {
|
|
1725
1730
|
r.routeModel = s.find, e.matched = s.find.matchedRoutes ?? [];
|
|
1726
1731
|
const i = {};
|
|
1727
1732
|
if (Array.isArray(s.find?.matchedRoutes)) for (let n = 0; n < s.find.matchedRoutes.length; n++) {
|
|
@@ -1730,7 +1735,7 @@ var Js = class {
|
|
|
1730
1735
|
}
|
|
1731
1736
|
e.meta && typeof e.meta == "object" && Object.assign(i, e.meta), e.meta = i;
|
|
1732
1737
|
}
|
|
1733
|
-
return new
|
|
1738
|
+
return new ft(r);
|
|
1734
1739
|
}
|
|
1735
1740
|
[qt](e) {
|
|
1736
1741
|
for (let t of this[je]) e.post((r) => {
|
|
@@ -1774,16 +1779,16 @@ var Js = class {
|
|
|
1774
1779
|
route: r,
|
|
1775
1780
|
find: null
|
|
1776
1781
|
};
|
|
1777
|
-
if (this[
|
|
1782
|
+
if (this[Ye](n))
|
|
1778
1783
|
s = n.find, t.session.routeModel = s;
|
|
1779
|
-
else if (this[
|
|
1784
|
+
else if (this[st]) s = this[st];
|
|
1780
1785
|
else {
|
|
1781
1786
|
t.reject(`not find route model, path:${r.path ?? r.name}`);
|
|
1782
1787
|
return;
|
|
1783
1788
|
}
|
|
1784
1789
|
}
|
|
1785
|
-
const i =
|
|
1786
|
-
this[
|
|
1790
|
+
const i = ze.from(t.session);
|
|
1791
|
+
this[vr](r, s, i).then((n) => {
|
|
1787
1792
|
this[U], t.session.updateResult = n ?? {
|
|
1788
1793
|
status: "success",
|
|
1789
1794
|
message: ""
|
|
@@ -1797,7 +1802,7 @@ var Js = class {
|
|
|
1797
1802
|
if (e.length == 0) return !0;
|
|
1798
1803
|
let t = this[U], r = [];
|
|
1799
1804
|
for (let s of e) {
|
|
1800
|
-
let i = this[
|
|
1805
|
+
let i = this[Pt](t, s);
|
|
1801
1806
|
i != null && r.push({
|
|
1802
1807
|
...i,
|
|
1803
1808
|
route: s
|
|
@@ -1805,20 +1810,20 @@ var Js = class {
|
|
|
1805
1810
|
}
|
|
1806
1811
|
if (r.length == 0)
|
|
1807
1812
|
return this[A]("can not find view index"), !1;
|
|
1808
|
-
for (let s of r.reverse()) this[
|
|
1813
|
+
for (let s of r.reverse()) this[le](t, {
|
|
1809
1814
|
x: s.x,
|
|
1810
1815
|
y: s.y
|
|
1811
1816
|
}, [s.route.index ?? 0], !0);
|
|
1812
1817
|
return !0;
|
|
1813
1818
|
}
|
|
1814
|
-
[
|
|
1819
|
+
[Pt](e, t) {
|
|
1815
1820
|
const r = t.root ?? "default";
|
|
1816
1821
|
let s;
|
|
1817
1822
|
for (let i = 0; i < e.layers.length; i++) {
|
|
1818
1823
|
const n = e.layers[i];
|
|
1819
1824
|
for (let o = n.views.length - 1; o >= 0; o--) {
|
|
1820
1825
|
const l = n.views[o];
|
|
1821
|
-
if (l[V] && l[
|
|
1826
|
+
if (l[V] && l[at] === r)
|
|
1822
1827
|
return s = {
|
|
1823
1828
|
x: o,
|
|
1824
1829
|
y: i
|
|
@@ -1830,7 +1835,7 @@ var Js = class {
|
|
|
1830
1835
|
[Ws](e) {
|
|
1831
1836
|
return e.layers.length > 0 && e.layers[0].views.length > 0 ? e.layers[0].views[0] : null;
|
|
1832
1837
|
}
|
|
1833
|
-
[
|
|
1838
|
+
[le](e, t, r = null, s = !0) {
|
|
1834
1839
|
if (t.y >= e.layers.length || t.x >= e.layers[t.y].views.length) return;
|
|
1835
1840
|
let i = e.layers[t.y].views[t.x], n = !1, o = [], l = !1, a = [...i.slots.value];
|
|
1836
1841
|
for (let f = a.length - 1; f >= 0; f--) {
|
|
@@ -1854,9 +1859,9 @@ var Js = class {
|
|
|
1854
1859
|
let y = f[h];
|
|
1855
1860
|
if (y[fe] && (n || I.include(o, y[fe]))) {
|
|
1856
1861
|
let d = y.slots.value;
|
|
1857
|
-
for (let
|
|
1858
|
-
let w = d[
|
|
1859
|
-
w.route && y[V] && this[$e](w.route), c.push(new I(y, w.index, u)), d.splice(
|
|
1862
|
+
for (let m = d.length - 1; m >= 0; m--) {
|
|
1863
|
+
let w = d[m];
|
|
1864
|
+
w.route && y[V] && this[$e](w.route), c.push(new I(y, w.index, u)), d.splice(m, 1);
|
|
1860
1865
|
}
|
|
1861
1866
|
e.layers[u].views.splice(h, 1);
|
|
1862
1867
|
}
|
|
@@ -1871,7 +1876,7 @@ var Js = class {
|
|
|
1871
1876
|
let r = t.layers[0].views;
|
|
1872
1877
|
r.length > 0 && (r[0].slots.value = []);
|
|
1873
1878
|
}
|
|
1874
|
-
return this[g] = [], this[
|
|
1879
|
+
return this[g] = [], this[me](null), Promise.resolve();
|
|
1875
1880
|
} else return new Promise((t, r) => {
|
|
1876
1881
|
let s = null, i = !1;
|
|
1877
1882
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -1887,15 +1892,15 @@ var Js = class {
|
|
|
1887
1892
|
}
|
|
1888
1893
|
this[ve].post((n) => {
|
|
1889
1894
|
if (s && i === !0) {
|
|
1890
|
-
const o =
|
|
1891
|
-
this[
|
|
1895
|
+
const o = x.clone(s, !0), l = new Rt(o, this[Ke]());
|
|
1896
|
+
this[S]?.replace(l);
|
|
1892
1897
|
}
|
|
1893
1898
|
n.resolve(), t();
|
|
1894
1899
|
});
|
|
1895
1900
|
});
|
|
1896
1901
|
}
|
|
1897
|
-
async [
|
|
1898
|
-
const s = e.updateType ??
|
|
1902
|
+
async [vr](e, t, r) {
|
|
1903
|
+
const s = e.updateType ?? gt.Part;
|
|
1899
1904
|
await this[pr](t);
|
|
1900
1905
|
const i = this[gr](t, e, r, s);
|
|
1901
1906
|
if (i.status === "error") throw Error(i.message);
|
|
@@ -1919,13 +1924,13 @@ var Js = class {
|
|
|
1919
1924
|
};
|
|
1920
1925
|
const i = e.layers[0].models[0];
|
|
1921
1926
|
let n = this[U], o = zs(n), l = t.root ?? "default", a;
|
|
1922
|
-
!o && s ==
|
|
1927
|
+
!o && s == gt.Part && (a = this[Pt](n, t));
|
|
1923
1928
|
let u, f = 0;
|
|
1924
1929
|
if (a == null || a == null)
|
|
1925
|
-
if (o || s ===
|
|
1926
|
-
if (n.layers.length == 0 && (n.layers[0] = new
|
|
1930
|
+
if (o || s === gt.All) {
|
|
1931
|
+
if (n.layers.length == 0 && (n.layers[0] = new wt()), n.layers[0].views.length == 0) {
|
|
1927
1932
|
let c = t.root ?? "default";
|
|
1928
|
-
u = new
|
|
1933
|
+
u = new Ee(c, !0, null), n.layers[0].views = [u];
|
|
1929
1934
|
} else u = n.layers[0].views[0];
|
|
1930
1935
|
a = {
|
|
1931
1936
|
x: 0,
|
|
@@ -1945,13 +1950,13 @@ var Js = class {
|
|
|
1945
1950
|
let y;
|
|
1946
1951
|
if (c.rootName) {
|
|
1947
1952
|
let d = n.layers[h - 1];
|
|
1948
|
-
for (let
|
|
1949
|
-
if (
|
|
1950
|
-
y = new I(
|
|
1953
|
+
for (let m of d.views) {
|
|
1954
|
+
if (m[V] && m.name === c.rootName) {
|
|
1955
|
+
y = new I(m, c.rootIndex ?? 0, h - 1);
|
|
1951
1956
|
break;
|
|
1952
1957
|
}
|
|
1953
|
-
if (
|
|
1954
|
-
y =
|
|
1958
|
+
if (m[B] && m[B].view.name === c.rootName && m[B].index === c.rootIndex) {
|
|
1959
|
+
y = m[B];
|
|
1955
1960
|
break;
|
|
1956
1961
|
}
|
|
1957
1962
|
}
|
|
@@ -1960,14 +1965,14 @@ var Js = class {
|
|
|
1960
1965
|
status: "error",
|
|
1961
1966
|
message: "can not insert view(not find root node ref)"
|
|
1962
1967
|
};
|
|
1963
|
-
u = new
|
|
1968
|
+
u = new Ee(l, !0, y), n.layers[h].views.push(u), a = {
|
|
1964
1969
|
x: n.layers[h].views.length - 1,
|
|
1965
1970
|
y: h
|
|
1966
1971
|
};
|
|
1967
1972
|
}
|
|
1968
1973
|
else u = n.layers[a.y].views[a.x];
|
|
1969
1974
|
if (f = a.y, u[V] = !0, t.opsType === _.Append) {
|
|
1970
|
-
t.index = t.index ??
|
|
1975
|
+
t.index = t.index ?? Ie.get(), t.active = !0;
|
|
1971
1976
|
let c = u.slots.value;
|
|
1972
1977
|
if (c.length > 0) {
|
|
1973
1978
|
let w = c[c.length - 1];
|
|
@@ -1975,14 +1980,14 @@ var Js = class {
|
|
|
1975
1980
|
}
|
|
1976
1981
|
let h = new Y(t, i, t.index, !0);
|
|
1977
1982
|
u.slots.value = [...c, h];
|
|
1978
|
-
let y = f + 1, d = 1,
|
|
1979
|
-
this[ee](n, y, e, d,
|
|
1983
|
+
let y = f + 1, d = 1, m = new I(u, t.index, f);
|
|
1984
|
+
this[ee](n, y, e, d, m);
|
|
1980
1985
|
} else if (t.opsType === _.Open) {
|
|
1981
1986
|
let c = u.slots.value;
|
|
1982
1987
|
const h = t.active ?? !0;
|
|
1983
1988
|
let y = !1;
|
|
1984
1989
|
for (let d of c) {
|
|
1985
|
-
if (d.route !== null &&
|
|
1990
|
+
if (d.route !== null && x.isSamePathForRoute(d.route, t)) {
|
|
1986
1991
|
if (d.active === h)
|
|
1987
1992
|
return t.index = d.index, t.active = h, d.route = t, {
|
|
1988
1993
|
status: "noChange",
|
|
@@ -1993,75 +1998,75 @@ var Js = class {
|
|
|
1993
1998
|
d.route && (d.route.active = d.active);
|
|
1994
1999
|
}
|
|
1995
2000
|
if (!y) {
|
|
1996
|
-
t.index = t.index ??
|
|
2001
|
+
t.index = t.index ?? Ie.get(), t.active = h;
|
|
1997
2002
|
let d = new Y(t, i, t.index, h);
|
|
1998
2003
|
c.push(d);
|
|
1999
|
-
let
|
|
2000
|
-
this[ee](n,
|
|
2004
|
+
let m = f + 1, w = 1, v = new I(u, t.index, f);
|
|
2005
|
+
this[ee](n, m, e, w, v);
|
|
2001
2006
|
}
|
|
2002
2007
|
u.slots.value = [...c];
|
|
2003
2008
|
} else {
|
|
2004
2009
|
let c = u.slots.value;
|
|
2005
2010
|
if (c.length == 0) {
|
|
2006
|
-
t.index = t.index ??
|
|
2011
|
+
t.index = t.index ?? Ie.get(), t.active = !0, u.slots.value = [new Y(t, i, t.index)];
|
|
2007
2012
|
let h = f + 1, y = 1, d = new I(u, t.index, f);
|
|
2008
2013
|
this[ee](n, h, e, y, d);
|
|
2009
2014
|
} else {
|
|
2010
2015
|
let h = c[0];
|
|
2011
2016
|
if (h.model !== i) {
|
|
2012
|
-
this[
|
|
2013
|
-
let y = f + 1, d = 1,
|
|
2014
|
-
this[ee](n, y, e, d,
|
|
2017
|
+
this[le](n, a, null, !0), t.index = t.index ?? Ie.get(), t.active = !0, u.slots.value = [new Y(t, i, t.index)];
|
|
2018
|
+
let y = f + 1, d = 1, m = new I(u, t.index, f);
|
|
2019
|
+
this[ee](n, y, e, d, m);
|
|
2015
2020
|
} else {
|
|
2016
2021
|
h.route !== null && this[$e](h.route);
|
|
2017
2022
|
let y = !1;
|
|
2018
2023
|
const d = t.active ?? !0;
|
|
2019
2024
|
h.active !== d && (h.active = d, y = !0), t.active = d, t.index = h.index, h.route = t;
|
|
2020
|
-
let
|
|
2021
|
-
for (let K = 1; K < c.length; K++)
|
|
2022
|
-
|
|
2023
|
-
let w = [new I(u, t.index, f)],
|
|
2024
|
-
for (; w.length > 0 &&
|
|
2025
|
+
let m = [];
|
|
2026
|
+
for (let K = 1; K < c.length; K++) m.push(c[K].index);
|
|
2027
|
+
m.length > 0 ? this[le](n, a, m, !0) : y && (u.slots.value = [...c]);
|
|
2028
|
+
let w = [new I(u, t.index, f)], v = f + 1, p = 1, $ = new I(u, t.index, f);
|
|
2029
|
+
for (; w.length > 0 && v < n.layers.length && p < e.layers.length; v++, p++) {
|
|
2025
2030
|
let K = [];
|
|
2026
|
-
for (let j = 0; j < n.layers[
|
|
2027
|
-
let E = n.layers[
|
|
2031
|
+
for (let j = 0; j < n.layers[v].views.length; j++) {
|
|
2032
|
+
let E = n.layers[v].views[j];
|
|
2028
2033
|
E[fe] && I.include(w, E[fe]) && K.unshift(j);
|
|
2029
2034
|
}
|
|
2030
2035
|
let _e = [];
|
|
2031
2036
|
for (let j of K) {
|
|
2032
|
-
let E = n.layers[
|
|
2033
|
-
for (let k = 0; k <
|
|
2034
|
-
Q =
|
|
2037
|
+
let E = n.layers[v].views[j], ie = e.layers[p].models, Q;
|
|
2038
|
+
for (let k = 0; k < ie.length; k++) if (E.name === ie[k].name) {
|
|
2039
|
+
Q = ie[k];
|
|
2035
2040
|
break;
|
|
2036
2041
|
}
|
|
2037
|
-
if (!Q) this[
|
|
2042
|
+
if (!Q) this[le](n, {
|
|
2038
2043
|
x: j,
|
|
2039
|
-
y:
|
|
2044
|
+
y: v
|
|
2040
2045
|
}, null, !1);
|
|
2041
2046
|
else {
|
|
2042
2047
|
let k = E.slots.value;
|
|
2043
2048
|
if (k.length == 0) {
|
|
2044
2049
|
let z = 0;
|
|
2045
2050
|
E.slots.value = [new Y(null, Q, z)];
|
|
2046
|
-
let D =
|
|
2051
|
+
let D = v + 1, N = p + 1;
|
|
2047
2052
|
this[ee](n, D, e, N, $);
|
|
2048
2053
|
} else {
|
|
2049
2054
|
let z = k[0];
|
|
2050
2055
|
if (z.model !== Q) {
|
|
2051
|
-
this[
|
|
2056
|
+
this[le](n, {
|
|
2052
2057
|
x: j,
|
|
2053
|
-
y:
|
|
2058
|
+
y: v
|
|
2054
2059
|
}, null, !0), E.slots.value = [new Y(null, Q, 0)];
|
|
2055
|
-
let D =
|
|
2060
|
+
let D = v + 1, N = p + 1;
|
|
2056
2061
|
this[ee](n, D, e, N, $);
|
|
2057
2062
|
} else {
|
|
2058
2063
|
E[V] && z.route !== null && this[$e](z.route);
|
|
2059
2064
|
let D = [];
|
|
2060
2065
|
for (let N = 1; N < k.length; N++) D.push(k[N].index);
|
|
2061
|
-
D.length > 0 && this[
|
|
2066
|
+
D.length > 0 && this[le](n, {
|
|
2062
2067
|
x: j,
|
|
2063
|
-
y:
|
|
2064
|
-
}, D, !0), _e.push(new I(E, z.index,
|
|
2068
|
+
y: v
|
|
2069
|
+
}, D, !0), _e.push(new I(E, z.index, v));
|
|
2065
2070
|
}
|
|
2066
2071
|
}
|
|
2067
2072
|
E[V] = !1;
|
|
@@ -2069,7 +2074,7 @@ var Js = class {
|
|
|
2069
2074
|
}
|
|
2070
2075
|
w = _e;
|
|
2071
2076
|
}
|
|
2072
|
-
this[ee](n,
|
|
2077
|
+
this[ee](n, v, e, p, $);
|
|
2073
2078
|
}
|
|
2074
2079
|
}
|
|
2075
2080
|
}
|
|
@@ -2087,15 +2092,15 @@ var Js = class {
|
|
|
2087
2092
|
for (; o < e.layers.length && n < r.layers.length; o++, n++) {
|
|
2088
2093
|
let l = e.layers[o].views;
|
|
2089
2094
|
for (let a of r.layers[n].models) {
|
|
2090
|
-
let u = new
|
|
2095
|
+
let u = new Ee(a.name, !1, i), f = new Y(null, a);
|
|
2091
2096
|
u.slots.value = [f], l.push(u);
|
|
2092
2097
|
}
|
|
2093
2098
|
}
|
|
2094
2099
|
for (; n < r.layers.length; n++) {
|
|
2095
|
-
let l = new
|
|
2100
|
+
let l = new wt();
|
|
2096
2101
|
l.views = [];
|
|
2097
2102
|
for (let a of r.layers[n].models) {
|
|
2098
|
-
let u = new
|
|
2103
|
+
let u = new Ee(a.name, !1, i), f = new Y(null, a);
|
|
2099
2104
|
u.slots.value = [f], l.views.push(u);
|
|
2100
2105
|
}
|
|
2101
2106
|
e.layers.push(l);
|
|
@@ -2128,15 +2133,15 @@ var Js = class {
|
|
|
2128
2133
|
index: n,
|
|
2129
2134
|
level: t - 1
|
|
2130
2135
|
});
|
|
2131
|
-
let a = new
|
|
2136
|
+
let a = new Ee(e, !0, o);
|
|
2132
2137
|
if (a[fe] = l, t == this[U].layers.length) {
|
|
2133
|
-
let u = new
|
|
2138
|
+
let u = new wt();
|
|
2134
2139
|
u.views = [a], this[U].layers.push(u);
|
|
2135
2140
|
} else this[U].layers[t].views.push(a);
|
|
2136
2141
|
return a;
|
|
2137
2142
|
}
|
|
2138
|
-
},
|
|
2139
|
-
[
|
|
2143
|
+
}, Ne = /* @__PURE__ */ Symbol("rk"), jt = /* @__PURE__ */ Symbol("vd"), Sr = /* @__PURE__ */ Symbol("rv"), kt = /* @__PURE__ */ Symbol("rvi"), xr = /* @__PURE__ */ Symbol("pv"), Tt = /* @__PURE__ */ Symbol("pvi"), Le = /* @__PURE__ */ Symbol("registerKey"), Mt = /* @__PURE__ */ Symbol("parentKey"), Ut = /* @__PURE__ */ Symbol("lc"), Gs = class {
|
|
2144
|
+
[Le] = /* @__PURE__ */ new Map();
|
|
2140
2145
|
[Mt] = null;
|
|
2141
2146
|
get parent() {
|
|
2142
2147
|
return this[Mt]?.deref() ?? null;
|
|
@@ -2147,77 +2152,77 @@ var Js = class {
|
|
|
2147
2152
|
constructor() {
|
|
2148
2153
|
}
|
|
2149
2154
|
set(e, t) {
|
|
2150
|
-
this[
|
|
2155
|
+
this[Le].set(e, t);
|
|
2151
2156
|
}
|
|
2152
2157
|
get(e) {
|
|
2153
|
-
return this[
|
|
2158
|
+
return this[Le].get(e);
|
|
2154
2159
|
}
|
|
2155
2160
|
has(e) {
|
|
2156
|
-
return this[
|
|
2161
|
+
return this[Le].has(e);
|
|
2157
2162
|
}
|
|
2158
2163
|
delete(e) {
|
|
2159
|
-
return this[
|
|
2164
|
+
return this[Le].delete(e);
|
|
2160
2165
|
}
|
|
2161
|
-
},
|
|
2162
|
-
function
|
|
2163
|
-
let r = e ?
|
|
2166
|
+
}, se = /* @__PURE__ */ new WeakMap(), He = [];
|
|
2167
|
+
function lt(e, t = !1) {
|
|
2168
|
+
let r = e ? se.get(e) ?? null : null;
|
|
2164
2169
|
if (t && !r) {
|
|
2165
|
-
r = new Gs(), e &&
|
|
2166
|
-
e &&
|
|
2170
|
+
r = new Gs(), e && se.set(e, r), Ce(() => {
|
|
2171
|
+
e && se.delete(e);
|
|
2167
2172
|
});
|
|
2168
2173
|
const s = L(Ut, null);
|
|
2169
2174
|
s && (r.parent = s), Z(Ut, r);
|
|
2170
2175
|
}
|
|
2171
2176
|
return r;
|
|
2172
2177
|
}
|
|
2173
|
-
function
|
|
2174
|
-
let t = e ?
|
|
2175
|
-
if (!t &&
|
|
2176
|
-
const r =
|
|
2177
|
-
t =
|
|
2178
|
+
function ht(e) {
|
|
2179
|
+
let t = e ? se.get(e) ?? null : null;
|
|
2180
|
+
if (!t && Pe() && (t = L(Ut, null)), !t && He.length > 0) {
|
|
2181
|
+
const r = He.length - 1;
|
|
2182
|
+
t = He[r];
|
|
2178
2183
|
}
|
|
2179
2184
|
return t;
|
|
2180
2185
|
}
|
|
2181
2186
|
async function Xs(e, t) {
|
|
2182
|
-
|
|
2187
|
+
He.push(e);
|
|
2183
2188
|
try {
|
|
2184
2189
|
return await t();
|
|
2185
2190
|
} finally {
|
|
2186
|
-
|
|
2191
|
+
He.pop();
|
|
2187
2192
|
}
|
|
2188
2193
|
}
|
|
2189
2194
|
function Vi(e) {
|
|
2190
2195
|
const t = Kr();
|
|
2191
2196
|
if (!t) return !1;
|
|
2192
|
-
const r =
|
|
2197
|
+
const r = ht();
|
|
2193
2198
|
if (!r) return !1;
|
|
2194
|
-
if (
|
|
2195
|
-
for (let s = 0; s < e.length; s++) e[s] && typeof e[s] == "object" &&
|
|
2196
|
-
return
|
|
2197
|
-
if (
|
|
2198
|
-
for (let s = 0; s < e.length; s++) e[s] && typeof e[s] == "object" &&
|
|
2199
|
+
if (se.set(t, r), Array.isArray(e))
|
|
2200
|
+
for (let s = 0; s < e.length; s++) e[s] && typeof e[s] == "object" && se.set(e[s], r);
|
|
2201
|
+
return Ce(() => {
|
|
2202
|
+
if (se.delete(t), Array.isArray(e))
|
|
2203
|
+
for (let s = 0; s < e.length; s++) e[s] && typeof e[s] == "object" && se.delete(e[s]);
|
|
2199
2204
|
}), !0;
|
|
2200
2205
|
}
|
|
2201
2206
|
function zr(e, t) {
|
|
2202
|
-
const r =
|
|
2207
|
+
const r = ht(e);
|
|
2203
2208
|
if (!r) return null;
|
|
2204
2209
|
let s = r;
|
|
2205
2210
|
for (; s && !s.has(t); ) s = s.parent;
|
|
2206
2211
|
return s?.get(t) ?? null;
|
|
2207
2212
|
}
|
|
2208
2213
|
function Wi(e, t, r) {
|
|
2209
|
-
|
|
2214
|
+
ht(e)?.set(t, r);
|
|
2210
2215
|
}
|
|
2211
2216
|
function zi(e, t, r) {
|
|
2212
|
-
|
|
2217
|
+
ht(e)?.delete(t);
|
|
2213
2218
|
}
|
|
2214
|
-
var
|
|
2219
|
+
var ct = /* @__PURE__ */ Symbol("hooksKey");
|
|
2215
2220
|
function Qs(e) {
|
|
2216
|
-
let t = e.get(
|
|
2217
|
-
t || (t = [], e.set(
|
|
2221
|
+
let t = e.get(ct);
|
|
2222
|
+
t || (t = [], e.set(ct, t));
|
|
2218
2223
|
}
|
|
2219
2224
|
function Pr(e, t) {
|
|
2220
|
-
const r = e.get(
|
|
2225
|
+
const r = e.get(ct);
|
|
2221
2226
|
r != null && Xs(e, async () => {
|
|
2222
2227
|
for (let s = r.length - 1; s >= 0; s--) {
|
|
2223
2228
|
let i = r[s];
|
|
@@ -2230,7 +2235,7 @@ function Pr(e, t) {
|
|
|
2230
2235
|
}
|
|
2231
2236
|
});
|
|
2232
2237
|
}
|
|
2233
|
-
var
|
|
2238
|
+
var Cr = /* @__PURE__ */ (function(e) {
|
|
2234
2239
|
return e.INACTIVATED = "ia", e.ACTIVATED = "a", e;
|
|
2235
2240
|
})({}), Zs = class {
|
|
2236
2241
|
type;
|
|
@@ -2256,8 +2261,8 @@ function ei(e, t, r) {
|
|
|
2256
2261
|
}
|
|
2257
2262
|
function Jr(e) {
|
|
2258
2263
|
return (t) => {
|
|
2259
|
-
const r = zr(null,
|
|
2260
|
-
r && (
|
|
2264
|
+
const r = zr(null, ct);
|
|
2265
|
+
r && (Ce(() => {
|
|
2261
2266
|
ei(r, e, t);
|
|
2262
2267
|
}), Ys(r, e, t));
|
|
2263
2268
|
};
|
|
@@ -2267,10 +2272,10 @@ var Ji = function(e) {
|
|
|
2267
2272
|
}, Gi = function(e) {
|
|
2268
2273
|
cs(e), Jr("ia")(e);
|
|
2269
2274
|
}, Gr = /* @__PURE__ */ Symbol("routeKey");
|
|
2270
|
-
function
|
|
2275
|
+
function _r(e, t) {
|
|
2271
2276
|
e.set(Gr, t);
|
|
2272
2277
|
}
|
|
2273
|
-
function
|
|
2278
|
+
function Fr(e) {
|
|
2274
2279
|
const t = zr(e ?? null, Gr);
|
|
2275
2280
|
return typeof t == "function" ? t() : t;
|
|
2276
2281
|
}
|
|
@@ -2345,17 +2350,17 @@ function rr(e) {
|
|
|
2345
2350
|
hide: r
|
|
2346
2351
|
}), t;
|
|
2347
2352
|
}
|
|
2348
|
-
function
|
|
2353
|
+
function xe(e, t) {
|
|
2349
2354
|
e.classList.contains(t) || e.classList.add(t);
|
|
2350
2355
|
}
|
|
2351
|
-
function
|
|
2356
|
+
function Re(e, t) {
|
|
2352
2357
|
e.classList.remove(t);
|
|
2353
2358
|
}
|
|
2354
|
-
var
|
|
2355
|
-
function
|
|
2356
|
-
|
|
2359
|
+
var mi = Se && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : setTimeout;
|
|
2360
|
+
function yt(e) {
|
|
2361
|
+
mi(e);
|
|
2357
2362
|
}
|
|
2358
|
-
function
|
|
2363
|
+
function F(e, t) {
|
|
2359
2364
|
b(e) && Reflect.apply(e, null, t);
|
|
2360
2365
|
}
|
|
2361
2366
|
function es(e, t, r = -1, s, i, n) {
|
|
@@ -2387,7 +2392,7 @@ function es(e, t, r = -1, s, i, n) {
|
|
|
2387
2392
|
]));
|
|
2388
2393
|
};
|
|
2389
2394
|
a.forEach((f) => {
|
|
2390
|
-
|
|
2395
|
+
ut(e, f, u), o.push({
|
|
2391
2396
|
type: f,
|
|
2392
2397
|
listener: u
|
|
2393
2398
|
});
|
|
@@ -2401,21 +2406,21 @@ function es(e, t, r = -1, s, i, n) {
|
|
|
2401
2406
|
r
|
|
2402
2407
|
]));
|
|
2403
2408
|
};
|
|
2404
|
-
|
|
2409
|
+
ut(e, a, u), o.push({
|
|
2405
2410
|
type: a,
|
|
2406
2411
|
listener: u
|
|
2407
2412
|
});
|
|
2408
2413
|
}
|
|
2409
2414
|
}
|
|
2410
|
-
function
|
|
2411
|
-
return !
|
|
2415
|
+
function dt(e) {
|
|
2416
|
+
return !Se || e === null ? !1 : e.opsType === _.Append || e.opsType === _.Open;
|
|
2412
2417
|
}
|
|
2413
2418
|
function ts(e, t, r = {}, s, i = -1) {
|
|
2414
|
-
if (e ||
|
|
2419
|
+
if (e || dt(s)) {
|
|
2415
2420
|
const n = Xr(r, e);
|
|
2416
|
-
n &&
|
|
2421
|
+
n && xe(t, n);
|
|
2417
2422
|
const o = Qr(r, e);
|
|
2418
|
-
o &&
|
|
2423
|
+
o && xe(t, o), F(li(r, e), [
|
|
2419
2424
|
t,
|
|
2420
2425
|
e,
|
|
2421
2426
|
s,
|
|
@@ -2424,7 +2429,7 @@ function ts(e, t, r = {}, s, i = -1) {
|
|
|
2424
2429
|
}
|
|
2425
2430
|
}
|
|
2426
2431
|
function rs(e, t, r = {}, s, i, n, o) {
|
|
2427
|
-
if (!
|
|
2432
|
+
if (!dt(i) && !e) {
|
|
2428
2433
|
b(o) && o(o, [t]);
|
|
2429
2434
|
return;
|
|
2430
2435
|
}
|
|
@@ -2433,22 +2438,22 @@ function rs(e, t, r = {}, s, i, n, o) {
|
|
|
2433
2438
|
b(o) && o(o, [t]);
|
|
2434
2439
|
return;
|
|
2435
2440
|
}
|
|
2436
|
-
|
|
2441
|
+
yt(() => {
|
|
2437
2442
|
es(t, i, n, s, () => {
|
|
2438
|
-
a &&
|
|
2443
|
+
a && Re(t, a), u && Re(t, u), b(c) && F(c, [
|
|
2439
2444
|
t,
|
|
2440
2445
|
e,
|
|
2441
2446
|
i,
|
|
2442
2447
|
n
|
|
2443
2448
|
]), b(o) && o(o, [t]);
|
|
2444
2449
|
}, () => {
|
|
2445
|
-
b(h) &&
|
|
2450
|
+
b(h) && F(h, [
|
|
2446
2451
|
t,
|
|
2447
2452
|
e,
|
|
2448
2453
|
i,
|
|
2449
2454
|
n
|
|
2450
2455
|
]);
|
|
2451
|
-
}), l &&
|
|
2456
|
+
}), l && Re(t, l), u && xe(t, u), b(f) && F(f, [
|
|
2452
2457
|
t,
|
|
2453
2458
|
e,
|
|
2454
2459
|
i,
|
|
@@ -2457,11 +2462,11 @@ function rs(e, t, r = {}, s, i, n, o) {
|
|
|
2457
2462
|
});
|
|
2458
2463
|
}
|
|
2459
2464
|
function ss(e, t, r = {}, s, i = -1) {
|
|
2460
|
-
if (e ||
|
|
2465
|
+
if (e || dt(s)) {
|
|
2461
2466
|
const n = Zr(r, e);
|
|
2462
|
-
n &&
|
|
2467
|
+
n && xe(t, n);
|
|
2463
2468
|
const o = Yr(r, e);
|
|
2464
|
-
o &&
|
|
2469
|
+
o && xe(t, o), F(ci(r, e), [
|
|
2465
2470
|
t,
|
|
2466
2471
|
e,
|
|
2467
2472
|
s,
|
|
@@ -2470,39 +2475,39 @@ function ss(e, t, r = {}, s, i = -1) {
|
|
|
2470
2475
|
}
|
|
2471
2476
|
}
|
|
2472
2477
|
function is(e, t, r = {}, s, i, n, o, l) {
|
|
2473
|
-
if (!
|
|
2474
|
-
b(l) &&
|
|
2478
|
+
if (!dt(n) && !e) {
|
|
2479
|
+
b(l) && F(l, [t]), !e && b(i) && i();
|
|
2475
2480
|
return;
|
|
2476
2481
|
}
|
|
2477
2482
|
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);
|
|
2478
2483
|
if (!a && !u && !f && !c) {
|
|
2479
|
-
b(l) &&
|
|
2484
|
+
b(l) && F(l, [t]), !e && b(i) && i();
|
|
2480
2485
|
return;
|
|
2481
2486
|
}
|
|
2482
|
-
|
|
2487
|
+
yt(() => {
|
|
2483
2488
|
es(t, n, o, s, () => {
|
|
2484
2489
|
try {
|
|
2485
|
-
u &&
|
|
2490
|
+
u && Re(t, u), f && Re(t, f), b(h) && F(h, [
|
|
2486
2491
|
t,
|
|
2487
2492
|
e,
|
|
2488
2493
|
n,
|
|
2489
2494
|
o
|
|
2490
|
-
]), b(l) &&
|
|
2495
|
+
]), b(l) && F(l, [t]);
|
|
2491
2496
|
} finally {
|
|
2492
2497
|
!e && b(i) && i();
|
|
2493
2498
|
}
|
|
2494
2499
|
}, () => {
|
|
2495
2500
|
try {
|
|
2496
|
-
b(y) &&
|
|
2501
|
+
b(y) && F(y, [
|
|
2497
2502
|
t,
|
|
2498
2503
|
e,
|
|
2499
2504
|
n,
|
|
2500
2505
|
o
|
|
2501
|
-
]), b(l) &&
|
|
2506
|
+
]), b(l) && F(l, [t]);
|
|
2502
2507
|
} finally {
|
|
2503
2508
|
!e && b(i) && i();
|
|
2504
2509
|
}
|
|
2505
|
-
}), a &&
|
|
2510
|
+
}), a && Re(t, a), f && xe(t, f), b(c) && F(c, [
|
|
2506
2511
|
t,
|
|
2507
2512
|
e,
|
|
2508
2513
|
n,
|
|
@@ -2532,15 +2537,15 @@ function Vt(e, t = {}, r, s = -1) {
|
|
|
2532
2537
|
function ns(e) {
|
|
2533
2538
|
return e.el;
|
|
2534
2539
|
}
|
|
2535
|
-
function
|
|
2540
|
+
function vi(e, t = {}, r, s, i, n) {
|
|
2536
2541
|
if (i === !0) {
|
|
2537
2542
|
const o = ns(e);
|
|
2538
2543
|
if (o == null) return;
|
|
2539
2544
|
const l = rr(t);
|
|
2540
2545
|
ts(!0, o, t, r, s), rs(!0, o, t, l.show, r, s, (a) => {
|
|
2541
|
-
b(n) &&
|
|
2546
|
+
b(n) && F(n, [a]);
|
|
2542
2547
|
});
|
|
2543
|
-
} else b(n) &&
|
|
2548
|
+
} else b(n) && F(n, []);
|
|
2544
2549
|
}
|
|
2545
2550
|
function pi(e, t = {}, r, s, i, n) {
|
|
2546
2551
|
if (i === !0) {
|
|
@@ -2548,12 +2553,12 @@ function pi(e, t = {}, r, s, i, n) {
|
|
|
2548
2553
|
if (o == null) return;
|
|
2549
2554
|
const l = rr(t);
|
|
2550
2555
|
ss(!0, o, t, r, s), is(!0, o, t, l.hide, null, r, s, (a) => {
|
|
2551
|
-
b(n) &&
|
|
2556
|
+
b(n) && F(n, [a]);
|
|
2552
2557
|
});
|
|
2553
|
-
} else b(n) &&
|
|
2558
|
+
} else b(n) && F(n, []);
|
|
2554
2559
|
}
|
|
2555
2560
|
function gi(e) {
|
|
2556
|
-
|
|
2561
|
+
yt(() => {
|
|
2557
2562
|
for (let t = 0; t < e.length; t++) Reflect.apply(e[t], null, []);
|
|
2558
2563
|
});
|
|
2559
2564
|
}
|
|
@@ -2562,23 +2567,23 @@ function os(e, t = {}, r, s = -1) {
|
|
|
2562
2567
|
mode: t.mode ?? "default",
|
|
2563
2568
|
persisted: !1,
|
|
2564
2569
|
beforeEnter: (i) => {
|
|
2565
|
-
|
|
2570
|
+
Ve(ti, {}, i);
|
|
2566
2571
|
},
|
|
2567
2572
|
enter: (i) => {
|
|
2568
|
-
|
|
2573
|
+
Ve(ri, {}, i);
|
|
2569
2574
|
},
|
|
2570
2575
|
leave: (i, n) => {
|
|
2571
|
-
|
|
2576
|
+
Ve(si, {}, i), yt(() => {
|
|
2572
2577
|
const o = (l) => {
|
|
2573
2578
|
(l.target || l.srcElement) === l.currentTarget && (Xt(i, Bt, o), n && Reflect.apply(n, null, []), e.transition = null);
|
|
2574
2579
|
};
|
|
2575
|
-
|
|
2580
|
+
ut(i, Bt, o), Ve(ii, {}, i);
|
|
2576
2581
|
});
|
|
2577
2582
|
},
|
|
2578
2583
|
clone: (i) => os(e, t, r, s)
|
|
2579
2584
|
};
|
|
2580
2585
|
}
|
|
2581
|
-
function
|
|
2586
|
+
function re(e, t, r) {
|
|
2582
2587
|
return typeof e == "function" ? Reflect.apply(e, {}, [t, r]) : e;
|
|
2583
2588
|
}
|
|
2584
2589
|
function Lt(e, t) {
|
|
@@ -2586,7 +2591,7 @@ function Lt(e, t) {
|
|
|
2586
2591
|
const r = e(t);
|
|
2587
2592
|
return r.length === 1 ? r[0] : r;
|
|
2588
2593
|
}
|
|
2589
|
-
function
|
|
2594
|
+
function pe(e, t) {
|
|
2590
2595
|
return typeof t == "function" ? t(e) : e;
|
|
2591
2596
|
}
|
|
2592
2597
|
var wi = class {
|
|
@@ -2785,15 +2790,15 @@ var wi = class {
|
|
|
2785
2790
|
}
|
|
2786
2791
|
},
|
|
2787
2792
|
setup(e, t) {
|
|
2788
|
-
const r = Kr(), s = e.multi === !0, i = L(
|
|
2793
|
+
const r = Kr(), s = e.multi === !0, i = L(Ne, null), n = L(jt, 0), o = L(Sr, null), l = L(kt, -1);
|
|
2789
2794
|
let a = null, u = e.modelSlot ?? null;
|
|
2790
2795
|
if (u) {
|
|
2791
2796
|
if (Z(jt, n + 1), Z(kt, u.index), Z(Tt, u.index), !u.route) {
|
|
2792
2797
|
console.warn("[Fox]child view render error, route not exist");
|
|
2793
2798
|
return;
|
|
2794
2799
|
}
|
|
2795
|
-
const c =
|
|
2796
|
-
c && (Qs(c),
|
|
2800
|
+
const c = lt(u, !0);
|
|
2801
|
+
c && (Qs(c), _r(c, () => u?.route ?? null));
|
|
2797
2802
|
} else {
|
|
2798
2803
|
if (i == null) {
|
|
2799
2804
|
console.error("[Fox]router is not been injected");
|
|
@@ -2804,15 +2809,15 @@ var wi = class {
|
|
|
2804
2809
|
Z(xr, a);
|
|
2805
2810
|
const d = a[V] === !0;
|
|
2806
2811
|
if (d && Z(Sr, a), !s && (Z(kt, -1), Z(jt, n + 1), Z(Tt, -1), d && r)) {
|
|
2807
|
-
const
|
|
2808
|
-
|
|
2812
|
+
const m = lt(r, !0);
|
|
2813
|
+
m && _r(m, () => {
|
|
2809
2814
|
const w = a?.slots.value ?? [];
|
|
2810
2815
|
return w.length > 0 ? w[0].route : null;
|
|
2811
2816
|
});
|
|
2812
2817
|
}
|
|
2813
2818
|
}
|
|
2814
2819
|
const f = { value: /* @__PURE__ */ new Map() };
|
|
2815
|
-
return
|
|
2820
|
+
return Ce(() => {
|
|
2816
2821
|
if (f.value && f.value.clear(), u) {
|
|
2817
2822
|
const c = u;
|
|
2818
2823
|
c.route = null, c.model = null, c.instance = null, u = null;
|
|
@@ -2820,55 +2825,55 @@ var wi = class {
|
|
|
2820
2825
|
}), () => {
|
|
2821
2826
|
if (s) {
|
|
2822
2827
|
const c = /* @__PURE__ */ new Map(), h = [], y = a?.slots.value, d = [];
|
|
2823
|
-
for (let
|
|
2824
|
-
const p = y[
|
|
2828
|
+
for (let v = 0; v < y.length; v++) {
|
|
2829
|
+
const p = y[v], $ = `${e.name}_${p.index}`, K = re(e.transition, p.route, v) ?? !0, _e = { modelSlot: p };
|
|
2825
2830
|
let j;
|
|
2826
2831
|
t.slots.default ? j = ue(Wt, _e, { default: t.slots.default }) : j = ue(Wt, _e);
|
|
2827
|
-
const E = {},
|
|
2828
|
-
typeof
|
|
2829
|
-
const Q =
|
|
2832
|
+
const E = {}, ie = re(e.viewClass, p.route, v);
|
|
2833
|
+
typeof ie == "string" && ie.length > 0 && (E[ie] = !0);
|
|
2834
|
+
const Q = re(e.viewActiveClass, p.route, v), k = re(e.viewInactiveClass, p.route, v), z = f.value.get($);
|
|
2830
2835
|
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
2836
|
const ye = z.node;
|
|
2832
2837
|
p.active ? d.unshift(() => {
|
|
2833
2838
|
const mt = () => {
|
|
2834
|
-
const Fe =
|
|
2835
|
-
Fe != null && Pr(Fe,
|
|
2839
|
+
const Fe = lt(p);
|
|
2840
|
+
Fe != null && Pr(Fe, Cr.ACTIVATED);
|
|
2836
2841
|
};
|
|
2837
|
-
|
|
2842
|
+
vi(ye, e, p.route, v, K, mt);
|
|
2838
2843
|
}) : d.push(() => {
|
|
2839
2844
|
const mt = () => {
|
|
2840
|
-
const Fe =
|
|
2841
|
-
Fe != null && Pr(Fe,
|
|
2845
|
+
const Fe = lt(p);
|
|
2846
|
+
Fe != null && Pr(Fe, Cr.INACTIVATED);
|
|
2842
2847
|
};
|
|
2843
|
-
pi(ye, e, p.route,
|
|
2848
|
+
pi(ye, e, p.route, v, K, mt);
|
|
2844
2849
|
});
|
|
2845
2850
|
}
|
|
2846
2851
|
const D = {
|
|
2847
2852
|
class: E,
|
|
2848
2853
|
key: $
|
|
2849
|
-
}, N =
|
|
2854
|
+
}, N = re(e.viewTagProps, p.route, v);
|
|
2850
2855
|
if (N !== null && typeof N == "object") {
|
|
2851
|
-
const ye =
|
|
2856
|
+
const ye = pe(N, i?.propsFilter);
|
|
2852
2857
|
q(!0, D, ye);
|
|
2853
2858
|
}
|
|
2854
2859
|
if (p.route?.viewTagAttrs && typeof p.route?.viewTagAttrs == "object") {
|
|
2855
|
-
const ye =
|
|
2860
|
+
const ye = pe(p.route.viewTagAttrs, i?.propsFilter);
|
|
2856
2861
|
q(!0, D, ye);
|
|
2857
2862
|
}
|
|
2858
|
-
const as =
|
|
2859
|
-
c.set($, new wi(he, p.active)), f.value.delete($), K === !0 ? he.transition = Vt(he, e, p.route,
|
|
2863
|
+
const as = re(e.viewTag, p.route, v), he = ue(as, D, { default: () => [j] });
|
|
2864
|
+
c.set($, new wi(he, p.active)), f.value.delete($), K === !0 ? he.transition = Vt(he, e, p.route, v) : K === "custom" && (he.transition = os(he, e, p.route, v)), h.push(he);
|
|
2860
2865
|
}
|
|
2861
2866
|
f.value = c, gi(d);
|
|
2862
|
-
const
|
|
2863
|
-
return Object.assign(w, t.attrs), ue(
|
|
2867
|
+
const m = re(e.tag, null, -1), w = {};
|
|
2868
|
+
return Object.assign(w, t.attrs), ue(m, w, { default: () => h });
|
|
2864
2869
|
} else if (u != null) {
|
|
2865
2870
|
const c = u.model, h = {};
|
|
2866
2871
|
if (c.props) {
|
|
2867
2872
|
if (typeof c.props == "object") {
|
|
2868
|
-
const d =
|
|
2873
|
+
const d = pe(c.props, i?.propsFilter);
|
|
2869
2874
|
q(!1, h, d);
|
|
2870
2875
|
} else if (c.props === !0 && typeof u.route?.params == "object") {
|
|
2871
|
-
const d =
|
|
2876
|
+
const d = pe(u.route.params, i?.propsFilter);
|
|
2872
2877
|
q(!1, h, d);
|
|
2873
2878
|
}
|
|
2874
2879
|
}
|
|
@@ -2880,18 +2885,18 @@ var wi = class {
|
|
|
2880
2885
|
} else {
|
|
2881
2886
|
const c = a?.slots.value ?? [];
|
|
2882
2887
|
if (c.length > 0) {
|
|
2883
|
-
const h = c[0], y = h.route, d = h.model,
|
|
2888
|
+
const h = c[0], y = h.route, d = h.model, m = {};
|
|
2884
2889
|
if (d.props) {
|
|
2885
2890
|
if (typeof d.props == "object") {
|
|
2886
|
-
const
|
|
2887
|
-
q(!1,
|
|
2891
|
+
const v = pe(d.props, i?.propsFilter);
|
|
2892
|
+
q(!1, m, v);
|
|
2888
2893
|
} else if (d.props === !0 && typeof y?.params == "object") {
|
|
2889
|
-
const
|
|
2890
|
-
q(!1,
|
|
2894
|
+
const v = pe(y.params, i?.propsFilter);
|
|
2895
|
+
q(!1, m, v);
|
|
2891
2896
|
}
|
|
2892
2897
|
}
|
|
2893
|
-
const w = ue(d.component,
|
|
2894
|
-
return (
|
|
2898
|
+
const w = ue(d.component, m);
|
|
2899
|
+
return (re(e.transition, y, -1) ?? !0) && (w.transition = Vt(w, e, y, -1)), Lt(t.slots.default, {
|
|
2895
2900
|
Component: w,
|
|
2896
2901
|
route: y
|
|
2897
2902
|
}) ?? w;
|
|
@@ -2912,7 +2917,7 @@ function bi(e) {
|
|
|
2912
2917
|
function Ri(e, t) {
|
|
2913
2918
|
return e == null || t == null ? !1 : !!(e.path && t.path && t.path.startsWith(e.path) || e.name && e.name == t.name);
|
|
2914
2919
|
}
|
|
2915
|
-
function
|
|
2920
|
+
function ge(e, t) {
|
|
2916
2921
|
return typeof e == "function" ? Reflect.apply(e, {}, [t]) : e;
|
|
2917
2922
|
}
|
|
2918
2923
|
var Si = $r({
|
|
@@ -2962,23 +2967,23 @@ var Si = $r({
|
|
|
2962
2967
|
}
|
|
2963
2968
|
},
|
|
2964
2969
|
setup(e, t) {
|
|
2965
|
-
const r = L(
|
|
2970
|
+
const r = L(Ne, null);
|
|
2966
2971
|
return () => {
|
|
2967
|
-
let s =
|
|
2972
|
+
let s = ge(e.to, null), i = ge(e.tag, s);
|
|
2968
2973
|
if (i == null) {
|
|
2969
2974
|
console.warn("[Fox]can not resolve link tag");
|
|
2970
2975
|
return;
|
|
2971
2976
|
}
|
|
2972
2977
|
let n = null, o = null;
|
|
2973
2978
|
r !== null && (n = r[M](s), e.root && (n.root = e.root), o = r.currentRoute.value);
|
|
2974
|
-
let l = {}, a =
|
|
2975
|
-
if (typeof a == "string" && a.length > 0 && (l[a] = Ri(n, o)),
|
|
2976
|
-
let c =
|
|
2977
|
-
typeof c == "string" && c.length > 0 && (l[c] =
|
|
2979
|
+
let l = {}, a = ge(e.activeClass, n);
|
|
2980
|
+
if (typeof a == "string" && a.length > 0 && (l[a] = Ri(n, o)), ge(e.exact, n) === !0) {
|
|
2981
|
+
let c = ge(e.exactActiveClass, n);
|
|
2982
|
+
typeof c == "string" && c.length > 0 && (l[c] = x.isSamePathForRoute(n, o));
|
|
2978
2983
|
}
|
|
2979
2984
|
let u = { class: l };
|
|
2980
2985
|
(i === "a" || i === "A") && (u.href = n?.path ?? n?.name ?? "#"), q(!0, u, t.attrs);
|
|
2981
|
-
const f =
|
|
2986
|
+
const f = ge(e.event, n);
|
|
2982
2987
|
if (typeof f == "string") {
|
|
2983
2988
|
const c = (h) => {
|
|
2984
2989
|
if (r == null) {
|
|
@@ -2996,26 +3001,26 @@ var Si = $r({
|
|
|
2996
3001
|
return ue(i, u, t.slots);
|
|
2997
3002
|
};
|
|
2998
3003
|
}
|
|
2999
|
-
}),
|
|
3004
|
+
}), we = /* @__PURE__ */ Symbol("registerKey"), xi = class {
|
|
3000
3005
|
policy;
|
|
3001
3006
|
callback;
|
|
3002
3007
|
constructor(e, t) {
|
|
3003
3008
|
this.callback = e, this.policy = t;
|
|
3004
3009
|
}
|
|
3005
3010
|
}, Er = class {
|
|
3006
|
-
[
|
|
3011
|
+
[we] = /* @__PURE__ */ new Map();
|
|
3007
3012
|
constructor() {
|
|
3008
3013
|
}
|
|
3009
3014
|
on(e, t, r = !1) {
|
|
3010
|
-
let s = this[
|
|
3011
|
-
s || (s = new Array(), this[
|
|
3015
|
+
let s = this[we].get(e);
|
|
3016
|
+
s || (s = new Array(), this[we].set(e, s));
|
|
3012
3017
|
let i = new xi(t, r === !0 ? 1 : 0);
|
|
3013
3018
|
return s.push(i), this;
|
|
3014
3019
|
}
|
|
3015
3020
|
off(e, t) {
|
|
3016
3021
|
if (!t)
|
|
3017
|
-
return this[
|
|
3018
|
-
let r = this[
|
|
3022
|
+
return this[we].delete(e), this;
|
|
3023
|
+
let r = this[we].get(e);
|
|
3019
3024
|
if (r) {
|
|
3020
3025
|
for (let s = 0; s < r.length; s++) if (r[s].callback === t) {
|
|
3021
3026
|
r.splice(s, 1);
|
|
@@ -3046,12 +3051,12 @@ var Si = $r({
|
|
|
3046
3051
|
return this;
|
|
3047
3052
|
}
|
|
3048
3053
|
emit(e, ...t) {
|
|
3049
|
-
let r = this[
|
|
3054
|
+
let r = this[we].get(e);
|
|
3050
3055
|
if (!r) return this;
|
|
3051
3056
|
for (let s = 0; s < r.length; ) {
|
|
3052
3057
|
let i = r[s];
|
|
3053
3058
|
if (i.policy == 1 ? r.splice(s, 1) : s++, typeof i.callback == "function") try {
|
|
3054
|
-
|
|
3059
|
+
Oe(() => {
|
|
3055
3060
|
Reflect.apply(i.callback, {}, t);
|
|
3056
3061
|
});
|
|
3057
3062
|
} catch (n) {
|
|
@@ -3063,15 +3068,15 @@ var Si = $r({
|
|
|
3063
3068
|
trigger(e, ...t) {
|
|
3064
3069
|
return Reflect.apply(this.emit, this, [e, ...t]);
|
|
3065
3070
|
}
|
|
3066
|
-
}, Pi = "FoxRouterView",
|
|
3071
|
+
}, Pi = "FoxRouterView", Ci = "FoxRouterLink", X = /* @__PURE__ */ (function(e) {
|
|
3067
3072
|
return e[e.Loading = 0] = "Loading", e[e.Loaded = 1] = "Loaded", e[e.Defining = 2] = "Defining", e[e.Defined = 3] = "Defined", e;
|
|
3068
3073
|
})({});
|
|
3069
|
-
function
|
|
3074
|
+
function _i(e) {
|
|
3070
3075
|
return e == 1 || e === 3;
|
|
3071
3076
|
}
|
|
3072
3077
|
var Ar = /* @__PURE__ */ (function(e) {
|
|
3073
3078
|
return e[e.normal = 0] = "normal", e[e.factory = 1] = "factory", e;
|
|
3074
|
-
})({}),
|
|
3079
|
+
})({}), Fi = class {
|
|
3075
3080
|
register = /* @__PURE__ */ new Map();
|
|
3076
3081
|
regExpRegisters = [];
|
|
3077
3082
|
constructor() {
|
|
@@ -3118,7 +3123,7 @@ async function Ei(e) {
|
|
|
3118
3123
|
return await new Function("url", "return import(url)")(e);
|
|
3119
3124
|
}
|
|
3120
3125
|
var qr = class {
|
|
3121
|
-
moduleManager = new
|
|
3126
|
+
moduleManager = new Fi();
|
|
3122
3127
|
_alias = {};
|
|
3123
3128
|
set alias(e) {
|
|
3124
3129
|
this._alias = e;
|
|
@@ -3148,7 +3153,7 @@ var qr = class {
|
|
|
3148
3153
|
return this._query;
|
|
3149
3154
|
}
|
|
3150
3155
|
get head() {
|
|
3151
|
-
return
|
|
3156
|
+
return Be().head;
|
|
3152
3157
|
}
|
|
3153
3158
|
_cssMountPoint = null;
|
|
3154
3159
|
set cssMountPoint(e) {
|
|
@@ -3177,10 +3182,10 @@ var qr = class {
|
|
|
3177
3182
|
}
|
|
3178
3183
|
getModuleExports(e) {
|
|
3179
3184
|
const t = this.moduleManager.get(e);
|
|
3180
|
-
return t &&
|
|
3185
|
+
return t && _i(t.status) ? t.type === Ar.factory && typeof t.exports == "function" ? t.exports() : t.exports : null;
|
|
3181
3186
|
}
|
|
3182
3187
|
exposeRequire(e = "__foxRequire", t, r) {
|
|
3183
|
-
const s = t ??
|
|
3188
|
+
const s = t ?? C();
|
|
3184
3189
|
return s && typeof s == "object" ? (s[e] = (i) => {
|
|
3185
3190
|
const n = this.getModuleExports(i);
|
|
3186
3191
|
return r && !n && console.error(`[Fox] module:${i}, not found!`), n;
|
|
@@ -3241,7 +3246,7 @@ var qr = class {
|
|
|
3241
3246
|
} catch (f) {
|
|
3242
3247
|
console.error(f), r(f);
|
|
3243
3248
|
}
|
|
3244
|
-
}), l = new
|
|
3249
|
+
}), l = new ft();
|
|
3245
3250
|
for (let a = 0; a < s.length; a++) {
|
|
3246
3251
|
const u = new qi(a, s[a], o);
|
|
3247
3252
|
this.mount(l, u);
|
|
@@ -3317,7 +3322,7 @@ var qr = class {
|
|
|
3317
3322
|
t.progress.work(!0, t.index, n), s.resolve();
|
|
3318
3323
|
return;
|
|
3319
3324
|
}
|
|
3320
|
-
const o =
|
|
3325
|
+
const o = Be(), l = o.createElement("link"), a = "onload" in l;
|
|
3321
3326
|
a && (l.onload = () => {
|
|
3322
3327
|
l.onload = null, l.onerror = null, t.progress.work(!0, t.index, i.path), s.resolve();
|
|
3323
3328
|
}, l.onerror = () => {
|
|
@@ -3345,7 +3350,7 @@ var qr = class {
|
|
|
3345
3350
|
status: X.Loading
|
|
3346
3351
|
};
|
|
3347
3352
|
this.moduleManager.set(i.path, o);
|
|
3348
|
-
const l =
|
|
3353
|
+
const l = Be().createElement("script");
|
|
3349
3354
|
if ("onload" in l)
|
|
3350
3355
|
l.onload = () => {
|
|
3351
3356
|
l.onload = null, l.onerror = null, o.status === X.Loading && (o.status = X.Loaded, t.progress.work(!0, t.index, i.path)), s.resolve();
|
|
@@ -3365,7 +3370,7 @@ var qr = class {
|
|
|
3365
3370
|
}
|
|
3366
3371
|
const a = this.constructResourceUri(i.path);
|
|
3367
3372
|
l.defer = !0, l.src = a;
|
|
3368
|
-
const u =
|
|
3373
|
+
const u = C(), f = this.createRequireLoad();
|
|
3369
3374
|
u.__require = u.__require ?? u.require, u.require = f;
|
|
3370
3375
|
const c = this.createDefine(o, f, t);
|
|
3371
3376
|
u.__define = u.__define ?? u.define, u.define = c, typeof t.progress.finalCallback != "function" && (t.progress.finalCallback = function() {
|
|
@@ -3382,7 +3387,7 @@ var qr = class {
|
|
|
3382
3387
|
}
|
|
3383
3388
|
try {
|
|
3384
3389
|
let n = await Ei(s.path);
|
|
3385
|
-
if (Zt(n) && (n = n.default ?? n),
|
|
3390
|
+
if (Zt(n) && (n = n.default ?? n), Ue(n)) {
|
|
3386
3391
|
t.progress.work(!1, t.index, n), r.resolve();
|
|
3387
3392
|
return;
|
|
3388
3393
|
}
|
|
@@ -3401,7 +3406,7 @@ var qr = class {
|
|
|
3401
3406
|
unmount(e) {
|
|
3402
3407
|
let t = "", r = "";
|
|
3403
3408
|
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);
|
|
3404
|
-
const s =
|
|
3409
|
+
const s = Be();
|
|
3405
3410
|
if (r === "umd") {
|
|
3406
3411
|
let i = s.getElementById(t);
|
|
3407
3412
|
i || (i = s.querySelector(`script[src="${t}"]`)), i && i.remove();
|
|
@@ -3525,7 +3530,7 @@ function Xi(e = {}) {
|
|
|
3525
3530
|
return s;
|
|
3526
3531
|
},
|
|
3527
3532
|
get EventChain() {
|
|
3528
|
-
return
|
|
3533
|
+
return ft;
|
|
3529
3534
|
},
|
|
3530
3535
|
get Require() {
|
|
3531
3536
|
return qr;
|
|
@@ -3537,7 +3542,7 @@ function Xi(e = {}) {
|
|
|
3537
3542
|
return Zt;
|
|
3538
3543
|
},
|
|
3539
3544
|
install(o, l = {}) {
|
|
3540
|
-
o.provide(
|
|
3545
|
+
o.provide(Ne, t), o.provide(zt, n), o.provide(Jt, r), o.provide(Gt, s), l.install !== !1 && (o.component(Pi, Wt), o.component(Ci, Si)), l.optionsApi !== !1 && (Reflect.defineProperty(o.config.globalProperties, "$fox", { get() {
|
|
3541
3546
|
return n;
|
|
3542
3547
|
} }), Reflect.defineProperty(o.config.globalProperties, "$router", { get() {
|
|
3543
3548
|
return t;
|
|
@@ -3570,25 +3575,25 @@ function Xi(e = {}) {
|
|
|
3570
3575
|
return n;
|
|
3571
3576
|
}
|
|
3572
3577
|
function ls(e) {
|
|
3573
|
-
return
|
|
3578
|
+
return Pe() ? L(Ne, null) : e ? e.$?.appContext?.provides?.[Ne] ?? null : null;
|
|
3574
3579
|
}
|
|
3575
3580
|
function $i(e) {
|
|
3576
|
-
let t =
|
|
3577
|
-
if (!t && e && !
|
|
3581
|
+
let t = Fr(e);
|
|
3582
|
+
if (!t && e && !Pe()) {
|
|
3578
3583
|
let r = e;
|
|
3579
|
-
for (r = r.$parent; r && (t =
|
|
3584
|
+
for (r = r.$parent; r && (t = Fr(r), !t); )
|
|
3580
3585
|
r = r.$parent;
|
|
3581
3586
|
}
|
|
3582
3587
|
return t;
|
|
3583
3588
|
}
|
|
3584
3589
|
function Qi(e) {
|
|
3585
|
-
return
|
|
3590
|
+
return Pe() ? L(zt, null) : e ? e.$?.appContext?.provides?.[zt] ?? null : null;
|
|
3586
3591
|
}
|
|
3587
3592
|
function Zi(e) {
|
|
3588
|
-
return
|
|
3593
|
+
return Pe() ? L(Jt, null) : e ? e.$?.appContext?.provides?.[Jt] ?? null : null;
|
|
3589
3594
|
}
|
|
3590
3595
|
function Yi(e) {
|
|
3591
|
-
return
|
|
3596
|
+
return Pe() ? L(Gt, null) : e ? e.$?.appContext?.provides?.[Gt] ?? null : null;
|
|
3592
3597
|
}
|
|
3593
3598
|
function en(e) {
|
|
3594
3599
|
const t = ls();
|
|
@@ -3604,7 +3609,7 @@ function en(e) {
|
|
|
3604
3609
|
}
|
|
3605
3610
|
n();
|
|
3606
3611
|
};
|
|
3607
|
-
t?.beforeEach(r),
|
|
3612
|
+
t?.beforeEach(r), Ce(() => {
|
|
3608
3613
|
t?.removeBeforeEach(r);
|
|
3609
3614
|
});
|
|
3610
3615
|
}
|
|
@@ -3622,13 +3627,13 @@ function tn(e) {
|
|
|
3622
3627
|
}
|
|
3623
3628
|
n();
|
|
3624
3629
|
};
|
|
3625
|
-
t?.afterEach(r),
|
|
3630
|
+
t?.afterEach(r), Ce(() => {
|
|
3626
3631
|
t?.removeAfterEach(r);
|
|
3627
3632
|
});
|
|
3628
3633
|
}
|
|
3629
3634
|
export {
|
|
3630
3635
|
ar as Bus,
|
|
3631
|
-
|
|
3636
|
+
ft as EventChain,
|
|
3632
3637
|
Er as EventProxy,
|
|
3633
3638
|
ti as FoxBeforeEnter,
|
|
3634
3639
|
si as FoxBeforeLeave,
|
|
@@ -3636,7 +3641,7 @@ export {
|
|
|
3636
3641
|
ii as FoxLeave,
|
|
3637
3642
|
Bt as FoxLeaveEnd,
|
|
3638
3643
|
_ as OperationType,
|
|
3639
|
-
|
|
3644
|
+
x as Route,
|
|
3640
3645
|
Js as Router,
|
|
3641
3646
|
Si as RouterLink,
|
|
3642
3647
|
Wt as RouterView,
|
|
@@ -3649,14 +3654,14 @@ export {
|
|
|
3649
3654
|
Ui as destroyState,
|
|
3650
3655
|
q as extend,
|
|
3651
3656
|
zr as injectContextValue,
|
|
3652
|
-
|
|
3657
|
+
ht as injectLifecycleContext,
|
|
3653
3658
|
sr as isArray,
|
|
3654
3659
|
Ti as isDate,
|
|
3655
3660
|
Zt as isESModule,
|
|
3656
3661
|
nr as isEqual,
|
|
3657
3662
|
b as isFunction,
|
|
3658
3663
|
ji as isMap,
|
|
3659
|
-
|
|
3664
|
+
Ue as isNil,
|
|
3660
3665
|
ps as isObject,
|
|
3661
3666
|
ws as isPlainObject,
|
|
3662
3667
|
Ii as isPromise,
|