@mantou/gem 2.3.2 → 2.3.3
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.js +11 -11
- package/dist/gem.mjs +11 -11
- package/elements/base/link.d.ts +2 -1
- package/elements/base/link.d.ts.map +1 -1
- package/elements/base/link.js +1 -2
- package/elements/base/link.js.map +1 -1
- package/elements/base/route.d.ts +4 -21
- package/elements/base/route.d.ts.map +1 -1
- package/elements/base/route.js +2 -83
- package/elements/base/route.js.map +1 -1
- package/lib/element.d.ts +13 -5
- package/lib/element.d.ts.map +1 -1
- package/lib/element.js +8 -11
- package/lib/element.js.map +1 -1
- package/lib/history.d.ts +24 -0
- package/lib/history.d.ts.map +1 -1
- package/lib/history.js +82 -0
- package/lib/history.js.map +1 -1
- package/lib/keyed.d.ts +10 -0
- package/lib/keyed.d.ts.map +1 -0
- package/lib/keyed.js +26 -0
- package/lib/keyed.js.map +1 -0
- package/lib/lit-html.d.ts.map +1 -1
- package/lib/lit-html.js +3 -3
- package/lib/lit-html.js.map +1 -1
- package/lib/repeat.d.ts.map +1 -1
- package/lib/repeat.js +1 -1
- package/lib/repeat.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +9 -1
- package/src/elements/base/link.ts +3 -3
- package/src/elements/base/route.ts +4 -96
- package/src/lib/element.ts +10 -12
- package/src/lib/history.ts +96 -0
- package/src/lib/keyed.ts +30 -0
- package/src/lib/lit-html.ts +3 -3
- package/src/lib/repeat.ts +1 -1
- package/src/lib/version.ts +1 -1
package/dist/gem.mjs
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
let t,e,n,i,s,r,a,o,l,h,c,u,d,p,f,m,g,y,b,_,$,S,v,w,E,C,P,L,x,k,T,O,N,R,M,A,H,I,V,j,D,W,K,U,G,q,B,z,F,J,Y,Z,Q,X,tt,te,tn,ti,ts,tr,ta,to,tl,th,tc,tu,td,tp,tf,tm,tg,ty,tb,t_,t$,tS,tv,tw,tE,tC,tP,tL,tx,tk,tT,tO,tN,tR,tM,tA,tH,tI,tV,tj,tD,tW,tK,tU,tG,tq,tB,tz,tF,tJ,tY,tZ,tQ,tX,t0,t1,t2,t3,t8,t4,t6,t5,t9,t7,et,ee,en,ei,es,er,ea,eo,el,eh,ec,eu,ed,ep,ef,em,eg,ey,eb,e_,e$,eS,ev,ew,eE,eC,eP,eL,ex,ek,eT,eO,eN,eR,eM,eA,eH,eI,eV,ej,eD,eW,eK,eU,eG,eq,eB,ez,eF;var eJ={};eJ.d=(t,e,n)=>{var i=(e,n)=>{for(var i in e)eJ.o(e,i)&&!eJ.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,[n]:e[i]})};i(e,"get"),i(n,"value")},eJ.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),eJ.r=t=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var eY={};eJ.r(eY),eJ.d(eY,{adoptedStyle:()=>iN,aria:()=>iI,async:()=>iH,attribute:()=>ip,boolattribute:()=>im,connectStore:()=>iR,customElement:()=>iV,effect:()=>i_,emitter:()=>ik,fallback:()=>iE,globalemitter:()=>iT,light:()=>iA,memo:()=>ib,mounted:()=>iv,numattribute:()=>ig,part:()=>ix,property:()=>iy,shadow:()=>iM,slot:()=>iL,state:()=>iC,template:()=>iw,unmounted:()=>i$,willMount:()=>iS});var eZ={};eJ.r(eZ),eJ.d(eZ,{GemElement:()=>n2,SheetToken:()=>nK,UpdateToken:()=>nU,_RenderErrorEvent:()=>nq,_createTemplate:()=>e,_renderRoot:()=>nV,createState:()=>t,css:()=>nJ,html:()=>nA,render:()=>nH,setEngine:()=>nI});var eQ={};eJ.r(eQ),eJ.d(eQ,{_StoreListenerMap:()=>nO,connect:()=>nM,createStore:()=>nR});var eX={};eJ.r(eX),eJ.d(eX,{version:()=>sy});let{get:e0,set:e1,has:e2,deleteProperty:e3,defineProperty:e8,getOwnPropertyDescriptor:e4,ownKeys:e6}=Reflect,e5=globalThis.__GEM_SSR__,e9=!!e5,e7={},nt=e5?(t,e)=>{let n=e5();return n?(n.has(t)||n.set(t,e()),n.get(t)):t}:t=>t,ne=e5?t=>{let e=()=>({...t});return new Proxy(t,{get:(n,i)=>e0(nt(t,e),i),set:(n,i,s)=>e1(nt(t,e),i,s),has:(n,i)=>e2(nt(t,e),i),deleteProperty:(n,i)=>e3(nt(t,e),i),defineProperty:(n,i,s)=>e8(nt(t,e),i,s),getOwnPropertyDescriptor:(n,i)=>e4(nt(t,e),i),ownKeys:()=>e6(nt(t,e))})}:t=>t,{assign:nn,fromEntries:ni,entries:ns,keys:nr,defineProperty:na,hasOwn:no}=Object,nl=new Set,nh=()=>new Set;function nc(t){let e=nt(nl,nh);!e.has(t)&&(Promise.resolve().then(()=>{e.delete(t),t()}),e.add(t))}function nu(t,e){for(let n of["name","length"])e&&no(e,n)&&na(t,n,{value:e[n],writable:!0,enumerable:!0,configurable:!0});nn(t,e)}function nd(t,e){return delete e.name,delete e.length,nu(e,t),e}function np(t="",e=""){let{pathname:n,search:i,hash:s}=new URL(e,location.origin+t);return n+i+decodeURIComponent(s)}function nf(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}class nm extends EventTarget{#t=new Map;#e;#n;#i(t){let e=this.#t.get(t);return e&&(e.prev?e.prev.next=e.next:this.#e=e.next,e.next?e.next.prev=e.prev:this.#n=e.prev,this.#t.delete(t)),e}get size(){return this.#t.size}get first(){return this.#e}get last(){return this.#n}isSuperLinkOf(t,e=!1){let n=t.first;if(!n)return!0;let i=e?this.#e:this.find(n.value);for(;i&&n;){if(i.value===n.value)n=n.next;else if(!e)return!1;i=i.next}return!n}find(t){return this.#t.get(t)}add(t){this.#n||this.dispatchEvent(new CustomEvent("start"));let e=this.#i(t)||{value:t};e.prev=this.#n,e.prev&&(e.prev.next=e),e.next=void 0,this.#n=e,this.#e||(this.#e=e),this.#t.set(t,e)}delete(t){let e=this.#i(t);return this.#e||this.dispatchEvent(new CustomEvent("end")),e}clear(){this.#t.clear(),this.#e=this.#n=void 0}get(){let t=this.#e;if(t)return this.delete(t.value),t.value}}class ng extends WeakMap{get(t){let e=super.get(t);return e||(e={},this.set(t,e)),e}}class ny extends URLSearchParams{concat(t){ns("string"==typeof t?ni(new URLSearchParams(t).entries()):t).forEach(([t,e])=>{this.append(t,this.#s(e))})}#s=t=>"string"==typeof t?t:JSON.stringify(t);setAny(t,e){if(Array.isArray(e))this.delete(t),e.forEach(e=>this.append(t,this.#s(e)));else{let n=this.#s(e);n?this.set(t,n):this.delete(t)}}#r=t=>{if(!t)return null;try{return JSON.parse(t)}catch{return null}};getAny(t){return this.getAnyAll(t)[0]}getAnyAll(t){return this.getAll(t).filter(t=>""!==t).map(t=>this.#r(t))}toString(){let t=super.toString();return t?`?${t}`:""}toJSON(){return this.toString()}}function nb(t,...e){return t.reduce((t,n,i)=>t+(e[i-1]??"")+n)}let n_=nb;function n$(t=5){let e=Math.random().toString(36).slice(2,2+t);return e.length<t?e+n$(t-e.length):e}function nS(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function nv(t){return t.replace(/-(.)/g,(t,e)=>e.toUpperCase())}function nw(t){return nr(t).forEach(e=>{delete t[e]}),t}class nE extends Error{constructor(t){super(t),this.message=`gem: ${this.message}`}}function nC(t,e){let n=t.length;if(e.length!==n)return!0;for(let i=0;i<n;i++)if(t[i]!==e[i])return!0;return!1}function nP(t,e,n){let i=e;for(let s in t){let r=n(s,t[s]);i+=r?r+e:""}return i}function nL(t){return nP(t,";",(t,e)=>e||0===e?`${nS(t)}:${e}`:"")}function nx(t){return nP(t," ",(t,e)=>e?t:"")}let nk=nx;function nT(t){return nP(t,",",(t,e)=>!0===e||t===e?t:e?`${t}:${e}`:"")}let nO=new WeakMap,nN=()=>new Set;function nR(t,e){let n=nN(),i=ne(nd(t,t=>{nu(i,t),n.forEach(nc),e9&&(nt(n,nN).forEach(nc),e&&e7.updateStore?.(e,i))}));return e&&nu(i,e7.createStore?.(e)),nO.set(i,n),i}function nM(t,e){let n=nO.get(t),i=n&&nt(n,nN);return i?.add(e),()=>i?.delete(e)}let nA=(t,...e)=>nb(t,...e.map(t=>t instanceof Element?t.outerHTML:t)),nH=(t,e)=>e.innerHTML=t;function nI(t,e){nA=t,nH=e}let nV=(t,e)=>e7.render?.(t,e)||nH(t,e),{assign:nj,defineProperty:nD}=Object;nD(Symbol,"metadata",{value:Symbol.for("Symbol.metadata")});let nW=t=>"function"==typeof t&&t(),nK=Symbol.for("gem@sheetToken"),nU=Symbol.for("gem@update"),nG="gem-style-boundary",nq="gem@render-error",nB=new WeakMap;class nz extends CSSStyleSheet{#a;cssText="";get element(){return this.#a||(this.#a=document.createElement("style"),this.#a.textContent=this.cssText),this.#a}replaceSync(t){this.cssText=t,this.#a&&(this.#a.textContent=t),super.replaceSync(t)}}class nF{#o="";#l="";constructor(t=""){this.#l=t}setContent(t){this.#o=t}#h=new Map;#c({sheet:t,scope:e}){t.replaceSync(e?`${e}{ ${this.#o} }`:this.#o)}getStyle(t,e){let n=t&&!t.internals?.shadowRoot,i=n?t.constructor:this,s=this.#h.get(i);if(!s){let r=n?e?"@scope":`@scope (${t.tagName}) to (:state(${nG}) > *)`:"";s={sheet:new nz({media:this.#l}),scope:r},this.#h.set(i,s),this.#c(s)}return s.sheet}updateStyle(){this.#h.forEach(t=>this.#c(t))}}function nJ(t,...e){let n="",i="",s=e.at(0);Array.isArray(t)?i=nb(t,...e):void 0!==s?(n=t,i=s):i=t;let r=new nF(n),a={[nK]:r},o="";return"string"==typeof i?o=i:Object.keys(i).forEach(t=>{let e="$"===t;a[t]=e||t.includes("-")?t:`${t}-${n$()}`,o+=`${e?":where(&:not([hidden])),:host(:where(:not([hidden])))":`.${a[t]}`} {${i[t]}}`}),r.setContent(o),a}let nY=({counts:t,update:e},n,i)=>{let s=!1;n.forEach(e=>{let n=t.get(e)||0;s||=1===i&&0===n||-1===i&&1===n,t.set(e,n+i)}),s&&nc(e)};function nZ(t,e){nW(t.preCallback),t.preCallback=t.callback(e,t.values),t.values=e,t.initialized=!0}function nQ(t){t.forEach(t=>{let e=t.getDep?.();(!t.getDep||!t.values||nC(t.values,e))&&nZ(t,e)})}function nX(t){return t.filter(t=>(nW(t.preCallback),t.preCallback=void 0,t.initialized=!1,t.values=void 0,t.fixed))}let n0=new nm,n1=(t=performance.now())=>{if(performance.now()>t+50)return requestAnimationFrame(n1);let e=n0.get();if(e){try{e()}catch(t){reportError(t)}n1(t)}};n0.addEventListener("start",()=>nc(n1));class n2 extends HTMLElement{#u;#d;#p=[];#f=[];#m=[];#g;#y;#b;#_;#$;[nU](){this.#S()}static{t=t=>{let e=n,i=nd(t,t=>{let n=e.#p.at(0);if(!e9&&e.#y&&n&&!n.initialized)throw new nE("Don't set state sync before insert the DOM");nu(i,t),e.#_||e.#S()});return e.#d.stateList.push(i),i},e=(t,e)=>t.#m.push(e)}constructor(){let t;super(),n=this;let{aria:e,mode:i,delegatesFocus:s,...r}=this.#v,{focusable:a,...o}=e||{};this.#u=i?this.shadowRoot||this.attachShadow({mode:i,delegatesFocus:s,...r}):this,this.#d=this.attachInternals(),this.#u===this||this.#d.shadowRoot||nD(this.#d,"shadowRoot",{value:this.#u}),this.#d.stateList=[],this.#d.sheets=[],nj(this.#d,o),this.#p.push({fixed:!0,getDep:()=>[this.disabled],callback:([e=!1])=>{if(void 0===t&&(t=this.hasAttribute("tabindex")),this.#d.ariaDisabled=String(e),a&&!t&&(this.tabIndex=-Number(e)),(a||s)&&e)return nf(this,"click",t=>t.isTrusted&&t.stopImmediatePropagation(),{capture:!0})}})}get #v(){return this.constructor[Symbol.metadata]}get #w(){return this.#m.findLast(t=>!t.condition||t.condition())}get internals(){return this.#d}#E=()=>{nQ(this.#p)};#C=t=>{try{this.#_=!0,nQ(this.#f);let e=this.#u===this,n=t?t.render():e?void 0:nA`<slot></slot>`;if(void 0===n)return;let i=n??(e?nA`<style>@scope{&{display:none!important;}}</style>`:nA`<style>:host{&{display:none!important;}}</style>`);nV(i,this.#u)}catch(e){let t=new CustomEvent(nq,{bubbles:!0,composed:!0,cancelable:!0,detail:e});if(this.dispatchEvent(t))throw e}finally{this.#_=!1}};#P=()=>{let t=this.#w;this.#y&&(t||!this.#m.length)&&(this.#C(t),e9||nc(this.#E))};#L=t=>{this.#v.noBlocking&&!e9?n0.add(t):t()};#x=()=>this.#L(this.#P);#S=()=>{this.#y&&nc(this.#x)};#k=()=>{let{adoptedStyleSheets:t=[]}=this.#v,{shadowRoot:e,sheets:n}=this.#d,i=t.map(t=>t[nK].getStyle(this));if(!e)return this.prepend(...n.map(t=>t.element)),((t,e)=>{let n=t.getRootNode(),i=nB.get(n);if(!i){let t=new Map;i={counts:t,update:()=>{let e=(n.adoptedStyleSheets||[]).filter(e=>!t.has(e));t.forEach((t,n)=>t&&e.push(n)),n.adoptedStyleSheets=e.reverse()}},nB.set(n,i)}return nY(i,e,1),()=>nY(i,e,-1)})(this,i);e.adoptedStyleSheets=i.concat(n)};#T=()=>{this.#p.forEach(t=>!t.initialized&&nZ(t,t.getDep?.()))};#O=()=>{this.willMount&&this.memo(this.willMount.bind(this),()=>[]),this.mounted&&this.effect(this.mounted.bind(this),()=>[]),this.updated&&this.effect((t,e)=>e&&this.updated.apply(this)),this.unmounted&&this.effect(()=>this.unmounted.bind(this),()=>[]),!this.#m.length&&this.render&&this.#m.push({render:this.render.bind(this),condition:this.shouldUpdate?.bind(this)})};#N;#R=()=>{if(this.#g){this.#g=!1,this.#$?.(),this.#$=this.#k();return}if(e7.connect?.(this,this.#R))return;this.#b=!0,this.#O();let{observedStores:t,mode:e,penetrable:n}=this.#v;this.#d.states.add("gem-element"),e||!this.#m.length||n||this.#d.states.add(nG),this.#N=t?.map(t=>nM(t,this.#x)),this.#C(this.#w),this.#y=!0,this.#$=this.#k(),e9||nc(this.#T)};connectedCallback(){this.#L(this.#R)}disconnectedCallback(){if(this.isConnected){this.#g=!0;return}n0.delete(this.#R),n0.delete(this.#P),this.#y=!1,this.#N?.forEach(t=>t()),this.#p=nX(this.#p),this.#f=nX(this.#f),this.#$?.()}effect=(t,e)=>{let n={callback:t,getDep:e,fixed:!this.#b};this.#y&&nZ(n,e?.()),this.#p.push(n)};memo=(t,e)=>{this.#f.push({callback:t,getDep:e,fixed:!this.#b})};update=()=>this.#S()}let{deleteProperty:n3,getOwnPropertyDescriptor:n8,defineProperty:n4}=Reflect,{getPrototypeOf:n6,assign:n5,hasOwn:n9}=Object,n7=new ng;function it(t,e,n){let i=t.metadata;n8(i,e)||n4(i,e,{value:i[e]?.filter(t=>t!==n)||[]}),i[e].push(n)}function ie(t,e,n,i){let s=t.name;it(t,e,n),t.addInitializer(function(){let e=iu(this,t);n9(e,s)||i(e,s),function(t,e){let{value:n}=n8(t,e)||{};n3(t,e),t[e]=n}(this,s)})}let{setAttribute:ii,toggleAttribute:is,removeAttribute:ir}=Element.prototype,ia=(t,e)=>t.constructor[Symbol.metadata]?.attrProps?.[e];function io(){}n2.prototype.setAttribute=function(t,e){let n=ia(this,t);if(!n)return ii.call(this,t,e);this[n]=e},n2.prototype.removeAttribute=function(t){let e=ia(this,t);if(!e)return ir.call(this,t);this[e]=null},n2.prototype.toggleAttribute=function(t,e){let n=ia(this,t);return n?this[n]=e??!this.hasAttribute(t):is.call(this,t,e)};let il=Symbol("event handle");function ih(t,e,{attr:n,attrType:i,event:s,eventOptions:r}={}){n4(t,e,{configurable:!0,get(){let t=n7.get(this)[e];return s&&!t?(this[e]=io,this[e]):t},set(t){let a=this,o=n7.get(a);n&&((t=i===Boolean&&""===t||i(t||""))?ii.call(this,n,i===Boolean?"":t):ir.call(this,n)),t!==o[e]&&(s?(o[e]=t?.[il]?t:async(e,n)=>{await Promise.resolve();let i=new CustomEvent(s,{...n,...r,detail:e});a.dispatchEvent(i),await t(e,n)},o[e][il]=!0):(o[e]=t,this[nU]()))}})}let ic=new WeakMap;function iu(t,{metadata:e}){let n=ic.get(e);if(n)return n;let i=t;do i=n6(i);while(i.constructor[Symbol.metadata]!==e);return ic.set(e,i),i}function id(t,e){let n=t.name,i=nS(n),s=t.metadata;return n9(s,"attrProps")||(s.attrProps=Object.create(s.attrProps||null)),s.attrProps[i]=n,ie(t,"observedAttributes",i,t=>ih(t,n,{attr:i,attrType:e})),function(t){return this.getAttribute(i)??t}}function ip(t,e){return id(e,String)}function im(t,e){return id(e,Boolean)}function ig(t,e){return id(e,Number)}function iy(t,e){let n=e.name;return ie(e,"observedProperties",n,ih),function(t){return this[n]??t}}function ib(t){return(e,n)=>{let{addInitializer:i,name:s,access:r,kind:a}=n;i(function(){let e=t&&(()=>t(this));if("getter"===a){if(n.private)throw new nE("not support");let t=n8(iu(this,n),s).get.bind(this);this.memo(()=>{n4(this,s,{configurable:!0,value:t()})},e)}else this.memo(r.get.call(this,this).bind(this),e)})}}function i_(t){return(e,{addInitializer:n,access:i})=>{n(function(){this.effect(i.get.call(this,this).bind(this),t&&(()=>t(this)))})}}function i$(){return(t,{addInitializer:e,access:n})=>{e(function(){this.effect(()=>n.get.call(this,this).bind(this),()=>[])})}}function iS(){return ib(()=>[])}function iv(){return i_(()=>[])}function iw(t){return(n,{addInitializer:i,access:s})=>{i(function(){e(this,{render:s.get.call(this,this).bind(this),condition:t&&(()=>t(this))})})}}function iE(){return(t,{addInitializer:e,access:n})=>{e(function(){this.addEventListener(nq,t=>{t.preventDefault(),nV(n.get.call(this,this).apply(this,[t.detail]),this.internals.shadowRoot||this)})})}}function iC(t,e){let n=nS(e.name);ie(e,"definedCSSStates",n,(t,e)=>{n4(t,e,{configurable:!0,get(){let{states:t}=this.internals;return t?.has(n)},set(t){let{states:e}=this.internals;t?e?.add(n):e?.delete(n)}})})}function iP(t,e,n,i){let s=t.name,r=nS(s);if(t.static)it(t,n,r);else{let i=n6(e);i[s]||(i[s]=r,it(t,n,r))}return i||r}function iL(t,e){return function(t){return iP(e,this,"definedSlots",t)}}function ix(t,e){return function(t){return iP(e,this,"definedParts",t)}}function ik(t,e){iO(e)}function iT(t,e){iO(e,{bubbles:!0,composed:!0})}function iO(t,e){let n=nS(t.name);ie(t,"definedEvents",n,(t,i)=>ih(t,i,{event:n,eventOptions:e}))}function iN(t){return(e,n)=>{it(n,"adoptedStyleSheets",t)}}function iR(t){return(e,n)=>{it(n,"observedStores",t)}}function iM({mode:t="open",serializable:e=!0,...n}={}){return(i,s)=>{n5(s.metadata,{mode:t,serializable:e,...n})}}function iA({penetrable:t}){return(e,n)=>{n.metadata.penetrable=t}}function iH(){return(t,e)=>{e.metadata.noBlocking=!0}}function iI(t){return(e,n)=>{let i=n.metadata;i.aria={...i.aria,...t}}}function iV(t){return(e,{addInitializer:n})=>{n(()=>{customElements.define(t,e)})}}let ij=globalThis.trustedTypes,iD=ij?.createPolicy("lit-html",{createHTML:t=>t}),iW="$lit$",iK=`lit$${Math.random().toFixed(9).slice(2)}$`,iU="?"+iK,iG=`<${iU}>`,iq=document,iB=()=>iq.createComment(""),iz=t=>null===t||"object"!=typeof t&&"function"!=typeof t,iF=t=>null==t,iJ=`[
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]`,iZ=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,iQ=/-->/g,iX=/>/g,i0=RegExp(`>|${iJ}(?:([^\\s"'>=/]+)(${iJ}*=${iJ}*(?:${iY}|("|')|))|$)`,"g"),i1=/'/g,i2=/"/g,i3=/^(?:script|style|textarea|title)$/i,i8="v-if",i4="v-else-if",i6="v-else";class i5{type;strings;values;constructor(t,e,n){this.type=t,this.strings=e,this.values=n}}let i9=t=>(e,...n)=>new i5(t,e,n),i7=i9(1),st=i9(2),se=i9(3),sn=Symbol.for("lit-noChange"),si=new WeakMap,ss=iq.createTreeWalker(iq,129);class sr{el;parts=[];constructor({strings:t,type:e},n){let i,s=0,r=0,a=t.length-1,o=this.parts,[l,h]=((t,e)=>{let n,i=t.length-1,s=[],r=2===e?"<svg>":3===e?"<math>":"",a=iZ;for(let e=0;e<i;e++){let i,o,l=t[e],h=-1,c=0;for(;c<l.length&&(a.lastIndex=c,null!==(o=a.exec(l)));)c=a.lastIndex,a===iZ?"!--"===o[1]?a=iQ:void 0!==o[1]?a=iX:void 0!==o[2]?(i3.test(o[2])&&(n=RegExp(`</${o[2]}`,"g")),a=i0):void 0!==o[3]&&(a=i0):a===i0?">"===o[0]?(a=n??iZ,h=-1):void 0===o[1]?h=-2:(h=a.lastIndex-o[2].length,i=o[1],a=void 0===o[3]?i0:'"'===o[3]?i2:i1):a===i2||a===i1?a=i0:a===iQ||a===iX?a=iZ:(a=i0,n=void 0);let u=a===i0&&t[e+1].startsWith("/>")?" ":"";r+=a===iZ?l+iG:h>=0?(s.push(i),l.slice(0,h)+iW+l.slice(h)+iK+u):l+iK+(-2===h?e:u)}let o=r+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"");return[function(t,e){if(!Array.isArray(t))throw Error("invalid template");return void 0!==iD?iD.createHTML(e):e}(t,o),s]})(t,e);if(this.el=sr.createElement(l,n),ss.currentNode=this.el.content,2===e||3===e){let t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=ss.nextNode())&&o.length<a;){if(1===i.nodeType){if(i.hasAttributes())for(let t of i.getAttributeNames())if(t.endsWith(iW)){let e=h[r++],n=i.getAttribute(t).split(iK),a=/([.?@])?(.*)/.exec(e);o.push({type:1,index:s,name:a[2],strings:n,ctor:"."===a[1]?su:"?"===a[1]?sd:"@"===a[1]?sp:sc}),i.removeAttribute(t)}else t.startsWith(iK)&&(o.push({type:6,index:s}),i.removeAttribute(t));if(i3.test(i.tagName)){let t=i.textContent.split(iK),e=t.length-1;if(e>0){i.textContent=ij?ij.emptyScript:"";for(let n=0;n<e;n++)i.append(t[n],iB()),ss.nextNode(),o.push({type:2,index:++s});i.append(t[e],iB())}}}else if(8===i.nodeType)if(i.data===iU)o.push({type:2,index:s});else{let t=-1;for(;-1!==(t=i.data.indexOf(iK,t+1));)o.push({type:7,index:s}),t+=iK.length-1}s++}}static createElement(t,e){let n=iq.createElement("template");return n.innerHTML=t,n}}function sa(t,e,n=t,i){if(e===sn)return e;let s=void 0!==i?n.__directives?.[i]:n.__directive,r=iz(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$notifyDirectiveConnectionChanged?.(!1),void 0===r?s=void 0:(s=new r(t))._$initialize(t,n,i),void 0!==i?(n.__directives??=[])[i]=s:n.__directive=s),void 0!==s&&(e=sa(t,s._$resolve(t,e.values),s,i)),e}class so{_$template;_$parts=[];_$conditions=[];_$parent;_$disconnectableChildren=void 0;constructor(t,e){this._$template=t,this._$parent=e}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(t){let{el:{content:e},parts:n}=this._$template,i=new Map,s=new Map,r=(t?.creationScope??iq).importNode(e,!0);ss.currentNode=r;let a=ss.nextNode(),o=0,l=0,h=n[0];for(;void 0!==h;){if(o===h.index){let e;2===h.type?e=new sh(a,a.nextSibling,this,t):1===h.type?(h.name===i8&&i.set(a,l),h.name===i4&&s.set(a,l),e=new h.ctor(a,h.name,h.strings,this,t)):6===h.type&&(e=new sf(a,this,t)),this._$parts.push(e),h=n[++l]}o!==h?.index&&(a=ss.nextNode(),o++)}let c=new Map;for(let t of(i.forEach((t,e)=>{let n=new sl(e,t);this._$conditions.push(n),c.set(e,n);let i=e;for(;i=i.nextElementSibling;){let t=s.get(i);if(void 0===t)break;n.push(i,t)}}),this._$parts)){if(t?.type!==2)continue;let e=c.get(t._$endNode);e&&(t._$endNode=e.mark)}return ss.currentNode=iq,r}_update(t){let e=0;for(let n of this._$parts)void 0!==n&&(void 0!==n.strings?(n._$setValue(t,n,e),e+=n.strings.length-2):n.name===i8||n.name===i4||n._$setValue(t[e])),e++;this._$conditions.forEach(e=>e.update(t))}}class sl{mark;list;constructor(t,e){let n=iB();n._$chain=this,t.before(n),this.mark=n,this.list=[{ele:t,idx:e}],this.check()}get next(){return this.list.at(-1).ele.nextElementSibling}push(t,e){this.list.push({ele:t,idx:e}),this.check()}check(){let t=this.next;t?.attributes.getNamedItem(i6)&&(this.list.push({ele:t}),t.removeAttribute(i6))}update(t){let{mark:e,list:n}=this,i=n.find(({idx:e})=>void 0===e||!!t[e]);i&&!i.ele.parentNode&&e.after(i.ele),n.forEach(({ele:t})=>(!i||t!==i.ele)&&t.remove())}}class sh{type=2;options;_$committedValue;__directive;_$startNode;_$endNode;_$parent;__isConnected;get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}_$disconnectableChildren=void 0;constructor(t,e,n,i){this._$startNode=t,this._$endNode=e,this._$parent=n,this.options=i,this.__isConnected=i?.isConnected??!0}get parentNode(){let t=this._$startNode.parentNode,e=this._$parent;return void 0!==e&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(t,e=this){this.parentNode&&(iz(t=sa(this,t,e))?iF(t)||""===t?(iF(this._$committedValue)||this._$clear(),this._$committedValue=void 0):t!==this._$committedValue&&t!==sn&&this._commitText(t):t instanceof i5?this._commitTemplateResult(t):void 0!==t.nodeType?this._commitNode(t):Symbol.iterator in t?this._commitIterable(t):this._commitText(t))}_insert(t){return this._$startNode.parentNode.insertBefore(t,this._$endNode)}_commitNode(t){this._$committedValue!==t&&(this._$clear(),this._$committedValue=this._insert(t))}_commitText(t){!iF(this._$committedValue)&&iz(this._$committedValue)?this._$startNode.nextSibling.data=t:this._commitNode(iq.createTextNode(t)),this._$committedValue=t}_commitTemplateResult(t){let{values:e}=t,n=this._$getTemplate(t);if(this._$committedValue?._$template===n)this._$committedValue._update(e);else{let t=new so(n,this),i=t._clone(this.options);t._update(e),this._commitNode(i),this._$committedValue=t}}_$getTemplate(t){let e=si.get(t.strings);return void 0===e&&si.set(t.strings,e=new sr(t)),e}_commitIterable(t){let e;Array.isArray(this._$committedValue)||(this._$committedValue=[],this._$clear());let n=this._$committedValue,i=0;for(let s of t)i===n.length?n.push(e=new sh(this._insert(iB()),this._insert(iB()),this,this.options)):e=n[i],e._$setValue(s),i++;i<n.length&&(this._$clear(e&&e._$endNode.nextSibling,i),n.length=i)}_$clear(t=this._$startNode.nextSibling,e){for(this._$notifyConnectionChanged?.(!1,!0,e);t&&t!==this._$endNode;){let e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$parent&&(this.__isConnected=t,this._$notifyConnectionChanged?.(t))}}class sc{type=1;element;name;options;strings;_$committedValue;__directives;_$parent;_$disconnectableChildren=void 0;get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(t,e,n,i,s){this.element=t,this.name=e,this._$parent=i,this.options=s,n.length>2||""!==n[0]||""!==n[1]?(this._$committedValue=Array(n.length-1).fill(new String),this.strings=n):this._$committedValue=void 0}_$setValue(t,e=this,n,i){let s=this.strings,r=!1;if(void 0===s)(r=!iz(t=sa(this,t,e,0))||t!==this._$committedValue)&&(this._$committedValue=t);else{let i,a,o=t;for(t=s[0],i=0;i<s.length-1;i++)a=sa(this,o[n+i],e,i),r||=!iz(a)||a!==this._$committedValue[i],iF(a)?t=void 0:iF(t)||(t+=a+s[i+1]),this._$committedValue[i]=a}r&&!i&&this._commitValue(t)}_commitValue(t){iF(t)?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t)}}class su extends sc{type=3;_commitValue(t){this.element[this.name]=t}}class sd extends sc{type=4;_commitValue(t){this.element.toggleAttribute(this.name,!!t)}}class sp extends sc{type=5;_$setValue(t,e=this){t=sa(this,t,e,0);let n=this._$committedValue,i=n&&(!t||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive),s=t&&(!n||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$committedValue=t}handleEvent(t){"function"==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,t):this._$committedValue.handleEvent(t)}}class sf{element;type=6;__directive;_$committedValue;_$parent;_$disconnectableChildren=void 0;_$props;options;constructor(t,e,n){this.element=t,this._$parent=e,this.options=n}get _$isConnected(){return this._$parent._$isConnected}_$setValue(t){if(t)if(t instanceof sg)t.value=this.element;else if(t._$litDirective$)sa(this,t);else{if(this._$props)for(let t in this._$props)Reflect.set(this.element,t,void 0);Object.assign(this.element,t),this._$props=t}}}let sm=()=>new sg;class sg{value}let sy="2.3.2",sb=t=>(...e)=>({_$litDirective$:t,values:e});class s_{__part;__attributeIndex;__directive;_$parent;_$disconnectableChildren;get _$isConnected(){return this._$parent._$isConnected}_$initialize(t,e,n){this.__part=t,this._$parent=e,this.__attributeIndex=n}_$resolve(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}let s$=(t,e,n)=>{let i=t._$startNode.parentNode,s=void 0===e?t._$endNode:e._$startNode;if(void 0===n)n=new sh(i.insertBefore(document.createComment(""),s),i.insertBefore(document.createComment(""),s),t,t.options);else{let e=n._$endNode.nextSibling,r=n._$parent,a=r!==t;if(a){let e;n._$reparentDisconnectables?.(t),n._$parent=t,void 0!==n._$notifyConnectionChanged&&(e=t._$isConnected)!==r._$isConnected&&n._$notifyConnectionChanged(e)}if(e!==s||a){let t=n._$startNode;for(;t!==e;){let e=t.nextSibling;i.insertBefore(t,s),t=e}}}return n},sS=(t,e,n=t)=>(t._$setValue(e,n),t),sv={},sw=t=>{t._$notifyConnectionChanged?.(!1,!0);let e=t._$startNode,n=t._$endNode.nextSibling;for(;e!==n;){let t=e.nextSibling;e.remove(),e=t}},sE=(t,e,n)=>{let i=new Map;for(let s=e;s<=n;s++)i.set(t[s],s);return i},sC=sb(class extends s_{_itemKeys;constructor(t){if(super(),2!==t.type)throw Error("repeat() can only be used in text expressions")}_getValuesAndKeys(t,e,n){let i;void 0===n?n=e:void 0!==e&&(i=e);let s=[],r=[],a=0;for(let e of t)s[a]=i?i(e,a):a,r[a]=n(e,a),a++;return{values:r,keys:s}}render(t,e,n){return this._getValuesAndKeys(t,e,n).values}update(t,[e,n,i]){let s,r,a=t._$committedValue,{values:o,keys:l}=this._getValuesAndKeys(e,n,i);if(!Array.isArray(a))return this._itemKeys=l,o;let h=this._itemKeys??=[],c=[],u=0,d=a.length-1,p=0,f=o.length-1;for(;u<=d&&p<=f;)if(null===a[u])u++;else if(null===a[d])d--;else if(h[u]===l[p])c[p]=sS(a[u],o[p]),u++,p++;else if(h[d]===l[f])c[f]=sS(a[d],o[f]),d--,f--;else if(h[u]===l[f])c[f]=sS(a[u],o[f]),s$(t,c[f+1],a[u]),u++,f--;else if(h[d]===l[p])c[p]=sS(a[d],o[p]),s$(t,a[u],a[d]),d--,p++;else if(void 0===s&&(s=sE(l,p,f),r=sE(h,u,d)),s.has(h[u]))if(s.has(h[d])){let e=r.get(l[p]),n=void 0!==e?a[e]:null;if(null===n){let e=s$(t,a[u]);sS(e,o[p]),c[p]=e}else c[p]=sS(n,o[p]),s$(t,a[u],n),a[e]=null;p++}else sw(a[d]),d--;else sw(a[u]),u++;for(;p<=f;){let e=s$(t,c[f+1]);sS(e,o[p]),c[p++]=e}for(;u<=d;){let t=a[u++];null!==t&&sw(t)}return this._itemKeys=l,((t,e=sv)=>t._$committedValue=e)(t,c),sn}});nI(i7,(t,e,n)=>{let i=n?.renderBefore??e,s=i._$litPart$;if(void 0===s){let t=n?.renderBefore??null;i._$litPart$=s=new sh(e.insertBefore(iB(),t),t,void 0,n??{})}return s._$setValue(t),s}),globalThis.__GEM_DEVTOOLS__HOOK__&&!globalThis.__GEM_DEVTOOLS__HOOK__.GemElement&&Object.assign(globalThis.__GEM_DEVTOOLS__HOOK__,{...eZ,...eY,...eQ,...eX});let sP=globalThis.history,sL=sP.pushState.bind(sP),sx=sP.replaceState.bind(sP),sk=0,sT=()=>`${performance.now()}-${++sk}`,sO=nR({$hasCloseHandle:!1,$hasOpenHandle:!1,$hasShouldCloseHandle:!1,$key:""}),sN=new Map,sR=()=>new Map([...sN].map(([t,e])=>[t,{...e}])),sM=["$key","$hasCloseHandle","$hasOpenHandle","$hasShouldCloseHandle"];function sA(t){return t===sK.basePath?"/":t.replace(RegExp(`^${sK.basePath}/`),"/")}function sH(t){sK.dispatchEvent(new CustomEvent("beforechange")),nw(sO),sO(t)}function sI(t){let e=sK.getParams()||{path:sA(location.pathname),query:new ny,title:document.title},n=t.path?np(e.path,t.path):sA(location.pathname),i=new ny(t.query??(t.path?"":location.search)),s=String(i)!==String(e.query),r=s?i:e.query,a=n!==e.path||s,o=t.title||(a?"":e.title),l=t.close||t.data||t.open||t.shouldClose,h=decodeURIComponent(t.hash??(!a&&l?location.hash:""));return{...t,title:o,path:n,query:r,hash:h}}function sV(t,e){var n=t.data;if(sO.$key!==n?.$key){for(let t of sM)if(n?.[t])throw new nE(`\`${t}\` is not allowed`)}let i=sI(t),{title:s,path:r,query:a,hash:o,close:l,open:h,shouldClose:c,data:u}=i,d={$hasCloseHandle:!!l,$hasOpenHandle:!!h,$hasShouldCloseHandle:!!c,$key:sT(),$title:s,...u};nt(sN,sR).set(d.$key,i),sH(d);let p=(sK.basePath?sK.basePath+r:r)+new ny(a)+o,f=decodeURIComponent(location.hash);e(d,s,p),f!==o&&dispatchEvent(new CustomEvent("hashchange"))}function sj(t,e,n,i){let{pathname:s,search:r,hash:a}=new URL(n,location.origin+location.pathname);sV({path:s,query:r,hash:a,title:e,data:t},i)}let sD=nR({basePath:""});class sW extends EventTarget{get store(){return sO}get currentKey(){return sO.$key}get basePath(){return sD.basePath}set basePath(t){sD({basePath:t}),Object.assign(this.getParams(),{path:sA(location.pathname)})}getParams(){return nt(sN,sR).get(sO.$key)}updateParams(t){Object.assign(this.getParams(),t),sO()}push(t){sV(t,sL)}replace(t){sV(t,sx)}pushIgnoreCloseHandle(t){sO.$hasCloseHandle?(this.getParams()?.close?.(),this.replace(t)):this.push(t)}forward(){sP.forward()}back(){sP.back()}}let sK=new sW,sU=nR({defaultTitle:document.title,url:"",title:""});if(!globalThis._GEMHISTORY){if(globalThis._GEMHISTORY={history:sK,titleStore:sU,basePathStore:sD},sP.pushState=(t,e,n)=>{sj(t,e,n,sL)},sP.replaceState=(t,e,n)=>{sj(t,e,n,sx)},addEventListener("hashchange",({isTrusted:t})=>{t&&sK.replace({hash:location.hash})}),sP.state)if(sP.state.$hasCloseHandle){sO(sP.state);let t=sI({title:document.title});nt(sN,sR).set(sO.$key,t),sK.back()}else{let t=sI({title:document.title,hash:location.hash});sO({$key:sT(),...sP.state||{}}),nt(sN,sR).set(sO.$key,t)}else{let{protocol:t,pathname:e,search:n,hash:i}=location;(t.startsWith("http")||t.startsWith("tauri"))&&sK.replace({path:e,query:n,hash:i})}nM(sU,()=>{let t=sK.getParams();t&&(t.title=sU.title)}),nM(sO,()=>{let{title:t}=sK.getParams();t!==sU.title&&sU({title:t})});let t=!1;addEventListener("popstate",e=>{let n=e.state;if(n?.$key){if(t){t=!1;return}if(!nt(sN,sR).has(n.$key)){let{pathname:t,search:e,hash:i}=location;nt(sN,sR).set(n.$key,{path:sA(t),query:new ny(e),hash:decodeURIComponent(i),title:sU.title||n.$title,data:n})}if(parseFloat(n.$key)>parseFloat(sO.$key)&&n.$hasOpenHandle)nt(sN,sR).get(n.$key)?.open?.();else if(sO.$hasCloseHandle){let e=nt(sN,sR).get(sO.$key),i=e?.close,s=e?.shouldClose;if(s&&!s()){t=!0,sK.forward();return}i?i():n.$hasCloseHandle&&(t=!0,sK.back())}sH(n)}})}let{history:sG,titleStore:sq,basePathStore:sB}=globalThis._GEMHISTORY;function sz(t,e,n){"symbol"==typeof e&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:n?n+" "+e:e})}catch(t){}return t}function sF(t,e,n,i,s,r){var a,o,l,h,c,u,d,p=Symbol.metadata||Symbol.for("Symbol.metadata"),f=Object.defineProperty,m=Object.create,g=[m(null),m(null)],y=e.length;function b(e,n,i){return function(s,r){n&&(r=s,s=t);for(var a=0;a<e.length;a++)r=e[a].apply(s,i?[r]:[]);return i?r:s}}function _(t,e,n,i){if("function"!=typeof t&&(i||void 0!==t))throw TypeError(e+" must "+(n||"be")+" a function"+(i?"":" or undefined"));return t}function $(t,e,n,i,s,r,a,o,l,h,c){function p(t){if(!c(t))throw TypeError("Attempted to access private element on non-instance")}var m=[].concat(e[0]),y=e[3],$=!a,S=1===s,v=3===s,w=4===s,E=2===s;function C(e,n,i){return function(s,r){return n&&(r=s,s=t),i&&i(s),P[e].call(s,r)}}var P={},L=[],x=v?"get":w||S?"set":"value";if(!$&&(l?(h||S?P={get:sz(function(){return y(this)},i,"get"),set:function(t){e[4](this,t)}}:P[x]=y,h||sz(P[x],i,E?"":x)):h||(P=Object.getOwnPropertyDescriptor(t,i)),!h&&!l)){if((d=g[+o][i])&&(d^s)!=7)throw Error("Decorating two elements with the same name ("+P[x].name+") is not supported yet");g[+o][i]=s<3?1:s}for(var k=t,T=m.length-1;T>=0;T-=n?2:1){var O=_(m[T],"A decorator","be",!0),N=n?m[T-1]:void 0,R={},M={kind:["field","accessor","method","getter","setter","class"][s],name:i,metadata:u,addInitializer:(function(t,e){if(t.v)throw TypeError("attempted to call addInitializer after decoration was finished");_(e,"An initializer","be",!0),r.push(e)}).bind(null,R)};if($){d=O.call(N,k,M),R.v=1,_(d,"class decorators","return")&&(k=d);continue}if(M.static=o,M.private=l,d=M.access={has:l?c.bind():function(t){return i in t}},w||(d.get=l?E?function(t){return p(t),P.value}:C("get",0,p):function(t){return t[i]}),E||v||(d.set=l?C("set",0,p):function(t,e){t[i]=e}),k=O.call(N,S?{get:P.get,set:P.set}:P[x],M),R.v=1,S){if("object"==typeof k&&k)(d=_(k.get,"accessor.get"))&&(P.get=d),(d=_(k.set,"accessor.set"))&&(P.set=d),(d=_(k.init,"accessor.init"))&&L.unshift(d);else if(void 0!==k)throw TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(k,(h?"field":"method")+" decorators","return")&&(h?L.unshift(k):P[x]=k)}return s<2&&a.push(b(L,o,1),b(r,o,0)),h||$||(l?S?a.splice(-1,0,C("get",o),C("set",o)):a.push(E?P[x]:_.call.bind(P[x])):f(t,i,P)),k}function S(t){return f(t,p,{configurable:!0,enumerable:!0,value:u})}return void 0!==r&&(u=r[p]),u=m(null==u?null:u),l=[],h=function(t){t&&l.push(b(t))},(c=function(e,i){for(var r=0;r<n.length;r++){var h=n[r],c=h[1],u=7&c;if((8&c)==e&&!u==i){var d=h[2],p=!!h[3],f=16&c;$(e?t:t.prototype,h,f,p?"#"+d:function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(d),u,u<2?[]:e?o=o||[]:a=a||[],l,!!e,p,i,e&&p?function(e){return function(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(null!==t?typeof t:"null"));return t}(e)===t}:s)}}})(8,0),c(0,0),c(8,1),c(0,1),h(a),h(o),d=l,y||S(t),{e:d,get c(){var v=[];return y&&[S(t=$(t,[e],i,t.name,5,v)),b(v,1)]}}}let sJ=Symbol();i=iR(sG.store),s=iI({role:"dialog",ariaModal:"true"}),a=n2,o=iS();class sY extends a{static{({e:[l,h,c,u,d,p],c:[f,r]}=sF(this,[i,s],[[ip,0,"label"],[iC,0,"opened"],[o,0,"init",function(t){return t.#M},function(t,e){t.#M=e}]],0,t=>#M in t,a))}label=l(this);opened=(h(this),c(this));#A=void u(this);#H;#I=[];#V=()=>{this.inert=!0,this.#I.forEach(t=>t.inert=!1),this.#A?this.#A.before(this):this.#H&&this.#H?.appendChild(this),this.dispatchEvent(new CustomEvent("close")),this.opened=!1};#j=()=>{this.hidden=!1,this.inert=!1,this.#A=this.nextSibling,this.#H=this.parentElement||this.getRootNode(),this.#I=[...document.body.children].filter(t=>!t.inert),this.#I.forEach(t=>t.inert=!0),document.body.append(this),this.dispatchEvent(new CustomEvent("open")),this.opened=!0};#M=d(this,()=>this.inert=!0);open=(p(this),()=>{if(!this.opened)return this.#j(),sG.push({title:this.label,open:this.#j,close:this.#V,shouldClose:this.shouldClose}),sJ});shouldClose(){return!0}close=()=>(sG.back(),sJ);forceClose=()=>(this.opened=!1,setTimeout(this.close,100),sJ);static{r()}}function sZ(t){return t}let sQ=Symbol("open mark"),sX=Symbol();function s0(t){let e,n,i,s,r,a,o,l,h,c,u;return e=iM(),n=iI({role:"alertdialog",ariaModal:"true"}),s=n2,r=iv(),a=iv(),new class extends sZ{constructor(){super(u),i()}static [class extends s{static{({e:[o,l,h,c],c:[u,i]}=sF(this,[e,n],[[r,0,"connectHistory",function(t){return t.#D},function(t,e){t.#D=e}],[a,0,"connectStore",function(t){return t.#W},function(t,e){t.#W=e}]],0,t=>#D in t,s))}constructor(...t){super(...t),c(this)}static get isOpen(){return this.store[sQ]}static open(t){let e=new this;this.instance=e,this.inertStore=[...document.body.children].filter(t=>!t.inert),this.inertStore.forEach(t=>t.inert=!0),document.body.append(e);let n=()=>this.store({[sQ]:!0,...t});return setTimeout(()=>{n(),sG.push({title:e.label,open:n,close:this.closeHandle.bind(this),shouldClose:this.shouldClose.bind(this)})},100),sX}static close(){return sG.back(),sX}static closeHandle(){return this.inertStore.forEach(t=>t.inert=!1),this.instance?.remove(),this.store({[sQ]:!1,...t}),sX}static shouldClose(){return!0}label="";#D=o(this,()=>nM(sG.store,this.update));#W=(l(this),h(this,()=>nM(u.store,this.update)))}];inertStore=[];instance=null;store=nR({[sQ]:!1,...t})},u}let s1=/^[\w\-./~]*/,s2=new Map;function s3(t,e){let n=s2.get(t);return n||s2.set(t,n=function(t){let e=s1.exec(t)[0];if(e===t)return e=>e===t?{}:null;if("*"===t)return t=>({0:t});if(!globalThis.URLPattern){let e,n,i;return e=0,n=t.replace(/:[^/$]+|\*/g,t=>"*"===t?`(?<_${e++}>.*)`:`(?<${t.slice(1)}>[^/]+)`),i=RegExp(`^${n}$`),t=>{let e=t.match(i);if(!e)return null;let n={};for(let t in e.groups)n[t.startsWith("_")?t.slice(1):t]=e.groups[t];return n}}let n=new URLPattern({pathname:t}),i=e.replace(/\/$/,"");return t=>t.startsWith(i)?n.exec({pathname:t})?.pathname.groups:null}(t)),n(e)||n(`${e}/`)||null}function s8(t,e){let n=0,i=t.pattern.replaceAll("*",()=>`:${n++}`),s=e?.params;return s&&Object.keys(s).forEach(t=>{i=i.replace(RegExp(`:${t}`,"g"),s[t])}),i}function s4(t,e){return{path:s8(t,e),...e}}let s6=nA``,s5=new Map,s9=!1;m=iA({penetrable:!0}),y=n2,b=i_(t=>[t.scrollContainer]),_=i_(t=>[t.scrollContainer]),$=iw(t=>!t.inert),new class extends sZ{constructor(){super(ti),g()}static [class extends y{static{({e:[S,v,w,E,C,P,L,x,k,T,O,N,R,M,A,H,I,V,j,D,W,K,U,G,q,B,z,F,J,Y,Z,Q],c:[ti,g]}=sF(this,[m],[[im,0,"transition"],[iy,0,"routes"],[iy,0,"locationStore"],[iy,0,"key"],[ik,0,"loading"],[ik,0,"beforeroutechange"],[ik,0,"routechange"],[ik,0,"error"],[iy,0,"scrollContainer"],[iy,0,"scrollWait"],[iy,0,"scrollIgnoreHash"],[iy,0,"trigger"],[b,0,"rememberScrollPosition",function(t){return t.#K},function(t,e){t.#K=e}],[_,0,"connectTriggerStore",function(t){return t.#U},function(t,e){t.#U=e}],[i_(t=>t.#G()),0,"updateContent",function(t){return t.#q},function(t,e){t.#q=e}],[$,0,"content",function(t){return t.#o},function(t,e){t.#o=e}]],0,t=>#K in t,y))}transition=S(this);routes=(v(this),w(this));locationStore=(E(this),C(this));key=(P(this),L(this));loading=(x(this),k(this));beforeroutechange=(T(this),O(this));routechange=(N(this),R(this));error=(M(this),A(this));scrollContainer=(H(this),I(this));scrollWait=(V(this),j(this));scrollIgnoreHash=(D(this),W(this));trigger=(K(this),U(this,sG));currentRoute=void G(this);currentParams={};get #B(){return"function"==typeof this.scrollContainer?this.scrollContainer():this.scrollContainer}#z=t({content:s6});#F=()=>{if(!this.locationStore)return;let{path:t,query:e,hash:n,data:i}=sG.getParams();this.locationStore({path:t,params:this.currentParams,query:e,hash:n,data:i})};#J;#Y=async()=>{let t=this.#B,e=sG.currentKey;if(!t||e===this.#J)return;this.#J=e;let n=s5.get(e);if(!s9&&void 0!==n){await this.scrollWait?.(),e===sG.currentKey&&t.scroll(0,n);return}(s9||t!==document.scrollingElement)&&(this.scrollIgnoreHash||!sG.getParams().hash)&&t.scroll(0,0)};#Z;#Q=(t,e,n)=>{this.beforeroutechange(t),this.#Z=void 0,this.currentRoute=t,this.currentParams=e;let i=async()=>{this.#z({content:n}),this.#F(),await Promise.resolve(),this.#Y(),this.routechange(this.currentRoute)};this.transition&&"startViewTransition"in document?document.startViewTransition(()=>i()):i()};#K=q(this,()=>{if(this.scrollContainer)return nf(sG,"beforechange",()=>{s9=globalThis.history.state?.$key===sG.currentKey;let t=this.#B;t&&s5.set(sG.currentKey,t.scrollTop)})});#U=(B(this),z(this,()=>this.trigger.store&&nM(this.trigger.store,()=>this.#z())));#G=(F(this),()=>{let{path:t,query:e,hash:n}=this.trigger.getParams();return[this.key,t,e,n]});#q=J(this,([t,e],n)=>{n&&t===n[0]&&e===n[1]?this.#F():this.update()});#o=(Y(this),Z(this,()=>{let{content:t}=this.#z;if(void 0!==t){if(!this.shadowRoot){if(t===s6)return;return nA`${t}`}return t===s6?nA`<slot></slot>`:t}}));update=(Q(this),async()=>{let{path:t,hash:e,query:n}=this.trigger.getParams(),{route:i,params:s={}}=ts.findRoute(this.routes,t),{redirect:r,content:a,getContent:o}=i||{};if(r)return void this.trigger.replace({path:s8({pattern:r},{params:s}),query:n,hash:e});this.trigger===sG&&(location.href!==sq.url||i?.title)&&sq({url:location.href,title:i?.title});let l=a||o?.(s,this.shadowRoot||this);this.loading(i),this.#Z=l;let h=()=>this.#Z===l;try{let t=await l;h()&&this.#Q(i,s,t)}catch(t){h()&&this.error(t)}})}];createLocationStore=()=>{let{path:t,query:e,hash:n,data:i}=sG.getParams();return nR({path:t,query:e,hash:n,data:i,params:{}})};findRoute=(t=[],e)=>{let n=null;for(let i of Array.isArray(t)?t:Object.values(t))if("*"===i.pattern)n=i;else{let t=s3(i.pattern,e);if(t)return{route:i,params:t}}return{route:n}}};let s7=nJ`
|
|
4
|
-
:host(:where(:not([hidden]))),
|
|
5
|
-
:not(:defined) {
|
|
6
|
-
display: contents;
|
|
7
|
-
}
|
|
8
|
-
`;X=iM(),tt=iN(s7),tn=ti;class rt extends tn{static{({c:[ts,te]}=sF(this,[X,tt],[],0,void 0,tn))}static{te()}}function re(t){return!t.startsWith("/")}let rn=nJ`
|
|
1
|
+
let t,e,n,i,s,r,a,o,l,h,c,u,d,p,f,m,g,y,b,_,$,S,v,w,E,C,x,L,P,k,T,N,O,R,M,A,H,I,V,D,j,W,K,U,G,q,B,z,F,J,Y,Z,Q,X,tt,te,tn,ti,ts,tr,ta,to,tl,th,tc,tu,td,tp,tf,tm,tg,ty,tb,t_,t$,tS,tv,tw,tE,tC,tx,tL,tP,tk,tT,tN,tO,tR,tM,tA,tH,tI,tV,tD,tj,tW,tK,tU,tG,tq,tB,tz,tF,tJ,tY,tZ,tQ,tX,t0,t1,t2,t3,t8,t4,t6,t5,t9,t7,et,ee,en,ei,es,er,ea,eo,el,eh,ec,eu,ed,ep,ef,em,eg,ey,eb,e_,e$,eS,ev,ew,eE,eC,ex,eL,eP,ek,eT,eN,eO,eR,eM,eA,eH,eI,eV,eD,ej,eW,eK,eU,eG,eq,eB,ez,eF;let eJ=globalThis.trustedTypes,eY=eJ?.createPolicy("lit-html",{createHTML:t=>t}),eZ="$lit$",eQ=`lit$${Math.random().toFixed(9).slice(2)}$`,eX="?"+eQ,e0=`<${eX}>`,e1=document,e2=()=>e1.createComment(""),e3=t=>null===t||"object"!=typeof t&&"function"!=typeof t,e8=t=>null==t,e4=`[
|
|
2
|
+
\f\r]`,e6=`[^
|
|
3
|
+
\f\r"'\`<>=]`,e5=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,e9=/-->/g,e7=/>/g,nt=RegExp(`>|${e4}(?:([^\\s"'>=/]+)(${e4}*=${e4}*(?:${e6}|("|')|))|$)`,"g"),ne=/'/g,nn=/"/g,ni=/^(?:script|style|textarea|title)$/i,ns="v-if",nr="v-else-if",na="v-else";class no{type;strings;values;constructor(t,e,n){this.type=t,this.strings=e,this.values=n}}let nl=t=>(e,...n)=>new no(t,e,n),nh=nl(1),nc=nl(2),nu=nl(3),nd=Symbol.for("lit-noChange"),np=new WeakMap,nf=e1.createTreeWalker(e1,129);class nm{el;parts=[];constructor({strings:t,type:e},n){let i,s=0,r=0,a=t.length-1,o=this.parts,[l,h]=((t,e)=>{let n,i=t.length-1,s=[],r=2===e?"<svg>":3===e?"<math>":"",a=e5;for(let e=0;e<i;e++){let i,o,l=t[e],h=-1,c=0;for(;c<l.length&&(a.lastIndex=c,null!==(o=a.exec(l)));)c=a.lastIndex,a===e5?"!--"===o[1]?a=e9:void 0!==o[1]?a=e7:void 0!==o[2]?(ni.test(o[2])&&(n=RegExp(`</${o[2]}`,"g")),a=nt):void 0!==o[3]&&(a=nt):a===nt?">"===o[0]?(a=n??e5,h=-1):void 0===o[1]?h=-2:(h=a.lastIndex-o[2].length,i=o[1],a=void 0===o[3]?nt:'"'===o[3]?nn:ne):a===nn||a===ne?a=nt:a===e9||a===e7?a=e5:(a=nt,n=void 0);let u=a===nt&&t[e+1].startsWith("/>")?" ":"";r+=a===e5?l+e0:h>=0?(s.push(i),l.slice(0,h)+eZ+l.slice(h)+eQ+u):l+eQ+(-2===h?e:u)}let o=r+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"");return[function(t,e){if(!Array.isArray(t))throw Error("invalid template");return void 0!==eY?eY.createHTML(e):e}(t,o),s]})(t,e);if(this.el=nm.createElement(l,n),nf.currentNode=this.el.content,2===e||3===e){let t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=nf.nextNode())&&o.length<a;){if(1===i.nodeType){if(i.hasAttributes())for(let t of i.getAttributeNames())if(t.endsWith(eZ)){let e=h[r++],n=i.getAttribute(t).split(eQ),a=/([.?@])?(.*)/.exec(e);o.push({type:1,index:s,name:a[2],strings:n,ctor:"."===a[1]?nS:"?"===a[1]?nv:"@"===a[1]?nw:n$}),i.removeAttribute(t)}else t.startsWith(eQ)&&(o.push({type:6,index:s}),i.removeAttribute(t));if(ni.test(i.tagName)){let t=i.textContent.split(eQ),e=t.length-1;if(e>0){i.textContent=eJ?eJ.emptyScript:"";for(let n=0;n<e;n++)i.append(t[n],e2()),nf.nextNode(),o.push({type:2,index:++s});i.append(t[e],e2())}}}else if(8===i.nodeType)if(i.data===eX)o.push({type:2,index:s});else{let t=-1;for(;-1!==(t=i.data.indexOf(eQ,t+1));)o.push({type:7,index:s}),t+=eQ.length-1}s++}}static createElement(t,e){let n=e1.createElement("template");return n.innerHTML=t,n}}function ng(t,e,n=t,i){if(e===nd)return e;let s=void 0!==i?n.__directives?.[i]:n.__directive,r=e3(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$notifyDirectiveConnectionChanged?.(!1),void 0===r?s=void 0:(s=new r(t))._$initialize(t,n,i),void 0!==i?(n.__directives??=[])[i]=s:n.__directive=s),void 0!==s&&(e=ng(t,s._$resolve(t,e.values),s,i)),e}class ny{_$template;_$parts=[];_$conditions=[];_$parent;_$disconnectableChildren=void 0;constructor(t,e){this._$template=t,this._$parent=e}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(t){let{el:{content:e},parts:n}=this._$template,i=new Map,s=new Map,r=(t?.creationScope??e1).importNode(e,!0);nf.currentNode=r;let a=nf.nextNode(),o=0,l=0,h=n[0];for(;void 0!==h;){if(o===h.index){let e;2===h.type?e=new n_(a,a.nextSibling,this,t):1===h.type?(h.name===ns&&i.set(a,l),h.name===nr&&s.set(a,l),e=new h.ctor(a,h.name,h.strings,this,t)):6===h.type&&(e=new nE(a,this,t)),this._$parts.push(e),h=n[++l]}o!==h?.index&&(a=nf.nextNode(),o++)}let c=new Map;for(let t of(i.forEach((t,e)=>{let n=new nb(e,t);this._$conditions.push(n),c.set(e,n);let i=e;for(;i=i.nextElementSibling;){let t=s.get(i);if(void 0===t)break;n.push(i,t)}}),this._$parts)){if(t?.type!==2)continue;let e=c.get(t._$endNode);e&&(t._$endNode=e.mark)}return nf.currentNode=e1,r}_update(t){let e=0;for(let n of this._$parts)void 0!==n&&(void 0!==n.strings?(n._$setValue(t,n,e),e+=n.strings.length-2):n.name===ns||n.name===nr||n._$setValue(t[e])),e++;this._$conditions.forEach(e=>e.update(t))}}class nb{mark;list;constructor(t,e){let n=e2();n._$chain=this,t.before(n),this.mark=n,this.list=[{ele:t,idx:e}],this.check()}get next(){return this.list.at(-1).ele.nextElementSibling}push(t,e){this.list.push({ele:t,idx:e}),this.check()}check(){let t=this.next;t?.attributes.getNamedItem(na)&&(this.list.push({ele:t}),t.removeAttribute(na))}update(t){let{mark:e,list:n}=this,i=n.find(({idx:e})=>void 0===e||!!t[e]);i&&!i.ele.parentNode&&e.after(i.ele),n.forEach(({ele:t})=>(!i||t!==i.ele)&&t.remove())}}class n_{type=2;options;_$committedValue;__directive;_$startNode;_$endNode;_$parent;__isConnected;get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}_$disconnectableChildren=void 0;constructor(t,e,n,i){this._$startNode=t,this._$endNode=e,this._$parent=n,this.options=i,this.__isConnected=i?.isConnected??!0}get parentNode(){let t=this._$startNode.parentNode,e=this._$parent;return void 0!==e&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(t,e=this){this.parentNode&&(e3(t=ng(this,t,e))?e8(t)||""===t?(e8(this._$committedValue)||this._$clear(),this._$committedValue=void 0):t!==this._$committedValue&&t!==nd&&this._commitText(t):t instanceof no?this._commitTemplateResult(t):void 0!==t.nodeType?this._commitNode(t):Symbol.iterator in t?this._commitIterable(t):this._commitText(t))}_insert(t){return this._$startNode.parentNode.insertBefore(t,this._$endNode)}_commitNode(t){this._$committedValue!==t&&(this._$clear(),this._$committedValue=this._insert(t))}_commitText(t){!e8(this._$committedValue)&&e3(this._$committedValue)?this._$startNode.nextSibling.data=t:this._commitNode(e1.createTextNode(t)),this._$committedValue=t}_commitTemplateResult(t){let{values:e}=t,n=this._$getTemplate(t);if(this._$committedValue?._$template===n)this._$committedValue._update(e);else{let t=new ny(n,this),i=t._clone(this.options);t._update(e),this._commitNode(i),this._$committedValue=t}}_$getTemplate(t){let e=np.get(t.strings);return void 0===e&&np.set(t.strings,e=new nm(t)),e}_commitIterable(t){let e;Array.isArray(this._$committedValue)||(this._$committedValue=[],this._$clear());let n=this._$committedValue,i=0;for(let s of t)i===n.length?n.push(e=new n_(this._insert(e2()),this._insert(e2()),this,this.options)):e=n[i],e._$setValue(s),i++;i<n.length&&(this._$clear(e&&e._$endNode.nextSibling,i),n.length=i)}_$clear(t=this._$startNode.nextSibling,e){for(this._$notifyConnectionChanged?.(!1,!0,e);t&&t!==this._$endNode;){let e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$parent&&(this.__isConnected=t,this._$notifyConnectionChanged?.(t))}}class n${type=1;element;name;options;strings;_$committedValue;__directives;_$parent;_$disconnectableChildren=void 0;get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(t,e,n,i,s){this.element=t,this.name=e,this._$parent=i,this.options=s,n.length>2||""!==n[0]||""!==n[1]?(this._$committedValue=Array(n.length-1).fill(new String),this.strings=n):this._$committedValue=void 0}_$setValue(t,e=this,n,i){let s=this.strings,r=!1;if(void 0===s)(r=!e3(t=ng(this,t,e,0))||t!==this._$committedValue)&&(this._$committedValue=t);else{let i,a,o=t;for(t=s[0],i=0;i<s.length-1;i++)a=ng(this,o[n+i],e,i),r||=!e3(a)||a!==this._$committedValue[i],e8(a)?t=void 0:e8(t)||(t+=a+s[i+1]),this._$committedValue[i]=a}r&&!i&&this._commitValue(t)}_commitValue(t){e8(t)?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t)}}class nS extends n${type=3;_commitValue(t){this.element[this.name]=t}}class nv extends n${type=4;_commitValue(t){this.element.toggleAttribute(this.name,!!t)}}class nw extends n${type=5;_$setValue(t,e=this){t=ng(this,t,e,0);let n=this._$committedValue,i=n&&(!t||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive),s=t&&(!n||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$committedValue=t}handleEvent(t){"function"==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,t):this._$committedValue.handleEvent(t)}}class nE{element;type=6;__directive;_$committedValue;_$parent;_$disconnectableChildren=void 0;_$props;options;constructor(t,e,n){this.element=t,this._$parent=e,this.options=n}get _$isConnected(){return this._$parent._$isConnected}_$setValue(t){if(t)if(t instanceof nx)t.value=this.element;else if(t._$litDirective$)ng(this,t);else{if(this._$props)for(let t in this._$props)Reflect.set(this.element,t,void 0);Object.assign(this.element,t),this._$props=t}}}let nC=()=>new nx;class nx{value}let nL=(t,e,n)=>{let i=n?.renderBefore??e,s=i._$litPart$;if(void 0===s){let t=n?.renderBefore??null;i._$litPart$=s=new n_(e.insertBefore(e2(),t),t,void 0,n??{})}return s._$setValue(t),s},{get:nP,set:nk,has:nT,deleteProperty:nN,defineProperty:nO,getOwnPropertyDescriptor:nR,ownKeys:nM}=Reflect,nA=globalThis.__GEM_SSR__,nH=!!nA,nI={},nV=nA?(t,e)=>{let n=nA();return n?(n.has(t)||n.set(t,e()),n.get(t)):t}:t=>t,nD=nA?t=>{let e=()=>({...t});return new Proxy(t,{get:(n,i)=>nP(nV(t,e),i),set:(n,i,s)=>nk(nV(t,e),i,s),has:(n,i)=>nT(nV(t,e),i),deleteProperty:(n,i)=>nN(nV(t,e),i),defineProperty:(n,i,s)=>nO(nV(t,e),i,s),getOwnPropertyDescriptor:(n,i)=>nR(nV(t,e),i),ownKeys:()=>nM(nV(t,e))})}:t=>t,{assign:nj,fromEntries:nW,entries:nK,keys:nU,defineProperty:nG,hasOwn:nq}=Object,nB=new Set,nz=()=>new Set;function nF(t){let e=nV(nB,nz);!e.has(t)&&(Promise.resolve().then(()=>{e.delete(t),t()}),e.add(t))}function nJ(t,e){for(let n of["name","length"])e&&nq(e,n)&&nG(t,n,{value:e[n],writable:!0,enumerable:!0,configurable:!0});nj(t,e)}function nY(t,e){return delete e.name,delete e.length,nJ(e,t),e}function nZ(t="",e=""){let{pathname:n,search:i,hash:s}=new URL(e,location.origin+t);return n+i+decodeURIComponent(s)}function nQ(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}class nX extends EventTarget{#t=new Map;#e;#n;#i(t){let e=this.#t.get(t);return e&&(e.prev?e.prev.next=e.next:this.#e=e.next,e.next?e.next.prev=e.prev:this.#n=e.prev,this.#t.delete(t)),e}get size(){return this.#t.size}get first(){return this.#e}get last(){return this.#n}isSuperLinkOf(t,e=!1){let n=t.first;if(!n)return!0;let i=e?this.#e:this.find(n.value);for(;i&&n;){if(i.value===n.value)n=n.next;else if(!e)return!1;i=i.next}return!n}find(t){return this.#t.get(t)}add(t){this.#n||this.dispatchEvent(new CustomEvent("start"));let e=this.#i(t)||{value:t};e.prev=this.#n,e.prev&&(e.prev.next=e),e.next=void 0,this.#n=e,this.#e||(this.#e=e),this.#t.set(t,e)}delete(t){let e=this.#i(t);return this.#e||this.dispatchEvent(new CustomEvent("end")),e}clear(){this.#t.clear(),this.#e=this.#n=void 0}get(){let t=this.#e;if(t)return this.delete(t.value),t.value}}class n0 extends WeakMap{get(t){let e=super.get(t);return e||(e={},this.set(t,e)),e}}class n1 extends URLSearchParams{concat(t){nK("string"==typeof t?nW(new URLSearchParams(t).entries()):t).forEach(([t,e])=>{this.append(t,this.#s(e))})}#s=t=>"string"==typeof t?t:JSON.stringify(t);setAny(t,e){if(Array.isArray(e))this.delete(t),e.forEach(e=>this.append(t,this.#s(e)));else{let n=this.#s(e);n?this.set(t,n):this.delete(t)}}#r=t=>{if(!t)return null;try{return JSON.parse(t)}catch{return null}};getAny(t){return this.getAnyAll(t)[0]}getAnyAll(t){return this.getAll(t).filter(t=>""!==t).map(t=>this.#r(t))}toString(){let t=super.toString();return t?`?${t}`:""}toJSON(){return this.toString()}}function n2(t,...e){return t.reduce((t,n,i)=>t+(e[i-1]??"")+n)}let n3=n2;function n8(t=5){let e=Math.random().toString(36).slice(2,2+t);return e.length<t?e+n8(t-e.length):e}function n4(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function n6(t){return t.replace(/-(.)/g,(t,e)=>e.toUpperCase())}function n5(t){return nU(t).forEach(e=>{delete t[e]}),t}class n9 extends Error{constructor(t){super(t),this.message=`gem: ${this.message}`}}function n7(t,e){let n=t.length;if(e.length!==n)return!0;for(let i=0;i<n;i++)if(t[i]!==e[i])return!0;return!1}function it(t,e,n){let i=e;for(let s in t){let r=n(s,t[s]);i+=r?r+e:""}return i}function ie(t){return it(t,";",(t,e)=>e||0===e?`${n4(t)}:${e}`:"")}function ii(t){return it(t," ",(t,e)=>e?t:"")}let is=ii;function ir(t){return it(t,",",(t,e)=>!0===e||t===e?t:e?`${t}:${e}`:"")}let ia=new WeakMap,io=()=>new Set;function il(t,e){let n=io(),i=nD(nY(t,t=>{nJ(i,t),n.forEach(nF),nH&&(nV(n,io).forEach(nF),e&&nI.updateStore?.(e,i))}));return e&&nJ(i,nI.createStore?.(e)),ia.set(i,n),i}function ih(t,e){let n=ia.get(t),i=n&&nV(n,io);return i?.add(e),()=>i?.delete(e)}let ic=(t,...e)=>n2(t,...e.map(t=>t instanceof Element?t.outerHTML:t)),iu=(t,e)=>e.innerHTML=t;function id(t,e){ic=t,iu=e}let ip=(t,e)=>nI.render?.(t,e)||iu(t,e),{assign:im,defineProperty:ig}=Object;ig(Symbol,"metadata",{value:Symbol.for("Symbol.metadata")});let iy=t=>"function"==typeof t&&t(),ib=Symbol.for("gem@sheetToken"),i_=Symbol.for("gem@update"),i$="gem-style-boundary",iS="gem@render-error",iv=new WeakMap;class iw extends CSSStyleSheet{#a;cssText="";get element(){return this.#a||(this.#a=document.createElement("style"),this.#a.textContent=this.cssText),this.#a}replaceSync(t){this.cssText=t,this.#a&&(this.#a.textContent=t),super.replaceSync(t)}}class iE{#o="";#l="";constructor(t=""){this.#l=t}setContent(t){this.#o=t}#h=new Map;#c({sheet:t,scope:e}){t.replaceSync(e?`${e}{ ${this.#o} }`:this.#o)}getStyle(t,e){let n=t&&!t.internals?.shadowRoot,i=n?t.constructor:this,s=this.#h.get(i);if(!s){let r=n?e?"@scope":`@scope (${t.tagName}) to (:state(${i$}) > *)`:"";s={sheet:new iw({media:this.#l}),scope:r},this.#h.set(i,s),this.#c(s)}return s.sheet}updateStyle(){this.#h.forEach(t=>this.#c(t))}}function iC(t,...e){let n="",i="",s=e.at(0);Array.isArray(t)?i=n2(t,...e):void 0!==s?(n=t,i=s):i=t;let r=new iE(n),a={[ib]:r},o="";return"string"==typeof i?o=i:Object.keys(i).forEach(t=>{let e="$"===t;a[t]=e||t.includes("-")?t:`${t}-${n8()}`,o+=`${e?":where(&:not([hidden])),:host(:where(:not([hidden])))":`.${a[t]}`} {${i[t]}}`}),r.setContent(o),a}let ix=({counts:t,update:e},n,i)=>{let s=!1;n.forEach(e=>{let n=t.get(e)||0;s||=1===i&&0===n||-1===i&&1===n,t.set(e,n+i)}),s&&nF(e)};function iL(t,e){iy(t.preCallback),t.preCallback=t.callback(e,t.values),t.values=e,t.initialized=!0}function iP(t){t.forEach(t=>{let e=t.getDep?.();(!t.getDep||!t.values||n7(t.values,e))&&iL(t,e)})}function ik(t){return t.filter(t=>(iy(t.preCallback),t.preCallback=void 0,t.initialized=!1,t.values=void 0,t.fixed))}let iT=new nX,iN=(t=performance.now())=>{if(performance.now()>t+50)return requestAnimationFrame(iN);let e=iT.get();if(e){try{e()}catch(t){reportError(t)}iN(t)}};iT.addEventListener("start",()=>nF(iN));class iO extends HTMLElement{#u;#d;#p=[];#f=[];#m=[];#g;#y;#b;#_;#$;[i_](){this.#S()}static{t=t=>{let e=n,i=nY(t,t=>{let n=e.#p.at(0);if(!nH&&e.#y&&n&&!n.initialized)throw new n9("Don't set state sync before insert the DOM");nJ(i,t),e.#_||e.#S()});return e.#d.stateList.push(i),i},e=(t,e)=>t.#m.push(e)}constructor(){let t;super(),n=this;let{aria:e,mode:i,delegatesFocus:s,...r}=this.#v,{focusable:a,...o}=e||{};this.#u=i?this.shadowRoot||this.attachShadow({mode:i,delegatesFocus:s,...r}):this,this.#d=this.attachInternals(),this.#u===this||this.#d.shadowRoot||ig(this.#d,"shadowRoot",{value:this.#u}),this.#d.stateList=[],this.#d.sheets=[],im(this.#d,o),this.#p.push({fixed:!0,getDep:()=>[this.disabled],callback:([e=!1])=>{if(void 0===t&&(t=this.hasAttribute("tabindex")),this.#d.ariaDisabled=String(e),a&&!t&&(this.tabIndex=-Number(e)),(a||s)&&e)return nQ(this,"click",t=>t.isTrusted&&t.stopImmediatePropagation(),{capture:!0})}})}get #v(){return this.constructor[Symbol.metadata]}get #w(){return this.#m.findLast(t=>!t.condition||t.condition())}get internals(){return this.#d}#E=()=>{iP(this.#p)};#C=t=>{try{this.#_=!0,iP(this.#f);let e=this.#u===this,n=t?t.render():e?void 0:ic`<slot></slot>`;if(void 0===n)return;let i=n??(e?ic`<style>@scope{&{display:none!important;}}</style>`:ic`<style>:host{&{display:none!important;}}</style>`);ip(i,this.#u)}catch(e){let t=new CustomEvent(iS,{bubbles:!0,composed:!0,cancelable:!0,detail:e});if(this.dispatchEvent(t))throw e}finally{this.#_=!1}};#x=()=>{let t=this.#w;this.#y&&(t||!this.#m.length)&&(this.#C(t),nH||nF(this.#E))};#L=t=>{this.#v.noBlocking&&!nH?iT.add(t):t()};#P=()=>this.#L(this.#x);#S=()=>{this.#y&&nF(this.#P)};#k=()=>{let{adoptedStyleSheets:t=[]}=this.#v,{shadowRoot:e,sheets:n}=this.#d,i=t.map(t=>t[ib].getStyle(this));if(!e)return this.prepend(...n.map(t=>t.element)),((t,e)=>{let n=t.getRootNode(),i=iv.get(n);if(!i){let t=new Map;i={counts:t,update:()=>{let e=(n.adoptedStyleSheets||[]).filter(e=>!t.has(e));t.forEach((t,n)=>t&&e.push(n)),n.adoptedStyleSheets=e.reverse()}},iv.set(n,i)}return ix(i,e,1),()=>ix(i,e,-1)})(this,i);e.adoptedStyleSheets=i.concat(n)};#T=()=>{this.#p.forEach(t=>!t.initialized&&iL(t,t.getDep?.()))};#N=()=>{this.willMount&&this.memo(this.willMount.bind(this),()=>[]),this.mounted&&this.effect(this.mounted.bind(this),()=>[]),this.updated&&this.effect((t,e)=>e&&this.updated.apply(this)),this.unmounted&&this.effect(()=>this.unmounted.bind(this),()=>[]),!this.#m.length&&this.render&&this.#m.push({render:this.render.bind(this),condition:this.shouldUpdate?.bind(this)})};#O;#R=()=>{if(this.#g){this.#g=!1,this.#$?.(),this.#$=this.#k();return}if(nI.connect?.(this,this.#R))return;this.#b=!0,this.#N();let{observedStores:t,mode:e,penetrable:n}=this.#v;this.#d.states.add("gem-element"),e||!this.#m.length||n||this.#d.states.add(i$),this.#O=t?.map(t=>ih(t,this.#P)),this.#C(this.#w),this.#y=!0,this.#$=this.#k(),nH||nF(this.#T)};connectedCallback(){this.#L(this.#R)}disconnectedCallback(){if(this.isConnected){this.#g=!0;return}iT.delete(this.#R),iT.delete(this.#x),this.#y=!1,this.#O?.forEach(t=>t()),this.#p=ik(this.#p),this.#f=ik(this.#f),this.#$?.()}effect=(t,e)=>{let n={callback:t,getDep:e,fixed:!this.#b};this.#y&&iL(n,e?.()),this.#p.push(n)};memo=(t,e)=>{this.#f.push({callback:t,getDep:e,fixed:!this.#b})};update=()=>this.#S()}let{deleteProperty:iR,getOwnPropertyDescriptor:iM,defineProperty:iA}=Reflect,{getPrototypeOf:iH,assign:iI,hasOwn:iV}=Object,iD=new n0;function ij(t,e,n){let i=t.metadata;iM(i,e)||iA(i,e,{value:i[e]?.filter(t=>t!==n)||[]}),i[e].push(n)}function iW(t,e,n,i){let s=t.name;ij(t,e,n),t.addInitializer(function(){let e=iY(this,t);iV(e,s)||i(e,s),function(t,e){let{value:n}=iM(t,e)||{};iR(t,e),t[e]=n}(this,s)})}let{setAttribute:iK,toggleAttribute:iU,removeAttribute:iG}=Element.prototype,iq=(t,e)=>t.constructor[Symbol.metadata]?.attrProps?.[e];function iB(){}iO.prototype.setAttribute=function(t,e){let n=iq(this,t);if(!n)return iK.call(this,t,e);this[n]=e},iO.prototype.removeAttribute=function(t){let e=iq(this,t);if(!e)return iG.call(this,t);this[e]=null},iO.prototype.toggleAttribute=function(t,e){let n=iq(this,t);return n?this[n]=e??!this.hasAttribute(t):iU.call(this,t,e)};let iz=Symbol("event handle");function iF(t,e,{attr:n,attrType:i,event:s,eventOptions:r}={}){iA(t,e,{configurable:!0,get(){let t=iD.get(this)[e];return s&&!t?(this[e]=iB,this[e]):t},set(t){let a=this,o=iD.get(a);n&&((t=i===Boolean&&""===t||i(t||""))?iK.call(this,n,i===Boolean?"":t):iG.call(this,n)),t!==o[e]&&(s?(o[e]=t?.[iz]?t:async(e,n)=>{await Promise.resolve();let i=new CustomEvent(s,{...n,...r,detail:e});a.dispatchEvent(i),await t(e,n)},o[e][iz]=!0):(o[e]=t,this[i_]()))}})}let iJ=new WeakMap;function iY(t,{metadata:e}){let n=iJ.get(e);if(n)return n;let i=t;do i=iH(i);while(i.constructor[Symbol.metadata]!==e);return iJ.set(e,i),i}function iZ(t,e){let n=t.name,i=n4(n),s=t.metadata;return iV(s,"attrProps")||(s.attrProps=Object.create(s.attrProps||null)),s.attrProps[i]=n,iW(t,"observedAttributes",i,t=>iF(t,n,{attr:i,attrType:e})),function(t){return this.getAttribute(i)??t}}function iQ(t,e){return iZ(e,String)}function iX(t,e){return iZ(e,Boolean)}function i0(t,e){return iZ(e,Number)}function i1(t,e){let n=e.name;return iW(e,"observedProperties",n,iF),function(t){return this[n]??t}}function i2(t){return(e,n)=>{let{addInitializer:i,name:s,access:r,kind:a}=n;i(function(){let e=t&&(()=>t(this));if("getter"===a){if(n.private)throw new n9("not support");let t=iM(iY(this,n),s).get.bind(this);this.memo(()=>{iA(this,s,{configurable:!0,value:t()})},e)}else this.memo(r.get.call(this,this).bind(this),e)})}}function i3(t){return(e,{addInitializer:n,access:i})=>{n(function(){this.effect(i.get.call(this,this).bind(this),t&&(()=>t(this)))})}}function i8(){return(t,{addInitializer:e,access:n})=>{e(function(){this.effect(()=>n.get.call(this,this).bind(this),()=>[])})}}function i4(){return i2(()=>[])}function i6(){return i3(()=>[])}function i5(t){return(n,{addInitializer:i,access:s})=>{i(function(){e(this,{render:s.get.call(this,this).bind(this),condition:t&&(()=>t(this))})})}}function i9(){return(t,{addInitializer:e,access:n})=>{e(function(){this.addEventListener(iS,t=>{t.preventDefault(),ip(n.get.call(this,this).apply(this,[t.detail]),this.internals.shadowRoot||this)})})}}function i7(t,e){let n=n4(e.name);iW(e,"definedCSSStates",n,(t,e)=>{iA(t,e,{configurable:!0,get(){let{states:t}=this.internals;return t?.has(n)},set(t){let{states:e}=this.internals;t?e?.add(n):e?.delete(n)}})})}function st(t,e,n,i){let s=t.name,r=n4(s);if(t.static)ij(t,n,r);else{let i=iH(e);i[s]||(i[s]=r,ij(t,n,r))}return i||r}function se(t,e){return function(t){return st(e,this,"definedSlots",t)}}function sn(t,e){return function(t){return st(e,this,"definedParts",t)}}function si(t,e){sr(e)}function ss(t,e){sr(e,{bubbles:!0,composed:!0})}function sr(t,e){let n=n4(t.name);iW(t,"definedEvents",n,(t,i)=>iF(t,i,{event:n,eventOptions:e}))}function sa(t){return(e,n)=>{ij(n,"adoptedStyleSheets",t)}}function so(t){return(e,n)=>{ij(n,"observedStores",t)}}function sl({mode:t="open",serializable:e=!0,...n}={}){return(i,s)=>{iI(s.metadata,{mode:t,serializable:e,...n})}}function sh({penetrable:t}){return(e,n)=>{n.metadata.penetrable=t}}function sc(){return(t,e)=>{e.metadata.noBlocking=!0}}function su(t){return(e,n)=>{let i=n.metadata;i.aria={...i.aria,...t}}}function sd(t){return(e,{addInitializer:n})=>{n(()=>{customElements.define(t,e)})}}let sp=t=>(...e)=>({_$litDirective$:t,values:e});class sf{__part;__attributeIndex;__directive;_$parent;_$disconnectableChildren;get _$isConnected(){return this._$parent._$isConnected}_$initialize(t,e,n){this.__part=t,this._$parent=e,this.__attributeIndex=n}_$resolve(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}let sm=(t,e,n)=>{let i=t._$startNode.parentNode,s=void 0===e?t._$endNode:e._$startNode;if(void 0===n)n=new n_(i.insertBefore(document.createComment(""),s),i.insertBefore(document.createComment(""),s),t,t.options);else{let e=n._$endNode.nextSibling,r=n._$parent,a=r!==t;if(a){let e;n._$reparentDisconnectables?.(t),n._$parent=t,void 0!==n._$notifyConnectionChanged&&(e=t._$isConnected)!==r._$isConnected&&n._$notifyConnectionChanged(e)}if(e!==s||a){let t=n._$startNode;for(;t!==e;){let e=t.nextSibling;i.insertBefore(t,s),t=e}}}return n},sg=(t,e,n=t)=>(t._$setValue(e,n),t),sy={},sb=(t,e=sy)=>t._$committedValue=e,s_=t=>{t._$notifyConnectionChanged?.(!1,!0);let e=t._$startNode,n=t._$endNode.nextSibling;for(;e!==n;){let t=e.nextSibling;e.remove(),e=t}},s$=(t,e,n)=>{let i=new Map;for(let s=e;s<=n;s++)i.set(t[s],s);return i},sS=sp(class extends sf{_itemKeys;constructor(t){if(super(),2!==t.type)throw Error("repeat() can only be used in text expressions")}_getValuesAndKeys(t,e,n){let i;void 0===n?n=e:void 0!==e&&(i=e);let s=[],r=[],a=0;for(let e of t)s[a]=i?i(e,a):a,r[a]=n(e,a),a++;return{values:r,keys:s}}render(t,e,n){return this._getValuesAndKeys(t,e,n).values}update(t,[e,n,i]){let s,r,a=t._$committedValue,{values:o,keys:l}=this._getValuesAndKeys(e,n,i);if(!Array.isArray(a))return this._itemKeys=l,o;let h=this._itemKeys??=[],c=[],u=0,d=a.length-1,p=0,f=o.length-1;for(;u<=d&&p<=f;)if(null===a[u])u++;else if(null===a[d])d--;else if(h[u]===l[p])c[p]=sg(a[u],o[p]),u++,p++;else if(h[d]===l[f])c[f]=sg(a[d],o[f]),d--,f--;else if(h[u]===l[f])c[f]=sg(a[u],o[f]),sm(t,c[f+1],a[u]),u++,f--;else if(h[d]===l[p])c[p]=sg(a[d],o[p]),sm(t,a[u],a[d]),d--,p++;else if(void 0===s&&(s=s$(l,p,f),r=s$(h,u,d)),s.has(h[u]))if(s.has(h[d])){let e=r.get(l[p]),n=void 0!==e?a[e]:null;if(null===n){let e=sm(t,a[u]);sg(e,o[p]),c[p]=e}else c[p]=sg(n,o[p]),sm(t,a[u],n),a[e]=null;p++}else s_(a[d]),d--;else s_(a[u]),u++;for(;p<=f;){let e=sm(t,c[f+1]);sg(e,o[p]),c[p++]=e}for(;u<=d;){let t=a[u++];null!==t&&s_(t)}return this._itemKeys=l,sb(t,c),nd}}),sv=Symbol(),sw=sp(class extends sf{#M=sv;render(t,e){return e}update(t,[e,n]){return this.#M!==sv&&e!==this.#M&&sb(t),this.#M=e,n}});id(nh,nL);let sE={GemElement:iO,setEngine:id,html:nh,render:nL,css:iC,createState:t,version:"2.3.3"};globalThis.__GEM_DEVTOOLS__HOOK__&&!globalThis.__GEM_DEVTOOLS__HOOK__.GemElement&&Object.assign(globalThis.__GEM_DEVTOOLS__HOOK__,sE);let sC=globalThis.history,sx=sC.pushState.bind(sC),sL=sC.replaceState.bind(sC),sP=0,sk=()=>`${performance.now()}-${++sP}`,sT=il({$hasCloseHandle:!1,$hasOpenHandle:!1,$hasShouldCloseHandle:!1,$key:""}),sN=new Map,sO=()=>new Map([...sN].map(([t,e])=>[t,{...e}])),sR=["$key","$hasCloseHandle","$hasOpenHandle","$hasShouldCloseHandle"];function sM(t){return t===sW.basePath?"/":t.replace(RegExp(`^${sW.basePath}/`),"/")}function sA(t){sW.dispatchEvent(new CustomEvent("beforechange")),n5(sT),sT(t)}function sH(t){let e=sW.getParams()||{path:sM(location.pathname),query:new n1,title:document.title},n=t.path?nZ(e.path,t.path):sM(location.pathname),i=new n1(t.query??(t.path?"":location.search)),s=String(i)!==String(e.query),r=s?i:e.query,a=n!==e.path||s,o=t.title||(a?"":e.title),l=t.close||t.data||t.open||t.shouldClose,h=decodeURIComponent(t.hash??(!a&&l?location.hash:""));return{...t,title:o,path:n,query:r,hash:h}}function sI(t,e){var n=t.data;if(sT.$key!==n?.$key){for(let t of sR)if(n?.[t])throw new n9(`\`${t}\` is not allowed`)}let i=sH(t),{title:s,path:r,query:a,hash:o,close:l,open:h,shouldClose:c,data:u}=i,d={$hasCloseHandle:!!l,$hasOpenHandle:!!h,$hasShouldCloseHandle:!!c,$key:sk(),$title:s,...u};nV(sN,sO).set(d.$key,i),sA(d);let p=(sW.basePath?sW.basePath+r:r)+new n1(a)+o,f=decodeURIComponent(location.hash);e(d,s,p),f!==o&&dispatchEvent(new CustomEvent("hashchange"))}function sV(t,e,n,i){let{pathname:s,search:r,hash:a}=new URL(n,location.origin+location.pathname);sI({path:s,query:r,hash:a,title:e,data:t},i)}let sD=il({basePath:""});class sj extends EventTarget{get store(){return sT}get currentKey(){return sT.$key}get basePath(){return sD.basePath}set basePath(t){sD({basePath:t}),Object.assign(this.getParams(),{path:sM(location.pathname)})}getParams(){return nV(sN,sO).get(sT.$key)}updateParams(t){Object.assign(this.getParams(),t),sT()}push(t){sI(t,sx)}replace(t){sI(t,sL)}pushIgnoreCloseHandle(t){sT.$hasCloseHandle?(this.getParams()?.close?.(),this.replace(t)):this.push(t)}forward(){sC.forward()}back(){sC.back()}}let sW=new sj,sK=il({defaultTitle:document.title,url:"",title:""});if(!globalThis._GEMHISTORY){if(globalThis._GEMHISTORY={history:sW,titleStore:sK,basePathStore:sD},sC.pushState=(t,e,n)=>{sV(t,e,n,sx)},sC.replaceState=(t,e,n)=>{sV(t,e,n,sL)},addEventListener("hashchange",({isTrusted:t})=>{t&&sW.replace({hash:location.hash})}),sC.state)if(sC.state.$hasCloseHandle){sT(sC.state);let t=sH({title:document.title});nV(sN,sO).set(sT.$key,t),sW.back()}else{let t=sH({title:document.title,hash:location.hash});sT({$key:sk(),...sC.state||{}}),nV(sN,sO).set(sT.$key,t)}else{let{protocol:t,pathname:e,search:n,hash:i}=location;(t.startsWith("http")||t.startsWith("tauri"))&&sW.replace({path:e,query:n,hash:i})}ih(sK,()=>{let t=sW.getParams();t&&(t.title=sK.title)}),ih(sT,()=>{let{title:t}=sW.getParams();t!==sK.title&&sK({title:t})});let t=!1;addEventListener("popstate",e=>{let n=e.state;if(n?.$key){if(t){t=!1;return}if(!nV(sN,sO).has(n.$key)){let{pathname:t,search:e,hash:i}=location;nV(sN,sO).set(n.$key,{path:sM(t),query:new n1(e),hash:decodeURIComponent(i),title:sK.title||n.$title,data:n})}if(parseFloat(n.$key)>parseFloat(sT.$key)&&n.$hasOpenHandle)nV(sN,sO).get(n.$key)?.open?.();else if(sT.$hasCloseHandle){let e=nV(sN,sO).get(sT.$key),i=e?.close,s=e?.shouldClose;if(s&&!s()){t=!0,sW.forward();return}i?i():n.$hasCloseHandle&&(t=!0,sW.back())}sA(n)}})}let{history:sU,titleStore:sG,basePathStore:sq}=globalThis._GEMHISTORY,sB=/^[\w\-./~]*/,sz=new Map;function sF(t,e){let n=sz.get(t);return n||sz.set(t,n=function(t){let e=sB.exec(t)[0];if(e===t)return e=>e===t?{}:null;if("*"===t)return t=>({0:t});if(!globalThis.URLPattern){let e,n,i;return e=0,n=t.replace(/:[^/$]+|\*/g,t=>"*"===t?`(?<_${e++}>.*)`:`(?<${t.slice(1)}>[^/]+)`),i=RegExp(`^${n}$`),t=>{let e=t.match(i);if(!e)return null;let n={};for(let t in e.groups)n[t.startsWith("_")?t.slice(1):t]=e.groups[t];return n}}let n=new URLPattern({pathname:t}),i=e.replace(/\/$/,"");return t=>t.startsWith(i)?n.exec({pathname:t})?.pathname.groups:null}(t)),n(e)||n(`${e}/`)||null}function sJ(t,e){let n=0,i=t.pattern.replaceAll("*",()=>`:${n++}`),s=e?.params;return s&&Object.keys(s).forEach(t=>{i=i.replace(RegExp(`:${t}`,"g"),s[t])}),i}function sY(t,e){return{path:sJ(t,e),...e}}function sZ(t,e,n){"symbol"==typeof e&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:n?n+" "+e:e})}catch(t){}return t}function sQ(t,e,n,i,s,r){var a,o,l,h,c,u,d,p=Symbol.metadata||Symbol.for("Symbol.metadata"),f=Object.defineProperty,m=Object.create,g=[m(null),m(null)],y=e.length;function b(e,n,i){return function(s,r){n&&(r=s,s=t);for(var a=0;a<e.length;a++)r=e[a].apply(s,i?[r]:[]);return i?r:s}}function _(t,e,n,i){if("function"!=typeof t&&(i||void 0!==t))throw TypeError(e+" must "+(n||"be")+" a function"+(i?"":" or undefined"));return t}function $(t,e,n,i,s,r,a,o,l,h,c){function p(t){if(!c(t))throw TypeError("Attempted to access private element on non-instance")}var m=[].concat(e[0]),y=e[3],$=!a,S=1===s,v=3===s,w=4===s,E=2===s;function C(e,n,i){return function(s,r){return n&&(r=s,s=t),i&&i(s),x[e].call(s,r)}}var x={},L=[],P=v?"get":w||S?"set":"value";if(!$&&(l?(h||S?x={get:sZ(function(){return y(this)},i,"get"),set:function(t){e[4](this,t)}}:x[P]=y,h||sZ(x[P],i,E?"":P)):h||(x=Object.getOwnPropertyDescriptor(t,i)),!h&&!l)){if((d=g[+o][i])&&(d^s)!=7)throw Error("Decorating two elements with the same name ("+x[P].name+") is not supported yet");g[+o][i]=s<3?1:s}for(var k=t,T=m.length-1;T>=0;T-=n?2:1){var N=_(m[T],"A decorator","be",!0),O=n?m[T-1]:void 0,R={},M={kind:["field","accessor","method","getter","setter","class"][s],name:i,metadata:u,addInitializer:(function(t,e){if(t.v)throw TypeError("attempted to call addInitializer after decoration was finished");_(e,"An initializer","be",!0),r.push(e)}).bind(null,R)};if($){d=N.call(O,k,M),R.v=1,_(d,"class decorators","return")&&(k=d);continue}if(M.static=o,M.private=l,d=M.access={has:l?c.bind():function(t){return i in t}},w||(d.get=l?E?function(t){return p(t),x.value}:C("get",0,p):function(t){return t[i]}),E||v||(d.set=l?C("set",0,p):function(t,e){t[i]=e}),k=N.call(O,S?{get:x.get,set:x.set}:x[P],M),R.v=1,S){if("object"==typeof k&&k)(d=_(k.get,"accessor.get"))&&(x.get=d),(d=_(k.set,"accessor.set"))&&(x.set=d),(d=_(k.init,"accessor.init"))&&L.unshift(d);else if(void 0!==k)throw TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(k,(h?"field":"method")+" decorators","return")&&(h?L.unshift(k):x[P]=k)}return s<2&&a.push(b(L,o,1),b(r,o,0)),h||$||(l?S?a.splice(-1,0,C("get",o),C("set",o)):a.push(E?x[P]:_.call.bind(x[P])):f(t,i,x)),k}function S(t){return f(t,p,{configurable:!0,enumerable:!0,value:u})}return void 0!==r&&(u=r[p]),u=m(null==u?null:u),l=[],h=function(t){t&&l.push(b(t))},(c=function(e,i){for(var r=0;r<n.length;r++){var h=n[r],c=h[1],u=7&c;if((8&c)==e&&!u==i){var d=h[2],p=!!h[3],f=16&c;$(e?t:t.prototype,h,f,p?"#"+d:function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(d),u,u<2?[]:e?o=o||[]:a=a||[],l,!!e,p,i,e&&p?function(e){return function(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(null!==t?typeof t:"null"));return t}(e)===t}:s)}}})(8,0),c(0,0),c(8,1),c(0,1),h(a),h(o),d=l,y||S(t),{e:d,get c(){var v=[];return y&&[S(t=$(t,[e],i,t.name,5,v)),b(v,1)]}}}let sX=Symbol();i=so(sU.store),s=su({role:"dialog",ariaModal:"true"}),a=iO,o=i4();class s0 extends a{static{({e:[l,h,c,u,d,p],c:[f,r]}=sQ(this,[i,s],[[iQ,0,"label"],[i7,0,"opened"],[o,0,"init",function(t){return t.#A},function(t,e){t.#A=e}]],0,t=>#A in t,a))}label=l(this);opened=(h(this),c(this));#H=void u(this);#I;#V=[];#D=()=>{this.inert=!0,this.#V.forEach(t=>t.inert=!1),this.#H?this.#H.before(this):this.#I&&this.#I?.appendChild(this),this.dispatchEvent(new CustomEvent("close")),this.opened=!1};#j=()=>{this.hidden=!1,this.inert=!1,this.#H=this.nextSibling,this.#I=this.parentElement||this.getRootNode(),this.#V=[...document.body.children].filter(t=>!t.inert),this.#V.forEach(t=>t.inert=!0),document.body.append(this),this.dispatchEvent(new CustomEvent("open")),this.opened=!0};#A=d(this,()=>this.inert=!0);open=(p(this),()=>{if(!this.opened)return this.#j(),sU.push({title:this.label,open:this.#j,close:this.#D,shouldClose:this.shouldClose}),sX});shouldClose(){return!0}close=()=>(sU.back(),sX);forceClose=()=>(this.opened=!1,setTimeout(this.close,100),sX);static{r()}}function s1(t){return t}let s2=Symbol("open mark"),s3=Symbol();function s8(t){let e,n,i,s,r,a,o,l,h,c,u;return e=sl(),n=su({role:"alertdialog",ariaModal:"true"}),s=iO,r=i6(),a=i6(),new class extends s1{constructor(){super(u),i()}static [class extends s{static{({e:[o,l,h,c],c:[u,i]}=sQ(this,[e,n],[[r,0,"connectHistory",function(t){return t.#W},function(t,e){t.#W=e}],[a,0,"connectStore",function(t){return t.#K},function(t,e){t.#K=e}]],0,t=>#W in t,s))}constructor(...t){super(...t),c(this)}static get isOpen(){return this.store[s2]}static open(t){let e=new this;this.instance=e,this.inertStore=[...document.body.children].filter(t=>!t.inert),this.inertStore.forEach(t=>t.inert=!0),document.body.append(e);let n=()=>this.store({[s2]:!0,...t});return setTimeout(()=>{n(),sU.push({title:e.label,open:n,close:this.closeHandle.bind(this),shouldClose:this.shouldClose.bind(this)})},100),s3}static close(){return sU.back(),s3}static closeHandle(){return this.inertStore.forEach(t=>t.inert=!1),this.instance?.remove(),this.store({[s2]:!1,...t}),s3}static shouldClose(){return!0}label="";#W=o(this,()=>ih(sU.store,this.update));#K=(l(this),h(this,()=>ih(u.store,this.update)))}];inertStore=[];instance=null;store=il({[s2]:!1,...t})},u}function s4(t){return!t.startsWith("/")}let s6=iC`
|
|
9
4
|
:host {
|
|
10
5
|
/* link default style */
|
|
11
6
|
cursor: pointer;
|
|
@@ -19,11 +14,16 @@ let t,e,n,i,s,r,a,o,l,h,c,u,d,p,f,m,g,y,b,_,$,S,v,w,E,C,P,L,x,k,T,O,N,R,M,A,H,I,
|
|
|
19
14
|
a:visited {
|
|
20
15
|
color: unset;
|
|
21
16
|
}
|
|
22
|
-
`;
|
|
17
|
+
`;m=so(sq),g=sa(s6),y=sl(),b=su({focusable:!0}),$=iO,S=i6(),v=i5(),new class extends s1{constructor(){super(to),_()}static [class extends ${static{({e:[z,w,E,C,x,L,P,k,T,N,O,R,M,A,H,I,V,D,j,W,K,U,G,q,B,F,J,Y],c:[to,_]}=sQ(this,[m,g,y,b],[[sn,8,"link"],[iQ,0,"href"],[iQ,0,"target"],[iQ,0,"path"],[iQ,0,"query"],[iQ,0,"hash"],[iQ,0,"hint"],[iX,0,"preload"],[i1,0,"route"],[i1,0,"options"],[i1,0,"routeOptions"],[i1,0,"prepare"],[S,2,"init",function(){this.addEventListener("click",this.#U),this.addEventListener("pointerenter",this.#G)}],[v,0,"content",function(t){return t.#o},function(t,e){t.#o=e}]],0,t=>#A in t,$))}constructor(...t){super(...t),J(this)}href=(Y(this),C(this));target=(x(this),L(this));path=(P(this),k(this));query=(T(this),N(this));hash=(O(this),R(this));hint=(M(this),A(this));preload=(H(this),I(this));route=(V(this),D(this));options=(j(this),W(this));routeOptions=(K(this),U(this));prepare=(G(this),q(this));get #q(){return this.routeOptions||this.options}get #B(){return this.hint||"on"}#U=(B(this),async t=>{t.preventDefault();let e=this._getLocationString();if(!e)return;if(s4(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}let{path:n,query:i,hash:s}=sU.getParams();if(n+i+s!==e)if(await this.prepare?.(),this.route)sU.pushIgnoreCloseHandle(sY(this.route,this.#q));else if(this.href){let t=new URL(e,location.origin);sU.pushIgnoreCloseHandle({path:t.pathname,query:t.search,hash:t.hash})}else sU.pushIgnoreCloseHandle({path:this.path,query:this.query,hash:this.hash})});#z=()=>{let t=this._getLocationString();if(s4(t))return t;let e=new URL(sU.basePath+t,location.origin);return nH?e.pathname+e.search+e.hash:e.toString()};#G=()=>{this.route?.content,this.route?.getContent?.({},this.shadowRoot)};get #A(){return z}#o=F(this,()=>{let t="off"===this.#B?null:this.#z();return ic`<a part=${to.link} href=${t} tabindex="-1"><slot></slot></a>`});_getLocationString(){if(this.route){let t=this.#q?.query||"",e=this.#q?.hash||"";return sJ(this.route,this.#q)+t+e}{let t=this.href||this.path+this.query+this.hash,{path:e,query:n}=sU.getParams();return t.startsWith("#")?`${e}${n}${t}`:t.startsWith("?")?`${e}${t}`:t.startsWith(".")?nZ(e,t):t}}}];link=(()=>{let t=w();return E(),t})()},Z=so(sU.store),X=to,tt=i3();class s5 extends X{static{({e:[te,tn,ti,ts,tr,ta],c:[tl,Q]}=sQ(this,[Z],[[iQ,0,"pattern"],[i7,0,"active"],[tt,0,"updateState",function(t){return t.#F},function(t,e){t.#F=e}]],0,t=>#F in t,X))}constructor(...t){super(...t),ta(this)}pattern=te(this);active=(tn(this),ti(this));#F=(ts(this),tr(this,()=>{let{path:t,query:e,hash:n}=sU.getParams(),i=this.pattern&&sF(this.pattern,t);this.active=!!i||t+e+n===this._getLocationString()}));static{Q()}}customElements.define("gem-link",to),customElements.define("gem-active-link",tl);let s9="gem-reflect-end",s7=t=>new Comment(t),rt=new WeakSet,re=new WeakMap;function rn(t){let e=t.parentNode;if(e&&rt.has(e)){let e=(t=>{for(let e=t.previousSibling;e;e=e.previousSibling){let t=re.get(e);if(t)return t;if(e.nodeValue===s9)return}})(t);if(e)return e}return e instanceof ShadowRoot?e.host:t.parentElement}th=i4(),tc=i3(t=>[t.target]);class ri extends iO{static{({e:[tu,td,tp,tf,tm,tg,ty,tb]}=sQ(this,[],[[iQ,0,"method"],[i1,0,"target"],[th,0,"init",function(t){return t.#A},function(t,e){t.#A=e}],[tc,0,"changeTarget",function(t){return t.#J},function(t,e){t.#J=e}]],0,t=>#A in t))}constructor(...t){super(...t),tb(this)}method=tu(this);target=(td(this),tp(this,document.head));get #Y(){return this.method||"append"}#A=(tf(this),tm(this,()=>{this.hidden=!0}));#Z=(tg(this),s7("gem-reflect-start"));#Q=s7(s9);#X;#J=ty(this,()=>(rt.add(this.target),re.set(this.#Z,this),(this.#X||[this.#Z,...this.childNodes,this.#Q]).forEach((t,e,n)=>{let i=n[e-1];i?i.after(t):this.target[this.#Y](t)}),()=>{this.#X=(t=>{let e=[],n=t;for(;n&&(e.push(n),n.nodeValue!==s9);)n=n.nextSibling;return e})(this.#Z),this.#X.forEach(t=>t.remove())}))}customElements.define("gem-reflect",ri);let rs=ic``,rr=new Map,ra=!1;t_=sh({penetrable:!0}),tS=iO,tv=i3(t=>[t.scrollContainer]),tw=i3(t=>[t.scrollContainer]),tE=i5(t=>!t.inert),new class extends s1{constructor(){super(t5),t$()}static [class extends tS{static{({e:[tC,tx,tL,tP,tk,tT,tN,tO,tR,tM,tA,tH,tI,tV,tD,tj,tW,tK,tU,tG,tq,tB,tz,tF,tJ,tY,tZ,tQ,tX,t0,t1,t2],c:[t5,t$]}=sQ(this,[t_],[[iX,0,"transition"],[i1,0,"routes"],[i1,0,"locationStore"],[i1,0,"key"],[si,0,"loading"],[si,0,"beforeroutechange"],[si,0,"routechange"],[si,0,"error"],[i1,0,"scrollContainer"],[i1,0,"scrollWait"],[i1,0,"scrollIgnoreHash"],[i1,0,"trigger"],[tv,0,"rememberScrollPosition",function(t){return t.#tt},function(t,e){t.#tt=e}],[tw,0,"connectTriggerStore",function(t){return t.#te},function(t,e){t.#te=e}],[i3(t=>t.#tn()),0,"updateContent",function(t){return t.#ti},function(t,e){t.#ti=e}],[tE,0,"content",function(t){return t.#o},function(t,e){t.#o=e}]],0,t=>#tt in t,tS))}transition=tC(this);routes=(tx(this),tL(this));locationStore=(tP(this),tk(this));key=(tT(this),tN(this));loading=(tO(this),tR(this));beforeroutechange=(tM(this),tA(this));routechange=(tH(this),tI(this));error=(tV(this),tD(this));scrollContainer=(tj(this),tW(this));scrollWait=(tK(this),tU(this));scrollIgnoreHash=(tG(this),tq(this));trigger=(tB(this),tz(this,sU));currentRoute=void tF(this);currentParams={};get #ts(){return"function"==typeof this.scrollContainer?this.scrollContainer():this.scrollContainer}#tr=t({content:rs});#ta=()=>{if(!this.locationStore)return;let{path:t,query:e,hash:n,data:i}=sU.getParams();this.locationStore({path:t,params:this.currentParams,query:e,hash:n,data:i})};#to;#tl=async()=>{let t=this.#ts,e=sU.currentKey;if(!t||e===this.#to)return;this.#to=e;let n=rr.get(e);if(!ra&&void 0!==n){await this.scrollWait?.(),e===sU.currentKey&&t.scroll(0,n);return}(ra||t!==document.scrollingElement)&&(this.scrollIgnoreHash||!sU.getParams().hash)&&t.scroll(0,0)};#th;#tc=(t,e,n)=>{this.beforeroutechange(t),this.#th=void 0,this.currentRoute=t,this.currentParams=e;let i=async()=>{this.#tr({content:n}),this.#ta(),await Promise.resolve(),this.#tl(),this.routechange(this.currentRoute)};this.transition&&"startViewTransition"in document?document.startViewTransition(()=>i()):i()};#tt=tJ(this,()=>{if(this.scrollContainer)return nQ(sU,"beforechange",()=>{ra=globalThis.history.state?.$key===sU.currentKey;let t=this.#ts;t&&rr.set(sU.currentKey,t.scrollTop)})});#te=(tY(this),tZ(this,()=>this.trigger.store&&ih(this.trigger.store,()=>this.#tr())));#tn=(tQ(this),()=>{let{path:t,query:e,hash:n}=this.trigger.getParams();return[this.key,t,e,n]});#ti=tX(this,([t,e],n)=>{n&&t===n[0]&&e===n[1]?this.#ta():this.update()});#o=(t0(this),t1(this,()=>{let{content:t}=this.#tr;if(void 0!==t){if(!this.shadowRoot){if(t===rs)return;return ic`${t}`}return t===rs?ic`<slot></slot>`:t}}));update=(t2(this),async()=>{let{path:t,hash:e,query:n}=this.trigger.getParams(),{route:i,params:s={}}=t9.findRoute(this.routes,t),{redirect:r,content:a,getContent:o}=i||{};if(r)return void this.trigger.replace({path:sJ({pattern:r},{params:s}),query:n,hash:e});this.trigger===sU&&(location.href!==sG.url||i?.title)&&sG({url:location.href,title:i?.title});let l=a||o?.(s,this.shadowRoot||this);this.loading(i),this.#th=l;let h=()=>this.#th===l;try{let t=await l;h()&&this.#tc(i,s,t)}catch(t){h()&&this.error(t)}})}];createLocationStore=()=>{let{path:t,query:e,hash:n,data:i}=sU.getParams();return il({path:t,query:e,hash:n,data:i,params:{}})};findRoute=(t=[],e)=>{let n=null;for(let i of Array.isArray(t)?t:Object.values(t))if("*"===i.pattern)n=i;else{let t=sF(i.pattern,e);if(t)return{route:i,params:t}}return{route:n}}};let ro=iC`
|
|
18
|
+
:host(:where(:not([hidden]))),
|
|
19
|
+
:not(:defined) {
|
|
20
|
+
display: contents;
|
|
21
|
+
}
|
|
22
|
+
`;t3=sl(),t8=sa(ro),t6=t5;class rl extends t6{static{({c:[t9,t4]}=sQ(this,[t3,t8],[],0,void 0,t6))}static{t4()}}customElements.define("gem-route",t9),customElements.define("gem-light-route",t5);let rh=0,rc=t=>{clearTimeout(rh),rh=setTimeout(()=>document.title=t)};t7=sl(),ee=iO,en=i3(t=>[t.inert]),ei=i6(),es=i5(),new class extends s1{constructor(){super(ey),et()}static [class extends ee{static{({e:[er,ea,eo,el,eh,ec,eu,ed,ep,ef,em,eg],c:[ey,et]}=sQ(this,[t7],[[iQ,0,"prefix"],[iQ,0,"suffix"],[iX,0,"inert"],[en,0,"connectStore",function(t){return t.#K},function(t,e){t.#K=e}],[ei,0,"obTextContent",function(t){return t.#tu},function(t,e){t.#tu=e}],[es,0,"content",function(t){return t.#o},function(t,e){t.#o=e}]],0,t=>#K in t,ee))}constructor(...t){super(...t),eg(this)}prefix=er(this);suffix=(ea(this),eo(this));inert=(el(this),eh(this));static setTitle(t){sG({title:t})}#K=(ec(this),eu(this,()=>!this.inert&&ih(sG,this.update)));#td=(ed(this),new MutationObserver(()=>this.update()));#tu=ep(this,()=>{this.#td.observe(this,{characterData:!0,childList:!0,subtree:!0})});#o=(ef(this),em(this,()=>(!function(t,e="",n=""){let i=sG.title||t;i&&i!==sG.defaultTitle?rc(e+(ey.title=i)+n):rc(ey.title=sG.defaultTitle)}(this.textContent?.trim(),this.prefix,this.suffix),ic`${ey.title}`)))}];title=document.title},customElements.define("gem-title",ey);let ru=iC`
|
|
23
23
|
:host(:where(:not([hidden]))) {
|
|
24
24
|
display: contents;
|
|
25
25
|
}
|
|
26
|
-
`;eb=
|
|
26
|
+
`;eb=sl(),e_=sa(ru),eS=iO,ev=i3(),ew=i5();class rd extends eS{static{({e:[eE,eC,ex,eL,eP,ek,eT,eN],c:[eO,e$]}=sQ(this,[eb,e_],[[iQ,0,"html"],[i1,0,"styles"],[ev,0,"adoptStyles",function(t){return t.#tp},function(t,e){t.#tp=e}],[ew,0,"content",function(t){return t.#o},function(t,e){t.#o=e}]],0,t=>#tp in t,eS))}constructor(...t){super(...t),eN(this)}html=eE(this);styles=(eC(this),ex(this));get #h(){if(!this.styles)return[];if("string"!=typeof this.styles)return[this.styles].flat().map(t=>t[ib].getStyle());{let t=new CSSStyleSheet;return t.replaceSync(this.styles),[t]}}#tp=(eL(this),eP(this,()=>{let t=this.shadowRoot.adoptedStyleSheets;return this.shadowRoot.adoptedStyleSheets=t.concat(this.#h),()=>{this.shadowRoot.adoptedStyleSheets=t}}));#o=(ek(this),eT(this,()=>{this.shadowRoot.innerHTML=this.html}));static{e$()}}customElements.define("gem-unsafe",eO);let rp=iC`
|
|
27
27
|
:host(:where(:not([hidden]))) {
|
|
28
28
|
position: relative;
|
|
29
29
|
display: inline-flex;
|
|
@@ -33,4 +33,4 @@ let t,e,n,i,s,r,a,o,l,h,c,u,d,p,f,m,g,y,b,_,$,S,v,w,E,C,P,L,x,k,T,O,N,R,M,A,H,I,
|
|
|
33
33
|
width: 100%;
|
|
34
34
|
height: 100%;
|
|
35
35
|
}
|
|
36
|
-
`,rm=new Map,rg=new Map;eR=iM(),eM=iN(rf),eH=n2,eI=iw();class ry extends eH{static{({e:[eV,ej,eD,eW,eK,eU,eG,eq,eB,ez],c:[eF,eA]}=sF(this,[eR,eM],[[ip,0,"selector"],[iy,0,"root"],[iy,0,"element"],[iC,0,"active"],[eI,0,"content",function(t){return t.#o},function(t,e){t.#o=e}]],0,t=>#o in t,eH))}constructor(...t){super(...t),ez(this)}selector=eV(this);root=(ej(this),eD(this));element=(eW(this),eK(this));active=(eU(this),eG(this));#tp=(eq(this),()=>{let t=this.element||(this.selector?(this.root||document).querySelector(this.selector):null);if("string"==typeof t&&e9){let e=rg.get(t);return e||(e=Object.assign([t],{raw:[t]}),rg.set(t,e)),nA(e)}if("string"==typeof t){let e=rm.get(t);return e||((e=document.createElement("template")).innerHTML=t,rm.set(t,e)),e.content.cloneNode(!0)}return t instanceof HTMLTemplateElement?t.content.cloneNode(!0):t?.cloneNode(!0)});#o=eB(this,()=>nA`${this.#tp()}<slot></slot>`);static{eA()}}customElements.define("gem-use",eF);class rb{#tf;get #tm(){return`[${this.#tf}]`}constructor(t){this.#tf=t}info=(...t)=>{console.log(this.#tm,...t)};warn=(...t)=>{console.warn(this.#tm,...t)};error=(...t)=>{console.error(this.#tm,...t)}}let r_=new rb("GEM"),r$=/\$\d(?:<[^>]*>)?/,rS=/\$(\d)(<([^>]*)>)?/g;function rv(t,...e){let n,i=t.split(r$),s=[];for(;n=rS.exec(t);){let t=n[3],i=e[Number(n[1])-1];s.push("function"==typeof i?i(t):i)}return nA(i,...s)}let rw=!1;class rE{resources;fallbackLanguage;cache;cachePrefix="gem-i18n";urlParamsType;urlParamsName;onChange;#z=ne({currentLanguage:"",pending:void 0});#tg=rw;#ty=new Set;get currentLanguage(){return this.#z.currentLanguage}set currentLanguage(t){this.#z.currentLanguage=t}get ready(){return Promise.all([this.#z.pending,...[...this.#ty].map(t=>t.ready)])}replace=({path:t})=>this.setLanguage(t);getParams=()=>({path:this.currentLanguage});get #tb(){return`${this.cachePrefix}:current`}get #t_(){return`i18n:${this.cachePrefix}`}get #t$(){let{hostname:t,pathname:e,search:n}=location,i=t.split(".");switch(this.urlParamsType){case"ccTLD":return i.pop();case"gTLD":return i.shift();case"path":return e.split("/")[1];default:{let t=this.urlParamsName&&new URLSearchParams(n).get(this.urlParamsName)||"";return t in this.resources?t:""}}}get #tS(){return!this.#tg&&this.cache&&localStorage.getItem(this.#tb)||""}set #tv(t){this.#tg||(document.documentElement.lang=t),this.currentLanguage=t,this.onChange?.(t)}#tw=Object.defineProperties({},{currentLanguage:{enumerable:!0,get:()=>this.currentLanguage},currentLanguagePack:{enumerable:!0,get:()=>this.#tE()}});#tC=!0;constructor(t){if(!t.resources[t.fallbackLanguage])throw new nE("i18n: fallbackLanguage invalid");Object.assign(this,t);let e=e9?void 0:e7.createStore?.(this.#t_);e&&(this.resources[e.currentLanguage]=e.currentLanguagePack);let n=this.#tg?this.currentLanguage||e?.currentLanguage:e?.currentLanguage||this.#t$||this.currentLanguage||this.#tS;n?(this.#tv=n,this.setLanguage(n)):this.resetLanguage(),this.#tC=!1}#tP(t){let e=this.resources[t];return e&&"object"==typeof e?e:void 0}#tE(){let t={...this.#tP(this.fallbackLanguage)};for(let[e,n]of Object.entries(this.#tP(this.currentLanguage)||{}))n&&(t[e]=n);return t}get(t,...e){e9&&e7.updateStore?.(this.#t_,this.#tw);let n=this.#tP(this.currentLanguage),i=this.#tP(this.fallbackLanguage),s=n?.[t]||i?.[t];s||!n||i||this.#tL();let r=("object"==typeof s?s.message:s)||`[${t}]`;return e.length?rv(r,...e):r}detectLanguage(){let t=Object.keys(this.resources);for(let e of navigator.languages.map(t=>t.replace(/-(.*)/,t=>t.toUpperCase()))){let n=t.find(t=>t===e||e.startsWith(`${t}-`));if(n)return n}return this.fallbackLanguage}#tx(t){return`${this.cachePrefix}:pack:${t}`}#tk(t){if(this.cache&&!e9)try{return JSON.parse(localStorage.getItem(this.#tx(t))||"null")||void 0}catch{}}#tT(t,e){if(!this.cache||e9)return!1;let n=this.#tx(t),i=JSON.stringify(e);try{if(localStorage.getItem(n)===i)return!1;let e=new Set([t,this.currentLanguage,this.fallbackLanguage].map(t=>this.#tx(t))),s=this.#tx("");for(let t of Object.keys(localStorage))t.startsWith(s)&&!e.has(t)&&localStorage.removeItem(t);localStorage.setItem(n,i)}catch{}return!0}#tO(t){let e=this.resources[t];if("function"!=typeof e)return e;let n=this.#tk(t),i=e().then(e=>{let i=e&&"object"==typeof e.default?e.default:e;return this.resources[t]=i,this.#tT(t,i)&&n&&this.#tN(),i});return n?(i.catch(e=>r_.warn(`${this.cachePrefix}: failed to load \`${t}\``,e)),this.resources[t]=n,n):i}#tR;#tL(){this.#tR||=Promise.resolve(this.#tO(this.fallbackLanguage)).then(()=>this.#tN())}#tN(){let t=[document.documentElement];for(;t.length;){let e=t.pop();e[nU]?.(),t.push(...[...e.children,...e.shadowRoot?.children||[]].reverse())}}setLanguage(t){let e=this.#tM(t);return this.#z.pending=e,e}async #tM(t){if(!this.resources[t])return r_.warn(`${this.cachePrefix}: not found \`${t}\``),this.resetLanguage();let e=[...this.#ty].map(e=>e.setLanguage(t)),n=(e9&&t!==this.fallbackLanguage?[t,this.fallbackLanguage]:[t]).map(t=>this.#tO(t));return n.some(t=>t instanceof Promise)&&await Promise.all(n),this.#tC||this.#tN(),t!==this.currentLanguage&&(this.#tv=t),!0===this.cache&&this.setCache(),await Promise.all(e),t}resetLanguage(){return this.cache&&localStorage.removeItem(this.#tb),this.setLanguage(this.detectLanguage())}setCache(){this.#tg||localStorage.setItem(this.#tb,this.currentLanguage)}createSubModule(t,e){rw=!0;try{let n=new rE({resources:e,cachePrefix:`${this.cachePrefix}-${t}`,currentLanguage:this.currentLanguage,fallbackLanguage:this.fallbackLanguage,cache:this.cache});return this.#ty.add(n),n}finally{rw=!1}}}let rC={PRINT:"print",get isPrint(){return matchMedia(this.PRINT).matches},HOVER:"(hover: hover)",get isHover(){return matchMedia(this.HOVER).matches},PWA:"(display-mode: standalone)",get isPWA(){return matchMedia(this.PWA).matches},MOTION_REDUCE:"(prefers-reduced-motion: reduce)",get isMotionReduce(){return matchMedia(this.MOTION_REDUCE).matches},DATA_REDUCE:"(prefers-reduced-data: reduce)",get isDataReduce(){return matchMedia(this.DATA_REDUCE).matches},WATCH:"(width < 320px)",get isWatch(){return matchMedia(this.WATCH).matches},SMALL_PHONE:"(320px <= width <= 480px) and (height <= 640px)",get isSmallPhone(){return matchMedia(this.SMALL_PHONE).matches},PHONE:"(320px <= width <= 480px)",get isPhone(){return matchMedia(this.PHONE).matches},PHONE_LANDSCAPE:"(480px < width < 960px) and (orientation: landscape)",get isPhoneLandscape(){return matchMedia(this.PHONE_LANDSCAPE).matches},SHORT:"(width >= 480px) and (height <= 320px)",get isShort(){return matchMedia(this.SHORT).matches},TABLET:"(480px < width <= 1280px)",get isTablet(){return matchMedia(this.TABLET).matches},DESKTOP:"(width > 1280px) and (orientation: landscape)",get isDesktop(){return matchMedia(this.DESKTOP).matches},WIDTHSCREEN:"(width >= 1920px) and (orientation: landscape)",get isWidthScreen(){return matchMedia(this.WIDTHSCREEN).matches}},rP=Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)).constructor;function rL(t={}){let{origin:e=location.origin,base:n="",appendHeaders:i=()=>({}),transformInput:s=t=>t,transformOutput:r=t=>t,...a}=t,o=t=>t instanceof FormData||t instanceof Blob||t instanceof rP||t instanceof URLSearchParams||t instanceof ReadableStream||t instanceof ArrayBuffer?t:"object"==typeof t?JSON.stringify(t):t,l=(t,i)=>{if(new URL(t,location.origin).pathname!==t)throw new nE("`path` format is incorrect");let s=new URLSearchParams(i).toString();return`${e}${n}${t}${s?"?":""}${s}`},h=t=>t?t instanceof Headers?Object.fromEntries(t):Object.fromEntries((Array.isArray(t)?t:Object.entries(t)).map(([t,e])=>[t.toLowerCase(),e])):{},c=async(t,e={})=>{let n=new Request(t,{...a,...e,headers:new Headers({"content-type":"application/json",...h(a.headers),...h(e.headers)})}),i=await fetch(n);if(204===i.status)return;if(0===i.status)throw Error("Request fail");if(i.status>=500)throw Error(i.statusText);let s=n.headers.get("content-type"),o=i.status>=400;try{let t;if(t=s.includes("json")?await i.json():s.includes("octet-stream")?await i.arrayBuffer():await i.text(),o)throw Error(i.statusText,{cause:t});return await r(t,n)}catch{throw Error("Parse error")}};return{request:c,async get(t,e){let n=await s(e);return c(l(t,n),{method:"GET",headers:await i(n)})},async del(t,e){let n=await s(e);return c(l(t,n),{method:"DELETE",headers:await i(n)})},async put(t,e){let n=await s(e);return c(l(t),{method:"PUT",headers:await i(n),body:o(n)})},async post(t,e){let n=await s(e);return c(l(t),{method:"POST",headers:await i(n),body:o(n)})}}}let{request:rx,del:rk,get:rT,post:rO,put:rN}=rL(),rR=new WeakMap,rM=new WeakMap;function rA(t){return rR.get(t)}function rH(t){return rM.get(t)}function rI(t,e={},n=n$()){let i=nJ({})[nK],s=nR(t),r=()=>{Object.keys(s).forEach(t=>{e[t]||(e[t]=`--${nS(t)}-${n}`,a[t]=`var(${e[t]})`)})},a=new Proxy(nd({[nK]:i},t=>{s(t),r()}),{get(t,e){if(!t[e]){let[n,i,s]=e.match(/^(\w*Color)(\d+)$/)||[];i&&(t[e]=`oklch(from ${t[i]} calc(l - ${(Number(s)-400)/1e3}) c h)`)}return t[e]}});rM.set(a,e),rR.set(a,s);let o=()=>{r();let t="";Object.keys(s).forEach(n=>{t+=`${e[n]}:${s[n]};`}),i.setContent(`&,:host{${t}}`)};return o(),nM(s,()=>{o(),i.updateStyle()}),a}function rV(t,e){return rI(t,{},e)}function rj(t,e){let n=rV(t,e);return document.adoptedStyleSheets.push(n[nK].getStyle()),n}function rD(t,e){return rI(e,rH(t))}function rW(t,e){let n=rI(t,{},e),i=rH(n);return nd(n,e=>(n,{addInitializer:s,access:r})=>{s(function(){let n=rI({...t},i),s=n[nK].getStyle(this,!0);this.internals.sheets.push(s),this.memo(()=>{if(e9||CSS.supports("font:-apple-system-body"))return n(r.get(this).apply(this));let t=r.get(this).apply(this),e=s.cssRules[0],a=this.shadowRoot?e:s.element?.sheet?.cssRules[0]?.cssRules?.[0];for(let e in i)a?.style.setProperty(i[e],t[e])},e&&(()=>e(this)))})})}export{n2 as GemElement,nE as GemError,rh as GemReflectElement,rE as I18n,nm as LinkedList,rb as Logger,ng as PropProxyMap,ny as QueryString,nK as SheetToken,i5 as TemplateResult,nU as UpdateToken,tQ as GemActiveLinkElement,f as GemDialogBaseElement,ti as GemLightRouteElement,tZ as GemLinkElement,ts as GemRouteElement,ey as GemTitleElement,eN as GemUnsafeElement,eF as GemUseElement,nq as _RenderErrorEvent,nO as _StoreListenerMap,e as _createTemplate,nV as _renderRoot,np as absoluteLocation,nf as addListener,nc as addMicrotask,iN as adoptedStyle,nu as assignState,ip as attribute,sB as basePathStore,im as boolattribute,nS as camelToKebabCase,nx as classMap,nw as cleanObject,nM as connect,iR as connectStore,rW as createDecoratorTheme,s4 as createHistoryParams,s0 as createModalClass,rD as createOverrideTheme,s8 as createPath,sm as createRef,rV as createScopedTheme,t as createState,nR as createStore,rj as createTheme,nd as createUpdater,nJ as css,iV as customElement,iI as aria,iH as async,i_ as effect,ix as part,iC as state,iw as template,rk as del,sb as directive,ik as emitter,nT as exportPartsMap,iE as fallback,rl as getLogicalParent,rH as getThemeProps,rA as getThemeStore,iT as globalemitter,sG as history,nA as html,rL as initRequest,nC as isArrayChange,nv as kebabToCamelCase,iA as light,r_ as logger,s3 as matchPath,se as mathml,rC as mediaQuery,ib as memo,iv as mounted,ig as numattribute,nP as objectMapToString,nk as partMap,rO as post,iy as property,rN as put,n$ as randomStr,nb as raw,nH as render,sC as repeat,rT as get,rx as request,nI as setEngine,iM as shadow,iL as slot,rv as splice,nL as styleMap,n_ as styled,st as svg,sq as titleStore,i$ as unmounted,sy as version,iS as willMount};
|
|
36
|
+
`,rf=new Map,rm=new Map;eR=sl(),eM=sa(rp),eH=iO,eI=i5();class rg extends eH{static{({e:[eV,eD,ej,eW,eK,eU,eG,eq,eB,ez],c:[eF,eA]}=sQ(this,[eR,eM],[[iQ,0,"selector"],[i1,0,"root"],[i1,0,"element"],[i7,0,"active"],[eI,0,"content",function(t){return t.#o},function(t,e){t.#o=e}]],0,t=>#o in t,eH))}constructor(...t){super(...t),ez(this)}selector=eV(this);root=(eD(this),ej(this));element=(eW(this),eK(this));active=(eU(this),eG(this));#tf=(eq(this),()=>{let t=this.element||(this.selector?(this.root||document).querySelector(this.selector):null);if("string"==typeof t&&nH){let e=rm.get(t);return e||(e=Object.assign([t],{raw:[t]}),rm.set(t,e)),ic(e)}if("string"==typeof t){let e=rf.get(t);return e||((e=document.createElement("template")).innerHTML=t,rf.set(t,e)),e.content.cloneNode(!0)}return t instanceof HTMLTemplateElement?t.content.cloneNode(!0):t?.cloneNode(!0)});#o=eB(this,()=>ic`${this.#tf()}<slot></slot>`);static{eA()}}customElements.define("gem-use",eF);class ry{#tm;get #tg(){return`[${this.#tm}]`}constructor(t){this.#tm=t}info=(...t)=>{console.log(this.#tg,...t)};warn=(...t)=>{console.warn(this.#tg,...t)};error=(...t)=>{console.error(this.#tg,...t)}}let rb=new ry("GEM"),r_=/\$\d(?:<[^>]*>)?/,r$=/\$(\d)(<([^>]*)>)?/g;function rS(t,...e){let n,i=t.split(r_),s=[];for(;n=r$.exec(t);){let t=n[3],i=e[Number(n[1])-1];s.push("function"==typeof i?i(t):i)}return ic(i,...s)}let rv=!1;class rw{resources;fallbackLanguage;cache;cachePrefix="gem-i18n";urlParamsType;urlParamsName;onChange;#tr=nD({currentLanguage:"",pending:void 0});#ty=rv;#tb=new Set;get currentLanguage(){return this.#tr.currentLanguage}set currentLanguage(t){this.#tr.currentLanguage=t}get ready(){return Promise.all([this.#tr.pending,...[...this.#tb].map(t=>t.ready)])}replace=({path:t})=>this.setLanguage(t);getParams=()=>({path:this.currentLanguage});get #t_(){return`${this.cachePrefix}:current`}get #t$(){return`i18n:${this.cachePrefix}`}get #tS(){let{hostname:t,pathname:e,search:n}=location,i=t.split(".");switch(this.urlParamsType){case"ccTLD":return i.pop();case"gTLD":return i.shift();case"path":return e.split("/")[1];default:{let t=this.urlParamsName&&new URLSearchParams(n).get(this.urlParamsName)||"";return t in this.resources?t:""}}}get #tv(){return!this.#ty&&this.cache&&localStorage.getItem(this.#t_)||""}set #tw(t){this.#ty||(document.documentElement.lang=t),this.currentLanguage=t,this.onChange?.(t)}#tE=Object.defineProperties({},{currentLanguage:{enumerable:!0,get:()=>this.currentLanguage},currentLanguagePack:{enumerable:!0,get:()=>this.#tC()}});#tx=!0;constructor(t){if(!t.resources[t.fallbackLanguage])throw new n9("i18n: fallbackLanguage invalid");Object.assign(this,t);let e=nH?void 0:nI.createStore?.(this.#t$);e&&(this.resources[e.currentLanguage]=e.currentLanguagePack);let n=this.#ty?this.currentLanguage||e?.currentLanguage:e?.currentLanguage||this.#tS||this.currentLanguage||this.#tv;n?(this.#tw=n,this.setLanguage(n)):this.resetLanguage(),this.#tx=!1}#tL(t){let e=this.resources[t];return e&&"object"==typeof e?e:void 0}#tC(){let t={...this.#tL(this.fallbackLanguage)};for(let[e,n]of Object.entries(this.#tL(this.currentLanguage)||{}))n&&(t[e]=n);return t}get(t,...e){nH&&nI.updateStore?.(this.#t$,this.#tE);let n=this.#tL(this.currentLanguage),i=this.#tL(this.fallbackLanguage),s=n?.[t]||i?.[t];s||!n||i||this.#tP();let r=("object"==typeof s?s.message:s)||`[${t}]`;return e.length?rS(r,...e):r}detectLanguage(){let t=Object.keys(this.resources);for(let e of navigator.languages.map(t=>t.replace(/-(.*)/,t=>t.toUpperCase()))){let n=t.find(t=>t===e||e.startsWith(`${t}-`));if(n)return n}return this.fallbackLanguage}#tk(t){return`${this.cachePrefix}:pack:${t}`}#tT(t){if(this.cache&&!nH)try{return JSON.parse(localStorage.getItem(this.#tk(t))||"null")||void 0}catch{}}#tN(t,e){if(!this.cache||nH)return!1;let n=this.#tk(t),i=JSON.stringify(e);try{if(localStorage.getItem(n)===i)return!1;let e=new Set([t,this.currentLanguage,this.fallbackLanguage].map(t=>this.#tk(t))),s=this.#tk("");for(let t of Object.keys(localStorage))t.startsWith(s)&&!e.has(t)&&localStorage.removeItem(t);localStorage.setItem(n,i)}catch{}return!0}#tO(t){let e=this.resources[t];if("function"!=typeof e)return e;let n=this.#tT(t),i=e().then(e=>{let i=e&&"object"==typeof e.default?e.default:e;return this.resources[t]=i,this.#tN(t,i)&&n&&this.#tR(),i});return n?(i.catch(e=>rb.warn(`${this.cachePrefix}: failed to load \`${t}\``,e)),this.resources[t]=n,n):i}#tM;#tP(){this.#tM||=Promise.resolve(this.#tO(this.fallbackLanguage)).then(()=>this.#tR())}#tR(){let t=[document.documentElement];for(;t.length;){let e=t.pop();e[i_]?.(),t.push(...[...e.children,...e.shadowRoot?.children||[]].reverse())}}setLanguage(t){let e=this.#tA(t);return this.#tr.pending=e,e}async #tA(t){if(!this.resources[t])return rb.warn(`${this.cachePrefix}: not found \`${t}\``),this.resetLanguage();let e=[...this.#tb].map(e=>e.setLanguage(t)),n=(nH&&t!==this.fallbackLanguage?[t,this.fallbackLanguage]:[t]).map(t=>this.#tO(t));return n.some(t=>t instanceof Promise)&&await Promise.all(n),this.#tx||this.#tR(),t!==this.currentLanguage&&(this.#tw=t),!0===this.cache&&this.setCache(),await Promise.all(e),t}resetLanguage(){return this.cache&&localStorage.removeItem(this.#t_),this.setLanguage(this.detectLanguage())}setCache(){this.#ty||localStorage.setItem(this.#t_,this.currentLanguage)}createSubModule(t,e){rv=!0;try{let n=new rw({resources:e,cachePrefix:`${this.cachePrefix}-${t}`,currentLanguage:this.currentLanguage,fallbackLanguage:this.fallbackLanguage,cache:this.cache});return this.#tb.add(n),n}finally{rv=!1}}}let rE={PRINT:"print",get isPrint(){return matchMedia(this.PRINT).matches},HOVER:"(hover: hover)",get isHover(){return matchMedia(this.HOVER).matches},PWA:"(display-mode: standalone)",get isPWA(){return matchMedia(this.PWA).matches},MOTION_REDUCE:"(prefers-reduced-motion: reduce)",get isMotionReduce(){return matchMedia(this.MOTION_REDUCE).matches},DATA_REDUCE:"(prefers-reduced-data: reduce)",get isDataReduce(){return matchMedia(this.DATA_REDUCE).matches},WATCH:"(width < 320px)",get isWatch(){return matchMedia(this.WATCH).matches},SMALL_PHONE:"(320px <= width <= 480px) and (height <= 640px)",get isSmallPhone(){return matchMedia(this.SMALL_PHONE).matches},PHONE:"(320px <= width <= 480px)",get isPhone(){return matchMedia(this.PHONE).matches},PHONE_LANDSCAPE:"(480px < width < 960px) and (orientation: landscape)",get isPhoneLandscape(){return matchMedia(this.PHONE_LANDSCAPE).matches},SHORT:"(width >= 480px) and (height <= 320px)",get isShort(){return matchMedia(this.SHORT).matches},TABLET:"(480px < width <= 1280px)",get isTablet(){return matchMedia(this.TABLET).matches},DESKTOP:"(width > 1280px) and (orientation: landscape)",get isDesktop(){return matchMedia(this.DESKTOP).matches},WIDTHSCREEN:"(width >= 1920px) and (orientation: landscape)",get isWidthScreen(){return matchMedia(this.WIDTHSCREEN).matches}},rC=Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)).constructor;function rx(t={}){let{origin:e=location.origin,base:n="",appendHeaders:i=()=>({}),transformInput:s=t=>t,transformOutput:r=t=>t,...a}=t,o=t=>t instanceof FormData||t instanceof Blob||t instanceof rC||t instanceof URLSearchParams||t instanceof ReadableStream||t instanceof ArrayBuffer?t:"object"==typeof t?JSON.stringify(t):t,l=(t,i)=>{if(new URL(t,location.origin).pathname!==t)throw new n9("`path` format is incorrect");let s=new URLSearchParams(i).toString();return`${e}${n}${t}${s?"?":""}${s}`},h=t=>t?t instanceof Headers?Object.fromEntries(t):Object.fromEntries((Array.isArray(t)?t:Object.entries(t)).map(([t,e])=>[t.toLowerCase(),e])):{},c=async(t,e={})=>{let n=new Request(t,{...a,...e,headers:new Headers({"content-type":"application/json",...h(a.headers),...h(e.headers)})}),i=await fetch(n);if(204===i.status)return;if(0===i.status)throw Error("Request fail");if(i.status>=500)throw Error(i.statusText);let s=n.headers.get("content-type"),o=i.status>=400;try{let t;if(t=s.includes("json")?await i.json():s.includes("octet-stream")?await i.arrayBuffer():await i.text(),o)throw Error(i.statusText,{cause:t});return await r(t,n)}catch{throw Error("Parse error")}};return{request:c,async get(t,e){let n=await s(e);return c(l(t,n),{method:"GET",headers:await i(n)})},async del(t,e){let n=await s(e);return c(l(t,n),{method:"DELETE",headers:await i(n)})},async put(t,e){let n=await s(e);return c(l(t),{method:"PUT",headers:await i(n),body:o(n)})},async post(t,e){let n=await s(e);return c(l(t),{method:"POST",headers:await i(n),body:o(n)})}}}let{request:rL,del:rP,get:rk,post:rT,put:rN}=rx(),rO=new WeakMap,rR=new WeakMap;function rM(t){return rO.get(t)}function rA(t){return rR.get(t)}function rH(t,e={},n=n8()){let i=iC({})[ib],s=il(t),r=()=>{Object.keys(s).forEach(t=>{e[t]||(e[t]=`--${n4(t)}-${n}`,a[t]=`var(${e[t]})`)})},a=new Proxy(nY({[ib]:i},t=>{s(t),r()}),{get(t,e){if(!t[e]){let[n,i,s]=e.match(/^(\w*Color)(\d+)$/)||[];i&&(t[e]=`oklch(from ${t[i]} calc(l - ${(Number(s)-400)/1e3}) c h)`)}return t[e]}});rR.set(a,e),rO.set(a,s);let o=()=>{r();let t="";Object.keys(s).forEach(n=>{t+=`${e[n]}:${s[n]};`}),i.setContent(`&,:host{${t}}`)};return o(),ih(s,()=>{o(),i.updateStyle()}),a}function rI(t,e){return rH(t,{},e)}function rV(t,e){let n=rI(t,e);return document.adoptedStyleSheets.push(n[ib].getStyle()),n}function rD(t,e){return rH(e,rA(t))}function rj(t,e){let n=rH(t,{},e),i=rA(n);return nY(n,e=>(n,{addInitializer:s,access:r})=>{s(function(){let n=rH({...t},i),s=n[ib].getStyle(this,!0);this.internals.sheets.push(s),this.memo(()=>{if(nH||CSS.supports("font:-apple-system-body"))return n(r.get(this).apply(this));let t=r.get(this).apply(this),e=s.cssRules[0],a=this.shadowRoot?e:s.element?.sheet?.cssRules[0]?.cssRules?.[0];for(let e in i)a?.style.setProperty(i[e],t[e])},e&&(()=>e(this)))})})}var rW="2.3.3";export{iO as GemElement,n9 as GemError,ri as GemReflectElement,rw as I18n,nX as LinkedList,ry as Logger,n0 as PropProxyMap,n1 as QueryString,ib as SheetToken,no as TemplateResult,i_ as UpdateToken,tl as GemActiveLinkElement,f as GemDialogBaseElement,t5 as GemLightRouteElement,to as GemLinkElement,t9 as GemRouteElement,ey as GemTitleElement,eO as GemUnsafeElement,eF as GemUseElement,iS as _RenderErrorEvent,ia as _StoreListenerMap,e as _createTemplate,ip as _renderRoot,nZ as absoluteLocation,nQ as addListener,nF as addMicrotask,sa as adoptedStyle,nJ as assignState,iQ as attribute,sq as basePathStore,iX as boolattribute,n4 as camelToKebabCase,ii as classMap,n5 as cleanObject,ih as connect,so as connectStore,rj as createDecoratorTheme,sY as createHistoryParams,s8 as createModalClass,rD as createOverrideTheme,sJ as createPath,nC as createRef,rI as createScopedTheme,t as createState,il as createStore,rV as createTheme,nY as createUpdater,iC as css,sd as customElement,su as aria,sc as async,i3 as effect,sn as part,i7 as state,i5 as template,rP as del,sp as directive,rW as version,si as emitter,ir as exportPartsMap,i9 as fallback,rn as getLogicalParent,rA as getThemeProps,rM as getThemeStore,ss as globalemitter,sU as history,rx as initRequest,n7 as isArrayChange,n6 as kebabToCamelCase,sw as keyed,sh as light,rb as logger,sF as matchPath,nu as mathml,rE as mediaQuery,i2 as memo,i6 as mounted,i0 as numattribute,it as objectMapToString,is as partMap,rT as post,i1 as property,rN as put,n8 as randomStr,n2 as raw,ic as html,iu as render,sS as repeat,rk as get,rL as request,id as setEngine,sl as shadow,se as slot,rS as splice,ie as styleMap,n3 as styled,nc as svg,sG as titleStore,i8 as unmounted,i4 as willMount};
|
package/elements/base/link.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GemElement } from '../../lib/element';
|
|
2
|
-
import type {
|
|
2
|
+
import type { RouteOptions } from '../../lib/history';
|
|
3
|
+
import type { RouteItem } from './route';
|
|
3
4
|
/**
|
|
4
5
|
* Bug: [can't print `<link>`](https://github.com/mantou132/gem/issues/36)
|
|
5
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/elements/base/link.ts"],"names":[],"mappings":"AAcA,OAAO,EAAO,UAAU,EAAQ,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/elements/base/link.ts"],"names":[],"mappings":"AAcA,OAAO,EAAO,UAAU,EAAQ,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAsBzC;;GAEG;AACH,qBAIa,cAAe,SAAQ,UAAU;;IACtC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IAEf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,GAAG,KAAK,CAAC;IAC9B,4CAA4C;IAC7B,OAAO,EAAE,OAAO,CAAC;IAGtB,KAAK,CAAC,EAAE,SAAS,CAAC;IAC5B,iBAAiB;IACP,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAwF/C;;OAEG;IACH,kBAAkB,WAkBjB;CACF;AAED,qBACa,oBAAqB,SAAQ,cAAc;;IAC3C,OAAO,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;CAQxB"}
|
package/elements/base/link.js
CHANGED
|
@@ -38,10 +38,9 @@ var __setFunctionName = (this && this.__setFunctionName) || function (f, name, p
|
|
|
38
38
|
};
|
|
39
39
|
import { adoptedStyle, aria, attribute, boolattribute, connectStore, effect, mounted, part, property, shadow, state, template, } from '../../lib/decorators';
|
|
40
40
|
import { css, GemElement, html } from '../../lib/element';
|
|
41
|
-
import { basePathStore, history } from '../../lib/history';
|
|
41
|
+
import { basePathStore, createHistoryParams, createPath, history, matchPath } from '../../lib/history';
|
|
42
42
|
import { isServer } from '../../lib/server';
|
|
43
43
|
import { absoluteLocation } from '../../lib/utils';
|
|
44
|
-
import { createHistoryParams, createPath, matchPath } from './route';
|
|
45
44
|
function isExternal(path) {
|
|
46
45
|
return !path.startsWith('/');
|
|
47
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/elements/base/link.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,SAAS,EACT,aAAa,EACb,YAAY,EACZ,MAAM,EACN,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,GACT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/elements/base/link.ts"],"names":[],"mappings":"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"}
|
package/elements/base/route.d.ts
CHANGED
|
@@ -4,21 +4,8 @@ import type { UpdateHistoryParams } from '../../lib/history';
|
|
|
4
4
|
import type { TemplateResult } from '../../lib/lit-html';
|
|
5
5
|
import type { Store } from '../../lib/store';
|
|
6
6
|
import type { QueryString } from '../../lib/utils';
|
|
7
|
+
export { createHistoryParams, createPath, matchPath, type RouteOptions } from '../../lib/history';
|
|
7
8
|
type Params = Record<string, string>;
|
|
8
|
-
/**
|
|
9
|
-
* - 大小写敏感
|
|
10
|
-
* - 匹配成功时返回 params
|
|
11
|
-
* - 以 `/` 结尾时能不带 `/` 结尾的路径
|
|
12
|
-
* - `*` 匹配到的 params 名称为数字
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```js
|
|
16
|
-
* matchPath(`/a/b/:c/:d`,`/a/b/1/2`);
|
|
17
|
-
* matchPath(`/a/b/:c/:d`,`/a/b/1/2/`);
|
|
18
|
-
* matchPath(`/a/b/*`,`/a/b/1/2/`);
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export declare function matchPath(pattern: string, path: string): Params | null;
|
|
22
9
|
export interface RouteItem<T = unknown> {
|
|
23
10
|
pattern: string;
|
|
24
11
|
redirect?: string;
|
|
@@ -28,11 +15,6 @@ export interface RouteItem<T = unknown> {
|
|
|
28
15
|
data?: T;
|
|
29
16
|
}
|
|
30
17
|
export type RoutesObject<T = unknown> = Record<string, RouteItem<T>>;
|
|
31
|
-
export interface RouteOptions extends Omit<UpdateHistoryParams, 'path'> {
|
|
32
|
-
params?: Params;
|
|
33
|
-
}
|
|
34
|
-
export declare function createPath(route: RouteItem, options?: RouteOptions): string;
|
|
35
|
-
export declare function createHistoryParams(route: RouteItem, options?: RouteOptions): UpdateHistoryParams;
|
|
36
18
|
export type RouteTrigger = {
|
|
37
19
|
store?: Store<any>;
|
|
38
20
|
replace: (arg: UpdateHistoryParams) => void;
|
|
@@ -101,7 +83,9 @@ export declare class GemLightRouteElement extends GemElement {
|
|
|
101
83
|
};
|
|
102
84
|
static findRoute: (target: RouteItem[] | RoutesObject | undefined, path: string) => {
|
|
103
85
|
route: RouteItem<unknown>;
|
|
104
|
-
params:
|
|
86
|
+
params: {
|
|
87
|
+
[x: string]: string;
|
|
88
|
+
};
|
|
105
89
|
} | {
|
|
106
90
|
params?: undefined;
|
|
107
91
|
route: RouteItem<unknown> | null;
|
|
@@ -110,5 +94,4 @@ export declare class GemLightRouteElement extends GemElement {
|
|
|
110
94
|
}
|
|
111
95
|
export declare class GemRouteElement extends GemLightRouteElement {
|
|
112
96
|
}
|
|
113
|
-
export {};
|
|
114
97
|
//# sourceMappingURL=route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../src/elements/base/route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAoB,UAAU,EAAQ,MAAM,mBAAmB,CAAC;AACvE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../src/elements/base/route.ts"],"names":[],"mappings":"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"}
|
package/elements/base/route.js
CHANGED
|
@@ -34,91 +34,10 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
34
34
|
};
|
|
35
35
|
import { adoptedStyle, boolattribute, effect, emitter, light, property, shadow, template } from '../../lib/decorators';
|
|
36
36
|
import { createState, css, GemElement, html } from '../../lib/element';
|
|
37
|
-
import { history, titleStore } from '../../lib/history';
|
|
37
|
+
import { createPath, history, matchPath, titleStore } from '../../lib/history';
|
|
38
38
|
import { connect, createStore } from '../../lib/store';
|
|
39
39
|
import { addListener } from '../../lib/utils';
|
|
40
|
-
|
|
41
|
-
// 不支持 `URLPattern` 时转换成正则
|
|
42
|
-
// '/test/:a' /^\/test\/(?<a>[^/]+)$/
|
|
43
|
-
// '/test/:a/b' /^\/test\/(?<a>[^/]+)\/b$/
|
|
44
|
-
// '/test/*' /^\/test\/(?<_0>.*)$/
|
|
45
|
-
// '/test/:a/*' /^\/test\/(?<a>[^/]+)\/(?<_0>.*)$/
|
|
46
|
-
// '/test/*/:b' /^\/test\/(?<_0>.*)\/(?<b>[^/]+)$/
|
|
47
|
-
function createRegExpMatcher(pattern) {
|
|
48
|
-
let i = 0;
|
|
49
|
-
const source = pattern.replace(/:[^/$]+|\*/g, (name) => name === '*' ? `(?<${UNNAMED_PARAM_PREFIX}${i++}>.*)` : `(?<${name.slice(1)}>[^/]+)`);
|
|
50
|
-
const reg = new RegExp(`^${source}$`);
|
|
51
|
-
return (path) => {
|
|
52
|
-
const result = path.match(reg);
|
|
53
|
-
if (!result)
|
|
54
|
-
return null;
|
|
55
|
-
const params = {};
|
|
56
|
-
for (const key in result.groups) {
|
|
57
|
-
params[key.startsWith(UNNAMED_PARAM_PREFIX) ? key.slice(1) : key] = result.groups[key];
|
|
58
|
-
}
|
|
59
|
-
return params;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
// pattern 开头不含参数和特殊字符的部分
|
|
63
|
-
const LITERAL_PREFIX = /^[\w\-./~]*/;
|
|
64
|
-
// `URLPattern` 的创建和 `exec` 都比较慢,不含参数时直接比较,否则先检查固定的开头
|
|
65
|
-
function createMatcher(pattern) {
|
|
66
|
-
const literal = LITERAL_PREFIX.exec(pattern)[0];
|
|
67
|
-
if (literal === pattern)
|
|
68
|
-
return (path) => (path === pattern ? {} : null);
|
|
69
|
-
// 根 layout 的 pattern
|
|
70
|
-
if (pattern === '*')
|
|
71
|
-
return (path) => ({ 0: path });
|
|
72
|
-
if (!globalThis.URLPattern)
|
|
73
|
-
return createRegExpMatcher(pattern);
|
|
74
|
-
const urlPattern = new URLPattern({ pathname: pattern });
|
|
75
|
-
// 参数前的 `/` 可能是可选的,例如 `/a/:b?` 匹配 `/a`
|
|
76
|
-
const prefix = literal.replace(/\/$/, '');
|
|
77
|
-
return (path) => path.startsWith(prefix) ? urlPattern.exec({ pathname: path })?.pathname.groups : null;
|
|
78
|
-
}
|
|
79
|
-
// pattern 来自路由定义,数量有限
|
|
80
|
-
const matchers = new Map();
|
|
81
|
-
/**
|
|
82
|
-
* - 大小写敏感
|
|
83
|
-
* - 匹配成功时返回 params
|
|
84
|
-
* - 以 `/` 结尾时能不带 `/` 结尾的路径
|
|
85
|
-
* - `*` 匹配到的 params 名称为数字
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```js
|
|
89
|
-
* matchPath(`/a/b/:c/:d`,`/a/b/1/2`);
|
|
90
|
-
* matchPath(`/a/b/:c/:d`,`/a/b/1/2/`);
|
|
91
|
-
* matchPath(`/a/b/*`,`/a/b/1/2/`);
|
|
92
|
-
* ```
|
|
93
|
-
*/
|
|
94
|
-
export function matchPath(pattern, path) {
|
|
95
|
-
let match = matchers.get(pattern);
|
|
96
|
-
if (!match)
|
|
97
|
-
matchers.set(pattern, (match = createMatcher(pattern)));
|
|
98
|
-
return match(path) || match(`${path}/`) || null;
|
|
99
|
-
}
|
|
100
|
-
// 从路由创建路径
|
|
101
|
-
// 不包含 basePath
|
|
102
|
-
export function createPath(route, options) {
|
|
103
|
-
// /a/* /a/:0
|
|
104
|
-
// /a/*/:b/* /a/:0/:b/:1
|
|
105
|
-
let i = 0;
|
|
106
|
-
let path = route.pattern.replaceAll('*', () => `:${i++}`);
|
|
107
|
-
const params = options?.params;
|
|
108
|
-
if (params) {
|
|
109
|
-
Object.keys(params).forEach((key) => {
|
|
110
|
-
path = path.replace(new RegExp(`:${key}`, 'g'), params[key]);
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
return path;
|
|
114
|
-
}
|
|
115
|
-
export function createHistoryParams(route, options) {
|
|
116
|
-
const path = createPath(route, options);
|
|
117
|
-
return {
|
|
118
|
-
path,
|
|
119
|
-
...options,
|
|
120
|
-
};
|
|
121
|
-
}
|
|
40
|
+
export { createHistoryParams, createPath, matchPath } from '../../lib/history';
|
|
122
41
|
const INIT_CONTENT = html ``;
|
|
123
42
|
const scrollPositionMap = new Map();
|
|
124
43
|
// 导航到了新的历史记录,前进、后退和页面加载时为 `false`
|