@mantou/gem 1.6.15 → 1.6.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gem.es.js +24 -16
- package/dist/gem.umd.js +17 -17
- package/helper/request.d.ts +2 -1
- package/helper/request.d.ts.map +1 -1
- package/helper/request.js +21 -14
- package/helper/request.js.map +1 -1
- package/lib/history.d.ts.map +1 -1
- package/lib/history.js +2 -1
- package/lib/history.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/helper/request.ts +20 -13
- package/src/lib/history.ts +2 -1
- package/src/lib/version.ts +1 -1
package/dist/gem.es.js
CHANGED
|
@@ -2046,7 +2046,8 @@ const store = createStore({
|
|
|
2046
2046
|
$key: ""
|
|
2047
2047
|
});
|
|
2048
2048
|
const paramsMap = new Map();
|
|
2049
|
-
function validData(
|
|
2049
|
+
function validData(data) {
|
|
2050
|
+
const { $key, $hasCloseHandle, $hasOpenHandle, $hasShouldCloseHandle } = data || {};
|
|
2050
2051
|
if (store.$key === $key)
|
|
2051
2052
|
return;
|
|
2052
2053
|
if ($key)
|
|
@@ -3162,19 +3163,25 @@ lang_set = function(lang) {
|
|
|
3162
3163
|
this.currentLanguage = lang;
|
|
3163
3164
|
(_a2 = this.onChange) == null ? void 0 : _a2.call(this, lang);
|
|
3164
3165
|
};
|
|
3165
|
-
const
|
|
3166
|
-
|
|
3167
|
-
|
|
3166
|
+
const defaultReqInit = {
|
|
3167
|
+
headers: {
|
|
3168
|
+
"Content-Type": "application/json"
|
|
3169
|
+
}
|
|
3168
3170
|
};
|
|
3169
3171
|
async function request(uri, options = {}) {
|
|
3170
|
-
const res = await fetch(uri, __spreadValues(__spreadValues({},
|
|
3172
|
+
const res = await fetch(uri, __spreadValues(__spreadValues({}, defaultReqInit), options));
|
|
3171
3173
|
if (res.status === 0)
|
|
3172
3174
|
throw new Error("Request fail");
|
|
3173
3175
|
if (res.status >= 500)
|
|
3174
3176
|
throw new Error(res.statusText);
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3177
|
+
try {
|
|
3178
|
+
const data = await res.json();
|
|
3179
|
+
if (res.status >= 400)
|
|
3180
|
+
throw new Error((data == null ? void 0 : data.message) || res.statusText, { cause: data });
|
|
3181
|
+
return data;
|
|
3182
|
+
} catch {
|
|
3183
|
+
throw new Error("Server error");
|
|
3184
|
+
}
|
|
3178
3185
|
}
|
|
3179
3186
|
const TypedArray = Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array())).constructor;
|
|
3180
3187
|
function serializationBody(body) {
|
|
@@ -3186,15 +3193,16 @@ function serializationBody(body) {
|
|
|
3186
3193
|
}
|
|
3187
3194
|
return body;
|
|
3188
3195
|
}
|
|
3189
|
-
function
|
|
3196
|
+
function serializationUrl(url, params) {
|
|
3190
3197
|
const { origin, pathname, search } = new URL(url, location.origin);
|
|
3191
3198
|
const query = new URLSearchParams(params).toString();
|
|
3192
|
-
return
|
|
3193
|
-
|
|
3194
|
-
|
|
3199
|
+
return `${origin}${pathname}${search ? `${search}&` : query ? "?" : ""}${query}`;
|
|
3200
|
+
}
|
|
3201
|
+
function get(url, params) {
|
|
3202
|
+
return request(serializationUrl(url, params), { method: "GET" });
|
|
3195
3203
|
}
|
|
3196
|
-
function del(url) {
|
|
3197
|
-
return request(url, { method: "DELETE" });
|
|
3204
|
+
function del(url, params) {
|
|
3205
|
+
return request(serializationUrl(url, params), { method: "DELETE" });
|
|
3198
3206
|
}
|
|
3199
3207
|
function put(url, body) {
|
|
3200
3208
|
return request(url, { method: "PUT", body: serializationBody(body) });
|
|
@@ -3261,8 +3269,8 @@ const mediaQuery = {
|
|
|
3261
3269
|
return matche(this.DATA_REDUCE);
|
|
3262
3270
|
}
|
|
3263
3271
|
};
|
|
3264
|
-
const version = "1.6.
|
|
3272
|
+
const version = "1.6.16";
|
|
3265
3273
|
if (window.__GEM_DEVTOOLS__HOOK__) {
|
|
3266
3274
|
Object.assign(window.__GEM_DEVTOOLS__HOOK__, __spreadValues({}, Gem));
|
|
3267
3275
|
}
|
|
3268
|
-
export { GemActiveLinkElement, GemDialogBaseElement, GemElement, GemError, GemLightRouteElement, GemLinkElement, GemReflectElement, GemRouteElement, GemTitleElement, GemUnsafeElement, GemUseElement, I18n, LinkedList, PropProxyMap, QueryString, SVGTemplateResult, SheetToken, StoreListenerMap, TemplateResult, absoluteLocation, addMicrotask, addMicrotaskToStack, adoptedStyle, attribute, basePathStore, boolattribute, camelToKebabCase, classMap, cleanObject, connect, connectStore, createCSSSheet, createHistoryParams, createModalClass, createPath, createStore, createStoreSet, createTheme, css, customElement, defineAttribute, defineCSSState, defineProperty, defineRef, del, directive, disconnect, emitter, exportPartsMap, get, getThemeProp, getThemeStore, globalemitter, guard, history, html, ifDefined, isArrayChange, kebabToCamelCase, matchPath, mediaQuery, nativeDefineElement, numattribute, objectMapToString, part, partMap, post, property, put, randomStr, raw, refobject, removeItems, render, repeat, request, rootElement, slot, splice, state, styleMap, styled, svg, titleStore, updateStore, updateTheme, useNativeCSSStyleSheet, version };
|
|
3276
|
+
export { GemActiveLinkElement, GemDialogBaseElement, GemElement, GemError, GemLightRouteElement, GemLinkElement, GemReflectElement, GemRouteElement, GemTitleElement, GemUnsafeElement, GemUseElement, I18n, LinkedList, PropProxyMap, QueryString, SVGTemplateResult, SheetToken, StoreListenerMap, TemplateResult, absoluteLocation, addMicrotask, addMicrotaskToStack, adoptedStyle, attribute, basePathStore, boolattribute, camelToKebabCase, classMap, cleanObject, connect, connectStore, createCSSSheet, createHistoryParams, createModalClass, createPath, createStore, createStoreSet, createTheme, css, customElement, defaultReqInit, defineAttribute, defineCSSState, defineProperty, defineRef, del, directive, disconnect, emitter, exportPartsMap, get, getThemeProp, getThemeStore, globalemitter, guard, history, html, ifDefined, isArrayChange, kebabToCamelCase, matchPath, mediaQuery, nativeDefineElement, numattribute, objectMapToString, part, partMap, post, property, put, randomStr, raw, refobject, removeItems, render, repeat, request, rootElement, slot, splice, state, styleMap, styled, svg, titleStore, updateStore, updateTheme, useNativeCSSStyleSheet, version };
|
package/dist/gem.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ai=Object.defineProperty,ci=Object.defineProperties;var li=Object.getOwnPropertyDescriptors;var fs=Object.getOwnPropertySymbols;var hi=Object.prototype.hasOwnProperty,ui=Object.prototype.propertyIsEnumerable;var ms=(o,f,y)=>f in o?ai(o,f,{enumerable:!0,configurable:!0,writable:!0,value:y}):o[f]=y,T=(o,f)=>{for(var y in f||(f={}))hi.call(f,y)&&ms(o,y,f[y]);if(fs)for(var y of fs(f))ui.call(f,y)&&ms(o,y,f[y]);return o},qe=(o,f)=>ci(o,li(f));var Xt=(o,f,y)=>{if(!f.has(o))throw TypeError("Cannot "+y)};var g=(o,f,y)=>(Xt(o,f,"read from private field"),y?y.call(o):f.get(o)),M=(o,f,y)=>{if(f.has(o))throw TypeError("Cannot add the same private member more than once");f instanceof WeakSet?f.add(o):f.set(o,y)},G=(o,f,y,J)=>(Xt(o,f,"write to private field"),J?J.call(o,y):f.set(o,y),y);var ft=(o,f,y)=>(Xt(o,f,"access private method"),y);(function(o,f){typeof exports=="object"&&typeof module!="undefined"?f(exports):typeof define=="function"&&define.amd?define(["exports"],f):(o=typeof globalThis!="undefined"?globalThis:o||self,f(o.Gem={}))})(this,function(o){var ee,te,le,Se,en,Ee,ht,_e,ve,he,ds,be,tn,ut,di,dt,fi,ue,mt,Pe,nn;"use strict";var f=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",get StoreListenerMap(){return ne},get createStore(){return z},get createStoreSet(){return Tn},get updateStore(){return P},get connect(){return se},get disconnect(){return kt},get history(){return E},get titleStore(){return ae},get basePathStore(){return Ut},get html(){return N},get svg(){return yn},get render(){return xe},get directive(){return J},get TemplateResult(){return ke},get SVGTemplateResult(){return yt},get repeat(){return Nn},get guard(){return On},get ifDefined(){return Ot},get GemElement(){return A},get defineAttribute(){return et},get defineProperty(){return ye},get defineRef(){return tt},get defineCSSState(){return nt},get nativeDefineElement(){return st},get refobject(){return Hn},get attribute(){return k},get boolattribute(){return In},get numattribute(){return Vn},get property(){return q},get state(){return Ge},get slot(){return Wn},get part(){return Dt},get emitter(){return He},get globalemitter(){return jn},get adoptedStyle(){return qn},get connectStore(){return oe},get rootElement(){return xn},get customElement(){return Un},get addMicrotask(){return H},get addMicrotaskToStack(){return wn},get absoluteLocation(){return Ue},get LinkedList(){return _t},get PropProxyMap(){return vt},get QueryString(){return fe},get raw(){return me},get css(){return Sn},get SheetToken(){return Be},get useNativeCSSStyleSheet(){return o.useNativeCSSStyleSheet},get createCSSSheet(){return En},get randomStr(){return Me},get styled(){return vn},get camelToKebabCase(){return I},get kebabToCamelCase(){return pe},get cleanObject(){return Ne},get GemError(){return K},get isArrayChange(){return Pt},get removeItems(){return Ct},get objectMapToString(){return Oe},get styleMap(){return bn},get classMap(){return Tt},get partMap(){return Pn},get exportPartsMap(){return Cn},get version(){return us}});/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
4
4
|
* This code may only be used under the BSD style license found at
|
|
@@ -10,7 +10,7 @@ var oi=Object.defineProperty,ai=Object.defineProperties;var ci=Object.getOwnProp
|
|
|
10
10
|
* Code distributed by Google as part of the polymer project is also
|
|
11
11
|
* subject to an additional IP rights grant found at
|
|
12
12
|
* http://polymer.github.io/PATENTS.txt
|
|
13
|
-
*/const y=new WeakMap,J=n=>(...e)=>{const t=n(...e);return y.set(t,!0),t},
|
|
13
|
+
*/const y=new WeakMap,J=n=>(...e)=>{const t=n(...e);return y.set(t,!0),t},Ce=n=>typeof n=="function"&&y.has(n);/**
|
|
14
14
|
* @license
|
|
15
15
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
16
16
|
* This code may only be used under the BSD style license found at
|
|
@@ -46,7 +46,7 @@ var oi=Object.defineProperty,ai=Object.defineProperties;var ci=Object.getOwnProp
|
|
|
46
46
|
* Code distributed by Google as part of the polymer project is also
|
|
47
47
|
* subject to an additional IP rights grant found at
|
|
48
48
|
* http://polymer.github.io/PATENTS.txt
|
|
49
|
-
*/const Q=`{{lit-${String(Math.random()).slice(2)}}}`,an=`<!--${Q}-->`,cn=new RegExp(`${Q}|${an}`),
|
|
49
|
+
*/const Q=`{{lit-${String(Math.random()).slice(2)}}}`,an=`<!--${Q}-->`,cn=new RegExp(`${Q}|${an}`),Te="$lit$";class ps{constructor(e,t){this.parts=[],this.element=t;const s=[],i=[],r=document.createTreeWalker(t.content,133,null,!1);let a=0,c=-1,l=0;const{strings:h,values:{length:m}}=e;for(;l<m;){const u=r.nextNode();if(u===null){r.currentNode=i.pop();continue}if(c++,u.nodeType===1){if(u.hasAttributes()){const $=u.attributes,{length:w}=$;let S=0;for(let p=0;p<w;p++)ln($[p].name,Te)&&S++;for(;S-- >0;){const p=h[l],_=gt.exec(p)[2],b=_.toLowerCase()+Te,U=u.getAttribute(b);u.removeAttribute(b);const W=U.split(cn);this.parts.push({type:"attribute",index:c,name:_,strings:W}),l+=W.length-1}}u.tagName==="TEMPLATE"&&(i.push(u),r.currentNode=u.content)}else if(u.nodeType===3){const $=u.data;if($.indexOf(Q)>=0){const w=u.parentNode,S=$.split(cn),p=S.length-1;for(let _=0;_<p;_++){let b,U=S[_];if(U==="")b=B();else{const W=gt.exec(U);W!==null&&ln(W[2],Te)&&(U=U.slice(0,W.index)+W[1]+W[2].slice(0,-Te.length)+W[3]),b=document.createTextNode(U)}w.insertBefore(b,u),this.parts.push({type:"node",index:++c})}S[p]===""?(w.insertBefore(B(),u),s.push(u)):u.data=S[p],l+=p}}else if(u.nodeType===8)if(u.data===Q){const $=u.parentNode;(u.previousSibling===null||c===a)&&(c++,$.insertBefore(B(),u)),a=c,this.parts.push({type:"node",index:c}),u.nextSibling===null?u.data="":(s.push(u),c--),l++}else{let $=-1;for(;($=u.data.indexOf(Q,$+1))!==-1;)this.parts.push({type:"node",index:-1}),l++}}for(const u of s)u.parentNode.removeChild(u)}}const ln=(n,e)=>{const t=n.length-e.length;return t>=0&&n.slice(t)===e},gs=n=>n.index!==-1,B=()=>document.createComment(""),gt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;/**
|
|
50
50
|
* @license
|
|
51
51
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
52
52
|
* This code may only be used under the BSD style license found at
|
|
@@ -58,7 +58,7 @@ var oi=Object.defineProperty,ai=Object.defineProperties;var ci=Object.getOwnProp
|
|
|
58
58
|
* Code distributed by Google as part of the polymer project is also
|
|
59
59
|
* subject to an additional IP rights grant found at
|
|
60
60
|
* http://polymer.github.io/PATENTS.txt
|
|
61
|
-
*/class hn{constructor(e,t,s){this.__parts=[],this.template=e,this.processor=t,this.options=s}update(e){let t=0;for(const s of this.__parts)s!==void 0&&s.setValue(e[t]),t++;for(const s of this.__parts)s!==void 0&&s.commit()}_clone(){const e=sn?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=[],s=this.template.parts,i=document.createTreeWalker(e,133,null,!1);let r=0,a=0,c,l=i.nextNode();for(;r<s.length;){if(c=s[r],!
|
|
61
|
+
*/class hn{constructor(e,t,s){this.__parts=[],this.template=e,this.processor=t,this.options=s}update(e){let t=0;for(const s of this.__parts)s!==void 0&&s.setValue(e[t]),t++;for(const s of this.__parts)s!==void 0&&s.commit()}_clone(){const e=sn?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=[],s=this.template.parts,i=document.createTreeWalker(e,133,null,!1);let r=0,a=0,c,l=i.nextNode();for(;r<s.length;){if(c=s[r],!gs(c)){this.__parts.push(void 0),r++;continue}for(;a<c.index;)a++,l.nodeName==="TEMPLATE"&&(t.push(l),i.currentNode=l.content),(l=i.nextNode())===null&&(i.currentNode=t.pop(),l=i.nextNode());if(c.type==="node"){const h=this.processor.handleTextExpression(this.options);h.insertAfterNode(l.previousSibling),this.__parts.push(h)}else this.__parts.push(...this.processor.handleAttributeExpressions(l,c.name,c.strings,this.options));r++}return sn&&(document.adoptNode(e),customElements.upgrade(e)),e}}/**
|
|
62
62
|
* @license
|
|
63
63
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
64
64
|
* This code may only be used under the BSD style license found at
|
|
@@ -70,7 +70,7 @@ var oi=Object.defineProperty,ai=Object.defineProperties;var ci=Object.getOwnProp
|
|
|
70
70
|
* Code distributed by Google as part of the polymer project is also
|
|
71
71
|
* subject to an additional IP rights grant found at
|
|
72
72
|
* http://polymer.github.io/PATENTS.txt
|
|
73
|
-
*/const un=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:n=>n}),
|
|
73
|
+
*/const un=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:n=>n}),ys=` ${Q} `;class ke{constructor(e,t,s,i){this.strings=e,this.values=t,this.type=s,this.processor=i}getHTML(){const e=this.strings.length-1;let t="",s=!1;for(let i=0;i<e;i++){const r=this.strings[i],a=r.lastIndexOf("<!--");s=(a>-1||s)&&r.indexOf("-->",a+1)===-1;const c=gt.exec(r);c===null?t+=r+(s?ys:an):t+=r.substr(0,c.index)+c[1]+c[2]+Te+c[3]+Q}return t+=this.strings[e],t}getTemplateElement(){const e=document.createElement("template");let t=this.getHTML();return un!==void 0&&(t=un.createHTML(t)),e.innerHTML=t,e}}class yt extends ke{getHTML(){return`<svg>${super.getHTML()}</svg>`}getTemplateElement(){const e=super.getTemplateElement(),t=e.content,s=t.firstChild;return t.removeChild(s),rn(t,s.firstChild),e}}/**
|
|
74
74
|
* @license
|
|
75
75
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
76
76
|
* This code may only be used under the BSD style license found at
|
|
@@ -82,7 +82,7 @@ var oi=Object.defineProperty,ai=Object.defineProperties;var ci=Object.getOwnProp
|
|
|
82
82
|
* Code distributed by Google as part of the polymer project is also
|
|
83
83
|
* subject to an additional IP rights grant found at
|
|
84
84
|
* http://polymer.github.io/PATENTS.txt
|
|
85
|
-
*/const wt=n=>n===null||!(typeof n=="object"||typeof n=="function"),St=n=>Array.isArray(n)||!!(n&&n[Symbol.iterator]);class dn{constructor(e,t,s){this.dirty=!0,this.element=e,this.name=t,this.strings=s,this.parts=[];for(let i=0;i<s.length-1;i++)this.parts[i]=this._createPart()}_createPart(){return new Et(this)}_getValue(){const e=this.strings,t=e.length-1,s=this.parts;if(t===1&&e[0]===""&&e[1]===""){const r=s[0].value;if(typeof r=="symbol")return String(r);if(typeof r=="string"||!St(r))return r}let i="";for(let r=0;r<t;r++){i+=e[r];const a=s[r];if(a!==void 0){const c=a.value;if(wt(c)||!St(c))i+=typeof c=="string"?c:String(c);else for(const l of c)i+=typeof l=="string"?l:String(l)}}return i+=e[t],i}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class Et{constructor(e){this.value=void 0,this.committer=e}setValue(e){e!==j&&(!wt(e)||e!==this.value)&&(this.value=e,
|
|
85
|
+
*/const wt=n=>n===null||!(typeof n=="object"||typeof n=="function"),St=n=>Array.isArray(n)||!!(n&&n[Symbol.iterator]);class dn{constructor(e,t,s){this.dirty=!0,this.element=e,this.name=t,this.strings=s,this.parts=[];for(let i=0;i<s.length-1;i++)this.parts[i]=this._createPart()}_createPart(){return new Et(this)}_getValue(){const e=this.strings,t=e.length-1,s=this.parts;if(t===1&&e[0]===""&&e[1]===""){const r=s[0].value;if(typeof r=="symbol")return String(r);if(typeof r=="string"||!St(r))return r}let i="";for(let r=0;r<t;r++){i+=e[r];const a=s[r];if(a!==void 0){const c=a.value;if(wt(c)||!St(c))i+=typeof c=="string"?c:String(c);else for(const l of c)i+=typeof l=="string"?l:String(l)}}return i+=e[t],i}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class Et{constructor(e){this.value=void 0,this.committer=e}setValue(e){e!==j&&(!wt(e)||e!==this.value)&&(this.value=e,Ce(e)||(this.committer.dirty=!0))}commit(){for(;Ce(this.value);){const e=this.value;this.value=j,e(this)}this.value!==j&&this.committer.commit()}}class de{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(B()),this.endNode=e.appendChild(B())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=B()),e.__insert(this.endNode=B())}insertAfterPart(e){e.__insert(this.startNode=B()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(this.startNode.parentNode===null)return;for(;Ce(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=j,t(this)}const e=this.__pendingValue;e!==j&&(wt(e)?e!==this.value&&this.__commitText(e):e instanceof ke?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):St(e)?this.__commitIterable(e):e===on?(this.value=on,this.clear()):this.__commitText(e))}__insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}__commitNode(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}__commitText(e){const t=this.startNode.nextSibling;e=e==null?"":e;const s=typeof e=="string"?e:String(e);t===this.endNode.previousSibling&&t.nodeType===3?t.data=s:this.__commitNode(document.createTextNode(s)),this.value=e}__commitTemplateResult(e){const t=this.options.templateFactory(e);if(this.value instanceof hn&&this.value.template===t)this.value.update(e.values);else{const s=new hn(t,e.processor,this.options),i=s._clone();s.update(e.values),this.__commitNode(i),this.value=s}}__commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());const t=this.value;let s=0,i;for(const r of e)i=t[s],i===void 0&&(i=new de(this.options),t.push(i),s===0?i.appendIntoPart(this):i.insertAfterPart(t[s-1])),i.setValue(r),i.commit(),s++;s<t.length&&(t.length=s,this.clear(i&&i.endNode))}clear(e=this.startNode){pt(this.startNode.parentNode,e.nextSibling,this.endNode)}}class ws{constructor(e,t,s){if(this.value=void 0,this.__pendingValue=void 0,s.length!==2||s[0]!==""||s[1]!=="")throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=t,this.strings=s}setValue(e){this.__pendingValue=e}commit(){for(;Ce(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=j,t(this)}if(this.__pendingValue===j)return;const e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=j}}class Ss extends dn{constructor(e,t,s){super(e,t,s);this.single=s.length===2&&s[0]===""&&s[1]===""}_createPart(){return new Es(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class Es extends Et{}let fn=!1;(()=>{try{const n={get capture(){return fn=!0,!1}};window.addEventListener("test",n,n),window.removeEventListener("test",n,n)}catch{}})();class _s{constructor(e,t,s){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=s,this.__boundHandleEvent=i=>this.handleEvent(i)}setValue(e){this.__pendingValue=e}commit(){for(;Ce(this.__pendingValue);){const r=this.__pendingValue;this.__pendingValue=j,r(this)}if(this.__pendingValue===j)return;const e=this.__pendingValue,t=this.value,s=e==null||t!=null&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),i=e!=null&&(t==null||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=vs(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=j}handleEvent(e){typeof this.value=="function"?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const vs=n=>n&&(fn?{capture:n.capture,passive:n.passive,once:n.once}:n.capture);/**
|
|
86
86
|
* @license
|
|
87
87
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
88
88
|
* This code may only be used under the BSD style license found at
|
|
@@ -94,7 +94,7 @@ var oi=Object.defineProperty,ai=Object.defineProperties;var ci=Object.getOwnProp
|
|
|
94
94
|
* Code distributed by Google as part of the polymer project is also
|
|
95
95
|
* subject to an additional IP rights grant found at
|
|
96
96
|
* http://polymer.github.io/PATENTS.txt
|
|
97
|
-
*/class
|
|
97
|
+
*/class bs{handleAttributeExpressions(e,t,s,i){const r=t[0];return r==="."?new Ss(e,t.slice(1),s).parts:r==="@"?[new _s(e,t.slice(1),i.eventContext)]:r==="?"?[new ws(e,t.slice(1),s)]:new dn(e,t,s).parts}handleTextExpression(e){return new de(e)}}const mn=new bs;/**
|
|
98
98
|
* @license
|
|
99
99
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
100
100
|
* This code may only be used under the BSD style license found at
|
|
@@ -106,7 +106,7 @@ var oi=Object.defineProperty,ai=Object.defineProperties;var ci=Object.getOwnProp
|
|
|
106
106
|
* Code distributed by Google as part of the polymer project is also
|
|
107
107
|
* subject to an additional IP rights grant found at
|
|
108
108
|
* http://polymer.github.io/PATENTS.txt
|
|
109
|
-
*/function
|
|
109
|
+
*/function Ps(n){let e=pn.get(n.type);e===void 0&&(e={stringsArray:new WeakMap,keyString:new Map},pn.set(n.type,e));let t=e.stringsArray.get(n.strings);if(t!==void 0)return t;const s=n.strings.join(Q);return t=e.keyString.get(s),t===void 0&&(t=new ps(n,n.getTemplateElement()),e.keyString.set(s,t)),e.stringsArray.set(n.strings,t),t}const pn=new Map;/**
|
|
110
110
|
* @license
|
|
111
111
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
112
112
|
* This code may only be used under the BSD style license found at
|
|
@@ -118,7 +118,7 @@ var oi=Object.defineProperty,ai=Object.defineProperties;var ci=Object.getOwnProp
|
|
|
118
118
|
* Code distributed by Google as part of the polymer project is also
|
|
119
119
|
* subject to an additional IP rights grant found at
|
|
120
120
|
* http://polymer.github.io/PATENTS.txt
|
|
121
|
-
*/const gn=new WeakMap,
|
|
121
|
+
*/const gn=new WeakMap,xe=(n,e,t)=>{let s=gn.get(e);s===void 0&&(pt(e,e.firstChild),gn.set(e,s=new de(Object.assign({templateFactory:Ps},t))),s.appendInto(e)),s.setValue(n),s.commit()};/**
|
|
122
122
|
* @license
|
|
123
123
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
124
124
|
* This code may only be used under the BSD style license found at
|
|
@@ -130,8 +130,8 @@ var oi=Object.defineProperty,ai=Object.defineProperties;var ci=Object.getOwnProp
|
|
|
130
130
|
* Code distributed by Google as part of the polymer project is also
|
|
131
131
|
* subject to an additional IP rights grant found at
|
|
132
132
|
* http://polymer.github.io/PATENTS.txt
|
|
133
|
-
*/typeof window!="undefined"&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const N=(n,...e)=>new ke(n,e,"html",mn),yn=(n,...e)=>new yt(n,e,"svg",mn),Le=new Set;function H(n){typeof n=="function"&&(Le.size||globalThis.queueMicrotask(()=>{Le.forEach(e=>e()),Le.clear()}),Le.delete(n),Le.add(n))}const $e=[];function
|
|
134
|
-
)*)}`,"g");function _n(n,e){const t=[];let s=`& {${n.replace(
|
|
133
|
+
*/typeof window!="undefined"&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const N=(n,...e)=>new ke(n,e,"html",mn),yn=(n,...e)=>new yt(n,e,"svg",mn),Le=new Set;function H(n){typeof n=="function"&&(Le.size||globalThis.queueMicrotask(()=>{Le.forEach(e=>e()),Le.clear()}),Le.delete(n),Le.add(n))}const $e=[];function Cs(){for(let n=$e.length-1;n>=0;n--)$e[n]();$e.length=0}function wn(n){$e.length||H(Cs),$e.push(n)}function Ue(n="",e=""){const{pathname:t,search:s,hash:i}=new URL(e,location.origin+n);return t+s+i}class _t extends(globalThis.EventTarget||Object){constructor(){super(...arguments);M(this,Se);M(this,ee,void 0);M(this,te,void 0);M(this,le,void 0);G(this,ee,new Map)}get size(){return g(this,ee).size}add(e){g(this,le)||this.dispatchEvent(new CustomEvent("start"));const t=ft(this,Se,en).call(this,e)||{value:e};t.prev=g(this,le),t.prev&&(t.prev.next=t),t.next=void 0,G(this,le,t),g(this,te)||G(this,te,t),g(this,ee).set(e,t)}delete(e){const t=ft(this,Se,en).call(this,e);return g(this,te)||this.dispatchEvent(new CustomEvent("end")),t}get(){const e=g(this,te);if(!!e)return ft(this,Se,en).call(this,e.value),e.value}}ee=new WeakMap,te=new WeakMap,le=new WeakMap,Se=new WeakSet,en=function(e){const t=g(this,ee).get(e);return t&&(t.prev?t.prev.next=t.next:G(this,te,t.next),t.next?t.next.prev=t.prev:G(this,le,t.prev),g(this,ee).delete(e)),t};class vt extends WeakMap{get(e){let t=super.get(e);return t||(t={},this.set(e,t)),t}}class fe extends URLSearchParams{constructor(e){super(e);M(this,Ee,e=>typeof e=="string"?e:JSON.stringify(e));M(this,ht,e=>{if(!e)return null;try{return JSON.parse(e)}catch{return null}})}concat(e){let t;typeof e=="string"?t=Object.fromEntries(new URLSearchParams(e).entries()):t=e,Object.entries(t).forEach(([s,i])=>{this.append(s,g(this,Ee).call(this,i))})}setAny(e,t){if(Array.isArray(t))this.delete(e),t.forEach(s=>this.append(e,g(this,Ee).call(this,s)));else{const s=g(this,Ee).call(this,t);s?this.set(e,s):this.delete(e)}}getAny(e){return this.getAnyAll(e)[0]}getAnyAll(e){return this.getAll(e).filter(t=>t!=="").map(t=>g(this,ht).call(this,t))}toString(){const e=super.toString();return e?`?${e}`:""}toJSON(){return this.toString()}}Ee=new WeakMap,ht=new WeakMap;function me(n,...e){return n.reduce((t,s,i)=>{var r;return t+((r=e[i-1])!=null?r:"")+s})}function Sn(n,...e){return me(n,...e)}const Be=Symbol.for("gem@sheetToken");o.useNativeCSSStyleSheet=!0;let bt=window.CSSStyleSheet;try{new bt}catch{o.useNativeCSSStyleSheet=!1,bt=class{constructor(){this.media={mediaText:""},this.style="",this.replaceSync=n=>this.style=n}}}function En(n,e=""){const t=new bt,s={};t.media.mediaText=e;let i="";return typeof n=="string"?i=n:Object.keys(n).forEach(r=>{s[r]=`${r}-${Me()}`,i+=n[r].styledContent.replace(/&/g,s[r])}),t.replaceSync(i),s[Be]=t,s}function Me(n=5,e="0123456789abcdefghijklmnopqrstuvwxyz"){const t=e.length;let s="";for(let i=0;i<n;i++)s+=e[Math.floor(Math.random()*t)];return s}const Ts=new RegExp(`&.*{((.|
|
|
134
|
+
)*)}`,"g");function _n(n,e){const t=[];let s=`& {${n.replace(Ts,i=>(t.push(i),""))}}`+t.join("");return s=s.replace(/&/g,e==="class"?".&":"#&"),{styledContent:s,type:e}}const vn={class:(n,...e)=>{const t=me(n,...e);return _n(t,"class")},id:(n,...e)=>{const t=me(n,...e);return _n(t,"id")},keyframes:(n,...e)=>({styledContent:`@keyframes & {${me(n,...e)}}`,type:"keyframes"})};function I(n){return n.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function pe(n){return n.replace(/-(.)/g,(e,t)=>t.toUpperCase())}function Ne(n){return Object.keys(n).forEach(e=>{const t=e;delete n[t]}),n}class K extends Error{constructor(e){super(e);this.message=`gem: ${this.message}`}}function Pt(n,e){const t=n.length;if(e.length!==t)return!0;for(let s=0;s<t;s++)if(n[s]!==e[s])return!0;return!1}function Ct(n,e){const t=new Set(e);return n.filter(s=>t.has(s)?(t.delete(s),!1):!0)}function Oe(n,e,t){let s=e;for(const i in n){const r=t(i,n[i]);s+=r?r+e:""}return s}function bn(n){return Oe(n,";",(e,t)=>t!==void 0?`${I(e)}:${t}`:"")}function Tt(n){return Oe(n," ",(e,t)=>t?e:"")}const Pn=Tt;function Cn(n){return Oe(n,",",(e,t)=>t!==void 0?`${e}:${t}`:"")}const ne=new WeakMap;function z(n){if(ne.has(n))throw new K("argument error");return ne.set(n,new Set),n}function Tn(n){return Object.keys(n).forEach(t=>{z(n[t])}),n}function P(n,e){Object.assign(n,e);const t=ne.get(n);t==null||t.forEach(s=>{H(s)})}function se(n,e){const t=ne.get(n);t==null||t.add(e)}function kt(n,e){const t=ne.get(n);t==null||t.delete(e)}/**
|
|
135
135
|
* @license
|
|
136
136
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
137
137
|
* This code may only be used under the BSD style license found at
|
|
@@ -167,11 +167,11 @@ var oi=Object.defineProperty,ai=Object.defineProperties;var ci=Object.getOwnProp
|
|
|
167
167
|
* Code distributed by Google as part of the polymer project is also
|
|
168
168
|
* subject to an additional IP rights grant found at
|
|
169
169
|
* http://polymer.github.io/PATENTS.txt
|
|
170
|
-
*/const Nt=new WeakMap,Ot=J(n=>e=>{const t=Nt.get(e);if(n===void 0&&e instanceof Et){if(t!==void 0||!Nt.has(e)){const s=e.committer.name;e.committer.element.removeAttribute(s)}}else n!==t&&e.setValue(n);Nt.set(e,n)});var Rn=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},d=(n,e,t)=>(Rn(n,e,"read from private field"),t?t.call(n):e.get(n)),
|
|
170
|
+
*/const Nt=new WeakMap,Ot=J(n=>e=>{const t=Nt.get(e);if(n===void 0&&e instanceof Et){if(t!==void 0||!Nt.has(e)){const s=e.committer.name;e.committer.element.removeAttribute(s)}}else n!==t&&e.setValue(n);Nt.set(e,n)});var Rn=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},d=(n,e,t)=>(Rn(n,e,"read from private field"),t?t.call(n):e.get(n)),C=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},F=(n,e,t,s)=>(Rn(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),ge,re,Re,Ae,Y,Z,Ke,ze,Rt,At,Gt,Fe,Ht,Je,X,It,Qe;function ks(){}function Vt(n){typeof n=="function"&&n()}const Ye=new _t,Wt=(n=performance.now())=>{if(performance.now()>n+16)return requestAnimationFrame(Wt);const e=Ye.get();e&&(e(),Wt(n))};Ye.addEventListener("start",()=>H(Wt));const Ze=Symbol("init"),An=Symbol("update");class A extends HTMLElement{constructor({isAsync:e,isLight:t,delegatesFocus:s}={}){super();C(this,ge,void 0),C(this,re,void 0),C(this,Re,void 0),C(this,Ae,void 0),C(this,Y,void 0),C(this,Z,void 0),C(this,Ke,void 0),this.setState=r=>{if(!this.state)throw new K("`state` not initialized");Object.assign(this.state,r),H(d(this,X))},C(this,ze,r=>{r==null||r.forEach(a=>{const{callback:c,getDep:l,values:h,preCallback:m}=a,u=l==null?void 0:l();(!l||!h||Pt(h,u))&&(Vt(m),a.preCallback=c(u,h),a.values=u)})}),C(this,Rt,()=>{d(this,ze).call(this,d(this,Y))}),C(this,At,()=>{d(this,ze).call(this,d(this,Z))}),this.effect=(r,a)=>{d(this,Y)||F(this,Y,[]);const c={callback:r,getDep:a,values:void 0,initialized:!!this.isConnected};this.isConnected&&(c.values=a==null?void 0:a(),c.preCallback=r(c.values)),d(this,Y).push(c)},this.memo=(r,a)=>{d(this,Z)||F(this,Z,[]),d(this,Z).push({callback:r,getDep:a,values:[Symbol()],initialized:this.isConnected})},C(this,Gt,()=>{var r;(r=d(this,Y))==null||r.forEach(a=>{const{callback:c,getDep:l,initialized:h}=a;h||(a.values=l==null?void 0:l(),a.preCallback=c(a.values),a.initialized=!0)})}),C(this,Fe,()=>{var a,c;d(this,At).call(this);const r=o.useNativeCSSStyleSheet?"":N`${(c=(a=this.shadowRoot)==null?void 0:a.adoptedStyleSheets)==null?void 0:c.map(l=>N`
|
|
171
171
|
<style media=${l.media.mediaText}>
|
|
172
172
|
${l.style}
|
|
173
173
|
</style>
|
|
174
|
-
`)}`;if(this.render){const l=this.render();return l&&N`${l}${r}`}return d(this,ge)===this?void 0:N`<slot></slot>${r}`}),T(this,Ht,()=>this.shouldUpdate?this.shouldUpdate():!0),T(this,Je,()=>{if(this.isConnected&&d(this,Ht).call(this)){const r=d(this,Fe).call(this);r!==void 0&&qe(r,d(this,ge)),H(d(this,It)),H(d(this,Rt))}}),T(this,X,()=>{d(this,Ae)?Ye.add(d(this,Je)):d(this,Je).call(this)}),this.update=()=>{H(d(this,X))},T(this,It,()=>{var r;(r=this.updated)==null||r.call(this)}),T(this,Qe,()=>{var l,h,m;if(d(this,Re)){F(this,Re,!1);return}(l=this.willMount)==null||l.call(this);const{observedStores:r,rootElement:a}=this.constructor;r==null||r.forEach(u=>{se(u,d(this,X))});const c=d(this,Fe).call(this);if(c!==void 0&&qe(c,d(this,ge)),F(this,Ke,(h=this.mounted)==null?void 0:h.call(this)),d(this,Gt).call(this),a&&((m=this.getRootNode().host)==null?void 0:m.tagName)!==a.toUpperCase())throw new K("not allow current root type")}),H(()=>this[Ze]=!1),this[Ze]=!0,this[An]=()=>{this.isConnected&&H(d(this,X))},F(this,Ae,e),F(this,ge,t?this:this.attachShadow({mode:"open",delegatesFocus:s}));const{adoptedStyleSheets:i}=new.target;if(i){const r=i.map(a=>a[Be]||a);this.shadowRoot?this.shadowRoot.adoptedStyleSheets=r:this.effect(()=>{const a=this.getRootNode();if(o.useNativeCSSStyleSheet)return a.adoptedStyleSheets=[...a.adoptedStyleSheets,...r],()=>{a.adoptedStyleSheets=Tt(a.adoptedStyleSheets,r)};{const c=a===document?document.body:a;return c._sheets=c._sheets||{},r.forEach(({style:l,media:h})=>{if(c._sheets[l])c._sheets[l].count++;else{const m=document.createElement("style");m.innerHTML=l,m.media=h.mediaText,c.append(m),c._sheets[l]={ele:m,count:1}}}),()=>{r.forEach(({style:l})=>{c._sheets[l].count--,c._sheets[l].count||delete c._sheets[l]})}}},()=>[])}}get internals(){if(!d(this,re)){const e=()=>{const t=s=>s.replace(/-/g,"");return{has:s=>t(s)in this.dataset,add:s=>{this.dataset[t(s)]=""},delete:s=>delete this.dataset[t(s)]}};this.attachInternals||(this.attachInternals=()=>({states:e()})),F(this,re,this.attachInternals()),d(this,re).states||(d(this,re).states=e())}return d(this,re)}attributeChangedCallback(){this.isConnected&&H(d(this,X))}closestElement(e){const t=typeof e=="function",s=typeof e=="string"&&e.toUpperCase(),i=r=>{const a=r.parentElement||r.getRootNode().host;if(!a)return null;if(t){if(a.constructor===e)return a}else if(a.tagName===s)return a;return i(a)};return i(this)}connectedCallback(){d(this,Ae)?Ye.add(d(this,Qe)):d(this,Qe).call(this)}disconnectedCallback(){var t,s,i;if(this.isConnected){F(this,Re,!0);return}const{observedStores:e}=this.constructor;e==null||e.forEach(r=>{kt(r,d(this,X))}),Vt(d(this,Ke)),(t=this.unmounted)==null||t.call(this),(s=d(this,Y))==null||s.forEach(r=>{Vt(r.preCallback)}),F(this,Z,(i=d(this,Z))==null?void 0:i.filter(({initialized:r})=>!r))}}ge=new WeakMap,re=new WeakMap,Re=new WeakMap,Ae=new WeakMap,Y=new WeakMap,Z=new WeakMap,Ke=new WeakMap,ze=new WeakMap,Rt=new WeakMap,At=new WeakMap,Gt=new WeakMap,Fe=new WeakMap,Ht=new WeakMap,Je=new WeakMap,X=new WeakMap,It=new WeakMap,Qe=new WeakMap;const Xe=new vt;function et(n,e,t){const{booleanAttributes:s,numberAttributes:i}=n.constructor;Object.defineProperty(n,e,{configurable:!0,get(){if(!(Ze in this))return;const a=this.getAttribute(t);return(s==null?void 0:s.has(t))?a!==null:(i==null?void 0:i.has(t))?Number(a):a||""},set(r){const a=this,c=Xe.get(this),l=c[e],h=a.getAttribute(t);if(this[Ze]&&h!==null&&!l)return;c[e]=!0;const m=s==null?void 0:s.has(t);r==null?a.removeAttribute(t):m?a.toggleAttribute(t,!!r):h!==String(r)&&a.setAttribute(t,String(r))}})}const Gn=Symbol("event handle");function ye(n,e,t,s){Object.defineProperty(n,e,{configurable:!0,get(){const i=Xe.get(this)[e];return i||!t?i:(this[e]=Ts,this[e])},set(i){const r=this,a=Xe.get(r);i!==a[e]&&(t?(a[e]=(i==null?void 0:i[Gn])?i:(c,l)=>{const h=new CustomEvent(t,xe(C(C({},l),s),{detail:c}));r.dispatchEvent(h),i(c,l)},a[e][Gn]=!0):(a[e]=i,this[An]()))}})}function tt(n,e,t){Object.defineProperty(n,e,{configurable:!0,get(){const s=Xe.get(this);let i=s[e];if(!i){const r=this,a=r.shadowRoot||r;i={get ref(){return t},get element(){const c=[...a.querySelectorAll("[data-gemreflect]")].map(l=>l.target);for(const l of[a,...c]){const h=l.querySelector(`[ref=${t}]`);if(h)return h}}},s[e]=i}return i}})}function nt(n,e,t){Object.defineProperty(n,e,{configurable:!0,get(){var r;const s=this,{states:i}=s.internals;return(r=i.has)==null?void 0:r.call(i,t)},set(s){const i=this,{states:r}=i.internals;s?r.add(t):r.delete(t)}})}const st=customElements.define.bind(customElements);customElements.define=(n,e,t)=>{if(e.prototype instanceof A){const{observedAttributes:s,observedPropertys:i,defineEvents:r,defineCSSStates:a,defineRefs:c}=e;s==null||s.forEach(l=>et(e.prototype,pe(l),l)),i==null||i.forEach(l=>ye(e.prototype,l)),r==null||r.forEach(l=>ye(e.prototype,pe(l),l)),a==null||a.forEach(l=>nt(e.prototype,pe(l),`--${l}`)),c==null||c.forEach(l=>tt(e.prototype,pe(l),l))}st(n,e,t)};function D(n,e,t,s=!1){const i=n.constructor,r=i[e];i.hasOwnProperty(e)||Object.defineProperty(i,e,{value:s?new Set(r):r?Array.from(r):[]}),i[e][s?"add":"push"](t)}function Hn(n,e){const t=`${I(e)}-${Me()}`;D(n,"defineRefs",t),tt(n,e,t)}function jt(n,e,t){D(n,"observedAttributes",t),et(n,e,t)}function k(n,e){jt(n,e,I(e))}function In(n,e){const t=I(e);D(n,"booleanAttributes",t,!0),jt(n,e,t)}function Vn(n,e){const t=I(e);D(n,"numberAttributes",t,!0),jt(n,e,t)}function x(n,e){D(n,"observedPropertys",e),ye(n,e)}function Ge(n,e){const t=I(e);D(n,"defineCSSStates",t),nt(n,e,`--${t}`)}function Wn(n,e){const t=I(n[e]||e);n[e]=t,D(n instanceof A?n:n.prototype,"defineSlots",t)}function Dt(n,e){const t=I(n[e]||e);n[e]=t,D(n instanceof A?n:n.prototype,"defineParts",t)}function He(n,e){Dn(n,e)}function jn(n,e){Dn(n,e,{bubbles:!0,composed:!0})}function Dn(n,e,t){const s=I(e);D(n,"defineEvents",s),ye(n,e,s,t)}function xn(n){return function(e){D(e.prototype,"adoptedStyleSheets",n)}}function oe(n){return function(e){D(e.prototype,"observedStores",n)}}function qn(n){return function(e){const t=e;t.rootElement=n}}function Un(n){return function(e){st(n,e)}}const V=window.history,Bn=V.pushState.bind(V),Kn=V.replaceState.bind(V);let Cs=0;const xt=()=>`${performance.now()}-${++Cs}`,v=z({$hasCloseHandle:!1,$hasOpenHandle:!1,$hasShouldCloseHandle:!1,$key:""}),O=new Map;function zn({$key:n,$hasCloseHandle:e,$hasOpenHandle:t,$hasShouldCloseHandle:s}={}){if(v.$key!==n){if(n)throw new K("`$key` is not allowed");if(e)throw new K("`$hasCloseHandle` is not allowed");if(t)throw new K("`$hasOpenHandle` is not allowed");if(s)throw new K("`$hasShouldCloseHandle` is not allowed")}}function Fn(n){return q.basePath?q.basePath+n:n}function Jn(n){return n===q.basePath?"/":n.replace(new RegExp(`^${q.basePath}/`),"/")}function it(n){const e=O.get(v.$key)||{},t=n.path?Ue(e.path,n.path):Jn(location.pathname),s=new fe(n.query||(n.path?"":location.search)),i=n.path&&n.path!==e.path||n.query&&String(n.query)!==String(e.query),r=n.title||(i?"":document.title),a=n.close||n.data||n.open||n.shouldClose,c=n.hash||(!i&&a?decodeURIComponent(location.hash):"");return xe(C({},n),{title:r,path:t,query:s,hash:c})}function Qn(n,e){zn(n.data);const t=it(n),{title:s,path:i,query:r,hash:a,close:c,open:l,shouldClose:h,data:m}=t,u=C({$hasCloseHandle:!!c,$hasOpenHandle:!!l,$hasShouldCloseHandle:!!h,$key:xt()},m);O.set(u.$key,t),P(Ne(v),u);const $=Fn(i)+new fe(r)+a,w=decodeURIComponent(location.hash);e(u,s,$),w!==a&&window.dispatchEvent(new CustomEvent("hashchange"))}function Yn(n,e,t,s){zn(n);const i=C({$key:xt()},n||{}),{pathname:r,search:a,hash:c}=new URL(t,location.origin+location.pathname),l=it({path:r,query:new fe(a),hash:c,title:e,data:n});O.set(i.$key,l),P(Ne(v),i);const h=Fn(r)+l.query+c,m=location.hash;s(i,e,h),m!==c&&window.dispatchEvent(new CustomEvent("hashchange"))}const qt=z({basePath:""});class ks{get store(){return v}get basePath(){return qt.basePath}set basePath(e){P(qt,{basePath:e}),Object.assign(O.get(v.$key),{path:Jn(location.pathname)})}getParams(){return O.get(v.$key)}updateParams(e){Object.assign(O.get(v.$key),e),P(v,{})}push(e){Qn(e,Bn)}replace(e){Qn(e,Kn)}pushIgnoreCloseHandle(e){var t,s;v.$hasCloseHandle?((s=(t=O.get(v.$key))==null?void 0:t.close)==null||s.call(t),this.replace(e)):this.push(e)}forward(){V.forward()}back(){V.back()}}const q=new ks,Ie=z({title:""}),Ls={history:q,titleStore:Ie,basePathStore:qt};if(!window._GEMHISTORY){if(window._GEMHISTORY=Ls,V.pushState=function(e,t,s){Yn(e,t,s,Bn)},V.replaceState=function(e,t,s){Yn(e,t,s,Kn)},window.addEventListener("hashchange",({isTrusted:e})=>{e&&q.replace({hash:decodeURIComponent(location.hash)})}),V.state)if(V.state.$hasCloseHandle){P(v,V.state);const e=it({title:document.title});O.set(v.$key,e),q.back()}else{const e=it({title:document.title,hash:location.hash});P(v,C({$key:xt()},V.state||{})),O.set(v.$key,e)}else{const{pathname:e,search:t,hash:s}=location;q.replace({path:e,query:t,hash:s})}se(Ie,()=>{const e=O.get(v.$key);e&&(e.title=Ie.title)}),se(v,()=>{const{title:e}=q.getParams();e!==Ie.title&&P(Ie,{title:e})});let n=!1;window.addEventListener("popstate",e=>{var i,r;const t=e.state;if(!(t==null?void 0:t.$key))return;if(n){n=!1;return}if(!O.has(t.$key)){const{pathname:a,search:c,hash:l}=location;O.set(t.$key,{path:a,query:new fe(c),hash:l,title:document.title,data:t})}const s=v;if(parseFloat(t.$key)>parseFloat(s.$key)&&t.$hasOpenHandle)(r=(i=O.get(t.$key))==null?void 0:i.open)==null||r.call(i);else if(s.$hasCloseHandle){const a=O.get(s.$key),c=a==null?void 0:a.close,l=a==null?void 0:a.shouldClose;if(l&&!l()){n=!0,q.forward();return}else c?c():t.$hasCloseHandle&&(n=!0,q.back())}P(Ne(v),t)})}const{history:E,titleStore:ae,basePathStore:Ut}=window._GEMHISTORY;var $s=Object.defineProperty,Ms=Object.getOwnPropertyDescriptor,ce=(n,e,t,s)=>{for(var i=s>1?void 0:s?Ms(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&$s(e,t,i),i},Zn=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},Ve=(n,e,t)=>(Zn(n,e,"read from private field"),t?t.call(n):e.get(n)),Bt=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Xn=(n,e,t,s)=>(Zn(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),We,rt,ot;class Ns extends RegExp{constructor(e){const t={};let s=0;super(`^${e.replace(/:([^/$]+)/g,(i,r)=>(t[r]=s++,"([^/]+)")).replace("*",".*")}$`,"i");this.namePosition=t}}function Kt(n,e){const t=new Ns(n),s=e.match(t)||`${e}/`.match(t);if(!s)return null;const i={};return s&&Object.keys(t.namePosition).forEach(r=>{i[r]=s[t.namePosition[r]+1]}),i}function zt(n,e){let t=n.pattern;const s=e==null?void 0:e.params;return s&&Object.keys(s).forEach(i=>{t=t.replace(new RegExp(`:${i}`,"g"),s[i])}),t}function es(n,e){const t=zt(n,e);return C({path:t},e)}o.GemRouteElement=class extends A{constructor({isLight:n,routes:e}={}){super({isLight:n});this.currentParams={},Bt(this,We,void 0),this.state={content:void 0},Bt(this,rt,()=>{if(this.locationStore){const{path:t,query:s,data:i}=E.getParams();P(this.locationStore,{path:t,params:this.currentParams,query:s,data:i})}}),Bt(this,ot,(t,s,i)=>{Xn(this,We,void 0),this.currentRoute=t,this.currentParams=s,this.setState({content:i}),this.routechange(this.currentRoute),Ve(this,rt).call(this)}),this.routes=e}mounted(){this.effect(([n,e],t)=>{if(t&&n===t[0]&&e===t[1]){Ve(this,rt).call(this);return}const{route:s,params:i={}}=o.GemRouteElement.findRoute(this.routes,e),{redirect:r,content:a,getContent:c}=s||{};if(r){E.replace({path:r});return}const l=s==null?void 0:s.title;l&&P(ae,{title:l});const h=a||(c==null?void 0:c(i));if(h instanceof Promise){this.loading(s),Xn(this,We,h);const m=()=>Ve(this,We)===h;h.then(u=>{m()&&Ve(this,ot).call(this,s,i,u)}).catch(u=>{m()&&this.error(u)});return}Ve(this,ot).call(this,s,i,h)},()=>{const{path:n}=E.getParams();return[this.key,n,location.search]})}shouldUpdate(){return!this.inert}render(){const{content:n}=this.state;return this.shadowRoot?N`
|
|
174
|
+
`)}`;if(this.render){const l=this.render();return l&&N`${l}${r}`}return d(this,ge)===this?void 0:N`<slot></slot>${r}`}),C(this,Ht,()=>this.shouldUpdate?this.shouldUpdate():!0),C(this,Je,()=>{if(this.isConnected&&d(this,Ht).call(this)){const r=d(this,Fe).call(this);r!==void 0&&xe(r,d(this,ge)),H(d(this,It)),H(d(this,Rt))}}),C(this,X,()=>{d(this,Ae)?Ye.add(d(this,Je)):d(this,Je).call(this)}),this.update=()=>{H(d(this,X))},C(this,It,()=>{var r;(r=this.updated)==null||r.call(this)}),C(this,Qe,()=>{var l,h,m;if(d(this,Re)){F(this,Re,!1);return}(l=this.willMount)==null||l.call(this);const{observedStores:r,rootElement:a}=this.constructor;r==null||r.forEach(u=>{se(u,d(this,X))});const c=d(this,Fe).call(this);if(c!==void 0&&xe(c,d(this,ge)),F(this,Ke,(h=this.mounted)==null?void 0:h.call(this)),d(this,Gt).call(this),a&&((m=this.getRootNode().host)==null?void 0:m.tagName)!==a.toUpperCase())throw new K("not allow current root type")}),H(()=>this[Ze]=!1),this[Ze]=!0,this[An]=()=>{this.isConnected&&H(d(this,X))},F(this,Ae,e),F(this,ge,t?this:this.attachShadow({mode:"open",delegatesFocus:s}));const{adoptedStyleSheets:i}=new.target;if(i){const r=i.map(a=>a[Be]||a);this.shadowRoot?this.shadowRoot.adoptedStyleSheets=r:this.effect(()=>{const a=this.getRootNode();if(o.useNativeCSSStyleSheet)return a.adoptedStyleSheets=[...a.adoptedStyleSheets,...r],()=>{a.adoptedStyleSheets=Ct(a.adoptedStyleSheets,r)};{const c=a===document?document.body:a;return c._sheets=c._sheets||{},r.forEach(({style:l,media:h})=>{if(c._sheets[l])c._sheets[l].count++;else{const m=document.createElement("style");m.innerHTML=l,m.media=h.mediaText,c.append(m),c._sheets[l]={ele:m,count:1}}}),()=>{r.forEach(({style:l})=>{c._sheets[l].count--,c._sheets[l].count||delete c._sheets[l]})}}},()=>[])}}get internals(){if(!d(this,re)){const e=()=>{const t=s=>s.replace(/-/g,"");return{has:s=>t(s)in this.dataset,add:s=>{this.dataset[t(s)]=""},delete:s=>delete this.dataset[t(s)]}};this.attachInternals||(this.attachInternals=()=>({states:e()})),F(this,re,this.attachInternals()),d(this,re).states||(d(this,re).states=e())}return d(this,re)}attributeChangedCallback(){this.isConnected&&H(d(this,X))}closestElement(e){const t=typeof e=="function",s=typeof e=="string"&&e.toUpperCase(),i=r=>{const a=r.parentElement||r.getRootNode().host;if(!a)return null;if(t){if(a.constructor===e)return a}else if(a.tagName===s)return a;return i(a)};return i(this)}connectedCallback(){d(this,Ae)?Ye.add(d(this,Qe)):d(this,Qe).call(this)}disconnectedCallback(){var t,s,i;if(this.isConnected){F(this,Re,!0);return}const{observedStores:e}=this.constructor;e==null||e.forEach(r=>{kt(r,d(this,X))}),Vt(d(this,Ke)),(t=this.unmounted)==null||t.call(this),(s=d(this,Y))==null||s.forEach(r=>{Vt(r.preCallback)}),F(this,Z,(i=d(this,Z))==null?void 0:i.filter(({initialized:r})=>!r))}}ge=new WeakMap,re=new WeakMap,Re=new WeakMap,Ae=new WeakMap,Y=new WeakMap,Z=new WeakMap,Ke=new WeakMap,ze=new WeakMap,Rt=new WeakMap,At=new WeakMap,Gt=new WeakMap,Fe=new WeakMap,Ht=new WeakMap,Je=new WeakMap,X=new WeakMap,It=new WeakMap,Qe=new WeakMap;const Xe=new vt;function et(n,e,t){const{booleanAttributes:s,numberAttributes:i}=n.constructor;Object.defineProperty(n,e,{configurable:!0,get(){if(!(Ze in this))return;const a=this.getAttribute(t);return(s==null?void 0:s.has(t))?a!==null:(i==null?void 0:i.has(t))?Number(a):a||""},set(r){const a=this,c=Xe.get(this),l=c[e],h=a.getAttribute(t);if(this[Ze]&&h!==null&&!l)return;c[e]=!0;const m=s==null?void 0:s.has(t);r==null?a.removeAttribute(t):m?a.toggleAttribute(t,!!r):h!==String(r)&&a.setAttribute(t,String(r))}})}const Gn=Symbol("event handle");function ye(n,e,t,s){Object.defineProperty(n,e,{configurable:!0,get(){const i=Xe.get(this)[e];return i||!t?i:(this[e]=ks,this[e])},set(i){const r=this,a=Xe.get(r);i!==a[e]&&(t?(a[e]=(i==null?void 0:i[Gn])?i:(c,l)=>{const h=new CustomEvent(t,qe(T(T({},l),s),{detail:c}));r.dispatchEvent(h),i(c,l)},a[e][Gn]=!0):(a[e]=i,this[An]()))}})}function tt(n,e,t){Object.defineProperty(n,e,{configurable:!0,get(){const s=Xe.get(this);let i=s[e];if(!i){const r=this,a=r.shadowRoot||r;i={get ref(){return t},get element(){const c=[...a.querySelectorAll("[data-gemreflect]")].map(l=>l.target);for(const l of[a,...c]){const h=l.querySelector(`[ref=${t}]`);if(h)return h}}},s[e]=i}return i}})}function nt(n,e,t){Object.defineProperty(n,e,{configurable:!0,get(){var r;const s=this,{states:i}=s.internals;return(r=i.has)==null?void 0:r.call(i,t)},set(s){const i=this,{states:r}=i.internals;s?r.add(t):r.delete(t)}})}const st=customElements.define.bind(customElements);customElements.define=(n,e,t)=>{if(e.prototype instanceof A){const{observedAttributes:s,observedPropertys:i,defineEvents:r,defineCSSStates:a,defineRefs:c}=e;s==null||s.forEach(l=>et(e.prototype,pe(l),l)),i==null||i.forEach(l=>ye(e.prototype,l)),r==null||r.forEach(l=>ye(e.prototype,pe(l),l)),a==null||a.forEach(l=>nt(e.prototype,pe(l),`--${l}`)),c==null||c.forEach(l=>tt(e.prototype,pe(l),l))}st(n,e,t)};function D(n,e,t,s=!1){const i=n.constructor,r=i[e];i.hasOwnProperty(e)||Object.defineProperty(i,e,{value:s?new Set(r):r?Array.from(r):[]}),i[e][s?"add":"push"](t)}function Hn(n,e){const t=`${I(e)}-${Me()}`;D(n,"defineRefs",t),tt(n,e,t)}function jt(n,e,t){D(n,"observedAttributes",t),et(n,e,t)}function k(n,e){jt(n,e,I(e))}function In(n,e){const t=I(e);D(n,"booleanAttributes",t,!0),jt(n,e,t)}function Vn(n,e){const t=I(e);D(n,"numberAttributes",t,!0),jt(n,e,t)}function q(n,e){D(n,"observedPropertys",e),ye(n,e)}function Ge(n,e){const t=I(e);D(n,"defineCSSStates",t),nt(n,e,`--${t}`)}function Wn(n,e){const t=I(n[e]||e);n[e]=t,D(n instanceof A?n:n.prototype,"defineSlots",t)}function Dt(n,e){const t=I(n[e]||e);n[e]=t,D(n instanceof A?n:n.prototype,"defineParts",t)}function He(n,e){Dn(n,e)}function jn(n,e){Dn(n,e,{bubbles:!0,composed:!0})}function Dn(n,e,t){const s=I(e);D(n,"defineEvents",s),ye(n,e,s,t)}function qn(n){return function(e){D(e.prototype,"adoptedStyleSheets",n)}}function oe(n){return function(e){D(e.prototype,"observedStores",n)}}function xn(n){return function(e){const t=e;t.rootElement=n}}function Un(n){return function(e){st(n,e)}}const V=window.history,Bn=V.pushState.bind(V),Kn=V.replaceState.bind(V);let Ls=0;const qt=()=>`${performance.now()}-${++Ls}`,v=z({$hasCloseHandle:!1,$hasOpenHandle:!1,$hasShouldCloseHandle:!1,$key:""}),O=new Map;function zn(n){const{$key:e,$hasCloseHandle:t,$hasOpenHandle:s,$hasShouldCloseHandle:i}=n||{};if(v.$key!==e){if(e)throw new K("`$key` is not allowed");if(t)throw new K("`$hasCloseHandle` is not allowed");if(s)throw new K("`$hasOpenHandle` is not allowed");if(i)throw new K("`$hasShouldCloseHandle` is not allowed")}}function Fn(n){return x.basePath?x.basePath+n:n}function Jn(n){return n===x.basePath?"/":n.replace(new RegExp(`^${x.basePath}/`),"/")}function it(n){const e=O.get(v.$key)||{},t=n.path?Ue(e.path,n.path):Jn(location.pathname),s=new fe(n.query||(n.path?"":location.search)),i=n.path&&n.path!==e.path||n.query&&String(n.query)!==String(e.query),r=n.title||(i?"":document.title),a=n.close||n.data||n.open||n.shouldClose,c=n.hash||(!i&&a?decodeURIComponent(location.hash):"");return qe(T({},n),{title:r,path:t,query:s,hash:c})}function Qn(n,e){zn(n.data);const t=it(n),{title:s,path:i,query:r,hash:a,close:c,open:l,shouldClose:h,data:m}=t,u=T({$hasCloseHandle:!!c,$hasOpenHandle:!!l,$hasShouldCloseHandle:!!h,$key:qt()},m);O.set(u.$key,t),P(Ne(v),u);const $=Fn(i)+new fe(r)+a,w=decodeURIComponent(location.hash);e(u,s,$),w!==a&&window.dispatchEvent(new CustomEvent("hashchange"))}function Yn(n,e,t,s){zn(n);const i=T({$key:qt()},n||{}),{pathname:r,search:a,hash:c}=new URL(t,location.origin+location.pathname),l=it({path:r,query:new fe(a),hash:c,title:e,data:n});O.set(i.$key,l),P(Ne(v),i);const h=Fn(r)+l.query+c,m=location.hash;s(i,e,h),m!==c&&window.dispatchEvent(new CustomEvent("hashchange"))}const xt=z({basePath:""});class $s{get store(){return v}get basePath(){return xt.basePath}set basePath(e){P(xt,{basePath:e}),Object.assign(O.get(v.$key),{path:Jn(location.pathname)})}getParams(){return O.get(v.$key)}updateParams(e){Object.assign(O.get(v.$key),e),P(v,{})}push(e){Qn(e,Bn)}replace(e){Qn(e,Kn)}pushIgnoreCloseHandle(e){var t,s;v.$hasCloseHandle?((s=(t=O.get(v.$key))==null?void 0:t.close)==null||s.call(t),this.replace(e)):this.push(e)}forward(){V.forward()}back(){V.back()}}const x=new $s,Ie=z({title:""}),Ms={history:x,titleStore:Ie,basePathStore:xt};if(!window._GEMHISTORY){if(window._GEMHISTORY=Ms,V.pushState=function(e,t,s){Yn(e,t,s,Bn)},V.replaceState=function(e,t,s){Yn(e,t,s,Kn)},window.addEventListener("hashchange",({isTrusted:e})=>{e&&x.replace({hash:decodeURIComponent(location.hash)})}),V.state)if(V.state.$hasCloseHandle){P(v,V.state);const e=it({title:document.title});O.set(v.$key,e),x.back()}else{const e=it({title:document.title,hash:location.hash});P(v,T({$key:qt()},V.state||{})),O.set(v.$key,e)}else{const{pathname:e,search:t,hash:s}=location;x.replace({path:e,query:t,hash:s})}se(Ie,()=>{const e=O.get(v.$key);e&&(e.title=Ie.title)}),se(v,()=>{const{title:e}=x.getParams();e!==Ie.title&&P(Ie,{title:e})});let n=!1;window.addEventListener("popstate",e=>{var i,r;const t=e.state;if(!(t==null?void 0:t.$key))return;if(n){n=!1;return}if(!O.has(t.$key)){const{pathname:a,search:c,hash:l}=location;O.set(t.$key,{path:a,query:new fe(c),hash:l,title:document.title,data:t})}const s=v;if(parseFloat(t.$key)>parseFloat(s.$key)&&t.$hasOpenHandle)(r=(i=O.get(t.$key))==null?void 0:i.open)==null||r.call(i);else if(s.$hasCloseHandle){const a=O.get(s.$key),c=a==null?void 0:a.close,l=a==null?void 0:a.shouldClose;if(l&&!l()){n=!0,x.forward();return}else c?c():t.$hasCloseHandle&&(n=!0,x.back())}P(Ne(v),t)})}const{history:E,titleStore:ae,basePathStore:Ut}=window._GEMHISTORY;var Ns=Object.defineProperty,Os=Object.getOwnPropertyDescriptor,ce=(n,e,t,s)=>{for(var i=s>1?void 0:s?Os(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&Ns(e,t,i),i},Zn=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},Ve=(n,e,t)=>(Zn(n,e,"read from private field"),t?t.call(n):e.get(n)),Bt=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Xn=(n,e,t,s)=>(Zn(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),We,rt,ot;class Rs extends RegExp{constructor(e){const t={};let s=0;super(`^${e.replace(/:([^/$]+)/g,(i,r)=>(t[r]=s++,"([^/]+)")).replace("*",".*")}$`,"i");this.namePosition=t}}function Kt(n,e){const t=new Rs(n),s=e.match(t)||`${e}/`.match(t);if(!s)return null;const i={};return s&&Object.keys(t.namePosition).forEach(r=>{i[r]=s[t.namePosition[r]+1]}),i}function zt(n,e){let t=n.pattern;const s=e==null?void 0:e.params;return s&&Object.keys(s).forEach(i=>{t=t.replace(new RegExp(`:${i}`,"g"),s[i])}),t}function es(n,e){const t=zt(n,e);return T({path:t},e)}o.GemRouteElement=class extends A{constructor({isLight:n,routes:e}={}){super({isLight:n});this.currentParams={},Bt(this,We,void 0),this.state={content:void 0},Bt(this,rt,()=>{if(this.locationStore){const{path:t,query:s,data:i}=E.getParams();P(this.locationStore,{path:t,params:this.currentParams,query:s,data:i})}}),Bt(this,ot,(t,s,i)=>{Xn(this,We,void 0),this.currentRoute=t,this.currentParams=s,this.setState({content:i}),this.routechange(this.currentRoute),Ve(this,rt).call(this)}),this.routes=e}mounted(){this.effect(([n,e],t)=>{if(t&&n===t[0]&&e===t[1]){Ve(this,rt).call(this);return}const{route:s,params:i={}}=o.GemRouteElement.findRoute(this.routes,e),{redirect:r,content:a,getContent:c}=s||{};if(r){E.replace({path:r});return}const l=s==null?void 0:s.title;l&&P(ae,{title:l});const h=a||(c==null?void 0:c(i));if(h instanceof Promise){this.loading(s),Xn(this,We,h);const m=()=>Ve(this,We)===h;h.then(u=>{m()&&Ve(this,ot).call(this,s,i,u)}).catch(u=>{m()&&this.error(u)});return}Ve(this,ot).call(this,s,i,h)},()=>{const{path:n}=E.getParams();return[this.key,n,location.search]})}shouldUpdate(){return!this.inert}render(){const{content:n}=this.state;return this.shadowRoot?N`
|
|
175
175
|
<style>
|
|
176
176
|
:host,
|
|
177
177
|
:not(:defined) {
|
|
@@ -179,7 +179,7 @@ var oi=Object.defineProperty,ai=Object.defineProperties;var ci=Object.getOwnProp
|
|
|
179
179
|
}
|
|
180
180
|
</style>
|
|
181
181
|
${n!=null?n:N`<slot></slot>`}
|
|
182
|
-
`:N`${n}`}},We=new WeakMap,rt=new WeakMap,ot=new WeakMap,o.GemRouteElement.createLocationStore=()=>{const{path:n,query:e,data:t}=E.getParams();return z({path:n,query:e,data:t,params:{}})},o.GemRouteElement.findRoute=(n=[],e)=>{let t=null,s;n instanceof Array?s=n:s=Object.values(n);for(const i of s)if(i.pattern==="*")t=i;else{const r=Kt(i.pattern,e);if(r)return{route:i,params:r}}return{route:t}},ce([
|
|
182
|
+
`:N`${n}`}},We=new WeakMap,rt=new WeakMap,ot=new WeakMap,o.GemRouteElement.createLocationStore=()=>{const{path:n,query:e,data:t}=E.getParams();return z({path:n,query:e,data:t,params:{}})},o.GemRouteElement.findRoute=(n=[],e)=>{let t=null,s;n instanceof Array?s=n:s=Object.values(n);for(const i of s)if(i.pattern==="*")t=i;else{const r=Kt(i.pattern,e);if(r)return{route:i,params:r}}return{route:t}},ce([q],o.GemRouteElement.prototype,"routes",2),ce([q],o.GemRouteElement.prototype,"locationStore",2),ce([q],o.GemRouteElement.prototype,"key",2),ce([He],o.GemRouteElement.prototype,"routechange",2),ce([He],o.GemRouteElement.prototype,"loading",2),ce([He],o.GemRouteElement.prototype,"error",2),o.GemRouteElement=ce([oe(E.store)],o.GemRouteElement);class ts extends o.GemRouteElement{constructor(e={}){super(qe(T({},e),{isLight:!0}))}}var As=Object.defineProperty,Gs=Object.getOwnPropertyDescriptor,L=(n,e,t,s)=>{for(var i=s>1?void 0:s?Gs(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&As(e,t,i),i};o.GemLinkElement=class extends A{constructor(){super();this.clickHandle=async n=>{var r;const e=this.getPathInfo();if(!e)return;if(this.isExternal(e))switch(this.target){case"_self":window.location.href=e;return;case"_parent":window.parent.location.href=e;return;case"_top":window.top.location.href=e;return;default:window.open(e);return}const{path:t,query:s,hash:i}=E.getParams();if(t+s+i!==e)if(n.stopPropagation(),await((r=this.prepare)==null?void 0:r.call(this)),this.route)E.pushIgnoreCloseHandle(qe(T({},es(this.route,this.options)),{title:this.route.title||this.docTitle}));else if(this.href){const{pathname:a,search:c,hash:l}=new URL(e,location.origin);E.pushIgnoreCloseHandle({path:a,query:c,hash:l,title:this.docTitle})}else E.pushIgnoreCloseHandle({path:this.path,query:this.query,hash:this.hash,title:this.docTitle})},this.preventDefault=n=>{n.preventDefault()},this.tabIndex=0,this.addEventListener("click",this.clickHandle)}getPathInfo(){var n,e;if(this.route){const t=((n=this.options)==null?void 0:n.query)||"",s=((e=this.options)==null?void 0:e.hash)||"";return zt(this.route,this.options)+t+s}else{const t=this.href||this.path+this.query+this.hash,{path:s,query:i}=E.getParams();return t.startsWith("#")?`${s}${i}${t}`:t.startsWith("?")?`${s}${t}`:t.startsWith(".")?Ue(s,t):t}}isExternal(n){return!n.startsWith("/")}render(n=this.getPathInfo()){return N`
|
|
183
183
|
<style>
|
|
184
184
|
:host {
|
|
185
185
|
/* link default style */
|
|
@@ -202,7 +202,7 @@ var oi=Object.defineProperty,ai=Object.defineProperties;var ci=Object.getOwnProp
|
|
|
202
202
|
>
|
|
203
203
|
<slot></slot>
|
|
204
204
|
</a>
|
|
205
|
-
`}},L([k],o.GemLinkElement.prototype,"href",2),L([k],o.GemLinkElement.prototype,"target",2),L([k],o.GemLinkElement.prototype,"path",2),L([k],o.GemLinkElement.prototype,"query",2),L([k],o.GemLinkElement.prototype,"hash",2),L([k],o.GemLinkElement.prototype,"docTitle",2),L([k],o.GemLinkElement.prototype,"hint",2),L([
|
|
205
|
+
`}},L([k],o.GemLinkElement.prototype,"href",2),L([k],o.GemLinkElement.prototype,"target",2),L([k],o.GemLinkElement.prototype,"path",2),L([k],o.GemLinkElement.prototype,"query",2),L([k],o.GemLinkElement.prototype,"hash",2),L([k],o.GemLinkElement.prototype,"docTitle",2),L([k],o.GemLinkElement.prototype,"hint",2),L([q],o.GemLinkElement.prototype,"route",2),L([q],o.GemLinkElement.prototype,"options",2),L([q],o.GemLinkElement.prototype,"prepare",2),L([Dt],o.GemLinkElement.prototype,"link",2),o.GemLinkElement=L([oe(Ut)],o.GemLinkElement),o.GemActiveLinkElement=class extends o.GemLinkElement{render(){const{path:n,query:e,hash:t}=E.getParams(),s=this.pattern&&Kt(this.pattern,n),i=this.getPathInfo();return s||n+e+t===i?this.active=!0:this.active=!1,super.render(i)}},L([k],o.GemActiveLinkElement.prototype,"pattern",2),L([Ge],o.GemActiveLinkElement.prototype,"active",2),o.GemActiveLinkElement=L([oe(E.store)],o.GemActiveLinkElement),customElements.define("gem-link",o.GemLinkElement),customElements.define("gem-active-link",o.GemActiveLinkElement),customElements.define("gem-route",o.GemRouteElement),customElements.define("gem-light-route",ts);var Hs=Object.defineProperty,Is=Object.getOwnPropertyDescriptor,ns=(n,e,t,s)=>{for(var i=s>1?void 0:s?Is(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&Hs(e,t,i),i};o.GemTitleElement=class extends A{static setTitle(n){P(ae,{title:n})}static updateTitle(n="",e=""){const{title:t}=ae;t&&t!==o.GemTitleElement.defaultTitle?(o.GemTitleElement.title=t,document.title=o.GemTitleElement.title+e):n?(o.GemTitleElement.title=n,document.title=o.GemTitleElement.title+e):(o.GemTitleElement.title=o.GemTitleElement.defaultTitle,document.title=o.GemTitleElement.title)}constructor(){super();new MutationObserver(()=>this.update()).observe(this,{childList:!0,characterData:!0,subtree:!0})}render(){return o.GemTitleElement.updateTitle(this.textContent||"",this.suffix),this.hidden?N``:N`${o.GemTitleElement.title}`}},o.GemTitleElement.title=document.title,o.GemTitleElement.defaultTitle=document.title,o.GemTitleElement.defaultSuffix=` - ${document.title}`,ns([k],o.GemTitleElement.prototype,"suffix",2),o.GemTitleElement=ns([oe(ae)],o.GemTitleElement),se(ae,o.GemTitleElement.updateTitle),customElements.define("gem-title",o.GemTitleElement);var Vs=Object.defineProperty,Ws=Object.getOwnPropertyDescriptor,at=(n,e,t,s)=>{for(var i=s>1?void 0:s?Ws(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&Vs(e,t,i),i};const ss=new Map;class we extends A{getContent(){const e=this.element||(this.selector?(this.root||document).querySelector(this.selector):null);if(typeof e=="string"){let t=ss.get(e);return t||(t=document.createElement("template"),t.innerHTML=e,ss.set(e,t)),t.content.cloneNode(!0)}else return e instanceof HTMLTemplateElement?e.content.cloneNode(!0):e==null?void 0:e.cloneNode(!0)}render(){return N`
|
|
206
206
|
<style>
|
|
207
207
|
:host {
|
|
208
208
|
position: relative;
|
|
@@ -218,7 +218,7 @@ var oi=Object.defineProperty,ai=Object.defineProperties;var ci=Object.getOwnProp
|
|
|
218
218
|
</style>
|
|
219
219
|
${this.getContent()}
|
|
220
220
|
<slot></slot>
|
|
221
|
-
`}}at([k],we.prototype,"selector",2),at([
|
|
221
|
+
`}}at([k],we.prototype,"selector",2),at([q],we.prototype,"root",2),at([q],we.prototype,"element",2),at([Ge],we.prototype,"active",2),customElements.define("gem-use",we);var js=Object.defineProperty,Ds=Object.getOwnPropertyDescriptor,is=(n,e,t,s)=>{for(var i=s>1?void 0:s?Ds(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&js(e,t,i),i};class ct extends A{constructor(){super();this.effect(()=>{this.shadowRoot&&(this.shadowRoot.innerHTML=`
|
|
222
222
|
<style>
|
|
223
223
|
:host {
|
|
224
224
|
display: contents;
|
|
@@ -226,4 +226,4 @@ var oi=Object.defineProperty,ai=Object.defineProperties;var ci=Object.getOwnProp
|
|
|
226
226
|
${this.contentcss}
|
|
227
227
|
</style>
|
|
228
228
|
${this.content}
|
|
229
|
-
`)},()=>[this.content,this.contentcss])}render(){}}is([k],ct.prototype,"content",2),is([k],ct.prototype,"contentcss",2),customElements.define("gem-unsafe",ct);var js=Object.defineProperty,Ds=Object.getOwnPropertyDescriptor,xs=(n,e,t,s)=>{for(var i=s>1?void 0:s?Ds(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&js(e,t,i),i};document.querySelectorAll("[data-reflect]").forEach(n=>n.remove());class Ft extends A{constructor(){super({isLight:!0});this.target=document.head,this.hidden=!0,this.dataset.gemreflect="",this.effect(()=>{const e=[...this.childNodes];return e.forEach(t=>{t instanceof HTMLElement&&(t.dataset.reflect=""),this.target.append(t)}),()=>{e.forEach(t=>t.remove())}},()=>[this.target])}}xs([x],Ft.prototype,"target",2),customElements.define("gem-reflect",Ft);const lt=Symbol("open mark");function qs(n){var e;return e=class extends A{constructor(){super();this.label="",this.internals.role="alertdialog",this.internals.ariaModal="true"}static get isOpen(){return this.store[lt]}static get observedStores(){return[E.store,this.store]}static open(t){const s=new this;this.instance=s,this.inertStore=[...document.body.children].filter(r=>!r.inert),this.inertStore.forEach(r=>r.inert=!0),document.body.append(s);const i=()=>P(this.store,C({[lt]:!0},t));setTimeout(()=>{i(),E.push({title:s.label,open:i,close:this.closeHandle.bind(this),shouldClose:this.shouldClose.bind(this)})},100)}static close(){E.back()}static closeHandle(){var t;this.inertStore.forEach(s=>s.inert=!1),(t=this.instance)==null||t.remove(),P(this.store,C({[lt]:!1},n))}static shouldClose(){return!0}},e.inertStore=[],e.instance=null,e.store=z(C({[lt]:!1},n)),e}var Us=Object.defineProperty,Bs=Object.getOwnPropertyDescriptor,Jt=(n,e,t,s)=>{for(var i=s>1?void 0:s?Bs(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&Us(e,t,i),i};o.GemDialogBaseElement=(hs=class extends A{constructor(){super();M(this,_e,void 0);M(this,ve,void 0);M(this,he,void 0);this.inert=!0,G(this,he,[]),this.closeHandle=()=>{var n;this.inert=!0,g(this,he).forEach(e=>e.inert=!1),g(this,_e)?g(this,_e).before(this):g(this,ve)&&((n=g(this,ve))==null||n.appendChild(this)),this.dispatchEvent(new CustomEvent("close")),this.opened=!1},this.openHandle=()=>{this.hidden=!1,this.inert=!1,G(this,_e,this.nextSibling),G(this,ve,this.parentElement||this.getRootNode()),G(this,he,[...document.body.children].filter(n=>!n.inert)),g(this,he).forEach(n=>n.inert=!0),document.body.append(this),this.dispatchEvent(new CustomEvent("open")),this.opened=!0},this.open=()=>{this.opened||(this.openHandle(),E.push({title:this.label,open:this.openHandle,close:this.closeHandle,shouldClose:this.shouldClose}))},this.close=()=>{E.back()},this.forceClose=()=>{this.opened=!1,setTimeout(this.close,100)},this.internals.role="dialog",this.internals.ariaModal="true"}shouldClose(){return!0}},_e=new WeakMap,ve=new WeakMap,he=new WeakMap,hs),Jt([k],o.GemDialogBaseElement.prototype,"label",2),Jt([Ge],o.GemDialogBaseElement.prototype,"opened",2),o.GemDialogBaseElement=Jt([oe(E.store)],o.GemDialogBaseElement);const Qt=new WeakMap;function rs(n){return Qt.get(n)}const Yt=new WeakMap;function Ks(n){return Yt.get(n)}function zs(n,e){const t=Qt.get(e),s=Yt.get(e),i=Object.keys(t).reduce((r,a)=>t[a]?r+`${s[a]}:${t[a]};`:r,"");n.textContent=`:root, :host {${i}}`}function Fs(n){const e=Me(),t=document.createElement("style"),s=z(n),i={},r={};Yt.set(i,r),Qt.set(i,s),Object.keys(s).forEach(c=>{r[c]=`--${I(c)}-${e}`,i[c]=`var(${r[c]})`});const a=()=>zs(t,i);return se(s,a),a(),(document.head||document.documentElement).append(t),i}function Js(n,e){const t=rs(n);P(t,e)}const Qs=/\$\d(?:<[^>]*>)?/,Ys=/\$(\d)(<([^>]*)>)?/g,Zs=3;function os(n,...e){const t=n.split(Qs),s=[];let i;for(;i=Ys.exec(n);){const r=i[Zs],a=Number(i[1])-1,c=e[a];s.push(typeof c=="function"?c(r):c)}return N(t,...s)}const je=new Set,Zt=class{constructor(e){M(this,be);M(this,ut);M(this,dt);M(this,ue);M(this,Pe);if(this.cachePrefix="gem-i18n",!e.resources[e.fallbackLanguage])throw new K("i18n: fallbackLanguage invalid");this.store=z(this),Object.assign(this,e);let t=g(this,ut,ui)||this.currentLanguage||g(this,dt,di);const s=document.querySelector(`[type*=${this.cachePrefix}]`);if(s)try{const i=JSON.parse(s.textContent||"");t=i.currentLanguage,this.resources[i.currentLanguage]=i.currentLanguagePack}catch{}t?(G(this,Pe,t,nn),this.setLanguage(t)):this.resetLanguage()}get(e,...t){const s=this.resources[this.currentLanguage],i=this.resources[this.fallbackLanguage],r=s[e]||i[e],a=(r==null?void 0:r.message)||r||`[${e}]`;return t.length?os(a,...t):a}detectLanguage(){const e=Object.keys(this.resources),t=navigator.languages.map(s=>s.replace(/-(.*)/,i=>i.toUpperCase()));for(const s of t){const i=e.find(r=>r===s||s.startsWith(`${r}-`));if(i)return i}return this.fallbackLanguage}async setLanguage(e){g(this,ue,mt)&&je.forEach(async i=>await i.setLanguage(e));let t;const s=this.resources[e];if(!s)return console.warn(`${this.cachePrefix}: not found \`${e}\``),this.resetLanguage();if(typeof s=="string"){const i=`${this.cachePrefix}:`,r=`${i}${s}`,a=localStorage.getItem(r),c=async()=>{const l=await(await fetch(s)).json();if(this.cache){for(let h=0;h<localStorage.length;h++){const m=localStorage.key(h);m.startsWith(i)&&localStorage.removeItem(m)}localStorage.setItem(r,JSON.stringify(l))}return l};if(a)try{t=JSON.parse(a)}catch{t=await c()}else t=await c()}else t=s;return this.resources[e]=t,P(this.store,{}),e!==this.currentLanguage&&G(this,Pe,e,nn),this.cache===!0&&this.setCache(),e}resetLanguage(){return g(this,ue,mt)&&je.forEach(e=>e.resetLanguage()),G(this,Pe,this.fallbackLanguage,nn),this.cache&&localStorage.removeItem(g(this,be,tn)),this.setLanguage(this.detectLanguage())}setCache(){g(this,ue,mt)&&je.forEach(e=>e.setCache()),localStorage.setItem(g(this,be,tn),this.currentLanguage)}createSubModule(e,t){const s=new Zt({resources:t,cachePrefix:`${this.cachePrefix}-${e}`,currentLanguage:this.currentLanguage,fallbackLanguage:this.fallbackLanguage,cache:this.cache});return je.add(s),s}toJSON(){return{currentLanguage:this.currentLanguage,currentLanguagePack:this.resources[this.currentLanguage]}}};let as=Zt;be=new WeakSet,tn=function(){return`${this.cachePrefix}:current`},ut=new WeakSet,ui=function(){const{hostname:e,pathname:t,search:s}=location,i=e.split(".");switch(this.urlParamsType){case"ccTLD":return i.pop();case"gTLD":return i.shift();case"path":return t.split("/")[1];default:const r=this.urlParamsName&&new URLSearchParams(s).get(this.urlParamsName)||"";return r in this.resources?r:""}},dt=new WeakSet,di=function(){return this.cache&&localStorage.getItem(g(this,be,tn))||""},ue=new WeakSet,mt=function(){return!je.has(this)},Pe=new WeakSet,nn=function(e){var t;g(this,ue,mt)&&(document.documentElement.lang=e),this.currentLanguage=e,(t=this.onChange)==null||t.call(this,e)};const Xs={credentials:"include",mode:"cors"};async function De(n,e={}){const t=await fetch(n,C(C({},Xs),e));if(t.status===0)throw new Error("Request fail");if(t.status>=500)throw new Error(t.statusText);if(t.status>=400)throw new Error(await t.text()||t.statusText);return await t.json()}const ei=Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)).constructor;function cs(n){return n instanceof FormData||n instanceof Blob||n instanceof ei||n instanceof URLSearchParams||n instanceof ReadableStream||n instanceof ArrayBuffer?n:typeof n=="object"?JSON.stringify(n):n}function ti(n,e){const{origin:t,pathname:s,search:i}=new URL(n,location.origin),r=new URLSearchParams(e).toString();return De(`${t}${s}${i?`${i}&`:r?"?":""}${r}`,{method:"GET"})}function ni(n){return De(n,{method:"DELETE"})}function si(n,e){return De(n,{method:"PUT",body:cs(e)})}function ii(n,e){return De(n,{method:"POST",body:cs(e)})}const R=n=>window.matchMedia(n).matches,ri={PRINT:"print",get isPrint(){return R(this.PRINT)},HOVER:"(hover: hover)",get isHover(){return R(this.HOVER)},PHONE:"(min-width: 319px) and (max-width: 480px)",get isPhone(){return R(this.PHONE)},LAPTOP:"(min-width: 1023px) and (max-width: 1280px) and (orientation: landscape)",get isLaptop(){return R(this.LAPTOP)},DESKTOP:"(min-width: 1279px) and (orientation: landscape)",get isDesktop(){return R(this.DESKTOP)},WIDTHSCREEN:"(min-width: 1919px) and (orientation: landscape)",get isWidthScreen(){return R(this.WIDTHSCREEN)},PHONE_LANDSCAPE:"(min-width: 479px) and (max-width: 767px) and (orientation: landscape)",get isPhoneLandscape(){return R(this.PHONE_LANDSCAPE)},TABLET:"(min-width: 768px) and (max-width: 1024px)",get isTablet(){return R(this.TABLET)},SMALL_PHONE:"(min-width: 319px) and (max-width: 480px) and (max-height: 640px)",get isSmallPhone(){return R(this.SMALL_PHONE)},WATCH:"(max-width: 319px)",get isWatch(){return R(this.WATCH)},SHORT:"(min-width: 479px) and (max-height: 320px)",get isShort(){return R(this.SHORT)},PWA:"(display-mode: standalone)",get isPWA(){return R(this.PWA)},MOTION_REDUCE:"(prefers-reduced-motion: reduce)",get isMotionReduce(){return R(this.MOTION_REDUCE)},DATA_REDUCE:"(prefers-reduced-data: reduce)",get isDataReduce(){return R(this.DATA_REDUCE)}},ls="1.6.15";window.__GEM_DEVTOOLS__HOOK__&&Object.assign(window.__GEM_DEVTOOLS__HOOK__,C({},f)),o.GemElement=A,o.GemError=K,o.GemLightRouteElement=ts,o.GemReflectElement=Ft,o.GemUnsafeElement=ct,o.GemUseElement=we,o.I18n=as,o.LinkedList=_t,o.PropProxyMap=vt,o.QueryString=fe,o.SVGTemplateResult=yt,o.SheetToken=Be,o.StoreListenerMap=ne,o.TemplateResult=ke,o.absoluteLocation=Ue,o.addMicrotask=H,o.addMicrotaskToStack=wn,o.adoptedStyle=xn,o.attribute=k,o.basePathStore=Ut,o.boolattribute=In,o.camelToKebabCase=I,o.classMap=Ct,o.cleanObject=Ne,o.connect=se,o.connectStore=oe,o.createCSSSheet=En,o.createHistoryParams=es,o.createModalClass=qs,o.createPath=zt,o.createStore=z,o.createStoreSet=Cn,o.createTheme=Fs,o.css=Sn,o.customElement=Un,o.defineAttribute=et,o.defineCSSState=nt,o.defineProperty=ye,o.defineRef=tt,o.del=ni,o.directive=J,o.disconnect=kt,o.emitter=He,o.exportPartsMap=Tn,o.get=ti,o.getThemeProp=Ks,o.getThemeStore=rs,o.globalemitter=jn,o.guard=On,o.history=E,o.html=N,o.ifDefined=Ot,o.isArrayChange=Pt,o.kebabToCamelCase=pe,o.matchPath=Kt,o.mediaQuery=ri,o.nativeDefineElement=st,o.numattribute=Vn,o.objectMapToString=Oe,o.part=Dt,o.partMap=Pn,o.post=ii,o.property=x,o.put=si,o.randomStr=Me,o.raw=me,o.refobject=Hn,o.removeItems=Tt,o.render=qe,o.repeat=Nn,o.request=De,o.rootElement=qn,o.slot=Wn,o.splice=os,o.state=Ge,o.styleMap=bn,o.styled=vn,o.svg=yn,o.titleStore=ae,o.updateStore=P,o.updateTheme=Js,o.version=ls,Object.defineProperty(o,"__esModule",{value:!0}),o[Symbol.toStringTag]="Module"});
|
|
229
|
+
`)},()=>[this.content,this.contentcss])}render(){}}is([k],ct.prototype,"content",2),is([k],ct.prototype,"contentcss",2),customElements.define("gem-unsafe",ct);var qs=Object.defineProperty,xs=Object.getOwnPropertyDescriptor,Us=(n,e,t,s)=>{for(var i=s>1?void 0:s?xs(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&qs(e,t,i),i};document.querySelectorAll("[data-reflect]").forEach(n=>n.remove());class Ft extends A{constructor(){super({isLight:!0});this.target=document.head,this.hidden=!0,this.dataset.gemreflect="",this.effect(()=>{const e=[...this.childNodes];return e.forEach(t=>{t instanceof HTMLElement&&(t.dataset.reflect=""),this.target.append(t)}),()=>{e.forEach(t=>t.remove())}},()=>[this.target])}}Us([q],Ft.prototype,"target",2),customElements.define("gem-reflect",Ft);const lt=Symbol("open mark");function Bs(n){var e;return e=class extends A{constructor(){super();this.label="",this.internals.role="alertdialog",this.internals.ariaModal="true"}static get isOpen(){return this.store[lt]}static get observedStores(){return[E.store,this.store]}static open(t){const s=new this;this.instance=s,this.inertStore=[...document.body.children].filter(r=>!r.inert),this.inertStore.forEach(r=>r.inert=!0),document.body.append(s);const i=()=>P(this.store,T({[lt]:!0},t));setTimeout(()=>{i(),E.push({title:s.label,open:i,close:this.closeHandle.bind(this),shouldClose:this.shouldClose.bind(this)})},100)}static close(){E.back()}static closeHandle(){var t;this.inertStore.forEach(s=>s.inert=!1),(t=this.instance)==null||t.remove(),P(this.store,T({[lt]:!1},n))}static shouldClose(){return!0}},e.inertStore=[],e.instance=null,e.store=z(T({[lt]:!1},n)),e}var Ks=Object.defineProperty,zs=Object.getOwnPropertyDescriptor,Jt=(n,e,t,s)=>{for(var i=s>1?void 0:s?zs(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&Ks(e,t,i),i};o.GemDialogBaseElement=(ds=class extends A{constructor(){super();M(this,_e,void 0);M(this,ve,void 0);M(this,he,void 0);this.inert=!0,G(this,he,[]),this.closeHandle=()=>{var n;this.inert=!0,g(this,he).forEach(e=>e.inert=!1),g(this,_e)?g(this,_e).before(this):g(this,ve)&&((n=g(this,ve))==null||n.appendChild(this)),this.dispatchEvent(new CustomEvent("close")),this.opened=!1},this.openHandle=()=>{this.hidden=!1,this.inert=!1,G(this,_e,this.nextSibling),G(this,ve,this.parentElement||this.getRootNode()),G(this,he,[...document.body.children].filter(n=>!n.inert)),g(this,he).forEach(n=>n.inert=!0),document.body.append(this),this.dispatchEvent(new CustomEvent("open")),this.opened=!0},this.open=()=>{this.opened||(this.openHandle(),E.push({title:this.label,open:this.openHandle,close:this.closeHandle,shouldClose:this.shouldClose}))},this.close=()=>{E.back()},this.forceClose=()=>{this.opened=!1,setTimeout(this.close,100)},this.internals.role="dialog",this.internals.ariaModal="true"}shouldClose(){return!0}},_e=new WeakMap,ve=new WeakMap,he=new WeakMap,ds),Jt([k],o.GemDialogBaseElement.prototype,"label",2),Jt([Ge],o.GemDialogBaseElement.prototype,"opened",2),o.GemDialogBaseElement=Jt([oe(E.store)],o.GemDialogBaseElement);const Qt=new WeakMap;function rs(n){return Qt.get(n)}const Yt=new WeakMap;function Fs(n){return Yt.get(n)}function Js(n,e){const t=Qt.get(e),s=Yt.get(e),i=Object.keys(t).reduce((r,a)=>t[a]?r+`${s[a]}:${t[a]};`:r,"");n.textContent=`:root, :host {${i}}`}function Qs(n){const e=Me(),t=document.createElement("style"),s=z(n),i={},r={};Yt.set(i,r),Qt.set(i,s),Object.keys(s).forEach(c=>{r[c]=`--${I(c)}-${e}`,i[c]=`var(${r[c]})`});const a=()=>Js(t,i);return se(s,a),a(),(document.head||document.documentElement).append(t),i}function Ys(n,e){const t=rs(n);P(t,e)}const Zs=/\$\d(?:<[^>]*>)?/,Xs=/\$(\d)(<([^>]*)>)?/g,ei=3;function os(n,...e){const t=n.split(Zs),s=[];let i;for(;i=Xs.exec(n);){const r=i[ei],a=Number(i[1])-1,c=e[a];s.push(typeof c=="function"?c(r):c)}return N(t,...s)}const je=new Set,Zt=class{constructor(e){M(this,be);M(this,ut);M(this,dt);M(this,ue);M(this,Pe);if(this.cachePrefix="gem-i18n",!e.resources[e.fallbackLanguage])throw new K("i18n: fallbackLanguage invalid");this.store=z(this),Object.assign(this,e);let t=g(this,ut,di)||this.currentLanguage||g(this,dt,fi);const s=document.querySelector(`[type*=${this.cachePrefix}]`);if(s)try{const i=JSON.parse(s.textContent||"");t=i.currentLanguage,this.resources[i.currentLanguage]=i.currentLanguagePack}catch{}t?(G(this,Pe,t,nn),this.setLanguage(t)):this.resetLanguage()}get(e,...t){const s=this.resources[this.currentLanguage],i=this.resources[this.fallbackLanguage],r=s[e]||i[e],a=(r==null?void 0:r.message)||r||`[${e}]`;return t.length?os(a,...t):a}detectLanguage(){const e=Object.keys(this.resources),t=navigator.languages.map(s=>s.replace(/-(.*)/,i=>i.toUpperCase()));for(const s of t){const i=e.find(r=>r===s||s.startsWith(`${r}-`));if(i)return i}return this.fallbackLanguage}async setLanguage(e){g(this,ue,mt)&&je.forEach(async i=>await i.setLanguage(e));let t;const s=this.resources[e];if(!s)return console.warn(`${this.cachePrefix}: not found \`${e}\``),this.resetLanguage();if(typeof s=="string"){const i=`${this.cachePrefix}:`,r=`${i}${s}`,a=localStorage.getItem(r),c=async()=>{const l=await(await fetch(s)).json();if(this.cache){for(let h=0;h<localStorage.length;h++){const m=localStorage.key(h);m.startsWith(i)&&localStorage.removeItem(m)}localStorage.setItem(r,JSON.stringify(l))}return l};if(a)try{t=JSON.parse(a)}catch{t=await c()}else t=await c()}else t=s;return this.resources[e]=t,P(this.store,{}),e!==this.currentLanguage&&G(this,Pe,e,nn),this.cache===!0&&this.setCache(),e}resetLanguage(){return g(this,ue,mt)&&je.forEach(e=>e.resetLanguage()),G(this,Pe,this.fallbackLanguage,nn),this.cache&&localStorage.removeItem(g(this,be,tn)),this.setLanguage(this.detectLanguage())}setCache(){g(this,ue,mt)&&je.forEach(e=>e.setCache()),localStorage.setItem(g(this,be,tn),this.currentLanguage)}createSubModule(e,t){const s=new Zt({resources:t,cachePrefix:`${this.cachePrefix}-${e}`,currentLanguage:this.currentLanguage,fallbackLanguage:this.fallbackLanguage,cache:this.cache});return je.add(s),s}toJSON(){return{currentLanguage:this.currentLanguage,currentLanguagePack:this.resources[this.currentLanguage]}}};let as=Zt;be=new WeakSet,tn=function(){return`${this.cachePrefix}:current`},ut=new WeakSet,di=function(){const{hostname:e,pathname:t,search:s}=location,i=e.split(".");switch(this.urlParamsType){case"ccTLD":return i.pop();case"gTLD":return i.shift();case"path":return t.split("/")[1];default:const r=this.urlParamsName&&new URLSearchParams(s).get(this.urlParamsName)||"";return r in this.resources?r:""}},dt=new WeakSet,fi=function(){return this.cache&&localStorage.getItem(g(this,be,tn))||""},ue=new WeakSet,mt=function(){return!je.has(this)},Pe=new WeakSet,nn=function(e){var t;g(this,ue,mt)&&(document.documentElement.lang=e),this.currentLanguage=e,(t=this.onChange)==null||t.call(this,e)};const cs={headers:{"Content-Type":"application/json"}};async function De(n,e={}){const t=await fetch(n,T(T({},cs),e));if(t.status===0)throw new Error("Request fail");if(t.status>=500)throw new Error(t.statusText);try{const s=await t.json();if(t.status>=400)throw new Error((s==null?void 0:s.message)||t.statusText,{cause:s});return s}catch{throw new Error("Server error")}}const ti=Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)).constructor;function ls(n){return n instanceof FormData||n instanceof Blob||n instanceof ti||n instanceof URLSearchParams||n instanceof ReadableStream||n instanceof ArrayBuffer?n:typeof n=="object"?JSON.stringify(n):n}function hs(n,e){const{origin:t,pathname:s,search:i}=new URL(n,location.origin),r=new URLSearchParams(e).toString();return`${t}${s}${i?`${i}&`:r?"?":""}${r}`}function ni(n,e){return De(hs(n,e),{method:"GET"})}function si(n,e){return De(hs(n,e),{method:"DELETE"})}function ii(n,e){return De(n,{method:"PUT",body:ls(e)})}function ri(n,e){return De(n,{method:"POST",body:ls(e)})}const R=n=>window.matchMedia(n).matches,oi={PRINT:"print",get isPrint(){return R(this.PRINT)},HOVER:"(hover: hover)",get isHover(){return R(this.HOVER)},PHONE:"(min-width: 319px) and (max-width: 480px)",get isPhone(){return R(this.PHONE)},LAPTOP:"(min-width: 1023px) and (max-width: 1280px) and (orientation: landscape)",get isLaptop(){return R(this.LAPTOP)},DESKTOP:"(min-width: 1279px) and (orientation: landscape)",get isDesktop(){return R(this.DESKTOP)},WIDTHSCREEN:"(min-width: 1919px) and (orientation: landscape)",get isWidthScreen(){return R(this.WIDTHSCREEN)},PHONE_LANDSCAPE:"(min-width: 479px) and (max-width: 767px) and (orientation: landscape)",get isPhoneLandscape(){return R(this.PHONE_LANDSCAPE)},TABLET:"(min-width: 768px) and (max-width: 1024px)",get isTablet(){return R(this.TABLET)},SMALL_PHONE:"(min-width: 319px) and (max-width: 480px) and (max-height: 640px)",get isSmallPhone(){return R(this.SMALL_PHONE)},WATCH:"(max-width: 319px)",get isWatch(){return R(this.WATCH)},SHORT:"(min-width: 479px) and (max-height: 320px)",get isShort(){return R(this.SHORT)},PWA:"(display-mode: standalone)",get isPWA(){return R(this.PWA)},MOTION_REDUCE:"(prefers-reduced-motion: reduce)",get isMotionReduce(){return R(this.MOTION_REDUCE)},DATA_REDUCE:"(prefers-reduced-data: reduce)",get isDataReduce(){return R(this.DATA_REDUCE)}},us="1.6.16";window.__GEM_DEVTOOLS__HOOK__&&Object.assign(window.__GEM_DEVTOOLS__HOOK__,T({},f)),o.GemElement=A,o.GemError=K,o.GemLightRouteElement=ts,o.GemReflectElement=Ft,o.GemUnsafeElement=ct,o.GemUseElement=we,o.I18n=as,o.LinkedList=_t,o.PropProxyMap=vt,o.QueryString=fe,o.SVGTemplateResult=yt,o.SheetToken=Be,o.StoreListenerMap=ne,o.TemplateResult=ke,o.absoluteLocation=Ue,o.addMicrotask=H,o.addMicrotaskToStack=wn,o.adoptedStyle=qn,o.attribute=k,o.basePathStore=Ut,o.boolattribute=In,o.camelToKebabCase=I,o.classMap=Tt,o.cleanObject=Ne,o.connect=se,o.connectStore=oe,o.createCSSSheet=En,o.createHistoryParams=es,o.createModalClass=Bs,o.createPath=zt,o.createStore=z,o.createStoreSet=Tn,o.createTheme=Qs,o.css=Sn,o.customElement=Un,o.defaultReqInit=cs,o.defineAttribute=et,o.defineCSSState=nt,o.defineProperty=ye,o.defineRef=tt,o.del=si,o.directive=J,o.disconnect=kt,o.emitter=He,o.exportPartsMap=Cn,o.get=ni,o.getThemeProp=Fs,o.getThemeStore=rs,o.globalemitter=jn,o.guard=On,o.history=E,o.html=N,o.ifDefined=Ot,o.isArrayChange=Pt,o.kebabToCamelCase=pe,o.matchPath=Kt,o.mediaQuery=oi,o.nativeDefineElement=st,o.numattribute=Vn,o.objectMapToString=Oe,o.part=Dt,o.partMap=Pn,o.post=ri,o.property=q,o.put=ii,o.randomStr=Me,o.raw=me,o.refobject=Hn,o.removeItems=Ct,o.render=xe,o.repeat=Nn,o.request=De,o.rootElement=xn,o.slot=Wn,o.splice=os,o.state=Ge,o.styleMap=bn,o.styled=vn,o.svg=yn,o.titleStore=ae,o.updateStore=P,o.updateTheme=Ys,o.version=us,Object.defineProperty(o,"__esModule",{value:!0}),o[Symbol.toStringTag]="Module"});
|
package/helper/request.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
export declare const defaultReqInit: RequestInit;
|
|
1
2
|
export declare function request<T>(uri: string, options?: RequestInit): Promise<T>;
|
|
2
3
|
declare type ReqBody = Record<string, unknown> | BodyInit;
|
|
3
4
|
export declare function get<T>(url: string, params?: Record<string, string | number>): Promise<T>;
|
|
4
|
-
export declare function del<T>(url: string): Promise<T>;
|
|
5
|
+
export declare function del<T>(url: string, params?: Record<string, string | number>): Promise<T>;
|
|
5
6
|
export declare function put<T>(url: string, body?: ReqBody): Promise<T>;
|
|
6
7
|
export declare function post<T>(url: string, body?: ReqBody): Promise<T>;
|
|
7
8
|
export {};
|
package/helper/request.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../src/helper/request.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../src/helper/request.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,EAAE,WAI5B,CAAC;AAEF,wBAAsB,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,CAAC,CAAC,CAcnF;AAED,aAAK,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC;AA0BlD,wBAAgB,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,cAE3E;AACD,wBAAgB,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,cAE3E;AACD,wBAAgB,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,cAEjD;AACD,wBAAgB,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,cAElD"}
|
package/helper/request.js
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export const defaultReqInit = {
|
|
2
|
+
headers: {
|
|
3
|
+
'Content-Type': 'application/json',
|
|
4
|
+
},
|
|
5
5
|
};
|
|
6
6
|
export async function request(uri, options = {}) {
|
|
7
7
|
const res = await fetch(uri, {
|
|
8
|
-
...
|
|
8
|
+
...defaultReqInit,
|
|
9
9
|
...options,
|
|
10
10
|
});
|
|
11
11
|
if (res.status === 0)
|
|
12
12
|
throw new Error('Request fail');
|
|
13
13
|
if (res.status >= 500)
|
|
14
14
|
throw new Error(res.statusText);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
try {
|
|
16
|
+
const data = await res.json();
|
|
17
|
+
if (res.status >= 400)
|
|
18
|
+
throw new Error((data === null || data === void 0 ? void 0 : data.message) || res.statusText, { cause: data });
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
catch (_a) {
|
|
22
|
+
throw new Error('Server error');
|
|
23
|
+
}
|
|
18
24
|
}
|
|
19
25
|
const TypedArray = Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array())).constructor;
|
|
20
26
|
function serializationBody(body) {
|
|
@@ -31,15 +37,16 @@ function serializationBody(body) {
|
|
|
31
37
|
}
|
|
32
38
|
return body;
|
|
33
39
|
}
|
|
34
|
-
|
|
40
|
+
function serializationUrl(url, params) {
|
|
35
41
|
const { origin, pathname, search } = new URL(url, location.origin);
|
|
36
42
|
const query = new URLSearchParams(params).toString();
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
return `${origin}${pathname}${search ? `${search}&` : query ? '?' : ''}${query}`;
|
|
44
|
+
}
|
|
45
|
+
export function get(url, params) {
|
|
46
|
+
return request(serializationUrl(url, params), { method: 'GET' });
|
|
40
47
|
}
|
|
41
|
-
export function del(url) {
|
|
42
|
-
return request(url, { method: 'DELETE' });
|
|
48
|
+
export function del(url, params) {
|
|
49
|
+
return request(serializationUrl(url, params), { method: 'DELETE' });
|
|
43
50
|
}
|
|
44
51
|
export function put(url, body) {
|
|
45
52
|
return request(url, { method: 'PUT', body: serializationBody(body) });
|
package/helper/request.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sourceRoot":"","sources":["../src/helper/request.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../src/helper/request.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAgB;IACzC,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;KACnC;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,OAAO,CAAI,GAAW,EAAE,UAAuB,EAAE;IACrE,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QAC3B,GAAG,cAAc;QACjB,GAAG,OAAO;KACX,CAAC,CAAC;IACH,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;IACtD,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACvD,IAAI;QACF,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG;YAAE,MAAM,IAAK,KAAa,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,KAAI,GAAG,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAA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,MAAM,EAAE,mBAAmB;IAGhC,OAAO,CAAC,MAAM,EAAE,mBAAmB;IAGnC,qBAAqB,CAAC,MAAM,EAAE,mBAAmB;IAQjD,OAAO;IAGP,IAAI;CAGL;AAOD,QAAA,MAAM,WAAW;;;;;;;;CAAsF,CAAC;AAExG,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,WAAW,CAAC,EAAE,OAAO,WAAW,CAAC;KAClC;CACF;AA0HD,QAAA,MAAQ,OAAO,cAAE,UAAU;;IAAE,aAAa;;EAAuB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC"}
|
package/lib/history.js
CHANGED
|
@@ -13,7 +13,8 @@ const store = createStore({
|
|
|
13
13
|
});
|
|
14
14
|
// TODO: WeakRef
|
|
15
15
|
const paramsMap = new Map();
|
|
16
|
-
function validData(
|
|
16
|
+
function validData(data) {
|
|
17
|
+
const { $key, $hasCloseHandle, $hasOpenHandle, $hasShouldCloseHandle } = data || {};
|
|
17
18
|
if (store.$key === $key)
|
|
18
19
|
return;
|
|
19
20
|
if ($key)
|
package/lib/history.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.js","sourceRoot":"","sources":["../src/lib/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE/E,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC;AACrC,MAAM,eAAe,GAAmC,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AACpG,MAAM,kBAAkB,GAAsC,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAE7G,IAAI,GAAG,GAAG,CAAC,CAAC;AACZ,MAAM,MAA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
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "1.6.
|
|
1
|
+
export declare const version = "1.6.16";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/lib/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '1.6.
|
|
1
|
+
export const version = '1.6.16';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
package/src/helper/request.ts
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export const defaultReqInit: RequestInit = {
|
|
2
|
+
headers: {
|
|
3
|
+
'Content-Type': 'application/json',
|
|
4
|
+
},
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
export async function request<T>(uri: string, options: RequestInit = {}): Promise<T> {
|
|
8
8
|
const res = await fetch(uri, {
|
|
9
|
-
...
|
|
9
|
+
...defaultReqInit,
|
|
10
10
|
...options,
|
|
11
11
|
});
|
|
12
12
|
if (res.status === 0) throw new Error('Request fail');
|
|
13
13
|
if (res.status >= 500) throw new Error(res.statusText);
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
try {
|
|
15
|
+
const data = await res.json();
|
|
16
|
+
if (res.status >= 400) throw new (Error as any)(data?.message || res.statusText, { cause: data });
|
|
17
|
+
return data;
|
|
18
|
+
} catch {
|
|
19
|
+
throw new Error('Server error');
|
|
20
|
+
}
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
type ReqBody = Record<string, unknown> | BodyInit;
|
|
@@ -35,15 +40,17 @@ function serializationBody(body?: ReqBody): BodyInit | undefined {
|
|
|
35
40
|
return body;
|
|
36
41
|
}
|
|
37
42
|
|
|
38
|
-
|
|
43
|
+
function serializationUrl(url: string, params?: Record<string, string | number>) {
|
|
39
44
|
const { origin, pathname, search } = new URL(url, location.origin);
|
|
40
45
|
const query = new URLSearchParams(params as Record<string, string>).toString();
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
return `${origin}${pathname}${search ? `${search}&` : query ? '?' : ''}${query}`;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function get<T>(url: string, params?: Record<string, string | number>) {
|
|
50
|
+
return request<T>(serializationUrl(url, params), { method: 'GET' });
|
|
44
51
|
}
|
|
45
|
-
export function del<T>(url: string) {
|
|
46
|
-
return request<T>(url, { method: 'DELETE' });
|
|
52
|
+
export function del<T>(url: string, params?: Record<string, string | number>) {
|
|
53
|
+
return request<T>(serializationUrl(url, params), { method: 'DELETE' });
|
|
47
54
|
}
|
|
48
55
|
export function put<T>(url: string, body?: ReqBody) {
|
|
49
56
|
return request<T>(url, { method: 'PUT', body: serializationBody(body) });
|
package/src/lib/history.ts
CHANGED
|
@@ -41,7 +41,8 @@ type HistoryParams = UpdateHistoryParams & { title: string; path: string; query:
|
|
|
41
41
|
// TODO: WeakRef
|
|
42
42
|
const paramsMap = new Map<string, HistoryParams>();
|
|
43
43
|
|
|
44
|
-
function validData(
|
|
44
|
+
function validData(data: any) {
|
|
45
|
+
const { $key, $hasCloseHandle, $hasOpenHandle, $hasShouldCloseHandle } = data || {};
|
|
45
46
|
if (store.$key === $key) return;
|
|
46
47
|
if ($key) throw new GemError('`$key` is not allowed');
|
|
47
48
|
if ($hasCloseHandle) throw new GemError('`$hasCloseHandle` is not allowed');
|
package/src/lib/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.6.
|
|
1
|
+
export const version = '1.6.16';
|