@fox-js/fox 3.1.3 → 3.1.5
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.js +345 -342
- 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
|
|
2
|
-
var Re = typeof window < "u",
|
|
1
|
+
import { defineComponent as $r, effectScope as us, getCurrentScope as Kr, h as ae, hasInjectionContext as xe, inject as L, onActivated as fs, onDeactivated as cs, onScopeDispose as Pe, provide as Z, reactive as hs, readonly as ys, ref as ds, shallowReactive as vs, shallowRef as jr, toRaw as Ot, watch as ms } from "vue";
|
|
2
|
+
var Re = typeof window < "u", _ = 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
|
+
}, mt = Rs ? Promise.resolve() : null;
|
|
66
|
+
function Oe(e, ...t) {
|
|
67
|
+
mt !== null ? t && t.length > 0 ? mt.then(() => {
|
|
68
68
|
e(t);
|
|
69
|
-
}) :
|
|
69
|
+
}) : mt.then(e) : t && t.length > 0 ? setTimeout(() => {
|
|
70
70
|
e(t);
|
|
71
71
|
}) : setTimeout(e);
|
|
72
72
|
}
|
|
@@ -141,35 +141,35 @@ function Ir(e, t) {
|
|
|
141
141
|
}, t);
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
-
var or = /* @__PURE__ */ Symbol("idKey"),
|
|
144
|
+
var or = /* @__PURE__ */ Symbol("idKey"), fe = /* @__PURE__ */ Symbol("valueKey"), R = /* @__PURE__ */ Symbol("childrenKey"), W = /* @__PURE__ */ Symbol("growKey"), Or = class {
|
|
145
145
|
[W] = !0;
|
|
146
146
|
[or];
|
|
147
|
-
[
|
|
148
|
-
[
|
|
147
|
+
[fe] = ds();
|
|
148
|
+
[R] = /* @__PURE__ */ new Map();
|
|
149
149
|
constructor(e) {
|
|
150
150
|
this[or] = e;
|
|
151
151
|
}
|
|
152
152
|
}, Ps = class {
|
|
153
153
|
get(e, t) {
|
|
154
|
-
if (t == "value") return e[
|
|
154
|
+
if (t == "value") return e[fe].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[
|
|
162
|
+
return t == "value" ? (e[fe].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
175
|
var _s = class {
|
|
@@ -179,7 +179,7 @@ var _s = class {
|
|
|
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) {
|
|
@@ -190,7 +190,7 @@ var _s = class {
|
|
|
190
190
|
let e = null;
|
|
191
191
|
if (this.persistPolicy === "custom") e = this.storage;
|
|
192
192
|
else if (Re) {
|
|
193
|
-
const t =
|
|
193
|
+
const t = _();
|
|
194
194
|
e = this.persistPolicy === "session" ? t.sessionStorage : t.localStorage;
|
|
195
195
|
}
|
|
196
196
|
return e;
|
|
@@ -263,9 +263,9 @@ 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
|
-
return r[
|
|
268
|
+
return r[fe].value = e[t - 1], this._persistHandler.put(e), !0;
|
|
269
269
|
}
|
|
270
270
|
get(...e) {
|
|
271
271
|
let t = e.length;
|
|
@@ -273,10 +273,10 @@ 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
|
-
return r[
|
|
279
|
+
return r[fe].value;
|
|
280
280
|
}
|
|
281
281
|
remove(...e) {
|
|
282
282
|
let t = e.length;
|
|
@@ -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,14 +296,14 @@ 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
|
}, Fs = [
|
|
309
309
|
"put",
|
|
@@ -318,21 +318,21 @@ function lr(e) {
|
|
|
318
318
|
}
|
|
319
319
|
var Cs = class {
|
|
320
320
|
get(e, t) {
|
|
321
|
-
if (t == "value") return e[
|
|
321
|
+
if (t == "value") return e[fe].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[
|
|
332
|
+
return t == "value" ? (e[fe].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) {
|
|
@@ -341,13 +341,13 @@ function Es(e, t) {
|
|
|
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() {
|
|
@@ -355,7 +355,7 @@ var ar = new Proxy(Hr, { construct(e, t) {
|
|
|
355
355
|
let e = null;
|
|
356
356
|
if (this.persistPolicy === "custom") e = this.storage;
|
|
357
357
|
else if (Re) {
|
|
358
|
-
const t =
|
|
358
|
+
const t = _();
|
|
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
|
};
|
|
@@ -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,9 +527,9 @@ 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 ===
|
|
532
|
+
else if (h.type === We.Param) {
|
|
533
533
|
const { value: d, repeatable: v, optional: w, regexp: m } = h;
|
|
534
534
|
n.push({
|
|
535
535
|
name: d,
|
|
@@ -571,8 +571,8 @@ 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 ===
|
|
574
|
+
for (const y of h) if (y.type === We.Static) f += y.value;
|
|
575
|
+
else if (y.type === We.Param) {
|
|
576
576
|
const { value: d, repeatable: v, optional: w } = y, m = d in u ? u[d] : "";
|
|
577
577
|
if (sr(m) && !v) throw new Error(`Provided param "${d}" is an array but it is not repeatable (* or + modifiers)`);
|
|
578
578
|
const p = sr(m) ? m.join("/") : m;
|
|
@@ -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;
|
|
@@ -725,11 +725,11 @@ var Is = class {
|
|
|
725
725
|
meta;
|
|
726
726
|
matchedRoutes;
|
|
727
727
|
layers = [];
|
|
728
|
-
},
|
|
728
|
+
}, F = /* @__PURE__ */ (function(e) {
|
|
729
729
|
return e[e.Push = 0] = "Push", e[e.Replace = 1] = "Replace", e[e.Put = 2] = "Put", e[e.Append = 3] = "Append", e[e.Open = 4] = "Open", e;
|
|
730
|
-
})({}),
|
|
730
|
+
})({}), gt = /* @__PURE__ */ (function(e) {
|
|
731
731
|
return e[e.Part = 0] = "Part", e[e.All = 1] = "All", e;
|
|
732
|
-
})({}), V = /* @__PURE__ */ Symbol("rootKey"), B = /* @__PURE__ */ Symbol("rootNodeKey"),
|
|
732
|
+
})({}), V = /* @__PURE__ */ Symbol("rootKey"), B = /* @__PURE__ */ Symbol("rootNodeKey"), ue = /* @__PURE__ */ Symbol("parentNodeKey"), at = /* @__PURE__ */ Symbol("nameKey"), Y = class {
|
|
733
733
|
model;
|
|
734
734
|
route;
|
|
735
735
|
active = !0;
|
|
@@ -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
|
+
[ue] = 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 = [];
|
|
@@ -793,29 +793,29 @@ var Is = class {
|
|
|
793
793
|
release(e) {
|
|
794
794
|
this.submitRecorder.time === e && (this.submitRecorder.route = void 0);
|
|
795
795
|
}
|
|
796
|
-
}, O = /* @__PURE__ */ Symbol("chainKey"), T = /* @__PURE__ */ Symbol("cursorKey"),
|
|
796
|
+
}, O = /* @__PURE__ */ Symbol("chainKey"), T = /* @__PURE__ */ Symbol("cursorKey"), bt = /* @__PURE__ */ Symbol("$persistentModeKey"), P = /* @__PURE__ */ Symbol("statusKey"), J = /* @__PURE__ */ Symbol("argsKey"), Je = /* @__PURE__ */ Symbol("exArgsKey"), ye = /* @__PURE__ */ Symbol("successFnsKey"), Ee = /* @__PURE__ */ Symbol("errorFnsKey"), ie = /* @__PURE__ */ Symbol("sessionKey"), G = /* @__PURE__ */ Symbol("_go"), ft = class {
|
|
797
797
|
[O] = [];
|
|
798
798
|
[T] = 0;
|
|
799
|
-
[
|
|
799
|
+
[bt] = !1;
|
|
800
800
|
[P] = "Free";
|
|
801
801
|
[J] = [];
|
|
802
|
-
[
|
|
803
|
-
[
|
|
802
|
+
[Je] = [];
|
|
803
|
+
[ye] = [];
|
|
804
804
|
[Ee] = [];
|
|
805
805
|
[ie];
|
|
806
806
|
get session() {
|
|
807
807
|
return this[ie];
|
|
808
808
|
}
|
|
809
809
|
constructor(e, t = !1) {
|
|
810
|
-
this[ie] = e, this[
|
|
810
|
+
this[ie] = e, this[bt] = t;
|
|
811
811
|
}
|
|
812
812
|
[G](e, ...t) {
|
|
813
813
|
let r = this[P];
|
|
814
814
|
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[ie] }, ...this[
|
|
815
|
+
let n = [{ session: this[ie] }, ...this[Je]];
|
|
816
816
|
for (; this[Ee].length > 0; ) try {
|
|
817
817
|
let o = this[Ee].shift();
|
|
818
|
-
typeof o == "function" &&
|
|
818
|
+
typeof o == "function" && Oe(() => {
|
|
819
819
|
Reflect.apply(o, {}, n);
|
|
820
820
|
});
|
|
821
821
|
} catch (o) {
|
|
@@ -824,9 +824,9 @@ var Is = class {
|
|
|
824
824
|
return this[P] = r, this[O] = [], this[T] = 0, this;
|
|
825
825
|
} else if (r === "Finished" || this[T] >= this[O].length) {
|
|
826
826
|
let n = [{ session: this[ie] }, ...this[J]];
|
|
827
|
-
for (; this[
|
|
828
|
-
let o = this[
|
|
829
|
-
typeof o == "function" &&
|
|
827
|
+
for (; this[ye].length > 0; ) {
|
|
828
|
+
let o = this[ye].shift();
|
|
829
|
+
typeof o == "function" && Oe(() => {
|
|
830
830
|
Reflect.apply(o, {}, n);
|
|
831
831
|
});
|
|
832
832
|
}
|
|
@@ -835,7 +835,7 @@ var Is = class {
|
|
|
835
835
|
if (this[T] >= this[O].length)
|
|
836
836
|
return this[P] = "Free", this;
|
|
837
837
|
let s = this[O][this[T]];
|
|
838
|
-
this[
|
|
838
|
+
this[bt] || (this[O].splice(0, this[T] + 1), this[T] = -1);
|
|
839
839
|
let i = this[T] + 1;
|
|
840
840
|
try {
|
|
841
841
|
let n = !1, o = {
|
|
@@ -853,7 +853,7 @@ var Is = class {
|
|
|
853
853
|
},
|
|
854
854
|
session: this[ie]
|
|
855
855
|
};
|
|
856
|
-
|
|
856
|
+
Oe(() => {
|
|
857
857
|
Reflect.apply(s, {}, [o, ...this[J]]);
|
|
858
858
|
});
|
|
859
859
|
} catch (n) {
|
|
@@ -868,17 +868,17 @@ var Is = class {
|
|
|
868
868
|
return this[P] = "Finished", this[J] = e, Reflect.apply(this[G], this, [0]);
|
|
869
869
|
}
|
|
870
870
|
reject(...e) {
|
|
871
|
-
return this[P] = "Reject", this[
|
|
871
|
+
return this[P] = "Reject", this[Je] = e, Reflect.apply(this[G], this, [0]);
|
|
872
872
|
}
|
|
873
873
|
throw(...e) {
|
|
874
|
-
return this[P] = "Exception", this[
|
|
874
|
+
return this[P] = "Exception", this[Je] = e, Reflect.apply(this[G], this, [0]);
|
|
875
875
|
}
|
|
876
876
|
reset(...e) {
|
|
877
877
|
this[P] = "Busy", this[J] = e, this[O] = [], this[T] = 0;
|
|
878
878
|
let t = [{ session: this[ie] }, ...this[J]];
|
|
879
|
-
for (; this[
|
|
880
|
-
let r = this[
|
|
881
|
-
|
|
879
|
+
for (; this[ye].length > 0; ) {
|
|
880
|
+
let r = this[ye].shift();
|
|
881
|
+
Oe(() => {
|
|
882
882
|
Reflect.apply(r, this, t);
|
|
883
883
|
});
|
|
884
884
|
}
|
|
@@ -888,7 +888,7 @@ var Is = class {
|
|
|
888
888
|
return this[P] === "Reject" || this[P] === "Exception" ? this : (Array.isArray(e) ? this[O] = [...this[O], ...e] : this[O].push(e), this[P] === "Busy" ? this : (Reflect.apply(this[G], this, [0, ...this[J]]), this));
|
|
889
889
|
}
|
|
890
890
|
wait(e, t) {
|
|
891
|
-
return e && typeof e == "function" && this[
|
|
891
|
+
return e && typeof e == "function" && this[ye].push(e), t && typeof t == "function" && this[Ee].push(t), this[P] === "Busy" ? this : (Reflect.apply(this[G], this, [0, ...this[J]]), this);
|
|
892
892
|
}
|
|
893
893
|
exception(e) {
|
|
894
894
|
return e && typeof e == "function" && this[Ee].push(e), this[P] === "Busy" ? this : Reflect.apply(this[G], this, [0, ...this[J]]);
|
|
@@ -896,14 +896,14 @@ var Is = class {
|
|
|
896
896
|
isFinish() {
|
|
897
897
|
return this[P] == "Reject" || this[P] == "Free" && this[T] >= this[O].length;
|
|
898
898
|
}
|
|
899
|
-
}, we = /* @__PURE__ */ Symbol("_notifyChange"),
|
|
899
|
+
}, we = /* @__PURE__ */ Symbol("_notifyChange"), Rt = class {
|
|
900
900
|
currentRoute;
|
|
901
901
|
routes;
|
|
902
902
|
constructor(e, t) {
|
|
903
903
|
this.currentRoute = e, this.routes = t;
|
|
904
904
|
}
|
|
905
|
-
}, ne = /* @__PURE__ */ Symbol("historyChangeConsumerKey"), hr = /* @__PURE__ */ Symbol("_navigateFirstRoute"),
|
|
906
|
-
function
|
|
905
|
+
}, ne = /* @__PURE__ */ Symbol("historyChangeConsumerKey"), hr = /* @__PURE__ */ Symbol("_navigateFirstRoute"), Ge = /* @__PURE__ */ Symbol("_getRouteMark"), St = /* @__PURE__ */ Symbol("_getUrlSearch"), xt = /* @__PURE__ */ Symbol("_generateLocation"), Xe = /* @__PURE__ */ Symbol("_setRouteMarkRecorder"), Ae = /* @__PURE__ */ Symbol("beforeRestoreFiltersKey"), yr = /* @__PURE__ */ Symbol("_beforeRestore"), dr = "Symbol(_fox_restore_point)";
|
|
906
|
+
function Qe(e, ...t) {
|
|
907
907
|
return typeof e == "function" ? Reflect.apply(e, null, [...t]) : e;
|
|
908
908
|
}
|
|
909
909
|
function vr(e) {
|
|
@@ -926,10 +926,10 @@ var Wr = class {
|
|
|
926
926
|
[Ae] = new Array();
|
|
927
927
|
backTimeout = 320;
|
|
928
928
|
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 ??
|
|
929
|
+
this.mode = e, this.base = t, this.query = r, this.firstNavigate = s, this.historyMonitor = i, this.traceless = n, this.storage = o ?? _().sessionStorage, this.backTimeout = l ?? 320;
|
|
930
930
|
}
|
|
931
931
|
init(e = !0) {
|
|
932
|
-
const t =
|
|
932
|
+
const t = _();
|
|
933
933
|
return typeof this.historyChange != "function" && (this.historyChange = () => {
|
|
934
934
|
if (typeof this[ne] == "function") {
|
|
935
935
|
const r = this[ne]();
|
|
@@ -938,23 +938,23 @@ var Wr = class {
|
|
|
938
938
|
this[ne] = !1;
|
|
939
939
|
return;
|
|
940
940
|
}
|
|
941
|
-
if (
|
|
941
|
+
if (Qe(this.historyMonitor)) {
|
|
942
942
|
const r = t.history.state;
|
|
943
943
|
this[we](r);
|
|
944
944
|
try {
|
|
945
945
|
let s = [];
|
|
946
946
|
if (typeof r == "string" ? s = JSON.parse(r) : s = r, Array.isArray(s) && s.length > 0) {
|
|
947
|
-
const i = this[
|
|
948
|
-
this[
|
|
947
|
+
const i = this[Ge]() ?? "/";
|
|
948
|
+
this[Xe](i, s);
|
|
949
949
|
}
|
|
950
950
|
} catch {
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
|
-
}),
|
|
953
|
+
}), ut(t, "popstate", this.historyChange), this.firstNavigate && e && this[hr](), Promise.resolve();
|
|
954
954
|
}
|
|
955
955
|
destroy() {
|
|
956
956
|
if (this.historyChange) {
|
|
957
|
-
const e =
|
|
957
|
+
const e = _();
|
|
958
958
|
Xt(e, "popstate", this.historyChange);
|
|
959
959
|
}
|
|
960
960
|
}
|
|
@@ -980,13 +980,13 @@ var Wr = class {
|
|
|
980
980
|
return t !== -1 ? (this[Ae].splice(t, 1), !0) : !1;
|
|
981
981
|
}
|
|
982
982
|
[hr]() {
|
|
983
|
-
const e = this[
|
|
983
|
+
const e = this[Ge]() ?? "/", t = this.storage.getItem(dr);
|
|
984
984
|
if (t) try {
|
|
985
985
|
const n = JSON.parse(t);
|
|
986
986
|
if (n.mark === e && Array.isArray(n.routes) && n.routes.length > 0) {
|
|
987
987
|
const o = n.routes.filter((l, a) => (l.params = l.params ? Lr(l.params) : {}, this[yr](l, a, e, n.routes)));
|
|
988
988
|
if (o.length > 0) {
|
|
989
|
-
const l = this[
|
|
989
|
+
const l = this[St](), a = o.length - 1;
|
|
990
990
|
o[a].query = l || o[a].query, this[we](o);
|
|
991
991
|
return;
|
|
992
992
|
}
|
|
@@ -996,10 +996,10 @@ var Wr = class {
|
|
|
996
996
|
const r = e.indexOf("!");
|
|
997
997
|
let s;
|
|
998
998
|
r != -1 ? s = e.substring(r + 1) : s = e;
|
|
999
|
-
const i = new
|
|
1000
|
-
i.path = s, i.query = this[
|
|
999
|
+
const i = new x();
|
|
1000
|
+
i.path = s, i.query = this[St](), this[we]([i]);
|
|
1001
1001
|
}
|
|
1002
|
-
[
|
|
1002
|
+
[Xe](e, t) {
|
|
1003
1003
|
try {
|
|
1004
1004
|
t.forEach((s) => {
|
|
1005
1005
|
s.params = s.params ? Mr(s.params) : {};
|
|
@@ -1014,14 +1014,14 @@ var Wr = class {
|
|
|
1014
1014
|
}
|
|
1015
1015
|
}
|
|
1016
1016
|
setRestorePoint(e) {
|
|
1017
|
-
const t = this[
|
|
1018
|
-
this[
|
|
1017
|
+
const t = this[Ge]() ?? "/";
|
|
1018
|
+
this[Xe](t, e);
|
|
1019
1019
|
}
|
|
1020
1020
|
[we](e) {
|
|
1021
1021
|
typeof this.changeHandler == "function" && this.changeHandler(e);
|
|
1022
1022
|
}
|
|
1023
|
-
[
|
|
1024
|
-
const e =
|
|
1023
|
+
[Ge]() {
|
|
1024
|
+
const e = _();
|
|
1025
1025
|
if (this.mode === "path") {
|
|
1026
1026
|
let t = e.location.pathname;
|
|
1027
1027
|
return this.base && t.indexOf(this.base) === 0 && (t = t.substring(this.base.length)), t;
|
|
@@ -1031,24 +1031,24 @@ var Wr = class {
|
|
|
1031
1031
|
}
|
|
1032
1032
|
return null;
|
|
1033
1033
|
}
|
|
1034
|
-
[
|
|
1035
|
-
let e =
|
|
1034
|
+
[St]() {
|
|
1035
|
+
let e = _().location.search;
|
|
1036
1036
|
return e.length > 0 && e.indexOf("?") === 0 && (e = e.substring(1)), e;
|
|
1037
1037
|
}
|
|
1038
1038
|
listen(e) {
|
|
1039
1039
|
this.changeHandler = e;
|
|
1040
1040
|
}
|
|
1041
1041
|
go(e, t = !1) {
|
|
1042
|
-
const r =
|
|
1042
|
+
const r = _();
|
|
1043
1043
|
this[ne] = t, r.history.go(e);
|
|
1044
1044
|
}
|
|
1045
1045
|
goBack(e, t) {
|
|
1046
|
-
const r =
|
|
1046
|
+
const r = _(), s = r.history.state;
|
|
1047
1047
|
if (vr(s) && s.length > 0) {
|
|
1048
1048
|
let i = !1;
|
|
1049
1049
|
for (let u = s.length - 1; u >= 0; u--) {
|
|
1050
|
-
const f =
|
|
1051
|
-
if (
|
|
1050
|
+
const f = x.from(s[u]);
|
|
1051
|
+
if (x.isSame(f, e)) {
|
|
1052
1052
|
i = !0;
|
|
1053
1053
|
break;
|
|
1054
1054
|
}
|
|
@@ -1063,17 +1063,17 @@ var Wr = class {
|
|
|
1063
1063
|
r.history.go(-1), o = setTimeout(l, n);
|
|
1064
1064
|
}, a = () => {
|
|
1065
1065
|
clearTimeout(o);
|
|
1066
|
-
const u =
|
|
1066
|
+
const u = _().history.state;
|
|
1067
1067
|
if (vr(u) && u.length > 0) {
|
|
1068
1068
|
let f = u.length;
|
|
1069
|
-
const c = u[f - 1], h =
|
|
1070
|
-
if (
|
|
1069
|
+
const c = u[f - 1], h = x.from(c);
|
|
1070
|
+
if (x.isSame(h, e))
|
|
1071
1071
|
return t(), !0;
|
|
1072
1072
|
if (f > 0) {
|
|
1073
1073
|
let y = !1;
|
|
1074
1074
|
for (let d = f - 1; d >= 0; d--) {
|
|
1075
|
-
const v =
|
|
1076
|
-
if (!(v.traceless === !0 ||
|
|
1075
|
+
const v = x.from(u[d]);
|
|
1076
|
+
if (!(v.traceless === !0 || Qe(this.traceless, v)) && x.isSame(v, e)) {
|
|
1077
1077
|
y = !0;
|
|
1078
1078
|
break;
|
|
1079
1079
|
}
|
|
@@ -1090,18 +1090,18 @@ var Wr = class {
|
|
|
1090
1090
|
}
|
|
1091
1091
|
setRouteMark(e) {
|
|
1092
1092
|
const t = e.currentRoute.fullPath;
|
|
1093
|
-
this[
|
|
1093
|
+
this[Xe](t, e.routes);
|
|
1094
1094
|
}
|
|
1095
1095
|
push(e) {
|
|
1096
|
-
const t = this[
|
|
1097
|
-
e.currentRoute.historyUpdatePolicy !== "traceless" && !
|
|
1096
|
+
const t = this[xt](e.currentRoute);
|
|
1097
|
+
e.currentRoute.historyUpdatePolicy !== "traceless" && !Qe(this.traceless, e.currentRoute) && _().history.pushState(e.routes, "", t), this.setRouteMark(e);
|
|
1098
1098
|
}
|
|
1099
1099
|
replace(e) {
|
|
1100
|
-
const t = this[
|
|
1101
|
-
(e.currentRoute.historyUpdatePolicy !== "traceless" || !
|
|
1100
|
+
const t = this[xt](e.currentRoute);
|
|
1101
|
+
(e.currentRoute.historyUpdatePolicy !== "traceless" || !Qe(this.traceless, e.currentRoute)) && _().history.replaceState(e.routes, "", t), this.setRouteMark(e);
|
|
1102
1102
|
}
|
|
1103
|
-
[
|
|
1104
|
-
const t =
|
|
1103
|
+
[xt](e) {
|
|
1104
|
+
const t = _();
|
|
1105
1105
|
let r = "";
|
|
1106
1106
|
if (e.query) {
|
|
1107
1107
|
let o = "";
|
|
@@ -1120,7 +1120,7 @@ var Wr = class {
|
|
|
1120
1120
|
}
|
|
1121
1121
|
};
|
|
1122
1122
|
function Bi(e = !0, t = null, r = "", s = !0, i = !1, n) {
|
|
1123
|
-
return t !== null && (t =
|
|
1123
|
+
return t !== null && (t = _().location.pathname), t && t.endsWith("/") && (t = t.substring(0, t.length - 1)), new Wr("path", t ?? "", r, e, s, i, n);
|
|
1124
1124
|
}
|
|
1125
1125
|
function Us(e = !0, t = "", r = !0, s = !1, i) {
|
|
1126
1126
|
return new Wr("hash", "", t, e, r, s, i);
|
|
@@ -1171,7 +1171,7 @@ var Bs = class {
|
|
|
1171
1171
|
if (e === null) r = this.cursor + 1;
|
|
1172
1172
|
else for (let s = this.cursor; s >= 0; s--) {
|
|
1173
1173
|
const i = this.queue[s];
|
|
1174
|
-
if (
|
|
1174
|
+
if (x.isSame(i.currentRoute, e)) break;
|
|
1175
1175
|
r++;
|
|
1176
1176
|
}
|
|
1177
1177
|
if (r === 0) {
|
|
@@ -1195,48 +1195,48 @@ var Bs = class {
|
|
|
1195
1195
|
function Vs(e = "", t = 50) {
|
|
1196
1196
|
return new Bs(e, t);
|
|
1197
1197
|
}
|
|
1198
|
-
var
|
|
1198
|
+
var Ze = /* @__PURE__ */ Symbol("_constructRouteModel"), Ye = /* @__PURE__ */ Symbol("_findRouteModel"), Pt = /* @__PURE__ */ Symbol("_findRootView"), Ws = /* @__PURE__ */ Symbol("_getFirstView"), oe = /* @__PURE__ */ Symbol("_removeView"), mr = /* @__PURE__ */ Symbol("_buildPage"), pr = /* @__PURE__ */ Symbol("_resolveComponent"), gr = /* @__PURE__ */ Symbol("_update"), ee = /* @__PURE__ */ Symbol("_merge"), _t = /* @__PURE__ */ Symbol("_handleHistoryChange"), de = /* @__PURE__ */ Symbol("_handleRouteUpdated"), et = /* @__PURE__ */ Symbol("routeUpdatedCallback"), Ft = /* @__PURE__ */ Symbol("currentRoute"), g = /* @__PURE__ */ Symbol("currentRoutes"), tt = /* @__PURE__ */ Symbol("routeSessionCacheKey"), wr = /* @__PURE__ */ Symbol("_addRouteRecorder"), qe = /* @__PURE__ */ Symbol("_removeRouteRecorder"), $e = /* @__PURE__ */ Symbol("_cloneRouteRecorder"), A = /* @__PURE__ */ Symbol("_handleError"), rt = /* @__PURE__ */ Symbol("errorCallback"), H = /* @__PURE__ */ Symbol("registerKey"), st = /* @__PURE__ */ Symbol("notFoundKey"), Ct = /* @__PURE__ */ Symbol("notFoundPathKey"), U = /* @__PURE__ */ Symbol("forestKey"), S = /* @__PURE__ */ Symbol("historyKey"), Ke = /* @__PURE__ */ Symbol("beforeFiltersKey"), je = /* @__PURE__ */ Symbol("afterFiltersKey"), ke = /* @__PURE__ */ Symbol("destroyFiltersKey"), Et = /* @__PURE__ */ Symbol("propsFilterKey"), ve = /* @__PURE__ */ Symbol("mainDispatcherKey"), it = /* @__PURE__ */ Symbol("initKey"), le = /* @__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"), Te = /* @__PURE__ */ Symbol("_unload"), Me = /* @__PURE__ */ Symbol("routerGuardKey");
|
|
1199
1199
|
function zs(e) {
|
|
1200
1200
|
return e.layers.length == 0 || e.layers[0].views.length == 0;
|
|
1201
1201
|
}
|
|
1202
1202
|
var Js = class {
|
|
1203
1203
|
[H] = new Array();
|
|
1204
|
-
[
|
|
1204
|
+
[st];
|
|
1205
1205
|
[Ct] = "*";
|
|
1206
|
-
[
|
|
1207
|
-
[
|
|
1206
|
+
[le] = !1;
|
|
1207
|
+
[nt] = [];
|
|
1208
1208
|
[U] = new Hs();
|
|
1209
|
-
[
|
|
1209
|
+
[S];
|
|
1210
1210
|
[g] = new Array();
|
|
1211
|
-
[
|
|
1212
|
-
[
|
|
1213
|
-
[
|
|
1214
|
-
[
|
|
1211
|
+
[Ft] = jr(null);
|
|
1212
|
+
[tt] = /* @__PURE__ */ new WeakMap();
|
|
1213
|
+
[rt] = null;
|
|
1214
|
+
[et] = null;
|
|
1215
|
+
[Ke] = new Array();
|
|
1215
1216
|
[je] = new Array();
|
|
1216
1217
|
[ke] = new Array();
|
|
1217
|
-
[Te] = new Array();
|
|
1218
1218
|
[Et] = null;
|
|
1219
|
-
[ve] = new
|
|
1220
|
-
[
|
|
1221
|
-
[
|
|
1219
|
+
[ve] = new ft();
|
|
1220
|
+
[Me] = new Ns();
|
|
1221
|
+
[it] = !1;
|
|
1222
1222
|
get currentRoute() {
|
|
1223
|
-
return ys(this[
|
|
1223
|
+
return ys(this[Ft]);
|
|
1224
1224
|
}
|
|
1225
1225
|
options;
|
|
1226
1226
|
constructor(e) {
|
|
1227
1227
|
this.options = e ?? {}, this.options.notFoundPath && this.setNotFoundPath(this.options.notFoundPath);
|
|
1228
1228
|
let t = this.options.routes || [];
|
|
1229
|
-
this.addRoutes(t), this.options.notFound && this.setNotFoundRoute(this.options.notFound), e.history ? this[
|
|
1229
|
+
this.addRoutes(t), this.options.notFound && this.setNotFoundRoute(this.options.notFound), e.history ? this[S] = e.history : this[S] = Re ? Us() : Vs(), this[S]?.listen(async (r) => {
|
|
1230
1230
|
let s = !0;
|
|
1231
1231
|
try {
|
|
1232
1232
|
if (typeof r == "string") {
|
|
1233
1233
|
const i = this[M](r);
|
|
1234
|
-
i && await this[
|
|
1235
|
-
} else await this[
|
|
1234
|
+
i && await this[_t]([i]);
|
|
1235
|
+
} else await this[_t](r);
|
|
1236
1236
|
} catch (i) {
|
|
1237
1237
|
console.error(i.message, i), s = !1;
|
|
1238
1238
|
}
|
|
1239
|
-
this[
|
|
1239
|
+
this[le] === !1 && this[ot](s);
|
|
1240
1240
|
});
|
|
1241
1241
|
}
|
|
1242
1242
|
[A](e = "error", t) {
|
|
@@ -1244,40 +1244,40 @@ var Js = class {
|
|
|
1244
1244
|
t.error(e);
|
|
1245
1245
|
} catch {
|
|
1246
1246
|
}
|
|
1247
|
-
if (typeof this[
|
|
1248
|
-
this[
|
|
1247
|
+
if (typeof this[rt] == "function") try {
|
|
1248
|
+
this[rt](e, t);
|
|
1249
1249
|
} catch {
|
|
1250
1250
|
}
|
|
1251
1251
|
console.error(e);
|
|
1252
1252
|
}
|
|
1253
1253
|
init() {
|
|
1254
|
-
this[
|
|
1254
|
+
this[it] !== !0 && (this[S]?.init(!this[le]), this[it] = !0);
|
|
1255
1255
|
}
|
|
1256
1256
|
destroy() {
|
|
1257
|
-
this[
|
|
1257
|
+
this[S]?.destroy(), this[it] = !1;
|
|
1258
1258
|
}
|
|
1259
1259
|
isReady() {
|
|
1260
|
-
return this[
|
|
1261
|
-
this[
|
|
1260
|
+
return this[le] ? Promise.resolve() : new Promise((e, t) => {
|
|
1261
|
+
this[nt].push([e, t]);
|
|
1262
1262
|
});
|
|
1263
1263
|
}
|
|
1264
|
-
[
|
|
1265
|
-
this[
|
|
1264
|
+
[ot](e) {
|
|
1265
|
+
this[le] = !0, this[nt].forEach(([t, r]) => {
|
|
1266
1266
|
try {
|
|
1267
1267
|
e ? t() : r();
|
|
1268
1268
|
} catch (s) {
|
|
1269
1269
|
console.error(s.message, s);
|
|
1270
1270
|
}
|
|
1271
|
-
}), this[
|
|
1271
|
+
}), this[nt] = [];
|
|
1272
1272
|
}
|
|
1273
|
-
[
|
|
1273
|
+
[_t](e) {
|
|
1274
1274
|
try {
|
|
1275
1275
|
if (!e) {
|
|
1276
1276
|
let n = [...this[g]].reverse();
|
|
1277
|
-
return this[
|
|
1277
|
+
return this[Te](n), Re && _().location.reload(), Promise.resolve();
|
|
1278
1278
|
}
|
|
1279
1279
|
let t = null, r = [], s = [], i = 0;
|
|
1280
|
-
for (; i < e.length && i < this[g].length &&
|
|
1280
|
+
for (; i < e.length && i < this[g].length && x.isSame(e[i], this[g][i]); i++)
|
|
1281
1281
|
e[i].active === !0 && e[i].active !== this[g][i].active && (t = e[i]);
|
|
1282
1282
|
if (i < e.length) r = e.slice(i);
|
|
1283
1283
|
else if (i === e.length) for (; i < this[g].length && this[g][i].historyUpdatePolicy === "traceless"; i++)
|
|
@@ -1285,7 +1285,7 @@ var Js = class {
|
|
|
1285
1285
|
if (i < this[g].length && (s = this[g].slice(i).reverse()), s.length === 0 && r.length === 0) {
|
|
1286
1286
|
if (t !== null) return this.restore([t]);
|
|
1287
1287
|
} else if (s.length > 0) {
|
|
1288
|
-
if (this[
|
|
1288
|
+
if (this[Te](s)) {
|
|
1289
1289
|
if (r.length > 0) return this.restore(r);
|
|
1290
1290
|
if (t !== null) return this.restore([t]);
|
|
1291
1291
|
}
|
|
@@ -1295,14 +1295,14 @@ var Js = class {
|
|
|
1295
1295
|
}
|
|
1296
1296
|
return Promise.resolve();
|
|
1297
1297
|
}
|
|
1298
|
-
[
|
|
1299
|
-
if (this[
|
|
1300
|
-
this[
|
|
1298
|
+
[de](e = null) {
|
|
1299
|
+
if (this[Ft].value = e, typeof this[et] == "function") try {
|
|
1300
|
+
this[et](e);
|
|
1301
1301
|
} catch {
|
|
1302
1302
|
}
|
|
1303
1303
|
}
|
|
1304
1304
|
[wr](e, t) {
|
|
1305
|
-
if (e.opsType ===
|
|
1305
|
+
if (e.opsType === F.Open) {
|
|
1306
1306
|
let r = !1;
|
|
1307
1307
|
const s = this[g].length - 1;
|
|
1308
1308
|
for (let i = s; i >= 0; i--) {
|
|
@@ -1317,47 +1317,50 @@ var Js = class {
|
|
|
1317
1317
|
}
|
|
1318
1318
|
r || this[g].push(e);
|
|
1319
1319
|
} else this[g].push(e);
|
|
1320
|
-
this[
|
|
1320
|
+
this[tt].set(e, t), this[de](e);
|
|
1321
1321
|
}
|
|
1322
|
-
[
|
|
1322
|
+
[$e]() {
|
|
1323
1323
|
let e = [];
|
|
1324
1324
|
for (let t of this[g]) {
|
|
1325
|
-
let r =
|
|
1325
|
+
let r = x.clone(t, !0);
|
|
1326
1326
|
e.push(r);
|
|
1327
1327
|
}
|
|
1328
1328
|
return e;
|
|
1329
1329
|
}
|
|
1330
|
-
[
|
|
1330
|
+
[qe](e) {
|
|
1331
1331
|
if (!this[g]) {
|
|
1332
|
-
this[
|
|
1332
|
+
this[de](null);
|
|
1333
1333
|
return;
|
|
1334
1334
|
}
|
|
1335
1335
|
let t = -1;
|
|
1336
|
-
for (let
|
|
1337
|
-
t =
|
|
1336
|
+
for (let s = 0; s < this[g].length; s++) if (x.isSame(this[g][s], e)) {
|
|
1337
|
+
t = s;
|
|
1338
1338
|
break;
|
|
1339
1339
|
}
|
|
1340
1340
|
if (t != -1) {
|
|
1341
|
-
const
|
|
1341
|
+
const s = this[g][t];
|
|
1342
1342
|
this[g].splice(t, 1);
|
|
1343
|
-
const
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1343
|
+
const i = this[tt].get(s);
|
|
1344
|
+
this[tt].delete(s), this[Rr](s, i);
|
|
1345
|
+
}
|
|
1346
|
+
let r = -1;
|
|
1347
|
+
for (let s = this[g].length - 1; s >= 0; s--) if (this[g][s].active === !0) {
|
|
1348
|
+
r = s;
|
|
1349
|
+
break;
|
|
1350
|
+
}
|
|
1351
|
+
r !== -1 ? this[de](this[g][r]) : this[de](null);
|
|
1349
1352
|
}
|
|
1350
1353
|
set historyMonitor(e) {
|
|
1351
|
-
this[
|
|
1354
|
+
this[S] && (this[S].historyMonitor = e);
|
|
1352
1355
|
}
|
|
1353
1356
|
get historyMonitor() {
|
|
1354
|
-
return this[
|
|
1357
|
+
return this[S] ? this[S].historyMonitor : !1;
|
|
1355
1358
|
}
|
|
1356
1359
|
set traceless(e) {
|
|
1357
|
-
this[
|
|
1360
|
+
this[S] && (this[S].traceless = e);
|
|
1358
1361
|
}
|
|
1359
1362
|
get traceless() {
|
|
1360
|
-
return this[
|
|
1363
|
+
return this[S]?.traceless ?? !1;
|
|
1361
1364
|
}
|
|
1362
1365
|
set propsFilter(e) {
|
|
1363
1366
|
this[Et] = e;
|
|
@@ -1366,41 +1369,41 @@ var Js = class {
|
|
|
1366
1369
|
return this[Et];
|
|
1367
1370
|
}
|
|
1368
1371
|
setRestorePoint() {
|
|
1369
|
-
const e = this[
|
|
1370
|
-
this[
|
|
1372
|
+
const e = this[$e]();
|
|
1373
|
+
this[S]?.setRestorePoint(e);
|
|
1371
1374
|
}
|
|
1372
1375
|
onRouteUpdated(e) {
|
|
1373
|
-
this[
|
|
1376
|
+
this[et] = e;
|
|
1374
1377
|
}
|
|
1375
1378
|
onError(e) {
|
|
1376
|
-
this[
|
|
1379
|
+
this[rt] = e;
|
|
1377
1380
|
}
|
|
1378
1381
|
beforeEach(e) {
|
|
1379
|
-
this[
|
|
1382
|
+
this[Ke].push(e);
|
|
1380
1383
|
}
|
|
1381
1384
|
removeBeforeEach(e) {
|
|
1382
|
-
const t = this[
|
|
1383
|
-
return t !== -1 ? (this[
|
|
1385
|
+
const t = this[Ke].indexOf(e);
|
|
1386
|
+
return t !== -1 ? (this[Ke].splice(t, 1), !0) : !1;
|
|
1384
1387
|
}
|
|
1385
1388
|
afterEach(e) {
|
|
1386
|
-
this[
|
|
1389
|
+
this[je].push(e);
|
|
1387
1390
|
}
|
|
1388
1391
|
removeAfterEach(e) {
|
|
1389
|
-
const t = this[
|
|
1390
|
-
return t !== -1 ? (this[
|
|
1392
|
+
const t = this[je].indexOf(e);
|
|
1393
|
+
return t !== -1 ? (this[je].splice(t, 1), !0) : !1;
|
|
1391
1394
|
}
|
|
1392
1395
|
destroyEach(e) {
|
|
1393
|
-
this[
|
|
1396
|
+
this[ke].push(e);
|
|
1394
1397
|
}
|
|
1395
1398
|
removeDestroyEach(e) {
|
|
1396
|
-
const t = this[
|
|
1397
|
-
return t !== -1 ? (this[
|
|
1399
|
+
const t = this[ke].indexOf(e);
|
|
1400
|
+
return t !== -1 ? (this[ke].splice(t, 1), !0) : !1;
|
|
1398
1401
|
}
|
|
1399
1402
|
beforeRestoreEach(e) {
|
|
1400
|
-
this[
|
|
1403
|
+
this[S]?.beforeRestoreEach(e);
|
|
1401
1404
|
}
|
|
1402
1405
|
removeBeforeRestoreEach(e) {
|
|
1403
|
-
return this[
|
|
1406
|
+
return this[S]?.removeBeforeRestoreEach(e) ?? !1;
|
|
1404
1407
|
}
|
|
1405
1408
|
addRoutes(e) {
|
|
1406
1409
|
for (let t of e) this.addRoute(t);
|
|
@@ -1410,7 +1413,7 @@ var Js = class {
|
|
|
1410
1413
|
this.setNotFoundRoute(e);
|
|
1411
1414
|
return;
|
|
1412
1415
|
}
|
|
1413
|
-
const r = this[
|
|
1416
|
+
const r = this[Ze](e);
|
|
1414
1417
|
if (t == -1) this[H] = [...this[H], ...r];
|
|
1415
1418
|
else for (let s = r.length - 1; s >= 0; s--) this[H].splice(t, 0, r[s]);
|
|
1416
1419
|
}
|
|
@@ -1437,21 +1440,21 @@ var Js = class {
|
|
|
1437
1440
|
this[Ct] = e;
|
|
1438
1441
|
}
|
|
1439
1442
|
setNotFoundRoute(e) {
|
|
1440
|
-
const t = this[
|
|
1441
|
-
this[
|
|
1443
|
+
const t = this[Ze](e);
|
|
1444
|
+
this[st] = t[0];
|
|
1442
1445
|
}
|
|
1443
1446
|
getRoutes() {
|
|
1444
1447
|
return [...this[H]];
|
|
1445
1448
|
}
|
|
1446
|
-
[
|
|
1449
|
+
[Ze](e) {
|
|
1447
1450
|
let t = e.path ?? "";
|
|
1448
1451
|
t.length > 0 && t.charAt(0) !== "/" && (t = `/${t}`);
|
|
1449
1452
|
let r = e.components ?? (e.component && { "": e.component });
|
|
1450
1453
|
if (!r) {
|
|
1451
|
-
const l = new
|
|
1454
|
+
const l = new pt();
|
|
1452
1455
|
return l.path = t, l.redirect = e.redirect, [l];
|
|
1453
1456
|
}
|
|
1454
|
-
const s = new
|
|
1457
|
+
const s = new x();
|
|
1455
1458
|
s.path = t, s.name = e.name, s.meta = e.meta;
|
|
1456
1459
|
let i = [];
|
|
1457
1460
|
for (let l in r) {
|
|
@@ -1462,9 +1465,9 @@ var Js = class {
|
|
|
1462
1465
|
}
|
|
1463
1466
|
let n = !1, o = [];
|
|
1464
1467
|
if (e.children) for (let l of e.children) {
|
|
1465
|
-
const a = this[
|
|
1468
|
+
const a = this[Ze](l);
|
|
1466
1469
|
for (let u of a) {
|
|
1467
|
-
let f = new
|
|
1470
|
+
let f = new pt();
|
|
1468
1471
|
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
1472
|
let c = new cr();
|
|
1470
1473
|
c.models = [...i], f.layers = [c, ...u.layers], f.matchedRoutes = [s, ...u.matchedRoutes ?? []], o.push(f);
|
|
@@ -1473,12 +1476,12 @@ var Js = class {
|
|
|
1473
1476
|
if (!n) {
|
|
1474
1477
|
const l = new cr();
|
|
1475
1478
|
l.models = i;
|
|
1476
|
-
const a = new
|
|
1479
|
+
const a = new pt();
|
|
1477
1480
|
a.name = e.name, a.path = t, a.matchedRoutes = [s], a.layers = [l], o.splice(0, 0, a);
|
|
1478
1481
|
}
|
|
1479
1482
|
return o;
|
|
1480
1483
|
}
|
|
1481
|
-
[
|
|
1484
|
+
[Ye](e) {
|
|
1482
1485
|
const t = e.route;
|
|
1483
1486
|
try {
|
|
1484
1487
|
for (let r of this[H]) {
|
|
@@ -1489,13 +1492,13 @@ var Js = class {
|
|
|
1489
1492
|
const o = n(s);
|
|
1490
1493
|
if (!o) continue;
|
|
1491
1494
|
if (r.redirect) {
|
|
1492
|
-
const l = new
|
|
1495
|
+
const l = new x();
|
|
1493
1496
|
q(!0, l, t), l.path = r.redirect;
|
|
1494
1497
|
const a = {
|
|
1495
1498
|
route: l,
|
|
1496
1499
|
find: void 0
|
|
1497
1500
|
};
|
|
1498
|
-
return this[
|
|
1501
|
+
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
1502
|
}
|
|
1500
1503
|
if (t.params = t.params ?? {}, q(!0, t.params, o.params), t.query) {
|
|
1501
1504
|
const l = t.query;
|
|
@@ -1522,33 +1525,33 @@ var Js = class {
|
|
|
1522
1525
|
[M](e) {
|
|
1523
1526
|
let t = null;
|
|
1524
1527
|
if (Array.isArray(e))
|
|
1525
|
-
if (t = new
|
|
1528
|
+
if (t = new x(), typeof e[0] == "object") t = x.from(e[0]);
|
|
1526
1529
|
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 =
|
|
1530
|
+
else typeof e == "object" ? t = x.from(e) : typeof e == "string" && (t = new x(), e.charAt(0) == "/" ? t.path = e : t.name = e);
|
|
1528
1531
|
if (t) {
|
|
1529
1532
|
if (t.path) {
|
|
1530
1533
|
let r = t.path.indexOf("?");
|
|
1531
1534
|
r !== -1 && r < t.path.length - 1 && (t.query = t.path.substring(r + 1), t.path = t.path.substring(0, r));
|
|
1532
1535
|
}
|
|
1533
|
-
t.root = t.root ?? "default", t.opsType = t.opsType ?? this.options.defaultOperationType ??
|
|
1536
|
+
t.root = t.root ?? "default", t.opsType = t.opsType ?? this.options.defaultOperationType ?? F.Push, t.traceless && !t.historyUpdatePolicy && (t.historyUpdatePolicy = "traceless");
|
|
1534
1537
|
}
|
|
1535
1538
|
return t;
|
|
1536
1539
|
}
|
|
1537
1540
|
push(...e) {
|
|
1538
1541
|
const t = this[M](e);
|
|
1539
|
-
return t ? (t.opsType =
|
|
1542
|
+
return t ? (t.opsType = F.Push, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "push", this.to(t)) : (this[A]("resolve route fail", t), this);
|
|
1540
1543
|
}
|
|
1541
1544
|
put(...e) {
|
|
1542
1545
|
const t = this[M](e);
|
|
1543
|
-
return t ? (t.opsType =
|
|
1546
|
+
return t ? (t.opsType = F.Put, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "traceless", this.to(t)) : (this[A]("resolve route fail", t), this);
|
|
1544
1547
|
}
|
|
1545
1548
|
replace(...e) {
|
|
1546
1549
|
const t = this[M](e);
|
|
1547
|
-
return t ? (t.opsType =
|
|
1550
|
+
return t ? (t.opsType = F.Replace, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "replace", this.to(t)) : (this[A]("resolve route fail", t), this);
|
|
1548
1551
|
}
|
|
1549
1552
|
append(...e) {
|
|
1550
1553
|
const t = this[M](e);
|
|
1551
|
-
return t ? (t.opsType =
|
|
1554
|
+
return t ? (t.opsType = F.Append, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "push", this.to(t)) : (this[A]("resolve route fail", t), this);
|
|
1552
1555
|
}
|
|
1553
1556
|
remove(e, t) {
|
|
1554
1557
|
return new Promise((r) => {
|
|
@@ -1562,7 +1565,7 @@ var Js = class {
|
|
|
1562
1565
|
if (e) {
|
|
1563
1566
|
if (n = e.root ?? "default", e.all) for (let f = l; f > 0; f--) {
|
|
1564
1567
|
const c = this[g][f];
|
|
1565
|
-
if (c.opsType ===
|
|
1568
|
+
if (c.opsType === F.Append) {
|
|
1566
1569
|
const h = c.root ?? "default";
|
|
1567
1570
|
if (n && n !== h) continue;
|
|
1568
1571
|
o.splice(0, 0, c), i = f - 1;
|
|
@@ -1570,7 +1573,7 @@ var Js = class {
|
|
|
1570
1573
|
}
|
|
1571
1574
|
else if (e.until) for (let f = l; f > 0; f--) {
|
|
1572
1575
|
let c = this[g][f];
|
|
1573
|
-
if (c.opsType ===
|
|
1576
|
+
if (c.opsType === F.Append && c.root === n) {
|
|
1574
1577
|
if (e.until.charAt(0) === "/" && e.until === c.path) {
|
|
1575
1578
|
i = f;
|
|
1576
1579
|
break;
|
|
@@ -1583,7 +1586,7 @@ var Js = class {
|
|
|
1583
1586
|
}
|
|
1584
1587
|
else if (e.to) for (let f = l; f > 0; f--) {
|
|
1585
1588
|
const c = this[g][f];
|
|
1586
|
-
if (c.opsType ===
|
|
1589
|
+
if (c.opsType === F.Append) {
|
|
1587
1590
|
const h = c.root ?? "default";
|
|
1588
1591
|
if (n && n !== h) continue;
|
|
1589
1592
|
if (o.splice(0, 0, c), e.to.charAt(0) === "/" && e.to === c.path) {
|
|
@@ -1597,7 +1600,7 @@ var Js = class {
|
|
|
1597
1600
|
}
|
|
1598
1601
|
} else for (let f = l; f > 0; f--) {
|
|
1599
1602
|
let c = this[g][f];
|
|
1600
|
-
if (c.opsType ===
|
|
1603
|
+
if (c.opsType === F.Append) {
|
|
1601
1604
|
o.push(c), i = f - 1;
|
|
1602
1605
|
break;
|
|
1603
1606
|
}
|
|
@@ -1608,16 +1611,16 @@ var Js = class {
|
|
|
1608
1611
|
return;
|
|
1609
1612
|
}
|
|
1610
1613
|
const u = i !== -1 ? this[g][i] : null;
|
|
1611
|
-
if (this[
|
|
1614
|
+
if (this[Te](o)) {
|
|
1612
1615
|
if (t === !1)
|
|
1613
1616
|
return s.resolve(), r(!0), !0;
|
|
1614
1617
|
const f = () => (s.resolve(), r(!0), !0), c = this[g].length;
|
|
1615
|
-
if (u &&
|
|
1618
|
+
if (u && x.isSame(u, this[g][c - 1])) {
|
|
1616
1619
|
if (a?.historyUpdatePolicy === "traceless") {
|
|
1617
|
-
let h =
|
|
1618
|
-
const y = new
|
|
1619
|
-
this[
|
|
1620
|
-
} else this[
|
|
1620
|
+
let h = x.clone(u, !0);
|
|
1621
|
+
const y = new Rt(h, this[$e]());
|
|
1622
|
+
this[S]?.replace(y), f();
|
|
1623
|
+
} else this[S]?.goBack(u, f);
|
|
1621
1624
|
return;
|
|
1622
1625
|
}
|
|
1623
1626
|
f();
|
|
@@ -1630,7 +1633,7 @@ var Js = class {
|
|
|
1630
1633
|
}
|
|
1631
1634
|
open(...e) {
|
|
1632
1635
|
const t = this[M](e);
|
|
1633
|
-
return t ? (t.opsType =
|
|
1636
|
+
return t ? (t.opsType = F.Open, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "push", this.to(t)) : (this[A]("resolve route fail", t), this);
|
|
1634
1637
|
}
|
|
1635
1638
|
close(e) {
|
|
1636
1639
|
return this[ve].post((t) => {
|
|
@@ -1661,7 +1664,7 @@ var Js = class {
|
|
|
1661
1664
|
t.resolve();
|
|
1662
1665
|
return;
|
|
1663
1666
|
}
|
|
1664
|
-
this[
|
|
1667
|
+
this[Te](s), t.resolve();
|
|
1665
1668
|
} catch (r) {
|
|
1666
1669
|
this[A](r), t.resolve();
|
|
1667
1670
|
}
|
|
@@ -1671,35 +1674,35 @@ var Js = class {
|
|
|
1671
1674
|
const t = this[M](e);
|
|
1672
1675
|
if (!t)
|
|
1673
1676
|
return this[A]("resolve route fail", t), this;
|
|
1674
|
-
const r = this[
|
|
1677
|
+
const r = this[Me].acquire(t);
|
|
1675
1678
|
return r == null ? (this[A]("route forbid", t), this) : (this[ve].post((s) => {
|
|
1676
1679
|
try {
|
|
1677
1680
|
let i = this[At](t);
|
|
1678
1681
|
this[qt](i), this[Kt](i), this[$t](i), i.wait((n, o) => {
|
|
1679
1682
|
const l = n.session.to;
|
|
1680
1683
|
if (n.session.updateResult && n.session.updateResult.status === "success") try {
|
|
1681
|
-
let a =
|
|
1682
|
-
const u = new
|
|
1683
|
-
l.historyUpdatePolicy === "replace" ? this[
|
|
1684
|
+
let a = x.clone(l, !0);
|
|
1685
|
+
const u = new Rt(a, this[$e]());
|
|
1686
|
+
l.historyUpdatePolicy === "replace" ? this[S]?.replace(u) : l.historyUpdatePolicy === "traceless" ? this[S]?.setRouteMark(u) : this[S]?.push(u);
|
|
1684
1687
|
} catch (a) {
|
|
1685
1688
|
console.error(a.message, a);
|
|
1686
1689
|
}
|
|
1687
|
-
if (
|
|
1690
|
+
if (ze.clear(n.session), this[Me].release(r), typeof t.success == "function") try {
|
|
1688
1691
|
Reflect.apply(t.success, {}, []);
|
|
1689
1692
|
} catch (a) {
|
|
1690
1693
|
console.error(a.message, a);
|
|
1691
1694
|
}
|
|
1692
|
-
this[
|
|
1695
|
+
this[le] === !1 && this[ot](!0), i = null, s.resolve();
|
|
1693
1696
|
}, (n, o) => {
|
|
1694
|
-
this[
|
|
1697
|
+
this[Me].release(r), o !== null && this[A](o, t), this[le] === !1 && this[ot](!1), ze.clear(n.session), i = null, s.resolve();
|
|
1695
1698
|
});
|
|
1696
1699
|
} catch (i) {
|
|
1697
|
-
this[
|
|
1700
|
+
this[Me].release(r), this[A](i, t), s.resolve();
|
|
1698
1701
|
}
|
|
1699
1702
|
}), this);
|
|
1700
1703
|
}
|
|
1701
1704
|
back(e = 1) {
|
|
1702
|
-
this[
|
|
1705
|
+
this[S]?.go(-e, !1);
|
|
1703
1706
|
}
|
|
1704
1707
|
[br](e) {
|
|
1705
1708
|
return (t, r) => {
|
|
@@ -1717,11 +1720,11 @@ var Js = class {
|
|
|
1717
1720
|
};
|
|
1718
1721
|
}
|
|
1719
1722
|
[At](e) {
|
|
1720
|
-
const t = this[g].length > 0 ? this[g][this[g].length - 1] : void 0, r = new
|
|
1723
|
+
const t = this[g].length > 0 ? this[g][this[g].length - 1] : void 0, r = new ze(e, t), s = {
|
|
1721
1724
|
route: e,
|
|
1722
1725
|
find: null
|
|
1723
1726
|
};
|
|
1724
|
-
if (this[
|
|
1727
|
+
if (this[Ye](s), s.find) {
|
|
1725
1728
|
r.routeModel = s.find, e.matched = s.find.matchedRoutes ?? [];
|
|
1726
1729
|
const i = {};
|
|
1727
1730
|
if (Array.isArray(s.find?.matchedRoutes)) for (let n = 0; n < s.find.matchedRoutes.length; n++) {
|
|
@@ -1730,10 +1733,10 @@ var Js = class {
|
|
|
1730
1733
|
}
|
|
1731
1734
|
e.meta && typeof e.meta == "object" && Object.assign(i, e.meta), e.meta = i;
|
|
1732
1735
|
}
|
|
1733
|
-
return new
|
|
1736
|
+
return new ft(r);
|
|
1734
1737
|
}
|
|
1735
1738
|
[qt](e) {
|
|
1736
|
-
for (let t of this[
|
|
1739
|
+
for (let t of this[Ke]) e.post((r) => {
|
|
1737
1740
|
const s = this[br](r);
|
|
1738
1741
|
Reflect.apply(t, {}, [
|
|
1739
1742
|
r.session.to,
|
|
@@ -1745,7 +1748,7 @@ var Js = class {
|
|
|
1745
1748
|
}
|
|
1746
1749
|
[$t](e) {
|
|
1747
1750
|
e.post((t) => {
|
|
1748
|
-
for (let r of this[
|
|
1751
|
+
for (let r of this[je]) try {
|
|
1749
1752
|
Reflect.apply(r, {}, [
|
|
1750
1753
|
t.session.to,
|
|
1751
1754
|
t.session.from,
|
|
@@ -1758,7 +1761,7 @@ var Js = class {
|
|
|
1758
1761
|
});
|
|
1759
1762
|
}
|
|
1760
1763
|
[Rr](e, t) {
|
|
1761
|
-
for (let r of this[
|
|
1764
|
+
for (let r of this[ke]) try {
|
|
1762
1765
|
Reflect.apply(r, {}, [e, t]);
|
|
1763
1766
|
} catch (s) {
|
|
1764
1767
|
console.error(s.message, s);
|
|
@@ -1774,15 +1777,15 @@ var Js = class {
|
|
|
1774
1777
|
route: r,
|
|
1775
1778
|
find: null
|
|
1776
1779
|
};
|
|
1777
|
-
if (this[
|
|
1780
|
+
if (this[Ye](n))
|
|
1778
1781
|
s = n.find, t.session.routeModel = s;
|
|
1779
|
-
else if (this[
|
|
1782
|
+
else if (this[st]) s = this[st];
|
|
1780
1783
|
else {
|
|
1781
1784
|
t.reject(`not find route model, path:${r.path ?? r.name}`);
|
|
1782
1785
|
return;
|
|
1783
1786
|
}
|
|
1784
1787
|
}
|
|
1785
|
-
const i =
|
|
1788
|
+
const i = ze.from(t.session);
|
|
1786
1789
|
this[mr](r, s, i).then((n) => {
|
|
1787
1790
|
this[U], t.session.updateResult = n ?? {
|
|
1788
1791
|
status: "success",
|
|
@@ -1793,11 +1796,11 @@ var Js = class {
|
|
|
1793
1796
|
});
|
|
1794
1797
|
});
|
|
1795
1798
|
}
|
|
1796
|
-
[
|
|
1799
|
+
[Te](e) {
|
|
1797
1800
|
if (e.length == 0) return !0;
|
|
1798
1801
|
let t = this[U], r = [];
|
|
1799
1802
|
for (let s of e) {
|
|
1800
|
-
let i = this[
|
|
1803
|
+
let i = this[Pt](t, s);
|
|
1801
1804
|
i != null && r.push({
|
|
1802
1805
|
...i,
|
|
1803
1806
|
route: s
|
|
@@ -1811,14 +1814,14 @@ var Js = class {
|
|
|
1811
1814
|
}, [s.route.index ?? 0], !0);
|
|
1812
1815
|
return !0;
|
|
1813
1816
|
}
|
|
1814
|
-
[
|
|
1817
|
+
[Pt](e, t) {
|
|
1815
1818
|
const r = t.root ?? "default";
|
|
1816
1819
|
let s;
|
|
1817
1820
|
for (let i = 0; i < e.layers.length; i++) {
|
|
1818
1821
|
const n = e.layers[i];
|
|
1819
1822
|
for (let o = n.views.length - 1; o >= 0; o--) {
|
|
1820
1823
|
const l = n.views[o];
|
|
1821
|
-
if (l[V] && l[
|
|
1824
|
+
if (l[V] && l[at] === r)
|
|
1822
1825
|
return s = {
|
|
1823
1826
|
x: o,
|
|
1824
1827
|
y: i
|
|
@@ -1835,7 +1838,7 @@ var Js = class {
|
|
|
1835
1838
|
let i = e.layers[t.y].views[t.x], n = !1, o = [], l = !1, a = [...i.slots.value];
|
|
1836
1839
|
for (let f = a.length - 1; f >= 0; f--) {
|
|
1837
1840
|
let c = a[f];
|
|
1838
|
-
(!r || r.indexOf(c.index) != -1) && (c.route && i[V] && (this[
|
|
1841
|
+
(!r || r.indexOf(c.index) != -1) && (c.route && i[V] && (this[qe](c.route), c.active === !0 && c.route.opsType == F.Append && (l = !0)), o.push(new I(i, c.index, t.y)), a.splice(f, 1));
|
|
1839
1842
|
}
|
|
1840
1843
|
if (a.length == 0)
|
|
1841
1844
|
s ? i.slots.value = a : e.layers[t.y].views.splice(t.x, 1);
|
|
@@ -1852,11 +1855,11 @@ var Js = class {
|
|
|
1852
1855
|
let f = e.layers[u].views, c = [];
|
|
1853
1856
|
for (let h = f.length - 1; (n || o.length > 0) && h >= 0; h--) {
|
|
1854
1857
|
let y = f[h];
|
|
1855
|
-
if (y[
|
|
1858
|
+
if (y[ue] && (n || I.include(o, y[ue]))) {
|
|
1856
1859
|
let d = y.slots.value;
|
|
1857
1860
|
for (let v = d.length - 1; v >= 0; v--) {
|
|
1858
1861
|
let w = d[v];
|
|
1859
|
-
w.route && y[V] && this[
|
|
1862
|
+
w.route && y[V] && this[qe](w.route), c.push(new I(y, w.index, u)), d.splice(v, 1);
|
|
1860
1863
|
}
|
|
1861
1864
|
e.layers[u].views.splice(h, 1);
|
|
1862
1865
|
}
|
|
@@ -1871,7 +1874,7 @@ var Js = class {
|
|
|
1871
1874
|
let r = t.layers[0].views;
|
|
1872
1875
|
r.length > 0 && (r[0].slots.value = []);
|
|
1873
1876
|
}
|
|
1874
|
-
return this[g] = [], this[
|
|
1877
|
+
return this[g] = [], this[de](null), Promise.resolve();
|
|
1875
1878
|
} else return new Promise((t, r) => {
|
|
1876
1879
|
let s = null, i = !1;
|
|
1877
1880
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -1887,15 +1890,15 @@ var Js = class {
|
|
|
1887
1890
|
}
|
|
1888
1891
|
this[ve].post((n) => {
|
|
1889
1892
|
if (s && i === !0) {
|
|
1890
|
-
const o =
|
|
1891
|
-
this[
|
|
1893
|
+
const o = x.clone(s, !0), l = new Rt(o, this[$e]());
|
|
1894
|
+
this[S]?.replace(l);
|
|
1892
1895
|
}
|
|
1893
1896
|
n.resolve(), t();
|
|
1894
1897
|
});
|
|
1895
1898
|
});
|
|
1896
1899
|
}
|
|
1897
1900
|
async [mr](e, t, r) {
|
|
1898
|
-
const s = e.updateType ??
|
|
1901
|
+
const s = e.updateType ?? gt.Part;
|
|
1899
1902
|
await this[pr](t);
|
|
1900
1903
|
const i = this[gr](t, e, r, s);
|
|
1901
1904
|
if (i.status === "error") throw Error(i.message);
|
|
@@ -1919,11 +1922,11 @@ var Js = class {
|
|
|
1919
1922
|
};
|
|
1920
1923
|
const i = e.layers[0].models[0];
|
|
1921
1924
|
let n = this[U], o = zs(n), l = t.root ?? "default", a;
|
|
1922
|
-
!o && s ==
|
|
1925
|
+
!o && s == gt.Part && (a = this[Pt](n, t));
|
|
1923
1926
|
let u, f = 0;
|
|
1924
1927
|
if (a == null || a == null)
|
|
1925
|
-
if (o || s ===
|
|
1926
|
-
if (n.layers.length == 0 && (n.layers[0] = new
|
|
1928
|
+
if (o || s === gt.All) {
|
|
1929
|
+
if (n.layers.length == 0 && (n.layers[0] = new wt()), n.layers[0].views.length == 0) {
|
|
1927
1930
|
let c = t.root ?? "default";
|
|
1928
1931
|
u = new Ce(c, !0, null), n.layers[0].views = [u];
|
|
1929
1932
|
} else u = n.layers[0].views[0];
|
|
@@ -1966,8 +1969,8 @@ var Js = class {
|
|
|
1966
1969
|
};
|
|
1967
1970
|
}
|
|
1968
1971
|
else u = n.layers[a.y].views[a.x];
|
|
1969
|
-
if (f = a.y, u[V] = !0, t.opsType ===
|
|
1970
|
-
t.index = t.index ??
|
|
1972
|
+
if (f = a.y, u[V] = !0, t.opsType === F.Append) {
|
|
1973
|
+
t.index = t.index ?? Ie.get(), t.active = !0;
|
|
1971
1974
|
let c = u.slots.value;
|
|
1972
1975
|
if (c.length > 0) {
|
|
1973
1976
|
let w = c[c.length - 1];
|
|
@@ -1977,12 +1980,12 @@ var Js = class {
|
|
|
1977
1980
|
u.slots.value = [...c, h];
|
|
1978
1981
|
let y = f + 1, d = 1, v = new I(u, t.index, f);
|
|
1979
1982
|
this[ee](n, y, e, d, v);
|
|
1980
|
-
} else if (t.opsType ===
|
|
1983
|
+
} else if (t.opsType === F.Open) {
|
|
1981
1984
|
let c = u.slots.value;
|
|
1982
1985
|
const h = t.active ?? !0;
|
|
1983
1986
|
let y = !1;
|
|
1984
1987
|
for (let d of c) {
|
|
1985
|
-
if (d.route !== null &&
|
|
1988
|
+
if (d.route !== null && x.isSamePathForRoute(d.route, t)) {
|
|
1986
1989
|
if (d.active === h)
|
|
1987
1990
|
return t.index = d.index, t.active = h, d.route = t, {
|
|
1988
1991
|
status: "noChange",
|
|
@@ -1993,7 +1996,7 @@ var Js = class {
|
|
|
1993
1996
|
d.route && (d.route.active = d.active);
|
|
1994
1997
|
}
|
|
1995
1998
|
if (!y) {
|
|
1996
|
-
t.index = t.index ??
|
|
1999
|
+
t.index = t.index ?? Ie.get(), t.active = h;
|
|
1997
2000
|
let d = new Y(t, i, t.index, h);
|
|
1998
2001
|
c.push(d);
|
|
1999
2002
|
let v = f + 1, w = 1, m = new I(u, t.index, f);
|
|
@@ -2003,17 +2006,17 @@ var Js = class {
|
|
|
2003
2006
|
} else {
|
|
2004
2007
|
let c = u.slots.value;
|
|
2005
2008
|
if (c.length == 0) {
|
|
2006
|
-
t.index = t.index ??
|
|
2009
|
+
t.index = t.index ?? Ie.get(), t.active = !0, u.slots.value = [new Y(t, i, t.index)];
|
|
2007
2010
|
let h = f + 1, y = 1, d = new I(u, t.index, f);
|
|
2008
2011
|
this[ee](n, h, e, y, d);
|
|
2009
2012
|
} else {
|
|
2010
2013
|
let h = c[0];
|
|
2011
2014
|
if (h.model !== i) {
|
|
2012
|
-
this[oe](n, a, null, !0), t.index = t.index ??
|
|
2015
|
+
this[oe](n, a, null, !0), t.index = t.index ?? Ie.get(), t.active = !0, u.slots.value = [new Y(t, i, t.index)];
|
|
2013
2016
|
let y = f + 1, d = 1, v = new I(u, t.index, f);
|
|
2014
2017
|
this[ee](n, y, e, d, v);
|
|
2015
2018
|
} else {
|
|
2016
|
-
h.route !== null && this[
|
|
2019
|
+
h.route !== null && this[qe](h.route);
|
|
2017
2020
|
let y = !1;
|
|
2018
2021
|
const d = t.active ?? !0;
|
|
2019
2022
|
h.active !== d && (h.active = d, y = !0), t.active = d, t.index = h.index, h.route = t;
|
|
@@ -2025,7 +2028,7 @@ var Js = class {
|
|
|
2025
2028
|
let K = [];
|
|
2026
2029
|
for (let j = 0; j < n.layers[m].views.length; j++) {
|
|
2027
2030
|
let E = n.layers[m].views[j];
|
|
2028
|
-
E[
|
|
2031
|
+
E[ue] && I.include(w, E[ue]) && K.unshift(j);
|
|
2029
2032
|
}
|
|
2030
2033
|
let _e = [];
|
|
2031
2034
|
for (let j of K) {
|
|
@@ -2055,7 +2058,7 @@ var Js = class {
|
|
|
2055
2058
|
let D = m + 1, N = p + 1;
|
|
2056
2059
|
this[ee](n, D, e, N, $);
|
|
2057
2060
|
} else {
|
|
2058
|
-
E[V] && z.route !== null && this[
|
|
2061
|
+
E[V] && z.route !== null && this[qe](z.route);
|
|
2059
2062
|
let D = [];
|
|
2060
2063
|
for (let N = 1; N < k.length; N++) D.push(k[N].index);
|
|
2061
2064
|
D.length > 0 && this[oe](n, {
|
|
@@ -2092,7 +2095,7 @@ var Js = class {
|
|
|
2092
2095
|
}
|
|
2093
2096
|
}
|
|
2094
2097
|
for (; n < r.layers.length; n++) {
|
|
2095
|
-
let l = new
|
|
2098
|
+
let l = new wt();
|
|
2096
2099
|
l.views = [];
|
|
2097
2100
|
for (let a of r.layers[n].models) {
|
|
2098
2101
|
let u = new Ce(a.name, !1, i), f = new Y(null, a);
|
|
@@ -2108,7 +2111,7 @@ var Js = class {
|
|
|
2108
2111
|
for (let c of u.views) {
|
|
2109
2112
|
let h = !1;
|
|
2110
2113
|
if (r !== null ? (h = c.name === e && c[B]?.view === r, h && s !== -1 && (h = c[B]?.index === s)) : h = c.name === e, !!h) {
|
|
2111
|
-
i !== null && (c[
|
|
2114
|
+
i !== null && (c[ue] = {
|
|
2112
2115
|
view: i,
|
|
2113
2116
|
index: n,
|
|
2114
2117
|
level: t - 1
|
|
@@ -2129,14 +2132,14 @@ var Js = class {
|
|
|
2129
2132
|
level: t - 1
|
|
2130
2133
|
});
|
|
2131
2134
|
let a = new Ce(e, !0, o);
|
|
2132
|
-
if (a[
|
|
2133
|
-
let u = new
|
|
2135
|
+
if (a[ue] = l, t == this[U].layers.length) {
|
|
2136
|
+
let u = new wt();
|
|
2134
2137
|
u.views = [a], this[U].layers.push(u);
|
|
2135
2138
|
} else this[U].layers[t].views.push(a);
|
|
2136
2139
|
return a;
|
|
2137
2140
|
}
|
|
2138
|
-
},
|
|
2139
|
-
[
|
|
2141
|
+
}, Ne = /* @__PURE__ */ Symbol("rk"), jt = /* @__PURE__ */ Symbol("vd"), Sr = /* @__PURE__ */ Symbol("rv"), kt = /* @__PURE__ */ Symbol("rvi"), xr = /* @__PURE__ */ Symbol("pv"), Tt = /* @__PURE__ */ Symbol("pvi"), Le = /* @__PURE__ */ Symbol("registerKey"), Mt = /* @__PURE__ */ Symbol("parentKey"), Ut = /* @__PURE__ */ Symbol("lc"), Gs = class {
|
|
2142
|
+
[Le] = /* @__PURE__ */ new Map();
|
|
2140
2143
|
[Mt] = null;
|
|
2141
2144
|
get parent() {
|
|
2142
2145
|
return this[Mt]?.deref() ?? null;
|
|
@@ -2147,19 +2150,19 @@ var Js = class {
|
|
|
2147
2150
|
constructor() {
|
|
2148
2151
|
}
|
|
2149
2152
|
set(e, t) {
|
|
2150
|
-
this[
|
|
2153
|
+
this[Le].set(e, t);
|
|
2151
2154
|
}
|
|
2152
2155
|
get(e) {
|
|
2153
|
-
return this[
|
|
2156
|
+
return this[Le].get(e);
|
|
2154
2157
|
}
|
|
2155
2158
|
has(e) {
|
|
2156
|
-
return this[
|
|
2159
|
+
return this[Le].has(e);
|
|
2157
2160
|
}
|
|
2158
2161
|
delete(e) {
|
|
2159
|
-
return this[
|
|
2162
|
+
return this[Le].delete(e);
|
|
2160
2163
|
}
|
|
2161
|
-
}, re = /* @__PURE__ */ new WeakMap(),
|
|
2162
|
-
function
|
|
2164
|
+
}, re = /* @__PURE__ */ new WeakMap(), He = [];
|
|
2165
|
+
function lt(e, t = !1) {
|
|
2163
2166
|
let r = e ? re.get(e) ?? null : null;
|
|
2164
2167
|
if (t && !r) {
|
|
2165
2168
|
r = new Gs(), e && re.set(e, r), Pe(() => {
|
|
@@ -2170,26 +2173,26 @@ function at(e, t = !1) {
|
|
|
2170
2173
|
}
|
|
2171
2174
|
return r;
|
|
2172
2175
|
}
|
|
2173
|
-
function
|
|
2176
|
+
function ht(e) {
|
|
2174
2177
|
let t = e ? re.get(e) ?? null : null;
|
|
2175
|
-
if (!t && xe() && (t = L(Ut, null)), !t &&
|
|
2176
|
-
const r =
|
|
2177
|
-
t =
|
|
2178
|
+
if (!t && xe() && (t = L(Ut, null)), !t && He.length > 0) {
|
|
2179
|
+
const r = He.length - 1;
|
|
2180
|
+
t = He[r];
|
|
2178
2181
|
}
|
|
2179
2182
|
return t;
|
|
2180
2183
|
}
|
|
2181
2184
|
async function Xs(e, t) {
|
|
2182
|
-
|
|
2185
|
+
He.push(e);
|
|
2183
2186
|
try {
|
|
2184
2187
|
return await t();
|
|
2185
2188
|
} finally {
|
|
2186
|
-
|
|
2189
|
+
He.pop();
|
|
2187
2190
|
}
|
|
2188
2191
|
}
|
|
2189
2192
|
function Vi(e) {
|
|
2190
2193
|
const t = Kr();
|
|
2191
2194
|
if (!t) return !1;
|
|
2192
|
-
const r =
|
|
2195
|
+
const r = ht();
|
|
2193
2196
|
if (!r) return !1;
|
|
2194
2197
|
if (re.set(t, r), Array.isArray(e))
|
|
2195
2198
|
for (let s = 0; s < e.length; s++) e[s] && typeof e[s] == "object" && re.set(e[s], r);
|
|
@@ -2199,25 +2202,25 @@ function Vi(e) {
|
|
|
2199
2202
|
}), !0;
|
|
2200
2203
|
}
|
|
2201
2204
|
function zr(e, t) {
|
|
2202
|
-
const r =
|
|
2205
|
+
const r = ht(e);
|
|
2203
2206
|
if (!r) return null;
|
|
2204
2207
|
let s = r;
|
|
2205
2208
|
for (; s && !s.has(t); ) s = s.parent;
|
|
2206
2209
|
return s?.get(t) ?? null;
|
|
2207
2210
|
}
|
|
2208
2211
|
function Wi(e, t, r) {
|
|
2209
|
-
|
|
2212
|
+
ht(e)?.set(t, r);
|
|
2210
2213
|
}
|
|
2211
2214
|
function zi(e, t, r) {
|
|
2212
|
-
|
|
2215
|
+
ht(e)?.delete(t);
|
|
2213
2216
|
}
|
|
2214
|
-
var
|
|
2217
|
+
var ct = /* @__PURE__ */ Symbol("hooksKey");
|
|
2215
2218
|
function Qs(e) {
|
|
2216
|
-
let t = e.get(
|
|
2217
|
-
t || (t = [], e.set(
|
|
2219
|
+
let t = e.get(ct);
|
|
2220
|
+
t || (t = [], e.set(ct, t));
|
|
2218
2221
|
}
|
|
2219
2222
|
function Pr(e, t) {
|
|
2220
|
-
const r = e.get(
|
|
2223
|
+
const r = e.get(ct);
|
|
2221
2224
|
r != null && Xs(e, async () => {
|
|
2222
2225
|
for (let s = r.length - 1; s >= 0; s--) {
|
|
2223
2226
|
let i = r[s];
|
|
@@ -2256,7 +2259,7 @@ function ei(e, t, r) {
|
|
|
2256
2259
|
}
|
|
2257
2260
|
function Jr(e) {
|
|
2258
2261
|
return (t) => {
|
|
2259
|
-
const r = zr(null,
|
|
2262
|
+
const r = zr(null, ct);
|
|
2260
2263
|
r && (Pe(() => {
|
|
2261
2264
|
ei(r, e, t);
|
|
2262
2265
|
}), Ys(r, e, t));
|
|
@@ -2352,7 +2355,7 @@ function be(e, t) {
|
|
|
2352
2355
|
e.classList.remove(t);
|
|
2353
2356
|
}
|
|
2354
2357
|
var vi = Re && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : setTimeout;
|
|
2355
|
-
function
|
|
2358
|
+
function yt(e) {
|
|
2356
2359
|
vi(e);
|
|
2357
2360
|
}
|
|
2358
2361
|
function C(e, t) {
|
|
@@ -2387,7 +2390,7 @@ function es(e, t, r = -1, s, i, n) {
|
|
|
2387
2390
|
]));
|
|
2388
2391
|
};
|
|
2389
2392
|
a.forEach((f) => {
|
|
2390
|
-
|
|
2393
|
+
ut(e, f, u), o.push({
|
|
2391
2394
|
type: f,
|
|
2392
2395
|
listener: u
|
|
2393
2396
|
});
|
|
@@ -2401,17 +2404,17 @@ function es(e, t, r = -1, s, i, n) {
|
|
|
2401
2404
|
r
|
|
2402
2405
|
]));
|
|
2403
2406
|
};
|
|
2404
|
-
|
|
2407
|
+
ut(e, a, u), o.push({
|
|
2405
2408
|
type: a,
|
|
2406
2409
|
listener: u
|
|
2407
2410
|
});
|
|
2408
2411
|
}
|
|
2409
2412
|
}
|
|
2410
|
-
function
|
|
2411
|
-
return !Re || e === null ? !1 : e.opsType ===
|
|
2413
|
+
function dt(e) {
|
|
2414
|
+
return !Re || e === null ? !1 : e.opsType === F.Append || e.opsType === F.Open;
|
|
2412
2415
|
}
|
|
2413
2416
|
function ts(e, t, r = {}, s, i = -1) {
|
|
2414
|
-
if (e ||
|
|
2417
|
+
if (e || dt(s)) {
|
|
2415
2418
|
const n = Xr(r, e);
|
|
2416
2419
|
n && Se(t, n);
|
|
2417
2420
|
const o = Qr(r, e);
|
|
@@ -2424,7 +2427,7 @@ function ts(e, t, r = {}, s, i = -1) {
|
|
|
2424
2427
|
}
|
|
2425
2428
|
}
|
|
2426
2429
|
function rs(e, t, r = {}, s, i, n, o) {
|
|
2427
|
-
if (!
|
|
2430
|
+
if (!dt(i) && !e) {
|
|
2428
2431
|
b(o) && o(o, [t]);
|
|
2429
2432
|
return;
|
|
2430
2433
|
}
|
|
@@ -2433,7 +2436,7 @@ function rs(e, t, r = {}, s, i, n, o) {
|
|
|
2433
2436
|
b(o) && o(o, [t]);
|
|
2434
2437
|
return;
|
|
2435
2438
|
}
|
|
2436
|
-
|
|
2439
|
+
yt(() => {
|
|
2437
2440
|
es(t, i, n, s, () => {
|
|
2438
2441
|
a && be(t, a), u && be(t, u), b(c) && C(c, [
|
|
2439
2442
|
t,
|
|
@@ -2457,7 +2460,7 @@ function rs(e, t, r = {}, s, i, n, o) {
|
|
|
2457
2460
|
});
|
|
2458
2461
|
}
|
|
2459
2462
|
function ss(e, t, r = {}, s, i = -1) {
|
|
2460
|
-
if (e ||
|
|
2463
|
+
if (e || dt(s)) {
|
|
2461
2464
|
const n = Zr(r, e);
|
|
2462
2465
|
n && Se(t, n);
|
|
2463
2466
|
const o = Yr(r, e);
|
|
@@ -2470,7 +2473,7 @@ function ss(e, t, r = {}, s, i = -1) {
|
|
|
2470
2473
|
}
|
|
2471
2474
|
}
|
|
2472
2475
|
function is(e, t, r = {}, s, i, n, o, l) {
|
|
2473
|
-
if (!
|
|
2476
|
+
if (!dt(n) && !e) {
|
|
2474
2477
|
b(l) && C(l, [t]), !e && b(i) && i();
|
|
2475
2478
|
return;
|
|
2476
2479
|
}
|
|
@@ -2479,7 +2482,7 @@ function is(e, t, r = {}, s, i, n, o, l) {
|
|
|
2479
2482
|
b(l) && C(l, [t]), !e && b(i) && i();
|
|
2480
2483
|
return;
|
|
2481
2484
|
}
|
|
2482
|
-
|
|
2485
|
+
yt(() => {
|
|
2483
2486
|
es(t, n, o, s, () => {
|
|
2484
2487
|
try {
|
|
2485
2488
|
u && be(t, u), f && be(t, f), b(h) && C(h, [
|
|
@@ -2553,7 +2556,7 @@ function pi(e, t = {}, r, s, i, n) {
|
|
|
2553
2556
|
} else b(n) && C(n, []);
|
|
2554
2557
|
}
|
|
2555
2558
|
function gi(e) {
|
|
2556
|
-
|
|
2559
|
+
yt(() => {
|
|
2557
2560
|
for (let t = 0; t < e.length; t++) Reflect.apply(e[t], null, []);
|
|
2558
2561
|
});
|
|
2559
2562
|
}
|
|
@@ -2562,17 +2565,17 @@ function os(e, t = {}, r, s = -1) {
|
|
|
2562
2565
|
mode: t.mode ?? "default",
|
|
2563
2566
|
persisted: !1,
|
|
2564
2567
|
beforeEnter: (i) => {
|
|
2565
|
-
|
|
2568
|
+
Ve(ti, {}, i);
|
|
2566
2569
|
},
|
|
2567
2570
|
enter: (i) => {
|
|
2568
|
-
|
|
2571
|
+
Ve(ri, {}, i);
|
|
2569
2572
|
},
|
|
2570
2573
|
leave: (i, n) => {
|
|
2571
|
-
|
|
2574
|
+
Ve(si, {}, i), yt(() => {
|
|
2572
2575
|
const o = (l) => {
|
|
2573
2576
|
(l.target || l.srcElement) === l.currentTarget && (Xt(i, Bt, o), n && Reflect.apply(n, null, []), e.transition = null);
|
|
2574
2577
|
};
|
|
2575
|
-
|
|
2578
|
+
ut(i, Bt, o), Ve(ii, {}, i);
|
|
2576
2579
|
});
|
|
2577
2580
|
},
|
|
2578
2581
|
clone: (i) => os(e, t, r, s)
|
|
@@ -2785,14 +2788,14 @@ var wi = class {
|
|
|
2785
2788
|
}
|
|
2786
2789
|
},
|
|
2787
2790
|
setup(e, t) {
|
|
2788
|
-
const r = Kr(), s = e.multi === !0, i = L(
|
|
2791
|
+
const r = Kr(), s = e.multi === !0, i = L(Ne, null), n = L(jt, 0), o = L(Sr, null), l = L(kt, -1);
|
|
2789
2792
|
let a = null, u = e.modelSlot ?? null;
|
|
2790
2793
|
if (u) {
|
|
2791
2794
|
if (Z(jt, n + 1), Z(kt, u.index), Z(Tt, u.index), !u.route) {
|
|
2792
2795
|
console.warn("[Fox]child view render error, route not exist");
|
|
2793
2796
|
return;
|
|
2794
2797
|
}
|
|
2795
|
-
const c =
|
|
2798
|
+
const c = lt(u, !0);
|
|
2796
2799
|
c && (Qs(c), Fr(c, () => u?.route ?? null));
|
|
2797
2800
|
} else {
|
|
2798
2801
|
if (i == null) {
|
|
@@ -2804,7 +2807,7 @@ var wi = class {
|
|
|
2804
2807
|
Z(xr, a);
|
|
2805
2808
|
const d = a[V] === !0;
|
|
2806
2809
|
if (d && Z(Sr, a), !s && (Z(kt, -1), Z(jt, n + 1), Z(Tt, -1), d && r)) {
|
|
2807
|
-
const v =
|
|
2810
|
+
const v = lt(r, !0);
|
|
2808
2811
|
v && Fr(v, () => {
|
|
2809
2812
|
const w = a?.slots.value ?? [];
|
|
2810
2813
|
return w.length > 0 ? w[0].route : null;
|
|
@@ -2823,24 +2826,24 @@ var wi = class {
|
|
|
2823
2826
|
for (let m = 0; m < y.length; m++) {
|
|
2824
2827
|
const p = y[m], $ = `${e.name}_${p.index}`, K = te(e.transition, p.route, m) ?? !0, _e = { modelSlot: p };
|
|
2825
2828
|
let j;
|
|
2826
|
-
t.slots.default ? j =
|
|
2829
|
+
t.slots.default ? j = ae(Wt, _e, { default: t.slots.default }) : j = ae(Wt, _e);
|
|
2827
2830
|
const E = {}, se = te(e.viewClass, p.route, m);
|
|
2828
2831
|
typeof se == "string" && se.length > 0 && (E[se] = !0);
|
|
2829
2832
|
const Q = te(e.viewActiveClass, p.route, m), k = te(e.viewInactiveClass, p.route, m), z = f.value.get($);
|
|
2830
2833
|
if (typeof Q == "string" && Q.length > 0 && (E[Q] = p.active), typeof k == "string" && k.length > 0 && (E[k] = !p.active), z && p.active !== z.state) {
|
|
2831
|
-
const
|
|
2834
|
+
const he = z.node;
|
|
2832
2835
|
p.active ? d.unshift(() => {
|
|
2833
|
-
const
|
|
2834
|
-
const Fe =
|
|
2836
|
+
const vt = () => {
|
|
2837
|
+
const Fe = lt(p);
|
|
2835
2838
|
Fe != null && Pr(Fe, _r.ACTIVATED);
|
|
2836
2839
|
};
|
|
2837
|
-
mi(
|
|
2840
|
+
mi(he, e, p.route, m, K, vt);
|
|
2838
2841
|
}) : d.push(() => {
|
|
2839
|
-
const
|
|
2840
|
-
const Fe =
|
|
2842
|
+
const vt = () => {
|
|
2843
|
+
const Fe = lt(p);
|
|
2841
2844
|
Fe != null && Pr(Fe, _r.INACTIVATED);
|
|
2842
2845
|
};
|
|
2843
|
-
pi(
|
|
2846
|
+
pi(he, e, p.route, m, K, vt);
|
|
2844
2847
|
});
|
|
2845
2848
|
}
|
|
2846
2849
|
const D = {
|
|
@@ -2848,19 +2851,19 @@ var wi = class {
|
|
|
2848
2851
|
key: $
|
|
2849
2852
|
}, N = te(e.viewTagProps, p.route, m);
|
|
2850
2853
|
if (N !== null && typeof N == "object") {
|
|
2851
|
-
const
|
|
2852
|
-
q(!0, D,
|
|
2854
|
+
const he = me(N, i?.propsFilter);
|
|
2855
|
+
q(!0, D, he);
|
|
2853
2856
|
}
|
|
2854
2857
|
if (p.route?.viewTagAttrs && typeof p.route?.viewTagAttrs == "object") {
|
|
2855
|
-
const
|
|
2856
|
-
q(!0, D,
|
|
2858
|
+
const he = me(p.route.viewTagAttrs, i?.propsFilter);
|
|
2859
|
+
q(!0, D, he);
|
|
2857
2860
|
}
|
|
2858
|
-
const as = te(e.viewTag, p.route, m),
|
|
2859
|
-
c.set($, new wi(
|
|
2861
|
+
const as = te(e.viewTag, p.route, m), ce = ae(as, D, { default: () => [j] });
|
|
2862
|
+
c.set($, new wi(ce, p.active)), f.value.delete($), K === !0 ? ce.transition = Vt(ce, e, p.route, m) : K === "custom" && (ce.transition = os(ce, e, p.route, m)), h.push(ce);
|
|
2860
2863
|
}
|
|
2861
2864
|
f.value = c, gi(d);
|
|
2862
2865
|
const v = te(e.tag, null, -1), w = {};
|
|
2863
|
-
return Object.assign(w, t.attrs),
|
|
2866
|
+
return Object.assign(w, t.attrs), ae(v, w, { default: () => h });
|
|
2864
2867
|
} else if (u != null) {
|
|
2865
2868
|
const c = u.model, h = {};
|
|
2866
2869
|
if (c.props) {
|
|
@@ -2872,7 +2875,7 @@ var wi = class {
|
|
|
2872
2875
|
q(!1, h, d);
|
|
2873
2876
|
}
|
|
2874
2877
|
}
|
|
2875
|
-
const y =
|
|
2878
|
+
const y = ae(c.component, h);
|
|
2876
2879
|
return Lt(t.slots.default, {
|
|
2877
2880
|
Component: y,
|
|
2878
2881
|
route: u.route
|
|
@@ -2890,7 +2893,7 @@ var wi = class {
|
|
|
2890
2893
|
q(!1, v, m);
|
|
2891
2894
|
}
|
|
2892
2895
|
}
|
|
2893
|
-
const w =
|
|
2896
|
+
const w = ae(d.component, v);
|
|
2894
2897
|
return (te(e.transition, y, -1) ?? !0) && (w.transition = Vt(w, e, y, -1)), Lt(t.slots.default, {
|
|
2895
2898
|
Component: w,
|
|
2896
2899
|
route: y
|
|
@@ -2962,7 +2965,7 @@ var Si = $r({
|
|
|
2962
2965
|
}
|
|
2963
2966
|
},
|
|
2964
2967
|
setup(e, t) {
|
|
2965
|
-
const r = L(
|
|
2968
|
+
const r = L(Ne, null);
|
|
2966
2969
|
return () => {
|
|
2967
2970
|
let s = pe(e.to, null), i = pe(e.tag, s);
|
|
2968
2971
|
if (i == null) {
|
|
@@ -2974,7 +2977,7 @@ var Si = $r({
|
|
|
2974
2977
|
let l = {}, a = pe(e.activeClass, n);
|
|
2975
2978
|
if (typeof a == "string" && a.length > 0 && (l[a] = Ri(n, o)), pe(e.exact, n) === !0) {
|
|
2976
2979
|
let c = pe(e.exactActiveClass, n);
|
|
2977
|
-
typeof c == "string" && c.length > 0 && (l[c] =
|
|
2980
|
+
typeof c == "string" && c.length > 0 && (l[c] = x.isSamePathForRoute(n, o));
|
|
2978
2981
|
}
|
|
2979
2982
|
let u = { class: l };
|
|
2980
2983
|
(i === "a" || i === "A") && (u.href = n?.path ?? n?.name ?? "#"), q(!0, u, t.attrs);
|
|
@@ -2993,7 +2996,7 @@ var Si = $r({
|
|
|
2993
2996
|
};
|
|
2994
2997
|
u[f] = c;
|
|
2995
2998
|
}
|
|
2996
|
-
return
|
|
2999
|
+
return ae(i, u, t.slots);
|
|
2997
3000
|
};
|
|
2998
3001
|
}
|
|
2999
3002
|
}), ge = /* @__PURE__ */ Symbol("registerKey"), xi = class {
|
|
@@ -3051,7 +3054,7 @@ var Si = $r({
|
|
|
3051
3054
|
for (let s = 0; s < r.length; ) {
|
|
3052
3055
|
let i = r[s];
|
|
3053
3056
|
if (i.policy == 1 ? r.splice(s, 1) : s++, typeof i.callback == "function") try {
|
|
3054
|
-
|
|
3057
|
+
Oe(() => {
|
|
3055
3058
|
Reflect.apply(i.callback, {}, t);
|
|
3056
3059
|
});
|
|
3057
3060
|
} catch (n) {
|
|
@@ -3148,7 +3151,7 @@ var qr = class {
|
|
|
3148
3151
|
return this._query;
|
|
3149
3152
|
}
|
|
3150
3153
|
get head() {
|
|
3151
|
-
return
|
|
3154
|
+
return Be().head;
|
|
3152
3155
|
}
|
|
3153
3156
|
_cssMountPoint = null;
|
|
3154
3157
|
set cssMountPoint(e) {
|
|
@@ -3180,7 +3183,7 @@ var qr = class {
|
|
|
3180
3183
|
return t && Fi(t.status) ? t.type === Ar.factory && typeof t.exports == "function" ? t.exports() : t.exports : null;
|
|
3181
3184
|
}
|
|
3182
3185
|
exposeRequire(e = "__foxRequire", t, r) {
|
|
3183
|
-
const s = t ??
|
|
3186
|
+
const s = t ?? _();
|
|
3184
3187
|
return s && typeof s == "object" ? (s[e] = (i) => {
|
|
3185
3188
|
const n = this.getModuleExports(i);
|
|
3186
3189
|
return r && !n && console.error(`[Fox] module:${i}, not found!`), n;
|
|
@@ -3241,7 +3244,7 @@ var qr = class {
|
|
|
3241
3244
|
} catch (f) {
|
|
3242
3245
|
console.error(f), r(f);
|
|
3243
3246
|
}
|
|
3244
|
-
}), l = new
|
|
3247
|
+
}), l = new ft();
|
|
3245
3248
|
for (let a = 0; a < s.length; a++) {
|
|
3246
3249
|
const u = new qi(a, s[a], o);
|
|
3247
3250
|
this.mount(l, u);
|
|
@@ -3317,7 +3320,7 @@ var qr = class {
|
|
|
3317
3320
|
t.progress.work(!0, t.index, n), s.resolve();
|
|
3318
3321
|
return;
|
|
3319
3322
|
}
|
|
3320
|
-
const o =
|
|
3323
|
+
const o = Be(), l = o.createElement("link"), a = "onload" in l;
|
|
3321
3324
|
a && (l.onload = () => {
|
|
3322
3325
|
l.onload = null, l.onerror = null, t.progress.work(!0, t.index, i.path), s.resolve();
|
|
3323
3326
|
}, l.onerror = () => {
|
|
@@ -3345,7 +3348,7 @@ var qr = class {
|
|
|
3345
3348
|
status: X.Loading
|
|
3346
3349
|
};
|
|
3347
3350
|
this.moduleManager.set(i.path, o);
|
|
3348
|
-
const l =
|
|
3351
|
+
const l = Be().createElement("script");
|
|
3349
3352
|
if ("onload" in l)
|
|
3350
3353
|
l.onload = () => {
|
|
3351
3354
|
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 +3368,7 @@ var qr = class {
|
|
|
3365
3368
|
}
|
|
3366
3369
|
const a = this.constructResourceUri(i.path);
|
|
3367
3370
|
l.defer = !0, l.src = a;
|
|
3368
|
-
const u =
|
|
3371
|
+
const u = _(), f = this.createRequireLoad();
|
|
3369
3372
|
u.__require = u.__require ?? u.require, u.require = f;
|
|
3370
3373
|
const c = this.createDefine(o, f, t);
|
|
3371
3374
|
u.__define = u.__define ?? u.define, u.define = c, typeof t.progress.finalCallback != "function" && (t.progress.finalCallback = function() {
|
|
@@ -3382,7 +3385,7 @@ var qr = class {
|
|
|
3382
3385
|
}
|
|
3383
3386
|
try {
|
|
3384
3387
|
let n = await Ei(s.path);
|
|
3385
|
-
if (Zt(n) && (n = n.default ?? n),
|
|
3388
|
+
if (Zt(n) && (n = n.default ?? n), Ue(n)) {
|
|
3386
3389
|
t.progress.work(!1, t.index, n), r.resolve();
|
|
3387
3390
|
return;
|
|
3388
3391
|
}
|
|
@@ -3401,7 +3404,7 @@ var qr = class {
|
|
|
3401
3404
|
unmount(e) {
|
|
3402
3405
|
let t = "", r = "";
|
|
3403
3406
|
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 =
|
|
3407
|
+
const s = Be();
|
|
3405
3408
|
if (r === "umd") {
|
|
3406
3409
|
let i = s.getElementById(t);
|
|
3407
3410
|
i || (i = s.querySelector(`script[src="${t}"]`)), i && i.remove();
|
|
@@ -3525,7 +3528,7 @@ function Xi(e = {}) {
|
|
|
3525
3528
|
return s;
|
|
3526
3529
|
},
|
|
3527
3530
|
get EventChain() {
|
|
3528
|
-
return
|
|
3531
|
+
return ft;
|
|
3529
3532
|
},
|
|
3530
3533
|
get Require() {
|
|
3531
3534
|
return qr;
|
|
@@ -3537,7 +3540,7 @@ function Xi(e = {}) {
|
|
|
3537
3540
|
return Zt;
|
|
3538
3541
|
},
|
|
3539
3542
|
install(o, l = {}) {
|
|
3540
|
-
o.provide(
|
|
3543
|
+
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(_i, Si)), l.optionsApi !== !1 && (Reflect.defineProperty(o.config.globalProperties, "$fox", { get() {
|
|
3541
3544
|
return n;
|
|
3542
3545
|
} }), Reflect.defineProperty(o.config.globalProperties, "$router", { get() {
|
|
3543
3546
|
return t;
|
|
@@ -3570,7 +3573,7 @@ function Xi(e = {}) {
|
|
|
3570
3573
|
return n;
|
|
3571
3574
|
}
|
|
3572
3575
|
function ls(e) {
|
|
3573
|
-
return xe() ? L(
|
|
3576
|
+
return xe() ? L(Ne, null) : e ? e.$?.appContext?.provides?.[Ne] ?? null : null;
|
|
3574
3577
|
}
|
|
3575
3578
|
function $i(e) {
|
|
3576
3579
|
let t = Cr(e);
|
|
@@ -3628,15 +3631,15 @@ function tn(e) {
|
|
|
3628
3631
|
}
|
|
3629
3632
|
export {
|
|
3630
3633
|
ar as Bus,
|
|
3631
|
-
|
|
3634
|
+
ft as EventChain,
|
|
3632
3635
|
Er as EventProxy,
|
|
3633
3636
|
ti as FoxBeforeEnter,
|
|
3634
3637
|
si as FoxBeforeLeave,
|
|
3635
3638
|
ri as FoxEnter,
|
|
3636
3639
|
ii as FoxLeave,
|
|
3637
3640
|
Bt as FoxLeaveEnd,
|
|
3638
|
-
|
|
3639
|
-
|
|
3641
|
+
F as OperationType,
|
|
3642
|
+
x as Route,
|
|
3640
3643
|
Js as Router,
|
|
3641
3644
|
Si as RouterLink,
|
|
3642
3645
|
Wt as RouterView,
|
|
@@ -3649,14 +3652,14 @@ export {
|
|
|
3649
3652
|
Ui as destroyState,
|
|
3650
3653
|
q as extend,
|
|
3651
3654
|
zr as injectContextValue,
|
|
3652
|
-
|
|
3655
|
+
ht as injectLifecycleContext,
|
|
3653
3656
|
sr as isArray,
|
|
3654
3657
|
Ti as isDate,
|
|
3655
3658
|
Zt as isESModule,
|
|
3656
3659
|
nr as isEqual,
|
|
3657
3660
|
b as isFunction,
|
|
3658
3661
|
ji as isMap,
|
|
3659
|
-
|
|
3662
|
+
Ue as isNil,
|
|
3660
3663
|
ps as isObject,
|
|
3661
3664
|
ws as isPlainObject,
|
|
3662
3665
|
Ii as isPromise,
|