@mantou/gem 1.5.0 → 1.5.1
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/elements/modal-base.d.ts +17 -17
- package/lib/utils.d.ts +6 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +39 -1
- package/lib/utils.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/lib/utils.ts +36 -2
- package/src/lib/version.ts +1 -1
- package/src/test/utils.test.ts +6 -0
- package/umd.js +5 -5
- package/umd.js.map +1 -1
package/elements/modal-base.d.ts
CHANGED
|
@@ -12,53 +12,53 @@ export declare function createModalClass<T extends Record<string, unknown>>(opti
|
|
|
12
12
|
new (): {
|
|
13
13
|
label: string;
|
|
14
14
|
readonly state?: Record<string, unknown> | undefined;
|
|
15
|
-
"__#
|
|
16
|
-
"__#
|
|
17
|
-
"__#
|
|
18
|
-
"__#
|
|
19
|
-
"__#
|
|
15
|
+
"__#2@#renderRoot": ShadowRoot | HTMLElement;
|
|
16
|
+
"__#2@#internals"?: ElementInternals | undefined;
|
|
17
|
+
"__#2@#isAppendReason"?: boolean | undefined;
|
|
18
|
+
"__#2@#isAsync"?: boolean | undefined;
|
|
19
|
+
"__#2@#effectList"?: {
|
|
20
20
|
callback: (depValues: any, oldDepValues?: any) => any;
|
|
21
21
|
initialized: boolean;
|
|
22
22
|
values?: any;
|
|
23
23
|
getDep?: (() => any) | undefined;
|
|
24
24
|
preCallback?: (() => void) | undefined;
|
|
25
25
|
}[] | undefined;
|
|
26
|
-
"__#
|
|
26
|
+
"__#2@#momeList"?: {
|
|
27
27
|
callback: (depValues: any, oldDepValues?: any) => any;
|
|
28
28
|
initialized: boolean;
|
|
29
29
|
values?: any;
|
|
30
30
|
getDep?: (() => any) | undefined;
|
|
31
31
|
preCallback?: (() => void) | undefined;
|
|
32
32
|
}[] | undefined;
|
|
33
|
-
"__#
|
|
33
|
+
"__#2@#unmountCallback"?: any;
|
|
34
34
|
readonly internals: ElementInternals;
|
|
35
35
|
setState: (payload: Partial<Record<string, unknown>>) => void;
|
|
36
|
-
"__#
|
|
36
|
+
"__#2@#exec": (list?: {
|
|
37
37
|
callback: (depValues: any, oldDepValues?: any) => any;
|
|
38
38
|
initialized: boolean;
|
|
39
39
|
values?: any;
|
|
40
40
|
getDep?: (() => any) | undefined;
|
|
41
41
|
preCallback?: (() => void) | undefined;
|
|
42
42
|
}[] | undefined) => void;
|
|
43
|
-
"__#
|
|
44
|
-
"__#
|
|
43
|
+
"__#2@#execEffect": () => void;
|
|
44
|
+
"__#2@#execMemo": () => void;
|
|
45
45
|
effect: <T_1 = any[] | undefined>(callback: (depValues: T_1, oldDepValues?: T_1 | undefined) => any, getDep?: (T_1 extends any[] ? () => [...T_1] : undefined) | undefined) => void;
|
|
46
46
|
memo: <T_2 = any[] | undefined>(callback: (depValues: T_2, oldDepValues?: T_2 | undefined) => any, getDep?: (T_2 extends any[] ? () => [...T_2] : undefined) | undefined) => void;
|
|
47
|
-
"__#
|
|
47
|
+
"__#2@#initEffect": () => void;
|
|
48
48
|
willMount?(): void | Promise<void>;
|
|
49
49
|
render?(): import("lit-html/lib/template-result").TemplateResult | null | undefined;
|
|
50
|
-
"__#
|
|
50
|
+
"__#2@#render": () => import("lit-html/lib/template-result").TemplateResult | null | undefined;
|
|
51
51
|
mounted?(): void | Promise<void> | (() => void);
|
|
52
52
|
shouldUpdate?(): boolean;
|
|
53
|
-
"__#
|
|
54
|
-
"__#
|
|
55
|
-
"__#
|
|
53
|
+
"__#2@#shouldUpdate": () => boolean;
|
|
54
|
+
"__#2@#updateCallback": () => void;
|
|
55
|
+
"__#2@#update": () => void;
|
|
56
56
|
update: () => void;
|
|
57
57
|
updated?(): void | Promise<void>;
|
|
58
|
-
"__#
|
|
58
|
+
"__#2@#updated": () => void;
|
|
59
59
|
unmounted?(): void | Promise<void>;
|
|
60
60
|
attributeChangedCallback(): void;
|
|
61
|
-
"__#
|
|
61
|
+
"__#2@#connectedCallback": () => void;
|
|
62
62
|
closestElement(clsOrName: string | CustomElementConstructor): Element | null;
|
|
63
63
|
connectedCallback(): void;
|
|
64
64
|
disconnectedCallback(): void;
|
package/lib/utils.d.ts
CHANGED
|
@@ -30,14 +30,19 @@ export declare class LinkedList<T extends NonPrimitive> extends LinkedList_base
|
|
|
30
30
|
export declare class PropProxyMap<T extends NonPrimitive, V = unknown> extends WeakMap<T, Record<string, V>> {
|
|
31
31
|
get(ele: T): Record<string, V>;
|
|
32
32
|
}
|
|
33
|
+
export declare function isObject(value: any): boolean;
|
|
33
34
|
declare global {
|
|
34
35
|
interface URLSearchParams {
|
|
35
36
|
entries(): Iterable<readonly [string | number | symbol, any]>;
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
export declare class QueryString extends URLSearchParams {
|
|
39
|
-
|
|
40
|
+
#private;
|
|
41
|
+
constructor(param?: any);
|
|
40
42
|
concat(param: any): void;
|
|
43
|
+
setAny(key: string, value: any): void;
|
|
44
|
+
getAny(key: string): any;
|
|
45
|
+
getAnyAll(key: string): any[];
|
|
41
46
|
toString(): string;
|
|
42
47
|
toJSON(): string;
|
|
43
48
|
}
|
package/lib/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/lib/utils.ts"],"names":[],"mappings":"AACA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,IAAI,QAW5C;AAWD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,IAAI,QAKnD;AAED,wBAAgB,gBAAgB,CAAC,WAAW,SAAK,EAAE,YAAY,SAAK,UAGnE;AAGD,oBAAY,YAAY,GAAG,MAAM,CAAC;AAElC,UAAU,kBAAkB;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,EAAE,KAAK,CAAC;CACZ;AACD,UAAU,cAAc,CAAC,CAAC;IACxB,KAAK,E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AAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,kBAAkB,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,SAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAgBzG;AAED,wBAAgB,SAAS,CAAC,MAAM,SAAI,EAAE,MAAM,SAAyC,UAOpF;AA2BD,eAAO,MAAM,MAAM;iBACJ,oBAAoB,WAAW,GAAG,EAAE;cAIvC,oBAAoB,WAAW,GAAG,EAAE;qBAI7B,oBAAoB,WAAW,GAAG,EAAE,KAAG,iBAAiB;CAK1E,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,UAE3C;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,UAE3C;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,KAMlE;AAED,qBAAa,QAAS,SAAQ,KAAK;gBACrB,GAAG,EAAE,MAAM;CAIxB;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,WAM/D;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,SAStD;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,mBAAmB,CAAC,UAMzD;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAQpD;AAED,eAAO,MAAM,OAAO,iBAAW,CAAC"}
|
package/lib/utils.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var _QueryString_stringify, _QueryString_parse;
|
|
1
7
|
const microtaskSet = new Set();
|
|
2
8
|
export function addMicrotask(func) {
|
|
3
9
|
if (typeof func !== 'function')
|
|
@@ -88,12 +94,26 @@ export class PropProxyMap extends WeakMap {
|
|
|
88
94
|
return proxy;
|
|
89
95
|
}
|
|
90
96
|
}
|
|
97
|
+
export function isObject(value) {
|
|
98
|
+
return typeof value === 'object';
|
|
99
|
+
}
|
|
91
100
|
export class QueryString extends URLSearchParams {
|
|
92
101
|
constructor(param) {
|
|
102
|
+
super(param);
|
|
103
|
+
_QueryString_stringify.set(this, (value) => (isObject(value) ? JSON.stringify(value) : value));
|
|
104
|
+
_QueryString_parse.set(this, (value) => {
|
|
105
|
+
if (!value)
|
|
106
|
+
return null;
|
|
107
|
+
try {
|
|
108
|
+
return JSON.parse(value);
|
|
109
|
+
}
|
|
110
|
+
catch (_a) {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
93
114
|
if (param instanceof QueryString) {
|
|
94
115
|
return param;
|
|
95
116
|
}
|
|
96
|
-
super(param);
|
|
97
117
|
}
|
|
98
118
|
concat(param) {
|
|
99
119
|
let query;
|
|
@@ -107,6 +127,23 @@ export class QueryString extends URLSearchParams {
|
|
|
107
127
|
this.append(key, query[key]);
|
|
108
128
|
});
|
|
109
129
|
}
|
|
130
|
+
setAny(key, value) {
|
|
131
|
+
if (Array.isArray(value)) {
|
|
132
|
+
this.delete(key);
|
|
133
|
+
value.forEach((e) => this.append(key, __classPrivateFieldGet(this, _QueryString_stringify, "f").call(this, e)));
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
this.set(key, __classPrivateFieldGet(this, _QueryString_stringify, "f").call(this, value));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
getAny(key) {
|
|
140
|
+
return this.getAnyAll(key)[0];
|
|
141
|
+
}
|
|
142
|
+
getAnyAll(key) {
|
|
143
|
+
return this.getAll(key)
|
|
144
|
+
.filter((e) => e !== '')
|
|
145
|
+
.map((e) => __classPrivateFieldGet(this, _QueryString_parse, "f").call(this, e));
|
|
146
|
+
}
|
|
110
147
|
toString() {
|
|
111
148
|
const string = super.toString();
|
|
112
149
|
return string ? `?${string}` : '';
|
|
@@ -115,6 +152,7 @@ export class QueryString extends URLSearchParams {
|
|
|
115
152
|
return this.toString();
|
|
116
153
|
}
|
|
117
154
|
}
|
|
155
|
+
_QueryString_stringify = new WeakMap(), _QueryString_parse = new WeakMap();
|
|
118
156
|
/**
|
|
119
157
|
* 写纯文本,仅用于 IDE HTML 高亮
|
|
120
158
|
*
|
package/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/lib/utils.ts"],"names":[],"mappings":"AAAA,MAAM,YAAY,GAAG,IAAI,GAAG,EAAc,CAAC;AAC3C,MAAM,UAAU,YAAY,CAAC,IAAgB;IAC3C,IAAI,OAAO,IAAI,KAAK,UAAU;QAAE,OAAO;IACvC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;QACtB,kDAAkD;QAClD,UAAU,CAAC,cAAc,CAAC,GAAG,EAAE;YAC7B,YAAY,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;YACvC,YAAY,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC,CAAC,CAAC;KACJ;IACD,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC1B,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AAED,MAAM,cAAc,GAAmB,EAAE,CAAC;AAE1C,SAAS,kBAAkB;IACzB,KAAK,IAAI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,CAAC;SACd;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,GAAiC;IACxD,IAAI,WAAW,GAAG,EAAE,CAAC;IACrB,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;QACrB,WAAW,IAAI,GAAG,gBAAgB,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;KACxD;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,GAA4B;IACnD,IAAI,SAAS,GAAG,GAAG,CAAC;IACpB,KAAK,MAAM,SAAS,IAAI,GAAG,EAAE;QAC3B,IAAI,GAAG,CAAC,SAAS,CAAC,EAAE;YAClB,SAAS,IAAI,GAAG,SAAS,GAAG,CAAC;SAC9B;KACF;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC"}
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "1.5.
|
|
1
|
+
export declare const version = "1.5.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
package/src/lib/utils.ts
CHANGED
|
@@ -115,17 +115,21 @@ export class PropProxyMap<T extends NonPrimitive, V = unknown> extends WeakMap<T
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
export function isObject(value: any) {
|
|
119
|
+
return typeof value === 'object';
|
|
120
|
+
}
|
|
121
|
+
|
|
118
122
|
declare global {
|
|
119
123
|
interface URLSearchParams {
|
|
120
124
|
entries(): Iterable<readonly [string | number | symbol, any]>;
|
|
121
125
|
}
|
|
122
126
|
}
|
|
123
127
|
export class QueryString extends URLSearchParams {
|
|
124
|
-
constructor(param
|
|
128
|
+
constructor(param?: any) {
|
|
129
|
+
super(param);
|
|
125
130
|
if (param instanceof QueryString) {
|
|
126
131
|
return param;
|
|
127
132
|
}
|
|
128
|
-
super(param);
|
|
129
133
|
}
|
|
130
134
|
|
|
131
135
|
concat(param: any) {
|
|
@@ -140,6 +144,36 @@ export class QueryString extends URLSearchParams {
|
|
|
140
144
|
});
|
|
141
145
|
}
|
|
142
146
|
|
|
147
|
+
#stringify = (value: any) => (isObject(value) ? JSON.stringify(value) : value);
|
|
148
|
+
|
|
149
|
+
setAny(key: string, value: any) {
|
|
150
|
+
if (Array.isArray(value)) {
|
|
151
|
+
this.delete(key);
|
|
152
|
+
value.forEach((e) => this.append(key, this.#stringify(e)));
|
|
153
|
+
} else {
|
|
154
|
+
this.set(key, this.#stringify(value));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
#parse = (value: any) => {
|
|
159
|
+
if (!value) return null;
|
|
160
|
+
try {
|
|
161
|
+
return JSON.parse(value);
|
|
162
|
+
} catch {
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
getAny(key: string) {
|
|
168
|
+
return this.getAnyAll(key)[0];
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
getAnyAll(key: string) {
|
|
172
|
+
return this.getAll(key)
|
|
173
|
+
.filter((e) => e !== '')
|
|
174
|
+
.map((e) => this.#parse(e));
|
|
175
|
+
}
|
|
176
|
+
|
|
143
177
|
toString() {
|
|
144
178
|
const string = super.toString();
|
|
145
179
|
return string ? `?${string}` : '';
|
package/src/lib/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Do not modify manually
|
|
2
|
-
export const version = '1.5.
|
|
2
|
+
export const version = '1.5.1';
|
package/src/test/utils.test.ts
CHANGED
|
@@ -47,6 +47,12 @@ describe('utils 测试', () => {
|
|
|
47
47
|
expect(query.get('c')).to.equal('3');
|
|
48
48
|
query.concat({ d: 4 });
|
|
49
49
|
expect(query.toString()).to.equal('?a=1&b=2&c=3&d=4');
|
|
50
|
+
query.setAny('obj', { a: 1, b: 2 });
|
|
51
|
+
expect(query.getAny('obj')).to.deep.equal({ a: 1, b: 2 });
|
|
52
|
+
expect(query.getAnyAll('obj')).to.deep.equal([{ a: 1, b: 2 }]);
|
|
53
|
+
query.setAny('obj', [{ a: 1, b: 2 }]);
|
|
54
|
+
expect(query.getAny('obj')).to.deep.equal({ a: 1, b: 2 });
|
|
55
|
+
expect(query.getAnyAll('obj')).to.deep.equal([{ a: 1, b: 2 }]);
|
|
50
56
|
expect(new QueryString({ a: 1 }).toString()).to.equal('?a=1');
|
|
51
57
|
expect(new QueryString(query).toString()).to.equal(query.toString());
|
|
52
58
|
});
|
package/umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! For license information please see umd.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Gem=e():t.Gem=e()}(self,(function(){return(()=>{"use strict";var t={d:(e,n)=>{for(var s in n)t.o(n,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:n[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{DialogBaseElement:()=>Tn,GemActiveLinkElement:()=>ln,GemElement:()=>Se,GemError:()=>x,GemLightRouteElement:()=>rn,GemLinkElement:()=>cn,GemReflectElement:()=>wn,GemRouteElement:()=>on,GemTitleElement:()=>dn,GemUnsafeElement:()=>vn,GemUseElement:()=>mn,I18n:()=>Wn,LinkedList:()=>l,PropProxyMap:()=>h,QueryString:()=>u,SVGTemplateResult:()=>wt,SheetToken:()=>f,StoreListenerMap:()=>C,TemplateResult:()=>yt,absoluteLocation:()=>c,addMicrotask:()=>i,addMicrotaskToStack:()=>a,adoptedStyle:()=>qe,attribute:()=>Me,basePathStore:()=>J,boolattribute:()=>Ne,camelToKebabCase:()=>b,classMap:()=>O,cleanObject:()=>E,connect:()=>N,connectStore:()=>Ue,createCSSSheet:()=>m,createHistoryParams:()=>sn,createModalClass:()=>Sn,createPath:()=>nn,createStore:()=>$,createStoreSet:()=>L,createTheme:()=>Nn,css:()=>p,customElement:()=>Be,defineAttribute:()=>xe,defineCSSState:()=>Oe,defineProperty:()=>Pe,defineRef:()=>ke,del:()=>Gn,directive:()=>Y,disconnect:()=>j,emitter:()=>Ie,get:()=>Un,getThemeProp:()=>Mn,getThemeStore:()=>$n,globalemitter:()=>Ve,guard:()=>Kt,history:()=>R,html:()=>At,ifDefined:()=>Jt,isArrayChange:()=>_,kebabToCamelCase:()=>S,matchPath:()=>en,mediaQuery:()=>Kn,nativeDefineElement:()=>Te,numattribute:()=>je,part:()=>We,partMap:()=>T,post:()=>Fn,property:()=>Re,put:()=>Bn,randomStr:()=>g,raw:()=>d,refobject:()=>$e,removeItems:()=>P,render:()=>Rt,repeat:()=>Bt,request:()=>Vn,rootElement:()=>Ge,slot:()=>He,state:()=>Ae,styleMap:()=>k,styled:()=>w,svg:()=>Ht,titleStore:()=>Q,updateStore:()=>M,updateTheme:()=>jn,version:()=>Fe});var n={};t.r(n),t.d(n,{GemElement:()=>Se,GemError:()=>x,LinkedList:()=>l,PropProxyMap:()=>h,QueryString:()=>u,SVGTemplateResult:()=>wt,SheetToken:()=>f,StoreListenerMap:()=>C,TemplateResult:()=>yt,absoluteLocation:()=>c,addMicrotask:()=>i,addMicrotaskToStack:()=>a,adoptedStyle:()=>qe,attribute:()=>Me,basePathStore:()=>J,boolattribute:()=>Ne,camelToKebabCase:()=>b,classMap:()=>O,cleanObject:()=>E,connect:()=>N,connectStore:()=>Ue,createCSSSheet:()=>m,createStore:()=>$,createStoreSet:()=>L,css:()=>p,customElement:()=>Be,defineAttribute:()=>xe,defineCSSState:()=>Oe,defineProperty:()=>Pe,defineRef:()=>ke,directive:()=>Y,disconnect:()=>j,emitter:()=>Ie,globalemitter:()=>Ve,guard:()=>Kt,history:()=>R,html:()=>At,ifDefined:()=>Jt,isArrayChange:()=>_,kebabToCamelCase:()=>S,nativeDefineElement:()=>Te,numattribute:()=>je,part:()=>We,partMap:()=>T,property:()=>Re,randomStr:()=>g,raw:()=>d,refobject:()=>$e,removeItems:()=>P,render:()=>Rt,repeat:()=>Bt,rootElement:()=>Ge,slot:()=>He,state:()=>Ae,styleMap:()=>k,styled:()=>w,svg:()=>Ht,titleStore:()=>Q,updateStore:()=>M,version:()=>Fe});const s=new Set;function i(t){"function"==typeof t&&(s.size||globalThis.queueMicrotask((()=>{s.forEach((t=>t())),s.clear()})),s.delete(t),s.add(t))}const o=[];function r(){for(let t=o.length-1;t>=0;t--)o[t]();o.length=0}function a(t){o.length||i(r),o.push(t)}function c(t="",e=""){const{pathname:n,search:s,hash:i}=new URL(e,location.origin+t);return n+s+i}class l extends(globalThis.EventTarget||Object){constructor(){super(...arguments),this.pool=new Map}add(t){const e={value:t};this.firstItem||(this.dispatchEvent(new CustomEvent("start")),this.firstItem=e),this.lastItem&&(this.lastItem.next=e,e.prev=this.lastItem),this.lastItem=e;const n=this.pool.get(t);n&&(n.prev?n.prev.next=n.next:this.firstItem=n.next,n.next&&(n.next.prev=n.prev)),this.pool.set(t,e)}get(){const t=this.firstItem;if(t)return this.pool.delete(t.value),this.firstItem=t.next,this.firstItem||(this.lastItem=void 0,this.dispatchEvent(new CustomEvent("end"))),t.value}}class h extends WeakMap{get(t){let e=super.get(t);return e||(e={},this.set(t,e)),e}}class u extends URLSearchParams{constructor(t){if(t instanceof u)return t;super(t)}concat(t){let e;e="string"==typeof t?Object.fromEntries(new URLSearchParams(t).entries()):t,Object.keys(e).forEach((t=>{this.append(t,e[t])}))}toString(){const t=super.toString();return t?`?${t}`:""}toJSON(){return this.toString()}}function d(t,...e){return t.reduce(((t,n,s)=>{var i;return t+(null!==(i=e[s-1])&&void 0!==i?i:"")+n}))}function p(t,...e){return d(t,...e)}const f=Symbol("sheet token");function m(t,e=""){const n=new CSSStyleSheet,s={};n.media.mediaText=e;let i="";return"string"==typeof t?i=t:Object.keys(t).forEach((e=>{s[e]=`${e}-${g()}`,i+=t[e].styledContent.replace(/&/g,s[e])})),n.replaceSync(i),s[f]=n,s}function g(t=5,e="0123456789abcdefghijklmnopqrstuvwxyz"){const n=e.length;let s="";for(let i=0;i<t;i++)s+=e[Math.floor(Math.random()*n)];return s}const v=new RegExp("&.*{((.|\n)*)}","g");function y(t,e){const n=[];let s=`& {${t.replace(v,(t=>(n.push(t),"")))}}`+n.join("");return s=s.replace(/&/g,"class"===e?".&":"#&"),{styledContent:s,type:e}}const w={class:(t,...e)=>y(d(t,...e),"class"),id:(t,...e)=>y(d(t,...e),"id"),keyframes:(t,...e)=>({styledContent:`@keyframes & {${d(t,...e)}}`,type:"keyframes"})};function b(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}function S(t){return t.replace(/-(.)/g,((t,e)=>e.toUpperCase()))}function E(t){return Object.keys(t).forEach((e=>{delete t[e]})),t}class x extends Error{constructor(t){super(t),this.message=`gem: ${this.message}`}}function _(t,e){const n=t.length;for(let s=0;s<n;s++)if(t[s]!==e[s])return!0;return!1}function P(t,e){const n=new Set(e);return t.filter((t=>!n.has(t)||(n.delete(t),!1)))}function k(t){let e="";for(const n in t)e+=`${b(n)}:${t[n]};`;return e}function O(t){let e=" ";for(const n in t)t[n]&&(e+=`${n} `);return e}const T=O,C=new WeakMap;function $(t){if(C.has(t))throw new x("argument error");return C.set(t,new Set),t}function L(t){return Object.keys(t).forEach((e=>{$(t[e])})),t}function M(t,e){Object.assign(t,e);const n=C.get(t);null==n||n.forEach((t=>{i(t)}))}function N(t,e){const n=C.get(t);null==n||n.add(e)}function j(t,e){const n=C.get(t);null==n||n.delete(e)}const R=window.history,A=window.location,H=R.pushState.bind(R),W=R.replaceState.bind(R);let I=0;const V=()=>`${performance.now()}-${++I}`,D=$({$hasCloseHandle:!1,$hasOpenHandle:!1,$hasShouldCloseHandle:!1,$key:""}),q=new Map;function U({$key:t,$hasCloseHandle:e,$hasOpenHandle:n,$hasShouldCloseHandle:s}={}){if(D.$key!==t){if(t)throw new x("`$key` is not allowed");if(e)throw new x("`$hasCloseHandle` is not allowed");if(n)throw new x("`$hasOpenHandle` is not allowed");if(s)throw new x("`$hasShouldCloseHandle` is not allowed")}}function G(t){return R.basePath?R.basePath+t:t}function B(t){return t===R.basePath?"/":t.replace(new RegExp(`^${R.basePath}/`),"/")}function F(t){const e=q.get(D.$key)||{},n=t.path?c(e.path,t.path):B(A.pathname),s=new u(t.query||(t.path?"":A.search)),i=t.path&&t.path!==e.path||t.query&&String(t.query)!==String(e.query),o=t.title||"",r=t.close||t.data||t.open||t.shouldClose,a=t.hash||(!i&&r?decodeURIComponent(A.hash):"");return Object.assign(Object.assign({},t),{title:o,path:n,query:s,hash:a})}function K(t,e){U(e.data);const n=F(e),{title:s,path:i,query:o,hash:r,close:a,open:c,shouldClose:l,data:h}=n,d=Object.assign({$hasCloseHandle:!!a,$hasOpenHandle:!!c,$hasShouldCloseHandle:!!l,$key:V()},h);q.set(d.$key,n),M(E(D),d);const p=G(i)+new u(o)+r,f=decodeURIComponent(A.hash);("push"===t?H:W)(d,s,p),f!==r&&window.dispatchEvent(new CustomEvent("hashchange"))}function z(t,e,n,s){U(e);const i=Object.assign({$key:V()},e||{}),{pathname:o,search:r,hash:a}=new URL(s,A.origin+A.pathname),c=F({path:o,query:new u(r),hash:a,title:n,data:e});q.set(i.$key,c),M(E(D),i);const l=G(o)+c.query+a,h=A.hash;("push"===t?H:W)(i,n,l),h!==a&&window.dispatchEvent(new CustomEvent("hashchange"))}const J=$({basePath:""});if(window.addEventListener("hashchange",(({isTrusted:t})=>{t&&R.replace({hash:decodeURIComponent(A.hash)})})),Object.defineProperties(R,{basePath:{get:()=>J.basePath,set(t){M(J,{basePath:t}),Object.assign(q.get(D.$key),{path:B(A.pathname)})}},getParams:{value:function(){return q.get(D.$key)}},updateParams:{value:function(t){Object.assign(q.get(D.$key),t),M(D,{})}},store:{value:D},push:{value:function(t){R.pushState(t,"")}},pushIgnoreCloseHandle:{value:function(t){var e,n;D.$hasCloseHandle?(null===(n=null===(e=q.get(D.$key))||void 0===e?void 0:e.close)||void 0===n||n.call(e),R.replace(t)):R.push(t)}},replace:{value:function(t){K("replace",t)}}}),R.pushState=function(t,e,n){n?z("push",t,e,n):K("push",t)},R.replaceState=function(t,e,n){z("replace",t,e,n)},R.state)if(R.state.$hasCloseHandle){M(D,R.state);const t=F({title:document.title});q.set(D.$key,t),R.back()}else{const t=F({title:document.title,hash:A.hash});M(D,Object.assign({$key:V()},R.state||{})),q.set(D.$key,t)}else{const{pathname:t,search:e,hash:n}=A;R.replace({path:t,query:e,hash:n})}const Q=$({title:""});N(Q,(()=>{const t=q.get(D.$key);t&&(t.title=Q.title)})),N(D,(()=>{const{title:t}=R.getParams();t!==Q.title&&M(Q,{title:t})}));let Z=!1;window.addEventListener("popstate",(t=>{var e,n;const s=t.state;if(!(null==s?void 0:s.$key))return;if(Z)return void(Z=!1);if(!q.has(s.$key)){const{pathname:t,search:e,hash:n}=A;q.set(s.$key,{path:t,query:new u(e),hash:n,title:document.title,data:s})}const i=D;if(parseFloat(s.$key)>parseFloat(i.$key)&&s.$hasOpenHandle)null===(n=null===(e=q.get(s.$key))||void 0===e?void 0:e.open)||void 0===n||n.call(e);else if(i.$hasCloseHandle){const t=q.get(i.$key),e=null==t?void 0:t.close,n=null==t?void 0:t.shouldClose;if(n&&!n())return Z=!0,void R.forward();e?e():s.$hasCloseHandle&&(Z=!0,R.back())}M(E(D),s)}));const X=new WeakMap,Y=t=>(...e)=>{const n=t(...e);return X.set(n,!0),n},tt=t=>"function"==typeof t&&X.has(t),et="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,nt=(t,e,n=null,s=null)=>{for(;e!==n;){const n=e.nextSibling;t.insertBefore(e,s),e=n}},st=(t,e,n=null)=>{for(;e!==n;){const n=e.nextSibling;t.removeChild(e),e=n}},it={},ot={},rt=`{{lit-${String(Math.random()).slice(2)}}}`,at=`\x3c!--${rt}--\x3e`,ct=new RegExp(`${rt}|${at}`),lt="$lit$";class ht{constructor(t,e){this.parts=[],this.element=e;const n=[],s=[],i=document.createTreeWalker(e.content,133,null,!1);let o=0,r=-1,a=0;const{strings:c,values:{length:l}}=t;for(;a<l;){const t=i.nextNode();if(null!==t){if(r++,1===t.nodeType){if(t.hasAttributes()){const e=t.attributes,{length:n}=e;let s=0;for(let t=0;t<n;t++)ut(e[t].name,lt)&&s++;for(;s-- >0;){const e=c[a],n=ft.exec(e)[2],s=n.toLowerCase()+lt,i=t.getAttribute(s);t.removeAttribute(s);const o=i.split(ct);this.parts.push({type:"attribute",index:r,name:n,strings:o}),a+=o.length-1}}"TEMPLATE"===t.tagName&&(s.push(t),i.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(rt)>=0){const s=t.parentNode,i=e.split(ct),o=i.length-1;for(let e=0;e<o;e++){let n,o=i[e];if(""===o)n=pt();else{const t=ft.exec(o);null!==t&&ut(t[2],lt)&&(o=o.slice(0,t.index)+t[1]+t[2].slice(0,-lt.length)+t[3]),n=document.createTextNode(o)}s.insertBefore(n,t),this.parts.push({type:"node",index:++r})}""===i[o]?(s.insertBefore(pt(),t),n.push(t)):t.data=i[o],a+=o}}else if(8===t.nodeType)if(t.data===rt){const e=t.parentNode;null!==t.previousSibling&&r!==o||(r++,e.insertBefore(pt(),t)),o=r,this.parts.push({type:"node",index:r}),null===t.nextSibling?t.data="":(n.push(t),r--),a++}else{let e=-1;for(;-1!==(e=t.data.indexOf(rt,e+1));)this.parts.push({type:"node",index:-1}),a++}}else i.currentNode=s.pop()}for(const t of n)t.parentNode.removeChild(t)}}const ut=(t,e)=>{const n=t.length-e.length;return n>=0&&t.slice(n)===e},dt=t=>-1!==t.index,pt=()=>document.createComment(""),ft=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class mt{constructor(t,e,n){this.__parts=[],this.template=t,this.processor=e,this.options=n}update(t){let e=0;for(const n of this.__parts)void 0!==n&&n.setValue(t[e]),e++;for(const t of this.__parts)void 0!==t&&t.commit()}_clone(){const t=et?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=[],n=this.template.parts,s=document.createTreeWalker(t,133,null,!1);let i,o=0,r=0,a=s.nextNode();for(;o<n.length;)if(i=n[o],dt(i)){for(;r<i.index;)r++,"TEMPLATE"===a.nodeName&&(e.push(a),s.currentNode=a.content),null===(a=s.nextNode())&&(s.currentNode=e.pop(),a=s.nextNode());if("node"===i.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(a.previousSibling),this.__parts.push(t)}else this.__parts.push(...this.processor.handleAttributeExpressions(a,i.name,i.strings,this.options));o++}else this.__parts.push(void 0),o++;return et&&(document.adoptNode(t),customElements.upgrade(t)),t}}const gt=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),vt=` ${rt} `;class yt{constructor(t,e,n,s){this.strings=t,this.values=e,this.type=n,this.processor=s}getHTML(){const t=this.strings.length-1;let e="",n=!1;for(let s=0;s<t;s++){const t=this.strings[s],i=t.lastIndexOf("\x3c!--");n=(i>-1||n)&&-1===t.indexOf("--\x3e",i+1);const o=ft.exec(t);e+=null===o?t+(n?vt:at):t.substr(0,o.index)+o[1]+o[2]+lt+o[3]+rt}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");let e=this.getHTML();return void 0!==gt&&(e=gt.createHTML(e)),t.innerHTML=e,t}}class wt extends yt{getHTML(){return`<svg>${super.getHTML()}</svg>`}getTemplateElement(){const t=super.getTemplateElement(),e=t.content,n=e.firstChild;return e.removeChild(n),nt(e,n.firstChild),t}}const bt=t=>null===t||!("object"==typeof t||"function"==typeof t),St=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class Et{constructor(t,e,n){this.dirty=!0,this.element=t,this.name=e,this.strings=n,this.parts=[];for(let t=0;t<n.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new xt(this)}_getValue(){const t=this.strings,e=t.length-1,n=this.parts;if(1===e&&""===t[0]&&""===t[1]){const t=n[0].value;if("symbol"==typeof t)return String(t);if("string"==typeof t||!St(t))return t}let s="";for(let i=0;i<e;i++){s+=t[i];const e=n[i];if(void 0!==e){const t=e.value;if(bt(t)||!St(t))s+="string"==typeof t?t:String(t);else for(const e of t)s+="string"==typeof e?e:String(e)}}return s+=t[e],s}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class xt{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===it||bt(t)&&t===this.value||(this.value=t,tt(t)||(this.committer.dirty=!0))}commit(){for(;tt(this.value);){const t=this.value;this.value=it,t(this)}this.value!==it&&this.committer.commit()}}class _t{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(pt()),this.endNode=t.appendChild(pt())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=pt()),t.__insert(this.endNode=pt())}insertAfterPart(t){t.__insert(this.startNode=pt()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){if(null===this.startNode.parentNode)return;for(;tt(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=it,t(this)}const t=this.__pendingValue;t!==it&&(bt(t)?t!==this.value&&this.__commitText(t):t instanceof yt?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):St(t)?this.__commitIterable(t):t===ot?(this.value=ot,this.clear()):this.__commitText(t))}__insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}__commitNode(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}__commitText(t){const e=this.startNode.nextSibling,n="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=n:this.__commitNode(document.createTextNode(n)),this.value=t}__commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof mt&&this.value.template===e)this.value.update(t.values);else{const n=new mt(e,t.processor,this.options),s=n._clone();n.update(t.values),this.__commitNode(s),this.value=n}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let n,s=0;for(const i of t)n=e[s],void 0===n&&(n=new _t(this.options),e.push(n),0===s?n.appendIntoPart(this):n.insertAfterPart(e[s-1])),n.setValue(i),n.commit(),s++;s<e.length&&(e.length=s,this.clear(n&&n.endNode))}clear(t=this.startNode){st(this.startNode.parentNode,t.nextSibling,this.endNode)}}class Pt{constructor(t,e,n){if(this.value=void 0,this.__pendingValue=void 0,2!==n.length||""!==n[0]||""!==n[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=n}setValue(t){this.__pendingValue=t}commit(){for(;tt(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=it,t(this)}if(this.__pendingValue===it)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=it}}class kt extends Et{constructor(t,e,n){super(t,e,n),this.single=2===n.length&&""===n[0]&&""===n[1]}_createPart(){return new Ot(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class Ot extends xt{}let Tt=!1;(()=>{try{const t={get capture(){return Tt=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class Ct{constructor(t,e,n){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=n,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;tt(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=it,t(this)}if(this.__pendingValue===it)return;const t=this.__pendingValue,e=this.value,n=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),s=null!=t&&(null==e||n);n&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),s&&(this.__options=$t(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=it}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const $t=t=>t&&(Tt?{capture:t.capture,passive:t.passive,once:t.once}:t.capture),Lt=new class{handleAttributeExpressions(t,e,n,s){const i=e[0];return"."===i?new kt(t,e.slice(1),n).parts:"@"===i?[new Ct(t,e.slice(1),s.eventContext)]:"?"===i?[new Pt(t,e.slice(1),n)]:new Et(t,e,n).parts}handleTextExpression(t){return new _t(t)}};function Mt(t){let e=Nt.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},Nt.set(t.type,e));let n=e.stringsArray.get(t.strings);if(void 0!==n)return n;const s=t.strings.join(rt);return n=e.keyString.get(s),void 0===n&&(n=new ht(t,t.getTemplateElement()),e.keyString.set(s,n)),e.stringsArray.set(t.strings,n),n}const Nt=new Map,jt=new WeakMap,Rt=(t,e,n)=>{let s=jt.get(e);void 0===s&&(st(e,e.firstChild),jt.set(e,s=new _t(Object.assign({templateFactory:Mt},n))),s.appendInto(e)),s.setValue(t),s.commit()};"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const At=(t,...e)=>new yt(t,e,"html",Lt),Ht=(t,...e)=>new wt(t,e,"svg",Lt),Wt=(t,e)=>{const n=t.startNode.parentNode,s=void 0===e?t.endNode:e.startNode,i=n.insertBefore(pt(),s);n.insertBefore(pt(),s);const o=new _t(t.options);return o.insertAfterNode(i),o},It=(t,e)=>(t.setValue(e),t.commit(),t),Vt=(t,e,n)=>{const s=t.startNode.parentNode,i=n?n.startNode:t.endNode,o=e.endNode.nextSibling;o!==i&&nt(s,e.startNode,o,i)},Dt=t=>{st(t.startNode.parentNode,t.startNode,t.endNode.nextSibling)},qt=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},Ut=new WeakMap,Gt=new WeakMap,Bt=Y(((t,e,n)=>{let s;return void 0===n?n=e:void 0!==e&&(s=e),e=>{if(!(e instanceof _t))throw new Error("repeat can only be used in text bindings");const i=Ut.get(e)||[],o=Gt.get(e)||[],r=[],a=[],c=[];let l,h,u=0;for(const e of t)c[u]=s?s(e,u):u,a[u]=n(e,u),u++;let d=0,p=i.length-1,f=0,m=a.length-1;for(;d<=p&&f<=m;)if(null===i[d])d++;else if(null===i[p])p--;else if(o[d]===c[f])r[f]=It(i[d],a[f]),d++,f++;else if(o[p]===c[m])r[m]=It(i[p],a[m]),p--,m--;else if(o[d]===c[m])r[m]=It(i[d],a[m]),Vt(e,i[d],r[m+1]),d++,m--;else if(o[p]===c[f])r[f]=It(i[p],a[f]),Vt(e,i[p],i[d]),p--,f++;else if(void 0===l&&(l=qt(c,f,m),h=qt(o,d,p)),l.has(o[d]))if(l.has(o[p])){const t=h.get(c[f]),n=void 0!==t?i[t]:null;if(null===n){const t=Wt(e,i[d]);It(t,a[f]),r[f]=t}else r[f]=It(n,a[f]),Vt(e,n,i[d]),i[t]=null;f++}else Dt(i[p]),p--;else Dt(i[d]),d++;for(;f<=m;){const t=Wt(e,r[m+1]);It(t,a[f]),r[f++]=t}for(;d<=p;){const t=i[d++];null!==t&&Dt(t)}Ut.set(e,r),Gt.set(e,c)}})),Ft=new WeakMap,Kt=Y(((t,e)=>n=>{const s=Ft.get(n);if(Array.isArray(t)){if(Array.isArray(s)&&s.length===t.length&&t.every(((t,e)=>t===s[e])))return}else if(s===t&&(void 0!==t||Ft.has(n)))return;n.setValue(e()),Ft.set(n,Array.isArray(t)?Array.from(t):t)})),zt=new WeakMap,Jt=Y((t=>e=>{const n=zt.get(e);if(void 0===t&&e instanceof xt){if(void 0!==n||!zt.has(e)){const t=e.committer.name;e.committer.element.removeAttribute(t)}}else t!==n&&e.setValue(t);zt.set(e,t)}));var Qt,Zt,Xt,Yt,te,ee,ne,se,ie,oe,re,ae,ce,le,he,ue,de,pe=function(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)},fe=function(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n};function me(){}function ge(t){"function"==typeof t&&t()}const ve=new l,ye=()=>{window.requestAnimationFrame((function t(e){if(performance.now()>e+16)return void ye();const n=ve.get();n&&(n(),t(e))}))};ve.addEventListener("start",ye);const we=Symbol("init"),be=Symbol("update");class Se extends HTMLElement{constructor({isAsync:t,isLight:e,delegatesFocus:n}={}){super(),Qt.set(this,void 0),Zt.set(this,void 0),Xt.set(this,void 0),Yt.set(this,void 0),te.set(this,void 0),ee.set(this,void 0),ne.set(this,void 0),this.setState=t=>{if(!this.state)throw new x("`state` not initialized");Object.assign(this.state,t),i(pe(this,he,"f"))},se.set(this,(t=>{null==t||t.forEach((t=>{const{callback:e,getDep:n,values:s,preCallback:i}=t,o=null==n?void 0:n();n&&!_(s,o)||(ge(i),t.preCallback=e(o,s),t.values=o)}))})),ie.set(this,(()=>{pe(this,se,"f").call(this,pe(this,te,"f"))})),oe.set(this,(()=>{pe(this,se,"f").call(this,pe(this,ee,"f"))})),this.effect=(t,e)=>{pe(this,te,"f")||fe(this,te,[],"f");const n=null==e?void 0:e(),s={callback:t,getDep:e,values:n,initialized:!!this.isConnected};this.isConnected&&(s.preCallback=t(n)),pe(this,te,"f").push(s)},this.memo=(t,e)=>{pe(this,ee,"f")||fe(this,ee,[],"f"),pe(this,ee,"f").push({callback:t,getDep:e,values:[Symbol()],initialized:this.isConnected})},re.set(this,(()=>{var t;null===(t=pe(this,te,"f"))||void 0===t||t.forEach((t=>{const{callback:e,getDep:n,initialized:s}=t;s||(t.preCallback=e(null==n?void 0:n()),t.initialized=!0)}))})),ae.set(this,(()=>(pe(this,oe,"f").call(this),this.render?this.render():pe(this,Qt,"f")===this?void 0:At`<slot></slot>`))),ce.set(this,(()=>!this.shouldUpdate||this.shouldUpdate())),le.set(this,(()=>{if(this.isConnected&&pe(this,ce,"f").call(this)){const t=pe(this,ae,"f").call(this);void 0!==t&&Rt(t,pe(this,Qt,"f")),i(pe(this,ue,"f")),i(pe(this,ie,"f"))}})),he.set(this,(()=>{pe(this,Yt,"f")?ve.add(pe(this,le,"f")):pe(this,le,"f").call(this)})),this.update=()=>{i(pe(this,he,"f"))},ue.set(this,(()=>{var t;null===(t=this.updated)||void 0===t||t.call(this)})),de.set(this,(()=>{var t,e,n;if(pe(this,Xt,"f"))return void fe(this,Xt,!1,"f");null===(t=this.willMount)||void 0===t||t.call(this);const{observedStores:s,rootElement:i}=this.constructor;null==s||s.forEach((t=>{N(t,pe(this,he,"f"))}));const o=pe(this,ae,"f").call(this);if(void 0!==o&&Rt(o,pe(this,Qt,"f")),fe(this,ne,null===(e=this.mounted)||void 0===e?void 0:e.call(this),"f"),pe(this,re,"f").call(this),i&&(null===(n=this.getRootNode().host)||void 0===n?void 0:n.tagName)!==i.toUpperCase())throw new x("not allow current root type")})),i((()=>this[we]=!1)),this[we]=!0,this[be]=()=>{this.isConnected&&i(pe(this,he,"f"))},fe(this,Yt,t,"f"),fe(this,Qt,e?this:this.attachShadow({mode:"open",delegatesFocus:n}),"f");const{adoptedStyleSheets:s}=new.target;if(s){const t=s.map((t=>t[f]||t));this.shadowRoot?this.shadowRoot.adoptedStyleSheets=t:this.effect((()=>{const e=this.getRootNode();return e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t],()=>{e.adoptedStyleSheets=P(e.adoptedStyleSheets,t)}}),(()=>[]))}}get internals(){if(!pe(this,Zt,"f")){const t=()=>{const{classList:t}=this;return{has:e=>t.contains(e),add:e=>t.add(e),delete:e=>t.remove(e)}};this.attachInternals||(this.attachInternals=()=>({states:t()})),fe(this,Zt,this.attachInternals(),"f"),pe(this,Zt,"f").states||(pe(this,Zt,"f").states=t())}return pe(this,Zt,"f")}attributeChangedCallback(){this.isConnected&&i(pe(this,he,"f"))}closestElement(t){const e="function"==typeof t,n="string"==typeof t&&t.toUpperCase(),s=i=>{const o=i.parentElement||i.getRootNode().host;if(!o)return null;if(e){if(o.constructor===t)return o}else if(o.tagName===n)return o;return s(o)};return s(this)}connectedCallback(){pe(this,Yt,"f")?ve.add(pe(this,de,"f")):pe(this,de,"f").call(this)}disconnectedCallback(){var t,e,n;if(this.isConnected)return void fe(this,Xt,!0,"f");const{observedStores:s}=this.constructor;null==s||s.forEach((t=>{j(t,pe(this,he,"f"))})),ge(pe(this,ne,"f")),null===(t=this.unmounted)||void 0===t||t.call(this),null===(e=pe(this,te,"f"))||void 0===e||e.forEach((t=>{ge(t.preCallback)})),fe(this,ee,null===(n=pe(this,ee,"f"))||void 0===n?void 0:n.filter((({initialized:t})=>!t)),"f")}}Qt=new WeakMap,Zt=new WeakMap,Xt=new WeakMap,Yt=new WeakMap,te=new WeakMap,ee=new WeakMap,ne=new WeakMap,se=new WeakMap,ie=new WeakMap,oe=new WeakMap,re=new WeakMap,ae=new WeakMap,ce=new WeakMap,le=new WeakMap,he=new WeakMap,ue=new WeakMap,de=new WeakMap;const Ee=new h;function xe(t,e,n){const{booleanAttributes:s,numberAttributes:i}=t.constructor;Object.defineProperty(t,e,{configurable:!0,get(){if(!(we in this))return;const t=this.getAttribute(n);return(null==s?void 0:s.has(n))?null!==t:(null==i?void 0:i.has(n))?Number(t):t||""},set(t){const i=this,o=Ee.get(this),r=o[e],a=i.getAttribute(n);if(this[we]&&null!==a&&!r)return;o[e]=!0;const c=null==s?void 0:s.has(n);null==t?i.removeAttribute(n):c?i.toggleAttribute(n,!!t):a!==String(t)&&i.setAttribute(n,String(t))}})}const _e=Symbol("event handle");function Pe(t,e,n,s){Object.defineProperty(t,e,{configurable:!0,get(){const t=Ee.get(this)[e];return t||!n?t:(this[e]=me,this[e])},set(t){const i=this,o=Ee.get(i);t!==o[e]&&(n?(o[e]=(null==t?void 0:t[_e])?t:(e,o)=>{const r=new CustomEvent(n,Object.assign(Object.assign(Object.assign({},o),s),{detail:e}));i.dispatchEvent(r),t(e,o)},o[e][_e]=!0):(o[e]=t,this[be]()))}})}function ke(t,e,n){Object.defineProperty(t,e,{configurable:!0,get(){const t=Ee.get(this);let s=t[e];if(!s){const i=this,o=i.shadowRoot||i;s={get ref(){return n},get element(){const t=[...o.querySelectorAll("gem-reflect")].map((t=>t.target));for(const e of[o,...t]){const t=e.querySelector(`[ref=${n}]`);if(t)return t}}},t[e]=s}return s}})}function Oe(t,e,n){Object.defineProperty(t,e,{configurable:!0,get(){var t;const{states:e}=this.internals;return null===(t=e.has)||void 0===t?void 0:t.call(e,n)},set(t){const{states:e}=this.internals;t?e.add(n):e.delete(n)}})}const Te=customElements.define.bind(customElements);function Ce(t,e,n,s=!1){const i=t.constructor,o=i[e];i.hasOwnProperty(e)||Object.defineProperty(i,e,{value:s?new Set(o):o?Array.from(o):[]}),i[e][s?"add":"push"](n)}function $e(t,e){const n=`${b(e)}-${g()}`;Ce(t,"defineRefs",n),ke(t,e,n)}function Le(t,e,n){Ce(t,"observedAttributes",n),xe(t,e,n)}function Me(t,e){Le(t,e,b(e))}function Ne(t,e){const n=b(e);Ce(t,"booleanAttributes",n,!0),Le(t,e,n)}function je(t,e){const n=b(e);Ce(t,"numberAttributes",n,!0),Le(t,e,n)}function Re(t,e){Ce(t,"observedPropertys",e),Pe(t,e)}function Ae(t,e){const n=b(e);Ce(t,"defineCSSStates",n),Oe(t,e,`--${n}`)}function He(t,e){const n=b(t[e]||e);t[e]=n,Ce(t instanceof Se?t:t.prototype,"defineSlots",n)}function We(t,e){const n=b(t[e]||e);t[e]=n,Ce(t instanceof Se?t:t.prototype,"defineParts",n)}function Ie(t,e){De(t,e)}function Ve(t,e){De(t,e,{bubbles:!0,composed:!0})}function De(t,e,n){const s=b(e);Ce(t,"defineEvents",s),Pe(t,e,s,n)}function qe(t){return function(e){Ce(e.prototype,"adoptedStyleSheets",t)}}function Ue(t){return function(e){Ce(e.prototype,"observedStores",t)}}function Ge(t){return function(e){e.rootElement=t}}function Be(t){return function(e){Te(t,e)}}customElements.define=(t,e,n)=>{if(e.prototype instanceof Se){const{observedAttributes:t,observedPropertys:n,defineEvents:s,defineCSSStates:i,defineRefs:o}=e;null==t||t.forEach((t=>xe(e.prototype,S(t),t))),null==n||n.forEach((t=>Pe(e.prototype,t))),null==s||s.forEach((t=>Pe(e.prototype,S(t),t))),null==i||i.forEach((t=>Oe(e.prototype,S(t),`--${t}`))),null==o||o.forEach((t=>ke(e.prototype,S(t),t)))}Te(t,e,n)};const Fe="1.5.0";window.__GEM_DEVTOOLS__HOOK__&&Object.assign(window.__GEM_DEVTOOLS__HOOK__,Object.assign({},n));var Ke,ze,Je,Qe,Ze=function(t,e,n,s){var i,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o<3?i(r):o>3?i(e,n,r):i(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r},Xe=function(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n},Ye=function(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)};class tn extends RegExp{constructor(t){const e={};let n=0;super(`^${t.replace(/:([^/$]+)/g,((t,s)=>(e[s]=n++,"([^/]+)"))).replace("*",".*")}$`,"i"),this.namePosition=e}}function en(t,e){const n=new tn(t),s=e.match(n)||`${e}/`.match(n);if(!s)return null;const i={};return s&&Object.keys(n.namePosition).forEach((t=>{i[t]=s[n.namePosition[t]+1]})),i}function nn(t,e){let n=t.pattern;const s=null==e?void 0:e.params;return s&&Object.keys(s).forEach((t=>{n=n.replace(new RegExp(`:${t}`,"g"),s[t])})),n}function sn(t,e){const n=nn(t,e);return Object.assign({path:n},e)}let on=Qe=class extends Se{constructor({isLight:t,routes:e}={}){super({isLight:t}),this.currentParams={},Ke.set(this,void 0),this.state={content:void 0},ze.set(this,(()=>{if(this.locationStore){const{path:t,query:e,data:n}=R.getParams();M(this.locationStore,{path:t,params:this.currentParams,query:e,data:n})}})),Je.set(this,((t,e,n)=>{Xe(this,Ke,void 0,"f"),this.currentRoute=t,this.currentParams=e,this.setState({content:n}),this.change(this.currentRoute);const s=null==t?void 0:t.title;s&&M(Q,{title:s}),Ye(this,ze,"f").call(this)})),this.routes=e}mounted(){this.effect((([t,e])=>{const{route:n,params:s={}}=Qe.findRoute(this.routes,e),{redirect:i,content:o,getContent:r}=n||{};if(i)return void R.replace({path:i});const a=o||(null==r?void 0:r(s));if(a instanceof Promise){this.loading(n),Xe(this,Ke,a,"f");const t=()=>Ye(this,Ke,"f")===a;a.then((e=>{t()&&Ye(this,Je,"f").call(this,n,s,e)})).catch((e=>{t()&&this.error(e)}))}else Ye(this,Je,"f").call(this,n,s,a)}),(()=>{const{path:t}=R.getParams();return[this.key,t]})),this.effect(Ye(this,ze,"f"),(()=>[location.search]))}shouldUpdate(){return!this.inert}render(){const{content:t}=this.state;return this.shadowRoot?At`
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Gem=e():t.Gem=e()}(self,(function(){return(()=>{"use strict";var t={d:(e,n)=>{for(var s in n)t.o(n,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:n[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{DialogBaseElement:()=>Nn,GemActiveLinkElement:()=>pn,GemElement:()=>Pe,GemError:()=>O,GemLightRouteElement:()=>hn,GemLinkElement:()=>dn,GemReflectElement:()=>xn,GemRouteElement:()=>ln,GemTitleElement:()=>gn,GemUnsafeElement:()=>Sn,GemUseElement:()=>wn,I18n:()=>qn,LinkedList:()=>d,PropProxyMap:()=>p,QueryString:()=>m,SVGTemplateResult:()=>xt,SheetToken:()=>y,StoreListenerMap:()=>L,TemplateResult:()=>Et,absoluteLocation:()=>u,addMicrotask:()=>a,addMicrotaskToStack:()=>h,adoptedStyle:()=>Fe,attribute:()=>Re,basePathStore:()=>Y,boolattribute:()=>He,camelToKebabCase:()=>_,classMap:()=>M,cleanObject:()=>k,connect:()=>H,connectStore:()=>Ke,createCSSSheet:()=>w,createHistoryParams:()=>cn,createModalClass:()=>Pn,createPath:()=>an,createStore:()=>j,createStoreSet:()=>A,createTheme:()=>Hn,css:()=>v,customElement:()=>Je,defineAttribute:()=>Oe,defineCSSState:()=>Me,defineProperty:()=>Ce,defineRef:()=>$e,del:()=>zn,directive:()=>st,disconnect:()=>W,emitter:()=>Ue,get:()=>Kn,getThemeProp:()=>Rn,getThemeStore:()=>jn,globalemitter:()=>Ge,guard:()=>Zt,history:()=>I,html:()=>Vt,ifDefined:()=>Yt,isArrayChange:()=>T,isObject:()=>f,kebabToCamelCase:()=>P,matchPath:()=>rn,mediaQuery:()=>Zn,nativeDefineElement:()=>Ne,numattribute:()=>We,part:()=>qe,partMap:()=>N,post:()=>Qn,property:()=>Ie,put:()=>Jn,randomStr:()=>b,raw:()=>g,refobject:()=>je,removeItems:()=>C,render:()=>It,repeat:()=>Jt,request:()=>Gn,rootElement:()=>ze,slot:()=>De,state:()=>Ve,styleMap:()=>$,styled:()=>x,svg:()=>Dt,titleStore:()=>tt,updateStore:()=>R,updateTheme:()=>Wn,version:()=>Qe});var n={};t.r(n),t.d(n,{GemElement:()=>Pe,GemError:()=>O,LinkedList:()=>d,PropProxyMap:()=>p,QueryString:()=>m,SVGTemplateResult:()=>xt,SheetToken:()=>y,StoreListenerMap:()=>L,TemplateResult:()=>Et,absoluteLocation:()=>u,addMicrotask:()=>a,addMicrotaskToStack:()=>h,adoptedStyle:()=>Fe,attribute:()=>Re,basePathStore:()=>Y,boolattribute:()=>He,camelToKebabCase:()=>_,classMap:()=>M,cleanObject:()=>k,connect:()=>H,connectStore:()=>Ke,createCSSSheet:()=>w,createStore:()=>j,createStoreSet:()=>A,css:()=>v,customElement:()=>Je,defineAttribute:()=>Oe,defineCSSState:()=>Me,defineProperty:()=>Ce,defineRef:()=>$e,directive:()=>st,disconnect:()=>W,emitter:()=>Ue,globalemitter:()=>Ge,guard:()=>Zt,history:()=>I,html:()=>Vt,ifDefined:()=>Yt,isArrayChange:()=>T,isObject:()=>f,kebabToCamelCase:()=>P,nativeDefineElement:()=>Ne,numattribute:()=>We,part:()=>qe,partMap:()=>N,property:()=>Ie,randomStr:()=>b,raw:()=>g,refobject:()=>je,removeItems:()=>C,render:()=>It,repeat:()=>Jt,rootElement:()=>ze,slot:()=>De,state:()=>Ve,styleMap:()=>$,styled:()=>x,svg:()=>Dt,titleStore:()=>tt,updateStore:()=>R,version:()=>Qe});var s,i,o=function(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)};const r=new Set;function a(t){"function"==typeof t&&(r.size||globalThis.queueMicrotask((()=>{r.forEach((t=>t())),r.clear()})),r.delete(t),r.add(t))}const c=[];function l(){for(let t=c.length-1;t>=0;t--)c[t]();c.length=0}function h(t){c.length||a(l),c.push(t)}function u(t="",e=""){const{pathname:n,search:s,hash:i}=new URL(e,location.origin+t);return n+s+i}class d extends(globalThis.EventTarget||Object){constructor(){super(...arguments),this.pool=new Map}add(t){const e={value:t};this.firstItem||(this.dispatchEvent(new CustomEvent("start")),this.firstItem=e),this.lastItem&&(this.lastItem.next=e,e.prev=this.lastItem),this.lastItem=e;const n=this.pool.get(t);n&&(n.prev?n.prev.next=n.next:this.firstItem=n.next,n.next&&(n.next.prev=n.prev)),this.pool.set(t,e)}get(){const t=this.firstItem;if(t)return this.pool.delete(t.value),this.firstItem=t.next,this.firstItem||(this.lastItem=void 0,this.dispatchEvent(new CustomEvent("end"))),t.value}}class p extends WeakMap{get(t){let e=super.get(t);return e||(e={},this.set(t,e)),e}}function f(t){return"object"==typeof t}class m extends URLSearchParams{constructor(t){if(super(t),s.set(this,(t=>f(t)?JSON.stringify(t):t)),i.set(this,(t=>{if(!t)return null;try{return JSON.parse(t)}catch(t){return null}})),t instanceof m)return t}concat(t){let e;e="string"==typeof t?Object.fromEntries(new URLSearchParams(t).entries()):t,Object.keys(e).forEach((t=>{this.append(t,e[t])}))}setAny(t,e){Array.isArray(e)?(this.delete(t),e.forEach((e=>this.append(t,o(this,s,"f").call(this,e))))):this.set(t,o(this,s,"f").call(this,e))}getAny(t){return this.getAnyAll(t)[0]}getAnyAll(t){return this.getAll(t).filter((t=>""!==t)).map((t=>o(this,i,"f").call(this,t)))}toString(){const t=super.toString();return t?`?${t}`:""}toJSON(){return this.toString()}}function g(t,...e){return t.reduce(((t,n,s)=>{var i;return t+(null!==(i=e[s-1])&&void 0!==i?i:"")+n}))}function v(t,...e){return g(t,...e)}s=new WeakMap,i=new WeakMap;const y=Symbol("sheet token");function w(t,e=""){const n=new CSSStyleSheet,s={};n.media.mediaText=e;let i="";return"string"==typeof t?i=t:Object.keys(t).forEach((e=>{s[e]=`${e}-${b()}`,i+=t[e].styledContent.replace(/&/g,s[e])})),n.replaceSync(i),s[y]=n,s}function b(t=5,e="0123456789abcdefghijklmnopqrstuvwxyz"){const n=e.length;let s="";for(let i=0;i<t;i++)s+=e[Math.floor(Math.random()*n)];return s}const S=new RegExp("&.*{((.|\n)*)}","g");function E(t,e){const n=[];let s=`& {${t.replace(S,(t=>(n.push(t),"")))}}`+n.join("");return s=s.replace(/&/g,"class"===e?".&":"#&"),{styledContent:s,type:e}}const x={class:(t,...e)=>E(g(t,...e),"class"),id:(t,...e)=>E(g(t,...e),"id"),keyframes:(t,...e)=>({styledContent:`@keyframes & {${g(t,...e)}}`,type:"keyframes"})};function _(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}function P(t){return t.replace(/-(.)/g,((t,e)=>e.toUpperCase()))}function k(t){return Object.keys(t).forEach((e=>{delete t[e]})),t}class O extends Error{constructor(t){super(t),this.message=`gem: ${this.message}`}}function T(t,e){const n=t.length;for(let s=0;s<n;s++)if(t[s]!==e[s])return!0;return!1}function C(t,e){const n=new Set(e);return t.filter((t=>!n.has(t)||(n.delete(t),!1)))}function $(t){let e="";for(const n in t)e+=`${_(n)}:${t[n]};`;return e}function M(t){let e=" ";for(const n in t)t[n]&&(e+=`${n} `);return e}const N=M,L=new WeakMap;function j(t){if(L.has(t))throw new O("argument error");return L.set(t,new Set),t}function A(t){return Object.keys(t).forEach((e=>{j(t[e])})),t}function R(t,e){Object.assign(t,e);const n=L.get(t);null==n||n.forEach((t=>{a(t)}))}function H(t,e){const n=L.get(t);null==n||n.add(e)}function W(t,e){const n=L.get(t);null==n||n.delete(e)}const I=window.history,V=window.location,D=I.pushState.bind(I),q=I.replaceState.bind(I);let U=0;const G=()=>`${performance.now()}-${++U}`,B=j({$hasCloseHandle:!1,$hasOpenHandle:!1,$hasShouldCloseHandle:!1,$key:""}),F=new Map;function K({$key:t,$hasCloseHandle:e,$hasOpenHandle:n,$hasShouldCloseHandle:s}={}){if(B.$key!==t){if(t)throw new O("`$key` is not allowed");if(e)throw new O("`$hasCloseHandle` is not allowed");if(n)throw new O("`$hasOpenHandle` is not allowed");if(s)throw new O("`$hasShouldCloseHandle` is not allowed")}}function z(t){return I.basePath?I.basePath+t:t}function J(t){return t===I.basePath?"/":t.replace(new RegExp(`^${I.basePath}/`),"/")}function Q(t){const e=F.get(B.$key)||{},n=t.path?u(e.path,t.path):J(V.pathname),s=new m(t.query||(t.path?"":V.search)),i=t.path&&t.path!==e.path||t.query&&String(t.query)!==String(e.query),o=t.title||"",r=t.close||t.data||t.open||t.shouldClose,a=t.hash||(!i&&r?decodeURIComponent(V.hash):"");return Object.assign(Object.assign({},t),{title:o,path:n,query:s,hash:a})}function Z(t,e){K(e.data);const n=Q(e),{title:s,path:i,query:o,hash:r,close:a,open:c,shouldClose:l,data:h}=n,u=Object.assign({$hasCloseHandle:!!a,$hasOpenHandle:!!c,$hasShouldCloseHandle:!!l,$key:G()},h);F.set(u.$key,n),R(k(B),u);const d=z(i)+new m(o)+r,p=decodeURIComponent(V.hash);("push"===t?D:q)(u,s,d),p!==r&&window.dispatchEvent(new CustomEvent("hashchange"))}function X(t,e,n,s){K(e);const i=Object.assign({$key:G()},e||{}),{pathname:o,search:r,hash:a}=new URL(s,V.origin+V.pathname),c=Q({path:o,query:new m(r),hash:a,title:n,data:e});F.set(i.$key,c),R(k(B),i);const l=z(o)+c.query+a,h=V.hash;("push"===t?D:q)(i,n,l),h!==a&&window.dispatchEvent(new CustomEvent("hashchange"))}const Y=j({basePath:""});if(window.addEventListener("hashchange",(({isTrusted:t})=>{t&&I.replace({hash:decodeURIComponent(V.hash)})})),Object.defineProperties(I,{basePath:{get:()=>Y.basePath,set(t){R(Y,{basePath:t}),Object.assign(F.get(B.$key),{path:J(V.pathname)})}},getParams:{value:function(){return F.get(B.$key)}},updateParams:{value:function(t){Object.assign(F.get(B.$key),t),R(B,{})}},store:{value:B},push:{value:function(t){I.pushState(t,"")}},pushIgnoreCloseHandle:{value:function(t){var e,n;B.$hasCloseHandle?(null===(n=null===(e=F.get(B.$key))||void 0===e?void 0:e.close)||void 0===n||n.call(e),I.replace(t)):I.push(t)}},replace:{value:function(t){Z("replace",t)}}}),I.pushState=function(t,e,n){n?X("push",t,e,n):Z("push",t)},I.replaceState=function(t,e,n){X("replace",t,e,n)},I.state)if(I.state.$hasCloseHandle){R(B,I.state);const t=Q({title:document.title});F.set(B.$key,t),I.back()}else{const t=Q({title:document.title,hash:V.hash});R(B,Object.assign({$key:G()},I.state||{})),F.set(B.$key,t)}else{const{pathname:t,search:e,hash:n}=V;I.replace({path:t,query:e,hash:n})}const tt=j({title:""});H(tt,(()=>{const t=F.get(B.$key);t&&(t.title=tt.title)})),H(B,(()=>{const{title:t}=I.getParams();t!==tt.title&&R(tt,{title:t})}));let et=!1;window.addEventListener("popstate",(t=>{var e,n;const s=t.state;if(!(null==s?void 0:s.$key))return;if(et)return void(et=!1);if(!F.has(s.$key)){const{pathname:t,search:e,hash:n}=V;F.set(s.$key,{path:t,query:new m(e),hash:n,title:document.title,data:s})}const i=B;if(parseFloat(s.$key)>parseFloat(i.$key)&&s.$hasOpenHandle)null===(n=null===(e=F.get(s.$key))||void 0===e?void 0:e.open)||void 0===n||n.call(e);else if(i.$hasCloseHandle){const t=F.get(i.$key),e=null==t?void 0:t.close,n=null==t?void 0:t.shouldClose;if(n&&!n())return et=!0,void I.forward();e?e():s.$hasCloseHandle&&(et=!0,I.back())}R(k(B),s)}));const nt=new WeakMap,st=t=>(...e)=>{const n=t(...e);return nt.set(n,!0),n},it=t=>"function"==typeof t&&nt.has(t),ot="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,rt=(t,e,n=null,s=null)=>{for(;e!==n;){const n=e.nextSibling;t.insertBefore(e,s),e=n}},at=(t,e,n=null)=>{for(;e!==n;){const n=e.nextSibling;t.removeChild(e),e=n}},ct={},lt={},ht=`{{lit-${String(Math.random()).slice(2)}}}`,ut=`\x3c!--${ht}--\x3e`,dt=new RegExp(`${ht}|${ut}`),pt="$lit$";class ft{constructor(t,e){this.parts=[],this.element=e;const n=[],s=[],i=document.createTreeWalker(e.content,133,null,!1);let o=0,r=-1,a=0;const{strings:c,values:{length:l}}=t;for(;a<l;){const t=i.nextNode();if(null!==t){if(r++,1===t.nodeType){if(t.hasAttributes()){const e=t.attributes,{length:n}=e;let s=0;for(let t=0;t<n;t++)mt(e[t].name,pt)&&s++;for(;s-- >0;){const e=c[a],n=yt.exec(e)[2],s=n.toLowerCase()+pt,i=t.getAttribute(s);t.removeAttribute(s);const o=i.split(dt);this.parts.push({type:"attribute",index:r,name:n,strings:o}),a+=o.length-1}}"TEMPLATE"===t.tagName&&(s.push(t),i.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(ht)>=0){const s=t.parentNode,i=e.split(dt),o=i.length-1;for(let e=0;e<o;e++){let n,o=i[e];if(""===o)n=vt();else{const t=yt.exec(o);null!==t&&mt(t[2],pt)&&(o=o.slice(0,t.index)+t[1]+t[2].slice(0,-pt.length)+t[3]),n=document.createTextNode(o)}s.insertBefore(n,t),this.parts.push({type:"node",index:++r})}""===i[o]?(s.insertBefore(vt(),t),n.push(t)):t.data=i[o],a+=o}}else if(8===t.nodeType)if(t.data===ht){const e=t.parentNode;null!==t.previousSibling&&r!==o||(r++,e.insertBefore(vt(),t)),o=r,this.parts.push({type:"node",index:r}),null===t.nextSibling?t.data="":(n.push(t),r--),a++}else{let e=-1;for(;-1!==(e=t.data.indexOf(ht,e+1));)this.parts.push({type:"node",index:-1}),a++}}else i.currentNode=s.pop()}for(const t of n)t.parentNode.removeChild(t)}}const mt=(t,e)=>{const n=t.length-e.length;return n>=0&&t.slice(n)===e},gt=t=>-1!==t.index,vt=()=>document.createComment(""),yt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class wt{constructor(t,e,n){this.__parts=[],this.template=t,this.processor=e,this.options=n}update(t){let e=0;for(const n of this.__parts)void 0!==n&&n.setValue(t[e]),e++;for(const t of this.__parts)void 0!==t&&t.commit()}_clone(){const t=ot?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=[],n=this.template.parts,s=document.createTreeWalker(t,133,null,!1);let i,o=0,r=0,a=s.nextNode();for(;o<n.length;)if(i=n[o],gt(i)){for(;r<i.index;)r++,"TEMPLATE"===a.nodeName&&(e.push(a),s.currentNode=a.content),null===(a=s.nextNode())&&(s.currentNode=e.pop(),a=s.nextNode());if("node"===i.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(a.previousSibling),this.__parts.push(t)}else this.__parts.push(...this.processor.handleAttributeExpressions(a,i.name,i.strings,this.options));o++}else this.__parts.push(void 0),o++;return ot&&(document.adoptNode(t),customElements.upgrade(t)),t}}const bt=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),St=` ${ht} `;class Et{constructor(t,e,n,s){this.strings=t,this.values=e,this.type=n,this.processor=s}getHTML(){const t=this.strings.length-1;let e="",n=!1;for(let s=0;s<t;s++){const t=this.strings[s],i=t.lastIndexOf("\x3c!--");n=(i>-1||n)&&-1===t.indexOf("--\x3e",i+1);const o=yt.exec(t);e+=null===o?t+(n?St:ut):t.substr(0,o.index)+o[1]+o[2]+pt+o[3]+ht}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");let e=this.getHTML();return void 0!==bt&&(e=bt.createHTML(e)),t.innerHTML=e,t}}class xt extends Et{getHTML(){return`<svg>${super.getHTML()}</svg>`}getTemplateElement(){const t=super.getTemplateElement(),e=t.content,n=e.firstChild;return e.removeChild(n),rt(e,n.firstChild),t}}const _t=t=>null===t||!("object"==typeof t||"function"==typeof t),Pt=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class kt{constructor(t,e,n){this.dirty=!0,this.element=t,this.name=e,this.strings=n,this.parts=[];for(let t=0;t<n.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new Ot(this)}_getValue(){const t=this.strings,e=t.length-1,n=this.parts;if(1===e&&""===t[0]&&""===t[1]){const t=n[0].value;if("symbol"==typeof t)return String(t);if("string"==typeof t||!Pt(t))return t}let s="";for(let i=0;i<e;i++){s+=t[i];const e=n[i];if(void 0!==e){const t=e.value;if(_t(t)||!Pt(t))s+="string"==typeof t?t:String(t);else for(const e of t)s+="string"==typeof e?e:String(e)}}return s+=t[e],s}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class Ot{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===ct||_t(t)&&t===this.value||(this.value=t,it(t)||(this.committer.dirty=!0))}commit(){for(;it(this.value);){const t=this.value;this.value=ct,t(this)}this.value!==ct&&this.committer.commit()}}class Tt{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(vt()),this.endNode=t.appendChild(vt())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=vt()),t.__insert(this.endNode=vt())}insertAfterPart(t){t.__insert(this.startNode=vt()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){if(null===this.startNode.parentNode)return;for(;it(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=ct,t(this)}const t=this.__pendingValue;t!==ct&&(_t(t)?t!==this.value&&this.__commitText(t):t instanceof Et?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):Pt(t)?this.__commitIterable(t):t===lt?(this.value=lt,this.clear()):this.__commitText(t))}__insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}__commitNode(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}__commitText(t){const e=this.startNode.nextSibling,n="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=n:this.__commitNode(document.createTextNode(n)),this.value=t}__commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof wt&&this.value.template===e)this.value.update(t.values);else{const n=new wt(e,t.processor,this.options),s=n._clone();n.update(t.values),this.__commitNode(s),this.value=n}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let n,s=0;for(const i of t)n=e[s],void 0===n&&(n=new Tt(this.options),e.push(n),0===s?n.appendIntoPart(this):n.insertAfterPart(e[s-1])),n.setValue(i),n.commit(),s++;s<e.length&&(e.length=s,this.clear(n&&n.endNode))}clear(t=this.startNode){at(this.startNode.parentNode,t.nextSibling,this.endNode)}}class Ct{constructor(t,e,n){if(this.value=void 0,this.__pendingValue=void 0,2!==n.length||""!==n[0]||""!==n[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=n}setValue(t){this.__pendingValue=t}commit(){for(;it(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=ct,t(this)}if(this.__pendingValue===ct)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=ct}}class $t extends kt{constructor(t,e,n){super(t,e,n),this.single=2===n.length&&""===n[0]&&""===n[1]}_createPart(){return new Mt(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class Mt extends Ot{}let Nt=!1;(()=>{try{const t={get capture(){return Nt=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class Lt{constructor(t,e,n){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=n,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;it(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=ct,t(this)}if(this.__pendingValue===ct)return;const t=this.__pendingValue,e=this.value,n=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),s=null!=t&&(null==e||n);n&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),s&&(this.__options=jt(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=ct}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const jt=t=>t&&(Nt?{capture:t.capture,passive:t.passive,once:t.once}:t.capture),At=new class{handleAttributeExpressions(t,e,n,s){const i=e[0];return"."===i?new $t(t,e.slice(1),n).parts:"@"===i?[new Lt(t,e.slice(1),s.eventContext)]:"?"===i?[new Ct(t,e.slice(1),n)]:new kt(t,e,n).parts}handleTextExpression(t){return new Tt(t)}};function Rt(t){let e=Ht.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},Ht.set(t.type,e));let n=e.stringsArray.get(t.strings);if(void 0!==n)return n;const s=t.strings.join(ht);return n=e.keyString.get(s),void 0===n&&(n=new ft(t,t.getTemplateElement()),e.keyString.set(s,n)),e.stringsArray.set(t.strings,n),n}const Ht=new Map,Wt=new WeakMap,It=(t,e,n)=>{let s=Wt.get(e);void 0===s&&(at(e,e.firstChild),Wt.set(e,s=new Tt(Object.assign({templateFactory:Rt},n))),s.appendInto(e)),s.setValue(t),s.commit()};"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const Vt=(t,...e)=>new Et(t,e,"html",At),Dt=(t,...e)=>new xt(t,e,"svg",At),qt=(t,e)=>{const n=t.startNode.parentNode,s=void 0===e?t.endNode:e.startNode,i=n.insertBefore(vt(),s);n.insertBefore(vt(),s);const o=new Tt(t.options);return o.insertAfterNode(i),o},Ut=(t,e)=>(t.setValue(e),t.commit(),t),Gt=(t,e,n)=>{const s=t.startNode.parentNode,i=n?n.startNode:t.endNode,o=e.endNode.nextSibling;o!==i&&rt(s,e.startNode,o,i)},Bt=t=>{at(t.startNode.parentNode,t.startNode,t.endNode.nextSibling)},Ft=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},Kt=new WeakMap,zt=new WeakMap,Jt=st(((t,e,n)=>{let s;return void 0===n?n=e:void 0!==e&&(s=e),e=>{if(!(e instanceof Tt))throw new Error("repeat can only be used in text bindings");const i=Kt.get(e)||[],o=zt.get(e)||[],r=[],a=[],c=[];let l,h,u=0;for(const e of t)c[u]=s?s(e,u):u,a[u]=n(e,u),u++;let d=0,p=i.length-1,f=0,m=a.length-1;for(;d<=p&&f<=m;)if(null===i[d])d++;else if(null===i[p])p--;else if(o[d]===c[f])r[f]=Ut(i[d],a[f]),d++,f++;else if(o[p]===c[m])r[m]=Ut(i[p],a[m]),p--,m--;else if(o[d]===c[m])r[m]=Ut(i[d],a[m]),Gt(e,i[d],r[m+1]),d++,m--;else if(o[p]===c[f])r[f]=Ut(i[p],a[f]),Gt(e,i[p],i[d]),p--,f++;else if(void 0===l&&(l=Ft(c,f,m),h=Ft(o,d,p)),l.has(o[d]))if(l.has(o[p])){const t=h.get(c[f]),n=void 0!==t?i[t]:null;if(null===n){const t=qt(e,i[d]);Ut(t,a[f]),r[f]=t}else r[f]=Ut(n,a[f]),Gt(e,n,i[d]),i[t]=null;f++}else Bt(i[p]),p--;else Bt(i[d]),d++;for(;f<=m;){const t=qt(e,r[m+1]);Ut(t,a[f]),r[f++]=t}for(;d<=p;){const t=i[d++];null!==t&&Bt(t)}Kt.set(e,r),zt.set(e,c)}})),Qt=new WeakMap,Zt=st(((t,e)=>n=>{const s=Qt.get(n);if(Array.isArray(t)){if(Array.isArray(s)&&s.length===t.length&&t.every(((t,e)=>t===s[e])))return}else if(s===t&&(void 0!==t||Qt.has(n)))return;n.setValue(e()),Qt.set(n,Array.isArray(t)?Array.from(t):t)})),Xt=new WeakMap,Yt=st((t=>e=>{const n=Xt.get(e);if(void 0===t&&e instanceof Ot){if(void 0!==n||!Xt.has(e)){const t=e.committer.name;e.committer.element.removeAttribute(t)}}else t!==n&&e.setValue(t);Xt.set(e,t)}));var te,ee,ne,se,ie,oe,re,ae,ce,le,he,ue,de,pe,fe,me,ge,ve=function(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)},ye=function(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n};function we(){}function be(t){"function"==typeof t&&t()}const Se=new d,Ee=()=>{window.requestAnimationFrame((function t(e){if(performance.now()>e+16)return void Ee();const n=Se.get();n&&(n(),t(e))}))};Se.addEventListener("start",Ee);const xe=Symbol("init"),_e=Symbol("update");class Pe extends HTMLElement{constructor({isAsync:t,isLight:e,delegatesFocus:n}={}){super(),te.set(this,void 0),ee.set(this,void 0),ne.set(this,void 0),se.set(this,void 0),ie.set(this,void 0),oe.set(this,void 0),re.set(this,void 0),this.setState=t=>{if(!this.state)throw new O("`state` not initialized");Object.assign(this.state,t),a(ve(this,fe,"f"))},ae.set(this,(t=>{null==t||t.forEach((t=>{const{callback:e,getDep:n,values:s,preCallback:i}=t,o=null==n?void 0:n();n&&!T(s,o)||(be(i),t.preCallback=e(o,s),t.values=o)}))})),ce.set(this,(()=>{ve(this,ae,"f").call(this,ve(this,ie,"f"))})),le.set(this,(()=>{ve(this,ae,"f").call(this,ve(this,oe,"f"))})),this.effect=(t,e)=>{ve(this,ie,"f")||ye(this,ie,[],"f");const n=null==e?void 0:e(),s={callback:t,getDep:e,values:n,initialized:!!this.isConnected};this.isConnected&&(s.preCallback=t(n)),ve(this,ie,"f").push(s)},this.memo=(t,e)=>{ve(this,oe,"f")||ye(this,oe,[],"f"),ve(this,oe,"f").push({callback:t,getDep:e,values:[Symbol()],initialized:this.isConnected})},he.set(this,(()=>{var t;null===(t=ve(this,ie,"f"))||void 0===t||t.forEach((t=>{const{callback:e,getDep:n,initialized:s}=t;s||(t.preCallback=e(null==n?void 0:n()),t.initialized=!0)}))})),ue.set(this,(()=>(ve(this,le,"f").call(this),this.render?this.render():ve(this,te,"f")===this?void 0:Vt`<slot></slot>`))),de.set(this,(()=>!this.shouldUpdate||this.shouldUpdate())),pe.set(this,(()=>{if(this.isConnected&&ve(this,de,"f").call(this)){const t=ve(this,ue,"f").call(this);void 0!==t&&It(t,ve(this,te,"f")),a(ve(this,me,"f")),a(ve(this,ce,"f"))}})),fe.set(this,(()=>{ve(this,se,"f")?Se.add(ve(this,pe,"f")):ve(this,pe,"f").call(this)})),this.update=()=>{a(ve(this,fe,"f"))},me.set(this,(()=>{var t;null===(t=this.updated)||void 0===t||t.call(this)})),ge.set(this,(()=>{var t,e,n;if(ve(this,ne,"f"))return void ye(this,ne,!1,"f");null===(t=this.willMount)||void 0===t||t.call(this);const{observedStores:s,rootElement:i}=this.constructor;null==s||s.forEach((t=>{H(t,ve(this,fe,"f"))}));const o=ve(this,ue,"f").call(this);if(void 0!==o&&It(o,ve(this,te,"f")),ye(this,re,null===(e=this.mounted)||void 0===e?void 0:e.call(this),"f"),ve(this,he,"f").call(this),i&&(null===(n=this.getRootNode().host)||void 0===n?void 0:n.tagName)!==i.toUpperCase())throw new O("not allow current root type")})),a((()=>this[xe]=!1)),this[xe]=!0,this[_e]=()=>{this.isConnected&&a(ve(this,fe,"f"))},ye(this,se,t,"f"),ye(this,te,e?this:this.attachShadow({mode:"open",delegatesFocus:n}),"f");const{adoptedStyleSheets:s}=new.target;if(s){const t=s.map((t=>t[y]||t));this.shadowRoot?this.shadowRoot.adoptedStyleSheets=t:this.effect((()=>{const e=this.getRootNode();return e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t],()=>{e.adoptedStyleSheets=C(e.adoptedStyleSheets,t)}}),(()=>[]))}}get internals(){if(!ve(this,ee,"f")){const t=()=>{const{classList:t}=this;return{has:e=>t.contains(e),add:e=>t.add(e),delete:e=>t.remove(e)}};this.attachInternals||(this.attachInternals=()=>({states:t()})),ye(this,ee,this.attachInternals(),"f"),ve(this,ee,"f").states||(ve(this,ee,"f").states=t())}return ve(this,ee,"f")}attributeChangedCallback(){this.isConnected&&a(ve(this,fe,"f"))}closestElement(t){const e="function"==typeof t,n="string"==typeof t&&t.toUpperCase(),s=i=>{const o=i.parentElement||i.getRootNode().host;if(!o)return null;if(e){if(o.constructor===t)return o}else if(o.tagName===n)return o;return s(o)};return s(this)}connectedCallback(){ve(this,se,"f")?Se.add(ve(this,ge,"f")):ve(this,ge,"f").call(this)}disconnectedCallback(){var t,e,n;if(this.isConnected)return void ye(this,ne,!0,"f");const{observedStores:s}=this.constructor;null==s||s.forEach((t=>{W(t,ve(this,fe,"f"))})),be(ve(this,re,"f")),null===(t=this.unmounted)||void 0===t||t.call(this),null===(e=ve(this,ie,"f"))||void 0===e||e.forEach((t=>{be(t.preCallback)})),ye(this,oe,null===(n=ve(this,oe,"f"))||void 0===n?void 0:n.filter((({initialized:t})=>!t)),"f")}}te=new WeakMap,ee=new WeakMap,ne=new WeakMap,se=new WeakMap,ie=new WeakMap,oe=new WeakMap,re=new WeakMap,ae=new WeakMap,ce=new WeakMap,le=new WeakMap,he=new WeakMap,ue=new WeakMap,de=new WeakMap,pe=new WeakMap,fe=new WeakMap,me=new WeakMap,ge=new WeakMap;const ke=new p;function Oe(t,e,n){const{booleanAttributes:s,numberAttributes:i}=t.constructor;Object.defineProperty(t,e,{configurable:!0,get(){if(!(xe in this))return;const t=this.getAttribute(n);return(null==s?void 0:s.has(n))?null!==t:(null==i?void 0:i.has(n))?Number(t):t||""},set(t){const i=this,o=ke.get(this),r=o[e],a=i.getAttribute(n);if(this[xe]&&null!==a&&!r)return;o[e]=!0;const c=null==s?void 0:s.has(n);null==t?i.removeAttribute(n):c?i.toggleAttribute(n,!!t):a!==String(t)&&i.setAttribute(n,String(t))}})}const Te=Symbol("event handle");function Ce(t,e,n,s){Object.defineProperty(t,e,{configurable:!0,get(){const t=ke.get(this)[e];return t||!n?t:(this[e]=we,this[e])},set(t){const i=this,o=ke.get(i);t!==o[e]&&(n?(o[e]=(null==t?void 0:t[Te])?t:(e,o)=>{const r=new CustomEvent(n,Object.assign(Object.assign(Object.assign({},o),s),{detail:e}));i.dispatchEvent(r),t(e,o)},o[e][Te]=!0):(o[e]=t,this[_e]()))}})}function $e(t,e,n){Object.defineProperty(t,e,{configurable:!0,get(){const t=ke.get(this);let s=t[e];if(!s){const i=this,o=i.shadowRoot||i;s={get ref(){return n},get element(){const t=[...o.querySelectorAll("gem-reflect")].map((t=>t.target));for(const e of[o,...t]){const t=e.querySelector(`[ref=${n}]`);if(t)return t}}},t[e]=s}return s}})}function Me(t,e,n){Object.defineProperty(t,e,{configurable:!0,get(){var t;const{states:e}=this.internals;return null===(t=e.has)||void 0===t?void 0:t.call(e,n)},set(t){const{states:e}=this.internals;t?e.add(n):e.delete(n)}})}const Ne=customElements.define.bind(customElements);function Le(t,e,n,s=!1){const i=t.constructor,o=i[e];i.hasOwnProperty(e)||Object.defineProperty(i,e,{value:s?new Set(o):o?Array.from(o):[]}),i[e][s?"add":"push"](n)}function je(t,e){const n=`${_(e)}-${b()}`;Le(t,"defineRefs",n),$e(t,e,n)}function Ae(t,e,n){Le(t,"observedAttributes",n),Oe(t,e,n)}function Re(t,e){Ae(t,e,_(e))}function He(t,e){const n=_(e);Le(t,"booleanAttributes",n,!0),Ae(t,e,n)}function We(t,e){const n=_(e);Le(t,"numberAttributes",n,!0),Ae(t,e,n)}function Ie(t,e){Le(t,"observedPropertys",e),Ce(t,e)}function Ve(t,e){const n=_(e);Le(t,"defineCSSStates",n),Me(t,e,`--${n}`)}function De(t,e){const n=_(t[e]||e);t[e]=n,Le(t instanceof Pe?t:t.prototype,"defineSlots",n)}function qe(t,e){const n=_(t[e]||e);t[e]=n,Le(t instanceof Pe?t:t.prototype,"defineParts",n)}function Ue(t,e){Be(t,e)}function Ge(t,e){Be(t,e,{bubbles:!0,composed:!0})}function Be(t,e,n){const s=_(e);Le(t,"defineEvents",s),Ce(t,e,s,n)}function Fe(t){return function(e){Le(e.prototype,"adoptedStyleSheets",t)}}function Ke(t){return function(e){Le(e.prototype,"observedStores",t)}}function ze(t){return function(e){e.rootElement=t}}function Je(t){return function(e){Ne(t,e)}}customElements.define=(t,e,n)=>{if(e.prototype instanceof Pe){const{observedAttributes:t,observedPropertys:n,defineEvents:s,defineCSSStates:i,defineRefs:o}=e;null==t||t.forEach((t=>Oe(e.prototype,P(t),t))),null==n||n.forEach((t=>Ce(e.prototype,t))),null==s||s.forEach((t=>Ce(e.prototype,P(t),t))),null==i||i.forEach((t=>Me(e.prototype,P(t),`--${t}`))),null==o||o.forEach((t=>$e(e.prototype,P(t),t)))}Ne(t,e,n)};const Qe="1.5.1";window.__GEM_DEVTOOLS__HOOK__&&Object.assign(window.__GEM_DEVTOOLS__HOOK__,Object.assign({},n));var Ze,Xe,Ye,tn,en=function(t,e,n,s){var i,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o<3?i(r):o>3?i(e,n,r):i(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r},nn=function(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n},sn=function(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)};class on extends RegExp{constructor(t){const e={};let n=0;super(`^${t.replace(/:([^/$]+)/g,((t,s)=>(e[s]=n++,"([^/]+)"))).replace("*",".*")}$`,"i"),this.namePosition=e}}function rn(t,e){const n=new on(t),s=e.match(n)||`${e}/`.match(n);if(!s)return null;const i={};return s&&Object.keys(n.namePosition).forEach((t=>{i[t]=s[n.namePosition[t]+1]})),i}function an(t,e){let n=t.pattern;const s=null==e?void 0:e.params;return s&&Object.keys(s).forEach((t=>{n=n.replace(new RegExp(`:${t}`,"g"),s[t])})),n}function cn(t,e){const n=an(t,e);return Object.assign({path:n},e)}let ln=tn=class extends Pe{constructor({isLight:t,routes:e}={}){super({isLight:t}),this.currentParams={},Ze.set(this,void 0),this.state={content:void 0},Xe.set(this,(()=>{if(this.locationStore){const{path:t,query:e,data:n}=I.getParams();R(this.locationStore,{path:t,params:this.currentParams,query:e,data:n})}})),Ye.set(this,((t,e,n)=>{nn(this,Ze,void 0,"f"),this.currentRoute=t,this.currentParams=e,this.setState({content:n}),this.change(this.currentRoute);const s=null==t?void 0:t.title;s&&R(tt,{title:s}),sn(this,Xe,"f").call(this)})),this.routes=e}mounted(){this.effect((([t,e])=>{const{route:n,params:s={}}=tn.findRoute(this.routes,e),{redirect:i,content:o,getContent:r}=n||{};if(i)return void I.replace({path:i});const a=o||(null==r?void 0:r(s));if(a instanceof Promise){this.loading(n),nn(this,Ze,a,"f");const t=()=>sn(this,Ze,"f")===a;a.then((e=>{t()&&sn(this,Ye,"f").call(this,n,s,e)})).catch((e=>{t()&&this.error(e)}))}else sn(this,Ye,"f").call(this,n,s,a)}),(()=>{const{path:t}=I.getParams();return[this.key,t]})),this.effect(sn(this,Xe,"f"),(()=>[location.search]))}shouldUpdate(){return!this.inert}render(){const{content:t}=this.state;return this.shadowRoot?Vt`
|
|
3
3
|
<style>
|
|
4
4
|
:host,
|
|
5
5
|
:not(:defined) {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
}
|
|
8
8
|
</style>
|
|
9
9
|
${t}
|
|
10
|
-
`:
|
|
10
|
+
`:Vt`${t}`}};Ze=new WeakMap,Xe=new WeakMap,Ye=new WeakMap,ln.createLocationStore=()=>{const{path:t,query:e,data:n}=I.getParams();return j({path:t,query:e,data:n,params:{}})},ln.findRoute=(t=[],e)=>{let n,s=null;n=t instanceof Array?t:Object.values(t);for(const t of n)if("*"===t.pattern)s=t;else{const n=rn(t.pattern,e);if(n)return{route:t,params:n}}return{route:s}},en([Ie],ln.prototype,"routes",void 0),en([Ie],ln.prototype,"locationStore",void 0),en([Ie],ln.prototype,"key",void 0),en([Ue],ln.prototype,"change",void 0),en([Ue],ln.prototype,"loading",void 0),en([Ue],ln.prototype,"error",void 0),ln=tn=en([Ke(I.store),Je("gem-route")],ln);let hn=class extends ln{constructor(t={}){super(Object.assign(Object.assign({},t),{isLight:!0}))}};hn=en([Je("gem-light-route")],hn);var un=function(t,e,n,s){var i,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o<3?i(r):o>3?i(e,n,r):i(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};let dn=class extends Pe{constructor(){super(),this.clickHandle=t=>{return e=this,n=void 0,i=function*(){var e;const n=this.getPathInfo();if(!n)return;if(this.isExternal(n))switch(this.target){case"_self":return void(window.location.href=n);case"_parent":return void(window.parent.location.href=n);case"_top":return void(window.top.location.href=n);default:return void window.open(n)}const{path:s,query:i,hash:o}=I.getParams();if(s+i+o!==n)if(t.stopPropagation(),yield null===(e=this.prepare)||void 0===e?void 0:e.call(this),this.route)I.pushIgnoreCloseHandle(Object.assign(Object.assign({},cn(this.route,this.options)),{title:this.route.title||this.docTitle}));else if(this.href){const{pathname:t,search:e,hash:s}=new URL(n,location.origin);I.pushIgnoreCloseHandle({path:t,query:e,hash:decodeURIComponent(s),title:this.docTitle})}else I.pushIgnoreCloseHandle({path:this.path,query:this.query,hash:this.hash,title:this.docTitle})},new((s=void 0)||(s=Promise))((function(t,o){function r(t){try{c(i.next(t))}catch(t){o(t)}}function a(t){try{c(i.throw(t))}catch(t){o(t)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof s?n:new s((function(t){t(n)}))).then(r,a)}c((i=i.apply(e,n||[])).next())}));var e,n,s,i},this.preventDefault=t=>{t.preventDefault()},this.addEventListener("click",this.clickHandle)}getPathInfo(){var t,e;if(this.route){const n=(null===(t=this.options)||void 0===t?void 0:t.query)||"",s=(null===(e=this.options)||void 0===e?void 0:e.hash)||"";return an(this.route,this.options)+n+s}{const t=this.href||this.path+this.query+this.hash,{path:e,query:n}=I.getParams();return t.startsWith("#")?`${e}${n}${t}`:t.startsWith("?")?`${e}${t}`:t.startsWith(".")?u(e,t):t}}isExternal(t){return!t.startsWith("/")}render(t=this.getPathInfo()){return Vt`
|
|
11
11
|
<style>
|
|
12
12
|
:host {
|
|
13
13
|
/* link default style */
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
<a
|
|
27
27
|
part=${this.link}
|
|
28
28
|
@click=${this.preventDefault}
|
|
29
|
-
href=${
|
|
29
|
+
href=${Yt("off"===this.hint?void 0:this.isExternal(t)?t:new URL(I.basePath+t,location.origin).toString())}
|
|
30
30
|
>
|
|
31
31
|
<slot></slot>
|
|
32
32
|
</a>
|
|
33
|
-
`}};
|
|
33
|
+
`}};un([Re],dn.prototype,"href",void 0),un([Re],dn.prototype,"target",void 0),un([Re],dn.prototype,"path",void 0),un([Re],dn.prototype,"query",void 0),un([Re],dn.prototype,"hash",void 0),un([Re],dn.prototype,"docTitle",void 0),un([Re],dn.prototype,"hint",void 0),un([Ie],dn.prototype,"route",void 0),un([Ie],dn.prototype,"options",void 0),un([Ie],dn.prototype,"prepare",void 0),un([qe],dn.prototype,"link",void 0),dn=un([Je("gem-link"),Ke(Y)],dn);let pn=class extends dn{render(){const{path:t,query:e,hash:n}=I.getParams(),s=this.pattern&&rn(this.pattern,t),i=this.getPathInfo();return this.active=!(!s&&t+e+n!==i),super.render(i)}};un([Re],pn.prototype,"pattern",void 0),un([Ve],pn.prototype,"active",void 0),pn=un([Je("gem-active-link"),Ke(I.store)],pn);var fn,mn=function(t,e,n,s){var i,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o<3?i(r):o>3?i(e,n,r):i(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};let gn=fn=class extends Pe{constructor(){super(),new MutationObserver((()=>this.update())).observe(this,{childList:!0,characterData:!0,subtree:!0})}static setTitle(t){R(tt,{title:t})}static updateTitle(t="",e=""){const{title:n}=tt;n&&n!==fn.defaultTitle?(fn.title=n,document.title=fn.title+e):t?(fn.title=t,document.title=fn.title+e):(fn.title=fn.defaultTitle,document.title=fn.title)}render(){return fn.updateTitle(this.textContent||"",this.suffix),this.hidden?Vt``:Vt`${fn.title}`}};gn.title=document.title,gn.defaultTitle=document.title,gn.defaultSuffix=` - ${document.title}`,mn([Re],gn.prototype,"suffix",void 0),gn=fn=mn([Ke(tt),Je("gem-title")],gn),H(tt,gn.updateTitle);var vn=function(t,e,n,s){var i,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o<3?i(r):o>3?i(e,n,r):i(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};const yn=new Map;let wn=class extends Pe{getContent(){const t=this.element||(this.selector?(this.root||document).querySelector(this.selector):null);if("string"==typeof t){let e=yn.get(t);return e||(e=document.createElement("template"),e.innerHTML=t,yn.set(t,e)),e.content.cloneNode(!0)}return t instanceof HTMLTemplateElement?t.content.cloneNode(!0):null==t?void 0:t.cloneNode(!0)}render(){return Vt`
|
|
34
34
|
<style>
|
|
35
35
|
:host {
|
|
36
36
|
position: relative;
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
</style>
|
|
47
47
|
${this.getContent()}
|
|
48
48
|
<slot></slot>
|
|
49
|
-
`}};pn([Me],mn.prototype,"selector",void 0),pn([Re],mn.prototype,"root",void 0),pn([Re],mn.prototype,"element",void 0),mn=pn([Be("gem-use")],mn);var gn=function(t,e,n,s){var i,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o<3?i(r):o>3?i(e,n,r):i(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};let vn=class extends Se{constructor(){super(),this.effect((()=>{this.shadowRoot&&(this.shadowRoot.innerHTML=`\n <style>\n :host {\n display: contents;\n }\n ${this.contentcss}\n </style>\n ${this.content}\n `)}),(()=>[this.content,this.contentcss]))}render(){}};gn([Me],vn.prototype,"content",void 0),gn([Me],vn.prototype,"contentcss",void 0),vn=gn([Be("gem-unsafe")],vn);var yn=function(t,e,n,s){var i,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o<3?i(r):o>3?i(e,n,r):i(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};document.querySelectorAll("[data-reflect]").forEach((t=>t.remove()));let wn=class extends Se{constructor(){super({isLight:!0}),this.target=document.head,this.hidden=!0,this.effect((()=>{const t=[...this.childNodes];return t.forEach((t=>{t instanceof HTMLElement&&(t.dataset.reflect=""),this.target.append(t)})),()=>{t.forEach((t=>t.remove()))}}),(()=>[this.target]))}};yn([Re],wn.prototype,"target",void 0),wn=yn([Be("gem-reflect")],wn);const bn=Symbol("open mark");function Sn(t){var e;return(e=class extends Se{constructor(){super(),this.label="",this.internals.role="alertdialog",this.internals.ariaModal=!0}static get isOpen(){return this.store[bn]}static get observedStores(){return[R.store,this.store]}static open(t){const e=new this;this.instance=e,this.inertStore=[...document.body.children].filter((t=>!t.inert)),this.inertStore.forEach((t=>t.inert=!0)),document.body.append(e);const n=()=>M(this.store,Object.assign({[bn]:!0},t));setTimeout((()=>{n(),R.push({title:e.label,open:n,close:this.closeHandle.bind(this),shouldClose:this.shouldClose.bind(this)})}),100)}static close(){R.back()}static closeHandle(){var e;this.inertStore.forEach((t=>t.inert=!1)),null===(e=this.instance)||void 0===e||e.remove(),M(this.store,Object.assign({[bn]:!1},t))}static shouldClose(){return!0}}).inertStore=[],e.instance=null,e.store=$(Object.assign({[bn]:!1},t)),e}var En,xn,_n,Pn=function(t,e,n,s){var i,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o<3?i(r):o>3?i(e,n,r):i(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r},kn=function(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)},On=function(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n};let Tn=class extends Se{constructor(){super(),this.opened=!1,this.inert=!0,En.set(this,void 0),xn.set(this,void 0),_n.set(this,[]),this.label="",this.closeHandle=()=>{var t;this.inert=!0,kn(this,_n,"f").forEach((t=>t.inert=!1)),kn(this,En,"f")?kn(this,En,"f").before(this):kn(this,xn,"f")&&(null===(t=kn(this,xn,"f"))||void 0===t||t.appendChild(this)),this.dispatchEvent(new CustomEvent("close")),this.opened=!1},this.openHandle=()=>{this.hidden=!1,this.inert=!1,On(this,En,this.nextSibling,"f"),On(this,xn,this.parentElement||this.getRootNode(),"f"),On(this,_n,[...document.body.children].filter((t=>!t.inert)),"f"),kn(this,_n,"f").forEach((t=>t.inert=!0)),document.body.append(this),this.dispatchEvent(new CustomEvent("open")),this.opened=!0},this.open=()=>{this.opened||(this.openHandle(),R.push({title:this.label,open:this.openHandle,close:this.closeHandle,shouldClose:this.shouldClose}))},this.close=()=>{R.back()},this.forceClose=()=>{this.opened=!1,setTimeout(this.close,100)},this.internals.role="dialog",this.internals.ariaModal=!0}shouldClose(){return!0}};En=new WeakMap,xn=new WeakMap,_n=new WeakMap,Pn([Ae],Tn.prototype,"opened",void 0),Pn([Me],Tn.prototype,"label",void 0),Tn=Pn([Ue(R.store)],Tn);const Cn=new WeakMap;function $n(t){return Cn.get(t)}const Ln=new WeakMap;function Mn(t){return Ln.get(t)}function Nn(t){const e=g(),n=document.createElement("style"),s=$(t),i={},o={};Ln.set(i,o),Cn.set(i,s),Object.keys(s).forEach((t=>{o[t]=`--${b(t)}-${e}`,i[t]=`var(${o[t]})`}));const r=()=>function(t,e){const n=Cn.get(e),s=Ln.get(e),i=Object.keys(n).reduce(((t,e)=>n[e]?t+`${s[e]}:${n[e]};`:t),"");t.textContent=`:root, :host {${i}}`}(n,i);return N(s,r),r(),(document.head||document.documentElement).append(n),i}function jn(t,e){M($n(t),e)}var Rn=function(t,e,n,s){return new(n||(n=Promise))((function(i,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}c((s=s.apply(t,e||[])).next())}))};const An=/\$\d(?:<[^>]*>)?/,Hn=/\$(\d)(<([^>]*)>)?/g;class Wn{constructor(t){if(this.cachePrefix="gem-i18n",!t.resources[t.fallbackLanguage])throw new x("i18n: fallbackLanguage invalid");this.store=$(this),Object.assign(this,t);let e=this.urlParamsLang||this.currentLanguage||this.cacheLang;const n=document.querySelector(`[type*=${this.cachePrefix}]`);if(n)try{const t=JSON.parse(n.textContent||"");e=t.currentLanguage,this.resources[t.currentLanguage]=t.currentLanguagePack}catch(t){}e?(this.lang=e,this.setLanguage(e)):this.resetLanguage()}get cacheCurrentKey(){return`${this.cachePrefix}:current`}get urlParamsLang(){const{hostname:t,pathname:e,search:n}=location,s=t.split(".");switch(this.urlParamsType){case"ccTLD":return s.pop();case"gTLD":return s.shift();case"path":return e.split("/")[1];default:const t=this.urlParamsName&&new URLSearchParams(n).get(this.urlParamsName)||"";return t in this.resources?t:""}}get cacheLang(){return this.cache&&localStorage.getItem(this.cacheCurrentKey)||""}set lang(t){var e;this.currentLanguage=t,document.documentElement.lang=t,null===(e=this.onChange)||void 0===e||e.call(this,t)}get(t,...e){const n=this.resources[this.currentLanguage],s=this.resources[this.fallbackLanguage],i=n[t]||s[t],o=(null==i?void 0:i.message)||i||`[${t}]`;if(!e.length)return o;const r=o.split(An),a=[];let c;for(;c=Hn.exec(o);){const t=c[3],n=e[Number(c[1])-1];a.push("string"==typeof n?n:n(t))}return At(r,...a)}detectLanguage(){const t=Object.keys(this.resources),e=navigator.languages.map((t=>t.replace(/-(.*)/,(t=>t.toUpperCase()))));for(const n of e){const e=t.find((t=>t===n||n.startsWith(`${t}-`)));if(e)return e}return this.fallbackLanguage}setLanguage(t){return Rn(this,void 0,void 0,(function*(){let e;const n=this.resources[t];if(!n)return console.warn(`i18n: not found \`${t}\``),this.resetLanguage();if("string"==typeof n){const t=`${this.cachePrefix}:`,s=`${t}${n}`,i=localStorage.getItem(s),o=()=>Rn(this,void 0,void 0,(function*(){const e=yield(yield fetch(n)).json();if(this.cache){for(let e=0;e<localStorage.length;e++){const n=localStorage.key(e);n.startsWith(t)&&localStorage.removeItem(n)}localStorage.setItem(s,JSON.stringify(e))}return e}));if(i)try{e=JSON.parse(i)}catch(t){e=yield o()}else e=yield o()}else e=n;return this.resources[t]=e,M(this.store,{}),t!==this.currentLanguage&&(this.lang=t),!0===this.cache&&this.setCache(),t}))}resetLanguage(){return this.lang=this.fallbackLanguage,this.cache&&localStorage.removeItem(this.cacheCurrentKey),this.setLanguage(this.detectLanguage())}setCache(){localStorage.setItem(this.cacheCurrentKey,this.currentLanguage)}toJSON(){return{currentLanguage:this.currentLanguage,currentLanguagePack:this.resources[this.currentLanguage]}}}const In={credentials:"include",mode:"cors"};function Vn(t,e={}){return n=this,s=void 0,o=function*(){const n=yield fetch(t,Object.assign(Object.assign({},In),e));if(0===n.status)throw new Error("Request fail");if(n.status>=500)throw new Error(n.statusText);if(n.status>=400)throw new Error((yield n.text())||n.statusText);return yield n.json()},new((i=void 0)||(i=Promise))((function(t,e){function r(t){try{c(o.next(t))}catch(t){e(t)}}function a(t){try{c(o.throw(t))}catch(t){e(t)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(t){t(n)}))).then(r,a)}c((o=o.apply(n,s||[])).next())}));var n,s,i,o}const Dn=Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array));function qn(t){return t instanceof FormData||t instanceof Blob||t instanceof Dn||t instanceof URLSearchParams||t instanceof ReadableStream||t instanceof ArrayBuffer?t:"object"==typeof t?JSON.stringify(t):t}function Un(t,e){const{origin:n,pathname:s,search:i}=new URL(t,location.origin),o=new URLSearchParams(e).toString();return Vn(`${n}${s}${i?`${i}&`:o?"?":""}${o}`,{method:"GET"})}function Gn(t){return Vn(t,{method:"DELETE"})}function Bn(t,e){return Vn(t,{method:"PUT",body:qn(e)})}function Fn(t,e){return Vn(t,{method:"POST",body:qn(e)})}const Kn={PRINT:"print",get isPrint(){return window.matchMedia(this.PRINT).matches},HOVER:"(hover: hover)",get isHover(){return window.matchMedia(this.HOVER).matches},PHONE:"(min-width: 319px) and (max-width: 480px)",get isPhone(){return window.matchMedia(this.PHONE).matches},LAPTOP:"(min-width: 1023px) and (max-width: 1280px) and (orientation: landscape)",get isLaptop(){return window.matchMedia(this.LAPTOP).matches},DESKTOP:"(min-width: 1279px) and (orientation: landscape)",get isDesktop(){return window.matchMedia(this.DESKTOP).matches},PHONE_LANDSCAPE:"(min-width: 479px) and (max-width: 767px) and (orientation: landscape)",get isPhoneLandscape(){return window.matchMedia(this.PHONE_LANDSCAPE).matches},TABLET:"(min-width: 768px) and (max-width: 1024px)",get isTablet(){return window.matchMedia(this.TABLET).matches},SMALL_PHONE:"(min-width: 319px) and (max-width: 480px) and (max-height: 640px)",get isSmallPhone(){return window.matchMedia(this.SMALL_PHONE).matches},WATCH:"(max-width: 319px)",get isWatch(){return window.matchMedia(this.WATCH).matches},SHORT:"(min-width: 479px) and (max-height: 320px)",get isShort(){return window.matchMedia(this.SHORT).matches},PWA:"(display-mode: standalone)",get isPWA(){return window.matchMedia(this.PWA).matches},MOTION_REDUCE:"(prefers-reduced-motion: reduce)",get isMotionReduce(){return window.matchMedia(this.MOTION_REDUCE).matches},DATA_REDUCE:"(prefers-reduced-data: reduce)",get isDataReduce(){return window.matchMedia(this.DATA_REDUCE).matches}};return e})()}));
|
|
49
|
+
`}};vn([Re],wn.prototype,"selector",void 0),vn([Ie],wn.prototype,"root",void 0),vn([Ie],wn.prototype,"element",void 0),wn=vn([Je("gem-use")],wn);var bn=function(t,e,n,s){var i,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o<3?i(r):o>3?i(e,n,r):i(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};let Sn=class extends Pe{constructor(){super(),this.effect((()=>{this.shadowRoot&&(this.shadowRoot.innerHTML=`\n <style>\n :host {\n display: contents;\n }\n ${this.contentcss}\n </style>\n ${this.content}\n `)}),(()=>[this.content,this.contentcss]))}render(){}};bn([Re],Sn.prototype,"content",void 0),bn([Re],Sn.prototype,"contentcss",void 0),Sn=bn([Je("gem-unsafe")],Sn);var En=function(t,e,n,s){var i,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o<3?i(r):o>3?i(e,n,r):i(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};document.querySelectorAll("[data-reflect]").forEach((t=>t.remove()));let xn=class extends Pe{constructor(){super({isLight:!0}),this.target=document.head,this.hidden=!0,this.effect((()=>{const t=[...this.childNodes];return t.forEach((t=>{t instanceof HTMLElement&&(t.dataset.reflect=""),this.target.append(t)})),()=>{t.forEach((t=>t.remove()))}}),(()=>[this.target]))}};En([Ie],xn.prototype,"target",void 0),xn=En([Je("gem-reflect")],xn);const _n=Symbol("open mark");function Pn(t){var e;return(e=class extends Pe{constructor(){super(),this.label="",this.internals.role="alertdialog",this.internals.ariaModal=!0}static get isOpen(){return this.store[_n]}static get observedStores(){return[I.store,this.store]}static open(t){const e=new this;this.instance=e,this.inertStore=[...document.body.children].filter((t=>!t.inert)),this.inertStore.forEach((t=>t.inert=!0)),document.body.append(e);const n=()=>R(this.store,Object.assign({[_n]:!0},t));setTimeout((()=>{n(),I.push({title:e.label,open:n,close:this.closeHandle.bind(this),shouldClose:this.shouldClose.bind(this)})}),100)}static close(){I.back()}static closeHandle(){var e;this.inertStore.forEach((t=>t.inert=!1)),null===(e=this.instance)||void 0===e||e.remove(),R(this.store,Object.assign({[_n]:!1},t))}static shouldClose(){return!0}}).inertStore=[],e.instance=null,e.store=j(Object.assign({[_n]:!1},t)),e}var kn,On,Tn,Cn=function(t,e,n,s){var i,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o<3?i(r):o>3?i(e,n,r):i(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r},$n=function(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)},Mn=function(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n};let Nn=class extends Pe{constructor(){super(),this.opened=!1,this.inert=!0,kn.set(this,void 0),On.set(this,void 0),Tn.set(this,[]),this.label="",this.closeHandle=()=>{var t;this.inert=!0,$n(this,Tn,"f").forEach((t=>t.inert=!1)),$n(this,kn,"f")?$n(this,kn,"f").before(this):$n(this,On,"f")&&(null===(t=$n(this,On,"f"))||void 0===t||t.appendChild(this)),this.dispatchEvent(new CustomEvent("close")),this.opened=!1},this.openHandle=()=>{this.hidden=!1,this.inert=!1,Mn(this,kn,this.nextSibling,"f"),Mn(this,On,this.parentElement||this.getRootNode(),"f"),Mn(this,Tn,[...document.body.children].filter((t=>!t.inert)),"f"),$n(this,Tn,"f").forEach((t=>t.inert=!0)),document.body.append(this),this.dispatchEvent(new CustomEvent("open")),this.opened=!0},this.open=()=>{this.opened||(this.openHandle(),I.push({title:this.label,open:this.openHandle,close:this.closeHandle,shouldClose:this.shouldClose}))},this.close=()=>{I.back()},this.forceClose=()=>{this.opened=!1,setTimeout(this.close,100)},this.internals.role="dialog",this.internals.ariaModal=!0}shouldClose(){return!0}};kn=new WeakMap,On=new WeakMap,Tn=new WeakMap,Cn([Ve],Nn.prototype,"opened",void 0),Cn([Re],Nn.prototype,"label",void 0),Nn=Cn([Ke(I.store)],Nn);const Ln=new WeakMap;function jn(t){return Ln.get(t)}const An=new WeakMap;function Rn(t){return An.get(t)}function Hn(t){const e=b(),n=document.createElement("style"),s=j(t),i={},o={};An.set(i,o),Ln.set(i,s),Object.keys(s).forEach((t=>{o[t]=`--${_(t)}-${e}`,i[t]=`var(${o[t]})`}));const r=()=>function(t,e){const n=Ln.get(e),s=An.get(e),i=Object.keys(n).reduce(((t,e)=>n[e]?t+`${s[e]}:${n[e]};`:t),"");t.textContent=`:root, :host {${i}}`}(n,i);return H(s,r),r(),(document.head||document.documentElement).append(n),i}function Wn(t,e){R(jn(t),e)}var In=function(t,e,n,s){return new(n||(n=Promise))((function(i,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}c((s=s.apply(t,e||[])).next())}))};const Vn=/\$\d(?:<[^>]*>)?/,Dn=/\$(\d)(<([^>]*)>)?/g;class qn{constructor(t){if(this.cachePrefix="gem-i18n",!t.resources[t.fallbackLanguage])throw new O("i18n: fallbackLanguage invalid");this.store=j(this),Object.assign(this,t);let e=this.urlParamsLang||this.currentLanguage||this.cacheLang;const n=document.querySelector(`[type*=${this.cachePrefix}]`);if(n)try{const t=JSON.parse(n.textContent||"");e=t.currentLanguage,this.resources[t.currentLanguage]=t.currentLanguagePack}catch(t){}e?(this.lang=e,this.setLanguage(e)):this.resetLanguage()}get cacheCurrentKey(){return`${this.cachePrefix}:current`}get urlParamsLang(){const{hostname:t,pathname:e,search:n}=location,s=t.split(".");switch(this.urlParamsType){case"ccTLD":return s.pop();case"gTLD":return s.shift();case"path":return e.split("/")[1];default:const t=this.urlParamsName&&new URLSearchParams(n).get(this.urlParamsName)||"";return t in this.resources?t:""}}get cacheLang(){return this.cache&&localStorage.getItem(this.cacheCurrentKey)||""}set lang(t){var e;this.currentLanguage=t,document.documentElement.lang=t,null===(e=this.onChange)||void 0===e||e.call(this,t)}get(t,...e){const n=this.resources[this.currentLanguage],s=this.resources[this.fallbackLanguage],i=n[t]||s[t],o=(null==i?void 0:i.message)||i||`[${t}]`;if(!e.length)return o;const r=o.split(Vn),a=[];let c;for(;c=Dn.exec(o);){const t=c[3],n=e[Number(c[1])-1];a.push("string"==typeof n?n:n(t))}return Vt(r,...a)}detectLanguage(){const t=Object.keys(this.resources),e=navigator.languages.map((t=>t.replace(/-(.*)/,(t=>t.toUpperCase()))));for(const n of e){const e=t.find((t=>t===n||n.startsWith(`${t}-`)));if(e)return e}return this.fallbackLanguage}setLanguage(t){return In(this,void 0,void 0,(function*(){let e;const n=this.resources[t];if(!n)return console.warn(`i18n: not found \`${t}\``),this.resetLanguage();if("string"==typeof n){const t=`${this.cachePrefix}:`,s=`${t}${n}`,i=localStorage.getItem(s),o=()=>In(this,void 0,void 0,(function*(){const e=yield(yield fetch(n)).json();if(this.cache){for(let e=0;e<localStorage.length;e++){const n=localStorage.key(e);n.startsWith(t)&&localStorage.removeItem(n)}localStorage.setItem(s,JSON.stringify(e))}return e}));if(i)try{e=JSON.parse(i)}catch(t){e=yield o()}else e=yield o()}else e=n;return this.resources[t]=e,R(this.store,{}),t!==this.currentLanguage&&(this.lang=t),!0===this.cache&&this.setCache(),t}))}resetLanguage(){return this.lang=this.fallbackLanguage,this.cache&&localStorage.removeItem(this.cacheCurrentKey),this.setLanguage(this.detectLanguage())}setCache(){localStorage.setItem(this.cacheCurrentKey,this.currentLanguage)}toJSON(){return{currentLanguage:this.currentLanguage,currentLanguagePack:this.resources[this.currentLanguage]}}}const Un={credentials:"include",mode:"cors"};function Gn(t,e={}){return n=this,s=void 0,o=function*(){const n=yield fetch(t,Object.assign(Object.assign({},Un),e));if(0===n.status)throw new Error("Request fail");if(n.status>=500)throw new Error(n.statusText);if(n.status>=400)throw new Error((yield n.text())||n.statusText);return yield n.json()},new((i=void 0)||(i=Promise))((function(t,e){function r(t){try{c(o.next(t))}catch(t){e(t)}}function a(t){try{c(o.throw(t))}catch(t){e(t)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(t){t(n)}))).then(r,a)}c((o=o.apply(n,s||[])).next())}));var n,s,i,o}const Bn=Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array));function Fn(t){return t instanceof FormData||t instanceof Blob||t instanceof Bn||t instanceof URLSearchParams||t instanceof ReadableStream||t instanceof ArrayBuffer?t:"object"==typeof t?JSON.stringify(t):t}function Kn(t,e){const{origin:n,pathname:s,search:i}=new URL(t,location.origin),o=new URLSearchParams(e).toString();return Gn(`${n}${s}${i?`${i}&`:o?"?":""}${o}`,{method:"GET"})}function zn(t){return Gn(t,{method:"DELETE"})}function Jn(t,e){return Gn(t,{method:"PUT",body:Fn(e)})}function Qn(t,e){return Gn(t,{method:"POST",body:Fn(e)})}const Zn={PRINT:"print",get isPrint(){return window.matchMedia(this.PRINT).matches},HOVER:"(hover: hover)",get isHover(){return window.matchMedia(this.HOVER).matches},PHONE:"(min-width: 319px) and (max-width: 480px)",get isPhone(){return window.matchMedia(this.PHONE).matches},LAPTOP:"(min-width: 1023px) and (max-width: 1280px) and (orientation: landscape)",get isLaptop(){return window.matchMedia(this.LAPTOP).matches},DESKTOP:"(min-width: 1279px) and (orientation: landscape)",get isDesktop(){return window.matchMedia(this.DESKTOP).matches},PHONE_LANDSCAPE:"(min-width: 479px) and (max-width: 767px) and (orientation: landscape)",get isPhoneLandscape(){return window.matchMedia(this.PHONE_LANDSCAPE).matches},TABLET:"(min-width: 768px) and (max-width: 1024px)",get isTablet(){return window.matchMedia(this.TABLET).matches},SMALL_PHONE:"(min-width: 319px) and (max-width: 480px) and (max-height: 640px)",get isSmallPhone(){return window.matchMedia(this.SMALL_PHONE).matches},WATCH:"(max-width: 319px)",get isWatch(){return window.matchMedia(this.WATCH).matches},SHORT:"(min-width: 479px) and (max-height: 320px)",get isShort(){return window.matchMedia(this.SHORT).matches},PWA:"(display-mode: standalone)",get isPWA(){return window.matchMedia(this.PWA).matches},MOTION_REDUCE:"(prefers-reduced-motion: reduce)",get isMotionReduce(){return window.matchMedia(this.MOTION_REDUCE).matches},DATA_REDUCE:"(prefers-reduced-data: reduce)",get isDataReduce(){return window.matchMedia(this.DATA_REDUCE).matches}};return e})()}));
|
|
50
50
|
//# sourceMappingURL=umd.js.map
|