@telperion/elements 5.4.1 → 5.4.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/.build-manifest.json +1 -1
- package/custom-elements.json +4409 -0
- package/fesm/elements.mjs +19 -9
- package/fesm/elements.mjs.map +1 -1
- package/iife/elements.js +19 -19
- package/iife/elements.js.map +1 -1
- package/iife/router/index.js +16 -16
- package/iife/router/index.js.map +1 -1
- package/iife/select/index.js +26 -26
- package/iife/select/index.js.map +1 -1
- package/package.json +17 -16
- package/router/history-managed.cjs +3 -1
- package/router/history-managed.cjs.map +1 -1
- package/router/history-managed.js +3 -1
- package/router/history-managed.js.map +1 -1
- package/select/select.element.cjs +16 -9
- package/select/select.element.cjs.map +1 -1
- package/select/select.element.js +16 -9
- package/select/select.element.js.map +1 -1
package/iife/router/index.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
this.TelperionElements=this.TelperionElements||{},function(t){"use strict";function e(t,e,r,
|
|
1
|
+
this.TelperionElements=this.TelperionElements||{},function(t){"use strict";function e(t,e,r,n){var o,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function r(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}"function"==typeof SuppressedError&&SuppressedError;
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2019 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
6
|
*/
|
|
7
|
-
const
|
|
7
|
+
const n=globalThis,o=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),s=new WeakMap;let a=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(o&&void 0===t){const r=void 0!==e&&1===e.length;r&&(t=s.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&s.set(e,t))}return t}toString(){return this.cssText}};const c=(t,...e)=>{const r=1===t.length?t[0]:e.reduce((e,r,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[n+1],t[0]);return new a(r,t,i)},l=o?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return(t=>new a("string"==typeof t?t:t+"",void 0,i))(e)})(t):t,{is:h,defineProperty:u,getOwnPropertyDescriptor:d,getOwnPropertyNames:p,getOwnPropertySymbols:f,getPrototypeOf:v}=Object,m=globalThis,y=m.trustedTypes,g=y?y.emptyScript:"",$=m.reactiveElementPolyfillSupport,_=(t,e)=>t,b={toAttribute(t,e){switch(e){case Boolean:t=t?g:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},S=(t,e)=>!h(t,e),w={attribute:!0,type:String,converter:b,reflect:!1,useDefault:!1,hasChanged:S};
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright 2017 Google LLC
|
|
11
11
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
-
*/Symbol.metadata??=Symbol("metadata"),m.litPropertyMetadata??=new WeakMap;let C=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=w){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),
|
|
12
|
+
*/Symbol.metadata??=Symbol("metadata"),m.litPropertyMetadata??=new WeakMap;let C=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=w){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(t,r,e);void 0!==n&&u(this.prototype,t,n)}}static getPropertyDescriptor(t,e,r){const{get:n,set:o}=d(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:n,set(e){const i=n?.call(this);o?.call(this,e),this.requestUpdate(t,i,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??w}static _$Ei(){if(this.hasOwnProperty(_("elementProperties")))return;const t=v(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(_("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(_("properties"))){const t=this.properties,e=[...p(t),...f(t)];for(const r of e)this.createProperty(r,t[r])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,r]of e)this.elementProperties.set(t,r)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const r=this._$Eu(t,e);void 0!==r&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const t of r)e.unshift(l(t))}else void 0!==t&&e.push(l(t));return e}static _$Eu(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(o)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const r of e){const e=document.createElement("style"),o=n.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=r.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){const r=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,r);if(void 0!==n&&!0===r.reflect){const o=(void 0!==r.converter?.toAttribute?r.converter:b).toAttribute(e,r.type);this._$Em=t,null==o?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(t,e){const r=this.constructor,n=r._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=r.getPropertyOptions(n),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:b;this._$Em=n;const i=o.fromAttribute(e,t.type);this[n]=i??this._$Ej?.get(n)??i,this._$Em=null}}requestUpdate(t,e,r){if(void 0!==t){const n=this.constructor,o=this[t];if(r??=n.getPropertyOptions(t),!((r.hasChanged??S)(o,e)||r.useDefault&&r.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,r))))return;this.C(t,e,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:n,wrapped:o},i){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),!0!==o||void 0!==i)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),!0===n&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,r]of t){const{wrapped:t}=r,n=this[e];!0!==t||this._$AL.has(e)||void 0===n||this.C(e,void 0,r,n)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};C.elementStyles=[],C.shadowRootOptions={mode:"open"},C[_("elementProperties")]=new Map,C[_("finalized")]=new Map,$?.({ReactiveElement:C}),(m.reactiveElementVersions??=[]).push("2.1.1");
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
|
15
15
|
* Copyright 2017 Google LLC
|
|
16
16
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
17
|
*/
|
|
18
|
-
const A=globalThis,E=A.trustedTypes,R=E?E.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",k=`lit$${Math.random().toFixed(9).slice(2)}$`,O="?"+k,x=`<${O}>`,N=document,P=()=>N.createComment(""),U=t=>null===t||"object"!=typeof t&&"function"!=typeof t,M=Array.isArray,I="[ \t\n\f\r]",H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,L=/-->/g,W=/>/g,j=RegExp(`>|${I}(?:([^\\s"'>=/]+)(${I}*=${I}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),D=/'/g,V=/"/g,q=/^(?:script|style|textarea|title)$/i,z=(t=>(e,...r)=>({_$litType$:t,strings:e,values:r}))(1),B=Symbol.for("lit-noChange"),J=Symbol.for("lit-nothing"),F=new WeakMap,G=N.createTreeWalker(N,129);function K(t,e){if(!M(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==R?R.createHTML(e):e}const Y=(t,e)=>{const r=t.length-1,
|
|
18
|
+
const A=globalThis,E=A.trustedTypes,R=E?E.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",k=`lit$${Math.random().toFixed(9).slice(2)}$`,O="?"+k,x=`<${O}>`,N=document,P=()=>N.createComment(""),U=t=>null===t||"object"!=typeof t&&"function"!=typeof t,M=Array.isArray,I="[ \t\n\f\r]",H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,L=/-->/g,W=/>/g,j=RegExp(`>|${I}(?:([^\\s"'>=/]+)(${I}*=${I}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),D=/'/g,V=/"/g,q=/^(?:script|style|textarea|title)$/i,z=(t=>(e,...r)=>({_$litType$:t,strings:e,values:r}))(1),B=Symbol.for("lit-noChange"),J=Symbol.for("lit-nothing"),F=new WeakMap,G=N.createTreeWalker(N,129);function K(t,e){if(!M(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==R?R.createHTML(e):e}const Y=(t,e)=>{const r=t.length-1,n=[];let o,i=2===e?"<svg>":3===e?"<math>":"",s=H;for(let e=0;e<r;e++){const r=t[e];let a,c,l=-1,h=0;for(;h<r.length&&(s.lastIndex=h,c=s.exec(r),null!==c);)h=s.lastIndex,s===H?"!--"===c[1]?s=L:void 0!==c[1]?s=W:void 0!==c[2]?(q.test(c[2])&&(o=RegExp("</"+c[2],"g")),s=j):void 0!==c[3]&&(s=j):s===j?">"===c[0]?(s=o??H,l=-1):void 0===c[1]?l=-2:(l=s.lastIndex-c[2].length,a=c[1],s=void 0===c[3]?j:'"'===c[3]?V:D):s===V||s===D?s=j:s===L||s===W?s=H:(s=j,o=void 0);const u=s===j&&t[e+1].startsWith("/>")?" ":"";i+=s===H?r+x:l>=0?(n.push(a),r.slice(0,l)+T+r.slice(l)+k+u):r+k+(-2===l?e:u)}return[K(t,i+(t[r]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]};class Z{constructor({strings:t,_$litType$:e},r){let n;this.parts=[];let o=0,i=0;const s=t.length-1,a=this.parts,[c,l]=Y(t,e);if(this.el=Z.createElement(c,r),G.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=G.nextNode())&&a.length<s;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(T)){const e=l[i++],r=n.getAttribute(t).split(k),s=/([.?@])?(.*)/.exec(e);a.push({type:1,index:o,name:s[2],strings:r,ctor:"."===s[1]?rt:"?"===s[1]?nt:"@"===s[1]?ot:et}),n.removeAttribute(t)}else t.startsWith(k)&&(a.push({type:6,index:o}),n.removeAttribute(t));if(q.test(n.tagName)){const t=n.textContent.split(k),e=t.length-1;if(e>0){n.textContent=E?E.emptyScript:"";for(let r=0;r<e;r++)n.append(t[r],P()),G.nextNode(),a.push({type:2,index:++o});n.append(t[e],P())}}}else if(8===n.nodeType)if(n.data===O)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=n.data.indexOf(k,t+1));)a.push({type:7,index:o}),t+=k.length-1}o++}}static createElement(t,e){const r=N.createElement("template");return r.innerHTML=t,r}}function Q(t,e,r=t,n){if(e===B)return e;let o=void 0!==n?r._$Co?.[n]:r._$Cl;const i=U(e)?void 0:e._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),void 0===i?o=void 0:(o=new i(t),o._$AT(t,r,n)),void 0!==n?(r._$Co??=[])[n]=o:r._$Cl=o),void 0!==o&&(e=Q(t,o._$AS(t,e.values),o,n)),e}class X{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,n=(t?.creationScope??N).importNode(e,!0);G.currentNode=n;let o=G.nextNode(),i=0,s=0,a=r[0];for(;void 0!==a;){if(i===a.index){let e;2===a.type?e=new tt(o,o.nextSibling,this,t):1===a.type?e=new a.ctor(o,a.name,a.strings,this,t):6===a.type&&(e=new it(o,this,t)),this._$AV.push(e),a=r[++s]}i!==a?.index&&(o=G.nextNode(),i++)}return G.currentNode=N,n}p(t){let e=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class tt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,n){this.type=2,this._$AH=J,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Q(this,t,e),U(t)?t===J||null==t||""===t?(this._$AH!==J&&this._$AR(),this._$AH=J):t!==this._$AH&&t!==B&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>M(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==J&&U(this._$AH)?this._$AA.nextSibling.data=t:this.T(N.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:r}=t,n="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=Z.createElement(K(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new X(n,this),r=t.u(this.options);t.p(e),this.T(r),this._$AH=t}}_$AC(t){let e=F.get(t.strings);return void 0===e&&F.set(t.strings,e=new Z(t)),e}k(t){M(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,n=0;for(const o of t)n===e.length?e.push(r=new tt(this.O(P()),this.O(P()),this,this.options)):r=e[n],r._$AI(o),n++;n<e.length&&(this._$AR(r&&r._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class et{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,n,o){this.type=1,this._$AH=J,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=o,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=J}_$AI(t,e=this,r,n){const o=this.strings;let i=!1;if(void 0===o)t=Q(this,t,e,0),i=!U(t)||t!==this._$AH&&t!==B,i&&(this._$AH=t);else{const n=t;let s,a;for(t=o[0],s=0;s<o.length-1;s++)a=Q(this,n[r+s],e,s),a===B&&(a=this._$AH[s]),i||=!U(a)||a!==this._$AH[s],a===J?t=J:t!==J&&(t+=(a??"")+o[s+1]),this._$AH[s]=a}i&&!n&&this.j(t)}j(t){t===J?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class rt extends et{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===J?void 0:t}}class nt extends et{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==J)}}class ot extends et{constructor(t,e,r,n,o){super(t,e,r,n,o),this.type=5}_$AI(t,e=this){if((t=Q(this,t,e,0)??J)===B)return;const r=this._$AH,n=t===J&&r!==J||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==J&&(r===J||n);n&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class it{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){Q(this,t)}}const st=A.litHtmlPolyfillSupport;st?.(Z,tt),(A.litHtmlVersions??=[]).push("3.3.1");const at=globalThis;
|
|
19
19
|
/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/let ct=class extends C{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,r)=>{const
|
|
23
|
+
*/let ct=class extends C{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,r)=>{const n=r?.renderBefore??e;let o=n._$litPart$;if(void 0===o){const t=r?.renderBefore??null;n._$litPart$=o=new tt(e.insertBefore(P(),t),t,void 0,r??{})}return o._$AI(t),o})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return B}};ct._$litElement$=!0,ct.finalized=!0,at.litElementHydrateSupport?.({LitElement:ct});const lt=at.litElementPolyfillSupport;lt?.({LitElement:ct}),(at.litElementVersions??=[]).push("4.2.1");
|
|
24
24
|
/**
|
|
25
25
|
* @license
|
|
26
26
|
* Copyright 2017 Google LLC
|
|
27
27
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
28
|
*/
|
|
29
|
-
const ht=t=>(e,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},ut={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:S},dt=(t=ut,e,r)=>{const{kind:
|
|
29
|
+
const ht=t=>(e,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},ut={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:S},dt=(t=ut,e,r)=>{const{kind:n,metadata:o}=r;let i=globalThis.litPropertyMetadata.get(o);if(void 0===i&&globalThis.litPropertyMetadata.set(o,i=new Map),"setter"===n&&((t=Object.create(t)).wrapped=!0),i.set(r.name,t),"accessor"===n){const{name:n}=r;return{set(r){const o=e.get.call(this);e.set.call(this,r),this.requestUpdate(n,o,t)},init(e){return void 0!==e&&this.C(n,void 0,t,e),e}}}if("setter"===n){const{name:n}=r;return function(r){const o=this[n];e.call(this,r),this.requestUpdate(n,o,t)}}throw Error("Unsupported decorator location: "+n)};
|
|
30
30
|
/**
|
|
31
31
|
* @license
|
|
32
32
|
* Copyright 2017 Google LLC
|
|
33
33
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
|
-
*/function pt(t){return(e,r)=>"object"==typeof r?dt(t,e,r):((t,e,r)=>{const
|
|
34
|
+
*/function pt(t){return(e,r)=>"object"==typeof r?dt(t,e,r):((t,e,r)=>{const n=e.hasOwnProperty(r);return e.constructor.createProperty(r,t),n?Object.getOwnPropertyDescriptor(e,r):void 0})(t,e,r)}
|
|
35
35
|
/**
|
|
36
36
|
* @license
|
|
37
37
|
* Copyright 2017 Google LLC
|
|
@@ -51,14 +51,14 @@ function $t(t,e){return Object.is(t,e)}
|
|
|
51
51
|
*
|
|
52
52
|
* Use of this source code is governed by an MIT-style license that can be
|
|
53
53
|
* found in the LICENSE file at https://angular.io/license
|
|
54
|
-
*/let _t=null,bt=!1,St=1;const wt=Symbol("SIGNAL");function Ct(t){const e=_t;return _t=t,e}const At={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function Et(t){if(bt)throw new Error("undefined"!=typeof ngDevMode&&ngDevMode?"Assertion error: signal read during notification phase":"");if(null===_t)return;_t.consumerOnSignalRead(t);const e=_t.nextProducerIndex++;if(Pt(_t),e<_t.producerNode.length&&_t.producerNode[e]!==t&&Nt(_t)){xt(_t.producerNode[e],_t.producerIndexOfThis[e])}_t.producerNode[e]!==t&&(_t.producerNode[e]=t,_t.producerIndexOfThis[e]=Nt(_t)?Ot(t,_t,e):0),_t.producerLastReadVersion[e]=t.version}function Rt(t){if(t.dirty||t.lastCleanEpoch!==St){if(!t.producerMustRecompute(t)&&!function(t){Pt(t);for(let e=0;e<t.producerNode.length;e++){const r=t.producerNode[e],
|
|
54
|
+
*/let _t=null,bt=!1,St=1;const wt=Symbol("SIGNAL");function Ct(t){const e=_t;return _t=t,e}const At={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function Et(t){if(bt)throw new Error("undefined"!=typeof ngDevMode&&ngDevMode?"Assertion error: signal read during notification phase":"");if(null===_t)return;_t.consumerOnSignalRead(t);const e=_t.nextProducerIndex++;if(Pt(_t),e<_t.producerNode.length&&_t.producerNode[e]!==t&&Nt(_t)){xt(_t.producerNode[e],_t.producerIndexOfThis[e])}_t.producerNode[e]!==t&&(_t.producerNode[e]=t,_t.producerIndexOfThis[e]=Nt(_t)?Ot(t,_t,e):0),_t.producerLastReadVersion[e]=t.version}function Rt(t){if(t.dirty||t.lastCleanEpoch!==St){if(!t.producerMustRecompute(t)&&!function(t){Pt(t);for(let e=0;e<t.producerNode.length;e++){const r=t.producerNode[e],n=t.producerLastReadVersion[e];if(n!==r.version)return!0;if(Rt(r),n!==r.version)return!0}return!1}(t))return t.dirty=!1,void(t.lastCleanEpoch=St);t.producerRecomputeValue(t),t.dirty=!1,t.lastCleanEpoch=St}}function Tt(t){if(void 0===t.liveConsumerNode)return;const e=bt;bt=!0;try{for(const e of t.liveConsumerNode)e.dirty||kt(e)}finally{bt=e}}function kt(t){var e;t.dirty=!0,Tt(t),null==(e=t.consumerMarkedDirty)||e.call(t.wrapper??t)}function Ot(t,e,r){var n;if(Ut(t),Pt(t),0===t.liveConsumerNode.length){null==(n=t.watched)||n.call(t.wrapper);for(let e=0;e<t.producerNode.length;e++)t.producerIndexOfThis[e]=Ot(t.producerNode[e],t,e)}return t.liveConsumerIndexOfThis.push(r),t.liveConsumerNode.push(e)-1}function xt(t,e){var r;if(Ut(t),Pt(t),"undefined"!=typeof ngDevMode&&ngDevMode&&e>=t.liveConsumerNode.length)throw new Error(`Assertion error: active consumer index ${e} is out of bounds of ${t.liveConsumerNode.length} consumers)`);if(1===t.liveConsumerNode.length){null==(r=t.unwatched)||r.call(t.wrapper);for(let e=0;e<t.producerNode.length;e++)xt(t.producerNode[e],t.producerIndexOfThis[e])}const n=t.liveConsumerNode.length-1;if(t.liveConsumerNode[e]=t.liveConsumerNode[n],t.liveConsumerIndexOfThis[e]=t.liveConsumerIndexOfThis[n],t.liveConsumerNode.length--,t.liveConsumerIndexOfThis.length--,e<t.liveConsumerNode.length){const r=t.liveConsumerIndexOfThis[e],n=t.liveConsumerNode[e];Pt(n),n.producerIndexOfThis[r]=e}}function Nt(t){var e;return t.consumerIsAlwaysLive||((null==(e=null==t?void 0:t.liveConsumerNode)?void 0:e.length)??0)>0}function Pt(t){t.producerNode??(t.producerNode=[]),t.producerIndexOfThis??(t.producerIndexOfThis=[]),t.producerLastReadVersion??(t.producerLastReadVersion=[])}function Ut(t){t.liveConsumerNode??(t.liveConsumerNode=[]),t.liveConsumerIndexOfThis??(t.liveConsumerIndexOfThis=[])}
|
|
55
55
|
/**
|
|
56
56
|
* @license
|
|
57
57
|
* Copyright Google LLC All Rights Reserved.
|
|
58
58
|
*
|
|
59
59
|
* Use of this source code is governed by an MIT-style license that can be
|
|
60
60
|
* found in the LICENSE file at https://angular.io/license
|
|
61
|
-
*/function Mt(t){if(Rt(t),Et(t),t.value===Lt)throw t.error;return t.value}const It=Symbol("UNSET"),Ht=Symbol("COMPUTING"),Lt=Symbol("ERRORED"),Wt=(()=>({...At,value:It,dirty:!0,error:null,equal:$t,producerMustRecompute:t=>t.value===It||t.value===Ht,producerRecomputeValue(t){if(t.value===Ht)throw new Error("Detected cycle in computations.");const e=t.value;t.value=Ht;const r=function(t){return t&&(t.nextProducerIndex=0),Ct(t)}(t);let o
|
|
61
|
+
*/function Mt(t){if(Rt(t),Et(t),t.value===Lt)throw t.error;return t.value}const It=Symbol("UNSET"),Ht=Symbol("COMPUTING"),Lt=Symbol("ERRORED"),Wt=(()=>({...At,value:It,dirty:!0,error:null,equal:$t,producerMustRecompute:t=>t.value===It||t.value===Ht,producerRecomputeValue(t){if(t.value===Ht)throw new Error("Detected cycle in computations.");const e=t.value;t.value=Ht;const r=function(t){return t&&(t.nextProducerIndex=0),Ct(t)}(t);let n,o=!1;try{n=t.computation.call(t.wrapper);o=e!==It&&e!==Lt&&t.equal.call(t.wrapper,e,n)}catch(e){n=Lt,t.error=e}finally{!function(t,e){if(Ct(e),t&&void 0!==t.producerNode&&void 0!==t.producerIndexOfThis&&void 0!==t.producerLastReadVersion){if(Nt(t))for(let e=t.nextProducerIndex;e<t.producerNode.length;e++)xt(t.producerNode[e],t.producerIndexOfThis[e]);for(;t.producerNode.length>t.nextProducerIndex;)t.producerNode.pop(),t.producerLastReadVersion.pop(),t.producerIndexOfThis.pop()}}(t,r)}o?t.value=e:(t.value=n,t.version++)}}))();let jt=
|
|
62
62
|
/**
|
|
63
63
|
* @license
|
|
64
64
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -82,7 +82,7 @@ function(){throw new Error};function Dt(){return Et(this),this.value}function Vt
|
|
|
82
82
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
83
83
|
* See the License for the specific language governing permissions and
|
|
84
84
|
* limitations under the License.
|
|
85
|
-
*/(t))}const qt=(()=>({...At,equal:$t,value:void 0}))();const zt=Symbol("node");var Bt;(t=>{var e,r,o
|
|
85
|
+
*/(t))}const qt=(()=>({...At,equal:$t,value:void 0}))();const zt=Symbol("node");var Bt;(t=>{var e,r,n,o;e=zt,r=new WeakSet,t.isState=t=>"object"==typeof t&&mt(r,t),t.State=class{constructor(n,o={}){yt(this,r),vt(this,e);const i=
|
|
86
86
|
/**
|
|
87
87
|
* @license
|
|
88
88
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -90,13 +90,13 @@ function(){throw new Error};function Dt(){return Et(this),this.value}function Vt
|
|
|
90
90
|
* Use of this source code is governed by an MIT-style license that can be
|
|
91
91
|
* found in the LICENSE file at https://angular.io/license
|
|
92
92
|
*/
|
|
93
|
-
function(t){const e=Object.create(qt);e.value=t;const r=()=>(Et(e),e.value);return r[wt]=e,r}(
|
|
93
|
+
function(t){const e=Object.create(qt);e.value=t;const r=()=>(Et(e),e.value);return r[wt]=e,r}(n),s=i[wt];if(this[zt]=s,s.wrapper=this,o){const e=o.equals;e&&(s.equal=e),s.watched=o[t.subtle.watched],s.unwatched=o[t.subtle.unwatched]}}get(){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.get");return Dt.call(this[zt])}set(e){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.set");if(bt)throw new Error("Writes to signals not permitted during Watcher callback");Vt(this[zt],e)}};n=zt,o=new WeakSet,t.isComputed=t=>"object"==typeof t&&mt(o,t),t.Computed=class{constructor(e,r){yt(this,o),vt(this,n);const i=function(t){const e=Object.create(Wt);e.computation=t;const r=()=>Mt(e);return r[wt]=e,r}(e),s=i[wt];if(s.consumerAllowSignalWrites=!0,this[zt]=s,s.wrapper=this,r){const e=r.equals;e&&(s.equal=e),s.watched=r[t.subtle.watched],s.unwatched=r[t.subtle.unwatched]}}get(){if(!(0,t.isComputed)(this))throw new TypeError("Wrong receiver type for Signal.Computed.prototype.get");return Mt(this[zt])}},(e=>{var r,n,o,i;e.untrack=function(t){let e,r=null;try{r=Ct(null),e=t()}finally{Ct(r)}return e},e.introspectSources=function(e){var r;if(!(0,t.isComputed)(e)&&!(0,t.isWatcher)(e))throw new TypeError("Called introspectSources without a Computed or Watcher argument");return(null==(r=e[zt].producerNode)?void 0:r.map(t=>t.wrapper))??[]},e.introspectSinks=function(e){var r;if(!(0,t.isComputed)(e)&&!(0,t.isState)(e))throw new TypeError("Called introspectSinks without a Signal argument");return(null==(r=e[zt].liveConsumerNode)?void 0:r.map(t=>t.wrapper))??[]},e.hasSinks=function(e){if(!(0,t.isComputed)(e)&&!(0,t.isState)(e))throw new TypeError("Called hasSinks without a Signal argument");const r=e[zt].liveConsumerNode;return!!r&&r.length>0},e.hasSources=function(e){if(!(0,t.isComputed)(e)&&!(0,t.isWatcher)(e))throw new TypeError("Called hasSources without a Computed or Watcher argument");const r=e[zt].producerNode;return!!r&&r.length>0};r=zt,n=new WeakSet,o=new WeakSet,i=function(e){for(const r of e)if(!(0,t.isComputed)(r)&&!(0,t.isState)(r))throw new TypeError("Called watch/unwatch without a Computed or State argument")},t.isWatcher=t=>mt(n,t),e.Watcher=class{constructor(t){yt(this,n),yt(this,o),vt(this,r);let e=Object.create(At);e.wrapper=this,e.consumerMarkedDirty=t,e.consumerIsAlwaysLive=!0,e.consumerAllowSignalWrites=!1,e.producerNode=[],this[zt]=e}watch(...e){if(!(0,t.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");gt(this,o,i).call(this,e);const r=this[zt];r.dirty=!1;const n=Ct(r);for(const t of e)Et(t[zt]);Ct(n)}unwatch(...e){if(!(0,t.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");gt(this,o,i).call(this,e);const r=this[zt];Pt(r);for(let t=r.producerNode.length-1;t>=0;t--)if(e.includes(r.producerNode[t].wrapper)){xt(r.producerNode[t],r.producerIndexOfThis[t]);const e=r.producerNode.length-1;if(r.producerNode[t]=r.producerNode[e],r.producerIndexOfThis[t]=r.producerIndexOfThis[e],r.producerNode.length--,r.producerIndexOfThis.length--,r.nextProducerIndex--,t<r.producerNode.length){const e=r.producerIndexOfThis[t],n=r.producerNode[t];Ut(n),n.liveConsumerIndexOfThis[e]=t}}}getPending(){if(!(0,t.isWatcher)(this))throw new TypeError("Called getPending without Watcher receiver");return this[zt].producerNode.filter(t=>t.dirty).map(t=>t.wrapper)}},e.currentComputed=function(){var t;return null==(t=_t)?void 0:t.wrapper},e.watched=Symbol("watched"),e.unwatched=Symbol("unwatched")})(t.subtle||(t.subtle={}))})(Bt||(Bt={}));
|
|
94
94
|
/**
|
|
95
95
|
* @license
|
|
96
96
|
* Copyright 2023 Google LLC
|
|
97
97
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
98
98
|
*/
|
|
99
|
-
let Jt=!1;const Ft=new Bt.subtle.Watcher(()=>{Jt||(Jt=!0,queueMicrotask(()=>{Jt=!1;for(const t of Ft.getPending())t.get();Ft.watch()}))}),Gt=Symbol("SignalWatcherBrand"),Kt=new FinalizationRegistry(t=>{t.unwatch(...Bt.subtle.introspectSources(t))}),Yt=new WeakMap;function Zt(t){return!0===t[Gt]?(console.warn("SignalWatcher should not be applied to the same class more than once."),t):class extends t{constructor(){super(...arguments),this._$St=new Map,this._$So=new Bt.State(0),this._$Si=!1}_$Sl(){var t,e;const r=[],
|
|
99
|
+
let Jt=!1;const Ft=new Bt.subtle.Watcher(()=>{Jt||(Jt=!0,queueMicrotask(()=>{Jt=!1;for(const t of Ft.getPending())t.get();Ft.watch()}))}),Gt=Symbol("SignalWatcherBrand"),Kt=new FinalizationRegistry(t=>{t.unwatch(...Bt.subtle.introspectSources(t))}),Yt=new WeakMap;function Zt(t){return!0===t[Gt]?(console.warn("SignalWatcher should not be applied to the same class more than once."),t):class extends t{constructor(){super(...arguments),this._$St=new Map,this._$So=new Bt.State(0),this._$Si=!1}_$Sl(){var t,e;const r=[],n=[];this._$St.forEach((t,e)=>{((null==t?void 0:t.beforeUpdate)?r:n).push(e)});const o=null===(t=this.h)||void 0===t?void 0:t.getPending().filter(t=>t!==this._$Su&&!this._$St.has(t));r.forEach(t=>t.get()),null===(e=this._$Su)||void 0===e||e.get(),o.forEach(t=>t.get()),n.forEach(t=>t.get())}_$Sv(){this.isUpdatePending||queueMicrotask(()=>{this.isUpdatePending||this._$Sl()})}_$S_(){if(void 0!==this.h)return;this._$Su=new Bt.Computed(()=>{this._$So.get(),super.performUpdate()});const t=this.h=new Bt.subtle.Watcher(function(){const t=Yt.get(this);void 0!==t&&(!1===t._$Si&&(new Set(this.getPending()).has(t._$Su)?t.requestUpdate():t._$Sv()),this.watch())});Yt.set(t,this),Kt.register(this,t),t.watch(this._$Su),t.watch(...Array.from(this._$St).map(([t])=>t))}_$Sp(){if(void 0===this.h)return;let t=!1;this.h.unwatch(...Bt.subtle.introspectSources(this.h).filter(e=>{var r;const n=!0!==(null===(r=this._$St.get(e))||void 0===r?void 0:r.manualDispose);return n&&this._$St.delete(e),t||(t=!n),n})),t||(this._$Su=void 0,this.h=void 0,this._$St.clear())}updateEffect(t,e){var r;this._$S_();const n=new Bt.Computed(()=>{t()});return this.h.watch(n),this._$St.set(n,e),null!==(r=null==e?void 0:e.beforeUpdate)&&void 0!==r&&r?Bt.subtle.untrack(()=>n.get()):this.updateComplete.then(()=>Bt.subtle.untrack(()=>n.get())),()=>{this._$St.delete(n),this.h.unwatch(n),!1===this.isConnected&&this._$Sp()}}performUpdate(){this.isUpdatePending&&(this._$S_(),this._$Si=!0,this._$So.set(this._$So.get()+1),this._$Si=!1,this._$Sl())}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask(()=>{!1===this.isConnected&&this._$Sp()})}}}
|
|
100
100
|
/**
|
|
101
101
|
* @license
|
|
102
102
|
* Copyright 2017 Google LLC
|
|
@@ -111,12 +111,12 @@ let Jt=!1;const Ft=new Bt.subtle.Watcher(()=>{Jt||(Jt=!0,queueMicrotask(()=>{Jt=
|
|
|
111
111
|
* @license
|
|
112
112
|
* Copyright 2017 Google LLC
|
|
113
113
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
114
|
-
*/function
|
|
114
|
+
*/function ne(t){void 0!==this._$AN?(ee(this),this._$AM=t,re(this)):this._$AM=t}function oe(t,e=!1,r=0){const n=this._$AH,o=this._$AN;if(void 0!==o&&0!==o.size)if(e)if(Array.isArray(n))for(let t=r;t<n.length;t++)te(n[t],!1),ee(n[t]);else null!=n&&(te(n,!1),ee(n));else te(this,t)}const ie=t=>{t.type==Qt&&(t._$AP??=oe,t._$AQ??=ne)};class se extends Xt{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,r){super._$AT(t,e,r),re(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(te(this,t),ee(this))}setValue(t){if((t=>void 0===t.strings)(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}
|
|
115
115
|
/**
|
|
116
116
|
* @license
|
|
117
117
|
* Copyright 2023 Google LLC
|
|
118
118
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
119
|
-
*/let ae=!1;const ce=new Bt.subtle.Watcher(async()=>{ae||(ae=!0,queueMicrotask(()=>{ae=!1;for(const t of ce.getPending())t.get();ce.watch()}))});const le=(t=>(...e)=>({_$litDirective$:t,values:e}))(class extends se{_$S_(){var t,e;void 0===this._$Sm&&(this._$Sj=new Bt.Computed(()=>{var t;const e=null===(t=this._$SW)||void 0===t?void 0:t.get();return this.setValue(e),e}),this._$Sm=null!==(e=null===(t=this._$Sk)||void 0===t?void 0:t.h)&&void 0!==e?e:ce,this._$Sm.watch(this._$Sj),Bt.subtle.untrack(()=>{var t;return null===(t=this._$Sj)||void 0===t?void 0:t.get()}))}_$Sp(){void 0!==this._$Sm&&(this._$Sm.unwatch(this._$SW),this._$Sm=void 0)}render(t){return Bt.subtle.untrack(()=>t.get())}update(t,[e]){var r,
|
|
119
|
+
*/let ae=!1;const ce=new Bt.subtle.Watcher(async()=>{ae||(ae=!0,queueMicrotask(()=>{ae=!1;for(const t of ce.getPending())t.get();ce.watch()}))});const le=(t=>(...e)=>({_$litDirective$:t,values:e}))(class extends se{_$S_(){var t,e;void 0===this._$Sm&&(this._$Sj=new Bt.Computed(()=>{var t;const e=null===(t=this._$SW)||void 0===t?void 0:t.get();return this.setValue(e),e}),this._$Sm=null!==(e=null===(t=this._$Sk)||void 0===t?void 0:t.h)&&void 0!==e?e:ce,this._$Sm.watch(this._$Sj),Bt.subtle.untrack(()=>{var t;return null===(t=this._$Sj)||void 0===t?void 0:t.get()}))}_$Sp(){void 0!==this._$Sm&&(this._$Sm.unwatch(this._$SW),this._$Sm=void 0)}render(t){return Bt.subtle.untrack(()=>t.get())}update(t,[e]){var r,n;return null!==(r=this._$Sk)&&void 0!==r||(this._$Sk=null===(n=t.options)||void 0===n?void 0:n.host),e!==this._$SW&&void 0!==this._$SW&&this._$Sp(),this._$SW=e,this._$S_(),Bt.subtle.untrack(()=>this._$SW.get())}disconnected(){this._$Sp()}reconnected(){this._$S_()}}),he=(t=>(e,...r)=>t(e,...r.map(t=>t instanceof Bt.State||t instanceof Bt.Computed?le(t):t)))(z);
|
|
120
120
|
/**
|
|
121
121
|
* @license
|
|
122
122
|
* Copyright 2023 Google LLC
|
|
@@ -171,13 +171,13 @@ Bt.State,Bt.Computed;const ue=(t,e)=>new Bt.State(t,e),de=(t,e)=>new Bt.Computed
|
|
|
171
171
|
&[color="danger"] { --tp-element-color: var(--tp-color-danger); }
|
|
172
172
|
&[color="warning"] { --tp-element-color: var(--tp-color-warning); }
|
|
173
173
|
&[color="neutral"] { --tp-element-color: var(--tp-color-neutral); }
|
|
174
|
-
`}willUpdate(t){t.has("shade")&&(this.mixer=500===this.shade?"none":this.shade>500?"black":"white")}}e([pt({type:String,reflect:!0}),r("design:type",String)],ge.prototype,"color",void 0),e([pt({type:Number,reflect:!0,converter(t,e){const r=Number(t);return isNaN(r)?500:function(t,e,r){return Math.max(Math.min(e,r),t)}(0,1e3,r)}}),r("design:type",Number)],ge.prototype,"shade",void 0),e([pt({type:String,reflect:!0}),r("design:type",String)],ge.prototype,"mixer",void 0);const $e=Zt(ct);function _e(){return _e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)({}).hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},_e.apply(null,arguments)}var be;Zt(ge),function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(be||(be={}));var Se="production"!==process.env.NODE_ENV?function(t){return Object.freeze(t)}:function(t){return t};function we(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}var Ce="beforeunload",Ae="popstate";function Ee(t){void 0===t&&(t={});var e=t.window,r=void 0===e?document.defaultView:e,o=r.history;function n(){var t=Ne(r.location.hash.substr(1)),e=t.pathname,n=void 0===e?"/":e,i=t.search,s=void 0===i?"":i,a=t.hash,c=void 0===a?"":a,l=o.state||{};return[l.idx,Se({pathname:n,search:s,hash:c,state:l.usr||null,key:l.key||"default"})]}var i=null;function s(){if(i)d.call(i),i=null;else{var t=be.Pop,e=n(),r=e[0],o=e[1];if(d.length)if(null!=r){var s=l-r;s&&(i={action:t,location:o,retry:function(){g(-1*s)}},g(s))}else"production"!==process.env.NODE_ENV&&we(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else y(t)}}r.addEventListener(Ae,s),r.addEventListener("hashchange",function(){xe(n()[1])!==xe(h)&&s()});var a=be.Pop,c=n(),l=c[0],h=c[1],u=ke(),d=ke();function p(t){return function(){var t=document.querySelector("base"),e="";if(t&&t.getAttribute("href")){var o=r.location.href,n=o.indexOf("#");e=-1===n?o:o.slice(0,n)}return e}()+"#"+("string"==typeof t?t:xe(t))}function f(t,e){return void 0===e&&(e=null),Se(_e({pathname:h.pathname,hash:"",search:""},"string"==typeof t?Ne(t):t,{state:e,key:Oe()}))}function v(t,e){return[{usr:t.state,key:t.key,idx:e},p(t)]}function m(t,e,r){return!d.length||(d.call({action:t,location:e,retry:r}),!1)}function y(t){a=t;var e=n();l=e[0],h=e[1],u.call({action:a,location:h})}function g(t){o.go(t)}null==l&&(l=0,o.replaceState(_e({},o.state,{idx:l}),""));var $={get action(){return a},get location(){return h},createHref:p,push:function t(e,n){var i=be.Push,s=f(e,n);if("production"!==process.env.NODE_ENV&&we("/"===s.pathname.charAt(0),"Relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")"),m(i,s,function(){t(e,n)})){var a=v(s,l+1),c=a[0],h=a[1];try{o.pushState(c,"",h)}catch(t){r.location.assign(h)}y(i)}},replace:function t(e,r){var n=be.Replace,i=f(e,r);if("production"!==process.env.NODE_ENV&&we("/"===i.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(e)+")"),m(n,i,function(){t(e,r)})){var s=v(i,l),a=s[0],c=s[1];o.replaceState(a,"",c),y(n)}},go:g,back:function(){g(-1)},forward:function(){g(1)},listen:function(t){return u.push(t)},block:function(t){var e=d.push(t);return 1===d.length&&r.addEventListener(Ce,Te),function(){e(),d.length||r.removeEventListener(Ce,Te)}}};return $}function Re(t,e,r){return Math.min(Math.max(t,e),r)}function Te(t){t.preventDefault(),t.returnValue=""}function ke(){var t=[];return{get length(){return t.length},push:function(e){return t.push(e),function(){t=t.filter(function(t){return t!==e})}},call:function(e){t.forEach(function(t){return t&&t(e)})}}}function Oe(){return Math.random().toString(36).substr(2,8)}function xe(t){var e=t.pathname,r=void 0===e?"/":e,o=t.search,n=void 0===o?"":o,i=t.hash,s=void 0===i?"":i;return n&&"?"!==n&&(r+="?"===n.charAt(0)?n:"?"+n),s&&"#"!==s&&(r+="#"===s.charAt(0)?s:"#"+s),r}function Ne(t){var e={};if(t){var r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));var o=t.indexOf("?");o>=0&&(e.search=t.substr(o),t=t.substr(0,o)),t&&(e.pathname=t)}return e}const Pe={},Ue=ue("browser");function Me(t){let e=Pe[t];if(!e){switch(t){case"browser":e=function(t){void 0===t&&(t={});var e=t.window,r=void 0===e?document.defaultView:e,o=r.history;function n(){var t=r.location,e=t.pathname,n=t.search,i=t.hash,s=o.state||{};return[s.idx,Se({pathname:e,search:n,hash:i,state:s.usr||null,key:s.key||"default"})]}var i=null;r.addEventListener(Ae,function(){if(i)u.call(i),i=null;else{var t=be.Pop,e=n(),r=e[0],o=e[1];if(u.length)if(null!=r){var s=c-r;s&&(i={action:t,location:o,retry:function(){y(-1*s)}},y(s))}else"production"!==process.env.NODE_ENV&&we(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else m(t)}});var s=be.Pop,a=n(),c=a[0],l=a[1],h=ke(),u=ke();function d(t){return"string"==typeof t?t:xe(t)}function p(t,e){return void 0===e&&(e=null),Se(_e({pathname:l.pathname,hash:"",search:""},"string"==typeof t?Ne(t):t,{state:e,key:Oe()}))}function f(t,e){return[{usr:t.state,key:t.key,idx:e},d(t)]}function v(t,e,r){return!u.length||(u.call({action:t,location:e,retry:r}),!1)}function m(t){s=t;var e=n();c=e[0],l=e[1],h.call({action:s,location:l})}function y(t){o.go(t)}null==c&&(c=0,o.replaceState(_e({},o.state,{idx:c}),""));var g={get action(){return s},get location(){return l},createHref:d,push:function t(e,n){var i=be.Push,s=p(e,n);if(v(i,s,function(){t(e,n)})){var a=f(s,c+1),l=a[0],h=a[1];try{o.pushState(l,"",h)}catch(t){r.location.assign(h)}m(i)}},replace:function t(e,r){var n=be.Replace,i=p(e,r);if(v(n,i,function(){t(e,r)})){var s=f(i,c),a=s[0],l=s[1];o.replaceState(a,"",l),m(n)}},go:y,back:function(){y(-1)},forward:function(){y(1)},listen:function(t){return h.push(t)},block:function(t){var e=u.push(t);return 1===u.length&&r.addEventListener(Ce,Te),function(){e(),u.length||r.removeEventListener(Ce,Te)}}};return g}();break;case"hash":e=Ee();break;default:e=function(t){void 0===t&&(t={});var e=t,r=e.initialEntries,o=void 0===r?["/"]:r,n=e.initialIndex,i=o.map(function(t){var e=Se(_e({pathname:"/",search:"",hash:"",state:null,key:Oe()},"string"==typeof t?Ne(t):t));return"production"!==process.env.NODE_ENV&&we("/"===e.pathname.charAt(0),"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(t)+")"),e}),s=Re(null==n?i.length-1:n,0,i.length-1),a=be.Pop,c=i[s],l=ke(),h=ke();function u(t,e){return void 0===e&&(e=null),Se(_e({pathname:c.pathname,search:"",hash:""},"string"==typeof t?Ne(t):t,{state:e,key:Oe()}))}function d(t,e,r){return!h.length||(h.call({action:t,location:e,retry:r}),!1)}function p(t,e){a=t,c=e,l.call({action:a,location:c})}function f(t){var e=Re(s+t,0,i.length-1),r=be.Pop,o=i[e];d(r,o,function(){f(t)})&&(s=e,p(r,o))}var v={get index(){return s},get action(){return a},get location(){return c},createHref:function(t){return"string"==typeof t?t:xe(t)},push:function t(e,r){var o=be.Push,n=u(e,r);"production"!==process.env.NODE_ENV&&we("/"===c.pathname.charAt(0),"Relative pathnames are not supported in memory history.push("+JSON.stringify(e)+")"),d(o,n,function(){t(e,r)})&&(s+=1,i.splice(s,i.length,n),p(o,n))},replace:function t(e,r){var o=be.Replace,n=u(e,r);"production"!==process.env.NODE_ENV&&we("/"===c.pathname.charAt(0),"Relative pathnames are not supported in memory history.replace("+JSON.stringify(e)+")"),d(o,n,function(){t(e,r)})&&(i[s]=n,p(o,n))},go:f,back:function(){f(-1)},forward:function(){f(1)},listen:function(t){return l.push(t)},block:function(t){return h.push(t)}};return v}()}Pe[t]=e}return e}de(()=>Me(Ue.get()));const Ie=Symbol("HistoryManaged:history"),He=Symbol("HistoryManaged:historyType"),Le=t=>{var o,n;class i extends t{constructor(){super(...arguments),this.history=void 0,this.#r=ue(this.history),this.#o=de(()=>{const t=this.closest("tha-router-config, tha-router-outlet");return t?.[He]?.get()}),this[o]=de(()=>this.#r.get()??this.#o.get()??Ue.get()),this[n]=de(()=>Me(this[He].get()))}static{o=He,n=Ie}#r;#o;attributeChangedCallback(t,e,r){if(super.attributeChangedCallback(t,e,r),"history"===t)this.#r.set(r)}}return e([pt({type:String}),r("design:type",Object)],i.prototype,"history",void 0),i};function We(t=ye){return new Promise((e,r)=>{setTimeout(()=>{try{const r=t();e(r)}catch(t){r(t)}},0)})}var je;const De=Symbol("ThaRouterOutlet:renderRoute"),Ve=Symbol("ThaRouterOutlet:params");function qe(t){return!!t}function ze(t){return t.filter(qe)}t.ThaRouterOutlet=class extends $e{constructor(){super(...arguments),this.#n=ue(void 0),this.#i=ue(null),this.#s=de(()=>this.#i.get()?.deref()?.[ve].get()??null),this.#a=de(()=>{const t=this.#n.get()?.deref(),e=this.#i.get()?.deref(),r=e?.[me];if(!t||!r)return null;const{location:{pathname:o}}=t[Ie].get();return r.exec(o,"http://dummy.base")?.pathname.groups??null}),this[je]=de(()=>{const t=this.#a.get()??{},e=this.parentElement?.closest("tha-router-outlet"),r=e?.[Ve].get()??{};return Object.freeze({...r,...t})}),this.params={},this.#c=ye,this.#l=ye,this.#h=ye,this.for=null,this.routePath=null,this.routeID=void 0}#n;#i;#s;#a;#c;#l;#h;connectedCallback(){super.connectedCallback(),We(()=>{this.bindToRouter()}),this.#c=this.updateEffect(()=>{Array.from(this.renderRoot.children).forEach(t=>t.remove());const t=this.#s.get()?.deref()??null;t&&this.renderRoot.appendChild(t.cloneNode(!0))}),this.#l=this.updateEffect(()=>{const t=this.#i.get()?.deref()??null;this.routePath=t?.getAttribute("path")??null,this.routeID=t?.id?t?.id:void 0}),this.#h=this.updateEffect(()=>{const t=this[Ve].get();Array.from(this.attributes).filter(t=>t.name.startsWith("param-")).filter(e=>!(e.name.slice(6)in t)).forEach(t=>{this.removeAttribute(t.name)});for(const[e,r]of Object.entries(t))this.setAttribute(`param-${e}`,r??"");this.params=t})}bindToRouter(t){if(!t)if(this.for){t=this.getRootNode().querySelector(`tha-router#${this.for}`)??void 0}else t=this.closest("tha-router")??void 0;const e=this.#n?.get()?.deref()??null;return e===t?e:(e?.assignOutlet(null),t?.assignOutlet(this),this.#n.set(t?new WeakRef(t):void 0),t??null)}[(je=Ve,De)](t){this.#i.set(t?new WeakRef(t):null)}disconnectedCallback(){super.disconnectedCallback(),this.#n?.get()?.deref()?.assignOutlet(null);try{this.#c(),this.#l(),this.#h()}catch{}}createRenderRoot(){return this}},e([function(t){return pt({...t,state:!0,attribute:!1})}(),r("design:type",Object)],t.ThaRouterOutlet.prototype,"params",void 0),e([pt({type:String}),r("design:type",Object)],t.ThaRouterOutlet.prototype,"for",void 0),e([pt({type:String,reflect:!0}),r("design:type",Object)],t.ThaRouterOutlet.prototype,"routePath",void 0),e([pt({type:String,reflect:!0}),r("design:type",Object)],t.ThaRouterOutlet.prototype,"routeID",void 0),t.ThaRouterOutlet=e([ht("tha-router-outlet")],t.ThaRouterOutlet),t.ThaRouter=class extends(Le($e)){static{const t=document.createElement("style");t.setAttribute("type","text/css"),t.setAttribute("data-id","tha-router-styles"),t.textContent=c`
|
|
174
|
+
`}willUpdate(t){t.has("shade")&&(this.mixer=500===this.shade?"none":this.shade>500?"black":"white")}}e([pt({type:String,reflect:!0}),r("design:type",String)],ge.prototype,"color",void 0),e([pt({type:Number,reflect:!0,converter(t,e){const r=Number(t);return isNaN(r)?500:function(t,e,r){return Math.max(Math.min(e,r),t)}(0,1e3,r)}}),r("design:type",Number)],ge.prototype,"shade",void 0),e([pt({type:String,reflect:!0}),r("design:type",String)],ge.prototype,"mixer",void 0);const $e=Zt(ct);function _e(){return _e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},_e.apply(null,arguments)}var be;Zt(ge),function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(be||(be={}));var Se="production"!==process.env.NODE_ENV?function(t){return Object.freeze(t)}:function(t){return t};function we(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}var Ce="beforeunload",Ae="popstate";function Ee(t){void 0===t&&(t={});var e=t.window,r=void 0===e?document.defaultView:e,n=r.history;function o(){var t=Ne(r.location.hash.substr(1)),e=t.pathname,o=void 0===e?"/":e,i=t.search,s=void 0===i?"":i,a=t.hash,c=void 0===a?"":a,l=n.state||{};return[l.idx,Se({pathname:o,search:s,hash:c,state:l.usr||null,key:l.key||"default"})]}var i=null;function s(){if(i)d.call(i),i=null;else{var t=be.Pop,e=o(),r=e[0],n=e[1];if(d.length)if(null!=r){var s=l-r;s&&(i={action:t,location:n,retry:function(){g(-1*s)}},g(s))}else"production"!==process.env.NODE_ENV&&we(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else y(t)}}r.addEventListener(Ae,s),r.addEventListener("hashchange",function(){xe(o()[1])!==xe(h)&&s()});var a=be.Pop,c=o(),l=c[0],h=c[1],u=ke(),d=ke();function p(t){return function(){var t=document.querySelector("base"),e="";if(t&&t.getAttribute("href")){var n=r.location.href,o=n.indexOf("#");e=-1===o?n:n.slice(0,o)}return e}()+"#"+("string"==typeof t?t:xe(t))}function f(t,e){return void 0===e&&(e=null),Se(_e({pathname:h.pathname,hash:"",search:""},"string"==typeof t?Ne(t):t,{state:e,key:Oe()}))}function v(t,e){return[{usr:t.state,key:t.key,idx:e},p(t)]}function m(t,e,r){return!d.length||(d.call({action:t,location:e,retry:r}),!1)}function y(t){a=t;var e=o();l=e[0],h=e[1],u.call({action:a,location:h})}function g(t){n.go(t)}null==l&&(l=0,n.replaceState(_e({},n.state,{idx:l}),""));var $={get action(){return a},get location(){return h},createHref:p,push:function t(e,o){var i=be.Push,s=f(e,o);if("production"!==process.env.NODE_ENV&&we("/"===s.pathname.charAt(0),"Relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")"),m(i,s,function(){t(e,o)})){var a=v(s,l+1),c=a[0],h=a[1];try{n.pushState(c,"",h)}catch(t){r.location.assign(h)}y(i)}},replace:function t(e,r){var o=be.Replace,i=f(e,r);if("production"!==process.env.NODE_ENV&&we("/"===i.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(e)+")"),m(o,i,function(){t(e,r)})){var s=v(i,l),a=s[0],c=s[1];n.replaceState(a,"",c),y(o)}},go:g,back:function(){g(-1)},forward:function(){g(1)},listen:function(t){return u.push(t)},block:function(t){var e=d.push(t);return 1===d.length&&r.addEventListener(Ce,Te),function(){e(),d.length||r.removeEventListener(Ce,Te)}}};return $}function Re(t,e,r){return Math.min(Math.max(t,e),r)}function Te(t){t.preventDefault(),t.returnValue=""}function ke(){var t=[];return{get length(){return t.length},push:function(e){return t.push(e),function(){t=t.filter(function(t){return t!==e})}},call:function(e){t.forEach(function(t){return t&&t(e)})}}}function Oe(){return Math.random().toString(36).substr(2,8)}function xe(t){var e=t.pathname,r=void 0===e?"/":e,n=t.search,o=void 0===n?"":n,i=t.hash,s=void 0===i?"":i;return o&&"?"!==o&&(r+="?"===o.charAt(0)?o:"?"+o),s&&"#"!==s&&(r+="#"===s.charAt(0)?s:"#"+s),r}function Ne(t){var e={};if(t){var r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));var n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}const Pe={},Ue=ue("browser");function Me(t){let e=Pe[t];if(!e){switch(t){case"browser":e=function(t){void 0===t&&(t={});var e=t.window,r=void 0===e?document.defaultView:e,n=r.history;function o(){var t=r.location,e=t.pathname,o=t.search,i=t.hash,s=n.state||{};return[s.idx,Se({pathname:e,search:o,hash:i,state:s.usr||null,key:s.key||"default"})]}var i=null;r.addEventListener(Ae,function(){if(i)u.call(i),i=null;else{var t=be.Pop,e=o(),r=e[0],n=e[1];if(u.length)if(null!=r){var s=c-r;s&&(i={action:t,location:n,retry:function(){y(-1*s)}},y(s))}else"production"!==process.env.NODE_ENV&&we(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else m(t)}});var s=be.Pop,a=o(),c=a[0],l=a[1],h=ke(),u=ke();function d(t){return"string"==typeof t?t:xe(t)}function p(t,e){return void 0===e&&(e=null),Se(_e({pathname:l.pathname,hash:"",search:""},"string"==typeof t?Ne(t):t,{state:e,key:Oe()}))}function f(t,e){return[{usr:t.state,key:t.key,idx:e},d(t)]}function v(t,e,r){return!u.length||(u.call({action:t,location:e,retry:r}),!1)}function m(t){s=t;var e=o();c=e[0],l=e[1],h.call({action:s,location:l})}function y(t){n.go(t)}null==c&&(c=0,n.replaceState(_e({},n.state,{idx:c}),""));var g={get action(){return s},get location(){return l},createHref:d,push:function t(e,o){var i=be.Push,s=p(e,o);if(v(i,s,function(){t(e,o)})){var a=f(s,c+1),l=a[0],h=a[1];try{n.pushState(l,"",h)}catch(t){r.location.assign(h)}m(i)}},replace:function t(e,r){var o=be.Replace,i=p(e,r);if(v(o,i,function(){t(e,r)})){var s=f(i,c),a=s[0],l=s[1];n.replaceState(a,"",l),m(o)}},go:y,back:function(){y(-1)},forward:function(){y(1)},listen:function(t){return h.push(t)},block:function(t){var e=u.push(t);return 1===u.length&&r.addEventListener(Ce,Te),function(){e(),u.length||r.removeEventListener(Ce,Te)}}};return g}();break;case"hash":e=Ee();break;default:e=function(t){void 0===t&&(t={});var e=t,r=e.initialEntries,n=void 0===r?["/"]:r,o=e.initialIndex,i=n.map(function(t){var e=Se(_e({pathname:"/",search:"",hash:"",state:null,key:Oe()},"string"==typeof t?Ne(t):t));return"production"!==process.env.NODE_ENV&&we("/"===e.pathname.charAt(0),"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(t)+")"),e}),s=Re(null==o?i.length-1:o,0,i.length-1),a=be.Pop,c=i[s],l=ke(),h=ke();function u(t,e){return void 0===e&&(e=null),Se(_e({pathname:c.pathname,search:"",hash:""},"string"==typeof t?Ne(t):t,{state:e,key:Oe()}))}function d(t,e,r){return!h.length||(h.call({action:t,location:e,retry:r}),!1)}function p(t,e){a=t,c=e,l.call({action:a,location:c})}function f(t){var e=Re(s+t,0,i.length-1),r=be.Pop,n=i[e];d(r,n,function(){f(t)})&&(s=e,p(r,n))}var v={get index(){return s},get action(){return a},get location(){return c},createHref:function(t){return"string"==typeof t?t:xe(t)},push:function t(e,r){var n=be.Push,o=u(e,r);"production"!==process.env.NODE_ENV&&we("/"===c.pathname.charAt(0),"Relative pathnames are not supported in memory history.push("+JSON.stringify(e)+")"),d(n,o,function(){t(e,r)})&&(s+=1,i.splice(s,i.length,o),p(n,o))},replace:function t(e,r){var n=be.Replace,o=u(e,r);"production"!==process.env.NODE_ENV&&we("/"===c.pathname.charAt(0),"Relative pathnames are not supported in memory history.replace("+JSON.stringify(e)+")"),d(n,o,function(){t(e,r)})&&(i[s]=o,p(n,o))},go:f,back:function(){f(-1)},forward:function(){f(1)},listen:function(t){return l.push(t)},block:function(t){return h.push(t)}};return v}()}Pe[t]=e}return e}de(()=>Me(Ue.get()));const Ie=Symbol("HistoryManaged:history"),He=Symbol("HistoryManaged:historyType"),Le=t=>{var n,o;class i extends t{constructor(){super(...arguments),this.history=void 0,this.#r=ue(this.history),this.#n=de(()=>{const t=this.parentElement?.closest("tha-router-config, tha-router-outlet");return t?.[He]?.get()}),this[n]=de(()=>this.#r.get()??this.#n.get()??Ue.get()),this[o]=de(()=>Me(this[He].get()))}static{n=He,o=Ie}#r;#n;attributeChangedCallback(t,e,r){if(super.attributeChangedCallback(t,e,r),"history"===t)this.#r.set(r)}}return e([pt({type:String}),r("design:type",Object)],i.prototype,"history",void 0),i};function We(t=ye){return new Promise((e,r)=>{setTimeout(()=>{try{const r=t();e(r)}catch(t){r(t)}},0)})}var je;const De=Symbol("ThaRouterOutlet:renderRoute"),Ve=Symbol("ThaRouterOutlet:params");function qe(t){return!!t}function ze(t){return t.filter(qe)}t.ThaRouterOutlet=class extends $e{constructor(){super(...arguments),this.#o=ue(void 0),this.#i=ue(null),this.#s=de(()=>this.#i.get()?.deref()?.[ve].get()??null),this.#a=de(()=>{const t=this.#o.get()?.deref(),e=this.#i.get()?.deref(),r=e?.[me];if(!t||!r)return null;const{location:{pathname:n}}=t[Ie].get();return r.exec(n,"http://dummy.base")?.pathname.groups??null}),this[je]=de(()=>{const t=this.#a.get()??{},e=this.parentElement?.closest("tha-router-outlet"),r=e?.[Ve].get()??{};return Object.freeze({...r,...t})}),this.params={},this.#c=ye,this.#l=ye,this.#h=ye,this.for=null,this.routePath=null,this.routeID=void 0}#o;#i;#s;#a;#c;#l;#h;connectedCallback(){super.connectedCallback(),We(()=>{this.bindToRouter()}),this.#c=this.updateEffect(()=>{Array.from(this.renderRoot.children).forEach(t=>t.remove());const t=this.#s.get()?.deref()??null;t&&this.renderRoot.appendChild(t.cloneNode(!0))}),this.#l=this.updateEffect(()=>{const t=this.#i.get()?.deref()??null;this.routePath=t?.getAttribute("path")??null,this.routeID=t?.id?t?.id:void 0}),this.#h=this.updateEffect(()=>{const t=this[Ve].get();Array.from(this.attributes).filter(t=>t.name.startsWith("param-")).filter(e=>!(e.name.slice(6)in t)).forEach(t=>{this.removeAttribute(t.name)});for(const[e,r]of Object.entries(t))this.setAttribute(`param-${e}`,r??"");this.params=t})}bindToRouter(t){if(!t)if(this.for){t=this.getRootNode().querySelector(`tha-router#${this.for}`)??void 0}else t=this.closest("tha-router")??void 0;const e=this.#o?.get()?.deref()??null;return e===t?e:(e?.assignOutlet(null),t?.assignOutlet(this),this.#o.set(t?new WeakRef(t):void 0),t??null)}[(je=Ve,De)](t){this.#i.set(t?new WeakRef(t):null)}disconnectedCallback(){super.disconnectedCallback(),this.#o?.get()?.deref()?.assignOutlet(null);try{this.#c(),this.#l(),this.#h()}catch{}}createRenderRoot(){return this}},e([function(t){return pt({...t,state:!0,attribute:!1})}(),r("design:type",Object)],t.ThaRouterOutlet.prototype,"params",void 0),e([pt({type:String}),r("design:type",Object)],t.ThaRouterOutlet.prototype,"for",void 0),e([pt({type:String,reflect:!0}),r("design:type",Object)],t.ThaRouterOutlet.prototype,"routePath",void 0),e([pt({type:String,reflect:!0}),r("design:type",Object)],t.ThaRouterOutlet.prototype,"routeID",void 0),t.ThaRouterOutlet=e([ht("tha-router-outlet")],t.ThaRouterOutlet),t.ThaRouter=class extends(Le($e)){static{const t=document.createElement("style");t.setAttribute("type","text/css"),t.setAttribute("data-id","tha-router-styles"),t.textContent=c`
|
|
175
175
|
tha-router {
|
|
176
176
|
& > :not(tha-router-outlet) {
|
|
177
177
|
display: none;
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
`.toString(),document.head.appendChild(t)}#u=new MutationObserver(e=>{e.filter(t=>"childList"===t.type).length&&this.#d.set(Array.from(this.children).filter(e=>e instanceof t.ThaRoute).map(t=>new WeakRef(t)))});#p=ye;#f=ye;#v=ye;#d=ue([]);#m=ue(null);#y=ue(null);connectedCallback(){super.connectedCallback(),this.#u.observe(this,{childList:!0}),this.#p=this.updateEffect(()=>{const t=this.#m.get()?.deref()??null,e=this.#y.get()?.deref()??null;e?.[De](t)}),this.#f=this.updateEffect(()=>{const t=this[Ie].get();this.#v(),this.#g({location:this[Ie].get().location,action:"POP"}),this.#v=t?t.listen(this.#g):ye}),We(()=>{this.#g({location:this[Ie].get().location,action:"POP"})})}assignOutlet(t){this.#y.set(t?new WeakRef(t):null)}#g=t=>{const e=this.#d.get().map(t=>t.deref()).filter(Boolean);for(const r of e){const e=r[me];if(e?.test({pathname:t.location.pathname}))return void this.#m.set(new WeakRef(r))}this.#m.set(null)};disconnectedCallback(){super.disconnectedCallback();try{this.#p(),this.#f()}catch{}this.#u.disconnect(),this.#v()}createRenderRoot(){return this}},t.ThaRouter=e([ht("tha-router")],t.ThaRouter),t.ThaRouterLink=class extends(Le($e)){constructor(){super(...arguments),this.to=null,this.active=!1,this.#$=ye,this.#v=ye,this.#_=ue(null),this.#b=de(()=>{const t=this.#_.get();if(!t||"back"===t||"forward"===t)return null;try{return new URLPattern({pathname:t})}catch{return null}}),this.#S=t=>{const e=this[Ie].get();if(console.log(this[He].get()),"back"===this.to)return e.back();if("forward"===this.to)return e.forward();const r=e.location.pathname+e.location.search+e.location.hash;let
|
|
180
|
+
`.toString(),document.head.appendChild(t)}#u=new MutationObserver(e=>{e.filter(t=>"childList"===t.type).length&&this.#d.set(Array.from(this.children).filter(e=>e instanceof t.ThaRoute).map(t=>new WeakRef(t)))});#p=ye;#f=ye;#v=ye;#d=ue([]);#m=ue(null);#y=ue(null);connectedCallback(){super.connectedCallback(),this.#u.observe(this,{childList:!0}),this.#p=this.updateEffect(()=>{const t=this.#m.get()?.deref()??null,e=this.#y.get()?.deref()??null;e?.[De](t)}),this.#f=this.updateEffect(()=>{const t=this[Ie].get();this.#v(),this.#g({location:this[Ie].get().location,action:"POP"}),this.#v=t?t.listen(this.#g):ye}),We(()=>{this.#g({location:this[Ie].get().location,action:"POP"})})}assignOutlet(t){this.#y.set(t?new WeakRef(t):null)}#g=t=>{const e=this.#d.get().map(t=>t.deref()).filter(Boolean);for(const r of e){const e=r[me];if(e?.test({pathname:t.location.pathname}))return void this.#m.set(new WeakRef(r))}this.#m.set(null)};disconnectedCallback(){super.disconnectedCallback();try{this.#p(),this.#f()}catch{}this.#u.disconnect(),this.#v()}createRenderRoot(){return this}},t.ThaRouter=e([ht("tha-router")],t.ThaRouter),t.ThaRouterLink=class extends(Le($e)){constructor(){super(...arguments),this.to=null,this.active=!1,this.#$=ye,this.#v=ye,this.#_=ue(null),this.#b=de(()=>{const t=this.#_.get();if(!t||"back"===t||"forward"===t)return null;try{return new URLPattern({pathname:t})}catch{return null}}),this.#S=t=>{const e=this[Ie].get();if(console.log(this[He].get()),"back"===this.to)return e.back();if("forward"===this.to)return e.forward();const r=e.location.pathname+e.location.search+e.location.hash;let n=this.to;if(n?.startsWith(".")){const t=ze(r.split("/")),e=ze(n.split("/"));for(const r of e)".."===r?t.pop():"."!==r&&t.push(r);n="/"+t.join("/")}n=n?.replaceAll("//","/"),this[Ie].get()?.push(n||"/")}}static{const t=document.createElement("style");t.setAttribute("type","text/css"),t.setAttribute("data-id","tha-router-link-styles"),t.textContent=c`
|
|
181
181
|
tha-router-link {
|
|
182
182
|
cursor: pointer;
|
|
183
183
|
}
|