Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More

@appmate/wishlist

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appmate/wishlist - npm Package Compare versions

Comparing version 5.4.2 to 5.4.3

@@ -1,1 +0,1 @@

var _=(a,e,s)=>{if(!e.has(a))throw TypeError("Cannot "+s)};var c=(a,e,s)=>(_(a,e,"read from private field"),s?s.call(a):e.get(a)),l=(a,e,s)=>{if(e.has(a))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(a):e.set(a,s)},A=(a,e,s,i)=>(_(a,e,"write to private field"),i?i.call(a,s):e.set(a,s),s);var r=(a,e,s)=>(_(a,e,"access private method"),s);var T,U=a=>(!!localStorage.getItem("debug")&&(T=import("https://cdn.jsdelivr.net/npm/debug@4.3.4/+esm")),(s,...i)=>{T&&T.then(({default:n})=>{n(a)(s,...i)})});var o=U("wk:loader");window.headlessElements=new Map;var W,y,g,M,H,K,D,O,P,B,$,R,L,V,S,q,x,z,f,v,j,G,N,Q,b,X,k,Y,w,C,F,Z,J=class{constructor({sdkHost:e,themeCodeHost:s,themeCodeVersion:i}){l(this,H);l(this,D);l(this,P);l(this,$);l(this,L);l(this,S);l(this,x);l(this,f);l(this,j);l(this,N);l(this,b);l(this,k);l(this,w);l(this,F);l(this,W,new Map);l(this,y,"");l(this,g,"");l(this,M,"");A(this,y,e),A(this,g,s),A(this,M,i),r(this,F,Z).call(this)}getSdkUrl(e){return e?`${c(this,y)}/${e}`:""}getThemeCodeUrl(e){return e?`${c(this,g)}/${e}?v=${c(this,M)}`:""}load(e){var u,d;let{name:s,url:i,isDependency:n}=e,t=s!=null?s:i;if(!s&&!i||!t)return Promise.resolve({});!e.type&&e.url&&(e={...e,type:r(this,b,X).call(this,e.url)}),n?o(`Load dependecy: ${t}`,{asset:e}):o(`Load: ${t}`,{asset:e});let m=c(this,W).get(t);if(m)return m;let h=(d=(u=e.dependencies)==null?void 0:u.map(E=>this.load({...E,isDependency:!0})))!=null?d:[];e.type==="headless-component"?h.push(this.load({type:"core",name:"wishlist-element-headless",url:this.getSdkUrl("wishlist-element-headless.js"),isDependency:!0})):e.type==="lit-component"&&h.push(this.load({type:"core",name:"wishlist-element",url:this.getSdkUrl("wishlist-element.js"),isDependency:!0}));let p=Promise.all([r(this,H,K).call(this,e),...h]).then(([E])=>{var I;return(I=e.afterLoad)==null||I.call(e,E),E});return c(this,W).set(t,p),document.dispatchEvent(new CustomEvent(`wk:loader:${t}:load`)),p}async waitFor(e){let s=c(this,W).get(e);return s||(console.warn("Waiting for unknwon module:",e),Promise.resolve({}))}async waitForCore(e){let s=c(this,W).get(e);return s?(o(`Wait for core module: ${e}`),s):(o(`Defer wait until core module available: ${e}`),new Promise(i=>{document.addEventListener(`wk:loader:${e}:load`,()=>{o(`Deferred wait can continue: ${e}`),i(c(this,W).get(e))},{once:!0})}))}};W=new WeakMap,y=new WeakMap,g=new WeakMap,M=new WeakMap,H=new WeakSet,K=async function(e){let{url:s,type:i}=e;if(!s)return Promise.resolve({});let n=r(this,k,Y).call(this,{url:s,noCache:r(this,w,C).call(this)});switch(r(this,w,C).call(this)&&o(`Load dev asset: ${n}`,{asset:e}),i){case"css":return r(this,x,z).call(this,n,e.order);case"js":return r(this,f,v).call(this,n).then(t=>r(this,S,q).call(this,e,t));case"json":return r(this,N,Q).call(this,n).then(t=>r(this,D,O).call(this,t));case"lit-component":return r(this,f,v).call(this,n).then(t=>r(this,$,R).call(this,e,t));case"headless-component":return r(this,f,v).call(this,n).then(t=>r(this,L,V).call(this,e,t));case"core":return r(this,j,G).call(this,n).then(t=>r(this,P,B).call(this,e,t));default:return Promise.resolve({})}},D=new WeakSet,O=async function(e){return o("Loaded json",{module:e}),e},P=new WeakSet,B=async function(e,s){return o(`Loaded core module: ${e.name}`,{asset:e,module:s}),s.WishlistApp?(o("Create wishlist app",{asset:e,module:s}),window.WishlistKing=new s.WishlistApp(e.props),{...s,artifact:window.WishlistKing}):s},$=new WeakSet,R=async function(e,s){var u;let{setup:i,inject:n,define:t}=s;o(`Loaded lit component: ${e.name}`,{asset:e,module:s});let h=(await this.waitForCore("wishlist-app")).artifact;e.isDependency||(typeof i=="function"?(o(`Setup lit component: ${e.name}`,{asset:e,module:s}),i({app:h,props:e.props})):typeof n=="function"&&(o(`Inject lit component: ${e.name}`,{asset:e,module:s}),n(h,e.props)));let p=await this.waitForCore("wishlist-element");if(typeof t=="function"){if(e.name&&window.customElements.get(e.name))return s;let d=t({...(u=e.props)!=null?u:{},...p},e.props);o(`Define lit component: ${e.name}`,{asset:e,module:s,element:d,wishlistElement:p}),d&&e.name&&window.customElements.define(e.name,d)}return s},L=new WeakSet,V=async function(e,s){var u;let{setup:i,inject:n,define:t}=s;o(`Loaded headless component: ${e.name}`,{asset:e,module:s});let m=await this.waitForCore("wishlist-element-headless");if(typeof t=="function"){let d=t(m);o(`Define headless component: ${e.name}`,{asset:e,module:s,element:d}),d&&e.name&&((u=window.headlessElements)==null||u.set(e.name,d))}let p=(await this.waitForCore("wishlist-app")).artifact;return typeof i=="function"?(o(`Setup headless component: ${e.name}`,{asset:e,module:s}),i({app:p})):typeof n=="function"&&(o(`Inject headless component: ${e.name}`,{asset:e,module:s}),n(p)),s},S=new WeakSet,q=async function(e,s){let{setup:i}=s;return o(`Loaded js component: ${e.name}`,{asset:e,module:s}),this.waitForCore("wishlist-app").then(n=>{if(typeof i=="function"&&n.artifact){let t=n.artifact;o(`Setup js component: ${e.name}`,{asset:e,module:n}),i({app:t})}}),s},x=new WeakSet,z=async function(e,s=0){return new Promise((i,n)=>{let t=document.createElement("link");t.rel="stylesheet",t.href=e,t.dataset.loaderOrder=s.toString(),t.onerror=n,t.onload=()=>{o("Loaded stylesheet",{url:e}),i({})};let m=Array.from(document.head.querySelectorAll("link[data-loader-order]")).find(h=>{var p;return parseInt((p=h.dataset.loaderOrder)!=null?p:"0")>s});m?document.head.insertBefore(t,m):document.head.appendChild(t)})},f=new WeakSet,v=async function(e){return import(e)},j=new WeakSet,G=async function(e){return import(e)},N=new WeakSet,Q=async function(e){return fetch(e).then(s=>s.json())},b=new WeakSet,X=function(e){var i;let s=(i=e.split(".").pop())==null?void 0:i.split(/\#|\?/)[0].toString();if(!(!s||!["js","css","json"].includes(s)))return s},k=new WeakSet,Y=function({url:e,noCache:s}){return s&&!e.includes("/themecode-templates/")?e.replace("cdn.appmate.io","storage.googleapis.com/appmate-cdn").replace(/v=\d*/,`v=${Date.now()}`):e},w=new WeakSet,C=function(){return!document.getElementById("preview-bar-iframe")?!1:!!window.localStorage.getItem("wk_dev_mode")},F=new WeakSet,Z=function(){window.location.search.includes("wk_dev_mode=on")?(o("Activate dev mode"),window.localStorage.setItem("wk_dev_mode",Date.now().toString())):window.location.search.includes("wk_dev_mode=off")&&(o("Deactivate dev mode"),window.localStorage.removeItem("wk_dev_mode")),r(this,w,C).call(this)&&(o("Dev mode active"),window.addEventListener("message",e=>{e.data==="WK_THEME_RELOAD"&&(window.localStorage.setItem("wk_dev_mode",Date.now().toString()),window.location.reload())},!1))};export{J as AppLoader};
var _=(a,e,t)=>{if(!e.has(a))throw TypeError("Cannot "+t)};var m=(a,e,t)=>(_(a,e,"read from private field"),t?t.call(a):e.get(a)),p=(a,e,t)=>{if(e.has(a))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(a):e.set(a,t)},v=(a,e,t,s)=>(_(a,e,"write to private field"),s?s.call(a,t):e.set(a,t),t);var r=(a,e,t)=>(_(a,e,"access private method"),t);var T,K=a=>(!!localStorage.getItem("debug")&&(T=import("https://cdn.jsdelivr.net/npm/debug@4.3.4/+esm")),(t,...s)=>{T&&T.then(({default:i})=>{i(a)(t,...s)})});var n=K("wk:loader");window.headlessElements=new Map;var f,y,g,M,D,B,P,R,$,V,E,I,L,q,S,z,x,G,W,C,j,Q,N,X,b,Y,k,Z,w,H,F,ee,O=class{constructor({sdkHost:e,themeCodeHost:t,themeCodeVersion:s}){p(this,D);p(this,P);p(this,$);p(this,E);p(this,L);p(this,S);p(this,x);p(this,W);p(this,j);p(this,N);p(this,b);p(this,k);p(this,w);p(this,F);p(this,f,new Map);p(this,y,"");p(this,g,"");p(this,M,"");v(this,y,e),v(this,g,t),v(this,M,s),r(this,F,ee).call(this)}getSdkUrl(e){return e?`${m(this,y)}/${e}`:""}getThemeCodeUrl(e){return e?`${m(this,g)}/${e}?v=${m(this,M)}`:""}load(e){var u,c;let{name:t,url:s,isDependency:i}=e,o=t!=null?t:s;if(!t&&!s||!o)return Promise.resolve({});!e.type&&e.url&&(e={...e,type:r(this,b,Y).call(this,e.url)}),i?n(`Load dependecy: ${o}`,{asset:e}):n(`Load: ${o}`,{asset:e});let d=m(this,f).get(o);if(d)return d;let l=(c=(u=e.dependencies)==null?void 0:u.map(A=>this.load({...A,isDependency:!0})))!=null?c:[];e.type==="headless-component"?l.push(this.load({type:"core",name:"wishlist-element-headless",url:this.getSdkUrl("wishlist-element-headless.js"),isDependency:!0})):e.type==="lit-component"&&l.push(this.load({type:"core",name:"wishlist-element",url:this.getSdkUrl("wishlist-element.js"),isDependency:!0}));let h=Promise.all([r(this,D,B).call(this,e),...l]).then(async([A])=>{var U,J;return await((U=e.afterDependencies)==null?void 0:U.call(e)),(J=e.afterLoad)==null||J.call(e,A),A});return m(this,f).set(o,h),document.dispatchEvent(new CustomEvent(`wk:loader:${o}:load`)),h}async waitFor(e){let t=m(this,f).get(e);return t||(console.warn("Waiting for unknwon module:",e),Promise.resolve({}))}async waitForCore(e){let t=m(this,f).get(e);return t?(n(`Wait for core module: ${e}`),t):(n(`Defer wait until core module available: ${e}`),new Promise(s=>{document.addEventListener(`wk:loader:${e}:load`,()=>{n(`Deferred wait can continue: ${e}`),s(m(this,f).get(e))},{once:!0})}))}};f=new WeakMap,y=new WeakMap,g=new WeakMap,M=new WeakMap,D=new WeakSet,B=async function(e){var d;let{url:t,type:s}=e;if(!t)return Promise.resolve({});let i=r(this,k,Z).call(this,{url:t,noCache:r(this,w,H).call(this)}),o=!!((d=e.dependencies)!=null&&d.length);switch(r(this,w,H).call(this)&&n(`Load dev asset: ${i}`,{asset:e}),s){case"css":return r(this,x,G).call(this,i,e.order);case"js":return r(this,W,C).call(this,i).then(l=>r(this,S,z).call(this,e,l));case"json":return r(this,N,X).call(this,i).then(l=>r(this,P,R).call(this,l));case"lit-component":return r(this,W,C).call(this,i).then(l=>o?(n(`Wait for dependencies: ${i}`,{asset:e}),e.afterDependencies=async()=>{n(`Dependencies loaded: ${i}`,{asset:e}),await r(this,E,I).call(this,e,l)},Promise.resolve(l)):r(this,E,I).call(this,e,l));case"headless-component":return r(this,W,C).call(this,i).then(l=>r(this,L,q).call(this,e,l));case"core":return r(this,j,Q).call(this,i).then(l=>r(this,$,V).call(this,e,l));default:return Promise.resolve({})}},P=new WeakSet,R=async function(e){return n("Loaded json",{module:e}),e},$=new WeakSet,V=async function(e,t){return n(`Loaded core module: ${e.name}`,{asset:e,module:t}),t.WishlistApp?(n("Create wishlist app",{asset:e,module:t}),window.WishlistKing=new t.WishlistApp(e.props),{...t,artifact:window.WishlistKing}):t},E=new WeakSet,I=async function(e,t){var u;let{setup:s,inject:i,define:o}=t;n(`Loaded lit component: ${e.name}`,{asset:e,module:t});let l=(await this.waitForCore("wishlist-app")).artifact;e.isDependency||(typeof s=="function"?(n(`Setup lit component: ${e.name}`,{asset:e,module:t}),s({app:l,props:e.props})):typeof i=="function"&&(n(`Inject lit component: ${e.name}`,{asset:e,module:t}),i(l,e.props)));let h=await this.waitForCore("wishlist-element");if(typeof o=="function"){if(e.name&&window.customElements.get(e.name))return t;let c=o({...(u=e.props)!=null?u:{},...h},e.props);n(`Define lit component: ${e.name}`,{asset:e,module:t,element:c,wishlistElement:h}),c&&e.name&&window.customElements.define(e.name,c)}return t},L=new WeakSet,q=async function(e,t){var u;let{setup:s,inject:i,define:o}=t;n(`Loaded headless component: ${e.name}`,{asset:e,module:t});let d=await this.waitForCore("wishlist-element-headless");if(typeof o=="function"){let c=o(d);n(`Define headless component: ${e.name}`,{asset:e,module:t,element:c}),c&&e.name&&((u=window.headlessElements)==null||u.set(e.name,c))}let h=(await this.waitForCore("wishlist-app")).artifact;return typeof s=="function"?(n(`Setup headless component: ${e.name}`,{asset:e,module:t}),s({app:h})):typeof i=="function"&&(n(`Inject headless component: ${e.name}`,{asset:e,module:t}),i(h)),t},S=new WeakSet,z=async function(e,t){let{setup:s}=t;return n(`Loaded js component: ${e.name}`,{asset:e,module:t}),this.waitForCore("wishlist-app").then(i=>{if(typeof s=="function"&&i.artifact){let o=i.artifact;n(`Setup js component: ${e.name}`,{asset:e,module:i}),s({app:o})}}),t},x=new WeakSet,G=async function(e,t=0){return new Promise((s,i)=>{let o=document.createElement("link");o.rel="stylesheet",o.href=e,o.dataset.loaderOrder=t.toString(),o.onerror=i,o.onload=()=>{n("Loaded stylesheet",{url:e}),s({})};let d=Array.from(document.head.querySelectorAll("link[data-loader-order]")).find(l=>{var h;return parseInt((h=l.dataset.loaderOrder)!=null?h:"0")>t});d?document.head.insertBefore(o,d):document.head.appendChild(o)})},W=new WeakSet,C=async function(e){return import(e)},j=new WeakSet,Q=async function(e){return import(e)},N=new WeakSet,X=async function(e){return fetch(e).then(t=>t.json())},b=new WeakSet,Y=function(e){var s;let t=(s=e.split(".").pop())==null?void 0:s.split(/\#|\?/)[0].toString();if(!(!t||!["js","css","json"].includes(t)))return t},k=new WeakSet,Z=function({url:e,noCache:t}){return t&&!e.includes("/themecode-templates/")?e.replace("cdn.appmate.io","storage.googleapis.com/appmate-cdn").replace(/v=\d*/,`v=${Date.now()}`):e},w=new WeakSet,H=function(){return!document.getElementById("preview-bar-iframe")?!1:!!window.localStorage.getItem("wk_dev_mode")},F=new WeakSet,ee=function(){window.location.search.includes("wk_dev_mode=on")?(n("Activate dev mode"),window.localStorage.setItem("wk_dev_mode",Date.now().toString())):window.location.search.includes("wk_dev_mode=off")&&(n("Deactivate dev mode"),window.localStorage.removeItem("wk_dev_mode")),r(this,w,H).call(this)&&(n("Dev mode active"),window.addEventListener("message",e=>{e.data==="WK_THEME_RELOAD"&&(window.localStorage.setItem("wk_dev_mode",Date.now().toString()),window.location.reload())},!1))};export{O as AppLoader};
{
"name": "@appmate/wishlist",
"version": "5.4.2",
"version": "5.4.3",
"description": "Wishlist King SDK",

@@ -5,0 +5,0 @@ "main": "wishlist-app.js",

@@ -1,4 +0,4 @@

var Ri=Object.defineProperty;var Oi=(s,t)=>{for(var e in t)Ri(s,e,{get:t[e],enumerable:!0})};var Le=(s,t,e)=>{if(!t.has(s))throw TypeError("Cannot "+e)};var gt=(s,t,e)=>(Le(s,t,"read from private field"),e?e.call(s):t.get(s)),wt=(s,t,e)=>{if(t.has(s))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(s):t.set(s,e)},yt=(s,t,e,i)=>(Le(s,t,"write to private field"),i?i.call(s,e):t.set(s,e),e);var _t={};Oi(_t,{CSSResult:()=>st,LitElement:()=>W,ReactiveElement:()=>M,_$LE:()=>Bi,_$LH:()=>be,adoptStyles:()=>Wt,css:()=>Fe,defaultConverter:()=>Nt,getCompatibleStyle:()=>vt,html:()=>Ui,isServer:()=>Ss,noChange:()=>P,notEqual:()=>pe,nothing:()=>b,render:()=>ve,supportsAdoptingStyleSheets:()=>bt,svg:()=>Vi,unsafeCSS:()=>fe});var Dt=globalThis,bt=Dt.ShadowRoot&&(Dt.ShadyCSS===void 0||Dt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,de=Symbol(),He=new WeakMap,st=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==de)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(bt&&t===void 0){let i=e!==void 0&&e.length===1;i&&(t=He.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&He.set(e,t))}return t}toString(){return this.cssText}},fe=s=>new st(typeof s=="string"?s:s+"",void 0,de),Fe=(s,...t)=>{let e=s.length===1?s[0]:t.reduce((i,n,r)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+s[r+1],s[0]);return new st(e,s,de)},Wt=(s,t)=>{if(bt)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let i=document.createElement("style"),n=Dt.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=e.cssText,s.appendChild(i)}},vt=bt?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return fe(e)})(s):s;var{is:Ii,defineProperty:Mi,getOwnPropertyDescriptor:Li,getOwnPropertyNames:Hi,getOwnPropertySymbols:Fi,getPrototypeOf:Di}=Object,B=globalThis,De=B.trustedTypes,Wi=De?De.emptyScript:"",ue=B.reactiveElementPolyfillSupport,xt=(s,t)=>s,Nt={toAttribute(s,t){switch(t){case Boolean:s=s?Wi:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch(i){e=null}}return e}},pe=(s,t)=>!Ii(s,t),We={attribute:!0,type:String,converter:Nt,reflect:!1,hasChanged:pe},Ne,Ue;(Ne=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(Ue=B.litPropertyMetadata)!=null||(B.litPropertyMetadata=new WeakMap);var M=class extends HTMLElement{static addInitializer(t){var e;this._$Ei(),((e=this.l)!=null?e:this.l=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=We){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let i=Symbol(),n=this.getPropertyDescriptor(t,i,e);n!==void 0&&Mi(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){var o;let{get:n,set:r}=(o=Li(this.prototype,t))!=null?o:{get(){return this[e]},set(a){this[e]=a}};return{get(){return n==null?void 0:n.call(this)},set(a){let l=n==null?void 0:n.call(this);r.call(this,a),this.requestUpdate(t,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return(e=this.elementProperties.get(t))!=null?e:We}static _$Ei(){if(this.hasOwnProperty(xt("elementProperties")))return;let t=Di(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(xt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(xt("properties"))){let e=this.properties,i=[...Hi(e),...Fi(e)];for(let n of i)this.createProperty(n,e[n])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[i,n]of e)this.elementProperties.set(i,n)}this._$Eh=new Map;for(let[e,i]of this.elementProperties){let n=this._$Eu(e,i);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let n of i)e.unshift(vt(n))}else t!==void 0&&e.push(vt(t));return e}static _$Eu(t,e){let i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$Eg=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$ES(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e,i;((e=this._$E_)!=null?e:this._$E_=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)==null||i.call(t))}removeController(t){var e;(e=this._$E_)==null||e.delete(t)}_$ES(){let t=new Map,e=this.constructor.elementProperties;for(let i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){var e;let t=(e=this.shadowRoot)!=null?e:this.attachShadow(this.constructor.shadowRootOptions);return Wt(t,this.constructor.elementStyles),t}connectedCallback(){var t,e;(t=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$E_)==null||e.forEach(i=>{var n;return(n=i.hostConnected)==null?void 0:n.call(i)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$E_)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e){var r;let i=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,i);if(n!==void 0&&i.reflect===!0){let o=(((r=i.converter)==null?void 0:r.toAttribute)!==void 0?i.converter:Nt).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(t,e){var r;let i=this.constructor,n=i._$Eh.get(t);if(n!==void 0&&this._$Em!==n){let o=i.getPropertyOptions(n),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:Nt;this._$Em=n,this[n]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,i,n=!1,r){var o;if(t!==void 0){if(i!=null||(i=this.constructor.getPropertyOptions(t)),!((o=i.hasChanged)!=null?o:pe)(n?r:this[t],e))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(t,e,i){var n;this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Em!==t&&((n=this._$Ej)!=null?n:this._$Ej=new Set).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i,n;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((i=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[o,a]of this._$Ep)this[o]=a;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[o,a]of r)a.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.C(o,this[o],a)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(n=this._$E_)==null||n.forEach(r=>{var o;return(o=r.hostUpdate)==null?void 0:o.call(r)}),this.update(e)):this._$ET()}catch(r){throw t=!1,this._$ET(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$E_)==null||e.forEach(i=>{var n;return(n=i.hostUpdated)==null?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EO(e,this[e]))),this._$ET()}updated(t){}firstUpdated(t){}},Ve;M.elementStyles=[],M.shadowRootOptions={mode:"open"},M[xt("elementProperties")]=new Map,M[xt("finalized")]=new Map,ue==null||ue({ReactiveElement:M}),((Ve=B.reactiveElementVersions)!=null?Ve:B.reactiveElementVersions=[]).push("2.0.2");var At=globalThis,Ut=At.trustedTypes,Be=Ut?Ut.createPolicy("lit-html",{createHTML:s=>s}):void 0,we="$lit$",D=`lit$${(Math.random()+"").slice(9)}$`,ye="?"+D,Ni=`<${ye}>`,J=document,Ct=()=>J.createComment(""),St=s=>s===null||typeof s!="object"&&typeof s!="function",Je=Array.isArray,Ze=s=>Je(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",me=`[
var Ri=Object.defineProperty;var Oi=(s,t)=>{for(var e in t)Ri(s,e,{get:t[e],enumerable:!0})};var Le=(s,t,e)=>{if(!t.has(s))throw TypeError("Cannot "+e)};var gt=(s,t,e)=>(Le(s,t,"read from private field"),e?e.call(s):t.get(s)),wt=(s,t,e)=>{if(t.has(s))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(s):t.set(s,e)},yt=(s,t,e,i)=>(Le(s,t,"write to private field"),i?i.call(s,e):t.set(s,e),e);var _t={};Oi(_t,{CSSResult:()=>st,LitElement:()=>W,ReactiveElement:()=>M,_$LE:()=>Bi,_$LH:()=>be,adoptStyles:()=>Wt,css:()=>Fe,defaultConverter:()=>Nt,getCompatibleStyle:()=>vt,html:()=>Ui,isServer:()=>Cs,noChange:()=>P,notEqual:()=>pe,nothing:()=>b,render:()=>ve,supportsAdoptingStyleSheets:()=>bt,svg:()=>Vi,unsafeCSS:()=>de});var Dt=globalThis,bt=Dt.ShadowRoot&&(Dt.ShadyCSS===void 0||Dt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,fe=Symbol(),He=new WeakMap,st=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==fe)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(bt&&t===void 0){let i=e!==void 0&&e.length===1;i&&(t=He.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&He.set(e,t))}return t}toString(){return this.cssText}},de=s=>new st(typeof s=="string"?s:s+"",void 0,fe),Fe=(s,...t)=>{let e=s.length===1?s[0]:t.reduce((i,n,r)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+s[r+1],s[0]);return new st(e,s,fe)},Wt=(s,t)=>{if(bt)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let i=document.createElement("style"),n=Dt.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=e.cssText,s.appendChild(i)}},vt=bt?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return de(e)})(s):s;var{is:Ii,defineProperty:Mi,getOwnPropertyDescriptor:Li,getOwnPropertyNames:Hi,getOwnPropertySymbols:Fi,getPrototypeOf:Di}=Object,B=globalThis,De=B.trustedTypes,Wi=De?De.emptyScript:"",ue=B.reactiveElementPolyfillSupport,xt=(s,t)=>s,Nt={toAttribute(s,t){switch(t){case Boolean:s=s?Wi:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch(i){e=null}}return e}},pe=(s,t)=>!Ii(s,t),We={attribute:!0,type:String,converter:Nt,reflect:!1,hasChanged:pe},Ne,Ue;(Ne=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(Ue=B.litPropertyMetadata)!=null||(B.litPropertyMetadata=new WeakMap);var M=class extends HTMLElement{static addInitializer(t){var e;this._$Ei(),((e=this.l)!=null?e:this.l=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=We){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let i=Symbol(),n=this.getPropertyDescriptor(t,i,e);n!==void 0&&Mi(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){var o;let{get:n,set:r}=(o=Li(this.prototype,t))!=null?o:{get(){return this[e]},set(a){this[e]=a}};return{get(){return n==null?void 0:n.call(this)},set(a){let l=n==null?void 0:n.call(this);r.call(this,a),this.requestUpdate(t,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return(e=this.elementProperties.get(t))!=null?e:We}static _$Ei(){if(this.hasOwnProperty(xt("elementProperties")))return;let t=Di(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(xt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(xt("properties"))){let e=this.properties,i=[...Hi(e),...Fi(e)];for(let n of i)this.createProperty(n,e[n])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[i,n]of e)this.elementProperties.set(i,n)}this._$Eh=new Map;for(let[e,i]of this.elementProperties){let n=this._$Eu(e,i);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let n of i)e.unshift(vt(n))}else t!==void 0&&e.push(vt(t));return e}static _$Eu(t,e){let i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$Eg=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$ES(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e,i;((e=this._$E_)!=null?e:this._$E_=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)==null||i.call(t))}removeController(t){var e;(e=this._$E_)==null||e.delete(t)}_$ES(){let t=new Map,e=this.constructor.elementProperties;for(let i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){var e;let t=(e=this.shadowRoot)!=null?e:this.attachShadow(this.constructor.shadowRootOptions);return Wt(t,this.constructor.elementStyles),t}connectedCallback(){var t,e;(t=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$E_)==null||e.forEach(i=>{var n;return(n=i.hostConnected)==null?void 0:n.call(i)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$E_)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e){var r;let i=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,i);if(n!==void 0&&i.reflect===!0){let o=(((r=i.converter)==null?void 0:r.toAttribute)!==void 0?i.converter:Nt).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(t,e){var r;let i=this.constructor,n=i._$Eh.get(t);if(n!==void 0&&this._$Em!==n){let o=i.getPropertyOptions(n),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:Nt;this._$Em=n,this[n]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,i,n=!1,r){var o;if(t!==void 0){if(i!=null||(i=this.constructor.getPropertyOptions(t)),!((o=i.hasChanged)!=null?o:pe)(n?r:this[t],e))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(t,e,i){var n;this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Em!==t&&((n=this._$Ej)!=null?n:this._$Ej=new Set).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i,n;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((i=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[o,a]of this._$Ep)this[o]=a;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[o,a]of r)a.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.C(o,this[o],a)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(n=this._$E_)==null||n.forEach(r=>{var o;return(o=r.hostUpdate)==null?void 0:o.call(r)}),this.update(e)):this._$ET()}catch(r){throw t=!1,this._$ET(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$E_)==null||e.forEach(i=>{var n;return(n=i.hostUpdated)==null?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EO(e,this[e]))),this._$ET()}updated(t){}firstUpdated(t){}},Ve;M.elementStyles=[],M.shadowRootOptions={mode:"open"},M[xt("elementProperties")]=new Map,M[xt("finalized")]=new Map,ue==null||ue({ReactiveElement:M}),((Ve=B.reactiveElementVersions)!=null?Ve:B.reactiveElementVersions=[]).push("2.0.2");var At=globalThis,Ut=At.trustedTypes,Be=Ut?Ut.createPolicy("lit-html",{createHTML:s=>s}):void 0,we="$lit$",D=`lit$${(Math.random()+"").slice(9)}$`,ye="?"+D,Ni=`<${ye}>`,J=document,St=()=>J.createComment(""),Ct=s=>s===null||typeof s!="object"&&typeof s!="function",Je=Array.isArray,Ze=s=>Je(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",me=`[
\f\r]`,$t=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ze=/-->/g,je=/>/g,Y=RegExp(`>|${me}(?:([^\\s"'>=/]+)(${me}*=${me}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ke=/'/g,qe=/"/g,Qe=/^(?:script|style|textarea|title)$/i,Ge=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),Ui=Ge(1),Vi=Ge(2),P=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),Ye=new WeakMap,X=J.createTreeWalker(J,129);function ti(s,t){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Be!==void 0?Be.createHTML(t):t}var ei=(s,t)=>{let e=s.length-1,i=[],n,r=t===2?"<svg>":"",o=$t;for(let a=0;a<e;a++){let l=s[a],c,f,h=-1,p=0;for(;p<l.length&&(o.lastIndex=p,f=o.exec(l),f!==null);)p=o.lastIndex,o===$t?f[1]==="!--"?o=ze:f[1]!==void 0?o=je:f[2]!==void 0?(Qe.test(f[2])&&(n=RegExp("</"+f[2],"g")),o=Y):f[3]!==void 0&&(o=Y):o===Y?f[0]===">"?(o=n!=null?n:$t,h=-1):f[1]===void 0?h=-2:(h=o.lastIndex-f[2].length,c=f[1],o=f[3]===void 0?Y:f[3]==='"'?qe:Ke):o===qe||o===Ke?o=Y:o===ze||o===je?o=$t:(o=Y,n=void 0);let d=o===Y&&s[a+1].startsWith("/>")?" ":"";r+=o===$t?l+Ni:h>=0?(i.push(c),l.slice(0,h)+we+l.slice(h)+D+d):l+D+(h===-2?a:d)}return[ti(s,r+(s[e]||"<?>")+(t===2?"</svg>":"")),i]},Et=class s{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let r=0,o=0,a=t.length-1,l=this.parts,[c,f]=ei(t,e);if(this.el=s.createElement(c,i),X.currentNode=this.el.content,e===2){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(n=X.nextNode())!==null&&l.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let h of n.getAttributeNames())if(h.endsWith(we)){let p=f[o++],d=n.getAttribute(h).split(D),u=/([.?@])?(.*)/.exec(p);l.push({type:1,index:r,name:u[2],strings:d,ctor:u[1]==="."?Bt:u[1]==="?"?zt:u[1]==="@"?jt:Q}),n.removeAttribute(h)}else h.startsWith(D)&&(l.push({type:6,index:r}),n.removeAttribute(h));if(Qe.test(n.tagName)){let h=n.textContent.split(D),p=h.length-1;if(p>0){n.textContent=Ut?Ut.emptyScript:"";for(let d=0;d<p;d++)n.append(h[d],Ct()),X.nextNode(),l.push({type:2,index:++r});n.append(h[p],Ct())}}}else if(n.nodeType===8)if(n.data===ye)l.push({type:2,index:r});else{let h=-1;for(;(h=n.data.indexOf(D,h+1))!==-1;)l.push({type:7,index:r}),h+=D.length-1}r++}}static createElement(t,e){let i=J.createElement("template");return i.innerHTML=t,i}};function Z(s,t,e=s,i){var o,a,l;if(t===P)return t;let n=i!==void 0?(o=e._$Co)==null?void 0:o[i]:e._$Cl,r=St(t)?void 0:t._$litDirective$;return(n==null?void 0:n.constructor)!==r&&((a=n==null?void 0:n._$AO)==null||a.call(n,!1),r===void 0?n=void 0:(n=new r(s),n._$AT(s,e,i)),i!==void 0?((l=e._$Co)!=null?l:e._$Co=[])[i]=n:e._$Cl=n),n!==void 0&&(t=Z(s,n._$AS(s,t.values),n,i)),t}var Vt=class{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){var c;let{el:{content:e},parts:i}=this._$AD,n=((c=t==null?void 0:t.creationScope)!=null?c:J).importNode(e,!0);X.currentNode=n;let r=X.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let f;l.type===2?f=new nt(r,r.nextSibling,this,t):l.type===1?f=new l.ctor(r,l.name,l.strings,this,t):l.type===6&&(f=new Kt(r,this,t)),this._$AV.push(f),l=i[++a]}o!==(l==null?void 0:l.index)&&(r=X.nextNode(),o++)}return X.currentNode=J,n}p(t){let e=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},nt=class s{get _$AU(){var t,e;return(e=(t=this._$AM)==null?void 0:t._$AU)!=null?e:this._$Cv}constructor(t,e,i,n){var r;this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$Cv=(r=n==null?void 0:n.isConnected)!=null?r:!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Z(this,t,e),St(t)?t===b||t==null||t===""?(this._$AH!==b&&this._$AR(),this._$AH=b):t!==this._$AH&&t!==P&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):Ze(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==b&&St(this._$AH)?this._$AA.nextSibling.data=t:this.$(J.createTextNode(t)),this._$AH=t}g(t){var r;let{values:e,_$litType$:i}=t,n=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=Et.createElement(ti(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)==null?void 0:r._$AD)===n)this._$AH.p(e);else{let o=new Vt(n,this),a=o.u(this.options);o.p(e),this.$(a),this._$AH=o}}_$AC(t){let e=Ye.get(t.strings);return e===void 0&&Ye.set(t.strings,e=new Et(t)),e}T(t){Je(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,i,n=0;for(let r of t)n===e.length?e.push(i=new s(this.k(Ct()),this.k(Ct()),this,this.options)):i=e[n],i._$AI(r),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){let n=t.nextSibling;t.remove(),t=n}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},Q=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,n,r){this.type=1,this._$AH=b,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=b}_$AI(t,e=this,i,n){let r=this.strings,o=!1;if(r===void 0)t=Z(this,t,e,0),o=!St(t)||t!==this._$AH&&t!==P,o&&(this._$AH=t);else{let a=t,l,c;for(t=r[0],l=0;l<r.length-1;l++)c=Z(this,a[i+l],e,l),c===P&&(c=this._$AH[l]),o||(o=!St(c)||c!==this._$AH[l]),c===b?t=b:t!==b&&(t+=(c!=null?c:"")+r[l+1]),this._$AH[l]=c}o&&!n&&this.O(t)}O(t){t===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}},Bt=class extends Q{constructor(){super(...arguments),this.type=3}O(t){this.element[this.name]=t===b?void 0:t}},zt=class extends Q{constructor(){super(...arguments),this.type=4}O(t){this.element.toggleAttribute(this.name,!!t&&t!==b)}},jt=class extends Q{constructor(t,e,i,n,r){super(t,e,i,n,r),this.type=5}_$AI(t,e=this){var o;if((t=(o=Z(this,t,e,0))!=null?o:b)===P)return;let i=this._$AH,n=t===b&&i!==b||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==b&&(i===b||n);n&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;typeof this._$AH=="function"?this._$AH.call((i=(e=this.options)==null?void 0:e.host)!=null?i:this.element,t):this._$AH.handleEvent(t)}},Kt=class{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Z(this,t)}},be={j:we,P:D,A:ye,C:1,M:ei,L:Vt,R:Ze,V:Z,D:nt,I:Q,H:zt,N:jt,U:Bt,B:Kt},ge=At.litHtmlPolyfillSupport,Xe;ge==null||ge(Et,nt),((Xe=At.litHtmlVersions)!=null?Xe:At.litHtmlVersions=[]).push("3.1.0");var ve=(s,t,e)=>{var r,o;let i=(r=e==null?void 0:e.renderBefore)!=null?r:t,n=i._$litPart$;if(n===void 0){let a=(o=e==null?void 0:e.renderBefore)!=null?o:null;i._$litPart$=n=new nt(t.insertBefore(Ct(),a),a,void 0,e!=null?e:{})}return n._$AI(s),n};var W=class extends M{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,i;let t=super.createRenderRoot();return(i=(e=this.renderOptions).renderBefore)!=null||(e.renderBefore=t.firstChild),t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ve(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return P}},ii;W._$litElement$=!0,W.finalized=!0,(ii=globalThis.litElementHydrateSupport)==null||ii.call(globalThis,{LitElement:W});var xe=globalThis.litElementPolyfillSupport;xe==null||xe({LitElement:W});var Bi={_$AK:(s,t,e)=>{s._$AK(t,e)},_$AL:s=>s._$AL},si;((si=globalThis.litElementVersions)!=null?si:globalThis.litElementVersions=[]).push("4.0.2");var Ss=!1;var qt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Yt=s=>(...t)=>({_$litDirective$:s,values:t}),ot=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var{D:zi}=be;var ni=()=>document.createComment(""),rt=(s,t,e)=>{var r;let i=s._$AA.parentNode,n=t===void 0?s._$AB:t._$AA;if(e===void 0){let o=i.insertBefore(ni(),n),a=i.insertBefore(ni(),n);e=new zi(o,a,s,s.options)}else{let o=e._$AB.nextSibling,a=e._$AM,l=a!==s;if(l){let c;(r=e._$AQ)==null||r.call(e,s),e._$AM=s,e._$AP!==void 0&&(c=s._$AU)!==a._$AU&&e._$AP(c)}if(o!==n||l){let c=e._$AA;for(;c!==o;){let f=c.nextSibling;i.insertBefore(c,n),c=f}}}return e},z=(s,t,e=s)=>(s._$AI(t,e),s),ji={},oi=(s,t=ji)=>s._$AH=t,ri=s=>s._$AH,Xt=s=>{var i;(i=s._$AP)==null||i.call(s,!1,!0);let t=s._$AA,e=s._$AB.nextSibling;for(;t!==e;){let n=t.nextSibling;t.remove(),t=n}};var ai=(s,t,e)=>{let i=new Map;for(let n=t;n<=e;n++)i.set(s[n],n);return i},Jt=Yt(class extends ot{constructor(s){if(super(s),s.type!==qt.CHILD)throw Error("repeat() can only be used in text expressions")}ht(s,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);let n=[],r=[],o=0;for(let a of s)n[o]=i?i(a,o):o,r[o]=e(a,o),o++;return{values:r,keys:n}}render(s,t,e){return this.ht(s,t,e).values}update(s,[t,e,i]){var m;let n=ri(s),{values:r,keys:o}=this.ht(t,e,i);if(!Array.isArray(n))return this.dt=o,r;let a=(m=this.dt)!=null?m:this.dt=[],l=[],c,f,h=0,p=n.length-1,d=0,u=r.length-1;for(;h<=p&&d<=u;)if(n[h]===null)h++;else if(n[p]===null)p--;else if(a[h]===o[d])l[d]=z(n[h],r[d]),h++,d++;else if(a[p]===o[u])l[u]=z(n[p],r[u]),p--,u--;else if(a[h]===o[u])l[u]=z(n[h],r[u]),rt(s,l[u+1],n[h]),h++,u--;else if(a[p]===o[d])l[d]=z(n[p],r[d]),rt(s,n[h],n[p]),p--,d++;else if(c===void 0&&(c=ai(o,d,u),f=ai(a,h,p)),c.has(a[h]))if(c.has(a[p])){let g=f.get(o[d]),w=g!==void 0?n[g]:null;if(w===null){let y=rt(s,n[h]);z(y,r[d]),l[d]=y}else l[d]=z(w,r[d]),rt(s,n[h],w),n[g]=null;d++}else Xt(n[p]),p--;else Xt(n[h]),h++;for(;d<=u;){let g=rt(s,l[u+1]);z(g,r[d]),l[d++]=g}for(;h<=p;){let g=n[h++];g!==null&&Xt(g)}return this.dt=o,oi(s,l),P}});var j=Math.min,N=Math.max,Tt=Math.round,kt=Math.floor,U=s=>({x:s,y:s}),Ki={left:"right",right:"left",bottom:"top",top:"bottom"},qi={start:"end",end:"start"};function Qt(s,t,e){return N(s,j(t,e))}function at(s,t){return typeof s=="function"?s(t):s}function K(s){return s.split("-")[0]}function lt(s){return s.split("-")[1]}function $e(s){return s==="x"?"y":"x"}function Gt(s){return s==="y"?"height":"width"}function Rt(s){return["top","bottom"].includes(K(s))?"y":"x"}function te(s){return $e(Rt(s))}function li(s,t,e){e===void 0&&(e=!1);let i=lt(s),n=te(s),r=Gt(n),o=n==="x"?i===(e?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(o=Pt(o)),[o,Pt(o)]}function ci(s){let t=Pt(s);return[Zt(s),t,Zt(t)]}function Zt(s){return s.replace(/start|end/g,t=>qi[t])}function Yi(s,t,e){let i=["left","right"],n=["right","left"],r=["top","bottom"],o=["bottom","top"];switch(s){case"top":case"bottom":return e?t?n:i:t?i:n;case"left":case"right":return t?r:o;default:return[]}}function hi(s,t,e,i){let n=lt(s),r=Yi(K(s),e==="start",i);return n&&(r=r.map(o=>o+"-"+n),t&&(r=r.concat(r.map(Zt)))),r}function Pt(s){return s.replace(/left|right|bottom|top/g,t=>Ki[t])}function Xi(s){return{top:0,right:0,bottom:0,left:0,...s}}function Ae(s){return typeof s!="number"?Xi(s):{top:s,right:s,bottom:s,left:s}}function G(s){return{...s,top:s.y,left:s.x,right:s.x+s.width,bottom:s.y+s.height}}function di(s,t,e){let{reference:i,floating:n}=s,r=Rt(t),o=te(t),a=Gt(o),l=K(t),c=r==="y",f=i.x+i.width/2-n.width/2,h=i.y+i.height/2-n.height/2,p=i[a]/2-n[a]/2,d;switch(l){case"top":d={x:f,y:i.y-n.height};break;case"bottom":d={x:f,y:i.y+i.height};break;case"right":d={x:i.x+i.width,y:h};break;case"left":d={x:i.x-n.width,y:h};break;default:d={x:i.x,y:i.y}}switch(lt(t)){case"start":d[o]-=p*(e&&c?-1:1);break;case"end":d[o]+=p*(e&&c?-1:1);break}return d}var fi=async(s,t,e)=>{let{placement:i="bottom",strategy:n="absolute",middleware:r=[],platform:o}=e,a=r.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t)),c=await o.getElementRects({reference:s,floating:t,strategy:n}),{x:f,y:h}=di(c,i,l),p=i,d={},u=0;for(let m=0;m<a.length;m++){let{name:g,fn:w}=a[m],{x:y,y:v,data:$,reset:x}=await w({x:f,y:h,initialPlacement:i,placement:p,strategy:n,middlewareData:d,rects:c,platform:o,elements:{reference:s,floating:t}});if(f=y!=null?y:f,h=v!=null?v:h,d={...d,[g]:{...d[g],...$}},x&&u<=50){u++,typeof x=="object"&&(x.placement&&(p=x.placement),x.rects&&(c=x.rects===!0?await o.getElementRects({reference:s,floating:t,strategy:n}):x.rects),{x:f,y:h}=di(c,p,l)),m=-1;continue}}return{x:f,y:h,placement:p,strategy:n,middlewareData:d}};async function Ce(s,t){var e;t===void 0&&(t={});let{x:i,y:n,platform:r,rects:o,elements:a,strategy:l}=s,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:p=!1,padding:d=0}=at(t,s),u=Ae(d),g=a[p?h==="floating"?"reference":"floating":h],w=G(await r.getClippingRect({element:(e=await(r.isElement==null?void 0:r.isElement(g)))==null||e?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:l})),y=h==="floating"?{...o.floating,x:i,y:n}:o.reference,v=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),$=await(r.isElement==null?void 0:r.isElement(v))?await(r.getScale==null?void 0:r.getScale(v))||{x:1,y:1}:{x:1,y:1},x=G(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({rect:y,offsetParent:v,strategy:l}):y);return{top:(w.top-x.top+u.top)/$.y,bottom:(x.bottom-w.bottom+u.bottom)/$.y,left:(w.left-x.left+u.left)/$.x,right:(x.right-w.right+u.right)/$.x}}var Se=s=>({name:"arrow",options:s,async fn(t){let{x:e,y:i,placement:n,rects:r,platform:o,elements:a,middlewareData:l}=t,{element:c,padding:f=0}=at(s,t)||{};if(c==null)return{};let h=Ae(f),p={x:e,y:i},d=te(n),u=Gt(d),m=await o.getDimensions(c),g=d==="y",w=g?"top":"left",y=g?"bottom":"right",v=g?"clientHeight":"clientWidth",$=r.reference[u]+r.reference[d]-p[d]-r.floating[u],x=p[d]-r.reference[d],T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c)),R=T?T[v]:0;(!R||!await(o.isElement==null?void 0:o.isElement(T)))&&(R=a.floating[v]||r.floating[u]);let q=$/2-x/2,ft=R/2-m[u]/2-1,ut=j(h[w],ft),pt=j(h[y],ft),_=ut,mt=R-m[u]-pt,S=R/2-m[u]/2+q,O=Qt(_,S,mt),I=!l.arrow&&lt(n)!=null&&S!=O&&r.reference[u]/2-(S<_?ut:pt)-m[u]/2<0,F=I?S<_?S-_:S-mt:0;return{[d]:p[d]+F,data:{[d]:O,centerOffset:S-O-F,...I&&{alignmentOffset:F}},reset:I}}});var Ee=function(s){return s===void 0&&(s={}),{name:"flip",options:s,async fn(t){var e,i;let{placement:n,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:u="none",flipAlignment:m=!0,...g}=at(s,t);if((e=r.arrow)!=null&&e.alignmentOffset)return{};let w=K(n),y=K(a)===a,v=await(l.isRTL==null?void 0:l.isRTL(c.floating)),$=p||(y||!m?[Pt(a)]:ci(a));!p&&u!=="none"&&$.push(...hi(a,m,u,v));let x=[a,...$],T=await Ce(t,g),R=[],q=((i=r.flip)==null?void 0:i.overflows)||[];if(f&&R.push(T[w]),h){let _=li(n,o,v);R.push(T[_[0]],T[_[1]])}if(q=[...q,{placement:n,overflows:R}],!R.every(_=>_<=0)){var ft,ut;let _=(((ft=r.flip)==null?void 0:ft.index)||0)+1,mt=x[_];if(mt)return{data:{index:_,overflows:q},reset:{placement:mt}};let S=(ut=q.filter(O=>O.overflows[0]<=0).sort((O,I)=>O.overflows[1]-I.overflows[1])[0])==null?void 0:ut.placement;if(!S)switch(d){case"bestFit":{var pt;let O=(pt=q.map(I=>[I.placement,I.overflows.filter(F=>F>0).reduce((F,ki)=>F+ki,0)]).sort((I,F)=>I[1]-F[1])[0])==null?void 0:pt[0];O&&(S=O);break}case"initialPlacement":S=a;break}if(n!==S)return{reset:{placement:S}}}return{}}}};async function Ji(s,t){let{placement:e,platform:i,elements:n}=s,r=await(i.isRTL==null?void 0:i.isRTL(n.floating)),o=K(e),a=lt(e),l=Rt(e)==="y",c=["left","top"].includes(o)?-1:1,f=r&&l?-1:1,h=at(t,s),{mainAxis:p,crossAxis:d,alignmentAxis:u}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...h};return a&&typeof u=="number"&&(d=a==="end"?u*-1:u),l?{x:d*f,y:p*c}:{x:p*c,y:d*f}}var ee=function(s){return s===void 0&&(s=0),{name:"offset",options:s,async fn(t){var e,i;let{x:n,y:r,placement:o,middlewareData:a}=t,l=await Ji(t,s);return o===((e=a.offset)==null?void 0:e.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:n+l.x,y:r+l.y,data:{...l,placement:o}}}}},_e=function(s){return s===void 0&&(s={}),{name:"shift",options:s,async fn(t){let{x:e,y:i,placement:n}=t,{mainAxis:r=!0,crossAxis:o=!1,limiter:a={fn:g=>{let{x:w,y}=g;return{x:w,y}}},...l}=at(s,t),c={x:e,y:i},f=await Ce(t,l),h=Rt(K(n)),p=$e(h),d=c[p],u=c[h];if(r){let g=p==="y"?"top":"left",w=p==="y"?"bottom":"right",y=d+f[g],v=d-f[w];d=Qt(y,d,v)}if(o){let g=h==="y"?"top":"left",w=h==="y"?"bottom":"right",y=u+f[g],v=u-f[w];u=Qt(y,u,v)}let m=a.fn({...t,[p]:d,[h]:u});return{...m,data:{x:m.x-e,y:m.y-i}}}}};function V(s){return pi(s)?(s.nodeName||"").toLowerCase():"#document"}function A(s){var t;return(s==null||(t=s.ownerDocument)==null?void 0:t.defaultView)||window}function L(s){var t;return(t=(pi(s)?s.ownerDocument:s.document)||window.document)==null?void 0:t.documentElement}function pi(s){return s instanceof Node||s instanceof A(s).Node}function H(s){return s instanceof Element||s instanceof A(s).Element}function k(s){return s instanceof HTMLElement||s instanceof A(s).HTMLElement}function ui(s){return typeof ShadowRoot=="undefined"?!1:s instanceof ShadowRoot||s instanceof A(s).ShadowRoot}function ht(s){let{overflow:t,overflowX:e,overflowY:i,display:n}=E(s);return/auto|scroll|overlay|hidden|clip/.test(t+i+e)&&!["inline","contents"].includes(n)}function mi(s){return["table","td","th"].includes(V(s))}function ie(s){let t=se(),e=E(s);return e.transform!=="none"||e.perspective!=="none"||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(e.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(e.contain||"").includes(i))}function gi(s){let t=tt(s);for(;k(t)&&!Ot(t);){if(ie(t))return t;t=tt(t)}return null}function se(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ot(s){return["html","body","#document"].includes(V(s))}function E(s){return A(s).getComputedStyle(s)}function It(s){return H(s)?{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}:{scrollLeft:s.pageXOffset,scrollTop:s.pageYOffset}}function tt(s){if(V(s)==="html")return s;let t=s.assignedSlot||s.parentNode||ui(s)&&s.host||L(s);return ui(t)?t.host:t}function wi(s){let t=tt(s);return Ot(t)?s.ownerDocument?s.ownerDocument.body:s.body:k(t)&&ht(t)?t:wi(t)}function ct(s,t,e){var i;t===void 0&&(t=[]),e===void 0&&(e=!0);let n=wi(s),r=n===((i=s.ownerDocument)==null?void 0:i.body),o=A(n);return r?t.concat(o,o.visualViewport||[],ht(n)?n:[],o.frameElement&&e?ct(o.frameElement):[]):t.concat(n,ct(n,[],e))}function vi(s){let t=E(s),e=parseFloat(t.width)||0,i=parseFloat(t.height)||0,n=k(s),r=n?s.offsetWidth:e,o=n?s.offsetHeight:i,a=Tt(e)!==r||Tt(i)!==o;return a&&(e=r,i=o),{width:e,height:i,$:a}}function Pe(s){return H(s)?s:s.contextElement}function dt(s){let t=Pe(s);if(!k(t))return U(1);let e=t.getBoundingClientRect(),{width:i,height:n,$:r}=vi(t),o=(r?Tt(e.width):e.width)/i,a=(r?Tt(e.height):e.height)/n;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var Zi=U(0);function xi(s){let t=A(s);return!se()||!t.visualViewport?Zi:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Qi(s,t,e){return t===void 0&&(t=!1),!e||t&&e!==A(s)?!1:t}function et(s,t,e,i){t===void 0&&(t=!1),e===void 0&&(e=!1);let n=s.getBoundingClientRect(),r=Pe(s),o=U(1);t&&(i?H(i)&&(o=dt(i)):o=dt(s));let a=Qi(r,e,i)?xi(r):U(0),l=(n.left+a.x)/o.x,c=(n.top+a.y)/o.y,f=n.width/o.x,h=n.height/o.y;if(r){let p=A(r),d=i&&H(i)?A(i):i,u=p.frameElement;for(;u&&i&&d!==p;){let m=dt(u),g=u.getBoundingClientRect(),w=E(u),y=g.left+(u.clientLeft+parseFloat(w.paddingLeft))*m.x,v=g.top+(u.clientTop+parseFloat(w.paddingTop))*m.y;l*=m.x,c*=m.y,f*=m.x,h*=m.y,l+=y,c+=v,u=A(u).frameElement}}return G({width:f,height:h,x:l,y:c})}function Gi(s){let{rect:t,offsetParent:e,strategy:i}=s,n=k(e),r=L(e);if(e===r)return t;let o={scrollLeft:0,scrollTop:0},a=U(1),l=U(0);if((n||!n&&i!=="fixed")&&((V(e)!=="body"||ht(r))&&(o=It(e)),k(e))){let c=et(e);a=dt(e),l.x=c.x+e.clientLeft,l.y=c.y+e.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-o.scrollLeft*a.x+l.x,y:t.y*a.y-o.scrollTop*a.y+l.y}}function ts(s){return Array.from(s.getClientRects())}function $i(s){return et(L(s)).left+It(s).scrollLeft}function es(s){let t=L(s),e=It(s),i=s.ownerDocument.body,n=N(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=N(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight),o=-e.scrollLeft+$i(s),a=-e.scrollTop;return E(i).direction==="rtl"&&(o+=N(t.clientWidth,i.clientWidth)-n),{width:n,height:r,x:o,y:a}}function is(s,t){let e=A(s),i=L(s),n=e.visualViewport,r=i.clientWidth,o=i.clientHeight,a=0,l=0;if(n){r=n.width,o=n.height;let c=se();(!c||c&&t==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:r,height:o,x:a,y:l}}function ss(s,t){let e=et(s,!0,t==="fixed"),i=e.top+s.clientTop,n=e.left+s.clientLeft,r=k(s)?dt(s):U(1),o=s.clientWidth*r.x,a=s.clientHeight*r.y,l=n*r.x,c=i*r.y;return{width:o,height:a,x:l,y:c}}function yi(s,t,e){let i;if(t==="viewport")i=is(s,e);else if(t==="document")i=es(L(s));else if(H(t))i=ss(t,e);else{let n=xi(s);i={...t,x:t.x-n.x,y:t.y-n.y}}return G(i)}function Ai(s,t){let e=tt(s);return e===t||!H(e)||Ot(e)?!1:E(e).position==="fixed"||Ai(e,t)}function ns(s,t){let e=t.get(s);if(e)return e;let i=ct(s,[],!1).filter(a=>H(a)&&V(a)!=="body"),n=null,r=E(s).position==="fixed",o=r?tt(s):s;for(;H(o)&&!Ot(o);){let a=E(o),l=ie(o);!l&&a.position==="fixed"&&(n=null),(r?!l&&!n:!l&&a.position==="static"&&!!n&&["absolute","fixed"].includes(n.position)||ht(o)&&!l&&Ai(s,o))?i=i.filter(f=>f!==o):n=a,o=tt(o)}return t.set(s,i),i}function os(s){let{element:t,boundary:e,rootBoundary:i,strategy:n}=s,o=[...e==="clippingAncestors"?ns(t,this._c):[].concat(e),i],a=o[0],l=o.reduce((c,f)=>{let h=yi(t,f,n);return c.top=N(h.top,c.top),c.right=j(h.right,c.right),c.bottom=j(h.bottom,c.bottom),c.left=N(h.left,c.left),c},yi(t,a,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function rs(s){return vi(s)}function as(s,t,e){let i=k(t),n=L(t),r=e==="fixed",o=et(s,!0,r,t),a={scrollLeft:0,scrollTop:0},l=U(0);if(i||!i&&!r)if((V(t)!=="body"||ht(n))&&(a=It(t)),i){let c=et(t,!0,r,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else n&&(l.x=$i(n));return{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function bi(s,t){return!k(s)||E(s).position==="fixed"?null:t?t(s):s.offsetParent}function Ci(s,t){let e=A(s);if(!k(s))return e;let i=bi(s,t);for(;i&&mi(i)&&E(i).position==="static";)i=bi(i,t);return i&&(V(i)==="html"||V(i)==="body"&&E(i).position==="static"&&!ie(i))?e:i||gi(s)||e}var ls=async function(s){let{reference:t,floating:e,strategy:i}=s,n=this.getOffsetParent||Ci,r=this.getDimensions;return{reference:as(t,await n(e),i),floating:{x:0,y:0,...await r(e)}}};function cs(s){return E(s).direction==="rtl"}var hs={convertOffsetParentRelativeRectToViewportRelativeRect:Gi,getDocumentElement:L,getClippingRect:os,getOffsetParent:Ci,getElementRects:ls,getClientRects:ts,getDimensions:rs,getScale:dt,isElement:H,isRTL:cs};function ds(s,t){let e=null,i,n=L(s);function r(){clearTimeout(i),e&&e.disconnect(),e=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),r();let{left:c,top:f,width:h,height:p}=s.getBoundingClientRect();if(a||t(),!h||!p)return;let d=kt(f),u=kt(n.clientWidth-(c+h)),m=kt(n.clientHeight-(f+p)),g=kt(c),y={rootMargin:-d+"px "+-u+"px "+-m+"px "+-g+"px",threshold:N(0,j(1,l))||1},v=!0;function $(x){let T=x[0].intersectionRatio;if(T!==l){if(!v)return o();T?o(!1,T):i=setTimeout(()=>{o(!1,1e-7)},100)}v=!1}try{e=new IntersectionObserver($,{...y,root:n.ownerDocument})}catch(x){e=new IntersectionObserver($,y)}e.observe(s)}return o(!0),r}function Si(s,t,e,i){i===void 0&&(i={});let{ancestorScroll:n=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=Pe(s),f=n||r?[...c?ct(c):[],...ct(t)]:[];f.forEach(w=>{n&&w.addEventListener("scroll",e,{passive:!0}),r&&w.addEventListener("resize",e)});let h=c&&a?ds(c,e):null,p=-1,d=null;o&&(d=new ResizeObserver(w=>{let[y]=w;y&&y.target===c&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{d&&d.observe(t)})),e()}),c&&!l&&d.observe(c),d.observe(t));let u,m=l?et(s):null;l&&g();function g(){let w=et(s);m&&(w.x!==m.x||w.y!==m.y||w.width!==m.width||w.height!==m.height)&&e(),m=w,u=requestAnimationFrame(g)}return e(),()=>{f.forEach(w=>{n&&w.removeEventListener("scroll",e),r&&w.removeEventListener("resize",e)}),h&&h(),d&&d.disconnect(),d=null,l&&cancelAnimationFrame(u)}}var Ei=(s,t,e)=>{let i=new Map,n={platform:hs,...e},r={...n.platform,_c:i};return fi(s,t,{...n,platform:r})};var it=class{constructor(t){this._middleware=[];this._floating=!1;(this.host=t).addController(this)}hostConnected(){this.host.floating&&this.float(this.host.floating)}hostDisconnected(){this.destroy()}hostUpdated(){this.host.floating&&!this._floating&&this.float(this.host.floating),this._floating&&this.updatePosition()}hostResized(){this._floating&&this.updatePosition()}float(t){var l;if(this._floating)return;if(this._floating=!0,this._settings=t,this._reference=this.getReference(),this._resizeObserver=new ResizeObserver(()=>this.hostResized()),!this._settings)throw new Error("Floating settings are required");if(!this._reference)throw new Error("Floating reference is required");this.host.classList.add("wk-floating");let{position:e,arrow:i=!1,flip:n=!1,shift:r=!1,animationFrame:o=!1}=this._settings,a=this.getOffsetSetting();Object.assign(this.host.style,{position:(l=e.strategy)!=null?l:"absolute",top:"0",left:"0",transition:"none",transform:"translate3d(0,0,0)"}),e.inset&&!i?this._middleware.push(ee(({rects:c,placement:f})=>{var h,p,d,u,m,g;return f.includes("top")||f.includes("bottom")?{mainAxis:-c.floating.height-((h=a==null?void 0:a.mainAxis)!=null?h:0),crossAxis:(p=a==null?void 0:a.crossAxis)!=null?p:0,alignmentAxis:(d=a==null?void 0:a.alignmentAxis)!=null?d:0}:{mainAxis:-c.floating.width-((u=a==null?void 0:a.mainAxis)!=null?u:0),crossAxis:(m=a==null?void 0:a.crossAxis)!=null?m:0,alignmentAxis:(g=a==null?void 0:a.alignmentAxis)!=null?g:0}})):a&&this._middleware.push(ee(a)),n&&this._middleware.push(Ee()),r&&this._middleware.push(_e()),i&&(this.arrowEl=document.createElement("div"),this.arrowEl.classList.add("wk-arrow"),this._middleware.push(Se({element:this.arrowEl}))),this.cleanupAutoUpdate=Si(this._reference,this.host,()=>{this.updatePosition()},{animationFrame:o}),this._resizeObserver.observe(this.host)}getOffsetSetting(){var e,i;let t=(e=this._settings)==null?void 0:e.offset;if(!(!t||typeof t=="boolean"))return typeof t=="number"?{mainAxis:t,alignmentAxis:(i=this._settings)!=null&&i.position.inset?t:null}:t}destroy(){var t,e,i,n;this._floating&&(Object.assign(this.host.style,{position:"",top:"",left:"",transition:"",transform:""}),(e=(t=this.arrowEl)==null?void 0:t.parentElement)==null||e.removeChild(this.arrowEl),this.arrowEl=void 0,this._middleware=[],this.host.classList.remove("wk-floating"),(i=this.cleanupAutoUpdate)==null||i.call(this),(n=this._resizeObserver)==null||n.disconnect(),this._floating=!1)}updatePosition(){var i;if(!this._reference||!this._settings)return;let{strategy:t="absolute",placement:e="top"}=(i=this._settings.position)!=null?i:{};Ei(this._reference,this.host,{middleware:this._middleware,strategy:t,placement:e}).then(({x:n,y:r,placement:o,middlewareData:a})=>{if(a.arrow&&this.arrowEl){let{x:l,y:c}=a.arrow,f={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]],h={bottom:"0deg",left:"90deg",top:"180deg",right:"270deg"}[o.split("-")[0]];Object.assign(this.arrowEl.style,{left:l!=null?`${l}px`:"",top:c!=null?`${c}px`:"",right:"",bottom:"",[f]:"-5px",transform:`rotate(${h})`})}Object.assign(this.host.style,{transform:`translate3d(${Math.round(n)}px,${Math.round(r)}px,0)`})})}getReference(){if(!this._settings)return;let t=this._settings.reference;if(typeof t=="string"){if(t==="viewport")return this.createViewportReference();let e=document.querySelector(t);if(!e)throw new Error(`Floating reference element (${t}) not found`);return e}return t.hasOwnProperty("element")?t.element:t}createViewportReference(){return{getBoundingClientRect(){var t,e,i,n;return{x:0,y:0,top:0,left:0,bottom:0,right:0,width:(e=(t=window.visualViewport)==null?void 0:t.width)!=null?e:0,height:(n=(i=window.visualViewport)==null?void 0:i.height)!=null?n:0}}}}};var Te=class{constructor(t){this.product=null;this.selectedVariant=null;this.selectedOptions={};this.hasSelection=!1;this.optionsWithValues=[];this.hasOnlyDefaultVariant=!1;(this.host=t).addController(this)}set submitting(t){var e;(e=this.host.querySelector("form"))==null||e.classList.toggle("wk-submitting",t)}get submitting(){var t,e;return(e=(t=this.host.querySelector("form"))==null?void 0:t.classList.contains("wk-submitting"))!=null?e:!1}setProduct({product:t,selectedVariantId:e,autoSelect:i=!1}){t!=null&&t.variants.length&&(this.product=t,this.initFormState({selectedVariantId:e,autoSelect:i}))}initFormState({selectedVariantId:t,autoSelect:e}){if(!this.product)throw new Error("Product not set");let i=this.initializedVariantId!==t?this.product.variants.find(r=>r.id===t):this.selectedVariant;this.initializedVariantId=t;let n=this.host.app.utils.product.getVariantOptions({variant:i});this.updateFormState({options:n,autoSelect:e})}updateFormState({options:t,change:e,autoSelect:i=!1}){if(!this.product)throw new Error("Product not set");let{hasSelection:n,optionsWithValues:r,selectedOptions:o,selectedVariant:a,hasOnlyDefaultVariant:l}=this.host.app.utils.product.getFormState({product:this.product,options:t,change:e,autoSelect:i});this.hasSelection=n,this.optionsWithValues=r,this.selectedOptions=o,this.selectedVariant=a,this.hasOnlyDefaultVariant=l,this.host.requestUpdate()}changeOption({input:t,autoSelect:e=!1}){if(!this.product)throw new Error("Product not set");let i=this.getInputOption(t);if(!i)throw new Error("Cannot parse options from input");this.updateFormState({options:this.selectedOptions,change:i,autoSelect:e})}addToCart({wishlistId:t,wishlistItemId:e,quantity:i,sectionsToRender:n,sectionsUrl:r="/"}){if(!this.selectedVariant)throw new Error("No variant selected");let o=this.host.querySelector("form");if(!o)throw new Error("Form not found");return this.submitting=!0,this.host.app.addToCart({wishlistId:t,wishlistItemId:e,variantId:this.selectedVariant.id,quantity:i!=null?i:this.host.app.utils.product.getFormQuantity({form:o}),properties:this.host.app.utils.product.getFormProperties({form:o}),sectionsToRender:n,sectionsUrl:r}).finally(()=>{this.submitting=!1})}getInputOption(t){if(!this.product)throw new Error("Product not set");return this.host.app.utils.product.getInputOption({input:t,product:this.product})}hostConnected(){}hostDisconnected(){}hostUpdate(){}hostUpdated(){}};var ke,_i=s=>(!!localStorage.getItem("debug")&&(ke=import("https://cdn.jsdelivr.net/npm/debug@4.3.4/+esm")),(e,...i)=>{ke&&ke.then(({default:n})=>{n(s)(e,...i)})});var Re=1,fs={shopify:`wk-shopify-v${Re}`,storefront:`wk-storefront-v${Re}`,wishlist:`wk-wishlist-v${Re}`};var us=()=>{let s=_i("wk:cache"),t=Object.values(fs);caches.keys().then(e=>Promise.all(e.map(i=>{if(!t.includes(i))return s("Delete old cache",{cacheName:i}),caches.delete(i)})))};us();var Mt,ne=class{constructor(t){wt(this,Mt,void 0);yt(this,Mt,t)}subscribe(t){let e=gt(this,Mt).call(this,new Oe(t));return new Ie(()=>{e==null||e()})}};Mt=new WeakMap;var Lt,Oe=class{constructor(t){wt(this,Lt,void 0);yt(this,Lt,t)}next(t){gt(this,Lt).call(this,t)}};Lt=new WeakMap;var Ht,Ie=class{constructor(t){wt(this,Ht,void 0);yt(this,Ht,t)}unsubscribe(){var t;(t=gt(this,Ht))==null||t.call(this)}};Ht=new WeakMap;var oe=class{constructor(t){this.stateConfig={loading:"eager"};this.state={};(this.host=t).addController(this)}get app(){if(!window.WishlistKing)throw new Error("Wishlist King SDK not initialized");return window.WishlistKing}get hostDataset(){return this.host.dataset?this.host.dataset:this.host.host?this.host.host.dataset:{}}hostConnected(){}hostDisconnected(){}parseStateConfig(t){var e;return{loading:(e=t.loading)!=null?e:"eager",wishlist:this.parseWishlistStateConfig(t),wishlistItem:this.parseWishlistItemStateConfig(t),productInfo:this.parseProductInfoStateConfig(t),cart:t.cart}}parseWishlistStateConfig({wishlist:t}){var i;let e=(i=this.hostDataset.wishlistId)!=null?i:"mine";if(t)return{params:{wishlistId:e}}}parseWishlistItemStateConfig({wishlistItem:t}){let{wishlistId:e="mine",wishlistItemId:i}=this.hostDataset;if(!(!t||!i))return{params:{wishlistId:e,wishlistItemId:i}}}parseProductInfoStateConfig({productInfo:t}){if(!t)return;let{wishlistId:e="mine",productHandle:i="",productId:n,variantId:r}=this.hostDataset;return{params:{wishlistId:e,productHandle:i,variantId:r?parseInt(r):void 0}}}observe(){return this.stateConfig=this.parseStateConfig(this.host.getStateConfig()),new ne(t=>{let e=i=>{this.state={...this.state,...i},t.next(this.state)};if(this.stateConfig.wishlist){let{wishlistId:i="mine"}=this.stateConfig.wishlist.params;this.app.state.observeWishlist({wishlistId:i}).subscribe(n=>e({wishlist:n}))}if(this.stateConfig.productInfo){let{productHandle:i,variantId:n}=this.stateConfig.productInfo.params;if(!i)throw new Error("Product handle is required");this.app.state.observeProductInfo({productHandle:i,variantId:n}).subscribe(r=>e({productInfo:r}))}if(this.stateConfig.wishlistItem){let{wishlistId:i,wishlistItemId:n}=this.stateConfig.wishlistItem.params;if(!i)throw new Error("Wishlist id is required");if(!n)throw new Error("Wishlist item id is required");this.app.state.observeWishlist({wishlistId:i}).subscribe(r=>e({wishlistItem:r.items.find(o=>o.id===n)}))}this.stateConfig.cart&&this.app.state.observeShopifyCart({cacheStrategy:"public, max-age=1, stale-while-revalidate=10"}).subscribe(i=>e({cart:i}))})}getFallback(){this.stateConfig=this.parseStateConfig(this.host.getStateConfig());let t={};if(this.stateConfig.wishlist){let{wishlistId:e="mine"}=this.stateConfig.wishlist.params;t.wishlist={id:e,isMine:e==="mine",numItems:0,items:[]}}if(this.stateConfig.productInfo){let{variantId:e=0,productHandle:i}=this.stateConfig.productInfo.params;t.productInfo={productId:0,variantId:e,productHandle:i,inWishlist:!1}}if(this.stateConfig.wishlistItem){let{wishlistId:e,wishlistItemId:i}=this.stateConfig.wishlistItem.params;if(!e)throw new Error("Wishlist id is required");if(!i)throw new Error("Wishlist item id is required");t.wishlistItem={id:i,product:{id:0,handle:"",variants:[]}}}return t}};var Ft=class extends ot{constructor(t){if(super(t),this.et=b,t.type!==qt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===b||t==null)return this.vt=void 0,this.et=t;if(t===P)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.vt;this.et=t;let e=[t];return e.raw=e,this.vt={_$litType$:this.constructor.resultType,strings:e,values:[]}}};Ft.directiveName="unsafeHTML",Ft.resultType=1;var Pi=Yt(Ft);var C=class extends W{constructor(){super(...arguments);this.lit=_t;this.unsafeHTML=Pi;this.repeat=Jt}};var re=class extends C{constructor(){super(...arguments);this.text="";this.hint="";this.selected=!1;this.disabled=!1;this.showIcon=!1;this.showText=!1;this.iconUnstyled=!1;this.fullWidth=!1;this.alignSelf="center";this.alignContent="center";this.floatingUi=new it(this);this.getCounterFloating=()=>{var i,n,r,o;if(!((i=this.counter)!=null&&i.floating))return;let e=((r=(n=this.counter)==null?void 0:n.floating)==null?void 0:r.reference)==="icon"?(o=this.iconElement)!=null?o:this:this;return{...this.counter.floating,reference:e}}}get iconElement(){return this.querySelector(".wk-icon")}render(){var r,o,a,l;let e=(r=this.alignSelf)!=null?r:"center",i=(o=this.alignContent)!=null?o:"center",n=["wk-button",`wk-align-${e}`,`wk-align-content-${i}`,this.selected&&"wk-selected",this.fullWidth&&"wk-full-width"].filter(c=>!!c).join(" ");return this.href?this.lit.html`
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ke=/'/g,qe=/"/g,Qe=/^(?:script|style|textarea|title)$/i,Ge=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),Ui=Ge(1),Vi=Ge(2),P=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),Ye=new WeakMap,X=J.createTreeWalker(J,129);function ti(s,t){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Be!==void 0?Be.createHTML(t):t}var ei=(s,t)=>{let e=s.length-1,i=[],n,r=t===2?"<svg>":"",o=$t;for(let a=0;a<e;a++){let l=s[a],c,d,h=-1,p=0;for(;p<l.length&&(o.lastIndex=p,d=o.exec(l),d!==null);)p=o.lastIndex,o===$t?d[1]==="!--"?o=ze:d[1]!==void 0?o=je:d[2]!==void 0?(Qe.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Y):d[3]!==void 0&&(o=Y):o===Y?d[0]===">"?(o=n!=null?n:$t,h=-1):d[1]===void 0?h=-2:(h=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?Y:d[3]==='"'?qe:Ke):o===qe||o===Ke?o=Y:o===ze||o===je?o=$t:(o=Y,n=void 0);let f=o===Y&&s[a+1].startsWith("/>")?" ":"";r+=o===$t?l+Ni:h>=0?(i.push(c),l.slice(0,h)+we+l.slice(h)+D+f):l+D+(h===-2?a:f)}return[ti(s,r+(s[e]||"<?>")+(t===2?"</svg>":"")),i]},Et=class s{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let r=0,o=0,a=t.length-1,l=this.parts,[c,d]=ei(t,e);if(this.el=s.createElement(c,i),X.currentNode=this.el.content,e===2){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(n=X.nextNode())!==null&&l.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let h of n.getAttributeNames())if(h.endsWith(we)){let p=d[o++],f=n.getAttribute(h).split(D),u=/([.?@])?(.*)/.exec(p);l.push({type:1,index:r,name:u[2],strings:f,ctor:u[1]==="."?Bt:u[1]==="?"?zt:u[1]==="@"?jt:Q}),n.removeAttribute(h)}else h.startsWith(D)&&(l.push({type:6,index:r}),n.removeAttribute(h));if(Qe.test(n.tagName)){let h=n.textContent.split(D),p=h.length-1;if(p>0){n.textContent=Ut?Ut.emptyScript:"";for(let f=0;f<p;f++)n.append(h[f],St()),X.nextNode(),l.push({type:2,index:++r});n.append(h[p],St())}}}else if(n.nodeType===8)if(n.data===ye)l.push({type:2,index:r});else{let h=-1;for(;(h=n.data.indexOf(D,h+1))!==-1;)l.push({type:7,index:r}),h+=D.length-1}r++}}static createElement(t,e){let i=J.createElement("template");return i.innerHTML=t,i}};function Z(s,t,e=s,i){var o,a,l;if(t===P)return t;let n=i!==void 0?(o=e._$Co)==null?void 0:o[i]:e._$Cl,r=Ct(t)?void 0:t._$litDirective$;return(n==null?void 0:n.constructor)!==r&&((a=n==null?void 0:n._$AO)==null||a.call(n,!1),r===void 0?n=void 0:(n=new r(s),n._$AT(s,e,i)),i!==void 0?((l=e._$Co)!=null?l:e._$Co=[])[i]=n:e._$Cl=n),n!==void 0&&(t=Z(s,n._$AS(s,t.values),n,i)),t}var Vt=class{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){var c;let{el:{content:e},parts:i}=this._$AD,n=((c=t==null?void 0:t.creationScope)!=null?c:J).importNode(e,!0);X.currentNode=n;let r=X.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let d;l.type===2?d=new nt(r,r.nextSibling,this,t):l.type===1?d=new l.ctor(r,l.name,l.strings,this,t):l.type===6&&(d=new Kt(r,this,t)),this._$AV.push(d),l=i[++a]}o!==(l==null?void 0:l.index)&&(r=X.nextNode(),o++)}return X.currentNode=J,n}p(t){let e=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},nt=class s{get _$AU(){var t,e;return(e=(t=this._$AM)==null?void 0:t._$AU)!=null?e:this._$Cv}constructor(t,e,i,n){var r;this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$Cv=(r=n==null?void 0:n.isConnected)!=null?r:!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Z(this,t,e),Ct(t)?t===b||t==null||t===""?(this._$AH!==b&&this._$AR(),this._$AH=b):t!==this._$AH&&t!==P&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):Ze(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==b&&Ct(this._$AH)?this._$AA.nextSibling.data=t:this.$(J.createTextNode(t)),this._$AH=t}g(t){var r;let{values:e,_$litType$:i}=t,n=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=Et.createElement(ti(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)==null?void 0:r._$AD)===n)this._$AH.p(e);else{let o=new Vt(n,this),a=o.u(this.options);o.p(e),this.$(a),this._$AH=o}}_$AC(t){let e=Ye.get(t.strings);return e===void 0&&Ye.set(t.strings,e=new Et(t)),e}T(t){Je(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,i,n=0;for(let r of t)n===e.length?e.push(i=new s(this.k(St()),this.k(St()),this,this.options)):i=e[n],i._$AI(r),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){let n=t.nextSibling;t.remove(),t=n}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},Q=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,n,r){this.type=1,this._$AH=b,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=b}_$AI(t,e=this,i,n){let r=this.strings,o=!1;if(r===void 0)t=Z(this,t,e,0),o=!Ct(t)||t!==this._$AH&&t!==P,o&&(this._$AH=t);else{let a=t,l,c;for(t=r[0],l=0;l<r.length-1;l++)c=Z(this,a[i+l],e,l),c===P&&(c=this._$AH[l]),o||(o=!Ct(c)||c!==this._$AH[l]),c===b?t=b:t!==b&&(t+=(c!=null?c:"")+r[l+1]),this._$AH[l]=c}o&&!n&&this.O(t)}O(t){t===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}},Bt=class extends Q{constructor(){super(...arguments),this.type=3}O(t){this.element[this.name]=t===b?void 0:t}},zt=class extends Q{constructor(){super(...arguments),this.type=4}O(t){this.element.toggleAttribute(this.name,!!t&&t!==b)}},jt=class extends Q{constructor(t,e,i,n,r){super(t,e,i,n,r),this.type=5}_$AI(t,e=this){var o;if((t=(o=Z(this,t,e,0))!=null?o:b)===P)return;let i=this._$AH,n=t===b&&i!==b||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==b&&(i===b||n);n&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;typeof this._$AH=="function"?this._$AH.call((i=(e=this.options)==null?void 0:e.host)!=null?i:this.element,t):this._$AH.handleEvent(t)}},Kt=class{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Z(this,t)}},be={j:we,P:D,A:ye,C:1,M:ei,L:Vt,R:Ze,V:Z,D:nt,I:Q,H:zt,N:jt,U:Bt,B:Kt},ge=At.litHtmlPolyfillSupport,Xe;ge==null||ge(Et,nt),((Xe=At.litHtmlVersions)!=null?Xe:At.litHtmlVersions=[]).push("3.1.0");var ve=(s,t,e)=>{var r,o;let i=(r=e==null?void 0:e.renderBefore)!=null?r:t,n=i._$litPart$;if(n===void 0){let a=(o=e==null?void 0:e.renderBefore)!=null?o:null;i._$litPart$=n=new nt(t.insertBefore(St(),a),a,void 0,e!=null?e:{})}return n._$AI(s),n};var W=class extends M{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,i;let t=super.createRenderRoot();return(i=(e=this.renderOptions).renderBefore)!=null||(e.renderBefore=t.firstChild),t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ve(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return P}},ii;W._$litElement$=!0,W.finalized=!0,(ii=globalThis.litElementHydrateSupport)==null||ii.call(globalThis,{LitElement:W});var xe=globalThis.litElementPolyfillSupport;xe==null||xe({LitElement:W});var Bi={_$AK:(s,t,e)=>{s._$AK(t,e)},_$AL:s=>s._$AL},si;((si=globalThis.litElementVersions)!=null?si:globalThis.litElementVersions=[]).push("4.0.2");var Cs=!1;var qt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Yt=s=>(...t)=>({_$litDirective$:s,values:t}),ot=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var{D:zi}=be;var ni=()=>document.createComment(""),rt=(s,t,e)=>{var r;let i=s._$AA.parentNode,n=t===void 0?s._$AB:t._$AA;if(e===void 0){let o=i.insertBefore(ni(),n),a=i.insertBefore(ni(),n);e=new zi(o,a,s,s.options)}else{let o=e._$AB.nextSibling,a=e._$AM,l=a!==s;if(l){let c;(r=e._$AQ)==null||r.call(e,s),e._$AM=s,e._$AP!==void 0&&(c=s._$AU)!==a._$AU&&e._$AP(c)}if(o!==n||l){let c=e._$AA;for(;c!==o;){let d=c.nextSibling;i.insertBefore(c,n),c=d}}}return e},z=(s,t,e=s)=>(s._$AI(t,e),s),ji={},oi=(s,t=ji)=>s._$AH=t,ri=s=>s._$AH,Xt=s=>{var i;(i=s._$AP)==null||i.call(s,!1,!0);let t=s._$AA,e=s._$AB.nextSibling;for(;t!==e;){let n=t.nextSibling;t.remove(),t=n}};var ai=(s,t,e)=>{let i=new Map;for(let n=t;n<=e;n++)i.set(s[n],n);return i},Jt=Yt(class extends ot{constructor(s){if(super(s),s.type!==qt.CHILD)throw Error("repeat() can only be used in text expressions")}ht(s,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);let n=[],r=[],o=0;for(let a of s)n[o]=i?i(a,o):o,r[o]=e(a,o),o++;return{values:r,keys:n}}render(s,t,e){return this.ht(s,t,e).values}update(s,[t,e,i]){var m;let n=ri(s),{values:r,keys:o}=this.ht(t,e,i);if(!Array.isArray(n))return this.dt=o,r;let a=(m=this.dt)!=null?m:this.dt=[],l=[],c,d,h=0,p=n.length-1,f=0,u=r.length-1;for(;h<=p&&f<=u;)if(n[h]===null)h++;else if(n[p]===null)p--;else if(a[h]===o[f])l[f]=z(n[h],r[f]),h++,f++;else if(a[p]===o[u])l[u]=z(n[p],r[u]),p--,u--;else if(a[h]===o[u])l[u]=z(n[h],r[u]),rt(s,l[u+1],n[h]),h++,u--;else if(a[p]===o[f])l[f]=z(n[p],r[f]),rt(s,n[h],n[p]),p--,f++;else if(c===void 0&&(c=ai(o,f,u),d=ai(a,h,p)),c.has(a[h]))if(c.has(a[p])){let g=d.get(o[f]),w=g!==void 0?n[g]:null;if(w===null){let y=rt(s,n[h]);z(y,r[f]),l[f]=y}else l[f]=z(w,r[f]),rt(s,n[h],w),n[g]=null;f++}else Xt(n[p]),p--;else Xt(n[h]),h++;for(;f<=u;){let g=rt(s,l[u+1]);z(g,r[f]),l[f++]=g}for(;h<=p;){let g=n[h++];g!==null&&Xt(g)}return this.dt=o,oi(s,l),P}});var j=Math.min,N=Math.max,Tt=Math.round,kt=Math.floor,U=s=>({x:s,y:s}),Ki={left:"right",right:"left",bottom:"top",top:"bottom"},qi={start:"end",end:"start"};function Qt(s,t,e){return N(s,j(t,e))}function at(s,t){return typeof s=="function"?s(t):s}function K(s){return s.split("-")[0]}function lt(s){return s.split("-")[1]}function $e(s){return s==="x"?"y":"x"}function Gt(s){return s==="y"?"height":"width"}function Rt(s){return["top","bottom"].includes(K(s))?"y":"x"}function te(s){return $e(Rt(s))}function li(s,t,e){e===void 0&&(e=!1);let i=lt(s),n=te(s),r=Gt(n),o=n==="x"?i===(e?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(o=Pt(o)),[o,Pt(o)]}function ci(s){let t=Pt(s);return[Zt(s),t,Zt(t)]}function Zt(s){return s.replace(/start|end/g,t=>qi[t])}function Yi(s,t,e){let i=["left","right"],n=["right","left"],r=["top","bottom"],o=["bottom","top"];switch(s){case"top":case"bottom":return e?t?n:i:t?i:n;case"left":case"right":return t?r:o;default:return[]}}function hi(s,t,e,i){let n=lt(s),r=Yi(K(s),e==="start",i);return n&&(r=r.map(o=>o+"-"+n),t&&(r=r.concat(r.map(Zt)))),r}function Pt(s){return s.replace(/left|right|bottom|top/g,t=>Ki[t])}function Xi(s){return{top:0,right:0,bottom:0,left:0,...s}}function Ae(s){return typeof s!="number"?Xi(s):{top:s,right:s,bottom:s,left:s}}function G(s){return{...s,top:s.y,left:s.x,right:s.x+s.width,bottom:s.y+s.height}}function fi(s,t,e){let{reference:i,floating:n}=s,r=Rt(t),o=te(t),a=Gt(o),l=K(t),c=r==="y",d=i.x+i.width/2-n.width/2,h=i.y+i.height/2-n.height/2,p=i[a]/2-n[a]/2,f;switch(l){case"top":f={x:d,y:i.y-n.height};break;case"bottom":f={x:d,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:h};break;case"left":f={x:i.x-n.width,y:h};break;default:f={x:i.x,y:i.y}}switch(lt(t)){case"start":f[o]-=p*(e&&c?-1:1);break;case"end":f[o]+=p*(e&&c?-1:1);break}return f}var di=async(s,t,e)=>{let{placement:i="bottom",strategy:n="absolute",middleware:r=[],platform:o}=e,a=r.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t)),c=await o.getElementRects({reference:s,floating:t,strategy:n}),{x:d,y:h}=fi(c,i,l),p=i,f={},u=0;for(let m=0;m<a.length;m++){let{name:g,fn:w}=a[m],{x:y,y:v,data:$,reset:x}=await w({x:d,y:h,initialPlacement:i,placement:p,strategy:n,middlewareData:f,rects:c,platform:o,elements:{reference:s,floating:t}});if(d=y!=null?y:d,h=v!=null?v:h,f={...f,[g]:{...f[g],...$}},x&&u<=50){u++,typeof x=="object"&&(x.placement&&(p=x.placement),x.rects&&(c=x.rects===!0?await o.getElementRects({reference:s,floating:t,strategy:n}):x.rects),{x:d,y:h}=fi(c,p,l)),m=-1;continue}}return{x:d,y:h,placement:p,strategy:n,middlewareData:f}};async function Se(s,t){var e;t===void 0&&(t={});let{x:i,y:n,platform:r,rects:o,elements:a,strategy:l}=s,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:p=!1,padding:f=0}=at(t,s),u=Ae(f),g=a[p?h==="floating"?"reference":"floating":h],w=G(await r.getClippingRect({element:(e=await(r.isElement==null?void 0:r.isElement(g)))==null||e?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),y=h==="floating"?{...o.floating,x:i,y:n}:o.reference,v=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),$=await(r.isElement==null?void 0:r.isElement(v))?await(r.getScale==null?void 0:r.getScale(v))||{x:1,y:1}:{x:1,y:1},x=G(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({rect:y,offsetParent:v,strategy:l}):y);return{top:(w.top-x.top+u.top)/$.y,bottom:(x.bottom-w.bottom+u.bottom)/$.y,left:(w.left-x.left+u.left)/$.x,right:(x.right-w.right+u.right)/$.x}}var Ce=s=>({name:"arrow",options:s,async fn(t){let{x:e,y:i,placement:n,rects:r,platform:o,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=at(s,t)||{};if(c==null)return{};let h=Ae(d),p={x:e,y:i},f=te(n),u=Gt(f),m=await o.getDimensions(c),g=f==="y",w=g?"top":"left",y=g?"bottom":"right",v=g?"clientHeight":"clientWidth",$=r.reference[u]+r.reference[f]-p[f]-r.floating[u],x=p[f]-r.reference[f],T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c)),R=T?T[v]:0;(!R||!await(o.isElement==null?void 0:o.isElement(T)))&&(R=a.floating[v]||r.floating[u]);let q=$/2-x/2,dt=R/2-m[u]/2-1,ut=j(h[w],dt),pt=j(h[y],dt),_=ut,mt=R-m[u]-pt,C=R/2-m[u]/2+q,O=Qt(_,C,mt),I=!l.arrow&&lt(n)!=null&&C!=O&&r.reference[u]/2-(C<_?ut:pt)-m[u]/2<0,F=I?C<_?C-_:C-mt:0;return{[f]:p[f]+F,data:{[f]:O,centerOffset:C-O-F,...I&&{alignmentOffset:F}},reset:I}}});var Ee=function(s){return s===void 0&&(s={}),{name:"flip",options:s,async fn(t){var e,i;let{placement:n,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:u="none",flipAlignment:m=!0,...g}=at(s,t);if((e=r.arrow)!=null&&e.alignmentOffset)return{};let w=K(n),y=K(a)===a,v=await(l.isRTL==null?void 0:l.isRTL(c.floating)),$=p||(y||!m?[Pt(a)]:ci(a));!p&&u!=="none"&&$.push(...hi(a,m,u,v));let x=[a,...$],T=await Se(t,g),R=[],q=((i=r.flip)==null?void 0:i.overflows)||[];if(d&&R.push(T[w]),h){let _=li(n,o,v);R.push(T[_[0]],T[_[1]])}if(q=[...q,{placement:n,overflows:R}],!R.every(_=>_<=0)){var dt,ut;let _=(((dt=r.flip)==null?void 0:dt.index)||0)+1,mt=x[_];if(mt)return{data:{index:_,overflows:q},reset:{placement:mt}};let C=(ut=q.filter(O=>O.overflows[0]<=0).sort((O,I)=>O.overflows[1]-I.overflows[1])[0])==null?void 0:ut.placement;if(!C)switch(f){case"bestFit":{var pt;let O=(pt=q.map(I=>[I.placement,I.overflows.filter(F=>F>0).reduce((F,ki)=>F+ki,0)]).sort((I,F)=>I[1]-F[1])[0])==null?void 0:pt[0];O&&(C=O);break}case"initialPlacement":C=a;break}if(n!==C)return{reset:{placement:C}}}return{}}}};async function Ji(s,t){let{placement:e,platform:i,elements:n}=s,r=await(i.isRTL==null?void 0:i.isRTL(n.floating)),o=K(e),a=lt(e),l=Rt(e)==="y",c=["left","top"].includes(o)?-1:1,d=r&&l?-1:1,h=at(t,s),{mainAxis:p,crossAxis:f,alignmentAxis:u}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...h};return a&&typeof u=="number"&&(f=a==="end"?u*-1:u),l?{x:f*d,y:p*c}:{x:p*c,y:f*d}}var ee=function(s){return s===void 0&&(s=0),{name:"offset",options:s,async fn(t){var e,i;let{x:n,y:r,placement:o,middlewareData:a}=t,l=await Ji(t,s);return o===((e=a.offset)==null?void 0:e.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:n+l.x,y:r+l.y,data:{...l,placement:o}}}}},_e=function(s){return s===void 0&&(s={}),{name:"shift",options:s,async fn(t){let{x:e,y:i,placement:n}=t,{mainAxis:r=!0,crossAxis:o=!1,limiter:a={fn:g=>{let{x:w,y}=g;return{x:w,y}}},...l}=at(s,t),c={x:e,y:i},d=await Se(t,l),h=Rt(K(n)),p=$e(h),f=c[p],u=c[h];if(r){let g=p==="y"?"top":"left",w=p==="y"?"bottom":"right",y=f+d[g],v=f-d[w];f=Qt(y,f,v)}if(o){let g=h==="y"?"top":"left",w=h==="y"?"bottom":"right",y=u+d[g],v=u-d[w];u=Qt(y,u,v)}let m=a.fn({...t,[p]:f,[h]:u});return{...m,data:{x:m.x-e,y:m.y-i}}}}};function V(s){return pi(s)?(s.nodeName||"").toLowerCase():"#document"}function A(s){var t;return(s==null||(t=s.ownerDocument)==null?void 0:t.defaultView)||window}function L(s){var t;return(t=(pi(s)?s.ownerDocument:s.document)||window.document)==null?void 0:t.documentElement}function pi(s){return s instanceof Node||s instanceof A(s).Node}function H(s){return s instanceof Element||s instanceof A(s).Element}function k(s){return s instanceof HTMLElement||s instanceof A(s).HTMLElement}function ui(s){return typeof ShadowRoot=="undefined"?!1:s instanceof ShadowRoot||s instanceof A(s).ShadowRoot}function ht(s){let{overflow:t,overflowX:e,overflowY:i,display:n}=E(s);return/auto|scroll|overlay|hidden|clip/.test(t+i+e)&&!["inline","contents"].includes(n)}function mi(s){return["table","td","th"].includes(V(s))}function ie(s){let t=se(),e=E(s);return e.transform!=="none"||e.perspective!=="none"||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(e.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(e.contain||"").includes(i))}function gi(s){let t=tt(s);for(;k(t)&&!Ot(t);){if(ie(t))return t;t=tt(t)}return null}function se(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ot(s){return["html","body","#document"].includes(V(s))}function E(s){return A(s).getComputedStyle(s)}function It(s){return H(s)?{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}:{scrollLeft:s.pageXOffset,scrollTop:s.pageYOffset}}function tt(s){if(V(s)==="html")return s;let t=s.assignedSlot||s.parentNode||ui(s)&&s.host||L(s);return ui(t)?t.host:t}function wi(s){let t=tt(s);return Ot(t)?s.ownerDocument?s.ownerDocument.body:s.body:k(t)&&ht(t)?t:wi(t)}function ct(s,t,e){var i;t===void 0&&(t=[]),e===void 0&&(e=!0);let n=wi(s),r=n===((i=s.ownerDocument)==null?void 0:i.body),o=A(n);return r?t.concat(o,o.visualViewport||[],ht(n)?n:[],o.frameElement&&e?ct(o.frameElement):[]):t.concat(n,ct(n,[],e))}function vi(s){let t=E(s),e=parseFloat(t.width)||0,i=parseFloat(t.height)||0,n=k(s),r=n?s.offsetWidth:e,o=n?s.offsetHeight:i,a=Tt(e)!==r||Tt(i)!==o;return a&&(e=r,i=o),{width:e,height:i,$:a}}function Pe(s){return H(s)?s:s.contextElement}function ft(s){let t=Pe(s);if(!k(t))return U(1);let e=t.getBoundingClientRect(),{width:i,height:n,$:r}=vi(t),o=(r?Tt(e.width):e.width)/i,a=(r?Tt(e.height):e.height)/n;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var Zi=U(0);function xi(s){let t=A(s);return!se()||!t.visualViewport?Zi:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Qi(s,t,e){return t===void 0&&(t=!1),!e||t&&e!==A(s)?!1:t}function et(s,t,e,i){t===void 0&&(t=!1),e===void 0&&(e=!1);let n=s.getBoundingClientRect(),r=Pe(s),o=U(1);t&&(i?H(i)&&(o=ft(i)):o=ft(s));let a=Qi(r,e,i)?xi(r):U(0),l=(n.left+a.x)/o.x,c=(n.top+a.y)/o.y,d=n.width/o.x,h=n.height/o.y;if(r){let p=A(r),f=i&&H(i)?A(i):i,u=p.frameElement;for(;u&&i&&f!==p;){let m=ft(u),g=u.getBoundingClientRect(),w=E(u),y=g.left+(u.clientLeft+parseFloat(w.paddingLeft))*m.x,v=g.top+(u.clientTop+parseFloat(w.paddingTop))*m.y;l*=m.x,c*=m.y,d*=m.x,h*=m.y,l+=y,c+=v,u=A(u).frameElement}}return G({width:d,height:h,x:l,y:c})}function Gi(s){let{rect:t,offsetParent:e,strategy:i}=s,n=k(e),r=L(e);if(e===r)return t;let o={scrollLeft:0,scrollTop:0},a=U(1),l=U(0);if((n||!n&&i!=="fixed")&&((V(e)!=="body"||ht(r))&&(o=It(e)),k(e))){let c=et(e);a=ft(e),l.x=c.x+e.clientLeft,l.y=c.y+e.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-o.scrollLeft*a.x+l.x,y:t.y*a.y-o.scrollTop*a.y+l.y}}function ts(s){return Array.from(s.getClientRects())}function $i(s){return et(L(s)).left+It(s).scrollLeft}function es(s){let t=L(s),e=It(s),i=s.ownerDocument.body,n=N(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=N(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight),o=-e.scrollLeft+$i(s),a=-e.scrollTop;return E(i).direction==="rtl"&&(o+=N(t.clientWidth,i.clientWidth)-n),{width:n,height:r,x:o,y:a}}function is(s,t){let e=A(s),i=L(s),n=e.visualViewport,r=i.clientWidth,o=i.clientHeight,a=0,l=0;if(n){r=n.width,o=n.height;let c=se();(!c||c&&t==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:r,height:o,x:a,y:l}}function ss(s,t){let e=et(s,!0,t==="fixed"),i=e.top+s.clientTop,n=e.left+s.clientLeft,r=k(s)?ft(s):U(1),o=s.clientWidth*r.x,a=s.clientHeight*r.y,l=n*r.x,c=i*r.y;return{width:o,height:a,x:l,y:c}}function yi(s,t,e){let i;if(t==="viewport")i=is(s,e);else if(t==="document")i=es(L(s));else if(H(t))i=ss(t,e);else{let n=xi(s);i={...t,x:t.x-n.x,y:t.y-n.y}}return G(i)}function Ai(s,t){let e=tt(s);return e===t||!H(e)||Ot(e)?!1:E(e).position==="fixed"||Ai(e,t)}function ns(s,t){let e=t.get(s);if(e)return e;let i=ct(s,[],!1).filter(a=>H(a)&&V(a)!=="body"),n=null,r=E(s).position==="fixed",o=r?tt(s):s;for(;H(o)&&!Ot(o);){let a=E(o),l=ie(o);!l&&a.position==="fixed"&&(n=null),(r?!l&&!n:!l&&a.position==="static"&&!!n&&["absolute","fixed"].includes(n.position)||ht(o)&&!l&&Ai(s,o))?i=i.filter(d=>d!==o):n=a,o=tt(o)}return t.set(s,i),i}function os(s){let{element:t,boundary:e,rootBoundary:i,strategy:n}=s,o=[...e==="clippingAncestors"?ns(t,this._c):[].concat(e),i],a=o[0],l=o.reduce((c,d)=>{let h=yi(t,d,n);return c.top=N(h.top,c.top),c.right=j(h.right,c.right),c.bottom=j(h.bottom,c.bottom),c.left=N(h.left,c.left),c},yi(t,a,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function rs(s){return vi(s)}function as(s,t,e){let i=k(t),n=L(t),r=e==="fixed",o=et(s,!0,r,t),a={scrollLeft:0,scrollTop:0},l=U(0);if(i||!i&&!r)if((V(t)!=="body"||ht(n))&&(a=It(t)),i){let c=et(t,!0,r,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else n&&(l.x=$i(n));return{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function bi(s,t){return!k(s)||E(s).position==="fixed"?null:t?t(s):s.offsetParent}function Si(s,t){let e=A(s);if(!k(s))return e;let i=bi(s,t);for(;i&&mi(i)&&E(i).position==="static";)i=bi(i,t);return i&&(V(i)==="html"||V(i)==="body"&&E(i).position==="static"&&!ie(i))?e:i||gi(s)||e}var ls=async function(s){let{reference:t,floating:e,strategy:i}=s,n=this.getOffsetParent||Si,r=this.getDimensions;return{reference:as(t,await n(e),i),floating:{x:0,y:0,...await r(e)}}};function cs(s){return E(s).direction==="rtl"}var hs={convertOffsetParentRelativeRectToViewportRelativeRect:Gi,getDocumentElement:L,getClippingRect:os,getOffsetParent:Si,getElementRects:ls,getClientRects:ts,getDimensions:rs,getScale:ft,isElement:H,isRTL:cs};function fs(s,t){let e=null,i,n=L(s);function r(){clearTimeout(i),e&&e.disconnect(),e=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),r();let{left:c,top:d,width:h,height:p}=s.getBoundingClientRect();if(a||t(),!h||!p)return;let f=kt(d),u=kt(n.clientWidth-(c+h)),m=kt(n.clientHeight-(d+p)),g=kt(c),y={rootMargin:-f+"px "+-u+"px "+-m+"px "+-g+"px",threshold:N(0,j(1,l))||1},v=!0;function $(x){let T=x[0].intersectionRatio;if(T!==l){if(!v)return o();T?o(!1,T):i=setTimeout(()=>{o(!1,1e-7)},100)}v=!1}try{e=new IntersectionObserver($,{...y,root:n.ownerDocument})}catch(x){e=new IntersectionObserver($,y)}e.observe(s)}return o(!0),r}function Ci(s,t,e,i){i===void 0&&(i={});let{ancestorScroll:n=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=Pe(s),d=n||r?[...c?ct(c):[],...ct(t)]:[];d.forEach(w=>{n&&w.addEventListener("scroll",e,{passive:!0}),r&&w.addEventListener("resize",e)});let h=c&&a?fs(c,e):null,p=-1,f=null;o&&(f=new ResizeObserver(w=>{let[y]=w;y&&y.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{f&&f.observe(t)})),e()}),c&&!l&&f.observe(c),f.observe(t));let u,m=l?et(s):null;l&&g();function g(){let w=et(s);m&&(w.x!==m.x||w.y!==m.y||w.width!==m.width||w.height!==m.height)&&e(),m=w,u=requestAnimationFrame(g)}return e(),()=>{d.forEach(w=>{n&&w.removeEventListener("scroll",e),r&&w.removeEventListener("resize",e)}),h&&h(),f&&f.disconnect(),f=null,l&&cancelAnimationFrame(u)}}var Ei=(s,t,e)=>{let i=new Map,n={platform:hs,...e},r={...n.platform,_c:i};return di(s,t,{...n,platform:r})};var it=class{constructor(t){this._middleware=[];this._floating=!1;(this.host=t).addController(this)}hostConnected(){this.host.floating&&this.float(this.host.floating)}hostDisconnected(){this.destroy()}hostUpdated(){this.host.floating&&!this._floating&&this.float(this.host.floating),this._floating&&this.updatePosition()}hostResized(){this._floating&&this.updatePosition()}float(t){var l;if(this._floating)return;if(this._floating=!0,this._settings=t,this._reference=this.getReference(),this._resizeObserver=new ResizeObserver(()=>this.hostResized()),!this._settings)throw new Error("Floating settings are required");if(!this._reference)throw new Error("Floating reference is required");this.host.classList.add("wk-floating");let{position:e,arrow:i=!1,flip:n=!1,shift:r=!1,animationFrame:o=!1}=this._settings,a=this.getOffsetSetting();Object.assign(this.host.style,{position:(l=e.strategy)!=null?l:"absolute",top:"0",left:"0",transition:"none",transform:"translate3d(0,0,0)"}),e.inset&&!i?this._middleware.push(ee(({rects:c,placement:d})=>{var h,p,f,u,m,g;return d.includes("top")||d.includes("bottom")?{mainAxis:-c.floating.height-((h=a==null?void 0:a.mainAxis)!=null?h:0),crossAxis:(p=a==null?void 0:a.crossAxis)!=null?p:0,alignmentAxis:(f=a==null?void 0:a.alignmentAxis)!=null?f:0}:{mainAxis:-c.floating.width-((u=a==null?void 0:a.mainAxis)!=null?u:0),crossAxis:(m=a==null?void 0:a.crossAxis)!=null?m:0,alignmentAxis:(g=a==null?void 0:a.alignmentAxis)!=null?g:0}})):a&&this._middleware.push(ee(a)),n&&this._middleware.push(Ee()),r&&this._middleware.push(_e()),i&&(this.arrowEl=document.createElement("div"),this.arrowEl.classList.add("wk-arrow"),this._middleware.push(Ce({element:this.arrowEl}))),this.cleanupAutoUpdate=Ci(this._reference,this.host,()=>{this.updatePosition()},{animationFrame:o}),this._resizeObserver.observe(this.host)}getOffsetSetting(){var e,i;let t=(e=this._settings)==null?void 0:e.offset;if(!(!t||typeof t=="boolean"))return typeof t=="number"?{mainAxis:t,alignmentAxis:(i=this._settings)!=null&&i.position.inset?t:null}:t}destroy(){var t,e,i,n;this._floating&&(Object.assign(this.host.style,{position:"",top:"",left:"",transition:"",transform:""}),(e=(t=this.arrowEl)==null?void 0:t.parentElement)==null||e.removeChild(this.arrowEl),this.arrowEl=void 0,this._middleware=[],this.host.classList.remove("wk-floating"),(i=this.cleanupAutoUpdate)==null||i.call(this),(n=this._resizeObserver)==null||n.disconnect(),this._floating=!1)}updatePosition(){var i;if(!this._reference||!this._settings)return;let{strategy:t="absolute",placement:e="top"}=(i=this._settings.position)!=null?i:{};Ei(this._reference,this.host,{middleware:this._middleware,strategy:t,placement:e}).then(({x:n,y:r,placement:o,middlewareData:a})=>{if(a.arrow&&this.arrowEl){let{x:l,y:c}=a.arrow,d={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]],h={bottom:"0deg",left:"90deg",top:"180deg",right:"270deg"}[o.split("-")[0]];Object.assign(this.arrowEl.style,{left:l!=null?`${l}px`:"",top:c!=null?`${c}px`:"",right:"",bottom:"",[d]:"-5px",transform:`rotate(${h})`})}Object.assign(this.host.style,{transform:`translate3d(${Math.round(n)}px,${Math.round(r)}px,0)`})})}getReference(){if(!this._settings)return;let t=this._settings.reference;if(typeof t=="string"){if(t==="viewport")return this.createViewportReference();let e=document.querySelector(t);if(!e)throw new Error(`Floating reference element (${t}) not found`);return e}return t.hasOwnProperty("element")?t.element:t}createViewportReference(){return{getBoundingClientRect(){var t,e,i,n;return{x:0,y:0,top:0,left:0,bottom:0,right:0,width:(e=(t=window.visualViewport)==null?void 0:t.width)!=null?e:0,height:(n=(i=window.visualViewport)==null?void 0:i.height)!=null?n:0}}}}};var Te=class{constructor(t){this.product=null;this.selectedVariant=null;this.selectedOptions={};this.hasSelection=!1;this.optionsWithValues=[];this.hasOnlyDefaultVariant=!1;(this.host=t).addController(this)}set submitting(t){var e;(e=this.host.querySelector("form"))==null||e.classList.toggle("wk-submitting",t)}get submitting(){var t,e;return(e=(t=this.host.querySelector("form"))==null?void 0:t.classList.contains("wk-submitting"))!=null?e:!1}setProduct({product:t,selectedVariantId:e,autoSelect:i=!1}){t!=null&&t.variants.length&&(this.product=t,this.initFormState({selectedVariantId:e,autoSelect:i}))}initFormState({selectedVariantId:t,autoSelect:e}){if(!this.product)throw new Error("Product not set");let i=this.initializedVariantId!==t?this.product.variants.find(r=>r.id===t):this.selectedVariant;this.initializedVariantId=t;let n=this.host.app.utils.product.getVariantOptions({variant:i});this.updateFormState({options:n,autoSelect:e})}updateFormState({options:t,change:e,autoSelect:i=!1}){if(!this.product)throw new Error("Product not set");let{hasSelection:n,optionsWithValues:r,selectedOptions:o,selectedVariant:a,hasOnlyDefaultVariant:l}=this.host.app.utils.product.getFormState({product:this.product,options:t,change:e,autoSelect:i});this.hasSelection=n,this.optionsWithValues=r,this.selectedOptions=o,this.selectedVariant=a,this.hasOnlyDefaultVariant=l,this.host.requestUpdate()}changeOption({input:t,autoSelect:e=!1}){if(!this.product)throw new Error("Product not set");let i=this.getInputOption(t);if(!i)throw new Error("Cannot parse options from input");this.updateFormState({options:this.selectedOptions,change:i,autoSelect:e})}addToCart({wishlistId:t,wishlistItemId:e,quantity:i,sectionsToRender:n,sectionsUrl:r="/"}){if(!this.selectedVariant)throw new Error("No variant selected");let o=this.host.querySelector("form");if(!o)throw new Error("Form not found");return this.submitting=!0,this.host.app.addToCart({wishlistId:t,wishlistItemId:e,variantId:this.selectedVariant.id,quantity:i!=null?i:this.host.app.utils.product.getFormQuantity({form:o}),properties:this.host.app.utils.product.getFormProperties({form:o}),sectionsToRender:n,sectionsUrl:r}).finally(()=>{this.submitting=!1})}getInputOption(t){if(!this.product)throw new Error("Product not set");return this.host.app.utils.product.getInputOption({input:t,product:this.product})}hostConnected(){}hostDisconnected(){}hostUpdate(){}hostUpdated(){}};var ke,_i=s=>(!!localStorage.getItem("debug")&&(ke=import("https://cdn.jsdelivr.net/npm/debug@4.3.4/+esm")),(e,...i)=>{ke&&ke.then(({default:n})=>{n(s)(e,...i)})});var Re=1,ds={shopify:`wk-shopify-v${Re}`,storefront:`wk-storefront-v${Re}`,wishlist:`wk-wishlist-v${Re}`};var us=()=>{let s=_i("wk:cache"),t=Object.values(ds);caches.keys().then(e=>Promise.all(e.map(i=>{if(!t.includes(i))return s("Delete old cache",{cacheName:i}),caches.delete(i)})))};us();var Mt,ne=class{constructor(t){wt(this,Mt,void 0);yt(this,Mt,t)}subscribe(t){let e=gt(this,Mt).call(this,new Oe(t));return new Ie(()=>{e==null||e()})}};Mt=new WeakMap;var Lt,Oe=class{constructor(t){wt(this,Lt,void 0);yt(this,Lt,t)}next(t){gt(this,Lt).call(this,t)}};Lt=new WeakMap;var Ht,Ie=class{constructor(t){wt(this,Ht,void 0);yt(this,Ht,t)}unsubscribe(){var t;(t=gt(this,Ht))==null||t.call(this)}};Ht=new WeakMap;var oe=class{constructor(t){this.stateConfig={loading:"eager"};this.state={};(this.host=t).addController(this)}get app(){if(!window.WishlistKing)throw new Error("Wishlist King SDK not initialized");return window.WishlistKing}get hostDataset(){return this.host.dataset?this.host.dataset:this.host.host?this.host.host.dataset:{}}hostConnected(){}hostDisconnected(){}parseStateConfig(t){var e;return{loading:(e=t.loading)!=null?e:"eager",wishlist:this.parseWishlistStateConfig(t),wishlistItem:this.parseWishlistItemStateConfig(t),productInfo:this.parseProductInfoStateConfig(t),cart:t.cart}}parseWishlistStateConfig({wishlist:t}){var i;let e=(i=this.hostDataset.wishlistId)!=null?i:"mine";if(t)return{params:{wishlistId:e}}}parseWishlistItemStateConfig({wishlistItem:t}){let{wishlistId:e="mine",wishlistItemId:i}=this.hostDataset;if(!(!t||!i))return{params:{wishlistId:e,wishlistItemId:i}}}parseProductInfoStateConfig({productInfo:t}){if(!t)return;let{wishlistId:e="mine",productHandle:i="",productId:n,variantId:r}=this.hostDataset;return{params:{wishlistId:e,productHandle:i,variantId:r?parseInt(r):void 0}}}observe(){return this.stateConfig=this.parseStateConfig(this.host.getStateConfig()),new ne(t=>{let e=i=>{this.state={...this.state,...i},t.next(this.state)};if(this.stateConfig.wishlist){let{wishlistId:i="mine"}=this.stateConfig.wishlist.params;this.app.state.observeWishlist({wishlistId:i}).subscribe(n=>e({wishlist:n}))}if(this.stateConfig.productInfo){let{productHandle:i,variantId:n}=this.stateConfig.productInfo.params;if(!i)throw new Error("Product handle is required");this.app.state.observeProductInfo({productHandle:i,variantId:n}).subscribe(r=>e({productInfo:r}))}if(this.stateConfig.wishlistItem){let{wishlistId:i,wishlistItemId:n}=this.stateConfig.wishlistItem.params;if(!i)throw new Error("Wishlist id is required");if(!n)throw new Error("Wishlist item id is required");this.app.state.observeWishlist({wishlistId:i}).subscribe(r=>e({wishlistItem:r.items.find(o=>o.id===n)}))}this.stateConfig.cart&&this.app.state.observeShopifyCart({cacheStrategy:"public, max-age=1, stale-while-revalidate=10"}).subscribe(i=>e({cart:i}))})}getFallback(){this.stateConfig=this.parseStateConfig(this.host.getStateConfig());let t={};if(this.stateConfig.wishlist){let{wishlistId:e="mine"}=this.stateConfig.wishlist.params;t.wishlist={id:e,isMine:e==="mine",numItems:0,items:[]}}if(this.stateConfig.productInfo){let{variantId:e=0,productHandle:i}=this.stateConfig.productInfo.params;t.productInfo={productId:0,variantId:e,productHandle:i,inWishlist:!1}}if(this.stateConfig.wishlistItem){let{wishlistId:e,wishlistItemId:i}=this.stateConfig.wishlistItem.params;if(!e)throw new Error("Wishlist id is required");if(!i)throw new Error("Wishlist item id is required");t.wishlistItem={id:i,product:{id:0,handle:"",variants:[]}}}return t}};var Ft=class extends ot{constructor(t){if(super(t),this.et=b,t.type!==qt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===b||t==null)return this.vt=void 0,this.et=t;if(t===P)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.vt;this.et=t;let e=[t];return e.raw=e,this.vt={_$litType$:this.constructor.resultType,strings:e,values:[]}}};Ft.directiveName="unsafeHTML",Ft.resultType=1;var Pi=Yt(Ft);var S=class extends W{constructor(){super(...arguments);this.lit=_t;this.unsafeHTML=Pi;this.repeat=Jt}};var re=class extends S{constructor(){super(...arguments);this.text="";this.hint="";this.selected=!1;this.disabled=!1;this.showIcon=!1;this.showText=!1;this.iconUnstyled=!1;this.fullWidth=!1;this.alignSelf="center";this.alignContent="center";this.floatingUi=new it(this);this.getCounterFloating=()=>{var i,n,r,o;if(!((i=this.counter)!=null&&i.floating))return;let e=((r=(n=this.counter)==null?void 0:n.floating)==null?void 0:r.reference)==="icon"?(o=this.iconElement)!=null?o:this:this;return{...this.counter.floating,reference:e}}}get iconElement(){return this.querySelector(".wk-icon")}render(){var r,o,a,l;let e=(r=this.alignSelf)!=null?r:"center",i=(o=this.alignContent)!=null?o:"center",n=["wk-button",`wk-align-${e}`,`wk-align-content-${i}`,this.selected&&"wk-selected",this.fullWidth&&"wk-full-width"].filter(c=>!!c).join(" ");return this.href?this.lit.html`
<a

@@ -34,3 +34,3 @@ href=${this.href}

></wk-counter>
`}firstUpdated(e){super.firstUpdated(e),this.counterFloating=this.getCounterFloating()}createRenderRoot(){return this}};re.properties={href:{type:String},text:{type:String},hint:{type:String},selected:{type:Boolean},disabled:{type:Boolean},showIcon:{type:Boolean,attribute:"show-icon"},showText:{type:Boolean,attribute:"show-text"},icon:{type:String},iconUnstyled:{type:Boolean,attribute:"icon-unstyled"},fullWidth:{type:Boolean,attribute:"full-width"},alignSelf:{type:String,attribute:"align-self"},alignContent:{type:String,attribute:"align-content"},floating:{type:Object},counter:{type:Object},counterFloating:{state:!0}};customElements.get("wk-button")||customElements.define("wk-button",re);var ae=class extends C{constructor(){super(...arguments);this.value=0;this.showNumber=!1;this.showBrackets=!1;this.floatingUi=new it(this)}render(){let e=this.showNumber?this.value:"",i=["wk-counter",this.showBrackets&&"wk-brackets",this.floating&&"wk-bubble",this.floating&&!this.showNumber&&"wk-dot"].filter(n=>!!n).join(" ");return this.lit.html`<span class=${i}>${e}</span>`}createRenderRoot(){return this}};ae.properties={value:{type:Number},floating:{type:Object},showNumber:{type:Boolean,attribute:"show-number"},showBrackets:{type:Boolean,attribute:"show-brackets"}};customElements.get("wk-counter")||customElements.define("wk-counter",ae);var Ti="wk-icon-update",le=class extends C{constructor(){super();this.icon="";this.unstyled=!1;this.classList.add("wk-icon"),this.handleIconUpdate=this.handleIconUpdate.bind(this)}get icons(){var e,i;return(i=(e=window.WishlistKing)==null?void 0:e.settings.icons)!=null?i:{}}connectedCallback(){super.connectedCallback(),document.addEventListener(Ti,this.handleIconUpdate)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(Ti,this.handleIconUpdate)}handleIconUpdate(){this.scheduleUpdate()}render(){if(!this.icon)return"";let e=this.icons[this.icon];return e?this.unsafeHTML(e):(console.warn(`Icon "${this.icon}" not found`,{icons:this.icons}),"")}updated(e){super.updated(e),e.has("unstyled")&&this.classList.toggle("wk-nostyle",this.unstyled)}createRenderRoot(){return this}};le.properties={icon:{type:String},unstyled:{type:Boolean}};customElements.get("wk-icon")||customElements.define("wk-icon",le);var ce=class extends C{constructor(){super(...arguments);this.icon="caret"}get app(){if(!window.WishlistKing)throw new Error("Wishlist King SDK not initialized");return window.WishlistKing}render(){if(!this.option)return;let e=this.option,i=`options[${this.option.name}]`,n=`${this.app.utils.url.handlelize(this.id)}-select`;return this.lit.html`
`}firstUpdated(e){super.firstUpdated(e),this.counterFloating=this.getCounterFloating()}createRenderRoot(){return this}};re.properties={href:{type:String},text:{type:String},hint:{type:String},selected:{type:Boolean},disabled:{type:Boolean},showIcon:{type:Boolean,attribute:"show-icon"},showText:{type:Boolean,attribute:"show-text"},icon:{type:String},iconUnstyled:{type:Boolean,attribute:"icon-unstyled"},fullWidth:{type:Boolean,attribute:"full-width"},alignSelf:{type:String,attribute:"align-self"},alignContent:{type:String,attribute:"align-content"},floating:{type:Object},counter:{type:Object},counterFloating:{state:!0}};customElements.get("wk-button")||customElements.define("wk-button",re);var ae=class extends S{constructor(){super(...arguments);this.value=0;this.showNumber=!1;this.showBrackets=!1;this.floatingUi=new it(this)}render(){let e=this.showNumber?this.value:"",i=["wk-counter",this.showBrackets&&"wk-brackets",this.floating&&"wk-bubble",this.floating&&!this.showNumber&&"wk-dot"].filter(n=>!!n).join(" ");return this.lit.html`<span class=${i}>${e}</span>`}createRenderRoot(){return this}};ae.properties={value:{type:Number},floating:{type:Object},showNumber:{type:Boolean,attribute:"show-number"},showBrackets:{type:Boolean,attribute:"show-brackets"}};customElements.get("wk-counter")||customElements.define("wk-counter",ae);var Ti="wk-icon-update",le=class extends S{constructor(){super();this.icon="";this.unstyled=!1;this.classList.add("wk-icon"),this.handleIconUpdate=this.handleIconUpdate.bind(this)}get icons(){var e,i;return(i=(e=window.WishlistKing)==null?void 0:e.settings.icons)!=null?i:{}}connectedCallback(){super.connectedCallback(),document.addEventListener(Ti,this.handleIconUpdate)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(Ti,this.handleIconUpdate)}handleIconUpdate(){this.scheduleUpdate()}render(){if(!this.icon)return"";let e=this.icons[this.icon];return e?this.unsafeHTML(e):(console.warn(`Icon "${this.icon}" not found`,{icons:this.icons}),"")}updated(e){super.updated(e),e.has("unstyled")&&this.classList.toggle("wk-nostyle",this.unstyled)}createRenderRoot(){return this}};le.properties={icon:{type:String},unstyled:{type:Boolean}};customElements.get("wk-icon")||customElements.define("wk-icon",le);var ce=class extends S{constructor(){super(...arguments);this.icon="caret"}get app(){if(!window.WishlistKing)throw new Error("Wishlist King SDK not initialized");return window.WishlistKing}render(){if(!this.option)return;let e=this.option,i=`options[${this.option.name}]`,n=`${this.app.utils.url.handlelize(this.id)}-select`;return this.lit.html`
<div class="wk-option-select">

@@ -58,3 +58,3 @@ <label class="wk-label" for=${n}>${e.name}</label>

</div>
`}updated(e){var i;super.updated(e),e.has("option")&&this.classList.toggle("wk-single-option",((i=this.option)==null?void 0:i.values.length)===1)}createRenderRoot(){return this}};ce.properties={icon:{type:String},option:{type:Object},defaultText:{type:String}};customElements.get("wk-option-select")||customElements.define("wk-option-select",ce);var he=class extends C{get app(){if(!window.WishlistKing)throw new Error("Wishlist King SDK not initialized");return window.WishlistKing}render(){if(!this.option)return;let t=`options[${this.option.name}]`,e=`${this.id}-fieldset`;return this.lit.html`
`}updated(e){var i;super.updated(e),e.has("option")&&this.classList.toggle("wk-single-option",((i=this.option)==null?void 0:i.values.length)===1)}createRenderRoot(){return this}};ce.properties={icon:{type:String},option:{type:Object},defaultText:{type:String}};customElements.get("wk-option-select")||customElements.define("wk-option-select",ce);var he=class extends S{get app(){if(!window.WishlistKing)throw new Error("Wishlist King SDK not initialized");return window.WishlistKing}render(){if(!this.option)return;let t=`options[${this.option.name}]`,e=`${this.id}-fieldset`;return this.lit.html`
<div class="wk-option-swatches">

@@ -66,6 +66,6 @@ <label class="wk-label" for=${e}>${this.option.name}</label>

</div>
`}renderSwatch({value:t,name:e}){var p,d,u,m,g;let i=this.app.utils.url.handlelize(t),n=`${this.app.utils.url.handlelize(this.id)}-${i}-radio`,r=(d=(p=this.option)==null?void 0:p.unavailableValues)==null?void 0:d.includes(t),o=(m=(u=this.option)==null?void 0:u.soldoutValues)==null?void 0:m.includes(t),a=t===((g=this.option)==null?void 0:g.selectedValue),{color:l,image:c}=this.getColorSettings(i),f=[l?`background-color: ${l}`:void 0,c?`background-image: url(${c})`:void 0].filter(w=>!!w).join(";"),h=["wk-swatch",o&&"wk-soldout",r&&"wk-unavailable",a&&"wk-selected",l&&"wk-has-color",c&&"wk-has-image"].filter(w=>!!w).join(" ");return this.lit.html`
`}renderSwatch({value:t,name:e}){var p,f,u,m,g;let i=this.app.utils.url.handlelize(t),n=`${this.app.utils.url.handlelize(this.id)}-${i}-radio`,r=(f=(p=this.option)==null?void 0:p.unavailableValues)==null?void 0:f.includes(t),o=(m=(u=this.option)==null?void 0:u.soldoutValues)==null?void 0:m.includes(t),a=t===((g=this.option)==null?void 0:g.selectedValue),{color:l,image:c}=this.getColorSettings(i),d=[l?`background-color: ${l}`:void 0,c?`background-image: url(${c})`:void 0].filter(w=>!!w).join(";"),h=["wk-swatch",o&&"wk-soldout",r&&"wk-unavailable",a&&"wk-selected",l&&"wk-has-color",c&&"wk-has-image"].filter(w=>!!w).join(" ");return this.lit.html`
<div class=${h}>
<label class="wk-label" for=${n}>${t}</label>
<div class="wk-control" style=${f}>
<div class="wk-control" style=${d}>
<input

@@ -81,2 +81,2 @@ id=${n}

</div>
`}getColorSettings(t){var e;return(e=this.colorMap)!=null&&e[t]?this.colorMap[t]:{color:void 0,image:void 0}}updated(t){var e;super.updated(t),t.has("option")&&this.classList.toggle("wk-single-option",((e=this.option)==null?void 0:e.values.length)===1)}createRenderRoot(){return this}};he.properties={option:{type:Object},colorMap:{type:Object}};customElements.get("wk-option-swatches")||customElements.define("wk-option-swatches",he);var to={..._t,repeat:Jt},Me=class extends C{constructor(){super();this.connected=!1;this.cleanupMethods=[];this.eventPending=!1;this.firstConnect=!0;this.loadWithoutSession=!1;this.stateCtrl=new oe(this)}get app(){return this.stateCtrl.app}static get observedAttributes(){return[...super.observedAttributes,"data-wishlist-id","data-wishlist-item-id","data-product-handle","data-product-id","data-variant-id"]}attributeChangedCallback(e,i,n){super.attributeChangedCallback(e,i,n),this.connected&&this.initState()}appReadyCallback(){this.classList.add("wk-ready"),this.dataset.productHandle&&this.app.events.subscribe("product:change-variant:success",e=>{var i,n;this.dataset.productHandle===((i=e.data)==null?void 0:i.productHandle)&&((n=e.data)!=null&&n.variantId)&&(this.dataset.variantId=e.data.variantId.toString())})}async connect(){this.connected||(this.connected=!0,this.init())}getStateConfig(){return{}}getTranslation(e,i){if(!this.app.theme)return e;let n=this.app.theme.translate(e,i);return e.endsWith("_html")?this.unsafeHTML(n):n}formatMoney(e,i){var n;return this.app.utils.money.formatMoney(e,{withCurrency:(n=i==null?void 0:i.withCurrency)!=null?n:this.app.settings.money.withCurrency})}renderMoney(e,i){return this.unsafeHTML(this.formatMoney(e,i))}getProductUrl(e,i){return this.app.utils.url.getVariantUrl(e.url,i==null?void 0:i.id)}getImageUrl(e,i,n){var r;return this.app.utils.url.getImageUrl((r=i==null?void 0:i.featured_image)!=null&&r.src?i:e,n)}init(){let{loading:e}=this.getStateConfig();e==="lazy"?(this.initFallbackState(),this.initObserver()):(this.initState(),this.appReadyCallback())}setState(e){e.wishlist&&(this.wishlist=e.wishlist),e.wishlistItem&&(this.wishlistItem=e.wishlistItem),e.productInfo&&(this.productInfo=e.productInfo),e.cart&&(this.cart=e.cart)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.innerHTML&&this.firstConnect&&(this.innerHTML=""),this.initEvents(),this.connect(),this.firstConnect=!1}disconnectedCallback(){var e,i;super.disconnectedCallback(),this.cleanupMethods.forEach(n=>n()),this.connected=!1,(e=this.subscription)==null||e.unsubscribe(),(i=this.observer)==null||i.disconnect()}shouldUpdate(e){return this.connected?super.shouldUpdate(e):!1}initState(){this.subscription&&this.subscription.unsubscribe(),this.subscription=this.stateCtrl.observe().subscribe(e=>{this.setState(e)})}initFallbackState(){let e=this.stateCtrl.getFallback();e&&this.setState(e)}initObserver(){var e,i;(e=this.observer)==null||e.disconnect(),this.observer=new IntersectionObserver(n=>this.handleIntersect(n),{root:null,rootMargin:"0px"}),this.setAttribute("wk-lazy",""),this.observer.observe((i=this.firstElementChild)!=null?i:this)}handleIntersect([e]){var i;e.isIntersecting&&(this.removeAttribute("wk-lazy"),(i=this.observer)==null||i.disconnect(),this.initState(),this.appReadyCallback())}getEventConfig(){return{}}initEvents(){let e=this.getEventConfig();if(!e)return;let i=Object.entries(e).map(([n,r])=>{let[o,a]=n.split(/ (.*)/s);return this.subscribeToEvent({eventName:o,selector:a,handler:r})})}subscribeToEvent({eventName:e,handler:i,selector:n}){this.addEventListener(e,async r=>{if(this.eventPending){r.preventDefault();return}this.eventPending=!0;let a=r.target instanceof HTMLElement?n?r.target.closest(n):r.currentTarget:null;await(async()=>{try{return i.bind(this)(r,a)}catch(c){return console.error(c),c}})(),this.eventPending=!1})}};Me.properties={wishlist:{state:!0},productInfo:{state:!0},wishlistItem:{state:!0},cart:{state:!0},loadWithoutSession:{type:Boolean,attribute:"load-without-session"}};export{it as FloatingUiController,Te as ProductFormController,Me as WishlistElement,oe as WishlistStateController,to as lit};
`}getColorSettings(t){var e;return(e=this.colorMap)!=null&&e[t]?this.colorMap[t]:{color:void 0,image:void 0}}updated(t){var e;super.updated(t),t.has("option")&&this.classList.toggle("wk-single-option",((e=this.option)==null?void 0:e.values.length)===1)}createRenderRoot(){return this}};he.properties={option:{type:Object},colorMap:{type:Object}};customElements.get("wk-option-swatches")||customElements.define("wk-option-swatches",he);var to={..._t,repeat:Jt},Me=class extends S{constructor(){super();this.connected=!1;this.cleanupMethods=[];this.eventPending=!1;this.firstConnect=!0;this.loadWithoutSession=!1;this.hasState=!1;this.stateCtrl=new oe(this)}get app(){return this.stateCtrl.app}static get observedAttributes(){return[...super.observedAttributes,"data-wishlist-id","data-wishlist-item-id","data-product-handle","data-product-id","data-variant-id"]}attributeChangedCallback(e,i,n){super.attributeChangedCallback(e,i,n),this.connected&&this.initState()}appReadyCallback(){this.dataset.productHandle&&this.app.events.subscribe("product:change-variant:success",e=>{var i,n;this.dataset.productHandle===((i=e.data)==null?void 0:i.productHandle)&&((n=e.data)!=null&&n.variantId)&&(this.dataset.variantId=e.data.variantId.toString())})}async connect(){this.connected||(this.connected=!0,this.init())}getStateConfig(){return{}}getTranslation(e,i){if(!this.app.theme)return e;let n=this.app.theme.translate(e,i);return e.endsWith("_html")?this.unsafeHTML(n):n}formatMoney(e,i){var n;return this.app.utils.money.formatMoney(e,{withCurrency:(n=i==null?void 0:i.withCurrency)!=null?n:this.app.settings.money.withCurrency})}renderMoney(e,i){return this.unsafeHTML(this.formatMoney(e,i))}getProductUrl(e,i){return this.app.utils.url.getVariantUrl(e.url,i==null?void 0:i.id)}getImageUrl(e,i,n){var r;return this.app.utils.url.getImageUrl((r=i==null?void 0:i.featured_image)!=null&&r.src?i:e,n)}init(){let{loading:e}=this.getStateConfig();e==="lazy"?(this.initFallbackState(),this.initObserver()):(this.initState(),this.appReadyCallback())}setState(e){this.hasState||(this.setAttribute("wk-loaded",""),this.hasState=!0),e.wishlist&&(this.wishlist=e.wishlist),e.wishlistItem&&(this.wishlistItem=e.wishlistItem),e.productInfo&&(this.productInfo=e.productInfo),e.cart&&(this.cart=e.cart)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.innerHTML&&this.firstConnect&&(this.innerHTML=""),this.initEvents(),this.connect(),this.firstConnect=!1}disconnectedCallback(){var e,i;super.disconnectedCallback(),this.cleanupMethods.forEach(n=>n()),this.connected=!1,(e=this.subscription)==null||e.unsubscribe(),(i=this.observer)==null||i.disconnect()}shouldUpdate(e){return this.connected?super.shouldUpdate(e):!1}initState(){this.subscription&&this.subscription.unsubscribe(),this.subscription=this.stateCtrl.observe().subscribe(e=>{this.setState(e)})}initFallbackState(){let e=this.stateCtrl.getFallback();e&&this.setState(e)}initObserver(){var e,i;(e=this.observer)==null||e.disconnect(),this.observer=new IntersectionObserver(n=>this.handleIntersect(n),{root:null,rootMargin:"0px"}),this.setAttribute("wk-lazy",""),this.observer.observe((i=this.firstElementChild)!=null?i:this)}handleIntersect([e]){var i;e.isIntersecting&&(this.removeAttribute("wk-lazy"),(i=this.observer)==null||i.disconnect(),this.initState(),this.appReadyCallback())}getEventConfig(){return{}}initEvents(){let e=this.getEventConfig();if(!e)return;let i=Object.entries(e).map(([n,r])=>{let[o,a]=n.split(/ (.*)/s);return this.subscribeToEvent({eventName:o,selector:a,handler:r})})}subscribeToEvent({eventName:e,handler:i,selector:n}){this.addEventListener(e,async r=>{if(this.eventPending){r.preventDefault();return}this.eventPending=!0;let a=r.target instanceof HTMLElement?n?r.target.closest(n):r.currentTarget:null;await(async()=>{try{return i.bind(this)(r,a)}catch(c){return console.error(c),c}})(),this.eventPending=!1})}};Me.properties={wishlist:{state:!0},productInfo:{state:!0},wishlistItem:{state:!0},cart:{state:!0},loadWithoutSession:{type:Boolean,attribute:"load-without-session"}};export{it as FloatingUiController,Te as ProductFormController,Me as WishlistElement,oe as WishlistStateController,to as lit};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet