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