@mantou/gem 1.7.10 → 1.7.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gem.es.js +1788 -2574
- package/dist/gem.umd.js +24 -24
- package/elements/base/gesture.d.ts +1 -3
- package/elements/base/gesture.d.ts.map +1 -1
- package/elements/base/gesture.js +2 -3
- package/elements/base/gesture.js.map +1 -1
- package/elements/base/link.d.ts +2 -0
- package/elements/base/link.d.ts.map +1 -1
- package/elements/base/link.js +2 -0
- package/elements/base/link.js.map +1 -1
- package/elements/base/modal-factory.d.ts +20 -20
- package/elements/base/reflect.d.ts +5 -0
- package/elements/base/reflect.d.ts.map +1 -1
- package/elements/base/reflect.js +26 -7
- package/elements/base/reflect.js.map +1 -1
- package/elements/base/route.d.ts +9 -7
- package/elements/base/route.d.ts.map +1 -1
- package/elements/base/route.js +23 -7
- package/elements/base/route.js.map +1 -1
- package/elements/base/title.d.ts +1 -1
- package/elements/base/title.js +1 -1
- package/elements/base/unsafe.d.ts +1 -2
- package/elements/base/unsafe.d.ts.map +1 -1
- package/elements/base/unsafe.js +1 -2
- package/elements/base/unsafe.js.map +1 -1
- package/elements/base/use.d.ts +1 -1
- package/elements/base/use.js +1 -1
- package/helper/i18n.d.ts +1 -1
- package/helper/i18n.d.ts.map +1 -1
- package/helper/i18n.js +2 -3
- package/helper/i18n.js.map +1 -1
- package/lib/store.d.ts +1 -1
- package/lib/store.d.ts.map +1 -1
- package/lib/store.js +3 -1
- package/lib/store.js.map +1 -1
- package/lib/utils.d.ts +2 -2
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +1 -1
- package/lib/utils.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +5 -4
- package/src/elements/base/gesture.ts +3 -3
- package/src/elements/base/link.ts +2 -0
- package/src/elements/base/reflect.ts +18 -6
- package/src/elements/base/route.ts +32 -11
- package/src/elements/base/title.ts +1 -1
- package/src/elements/base/unsafe.ts +1 -2
- package/src/elements/base/use.ts +1 -1
- package/src/helper/i18n.ts +2 -4
- package/src/lib/store.ts +3 -1
- package/src/lib/utils.ts +3 -3
- package/src/lib/version.ts +1 -1
package/dist/gem.es.js
CHANGED
|
@@ -1,72 +1,59 @@
|
|
|
1
|
-
var
|
|
2
|
-
if (!
|
|
3
|
-
throw TypeError("Cannot " +
|
|
1
|
+
var be = (n, t, e) => {
|
|
2
|
+
if (!t.has(n))
|
|
3
|
+
throw TypeError("Cannot " + e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
8
|
-
};
|
|
9
|
-
var __privateAdd = (obj, member, value) => {
|
|
10
|
-
if (member.has(obj))
|
|
5
|
+
var g = (n, t, e) => (be(n, t, "read from private field"), e ? e.call(n) : t.get(n)), P = (n, t, e) => {
|
|
6
|
+
if (t.has(n))
|
|
11
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
17
|
-
return value;
|
|
18
|
-
};
|
|
19
|
-
var __privateMethod = (obj, member, method) => {
|
|
20
|
-
__accessCheck(obj, member, "access private method");
|
|
21
|
-
return method;
|
|
22
|
-
};
|
|
23
|
-
var _map, _firstItem, _lastItem, _delete, delete_fn, _stringify, _parse, _routeOptions, routeOptions_get, _hint, hint_get, _onClick, _preventDefault, _getHint, _a, _getContent, _nextSibling, _parentElement, _inertStore, _b, _cacheCurrentKey, cacheCurrentKey_get, _urlParamsLang, urlParamsLang_get, _cacheLang, cacheLang_get, _isMain, isMain_get, _lang, lang_set;
|
|
24
|
-
var GemExports = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8
|
+
t instanceof WeakSet ? t.add(n) : t.set(n, e);
|
|
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({
|
|
25
12
|
__proto__: null,
|
|
26
13
|
get GemElement() {
|
|
27
|
-
return
|
|
14
|
+
return A;
|
|
15
|
+
},
|
|
16
|
+
get SVGTemplateResult() {
|
|
17
|
+
return Gn;
|
|
18
|
+
},
|
|
19
|
+
get TemplateResult() {
|
|
20
|
+
return _e;
|
|
28
21
|
},
|
|
29
22
|
get defineAttribute() {
|
|
30
|
-
return
|
|
23
|
+
return nn;
|
|
24
|
+
},
|
|
25
|
+
get defineCSSState() {
|
|
26
|
+
return rn;
|
|
31
27
|
},
|
|
32
28
|
get defineProperty() {
|
|
33
|
-
return
|
|
29
|
+
return Dt;
|
|
34
30
|
},
|
|
35
31
|
get defineRef() {
|
|
36
|
-
return
|
|
32
|
+
return sn;
|
|
37
33
|
},
|
|
38
|
-
get
|
|
39
|
-
return
|
|
34
|
+
get directive() {
|
|
35
|
+
return we;
|
|
40
36
|
},
|
|
41
|
-
get
|
|
42
|
-
return
|
|
37
|
+
get guard() {
|
|
38
|
+
return Ys;
|
|
43
39
|
},
|
|
44
40
|
get html() {
|
|
45
|
-
return
|
|
46
|
-
},
|
|
47
|
-
get svg() {
|
|
48
|
-
return svg;
|
|
49
|
-
},
|
|
50
|
-
get render() {
|
|
51
|
-
return render;
|
|
41
|
+
return G;
|
|
52
42
|
},
|
|
53
|
-
get
|
|
54
|
-
return
|
|
43
|
+
get ifDefined() {
|
|
44
|
+
return Qn;
|
|
55
45
|
},
|
|
56
|
-
get
|
|
57
|
-
return
|
|
46
|
+
get nativeDefineElement() {
|
|
47
|
+
return on;
|
|
58
48
|
},
|
|
59
|
-
get
|
|
60
|
-
return
|
|
49
|
+
get render() {
|
|
50
|
+
return Kn;
|
|
61
51
|
},
|
|
62
52
|
get repeat() {
|
|
63
|
-
return
|
|
64
|
-
},
|
|
65
|
-
get guard() {
|
|
66
|
-
return guard;
|
|
53
|
+
return Js;
|
|
67
54
|
},
|
|
68
|
-
get
|
|
69
|
-
return
|
|
55
|
+
get svg() {
|
|
56
|
+
return Vs;
|
|
70
57
|
}
|
|
71
58
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
72
59
|
/**
|
|
@@ -82,15 +69,10 @@ var GemExports = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
|
|
|
82
69
|
* subject to an additional IP rights grant found at
|
|
83
70
|
* http://polymer.github.io/PATENTS.txt
|
|
84
71
|
*/
|
|
85
|
-
const
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
return d;
|
|
90
|
-
};
|
|
91
|
-
const isDirective = (o) => {
|
|
92
|
-
return typeof o === "function" && directives.has(o);
|
|
93
|
-
};
|
|
72
|
+
const Dn = /* @__PURE__ */ new WeakMap(), we = (n) => (...t) => {
|
|
73
|
+
const e = n(...t);
|
|
74
|
+
return Dn.set(e, !0), e;
|
|
75
|
+
}, Wt = (n) => typeof n == "function" && Dn.has(n);
|
|
94
76
|
/**
|
|
95
77
|
* @license
|
|
96
78
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -104,19 +86,15 @@ const isDirective = (o) => {
|
|
|
104
86
|
* subject to an additional IP rights grant found at
|
|
105
87
|
* http://polymer.github.io/PATENTS.txt
|
|
106
88
|
*/
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
container.insertBefore(start, before);
|
|
112
|
-
start = n;
|
|
89
|
+
const wn = typeof window < "u" && window.customElements != null && window.customElements.polyfillWrapFlushCallback !== void 0, qn = (n, t, e = null, s = null) => {
|
|
90
|
+
for (; t !== e; ) {
|
|
91
|
+
const i = t.nextSibling;
|
|
92
|
+
n.insertBefore(t, s), t = i;
|
|
113
93
|
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
container.removeChild(start);
|
|
119
|
-
start = n;
|
|
94
|
+
}, Ye = (n, t, e = null) => {
|
|
95
|
+
for (; t !== e; ) {
|
|
96
|
+
const s = t.nextSibling;
|
|
97
|
+
n.removeChild(t), t = s;
|
|
120
98
|
}
|
|
121
99
|
};
|
|
122
100
|
/**
|
|
@@ -132,8 +110,7 @@ const removeNodes = (container, start, end = null) => {
|
|
|
132
110
|
* subject to an additional IP rights grant found at
|
|
133
111
|
* http://polymer.github.io/PATENTS.txt
|
|
134
112
|
*/
|
|
135
|
-
const
|
|
136
|
-
const nothing = {};
|
|
113
|
+
const V = {}, _n = {};
|
|
137
114
|
/**
|
|
138
115
|
* @license
|
|
139
116
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -147,119 +124,70 @@ const nothing = {};
|
|
|
147
124
|
* subject to an additional IP rights grant found at
|
|
148
125
|
* http://polymer.github.io/PATENTS.txt
|
|
149
126
|
*/
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
let lastPartIndex = 0;
|
|
162
|
-
let index = -1;
|
|
163
|
-
let partIndex = 0;
|
|
164
|
-
const { strings, values: { length } } = result;
|
|
165
|
-
while (partIndex < length) {
|
|
166
|
-
const node = walker.nextNode();
|
|
167
|
-
if (node === null) {
|
|
168
|
-
walker.currentNode = stack.pop();
|
|
127
|
+
const et = `{{lit-${String(Math.random()).slice(2)}}}`, Un = `<!--${et}-->`, vn = new RegExp(`${et}|${Un}`), bt = "$lit$";
|
|
128
|
+
class ks {
|
|
129
|
+
constructor(t, e) {
|
|
130
|
+
this.parts = [], this.element = e;
|
|
131
|
+
const s = [], i = [], r = document.createTreeWalker(e.content, 133, null, !1);
|
|
132
|
+
let o = 0, a = -1, c = 0;
|
|
133
|
+
const { strings: h, values: { length: p } } = t;
|
|
134
|
+
for (; c < p; ) {
|
|
135
|
+
const u = r.nextNode();
|
|
136
|
+
if (u === null) {
|
|
137
|
+
r.currentNode = i.pop();
|
|
169
138
|
continue;
|
|
170
139
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
for (
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
140
|
+
if (a++, u.nodeType === 1) {
|
|
141
|
+
if (u.hasAttributes()) {
|
|
142
|
+
const S = u.attributes, { length: d } = S;
|
|
143
|
+
let m = 0;
|
|
144
|
+
for (let f = 0; f < d; f++)
|
|
145
|
+
Sn(S[f].name, bt) && m++;
|
|
146
|
+
for (; m-- > 0; ) {
|
|
147
|
+
const f = h[c], _ = Re.exec(f)[2], v = _.toLowerCase() + bt, H = u.getAttribute(v);
|
|
148
|
+
u.removeAttribute(v);
|
|
149
|
+
const M = H.split(vn);
|
|
150
|
+
this.parts.push({ type: "attribute", index: a, name: _, strings: M }), c += M.length - 1;
|
|
181
151
|
}
|
|
182
|
-
while (count-- > 0) {
|
|
183
|
-
const stringForPart = strings[partIndex];
|
|
184
|
-
const name = lastAttributeNameRegex.exec(stringForPart)[2];
|
|
185
|
-
const attributeLookupName = name.toLowerCase() + boundAttributeSuffix;
|
|
186
|
-
const attributeValue = node.getAttribute(attributeLookupName);
|
|
187
|
-
node.removeAttribute(attributeLookupName);
|
|
188
|
-
const statics = attributeValue.split(markerRegex);
|
|
189
|
-
this.parts.push({ type: "attribute", index, name, strings: statics });
|
|
190
|
-
partIndex += statics.length - 1;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
if (node.tagName === "TEMPLATE") {
|
|
194
|
-
stack.push(node);
|
|
195
|
-
walker.currentNode = node.content;
|
|
196
152
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
const match2 = lastAttributeNameRegex.exec(s);
|
|
210
|
-
if (match2 !== null && endsWith(match2[2], boundAttributeSuffix)) {
|
|
211
|
-
s = s.slice(0, match2.index) + match2[1] + match2[2].slice(0, -boundAttributeSuffix.length) + match2[3];
|
|
212
|
-
}
|
|
213
|
-
insert = document.createTextNode(s);
|
|
153
|
+
u.tagName === "TEMPLATE" && (i.push(u), r.currentNode = u.content);
|
|
154
|
+
} else if (u.nodeType === 3) {
|
|
155
|
+
const S = u.data;
|
|
156
|
+
if (S.indexOf(et) >= 0) {
|
|
157
|
+
const d = u.parentNode, m = S.split(vn), f = m.length - 1;
|
|
158
|
+
for (let _ = 0; _ < f; _++) {
|
|
159
|
+
let v, H = m[_];
|
|
160
|
+
if (H === "")
|
|
161
|
+
v = U();
|
|
162
|
+
else {
|
|
163
|
+
const M = Re.exec(H);
|
|
164
|
+
M !== null && Sn(M[2], bt) && (H = H.slice(0, M.index) + M[1] + M[2].slice(0, -bt.length) + M[3]), v = document.createTextNode(H);
|
|
214
165
|
}
|
|
215
|
-
|
|
216
|
-
this.parts.push({ type: "node", index: ++index });
|
|
166
|
+
d.insertBefore(v, u), this.parts.push({ type: "node", index: ++a });
|
|
217
167
|
}
|
|
218
|
-
|
|
219
|
-
parent.insertBefore(createMarker(), node);
|
|
220
|
-
nodesToRemove.push(node);
|
|
221
|
-
} else {
|
|
222
|
-
node.data = strings2[lastIndex];
|
|
223
|
-
}
|
|
224
|
-
partIndex += lastIndex;
|
|
168
|
+
m[f] === "" ? (d.insertBefore(U(), u), s.push(u)) : u.data = m[f], c += f;
|
|
225
169
|
}
|
|
226
|
-
} else if (
|
|
227
|
-
if (
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
index++;
|
|
231
|
-
parent.insertBefore(createMarker(), node);
|
|
232
|
-
}
|
|
233
|
-
lastPartIndex = index;
|
|
234
|
-
this.parts.push({ type: "node", index });
|
|
235
|
-
if (node.nextSibling === null) {
|
|
236
|
-
node.data = "";
|
|
237
|
-
} else {
|
|
238
|
-
nodesToRemove.push(node);
|
|
239
|
-
index--;
|
|
240
|
-
}
|
|
241
|
-
partIndex++;
|
|
170
|
+
} else if (u.nodeType === 8)
|
|
171
|
+
if (u.data === et) {
|
|
172
|
+
const S = u.parentNode;
|
|
173
|
+
(u.previousSibling === null || a === o) && (a++, S.insertBefore(U(), u)), o = a, this.parts.push({ type: "node", index: a }), u.nextSibling === null ? u.data = "" : (s.push(u), a--), c++;
|
|
242
174
|
} else {
|
|
243
|
-
let
|
|
244
|
-
|
|
245
|
-
this.parts.push({ type: "node", index: -1 })
|
|
246
|
-
partIndex++;
|
|
247
|
-
}
|
|
175
|
+
let S = -1;
|
|
176
|
+
for (; (S = u.data.indexOf(et, S + 1)) !== -1; )
|
|
177
|
+
this.parts.push({ type: "node", index: -1 }), c++;
|
|
248
178
|
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
for (const n of nodesToRemove) {
|
|
252
|
-
n.parentNode.removeChild(n);
|
|
253
179
|
}
|
|
180
|
+
for (const u of s)
|
|
181
|
+
u.parentNode.removeChild(u);
|
|
254
182
|
}
|
|
255
183
|
}
|
|
256
|
-
const
|
|
257
|
-
const
|
|
258
|
-
return
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
184
|
+
const Sn = (n, t) => {
|
|
185
|
+
const e = n.length - t.length;
|
|
186
|
+
return e >= 0 && n.slice(e) === t;
|
|
187
|
+
}, Ls = (n) => n.index !== -1, U = () => document.createComment(""), Re = (
|
|
188
|
+
// eslint-disable-next-line no-control-regex
|
|
189
|
+
/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/
|
|
190
|
+
);
|
|
263
191
|
/**
|
|
264
192
|
* @license
|
|
265
193
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -273,68 +201,35 @@ const lastAttributeNameRegex = /([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+
|
|
|
273
201
|
* subject to an additional IP rights grant found at
|
|
274
202
|
* http://polymer.github.io/PATENTS.txt
|
|
275
203
|
*/
|
|
276
|
-
class
|
|
277
|
-
constructor(
|
|
278
|
-
this.__parts = [];
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
if (part2 !== void 0) {
|
|
287
|
-
part2.setValue(values[i]);
|
|
288
|
-
}
|
|
289
|
-
i++;
|
|
290
|
-
}
|
|
291
|
-
for (const part2 of this.__parts) {
|
|
292
|
-
if (part2 !== void 0) {
|
|
293
|
-
part2.commit();
|
|
294
|
-
}
|
|
295
|
-
}
|
|
204
|
+
class En {
|
|
205
|
+
constructor(t, e, s) {
|
|
206
|
+
this.__parts = [], this.template = t, this.processor = e, this.options = s;
|
|
207
|
+
}
|
|
208
|
+
update(t) {
|
|
209
|
+
let e = 0;
|
|
210
|
+
for (const s of this.__parts)
|
|
211
|
+
s !== void 0 && s.setValue(t[e]), e++;
|
|
212
|
+
for (const s of this.__parts)
|
|
213
|
+
s !== void 0 && s.commit();
|
|
296
214
|
}
|
|
297
215
|
_clone() {
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
let nodeIndex = 0;
|
|
304
|
-
let part2;
|
|
305
|
-
let node = walker.nextNode();
|
|
306
|
-
while (partIndex < parts2.length) {
|
|
307
|
-
part2 = parts2[partIndex];
|
|
308
|
-
if (!isTemplatePartActive(part2)) {
|
|
309
|
-
this.__parts.push(void 0);
|
|
310
|
-
partIndex++;
|
|
216
|
+
const t = wn ? this.template.element.content.cloneNode(!0) : document.importNode(this.template.element.content, !0), e = [], s = this.template.parts, i = document.createTreeWalker(t, 133, null, !1);
|
|
217
|
+
let r = 0, o = 0, a, c = i.nextNode();
|
|
218
|
+
for (; r < s.length; ) {
|
|
219
|
+
if (a = s[r], !Ls(a)) {
|
|
220
|
+
this.__parts.push(void 0), r++;
|
|
311
221
|
continue;
|
|
312
222
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
node = walker.nextNode();
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
if (part2.type === "node") {
|
|
325
|
-
const part3 = this.processor.handleTextExpression(this.options);
|
|
326
|
-
part3.insertAfterNode(node.previousSibling);
|
|
327
|
-
this.__parts.push(part3);
|
|
328
|
-
} else {
|
|
329
|
-
this.__parts.push(...this.processor.handleAttributeExpressions(node, part2.name, part2.strings, this.options));
|
|
330
|
-
}
|
|
331
|
-
partIndex++;
|
|
332
|
-
}
|
|
333
|
-
if (isCEPolyfill) {
|
|
334
|
-
document.adoptNode(fragment);
|
|
335
|
-
customElements.upgrade(fragment);
|
|
223
|
+
for (; o < a.index; )
|
|
224
|
+
o++, c.nodeName === "TEMPLATE" && (e.push(c), i.currentNode = c.content), (c = i.nextNode()) === null && (i.currentNode = e.pop(), c = i.nextNode());
|
|
225
|
+
if (a.type === "node") {
|
|
226
|
+
const h = this.processor.handleTextExpression(this.options);
|
|
227
|
+
h.insertAfterNode(c.previousSibling), this.__parts.push(h);
|
|
228
|
+
} else
|
|
229
|
+
this.__parts.push(...this.processor.handleAttributeExpressions(c, a.name, a.strings, this.options));
|
|
230
|
+
r++;
|
|
336
231
|
}
|
|
337
|
-
return
|
|
232
|
+
return wn && (document.adoptNode(t), customElements.upgrade(t)), t;
|
|
338
233
|
}
|
|
339
234
|
}
|
|
340
235
|
/**
|
|
@@ -350,54 +245,38 @@ class TemplateInstance {
|
|
|
350
245
|
* subject to an additional IP rights grant found at
|
|
351
246
|
* http://polymer.github.io/PATENTS.txt
|
|
352
247
|
*/
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
}
|
|
248
|
+
const xn = window.trustedTypes && trustedTypes.createPolicy("lit-html", { createHTML: (n) => n }), Ns = ` ${et} `;
|
|
249
|
+
class _e {
|
|
250
|
+
constructor(t, e, s, i) {
|
|
251
|
+
this.strings = t, this.values = e, this.type = s, this.processor = i;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Returns a string of HTML used to create a `<template>` element.
|
|
255
|
+
*/
|
|
362
256
|
getHTML() {
|
|
363
|
-
const
|
|
364
|
-
let
|
|
365
|
-
let
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
const
|
|
369
|
-
|
|
370
|
-
const attributeMatch = lastAttributeNameRegex.exec(s);
|
|
371
|
-
if (attributeMatch === null) {
|
|
372
|
-
html2 += s + (isCommentBinding ? commentMarker : nodeMarker);
|
|
373
|
-
} else {
|
|
374
|
-
html2 += s.substr(0, attributeMatch.index) + attributeMatch[1] + attributeMatch[2] + boundAttributeSuffix + attributeMatch[3] + marker;
|
|
375
|
-
}
|
|
257
|
+
const t = this.strings.length - 1;
|
|
258
|
+
let e = "", s = !1;
|
|
259
|
+
for (let i = 0; i < t; i++) {
|
|
260
|
+
const r = this.strings[i], o = r.lastIndexOf("<!--");
|
|
261
|
+
s = (o > -1 || s) && r.indexOf("-->", o + 1) === -1;
|
|
262
|
+
const a = Re.exec(r);
|
|
263
|
+
a === null ? e += r + (s ? Ns : Un) : e += r.substr(0, a.index) + a[1] + a[2] + bt + a[3] + et;
|
|
376
264
|
}
|
|
377
|
-
|
|
378
|
-
return html2;
|
|
265
|
+
return e += this.strings[t], e;
|
|
379
266
|
}
|
|
380
267
|
getTemplateElement() {
|
|
381
|
-
const
|
|
382
|
-
let
|
|
383
|
-
|
|
384
|
-
value = policy.createHTML(value);
|
|
385
|
-
}
|
|
386
|
-
template.innerHTML = value;
|
|
387
|
-
return template;
|
|
268
|
+
const t = document.createElement("template");
|
|
269
|
+
let e = this.getHTML();
|
|
270
|
+
return xn !== void 0 && (e = xn.createHTML(e)), t.innerHTML = e, t;
|
|
388
271
|
}
|
|
389
272
|
}
|
|
390
|
-
class
|
|
273
|
+
class Gn extends _e {
|
|
391
274
|
getHTML() {
|
|
392
275
|
return `<svg>${super.getHTML()}</svg>`;
|
|
393
276
|
}
|
|
394
277
|
getTemplateElement() {
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
const svgElement = content.firstChild;
|
|
398
|
-
content.removeChild(svgElement);
|
|
399
|
-
reparentNodes(content, svgElement.firstChild);
|
|
400
|
-
return template;
|
|
278
|
+
const t = super.getTemplateElement(), e = t.content, s = e.firstChild;
|
|
279
|
+
return e.removeChild(s), qn(e, s.firstChild), t;
|
|
401
280
|
}
|
|
402
281
|
}
|
|
403
282
|
/**
|
|
@@ -413,327 +292,217 @@ class SVGTemplateResult extends TemplateResult {
|
|
|
413
292
|
* subject to an additional IP rights grant found at
|
|
414
293
|
* http://polymer.github.io/PATENTS.txt
|
|
415
294
|
*/
|
|
416
|
-
const
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
class AttributeCommitter {
|
|
423
|
-
constructor(element, name, strings) {
|
|
424
|
-
this.dirty = true;
|
|
425
|
-
this.element = element;
|
|
426
|
-
this.name = name;
|
|
427
|
-
this.strings = strings;
|
|
428
|
-
this.parts = [];
|
|
429
|
-
for (let i = 0; i < strings.length - 1; i++) {
|
|
295
|
+
const Qe = (n) => n === null || !(typeof n == "object" || typeof n == "function"), Ae = (n) => Array.isArray(n) || // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
296
|
+
!!(n && n[Symbol.iterator]);
|
|
297
|
+
class jn {
|
|
298
|
+
constructor(t, e, s) {
|
|
299
|
+
this.dirty = !0, this.element = t, this.name = e, this.strings = s, this.parts = [];
|
|
300
|
+
for (let i = 0; i < s.length - 1; i++)
|
|
430
301
|
this.parts[i] = this._createPart();
|
|
431
|
-
}
|
|
432
302
|
}
|
|
303
|
+
/**
|
|
304
|
+
* Creates a single part. Override this to create a differnt type of part.
|
|
305
|
+
*/
|
|
433
306
|
_createPart() {
|
|
434
|
-
return new
|
|
307
|
+
return new Xe(this);
|
|
435
308
|
}
|
|
436
309
|
_getValue() {
|
|
437
|
-
const strings = this.
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
if (typeof
|
|
443
|
-
return
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
text += typeof v === "string" ? v : String(v);
|
|
457
|
-
} else {
|
|
458
|
-
for (const t of v) {
|
|
459
|
-
text += typeof t === "string" ? t : String(t);
|
|
460
|
-
}
|
|
461
|
-
}
|
|
310
|
+
const t = this.strings, e = t.length - 1, s = this.parts;
|
|
311
|
+
if (e === 1 && t[0] === "" && t[1] === "") {
|
|
312
|
+
const r = s[0].value;
|
|
313
|
+
if (typeof r == "symbol")
|
|
314
|
+
return String(r);
|
|
315
|
+
if (typeof r == "string" || !Ae(r))
|
|
316
|
+
return r;
|
|
317
|
+
}
|
|
318
|
+
let i = "";
|
|
319
|
+
for (let r = 0; r < e; r++) {
|
|
320
|
+
i += t[r];
|
|
321
|
+
const o = s[r];
|
|
322
|
+
if (o !== void 0) {
|
|
323
|
+
const a = o.value;
|
|
324
|
+
if (Qe(a) || !Ae(a))
|
|
325
|
+
i += typeof a == "string" ? a : String(a);
|
|
326
|
+
else
|
|
327
|
+
for (const c of a)
|
|
328
|
+
i += typeof c == "string" ? c : String(c);
|
|
462
329
|
}
|
|
463
330
|
}
|
|
464
|
-
|
|
465
|
-
return text;
|
|
331
|
+
return i += t[e], i;
|
|
466
332
|
}
|
|
467
333
|
commit() {
|
|
468
|
-
|
|
469
|
-
this.dirty = false;
|
|
470
|
-
this.element.setAttribute(this.name, this._getValue());
|
|
471
|
-
}
|
|
334
|
+
this.dirty && (this.dirty = !1, this.element.setAttribute(this.name, this._getValue()));
|
|
472
335
|
}
|
|
473
336
|
}
|
|
474
|
-
class
|
|
475
|
-
constructor(
|
|
476
|
-
this.value = void 0;
|
|
477
|
-
this.committer = committer;
|
|
337
|
+
class Xe {
|
|
338
|
+
constructor(t) {
|
|
339
|
+
this.value = void 0, this.committer = t;
|
|
478
340
|
}
|
|
479
|
-
setValue(
|
|
480
|
-
|
|
481
|
-
this.value = value;
|
|
482
|
-
if (!isDirective(value)) {
|
|
483
|
-
this.committer.dirty = true;
|
|
484
|
-
}
|
|
485
|
-
}
|
|
341
|
+
setValue(t) {
|
|
342
|
+
t !== V && (!Qe(t) || t !== this.value) && (this.value = t, Wt(t) || (this.committer.dirty = !0));
|
|
486
343
|
}
|
|
487
344
|
commit() {
|
|
488
|
-
|
|
489
|
-
const
|
|
490
|
-
this.value =
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
this.
|
|
345
|
+
for (; Wt(this.value); ) {
|
|
346
|
+
const t = this.value;
|
|
347
|
+
this.value = V, t(this);
|
|
348
|
+
}
|
|
349
|
+
this.value !== V && this.committer.commit();
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
class wt {
|
|
353
|
+
constructor(t) {
|
|
354
|
+
this.value = void 0, this.__pendingValue = void 0, this.options = t;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Appends this part into a container.
|
|
358
|
+
*
|
|
359
|
+
* This part must be empty, as its contents are not automatically moved.
|
|
360
|
+
*/
|
|
361
|
+
appendInto(t) {
|
|
362
|
+
this.startNode = t.appendChild(U()), this.endNode = t.appendChild(U());
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Inserts this part after the `ref` node (between `ref` and `ref`'s next
|
|
366
|
+
* sibling). Both `ref` and its next sibling must be static, unchanging nodes
|
|
367
|
+
* such as those that appear in a literal section of a template.
|
|
368
|
+
*
|
|
369
|
+
* This part must be empty, as its contents are not automatically moved.
|
|
370
|
+
*/
|
|
371
|
+
insertAfterNode(t) {
|
|
372
|
+
this.startNode = t, this.endNode = t.nextSibling;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Appends this part into a parent part.
|
|
376
|
+
*
|
|
377
|
+
* This part must be empty, as its contents are not automatically moved.
|
|
378
|
+
*/
|
|
379
|
+
appendIntoPart(t) {
|
|
380
|
+
t.__insert(this.startNode = U()), t.__insert(this.endNode = U());
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Inserts this part after the `ref` part.
|
|
384
|
+
*
|
|
385
|
+
* This part must be empty, as its contents are not automatically moved.
|
|
386
|
+
*/
|
|
387
|
+
insertAfterPart(t) {
|
|
388
|
+
t.__insert(this.startNode = U()), this.endNode = t.endNode, t.endNode = this.startNode;
|
|
389
|
+
}
|
|
390
|
+
setValue(t) {
|
|
391
|
+
this.__pendingValue = t;
|
|
524
392
|
}
|
|
525
393
|
commit() {
|
|
526
|
-
if (this.startNode.parentNode === null)
|
|
527
|
-
return;
|
|
528
|
-
}
|
|
529
|
-
while (isDirective(this.__pendingValue)) {
|
|
530
|
-
const directive2 = this.__pendingValue;
|
|
531
|
-
this.__pendingValue = noChange;
|
|
532
|
-
directive2(this);
|
|
533
|
-
}
|
|
534
|
-
const value = this.__pendingValue;
|
|
535
|
-
if (value === noChange) {
|
|
394
|
+
if (this.startNode.parentNode === null)
|
|
536
395
|
return;
|
|
396
|
+
for (; Wt(this.__pendingValue); ) {
|
|
397
|
+
const e = this.__pendingValue;
|
|
398
|
+
this.__pendingValue = V, e(this);
|
|
537
399
|
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
this.__commitText(value);
|
|
541
|
-
}
|
|
542
|
-
} else if (value instanceof TemplateResult) {
|
|
543
|
-
this.__commitTemplateResult(value);
|
|
544
|
-
} else if (value instanceof Node) {
|
|
545
|
-
this.__commitNode(value);
|
|
546
|
-
} else if (isIterable(value)) {
|
|
547
|
-
this.__commitIterable(value);
|
|
548
|
-
} else if (value === nothing) {
|
|
549
|
-
this.value = nothing;
|
|
550
|
-
this.clear();
|
|
551
|
-
} else {
|
|
552
|
-
this.__commitText(value);
|
|
553
|
-
}
|
|
400
|
+
const t = this.__pendingValue;
|
|
401
|
+
t !== V && (Qe(t) ? t !== this.value && this.__commitText(t) : t instanceof _e ? this.__commitTemplateResult(t) : t instanceof Node ? this.__commitNode(t) : Ae(t) ? this.__commitIterable(t) : t === _n ? (this.value = _n, this.clear()) : this.__commitText(t));
|
|
554
402
|
}
|
|
555
|
-
__insert(
|
|
556
|
-
this.endNode.parentNode.insertBefore(
|
|
403
|
+
__insert(t) {
|
|
404
|
+
this.endNode.parentNode.insertBefore(t, this.endNode);
|
|
557
405
|
}
|
|
558
|
-
__commitNode(
|
|
559
|
-
|
|
560
|
-
return;
|
|
561
|
-
}
|
|
562
|
-
this.clear();
|
|
563
|
-
this.__insert(value);
|
|
564
|
-
this.value = value;
|
|
565
|
-
}
|
|
566
|
-
__commitText(value) {
|
|
567
|
-
const node = this.startNode.nextSibling;
|
|
568
|
-
value = value == null ? "" : value;
|
|
569
|
-
const valueAsString = typeof value === "string" ? value : String(value);
|
|
570
|
-
if (node === this.endNode.previousSibling && node.nodeType === 3) {
|
|
571
|
-
node.data = valueAsString;
|
|
572
|
-
} else {
|
|
573
|
-
this.__commitNode(document.createTextNode(valueAsString));
|
|
574
|
-
}
|
|
575
|
-
this.value = value;
|
|
406
|
+
__commitNode(t) {
|
|
407
|
+
this.value !== t && (this.clear(), this.__insert(t), this.value = t);
|
|
576
408
|
}
|
|
577
|
-
|
|
578
|
-
const
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
const instance = new TemplateInstance(template, value.processor, this.options);
|
|
583
|
-
const fragment = instance._clone();
|
|
584
|
-
instance.update(value.values);
|
|
585
|
-
this.__commitNode(fragment);
|
|
586
|
-
this.value = instance;
|
|
587
|
-
}
|
|
409
|
+
__commitText(t) {
|
|
410
|
+
const e = this.startNode.nextSibling;
|
|
411
|
+
t = t ?? "";
|
|
412
|
+
const s = typeof t == "string" ? t : String(t);
|
|
413
|
+
e === this.endNode.previousSibling && e.nodeType === 3 ? e.data = s : this.__commitNode(document.createTextNode(s)), this.value = t;
|
|
588
414
|
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
this.
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
let itemPart;
|
|
597
|
-
for (const item of value) {
|
|
598
|
-
itemPart = itemParts[partIndex];
|
|
599
|
-
if (itemPart === void 0) {
|
|
600
|
-
itemPart = new NodePart(this.options);
|
|
601
|
-
itemParts.push(itemPart);
|
|
602
|
-
if (partIndex === 0) {
|
|
603
|
-
itemPart.appendIntoPart(this);
|
|
604
|
-
} else {
|
|
605
|
-
itemPart.insertAfterPart(itemParts[partIndex - 1]);
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
itemPart.setValue(item);
|
|
609
|
-
itemPart.commit();
|
|
610
|
-
partIndex++;
|
|
611
|
-
}
|
|
612
|
-
if (partIndex < itemParts.length) {
|
|
613
|
-
itemParts.length = partIndex;
|
|
614
|
-
this.clear(itemPart && itemPart.endNode);
|
|
415
|
+
__commitTemplateResult(t) {
|
|
416
|
+
const e = this.options.templateFactory(t);
|
|
417
|
+
if (this.value instanceof En && this.value.template === e)
|
|
418
|
+
this.value.update(t.values);
|
|
419
|
+
else {
|
|
420
|
+
const s = new En(e, t.processor, this.options), i = s._clone();
|
|
421
|
+
s.update(t.values), this.__commitNode(i), this.value = s;
|
|
615
422
|
}
|
|
616
423
|
}
|
|
617
|
-
|
|
618
|
-
|
|
424
|
+
__commitIterable(t) {
|
|
425
|
+
Array.isArray(this.value) || (this.value = [], this.clear());
|
|
426
|
+
const e = this.value;
|
|
427
|
+
let s = 0, i;
|
|
428
|
+
for (const r of t)
|
|
429
|
+
i = e[s], i === void 0 && (i = new wt(this.options), e.push(i), s === 0 ? i.appendIntoPart(this) : i.insertAfterPart(e[s - 1])), i.setValue(r), i.commit(), s++;
|
|
430
|
+
s < e.length && (e.length = s, this.clear(i && i.endNode));
|
|
431
|
+
}
|
|
432
|
+
clear(t = this.startNode) {
|
|
433
|
+
Ye(this.startNode.parentNode, t.nextSibling, this.endNode);
|
|
619
434
|
}
|
|
620
435
|
}
|
|
621
|
-
class
|
|
622
|
-
constructor(
|
|
623
|
-
this.value = void 0
|
|
624
|
-
this.__pendingValue = void 0;
|
|
625
|
-
if (strings.length !== 2 || strings[0] !== "" || strings[1] !== "") {
|
|
436
|
+
class Ms {
|
|
437
|
+
constructor(t, e, s) {
|
|
438
|
+
if (this.value = void 0, this.__pendingValue = void 0, s.length !== 2 || s[0] !== "" || s[1] !== "")
|
|
626
439
|
throw new Error("Boolean attributes can only contain a single expression");
|
|
627
|
-
|
|
628
|
-
this.element = element;
|
|
629
|
-
this.name = name;
|
|
630
|
-
this.strings = strings;
|
|
440
|
+
this.element = t, this.name = e, this.strings = s;
|
|
631
441
|
}
|
|
632
|
-
setValue(
|
|
633
|
-
this.__pendingValue =
|
|
442
|
+
setValue(t) {
|
|
443
|
+
this.__pendingValue = t;
|
|
634
444
|
}
|
|
635
445
|
commit() {
|
|
636
|
-
|
|
637
|
-
const
|
|
638
|
-
this.__pendingValue =
|
|
639
|
-
directive2(this);
|
|
446
|
+
for (; Wt(this.__pendingValue); ) {
|
|
447
|
+
const e = this.__pendingValue;
|
|
448
|
+
this.__pendingValue = V, e(this);
|
|
640
449
|
}
|
|
641
|
-
if (this.__pendingValue ===
|
|
450
|
+
if (this.__pendingValue === V)
|
|
642
451
|
return;
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
if (this.value !== value) {
|
|
646
|
-
if (value) {
|
|
647
|
-
this.element.setAttribute(this.name, "");
|
|
648
|
-
} else {
|
|
649
|
-
this.element.removeAttribute(this.name);
|
|
650
|
-
}
|
|
651
|
-
this.value = value;
|
|
652
|
-
}
|
|
653
|
-
this.__pendingValue = noChange;
|
|
452
|
+
const t = !!this.__pendingValue;
|
|
453
|
+
this.value !== t && (t ? this.element.setAttribute(this.name, "") : this.element.removeAttribute(this.name), this.value = t), this.__pendingValue = V;
|
|
654
454
|
}
|
|
655
455
|
}
|
|
656
|
-
class
|
|
657
|
-
constructor(
|
|
658
|
-
super(
|
|
659
|
-
this.single = strings.length === 2 && strings[0] === "" && strings[1] === "";
|
|
456
|
+
class Os extends jn {
|
|
457
|
+
constructor(t, e, s) {
|
|
458
|
+
super(t, e, s), this.single = s.length === 2 && s[0] === "" && s[1] === "";
|
|
660
459
|
}
|
|
661
460
|
_createPart() {
|
|
662
|
-
return new
|
|
461
|
+
return new Rs(this);
|
|
663
462
|
}
|
|
664
463
|
_getValue() {
|
|
665
|
-
|
|
666
|
-
return this.parts[0].value;
|
|
667
|
-
}
|
|
668
|
-
return super._getValue();
|
|
464
|
+
return this.single ? this.parts[0].value : super._getValue();
|
|
669
465
|
}
|
|
670
466
|
commit() {
|
|
671
|
-
|
|
672
|
-
this.dirty = false;
|
|
673
|
-
this.element[this.name] = this._getValue();
|
|
674
|
-
}
|
|
467
|
+
this.dirty && (this.dirty = !1, this.element[this.name] = this._getValue());
|
|
675
468
|
}
|
|
676
469
|
}
|
|
677
|
-
class
|
|
470
|
+
class Rs extends Xe {
|
|
678
471
|
}
|
|
679
|
-
let
|
|
472
|
+
let Fn = !1;
|
|
680
473
|
(() => {
|
|
681
474
|
try {
|
|
682
|
-
const
|
|
475
|
+
const n = {
|
|
683
476
|
get capture() {
|
|
684
|
-
|
|
685
|
-
return false;
|
|
477
|
+
return Fn = !0, !1;
|
|
686
478
|
}
|
|
687
479
|
};
|
|
688
|
-
window.addEventListener("test",
|
|
689
|
-
|
|
690
|
-
} catch (_e) {
|
|
480
|
+
window.addEventListener("test", n, n), window.removeEventListener("test", n, n);
|
|
481
|
+
} catch {
|
|
691
482
|
}
|
|
692
483
|
})();
|
|
693
|
-
class
|
|
694
|
-
constructor(
|
|
695
|
-
this.value = void 0;
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
this.
|
|
699
|
-
this.eventContext = eventContext;
|
|
700
|
-
this.__boundHandleEvent = (e) => this.handleEvent(e);
|
|
701
|
-
}
|
|
702
|
-
setValue(value) {
|
|
703
|
-
this.__pendingValue = value;
|
|
484
|
+
class As {
|
|
485
|
+
constructor(t, e, s) {
|
|
486
|
+
this.value = void 0, this.__pendingValue = void 0, this.element = t, this.eventName = e, this.eventContext = s, this.__boundHandleEvent = (i) => this.handleEvent(i);
|
|
487
|
+
}
|
|
488
|
+
setValue(t) {
|
|
489
|
+
this.__pendingValue = t;
|
|
704
490
|
}
|
|
705
491
|
commit() {
|
|
706
|
-
|
|
707
|
-
const
|
|
708
|
-
this.__pendingValue =
|
|
709
|
-
directive2(this);
|
|
492
|
+
for (; Wt(this.__pendingValue); ) {
|
|
493
|
+
const r = this.__pendingValue;
|
|
494
|
+
this.__pendingValue = V, r(this);
|
|
710
495
|
}
|
|
711
|
-
if (this.__pendingValue ===
|
|
496
|
+
if (this.__pendingValue === V)
|
|
712
497
|
return;
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
const oldListener = this.value;
|
|
716
|
-
const shouldRemoveListener = newListener == null || oldListener != null && (newListener.capture !== oldListener.capture || newListener.once !== oldListener.once || newListener.passive !== oldListener.passive);
|
|
717
|
-
const shouldAddListener = newListener != null && (oldListener == null || shouldRemoveListener);
|
|
718
|
-
if (shouldRemoveListener) {
|
|
719
|
-
this.element.removeEventListener(this.eventName, this.__boundHandleEvent, this.__options);
|
|
720
|
-
}
|
|
721
|
-
if (shouldAddListener) {
|
|
722
|
-
this.__options = getOptions(newListener);
|
|
723
|
-
this.element.addEventListener(this.eventName, this.__boundHandleEvent, this.__options);
|
|
724
|
-
}
|
|
725
|
-
this.value = newListener;
|
|
726
|
-
this.__pendingValue = noChange;
|
|
498
|
+
const t = this.__pendingValue, e = this.value, s = t == null || e != null && (t.capture !== e.capture || t.once !== e.once || t.passive !== e.passive), i = t != null && (e == null || s);
|
|
499
|
+
s && this.element.removeEventListener(this.eventName, this.__boundHandleEvent, this.__options), i && (this.__options = Hs(t), this.element.addEventListener(this.eventName, this.__boundHandleEvent, this.__options)), this.value = t, this.__pendingValue = V;
|
|
727
500
|
}
|
|
728
|
-
handleEvent(
|
|
729
|
-
|
|
730
|
-
this.value.call(this.eventContext || this.element, event);
|
|
731
|
-
} else {
|
|
732
|
-
this.value.handleEvent(event);
|
|
733
|
-
}
|
|
501
|
+
handleEvent(t) {
|
|
502
|
+
typeof this.value == "function" ? this.value.call(this.eventContext || this.element, t) : this.value.handleEvent(t);
|
|
734
503
|
}
|
|
735
504
|
}
|
|
736
|
-
const
|
|
505
|
+
const Hs = (n) => n && (Fn ? { capture: n.capture, passive: n.passive, once: n.once } : n.capture);
|
|
737
506
|
/**
|
|
738
507
|
* @license
|
|
739
508
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -747,27 +516,29 @@ const getOptions = (o) => o && (eventOptionsSupported ? { capture: o.capture, pa
|
|
|
747
516
|
* subject to an additional IP rights grant found at
|
|
748
517
|
* http://polymer.github.io/PATENTS.txt
|
|
749
518
|
*/
|
|
750
|
-
class
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
519
|
+
class Ws {
|
|
520
|
+
/**
|
|
521
|
+
* Create parts for an attribute-position binding, given the event, attribute
|
|
522
|
+
* name, and string literals.
|
|
523
|
+
*
|
|
524
|
+
* @param element The element containing the binding
|
|
525
|
+
* @param name The attribute name
|
|
526
|
+
* @param strings The string literals. There are always at least two strings,
|
|
527
|
+
* event for fully-controlled bindings with a single expression.
|
|
528
|
+
*/
|
|
529
|
+
handleAttributeExpressions(t, e, s, i) {
|
|
530
|
+
const r = e[0];
|
|
531
|
+
return r === "." ? new Os(t, e.slice(1), s).parts : r === "@" ? [new As(t, e.slice(1), i.eventContext)] : r === "?" ? [new Ms(t, e.slice(1), s)] : new jn(t, e, s).parts;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Create parts for a text-position binding.
|
|
535
|
+
* @param templateFactory
|
|
536
|
+
*/
|
|
537
|
+
handleTextExpression(t) {
|
|
538
|
+
return new wt(t);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
const Bn = new Ws();
|
|
771
542
|
/**
|
|
772
543
|
* @license
|
|
773
544
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -781,29 +552,19 @@ const defaultTemplateProcessor = new DefaultTemplateProcessor();
|
|
|
781
552
|
* subject to an additional IP rights grant found at
|
|
782
553
|
* http://polymer.github.io/PATENTS.txt
|
|
783
554
|
*/
|
|
784
|
-
function
|
|
785
|
-
let
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
const key2 = result.strings.join(marker);
|
|
798
|
-
template = templateCache.keyString.get(key2);
|
|
799
|
-
if (template === void 0) {
|
|
800
|
-
template = new Template(result, result.getTemplateElement());
|
|
801
|
-
templateCache.keyString.set(key2, template);
|
|
802
|
-
}
|
|
803
|
-
templateCache.stringsArray.set(result.strings, template);
|
|
804
|
-
return template;
|
|
805
|
-
}
|
|
806
|
-
const templateCaches = /* @__PURE__ */ new Map();
|
|
555
|
+
function Is(n) {
|
|
556
|
+
let t = bn.get(n.type);
|
|
557
|
+
t === void 0 && (t = {
|
|
558
|
+
stringsArray: /* @__PURE__ */ new WeakMap(),
|
|
559
|
+
keyString: /* @__PURE__ */ new Map()
|
|
560
|
+
}, bn.set(n.type, t));
|
|
561
|
+
let e = t.stringsArray.get(n.strings);
|
|
562
|
+
if (e !== void 0)
|
|
563
|
+
return e;
|
|
564
|
+
const s = n.strings.join(et);
|
|
565
|
+
return e = t.keyString.get(s), e === void 0 && (e = new ks(n, n.getTemplateElement()), t.keyString.set(s, e)), t.stringsArray.set(n.strings, e), e;
|
|
566
|
+
}
|
|
567
|
+
const bn = /* @__PURE__ */ new Map();
|
|
807
568
|
/**
|
|
808
569
|
* @license
|
|
809
570
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -817,16 +578,9 @@ const templateCaches = /* @__PURE__ */ new Map();
|
|
|
817
578
|
* subject to an additional IP rights grant found at
|
|
818
579
|
* http://polymer.github.io/PATENTS.txt
|
|
819
580
|
*/
|
|
820
|
-
const
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
if (part2 === void 0) {
|
|
824
|
-
removeNodes(container, container.firstChild);
|
|
825
|
-
parts.set(container, part2 = new NodePart(Object.assign({ templateFactory }, options)));
|
|
826
|
-
part2.appendInto(container);
|
|
827
|
-
}
|
|
828
|
-
part2.setValue(result);
|
|
829
|
-
part2.commit();
|
|
581
|
+
const Cn = /* @__PURE__ */ new WeakMap(), Kn = (n, t, e) => {
|
|
582
|
+
let s = Cn.get(t);
|
|
583
|
+
s === void 0 && (Ye(t, t.firstChild), Cn.set(t, s = new wt(Object.assign({ templateFactory: Is }, e))), s.appendInto(t)), s.setValue(n), s.commit();
|
|
830
584
|
};
|
|
831
585
|
/**
|
|
832
586
|
* @license
|
|
@@ -841,346 +595,259 @@ const render = (result, container, options) => {
|
|
|
841
595
|
* subject to an additional IP rights grant found at
|
|
842
596
|
* http://polymer.github.io/PATENTS.txt
|
|
843
597
|
*/
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
function addMicrotaskToStack(func) {
|
|
870
|
-
if (!microtaskStack.length) {
|
|
871
|
-
addMicrotask(execMicrotaskStack);
|
|
872
|
-
}
|
|
873
|
-
microtaskStack.push(func);
|
|
874
|
-
}
|
|
875
|
-
function absoluteLocation(currentPath = "", relativePath = "") {
|
|
876
|
-
const { pathname, search, hash } = new URL(relativePath, location.origin + currentPath);
|
|
877
|
-
return pathname + search + decodeURIComponent(hash);
|
|
878
|
-
}
|
|
879
|
-
function addListener(target, type, listener, options) {
|
|
880
|
-
target.addEventListener(type, listener, options);
|
|
881
|
-
return () => target.removeEventListener(type, listener, options);
|
|
882
|
-
}
|
|
883
|
-
class LinkedList extends EventTarget {
|
|
598
|
+
typeof window < "u" && (window.litHtmlVersions || (window.litHtmlVersions = [])).push("1.4.1");
|
|
599
|
+
const G = (n, ...t) => new _e(n, t, "html", Bn), Vs = (n, ...t) => new Gn(n, t, "svg", Bn), _t = /* @__PURE__ */ new Set();
|
|
600
|
+
function I(n) {
|
|
601
|
+
typeof n == "function" && (_t.size || globalThis.queueMicrotask(() => {
|
|
602
|
+
_t.forEach((t) => t()), _t.clear();
|
|
603
|
+
}), _t.delete(n), _t.add(n));
|
|
604
|
+
}
|
|
605
|
+
const Ht = [];
|
|
606
|
+
function Ds() {
|
|
607
|
+
for (let n = Ht.length - 1; n >= 0; n--)
|
|
608
|
+
Ht[n]();
|
|
609
|
+
Ht.length = 0;
|
|
610
|
+
}
|
|
611
|
+
function Di(n) {
|
|
612
|
+
Ht.length || I(Ds), Ht.push(n);
|
|
613
|
+
}
|
|
614
|
+
function zn(n = "", t = "") {
|
|
615
|
+
const { pathname: e, search: s, hash: i } = new URL(t, location.origin + n);
|
|
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 {
|
|
884
623
|
constructor() {
|
|
885
624
|
super(...arguments);
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
__privateSet(this, _map, /* @__PURE__ */ new Map());
|
|
625
|
+
P(this, Gt);
|
|
626
|
+
P(this, X, /* @__PURE__ */ new Map());
|
|
627
|
+
P(this, z, void 0);
|
|
628
|
+
P(this, Z, void 0);
|
|
891
629
|
}
|
|
892
630
|
get size() {
|
|
893
|
-
return
|
|
631
|
+
return g(this, X).size;
|
|
894
632
|
}
|
|
895
633
|
get first() {
|
|
896
|
-
return
|
|
634
|
+
return g(this, z);
|
|
897
635
|
}
|
|
898
636
|
get last() {
|
|
899
|
-
return
|
|
900
|
-
}
|
|
901
|
-
isSuperLinkOf(
|
|
902
|
-
let
|
|
903
|
-
if (!
|
|
904
|
-
return
|
|
905
|
-
let
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
}
|
|
931
|
-
__privateGet(this, _map).set(value, item);
|
|
932
|
-
}
|
|
933
|
-
delete(value) {
|
|
934
|
-
const deleteItem = __privateMethod(this, _delete, delete_fn).call(this, value);
|
|
935
|
-
if (!__privateGet(this, _firstItem)) {
|
|
936
|
-
this.dispatchEvent(new CustomEvent("end"));
|
|
937
|
-
}
|
|
938
|
-
return deleteItem;
|
|
939
|
-
}
|
|
637
|
+
return g(this, Z);
|
|
638
|
+
}
|
|
639
|
+
isSuperLinkOf(e) {
|
|
640
|
+
let s = e.first;
|
|
641
|
+
if (!s)
|
|
642
|
+
return !0;
|
|
643
|
+
let i = this.find(s.value);
|
|
644
|
+
for (; i && i.value === s.value; ) {
|
|
645
|
+
if (s = s.next, !s)
|
|
646
|
+
return !0;
|
|
647
|
+
i = i.next;
|
|
648
|
+
}
|
|
649
|
+
return !1;
|
|
650
|
+
}
|
|
651
|
+
find(e) {
|
|
652
|
+
return g(this, X).get(e);
|
|
653
|
+
}
|
|
654
|
+
// 添加到尾部,已存在时会删除老的项目
|
|
655
|
+
// 如果是添加第一个,start 事件会在添加前触发,避免处理事件重复的逻辑
|
|
656
|
+
add(e) {
|
|
657
|
+
g(this, Z) || this.dispatchEvent(new CustomEvent("start"));
|
|
658
|
+
const s = Ce(this, Gt, He).call(this, e) || { value: e };
|
|
659
|
+
s.prev = g(this, Z), s.prev && (s.prev.next = s), s.next = void 0, F(this, Z, s), g(this, z) || F(this, z, s), g(this, X).set(e, s);
|
|
660
|
+
}
|
|
661
|
+
// 删除这个元素后没有其他元素时立即出发 end 事件
|
|
662
|
+
delete(e) {
|
|
663
|
+
const s = Ce(this, Gt, He).call(this, e);
|
|
664
|
+
return g(this, z) || this.dispatchEvent(new CustomEvent("end")), s;
|
|
665
|
+
}
|
|
666
|
+
// 获取头部元素
|
|
667
|
+
// 会从链表删除
|
|
940
668
|
get() {
|
|
941
|
-
const
|
|
942
|
-
if (
|
|
943
|
-
return;
|
|
944
|
-
this.delete(firstItem.value);
|
|
945
|
-
return firstItem.value;
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
_map = new WeakMap();
|
|
949
|
-
_firstItem = new WeakMap();
|
|
950
|
-
_lastItem = new WeakMap();
|
|
951
|
-
_delete = new WeakSet();
|
|
952
|
-
delete_fn = function(value) {
|
|
953
|
-
const existItem = __privateGet(this, _map).get(value);
|
|
954
|
-
if (existItem) {
|
|
955
|
-
if (existItem.prev) {
|
|
956
|
-
existItem.prev.next = existItem.next;
|
|
957
|
-
} else {
|
|
958
|
-
__privateSet(this, _firstItem, existItem.next);
|
|
959
|
-
}
|
|
960
|
-
if (existItem.next) {
|
|
961
|
-
existItem.next.prev = existItem.prev;
|
|
962
|
-
} else {
|
|
963
|
-
__privateSet(this, _lastItem, existItem.prev);
|
|
964
|
-
}
|
|
965
|
-
__privateGet(this, _map).delete(value);
|
|
966
|
-
}
|
|
967
|
-
return existItem;
|
|
968
|
-
};
|
|
969
|
-
class PropProxyMap extends WeakMap {
|
|
970
|
-
get(ele) {
|
|
971
|
-
let proxy = super.get(ele);
|
|
972
|
-
if (!proxy) {
|
|
973
|
-
proxy = {};
|
|
974
|
-
this.set(ele, proxy);
|
|
975
|
-
}
|
|
976
|
-
return proxy;
|
|
669
|
+
const e = g(this, z);
|
|
670
|
+
if (e)
|
|
671
|
+
return this.delete(e.value), e.value;
|
|
977
672
|
}
|
|
978
673
|
}
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
674
|
+
X = new WeakMap(), z = new WeakMap(), Z = new WeakMap(), Gt = new WeakSet(), He = function(e) {
|
|
675
|
+
const s = g(this, X).get(e);
|
|
676
|
+
return s && (s.prev ? s.prev.next = s.next : F(this, z, s.next), s.next ? s.next.prev = s.prev : F(this, Z, s.prev), g(this, X).delete(e)), s;
|
|
677
|
+
};
|
|
678
|
+
class Us extends WeakMap {
|
|
679
|
+
get(t) {
|
|
680
|
+
let e = super.get(t);
|
|
681
|
+
return e || (e = {}, this.set(t, e)), e;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
var gt, pe;
|
|
685
|
+
class It extends URLSearchParams {
|
|
686
|
+
constructor(e) {
|
|
687
|
+
super(e);
|
|
688
|
+
P(this, gt, (e) => typeof e == "string" ? e : JSON.stringify(e));
|
|
689
|
+
P(this, pe, (e) => {
|
|
690
|
+
if (!e)
|
|
985
691
|
return null;
|
|
986
692
|
try {
|
|
987
|
-
return JSON.parse(
|
|
693
|
+
return JSON.parse(e);
|
|
988
694
|
} catch {
|
|
989
695
|
return null;
|
|
990
696
|
}
|
|
991
697
|
});
|
|
992
698
|
}
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
query = param;
|
|
999
|
-
}
|
|
1000
|
-
Object.entries(query).forEach(([key2, value]) => {
|
|
1001
|
-
this.append(key2, __privateGet(this, _stringify).call(this, value));
|
|
699
|
+
// support `{ key: ObjectValue }`
|
|
700
|
+
concat(e) {
|
|
701
|
+
let s;
|
|
702
|
+
typeof e == "string" ? s = Object.fromEntries(new URLSearchParams(e).entries()) : s = e, Object.entries(s).forEach(([i, r]) => {
|
|
703
|
+
this.append(i, g(this, gt).call(this, r));
|
|
1002
704
|
});
|
|
1003
705
|
}
|
|
1004
|
-
setAny(
|
|
1005
|
-
if (Array.isArray(
|
|
1006
|
-
this.delete(
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
v ? this.set(key2, v) : this.delete(key2);
|
|
706
|
+
setAny(e, s) {
|
|
707
|
+
if (Array.isArray(s))
|
|
708
|
+
this.delete(e), s.forEach((i) => this.append(e, g(this, gt).call(this, i)));
|
|
709
|
+
else {
|
|
710
|
+
const i = g(this, gt).call(this, s);
|
|
711
|
+
i ? this.set(e, i) : this.delete(e);
|
|
1011
712
|
}
|
|
1012
713
|
}
|
|
1013
|
-
getAny(
|
|
1014
|
-
return this.getAnyAll(
|
|
714
|
+
getAny(e) {
|
|
715
|
+
return this.getAnyAll(e)[0];
|
|
1015
716
|
}
|
|
1016
|
-
getAnyAll(
|
|
1017
|
-
return this.getAll(
|
|
717
|
+
getAnyAll(e) {
|
|
718
|
+
return this.getAll(e).filter((s) => s !== "").map((s) => g(this, pe).call(this, s));
|
|
1018
719
|
}
|
|
1019
720
|
toString() {
|
|
1020
|
-
const
|
|
1021
|
-
return
|
|
721
|
+
const e = super.toString();
|
|
722
|
+
return e ? `?${e}` : "";
|
|
1022
723
|
}
|
|
1023
724
|
toJSON() {
|
|
1024
725
|
return this.toString();
|
|
1025
726
|
}
|
|
1026
727
|
}
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
function
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
}
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
if (str.length < len)
|
|
1059
|
-
return str + randomStr(len - str.length);
|
|
1060
|
-
return str;
|
|
1061
|
-
}
|
|
1062
|
-
const nestingRuleRegExp = new RegExp("&.*{((.|\n)*)}", "g");
|
|
1063
|
-
function flatStyled(style, type) {
|
|
1064
|
-
const nestingRules = [];
|
|
1065
|
-
let styledContent = `& {${style.replace(nestingRuleRegExp, (substr) => {
|
|
1066
|
-
nestingRules.push(substr);
|
|
1067
|
-
return "";
|
|
1068
|
-
})}}` + nestingRules.join("");
|
|
1069
|
-
styledContent = styledContent.replace(/&/g, type === "class" ? ".&" : "#&");
|
|
1070
|
-
return { styledContent, type };
|
|
1071
|
-
}
|
|
1072
|
-
const styled = {
|
|
1073
|
-
class: (arr, ...args) => {
|
|
1074
|
-
const style = raw(arr, ...args);
|
|
1075
|
-
return flatStyled(style, "class");
|
|
728
|
+
gt = new WeakMap(), pe = new WeakMap();
|
|
729
|
+
function Jt(n, ...t) {
|
|
730
|
+
return n.reduce((e, s, i) => e + (t[i - 1] ?? "") + s);
|
|
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");
|
|
1076
759
|
},
|
|
1077
|
-
id: (
|
|
1078
|
-
const
|
|
1079
|
-
return
|
|
760
|
+
id: (n, ...t) => {
|
|
761
|
+
const e = Jt(n, ...t);
|
|
762
|
+
return Pn(e, "id");
|
|
1080
763
|
},
|
|
1081
|
-
keyframes: (
|
|
1082
|
-
const keyframesContent = raw(arr, ...args);
|
|
1083
|
-
const styledContent = `@keyframes & {${keyframesContent}}`;
|
|
1084
|
-
return { styledContent, type: "keyframes" };
|
|
1085
|
-
}
|
|
764
|
+
keyframes: (n, ...t) => ({ styledContent: `@keyframes & {${Jt(n, ...t)}}`, type: "keyframes" })
|
|
1086
765
|
};
|
|
1087
|
-
function
|
|
1088
|
-
return
|
|
1089
|
-
}
|
|
1090
|
-
function
|
|
1091
|
-
return
|
|
1092
|
-
}
|
|
1093
|
-
function
|
|
1094
|
-
Object.keys(
|
|
1095
|
-
const
|
|
1096
|
-
delete
|
|
1097
|
-
});
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
for (const key2 in object) {
|
|
1129
|
-
const s = toString(key2, object[key2]);
|
|
1130
|
-
result += s ? s + separate : "";
|
|
1131
|
-
}
|
|
1132
|
-
return result;
|
|
1133
|
-
}
|
|
1134
|
-
function styleMap(object) {
|
|
1135
|
-
return objectMapToString(
|
|
1136
|
-
object,
|
|
766
|
+
function j(n) {
|
|
767
|
+
return n.replace(/[A-Z]/g, (t) => "-" + t.toLowerCase());
|
|
768
|
+
}
|
|
769
|
+
function ot(n) {
|
|
770
|
+
return n.replace(/-(.)/g, (t, e) => e.toUpperCase());
|
|
771
|
+
}
|
|
772
|
+
function Ze(n) {
|
|
773
|
+
return Object.keys(n).forEach((t) => {
|
|
774
|
+
const e = t;
|
|
775
|
+
delete n[e];
|
|
776
|
+
}), n;
|
|
777
|
+
}
|
|
778
|
+
class tt extends Error {
|
|
779
|
+
constructor(t) {
|
|
780
|
+
super(t), this.message = `gem: ${this.message}`;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
function js(n, t) {
|
|
784
|
+
const e = n.length;
|
|
785
|
+
if (t.length !== e)
|
|
786
|
+
return !0;
|
|
787
|
+
for (let s = 0; s < e; s++)
|
|
788
|
+
if (n[s] !== t[s])
|
|
789
|
+
return !0;
|
|
790
|
+
return !1;
|
|
791
|
+
}
|
|
792
|
+
function Fs(n, t) {
|
|
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) {
|
|
797
|
+
let s = t;
|
|
798
|
+
for (const i in n) {
|
|
799
|
+
const r = e(i, n[i]);
|
|
800
|
+
s += r ? r + t : "";
|
|
801
|
+
}
|
|
802
|
+
return s;
|
|
803
|
+
}
|
|
804
|
+
function ji(n) {
|
|
805
|
+
return tn(
|
|
806
|
+
n,
|
|
1137
807
|
";",
|
|
1138
|
-
(
|
|
808
|
+
(t, e) => e || e === 0 ? `${j(t)}:${e}` : ""
|
|
1139
809
|
);
|
|
1140
810
|
}
|
|
1141
|
-
function
|
|
1142
|
-
return
|
|
811
|
+
function Bs(n) {
|
|
812
|
+
return tn(n, " ", (t, e) => e ? t : "");
|
|
1143
813
|
}
|
|
1144
|
-
const
|
|
1145
|
-
function
|
|
1146
|
-
return
|
|
1147
|
-
|
|
814
|
+
const Fi = Bs;
|
|
815
|
+
function Bi(n) {
|
|
816
|
+
return tn(
|
|
817
|
+
n,
|
|
1148
818
|
",",
|
|
1149
|
-
(
|
|
819
|
+
(t, e) => e === !0 || t === e ? t : e ? `${t}:${e}` : ""
|
|
1150
820
|
);
|
|
1151
821
|
}
|
|
1152
|
-
const
|
|
1153
|
-
function
|
|
1154
|
-
if (
|
|
1155
|
-
throw new
|
|
1156
|
-
|
|
1157
|
-
StoreListenerMap.set(originStore, /* @__PURE__ */ new Set());
|
|
1158
|
-
return originStore;
|
|
822
|
+
const Vt = /* @__PURE__ */ new WeakMap();
|
|
823
|
+
function Ft(n) {
|
|
824
|
+
if (Vt.has(n))
|
|
825
|
+
throw new tt("argument error");
|
|
826
|
+
return Vt.set(n, /* @__PURE__ */ new Set()), n;
|
|
1159
827
|
}
|
|
1160
|
-
function
|
|
1161
|
-
var
|
|
1162
|
-
Object.assign(
|
|
1163
|
-
|
|
1164
|
-
addMicrotask(func);
|
|
828
|
+
function nt(n, t) {
|
|
829
|
+
var e;
|
|
830
|
+
Object.assign(n, t), (e = Vt.get(n)) == null || e.forEach((s) => {
|
|
831
|
+
I(s);
|
|
1165
832
|
});
|
|
1166
833
|
}
|
|
1167
|
-
function
|
|
1168
|
-
const
|
|
1169
|
-
return [
|
|
834
|
+
function en(n) {
|
|
835
|
+
const t = Ft(n);
|
|
836
|
+
return [t, (e) => nt(t, e)];
|
|
1170
837
|
}
|
|
1171
|
-
function
|
|
1172
|
-
const
|
|
1173
|
-
|
|
1174
|
-
|
|
838
|
+
function ct(n, t) {
|
|
839
|
+
const e = Vt.get(n);
|
|
840
|
+
return e == null || e.add(t), () => {
|
|
841
|
+
e == null || e.delete(t);
|
|
842
|
+
};
|
|
1175
843
|
}
|
|
1176
|
-
function
|
|
1177
|
-
const
|
|
1178
|
-
|
|
844
|
+
function Ki(n, t) {
|
|
845
|
+
const e = Vt.get(n);
|
|
846
|
+
e == null || e.delete(t);
|
|
1179
847
|
}
|
|
1180
|
-
const
|
|
1181
|
-
var VersionExports = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
848
|
+
const Ks = "1.7.11", zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1182
849
|
__proto__: null,
|
|
1183
|
-
version
|
|
850
|
+
version: Ks
|
|
1184
851
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1185
852
|
/**
|
|
1186
853
|
* @license
|
|
@@ -1195,131 +862,66 @@ var VersionExports = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.define
|
|
|
1195
862
|
* subject to an additional IP rights grant found at
|
|
1196
863
|
* http://polymer.github.io/PATENTS.txt
|
|
1197
864
|
*/
|
|
1198
|
-
const
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1201
|
-
const
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
reparentNodes(container, part2.startNode, endNode, beforeNode);
|
|
1218
|
-
}
|
|
1219
|
-
};
|
|
1220
|
-
const removePart = (part2) => {
|
|
1221
|
-
removeNodes(part2.startNode.parentNode, part2.startNode, part2.endNode.nextSibling);
|
|
1222
|
-
};
|
|
1223
|
-
const generateMap = (list, start, end) => {
|
|
1224
|
-
const map = /* @__PURE__ */ new Map();
|
|
1225
|
-
for (let i = start; i <= end; i++) {
|
|
1226
|
-
map.set(list[i], i);
|
|
1227
|
-
}
|
|
1228
|
-
return map;
|
|
1229
|
-
};
|
|
1230
|
-
const partListCache = /* @__PURE__ */ new WeakMap();
|
|
1231
|
-
const keyListCache = /* @__PURE__ */ new WeakMap();
|
|
1232
|
-
const repeat = directive((items, keyFnOrTemplate, template) => {
|
|
1233
|
-
let keyFn;
|
|
1234
|
-
if (template === void 0) {
|
|
1235
|
-
template = keyFnOrTemplate;
|
|
1236
|
-
} else if (keyFnOrTemplate !== void 0) {
|
|
1237
|
-
keyFn = keyFnOrTemplate;
|
|
1238
|
-
}
|
|
1239
|
-
return (containerPart) => {
|
|
1240
|
-
if (!(containerPart instanceof NodePart)) {
|
|
865
|
+
const $n = (n, t) => {
|
|
866
|
+
const e = n.startNode.parentNode, s = t === void 0 ? n.endNode : t.startNode, i = e.insertBefore(U(), s);
|
|
867
|
+
e.insertBefore(U(), s);
|
|
868
|
+
const r = new wt(n.options);
|
|
869
|
+
return r.insertAfterNode(i), r;
|
|
870
|
+
}, st = (n, t) => (n.setValue(t), n.commit(), n), Pe = (n, t, e) => {
|
|
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))
|
|
1241
884
|
throw new Error("repeat can only be used in text bindings");
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
const
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
newTail--;
|
|
1273
|
-
} else if (oldKeys[oldHead] === newKeys[newTail]) {
|
|
1274
|
-
newParts[newTail] = updatePart(oldParts[oldHead], newValues[newTail]);
|
|
1275
|
-
insertPartBefore(containerPart, oldParts[oldHead], newParts[newTail + 1]);
|
|
1276
|
-
oldHead++;
|
|
1277
|
-
newTail--;
|
|
1278
|
-
} else if (oldKeys[oldTail] === newKeys[newHead]) {
|
|
1279
|
-
newParts[newHead] = updatePart(oldParts[oldTail], newValues[newHead]);
|
|
1280
|
-
insertPartBefore(containerPart, oldParts[oldTail], oldParts[oldHead]);
|
|
1281
|
-
oldTail--;
|
|
1282
|
-
newHead++;
|
|
1283
|
-
} else {
|
|
1284
|
-
if (newKeyToIndexMap === void 0) {
|
|
1285
|
-
newKeyToIndexMap = generateMap(newKeys, newHead, newTail);
|
|
1286
|
-
oldKeyToIndexMap = generateMap(oldKeys, oldHead, oldTail);
|
|
1287
|
-
}
|
|
1288
|
-
if (!newKeyToIndexMap.has(oldKeys[oldHead])) {
|
|
1289
|
-
removePart(oldParts[oldHead]);
|
|
1290
|
-
oldHead++;
|
|
1291
|
-
} else if (!newKeyToIndexMap.has(oldKeys[oldTail])) {
|
|
1292
|
-
removePart(oldParts[oldTail]);
|
|
1293
|
-
oldTail--;
|
|
1294
|
-
} else {
|
|
1295
|
-
const oldIndex = oldKeyToIndexMap.get(newKeys[newHead]);
|
|
1296
|
-
const oldPart = oldIndex !== void 0 ? oldParts[oldIndex] : null;
|
|
1297
|
-
if (oldPart === null) {
|
|
1298
|
-
const newPart = createAndInsertPart(containerPart, oldParts[oldHead]);
|
|
1299
|
-
updatePart(newPart, newValues[newHead]);
|
|
1300
|
-
newParts[newHead] = newPart;
|
|
1301
|
-
} else {
|
|
1302
|
-
newParts[newHead] = updatePart(oldPart, newValues[newHead]);
|
|
1303
|
-
insertPartBefore(containerPart, oldPart, oldParts[oldHead]);
|
|
1304
|
-
oldParts[oldIndex] = null;
|
|
1305
|
-
}
|
|
1306
|
-
newHead++;
|
|
1307
|
-
}
|
|
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++;
|
|
1308
915
|
}
|
|
916
|
+
for (; f <= _; ) {
|
|
917
|
+
const v = $n(i, a[_ + 1]);
|
|
918
|
+
st(v, c[f]), a[f++] = v;
|
|
1309
919
|
}
|
|
1310
|
-
|
|
1311
|
-
const
|
|
1312
|
-
|
|
1313
|
-
newParts[newHead++] = newPart;
|
|
920
|
+
for (; d <= m; ) {
|
|
921
|
+
const v = r[d++];
|
|
922
|
+
v !== null && $e(v);
|
|
1314
923
|
}
|
|
1315
|
-
|
|
1316
|
-
const oldPart = oldParts[oldHead++];
|
|
1317
|
-
if (oldPart !== null) {
|
|
1318
|
-
removePart(oldPart);
|
|
1319
|
-
}
|
|
1320
|
-
}
|
|
1321
|
-
partListCache.set(containerPart, newParts);
|
|
1322
|
-
keyListCache.set(containerPart, newKeys);
|
|
924
|
+
kn.set(i, a), Ln.set(i, h);
|
|
1323
925
|
};
|
|
1324
926
|
});
|
|
1325
927
|
/**
|
|
@@ -1335,18 +937,14 @@ const repeat = directive((items, keyFnOrTemplate, template) => {
|
|
|
1335
937
|
* subject to an additional IP rights grant found at
|
|
1336
938
|
* http://polymer.github.io/PATENTS.txt
|
|
1337
939
|
*/
|
|
1338
|
-
const
|
|
1339
|
-
const
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
if (Array.isArray(previousValue) && previousValue.length === value.length && value.every((v, i) => v === previousValue[i])) {
|
|
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]))
|
|
1343
944
|
return;
|
|
1344
|
-
|
|
1345
|
-
} else if (previousValue === value && (value !== void 0 || previousValues$1.has(part2))) {
|
|
945
|
+
} else if (s === n && (n !== void 0 || Te.has(e)))
|
|
1346
946
|
return;
|
|
1347
|
-
|
|
1348
|
-
part2.setValue(f());
|
|
1349
|
-
previousValues$1.set(part2, Array.isArray(value) ? Array.from(value) : value);
|
|
947
|
+
e.setValue(t()), Te.set(e, Array.isArray(n) ? Array.from(n) : n);
|
|
1350
948
|
});
|
|
1351
949
|
/**
|
|
1352
950
|
* @license
|
|
@@ -1361,1133 +959,815 @@ const guard = directive((value, f) => (part2) => {
|
|
|
1361
959
|
* subject to an additional IP rights grant found at
|
|
1362
960
|
* http://polymer.github.io/PATENTS.txt
|
|
1363
961
|
*/
|
|
1364
|
-
const
|
|
1365
|
-
const
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
}
|
|
1375
|
-
previousValues.set(part2, value);
|
|
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);
|
|
968
|
+
}
|
|
969
|
+
} else
|
|
970
|
+
n !== e && t.setValue(n);
|
|
971
|
+
ke.set(t, n);
|
|
1376
972
|
});
|
|
1377
|
-
var
|
|
1378
|
-
if (!
|
|
1379
|
-
throw TypeError("Cannot " +
|
|
1380
|
-
}
|
|
1381
|
-
|
|
1382
|
-
__accessCheck$1(obj, member, "read from private field");
|
|
1383
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
1384
|
-
};
|
|
1385
|
-
var __privateAdd$1 = (obj, member, value) => {
|
|
1386
|
-
if (member.has(obj))
|
|
973
|
+
var Xn = (n, t, e) => {
|
|
974
|
+
if (!t.has(n))
|
|
975
|
+
throw TypeError("Cannot " + e);
|
|
976
|
+
}, l = (n, t, e) => (Xn(n, t, "read from private field"), e ? e.call(n) : t.get(n)), w = (n, t, e) => {
|
|
977
|
+
if (t.has(n))
|
|
1387
978
|
throw TypeError("Cannot add the same private member more than once");
|
|
1388
|
-
|
|
1389
|
-
};
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
}
|
|
1401
|
-
const asyncRenderTaskList = new LinkedList();
|
|
1402
|
-
const tick = (timeStamp = performance.now()) => {
|
|
1403
|
-
if (performance.now() > timeStamp + 16)
|
|
1404
|
-
return requestAnimationFrame(tick);
|
|
1405
|
-
const task = asyncRenderTaskList.get();
|
|
1406
|
-
if (task) {
|
|
1407
|
-
task();
|
|
1408
|
-
tick(timeStamp);
|
|
1409
|
-
}
|
|
979
|
+
t instanceof WeakSet ? t.add(n) : t.set(n, e);
|
|
980
|
+
}, k = (n, t, e, s) => (Xn(n, t, "write to private field"), s ? s.call(n, e) : t.set(n, e), e), ft, Ct, Y, Pt, B, $t, K, Q, Yt, Qt, We, Ie, Ve, Xt, De, Zt, it, qe, te, ee, ne;
|
|
981
|
+
function Qs() {
|
|
982
|
+
}
|
|
983
|
+
function Le(n) {
|
|
984
|
+
typeof n == "function" && n();
|
|
985
|
+
}
|
|
986
|
+
const ce = new qs(), Ue = (n = performance.now()) => {
|
|
987
|
+
if (performance.now() > n + 16)
|
|
988
|
+
return requestAnimationFrame(Ue);
|
|
989
|
+
const t = ce.get();
|
|
990
|
+
t && (t(), Ue(n));
|
|
1410
991
|
};
|
|
1411
|
-
|
|
1412
|
-
const
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
const _GemElement = class extends HTMLElement {
|
|
1416
|
-
constructor(options = {}) {
|
|
1417
|
-
super();
|
|
1418
|
-
__privateAdd$1(this, _renderRoot, void 0);
|
|
1419
|
-
__privateAdd$1(this, _internals, void 0);
|
|
1420
|
-
__privateAdd$1(this, _isAppendReason, void 0);
|
|
1421
|
-
__privateAdd$1(this, _isMounted, void 0);
|
|
1422
|
-
__privateAdd$1(this, _isAsync, void 0);
|
|
1423
|
-
__privateAdd$1(this, _effectList, void 0);
|
|
1424
|
-
__privateAdd$1(this, _memoList, void 0);
|
|
1425
|
-
__privateAdd$1(this, _unmountCallback, void 0);
|
|
1426
|
-
this.setState = (payload) => {
|
|
992
|
+
ce.addEventListener("start", () => I(Ue));
|
|
993
|
+
const Kt = Symbol("constructor"), he = Symbol("init"), Zn = Symbol("update"), ts = class Tt extends HTMLElement {
|
|
994
|
+
constructor(t = {}) {
|
|
995
|
+
super(), w(this, Ct, void 0), w(this, Y, void 0), w(this, Pt, void 0), w(this, B, void 0), w(this, $t, void 0), w(this, K, void 0), w(this, Q, void 0), w(this, Yt, void 0), this.setState = (i) => {
|
|
1427
996
|
if (!this.state)
|
|
1428
|
-
throw new
|
|
1429
|
-
Object.assign(this.state,
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
const { callback, getDep, values, preCallback } = effectItem;
|
|
1435
|
-
const newValues = getDep == null ? void 0 : getDep();
|
|
1436
|
-
if (!getDep || !values || isArrayChange(values, newValues)) {
|
|
1437
|
-
execCallback(preCallback);
|
|
1438
|
-
effectItem.preCallback = callback(newValues, values);
|
|
1439
|
-
effectItem.values = newValues;
|
|
1440
|
-
}
|
|
997
|
+
throw new tt("`state` not initialized");
|
|
998
|
+
Object.assign(this.state, i), I(l(this, it));
|
|
999
|
+
}, w(this, Qt, (i) => {
|
|
1000
|
+
i == null || i.forEach((r) => {
|
|
1001
|
+
const { callback: o, getDep: a, values: c, preCallback: h } = r, p = a == null ? void 0 : a();
|
|
1002
|
+
(!a || !c || js(c, p)) && (Le(h), r.preCallback = o(p, c), r.values = p);
|
|
1441
1003
|
});
|
|
1442
|
-
})
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
callback,
|
|
1454
|
-
getDep,
|
|
1455
|
-
initialized: __privateGet$1(this, _isMounted),
|
|
1456
|
-
inConstructor: this[constructorSymbol]
|
|
1004
|
+
}), w(this, We, () => {
|
|
1005
|
+
l(this, Qt).call(this, l(this, K));
|
|
1006
|
+
}), w(this, Ie, () => {
|
|
1007
|
+
l(this, Qt).call(this, l(this, Q));
|
|
1008
|
+
}), this.effect = (i, r) => {
|
|
1009
|
+
l(this, K) || k(this, K, []);
|
|
1010
|
+
const o = {
|
|
1011
|
+
callback: i,
|
|
1012
|
+
getDep: r,
|
|
1013
|
+
initialized: l(this, B),
|
|
1014
|
+
inConstructor: this[Kt]
|
|
1457
1015
|
};
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
this.memo = (callback, getDep) => {
|
|
1465
|
-
if (!__privateGet$1(this, _memoList))
|
|
1466
|
-
__privateSet$1(this, _memoList, []);
|
|
1467
|
-
__privateGet$1(this, _memoList).push({
|
|
1468
|
-
callback,
|
|
1469
|
-
getDep,
|
|
1470
|
-
inConstructor: this[constructorSymbol]
|
|
1016
|
+
l(this, B) && (o.values = r == null ? void 0 : r(), o.preCallback = i(o.values)), l(this, K).push(o);
|
|
1017
|
+
}, this.memo = (i, r) => {
|
|
1018
|
+
l(this, Q) || k(this, Q, []), l(this, Q).push({
|
|
1019
|
+
callback: i,
|
|
1020
|
+
getDep: r,
|
|
1021
|
+
inConstructor: this[Kt]
|
|
1471
1022
|
});
|
|
1472
|
-
}
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
if (!initialized) {
|
|
1478
|
-
effectItem.values = getDep == null ? void 0 : getDep();
|
|
1479
|
-
effectItem.preCallback = callback(effectItem.values);
|
|
1480
|
-
effectItem.initialized = true;
|
|
1481
|
-
}
|
|
1023
|
+
}, w(this, Ve, () => {
|
|
1024
|
+
var i;
|
|
1025
|
+
(i = l(this, K)) == null || i.forEach((r) => {
|
|
1026
|
+
const { callback: o, getDep: a, initialized: c } = r;
|
|
1027
|
+
c || (r.values = a == null ? void 0 : a(), r.preCallback = o(r.values), r.initialized = !0);
|
|
1482
1028
|
});
|
|
1483
|
-
})
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
})
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
}
|
|
1501
|
-
});
|
|
1502
|
-
__privateAdd$1(this, _update, () => {
|
|
1503
|
-
if (__privateGet$1(this, _isAsync)) {
|
|
1504
|
-
asyncRenderTaskList.add(__privateGet$1(this, _updateCallback));
|
|
1505
|
-
} else {
|
|
1506
|
-
__privateGet$1(this, _updateCallback).call(this);
|
|
1507
|
-
}
|
|
1508
|
-
});
|
|
1509
|
-
this.update = () => {
|
|
1510
|
-
addMicrotask(__privateGet$1(this, _update));
|
|
1511
|
-
};
|
|
1512
|
-
__privateAdd$1(this, _updated, () => {
|
|
1513
|
-
var _a2;
|
|
1514
|
-
(_a2 = this.updated) == null ? void 0 : _a2.call(this);
|
|
1515
|
-
});
|
|
1516
|
-
__privateAdd$1(this, _disconnectStore, void 0);
|
|
1517
|
-
__privateAdd$1(this, _connectedCallback, () => {
|
|
1518
|
-
var _a2, _b2, _c;
|
|
1519
|
-
if (__privateGet$1(this, _isAppendReason)) {
|
|
1520
|
-
__privateSet$1(this, _isAppendReason, false);
|
|
1029
|
+
}), w(this, Xt, () => {
|
|
1030
|
+
l(this, Ie).call(this);
|
|
1031
|
+
const i = l(this, Ct) === this, r = this.render ? this.render() : i ? void 0 : G`<slot></slot>`;
|
|
1032
|
+
r !== void 0 && Kn(r, l(this, Ct));
|
|
1033
|
+
}), w(this, De, () => this.shouldUpdate ? this.shouldUpdate() : !0), w(this, Zt, () => {
|
|
1034
|
+
l(this, B) && l(this, De).call(this) && (l(this, Xt).call(this), I(l(this, qe)), I(l(this, We)));
|
|
1035
|
+
}), w(this, it, () => {
|
|
1036
|
+
l(this, $t) ? ce.add(l(this, Zt)) : l(this, Zt).call(this);
|
|
1037
|
+
}), this.update = () => {
|
|
1038
|
+
I(l(this, it));
|
|
1039
|
+
}, w(this, qe, () => {
|
|
1040
|
+
var i;
|
|
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);
|
|
1521
1046
|
return;
|
|
1522
1047
|
}
|
|
1523
|
-
Reflect.set(this,
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
}
|
|
1534
|
-
});
|
|
1535
|
-
__privateAdd$1(this, _clearEffect, (list) => {
|
|
1536
|
-
return list == null ? void 0 : list.filter((e) => {
|
|
1537
|
-
execCallback(e.preCallback);
|
|
1538
|
-
e.initialized = false;
|
|
1539
|
-
return e.inConstructor;
|
|
1540
|
-
});
|
|
1541
|
-
});
|
|
1542
|
-
addMicrotask(() => Reflect.set(this, initSymbol, false));
|
|
1543
|
-
Reflect.set(this, constructorSymbol, true);
|
|
1544
|
-
Reflect.set(this, initSymbol, true);
|
|
1545
|
-
Reflect.set(this, updateSymbol, () => {
|
|
1546
|
-
if (__privateGet$1(this, _isMounted)) {
|
|
1547
|
-
addMicrotask(__privateGet$1(this, _update));
|
|
1548
|
-
}
|
|
1549
|
-
});
|
|
1550
|
-
__privateSet$1(this, _isAsync, options.isAsync);
|
|
1551
|
-
__privateSet$1(this, _renderRoot, options.isLight ? this : this.attachShadow({
|
|
1552
|
-
mode: options.mode || "open",
|
|
1553
|
-
delegatesFocus: options.delegatesFocus,
|
|
1554
|
-
slotAssignment: options.slotAssignment
|
|
1048
|
+
Reflect.set(this, Kt, !1), (o = this.willMount) == null || o.call(this);
|
|
1049
|
+
const { observedStores: i, rootElement: r } = this.constructor;
|
|
1050
|
+
if (k(this, te, i == null ? void 0 : i.map((h) => ct(h, l(this, it)))), l(this, Xt).call(this), k(this, B, !0), k(this, Yt, (a = this.mounted) == null ? void 0 : a.call(this)), l(this, Ve).call(this), r && this.isConnected && ((c = this.getRootNode().host) == null ? void 0 : c.tagName) !== r.toUpperCase())
|
|
1051
|
+
throw new tt("not allow current root type");
|
|
1052
|
+
}), w(this, ne, (i) => i == null ? void 0 : i.filter((r) => (Le(r.preCallback), r.initialized = !1, r.inConstructor))), I(() => Reflect.set(this, he, !1)), Reflect.set(this, Kt, !0), Reflect.set(this, he, !0), Reflect.set(this, Zn, () => {
|
|
1053
|
+
l(this, B) && I(l(this, it));
|
|
1054
|
+
}), k(this, $t, t.isAsync), k(this, Ct, t.isLight ? this : this.attachShadow({
|
|
1055
|
+
mode: t.mode || "open",
|
|
1056
|
+
delegatesFocus: t.delegatesFocus,
|
|
1057
|
+
slotAssignment: t.slotAssignment
|
|
1555
1058
|
}));
|
|
1556
|
-
let
|
|
1059
|
+
let e;
|
|
1557
1060
|
this.effect(
|
|
1558
|
-
([
|
|
1559
|
-
if (
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
if (options.focusable && !hasInitTabIndex) {
|
|
1563
|
-
this.tabIndex = -Number(disabled);
|
|
1564
|
-
}
|
|
1565
|
-
if ((options.focusable || options.delegatesFocus) && disabled) {
|
|
1566
|
-
return addListener(this, "click", (e) => e.isTrusted && e.stopImmediatePropagation(), {
|
|
1567
|
-
capture: true
|
|
1061
|
+
([i = !1]) => {
|
|
1062
|
+
if (e === void 0 && (e = this.hasAttribute("tabindex")), this.internals.ariaDisabled = String(i), t.focusable && !e && (this.tabIndex = -Number(i)), (t.focusable || t.delegatesFocus) && i)
|
|
1063
|
+
return Jn(this, "click", (r) => r.isTrusted && r.stopImmediatePropagation(), {
|
|
1064
|
+
capture: !0
|
|
1568
1065
|
});
|
|
1569
|
-
}
|
|
1570
1066
|
},
|
|
1571
1067
|
() => [Reflect.get(this, "disabled")]
|
|
1572
1068
|
);
|
|
1573
|
-
const { adoptedStyleSheets } = new.target;
|
|
1574
|
-
if (
|
|
1575
|
-
const
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
};
|
|
1586
|
-
},
|
|
1587
|
-
() => []
|
|
1588
|
-
);
|
|
1589
|
-
}
|
|
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
|
+
);
|
|
1590
1081
|
}
|
|
1591
1082
|
}
|
|
1592
1083
|
get internals() {
|
|
1593
|
-
if (!
|
|
1594
|
-
|
|
1084
|
+
if (!l(this, Y)) {
|
|
1085
|
+
k(this, Y, this.attachInternals());
|
|
1595
1086
|
try {
|
|
1596
|
-
|
|
1597
|
-
__privateGet$1(this, _internals).states.delete("foo");
|
|
1087
|
+
l(this, Y).states.add("foo"), l(this, Y).states.delete("foo");
|
|
1598
1088
|
} catch {
|
|
1599
|
-
Reflect.defineProperty(
|
|
1089
|
+
Reflect.defineProperty(l(this, Y), "states", {
|
|
1600
1090
|
value: {
|
|
1601
|
-
has: (
|
|
1602
|
-
add: (
|
|
1603
|
-
delete: (
|
|
1091
|
+
has: (t) => ot(t) in this.dataset,
|
|
1092
|
+
add: (t) => this.dataset[ot(t)] = "",
|
|
1093
|
+
delete: (t) => delete this.dataset[ot(t)]
|
|
1604
1094
|
}
|
|
1605
1095
|
});
|
|
1606
1096
|
}
|
|
1607
1097
|
}
|
|
1608
|
-
return
|
|
1098
|
+
return l(this, Y);
|
|
1609
1099
|
}
|
|
1100
|
+
/**
|
|
1101
|
+
* @private
|
|
1102
|
+
* @final
|
|
1103
|
+
* use `effect`
|
|
1104
|
+
*/
|
|
1610
1105
|
attributeChangedCallback() {
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
const isConstructor = typeof constructorOrTag === "function";
|
|
1618
|
-
const tagName = typeof constructorOrTag === "string" && constructorOrTag.toUpperCase();
|
|
1619
|
-
const getRootElement = (ele) => {
|
|
1620
|
-
const rootEle = ele.parentElement || ele.getRootNode().host;
|
|
1621
|
-
if (!rootEle)
|
|
1106
|
+
return l(this, B) && I(l(this, it)), l(Tt, ft);
|
|
1107
|
+
}
|
|
1108
|
+
closestElement(t) {
|
|
1109
|
+
const e = typeof t == "function", s = typeof t == "string" && t.toUpperCase(), i = (r) => {
|
|
1110
|
+
const o = r.parentElement || r.getRootNode().host;
|
|
1111
|
+
if (!o)
|
|
1622
1112
|
return null;
|
|
1623
|
-
if (
|
|
1624
|
-
if (
|
|
1625
|
-
return
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
}
|
|
1630
|
-
return getRootElement(rootEle);
|
|
1113
|
+
if (e) {
|
|
1114
|
+
if (o.constructor === t)
|
|
1115
|
+
return o;
|
|
1116
|
+
} else if (o.tagName === s)
|
|
1117
|
+
return o;
|
|
1118
|
+
return i(o);
|
|
1631
1119
|
};
|
|
1632
|
-
return
|
|
1120
|
+
return i(this);
|
|
1633
1121
|
}
|
|
1122
|
+
/**
|
|
1123
|
+
* @private
|
|
1124
|
+
* @final
|
|
1125
|
+
* use `mounted`; 允许手动调用 `connectedCallback` 以清除装饰器定义的字段
|
|
1126
|
+
*/
|
|
1634
1127
|
connectedCallback() {
|
|
1635
|
-
|
|
1636
|
-
asyncRenderTaskList.add(__privateGet$1(this, _connectedCallback));
|
|
1637
|
-
} else {
|
|
1638
|
-
__privateGet$1(this, _connectedCallback).call(this);
|
|
1639
|
-
}
|
|
1640
|
-
return __privateGet$1(_GemElement, _final);
|
|
1128
|
+
return this.isConnected && l(this, $t) ? ce.add(l(this, ee)) : l(this, ee).call(this), l(Tt, ft);
|
|
1641
1129
|
}
|
|
1130
|
+
/**
|
|
1131
|
+
* @private
|
|
1132
|
+
* @final
|
|
1133
|
+
*/
|
|
1642
1134
|
adoptedCallback() {
|
|
1643
|
-
return
|
|
1135
|
+
return l(Tt, ft);
|
|
1644
1136
|
}
|
|
1137
|
+
/**
|
|
1138
|
+
* @private
|
|
1139
|
+
* @final
|
|
1140
|
+
* use `unmounted`
|
|
1141
|
+
*/
|
|
1645
1142
|
disconnectedCallback() {
|
|
1646
|
-
var
|
|
1143
|
+
var t, e;
|
|
1647
1144
|
if (this.isConnected) {
|
|
1648
|
-
|
|
1145
|
+
k(this, Pt, !0);
|
|
1649
1146
|
return;
|
|
1650
1147
|
}
|
|
1651
|
-
|
|
1652
|
-
(_a2 = __privateGet$1(this, _disconnectStore)) == null ? void 0 : _a2.forEach((disconnect2) => disconnect2());
|
|
1653
|
-
execCallback(__privateGet$1(this, _unmountCallback));
|
|
1654
|
-
(_b2 = this.unmounted) == null ? void 0 : _b2.call(this);
|
|
1655
|
-
__privateSet$1(this, _effectList, __privateGet$1(this, _clearEffect).call(this, __privateGet$1(this, _effectList)));
|
|
1656
|
-
__privateSet$1(this, _memoList, __privateGet$1(this, _clearEffect).call(this, __privateGet$1(this, _memoList)));
|
|
1657
|
-
return __privateGet$1(_GemElement, _final);
|
|
1148
|
+
return k(this, B, !1), (t = l(this, te)) == null || t.forEach((s) => s()), Le(l(this, Yt)), (e = this.unmounted) == null || e.call(this), k(this, K, l(this, ne).call(this, l(this, K))), k(this, Q, l(this, ne).call(this, l(this, Q))), l(Tt, ft);
|
|
1658
1149
|
}
|
|
1659
1150
|
};
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
const
|
|
1684
|
-
function
|
|
1685
|
-
const { booleanAttributes, numberAttributes } =
|
|
1686
|
-
Object.defineProperty(
|
|
1687
|
-
configurable:
|
|
1151
|
+
ft = /* @__PURE__ */ new WeakMap();
|
|
1152
|
+
Ct = /* @__PURE__ */ new WeakMap();
|
|
1153
|
+
Y = /* @__PURE__ */ new WeakMap();
|
|
1154
|
+
Pt = /* @__PURE__ */ new WeakMap();
|
|
1155
|
+
B = /* @__PURE__ */ new WeakMap();
|
|
1156
|
+
$t = /* @__PURE__ */ new WeakMap();
|
|
1157
|
+
K = /* @__PURE__ */ new WeakMap();
|
|
1158
|
+
Q = /* @__PURE__ */ new WeakMap();
|
|
1159
|
+
Yt = /* @__PURE__ */ new WeakMap();
|
|
1160
|
+
Qt = /* @__PURE__ */ new WeakMap();
|
|
1161
|
+
We = /* @__PURE__ */ new WeakMap();
|
|
1162
|
+
Ie = /* @__PURE__ */ new WeakMap();
|
|
1163
|
+
Ve = /* @__PURE__ */ new WeakMap();
|
|
1164
|
+
Xt = /* @__PURE__ */ new WeakMap();
|
|
1165
|
+
De = /* @__PURE__ */ new WeakMap();
|
|
1166
|
+
Zt = /* @__PURE__ */ new WeakMap();
|
|
1167
|
+
it = /* @__PURE__ */ new WeakMap();
|
|
1168
|
+
qe = /* @__PURE__ */ new WeakMap();
|
|
1169
|
+
te = /* @__PURE__ */ new WeakMap();
|
|
1170
|
+
ee = /* @__PURE__ */ new WeakMap();
|
|
1171
|
+
ne = /* @__PURE__ */ new WeakMap();
|
|
1172
|
+
w(ts, ft, Symbol());
|
|
1173
|
+
let A = ts;
|
|
1174
|
+
const le = new Us();
|
|
1175
|
+
function nn(n, t, e) {
|
|
1176
|
+
const { booleanAttributes: s, numberAttributes: i } = n.constructor;
|
|
1177
|
+
Object.defineProperty(n, t, {
|
|
1178
|
+
configurable: !0,
|
|
1688
1179
|
get() {
|
|
1689
|
-
if (!(
|
|
1180
|
+
if (!(he in this))
|
|
1690
1181
|
return;
|
|
1691
|
-
const
|
|
1692
|
-
|
|
1693
|
-
if (booleanAttributes == null ? void 0 : booleanAttributes.has(attr)) {
|
|
1694
|
-
return value === null ? false : true;
|
|
1695
|
-
}
|
|
1696
|
-
if (numberAttributes == null ? void 0 : numberAttributes.has(attr)) {
|
|
1697
|
-
return Number(value);
|
|
1698
|
-
}
|
|
1699
|
-
return value || "";
|
|
1182
|
+
const o = this.getAttribute(e);
|
|
1183
|
+
return s != null && s.has(e) ? o !== null : i != null && i.has(e) ? Number(o) : o || "";
|
|
1700
1184
|
},
|
|
1701
|
-
set(
|
|
1702
|
-
const
|
|
1703
|
-
|
|
1704
|
-
const hasSet = proxy[prop];
|
|
1705
|
-
const value = that.getAttribute(attr);
|
|
1706
|
-
if (this[initSymbol] && value !== null && !hasSet)
|
|
1185
|
+
set(r) {
|
|
1186
|
+
const o = this, a = le.get(this), c = a[t], h = o.getAttribute(e);
|
|
1187
|
+
if (this[he] && h !== null && !c)
|
|
1707
1188
|
return;
|
|
1708
|
-
|
|
1709
|
-
const
|
|
1710
|
-
|
|
1711
|
-
that.removeAttribute(attr);
|
|
1712
|
-
} else if (isBool) {
|
|
1713
|
-
that.toggleAttribute(attr, !!v);
|
|
1714
|
-
} else {
|
|
1715
|
-
if (value !== String(v))
|
|
1716
|
-
that.setAttribute(attr, String(v));
|
|
1717
|
-
}
|
|
1189
|
+
a[t] = !0;
|
|
1190
|
+
const p = s == null ? void 0 : s.has(e);
|
|
1191
|
+
r == null ? o.removeAttribute(e) : p ? o.toggleAttribute(e, !!r) : h !== String(r) && o.setAttribute(e, String(r));
|
|
1718
1192
|
}
|
|
1719
1193
|
});
|
|
1720
1194
|
}
|
|
1721
|
-
const
|
|
1722
|
-
function
|
|
1723
|
-
Object.defineProperty(
|
|
1724
|
-
configurable:
|
|
1195
|
+
const Nn = Symbol("event handle");
|
|
1196
|
+
function Dt(n, t, e, s) {
|
|
1197
|
+
Object.defineProperty(n, t, {
|
|
1198
|
+
configurable: !0,
|
|
1725
1199
|
get() {
|
|
1726
|
-
const
|
|
1727
|
-
|
|
1728
|
-
return value;
|
|
1729
|
-
} else {
|
|
1730
|
-
this[prop] = emptyFunction;
|
|
1731
|
-
return this[prop];
|
|
1732
|
-
}
|
|
1200
|
+
const i = le.get(this)[t];
|
|
1201
|
+
return i || !e ? i : (this[t] = Qs, this[t]);
|
|
1733
1202
|
},
|
|
1734
|
-
set(
|
|
1735
|
-
const
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
const evt = new CustomEvent(event, { ...options, ...eventOptions, detail });
|
|
1741
|
-
that.dispatchEvent(evt);
|
|
1742
|
-
v(detail, options);
|
|
1743
|
-
};
|
|
1744
|
-
Reflect.set(proxy[prop], isEventHandleSymbol, true);
|
|
1745
|
-
} else {
|
|
1746
|
-
proxy[prop] = v;
|
|
1747
|
-
this[updateSymbol]();
|
|
1748
|
-
}
|
|
1749
|
-
}
|
|
1203
|
+
set(i) {
|
|
1204
|
+
const r = this, o = le.get(r);
|
|
1205
|
+
i !== o[t] && (e ? (o[t] = i != null && i[Nn] ? i : (a, c) => {
|
|
1206
|
+
const h = new CustomEvent(e, { ...c, ...s, detail: a });
|
|
1207
|
+
r.dispatchEvent(h), i(a, c);
|
|
1208
|
+
}, Reflect.set(o[t], Nn, !0)) : (o[t] = i, this[Zn]()));
|
|
1750
1209
|
}
|
|
1751
1210
|
});
|
|
1752
1211
|
}
|
|
1753
|
-
function
|
|
1754
|
-
Object.defineProperty(
|
|
1755
|
-
configurable:
|
|
1212
|
+
function sn(n, t, e) {
|
|
1213
|
+
Object.defineProperty(n, t, {
|
|
1214
|
+
configurable: !0,
|
|
1756
1215
|
get() {
|
|
1757
|
-
const
|
|
1758
|
-
let
|
|
1759
|
-
if (!
|
|
1760
|
-
const
|
|
1761
|
-
|
|
1762
|
-
refobject2 = {
|
|
1216
|
+
const s = le.get(this);
|
|
1217
|
+
let i = s[t];
|
|
1218
|
+
if (!i) {
|
|
1219
|
+
const r = this, o = r.shadowRoot || r;
|
|
1220
|
+
i = {
|
|
1763
1221
|
get ref() {
|
|
1764
|
-
return
|
|
1222
|
+
return e;
|
|
1765
1223
|
},
|
|
1766
1224
|
get element() {
|
|
1767
|
-
const
|
|
1768
|
-
for (const
|
|
1769
|
-
const
|
|
1770
|
-
if (
|
|
1771
|
-
return
|
|
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;
|
|
1772
1230
|
}
|
|
1773
1231
|
}
|
|
1774
|
-
};
|
|
1775
|
-
proxy[prop] = refobject2;
|
|
1232
|
+
}, s[t] = i;
|
|
1776
1233
|
}
|
|
1777
|
-
return
|
|
1234
|
+
return i;
|
|
1778
1235
|
}
|
|
1779
1236
|
});
|
|
1780
1237
|
}
|
|
1781
|
-
function
|
|
1782
|
-
Object.defineProperty(
|
|
1783
|
-
configurable:
|
|
1238
|
+
function rn(n, t, e) {
|
|
1239
|
+
Object.defineProperty(n, t, {
|
|
1240
|
+
configurable: !0,
|
|
1784
1241
|
get() {
|
|
1785
|
-
const
|
|
1786
|
-
|
|
1787
|
-
return states == null ? void 0 : states.has(state2);
|
|
1242
|
+
const s = this, { states: i } = s.internals;
|
|
1243
|
+
return i == null ? void 0 : i.has(e);
|
|
1788
1244
|
},
|
|
1789
|
-
set(
|
|
1790
|
-
const
|
|
1791
|
-
|
|
1792
|
-
if (v) {
|
|
1793
|
-
states == null ? void 0 : states.add(state2);
|
|
1794
|
-
} else {
|
|
1795
|
-
states == null ? void 0 : states.delete(state2);
|
|
1796
|
-
}
|
|
1245
|
+
set(s) {
|
|
1246
|
+
const i = this, { states: r } = i.internals;
|
|
1247
|
+
s ? r == null || r.add(e) : r == null || r.delete(e);
|
|
1797
1248
|
}
|
|
1798
1249
|
});
|
|
1799
1250
|
}
|
|
1800
|
-
const
|
|
1801
|
-
customElements.define = (
|
|
1802
|
-
if (
|
|
1803
|
-
const { observedAttributes, observedProperties, defineEvents, defineCSSStates, defineRefs } =
|
|
1804
|
-
|
|
1805
|
-
observedProperties == null ? void 0 : observedProperties.forEach((prop) => defineProperty(cls.prototype, prop));
|
|
1806
|
-
defineEvents == null ? void 0 : defineEvents.forEach((event) => defineProperty(cls.prototype, kebabToCamelCase(event), event));
|
|
1807
|
-
defineCSSStates == null ? void 0 : defineCSSStates.forEach((state2) => defineCSSState(cls.prototype, kebabToCamelCase(state2), state2));
|
|
1808
|
-
defineRefs == null ? void 0 : defineRefs.forEach((ref) => defineRef(cls.prototype, kebabToCamelCase(ref), ref));
|
|
1809
|
-
}
|
|
1810
|
-
nativeDefineElement(name, cls, options);
|
|
1811
|
-
};
|
|
1812
|
-
if (window.__GEM_DEVTOOLS__HOOK__) {
|
|
1813
|
-
Object.assign(window.__GEM_DEVTOOLS__HOOK__, { ...GemExports, ...VersionExports });
|
|
1814
|
-
}
|
|
1815
|
-
function pushStaticField(target, field, member, isSet = false) {
|
|
1816
|
-
const cls = target.constructor;
|
|
1817
|
-
const current = cls[field];
|
|
1818
|
-
if (!cls.hasOwnProperty(field)) {
|
|
1819
|
-
Object.defineProperty(cls, field, {
|
|
1820
|
-
value: isSet ? new Set(current) : current ? Array.from(current) : []
|
|
1821
|
-
});
|
|
1251
|
+
const on = customElements.define.bind(customElements);
|
|
1252
|
+
customElements.define = (n, t, e) => {
|
|
1253
|
+
if (t.prototype instanceof A) {
|
|
1254
|
+
const { observedAttributes: s, observedProperties: i, defineEvents: r, defineCSSStates: o, defineRefs: a } = t;
|
|
1255
|
+
s == null || s.forEach((c) => nn(t.prototype, ot(c), c)), i == null || i.forEach((c) => Dt(t.prototype, c)), r == null || r.forEach((c) => Dt(t.prototype, ot(c), c)), o == null || o.forEach((c) => rn(t.prototype, ot(c), c)), a == null || a.forEach((c) => sn(t.prototype, ot(c), c));
|
|
1822
1256
|
}
|
|
1823
|
-
|
|
1257
|
+
on(n, t, e);
|
|
1258
|
+
};
|
|
1259
|
+
window.__GEM_DEVTOOLS__HOOK__ && Object.assign(window.__GEM_DEVTOOLS__HOOK__, { ...Ts, ...zs });
|
|
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);
|
|
1824
1265
|
}
|
|
1825
|
-
function
|
|
1826
|
-
const
|
|
1827
|
-
|
|
1828
|
-
defineRef(target, prop, ref);
|
|
1266
|
+
function zi(n, t) {
|
|
1267
|
+
const e = `${j(t)}-${ve()}`;
|
|
1268
|
+
D(n, "defineRefs", e), sn(n, t, e);
|
|
1829
1269
|
}
|
|
1830
|
-
function
|
|
1831
|
-
|
|
1832
|
-
defineAttribute(target, prop, attr);
|
|
1270
|
+
function an(n, t, e) {
|
|
1271
|
+
D(n, "observedAttributes", e), nn(n, t, e);
|
|
1833
1272
|
}
|
|
1834
|
-
function
|
|
1835
|
-
|
|
1273
|
+
function C(n, t) {
|
|
1274
|
+
an(n, t, j(t));
|
|
1836
1275
|
}
|
|
1837
|
-
function
|
|
1838
|
-
const
|
|
1839
|
-
|
|
1840
|
-
defineAttr(target, prop, attr);
|
|
1276
|
+
function es(n, t) {
|
|
1277
|
+
const e = j(t);
|
|
1278
|
+
D(n, "booleanAttributes", e, !0), an(n, t, e);
|
|
1841
1279
|
}
|
|
1842
|
-
function
|
|
1843
|
-
const
|
|
1844
|
-
|
|
1845
|
-
defineAttr(target, prop, attr);
|
|
1280
|
+
function Ji(n, t) {
|
|
1281
|
+
const e = j(t);
|
|
1282
|
+
D(n, "numberAttributes", e, !0), an(n, t, e);
|
|
1846
1283
|
}
|
|
1847
|
-
function
|
|
1848
|
-
|
|
1849
|
-
defineProperty(target, prop);
|
|
1284
|
+
function N(n, t) {
|
|
1285
|
+
D(n, "observedProperties", t), Dt(n, t);
|
|
1850
1286
|
}
|
|
1851
|
-
function
|
|
1852
|
-
const
|
|
1853
|
-
|
|
1854
|
-
defineCSSState(target, prop, attr);
|
|
1287
|
+
function cn(n, t) {
|
|
1288
|
+
const e = j(t);
|
|
1289
|
+
D(n, "defineCSSStates", e), rn(n, t, e);
|
|
1855
1290
|
}
|
|
1856
|
-
function
|
|
1857
|
-
const
|
|
1858
|
-
|
|
1859
|
-
pushStaticField(target instanceof GemElement ? target : target.prototype, "defineSlots", attr);
|
|
1291
|
+
function Yi(n, t) {
|
|
1292
|
+
const e = j(n[t] || t);
|
|
1293
|
+
n[t] = e, D(n instanceof A ? n : n.prototype, "defineSlots", e);
|
|
1860
1294
|
}
|
|
1861
|
-
function
|
|
1862
|
-
const
|
|
1863
|
-
|
|
1864
|
-
pushStaticField(target instanceof GemElement ? target : target.prototype, "defineParts", attr);
|
|
1295
|
+
function Xs(n, t) {
|
|
1296
|
+
const e = j(n[t] || t);
|
|
1297
|
+
n[t] = e, D(n instanceof A ? n : n.prototype, "defineParts", e);
|
|
1865
1298
|
}
|
|
1866
|
-
function
|
|
1867
|
-
|
|
1299
|
+
function Se(n, t) {
|
|
1300
|
+
ns(n, t);
|
|
1868
1301
|
}
|
|
1869
|
-
function
|
|
1870
|
-
|
|
1302
|
+
function Qi(n, t) {
|
|
1303
|
+
ns(n, t, { bubbles: !0, composed: !0 });
|
|
1871
1304
|
}
|
|
1872
|
-
function
|
|
1873
|
-
const
|
|
1874
|
-
|
|
1875
|
-
defineProperty(target, prop, event, options);
|
|
1305
|
+
function ns(n, t, e) {
|
|
1306
|
+
const s = j(t);
|
|
1307
|
+
D(n, "defineEvents", s), Dt(n, t, s, e);
|
|
1876
1308
|
}
|
|
1877
|
-
function
|
|
1878
|
-
return function(
|
|
1879
|
-
|
|
1880
|
-
pushStaticField(con.prototype, "adoptedStyleSheets", style);
|
|
1309
|
+
function Xi(n) {
|
|
1310
|
+
return function(t) {
|
|
1311
|
+
D(t.prototype, "adoptedStyleSheets", n);
|
|
1881
1312
|
};
|
|
1882
1313
|
}
|
|
1883
|
-
function
|
|
1884
|
-
return function(
|
|
1885
|
-
|
|
1886
|
-
pushStaticField(con.prototype, "observedStores", store2);
|
|
1314
|
+
function hn(n) {
|
|
1315
|
+
return function(t) {
|
|
1316
|
+
D(t.prototype, "observedStores", n);
|
|
1887
1317
|
};
|
|
1888
1318
|
}
|
|
1889
|
-
function
|
|
1890
|
-
return function(
|
|
1891
|
-
const
|
|
1892
|
-
|
|
1319
|
+
function Zi(n) {
|
|
1320
|
+
return function(t) {
|
|
1321
|
+
const e = t;
|
|
1322
|
+
e.rootElement = n;
|
|
1893
1323
|
};
|
|
1894
1324
|
}
|
|
1895
|
-
function
|
|
1896
|
-
return function(
|
|
1897
|
-
|
|
1325
|
+
function tr(n) {
|
|
1326
|
+
return function(t) {
|
|
1327
|
+
on(n, t);
|
|
1898
1328
|
};
|
|
1899
1329
|
}
|
|
1900
|
-
const
|
|
1901
|
-
|
|
1902
|
-
const
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
$hasCloseHandle: false,
|
|
1907
|
-
$hasOpenHandle: false,
|
|
1908
|
-
$hasShouldCloseHandle: false,
|
|
1330
|
+
const O = window.history, ss = O.pushState.bind(O), is = O.replaceState.bind(O);
|
|
1331
|
+
let Zs = 0;
|
|
1332
|
+
const ln = () => `${performance.now()}-${++Zs}`, [E, pt] = en({
|
|
1333
|
+
$hasCloseHandle: !1,
|
|
1334
|
+
$hasOpenHandle: !1,
|
|
1335
|
+
$hasShouldCloseHandle: !1,
|
|
1909
1336
|
$key: ""
|
|
1910
|
-
});
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
}
|
|
1933
|
-
function
|
|
1934
|
-
|
|
1935
|
-
}
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
const
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
const hash = decodeURIComponent((_b2 = params.hash) != null ? _b2 : !urlChanged && statusChanged ? location.hash : "");
|
|
1947
|
-
return { ...params, title, path, query, hash };
|
|
1948
|
-
}
|
|
1949
|
-
function updateHistory(p, native) {
|
|
1950
|
-
validData(p.data);
|
|
1951
|
-
const params = normalizeParams(p);
|
|
1952
|
-
const { title, path, query, hash, close, open: open2, shouldClose, data } = params;
|
|
1953
|
-
const state2 = {
|
|
1954
|
-
$hasCloseHandle: !!close,
|
|
1955
|
-
$hasOpenHandle: !!open2,
|
|
1956
|
-
$hasShouldCloseHandle: !!shouldClose,
|
|
1957
|
-
$key: getKey(),
|
|
1958
|
-
$title: title,
|
|
1959
|
-
...data
|
|
1960
|
-
};
|
|
1961
|
-
paramsMap.set(state2.$key, params);
|
|
1962
|
-
dispatchBeforeChangeEvent();
|
|
1963
|
-
cleanObject(store);
|
|
1964
|
-
updateHistoryStore(state2);
|
|
1965
|
-
const url = getUrlBarPath(path) + new QueryString(query) + hash;
|
|
1966
|
-
const prevHash = decodeURIComponent(location.hash);
|
|
1967
|
-
native(state2, title, url);
|
|
1968
|
-
if (prevHash !== hash)
|
|
1969
|
-
window.dispatchEvent(new CustomEvent("hashchange"));
|
|
1970
|
-
}
|
|
1971
|
-
function updateHistoryByNative(data, title, originUrl, native) {
|
|
1972
|
-
validData(data);
|
|
1973
|
-
const state2 = {
|
|
1974
|
-
$key: getKey(),
|
|
1975
|
-
$title: title,
|
|
1976
|
-
...data || {}
|
|
1337
|
+
}), $ = /* @__PURE__ */ new Map();
|
|
1338
|
+
function rs(n) {
|
|
1339
|
+
const { $key: t, $hasCloseHandle: e, $hasOpenHandle: s, $hasShouldCloseHandle: i } = n || {};
|
|
1340
|
+
if (E.$key !== t) {
|
|
1341
|
+
if (t)
|
|
1342
|
+
throw new tt("`$key` is not allowed");
|
|
1343
|
+
if (e)
|
|
1344
|
+
throw new tt("`$hasCloseHandle` is not allowed");
|
|
1345
|
+
if (s)
|
|
1346
|
+
throw new tt("`$hasOpenHandle` is not allowed");
|
|
1347
|
+
if (i)
|
|
1348
|
+
throw new tt("`$hasShouldCloseHandle` is not allowed");
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
function os(n) {
|
|
1352
|
+
return R.basePath ? R.basePath + n : n;
|
|
1353
|
+
}
|
|
1354
|
+
function Ge(n) {
|
|
1355
|
+
return n === R.basePath ? "/" : n.replace(new RegExp(`^${R.basePath}/`), "/");
|
|
1356
|
+
}
|
|
1357
|
+
function un() {
|
|
1358
|
+
R.dispatchEvent(new CustomEvent("beforechange"));
|
|
1359
|
+
}
|
|
1360
|
+
function ue(n) {
|
|
1361
|
+
const t = $.get(E.$key) || { path: Ge(location.pathname), query: new It() }, e = n.path ? zn(t.path, n.path) : Ge(location.pathname), s = new It(n.query ?? (n.path ? "" : location.search)), i = String(s) !== String(t.query), r = i ? s : t.query, o = e !== t.path || i, a = n.title || (o ? "" : document.title), c = n.close || n.data || n.open || n.shouldClose, h = decodeURIComponent(n.hash ?? (!o && c ? location.hash : ""));
|
|
1362
|
+
return { ...n, title: a, path: e, query: r, hash: h };
|
|
1363
|
+
}
|
|
1364
|
+
function Mn(n, t) {
|
|
1365
|
+
rs(n.data);
|
|
1366
|
+
const e = ue(n), { title: s, path: i, query: r, hash: o, close: a, open: c, shouldClose: h, data: p } = e, u = {
|
|
1367
|
+
$hasCloseHandle: !!a,
|
|
1368
|
+
$hasOpenHandle: !!c,
|
|
1369
|
+
$hasShouldCloseHandle: !!h,
|
|
1370
|
+
$key: ln(),
|
|
1371
|
+
$title: s,
|
|
1372
|
+
...p
|
|
1977
1373
|
};
|
|
1978
|
-
|
|
1979
|
-
const
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
const
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
const
|
|
1374
|
+
$.set(u.$key, e), un(), Ze(E), pt(u);
|
|
1375
|
+
const S = os(i) + new It(r) + o, d = decodeURIComponent(location.hash);
|
|
1376
|
+
t(u, s, S), d !== o && window.dispatchEvent(new CustomEvent("hashchange"));
|
|
1377
|
+
}
|
|
1378
|
+
function On(n, t, e, s) {
|
|
1379
|
+
rs(n);
|
|
1380
|
+
const i = {
|
|
1381
|
+
$key: ln(),
|
|
1382
|
+
$title: t,
|
|
1383
|
+
...n || {}
|
|
1384
|
+
}, { pathname: r, search: o, hash: a } = new URL(e, location.origin + location.pathname), c = ue({ path: r, query: new It(o), hash: a, title: t, data: n });
|
|
1385
|
+
$.set(i.$key, c), un(), Ze(E), pt(i);
|
|
1386
|
+
const h = os(r) + c.query + a, p = location.hash;
|
|
1387
|
+
s(i, t, h), p !== a && window.dispatchEvent(new CustomEvent("hashchange"));
|
|
1388
|
+
}
|
|
1389
|
+
const [as, ti] = en({
|
|
1991
1390
|
basePath: ""
|
|
1992
1391
|
});
|
|
1993
|
-
class
|
|
1392
|
+
class ei extends EventTarget {
|
|
1994
1393
|
get store() {
|
|
1995
|
-
return
|
|
1394
|
+
return E;
|
|
1996
1395
|
}
|
|
1997
1396
|
get currentKey() {
|
|
1998
|
-
return
|
|
1397
|
+
return E.$key;
|
|
1999
1398
|
}
|
|
2000
1399
|
get basePath() {
|
|
2001
|
-
return
|
|
1400
|
+
return as.basePath;
|
|
2002
1401
|
}
|
|
2003
|
-
set basePath(
|
|
2004
|
-
|
|
2005
|
-
Object.assign(paramsMap.get(store.$key), { path: getInternalPath(location.pathname) });
|
|
1402
|
+
set basePath(t) {
|
|
1403
|
+
ti({ basePath: t }), Object.assign($.get(E.$key), { path: Ge(location.pathname) });
|
|
2006
1404
|
}
|
|
2007
1405
|
getParams() {
|
|
2008
|
-
return
|
|
1406
|
+
return $.get(E.$key);
|
|
2009
1407
|
}
|
|
2010
|
-
updateParams(
|
|
2011
|
-
Object.assign(
|
|
2012
|
-
updateHistoryStore();
|
|
1408
|
+
updateParams(t) {
|
|
1409
|
+
Object.assign($.get(E.$key), t), pt();
|
|
2013
1410
|
}
|
|
2014
|
-
push(
|
|
2015
|
-
|
|
1411
|
+
push(t) {
|
|
1412
|
+
Mn(t, ss);
|
|
2016
1413
|
}
|
|
2017
|
-
replace(
|
|
2018
|
-
|
|
1414
|
+
replace(t) {
|
|
1415
|
+
Mn(t, is);
|
|
2019
1416
|
}
|
|
2020
|
-
pushIgnoreCloseHandle(
|
|
2021
|
-
var
|
|
2022
|
-
|
|
2023
|
-
(_b2 = (_a2 = paramsMap.get(store.$key)) == null ? void 0 : _a2.close) == null ? void 0 : _b2.call(_a2);
|
|
2024
|
-
this.replace(params);
|
|
2025
|
-
} else {
|
|
2026
|
-
this.push(params);
|
|
2027
|
-
}
|
|
1417
|
+
pushIgnoreCloseHandle(t) {
|
|
1418
|
+
var e, s;
|
|
1419
|
+
E.$hasCloseHandle ? ((s = (e = $.get(E.$key)) == null ? void 0 : e.close) == null || s.call(e), this.replace(t)) : this.push(t);
|
|
2028
1420
|
}
|
|
2029
1421
|
forward() {
|
|
2030
|
-
|
|
1422
|
+
O.forward();
|
|
2031
1423
|
}
|
|
2032
1424
|
back() {
|
|
2033
|
-
|
|
1425
|
+
O.back();
|
|
2034
1426
|
}
|
|
2035
1427
|
}
|
|
2036
|
-
const
|
|
2037
|
-
const [gemTitleStore, updateTitleStore] = useStore({ title: "" });
|
|
2038
|
-
const _GEMHISTORY = { history: gemHistory, titleStore: gemTitleStore, basePathStore: gemBasePathStore };
|
|
1428
|
+
const R = new ei(), [se, ni] = en({ title: "" }), si = { history: R, titleStore: se, basePathStore: as };
|
|
2039
1429
|
if (!window._GEMHISTORY) {
|
|
2040
|
-
window._GEMHISTORY =
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
}
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
connect(gemTitleStore, () => {
|
|
2069
|
-
const params = paramsMap.get(store.$key);
|
|
2070
|
-
if (params) {
|
|
2071
|
-
params.title = gemTitleStore.title;
|
|
2072
|
-
}
|
|
2073
|
-
});
|
|
2074
|
-
connect(store, () => {
|
|
2075
|
-
const { title } = gemHistory.getParams();
|
|
2076
|
-
if (title !== gemTitleStore.title) {
|
|
2077
|
-
updateTitleStore({ title });
|
|
2078
|
-
}
|
|
1430
|
+
if (window._GEMHISTORY = si, O.pushState = function(t, e, s) {
|
|
1431
|
+
On(t, e, s, ss);
|
|
1432
|
+
}, O.replaceState = function(t, e, s) {
|
|
1433
|
+
On(t, e, s, is);
|
|
1434
|
+
}, window.addEventListener("hashchange", ({ isTrusted: t }) => {
|
|
1435
|
+
t && R.replace({ hash: location.hash });
|
|
1436
|
+
}), O.state)
|
|
1437
|
+
if (O.state.$hasCloseHandle) {
|
|
1438
|
+
pt(O.state);
|
|
1439
|
+
const t = ue({ title: document.title });
|
|
1440
|
+
$.set(E.$key, t), R.back();
|
|
1441
|
+
} else {
|
|
1442
|
+
const t = ue({ title: document.title, hash: location.hash });
|
|
1443
|
+
pt({
|
|
1444
|
+
$key: ln(),
|
|
1445
|
+
...O.state || {}
|
|
1446
|
+
}), $.set(E.$key, t);
|
|
1447
|
+
}
|
|
1448
|
+
else {
|
|
1449
|
+
const { pathname: t, search: e, hash: s } = location;
|
|
1450
|
+
R.replace({ path: t, query: e, hash: s });
|
|
1451
|
+
}
|
|
1452
|
+
ct(se, () => {
|
|
1453
|
+
const t = $.get(E.$key);
|
|
1454
|
+
t && (t.title = se.title);
|
|
1455
|
+
}), ct(E, () => {
|
|
1456
|
+
const { title: t } = R.getParams();
|
|
1457
|
+
t !== se.title && ni({ title: t });
|
|
2079
1458
|
});
|
|
2080
|
-
let
|
|
2081
|
-
window.addEventListener("popstate", (
|
|
2082
|
-
var
|
|
2083
|
-
const
|
|
2084
|
-
if (!(
|
|
1459
|
+
let n = !1;
|
|
1460
|
+
window.addEventListener("popstate", (t) => {
|
|
1461
|
+
var r, o;
|
|
1462
|
+
const e = t.state;
|
|
1463
|
+
if (!(e != null && e.$key))
|
|
2085
1464
|
return;
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
navigating = false;
|
|
1465
|
+
if (n) {
|
|
1466
|
+
n = !1;
|
|
2089
1467
|
return;
|
|
2090
1468
|
}
|
|
2091
|
-
if (
|
|
2092
|
-
const { pathname, search, hash } = location;
|
|
2093
|
-
|
|
2094
|
-
path:
|
|
2095
|
-
query: new
|
|
2096
|
-
hash: decodeURIComponent(
|
|
2097
|
-
title:
|
|
2098
|
-
|
|
1469
|
+
if (!$.has(e.$key)) {
|
|
1470
|
+
const { pathname: a, search: c, hash: h } = location;
|
|
1471
|
+
$.set(e.$key, {
|
|
1472
|
+
path: a,
|
|
1473
|
+
query: new It(c),
|
|
1474
|
+
hash: decodeURIComponent(h),
|
|
1475
|
+
title: e.$title,
|
|
1476
|
+
// document.title 是导航前的
|
|
1477
|
+
data: e
|
|
2099
1478
|
});
|
|
2100
1479
|
}
|
|
2101
|
-
const
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
const shouldCloseHandle = prevParams == null ? void 0 : prevParams.shouldClose;
|
|
2109
|
-
const notAllowClose = shouldCloseHandle && !shouldCloseHandle();
|
|
2110
|
-
if (notAllowClose) {
|
|
2111
|
-
navigating = true;
|
|
2112
|
-
gemHistory.forward();
|
|
1480
|
+
const s = E;
|
|
1481
|
+
if (parseFloat(e.$key) > parseFloat(s.$key) && e.$hasOpenHandle)
|
|
1482
|
+
(o = (r = $.get(e.$key)) == null ? void 0 : r.open) == null || o.call(r);
|
|
1483
|
+
else if (s.$hasCloseHandle) {
|
|
1484
|
+
const a = $.get(s.$key), c = a == null ? void 0 : a.close, h = a == null ? void 0 : a.shouldClose;
|
|
1485
|
+
if (h && !h()) {
|
|
1486
|
+
n = !0, R.forward();
|
|
2113
1487
|
return;
|
|
2114
|
-
} else
|
|
2115
|
-
|
|
2116
|
-
closeHandle();
|
|
2117
|
-
} else if (newState.$hasCloseHandle) {
|
|
2118
|
-
navigating = true;
|
|
2119
|
-
gemHistory.back();
|
|
2120
|
-
}
|
|
2121
|
-
}
|
|
1488
|
+
} else
|
|
1489
|
+
c ? c() : e.$hasCloseHandle && (n = !0, R.back());
|
|
2122
1490
|
}
|
|
2123
|
-
|
|
2124
|
-
cleanObject(store);
|
|
2125
|
-
updateHistoryStore(newState);
|
|
1491
|
+
un(), Ze(E), pt(e);
|
|
2126
1492
|
});
|
|
2127
1493
|
}
|
|
2128
|
-
const { history, titleStore, basePathStore } = window._GEMHISTORY;
|
|
2129
|
-
var
|
|
2130
|
-
var
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
return result;
|
|
2139
|
-
};
|
|
2140
|
-
var __accessCheck2 = (obj, member, msg) => {
|
|
2141
|
-
if (!member.has(obj))
|
|
2142
|
-
throw TypeError("Cannot " + msg);
|
|
2143
|
-
};
|
|
2144
|
-
var __privateGet2 = (obj, member, getter) => {
|
|
2145
|
-
__accessCheck2(obj, member, "read from private field");
|
|
2146
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
2147
|
-
};
|
|
2148
|
-
var __privateAdd2 = (obj, member, value) => {
|
|
2149
|
-
if (member.has(obj))
|
|
1494
|
+
const { history: y, titleStore: qt, basePathStore: ii } = window._GEMHISTORY;
|
|
1495
|
+
var ri = Object.defineProperty, oi = Object.getOwnPropertyDescriptor, q = (n, t, e, s) => {
|
|
1496
|
+
for (var i = s > 1 ? void 0 : s ? oi(t, e) : t, r = n.length - 1, o; r >= 0; r--)
|
|
1497
|
+
(o = n[r]) && (i = (s ? o(t, e, i) : o(i)) || i);
|
|
1498
|
+
return s && i && ri(t, e, i), i;
|
|
1499
|
+
}, cs = (n, t, e) => {
|
|
1500
|
+
if (!t.has(n))
|
|
1501
|
+
throw TypeError("Cannot " + e);
|
|
1502
|
+
}, W = (n, t, e) => (cs(n, t, "read from private field"), e ? e.call(n) : t.get(n)), vt = (n, t, e) => {
|
|
1503
|
+
if (t.has(n))
|
|
2150
1504
|
throw TypeError("Cannot add the same private member more than once");
|
|
2151
|
-
|
|
2152
|
-
};
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
};
|
|
2158
|
-
var _lastLoader, _scrollContainer, scrollContainer_get, _updateLocationStore, _updateScrollContainerPosition, _setContent;
|
|
2159
|
-
const UNNAMED_PARAM_PREFIX = "_";
|
|
2160
|
-
class ParamsRegExp extends RegExp {
|
|
2161
|
-
constructor(pattern) {
|
|
2162
|
-
let i = 0;
|
|
1505
|
+
t instanceof WeakSet ? t.add(n) : t.set(n, e);
|
|
1506
|
+
}, Rn = (n, t, e, s) => (cs(n, t, "write to private field"), s ? s.call(n, e) : t.set(n, e), e), kt, rt, ut, ie, je, re;
|
|
1507
|
+
const hs = "_";
|
|
1508
|
+
class ai extends RegExp {
|
|
1509
|
+
constructor(t) {
|
|
1510
|
+
let e = 0;
|
|
2163
1511
|
super(
|
|
2164
|
-
`^${
|
|
2165
|
-
if (name === "*")
|
|
2166
|
-
return `(?<${UNNAMED_PARAM_PREFIX}${i++}>.*)`;
|
|
2167
|
-
return `(?<${name.slice(1)}>[^/]+)`;
|
|
2168
|
-
})}$`
|
|
1512
|
+
`^${t.replace(/((:[^/$]+)|(\*))/g, (s, i) => i === "*" ? `(?<${hs}${e++}>.*)` : `(?<${i.slice(1)}>[^/]+)`)}$`
|
|
2169
1513
|
);
|
|
2170
1514
|
}
|
|
2171
1515
|
}
|
|
2172
|
-
function
|
|
1516
|
+
function ls(n, t) {
|
|
2173
1517
|
if (window.URLPattern) {
|
|
2174
|
-
const
|
|
2175
|
-
|
|
2176
|
-
if (!matchResult2)
|
|
2177
|
-
return null;
|
|
2178
|
-
return matchResult2.pathname.groups;
|
|
2179
|
-
}
|
|
2180
|
-
const reg = new ParamsRegExp(pattern);
|
|
2181
|
-
const matchResult = path.match(reg) || `${path}/`.match(reg);
|
|
2182
|
-
if (!matchResult)
|
|
2183
|
-
return null;
|
|
2184
|
-
const params = {};
|
|
2185
|
-
if (matchResult.groups) {
|
|
2186
|
-
Object.entries(matchResult.groups).forEach(([key2, value]) => {
|
|
2187
|
-
params[key2.startsWith(UNNAMED_PARAM_PREFIX) ? key2.slice(1) : key2] = value;
|
|
2188
|
-
});
|
|
2189
|
-
}
|
|
2190
|
-
return params;
|
|
2191
|
-
}
|
|
2192
|
-
function createPath(route, options) {
|
|
2193
|
-
let path = route.pattern;
|
|
2194
|
-
const params = options == null ? void 0 : options.params;
|
|
2195
|
-
if (params) {
|
|
2196
|
-
Object.keys(params).forEach((key2) => {
|
|
2197
|
-
path = path.replace(new RegExp(`:${key2}`, "g"), params[key2]);
|
|
2198
|
-
});
|
|
1518
|
+
const r = new window.URLPattern({ pathname: n }), o = r.exec({ pathname: t }) || r.exec({ pathname: `${t}/` });
|
|
1519
|
+
return o ? o.pathname.groups : null;
|
|
2199
1520
|
}
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
const
|
|
1521
|
+
const e = new ai(n), s = t.match(e) || `${t}/`.match(e);
|
|
1522
|
+
if (!s)
|
|
1523
|
+
return null;
|
|
1524
|
+
const i = {};
|
|
1525
|
+
return s.groups && Object.entries(s.groups).forEach(([r, o]) => {
|
|
1526
|
+
i[r.startsWith(hs) ? r.slice(1) : r] = o;
|
|
1527
|
+
}), i;
|
|
1528
|
+
}
|
|
1529
|
+
function dn(n, t) {
|
|
1530
|
+
let e = 0, s = n.pattern.replaceAll("*", () => `:${e++}`);
|
|
1531
|
+
const i = t == null ? void 0 : t.params;
|
|
1532
|
+
return i && Object.keys(i).forEach((r) => {
|
|
1533
|
+
s = s.replace(new RegExp(`:${r}`, "g"), i[r]);
|
|
1534
|
+
}), s;
|
|
1535
|
+
}
|
|
1536
|
+
function ci(n, t) {
|
|
2204
1537
|
return {
|
|
2205
|
-
path,
|
|
2206
|
-
...
|
|
1538
|
+
path: dn(n, t),
|
|
1539
|
+
...t
|
|
2207
1540
|
};
|
|
2208
1541
|
}
|
|
2209
|
-
const
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
this.trigger = history;
|
|
2215
|
-
this.currentParams = {};
|
|
2216
|
-
__privateAdd2(this, _lastLoader, void 0);
|
|
2217
|
-
this.state = {
|
|
2218
|
-
content: void 0
|
|
2219
|
-
};
|
|
2220
|
-
__privateAdd2(this, _updateLocationStore, () => {
|
|
1542
|
+
const Ne = G``, An = /* @__PURE__ */ new Map(), T = class us extends A {
|
|
1543
|
+
constructor({ isLight: t, routes: e } = {}) {
|
|
1544
|
+
super({ isLight: t }), vt(this, rt), this.trigger = y, this.currentParams = {}, vt(this, kt, void 0), this.state = {
|
|
1545
|
+
content: Ne
|
|
1546
|
+
}, vt(this, ie, () => {
|
|
2221
1547
|
if (!this.locationStore)
|
|
2222
1548
|
return;
|
|
2223
|
-
const { path, query, hash, data } =
|
|
2224
|
-
|
|
2225
|
-
path,
|
|
1549
|
+
const { path: s, query: i, hash: r, data: o } = y.getParams();
|
|
1550
|
+
nt(this.locationStore, {
|
|
1551
|
+
path: s,
|
|
2226
1552
|
params: this.currentParams,
|
|
2227
|
-
query,
|
|
2228
|
-
hash,
|
|
2229
|
-
data
|
|
1553
|
+
query: i,
|
|
1554
|
+
hash: r,
|
|
1555
|
+
data: o
|
|
2230
1556
|
});
|
|
2231
|
-
})
|
|
2232
|
-
|
|
2233
|
-
if (!__privateGet2(this, _scrollContainer, scrollContainer_get))
|
|
1557
|
+
}), vt(this, je, () => {
|
|
1558
|
+
if (!W(this, rt, ut))
|
|
2234
1559
|
return;
|
|
2235
|
-
const
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
});
|
|
2242
|
-
__privateAdd2(this, _setContent, (route, params, content) => {
|
|
2243
|
-
this.beforeroutechange(route);
|
|
2244
|
-
__privateSet2(this, _lastLoader, void 0);
|
|
2245
|
-
this.currentRoute = route;
|
|
2246
|
-
this.currentParams = params;
|
|
2247
|
-
const changeContent = async () => {
|
|
2248
|
-
this.setState({ content });
|
|
2249
|
-
__privateGet2(this, _updateLocationStore).call(this);
|
|
2250
|
-
await Promise.resolve();
|
|
2251
|
-
__privateGet2(this, _updateScrollContainerPosition).call(this);
|
|
2252
|
-
this.routechange(this.currentRoute);
|
|
1560
|
+
const s = An.get(y.currentKey);
|
|
1561
|
+
s ? W(this, rt, ut).scroll(0, s) : (this.scrollIgnoreHash || !y.getParams().hash) && W(this, rt, ut).scroll(0, 0);
|
|
1562
|
+
}), vt(this, re, (s, i, r) => {
|
|
1563
|
+
this.beforeroutechange(s), Rn(this, kt, void 0), this.currentRoute = s, this.currentParams = i;
|
|
1564
|
+
const o = async () => {
|
|
1565
|
+
this.setState({ content: r }), W(this, ie).call(this), await Promise.resolve(), W(this, je).call(this), this.routechange(this.currentRoute);
|
|
2253
1566
|
};
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
}
|
|
2257
|
-
|
|
2258
|
-
}
|
|
2259
|
-
});
|
|
2260
|
-
this.update = () => {
|
|
2261
|
-
const { route, params = {} } = _GemRouteElement.findRoute(this.routes, this.trigger.getParams().path);
|
|
2262
|
-
const { redirect, content, getContent } = route || {};
|
|
2263
|
-
if (redirect) {
|
|
1567
|
+
this.transition && "startViewTransition" in document ? document.startViewTransition(() => o()) : o();
|
|
1568
|
+
}), this.update = () => {
|
|
1569
|
+
const { path: s, hash: i, query: r } = this.trigger.getParams(), { route: o, params: a = {} } = us.findRoute(this.routes, s), { redirect: c, content: h, getContent: p } = o || {};
|
|
1570
|
+
if (c) {
|
|
2264
1571
|
this.trigger.replace({
|
|
2265
|
-
path:
|
|
1572
|
+
path: dn({ pattern: c }, { params: a }),
|
|
1573
|
+
query: r,
|
|
1574
|
+
hash: i
|
|
2266
1575
|
});
|
|
2267
1576
|
return;
|
|
2268
1577
|
}
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
if (isSomeLoader())
|
|
2279
|
-
__privateGet2(this, _setContent).call(this, route, params, content2);
|
|
2280
|
-
}).catch((err) => {
|
|
2281
|
-
if (isSomeLoader())
|
|
2282
|
-
this.error(err);
|
|
1578
|
+
this.trigger === y && nt(qt, { title: o == null ? void 0 : o.title });
|
|
1579
|
+
const u = h || (p == null ? void 0 : p(a, this.shadowRoot || this));
|
|
1580
|
+
if (this.loading(o), u instanceof Promise) {
|
|
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);
|
|
2283
1587
|
});
|
|
2284
1588
|
return;
|
|
2285
1589
|
}
|
|
2286
|
-
|
|
2287
|
-
};
|
|
2288
|
-
this.routes = routes;
|
|
1590
|
+
W(this, re).call(this, o, a, u);
|
|
1591
|
+
}, this.routes = this.routes || e;
|
|
2289
1592
|
}
|
|
2290
1593
|
mounted() {
|
|
2291
1594
|
this.effect(
|
|
2292
1595
|
() => {
|
|
2293
|
-
if (
|
|
2294
|
-
return
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
);
|
|
1596
|
+
if (W(this, rt, ut))
|
|
1597
|
+
return Jn(
|
|
1598
|
+
y,
|
|
1599
|
+
"beforechange",
|
|
1600
|
+
() => An.set(y.currentKey, W(this, rt, ut).scrollTop)
|
|
1601
|
+
);
|
|
2300
1602
|
},
|
|
2301
1603
|
() => [this.scrollContainer]
|
|
2302
|
-
)
|
|
2303
|
-
|
|
2304
|
-
() =>
|
|
1604
|
+
), this.effect(
|
|
1605
|
+
// 触发 this.#update
|
|
1606
|
+
() => ct(this.trigger.store, () => this.setState({})),
|
|
2305
1607
|
() => [this.trigger]
|
|
2306
|
-
)
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
__privateGet2(this, _updateLocationStore).call(this);
|
|
1608
|
+
), this.effect(
|
|
1609
|
+
([t, e], s) => {
|
|
1610
|
+
if (s && t === s[0] && e === s[1]) {
|
|
1611
|
+
W(this, ie).call(this);
|
|
2311
1612
|
return;
|
|
2312
1613
|
}
|
|
2313
1614
|
this.update();
|
|
2314
1615
|
},
|
|
2315
1616
|
() => {
|
|
2316
|
-
const { path, query, hash } = this.trigger.getParams();
|
|
2317
|
-
return [this.key,
|
|
1617
|
+
const { path: t, query: e, hash: s } = this.trigger.getParams();
|
|
1618
|
+
return [this.key, t, e, s];
|
|
2318
1619
|
}
|
|
2319
1620
|
);
|
|
2320
1621
|
}
|
|
2321
1622
|
shouldUpdate() {
|
|
2322
|
-
return this.inert
|
|
1623
|
+
return !this.inert;
|
|
2323
1624
|
}
|
|
2324
1625
|
render() {
|
|
2325
|
-
const { content } = this.state;
|
|
2326
|
-
if (
|
|
2327
|
-
return
|
|
2328
|
-
return html`
|
|
1626
|
+
const { content: t } = this.state;
|
|
1627
|
+
if (t !== void 0)
|
|
1628
|
+
return this.shadowRoot ? G`
|
|
2329
1629
|
<style>
|
|
2330
1630
|
:host(:where(:not([hidden]))),
|
|
2331
1631
|
:not(:defined) {
|
|
2332
1632
|
display: contents;
|
|
2333
1633
|
}
|
|
2334
1634
|
</style>
|
|
2335
|
-
${
|
|
2336
|
-
`;
|
|
1635
|
+
${t === Ne ? G`<slot></slot>` : t}
|
|
1636
|
+
` : t === Ne ? void 0 : G`${t}`;
|
|
2337
1637
|
}
|
|
2338
1638
|
};
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
return typeof this.scrollContainer === "function" ? this.scrollContainer() : this.scrollContainer;
|
|
1639
|
+
kt = /* @__PURE__ */ new WeakMap();
|
|
1640
|
+
rt = /* @__PURE__ */ new WeakSet();
|
|
1641
|
+
ut = function() {
|
|
1642
|
+
return typeof this.scrollContainer == "function" ? this.scrollContainer() : this.scrollContainer;
|
|
2344
1643
|
};
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
const { path, query, hash, data } =
|
|
2350
|
-
return
|
|
1644
|
+
ie = /* @__PURE__ */ new WeakMap();
|
|
1645
|
+
je = /* @__PURE__ */ new WeakMap();
|
|
1646
|
+
re = /* @__PURE__ */ new WeakMap();
|
|
1647
|
+
T.createLocationStore = () => {
|
|
1648
|
+
const { path: n, query: t, hash: e, data: s } = y.getParams();
|
|
1649
|
+
return Ft({ path: n, query: t, hash: e, data: s, params: {} });
|
|
2351
1650
|
};
|
|
2352
|
-
|
|
2353
|
-
let
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
const params = matchPath(route.pattern, path);
|
|
2365
|
-
if (params) {
|
|
2366
|
-
return { route, params };
|
|
2367
|
-
}
|
|
2368
|
-
}
|
|
2369
|
-
}
|
|
2370
|
-
return { route: defaultRoute };
|
|
2371
|
-
};
|
|
2372
|
-
__decorateClass$6([
|
|
2373
|
-
boolattribute
|
|
2374
|
-
], GemRouteElement.prototype, "transition", 2);
|
|
2375
|
-
__decorateClass$6([
|
|
2376
|
-
property
|
|
2377
|
-
], GemRouteElement.prototype, "routes", 2);
|
|
2378
|
-
__decorateClass$6([
|
|
2379
|
-
property
|
|
2380
|
-
], GemRouteElement.prototype, "locationStore", 2);
|
|
2381
|
-
__decorateClass$6([
|
|
2382
|
-
property
|
|
2383
|
-
], GemRouteElement.prototype, "key", 2);
|
|
2384
|
-
__decorateClass$6([
|
|
2385
|
-
emitter
|
|
2386
|
-
], GemRouteElement.prototype, "loading", 2);
|
|
2387
|
-
__decorateClass$6([
|
|
2388
|
-
emitter
|
|
2389
|
-
], GemRouteElement.prototype, "beforeroutechange", 2);
|
|
2390
|
-
__decorateClass$6([
|
|
2391
|
-
emitter
|
|
2392
|
-
], GemRouteElement.prototype, "routechange", 2);
|
|
2393
|
-
__decorateClass$6([
|
|
2394
|
-
emitter
|
|
2395
|
-
], GemRouteElement.prototype, "error", 2);
|
|
2396
|
-
__decorateClass$6([
|
|
2397
|
-
property
|
|
2398
|
-
], GemRouteElement.prototype, "scrollContainer", 2);
|
|
2399
|
-
__decorateClass$6([
|
|
2400
|
-
property
|
|
2401
|
-
], GemRouteElement.prototype, "scrollIgnoreHash", 2);
|
|
2402
|
-
__decorateClass$6([
|
|
2403
|
-
property
|
|
2404
|
-
], GemRouteElement.prototype, "trigger", 2);
|
|
2405
|
-
class GemLightRouteElement extends GemRouteElement {
|
|
2406
|
-
constructor(options = {}) {
|
|
2407
|
-
super({ ...options, isLight: true });
|
|
2408
|
-
}
|
|
2409
|
-
}
|
|
2410
|
-
var __defProp$5 = Object.defineProperty;
|
|
2411
|
-
var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
|
|
2412
|
-
var __decorateClass$5 = (decorators, target, key2, kind) => {
|
|
2413
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key2) : target;
|
|
2414
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2415
|
-
if (decorator = decorators[i])
|
|
2416
|
-
result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
|
|
2417
|
-
if (kind && result)
|
|
2418
|
-
__defProp$5(target, key2, result);
|
|
2419
|
-
return result;
|
|
1651
|
+
T.findRoute = (n = [], t) => {
|
|
1652
|
+
let e = null, s;
|
|
1653
|
+
n instanceof Array ? s = n : s = Object.values(n);
|
|
1654
|
+
for (const i of s)
|
|
1655
|
+
if (i.pattern === "*")
|
|
1656
|
+
e = i;
|
|
1657
|
+
else {
|
|
1658
|
+
const r = ls(i.pattern, t);
|
|
1659
|
+
if (r)
|
|
1660
|
+
return { route: i, params: r };
|
|
1661
|
+
}
|
|
1662
|
+
return { route: e };
|
|
2420
1663
|
};
|
|
2421
|
-
|
|
2422
|
-
|
|
1664
|
+
q([
|
|
1665
|
+
es
|
|
1666
|
+
], T.prototype, "transition", 2);
|
|
1667
|
+
q([
|
|
1668
|
+
N
|
|
1669
|
+
], T.prototype, "routes", 2);
|
|
1670
|
+
q([
|
|
1671
|
+
N
|
|
1672
|
+
], T.prototype, "locationStore", 2);
|
|
1673
|
+
q([
|
|
1674
|
+
N
|
|
1675
|
+
], T.prototype, "key", 2);
|
|
1676
|
+
q([
|
|
1677
|
+
Se
|
|
1678
|
+
], T.prototype, "loading", 2);
|
|
1679
|
+
q([
|
|
1680
|
+
Se
|
|
1681
|
+
], T.prototype, "beforeroutechange", 2);
|
|
1682
|
+
q([
|
|
1683
|
+
Se
|
|
1684
|
+
], T.prototype, "routechange", 2);
|
|
1685
|
+
q([
|
|
1686
|
+
Se
|
|
1687
|
+
], T.prototype, "error", 2);
|
|
1688
|
+
q([
|
|
1689
|
+
N
|
|
1690
|
+
], T.prototype, "scrollContainer", 2);
|
|
1691
|
+
q([
|
|
1692
|
+
N
|
|
1693
|
+
], T.prototype, "scrollIgnoreHash", 2);
|
|
1694
|
+
q([
|
|
1695
|
+
N
|
|
1696
|
+
], T.prototype, "trigger", 2);
|
|
1697
|
+
let ds = T;
|
|
1698
|
+
class hi extends ds {
|
|
1699
|
+
constructor(t = {}) {
|
|
1700
|
+
super({ ...t, isLight: !0 });
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
var li = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, b = (n, t, e, s) => {
|
|
1704
|
+
for (var i = s > 1 ? void 0 : s ? ui(t, e) : t, r = n.length - 1, o; r >= 0; r--)
|
|
1705
|
+
(o = n[r]) && (i = (s ? o(t, e, i) : o(i)) || i);
|
|
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("/");
|
|
2423
1717
|
}
|
|
2424
|
-
let
|
|
1718
|
+
let x = class extends A {
|
|
2425
1719
|
constructor() {
|
|
2426
|
-
super({ focusable:
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
__privateAdd(this, _preventDefault, void 0);
|
|
2431
|
-
__privateAdd(this, _getHint, void 0);
|
|
2432
|
-
__privateSet(this, _onClick, async () => {
|
|
2433
|
-
var _a2;
|
|
2434
|
-
const locationString = this.getLocationString();
|
|
2435
|
-
if (!locationString)
|
|
1720
|
+
super({ focusable: !0 }), St(this, dt), St(this, Fe), St(this, Be, async () => {
|
|
1721
|
+
var i;
|
|
1722
|
+
const n = this.getLocationString();
|
|
1723
|
+
if (!n)
|
|
2436
1724
|
return;
|
|
2437
|
-
if (
|
|
1725
|
+
if (Hn(n))
|
|
2438
1726
|
switch (this.target) {
|
|
2439
1727
|
case "_self":
|
|
2440
|
-
window.location.href =
|
|
1728
|
+
window.location.href = n;
|
|
2441
1729
|
return;
|
|
2442
1730
|
case "_parent":
|
|
2443
|
-
window.parent.location.href =
|
|
1731
|
+
window.parent.location.href = n;
|
|
2444
1732
|
return;
|
|
2445
1733
|
case "_top":
|
|
2446
|
-
window.top.location.href =
|
|
1734
|
+
window.top.location.href = n;
|
|
2447
1735
|
return;
|
|
2448
1736
|
default:
|
|
2449
|
-
window.open(
|
|
1737
|
+
window.open(n);
|
|
2450
1738
|
return;
|
|
2451
1739
|
}
|
|
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
|
-
__privateSet(this, _preventDefault, (e) => {
|
|
2481
|
-
e.preventDefault();
|
|
2482
|
-
});
|
|
2483
|
-
__privateSet(this, _getHint, () => {
|
|
2484
|
-
const locationString = this.getLocationString();
|
|
2485
|
-
return isExternal(locationString) ? locationString : new URL(history.basePath + locationString, location.origin).toString();
|
|
2486
|
-
});
|
|
2487
|
-
this.addEventListener("click", __privateGet(this, _onClick));
|
|
1740
|
+
const { path: t, query: e, hash: s } = y.getParams();
|
|
1741
|
+
if (t + e + s !== n)
|
|
1742
|
+
if (await ((i = this.prepare) == null ? void 0 : i.call(this)), this.route)
|
|
1743
|
+
y.pushIgnoreCloseHandle({
|
|
1744
|
+
...ci(this.route, J(this, dt, Lt)),
|
|
1745
|
+
title: this.route.title || this.docTitle
|
|
1746
|
+
});
|
|
1747
|
+
else if (this.href) {
|
|
1748
|
+
const { pathname: r, search: o, hash: a } = new URL(n, location.origin);
|
|
1749
|
+
y.pushIgnoreCloseHandle({
|
|
1750
|
+
path: r,
|
|
1751
|
+
query: o,
|
|
1752
|
+
hash: a,
|
|
1753
|
+
title: this.docTitle
|
|
1754
|
+
});
|
|
1755
|
+
} else
|
|
1756
|
+
y.pushIgnoreCloseHandle({
|
|
1757
|
+
path: this.path,
|
|
1758
|
+
query: this.query,
|
|
1759
|
+
hash: this.hash,
|
|
1760
|
+
title: this.docTitle
|
|
1761
|
+
});
|
|
1762
|
+
}), St(this, Ke, (n) => {
|
|
1763
|
+
n.preventDefault();
|
|
1764
|
+
}), St(this, ze, () => {
|
|
1765
|
+
const n = this.getLocationString();
|
|
1766
|
+
return Hn(n) ? n : new URL(y.basePath + n, location.origin).toString();
|
|
1767
|
+
}), this.addEventListener("click", J(this, Be));
|
|
2488
1768
|
}
|
|
2489
1769
|
render() {
|
|
2490
|
-
return
|
|
1770
|
+
return G`
|
|
2491
1771
|
<style>
|
|
2492
1772
|
:host {
|
|
2493
1773
|
/* link default style */
|
|
@@ -2505,201 +1785,168 @@ let GemLinkElement = (_a = class extends GemElement {
|
|
|
2505
1785
|
</style>
|
|
2506
1786
|
<a
|
|
2507
1787
|
part=${this.link}
|
|
2508
|
-
@click=${
|
|
2509
|
-
href=${
|
|
1788
|
+
@click=${J(this, Ke)}
|
|
1789
|
+
href=${Qn(J(this, Fe, fs) === "off" ? void 0 : J(this, ze).call(this))}
|
|
2510
1790
|
>
|
|
2511
1791
|
<slot></slot>
|
|
2512
1792
|
</a>
|
|
2513
1793
|
`;
|
|
2514
1794
|
}
|
|
1795
|
+
/**
|
|
1796
|
+
* 如果该元素是外部链接返回 URL,否则返回路径(不包含 basePath)
|
|
1797
|
+
*/
|
|
2515
1798
|
getLocationString() {
|
|
2516
|
-
var
|
|
1799
|
+
var n, t;
|
|
2517
1800
|
if (this.route) {
|
|
2518
|
-
const
|
|
2519
|
-
|
|
2520
|
-
return createPath(this.route, __privateGet(this, _routeOptions, routeOptions_get)) + queryProp + hashProp;
|
|
1801
|
+
const e = ((n = J(this, dt, Lt)) == null ? void 0 : n.query) || "", s = ((t = J(this, dt, Lt)) == null ? void 0 : t.hash) || "";
|
|
1802
|
+
return dn(this.route, J(this, dt, Lt)) + e + s;
|
|
2521
1803
|
} else {
|
|
2522
|
-
const
|
|
2523
|
-
|
|
2524
|
-
if (url.startsWith("#")) {
|
|
2525
|
-
return `${path}${query}${url}`;
|
|
2526
|
-
} else if (url.startsWith("?")) {
|
|
2527
|
-
return `${path}${url}`;
|
|
2528
|
-
} else if (url.startsWith(".")) {
|
|
2529
|
-
return absoluteLocation(path, url);
|
|
2530
|
-
} else {
|
|
2531
|
-
return url;
|
|
2532
|
-
}
|
|
1804
|
+
const e = this.href || this.path + this.query + this.hash, { path: s, query: i } = y.getParams();
|
|
1805
|
+
return e.startsWith("#") ? `${s}${i}${e}` : e.startsWith("?") ? `${s}${e}` : e.startsWith(".") ? zn(s, e) : e;
|
|
2533
1806
|
}
|
|
2534
1807
|
}
|
|
2535
|
-
}
|
|
1808
|
+
};
|
|
1809
|
+
dt = /* @__PURE__ */ new WeakSet();
|
|
1810
|
+
Lt = function() {
|
|
2536
1811
|
return this.routeOptions || this.options;
|
|
2537
|
-
}
|
|
1812
|
+
};
|
|
1813
|
+
Fe = /* @__PURE__ */ new WeakSet();
|
|
1814
|
+
fs = function() {
|
|
2538
1815
|
return this.hint || "on";
|
|
2539
|
-
}
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
],
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
],
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
],
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
],
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
],
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
],
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
],
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
],
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
],
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
],
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
],
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
],
|
|
2579
|
-
|
|
1816
|
+
};
|
|
1817
|
+
Be = /* @__PURE__ */ new WeakMap();
|
|
1818
|
+
Ke = /* @__PURE__ */ new WeakMap();
|
|
1819
|
+
ze = /* @__PURE__ */ new WeakMap();
|
|
1820
|
+
b([
|
|
1821
|
+
C
|
|
1822
|
+
], x.prototype, "href", 2);
|
|
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 {
|
|
2580
1860
|
constructor() {
|
|
2581
|
-
super()
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
const isMatchPattern = this.pattern && matchPath(this.pattern, path);
|
|
2585
|
-
this.active = !!isMatchPattern || path + query + hash === this.getLocationString();
|
|
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();
|
|
2586
1864
|
});
|
|
2587
1865
|
}
|
|
2588
1866
|
};
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
],
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
],
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
],
|
|
2598
|
-
customElements.define("gem-link",
|
|
2599
|
-
customElements.define("gem-active-link",
|
|
2600
|
-
customElements.define("gem-route",
|
|
2601
|
-
customElements.define("gem-light-route",
|
|
2602
|
-
var
|
|
2603
|
-
var
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2607
|
-
if (decorator = decorators[i])
|
|
2608
|
-
result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
|
|
2609
|
-
if (kind && result)
|
|
2610
|
-
__defProp$4(target, key2, result);
|
|
2611
|
-
return result;
|
|
1867
|
+
b([
|
|
1868
|
+
C
|
|
1869
|
+
], Ut.prototype, "pattern", 2);
|
|
1870
|
+
b([
|
|
1871
|
+
cn
|
|
1872
|
+
], Ut.prototype, "active", 2);
|
|
1873
|
+
Ut = b([
|
|
1874
|
+
hn(y.store)
|
|
1875
|
+
], Ut);
|
|
1876
|
+
customElements.define("gem-link", x);
|
|
1877
|
+
customElements.define("gem-active-link", Ut);
|
|
1878
|
+
customElements.define("gem-route", ds);
|
|
1879
|
+
customElements.define("gem-light-route", hi);
|
|
1880
|
+
var fi = Object.defineProperty, pi = Object.getOwnPropertyDescriptor, fn = (n, t, e, s) => {
|
|
1881
|
+
for (var i = s > 1 ? void 0 : s ? pi(t, e) : t, r = n.length - 1, o; r >= 0; r--)
|
|
1882
|
+
(o = n[r]) && (i = (s ? o(t, e, i) : o(i)) || i);
|
|
1883
|
+
return s && i && fi(t, e, i), i;
|
|
2612
1884
|
};
|
|
2613
|
-
const
|
|
2614
|
-
let
|
|
2615
|
-
const
|
|
2616
|
-
function
|
|
2617
|
-
const
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
GemTitleElement.title = defaultTitle;
|
|
2623
|
-
documentTitle = GemTitleElement.title;
|
|
2624
|
-
}
|
|
2625
|
-
addMicrotask(setTitle);
|
|
2626
|
-
}
|
|
2627
|
-
connect(titleStore, setDocumentTitle);
|
|
2628
|
-
const PREFIX = `${defaultTitle} | `;
|
|
2629
|
-
const SUFFIX = ` - ${defaultTitle}`;
|
|
2630
|
-
const _GemTitleElement = class extends GemElement {
|
|
1885
|
+
const de = document.title;
|
|
1886
|
+
let Je = "";
|
|
1887
|
+
const gi = () => document.title = Je;
|
|
1888
|
+
function ps(n, t = "", e = "") {
|
|
1889
|
+
const s = qt.title || n;
|
|
1890
|
+
s && s !== de ? (Nt.title = s, Je = t + Nt.title + e) : (Nt.title = de, Je = Nt.title), I(gi);
|
|
1891
|
+
}
|
|
1892
|
+
ct(qt, ps);
|
|
1893
|
+
const mi = `${de} | `, yi = ` - ${de}`, ht = class gs extends A {
|
|
2631
1894
|
constructor() {
|
|
2632
|
-
super()
|
|
2633
|
-
this.mounted = () => {
|
|
1895
|
+
super(), this.mounted = () => {
|
|
2634
1896
|
this.effect(
|
|
2635
|
-
() => !this.inert &&
|
|
1897
|
+
() => !this.inert && ct(qt, this.update),
|
|
2636
1898
|
() => [this.inert]
|
|
2637
1899
|
);
|
|
2638
|
-
}
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
subtree: true
|
|
1900
|
+
}, new MutationObserver(() => this.update()).observe(this, {
|
|
1901
|
+
characterData: !0,
|
|
1902
|
+
childList: !0,
|
|
1903
|
+
subtree: !0
|
|
2643
1904
|
});
|
|
2644
1905
|
}
|
|
2645
|
-
static setTitle(
|
|
2646
|
-
|
|
1906
|
+
static setTitle(t) {
|
|
1907
|
+
nt(qt, { title: t });
|
|
2647
1908
|
}
|
|
2648
1909
|
render() {
|
|
2649
|
-
var
|
|
2650
|
-
|
|
2651
|
-
return html`${_GemTitleElement.title}`;
|
|
1910
|
+
var t;
|
|
1911
|
+
return ps((t = this.textContent) == null ? void 0 : t.trim(), this.prefix, this.suffix), G`${gs.title}`;
|
|
2652
1912
|
}
|
|
2653
1913
|
};
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
customElements.define("gem-title",
|
|
2668
|
-
var
|
|
2669
|
-
var
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2673
|
-
if (decorator = decorators[i])
|
|
2674
|
-
result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
|
|
2675
|
-
if (kind && result)
|
|
2676
|
-
__defProp$3(target, key2, result);
|
|
2677
|
-
return result;
|
|
1914
|
+
ht.title = document.title;
|
|
1915
|
+
ht.defaultPrefix = mi;
|
|
1916
|
+
ht.defaultSuffix = yi;
|
|
1917
|
+
fn([
|
|
1918
|
+
C
|
|
1919
|
+
], ht.prototype, "prefix", 2);
|
|
1920
|
+
fn([
|
|
1921
|
+
C
|
|
1922
|
+
], ht.prototype, "suffix", 2);
|
|
1923
|
+
fn([
|
|
1924
|
+
es
|
|
1925
|
+
], ht.prototype, "inert", 2);
|
|
1926
|
+
let Nt = ht;
|
|
1927
|
+
customElements.define("gem-title", Nt);
|
|
1928
|
+
var wi = Object.defineProperty, _i = Object.getOwnPropertyDescriptor, Ee = (n, t, e, s) => {
|
|
1929
|
+
for (var i = s > 1 ? void 0 : s ? _i(t, e) : t, r = n.length - 1, o; r >= 0; r--)
|
|
1930
|
+
(o = n[r]) && (i = (s ? o(t, e, i) : o(i)) || i);
|
|
1931
|
+
return s && i && wi(t, e, i), i;
|
|
2678
1932
|
};
|
|
2679
|
-
const
|
|
2680
|
-
|
|
1933
|
+
const Wn = /* @__PURE__ */ new Map();
|
|
1934
|
+
var jt;
|
|
1935
|
+
class Bt extends A {
|
|
2681
1936
|
constructor() {
|
|
2682
1937
|
super(...arguments);
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
const
|
|
2686
|
-
if (typeof
|
|
2687
|
-
let
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
eleCache.set(ele, temp);
|
|
2692
|
-
}
|
|
2693
|
-
return temp.content.cloneNode(true);
|
|
2694
|
-
} else if (ele instanceof HTMLTemplateElement) {
|
|
2695
|
-
return ele.content.cloneNode(true);
|
|
2696
|
-
} else {
|
|
2697
|
-
return ele == null ? void 0 : ele.cloneNode(true);
|
|
2698
|
-
}
|
|
1938
|
+
P(this, jt, void 0);
|
|
1939
|
+
F(this, jt, () => {
|
|
1940
|
+
const e = this.element || (this.selector ? (this.root || document).querySelector(this.selector) : null);
|
|
1941
|
+
if (typeof e == "string") {
|
|
1942
|
+
let s = Wn.get(e);
|
|
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);
|
|
2699
1946
|
});
|
|
2700
1947
|
}
|
|
2701
1948
|
render() {
|
|
2702
|
-
return
|
|
1949
|
+
return G`
|
|
2703
1950
|
<style>
|
|
2704
1951
|
:host(:where(:not([hidden]))) {
|
|
2705
1952
|
position: relative;
|
|
@@ -2711,43 +1958,35 @@ class GemUseElement extends GemElement {
|
|
|
2711
1958
|
height: 100%;
|
|
2712
1959
|
}
|
|
2713
1960
|
</style>
|
|
2714
|
-
${
|
|
1961
|
+
${g(this, jt).call(this)}
|
|
2715
1962
|
<slot></slot>
|
|
2716
1963
|
`;
|
|
2717
1964
|
}
|
|
2718
1965
|
}
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
],
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
],
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
],
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
],
|
|
2732
|
-
customElements.define("gem-use",
|
|
2733
|
-
var
|
|
2734
|
-
var
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2738
|
-
if (decorator = decorators[i])
|
|
2739
|
-
result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
|
|
2740
|
-
if (kind && result)
|
|
2741
|
-
__defProp$2(target, key2, result);
|
|
2742
|
-
return result;
|
|
1966
|
+
jt = new WeakMap();
|
|
1967
|
+
Ee([
|
|
1968
|
+
C
|
|
1969
|
+
], Bt.prototype, "selector", 2);
|
|
1970
|
+
Ee([
|
|
1971
|
+
N
|
|
1972
|
+
], Bt.prototype, "root", 2);
|
|
1973
|
+
Ee([
|
|
1974
|
+
N
|
|
1975
|
+
], Bt.prototype, "element", 2);
|
|
1976
|
+
Ee([
|
|
1977
|
+
cn
|
|
1978
|
+
], Bt.prototype, "active", 2);
|
|
1979
|
+
customElements.define("gem-use", Bt);
|
|
1980
|
+
var vi = Object.defineProperty, Si = Object.getOwnPropertyDescriptor, ms = (n, t, e, s) => {
|
|
1981
|
+
for (var i = s > 1 ? void 0 : s ? Si(t, e) : t, r = n.length - 1, o; r >= 0; r--)
|
|
1982
|
+
(o = n[r]) && (i = (s ? o(t, e, i) : o(i)) || i);
|
|
1983
|
+
return s && i && vi(t, e, i), i;
|
|
2743
1984
|
};
|
|
2744
|
-
class
|
|
1985
|
+
class pn extends A {
|
|
2745
1986
|
constructor() {
|
|
2746
|
-
super()
|
|
2747
|
-
this.effect(
|
|
1987
|
+
super(), this.effect(
|
|
2748
1988
|
() => {
|
|
2749
|
-
|
|
2750
|
-
this.shadowRoot.innerHTML = `
|
|
1989
|
+
this.shadowRoot && (this.shadowRoot.innerHTML = `
|
|
2751
1990
|
<style>
|
|
2752
1991
|
:host(:where(:not([hidden]))) {
|
|
2753
1992
|
display: contents;
|
|
@@ -2755,421 +1994,318 @@ class GemUnsafeElement extends GemElement {
|
|
|
2755
1994
|
${this.contentcss}
|
|
2756
1995
|
</style>
|
|
2757
1996
|
${this.content}
|
|
2758
|
-
|
|
2759
|
-
}
|
|
1997
|
+
`);
|
|
2760
1998
|
},
|
|
2761
1999
|
() => [this.content, this.contentcss]
|
|
2762
2000
|
);
|
|
2763
2001
|
}
|
|
2764
2002
|
render() {
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
var
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key2) : target;
|
|
2779
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2780
|
-
if (decorator = decorators[i])
|
|
2781
|
-
result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
|
|
2782
|
-
if (kind && result)
|
|
2783
|
-
__defProp$1(target, key2, result);
|
|
2784
|
-
return result;
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
ms([
|
|
2006
|
+
C
|
|
2007
|
+
], pn.prototype, "content", 2);
|
|
2008
|
+
ms([
|
|
2009
|
+
C
|
|
2010
|
+
], pn.prototype, "contentcss", 2);
|
|
2011
|
+
customElements.define("gem-unsafe", pn);
|
|
2012
|
+
var Ei = Object.defineProperty, xi = Object.getOwnPropertyDescriptor, ys = (n, t, e, s) => {
|
|
2013
|
+
for (var i = s > 1 ? void 0 : s ? xi(t, e) : t, r = n.length - 1, o; r >= 0; r--)
|
|
2014
|
+
(o = n[r]) && (i = (s ? o(t, e, i) : o(i)) || i);
|
|
2015
|
+
return s && i && Ei(t, e, i), i;
|
|
2785
2016
|
};
|
|
2786
|
-
const
|
|
2787
|
-
const
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
while (node) {
|
|
2793
|
-
result.push(node);
|
|
2794
|
-
if (node.nodeValue === END)
|
|
2795
|
-
break;
|
|
2796
|
-
node = node.nextSibling;
|
|
2797
|
-
}
|
|
2798
|
-
return result;
|
|
2017
|
+
const bi = "gem-reflect-start", ws = "gem-reflect-end", In = (n) => new Comment(n), Ci = (n) => {
|
|
2018
|
+
const t = [];
|
|
2019
|
+
let e = n;
|
|
2020
|
+
for (; e && (t.push(e), e.nodeValue !== ws); )
|
|
2021
|
+
e = e.nextSibling;
|
|
2022
|
+
return t;
|
|
2799
2023
|
};
|
|
2800
|
-
|
|
2024
|
+
var ge, _s;
|
|
2025
|
+
class gn extends A {
|
|
2801
2026
|
constructor() {
|
|
2802
|
-
super({ isLight:
|
|
2803
|
-
this
|
|
2804
|
-
this.effect(
|
|
2027
|
+
super({ isLight: !0 });
|
|
2028
|
+
P(this, ge);
|
|
2029
|
+
this.target = document.head, this.effect(
|
|
2805
2030
|
() => {
|
|
2806
|
-
this.hidden =
|
|
2807
|
-
this.dataset.gemReflect = "";
|
|
2031
|
+
this.hidden = !0, this.dataset.gemReflect = "";
|
|
2808
2032
|
},
|
|
2809
2033
|
() => []
|
|
2810
2034
|
);
|
|
2811
|
-
const
|
|
2812
|
-
|
|
2813
|
-
let childNodes;
|
|
2035
|
+
const e = In(bi), s = In(ws);
|
|
2036
|
+
let i;
|
|
2814
2037
|
this.effect(
|
|
2815
|
-
() => {
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
return () => {
|
|
2822
|
-
childNodes = getReflectFragment(startNode);
|
|
2823
|
-
childNodes.forEach((node) => node.remove());
|
|
2824
|
-
};
|
|
2825
|
-
},
|
|
2038
|
+
() => ((i || [e, ...this.childNodes, s]).forEach((r, o, a) => {
|
|
2039
|
+
const c = a[o - 1];
|
|
2040
|
+
c ? c.after(r) : this.target[g(this, ge, _s)](r);
|
|
2041
|
+
}), () => {
|
|
2042
|
+
i = Ci(e), i.forEach((r) => r.remove());
|
|
2043
|
+
}),
|
|
2826
2044
|
() => [this.target]
|
|
2827
2045
|
);
|
|
2828
2046
|
}
|
|
2829
2047
|
}
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2048
|
+
ge = new WeakSet(), _s = function() {
|
|
2049
|
+
return this.method || "append";
|
|
2050
|
+
};
|
|
2051
|
+
ys([
|
|
2052
|
+
C
|
|
2053
|
+
], gn.prototype, "method", 2);
|
|
2054
|
+
ys([
|
|
2055
|
+
N
|
|
2056
|
+
], gn.prototype, "target", 2);
|
|
2057
|
+
customElements.define("gem-reflect", gn);
|
|
2058
|
+
const zt = Symbol("open mark");
|
|
2059
|
+
function er(n) {
|
|
2060
|
+
var t;
|
|
2061
|
+
const e = Symbol();
|
|
2062
|
+
return t = class extends A {
|
|
2839
2063
|
constructor() {
|
|
2840
|
-
super();
|
|
2841
|
-
this.label = "";
|
|
2842
|
-
this.internals.role = "alertdialog";
|
|
2843
|
-
this.internals.ariaModal = "true";
|
|
2064
|
+
super(), this.label = "", this.internals.role = "alertdialog", this.internals.ariaModal = "true";
|
|
2844
2065
|
}
|
|
2066
|
+
/**@final */
|
|
2845
2067
|
static get isOpen() {
|
|
2846
|
-
return this.store[
|
|
2068
|
+
return this.store[zt];
|
|
2847
2069
|
}
|
|
2070
|
+
/**@final */
|
|
2848
2071
|
static get observedStores() {
|
|
2849
|
-
return [
|
|
2850
|
-
}
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
const
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2072
|
+
return [y.store, this.store];
|
|
2073
|
+
}
|
|
2074
|
+
/**
|
|
2075
|
+
* @final
|
|
2076
|
+
* 自带 100ms 延迟,以允许在其他 Dialog 的 `shouldClose` 中调用此方法;
|
|
2077
|
+
* 浏览器 history 为异步 API,需要设置较长延迟;
|
|
2078
|
+
*/
|
|
2079
|
+
static open(s) {
|
|
2080
|
+
const i = new this();
|
|
2081
|
+
this.instance = i, this.inertStore = [...document.body.children].filter((o) => !o.inert), this.inertStore.forEach((o) => o.inert = !0), document.body.append(i);
|
|
2082
|
+
const r = () => nt(this.store, { [zt]: !0, ...s });
|
|
2083
|
+
return setTimeout(() => {
|
|
2084
|
+
r(), y.push({
|
|
2085
|
+
title: i.label,
|
|
2086
|
+
open: r,
|
|
2863
2087
|
close: this.closeHandle.bind(this),
|
|
2864
2088
|
shouldClose: this.shouldClose.bind(this)
|
|
2865
2089
|
});
|
|
2866
|
-
}, 100);
|
|
2867
|
-
return final2;
|
|
2090
|
+
}, 100), e;
|
|
2868
2091
|
}
|
|
2092
|
+
/**
|
|
2093
|
+
* @final
|
|
2094
|
+
* UI 中执行关闭
|
|
2095
|
+
*/
|
|
2869
2096
|
static close() {
|
|
2870
|
-
|
|
2871
|
-
return final2;
|
|
2097
|
+
return y.back(), e;
|
|
2872
2098
|
}
|
|
2099
|
+
/**
|
|
2100
|
+
* @final
|
|
2101
|
+
* history 中自动调用
|
|
2102
|
+
*/
|
|
2873
2103
|
static closeHandle() {
|
|
2874
|
-
var
|
|
2875
|
-
this.inertStore.forEach((
|
|
2876
|
-
(_a3 = this.instance) == null ? void 0 : _a3.remove();
|
|
2877
|
-
updateStore(this.store, { [open]: false, ...options });
|
|
2878
|
-
return final2;
|
|
2104
|
+
var s;
|
|
2105
|
+
return this.inertStore.forEach((i) => i.inert = !1), (s = this.instance) == null || s.remove(), nt(this.store, { [zt]: !1, ...n }), e;
|
|
2879
2106
|
}
|
|
2107
|
+
/**
|
|
2108
|
+
* 由于要操作浏览器历史记录,所以没有设计为 Promise;
|
|
2109
|
+
*/
|
|
2880
2110
|
static shouldClose() {
|
|
2881
|
-
return
|
|
2882
|
-
}
|
|
2883
|
-
},
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2111
|
+
return !0;
|
|
2112
|
+
}
|
|
2113
|
+
}, t.inertStore = [], t.instance = null, /**
|
|
2114
|
+
* @final
|
|
2115
|
+
* modal 状态,包括内容,是否已经确认关闭等属性
|
|
2116
|
+
*/
|
|
2117
|
+
t.store = Ft({
|
|
2118
|
+
[zt]: !1,
|
|
2119
|
+
...n
|
|
2120
|
+
}), t;
|
|
2121
|
+
}
|
|
2122
|
+
var Pi = Object.defineProperty, $i = Object.getOwnPropertyDescriptor, mn = (n, t, e, s) => {
|
|
2123
|
+
for (var i = s > 1 ? void 0 : s ? $i(t, e) : t, r = n.length - 1, o; r >= 0; r--)
|
|
2124
|
+
(o = n[r]) && (i = (s ? o(t, e, i) : o(i)) || i);
|
|
2125
|
+
return s && i && Pi(t, e, i), i;
|
|
2126
|
+
}, vs = (n, t, e) => {
|
|
2127
|
+
if (!t.has(n))
|
|
2128
|
+
throw TypeError("Cannot " + e);
|
|
2129
|
+
}, lt = (n, t, e) => (vs(n, t, "read from private field"), e ? e.call(n) : t.get(n)), Me = (n, t, e) => {
|
|
2130
|
+
if (t.has(n))
|
|
2131
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
2132
|
+
t instanceof WeakSet ? t.add(n) : t.set(n, e);
|
|
2133
|
+
}, Oe = (n, t, e, s) => (vs(n, t, "write to private field"), s ? s.call(n, e) : t.set(n, e), e), Mt, Ot, Rt;
|
|
2134
|
+
const Et = Symbol();
|
|
2135
|
+
let fe = class extends A {
|
|
2901
2136
|
constructor() {
|
|
2902
|
-
super()
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
}
|
|
2916
|
-
this.dispatchEvent(new CustomEvent("close"));
|
|
2917
|
-
this.opened = false;
|
|
2918
|
-
return final;
|
|
2919
|
-
};
|
|
2920
|
-
this.openHandle = () => {
|
|
2921
|
-
this.hidden = false;
|
|
2922
|
-
this.inert = false;
|
|
2923
|
-
__privateSet(this, _nextSibling, this.nextSibling);
|
|
2924
|
-
__privateSet(this, _parentElement, this.parentElement || this.getRootNode());
|
|
2925
|
-
__privateSet(this, _inertStore, [...document.body.children].filter((e) => !e.inert));
|
|
2926
|
-
__privateGet(this, _inertStore).forEach((e) => e.inert = true);
|
|
2927
|
-
document.body.append(this);
|
|
2928
|
-
this.dispatchEvent(new CustomEvent("open"));
|
|
2929
|
-
this.opened = true;
|
|
2930
|
-
return final;
|
|
2931
|
-
};
|
|
2932
|
-
this.open = () => {
|
|
2933
|
-
if (this.opened)
|
|
2934
|
-
return;
|
|
2935
|
-
this.openHandle();
|
|
2936
|
-
history.push({
|
|
2937
|
-
title: this.label,
|
|
2938
|
-
open: this.openHandle,
|
|
2939
|
-
close: this.closeHandle,
|
|
2940
|
-
shouldClose: this.shouldClose
|
|
2941
|
-
});
|
|
2942
|
-
return final;
|
|
2943
|
-
};
|
|
2944
|
-
this.close = () => {
|
|
2945
|
-
history.back();
|
|
2946
|
-
return final;
|
|
2947
|
-
};
|
|
2948
|
-
this.forceClose = () => {
|
|
2949
|
-
this.opened = false;
|
|
2950
|
-
setTimeout(this.close, 100);
|
|
2951
|
-
return final;
|
|
2952
|
-
};
|
|
2953
|
-
this.effect(
|
|
2954
|
-
() => this.inert = true,
|
|
2137
|
+
super(), Me(this, Mt, void 0), Me(this, Ot, void 0), Me(this, Rt, []), this.closeHandle = () => {
|
|
2138
|
+
var n;
|
|
2139
|
+
return this.inert = !0, lt(this, Rt).forEach((t) => t.inert = !1), lt(this, Mt) ? lt(this, Mt).before(this) : lt(this, Ot) && ((n = lt(this, Ot)) == null || n.appendChild(this)), this.dispatchEvent(new CustomEvent("close")), this.opened = !1, Et;
|
|
2140
|
+
}, this.openHandle = () => (this.hidden = !1, this.inert = !1, Oe(this, Mt, this.nextSibling), Oe(this, Ot, this.parentElement || this.getRootNode()), Oe(this, Rt, [...document.body.children].filter((n) => !n.inert)), lt(this, Rt).forEach((n) => n.inert = !0), document.body.append(this), this.dispatchEvent(new CustomEvent("open")), this.opened = !0, Et), this.open = () => {
|
|
2141
|
+
if (!this.opened)
|
|
2142
|
+
return this.openHandle(), y.push({
|
|
2143
|
+
title: this.label,
|
|
2144
|
+
open: this.openHandle,
|
|
2145
|
+
close: this.closeHandle,
|
|
2146
|
+
shouldClose: this.shouldClose
|
|
2147
|
+
}), Et;
|
|
2148
|
+
}, this.close = () => (y.back(), Et), this.forceClose = () => (this.opened = !1, setTimeout(this.close, 100), Et), this.effect(
|
|
2149
|
+
() => this.inert = !0,
|
|
2955
2150
|
() => []
|
|
2956
|
-
);
|
|
2957
|
-
this.internals.role = "dialog";
|
|
2958
|
-
this.internals.ariaModal = "true";
|
|
2151
|
+
), this.internals.role = "dialog", this.internals.ariaModal = "true";
|
|
2959
2152
|
}
|
|
2960
2153
|
shouldClose() {
|
|
2961
|
-
return
|
|
2962
|
-
}
|
|
2963
|
-
}
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
],
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
],
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
const
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
const setTheme = () => Object.keys(store2).forEach((key2) => {
|
|
2991
|
-
if (props[key2])
|
|
2992
|
-
return;
|
|
2993
|
-
props[key2] = `--${camelToKebabCase(key2)}-${salt}`;
|
|
2994
|
-
theme[key2] = `var(${props[key2]})`;
|
|
2154
|
+
return !0;
|
|
2155
|
+
}
|
|
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]})`);
|
|
2995
2183
|
});
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
}
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
this.
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
}
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
const
|
|
3029
|
-
|
|
3030
|
-
const
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
const modules = /* @__PURE__ */ new Set();
|
|
3044
|
-
const _I18n = class {
|
|
3045
|
-
constructor(options) {
|
|
3046
|
-
__privateAdd(this, _cacheCurrentKey);
|
|
3047
|
-
__privateAdd(this, _urlParamsLang);
|
|
3048
|
-
__privateAdd(this, _cacheLang);
|
|
3049
|
-
__privateAdd(this, _isMain);
|
|
3050
|
-
__privateAdd(this, _lang);
|
|
3051
|
-
this.cachePrefix = "gem-i18n";
|
|
3052
|
-
this.replace = ({ path }) => {
|
|
3053
|
-
this.setLanguage(path);
|
|
3054
|
-
};
|
|
3055
|
-
this.getParams = () => ({ path: this.currentLanguage });
|
|
3056
|
-
if (!options.resources[options.fallbackLanguage]) {
|
|
3057
|
-
throw new GemError("i18n: fallbackLanguage invalid");
|
|
3058
|
-
}
|
|
3059
|
-
this.store = createStore(this);
|
|
3060
|
-
Object.assign(this, options);
|
|
3061
|
-
let currentLanguage = __privateGet(this, _urlParamsLang, urlParamsLang_get) || this.currentLanguage || __privateGet(this, _cacheLang, cacheLang_get);
|
|
3062
|
-
const ele = document.querySelector(`[type*=${this.cachePrefix}]`);
|
|
3063
|
-
if (ele) {
|
|
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
|
+
}
|
|
2191
|
+
function sr(n) {
|
|
2192
|
+
const t = ki(n);
|
|
2193
|
+
return [t, (e) => Li(t, e)];
|
|
2194
|
+
}
|
|
2195
|
+
class Ni {
|
|
2196
|
+
constructor(t) {
|
|
2197
|
+
this.info = (...e) => {
|
|
2198
|
+
console.log(`[${this._type}]:`, ...e);
|
|
2199
|
+
}, this.warn = (...e) => {
|
|
2200
|
+
console.warn(`[${this._type}]:`, ...e);
|
|
2201
|
+
}, this.error = (...e) => {
|
|
2202
|
+
console.error(`[${this._type}]:`, ...e);
|
|
2203
|
+
}, this._type = t;
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
const Mi = new Ni("GEM"), Oi = /\$\d(?:<[^>]*>)?/, Ri = /\$(\d)(<([^>]*)>)?/g, Ai = 3;
|
|
2207
|
+
function Hi(n, ...t) {
|
|
2208
|
+
const e = n.split(Oi), s = [];
|
|
2209
|
+
let i;
|
|
2210
|
+
for (; i = Ri.exec(n); ) {
|
|
2211
|
+
const r = i[Ai], o = Number(i[1]) - 1, a = t[o];
|
|
2212
|
+
s.push(typeof a == "function" ? a(r) : a);
|
|
2213
|
+
}
|
|
2214
|
+
return G(e, ...s);
|
|
2215
|
+
}
|
|
2216
|
+
const xt = /* @__PURE__ */ new Set();
|
|
2217
|
+
var mt, oe, me, bs, ye, Cs, at, At, yt, ae;
|
|
2218
|
+
const yn = class yn {
|
|
2219
|
+
constructor(t) {
|
|
2220
|
+
P(this, mt);
|
|
2221
|
+
P(this, me);
|
|
2222
|
+
P(this, ye);
|
|
2223
|
+
P(this, at);
|
|
2224
|
+
P(this, yt);
|
|
2225
|
+
if (this.cachePrefix = "gem-i18n", this.replace = ({ path: i }) => this.setLanguage(i), this.getParams = () => ({ path: this.currentLanguage }), !t.resources[t.fallbackLanguage])
|
|
2226
|
+
throw new tt("i18n: fallbackLanguage invalid");
|
|
2227
|
+
this.store = Ft(this), Object.assign(this, t);
|
|
2228
|
+
let e = g(this, me, bs) || this.currentLanguage || g(this, ye, Cs);
|
|
2229
|
+
const s = document.querySelector(`[type*=${this.cachePrefix}]`);
|
|
2230
|
+
if (s)
|
|
3064
2231
|
try {
|
|
3065
|
-
const
|
|
3066
|
-
currentLanguage =
|
|
3067
|
-
this.resources[prerenderData.currentLanguage] = prerenderData.currentLanguagePack;
|
|
2232
|
+
const i = JSON.parse(s.textContent || "");
|
|
2233
|
+
e = i.currentLanguage, this.resources[i.currentLanguage] = i.currentLanguagePack;
|
|
3068
2234
|
} catch {
|
|
3069
2235
|
}
|
|
3070
|
-
|
|
3071
|
-
if (currentLanguage) {
|
|
3072
|
-
__privateSet(this, _lang, currentLanguage, lang_set);
|
|
3073
|
-
this.setLanguage(currentLanguage);
|
|
3074
|
-
} else {
|
|
3075
|
-
this.resetLanguage();
|
|
3076
|
-
}
|
|
2236
|
+
e ? (F(this, yt, e, ae), this.setLanguage(e)) : this.resetLanguage();
|
|
3077
2237
|
}
|
|
3078
|
-
get(
|
|
3079
|
-
const
|
|
3080
|
-
|
|
3081
|
-
const msg = currentLanguagePack[s] || fallbackLanguagePack[s];
|
|
3082
|
-
const rawValue = (msg == null ? void 0 : msg.message) || msg || `[${s}]`;
|
|
3083
|
-
if (!rest.length)
|
|
3084
|
-
return rawValue;
|
|
3085
|
-
return splice(rawValue, ...rest);
|
|
2238
|
+
get(t, ...e) {
|
|
2239
|
+
const s = this.resources[this.currentLanguage], i = this.resources[this.fallbackLanguage], r = s[t] || i[t], o = (r == null ? void 0 : r.message) || r || `[${t}]`;
|
|
2240
|
+
return e.length ? Hi(o, ...e) : o;
|
|
3086
2241
|
}
|
|
3087
2242
|
detectLanguage() {
|
|
3088
|
-
const
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
return matched;
|
|
2243
|
+
const t = Object.keys(this.resources), e = navigator.languages.map((s) => s.replace(/-(.*)/, (i) => i.toUpperCase()));
|
|
2244
|
+
for (const s of e) {
|
|
2245
|
+
const i = t.find((r) => r === s || s.startsWith(`${r}-`));
|
|
2246
|
+
if (i)
|
|
2247
|
+
return i;
|
|
3094
2248
|
}
|
|
3095
2249
|
return this.fallbackLanguage;
|
|
3096
2250
|
}
|
|
3097
|
-
async setLanguage(
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
if (
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
}
|
|
3107
|
-
if (typeof data === "string") {
|
|
3108
|
-
const prefix = `${this.cachePrefix}:`;
|
|
3109
|
-
const localKey = `${prefix}${data}`;
|
|
3110
|
-
const localPackString = localStorage.getItem(localKey);
|
|
3111
|
-
const fetchPack = async () => {
|
|
3112
|
-
const pack2 = await (await fetch(data)).json();
|
|
2251
|
+
async setLanguage(t) {
|
|
2252
|
+
g(this, at, At) && xt.forEach(async (i) => await i.setLanguage(t));
|
|
2253
|
+
let e;
|
|
2254
|
+
const s = this.resources[t];
|
|
2255
|
+
if (!s)
|
|
2256
|
+
return Mi.warn(`${this.cachePrefix}: not found \`${t}\``), this.resetLanguage();
|
|
2257
|
+
if (typeof s == "string") {
|
|
2258
|
+
const i = `${this.cachePrefix}:`, r = `${i}${s}`, o = localStorage.getItem(r), a = async () => {
|
|
2259
|
+
const c = await (await fetch(s)).json();
|
|
3113
2260
|
if (this.cache) {
|
|
3114
|
-
for (let
|
|
3115
|
-
const
|
|
3116
|
-
|
|
3117
|
-
localStorage.removeItem(key2);
|
|
3118
|
-
}
|
|
2261
|
+
for (let h = 0; h < localStorage.length; h++) {
|
|
2262
|
+
const p = localStorage.key(h);
|
|
2263
|
+
p.startsWith(i) && localStorage.removeItem(p);
|
|
3119
2264
|
}
|
|
3120
|
-
localStorage.setItem(
|
|
2265
|
+
localStorage.setItem(r, JSON.stringify(c));
|
|
3121
2266
|
}
|
|
3122
|
-
return
|
|
2267
|
+
return c;
|
|
3123
2268
|
};
|
|
3124
|
-
if (
|
|
2269
|
+
if (o)
|
|
3125
2270
|
try {
|
|
3126
|
-
|
|
3127
|
-
} catch
|
|
3128
|
-
|
|
2271
|
+
e = JSON.parse(o);
|
|
2272
|
+
} catch {
|
|
2273
|
+
e = await a();
|
|
3129
2274
|
}
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
}
|
|
3136
|
-
this.resources[lang] = pack;
|
|
3137
|
-
updateStore(this.store);
|
|
3138
|
-
if (lang !== this.currentLanguage) {
|
|
3139
|
-
__privateSet(this, _lang, lang, lang_set);
|
|
3140
|
-
}
|
|
3141
|
-
if (this.cache === true) {
|
|
3142
|
-
this.setCache();
|
|
3143
|
-
}
|
|
3144
|
-
return lang;
|
|
2275
|
+
else
|
|
2276
|
+
e = await a();
|
|
2277
|
+
} else
|
|
2278
|
+
e = s;
|
|
2279
|
+
return this.resources[t] = e, nt(this.store), t !== this.currentLanguage && F(this, yt, t, ae), this.cache === !0 && this.setCache(), t;
|
|
3145
2280
|
}
|
|
3146
2281
|
resetLanguage() {
|
|
3147
|
-
|
|
3148
|
-
modules.forEach((i18n) => i18n.resetLanguage());
|
|
3149
|
-
}
|
|
3150
|
-
__privateSet(this, _lang, this.fallbackLanguage, lang_set);
|
|
3151
|
-
if (this.cache) {
|
|
3152
|
-
localStorage.removeItem(__privateGet(this, _cacheCurrentKey, cacheCurrentKey_get));
|
|
3153
|
-
}
|
|
3154
|
-
return this.setLanguage(this.detectLanguage());
|
|
2282
|
+
return g(this, at, At) && xt.forEach((t) => t.resetLanguage()), F(this, yt, this.fallbackLanguage, ae), this.cache && localStorage.removeItem(g(this, mt, oe)), this.setLanguage(this.detectLanguage());
|
|
3155
2283
|
}
|
|
2284
|
+
// 一般用在 `onChange` 中
|
|
3156
2285
|
setCache() {
|
|
3157
|
-
|
|
3158
|
-
modules.forEach((i18n) => i18n.setCache());
|
|
3159
|
-
}
|
|
3160
|
-
localStorage.setItem(__privateGet(this, _cacheCurrentKey, cacheCurrentKey_get), this.currentLanguage);
|
|
2286
|
+
g(this, at, At) && xt.forEach((t) => t.setCache()), localStorage.setItem(g(this, mt, oe), this.currentLanguage);
|
|
3161
2287
|
}
|
|
3162
|
-
createSubModule(
|
|
3163
|
-
const
|
|
3164
|
-
resources,
|
|
3165
|
-
cachePrefix: `${this.cachePrefix}-${
|
|
2288
|
+
createSubModule(t, e) {
|
|
2289
|
+
const s = new yn({
|
|
2290
|
+
resources: e,
|
|
2291
|
+
cachePrefix: `${this.cachePrefix}-${t}`,
|
|
3166
2292
|
currentLanguage: this.currentLanguage,
|
|
3167
2293
|
fallbackLanguage: this.fallbackLanguage,
|
|
3168
2294
|
cache: this.cache
|
|
3169
2295
|
});
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
2296
|
+
return xt.add(s), s;
|
|
2297
|
+
}
|
|
2298
|
+
/**
|
|
2299
|
+
* prepare: @connectStore(i18n.store)
|
|
2300
|
+
*
|
|
2301
|
+
* @example
|
|
2302
|
+
*
|
|
2303
|
+
* html`
|
|
2304
|
+
* <gem-reflect>
|
|
2305
|
+
* <script type="${i18n.cachePrefix}">${JSON.stringify(i18n)}<\/script>
|
|
2306
|
+
* </gem-reflect>
|
|
2307
|
+
* `
|
|
2308
|
+
*/
|
|
3173
2309
|
toJSON() {
|
|
3174
2310
|
return {
|
|
3175
2311
|
currentLanguage: this.currentLanguage,
|
|
@@ -3177,147 +2313,225 @@ const _I18n = class {
|
|
|
3177
2313
|
};
|
|
3178
2314
|
}
|
|
3179
2315
|
};
|
|
3180
|
-
|
|
3181
|
-
_cacheCurrentKey = new WeakSet();
|
|
3182
|
-
cacheCurrentKey_get = function() {
|
|
2316
|
+
mt = new WeakSet(), oe = function() {
|
|
3183
2317
|
return `${this.cachePrefix}:current`;
|
|
3184
|
-
}
|
|
3185
|
-
|
|
3186
|
-
urlParamsLang_get = function() {
|
|
3187
|
-
const { hostname, pathname, search } = location;
|
|
3188
|
-
const parts2 = hostname.split(".");
|
|
2318
|
+
}, me = new WeakSet(), bs = function() {
|
|
2319
|
+
const { hostname: t, pathname: e, search: s } = location, i = t.split(".");
|
|
3189
2320
|
switch (this.urlParamsType) {
|
|
3190
2321
|
case "ccTLD":
|
|
3191
|
-
return
|
|
2322
|
+
return i.pop();
|
|
3192
2323
|
case "gTLD":
|
|
3193
|
-
return
|
|
2324
|
+
return i.shift();
|
|
3194
2325
|
case "path":
|
|
3195
|
-
return
|
|
2326
|
+
return e.split("/")[1];
|
|
3196
2327
|
default:
|
|
3197
|
-
const
|
|
3198
|
-
return
|
|
3199
|
-
}
|
|
3200
|
-
}
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
return
|
|
2328
|
+
const r = this.urlParamsName && new URLSearchParams(s).get(this.urlParamsName) || "";
|
|
2329
|
+
return r in this.resources ? r : "";
|
|
2330
|
+
}
|
|
2331
|
+
}, ye = new WeakSet(), Cs = function() {
|
|
2332
|
+
return this.cache && localStorage.getItem(g(this, mt, oe)) || "";
|
|
2333
|
+
}, at = new WeakSet(), At = function() {
|
|
2334
|
+
return !xt.has(this);
|
|
2335
|
+
}, yt = new WeakSet(), ae = function(t) {
|
|
2336
|
+
var e;
|
|
2337
|
+
g(this, at, At) && (document.documentElement.lang = t), this.currentLanguage = t, (e = this.onChange) == null || e.call(this, t);
|
|
3204
2338
|
};
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
return !modules.has(this);
|
|
3208
|
-
};
|
|
3209
|
-
_lang = new WeakSet();
|
|
3210
|
-
lang_set = function(lang) {
|
|
3211
|
-
var _a2;
|
|
3212
|
-
if (__privateGet(this, _isMain, isMain_get)) {
|
|
3213
|
-
document.documentElement.lang = lang;
|
|
3214
|
-
}
|
|
3215
|
-
this.currentLanguage = lang;
|
|
3216
|
-
(_a2 = this.onChange) == null ? void 0 : _a2.call(this, lang);
|
|
3217
|
-
};
|
|
3218
|
-
const defaultReqInit = {
|
|
2339
|
+
let Vn = yn;
|
|
2340
|
+
const Wi = {
|
|
3219
2341
|
headers: {
|
|
3220
2342
|
"Content-Type": "application/json"
|
|
3221
2343
|
}
|
|
3222
2344
|
};
|
|
3223
|
-
async function
|
|
3224
|
-
const
|
|
3225
|
-
...
|
|
3226
|
-
...
|
|
2345
|
+
async function xe(n, t = {}) {
|
|
2346
|
+
const e = await fetch(n, {
|
|
2347
|
+
...Wi,
|
|
2348
|
+
...t
|
|
3227
2349
|
});
|
|
3228
|
-
if (
|
|
2350
|
+
if (e.status === 0)
|
|
3229
2351
|
throw new Error("Request fail");
|
|
3230
|
-
if (
|
|
3231
|
-
throw new Error(
|
|
2352
|
+
if (e.status >= 500)
|
|
2353
|
+
throw new Error(e.statusText);
|
|
3232
2354
|
try {
|
|
3233
|
-
const
|
|
3234
|
-
if (
|
|
3235
|
-
throw new Error((
|
|
3236
|
-
return
|
|
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;
|
|
3237
2359
|
} catch {
|
|
3238
2360
|
throw new Error("Server error");
|
|
3239
2361
|
}
|
|
3240
2362
|
}
|
|
3241
|
-
const
|
|
3242
|
-
function
|
|
3243
|
-
|
|
3244
|
-
return body;
|
|
3245
|
-
}
|
|
3246
|
-
if (typeof body === "object") {
|
|
3247
|
-
return JSON.stringify(body);
|
|
3248
|
-
}
|
|
3249
|
-
return body;
|
|
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;
|
|
3250
2366
|
}
|
|
3251
|
-
function
|
|
3252
|
-
const { origin, pathname, search } = new URL(
|
|
3253
|
-
|
|
3254
|
-
return `${origin}${pathname}${search ? `${search}&` : query ? "?" : ""}${query}`;
|
|
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}`;
|
|
3255
2370
|
}
|
|
3256
|
-
function
|
|
3257
|
-
return
|
|
2371
|
+
function ir(n, t) {
|
|
2372
|
+
return xe($s(n, t), { method: "GET" });
|
|
3258
2373
|
}
|
|
3259
|
-
function
|
|
3260
|
-
return
|
|
2374
|
+
function rr(n, t) {
|
|
2375
|
+
return xe($s(n, t), { method: "DELETE" });
|
|
3261
2376
|
}
|
|
3262
|
-
function
|
|
3263
|
-
return
|
|
2377
|
+
function or(n, t) {
|
|
2378
|
+
return xe(n, { method: "PUT", body: Ps(t) });
|
|
3264
2379
|
}
|
|
3265
|
-
function
|
|
3266
|
-
return
|
|
2380
|
+
function ar(n, t) {
|
|
2381
|
+
return xe(n, { method: "POST", body: Ps(t) });
|
|
3267
2382
|
}
|
|
3268
|
-
const
|
|
3269
|
-
const mediaQuery = {
|
|
2383
|
+
const L = (n) => window.matchMedia(n).matches, cr = {
|
|
3270
2384
|
PRINT: "print",
|
|
3271
2385
|
get isPrint() {
|
|
3272
|
-
return
|
|
2386
|
+
return L(this.PRINT);
|
|
3273
2387
|
},
|
|
3274
2388
|
HOVER: "(hover: hover)",
|
|
3275
2389
|
get isHover() {
|
|
3276
|
-
return
|
|
2390
|
+
return L(this.HOVER);
|
|
3277
2391
|
},
|
|
3278
2392
|
PWA: "(display-mode: standalone)",
|
|
2393
|
+
// PWA: '(display-mode: browser)', // debugging
|
|
3279
2394
|
get isPWA() {
|
|
3280
|
-
return
|
|
2395
|
+
return L(this.PWA);
|
|
3281
2396
|
},
|
|
3282
2397
|
MOTION_REDUCE: "(prefers-reduced-motion: reduce)",
|
|
3283
2398
|
get isMotionReduce() {
|
|
3284
|
-
return
|
|
2399
|
+
return L(this.MOTION_REDUCE);
|
|
3285
2400
|
},
|
|
3286
2401
|
DATA_REDUCE: "(prefers-reduced-data: reduce)",
|
|
3287
2402
|
get isDataReduce() {
|
|
3288
|
-
return
|
|
2403
|
+
return L(this.DATA_REDUCE);
|
|
3289
2404
|
},
|
|
3290
2405
|
WATCH: "(width < 320px)",
|
|
3291
2406
|
get isWatch() {
|
|
3292
|
-
return
|
|
2407
|
+
return L(this.WATCH);
|
|
3293
2408
|
},
|
|
3294
2409
|
SMALL_PHONE: "(320px <= width <= 480px) and (height <= 640px)",
|
|
3295
2410
|
get isSmallPhone() {
|
|
3296
|
-
return
|
|
2411
|
+
return L(this.SMALL_PHONE);
|
|
3297
2412
|
},
|
|
3298
2413
|
PHONE: "(320px <= width <= 480px)",
|
|
3299
2414
|
get isPhone() {
|
|
3300
|
-
return
|
|
2415
|
+
return L(this.PHONE);
|
|
3301
2416
|
},
|
|
3302
2417
|
PHONE_LANDSCAPE: "(480px < width < 960px) and (orientation: landscape)",
|
|
2418
|
+
// PHONE_LANDSCAPE: '(480px < width < 960px)',
|
|
3303
2419
|
get isPhoneLandscape() {
|
|
3304
|
-
return
|
|
2420
|
+
return L(this.PHONE_LANDSCAPE);
|
|
3305
2421
|
},
|
|
2422
|
+
// Widget
|
|
3306
2423
|
SHORT: "(width >= 480px) and (height <= 320px)",
|
|
3307
2424
|
get isShort() {
|
|
3308
|
-
return
|
|
2425
|
+
return L(this.SHORT);
|
|
3309
2426
|
},
|
|
2427
|
+
// 1280 x 850
|
|
2428
|
+
// 1024 x 768
|
|
3310
2429
|
TABLET: "(480px < width <= 1280px)",
|
|
3311
2430
|
get isTablet() {
|
|
3312
|
-
return
|
|
2431
|
+
return L(this.TABLET);
|
|
3313
2432
|
},
|
|
2433
|
+
// 1366x768
|
|
3314
2434
|
DESKTOP: "(width > 1280px) and (orientation: landscape)",
|
|
3315
2435
|
get isDesktop() {
|
|
3316
|
-
return
|
|
2436
|
+
return L(this.DESKTOP);
|
|
3317
2437
|
},
|
|
2438
|
+
// 1920x1080
|
|
3318
2439
|
WIDTHSCREEN: "(width >= 1920px) and (orientation: landscape)",
|
|
3319
2440
|
get isWidthScreen() {
|
|
3320
|
-
return
|
|
2441
|
+
return L(this.WIDTHSCREEN);
|
|
3321
2442
|
}
|
|
3322
2443
|
};
|
|
3323
|
-
export {
|
|
2444
|
+
export {
|
|
2445
|
+
Ut as GemActiveLinkElement,
|
|
2446
|
+
fe as GemDialogBaseElement,
|
|
2447
|
+
A as GemElement,
|
|
2448
|
+
tt as GemError,
|
|
2449
|
+
hi as GemLightRouteElement,
|
|
2450
|
+
x as GemLinkElement,
|
|
2451
|
+
gn as GemReflectElement,
|
|
2452
|
+
ds as GemRouteElement,
|
|
2453
|
+
Nt as GemTitleElement,
|
|
2454
|
+
pn as GemUnsafeElement,
|
|
2455
|
+
Bt as GemUseElement,
|
|
2456
|
+
Vn as I18n,
|
|
2457
|
+
qs as LinkedList,
|
|
2458
|
+
mi as PREFIX,
|
|
2459
|
+
Us as PropProxyMap,
|
|
2460
|
+
It as QueryString,
|
|
2461
|
+
yi as SUFFIX,
|
|
2462
|
+
Gn as SVGTemplateResult,
|
|
2463
|
+
Yn as SheetToken,
|
|
2464
|
+
Vt as StoreListenerMap,
|
|
2465
|
+
_e as TemplateResult,
|
|
2466
|
+
zn as absoluteLocation,
|
|
2467
|
+
Jn as addListener,
|
|
2468
|
+
I as addMicrotask,
|
|
2469
|
+
Di as addMicrotaskToStack,
|
|
2470
|
+
Xi as adoptedStyle,
|
|
2471
|
+
C as attribute,
|
|
2472
|
+
ii as basePathStore,
|
|
2473
|
+
es as boolattribute,
|
|
2474
|
+
j as camelToKebabCase,
|
|
2475
|
+
Bs as classMap,
|
|
2476
|
+
Ze as cleanObject,
|
|
2477
|
+
ct as connect,
|
|
2478
|
+
hn as connectStore,
|
|
2479
|
+
Ui as createCSSSheet,
|
|
2480
|
+
ci as createHistoryParams,
|
|
2481
|
+
er as createModalClass,
|
|
2482
|
+
dn as createPath,
|
|
2483
|
+
Ft as createStore,
|
|
2484
|
+
ki as createTheme,
|
|
2485
|
+
qi as css,
|
|
2486
|
+
tr as customElement,
|
|
2487
|
+
Wi as defaultReqInit,
|
|
2488
|
+
nn as defineAttribute,
|
|
2489
|
+
rn as defineCSSState,
|
|
2490
|
+
Dt as defineProperty,
|
|
2491
|
+
sn as defineRef,
|
|
2492
|
+
rr as del,
|
|
2493
|
+
we as directive,
|
|
2494
|
+
Ki as disconnect,
|
|
2495
|
+
Se as emitter,
|
|
2496
|
+
Bi as exportPartsMap,
|
|
2497
|
+
ir as get,
|
|
2498
|
+
nr as getThemeProps,
|
|
2499
|
+
Ti as getThemeStore,
|
|
2500
|
+
Qi as globalemitter,
|
|
2501
|
+
Ys as guard,
|
|
2502
|
+
y as history,
|
|
2503
|
+
G as html,
|
|
2504
|
+
Qn as ifDefined,
|
|
2505
|
+
js as isArrayChange,
|
|
2506
|
+
ot as kebabToCamelCase,
|
|
2507
|
+
ls as matchPath,
|
|
2508
|
+
cr as mediaQuery,
|
|
2509
|
+
on as nativeDefineElement,
|
|
2510
|
+
Ji as numattribute,
|
|
2511
|
+
tn as objectMapToString,
|
|
2512
|
+
Xs as part,
|
|
2513
|
+
Fi as partMap,
|
|
2514
|
+
ar as post,
|
|
2515
|
+
N as property,
|
|
2516
|
+
or as put,
|
|
2517
|
+
ve as randomStr,
|
|
2518
|
+
Jt as raw,
|
|
2519
|
+
zi as refobject,
|
|
2520
|
+
Fs as removeItems,
|
|
2521
|
+
Kn as render,
|
|
2522
|
+
Js as repeat,
|
|
2523
|
+
xe as request,
|
|
2524
|
+
Zi as rootElement,
|
|
2525
|
+
Yi as slot,
|
|
2526
|
+
Hi as splice,
|
|
2527
|
+
cn as state,
|
|
2528
|
+
ji as styleMap,
|
|
2529
|
+
Gi as styled,
|
|
2530
|
+
Vs as svg,
|
|
2531
|
+
qt as titleStore,
|
|
2532
|
+
nt as updateStore,
|
|
2533
|
+
Li as updateTheme,
|
|
2534
|
+
en as useStore,
|
|
2535
|
+
sr as useTheme,
|
|
2536
|
+
Ks as version
|
|
2537
|
+
};
|