@mantou/gem 2.2.1 → 2.2.2
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/dist/gem.es.js +1015 -1014
- package/dist/gem.umd.js +12 -15
- package/elements/base/gesture.js +1 -1
- package/elements/base/link.d.ts +1 -1
- package/elements/base/link.d.ts.map +1 -1
- package/elements/base/link.js +13 -9
- package/elements/base/link.js.map +1 -1
- package/elements/base/modal-factory.d.ts +73 -48
- package/elements/base/modal-factory.d.ts.map +1 -1
- package/elements/base/modal-factory.js +12 -11
- package/elements/base/modal-factory.js.map +1 -1
- package/elements/base/route.d.ts +1 -1
- package/elements/base/route.d.ts.map +1 -1
- package/elements/base/route.js +11 -15
- package/elements/base/route.js.map +1 -1
- package/elements/base/title.d.ts.map +1 -1
- package/elements/base/title.js +2 -4
- package/elements/base/title.js.map +1 -1
- package/elements/base/unsafe.d.ts +3 -2
- package/elements/base/unsafe.d.ts.map +1 -1
- package/elements/base/unsafe.js +45 -24
- package/elements/base/unsafe.js.map +1 -1
- package/helper/i18n.d.ts.map +1 -1
- package/helper/logger.d.ts.map +1 -1
- package/helper/react-utils.d.ts.map +1 -1
- package/helper/react-utils.js +2 -6
- package/helper/react-utils.js.map +1 -1
- package/helper/ssr-shim.d.ts.map +1 -1
- package/helper/ssr-shim.js +0 -1
- package/helper/ssr-shim.js.map +1 -1
- package/helper/theme.d.ts +15 -3
- package/helper/theme.d.ts.map +1 -1
- package/helper/theme.js +22 -7
- package/helper/theme.js.map +1 -1
- package/lib/decorators.d.ts +49 -49
- package/lib/decorators.d.ts.map +1 -1
- package/lib/decorators.js +50 -49
- package/lib/decorators.js.map +1 -1
- package/lib/directive.d.ts.map +1 -1
- package/lib/element.d.ts.map +1 -1
- package/lib/element.js.map +1 -1
- package/lib/history.d.ts +1 -1
- package/lib/history.d.ts.map +1 -1
- package/lib/history.js +3 -3
- package/lib/history.js.map +1 -1
- package/lib/lit-html.d.ts +2 -5
- package/lib/lit-html.d.ts.map +1 -1
- package/lib/lit-html.js +2 -5
- package/lib/lit-html.js.map +1 -1
- package/lib/reactive.d.ts +12 -5
- package/lib/reactive.d.ts.map +1 -1
- package/lib/reactive.js +14 -18
- package/lib/reactive.js.map +1 -1
- package/lib/repeat.d.ts.map +1 -1
- package/lib/store.d.ts +2 -2
- package/lib/store.d.ts.map +1 -1
- package/lib/store.js +1 -0
- package/lib/store.js.map +1 -1
- package/lib/utils.d.ts +4 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +11 -9
- package/lib/utils.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.d.ts.map +1 -1
- package/lib/version.js +2 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/src/elements/base/gesture.ts +1 -1
- package/src/elements/base/link.ts +3 -3
- package/src/elements/base/modal-factory.ts +12 -11
- package/src/elements/base/route.ts +9 -15
- package/src/elements/base/title.ts +2 -4
- package/src/elements/base/unsafe.ts +33 -14
- package/src/helper/react-utils.ts +4 -12
- package/src/helper/ssr-shim.ts +0 -1
- package/src/helper/theme.ts +25 -10
- package/src/lib/decorators.ts +51 -49
- package/src/lib/element.ts +0 -1
- package/src/lib/history.ts +3 -4
- package/src/lib/lit-html.ts +3 -0
- package/src/lib/reactive.ts +45 -21
- package/src/lib/store.ts +3 -2
- package/src/lib/utils.ts +15 -8
- package/src/lib/version.ts +2 -1
- package/src/test/gem-element/advance.test.ts +1 -1
- package/src/test/gem-element/basic.test.ts +1 -2
- package/src/test/utils.test.ts +1 -1
package/dist/gem.es.js
CHANGED
|
@@ -1,46 +1,48 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Ya = Object.defineProperty;
|
|
2
|
+
var Ri = (s) => {
|
|
3
3
|
throw TypeError(s);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var v = (s, t, e) =>
|
|
7
|
-
var _ = (s, t, e) => (
|
|
8
|
-
const { assign:
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
var Za = (s, t, e) => t in s ? Ya(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
6
|
+
var v = (s, t, e) => Za(s, typeof t != "symbol" ? t + "" : t, e), Bs = (s, t, e) => t.has(s) || Ri("Cannot " + e);
|
|
7
|
+
var _ = (s, t, e) => (Bs(s, t, "read from private field"), e ? e.call(s) : t.get(s)), E = (s, t, e) => t.has(s) ? Ri("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), M = (s, t, e, n) => (Bs(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), Ks = (s, t, e) => (Bs(s, t, "access private method"), e);
|
|
8
|
+
const { assign: Xa, fromEntries: tc, entries: ec, keys: sc } = Object;
|
|
9
|
+
function nc(s) {
|
|
10
|
+
Promise.resolve().then(s);
|
|
11
|
+
}
|
|
12
|
+
const js = /* @__PURE__ */ new Set();
|
|
13
|
+
function St(s, t = nc) {
|
|
14
|
+
js.has(s) || (t(() => {
|
|
15
|
+
js.delete(s), s();
|
|
16
|
+
}), js.add(s));
|
|
15
17
|
}
|
|
16
18
|
function xs(s, t) {
|
|
17
19
|
const e = t;
|
|
18
|
-
return delete e.name, delete e.length,
|
|
20
|
+
return delete e.name, delete e.length, Xa(e, s), e;
|
|
19
21
|
}
|
|
20
|
-
function
|
|
22
|
+
function xr(s = "", t = "") {
|
|
21
23
|
const { pathname: e, search: n, hash: i } = new URL(t, location.origin + s);
|
|
22
24
|
return e + n + decodeURIComponent(i);
|
|
23
25
|
}
|
|
24
|
-
function
|
|
26
|
+
function Lr(s, t, e, n) {
|
|
25
27
|
return s.addEventListener(t, e, n), () => s.removeEventListener(t, e, n);
|
|
26
28
|
}
|
|
27
|
-
var
|
|
28
|
-
class
|
|
29
|
+
var dt, at, ut, Je, nn;
|
|
30
|
+
class ic extends EventTarget {
|
|
29
31
|
constructor() {
|
|
30
32
|
super(...arguments);
|
|
31
|
-
E(this,
|
|
32
|
-
E(this,
|
|
33
|
-
E(this,
|
|
34
|
-
E(this,
|
|
33
|
+
E(this, Je);
|
|
34
|
+
E(this, dt, /* @__PURE__ */ new Map());
|
|
35
|
+
E(this, at);
|
|
36
|
+
E(this, ut);
|
|
35
37
|
}
|
|
36
38
|
get size() {
|
|
37
|
-
return _(this,
|
|
39
|
+
return _(this, dt).size;
|
|
38
40
|
}
|
|
39
41
|
get first() {
|
|
40
|
-
return _(this,
|
|
42
|
+
return _(this, at);
|
|
41
43
|
}
|
|
42
44
|
get last() {
|
|
43
|
-
return _(this,
|
|
45
|
+
return _(this, ut);
|
|
44
46
|
}
|
|
45
47
|
isSuperLinkOf(e) {
|
|
46
48
|
let n = e.first;
|
|
@@ -53,44 +55,47 @@ class Qa extends EventTarget {
|
|
|
53
55
|
return !1;
|
|
54
56
|
}
|
|
55
57
|
find(e) {
|
|
56
|
-
return _(this,
|
|
58
|
+
return _(this, dt).get(e);
|
|
57
59
|
}
|
|
58
60
|
/**
|
|
59
61
|
* 添加到尾部,已存在时会删除老的项目
|
|
60
62
|
* 如果是添加第一个,start 事件会在添加前触发,避免处理事件重复的逻辑
|
|
61
63
|
*/
|
|
62
64
|
add(e) {
|
|
63
|
-
_(this,
|
|
64
|
-
const n =
|
|
65
|
-
n.prev = _(this,
|
|
65
|
+
_(this, ut) || this.dispatchEvent(new CustomEvent("start"));
|
|
66
|
+
const n = Ks(this, Je, nn).call(this, e) || { value: e };
|
|
67
|
+
n.prev = _(this, ut), n.prev && (n.prev.next = n), n.next = void 0, M(this, ut, n), _(this, at) || M(this, at, n), _(this, dt).set(e, n);
|
|
66
68
|
}
|
|
67
69
|
/** 删除这个元素后没有其他元素时立即出发 end 事件 */
|
|
68
70
|
delete(e) {
|
|
69
|
-
const n =
|
|
70
|
-
return _(this,
|
|
71
|
+
const n = Ks(this, Je, nn).call(this, e);
|
|
72
|
+
return _(this, at) || this.dispatchEvent(new CustomEvent("end")), n;
|
|
73
|
+
}
|
|
74
|
+
clear() {
|
|
75
|
+
_(this, dt).clear(), M(this, at, M(this, ut, void 0));
|
|
71
76
|
}
|
|
72
77
|
/** 获取头部元素,会从链表删除 */
|
|
73
78
|
get() {
|
|
74
|
-
const e = _(this,
|
|
79
|
+
const e = _(this, at);
|
|
75
80
|
if (e)
|
|
76
81
|
return this.delete(e.value), e.value;
|
|
77
82
|
}
|
|
78
83
|
}
|
|
79
|
-
|
|
80
|
-
const n = _(this,
|
|
81
|
-
return n && (n.prev ? n.prev.next = n.next : M(this,
|
|
84
|
+
dt = new WeakMap(), at = new WeakMap(), ut = new WeakMap(), Je = new WeakSet(), nn = function(e) {
|
|
85
|
+
const n = _(this, dt).get(e);
|
|
86
|
+
return n && (n.prev ? n.prev.next = n.next : M(this, at, n.next), n.next ? n.next.prev = n.prev : M(this, ut, n.prev), _(this, dt).delete(e)), n;
|
|
82
87
|
};
|
|
83
|
-
class
|
|
88
|
+
class rc extends WeakMap {
|
|
84
89
|
get(t) {
|
|
85
90
|
let e = super.get(t);
|
|
86
91
|
return e || (e = {}, this.set(t, e)), e;
|
|
87
92
|
}
|
|
88
93
|
}
|
|
89
|
-
var
|
|
90
|
-
class
|
|
94
|
+
var Qt, Ts;
|
|
95
|
+
class qe extends URLSearchParams {
|
|
91
96
|
constructor() {
|
|
92
97
|
super(...arguments);
|
|
93
|
-
E(this,
|
|
98
|
+
E(this, Qt, (e) => typeof e == "string" ? e : JSON.stringify(e));
|
|
94
99
|
E(this, Ts, (e) => {
|
|
95
100
|
if (!e) return null;
|
|
96
101
|
try {
|
|
@@ -103,15 +108,15 @@ class Be extends URLSearchParams {
|
|
|
103
108
|
// support `{ key: ObjectValue }`
|
|
104
109
|
concat(e) {
|
|
105
110
|
let n;
|
|
106
|
-
typeof e == "string" ? n =
|
|
107
|
-
this.append(i, _(this,
|
|
111
|
+
typeof e == "string" ? n = tc(new URLSearchParams(e).entries()) : n = e, ec(n).forEach(([i, o]) => {
|
|
112
|
+
this.append(i, _(this, Qt).call(this, o));
|
|
108
113
|
});
|
|
109
114
|
}
|
|
110
115
|
setAny(e, n) {
|
|
111
116
|
if (Array.isArray(n))
|
|
112
|
-
this.delete(e), n.forEach((i) => this.append(e, _(this,
|
|
117
|
+
this.delete(e), n.forEach((i) => this.append(e, _(this, Qt).call(this, i)));
|
|
113
118
|
else {
|
|
114
|
-
const i = _(this,
|
|
119
|
+
const i = _(this, Qt).call(this, n);
|
|
115
120
|
i ? this.set(e, i) : this.delete(e);
|
|
116
121
|
}
|
|
117
122
|
}
|
|
@@ -129,39 +134,39 @@ class Be extends URLSearchParams {
|
|
|
129
134
|
return this.toString();
|
|
130
135
|
}
|
|
131
136
|
}
|
|
132
|
-
|
|
133
|
-
function
|
|
137
|
+
Qt = new WeakMap(), Ts = new WeakMap();
|
|
138
|
+
function Nn(s, ...t) {
|
|
134
139
|
return s.reduce((e, n, i) => e + (t[i - 1] ?? "") + n);
|
|
135
140
|
}
|
|
136
|
-
const
|
|
137
|
-
function
|
|
141
|
+
const Pl = Nn;
|
|
142
|
+
function Rn(s = 5) {
|
|
138
143
|
const t = Math.random().toString(36).slice(2, 2 + s);
|
|
139
|
-
return t.length < s ? t +
|
|
144
|
+
return t.length < s ? t + Rn(s - t.length) : t;
|
|
140
145
|
}
|
|
141
146
|
function he(s) {
|
|
142
147
|
return s.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
143
148
|
}
|
|
144
|
-
function
|
|
149
|
+
function Ml(s) {
|
|
145
150
|
return s.replace(/-(.)/g, (t, e) => e.toUpperCase());
|
|
146
151
|
}
|
|
147
|
-
function
|
|
148
|
-
return
|
|
152
|
+
function In(s) {
|
|
153
|
+
return sc(s).forEach((t) => {
|
|
149
154
|
delete s[t];
|
|
150
155
|
}), s;
|
|
151
156
|
}
|
|
152
|
-
class
|
|
157
|
+
class wt extends Error {
|
|
153
158
|
constructor(t) {
|
|
154
159
|
super(t), this.message = `gem: ${this.message}`;
|
|
155
160
|
}
|
|
156
161
|
}
|
|
157
|
-
function
|
|
162
|
+
function oc(s, t) {
|
|
158
163
|
const e = s.length;
|
|
159
164
|
if (t.length !== e) return !0;
|
|
160
165
|
for (let n = 0; n < e; n++)
|
|
161
166
|
if (s[n] !== t[n]) return !0;
|
|
162
167
|
return !1;
|
|
163
168
|
}
|
|
164
|
-
function
|
|
169
|
+
function Hn(s, t, e) {
|
|
165
170
|
let n = t;
|
|
166
171
|
for (const i in s) {
|
|
167
172
|
const o = e(i, s[i]);
|
|
@@ -169,158 +174,158 @@ function Nn(s, t, e) {
|
|
|
169
174
|
}
|
|
170
175
|
return n;
|
|
171
176
|
}
|
|
172
|
-
function
|
|
173
|
-
return
|
|
177
|
+
function Ol(s) {
|
|
178
|
+
return Hn(
|
|
174
179
|
s,
|
|
175
180
|
";",
|
|
176
181
|
(t, e) => e || e === 0 ? `${he(t)}:${e}` : ""
|
|
177
182
|
);
|
|
178
183
|
}
|
|
179
|
-
function
|
|
180
|
-
return
|
|
184
|
+
function ac(s) {
|
|
185
|
+
return Hn(s, " ", (t, e) => e ? t : "");
|
|
181
186
|
}
|
|
182
|
-
const
|
|
183
|
-
function
|
|
184
|
-
return
|
|
187
|
+
const xl = ac;
|
|
188
|
+
function Ll(s) {
|
|
189
|
+
return Hn(
|
|
185
190
|
s,
|
|
186
191
|
",",
|
|
187
192
|
(t, e) => e === !0 || t === e ? t : e ? `${t}:${e}` : ""
|
|
188
193
|
);
|
|
189
194
|
}
|
|
190
|
-
const
|
|
191
|
-
function
|
|
195
|
+
const vs = /* @__PURE__ */ new WeakMap();
|
|
196
|
+
function Wt(s) {
|
|
192
197
|
const t = xs(s, (e) => {
|
|
193
198
|
var n;
|
|
194
|
-
Object.assign(t, e), (n =
|
|
199
|
+
Object.assign(t, e), (n = vs.get(t)) == null || n.forEach((i) => St(i));
|
|
195
200
|
});
|
|
196
|
-
return
|
|
201
|
+
return vs.set(t, /* @__PURE__ */ new Set()), t;
|
|
197
202
|
}
|
|
198
|
-
function
|
|
199
|
-
const e =
|
|
203
|
+
function mt(s, t) {
|
|
204
|
+
const e = vs.get(s);
|
|
200
205
|
return e == null || e.add(t), () => e == null ? void 0 : e.delete(t);
|
|
201
206
|
}
|
|
202
|
-
const
|
|
207
|
+
const cc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
203
208
|
__proto__: null,
|
|
204
|
-
_StoreListenerMap:
|
|
205
|
-
connect:
|
|
206
|
-
createStore:
|
|
209
|
+
_StoreListenerMap: vs,
|
|
210
|
+
connect: mt,
|
|
211
|
+
createStore: Wt
|
|
207
212
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
208
|
-
let
|
|
209
|
-
function
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
const { assign:
|
|
213
|
-
|
|
214
|
-
const
|
|
215
|
-
var
|
|
216
|
-
class
|
|
213
|
+
let ot = (s, ...t) => Nn(s, ...t.map((e) => e instanceof Element ? e.outerHTML : e)), Ls = (s, t) => t.innerHTML = s;
|
|
214
|
+
function Ar(s, t) {
|
|
215
|
+
ot = s, Ls = t;
|
|
216
|
+
}
|
|
217
|
+
const { assign: Ii, defineProperty: hc } = Object;
|
|
218
|
+
hc(Symbol, "metadata", { value: Symbol.for("Symbol.metadata") });
|
|
219
|
+
const Nr = (s) => typeof s == "function" && s(), rn = globalThis.nQM, Et = Symbol.for("gem@sheetToken"), As = Symbol.for("gem@update"), Rr = "gem-style-boundary", Wn = "gem@render-error", lc = As, Qs = /* @__PURE__ */ new WeakMap(), Ir = /* @__PURE__ */ new WeakMap();
|
|
220
|
+
var _t;
|
|
221
|
+
class dc extends CSSStyleSheet {
|
|
217
222
|
constructor() {
|
|
218
223
|
super(...arguments);
|
|
219
|
-
E(this,
|
|
224
|
+
E(this, _t);
|
|
220
225
|
v(this, "cssText", "");
|
|
221
226
|
}
|
|
222
227
|
get element() {
|
|
223
|
-
return _(this,
|
|
228
|
+
return _(this, _t) || (M(this, _t, document.createElement("style")), _(this, _t).textContent = this.cssText), _(this, _t);
|
|
224
229
|
}
|
|
225
230
|
replaceSync(e) {
|
|
226
|
-
this.cssText = e, _(this,
|
|
231
|
+
this.cssText = e, _(this, _t) && (_(this, _t).textContent = e), super.replaceSync(e);
|
|
227
232
|
}
|
|
228
233
|
}
|
|
229
|
-
|
|
230
|
-
var
|
|
231
|
-
class
|
|
234
|
+
_t = new WeakMap();
|
|
235
|
+
var Lt, Ye, Jt, Yt;
|
|
236
|
+
class uc {
|
|
232
237
|
constructor(t = "") {
|
|
233
|
-
E(this,
|
|
234
|
-
E(this,
|
|
238
|
+
E(this, Lt, "");
|
|
239
|
+
E(this, Ye, "");
|
|
235
240
|
// 不需要 GC
|
|
236
|
-
E(this,
|
|
241
|
+
E(this, Jt, /* @__PURE__ */ new Map());
|
|
237
242
|
E(this, Yt, /* @__PURE__ */ new Map());
|
|
238
|
-
M(this,
|
|
243
|
+
M(this, Ye, t);
|
|
239
244
|
}
|
|
240
245
|
setContent(t) {
|
|
241
|
-
M(this,
|
|
242
|
-
}
|
|
243
|
-
getStyle(t) {
|
|
244
|
-
var
|
|
245
|
-
const
|
|
246
|
-
if (!_(this,
|
|
247
|
-
const
|
|
248
|
-
_(this,
|
|
246
|
+
M(this, Lt, t);
|
|
247
|
+
}
|
|
248
|
+
getStyle(t, e) {
|
|
249
|
+
var a;
|
|
250
|
+
const n = t && !((a = t.internals) != null && a.shadowRoot), i = n ? t.constructor : this;
|
|
251
|
+
if (!_(this, Jt).has(i)) {
|
|
252
|
+
const c = new dc({ media: _(this, Ye) });
|
|
253
|
+
_(this, Jt).set(i, c);
|
|
249
254
|
}
|
|
250
|
-
const
|
|
251
|
-
if (!_(this, Yt).has(
|
|
252
|
-
let
|
|
253
|
-
|
|
255
|
+
const o = _(this, Jt).get(i);
|
|
256
|
+
if (!_(this, Yt).has(o)) {
|
|
257
|
+
let c = _(this, Lt), l = "";
|
|
258
|
+
n && (l = e ? "@scope" : `@scope (${t.tagName}) to (:state(${Rr}) > *)`, c = `${l}{ ${c} }`), o.replaceSync(c), _(this, Yt).set(o, l);
|
|
254
259
|
}
|
|
255
|
-
return
|
|
260
|
+
return o;
|
|
256
261
|
}
|
|
257
262
|
// 一般用于主题更新
|
|
258
263
|
updateStyle() {
|
|
259
264
|
_(this, Yt).forEach((t, e) => {
|
|
260
|
-
e.replaceSync(t ? `${t}{${_(this,
|
|
265
|
+
e.replaceSync(t ? `${t}{${_(this, Lt)}}` : _(this, Lt));
|
|
261
266
|
});
|
|
262
267
|
}
|
|
263
268
|
}
|
|
264
|
-
|
|
265
|
-
function
|
|
269
|
+
Lt = new WeakMap(), Ye = new WeakMap(), Jt = new WeakMap(), Yt = new WeakMap();
|
|
270
|
+
function le(s, ...t) {
|
|
266
271
|
let e = "", n = "";
|
|
267
272
|
const i = t.at(0);
|
|
268
|
-
Array.isArray(s) ? n =
|
|
269
|
-
const o = new
|
|
273
|
+
Array.isArray(s) ? n = Nn(s, ...t) : i !== void 0 ? (e = s, n = i) : n = s;
|
|
274
|
+
const o = new uc(e), a = { [Et]: o };
|
|
270
275
|
let c = "";
|
|
271
|
-
return typeof n == "string" ? c = n : Object.keys(n).forEach((
|
|
272
|
-
const
|
|
273
|
-
a[
|
|
276
|
+
return typeof n == "string" ? c = n : Object.keys(n).forEach((l) => {
|
|
277
|
+
const d = l === "$";
|
|
278
|
+
a[l] = d || l.includes("-") ? l : `${l}-${Rn()}`, c += `${d ? ":where(&:not([hidden])),:host(:where(:not([hidden])))" : `.${a[l]}`} {${n[l]}}`;
|
|
274
279
|
}), o.setContent(c), a;
|
|
275
280
|
}
|
|
276
|
-
const
|
|
281
|
+
const Hi = (s, t, e) => {
|
|
277
282
|
let n = !1;
|
|
278
283
|
t.forEach((i) => {
|
|
279
284
|
const o = s.get(i) || 0;
|
|
280
285
|
n || (n = e === 1 && o === 0 || e === -1 && o === 1), s.set(i, o + e);
|
|
281
|
-
}), n &&
|
|
282
|
-
},
|
|
286
|
+
}), n && St(Ir.get(s), rn);
|
|
287
|
+
}, _c = (s, t) => {
|
|
283
288
|
const e = s.getRootNode();
|
|
284
|
-
if (!
|
|
289
|
+
if (!Qs.has(e)) {
|
|
285
290
|
const i = /* @__PURE__ */ new Map();
|
|
286
|
-
|
|
291
|
+
Qs.set(e, i), Ir.set(i, () => {
|
|
287
292
|
const o = e.adoptedStyleSheets.filter((a) => !i.has(a));
|
|
288
293
|
i.forEach((a, c) => a && o.push(c)), e.adoptedStyleSheets = o.reverse();
|
|
289
294
|
});
|
|
290
295
|
}
|
|
291
|
-
const n =
|
|
292
|
-
return
|
|
296
|
+
const n = Qs.get(e);
|
|
297
|
+
return Hi(n, t, 1), () => Hi(n, t, -1);
|
|
293
298
|
};
|
|
294
|
-
let
|
|
295
|
-
function
|
|
299
|
+
let zn;
|
|
300
|
+
function Wi(s) {
|
|
296
301
|
s == null || s.forEach((t) => {
|
|
297
302
|
const { callback: e, getDep: n, values: i, preCallback: o } = t, a = n == null ? void 0 : n();
|
|
298
|
-
(!n || !i ||
|
|
303
|
+
(!n || !i || oc(i, a)) && (Nr(o), t.preCallback = e(a, i), t.values = a, t.initialized = !0);
|
|
299
304
|
});
|
|
300
305
|
}
|
|
301
|
-
function
|
|
302
|
-
return s.filter((t) => (
|
|
306
|
+
function zi(s) {
|
|
307
|
+
return s.filter((t) => (Nr(t.preCallback), t.initialized = !1, t.values = void 0, t.fixed));
|
|
303
308
|
}
|
|
304
|
-
let
|
|
305
|
-
const Kt = new
|
|
309
|
+
let Vn;
|
|
310
|
+
const Kt = new ic(), on = (s = performance.now()) => {
|
|
306
311
|
if (performance.now() > s + 16) return requestAnimationFrame(on);
|
|
307
312
|
const t = Kt.get();
|
|
308
313
|
t && (t(), on(s));
|
|
309
314
|
};
|
|
310
|
-
Kt.addEventListener("start", () =>
|
|
311
|
-
let
|
|
312
|
-
var Zt,
|
|
313
|
-
class
|
|
315
|
+
Kt.addEventListener("start", () => St(on));
|
|
316
|
+
let Vi;
|
|
317
|
+
var Zt, Q, ct, At, pt, Xt, it, te, ee, Nt, rt, Ut, an, ks, Ps, Ze, se, Rt, Xe, Ms, Os, ts, ne;
|
|
318
|
+
class tt extends HTMLElement {
|
|
314
319
|
constructor() {
|
|
315
320
|
super();
|
|
316
|
-
E(this,
|
|
321
|
+
E(this, rt);
|
|
317
322
|
E(this, Zt);
|
|
318
|
-
E(this,
|
|
323
|
+
E(this, Q);
|
|
319
324
|
E(this, ct, []);
|
|
320
|
-
E(this,
|
|
321
|
-
E(this,
|
|
325
|
+
E(this, At, []);
|
|
326
|
+
E(this, pt, []);
|
|
322
327
|
E(this, Xt);
|
|
323
|
-
E(this,
|
|
328
|
+
E(this, it);
|
|
324
329
|
// not in constructor 的近似值
|
|
325
330
|
E(this, te);
|
|
326
331
|
E(this, ee);
|
|
@@ -328,11 +333,11 @@ class st extends HTMLElement {
|
|
|
328
333
|
/**
|
|
329
334
|
* 每次更新完检查依赖,执行对应的副作用回调
|
|
330
335
|
* */
|
|
331
|
-
E(this, Ps, () => {
|
|
332
|
-
Ni(_(this, ct));
|
|
333
|
-
});
|
|
334
336
|
E(this, ks, () => {
|
|
335
|
-
|
|
337
|
+
Wi(_(this, ct));
|
|
338
|
+
});
|
|
339
|
+
E(this, Ps, () => {
|
|
340
|
+
Wi(_(this, At));
|
|
336
341
|
});
|
|
337
342
|
/**
|
|
338
343
|
* - 条件渲染
|
|
@@ -341,41 +346,35 @@ class st extends HTMLElement {
|
|
|
341
346
|
* - 返回 `null` 时渲染空内容
|
|
342
347
|
* - 返回空的 TemplateResult 时渲染空的子内容
|
|
343
348
|
* */
|
|
344
|
-
E(this,
|
|
349
|
+
E(this, Ze, (e) => {
|
|
345
350
|
try {
|
|
346
|
-
M(this, ee, !0), _(this,
|
|
347
|
-
const n = _(this, Zt) === this, i = e ? e.render() : n ? void 0 :
|
|
351
|
+
M(this, ee, !0), _(this, Ps).call(this);
|
|
352
|
+
const n = _(this, Zt) === this, i = e ? e.render() : n ? void 0 : ot`<slot></slot>`;
|
|
348
353
|
if (i === void 0) return;
|
|
349
|
-
|
|
350
|
-
i !== null ? i : n ?
|
|
351
|
-
// prettier-ignore
|
|
352
|
-
et`<style>@scope{:scope{display:none !important}}</style>`
|
|
353
|
-
) : (
|
|
354
|
-
// prettier-ignore
|
|
355
|
-
et`<style>:host{display:none !important}</style>`
|
|
356
|
-
),
|
|
354
|
+
Ls(
|
|
355
|
+
i !== null ? i : ot`<style>${n ? "@scope" : ":host"}{&{display:none!important;}}</style>`,
|
|
357
356
|
_(this, Zt)
|
|
358
357
|
);
|
|
359
358
|
} catch (n) {
|
|
360
|
-
throw this.dispatchEvent(new CustomEvent(
|
|
359
|
+
throw this.dispatchEvent(new CustomEvent(Wn, { bubbles: !0, composed: !0, detail: n })), n;
|
|
361
360
|
} finally {
|
|
362
361
|
M(this, ee, !1);
|
|
363
362
|
}
|
|
364
363
|
});
|
|
365
364
|
E(this, se, () => {
|
|
366
|
-
const e = _(this,
|
|
367
|
-
_(this,
|
|
368
|
-
(e || !_(this,
|
|
365
|
+
const e = _(this, rt, an);
|
|
366
|
+
_(this, it) && // 当有渲染函数,但是没一个符合条件时跳过
|
|
367
|
+
(e || !_(this, pt).length) && (_(this, Ze).call(this, e), St(_(this, ks)));
|
|
369
368
|
});
|
|
370
369
|
E(this, Rt, () => {
|
|
371
|
-
_(this,
|
|
370
|
+
_(this, rt, Ut).noBlocking ? Kt.add(_(this, se)) : _(this, se).call(this);
|
|
372
371
|
});
|
|
373
|
-
E(this,
|
|
374
|
-
const { adoptedStyleSheets: e = [] } = _(this,
|
|
372
|
+
E(this, Xe, () => {
|
|
373
|
+
const { adoptedStyleSheets: e = [] } = _(this, rt, Ut), { shadowRoot: n, sheets: i } = _(this, Q), o = e.map((a) => a[Et].getStyle(this));
|
|
375
374
|
if (n)
|
|
376
375
|
n.adoptedStyleSheets = o.concat(i);
|
|
377
376
|
else
|
|
378
|
-
return this.prepend(...i.map((a) => a.element)),
|
|
377
|
+
return this.prepend(...i.map((a) => a.element)), _c(this, o);
|
|
379
378
|
});
|
|
380
379
|
/**
|
|
381
380
|
* 元素挂载后执行还未初始化的副作用
|
|
@@ -392,18 +391,18 @@ class st extends HTMLElement {
|
|
|
392
391
|
this.willMount && this.memo(this.willMount.bind(this), () => []), this.mounted && this.effect(this.mounted.bind(this), () => []), this.updated && this.effect((n, i) => i && this.updated.apply(this)), this.unmounted && this.effect(
|
|
393
392
|
() => this.unmounted.bind(this),
|
|
394
393
|
() => []
|
|
395
|
-
), !_(this,
|
|
394
|
+
), !_(this, pt).length && this.render && _(this, pt).push({ render: this.render.bind(this), condition: (e = this.shouldUpdate) == null ? void 0 : e.bind(this) });
|
|
396
395
|
});
|
|
397
|
-
E(this,
|
|
396
|
+
E(this, ts);
|
|
398
397
|
E(this, ne, async () => {
|
|
399
398
|
var o;
|
|
400
399
|
if (_(this, Xt)) {
|
|
401
|
-
M(this, Xt, !1), (o = _(this, Nt)) == null || o.call(this), M(this, Nt, _(this,
|
|
400
|
+
M(this, Xt, !1), (o = _(this, Nt)) == null || o.call(this), M(this, Nt, _(this, Xe).call(this));
|
|
402
401
|
return;
|
|
403
402
|
}
|
|
404
403
|
M(this, te, !0), _(this, Os).call(this);
|
|
405
|
-
const { observedStores: e, mode: n, penetrable: i } = _(this,
|
|
406
|
-
!n && _(this,
|
|
404
|
+
const { observedStores: e, mode: n, penetrable: i } = _(this, rt, Ut);
|
|
405
|
+
!n && _(this, pt).length && !i && _(this, Q).states.add(Rr), M(this, ts, e == null ? void 0 : e.map((a) => mt(a, _(this, Rt)))), _(this, Ze).call(this, _(this, rt, an)), M(this, it, !0), M(this, Nt, _(this, Xe).call(this)), St(_(this, Ms));
|
|
407
406
|
});
|
|
408
407
|
/**
|
|
409
408
|
* @helper
|
|
@@ -423,10 +422,10 @@ class st extends HTMLElement {
|
|
|
423
422
|
const i = {
|
|
424
423
|
callback: e,
|
|
425
424
|
getDep: n,
|
|
426
|
-
initialized: _(this,
|
|
425
|
+
initialized: _(this, it),
|
|
427
426
|
fixed: !_(this, te)
|
|
428
427
|
};
|
|
429
|
-
_(this,
|
|
428
|
+
_(this, it) && (i.values = n == null ? void 0 : n(), i.preCallback = e(i.values)), _(this, ct).push(i);
|
|
430
429
|
});
|
|
431
430
|
/**
|
|
432
431
|
* @helper
|
|
@@ -446,7 +445,7 @@ class st extends HTMLElement {
|
|
|
446
445
|
* ```
|
|
447
446
|
* */
|
|
448
447
|
v(this, "memo", (e, n) => {
|
|
449
|
-
_(this,
|
|
448
|
+
_(this, At).push({
|
|
450
449
|
callback: e,
|
|
451
450
|
getDep: n,
|
|
452
451
|
fixed: !_(this, te)
|
|
@@ -456,27 +455,27 @@ class st extends HTMLElement {
|
|
|
456
455
|
* @helper
|
|
457
456
|
* async
|
|
458
457
|
*/
|
|
459
|
-
v(this, "update", () =>
|
|
460
|
-
|
|
461
|
-
const { mode: e, serializable: n, delegatesFocus: i, slotAssignment: o, aria: a } = _(this,
|
|
462
|
-
M(this, Zt, e ? this.attachShadow({ mode: e, serializable: n, delegatesFocus: i, slotAssignment: o }) : this), M(this,
|
|
463
|
-
let
|
|
458
|
+
v(this, "update", () => St(_(this, Rt)));
|
|
459
|
+
Vi = this;
|
|
460
|
+
const { mode: e, serializable: n, delegatesFocus: i, slotAssignment: o, aria: a } = _(this, rt, Ut), { focusable: c, ...l } = a || {};
|
|
461
|
+
M(this, Zt, e ? this.attachShadow({ mode: e, serializable: n, delegatesFocus: i, slotAssignment: o }) : this), M(this, Q, this.attachInternals()), _(this, Q).stateList = [], _(this, Q).sheets = [], Ii(_(this, Q), l);
|
|
462
|
+
let d;
|
|
464
463
|
_(this, ct).push({
|
|
465
464
|
fixed: !0,
|
|
466
465
|
getDep: () => [this.disabled],
|
|
467
466
|
callback: ([f = !1]) => {
|
|
468
|
-
if (
|
|
469
|
-
return
|
|
467
|
+
if (d === void 0 && (d = this.hasAttribute("tabindex")), _(this, Q).ariaDisabled = String(f), c && !d && (this.tabIndex = -Number(f)), (c || i) && f)
|
|
468
|
+
return Lr(this, "click", (r) => r.isTrusted && r.stopImmediatePropagation(), {
|
|
470
469
|
capture: !0
|
|
471
470
|
});
|
|
472
471
|
}
|
|
473
472
|
});
|
|
474
473
|
}
|
|
475
|
-
[
|
|
476
|
-
_(this,
|
|
474
|
+
[lc]() {
|
|
475
|
+
_(this, it) && St(_(this, Rt));
|
|
477
476
|
}
|
|
478
477
|
get internals() {
|
|
479
|
-
return _(this,
|
|
478
|
+
return _(this, Q);
|
|
480
479
|
}
|
|
481
480
|
/**
|
|
482
481
|
* @private
|
|
@@ -484,7 +483,7 @@ class st extends HTMLElement {
|
|
|
484
483
|
* use `@mounted`
|
|
485
484
|
*/
|
|
486
485
|
connectedCallback() {
|
|
487
|
-
_(this,
|
|
486
|
+
_(this, rt, Ut).noBlocking ? Kt.add(_(this, ne)) : _(this, ne).call(this);
|
|
488
487
|
}
|
|
489
488
|
/**
|
|
490
489
|
* @private
|
|
@@ -497,144 +496,143 @@ class st extends HTMLElement {
|
|
|
497
496
|
M(this, Xt, !0);
|
|
498
497
|
return;
|
|
499
498
|
}
|
|
500
|
-
Kt.delete(_(this, ne)), Kt.delete(_(this, se)), M(this,
|
|
499
|
+
Kt.delete(_(this, ne)), Kt.delete(_(this, se)), M(this, it, !1), (e = _(this, ts)) == null || e.forEach((i) => i()), M(this, ct, zi(_(this, ct))), M(this, At, zi(_(this, At))), (n = _(this, Nt)) == null || n.call(this);
|
|
501
500
|
}
|
|
502
501
|
}
|
|
503
|
-
Zt = new WeakMap(),
|
|
502
|
+
Zt = new WeakMap(), Q = new WeakMap(), ct = new WeakMap(), At = new WeakMap(), pt = new WeakMap(), Xt = new WeakMap(), it = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), Nt = new WeakMap(), rt = new WeakSet(), Ut = function() {
|
|
504
503
|
return this.constructor[Symbol.metadata];
|
|
505
504
|
}, an = function() {
|
|
506
|
-
return _(this,
|
|
507
|
-
},
|
|
508
|
-
const n =
|
|
505
|
+
return _(this, pt).findLast((e) => !e.condition || e.condition());
|
|
506
|
+
}, ks = new WeakMap(), Ps = new WeakMap(), Ze = new WeakMap(), se = new WeakMap(), Rt = new WeakMap(), Xe = new WeakMap(), Ms = new WeakMap(), Os = new WeakMap(), ts = new WeakMap(), ne = new WeakMap(), zn = (e) => {
|
|
507
|
+
const n = Vi, i = xs(e, (o) => {
|
|
509
508
|
const a = _(n, ct).at(0);
|
|
510
|
-
if (_(n,
|
|
511
|
-
throw new
|
|
512
|
-
|
|
509
|
+
if (!rn && _(n, it) && a && !a.initialized)
|
|
510
|
+
throw new wt("Don't set state sync before insert the DOM");
|
|
511
|
+
Ii(i, o), !_(n, ee) && _(n, it) && St(_(n, Rt), rn);
|
|
513
512
|
});
|
|
514
|
-
return _(n,
|
|
515
|
-
},
|
|
516
|
-
const
|
|
513
|
+
return _(n, Q).stateList.push(i), i;
|
|
514
|
+
}, Vn = (e, n) => _(e, pt).push(n);
|
|
515
|
+
const pc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
517
516
|
__proto__: null,
|
|
518
|
-
GemElement:
|
|
519
|
-
SheetToken:
|
|
520
|
-
UpdateToken:
|
|
521
|
-
_RenderErrorEvent:
|
|
517
|
+
GemElement: tt,
|
|
518
|
+
SheetToken: Et,
|
|
519
|
+
UpdateToken: As,
|
|
520
|
+
_RenderErrorEvent: Wn,
|
|
522
521
|
get _createTemplate() {
|
|
523
|
-
return
|
|
522
|
+
return Vn;
|
|
524
523
|
},
|
|
525
524
|
get createState() {
|
|
526
|
-
return
|
|
525
|
+
return zn;
|
|
527
526
|
},
|
|
528
|
-
css:
|
|
527
|
+
css: le,
|
|
529
528
|
get html() {
|
|
530
|
-
return
|
|
529
|
+
return ot;
|
|
531
530
|
},
|
|
532
|
-
isSSR: Nr,
|
|
533
531
|
get render() {
|
|
534
|
-
return
|
|
532
|
+
return Ls;
|
|
535
533
|
},
|
|
536
|
-
setEngine:
|
|
537
|
-
}, Symbol.toStringTag, { value: "Module" })), { deleteProperty:
|
|
538
|
-
function
|
|
534
|
+
setEngine: Ar
|
|
535
|
+
}, Symbol.toStringTag, { value: "Module" })), { deleteProperty: fc, getOwnPropertyDescriptor: Gn, defineProperty: Ns } = Reflect, { getPrototypeOf: Rs, assign: mc, hasOwn: Is } = Object, Gi = new rc();
|
|
536
|
+
function Ct(s, t, e) {
|
|
539
537
|
var i;
|
|
540
538
|
const n = s.metadata;
|
|
541
|
-
|
|
539
|
+
Gn(n, t) || Ns(n, t, {
|
|
542
540
|
value: ((i = n[t]) == null ? void 0 : i.filter((o) => o !== e)) || []
|
|
543
541
|
}), n[t].push(e);
|
|
544
542
|
}
|
|
545
543
|
function Hs(s, t) {
|
|
546
|
-
const { value: e } =
|
|
547
|
-
|
|
544
|
+
const { value: e } = Gn(s, t) || {};
|
|
545
|
+
fc(s, t), s[t] = e;
|
|
548
546
|
}
|
|
549
|
-
const cn = /* @__PURE__ */ new WeakMap(), { setAttribute:
|
|
547
|
+
const cn = /* @__PURE__ */ new WeakMap(), { setAttribute: Hr, toggleAttribute: gc, removeAttribute: Wr } = Element.prototype, Dn = (s, t) => {
|
|
550
548
|
var e;
|
|
551
549
|
return (e = cn.get(Rs(s))) == null ? void 0 : e.get(t);
|
|
552
550
|
};
|
|
553
|
-
|
|
554
|
-
const e =
|
|
555
|
-
if (!e) return
|
|
551
|
+
tt.prototype.setAttribute = function(s, t) {
|
|
552
|
+
const e = Dn(this, s);
|
|
553
|
+
if (!e) return Hr.call(this, s, t);
|
|
556
554
|
this[e] = t;
|
|
557
555
|
};
|
|
558
|
-
|
|
559
|
-
const t =
|
|
560
|
-
if (!t) return
|
|
556
|
+
tt.prototype.removeAttribute = function(s) {
|
|
557
|
+
const t = Dn(this, s);
|
|
558
|
+
if (!t) return Wr.call(this, s);
|
|
561
559
|
this[t] = null;
|
|
562
560
|
};
|
|
563
|
-
|
|
564
|
-
const e =
|
|
565
|
-
return e ? this[e] = t ?? !this.hasAttribute(s) :
|
|
561
|
+
tt.prototype.toggleAttribute = function(s, t) {
|
|
562
|
+
const e = Dn(this, s);
|
|
563
|
+
return e ? this[e] = t ?? !this.hasAttribute(s) : gc.call(this, s, t);
|
|
566
564
|
};
|
|
567
|
-
function
|
|
565
|
+
function vc() {
|
|
568
566
|
}
|
|
569
|
-
const
|
|
570
|
-
function
|
|
567
|
+
const Di = Symbol("event handle");
|
|
568
|
+
function Un(s, t, { attr: e, attrType: n, event: i, eventOptions: o } = {}) {
|
|
571
569
|
Ns(s, t, {
|
|
572
570
|
configurable: !0,
|
|
573
571
|
get() {
|
|
574
|
-
const a =
|
|
575
|
-
return i && !a ? (this[t] =
|
|
572
|
+
const a = Gi.get(this)[t];
|
|
573
|
+
return i && !a ? (this[t] = vc, this[t]) : a;
|
|
576
574
|
},
|
|
577
575
|
set(a) {
|
|
578
|
-
const c = this,
|
|
579
|
-
e && (a = n === Boolean && a === "" ? !0 : n(a || ""), a ?
|
|
576
|
+
const c = this, l = Gi.get(c);
|
|
577
|
+
e && (a = n === Boolean && a === "" ? !0 : n(a || ""), a ? Hr.call(this, e, n === Boolean ? "" : a) : Wr.call(this, e)), a !== l[t] && (i ? (l[t] = a != null && a[Di] ? a : async (d, f) => {
|
|
580
578
|
await Promise.resolve();
|
|
581
|
-
const r = new CustomEvent(i, { ...f, ...o, detail:
|
|
582
|
-
c.dispatchEvent(r), await a(
|
|
583
|
-
},
|
|
579
|
+
const r = new CustomEvent(i, { ...f, ...o, detail: d });
|
|
580
|
+
c.dispatchEvent(r), await a(d, f);
|
|
581
|
+
}, l[t][Di] = !0) : (l[t] = a, this[As]()));
|
|
584
582
|
}
|
|
585
583
|
});
|
|
586
584
|
}
|
|
587
|
-
const
|
|
588
|
-
function
|
|
589
|
-
const e =
|
|
585
|
+
const Ui = /* @__PURE__ */ new WeakMap();
|
|
586
|
+
function ns(s, { metadata: t }) {
|
|
587
|
+
const e = Ui.get(t);
|
|
590
588
|
if (e) return e;
|
|
591
589
|
let n = s;
|
|
592
590
|
do
|
|
593
591
|
n = Rs(n);
|
|
594
592
|
while (n.constructor[Symbol.metadata] !== t);
|
|
595
|
-
return
|
|
593
|
+
return Ui.set(t, n), n;
|
|
596
594
|
}
|
|
597
|
-
function
|
|
595
|
+
function Fn(s, t) {
|
|
598
596
|
const e = s.name, n = he(e);
|
|
599
597
|
return s.addInitializer(function() {
|
|
600
|
-
const i =
|
|
601
|
-
Is(i, e) || (
|
|
598
|
+
const i = ns(this, s);
|
|
599
|
+
Is(i, e) || (Ct(s, "observedAttributes", n), Un(i, e, { attr: n, attrType: t })), Hs(this, e);
|
|
602
600
|
const o = Rs(this), a = cn.get(o) || /* @__PURE__ */ new Map();
|
|
603
601
|
a.set(n, e), cn.set(o, a);
|
|
604
602
|
}), function(i) {
|
|
605
603
|
return this.getAttribute(n) ?? i;
|
|
606
604
|
};
|
|
607
605
|
}
|
|
608
|
-
function
|
|
609
|
-
return
|
|
606
|
+
function B(s, t) {
|
|
607
|
+
return Fn(t, String);
|
|
610
608
|
}
|
|
611
609
|
function Ws(s, t) {
|
|
612
|
-
return
|
|
610
|
+
return Fn(t, Boolean);
|
|
613
611
|
}
|
|
614
|
-
function
|
|
615
|
-
return
|
|
612
|
+
function $c(s, t) {
|
|
613
|
+
return Fn(t, Number);
|
|
616
614
|
}
|
|
617
|
-
function
|
|
615
|
+
function D(s, t) {
|
|
618
616
|
const e = t.name;
|
|
619
617
|
return t.addInitializer(function() {
|
|
620
|
-
const n =
|
|
621
|
-
Is(n, e) || (
|
|
618
|
+
const n = ns(this, t);
|
|
619
|
+
Is(n, e) || (Ct(t, "observedProperties", e), Un(n, e)), Hs(this, e);
|
|
622
620
|
}), function(n) {
|
|
623
621
|
return this[e] ?? n;
|
|
624
622
|
};
|
|
625
623
|
}
|
|
626
|
-
function
|
|
624
|
+
function zr(s) {
|
|
627
625
|
return (t, e) => {
|
|
628
626
|
const { addInitializer: n, name: i, access: o, kind: a } = e;
|
|
629
627
|
n(function() {
|
|
630
628
|
const c = s && (() => s(this));
|
|
631
629
|
if (a === "getter") {
|
|
632
|
-
if (e.private) throw new
|
|
633
|
-
const
|
|
630
|
+
if (e.private) throw new wt("not support");
|
|
631
|
+
const l = ns(this, e), d = Gn(l, i).get.bind(this);
|
|
634
632
|
this.memo(() => {
|
|
635
633
|
Ns(this, i, {
|
|
636
634
|
configurable: !0,
|
|
637
|
-
value:
|
|
635
|
+
value: d()
|
|
638
636
|
});
|
|
639
637
|
}, c);
|
|
640
638
|
} else
|
|
@@ -642,14 +640,14 @@ function Hr(s) {
|
|
|
642
640
|
});
|
|
643
641
|
};
|
|
644
642
|
}
|
|
645
|
-
function
|
|
643
|
+
function ft(s) {
|
|
646
644
|
return (t, { addInitializer: e, access: n }) => {
|
|
647
645
|
e(function() {
|
|
648
646
|
this.effect(n.get.call(this, this).bind(this), s && (() => s(this)));
|
|
649
647
|
});
|
|
650
648
|
};
|
|
651
649
|
}
|
|
652
|
-
function
|
|
650
|
+
function Sc() {
|
|
653
651
|
return (s, { addInitializer: t, access: e }) => {
|
|
654
652
|
t(function() {
|
|
655
653
|
this.effect(
|
|
@@ -659,32 +657,32 @@ function uc() {
|
|
|
659
657
|
});
|
|
660
658
|
};
|
|
661
659
|
}
|
|
662
|
-
function
|
|
663
|
-
return
|
|
660
|
+
function qn() {
|
|
661
|
+
return zr(() => []);
|
|
664
662
|
}
|
|
665
|
-
function
|
|
666
|
-
return
|
|
663
|
+
function Be() {
|
|
664
|
+
return ft(() => []);
|
|
667
665
|
}
|
|
668
|
-
function
|
|
666
|
+
function de(s) {
|
|
669
667
|
return (t, { addInitializer: e, access: n }) => {
|
|
670
668
|
e(function() {
|
|
671
|
-
|
|
669
|
+
Vn(this, {
|
|
672
670
|
render: n.get.call(this, this).bind(this),
|
|
673
671
|
condition: s && (() => s(this))
|
|
674
672
|
});
|
|
675
673
|
});
|
|
676
674
|
};
|
|
677
675
|
}
|
|
678
|
-
function
|
|
676
|
+
function yc() {
|
|
679
677
|
return (s, { addInitializer: t, access: e }) => {
|
|
680
678
|
t(function() {
|
|
681
|
-
this.addEventListener(
|
|
682
|
-
|
|
679
|
+
this.addEventListener(Wn, ({ detail: n }) => {
|
|
680
|
+
Ls(e.get.call(this, this).apply(this, [n]), this.internals.shadowRoot || this);
|
|
683
681
|
});
|
|
684
682
|
});
|
|
685
683
|
};
|
|
686
684
|
}
|
|
687
|
-
function
|
|
685
|
+
function wc(s, t, e) {
|
|
688
686
|
Ns(s, t, {
|
|
689
687
|
configurable: !0,
|
|
690
688
|
get() {
|
|
@@ -700,54 +698,54 @@ function pc(s, t, e) {
|
|
|
700
698
|
function zs(s, t) {
|
|
701
699
|
const e = t.name, n = he(e);
|
|
702
700
|
t.addInitializer(function() {
|
|
703
|
-
const i =
|
|
704
|
-
Is(i, e) || (
|
|
701
|
+
const i = ns(this, t);
|
|
702
|
+
Is(i, e) || (Ct(t, "definedCSSStates", n), wc(i, e, n)), Hs(this, e);
|
|
705
703
|
});
|
|
706
704
|
}
|
|
707
|
-
function
|
|
705
|
+
function Vr(s, t, e, n) {
|
|
708
706
|
const i = s.name, o = he(i);
|
|
709
707
|
if (s.static)
|
|
710
|
-
|
|
708
|
+
Ct(s, e, o);
|
|
711
709
|
else {
|
|
712
710
|
const a = Rs(t);
|
|
713
|
-
a[i] || (a[i] = o,
|
|
711
|
+
a[i] || (a[i] = o, Ct(s, e, o));
|
|
714
712
|
}
|
|
715
713
|
return n || o;
|
|
716
714
|
}
|
|
717
|
-
function
|
|
715
|
+
function Ec(s, t) {
|
|
718
716
|
return function(e) {
|
|
719
|
-
return
|
|
717
|
+
return Vr(t, this, "definedSlots", e);
|
|
720
718
|
};
|
|
721
719
|
}
|
|
722
|
-
function
|
|
720
|
+
function Gr(s, t) {
|
|
723
721
|
return function(e) {
|
|
724
|
-
return
|
|
722
|
+
return Vr(t, this, "definedParts", e);
|
|
725
723
|
};
|
|
726
724
|
}
|
|
727
|
-
function
|
|
728
|
-
|
|
725
|
+
function Te(s, t) {
|
|
726
|
+
Dr(t);
|
|
729
727
|
}
|
|
730
|
-
function
|
|
731
|
-
|
|
728
|
+
function Cc(s, t) {
|
|
729
|
+
Dr(t, { bubbles: !0, composed: !0 });
|
|
732
730
|
}
|
|
733
|
-
function
|
|
731
|
+
function Dr(s, t) {
|
|
734
732
|
const e = s.name, n = he(e);
|
|
735
733
|
s.addInitializer(function() {
|
|
736
|
-
const i =
|
|
737
|
-
Is(i, e) || (
|
|
734
|
+
const i = ns(this, s);
|
|
735
|
+
Is(i, e) || (Ct(s, "definedEvents", n), Un(i, e, { event: n, eventOptions: t })), Hs(this, e);
|
|
738
736
|
});
|
|
739
737
|
}
|
|
740
|
-
function
|
|
738
|
+
function is(s) {
|
|
741
739
|
return (t, e) => {
|
|
742
|
-
|
|
740
|
+
Ct(e, "adoptedStyleSheets", s);
|
|
743
741
|
};
|
|
744
742
|
}
|
|
745
|
-
function
|
|
743
|
+
function Vs(s) {
|
|
746
744
|
return (t, e) => {
|
|
747
|
-
|
|
745
|
+
Ct(e, "observedStores", s);
|
|
748
746
|
};
|
|
749
747
|
}
|
|
750
|
-
function
|
|
748
|
+
function zt({
|
|
751
749
|
mode: s = "open",
|
|
752
750
|
serializable: t = !0,
|
|
753
751
|
delegatesFocus: e,
|
|
@@ -755,72 +753,72 @@ function Vt({
|
|
|
755
753
|
} = {}) {
|
|
756
754
|
return (i, o) => {
|
|
757
755
|
const a = o.metadata;
|
|
758
|
-
|
|
756
|
+
mc(a, { mode: s, serializable: t, delegatesFocus: e, slotAssignment: n });
|
|
759
757
|
};
|
|
760
758
|
}
|
|
761
|
-
function
|
|
759
|
+
function Ur({ penetrable: s }) {
|
|
762
760
|
return (t, e) => {
|
|
763
761
|
const n = e.metadata;
|
|
764
762
|
n.penetrable = s;
|
|
765
763
|
};
|
|
766
764
|
}
|
|
767
|
-
function
|
|
765
|
+
function bc() {
|
|
768
766
|
return (s, t) => {
|
|
769
767
|
const e = t.metadata;
|
|
770
768
|
e.noBlocking = !0;
|
|
771
769
|
};
|
|
772
770
|
}
|
|
773
|
-
function
|
|
771
|
+
function Gs(s) {
|
|
774
772
|
return (t, e) => {
|
|
775
773
|
const n = e.metadata;
|
|
776
774
|
n.aria = { ...n.aria, ...s };
|
|
777
775
|
};
|
|
778
776
|
}
|
|
779
|
-
function
|
|
777
|
+
function Tc(s) {
|
|
780
778
|
return (t, { addInitializer: e }) => {
|
|
781
779
|
e(() => {
|
|
782
780
|
customElements.define(s, t);
|
|
783
781
|
});
|
|
784
782
|
};
|
|
785
783
|
}
|
|
786
|
-
const
|
|
784
|
+
const kc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
787
785
|
__proto__: null,
|
|
788
|
-
adoptedStyle:
|
|
789
|
-
aria:
|
|
790
|
-
async:
|
|
791
|
-
attribute:
|
|
786
|
+
adoptedStyle: is,
|
|
787
|
+
aria: Gs,
|
|
788
|
+
async: bc,
|
|
789
|
+
attribute: B,
|
|
792
790
|
boolattribute: Ws,
|
|
793
|
-
connectStore:
|
|
794
|
-
customElement:
|
|
795
|
-
effect:
|
|
796
|
-
emitter:
|
|
797
|
-
fallback:
|
|
798
|
-
globalemitter:
|
|
799
|
-
light:
|
|
800
|
-
memo:
|
|
801
|
-
mounted:
|
|
802
|
-
numattribute:
|
|
803
|
-
part:
|
|
804
|
-
property:
|
|
805
|
-
shadow:
|
|
806
|
-
slot:
|
|
791
|
+
connectStore: Vs,
|
|
792
|
+
customElement: Tc,
|
|
793
|
+
effect: ft,
|
|
794
|
+
emitter: Te,
|
|
795
|
+
fallback: yc,
|
|
796
|
+
globalemitter: Cc,
|
|
797
|
+
light: Ur,
|
|
798
|
+
memo: zr,
|
|
799
|
+
mounted: Be,
|
|
800
|
+
numattribute: $c,
|
|
801
|
+
part: Gr,
|
|
802
|
+
property: D,
|
|
803
|
+
shadow: zt,
|
|
804
|
+
slot: Ec,
|
|
807
805
|
state: zs,
|
|
808
|
-
template:
|
|
809
|
-
unmounted:
|
|
810
|
-
willMount:
|
|
806
|
+
template: de,
|
|
807
|
+
unmounted: Sc,
|
|
808
|
+
willMount: qn
|
|
811
809
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
812
810
|
/**
|
|
813
811
|
* @license
|
|
814
812
|
* Copyright 2017 Google LLC
|
|
815
813
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
816
814
|
*/
|
|
817
|
-
const
|
|
818
|
-
\f\r]`,
|
|
819
|
-
\f\r"'\`<>=]`,
|
|
820
|
-
`>|${
|
|
815
|
+
const Pc = globalThis, Ue = Pc.trustedTypes, Fi = Ue == null ? void 0 : Ue.createPolicy("lit-html", { createHTML: (s) => s }), Fr = "$lit$", yt = `lit$${Math.random().toFixed(9).slice(2)}$`, qr = "?" + yt, Mc = `<${qr}>`, Ht = document, re = () => Ht.createComment(""), Ke = (s) => s === null || typeof s != "object" && typeof s != "function", jt = (s) => s == null, Oc = (s) => Symbol.iterator in s, Js = `[
|
|
816
|
+
\f\r]`, xc = `[^
|
|
817
|
+
\f\r"'\`<>=]`, Lc = `[^\\s"'>=/]`, ye = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, qi = 1, Ys = 2, Ac = 3, Bi = /-->/g, Ki = />/g, kt = new RegExp(
|
|
818
|
+
`>|${Js}(?:(${Lc}+)(${Js}*=${Js}*(?:${xc}|("|')|))|$)`,
|
|
821
819
|
"g"
|
|
822
|
-
),
|
|
823
|
-
class
|
|
820
|
+
), Nc = 0, ji = 1, Rc = 2, Qi = 3, Ji = /'/g, Yi = /"/g, Br = /^(?:script|style|textarea|title)$/i, Ic = 1, $s = 2, Ss = 3, Bn = 1, ys = 2, Hc = 3, Wc = 4, zc = 5, Kn = 6, Vc = 7, Zi = "v-if", Xi = "v-else-if", tr = "v-else";
|
|
821
|
+
class Kr {
|
|
824
822
|
constructor(t, e, n) {
|
|
825
823
|
v(this, "type");
|
|
826
824
|
v(this, "strings");
|
|
@@ -828,73 +826,73 @@ class qr {
|
|
|
828
826
|
this.type = t, this.strings = e, this.values = n;
|
|
829
827
|
}
|
|
830
828
|
}
|
|
831
|
-
const
|
|
832
|
-
|
|
829
|
+
const jn = (s) => (t, ...e) => new Kr(s, t, e), Gc = jn(Ic), Al = jn($s), Nl = jn(Ss), Qn = Symbol.for("lit-noChange"), er = /* @__PURE__ */ new WeakMap(), xt = Ht.createTreeWalker(
|
|
830
|
+
Ht,
|
|
833
831
|
129
|
|
834
832
|
/* NodeFilter.SHOW_{ELEMENT|COMMENT} */
|
|
835
833
|
);
|
|
836
|
-
function
|
|
834
|
+
function Dc(s, t) {
|
|
837
835
|
if (!Array.isArray(s)) throw new Error("invalid template");
|
|
838
|
-
return
|
|
836
|
+
return Fi !== void 0 ? Fi.createHTML(t) : t;
|
|
839
837
|
}
|
|
840
|
-
const
|
|
838
|
+
const Uc = (s, t) => {
|
|
841
839
|
const e = s.length - 1, n = [];
|
|
842
|
-
let i = t ===
|
|
843
|
-
for (let
|
|
844
|
-
const
|
|
840
|
+
let i = t === $s ? "<svg>" : t === Ss ? "<math>" : "", o, a = ye;
|
|
841
|
+
for (let l = 0; l < e; l++) {
|
|
842
|
+
const d = s[l];
|
|
845
843
|
let f = -1, r, m = 0, h;
|
|
846
|
-
for (; m <
|
|
847
|
-
m = a.lastIndex, a ===
|
|
848
|
-
const g = a ===
|
|
849
|
-
i += a ===
|
|
844
|
+
for (; m < d.length && (a.lastIndex = m, h = a.exec(d), h !== null); )
|
|
845
|
+
m = a.lastIndex, a === ye ? h[qi] === "!--" ? a = Bi : h[qi] !== void 0 ? a = Ki : h[Ys] !== void 0 ? (Br.test(h[Ys]) && (o = new RegExp(`</${h[Ys]}`, "g")), a = kt) : h[Ac] !== void 0 && (a = kt) : a === kt ? h[Nc] === ">" ? (a = o ?? ye, f = -1) : h[ji] === void 0 ? f = -2 : (f = a.lastIndex - h[Rc].length, r = h[ji], a = h[Qi] === void 0 ? kt : h[Qi] === '"' ? Yi : Ji) : a === Yi || a === Ji ? a = kt : a === Bi || a === Ki ? a = ye : (a = kt, o = void 0);
|
|
846
|
+
const g = a === kt && s[l + 1].startsWith("/>") ? " " : "";
|
|
847
|
+
i += a === ye ? d + Mc : f >= 0 ? (n.push(r), d.slice(0, f) + Fr + d.slice(f) + yt + g) : d + yt + (f === -2 ? l : g);
|
|
850
848
|
}
|
|
851
|
-
const c = i + (s[e] || "<?>") + (t ===
|
|
852
|
-
return [
|
|
849
|
+
const c = i + (s[e] || "<?>") + (t === $s ? "</svg>" : t === Ss ? "</math>" : "");
|
|
850
|
+
return [Dc(s, c), n];
|
|
853
851
|
};
|
|
854
|
-
class
|
|
852
|
+
class Jn {
|
|
855
853
|
constructor({ strings: t, type: e }, n) {
|
|
856
854
|
/** @internal */
|
|
857
855
|
v(this, "el");
|
|
858
856
|
v(this, "parts", []);
|
|
859
857
|
let i, o = 0, a = 0;
|
|
860
|
-
const c = t.length - 1,
|
|
861
|
-
if (this.el =
|
|
858
|
+
const c = t.length - 1, l = this.parts, [d, f] = Uc(t, e);
|
|
859
|
+
if (this.el = Jn.createElement(d, n), xt.currentNode = this.el.content, e === $s || e === Ss) {
|
|
862
860
|
const r = this.el.content.firstChild;
|
|
863
861
|
r.replaceWith(...r.childNodes);
|
|
864
862
|
}
|
|
865
|
-
for (; (i = xt.nextNode()) !== null &&
|
|
863
|
+
for (; (i = xt.nextNode()) !== null && l.length < c; ) {
|
|
866
864
|
if (i.nodeType === 1) {
|
|
867
865
|
if (i.hasAttributes())
|
|
868
866
|
for (const r of i.getAttributeNames())
|
|
869
|
-
if (r.endsWith(
|
|
870
|
-
const m = f[a++], g = i.getAttribute(r).split(
|
|
871
|
-
|
|
872
|
-
type:
|
|
867
|
+
if (r.endsWith(Fr)) {
|
|
868
|
+
const m = f[a++], g = i.getAttribute(r).split(yt), $ = /([.?@])?(.*)/.exec(m);
|
|
869
|
+
l.push({
|
|
870
|
+
type: Bn,
|
|
873
871
|
index: o,
|
|
874
872
|
name: $[2],
|
|
875
873
|
strings: g,
|
|
876
|
-
ctor: $[1] === "." ?
|
|
874
|
+
ctor: $[1] === "." ? Bc : $[1] === "?" ? Kc : $[1] === "@" ? jc : Ds
|
|
877
875
|
}), i.removeAttribute(r);
|
|
878
|
-
} else r.startsWith(
|
|
879
|
-
type:
|
|
876
|
+
} else r.startsWith(yt) && (l.push({
|
|
877
|
+
type: Kn,
|
|
880
878
|
index: o
|
|
881
879
|
}), i.removeAttribute(r));
|
|
882
|
-
if (
|
|
883
|
-
const r = i.textContent.split(
|
|
880
|
+
if (Br.test(i.tagName)) {
|
|
881
|
+
const r = i.textContent.split(yt), m = r.length - 1;
|
|
884
882
|
if (m > 0) {
|
|
885
|
-
i.textContent =
|
|
883
|
+
i.textContent = Ue ? Ue.emptyScript : "";
|
|
886
884
|
for (let h = 0; h < m; h++)
|
|
887
|
-
i.append(r[h], re()), xt.nextNode(),
|
|
885
|
+
i.append(r[h], re()), xt.nextNode(), l.push({ type: ys, index: ++o });
|
|
888
886
|
i.append(r[m], re());
|
|
889
887
|
}
|
|
890
888
|
}
|
|
891
889
|
} else if (i.nodeType === 8)
|
|
892
|
-
if (i.data ===
|
|
893
|
-
|
|
890
|
+
if (i.data === qr)
|
|
891
|
+
l.push({ type: ys, index: o });
|
|
894
892
|
else {
|
|
895
893
|
let m = -1;
|
|
896
|
-
for (; (m = i.data.indexOf(
|
|
897
|
-
|
|
894
|
+
for (; (m = i.data.indexOf(yt, m + 1)) !== -1; )
|
|
895
|
+
l.push({ type: Vc, index: o }), m += yt.length - 1;
|
|
898
896
|
}
|
|
899
897
|
o++;
|
|
900
898
|
}
|
|
@@ -902,16 +900,16 @@ class Kn {
|
|
|
902
900
|
// Overridden via `litHtmlPolyfillSupport` to provide platform support.
|
|
903
901
|
/** @nocollapse */
|
|
904
902
|
static createElement(t, e) {
|
|
905
|
-
const n =
|
|
903
|
+
const n = Ht.createElement("template");
|
|
906
904
|
return n.innerHTML = t, n;
|
|
907
905
|
}
|
|
908
906
|
}
|
|
909
907
|
function oe(s, t, e = s, n) {
|
|
910
908
|
var a, c;
|
|
911
|
-
if (t ===
|
|
909
|
+
if (t === Qn)
|
|
912
910
|
return t;
|
|
913
911
|
let i = n !== void 0 ? (a = e.__directives) == null ? void 0 : a[n] : e.__directive;
|
|
914
|
-
const o =
|
|
912
|
+
const o = Ke(t) ? void 0 : (
|
|
915
913
|
// This property needs to remain unminified.
|
|
916
914
|
t._$litDirective$
|
|
917
915
|
);
|
|
@@ -922,7 +920,7 @@ function oe(s, t, e = s, n) {
|
|
|
922
920
|
n
|
|
923
921
|
)), t;
|
|
924
922
|
}
|
|
925
|
-
class
|
|
923
|
+
class Fc {
|
|
926
924
|
constructor(t, e) {
|
|
927
925
|
v(this, "_$template");
|
|
928
926
|
v(this, "_$parts", []);
|
|
@@ -948,18 +946,18 @@ class Ic {
|
|
|
948
946
|
const {
|
|
949
947
|
el: { content: e },
|
|
950
948
|
parts: n
|
|
951
|
-
} = this._$template, i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), a = ((t == null ? void 0 : t.creationScope) ??
|
|
949
|
+
} = this._$template, i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), a = ((t == null ? void 0 : t.creationScope) ?? Ht).importNode(e, !0);
|
|
952
950
|
xt.currentNode = a;
|
|
953
|
-
let c = xt.nextNode(),
|
|
951
|
+
let c = xt.nextNode(), l = 0, d = 0, f = n[0];
|
|
954
952
|
for (; f !== void 0; ) {
|
|
955
|
-
if (
|
|
953
|
+
if (l === f.index) {
|
|
956
954
|
let r;
|
|
957
|
-
f.type ===
|
|
955
|
+
f.type === ys ? r = new rs(c, c.nextSibling, this, t) : f.type === Bn ? (f.name === Zi && i.set(c, d), f.name === Xi && o.set(c, d), r = new f.ctor(c, f.name, f.strings, this, t)) : f.type === Kn && (r = new Qc(c, this, t)), this._$parts.push(r), f = n[++d];
|
|
958
956
|
}
|
|
959
|
-
|
|
957
|
+
l !== (f == null ? void 0 : f.index) && (c = xt.nextNode(), l++);
|
|
960
958
|
}
|
|
961
959
|
return i.forEach((r, m) => {
|
|
962
|
-
const h = new
|
|
960
|
+
const h = new qc(m, r);
|
|
963
961
|
this._$conditions.push(h);
|
|
964
962
|
let g = m;
|
|
965
963
|
for (; g = g.nextElementSibling; ) {
|
|
@@ -967,16 +965,16 @@ class Ic {
|
|
|
967
965
|
if ($ === void 0) break;
|
|
968
966
|
h.push(g, $);
|
|
969
967
|
}
|
|
970
|
-
}), xt.currentNode =
|
|
968
|
+
}), xt.currentNode = Ht, a;
|
|
971
969
|
}
|
|
972
970
|
_update(t) {
|
|
973
971
|
let e = 0;
|
|
974
972
|
for (const n of this._$parts)
|
|
975
|
-
n !== void 0 && (n.strings !== void 0 ? (n._$setValue(t, n, e), e += n.strings.length - 2) : n.name ===
|
|
973
|
+
n !== void 0 && (n.strings !== void 0 ? (n._$setValue(t, n, e), e += n.strings.length - 2) : n.name === Zi || n.name === Xi || n._$setValue(t[e])), e++;
|
|
976
974
|
this._$conditions.forEach((n) => n.update(t));
|
|
977
975
|
}
|
|
978
976
|
}
|
|
979
|
-
class
|
|
977
|
+
class qc {
|
|
980
978
|
constructor(t, e) {
|
|
981
979
|
v(this, "mark");
|
|
982
980
|
v(this, "list");
|
|
@@ -991,16 +989,16 @@ class Hc {
|
|
|
991
989
|
}
|
|
992
990
|
check() {
|
|
993
991
|
const t = this.next;
|
|
994
|
-
t != null && t.attributes.getNamedItem(
|
|
992
|
+
t != null && t.attributes.getNamedItem(tr) && (this.list.push({ ele: t }), t.removeAttribute(tr));
|
|
995
993
|
}
|
|
996
994
|
update(t) {
|
|
997
995
|
const { mark: e, list: n } = this, i = n.find(({ idx: o }) => o === void 0 || !!t[o]);
|
|
998
996
|
i && !i.ele.parentNode && e.after(i.ele), n.forEach(({ ele: o }) => (!i || o !== i.ele) && o.remove());
|
|
999
997
|
}
|
|
1000
998
|
}
|
|
1001
|
-
class
|
|
999
|
+
class rs {
|
|
1002
1000
|
constructor(t, e, n, i) {
|
|
1003
|
-
v(this, "type",
|
|
1001
|
+
v(this, "type", ys);
|
|
1004
1002
|
v(this, "options");
|
|
1005
1003
|
v(this, "_$committedValue");
|
|
1006
1004
|
/** @internal */
|
|
@@ -1069,7 +1067,7 @@ class os {
|
|
|
1069
1067
|
return this._$endNode;
|
|
1070
1068
|
}
|
|
1071
1069
|
_$setValue(t, e = this) {
|
|
1072
|
-
this.parentNode && (t = oe(this, t, e),
|
|
1070
|
+
this.parentNode && (t = oe(this, t, e), Ke(t) ? jt(t) || t === "" ? (jt(this._$committedValue) || this._$clear(), this._$committedValue = void 0) : t !== this._$committedValue && t !== Qn && this._commitText(t) : t instanceof Kr ? this._commitTemplateResult(t) : t.nodeType !== void 0 ? this._commitNode(t) : Oc(t) ? this._commitIterable(t) : this._commitText(t));
|
|
1073
1071
|
}
|
|
1074
1072
|
_insert(t) {
|
|
1075
1073
|
return this._$startNode.parentNode.insertBefore(t, this._$endNode);
|
|
@@ -1078,11 +1076,11 @@ class os {
|
|
|
1078
1076
|
this._$committedValue !== t && (this._$clear(), this._$committedValue = this._insert(t));
|
|
1079
1077
|
}
|
|
1080
1078
|
_commitText(t) {
|
|
1081
|
-
if (!jt(this._$committedValue) &&
|
|
1079
|
+
if (!jt(this._$committedValue) && Ke(this._$committedValue)) {
|
|
1082
1080
|
const e = this._$startNode.nextSibling;
|
|
1083
1081
|
e.data = t;
|
|
1084
1082
|
} else
|
|
1085
|
-
this._commitNode(
|
|
1083
|
+
this._commitNode(Ht.createTextNode(t));
|
|
1086
1084
|
this._$committedValue = t;
|
|
1087
1085
|
}
|
|
1088
1086
|
_commitTemplateResult(t) {
|
|
@@ -1091,15 +1089,15 @@ class os {
|
|
|
1091
1089
|
if (((i = this._$committedValue) == null ? void 0 : i._$template) === n)
|
|
1092
1090
|
this._$committedValue._update(e);
|
|
1093
1091
|
else {
|
|
1094
|
-
const o = new
|
|
1092
|
+
const o = new Fc(n, this), a = o._clone(this.options);
|
|
1095
1093
|
o._update(e), this._commitNode(a), this._$committedValue = o;
|
|
1096
1094
|
}
|
|
1097
1095
|
}
|
|
1098
1096
|
// Overridden via `litHtmlPolyfillSupport` to provide platform support.
|
|
1099
1097
|
/** @internal */
|
|
1100
1098
|
_$getTemplate(t) {
|
|
1101
|
-
let e =
|
|
1102
|
-
return e === void 0 &&
|
|
1099
|
+
let e = er.get(t.strings);
|
|
1100
|
+
return e === void 0 && er.set(t.strings, e = new Jn(t)), e;
|
|
1103
1101
|
}
|
|
1104
1102
|
_commitIterable(t) {
|
|
1105
1103
|
Array.isArray(this._$committedValue) || (this._$committedValue = [], this._$clear());
|
|
@@ -1107,7 +1105,7 @@ class os {
|
|
|
1107
1105
|
let n = 0, i;
|
|
1108
1106
|
for (const o of t)
|
|
1109
1107
|
n === e.length ? e.push(
|
|
1110
|
-
i = new
|
|
1108
|
+
i = new rs(this._insert(re()), this._insert(re()), this, this.options)
|
|
1111
1109
|
) : i = e[n], i._$setValue(o), n++;
|
|
1112
1110
|
n < e.length && (this._$clear(i && i._$endNode.nextSibling, n), e.length = n);
|
|
1113
1111
|
}
|
|
@@ -1141,9 +1139,9 @@ class os {
|
|
|
1141
1139
|
this._$parent === void 0 && (this.__isConnected = t, (e = this._$notifyConnectionChanged) == null || e.call(this, t));
|
|
1142
1140
|
}
|
|
1143
1141
|
}
|
|
1144
|
-
class
|
|
1142
|
+
class Ds {
|
|
1145
1143
|
constructor(t, e, n, i, o) {
|
|
1146
|
-
v(this, "type",
|
|
1144
|
+
v(this, "type", Bn);
|
|
1147
1145
|
v(this, "element");
|
|
1148
1146
|
v(this, "name");
|
|
1149
1147
|
v(this, "options");
|
|
@@ -1196,13 +1194,13 @@ class Us {
|
|
|
1196
1194
|
const o = this.strings;
|
|
1197
1195
|
let a = !1;
|
|
1198
1196
|
if (o === void 0)
|
|
1199
|
-
t = oe(this, t, e, 0), a = !
|
|
1197
|
+
t = oe(this, t, e, 0), a = !Ke(t) || t !== this._$committedValue, a && (this._$committedValue = t);
|
|
1200
1198
|
else {
|
|
1201
1199
|
const c = t;
|
|
1202
1200
|
t = o[0];
|
|
1203
|
-
let
|
|
1204
|
-
for (
|
|
1205
|
-
|
|
1201
|
+
let l, d;
|
|
1202
|
+
for (l = 0; l < o.length - 1; l++)
|
|
1203
|
+
d = oe(this, c[n + l], e, l), a || (a = !Ke(d) || d !== this._$committedValue[l]), jt(d) ? t = void 0 : jt(t) || (t += d + o[l + 1]), this._$committedValue[l] = d;
|
|
1206
1204
|
}
|
|
1207
1205
|
a && !i && this._commitValue(t);
|
|
1208
1206
|
}
|
|
@@ -1211,30 +1209,30 @@ class Us {
|
|
|
1211
1209
|
jt(t) ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t);
|
|
1212
1210
|
}
|
|
1213
1211
|
}
|
|
1214
|
-
class
|
|
1212
|
+
class Bc extends Ds {
|
|
1215
1213
|
constructor() {
|
|
1216
1214
|
super(...arguments);
|
|
1217
|
-
v(this, "type",
|
|
1215
|
+
v(this, "type", Hc);
|
|
1218
1216
|
}
|
|
1219
1217
|
/** @internal */
|
|
1220
1218
|
_commitValue(e) {
|
|
1221
1219
|
this.element[this.name] = e;
|
|
1222
1220
|
}
|
|
1223
1221
|
}
|
|
1224
|
-
class
|
|
1222
|
+
class Kc extends Ds {
|
|
1225
1223
|
constructor() {
|
|
1226
1224
|
super(...arguments);
|
|
1227
|
-
v(this, "type",
|
|
1225
|
+
v(this, "type", Wc);
|
|
1228
1226
|
}
|
|
1229
1227
|
/** @internal */
|
|
1230
1228
|
_commitValue(e) {
|
|
1231
1229
|
this.element.toggleAttribute(this.name, !!e);
|
|
1232
1230
|
}
|
|
1233
1231
|
}
|
|
1234
|
-
class
|
|
1232
|
+
class jc extends Ds {
|
|
1235
1233
|
constructor() {
|
|
1236
1234
|
super(...arguments);
|
|
1237
|
-
v(this, "type",
|
|
1235
|
+
v(this, "type", zc);
|
|
1238
1236
|
}
|
|
1239
1237
|
/** @internal */
|
|
1240
1238
|
_$setValue(e, n = this) {
|
|
@@ -1247,9 +1245,9 @@ class Vc extends Us {
|
|
|
1247
1245
|
typeof this._$committedValue == "function" ? this._$committedValue.call(((n = this.options) == null ? void 0 : n.host) ?? this.element, e) : this._$committedValue.handleEvent(e);
|
|
1248
1246
|
}
|
|
1249
1247
|
}
|
|
1250
|
-
class
|
|
1248
|
+
class Qc {
|
|
1251
1249
|
constructor(t, e, n) {
|
|
1252
|
-
v(this, "type",
|
|
1250
|
+
v(this, "type", Kn);
|
|
1253
1251
|
/** @internal */
|
|
1254
1252
|
v(this, "__directive");
|
|
1255
1253
|
// This is to ensure that every Part has a _$committedValue
|
|
@@ -1268,7 +1266,7 @@ class Gc {
|
|
|
1268
1266
|
}
|
|
1269
1267
|
_$setValue(t) {
|
|
1270
1268
|
if (t)
|
|
1271
|
-
if (t instanceof
|
|
1269
|
+
if (t instanceof jr)
|
|
1272
1270
|
t.value = this.element;
|
|
1273
1271
|
else if (t._$litDirective$)
|
|
1274
1272
|
oe(this, t);
|
|
@@ -1280,18 +1278,18 @@ class Gc {
|
|
|
1280
1278
|
}
|
|
1281
1279
|
}
|
|
1282
1280
|
}
|
|
1283
|
-
const
|
|
1284
|
-
class
|
|
1281
|
+
const Rl = () => new jr();
|
|
1282
|
+
class jr {
|
|
1285
1283
|
constructor() {
|
|
1286
1284
|
v(this, "value");
|
|
1287
1285
|
}
|
|
1288
1286
|
}
|
|
1289
|
-
const
|
|
1287
|
+
const Jc = (s, t, e) => {
|
|
1290
1288
|
const n = (e == null ? void 0 : e.renderBefore) ?? t;
|
|
1291
1289
|
let i = n._$litPart$;
|
|
1292
1290
|
if (i === void 0) {
|
|
1293
1291
|
const o = (e == null ? void 0 : e.renderBefore) ?? null;
|
|
1294
|
-
n._$litPart$ = i = new
|
|
1292
|
+
n._$litPart$ = i = new rs(
|
|
1295
1293
|
t.insertBefore(re(), o),
|
|
1296
1294
|
o,
|
|
1297
1295
|
void 0,
|
|
@@ -1299,28 +1297,23 @@ const Dc = (s, t, e) => {
|
|
|
1299
1297
|
);
|
|
1300
1298
|
}
|
|
1301
1299
|
return i._$setValue(s), i;
|
|
1302
|
-
},
|
|
1300
|
+
}, Yc = "0.0.0", Zc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1303
1301
|
__proto__: null,
|
|
1304
|
-
version:
|
|
1302
|
+
version: Yc
|
|
1305
1303
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1306
1304
|
/**
|
|
1307
1305
|
* @license
|
|
1308
1306
|
* Copyright 2017 Google LLC
|
|
1309
1307
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1310
1308
|
*/
|
|
1311
|
-
const
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
PROPERTY: 3,
|
|
1315
|
-
BOOLEAN_ATTRIBUTE: 4,
|
|
1316
|
-
EVENT: 5,
|
|
1317
|
-
ELEMENT: 6
|
|
1318
|
-
}, Bc = (s) => (...t) => ({
|
|
1309
|
+
const Xc = {
|
|
1310
|
+
CHILD: 2
|
|
1311
|
+
}, th = (s) => (...t) => ({
|
|
1319
1312
|
// This property needs to remain unminified.
|
|
1320
1313
|
_$litDirective$: s,
|
|
1321
1314
|
values: t
|
|
1322
1315
|
});
|
|
1323
|
-
class
|
|
1316
|
+
class eh {
|
|
1324
1317
|
constructor() {
|
|
1325
1318
|
//@internal
|
|
1326
1319
|
v(this, "__part");
|
|
@@ -1350,29 +1343,29 @@ class Kc {
|
|
|
1350
1343
|
return this.render(...e);
|
|
1351
1344
|
}
|
|
1352
1345
|
}
|
|
1353
|
-
const
|
|
1346
|
+
const sr = () => document.createComment(""), we = (s, t, e) => {
|
|
1354
1347
|
var o;
|
|
1355
1348
|
const n = s._$startNode.parentNode, i = t === void 0 ? s._$endNode : t._$startNode;
|
|
1356
1349
|
if (e === void 0) {
|
|
1357
|
-
const a = n.insertBefore(
|
|
1358
|
-
e = new
|
|
1350
|
+
const a = n.insertBefore(sr(), i), c = n.insertBefore(sr(), i);
|
|
1351
|
+
e = new rs(a, c, s, s.options);
|
|
1359
1352
|
} else {
|
|
1360
|
-
const a = e._$endNode.nextSibling, c = e._$parent,
|
|
1361
|
-
if (
|
|
1353
|
+
const a = e._$endNode.nextSibling, c = e._$parent, l = c !== s;
|
|
1354
|
+
if (l) {
|
|
1362
1355
|
(o = e._$reparentDisconnectables) == null || o.call(e, s), e._$parent = s;
|
|
1363
|
-
let
|
|
1364
|
-
e._$notifyConnectionChanged !== void 0 && (
|
|
1356
|
+
let d;
|
|
1357
|
+
e._$notifyConnectionChanged !== void 0 && (d = s._$isConnected) !== c._$isConnected && e._$notifyConnectionChanged(d);
|
|
1365
1358
|
}
|
|
1366
|
-
if (a !== i ||
|
|
1367
|
-
let
|
|
1368
|
-
for (;
|
|
1369
|
-
const f =
|
|
1370
|
-
n.insertBefore(
|
|
1359
|
+
if (a !== i || l) {
|
|
1360
|
+
let d = e._$startNode;
|
|
1361
|
+
for (; d !== a; ) {
|
|
1362
|
+
const f = d.nextSibling;
|
|
1363
|
+
n.insertBefore(d, i), d = f;
|
|
1371
1364
|
}
|
|
1372
1365
|
}
|
|
1373
1366
|
}
|
|
1374
1367
|
return e;
|
|
1375
|
-
}, Pt = (s, t, e = s) => (s._$setValue(t, e), s),
|
|
1368
|
+
}, Pt = (s, t, e = s) => (s._$setValue(t, e), s), sh = {}, nh = (s, t = sh) => s._$committedValue = t, ih = (s) => s._$committedValue, Zs = (s) => {
|
|
1376
1369
|
var n;
|
|
1377
1370
|
(n = s._$notifyConnectionChanged) == null || n.call(s, !1, !0);
|
|
1378
1371
|
let t = s._$startNode;
|
|
@@ -1381,26 +1374,26 @@ const Zi = () => document.createComment(""), ye = (s, t, e) => {
|
|
|
1381
1374
|
const i = t.nextSibling;
|
|
1382
1375
|
t.remove(), t = i;
|
|
1383
1376
|
}
|
|
1384
|
-
},
|
|
1377
|
+
}, nr = (s, t, e) => {
|
|
1385
1378
|
const n = /* @__PURE__ */ new Map();
|
|
1386
1379
|
for (let i = t; i <= e; i++)
|
|
1387
1380
|
n.set(s[i], i);
|
|
1388
1381
|
return n;
|
|
1389
1382
|
};
|
|
1390
|
-
class
|
|
1383
|
+
class rh extends eh {
|
|
1391
1384
|
constructor(e) {
|
|
1392
1385
|
super();
|
|
1393
1386
|
v(this, "_itemKeys");
|
|
1394
|
-
if (e.type !==
|
|
1387
|
+
if (e.type !== Xc.CHILD)
|
|
1395
1388
|
throw new Error("repeat() can only be used in text expressions");
|
|
1396
1389
|
}
|
|
1397
1390
|
_getValuesAndKeys(e, n, i) {
|
|
1398
1391
|
let o;
|
|
1399
1392
|
i === void 0 ? i = n : n !== void 0 && (o = n);
|
|
1400
1393
|
const a = [], c = [];
|
|
1401
|
-
let
|
|
1402
|
-
for (const
|
|
1403
|
-
a[
|
|
1394
|
+
let l = 0;
|
|
1395
|
+
for (const d of e)
|
|
1396
|
+
a[l] = o ? o(d, l) : l, c[l] = i(d, l), l++;
|
|
1404
1397
|
return {
|
|
1405
1398
|
values: c,
|
|
1406
1399
|
keys: a
|
|
@@ -1410,115 +1403,115 @@ class Yc extends Kc {
|
|
|
1410
1403
|
return this._getValuesAndKeys(e, n, i).values;
|
|
1411
1404
|
}
|
|
1412
1405
|
update(e, [n, i, o]) {
|
|
1413
|
-
const a =
|
|
1406
|
+
const a = ih(e), { values: c, keys: l } = this._getValuesAndKeys(n, i, o);
|
|
1414
1407
|
if (!Array.isArray(a))
|
|
1415
|
-
return this._itemKeys =
|
|
1416
|
-
const
|
|
1408
|
+
return this._itemKeys = l, c;
|
|
1409
|
+
const d = this._itemKeys ?? (this._itemKeys = []), f = [];
|
|
1417
1410
|
let r, m, h = 0, g = a.length - 1, $ = 0, w = c.length - 1;
|
|
1418
1411
|
for (; h <= g && $ <= w; )
|
|
1419
1412
|
if (a[h] === null)
|
|
1420
1413
|
h++;
|
|
1421
1414
|
else if (a[g] === null)
|
|
1422
1415
|
g--;
|
|
1423
|
-
else if (
|
|
1416
|
+
else if (d[h] === l[$])
|
|
1424
1417
|
f[$] = Pt(a[h], c[$]), h++, $++;
|
|
1425
|
-
else if (
|
|
1418
|
+
else if (d[g] === l[w])
|
|
1426
1419
|
f[w] = Pt(a[g], c[w]), g--, w--;
|
|
1427
|
-
else if (
|
|
1428
|
-
f[w] = Pt(a[h], c[w]),
|
|
1429
|
-
else if (
|
|
1430
|
-
f[$] = Pt(a[g], c[$]),
|
|
1431
|
-
else if (r === void 0 && (r =
|
|
1432
|
-
|
|
1433
|
-
else if (!r.has(
|
|
1434
|
-
|
|
1420
|
+
else if (d[h] === l[w])
|
|
1421
|
+
f[w] = Pt(a[h], c[w]), we(e, f[w + 1], a[h]), h++, w--;
|
|
1422
|
+
else if (d[g] === l[$])
|
|
1423
|
+
f[$] = Pt(a[g], c[$]), we(e, a[h], a[g]), g--, $++;
|
|
1424
|
+
else if (r === void 0 && (r = nr(l, $, w), m = nr(d, h, g)), !r.has(d[h]))
|
|
1425
|
+
Zs(a[h]), h++;
|
|
1426
|
+
else if (!r.has(d[g]))
|
|
1427
|
+
Zs(a[g]), g--;
|
|
1435
1428
|
else {
|
|
1436
|
-
const
|
|
1429
|
+
const k = m.get(l[$]), p = k !== void 0 ? a[k] : null;
|
|
1437
1430
|
if (p === null) {
|
|
1438
|
-
const b =
|
|
1431
|
+
const b = we(e, a[h]);
|
|
1439
1432
|
Pt(b, c[$]), f[$] = b;
|
|
1440
1433
|
} else
|
|
1441
|
-
f[$] = Pt(p, c[$]),
|
|
1434
|
+
f[$] = Pt(p, c[$]), we(e, a[h], p), a[k] = null;
|
|
1442
1435
|
$++;
|
|
1443
1436
|
}
|
|
1444
1437
|
for (; $ <= w; ) {
|
|
1445
|
-
const
|
|
1446
|
-
Pt(
|
|
1438
|
+
const k = we(e, f[w + 1]);
|
|
1439
|
+
Pt(k, c[$]), f[$++] = k;
|
|
1447
1440
|
}
|
|
1448
1441
|
for (; h <= g; ) {
|
|
1449
|
-
const
|
|
1450
|
-
|
|
1442
|
+
const k = a[h++];
|
|
1443
|
+
k !== null && Zs(k);
|
|
1451
1444
|
}
|
|
1452
|
-
return this._itemKeys =
|
|
1445
|
+
return this._itemKeys = l, nh(e, f), Qn;
|
|
1453
1446
|
}
|
|
1454
1447
|
}
|
|
1455
|
-
const
|
|
1456
|
-
|
|
1448
|
+
const Il = th(rh);
|
|
1449
|
+
Ar(Gc, Jc);
|
|
1457
1450
|
globalThis.__GEM_DEVTOOLS__HOOK__ && !globalThis.__GEM_DEVTOOLS__HOOK__.GemElement && Object.assign(globalThis.__GEM_DEVTOOLS__HOOK__, {
|
|
1458
|
-
...
|
|
1459
|
-
|
|
1460
|
-
...
|
|
1461
|
-
...
|
|
1451
|
+
...pc,
|
|
1452
|
+
...kc,
|
|
1453
|
+
...cc,
|
|
1454
|
+
...Zc
|
|
1462
1455
|
});
|
|
1463
|
-
const
|
|
1464
|
-
let
|
|
1465
|
-
const
|
|
1456
|
+
const J = globalThis.history, Qr = J.pushState.bind(J), Jr = J.replaceState.bind(J);
|
|
1457
|
+
let oh = 0;
|
|
1458
|
+
const Yn = () => `${performance.now()}-${++oh}`, O = Wt({
|
|
1466
1459
|
$hasCloseHandle: !1,
|
|
1467
1460
|
$hasOpenHandle: !1,
|
|
1468
1461
|
$hasShouldCloseHandle: !1,
|
|
1469
1462
|
$key: ""
|
|
1470
1463
|
}), q = /* @__PURE__ */ new Map();
|
|
1471
|
-
function
|
|
1464
|
+
function Yr(s) {
|
|
1472
1465
|
const { $key: t, $hasCloseHandle: e, $hasOpenHandle: n, $hasShouldCloseHandle: i } = s || {};
|
|
1473
1466
|
if (O.$key !== t) {
|
|
1474
|
-
if (t) throw new
|
|
1475
|
-
if (e) throw new
|
|
1476
|
-
if (n) throw new
|
|
1477
|
-
if (i) throw new
|
|
1467
|
+
if (t) throw new wt("`$key` is not allowed");
|
|
1468
|
+
if (e) throw new wt("`$hasCloseHandle` is not allowed");
|
|
1469
|
+
if (n) throw new wt("`$hasOpenHandle` is not allowed");
|
|
1470
|
+
if (i) throw new wt("`$hasShouldCloseHandle` is not allowed");
|
|
1478
1471
|
}
|
|
1479
1472
|
}
|
|
1480
|
-
function
|
|
1473
|
+
function Zr(s) {
|
|
1481
1474
|
return Y.basePath ? Y.basePath + s : s;
|
|
1482
1475
|
}
|
|
1483
|
-
function
|
|
1476
|
+
function ws(s) {
|
|
1484
1477
|
return s === Y.basePath ? "/" : s.replace(new RegExp(`^${Y.basePath}/`), "/");
|
|
1485
1478
|
}
|
|
1486
|
-
function
|
|
1479
|
+
function Zn() {
|
|
1487
1480
|
Y.dispatchEvent(new CustomEvent("beforechange"));
|
|
1488
1481
|
}
|
|
1489
1482
|
function Es(s) {
|
|
1490
|
-
const t = q.get(O.$key) || { path:
|
|
1491
|
-
return { ...s, title: c, path: e, query: o, hash:
|
|
1483
|
+
const t = q.get(O.$key) || { path: ws(location.pathname), query: new qe() }, e = s.path ? xr(t.path, s.path) : ws(location.pathname), n = new qe(s.query ?? (s.path ? "" : location.search)), i = String(n) !== String(t.query), o = i ? n : t.query, a = e !== t.path || i, c = s.title || (a ? "" : document.title), l = s.close || s.data || s.open || s.shouldClose, d = decodeURIComponent(s.hash ?? (!a && l ? location.hash : ""));
|
|
1484
|
+
return { ...s, title: c, path: e, query: o, hash: d };
|
|
1492
1485
|
}
|
|
1493
|
-
function
|
|
1494
|
-
|
|
1495
|
-
const e = Es(s), { title: n, path: i, query: o, hash: a, close: c, open:
|
|
1486
|
+
function ir(s, t) {
|
|
1487
|
+
Yr(s.data);
|
|
1488
|
+
const e = Es(s), { title: n, path: i, query: o, hash: a, close: c, open: l, shouldClose: d, data: f } = e, r = {
|
|
1496
1489
|
$hasCloseHandle: !!c,
|
|
1497
|
-
$hasOpenHandle: !!
|
|
1498
|
-
$hasShouldCloseHandle: !!
|
|
1499
|
-
$key:
|
|
1490
|
+
$hasOpenHandle: !!l,
|
|
1491
|
+
$hasShouldCloseHandle: !!d,
|
|
1492
|
+
$key: Yn(),
|
|
1500
1493
|
$title: n,
|
|
1501
1494
|
...f
|
|
1502
1495
|
};
|
|
1503
|
-
q.set(r.$key, e),
|
|
1504
|
-
const m =
|
|
1496
|
+
q.set(r.$key, e), Zn(), In(O), O(r);
|
|
1497
|
+
const m = Zr(i) + new qe(o) + a, h = decodeURIComponent(location.hash);
|
|
1505
1498
|
t(r, n, m), h !== a && dispatchEvent(new CustomEvent("hashchange"));
|
|
1506
1499
|
}
|
|
1507
|
-
function
|
|
1508
|
-
|
|
1500
|
+
function rr(s, t, e, n) {
|
|
1501
|
+
Yr(s);
|
|
1509
1502
|
const i = {
|
|
1510
|
-
$key:
|
|
1503
|
+
$key: Yn(),
|
|
1511
1504
|
$title: t,
|
|
1512
1505
|
...s || {}
|
|
1513
|
-
}, { pathname: o, search: a, hash: c } = new URL(e, location.origin + location.pathname),
|
|
1514
|
-
q.set(i.$key,
|
|
1515
|
-
const
|
|
1516
|
-
n(i, t,
|
|
1506
|
+
}, { pathname: o, search: a, hash: c } = new URL(e, location.origin + location.pathname), l = Es({ path: o, query: new qe(a), hash: c, title: t, data: s });
|
|
1507
|
+
q.set(i.$key, l), Zn(), In(O), O(i);
|
|
1508
|
+
const d = Zr(o) + l.query + c, f = location.hash;
|
|
1509
|
+
n(i, t, d), f !== c && dispatchEvent(new CustomEvent("hashchange"));
|
|
1517
1510
|
}
|
|
1518
|
-
const
|
|
1511
|
+
const hn = Wt({
|
|
1519
1512
|
basePath: ""
|
|
1520
1513
|
});
|
|
1521
|
-
class
|
|
1514
|
+
class ah extends EventTarget {
|
|
1522
1515
|
get store() {
|
|
1523
1516
|
return O;
|
|
1524
1517
|
}
|
|
@@ -1526,10 +1519,10 @@ class Xc extends EventTarget {
|
|
|
1526
1519
|
return O.$key;
|
|
1527
1520
|
}
|
|
1528
1521
|
get basePath() {
|
|
1529
|
-
return
|
|
1522
|
+
return hn.basePath;
|
|
1530
1523
|
}
|
|
1531
1524
|
set basePath(t) {
|
|
1532
|
-
|
|
1525
|
+
hn({ basePath: t }), Object.assign(q.get(O.$key), { path: ws(location.pathname) });
|
|
1533
1526
|
}
|
|
1534
1527
|
getParams() {
|
|
1535
1528
|
return q.get(O.$key);
|
|
@@ -1538,52 +1531,52 @@ class Xc extends EventTarget {
|
|
|
1538
1531
|
Object.assign(q.get(O.$key), t), O();
|
|
1539
1532
|
}
|
|
1540
1533
|
push(t) {
|
|
1541
|
-
|
|
1534
|
+
ir(t, Qr);
|
|
1542
1535
|
}
|
|
1543
1536
|
replace(t) {
|
|
1544
|
-
|
|
1537
|
+
ir(t, Jr);
|
|
1545
1538
|
}
|
|
1546
1539
|
pushIgnoreCloseHandle(t) {
|
|
1547
1540
|
var e, n;
|
|
1548
1541
|
O.$hasCloseHandle ? ((n = (e = q.get(O.$key)) == null ? void 0 : e.close) == null || n.call(e), this.replace(t)) : this.push(t);
|
|
1549
1542
|
}
|
|
1550
1543
|
forward() {
|
|
1551
|
-
|
|
1544
|
+
J.forward();
|
|
1552
1545
|
}
|
|
1553
1546
|
back() {
|
|
1554
|
-
|
|
1547
|
+
J.back();
|
|
1555
1548
|
}
|
|
1556
1549
|
}
|
|
1557
|
-
const Y = new
|
|
1550
|
+
const Y = new ah(), Ft = Wt({ defaultTitle: document.title, url: "", title: "" }), ch = { history: Y, titleStore: Ft, basePathStore: hn };
|
|
1558
1551
|
if (!globalThis._GEMHISTORY) {
|
|
1559
|
-
if (globalThis._GEMHISTORY =
|
|
1560
|
-
|
|
1561
|
-
},
|
|
1562
|
-
|
|
1552
|
+
if (globalThis._GEMHISTORY = ch, J.pushState = (t, e, n) => {
|
|
1553
|
+
rr(t, e, n, Qr);
|
|
1554
|
+
}, J.replaceState = (t, e, n) => {
|
|
1555
|
+
rr(t, e, n, Jr);
|
|
1563
1556
|
}, addEventListener("hashchange", ({ isTrusted: t }) => {
|
|
1564
1557
|
t && Y.replace({ hash: location.hash });
|
|
1565
|
-
}),
|
|
1566
|
-
if (
|
|
1567
|
-
O(
|
|
1558
|
+
}), J.state)
|
|
1559
|
+
if (J.state.$hasCloseHandle) {
|
|
1560
|
+
O(J.state);
|
|
1568
1561
|
const t = Es({ title: document.title });
|
|
1569
1562
|
q.set(O.$key, t), Y.back();
|
|
1570
1563
|
} else {
|
|
1571
1564
|
const t = Es({ title: document.title, hash: location.hash });
|
|
1572
1565
|
O({
|
|
1573
|
-
$key:
|
|
1574
|
-
...
|
|
1566
|
+
$key: Yn(),
|
|
1567
|
+
...J.state || {}
|
|
1575
1568
|
}), q.set(O.$key, t);
|
|
1576
1569
|
}
|
|
1577
1570
|
else {
|
|
1578
1571
|
const { protocol: t, pathname: e, search: n, hash: i } = location;
|
|
1579
1572
|
t.startsWith("http") && Y.replace({ path: e, query: n, hash: i });
|
|
1580
1573
|
}
|
|
1581
|
-
|
|
1574
|
+
mt(Ft, () => {
|
|
1582
1575
|
const t = q.get(O.$key);
|
|
1583
|
-
t && (t.title =
|
|
1584
|
-
}),
|
|
1576
|
+
t && (t.title = Ft.title);
|
|
1577
|
+
}), mt(O, () => {
|
|
1585
1578
|
const { title: t } = Y.getParams();
|
|
1586
|
-
t !==
|
|
1579
|
+
t !== Ft.title && Ft({ title: t });
|
|
1587
1580
|
});
|
|
1588
1581
|
let s = !1;
|
|
1589
1582
|
addEventListener("popstate", (t) => {
|
|
@@ -1596,12 +1589,12 @@ if (!globalThis._GEMHISTORY) {
|
|
|
1596
1589
|
return;
|
|
1597
1590
|
}
|
|
1598
1591
|
if (!q.has(e.$key)) {
|
|
1599
|
-
const { pathname: c, search:
|
|
1592
|
+
const { pathname: c, search: l, hash: d } = location;
|
|
1600
1593
|
q.set(e.$key, {
|
|
1601
|
-
path: c,
|
|
1602
|
-
query: new
|
|
1603
|
-
hash: decodeURIComponent(
|
|
1604
|
-
title: e.$title,
|
|
1594
|
+
path: ws(c),
|
|
1595
|
+
query: new qe(l),
|
|
1596
|
+
hash: decodeURIComponent(d),
|
|
1597
|
+
title: Ft.title || e.$title,
|
|
1605
1598
|
// document.title 是导航前的
|
|
1606
1599
|
data: e
|
|
1607
1600
|
});
|
|
@@ -1610,96 +1603,96 @@ if (!globalThis._GEMHISTORY) {
|
|
|
1610
1603
|
if (parseFloat(e.$key) > parseFloat(n.$key) && e.$hasOpenHandle)
|
|
1611
1604
|
(a = (o = q.get(e.$key)) == null ? void 0 : o.open) == null || a.call(o);
|
|
1612
1605
|
else if (n.$hasCloseHandle) {
|
|
1613
|
-
const c = q.get(n.$key),
|
|
1614
|
-
if (
|
|
1606
|
+
const c = q.get(n.$key), l = c == null ? void 0 : c.close, d = c == null ? void 0 : c.shouldClose;
|
|
1607
|
+
if (d && !d()) {
|
|
1615
1608
|
s = !0, Y.forward();
|
|
1616
1609
|
return;
|
|
1617
1610
|
} else
|
|
1618
|
-
|
|
1611
|
+
l ? l() : e.$hasCloseHandle && (s = !0, Y.back());
|
|
1619
1612
|
}
|
|
1620
|
-
|
|
1613
|
+
Zn(), In(O), O(e);
|
|
1621
1614
|
});
|
|
1622
1615
|
}
|
|
1623
|
-
const { history: x, titleStore: It, basePathStore:
|
|
1624
|
-
var
|
|
1616
|
+
const { history: x, titleStore: It, basePathStore: hh } = globalThis._GEMHISTORY;
|
|
1617
|
+
var lh = Object.create, Xn = Object.defineProperty, dh = Object.getOwnPropertyDescriptor, Xr = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s), ue = (s) => {
|
|
1625
1618
|
throw TypeError(s);
|
|
1626
|
-
},
|
|
1619
|
+
}, to = (s, t, e) => t in s ? Xn(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, or = (s, t) => Xn(s, "name", { value: t, configurable: !0 }), uh = (s) => [, , , lh((s == null ? void 0 : s[Xr("metadata")]) ?? null)], eo = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], ke = (s) => s !== void 0 && typeof s != "function" ? ue("Function expected") : s, _h = (s, t, e, n, i) => ({ kind: eo[s], name: t, metadata: n, addInitializer: (o) => e._ ? ue("Already initialized") : i.push(ke(o || null)) }), ph = (s, t) => to(t, Xr("metadata"), s[3]), Mt = (s, t, e, n) => {
|
|
1627
1620
|
for (var i = 0, o = s[t >> 1], a = o && o.length; i < a; i++) t & 1 ? o[i].call(e) : n = o[i].call(e, n);
|
|
1628
1621
|
return n;
|
|
1629
|
-
},
|
|
1630
|
-
var a, c,
|
|
1631
|
-
return
|
|
1622
|
+
}, Us = (s, t, e, n, i, o) => {
|
|
1623
|
+
var a, c, l, d, f, r = t & 7, m = !!(t & 8), h = !!(t & 16), g = r > 3 ? s.length + 1 : r ? m ? 1 : 2 : 0, $ = eo[r + 5], w = r > 3 && (s[g - 1] = []), k = s[g] || (s[g] = []), p = r && (!h && !m && (i = i.prototype), r < 5 && (r > 3 || !h) && dh(r < 4 ? i : { get [e]() {
|
|
1624
|
+
return nt(this, o);
|
|
1632
1625
|
}, set [e](u) {
|
|
1633
|
-
return
|
|
1626
|
+
return Fe(this, o, u);
|
|
1634
1627
|
} }, e));
|
|
1635
|
-
r ? h && r < 4 &&
|
|
1628
|
+
r ? h && r < 4 && or(o, (r > 2 ? "set " : r > 1 ? "get " : "") + e) : or(i, e);
|
|
1636
1629
|
for (var b = n.length - 1; b >= 0; b--)
|
|
1637
|
-
|
|
1638
|
-
return r ||
|
|
1639
|
-
},
|
|
1640
|
-
const
|
|
1641
|
-
|
|
1642
|
-
class
|
|
1630
|
+
d = _h(r, e, l = {}, s[3], k), r && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => fh(i, u) : (u) => e in u }, r ^ 3 && (f.get = h ? (u) => (r ^ 1 ? nt : mh)(u, i, r ^ 4 ? o : p.get) : (u) => u[e]), r > 2 && (f.set = h ? (u, P) => Fe(u, i, P, r ^ 4 ? o : p.set) : (u, P) => u[e] = P)), c = (0, n[b])(r ? r < 4 ? h ? o : p[$] : r > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, r ^ 4 || c === void 0 ? ke(c) && (r > 4 ? w.unshift(c) : r ? h ? o = c : p[$] = c : i = c) : typeof c != "object" || c === null ? ue("Object expected") : (ke(a = c.get) && (p.get = a), ke(a = c.set) && (p.set = a), ke(a = c.init) && w.unshift(a));
|
|
1631
|
+
return r || ph(s, i), p && Xn(i, e, p), h ? r ^ 4 ? o : p : i;
|
|
1632
|
+
}, Ee = (s, t, e) => to(s, typeof t != "symbol" ? t + "" : t, e), ti = (s, t, e) => t.has(s) || ue("Cannot " + e), fh = (s, t) => Object(t) !== t ? ue('Cannot use the "in" operator on this value') : s.has(t), nt = (s, t, e) => (ti(s, t, "read from private field"), e ? e.call(s) : t.get(s)), Gt = (s, t, e) => t.has(s) ? ue("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), Fe = (s, t, e, n) => (ti(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), mh = (s, t, e) => (ti(s, t, "access private method"), e), so, no, io, ln, ro, Z, Pe, Me, Oe, dn, ds, ei;
|
|
1633
|
+
const Xs = Symbol();
|
|
1634
|
+
ro = [Vs(x.store), Gs({ role: "dialog", ariaModal: "true" })];
|
|
1635
|
+
class je extends (ln = tt, io = [B], no = [zs], so = [qn()], ln) {
|
|
1643
1636
|
constructor() {
|
|
1644
|
-
super(...arguments),
|
|
1637
|
+
super(...arguments), Ee(this, "label", Mt(Z, 8, this)), Mt(Z, 11, this), Ee(this, "opened", Mt(Z, 12, this)), Mt(Z, 15, this), Gt(this, Pe), Gt(this, Me), Gt(this, Oe, []), Gt(this, dn, () => {
|
|
1645
1638
|
var t;
|
|
1646
|
-
this.inert = !0,
|
|
1647
|
-
}),
|
|
1648
|
-
this.hidden = !1, this.inert = !1,
|
|
1649
|
-
}),
|
|
1639
|
+
this.inert = !0, nt(this, Oe).forEach((e) => e.inert = !1), nt(this, Pe) ? nt(this, Pe).before(this) : nt(this, Me) && ((t = nt(this, Me)) == null || t.appendChild(this)), this.dispatchEvent(new CustomEvent("close")), this.opened = !1;
|
|
1640
|
+
}), Gt(this, ds, () => {
|
|
1641
|
+
this.hidden = !1, this.inert = !1, Fe(this, Pe, this.nextSibling), Fe(this, Me, this.parentElement || this.getRootNode()), Fe(this, Oe, [...document.body.children].filter((t) => !t.inert)), nt(this, Oe).forEach((t) => t.inert = !0), document.body.append(this), this.dispatchEvent(new CustomEvent("open")), this.opened = !0;
|
|
1642
|
+
}), Gt(this, ei, Mt(Z, 16, this, () => this.inert = !0)), Mt(Z, 19, this), Ee(this, "open", () => {
|
|
1650
1643
|
if (!this.opened)
|
|
1651
|
-
return
|
|
1644
|
+
return nt(this, ds).call(this), x.push({
|
|
1652
1645
|
title: this.label,
|
|
1653
|
-
open:
|
|
1654
|
-
close:
|
|
1646
|
+
open: nt(this, ds),
|
|
1647
|
+
close: nt(this, dn),
|
|
1655
1648
|
shouldClose: this.shouldClose
|
|
1656
|
-
}),
|
|
1657
|
-
}),
|
|
1649
|
+
}), Xs;
|
|
1650
|
+
}), Ee(this, "close", () => (x.back(), Xs)), Ee(this, "forceClose", () => (this.opened = !1, setTimeout(this.close, 100), Xs));
|
|
1658
1651
|
}
|
|
1659
1652
|
shouldClose() {
|
|
1660
1653
|
return !0;
|
|
1661
1654
|
}
|
|
1662
1655
|
}
|
|
1663
|
-
Z =
|
|
1664
|
-
|
|
1656
|
+
Z = uh(ln);
|
|
1657
|
+
Pe = /* @__PURE__ */ new WeakMap();
|
|
1665
1658
|
Me = /* @__PURE__ */ new WeakMap();
|
|
1666
1659
|
Oe = /* @__PURE__ */ new WeakMap();
|
|
1667
|
-
|
|
1660
|
+
dn = /* @__PURE__ */ new WeakMap();
|
|
1668
1661
|
ds = /* @__PURE__ */ new WeakMap();
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
var
|
|
1662
|
+
ei = /* @__PURE__ */ new WeakMap();
|
|
1663
|
+
Us(Z, 5, "label", io, je);
|
|
1664
|
+
Us(Z, 5, "opened", no, je);
|
|
1665
|
+
Us(Z, 21, "#init", so, ei);
|
|
1666
|
+
je = Us(Z, 0, "GemDialogBaseElement", ro, je);
|
|
1667
|
+
Mt(Z, 1, je);
|
|
1668
|
+
var gh = Object.create, si = Object.defineProperty, vh = Object.getOwnPropertyDescriptor, oo = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s), _e = (s) => {
|
|
1676
1669
|
throw TypeError(s);
|
|
1677
|
-
},
|
|
1670
|
+
}, ao = (s, t, e) => t in s ? si(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, ar = (s, t) => si(s, "name", { value: t, configurable: !0 }), $h = (s) => [, , , gh((s == null ? void 0 : s[oo("metadata")]) ?? null)], co = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], xe = (s) => s !== void 0 && typeof s != "function" ? _e("Function expected") : s, Sh = (s, t, e, n, i) => ({ kind: co[s], name: t, metadata: n, addInitializer: (o) => e._ ? _e("Already initialized") : i.push(xe(o || null)) }), yh = (s, t) => ao(t, oo("metadata"), s[3]), Ce = (s, t, e, n) => {
|
|
1678
1671
|
for (var i = 0, o = s[t >> 1], a = o && o.length; i < a; i++) t & 1 ? o[i].call(e) : n = o[i].call(e, n);
|
|
1679
1672
|
return n;
|
|
1680
|
-
},
|
|
1681
|
-
var a, c,
|
|
1682
|
-
return
|
|
1673
|
+
}, tn = (s, t, e, n, i, o) => {
|
|
1674
|
+
var a, c, l, d, f, r = t & 7, m = !!(t & 8), h = !!(t & 16), g = r > 3 ? s.length + 1 : r ? m ? 1 : 2 : 0, $ = co[r + 5], w = r > 3 && (s[g - 1] = []), k = s[g] || (s[g] = []), p = r && (!h && !m && (i = i.prototype), r < 5 && (r > 3 || !h) && vh(r < 4 ? i : { get [e]() {
|
|
1675
|
+
return cr(this, o);
|
|
1683
1676
|
}, set [e](u) {
|
|
1684
|
-
return
|
|
1677
|
+
return lr(this, o, u);
|
|
1685
1678
|
} }, e));
|
|
1686
|
-
r ? h && r < 4 &&
|
|
1679
|
+
r ? h && r < 4 && ar(o, (r > 2 ? "set " : r > 1 ? "get " : "") + e) : ar(i, e);
|
|
1687
1680
|
for (var b = n.length - 1; b >= 0; b--)
|
|
1688
|
-
|
|
1689
|
-
return r ||
|
|
1690
|
-
}, as = (s, t, e) =>
|
|
1681
|
+
d = Sh(r, e, l = {}, s[3], k), r && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => wh(i, u) : (u) => e in u }, r ^ 3 && (f.get = h ? (u) => (r ^ 1 ? cr : Eh)(u, i, r ^ 4 ? o : p.get) : (u) => u[e]), r > 2 && (f.set = h ? (u, P) => lr(u, i, P, r ^ 4 ? o : p.set) : (u, P) => u[e] = P)), c = (0, n[b])(r ? r < 4 ? h ? o : p[$] : r > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, r ^ 4 || c === void 0 ? xe(c) && (r > 4 ? w.unshift(c) : r ? h ? o = c : p[$] = c : i = c) : typeof c != "object" || c === null ? _e("Object expected") : (xe(a = c.get) && (p.get = a), xe(a = c.set) && (p.set = a), xe(a = c.init) && w.unshift(a));
|
|
1682
|
+
return r || yh(s, i), p && si(i, e, p), h ? r ^ 4 ? o : p : i;
|
|
1683
|
+
}, as = (s, t, e) => ao(s, typeof t != "symbol" ? t + "" : t, e), ni = (s, t, e) => t.has(s) || _e("Cannot " + e), wh = (s, t) => Object(t) !== t ? _e('Cannot use the "in" operator on this value') : s.has(t), cr = (s, t, e) => (ni(s, t, "read from private field"), e ? e.call(s) : t.get(s)), hr = (s, t, e) => t.has(s) ? _e("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), lr = (s, t, e, n) => (ni(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), Eh = (s, t, e) => (ni(s, t, "access private method"), e);
|
|
1691
1684
|
const cs = Symbol("open mark");
|
|
1692
|
-
function
|
|
1685
|
+
function Hl(s) {
|
|
1693
1686
|
var t, e, n, i, o, a, c;
|
|
1694
|
-
const
|
|
1695
|
-
i = [
|
|
1696
|
-
let
|
|
1687
|
+
const l = Symbol();
|
|
1688
|
+
i = [zt(), Gs({ role: "alertdialog", ariaModal: "true" })];
|
|
1689
|
+
let d = class ho extends (n = tt, e = [Be()], t = [Be()], n) {
|
|
1697
1690
|
constructor() {
|
|
1698
|
-
super(...arguments), as(this, "label", ""),
|
|
1691
|
+
super(...arguments), as(this, "label", ""), hr(this, a, Ce(o, 8, this, () => mt(x.store, this.update))), Ce(o, 11, this), hr(this, c, Ce(o, 12, this, () => mt(ho.store, this.update))), Ce(o, 15, this);
|
|
1699
1692
|
}
|
|
1700
1693
|
/**@final */
|
|
1701
1694
|
static get isOpen() {
|
|
1702
|
-
return
|
|
1695
|
+
return this.store[cs];
|
|
1703
1696
|
}
|
|
1704
1697
|
/**
|
|
1705
1698
|
* @final
|
|
@@ -1707,24 +1700,24 @@ function Ml(s) {
|
|
|
1707
1700
|
* 浏览器 history 为异步 API,需要设置较长延迟;
|
|
1708
1701
|
*/
|
|
1709
1702
|
static open(m) {
|
|
1710
|
-
const h = new
|
|
1711
|
-
|
|
1712
|
-
const g = () =>
|
|
1703
|
+
const h = new this();
|
|
1704
|
+
this.instance = h, this.inertStore = [...document.body.children].filter(($) => !$.inert), this.inertStore.forEach(($) => $.inert = !0), document.body.append(h);
|
|
1705
|
+
const g = () => this.store({ [cs]: !0, ...m });
|
|
1713
1706
|
return setTimeout(() => {
|
|
1714
1707
|
g(), x.push({
|
|
1715
1708
|
title: h.label,
|
|
1716
1709
|
open: g,
|
|
1717
|
-
close:
|
|
1718
|
-
shouldClose:
|
|
1710
|
+
close: this.closeHandle.bind(this),
|
|
1711
|
+
shouldClose: this.shouldClose.bind(this)
|
|
1719
1712
|
});
|
|
1720
|
-
}, 100),
|
|
1713
|
+
}, 100), l;
|
|
1721
1714
|
}
|
|
1722
1715
|
/**
|
|
1723
1716
|
* @final
|
|
1724
1717
|
* UI 中执行关闭
|
|
1725
1718
|
*/
|
|
1726
1719
|
static close() {
|
|
1727
|
-
return x.back(),
|
|
1720
|
+
return x.back(), l;
|
|
1728
1721
|
}
|
|
1729
1722
|
/**
|
|
1730
1723
|
* @final
|
|
@@ -1732,7 +1725,7 @@ function Ml(s) {
|
|
|
1732
1725
|
*/
|
|
1733
1726
|
static closeHandle() {
|
|
1734
1727
|
var m;
|
|
1735
|
-
return
|
|
1728
|
+
return this.inertStore.forEach((h) => h.inert = !1), (m = this.instance) == null || m.remove(), this.store({ [cs]: !1, ...s }), l;
|
|
1736
1729
|
}
|
|
1737
1730
|
/**
|
|
1738
1731
|
* 由于要操作浏览器历史记录,所以没有设计为 Promise;
|
|
@@ -1741,69 +1734,69 @@ function Ml(s) {
|
|
|
1741
1734
|
return !0;
|
|
1742
1735
|
}
|
|
1743
1736
|
};
|
|
1744
|
-
return o =
|
|
1737
|
+
return o = $h(n), a = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), tn(o, 21, "#connectHistory", e, a), tn(o, 21, "#connectStore", t, c), d = tn(o, 0, "ModalElement", i, d), as(d, "inertStore", []), as(d, "instance", null), as(d, "store", Wt({
|
|
1745
1738
|
[cs]: !1,
|
|
1746
1739
|
...s
|
|
1747
|
-
})),
|
|
1740
|
+
})), Ce(o, 1, d), d;
|
|
1748
1741
|
}
|
|
1749
|
-
var
|
|
1742
|
+
var Ch = Object.create, ii = Object.defineProperty, bh = Object.getOwnPropertyDescriptor, lo = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s), pe = (s) => {
|
|
1750
1743
|
throw TypeError(s);
|
|
1751
|
-
},
|
|
1744
|
+
}, uo = (s, t, e) => t in s ? ii(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, dr = (s, t) => ii(s, "name", { value: t, configurable: !0 }), _o = (s) => [, , , Ch((s == null ? void 0 : s[lo("metadata")]) ?? null)], po = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Le = (s) => s !== void 0 && typeof s != "function" ? pe("Function expected") : s, Th = (s, t, e, n, i) => ({ kind: po[s], name: t, metadata: n, addInitializer: (o) => e._ ? pe("Already initialized") : i.push(Le(o || null)) }), kh = (s, t) => uo(t, lo("metadata"), s[3]), T = (s, t, e, n) => {
|
|
1752
1745
|
for (var i = 0, o = s[t >> 1], a = o && o.length; i < a; i++) t & 1 ? o[i].call(e) : n = o[i].call(e, n);
|
|
1753
1746
|
return n;
|
|
1754
|
-
},
|
|
1755
|
-
var a, c,
|
|
1756
|
-
return
|
|
1747
|
+
}, W = (s, t, e, n, i, o) => {
|
|
1748
|
+
var a, c, l, d, f, r = t & 7, m = !!(t & 8), h = !!(t & 16), g = r > 3 ? s.length + 1 : r ? m ? 1 : 2 : 0, $ = po[r + 5], w = r > 3 && (s[g - 1] = []), k = s[g] || (s[g] = []), p = r && (!h && !m && (i = i.prototype), r < 5 && (r > 3 || !h) && bh(r < 4 ? i : { get [e]() {
|
|
1749
|
+
return V(this, o);
|
|
1757
1750
|
}, set [e](u) {
|
|
1758
1751
|
return Cs(this, o, u);
|
|
1759
1752
|
} }, e));
|
|
1760
|
-
r ? h && r < 4 &&
|
|
1753
|
+
r ? h && r < 4 && dr(o, (r > 2 ? "set " : r > 1 ? "get " : "") + e) : dr(i, e);
|
|
1761
1754
|
for (var b = n.length - 1; b >= 0; b--)
|
|
1762
|
-
|
|
1763
|
-
return r ||
|
|
1764
|
-
},
|
|
1765
|
-
const
|
|
1766
|
-
class
|
|
1755
|
+
d = Th(r, e, l = {}, s[3], k), r && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => Ph(i, u) : (u) => e in u }, r ^ 3 && (f.get = h ? (u) => (r ^ 1 ? V : Mh)(u, i, r ^ 4 ? o : p.get) : (u) => u[e]), r > 2 && (f.set = h ? (u, P) => Cs(u, i, P, r ^ 4 ? o : p.set) : (u, P) => u[e] = P)), c = (0, n[b])(r ? r < 4 ? h ? o : p[$] : r > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, r ^ 4 || c === void 0 ? Le(c) && (r > 4 ? w.unshift(c) : r ? h ? o = c : p[$] = c : i = c) : typeof c != "object" || c === null ? pe("Object expected") : (Le(a = c.get) && (p.get = a), Le(a = c.set) && (p.set = a), Le(a = c.init) && w.unshift(a));
|
|
1756
|
+
return r || kh(s, i), p && ii(i, e, p), h ? r ^ 4 ? o : p : i;
|
|
1757
|
+
}, z = (s, t, e) => uo(s, typeof t != "symbol" ? t + "" : t, e), ri = (s, t, e) => t.has(s) || pe("Cannot " + e), Ph = (s, t) => Object(t) !== t ? pe('Cannot use the "in" operator on this value') : s.has(t), V = (s, t, e) => (ri(s, t, "read from private field"), e ? e.call(s) : t.get(s)), et = (s, t, e) => t.has(s) ? pe("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), Cs = (s, t, e, n) => (ri(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), Mh = (s, t, e) => (ri(s, t, "access private method"), e), fo, mo, go, vo, $o, So, yo, wo, Eo, Co, bo, To, ko, Po, Mo, un, Oo, S, Ot, qt, Ae, us, _n, Ne, pn, oi, ai, fn, ci, hi, xo, li, Lo;
|
|
1758
|
+
const Ao = "_";
|
|
1759
|
+
class Oh extends RegExp {
|
|
1767
1760
|
constructor(t) {
|
|
1768
1761
|
let e = 0;
|
|
1769
1762
|
super(
|
|
1770
|
-
`^${t.replace(/((:[^/$]+)|(\*))/g, (n, i) => i === "*" ? `(?<${
|
|
1763
|
+
`^${t.replace(/((:[^/$]+)|(\*))/g, (n, i) => i === "*" ? `(?<${Ao}${e++}>.*)` : `(?<${i.slice(1)}>[^/]+)`)}$`
|
|
1771
1764
|
);
|
|
1772
1765
|
}
|
|
1773
1766
|
}
|
|
1774
|
-
function
|
|
1767
|
+
function No(s, t) {
|
|
1775
1768
|
if (globalThis.URLPattern) {
|
|
1776
1769
|
const o = new URLPattern({ pathname: s }), a = o.exec({ pathname: t }) || o.exec({ pathname: `${t}/` });
|
|
1777
1770
|
return a ? a.pathname.groups : null;
|
|
1778
1771
|
}
|
|
1779
|
-
const e = new
|
|
1772
|
+
const e = new Oh(s), n = t.match(e) || `${t}/`.match(e);
|
|
1780
1773
|
if (!n) return null;
|
|
1781
1774
|
const i = {};
|
|
1782
1775
|
return n.groups && Object.entries(n.groups).forEach(([o, a]) => {
|
|
1783
|
-
i[o.startsWith(
|
|
1776
|
+
i[o.startsWith(Ao) ? o.slice(1) : o] = a;
|
|
1784
1777
|
}), i;
|
|
1785
1778
|
}
|
|
1786
|
-
function
|
|
1779
|
+
function di(s, t) {
|
|
1787
1780
|
let e = 0, n = s.pattern.replaceAll("*", () => `:${e++}`);
|
|
1788
1781
|
const i = t == null ? void 0 : t.params;
|
|
1789
1782
|
return i && Object.keys(i).forEach((o) => {
|
|
1790
1783
|
n = n.replace(new RegExp(`:${o}`, "g"), i[o]);
|
|
1791
1784
|
}), n;
|
|
1792
1785
|
}
|
|
1793
|
-
function
|
|
1786
|
+
function xh(s, t) {
|
|
1794
1787
|
return {
|
|
1795
|
-
path:
|
|
1788
|
+
path: di(s, t),
|
|
1796
1789
|
...t
|
|
1797
1790
|
};
|
|
1798
1791
|
}
|
|
1799
|
-
const
|
|
1800
|
-
|
|
1801
|
-
class
|
|
1792
|
+
const en = ot``, ur = /* @__PURE__ */ new Map();
|
|
1793
|
+
Oo = [Ur({ penetrable: !0 })];
|
|
1794
|
+
class H extends (un = tt, Mo = [Ws], Po = [D], ko = [D], To = [D], bo = [Te], Co = [Te], Eo = [Te], wo = [Te], yo = [D], So = [D], $o = [D], vo = [ft((t) => [t.scrollContainer])], go = [ft((t) => [t.scrollContainer])], mo = [ft((t) => {
|
|
1802
1795
|
var e;
|
|
1803
|
-
return
|
|
1804
|
-
})],
|
|
1796
|
+
return V(e = t, fn).call(e);
|
|
1797
|
+
})], fo = [de((t) => !t.inert)], un) {
|
|
1805
1798
|
constructor() {
|
|
1806
|
-
super(...arguments),
|
|
1799
|
+
super(...arguments), et(this, Ot), z(this, "transition", T(S, 8, this)), T(S, 11, this), z(this, "routes", T(S, 12, this)), T(S, 15, this), z(this, "locationStore", T(S, 16, this)), T(S, 19, this), z(this, "key", T(S, 20, this)), T(S, 23, this), z(this, "loading", T(S, 24, this)), T(S, 27, this), z(this, "beforeroutechange", T(S, 28, this)), T(S, 31, this), z(this, "routechange", T(S, 32, this)), T(S, 35, this), z(this, "error", T(S, 36, this)), T(S, 39, this), z(this, "scrollContainer", T(S, 40, this)), T(S, 43, this), z(this, "scrollIgnoreHash", T(S, 44, this)), T(S, 47, this), z(this, "trigger", T(S, 48, this, x)), T(S, 51, this), z(this, "currentRoute"), z(this, "currentParams", {}), et(this, Ae, zn({ content: en })), et(this, us, () => {
|
|
1807
1800
|
if (!this.locationStore) return;
|
|
1808
1801
|
const { path: t, query: e, hash: n, data: i } = x.getParams();
|
|
1809
1802
|
this.locationStore({
|
|
@@ -1813,143 +1806,140 @@ class I extends (_n = st, To = [Ws], bo = [B], Co = [B], Eo = [B], wo = [be], yo
|
|
|
1813
1806
|
hash: n,
|
|
1814
1807
|
data: i
|
|
1815
1808
|
});
|
|
1816
|
-
}),
|
|
1817
|
-
if (!
|
|
1818
|
-
const t =
|
|
1819
|
-
t ?
|
|
1820
|
-
}),
|
|
1809
|
+
}), et(this, _n, () => {
|
|
1810
|
+
if (!V(this, Ot, qt)) return;
|
|
1811
|
+
const t = ur.get(x.currentKey);
|
|
1812
|
+
t ? V(this, Ot, qt).scroll(0, t) : (this.scrollIgnoreHash || !x.getParams().hash) && V(this, Ot, qt).scroll(0, 0);
|
|
1813
|
+
}), et(this, Ne), et(this, pn, (t, e, n) => {
|
|
1821
1814
|
this.beforeroutechange(t), Cs(this, Ne, void 0), this.currentRoute = t, this.currentParams = e;
|
|
1822
1815
|
const i = async () => {
|
|
1823
|
-
|
|
1816
|
+
V(this, Ae).call(this, { content: n }), V(this, us).call(this), await Promise.resolve(), V(this, _n).call(this), this.routechange(this.currentRoute);
|
|
1824
1817
|
};
|
|
1825
1818
|
this.transition && "startViewTransition" in document ? document.startViewTransition(() => i()) : i();
|
|
1826
|
-
}),
|
|
1827
|
-
if (
|
|
1828
|
-
return
|
|
1819
|
+
}), et(this, oi, T(S, 52, this, () => {
|
|
1820
|
+
if (V(this, Ot, qt))
|
|
1821
|
+
return Lr(
|
|
1829
1822
|
x,
|
|
1830
1823
|
"beforechange",
|
|
1831
|
-
() =>
|
|
1824
|
+
() => ur.set(x.currentKey, V(this, Ot, qt).scrollTop)
|
|
1832
1825
|
);
|
|
1833
|
-
})), T(S, 55, this),
|
|
1826
|
+
})), T(S, 55, this), et(this, ai, T(S, 56, this, () => this.trigger.store && mt(this.trigger.store, () => V(this, Ae).call(this)))), T(S, 59, this), et(this, fn, () => {
|
|
1834
1827
|
const { path: t, query: e, hash: n } = this.trigger.getParams();
|
|
1835
1828
|
return [this.key, t, e, n];
|
|
1836
|
-
}),
|
|
1829
|
+
}), et(this, ci, T(S, 60, this, ([t, e], n) => {
|
|
1837
1830
|
if (n && t === n[0] && e === n[1]) {
|
|
1838
|
-
|
|
1831
|
+
V(this, us).call(this);
|
|
1839
1832
|
return;
|
|
1840
1833
|
}
|
|
1841
1834
|
this.update();
|
|
1842
|
-
})), T(S, 63, this),
|
|
1843
|
-
const { content: t } =
|
|
1835
|
+
})), T(S, 63, this), et(this, hi, T(S, 64, this, () => {
|
|
1836
|
+
const { content: t } = V(this, Ae);
|
|
1844
1837
|
if (t !== void 0)
|
|
1845
|
-
return this.shadowRoot ? t ===
|
|
1846
|
-
})), T(S, 67, this),
|
|
1847
|
-
const { path: t, hash: e, query: n } = this.trigger.getParams(), { route: i, params: o = {} } = Qe.findRoute(this.routes, t), { redirect: a, content: c, getContent:
|
|
1838
|
+
return this.shadowRoot ? t === en ? ot`<slot></slot>` : t : t === en ? void 0 : ot`${t}`;
|
|
1839
|
+
})), T(S, 67, this), z(this, "update", async () => {
|
|
1840
|
+
const { path: t, hash: e, query: n } = this.trigger.getParams(), { route: i, params: o = {} } = Qe.findRoute(this.routes, t), { redirect: a, content: c, getContent: l } = i || {};
|
|
1848
1841
|
if (a) {
|
|
1849
1842
|
this.trigger.replace({
|
|
1850
|
-
path:
|
|
1843
|
+
path: di({ pattern: a }, { params: o }),
|
|
1851
1844
|
query: n,
|
|
1852
1845
|
hash: e
|
|
1853
1846
|
});
|
|
1854
1847
|
return;
|
|
1855
1848
|
}
|
|
1856
1849
|
this.trigger === x && (location.href !== It.url || i != null && i.title) && It({ url: location.href, title: i == null ? void 0 : i.title });
|
|
1857
|
-
const
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
});
|
|
1866
|
-
return;
|
|
1850
|
+
const d = c || (l == null ? void 0 : l(o, this.shadowRoot || this));
|
|
1851
|
+
this.loading(i), Cs(this, Ne, d);
|
|
1852
|
+
const f = () => V(this, Ne) === d;
|
|
1853
|
+
try {
|
|
1854
|
+
const r = await d;
|
|
1855
|
+
f() && V(this, pn).call(this, i, o, r);
|
|
1856
|
+
} catch (r) {
|
|
1857
|
+
f() && this.error(r);
|
|
1867
1858
|
}
|
|
1868
|
-
H(this, _s).call(this, i, o, l);
|
|
1869
1859
|
});
|
|
1870
1860
|
}
|
|
1871
1861
|
}
|
|
1872
|
-
S =
|
|
1873
|
-
|
|
1862
|
+
S = _o(un);
|
|
1863
|
+
Ot = /* @__PURE__ */ new WeakSet();
|
|
1874
1864
|
qt = function() {
|
|
1875
1865
|
return typeof this.scrollContainer == "function" ? this.scrollContainer() : this.scrollContainer;
|
|
1876
1866
|
};
|
|
1877
|
-
|
|
1867
|
+
Ae = /* @__PURE__ */ new WeakMap();
|
|
1878
1868
|
us = /* @__PURE__ */ new WeakMap();
|
|
1879
|
-
|
|
1869
|
+
_n = /* @__PURE__ */ new WeakMap();
|
|
1880
1870
|
Ne = /* @__PURE__ */ new WeakMap();
|
|
1881
|
-
|
|
1882
|
-
ni = /* @__PURE__ */ new WeakMap();
|
|
1883
|
-
ii = /* @__PURE__ */ new WeakMap();
|
|
1884
|
-
fn = /* @__PURE__ */ new WeakMap();
|
|
1885
|
-
ri = /* @__PURE__ */ new WeakMap();
|
|
1871
|
+
pn = /* @__PURE__ */ new WeakMap();
|
|
1886
1872
|
oi = /* @__PURE__ */ new WeakMap();
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1873
|
+
ai = /* @__PURE__ */ new WeakMap();
|
|
1874
|
+
fn = /* @__PURE__ */ new WeakMap();
|
|
1875
|
+
ci = /* @__PURE__ */ new WeakMap();
|
|
1876
|
+
hi = /* @__PURE__ */ new WeakMap();
|
|
1877
|
+
W(S, 5, "transition", Mo, H);
|
|
1878
|
+
W(S, 5, "routes", Po, H);
|
|
1879
|
+
W(S, 5, "locationStore", ko, H);
|
|
1880
|
+
W(S, 5, "key", To, H);
|
|
1881
|
+
W(S, 5, "loading", bo, H);
|
|
1882
|
+
W(S, 5, "beforeroutechange", Co, H);
|
|
1883
|
+
W(S, 5, "routechange", Eo, H);
|
|
1884
|
+
W(S, 5, "error", wo, H);
|
|
1885
|
+
W(S, 5, "scrollContainer", yo, H);
|
|
1886
|
+
W(S, 5, "scrollIgnoreHash", So, H);
|
|
1887
|
+
W(S, 5, "trigger", $o, H);
|
|
1888
|
+
W(S, 21, "#rememberScrollPosition", vo, oi);
|
|
1889
|
+
W(S, 21, "#connectTriggerStore", go, ai);
|
|
1890
|
+
W(S, 21, "#updateContent", mo, ci);
|
|
1891
|
+
W(S, 21, "#content", fo, hi);
|
|
1892
|
+
H = W(S, 0, "GemLightRouteElement", Oo, H);
|
|
1893
|
+
z(H, "createLocationStore", () => {
|
|
1904
1894
|
const { path: s, query: t, hash: e, data: n } = x.getParams();
|
|
1905
|
-
return
|
|
1895
|
+
return Wt({ path: s, query: t, hash: e, data: n, params: {} });
|
|
1906
1896
|
});
|
|
1907
|
-
|
|
1897
|
+
z(H, "findRoute", (s = [], t) => {
|
|
1908
1898
|
let e = null, n;
|
|
1909
1899
|
Array.isArray(s) ? n = s : n = Object.values(s);
|
|
1910
1900
|
for (const i of n)
|
|
1911
1901
|
if (i.pattern === "*")
|
|
1912
1902
|
e = i;
|
|
1913
1903
|
else {
|
|
1914
|
-
const o =
|
|
1904
|
+
const o = No(i.pattern, t);
|
|
1915
1905
|
if (o)
|
|
1916
1906
|
return { route: i, params: o };
|
|
1917
1907
|
}
|
|
1918
1908
|
return { route: e };
|
|
1919
1909
|
});
|
|
1920
|
-
T(S, 1,
|
|
1921
|
-
const
|
|
1910
|
+
T(S, 1, H);
|
|
1911
|
+
const Lh = le`
|
|
1922
1912
|
:host(:where(:not([hidden]))),
|
|
1923
1913
|
:not(:defined) {
|
|
1924
1914
|
display: contents;
|
|
1925
1915
|
}
|
|
1926
1916
|
`;
|
|
1927
|
-
|
|
1928
|
-
class Qe extends (
|
|
1917
|
+
xo = [zt(), is(Lh)];
|
|
1918
|
+
class Qe extends (Lo = H) {
|
|
1929
1919
|
}
|
|
1930
|
-
|
|
1931
|
-
Qe =
|
|
1932
|
-
T(
|
|
1933
|
-
var
|
|
1920
|
+
li = _o(Lo);
|
|
1921
|
+
Qe = W(li, 0, "GemRouteElement", xo, Qe);
|
|
1922
|
+
T(li, 1, Qe);
|
|
1923
|
+
var Ah = Object.create, ui = Object.defineProperty, Nh = Object.getOwnPropertyDescriptor, Ro = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s), fe = (s) => {
|
|
1934
1924
|
throw TypeError(s);
|
|
1935
|
-
},
|
|
1925
|
+
}, Io = (s, t, e) => t in s ? ui(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, _r = (s, t) => ui(s, "name", { value: t, configurable: !0 }), Ho = (s) => [, , , Ah((s == null ? void 0 : s[Ro("metadata")]) ?? null)], Wo = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Re = (s) => s !== void 0 && typeof s != "function" ? fe("Function expected") : s, Rh = (s, t, e, n, i) => ({ kind: Wo[s], name: t, metadata: n, addInitializer: (o) => e._ ? fe("Already initialized") : i.push(Re(o || null)) }), Ih = (s, t) => Io(t, Ro("metadata"), s[3]), C = (s, t, e, n) => {
|
|
1936
1926
|
for (var i = 0, o = s[t >> 1], a = o && o.length; i < a; i++) t & 1 ? o[i].call(e) : n = o[i].call(e, n);
|
|
1937
1927
|
return n;
|
|
1938
|
-
},
|
|
1939
|
-
var a, c,
|
|
1928
|
+
}, R = (s, t, e, n, i, o) => {
|
|
1929
|
+
var a, c, l, d, f, r = t & 7, m = !!(t & 8), h = !!(t & 16), g = r > 3 ? s.length + 1 : r ? m ? 1 : 2 : 0, $ = Wo[r + 5], w = r > 3 && (s[g - 1] = []), k = s[g] || (s[g] = []), p = r && (!h && !m && (i = i.prototype), r < 5 && (r > 3 || !h) && Nh(r < 4 ? i : { get [e]() {
|
|
1940
1930
|
return ht(this, o);
|
|
1941
1931
|
}, set [e](u) {
|
|
1942
|
-
return
|
|
1932
|
+
return pr(this, o, u);
|
|
1943
1933
|
} }, e));
|
|
1944
|
-
r ? h && r < 4 &&
|
|
1934
|
+
r ? h && r < 4 && _r(o, (r > 2 ? "set " : r > 1 ? "get " : "") + e) : _r(i, e);
|
|
1945
1935
|
for (var b = n.length - 1; b >= 0; b--)
|
|
1946
|
-
|
|
1947
|
-
return r ||
|
|
1948
|
-
}, U = (s, t, e) =>
|
|
1949
|
-
function
|
|
1936
|
+
d = Rh(r, e, l = {}, s[3], k), r && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => Hh(i, u) : (u) => e in u }, r ^ 3 && (f.get = h ? (u) => (r ^ 1 ? ht : Wh)(u, i, r ^ 4 ? o : p.get) : (u) => u[e]), r > 2 && (f.set = h ? (u, P) => pr(u, i, P, r ^ 4 ? o : p.set) : (u, P) => u[e] = P)), c = (0, n[b])(r ? r < 4 ? h ? o : p[$] : r > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, r ^ 4 || c === void 0 ? Re(c) && (r > 4 ? w.unshift(c) : r ? h ? o = c : p[$] = c : i = c) : typeof c != "object" || c === null ? fe("Object expected") : (Re(a = c.get) && (p.get = a), Re(a = c.set) && (p.set = a), Re(a = c.init) && w.unshift(a));
|
|
1937
|
+
return r || Ih(s, i), p && ui(i, e, p), h ? r ^ 4 ? o : p : i;
|
|
1938
|
+
}, U = (s, t, e) => Io(s, typeof t != "symbol" ? t + "" : t, e), _i = (s, t, e) => t.has(s) || fe("Cannot " + e), Hh = (s, t) => Object(t) !== t ? fe('Cannot use the "in" operator on this value') : s.has(t), ht = (s, t, e) => (_i(s, t, "read from private field"), e ? e.call(s) : t.get(s)), Bt = (s, t, e) => t.has(s) ? fe("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), pr = (s, t, e, n) => (_i(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), Wh = (s, t, e) => (_i(s, t, "access private method"), e), zo, Vo, Go, Do, Uo, Fo, qo, Bo, Ko, jo, Qo, Jo, Yo, Zo, mn, Xo, y, vt, Ie, ta, pi, gn, fi, vn, mi, ea, sa, na, $n, ia, X, gi;
|
|
1939
|
+
function fr(s) {
|
|
1950
1940
|
return !s.startsWith("/");
|
|
1951
1941
|
}
|
|
1952
|
-
const
|
|
1942
|
+
const zh = le`
|
|
1953
1943
|
:host {
|
|
1954
1944
|
/* link default style */
|
|
1955
1945
|
cursor: pointer;
|
|
@@ -1964,15 +1954,15 @@ const xh = is`
|
|
|
1964
1954
|
color: unset;
|
|
1965
1955
|
}
|
|
1966
1956
|
`;
|
|
1967
|
-
|
|
1968
|
-
class
|
|
1957
|
+
Xo = [Vs(hh), is(zh), zt(), Gs({ focusable: !0 })];
|
|
1958
|
+
let N = class ra extends (mn = tt, Zo = [Gr], Yo = [B], Jo = [B], Qo = [B], jo = [B], Ko = [B], Bo = [B], qo = [Ws], Fo = [D], Uo = [D], Do = [D], Go = [D], Vo = [Be()], zo = [de()], mn) {
|
|
1969
1959
|
constructor() {
|
|
1970
|
-
super(...arguments), C(y, 5, this), Bt(this,
|
|
1960
|
+
super(...arguments), C(y, 5, this), Bt(this, vt), U(this, "href", C(y, 12, this)), C(y, 15, this), U(this, "target", C(y, 16, this)), C(y, 19, this), U(this, "path", C(y, 20, this)), C(y, 23, this), U(this, "query", C(y, 24, this)), C(y, 27, this), U(this, "hash", C(y, 28, this)), C(y, 31, this), U(this, "hint", C(y, 32, this)), C(y, 35, this), U(this, "preload", C(y, 36, this)), C(y, 39, this), U(this, "route", C(y, 40, this)), C(y, 43, this), U(this, "options", C(y, 44, this)), C(y, 47, this), U(this, "routeOptions", C(y, 48, this)), C(y, 51, this), U(this, "prepare", C(y, 52, this)), C(y, 55, this), Bt(this, pi, async (t) => {
|
|
1971
1961
|
var a;
|
|
1972
1962
|
t.preventDefault();
|
|
1973
1963
|
const e = this._getLocationString();
|
|
1974
1964
|
if (!e) return;
|
|
1975
|
-
if (
|
|
1965
|
+
if (fr(e))
|
|
1976
1966
|
switch (this.target) {
|
|
1977
1967
|
case "_self":
|
|
1978
1968
|
window.location.href = e;
|
|
@@ -1990,7 +1980,7 @@ class W extends (mn = st, Jo = [D], jo = [D], Ko = [D], Bo = [D], qo = [D], Fo =
|
|
|
1990
1980
|
const { path: n, query: i, hash: o } = x.getParams();
|
|
1991
1981
|
if (n + i + o !== e)
|
|
1992
1982
|
if (await ((a = this.prepare) == null ? void 0 : a.call(this)), this.route)
|
|
1993
|
-
x.pushIgnoreCloseHandle(
|
|
1983
|
+
x.pushIgnoreCloseHandle(xh(this.route, ht(this, vt, Ie)));
|
|
1994
1984
|
else if (this.href) {
|
|
1995
1985
|
const c = new URL(e, location.origin);
|
|
1996
1986
|
x.pushIgnoreCloseHandle({
|
|
@@ -2006,13 +1996,13 @@ class W extends (mn = st, Jo = [D], jo = [D], Ko = [D], Bo = [D], qo = [D], Fo =
|
|
|
2006
1996
|
});
|
|
2007
1997
|
}), Bt(this, gn, () => {
|
|
2008
1998
|
const t = this._getLocationString();
|
|
2009
|
-
return
|
|
2010
|
-
}), Bt(this,
|
|
1999
|
+
return fr(t) ? t : new URL(x.basePath + t, location.origin).toString();
|
|
2000
|
+
}), Bt(this, fi, () => {
|
|
2011
2001
|
var t, e, n;
|
|
2012
2002
|
(t = this.route) == null || t.content, (n = (e = this.route) == null ? void 0 : e.getContent) == null || n.call(e, {}, this.shadowRoot);
|
|
2013
|
-
}), Bt(this,
|
|
2014
|
-
const t = ht(this,
|
|
2015
|
-
return
|
|
2003
|
+
}), Bt(this, mi, C(y, 56, this, () => {
|
|
2004
|
+
const t = ht(this, vt, ta) === "off" ? null : ht(this, gn).call(this);
|
|
2005
|
+
return ot`<a part=${ra.link} href=${t} tabindex="-1"><slot></slot></a>`;
|
|
2016
2006
|
})), C(y, 59, this);
|
|
2017
2007
|
}
|
|
2018
2008
|
/**
|
|
@@ -2021,230 +2011,242 @@ class W extends (mn = st, Jo = [D], jo = [D], Ko = [D], Bo = [D], qo = [D], Fo =
|
|
|
2021
2011
|
_getLocationString() {
|
|
2022
2012
|
var t, e;
|
|
2023
2013
|
if (this.route) {
|
|
2024
|
-
const n = ((t = ht(this,
|
|
2025
|
-
return
|
|
2014
|
+
const n = ((t = ht(this, vt, Ie)) == null ? void 0 : t.query) || "", i = ((e = ht(this, vt, Ie)) == null ? void 0 : e.hash) || "";
|
|
2015
|
+
return di(this.route, ht(this, vt, Ie)) + n + i;
|
|
2026
2016
|
} else {
|
|
2027
2017
|
const n = this.href || this.path + this.query + this.hash, { path: i, query: o } = x.getParams();
|
|
2028
|
-
return n.startsWith("#") ? `${i}${o}${n}` : n.startsWith("?") ? `${i}${n}` : n.startsWith(".") ?
|
|
2018
|
+
return n.startsWith("#") ? `${i}${o}${n}` : n.startsWith("?") ? `${i}${n}` : n.startsWith(".") ? xr(i, n) : n;
|
|
2029
2019
|
}
|
|
2030
2020
|
}
|
|
2031
|
-
}
|
|
2032
|
-
y =
|
|
2033
|
-
|
|
2021
|
+
};
|
|
2022
|
+
y = Ho(mn);
|
|
2023
|
+
vt = /* @__PURE__ */ new WeakSet();
|
|
2034
2024
|
Ie = function() {
|
|
2035
2025
|
return this.routeOptions || this.options;
|
|
2036
2026
|
};
|
|
2037
|
-
|
|
2027
|
+
ta = function() {
|
|
2038
2028
|
return this.hint || "on";
|
|
2039
2029
|
};
|
|
2040
|
-
|
|
2030
|
+
pi = /* @__PURE__ */ new WeakMap();
|
|
2041
2031
|
gn = /* @__PURE__ */ new WeakMap();
|
|
2042
|
-
|
|
2032
|
+
fi = /* @__PURE__ */ new WeakMap();
|
|
2043
2033
|
vn = function() {
|
|
2044
|
-
this.addEventListener("click", ht(this,
|
|
2034
|
+
this.addEventListener("click", ht(this, pi)), this.addEventListener("pointerenter", ht(this, fi));
|
|
2045
2035
|
};
|
|
2046
|
-
|
|
2047
|
-
vn =
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
C(y,
|
|
2063
|
-
|
|
2064
|
-
|
|
2036
|
+
mi = /* @__PURE__ */ new WeakMap();
|
|
2037
|
+
vn = R(y, 17, "#init", Vo, vt, vn);
|
|
2038
|
+
R(y, 13, "link", Zo, N);
|
|
2039
|
+
R(y, 5, "href", Yo, N);
|
|
2040
|
+
R(y, 5, "target", Jo, N);
|
|
2041
|
+
R(y, 5, "path", Qo, N);
|
|
2042
|
+
R(y, 5, "query", jo, N);
|
|
2043
|
+
R(y, 5, "hash", Ko, N);
|
|
2044
|
+
R(y, 5, "hint", Bo, N);
|
|
2045
|
+
R(y, 5, "preload", qo, N);
|
|
2046
|
+
R(y, 5, "route", Fo, N);
|
|
2047
|
+
R(y, 5, "options", Uo, N);
|
|
2048
|
+
R(y, 5, "routeOptions", Do, N);
|
|
2049
|
+
R(y, 5, "prepare", Go, N);
|
|
2050
|
+
R(y, 21, "#content", zo, mi);
|
|
2051
|
+
N = R(y, 0, "GemLinkElement", Xo, N);
|
|
2052
|
+
U(N, "link", C(y, 8, N)), C(y, 11, N);
|
|
2053
|
+
C(y, 1, N);
|
|
2054
|
+
let oa = N;
|
|
2055
|
+
ia = [Vs(x.store)];
|
|
2056
|
+
class ae extends ($n = oa, na = [B], sa = [zs], ea = [ft()], $n) {
|
|
2065
2057
|
constructor() {
|
|
2066
|
-
super(...arguments), U(this, "pattern", C(X, 8, this)), C(X, 11, this), U(this, "active", C(X, 12, this)), C(X, 15, this), Bt(this,
|
|
2067
|
-
const { path: t, query: e, hash: n } = x.getParams(), i = this.pattern &&
|
|
2058
|
+
super(...arguments), U(this, "pattern", C(X, 8, this)), C(X, 11, this), U(this, "active", C(X, 12, this)), C(X, 15, this), Bt(this, gi, C(X, 16, this, () => {
|
|
2059
|
+
const { path: t, query: e, hash: n } = x.getParams(), i = this.pattern && No(this.pattern, t);
|
|
2068
2060
|
this.active = !!i || t + e + n === this._getLocationString();
|
|
2069
2061
|
})), C(X, 19, this);
|
|
2070
2062
|
}
|
|
2071
2063
|
}
|
|
2072
|
-
X =
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
ae =
|
|
2064
|
+
X = Ho($n);
|
|
2065
|
+
gi = /* @__PURE__ */ new WeakMap();
|
|
2066
|
+
R(X, 5, "pattern", na, ae);
|
|
2067
|
+
R(X, 5, "active", sa, ae);
|
|
2068
|
+
R(X, 21, "#updateState", ea, gi);
|
|
2069
|
+
ae = R(X, 0, "GemActiveLinkElement", ia, ae);
|
|
2078
2070
|
C(X, 1, ae);
|
|
2079
|
-
customElements.define("gem-link",
|
|
2071
|
+
customElements.define("gem-link", oa);
|
|
2080
2072
|
customElements.define("gem-active-link", ae);
|
|
2081
|
-
var
|
|
2073
|
+
var Vh = Object.create, vi = Object.defineProperty, Gh = Object.getOwnPropertyDescriptor, aa = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s), me = (s) => {
|
|
2082
2074
|
throw TypeError(s);
|
|
2083
|
-
},
|
|
2075
|
+
}, ca = (s, t, e) => t in s ? vi(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, mr = (s, t) => vi(s, "name", { value: t, configurable: !0 }), Dh = (s) => [, , , Vh((s == null ? void 0 : s[aa("metadata")]) ?? null)], ha = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], He = (s) => s !== void 0 && typeof s != "function" ? me("Function expected") : s, Uh = (s, t, e, n, i) => ({ kind: ha[s], name: t, metadata: n, addInitializer: (o) => e._ ? me("Already initialized") : i.push(He(o || null)) }), la = (s, t) => ca(t, aa("metadata"), s[3]), gt = (s, t, e, n) => {
|
|
2084
2076
|
for (var i = 0, o = s[t >> 1], a = o && o.length; i < a; i++) t & 1 ? o[i].call(e) : n = o[i].call(e, n);
|
|
2085
2077
|
return n;
|
|
2086
|
-
},
|
|
2087
|
-
var a, c,
|
|
2088
|
-
return
|
|
2078
|
+
}, Fs = (s, t, e, n, i, o) => {
|
|
2079
|
+
var a, c, l, d, f, r = t & 7, m = !!(t & 8), h = !!(t & 16), g = r > 3 ? s.length + 1 : r ? m ? 1 : 2 : 0, $ = ha[r + 5], w = r > 3 && (s[g - 1] = []), k = s[g] || (s[g] = []), p = r && (!h && !m && (i = i.prototype), r < 5 && (r > 3 || !h) && Gh(r < 4 ? i : { get [e]() {
|
|
2080
|
+
return $t(this, o);
|
|
2089
2081
|
}, set [e](u) {
|
|
2090
2082
|
return Sn(this, o, u);
|
|
2091
2083
|
} }, e));
|
|
2092
|
-
r ? h && r < 4 &&
|
|
2084
|
+
r ? h && r < 4 && mr(o, (r > 2 ? "set " : r > 1 ? "get " : "") + e) : mr(i, e);
|
|
2093
2085
|
for (var b = n.length - 1; b >= 0; b--)
|
|
2094
|
-
|
|
2095
|
-
return r ||
|
|
2096
|
-
},
|
|
2097
|
-
const
|
|
2086
|
+
d = Uh(r, e, l = {}, s[3], k), r && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => Fh(i, u) : (u) => e in u }, r ^ 3 && (f.get = h ? (u) => (r ^ 1 ? $t : qh)(u, i, r ^ 4 ? o : p.get) : (u) => u[e]), r > 2 && (f.set = h ? (u, P) => Sn(u, i, P, r ^ 4 ? o : p.set) : (u, P) => u[e] = P)), c = (0, n[b])(r ? r < 4 ? h ? o : p[$] : r > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, r ^ 4 || c === void 0 ? He(c) && (r > 4 ? w.unshift(c) : r ? h ? o = c : p[$] = c : i = c) : typeof c != "object" || c === null ? me("Object expected") : (He(a = c.get) && (p.get = a), He(a = c.set) && (p.set = a), He(a = c.init) && w.unshift(a));
|
|
2087
|
+
return r || la(s, i), p && vi(i, e, p), h ? r ^ 4 ? o : p : i;
|
|
2088
|
+
}, gr = (s, t, e) => ca(s, typeof t != "symbol" ? t + "" : t, e), $i = (s, t, e) => t.has(s) || me("Cannot " + e), Fh = (s, t) => Object(t) !== t ? me('Cannot use the "in" operator on this value') : s.has(t), $t = (s, t, e) => ($i(s, t, "read from private field"), e ? e.call(s) : t.get(s)), Dt = (s, t, e) => t.has(s) ? me("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), Sn = (s, t, e, n) => ($i(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), qh = (s, t, e) => ($i(s, t, "access private method"), e), da, ua, _a, pa, yn, F, wn, fa, Si, _s, En, We, yi;
|
|
2089
|
+
const Bh = "gem-reflect-start", ma = "gem-reflect-end", vr = (s) => new Comment(s), Kh = (s) => {
|
|
2098
2090
|
const t = [];
|
|
2099
2091
|
let e = s;
|
|
2100
|
-
for (; e && (t.push(e), e.nodeValue !==
|
|
2092
|
+
for (; e && (t.push(e), e.nodeValue !== ma); )
|
|
2101
2093
|
e = e.nextSibling;
|
|
2102
2094
|
return t;
|
|
2103
2095
|
};
|
|
2104
|
-
class
|
|
2096
|
+
class qs extends (yn = tt, pa = [B], _a = [D], ua = [qn()], da = [ft((t) => [t.target])], yn) {
|
|
2105
2097
|
constructor() {
|
|
2106
|
-
super(...arguments),
|
|
2098
|
+
super(...arguments), Dt(this, wn), gr(this, "method", gt(F, 8, this)), gt(F, 11, this), gr(this, "target", gt(F, 12, this, document.head)), gt(F, 15, this), Dt(this, Si, gt(F, 16, this, () => {
|
|
2107
2099
|
this.hidden = !0;
|
|
2108
|
-
})),
|
|
2100
|
+
})), gt(F, 19, this), Dt(this, _s, vr(Bh)), Dt(this, En, vr(ma)), Dt(this, We), Dt(this, yi, gt(F, 20, this, () => (($t(this, We) || [$t(this, _s), ...this.childNodes, $t(this, En)]).forEach((t, e, n) => {
|
|
2109
2101
|
const i = n[e - 1];
|
|
2110
|
-
i ? i.after(t) : this.target[
|
|
2102
|
+
i ? i.after(t) : this.target[$t(this, wn, fa)](t);
|
|
2111
2103
|
}), () => {
|
|
2112
|
-
Sn(this, We,
|
|
2113
|
-
}))),
|
|
2104
|
+
Sn(this, We, Kh($t(this, _s))), $t(this, We).forEach((t) => t.remove());
|
|
2105
|
+
}))), gt(F, 23, this);
|
|
2114
2106
|
}
|
|
2115
2107
|
}
|
|
2116
|
-
F =
|
|
2108
|
+
F = Dh(yn);
|
|
2117
2109
|
wn = /* @__PURE__ */ new WeakSet();
|
|
2118
|
-
|
|
2110
|
+
fa = function() {
|
|
2119
2111
|
return this.method || "append";
|
|
2120
2112
|
};
|
|
2121
|
-
|
|
2122
|
-
|
|
2113
|
+
Si = /* @__PURE__ */ new WeakMap();
|
|
2114
|
+
_s = /* @__PURE__ */ new WeakMap();
|
|
2123
2115
|
En = /* @__PURE__ */ new WeakMap();
|
|
2124
2116
|
We = /* @__PURE__ */ new WeakMap();
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
customElements.define("gem-reflect",
|
|
2117
|
+
yi = /* @__PURE__ */ new WeakMap();
|
|
2118
|
+
Fs(F, 5, "method", pa, qs);
|
|
2119
|
+
Fs(F, 5, "target", _a, qs);
|
|
2120
|
+
Fs(F, 21, "#init", ua, Si);
|
|
2121
|
+
Fs(F, 21, "#changeTarget", da, yi);
|
|
2122
|
+
la(F, qs);
|
|
2123
|
+
customElements.define("gem-reflect", qs);
|
|
2132
2124
|
customElements.define("gem-route", Qe);
|
|
2133
|
-
customElements.define("gem-light-route",
|
|
2134
|
-
var
|
|
2125
|
+
customElements.define("gem-light-route", H);
|
|
2126
|
+
var jh = Object.create, wi = Object.defineProperty, Qh = Object.getOwnPropertyDescriptor, ga = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s), ge = (s) => {
|
|
2135
2127
|
throw TypeError(s);
|
|
2136
|
-
},
|
|
2128
|
+
}, va = (s, t, e) => t in s ? wi(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, $r = (s, t) => wi(s, "name", { value: t, configurable: !0 }), Jh = (s) => [, , , jh((s == null ? void 0 : s[ga("metadata")]) ?? null)], $a = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], ze = (s) => s !== void 0 && typeof s != "function" ? ge("Function expected") : s, Yh = (s, t, e, n, i) => ({ kind: $a[s], name: t, metadata: n, addInitializer: (o) => e._ ? ge("Already initialized") : i.push(ze(o || null)) }), Zh = (s, t) => va(t, ga("metadata"), s[3]), j = (s, t, e, n) => {
|
|
2137
2129
|
for (var i = 0, o = s[t >> 1], a = o && o.length; i < a; i++) t & 1 ? o[i].call(e) : n = o[i].call(e, n);
|
|
2138
2130
|
return n;
|
|
2139
|
-
},
|
|
2140
|
-
var a, c,
|
|
2131
|
+
}, Vt = (s, t, e, n, i, o) => {
|
|
2132
|
+
var a, c, l, d, f, r = t & 7, m = !!(t & 8), h = !!(t & 16), g = r > 3 ? s.length + 1 : r ? m ? 1 : 2 : 0, $ = $a[r + 5], w = r > 3 && (s[g - 1] = []), k = s[g] || (s[g] = []), p = r && (!h && !m && (i = i.prototype), r < 5 && (r > 3 || !h) && Qh(r < 4 ? i : { get [e]() {
|
|
2141
2133
|
return Cn(this, o);
|
|
2142
2134
|
}, set [e](u) {
|
|
2143
|
-
return
|
|
2135
|
+
return Sr(this, o, u);
|
|
2144
2136
|
} }, e));
|
|
2145
|
-
r ? h && r < 4 &&
|
|
2137
|
+
r ? h && r < 4 && $r(o, (r > 2 ? "set " : r > 1 ? "get " : "") + e) : $r(i, e);
|
|
2146
2138
|
for (var b = n.length - 1; b >= 0; b--)
|
|
2147
|
-
|
|
2148
|
-
return r ||
|
|
2149
|
-
},
|
|
2150
|
-
let
|
|
2151
|
-
const
|
|
2152
|
-
clearTimeout(
|
|
2139
|
+
d = Yh(r, e, l = {}, s[3], k), r && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => Xh(i, u) : (u) => e in u }, r ^ 3 && (f.get = h ? (u) => (r ^ 1 ? Cn : tl)(u, i, r ^ 4 ? o : p.get) : (u) => u[e]), r > 2 && (f.set = h ? (u, P) => Sr(u, i, P, r ^ 4 ? o : p.set) : (u, P) => u[e] = P)), c = (0, n[b])(r ? r < 4 ? h ? o : p[$] : r > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, r ^ 4 || c === void 0 ? ze(c) && (r > 4 ? w.unshift(c) : r ? h ? o = c : p[$] = c : i = c) : typeof c != "object" || c === null ? ge("Object expected") : (ze(a = c.get) && (p.get = a), ze(a = c.set) && (p.set = a), ze(a = c.init) && w.unshift(a));
|
|
2140
|
+
return r || Zh(s, i), p && wi(i, e, p), h ? r ^ 4 ? o : p : i;
|
|
2141
|
+
}, ps = (s, t, e) => va(s, typeof t != "symbol" ? t + "" : t, e), Ei = (s, t, e) => t.has(s) || ge("Cannot " + e), Xh = (s, t) => Object(t) !== t ? ge('Cannot use the "in" operator on this value') : s.has(t), Cn = (s, t, e) => (Ei(s, t, "read from private field"), e ? e.call(s) : t.get(s)), hs = (s, t, e) => t.has(s) ? ge("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), Sr = (s, t, e, n) => (Ei(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), tl = (s, t, e) => (Ei(s, t, "access private method"), e), Sa, ya, wa, Ea, Ca, ba, bn, Ta, L, Ci, Tn, bi, Ti;
|
|
2142
|
+
let yr = 0;
|
|
2143
|
+
const wr = (s) => {
|
|
2144
|
+
clearTimeout(yr), yr = setTimeout(() => document.title = s);
|
|
2153
2145
|
};
|
|
2154
|
-
function
|
|
2146
|
+
function el(s, t = "", e = "") {
|
|
2155
2147
|
const n = It.title || s;
|
|
2156
|
-
n && n !== It.defaultTitle ? (
|
|
2148
|
+
n && n !== It.defaultTitle ? wr(t + (kn.title = n) + e) : wr(kn.title = It.defaultTitle);
|
|
2157
2149
|
}
|
|
2158
|
-
|
|
2159
|
-
let
|
|
2150
|
+
Ta = [zt()];
|
|
2151
|
+
let bt = class ka extends (bn = tt, ba = [B], Ca = [B], Ea = [Ws], wa = [ft((t) => [t.inert])], ya = [Be()], Sa = [de()], bn) {
|
|
2160
2152
|
constructor() {
|
|
2161
|
-
super(...arguments),
|
|
2153
|
+
super(...arguments), ps(this, "prefix", j(L, 8, this)), j(L, 11, this), ps(this, "suffix", j(L, 12, this)), j(L, 15, this), ps(this, "inert", j(L, 16, this)), j(L, 19, this), hs(this, Ci, j(L, 20, this, () => !this.inert && mt(It, this.update))), j(L, 23, this), hs(this, Tn, new MutationObserver(() => this.update())), hs(this, bi, j(L, 24, this, () => {
|
|
2162
2154
|
Cn(this, Tn).observe(this, { characterData: !0, childList: !0, subtree: !0 });
|
|
2163
|
-
})), j(
|
|
2155
|
+
})), j(L, 27, this), hs(this, Ti, j(L, 28, this, () => {
|
|
2164
2156
|
var t;
|
|
2165
|
-
return
|
|
2166
|
-
})), j(
|
|
2157
|
+
return el((t = this.textContent) == null ? void 0 : t.trim(), this.prefix, this.suffix), ot`${ka.title}`;
|
|
2158
|
+
})), j(L, 31, this);
|
|
2167
2159
|
}
|
|
2168
2160
|
static setTitle(t) {
|
|
2169
2161
|
It({ title: t });
|
|
2170
2162
|
}
|
|
2171
2163
|
};
|
|
2172
|
-
|
|
2173
|
-
|
|
2164
|
+
L = Jh(bn);
|
|
2165
|
+
Ci = /* @__PURE__ */ new WeakMap();
|
|
2174
2166
|
Tn = /* @__PURE__ */ new WeakMap();
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
j(
|
|
2186
|
-
let
|
|
2187
|
-
customElements.define("gem-title",
|
|
2188
|
-
var
|
|
2167
|
+
bi = /* @__PURE__ */ new WeakMap();
|
|
2168
|
+
Ti = /* @__PURE__ */ new WeakMap();
|
|
2169
|
+
Vt(L, 5, "prefix", ba, bt);
|
|
2170
|
+
Vt(L, 5, "suffix", Ca, bt);
|
|
2171
|
+
Vt(L, 5, "inert", Ea, bt);
|
|
2172
|
+
Vt(L, 21, "#connectStore", wa, Ci);
|
|
2173
|
+
Vt(L, 21, "#obTextContent", ya, bi);
|
|
2174
|
+
Vt(L, 21, "#content", Sa, Ti);
|
|
2175
|
+
bt = Vt(L, 0, "GemTitleElement", Ta, bt);
|
|
2176
|
+
ps(bt, "title", document.title);
|
|
2177
|
+
j(L, 1, bt);
|
|
2178
|
+
let kn = bt;
|
|
2179
|
+
customElements.define("gem-title", kn);
|
|
2180
|
+
var sl = Object.create, ki = Object.defineProperty, nl = Object.getOwnPropertyDescriptor, Pa = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s), ve = (s) => {
|
|
2189
2181
|
throw TypeError(s);
|
|
2190
|
-
},
|
|
2182
|
+
}, Ma = (s, t, e) => t in s ? ki(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, Er = (s, t) => ki(s, "name", { value: t, configurable: !0 }), il = (s) => [, , , sl((s == null ? void 0 : s[Pa("metadata")]) ?? null)], Oa = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Ve = (s) => s !== void 0 && typeof s != "function" ? ve("Function expected") : s, rl = (s, t, e, n, i) => ({ kind: Oa[s], name: t, metadata: n, addInitializer: (o) => e._ ? ve("Already initialized") : i.push(Ve(o || null)) }), ol = (s, t) => Ma(t, Pa("metadata"), s[3]), lt = (s, t, e, n) => {
|
|
2191
2183
|
for (var i = 0, o = s[t >> 1], a = o && o.length; i < a; i++) t & 1 ? o[i].call(e) : n = o[i].call(e, n);
|
|
2192
2184
|
return n;
|
|
2193
|
-
},
|
|
2194
|
-
var a, c,
|
|
2195
|
-
return
|
|
2185
|
+
}, os = (s, t, e, n, i, o) => {
|
|
2186
|
+
var a, c, l, d, f, r = t & 7, m = !!(t & 8), h = !!(t & 16), g = r > 3 ? s.length + 1 : r ? m ? 1 : 2 : 0, $ = Oa[r + 5], w = r > 3 && (s[g - 1] = []), k = s[g] || (s[g] = []), p = r && (!h && !m && (i = i.prototype), r < 5 && (r > 3 || !h) && nl(r < 4 ? i : { get [e]() {
|
|
2187
|
+
return Pn(this, o);
|
|
2196
2188
|
}, set [e](u) {
|
|
2197
|
-
return
|
|
2189
|
+
return br(this, o, u);
|
|
2198
2190
|
} }, e));
|
|
2199
|
-
r ? h && r < 4 &&
|
|
2191
|
+
r ? h && r < 4 && Er(o, (r > 2 ? "set " : r > 1 ? "get " : "") + e) : Er(i, e);
|
|
2200
2192
|
for (var b = n.length - 1; b >= 0; b--)
|
|
2201
|
-
|
|
2202
|
-
return r ||
|
|
2203
|
-
},
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
super(...arguments), Sr(this, "content", Ot(tt, 8, this)), Ot(tt, 11, this), Sr(this, "contentcss", Ot(tt, 12, this)), Ot(tt, 15, this), tl(this, Ti, Ot(tt, 16, this, () => {
|
|
2208
|
-
const t = (
|
|
2209
|
-
/*html*/
|
|
2210
|
-
`
|
|
2211
|
-
<style>
|
|
2212
|
-
:host(:where(:not([hidden]))) {
|
|
2213
|
-
display: contents;
|
|
2214
|
-
}
|
|
2215
|
-
${this.contentcss}
|
|
2216
|
-
</style>
|
|
2217
|
-
`
|
|
2218
|
-
);
|
|
2219
|
-
this.shadowRoot.innerHTML = this.content + t.trim();
|
|
2220
|
-
})), Ot(tt, 19, this);
|
|
2193
|
+
d = rl(r, e, l = {}, s[3], k), r && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => al(i, u) : (u) => e in u }, r ^ 3 && (f.get = h ? (u) => (r ^ 1 ? Pn : cl)(u, i, r ^ 4 ? o : p.get) : (u) => u[e]), r > 2 && (f.set = h ? (u, P) => br(u, i, P, r ^ 4 ? o : p.set) : (u, P) => u[e] = P)), c = (0, n[b])(r ? r < 4 ? h ? o : p[$] : r > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, r ^ 4 || c === void 0 ? Ve(c) && (r > 4 ? w.unshift(c) : r ? h ? o = c : p[$] = c : i = c) : typeof c != "object" || c === null ? ve("Object expected") : (Ve(a = c.get) && (p.get = a), Ve(a = c.set) && (p.set = a), Ve(a = c.init) && w.unshift(a));
|
|
2194
|
+
return r || ol(s, i), p && ki(i, e, p), h ? r ^ 4 ? o : p : i;
|
|
2195
|
+
}, Cr = (s, t, e) => Ma(s, typeof t != "symbol" ? t + "" : t, e), Pi = (s, t, e) => t.has(s) || ve("Cannot " + e), al = (s, t) => Object(t) !== t ? ve('Cannot use the "in" operator on this value') : s.has(t), Pn = (s, t, e) => (Pi(s, t, "read from private field"), e ? e.call(s) : t.get(s)), sn = (s, t, e) => t.has(s) ? ve("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), br = (s, t, e, n) => (Pi(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), cl = (s, t, e) => (Pi(s, t, "access private method"), e), xa, La, Aa, Na, Mn, Ra, G, On, Ia, Mi, Oi;
|
|
2196
|
+
const hl = le`
|
|
2197
|
+
:host(:where(:not([hidden]))) {
|
|
2198
|
+
display: contents;
|
|
2221
2199
|
}
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2200
|
+
`;
|
|
2201
|
+
Ra = [zt(), is(hl)];
|
|
2202
|
+
class ce extends (Mn = tt, Na = [B], Aa = [D], La = [ft()], xa = [de()], Mn) {
|
|
2203
|
+
constructor() {
|
|
2204
|
+
super(...arguments), sn(this, On), Cr(this, "html", lt(G, 8, this)), lt(G, 11, this), Cr(this, "styles", lt(G, 12, this)), lt(G, 15, this), sn(this, Mi, lt(G, 16, this, () => {
|
|
2205
|
+
const t = this.shadowRoot.adoptedStyleSheets;
|
|
2206
|
+
return this.shadowRoot.adoptedStyleSheets = t.concat(Pn(this, On, Ia)), () => {
|
|
2207
|
+
this.shadowRoot.adoptedStyleSheets = t;
|
|
2208
|
+
};
|
|
2209
|
+
})), lt(G, 19, this), sn(this, Oi, lt(G, 20, this, () => {
|
|
2210
|
+
this.shadowRoot.innerHTML = this.html;
|
|
2211
|
+
})), lt(G, 23, this);
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2214
|
+
G = il(Mn);
|
|
2215
|
+
On = /* @__PURE__ */ new WeakSet();
|
|
2216
|
+
Ia = function() {
|
|
2217
|
+
if (!this.styles) return [];
|
|
2218
|
+
if (typeof this.styles == "string") {
|
|
2219
|
+
const s = new CSSStyleSheet();
|
|
2220
|
+
return s.replaceSync(this.styles), [s];
|
|
2221
|
+
} else
|
|
2222
|
+
return [this.styles].flat().map((s) => s[Et].getStyle());
|
|
2223
|
+
};
|
|
2224
|
+
Mi = /* @__PURE__ */ new WeakMap();
|
|
2225
|
+
Oi = /* @__PURE__ */ new WeakMap();
|
|
2226
|
+
os(G, 5, "html", Na, ce);
|
|
2227
|
+
os(G, 5, "styles", Aa, ce);
|
|
2228
|
+
os(G, 21, "#adoptStyles", La, Mi);
|
|
2229
|
+
os(G, 21, "#content", xa, Oi);
|
|
2230
|
+
ce = os(G, 0, "GemUnsafeElement", Ra, ce);
|
|
2231
|
+
lt(G, 1, ce);
|
|
2230
2232
|
customElements.define("gem-unsafe", ce);
|
|
2231
|
-
var
|
|
2233
|
+
var ll = Object.create, xi = Object.defineProperty, dl = Object.getOwnPropertyDescriptor, Ha = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s), $e = (s) => {
|
|
2232
2234
|
throw TypeError(s);
|
|
2233
|
-
},
|
|
2235
|
+
}, Wa = (s, t, e) => t in s ? xi(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, Tr = (s, t) => xi(s, "name", { value: t, configurable: !0 }), ul = (s) => [, , , ll((s == null ? void 0 : s[Ha("metadata")]) ?? null)], za = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Ge = (s) => s !== void 0 && typeof s != "function" ? $e("Function expected") : s, _l = (s, t, e, n, i) => ({ kind: za[s], name: t, metadata: n, addInitializer: (o) => e._ ? $e("Already initialized") : i.push(Ge(o || null)) }), pl = (s, t) => Wa(t, Ha("metadata"), s[3]), st = (s, t, e, n) => {
|
|
2234
2236
|
for (var i = 0, o = s[t >> 1], a = o && o.length; i < a; i++) t & 1 ? o[i].call(e) : n = o[i].call(e, n);
|
|
2235
2237
|
return n;
|
|
2236
|
-
},
|
|
2237
|
-
var a, c,
|
|
2238
|
-
return
|
|
2238
|
+
}, Se = (s, t, e, n, i, o) => {
|
|
2239
|
+
var a, c, l, d, f, r = t & 7, m = !!(t & 8), h = !!(t & 16), g = r > 3 ? s.length + 1 : r ? m ? 1 : 2 : 0, $ = za[r + 5], w = r > 3 && (s[g - 1] = []), k = s[g] || (s[g] = []), p = r && (!h && !m && (i = i.prototype), r < 5 && (r > 3 || !h) && dl(r < 4 ? i : { get [e]() {
|
|
2240
|
+
return xn(this, o);
|
|
2239
2241
|
}, set [e](u) {
|
|
2240
|
-
return
|
|
2242
|
+
return Pr(this, o, u);
|
|
2241
2243
|
} }, e));
|
|
2242
|
-
r ? h && r < 4 &&
|
|
2244
|
+
r ? h && r < 4 && Tr(o, (r > 2 ? "set " : r > 1 ? "get " : "") + e) : Tr(i, e);
|
|
2243
2245
|
for (var b = n.length - 1; b >= 0; b--)
|
|
2244
|
-
|
|
2245
|
-
return r ||
|
|
2246
|
-
}, ls = (s, t, e) =>
|
|
2247
|
-
const
|
|
2246
|
+
d = _l(r, e, l = {}, s[3], k), r && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => fl(i, u) : (u) => e in u }, r ^ 3 && (f.get = h ? (u) => (r ^ 1 ? xn : ml)(u, i, r ^ 4 ? o : p.get) : (u) => u[e]), r > 2 && (f.set = h ? (u, P) => Pr(u, i, P, r ^ 4 ? o : p.set) : (u, P) => u[e] = P)), c = (0, n[b])(r ? r < 4 ? h ? o : p[$] : r > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, r ^ 4 || c === void 0 ? Ge(c) && (r > 4 ? w.unshift(c) : r ? h ? o = c : p[$] = c : i = c) : typeof c != "object" || c === null ? $e("Object expected") : (Ge(a = c.get) && (p.get = a), Ge(a = c.set) && (p.set = a), Ge(a = c.init) && w.unshift(a));
|
|
2247
|
+
return r || pl(s, i), p && xi(i, e, p), h ? r ^ 4 ? o : p : i;
|
|
2248
|
+
}, ls = (s, t, e) => Wa(s, typeof t != "symbol" ? t + "" : t, e), Li = (s, t, e) => t.has(s) || $e("Cannot " + e), fl = (s, t) => Object(t) !== t ? $e('Cannot use the "in" operator on this value') : s.has(t), xn = (s, t, e) => (Li(s, t, "read from private field"), e ? e.call(s) : t.get(s)), kr = (s, t, e) => t.has(s) ? $e("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), Pr = (s, t, e, n) => (Li(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), ml = (s, t, e) => (Li(s, t, "access private method"), e), Va, Ga, Da, Ua, Fa, Ln, qa, I, An, Ai;
|
|
2249
|
+
const gl = le`
|
|
2248
2250
|
:host(:where(:not([hidden]))) {
|
|
2249
2251
|
position: relative;
|
|
2250
2252
|
display: inline-flex;
|
|
@@ -2254,65 +2256,65 @@ const hl = is`
|
|
|
2254
2256
|
width: 100%;
|
|
2255
2257
|
height: 100%;
|
|
2256
2258
|
}
|
|
2257
|
-
`,
|
|
2258
|
-
|
|
2259
|
-
class
|
|
2259
|
+
`, Mr = /* @__PURE__ */ new Map();
|
|
2260
|
+
qa = [zt(), is(gl)];
|
|
2261
|
+
class Tt extends (Ln = tt, Fa = [B], Ua = [D], Da = [D], Ga = [zs], Va = [de()], Ln) {
|
|
2260
2262
|
constructor() {
|
|
2261
|
-
super(...arguments), ls(this, "selector",
|
|
2263
|
+
super(...arguments), ls(this, "selector", st(I, 8, this)), st(I, 11, this), ls(this, "root", st(I, 12, this)), st(I, 15, this), ls(this, "element", st(I, 16, this)), st(I, 19, this), ls(this, "active", st(I, 20, this)), st(I, 23, this), kr(this, An, () => {
|
|
2262
2264
|
const t = this.element || (this.selector ? (this.root || document).querySelector(this.selector) : null);
|
|
2263
2265
|
if (typeof t == "string") {
|
|
2264
|
-
let e =
|
|
2265
|
-
return e || (e = document.createElement("template"), e.innerHTML = t,
|
|
2266
|
+
let e = Mr.get(t);
|
|
2267
|
+
return e || (e = document.createElement("template"), e.innerHTML = t, Mr.set(t, e)), e.content.cloneNode(!0);
|
|
2266
2268
|
} else return t instanceof HTMLTemplateElement ? t.content.cloneNode(!0) : t == null ? void 0 : t.cloneNode(!0);
|
|
2267
|
-
}),
|
|
2268
|
-
}
|
|
2269
|
-
}
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
customElements.define("gem-use",
|
|
2281
|
-
var
|
|
2282
|
-
class
|
|
2269
|
+
}), kr(this, Ai, st(I, 24, this, () => ot`${xn(this, An).call(this)}<slot></slot>`)), st(I, 27, this);
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
I = ul(Ln);
|
|
2273
|
+
An = /* @__PURE__ */ new WeakMap();
|
|
2274
|
+
Ai = /* @__PURE__ */ new WeakMap();
|
|
2275
|
+
Se(I, 5, "selector", Fa, Tt);
|
|
2276
|
+
Se(I, 5, "root", Ua, Tt);
|
|
2277
|
+
Se(I, 5, "element", Da, Tt);
|
|
2278
|
+
Se(I, 5, "active", Ga, Tt);
|
|
2279
|
+
Se(I, 21, "#content", Va, Ai);
|
|
2280
|
+
Tt = Se(I, 0, "GemUseElement", qa, Tt);
|
|
2281
|
+
st(I, 1, Tt);
|
|
2282
|
+
customElements.define("gem-use", Tt);
|
|
2283
|
+
var es, ie, fs;
|
|
2284
|
+
class vl {
|
|
2283
2285
|
constructor(t) {
|
|
2284
2286
|
E(this, ie);
|
|
2285
|
-
E(this,
|
|
2287
|
+
E(this, es);
|
|
2286
2288
|
v(this, "info", (...t) => {
|
|
2287
|
-
console.log(_(this, ie,
|
|
2289
|
+
console.log(_(this, ie, fs), ...t);
|
|
2288
2290
|
});
|
|
2289
2291
|
v(this, "warn", (...t) => {
|
|
2290
|
-
console.warn(_(this, ie,
|
|
2292
|
+
console.warn(_(this, ie, fs), ...t);
|
|
2291
2293
|
});
|
|
2292
2294
|
v(this, "error", (...t) => {
|
|
2293
|
-
console.error(_(this, ie,
|
|
2295
|
+
console.error(_(this, ie, fs), ...t);
|
|
2294
2296
|
});
|
|
2295
|
-
M(this,
|
|
2297
|
+
M(this, es, t);
|
|
2296
2298
|
}
|
|
2297
2299
|
}
|
|
2298
|
-
|
|
2299
|
-
return `[${_(this,
|
|
2300
|
+
es = new WeakMap(), ie = new WeakSet(), fs = function() {
|
|
2301
|
+
return `[${_(this, es)}]`;
|
|
2300
2302
|
};
|
|
2301
|
-
const
|
|
2302
|
-
function
|
|
2303
|
-
const e = s.split(
|
|
2303
|
+
const $l = new vl("GEM"), Sl = /\$\d(?:<[^>]*>)?/, yl = /\$(\d)(<([^>]*)>)?/g, wl = 3;
|
|
2304
|
+
function El(s, ...t) {
|
|
2305
|
+
const e = s.split(Sl), n = [];
|
|
2304
2306
|
let i;
|
|
2305
|
-
for (; i =
|
|
2306
|
-
const o = i[
|
|
2307
|
+
for (; i = yl.exec(s); ) {
|
|
2308
|
+
const o = i[wl], a = Number(i[1]) - 1, c = t[a];
|
|
2307
2309
|
n.push(typeof c == "function" ? c(o) : c);
|
|
2308
2310
|
}
|
|
2309
|
-
return
|
|
2311
|
+
return ot(e, ...n);
|
|
2310
2312
|
}
|
|
2311
|
-
const
|
|
2312
|
-
var
|
|
2313
|
-
const
|
|
2313
|
+
const be = /* @__PURE__ */ new Set();
|
|
2314
|
+
var A, ms, Ba, Ka, De, gs, ss;
|
|
2315
|
+
const Ni = class Ni {
|
|
2314
2316
|
constructor(t) {
|
|
2315
|
-
E(this,
|
|
2317
|
+
E(this, A);
|
|
2316
2318
|
v(this, "resources");
|
|
2317
2319
|
v(this, "fallbackLanguage");
|
|
2318
2320
|
v(this, "currentLanguage");
|
|
@@ -2324,11 +2326,11 @@ const Oi = class Oi {
|
|
|
2324
2326
|
// 兼容 `<gem-route>`
|
|
2325
2327
|
v(this, "replace", ({ path: t }) => this.setLanguage(t));
|
|
2326
2328
|
v(this, "getParams", () => ({ path: this.currentLanguage }));
|
|
2327
|
-
E(this,
|
|
2329
|
+
E(this, ss, !0);
|
|
2328
2330
|
if (!t.resources[t.fallbackLanguage])
|
|
2329
|
-
throw new
|
|
2331
|
+
throw new wt("i18n: fallbackLanguage invalid");
|
|
2330
2332
|
Object.assign(this, t);
|
|
2331
|
-
let e = _(this,
|
|
2333
|
+
let e = _(this, A, Ba) || this.currentLanguage || _(this, A, Ka);
|
|
2332
2334
|
const n = document.querySelector(`[type*=${this.cachePrefix}]`);
|
|
2333
2335
|
if (n)
|
|
2334
2336
|
try {
|
|
@@ -2336,11 +2338,11 @@ const Oi = class Oi {
|
|
|
2336
2338
|
e = i.currentLanguage, this.resources[i.currentLanguage] = i.currentLanguagePack;
|
|
2337
2339
|
} catch {
|
|
2338
2340
|
}
|
|
2339
|
-
e ? (M(this,
|
|
2341
|
+
e ? (M(this, A, e, gs), this.setLanguage(e)) : this.resetLanguage(), M(this, ss, !1);
|
|
2340
2342
|
}
|
|
2341
2343
|
get(t, ...e) {
|
|
2342
2344
|
const n = this.resources[this.currentLanguage], i = this.resources[this.fallbackLanguage], o = n[t] || i[t], a = (o == null ? void 0 : o.message) || o || `[${t}]`;
|
|
2343
|
-
return e.length ?
|
|
2345
|
+
return e.length ? El(a, ...e) : a;
|
|
2344
2346
|
}
|
|
2345
2347
|
detectLanguage() {
|
|
2346
2348
|
const t = Object.keys(this.resources), e = navigator.languages.map((n) => n.replace(/-(.*)/, (i) => i.toUpperCase()));
|
|
@@ -2352,13 +2354,13 @@ const Oi = class Oi {
|
|
|
2352
2354
|
}
|
|
2353
2355
|
async setLanguage(t) {
|
|
2354
2356
|
var i, o;
|
|
2355
|
-
_(this,
|
|
2357
|
+
_(this, A, De) && be.forEach(async (a) => await a.setLanguage(t));
|
|
2356
2358
|
let e;
|
|
2357
2359
|
const n = this.resources[t];
|
|
2358
2360
|
if (!n)
|
|
2359
|
-
return
|
|
2361
|
+
return $l.warn(`${this.cachePrefix}: not found \`${t}\``), this.resetLanguage();
|
|
2360
2362
|
if (typeof n == "string") {
|
|
2361
|
-
const a = `${this.cachePrefix}:`, c = `${a}${n}`,
|
|
2363
|
+
const a = `${this.cachePrefix}:`, c = `${a}${n}`, l = localStorage.getItem(c), d = async () => {
|
|
2362
2364
|
const f = await (await fetch(n)).json();
|
|
2363
2365
|
if (this.cache) {
|
|
2364
2366
|
for (let r = 0; r < localStorage.length; r++) {
|
|
@@ -2369,41 +2371,41 @@ const Oi = class Oi {
|
|
|
2369
2371
|
}
|
|
2370
2372
|
return f;
|
|
2371
2373
|
};
|
|
2372
|
-
if (
|
|
2374
|
+
if (l)
|
|
2373
2375
|
try {
|
|
2374
|
-
e = JSON.parse(
|
|
2376
|
+
e = JSON.parse(l);
|
|
2375
2377
|
} catch {
|
|
2376
|
-
e = await
|
|
2378
|
+
e = await d();
|
|
2377
2379
|
}
|
|
2378
2380
|
else
|
|
2379
|
-
e = await
|
|
2381
|
+
e = await d();
|
|
2380
2382
|
} else
|
|
2381
2383
|
e = n;
|
|
2382
|
-
if (this.resources[t] = e, !_(this,
|
|
2384
|
+
if (this.resources[t] = e, !_(this, ss)) {
|
|
2383
2385
|
const a = [document.documentElement];
|
|
2384
2386
|
for (; a.length; ) {
|
|
2385
2387
|
const c = a.pop();
|
|
2386
|
-
(i = c[
|
|
2388
|
+
(i = c[As]) == null || i.call(c), a.push(...[...c.children, ...((o = c.shadowRoot) == null ? void 0 : o.children) || []].reverse());
|
|
2387
2389
|
}
|
|
2388
2390
|
}
|
|
2389
|
-
return t !== this.currentLanguage && M(this,
|
|
2391
|
+
return t !== this.currentLanguage && M(this, A, t, gs), this.cache === !0 && this.setCache(), t;
|
|
2390
2392
|
}
|
|
2391
2393
|
resetLanguage() {
|
|
2392
|
-
return _(this,
|
|
2394
|
+
return _(this, A, De) && be.forEach((t) => t.resetLanguage()), M(this, A, this.fallbackLanguage, gs), this.cache && localStorage.removeItem(_(this, A, ms)), this.setLanguage(this.detectLanguage());
|
|
2393
2395
|
}
|
|
2394
2396
|
// 一般用在 `onChange` 中
|
|
2395
2397
|
setCache() {
|
|
2396
|
-
_(this,
|
|
2398
|
+
_(this, A, De) && be.forEach((t) => t.setCache()), localStorage.setItem(_(this, A, ms), this.currentLanguage);
|
|
2397
2399
|
}
|
|
2398
2400
|
createSubModule(t, e) {
|
|
2399
|
-
const n = new
|
|
2401
|
+
const n = new Ni({
|
|
2400
2402
|
resources: e,
|
|
2401
2403
|
cachePrefix: `${this.cachePrefix}-${t}`,
|
|
2402
2404
|
currentLanguage: this.currentLanguage,
|
|
2403
2405
|
fallbackLanguage: this.fallbackLanguage,
|
|
2404
2406
|
cache: this.cache
|
|
2405
2407
|
});
|
|
2406
|
-
return
|
|
2408
|
+
return be.add(n), n;
|
|
2407
2409
|
}
|
|
2408
2410
|
/**
|
|
2409
2411
|
* @example
|
|
@@ -2421,9 +2423,9 @@ const Oi = class Oi {
|
|
|
2421
2423
|
};
|
|
2422
2424
|
}
|
|
2423
2425
|
};
|
|
2424
|
-
|
|
2426
|
+
A = new WeakSet(), ms = function() {
|
|
2425
2427
|
return `${this.cachePrefix}:current`;
|
|
2426
|
-
},
|
|
2428
|
+
}, Ba = function() {
|
|
2427
2429
|
const { hostname: t, pathname: e, search: n } = location, i = t.split(".");
|
|
2428
2430
|
switch (this.urlParamsType) {
|
|
2429
2431
|
case "ccTLD":
|
|
@@ -2437,16 +2439,16 @@ L = new WeakSet(), gs = function() {
|
|
|
2437
2439
|
return o in this.resources ? o : "";
|
|
2438
2440
|
}
|
|
2439
2441
|
}
|
|
2440
|
-
},
|
|
2441
|
-
return this.cache && localStorage.getItem(_(this,
|
|
2442
|
-
},
|
|
2443
|
-
return !
|
|
2444
|
-
},
|
|
2442
|
+
}, Ka = function() {
|
|
2443
|
+
return this.cache && localStorage.getItem(_(this, A, ms)) || "";
|
|
2444
|
+
}, De = function() {
|
|
2445
|
+
return !be.has(this);
|
|
2446
|
+
}, gs = function(t) {
|
|
2445
2447
|
var e;
|
|
2446
|
-
_(this,
|
|
2447
|
-
},
|
|
2448
|
-
let
|
|
2449
|
-
const K = (s) => matchMedia(s).matches,
|
|
2448
|
+
_(this, A, De) && (document.documentElement.lang = t), this.currentLanguage = t, (e = this.onChange) == null || e.call(this, t);
|
|
2449
|
+
}, ss = new WeakMap();
|
|
2450
|
+
let Or = Ni;
|
|
2451
|
+
const K = (s) => matchMedia(s).matches, Wl = {
|
|
2450
2452
|
PRINT: "print",
|
|
2451
2453
|
get isPrint() {
|
|
2452
2454
|
return K(this.PRINT);
|
|
@@ -2506,8 +2508,8 @@ const K = (s) => matchMedia(s).matches, Ol = {
|
|
|
2506
2508
|
get isWidthScreen() {
|
|
2507
2509
|
return K(this.WIDTHSCREEN);
|
|
2508
2510
|
}
|
|
2509
|
-
},
|
|
2510
|
-
function
|
|
2511
|
+
}, Cl = Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array())).constructor;
|
|
2512
|
+
function bl(s = {}) {
|
|
2511
2513
|
const {
|
|
2512
2514
|
origin: t = location.origin,
|
|
2513
2515
|
base: e = "",
|
|
@@ -2515,12 +2517,12 @@ function gl(s = {}) {
|
|
|
2515
2517
|
transformInput: i = (r) => r,
|
|
2516
2518
|
transformOutput: o = (r) => r,
|
|
2517
2519
|
...a
|
|
2518
|
-
} = s, c = (r) => r instanceof FormData || r instanceof Blob || r instanceof
|
|
2520
|
+
} = s, c = (r) => r instanceof FormData || r instanceof Blob || r instanceof Cl || r instanceof URLSearchParams || r instanceof ReadableStream || r instanceof ArrayBuffer ? r : typeof r == "object" ? JSON.stringify(r) : r, l = (r, m) => {
|
|
2519
2521
|
if (new URL(r, location.origin).pathname !== r)
|
|
2520
|
-
throw new
|
|
2522
|
+
throw new wt("`path` format is incorrect");
|
|
2521
2523
|
const h = new URLSearchParams(m).toString();
|
|
2522
2524
|
return `${t}${e}${r}${h ? "?" : ""}${h}`;
|
|
2523
|
-
},
|
|
2525
|
+
}, d = (r) => {
|
|
2524
2526
|
if (!r) return {};
|
|
2525
2527
|
if (r instanceof Headers) return Object.fromEntries(r);
|
|
2526
2528
|
const m = Array.isArray(r) ? r : Object.entries(r);
|
|
@@ -2531,17 +2533,17 @@ function gl(s = {}) {
|
|
|
2531
2533
|
...m,
|
|
2532
2534
|
headers: new Headers({
|
|
2533
2535
|
"content-type": "application/json",
|
|
2534
|
-
...
|
|
2535
|
-
...
|
|
2536
|
+
...d(a.headers),
|
|
2537
|
+
...d(m.headers)
|
|
2536
2538
|
})
|
|
2537
2539
|
}), g = await fetch(h);
|
|
2538
2540
|
if (g.status === 0) throw new Error("Request fail");
|
|
2539
2541
|
if (g.status >= 500) throw new Error(g.statusText);
|
|
2540
2542
|
const $ = h.headers.get("content-type"), w = g.status >= 400;
|
|
2541
2543
|
try {
|
|
2542
|
-
let
|
|
2543
|
-
if ($.includes("json") ?
|
|
2544
|
-
return o(
|
|
2544
|
+
let k;
|
|
2545
|
+
if ($.includes("json") ? k = await g.json() : $.includes("octet-stream") ? k = await g.arrayBuffer() : k = await g.text(), w) throw new Error(g.statusText, { cause: k });
|
|
2546
|
+
return o(k, h);
|
|
2545
2547
|
} catch {
|
|
2546
2548
|
throw new Error("Parse error");
|
|
2547
2549
|
}
|
|
@@ -2550,21 +2552,21 @@ function gl(s = {}) {
|
|
|
2550
2552
|
request: f,
|
|
2551
2553
|
get(r, m) {
|
|
2552
2554
|
const h = i(m);
|
|
2553
|
-
return f(
|
|
2555
|
+
return f(l(r, h), {
|
|
2554
2556
|
method: "GET",
|
|
2555
2557
|
headers: n(h)
|
|
2556
2558
|
});
|
|
2557
2559
|
},
|
|
2558
2560
|
del(r, m) {
|
|
2559
2561
|
const h = i(m);
|
|
2560
|
-
return f(
|
|
2562
|
+
return f(l(r, h), {
|
|
2561
2563
|
method: "DELETE",
|
|
2562
2564
|
headers: n(h)
|
|
2563
2565
|
});
|
|
2564
2566
|
},
|
|
2565
2567
|
put(r, m) {
|
|
2566
2568
|
const h = i(m);
|
|
2567
|
-
return f(
|
|
2569
|
+
return f(l(r), {
|
|
2568
2570
|
method: "PUT",
|
|
2569
2571
|
headers: n(h),
|
|
2570
2572
|
body: c(h)
|
|
@@ -2572,7 +2574,7 @@ function gl(s = {}) {
|
|
|
2572
2574
|
},
|
|
2573
2575
|
post(r, m) {
|
|
2574
2576
|
const h = i(m);
|
|
2575
|
-
return f(
|
|
2577
|
+
return f(l(r), {
|
|
2576
2578
|
method: "POST",
|
|
2577
2579
|
headers: n(h),
|
|
2578
2580
|
body: c(h)
|
|
@@ -2580,152 +2582,151 @@ function gl(s = {}) {
|
|
|
2580
2582
|
}
|
|
2581
2583
|
};
|
|
2582
2584
|
}
|
|
2583
|
-
const { request:
|
|
2584
|
-
function
|
|
2585
|
-
return
|
|
2585
|
+
const { request: zl, del: Vl, get: Gl, post: Dl, put: Ul } = bl(), ja = /* @__PURE__ */ new WeakMap(), Qa = /* @__PURE__ */ new WeakMap();
|
|
2586
|
+
function Fl(s) {
|
|
2587
|
+
return ja.get(s);
|
|
2586
2588
|
}
|
|
2587
|
-
function
|
|
2588
|
-
return
|
|
2589
|
+
function Ja(s) {
|
|
2590
|
+
return Qa.get(s);
|
|
2589
2591
|
}
|
|
2590
2592
|
function bs(s, t = {}) {
|
|
2591
|
-
const e =
|
|
2592
|
-
xs({ [
|
|
2593
|
+
const e = Rn(), n = le({})[Et], i = Wt(s), o = new Proxy(
|
|
2594
|
+
xs({ [Et]: n }, (c) => i(c)),
|
|
2593
2595
|
{
|
|
2594
|
-
get(c,
|
|
2595
|
-
if (!c[
|
|
2596
|
-
const [
|
|
2597
|
-
f && (c[
|
|
2596
|
+
get(c, l) {
|
|
2597
|
+
if (!c[l]) {
|
|
2598
|
+
const [d, f, r] = l.match(/^(\w*Color)(\d+)$/) || [];
|
|
2599
|
+
f && (c[l] = `oklch(from ${c[f]} calc(l - ${(Number(r) - 400) / 1e3}) c h)`);
|
|
2598
2600
|
}
|
|
2599
|
-
return c[
|
|
2601
|
+
return c[l];
|
|
2600
2602
|
}
|
|
2601
2603
|
}
|
|
2602
2604
|
);
|
|
2603
|
-
|
|
2605
|
+
Qa.set(o, t), ja.set(o, i);
|
|
2604
2606
|
const a = () => {
|
|
2605
2607
|
let c = "";
|
|
2606
|
-
Object.keys(i).forEach((
|
|
2607
|
-
t[
|
|
2608
|
-
}), n.setContent(
|
|
2608
|
+
Object.keys(i).forEach((l) => {
|
|
2609
|
+
t[l] || (t[l] = `--${he(l)}-${e}`, o[l] = `var(${t[l]})`), c += `${t[l]}:${i[l]};`;
|
|
2610
|
+
}), n.setContent(`&,:host{${c}}`);
|
|
2609
2611
|
};
|
|
2610
|
-
return a(),
|
|
2612
|
+
return a(), mt(i, () => {
|
|
2611
2613
|
a(), n.updateStyle();
|
|
2612
2614
|
}), o;
|
|
2613
2615
|
}
|
|
2614
|
-
function
|
|
2616
|
+
function Tl(s) {
|
|
2615
2617
|
return bs(s);
|
|
2616
2618
|
}
|
|
2617
|
-
function
|
|
2618
|
-
const t =
|
|
2619
|
-
return document.adoptedStyleSheets.push(t[
|
|
2619
|
+
function ql(s) {
|
|
2620
|
+
const t = Tl(s);
|
|
2621
|
+
return document.adoptedStyleSheets.push(t[Et].getStyle()), t;
|
|
2620
2622
|
}
|
|
2621
|
-
function
|
|
2622
|
-
return bs(t,
|
|
2623
|
+
function Bl(s, t) {
|
|
2624
|
+
return bs(t, Ja(s));
|
|
2623
2625
|
}
|
|
2624
|
-
function
|
|
2625
|
-
const t = bs(s), e =
|
|
2626
|
+
function Kl(s) {
|
|
2627
|
+
const t = bs(s), e = Ja(t);
|
|
2626
2628
|
return xs(t, (i) => (o, { addInitializer: a, access: c }) => {
|
|
2627
2629
|
a(function() {
|
|
2628
|
-
const
|
|
2629
|
-
this.internals.sheets.push(
|
|
2630
|
+
const l = bs({ ...s }, e);
|
|
2631
|
+
this.internals.sheets.push(l[Et].getStyle(this, !0)), this.memo(() => l(c.get(this).apply(this)), i && (() => i(this)));
|
|
2630
2632
|
});
|
|
2631
2633
|
});
|
|
2632
2634
|
}
|
|
2633
2635
|
export {
|
|
2634
2636
|
ae as GemActiveLinkElement,
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2637
|
+
je as GemDialogBaseElement,
|
|
2638
|
+
tt as GemElement,
|
|
2639
|
+
wt as GemError,
|
|
2640
|
+
H as GemLightRouteElement,
|
|
2641
|
+
oa as GemLinkElement,
|
|
2642
|
+
qs as GemReflectElement,
|
|
2641
2643
|
Qe as GemRouteElement,
|
|
2642
|
-
|
|
2644
|
+
kn as GemTitleElement,
|
|
2643
2645
|
ce as GemUnsafeElement,
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2646
|
+
Tt as GemUseElement,
|
|
2647
|
+
Or as I18n,
|
|
2648
|
+
ic as LinkedList,
|
|
2649
|
+
vl as Logger,
|
|
2650
|
+
rc as PropProxyMap,
|
|
2651
|
+
qe as QueryString,
|
|
2652
|
+
Et as SheetToken,
|
|
2653
|
+
Kr as TemplateResult,
|
|
2654
|
+
As as UpdateToken,
|
|
2655
|
+
Wn as _RenderErrorEvent,
|
|
2656
|
+
vs as _StoreListenerMap,
|
|
2657
|
+
Vn as _createTemplate,
|
|
2658
|
+
xr as absoluteLocation,
|
|
2659
|
+
Lr as addListener,
|
|
2660
|
+
St as addMicrotask,
|
|
2661
|
+
is as adoptedStyle,
|
|
2662
|
+
Gs as aria,
|
|
2663
|
+
bc as async,
|
|
2664
|
+
B as attribute,
|
|
2665
|
+
hh as basePathStore,
|
|
2664
2666
|
Ws as boolattribute,
|
|
2665
2667
|
he as camelToKebabCase,
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2668
|
+
ac as classMap,
|
|
2669
|
+
In as cleanObject,
|
|
2670
|
+
mt as connect,
|
|
2671
|
+
Vs as connectStore,
|
|
2672
|
+
Kl as createDecoratorTheme,
|
|
2673
|
+
xh as createHistoryParams,
|
|
2674
|
+
Hl as createModalClass,
|
|
2675
|
+
Bl as createOverrideTheme,
|
|
2676
|
+
di as createPath,
|
|
2677
|
+
Rl as createRef,
|
|
2678
|
+
Tl as createScopedTheme,
|
|
2679
|
+
zn as createState,
|
|
2680
|
+
Wt as createStore,
|
|
2681
|
+
ql as createTheme,
|
|
2680
2682
|
xs as createUpdater,
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2683
|
+
le as css,
|
|
2684
|
+
Tc as customElement,
|
|
2685
|
+
Vl as del,
|
|
2686
|
+
th as directive,
|
|
2687
|
+
ft as effect,
|
|
2688
|
+
Te as emitter,
|
|
2689
|
+
Ll as exportPartsMap,
|
|
2690
|
+
yc as fallback,
|
|
2691
|
+
Gl as get,
|
|
2692
|
+
Ja as getThemeProps,
|
|
2693
|
+
Fl as getThemeStore,
|
|
2694
|
+
Cc as globalemitter,
|
|
2693
2695
|
x as history,
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
fl as splice,
|
|
2696
|
+
ot as html,
|
|
2697
|
+
bl as initRequest,
|
|
2698
|
+
oc as isArrayChange,
|
|
2699
|
+
Ml as kebabToCamelCase,
|
|
2700
|
+
Ur as light,
|
|
2701
|
+
$l as logger,
|
|
2702
|
+
No as matchPath,
|
|
2703
|
+
Nl as mathml,
|
|
2704
|
+
Wl as mediaQuery,
|
|
2705
|
+
zr as memo,
|
|
2706
|
+
Be as mounted,
|
|
2707
|
+
$c as numattribute,
|
|
2708
|
+
Hn as objectMapToString,
|
|
2709
|
+
Gr as part,
|
|
2710
|
+
xl as partMap,
|
|
2711
|
+
Dl as post,
|
|
2712
|
+
D as property,
|
|
2713
|
+
Ul as put,
|
|
2714
|
+
Rn as randomStr,
|
|
2715
|
+
Nn as raw,
|
|
2716
|
+
Ls as render,
|
|
2717
|
+
Il as repeat,
|
|
2718
|
+
zl as request,
|
|
2719
|
+
Ar as setEngine,
|
|
2720
|
+
zt as shadow,
|
|
2721
|
+
Ec as slot,
|
|
2722
|
+
El as splice,
|
|
2722
2723
|
zs as state,
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2724
|
+
Ol as styleMap,
|
|
2725
|
+
Pl as styled,
|
|
2726
|
+
Al as svg,
|
|
2727
|
+
de as template,
|
|
2727
2728
|
It as titleStore,
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2729
|
+
Sc as unmounted,
|
|
2730
|
+
Yc as version,
|
|
2731
|
+
qn as willMount
|
|
2731
2732
|
};
|