1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
| var e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap,i=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,n=this.t;if(t&&e===void 0){let t=n!==void 0&&n.length===1;t&&(e=r.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(n,e))}return e}toString(){return this.cssText}},a=e=>new i(typeof e==`string`?e:e+``,void 0,n),o=(e,...t)=>new i(e.length===1?e[0]:t.reduce((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1],e[0]),e,n),s=(n,r)=>{if(t)n.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let t of r){let r=document.createElement(`style`),i=e.litNonce;i!==void 0&&r.setAttribute(`nonce`,i),r.textContent=t.cssText,n.appendChild(r)}},c=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return a(t)})(e):e,{is:l,defineProperty:u,getOwnPropertyDescriptor:d,getOwnPropertyNames:f,getOwnPropertySymbols:p,getPrototypeOf:m}=Object,ee=globalThis,te=ee.trustedTypes,ne=te?te.emptyScript:``,re=ee.reactiveElementPolyfillSupport,h=(e,t)=>e,ie={toAttribute(e,t){switch(t){case Boolean:e=e?ne:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},ae=(e,t)=>!l(e,t),oe={attribute:!0,type:String,converter:ie,reflect:!1,useDefault:!1,hasChanged:ae};Symbol.metadata??=Symbol(`metadata`),ee.litPropertyMetadata??=new WeakMap;var g=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=oe){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&u(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=d(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??oe}static _$Ei(){if(this.hasOwnProperty(h(`elementProperties`)))return;let e=m(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(h(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(h(`properties`))){let e=this.properties,t=[...f(e),...p(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(c(e))}else e!==void 0&&t.push(c(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.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(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?ie:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?ie:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??ae)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};g.elementStyles=[],g.shadowRootOptions={mode:`open`},g[h(`elementProperties`)]=new Map,g[h(`finalized`)]=new Map,re?.({ReactiveElement:g}),(ee.reactiveElementVersions??=[]).push(`2.1.2`);var se=globalThis,ce=e=>e,le=se.trustedTypes,ue=le?le.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,de=`$lit$`,_=`lit$${Math.random().toFixed(9).slice(2)}$`,fe=`?`+_,pe=`<${fe}>`,v=document,y=()=>v.createComment(``),b=e=>e===null||typeof e!=`object`&&typeof e!=`function`,me=Array.isArray,he=e=>me(e)||typeof e?.[Symbol.iterator]==`function`,ge=`[
| \f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_e=/-->/g,ve=/>/g,S=RegExp(`>|${ge}(?:([^\\s"'>=/]+)(${ge}*=${ge}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),ye=/'/g,be=/"/g,xe=/^(?:script|style|textarea|title)$/i,Se=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),C=Symbol.for(`lit-noChange`),w=Symbol.for(`lit-nothing`),Ce=new WeakMap,T=v.createTreeWalker(v,129);function we(e,t){if(!me(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return ue===void 0?t:ue.createHTML(t)}var Te=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=x;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===x?c[1]===`!--`?o=_e:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=S):(xe.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=S):o=ve:o===S?c[0]===`>`?(o=i??x,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?S:c[3]===`"`?be:ye):o===be||o===ye?o=S:o===_e||o===ve?o=x:(o=S,i=void 0);let d=o===S&&e[t+1].startsWith(`/>`)?` `:``;a+=o===x?n+pe:l>=0?(r.push(s),n.slice(0,l)+de+n.slice(l)+_+d):n+_+(l===-2?t:d)}return[we(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},Ee=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=Te(t,n);if(this.el=e.createElement(l,r),T.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=T.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(de)){let t=u[o++],n=i.getAttribute(e).split(_),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?ke:r[1]===`?`?Ae:r[1]===`@`?je:D}),i.removeAttribute(e)}else e.startsWith(_)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(xe.test(i.tagName)){let e=i.textContent.split(_),t=e.length-1;if(t>0){i.textContent=le?le.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],y()),T.nextNode(),c.push({type:2,index:++a});i.append(e[t],y())}}}else if(i.nodeType===8)if(i.data===fe)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(_,e+1))!==-1;)c.push({type:7,index:a}),e+=_.length-1}a++}}static createElement(e,t){let n=v.createElement(`template`);return n.innerHTML=e,n}};function E(e,t,n=e,r){if(t===C)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=b(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=E(e,i._$AS(e,t.values),i,r)),t}var De=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??v).importNode(t,!0);T.currentNode=r;let i=T.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new Oe(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new Me(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=T.nextNode(),a++)}return T.currentNode=v,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},Oe=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=E(this,e,t),b(e)?e===w||e==null||e===``?(this._$AH!==w&&this._$AR(),this._$AH=w):e!==this._$AH&&e!==C&&this._(e):e._$litType$===void 0?e.nodeType===void 0?he(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==w&&b(this._$AH)?this._$AA.nextSibling.data=e:this.T(v.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=Ee.createElement(we(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new De(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=Ce.get(e.strings);return t===void 0&&Ce.set(e.strings,t=new Ee(e)),t}k(t){me(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(y()),this.O(y()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=ce(e).nextSibling;ce(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},D=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=w,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=w}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=E(this,e,t,0),a=!b(e)||e!==this._$AH&&e!==C,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=E(this,r[n+o],t,o),s===C&&(s=this._$AH[o]),a||=!b(s)||s!==this._$AH[o],s===w?e=w:e!==w&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},ke=class extends D{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===w?void 0:e}},Ae=class extends D{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==w)}},je=class extends D{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=E(this,e,t,0)??w)===C)return;let n=this._$AH,r=e===w&&n!==w||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==w&&(n===w||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Me=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){E(this,e)}},Ne={M:de,P:_,A:fe,C:1,L:Te,R:De,D:he,V:E,I:Oe,H:D,N:Ae,U:je,B:ke,F:Me},Pe=se.litHtmlPolyfillSupport;Pe?.(Ee,Oe),(se.litHtmlVersions??=[]).push(`3.3.3`);var Fe=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new Oe(t.insertBefore(y(),e),e,void 0,n??{})}return i._$AI(e),i},Ie=globalThis,O=class extends g{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Fe(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return C}};O._$litElement$=!0,O.finalized=!0,Ie.litElementHydrateSupport?.({LitElement:O});var Le=Ie.litElementPolyfillSupport;Le?.({LitElement:O}),(Ie.litElementVersions??=[]).push(`4.2.2`);var Re=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},ze={attribute:!0,type:String,converter:ie,reflect:!1,hasChanged:ae},Be=(e=ze,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function Ve(e){return(t,n)=>typeof n==`object`?Be(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function He(e){return Ve({...e,state:!0,attribute:!1})}var Ue=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function We(e,t){return(n,r,i)=>{let a=t=>t.renderRoot?.querySelector(e)??null;if(t){let{get:e,set:t}=typeof r==`object`?n:i??(()=>{let e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})();return Ue(n,r,{get(){let n=e.call(this);return n===void 0&&(n=a(this),(n!==null||this.hasUpdated)&&t.call(this,n)),n}})}return Ue(n,r,{get(){return a(this)}})}}function Ge(e){return(t,n)=>Ue(t,n,{async get(){return await this.updateComplete,this.renderRoot?.querySelector(e)??null}})}var Ke=(e,t,n)=>{for(let n of t)if(n[0]===e)return(0,n[1])();return n?.()},qe={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Je=e=>(...t)=>({_$litDirective$:e,values:t}),Ye=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},Xe={},Ze=Je(class extends Ye{constructor(){super(...arguments),this.ot=Xe}render(e,t){return t()}update(e,[t,n]){if(Array.isArray(t)){if(Array.isArray(this.ot)&&this.ot.length===t.length&&t.every((e,t)=>e===this.ot[t]))return C}else if(this.ot===t)return C;return this.ot=Array.isArray(t)?Array.from(t):t,this.render(t,n)}}),Qe=Je(class extends Ye{constructor(e){if(super(e),e.type!==qe.ATTRIBUTE||e.name!==`class`||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return` `+Object.keys(e).filter(t=>e[t]).join(` `)+` `}update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(` `).split(/\s/).filter(e=>e!==``)));for(let e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}let n=e.element.classList;for(let e of this.st)e in t||(n.remove(e),this.st.delete(e));for(let e in t){let r=!!t[e];r===this.st.has(e)||this.nt?.has(e)||(r?(n.add(e),this.st.add(e)):(n.remove(e),this.st.delete(e)))}return C}}),$e=e=>e??w,{I:et}=Ne,tt=e=>e,nt=()=>document.createComment(``),k=(e,t,n)=>{let r=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0)n=new et(r.insertBefore(nt(),i),r.insertBefore(nt(),i),e,e.options);else{let t=n._$AB.nextSibling,a=n._$AM,o=a!==e;if(o){let t;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(t=e._$AU)!==a._$AU&&n._$AP(t)}if(t!==i||o){let e=n._$AA;for(;e!==t;){let t=tt(e).nextSibling;tt(r).insertBefore(e,i),e=t}}}return n},A=(e,t,n=e)=>(e._$AI(t,n),e),rt={},it=(e,t=rt)=>e._$AH=t,at=e=>e._$AH,ot=e=>{e._$AR(),e._$AA.remove()},st=(e,t,n)=>{let r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},ct=Je(class extends Ye{constructor(e){if(super(e),e.type!==qe.CHILD)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,r]){let i=at(e),{values:a,keys:o}=this.dt(t,n,r);if(!Array.isArray(i))return this.ut=o,a;let s=this.ut??=[],c=[],l,u,d=0,f=i.length-1,p=0,m=a.length-1;for(;d<=f&&p<=m;)if(i[d]===null)d++;else if(i[f]===null)f--;else if(s[d]===o[p])c[p]=A(i[d],a[p]),d++,p++;else if(s[f]===o[m])c[m]=A(i[f],a[m]),f--,m--;else if(s[d]===o[m])c[m]=A(i[d],a[m]),k(e,c[m+1],i[d]),d++,m--;else if(s[f]===o[p])c[p]=A(i[f],a[p]),k(e,i[d],i[f]),f--,p++;else if(l===void 0&&(l=st(o,p,m),u=st(s,d,f)),l.has(s[d]))if(l.has(s[f])){let t=u.get(o[p]),n=t===void 0?null:i[t];if(n===null){let t=k(e,i[d]);A(t,a[p]),c[p]=t}else c[p]=A(n,a[p]),k(e,i[d],n),i[t]=null;p++}else ot(i[f]),f--;else ot(i[d]),d++;for(;p<=m;){let t=k(e,c[m+1]);A(t,a[p]),c[p++]=t}for(;d<=f;){let e=i[d++];e!==null&&ot(e)}return this.ut=o,it(e,c),C}}),lt=Je(class extends Ye{constructor(){super(...arguments),this.key=w}render(e,t){return this.key=e,t}update(e,[t,n]){return t!==this.key&&(it(e),this.key=t),n}}),ut=globalThis,dt=ut.ShadowRoot&&(ut.ShadyCSS===void 0||ut.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,ft=Symbol(),pt=new WeakMap,mt=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==ft)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(dt&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=pt.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&pt.set(t,e))}return e}toString(){return this.cssText}},ht=e=>new mt(typeof e==`string`?e:e+``,void 0,ft),gt=(e,...t)=>new mt(e.length===1?e[0]:t.reduce(((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1]),e[0]),e,ft),_t=(e,t)=>{if(dt)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let n of t){let t=document.createElement(`style`),r=ut.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},vt=dt?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return ht(t)})(e):e,{is:yt,defineProperty:bt,getOwnPropertyDescriptor:xt,getOwnPropertyNames:St,getOwnPropertySymbols:Ct,getPrototypeOf:wt}=Object,Tt=globalThis,Et=Tt.trustedTypes,Dt=Et?Et.emptyScript:``,Ot=Tt.reactiveElementPolyfillSupport,j=(e,t)=>e,kt={toAttribute(e,t){switch(t){case Boolean:e=e?Dt:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},At=(e,t)=>!yt(e,t),jt={attribute:!0,type:String,converter:kt,reflect:!1,useDefault:!1,hasChanged:At};Symbol.metadata??=Symbol(`metadata`),Tt.litPropertyMetadata??=new WeakMap;var M=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=jt){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&bt(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=xt(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??jt}static _$Ei(){if(this.hasOwnProperty(j(`elementProperties`)))return;let e=wt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(j(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(j(`properties`))){let e=this.properties,t=[...St(e),...Ct(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(vt(e))}else e!==void 0&&t.push(vt(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.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((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return _t(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?kt:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?kt:e.converter;this._$Em=r,this[r]=i.fromAttribute(t,e.type)??this._$Ej?.get(r)??null,this._$Em=null}}requestUpdate(e,t,n){if(e!==void 0){let r=this.constructor,i=this[e];if(n??=r.getPropertyOptions(e),!((n.hasChanged??At)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};M.elementStyles=[],M.shadowRootOptions={mode:`open`},M[j(`elementProperties`)]=new Map,M[j(`finalized`)]=new Map,Ot?.({ReactiveElement:M}),(Tt.reactiveElementVersions??=[]).push(`2.1.0`);var Mt=globalThis,Nt=Mt.trustedTypes,Pt=Nt?Nt.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,Ft=`$lit$`,N=`lit$${Math.random().toFixed(9).slice(2)}$`,It=`?`+N,Lt=`<${It}>`,P=document,F=()=>P.createComment(``),I=e=>e===null||typeof e!=`object`&&typeof e!=`function`,Rt=Array.isArray,zt=e=>Rt(e)||typeof e?.[Symbol.iterator]==`function`,Bt=`[
| \f\r]`,L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Vt=/-->/g,Ht=/>/g,R=RegExp(`>|${Bt}(?:([^\\s"'>=/]+)(${Bt}*=${Bt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),Ut=/'/g,Wt=/"/g,Gt=/^(?:script|style|textarea|title)$/i,Kt=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),z=Symbol.for(`lit-noChange`),B=Symbol.for(`lit-nothing`),qt=new WeakMap,V=P.createTreeWalker(P,129);function Jt(e,t){if(!Rt(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return Pt===void 0?t:Pt.createHTML(t)}var Yt=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=L;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===L?c[1]===`!--`?o=Vt:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=R):(Gt.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=R):o=Ht:o===R?c[0]===`>`?(o=i??L,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?R:c[3]===`"`?Wt:Ut):o===Wt||o===Ut?o=R:o===Vt||o===Ht?o=L:(o=R,i=void 0);let d=o===R&&e[t+1].startsWith(`/>`)?` `:``;a+=o===L?n+Lt:l>=0?(r.push(s),n.slice(0,l)+Ft+n.slice(l)+N+d):n+N+(l===-2?t:d)}return[Jt(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},Xt=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=Yt(t,n);if(this.el=e.createElement(l,r),V.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=V.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(Ft)){let t=u[o++],n=i.getAttribute(e).split(N),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?$t:r[1]===`?`?en:r[1]===`@`?tn:U}),i.removeAttribute(e)}else e.startsWith(N)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(Gt.test(i.tagName)){let e=i.textContent.split(N),t=e.length-1;if(t>0){i.textContent=Nt?Nt.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],F()),V.nextNode(),c.push({type:2,index:++a});i.append(e[t],F())}}}else if(i.nodeType===8)if(i.data===It)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(N,e+1))!==-1;)c.push({type:7,index:a}),e+=N.length-1}a++}}static createElement(e,t){let n=P.createElement(`template`);return n.innerHTML=e,n}};function H(e,t,n=e,r){if(t===z)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=I(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=H(e,i._$AS(e,t.values),i,r)),t}var Zt=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??P).importNode(t,!0);V.currentNode=r;let i=V.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new Qt(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new nn(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=V.nextNode(),a++)}return V.currentNode=P,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},Qt=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=B,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=H(this,e,t),I(e)?e===B||e==null||e===``?(this._$AH!==B&&this._$AR(),this._$AH=B):e!==this._$AH&&e!==z&&this._(e):e._$litType$===void 0?e.nodeType===void 0?zt(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==B&&I(this._$AH)?this._$AA.nextSibling.data=e:this.T(P.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=Xt.createElement(Jt(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new Zt(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=qt.get(e.strings);return t===void 0&&qt.set(e.strings,t=new Xt(e)),t}k(t){Rt(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(F()),this.O(F()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){let t=e.nextSibling;e.remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},U=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=B,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=B}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=H(this,e,t,0),a=!I(e)||e!==this._$AH&&e!==z,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=H(this,r[n+o],t,o),s===z&&(s=this._$AH[o]),a||=!I(s)||s!==this._$AH[o],s===B?e=B:e!==B&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===B?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},$t=class extends U{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===B?void 0:e}},en=class extends U{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==B)}},tn=class extends U{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=H(this,e,t,0)??B)===z)return;let n=this._$AH,r=e===B&&n!==B||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==B&&(n===B||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},nn=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){H(this,e)}},rn={M:Ft,P:N,A:It,C:1,L:Yt,R:Zt,D:zt,V:H,I:Qt,H:U,N:en,U:tn,B:$t,F:nn},an=Mt.litHtmlPolyfillSupport;an?.(Xt,Qt),(Mt.litHtmlVersions??=[]).push(`3.3.0`);var on=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new Qt(t.insertBefore(F(),e),e,void 0,n??{})}return i._$AI(e),i},sn=globalThis,W=class extends M{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=on(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return z}};W._$litElement$=!0,W.finalized=!0,sn.litElementHydrateSupport?.({LitElement:W});var cn=sn.litElementPolyfillSupport;cn?.({LitElement:W}),(sn.litElementVersions??=[]).push(`4.2.0`);var ln=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer((()=>{customElements.define(e,t)}))},un={attribute:!0,type:String,converter:kt,reflect:!1,hasChanged:At},dn=(e=un,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e)}}throw Error(`Unsupported decorator location: `+r)};function fn(e){return(t,n)=>typeof n==`object`?dn(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function pn(e){return fn({...e,state:!0,attribute:!1})}var mn=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function hn(e,t){return(n,r,i)=>{let a=t=>t.renderRoot?.querySelector(e)??null;if(t){let{get:e,set:t}=typeof r==`object`?n:i??(()=>{let e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})();return mn(n,r,{get(){let n=e.call(this);return n===void 0&&(n=a(this),(n!==null||this.hasUpdated)&&t.call(this,n)),n}})}return mn(n,r,{get(){return a(this)}})}}var gn;function _n(e){return(t,n)=>mn(t,n,{get(){return(this.renderRoot??(gn??=document.createDocumentFragment())).querySelectorAll(e)}})}function vn(e){return(t,n)=>mn(t,n,{async get(){return await this.updateComplete,this.renderRoot?.querySelector(e)??null}})}var yn=class{constructor(e){this.listeners=new Set,this.startListenHook=e?.startListen||null,this.stopListenHook=e?.stopListen||null}on(e){return this.listeners.size===0&&this.startListenHook?.(),this.listeners.add(e),{unsubscribe:()=>this.off(e)}}off(e){let t=this.listeners.delete(e);return t&&this.listeners.size<1&&this.stopListenHook?.(),t}once(e){let t=(...n)=>{this.off(t),e(...n)};return this.on(t)}async emit(...e){let t=[];for(let n of[...this.listeners])t.push(n(...e));await Promise.all(t.filter(Boolean))}hasListener(){return!!this.listeners.size}asPromise(){return new Promise(e=>this.once(e))}clear(){this.hasListener()&&(this.listeners.clear(),this.stopListenHook?.())}dispose(){this.listeners.clear(),this.startListenHook=null,this.stopListenHook=null}},bn=class{constructor(e){this._listeners=new Map,this._linked=new Set,this._callstack=[],this._hooks={startListen:new yn,stopListen:new yn},e?.startListen&&this._hooks.startListen.on(e.startListen),e?.stopListen&&this._hooks.stopListen.on(e.stopListen)}_getListeners(e){let t=this._listeners.get(e);return t||(t=new yn({startListen:()=>this._hooks.startListen.emit(e),stopListen:()=>this._hooks.stopListen.emit(e)}),this._listeners.set(e,t)),t}startListen(e){return this._hooks.startListen.on(e)}stopListen(e){return this._hooks.stopListen.on(e)}has(e){return!!this._listeners.get(e)?.hasListener()}listeners(){return[...this._listeners.keys()]}on(e,t){return this._getListeners(e).on(t)}off(e,t){return this._listeners.get(e)?.off(t)??!1}once(e,t){return this._getListeners(e).once(t)}async emit(e,...t){let n=[],r=this._listeners.get(e);r&&n.push(r.emit(...t));for(let r of[...this._linked])if(!r.hasLinkTo?.(this))n.push(r.emit(e,...t));else{let i=r._listeners.get(e);n.push(i.emit(...t))}await Promise.all(n.filter(Boolean))}asPromise(e){return this._getListeners(e).asPromise()}link(e){if(!this._linked.has(e)&&(this._linked.add(e),this._hooks.startListen.hasListener()&&e.listeners)){let t=e.listeners().filter(e=>!this._listeners.has(e));for(let e of t)this._hooks.startListen.emit(e)}}unlink(e){return this._linked.delete(e)}hasLinkTo(e){if(!this._linked.size)return!1;if(this._linked.has(e))return!0;for(let t of this._linked)if(t.hasLinkTo?.(e))return!0;return!1}isEmpty(){if(this._listeners.size>0)return!0;for(let e of this._linked)if(e.isEmpty&&!e.isEmpty())return!0;return!1}clear(){this._linked.clear(),this._listeners.clear()}},xn=class{promise;resolve;reject;constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}},Sn=0;function Cn(){return(++Sn).toString()}var G=new class{stats=new Map;labels={};start(e,t=``){if(this.labels[e]){this.labels[e].push(t);return}e===`REQUEST`&&this.end(`IDLE`),this.labels[e]=[t],performance.mark(`start.${e}`)}push(e,t){if(this.stats.has(e)){let n=this.stats.get(e);n.sum+=t,n.count++}else this.stats.set(e,{sum:t,count:1})}end(e,t=``){if(!this.labels[e]||(this.labels[e].pop(),this.labels[e].length>0))return;performance.mark(`end.`+e),this.labels[e]=void 0;let n=performance.measure(e,`start.`+e,`end.`+e).duration;this.push(e,n),e===`REQUEST`&&this.start(`IDLE`)}reset(e){this.stats.has(e)&&this.stats.delete(e)}get(e){return this.stats.get(e)}getAll(){return this.stats}log(e){let t=this.stats.get(e);t&&console.log(`${e}: ${t.sum} ms and called ${t.count} times`)}},wn=class{constructor(e){this._hooks=e}_localListener=new Map;_remoteListener=new Map;create(e){return this._localListener.has(e)||this._localListener.set(e,new bn({startListen:t=>this._hooks.startLocalListen(e,t),stopListen:t=>this._hooks.stopLocalListen(e,t)})),this._localListener.get(e)}onLocal(e,t,n){return this.create(e).on(t,n)}onceLocal(e,t,n){return this.create(e).once(t,n)}emitFromRemote(e,t,...n){let r=this._localListener.get(e);if(r)return r.emit(t,...n)}getEventRemotes(e){return[...this._remoteListener.get(e)]}hasRemoteListener(e){return this._remoteListener.has(e)}addRemoteListener(e,t){let n=this._remoteListener.get(t);n||(n=new Set,this._remoteListener.set(t,n)),n.add(e)}removeRemote(e){this._localListener.delete(e);for(let[t,n]of[...this._remoteListener])n.delete(e),n.size===0&&this._remoteListener.delete(t)}},K=(e=>(e[e.UNKNOWN=0]=`UNKNOWN`,e[e.DISCONNECTED=1]=`DISCONNECTED`,e[e.DISCONNECTING=2]=`DISCONNECTING`,e[e.CONNECTING=3]=`CONNECTING`,e[e.RECONNECTING=4]=`RECONNECTING`,e[e.CONNECTED=5]=`CONNECTED`,e[e.READY=6]=`READY`,e))(K||{}),Tn=class e extends bn{static _INSTANCE_COUNTER=0;verbosity=1;_debugName;_communicator;_status=1;_stats={received:0,send:0,sumLength:0,maxLength:0,maxLengthCommand:``,workTime:0,maxTime:0,maxTimeCommand:``};constructor(){super(),this._debugName=this.constructor.name+`-`+ ++e._INSTANCE_COUNTER}setCommunicator(e,t){this._communicator=e.registerConnector(this,t)}sendHandshake(){this.setStatus(5),this._communicator.sendHandshake(this)}dispose(){super.clear(),this._communicator.removeConnector(this)}receiveMessage(e){this._communicator.receiveMessage(this,e)}receiveRequest(e){return this._communicator.receiveRequest(this,e)}_ready(){this._status!==6&&(this.setStatus(6),this.emit(`ready`))}isReady(){return this._status===6}getStatus(){return this._status}setStatus(e){if(e!==this._status){let t=this._status;this._status=e,this.emit(`status`,e,t),t===6&&this.emit(`disconnect`,e)}}updateIncomingStats(e,t=0){this._stats.sumLength+=t,this._stats.received++,t>this._stats.maxLength&&(this._stats.maxLength=t,this._stats.maxLengthCommand=e.header.command),e.header.work&&(this._stats.workTime+=e.header.work,e.header.work>this._stats.maxTime&&(this._stats.maxTime=e.header.work,this._stats.maxTimeCommand=e.header.command)),this.emit(`stats`,this._stats)}updateOutgoingStats(e,t=0){this._stats.sumLength+=t,this._stats.send++,t>this._stats.maxLength&&(this._stats.maxLength=t,this._stats.maxLengthCommand=e.header.command),this.emit(`stats`,this._stats)}getStats(){return{type:this.type,status:`${K[this._status]} (${this._status})`,...this._stats}}getDebugName(){return this._debugName}setDebugName(e){this._debugName=e}setVerbosity(e){this.verbosity=e}},En=class extends Tn{_pending=new Map;constructor(){super()}registerRequest(e){typeof e==`object`&&(e=e.reqId);let t=new xn;return this._pending.set(e,t),t.promise}resolveRequest(e){let t=this._pending.get(e.header.resId);return t?(e.header.err?t.reject(e.header.err):t.resolve(e),!0):(console.error(`No matching request found for response ID:`,e.header.resId),!1)}createResponseHeader(e){let t={};for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let r=e[n];n==`reqId`&&(n=`resId`),n==`from`?n=`to`:n==`to`&&(n=`from`),t[n]=r}return console.assert(!!t.command,t.from,t.to,t.resId),t}send(e){this.verbosity>=3&&console.log(`WS [${this.getDebugName()}] - Send Message`,e),this.sendWrapped({header:e.header,data:e.data}),this.updateOutgoingStats(e)}async request(e){let t=e.header;return t.reqId||=e.header.from+Cn(),this.verbosity>=3&&console.log(`WS [${this.getDebugName()}] - Send Request`,e),this.updateOutgoingStats(e),this.sendWrapped({header:e.header,data:e.data}),await this.registerRequest(t)}handleWrapped(e,t){if(typeof e!=`object`){console.error(TypeError(`${this.type} [${this.getDebugName()}] - Invalid Message Type, not object!`),e);return}if(this.updateIncomingStats(e,t),!e.header?.from){console.error(`${this.type} [${this.getDebugName()}] - Invalid header data!`,event);return}if(e.header.resId)this.verbosity>=3&&console.log(`[${this.getDebugName()}] - Get Response`,e),this.resolveRequest(e);else if(e.header.reqId){this.verbosity>=3&&console.log(`${this.type} [${this.getDebugName()}] - Get Request`,e);let t={header:{...e.header},data:e.data};(async()=>{let e={header:void 0,data:void 0};try{let n=await this.receiveRequest(t);n.header?e.header=n.header:e.header=this.createResponseHeader(t.header),e.data=n.data}catch(n){e.header=this.createResponseHeader(t.header),e.header.err=n.toString()}this.verbosity>=3&&console.log(`${this.type} [${this.getDebugName()}] - Send Response`,e),this.sendWrapped(e)})()}else this.verbosity>=3&&console.log(`${this.type} [${this.getDebugName()}] - Get Message`,e),this.receiveMessage(e)}},q=(e=>(e[e.NEVER=0]=`NEVER`,e[e.ALWAYS=1]=`ALWAYS`,e[e.UNTIL_CONNECTING=2]=`UNTIL_CONNECTING`,e))(q||{}),Dn=(e=>(e[e.NONE=0]=`NONE`,e[e.SHOULD_PING=1]=`SHOULD_PING`,e[e.CAN_RECONNECT=2]=`CAN_RECONNECT`,e[e.EXISTING_CONNECTION=4]=`EXISTING_CONNECTION`,e))(Dn||{}),On=new class{constructor(){}defined(e,t=`unexpected undefined/null`){}number(e,t=`unexpected undefined/null`){}positive(e,t=`unexpected undefined/null`){this.number(e,t)}filledString(e,t=`string expected`){}},kn=class extends bn{id;connector;persistent;discardMode;constructor(e){super(),this.id=e.id,this.connector=null,this.persistent=!1,this.discardMode=q.NEVER,this.update(e)}update(e){typeof e.connector<`u`&&e.connector!=this.connector&&(this.connector&&(this.connector.unlink(this),e.connector!=this.connector&&console.warn(`CDhMessageConnector changed unexpected for route '${this.id}'! Review Needed?`)),this.connector=e.connector,this.connector&&this.connector.link(this)),this.persistent=e.persistent??this.persistent,this.discardMode=e.discardMode??this.discardMode}getStatus(){return this.connector?this.connector.getStatus():K.DISCONNECTED}isReady(){return this.connector?.isReady()}},An=class{id;_debugName;_routes=new Map;_services=[];_holdMessages=[];_pendingRequests=[];_debugIndicator;_remoteEventManager;_clientListener=new Map;_verbosity=1;_history=[];constructor(e){On.filledString(e),this._debugName=this.id=e,globalThis.communicator??(globalThis.communicator=this),this._remoteEventManager=new wn({startLocalListen:(e,t)=>{this.send(e,`dh-com-listener-add`,{command:t})},stopLocalListen:(e,t)=>{this.send(e,`dh-com-listener-remove`,{command:t})}}),globalThis.timeline?.note(`COM created!`)}dispose(){let e=this._routes.size,t=this._services.length,n=this._holdMessages.length,r=this._pendingRequests.length;for(let e of[...this._holdMessages,...this._pendingRequests])e.defer&&e.defer.reject(Error(`Communicator closed, reject pending Message/Request!`));this._pendingRequests=[],this._holdMessages=[],this._history=[];for(let[e,t]of this._routes.entries())t.connector&&t.connector.unlink(t),t.clear();this._routes.clear(),this._services=[],this._verbosity&8&&console.log(`COM [${this.getDebugName()}] - Disposed! Routes: ${e} Services: ${t} Hold Messages: ${n} Pending Messages: ${r}!`),this._debugIndicator&&=(this._debugIndicator.remove(),null)}internalInterface(){return this}registerService(e){return e?(this._services.push(e),this._verbosity&8&&console.log(`COM [${this.getDebugName()}] - registered service '${e.constructor.name}'!`),this.internalInterface()):{}}removeService(e){let t=this._services.indexOf(e);t>-1&&this._services.splice(t,1),this._verbosity&8&&console.log(`COM [${this.getDebugName()}] - removed service '${e.constructor.name}'!`)}registerConnector(e,t){if(!e)return{};function n(e){return typeof e[0]==`string`}if(Array.isArray(t)&&t.length>0){if(n(t))t=t.map(t=>({id:t,connector:e,persistent:!0}));else for(let n of t)n.connector!==e&&(n.connector&&console.error(`connector [${e.getDebugName()}] defined route ${n.id} config with a different connector!`,n),n.connector=e);for(let e of t)this.defineRoute(e)}return this._verbosity&8&&console.log(`COM [${this.getDebugName()}] - registered connector '${e.getDebugName()}'!`),this._verbosity&2&&(e.on(`status`,()=>this._updateIndicator(2)),e.on(`stats`,()=>this._updateIndicator(4)),this._updateIndicator(2)),this.internalInterface()}removeConnector(e){for(let[t,n]of this._routes.entries())if(n.connector===e){e.unlink(n),n.connector=null;let r=this._pendingRequests.filter(e=>e.message.header.to===n.id);r.length&&console.warn(`Connector removed with pending requests... REVIEW NEEDED?`,r);for(let e of r)e.defer?.reject(`connector removed`);this._remoteEventManager.removeRemote(t),n.persistent||this._routes.delete(t)}this._verbosity&8&&console.log(`COM [${this.getDebugName()}] - removed connector '${e.getDebugName()}'!`)}getHandshakeData(e){return{id:this.id,routes:[...this._routes.entries()].filter(([t,n])=>n.connector!==e&&n.connector?.getStatus()===K.READY).map(([e])=>e)}}async sendHandshake(e,t){let n=this.getHandshakeData(e);t&&(n.update=!0),this._verbosity&8&&console.log(`COM [${this.getDebugName()}] - send handshake to CON [${e.getDebugName()}]`,n);let r=await e.request({header:{from:this.id,to:``,command:`handshake`},data:n});this.updateHandshake(r.data,e)}async updateHandshake(e,t){if(!e.id){this._verbosity&1&&console.error(`COM [${this.getDebugName()}] - Invalid Handshake Data from CON [${t}]!`);return}let n=[e.id,...e.routes],r=n.filter(e=>{let n=this._routes.get(e);return n?.connector===t?!n.isReady():!0}),i=[...this._routes.values()].filter(e=>e.connector===t&&!n.includes(e.id));if(i.length===0&&r.length===0){this._verbosity&8&&console.log(`COM [${this.getDebugName()}] - Handshake from '${e.id}' has no updates!`,e);return}this._verbosity&8&&console.log(`COM [${this.getDebugName()}] - Handshake from '${e.id}' update! data:`,e,`new/modified:`,r,`missing/removed`,i);let a=r.map(e=>this.defineRoute(e,t));for(let e of i)if(e.persistent)e.update({id:e.id,connector:null});else{let t=e.connector.getStatus();e.emit(`status`,K.DISCONNECTED,t),t===K.READY&&e.emit(`disconnect`,K.DISCONNECTED),this._routes.delete(e.id)}if(!t.isReady())t._ready();else for(let e of a)e.emit(`status`,K.READY),e.emit(`ready`);if(this._routes.size!==r.length){let e=[];for(let n of this._routes.values())t!==n.connector&&n.isReady()&&!e.includes(n.connector)&&e.push(n.connector);for(let t of e)this.sendHandshake(t,!0)}this._verbosity&2&&this._updateIndicator(7)}listen(e,t,n){if(!this.hasRoute(e))throw ReferenceError(`listen to unknown route '${e}'`);return this._remoteEventManager.onLocal(e,t,n)}listenOnce(e,t,n){if(!this.hasRoute(e))throw ReferenceError(`listen to unknown route '${e}'`);return this._remoteEventManager.onceLocal(e,t,n)}hasListener(e){return this._remoteEventManager.hasRemoteListener(e)}emit(e,t){let n=this._remoteEventManager.getEventRemotes(e);for(let r of n)this._internalSend({header:{from:this.id,to:r,command:e},data:t})}send(e,t,n){this._internalSend({header:{from:this.id,to:e,command:t},data:n})}async request(e,t,n){return(await this._internalRequest({header:{from:this.id,to:e,command:t},data:n})).data}receiveMessage(e,t){if(t.header.to===`*`){for(let e of this._services)e.processMessage(t);this._internalSend(t);return}if(t.header.to!==this.id){this._verbosity&16&&console.log(`COM [${this.getDebugName()}] - redirect message`,t),this._internalSend(t),G.end(`RECEIVE`,t.header.command);return}if(this._verbosity&16&&console.log(`COM [${this.getDebugName()}] - received message '${t.header.command}' from '${t.header.from}'`,t),t.header.command.startsWith(`dh-com-listener-`)){t.data.command&&(this._clientListener.has(t.data.command)||this._clientListener.set(t.data.command,new Set)),this._clientListener.get(t.data.command).add(t.header.from);return}else this._remoteEventManager.emitFromRemote(t.header.from,t.header.command,t.data);for(let e of this._services)e.processMessage(t);G.end(`RECEIVE`,t.header.command)}async receiveRequest(e,t){if(t.header.command===`handshake`)return t.header.to=this.id,this._verbosity&8&&console.log(`COM [${this.getDebugName()}] - received handshake request from '${t.header.from}'`,t.data),t.data.update&&this.updateHandshake(t.data,e),G.end(`RECEIVE`,t.header.command),Promise.resolve({header:null,data:this.getHandshakeData(e)});if(t.header.to!==this.id){for(let e of this._services){let n=e.intercept(t);if(n!=null)return this._verbosity&16&&console.log(`COM [${this.getDebugName()}] - Service '${e.constructor.name}' intercept request '${t.header.command}' from '${t.header.from}' to '${t.header.to}'`,t),G.end(`RECEIVE`,t.header.command),await n}this._verbosity&16&&console.log(`COM [${this.getDebugName()}] - redirect request '${t.header.command}' from '${t.header.from}' to '${t.header.to}'`,t);let e=this._internalRequest(t);return G.end(`RECEIVE`,t.header.command),await e}this._verbosity&16&&console.log(`COM [${this.getDebugName()}] - received request '${t.header.command}' from '${t.header.from}'`,t);for(let e of this._services){let n=e.processRequest(t);if(n)return G.end(`RECEIVE`,t.header.command),n.then(e=>({header:null,data:e}))}return G.end(`RECEIVE`,t.header.command),Promise.reject(Error(`COM [${this.getDebugName()}] - no service to handle requested command '${t.header.command}'`))}async _internalSend(e){if(e.header.to===`*`){let t=this.getRoute(e.header.from),n=new Set([...this._routes.values()].map(e=>e.isReady()?e.connector:void 0).filter(e=>e&&e!==t?.connector));for(let t of n)t.send(e);return}let t=this.getRoute(e.header.to);if(t){if(!t.connector||t.connector.getStatus()!==K.READY){if(t.discardMode===q.ALWAYS||t.discardMode===q.UNTIL_CONNECTING&&t.connector.getStatus()<K.CONNECTING)return;this._verbosity&16&&console.log(`COM [${this.getDebugName()}] - route to ${e.header.to} not ready! ...Waiting for connector update.`),await this.holdMessage(e)}}else throw ReferenceError(`send to unknown route '${e.header.to}'`);if(this._verbosity&4){let t={type:0,req:e};this._history.push(t)}t.connector.send(e)}async _internalRequest(e){G.start(`REQUEST`,e.header.command);let t,n=this.getRoute(e.header.to);if(n)if(n.isReady())t=globalThis.timeline?.add(`REQ-${e.header.command}`);else{if(n.discardMode===q.ALWAYS||n.discardMode===q.UNTIL_CONNECTING&&n.connector.getStatus()<K.CONNECTING)return Promise.reject(`Not Connected`);this._verbosity&16&&console.log(`COM [${this.getDebugName()}] - route to ${e.header.to} not ready! ...Waiting for connector update.`),t=globalThis.timeline?.add(`REQ-${e.header.command}`),await this.holdMessage(e)}else return Promise.reject(ReferenceError(`request to unknown route '${e.header.to}'`));let r;this._verbosity&&(this._verbosity&16&&console.log(`COM [${this.getDebugName()}] - send request '${e.header.command}' by connector '${n.connector.getDebugName()}'`),this._verbosity&2&&this._updateIndicator(1),this._verbosity&4&&(r={type:1,req:e,res:`<yet not received>`},this._history.push(r)));let i={message:e,defer:new xn};this._pendingRequests.push(i);let a=await n.connector.request(e);return t?.stop(),r&&(r.res=a),this._pendingRequests.splice(this._pendingRequests.indexOf(i),1),this._verbosity&2&&(this._updateIndicator(5),G.end(`REQUEST`,e.header.command)),a}holdMessage(e){let t={message:e,defer:new xn},n=this.getRoute(e.header.to);return this._holdMessages.push(t),this._updateIndicator(1),n.asPromise(`ready`).then(()=>{this._holdMessages.splice(this._holdMessages.indexOf(t)),this._updateIndicator(1)})}defineRoute(e,t=null,n=!0){typeof e==`string`&&(e={id:e,persistent:n,connector:t});let r=this._routes.get(e.id);if(r)r.update(e);else{r=new kn(e),this._routes.set(e.id,r);let t=globalThis.timeline?.add(`Route: create '${e.id}'`);t&&r.once(`ready`,()=>t.stop())}return r}getRouteStatus(e){let t=this.getRoute(e);return t?t.getStatus():K.UNKNOWN}getRoute(e){return this._routes.get(e)}hasRoute(e){return this._routes.has(e)}static getMainInstance(){return globalThis.communicator}static _onMainInstance;static mainInstanceRegistered(e){if(globalThis.communicator){e(globalThis.communicator);return}this._onMainInstance||=new yn,this._onMainInstance.on(e)}static setMainInstance(e){if(globalThis.communicator&&globalThis.communicator!==e)throw Error(`Multiple Main Instances of MessageCommunicator not allowed!`);if(globalThis.communicator===0&&e)throw Error(`Main Instance of MessageCommunicator was disabled and should not dynamically change!`);globalThis.communicator=e,e&&this._onMainInstance&&(this._onMainInstance.emit(e),this._onMainInstance.dispose(),this._onMainInstance=null)}getDebugName(){return this._debugName}setDebugName(e){this._debugName=e}setVerbosity(e){typeof window==`object`&&typeof window.document==`object`&&(e&2)!=(this._verbosity&2)&&(e&2?(this._debugIndicator=document.createElement(`dhcom-debug-indicator`),document.body.appendChild(this._debugIndicator),this._updateIndicator(255)):this._debugIndicator&&=(this._debugIndicator.remove(),null)),this._verbosity=e}getConnectorList(){let e=[];for(let[t,n]of this._routes)n.connector&&!e.includes(n.connector)&&e.push(n.connector);return e}_updateIndicator(e){if(this._debugIndicator&&(e&1&&this._debugIndicator.setAttribute(`counter`,this._pendingRequests.length.toString()),e&7)){let t=this.getConnectorList();if(e&4){let e={name:this.getDebugName(),connectors:{},pending:this._pendingRequests.map(e=>e.message.header.command)};for(let n of t){let t=[...this._routes.values()].filter(e=>e.connector===n).map(e=>e.id);e.connectors[n.getDebugName()]={routes:t,...n.getStats()}}this._debugIndicator.renderStats(e)}if(e&2){let e=K.READY,n=K.UNKNOWN;for(let r of t){let t=r.getStatus();t<e&&(e=t),t>n&&(n=t)}e>n&&(e=K.UNKNOWN),this._debugIndicator.setAttribute(`status`,e.toString())}}}},jn=class{communicator;setCommunicator(e){this.communicator=e.registerService(this)}dispose(){return this.communicator.removeService(this)}processMessage(e){return!1}processRequest(e){}intercept(e){}send(e,t,n){this.communicator.send(e,t,n)}request(e,t,n){return this.communicator.request(e,t,n)}listen(e,t,n){return this.communicator.listen(e,t,n)}listenOnce(e,t,n){return this.communicator.listenOnce(e,t,n)}hasListener(e){return this.communicator.hasListener(e)}emit(e,t){return this.communicator.emit(e,t)}},Mn=class e extends En{constructor(e,t){super(),this.targetWindow=e,this.targetOrigin=t}type=`PostMessage`;start(){window.addEventListener(`message`,e=>this.receiveEvent(e)),this.sendHandshake()}resetTargetWindow(e){this.targetWindow=e,this.targetOrigin=e.origin,this.setStatus(K.RECONNECTING),this.init()}async receiveEvent(e){try{if(typeof e.data==`string`)return;if(this.targetOrigin!==`*`&&e.origin!=this.targetOrigin){console.log(`[${this.getDebugName()}] - Origin mismatch`,e.origin,this.targetOrigin);return}this.handleWrapped(e.data)}catch(t){console.error(`[${this.getDebugName()}] - CATCH in Socket Message`,e,t)}}sendWrapped(e){try{this.targetWindow.postMessage(e,this.targetOrigin)}catch(t){console.error(t,e)}}init(){e.tryPing(this.targetWindow,e=>{this.targetWindow=e.source,this.start()})}static tryPing(e,t){let n=e.origin,r=i=>{if(i.origin===n)switch(e!=i.source&&console.warn(`CHECK target?!`,e,i.source),i.data){case`dh-pmc-init-ping`:i.source.postMessage(`dh-pmc-init-pong`,i.origin);case`dh-pmc-init-pong`:window.removeEventListener(`message`,r),t(i)}};window.addEventListener(`message`,r),e.postMessage(`dh-pmc-init-ping`,`*`)}},Nn=class{constructor(e){this.name=e,this.name=e,this.start=performance.now(),this.end=0}start;end;stop(){this.end=performance.now()}};globalThis.timeline=new class e{name=window.location.pathname.match(/^\/(?<basepath>\w+)\b/)?.groups?.basepath||`nopath`;clock=Date.now()-performance.now();times=[];constructor(){if(this.note(`Timeline: start`),typeof window<`u`){let e=this.add(`load`);window.addEventListener(`load`,()=>e.stop())}setTimeout(()=>{performance.getEntriesByType(`resource`).forEach(e=>{let t=this.add(`RES(${e.initiatorType}): ${e.name}`);t.start=e.fetchStart,t.end=e.responseEnd}),this.times.sort((e,t)=>e.start-t.start),console.log(`TIMELINE:`,this)},2e4)}add(e){let t=new Nn(e);return this.times.push(t),t}note(e){let t=new Nn(e);this.times.push(t),t.end=t.start}static stackCounter=new Map;stack(t){let n=e.stackCounter.get(t);return n?n.i===0&&performance.now()-n.t.end>1?(n={i:1,t:this.add(t)},e.stackCounter.set(t,n)):++n.i:(n={i:1,t:this.add(t)},e.stackCounter.set(t,n)),{pop:()=>{--n.i===0&&n.t.stop()}}}};var Pn=class extends jn{processMessage(e){return e.header.command===`getTimeline`&&globalThis.timeline?(this.send(e.header.from,`timelineData`,structuredClone(globalThis.timeline)),!0):!1}},Fn=null;if(An.mainInstanceRegistered(e=>{Fn=new Pn,Fn.setCommunicator(e)}),typeof window<`u`&&typeof document<`u`&&!customElements.get(`dhcom-debug-indicator`)){class e extends HTMLElement{status=K.UNKNOWN;counter=0;shadow;circle;badge;tooltip;keepOpen=!1;communicator;constructor(){super()}static get observedAttributes(){return[`status`,`counter`]}connectedCallback(){this.shadow||(this.shadow=this.attachShadow({mode:`open`}),this.build())}disconnectedCallback(){}attributeChangedCallback(e,t,n){t!==n&&(e===`status`&&(this.status=parseInt(n,10)||0,this.circle.style.backgroundColor=this.getColor()),e===`counter`&&(this.counter=parseInt(n,10)||0,this.badge.innerHTML=n,this.badge.style.display=this.counter?`block`:`none`))}renderStatsTree(e,t=0){return`<ul>${Object.entries(e).map(([e,n])=>n?(n=Array.isArray(n)?n.join(`, `):typeof n==`object`?this.renderStatsTree(n,t+1):` <i>${n}</i>`,`<li class="level${t}"><b>${e}</b>:${n}</li>`):``).join(``)}</ul>`}renderStats(e){let t=this.keepOpen?`<svg class="lock" width="20" height="20" viewBox="0 0 20 20" fill="white"><path d="M6.5 9V6a3.5 3.5 0 1 1 7 0v3" stroke="white" stroke-width="2" fill="none"/><rect x="5" y="8" width="10" height="8" rx="1" fill="white"/></svg>`:``;this.tooltip.innerHTML=`<h4>${e.name} Communication</h4>${t}`+this.renderStatsTree(e)}build(){this.shadow.innerHTML=`
| <style>
| :host {
| position: fixed;
| bottom: 30px;
| left: 30px;
| width: 20px;
| height: 20px;
| z-index: 9999999;
| font-family: arial;
| max-width: 350px;
| }
| .circle {
| width: 20px;
| height: 20px;
| border-radius: 50%;
| background-color: ${this.getColor()};
| position: relative;
| display: flex;
| cursor: grab;
| align-items: center;
| justify-content: center;
| }
| .badge {
| position: absolute;
| bottom: 60%;
| left: 60%;
| background-color: blue;
| color: white;
| font-size: 9px;
| line-height: 10px;
| padding: 2px;
| border-radius: 12px;
| }
| .tooltip {
| display: none;
| position: absolute;
| background: rgba(0, 0, 0, 0.8);
| color: white;
| padding: 10px;
| border-radius: 5px;
| font-size: 12px;
| white-space: nowrap;
| z-index: 99999999;
| }
| .tooltip h4 {
| margin: 0;
| font-size: 14px;
| }
| .tooltip ul {
| padding: 0 0 0 5px;
| margin: 0 0 0 10px;
| }
| .tooltip li {
| margin: 2px 0;
| }
| .lock {
| position: absolute;
| right: 5px;
| top: 5px;
| width: 20px;
| height: 20px;
| }
| </style>
| <div class="circle">
| <span class="badge">${this.counter}</span>
| </div>
| <div class="tooltip">
| <h4>Debug-Statistiken</h4>
| </div>
| `,this.circle=this.shadow.querySelector(`.circle`),this.badge=this.shadow.querySelector(`.badge`),this.tooltip=this.shadow.querySelector(`.tooltip`),this.circle.addEventListener(`contextmenu`,e=>(this.keepOpen=!this.keepOpen,e.preventDefault(),1)),this.tooltip.style.left=`80%`,this.tooltip.style.bottom=`80%`,this.addEventListener(`mouseenter`,()=>{this.tooltip.style.display=`block`}),this.addEventListener(`mouseleave`,()=>{this.keepOpen||(this.tooltip.style.display=`none`)}),this.enableDragging()}enableDragging(){let e=this.circle,t=!1,n=0,r=0,i={x:0,y:0},a=(t,a)=>{i.x=t-n,i.y=a-r;let o=window.innerWidth-e.clientWidth,s=window.innerHeight-e.clientHeight;i.x=Math.max(0,Math.min(i.x,o)),i.y=Math.max(0,Math.min(i.y,s)),this.tooltip.style.left=i.x<o*.5?`80%`:``,this.tooltip.style.right=i.x<o*.5?``:`80%`,this.tooltip.style.top=i.y<s*.5?`80%`:``,this.tooltip.style.bottom=i.y<s*.5?``:`80%`,this.style.left=`${i.x}px`,this.style.top=`${i.y}px`},o=`_debug_comindicator_pos_`+window.location.pathname.substring(1),s=localStorage.getItem(o);if(s){let{x:e,y:t}=JSON.parse(s);a(e,t)}let c=e=>{t=!0,n=e.clientX-this.getBoundingClientRect().left,r=e.clientY-this.getBoundingClientRect().top,this.circle.style.cursor=`grabbing`,document.addEventListener(`mousemove`,l),document.addEventListener(`mouseup`,u)},l=e=>{t&&a(e.clientX,e.clientY)},u=()=>{t=!1,this.circle.style.cursor=``,document.removeEventListener(`mousemove`,l),document.removeEventListener(`mouseup`,u),localStorage.setItem(o,JSON.stringify(i))};e.addEventListener(`mousedown`,c)}getColor(){switch(this.status){case K.UNKNOWN:return`gray`;case K.DISCONNECTED:return`red`;case K.DISCONNECTING:return`red`;case K.CONNECTING:return`orange`;case K.RECONNECTING:return`yellow`;case K.CONNECTED:return`turquoise`;case K.READY:return`green`;default:return`gray`}}}customElements.define(`dhcom-debug-indicator`,e)}new class{static{this.templates=new WeakMap}_getNestedOptions(e,t){return t?.subkeyValidation?.[e]??void 0}_log(e,t){return console.warn(`[ValidatedProperty] Key '${String(e)}' was set to 'undefined'. Reverting to`,t??`'empty'`),t}_validateObject(e,t,n,r){let i=!1;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let a=this._getNestedOptions(r,n),o=t[r],s=e[r];if(s===void 0){let t=a??o;t=a&&t!==void 0?this.validateObjectProperty(r,Array.isArray(t)?[]:{},t,n,!1).result:o,e[r]=this._log(r,t),i=!0}else if(a){let t=this.validateObjectProperty(r,s,a,n,!1);t.changed&&(e[r]=this._log(r,t.result),i=!0)}}return{changed:i,result:e}}_validateArray(e,t,n,r){let i=!1,a=r?[]:e,o=Array.isArray(t)?t[0]:t;if(!o)return{changed:!1,result:e};let s=a.map(e=>{let t=this._validateObject(e,o,n,r);return t.changed&&(i=!0),t.result});return{changed:i,result:s}}_getValidatedValue(e,t,n,r=!1){return Array.isArray(e)?this._validateArray([...e],t,n,r):this._validateObject({...e},t,n,r)}validateObjectProperty(e,t,n,r,i=!1,a=0){return t===void 0?{changed:!0,result:JSON.parse(JSON.stringify(this._log(e,n)))}:typeof t!=`object`||!t?{changed:!1,result:t}:this._getValidatedValue(t,n,r,i)}static getTemplate(e,t){return this.templates.get(e)?.get(t)}static setTemplate(e,t,n){typeof n==`object`&&n&&n!==void 0&&!Array.isArray(n)&&(this.templates.has(e)||this.templates.set(e,new Map),this.templates.get(e).set(t,JSON.parse(JSON.stringify(n))))}};var In=class{constructor(e,t,n){this.element=e,this.name=t,this.env=n}composeEvent(e){return e instanceof Event&&e.type==this.name?e:new CustomEvent(this.name,{...this.env,detail:e})}dispatch(e){this.element.dispatchEvent(this.composeEvent(e))}addListener(e,t){this.element.addEventListener(this.name,e,t)}removeListener(e,t){this.element.removeEventListener(this.name,e,t)}handleEvent(e){this.dispatch()}detail(e){let t=this;return{handleEvent(n){t.dispatch(e)}}}};function Ln(e,t){return(n,r)=>{t||=r.toString().toLowerCase(),t.endsWith(`event`)&&(t=t.replace(`event`,``));let i=Symbol(`__${String(r)}_eventRef`);Object.defineProperty(n,r,{get(){return this[i]||(this[i]=new In(this,t,e)),this[i]},enumerable:!0,configurable:!0})}}var Rn={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},J=e=>(...t)=>({_$litDirective$:e,values:t}),zn=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},Bn=J(class extends zn{constructor(e){if(super(e),e.type!==Rn.ATTRIBUTE||e.name!==`class`||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return` `+Object.keys(e).filter((t=>e[t])).join(` `)+` `}update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(` `).split(/\s/).filter((e=>e!==``))));for(let e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}let n=e.element.classList;for(let e of this.st)e in t||(n.remove(e),this.st.delete(e));for(let e in t){let r=!!t[e];r===this.st.has(e)||this.nt?.has(e)||(r?(n.add(e),this.st.add(e)):(n.remove(e),this.st.delete(e)))}return z}}),{I:Vn}=rn,Hn=e=>e.strings===void 0,Un=()=>document.createComment(``),Y=(e,t,n)=>{let r=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0)n=new Vn(r.insertBefore(Un(),i),r.insertBefore(Un(),i),e,e.options);else{let t=n._$AB.nextSibling,a=n._$AM,o=a!==e;if(o){let t;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(t=e._$AU)!==a._$AU&&n._$AP(t)}if(t!==i||o){let e=n._$AA;for(;e!==t;){let t=e.nextSibling;r.insertBefore(e,i),e=t}}}return n},X=(e,t,n=e)=>(e._$AI(t,n),e),Wn={},Gn=(e,t=Wn)=>e._$AH=t,Kn=e=>e._$AH,qn=e=>{e._$AP?.(!1,!0);let t=e._$AA,n=e._$AB.nextSibling;for(;t!==n;){let e=t.nextSibling;t.remove(),t=e}},Jn=(e,t,n)=>{let r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},Yn=J(class extends zn{constructor(e){if(super(e),e.type!==Rn.CHILD)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,r]){let i=Kn(e),{values:a,keys:o}=this.dt(t,n,r);if(!Array.isArray(i))return this.ut=o,a;let s=this.ut??=[],c=[],l,u,d=0,f=i.length-1,p=0,m=a.length-1;for(;d<=f&&p<=m;)if(i[d]===null)d++;else if(i[f]===null)f--;else if(s[d]===o[p])c[p]=X(i[d],a[p]),d++,p++;else if(s[f]===o[m])c[m]=X(i[f],a[m]),f--,m--;else if(s[d]===o[m])c[m]=X(i[d],a[m]),Y(e,c[m+1],i[d]),d++,m--;else if(s[f]===o[p])c[p]=X(i[f],a[p]),Y(e,i[d],i[f]),f--,p++;else if(l===void 0&&(l=Jn(o,p,m),u=Jn(s,d,f)),l.has(s[d]))if(l.has(s[f])){let t=u.get(o[p]),n=t===void 0?null:i[t];if(n===null){let t=Y(e,i[d]);X(t,a[p]),c[p]=t}else c[p]=X(n,a[p]),Y(e,i[d],n),i[t]=null;p++}else qn(i[f]),f--;else qn(i[d]),d++;for(;p<=m;){let t=Y(e,c[m+1]);X(t,a[p]),c[p++]=t}for(;d<=f;){let e=i[d++];e!==null&&qn(e)}return this.ut=o,Gn(e,c),z}}),Xn=`important`,Zn=` !important`,Qn=J(class extends zn{constructor(e){if(super(e),e.type!==Rn.ATTRIBUTE||e.name!==`style`||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,n)=>{let r=e[n];return r==null?t:t+`${n=n.includes(`-`)?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,`-$&`).toLowerCase()}:${r};`}),``)}update(e,[t]){let{style:n}=e.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let e of this.ft)t[e]??(this.ft.delete(e),e.includes(`-`)?n.removeProperty(e):n[e]=null);for(let e in t){let r=t[e];if(r!=null){this.ft.add(e);let t=typeof r==`string`&&r.endsWith(Zn);e.includes(`-`)||t?n.setProperty(e,t?r.slice(0,-11):r,t?Xn:``):n[e]=r}}return z}}),$n=Symbol.for(``),er=e=>{if(e?.r===$n)return e?._$litStatic$},tr=e=>({_$litStatic$:e,r:$n}),nr=new Map,rr=(e=>(t,...n)=>{let r=n.length,i,a,o=[],s=[],c,l=0,u=!1;for(;l<r;){for(c=t[l];l<r&&(a=n[l],i=er(a))!==void 0;)c+=i+t[++l],u=!0;l!==r&&s.push(a),o.push(c),l++}if(l===r&&o.push(t[r]),u){let e=o.join(`$$lit$$`);(t=nr.get(e))===void 0&&(o.raw=o,nr.set(e,t=o)),n=s}return e(t,...n)})(Kt),ir=e=>e??B;function*ar(e,t){if(e!==void 0){let n=0;for(let r of e)yield t(r,n++)}}function*or(e,t,n=1){let r=t===void 0?0:e;t??=e;for(let e=r;n>0?e<t:t<e;e+=n)yield e}var sr=globalThis,cr=sr.ShadowRoot&&(sr.ShadyCSS===void 0||sr.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,lr=Symbol(),ur=new WeakMap,dr=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==lr)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(cr&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=ur.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&ur.set(t,e))}return e}toString(){return this.cssText}},fr=e=>new dr(typeof e==`string`?e:e+``,void 0,lr),pr=(e,t)=>{if(cr)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement(`style`),r=sr.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},mr=cr?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return fr(t)})(e):e,{is:hr,defineProperty:gr,getOwnPropertyDescriptor:_r,getOwnPropertyNames:vr,getOwnPropertySymbols:yr,getPrototypeOf:br}=Object,xr=globalThis,Sr=xr.trustedTypes,Cr=Sr?Sr.emptyScript:``,wr=xr.reactiveElementPolyfillSupport,Z=(e,t)=>e,Tr={toAttribute(e,t){switch(t){case Boolean:e=e?Cr:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},Er=(e,t)=>!hr(e,t),Dr={attribute:!0,type:String,converter:Tr,reflect:!1,useDefault:!1,hasChanged:Er};Symbol.metadata??=Symbol(`metadata`),xr.litPropertyMetadata??=new WeakMap;var Q=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Dr){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&gr(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=_r(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Dr}static _$Ei(){if(this.hasOwnProperty(Z(`elementProperties`)))return;let e=br(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Z(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Z(`properties`))){let e=this.properties,t=[...vr(e),...yr(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(mr(e))}else e!==void 0&&t.push(mr(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.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(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return pr(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?Tr:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?Tr:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??Er)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};Q.elementStyles=[],Q.shadowRootOptions={mode:`open`},Q[Z(`elementProperties`)]=new Map,Q[Z(`finalized`)]=new Map,wr?.({ReactiveElement:Q}),(xr.reactiveElementVersions??=[]).push(`2.1.2`);var Or=Symbol(),kr=class{get taskComplete(){return this.t||(this.i===1?this.t=new Promise(((e,t)=>{this.o=e,this.h=t})):this.i===3?this.t=Promise.reject(this.l):this.t=Promise.resolve(this.u)),this.t}constructor(e,t,n){this.p=0,this.i=0,(this._=e).addController(this);let r=typeof t==`object`?t:{task:t,args:n};this.v=r.task,this.j=r.args,this.m=r.argsEqual??Ar,this.k=r.onComplete,this.A=r.onError,this.autoRun=r.autoRun??!0,`initialValue`in r&&(this.u=r.initialValue,this.i=2,this.O=this.T?.())}hostUpdate(){!0===this.autoRun&&this.S()}hostUpdated(){this.autoRun===`afterUpdate`&&this.S()}T(){if(this.j===void 0)return;let e=this.j();if(!Array.isArray(e))throw Error(`The args function must return an array`);return e}async S(){let e=this.T(),t=this.O;this.O=e,e===t||e===void 0||t!==void 0&&this.m(t,e)||await this.run(e)}async run(e){let t,n;e??=this.T(),this.O=e,this.i===1?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,this.autoRun===`afterUpdate`?queueMicrotask((()=>this._.requestUpdate())):this._.requestUpdate();let r=++this.p;this.q=new AbortController;let i=!1;try{t=await this.v(e,{signal:this.q.signal})}catch(e){i=!0,n=e}if(this.p===r){if(t===Or)this.i=0;else{if(!1===i){try{this.k?.(t)}catch{}this.i=2,this.o?.(t)}else{try{this.A?.(n)}catch{}this.i=3,this.h?.(n)}this.u=t,this.l=n}this._.requestUpdate()}}abort(e){this.i===1&&this.q?.abort(e)}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(e){switch(this.i){case 0:return e.initial?.();case 1:return e.pending?.();case 2:return e.complete?.(this.value);case 3:return e.error?.(this.error);default:throw Error(`Unexpected status: `+this.i)}}},Ar=(e,t)=>e===t||e.length===t.length&&e.every(((e,n)=>!Er(e,t[n]))),$=(e,t)=>{let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),$(e,t);return!0},jr=e=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},Mr=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),Fr(t)}};function Nr(e){this._$AN===void 0?this._$AM=e:(jr(this),this._$AM=e,Mr(this))}function Pr(e,t=!1,n=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(let e=n;e<r.length;e++)$(r[e],!1),jr(r[e]);else r!=null&&($(r,!1),jr(r));else $(this,e)}var Fr=e=>{e.type==Rn.CHILD&&(e._$AP??=Pr,e._$AQ??=Nr)},Ir=class extends zn{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),Mr(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&($(this,e),jr(this))}setValue(e){if(Hn(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}},Lr=()=>new Rr,Rr=class{},zr=new WeakMap,Br=J(class extends Ir{render(e){return B}update(e,[t]){let n=t!==this.G;return n&&this.G!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),B}rt(e){if(this.isConnected||(e=void 0),typeof this.G==`function`){let t=this.ht??globalThis,n=zr.get(t);n===void 0&&(n=new WeakMap,zr.set(t,n)),n.get(this.G)!==void 0&&this.G.call(this.ht,void 0),n.set(this.G,e),e!==void 0&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return typeof this.G==`function`?zr.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});export{$e as A,w as B,W as C,ht as D,gt as E,We as F,o as H,He as I,Ve as L,Ze as M,Ke as N,lt as O,Ge as P,Re as R,ln as S,Kt as T,a as U,Se as V,vn as _,ar as a,pn as b,rr as c,Bn as d,Ln as f,bn as g,An as h,or as i,Qe as j,ct as k,Qn as l,Mn as m,Br as n,ir as o,jn as p,kr as r,tr as s,Lr as t,Yn as u,_n as v,B as w,fn as x,hn as y,O as z};
| //# sourceMappingURL=vendor.chunk.js.map
|
|