var se=Object.create;var ht=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var ae=Object.getOwnPropertyNames;var le=Object.getPrototypeOf,ce=Object.prototype.hasOwnProperty;var de=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var he=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ae(e))!ce.call(i,o)&&o!==t&&ht(i,o,{get:()=>e[o],enumerable:!(n=Et(e,o))||n.enumerable});return i};var pt=(i,e,t)=>(t=i!=null?se(le(i)):{},he(e||!i||!i.__esModule?ht(t,"default",{value:i,enumerable:!0}):t,i));var p=(i,e,t,n)=>{for(var o=n>1?void 0:n?Et(e,t):e,a=i.length-1,r;a>=0;a--)(r=i[a])&&(o=(n?r(e,t,o):r(o))||o);return n&&o&&ht(e,t,o),o};var ct=de((xn,vt)=>{var xt=(()=>{var i=Object.defineProperty,e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,o=(d,f,b)=>f in d?i(d,f,{enumerable:!0,configurable:!0,writable:!0,value:b}):d[f]=b,a=(d,f)=>{for(var b in f||(f={}))t.call(f,b)&&o(d,b,f[b]);if(e)for(var b of e(f))n.call(f,b)&&o(d,b,f[b]);return d},r=d=>i(d,"__esModule",{value:!0}),s=(d,f)=>{r(d);for(var b in f)i(d,b,{get:f[b],enumerable:!0})},l={};s(l,{DEFAULT_UUID_LENGTH:()=>g,default:()=>m});var u="4.4.4",g=6,c={dictionary:"alphanum",shuffle:!0,debug:!1,length:g},y=class extends Function{constructor(d={}){super(),this.dictIndex=0,this.dictRange=[],this.lowerBound=0,this.upperBound=0,this.dictLength=0,this._digit_first_ascii=48,this._digit_last_ascii=58,this._alpha_lower_first_ascii=97,this._alpha_lower_last_ascii=123,this._hex_last_ascii=103,this._alpha_upper_first_ascii=65,this._alpha_upper_last_ascii=91,this._number_dict_ranges={digits:[this._digit_first_ascii,this._digit_last_ascii]},this._alpha_dict_ranges={lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]},this._alpha_lower_dict_ranges={lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]},this._alpha_upper_dict_ranges={upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]},this._alphanum_dict_ranges={digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]},this._alphanum_lower_dict_ranges={digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]},this._alphanum_upper_dict_ranges={digits:[this._digit_first_ascii,this._digit_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]},this._hex_dict_ranges={decDigits:[this._digit_first_ascii,this._digit_last_ascii],alphaDigits:[this._alpha_lower_first_ascii,this._hex_last_ascii]},this.log=(...h)=>{let w=[...h];if(w[0]=`[short-unique-id] ${h[0]}`,this.debug===!0&&typeof console!="undefined"&&console!==null)return console.log(...w)},this.setDictionary=(h,w)=>{let x;if(h&&Array.isArray(h)&&h.length>1)x=h;else{x=[];let v;this.dictIndex=v=0;let A=`_${h}_dict_ranges`,_=this[A];Object.keys(_).forEach(S=>{let z=S;for(this.dictRange=_[z],this.lowerBound=this.dictRange[0],this.upperBound=this.dictRange[1],this.dictIndex=v=this.lowerBound;this.lowerBound<=this.upperBound?vthis.upperBound;this.dictIndex=this.lowerBound<=this.upperBound?v+=1:v-=1)x.push(String.fromCharCode(this.dictIndex))})}w&&(x=x.sort(()=>Math.random()-.5)),this.dict=x,this.dictLength=this.dict.length,this.counter=0},this.seq=()=>this.sequentialUUID(),this.sequentialUUID=()=>{let h,w,x="";h=this.counter;do w=h%this.dictLength,h=Math.trunc(h/this.dictLength),x+=this.dict[w];while(h!==0);return this.counter+=1,x},this.randomUUID=(h=this.uuidLength||g)=>{let w,x,v;if(h===null||typeof h=="undefined"||h<1)throw new Error("Invalid UUID Length Provided");let A=h>=0;for(w="",v=0;vparseFloat(Math.pow([...new Set(this.dict)].length,h).toFixed(0)),this.approxMaxBeforeCollision=(h=this.availableUUIDs(this.uuidLength))=>parseFloat(Math.sqrt(Math.PI/2*h).toFixed(20)),this.collisionProbability=(h=this.availableUUIDs(this.uuidLength),w=this.uuidLength)=>parseFloat((this.approxMaxBeforeCollision(h)/this.availableUUIDs(w)).toFixed(20)),this.uniqueness=(h=this.availableUUIDs(this.uuidLength))=>{let w=parseFloat((1-this.approxMaxBeforeCollision(h)/h).toFixed(20));return w>1?1:w<0?0:w},this.getVersion=()=>this.version,this.stamp=h=>{if(typeof h!="number"||h<10)throw new Error("Param finalLength must be number greater than 10");let w=Math.floor(+new Date/1e3).toString(16),x=h-9,v=Math.round(Math.random()*(x>15?15:x)),A=this.randomUUID(x);return`${A.substr(0,v)}${w}${A.substr(v)}${v.toString(16)}`},this.parseStamp=h=>{if(h.length<10)throw new Error("Stamp length invalid");let w=parseInt(h.substr(h.length-1,1),16);return new Date(parseInt(h.substr(w,8),16)*1e3)};let f=a(a({},c),d);this.counter=0,this.debug=!1,this.dict=[],this.version=u;let{dictionary:b,shuffle:E,length:T}=f;return this.uuidLength=T,this.setDictionary(b,E),this.debug=f.debug,this.log(this.dict),this.log(`Generator instantiated with Dictionary Size ${this.dictLength}`),new Proxy(this,{apply:(h,w,x)=>this.randomUUID(...x)})}},m=y;return m.default=y,l})();typeof vt!="undefined"&&(vt.exports=xt.default),typeof window!="undefined"&&(xt=xt.default)});import{css as _e,html as Ee,LitElement as Te}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/+esm";import{customElement as Re,property as Q}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/decorators/+esm";import{classMap as Le}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/directives/class-map/+esm";function G(i){return i.split("-")[0]}function nt(i){return i.split("-")[1]}function J(i){return["top","bottom"].includes(G(i))?"x":"y"}function ut(i){return i==="y"?"height":"width"}function Tt(i,e,t){let{reference:n,floating:o}=i,a=n.x+n.width/2-o.width/2,r=n.y+n.height/2-o.height/2,s=J(e),l=ut(s),u=n[l]/2-o[l]/2,g=s==="x",c;switch(G(e)){case"top":c={x:a,y:n.y-o.height};break;case"bottom":c={x:a,y:n.y+n.height};break;case"right":c={x:n.x+n.width,y:r};break;case"left":c={x:n.x-o.width,y:r};break;default:c={x:n.x,y:n.y}}switch(nt(e)){case"start":c[s]-=u*(t&&g?-1:1);break;case"end":c[s]+=u*(t&&g?-1:1)}return c}var Lt=async(i,e,t)=>{let{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:r}=t,s=await(r.isRTL==null?void 0:r.isRTL(e)),l=await r.getElementRects({reference:i,floating:e,strategy:o}),{x:u,y:g}=Tt(l,n,s),c=n,y={},m=0;for(let d=0;d({name:"arrow",options:i,async fn(e){let{element:t,padding:n=0}=i!=null?i:{},{x:o,y:a,placement:r,rects:s,platform:l}=e;if(t==null)return{};let u=St(n),g={x:o,y:a},c=J(r),y=nt(r),m=ut(c),d=await l.getDimensions(t),f=c==="y"?"top":"left",b=c==="y"?"bottom":"right",E=s.reference[m]+s.reference[c]-g[c]-s.floating[m],T=g[c]-s.reference[c],h=await(l.getOffsetParent==null?void 0:l.getOffsetParent(t)),w=h?c==="y"?h.clientHeight||0:h.clientWidth||0:0;w===0&&(w=s.floating[m]);let x=E/2-T/2,v=u[f],A=w-d[m]-u[b],_=w/2-d[m]/2+x,S=ft(v,_,A),z=(y==="start"?u[f]:u[b])>0&&_!==S&&s.reference[m]<=s.floating[m];return{[c]:g[c]-(z?_ue[e])}function ge(i,e,t){t===void 0&&(t=!1);let n=nt(i),o=J(i),a=ut(o),r=o==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(r=it(r)),{main:r,cross:it(r)}}var me={start:"end",end:"start"};function Rt(i){return i.replace(/start|end/g,e=>me[e])}var we=["top","right","bottom","left"],_i=we.reduce((i,e)=>i.concat(e,e+"-start",e+"-end"),[]);var wt=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(e){var t;let{placement:n,middlewareData:o,rects:a,initialPlacement:r,platform:s,elements:l}=e,{mainAxis:u=!0,crossAxis:g=!0,fallbackPlacements:c,fallbackStrategy:y="bestFit",flipAlignment:m=!0,...d}=i,f=G(n),b=c||(f===r||!m?[it(r)]:function(_){let S=it(_);return[Rt(_),S,Rt(S)]}(r)),E=[r,...b],T=await gt(e,d),h=[],w=((t=o.flip)==null?void 0:t.overflows)||[];if(u&&h.push(T[f]),g){let{main:_,cross:S}=ge(n,a,await(s.isRTL==null?void 0:s.isRTL(l.floating)));h.push(T[_],T[S])}if(w=[...w,{placement:n,overflows:h}],!h.every(_=>_<=0)){var x,v;let _=((x=(v=o.flip)==null?void 0:v.index)!=null?x:0)+1,S=E[_];if(S)return{data:{index:_,overflows:w},reset:{placement:S}};let z="bottom";switch(y){case"bestFit":{var A;let _t=(A=w.map(et=>[et,et.overflows.filter(Y=>Y>0).reduce((Y,re)=>Y+re,0)]).sort((et,Y)=>et[1]-Y[1])[0])==null?void 0:A[0].placement;_t&&(z=_t);break}case"initialPlacement":z=r}if(n!==z)return{reset:{placement:z}}}return{}}}};var ot=function(i){return i===void 0&&(i=0),{name:"offset",options:i,async fn(e){let{x:t,y:n}=e,o=await async function(a,r){let{placement:s,platform:l,elements:u}=a,g=await(l.isRTL==null?void 0:l.isRTL(u.floating)),c=G(s),y=nt(s),m=J(s)==="x",d=["left","top"].includes(c)?-1:1,f=g&&m?-1:1,b=typeof r=="function"?r(a):r,{mainAxis:E,crossAxis:T,alignmentAxis:h}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...b};return y&&typeof h=="number"&&(T=y==="end"?-1*h:h),m?{x:T*f,y:E*d}:{x:E*d,y:T*f}}(e,i);return{x:t+o.x,y:n+o.y,data:o}}}};function ye(i){return i==="x"?"y":"x"}var yt=function(i){return i===void 0&&(i={}),{name:"shift",options:i,async fn(e){let{x:t,y:n,placement:o}=e,{mainAxis:a=!0,crossAxis:r=!1,limiter:s={fn:b=>{let{x:E,y:T}=b;return{x:E,y:T}}},...l}=i,u={x:t,y:n},g=await gt(e,l),c=J(G(o)),y=ye(c),m=u[c],d=u[y];if(a){let b=c==="y"?"bottom":"right";m=ft(m+g[c==="y"?"top":"left"],m,m-g[b])}if(r){let b=y==="y"?"bottom":"right";d=ft(d+g[y==="y"?"top":"left"],d,d-g[b])}let f=s.fn({...e,[c]:m,[y]:d});return{...f,data:{x:f.x-t,y:f.y-n}}}}};function Ft(i){return i&&i.document&&i.location&&i.alert&&i.setInterval}function U(i){if(i==null)return window;if(!Ft(i)){let e=i.ownerDocument;return e&&e.defaultView||window}return i}function I(i){return U(i).getComputedStyle(i)}function M(i){return Ft(i)?"":i?(i.nodeName||"").toLowerCase():""}function Mt(){let i=navigator.userAgentData;return i!=null&&i.brands?i.brands.map(e=>e.brand+"/"+e.version).join(" "):navigator.userAgent}function O(i){return i instanceof U(i).HTMLElement}function V(i){return i instanceof U(i).Element}function q(i){return typeof ShadowRoot=="undefined"?!1:i instanceof U(i).ShadowRoot||i instanceof ShadowRoot}function at(i){let{overflow:e,overflowX:t,overflowY:n}=I(i);return/auto|scroll|overlay|hidden/.test(e+n+t)}function be(i){return["table","td","th"].includes(M(i))}function Ct(i){let e=/firefox/i.test(Mt()),t=I(i);return t.transform!=="none"||t.perspective!=="none"||t.contain==="paint"||["transform","perspective"].includes(t.willChange)||e&&t.willChange==="filter"||e&&!!t.filter&&t.filter!=="none"}function Ht(){return!/^((?!chrome|android).)*safari/i.test(Mt())}var At=Math.min,K=Math.max,rt=Math.round;function H(i,e,t){var n,o,a,r;e===void 0&&(e=!1),t===void 0&&(t=!1);let s=i.getBoundingClientRect(),l=1,u=1;e&&O(i)&&(l=i.offsetWidth>0&&rt(s.width)/i.offsetWidth||1,u=i.offsetHeight>0&&rt(s.height)/i.offsetHeight||1);let g=V(i)?U(i):window,c=!Ht()&&t,y=(s.left+(c&&(n=(o=g.visualViewport)==null?void 0:o.offsetLeft)!=null?n:0))/l,m=(s.top+(c&&(a=(r=g.visualViewport)==null?void 0:r.offsetTop)!=null?a:0))/u,d=s.width/l,f=s.height/u;return{width:d,height:f,top:m,right:y+d,bottom:m+f,left:y,x:y,y:m}}function D(i){return(e=i,(e instanceof U(e).Node?i.ownerDocument:i.document)||window.document).documentElement;var e}function lt(i){return V(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:{scrollLeft:i.pageXOffset,scrollTop:i.pageYOffset}}function Ut(i){return H(D(i)).left+lt(i).scrollLeft}function xe(i,e,t){let n=O(e),o=D(e),a=H(i,n&&function(l){let u=H(l);return rt(u.width)!==l.offsetWidth||rt(u.height)!==l.offsetHeight}(e),t==="fixed"),r={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(n||!n&&t!=="fixed")if((M(e)!=="body"||at(o))&&(r=lt(e)),O(e)){let l=H(e,!0);s.x=l.x+e.clientLeft,s.y=l.y+e.clientTop}else o&&(s.x=Ut(o));return{x:a.left+r.scrollLeft-s.x,y:a.top+r.scrollTop-s.y,width:a.width,height:a.height}}function $t(i){return M(i)==="html"?i:i.assignedSlot||i.parentNode||(q(i)?i.host:null)||D(i)}function Pt(i){return O(i)&&I(i).position!=="fixed"?function(e){let{offsetParent:t}=e,n=e,o=!1;for(;n&&n!==t;){let{assignedSlot:a}=n;if(a){let r=a.offsetParent;if(I(a).display==="contents"){let s=a.hasAttribute("style"),l=a.style.display;a.style.display=I(n).display,r=a.offsetParent,a.style.display=l,s||a.removeAttribute("style")}n=a,t!==r&&(t=r,o=!0)}else if(q(n)&&n.host&&o)break;n=q(n)&&n.host||n.parentNode}return t}(i):null}function bt(i){let e=U(i),t=Pt(i);for(;t&&be(t)&&I(t).position==="static";)t=Pt(t);return t&&(M(t)==="html"||M(t)==="body"&&I(t).position==="static"&&!Ct(t))?e:t||function(n){let o=$t(n);for(q(o)&&(o=o.host);O(o)&&!["html","body"].includes(M(o));){if(Ct(o))return o;{let a=o.parentNode;o=q(a)?a.host:a}}return null}(i)||e}function It(i){if(O(i))return{width:i.offsetWidth,height:i.offsetHeight};let e=H(i);return{width:e.width,height:e.height}}function zt(i){let e=$t(i);return["html","body","#document"].includes(M(e))?i.ownerDocument.body:O(e)&&at(e)?e:zt(e)}function st(i,e){var t;e===void 0&&(e=[]);let n=zt(i),o=n===((t=i.ownerDocument)==null?void 0:t.body),a=U(n),r=o?[a].concat(a.visualViewport||[],at(n)?n:[]):n,s=e.concat(r);return o?s:s.concat(st(r))}function Ot(i,e,t){return e==="viewport"?X(function(n,o){let a=U(n),r=D(n),s=a.visualViewport,l=r.clientWidth,u=r.clientHeight,g=0,c=0;if(s){l=s.width,u=s.height;let y=Ht();(y||!y&&o==="fixed")&&(g=s.offsetLeft,c=s.offsetTop)}return{width:l,height:u,x:g,y:c}}(i,t)):V(e)?function(n,o){let a=H(n,!1,o==="fixed"),r=a.top+n.clientTop,s=a.left+n.clientLeft;return{top:r,left:s,x:s,y:r,right:s+n.clientWidth,bottom:r+n.clientHeight,width:n.clientWidth,height:n.clientHeight}}(e,t):X(function(n){var o;let a=D(n),r=lt(n),s=(o=n.ownerDocument)==null?void 0:o.body,l=K(a.scrollWidth,a.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),u=K(a.scrollHeight,a.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),g=-r.scrollLeft+Ut(n),c=-r.scrollTop;return I(s||a).direction==="rtl"&&(g+=K(a.clientWidth,s?s.clientWidth:0)-l),{width:l,height:u,x:g,y:c}}(D(i)))}function ve(i){let e=st(i),t=["absolute","fixed"].includes(I(i).position)&&O(i)?bt(i):i;return V(t)?e.filter(n=>V(n)&&function(o,a){let r=a.getRootNode==null?void 0:a.getRootNode();if(o.contains(a))return!0;if(r&&q(r)){let s=a;do{if(s&&o===s)return!0;s=s.parentNode||s.host}while(s)}return!1}(n,t)&&M(n)!=="body"):[]}var ke={getClippingRect:function(i){let{element:e,boundary:t,rootBoundary:n,strategy:o}=i,a=[...t==="clippingAncestors"?ve(e):[].concat(t),n],r=a[0],s=a.reduce((l,u)=>{let g=Ot(e,u,o);return l.top=K(g.top,l.top),l.right=At(g.right,l.right),l.bottom=At(g.bottom,l.bottom),l.left=K(g.left,l.left),l},Ot(e,r,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(i){let{rect:e,offsetParent:t,strategy:n}=i,o=O(t),a=D(t);if(t===a)return e;let r={scrollLeft:0,scrollTop:0},s={x:0,y:0};if((o||!o&&n!=="fixed")&&((M(t)!=="body"||at(a))&&(r=lt(t)),O(t))){let l=H(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}return{...e,x:e.x-r.scrollLeft+s.x,y:e.y-r.scrollTop+s.y}},isElement:V,getDimensions:It,getOffsetParent:bt,getDocumentElement:D,getElementRects:i=>{let{reference:e,floating:t,strategy:n}=i;return{reference:xe(e,bt(t),n),floating:{...It(t),x:0,y:0}}},getClientRects:i=>Array.from(i.getClientRects()),isRTL:i=>I(i).direction==="rtl"};function Dt(i,e,t,n){n===void 0&&(n={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:r=!0,animationFrame:s=!1}=n,l=o&&!s,u=a&&!s,g=l||u?[...V(i)?st(i):[],...st(e)]:[];g.forEach(d=>{l&&d.addEventListener("scroll",t,{passive:!0}),u&&d.addEventListener("resize",t)});let c,y=null;if(r){let d=!0;y=new ResizeObserver(()=>{d||t(),d=!1}),V(i)&&!s&&y.observe(i),y.observe(e)}let m=s?H(i):null;return s&&function d(){let f=H(i);!m||f.x===m.x&&f.y===m.y&&f.width===m.width&&f.height===m.height||t(),m=f,c=requestAnimationFrame(d)}(),t(),()=>{var d;g.forEach(f=>{l&&f.removeEventListener("scroll",t),u&&f.removeEventListener("resize",t)}),(d=y)==null||d.disconnect(),y=null,s&&cancelAnimationFrame(c)}}var Vt=(i,e,t)=>Lt(i,e,{platform:ke,...t});var P=class{constructor(e){this.element=e}replace(e){var t;return(t=this.element)==null||t.replaceWith(e),e}append(e){var t;return(t=this.element)==null||t.append(e),e}prepend(e){var t;return(t=this.element)==null||t.prepend(e),e}insertBefore(e){var t;return(t=this.element)==null||t.before(e),e}insertAfter(e){var t;return(t=this.element)==null||t.after(e),e}closest(e,t=5){if(!this.element)return new P;if(typeof e=="object")return this.searchByStyle(e,this.element,o=>o.parentElement,t);let n=this.element.closest(e);return n?new P(n):new P}find(e){var n;let t=(n=this.element)==null?void 0:n.querySelector(e);return t?new P(t):new P}searchByStyle(e,t,n,o=5){if(o<0||!t)return null;let a=getComputedStyle(t);if(Object.entries(e).every(([l,u])=>a.getPropertyValue(l)===u))return new P(t);let s=n(t);return s?this.searchByStyle(e,s,n,o-1):null}};var N=class{constructor(e){this._middleware=[];(this.host=e).addController(this)}hostDisconnected(){this.destroy()}hostUpdated(){this.updatePosition()}hostResized(){this.updatePosition()}float(e){var s;if(this.destroy(),this._settings=e,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:t,arrow:n=!1,flip:o=!1,shift:a=!1}=this._settings,r=this.getOffsetSetting();Object.assign(this.host.style,{position:(s=t.strategy)!=null?s:"absolute",top:"0",left:"0",transition:"none",transform:"translate3d(0,0,0)"}),t.inset&&!n?this._middleware.push(ot(({rects:l,placement:u})=>{var g,c,y,m,d,f;return u.includes("top")||u.includes("bottom")?{mainAxis:-l.floating.height-((g=r==null?void 0:r.mainAxis)!=null?g:0),crossAxis:(c=r==null?void 0:r.crossAxis)!=null?c:0,alignmentAxis:(y=r==null?void 0:r.alignmentAxis)!=null?y:0}:{mainAxis:-l.floating.width-((m=r==null?void 0:r.mainAxis)!=null?m:0),crossAxis:(d=r==null?void 0:r.crossAxis)!=null?d:0,alignmentAxis:(f=r==null?void 0:r.alignmentAxis)!=null?f:0}})):r&&this._middleware.push(ot(r)),o&&this._middleware.push(wt()),a&&this._middleware.push(yt()),n&&(this.arrowEl=document.createElement("div"),this.arrowEl.classList.add("wk-arrow"),this._middleware.push(mt({element:this.arrowEl}))),this.cleanupAutoUpdate=Dt(this._reference,this.host,()=>{this.updatePosition()}),this._resizeObserver.observe(this.host)}getOffsetSetting(){var t,n;let e=(t=this._settings)==null?void 0:t.offset;if(!(!e||typeof e=="boolean"))return typeof e=="number"?{mainAxis:e,alignmentAxis:(n=this._settings)!=null&&n.position.inset?e:null}:e}destroy(){var e,t,n,o;Object.assign(this.host.style,{position:"",top:"",left:""}),(t=(e=this.arrowEl)==null?void 0:e.parentElement)==null||t.removeChild(this.arrowEl),this.arrowEl=void 0,this._middleware=[],this.host.classList.remove("wk-floating"),(n=this.cleanupAutoUpdate)==null||n.call(this),(o=this._resizeObserver)==null||o.disconnect()}updatePosition(){var n;if(!this._reference||!this._settings)return;let{strategy:e="absolute",placement:t="top"}=(n=this._settings.position)!=null?n:{};Vt(this._reference,this.host,{middleware:this._middleware,strategy:e,placement:t}).then(({x:o,y:a,placement:r,middlewareData:s})=>{if(s.arrow&&this.arrowEl){let{x:l,y:u}=s.arrow,g={top:"bottom",right:"left",bottom:"top",left:"right"}[r.split("-")[0]],c={bottom:"0deg",left:"90deg",top:"180deg",right:"270deg"}[r.split("-")[0]];Object.assign(this.arrowEl.style,{left:l!=null?`${l}px`:"",top:u!=null?`${u}px`:"",right:"",bottom:"",[g]:"-5px",transform:`rotate(${c})`})}Object.assign(this.host.style,{transform:`translate3d(${Math.round(o)}px,${Math.round(a)}px,0)`})})}getReference(){if(!this._settings)return;let e=this._settings.reference;if(typeof e=="string"){if(e==="viewport")return this.createViewportReference();let t=document.querySelector(e);if(!t)throw new Error(`Floating reference element (${e}) not found`);return t}return e.hasOwnProperty("element")||e instanceof P?e.element:e}createViewportReference(){return{getBoundingClientRect(){var e,t,n,o;return{x:0,y:0,top:0,left:0,bottom:0,right:0,width:(t=(e=window.visualViewport)==null?void 0:e.width)!=null?t:0,height:(o=(n=window.visualViewport)==null?void 0:n.height)!=null?o:0}}}}};var F=class extends Te{constructor(){super(...arguments);this.text="";this.layout="text-only";this.parentheses=!1;this.hiddenIfEmpty=!1;this.floatingUi=new N(this)}updated(t){t.has("floating")&&(this.floating?this.floatingUi.float(this.floating):this.floatingUi.destroy())}render(){var o,a,r;let t={"wk-badge":!0,"wk-parentheses":!!this.parentheses,"wk-pill":(a=(o=this.layout)==null?void 0:o.includes("pill"))!=null?a:!1};if(this.hiddenIfEmpty&&(!this.text||parseInt(this.text)===0))return;let n=(r=this.layout)!=null&&r.includes("text")?this.text:"";return Ee`${n}`}createRenderRoot(){return this}};p([Q({type:String})],F.prototype,"text",2),p([Q({type:String})],F.prototype,"layout",2),p([Q({type:Boolean})],F.prototype,"parentheses",2),p([Q({type:Boolean,attribute:"hidden-if-empty"})],F.prototype,"hiddenIfEmpty",2),p([Q({type:Object})],F.prototype,"floating",2),F=p([Re("wk-badge")],F);var Se=_e` wk-badge .wk-badge { display: flex; justify-content: center; align-items: center; position: relative; } wk-badge .wk-pill { padding: 0 4px; } wk-badge .wk-parentheses::before { content: "("; } wk-badge .wk-parentheses::after { content: ")"; } wk-badge .wk-pill { height: var(--size); min-width: var(--size); border-radius: calc(var(--size) / 2); } `,Nt=document.createElement("style");Nt.textContent=Se.cssText;document.head.appendChild(Nt);import{css as Pe,html as Z,LitElement as Ie}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/+esm";import{customElement as Oe,property as R}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/decorators/+esm";import{classMap as Bt}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/directives/class-map/+esm";var Wt=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Ce(i,e){return!!(i===e||Wt(i)&&Wt(e))}function Ae(i,e){if(i.length!==e.length)return!1;for(var t=0;t{if(!(!t||!n))return{...t,reference:n}})}updated(t){t.has("floating")&&(this.floating?this.floatingUi.float(this.floating):this.floatingUi.destroy())}render(){var o,a,r;let t=(o=this.alignment)!=null?o:"center",n={"wk-button":!0,"wk-selected":!!this.selected,"wk-outline":!!this.outline,"wk-full-width":!!this.fullWidth,[`wk-align-${t}`]:!0};return this.href?Z` ${this.renderIcon()}${this.renderText()}${this.renderBadge()} `:Z` `}renderIcon(){var n;let t=(n=this.layout)!=null?n:"icon-and-text";if(!(!(t!=null&&t.includes("icon"))||!this.icon))return Z``}renderText(){var n;let t=(n=this.layout)!=null?n:"icon-and-text";if(!!(t!=null&&t.includes("text")))return Z`${this.text}`}renderBadge(){if(!(!this.badgeLayout||this.badgeText===void 0))return Z``}createRenderRoot(){return this}};p([R({type:String})],k.prototype,"href",2),p([R({type:String})],k.prototype,"text",2),p([R({type:String})],k.prototype,"hint",2),p([R({type:Boolean})],k.prototype,"selected",2),p([R({type:String})],k.prototype,"layout",2),p([R({type:String})],k.prototype,"icon",2),p([R({type:Boolean})],k.prototype,"outline",2),p([R({type:Boolean,attribute:"full-width"})],k.prototype,"fullWidth",2),p([R({type:String})],k.prototype,"alignment",2),p([R({type:Object})],k.prototype,"floating",2),p([R({type:String,attribute:"badge-text"})],k.prototype,"badgeText",2),p([R({type:String,attribute:"badge-layout"})],k.prototype,"badgeLayout",2),p([R({type:Boolean,attribute:"badge-parentheses"})],k.prototype,"badgeParentheses",2),p([R({type:Boolean,attribute:"badge-hidden-if-empty"})],k.prototype,"badgeHiddenIfEmpty",2),p([R({type:Object,attribute:"badge-floating"})],k.prototype,"badgeFloating",2),k=p([Oe("wk-button")],k);var Fe=Pe` wk-button { pointer-events: none; } wk-button wk-icon { --size: var(--icon-size); --fill: var(--icon-fill); --stroke: var(--icon-stroke); --stroke-width: var(--icon-stroke-width); } wk-button wk-badge { --size: var(--badge-size); } wk-button .wk-button { position: relative; appearance: none; outline: none; pointer-events: all; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; margin: 0; text-decoration: none; color: unset; border-width: 1px; border-color: currentColor; border-style: none; gap: 5px; } wk-button .wk-button:focus { outline: none; } wk-button .wk-button.wk-outline { border-style: solid; } wk-button .wk-button.wk-full-width { width: 100%; } wk-button .wk-button.wk-align-left { justify-content: left; margin-left: 0; } wk-button .wk-button.wk-align-left:not(.wk-outline) { padding-left: 0; } wk-button .wk-button.wk-align-right { justify-content: right; margin-right: 0; } wk-button .wk-button.wk-align-right:not(.wk-outline) { padding-right: 0; } `,qt=document.createElement("style");qt.textContent=Fe.cssText;document.head.appendChild(qt);import{css as Me,html as He,LitElement as Ue}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/+esm";import{customElement as $e}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/decorators/+esm";var tt=class extends Ue{constructor(){super();this.gridItems=[]}connectedCallback(){super.connectedCallback();for(let t of this.children)t instanceof HTMLElement&&this.gridItems.push(t);this.innerHTML=""}render(){return He`
${this.gridItems}
`}createRenderRoot(){return this}};tt=p([$e("wk-grid")],tt);var ze=Me` wk-grid .wk-grid { display: grid; grid-gap: 3em 2em; grid-template-columns: repeat(var(--columns), 1fr); } `,Yt=document.createElement("style");Yt.textContent=ze.cssText;document.head.appendChild(Yt);import{css as De,LitElement as Ve,html as Xt}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/+esm";import{customElement as Ne,property as We}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/decorators/+esm";import{svg as je,unsafeStatic as Be}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/static-html/+esm";var C=class extends Ve{constructor(){super(...arguments);this.icon=""}static setIcons(t){C.icons=t}static addIcons(t){Object.assign(C.icons,t)}static removeIcons(t){Object.entries(C.icons).filter(([n])=>!t.includes(n))}render(){var n;if(!this.icon)return Xt``;let t=(n=C.icons[this.icon])!=null?n:Xt``;return je`${Be(t)}`}createRenderRoot(){return this}};C.icons={},p([We({type:String})],C.prototype,"icon",2),C=p([Ne("wk-icon")],C);var qe=De` wk-icon { --size: 18px; --fill: currentColor; --stroke: currentColor; --stroke-width: 1.25px; position: relative; } wk-icon svg, wk-icon svg:not(:root) { display: block; width: var(--size); height: var(--size); overflow: visible; fill: var(--fill); stroke: var(--stroke); stroke-width: var(--stroke-width); pointer-events: none; transition: none; } wk-icon path { transition: none; vector-effect: non-scaling-stroke; } wk-icon .wk-spinner-svg { animation: wk-rotate 1.4s linear infinite; } wk-icon .wk-spinner-circle { stroke-dasharray: 280; stroke-dashoffset: 0; transform-origin: center; stroke: currentColor; animation: wk-dash 1.4s ease-in-out infinite; } @keyframes wk-rotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(270deg); } } @keyframes wk-dash { 0% { stroke-dashoffset: 280; } 50% { stroke-dashoffset: 75; transform: rotate(135deg); } 100% { stroke-dashoffset: 280; transform: rotate(450deg); } } `,Gt=document.createElement("style");Gt.textContent=qe.cssText;document.head.appendChild(Gt);import{css as Ye,html as Xe,LitElement as Ge}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/+esm";import{customElement as Je,property as Ke,state as Qe}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/decorators/+esm";import{classMap as Ze}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/directives/class-map/+esm";var j=class extends Ge{constructor(){super(...arguments);this.text="";this.autoShow=!1;this.autoHide=!1}get added(){return!!this.parentElement}get floats(){return!!this._floatingCtrl}get showing(){return this.transition==="show"}get hiding(){return this.transition==="hide"}render(){var n;let t={"wk-popover":!0,"wk-show":this.transition==="show","wk-hide":this.transition==="hide"};return this.elementClass&&(t[this.elementClass]=!0),Xe`
${this.getText()}
${(n=this._floatingCtrl)==null?void 0:n.arrowEl}
`}firstUpdated(){this.autoShow!==!1&&(this._autoShowTimer=setTimeout(()=>this.show(),(this.autoShow===!0?0:this.autoShow)*1e3)),this.autoHide!==!1&&(this._autoHideTimer=setTimeout(()=>this.hide(),(this.autoHide===!0?2:this.autoHide)*1e3))}add(t=document.body){this.added||t.appendChild(this),!this.floats&&this.floating&&(this._floatingCtrl=new N(this,this.floating))}show(t){if(this.showing)return;this.clearAllTimer(),this.added||this.add(),requestAnimationFrame(()=>{this.transition="show"});let n=()=>{this.removeEventListener("transitionend",n),this.removeEventListener("transitioncancel",o),t==null||t()},o=()=>{this.removeEventListener("transitionend",n),this.removeEventListener("transitioncancel",o)};this.addEventListener("transitionend",n),this.addEventListener("transitioncancel",o)}hide(){if(!this.showing)return;this.clearAllTimer(),requestAnimationFrame(()=>{this.transition="hide"});let t=()=>{this.removeEventListener("transitionend",t),this.removeEventListener("transitioncancel",n),this.remove()},n=()=>{this.removeEventListener("transitionend",t),this.removeEventListener("transitioncancel",n)};this.addEventListener("transitionend",t),this.addEventListener("transitioncancel",n)}remove(){this.parentElement&&this.parentElement.removeChild(this),this.transition=void 0,this.dispatchEvent(new Event("removed"))}clearAllTimer(){this._autoShowTimer&&(clearTimeout(this._autoShowTimer),this._autoShowTimer=void 0),this._autoHideTimer&&(clearTimeout(this._autoHideTimer),this._autoHideTimer=void 0)}getText(){return typeof this.text=="function"?this.text():this.text}createRenderRoot(){return this}};p([Ke({attribute:!1})],j.prototype,"text",2),p([Qe()],j.prototype,"transition",2),j=p([Je("wk-popover")],j);var ti=Ye` wk-popover { --text-color: white; --background-color: black; --font-size: 100%; --font-weight: normal; --padding: 10px; --border-radius: 5px; --box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5); --tooltip-text-color: white; --tooltip-background-color: black; --tooltip-font-size: 100%; --tooltip-font-weight: normal; --tooltip-padding: 10px; --tooltip-border-radius: 5px; --tooltip-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5); --notification-text-color: white; --notification-background-color: black; --notification-font-size: 120%; --notification-font-weight: 500; --notification-padding: 10px; --notification-border-radius: 0px; --notification-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5); } wk-popover .wk-popover { position: relative; color: var(--text-color); background-color: var(--background-color); font-size: var(--font-size); font-weight: var(--font-weight); padding: var(--padding); border-radius: var(--border-radius); opacity: 0; transition: 0.25s opacity; pointer-events: none; box-shadow: var(--box-shadow); } wk-popover .wk-tooltip { --text-color: var(--tooltip-text-color); --background-color: var(--tooltip-background-color); --font-size: var(--tooltip-font-size); --font-weight: var(--tooltip-font-weight); --padding: var(--tooltip-padding); --border-radius: var(--tooltip-border-radius); --box-shadow: var(--tooltip-box-shadow); } wk-popover .wk-notification { --text-color: var(--notification-text-color); --background-color: var(--notification-background-color); --font-size: var(--notification-font-size); --font-weight: var(--notification-font-weight); --padding: var(--notification-padding); --border-radius: var(--notification-border-radius); --box-shadow: var(--notification-box-shadow); } wk-popover .wk-popover.wk-show { opacity: 1; } wk-popover .wk-popover.wk-hide { opacity: 0; } wk-popover .wk-arrow, wk-popover .wk-arrow:empty { position: absolute; display: block; width: 0; height: 0; border-style: solid; border-width: 0 5px 5px 5px; border-color: transparent transparent var(--background-color) transparent; } `,Jt=document.createElement("style");Jt.textContent=ti.cssText;document.head.appendChild(Jt);var Kt=pt(ct());import{css as ei,html as ii,LitElement as ni}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/+esm";import{customElement as oi,property as dt}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/decorators/+esm";import{classMap as ri}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/directives/class-map/+esm";var si=new Kt.default({length:10}),$=class extends ni{constructor(){super();this.icon="caret";this.label="";this.text="";this.name="";this.options=[];this.inputId=`wk-select-${si()}`}connectedCallback(){super.connectedCallback();for(let t of this.children)t instanceof HTMLOptionElement&&this.options.push(t);this.innerHTML=""}render(){let t=ri({"wk-select":!0,"wk-single-option":this.options.length===1});return ii`
${this.text}
`}createRenderRoot(){return this}};p([dt({type:String})],$.prototype,"icon",2),p([dt({type:String})],$.prototype,"label",2),p([dt({type:String})],$.prototype,"text",2),p([dt({type:String})],$.prototype,"name",2),$=p([oi("wk-select")],$);var ai=ei` wk-select .wk-select { position: relative; display: flex; flex-direction: column; width: 100%; } wk-select .wk-control { position: relative; display: flex; width: 100%; background-color: white; border: 1px solid black; border-radius: 0; color: black; padding: 0.25em 0.5em; min-height: 40px; } wk-select .wk-label { display: flex; width: 100%; color: black; font-size: 80%; padding: 0 0 0.25em 0; line-height: 1; } wk-select .wk-input { appearance: none; position: absolute; z-index: 1; left: 0; right: 0; top: 0; bottom: 0; opacity: 0; cursor: pointer; } wk-select .wk-content { display: flex; flex-direction: row; align-items: center; width: 100%; } wk-select .wk-text { flex: 1; line-height: 1; } wk-select .wk-icon { --size: 16px; --stroke-width: 1px; --stroke: black; --fill: transparent; } `,Qt=document.createElement("style");Qt.textContent=ai.cssText;document.head.appendChild(Qt);var ne=pt(ct());import{css as gi,html as mi,LitElement as wi}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/+esm";import{customElement as yi,property as ie}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/decorators/+esm";import{classMap as bi}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/directives/class-map/+esm";var te=pt(ct());import{css as li,html as Zt,LitElement as ci}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/+esm";import{customElement as di,property as W}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/decorators/+esm";import{classMap as hi}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/directives/class-map/+esm";import{styleMap as pi}from"https://cdn.jsdelivr.net/npm/lit@2.3.1/directives/style-map/+esm";var fi=new te.default({length:10}),L=class extends ci{constructor(){super();this.label="";this.name="";this.value="";this.selected=!1;this.disabled=!1;this.unavailable=!1;this.inputId=`wk-swatches-${fi()}`}render(){let t=hi({"wk-swatch":!0,"wk-disabled":this.disabled||this.unavailable,"wk-selected":this.selected,"wk-has-color":!!this.color,"wk-has-image":!!this.image});return Zt`
${this.renderLabel()}
`}renderLabel(){let t={backgroundColor:this.color?this.color:void 0,backgroundImage:this.image?`url(${this.image})`:void 0};return Zt` `}createRenderRoot(){return this}};p([W({type:String})],L.prototype,"label",2),p([W({type:String})],L.prototype,"name",2),p([W({type:String})],L.prototype,"value",2),p([W({type:Boolean})],L.prototype,"selected",2),p([W({type:Boolean})],L.prototype,"disabled",2),p([W({type:Boolean})],L.prototype,"unavailable",2),p([W({type:String})],L.prototype,"image",2),p([W({type:String})],L.prototype,"color",2),L=p([di("wk-swatch")],L);var ui=li` wk-swatch .wk-swatch { position: relative; display: inline-flex; flex-direction: row; } wk-swatch .wk-radio { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } wk-swatch .wk-label { position: relative; overflow: hidden; display: flex; justify-content: center; align-items: center; min-height: 40px; margin: 0; padding: 0.5em; color: black; font-size: 80%; box-shadow: 0 0 0 1px grey; } wk-swatch .wk-disabled .wk-label { color: lightgray; box-shadow: 0 0 0 1px lightgrey; } wk-swatch .wk-disabled .wk-label::after { position: absolute; content: ""; left: 50%; top: 0; bottom: 0; border-left: 1px solid currentColor; transform: rotate(45deg); } wk-swatch .wk-selected .wk-label { box-shadow: 0 0 0 2px black; } wk-swatch .wk-has-color .wk-label, wk-swatch .wk-has-image .wk-label { text-indent: -9999px; aspect-ratio: 1; } `,ee=document.createElement("style");ee.textContent=ui.cssText;document.head.appendChild(ee);var xi=new ne.default({length:10}),B=class extends wi{constructor(){super();this.label="";this.name="";this.options=[];this.inputId=`wk-swatch-${xi()}`}connectedCallback(){super.connectedCallback();for(let t of this.children)t instanceof L&&this.options.push(t);this.innerHTML=""}render(){let t=bi({"wk-swatches":!0,"wk-single-option":this.options.length===1});return mi`
${this.options.map(n=>Object.assign(n,{name:this.name}))}
`}createRenderRoot(){return this}};p([ie({type:String})],B.prototype,"label",2),p([ie({type:String})],B.prototype,"name",2),B=p([yi("wk-swatches")],B);var vi=gi` wk-swatches .wk-swatch { position: relative; display: flex; width: 100%; } wk-swatches .wk-fieldset { position: relative; display: flex; flex-direction: column; width: 100%; border: none; padding: 0; } wk-swatches .wk-fieldset > .wk-label { color: black; font-size: 80%; padding: 0 0 0.25em 0; } wk-swatches .wk-options { display: flex; flex-direction: row; flex-wrap: wrap; gap: 10px; } `,oe=document.createElement("style");oe.textContent=vi.cssText;document.head.appendChild(oe);var kt=class{constructor(e,{app:t}){this.product=null,this.app=t,this.state={selectedVariant:null,selectedOptions:{},hasSelection:!1,optionsWithValues:[]},(this.host=e).addController(this)}setProduct({product:e,selectedVariantId:t=null,autoSelect:n=!1}){!(e!=null&&e.variants)||(this.product=e,this.initFormState({selectedVariantId:t,autoSelect:n}))}initFormState({selectedVariantId:e,autoSelect:t}){if(!this.product)throw new Error("Product not set");let n=this.initializedVariantId!==e?this.product.variants.find(a=>a.id===e):this.state.selectedVariant;this.initializedVariantId=e;let o=this.app.utils.product.getVariantOptions({variant:n});this.updateFormState({options:o,autoSelect:t})}updateFormState({options:e,change:t,autoSelect:n=!1}){if(!this.product)throw new Error("Product not set");let{hasSelection:o,optionsWithValues:a,selectedOptions:r,selectedVariant:s}=this.app.utils.product.getFormState({product:this.product,options:e,change:t,autoSelect:n});this.state.hasSelection=o,this.state.optionsWithValues=a,this.state.selectedOptions=r,this.state.selectedVariant=s,this.host.requestUpdate()}changeOption({input:e,autoSelect:t=!1}){if(!this.product)throw new Error("Product not set");let n=this.getInputOption(e);if(!n)throw new Error("Cannot parse options from input");this.updateFormState({options:this.state.selectedOptions,change:n,autoSelect:t})}async addToCart({wishlistId:e,wishlistItemId:t}){if(!this.state.selectedVariant)throw new Error("No variant selected");let n=this.host.querySelector("form");if(!n)throw new Error("Form not found");n.classList.add("wk-submitting"),await this.app.addToCart({wishlistId:e,wishlistItemId:t,variantId:this.state.selectedVariant.id,quantity:this.app.utils.product.getFormQuantity({form:n})}),n.classList.remove("wk-submitting")}getInputOption(e){if(!this.product)throw new Error("Product not set");return this.app.utils.product.getInputOption({input:e,product:this.product})}hostConnected(){}hostDisconnected(){}hostUpdate(){}hostUpdated(){}};export{F as Badge,k as Button,tt as Grid,C as Icon,j as Popover,kt as ProductFormController,$ as Select,L as Swatch,B as Swatches};