@fox-js/fox 3.1.1-25 → 3.1.1-26
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 +31 -19
- package/libs/index.esm.js +540 -533
- package/libs/index.umd.js +1 -1
- package/package.json +1 -1
package/libs/index.esm.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
var
|
|
1
|
+
import { defineComponent as Kr, effectScope as fs, getCurrentScope as jr, h as he, hasInjectionContext as _e, inject as N, onActivated as cs, onDeactivated as hs, onScopeDispose as Fe, provide as te, reactive as ys, readonly as ds, ref as ms, shallowReactive as vs, shallowRef as Lr, toRaw as Dt, watch as ps } from "vue";
|
|
2
|
+
var Ee = typeof window < "u", C = function() {
|
|
3
3
|
return window;
|
|
4
|
-
},
|
|
4
|
+
}, Je = function() {
|
|
5
5
|
return window.document;
|
|
6
6
|
};
|
|
7
|
-
function
|
|
7
|
+
function ft(e, t, r, s = !1) {
|
|
8
8
|
e.addEventListener ? e.addEventListener(t, r, s) : e.attachEvent ? e.attachEvent(`on${t}`, r) : e[`on${t}`] = r;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function Qt(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 ze = (e, t, r) => {
|
|
14
14
|
t = t ?? {
|
|
15
15
|
bubbles: !1,
|
|
16
16
|
cancelable: !1,
|
|
@@ -20,12 +20,12 @@ 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
|
-
},
|
|
24
|
-
function
|
|
23
|
+
}, nr = Array.isArray, ji = (e) => Zt(e) === "[object Map]", Li = (e) => Zt(e) === "[object Set]", Mi = (e) => e instanceof Date, b = (e) => typeof e == "function", Ti = (e) => typeof e == "string", ki = (e) => typeof e == "symbol", gs = (e) => e !== null && typeof e == "object", Ii = (e) => gs(e) && b(e.then) && b(e.catch), We = (e) => e == null, ws = Object.prototype.toString, Zt = (e) => ws.call(e), bs = (e) => Zt(e) === "[object Object]", Rs = typeof Symbol == "function" && typeof Symbol.toStringTag == "symbol";
|
|
24
|
+
function Yt(e) {
|
|
25
25
|
return e.__esModule || Rs && e[Symbol.toStringTag] === "Module";
|
|
26
26
|
}
|
|
27
27
|
var xs = typeof Promise < "u" && Promise.toString().indexOf("[native code]") !== -1;
|
|
28
|
-
function
|
|
28
|
+
function K(...e) {
|
|
29
29
|
let t = e[0] !== void 0 && e[0] !== null ? e[0] : {}, r = 1, s = e.length, i = !1;
|
|
30
30
|
for (typeof t == "boolean" && (i = t, t = e[r] ?? {}, r++), typeof t != "object" && (t = {}); r < s; r++) if (e[r] !== null && e[r] !== void 0) {
|
|
31
31
|
let n = e[r];
|
|
@@ -34,13 +34,13 @@ function $(...e) {
|
|
|
34
34
|
if (u !== l)
|
|
35
35
|
if (i === !0 && l && typeof l == "object") {
|
|
36
36
|
let a;
|
|
37
|
-
Array.isArray(l) ? a = u && Array.isArray(u) ? u : [] : a = u && typeof u == "object" ? u : {}, t[o] =
|
|
37
|
+
Array.isArray(l) ? a = u && Array.isArray(u) ? u : [] : a = u && typeof u == "object" ? u : {}, t[o] = K(i, a, l);
|
|
38
38
|
} else l !== void 0 && (t[o] = l);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
return t;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function Mr(e, t, r = !1) {
|
|
44
44
|
if (typeof t != "object") return {};
|
|
45
45
|
typeof e != "object" && (e = {});
|
|
46
46
|
for (let s of Reflect.ownKeys(t)) {
|
|
@@ -48,7 +48,7 @@ function qr(e, t, r = !1) {
|
|
|
48
48
|
if (i !== n)
|
|
49
49
|
if (typeof n == "object") {
|
|
50
50
|
if (!Array.isArray(n) && !bs(n)) continue;
|
|
51
|
-
i =
|
|
51
|
+
i = Mr(i, n, r), e[s] = i;
|
|
52
52
|
} else {
|
|
53
53
|
if (typeof n == "function") continue;
|
|
54
54
|
e[s] = n;
|
|
@@ -56,21 +56,21 @@ function qr(e, t, r = !1) {
|
|
|
56
56
|
}
|
|
57
57
|
return e;
|
|
58
58
|
}
|
|
59
|
-
var
|
|
59
|
+
var De = class Ht {
|
|
60
60
|
static seed = (/* @__PURE__ */ new Date()).getTime();
|
|
61
61
|
static get() {
|
|
62
|
-
let t = ++
|
|
63
|
-
return t >= Number.MAX_VALUE && (
|
|
62
|
+
let t = ++Ht.seed;
|
|
63
|
+
return t >= Number.MAX_VALUE && (Ht.seed = 0), t;
|
|
64
64
|
}
|
|
65
|
-
},
|
|
66
|
-
function
|
|
67
|
-
|
|
65
|
+
}, gt = xs ? Promise.resolve() : null;
|
|
66
|
+
function He(e, ...t) {
|
|
67
|
+
gt !== null ? t && t.length > 0 ? gt.then(() => {
|
|
68
68
|
e(t);
|
|
69
|
-
}) :
|
|
69
|
+
}) : gt.then(e) : t && t.length > 0 ? setTimeout(() => {
|
|
70
70
|
e(t);
|
|
71
71
|
}) : setTimeout(e);
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function Tr(e) {
|
|
74
74
|
return e == null ? !1 : typeof e == "boolean" ? e : typeof e == "string" ? e.toLocaleLowerCase() === "true" : !!e;
|
|
75
75
|
}
|
|
76
76
|
function Oi(e) {
|
|
@@ -86,46 +86,46 @@ var Ss = {
|
|
|
86
86
|
"[object RegExp]": "regExp",
|
|
87
87
|
"[object Object]": "object"
|
|
88
88
|
};
|
|
89
|
-
function
|
|
89
|
+
function or(e) {
|
|
90
90
|
let t = Object.prototype.toString.call(e);
|
|
91
91
|
return e == null ? String(e) : Ss[t] || "object";
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function lr(e, t) {
|
|
94
94
|
if (e == t) return !0;
|
|
95
95
|
if (e === void 0 || t === void 0) return !1;
|
|
96
|
-
let r =
|
|
97
|
-
if (r !==
|
|
96
|
+
let r = or(e);
|
|
97
|
+
if (r !== or(t)) return !1;
|
|
98
98
|
if (r === "object") {
|
|
99
99
|
let s = Object.keys(e), i = Object.keys(t);
|
|
100
100
|
if (s.length !== i.length) return !1;
|
|
101
101
|
for (let n = 0; n < s.length; n++) {
|
|
102
102
|
let o = s[n], u = e[o], l = t[o];
|
|
103
|
-
if (!
|
|
103
|
+
if (!lr(u, l)) return !1;
|
|
104
104
|
}
|
|
105
105
|
return !0;
|
|
106
106
|
} else if (r === "array") {
|
|
107
107
|
if (e.length !== t.length) return !1;
|
|
108
108
|
for (let s = 0; s < e.length; s++) {
|
|
109
109
|
let i = e[s], n = t[s];
|
|
110
|
-
if (!
|
|
110
|
+
if (!lr(i, n)) return !1;
|
|
111
111
|
}
|
|
112
112
|
return !0;
|
|
113
113
|
}
|
|
114
114
|
return !1;
|
|
115
115
|
}
|
|
116
|
-
var
|
|
116
|
+
var kr = (e) => {
|
|
117
117
|
const t = {};
|
|
118
118
|
for (let r of Reflect.ownKeys(e)) {
|
|
119
119
|
let s = e[r];
|
|
120
|
-
s && !Array.isArray(s) && typeof s == "object" && (s =
|
|
120
|
+
s && !Array.isArray(s) && typeof s == "object" && (s = kr(s)), typeof r == "symbol" ? t[String(r)] = s : t[r] = s;
|
|
121
121
|
}
|
|
122
122
|
return t;
|
|
123
|
-
},
|
|
123
|
+
}, Es = /^Symbol\((.*)\)$/, Ir = (e) => {
|
|
124
124
|
const t = {};
|
|
125
125
|
for (let r of Reflect.ownKeys(e)) {
|
|
126
126
|
let s = e[r];
|
|
127
|
-
s && !Array.isArray(s) && typeof s == "object" && (s =
|
|
128
|
-
const i =
|
|
127
|
+
s && !Array.isArray(s) && typeof s == "object" && (s = Ir(s));
|
|
128
|
+
const i = Es.exec(r);
|
|
129
129
|
if (i && i[1]) {
|
|
130
130
|
const n = Symbol.for(i[1]);
|
|
131
131
|
t[n] = s;
|
|
@@ -133,7 +133,7 @@ var $r = (e) => {
|
|
|
133
133
|
}
|
|
134
134
|
return t;
|
|
135
135
|
};
|
|
136
|
-
function
|
|
136
|
+
function Or(e, t) {
|
|
137
137
|
let r = null;
|
|
138
138
|
return function(...s) {
|
|
139
139
|
r && clearTimeout(r), r = setTimeout(() => {
|
|
@@ -141,45 +141,45 @@ function Lr(e, t) {
|
|
|
141
141
|
}, t);
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
-
var
|
|
144
|
+
var ar = /* @__PURE__ */ Symbol("idKey"), me = /* @__PURE__ */ Symbol("valueKey"), R = /* @__PURE__ */ Symbol("childrenKey"), X = /* @__PURE__ */ Symbol("growKey"), Br = class {
|
|
145
145
|
[X] = !0;
|
|
146
|
-
[
|
|
146
|
+
[ar];
|
|
147
147
|
[me] = ms();
|
|
148
148
|
[R] = /* @__PURE__ */ new Map();
|
|
149
149
|
constructor(e) {
|
|
150
|
-
this[
|
|
150
|
+
this[ar] = e;
|
|
151
151
|
}
|
|
152
|
-
},
|
|
152
|
+
}, Ps = class {
|
|
153
153
|
get(e, t) {
|
|
154
154
|
if (t == "value") return e[me].value;
|
|
155
155
|
if (t === "grow") return e[X];
|
|
156
156
|
let r = e[R].get(t);
|
|
157
|
-
if (r) return
|
|
157
|
+
if (r) return Ue(r);
|
|
158
158
|
if (e[X])
|
|
159
|
-
return r =
|
|
159
|
+
return r = tr(t), r[X] = e[X], e[R].set(t, r), Ue(r);
|
|
160
160
|
}
|
|
161
161
|
set(e, t, r) {
|
|
162
|
-
return t == "value" ? (e[me].value = r, !0) : t === "grow" ? (e[X] =
|
|
162
|
+
return t == "value" ? (e[me].value = r, !0) : t === "grow" ? (e[X] = Tr(r), !0) : r == null ? (e[R].delete(t), !0) : (console.error(`[Fox]illegal property:${t}`), !1);
|
|
163
163
|
}
|
|
164
164
|
deleteProperty(e, t) {
|
|
165
165
|
return t === "value" || t == "grow" ? (console.error(`[Fox]can not delete property:${String(t)}`), !1) : (e[R].delete(t), !0);
|
|
166
166
|
}
|
|
167
|
-
},
|
|
168
|
-
function
|
|
169
|
-
const t = new
|
|
170
|
-
return Reflect.set(t,
|
|
167
|
+
}, er = "__proxy__";
|
|
168
|
+
function tr(e) {
|
|
169
|
+
const t = new Br(e);
|
|
170
|
+
return Reflect.set(t, er, new Proxy(t, new Ps())), t;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
173
|
-
return Reflect.get(e,
|
|
172
|
+
function Ue(e) {
|
|
173
|
+
return Reflect.get(e, er);
|
|
174
174
|
}
|
|
175
|
-
var
|
|
175
|
+
var _s = class {
|
|
176
176
|
name = "";
|
|
177
177
|
persistPolicy = "memory";
|
|
178
178
|
storage;
|
|
179
179
|
initFlag = !1;
|
|
180
180
|
state = {};
|
|
181
181
|
constructor(e = {}, t) {
|
|
182
|
-
if (e.persistPolicy && e.persistPolicy !== "memory" &&
|
|
182
|
+
if (e.persistPolicy && e.persistPolicy !== "memory" && We(e.name)) throw new Error("name can not be empty, where persistPolicy is not memory.");
|
|
183
183
|
this.name = e.name ?? "", this.persistPolicy = e.persistPolicy ?? "memory", this.storage = e.storage, t && typeof t == "object" && Object.assign(this.state, t);
|
|
184
184
|
}
|
|
185
185
|
init(e) {
|
|
@@ -189,7 +189,7 @@ var Fs = class {
|
|
|
189
189
|
if (!this.persistPolicy || this.persistPolicy === "memory") return null;
|
|
190
190
|
let e = null;
|
|
191
191
|
if (this.persistPolicy === "custom") e = this.storage;
|
|
192
|
-
else if (
|
|
192
|
+
else if (Ee) {
|
|
193
193
|
const t = C();
|
|
194
194
|
e = this.persistPolicy === "session" ? t.sessionStorage : t.localStorage;
|
|
195
195
|
}
|
|
@@ -251,10 +251,10 @@ var Fs = class {
|
|
|
251
251
|
console.error(e);
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
-
},
|
|
254
|
+
}, Dr = class extends Br {
|
|
255
255
|
_persistHandler;
|
|
256
256
|
constructor(e = {}, t) {
|
|
257
|
-
super("__root__"), this._persistHandler = new
|
|
257
|
+
super("__root__"), this._persistHandler = new _s(e, t), this._persistHandler.init(this);
|
|
258
258
|
}
|
|
259
259
|
put(...e) {
|
|
260
260
|
let t = e.length;
|
|
@@ -263,7 +263,7 @@ var Fs = 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[R].has(i) ? n = r[R].get(i) : (n =
|
|
266
|
+
r[R].has(i) ? n = r[R].get(i) : (n = tr(i), r[R].set(i, n)), r = n;
|
|
267
267
|
}
|
|
268
268
|
return r[me].value = e[t - 1], this._persistHandler.put(e), !0;
|
|
269
269
|
}
|
|
@@ -305,7 +305,7 @@ var Fs = class {
|
|
|
305
305
|
clear() {
|
|
306
306
|
this[R].clear(), this._persistHandler.clear();
|
|
307
307
|
}
|
|
308
|
-
},
|
|
308
|
+
}, Fs = [
|
|
309
309
|
"put",
|
|
310
310
|
"get",
|
|
311
311
|
"contains",
|
|
@@ -313,48 +313,48 @@ var Fs = class {
|
|
|
313
313
|
"clear",
|
|
314
314
|
"_persistHandler"
|
|
315
315
|
];
|
|
316
|
-
function
|
|
317
|
-
return
|
|
316
|
+
function ur(e) {
|
|
317
|
+
return Fs.includes(e);
|
|
318
318
|
}
|
|
319
319
|
var Cs = class {
|
|
320
320
|
get(e, t) {
|
|
321
321
|
if (t == "value") return e[me].value;
|
|
322
322
|
if (t === "grow") return e[X];
|
|
323
323
|
if (t === R) return e[R];
|
|
324
|
-
if (typeof t == "string" &&
|
|
324
|
+
if (typeof t == "string" && ur(t)) return e[t];
|
|
325
325
|
const r = String(t);
|
|
326
326
|
let s = e[R].get(r);
|
|
327
|
-
if (s) return
|
|
327
|
+
if (s) return Ue(s);
|
|
328
328
|
if (e[X])
|
|
329
|
-
return s =
|
|
329
|
+
return s = tr(r), s[X] = e[X], e[R].set(r, s), Ue(s);
|
|
330
330
|
}
|
|
331
331
|
set(e, t, r) {
|
|
332
|
-
return t == "value" ? (e[me].value = r, !0) : t === "grow" ? (e[X] =
|
|
332
|
+
return t == "value" ? (e[me].value = r, !0) : t === "grow" ? (e[X] = Tr(r), !0) : ur(t) ? !1 : r == null ? (e[R].delete(t), !0) : (console.error(`[Fox]illegal property:${t}`), !1);
|
|
333
333
|
}
|
|
334
334
|
deleteProperty(e, t) {
|
|
335
335
|
return t === "value" || t == "grow" ? (console.error(`[Fox]can not delete property:${String(t)}`), !1) : (e[R].delete(t), !0);
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
338
|
function As(e, t) {
|
|
339
|
-
const r = new
|
|
340
|
-
return Reflect.set(r,
|
|
339
|
+
const r = new Dr(e, t), s = new Cs(), i = new Proxy(r, s);
|
|
340
|
+
return Reflect.set(r, er, i), r;
|
|
341
341
|
}
|
|
342
|
-
var
|
|
342
|
+
var fr = new Proxy(Dr, { construct(e, t) {
|
|
343
343
|
const r = t[0] ?? {}, s = t[1];
|
|
344
|
-
return
|
|
345
|
-
} }),
|
|
344
|
+
return Ue(As(r, s));
|
|
345
|
+
} }), rr = (e) => !e || typeof e != "object" ? !0 : Reflect.ownKeys(e).length === 0, Hr = 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" && We(e.name)) throw new Error("name can not be empty, where persistPolicy is not memory.");
|
|
351
351
|
this.name = e.name ?? "", this.persistPolicy = e.persistPolicy ?? "memory", this.storage = e.storage;
|
|
352
352
|
}
|
|
353
353
|
getStorage() {
|
|
354
354
|
if (!this.persistPolicy || this.persistPolicy === "memory") return null;
|
|
355
355
|
let e = null;
|
|
356
356
|
if (this.persistPolicy === "custom") e = this.storage;
|
|
357
|
-
else if (
|
|
357
|
+
else if (Ee) {
|
|
358
358
|
const t = C();
|
|
359
359
|
e = this.persistPolicy === "session" ? t.sessionStorage : t.localStorage;
|
|
360
360
|
}
|
|
@@ -363,7 +363,7 @@ var nr = new Proxy(Tr, { construct(e, t) {
|
|
|
363
363
|
saveState(e) {
|
|
364
364
|
if (!this.persistPolicy || this.persistPolicy === "memory") return;
|
|
365
365
|
let t = this.getStorage();
|
|
366
|
-
if (t === null ||
|
|
366
|
+
if (t === null || rr(e)) return;
|
|
367
367
|
const r = `_state_${this.name}`, s = JSON.stringify(e ?? {});
|
|
368
368
|
t.setItem(r, s);
|
|
369
369
|
}
|
|
@@ -385,46 +385,46 @@ var nr = new Proxy(Tr, { construct(e, t) {
|
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
};
|
|
388
|
-
function
|
|
389
|
-
const s = new
|
|
388
|
+
function Nr(e, t, r) {
|
|
389
|
+
const s = new Hr(r);
|
|
390
390
|
s.restore(t);
|
|
391
391
|
const i = (u) => {
|
|
392
|
-
const l =
|
|
392
|
+
const l = Dt(u), a = {};
|
|
393
393
|
for (let f in l) {
|
|
394
394
|
const c = l[f];
|
|
395
|
-
|
|
395
|
+
We(c) || (a[f] = c);
|
|
396
396
|
}
|
|
397
|
-
|
|
397
|
+
rr(a) ? s.removeState() : s.saveState(a);
|
|
398
398
|
};
|
|
399
399
|
let n = null;
|
|
400
|
-
r && r.debounce === !1 ? n = i : n =
|
|
400
|
+
r && r.debounce === !1 ? n = i : n = Or(i, r && r.debounceDelay ? r.debounceDelay : 250);
|
|
401
401
|
const o = e ? vs(t) : ys(t);
|
|
402
|
-
return
|
|
402
|
+
return fs(!0).run(() => {
|
|
403
403
|
ps(o, (u) => {
|
|
404
|
-
const l =
|
|
404
|
+
const l = Dt(u);
|
|
405
405
|
n(l);
|
|
406
406
|
});
|
|
407
407
|
}), o;
|
|
408
408
|
}
|
|
409
409
|
function Bi(e, t) {
|
|
410
|
-
return
|
|
410
|
+
return Nr(!1, e, t);
|
|
411
411
|
}
|
|
412
412
|
function Di(e, t) {
|
|
413
|
-
return
|
|
413
|
+
return Nr(!0, e, t);
|
|
414
414
|
}
|
|
415
415
|
function qs(e, t) {
|
|
416
|
-
const r = new
|
|
416
|
+
const r = new Hr(t);
|
|
417
417
|
r.restore(e);
|
|
418
418
|
const s = (n) => {
|
|
419
|
-
const o =
|
|
419
|
+
const o = Dt(n), u = {};
|
|
420
420
|
for (let l in o) {
|
|
421
421
|
const a = o[l];
|
|
422
|
-
|
|
422
|
+
We(a) || (u[l] = a);
|
|
423
423
|
}
|
|
424
|
-
|
|
424
|
+
rr(u) ? r.removeState() : r.saveState(u);
|
|
425
425
|
};
|
|
426
426
|
let i = null;
|
|
427
|
-
return t && t.debounce === !1 ? i = s : i =
|
|
427
|
+
return t && t.debounce === !1 ? i = s : i = Or(s, t && t.debounceDelay ? t.debounceDelay : 250), new Proxy(e, {
|
|
428
428
|
get(n, o) {
|
|
429
429
|
return n[o];
|
|
430
430
|
},
|
|
@@ -438,20 +438,20 @@ function Hi(e, t) {
|
|
|
438
438
|
}
|
|
439
439
|
var de = /* @__PURE__ */ (function(e) {
|
|
440
440
|
return e[e.Static = 0] = "Static", e[e.Param = 1] = "Param", e[e.Group = 2] = "Group", e;
|
|
441
|
-
})({}),
|
|
441
|
+
})({}), P = /* @__PURE__ */ (function(e) {
|
|
442
442
|
return e[e.Static = 0] = "Static", e[e.Param = 1] = "Param", e[e.ParamRegExp = 2] = "ParamRegExp", e[e.ParamRegExpEnd = 3] = "ParamRegExpEnd", e[e.EscapeNext = 4] = "EscapeNext", e;
|
|
443
|
-
})(
|
|
443
|
+
})(P || {}), $s = {
|
|
444
444
|
type: de.Static,
|
|
445
445
|
value: ""
|
|
446
|
-
},
|
|
446
|
+
}, Ks = /[a-zA-Z0-9_]/;
|
|
447
447
|
function js(e) {
|
|
448
448
|
if (!e) return [[]];
|
|
449
|
-
if (e === "/") return [[
|
|
449
|
+
if (e === "/") return [[$s]];
|
|
450
450
|
if (!e.startsWith("/")) throw new Error(`Invalid path "${e}"`);
|
|
451
451
|
function t(y) {
|
|
452
452
|
throw new Error(`ERR (${r})/"${a}": ${y}`);
|
|
453
453
|
}
|
|
454
|
-
let r =
|
|
454
|
+
let r = P.Static, s = r;
|
|
455
455
|
const i = [];
|
|
456
456
|
let n;
|
|
457
457
|
function o() {
|
|
@@ -459,10 +459,10 @@ function js(e) {
|
|
|
459
459
|
}
|
|
460
460
|
let u = 0, l, a = "", f = "";
|
|
461
461
|
function c() {
|
|
462
|
-
a && (r ===
|
|
462
|
+
a && (r === P.Static ? n.push({
|
|
463
463
|
type: de.Static,
|
|
464
464
|
value: a
|
|
465
|
-
}) : r ===
|
|
465
|
+
}) : r === P.Param || r === P.ParamRegExp || r === P.ParamRegExpEnd ? (n.length > 1 && (l === "*" || l === "+") && t(`A repeatable param (${a}) must be alone in its segment. eg: '/:ids+.`), n.push({
|
|
466
466
|
type: de.Param,
|
|
467
467
|
value: a,
|
|
468
468
|
regexp: f,
|
|
@@ -474,43 +474,43 @@ function js(e) {
|
|
|
474
474
|
a += l;
|
|
475
475
|
}
|
|
476
476
|
for (; u < e.length; ) {
|
|
477
|
-
if (l = e[u++], l === "\\" && r !==
|
|
478
|
-
s = r, r =
|
|
477
|
+
if (l = e[u++], l === "\\" && r !== P.ParamRegExp) {
|
|
478
|
+
s = r, r = P.EscapeNext;
|
|
479
479
|
continue;
|
|
480
480
|
}
|
|
481
481
|
switch (r) {
|
|
482
|
-
case
|
|
483
|
-
l === "/" ? (a && c(), o()) : l === ":" ? (c(), r =
|
|
482
|
+
case P.Static:
|
|
483
|
+
l === "/" ? (a && c(), o()) : l === ":" ? (c(), r = P.Param) : h();
|
|
484
484
|
break;
|
|
485
|
-
case
|
|
485
|
+
case P.EscapeNext:
|
|
486
486
|
h(), r = s;
|
|
487
487
|
break;
|
|
488
|
-
case
|
|
489
|
-
l === "(" ? r =
|
|
488
|
+
case P.Param:
|
|
489
|
+
l === "(" ? r = P.ParamRegExp : Ks.test(l) ? h() : (c(), r = P.Static, l !== "*" && l !== "?" && l !== "+" && u--);
|
|
490
490
|
break;
|
|
491
|
-
case
|
|
492
|
-
l === ")" ? f[f.length - 1] == "\\" ? f = f.slice(0, -1) + l : r =
|
|
491
|
+
case P.ParamRegExp:
|
|
492
|
+
l === ")" ? f[f.length - 1] == "\\" ? f = f.slice(0, -1) + l : r = P.ParamRegExpEnd : f += l;
|
|
493
493
|
break;
|
|
494
|
-
case
|
|
495
|
-
c(), r =
|
|
494
|
+
case P.ParamRegExpEnd:
|
|
495
|
+
c(), r = P.Static, l !== "*" && l !== "?" && l !== "+" && u--, f = "";
|
|
496
496
|
break;
|
|
497
497
|
default:
|
|
498
498
|
t("Unknown state");
|
|
499
499
|
break;
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
return r ===
|
|
502
|
+
return r === P.ParamRegExp && t(`Unfinished custom RegExp for param "${a}"`), c(), o(), i;
|
|
503
503
|
}
|
|
504
|
-
var
|
|
504
|
+
var cr = "[^/]+?", Ls = {
|
|
505
505
|
sensitive: !1,
|
|
506
506
|
strict: !1,
|
|
507
507
|
start: !0,
|
|
508
508
|
end: !0
|
|
509
509
|
}, J = /* @__PURE__ */ (function(e) {
|
|
510
|
-
return e[e._multiplier = 10] = "_multiplier", e[e.Root =
|
|
510
|
+
return e[e._multiplier = 10] = "_multiplier", e[e.Root = 9 * e._multiplier] = "Root", e[e.Segment = 4 * e._multiplier] = "Segment", e[e.SubSegment = 3 * e._multiplier] = "SubSegment", e[e.Static = 4 * e._multiplier] = "Static", e[e.Dynamic = 2 * e._multiplier] = "Dynamic", e[e.BonusCustomRegExp = 1 * e._multiplier] = "BonusCustomRegExp", e[e.BonusWildcard = -4 * e._multiplier - e.BonusCustomRegExp] = "BonusWildcard", e[e.BonusRepeatable = -2 * e._multiplier] = "BonusRepeatable", e[e.BonusOptional = -0.8 * e._multiplier] = "BonusOptional", e[e.BonusStrict = 0.07 * e._multiplier] = "BonusStrict", e[e.BonusCaseSensitive = 0.025 * e._multiplier] = "BonusCaseSensitive", e;
|
|
511
511
|
})(J || {}), Ms = /[.+*?^${}()[\]/\\]/g;
|
|
512
512
|
function Ts(e, t) {
|
|
513
|
-
const r =
|
|
513
|
+
const r = K(!0, {}, Ls, t), s = [];
|
|
514
514
|
let i = r.start ? "^" : "";
|
|
515
515
|
const n = [];
|
|
516
516
|
for (const a of e) {
|
|
@@ -528,8 +528,8 @@ function Ts(e, t) {
|
|
|
528
528
|
repeatable: m,
|
|
529
529
|
optional: w
|
|
530
530
|
});
|
|
531
|
-
const v = g ||
|
|
532
|
-
if (v !==
|
|
531
|
+
const v = g || cr;
|
|
532
|
+
if (v !== cr) {
|
|
533
533
|
y += J.BonusCustomRegExp;
|
|
534
534
|
try {
|
|
535
535
|
new RegExp(`(${v})`);
|
|
@@ -566,8 +566,8 @@ function Ts(e, t) {
|
|
|
566
566
|
for (const y of h) if (y.type === de.Static) f += y.value;
|
|
567
567
|
else if (y.type === de.Param) {
|
|
568
568
|
const { value: d, repeatable: m, optional: w } = y, g = d in a ? a[d] : "";
|
|
569
|
-
if (
|
|
570
|
-
const v =
|
|
569
|
+
if (nr(g) && !m) throw new Error(`Provided param "${d}" is an array but it is not repeatable (* or + modifiers)`);
|
|
570
|
+
const v = nr(g) ? g.join("/") : g;
|
|
571
571
|
if (!v) if (w)
|
|
572
572
|
h.length < 2 && (f.endsWith("/") ? f = f.slice(0, -1) : c = !0);
|
|
573
573
|
else throw new Error(`Missing required param "${d}"`);
|
|
@@ -594,8 +594,8 @@ function ks(e, t) {
|
|
|
594
594
|
} : null;
|
|
595
595
|
};
|
|
596
596
|
}
|
|
597
|
-
var
|
|
598
|
-
function
|
|
597
|
+
var Ur = "default", Vr = /* @__PURE__ */ Symbol("sync"), I = /* @__PURE__ */ Symbol("normalizeRoute");
|
|
598
|
+
function hr(e) {
|
|
599
599
|
let t = !1;
|
|
600
600
|
return function(...r) {
|
|
601
601
|
if (!t)
|
|
@@ -605,9 +605,9 @@ function lr(e) {
|
|
|
605
605
|
function Is(e) {
|
|
606
606
|
let t = e.src;
|
|
607
607
|
return new Promise((r, s) => {
|
|
608
|
-
const i =
|
|
609
|
-
|
|
610
|
-
}), n =
|
|
608
|
+
const i = hr((u) => {
|
|
609
|
+
Yt(u) && (u = u.default), e.component = u, console.debug("success load async module"), r();
|
|
610
|
+
}), n = hr((u) => {
|
|
611
611
|
`${u}`, console.debug("reject load async module"), s(u);
|
|
612
612
|
});
|
|
613
613
|
let o;
|
|
@@ -631,7 +631,7 @@ var Os = class {
|
|
|
631
631
|
constructor(e, t, r, s) {
|
|
632
632
|
this.name = e, this.level = t, this.rootName = r, this.rootIndex = s;
|
|
633
633
|
}
|
|
634
|
-
},
|
|
634
|
+
}, Ge = class Wr {
|
|
635
635
|
to;
|
|
636
636
|
routeModel;
|
|
637
637
|
from;
|
|
@@ -640,13 +640,13 @@ var Os = class {
|
|
|
640
640
|
this.to = t, this.from = r;
|
|
641
641
|
}
|
|
642
642
|
static from(t) {
|
|
643
|
-
const r = new
|
|
644
|
-
return
|
|
643
|
+
const r = new Wr(t.to, t.from), s = t.data ?? {};
|
|
644
|
+
return K(!0, r.data, s), r;
|
|
645
645
|
}
|
|
646
646
|
static clear(t) {
|
|
647
647
|
for (let r in t) t[r] = void 0;
|
|
648
648
|
}
|
|
649
|
-
}, S = class
|
|
649
|
+
}, S = class Nt {
|
|
650
650
|
path;
|
|
651
651
|
get fullPath() {
|
|
652
652
|
const t = this.path ?? `${this.name}`;
|
|
@@ -672,8 +672,8 @@ var Os = class {
|
|
|
672
672
|
active;
|
|
673
673
|
slot;
|
|
674
674
|
static clone(t, r) {
|
|
675
|
-
let s = new
|
|
676
|
-
return
|
|
675
|
+
let s = new Nt();
|
|
676
|
+
return Mr(s, t, r), s;
|
|
677
677
|
}
|
|
678
678
|
static isSame(t, r) {
|
|
679
679
|
return !t || !r ? !1 : t === r ? !0 : t.root !== r.root || t.index !== r.index ? !1 : t.path && r.path && t.path === r.path ? !0 : !!(t.name && r.name && t.name === r.name);
|
|
@@ -682,7 +682,7 @@ var Os = class {
|
|
|
682
682
|
return !t || !r ? !1 : t === r || t.path && r.path && t.path === r.path ? !0 : !!(t.name && r.name && t.name === r.name);
|
|
683
683
|
}
|
|
684
684
|
static from(t) {
|
|
685
|
-
let r = new
|
|
685
|
+
let r = new Nt();
|
|
686
686
|
if (t == null) return r;
|
|
687
687
|
let s = r;
|
|
688
688
|
for (let n in t) s[n] = t[n];
|
|
@@ -697,7 +697,7 @@ var Os = class {
|
|
|
697
697
|
src;
|
|
698
698
|
component;
|
|
699
699
|
constructor(e, t, r) {
|
|
700
|
-
this.id =
|
|
700
|
+
this.id = De.get(), this.name = e, this.src = t, typeof t != "function" && (this.component = t), this.props = r;
|
|
701
701
|
}
|
|
702
702
|
get isResolved() {
|
|
703
703
|
return this.component !== void 0;
|
|
@@ -705,9 +705,9 @@ var Os = class {
|
|
|
705
705
|
resolve() {
|
|
706
706
|
return Is(this);
|
|
707
707
|
}
|
|
708
|
-
},
|
|
708
|
+
}, yr = class {
|
|
709
709
|
models = [];
|
|
710
|
-
},
|
|
710
|
+
}, wt = class {
|
|
711
711
|
path;
|
|
712
712
|
match;
|
|
713
713
|
redirect;
|
|
@@ -715,11 +715,11 @@ var Os = class {
|
|
|
715
715
|
meta;
|
|
716
716
|
matchedRoutes;
|
|
717
717
|
layers = [];
|
|
718
|
-
},
|
|
718
|
+
}, F = /* @__PURE__ */ (function(e) {
|
|
719
719
|
return e[e.Push = 0] = "Push", e[e.Replace = 1] = "Replace", e[e.Put = 2] = "Put", e[e.Append = 3] = "Append", e[e.Open = 4] = "Open", e;
|
|
720
|
-
})({}),
|
|
720
|
+
})({}), bt = /* @__PURE__ */ (function(e) {
|
|
721
721
|
return e[e.Part = 0] = "Part", e[e.All = 1] = "All", e;
|
|
722
|
-
})({}), G = /* @__PURE__ */ Symbol("rootKey"), z = /* @__PURE__ */ Symbol("rootNodeKey"), ye = /* @__PURE__ */ Symbol("parentNodeKey"),
|
|
722
|
+
})({}), G = /* @__PURE__ */ Symbol("rootKey"), z = /* @__PURE__ */ Symbol("rootNodeKey"), ye = /* @__PURE__ */ Symbol("parentNodeKey"), at = /* @__PURE__ */ Symbol("nameKey"), re = class {
|
|
723
723
|
model;
|
|
724
724
|
route;
|
|
725
725
|
active = !0;
|
|
@@ -727,23 +727,23 @@ var Os = class {
|
|
|
727
727
|
constructor(e, t, r = 0, s = !0) {
|
|
728
728
|
this.route = e, this.model = t, this.index = r, this.active = s;
|
|
729
729
|
}
|
|
730
|
-
},
|
|
730
|
+
}, qe = class {
|
|
731
731
|
_slots;
|
|
732
732
|
get slots() {
|
|
733
|
-
return this._slots == null && (this._slots =
|
|
733
|
+
return this._slots == null && (this._slots = Lr([])), this._slots;
|
|
734
734
|
}
|
|
735
735
|
get empty() {
|
|
736
736
|
return this._slots == null || this._slots.value.length == 0;
|
|
737
737
|
}
|
|
738
|
-
[
|
|
738
|
+
[at];
|
|
739
739
|
[G];
|
|
740
740
|
[z] = null;
|
|
741
741
|
[ye] = null;
|
|
742
742
|
get name() {
|
|
743
|
-
return this[
|
|
743
|
+
return this[at];
|
|
744
744
|
}
|
|
745
745
|
constructor(e, t, r) {
|
|
746
|
-
this[
|
|
746
|
+
this[at] = e, this[G] = t, r && (this[z] = r);
|
|
747
747
|
}
|
|
748
748
|
}, O = class {
|
|
749
749
|
view;
|
|
@@ -759,7 +759,7 @@ var Os = class {
|
|
|
759
759
|
}
|
|
760
760
|
return !1;
|
|
761
761
|
}
|
|
762
|
-
},
|
|
762
|
+
}, Rt = class {
|
|
763
763
|
views = [];
|
|
764
764
|
}, Ds = class {
|
|
765
765
|
layers = [];
|
|
@@ -783,51 +783,51 @@ var Os = class {
|
|
|
783
783
|
release(e) {
|
|
784
784
|
this.submitRecorder.time === e && (this.submitRecorder.route = void 0);
|
|
785
785
|
}
|
|
786
|
-
},
|
|
786
|
+
}, E = /* @__PURE__ */ (function(e) {
|
|
787
787
|
return e.Busy = "Busy", e.Free = "Free", e.Reject = "Reject", e.Exception = "Exception", e.Finished = "Finished", e;
|
|
788
|
-
})(
|
|
788
|
+
})(E || {}), B = /* @__PURE__ */ Symbol("chainKey"), k = /* @__PURE__ */ Symbol("cursorKey"), xt = /* @__PURE__ */ Symbol("$persistentModeKey"), _ = /* @__PURE__ */ Symbol("statusKey"), Z = /* @__PURE__ */ Symbol("argsKey"), Xe = /* @__PURE__ */ Symbol("exArgsKey"), pe = /* @__PURE__ */ Symbol("successFnsKey"), $e = /* @__PURE__ */ Symbol("errorFnsKey"), le = /* @__PURE__ */ Symbol("sessionKey"), Y = /* @__PURE__ */ Symbol("_go"), ct = class {
|
|
789
789
|
[B] = [];
|
|
790
790
|
[k] = 0;
|
|
791
|
-
[
|
|
792
|
-
[
|
|
791
|
+
[xt] = !1;
|
|
792
|
+
[_] = E.Free;
|
|
793
793
|
[Z] = [];
|
|
794
|
-
[
|
|
794
|
+
[Xe] = [];
|
|
795
795
|
[pe] = [];
|
|
796
|
-
[
|
|
796
|
+
[$e] = [];
|
|
797
797
|
[le];
|
|
798
798
|
get session() {
|
|
799
799
|
return this[le];
|
|
800
800
|
}
|
|
801
801
|
constructor(e, t = !1) {
|
|
802
|
-
this[le] = e, this[
|
|
802
|
+
this[le] = e, this[xt] = t;
|
|
803
803
|
}
|
|
804
804
|
[Y](e, ...t) {
|
|
805
|
-
let r = this[
|
|
806
|
-
if (this[
|
|
807
|
-
let n = [{ session: this[le] }, ...this[
|
|
808
|
-
for (; this[
|
|
809
|
-
let o = this[
|
|
810
|
-
typeof o == "function" &&
|
|
805
|
+
let r = this[_];
|
|
806
|
+
if (this[_] = E.Busy, this[k] += e, this[k] < 0 && (this[k] = 0), this[Z] = t, r === E.Exception || r === E.Reject) {
|
|
807
|
+
let n = [{ session: this[le] }, ...this[Xe]];
|
|
808
|
+
for (; this[$e].length > 0; ) try {
|
|
809
|
+
let o = this[$e].shift();
|
|
810
|
+
typeof o == "function" && He(() => {
|
|
811
811
|
Reflect.apply(o, {}, n);
|
|
812
812
|
});
|
|
813
813
|
} catch (o) {
|
|
814
814
|
console.error(o.message, o);
|
|
815
815
|
}
|
|
816
|
-
return this[
|
|
817
|
-
} else if (r ===
|
|
816
|
+
return this[_] = r, this[B] = [], this[k] = 0, this;
|
|
817
|
+
} else if (r === E.Finished || this[k] >= this[B].length) {
|
|
818
818
|
let n = [{ session: this[le] }, ...this[Z]];
|
|
819
819
|
for (; this[pe].length > 0; ) {
|
|
820
820
|
let o = this[pe].shift();
|
|
821
|
-
typeof o == "function" &&
|
|
821
|
+
typeof o == "function" && He(() => {
|
|
822
822
|
Reflect.apply(o, {}, n);
|
|
823
823
|
});
|
|
824
824
|
}
|
|
825
|
-
return this[
|
|
825
|
+
return this[_] = E.Free, this;
|
|
826
826
|
}
|
|
827
827
|
if (this[k] >= this[B].length)
|
|
828
|
-
return this[
|
|
828
|
+
return this[_] = E.Free, this;
|
|
829
829
|
let s = this[B][this[k]];
|
|
830
|
-
this[
|
|
830
|
+
this[xt] || (this[B].splice(0, this[k] + 1), this[k] = -1);
|
|
831
831
|
let i = this[k] + 1;
|
|
832
832
|
try {
|
|
833
833
|
let n = !1, o = {
|
|
@@ -845,7 +845,7 @@ var Os = class {
|
|
|
845
845
|
},
|
|
846
846
|
session: this[le]
|
|
847
847
|
};
|
|
848
|
-
|
|
848
|
+
He(() => {
|
|
849
849
|
Reflect.apply(s, {}, [o, ...this[Z]]);
|
|
850
850
|
});
|
|
851
851
|
} catch (n) {
|
|
@@ -857,54 +857,54 @@ var Os = class {
|
|
|
857
857
|
return Reflect.apply(this[Y], this, [e, ...t]);
|
|
858
858
|
}
|
|
859
859
|
finish(...e) {
|
|
860
|
-
return this[
|
|
860
|
+
return this[_] = E.Finished, this[Z] = e, Reflect.apply(this[Y], this, [0]);
|
|
861
861
|
}
|
|
862
862
|
reject(...e) {
|
|
863
|
-
return this[
|
|
863
|
+
return this[_] = E.Reject, this[Xe] = e, Reflect.apply(this[Y], this, [0]);
|
|
864
864
|
}
|
|
865
865
|
throw(...e) {
|
|
866
|
-
return this[
|
|
866
|
+
return this[_] = E.Exception, this[Xe] = e, Reflect.apply(this[Y], this, [0]);
|
|
867
867
|
}
|
|
868
868
|
reset(...e) {
|
|
869
|
-
this[
|
|
869
|
+
this[_] = E.Busy, this[Z] = e, this[B] = [], this[k] = 0;
|
|
870
870
|
let t = [{ session: this[le] }, ...this[Z]];
|
|
871
871
|
for (; this[pe].length > 0; ) {
|
|
872
872
|
let r = this[pe].shift();
|
|
873
|
-
|
|
873
|
+
He(() => {
|
|
874
874
|
Reflect.apply(r, this, t);
|
|
875
875
|
});
|
|
876
876
|
}
|
|
877
|
-
return this[
|
|
877
|
+
return this[_] = E.Free, this;
|
|
878
878
|
}
|
|
879
879
|
post(e) {
|
|
880
|
-
return this[
|
|
880
|
+
return this[_] === E.Reject || this[_] === E.Exception ? this : (Array.isArray(e) ? this[B] = [...this[B], ...e] : this[B].push(e), this[_] === E.Busy ? this : (Reflect.apply(this[Y], this, [0, ...this[Z]]), this));
|
|
881
881
|
}
|
|
882
882
|
wait(e, t) {
|
|
883
|
-
return e && typeof e == "function" && this[pe].push(e), t && typeof t == "function" && this[
|
|
883
|
+
return e && typeof e == "function" && this[pe].push(e), t && typeof t == "function" && this[$e].push(t), this[_] === E.Busy ? this : (Reflect.apply(this[Y], this, [0, ...this[Z]]), this);
|
|
884
884
|
}
|
|
885
885
|
exception(e) {
|
|
886
|
-
return e && typeof e == "function" && this[
|
|
886
|
+
return e && typeof e == "function" && this[$e].push(e), this[_] === E.Busy ? this : Reflect.apply(this[Y], this, [0, ...this[Z]]);
|
|
887
887
|
}
|
|
888
888
|
isFinish() {
|
|
889
|
-
return this[
|
|
889
|
+
return this[_] == E.Reject || this[_] == E.Free && this[k] >= this[B].length;
|
|
890
890
|
}
|
|
891
|
-
}, xe = /* @__PURE__ */ Symbol("_notifyChange"),
|
|
891
|
+
}, xe = /* @__PURE__ */ Symbol("_notifyChange"), dr = class {
|
|
892
892
|
currentRoute;
|
|
893
893
|
routes;
|
|
894
894
|
constructor(e, t) {
|
|
895
895
|
this.currentRoute = e, this.routes = t;
|
|
896
896
|
}
|
|
897
|
-
}, ae = /* @__PURE__ */ Symbol("historyChangeConsumerKey"),
|
|
898
|
-
function
|
|
897
|
+
}, ae = /* @__PURE__ */ Symbol("historyChangeConsumerKey"), mr = /* @__PURE__ */ Symbol("_navigateFirstRoute"), Qe = /* @__PURE__ */ Symbol("_getRouteMark"), St = /* @__PURE__ */ Symbol("_getUrlSearch"), Et = /* @__PURE__ */ Symbol("_generateLocation"), Ze = /* @__PURE__ */ Symbol("_setRouteMarkRecorder"), Ke = /* @__PURE__ */ Symbol("beforeRestoreFiltersKey"), vr = /* @__PURE__ */ Symbol("_beforeRestore"), pr = "Symbol(_fox_restore_point)";
|
|
898
|
+
function je(e, ...t) {
|
|
899
899
|
return typeof e == "function" ? Reflect.apply(e, null, [...t]) : e;
|
|
900
900
|
}
|
|
901
|
-
function
|
|
901
|
+
function gr(e) {
|
|
902
902
|
if (!Array.isArray(e)) return !1;
|
|
903
903
|
if (e.length === 0) return !0;
|
|
904
904
|
const t = e[0];
|
|
905
905
|
return !!(Reflect.has(t, "path") && Reflect.has(t, "root"));
|
|
906
906
|
}
|
|
907
|
-
var
|
|
907
|
+
var Jr = class {
|
|
908
908
|
base;
|
|
909
909
|
storage;
|
|
910
910
|
mode;
|
|
@@ -930,24 +930,24 @@ var Hr = class {
|
|
|
930
930
|
this[ae] = !1;
|
|
931
931
|
return;
|
|
932
932
|
}
|
|
933
|
-
if (
|
|
933
|
+
if (je(this.historyMonitor)) {
|
|
934
934
|
const r = t.history.state;
|
|
935
935
|
this[xe](r);
|
|
936
936
|
try {
|
|
937
937
|
let s = [];
|
|
938
938
|
if (typeof r == "string" ? s = JSON.parse(r) : s = r, Array.isArray(s) && s.length > 0) {
|
|
939
|
-
const i = this[
|
|
940
|
-
this[
|
|
939
|
+
const i = this[Qe]() ?? "/";
|
|
940
|
+
this[Ze](i, s);
|
|
941
941
|
}
|
|
942
942
|
} catch {
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
|
-
}),
|
|
945
|
+
}), ft(t, "popstate", this.historyChange), this.firstNavigate && e && this[mr](), Promise.resolve();
|
|
946
946
|
}
|
|
947
947
|
destroy() {
|
|
948
|
-
this.historyChange &&
|
|
948
|
+
this.historyChange && Qt(C(), "popstate", this.historyChange);
|
|
949
949
|
}
|
|
950
|
-
[
|
|
950
|
+
[vr](e, t, r, s) {
|
|
951
951
|
for (let i of this[Ke]) try {
|
|
952
952
|
const n = Reflect.apply(i, {}, [
|
|
953
953
|
e,
|
|
@@ -968,14 +968,14 @@ var Hr = class {
|
|
|
968
968
|
const t = this[Ke].indexOf(e);
|
|
969
969
|
return t !== -1 ? (this[Ke].splice(t, 1), !0) : !1;
|
|
970
970
|
}
|
|
971
|
-
[
|
|
972
|
-
const e = this[
|
|
971
|
+
[mr]() {
|
|
972
|
+
const e = this[Qe]() ?? "/", t = this.storage.getItem(pr);
|
|
973
973
|
if (t) try {
|
|
974
974
|
const n = JSON.parse(t);
|
|
975
975
|
if (n.mark === e && Array.isArray(n.routes) && n.routes.length > 0) {
|
|
976
|
-
const o = n.routes.filter((u, l) => (u.params = u.params ?
|
|
976
|
+
const o = n.routes.filter((u, l) => (u.params = u.params ? Ir(u.params) : {}, this[vr](u, l, e, n.routes)));
|
|
977
977
|
if (o.length > 0) {
|
|
978
|
-
const u = this[
|
|
978
|
+
const u = this[St](), l = o.length - 1;
|
|
979
979
|
o[l].query = u || o[l].query, this[xe](o);
|
|
980
980
|
return;
|
|
981
981
|
}
|
|
@@ -986,30 +986,30 @@ var Hr = class {
|
|
|
986
986
|
let s;
|
|
987
987
|
r != -1 ? s = e.substring(r + 1) : s = e;
|
|
988
988
|
const i = new S();
|
|
989
|
-
i.path = s, i.query = this[
|
|
989
|
+
i.path = s, i.query = this[St](), this[xe]([i]);
|
|
990
990
|
}
|
|
991
|
-
[
|
|
991
|
+
[Ze](e, t) {
|
|
992
992
|
try {
|
|
993
993
|
t.forEach((s) => {
|
|
994
|
-
s.params = s.params ?
|
|
994
|
+
s.params = s.params ? kr(s.params) : {};
|
|
995
995
|
});
|
|
996
996
|
const r = JSON.stringify({
|
|
997
997
|
mark: e,
|
|
998
998
|
routes: t
|
|
999
999
|
});
|
|
1000
|
-
this.storage.setItem(
|
|
1000
|
+
this.storage.setItem(pr, r);
|
|
1001
1001
|
} catch (r) {
|
|
1002
1002
|
console.error(r.message, r);
|
|
1003
1003
|
}
|
|
1004
1004
|
}
|
|
1005
1005
|
setRestorePoint(e) {
|
|
1006
|
-
const t = this[
|
|
1007
|
-
this[
|
|
1006
|
+
const t = this[Qe]() ?? "/";
|
|
1007
|
+
this[Ze](t, e);
|
|
1008
1008
|
}
|
|
1009
1009
|
[xe](e) {
|
|
1010
1010
|
typeof this.changeHandler == "function" && this.changeHandler(e);
|
|
1011
1011
|
}
|
|
1012
|
-
[
|
|
1012
|
+
[Qe]() {
|
|
1013
1013
|
const e = C();
|
|
1014
1014
|
if (this.mode === "path") {
|
|
1015
1015
|
let t = e.location.pathname;
|
|
@@ -1020,7 +1020,7 @@ var Hr = class {
|
|
|
1020
1020
|
}
|
|
1021
1021
|
return null;
|
|
1022
1022
|
}
|
|
1023
|
-
[
|
|
1023
|
+
[St]() {
|
|
1024
1024
|
let e = C().location.search;
|
|
1025
1025
|
return e.length > 0 && e.indexOf("?") === 0 && (e = e.substring(1)), e;
|
|
1026
1026
|
}
|
|
@@ -1033,11 +1033,11 @@ var Hr = class {
|
|
|
1033
1033
|
}
|
|
1034
1034
|
goBack(e, t) {
|
|
1035
1035
|
const r = C(), s = r.history.state;
|
|
1036
|
-
if (
|
|
1036
|
+
if (gr(s) && s.length > 0) {
|
|
1037
1037
|
let i = !1;
|
|
1038
1038
|
for (let a = s.length - 1; a >= 0; a--) {
|
|
1039
1039
|
const f = S.from(s[a]);
|
|
1040
|
-
if (!(f.historyUpdatePolicy === "traceless" ||
|
|
1040
|
+
if (!(f.historyUpdatePolicy === "traceless" || je(this.traceless, f)) && S.isSame(f, e)) {
|
|
1041
1041
|
i = !0;
|
|
1042
1042
|
break;
|
|
1043
1043
|
}
|
|
@@ -1053,7 +1053,7 @@ var Hr = class {
|
|
|
1053
1053
|
}, l = () => {
|
|
1054
1054
|
clearTimeout(o);
|
|
1055
1055
|
const a = C().history.state;
|
|
1056
|
-
if (
|
|
1056
|
+
if (gr(a) && a.length > 0) {
|
|
1057
1057
|
let f = a.length;
|
|
1058
1058
|
const c = a[f - 1], h = S.from(c);
|
|
1059
1059
|
if (S.isSame(h, e))
|
|
@@ -1062,7 +1062,7 @@ var Hr = class {
|
|
|
1062
1062
|
let y = !1;
|
|
1063
1063
|
for (let d = f - 1; d >= 0; d--) {
|
|
1064
1064
|
const m = S.from(a[d]);
|
|
1065
|
-
if (!(m.traceless === !0 ||
|
|
1065
|
+
if (!(m.traceless === !0 || je(this.traceless, m)) && S.isSame(m, e)) {
|
|
1066
1066
|
y = !0;
|
|
1067
1067
|
break;
|
|
1068
1068
|
}
|
|
@@ -1079,17 +1079,17 @@ var Hr = class {
|
|
|
1079
1079
|
}
|
|
1080
1080
|
setRouteMark(e) {
|
|
1081
1081
|
const t = e.currentRoute.fullPath;
|
|
1082
|
-
this[
|
|
1082
|
+
this[Ze](t, e.routes);
|
|
1083
1083
|
}
|
|
1084
1084
|
push(e) {
|
|
1085
|
-
const t = this[
|
|
1086
|
-
e.currentRoute.historyUpdatePolicy !== "traceless" &&
|
|
1085
|
+
const t = this[Et](e.currentRoute);
|
|
1086
|
+
e.currentRoute.historyUpdatePolicy !== "traceless" && !je(this.traceless, e.currentRoute) && C().history.pushState(e.routes, "", t), this.setRouteMark(e);
|
|
1087
1087
|
}
|
|
1088
1088
|
replace(e) {
|
|
1089
|
-
const t = this[
|
|
1090
|
-
(e.currentRoute.historyUpdatePolicy !== "traceless" ||
|
|
1089
|
+
const t = this[Et](e.currentRoute);
|
|
1090
|
+
(e.currentRoute.historyUpdatePolicy !== "traceless" || !je(this.traceless, e.currentRoute)) && C().history.replaceState(e.routes, "", t), this.setRouteMark(e);
|
|
1091
1091
|
}
|
|
1092
|
-
[
|
|
1092
|
+
[Et](e) {
|
|
1093
1093
|
const t = C();
|
|
1094
1094
|
let r = "";
|
|
1095
1095
|
if (e.query) {
|
|
@@ -1103,16 +1103,16 @@ var Hr = class {
|
|
|
1103
1103
|
}
|
|
1104
1104
|
const s = t.location;
|
|
1105
1105
|
let i = e.alias ?? e.fullPath;
|
|
1106
|
-
i.startsWith("default") && (i = i.substring(
|
|
1106
|
+
i.startsWith("default") && (i = i.substring(Ur.length + 1));
|
|
1107
1107
|
let n;
|
|
1108
1108
|
return r ? this.mode == "path" ? i.indexOf("/") === 0 ? n = `${this.base}${i}${r}` : n = `${this.base}/${i}${r}` : n = `${s.pathname}${r}#${i}` : this.mode == "path" ? i.indexOf("/") === 0 ? n = `${this.base}${i}` : n = `${this.base}/${i}` : n = `${s.pathname}#${i}`, `${s.origin}${n}`;
|
|
1109
1109
|
}
|
|
1110
1110
|
};
|
|
1111
1111
|
function Ni(e = !0, t = null, r = "", s = !0, i = !1, n) {
|
|
1112
|
-
return t !== null && (t = C().location.pathname), t && t.endsWith("/") && (t = t.substring(0, t.length - 1)), new
|
|
1112
|
+
return t !== null && (t = C().location.pathname), t && t.endsWith("/") && (t = t.substring(0, t.length - 1)), new Jr("path", t ?? "", r, e, s, i, n);
|
|
1113
1113
|
}
|
|
1114
1114
|
function Us(e = !0, t = "", r = !0, s = !1, i) {
|
|
1115
|
-
return new
|
|
1115
|
+
return new Jr("hash", "", t, e, r, s, i);
|
|
1116
1116
|
}
|
|
1117
1117
|
var Vs = class {
|
|
1118
1118
|
maxSize = 50;
|
|
@@ -1184,30 +1184,30 @@ var Vs = class {
|
|
|
1184
1184
|
function Ws(e = "", t = 50) {
|
|
1185
1185
|
return new Vs(e, t);
|
|
1186
1186
|
}
|
|
1187
|
-
var
|
|
1187
|
+
var Ye = /* @__PURE__ */ Symbol("_constructRouteModel"), et = /* @__PURE__ */ Symbol("_findRouteModel"), Pt = /* @__PURE__ */ Symbol("_findRootView"), Js = /* @__PURE__ */ Symbol("_getFirstView"), ue = /* @__PURE__ */ Symbol("_removeView"), wr = /* @__PURE__ */ Symbol("_buildPage"), br = /* @__PURE__ */ Symbol("_resolveComponent"), Rr = /* @__PURE__ */ Symbol("_update"), se = /* @__PURE__ */ Symbol("_merge"), _t = /* @__PURE__ */ Symbol("_handleHistoryChange"), fe = /* @__PURE__ */ Symbol("_handleRouteUpdated"), tt = /* @__PURE__ */ Symbol("routeUpdatedCallback"), Ft = /* @__PURE__ */ Symbol("currentRoute"), p = /* @__PURE__ */ Symbol("currentRoutes"), rt = /* @__PURE__ */ Symbol("routeSessionCacheKey"), xr = /* @__PURE__ */ Symbol("_addRouteRecorder"), Le = /* @__PURE__ */ Symbol("_removeRouteRecorder"), st = /* @__PURE__ */ Symbol("_cloneRouteRecorder"), $ = /* @__PURE__ */ Symbol("_handleError"), it = /* @__PURE__ */ Symbol("errorCallback"), D = /* @__PURE__ */ Symbol("registerKey"), nt = /* @__PURE__ */ Symbol("notFoundKey"), Ct = /* @__PURE__ */ Symbol("notFoundPathKey"), W = /* @__PURE__ */ Symbol("forestKey"), x = /* @__PURE__ */ Symbol("historyKey"), Me = /* @__PURE__ */ Symbol("beforeFiltersKey"), Te = /* @__PURE__ */ Symbol("afterFiltersKey"), ke = /* @__PURE__ */ Symbol("destroyFiltersKey"), At = /* @__PURE__ */ Symbol("propsFilterKey"), ge = /* @__PURE__ */ Symbol("mainDispatcherKey"), qt = /* @__PURE__ */ Symbol("initKey"), ce = /* @__PURE__ */ Symbol("readyKey"), $t = /* @__PURE__ */ Symbol("readyHandlersKey"), ot = /* @__PURE__ */ Symbol("_markReady"), Sr = /* @__PURE__ */ Symbol("_createNextFn"), Kt = /* @__PURE__ */ Symbol("_start"), jt = /* @__PURE__ */ Symbol("_before"), Lt = /* @__PURE__ */ Symbol("_after"), Er = /* @__PURE__ */ Symbol("_destroy"), Mt = /* @__PURE__ */ Symbol("_load"), Ie = /* @__PURE__ */ Symbol("_unload"), Oe = /* @__PURE__ */ Symbol("routerGuardKey");
|
|
1188
1188
|
function zs(e) {
|
|
1189
1189
|
return e.layers.length == 0 || e.layers[0].views.length == 0;
|
|
1190
1190
|
}
|
|
1191
1191
|
var Gs = class {
|
|
1192
1192
|
[D] = new Array();
|
|
1193
|
-
[
|
|
1194
|
-
[
|
|
1193
|
+
[nt];
|
|
1194
|
+
[Ct] = "*";
|
|
1195
1195
|
[ce] = !1;
|
|
1196
|
-
[
|
|
1196
|
+
[$t] = [];
|
|
1197
1197
|
[W] = new Ds();
|
|
1198
1198
|
[x];
|
|
1199
1199
|
[p] = new Array();
|
|
1200
|
-
[Ft] =
|
|
1201
|
-
[
|
|
1202
|
-
[
|
|
1203
|
-
[
|
|
1204
|
-
[Le] = new Array();
|
|
1200
|
+
[Ft] = Lr(null);
|
|
1201
|
+
[rt] = /* @__PURE__ */ new WeakMap();
|
|
1202
|
+
[it] = null;
|
|
1203
|
+
[tt] = null;
|
|
1205
1204
|
[Me] = new Array();
|
|
1206
1205
|
[Te] = new Array();
|
|
1207
|
-
[
|
|
1208
|
-
[
|
|
1209
|
-
[
|
|
1210
|
-
[
|
|
1206
|
+
[ke] = new Array();
|
|
1207
|
+
[At] = null;
|
|
1208
|
+
[ge] = new ct();
|
|
1209
|
+
[Oe] = new Ns();
|
|
1210
|
+
[qt] = !1;
|
|
1211
1211
|
get currentRoute() {
|
|
1212
1212
|
return ds(this[Ft]);
|
|
1213
1213
|
}
|
|
@@ -1215,40 +1215,40 @@ var Gs = class {
|
|
|
1215
1215
|
constructor(e) {
|
|
1216
1216
|
this.options = e ?? {}, this.options.notFoundPath && this.setNotFoundPath(this.options.notFoundPath);
|
|
1217
1217
|
let t = this.options.routes || [];
|
|
1218
|
-
this.addRoutes(t), this.options.notFound && this.setNotFoundRoute(this.options.notFound), e.history ? this[x] = e.history : this[x] =
|
|
1218
|
+
this.addRoutes(t), this.options.notFound && this.setNotFoundRoute(this.options.notFound), e.history ? this[x] = e.history : this[x] = Ee ? Us() : Ws(), this[x]?.listen(async (r) => {
|
|
1219
1219
|
let s = !0;
|
|
1220
1220
|
try {
|
|
1221
1221
|
if (typeof r == "string") {
|
|
1222
1222
|
const i = this[I](r);
|
|
1223
|
-
i && await this[
|
|
1224
|
-
} else await this[
|
|
1223
|
+
i && await this[_t]([i]);
|
|
1224
|
+
} else await this[_t](r);
|
|
1225
1225
|
} catch (i) {
|
|
1226
1226
|
console.error(i.message, i), s = !1;
|
|
1227
1227
|
}
|
|
1228
|
-
this[ce] === !1 && this[
|
|
1228
|
+
this[ce] === !1 && this[ot](s);
|
|
1229
1229
|
});
|
|
1230
1230
|
}
|
|
1231
|
-
[
|
|
1231
|
+
[$](e = "error", t) {
|
|
1232
1232
|
if (t && typeof t.error == "function") try {
|
|
1233
1233
|
t.error(e);
|
|
1234
1234
|
} catch {
|
|
1235
1235
|
}
|
|
1236
|
-
if (typeof this[
|
|
1237
|
-
this[
|
|
1236
|
+
if (typeof this[it] == "function") try {
|
|
1237
|
+
this[it](e, t);
|
|
1238
1238
|
} catch {
|
|
1239
1239
|
}
|
|
1240
1240
|
console.error(e);
|
|
1241
1241
|
}
|
|
1242
1242
|
init() {
|
|
1243
|
-
this[
|
|
1243
|
+
this[qt] !== !0 && (this[x]?.init(!this[ce]), this[qt] = !0);
|
|
1244
1244
|
}
|
|
1245
1245
|
isReady() {
|
|
1246
1246
|
return this[ce] ? Promise.resolve() : new Promise((e, t) => {
|
|
1247
|
-
this[
|
|
1247
|
+
this[$t].push([e, t]);
|
|
1248
1248
|
});
|
|
1249
1249
|
}
|
|
1250
|
-
[
|
|
1251
|
-
this[ce] = !0, this[
|
|
1250
|
+
[ot](e) {
|
|
1251
|
+
this[ce] = !0, this[$t].forEach(([t, r]) => {
|
|
1252
1252
|
try {
|
|
1253
1253
|
e ? t() : r();
|
|
1254
1254
|
} catch (s) {
|
|
@@ -1256,11 +1256,11 @@ var Gs = class {
|
|
|
1256
1256
|
}
|
|
1257
1257
|
});
|
|
1258
1258
|
}
|
|
1259
|
-
[
|
|
1259
|
+
[_t](e) {
|
|
1260
1260
|
try {
|
|
1261
1261
|
if (!e) {
|
|
1262
1262
|
let n = [...this[p]].reverse();
|
|
1263
|
-
return this[
|
|
1263
|
+
return this[Ie](n), Ee && C().location.reload(), Promise.resolve();
|
|
1264
1264
|
}
|
|
1265
1265
|
let t = null, r = [], s = [], i = 0;
|
|
1266
1266
|
for (; i < e.length && i < this[p].length && S.isSame(e[i], this[p][i]); i++)
|
|
@@ -1268,24 +1268,24 @@ var Gs = class {
|
|
|
1268
1268
|
if (i < e.length && (r = e.slice(i)), i < this[p].length && (s = this[p].slice(i).reverse()), s.length === 0 && r.length === 0) {
|
|
1269
1269
|
if (t !== null) return this.restore([t]);
|
|
1270
1270
|
} else if (s.length > 0) {
|
|
1271
|
-
if (this[
|
|
1271
|
+
if (this[Ie](s)) {
|
|
1272
1272
|
if (r.length > 0) return this.restore(r);
|
|
1273
1273
|
if (t !== null) return this.restore([t]);
|
|
1274
1274
|
}
|
|
1275
1275
|
} else return this.restore(r);
|
|
1276
1276
|
} catch (t) {
|
|
1277
|
-
this[
|
|
1277
|
+
this[$](t);
|
|
1278
1278
|
}
|
|
1279
1279
|
return Promise.resolve();
|
|
1280
1280
|
}
|
|
1281
1281
|
[fe](e = null) {
|
|
1282
|
-
if (this[Ft].value = e, typeof this[
|
|
1283
|
-
this[
|
|
1282
|
+
if (this[Ft].value = e, typeof this[tt] == "function") try {
|
|
1283
|
+
this[tt](e);
|
|
1284
1284
|
} catch {
|
|
1285
1285
|
}
|
|
1286
1286
|
}
|
|
1287
|
-
[
|
|
1288
|
-
if (e.opsType ===
|
|
1287
|
+
[xr](e, t) {
|
|
1288
|
+
if (e.opsType === F.Open) {
|
|
1289
1289
|
let r = !1;
|
|
1290
1290
|
const s = this[p].length - 1;
|
|
1291
1291
|
for (let i = s; i >= 0; i--) {
|
|
@@ -1300,9 +1300,9 @@ var Gs = class {
|
|
|
1300
1300
|
}
|
|
1301
1301
|
r || this[p].push(e);
|
|
1302
1302
|
} else this[p].push(e);
|
|
1303
|
-
this[
|
|
1303
|
+
this[rt].set(e, t), this[fe](e);
|
|
1304
1304
|
}
|
|
1305
|
-
[
|
|
1305
|
+
[st]() {
|
|
1306
1306
|
let e = [];
|
|
1307
1307
|
for (let t of this[p]) {
|
|
1308
1308
|
let r = S.clone(t, !0);
|
|
@@ -1310,7 +1310,7 @@ var Gs = class {
|
|
|
1310
1310
|
}
|
|
1311
1311
|
return e;
|
|
1312
1312
|
}
|
|
1313
|
-
[
|
|
1313
|
+
[Le](e) {
|
|
1314
1314
|
if (!this[p]) {
|
|
1315
1315
|
this[fe](null);
|
|
1316
1316
|
return;
|
|
@@ -1323,8 +1323,8 @@ var Gs = class {
|
|
|
1323
1323
|
if (t != -1) {
|
|
1324
1324
|
const r = this[p][t];
|
|
1325
1325
|
this[p].splice(t, 1);
|
|
1326
|
-
const s = this[
|
|
1327
|
-
if (this[
|
|
1326
|
+
const s = this[rt].get(r);
|
|
1327
|
+
if (this[rt].delete(r), this[Er](r, s), r.opsType === F.Append) {
|
|
1328
1328
|
const i = this[p].length - 1;
|
|
1329
1329
|
this[fe](this[p][i] ?? null);
|
|
1330
1330
|
} else this[fe](null);
|
|
@@ -1343,41 +1343,41 @@ var Gs = class {
|
|
|
1343
1343
|
return this[x] ? this[x].traceless : !1;
|
|
1344
1344
|
}
|
|
1345
1345
|
set propsFilter(e) {
|
|
1346
|
-
this[
|
|
1346
|
+
this[At] = e;
|
|
1347
1347
|
}
|
|
1348
1348
|
get propsFilter() {
|
|
1349
|
-
return this[
|
|
1349
|
+
return this[At];
|
|
1350
1350
|
}
|
|
1351
1351
|
setRestorePoint() {
|
|
1352
|
-
const e = this[
|
|
1352
|
+
const e = this[st]();
|
|
1353
1353
|
this[x]?.setRestorePoint(e);
|
|
1354
1354
|
}
|
|
1355
1355
|
onRouteUpdated(e) {
|
|
1356
|
-
this[
|
|
1356
|
+
this[tt] = e;
|
|
1357
1357
|
}
|
|
1358
1358
|
onError(e) {
|
|
1359
|
-
this[
|
|
1359
|
+
this[it] = e;
|
|
1360
1360
|
}
|
|
1361
1361
|
beforeEach(e) {
|
|
1362
|
-
this[
|
|
1362
|
+
this[Me].push(e);
|
|
1363
1363
|
}
|
|
1364
1364
|
removeBeforeEach(e) {
|
|
1365
|
-
const t = this[
|
|
1366
|
-
return t !== -1 ? (this[
|
|
1365
|
+
const t = this[Me].indexOf(e);
|
|
1366
|
+
return t !== -1 ? (this[Me].splice(t, 1), !0) : !1;
|
|
1367
1367
|
}
|
|
1368
1368
|
afterEach(e) {
|
|
1369
|
-
this[
|
|
1369
|
+
this[Te].push(e);
|
|
1370
1370
|
}
|
|
1371
1371
|
removeAfterEach(e) {
|
|
1372
|
-
const t = this[
|
|
1373
|
-
return t !== -1 ? (this[
|
|
1372
|
+
const t = this[Te].indexOf(e);
|
|
1373
|
+
return t !== -1 ? (this[Te].splice(t, 1), !0) : !1;
|
|
1374
1374
|
}
|
|
1375
1375
|
destroyEach(e) {
|
|
1376
|
-
this[
|
|
1376
|
+
this[ke].push(e);
|
|
1377
1377
|
}
|
|
1378
1378
|
removeDestroyEach(e) {
|
|
1379
|
-
const t = this[
|
|
1380
|
-
return t !== -1 ? (this[
|
|
1379
|
+
const t = this[ke].indexOf(e);
|
|
1380
|
+
return t !== -1 ? (this[ke].splice(t, 1), !0) : !1;
|
|
1381
1381
|
}
|
|
1382
1382
|
beforeRestoreEach(e) {
|
|
1383
1383
|
this[x]?.beforeRestoreEach(e);
|
|
@@ -1389,11 +1389,11 @@ var Gs = class {
|
|
|
1389
1389
|
for (let t of e) this.addRoute(t);
|
|
1390
1390
|
}
|
|
1391
1391
|
addRoute(e, t = -1) {
|
|
1392
|
-
if (e.path === this[
|
|
1392
|
+
if (e.path === this[Ct]) {
|
|
1393
1393
|
this.setNotFoundRoute(e);
|
|
1394
1394
|
return;
|
|
1395
1395
|
}
|
|
1396
|
-
const r = this[
|
|
1396
|
+
const r = this[Ye](e);
|
|
1397
1397
|
if (t == -1) this[D] = [...this[D], ...r];
|
|
1398
1398
|
else for (let s = r.length - 1; s >= 0; s--) this[D].splice(t, 0, r[s]);
|
|
1399
1399
|
}
|
|
@@ -1417,20 +1417,21 @@ var Gs = class {
|
|
|
1417
1417
|
}) !== -1;
|
|
1418
1418
|
}
|
|
1419
1419
|
setNotFoundPath(e) {
|
|
1420
|
-
this[
|
|
1420
|
+
this[Ct] = e;
|
|
1421
1421
|
}
|
|
1422
1422
|
setNotFoundRoute(e) {
|
|
1423
|
-
|
|
1423
|
+
const t = this[Ye](e);
|
|
1424
|
+
this[nt] = t[0];
|
|
1424
1425
|
}
|
|
1425
1426
|
getRoutes() {
|
|
1426
1427
|
return [...this[D]];
|
|
1427
1428
|
}
|
|
1428
|
-
[
|
|
1429
|
+
[Ye](e) {
|
|
1429
1430
|
let t = e.path ?? "";
|
|
1430
1431
|
t.length > 0 && t.charAt(0) !== "/" && (t = `/${t}`);
|
|
1431
1432
|
let r = e.components ?? (e.component && { "": e.component });
|
|
1432
1433
|
if (!r) {
|
|
1433
|
-
const u = new
|
|
1434
|
+
const u = new wt();
|
|
1434
1435
|
return u.path = t, u.redirect = e.redirect, [u];
|
|
1435
1436
|
}
|
|
1436
1437
|
const s = new S();
|
|
@@ -1438,29 +1439,29 @@ var Gs = class {
|
|
|
1438
1439
|
let i = [];
|
|
1439
1440
|
for (let u in r) {
|
|
1440
1441
|
const l = r[u];
|
|
1441
|
-
u.length === 0 && (u =
|
|
1442
|
+
u.length === 0 && (u = Ur);
|
|
1442
1443
|
const a = new Bs(u, l, e.props);
|
|
1443
1444
|
i.push(a);
|
|
1444
1445
|
}
|
|
1445
1446
|
let n = !1, o = [];
|
|
1446
1447
|
if (e.children) for (let u of e.children) {
|
|
1447
|
-
const l = this[
|
|
1448
|
+
const l = this[Ye](u);
|
|
1448
1449
|
for (let a of l) {
|
|
1449
|
-
let f = new
|
|
1450
|
+
let f = new wt();
|
|
1450
1451
|
f.name = a.name, a.path && a.path.length > 0 ? t !== "/" ? f.path = `${t}${a.path}` : f.path = a.path : (n = !0, f.path = t);
|
|
1451
|
-
let c = new
|
|
1452
|
+
let c = new yr();
|
|
1452
1453
|
c.models = [...i], f.layers = [c, ...a.layers], f.matchedRoutes = [s, ...a.matchedRoutes ?? []], o.push(f);
|
|
1453
1454
|
}
|
|
1454
1455
|
}
|
|
1455
1456
|
if (!n) {
|
|
1456
|
-
const u = new
|
|
1457
|
+
const u = new yr();
|
|
1457
1458
|
u.models = i;
|
|
1458
|
-
const l = new
|
|
1459
|
+
const l = new wt();
|
|
1459
1460
|
l.name = e.name, l.path = t, l.matchedRoutes = [s], l.layers = [u], o.splice(0, 0, l);
|
|
1460
1461
|
}
|
|
1461
1462
|
return o;
|
|
1462
1463
|
}
|
|
1463
|
-
[
|
|
1464
|
+
[et](e) {
|
|
1464
1465
|
const t = e.route;
|
|
1465
1466
|
try {
|
|
1466
1467
|
for (let r of this[D]) {
|
|
@@ -1472,14 +1473,14 @@ var Gs = class {
|
|
|
1472
1473
|
if (!o) continue;
|
|
1473
1474
|
if (r.redirect) {
|
|
1474
1475
|
const u = new S();
|
|
1475
|
-
|
|
1476
|
+
K(!0, u, t), u.path = r.redirect;
|
|
1476
1477
|
const l = {
|
|
1477
1478
|
route: u,
|
|
1478
1479
|
find: void 0
|
|
1479
1480
|
};
|
|
1480
|
-
return this[
|
|
1481
|
+
return this[et](l) ? (e.route = l.route, e.find = l.find, t.template && e.find && (e.find = { ...e.find }, e.find.path = t.path), !0) : !1;
|
|
1481
1482
|
}
|
|
1482
|
-
if (t.params = t.params ?? {},
|
|
1483
|
+
if (t.params = t.params ?? {}, K(!0, t.params, o.params), t.query) {
|
|
1483
1484
|
const u = t.query;
|
|
1484
1485
|
if (typeof u == "string") {
|
|
1485
1486
|
const l = {}, a = u.split("&");
|
|
@@ -1489,8 +1490,8 @@ var Gs = class {
|
|
|
1489
1490
|
const h = decodeURIComponent(c[0].trim());
|
|
1490
1491
|
l[h] = decodeURIComponent(c[1].trim());
|
|
1491
1492
|
}
|
|
1492
|
-
|
|
1493
|
-
} else typeof u == "object" &&
|
|
1493
|
+
K(!0, t.params, l);
|
|
1494
|
+
} else typeof u == "object" && K(!0, t.params, u);
|
|
1494
1495
|
}
|
|
1495
1496
|
return e.find = r, t.template && e.find && (e.find = { ...e.find }, e.find.path = t.path), !0;
|
|
1496
1497
|
} else if (i === r.name)
|
|
@@ -1505,32 +1506,32 @@ var Gs = class {
|
|
|
1505
1506
|
let t = null;
|
|
1506
1507
|
if (Array.isArray(e))
|
|
1507
1508
|
if (t = new S(), typeof e[0] == "object") t = S.from(e[0]);
|
|
1508
|
-
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 &&
|
|
1509
|
+
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 && K(!1, t, e[r]);
|
|
1509
1510
|
else typeof e == "object" ? t = S.from(e) : typeof e == "string" && (t = new S(), e.charAt(0) == "/" ? t.path = e : t.name = e);
|
|
1510
1511
|
if (t) {
|
|
1511
1512
|
if (t.path) {
|
|
1512
1513
|
let r = t.path.indexOf("?");
|
|
1513
1514
|
r !== -1 && r < t.path.length - 1 && (t.query = t.path.substring(r + 1), t.path = t.path.substring(0, r));
|
|
1514
1515
|
}
|
|
1515
|
-
t.root = t.root ?? "default", t.opsType = t.opsType ?? this.options.defaultOperationType ??
|
|
1516
|
+
t.root = t.root ?? "default", t.opsType = t.opsType ?? this.options.defaultOperationType ?? F.Push, t.traceless && !t.historyUpdatePolicy && (t.historyUpdatePolicy = "traceless");
|
|
1516
1517
|
}
|
|
1517
1518
|
return t;
|
|
1518
1519
|
}
|
|
1519
1520
|
push(...e) {
|
|
1520
1521
|
const t = this[I](e);
|
|
1521
|
-
return t ? (t.opsType =
|
|
1522
|
+
return t ? (t.opsType = F.Push, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "push", this.to(t)) : (this[$]("resolve route fail", t), this);
|
|
1522
1523
|
}
|
|
1523
1524
|
put(...e) {
|
|
1524
1525
|
const t = this[I](e);
|
|
1525
|
-
return t ? (t.opsType =
|
|
1526
|
+
return t ? (t.opsType = F.Put, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "traceless", this.to(t)) : (this[$]("resolve route fail", t), this);
|
|
1526
1527
|
}
|
|
1527
1528
|
replace(...e) {
|
|
1528
1529
|
const t = this[I](e);
|
|
1529
|
-
return t ? (t.opsType =
|
|
1530
|
+
return t ? (t.opsType = F.Replace, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "replace", this.to(t)) : (this[$]("resolve route fail", t), this);
|
|
1530
1531
|
}
|
|
1531
1532
|
append(...e) {
|
|
1532
1533
|
const t = this[I](e);
|
|
1533
|
-
return t ? (t.opsType =
|
|
1534
|
+
return t ? (t.opsType = F.Append, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "push", this.to(t)) : (this[$]("resolve route fail", t), this);
|
|
1534
1535
|
}
|
|
1535
1536
|
remove(e, t) {
|
|
1536
1537
|
return new Promise((r) => {
|
|
@@ -1544,7 +1545,7 @@ var Gs = class {
|
|
|
1544
1545
|
if (e) {
|
|
1545
1546
|
if (n = e.root ?? "default", e.all) for (let l = this[p].length - 1; l > 0; l--) {
|
|
1546
1547
|
const a = this[p][l];
|
|
1547
|
-
if (a.opsType ===
|
|
1548
|
+
if (a.opsType === F.Append) {
|
|
1548
1549
|
const f = a.root ?? "default";
|
|
1549
1550
|
if (n && n !== f) continue;
|
|
1550
1551
|
o.splice(0, 0, a), i = l - 1;
|
|
@@ -1552,7 +1553,7 @@ var Gs = class {
|
|
|
1552
1553
|
}
|
|
1553
1554
|
else if (e.until) for (let l = this[p].length - 1; l > 0; l--) {
|
|
1554
1555
|
let a = this[p][l];
|
|
1555
|
-
if (a.opsType ===
|
|
1556
|
+
if (a.opsType === F.Append && a.root === n) {
|
|
1556
1557
|
if (e.until.charAt(0) === "/" && e.until === a.path) {
|
|
1557
1558
|
i = l;
|
|
1558
1559
|
break;
|
|
@@ -1565,7 +1566,7 @@ var Gs = class {
|
|
|
1565
1566
|
}
|
|
1566
1567
|
else if (e.to) for (let l = this[p].length - 1; l > 0; l--) {
|
|
1567
1568
|
const a = this[p][l];
|
|
1568
|
-
if (a.opsType ===
|
|
1569
|
+
if (a.opsType === F.Append) {
|
|
1569
1570
|
const f = a.root ?? "default";
|
|
1570
1571
|
if (n && n !== f) continue;
|
|
1571
1572
|
if (o.splice(0, 0, a), e.to.charAt(0) === "/" && e.to === a.path) {
|
|
@@ -1579,7 +1580,7 @@ var Gs = class {
|
|
|
1579
1580
|
}
|
|
1580
1581
|
} else for (let l = this[p].length - 1; l > 0; l--) {
|
|
1581
1582
|
let a = this[p][l];
|
|
1582
|
-
if (a.opsType ===
|
|
1583
|
+
if (a.opsType === F.Append) {
|
|
1583
1584
|
o.push(a), i = l - 1;
|
|
1584
1585
|
break;
|
|
1585
1586
|
}
|
|
@@ -1590,7 +1591,7 @@ var Gs = class {
|
|
|
1590
1591
|
return;
|
|
1591
1592
|
}
|
|
1592
1593
|
let u = null;
|
|
1593
|
-
if (i !== -1 && (u = this[p][i]), this[
|
|
1594
|
+
if (i !== -1 && (u = this[p][i]), this[Ie](o)) {
|
|
1594
1595
|
if (t === !1)
|
|
1595
1596
|
return s.resolve(), r(!0), !0;
|
|
1596
1597
|
const l = () => (s.resolve(), r(!0), !0), a = this[p].length;
|
|
@@ -1601,14 +1602,14 @@ var Gs = class {
|
|
|
1601
1602
|
l();
|
|
1602
1603
|
}
|
|
1603
1604
|
} catch (i) {
|
|
1604
|
-
this[
|
|
1605
|
+
this[$](i), s.resolve(), r(!1);
|
|
1605
1606
|
}
|
|
1606
1607
|
});
|
|
1607
1608
|
});
|
|
1608
1609
|
}
|
|
1609
1610
|
open(...e) {
|
|
1610
1611
|
const t = this[I](e);
|
|
1611
|
-
return t ? (t.opsType =
|
|
1612
|
+
return t ? (t.opsType = F.Open, t.historyUpdatePolicy = t.historyUpdatePolicy ?? "push", this.to(t)) : (this[$]("resolve route fail", t), this);
|
|
1612
1613
|
}
|
|
1613
1614
|
close(e) {
|
|
1614
1615
|
return this[ge].post((t) => {
|
|
@@ -1639,46 +1640,46 @@ var Gs = class {
|
|
|
1639
1640
|
t.resolve();
|
|
1640
1641
|
return;
|
|
1641
1642
|
}
|
|
1642
|
-
this[
|
|
1643
|
+
this[Ie](s), t.resolve();
|
|
1643
1644
|
} catch (r) {
|
|
1644
|
-
this[
|
|
1645
|
+
this[$](r), t.resolve();
|
|
1645
1646
|
}
|
|
1646
1647
|
}), this;
|
|
1647
1648
|
}
|
|
1648
1649
|
to(...e) {
|
|
1649
1650
|
const t = this[I](e);
|
|
1650
1651
|
if (!t)
|
|
1651
|
-
return this[
|
|
1652
|
-
const r = this[
|
|
1653
|
-
return r == null ? (this[
|
|
1652
|
+
return this[$]("resolve route fail", t), this;
|
|
1653
|
+
const r = this[Oe].acquire(t);
|
|
1654
|
+
return r == null ? (this[$]("route forbid", t), this) : (this[ge].post((s) => {
|
|
1654
1655
|
try {
|
|
1655
1656
|
let i = this[Kt](t);
|
|
1656
|
-
this[
|
|
1657
|
+
this[jt](i), this[Mt](i), this[Lt](i), i.wait((n, o) => {
|
|
1657
1658
|
const u = n.session.to;
|
|
1658
1659
|
if (n.session.updateResult && n.session.updateResult.status === "success") try {
|
|
1659
|
-
const l = new
|
|
1660
|
+
const l = new dr(S.clone(u, !0), this[st]());
|
|
1660
1661
|
u.historyUpdatePolicy === "replace" ? this[x]?.replace(l) : u.historyUpdatePolicy === "traceless" ? this[x]?.setRouteMark(l) : this[x]?.push(l);
|
|
1661
1662
|
} catch (l) {
|
|
1662
1663
|
console.error(l.message, l);
|
|
1663
1664
|
}
|
|
1664
|
-
if (
|
|
1665
|
+
if (Ge.clear(n.session), this[Oe].release(r), typeof t.success == "function") try {
|
|
1665
1666
|
Reflect.apply(t.success, {}, []);
|
|
1666
1667
|
} catch (l) {
|
|
1667
1668
|
console.error(l.message, l);
|
|
1668
1669
|
}
|
|
1669
|
-
this[ce] === !1 && this[
|
|
1670
|
+
this[ce] === !1 && this[ot](!0), i = null, s.resolve();
|
|
1670
1671
|
}, (n, o) => {
|
|
1671
|
-
this[
|
|
1672
|
+
this[Oe].release(r), o !== null && this[$](o, t), this[ce] === !1 && this[ot](!1), Ge.clear(n.session), i = null, s.resolve();
|
|
1672
1673
|
});
|
|
1673
1674
|
} catch (i) {
|
|
1674
|
-
this[
|
|
1675
|
+
this[Oe].release(r), this[$](i, t), s.resolve();
|
|
1675
1676
|
}
|
|
1676
1677
|
}), this);
|
|
1677
1678
|
}
|
|
1678
1679
|
back(e = 1) {
|
|
1679
1680
|
this[x]?.go(-e, !1);
|
|
1680
1681
|
}
|
|
1681
|
-
[
|
|
1682
|
+
[Sr](e) {
|
|
1682
1683
|
return (t, r) => {
|
|
1683
1684
|
if (typeof t == "boolean")
|
|
1684
1685
|
e.session.redirect = !1, t ? e.resolve() : e.reject(r ?? null);
|
|
@@ -1694,11 +1695,11 @@ var Gs = class {
|
|
|
1694
1695
|
};
|
|
1695
1696
|
}
|
|
1696
1697
|
[Kt](e) {
|
|
1697
|
-
const t = new
|
|
1698
|
+
const t = new Ge(e, this[p].length > 0 ? this[p][this[p].length - 1] : void 0), r = {
|
|
1698
1699
|
route: e,
|
|
1699
1700
|
find: null
|
|
1700
1701
|
};
|
|
1701
|
-
if (this[
|
|
1702
|
+
if (this[et](r), r.find) {
|
|
1702
1703
|
t.routeModel = r.find, e.matched = r.find.matchedRoutes ?? [];
|
|
1703
1704
|
const s = {};
|
|
1704
1705
|
if (Array.isArray(r.find?.matchedRoutes)) for (let i = 0; i < r.find.matchedRoutes.length; i++) {
|
|
@@ -1707,11 +1708,11 @@ var Gs = class {
|
|
|
1707
1708
|
}
|
|
1708
1709
|
e.meta && typeof e.meta == "object" && Object.assign(s, e.meta), e.meta = s;
|
|
1709
1710
|
}
|
|
1710
|
-
return new
|
|
1711
|
+
return new ct(t);
|
|
1711
1712
|
}
|
|
1712
|
-
[
|
|
1713
|
-
for (let t of this[
|
|
1714
|
-
const s = this[
|
|
1713
|
+
[jt](e) {
|
|
1714
|
+
for (let t of this[Me]) e.post((r) => {
|
|
1715
|
+
const s = this[Sr](r);
|
|
1715
1716
|
Reflect.apply(t, {}, [
|
|
1716
1717
|
r.session.to,
|
|
1717
1718
|
r.session.from,
|
|
@@ -1720,9 +1721,9 @@ var Gs = class {
|
|
|
1720
1721
|
]);
|
|
1721
1722
|
});
|
|
1722
1723
|
}
|
|
1723
|
-
[
|
|
1724
|
+
[Lt](e) {
|
|
1724
1725
|
e.post((t) => {
|
|
1725
|
-
for (let r of this[
|
|
1726
|
+
for (let r of this[Te]) try {
|
|
1726
1727
|
Reflect.apply(r, {}, [
|
|
1727
1728
|
t.session.to,
|
|
1728
1729
|
t.session.from,
|
|
@@ -1734,15 +1735,15 @@ var Gs = class {
|
|
|
1734
1735
|
t.resolve();
|
|
1735
1736
|
});
|
|
1736
1737
|
}
|
|
1737
|
-
[
|
|
1738
|
-
for (let r of this[
|
|
1738
|
+
[Er](e, t) {
|
|
1739
|
+
for (let r of this[ke]) try {
|
|
1739
1740
|
Reflect.apply(r, {}, [e, t]);
|
|
1740
1741
|
} catch (s) {
|
|
1741
1742
|
console.error(s.message, s);
|
|
1742
1743
|
}
|
|
1743
1744
|
typeof e.destroy == "function" && Reflect.apply(e.destroy, e, []);
|
|
1744
1745
|
}
|
|
1745
|
-
[
|
|
1746
|
+
[Mt](e) {
|
|
1746
1747
|
e.post((t) => {
|
|
1747
1748
|
const r = t.session.to;
|
|
1748
1749
|
let s = t.session.routeModel;
|
|
@@ -1751,15 +1752,15 @@ var Gs = class {
|
|
|
1751
1752
|
route: r,
|
|
1752
1753
|
find: null
|
|
1753
1754
|
};
|
|
1754
|
-
if (this[
|
|
1755
|
-
else if (this[
|
|
1755
|
+
if (this[et](n)) s = n.find, t.session.routeModel = s;
|
|
1756
|
+
else if (this[nt]) s = this[nt];
|
|
1756
1757
|
else {
|
|
1757
1758
|
t.reject(`not find route model, path:${r.path ?? r.name}`);
|
|
1758
1759
|
return;
|
|
1759
1760
|
}
|
|
1760
1761
|
}
|
|
1761
|
-
const i =
|
|
1762
|
-
this[
|
|
1762
|
+
const i = Ge.from(t.session);
|
|
1763
|
+
this[wr](r, s, i).then((n) => {
|
|
1763
1764
|
this[W], t.session.updateResult = n ?? {
|
|
1764
1765
|
status: "success",
|
|
1765
1766
|
message: ""
|
|
@@ -1769,7 +1770,7 @@ var Gs = class {
|
|
|
1769
1770
|
});
|
|
1770
1771
|
});
|
|
1771
1772
|
}
|
|
1772
|
-
[
|
|
1773
|
+
[Ie](e) {
|
|
1773
1774
|
if (e.length == 0) return !0;
|
|
1774
1775
|
let t = this[W], r = [];
|
|
1775
1776
|
for (let s of e) {
|
|
@@ -1780,7 +1781,7 @@ var Gs = class {
|
|
|
1780
1781
|
});
|
|
1781
1782
|
}
|
|
1782
1783
|
if (r.length == 0)
|
|
1783
|
-
return this[
|
|
1784
|
+
return this[$]("can not find view index"), !1;
|
|
1784
1785
|
for (let s of r.reverse()) this[ue](t, {
|
|
1785
1786
|
x: s.x,
|
|
1786
1787
|
y: s.y
|
|
@@ -1794,7 +1795,7 @@ var Gs = class {
|
|
|
1794
1795
|
const n = e.layers[i];
|
|
1795
1796
|
for (let o = n.views.length - 1; o >= 0; o--) {
|
|
1796
1797
|
const u = n.views[o];
|
|
1797
|
-
if (u[G] && u[
|
|
1798
|
+
if (u[G] && u[at] === r)
|
|
1798
1799
|
return s = {
|
|
1799
1800
|
x: o,
|
|
1800
1801
|
y: i
|
|
@@ -1811,7 +1812,7 @@ var Gs = class {
|
|
|
1811
1812
|
let i = e.layers[t.y].views[t.x], n = !1, o = [], u = !1, l = [...i.slots.value];
|
|
1812
1813
|
for (let f = l.length - 1; f >= 0; f--) {
|
|
1813
1814
|
let c = l[f];
|
|
1814
|
-
(!r || r.indexOf(c.index) != -1) && (c.route && i[G] && (this[
|
|
1815
|
+
(!r || r.indexOf(c.index) != -1) && (c.route && i[G] && (this[Le](c.route), c.active === !0 && c.route.opsType == F.Append && (u = !0)), o.push(new O(i, c.index, t.y)), l.splice(f, 1));
|
|
1815
1816
|
}
|
|
1816
1817
|
if (l.length == 0) s ? i.slots.value = l : e.layers[t.y].views.splice(t.x, 1);
|
|
1817
1818
|
else {
|
|
@@ -1831,7 +1832,7 @@ var Gs = class {
|
|
|
1831
1832
|
let d = y.slots.value;
|
|
1832
1833
|
for (let m = d.length - 1; m >= 0; m--) {
|
|
1833
1834
|
let w = d[m];
|
|
1834
|
-
w.route && y[G] && this[
|
|
1835
|
+
w.route && y[G] && this[Le](w.route), c.push(new O(y, w.index, a)), d.splice(m, 1);
|
|
1835
1836
|
}
|
|
1836
1837
|
e.layers[a].views.splice(h, 1);
|
|
1837
1838
|
}
|
|
@@ -1853,30 +1854,30 @@ var Gs = class {
|
|
|
1853
1854
|
const o = e[n];
|
|
1854
1855
|
this[ge].post((u) => {
|
|
1855
1856
|
const l = this[Kt](o);
|
|
1856
|
-
this[
|
|
1857
|
+
this[jt](l), this[Mt](l), this[Lt](l), l.wait((a, f) => {
|
|
1857
1858
|
s = a.session.to, i = a.session.redirect, u.resolve();
|
|
1858
1859
|
}, (a, f) => {
|
|
1859
|
-
s = null, f !== null && this[
|
|
1860
|
+
s = null, f !== null && this[$](f), u.resolve();
|
|
1860
1861
|
});
|
|
1861
1862
|
});
|
|
1862
1863
|
}
|
|
1863
1864
|
this[ge].post((n) => {
|
|
1864
1865
|
if (s && i === !0) {
|
|
1865
|
-
const o = new
|
|
1866
|
+
const o = new dr(S.clone(s, !0), this[st]());
|
|
1866
1867
|
this[x]?.replace(o);
|
|
1867
1868
|
}
|
|
1868
1869
|
n.resolve(), t();
|
|
1869
1870
|
});
|
|
1870
1871
|
});
|
|
1871
1872
|
}
|
|
1872
|
-
async [
|
|
1873
|
-
const s = e.updateType ??
|
|
1874
|
-
await this[
|
|
1875
|
-
const i = this[
|
|
1873
|
+
async [wr](e, t, r) {
|
|
1874
|
+
const s = e.updateType ?? bt.Part;
|
|
1875
|
+
await this[br](t);
|
|
1876
|
+
const i = this[Rr](t, e, r, s);
|
|
1876
1877
|
if (i.status === "error") throw Error(i.message);
|
|
1877
1878
|
return i;
|
|
1878
1879
|
}
|
|
1879
|
-
[
|
|
1880
|
+
[br](e) {
|
|
1880
1881
|
let t = [];
|
|
1881
1882
|
for (let r = 0; r < e.layers.length; r++) {
|
|
1882
1883
|
let s = e.layers[r];
|
|
@@ -1887,17 +1888,17 @@ var Gs = class {
|
|
|
1887
1888
|
}
|
|
1888
1889
|
return t.length > 0 ? Promise.all(t) : Promise.resolve();
|
|
1889
1890
|
}
|
|
1890
|
-
[
|
|
1891
|
+
[Rr](e, t, r, s) {
|
|
1891
1892
|
if (e.layers[0].models.length !== 1) return {
|
|
1892
1893
|
status: "error",
|
|
1893
1894
|
message: "illegal route structure(multi root node)"
|
|
1894
1895
|
};
|
|
1895
1896
|
const i = e.layers[0].models[0];
|
|
1896
1897
|
let n = this[W], o = zs(n), u = t.root ?? "default", l;
|
|
1897
|
-
!o && s ==
|
|
1898
|
+
!o && s == bt.Part && (l = this[Pt](n, t));
|
|
1898
1899
|
let a, f = 0;
|
|
1899
|
-
if (l == null || l == null) if (o || s ===
|
|
1900
|
-
n.layers.length == 0 && (n.layers[0] = new
|
|
1900
|
+
if (l == null || l == null) if (o || s === bt.All)
|
|
1901
|
+
n.layers.length == 0 && (n.layers[0] = new Rt()), n.layers[0].views.length == 0 ? (a = new qe(t.root ?? "default", !0, null), n.layers[0].views = [a]) : a = n.layers[0].views[0], l = {
|
|
1901
1902
|
x: 0,
|
|
1902
1903
|
y: 0
|
|
1903
1904
|
};
|
|
@@ -1930,14 +1931,14 @@ var Gs = class {
|
|
|
1930
1931
|
status: "error",
|
|
1931
1932
|
message: "can not insert view(not find root node ref)"
|
|
1932
1933
|
};
|
|
1933
|
-
a = new
|
|
1934
|
+
a = new qe(u, !0, y), n.layers[h].views.push(a), l = {
|
|
1934
1935
|
x: n.layers[h].views.length - 1,
|
|
1935
1936
|
y: h
|
|
1936
1937
|
};
|
|
1937
1938
|
}
|
|
1938
1939
|
else a = n.layers[l.y].views[l.x];
|
|
1939
|
-
if (f = l.y, a[G] = !0, t.opsType ===
|
|
1940
|
-
t.index = t.index ??
|
|
1940
|
+
if (f = l.y, a[G] = !0, t.opsType === F.Append) {
|
|
1941
|
+
t.index = t.index ?? De.get(), t.active = !0;
|
|
1941
1942
|
let c = a.slots.value;
|
|
1942
1943
|
if (c.length > 0) {
|
|
1943
1944
|
let w = c[c.length - 1];
|
|
@@ -1947,7 +1948,7 @@ var Gs = class {
|
|
|
1947
1948
|
a.slots.value = [...c, h];
|
|
1948
1949
|
let y = f + 1, d = 1, m = new O(a, t.index, f);
|
|
1949
1950
|
this[se](n, y, e, d, m);
|
|
1950
|
-
} else if (t.opsType ===
|
|
1951
|
+
} else if (t.opsType === F.Open) {
|
|
1951
1952
|
let c = a.slots.value;
|
|
1952
1953
|
const h = t.active ?? !0;
|
|
1953
1954
|
let y = !1;
|
|
@@ -1963,7 +1964,7 @@ var Gs = class {
|
|
|
1963
1964
|
d.route && (d.route.active = d.active);
|
|
1964
1965
|
}
|
|
1965
1966
|
if (!y) {
|
|
1966
|
-
t.index = t.index ??
|
|
1967
|
+
t.index = t.index ?? De.get(), t.active = h;
|
|
1967
1968
|
let d = new re(t, i, t.index, h);
|
|
1968
1969
|
c.push(d);
|
|
1969
1970
|
let m = f + 1, w = 1, g = new O(a, t.index, f);
|
|
@@ -1973,17 +1974,17 @@ var Gs = class {
|
|
|
1973
1974
|
} else {
|
|
1974
1975
|
let c = a.slots.value;
|
|
1975
1976
|
if (c.length == 0) {
|
|
1976
|
-
t.index = t.index ??
|
|
1977
|
+
t.index = t.index ?? De.get(), t.active = !0, a.slots.value = [new re(t, i, t.index)];
|
|
1977
1978
|
let h = f + 1, y = 1, d = new O(a, t.index, f);
|
|
1978
1979
|
this[se](n, h, e, y, d);
|
|
1979
1980
|
} else {
|
|
1980
1981
|
let h = c[0];
|
|
1981
1982
|
if (h.model !== i) {
|
|
1982
|
-
this[ue](n, l, null, !0), t.index = t.index ??
|
|
1983
|
+
this[ue](n, l, null, !0), t.index = t.index ?? De.get(), t.active = !0, a.slots.value = [new re(t, i, t.index)];
|
|
1983
1984
|
let y = f + 1, d = 1, m = new O(a, t.index, f);
|
|
1984
1985
|
this[se](n, y, e, d, m);
|
|
1985
1986
|
} else {
|
|
1986
|
-
h.route !== null && this[
|
|
1987
|
+
h.route !== null && this[Le](h.route);
|
|
1987
1988
|
let y = !1;
|
|
1988
1989
|
const d = t.active ?? !0;
|
|
1989
1990
|
h.active !== d && (h.active = d, y = !0), t.active = d, t.index = h.index, h.route = t;
|
|
@@ -1997,7 +1998,7 @@ var Gs = class {
|
|
|
1997
1998
|
let q = n.layers[g].views[M];
|
|
1998
1999
|
q[ye] && O.include(w, q[ye]) && L.unshift(M);
|
|
1999
2000
|
}
|
|
2000
|
-
let
|
|
2001
|
+
let Ce = [];
|
|
2001
2002
|
for (let M of L) {
|
|
2002
2003
|
let q = n.layers[g].views[M], oe = e.layers[v].models, ee;
|
|
2003
2004
|
for (let T = 0; T < oe.length; T++) if (q.name === oe[T].name) {
|
|
@@ -2025,19 +2026,19 @@ var Gs = class {
|
|
|
2025
2026
|
let U = g + 1, V = v + 1;
|
|
2026
2027
|
this[se](n, U, e, V, j);
|
|
2027
2028
|
} else {
|
|
2028
|
-
q[G] && Q.route !== null && this[
|
|
2029
|
+
q[G] && Q.route !== null && this[Le](Q.route);
|
|
2029
2030
|
let U = [];
|
|
2030
2031
|
for (let V = 1; V < T.length; V++) U.push(T[V].index);
|
|
2031
2032
|
U.length > 0 && this[ue](n, {
|
|
2032
2033
|
x: M,
|
|
2033
2034
|
y: g
|
|
2034
|
-
}, U, !0),
|
|
2035
|
+
}, U, !0), Ce.push(new O(q, Q.index, g));
|
|
2035
2036
|
}
|
|
2036
2037
|
}
|
|
2037
2038
|
q[G] = !1;
|
|
2038
2039
|
}
|
|
2039
2040
|
}
|
|
2040
|
-
w =
|
|
2041
|
+
w = Ce;
|
|
2041
2042
|
}
|
|
2042
2043
|
this[se](n, g, e, v, j);
|
|
2043
2044
|
}
|
|
@@ -2047,7 +2048,7 @@ var Gs = class {
|
|
|
2047
2048
|
let c = a[z];
|
|
2048
2049
|
c && (t.slot = new Os(u, f, c?.view.name, c?.index ?? 0));
|
|
2049
2050
|
}
|
|
2050
|
-
return r.to = void 0, r.routeModel = void 0, this[
|
|
2051
|
+
return r.to = void 0, r.routeModel = void 0, this[xr](t, r), {
|
|
2051
2052
|
status: "success",
|
|
2052
2053
|
message: ""
|
|
2053
2054
|
};
|
|
@@ -2057,21 +2058,21 @@ var Gs = class {
|
|
|
2057
2058
|
for (; o < e.layers.length && n < r.layers.length; o++, n++) {
|
|
2058
2059
|
let u = e.layers[o].views;
|
|
2059
2060
|
for (let l of r.layers[n].models) {
|
|
2060
|
-
let a = new
|
|
2061
|
+
let a = new qe(l.name, !1, i), f = new re(null, l);
|
|
2061
2062
|
a.slots.value = [f], u.push(a);
|
|
2062
2063
|
}
|
|
2063
2064
|
}
|
|
2064
2065
|
for (; n < r.layers.length; n++) {
|
|
2065
|
-
let u = new
|
|
2066
|
+
let u = new Rt();
|
|
2066
2067
|
u.views = [];
|
|
2067
2068
|
for (let l of r.layers[n].models) {
|
|
2068
|
-
let a = new
|
|
2069
|
+
let a = new qe(l.name, !1, i), f = new re(null, l);
|
|
2069
2070
|
a.slots.value = [f], u.views.push(a);
|
|
2070
2071
|
}
|
|
2071
2072
|
e.layers.push(u);
|
|
2072
2073
|
}
|
|
2073
2074
|
}
|
|
2074
|
-
[
|
|
2075
|
+
[Vr](e, t, r, s, i, n) {
|
|
2075
2076
|
if (t < 0 || t > this[W].layers.length) return null;
|
|
2076
2077
|
if (t < this[W].layers.length) {
|
|
2077
2078
|
let a = this[W].layers[t], f = null;
|
|
@@ -2098,74 +2099,74 @@ var Gs = class {
|
|
|
2098
2099
|
index: n,
|
|
2099
2100
|
level: t - 1
|
|
2100
2101
|
});
|
|
2101
|
-
let l = new
|
|
2102
|
+
let l = new qe(e, !0, o);
|
|
2102
2103
|
if (l[ye] = u, t == this[W].layers.length) {
|
|
2103
|
-
let a = new
|
|
2104
|
+
let a = new Rt();
|
|
2104
2105
|
a.views = [l], this[W].layers.push(a);
|
|
2105
2106
|
} else this[W].layers[t].views.push(l);
|
|
2106
2107
|
return l;
|
|
2107
2108
|
}
|
|
2108
|
-
},
|
|
2109
|
-
[
|
|
2109
|
+
}, Ve = /* @__PURE__ */ Symbol("rk"), Tt = /* @__PURE__ */ Symbol("vd"), Pr = /* @__PURE__ */ Symbol("rv"), kt = /* @__PURE__ */ Symbol("rvi"), _r = /* @__PURE__ */ Symbol("pv"), It = /* @__PURE__ */ Symbol("pvi"), Be = /* @__PURE__ */ Symbol("registerKey"), zr = /* @__PURE__ */ Symbol("lc"), Xs = class {
|
|
2110
|
+
[Be] = /* @__PURE__ */ new Map();
|
|
2110
2111
|
constructor() {
|
|
2111
2112
|
}
|
|
2112
2113
|
set(e, t) {
|
|
2113
|
-
this[
|
|
2114
|
+
this[Be].set(e, t);
|
|
2114
2115
|
}
|
|
2115
2116
|
get(e) {
|
|
2116
|
-
return this[
|
|
2117
|
+
return this[Be].get(e);
|
|
2117
2118
|
}
|
|
2118
2119
|
has(e) {
|
|
2119
|
-
return this[
|
|
2120
|
+
return this[Be].has(e);
|
|
2120
2121
|
}
|
|
2121
2122
|
delete(e) {
|
|
2122
|
-
return this[
|
|
2123
|
+
return this[Be].delete(e);
|
|
2123
2124
|
}
|
|
2124
|
-
}, ne = /* @__PURE__ */ new WeakMap(),
|
|
2125
|
-
function
|
|
2125
|
+
}, ne = /* @__PURE__ */ new WeakMap(), Ne = [];
|
|
2126
|
+
function lt(e, t = !1) {
|
|
2126
2127
|
let r = e ? ne.get(e) ?? null : null;
|
|
2127
2128
|
return t && !r && (r = new Xs(), e && ne.set(e, r), Fe(() => {
|
|
2128
2129
|
e && ne.delete(e);
|
|
2129
|
-
}), te(
|
|
2130
|
+
}), te(zr, r)), r;
|
|
2130
2131
|
}
|
|
2131
|
-
function
|
|
2132
|
+
function dt(e) {
|
|
2132
2133
|
let t = e ? ne.get(e) ?? null : null;
|
|
2133
|
-
return !t &&
|
|
2134
|
+
return !t && _e() && (t = N(zr, null)), !t && Ne.length > 0 && (t = Ne[Ne.length - 1]), t;
|
|
2134
2135
|
}
|
|
2135
2136
|
async function Qs(e, t) {
|
|
2136
|
-
|
|
2137
|
+
Ne.push(e);
|
|
2137
2138
|
try {
|
|
2138
2139
|
return await t();
|
|
2139
2140
|
} finally {
|
|
2140
|
-
|
|
2141
|
+
Ne.pop();
|
|
2141
2142
|
}
|
|
2142
2143
|
}
|
|
2143
2144
|
function Ui(e) {
|
|
2144
|
-
const t =
|
|
2145
|
+
const t = jr();
|
|
2145
2146
|
if (!t) return !1;
|
|
2146
|
-
const r =
|
|
2147
|
+
const r = dt();
|
|
2147
2148
|
if (!r) return !1;
|
|
2148
2149
|
if (ne.set(t, r), Array.isArray(e)) for (let s = 0; s < e.length; s++) ne.set(e[s], r);
|
|
2149
2150
|
return Fe(() => {
|
|
2150
2151
|
if (ne.delete(t), Array.isArray(e)) for (let s = 0; s < e.length; s++) ne.delete(e[s]);
|
|
2151
2152
|
}), !0;
|
|
2152
2153
|
}
|
|
2153
|
-
function
|
|
2154
|
-
return
|
|
2154
|
+
function Gr(e, t) {
|
|
2155
|
+
return dt(e)?.get(t) ?? null;
|
|
2155
2156
|
}
|
|
2156
|
-
function Vi(e, t, r
|
|
2157
|
-
|
|
2157
|
+
function Vi(e, t, r) {
|
|
2158
|
+
dt(e)?.set(t, r);
|
|
2158
2159
|
}
|
|
2159
2160
|
function Wi(e, t, r) {
|
|
2160
|
-
|
|
2161
|
+
dt(e)?.delete(t);
|
|
2161
2162
|
}
|
|
2162
|
-
var
|
|
2163
|
+
var ht = /* @__PURE__ */ Symbol("hooksKey");
|
|
2163
2164
|
function Zs(e) {
|
|
2164
|
-
let t = e.get(
|
|
2165
|
-
t || (t = [], e.set(
|
|
2165
|
+
let t = e.get(ht);
|
|
2166
|
+
t || (t = [], e.set(ht, t));
|
|
2166
2167
|
}
|
|
2167
|
-
function
|
|
2168
|
-
const r = e.get(
|
|
2168
|
+
function Fr(e, t) {
|
|
2169
|
+
const r = e.get(ht);
|
|
2169
2170
|
r != null && Qs(e, async () => {
|
|
2170
2171
|
for (let s = r.length - 1; s >= 0; s--) {
|
|
2171
2172
|
let i = r[s];
|
|
@@ -2178,7 +2179,7 @@ function xr(e, t) {
|
|
|
2178
2179
|
}
|
|
2179
2180
|
});
|
|
2180
2181
|
}
|
|
2181
|
-
var
|
|
2182
|
+
var yt = /* @__PURE__ */ (function(e) {
|
|
2182
2183
|
return e.INACTIVATED = "ia", e.ACTIVATED = "a", e;
|
|
2183
2184
|
})({}), Ys = class {
|
|
2184
2185
|
type;
|
|
@@ -2202,9 +2203,9 @@ function ti(e, t, r) {
|
|
|
2202
2203
|
}
|
|
2203
2204
|
return s != -1 ? (e.splice(s, 1), !0) : !1;
|
|
2204
2205
|
}
|
|
2205
|
-
function
|
|
2206
|
+
function Xr(e) {
|
|
2206
2207
|
return (t) => {
|
|
2207
|
-
const r =
|
|
2208
|
+
const r = Gr(null, ht);
|
|
2208
2209
|
if (r == null) {
|
|
2209
2210
|
console.warn("[Fox]hooks context not found");
|
|
2210
2211
|
return;
|
|
@@ -2215,23 +2216,23 @@ function Vr(e) {
|
|
|
2215
2216
|
};
|
|
2216
2217
|
}
|
|
2217
2218
|
var Ji = function(e) {
|
|
2218
|
-
cs(e),
|
|
2219
|
+
cs(e), Xr(yt.ACTIVATED)(e);
|
|
2219
2220
|
}, zi = function(e) {
|
|
2220
|
-
hs(e),
|
|
2221
|
-
},
|
|
2222
|
-
function
|
|
2223
|
-
e.set(
|
|
2221
|
+
hs(e), Xr(yt.INACTIVATED)(e);
|
|
2222
|
+
}, Qr = /* @__PURE__ */ Symbol("routeKey");
|
|
2223
|
+
function Cr(e, t) {
|
|
2224
|
+
e.set(Qr, t);
|
|
2224
2225
|
}
|
|
2225
|
-
function
|
|
2226
|
-
const t =
|
|
2226
|
+
function Ut(e) {
|
|
2227
|
+
const t = Gr(e ?? null, Qr);
|
|
2227
2228
|
return typeof t == "function" ? t() : t;
|
|
2228
2229
|
}
|
|
2229
|
-
var ri = "FoxBeforeEnter", si = "FoxEnter", ii = "FoxLeave", ni = "FoxLeave",
|
|
2230
|
-
function
|
|
2230
|
+
var ri = "FoxBeforeEnter", si = "FoxEnter", ii = "FoxLeave", ni = "FoxLeave", Vt = "FoxLeaveEnd";
|
|
2231
|
+
function Zr(e, t = !1) {
|
|
2231
2232
|
let r = null;
|
|
2232
2233
|
return t ? r = e.showFromClass ?? e.enterFromClass : r = e.enterFromClass, r || (r = e.transitionName, r ? t ? `${r}-show-from` : `${r}-enter-from` : null);
|
|
2233
2234
|
}
|
|
2234
|
-
function
|
|
2235
|
+
function Yr(e, t = !1) {
|
|
2235
2236
|
let r = null;
|
|
2236
2237
|
return t ? r = e.showActiveClass ?? e.enterActiveClass : r = e.enterActiveClass, r || (r = e.transitionName, r ? t ? `${r}-show-active` : `${r}-enter-active` : null);
|
|
2237
2238
|
}
|
|
@@ -2239,11 +2240,11 @@ function oi(e, t = !1) {
|
|
|
2239
2240
|
let r = null;
|
|
2240
2241
|
return t ? r = e.showToClass ?? e.enterToClass : r = e.enterToClass, r || (r = e.transitionName, r ? t ? `${r}-show-to` : `${r}-enter-to` : null);
|
|
2241
2242
|
}
|
|
2242
|
-
function
|
|
2243
|
+
function es(e, t = !1) {
|
|
2243
2244
|
let r = null;
|
|
2244
2245
|
return t ? r = e.hideFromClass ?? e.leaveFromClass : r = e.leaveFromClass, r || (r = e.transitionName, r ? t ? `${r}-hide-from` : `${r}-leave-from` : null);
|
|
2245
2246
|
}
|
|
2246
|
-
function
|
|
2247
|
+
function ts(e, t = !1) {
|
|
2247
2248
|
let r = null;
|
|
2248
2249
|
return t ? r = e.hideActiveClass ?? e.leaveActiveClass : r = e.leaveActiveClass, r || (r = e.transitionName, r ? t ? `${r}-hide-active` : `${r}-leave-active` : null);
|
|
2249
2250
|
}
|
|
@@ -2283,7 +2284,7 @@ function mi(e, t = !1) {
|
|
|
2283
2284
|
let r = null;
|
|
2284
2285
|
return t ? r = e.hideCancelled ?? e.leaveCancelled : r = e.leaveCancelled, r;
|
|
2285
2286
|
}
|
|
2286
|
-
function
|
|
2287
|
+
function sr(e) {
|
|
2287
2288
|
let t, r = e.transitionDuration;
|
|
2288
2289
|
return typeof r == "object" ? t = {
|
|
2289
2290
|
enter: r.enter ?? -1,
|
|
@@ -2297,23 +2298,23 @@ function Zt(e) {
|
|
|
2297
2298
|
hide: r
|
|
2298
2299
|
}), t;
|
|
2299
2300
|
}
|
|
2300
|
-
function
|
|
2301
|
+
function Pe(e, t) {
|
|
2301
2302
|
e.classList.contains(t) || e.classList.add(t);
|
|
2302
2303
|
}
|
|
2303
2304
|
function Se(e, t) {
|
|
2304
2305
|
e.classList.remove(t);
|
|
2305
2306
|
}
|
|
2306
|
-
var vi =
|
|
2307
|
-
function
|
|
2307
|
+
var vi = Ee && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : setTimeout;
|
|
2308
|
+
function mt(e) {
|
|
2308
2309
|
vi(e);
|
|
2309
2310
|
}
|
|
2310
2311
|
function A(e, t) {
|
|
2311
2312
|
b(e) && Reflect.apply(e, null, t);
|
|
2312
2313
|
}
|
|
2313
|
-
function
|
|
2314
|
+
function rs(e, t, r = -1, s, i, n) {
|
|
2314
2315
|
let o = [];
|
|
2315
2316
|
const u = () => {
|
|
2316
|
-
for (let l of o)
|
|
2317
|
+
for (let l of o) Qt(e, l.type, l.listener);
|
|
2317
2318
|
o = [];
|
|
2318
2319
|
};
|
|
2319
2320
|
if (b(i)) {
|
|
@@ -2330,7 +2331,7 @@ function Zr(e, t, r = -1, s, i, n) {
|
|
|
2330
2331
|
const l = [
|
|
2331
2332
|
"animationend",
|
|
2332
2333
|
"transitionend",
|
|
2333
|
-
|
|
2334
|
+
Vt
|
|
2334
2335
|
], a = (f) => {
|
|
2335
2336
|
(f.target || f.srcElement) === f.currentTarget && (u(), Reflect.apply(i, null, [
|
|
2336
2337
|
e,
|
|
@@ -2339,7 +2340,7 @@ function Zr(e, t, r = -1, s, i, n) {
|
|
|
2339
2340
|
]));
|
|
2340
2341
|
};
|
|
2341
2342
|
l.forEach((f) => {
|
|
2342
|
-
|
|
2343
|
+
ft(e, f, a), o.push({
|
|
2343
2344
|
type: f,
|
|
2344
2345
|
listener: a
|
|
2345
2346
|
});
|
|
@@ -2353,21 +2354,21 @@ function Zr(e, t, r = -1, s, i, n) {
|
|
|
2353
2354
|
r
|
|
2354
2355
|
]));
|
|
2355
2356
|
};
|
|
2356
|
-
|
|
2357
|
+
ft(e, l, a), o.push({
|
|
2357
2358
|
type: l,
|
|
2358
2359
|
listener: a
|
|
2359
2360
|
});
|
|
2360
2361
|
}
|
|
2361
2362
|
}
|
|
2362
|
-
function
|
|
2363
|
-
return !
|
|
2364
|
-
}
|
|
2365
|
-
function
|
|
2366
|
-
if (e ||
|
|
2367
|
-
const n =
|
|
2368
|
-
n &&
|
|
2369
|
-
const o =
|
|
2370
|
-
o &&
|
|
2363
|
+
function vt(e) {
|
|
2364
|
+
return !Ee || e === null ? !1 : e.opsType === F.Append || e.opsType === F.Open;
|
|
2365
|
+
}
|
|
2366
|
+
function ss(e, t, r = {}, s, i = -1) {
|
|
2367
|
+
if (e || vt(s)) {
|
|
2368
|
+
const n = Zr(r, e);
|
|
2369
|
+
n && Pe(t, n);
|
|
2370
|
+
const o = Yr(r, e);
|
|
2371
|
+
o && Pe(t, o), A(ai(r, e), [
|
|
2371
2372
|
t,
|
|
2372
2373
|
e,
|
|
2373
2374
|
s,
|
|
@@ -2375,18 +2376,18 @@ function Yr(e, t, r = {}, s, i = -1) {
|
|
|
2375
2376
|
]);
|
|
2376
2377
|
}
|
|
2377
2378
|
}
|
|
2378
|
-
function
|
|
2379
|
-
if (!
|
|
2379
|
+
function is(e, t, r = {}, s, i, n, o) {
|
|
2380
|
+
if (!vt(i) && !e) {
|
|
2380
2381
|
b(o) && o(o, [t]);
|
|
2381
2382
|
return;
|
|
2382
2383
|
}
|
|
2383
|
-
const u =
|
|
2384
|
+
const u = Zr(r, e), l = Yr(r, e), a = oi(r, e), f = ui(r, e), c = fi(r, e), h = ci(r, e);
|
|
2384
2385
|
if (!u && !l && !a && !f) {
|
|
2385
2386
|
b(o) && o(o, [t]);
|
|
2386
2387
|
return;
|
|
2387
2388
|
}
|
|
2388
|
-
|
|
2389
|
-
|
|
2389
|
+
mt(() => {
|
|
2390
|
+
rs(t, i, n, s, () => {
|
|
2390
2391
|
l && Se(t, l), a && Se(t, a), b(c) && A(c, [
|
|
2391
2392
|
t,
|
|
2392
2393
|
e,
|
|
@@ -2400,7 +2401,7 @@ function es(e, t, r = {}, s, i, n, o) {
|
|
|
2400
2401
|
i,
|
|
2401
2402
|
n
|
|
2402
2403
|
]);
|
|
2403
|
-
}), u && Se(t, u), a &&
|
|
2404
|
+
}), u && Se(t, u), a && Pe(t, a), b(f) && A(f, [
|
|
2404
2405
|
t,
|
|
2405
2406
|
e,
|
|
2406
2407
|
i,
|
|
@@ -2408,12 +2409,12 @@ function es(e, t, r = {}, s, i, n, o) {
|
|
|
2408
2409
|
]);
|
|
2409
2410
|
});
|
|
2410
2411
|
}
|
|
2411
|
-
function
|
|
2412
|
-
if (e ||
|
|
2413
|
-
const n =
|
|
2414
|
-
n &&
|
|
2415
|
-
const o =
|
|
2416
|
-
o &&
|
|
2412
|
+
function ns(e, t, r = {}, s, i = -1) {
|
|
2413
|
+
if (e || vt(s)) {
|
|
2414
|
+
const n = es(r, e);
|
|
2415
|
+
n && Pe(t, n);
|
|
2416
|
+
const o = ts(r, e);
|
|
2417
|
+
o && Pe(t, o), A(hi(r, e), [
|
|
2417
2418
|
t,
|
|
2418
2419
|
e,
|
|
2419
2420
|
s,
|
|
@@ -2421,18 +2422,18 @@ function ts(e, t, r = {}, s, i = -1) {
|
|
|
2421
2422
|
]);
|
|
2422
2423
|
}
|
|
2423
2424
|
}
|
|
2424
|
-
function
|
|
2425
|
-
if (!
|
|
2425
|
+
function os(e, t, r = {}, s, i, n, o, u) {
|
|
2426
|
+
if (!vt(n) && !e) {
|
|
2426
2427
|
b(u) && A(u, [t]), !e && b(i) && i();
|
|
2427
2428
|
return;
|
|
2428
2429
|
}
|
|
2429
|
-
const l =
|
|
2430
|
+
const l = es(r, e), a = ts(r, e), f = li(r, e), c = yi(r, e), h = di(r, e), y = mi(r, e);
|
|
2430
2431
|
if (!l && !a && !f && !c) {
|
|
2431
2432
|
b(u) && A(u, [t]), !e && b(i) && i();
|
|
2432
2433
|
return;
|
|
2433
2434
|
}
|
|
2434
|
-
|
|
2435
|
-
|
|
2435
|
+
mt(() => {
|
|
2436
|
+
rs(t, n, o, s, () => {
|
|
2436
2437
|
try {
|
|
2437
2438
|
a && Se(t, a), f && Se(t, f), b(h) && A(h, [
|
|
2438
2439
|
t,
|
|
@@ -2454,7 +2455,7 @@ function rs(e, t, r = {}, s, i, n, o, u) {
|
|
|
2454
2455
|
} finally {
|
|
2455
2456
|
!e && b(i) && i();
|
|
2456
2457
|
}
|
|
2457
|
-
}), l && Se(t, l), f &&
|
|
2458
|
+
}), l && Se(t, l), f && Pe(t, f), b(c) && A(c, [
|
|
2458
2459
|
t,
|
|
2459
2460
|
e,
|
|
2460
2461
|
n,
|
|
@@ -2462,78 +2463,78 @@ function rs(e, t, r = {}, s, i, n, o, u) {
|
|
|
2462
2463
|
]);
|
|
2463
2464
|
});
|
|
2464
2465
|
}
|
|
2465
|
-
function
|
|
2466
|
-
const i = t.mode ?? "default", n =
|
|
2466
|
+
function Wt(e, t = {}, r, s = -1) {
|
|
2467
|
+
const i = t.mode ?? "default", n = sr(t);
|
|
2467
2468
|
return {
|
|
2468
2469
|
mode: i,
|
|
2469
2470
|
persisted: !1,
|
|
2470
2471
|
beforeEnter: (o) => {
|
|
2471
|
-
|
|
2472
|
+
ss(!1, o, t, r, s);
|
|
2472
2473
|
},
|
|
2473
2474
|
enter: (o) => {
|
|
2474
|
-
|
|
2475
|
+
is(!1, o, t, n.enter, r, s);
|
|
2475
2476
|
},
|
|
2476
2477
|
leave: (o, u) => {
|
|
2477
|
-
|
|
2478
|
+
ns(!1, o, t, r, s), os(!1, o, t, n.leave, u, r, s, () => {
|
|
2478
2479
|
e.transition = null;
|
|
2479
2480
|
});
|
|
2480
2481
|
},
|
|
2481
|
-
clone: (o) =>
|
|
2482
|
+
clone: (o) => Wt(e, t, r, s)
|
|
2482
2483
|
};
|
|
2483
2484
|
}
|
|
2484
|
-
function
|
|
2485
|
+
function ls(e) {
|
|
2485
2486
|
return e.el;
|
|
2486
2487
|
}
|
|
2487
2488
|
function pi(e, t = {}, r, s, i, n) {
|
|
2488
2489
|
if (i === !0) {
|
|
2489
|
-
const o =
|
|
2490
|
+
const o = ls(e);
|
|
2490
2491
|
if (o == null) return;
|
|
2491
|
-
const u =
|
|
2492
|
-
|
|
2492
|
+
const u = sr(t);
|
|
2493
|
+
ss(!0, o, t, r, s), is(!0, o, t, u.show, r, s, (l) => {
|
|
2493
2494
|
b(n) && A(n, [l]);
|
|
2494
2495
|
});
|
|
2495
2496
|
} else b(n) && A(n, []);
|
|
2496
2497
|
}
|
|
2497
2498
|
function gi(e, t = {}, r, s, i, n) {
|
|
2498
2499
|
if (i === !0) {
|
|
2499
|
-
const o =
|
|
2500
|
+
const o = ls(e);
|
|
2500
2501
|
if (o == null) return;
|
|
2501
|
-
const u =
|
|
2502
|
-
|
|
2502
|
+
const u = sr(t);
|
|
2503
|
+
ns(!0, o, t, r, s), os(!0, o, t, u.hide, null, r, s, (l) => {
|
|
2503
2504
|
b(n) && A(n, [l]);
|
|
2504
2505
|
});
|
|
2505
2506
|
} else b(n) && A(n, []);
|
|
2506
2507
|
}
|
|
2507
2508
|
function wi(e) {
|
|
2508
|
-
|
|
2509
|
+
mt(() => {
|
|
2509
2510
|
for (let t = 0; t < e.length; t++) Reflect.apply(e[t], null, []);
|
|
2510
2511
|
});
|
|
2511
2512
|
}
|
|
2512
|
-
function
|
|
2513
|
+
function as(e, t = {}, r, s = -1) {
|
|
2513
2514
|
return {
|
|
2514
2515
|
mode: t.mode ?? "default",
|
|
2515
2516
|
persisted: !1,
|
|
2516
2517
|
beforeEnter: (i) => {
|
|
2517
|
-
|
|
2518
|
+
ze(ri, {}, i);
|
|
2518
2519
|
},
|
|
2519
2520
|
enter: (i) => {
|
|
2520
|
-
|
|
2521
|
+
ze(si, {}, i);
|
|
2521
2522
|
},
|
|
2522
2523
|
leave: (i, n) => {
|
|
2523
|
-
|
|
2524
|
+
ze(ii, {}, i), mt(() => {
|
|
2524
2525
|
const o = (u) => {
|
|
2525
|
-
(u.target || u.srcElement) === u.currentTarget && (
|
|
2526
|
+
(u.target || u.srcElement) === u.currentTarget && (Qt(i, Vt, o), n && Reflect.apply(n, null, []), e.transition = null);
|
|
2526
2527
|
};
|
|
2527
|
-
|
|
2528
|
+
ft(i, Vt, o), ze(ni, {}, i);
|
|
2528
2529
|
});
|
|
2529
2530
|
},
|
|
2530
|
-
clone: (i) =>
|
|
2531
|
+
clone: (i) => as(e, t, r, s)
|
|
2531
2532
|
};
|
|
2532
2533
|
}
|
|
2533
2534
|
function ie(e, t, r) {
|
|
2534
2535
|
return typeof e == "function" ? Reflect.apply(e, {}, [t, r]) : e;
|
|
2535
2536
|
}
|
|
2536
|
-
function
|
|
2537
|
+
function Ot(e, t) {
|
|
2537
2538
|
if (!e) return null;
|
|
2538
2539
|
const r = e(t);
|
|
2539
2540
|
return r.length === 1 ? r[0] : r;
|
|
@@ -2547,7 +2548,7 @@ var bi = class {
|
|
|
2547
2548
|
constructor(e, t) {
|
|
2548
2549
|
this.node = e, this.state = t;
|
|
2549
2550
|
}
|
|
2550
|
-
},
|
|
2551
|
+
}, Jt = Kr({
|
|
2551
2552
|
name: "RouterView",
|
|
2552
2553
|
inheritAttrs: !1,
|
|
2553
2554
|
props: {
|
|
@@ -2737,27 +2738,27 @@ var bi = class {
|
|
|
2737
2738
|
}
|
|
2738
2739
|
},
|
|
2739
2740
|
setup(e, t) {
|
|
2740
|
-
const r =
|
|
2741
|
+
const r = jr(), s = e.multi === !0, i = N(Ve, null), n = N(Tt, 0), o = N(Pr, null), u = N(kt, -1);
|
|
2741
2742
|
let l = null, a = e.modelSlot ?? null;
|
|
2742
2743
|
if (a) {
|
|
2743
|
-
if (te(
|
|
2744
|
+
if (te(Tt, n + 1), te(kt, a.index), te(It, a.index), !a.route) {
|
|
2744
2745
|
console.warn("[Fox]child view render error, route not exist");
|
|
2745
2746
|
return;
|
|
2746
2747
|
}
|
|
2747
|
-
const c =
|
|
2748
|
-
c && (Zs(c),
|
|
2748
|
+
const c = lt(a, !0);
|
|
2749
|
+
c && (Zs(c), Cr(c, () => a?.route ?? null));
|
|
2749
2750
|
} else {
|
|
2750
2751
|
if (i == null) {
|
|
2751
2752
|
console.error("[Fox]router is not been injected");
|
|
2752
2753
|
return;
|
|
2753
2754
|
}
|
|
2754
|
-
const c = e.name, h = N(
|
|
2755
|
-
if (l = i[
|
|
2756
|
-
te(
|
|
2755
|
+
const c = e.name, h = N(_r, null), y = N(It, 0);
|
|
2756
|
+
if (l = i[Vr](c, n, o, u, h, y), l === null) return;
|
|
2757
|
+
te(_r, l);
|
|
2757
2758
|
const d = l[G] === !0;
|
|
2758
|
-
if (d && te(
|
|
2759
|
-
const m =
|
|
2760
|
-
m &&
|
|
2759
|
+
if (d && te(Pr, l), !s && (te(kt, -1), te(Tt, n + 1), te(It, -1), d && r)) {
|
|
2760
|
+
const m = lt(r, !0);
|
|
2761
|
+
m && Cr(m, () => {
|
|
2761
2762
|
const w = l?.slots.value ?? [];
|
|
2762
2763
|
return w.length > 0 ? w[0].route : null;
|
|
2763
2764
|
});
|
|
@@ -2773,44 +2774,44 @@ var bi = class {
|
|
|
2773
2774
|
if (s) {
|
|
2774
2775
|
const c = /* @__PURE__ */ new Map(), h = [], y = l?.slots.value, d = [];
|
|
2775
2776
|
for (let g = 0; g < y.length; g++) {
|
|
2776
|
-
const v = y[g], j = `${e.name}_${v.index}`, L = ie(e.transition, v.route, g) ?? !0,
|
|
2777
|
+
const v = y[g], j = `${e.name}_${v.index}`, L = ie(e.transition, v.route, g) ?? !0, Ce = { modelSlot: v };
|
|
2777
2778
|
let M;
|
|
2778
|
-
t.slots.default ? M = he(
|
|
2779
|
+
t.slots.default ? M = he(Jt, Ce, { default: t.slots.default }) : M = he(Jt, Ce);
|
|
2779
2780
|
const q = {}, oe = ie(e.viewClass, v.route, g);
|
|
2780
2781
|
typeof oe == "string" && oe.length > 0 && (q[oe] = !0);
|
|
2781
2782
|
const ee = ie(e.viewActiveClass, v.route, g), T = ie(e.viewInactiveClass, v.route, g), Q = f.value.get(j);
|
|
2782
2783
|
if (typeof ee == "string" && ee.length > 0 && (q[ee] = v.active), typeof T == "string" && T.length > 0 && (q[T] = !v.active), Q && v.active !== Q.state) {
|
|
2783
|
-
const
|
|
2784
|
+
const ir = Q.node;
|
|
2784
2785
|
v.active ? d.unshift(() => {
|
|
2785
|
-
const
|
|
2786
|
-
const
|
|
2787
|
-
|
|
2786
|
+
const pt = () => {
|
|
2787
|
+
const Ae = lt(v);
|
|
2788
|
+
Ae != null && Fr(Ae, yt.ACTIVATED);
|
|
2788
2789
|
};
|
|
2789
|
-
pi(
|
|
2790
|
+
pi(ir, e, v.route, g, L, pt);
|
|
2790
2791
|
}) : d.push(() => {
|
|
2791
|
-
const
|
|
2792
|
-
const
|
|
2793
|
-
|
|
2792
|
+
const pt = () => {
|
|
2793
|
+
const Ae = lt(v);
|
|
2794
|
+
Ae != null && Fr(Ae, yt.INACTIVATED);
|
|
2794
2795
|
};
|
|
2795
|
-
gi(
|
|
2796
|
+
gi(ir, e, v.route, g, L, pt);
|
|
2796
2797
|
});
|
|
2797
2798
|
}
|
|
2798
2799
|
const U = {
|
|
2799
2800
|
class: q,
|
|
2800
2801
|
key: j
|
|
2801
2802
|
}, V = ie(e.viewTagProps, v.route, g);
|
|
2802
|
-
V !== null && typeof V == "object" &&
|
|
2803
|
+
V !== null && typeof V == "object" && K(!0, U, we(V, i?.propsFilter)), v.route?.viewTagAttrs && typeof v.route?.viewTagAttrs == "object" && K(!0, U, we(v.route.viewTagAttrs, i?.propsFilter));
|
|
2803
2804
|
const ve = he(ie(e.viewTag, v.route, g), U, { default: () => [M] });
|
|
2804
|
-
c.set(j, new bi(ve, v.active)), f.value.delete(j), L === !0 ? ve.transition =
|
|
2805
|
+
c.set(j, new bi(ve, v.active)), f.value.delete(j), L === !0 ? ve.transition = Wt(ve, e, v.route, g) : L === "custom" && (ve.transition = as(ve, e, v.route, g)), h.push(ve);
|
|
2805
2806
|
}
|
|
2806
2807
|
f.value = c, wi(d);
|
|
2807
2808
|
const m = ie(e.tag, null, -1), w = {};
|
|
2808
2809
|
return Object.assign(w, t.attrs), he(m, w, { default: () => h });
|
|
2809
2810
|
} else if (a != null) {
|
|
2810
2811
|
const c = a.model, h = {};
|
|
2811
|
-
c.props && (typeof c.props == "object" ?
|
|
2812
|
+
c.props && (typeof c.props == "object" ? K(!1, h, we(c.props, i?.propsFilter)) : c.props === !0 && typeof a.route?.params == "object" && K(!1, h, we(a.route.params, i?.propsFilter)));
|
|
2812
2813
|
const y = he(c.component, h);
|
|
2813
|
-
return
|
|
2814
|
+
return Ot(t.slots.default, {
|
|
2814
2815
|
Component: y,
|
|
2815
2816
|
route: a.route
|
|
2816
2817
|
}) ?? y;
|
|
@@ -2818,13 +2819,13 @@ var bi = class {
|
|
|
2818
2819
|
const c = l?.slots.value ?? [];
|
|
2819
2820
|
if (c.length > 0) {
|
|
2820
2821
|
const h = c[0], y = h.route, d = h.model, m = {};
|
|
2821
|
-
d.props && (typeof d.props == "object" ?
|
|
2822
|
+
d.props && (typeof d.props == "object" ? K(!1, m, we(d.props, i?.propsFilter)) : d.props === !0 && typeof y?.params == "object" && K(!1, m, we(y.params, i?.propsFilter)));
|
|
2822
2823
|
const w = he(d.component, m);
|
|
2823
|
-
return (ie(e.transition, y, -1) ?? !0) && (w.transition =
|
|
2824
|
+
return (ie(e.transition, y, -1) ?? !0) && (w.transition = Wt(w, e, y, -1)), Ot(t.slots.default, {
|
|
2824
2825
|
Component: w,
|
|
2825
2826
|
route: y
|
|
2826
2827
|
}) ?? w;
|
|
2827
|
-
} else return
|
|
2828
|
+
} else return Ot(t.slots.fallback, {});
|
|
2828
2829
|
}
|
|
2829
2830
|
};
|
|
2830
2831
|
}
|
|
@@ -2844,7 +2845,7 @@ function xi(e, t) {
|
|
|
2844
2845
|
function be(e, t) {
|
|
2845
2846
|
return typeof e == "function" ? Reflect.apply(e, {}, [t]) : e;
|
|
2846
2847
|
}
|
|
2847
|
-
var Si =
|
|
2848
|
+
var Si = Kr({
|
|
2848
2849
|
name: "RouterLink",
|
|
2849
2850
|
inheritAttrs: !1,
|
|
2850
2851
|
props: {
|
|
@@ -2891,7 +2892,7 @@ var Si = _r({
|
|
|
2891
2892
|
}
|
|
2892
2893
|
},
|
|
2893
2894
|
setup(e, t) {
|
|
2894
|
-
const r = N(
|
|
2895
|
+
const r = N(Ve, null);
|
|
2895
2896
|
return () => {
|
|
2896
2897
|
let s = be(e.to, null), i = be(e.tag, s);
|
|
2897
2898
|
if (i == null) {
|
|
@@ -2906,7 +2907,7 @@ var Si = _r({
|
|
|
2906
2907
|
typeof c == "string" && c.length > 0 && (u[c] = S.isSamePathForRoute(n, o));
|
|
2907
2908
|
}
|
|
2908
2909
|
let a = { class: u };
|
|
2909
|
-
(i === "a" || i === "A") && (a.href = n?.path ?? n?.name ?? "#"),
|
|
2910
|
+
(i === "a" || i === "A") && (a.href = n?.path ?? n?.name ?? "#"), K(!0, a, t.attrs);
|
|
2910
2911
|
const f = be(e.event, n);
|
|
2911
2912
|
if (typeof f == "string") {
|
|
2912
2913
|
const c = (h) => {
|
|
@@ -2925,22 +2926,22 @@ var Si = _r({
|
|
|
2925
2926
|
return he(i, a, t.slots);
|
|
2926
2927
|
};
|
|
2927
2928
|
}
|
|
2928
|
-
}),
|
|
2929
|
+
}), ut = /* @__PURE__ */ (function(e) {
|
|
2929
2930
|
return e[e.limitless = 0] = "limitless", e[e.once = 1] = "once", e;
|
|
2930
|
-
})(
|
|
2931
|
+
})(ut || {}), Re = /* @__PURE__ */ Symbol("registerKey"), Ei = class {
|
|
2931
2932
|
policy;
|
|
2932
2933
|
callback;
|
|
2933
2934
|
constructor(e, t) {
|
|
2934
2935
|
this.callback = e, this.policy = t;
|
|
2935
2936
|
}
|
|
2936
|
-
},
|
|
2937
|
+
}, Ar = class {
|
|
2937
2938
|
[Re] = /* @__PURE__ */ new Map();
|
|
2938
2939
|
constructor() {
|
|
2939
2940
|
}
|
|
2940
2941
|
on(e, t, r = !1) {
|
|
2941
2942
|
let s = this[Re].get(e);
|
|
2942
2943
|
s || (s = new Array(), this[Re].set(e, s));
|
|
2943
|
-
let i = new
|
|
2944
|
+
let i = new Ei(t, r === !0 ? ut.once : ut.limitless);
|
|
2944
2945
|
return s.push(i), this;
|
|
2945
2946
|
}
|
|
2946
2947
|
off(e, t) {
|
|
@@ -2981,8 +2982,8 @@ var Si = _r({
|
|
|
2981
2982
|
if (!r) return this;
|
|
2982
2983
|
for (let s = 0; s < r.length; ) {
|
|
2983
2984
|
let i = r[s];
|
|
2984
|
-
if (i.policy ==
|
|
2985
|
-
|
|
2985
|
+
if (i.policy == ut.once ? r.splice(s, 1) : s++, typeof i.callback == "function") try {
|
|
2986
|
+
He(() => {
|
|
2986
2987
|
Reflect.apply(i.callback, {}, t);
|
|
2987
2988
|
});
|
|
2988
2989
|
} catch (n) {
|
|
@@ -2994,13 +2995,13 @@ var Si = _r({
|
|
|
2994
2995
|
trigger(e, ...t) {
|
|
2995
2996
|
return Reflect.apply(this.emit, this, [e, ...t]);
|
|
2996
2997
|
}
|
|
2997
|
-
},
|
|
2998
|
+
}, Pi = "FoxRouterView", _i = "FoxRouterLink", H = /* @__PURE__ */ (function(e) {
|
|
2998
2999
|
return e[e.Loading = 0] = "Loading", e[e.Loaded = 1] = "Loaded", e[e.Defining = 2] = "Defining", e[e.Defined = 3] = "Defined", e;
|
|
2999
3000
|
})({});
|
|
3000
|
-
function
|
|
3001
|
+
function Fi(e) {
|
|
3001
3002
|
return e == H.Loaded || e === H.Defined;
|
|
3002
3003
|
}
|
|
3003
|
-
var
|
|
3004
|
+
var qr = /* @__PURE__ */ (function(e) {
|
|
3004
3005
|
return e[e.normal = 0] = "normal", e[e.factory = 1] = "factory", e;
|
|
3005
3006
|
})({}), Ci = class {
|
|
3006
3007
|
register = /* @__PURE__ */ new Map();
|
|
@@ -3040,7 +3041,7 @@ var Er = /* @__PURE__ */ (function(e) {
|
|
|
3040
3041
|
clear() {
|
|
3041
3042
|
this.register.clear(), this.regExpRegisters = [];
|
|
3042
3043
|
}
|
|
3043
|
-
},
|
|
3044
|
+
}, Bt = [
|
|
3044
3045
|
"require",
|
|
3045
3046
|
"exports",
|
|
3046
3047
|
"module"
|
|
@@ -3048,7 +3049,7 @@ var Er = /* @__PURE__ */ (function(e) {
|
|
|
3048
3049
|
async function Ai(e) {
|
|
3049
3050
|
return await new Function("url", "return import(url)")(e);
|
|
3050
3051
|
}
|
|
3051
|
-
var
|
|
3052
|
+
var $r = class {
|
|
3052
3053
|
moduleManager = new Ci();
|
|
3053
3054
|
_alias = {};
|
|
3054
3055
|
set alias(e) {
|
|
@@ -3079,7 +3080,7 @@ var Fr = class {
|
|
|
3079
3080
|
return this._query;
|
|
3080
3081
|
}
|
|
3081
3082
|
get head() {
|
|
3082
|
-
return
|
|
3083
|
+
return Je().head;
|
|
3083
3084
|
}
|
|
3084
3085
|
_cssMountPoint = null;
|
|
3085
3086
|
set cssMountPoint(e) {
|
|
@@ -3101,14 +3102,14 @@ var Fr = class {
|
|
|
3101
3102
|
src: "",
|
|
3102
3103
|
status: H.Loaded
|
|
3103
3104
|
};
|
|
3104
|
-
typeof t == "function" ? (r.exports = t, r.type =
|
|
3105
|
+
typeof t == "function" ? (r.exports = t, r.type = qr.factory) : r.exports = t, this.moduleManager.set(e, r);
|
|
3105
3106
|
}
|
|
3106
3107
|
removeModule(e) {
|
|
3107
3108
|
this.moduleManager.remove(e);
|
|
3108
3109
|
}
|
|
3109
3110
|
getModuleExports(e) {
|
|
3110
3111
|
const t = this.moduleManager.get(e);
|
|
3111
|
-
return t &&
|
|
3112
|
+
return t && Fi(t.status) ? t.type === qr.factory && typeof t.exports == "function" ? t.exports() : t.exports : null;
|
|
3112
3113
|
}
|
|
3113
3114
|
exposeRequire(e = "__foxRequire", t, r) {
|
|
3114
3115
|
const s = t ?? C();
|
|
@@ -3119,7 +3120,7 @@ var Fr = class {
|
|
|
3119
3120
|
}
|
|
3120
3121
|
resloveResource(e) {
|
|
3121
3122
|
if (typeof e == "string") {
|
|
3122
|
-
if (
|
|
3123
|
+
if (Bt.includes(e)) return e;
|
|
3123
3124
|
if (e = this.alias?.[e] ?? e, typeof this.resourceParser == "function") {
|
|
3124
3125
|
const r = this.resloveResource(e);
|
|
3125
3126
|
if (!r) return r;
|
|
@@ -3172,9 +3173,9 @@ var Fr = class {
|
|
|
3172
3173
|
} catch (f) {
|
|
3173
3174
|
console.error(f), r(f);
|
|
3174
3175
|
}
|
|
3175
|
-
}), u = new
|
|
3176
|
+
}), u = new ct();
|
|
3176
3177
|
for (let l = 0; l < s.length; l++) {
|
|
3177
|
-
const a = new
|
|
3178
|
+
const a = new $i(l, s[l], o);
|
|
3178
3179
|
this.mount(u, a);
|
|
3179
3180
|
}
|
|
3180
3181
|
return this;
|
|
@@ -3215,7 +3216,7 @@ var Fr = class {
|
|
|
3215
3216
|
return;
|
|
3216
3217
|
}
|
|
3217
3218
|
if (typeof t.resource == "string") {
|
|
3218
|
-
if (
|
|
3219
|
+
if (Bt.includes(t.resource)) {
|
|
3219
3220
|
e.post((i) => {
|
|
3220
3221
|
t.progress.work(!0, t.index, t.resource), i.resolve();
|
|
3221
3222
|
});
|
|
@@ -3247,7 +3248,7 @@ var Fr = class {
|
|
|
3247
3248
|
t.progress.work(!0, t.index, n), s.resolve();
|
|
3248
3249
|
return;
|
|
3249
3250
|
}
|
|
3250
|
-
const o =
|
|
3251
|
+
const o = Je(), u = o.createElement("link"), l = "onload" in u;
|
|
3251
3252
|
l && (u.onload = () => {
|
|
3252
3253
|
u.onload = null, u.onerror = null, t.progress.work(!0, t.index, i.path), s.resolve();
|
|
3253
3254
|
}, u.onerror = () => {
|
|
@@ -3275,7 +3276,7 @@ var Fr = class {
|
|
|
3275
3276
|
status: H.Loading
|
|
3276
3277
|
};
|
|
3277
3278
|
this.moduleManager.set(i.path, o);
|
|
3278
|
-
const u =
|
|
3279
|
+
const u = Je().createElement("script");
|
|
3279
3280
|
if ("onload" in u)
|
|
3280
3281
|
u.onload = () => {
|
|
3281
3282
|
u.onload = null, u.onerror = null, o.status === H.Loading && (o.status = H.Loaded, t.progress.work(!0, t.index, i.path)), s.resolve();
|
|
@@ -3312,7 +3313,7 @@ var Fr = class {
|
|
|
3312
3313
|
}
|
|
3313
3314
|
try {
|
|
3314
3315
|
let n = await Ai(s.path);
|
|
3315
|
-
if (
|
|
3316
|
+
if (Yt(n) && (n = n.default ?? n), We(n)) {
|
|
3316
3317
|
t.progress.work(!1, t.index, n), r.resolve();
|
|
3317
3318
|
return;
|
|
3318
3319
|
}
|
|
@@ -3331,7 +3332,7 @@ var Fr = class {
|
|
|
3331
3332
|
unmount(e) {
|
|
3332
3333
|
let t = "", r = "";
|
|
3333
3334
|
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);
|
|
3334
|
-
const s =
|
|
3335
|
+
const s = Je();
|
|
3335
3336
|
if (r === "umd") {
|
|
3336
3337
|
let i = s.getElementById(t);
|
|
3337
3338
|
i || (i = s.querySelector(`script[src="${t}"]`)), i && i.remove();
|
|
@@ -3383,7 +3384,7 @@ var Fr = class {
|
|
|
3383
3384
|
}
|
|
3384
3385
|
constructResourceUri(e) {
|
|
3385
3386
|
try {
|
|
3386
|
-
if (
|
|
3387
|
+
if (Bt.includes(e) || !this.query) return e;
|
|
3387
3388
|
const t = this.createSearch(this.query);
|
|
3388
3389
|
return e.indexOf("?") == -1 ? e += `?${t}` : t.length > 0 && (e += `&${t}`), e;
|
|
3389
3390
|
} catch (t) {
|
|
@@ -3429,16 +3430,16 @@ var Fr = class {
|
|
|
3429
3430
|
isOK() {
|
|
3430
3431
|
return this.status;
|
|
3431
3432
|
}
|
|
3432
|
-
},
|
|
3433
|
+
}, $i = class {
|
|
3433
3434
|
index;
|
|
3434
3435
|
resource;
|
|
3435
3436
|
progress;
|
|
3436
3437
|
constructor(e, t, r) {
|
|
3437
3438
|
this.index = e, this.resource = t, this.progress = r;
|
|
3438
3439
|
}
|
|
3439
|
-
},
|
|
3440
|
+
}, zt = /* @__PURE__ */ Symbol("fk"), Gt = /* @__PURE__ */ Symbol("fbk"), Xt = /* @__PURE__ */ Symbol("fepk");
|
|
3440
3441
|
function Gi(e = {}) {
|
|
3441
|
-
const t = new Gs(e), r = new
|
|
3442
|
+
const t = new Gs(e), r = new fr(), s = new Ar(), i = new $r(), n = {
|
|
3442
3443
|
get router() {
|
|
3443
3444
|
return t;
|
|
3444
3445
|
},
|
|
@@ -3446,28 +3447,28 @@ function Gi(e = {}) {
|
|
|
3446
3447
|
return r;
|
|
3447
3448
|
},
|
|
3448
3449
|
get Bus() {
|
|
3449
|
-
return
|
|
3450
|
+
return fr;
|
|
3450
3451
|
},
|
|
3451
3452
|
get EventProxy() {
|
|
3452
|
-
return
|
|
3453
|
+
return Ar;
|
|
3453
3454
|
},
|
|
3454
3455
|
get eventproxy() {
|
|
3455
3456
|
return s;
|
|
3456
3457
|
},
|
|
3457
3458
|
get EventChain() {
|
|
3458
|
-
return
|
|
3459
|
+
return ct;
|
|
3459
3460
|
},
|
|
3460
3461
|
get Require() {
|
|
3461
|
-
return
|
|
3462
|
+
return $r;
|
|
3462
3463
|
},
|
|
3463
3464
|
get require() {
|
|
3464
3465
|
return i;
|
|
3465
3466
|
},
|
|
3466
3467
|
get isESModule() {
|
|
3467
|
-
return
|
|
3468
|
+
return Yt;
|
|
3468
3469
|
},
|
|
3469
3470
|
install(o, u = {}) {
|
|
3470
|
-
o.provide(
|
|
3471
|
+
o.provide(Ve, t), o.provide(zt, n), o.provide(Gt, r), o.provide(Xt, s), u.install !== !1 && (o.component(Pi, Jt), o.component(_i, Si)), u.optionsApi !== !1 && (Reflect.defineProperty(o.config.globalProperties, "$fox", { get() {
|
|
3471
3472
|
return n;
|
|
3472
3473
|
} }), Reflect.defineProperty(o.config.globalProperties, "$router", { get() {
|
|
3473
3474
|
return t;
|
|
@@ -3493,29 +3494,35 @@ function Gi(e = {}) {
|
|
|
3493
3494
|
let f = s;
|
|
3494
3495
|
Reflect.apply(f.trigger, f, [l, ...a]);
|
|
3495
3496
|
}, o.mixin({ setup() {
|
|
3496
|
-
return { $route:
|
|
3497
|
+
return { $route: Ut() };
|
|
3497
3498
|
} })), t.init();
|
|
3498
3499
|
}
|
|
3499
3500
|
};
|
|
3500
3501
|
return n;
|
|
3501
3502
|
}
|
|
3502
|
-
function
|
|
3503
|
-
return N(
|
|
3503
|
+
function us(e) {
|
|
3504
|
+
return _e() ? N(Ve, null) : e ? e.$?.appContext?.provides?.[Ve] ?? null : null;
|
|
3504
3505
|
}
|
|
3505
3506
|
function Xi(e) {
|
|
3506
|
-
|
|
3507
|
+
let t = Ut(e);
|
|
3508
|
+
if (!t && e && !_e()) {
|
|
3509
|
+
let r = e;
|
|
3510
|
+
for (r = r.$parent; r && (t = Ut(r), !t); )
|
|
3511
|
+
r = r.$parent;
|
|
3512
|
+
}
|
|
3513
|
+
return t;
|
|
3507
3514
|
}
|
|
3508
|
-
function Qi() {
|
|
3509
|
-
return N(
|
|
3515
|
+
function Qi(e) {
|
|
3516
|
+
return _e() ? N(zt, null) : e ? e.$?.appContext?.provides?.[zt] ?? null : null;
|
|
3510
3517
|
}
|
|
3511
|
-
function Zi() {
|
|
3512
|
-
return N(
|
|
3518
|
+
function Zi(e) {
|
|
3519
|
+
return _e() ? N(Gt, null) : e ? e.$?.appContext?.provides?.[Gt] ?? null : null;
|
|
3513
3520
|
}
|
|
3514
|
-
function Yi() {
|
|
3515
|
-
return N(
|
|
3521
|
+
function Yi(e) {
|
|
3522
|
+
return _e() ? N(Xt, null) : e ? e.$?.appContext?.provides?.[Xt] ?? null : null;
|
|
3516
3523
|
}
|
|
3517
3524
|
function en(e) {
|
|
3518
|
-
const t =
|
|
3525
|
+
const t = us();
|
|
3519
3526
|
if (!t) {
|
|
3520
3527
|
console.error("[Fox]router is not exist.");
|
|
3521
3528
|
return;
|
|
@@ -3533,7 +3540,7 @@ function en(e) {
|
|
|
3533
3540
|
});
|
|
3534
3541
|
}
|
|
3535
3542
|
function tn(e) {
|
|
3536
|
-
const t =
|
|
3543
|
+
const t = us();
|
|
3537
3544
|
if (!t) {
|
|
3538
3545
|
console.error("[Fox]router is not exist.");
|
|
3539
3546
|
return;
|
|
@@ -3551,35 +3558,35 @@ function tn(e) {
|
|
|
3551
3558
|
});
|
|
3552
3559
|
}
|
|
3553
3560
|
export {
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3561
|
+
fr as Bus,
|
|
3562
|
+
ct as EventChain,
|
|
3563
|
+
Ar as EventProxy,
|
|
3557
3564
|
ri as FoxBeforeEnter,
|
|
3558
3565
|
ii as FoxBeforeLeave,
|
|
3559
3566
|
si as FoxEnter,
|
|
3560
3567
|
ni as FoxLeave,
|
|
3561
|
-
|
|
3562
|
-
|
|
3568
|
+
Vt as FoxLeaveEnd,
|
|
3569
|
+
F as OperationType,
|
|
3563
3570
|
S as Route,
|
|
3564
3571
|
Gs as Router,
|
|
3565
3572
|
Si as RouterLink,
|
|
3566
|
-
|
|
3573
|
+
Jt as RouterView,
|
|
3567
3574
|
Ui as bindLifecycleContextToCurrentScope,
|
|
3568
3575
|
Gi as createFox,
|
|
3569
3576
|
Ws as createMemoryHistory,
|
|
3570
3577
|
Us as createWebHashHistory,
|
|
3571
3578
|
Ni as createWebHistory,
|
|
3572
3579
|
Wi as deleteContextValue,
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3580
|
+
K as extend,
|
|
3581
|
+
Gr as injectContextValue,
|
|
3582
|
+
dt as injectLifecycleContext,
|
|
3583
|
+
nr as isArray,
|
|
3577
3584
|
Mi as isDate,
|
|
3578
|
-
|
|
3579
|
-
|
|
3585
|
+
Yt as isESModule,
|
|
3586
|
+
lr as isEqual,
|
|
3580
3587
|
b as isFunction,
|
|
3581
3588
|
ji as isMap,
|
|
3582
|
-
|
|
3589
|
+
We as isNil,
|
|
3583
3590
|
gs as isObject,
|
|
3584
3591
|
bs as isPlainObject,
|
|
3585
3592
|
Ii as isPromise,
|
|
@@ -3594,14 +3601,14 @@ export {
|
|
|
3594
3601
|
Hi as rawState,
|
|
3595
3602
|
Bi as reactiveState,
|
|
3596
3603
|
Di as shallowReactiveState,
|
|
3597
|
-
|
|
3604
|
+
Tr as toBoolean,
|
|
3598
3605
|
Oi as toNumber,
|
|
3599
|
-
|
|
3600
|
-
|
|
3606
|
+
Zt as toTypeString,
|
|
3607
|
+
or as typeOf,
|
|
3601
3608
|
Zi as useBus,
|
|
3602
3609
|
Yi as useEventProxy,
|
|
3603
3610
|
Qi as useFox,
|
|
3604
3611
|
Xi as useRoute,
|
|
3605
|
-
|
|
3612
|
+
us as useRouter,
|
|
3606
3613
|
Qs as withLifecycleContext
|
|
3607
3614
|
};
|