mtrl 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/textfield/features/placement.d.ts +1 -1
- package/dist/core/compose/features/textinput.d.ts +4 -0
- package/dist/index.cjs +15 -15
- package/dist/index.cjs.map +5 -5
- package/dist/index.js +15 -15
- package/dist/index.js.map +5 -5
- package/dist/package.json +1 -1
- package/dist/styles.css +2 -2
- package/package.json +13 -3
package/dist/index.cjs
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* mtrl v0.4.
|
|
2
|
+
* mtrl v0.4.5
|
|
3
3
|
* A functional TypeScript component library based on Material Design 3
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
var{defineProperty:C8,getOwnPropertyNames:a3,getOwnPropertyDescriptor:c3}=Object,i3=Object.prototype.hasOwnProperty;var K4=new WeakMap,o3=(J)=>{var $=K4.get(J),Q;if($)return $;if($=C8({},"__esModule",{value:!0}),J&&typeof J==="object"||typeof J==="function")a3(J).map((Z)=>!i3.call($,Z)&&C8($,Z,{get:()=>J[Z],enumerable:!(Q=c3(J,Z))||Q.enumerable}));return K4.set(J,$),$};var E8=(J,$)=>{for(var Q in $)C8(J,Q,{get:$[Q],enumerable:!0,configurable:!0,set:(Z)=>$[Q]=()=>Z})};var T=(J,$)=>()=>(J&&($=J(J=0)),$);var b=(...J)=>($)=>J.reduce((Q,Z)=>Z(Q),$),G4=(...J)=>($)=>J.reduceRight((Q,Z)=>Z(Q),$),z4=(...J)=>($,Q={})=>J.reduce((Z,q)=>({...Z,...q(Z,Q)}),$);var W4=(J={})=>({element:null,config:J,setup(){return this}});var h8=(J,$={})=>{return Object.entries($).forEach(([Q,Z])=>{if(Z===null||Z===void 0)return;J.setAttribute(Q,String(Z))}),J},Y4=(J,$=[])=>{return $.forEach((Q)=>J.removeAttribute(Q)),J};var u="mtrl",U4=(J)=>`mtrl-${J}`,X4=(J,$)=>`${J}--${$}`,B4=(J,$)=>`${J}-${$}`,u8,f8,F4;var y6=T(()=>{((j)=>{j.BUTTON="button";j.TEXTFIELD="textfield";j.CONTAINER="container";j.SNACKBAR="snackbar";j.SWITCH="switch"})(u8||={});((j)=>{j.DISABLED="disabled";j.FOCUSED="focused";j.ACTIVE="active";j.LOADING="loading";j.ERROR="error"})(f8||={});F4={bem:(J,$,Q)=>{let Z=J;if($)Z+=`-${$}`;if(Q)Z+=`--${Q}`;return Z},join:(...J)=>J.filter(Boolean).join(" ")}});var V9,o6=(...J)=>{let $=J.flat().reduce((Z,q)=>{if(typeof q==="string")Z.push(...q.split(/\s+/));return Z},[]).filter(Boolean),Q=new Set;return $.forEach((Z)=>Q.add(Z)),Array.from(Q)},f=(J,...$)=>{let Q=o6(...$);if(!Q.length)return J;let Z=[];for(let q=0;q<Q.length;q++){let j=Q[q];if(!j)continue;Z.push(j.startsWith(V9)?j:V9+j)}if(Z.length)J.classList.add(...Z);return J},q6=(J,...$)=>{let Q=o6(...$);if(!Q.length)return J;let Z=[];for(let q=0;q<Q.length;q++){let j=Q[q];if(!j)continue;Z.push(j.startsWith(V9)?j:V9+j)}if(Z.length)J.classList.remove(...Z);return J},g8=(J,...$)=>{let Q=o6(...$);for(let Z=0;Z<Q.length;Z++){let q=Q[Z];if(!q)continue;let j=q.startsWith(V9)?q:V9+q;J.classList.toggle(j)}return J},O6=(J,...$)=>{let Q=o6(...$);if(!Q.length)return!0;for(let Z=0;Z<Q.length;Z++){let q=Q[Z];if(!q)continue;let j=q.startsWith(V9)?q:V9+q;if(!J.classList.contains(j))return!1}return!0};var T9=T(()=>{y6();V9=`${u}-`});var t3,H4=(J,$,Q)=>{if(!$||!Q?.emit&&!Q?.on)return;J.__eventHandlers={};for(let Z in $){let q=$[Z],j=(G)=>{let K=!0;if(typeof q==="function")try{let z={...Q,element:J};K=q(z,G)}catch(z){console.warn(`Error in event condition for ${Z}:`,z),K=!1}else K=Boolean(q);if(K){if(Q.emit)Q.emit(Z,{event:G,element:J,originalEvent:G});else if(Q.on)J.dispatchEvent(new CustomEvent(Z,{detail:{event:G,element:J,originalEvent:G},bubbles:!0,cancelable:!0}))}};J.__eventHandlers[Z]=j,J.addEventListener(Z,j)}},k4=(J,{html:$,text:Q,id:Z})=>{if($)J.innerHTML=$;if(Q)J.textContent=Q;if(Z)J.id=Z},M4=(J,$,Q)=>{if($)f(J,$);if(Q){let Z=o6(Q);if(Z.length)J.classList.add(...Z)}},V4=(J,$,Q,Z)=>{if($)$.appendChild(J);if(Q)Q(J,Z);return J},v=(J={})=>{let{tag:$="div",container:Q=null,html:Z="",text:q="",id:j="",data:G={},class:K,className:z,rawClass:W,attributes:Y={},forwardEvents:U={},onCreate:X,context:_,...H}=J,B=document.createElement($);k4(B,{html:Z,text:q,id:j}),M4(B,K||z,W);for(let k in G)B.dataset[k]=G[k];let M={...Y,...H};for(let k in M){let N=M[k];if(N!=null)B.setAttribute(k,String(N))}return H4(B,U,_),V4(B,Q,X,_)},N4=(J={})=>{let{tag:$="svg",container:Q=null,html:Z="",text:q="",id:j="",class:G,className:K,rawClass:z,attributes:W={},forwardEvents:Y={},onCreate:U,context:X,..._}=J;if(!t3.includes($.toLowerCase()))console.warn(`Warning: '${$}' is not a standard SVG element tag.`);let H=document.createElementNS("http://www.w3.org/2000/svg",$);k4(H,{html:Z,text:q,id:j}),M4(H,G||K,z);let B={...W,..._};for(let M in B){let k=B[M];if(k!=null)H.setAttributeNS(null,M,String(k))}return H4(H,Y,X),V4(H,Q,U,X)},_4=(J)=>{let $=J.__eventHandlers;if($){for(let Q in $)J.removeEventListener(Q,$[Q]);delete J.__eventHandlers}};var A6=T(()=>{T9();T9();t3=["svg","circle","ellipse","line","path","polygon","polyline","rect","g","text","tspan","textPath","defs","clipPath","mask","pattern","marker","linearGradient","radialGradient","stop","use","foreignObject","desc","title","metadata","symbol","switch"]});function n3(J){return"touches"in J}function e3(J){return"clientX"in J&&"clientY"in J}var L4=()=>{let J=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),$=window.innerWidth<=768;return J||$},N$,N9,d8,v6=()=>{return"ontouchstart"in window||navigator.maxTouchPoints>0},p6=(J)=>{if(n3(J)&&J.touches.length>0){let $=J.touches[0];return{clientX:$.clientX,clientY:$.clientY,pageX:$.pageX,pageY:$.pageY,target:J.target,preventDefault:()=>J.preventDefault(),stopPropagation:()=>J.stopPropagation(),type:J.type}}if(e3(J))return{clientX:J.clientX,clientY:J.clientY,pageX:J.pageX,pageY:J.pageY,target:J.target,preventDefault:()=>J.preventDefault(),stopPropagation:()=>J.stopPropagation(),type:J.type};return{clientX:0,clientY:0,pageX:0,pageY:0,target:J.target,preventDefault:()=>J.preventDefault(),stopPropagation:()=>J.stopPropagation(),type:J.type}};var D7=T(()=>{N$={passive:!0},N9={TARGET_SIZE:44,FEEDBACK_DURATION:200,TAP_THRESHOLD:250,SWIPE_THRESHOLD:50},d8={MINIMUM:44,COMFORTABLE:48,LARGE:56}});var $q=(J)=>({getClass:($)=>`${J}-${$}`,getModifierClass:($,Q)=>`${$}--${Q}`,getElementClass:($,Q)=>`${$}-${Q}`}),S=(J={})=>({config:J,componentName:J.componentName,...$q(J.prefix||"mtrl"),touchState:{startTime:0,startPosition:{x:0,y:0},isTouching:!1,activeTarget:null},updateTouchState($,Q){let Z=p6($);if(Q==="start")this.touchState={startTime:Date.now(),startPosition:{x:Z.clientX,y:Z.clientY},isTouching:!0,activeTarget:Z.target};else if(Q==="end")this.touchState.isTouching=!1,this.touchState.activeTarget=null}}),E=(J={})=>($)=>{let Q=(W)=>{if(j.updateTouchState(W,"start"),z.classList.add(`${j.getClass("touch-active")}`),J.forwardEvents?.touchstart&&"emit"in $)$.emit("touchstart",p6(W))},Z=(W)=>{if(!j.touchState.isTouching)return;let Y=Date.now()-j.touchState.startTime;if(z.classList.remove(`${j.getClass("touch-active")}`),j.updateTouchState(W,"end"),Y<N9.TAP_THRESHOLD&&"emit"in $)$.emit("tap",p6(W));if(J.forwardEvents?.touchend&&"emit"in $)$.emit("touchend",p6(W))},q=(W)=>{if(!j.touchState.isTouching)return;let Y=p6(W),U=Y.clientX-j.touchState.startPosition.x,X=Y.clientY-j.touchState.startPosition.y;if(Math.abs(U)>N9.SWIPE_THRESHOLD&&"emit"in $)$.emit("swipe",{direction:U>0?"right":"left",deltaX:U,deltaY:X});if(J.forwardEvents?.touchmove&&"emit"in $)$.emit("touchmove",{...Y,deltaX:U,deltaY:X})},j=$,G=$.config.parent||J.parent;if(typeof G==="string")G=document.querySelector(G);let K={tag:J.tag||"div",className:[j.getClass(J.componentName||j.componentName||"component"),v6()&&J.interactive?j.getClass("interactive"):null,...Array.isArray(J.className)?J.className:[J.className]].filter(Boolean),attributes:J.attributes||{},forwardEvents:J.forwardEvents||{},context:$,container:G},z=v(K);if(v6()&&J.interactive)z.addEventListener("touchstart",Q,N$),z.addEventListener("touchend",Z),z.addEventListener("touchmove",q,N$);return{...$,element:z,addClass(...W){return z.classList.add(...W.filter(Boolean)),this},destroy(){if(v6()&&J.interactive)z.removeEventListener("touchstart",Q),z.removeEventListener("touchend",Z),z.removeEventListener("touchmove",q);_4(z),z.remove()}}};var c=T(()=>{A6();D7()});var C6=()=>{let J=new Map;return{on:($,Q)=>{let Z=J.get($)||[];return J.set($,[...Z,Q]),()=>{let q=J.get($)||[];J.set($,q.filter((j)=>j!==Q))}},off($,Q){let Z=J.get($)||[];J.set($,Z.filter((q)=>q!==Q))},emit:($,...Q)=>{(J.get($)||[]).forEach((q)=>q(...Q))},clear:()=>{J.clear()}}};var g=()=>(J)=>{let $=C6();return{...J,on(Q,Z){return $.on(Q,Z),this},off(Q,Z){return $.off(Q,Z),this},emit(Q,Z){return $.emit(Q,Z),this}}};var D4=()=>{};var Jq=(J,$={})=>{let Q=null,Z=$.prefix||"mtrl",q=(j)=>{let G=document.createElement("span");return G.className=`${Z}-${$.componentName||"component"}-text`,G.textContent=j,G};return{setText(j){if(!Q&&j)if(Q=q(j),$.beforeElement)J.insertBefore(Q,$.beforeElement);else J.appendChild(Q);else if(Q)Q.textContent=j;return this},getText(){return Q?Q.textContent||"":""},getElement(){return Q}}},K9=(J)=>($)=>{let Q=Jq($.element,{prefix:J.prefix,componentName:J.componentName||"component"});if(J.text)Q.setText(J.text);return{...$,text:Q}};var Qq=(J,$={})=>{let Q=null,Z=$.prefix||"mtrl",q=(j)=>{let G=document.createElement("span");G.className=`${Z}-icon`;let K=`${Z}-${$.componentName||"component"}-icon`;if(G.classList.add(K),$.iconSize)G.classList.add(`${Z}-icon--${$.iconSize}`);return G.innerHTML=j,G};return{setIcon(j){if(!Q&&j)if(Q=q(j),$.iconPosition==="end")J.appendChild(Q);else J.insertBefore(Q,J.firstChild);else if(Q&&j)Q.innerHTML=j;return this},getIcon(){return Q?Q.innerHTML:""},getElement(){return Q}}},Zq=(J,$)=>{let{text:Q,icon:Z}=$,q=`${J.getClass("button")}--circular`;if(!Q&&Z)J.element.classList.add(q);else J.element.classList.remove(q)},G9=(J)=>($)=>{let Q=Qq($.element,{prefix:J.prefix,componentName:J.componentName||"component",iconPosition:J.iconPosition,iconSize:J.iconSize});if(J.icon)Q.setIcon(J.icon);if($.componentName==="button"){if(!J.text)Zq($,J);else if(J.icon&&J.text)$.element.classList.add(`${$.getClass("button")}--icon`)}return{...$,icon:Q}};var K6=(J)=>($)=>{if(J.variant&&$.element){let Q=`${J.prefix}-${J.componentName}--${J.variant}`;$.element.classList.add(Q)}return $};var O7=(J)=>($)=>{if(J.size&&$.element){let Q=`${J.prefix}-${J.componentName}--${J.size}`;$.element.classList.add(Q)}return $};var O4,P7=(J)=>($)=>{if(!J.position||!$.element)return $;let Q=O4[J.position.toUpperCase()]||J.position,Z=`${J.prefix}-${J.componentName}--${Q}`;return $.element.classList.add(Z),{...$,position:{setPosition(j){let G=Q,K=`${J.prefix}-${J.componentName}--${G}`,z=`${J.prefix}-${J.componentName}--${j}`;return $.element.classList.remove(K),$.element.classList.add(z),this},getPosition(){return Q}}}};var P4=T(()=>{((K)=>{K.LEFT="left";K.RIGHT="right";K.TOP="top";K.BOTTOM="bottom";K.START="start";K.END="end";K.CENTER="center"})(O4||={})});var R4,n9,QG;var A4=T(()=>{((G)=>{G.LINEAR="linear";G.EASE="ease";G.EASE_IN="ease-in";G.EASE_OUT="ease-out";G.EASE_IN_OUT="ease-in-out";G.MATERIAL="cubic-bezier(0.4, 0.0, 0.2, 1)"})(R4||={});n9={duration:450,timing:"cubic-bezier(0.4, 0.0, 0.2, 1)",opacity:["0.4","0"]},QG={duration:{type:"number",minimum:0,default:n9.duration},timing:{type:"string",enum:Object.values(R4),default:n9.timing},opacity:{type:"array",items:{type:"string",pattern:"^[0-1](\\.\\d+)?$"},minItems:2,maxItems:2,default:n9.opacity}}});var qq=(J={})=>{let $={...n9,...J,opacity:J.opacity||n9.opacity},Q=new WeakMap,Z=[],q=()=>{let z=document.createElement("div");return z.className=`${u}-ripple-wave`,z},j=(z,W)=>{if(typeof document.addEventListener==="function")document.addEventListener(z,W),Z.push({event:z,handler:W})},G=(z,W)=>{if(typeof document.removeEventListener==="function")document.removeEventListener(z,W),Z=Z.filter((Y)=>!(Y.event===z&&Y.handler===W))},K=(z,W)=>{if(!W||!W.__rippleContainer)return;let Y=W.__rippleContainer,U=W.getBoundingClientRect(),X=q(),_=Math.max(U.width,U.height)*2,H=z.clientX-U.left-_/2,B=z.clientY-U.top-_/2;Object.assign(X.style,{width:`${_}px`,height:`${_}px`,left:`${H}px`,top:`${B}px`}),Y.appendChild(X),X.offsetHeight,requestAnimationFrame(()=>{X.classList.add("active")});let M=()=>{G("mouseup",M),G("mouseleave",M),X.classList.remove("active"),X.classList.add("fade-out"),setTimeout(()=>{if(X.parentNode)X.parentNode.removeChild(X);Q.get(W)?.delete(X)},$.duration)};j("mouseup",M),j("mouseleave",M)};return{mount:(z)=>{if(!z)return;if(window.getComputedStyle(z).position==="static")z.style.position="relative";let Y=z.querySelector(`.${u}-ripple`);if(!Y)Y=document.createElement("div"),Y.className=`${u}-ripple`,z.appendChild(Y);z.__rippleContainer=Y,Q.set(z,new Set);let U=(X)=>K(X,z);if(!z.__rippleHandlers)z.__rippleHandlers=[];z.__rippleHandlers.push(U),z.addEventListener("mousedown",U)},unmount:(z)=>{if(!z)return;if(Z.forEach(({event:W,handler:Y})=>{G(W,Y)}),Z=[],z.__rippleHandlers)z.__rippleHandlers.forEach((W)=>{z.removeEventListener("mousedown",W)}),z.__rippleHandlers=[];if(Q.has(z)){let W=Q.get(z);if(W)W.forEach((Y)=>{if(Y.parentNode)Y.parentNode.removeChild(Y)});Q.delete(z)}if(z.__rippleContainer&&z.__rippleContainer.parentNode)z.__rippleContainer.parentNode.removeChild(z.__rippleContainer),delete z.__rippleContainer}}},T6=(J)=>($)=>{if(!J.ripple)return $;let Q=qq(J.rippleConfig);if(Q.mount($.element),$.lifecycle){let Z=$.lifecycle.mount,q=$.lifecycle.destroy;$.lifecycle.mount=()=>{Z.call($.lifecycle)},$.lifecycle.destroy=()=>{Q.unmount($.element),q.call($.lifecycle)}}return{...$,ripple:Q}};var w4=T(()=>{A4();y6()});function x4(J){return"emit"in J&&typeof J.emit==="function"}var I9=(J={})=>($)=>{let Q=document.createElement("input"),Z=$.componentName||"component";Q.type="checkbox",Q.className=`${$.getClass(Z)}-input`,Q.style.position="absolute",Q.style.opacity="0",Q.style.cursor="pointer",$.element.setAttribute("role","presentation"),Q.setAttribute("role",Z);let q={name:J.name,checked:J.checked,required:J.required,disabled:J.disabled,value:J.value||"on","aria-label":J.label||J.ariaLabel};return Object.entries(q).forEach(([j,G])=>{if(G!==null&&G!==void 0)if(j==="disabled"&&G===!0)Q.disabled=!0,Q.setAttribute("disabled","true");else if(G===!0)Q.setAttribute(j,j);else Q.setAttribute(j,String(G))}),Q.addEventListener("change",(j)=>{if(x4($))$.emit("change",{checked:Q.checked,value:Q.value,nativeEvent:j})}),Q.addEventListener("keydown",(j)=>{if(j.key===" "||j.key==="Enter"){if(j.preventDefault(),!Q.disabled)Q.checked=!Q.checked,Q.dispatchEvent(new Event("change",{bubbles:!0}))}}),$.element.appendChild(Q),{...$,input:Q,getValue:()=>Q.value,setValue(j){if(Q.value=j,x4($))$.emit("value",{value:j});return this}}};var S9=(J={})=>($)=>{if(!$.input)return $;let Q=$.componentName||"component",Z=()=>{$.element.classList.toggle(`${$.getClass(Q)}--checked`,$.input.checked)};if(J.checked!==void 0)$.input.checked=J.checked;if(Z(),$.emit)$.on?.("change",Z);return{...$,checkable:{check(){if(!$.input.checked)$.input.checked=!0,Z(),$.emit?.("change",{checked:!0,value:$.input.value});return this},uncheck(){if($.input.checked)$.input.checked=!1,Z(),$.emit?.("change",{checked:!1,value:$.input.value});return this},toggle(){return $.input.checked=!$.input.checked,Z(),$.emit?.("change",{checked:$.input.checked,value:$.input.value}),this},isChecked(){return $.input.checked}}}};var l8=(J={})=>($)=>{if(J.variant)$.element.classList.add(`${$.getClass("button")}--${J.variant}`);if(J.size)$.element.classList.add(`${$.getClass("button")}--${J.size}`);return $};function k6(J){return"lifecycle"in J&&J.lifecycle&&typeof J.lifecycle==="object"&&"destroy"in J.lifecycle&&typeof J.lifecycle.destroy==="function"}function N6(J){return"emit"in J&&typeof J.emit==="function"}var R7=(J={})=>($)=>{let Q=J.multiline||J.type==="multiline",Z=document.createElement(Q?"textarea":"input");Z.className=`${$.getClass("textfield")}-input`;let q={name:J.name,required:J.required,disabled:J.disabled,maxLength:J.maxLength,pattern:J.pattern,autocomplete:J.autocomplete,value:J.value||""};if(!Q)q.type=J.type||"text";else q["data-type"]="multiline";Object.entries(q).forEach(([K,z])=>{if(z!==null&&z!==void 0)if(typeof z==="boolean"){if(z)Z.setAttribute(K,"")}else Z.setAttribute(K,String(z))});let j=()=>{let K=!Z.value;return $.element.classList.toggle(`${$.getClass("textfield")}--empty`,K),K},G=()=>{if(Z.matches(":-webkit-autofill")||window.getComputedStyle(Z).backgroundColor==="rgb(250, 255, 189)"||window.getComputedStyle(Z).backgroundColor==="rgb(232, 240, 254)"){if($.element.classList.remove(`${$.getClass("textfield")}--empty`),N6($))$.emit("input",{value:Z.value,isEmpty:!1,isAutofilled:!0})}};if(Z.addEventListener("focus",()=>{if($.element.classList.add(`${$.getClass("textfield")}--focused`),N6($))$.emit("focus",{isEmpty:j()});setTimeout(G,100)}),Z.addEventListener("blur",()=>{if($.element.classList.remove(`${$.getClass("textfield")}--focused`),N6($))$.emit("blur",{isEmpty:j()})}),Z.addEventListener("input",()=>{if(N6($))$.emit("input",{value:Z.value,isEmpty:j(),isAutofilled:!1});else j()}),j(),Q)$.element.classList.add(`${$.getClass("textfield")}--multiline`);if($.element.appendChild(Z),k6($)){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),K.call($.lifecycle)}}return{...$,input:Z,setValue(K){return Z.value=K||"",j(),this},getValue(){return Z.value},setAttribute(K,z){return Z.setAttribute(K,z),this},getAttribute(K){return Z.getAttribute(K)},removeAttribute(K){return Z.removeAttribute(K),this}}};var y4=()=>{};var z9=(J={})=>($)=>{if(!J.label)return $;let Q=document.createElement("label");Q.className=`${J.prefix}-${J.componentName}-label`,Q.textContent=J.label;let Z=J.labelPosition||"start";if(Z==="start")if($.element.firstChild)$.element.insertBefore(Q,$.element.firstChild);else $.element.appendChild(Q);else $.element.appendChild(Q);if(Z&&$.componentName!=="slider")$.element.classList.add(`${J.prefix}-${J.componentName}--label-${Z}`);return{...$,label:{setText(j){return Q.textContent=j,this},getText(){return Q.textContent||""},getElement(){return Q}}}};var jq=`
|
|
6
|
+
var{defineProperty:C8,getOwnPropertyNames:a3,getOwnPropertyDescriptor:c3}=Object,i3=Object.prototype.hasOwnProperty;var K4=new WeakMap,o3=(J)=>{var $=K4.get(J),Q;if($)return $;if($=C8({},"__esModule",{value:!0}),J&&typeof J==="object"||typeof J==="function")a3(J).map((Z)=>!i3.call($,Z)&&C8($,Z,{get:()=>J[Z],enumerable:!(Q=c3(J,Z))||Q.enumerable}));return K4.set(J,$),$};var E8=(J,$)=>{for(var Q in $)C8(J,Q,{get:$[Q],enumerable:!0,configurable:!0,set:(Z)=>$[Q]=()=>Z})};var T=(J,$)=>()=>(J&&($=J(J=0)),$);var b=(...J)=>($)=>J.reduce((Q,Z)=>Z(Q),$),G4=(...J)=>($)=>J.reduceRight((Q,Z)=>Z(Q),$),z4=(...J)=>($,Q={})=>J.reduce((Z,q)=>({...Z,...q(Z,Q)}),$);var W4=(J={})=>({element:null,config:J,setup(){return this}});var h8=(J,$={})=>{return Object.entries($).forEach(([Q,Z])=>{if(Z===null||Z===void 0)return;J.setAttribute(Q,String(Z))}),J},Y4=(J,$=[])=>{return $.forEach((Q)=>J.removeAttribute(Q)),J};var u="mtrl",U4=(J)=>`mtrl-${J}`,X4=(J,$)=>`${J}--${$}`,B4=(J,$)=>`${J}-${$}`,u8,f8,F4;var y6=T(()=>{((j)=>{j.BUTTON="button";j.TEXTFIELD="textfield";j.CONTAINER="container";j.SNACKBAR="snackbar";j.SWITCH="switch"})(u8||={});((j)=>{j.DISABLED="disabled";j.FOCUSED="focused";j.ACTIVE="active";j.LOADING="loading";j.ERROR="error"})(f8||={});F4={bem:(J,$,Q)=>{let Z=J;if($)Z+=`-${$}`;if(Q)Z+=`--${Q}`;return Z},join:(...J)=>J.filter(Boolean).join(" ")}});var N9,o6=(...J)=>{let $=J.flat().reduce((Z,q)=>{if(typeof q==="string")Z.push(...q.split(/\s+/));return Z},[]).filter(Boolean),Q=new Set;return $.forEach((Z)=>Q.add(Z)),Array.from(Q)},f=(J,...$)=>{let Q=o6(...$);if(!Q.length)return J;let Z=[];for(let q=0;q<Q.length;q++){let j=Q[q];if(!j)continue;Z.push(j.startsWith(N9)?j:N9+j)}if(Z.length)J.classList.add(...Z);return J},q6=(J,...$)=>{let Q=o6(...$);if(!Q.length)return J;let Z=[];for(let q=0;q<Q.length;q++){let j=Q[q];if(!j)continue;Z.push(j.startsWith(N9)?j:N9+j)}if(Z.length)J.classList.remove(...Z);return J},g8=(J,...$)=>{let Q=o6(...$);for(let Z=0;Z<Q.length;Z++){let q=Q[Z];if(!q)continue;let j=q.startsWith(N9)?q:N9+q;J.classList.toggle(j)}return J},O6=(J,...$)=>{let Q=o6(...$);if(!Q.length)return!0;for(let Z=0;Z<Q.length;Z++){let q=Q[Z];if(!q)continue;let j=q.startsWith(N9)?q:N9+q;if(!J.classList.contains(j))return!1}return!0};var T9=T(()=>{y6();N9=`${u}-`});var t3,H4=(J,$,Q)=>{if(!$||!Q?.emit&&!Q?.on)return;J.__eventHandlers={};for(let Z in $){let q=$[Z],j=(K)=>{let G=!0;if(typeof q==="function")try{let W={...Q,element:J};G=q(W,K)}catch(W){console.warn(`Error in event condition for ${Z}:`,W),G=!1}else G=Boolean(q);if(G){if(Q.emit)Q.emit(Z,{event:K,element:J,originalEvent:K});else if(Q.on)J.dispatchEvent(new CustomEvent(Z,{detail:{event:K,element:J,originalEvent:K},bubbles:!0,cancelable:!0}))}};J.__eventHandlers[Z]=j,J.addEventListener(Z,j)}},M4=(J,{html:$,text:Q,id:Z})=>{if($)J.innerHTML=$;if(Q)J.textContent=Q;if(Z)J.id=Z},k4=(J,$,Q)=>{if($)f(J,$);if(Q){let Z=o6(Q);if(Z.length)J.classList.add(...Z)}},N4=(J,$,Q,Z)=>{if($)$.appendChild(J);if(Q)Q(J,Z);return J},v=(J={})=>{let{tag:$="div",container:Q=null,html:Z="",text:q="",id:j="",data:K={},class:G,className:W,rawClass:z,attributes:Y={},forwardEvents:U={},onCreate:X,context:_,...H}=J,B=document.createElement($);M4(B,{html:Z,text:q,id:j}),k4(B,G||W,z);for(let M in K)B.dataset[M]=K[M];let k={...Y,...H};for(let M in k){let V=k[M];if(V!=null)B.setAttribute(M,String(V))}return H4(B,U,_),N4(B,Q,X,_)},V4=(J={})=>{let{tag:$="svg",container:Q=null,html:Z="",text:q="",id:j="",class:K,className:G,rawClass:W,attributes:z={},forwardEvents:Y={},onCreate:U,context:X,..._}=J;if(!t3.includes($.toLowerCase()))console.warn(`Warning: '${$}' is not a standard SVG element tag.`);let H=document.createElementNS("http://www.w3.org/2000/svg",$);M4(H,{html:Z,text:q,id:j}),k4(H,K||G,W);let B={...z,..._};for(let k in B){let M=B[k];if(M!=null)H.setAttributeNS(null,k,String(M))}return H4(H,Y,X),N4(H,Q,U,X)},_4=(J)=>{let $=J.__eventHandlers;if($){for(let Q in $)J.removeEventListener(Q,$[Q]);delete J.__eventHandlers}};var A6=T(()=>{T9();T9();t3=["svg","circle","ellipse","line","path","polygon","polyline","rect","g","text","tspan","textPath","defs","clipPath","mask","pattern","marker","linearGradient","radialGradient","stop","use","foreignObject","desc","title","metadata","symbol","switch"]});function n3(J){return"touches"in J}function e3(J){return"clientX"in J&&"clientY"in J}var L4=()=>{let J=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),$=window.innerWidth<=768;return J||$},V$,V9,d8,v6=()=>{return"ontouchstart"in window||navigator.maxTouchPoints>0},p6=(J)=>{if(n3(J)&&J.touches.length>0){let $=J.touches[0];return{clientX:$.clientX,clientY:$.clientY,pageX:$.pageX,pageY:$.pageY,target:J.target,preventDefault:()=>J.preventDefault(),stopPropagation:()=>J.stopPropagation(),type:J.type}}if(e3(J))return{clientX:J.clientX,clientY:J.clientY,pageX:J.pageX,pageY:J.pageY,target:J.target,preventDefault:()=>J.preventDefault(),stopPropagation:()=>J.stopPropagation(),type:J.type};return{clientX:0,clientY:0,pageX:0,pageY:0,target:J.target,preventDefault:()=>J.preventDefault(),stopPropagation:()=>J.stopPropagation(),type:J.type}};var D7=T(()=>{V$={passive:!0},V9={TARGET_SIZE:44,FEEDBACK_DURATION:200,TAP_THRESHOLD:250,SWIPE_THRESHOLD:50},d8={MINIMUM:44,COMFORTABLE:48,LARGE:56}});var $q=(J)=>({getClass:($)=>`${J}-${$}`,getModifierClass:($,Q)=>`${$}--${Q}`,getElementClass:($,Q)=>`${$}-${Q}`}),S=(J={})=>({config:J,componentName:J.componentName,...$q(J.prefix||"mtrl"),touchState:{startTime:0,startPosition:{x:0,y:0},isTouching:!1,activeTarget:null},updateTouchState($,Q){let Z=p6($);if(Q==="start")this.touchState={startTime:Date.now(),startPosition:{x:Z.clientX,y:Z.clientY},isTouching:!0,activeTarget:Z.target};else if(Q==="end")this.touchState.isTouching=!1,this.touchState.activeTarget=null}}),E=(J={})=>($)=>{let Q=(z)=>{if(j.updateTouchState(z,"start"),W.classList.add(`${j.getClass("touch-active")}`),J.forwardEvents?.touchstart&&"emit"in $)$.emit("touchstart",p6(z))},Z=(z)=>{if(!j.touchState.isTouching)return;let Y=Date.now()-j.touchState.startTime;if(W.classList.remove(`${j.getClass("touch-active")}`),j.updateTouchState(z,"end"),Y<V9.TAP_THRESHOLD&&"emit"in $)$.emit("tap",p6(z));if(J.forwardEvents?.touchend&&"emit"in $)$.emit("touchend",p6(z))},q=(z)=>{if(!j.touchState.isTouching)return;let Y=p6(z),U=Y.clientX-j.touchState.startPosition.x,X=Y.clientY-j.touchState.startPosition.y;if(Math.abs(U)>V9.SWIPE_THRESHOLD&&"emit"in $)$.emit("swipe",{direction:U>0?"right":"left",deltaX:U,deltaY:X});if(J.forwardEvents?.touchmove&&"emit"in $)$.emit("touchmove",{...Y,deltaX:U,deltaY:X})},j=$,K=$.config.parent||J.parent;if(typeof K==="string")K=document.querySelector(K);let G={tag:J.tag||"div",className:[j.getClass(J.componentName||j.componentName||"component"),v6()&&J.interactive?j.getClass("interactive"):null,...Array.isArray(J.className)?J.className:[J.className]].filter(Boolean),attributes:J.attributes||{},forwardEvents:J.forwardEvents||{},context:$,container:K},W=v(G);if(v6()&&J.interactive)W.addEventListener("touchstart",Q,V$),W.addEventListener("touchend",Z),W.addEventListener("touchmove",q,V$);return{...$,element:W,addClass(...z){return W.classList.add(...z.filter(Boolean)),this},destroy(){if(v6()&&J.interactive)W.removeEventListener("touchstart",Q),W.removeEventListener("touchend",Z),W.removeEventListener("touchmove",q);_4(W),W.remove()}}};var c=T(()=>{A6();D7()});var C6=()=>{let J=new Map;return{on:($,Q)=>{let Z=J.get($)||[];return J.set($,[...Z,Q]),()=>{let q=J.get($)||[];J.set($,q.filter((j)=>j!==Q))}},off($,Q){let Z=J.get($)||[];J.set($,Z.filter((q)=>q!==Q))},emit:($,...Q)=>{(J.get($)||[]).forEach((q)=>q(...Q))},clear:()=>{J.clear()}}};var g=()=>(J)=>{let $=C6();return{...J,on(Q,Z){return $.on(Q,Z),this},off(Q,Z){return $.off(Q,Z),this},emit(Q,Z){return $.emit(Q,Z),this}}};var D4=()=>{};var Jq=(J,$={})=>{let Q=null,Z=$.prefix||"mtrl",q=(j)=>{let K=document.createElement("span");return K.className=`${Z}-${$.componentName||"component"}-text`,K.textContent=j,K};return{setText(j){if(!Q&&j)if(Q=q(j),$.beforeElement)J.insertBefore(Q,$.beforeElement);else J.appendChild(Q);else if(Q)Q.textContent=j;return this},getText(){return Q?Q.textContent||"":""},getElement(){return Q}}},K9=(J)=>($)=>{let Q=Jq($.element,{prefix:J.prefix,componentName:J.componentName||"component"});if(J.text)Q.setText(J.text);return{...$,text:Q}};var Qq=(J,$={})=>{let Q=null,Z=$.prefix||"mtrl",q=(j)=>{let K=document.createElement("span");K.className=`${Z}-icon`;let G=`${Z}-${$.componentName||"component"}-icon`;if(K.classList.add(G),$.iconSize)K.classList.add(`${Z}-icon--${$.iconSize}`);return K.innerHTML=j,K};return{setIcon(j){if(!Q&&j)if(Q=q(j),$.iconPosition==="end")J.appendChild(Q);else J.insertBefore(Q,J.firstChild);else if(Q&&j)Q.innerHTML=j;return this},getIcon(){return Q?Q.innerHTML:""},getElement(){return Q}}},Zq=(J,$)=>{let{text:Q,icon:Z}=$,q=`${J.getClass("button")}--circular`;if(!Q&&Z)J.element.classList.add(q);else J.element.classList.remove(q)},G9=(J)=>($)=>{let Q=Qq($.element,{prefix:J.prefix,componentName:J.componentName||"component",iconPosition:J.iconPosition,iconSize:J.iconSize});if(J.icon)Q.setIcon(J.icon);if($.componentName==="button"){if(!J.text)Zq($,J);else if(J.icon&&J.text)$.element.classList.add(`${$.getClass("button")}--icon`)}return{...$,icon:Q}};var K6=(J)=>($)=>{if(J.variant&&$.element){let Q=`${J.prefix}-${J.componentName}--${J.variant}`;$.element.classList.add(Q)}return $};var O7=(J)=>($)=>{if(J.size&&$.element){let Q=`${J.prefix}-${J.componentName}--${J.size}`;$.element.classList.add(Q)}return $};var O4,P7=(J)=>($)=>{if(!J.position||!$.element)return $;let Q=O4[J.position.toUpperCase()]||J.position,Z=`${J.prefix}-${J.componentName}--${Q}`;return $.element.classList.add(Z),{...$,position:{setPosition(j){let K=Q,G=`${J.prefix}-${J.componentName}--${K}`,W=`${J.prefix}-${J.componentName}--${j}`;return $.element.classList.remove(G),$.element.classList.add(W),this},getPosition(){return Q}}}};var P4=T(()=>{((G)=>{G.LEFT="left";G.RIGHT="right";G.TOP="top";G.BOTTOM="bottom";G.START="start";G.END="end";G.CENTER="center"})(O4||={})});var R4,n9,QG;var A4=T(()=>{((K)=>{K.LINEAR="linear";K.EASE="ease";K.EASE_IN="ease-in";K.EASE_OUT="ease-out";K.EASE_IN_OUT="ease-in-out";K.MATERIAL="cubic-bezier(0.4, 0.0, 0.2, 1)"})(R4||={});n9={duration:450,timing:"cubic-bezier(0.4, 0.0, 0.2, 1)",opacity:["0.4","0"]},QG={duration:{type:"number",minimum:0,default:n9.duration},timing:{type:"string",enum:Object.values(R4),default:n9.timing},opacity:{type:"array",items:{type:"string",pattern:"^[0-1](\\.\\d+)?$"},minItems:2,maxItems:2,default:n9.opacity}}});var qq=(J={})=>{let $={...n9,...J,opacity:J.opacity||n9.opacity},Q=new WeakMap,Z=[],q=()=>{let W=document.createElement("div");return W.className=`${u}-ripple-wave`,W},j=(W,z)=>{if(typeof document.addEventListener==="function")document.addEventListener(W,z),Z.push({event:W,handler:z})},K=(W,z)=>{if(typeof document.removeEventListener==="function")document.removeEventListener(W,z),Z=Z.filter((Y)=>!(Y.event===W&&Y.handler===z))},G=(W,z)=>{if(!z||!z.__rippleContainer)return;let Y=z.__rippleContainer,U=z.getBoundingClientRect(),X=q(),_=Math.max(U.width,U.height)*2,H=W.clientX-U.left-_/2,B=W.clientY-U.top-_/2;Object.assign(X.style,{width:`${_}px`,height:`${_}px`,left:`${H}px`,top:`${B}px`}),Y.appendChild(X),X.offsetHeight,requestAnimationFrame(()=>{X.classList.add("active")});let k=()=>{K("mouseup",k),K("mouseleave",k),X.classList.remove("active"),X.classList.add("fade-out"),setTimeout(()=>{if(X.parentNode)X.parentNode.removeChild(X);Q.get(z)?.delete(X)},$.duration)};j("mouseup",k),j("mouseleave",k)};return{mount:(W)=>{if(!W)return;if(window.getComputedStyle(W).position==="static")W.style.position="relative";let Y=W.querySelector(`.${u}-ripple`);if(!Y)Y=document.createElement("div"),Y.className=`${u}-ripple`,W.appendChild(Y);W.__rippleContainer=Y,Q.set(W,new Set);let U=(X)=>G(X,W);if(!W.__rippleHandlers)W.__rippleHandlers=[];W.__rippleHandlers.push(U),W.addEventListener("mousedown",U)},unmount:(W)=>{if(!W)return;if(Z.forEach(({event:z,handler:Y})=>{K(z,Y)}),Z=[],W.__rippleHandlers)W.__rippleHandlers.forEach((z)=>{W.removeEventListener("mousedown",z)}),W.__rippleHandlers=[];if(Q.has(W)){let z=Q.get(W);if(z)z.forEach((Y)=>{if(Y.parentNode)Y.parentNode.removeChild(Y)});Q.delete(W)}if(W.__rippleContainer&&W.__rippleContainer.parentNode)W.__rippleContainer.parentNode.removeChild(W.__rippleContainer),delete W.__rippleContainer}}},T6=(J)=>($)=>{if(!J.ripple)return $;let Q=qq(J.rippleConfig);if(Q.mount($.element),$.lifecycle){let Z=$.lifecycle.mount,q=$.lifecycle.destroy;$.lifecycle.mount=()=>{Z.call($.lifecycle)},$.lifecycle.destroy=()=>{Q.unmount($.element),q.call($.lifecycle)}}return{...$,ripple:Q}};var w4=T(()=>{A4();y6()});function x4(J){return"emit"in J&&typeof J.emit==="function"}var I9=(J={})=>($)=>{let Q=document.createElement("input"),Z=$.componentName||"component";Q.type="checkbox",Q.className=`${$.getClass(Z)}-input`,Q.style.position="absolute",Q.style.opacity="0",Q.style.cursor="pointer",$.element.setAttribute("role","presentation"),Q.setAttribute("role",Z);let q={name:J.name,checked:J.checked,required:J.required,disabled:J.disabled,value:J.value||"on","aria-label":J.label||J.ariaLabel};return Object.entries(q).forEach(([j,K])=>{if(K!==null&&K!==void 0)if(j==="disabled"&&K===!0)Q.disabled=!0,Q.setAttribute("disabled","true");else if(K===!0)Q.setAttribute(j,j);else Q.setAttribute(j,String(K))}),Q.addEventListener("change",(j)=>{if(x4($))$.emit("change",{checked:Q.checked,value:Q.value,nativeEvent:j})}),Q.addEventListener("keydown",(j)=>{if(j.key===" "||j.key==="Enter"){if(j.preventDefault(),!Q.disabled)Q.checked=!Q.checked,Q.dispatchEvent(new Event("change",{bubbles:!0}))}}),$.element.appendChild(Q),{...$,input:Q,getValue:()=>Q.value,setValue(j){if(Q.value=j,x4($))$.emit("value",{value:j});return this}}};var S9=(J={})=>($)=>{if(!$.input)return $;let Q=$.componentName||"component",Z=()=>{$.element.classList.toggle(`${$.getClass(Q)}--checked`,$.input.checked)};if(J.checked!==void 0)$.input.checked=J.checked;if(Z(),$.emit)$.on?.("change",Z);return{...$,checkable:{check(){if(!$.input.checked)$.input.checked=!0,Z(),$.emit?.("change",{checked:!0,value:$.input.value});return this},uncheck(){if($.input.checked)$.input.checked=!1,Z(),$.emit?.("change",{checked:!1,value:$.input.value});return this},toggle(){return $.input.checked=!$.input.checked,Z(),$.emit?.("change",{checked:$.input.checked,value:$.input.value}),this},isChecked(){return $.input.checked}}}};var l8=(J={})=>($)=>{if(J.variant)$.element.classList.add(`${$.getClass("button")}--${J.variant}`);if(J.size)$.element.classList.add(`${$.getClass("button")}--${J.size}`);return $};function M6(J){return"lifecycle"in J&&J.lifecycle&&typeof J.lifecycle==="object"&&"destroy"in J.lifecycle&&typeof J.lifecycle.destroy==="function"}function k6(J){return"emit"in J&&typeof J.emit==="function"}var R7=(J={})=>($)=>{let Q=J.multiline||J.type==="multiline",Z=document.createElement(Q?"textarea":"input");Z.className=`${$.getClass("textfield")}-input`;let q={name:J.name,required:J.required,disabled:J.disabled,maxLength:J.maxLength,pattern:J.pattern,autocomplete:J.autocomplete,value:J.value||"",placeholder:J.placeholder||" "};if(!Q)q.type=J.type||"text";else q["data-type"]="multiline";Object.entries(q).forEach(([W,z])=>{if(z!==null&&z!==void 0)if(typeof z==="boolean"){if(z)Z.setAttribute(W,"")}else Z.setAttribute(W,String(z))});let j=()=>{let W=!Z.value;return $.element.classList.toggle(`${$.getClass("textfield")}--empty`,W),W},K=(W=!0)=>{console.log("checkForAutofill");let z=Z.value&&Z.value.length>0,Y=Z.matches(":-webkit-autofill"),X=window.getComputedStyle(Z).backgroundColor,_=X==="rgb(250, 255, 189)"||X==="rgb(232, 240, 254)"||X==="rgb(250, 255, 0)"||X==="rgba(255, 255, 0, 0.1)";if(z||Y||_){if($.element.classList.remove(`${$.getClass("textfield")}--empty`),W&&k6($)&&(Y||_))$.emit("input",{value:Z.value,isEmpty:!1,isAutofilled:!0})}},G=null;if(typeof MutationObserver!=="undefined")G=new MutationObserver((W)=>{W.forEach((z)=>{if(z.type==="attributes"&&(z.attributeName==="value"||z.attributeName==="data-autofilled"))K(!0)})}),G.observe(Z,{attributes:!0,attributeFilter:["value","data-autofilled","autocomplete"]});if(Z.addEventListener("focus",()=>{if($.element.classList.add(`${$.getClass("textfield")}--focused`),k6($))$.emit("focus",{isEmpty:j()});K(!1)}),Z.addEventListener("blur",()=>{if($.element.classList.remove(`${$.getClass("textfield")}--focused`),k6($))$.emit("blur",{isEmpty:j()});K(!1)}),Z.addEventListener("input",()=>{if(k6($))$.emit("input",{value:Z.value,isEmpty:j(),isAutofilled:!1});else j()}),Z.addEventListener("change",()=>{let W=j();if(K(!1),k6($))$.emit("change",{value:Z.value,isEmpty:W,isAutofilled:Z.matches?.(":-webkit-autofill")||!1})}),Z.addEventListener("animationstart",(W)=>{if(W.animationName==="onAutoFillStart"||W.animationName?.includes("autofill"))K()}),j(),setTimeout(()=>{K(!1)},0),Q)$.element.classList.add(`${$.getClass("textfield")}--multiline`);if($.element.appendChild(Z),M6($)){let W=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(G)G.disconnect();Z.remove(),W.call($.lifecycle)}}return{...$,input:Z,setValue(W){return Z.value=W||"",j(),this},getValue(){return Z.value},setAttribute(W,z){return Z.setAttribute(W,z),this},getAttribute(W){return Z.getAttribute(W)},removeAttribute(W){return Z.removeAttribute(W),this}}};var y4=()=>{};var z9=(J={})=>($)=>{if(!J.label)return $;let Q=document.createElement("label");Q.className=`${J.prefix}-${J.componentName}-label`,Q.textContent=J.label;let Z=J.labelPosition||"start";if(Z==="start")if($.element.firstChild)$.element.insertBefore(Q,$.element.firstChild);else $.element.appendChild(Q);else $.element.appendChild(Q);if(Z&&$.componentName!=="slider")$.element.classList.add(`${J.prefix}-${J.componentName}--label-${Z}`);return{...$,label:{setText(j){return Q.textContent=j,this},getText(){return Q.textContent||""},getElement(){return Q}}}};var jq=`
|
|
7
7
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
8
8
|
<polyline points="20 6 9 17 4 12"></polyline>
|
|
9
|
-
</svg>`,A7=(J)=>($)=>{let Q=document.createElement("span");Q.className=`${J.prefix}-${J.componentName}-track`;let Z=document.createElement("span");if(Z.className=`${J.prefix}-${J.componentName}-thumb`,Q.appendChild(Z),J.icon!=="none"){let q=document.createElement("span");q.className=`${J.prefix}-${J.componentName}-thumb-icon`,q.innerHTML=J.icon||jq,Z.appendChild(q)}return $.element.appendChild(Q),{...$,track:Q,thumb:Z}};var _$=(J)=>{let $=new Map;return{on(Q,Z){return J.addEventListener(Q,Z),$.set(Z,Q),this},off(Q,Z){return J.removeEventListener(Q,Z),$.delete(Z),this},destroy(){$.forEach((Q,Z)=>{J.removeEventListener(Q,Z)}),$.clear()},getHandlers(){return new Map($)}}};var r8=(J)=>($)=>{let Q=_$(J||$.element),Z={addListeners(q){return Object.entries(q).forEach(([j,G])=>{Q.on(j,G)}),this},removeListeners(q){return Object.entries(q).forEach(([j,G])=>{Q.off(j,G)}),this},once(q,j){let G=(K)=>{j(K),Q.off(q,G)};return Q.on(q,G),this},on(q,j){return Q.on(q,j),this},off(q,j){return Q.off(q,j),this},destroy(){Q.destroy()}};if(k6($)){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Q.destroy(),q.call($.lifecycle)}}return{...$,events:Z,on:Z.on.bind(Z),off:Z.off.bind(Z)}};var T4=()=>{};var I4=T(()=>{w7();y6()});var $7=(J,$,Q={})=>{let Z=null,q=0,{leading:j=!0,trailing:G=!0}=Q;return function(...K){let z=Date.now();if(!q&&!j)q=z;let W=$-(z-q);if(W<=0||W>$){if(Z)clearTimeout(Z),Z=null;q=z,J.apply(this,K)}else if(!Z&&G)Z=window.setTimeout(()=>{q=j?Date.now():0,Z=null,J.apply(this,K)},W)}},J7=(J,$,Q={})=>{let Z=null,q=null,j=null,G,K=null,z=0,{leading:W=!1,maxWait:Y}=Q,U=(B)=>{let M=B-(K||0),k=B-z;return!K||M>=$||M<0||Y!==void 0&&k>=Y},X=(B)=>{let M=q,k=j;return q=j=null,z=B,G=J.apply(k,M),G},_=(B)=>{if(Z=null,q)return X(B);return G},H=(B)=>{return z=B,Z=window.setTimeout(()=>{_(Date.now())},$),W?X(B):G};return function(...B){let M=Date.now(),k=U(M);if(q=B,j=this,K=M,k){if(Z===null)return H(M);if(Y!==void 0)Z=window.setTimeout(()=>{let N=Date.now();if(U(N))return _(N)},Math.min($,Y-(M-z)))}if(Z===null)Z=window.setTimeout(()=>{_(Date.now())},$);return G}},L$=(J)=>{let $=!1,Q;return function(...Z){if(!$)$=!0,Q=J.apply(this,Z);return Q}};var p8=(J={})=>($)=>{let Q={},Z=(G,K,z,W={})=>{if(Q[G])q(G);let Y=$7(K,z,W);return $.element.addEventListener(G,Y),Q[G]={original:K,throttled:Y},j},q=(G)=>{let K=Q[G];if(K)$.element.removeEventListener(G,K.throttled),delete Q[G];return j};if(k6($)){let G=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Object.keys(Q).forEach((K)=>{let z=Q[K];$.element.removeEventListener(K,z.throttled)}),G.call($.lifecycle)}}if(J.throttledEvents)Object.entries(J.throttledEvents).forEach(([G,K])=>{Z(G,K.handler,K.wait,K.options)});let j={...$,addThrottledEvent:Z,removeThrottledEvent:q};return j};var S4=()=>{};function Kq(J){return"lifecycle"in J&&J.lifecycle&&typeof J.lifecycle==="object"&&"destroy"in J.lifecycle&&typeof J.lifecycle.destroy==="function"}var s8=(J={})=>($)=>{let Q={},Z=(G,K,z,W={})=>{if(Q[G])q(G);let Y=J7(K,z,W);return $.element.addEventListener(G,Y),Q[G]={original:K,debounced:Y},j},q=(G)=>{let K=Q[G];if(K)$.element.removeEventListener(G,K.debounced),delete Q[G];return j};if(Kq($)){let G=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Object.keys(Q).forEach((K)=>{let z=Q[K];$.element.removeEventListener(K,z.debounced)}),G.call($.lifecycle)}}if(J.debouncedEvents)Object.entries(J.debouncedEvents).forEach(([G,K])=>{Z(G,K.handler,K.wait,K.options)});let j={...$,addDebouncedEvent:Z,removeDebouncedEvent:q};return j};var b4=()=>{};var m8=()=>{};function v4(J,$,Q,Z){return Math.sqrt(Math.pow(Q-J,2)+Math.pow(Z-$,2))}function C4(J,$,Q,Z){let q=Math.atan2(Z-$,Q-J)*180/Math.PI;return q<0?q+360:q}function E6(J,$,Q){let Z=Date.now(),q=!1,j={type:J,originalEvent:$,target:Q.target||$.target,startTime:Q.startTime,endTime:Z,duration:Z-Q.startTime,defaultPrevented:q,preventDefault:()=>{if(q=!0,j.defaultPrevented=!0,$.cancelable)$.preventDefault()},stopPropagation:()=>{$.stopPropagation()}};return j}function E4(){return"ontouchstart"in window||navigator.maxTouchPoints&&navigator.maxTouchPoints>0}function h4(){return!!window.PointerEvent}function a8(J){if("touches"in J&&J.touches.length>0)return{clientX:J.touches[0].clientX,clientY:J.touches[0].clientY};return{clientX:J.clientX,clientY:J.clientY}}function c8(J){let{state:$,options:Q,originalEvent:Z}=J,q=$.currentX-$.startX,j=$.currentY-$.startY;if(Math.sqrt(q*q+j*j)<Q.tapDistanceThreshold){let W=Date.now()-$.lastTapTime<300?$.tapCount+1:1;return{...E6("tap",Z,$),type:"tap",count:W,x:$.currentX,y:$.currentY}}return null}var i8=()=>{};function Gq(J,$){if(Math.abs(J)>Math.abs($))return J>0?"right":"left";return $>0?"down":"up"}function t8(J){let{state:$,options:Q,originalEvent:Z}=J,q=$.currentX-$.startX,j=$.currentY-$.startY,G=Math.sqrt(q*q+j*j),z=Date.now()-$.startTime,W=G/z;if(G>=Q.swipeThreshold&&z<=Q.swipeTimeThreshold){let Y=Gq(q,j);return{...E6("swipe",Z,$),type:"swipe",direction:Y,deltaX:q,deltaY:j,distance:G,velocity:W,startX:$.startX,startY:$.startY,endX:$.currentX,endY:$.currentY}}return null}var n8=T(()=>{m8()});function e8(J,$){let{state:Q,options:Z,originalEvent:q}=J,j=window.setTimeout(()=>{if(Q.active){let G=Math.abs(Q.currentX-Q.startX),K=Math.abs(Q.currentY-Q.startY);if(G<Z.tapDistanceThreshold&&K<Z.tapDistanceThreshold){let z={...E6("longpress",q,Q),type:"longpress",x:Q.currentX,y:Q.currentY};$(z)}}},Z.longPressTime);return()=>{clearTimeout(j)}}function u4(J){let{state:$,options:Q}=J,Z=Math.abs($.currentX-$.startX),q=Math.abs($.currentY-$.startY);return Z>Q.tapDistanceThreshold||q>Q.tapDistanceThreshold}var $1=()=>{};function J1(J){let{state:$,originalEvent:Q}=J,Z=$.currentX-$.startX,q=$.currentY-$.startY,j=$.currentX-$.lastX,G=$.currentY-$.lastY;if(Math.sqrt(j*j+G*G)>0)return{...E6("pan",Q,$),type:"pan",deltaX:Z,deltaY:q,startX:$.startX,startY:$.startY,currentX:$.currentX,currentY:$.currentY};return null}var Q1=()=>{};function Z1(J,$,Q){let{state:Z,originalEvent:q}=J,j=v4($.clientX,$.clientY,Q.clientX,Q.clientY),G=10;if(Math.abs(j-Z.startDistance)>10){let K=j/Z.startDistance,z=($.clientX+Q.clientX)/2,W=($.clientY+Q.clientY)/2;return{...E6("pinch",q,Z),type:"pinch",scale:K,centerX:z,centerY:W}}return null}var q1=()=>{};function j1(J,$,Q){let{state:Z,originalEvent:q}=J,j=C4($.clientX,$.clientY,Q.clientX,Q.clientY),G=10,K=j-Z.startAngle;if(Math.abs(K)>10){let z=($.clientX+Q.clientX)/2,W=($.clientY+Q.clientY)/2;return{...E6("rotate",q,Z),type:"rotate",rotation:K,centerX:z,centerY:W}}return null}var K1=()=>{};var x7=(J,$={})=>{let Q={swipeThreshold:30,swipeTimeThreshold:300,longPressTime:500,tapDistanceThreshold:10,preventDefault:!0,stopPropagation:!1,...$},Z=new Map,q={active:!1,startTime:0,startX:0,startY:0,lastX:0,lastY:0,currentX:0,currentY:0,touchCount:0,longPressTimer:null,startDistance:0,startAngle:0,lastTapTime:0,tapCount:0,target:null},j=E4(),G=h4(),K={tap:!0,swipe:!0,swipeleft:!0,swiperight:!0,swipeup:!0,swipedown:!0,longpress:!0,pan:!0,pinch:j||G,rotate:j||G},z=(k)=>{let N=Z.get(k.type);if(!N)return;if(N.forEach((F)=>{try{F(k)}catch(V){console.error(`Error in gesture handler for ${k.type}:`,V)}}),k.type==="swipe"&&"direction"in k){let F={...k,type:`swipe${k.direction}`};z(F)}if(Q.preventDefault&&!k.defaultPrevented)k.preventDefault();if(Q.stopPropagation)k.stopPropagation()},W=null,Y=(k)=>{let N=a8(k),F="touches"in k?k.touches.length:1;if(q.active=!0,q.startTime=Date.now(),q.startX=q.lastX=q.currentX=N.clientX,q.startY=q.lastY=q.currentY=N.clientY,q.touchCount=F,q.target=k.target,F===2&&"touches"in k){let O=k.touches[0],P=k.touches[1];if(q.startDistance=Math.sqrt(Math.pow(P.clientX-O.clientX,2)+Math.pow(P.clientY-O.clientY,2)),q.startAngle=Math.atan2(P.clientY-O.clientY,P.clientX-O.clientX)*180/Math.PI,q.startAngle<0)q.startAngle+=360}let V={state:q,options:Q,originalEvent:k};if(W)W();W=e8(V,(O)=>{z(O)})},U=(k)=>{if(!q.active)return;let N=a8(k),F="touches"in k?k.touches.length:1;q.lastX=q.currentX,q.lastY=q.currentY,q.currentX=N.clientX,q.currentY=N.clientY;let V={state:q,options:Q,originalEvent:k};if(u4(V)&&W)W(),W=null;let O=J1(V);if(O)z(O);if(F===2&&"touches"in k){let P=k.touches[0],L=k.touches[1],D=Z1(V,P,L);if(D)z(D);let R=j1(V,P,L);if(R)z(R)}},X=(k)=>{if(!q.active)return;if(W)W(),W=null;let N={state:q,options:Q,originalEvent:k},F=c8(N);if(F)q.lastTapTime=Date.now(),q.tapCount=F.count,z(F);else{let V=t8(N);if(V)z(V)}q.active=!1},_=()=>{if(W)W(),W=null;q.active=!1},H={},B=()=>{if(G)H={pointerdown:Y,pointermove:U,pointerup:X,pointercancel:_};else if(j)H={touchstart:Y,touchmove:U,touchend:X,touchcancel:_};else H={mousedown:Y,mousemove:U,mouseup:X,mouseleave:_};Object.entries(H).forEach(([k,N])=>{J.addEventListener(k,N,{passive:!Q.preventDefault})})},M=()=>{Object.entries(H).forEach(([k,N])=>{J.removeEventListener(k,N)}),H={}};return B(),{on(k,N){if(!Z.has(k))Z.set(k,new Set);return Z.get(k).add(N),this},off(k,N){let F=Z.get(k);if(F){if(F.delete(N),F.size===0)Z.delete(k)}return this},isSupported(k){return k in K&&K[k]},enable(){return B(),this},disable(){return M(),this},destroy(){if(M(),W)W(),W=null;Z.clear()}}};var f4=T(()=>{m8();i8();n8();$1();Q1();q1();K1()});var D$=T(()=>{f4();i8();n8();$1();q1();K1();Q1()});var G1=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add gesture recognition: missing element"),$;let{enableGestures:Q=!0,gestureHandlers:Z={},...q}=J,j=x7($.element,q);if(Object.entries(Z).forEach(([G,K])=>{j.on(G,K)}),!Q)j.disable();if(N6($)){let G=(K)=>{$.emit(K.type,K)};["tap","swipe","swipeleft","swiperight","swipeup","swipedown","longpress","pinch","rotate","pan"].forEach((K)=>{j.on(K,G)})}if(k6($)){let G=$.lifecycle.destroy;$.lifecycle.destroy=()=>{j.destroy(),G.call($.lifecycle)}}return{...$,gestures:j,onGesture(G,K){return j.on(G,K),this},offGesture(G,K){return j.off(G,K),this},isGestureSupported(G){return j.isSupported(G)},enableGestures(){return j.enable(),this},disableGestures(){return j.disable(),this}}};var g4=T(()=>{D$()});function z1(J){return"input"in J&&J.input instanceof HTMLElement&&"disabled"in J.input}var G6=(J)=>($)=>{let Q=`${$.getClass(J.componentName||$.componentName||"component")}--disabled`,Z={enable(){if($.element.classList.remove(Q),z1($))$.input.disabled=!1,$.input.removeAttribute("disabled");else{let q=$.element;if("disabled"in q)q.disabled=!1;$.element.removeAttribute("disabled")}return this},disable(){if($.element.classList.add(Q),z1($))$.input.disabled=!0,$.input.setAttribute("disabled","true");else{let q=$.element;if("disabled"in q)q.disabled=!0;$.element.setAttribute("disabled","true")}return this},toggle(){if(this.isDisabled())this.enable();else this.disable();return this},isDisabled(){if(z1($))return $.input.disabled;let q=$.element;return"disabled"in q&&q.disabled}};if(J.disabled)requestAnimationFrame(()=>{Z.disable()});return{...$,disabled:Z}};function Wq(J){return"events"in J&&J.events&&typeof J.events==="object"&&"destroy"in J.events&&typeof J.events.destroy==="function"}function Yq(J){return"text"in J&&J.text&&typeof J.text==="object"&&"getElement"in J.text&&typeof J.text.getElement==="function"}function Uq(J){return"icon"in J&&J.icon&&typeof J.icon==="object"&&"getElement"in J.icon&&typeof J.icon.getElement==="function"}var C=()=>(J)=>{let $=!1,Q=C6();return{...J,lifecycle:{onMount:(q)=>Q.on("mount",q),onUnmount:(q)=>Q.on("unmount",q),mount:()=>{if(!$)$=!0,Q.emit("mount")},unmount:()=>{if($)$=!1,Q.emit("unmount"),Q.clear()},isMounted:()=>$,destroy(){if($)this.unmount();if(Wq(J))J.events.destroy();if(Yq(J)){let q=J.text.getElement();if(q)q.remove()}if(Uq(J)){let q=J.icon.getElement();if(q)q.remove()}if(J.element)J.element.remove()}}}};var d4=()=>{};var o=T(()=>{D4();P4();w4();y4();T4();I4();S4();b4();g4();d4()});var l4=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add tap gesture recognition: missing element"),$;let{tapDistanceThreshold:Q=10,preventDefault:Z=!0,onTap:q,enabled:j=!0}=J,G=new Set;if(q)G.add(q);let K=0,z=0,W=!1,Y=0,U=0,X=0,_=j,H=(O,P,L)=>{let D=Date.now();if(D-U<300)X++;else X=1;U=D;let w={type:"tap",originalEvent:O,target:O.target,startTime:Y,endTime:D,duration:D-Y,defaultPrevented:!1,preventDefault:()=>{if(w.defaultPrevented=!0,O.cancelable)O.preventDefault()},stopPropagation:()=>{O.stopPropagation()},count:X,x:P,y:L};if(G.forEach((A)=>{try{A(w)}catch(x){console.error("Error in tap handler:",x)}}),N6($))$.emit("tap",w);if(Z&&!w.defaultPrevented)w.preventDefault()},B=(O)=>{if(!_)return;let P="touches"in O?O.touches[0]:O;K=P.clientX,z=P.clientY,Y=Date.now(),W=!0},M=(O)=>{if(!W||!_)return;let P="changedTouches"in O&&O.changedTouches.length>0?O.changedTouches[0]:O,L=P.clientX,D=P.clientY,R=L-K,w=D-z;if(Math.sqrt(R*R+w*w)<Q)H(O,L,D);W=!1},k=()=>{W=!1},N={mousedown:B,mouseup:M,mouseleave:k,touchstart:B,touchend:M,touchcancel:k},F=()=>{Object.entries(N).forEach(([O,P])=>{$.element.addEventListener(O,P,{passive:!Z})})},V=()=>{Object.entries(N).forEach(([O,P])=>{$.element.removeEventListener(O,P)})};if(_)F();if(k6($)){let O=$.lifecycle.destroy;$.lifecycle.destroy=()=>{V(),G.clear(),O.call($.lifecycle)}}return{...$,onTap(O){return G.add(O),this},offTap(O){return G.delete(O),this},enableTap(){if(!_)_=!0,F();return this},disableTap(){if(_)_=!1,V();return this}}};var r4=()=>{};function Xq(J,$){if(Math.abs(J)>Math.abs($))return J>0?"right":"left";return $>0?"down":"up"}var p4=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add swipe gesture recognition: missing element"),$;let{swipeThreshold:Q=30,swipeTimeThreshold:Z=300,preventDefault:q=!0,onSwipe:j,onSwipeLeft:G,onSwipeRight:K,onSwipeUp:z,onSwipeDown:W,enabled:Y=!0}=J,U={swipe:new Set,swipeleft:new Set,swiperight:new Set,swipeup:new Set,swipedown:new Set};if(j)U.swipe.add(j);if(G)U.swipeleft.add(G);if(K)U.swiperight.add(K);if(z)U.swipeup.add(z);if(W)U.swipedown.add(W);let X=0,_=0,H=!1,B=0,M=Y,k=(D,R,w)=>{let A=R-X,x=w-_,I=Math.sqrt(A*A+x*x),r=Date.now(),a=r-B,V6=I/a,i=Xq(A,x),y={type:"swipe",originalEvent:D,target:D.target,startTime:B,endTime:r,duration:a,defaultPrevented:!1,preventDefault:()=>{if(y.defaultPrevented=!0,D.cancelable)D.preventDefault()},stopPropagation:()=>{D.stopPropagation()},direction:i,deltaX:A,deltaY:x,distance:I,velocity:V6,startX:X,startY:_,endX:R,endY:w};U.swipe.forEach((m)=>{try{m(y)}catch(s){console.error("Error in swipe handler:",s)}});let l=`swipe${i}`;if(U[l].forEach((m)=>{try{m({...y,type:l})}catch(s){console.error(`Error in ${l} handler:`,s)}}),N6($))$.emit("swipe",y),$.emit(l,y);if(q&&!y.defaultPrevented)y.preventDefault()},N=(D)=>{if(!M)return;let R="touches"in D?D.touches[0]:D;X=R.clientX,_=R.clientY,B=Date.now(),H=!0},F=(D)=>{if(!H||!M)return;let R="changedTouches"in D&&D.changedTouches.length>0?D.changedTouches[0]:D,w=R.clientX,A=R.clientY,x=w-X,I=A-_,r=Math.sqrt(x*x+I*I),a=Date.now()-B;if(r>=Q&&a<=Z)k(D,w,A);H=!1},V=()=>{H=!1},O={mousedown:N,mouseup:F,mouseleave:V,touchstart:N,touchend:F,touchcancel:V},P=()=>{Object.entries(O).forEach(([D,R])=>{$.element.addEventListener(D,R,{passive:!q})})},L=()=>{Object.entries(O).forEach(([D,R])=>{$.element.removeEventListener(D,R)})};if(M)P();if(k6($)){let D=$.lifecycle.destroy;$.lifecycle.destroy=()=>{L(),Object.values(U).forEach((R)=>R.clear()),D.call($.lifecycle)}}return{...$,onSwipe(D){return U.swipe.add(D),this},onSwipeLeft(D){return U.swipeleft.add(D),this},onSwipeRight(D){return U.swiperight.add(D),this},onSwipeUp(D){return U.swipeup.add(D),this},onSwipeDown(D){return U.swipedown.add(D),this},offSwipe(D){return U.swipe.delete(D),this},offSwipeLeft(D){return U.swipeleft.delete(D),this},offSwipeRight(D){return U.swiperight.delete(D),this},offSwipeUp(D){return U.swipeup.delete(D),this},offSwipeDown(D){return U.swipedown.delete(D),this},enableSwipe(){if(!M)M=!0,P();return this},disableSwipe(){if(M)M=!1,L();return this}}};var s4=T(()=>{D$()});var m4=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add long press gesture recognition: missing element"),$;let{longPressTime:Q=500,moveThreshold:Z=10,preventDefault:q=!0,onLongPress:j,enabled:G=!0}=J,K=new Set;if(j)K.add(j);let z=0,W=0,Y=0,U=0,X=!1,_=0,H=null,B=G,M=(D)=>{let R={type:"longpress",originalEvent:D,target:D.target,startTime:_,endTime:Date.now(),duration:Date.now()-_,defaultPrevented:!1,preventDefault:()=>{if(R.defaultPrevented=!0,D.cancelable)D.preventDefault()},stopPropagation:()=>{D.stopPropagation()},x:Y,y:U};if(K.forEach((w)=>{try{w(R)}catch(A){console.error("Error in long press handler:",A)}}),N6($))$.emit("longpress",R);if(q&&!R.defaultPrevented)R.preventDefault()},k=(D)=>{if(!B)return;let R="touches"in D?D.touches[0]:D;if(z=Y=R.clientX,W=U=R.clientY,_=Date.now(),X=!0,H!==null)window.clearTimeout(H);H=window.setTimeout(()=>{if(X){let w=Y-z,A=U-W;if(Math.sqrt(w*w+A*A)<Z)M(D)}H=null},Q)},N=(D)=>{if(!X||!B)return;let R="touches"in D?D.touches[0]:D;Y=R.clientX,U=R.clientY;let w=Y-z,A=U-W;if(Math.sqrt(w*w+A*A)>Z){if(H!==null)window.clearTimeout(H),H=null}},F=()=>{if(H!==null)window.clearTimeout(H),H=null;X=!1},V=()=>{if(H!==null)window.clearTimeout(H),H=null;X=!1},O={mousedown:k,mousemove:N,mouseup:F,mouseleave:V,touchstart:k,touchmove:N,touchend:F,touchcancel:V},P=()=>{Object.entries(O).forEach(([D,R])=>{$.element.addEventListener(D,R,{passive:!q})})},L=()=>{Object.entries(O).forEach(([D,R])=>{$.element.removeEventListener(D,R)})};if(B)P();if(k6($)){let D=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(L(),H!==null)window.clearTimeout(H),H=null;K.clear(),D.call($.lifecycle)}}return{...$,onLongPress(D){return K.add(D),this},offLongPress(D){return K.delete(D),this},enableLongPress(){if(!B)B=!0,P();return this},disableLongPress(){if(B){if(B=!1,L(),H!==null)window.clearTimeout(H),H=null}return this}}};var a4=()=>{};var c4=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add pan gesture recognition: missing element"),$;let{preventDefault:Q=!0,onPanStart:Z,onPan:q,onPanEnd:j,enabled:G=!0}=J,K={panstart:new Set,pan:new Set,panend:new Set};if(Z)K.panstart.add(Z);if(q)K.pan.add(q);if(j)K.panend.add(j);let z=0,W=0,Y=0,U=0,X=0,_=0,H=!1,B=!1,M=0,k=G,N=(A,x)=>{let I={type:x,originalEvent:A,target:A.target,startTime:M,endTime:Date.now(),duration:Date.now()-M,defaultPrevented:!1,preventDefault:()=>{if(I.defaultPrevented=!0,A.cancelable)A.preventDefault()},stopPropagation:()=>{A.stopPropagation()},deltaX:X-z,deltaY:_-W,startX:z,startY:W,currentX:X,currentY:_};return I},F=(A,x)=>{let I=N(A,x);if(K[x].forEach((r)=>{try{r(I)}catch(a){console.error(`Error in ${x} handler:`,a)}}),N6($))$.emit(x,I);if(Q&&!I.defaultPrevented)I.preventDefault()},V=(A)=>{if(!k)return;let x="touches"in A?A.touches[0]:A;z=Y=X=x.clientX,W=U=_=x.clientY,M=Date.now(),H=!0,B=!1},O=(A)=>{if(!H||!k)return;let x="touches"in A?A.touches[0]:A;Y=X,U=_,X=x.clientX,_=x.clientY;let I=X-Y,r=_-U;if(Math.sqrt(I*I+r*r)>0){if(!B)B=!0,F(A,"panstart");F(A,"pan")}},P=(A)=>{if(!H||!k)return;if(B)F(A,"panend");H=!1,B=!1},L=(A)=>{if(!H||!k)return;if(B)F(A,"panend");H=!1,B=!1},D={mousedown:V,mousemove:O,mouseup:P,mouseleave:L,touchstart:V,touchmove:O,touchend:P,touchcancel:L},R=()=>{Object.entries(D).forEach(([A,x])=>{$.element.addEventListener(A,x,{passive:!Q})})},w=()=>{Object.entries(D).forEach(([A,x])=>{$.element.removeEventListener(A,x)})};if(k)R();if(k6($)){let A=$.lifecycle.destroy;$.lifecycle.destroy=()=>{w(),Object.values(K).forEach((x)=>x.clear()),A.call($.lifecycle)}}return{...$,onPanStart(A){return K.panstart.add(A),this},onPan(A){return K.pan.add(A),this},onPanEnd(A){return K.panend.add(A),this},offPanStart(A){return K.panstart.delete(A),this},offPan(A){return K.pan.delete(A),this},offPanEnd(A){return K.panend.delete(A),this},enablePan(){if(!k)k=!0,R();return this},disablePan(){if(k)k=!1,w();return this}}};var i4=()=>{};var J6=T(()=>{c();o();r4();s4();a4();i4()});function W1(J,$){y7[J]=$}function T7(J){return y7[J]||{}}function Y1(J){Object.assign(y7,J)}function U1(){Object.keys(y7).forEach((J)=>{delete y7[J]})}var y7;var X1=T(()=>{y7={}});var d=(J,$={},Q)=>{let Z=T7(Q),q=$.className!==void 0?$.className:$.class,j=J.className!==void 0?J.className:J.class,G={...J,...Z,...$,componentName:Q,prefix:u,className:q!==void 0?q:j};if("class"in G&&G.className!==void 0)delete G.class;return G},p=(J,$)=>{let Q=J.className||J.class,Z=$.className,q=[...Array.isArray(Q)?Q:[Q],...Array.isArray(Z)?Z:[Z]].filter(Boolean),j=$.attributes||{};return{tag:$.tag,componentName:J.componentName,attributes:j,className:q.length>0?q:void 0,rawClass:J.rawClass,html:$.html,text:$.text,forwardEvents:$.forwardEvents||{},interactive:$.interactive}};var t=T(()=>{y6();X1()});var I7,S7,b7,b9=4;var B1=T(()=>{I7={SMALL:"small",LARGE:"large"},S7={ERROR:"error",PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",SUCCESS:"success",WARNING:"warning",INFO:"info"},b7={TOP_RIGHT:"top-right",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left"}});var Bq,o4=(J={})=>d(Bq,J,"badge"),t4=(J)=>{let $={};if(J.variant!=="small")$.role="status";let Q=J.variant==="small"?"":Q7(J.label||"",J.max);return p(J,{tag:"span",attributes:$,className:J.class,text:Q})},n4=(J)=>({visibility:{show:()=>J.visibility.show(),hide:()=>J.visibility.hide(),toggle:($)=>J.visibility.toggle($),isVisible:()=>J.visibility.isVisible()},lifecycle:{destroy:()=>J.lifecycle.destroy()}}),Q7=(J,$)=>{if(J===void 0||J===null||J==="")return"";let Q=String(J),Z=Number(J);if($!==void 0&&!isNaN(Z)&&Z>$)Q=`${$}+`;if(Q.length>b9){let q=Number(J);if(!isNaN(q))if(q>=1000)Q="999+";else Q=Q.substring(0,b9-1)+"+";else Q=Q.substring(0,b9)}return Q};var O$=T(()=>{t();B1();Bq={variant:I7.LARGE,color:S7.ERROR,position:b7.TOP_RIGHT,label:"",visible:!0}});var e4="small",Fq="large",Hq="error",kq="top-right",$5=()=>(J)=>{if(J.config.visible===!1)J.element.classList.add(`${J.getClass("badge")}--invisible`);return{...J,visibility:{show(){J.element.classList.remove(`${J.getClass("badge")}--invisible`)},hide(){J.element.classList.add(`${J.getClass("badge")}--invisible`)},toggle(Q){if(Q===void 0)J.element.classList.toggle(`${J.getClass("badge")}--invisible`);else if(Q)this.show();else this.hide()},isVisible(){return!J.element.classList.contains(`${J.getClass("badge")}--invisible`)}}}},J5=(J)=>($)=>{let Q=J.variant||Fq;if($.element.classList.add(`${$.getClass("badge")}--${Q}`),Q===e4)$.element.textContent="",$.element.setAttribute("aria-hidden","true");else if($.element.setAttribute("role","status"),J.label!==void 0&&J.label!==""){let Z=Q7(J.label,J.max);$.element.textContent=Z}return $},Q5=(J)=>($)=>{let Q=J.color||Hq;return $.element.classList.add(`${$.getClass("badge")}--${Q}`),$},Z5=(J)=>($)=>{let Q=J.position||kq;if($.element.classList.add(`${$.getClass("badge")}--${Q}`),J.target)$.element.classList.add(`${$.getClass("badge")}--positioned`);return $},q5=(J)=>($)=>{if(J.max===void 0||J.variant===e4)return $;if($.config.max=J.max,J.label!==void 0&&J.label!==""){let Q=Q7(J.label,J.max);if($.element.textContent=Q,typeof J.label==="number"&&J.label>J.max)$.element.classList.add(`${$.getClass("badge")}--overflow`)}return $},j5=(J)=>($)=>{if(!J.target)return $;let Q=document.createElement("div");Q.classList.add($.getClass("badge-wrapper")),Q.style.position="relative";let Z=J.target.parentNode;if(Z)Z.replaceChild(Q,J.target),Q.appendChild(J.target),Q.appendChild($.element),$.wrapper=Q;return $};var K5=T(()=>{O$()});var G5="small",Mq,Vq,Nq,z5=({visibility:J,lifecycle:$})=>(Q)=>{let Z={element:Q.element,wrapper:Q.wrapper,getClass:Q.getClass,setLabel(q){if(Q.config.label=q,Q.config.variant===G5)return Q.element.textContent="",Z;let j=Q7(q,Q.config.max);if(Q.element.textContent=j,Q.element.classList.remove(`${Q.getClass("badge")}--overflow`),typeof q==="number"&&Q.config.max!==void 0&&q>Q.config.max)Q.element.classList.add(`${Q.getClass("badge")}--overflow`);if(j===""||j==="0")Z.hide();else Z.show();return Z},getLabel(){return Q.element.textContent||""},setContent(q){return Z.setLabel(q)},getContent(){return Z.getLabel()},show(){return J.show(),Z},hide(){return J.hide(),Z},toggle(q){return J.toggle(q),Z},isVisible(){return J.isVisible()},setMax(q){if(Q.config.max=q,Q.config.label!==void 0)Z.setLabel(Q.config.label);return Z},setColor(q){return Mq.forEach((j)=>{Q.element.classList.remove(`${Q.getClass("badge")}--${j}`)}),Q.element.classList.add(`${Q.getClass("badge")}--${q}`),Z},setVariant(q){if(Vq.forEach((j)=>{Q.element.classList.remove(`${Q.getClass("badge")}--${j}`)}),Q.element.classList.add(`${Q.getClass("badge")}--${q}`),Q.config.variant=q,q===G5)Q.element.textContent="",Q.element.setAttribute("aria-hidden","true");else if(Q.element.setAttribute("role","status"),Q.config.label!==void 0)Z.setLabel(Q.config.label);return Z},setPosition(q){return Nq.forEach((j)=>{Q.element.classList.remove(`${Q.getClass("badge")}--${j}`)}),Q.element.classList.add(`${Q.getClass("badge")}--${q}`),Z},attachTo(q){if(Q.wrapper&&Q.wrapper.contains(Q.element))Q.wrapper.removeChild(Q.element);let j=document.createElement("div");j.classList.add(Q.getClass("badge-wrapper")),j.style.position="relative";let G=q.parentNode;if(G)G.replaceChild(j,q),j.appendChild(q),j.appendChild(Q.element),Q.element.classList.add(`${Q.getClass("badge")}--positioned`),Q.wrapper=j,Z.wrapper=j;return Z},detach(){if(Q.wrapper&&Q.wrapper.contains(Q.element))Q.wrapper.removeChild(Q.element),Q.element.classList.remove(`${Q.getClass("badge")}--positioned`),document.body.appendChild(Q.element),Q.wrapper=void 0,Z.wrapper=void 0;return Z},destroy(){if($.destroy(),Q.wrapper){let q=Q.wrapper.firstChild,j=Q.wrapper.parentNode;if(j&&q)j.replaceChild(q,Q.wrapper)}},addClass:(...q)=>{return Q.addClass(...q),Z},removeClass:(...q)=>{return Q.removeClass(...q),Z},on:(q,j)=>{return Q.on(q,j),Z},off:(q,j)=>{return Q.off(q,j),Z}};return Z};var W5=T(()=>{O$();Mq=["error","primary","secondary","tertiary","success","warning","info"],Vq=["small","large"],Nq=["top-right","top-left","bottom-right","bottom-left"]});var _q=(J={})=>{let $=o4(J);try{return b(S,g(),E(t4($)),J5($),Q5($),Z5($),q5($),$5(),j5($),C(),(Z)=>z5(n4(Z))(Z))($)}catch(Q){throw console.error("Badge creation error:",Q),new Error(`Failed to create badge: ${Q.message}`)}},e9;var Y5=T(()=>{J6();c();o();K5();W5();O$();e9=_q});var w7=T(()=>{Y5()});var F5=(J)=>{let $=new Map,Q=(j,G)=>`${j}_${G.toString()}`,Z=(j,G)=>(K)=>{try{j(K)}catch(z){console.error(`Error in ${G} handler:`,z)}},q=(j,G)=>{try{J.removeEventListener(j,G)}catch(K){console.warn(`Failed to remove ${j} listener:`,K)}};return{on(j,G,K={}){let z=Z(G,j),W=Q(j,G);return $.set(W,{original:G,enhanced:z,event:j,options:K}),J.addEventListener(j,z,K),this},off(j,G){let K=Q(j,G),z=$.get(K);if(z)q(j,z.enhanced),$.delete(K);return this},pause(){return $.forEach(({enhanced:j,event:G})=>{q(G,j)}),this},resume(){return $.forEach(({enhanced:j,event:G,options:K})=>{J.addEventListener(G,j,K)}),this},destroy(){$.forEach(({enhanced:j,event:G})=>{q(G,j)}),$.clear()},getHandlers(){return new Map($)},hasHandler(j,G){let K=Q(j,G);return $.has(K)}}};var v9=T(()=>{A6();T9()});var W9,I6,Z7,h6,z6,s6,u6,W6;var t6=T(()=>{W9={LINEAR:"linear",CIRCULAR:"circular"},I6={FLAT:"flat",WAVY:"wavy"},Z7={CHANGE:"change",COMPLETE:"complete"},h6={VARIANT:"linear",VALUE:0,MAX:100,BUFFER:0,SHAPE:"flat",SHOW_LABEL:!1,INDETERMINATE:!1},z6={CONTAINER:"progress",LINEAR:"progress--linear",CIRCULAR:"progress--circular",TRACK:"progress__track",INDICATOR:"progress__indicator",BUFFER:"progress__buffer",LABEL:"progress__label",INDETERMINATE:"progress--indeterminate",DISABLED:"progress--disabled",TEST:"progress--test",TRANSITION:"progress--transition"},s6={LINEAR:{MIN_HEIGHT:4,GAP:4,STOP_INDICATOR:4,HEIGHT:4},CIRCULAR:{SIZE:48,GAP:8},COMMON:{STROKE_WIDTH:4}},u6={THIN:4,THICK:8},W6={LINEAR:{AMPLITUDE:3,SPEED:0.88,FREQUENCY:2,INDETERMINATE_FREQUENCY:4,INDETERMINATE_AMPLITUDE:2,POWER:0.8,START_TRANSITION_END:0,END_TRANSITION_START:0.92},CIRCULAR:{AMPLITUDE:6,INDETERMINATE_AMPLITUDE:4,SPEED:1.1,FREQUENCY:10,INDETERMINATE_FREQUENCY:16,POWER:0.8,START_TRANSITION_END:0,END_TRANSITION_START:0.92}}});var m6=(J)=>{return Boolean(J&&typeof J==="object"&&Object.getPrototypeOf(J)===Object.getPrototypeOf({}))},k1=(J,$)=>{let q=$.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split("."),j=J;for(let G=0,K=q.length;G<K;++G){let z=q[G];if(z in j)j=j[z];else return}return j};var _9=(J,$=17)=>{if(!J||!(J instanceof HTMLElement))return{color:"",element:null};let Q=0,Z=J;while(Z&&Q<$){let G=window.getComputedStyle(Z).backgroundColor;if(G.startsWith("var(")){let K=G.match(/var\((--[\w-]+)\)/);if(K){let z=K[1];G=window.getComputedStyle(document.documentElement).getPropertyValue(z).trim()||"transparent"}}if(G&&G!=="transparent"&&G!=="rgba(0, 0, 0, 0)"&&G!=="rgba(0,0,0,0)")return{color:G,element:Z};Z=Z.parentElement,Q++}let q=window.getComputedStyle(document.body).backgroundColor;if(q!=="transparent"&&q!=="rgba(0, 0, 0, 0)")return{color:q,element:document.body};return{color:"rgb(255, 255, 255)",element:null}};var M1=()=>{};function B6(J,$){let Q=`--${u}-${J}`;if($?.onThemeChange)Oq($.onThemeChange);let q=getComputedStyle(document.body).getPropertyValue(Q).trim();if(!q)q=getComputedStyle(document.documentElement).getPropertyValue(Q).trim();if(!q&&$?.fallback)return $.fallback;if(!q)return"";if(typeof $?.alpha==="number"&&/\d+,\s*\d+,\s*\d+/.test(q))return`rgba(${q}, ${$.alpha})`;if(typeof $?.alpha==="number"&&/^#([\da-f]{6}|[\da-f]{3})$/i.test(q)){let j=q.replace("#",""),G,K,z;if(j.length===3)G=parseInt(j[0]+j[0],16),K=parseInt(j[1]+j[1],16),z=parseInt(j[2]+j[2],16);else G=parseInt(j.substring(0,2),16),K=parseInt(j.substring(2,4),16),z=parseInt(j.substring(4,6),16);return`rgba(${G}, ${K}, ${z}, ${$.alpha})`}return q}var P$,C9=null,Dq=()=>{if(C9)return;C9=new MutationObserver((J)=>{for(let $ of J)if($.type==="attributes"&&($.attributeName==="data-theme"||$.attributeName==="data-theme-mode")){P$.forEach((Q)=>Q());break}}),C9.observe(document.body,{attributes:!0,attributeFilter:["data-theme","data-theme-mode"]})},Oq=(J)=>{if(!C9)Dq();return P$.add(J),()=>{P$.delete(J)}};var H5=T(()=>{y6();P$=new Set;if(typeof window!=="undefined")window.addEventListener("unload",()=>{if(C9)C9.disconnect(),C9=null;P$.clear()})});var v7=(J,$)=>{let Z=document.createElement("canvas").getContext("2d");if(!Z)return`rgba(0, 0, 0, ${$})`;Z.fillStyle=J;let q=Z.fillStyle;if(q.startsWith("#")){let j=q.substring(1),G=parseInt(j.substring(0,2),16),K=parseInt(j.substring(2,4),16),z=parseInt(j.substring(4,6),16);return`rgba(${G}, ${K}, ${z}, ${$})`}if(q.startsWith("rgb")){let j=q.match(/\d+/g);if(j){let[G,K,z]=j;return`rgba(${G}, ${K}, ${z}, ${$})`}}return`rgba(0, 0, 0, ${$})`};var k5=(J,$)=>(Q,Z)=>J(Q,Z)?$(Q,Z):Q,M5=(...J)=>J.filter(Boolean).join(" ");var Y9=T(()=>{D7();M1();H5()});var C7=(J,$,Q)=>{let Z=null,q=()=>{if(Z)clearTimeout(Z);Z=window.setTimeout(()=>{Q()},100)};if(typeof ResizeObserver!=="undefined"){let j=new ResizeObserver((G)=>{for(let K of G){let{width:z}=K.contentRect,W=parseFloat($.style.width||"0");if(Math.abs(z-W)>2)q()}});return j.observe(J),()=>{if(Z)clearTimeout(Z);j.disconnect()}}else return window.addEventListener("resize",q),()=>{if(Z)clearTimeout(Z);window.removeEventListener("resize",q)}};var V5=(J,$,Q,Z,q,j,G,K,z)=>{let W=Math.max(100,Math.abs(j-q)*50),Y=(j-q)/W,U=W6.CIRCULAR.SPEED*2*Math.PI/1000;J.beginPath();for(let X=0;X<=W;X++){let _=q+Y*X,H=_*K+z*U,B=Math.sin(H),k=Math.sign(B)*Math.pow(Math.abs(B),W6.CIRCULAR.POWER)*G,N=Z+k,F=$+N*Math.cos(_),V=Q+N*Math.sin(_);if(X===0)J.moveTo(F,V);else J.lineTo(F,V)}J.stroke()},N5=(J,$,Q,Z,q,j=0,G="flat")=>{let{ctx:K,width:z,height:W}=J,Y=E7($.thickness),U=G==="wavy",X=Math.min(z,W),_=q?W6.CIRCULAR.INDETERMINATE_AMPLITUDE:W6.CIRCULAR.AMPLITUDE,H=X/2-Y/2,B=H*(_/100),M=U?E9(Y,B):0,k=H-M,N=z/2,F=W/2;K.clearRect(0,0,z,W);let O=(s6.CIRCULAR.GAP+2*Y)/k,P=-Math.PI/2,L=2*Math.PI-O;K.lineWidth=Y,K.lineCap="round",K.lineJoin="round";let D=q?W6.CIRCULAR.INDETERMINATE_FREQUENCY:W6.CIRCULAR.FREQUENCY;if(q){let y=j%1333/1333,l=(x9)=>{let U6=x9<=0.5?x9*2:2-x9*2;return 0.028+0.722*(U6<0.5?2*U6*U6:1-Math.pow(-2*U6+2,2)/2)},m=()=>{let x9=j/1568*2*Math.PI,U6=Math.floor(j/1333),r6=j%1333/1333,q9=0;if(r6>0.5){let N7=(r6-0.5)*2;q9=0.722*(N7<0.5?2*N7*N7:1-Math.pow(-2*N7+2,2)/2)}return x9+(U6*0.722+q9)*2*Math.PI},s=l(y)*2*Math.PI,k9=m(),L6=P+k9,X6=L6+s;K.strokeStyle=B6("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"}),K.beginPath();let t9=O/2;if(K.arc(N,F,k,X6+t9,L6-t9+2*Math.PI),K.stroke(),K.strokeStyle=B6("sys-color-primary",{fallback:"#6750A4"}),U)V5(K,N,F,k,L6,X6,M,D,j);else K.beginPath(),K.arc(N,F,k,L6,X6),K.stroke();return}let R=Q/Z,A=Math.max(R,0.001),x=0.95,I=L;if(R>=x){let i=(R-x)/(1-x),y=i*i;I=L+O*y}if(R<0.99){let y=P+I*A+O/2,l=P+L+O/2;if(y<l)K.strokeStyle=B6("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"}),K.beginPath(),K.arc(N,F,k,y,l),K.stroke()}K.strokeStyle=B6("sys-color-primary",{fallback:"#6750A4"});let r=M;if(U){let i=W6.CIRCULAR.START_TRANSITION_END,y=W6.CIRCULAR.END_TRANSITION_START;if(R===0&&i>0)r=0;else if(R>0&&R<=i){let l=R/i;r=M*Math.pow(l,2)}else if(R>=y){let l=(R-y)/(1-y),m=1-Math.pow(1-l,2);r=M*(1-m)}if(R>=1)r=0}let a=P,V6=P+I*A;if(U)V5(K,N,F,k,a,V6,r,D,j);else K.beginPath(),K.arc(N,F,k,a,V6),K.stroke()};var _5=T(()=>{t6();Y9();R$()});var h7=(J,$,Q)=>{J.strokeStyle=Q,J.lineWidth=$,J.lineCap="round"},L9=(J,$,Q,Z,q,j,G)=>{if(J.beginPath(),!q||G.amplitude===0)J.moveTo($,Z),J.lineTo(Q,Z);else{let K=$;for(let z=$;z<=Q;z+=1){let W=z*G.frequency+j*G.speed,Y=Math.sin(W),U=Math.sign(Y)*Math.pow(Math.abs(Y),W6.LINEAR.POWER),X=Z+U*G.amplitude;if(z===$)J.moveTo(z,X);else J.lineTo(z,X);K=z}if(K<Q){let z=Q*G.frequency+j*G.speed,W=Math.sin(z),Y=Math.sign(W)*Math.pow(Math.abs(W),W6.LINEAR.POWER),U=Z+Y*G.amplitude;J.lineTo(Q,U)}}J.stroke()},L5=(J,$)=>{let[Q,Z,q]=$;if(J<=Q)return 0.08+0.5814790000000001*(J/Q);else if(J<=Z)return 0.661479;else if(q&&J<=q)return 0.661479;return q?0.661479-0.5814790000000001*((J-q)/(1-q)):0.08},D5=(J,$)=>{for(let q=0;q<$.length-1;q++){let[j,G]=$[q],[K,z]=$[q+1];if(J<=K){let W=(J-j)/(K-j);return G+(z-G)*W}}let[Q,Z]=$[$.length-1];return Z+(220-Z)*((J-Q)/(1-Q))},O5=(J,$,Q,Z,q,j,G=0,K=!0,z="flat")=>{let{ctx:W,width:Y,height:U}=J,X=E7($.thickness),_=U/2,H=z==="wavy",B=X/2,M=Y-B*2,k=s6.LINEAR.GAP,N=Q/Z,F=0.001,V=Math.max(N,0.001),O=B+M*V;W.clearRect(0,0,Y,U);let P=B6("sys-color-primary",{fallback:"#6750A4"}),L=B6("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"});if(j){let V6=G%2000/2000,i=k*2+X/2,y=L5(V6,[0.3665,0.6915]),l=D5(V6,[[0,-120],[0.2,0],[0.5915,83.6714]]),m=V6<=0.5?0:L5(V6,[0.8335,null,0.8335]),s=V6<=0.5?-54.8889:D5(V6,[[0.5,-54.8889],[0.7,25.0389],[0.85,83.6714]]),L6=[{scale:y,translate:l,start:Math.max(B,B+M*l/100),end:Math.min(Y-B,B+M*l/100+M*y)},{scale:m,translate:s,start:Math.max(B,B+M*s/100),end:Math.min(Y-B,B+M*s/100+M*m)}].filter((U6)=>U6.end>U6.start).sort((U6,r6)=>U6.start-r6.start),X6=[];for(let U6=0;U6<L6.length;U6++){let r6=L6[U6];if(X6.length===0)X6.push({...r6});else{let q9=X6[X6.length-1];if(r6.start<=q9.end+i)q9.end=Math.max(q9.end,r6.end);else X6.push({...r6})}}h7(W,X,L);let t9=X;if(X6.length===0)L9(W,B,Y-B,_,!1,0,{amplitude:0,frequency:0,speed:0});else{let U6=X6[0].start;if(U6-B>i+t9)L9(W,B,U6-i,_,!1,0,{amplitude:0,frequency:0,speed:0});if(X6.length===2){if(X6[1].start-X6[0].end>2*i+t9)L9(W,X6[0].end+i,X6[1].start-i,_,!1,0,{amplitude:0,frequency:0,speed:0})}let q9=X6[X6.length-1].end;if(Y-B-q9>i+t9)L9(W,q9+i,Y-B,_,!1,0,{amplitude:0,frequency:0,speed:0})}h7(W,X,P);let x9={amplitude:H?E9(X,W6.LINEAR.INDETERMINATE_AMPLITUDE):0,frequency:W6.LINEAR.INDETERMINATE_FREQUENCY*2*Math.PI/100,speed:0};X6.forEach((U6)=>{L9(W,U6.start,U6.end,_,H,G,x9)});return}let D=W6.LINEAR.START_TRANSITION_END,R=W6.LINEAR.END_TRANSITION_START,w=(k+X)/2;h7(W,X,L);let A=N===0?B+X+k:Math.min(O+w,Y-B);L9(W,A,Y-B,_,!1,0,{amplitude:0,frequency:0,speed:0}),h7(W,X,P);let x=N>=1?Y-B:Math.max(B,O-w),I;if(N===0)I=B+(H?0.1:0);else{let a=X/2;I=Math.max(B+a,x)}let r=H?E9(X,W6.LINEAR.AMPLITUDE):0;if(H){if(N===0&&D>0)r=0;else if(V<=D)r*=Math.pow(V/D,2);else if(V>=R)r*=Math.pow((1-V)/(1-R),2)}if(L9(W,B,I,_,H,G,{amplitude:r,frequency:W6.LINEAR.FREQUENCY*2*Math.PI/100,speed:W6.LINEAR.SPEED*2*Math.PI/1000}),q>0&&q>Q){h7(W,X,B6("sys-color-secondary-container",{fallback:"#E8DEF8"}));let a=B+M*(q/Z);L9(W,O,a,_,!1,0,{amplitude:0,frequency:0,speed:0})}if(N<1&&K){let a=Math.min(X*0.5,2);W.beginPath(),W.arc(Y-B,_,a,0,2*Math.PI),W.fillStyle=P,W.fill()}};var P5=T(()=>{t6();Y9();R$()});var E7=(J="thin")=>{if(typeof J==="number")return J;return J==="thick"?u6.THICK:u6.THIN},E9=(J,$,Q)=>{let q=1+0.3*(4-J)/(J+4),j=$*q;return Q?Math.min(j,Q):j},V1=(J,$,Q,Z)=>{let q=window.devicePixelRatio||1,j=E7(Z?.thickness),{ctx:G}=$;if(Q){let K=Math.max(24,Math.min(Z?.size??s6.CIRCULAR.SIZE,240)),z=0;if(Z?.shape==="wavy"){let Y=K/2-j/2,U=Z?.indeterminate?W6.CIRCULAR.INDETERMINATE_AMPLITUDE:W6.CIRCULAR.AMPLITUDE,X=Y*(U/100);z=E9(j,X)}let W=K+z*2;J.style.width=J.style.height=`${W}px`,J.width=J.height=Math.round(W*q),$.width=$.height=W}else{let K=J.parentElement;if(!K)return;let z=Math.max(K.getBoundingClientRect().width||K.offsetWidth,200),W=0;if(Z?.shape==="wavy"){let U=W6.LINEAR.AMPLITUDE,X=E9(j,U);W=Math.ceil(X*2)}let Y=j+W;J.style.width=`${z}px`,J.style.height=`${Y}px`,J.width=Math.round(z*q),J.height=Math.round(Y*q),$.width=z,$.height=Y}G.setTransform(1,0,0,1,0,0),G.scale(q,q)},R5=(J,$,Q)=>{let Z={canvas:J,ctx:J.getContext("2d"),width:0,height:0,pixelRatio:window.devicePixelRatio||1};return V1(J,Z,$,Q),Z},A5=(J)=>($)=>{let Z=J.variant===W9.CIRCULAR,q=document.createElement("canvas");q.className=`${$.getClass(z6.CONTAINER)}-canvas`,q.style.maxWidth="100%",q.style.maxHeight="100%",q.style.boxSizing="border-box",$.element.appendChild(q);let j=null,G=null,K=null,z=J.thickness,W=J.shape,Y=J.size??s6.CIRCULAR.SIZE,U=J.value??0,X=U,_=0,H=()=>{try{return j=R5(q,Z,{...J,thickness:z,shape:W,size:Y}),$.ctx=j.ctx,!0}catch(D){return console.warn("Canvas initialization failed:",D),!1}};if(!H())requestAnimationFrame(()=>{if(!H())setTimeout(H,100)});$.canvas=q,$.animationTime=0,$.animationId=null,$.wavyAnimationId=null,$.valueAnimationId=null,$.currentShape=W;let B=(D=0)=>{if(!$.state?.indeterminate)return;if($.animationId)cancelAnimationFrame($.animationId),$.animationId=null;let R=0,w=(A)=>{if(!$.state?.indeterminate){M();return}if(R===0)R=A-D;let x=A-R;$.animationTime=x,F(x),$.animationId=requestAnimationFrame(w)};$.animationId=requestAnimationFrame(w)},M=()=>{if($.animationId)cancelAnimationFrame($.animationId),$.animationId=null},k=(D=0)=>{if($.wavyAnimationId)cancelAnimationFrame($.wavyAnimationId),$.wavyAnimationId=null;let R=0,w=(A)=>{if(R===0)R=A-D;let x=A-R;$.animationTime=x,F(x),$.wavyAnimationId=requestAnimationFrame(w)};$.wavyAnimationId=requestAnimationFrame(w)},N=()=>{if($.wavyAnimationId)cancelAnimationFrame($.wavyAnimationId),$.wavyAnimationId=null},F=(D=0)=>{if(!j)return;let R=$.state,w=R?.value??J.value??0,A=R?.max??J.max??100,x=R?.buffer??J.buffer??0,I=R?.indeterminate??J.indeterminate??!1,r={...J,thickness:z,shape:W,size:Y};V1(q,j,Z,r);let a=I||!R?w:U;if(Z)N5(j,r,a,A,I,D,W);else O5(j,r,a,A,x,I,D,!0,W)},V=()=>{if(!j)return;try{let D=R5(q,Z,{...J,thickness:z,shape:W,size:Y});$.ctx=D.ctx,Object.assign(j,D),F()}catch(D){console.warn("Canvas resize failed:",D)}};G=C7($.element,q,()=>{if($.element.offsetWidth>0||Z)V()});let O=B6("sys-color-primary",{onThemeChange:F});K=typeof O==="function"?O:null;let P=()=>{if(!j){requestAnimationFrame(P);return}if(F(),$.state?.indeterminate)if(W==="wavy"||!Z)k();else B();else if(W==="wavy")k()};requestAnimationFrame(P);let L=(D)=>{if(!j)return;let R={...J,thickness:z,shape:W,size:Y,...D};V1(q,j,Z,R),F()};if($.setThickness=(D)=>{z=D,L({thickness:D})},$.setSize=(D)=>{if(!Z)return;Y=Math.max(24,Math.min(D,240)),L({size:Y})},$.getSize=()=>Z?Y:void 0,$.setShape=(D)=>{if(W===D)return;if(W=D,$.currentShape=W,L({shape:D}),$.state?.indeterminate){let R=$.animationTime||0;if(N(),M(),D==="wavy"||!Z)k(R);else B(R)}else if(D==="wavy"){if(!$.wavyAnimationId)k()}else N();F($.animationTime||0)},$.setValue=(D,R=!0)=>{if(X=Math.max(0,Math.min($.state.max,D)),$.state.indeterminate)$.setIndeterminate(!1);if($.valueAnimationId&&R)return;if($.valueAnimationId)cancelAnimationFrame($.valueAnimationId),$.valueAnimationId=null;if(!R){if(U=X,F(),W==="wavy"&&!$.state.indeterminate&&!$.wavyAnimationId)k();if(X>=$.state.max)$.element.dispatchEvent(new CustomEvent("complete",{detail:{value:X,max:$.state.max}}));return}let w=U,A=performance.now(),x=A-_,I=300;if(x<300&&_>0)I=Math.max(100,x*0.9);_=A;let r=(a)=>{let V6=a-A,i=Math.min(V6/I,1),y=i<0.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2;if(U=w+(X-w)*y,!$.wavyAnimationId||W!=="wavy")F(a);if(i<1)$.valueAnimationId=requestAnimationFrame(r);else{if(U=X,$.valueAnimationId=null,W==="wavy"&&!$.state.indeterminate&&!$.wavyAnimationId)k();if(X>=$.state.max)$.element.dispatchEvent(new CustomEvent("complete",{detail:{value:X,max:$.state.max}}))}};$.valueAnimationId=requestAnimationFrame(r)},$.setIndeterminate=(D)=>{if(!$.state){console.warn("[Progress] No state available for setIndeterminate");return}if($.state.indeterminate=D,D){if($.valueAnimationId)cancelAnimationFrame($.valueAnimationId),$.valueAnimationId=null;if(U=$.state.value,W==="wavy"||!Z)k();else B()}else{if(U=$.state.value,M(),W==="wavy"){if(!$.wavyAnimationId)k()}else N();F()}},$.hide=()=>{$.element.classList.add($.getClass(z6.TRANSITION)),$.element.style.opacity="0";let D=()=>{$.element.style.display="none",$.element.removeEventListener("transitionend",D)};return $.element.addEventListener("transitionend",D),[$.animationId,$.wavyAnimationId,$.valueAnimationId].forEach((R)=>{if(R)cancelAnimationFrame(R)}),$.animationId=$.wavyAnimationId=$.valueAnimationId=null,$},$.show=()=>{if($.element.classList.add($.getClass(z6.TRANSITION)),$.element.style.display="",$.element.style.opacity="0",$.element.offsetHeight,$.element.style.opacity="1",$.state?.indeterminate)if(W==="wavy"||!Z)k();else B();else if(W==="wavy")k();return $},$.isVisible=()=>$.element.style.display!=="none"&&$.element.style.opacity!=="0",$.lifecycle){let D=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{if(G)G();if(K)K();[$.animationId,$.wavyAnimationId,$.valueAnimationId].forEach((R)=>{if(R)cancelAnimationFrame(R)}),D()}}return Object.assign($,{startWavyAnimation:k,stopWavyAnimation:N,startIndeterminateAnimation:B,stopIndeterminateAnimation:M}),{...$,canvas:q,get ctx(){return j?.ctx},draw:F,resize:V}};var R$=T(()=>{t6();Y9();_5();P5()});var w5=(J)=>($)=>{if(J.indeterminate&&$.element)f($.element,z6.INDETERMINATE),$.element.removeAttribute("aria-valuenow");if($.element){let j=$.getClass?.(z6.CONTAINER)||"";$.element.classList.remove(`${j}--thin`,`${j}--thick`)}if(J.shape&&J.shape!==I6.FLAT&&$.element){if(!$.element.classList.contains($.getClass?.(z6.CIRCULAR)||"")){let G=$.getClass?.(z6.CONTAINER)||"";f($.element,`${G}--${J.shape}`)}}let Q={value:J.value??0,max:J.max??100,buffer:J.buffer??0,indeterminate:J.indeterminate===!0,thickness:J.thickness??"thin",shape:J.shape??I6.FLAT,labelFormatter:J.labelFormatter??((j,G)=>`${Math.round(j/G*100)}%`),showLabel:J.showLabel},Z=$.lifecycle?.init,q=$.lifecycle?.destroy;return $.state=Q,$.lifecycle={init:()=>{if(requestAnimationFrame(()=>{try{if(Q.indeterminate)$.setIndeterminate?.(!0);else if($.setValue?.(Q.value),J.buffer!==void 0)$.setBuffer?.(Q.buffer);if(Q.shape!==I6.FLAT&&$.setShape)$.setShape(Q.shape);if(Q.thickness)if($.setThickness)$.setThickness(Q.thickness);else $.state.thickness=Q.thickness}catch(j){console.error("Error initializing progress state:",j)}}),Z)Z()},destroy:()=>{if(q)q()}},{...$,state:Q}};var x5=T(()=>{t6();v9()});var y5=(J)=>($)=>{let{element:Q,getClass:Z,canvas:q}=$,j=Q.classList.contains(Z(z6.CIRCULAR)),G=(Y,U)=>{Q.dispatchEvent(new CustomEvent(Y,{detail:U}))},K=(Y,U)=>{Q.setAttribute("aria-valuenow",Y.toString());let X=$.label;if(X){let _=J.label?.formatter||((H,B)=>`${Math.round(H/B*100)}%`);X.textContent=_(Y,U)}if(typeof $.draw==="function")$.draw()},z=(Y)=>{if(Y){if(f(Q,z6.INDETERMINATE),Q.removeAttribute("aria-valuenow"),!j){if((J.shape?.getShape()||I6.FLAT)!=="wavy"&&$.startIndeterminateAnimation)$.startIndeterminateAnimation()}}else if(q6(Q,z6.INDETERMINATE),$.stopIndeterminateAnimation)$.stopIndeterminateAnimation();if(typeof $.draw==="function")$.draw()};if(J.state.isIndeterminate())z(!0);let W={element:Q,track:q,indicator:q,buffer:q,getClass:Z,getValue(){return J.value.getValue()},setValue(Y,U=!0){let X=J.value.getValue(),_=J.value.getMax();if(J.value.setValue(Y),X!==Y){Q.setAttribute("aria-valuenow",Y.toString());let H=$.label;if(H){let M=J.label?.formatter||((k,N)=>`${Math.round(k/N*100)}%`);H.textContent=M(Y,_)}let B={value:Y,max:_};if(G(Z7.CHANGE,B),$.setValue&&typeof $.setValue==="function")$.setValue(Y,U);else K(Y,_)}return W},getMax(){return J.value.getMax()},getBuffer:()=>J.buffer.getBuffer(),setBuffer(Y){if(J.buffer.setBuffer(Y),!J.state.isIndeterminate()&&typeof $.draw==="function")$.draw();return W},setIndeterminate(Y){if(J.state.isIndeterminate()===Y)return W;return J.state.setIndeterminate(Y),z(Y),W},isIndeterminate:()=>J.state.isIndeterminate(),showLabel(){if(J.label?.show)J.label.show();return W},hideLabel(){if(J.label?.hide)J.label.hide();return W},setLabelFormatter(Y){if(J.label?.format)J.label.format(Y);let U=$.label||$.state?.label;if(U)U.textContent=Y(J.value.getValue(),J.value.getMax());return W},getThickness(){return J.thickness?.getThickness()||u6.THIN},setThickness(Y){if(J.thickness)J.thickness.setThickness(Y);if($.setThickness)$.setThickness(Y);return W},getShape(){if(J.shape&&typeof J.shape.getShape==="function")return J.shape.getShape();return I6.FLAT},setShape(Y){return $.setShape?.(Y),W},setSize(Y){if($.setSize)$.setSize(Y);return W},getSize(){return $.getSize?$.getSize():void 0},enable(){return J.disabled.enable(),W},disable(){return J.disabled.disable(),W},isDisabled:J.disabled.isDisabled,hide(){if($.hide)$.hide();return W},show(){if($.show)$.show();return W},isVisible(){return $.isVisible?$.isVisible():Q.style.display!=="none"},on(Y,U){return Q.addEventListener(Y,U),W},off(Y,U){return Q.removeEventListener(Y,U),W},addClass(...Y){return Y.forEach((U)=>Q.classList.add(U)),W},destroy(){J.lifecycle.destroy()},disabled:{enable(){J.disabled.enable()},disable(){J.disabled.disable()},isDisabled:J.disabled.isDisabled},lifecycle:{destroy(){J.lifecycle.destroy()}}};if($.state?.showLabel===!0){if(J.label?.show)J.label.show()}return W};var T5=T(()=>{t6();v9()});var Pq,I5=(J={})=>{return d(Pq,J,"progress")},S5=(J)=>{let $=J.indeterminate===!0,Q=J.variant===W9.CIRCULAR,Z={role:"progressbar","aria-valuemin":"0","aria-valuemax":(J.max||100).toString()};if(!$&&J.value!==void 0)Z["aria-valuenow"]=J.value.toString();if(J.disabled===!0)Z["aria-disabled"]="true";let q=[J.class,z6.CONTAINER,Q?z6.CIRCULAR:z6.LINEAR].filter(Boolean);if(!Q&&J.shape&&J.shape!==I6.FLAT)q.push(`${z6.CONTAINER}--${J.shape}`);return p(J,{tag:"div",attributes:Z,className:q})},b5=(J)=>{if(!J.state)J.state={value:0,max:100,buffer:0,indeterminate:!1,thickness:"thin",shape:h6.SHAPE,labelFormatter:($,Q)=>`${Math.round($/Q*100)}%`};return{value:{getValue:()=>J.state.value,setValue:($)=>{if(J.state){let Q=Math.max(0,Math.min(J.state.max,$));if(J.state.previousValue=J.state.value,J.state.value=Q,J.state.label)J.state.label.textContent=J.state.labelFormatter(Q,J.state.max);if(typeof J.setValue==="function")J.setValue(Q);else if(J.draw)J.draw()}},getMax:()=>J.state.max},buffer:{getBuffer:()=>J.state.buffer,setBuffer:($)=>{J.state.buffer=Math.max(0,Math.min(J.state.max,$))}},disabled:{enable:()=>J.disabled?.enable?.()||void 0,disable:()=>J.disabled?.disable?.()||void 0,isDisabled:()=>J.disabled?.isDisabled?.()||!1},label:{show:()=>{if(!J.state.label){let $=document.createElement("div");$.className=`${J.getClass(z6.LABEL)}`,$.textContent=J.state.labelFormatter(J.state.value,J.state.max),J.element.appendChild($),J.state.label=$,J.label=$}},hide:()=>{if(J.state.label)J.state.label.remove(),J.state.label=void 0,J.label=void 0},format:($)=>{J.state.labelFormatter=$},formatter:J.state.labelFormatter},thickness:{getThickness:()=>{let $=J.state.thickness;if($==="thin")return u6.THIN;else if($==="thick")return u6.THICK;else if(typeof $==="number")return $;return u6.THIN},setThickness:($)=>{if(J.state.thickness=$,J.draw)J.draw()}},shape:{getShape:()=>J.state.shape,setShape:($)=>{if(J.state.shape=$,J.setShape)J.setShape($)}},state:{setIndeterminate:($)=>{if(J.state){if(J.state.indeterminate=$,typeof J.setIndeterminate==="function")J.setIndeterminate($);else if(J.draw)J.draw()}},isIndeterminate:()=>J.state.indeterminate},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()||void 0}}};var v5=T(()=>{t();t6();Pq={variant:h6.VARIANT,value:h6.VALUE,max:h6.MAX,buffer:h6.BUFFER,showLabel:h6.SHOW_LABEL,thickness:"thin",shape:h6.SHAPE}});var C5={};E8(C5,{default:()=>A$});var Rq=(J={})=>{let $=I5(J);try{let Q=b(S,g(),E(S5($)),K6($),G6($),w5($),A5($),(Z)=>{return y5(b5(Z))(Z)},C())($);if(Q.lifecycle?.init)Q.lifecycle.init();return Q}catch(Q){throw console.error("Progress creation error:",Q),new Error(`Failed to create progress: ${Q.message}`)}},A$;var N1=T(()=>{J6();c();o();R$();x5();T5();v5();A$=Rq});var Aq=async(J)=>{let{default:$}=await Promise.resolve().then(() => (N1(),C5));return $(J)},E5=(J)=>($)=>{if(!J.progress)return $;let Q={},Z=typeof J.progress==="boolean"?{variant:"circular",size:20,thickness:2,indeterminate:!0}:(()=>{let{on:Y,...U}=J.progress;if(Y)Q=Y;return{variant:"circular",size:20,thickness:2,indeterminate:!0,...U}})(),q=null,j=null,G=!1,K="",z=async()=>{if(q)return q;if(!j)j=Aq(Z).then((Y)=>{return q=Y,f(q.element,$.getClass("button-progress")),q.element.style.display="none",Object.entries(Q).forEach(([U,X])=>{q.on(U,X)}),$.progress=q,q});return j},W=()=>{let Y=$.element.querySelector(`.${$.getClass("button-icon")}`);if(Y&&Y.nextSibling)return Y.nextSibling;return $.element.firstChild};if($.showProgress=async function(){let Y=await z();if(Y.element){if(!$.element.contains(Y.element)){let X=W();if(X)$.element.insertBefore(Y.element,X);else $.element.appendChild(Y.element)}Y.element.style.display="",f($.element,`${$.getClass("button")}--progress`);let U=$.element.querySelector(`.${$.getClass("button-icon")}`);if(U instanceof HTMLElement)U.style.display="none"}return $},$.showProgressSync=function(){return $.showProgress(),$},$.hideProgress=async function(){if(!q)return $;q.element.style.display="none",q6($.element,`${$.getClass("button")}--progress`);let Y=$.element.querySelector(`.${$.getClass("button-icon")}`);if(Y instanceof HTMLElement)Y.style.display="";return $},$.hideProgressSync=function(){return $.hideProgress(),$},$.setProgress=async function(Y){return(await z()).setValue(Y),$},$.setProgressSync=function(Y){return $.setProgress(Y),$},$.setIndeterminate=async function(Y){return(await z()).setIndeterminate(Y),$},$.setIndeterminateSync=function(Y){return $.setIndeterminate(Y),$},$.setLoading=async function(Y,U){if(Y&&!G){if($.setText&&$.getText)K=$.getText();if(G=!0,await $.showProgress(),$.disabled?.disable)$.disabled.disable();if(U&&$.setText)$.setText(U)}else if(!Y&&G){if(G=!1,await $.hideProgress(),$.disabled?.enable)$.disabled.enable();if(U&&$.setText)$.setText(U);else if(K&&$.setText)$.setText(K)}return $},$.setLoadingSync=function(Y,U){return $.setLoading(Y,U),$},$.lifecycle){let Y=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(q)q.destroy();if(q&&q.element.parentNode)q.element.parentNode.removeChild(q.element);Y()}}if(J.showProgress)z().then(()=>{$.showProgress()});return $};var h5=T(()=>{v9()});var u5=(J={},$={})=>{let Q={...J},Z=C6(),q=new Map,j=$.middleware||[],G=(z,W)=>{Z.emit("change",z,W)},K=(z,W)=>{return j.reduce((Y,U)=>U(Y,W),z)};return{getState:()=>{let z={};return q.forEach((W,Y)=>{z[Y]=W(Q)}),{...Q,...z}},setState:(z)=>{let W={...Q},Y=typeof z==="function"?z(Q):{...Q,...z};Q=K(Y,W),G(Q,W)},subscribe:(z)=>Z.on("change",z),derive:(z,W)=>{return q.set(z,W),()=>{q.delete(z)}},select:(z)=>z(Q),reset:()=>{Q={...J},G(Q,{})}}},f5=(J,$)=>{return console.log("State change:",{old:$,new:J,diff:Object.keys(J).reduce((Q,Z)=>{if(J[Z]!==$[Z])Q[Z]={from:$[Z],to:J[Z]};return Q},{})}),J},g5=(J)=>($)=>Object.keys($).reduce((Q,Z)=>{if(J($[Z],Z))Q[Z]=$[Z];return Q},{});var d5=()=>{};var l5=(J,$={})=>{let Q=!1,Z=C6();return{onMount:(q)=>Z.on("mount",q),onUnmount:(q)=>Z.on("unmount",q),mount:()=>{if(!Q)Q=!0,Z.emit("mount")},unmount:()=>{if(Q)Q=!1,Z.emit("unmount"),Z.clear()},isMounted:()=>Q,destroy(){if(Q)this.unmount();if($.events)$.events.destroy();if($.text){let q=$.text.getElement();if(q)q.remove()}if($.icon){let q=$.icon.getElement();if(q)q.remove()}if(J)J.remove()}}};var r5=()=>{};var p5=(J)=>{return{enable(){return J.disabled=!1,J.removeAttribute("disabled"),this},disable(){return J.disabled=!0,J.setAttribute("disabled","true"),this},toggle(){if(J.disabled)this.enable();else this.disable();return this},isDisabled(){return J.disabled===!0}}};function w6(J){return J&&typeof J==="object"&&"element"in J}function u7(){return document.createDocumentFragment()}function wq(...J){return o6(...J)}function h9(J,$=!1,Q=!1){if(!J||$)return{...J};if(!(J.class||J.className||J.rawClass))return{...J};let q={...J};if(q.className){if(!q.class)q.class=q.className;else{let j=wq([q.class,q.className]);q.class=j.join(" ")}delete q.className}if(q.class&&!$){if(typeof q.class==="string"){let j=q.class.split(/\s+/).filter(Boolean);if(Q)q.class=j.map((G)=>{if(!G||G.startsWith(D9))return G;if(G.includes("__")){let[K,z]=G.split("__");return`${D9}${K}__${z}`}else if(G.includes("--")){let[K,z]=G.split("--");return`${D9}${K}--${z}`}return`${D9}${G}`}).join(" ");else q.class=j.map((G)=>G&&!G.startsWith(D9)?`${D9}${G}`:G).filter(Boolean).join(" ")}else if(Array.isArray(q.class))q.class=q.class.filter(Boolean).map((j)=>typeof j==="string"&&!j.startsWith(D9)?`${D9}${j}`:j).join(" ")}return q}function w$(J){let $={};if(!J||typeof J!=="object")return $;for(let Q in J){let Z=J[Q];if(Z&&typeof Z!=="function"&&(Z instanceof HTMLElement||typeof SVGElement!=="undefined"&&Z instanceof SVGElement||w6(Z)))$[Q]=Z}return $}var D9;var f7=T(()=>{y6();v9();D9=`${u}-`});function n6(J){let $=w$(J);return{layout:J,element:J.element,component:$,get(Z){return J[Z]??null},getAll(){return $},destroy(){let Z=J.element;if(Z){if(w6(Z)&&typeof Z.destroy==="function")Z.destroy();else if(w6(Z)&&Z.element?.parentNode)Z.element.parentNode.removeChild(Z.element);else if(Z instanceof HTMLElement&&Z.parentNode)Z.parentNode.removeChild(Z)}for(let q in J){if(q==="element")continue;let j=J[q];if(w6(j)&&typeof j.destroy==="function")j.destroy()}}}}var g7=T(()=>{f7()});function x$(J,$=null,Q=0,Z={}){Q++;let q={},j=[],G=u7(),K=null;if(!Array.isArray(J))return console.error("Schema is not an array!",$,Q,J),n6(q);let z=Z.creator||v;for(let W=0;W<J.length;W++){let Y=J[W];if(!Y)continue;if(Array.isArray(Y)){let F=x$(Y,K||$,Q,Z);Object.assign(q,F.layout);continue}let U,X,_;if(typeof Y==="function"){U=Y;let N=J[W+1],F=J[W+2];if(typeof N==="string")if(X=N,W++,m6(F))_=F,W++;else _={};else if(m6(N))_=N,W++;else _={}}else if(typeof Y==="string"){U=z,X=Y;let N=J[W+1];if(m6(N))_=N,W++;else _={};if(U===v&&!("tag"in _))_.tag="div"}else if(m6(Y))U=z,_=Y;else{console.warn("Skipping unsupported item type:",Y);continue}let H=J[W+1];if(m6(H)&&!Array.isArray(H)&&typeof H.prefix!=="undefined")Object.assign(_,H),W++;let M=("prefix"in _?_.prefix:Z.prefix!==!1)?h9(_):{..._};if(X&&!("name"in M)&&!(U===v||U.isElement))M.name=X;K=u9(U,M);let k=w6(K)?K.element:K;if(Q===1)q.element=k;if(X)q[X]=K,j.push([X,K]);if(K){if("insert"in K&&typeof K.insert==="function")K.insert(G);else G.appendChild(k);if($){if(K._container=$,"onInserted"in K&&typeof K.onInserted==="function")K.onInserted($)}}}if($&&G.hasChildNodes())(w6($)?$.element:$).appendChild(G);return q.components=j,n6(q)}var s5=T(()=>{A6();f7();g7();d7();Y9()});function y$(J,$=null,Q={}){let Z={},q=Q.creator||v;if(J.element&&!$){let K=J.element,z=K.creator||q,W=K.options||{},Y=Q.prefix!==!1?h9(W):{...W},U=u9(z,Y),X=w6(U)?U.element:U;if(Z.element=U,K.name)Z[K.name]=U;if(K.children){let _=u7(),H=[];for(let B in K.children){let M=K.children[B];if(M&&!M.name)M.name=B;let k=y$({[B]:M},_,Q);H.push(k.layout)}X.appendChild(_);for(let B of H)Object.assign(Z,B)}return n6(Z)}let j=$?u7():null,G=[];for(let K in J){let z=J[K];if(!z)continue;let W=z.creator||q,Y=z.options||{},X=("prefix"in Y?Y.prefix:Q.prefix!==!1)?h9(Y):{...Y};if(!z.name&&K!=="element")z.name=K;let _=u9(W,X);if(Z[K]=_,z.name&&z.name!==K)Z[z.name]=_;let H=w6(_)?_.element:_;if(j)j.appendChild(H);if(z.children){let B=typeof SVGElement!=="undefined"&&H instanceof SVGElement,M=y$(z.children,H,Q);if(G.push(M.layout),B)Object.assign(Z,M.layout)}}if($&&j)(w6($)?$.element:$).appendChild(j);for(let K of G)Object.assign(Z,K);return n6(Z)}var m5=T(()=>{A6();f7();g7();d7()});function _1(J){if(!J)return;Array.from(J.classList).filter((Z)=>Z.startsWith("layout--")||Z.includes("-layout--")).forEach((Z)=>{J.classList.remove(Z)})}function f9(J){return O6(J,"layout--stack")?"stack":O6(J,"layout--row")?"row":O6(J,"layout--grid")?"grid":""}function T$(J,$,Q=!0){if(!J||!$)return;if(Q)_1(J);if($.type)f(J,`layout--${$.type}`);if($.gap!==void 0){let Z=$.type||f9(J);if(Z)f(J,`layout--${Z}-gap-${$.gap}`)}if($.align){let Z=$.type||f9(J);if(Z)f(J,`layout--${Z}-${$.align}`)}if($.justify){let Z=$.type||f9(J);if(Z)f(J,`layout--${Z}-justify-${$.justify}`)}if($.type==="grid"||f9(J)==="grid"){if(typeof $.columns==="number")f(J,`layout--grid-cols-${$.columns}`);else if($.columns==="auto-fill")f(J,"layout--grid-fill");else if($.columns==="auto-fit")f(J,"layout--grid-cols-auto-fit");if($.dense)f(J,"layout--grid-dense");if($.autoHeight)f(J,"layout--grid-auto-height")}if($.type==="row"||f9(J)==="row"){if($.wrap===!1||$.wrap==="nowrap")f(J,"layout--row-nowrap");else if($.wrap==="reverse")f(J,"layout--row-wrap-reverse");if($.mobileStack)f(J,"layout--row-mobile-stack");if($.mobileScroll)f(J,"layout--row-mobile-scroll")}if($.class)$.class.split(" ").filter(Boolean).forEach((Z)=>{J.classList.add(Z)})}function I$(J,$){if(!J||!$)return;if(f(J,"layout__item"),$.width&&$.width>=1&&$.width<=12)f(J,`layout__item--${$.width}`);if($.sm)f(J,`layout__item--sm-${$.sm}`);if($.md)f(J,`layout__item--md-${$.md}`);if($.lg)f(J,`layout__item--lg-${$.lg}`);if($.xl)f(J,`layout__item--xl-${$.xl}`);if($.span)f(J,`layout__item--span-${$.span}`);if($.rowSpan)f(J,`layout__item--row-span-${$.rowSpan}`);if($.order)if(typeof $.order==="number")f(J,`layout__item--order-${$.order}`);else f(J,`layout__item--order-${$.order}`);if($.align)f(J,`layout__item--self-${$.align}`);if($.auto)f(J,"layout__item--auto")}var L1=T(()=>{T9()});function u9(J,$={}){try{let{layout:Q,layoutItem:Z,style:q,attributes:j}=$,G=$.events||$.event,K={...$};delete K.layout,delete K.layoutItem,delete K.events,delete K.event;let W=typeof J==="function"&&Object.getOwnPropertyDescriptor(J,"prototype")?.writable===!1?new J(K):J(K);if(W){let Y=W.element||(W instanceof HTMLElement?W:null);if(Y){if(Q)T$(Y,Q);if(Z)I$(Y,Z);if(q&&typeof q==="object")Object.assign(Y.style,q);if(j&&typeof j==="object"){for(let[U,X]of Object.entries(j))if(X!==void 0&&X!==null)Y.setAttribute(U,X.toString())}if(G){if(typeof G==="object"&&!Array.isArray(G)){for(let[U,X]of Object.entries(G))if(typeof X==="function")Y.addEventListener(U,X)}else if(Array.isArray(G)){for(let U of G)if(Array.isArray(U)&&U.length>=2){let[X,_]=U;if(typeof X==="string"&&typeof _==="function")Y.addEventListener(X,_)}}}}}return W}catch(Q){return console.error("Error creating component instance:",Q),document.createElement("div")}}function D1(J){return Array.isArray(J)&&J.length>=3&&typeof J[0]==="function"&&typeof J[1]==="string"&&m6(J[2])}function S$(J,$=null,Q=0,Z={}){if(!J)return console.warn("Empty schema provided to layout processor"),{layout:{},element:document.createElement("div"),component:{},get:()=>null,getAll:()=>({}),destroy:()=>{}};if(D1(J))return x$(J,$,Q,Z);return Array.isArray(J)?x$(J,$,Q,Z):y$(J,$,Z)}var d7=T(()=>{s5();m5();Y9();L1()});function g9(J,$=null,Q={}){if(typeof J==="function")J=J();if(typeof J==="string"){let Z=document.createElement("template");Z.innerHTML=J.trim();let q=Z.content;if($&&q.hasChildNodes())$.appendChild(q);let j={element:q.firstElementChild};return n6(j)}return S$(J,$,0,Q)}var b$=T(()=>{d7();g7()});function q7(J,$,...Q){if(J===P1)return Q.flat(1/0).filter(Boolean);let Z=$||{};if(Z.style&&typeof Z.style==="object")Z.style=Object.entries(Z.style).map(([K,z])=>{return`${K.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}: ${z}`}).join("; ");let q=Z.id||Z.name||`el-${Math.floor(Math.random()*1e4)}`,j={...Z};delete j.id,delete j.name;let G=Q.flat(1/0).filter((K)=>K!==null&&K!==void 0&&K!==!1);if(typeof J==="function")return[J,q,j,G.length>0?O1(G):void 0].filter(Boolean);else if(typeof J==="string")return[v,q,{...j,tag:J},G.length>0?O1(G):void 0].filter(Boolean);return[]}function O1(J){let $=[];for(let Q of J)if(typeof Q==="string"||typeof Q==="number"||typeof Q==="boolean")$.push(String(Q));else if(Array.isArray(Q))$.push(...O1(Q));else if(Q&&typeof Q==="object")$.push(Q);return $}function a5(J,$){return g9(J,$)}var P1;var R1=T(()=>{A6();b$();P1=Symbol("Fragment")});var c5;var v$=T(()=>{f7();b$();g7();d7();L1();R1();b$();c5=g9});var Y6,i5,C$=(J={})=>{let $=new Map,Q=new Set,Z=null,q=null,j=null,G=!1,K=!1,z=null,W=[],Y={event:Y6.CHANGE,data:null},U=J.transform||((M)=>M),X=J.validate||(()=>!0);function _(M,k){if(Q.size===0)return;Y.event=M,Y.data=k,W.length=0,Q.forEach((N)=>W.push(N));for(let N=0;N<W.length;N++)W[N](Y)}function H(){if(G&&j!==null)return j;if(!Z&&!q){let N=Array.from($.values());return j=N,G=!0,N}let M=Array.from($.values()),k=M;if(Z)k=M.filter(Z);if(q)k.sort(q);return j=k,G=!0,k}function B(M){if(!Array.isArray(M)){if(!X(M))return[];return[U(M)]}if(M.length===0)return[];let k=[];for(let N=0;N<M.length;N++)if(X(M[N])){let F=U(M[N]);if(F.id)k.push(F);else throw new Error("Items must have an id property")}return k}return{subscribe(M){return Q.add(M),()=>{Q.delete(M)}},getItems:H,getSize(){return $.size},isLoading(){return K},getError(){return z},query(M){Z=M,G=!1,_(Y6.CHANGE,H())},sort(M){q=M,G=!1,_(Y6.CHANGE,H())},async add(M){try{K=!0,_(Y6.LOADING,!0);let k=B(M);if(k.length===0)return k;for(let N=0;N<k.length;N++)$.set(k[N].id,k[N]);return G=!1,_(Y6.ADD,k),_(Y6.CHANGE,H()),k}catch(k){throw z=k instanceof Error?k:new Error(String(k)),_(Y6.ERROR,z),z}finally{K=!1,_(Y6.LOADING,!1)}},async update(M){try{K=!0,_(Y6.LOADING,!0);let k=Array.isArray(M)?M:[M];if(k.length===0)return[];for(let F=0;F<k.length;F++)if(!$.has(k[F].id))throw new Error(`Item with id ${k[F].id} not found`);let N=B(k);for(let F=0;F<N.length;F++)$.set(N[F].id,N[F]);return G=!1,_(Y6.UPDATE,N),_(Y6.CHANGE,H()),N}catch(k){throw z=k instanceof Error?k:new Error(String(k)),_(Y6.ERROR,z),z}finally{K=!1,_(Y6.LOADING,!1)}},async remove(M){try{K=!0,_(Y6.LOADING,!0);let k=Array.isArray(M)?M:[M];if(k.length===0)return[];for(let N=0;N<k.length;N++)if(!$.has(k[N]))throw new Error(`Item with id ${k[N]} not found`);for(let N=0;N<k.length;N++)$.delete(k[N]);return G=!1,_(Y6.REMOVE,k),_(Y6.CHANGE,H()),k}catch(k){throw z=k instanceof Error?k:new Error(String(k)),_(Y6.ERROR,z),z}finally{K=!1,_(Y6.LOADING,!1)}},clear(){$.clear(),Z=null,q=null,j=null,G=!1,_(Y6.CHANGE,[])}}};var l7=T(()=>{Y6={CHANGE:"change",ADD:"add",UPDATE:"update",REMOVE:"remove",ERROR:"error",LOADING:"loading"},i5={EQ:"eq",NE:"ne",GT:"gt",GTE:"gte",LT:"lt",LTE:"lte",IN:"in",NIN:"nin",CONTAINS:"contains",STARTS_WITH:"startsWith",ENDS_WITH:"endsWith"}});var x6,E$=(J={})=>{return{handleError:(Q,Z)=>{throw J.onError?.(Q,Z),Q}}};var A1=T(()=>{x6={EQ:"eq",NE:"ne",GT:"gt",GTE:"gte",LT:"lt",LTE:"lte",IN:"in",NIN:"nin",CONTAINS:"contains",STARTS_WITH:"startsWith",ENDS_WITH:"endsWith"}});var xq,h$=(J={})=>{let $=E$(J),Q=null,Z=new Map,q=new Map,j={strategy:J.pagination?.strategy||"cursor",cursorParamName:J.pagination?.cursorParamName||"cursor",pageParamName:J.pagination?.pageParamName||"page",perPageParamName:J.pagination?.perPageParamName||"per_page",offsetParamName:J.pagination?.offsetParamName||"offset",limitParamName:J.pagination?.limitParamName||"limit",defaultPageSize:J.pagination?.defaultPageSize||20},G=(H)=>{if(!H)return"http://localhost";if(/^https?:\/\//i.test(H))return H;if(H.startsWith("/"))return`${window.location.origin}${H}`;return`http://${H}`},K=(H,B={})=>{try{let M=H+JSON.stringify(B);if(q.has(M))return q.get(M);let k=G(J.base),N=new URL(k+H);if(Object.entries(B).forEach(([V,O])=>{if(Array.isArray(O))O.forEach((P)=>N.searchParams.append(V,P));else if(O!==null&&O!==void 0)N.searchParams.append(V,String(O))}),J.base&&J.base.startsWith("/")){let V=`${N.pathname}${N.search}`;return q.set(M,V),V}let F=N.toString();return q.set(M,F),F}catch(M){throw console.error("Error building URL:",M,{base:J.base,endpoint:H,params:B}),M}},z=(H)=>{let B={};return Object.entries(H).forEach(([M,k])=>{if(typeof k==="object")Object.entries(k).forEach(([N,F])=>{let V=xq[N];if(V)B[`${M}_${V}`]=F});else B[M]=k}),B},W=async(H,B={})=>{if(Q)Q.abort();Q=new AbortController;try{let M=await fetch(H,{...B,headers:{"Content-Type":"application/json",...J.headers,...B.headers},signal:Q.signal});if(!M.ok){let N;try{N=await M.json()}catch{N={message:`HTTP error ${M.status}`}}return console.error("API error response:",N),$.handleError(new Error(N.message||"API request failed"))}let k=M.headers.get("content-type");if(k&&k.includes("application/json"))return await M.json();else return await M.text()}catch(M){if(console.error("API request error:",M),M.name==="AbortError")return null;return $.handleError(M)}finally{Q=null}},Y=(H)=>{if(!J.cache)return null;let B=Z.get(H);if(!B)return null;let{data:M,timestamp:k}=B;if(Date.now()-k>300000)return Z.delete(H),null;return M},U=(H,B)=>{if(!J.cache)return;Z.set(H,{data:B,timestamp:Date.now()})},X=(H={},B={})=>{let M={};switch(j.strategy){case"cursor":{let N=H.cursor||B.cursor;if(N)M[j.cursorParamName]=N;let F=H.limit||B.limit||j.defaultPageSize;M[j.limitParamName]=F;break}case"offset":{let N=H.offset!==void 0?H.offset:B.offset!==void 0?B.offset:0;M[j.offsetParamName]=N;let F=H.limit||B.limit||j.defaultPageSize;M[j.limitParamName]=F;break}case"page":{let N=H.page!==void 0?H.page:B.page!==void 0?B.page:H.cursor?H.cursor:1;M[j.pageParamName]=N;let F=H.per_page||H.perPage||H.limit||B.per_page||B.perPage||B.limit||j.defaultPageSize;M[j.perPageParamName]=F;break}}return M},_=(H,B={},M={})=>{if(J.adapter?.parseResponse)return J.adapter.parseResponse(H);if(H&&H.items)return H;if(Array.isArray(H))return{items:H,meta:{cursor:null,hasNext:!1}};let k=H.data||H.items||H.results||H.content||[],N=H.meta||H.pagination||H.page||{},F=N.total||H.total||k.length,V={cursor:null,hasNext:!1,total:F};switch(j.strategy){case"cursor":{if(N.next||N.nextCursor||N.nextPage)V.cursor=String(N.next||N.nextCursor||N.nextPage),V.hasNext=!0;else if(N.hasMore||N.hasNext)V.hasNext=Boolean(N.hasMore||N.hasNext),V.cursor=N.cursor||(N.page?String(Number(N.page)+1):null);else{let P=B.limit||M.limit||j.defaultPageSize;if(V.hasNext=k.length>=P,V.hasNext&&k.length>0){let L=k[k.length-1];V.cursor=L.id||L._id||String(k.length)}}break}case"offset":{let P=Number(B.offset||M.offset||N.offset||0),L=Number(B.limit||M.limit||N.limit||j.defaultPageSize),D=k.length;if(F!==void 0)V.hasNext=P+D<F;else V.hasNext=D>=L;V.cursor=V.hasNext?String(P+D):null,V.offset=P;break}case"page":{let P=Number(B.page||M.page||N.page||N.current_page||1),L=Number(B.per_page||B.perPage||B.limit||M.per_page||M.perPage||M.limit||N.per_page||N.perPage||N.size||N.limit||j.defaultPageSize);V.page=P;let D=Number(N.totalPages||N.total_pages||N.pages||N.pageCount||0);if(D>0)V.hasNext=P<D,V.pages=D;else if(F!==void 0){let R=Math.ceil(F/L);V.hasNext=P<R,V.pages=R}else V.hasNext=k.length>=L;V.cursor=V.hasNext?String(P+1):null;break}}return{items:k,meta:V}};return{...$,create:async(H)=>{let B=K(J.endpoints?.create||"/create"),M=await W(B,{method:"POST",body:JSON.stringify({items:H})});return _(M)},read:async(H={},B={})=>{let M={...H};["cursor","page","offset","limit","per_page","perPage","sort","fields","search"].forEach((w)=>{delete M[w]});let k=z(M),N=X(H,B),F={};if(H.search||B.search)F.search=H.search||B.search;if(H.sort||B.sort)F.sort=H.sort||B.sort;if(H.fields||B.fields)F.fields=H.fields||B.fields;let V={...k,...N,...F};Object.keys(V).forEach((w)=>{if(V[w]===void 0)delete V[w]});let O=K(J.endpoints?.list||"/list",V),P=O.toString(),L=Y(P);if(L)return L;let D=await W(O),R=_(D,H,B);return U(P,R),R},update:async(H)=>{let B=K(J.endpoints?.update||"/update"),M=await W(B,{method:"PUT",body:JSON.stringify({items:H})});return _(M)},delete:async(H)=>{let B=K(J.endpoints?.delete||"/delete"),M=await W(B,{method:"DELETE",body:JSON.stringify({ids:H})});return _(M)},query:async(H={},B={})=>{let M={...H},k={...B};["cursor","page","offset","limit","per_page","perPage","sort","fields","search"].forEach((D)=>{delete M[D],delete k[D]});let N=z(M),F=X(H,B),V={...k};if(H.search||B.search)V.search=H.search||B.search;let O={...N,...F,...V},P=K(J.endpoints?.list||"/list",O),L=await W(P);return _(L,H,B)},setPaginationStrategy:(H)=>{j.strategy=H},getPaginationConfig:()=>{return{...j}},disconnect:()=>{if(Q)Q.abort(),Q=null;Z.clear(),q.clear()}}};var w1=T(()=>{A1();xq={[x6.EQ]:"eq",[x6.NE]:"ne",[x6.GT]:"gt",[x6.GTE]:"gte",[x6.LT]:"lt",[x6.LTE]:"lte",[x6.IN]:"in",[x6.NIN]:"nin",[x6.CONTAINS]:"contains",[x6.STARTS_WITH]:"startsWith",[x6.ENDS_WITH]:"endsWith"}});function Tq(J){return{...yq,...J}}function o5(J){if(!J.renderItem||typeof J.renderItem!=="function")throw new Error("List manager requires a renderItem function");let $=Tq(J);if(!$.collection)$.collection="items";if(!$.transform)$.transform=(Q)=>Q;return $}function t5(J){return Boolean(J.baseUrl)}function n5(J){return J.staticItems||J.items||[]}var yq;var e5=T(()=>{yq={renderBufferSize:5,overscanCount:3,itemHeight:48,measureItemsInitially:!0,pageSize:20,loadThreshold:0.8,throttleMs:16,dedupeItems:!0,dynamicItemSize:!1,scrollStrategy:"scroll"}});function $Q(J){if(getComputedStyle(J).position==="static")J.style.position="relative";let $=document.createElement("div");$.style.position="relative",$.style.width="100%",$.style.willChange="transform";let Q=document.createElement("div");return Q.style.position="absolute",Q.style.top="0",Q.style.left="0",Q.style.width="1px",Q.style.visibility="hidden",Q.style.pointerEvents="none",J.appendChild($),J.appendChild(Q),{container:J,content:$,spacer:Q}}function JQ(J){let $=document.createElement("div");$.className="mtrl-list-sentinel mtrl-list-sentinel--top",$.style.position="absolute",$.style.top="0",$.style.left="0",$.style.width="100%",$.style.height="1px",$.style.pointerEvents="none",$.style.visibility="hidden";let Q=document.createElement("div");return Q.className="mtrl-list-sentinel mtrl-list-sentinel--bottom",Q.style.position="absolute",Q.style.bottom="0",Q.style.left="0",Q.style.width="100%",Q.style.height="1px",Q.style.pointerEvents="none",Q.style.visibility="hidden",J.content.appendChild($),J.content.appendChild(Q),{...J,topSentinel:$,bottomSentinel:Q}}function x1(J,$){J.spacer.style.height=`${$}px`}function QQ(J){if(J.content.parentNode)J.content.parentNode.removeChild(J.content);if(J.spacer.parentNode)J.spacer.parentNode.removeChild(J.spacer);if(J.topSentinel&&J.topSentinel.parentNode)J.topSentinel.remove();if(J.bottomSentinel&&J.bottomSentinel.parentNode)J.bottomSentinel.remove()}var ZQ=(J=48)=>{let $=new Map,Q=new Map,Z=!1,q=!0,j=!1,G=(W)=>{if(!W)return;return W.id||W.original&&W.original.id},K=(W)=>{if(Z&&Q.size>=W.length)return;if(Q.clear(),q){let Y=0;for(let U=0;U<W.length;U++)if(W[U]){let X=G(W[U]);if(X)Q.set(X,Y);Q.set(`index:${U}`,Y),Y+=J}}else{let Y=0;for(let U=0;U<W.length;U++)if(W[U]){let X=G(W[U]);if(X)Q.set(X,Y);Q.set(`index:${U}`,Y);let _=X&&$.has(X)?$.get(X):J;Y+=_}}Z=!0},z=(W)=>{if(!W)return;if(j=W.dynamicItemSize===!0,q=!j,W.itemHeight)J=W.itemHeight};return{setup:(W)=>{z(W)},measureItemHeight:(W,Y)=>{if(!Y||!W)return J;if(q&&$.size>0)return J;let U=G(W);if(!U)return J;let X=Y.offsetHeight;if(j||$.size===0||$.has(U)){if(X>0){let H=$.get(U)!==X;if($.size===0&&!j)J=X;if(H){if($.set(U,X),Z&&!q)Z=!1}}}if($.size===1&&!j&&Y.offsetHeight>0)return $.values().next().value;return j?$.get(U)||J:J},getItemHeight:(W)=>{if(q)return J;if(!W)return J;let Y=G(W);if(!Y)return J;if($.has(Y))return $.get(Y)||J;return J},setItemHeights:(W)=>{if(q&&!j)return!1;let Y=!1;for(let[U,X]of Object.entries(W))if($.get(U)!==X&&X>0)$.set(U,X),Y=!0;if(Y)Z=!1;return Y},calculateTotalHeight:(W)=>{if(!W||W.length===0)return 0;let Y=W.length;if(q)return Y*J;let U=0;for(let X of W){if(!X)continue;let _=G(X);U+=_&&$.has(_)?$.get(_):J}return U},getItemOffset:(W,Y)=>{if(Z&&Q.has(Y))return Q.get(Y)||0;if(K(W),Q.has(Y))return Q.get(Y)||0;if(q){let U=W.findIndex((X)=>G(X)===Y);if(U>=0)return U*J}else{let U=0;for(let X of W){let _=G(X);if(_===Y)return U;let H=_&&$.has(_)?$.get(_):J;U+=H}}return-1},getOffsetAtIndex:(W)=>{let Y=`index:${W}`;if(Z&&Q.has(Y))return Q.get(Y)||0;if(q)return W*J;return W*J},measureMarkedElements:(W,Y)=>{let U=$.size===0?".mtrl-list-item":'[data-needs-measurement="true"]',X=W.querySelectorAll(U),_=!1;if(X.length>0){if($.size===0&&X.length>0){let B=X[0].offsetHeight;if(B>0){if(J=B,_=!0,!j)return!0}}if(j)for(let H=0;H<X.length;H++){let B=X[H],M=B.getAttribute("data-id");if(M){if(Y.find((N)=>G(N)===M)){let N=B.offsetHeight;if(N>0&&$.get(M)!==N)$.set(M,N),_=!0;delete B.dataset.needsMeasurement}}}if(_&&!q)Z=!1}return _},hasCachedOffsets:()=>{return Z},calculateOffsets:K,clear:()=>{$.clear(),Q.clear(),Z=!1},getAllHeights:()=>{return new Map($)},getDefaultHeight:()=>{return J},isUsingUniformHeight:()=>{return q}}};function Iq(J,$,Q,Z,q){let{renderBufferSize:j=5,overscanCount:G=3}=q,K=Math.floor(J/$),z=Math.ceil(Q/$),W=K+z,Y=Math.max(0,K-j-G),U=Math.min(Z,W+j+G);return{start:Y,end:U}}function Sq(J,$,Q,Z,q,j,G){let K=0,z=$.length-1,W=0;if(typeof Z.hasCachedOffsets==="function"&&Z.hasCachedOffsets())while(K<=z){let H=Math.floor((K+z)/2);if(!$[H]){K=H+1;continue}if(Z.getItemOffset($,$[H].id)<J)W=H,K=H+1;else z=H-1}else{let H=Z.getAllHeights(),B=G;if(H.size>0){let k=0,N=0;H.forEach((F)=>{k+=F,N++}),B=k/N}W=Math.floor(J/B);let M=W*B;while(W<$.length&&M<J){if($[W])M+=Z.getItemHeight($[W]);W++}while(W>0&&M>J)if(W--,$[W])M-=Z.getItemHeight($[W])}W=Math.max(0,Math.min(W,$.length-1));let Y=Math.max(0,W-q-j),U=0;for(let H=0;H<Y;H++)if($[H])U+=Z.getItemHeight($[H]);let X=Y,_=J+Q+q*G;while(X<$.length&&U<_){if($[X])U+=Z.getItemHeight($[X]);X++}return X=Math.min($.length,X+j),{start:Y,end:X}}function qQ(J,$,Q,Z,q){let{renderBufferSize:j=5,overscanCount:G=3,itemHeight:K=48}=q;if($.length===0)return{start:0,end:0};if($.length<10)return{start:0,end:$.length};let z=Z.getAllHeights();if(new Set(z.values()).size<=1&&$.length>20)return Iq(J,K,Q,$.length,q);if($.length>100)return Sq(J,$,Q,Z,j,G,K);let Y=0,U=0,X=0;for(let _=0;_<$.length;_++){if(!$[_])continue;let H=Z.getItemHeight($[_]);if(Y+H>J-j*q.itemHeight){U=Math.max(0,_-G);break}Y+=H}Y=0;for(let _=0;_<$.length;_++){if(!$[_])continue;let H=Z.getItemHeight($[_]);if(Y+=H,Y>J+Q+j*q.itemHeight){X=Math.min($.length,_+G);break}}if(X===0)X=$.length;return{start:U,end:X}}function jQ(J,$,Q){if(typeof Q.hasCachedOffsets==="function"&&Q.hasCachedOffsets()&&typeof Q.getOffsetAtIndex==="function"){let j=[];for(let G=$.start;G<$.end;G++)if(J[G])j.push({index:G,item:J[G],offset:Q.getOffsetAtIndex(G)});return j}let Z=0;for(let j=0;j<$.start;j++)if(J[j])Z+=Q.getItemHeight(J[j]);let q=[];for(let j=$.start;j<$.end;j++)if(J[j])q.push({index:j,item:J[j],offset:Z}),Z+=Q.getItemHeight(J[j]);return q}function KQ(J,$,Q,Z){if(Q<=0||$<=0)return!1;return(J+$)/Q>Z}var GQ=(J,$,Q,Z)=>{let q=null,j=new Map,G={start:0,end:0};if(typeof Q.setup==="function")Q.setup(J);let K=(W,Y)=>{if(!W){console.warn("Attempted to render undefined item at index",Y);let _=document.createElement("div");return _.style.height=`${J.itemHeight||48}px`,_}let U=Z.getRecycledElement(W),X=J.renderItem(W,Y,U);if(!X){console.warn("renderItem returned null or undefined for item",W);let _=document.createElement("div");return _.style.height=`${J.itemHeight||48}px`,_}if(!X.classList.contains("mtrl-list-item"))X.classList.add("mtrl-list-item");if(W.id&&!X.hasAttribute("data-id"))X.setAttribute("data-id",W.id);if(W.type)X.dataset.itemType=W.type;if((J.dynamicItemSize===!0||j.size===0)&&!X.hasAttribute("data-needs-measurement"))X.dataset.needsMeasurement="true";if(q)q(W,X);return X},z=(W,Y,U)=>{if(Math.abs(U.end-U.start-(G.end-G.start))>10)return!1;let _=0;return Array.from(W).forEach((H)=>{if(Y.has(H))_++}),_>=W.size/2};return{setRenderHook:(W)=>{q=W},renderVisibleItems:(W,Y)=>{if(!$.content)return console.warn("Cannot render items: content element missing"),new Map;if(Y.start===G.start&&Y.end===G.end)return j;G=Y;let{topSentinel:U,bottomSentinel:X}=$,_=jQ(W,Y,Q),H=new Set(_.map((k)=>k.item.id)),B=new Set(j.keys());if(z(H,B,Y)){let k=_.filter((F)=>!B.has(F.item.id));if(Array.from(j.entries()).filter(([F])=>!H.has(F)).forEach(([F,V])=>{Z.recycleElement(V),j.delete(F),V.remove()}),k.length>0){let F=document.createDocumentFragment();k.forEach(({index:V,item:O,offset:P})=>{let L=K(O,V);L.style.position="absolute",L.style.top=`${P}px`,L.style.left="0",L.style.width="100%",F.appendChild(L),j.set(O.id,L)}),$.content.appendChild(F)}_.forEach(({item:F,offset:V})=>{if(j.has(F.id)){let O=j.get(F.id);if(parseInt(O.style.top,10)!==V)O.style.top=`${V}px`}})}else{let k=new Map;Array.from($.content.children).forEach((F)=>{if(F===U||F===X)return;let V=F.getAttribute("data-id");if(V)k.set(V,F),F.remove()});let N=document.createDocumentFragment();j.clear(),_.forEach(({index:F,item:V,offset:O})=>{let P;if(k.has(V.id)){if(P=k.get(V.id),k.delete(V.id),P.style.top=`${O}px`,J.dynamicItemSize===!0||j.size===0)P.dataset.needsMeasurement="true"}else P=K(V,F),P.style.position="absolute",P.style.top=`${O}px`,P.style.left="0",P.style.width="100%";N.appendChild(P),j.set(V.id,P)}),k.forEach((F)=>{Z.recycleElement(F)}),$.content.innerHTML="",$.content.appendChild(N)}if(U&&!U.parentNode)$.content.insertBefore(U,$.content.firstChild);if(X&&!X.parentNode)$.content.appendChild(X);return j},getItemElements:()=>{return new Map(j)}}};var zQ=()=>{};function WQ(J,$,Q,Z){let{scrollStrategy:q="scroll"}=Q;switch(q){case"intersection":return YQ(J,$,Z);case"hybrid":return bq(J,$,Z);case"scroll":default:return y1(J,Q,Z)}}function y1(J,$,Q){let Z=null,q=0,j=5,G=$.throttleMs||16,K=0;return{setup:()=>{let z=(W)=>{let Y=W.target.scrollTop;if(Math.abs(Y-q)<j)return;let U=Date.now();if(U-K<G){if(Z)return;Z=requestAnimationFrame(()=>{q=Y,K=Date.now(),Q.onScroll(Y),Z=null});return}q=Y,K=U,Q.onScroll(Y)};return J.addEventListener("scroll",z,{passive:!0}),()=>{if(J.removeEventListener("scroll",z),Z)cancelAnimationFrame(Z),Z=null}},getScrollTop:()=>{return J.scrollTop}}}function YQ(J,$,Q){let Z=null,q=null,j=null,G=!1;return{setup:()=>{if(!("IntersectionObserver"in window))return console.warn("IntersectionObserver not supported, falling back to scroll events"),y1(J,{renderItem:()=>document.createElement("div")},Q).setup();if(!$.topSentinel||!$.bottomSentinel)Object.assign($,JQ($));if(Z=new IntersectionObserver((W)=>{if(G)return;G=!0;let Y=!1,U=!1;if(W.forEach((X)=>{if(X.target===$.topSentinel&&X.isIntersecting)Y=!0;if(X.target===$.bottomSentinel&&X.isIntersecting)U=!0,Y=!0}),U){if(j!==null)clearTimeout(j);j=window.setTimeout(()=>{Q.onLoadMore(),j=null},100)}if(Y)Q.onScroll(J.scrollTop);setTimeout(()=>{G=!1},100)},{root:J,rootMargin:"400px 0px 400px 0px",threshold:0}),$.topSentinel)Z.observe($.topSentinel);if($.bottomSentinel)Z.observe($.bottomSentinel);let K=()=>{if(!G)Q.onScroll(J.scrollTop)},z=0;return q=()=>{let W=Date.now();if(W-z<200)return;z=W,K()},J.addEventListener("scroll",q,{passive:!0}),()=>{if(Z)Z.disconnect(),Z=null;if(q)J.removeEventListener("scroll",q),q=null;if(j!==null)clearTimeout(j),j=null}},getScrollTop:()=>{return J.scrollTop}}}function bq(J,$,Q){let q=y1(J,{throttleMs:32,renderItem:()=>document.createElement("div")},{onScroll:Q.onScroll,onLoadMore:()=>{}}),j=YQ(J,$,{onScroll:(K)=>{let z=J.scrollTop;if(Math.abs(z-K)>50)Q.onScroll(z)},onLoadMore:Q.onLoadMore}),G=[];return{setup:()=>{return G.push(q.setup()),G.push(j.setup()),()=>{G.forEach((K)=>K()),G=[]}},getScrollTop:()=>{return q.getScrollTop()}}}var UQ=()=>{};var XQ=()=>{let J=new Map,$=50;return{getRecycledElement:(Q)=>{let Z=Q.type||"default";if(!J.has(Z))return J.set(Z,[]),null;let q=J.get(Z);return q.length>0?q.pop():null},recycleElement:(Q,Z=!1)=>{if(!Q)return;if(!Z&&Q.innerHTML.length<100)return;let q=Q.dataset.itemType||"default";if(!J.has(q))J.set(q,[]);let j=J.get(q);if(j.length<50){Q.style.display="none",Q.style.top="-9999px";for(let G in Q.dataset)if(G!=="itemType")delete Q.dataset[G];j.push(Q)}},getPool:(Q)=>{return J.get(Q)||[]},clear:()=>{J.forEach((Q)=>{Q.length=0}),J.clear()},getSize:()=>{let Q=0;return J.forEach((Z)=>{Q+=Z.length}),Q}}};function BQ(J){let $=Boolean(J.baseUrl),Q=!$,Z=Q?J.staticItems||J.items||[]:[],q=J.pagination?.strategy||"cursor";return{items:Z,visibleItems:[],visibleRange:{start:0,end:0},totalHeight:0,totalHeightDirty:!0,itemHeights:new Map,loading:!1,cursor:null,page:q==="page"?1:void 0,paginationStrategy:q,hasNext:$,itemElements:new Map,scrollTop:0,containerHeight:0,scrollRAF:null,resizeRAF:null,mounted:!1,itemCount:Z.length,useStatic:Q,renderHook:null}}function FQ(J,$,Q,Z=!0){let q=Q.cursor??null,j=Q.hasNext??!1,G=J.page;if(Q.page!==void 0)G=Q.page;else if(q&&/^\d+$/.test(q))G=parseInt(q,10)-1;if(J.paginationStrategy==="page"&&Q.page===void 0&&!q)G=J.page;let K;if(J.paginationStrategy==="page"&&J.page===1)K=[...$];else{let W=$;if(Z&&$.length>0&&J.items.length>0){let Y=new Set;for(let U=0;U<J.items.length;U++){let X=J.items[U];if(X&&X.id)Y.add(X.id)}W=$.filter((U)=>U&&U.id&&!Y.has(U.id))}K=[...J.items,...W]}let z=Q.total!==void 0?Q.total:K.length;return{items:K,cursor:q,page:G,hasNext:j,totalHeightDirty:!0,itemCount:z}}function HQ(J,$,Q){return{visibleItems:$,visibleRange:Q}}function T1(J,$){return{totalHeight:$,totalHeightDirty:!1}}function I1(J,$){return{loading:$}}function kQ(J,$=[]){return{items:J.useStatic?[...$]:[],visibleItems:[],visibleRange:{start:0,end:0},itemElements:new Map,cursor:null,page:J.paginationStrategy==="page"?1:void 0,hasNext:!J.useStatic,totalHeightDirty:!0,itemCount:J.useStatic?$.length:0}}function MQ(J,$){let Q={};switch($||J.paginationStrategy||"cursor"){case"page":{if(J.cursor&&/^\d+$/.test(J.cursor))Q.page=parseInt(J.cursor,10);else if(J.page!==void 0)Q.page=J.page;else Q.page=1;break}case"offset":{if(J.cursor&&/^\d+$/.test(J.cursor))Q.offset=parseInt(J.cursor,10);else Q.offset=0;break}case"cursor":default:{if(J.cursor)Q.cursor=J.cursor;if(J.cursor&&/^\d+$/.test(J.cursor))Q.page=parseInt(J.cursor,10);break}}return Q}var u$=(J,$,Q)=>{Q.collection=J;let Z=o5(Q);if(!$||!($ instanceof HTMLElement))throw new Error("List manager requires a valid container element");let q=t5(Z),j=!q,G=j?n5(Z):[],K=BQ(Z);K.useStatic=j;let z=$Q($),W=ZQ(Z.itemHeight),Y=XQ(),U=GQ(Z,z,W,Y),X=C$({transform:Z.transform,initialCapacity:j?G.length:50}),_=q?h$({base:Z.baseUrl,endpoints:{list:`/${J}`},headers:{"Content-Type":"application/json"},cache:!0,pagination:Z.pagination?{strategy:Z.pagination.strategy||"cursor",...Z.pagination}:{strategy:"cursor"}}):null,H=[],B=async(L={})=>{try{if(Object.assign(K,I1(K,!0)),K.useStatic)return{items:[...K.items],meta:{cursor:null,hasNext:!1}};if(!_)throw new Error("Cannot load items: API adapter not initialized");let D=await _.read(L),R=Array.isArray(D.items)?D.items.map(Z.transform):[];if(Object.assign(K,FQ(K,R,D.meta,Z.dedupeItems)),K.paginationStrategy==="page"&&L.page===1){if(await X.clear(),R.length>0)await X.add(R)}else if(Z.dedupeItems){let w=new Set(K.items.map((x)=>x.id).filter(Boolean)),A=R.filter((x)=>!w.has(x.id));if(A.length>0)await X.add(A)}else await X.add(R);if(K.totalHeightDirty=!0,Z.afterLoad){let w=[...K.items],A={loading:!1,hasNext:K.hasNext,hasPrev:!!L.cursor||L.page&&L.page>1,items:[...R],allItems:w};Z.afterLoad(A)}if(K.paginationStrategy==="cursor"&&D.meta?.cursor)K.cursor=D.meta.cursor;else if(K.paginationStrategy==="page"&&L.page)K.page=L.page;return{items:R,meta:D.meta}}catch(D){return console.error(`Error loading ${J}:`,D),{items:[],meta:{cursor:null,hasNext:!1}}}finally{Object.assign(K,I1(K,!1))}},M=(L=K.scrollTop)=>{if(!K.mounted)return;if(K.containerHeight===0)K.containerHeight=$.clientHeight;K.scrollTop=L;let D=qQ(L,K.items,K.containerHeight,W,Z);if(D.start===K.visibleRange.start&&D.end===K.visibleRange.end)return;if(Object.assign(K,HQ(K,K.items.slice(D.start,D.end).filter(Boolean),D)),typeof W.calculateOffsets==="function")W.calculateOffsets(K.items);if(K.totalHeightDirty){let w=W.calculateTotalHeight(K.items);Object.assign(K,T1(K,w)),x1(z,w)}if(U.renderVisibleItems(K.items,D),W.measureMarkedElements(z.content,K.items)){let w=W.calculateTotalHeight(K.items);Object.assign(K,T1(K,w)),x1(z,w)}k(L)},k=(L)=>{if(K.loading||!K.hasNext)return;if(KQ(L,K.containerHeight,K.totalHeight,Z.loadThreshold))N()},N=async()=>{if(K.loading||!K.hasNext)return{hasNext:K.hasNext,items:[]};if(K.useStatic)return{hasNext:!1,items:[]};let L=Z.pagination?.strategy||"cursor";if(K.paginationStrategy=L,L==="page")if(K.cursor&&/^\d+$/.test(K.cursor))K.page=parseInt(K.cursor,10);else if(K.page!==void 0)K.page+=1;else K.page=1;let D=MQ(K,L);if(!D.limit&&!D.per_page)if(L==="page"){let w=Z.pagination?.perPageParamName||"per_page";D[w]=Z.pageSize||20}else{let w=Z.pagination?.limitParamName||"limit";D[w]=Z.pageSize||20}let R=await B(D);return M(K.scrollTop),{hasNext:K.hasNext,items:R.items}},F=async()=>{if(Object.assign(K,kQ(K,G)),Y.clear(),X.clear(),K.useStatic&&G&&G.length>0)K.items=[...G],await X.add(G);else await B();M(0)},V=(L,D="start")=>{if(typeof W.calculateOffsets==="function")W.calculateOffsets(K.items);let R=W.getItemOffset(K.items,L);if(R===-1)return;let w=R;if(D==="center")w=R-K.containerHeight/2;else if(D==="end"){let A=K.items.findIndex((I)=>I&&I.id===L);if(A===-1)return;let x=W.getItemHeight(K.items[A]);w=R-K.containerHeight+x}$.scrollTo({top:Math.max(0,w),behavior:"smooth"})},P=(()=>{K.mounted=!0;let D=WQ($,z,Z,{onScroll:M,onLoadMore:N}).setup();H.push(D);let R=X.subscribe(({event:w})=>{if(w===Y6.CHANGE)K.totalHeightDirty=!0,requestAnimationFrame(()=>{M(K.scrollTop)})});if(H.push(R),K.useStatic&&G&&G.length>0)X.add(G).then(()=>{requestAnimationFrame(()=>{M(K.scrollTop)})}).catch((w)=>{console.error("Error adding static items to collection:",w)});else if(!K.useStatic)B().then(()=>{requestAnimationFrame(()=>{M(K.scrollTop)})}).catch((w)=>{console.error("Error loading items:",w)});if("ResizeObserver"in window){let w=new ResizeObserver((A)=>{for(let x of A)if(x.target===$){let I=$.clientHeight;if(I!==K.containerHeight){if(K.containerHeight=I,K.resizeRAF)cancelAnimationFrame(K.resizeRAF);K.resizeRAF=requestAnimationFrame(()=>{M(K.scrollTop),K.resizeRAF=null})}}});w.observe($),H.push(()=>{if(w.disconnect(),K.resizeRAF)cancelAnimationFrame(K.resizeRAF),K.resizeRAF=null})}else{let w=null,A=()=>{if(w)clearTimeout(w);w=window.setTimeout(()=>{let x=$.clientHeight;if(x!==K.containerHeight)K.containerHeight=x,M(K.scrollTop);w=null},100)};window.addEventListener("resize",A,{passive:!0}),H.push(()=>{if(window.removeEventListener("resize",A),w)clearTimeout(w),w=null})}return()=>{H.forEach((w)=>w()),H.length=0,K.mounted=!1}})();return{loadItems:B,loadMore:N,refresh:F,updateVisibleItems:M,scrollToItem:V,setItemHeights:(L)=>{let D=W.setItemHeights(L);if(D)K.totalHeightDirty=!0,M(K.scrollTop);return D},getCollection:()=>X,getVisibleItems:()=>K.visibleItems,getAllItems:()=>K.items,isLoading:()=>K.loading,hasNextPage:()=>K.hasNext,isApiMode:()=>q,setRenderHook:(L)=>{U.setRenderHook(L),M(K.scrollTop)},destroy:()=>{if(P(),X.clear(),typeof W.clear==="function")W.clear();if(Y.clear(),z.content)z.content.innerHTML="";if(QQ(z),_&&typeof _.disconnect==="function")_.disconnect()}}},VQ;var S1=T(()=>{l7();w1();e5();zQ();UQ();VQ={track:(J)=>({id:J._id,headline:J.title||"Untitled",supportingText:J.artist||"Unknown Artist",meta:J.year?.toString()||""}),playlist:(J)=>({id:J._id,headline:J.name||"Untitled Playlist",supportingText:`${J.tracks?.length||0} tracks`,meta:J.creator||""}),country:(J)=>({id:J._id,headline:J.name||J.code,supportingText:J.continent||"",meta:J.code||""})}});var NQ=T(()=>{l7();l7();l7();S1();A1();w1()});var b1=(J,$,Q,Z,q,j)=>{if(Z<0||q<0)return;let G=typeof j==="number"?[j,j,j,j]:j,[K,z,W,Y]=G;J.beginPath(),J.moveTo($+K,Q),J.lineTo($+Z-z,Q),J.quadraticCurveTo($+Z,Q,$+Z,Q+z),J.lineTo($+Z,Q+q-W),J.quadraticCurveTo($+Z,Q+q,$+Z-W,Q+q),J.lineTo($+Y,Q+q),J.quadraticCurveTo($,Q+q,$,Q+q-Y),J.lineTo($,Q+K),J.quadraticCurveTo($,Q,$+K,Q),J.closePath()},vq=(J,$,Q,Z,q,j,G)=>{if(J.save(),G)J.fillStyle=G;b1(J,$,Q,Z,q,j),J.fill(),J.restore()},v1=(J,$,Q,Z,q,j)=>{return J.save(),b1(J,$,Q,Z,q,j),J.clip(),()=>J.restore()},C1=(J,$,Q,Z,q,j,G,K)=>{if(Z<0||q<0)return;if(J.save(),K)J.fillStyle=K;J.beginPath(),J.moveTo($+j,Q),J.lineTo($+Z-G,Q),J.quadraticCurveTo($+Z,Q,$+Z,Q+G),J.lineTo($+Z,Q+q-G),J.quadraticCurveTo($+Z,Q+q,$+Z-G,Q+q),J.lineTo($+j,Q+q),J.quadraticCurveTo($,Q+q,$,Q+q-j),J.lineTo($,Q+j),J.quadraticCurveTo($,Q,$+j,Q),J.closePath(),J.fill(),J.restore()},E1=(J,$,Q,Z)=>{if(Z)J.fillStyle=Z,J.fillRect(0,0,$,Q);else J.clearRect(0,0,$,Q)};var f$=(J)=>{let j=J;for(let U=0;U<4;U++){let B=j*j,k=1.6*(B*j)+-1.8000000000000003*B+1.2000000000000002*j-J,N=4.800000000000001*B+-3.6000000000000005*j+1.2000000000000002;if(Math.abs(k)<0.00001)break;j=j-k/N}let G=0,K=3-G,z=1-G-K,W=j*j,Y=W*j;return z*Y+K*W+G*j},h1,Cq;var _Q=T(()=>{h1={SHORT:100,MEDIUM:225,LONG:375,EXTRA_LONG:500},Cq={linear:(J)=>J,easeIn:(J)=>J*J,easeOut:(J)=>J*(2-J),easeInOut:(J)=>J<0.5?2*J*J:-1+(4-2*J)*J,materialStandard:f$}});class LQ{animationId=null;start(J){this.stop();let $=(Q)=>{J(Q),this.animationId=requestAnimationFrame($)};this.animationId=requestAnimationFrame($)}stop(){if(this.animationId!==null)cancelAnimationFrame(this.animationId),this.animationId=null}get isRunning(){return this.animationId!==null}}class DQ{cleanupFunctions=[];add(J){if(J)this.cleanupFunctions.push(J)}cleanup(){this.cleanupFunctions.forEach((J)=>J()),this.cleanupFunctions=[]}}var u1=(J,$,Q)=>{let Z=window.devicePixelRatio||1,q=J.getContext("2d");return J.style.width=`${$}px`,J.style.height=`${Q}px`,J.width=Math.round($*Z),J.height=Math.round(Q*Z),q.setTransform(1,0,0,1,0,0),q.scale(Z,Z),{canvas:J,ctx:q,width:$,height:Q,pixelRatio:Z}},f1=(J,$,Q)=>{let{canvas:Z,ctx:q,pixelRatio:j}=J;Z.style.width=`${$}px`,Z.style.height=`${Q}px`,Z.width=Math.round($*j),Z.height=Math.round(Q*j),J.width=$,J.height=Q,q.setTransform(1,0,0,1,0,0),q.scale(j,j)},g1=(J,$)=>{if(J())return $?.(),!0;return requestAnimationFrame(()=>{if(J())$?.();else setTimeout(()=>{if(J())$?.()},100)}),!1},g$=(J,$)=>{let Q=B6(`sys-color-${J}`,{onThemeChange:$});return typeof Q==="function"?Q:null},d1=(J,$={})=>{let Q=document.createElement("canvas");return Q.className=J,Object.assign(Q.style,{position:"absolute",width:"100%",height:"100%",pointerEvents:"none",...$}),Q};var OQ=T(()=>{Y9()});var l1=T(()=>{_Q();OQ()});var r7=T(()=>{J6();v9();d5();r5();v$();NQ();l1();y6();X1();Y9();D$()});var PQ=({disabled:J,lifecycle:$})=>(Q)=>{let Z={setText:(G)=>{return Q.text.setText(G),Z},getText:()=>Q.text.getText(),getElement:()=>Q.text.getElement()},q={setIcon:(G)=>{return Q.icon.setIcon(G),q},getIcon:()=>Q.icon.getIcon(),getElement:()=>Q.icon.getElement()},j={element:Q.element,text:Z,icon:q,disabled:J,lifecycle:$,getClass:Q.getClass,on:(G,K)=>{if(Q.on)Q.on(G,K);return j},off:(G,K)=>{if(Q.off)Q.off(G,K);return j},addClass:(...G)=>{if(Q.addClass)Q.addClass(...G);else f(Q.element,...G);return j},getValue:()=>Q.element.value,setValue(G){return Q.element.value=G,j},enable(){return J.enable(),j},disable(){return J.disable(),j},setText(G){return Q.text.setText(G),j.updateCircularStyle(),j},getText(){return Q.text.getText()},hasIcon(){let G=Q.icon.getElement();return!!G&&!!G.innerHTML.trim()&&!!G.parentNode},setIcon(G){let K=Q.componentName||"button",z=Q.getClass(K);if(!G){let W=Q.icon.getElement();if(W&&W.parentNode)W.parentNode.removeChild(W),Q.icon.getElement=()=>null,Q.icon.getIcon=()=>"";Q.element.classList.remove(`${z}--icon`)}else if(!j.hasIcon()){let W=document.createElement("span");if(W.className=`${Q.getClass("button-icon")}`,W.innerHTML=G,Q.element.firstChild)Q.element.insertBefore(W,Q.element.firstChild);else Q.element.appendChild(W);Q.icon.getElement=()=>W,Q.icon.getIcon=()=>G,Q.element.classList.add(`${z}--icon`)}else{let W=Q.icon.getElement();if(W)W.innerHTML=G}return j.updateCircularStyle(),j},getIcon(){return j.hasIcon()?Q.icon.getIcon():""},setVariant(G){let K=Q.componentName||"button",z=Q.getClass(K);return["filled","tonal","outlined","elevated","text"].map((Y)=>`${z}--${Y}`).forEach((Y)=>{Q.element.classList.remove(Y)}),Q.element.classList.add(`${z}--${G}`),j},getVariant(){let G=Q.componentName||"button",K=Q.getClass(G),z=["filled","tonal","outlined","elevated","text"];for(let W of z)if(Q.element.classList.contains(`${K}--${W}`))return W;return"filled"},getSize(){let G=Q.componentName||"button",K=Q.getClass(G),z=["xs","s","m","l","xl"];for(let W of z)if(Q.element.classList.contains(`${K}--${W}`))return W;return"s"},setSize(G){let K=Q.componentName||"button",z=Q.getClass(K);return["xs","s","m","l","xl"].map((Y)=>`${z}--${Y}`).forEach((Y)=>{Q.element.classList.remove(Y)}),Q.element.classList.add(`${z}--${G}`),j},getShape(){let G=Q.componentName||"button",K=Q.getClass(G),z=["round","square"];for(let W of z)if(Q.element.classList.contains(`${K}--${W}`))return W;return"round"},setShape(G){let K=Q.componentName||"button",z=Q.getClass(K);return["round","square"].map((Y)=>`${z}--${Y}`).forEach((Y)=>{Q.element.classList.remove(Y)}),Q.element.classList.add(`${z}--${G}`),j},setActive(G){if(G)Q.element.classList.add(`${Q.getClass("button")}--active`);else Q.element.classList.remove(`${Q.getClass("button")}--active`);return j},setAriaLabel(G){return Q.element.setAttribute("aria-label",G),j},destroy(){$.destroy()},updateCircularStyle(){let G=Q.text.getText()!=="",K=j.hasIcon();if(!G)f(Q.element,"button--circular"),q6(Q.element,"button--icon");else q6(Q.element,"button--circular");if(K&&G)f(Q.element,"button--icon")}};if(Q.progress)j.progress=Q.progress;if(Q.showProgress)j.showProgress=async()=>{return await Q.showProgress(),j};if(Q.showProgressSync)j.showProgressSync=()=>{return Q.showProgressSync(),j};if(Q.hideProgress)j.hideProgress=async()=>{return await Q.hideProgress(),j};if(Q.hideProgressSync)j.hideProgressSync=()=>{return Q.hideProgressSync(),j};if(Q.setProgress)j.setProgress=async(G)=>{return await Q.setProgress(G),j};if(Q.setProgressSync)j.setProgressSync=(G)=>{return Q.setProgressSync(G),j};if(Q.setIndeterminate)j.setIndeterminate=async(G)=>{return await Q.setIndeterminate(G),j};if(Q.setIndeterminateSync)j.setIndeterminateSync=(G)=>{return Q.setIndeterminateSync(G),j};if(Q.setLoading)j.setLoading=async(G,K)=>{return await Q.setLoading(G,K),j};if(Q.setLoadingSync)j.setLoadingSync=(G,K)=>{return Q.setLoadingSync(G,K),j};return j};var RQ=T(()=>{r7()});var p7,s7,m7,a7,r1,d9;var p1=T(()=>{p7={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",ELEVATED:"elevated",TEXT:"text"},s7={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},m7={ROUND:"round",SQUARE:"square"},a7={BUTTON:"button",SUBMIT:"submit",RESET:"reset"},r1={ROOT:"button",ICON:"button-icon",TEXT:"button-text",CIRCULAR:"button-circular",ACTIVE:"button-active",DISABLED:"button-disabled"},d9={DURATION:450,TIMING:"cubic-bezier(0.4, 0.0, 0.2, 1)",OPACITY:["0.7","0"]}});var Eq,AQ=(J={})=>d(Eq,J,"button"),wQ=(J)=>{let $={type:J.type||"button"};if(J.disabled===!0)$.disabled=!0;if(J.value!==void 0)$.value=J.value;if(J.ariaLabel)$["aria-label"]=J.ariaLabel;return p(J,{tag:"button",attributes:$,className:J.class,forwardEvents:{click:(Q)=>!Q.element.disabled,focus:!0,blur:!0}})},xQ=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable(),isDisabled:()=>J.disabled.isDisabled()},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var yQ=T(()=>{t();p1();Eq={variant:p7.FILLED,size:s7.S,shape:m7.ROUND,disabled:!1,type:a7.BUTTON,ripple:!0,rippleConfig:{duration:d9.DURATION,timing:d9.TIMING,opacity:d9.OPACITY}}});var hq=(J={})=>{let $=AQ(J);try{return b(S,g(),E(wQ($)),K6($),O7($),K9($),G9($),G6($),E5($),T6($),C(),(Z)=>{if($.shape&&Z.element){let q=`${$.prefix}-${$.componentName}--${$.shape}`;Z.element.classList.add(q)}return Z},(Z)=>PQ(xQ(Z))(Z))($)}catch(Q){throw console.error("Button creation error:",Q),new Error(`Failed to create button: ${Q.message}`)}},e6;var TQ=T(()=>{J6();c();o();h5();RQ();yQ();e6=hq});var IQ={};E8(IQ,{default:()=>e6});var l9=T(()=>{TQ()});var wK={};E8(wK,{withVariant:()=>K6,withTrack:()=>A7,withThrottle:()=>p8,withTextLabel:()=>z9,withTextInput:()=>R7,withText:()=>K9,withTapGesture:()=>l4,withTabsManagement:()=>O8,withSwipeable:()=>gQ,withSwipeGesture:()=>p4,withSupportingText:()=>k8,withStyle:()=>l8,withSize:()=>O7,withScrollable:()=>P8,withRipple:()=>T6,withPosition:()=>P7,withPanGesture:()=>c4,withLongPressGesture:()=>m4,withLoading:()=>uQ,withLifecycle:()=>C,withInput:()=>I9,withIndicator:()=>A8,withIcon:()=>G9,withGestures:()=>G1,withExpandable:()=>fQ,withEvents:()=>g,withEnhancedEvents:()=>r8,withElevation:()=>p$,withElement:()=>E,withDivider:()=>R8,withDisabled:()=>G6,withDebounce:()=>s8,withCheckable:()=>S9,withAPI:()=>d$,when:()=>k5,updateTabPanels:()=>_8,updateCanvasDimensions:()=>f1,transforms:()=>VQ,transform:()=>z4,toggleClass:()=>g8,throttle:()=>$7,setupResponsiveBehavior:()=>e2,setupKeyboardNavigation:()=>L8,setGlobalDefaults:()=>Y1,setComponentDefaults:()=>W1,setAttributes:()=>h8,removeClass:()=>q6,removeAttributes:()=>Y4,processSchema:()=>S$,processClassNames:()=>h9,pipe:()=>b,once:()=>L$,observeCanvasResize:()=>C7,normalizeEvent:()=>p6,normalizeClasses:()=>o6,loggingMiddleware:()=>f5,jsxs:()=>RK,jsxDEV:()=>AK,jsx:()=>PK,joinClasses:()=>M5,isObject:()=>m6,isJsxSchema:()=>D1,isComponent:()=>w6,initializeCanvasWithRetry:()=>g1,hasTouchSupport:()=>v6,hasLifecycle:()=>k6,hasEmit:()=>N6,hasClass:()=>O6,h:()=>q7,getModifierClass:()=>X4,getLayoutType:()=>f9,getInheritedBackground:()=>_9,getElementClass:()=>B4,getComponentDefaults:()=>T7,getComponentClass:()=>U4,flattenLayout:()=>w$,fillRoundedRectLR:()=>C1,fillRoundedRect:()=>vq,easeOutCubic:()=>f$,deriveFiltered:()=>g5,debounce:()=>J7,createTopAppBar:()=>H3,createTooltip:()=>E0,createTimePicker:()=>I0,createTextfield:()=>Y$,createTabsState:()=>i2,createTabs:()=>$3,createTabIndicator:()=>D8,createTab:()=>H7,createSwitch:()=>z0,createStyledCanvas:()=>d1,createStore:()=>u5,createStateEventManager:()=>_$,createSnackbar:()=>G0,createSlider:()=>Z0,createSheet:()=>cJ,createSelect:()=>r0,createSegmentedButton:()=>U8,createSegment:()=>Y8,createSearch:()=>vJ,createSVGElement:()=>N4,createRouteAdapter:()=>h$,createRoundedRectPath:()=>b1,createRadios:()=>OJ,createProgress:()=>A$,createNavigationSystem:()=>d3,createNavigation:()=>W7,createMenu:()=>Q$,createListManager:()=>u$,createList:()=>f0,createLifecycle:()=>l5,createLayoutResult:()=>n6,createLayout:()=>g9,createJsxLayout:()=>a5,createGestureManager:()=>x7,createFab:()=>o$,createExtendedFab:()=>t$,createEventManager:()=>F5,createEmitter:()=>C6,createElement:()=>v,createDivider:()=>s9,createDisabled:()=>p5,createDialog:()=>XJ,createDatePicker:()=>UJ,createComponentInstance:()=>u9,createComponent:()=>W4,createCollection:()=>C$,createChips:()=>jZ,createChip:()=>t7,createCheckbox:()=>$J,createCarousel:()=>e1,createCardMedia:()=>K7,createCardHeader:()=>i7,createCardContent:()=>c7,createCardActions:()=>j7,createCard:()=>i1,createCanvasThemeObserver:()=>g$,createCanvasContext:()=>u1,createButton:()=>e6,createBottomAppBar:()=>B5,createBaseAdapter:()=>E$,createBase:()=>S,createBadge:()=>e9,compose:()=>G4,clipRoundedRect:()=>v1,clearGlobalDefaults:()=>U1,clearCanvas:()=>E1,cleanupLayoutClasses:()=>_1,classNames:()=>F4,byString:()=>k1,applyLayoutItemClasses:()=>I$,applyLayoutClasses:()=>T$,addScrollIndicators:()=>n2,addClass:()=>f,TOP_APP_BAR_TYPES:()=>S8,TOP_APP_BAR_STATES:()=>S0,TOP_APP_BAR_DEFAULTS:()=>H9,TOP_APP_BAR_CLASSES:()=>b0,TOOLTIP_VARIANTS:()=>v8,TOOLTIP_POSITIONS:()=>b8,TOOLTIP_EVENTS:()=>v0,TOOLTIP_DEFAULTS:()=>l6,TOOLTIP_CLASSES:()=>C0,TIME_PICKER_TYPE:()=>M7,TIME_PICKER_ORIENTATION:()=>U$,TIME_PERIOD:()=>o9,TIME_FORMAT:()=>i9,TIMEPICKER_Z_INDEX:()=>V7,TIMEPICKER_VALUES:()=>y0,TIMEPICKER_TYPES:()=>x8,TIMEPICKER_SELECTORS:()=>Q6,TIMEPICKER_PERIODS:()=>x0,TIMEPICKER_ORIENTATIONS:()=>y8,TIMEPICKER_ICONS:()=>g6,TIMEPICKER_FORMATS:()=>T8,TIMEPICKER_EVENTS:()=>_6,TIMEPICKER_DIAL:()=>Z9,TIMEPICKER_DEFAULTS:()=>i6,TIMEPICKER_CLASSES:()=>T0,TEXTFIELD_VARIANTS:()=>W$,TEXTFIELD_TYPES:()=>w8,TEXTFIELD_STATES:()=>P0,TEXTFIELD_EVENTS:()=>R0,TEXTFIELD_DENSITY:()=>A0,TEXTFIELD_DEFAULTS:()=>k7,TEXTFIELD_CLASSES:()=>w0,TAB_VARIANTS:()=>z$,TAB_STATES:()=>B7,TAB_INDICATOR_WIDTH_STRATEGIES:()=>V8,TAB_EVENTS:()=>B0,TAB_CLASSES:()=>H0,TABS_EVENTS:()=>N8,TABS_DEFAULTS:()=>w9,TABS_CLASSES:()=>F0,SelectionMode:()=>q$,SWITCH_STATES:()=>W0,SWITCH_LABEL_POSITIONS:()=>M8,SWITCH_EVENTS:()=>Y0,SWITCH_DEFAULTS:()=>U0,SWITCH_CLASSES:()=>X0,STATES:()=>f8,SNACKBAR_VARIANTS:()=>H8,SNACKBAR_STATES:()=>q0,SNACKBAR_POSITIONS:()=>Q9,SNACKBAR_EVENTS:()=>j0,SNACKBAR_DEFAULTS:()=>c9,SNACKBAR_CLASSES:()=>K0,SLIDER_SIZES:()=>D6,SLIDER_POSITIONS:()=>K$,SLIDER_EVENTS:()=>H6,SLIDER_DEFAULTS:()=>M6,SLIDER_COLORS:()=>J9,SLIDER_CLASSES:()=>oJ,SHEET_VARIANTS:()=>A9,SHEET_POSITIONS:()=>a9,SHEET_GESTURE:()=>mJ,SHEET_EVENTS:()=>pJ,SHEET_ELEVATION:()=>X8,SHEET_DEFAULTS:()=>F9,SHEET_CLASSES:()=>aJ,SHEET_ANIMATION:()=>sJ,SELECT_VARIANTS:()=>_7,SELECT_PLACEMENT:()=>L7,SELECT_INTERACTION:()=>H$,SELECT_ICONS:()=>M$,SELECT_EVENTS:()=>k$,SELECT_DEFAULTS:()=>y9,SELECT_CLASSES:()=>V$,SEGMENTED_BUTTON_MODES:()=>z8,SEGMENTED_BUTTON_ICONS:()=>EJ,SEGMENTED_BUTTON_EVENTS:()=>CJ,SEGMENTED_BUTTON_DENSITY:()=>W8,SEGMENTED_BUTTON_DEFAULTS:()=>m9,SEGMENTED_BUTTON_CLASSES:()=>hJ,SEARCH_VARIANTS:()=>Y7,SEARCH_STATES:()=>IJ,SEARCH_ICONS:()=>U7,SEARCH_EVENTS:()=>SJ,SEARCH_DEFAULTS:()=>c6,SEARCH_CLASSES:()=>bJ,RADIO_VARIANTS:()=>q8,RADIO_STATES:()=>PJ,RADIO_SIZES:()=>K8,RADIO_LABEL_POSITIONS:()=>j8,RADIO_EVENTS:()=>RJ,RADIO_DIRECTIONS:()=>Z8,RADIO_DEFAULTS:()=>AJ,RADIO_CLASSES:()=>wJ,PROGRESS_VARIANTS:()=>W9,PROGRESS_THICKNESS:()=>u6,PROGRESS_SHAPES:()=>I6,PROGRESS_MEASUREMENTS:()=>s6,PROGRESS_EVENTS:()=>Z7,PROGRESS_DEFAULTS:()=>h6,PROGRESS_CLASSES:()=>z6,PREFIX:()=>u,OPERATORS:()=>x6,NAV_VARIANTS:()=>e$,NAV_POSITIONS:()=>$8,NAV_ITEM_STATES:()=>LJ,NAV_EVENTS:()=>Z$,NAV_DEFAULTS:()=>B9,NAV_CLASSES:()=>n,NAV_BEHAVIORS:()=>J8,MONTH_NAMES_SHORT:()=>i0,MONTH_NAMES:()=>c0,MENU_POSITION:()=>n$,MENU_ITEM_TYPES:()=>NJ,MENU_INTERACTION_TYPES:()=>VJ,MENU_EVENTS:()=>_J,MENU_DEFAULTS:()=>a6,MENU_CLASSES:()=>J$,LIST_TYPES:()=>X$,LIST_SELECTION_MODES:()=>B$,LIST_SCROLL_POSITIONS:()=>F$,LIST_EVENTS:()=>M9,LIST_DEFAULTS:()=>j9,LIST_CLASSES:()=>e,Fragment:()=>P1,FAB_VARIANTS:()=>Z4,FAB_SIZES:()=>q4,FAB_POSITIONS:()=>j4,EASING_FUNCTIONS:()=>Cq,Density:()=>j$,DIALOG_SIZES:()=>t0,DIALOG_FOOTER_ALIGNMENTS:()=>e0,DIALOG_BUTTON_VARIANTS:()=>$4,DIALOG_ANIMATIONS:()=>n0,DEFAULT_RIPPLE_CONFIG:()=>d9,DEFAULT_DATE_FORMAT:()=>o0,DEFAULT_CONFIRM_BUTTON_TEXT:()=>J4,DEFAULT_CANCEL_BUTTON_TEXT:()=>Q4,DAY_NAMES:()=>a0,DATEPICKER_VIEWS:()=>s0,DATEPICKER_VARIANTS:()=>p0,DATEPICKER_SELECTION_MODES:()=>m0,CleanupManager:()=>DQ,COMPONENTS:()=>u8,COLLECTION_OPERATORS:()=>i5,COLLECTION_EVENTS:()=>Y6,CHIP_VARIANTS:()=>KJ,CHIP_EVENTS:()=>GJ,CHIPS_EVENTS:()=>X9,CHECKBOX_VARIANTS:()=>s$,CHECKBOX_STATES:()=>JJ,CHECKBOX_LABEL_POSITION:()=>m$,CHECKBOX_CLASSES:()=>QJ,CAROUSEL_TRANSITIONS:()=>o7,CAROUSEL_SCROLL_BEHAVIORS:()=>o1,CAROUSEL_LAYOUTS:()=>U9,CAROUSEL_ITEM_SIZES:()=>dQ,CAROUSEL_EVENTS:()=>p9,CAROUSEL_DEFAULTS:()=>F6,CARD_WIDTHS:()=>l$,CARD_VARIANTS:()=>O9,CARD_MEDIA_POSITION:()=>a1,CARD_ELEVATIONS:()=>G7,CARD_CORNER_RADIUS:()=>s1,CARD_CLASSES:()=>c1,CARD_ASPECT_RATIOS:()=>r$,CARD_ACTION_ALIGNMENT:()=>m1,BUTTON_VARIANTS:()=>p7,BUTTON_TYPES:()=>a7,BUTTON_SIZES:()=>s7,BUTTON_SHAPES:()=>m7,BUTTON_CLASSES:()=>r1,BADGE_VARIANTS:()=>I7,BADGE_POSITIONS:()=>b7,BADGE_MAX_CHARACTERS:()=>b9,BADGE_COLORS:()=>S7,AnimationFrameManager:()=>LQ,ANIMATION_DURATIONS:()=>h1});module.exports=o3(wK);var j9={COLLECTION:"items",BASE_URL:"http://localhost:4000/api",PAGE_SIZE:20,RENDER_BUFFER_SIZE:5,ITEM_HEIGHT:48},X$={DEFAULT:"default",SINGLE_SELECT:"single-select",MULTI_SELECT:"multi-select"},B$={NONE:"none",SINGLE:"single",MULTIPLE:"multiple"},M9={SELECT:"select",LOAD:"load",SCROLL:"scroll"},F$={START:"start",CENTER:"center",END:"end"},e={CONTAINER:"list-container",LIST:"list",ITEM:"list-item",SELECTED:"list-item--selected",LOADING:"list--loading",EMPTY:"list--empty"};var _7={FILLED:"filled",OUTLINED:"outlined"},L7={BOTTOM_START:"bottom-start",BOTTOM:"bottom",BOTTOM_END:"bottom-end",TOP_START:"top-start",TOP:"top",TOP_END:"top-end"},H$={MOUSE:"mouse",KEYBOARD:"keyboard"},k$={CHANGE:"change",OPEN:"open",CLOSE:"close"},M$={DROPDOWN:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M7 10l5 5 5-5z"/></svg>',CHECKMARK:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>'},y9={VARIANT:_7.FILLED,PLACEMENT:L7.BOTTOM_START,LABEL:"Select",VALUE:"",REQUIRED:!1,DISABLED:!1,SUPPORTING_TEXT:"",ERROR:!1},V$={CONTAINER:"select",TEXTFIELD:"select__textfield",DROPDOWN_ICON:"select__dropdown-icon",MENU:"select__menu",MENU_ITEM:"select__menu-item",MENU_ITEM_SELECTED:"select__menu-item--selected",MENU_ITEM_DISABLED:"select__menu-item--disabled",MENU_ITEM_CHECKMARK:"select__menu-item-checkmark",MENU_ITEM_ICON:"select__menu-item-icon",MENU_ITEM_TEXT:"select__menu-item-text",FILLED:"select--filled",OUTLINED:"select--outlined",OPEN:"select--open",DISABLED:"select--disabled",REQUIRED:"select--required",ERROR:"select--error"};w7();J6();t();var F1={CENTER:"center",END:"end"},H1=300;var Lq={tag:"div",hasFab:!1,fabPosition:F1.END,autoHide:!1,transitionDuration:H1},U5=(J={})=>d(Lq,J,"bottom-app-bar");var X5=(J={})=>{let $=U5(J),Q=S($),Z=document.createElement("div");Z.className=`${Q.getClass("bottom-app-bar")}-actions`;let q=document.createElement("div");q.className=`${Q.getClass("bottom-app-bar")}-fab-container`;let j=E({tag:$.tag,componentName:"bottom-app-bar",className:[$.hasFab?`${Q.getClass("bottom-app-bar")}--with-fab`:"",$.fabPosition==="center"?`${Q.getClass("bottom-app-bar")}--fab-center`:"",$.class],attributes:{role:"toolbar","aria-label":"Bottom app bar"},interactive:!0})(Q),G=g()(j),K=C()(G);K.element.appendChild(Z),K.element.appendChild(q);let z=!0,W=window.scrollY;if($.autoHide){let U=()=>{let _=window.scrollY;if(_>W+10){if(z)Y.hide(),$.onVisibilityChange?.(!1)}else if(_<W-10){if(!z)Y.show(),$.onVisibilityChange?.(!0)}W=_};window.addEventListener("scroll",U,{passive:!0});let X=K.lifecycle.destroy;K.lifecycle.destroy=()=>{window.removeEventListener("scroll",U),X()}}let Y={...K,addAction(U){return Z.appendChild(U),this},addFab(U){return q.innerHTML="",q.appendChild(U),this.element.classList.add(`${Q.getClass("bottom-app-bar")}--with-fab`),this},show(){return this.element.classList.remove(`${Q.getClass("bottom-app-bar")}--hidden`),z=!0,this},hide(){return this.element.classList.add(`${Q.getClass("bottom-app-bar")}--hidden`),z=!1,this},isVisible(){return z},getActionsContainer(){return Z}};if($.autoHide&&$.transitionDuration)Y.element.style.transition=`transform ${$.transitionDuration}ms ease-in-out`;return Y};var B5=X5;l9();J6();c();o();var d$=({lifecycle:J})=>($)=>({...$,element:$.element,addContent(Q){if(Q&&Q.classList.contains(`${$.getClass("card")}-content`))$.element.appendChild(Q);return this},setHeader(Q){if(Q&&Q.classList.contains(`${$.getClass("card")}-header`)){let Z=$.element.querySelector(`.${$.getClass("card")}-header`);if(Z)Z.remove();if($.element.querySelector(`.${$.getClass("card")}-media`)){let j=$.element.querySelectorAll(`.${$.getClass("card")}-media`),G=j[j.length-1];if(G.nextSibling)$.element.insertBefore(Q,G.nextSibling);else $.element.appendChild(Q)}else $.element.insertBefore(Q,$.element.firstChild)}return this},addMedia(Q,Z="top"){if(Q&&Q.classList.contains(`${$.getClass("card")}-media`))if(Z==="top")$.element.insertBefore(Q,$.element.firstChild);else $.element.appendChild(Q);return this},setActions(Q){if(Q&&Q.classList.contains(`${$.getClass("card")}-actions`)){let Z=$.element.querySelector(`.${$.getClass("card")}-actions`);if(Z)Z.remove();$.element.appendChild(Q)}return this},makeDraggable(Q){if($.element.setAttribute("draggable","true"),$.element.setAttribute("aria-grabbed","false"),typeof Q==="function")$.element.addEventListener("dragstart",(Z)=>{$.element.setAttribute("aria-grabbed","true"),Q(Z)}),$.element.addEventListener("dragend",()=>{$.element.setAttribute("aria-grabbed","false")});return this},focus(){return $.element.focus(),this},destroy(){J.destroy()}});t();y6();J6();c();A6();var c7=(J={})=>{let $={...J,componentName:"card-content",prefix:u};try{let Q=b(S,E({tag:"div",componentName:"card-content",className:[J.class,J.padding===!1?`${u}-card-content--no-padding`:null],attributes:{role:"region",style:"display: block; color: inherit;"}}))($);if(J.html)Q.element.innerHTML=J.html;else if(J.text)Q.element.innerHTML=`<p>${J.text}</p>`;if(Array.isArray(J.children))J.children.forEach((Z)=>{if(Z instanceof HTMLElement)Q.element.appendChild(Z)});return Q.element.classList.add("debug-content"),Q.element}catch(Q){throw console.error("Card content creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card content: ${Q instanceof Error?Q.message:String(Q)}`)}},i7=(J={})=>{let $={...J,componentName:"card-header",prefix:u};try{let Q=b(S,E({tag:"div",componentName:"card-header",className:J.class,attributes:{role:"heading","aria-level":"3"}}))($),Z=v({tag:"div",className:`${u}-card-header-text`,container:Q.element});if(J.title){v({tag:"h3",className:`${u}-card-header-title`,text:J.title,container:Z,attributes:{id:`${Q.element.id||"card-header"}-title`}});let q=Q.element.closest(`.${u}-card`);if(q&&!q.hasAttribute("aria-labelledby"))q.setAttribute("aria-labelledby",`${Q.element.id||"card-header"}-title`)}if(J.subtitle)v({tag:"h4",className:`${u}-card-header-subtitle`,text:J.subtitle,container:Z});if(J.avatar){let q=typeof J.avatar==="string"?v({tag:"div",className:`${u}-card-header-avatar`,html:J.avatar}):J.avatar,j=q.querySelector("img");if(j&&!j.hasAttribute("alt"))j.setAttribute("alt",""),j.setAttribute("aria-hidden","true");Q.element.insertBefore(q,Q.element.firstChild)}if(J.action){let q=typeof J.action==="string"?v({tag:"div",className:`${u}-card-header-action`,html:J.action}):J.action;Q.element.appendChild(q)}return Q.element}catch(Q){throw console.error("Card header creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card header: ${Q instanceof Error?Q.message:String(Q)}`)}},j7=(J={})=>{let $={...J,componentName:"card-actions",prefix:u};try{let Q=b(S,E({tag:"div",componentName:"card-actions",className:[J.class,J.fullBleed?`${u}-card-actions--full-bleed`:null,J.vertical?`${u}-card-actions--vertical`:null,J.align?`${u}-card-actions--${J.align}`:null],attributes:{role:"group"}}))($);if(Array.isArray(J.actions))J.actions.forEach((Z,q)=>{if(Z instanceof HTMLElement){if(!Z.hasAttribute("aria-label")&&!Z.hasAttribute("aria-labelledby")&&Z.textContent?.trim()==="")Z.setAttribute("aria-label",`Action ${q+1}`);Q.element.appendChild(Z)}});return Q.element}catch(Q){throw console.error("Card actions creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card actions: ${Q instanceof Error?Q.message:String(Q)}`)}},K7=(J={})=>{let $={...J,componentName:"card-media",prefix:u};try{let Q=b(S,E({tag:"div",componentName:"card-media",className:[J.class,J.aspectRatio?`${u}-card-media--${J.aspectRatio.replace(":","-")}`:null,J.contain?`${u}-card-media--contain`:null]}))($);if(J.element instanceof HTMLElement)Q.element.appendChild(J.element);else if(J.src){let Z=document.createElement("img");if(Z.src=J.src,Z.className=`${u}-card-media-img`,Z.alt=J.alt||"",!J.alt)Z.setAttribute("aria-hidden","true");Q.element.appendChild(Z)}return Q.element}catch(Q){throw console.error("Card media creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card media: ${Q instanceof Error?Q.message:String(Q)}`)}};var O9={ELEVATED:"elevated",FILLED:"filled",OUTLINED:"outlined"},G7={LEVEL0:0,LEVEL1:1,LEVEL2:2,LEVEL4:4},l$={SMALL:"344px",MEDIUM:"480px",LARGE:"624px",FULL:"100%"},s1={SMALL:"8px",MEDIUM:"12px",LARGE:"16px"},r$={SQUARE:"1:1",STANDARD:"4:3",WIDESCREEN:"16:9"},m1={START:"start",CENTER:"center",END:"end",SPACE_BETWEEN:"space-between"},a1={TOP:"top",BOTTOM:"bottom"},c1={ROOT:"card",HEADER:"card-header",TITLE:"card-title",SUBTITLE:"card-subtitle",AVATAR:"card-avatar",HEADER_ACTION:"card-header-action",CONTENT:"card-content",MEDIA:"card-media",ACTIONS:"card-actions",DRAGGABLE:"card-draggable",INTERACTIVE:"card-interactive",FULL_WIDTH:"card-full-width",CLICKABLE:"card-clickable",LOADING:"card-loading",EXPANDED:"card-expanded",ELEVATION_PREFIX:"card-elevation-"};var uq={variant:O9.ELEVATED,interactive:!1,fullWidth:!1,clickable:!1,draggable:!1},SQ=(J)=>{let $={...J};if(J.header)$.headerConfig=J.header;if(J.content)$.contentConfig=J.content;if(J.media)$.mediaConfig=J.media;if(J.actions)$.actionsConfig=J.actions;return $},bQ=(J,$)=>{if($.mediaConfig&&(!$.mediaConfig.position||$.mediaConfig.position==="top")){let Q=K7({...$.mediaConfig,position:void 0});J.addMedia(Q,"top")}if($.headerConfig){let Q=i7($.headerConfig);J.setHeader(Q)}if($.contentConfig){let Q=c7($.contentConfig);J.addContent(Q)}if($.mediaConfig&&$.mediaConfig.position==="bottom"){let Q=K7({...$.mediaConfig,position:void 0});J.addMedia(Q,"bottom")}if($.actionsConfig){let Q=j7($.actionsConfig);J.setActions(Q)}if(Array.isArray($.buttons)&&$.buttons.length>0)Promise.resolve().then(() => (l9(),IQ)).then(({default:Q})=>{let Z=$.buttons.map((j)=>Q(j).element),q=j7({actions:Z,align:$.actionsConfig?.align||"end"});J.setActions(q)}).catch((Q)=>{console.error("Error processing buttons:",Q)})},vQ=(J={})=>d(uq,J,"card"),CQ=(J)=>{let $=J.interactive||J.clickable,Q=$?"button":"region",Z={};if(J.aria)Object.entries(J.aria).forEach(([q,j])=>{if(j!==void 0){let G=q.startsWith("aria-")?q:`aria-${q}`;Z[G]=j}});if(!Z.role&&!J.aria?.role)Z.role=Q;if($&&!Z.tabindex)Z.tabindex="0";return p(J,{tag:"div",className:[J.class,J.fullWidth?`${J.prefix}-card--full-width`:null,$?`${J.prefix}-card--interactive`:null],attributes:Z,forwardEvents:{click:()=>!!J.clickable,mouseenter:()=>!!$,mouseleave:()=>!!$,keydown:()=>!!$,focus:()=>!!$,blur:()=>!!$},interactive:$})},EQ=(J)=>({lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}}),r9=G7,hQ=(J)=>{let $=J.config;if($.interactive||$.clickable)J.element.addEventListener("mouseenter",()=>{if($.variant===O9.ELEVATED)J.element.style.setProperty("--card-elevation",String(r9.LEVEL2))}),J.element.addEventListener("mouseleave",()=>{if($.variant===O9.ELEVATED)J.element.style.setProperty("--card-elevation",String(r9.LEVEL1))}),J.element.addEventListener("keydown",(Z)=>{if((Z.key==="Enter"||Z.key===" ")&&$.clickable)Z.preventDefault(),J.element.click()}),J.element.addEventListener("focus",()=>{J.element.classList.add(`${J.getClass("card")}--focused`)}),J.element.addEventListener("blur",()=>{J.element.classList.remove(`${J.getClass("card")}--focused`)});if($.draggable)J.element.setAttribute("draggable","true"),J.element.addEventListener("dragstart",(Z)=>{if(J.element.style.setProperty("--card-elevation",String(r9.LEVEL4)),J.element.classList.add(`${J.getClass("card")}--dragging`),J.emit?.("dragstart",{event:Z}),Z.dataTransfer){let q=J.element.querySelector(`.${J.getClass("card")}-header-title`)?.textContent||"Card";Z.dataTransfer.setData("text/plain",q)}}),J.element.addEventListener("dragend",(Z)=>{J.element.style.setProperty("--card-elevation",String(r9.LEVEL1)),J.element.classList.remove(`${J.getClass("card")}--dragging`),J.emit?.("dragend",{event:Z})});return J};y6();A6();var uQ=(J={})=>($)=>{let Q=J.initialState||!1,Z=null,q=Q;function j(G){if(q=G,G&&!Z)Z=v({tag:"div",className:`${u}-card-loading-overlay`,container:$.element,attributes:{role:"progressbar","aria-busy":"true","aria-label":"Loading"}}),v({tag:"div",className:`${u}-card-loading-spinner`,container:Z}),$.element.classList.add(`${u}-card--state-loading`),$.element.setAttribute("aria-busy","true");else if(!G&&Z)Z.remove(),Z=null,$.element.classList.remove(`${u}-card--state-loading`),$.element.setAttribute("aria-busy","false")}if(Q)j(!0);return{...$,loading:{isLoading:()=>q,setLoading:j}}},p$=(J)=>{if(J.config.variant==="elevated")J.element.style.setProperty("--card-elevation",String(r9.LEVEL1));else J.element.style.setProperty("--card-elevation",String(r9.LEVEL0));return J},fQ=(J={})=>($)=>{let Q=J.initialExpanded||!1,Z=Q,q=J.expandableContent,j=v({tag:"button",className:`${u}-card-expand-button`,attributes:{"aria-expanded":Z?"true":"false","aria-label":Z?"Collapse content":"Expand content","aria-controls":q?.id||`${$.element.id||"card"}-expandable-content`}}),G=$.element.querySelector(`.${u}-card-actions`);if(G)G.appendChild(j);else v({tag:"div",className:`${u}-card-actions`,container:$.element,attributes:{role:"group"}}).appendChild(j);if(q){if(q.classList.add(`${u}-card-expandable-content`),!q.id)q.id=`${$.element.id||"card"}-expandable-content`;if(!Q)q.style.display="none",q.setAttribute("aria-hidden","true");else q.setAttribute("aria-hidden","false");$.element.appendChild(q)}function K(W){if(Z=W,q)q.style.display=W?"block":"none",q.setAttribute("aria-hidden",W?"false":"true");if(j.setAttribute("aria-expanded",W?"true":"false"),j.setAttribute("aria-label",W?"Collapse content":"Expand content"),W)$.element.classList.add(`${u}-card--expanded`);else $.element.classList.remove(`${u}-card--expanded`);$.emit?.("expandedChanged",{expanded:W})}function z(){K(!Z)}return j.addEventListener("click",(W)=>{W.stopPropagation(),z()}),j.addEventListener("keydown",(W)=>{if(W.key==="Enter"||W.key===" ")W.preventDefault(),z()}),{...$,expandable:{isExpanded:()=>Z,setExpanded:K,toggleExpanded:z}}},gQ=(J={})=>($)=>{let Q=J.threshold||100,Z=0,q=0;$.element.setAttribute("aria-description","Swipeable card. Swipe left or right to perform actions.");let j=v({tag:"button",className:`${u}-card-swipe-left-action`,text:"Swipe Left Action",container:$.element,attributes:{"aria-label":"Perform swipe left action",style:"position: absolute; left: -9999px; top: -9999px; visibility: hidden;"}}),G=v({tag:"button",className:`${u}-card-swipe-right-action`,text:"Swipe Right Action",container:$.element,attributes:{"aria-label":"Perform swipe right action",style:"position: absolute; left: -9999px; top: -9999px; visibility: hidden;"}});j.addEventListener("click",()=>{if(J.onSwipeLeft)$.element.style.transform="translateX(-100%)",$.element.style.transition="transform 0.3s ease",J.onSwipeLeft($)}),G.addEventListener("click",()=>{if(J.onSwipeRight)$.element.style.transform="translateX(100%)",$.element.style.transition="transform 0.3s ease",J.onSwipeRight($)});function K(Y){Z=Y.touches[0].clientX,$.element.style.transition="none"}function z(Y){if(!Z)return;q=Y.touches[0].clientX;let U=q-Z;$.element.style.transform=`translateX(${U}px)`}function W(){if(!Z)return;$.element.style.transition="transform 0.3s ease";let Y=q-Z;if(Math.abs(Y)>=Q)if(Y>0&&J.onSwipeRight)$.element.style.transform="translateX(100%)",J.onSwipeRight($);else if(Y<0&&J.onSwipeLeft)$.element.style.transform="translateX(-100%)",J.onSwipeLeft($);else $.element.style.transform="translateX(0)";else $.element.style.transform="translateX(0)";Z=0,q=0}return $.element.addEventListener("touchstart",K),$.element.addEventListener("touchmove",z),$.element.addEventListener("touchend",W),$.element.classList.add(`${u}-card--swipeable`),{...$,swipeable:{reset:()=>{$.element.style.transition="transform 0.3s ease",$.element.style.transform="translateX(0)"}}}};var fq=(J={})=>{let $=SQ(J),Q=vQ($);try{let Z=b(S,g(),E(CQ(Q)),K6(Q),Q.clickable?T6(Q):(q)=>q,C(),hQ,p$,(q)=>d$(EQ(q))(q))(Q);return bQ(Z,$),Z}catch(Z){throw console.error("Card creation error:",Z instanceof Error?Z.message:String(Z)),new Error(`Failed to create card: ${Z instanceof Error?Z.message:String(Z)}`)}},i1=fq;J6();c();o();var U9={MULTI_BROWSE:"multi-browse",UNCONTAINED:"uncontained",HERO:"hero",FULL_SCREEN:"full-screen"},o1={DEFAULT:"default",SNAP:"snap"},dQ={LARGE:"large",MEDIUM:"medium",SMALL:"small"},o7={SLIDE:"slide",FADE:"fade",NONE:"none"},p9={SLIDE_CHANGE:"slide-change",SLIDE_CHANGED:"slide-changed",RESIZE:"resize"},F6={INITIAL_SLIDE:0,LOOP:!0,TRANSITION:o7.SLIDE,TRANSITION_DURATION:300,BORDER_RADIUS:16,GAP:8,LAYOUT:U9.MULTI_BROWSE,SCROLL_BEHAVIOR:o1.SNAP,SMALL_ITEM_WIDTH:48,ITEM_WIDTHS:{[U9.MULTI_BROWSE]:{LARGE:240,MEDIUM:180,SMALL:48},[U9.UNCONTAINED]:{LARGE:240,MEDIUM:240,SMALL:240},[U9.HERO]:{LARGE:300,MEDIUM:240,SMALL:48},[U9.FULL_SCREEN]:{LARGE:"100%",MEDIUM:"100%",SMALL:"100%"}}};var t1=(J)=>($)=>{let Q={...$},Z=J.layout||F6.LAYOUT,q=()=>{let F=document.createElement("div");return F.className=`${$.getClass("carousel")}-wrapper`,F.dataset.layout=Z,$.element.appendChild(F),F},j=document.createElement("div");if(j.className=`${$.getClass("carousel")}-slides`,j.setAttribute("role","list"),j.setAttribute("aria-label","Carousel Slides"),J.scrollBehavior==="snap")j.dataset.snapScroll="true";j.dataset.gap=`${J.gap||F6.GAP}`;let G=q();G.appendChild(j);let K=J.initialSlide||0,z=0,W=[],Y=[];function U(F){if(Y[F]?.size)return Y[F].size;switch(Z){case"multi-browse":if(F===0||F===1)return"large";if(F===2)return"medium";return"small";case"uncontained":return"large";case"hero":return F===0?"large":"small";case"full-screen":return"large";default:return"large"}}function X(){let F=j.clientWidth,V=typeof F6.ITEM_WIDTHS[Z].LARGE==="number"?F6.ITEM_WIDTHS[Z].LARGE:F,O=typeof F6.ITEM_WIDTHS[Z].MEDIUM==="number"?F6.ITEM_WIDTHS[Z].MEDIUM:F*0.75,P=typeof F6.ITEM_WIDTHS[Z].SMALL==="number"?F6.ITEM_WIDTHS[Z].SMALL:F6.SMALL_ITEM_WIDTH;if(J.largeItemMaxWidth&&typeof J.largeItemMaxWidth==="number")V=Math.min(V,J.largeItemMaxWidth);if(J.smallItemWidth&&typeof J.smallItemWidth==="number")P=J.smallItemWidth;if(Z==="full-screen")V=F,O=F,P=F;W.forEach((L,D)=>{let R=U(D);switch(R){case"large":L.style.width=`${V}px`;break;case"medium":L.style.width=`${O}px`;break;case"small":L.style.width=`${P}px`;break}L.className=`${$.getClass("carousel")}-slide ${$.getClass("carousel")}-slide--${R}`;let w=L.querySelector(`.${$.getClass("carousel")}-slide-title`),A=L.querySelector(`.${$.getClass("carousel")}-slide-description`);if(w)if(R==="small"&&Z!=="uncontained")w.classList.add("visually-hidden");else w.classList.remove("visually-hidden");if(A)if(R==="small"||R==="medium"&&Z==="multi-browse")A.classList.add("visually-hidden");else A.classList.remove("visually-hidden")})}function _(F,V){let O=document.createElement("div");O.className=`${$.getClass("carousel")}-slide`,O.setAttribute("role","listitem"),O.setAttribute("aria-roledescription","slide"),O.dataset.borderRadius=`${J.borderRadius||F6.BORDER_RADIUS}`;let P=document.createElement("div");P.className=`${$.getClass("carousel")}-slide-image`;let L=document.createElement("img");if(L.src=F.image,L.alt=F.title||"Carousel slide",P.appendChild(L),F.accent){let R=document.createElement("div");if(R.className=`${$.getClass("carousel")}-slide-overlay`,F.accent)R.style.backgroundColor=F.accent;P.appendChild(R)}let D=document.createElement("div");if(D.className=`${$.getClass("carousel")}-slide-content`,F.title){let R=document.createElement("div");if(R.className=`${$.getClass("carousel")}-slide-title`,R.textContent=F.title,Z==="full-screen")D.appendChild(R);else P.appendChild(R)}if(F.description){let R=document.createElement("div");R.className=`${$.getClass("carousel")}-slide-description`,R.textContent=F.description,D.appendChild(R)}if(F.buttonText){let R=document.createElement("a");if(R.className=`${$.getClass("carousel")}-slide-button`,R.textContent=F.buttonText,F.buttonUrl)R.href=F.buttonUrl;if(F.accent)R.style.backgroundColor=F.accent;D.appendChild(R)}if(O.appendChild(P),O.appendChild(D),V!==void 0&&V>=0&&V<=Y.length)Y.splice(V,0,F);else Y.push(F);if(V!==void 0&&V>=0&&V<=W.length)if(V<W.length)j.insertBefore(O,W[V]),W.splice(V,0,O);else j.appendChild(O),W.push(O);else j.appendChild(O),W.push(O);return z++,X(),O}let H=()=>{if(J.showAllLink===!1)return;let F=document.createElement("div");F.className=`${$.getClass("carousel")}-show-all`,F.setAttribute("role","button"),F.setAttribute("tabindex","0"),F.setAttribute("aria-label","Show all items");let V=document.createElement("span");V.textContent="Show all",F.appendChild(V),G.appendChild(F),F.addEventListener("click",()=>{if(J.onShowAll&&typeof J.onShowAll==="function")J.onShowAll()}),F.addEventListener("keydown",(O)=>{if(O.key==="Enter"||O.key===" "){if(J.onShowAll&&typeof J.onShowAll==="function")J.onShowAll();O.preventDefault()}})};if(J.slides&&J.slides.length>0)J.slides.forEach((F)=>{_(F)});if(J.showAllLink!==!1&&Z!=="full-screen")H();let B=()=>{X();let F=new CustomEvent(p9.RESIZE,{detail:{width:j.clientWidth}});$.element.dispatchEvent(F)};window.addEventListener("resize",B),setTimeout(X,0);let M=(F)=>{if(F<0||F>=z)if(J.loop)if(F<0)F=z-1;else F=0;else return Q;if(K!==F){let V=new CustomEvent(p9.SLIDE_CHANGE,{detail:{previousSlide:K,nextSlide:F}});$.element.dispatchEvent(V),K=F,W.forEach((L,D)=>{if(D===K)L.classList.add(`${$.getClass("carousel")}-slide--active`),L.setAttribute("aria-current","true");else L.classList.remove(`${$.getClass("carousel")}-slide--active`),L.removeAttribute("aria-current")});let O=J.scrollBehavior==="snap"?"smooth":"auto";if(W[F])if(Z==="hero"&&J.centered){let L=W[F].offsetWidth,D=j.clientWidth,R=W[F].offsetLeft;j.scrollTo({left:R-D/2+L/2,behavior:O})}else W[F].scrollIntoView({behavior:O,block:"nearest",inline:"start"});let P=new CustomEvent(p9.SLIDE_CHANGED,{detail:{currentSlide:K}});$.element.dispatchEvent(P)}return Q};if(Object.assign(Q,{slides:{addSlide:(F,V)=>{return _(F,V),Q.slides},removeSlide:(F)=>{if(F>=0&&F<W.length){if(j.removeChild(W[F]),W.splice(F,1),Y.splice(F,1),z--,K>=z)K=z-1;if(K<0)K=0;X()}return Q.slides},updateSlide:(F,V)=>{if(F>=0&&F<W.length){Y[F]=V;let O=W[F],P=O.querySelector("img");if(P)P.src=V.image,P.alt=V.title||"Carousel slide";let L=O.querySelector(`.${$.getClass("carousel")}-slide-title`);if(L&&V.title)L.textContent=V.title;let D=O.querySelector(`.${$.getClass("carousel")}-slide-description`);if(D&&V.description)D.textContent=V.description;let R=O.querySelector(`.${$.getClass("carousel")}-slide-overlay`);if(R&&V.accent)R.style.backgroundColor=V.accent;let w=O.querySelector(`.${$.getClass("carousel")}-slide-button`);if(w)if(V.buttonText){if(w.textContent=V.buttonText,V.buttonUrl)w.href=V.buttonUrl;if(V.accent)w.style.backgroundColor=V.accent}else w.parentElement?.removeChild(w);else if(V.buttonText){let A=O.querySelector(`.${$.getClass("carousel")}-slide-content`);if(A){let x=document.createElement("a");if(x.className=`${$.getClass("carousel")}-slide-button`,x.textContent=V.buttonText,V.buttonUrl)x.href=V.buttonUrl;if(V.accent)x.style.backgroundColor=V.accent;A.appendChild(x)}}if(V.size)X()}return Q.slides},getSlide:(F)=>{if(F>=0&&F<Y.length)return Y[F];return null},getCount:()=>z,getElements:()=>[...W]},slidesContainer:j,slideData:Y,wrapper:G,getCurrentSlide:()=>K,goTo:M,next:()=>M(K+1),prev:()=>M(K-1),enableLoop:()=>{return J.loop=!0,Q},disableLoop:()=>{return J.loop=!1,Q},setBorderRadius:(F)=>{return J.borderRadius=F,W.forEach((V)=>{V.dataset.borderRadius=`${F}`}),Q},setGap:(F)=>{return J.gap=F,j.dataset.gap=`${F}`,Q},updateLayout:(F)=>{return J.layout=F,G.dataset.layout=F,$.element.dataset.layout=F,Object.values(U9).forEach((V)=>{$.element.classList.remove(`${$.getClass("carousel")}-layout--${V}`)}),$.element.classList.add(`${$.getClass("carousel")}-layout--${F}`),X(),Q},lifecycle:{...$.lifecycle||{},destroy:()=>{if(window.removeEventListener("resize",B),$.lifecycle&&$.lifecycle.destroy)$.lifecycle.destroy()}}}),J.transition)$.element.classList.add(`${$.getClass("carousel")}-transition--${J.transition}`);if(J.scrollBehavior==="snap")j.addEventListener("scroll",()=>{clearTimeout(Q.scrollTimeout),Q.scrollTimeout=setTimeout(()=>{let F=0,V=1/0,O=j.scrollLeft,P=j.clientWidth;if(W.forEach((L,D)=>{let w=L.offsetLeft+L.offsetWidth/2,A=O+P/2,x=Math.abs(w-A);if(x<V)V=x,F=D}),F!==K){K=F,W.forEach((D,R)=>{if(R===K)D.classList.add(`${$.getClass("carousel")}-slide--active`),D.setAttribute("aria-current","true");else D.classList.remove(`${$.getClass("carousel")}-slide--active`),D.removeAttribute("aria-current")});let L=new CustomEvent(p9.SLIDE_CHANGED,{detail:{currentSlide:K}});$.element.dispatchEvent(L)}},150)});return Q};var n1=(J)=>($)=>{let Q,Z,q,j=!1,G=0,K=0,z,W=J.scrollBehavior||"default",Y=(V)=>{if(V.button!==0)return;cancelAnimationFrame(z),Q=V.clientX,Z=$.slidesContainer.scrollLeft,q=Q,j=!0,K=Date.now(),G=0,$.slidesContainer.dataset.touchAction="none",$.element.dataset.dragging="true",$.slidesContainer.style.scrollBehavior="auto",$.element.setPointerCapture(V.pointerId),V.preventDefault()},U=(V)=>{if(!j)return;let O=V.clientX-Q;$.slidesContainer.scrollLeft=Z-O;let P=Date.now(),L=P-K;if(L>0)G=(V.clientX-q)/L;q=V.clientX,K=P,V.preventDefault()},X=()=>{let V=$.slides.getElements(),O=$.slidesContainer.clientWidth,P=$.slidesContainer.scrollLeft,L=J.layout==="hero"&&J.centered,D=0,R=1/0;return V.forEach((w)=>{let A;if(L)A=w.offsetLeft+w.offsetWidth/2-O/2;else A=w.offsetLeft;let x=Math.abs(A-P);if(x<R)R=x,D=A}),D},_=(V,O,P)=>{let L=Date.now(),D=O-V,R=500;if(Math.abs(P)>0.5)R=Math.min(R,300);let w=()=>{let A=Date.now()-L,x=Math.min(A/R,1);x=1-Math.pow(1-x,3);let I=V+D*x;if($.slidesContainer.scrollLeft=I,x<1)z=requestAnimationFrame(w)};z=requestAnimationFrame(w)},H=(V)=>{if(!j)return;if(j=!1,delete $.element.dataset.dragging,$.element.releasePointerCapture(V.pointerId),W==="snap"){let O=X();_($.slidesContainer.scrollLeft,O,G)}else if(Math.abs(G)>0.5){let O=G*100,P=$.slidesContainer.scrollLeft-O;_($.slidesContainer.scrollLeft,P,G)}G=0,setTimeout(()=>{$.slidesContainer.style.scrollBehavior=""},0)},B=(V)=>{if(j)j=!1,delete $.element.dataset.dragging,$.element.releasePointerCapture(V.pointerId),$.slidesContainer.style.scrollBehavior=""},M=(V)=>{if(J.layout==="full-screen")return;V.preventDefault();let P=(V.deltaY||V.deltaX)*0.5;if(W==="snap")$.slidesContainer.scrollLeft+=P,clearTimeout($.wheelSnapTimeout),$.wheelSnapTimeout=setTimeout(()=>{let L=X();_($.slidesContainer.scrollLeft,L,0)},150);else $.slidesContainer.scrollLeft+=P},k=()=>{if(J.layout!=="multi-browse"||!$.element.dataset.enableParallax)return;let V=$.slides.getElements(),O=$.slidesContainer.clientWidth,P=$.slidesContainer.scrollLeft;V.forEach((L)=>{let{offsetLeft:D,offsetWidth:R}=L,w=D+R/2,A=P+O/2,x=w-A,I=Math.max(-1,Math.min(1,x/(O/2))),r=L.querySelector(`.${$.getClass("carousel")}-slide-image img`);if(r)r.style.transform=`translateX(${I*-5}%)`})},N=()=>{k()};if(J.layout==="multi-browse")$.element.dataset.enableParallax="true";$.element.dataset.swipe="true",$.slidesContainer.addEventListener("pointerdown",Y),window.addEventListener("pointermove",U),window.addEventListener("pointerup",H),window.addEventListener("pointercancel",B),$.slidesContainer.addEventListener("wheel",M,{passive:!1}),$.slidesContainer.addEventListener("scroll",N,{passive:!0});let F=(V)=>{if($.element!==document.activeElement)return;switch(V.key){case"ArrowLeft":if($.prev)$.prev();else $.slidesContainer.scrollBy({left:-200,behavior:W==="snap"?"smooth":"auto"});V.preventDefault();break;case"ArrowRight":if($.next)$.next();else $.slidesContainer.scrollBy({left:200,behavior:W==="snap"?"smooth":"auto"});V.preventDefault();break;case"Home":if($.goTo)$.goTo(0);V.preventDefault();break;case"End":if($.goTo&&$.slides.getCount)$.goTo($.slides.getCount()-1);V.preventDefault();break}};return $.element.setAttribute("tabindex","0"),$.element.addEventListener("keydown",F),$.element.setAttribute("aria-label","Carousel"),{...$,lifecycle:{...$.lifecycle,destroy:()=>{if(cancelAnimationFrame(z),$.slidesContainer.removeEventListener("pointerdown",Y),window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",H),window.removeEventListener("pointercancel",B),$.slidesContainer.removeEventListener("wheel",M),$.slidesContainer.removeEventListener("scroll",N),$.element.removeEventListener("keydown",F),$.lifecycle&&$.lifecycle.destroy)$.lifecycle.destroy()}}}};var lQ=(J)=>($)=>{let Q={element:$.element,slides:{addSlide:(Z,q)=>{return J.slides.addSlide(Z,q),Q.slides},removeSlide:(Z)=>{return J.slides.removeSlide(Z),Q.slides},updateSlide:(Z,q)=>{return J.slides.updateSlide(Z,q),Q.slides},getSlide:(Z)=>{if($.slideData&&Z>=0&&Z<$.slideData.length)return $.slideData[Z];return null},getCount:J.slides.getCount,getElements:J.slides.getElements},lifecycle:{destroy:J.lifecycle.destroy},getClass:$.getClass,next(){return $.next(),this},prev(){return $.prev(),this},goTo(Z){return $.goTo(Z),this},getCurrentSlide:$.getCurrentSlide,addSlide(Z,q){return J.slides.addSlide(Z,q),this},removeSlide(Z){return J.slides.removeSlide(Z),this},enableLoop(){return $.enableLoop(),this},disableLoop(){return $.disableLoop(),this},setBorderRadius(Z){if($.setBorderRadius)$.setBorderRadius(Z);return this},setGap(Z){if($.setGap)$.setGap(Z);return this},destroy(){J.lifecycle.destroy()},on(Z,q){if($.on)$.on(Z,q);else if($.element.addEventListener)$.element.addEventListener(Z,q);return this},off(Z,q){if($.off)$.off(Z,q);else if($.element.removeEventListener)$.element.removeEventListener(Z,q);return this},addClass(...Z){if($.addClass)$.addClass(...Z);else Z.forEach((q)=>$.element.classList.add(q));return this}};return Q};t();var gq={initialSlide:F6.INITIAL_SLIDE,loop:F6.LOOP,transition:o7.SLIDE,transitionDuration:F6.TRANSITION_DURATION,borderRadius:F6.BORDER_RADIUS,gap:F6.GAP,prefix:"carousel",showAllLink:!0},rQ=(J={})=>d(gq,J,"carousel"),pQ=(J)=>{let $={role:"region","aria-roledescription":"carousel","aria-live":"polite"},Q={"data-transition":J.transition,"data-loop":J.loop?"true":"false"};return p(J,{tag:"div",attributes:{...$,...Q},className:J.class,forwardEvents:{keydown:!0,focus:!0,blur:!0}})};var dq=(J={})=>{J.layout=J.layout||"multi-browse",J.scrollBehavior=J.scrollBehavior||lq(J.layout);let $=rQ(J);try{let Z={...b(S,g(),E(pQ($)))($)};rq(Z,J);let q=t1($)(Z),j=n1($)(q),G=C()(j),K={slides:{addSlide:G.slides.addSlide,removeSlide:G.slides.removeSlide,updateSlide:G.slides.updateSlide,getCount:G.slides.getCount,getElements:G.slides.getElements},lifecycle:{destroy:G.lifecycle.destroy}},z=lQ(K)(G);return z.element.dataset.layout=J.layout,z.element.dataset.scrollBehavior=J.scrollBehavior,z}catch(Q){throw console.error("Carousel creation error:",Q),new Error(`Failed to create carousel: ${Q.message}`)}};function lq(J){switch(J){case"multi-browse":case"hero":case"full-screen":return"snap";case"uncontained":return"default";default:return"default"}}function rq(J,$){switch(J.element.classList.add(`${J.getClass("carousel")}-layout--${$.layout}`),$.layout){case"multi-browse":J.element.dataset.enableParallax="true",J.element.dataset.layout="multi-browse";break;case"uncontained":J.element.style.overflow="visible",J.element.dataset.layout="uncontained";break;case"hero":if(J.element.dataset.largeItemFocus="true",J.element.dataset.layout="hero",$.centered)J.element.dataset.centered="true";break;case"full-screen":J.element.style.width="100%",J.element.style.height="100%",J.element.style.maxWidth="100vw",J.element.style.maxHeight="100vh",J.element.dataset.verticalScroll="true",J.element.dataset.layout="full-screen",$.scrollBehavior="snap";break}if($.scrollBehavior==="snap")J.element.dataset.snapScroll="true";else J.element.dataset.snapScroll="false"}var e1=dq;J6();c();o();var sQ=({disabled:J,lifecycle:$,checkable:Q})=>(Z)=>({...Z,element:Z.element,input:Z.input,getValue:Z.getValue||(()=>""),setValue(q){return Z.setValue?.(q),this},check(){return Q.check(),this},uncheck(){return Q.uncheck(),this},toggle(){return Q.toggle(),this},isChecked(){return Q.isChecked()},setIndeterminate(q){return Z.setIndeterminate?.(q),this},setLabel(q){return Z.text?.setText(q),this},getLabel(){return Z.text?.getText()||""},on(q,j){return Z.on?.(q,j),this},off(q,j){return Z.off?.(q,j),this},enable(){return J.enable(),this},disable(){return J.disable(),this},destroy(){$.destroy()}});t();var pq={variant:"filled",labelPosition:"end"},mQ=(J={})=>d(pq,J,"checkbox"),aQ=(J)=>p(J,{tag:"div",className:J.class,interactive:!0}),cQ=(J)=>($)=>{let Q=document.createElement("span");return Q.className=`${J.prefix}-checkbox-icon`,Q.innerHTML=`
|
|
9
|
+
</svg>`,A7=(J)=>($)=>{let Q=document.createElement("span");Q.className=`${J.prefix}-${J.componentName}-track`;let Z=document.createElement("span");if(Z.className=`${J.prefix}-${J.componentName}-thumb`,Q.appendChild(Z),J.icon!=="none"){let q=document.createElement("span");q.className=`${J.prefix}-${J.componentName}-thumb-icon`,q.innerHTML=J.icon||jq,Z.appendChild(q)}return $.element.appendChild(Q),{...$,track:Q,thumb:Z}};var _$=(J)=>{let $=new Map;return{on(Q,Z){return J.addEventListener(Q,Z),$.set(Z,Q),this},off(Q,Z){return J.removeEventListener(Q,Z),$.delete(Z),this},destroy(){$.forEach((Q,Z)=>{J.removeEventListener(Q,Z)}),$.clear()},getHandlers(){return new Map($)}}};var r8=(J)=>($)=>{let Q=_$(J||$.element),Z={addListeners(q){return Object.entries(q).forEach(([j,K])=>{Q.on(j,K)}),this},removeListeners(q){return Object.entries(q).forEach(([j,K])=>{Q.off(j,K)}),this},once(q,j){let K=(G)=>{j(G),Q.off(q,K)};return Q.on(q,K),this},on(q,j){return Q.on(q,j),this},off(q,j){return Q.off(q,j),this},destroy(){Q.destroy()}};if(M6($)){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Q.destroy(),q.call($.lifecycle)}}return{...$,events:Z,on:Z.on.bind(Z),off:Z.off.bind(Z)}};var T4=()=>{};var I4=T(()=>{w7();y6()});var $7=(J,$,Q={})=>{let Z=null,q=0,{leading:j=!0,trailing:K=!0}=Q;return function(...G){let W=Date.now();if(!q&&!j)q=W;let z=$-(W-q);if(z<=0||z>$){if(Z)clearTimeout(Z),Z=null;q=W,J.apply(this,G)}else if(!Z&&K)Z=window.setTimeout(()=>{q=j?Date.now():0,Z=null,J.apply(this,G)},z)}},J7=(J,$,Q={})=>{let Z=null,q=null,j=null,K,G=null,W=0,{leading:z=!1,maxWait:Y}=Q,U=(B)=>{let k=B-(G||0),M=B-W;return!G||k>=$||k<0||Y!==void 0&&M>=Y},X=(B)=>{let k=q,M=j;return q=j=null,W=B,K=J.apply(M,k),K},_=(B)=>{if(Z=null,q)return X(B);return K},H=(B)=>{return W=B,Z=window.setTimeout(()=>{_(Date.now())},$),z?X(B):K};return function(...B){let k=Date.now(),M=U(k);if(q=B,j=this,G=k,M){if(Z===null)return H(k);if(Y!==void 0)Z=window.setTimeout(()=>{let V=Date.now();if(U(V))return _(V)},Math.min($,Y-(k-W)))}if(Z===null)Z=window.setTimeout(()=>{_(Date.now())},$);return K}},L$=(J)=>{let $=!1,Q;return function(...Z){if(!$)$=!0,Q=J.apply(this,Z);return Q}};var p8=(J={})=>($)=>{let Q={},Z=(K,G,W,z={})=>{if(Q[K])q(K);let Y=$7(G,W,z);return $.element.addEventListener(K,Y),Q[K]={original:G,throttled:Y},j},q=(K)=>{let G=Q[K];if(G)$.element.removeEventListener(K,G.throttled),delete Q[K];return j};if(M6($)){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Object.keys(Q).forEach((G)=>{let W=Q[G];$.element.removeEventListener(G,W.throttled)}),K.call($.lifecycle)}}if(J.throttledEvents)Object.entries(J.throttledEvents).forEach(([K,G])=>{Z(K,G.handler,G.wait,G.options)});let j={...$,addThrottledEvent:Z,removeThrottledEvent:q};return j};var S4=()=>{};function Kq(J){return"lifecycle"in J&&J.lifecycle&&typeof J.lifecycle==="object"&&"destroy"in J.lifecycle&&typeof J.lifecycle.destroy==="function"}var s8=(J={})=>($)=>{let Q={},Z=(K,G,W,z={})=>{if(Q[K])q(K);let Y=J7(G,W,z);return $.element.addEventListener(K,Y),Q[K]={original:G,debounced:Y},j},q=(K)=>{let G=Q[K];if(G)$.element.removeEventListener(K,G.debounced),delete Q[K];return j};if(Kq($)){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Object.keys(Q).forEach((G)=>{let W=Q[G];$.element.removeEventListener(G,W.debounced)}),K.call($.lifecycle)}}if(J.debouncedEvents)Object.entries(J.debouncedEvents).forEach(([K,G])=>{Z(K,G.handler,G.wait,G.options)});let j={...$,addDebouncedEvent:Z,removeDebouncedEvent:q};return j};var b4=()=>{};var m8=()=>{};function v4(J,$,Q,Z){return Math.sqrt(Math.pow(Q-J,2)+Math.pow(Z-$,2))}function C4(J,$,Q,Z){let q=Math.atan2(Z-$,Q-J)*180/Math.PI;return q<0?q+360:q}function E6(J,$,Q){let Z=Date.now(),q=!1,j={type:J,originalEvent:$,target:Q.target||$.target,startTime:Q.startTime,endTime:Z,duration:Z-Q.startTime,defaultPrevented:q,preventDefault:()=>{if(q=!0,j.defaultPrevented=!0,$.cancelable)$.preventDefault()},stopPropagation:()=>{$.stopPropagation()}};return j}function E4(){return"ontouchstart"in window||navigator.maxTouchPoints&&navigator.maxTouchPoints>0}function h4(){return!!window.PointerEvent}function a8(J){if("touches"in J&&J.touches.length>0)return{clientX:J.touches[0].clientX,clientY:J.touches[0].clientY};return{clientX:J.clientX,clientY:J.clientY}}function c8(J){let{state:$,options:Q,originalEvent:Z}=J,q=$.currentX-$.startX,j=$.currentY-$.startY;if(Math.sqrt(q*q+j*j)<Q.tapDistanceThreshold){let z=Date.now()-$.lastTapTime<300?$.tapCount+1:1;return{...E6("tap",Z,$),type:"tap",count:z,x:$.currentX,y:$.currentY}}return null}var i8=()=>{};function Gq(J,$){if(Math.abs(J)>Math.abs($))return J>0?"right":"left";return $>0?"down":"up"}function t8(J){let{state:$,options:Q,originalEvent:Z}=J,q=$.currentX-$.startX,j=$.currentY-$.startY,K=Math.sqrt(q*q+j*j),W=Date.now()-$.startTime,z=K/W;if(K>=Q.swipeThreshold&&W<=Q.swipeTimeThreshold){let Y=Gq(q,j);return{...E6("swipe",Z,$),type:"swipe",direction:Y,deltaX:q,deltaY:j,distance:K,velocity:z,startX:$.startX,startY:$.startY,endX:$.currentX,endY:$.currentY}}return null}var n8=T(()=>{m8()});function e8(J,$){let{state:Q,options:Z,originalEvent:q}=J,j=window.setTimeout(()=>{if(Q.active){let K=Math.abs(Q.currentX-Q.startX),G=Math.abs(Q.currentY-Q.startY);if(K<Z.tapDistanceThreshold&&G<Z.tapDistanceThreshold){let W={...E6("longpress",q,Q),type:"longpress",x:Q.currentX,y:Q.currentY};$(W)}}},Z.longPressTime);return()=>{clearTimeout(j)}}function u4(J){let{state:$,options:Q}=J,Z=Math.abs($.currentX-$.startX),q=Math.abs($.currentY-$.startY);return Z>Q.tapDistanceThreshold||q>Q.tapDistanceThreshold}var $1=()=>{};function J1(J){let{state:$,originalEvent:Q}=J,Z=$.currentX-$.startX,q=$.currentY-$.startY,j=$.currentX-$.lastX,K=$.currentY-$.lastY;if(Math.sqrt(j*j+K*K)>0)return{...E6("pan",Q,$),type:"pan",deltaX:Z,deltaY:q,startX:$.startX,startY:$.startY,currentX:$.currentX,currentY:$.currentY};return null}var Q1=()=>{};function Z1(J,$,Q){let{state:Z,originalEvent:q}=J,j=v4($.clientX,$.clientY,Q.clientX,Q.clientY),K=10;if(Math.abs(j-Z.startDistance)>10){let G=j/Z.startDistance,W=($.clientX+Q.clientX)/2,z=($.clientY+Q.clientY)/2;return{...E6("pinch",q,Z),type:"pinch",scale:G,centerX:W,centerY:z}}return null}var q1=()=>{};function j1(J,$,Q){let{state:Z,originalEvent:q}=J,j=C4($.clientX,$.clientY,Q.clientX,Q.clientY),K=10,G=j-Z.startAngle;if(Math.abs(G)>10){let W=($.clientX+Q.clientX)/2,z=($.clientY+Q.clientY)/2;return{...E6("rotate",q,Z),type:"rotate",rotation:G,centerX:W,centerY:z}}return null}var K1=()=>{};var x7=(J,$={})=>{let Q={swipeThreshold:30,swipeTimeThreshold:300,longPressTime:500,tapDistanceThreshold:10,preventDefault:!0,stopPropagation:!1,...$},Z=new Map,q={active:!1,startTime:0,startX:0,startY:0,lastX:0,lastY:0,currentX:0,currentY:0,touchCount:0,longPressTimer:null,startDistance:0,startAngle:0,lastTapTime:0,tapCount:0,target:null},j=E4(),K=h4(),G={tap:!0,swipe:!0,swipeleft:!0,swiperight:!0,swipeup:!0,swipedown:!0,longpress:!0,pan:!0,pinch:j||K,rotate:j||K},W=(M)=>{let V=Z.get(M.type);if(!V)return;if(V.forEach((F)=>{try{F(M)}catch(N){console.error(`Error in gesture handler for ${M.type}:`,N)}}),M.type==="swipe"&&"direction"in M){let F={...M,type:`swipe${M.direction}`};W(F)}if(Q.preventDefault&&!M.defaultPrevented)M.preventDefault();if(Q.stopPropagation)M.stopPropagation()},z=null,Y=(M)=>{let V=a8(M),F="touches"in M?M.touches.length:1;if(q.active=!0,q.startTime=Date.now(),q.startX=q.lastX=q.currentX=V.clientX,q.startY=q.lastY=q.currentY=V.clientY,q.touchCount=F,q.target=M.target,F===2&&"touches"in M){let O=M.touches[0],P=M.touches[1];if(q.startDistance=Math.sqrt(Math.pow(P.clientX-O.clientX,2)+Math.pow(P.clientY-O.clientY,2)),q.startAngle=Math.atan2(P.clientY-O.clientY,P.clientX-O.clientX)*180/Math.PI,q.startAngle<0)q.startAngle+=360}let N={state:q,options:Q,originalEvent:M};if(z)z();z=e8(N,(O)=>{W(O)})},U=(M)=>{if(!q.active)return;let V=a8(M),F="touches"in M?M.touches.length:1;q.lastX=q.currentX,q.lastY=q.currentY,q.currentX=V.clientX,q.currentY=V.clientY;let N={state:q,options:Q,originalEvent:M};if(u4(N)&&z)z(),z=null;let O=J1(N);if(O)W(O);if(F===2&&"touches"in M){let P=M.touches[0],L=M.touches[1],D=Z1(N,P,L);if(D)W(D);let R=j1(N,P,L);if(R)W(R)}},X=(M)=>{if(!q.active)return;if(z)z(),z=null;let V={state:q,options:Q,originalEvent:M},F=c8(V);if(F)q.lastTapTime=Date.now(),q.tapCount=F.count,W(F);else{let N=t8(V);if(N)W(N)}q.active=!1},_=()=>{if(z)z(),z=null;q.active=!1},H={},B=()=>{if(K)H={pointerdown:Y,pointermove:U,pointerup:X,pointercancel:_};else if(j)H={touchstart:Y,touchmove:U,touchend:X,touchcancel:_};else H={mousedown:Y,mousemove:U,mouseup:X,mouseleave:_};Object.entries(H).forEach(([M,V])=>{J.addEventListener(M,V,{passive:!Q.preventDefault})})},k=()=>{Object.entries(H).forEach(([M,V])=>{J.removeEventListener(M,V)}),H={}};return B(),{on(M,V){if(!Z.has(M))Z.set(M,new Set);return Z.get(M).add(V),this},off(M,V){let F=Z.get(M);if(F){if(F.delete(V),F.size===0)Z.delete(M)}return this},isSupported(M){return M in G&&G[M]},enable(){return B(),this},disable(){return k(),this},destroy(){if(k(),z)z(),z=null;Z.clear()}}};var f4=T(()=>{m8();i8();n8();$1();Q1();q1();K1()});var D$=T(()=>{f4();i8();n8();$1();q1();K1();Q1()});var G1=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add gesture recognition: missing element"),$;let{enableGestures:Q=!0,gestureHandlers:Z={},...q}=J,j=x7($.element,q);if(Object.entries(Z).forEach(([K,G])=>{j.on(K,G)}),!Q)j.disable();if(k6($)){let K=(G)=>{$.emit(G.type,G)};["tap","swipe","swipeleft","swiperight","swipeup","swipedown","longpress","pinch","rotate","pan"].forEach((G)=>{j.on(G,K)})}if(M6($)){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{j.destroy(),K.call($.lifecycle)}}return{...$,gestures:j,onGesture(K,G){return j.on(K,G),this},offGesture(K,G){return j.off(K,G),this},isGestureSupported(K){return j.isSupported(K)},enableGestures(){return j.enable(),this},disableGestures(){return j.disable(),this}}};var g4=T(()=>{D$()});function z1(J){return"input"in J&&J.input instanceof HTMLElement&&"disabled"in J.input}var G6=(J)=>($)=>{let Q=`${$.getClass(J.componentName||$.componentName||"component")}--disabled`,Z={enable(){if($.element.classList.remove(Q),z1($))$.input.disabled=!1,$.input.removeAttribute("disabled");else{let q=$.element;if("disabled"in q)q.disabled=!1;$.element.removeAttribute("disabled")}return this},disable(){if($.element.classList.add(Q),z1($))$.input.disabled=!0,$.input.setAttribute("disabled","true");else{let q=$.element;if("disabled"in q)q.disabled=!0;$.element.setAttribute("disabled","true")}return this},toggle(){if(this.isDisabled())this.enable();else this.disable();return this},isDisabled(){if(z1($))return $.input.disabled;let q=$.element;return"disabled"in q&&q.disabled}};if(J.disabled)requestAnimationFrame(()=>{Z.disable()});return{...$,disabled:Z}};function Wq(J){return"events"in J&&J.events&&typeof J.events==="object"&&"destroy"in J.events&&typeof J.events.destroy==="function"}function Yq(J){return"text"in J&&J.text&&typeof J.text==="object"&&"getElement"in J.text&&typeof J.text.getElement==="function"}function Uq(J){return"icon"in J&&J.icon&&typeof J.icon==="object"&&"getElement"in J.icon&&typeof J.icon.getElement==="function"}var C=()=>(J)=>{let $=!1,Q=C6();return{...J,lifecycle:{onMount:(q)=>Q.on("mount",q),onUnmount:(q)=>Q.on("unmount",q),mount:()=>{if(!$)$=!0,Q.emit("mount")},unmount:()=>{if($)$=!1,Q.emit("unmount"),Q.clear()},isMounted:()=>$,destroy(){if($)this.unmount();if(Wq(J))J.events.destroy();if(Yq(J)){let q=J.text.getElement();if(q)q.remove()}if(Uq(J)){let q=J.icon.getElement();if(q)q.remove()}if(J.element)J.element.remove()}}}};var d4=()=>{};var o=T(()=>{D4();P4();w4();y4();T4();I4();S4();b4();g4();d4()});var l4=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add tap gesture recognition: missing element"),$;let{tapDistanceThreshold:Q=10,preventDefault:Z=!0,onTap:q,enabled:j=!0}=J,K=new Set;if(q)K.add(q);let G=0,W=0,z=!1,Y=0,U=0,X=0,_=j,H=(O,P,L)=>{let D=Date.now();if(D-U<300)X++;else X=1;U=D;let w={type:"tap",originalEvent:O,target:O.target,startTime:Y,endTime:D,duration:D-Y,defaultPrevented:!1,preventDefault:()=>{if(w.defaultPrevented=!0,O.cancelable)O.preventDefault()},stopPropagation:()=>{O.stopPropagation()},count:X,x:P,y:L};if(K.forEach((A)=>{try{A(w)}catch(x){console.error("Error in tap handler:",x)}}),k6($))$.emit("tap",w);if(Z&&!w.defaultPrevented)w.preventDefault()},B=(O)=>{if(!_)return;let P="touches"in O?O.touches[0]:O;G=P.clientX,W=P.clientY,Y=Date.now(),z=!0},k=(O)=>{if(!z||!_)return;let P="changedTouches"in O&&O.changedTouches.length>0?O.changedTouches[0]:O,L=P.clientX,D=P.clientY,R=L-G,w=D-W;if(Math.sqrt(R*R+w*w)<Q)H(O,L,D);z=!1},M=()=>{z=!1},V={mousedown:B,mouseup:k,mouseleave:M,touchstart:B,touchend:k,touchcancel:M},F=()=>{Object.entries(V).forEach(([O,P])=>{$.element.addEventListener(O,P,{passive:!Z})})},N=()=>{Object.entries(V).forEach(([O,P])=>{$.element.removeEventListener(O,P)})};if(_)F();if(M6($)){let O=$.lifecycle.destroy;$.lifecycle.destroy=()=>{N(),K.clear(),O.call($.lifecycle)}}return{...$,onTap(O){return K.add(O),this},offTap(O){return K.delete(O),this},enableTap(){if(!_)_=!0,F();return this},disableTap(){if(_)_=!1,N();return this}}};var r4=()=>{};function Xq(J,$){if(Math.abs(J)>Math.abs($))return J>0?"right":"left";return $>0?"down":"up"}var p4=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add swipe gesture recognition: missing element"),$;let{swipeThreshold:Q=30,swipeTimeThreshold:Z=300,preventDefault:q=!0,onSwipe:j,onSwipeLeft:K,onSwipeRight:G,onSwipeUp:W,onSwipeDown:z,enabled:Y=!0}=J,U={swipe:new Set,swipeleft:new Set,swiperight:new Set,swipeup:new Set,swipedown:new Set};if(j)U.swipe.add(j);if(K)U.swipeleft.add(K);if(G)U.swiperight.add(G);if(W)U.swipeup.add(W);if(z)U.swipedown.add(z);let X=0,_=0,H=!1,B=0,k=Y,M=(D,R,w)=>{let A=R-X,x=w-_,I=Math.sqrt(A*A+x*x),r=Date.now(),a=r-B,V6=I/a,i=Xq(A,x),y={type:"swipe",originalEvent:D,target:D.target,startTime:B,endTime:r,duration:a,defaultPrevented:!1,preventDefault:()=>{if(y.defaultPrevented=!0,D.cancelable)D.preventDefault()},stopPropagation:()=>{D.stopPropagation()},direction:i,deltaX:A,deltaY:x,distance:I,velocity:V6,startX:X,startY:_,endX:R,endY:w};U.swipe.forEach((m)=>{try{m(y)}catch(s){console.error("Error in swipe handler:",s)}});let l=`swipe${i}`;if(U[l].forEach((m)=>{try{m({...y,type:l})}catch(s){console.error(`Error in ${l} handler:`,s)}}),k6($))$.emit("swipe",y),$.emit(l,y);if(q&&!y.defaultPrevented)y.preventDefault()},V=(D)=>{if(!k)return;let R="touches"in D?D.touches[0]:D;X=R.clientX,_=R.clientY,B=Date.now(),H=!0},F=(D)=>{if(!H||!k)return;let R="changedTouches"in D&&D.changedTouches.length>0?D.changedTouches[0]:D,w=R.clientX,A=R.clientY,x=w-X,I=A-_,r=Math.sqrt(x*x+I*I),a=Date.now()-B;if(r>=Q&&a<=Z)M(D,w,A);H=!1},N=()=>{H=!1},O={mousedown:V,mouseup:F,mouseleave:N,touchstart:V,touchend:F,touchcancel:N},P=()=>{Object.entries(O).forEach(([D,R])=>{$.element.addEventListener(D,R,{passive:!q})})},L=()=>{Object.entries(O).forEach(([D,R])=>{$.element.removeEventListener(D,R)})};if(k)P();if(M6($)){let D=$.lifecycle.destroy;$.lifecycle.destroy=()=>{L(),Object.values(U).forEach((R)=>R.clear()),D.call($.lifecycle)}}return{...$,onSwipe(D){return U.swipe.add(D),this},onSwipeLeft(D){return U.swipeleft.add(D),this},onSwipeRight(D){return U.swiperight.add(D),this},onSwipeUp(D){return U.swipeup.add(D),this},onSwipeDown(D){return U.swipedown.add(D),this},offSwipe(D){return U.swipe.delete(D),this},offSwipeLeft(D){return U.swipeleft.delete(D),this},offSwipeRight(D){return U.swiperight.delete(D),this},offSwipeUp(D){return U.swipeup.delete(D),this},offSwipeDown(D){return U.swipedown.delete(D),this},enableSwipe(){if(!k)k=!0,P();return this},disableSwipe(){if(k)k=!1,L();return this}}};var s4=T(()=>{D$()});var m4=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add long press gesture recognition: missing element"),$;let{longPressTime:Q=500,moveThreshold:Z=10,preventDefault:q=!0,onLongPress:j,enabled:K=!0}=J,G=new Set;if(j)G.add(j);let W=0,z=0,Y=0,U=0,X=!1,_=0,H=null,B=K,k=(D)=>{let R={type:"longpress",originalEvent:D,target:D.target,startTime:_,endTime:Date.now(),duration:Date.now()-_,defaultPrevented:!1,preventDefault:()=>{if(R.defaultPrevented=!0,D.cancelable)D.preventDefault()},stopPropagation:()=>{D.stopPropagation()},x:Y,y:U};if(G.forEach((w)=>{try{w(R)}catch(A){console.error("Error in long press handler:",A)}}),k6($))$.emit("longpress",R);if(q&&!R.defaultPrevented)R.preventDefault()},M=(D)=>{if(!B)return;let R="touches"in D?D.touches[0]:D;if(W=Y=R.clientX,z=U=R.clientY,_=Date.now(),X=!0,H!==null)window.clearTimeout(H);H=window.setTimeout(()=>{if(X){let w=Y-W,A=U-z;if(Math.sqrt(w*w+A*A)<Z)k(D)}H=null},Q)},V=(D)=>{if(!X||!B)return;let R="touches"in D?D.touches[0]:D;Y=R.clientX,U=R.clientY;let w=Y-W,A=U-z;if(Math.sqrt(w*w+A*A)>Z){if(H!==null)window.clearTimeout(H),H=null}},F=()=>{if(H!==null)window.clearTimeout(H),H=null;X=!1},N=()=>{if(H!==null)window.clearTimeout(H),H=null;X=!1},O={mousedown:M,mousemove:V,mouseup:F,mouseleave:N,touchstart:M,touchmove:V,touchend:F,touchcancel:N},P=()=>{Object.entries(O).forEach(([D,R])=>{$.element.addEventListener(D,R,{passive:!q})})},L=()=>{Object.entries(O).forEach(([D,R])=>{$.element.removeEventListener(D,R)})};if(B)P();if(M6($)){let D=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(L(),H!==null)window.clearTimeout(H),H=null;G.clear(),D.call($.lifecycle)}}return{...$,onLongPress(D){return G.add(D),this},offLongPress(D){return G.delete(D),this},enableLongPress(){if(!B)B=!0,P();return this},disableLongPress(){if(B){if(B=!1,L(),H!==null)window.clearTimeout(H),H=null}return this}}};var a4=()=>{};var c4=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add pan gesture recognition: missing element"),$;let{preventDefault:Q=!0,onPanStart:Z,onPan:q,onPanEnd:j,enabled:K=!0}=J,G={panstart:new Set,pan:new Set,panend:new Set};if(Z)G.panstart.add(Z);if(q)G.pan.add(q);if(j)G.panend.add(j);let W=0,z=0,Y=0,U=0,X=0,_=0,H=!1,B=!1,k=0,M=K,V=(A,x)=>{let I={type:x,originalEvent:A,target:A.target,startTime:k,endTime:Date.now(),duration:Date.now()-k,defaultPrevented:!1,preventDefault:()=>{if(I.defaultPrevented=!0,A.cancelable)A.preventDefault()},stopPropagation:()=>{A.stopPropagation()},deltaX:X-W,deltaY:_-z,startX:W,startY:z,currentX:X,currentY:_};return I},F=(A,x)=>{let I=V(A,x);if(G[x].forEach((r)=>{try{r(I)}catch(a){console.error(`Error in ${x} handler:`,a)}}),k6($))$.emit(x,I);if(Q&&!I.defaultPrevented)I.preventDefault()},N=(A)=>{if(!M)return;let x="touches"in A?A.touches[0]:A;W=Y=X=x.clientX,z=U=_=x.clientY,k=Date.now(),H=!0,B=!1},O=(A)=>{if(!H||!M)return;let x="touches"in A?A.touches[0]:A;Y=X,U=_,X=x.clientX,_=x.clientY;let I=X-Y,r=_-U;if(Math.sqrt(I*I+r*r)>0){if(!B)B=!0,F(A,"panstart");F(A,"pan")}},P=(A)=>{if(!H||!M)return;if(B)F(A,"panend");H=!1,B=!1},L=(A)=>{if(!H||!M)return;if(B)F(A,"panend");H=!1,B=!1},D={mousedown:N,mousemove:O,mouseup:P,mouseleave:L,touchstart:N,touchmove:O,touchend:P,touchcancel:L},R=()=>{Object.entries(D).forEach(([A,x])=>{$.element.addEventListener(A,x,{passive:!Q})})},w=()=>{Object.entries(D).forEach(([A,x])=>{$.element.removeEventListener(A,x)})};if(M)R();if(M6($)){let A=$.lifecycle.destroy;$.lifecycle.destroy=()=>{w(),Object.values(G).forEach((x)=>x.clear()),A.call($.lifecycle)}}return{...$,onPanStart(A){return G.panstart.add(A),this},onPan(A){return G.pan.add(A),this},onPanEnd(A){return G.panend.add(A),this},offPanStart(A){return G.panstart.delete(A),this},offPan(A){return G.pan.delete(A),this},offPanEnd(A){return G.panend.delete(A),this},enablePan(){if(!M)M=!0,R();return this},disablePan(){if(M)M=!1,w();return this}}};var i4=()=>{};var J6=T(()=>{c();o();r4();s4();a4();i4()});function W1(J,$){y7[J]=$}function T7(J){return y7[J]||{}}function Y1(J){Object.assign(y7,J)}function U1(){Object.keys(y7).forEach((J)=>{delete y7[J]})}var y7;var X1=T(()=>{y7={}});var d=(J,$={},Q)=>{let Z=T7(Q),q=$.className!==void 0?$.className:$.class,j=J.className!==void 0?J.className:J.class,K={...J,...Z,...$,componentName:Q,prefix:u,className:q!==void 0?q:j};if("class"in K&&K.className!==void 0)delete K.class;return K},p=(J,$)=>{let Q=J.className||J.class,Z=$.className,q=[...Array.isArray(Q)?Q:[Q],...Array.isArray(Z)?Z:[Z]].filter(Boolean),j=$.attributes||{};return{tag:$.tag,componentName:J.componentName,attributes:j,className:q.length>0?q:void 0,rawClass:J.rawClass,html:$.html,text:$.text,forwardEvents:$.forwardEvents||{},interactive:$.interactive}};var t=T(()=>{y6();X1()});var I7,S7,b7,b9=4;var B1=T(()=>{I7={SMALL:"small",LARGE:"large"},S7={ERROR:"error",PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",SUCCESS:"success",WARNING:"warning",INFO:"info"},b7={TOP_RIGHT:"top-right",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left"}});var Bq,o4=(J={})=>d(Bq,J,"badge"),t4=(J)=>{let $={};if(J.variant!=="small")$.role="status";let Q=J.variant==="small"?"":Q7(J.label||"",J.max);return p(J,{tag:"span",attributes:$,className:J.class,text:Q})},n4=(J)=>({visibility:{show:()=>J.visibility.show(),hide:()=>J.visibility.hide(),toggle:($)=>J.visibility.toggle($),isVisible:()=>J.visibility.isVisible()},lifecycle:{destroy:()=>J.lifecycle.destroy()}}),Q7=(J,$)=>{if(J===void 0||J===null||J==="")return"";let Q=String(J),Z=Number(J);if($!==void 0&&!isNaN(Z)&&Z>$)Q=`${$}+`;if(Q.length>b9){let q=Number(J);if(!isNaN(q))if(q>=1000)Q="999+";else Q=Q.substring(0,b9-1)+"+";else Q=Q.substring(0,b9)}return Q};var O$=T(()=>{t();B1();Bq={variant:I7.LARGE,color:S7.ERROR,position:b7.TOP_RIGHT,label:"",visible:!0}});var e4="small",Fq="large",Hq="error",Mq="top-right",$5=()=>(J)=>{if(J.config.visible===!1)J.element.classList.add(`${J.getClass("badge")}--invisible`);return{...J,visibility:{show(){J.element.classList.remove(`${J.getClass("badge")}--invisible`)},hide(){J.element.classList.add(`${J.getClass("badge")}--invisible`)},toggle(Q){if(Q===void 0)J.element.classList.toggle(`${J.getClass("badge")}--invisible`);else if(Q)this.show();else this.hide()},isVisible(){return!J.element.classList.contains(`${J.getClass("badge")}--invisible`)}}}},J5=(J)=>($)=>{let Q=J.variant||Fq;if($.element.classList.add(`${$.getClass("badge")}--${Q}`),Q===e4)$.element.textContent="",$.element.setAttribute("aria-hidden","true");else if($.element.setAttribute("role","status"),J.label!==void 0&&J.label!==""){let Z=Q7(J.label,J.max);$.element.textContent=Z}return $},Q5=(J)=>($)=>{let Q=J.color||Hq;return $.element.classList.add(`${$.getClass("badge")}--${Q}`),$},Z5=(J)=>($)=>{let Q=J.position||Mq;if($.element.classList.add(`${$.getClass("badge")}--${Q}`),J.target)$.element.classList.add(`${$.getClass("badge")}--positioned`);return $},q5=(J)=>($)=>{if(J.max===void 0||J.variant===e4)return $;if($.config.max=J.max,J.label!==void 0&&J.label!==""){let Q=Q7(J.label,J.max);if($.element.textContent=Q,typeof J.label==="number"&&J.label>J.max)$.element.classList.add(`${$.getClass("badge")}--overflow`)}return $},j5=(J)=>($)=>{if(!J.target)return $;let Q=document.createElement("div");Q.classList.add($.getClass("badge-wrapper")),Q.style.position="relative";let Z=J.target.parentNode;if(Z)Z.replaceChild(Q,J.target),Q.appendChild(J.target),Q.appendChild($.element),$.wrapper=Q;return $};var K5=T(()=>{O$()});var G5="small",kq,Nq,Vq,z5=({visibility:J,lifecycle:$})=>(Q)=>{let Z={element:Q.element,wrapper:Q.wrapper,getClass:Q.getClass,setLabel(q){if(Q.config.label=q,Q.config.variant===G5)return Q.element.textContent="",Z;let j=Q7(q,Q.config.max);if(Q.element.textContent=j,Q.element.classList.remove(`${Q.getClass("badge")}--overflow`),typeof q==="number"&&Q.config.max!==void 0&&q>Q.config.max)Q.element.classList.add(`${Q.getClass("badge")}--overflow`);if(j===""||j==="0")Z.hide();else Z.show();return Z},getLabel(){return Q.element.textContent||""},setContent(q){return Z.setLabel(q)},getContent(){return Z.getLabel()},show(){return J.show(),Z},hide(){return J.hide(),Z},toggle(q){return J.toggle(q),Z},isVisible(){return J.isVisible()},setMax(q){if(Q.config.max=q,Q.config.label!==void 0)Z.setLabel(Q.config.label);return Z},setColor(q){return kq.forEach((j)=>{Q.element.classList.remove(`${Q.getClass("badge")}--${j}`)}),Q.element.classList.add(`${Q.getClass("badge")}--${q}`),Z},setVariant(q){if(Nq.forEach((j)=>{Q.element.classList.remove(`${Q.getClass("badge")}--${j}`)}),Q.element.classList.add(`${Q.getClass("badge")}--${q}`),Q.config.variant=q,q===G5)Q.element.textContent="",Q.element.setAttribute("aria-hidden","true");else if(Q.element.setAttribute("role","status"),Q.config.label!==void 0)Z.setLabel(Q.config.label);return Z},setPosition(q){return Vq.forEach((j)=>{Q.element.classList.remove(`${Q.getClass("badge")}--${j}`)}),Q.element.classList.add(`${Q.getClass("badge")}--${q}`),Z},attachTo(q){if(Q.wrapper&&Q.wrapper.contains(Q.element))Q.wrapper.removeChild(Q.element);let j=document.createElement("div");j.classList.add(Q.getClass("badge-wrapper")),j.style.position="relative";let K=q.parentNode;if(K)K.replaceChild(j,q),j.appendChild(q),j.appendChild(Q.element),Q.element.classList.add(`${Q.getClass("badge")}--positioned`),Q.wrapper=j,Z.wrapper=j;return Z},detach(){if(Q.wrapper&&Q.wrapper.contains(Q.element))Q.wrapper.removeChild(Q.element),Q.element.classList.remove(`${Q.getClass("badge")}--positioned`),document.body.appendChild(Q.element),Q.wrapper=void 0,Z.wrapper=void 0;return Z},destroy(){if($.destroy(),Q.wrapper){let q=Q.wrapper.firstChild,j=Q.wrapper.parentNode;if(j&&q)j.replaceChild(q,Q.wrapper)}},addClass:(...q)=>{return Q.addClass(...q),Z},removeClass:(...q)=>{return Q.removeClass(...q),Z},on:(q,j)=>{return Q.on(q,j),Z},off:(q,j)=>{return Q.off(q,j),Z}};return Z};var W5=T(()=>{O$();kq=["error","primary","secondary","tertiary","success","warning","info"],Nq=["small","large"],Vq=["top-right","top-left","bottom-right","bottom-left"]});var _q=(J={})=>{let $=o4(J);try{return b(S,g(),E(t4($)),J5($),Q5($),Z5($),q5($),$5(),j5($),C(),(Z)=>z5(n4(Z))(Z))($)}catch(Q){throw console.error("Badge creation error:",Q),new Error(`Failed to create badge: ${Q.message}`)}},e9;var Y5=T(()=>{J6();c();o();K5();W5();O$();e9=_q});var w7=T(()=>{Y5()});var F5=(J)=>{let $=new Map,Q=(j,K)=>`${j}_${K.toString()}`,Z=(j,K)=>(G)=>{try{j(G)}catch(W){console.error(`Error in ${K} handler:`,W)}},q=(j,K)=>{try{J.removeEventListener(j,K)}catch(G){console.warn(`Failed to remove ${j} listener:`,G)}};return{on(j,K,G={}){let W=Z(K,j),z=Q(j,K);return $.set(z,{original:K,enhanced:W,event:j,options:G}),J.addEventListener(j,W,G),this},off(j,K){let G=Q(j,K),W=$.get(G);if(W)q(j,W.enhanced),$.delete(G);return this},pause(){return $.forEach(({enhanced:j,event:K})=>{q(K,j)}),this},resume(){return $.forEach(({enhanced:j,event:K,options:G})=>{J.addEventListener(K,j,G)}),this},destroy(){$.forEach(({enhanced:j,event:K})=>{q(K,j)}),$.clear()},getHandlers(){return new Map($)},hasHandler(j,K){let G=Q(j,K);return $.has(G)}}};var v9=T(()=>{A6();T9()});var W9,I6,Z7,h6,z6,s6,u6,W6;var t6=T(()=>{W9={LINEAR:"linear",CIRCULAR:"circular"},I6={FLAT:"flat",WAVY:"wavy"},Z7={CHANGE:"change",COMPLETE:"complete"},h6={VARIANT:"linear",VALUE:0,MAX:100,BUFFER:0,SHAPE:"flat",SHOW_LABEL:!1,INDETERMINATE:!1},z6={CONTAINER:"progress",LINEAR:"progress--linear",CIRCULAR:"progress--circular",TRACK:"progress__track",INDICATOR:"progress__indicator",BUFFER:"progress__buffer",LABEL:"progress__label",INDETERMINATE:"progress--indeterminate",DISABLED:"progress--disabled",TEST:"progress--test",TRANSITION:"progress--transition"},s6={LINEAR:{MIN_HEIGHT:4,GAP:4,STOP_INDICATOR:4,HEIGHT:4},CIRCULAR:{SIZE:48,GAP:8},COMMON:{STROKE_WIDTH:4}},u6={THIN:4,THICK:8},W6={LINEAR:{AMPLITUDE:3,SPEED:0.88,FREQUENCY:2,INDETERMINATE_FREQUENCY:4,INDETERMINATE_AMPLITUDE:2,POWER:0.8,START_TRANSITION_END:0,END_TRANSITION_START:0.92},CIRCULAR:{AMPLITUDE:6,INDETERMINATE_AMPLITUDE:4,SPEED:1.1,FREQUENCY:10,INDETERMINATE_FREQUENCY:16,POWER:0.8,START_TRANSITION_END:0,END_TRANSITION_START:0.92}}});var m6=(J)=>{return Boolean(J&&typeof J==="object"&&Object.getPrototypeOf(J)===Object.getPrototypeOf({}))},M1=(J,$)=>{let q=$.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split("."),j=J;for(let K=0,G=q.length;K<G;++K){let W=q[K];if(W in j)j=j[W];else return}return j};var _9=(J,$=17)=>{if(!J||!(J instanceof HTMLElement))return{color:"",element:null};let Q=0,Z=J;while(Z&&Q<$){let K=window.getComputedStyle(Z).backgroundColor;if(K.startsWith("var(")){let G=K.match(/var\((--[\w-]+)\)/);if(G){let W=G[1];K=window.getComputedStyle(document.documentElement).getPropertyValue(W).trim()||"transparent"}}if(K&&K!=="transparent"&&K!=="rgba(0, 0, 0, 0)"&&K!=="rgba(0,0,0,0)")return{color:K,element:Z};Z=Z.parentElement,Q++}let q=window.getComputedStyle(document.body).backgroundColor;if(q!=="transparent"&&q!=="rgba(0, 0, 0, 0)")return{color:q,element:document.body};return{color:"rgb(255, 255, 255)",element:null}};var k1=()=>{};function B6(J,$){let Q=`--${u}-${J}`;if($?.onThemeChange)Oq($.onThemeChange);let q=getComputedStyle(document.body).getPropertyValue(Q).trim();if(!q)q=getComputedStyle(document.documentElement).getPropertyValue(Q).trim();if(!q&&$?.fallback)return $.fallback;if(!q)return"";if(typeof $?.alpha==="number"&&/\d+,\s*\d+,\s*\d+/.test(q))return`rgba(${q}, ${$.alpha})`;if(typeof $?.alpha==="number"&&/^#([\da-f]{6}|[\da-f]{3})$/i.test(q)){let j=q.replace("#",""),K,G,W;if(j.length===3)K=parseInt(j[0]+j[0],16),G=parseInt(j[1]+j[1],16),W=parseInt(j[2]+j[2],16);else K=parseInt(j.substring(0,2),16),G=parseInt(j.substring(2,4),16),W=parseInt(j.substring(4,6),16);return`rgba(${K}, ${G}, ${W}, ${$.alpha})`}return q}var P$,C9=null,Dq=()=>{if(C9)return;C9=new MutationObserver((J)=>{for(let $ of J)if($.type==="attributes"&&($.attributeName==="data-theme"||$.attributeName==="data-theme-mode")){P$.forEach((Q)=>Q());break}}),C9.observe(document.body,{attributes:!0,attributeFilter:["data-theme","data-theme-mode"]})},Oq=(J)=>{if(!C9)Dq();return P$.add(J),()=>{P$.delete(J)}};var H5=T(()=>{y6();P$=new Set;if(typeof window!=="undefined")window.addEventListener("unload",()=>{if(C9)C9.disconnect(),C9=null;P$.clear()})});var v7=(J,$)=>{let Z=document.createElement("canvas").getContext("2d");if(!Z)return`rgba(0, 0, 0, ${$})`;Z.fillStyle=J;let q=Z.fillStyle;if(q.startsWith("#")){let j=q.substring(1),K=parseInt(j.substring(0,2),16),G=parseInt(j.substring(2,4),16),W=parseInt(j.substring(4,6),16);return`rgba(${K}, ${G}, ${W}, ${$})`}if(q.startsWith("rgb")){let j=q.match(/\d+/g);if(j){let[K,G,W]=j;return`rgba(${K}, ${G}, ${W}, ${$})`}}return`rgba(0, 0, 0, ${$})`};var M5=(J,$)=>(Q,Z)=>J(Q,Z)?$(Q,Z):Q,k5=(...J)=>J.filter(Boolean).join(" ");var Y9=T(()=>{D7();k1();H5()});var C7=(J,$,Q)=>{let Z=null,q=()=>{if(Z)clearTimeout(Z);Z=window.setTimeout(()=>{Q()},100)};if(typeof ResizeObserver!=="undefined"){let j=new ResizeObserver((K)=>{for(let G of K){let{width:W}=G.contentRect,z=parseFloat($.style.width||"0");if(Math.abs(W-z)>2)q()}});return j.observe(J),()=>{if(Z)clearTimeout(Z);j.disconnect()}}else return window.addEventListener("resize",q),()=>{if(Z)clearTimeout(Z);window.removeEventListener("resize",q)}};var N5=(J,$,Q,Z,q,j,K,G,W)=>{let z=Math.max(100,Math.abs(j-q)*50),Y=(j-q)/z,U=W6.CIRCULAR.SPEED*2*Math.PI/1000;J.beginPath();for(let X=0;X<=z;X++){let _=q+Y*X,H=_*G+W*U,B=Math.sin(H),M=Math.sign(B)*Math.pow(Math.abs(B),W6.CIRCULAR.POWER)*K,V=Z+M,F=$+V*Math.cos(_),N=Q+V*Math.sin(_);if(X===0)J.moveTo(F,N);else J.lineTo(F,N)}J.stroke()},V5=(J,$,Q,Z,q,j=0,K="flat")=>{let{ctx:G,width:W,height:z}=J,Y=E7($.thickness),U=K==="wavy",X=Math.min(W,z),_=q?W6.CIRCULAR.INDETERMINATE_AMPLITUDE:W6.CIRCULAR.AMPLITUDE,H=X/2-Y/2,B=H*(_/100),k=U?E9(Y,B):0,M=H-k,V=W/2,F=z/2;G.clearRect(0,0,W,z);let O=(s6.CIRCULAR.GAP+2*Y)/M,P=-Math.PI/2,L=2*Math.PI-O;G.lineWidth=Y,G.lineCap="round",G.lineJoin="round";let D=q?W6.CIRCULAR.INDETERMINATE_FREQUENCY:W6.CIRCULAR.FREQUENCY;if(q){let y=j%1333/1333,l=(x9)=>{let U6=x9<=0.5?x9*2:2-x9*2;return 0.028+0.722*(U6<0.5?2*U6*U6:1-Math.pow(-2*U6+2,2)/2)},m=()=>{let x9=j/1568*2*Math.PI,U6=Math.floor(j/1333),r6=j%1333/1333,q9=0;if(r6>0.5){let V7=(r6-0.5)*2;q9=0.722*(V7<0.5?2*V7*V7:1-Math.pow(-2*V7+2,2)/2)}return x9+(U6*0.722+q9)*2*Math.PI},s=l(y)*2*Math.PI,M9=m(),L6=P+M9,X6=L6+s;G.strokeStyle=B6("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"}),G.beginPath();let t9=O/2;if(G.arc(V,F,M,X6+t9,L6-t9+2*Math.PI),G.stroke(),G.strokeStyle=B6("sys-color-primary",{fallback:"#6750A4"}),U)N5(G,V,F,M,L6,X6,k,D,j);else G.beginPath(),G.arc(V,F,M,L6,X6),G.stroke();return}let R=Q/Z,A=Math.max(R,0.001),x=0.95,I=L;if(R>=x){let i=(R-x)/(1-x),y=i*i;I=L+O*y}if(R<0.99){let y=P+I*A+O/2,l=P+L+O/2;if(y<l)G.strokeStyle=B6("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"}),G.beginPath(),G.arc(V,F,M,y,l),G.stroke()}G.strokeStyle=B6("sys-color-primary",{fallback:"#6750A4"});let r=k;if(U){let i=W6.CIRCULAR.START_TRANSITION_END,y=W6.CIRCULAR.END_TRANSITION_START;if(R===0&&i>0)r=0;else if(R>0&&R<=i){let l=R/i;r=k*Math.pow(l,2)}else if(R>=y){let l=(R-y)/(1-y),m=1-Math.pow(1-l,2);r=k*(1-m)}if(R>=1)r=0}let a=P,V6=P+I*A;if(U)N5(G,V,F,M,a,V6,r,D,j);else G.beginPath(),G.arc(V,F,M,a,V6),G.stroke()};var _5=T(()=>{t6();Y9();R$()});var h7=(J,$,Q)=>{J.strokeStyle=Q,J.lineWidth=$,J.lineCap="round"},L9=(J,$,Q,Z,q,j,K)=>{if(J.beginPath(),!q||K.amplitude===0)J.moveTo($,Z),J.lineTo(Q,Z);else{let G=$;for(let W=$;W<=Q;W+=1){let z=W*K.frequency+j*K.speed,Y=Math.sin(z),U=Math.sign(Y)*Math.pow(Math.abs(Y),W6.LINEAR.POWER),X=Z+U*K.amplitude;if(W===$)J.moveTo(W,X);else J.lineTo(W,X);G=W}if(G<Q){let W=Q*K.frequency+j*K.speed,z=Math.sin(W),Y=Math.sign(z)*Math.pow(Math.abs(z),W6.LINEAR.POWER),U=Z+Y*K.amplitude;J.lineTo(Q,U)}}J.stroke()},L5=(J,$)=>{let[Q,Z,q]=$;if(J<=Q)return 0.08+0.5814790000000001*(J/Q);else if(J<=Z)return 0.661479;else if(q&&J<=q)return 0.661479;return q?0.661479-0.5814790000000001*((J-q)/(1-q)):0.08},D5=(J,$)=>{for(let q=0;q<$.length-1;q++){let[j,K]=$[q],[G,W]=$[q+1];if(J<=G){let z=(J-j)/(G-j);return K+(W-K)*z}}let[Q,Z]=$[$.length-1];return Z+(220-Z)*((J-Q)/(1-Q))},O5=(J,$,Q,Z,q,j,K=0,G=!0,W="flat")=>{let{ctx:z,width:Y,height:U}=J,X=E7($.thickness),_=U/2,H=W==="wavy",B=X/2,k=Y-B*2,M=s6.LINEAR.GAP,V=Q/Z,F=0.001,N=Math.max(V,0.001),O=B+k*N;z.clearRect(0,0,Y,U);let P=B6("sys-color-primary",{fallback:"#6750A4"}),L=B6("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"});if(j){let V6=K%2000/2000,i=M*2+X/2,y=L5(V6,[0.3665,0.6915]),l=D5(V6,[[0,-120],[0.2,0],[0.5915,83.6714]]),m=V6<=0.5?0:L5(V6,[0.8335,null,0.8335]),s=V6<=0.5?-54.8889:D5(V6,[[0.5,-54.8889],[0.7,25.0389],[0.85,83.6714]]),L6=[{scale:y,translate:l,start:Math.max(B,B+k*l/100),end:Math.min(Y-B,B+k*l/100+k*y)},{scale:m,translate:s,start:Math.max(B,B+k*s/100),end:Math.min(Y-B,B+k*s/100+k*m)}].filter((U6)=>U6.end>U6.start).sort((U6,r6)=>U6.start-r6.start),X6=[];for(let U6=0;U6<L6.length;U6++){let r6=L6[U6];if(X6.length===0)X6.push({...r6});else{let q9=X6[X6.length-1];if(r6.start<=q9.end+i)q9.end=Math.max(q9.end,r6.end);else X6.push({...r6})}}h7(z,X,L);let t9=X;if(X6.length===0)L9(z,B,Y-B,_,!1,0,{amplitude:0,frequency:0,speed:0});else{let U6=X6[0].start;if(U6-B>i+t9)L9(z,B,U6-i,_,!1,0,{amplitude:0,frequency:0,speed:0});if(X6.length===2){if(X6[1].start-X6[0].end>2*i+t9)L9(z,X6[0].end+i,X6[1].start-i,_,!1,0,{amplitude:0,frequency:0,speed:0})}let q9=X6[X6.length-1].end;if(Y-B-q9>i+t9)L9(z,q9+i,Y-B,_,!1,0,{amplitude:0,frequency:0,speed:0})}h7(z,X,P);let x9={amplitude:H?E9(X,W6.LINEAR.INDETERMINATE_AMPLITUDE):0,frequency:W6.LINEAR.INDETERMINATE_FREQUENCY*2*Math.PI/100,speed:0};X6.forEach((U6)=>{L9(z,U6.start,U6.end,_,H,K,x9)});return}let D=W6.LINEAR.START_TRANSITION_END,R=W6.LINEAR.END_TRANSITION_START,w=(M+X)/2;h7(z,X,L);let A=V===0?B+X+M:Math.min(O+w,Y-B);L9(z,A,Y-B,_,!1,0,{amplitude:0,frequency:0,speed:0}),h7(z,X,P);let x=V>=1?Y-B:Math.max(B,O-w),I;if(V===0)I=B+(H?0.1:0);else{let a=X/2;I=Math.max(B+a,x)}let r=H?E9(X,W6.LINEAR.AMPLITUDE):0;if(H){if(V===0&&D>0)r=0;else if(N<=D)r*=Math.pow(N/D,2);else if(N>=R)r*=Math.pow((1-N)/(1-R),2)}if(L9(z,B,I,_,H,K,{amplitude:r,frequency:W6.LINEAR.FREQUENCY*2*Math.PI/100,speed:W6.LINEAR.SPEED*2*Math.PI/1000}),q>0&&q>Q){h7(z,X,B6("sys-color-secondary-container",{fallback:"#E8DEF8"}));let a=B+k*(q/Z);L9(z,O,a,_,!1,0,{amplitude:0,frequency:0,speed:0})}if(V<1&&G){let a=Math.min(X*0.5,2);z.beginPath(),z.arc(Y-B,_,a,0,2*Math.PI),z.fillStyle=P,z.fill()}};var P5=T(()=>{t6();Y9();R$()});var E7=(J="thin")=>{if(typeof J==="number")return J;return J==="thick"?u6.THICK:u6.THIN},E9=(J,$,Q)=>{let q=1+0.3*(4-J)/(J+4),j=$*q;return Q?Math.min(j,Q):j},N1=(J,$,Q,Z)=>{let q=window.devicePixelRatio||1,j=E7(Z?.thickness),{ctx:K}=$;if(Q){let G=Math.max(24,Math.min(Z?.size??s6.CIRCULAR.SIZE,240)),W=0;if(Z?.shape==="wavy"){let Y=G/2-j/2,U=Z?.indeterminate?W6.CIRCULAR.INDETERMINATE_AMPLITUDE:W6.CIRCULAR.AMPLITUDE,X=Y*(U/100);W=E9(j,X)}let z=G+W*2;J.style.width=J.style.height=`${z}px`,J.width=J.height=Math.round(z*q),$.width=$.height=z}else{let G=J.parentElement;if(!G)return;let W=Math.max(G.getBoundingClientRect().width||G.offsetWidth,200),z=0;if(Z?.shape==="wavy"){let U=W6.LINEAR.AMPLITUDE,X=E9(j,U);z=Math.ceil(X*2)}let Y=j+z;J.style.width=`${W}px`,J.style.height=`${Y}px`,J.width=Math.round(W*q),J.height=Math.round(Y*q),$.width=W,$.height=Y}K.setTransform(1,0,0,1,0,0),K.scale(q,q)},R5=(J,$,Q)=>{let Z={canvas:J,ctx:J.getContext("2d"),width:0,height:0,pixelRatio:window.devicePixelRatio||1};return N1(J,Z,$,Q),Z},A5=(J)=>($)=>{let Z=J.variant===W9.CIRCULAR,q=document.createElement("canvas");q.className=`${$.getClass(z6.CONTAINER)}-canvas`,q.style.maxWidth="100%",q.style.maxHeight="100%",q.style.boxSizing="border-box",$.element.appendChild(q);let j=null,K=null,G=null,W=J.thickness,z=J.shape,Y=J.size??s6.CIRCULAR.SIZE,U=J.value??0,X=U,_=0,H=()=>{try{return j=R5(q,Z,{...J,thickness:W,shape:z,size:Y}),$.ctx=j.ctx,!0}catch(D){return console.warn("Canvas initialization failed:",D),!1}};if(!H())requestAnimationFrame(()=>{if(!H())setTimeout(H,100)});$.canvas=q,$.animationTime=0,$.animationId=null,$.wavyAnimationId=null,$.valueAnimationId=null,$.currentShape=z;let B=(D=0)=>{if(!$.state?.indeterminate)return;if($.animationId)cancelAnimationFrame($.animationId),$.animationId=null;let R=0,w=(A)=>{if(!$.state?.indeterminate){k();return}if(R===0)R=A-D;let x=A-R;$.animationTime=x,F(x),$.animationId=requestAnimationFrame(w)};$.animationId=requestAnimationFrame(w)},k=()=>{if($.animationId)cancelAnimationFrame($.animationId),$.animationId=null},M=(D=0)=>{if($.wavyAnimationId)cancelAnimationFrame($.wavyAnimationId),$.wavyAnimationId=null;let R=0,w=(A)=>{if(R===0)R=A-D;let x=A-R;$.animationTime=x,F(x),$.wavyAnimationId=requestAnimationFrame(w)};$.wavyAnimationId=requestAnimationFrame(w)},V=()=>{if($.wavyAnimationId)cancelAnimationFrame($.wavyAnimationId),$.wavyAnimationId=null},F=(D=0)=>{if(!j)return;let R=$.state,w=R?.value??J.value??0,A=R?.max??J.max??100,x=R?.buffer??J.buffer??0,I=R?.indeterminate??J.indeterminate??!1,r={...J,thickness:W,shape:z,size:Y};N1(q,j,Z,r);let a=I||!R?w:U;if(Z)V5(j,r,a,A,I,D,z);else O5(j,r,a,A,x,I,D,!0,z)},N=()=>{if(!j)return;try{let D=R5(q,Z,{...J,thickness:W,shape:z,size:Y});$.ctx=D.ctx,Object.assign(j,D),F()}catch(D){console.warn("Canvas resize failed:",D)}};K=C7($.element,q,()=>{if($.element.offsetWidth>0||Z)N()});let O=B6("sys-color-primary",{onThemeChange:F});G=typeof O==="function"?O:null;let P=()=>{if(!j){requestAnimationFrame(P);return}if(F(),$.state?.indeterminate)if(z==="wavy"||!Z)M();else B();else if(z==="wavy")M()};requestAnimationFrame(P);let L=(D)=>{if(!j)return;let R={...J,thickness:W,shape:z,size:Y,...D};N1(q,j,Z,R),F()};if($.setThickness=(D)=>{W=D,L({thickness:D})},$.setSize=(D)=>{if(!Z)return;Y=Math.max(24,Math.min(D,240)),L({size:Y})},$.getSize=()=>Z?Y:void 0,$.setShape=(D)=>{if(z===D)return;if(z=D,$.currentShape=z,L({shape:D}),$.state?.indeterminate){let R=$.animationTime||0;if(V(),k(),D==="wavy"||!Z)M(R);else B(R)}else if(D==="wavy"){if(!$.wavyAnimationId)M()}else V();F($.animationTime||0)},$.setValue=(D,R=!0)=>{if(X=Math.max(0,Math.min($.state.max,D)),$.state.indeterminate)$.setIndeterminate(!1);if($.valueAnimationId&&R)return;if($.valueAnimationId)cancelAnimationFrame($.valueAnimationId),$.valueAnimationId=null;if(!R){if(U=X,F(),z==="wavy"&&!$.state.indeterminate&&!$.wavyAnimationId)M();if(X>=$.state.max)$.element.dispatchEvent(new CustomEvent("complete",{detail:{value:X,max:$.state.max}}));return}let w=U,A=performance.now(),x=A-_,I=300;if(x<300&&_>0)I=Math.max(100,x*0.9);_=A;let r=(a)=>{let V6=a-A,i=Math.min(V6/I,1),y=i<0.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2;if(U=w+(X-w)*y,!$.wavyAnimationId||z!=="wavy")F(a);if(i<1)$.valueAnimationId=requestAnimationFrame(r);else{if(U=X,$.valueAnimationId=null,z==="wavy"&&!$.state.indeterminate&&!$.wavyAnimationId)M();if(X>=$.state.max)$.element.dispatchEvent(new CustomEvent("complete",{detail:{value:X,max:$.state.max}}))}};$.valueAnimationId=requestAnimationFrame(r)},$.setIndeterminate=(D)=>{if(!$.state){console.warn("[Progress] No state available for setIndeterminate");return}if($.state.indeterminate=D,D){if($.valueAnimationId)cancelAnimationFrame($.valueAnimationId),$.valueAnimationId=null;if(U=$.state.value,z==="wavy"||!Z)M();else B()}else{if(U=$.state.value,k(),z==="wavy"){if(!$.wavyAnimationId)M()}else V();F()}},$.hide=()=>{$.element.classList.add($.getClass(z6.TRANSITION)),$.element.style.opacity="0";let D=()=>{$.element.style.display="none",$.element.removeEventListener("transitionend",D)};return $.element.addEventListener("transitionend",D),[$.animationId,$.wavyAnimationId,$.valueAnimationId].forEach((R)=>{if(R)cancelAnimationFrame(R)}),$.animationId=$.wavyAnimationId=$.valueAnimationId=null,$},$.show=()=>{if($.element.classList.add($.getClass(z6.TRANSITION)),$.element.style.display="",$.element.style.opacity="0",$.element.offsetHeight,$.element.style.opacity="1",$.state?.indeterminate)if(z==="wavy"||!Z)M();else B();else if(z==="wavy")M();return $},$.isVisible=()=>$.element.style.display!=="none"&&$.element.style.opacity!=="0",$.lifecycle){let D=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{if(K)K();if(G)G();[$.animationId,$.wavyAnimationId,$.valueAnimationId].forEach((R)=>{if(R)cancelAnimationFrame(R)}),D()}}return Object.assign($,{startWavyAnimation:M,stopWavyAnimation:V,startIndeterminateAnimation:B,stopIndeterminateAnimation:k}),{...$,canvas:q,get ctx(){return j?.ctx},draw:F,resize:N}};var R$=T(()=>{t6();Y9();_5();P5()});var w5=(J)=>($)=>{if(J.indeterminate&&$.element)f($.element,z6.INDETERMINATE),$.element.removeAttribute("aria-valuenow");if($.element){let j=$.getClass?.(z6.CONTAINER)||"";$.element.classList.remove(`${j}--thin`,`${j}--thick`)}if(J.shape&&J.shape!==I6.FLAT&&$.element){if(!$.element.classList.contains($.getClass?.(z6.CIRCULAR)||"")){let K=$.getClass?.(z6.CONTAINER)||"";f($.element,`${K}--${J.shape}`)}}let Q={value:J.value??0,max:J.max??100,buffer:J.buffer??0,indeterminate:J.indeterminate===!0,thickness:J.thickness??"thin",shape:J.shape??I6.FLAT,labelFormatter:J.labelFormatter??((j,K)=>`${Math.round(j/K*100)}%`),showLabel:J.showLabel},Z=$.lifecycle?.init,q=$.lifecycle?.destroy;return $.state=Q,$.lifecycle={init:()=>{if(requestAnimationFrame(()=>{try{if(Q.indeterminate)$.setIndeterminate?.(!0);else if($.setValue?.(Q.value),J.buffer!==void 0)$.setBuffer?.(Q.buffer);if(Q.shape!==I6.FLAT&&$.setShape)$.setShape(Q.shape);if(Q.thickness)if($.setThickness)$.setThickness(Q.thickness);else $.state.thickness=Q.thickness}catch(j){console.error("Error initializing progress state:",j)}}),Z)Z()},destroy:()=>{if(q)q()}},{...$,state:Q}};var x5=T(()=>{t6();v9()});var y5=(J)=>($)=>{let{element:Q,getClass:Z,canvas:q}=$,j=Q.classList.contains(Z(z6.CIRCULAR)),K=(Y,U)=>{Q.dispatchEvent(new CustomEvent(Y,{detail:U}))},G=(Y,U)=>{Q.setAttribute("aria-valuenow",Y.toString());let X=$.label;if(X){let _=J.label?.formatter||((H,B)=>`${Math.round(H/B*100)}%`);X.textContent=_(Y,U)}if(typeof $.draw==="function")$.draw()},W=(Y)=>{if(Y){if(f(Q,z6.INDETERMINATE),Q.removeAttribute("aria-valuenow"),!j){if((J.shape?.getShape()||I6.FLAT)!=="wavy"&&$.startIndeterminateAnimation)$.startIndeterminateAnimation()}}else if(q6(Q,z6.INDETERMINATE),$.stopIndeterminateAnimation)$.stopIndeterminateAnimation();if(typeof $.draw==="function")$.draw()};if(J.state.isIndeterminate())W(!0);let z={element:Q,track:q,indicator:q,buffer:q,getClass:Z,getValue(){return J.value.getValue()},setValue(Y,U=!0){let X=J.value.getValue(),_=J.value.getMax();if(J.value.setValue(Y),X!==Y){Q.setAttribute("aria-valuenow",Y.toString());let H=$.label;if(H){let k=J.label?.formatter||((M,V)=>`${Math.round(M/V*100)}%`);H.textContent=k(Y,_)}let B={value:Y,max:_};if(K(Z7.CHANGE,B),$.setValue&&typeof $.setValue==="function")$.setValue(Y,U);else G(Y,_)}return z},getMax(){return J.value.getMax()},getBuffer:()=>J.buffer.getBuffer(),setBuffer(Y){if(J.buffer.setBuffer(Y),!J.state.isIndeterminate()&&typeof $.draw==="function")$.draw();return z},setIndeterminate(Y){if(J.state.isIndeterminate()===Y)return z;return J.state.setIndeterminate(Y),W(Y),z},isIndeterminate:()=>J.state.isIndeterminate(),showLabel(){if(J.label?.show)J.label.show();return z},hideLabel(){if(J.label?.hide)J.label.hide();return z},setLabelFormatter(Y){if(J.label?.format)J.label.format(Y);let U=$.label||$.state?.label;if(U)U.textContent=Y(J.value.getValue(),J.value.getMax());return z},getThickness(){return J.thickness?.getThickness()||u6.THIN},setThickness(Y){if(J.thickness)J.thickness.setThickness(Y);if($.setThickness)$.setThickness(Y);return z},getShape(){if(J.shape&&typeof J.shape.getShape==="function")return J.shape.getShape();return I6.FLAT},setShape(Y){return $.setShape?.(Y),z},setSize(Y){if($.setSize)$.setSize(Y);return z},getSize(){return $.getSize?$.getSize():void 0},enable(){return J.disabled.enable(),z},disable(){return J.disabled.disable(),z},isDisabled:J.disabled.isDisabled,hide(){if($.hide)$.hide();return z},show(){if($.show)$.show();return z},isVisible(){return $.isVisible?$.isVisible():Q.style.display!=="none"},on(Y,U){return Q.addEventListener(Y,U),z},off(Y,U){return Q.removeEventListener(Y,U),z},addClass(...Y){return Y.forEach((U)=>Q.classList.add(U)),z},destroy(){J.lifecycle.destroy()},disabled:{enable(){J.disabled.enable()},disable(){J.disabled.disable()},isDisabled:J.disabled.isDisabled},lifecycle:{destroy(){J.lifecycle.destroy()}}};if($.state?.showLabel===!0){if(J.label?.show)J.label.show()}return z};var T5=T(()=>{t6();v9()});var Pq,I5=(J={})=>{return d(Pq,J,"progress")},S5=(J)=>{let $=J.indeterminate===!0,Q=J.variant===W9.CIRCULAR,Z={role:"progressbar","aria-valuemin":"0","aria-valuemax":(J.max||100).toString()};if(!$&&J.value!==void 0)Z["aria-valuenow"]=J.value.toString();if(J.disabled===!0)Z["aria-disabled"]="true";let q=[J.class,z6.CONTAINER,Q?z6.CIRCULAR:z6.LINEAR].filter(Boolean);if(!Q&&J.shape&&J.shape!==I6.FLAT)q.push(`${z6.CONTAINER}--${J.shape}`);return p(J,{tag:"div",attributes:Z,className:q})},b5=(J)=>{if(!J.state)J.state={value:0,max:100,buffer:0,indeterminate:!1,thickness:"thin",shape:h6.SHAPE,labelFormatter:($,Q)=>`${Math.round($/Q*100)}%`};return{value:{getValue:()=>J.state.value,setValue:($)=>{if(J.state){let Q=Math.max(0,Math.min(J.state.max,$));if(J.state.previousValue=J.state.value,J.state.value=Q,J.state.label)J.state.label.textContent=J.state.labelFormatter(Q,J.state.max);if(typeof J.setValue==="function")J.setValue(Q);else if(J.draw)J.draw()}},getMax:()=>J.state.max},buffer:{getBuffer:()=>J.state.buffer,setBuffer:($)=>{J.state.buffer=Math.max(0,Math.min(J.state.max,$))}},disabled:{enable:()=>J.disabled?.enable?.()||void 0,disable:()=>J.disabled?.disable?.()||void 0,isDisabled:()=>J.disabled?.isDisabled?.()||!1},label:{show:()=>{if(!J.state.label){let $=document.createElement("div");$.className=`${J.getClass(z6.LABEL)}`,$.textContent=J.state.labelFormatter(J.state.value,J.state.max),J.element.appendChild($),J.state.label=$,J.label=$}},hide:()=>{if(J.state.label)J.state.label.remove(),J.state.label=void 0,J.label=void 0},format:($)=>{J.state.labelFormatter=$},formatter:J.state.labelFormatter},thickness:{getThickness:()=>{let $=J.state.thickness;if($==="thin")return u6.THIN;else if($==="thick")return u6.THICK;else if(typeof $==="number")return $;return u6.THIN},setThickness:($)=>{if(J.state.thickness=$,J.draw)J.draw()}},shape:{getShape:()=>J.state.shape,setShape:($)=>{if(J.state.shape=$,J.setShape)J.setShape($)}},state:{setIndeterminate:($)=>{if(J.state){if(J.state.indeterminate=$,typeof J.setIndeterminate==="function")J.setIndeterminate($);else if(J.draw)J.draw()}},isIndeterminate:()=>J.state.indeterminate},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()||void 0}}};var v5=T(()=>{t();t6();Pq={variant:h6.VARIANT,value:h6.VALUE,max:h6.MAX,buffer:h6.BUFFER,showLabel:h6.SHOW_LABEL,thickness:"thin",shape:h6.SHAPE}});var C5={};E8(C5,{default:()=>A$});var Rq=(J={})=>{let $=I5(J);try{let Q=b(S,g(),E(S5($)),K6($),G6($),w5($),A5($),(Z)=>{return y5(b5(Z))(Z)},C())($);if(Q.lifecycle?.init)Q.lifecycle.init();return Q}catch(Q){throw console.error("Progress creation error:",Q),new Error(`Failed to create progress: ${Q.message}`)}},A$;var V1=T(()=>{J6();c();o();R$();x5();T5();v5();A$=Rq});var Aq=async(J)=>{let{default:$}=await Promise.resolve().then(() => (V1(),C5));return $(J)},E5=(J)=>($)=>{if(!J.progress)return $;let Q={},Z=typeof J.progress==="boolean"?{variant:"circular",size:20,thickness:2,indeterminate:!0}:(()=>{let{on:Y,...U}=J.progress;if(Y)Q=Y;return{variant:"circular",size:20,thickness:2,indeterminate:!0,...U}})(),q=null,j=null,K=!1,G="",W=async()=>{if(q)return q;if(!j)j=Aq(Z).then((Y)=>{return q=Y,f(q.element,$.getClass("button-progress")),q.element.style.display="none",Object.entries(Q).forEach(([U,X])=>{q.on(U,X)}),$.progress=q,q});return j},z=()=>{let Y=$.element.querySelector(`.${$.getClass("button-icon")}`);if(Y&&Y.nextSibling)return Y.nextSibling;return $.element.firstChild};if($.showProgress=async function(){let Y=await W();if(Y.element){if(!$.element.contains(Y.element)){let X=z();if(X)$.element.insertBefore(Y.element,X);else $.element.appendChild(Y.element)}Y.element.style.display="",f($.element,`${$.getClass("button")}--progress`);let U=$.element.querySelector(`.${$.getClass("button-icon")}`);if(U instanceof HTMLElement)U.style.display="none"}return $},$.showProgressSync=function(){return $.showProgress(),$},$.hideProgress=async function(){if(!q)return $;q.element.style.display="none",q6($.element,`${$.getClass("button")}--progress`);let Y=$.element.querySelector(`.${$.getClass("button-icon")}`);if(Y instanceof HTMLElement)Y.style.display="";return $},$.hideProgressSync=function(){return $.hideProgress(),$},$.setProgress=async function(Y){return(await W()).setValue(Y),$},$.setProgressSync=function(Y){return $.setProgress(Y),$},$.setIndeterminate=async function(Y){return(await W()).setIndeterminate(Y),$},$.setIndeterminateSync=function(Y){return $.setIndeterminate(Y),$},$.setLoading=async function(Y,U){if(Y&&!K){if($.setText&&$.getText)G=$.getText();if(K=!0,await $.showProgress(),$.disabled?.disable)$.disabled.disable();if(U&&$.setText)$.setText(U)}else if(!Y&&K){if(K=!1,await $.hideProgress(),$.disabled?.enable)$.disabled.enable();if(U&&$.setText)$.setText(U);else if(G&&$.setText)$.setText(G)}return $},$.setLoadingSync=function(Y,U){return $.setLoading(Y,U),$},$.lifecycle){let Y=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(q)q.destroy();if(q&&q.element.parentNode)q.element.parentNode.removeChild(q.element);Y()}}if(J.showProgress)W().then(()=>{$.showProgress()});return $};var h5=T(()=>{v9()});var u5=(J={},$={})=>{let Q={...J},Z=C6(),q=new Map,j=$.middleware||[],K=(W,z)=>{Z.emit("change",W,z)},G=(W,z)=>{return j.reduce((Y,U)=>U(Y,z),W)};return{getState:()=>{let W={};return q.forEach((z,Y)=>{W[Y]=z(Q)}),{...Q,...W}},setState:(W)=>{let z={...Q},Y=typeof W==="function"?W(Q):{...Q,...W};Q=G(Y,z),K(Q,z)},subscribe:(W)=>Z.on("change",W),derive:(W,z)=>{return q.set(W,z),()=>{q.delete(W)}},select:(W)=>W(Q),reset:()=>{Q={...J},K(Q,{})}}},f5=(J,$)=>{return console.log("State change:",{old:$,new:J,diff:Object.keys(J).reduce((Q,Z)=>{if(J[Z]!==$[Z])Q[Z]={from:$[Z],to:J[Z]};return Q},{})}),J},g5=(J)=>($)=>Object.keys($).reduce((Q,Z)=>{if(J($[Z],Z))Q[Z]=$[Z];return Q},{});var d5=()=>{};var l5=(J,$={})=>{let Q=!1,Z=C6();return{onMount:(q)=>Z.on("mount",q),onUnmount:(q)=>Z.on("unmount",q),mount:()=>{if(!Q)Q=!0,Z.emit("mount")},unmount:()=>{if(Q)Q=!1,Z.emit("unmount"),Z.clear()},isMounted:()=>Q,destroy(){if(Q)this.unmount();if($.events)$.events.destroy();if($.text){let q=$.text.getElement();if(q)q.remove()}if($.icon){let q=$.icon.getElement();if(q)q.remove()}if(J)J.remove()}}};var r5=()=>{};var p5=(J)=>{return{enable(){return J.disabled=!1,J.removeAttribute("disabled"),this},disable(){return J.disabled=!0,J.setAttribute("disabled","true"),this},toggle(){if(J.disabled)this.enable();else this.disable();return this},isDisabled(){return J.disabled===!0}}};function w6(J){return J&&typeof J==="object"&&"element"in J}function u7(){return document.createDocumentFragment()}function wq(...J){return o6(...J)}function h9(J,$=!1,Q=!1){if(!J||$)return{...J};if(!(J.class||J.className||J.rawClass))return{...J};let q={...J};if(q.className){if(!q.class)q.class=q.className;else{let j=wq([q.class,q.className]);q.class=j.join(" ")}delete q.className}if(q.class&&!$){if(typeof q.class==="string"){let j=q.class.split(/\s+/).filter(Boolean);if(Q)q.class=j.map((K)=>{if(!K||K.startsWith(D9))return K;if(K.includes("__")){let[G,W]=K.split("__");return`${D9}${G}__${W}`}else if(K.includes("--")){let[G,W]=K.split("--");return`${D9}${G}--${W}`}return`${D9}${K}`}).join(" ");else q.class=j.map((K)=>K&&!K.startsWith(D9)?`${D9}${K}`:K).filter(Boolean).join(" ")}else if(Array.isArray(q.class))q.class=q.class.filter(Boolean).map((j)=>typeof j==="string"&&!j.startsWith(D9)?`${D9}${j}`:j).join(" ")}return q}function w$(J){let $={};if(!J||typeof J!=="object")return $;for(let Q in J){let Z=J[Q];if(Z&&typeof Z!=="function"&&(Z instanceof HTMLElement||typeof SVGElement!=="undefined"&&Z instanceof SVGElement||w6(Z)))$[Q]=Z}return $}var D9;var f7=T(()=>{y6();v9();D9=`${u}-`});function n6(J){let $=w$(J);return{layout:J,element:J.element,component:$,get(Z){return J[Z]??null},getAll(){return $},destroy(){let Z=J.element;if(Z){if(w6(Z)&&typeof Z.destroy==="function")Z.destroy();else if(w6(Z)&&Z.element?.parentNode)Z.element.parentNode.removeChild(Z.element);else if(Z instanceof HTMLElement&&Z.parentNode)Z.parentNode.removeChild(Z)}for(let q in J){if(q==="element")continue;let j=J[q];if(w6(j)&&typeof j.destroy==="function")j.destroy()}}}}var g7=T(()=>{f7()});function x$(J,$=null,Q=0,Z={}){Q++;let q={},j=[],K=u7(),G=null;if(!Array.isArray(J))return console.error("Schema is not an array!",$,Q,J),n6(q);let W=Z.creator||v;for(let z=0;z<J.length;z++){let Y=J[z];if(!Y)continue;if(Array.isArray(Y)){let F=x$(Y,G||$,Q,Z);Object.assign(q,F.layout);continue}let U,X,_;if(typeof Y==="function"){U=Y;let V=J[z+1],F=J[z+2];if(typeof V==="string")if(X=V,z++,m6(F))_=F,z++;else _={};else if(m6(V))_=V,z++;else _={}}else if(typeof Y==="string"){U=W,X=Y;let V=J[z+1];if(m6(V))_=V,z++;else _={};if(U===v&&!("tag"in _))_.tag="div"}else if(m6(Y))U=W,_=Y;else{console.warn("Skipping unsupported item type:",Y);continue}let H=J[z+1];if(m6(H)&&!Array.isArray(H)&&typeof H.prefix!=="undefined")Object.assign(_,H),z++;let k=("prefix"in _?_.prefix:Z.prefix!==!1)?h9(_):{..._};if(X&&!("name"in k)&&!(U===v||U.isElement))k.name=X;G=u9(U,k);let M=w6(G)?G.element:G;if(Q===1)q.element=M;if(X)q[X]=G,j.push([X,G]);if(G){if("insert"in G&&typeof G.insert==="function")G.insert(K);else K.appendChild(M);if($){if(G._container=$,"onInserted"in G&&typeof G.onInserted==="function")G.onInserted($)}}}if($&&K.hasChildNodes())(w6($)?$.element:$).appendChild(K);return q.components=j,n6(q)}var s5=T(()=>{A6();f7();g7();d7();Y9()});function y$(J,$=null,Q={}){let Z={},q=Q.creator||v;if(J.element&&!$){let G=J.element,W=G.creator||q,z=G.options||{},Y=Q.prefix!==!1?h9(z):{...z},U=u9(W,Y),X=w6(U)?U.element:U;if(Z.element=U,G.name)Z[G.name]=U;if(G.children){let _=u7(),H=[];for(let B in G.children){let k=G.children[B];if(k&&!k.name)k.name=B;let M=y$({[B]:k},_,Q);H.push(M.layout)}X.appendChild(_);for(let B of H)Object.assign(Z,B)}return n6(Z)}let j=$?u7():null,K=[];for(let G in J){let W=J[G];if(!W)continue;let z=W.creator||q,Y=W.options||{},X=("prefix"in Y?Y.prefix:Q.prefix!==!1)?h9(Y):{...Y};if(!W.name&&G!=="element")W.name=G;let _=u9(z,X);if(Z[G]=_,W.name&&W.name!==G)Z[W.name]=_;let H=w6(_)?_.element:_;if(j)j.appendChild(H);if(W.children){let B=typeof SVGElement!=="undefined"&&H instanceof SVGElement,k=y$(W.children,H,Q);if(K.push(k.layout),B)Object.assign(Z,k.layout)}}if($&&j)(w6($)?$.element:$).appendChild(j);for(let G of K)Object.assign(Z,G);return n6(Z)}var m5=T(()=>{A6();f7();g7();d7()});function _1(J){if(!J)return;Array.from(J.classList).filter((Z)=>Z.startsWith("layout--")||Z.includes("-layout--")).forEach((Z)=>{J.classList.remove(Z)})}function f9(J){return O6(J,"layout--stack")?"stack":O6(J,"layout--row")?"row":O6(J,"layout--grid")?"grid":""}function T$(J,$,Q=!0){if(!J||!$)return;if(Q)_1(J);if($.type)f(J,`layout--${$.type}`);if($.gap!==void 0){let Z=$.type||f9(J);if(Z)f(J,`layout--${Z}-gap-${$.gap}`)}if($.align){let Z=$.type||f9(J);if(Z)f(J,`layout--${Z}-${$.align}`)}if($.justify){let Z=$.type||f9(J);if(Z)f(J,`layout--${Z}-justify-${$.justify}`)}if($.type==="grid"||f9(J)==="grid"){if(typeof $.columns==="number")f(J,`layout--grid-cols-${$.columns}`);else if($.columns==="auto-fill")f(J,"layout--grid-fill");else if($.columns==="auto-fit")f(J,"layout--grid-cols-auto-fit");if($.dense)f(J,"layout--grid-dense");if($.autoHeight)f(J,"layout--grid-auto-height")}if($.type==="row"||f9(J)==="row"){if($.wrap===!1||$.wrap==="nowrap")f(J,"layout--row-nowrap");else if($.wrap==="reverse")f(J,"layout--row-wrap-reverse");if($.mobileStack)f(J,"layout--row-mobile-stack");if($.mobileScroll)f(J,"layout--row-mobile-scroll")}if($.class)$.class.split(" ").filter(Boolean).forEach((Z)=>{J.classList.add(Z)})}function I$(J,$){if(!J||!$)return;if(f(J,"layout__item"),$.width&&$.width>=1&&$.width<=12)f(J,`layout__item--${$.width}`);if($.sm)f(J,`layout__item--sm-${$.sm}`);if($.md)f(J,`layout__item--md-${$.md}`);if($.lg)f(J,`layout__item--lg-${$.lg}`);if($.xl)f(J,`layout__item--xl-${$.xl}`);if($.span)f(J,`layout__item--span-${$.span}`);if($.rowSpan)f(J,`layout__item--row-span-${$.rowSpan}`);if($.order)if(typeof $.order==="number")f(J,`layout__item--order-${$.order}`);else f(J,`layout__item--order-${$.order}`);if($.align)f(J,`layout__item--self-${$.align}`);if($.auto)f(J,"layout__item--auto")}var L1=T(()=>{T9()});function u9(J,$={}){try{let{layout:Q,layoutItem:Z,style:q,attributes:j}=$,K=$.events||$.event,G={...$};delete G.layout,delete G.layoutItem,delete G.events,delete G.event;let z=typeof J==="function"&&Object.getOwnPropertyDescriptor(J,"prototype")?.writable===!1?new J(G):J(G);if(z){let Y=z.element||(z instanceof HTMLElement?z:null);if(Y){if(Q)T$(Y,Q);if(Z)I$(Y,Z);if(q&&typeof q==="object")Object.assign(Y.style,q);if(j&&typeof j==="object"){for(let[U,X]of Object.entries(j))if(X!==void 0&&X!==null)Y.setAttribute(U,X.toString())}if(K){if(typeof K==="object"&&!Array.isArray(K)){for(let[U,X]of Object.entries(K))if(typeof X==="function")Y.addEventListener(U,X)}else if(Array.isArray(K)){for(let U of K)if(Array.isArray(U)&&U.length>=2){let[X,_]=U;if(typeof X==="string"&&typeof _==="function")Y.addEventListener(X,_)}}}}}return z}catch(Q){return console.error("Error creating component instance:",Q),document.createElement("div")}}function D1(J){return Array.isArray(J)&&J.length>=3&&typeof J[0]==="function"&&typeof J[1]==="string"&&m6(J[2])}function S$(J,$=null,Q=0,Z={}){if(!J)return console.warn("Empty schema provided to layout processor"),{layout:{},element:document.createElement("div"),component:{},get:()=>null,getAll:()=>({}),destroy:()=>{}};if(D1(J))return x$(J,$,Q,Z);return Array.isArray(J)?x$(J,$,Q,Z):y$(J,$,Z)}var d7=T(()=>{s5();m5();Y9();L1()});function g9(J,$=null,Q={}){if(typeof J==="function")J=J();if(typeof J==="string"){let Z=document.createElement("template");Z.innerHTML=J.trim();let q=Z.content;if($&&q.hasChildNodes())$.appendChild(q);let j={element:q.firstElementChild};return n6(j)}return S$(J,$,0,Q)}var b$=T(()=>{d7();g7()});function q7(J,$,...Q){if(J===P1)return Q.flat(1/0).filter(Boolean);let Z=$||{};if(Z.style&&typeof Z.style==="object")Z.style=Object.entries(Z.style).map(([G,W])=>{return`${G.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}: ${W}`}).join("; ");let q=Z.id||Z.name||`el-${Math.floor(Math.random()*1e4)}`,j={...Z};delete j.id,delete j.name;let K=Q.flat(1/0).filter((G)=>G!==null&&G!==void 0&&G!==!1);if(typeof J==="function")return[J,q,j,K.length>0?O1(K):void 0].filter(Boolean);else if(typeof J==="string")return[v,q,{...j,tag:J},K.length>0?O1(K):void 0].filter(Boolean);return[]}function O1(J){let $=[];for(let Q of J)if(typeof Q==="string"||typeof Q==="number"||typeof Q==="boolean")$.push(String(Q));else if(Array.isArray(Q))$.push(...O1(Q));else if(Q&&typeof Q==="object")$.push(Q);return $}function a5(J,$){return g9(J,$)}var P1;var R1=T(()=>{A6();b$();P1=Symbol("Fragment")});var c5;var v$=T(()=>{f7();b$();g7();d7();L1();R1();b$();c5=g9});var Y6,i5,C$=(J={})=>{let $=new Map,Q=new Set,Z=null,q=null,j=null,K=!1,G=!1,W=null,z=[],Y={event:Y6.CHANGE,data:null},U=J.transform||((k)=>k),X=J.validate||(()=>!0);function _(k,M){if(Q.size===0)return;Y.event=k,Y.data=M,z.length=0,Q.forEach((V)=>z.push(V));for(let V=0;V<z.length;V++)z[V](Y)}function H(){if(K&&j!==null)return j;if(!Z&&!q){let V=Array.from($.values());return j=V,K=!0,V}let k=Array.from($.values()),M=k;if(Z)M=k.filter(Z);if(q)M.sort(q);return j=M,K=!0,M}function B(k){if(!Array.isArray(k)){if(!X(k))return[];return[U(k)]}if(k.length===0)return[];let M=[];for(let V=0;V<k.length;V++)if(X(k[V])){let F=U(k[V]);if(F.id)M.push(F);else throw new Error("Items must have an id property")}return M}return{subscribe(k){return Q.add(k),()=>{Q.delete(k)}},getItems:H,getSize(){return $.size},isLoading(){return G},getError(){return W},query(k){Z=k,K=!1,_(Y6.CHANGE,H())},sort(k){q=k,K=!1,_(Y6.CHANGE,H())},async add(k){try{G=!0,_(Y6.LOADING,!0);let M=B(k);if(M.length===0)return M;for(let V=0;V<M.length;V++)$.set(M[V].id,M[V]);return K=!1,_(Y6.ADD,M),_(Y6.CHANGE,H()),M}catch(M){throw W=M instanceof Error?M:new Error(String(M)),_(Y6.ERROR,W),W}finally{G=!1,_(Y6.LOADING,!1)}},async update(k){try{G=!0,_(Y6.LOADING,!0);let M=Array.isArray(k)?k:[k];if(M.length===0)return[];for(let F=0;F<M.length;F++)if(!$.has(M[F].id))throw new Error(`Item with id ${M[F].id} not found`);let V=B(M);for(let F=0;F<V.length;F++)$.set(V[F].id,V[F]);return K=!1,_(Y6.UPDATE,V),_(Y6.CHANGE,H()),V}catch(M){throw W=M instanceof Error?M:new Error(String(M)),_(Y6.ERROR,W),W}finally{G=!1,_(Y6.LOADING,!1)}},async remove(k){try{G=!0,_(Y6.LOADING,!0);let M=Array.isArray(k)?k:[k];if(M.length===0)return[];for(let V=0;V<M.length;V++)if(!$.has(M[V]))throw new Error(`Item with id ${M[V]} not found`);for(let V=0;V<M.length;V++)$.delete(M[V]);return K=!1,_(Y6.REMOVE,M),_(Y6.CHANGE,H()),M}catch(M){throw W=M instanceof Error?M:new Error(String(M)),_(Y6.ERROR,W),W}finally{G=!1,_(Y6.LOADING,!1)}},clear(){$.clear(),Z=null,q=null,j=null,K=!1,_(Y6.CHANGE,[])}}};var l7=T(()=>{Y6={CHANGE:"change",ADD:"add",UPDATE:"update",REMOVE:"remove",ERROR:"error",LOADING:"loading"},i5={EQ:"eq",NE:"ne",GT:"gt",GTE:"gte",LT:"lt",LTE:"lte",IN:"in",NIN:"nin",CONTAINS:"contains",STARTS_WITH:"startsWith",ENDS_WITH:"endsWith"}});var x6,E$=(J={})=>{return{handleError:(Q,Z)=>{throw J.onError?.(Q,Z),Q}}};var A1=T(()=>{x6={EQ:"eq",NE:"ne",GT:"gt",GTE:"gte",LT:"lt",LTE:"lte",IN:"in",NIN:"nin",CONTAINS:"contains",STARTS_WITH:"startsWith",ENDS_WITH:"endsWith"}});var xq,h$=(J={})=>{let $=E$(J),Q=null,Z=new Map,q=new Map,j={strategy:J.pagination?.strategy||"cursor",cursorParamName:J.pagination?.cursorParamName||"cursor",pageParamName:J.pagination?.pageParamName||"page",perPageParamName:J.pagination?.perPageParamName||"per_page",offsetParamName:J.pagination?.offsetParamName||"offset",limitParamName:J.pagination?.limitParamName||"limit",defaultPageSize:J.pagination?.defaultPageSize||20},K=(H)=>{if(!H)return"http://localhost";if(/^https?:\/\//i.test(H))return H;if(H.startsWith("/"))return`${window.location.origin}${H}`;return`http://${H}`},G=(H,B={})=>{try{let k=H+JSON.stringify(B);if(q.has(k))return q.get(k);let M=K(J.base),V=new URL(M+H);if(Object.entries(B).forEach(([N,O])=>{if(Array.isArray(O))O.forEach((P)=>V.searchParams.append(N,P));else if(O!==null&&O!==void 0)V.searchParams.append(N,String(O))}),J.base&&J.base.startsWith("/")){let N=`${V.pathname}${V.search}`;return q.set(k,N),N}let F=V.toString();return q.set(k,F),F}catch(k){throw console.error("Error building URL:",k,{base:J.base,endpoint:H,params:B}),k}},W=(H)=>{let B={};return Object.entries(H).forEach(([k,M])=>{if(typeof M==="object")Object.entries(M).forEach(([V,F])=>{let N=xq[V];if(N)B[`${k}_${N}`]=F});else B[k]=M}),B},z=async(H,B={})=>{if(Q)Q.abort();Q=new AbortController;try{let k=await fetch(H,{...B,headers:{"Content-Type":"application/json",...J.headers,...B.headers},signal:Q.signal});if(!k.ok){let V;try{V=await k.json()}catch{V={message:`HTTP error ${k.status}`}}return console.error("API error response:",V),$.handleError(new Error(V.message||"API request failed"))}let M=k.headers.get("content-type");if(M&&M.includes("application/json"))return await k.json();else return await k.text()}catch(k){if(console.error("API request error:",k),k.name==="AbortError")return null;return $.handleError(k)}finally{Q=null}},Y=(H)=>{if(!J.cache)return null;let B=Z.get(H);if(!B)return null;let{data:k,timestamp:M}=B;if(Date.now()-M>300000)return Z.delete(H),null;return k},U=(H,B)=>{if(!J.cache)return;Z.set(H,{data:B,timestamp:Date.now()})},X=(H={},B={})=>{let k={};switch(j.strategy){case"cursor":{let V=H.cursor||B.cursor;if(V)k[j.cursorParamName]=V;let F=H.limit||B.limit||j.defaultPageSize;k[j.limitParamName]=F;break}case"offset":{let V=H.offset!==void 0?H.offset:B.offset!==void 0?B.offset:0;k[j.offsetParamName]=V;let F=H.limit||B.limit||j.defaultPageSize;k[j.limitParamName]=F;break}case"page":{let V=H.page!==void 0?H.page:B.page!==void 0?B.page:H.cursor?H.cursor:1;k[j.pageParamName]=V;let F=H.per_page||H.perPage||H.limit||B.per_page||B.perPage||B.limit||j.defaultPageSize;k[j.perPageParamName]=F;break}}return k},_=(H,B={},k={})=>{if(J.adapter?.parseResponse)return J.adapter.parseResponse(H);if(H&&H.items)return H;if(Array.isArray(H))return{items:H,meta:{cursor:null,hasNext:!1}};let M=H.data||H.items||H.results||H.content||[],V=H.meta||H.pagination||H.page||{},F=V.total||H.total||M.length,N={cursor:null,hasNext:!1,total:F};switch(j.strategy){case"cursor":{if(V.next||V.nextCursor||V.nextPage)N.cursor=String(V.next||V.nextCursor||V.nextPage),N.hasNext=!0;else if(V.hasMore||V.hasNext)N.hasNext=Boolean(V.hasMore||V.hasNext),N.cursor=V.cursor||(V.page?String(Number(V.page)+1):null);else{let P=B.limit||k.limit||j.defaultPageSize;if(N.hasNext=M.length>=P,N.hasNext&&M.length>0){let L=M[M.length-1];N.cursor=L.id||L._id||String(M.length)}}break}case"offset":{let P=Number(B.offset||k.offset||V.offset||0),L=Number(B.limit||k.limit||V.limit||j.defaultPageSize),D=M.length;if(F!==void 0)N.hasNext=P+D<F;else N.hasNext=D>=L;N.cursor=N.hasNext?String(P+D):null,N.offset=P;break}case"page":{let P=Number(B.page||k.page||V.page||V.current_page||1),L=Number(B.per_page||B.perPage||B.limit||k.per_page||k.perPage||k.limit||V.per_page||V.perPage||V.size||V.limit||j.defaultPageSize);N.page=P;let D=Number(V.totalPages||V.total_pages||V.pages||V.pageCount||0);if(D>0)N.hasNext=P<D,N.pages=D;else if(F!==void 0){let R=Math.ceil(F/L);N.hasNext=P<R,N.pages=R}else N.hasNext=M.length>=L;N.cursor=N.hasNext?String(P+1):null;break}}return{items:M,meta:N}};return{...$,create:async(H)=>{let B=G(J.endpoints?.create||"/create"),k=await z(B,{method:"POST",body:JSON.stringify({items:H})});return _(k)},read:async(H={},B={})=>{let k={...H};["cursor","page","offset","limit","per_page","perPage","sort","fields","search"].forEach((w)=>{delete k[w]});let M=W(k),V=X(H,B),F={};if(H.search||B.search)F.search=H.search||B.search;if(H.sort||B.sort)F.sort=H.sort||B.sort;if(H.fields||B.fields)F.fields=H.fields||B.fields;let N={...M,...V,...F};Object.keys(N).forEach((w)=>{if(N[w]===void 0)delete N[w]});let O=G(J.endpoints?.list||"/list",N),P=O.toString(),L=Y(P);if(L)return L;let D=await z(O),R=_(D,H,B);return U(P,R),R},update:async(H)=>{let B=G(J.endpoints?.update||"/update"),k=await z(B,{method:"PUT",body:JSON.stringify({items:H})});return _(k)},delete:async(H)=>{let B=G(J.endpoints?.delete||"/delete"),k=await z(B,{method:"DELETE",body:JSON.stringify({ids:H})});return _(k)},query:async(H={},B={})=>{let k={...H},M={...B};["cursor","page","offset","limit","per_page","perPage","sort","fields","search"].forEach((D)=>{delete k[D],delete M[D]});let V=W(k),F=X(H,B),N={...M};if(H.search||B.search)N.search=H.search||B.search;let O={...V,...F,...N},P=G(J.endpoints?.list||"/list",O),L=await z(P);return _(L,H,B)},setPaginationStrategy:(H)=>{j.strategy=H},getPaginationConfig:()=>{return{...j}},disconnect:()=>{if(Q)Q.abort(),Q=null;Z.clear(),q.clear()}}};var w1=T(()=>{A1();xq={[x6.EQ]:"eq",[x6.NE]:"ne",[x6.GT]:"gt",[x6.GTE]:"gte",[x6.LT]:"lt",[x6.LTE]:"lte",[x6.IN]:"in",[x6.NIN]:"nin",[x6.CONTAINS]:"contains",[x6.STARTS_WITH]:"startsWith",[x6.ENDS_WITH]:"endsWith"}});function Tq(J){return{...yq,...J}}function o5(J){if(!J.renderItem||typeof J.renderItem!=="function")throw new Error("List manager requires a renderItem function");let $=Tq(J);if(!$.collection)$.collection="items";if(!$.transform)$.transform=(Q)=>Q;return $}function t5(J){return Boolean(J.baseUrl)}function n5(J){return J.staticItems||J.items||[]}var yq;var e5=T(()=>{yq={renderBufferSize:5,overscanCount:3,itemHeight:48,measureItemsInitially:!0,pageSize:20,loadThreshold:0.8,throttleMs:16,dedupeItems:!0,dynamicItemSize:!1,scrollStrategy:"scroll"}});function $Q(J){if(getComputedStyle(J).position==="static")J.style.position="relative";let $=document.createElement("div");$.style.position="relative",$.style.width="100%",$.style.willChange="transform";let Q=document.createElement("div");return Q.style.position="absolute",Q.style.top="0",Q.style.left="0",Q.style.width="1px",Q.style.visibility="hidden",Q.style.pointerEvents="none",J.appendChild($),J.appendChild(Q),{container:J,content:$,spacer:Q}}function JQ(J){let $=document.createElement("div");$.className="mtrl-list-sentinel mtrl-list-sentinel--top",$.style.position="absolute",$.style.top="0",$.style.left="0",$.style.width="100%",$.style.height="1px",$.style.pointerEvents="none",$.style.visibility="hidden";let Q=document.createElement("div");return Q.className="mtrl-list-sentinel mtrl-list-sentinel--bottom",Q.style.position="absolute",Q.style.bottom="0",Q.style.left="0",Q.style.width="100%",Q.style.height="1px",Q.style.pointerEvents="none",Q.style.visibility="hidden",J.content.appendChild($),J.content.appendChild(Q),{...J,topSentinel:$,bottomSentinel:Q}}function x1(J,$){J.spacer.style.height=`${$}px`}function QQ(J){if(J.content.parentNode)J.content.parentNode.removeChild(J.content);if(J.spacer.parentNode)J.spacer.parentNode.removeChild(J.spacer);if(J.topSentinel&&J.topSentinel.parentNode)J.topSentinel.remove();if(J.bottomSentinel&&J.bottomSentinel.parentNode)J.bottomSentinel.remove()}var ZQ=(J=48)=>{let $=new Map,Q=new Map,Z=!1,q=!0,j=!1,K=(z)=>{if(!z)return;return z.id||z.original&&z.original.id},G=(z)=>{if(Z&&Q.size>=z.length)return;if(Q.clear(),q){let Y=0;for(let U=0;U<z.length;U++)if(z[U]){let X=K(z[U]);if(X)Q.set(X,Y);Q.set(`index:${U}`,Y),Y+=J}}else{let Y=0;for(let U=0;U<z.length;U++)if(z[U]){let X=K(z[U]);if(X)Q.set(X,Y);Q.set(`index:${U}`,Y);let _=X&&$.has(X)?$.get(X):J;Y+=_}}Z=!0},W=(z)=>{if(!z)return;if(j=z.dynamicItemSize===!0,q=!j,z.itemHeight)J=z.itemHeight};return{setup:(z)=>{W(z)},measureItemHeight:(z,Y)=>{if(!Y||!z)return J;if(q&&$.size>0)return J;let U=K(z);if(!U)return J;let X=Y.offsetHeight;if(j||$.size===0||$.has(U)){if(X>0){let H=$.get(U)!==X;if($.size===0&&!j)J=X;if(H){if($.set(U,X),Z&&!q)Z=!1}}}if($.size===1&&!j&&Y.offsetHeight>0)return $.values().next().value;return j?$.get(U)||J:J},getItemHeight:(z)=>{if(q)return J;if(!z)return J;let Y=K(z);if(!Y)return J;if($.has(Y))return $.get(Y)||J;return J},setItemHeights:(z)=>{if(q&&!j)return!1;let Y=!1;for(let[U,X]of Object.entries(z))if($.get(U)!==X&&X>0)$.set(U,X),Y=!0;if(Y)Z=!1;return Y},calculateTotalHeight:(z)=>{if(!z||z.length===0)return 0;let Y=z.length;if(q)return Y*J;let U=0;for(let X of z){if(!X)continue;let _=K(X);U+=_&&$.has(_)?$.get(_):J}return U},getItemOffset:(z,Y)=>{if(Z&&Q.has(Y))return Q.get(Y)||0;if(G(z),Q.has(Y))return Q.get(Y)||0;if(q){let U=z.findIndex((X)=>K(X)===Y);if(U>=0)return U*J}else{let U=0;for(let X of z){let _=K(X);if(_===Y)return U;let H=_&&$.has(_)?$.get(_):J;U+=H}}return-1},getOffsetAtIndex:(z)=>{let Y=`index:${z}`;if(Z&&Q.has(Y))return Q.get(Y)||0;if(q)return z*J;return z*J},measureMarkedElements:(z,Y)=>{let U=$.size===0?".mtrl-list-item":'[data-needs-measurement="true"]',X=z.querySelectorAll(U),_=!1;if(X.length>0){if($.size===0&&X.length>0){let B=X[0].offsetHeight;if(B>0){if(J=B,_=!0,!j)return!0}}if(j)for(let H=0;H<X.length;H++){let B=X[H],k=B.getAttribute("data-id");if(k){if(Y.find((V)=>K(V)===k)){let V=B.offsetHeight;if(V>0&&$.get(k)!==V)$.set(k,V),_=!0;delete B.dataset.needsMeasurement}}}if(_&&!q)Z=!1}return _},hasCachedOffsets:()=>{return Z},calculateOffsets:G,clear:()=>{$.clear(),Q.clear(),Z=!1},getAllHeights:()=>{return new Map($)},getDefaultHeight:()=>{return J},isUsingUniformHeight:()=>{return q}}};function Iq(J,$,Q,Z,q){let{renderBufferSize:j=5,overscanCount:K=3}=q,G=Math.floor(J/$),W=Math.ceil(Q/$),z=G+W,Y=Math.max(0,G-j-K),U=Math.min(Z,z+j+K);return{start:Y,end:U}}function Sq(J,$,Q,Z,q,j,K){let G=0,W=$.length-1,z=0;if(typeof Z.hasCachedOffsets==="function"&&Z.hasCachedOffsets())while(G<=W){let H=Math.floor((G+W)/2);if(!$[H]){G=H+1;continue}if(Z.getItemOffset($,$[H].id)<J)z=H,G=H+1;else W=H-1}else{let H=Z.getAllHeights(),B=K;if(H.size>0){let M=0,V=0;H.forEach((F)=>{M+=F,V++}),B=M/V}z=Math.floor(J/B);let k=z*B;while(z<$.length&&k<J){if($[z])k+=Z.getItemHeight($[z]);z++}while(z>0&&k>J)if(z--,$[z])k-=Z.getItemHeight($[z])}z=Math.max(0,Math.min(z,$.length-1));let Y=Math.max(0,z-q-j),U=0;for(let H=0;H<Y;H++)if($[H])U+=Z.getItemHeight($[H]);let X=Y,_=J+Q+q*K;while(X<$.length&&U<_){if($[X])U+=Z.getItemHeight($[X]);X++}return X=Math.min($.length,X+j),{start:Y,end:X}}function qQ(J,$,Q,Z,q){let{renderBufferSize:j=5,overscanCount:K=3,itemHeight:G=48}=q;if($.length===0)return{start:0,end:0};if($.length<10)return{start:0,end:$.length};let W=Z.getAllHeights();if(new Set(W.values()).size<=1&&$.length>20)return Iq(J,G,Q,$.length,q);if($.length>100)return Sq(J,$,Q,Z,j,K,G);let Y=0,U=0,X=0;for(let _=0;_<$.length;_++){if(!$[_])continue;let H=Z.getItemHeight($[_]);if(Y+H>J-j*q.itemHeight){U=Math.max(0,_-K);break}Y+=H}Y=0;for(let _=0;_<$.length;_++){if(!$[_])continue;let H=Z.getItemHeight($[_]);if(Y+=H,Y>J+Q+j*q.itemHeight){X=Math.min($.length,_+K);break}}if(X===0)X=$.length;return{start:U,end:X}}function jQ(J,$,Q){if(typeof Q.hasCachedOffsets==="function"&&Q.hasCachedOffsets()&&typeof Q.getOffsetAtIndex==="function"){let j=[];for(let K=$.start;K<$.end;K++)if(J[K])j.push({index:K,item:J[K],offset:Q.getOffsetAtIndex(K)});return j}let Z=0;for(let j=0;j<$.start;j++)if(J[j])Z+=Q.getItemHeight(J[j]);let q=[];for(let j=$.start;j<$.end;j++)if(J[j])q.push({index:j,item:J[j],offset:Z}),Z+=Q.getItemHeight(J[j]);return q}function KQ(J,$,Q,Z){if(Q<=0||$<=0)return!1;return(J+$)/Q>Z}var GQ=(J,$,Q,Z)=>{let q=null,j=new Map,K={start:0,end:0};if(typeof Q.setup==="function")Q.setup(J);let G=(z,Y)=>{if(!z){console.warn("Attempted to render undefined item at index",Y);let _=document.createElement("div");return _.style.height=`${J.itemHeight||48}px`,_}let U=Z.getRecycledElement(z),X=J.renderItem(z,Y,U);if(!X){console.warn("renderItem returned null or undefined for item",z);let _=document.createElement("div");return _.style.height=`${J.itemHeight||48}px`,_}if(!X.classList.contains("mtrl-list-item"))X.classList.add("mtrl-list-item");if(z.id&&!X.hasAttribute("data-id"))X.setAttribute("data-id",z.id);if(z.type)X.dataset.itemType=z.type;if((J.dynamicItemSize===!0||j.size===0)&&!X.hasAttribute("data-needs-measurement"))X.dataset.needsMeasurement="true";if(q)q(z,X);return X},W=(z,Y,U)=>{if(Math.abs(U.end-U.start-(K.end-K.start))>10)return!1;let _=0;return Array.from(z).forEach((H)=>{if(Y.has(H))_++}),_>=z.size/2};return{setRenderHook:(z)=>{q=z},renderVisibleItems:(z,Y)=>{if(!$.content)return console.warn("Cannot render items: content element missing"),new Map;if(Y.start===K.start&&Y.end===K.end)return j;K=Y;let{topSentinel:U,bottomSentinel:X}=$,_=jQ(z,Y,Q),H=new Set(_.map((M)=>M.item.id)),B=new Set(j.keys());if(W(H,B,Y)){let M=_.filter((F)=>!B.has(F.item.id));if(Array.from(j.entries()).filter(([F])=>!H.has(F)).forEach(([F,N])=>{Z.recycleElement(N),j.delete(F),N.remove()}),M.length>0){let F=document.createDocumentFragment();M.forEach(({index:N,item:O,offset:P})=>{let L=G(O,N);L.style.position="absolute",L.style.top=`${P}px`,L.style.left="0",L.style.width="100%",F.appendChild(L),j.set(O.id,L)}),$.content.appendChild(F)}_.forEach(({item:F,offset:N})=>{if(j.has(F.id)){let O=j.get(F.id);if(parseInt(O.style.top,10)!==N)O.style.top=`${N}px`}})}else{let M=new Map;Array.from($.content.children).forEach((F)=>{if(F===U||F===X)return;let N=F.getAttribute("data-id");if(N)M.set(N,F),F.remove()});let V=document.createDocumentFragment();j.clear(),_.forEach(({index:F,item:N,offset:O})=>{let P;if(M.has(N.id)){if(P=M.get(N.id),M.delete(N.id),P.style.top=`${O}px`,J.dynamicItemSize===!0||j.size===0)P.dataset.needsMeasurement="true"}else P=G(N,F),P.style.position="absolute",P.style.top=`${O}px`,P.style.left="0",P.style.width="100%";V.appendChild(P),j.set(N.id,P)}),M.forEach((F)=>{Z.recycleElement(F)}),$.content.innerHTML="",$.content.appendChild(V)}if(U&&!U.parentNode)$.content.insertBefore(U,$.content.firstChild);if(X&&!X.parentNode)$.content.appendChild(X);return j},getItemElements:()=>{return new Map(j)}}};var zQ=()=>{};function WQ(J,$,Q,Z){let{scrollStrategy:q="scroll"}=Q;switch(q){case"intersection":return YQ(J,$,Z);case"hybrid":return bq(J,$,Z);case"scroll":default:return y1(J,Q,Z)}}function y1(J,$,Q){let Z=null,q=0,j=5,K=$.throttleMs||16,G=0;return{setup:()=>{let W=(z)=>{let Y=z.target.scrollTop;if(Math.abs(Y-q)<j)return;let U=Date.now();if(U-G<K){if(Z)return;Z=requestAnimationFrame(()=>{q=Y,G=Date.now(),Q.onScroll(Y),Z=null});return}q=Y,G=U,Q.onScroll(Y)};return J.addEventListener("scroll",W,{passive:!0}),()=>{if(J.removeEventListener("scroll",W),Z)cancelAnimationFrame(Z),Z=null}},getScrollTop:()=>{return J.scrollTop}}}function YQ(J,$,Q){let Z=null,q=null,j=null,K=!1;return{setup:()=>{if(!("IntersectionObserver"in window))return console.warn("IntersectionObserver not supported, falling back to scroll events"),y1(J,{renderItem:()=>document.createElement("div")},Q).setup();if(!$.topSentinel||!$.bottomSentinel)Object.assign($,JQ($));if(Z=new IntersectionObserver((z)=>{if(K)return;K=!0;let Y=!1,U=!1;if(z.forEach((X)=>{if(X.target===$.topSentinel&&X.isIntersecting)Y=!0;if(X.target===$.bottomSentinel&&X.isIntersecting)U=!0,Y=!0}),U){if(j!==null)clearTimeout(j);j=window.setTimeout(()=>{Q.onLoadMore(),j=null},100)}if(Y)Q.onScroll(J.scrollTop);setTimeout(()=>{K=!1},100)},{root:J,rootMargin:"400px 0px 400px 0px",threshold:0}),$.topSentinel)Z.observe($.topSentinel);if($.bottomSentinel)Z.observe($.bottomSentinel);let G=()=>{if(!K)Q.onScroll(J.scrollTop)},W=0;return q=()=>{let z=Date.now();if(z-W<200)return;W=z,G()},J.addEventListener("scroll",q,{passive:!0}),()=>{if(Z)Z.disconnect(),Z=null;if(q)J.removeEventListener("scroll",q),q=null;if(j!==null)clearTimeout(j),j=null}},getScrollTop:()=>{return J.scrollTop}}}function bq(J,$,Q){let q=y1(J,{throttleMs:32,renderItem:()=>document.createElement("div")},{onScroll:Q.onScroll,onLoadMore:()=>{}}),j=YQ(J,$,{onScroll:(G)=>{let W=J.scrollTop;if(Math.abs(W-G)>50)Q.onScroll(W)},onLoadMore:Q.onLoadMore}),K=[];return{setup:()=>{return K.push(q.setup()),K.push(j.setup()),()=>{K.forEach((G)=>G()),K=[]}},getScrollTop:()=>{return q.getScrollTop()}}}var UQ=()=>{};var XQ=()=>{let J=new Map,$=50;return{getRecycledElement:(Q)=>{let Z=Q.type||"default";if(!J.has(Z))return J.set(Z,[]),null;let q=J.get(Z);return q.length>0?q.pop():null},recycleElement:(Q,Z=!1)=>{if(!Q)return;if(!Z&&Q.innerHTML.length<100)return;let q=Q.dataset.itemType||"default";if(!J.has(q))J.set(q,[]);let j=J.get(q);if(j.length<50){Q.style.display="none",Q.style.top="-9999px";for(let K in Q.dataset)if(K!=="itemType")delete Q.dataset[K];j.push(Q)}},getPool:(Q)=>{return J.get(Q)||[]},clear:()=>{J.forEach((Q)=>{Q.length=0}),J.clear()},getSize:()=>{let Q=0;return J.forEach((Z)=>{Q+=Z.length}),Q}}};function BQ(J){let $=Boolean(J.baseUrl),Q=!$,Z=Q?J.staticItems||J.items||[]:[],q=J.pagination?.strategy||"cursor";return{items:Z,visibleItems:[],visibleRange:{start:0,end:0},totalHeight:0,totalHeightDirty:!0,itemHeights:new Map,loading:!1,cursor:null,page:q==="page"?1:void 0,paginationStrategy:q,hasNext:$,itemElements:new Map,scrollTop:0,containerHeight:0,scrollRAF:null,resizeRAF:null,mounted:!1,itemCount:Z.length,useStatic:Q,renderHook:null}}function FQ(J,$,Q,Z=!0){let q=Q.cursor??null,j=Q.hasNext??!1,K=J.page;if(Q.page!==void 0)K=Q.page;else if(q&&/^\d+$/.test(q))K=parseInt(q,10)-1;if(J.paginationStrategy==="page"&&Q.page===void 0&&!q)K=J.page;let G;if(J.paginationStrategy==="page"&&J.page===1)G=[...$];else{let z=$;if(Z&&$.length>0&&J.items.length>0){let Y=new Set;for(let U=0;U<J.items.length;U++){let X=J.items[U];if(X&&X.id)Y.add(X.id)}z=$.filter((U)=>U&&U.id&&!Y.has(U.id))}G=[...J.items,...z]}let W=Q.total!==void 0?Q.total:G.length;return{items:G,cursor:q,page:K,hasNext:j,totalHeightDirty:!0,itemCount:W}}function HQ(J,$,Q){return{visibleItems:$,visibleRange:Q}}function T1(J,$){return{totalHeight:$,totalHeightDirty:!1}}function I1(J,$){return{loading:$}}function MQ(J,$=[]){return{items:J.useStatic?[...$]:[],visibleItems:[],visibleRange:{start:0,end:0},itemElements:new Map,cursor:null,page:J.paginationStrategy==="page"?1:void 0,hasNext:!J.useStatic,totalHeightDirty:!0,itemCount:J.useStatic?$.length:0}}function kQ(J,$){let Q={};switch($||J.paginationStrategy||"cursor"){case"page":{if(J.cursor&&/^\d+$/.test(J.cursor))Q.page=parseInt(J.cursor,10);else if(J.page!==void 0)Q.page=J.page;else Q.page=1;break}case"offset":{if(J.cursor&&/^\d+$/.test(J.cursor))Q.offset=parseInt(J.cursor,10);else Q.offset=0;break}case"cursor":default:{if(J.cursor)Q.cursor=J.cursor;if(J.cursor&&/^\d+$/.test(J.cursor))Q.page=parseInt(J.cursor,10);break}}return Q}var u$=(J,$,Q)=>{Q.collection=J;let Z=o5(Q);if(!$||!($ instanceof HTMLElement))throw new Error("List manager requires a valid container element");let q=t5(Z),j=!q,K=j?n5(Z):[],G=BQ(Z);G.useStatic=j;let W=$Q($),z=ZQ(Z.itemHeight),Y=XQ(),U=GQ(Z,W,z,Y),X=C$({transform:Z.transform,initialCapacity:j?K.length:50}),_=q?h$({base:Z.baseUrl,endpoints:{list:`/${J}`},headers:{"Content-Type":"application/json"},cache:!0,pagination:Z.pagination?{strategy:Z.pagination.strategy||"cursor",...Z.pagination}:{strategy:"cursor"}}):null,H=[],B=async(L={})=>{try{if(Object.assign(G,I1(G,!0)),G.useStatic)return{items:[...G.items],meta:{cursor:null,hasNext:!1}};if(!_)throw new Error("Cannot load items: API adapter not initialized");let D=await _.read(L),R=Array.isArray(D.items)?D.items.map(Z.transform):[];if(Object.assign(G,FQ(G,R,D.meta,Z.dedupeItems)),G.paginationStrategy==="page"&&L.page===1){if(await X.clear(),R.length>0)await X.add(R)}else if(Z.dedupeItems){let w=new Set(G.items.map((x)=>x.id).filter(Boolean)),A=R.filter((x)=>!w.has(x.id));if(A.length>0)await X.add(A)}else await X.add(R);if(G.totalHeightDirty=!0,Z.afterLoad){let w=[...G.items],A={loading:!1,hasNext:G.hasNext,hasPrev:!!L.cursor||L.page&&L.page>1,items:[...R],allItems:w};Z.afterLoad(A)}if(G.paginationStrategy==="cursor"&&D.meta?.cursor)G.cursor=D.meta.cursor;else if(G.paginationStrategy==="page"&&L.page)G.page=L.page;return{items:R,meta:D.meta}}catch(D){return console.error(`Error loading ${J}:`,D),{items:[],meta:{cursor:null,hasNext:!1}}}finally{Object.assign(G,I1(G,!1))}},k=(L=G.scrollTop)=>{if(!G.mounted)return;if(G.containerHeight===0)G.containerHeight=$.clientHeight;G.scrollTop=L;let D=qQ(L,G.items,G.containerHeight,z,Z);if(D.start===G.visibleRange.start&&D.end===G.visibleRange.end)return;if(Object.assign(G,HQ(G,G.items.slice(D.start,D.end).filter(Boolean),D)),typeof z.calculateOffsets==="function")z.calculateOffsets(G.items);if(G.totalHeightDirty){let w=z.calculateTotalHeight(G.items);Object.assign(G,T1(G,w)),x1(W,w)}if(U.renderVisibleItems(G.items,D),z.measureMarkedElements(W.content,G.items)){let w=z.calculateTotalHeight(G.items);Object.assign(G,T1(G,w)),x1(W,w)}M(L)},M=(L)=>{if(G.loading||!G.hasNext)return;if(KQ(L,G.containerHeight,G.totalHeight,Z.loadThreshold))V()},V=async()=>{if(G.loading||!G.hasNext)return{hasNext:G.hasNext,items:[]};if(G.useStatic)return{hasNext:!1,items:[]};let L=Z.pagination?.strategy||"cursor";if(G.paginationStrategy=L,L==="page")if(G.cursor&&/^\d+$/.test(G.cursor))G.page=parseInt(G.cursor,10);else if(G.page!==void 0)G.page+=1;else G.page=1;let D=kQ(G,L);if(!D.limit&&!D.per_page)if(L==="page"){let w=Z.pagination?.perPageParamName||"per_page";D[w]=Z.pageSize||20}else{let w=Z.pagination?.limitParamName||"limit";D[w]=Z.pageSize||20}let R=await B(D);return k(G.scrollTop),{hasNext:G.hasNext,items:R.items}},F=async()=>{if(Object.assign(G,MQ(G,K)),Y.clear(),X.clear(),G.useStatic&&K&&K.length>0)G.items=[...K],await X.add(K);else await B();k(0)},N=(L,D="start")=>{if(typeof z.calculateOffsets==="function")z.calculateOffsets(G.items);let R=z.getItemOffset(G.items,L);if(R===-1)return;let w=R;if(D==="center")w=R-G.containerHeight/2;else if(D==="end"){let A=G.items.findIndex((I)=>I&&I.id===L);if(A===-1)return;let x=z.getItemHeight(G.items[A]);w=R-G.containerHeight+x}$.scrollTo({top:Math.max(0,w),behavior:"smooth"})},P=(()=>{G.mounted=!0;let D=WQ($,W,Z,{onScroll:k,onLoadMore:V}).setup();H.push(D);let R=X.subscribe(({event:w})=>{if(w===Y6.CHANGE)G.totalHeightDirty=!0,requestAnimationFrame(()=>{k(G.scrollTop)})});if(H.push(R),G.useStatic&&K&&K.length>0)X.add(K).then(()=>{requestAnimationFrame(()=>{k(G.scrollTop)})}).catch((w)=>{console.error("Error adding static items to collection:",w)});else if(!G.useStatic)B().then(()=>{requestAnimationFrame(()=>{k(G.scrollTop)})}).catch((w)=>{console.error("Error loading items:",w)});if("ResizeObserver"in window){let w=new ResizeObserver((A)=>{for(let x of A)if(x.target===$){let I=$.clientHeight;if(I!==G.containerHeight){if(G.containerHeight=I,G.resizeRAF)cancelAnimationFrame(G.resizeRAF);G.resizeRAF=requestAnimationFrame(()=>{k(G.scrollTop),G.resizeRAF=null})}}});w.observe($),H.push(()=>{if(w.disconnect(),G.resizeRAF)cancelAnimationFrame(G.resizeRAF),G.resizeRAF=null})}else{let w=null,A=()=>{if(w)clearTimeout(w);w=window.setTimeout(()=>{let x=$.clientHeight;if(x!==G.containerHeight)G.containerHeight=x,k(G.scrollTop);w=null},100)};window.addEventListener("resize",A,{passive:!0}),H.push(()=>{if(window.removeEventListener("resize",A),w)clearTimeout(w),w=null})}return()=>{H.forEach((w)=>w()),H.length=0,G.mounted=!1}})();return{loadItems:B,loadMore:V,refresh:F,updateVisibleItems:k,scrollToItem:N,setItemHeights:(L)=>{let D=z.setItemHeights(L);if(D)G.totalHeightDirty=!0,k(G.scrollTop);return D},getCollection:()=>X,getVisibleItems:()=>G.visibleItems,getAllItems:()=>G.items,isLoading:()=>G.loading,hasNextPage:()=>G.hasNext,isApiMode:()=>q,setRenderHook:(L)=>{U.setRenderHook(L),k(G.scrollTop)},destroy:()=>{if(P(),X.clear(),typeof z.clear==="function")z.clear();if(Y.clear(),W.content)W.content.innerHTML="";if(QQ(W),_&&typeof _.disconnect==="function")_.disconnect()}}},NQ;var S1=T(()=>{l7();w1();e5();zQ();UQ();NQ={track:(J)=>({id:J._id,headline:J.title||"Untitled",supportingText:J.artist||"Unknown Artist",meta:J.year?.toString()||""}),playlist:(J)=>({id:J._id,headline:J.name||"Untitled Playlist",supportingText:`${J.tracks?.length||0} tracks`,meta:J.creator||""}),country:(J)=>({id:J._id,headline:J.name||J.code,supportingText:J.continent||"",meta:J.code||""})}});var VQ=T(()=>{l7();l7();l7();S1();A1();w1()});var b1=(J,$,Q,Z,q,j)=>{if(Z<0||q<0)return;let K=typeof j==="number"?[j,j,j,j]:j,[G,W,z,Y]=K;J.beginPath(),J.moveTo($+G,Q),J.lineTo($+Z-W,Q),J.quadraticCurveTo($+Z,Q,$+Z,Q+W),J.lineTo($+Z,Q+q-z),J.quadraticCurveTo($+Z,Q+q,$+Z-z,Q+q),J.lineTo($+Y,Q+q),J.quadraticCurveTo($,Q+q,$,Q+q-Y),J.lineTo($,Q+G),J.quadraticCurveTo($,Q,$+G,Q),J.closePath()},vq=(J,$,Q,Z,q,j,K)=>{if(J.save(),K)J.fillStyle=K;b1(J,$,Q,Z,q,j),J.fill(),J.restore()},v1=(J,$,Q,Z,q,j)=>{return J.save(),b1(J,$,Q,Z,q,j),J.clip(),()=>J.restore()},C1=(J,$,Q,Z,q,j,K,G)=>{if(Z<0||q<0)return;if(J.save(),G)J.fillStyle=G;J.beginPath(),J.moveTo($+j,Q),J.lineTo($+Z-K,Q),J.quadraticCurveTo($+Z,Q,$+Z,Q+K),J.lineTo($+Z,Q+q-K),J.quadraticCurveTo($+Z,Q+q,$+Z-K,Q+q),J.lineTo($+j,Q+q),J.quadraticCurveTo($,Q+q,$,Q+q-j),J.lineTo($,Q+j),J.quadraticCurveTo($,Q,$+j,Q),J.closePath(),J.fill(),J.restore()},E1=(J,$,Q,Z)=>{if(Z)J.fillStyle=Z,J.fillRect(0,0,$,Q);else J.clearRect(0,0,$,Q)};var f$=(J)=>{let j=J;for(let U=0;U<4;U++){let B=j*j,M=1.6*(B*j)+-1.8000000000000003*B+1.2000000000000002*j-J,V=4.800000000000001*B+-3.6000000000000005*j+1.2000000000000002;if(Math.abs(M)<0.00001)break;j=j-M/V}let K=0,G=3-K,W=1-K-G,z=j*j,Y=z*j;return W*Y+G*z+K*j},h1,Cq;var _Q=T(()=>{h1={SHORT:100,MEDIUM:225,LONG:375,EXTRA_LONG:500},Cq={linear:(J)=>J,easeIn:(J)=>J*J,easeOut:(J)=>J*(2-J),easeInOut:(J)=>J<0.5?2*J*J:-1+(4-2*J)*J,materialStandard:f$}});class LQ{animationId=null;start(J){this.stop();let $=(Q)=>{J(Q),this.animationId=requestAnimationFrame($)};this.animationId=requestAnimationFrame($)}stop(){if(this.animationId!==null)cancelAnimationFrame(this.animationId),this.animationId=null}get isRunning(){return this.animationId!==null}}class DQ{cleanupFunctions=[];add(J){if(J)this.cleanupFunctions.push(J)}cleanup(){this.cleanupFunctions.forEach((J)=>J()),this.cleanupFunctions=[]}}var u1=(J,$,Q)=>{let Z=window.devicePixelRatio||1,q=J.getContext("2d");return J.style.width=`${$}px`,J.style.height=`${Q}px`,J.width=Math.round($*Z),J.height=Math.round(Q*Z),q.setTransform(1,0,0,1,0,0),q.scale(Z,Z),{canvas:J,ctx:q,width:$,height:Q,pixelRatio:Z}},f1=(J,$,Q)=>{let{canvas:Z,ctx:q,pixelRatio:j}=J;Z.style.width=`${$}px`,Z.style.height=`${Q}px`,Z.width=Math.round($*j),Z.height=Math.round(Q*j),J.width=$,J.height=Q,q.setTransform(1,0,0,1,0,0),q.scale(j,j)},g1=(J,$)=>{if(J())return $?.(),!0;return requestAnimationFrame(()=>{if(J())$?.();else setTimeout(()=>{if(J())$?.()},100)}),!1},g$=(J,$)=>{let Q=B6(`sys-color-${J}`,{onThemeChange:$});return typeof Q==="function"?Q:null},d1=(J,$={})=>{let Q=document.createElement("canvas");return Q.className=J,Object.assign(Q.style,{position:"absolute",width:"100%",height:"100%",pointerEvents:"none",...$}),Q};var OQ=T(()=>{Y9()});var l1=T(()=>{_Q();OQ()});var r7=T(()=>{J6();v9();d5();r5();v$();VQ();l1();y6();X1();Y9();D$()});var PQ=({disabled:J,lifecycle:$})=>(Q)=>{let Z={setText:(K)=>{return Q.text.setText(K),Z},getText:()=>Q.text.getText(),getElement:()=>Q.text.getElement()},q={setIcon:(K)=>{return Q.icon.setIcon(K),q},getIcon:()=>Q.icon.getIcon(),getElement:()=>Q.icon.getElement()},j={element:Q.element,text:Z,icon:q,disabled:J,lifecycle:$,getClass:Q.getClass,on:(K,G)=>{if(Q.on)Q.on(K,G);return j},off:(K,G)=>{if(Q.off)Q.off(K,G);return j},addClass:(...K)=>{if(Q.addClass)Q.addClass(...K);else f(Q.element,...K);return j},getValue:()=>Q.element.value,setValue(K){return Q.element.value=K,j},enable(){return J.enable(),j},disable(){return J.disable(),j},setText(K){return Q.text.setText(K),j.updateCircularStyle(),j},getText(){return Q.text.getText()},hasIcon(){let K=Q.icon.getElement();return!!K&&!!K.innerHTML.trim()&&!!K.parentNode},setIcon(K){let G=Q.componentName||"button",W=Q.getClass(G);if(!K){let z=Q.icon.getElement();if(z&&z.parentNode)z.parentNode.removeChild(z),Q.icon.getElement=()=>null,Q.icon.getIcon=()=>"";Q.element.classList.remove(`${W}--icon`)}else if(!j.hasIcon()){let z=document.createElement("span");if(z.className=`${Q.getClass("button-icon")}`,z.innerHTML=K,Q.element.firstChild)Q.element.insertBefore(z,Q.element.firstChild);else Q.element.appendChild(z);Q.icon.getElement=()=>z,Q.icon.getIcon=()=>K,Q.element.classList.add(`${W}--icon`)}else{let z=Q.icon.getElement();if(z)z.innerHTML=K}return j.updateCircularStyle(),j},getIcon(){return j.hasIcon()?Q.icon.getIcon():""},setVariant(K){let G=Q.componentName||"button",W=Q.getClass(G);return["filled","tonal","outlined","elevated","text"].map((Y)=>`${W}--${Y}`).forEach((Y)=>{Q.element.classList.remove(Y)}),Q.element.classList.add(`${W}--${K}`),j},getVariant(){let K=Q.componentName||"button",G=Q.getClass(K),W=["filled","tonal","outlined","elevated","text"];for(let z of W)if(Q.element.classList.contains(`${G}--${z}`))return z;return"filled"},getSize(){let K=Q.componentName||"button",G=Q.getClass(K),W=["xs","s","m","l","xl"];for(let z of W)if(Q.element.classList.contains(`${G}--${z}`))return z;return"s"},setSize(K){let G=Q.componentName||"button",W=Q.getClass(G);return["xs","s","m","l","xl"].map((Y)=>`${W}--${Y}`).forEach((Y)=>{Q.element.classList.remove(Y)}),Q.element.classList.add(`${W}--${K}`),j},getShape(){let K=Q.componentName||"button",G=Q.getClass(K),W=["round","square"];for(let z of W)if(Q.element.classList.contains(`${G}--${z}`))return z;return"round"},setShape(K){let G=Q.componentName||"button",W=Q.getClass(G);return["round","square"].map((Y)=>`${W}--${Y}`).forEach((Y)=>{Q.element.classList.remove(Y)}),Q.element.classList.add(`${W}--${K}`),j},setActive(K){if(K)Q.element.classList.add(`${Q.getClass("button")}--active`);else Q.element.classList.remove(`${Q.getClass("button")}--active`);return j},setAriaLabel(K){return Q.element.setAttribute("aria-label",K),j},destroy(){$.destroy()},updateCircularStyle(){let K=Q.text.getText()!=="",G=j.hasIcon();if(!K)f(Q.element,"button--circular"),q6(Q.element,"button--icon");else q6(Q.element,"button--circular");if(G&&K)f(Q.element,"button--icon")}};if(Q.progress)j.progress=Q.progress;if(Q.showProgress)j.showProgress=async()=>{return await Q.showProgress(),j};if(Q.showProgressSync)j.showProgressSync=()=>{return Q.showProgressSync(),j};if(Q.hideProgress)j.hideProgress=async()=>{return await Q.hideProgress(),j};if(Q.hideProgressSync)j.hideProgressSync=()=>{return Q.hideProgressSync(),j};if(Q.setProgress)j.setProgress=async(K)=>{return await Q.setProgress(K),j};if(Q.setProgressSync)j.setProgressSync=(K)=>{return Q.setProgressSync(K),j};if(Q.setIndeterminate)j.setIndeterminate=async(K)=>{return await Q.setIndeterminate(K),j};if(Q.setIndeterminateSync)j.setIndeterminateSync=(K)=>{return Q.setIndeterminateSync(K),j};if(Q.setLoading)j.setLoading=async(K,G)=>{return await Q.setLoading(K,G),j};if(Q.setLoadingSync)j.setLoadingSync=(K,G)=>{return Q.setLoadingSync(K,G),j};return j};var RQ=T(()=>{r7()});var p7,s7,m7,a7,r1,d9;var p1=T(()=>{p7={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",ELEVATED:"elevated",TEXT:"text"},s7={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},m7={ROUND:"round",SQUARE:"square"},a7={BUTTON:"button",SUBMIT:"submit",RESET:"reset"},r1={ROOT:"button",ICON:"button-icon",TEXT:"button-text",CIRCULAR:"button-circular",ACTIVE:"button-active",DISABLED:"button-disabled"},d9={DURATION:450,TIMING:"cubic-bezier(0.4, 0.0, 0.2, 1)",OPACITY:["0.7","0"]}});var Eq,AQ=(J={})=>d(Eq,J,"button"),wQ=(J)=>{let $={type:J.type||"button"};if(J.disabled===!0)$.disabled=!0;if(J.value!==void 0)$.value=J.value;if(J.ariaLabel)$["aria-label"]=J.ariaLabel;return p(J,{tag:"button",attributes:$,className:J.class,forwardEvents:{click:(Q)=>!Q.element.disabled,focus:!0,blur:!0}})},xQ=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable(),isDisabled:()=>J.disabled.isDisabled()},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var yQ=T(()=>{t();p1();Eq={variant:p7.FILLED,size:s7.S,shape:m7.ROUND,disabled:!1,type:a7.BUTTON,ripple:!0,rippleConfig:{duration:d9.DURATION,timing:d9.TIMING,opacity:d9.OPACITY}}});var hq=(J={})=>{let $=AQ(J);try{return b(S,g(),E(wQ($)),K6($),O7($),K9($),G9($),G6($),E5($),T6($),C(),(Z)=>{if($.shape&&Z.element){let q=`${$.prefix}-${$.componentName}--${$.shape}`;Z.element.classList.add(q)}return Z},(Z)=>PQ(xQ(Z))(Z))($)}catch(Q){throw console.error("Button creation error:",Q),new Error(`Failed to create button: ${Q.message}`)}},e6;var TQ=T(()=>{J6();c();o();h5();RQ();yQ();e6=hq});var IQ={};E8(IQ,{default:()=>e6});var l9=T(()=>{TQ()});var wK={};E8(wK,{withVariant:()=>K6,withTrack:()=>A7,withThrottle:()=>p8,withTextLabel:()=>z9,withTextInput:()=>R7,withText:()=>K9,withTapGesture:()=>l4,withTabsManagement:()=>O8,withSwipeable:()=>gQ,withSwipeGesture:()=>p4,withSupportingText:()=>M8,withStyle:()=>l8,withSize:()=>O7,withScrollable:()=>P8,withRipple:()=>T6,withPosition:()=>P7,withPanGesture:()=>c4,withLongPressGesture:()=>m4,withLoading:()=>uQ,withLifecycle:()=>C,withInput:()=>I9,withIndicator:()=>A8,withIcon:()=>G9,withGestures:()=>G1,withExpandable:()=>fQ,withEvents:()=>g,withEnhancedEvents:()=>r8,withElevation:()=>p$,withElement:()=>E,withDivider:()=>R8,withDisabled:()=>G6,withDebounce:()=>s8,withCheckable:()=>S9,withAPI:()=>d$,when:()=>M5,updateTabPanels:()=>_8,updateCanvasDimensions:()=>f1,transforms:()=>NQ,transform:()=>z4,toggleClass:()=>g8,throttle:()=>$7,setupResponsiveBehavior:()=>e2,setupKeyboardNavigation:()=>L8,setGlobalDefaults:()=>Y1,setComponentDefaults:()=>W1,setAttributes:()=>h8,removeClass:()=>q6,removeAttributes:()=>Y4,processSchema:()=>S$,processClassNames:()=>h9,pipe:()=>b,once:()=>L$,observeCanvasResize:()=>C7,normalizeEvent:()=>p6,normalizeClasses:()=>o6,loggingMiddleware:()=>f5,jsxs:()=>RK,jsxDEV:()=>AK,jsx:()=>PK,joinClasses:()=>k5,isObject:()=>m6,isJsxSchema:()=>D1,isComponent:()=>w6,initializeCanvasWithRetry:()=>g1,hasTouchSupport:()=>v6,hasLifecycle:()=>M6,hasEmit:()=>k6,hasClass:()=>O6,h:()=>q7,getModifierClass:()=>X4,getLayoutType:()=>f9,getInheritedBackground:()=>_9,getElementClass:()=>B4,getComponentDefaults:()=>T7,getComponentClass:()=>U4,flattenLayout:()=>w$,fillRoundedRectLR:()=>C1,fillRoundedRect:()=>vq,easeOutCubic:()=>f$,deriveFiltered:()=>g5,debounce:()=>J7,createTopAppBar:()=>H3,createTooltip:()=>E0,createTimePicker:()=>I0,createTextfield:()=>Y$,createTabsState:()=>i2,createTabs:()=>$3,createTabIndicator:()=>D8,createTab:()=>H7,createSwitch:()=>z0,createStyledCanvas:()=>d1,createStore:()=>u5,createStateEventManager:()=>_$,createSnackbar:()=>G0,createSlider:()=>Z0,createSheet:()=>cJ,createSelect:()=>r0,createSegmentedButton:()=>U8,createSegment:()=>Y8,createSearch:()=>vJ,createSVGElement:()=>V4,createRouteAdapter:()=>h$,createRoundedRectPath:()=>b1,createRadios:()=>OJ,createProgress:()=>A$,createNavigationSystem:()=>d3,createNavigation:()=>W7,createMenu:()=>Q$,createListManager:()=>u$,createList:()=>f0,createLifecycle:()=>l5,createLayoutResult:()=>n6,createLayout:()=>g9,createJsxLayout:()=>a5,createGestureManager:()=>x7,createFab:()=>o$,createExtendedFab:()=>t$,createEventManager:()=>F5,createEmitter:()=>C6,createElement:()=>v,createDivider:()=>s9,createDisabled:()=>p5,createDialog:()=>XJ,createDatePicker:()=>UJ,createComponentInstance:()=>u9,createComponent:()=>W4,createCollection:()=>C$,createChips:()=>jZ,createChip:()=>t7,createCheckbox:()=>$J,createCarousel:()=>e1,createCardMedia:()=>K7,createCardHeader:()=>i7,createCardContent:()=>c7,createCardActions:()=>j7,createCard:()=>i1,createCanvasThemeObserver:()=>g$,createCanvasContext:()=>u1,createButton:()=>e6,createBottomAppBar:()=>B5,createBaseAdapter:()=>E$,createBase:()=>S,createBadge:()=>e9,compose:()=>G4,clipRoundedRect:()=>v1,clearGlobalDefaults:()=>U1,clearCanvas:()=>E1,cleanupLayoutClasses:()=>_1,classNames:()=>F4,byString:()=>M1,applyLayoutItemClasses:()=>I$,applyLayoutClasses:()=>T$,addScrollIndicators:()=>n2,addClass:()=>f,TOP_APP_BAR_TYPES:()=>S8,TOP_APP_BAR_STATES:()=>S0,TOP_APP_BAR_DEFAULTS:()=>H9,TOP_APP_BAR_CLASSES:()=>b0,TOOLTIP_VARIANTS:()=>v8,TOOLTIP_POSITIONS:()=>b8,TOOLTIP_EVENTS:()=>v0,TOOLTIP_DEFAULTS:()=>l6,TOOLTIP_CLASSES:()=>C0,TIME_PICKER_TYPE:()=>k7,TIME_PICKER_ORIENTATION:()=>U$,TIME_PERIOD:()=>o9,TIME_FORMAT:()=>i9,TIMEPICKER_Z_INDEX:()=>N7,TIMEPICKER_VALUES:()=>y0,TIMEPICKER_TYPES:()=>x8,TIMEPICKER_SELECTORS:()=>Q6,TIMEPICKER_PERIODS:()=>x0,TIMEPICKER_ORIENTATIONS:()=>y8,TIMEPICKER_ICONS:()=>g6,TIMEPICKER_FORMATS:()=>T8,TIMEPICKER_EVENTS:()=>_6,TIMEPICKER_DIAL:()=>Z9,TIMEPICKER_DEFAULTS:()=>i6,TIMEPICKER_CLASSES:()=>T0,TEXTFIELD_VARIANTS:()=>W$,TEXTFIELD_TYPES:()=>w8,TEXTFIELD_STATES:()=>P0,TEXTFIELD_EVENTS:()=>R0,TEXTFIELD_DENSITY:()=>A0,TEXTFIELD_DEFAULTS:()=>M7,TEXTFIELD_CLASSES:()=>w0,TAB_VARIANTS:()=>z$,TAB_STATES:()=>B7,TAB_INDICATOR_WIDTH_STRATEGIES:()=>N8,TAB_EVENTS:()=>B0,TAB_CLASSES:()=>H0,TABS_EVENTS:()=>V8,TABS_DEFAULTS:()=>w9,TABS_CLASSES:()=>F0,SelectionMode:()=>q$,SWITCH_STATES:()=>W0,SWITCH_LABEL_POSITIONS:()=>k8,SWITCH_EVENTS:()=>Y0,SWITCH_DEFAULTS:()=>U0,SWITCH_CLASSES:()=>X0,STATES:()=>f8,SNACKBAR_VARIANTS:()=>H8,SNACKBAR_STATES:()=>q0,SNACKBAR_POSITIONS:()=>Q9,SNACKBAR_EVENTS:()=>j0,SNACKBAR_DEFAULTS:()=>c9,SNACKBAR_CLASSES:()=>K0,SLIDER_SIZES:()=>D6,SLIDER_POSITIONS:()=>K$,SLIDER_EVENTS:()=>H6,SLIDER_DEFAULTS:()=>N6,SLIDER_COLORS:()=>J9,SLIDER_CLASSES:()=>oJ,SHEET_VARIANTS:()=>A9,SHEET_POSITIONS:()=>a9,SHEET_GESTURE:()=>mJ,SHEET_EVENTS:()=>pJ,SHEET_ELEVATION:()=>X8,SHEET_DEFAULTS:()=>F9,SHEET_CLASSES:()=>aJ,SHEET_ANIMATION:()=>sJ,SELECT_VARIANTS:()=>_7,SELECT_PLACEMENT:()=>L7,SELECT_INTERACTION:()=>H$,SELECT_ICONS:()=>k$,SELECT_EVENTS:()=>M$,SELECT_DEFAULTS:()=>y9,SELECT_CLASSES:()=>N$,SEGMENTED_BUTTON_MODES:()=>z8,SEGMENTED_BUTTON_ICONS:()=>EJ,SEGMENTED_BUTTON_EVENTS:()=>CJ,SEGMENTED_BUTTON_DENSITY:()=>W8,SEGMENTED_BUTTON_DEFAULTS:()=>m9,SEGMENTED_BUTTON_CLASSES:()=>hJ,SEARCH_VARIANTS:()=>Y7,SEARCH_STATES:()=>IJ,SEARCH_ICONS:()=>U7,SEARCH_EVENTS:()=>SJ,SEARCH_DEFAULTS:()=>c6,SEARCH_CLASSES:()=>bJ,RADIO_VARIANTS:()=>q8,RADIO_STATES:()=>PJ,RADIO_SIZES:()=>K8,RADIO_LABEL_POSITIONS:()=>j8,RADIO_EVENTS:()=>RJ,RADIO_DIRECTIONS:()=>Z8,RADIO_DEFAULTS:()=>AJ,RADIO_CLASSES:()=>wJ,PROGRESS_VARIANTS:()=>W9,PROGRESS_THICKNESS:()=>u6,PROGRESS_SHAPES:()=>I6,PROGRESS_MEASUREMENTS:()=>s6,PROGRESS_EVENTS:()=>Z7,PROGRESS_DEFAULTS:()=>h6,PROGRESS_CLASSES:()=>z6,PREFIX:()=>u,OPERATORS:()=>x6,NAV_VARIANTS:()=>e$,NAV_POSITIONS:()=>$8,NAV_ITEM_STATES:()=>LJ,NAV_EVENTS:()=>Z$,NAV_DEFAULTS:()=>B9,NAV_CLASSES:()=>n,NAV_BEHAVIORS:()=>J8,MONTH_NAMES_SHORT:()=>i0,MONTH_NAMES:()=>c0,MENU_POSITION:()=>n$,MENU_ITEM_TYPES:()=>VJ,MENU_INTERACTION_TYPES:()=>NJ,MENU_EVENTS:()=>_J,MENU_DEFAULTS:()=>a6,MENU_CLASSES:()=>J$,LIST_TYPES:()=>X$,LIST_SELECTION_MODES:()=>B$,LIST_SCROLL_POSITIONS:()=>F$,LIST_EVENTS:()=>k9,LIST_DEFAULTS:()=>j9,LIST_CLASSES:()=>e,Fragment:()=>P1,FAB_VARIANTS:()=>Z4,FAB_SIZES:()=>q4,FAB_POSITIONS:()=>j4,EASING_FUNCTIONS:()=>Cq,Density:()=>j$,DIALOG_SIZES:()=>t0,DIALOG_FOOTER_ALIGNMENTS:()=>e0,DIALOG_BUTTON_VARIANTS:()=>$4,DIALOG_ANIMATIONS:()=>n0,DEFAULT_RIPPLE_CONFIG:()=>d9,DEFAULT_DATE_FORMAT:()=>o0,DEFAULT_CONFIRM_BUTTON_TEXT:()=>J4,DEFAULT_CANCEL_BUTTON_TEXT:()=>Q4,DAY_NAMES:()=>a0,DATEPICKER_VIEWS:()=>s0,DATEPICKER_VARIANTS:()=>p0,DATEPICKER_SELECTION_MODES:()=>m0,CleanupManager:()=>DQ,COMPONENTS:()=>u8,COLLECTION_OPERATORS:()=>i5,COLLECTION_EVENTS:()=>Y6,CHIP_VARIANTS:()=>KJ,CHIP_EVENTS:()=>GJ,CHIPS_EVENTS:()=>X9,CHECKBOX_VARIANTS:()=>s$,CHECKBOX_STATES:()=>JJ,CHECKBOX_LABEL_POSITION:()=>m$,CHECKBOX_CLASSES:()=>QJ,CAROUSEL_TRANSITIONS:()=>o7,CAROUSEL_SCROLL_BEHAVIORS:()=>o1,CAROUSEL_LAYOUTS:()=>U9,CAROUSEL_ITEM_SIZES:()=>dQ,CAROUSEL_EVENTS:()=>p9,CAROUSEL_DEFAULTS:()=>F6,CARD_WIDTHS:()=>l$,CARD_VARIANTS:()=>O9,CARD_MEDIA_POSITION:()=>a1,CARD_ELEVATIONS:()=>G7,CARD_CORNER_RADIUS:()=>s1,CARD_CLASSES:()=>c1,CARD_ASPECT_RATIOS:()=>r$,CARD_ACTION_ALIGNMENT:()=>m1,BUTTON_VARIANTS:()=>p7,BUTTON_TYPES:()=>a7,BUTTON_SIZES:()=>s7,BUTTON_SHAPES:()=>m7,BUTTON_CLASSES:()=>r1,BADGE_VARIANTS:()=>I7,BADGE_POSITIONS:()=>b7,BADGE_MAX_CHARACTERS:()=>b9,BADGE_COLORS:()=>S7,AnimationFrameManager:()=>LQ,ANIMATION_DURATIONS:()=>h1});module.exports=o3(wK);var j9={COLLECTION:"items",BASE_URL:"http://localhost:4000/api",PAGE_SIZE:20,RENDER_BUFFER_SIZE:5,ITEM_HEIGHT:48},X$={DEFAULT:"default",SINGLE_SELECT:"single-select",MULTI_SELECT:"multi-select"},B$={NONE:"none",SINGLE:"single",MULTIPLE:"multiple"},k9={SELECT:"select",LOAD:"load",SCROLL:"scroll"},F$={START:"start",CENTER:"center",END:"end"},e={CONTAINER:"list-container",LIST:"list",ITEM:"list-item",SELECTED:"list-item--selected",LOADING:"list--loading",EMPTY:"list--empty"};var _7={FILLED:"filled",OUTLINED:"outlined"},L7={BOTTOM_START:"bottom-start",BOTTOM:"bottom",BOTTOM_END:"bottom-end",TOP_START:"top-start",TOP:"top",TOP_END:"top-end"},H$={MOUSE:"mouse",KEYBOARD:"keyboard"},M$={CHANGE:"change",OPEN:"open",CLOSE:"close"},k$={DROPDOWN:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M7 10l5 5 5-5z"/></svg>',CHECKMARK:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>'},y9={VARIANT:_7.FILLED,PLACEMENT:L7.BOTTOM_START,LABEL:"Select",VALUE:"",REQUIRED:!1,DISABLED:!1,SUPPORTING_TEXT:"",ERROR:!1},N$={CONTAINER:"select",TEXTFIELD:"select__textfield",DROPDOWN_ICON:"select__dropdown-icon",MENU:"select__menu",MENU_ITEM:"select__menu-item",MENU_ITEM_SELECTED:"select__menu-item--selected",MENU_ITEM_DISABLED:"select__menu-item--disabled",MENU_ITEM_CHECKMARK:"select__menu-item-checkmark",MENU_ITEM_ICON:"select__menu-item-icon",MENU_ITEM_TEXT:"select__menu-item-text",FILLED:"select--filled",OUTLINED:"select--outlined",OPEN:"select--open",DISABLED:"select--disabled",REQUIRED:"select--required",ERROR:"select--error"};w7();J6();t();var F1={CENTER:"center",END:"end"},H1=300;var Lq={tag:"div",hasFab:!1,fabPosition:F1.END,autoHide:!1,transitionDuration:H1},U5=(J={})=>d(Lq,J,"bottom-app-bar");var X5=(J={})=>{let $=U5(J),Q=S($),Z=document.createElement("div");Z.className=`${Q.getClass("bottom-app-bar")}-actions`;let q=document.createElement("div");q.className=`${Q.getClass("bottom-app-bar")}-fab-container`;let j=E({tag:$.tag,componentName:"bottom-app-bar",className:[$.hasFab?`${Q.getClass("bottom-app-bar")}--with-fab`:"",$.fabPosition==="center"?`${Q.getClass("bottom-app-bar")}--fab-center`:"",$.class],attributes:{role:"toolbar","aria-label":"Bottom app bar"},interactive:!0})(Q),K=g()(j),G=C()(K);G.element.appendChild(Z),G.element.appendChild(q);let W=!0,z=window.scrollY;if($.autoHide){let U=()=>{let _=window.scrollY;if(_>z+10){if(W)Y.hide(),$.onVisibilityChange?.(!1)}else if(_<z-10){if(!W)Y.show(),$.onVisibilityChange?.(!0)}z=_};window.addEventListener("scroll",U,{passive:!0});let X=G.lifecycle.destroy;G.lifecycle.destroy=()=>{window.removeEventListener("scroll",U),X()}}let Y={...G,addAction(U){return Z.appendChild(U),this},addFab(U){return q.innerHTML="",q.appendChild(U),this.element.classList.add(`${Q.getClass("bottom-app-bar")}--with-fab`),this},show(){return this.element.classList.remove(`${Q.getClass("bottom-app-bar")}--hidden`),W=!0,this},hide(){return this.element.classList.add(`${Q.getClass("bottom-app-bar")}--hidden`),W=!1,this},isVisible(){return W},getActionsContainer(){return Z}};if($.autoHide&&$.transitionDuration)Y.element.style.transition=`transform ${$.transitionDuration}ms ease-in-out`;return Y};var B5=X5;l9();J6();c();o();var d$=({lifecycle:J})=>($)=>({...$,element:$.element,addContent(Q){if(Q&&Q.classList.contains(`${$.getClass("card")}-content`))$.element.appendChild(Q);return this},setHeader(Q){if(Q&&Q.classList.contains(`${$.getClass("card")}-header`)){let Z=$.element.querySelector(`.${$.getClass("card")}-header`);if(Z)Z.remove();if($.element.querySelector(`.${$.getClass("card")}-media`)){let j=$.element.querySelectorAll(`.${$.getClass("card")}-media`),K=j[j.length-1];if(K.nextSibling)$.element.insertBefore(Q,K.nextSibling);else $.element.appendChild(Q)}else $.element.insertBefore(Q,$.element.firstChild)}return this},addMedia(Q,Z="top"){if(Q&&Q.classList.contains(`${$.getClass("card")}-media`))if(Z==="top")$.element.insertBefore(Q,$.element.firstChild);else $.element.appendChild(Q);return this},setActions(Q){if(Q&&Q.classList.contains(`${$.getClass("card")}-actions`)){let Z=$.element.querySelector(`.${$.getClass("card")}-actions`);if(Z)Z.remove();$.element.appendChild(Q)}return this},makeDraggable(Q){if($.element.setAttribute("draggable","true"),$.element.setAttribute("aria-grabbed","false"),typeof Q==="function")$.element.addEventListener("dragstart",(Z)=>{$.element.setAttribute("aria-grabbed","true"),Q(Z)}),$.element.addEventListener("dragend",()=>{$.element.setAttribute("aria-grabbed","false")});return this},focus(){return $.element.focus(),this},destroy(){J.destroy()}});t();y6();J6();c();A6();var c7=(J={})=>{let $={...J,componentName:"card-content",prefix:u};try{let Q=b(S,E({tag:"div",componentName:"card-content",className:[J.class,J.padding===!1?`${u}-card-content--no-padding`:null],attributes:{role:"region",style:"display: block; color: inherit;"}}))($);if(J.html)Q.element.innerHTML=J.html;else if(J.text)Q.element.innerHTML=`<p>${J.text}</p>`;if(Array.isArray(J.children))J.children.forEach((Z)=>{if(Z instanceof HTMLElement)Q.element.appendChild(Z)});return Q.element.classList.add("debug-content"),Q.element}catch(Q){throw console.error("Card content creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card content: ${Q instanceof Error?Q.message:String(Q)}`)}},i7=(J={})=>{let $={...J,componentName:"card-header",prefix:u};try{let Q=b(S,E({tag:"div",componentName:"card-header",className:J.class,attributes:{role:"heading","aria-level":"3"}}))($),Z=v({tag:"div",className:`${u}-card-header-text`,container:Q.element});if(J.title){v({tag:"h3",className:`${u}-card-header-title`,text:J.title,container:Z,attributes:{id:`${Q.element.id||"card-header"}-title`}});let q=Q.element.closest(`.${u}-card`);if(q&&!q.hasAttribute("aria-labelledby"))q.setAttribute("aria-labelledby",`${Q.element.id||"card-header"}-title`)}if(J.subtitle)v({tag:"h4",className:`${u}-card-header-subtitle`,text:J.subtitle,container:Z});if(J.avatar){let q=typeof J.avatar==="string"?v({tag:"div",className:`${u}-card-header-avatar`,html:J.avatar}):J.avatar,j=q.querySelector("img");if(j&&!j.hasAttribute("alt"))j.setAttribute("alt",""),j.setAttribute("aria-hidden","true");Q.element.insertBefore(q,Q.element.firstChild)}if(J.action){let q=typeof J.action==="string"?v({tag:"div",className:`${u}-card-header-action`,html:J.action}):J.action;Q.element.appendChild(q)}return Q.element}catch(Q){throw console.error("Card header creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card header: ${Q instanceof Error?Q.message:String(Q)}`)}},j7=(J={})=>{let $={...J,componentName:"card-actions",prefix:u};try{let Q=b(S,E({tag:"div",componentName:"card-actions",className:[J.class,J.fullBleed?`${u}-card-actions--full-bleed`:null,J.vertical?`${u}-card-actions--vertical`:null,J.align?`${u}-card-actions--${J.align}`:null],attributes:{role:"group"}}))($);if(Array.isArray(J.actions))J.actions.forEach((Z,q)=>{if(Z instanceof HTMLElement){if(!Z.hasAttribute("aria-label")&&!Z.hasAttribute("aria-labelledby")&&Z.textContent?.trim()==="")Z.setAttribute("aria-label",`Action ${q+1}`);Q.element.appendChild(Z)}});return Q.element}catch(Q){throw console.error("Card actions creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card actions: ${Q instanceof Error?Q.message:String(Q)}`)}},K7=(J={})=>{let $={...J,componentName:"card-media",prefix:u};try{let Q=b(S,E({tag:"div",componentName:"card-media",className:[J.class,J.aspectRatio?`${u}-card-media--${J.aspectRatio.replace(":","-")}`:null,J.contain?`${u}-card-media--contain`:null]}))($);if(J.element instanceof HTMLElement)Q.element.appendChild(J.element);else if(J.src){let Z=document.createElement("img");if(Z.src=J.src,Z.className=`${u}-card-media-img`,Z.alt=J.alt||"",!J.alt)Z.setAttribute("aria-hidden","true");Q.element.appendChild(Z)}return Q.element}catch(Q){throw console.error("Card media creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card media: ${Q instanceof Error?Q.message:String(Q)}`)}};var O9={ELEVATED:"elevated",FILLED:"filled",OUTLINED:"outlined"},G7={LEVEL0:0,LEVEL1:1,LEVEL2:2,LEVEL4:4},l$={SMALL:"344px",MEDIUM:"480px",LARGE:"624px",FULL:"100%"},s1={SMALL:"8px",MEDIUM:"12px",LARGE:"16px"},r$={SQUARE:"1:1",STANDARD:"4:3",WIDESCREEN:"16:9"},m1={START:"start",CENTER:"center",END:"end",SPACE_BETWEEN:"space-between"},a1={TOP:"top",BOTTOM:"bottom"},c1={ROOT:"card",HEADER:"card-header",TITLE:"card-title",SUBTITLE:"card-subtitle",AVATAR:"card-avatar",HEADER_ACTION:"card-header-action",CONTENT:"card-content",MEDIA:"card-media",ACTIONS:"card-actions",DRAGGABLE:"card-draggable",INTERACTIVE:"card-interactive",FULL_WIDTH:"card-full-width",CLICKABLE:"card-clickable",LOADING:"card-loading",EXPANDED:"card-expanded",ELEVATION_PREFIX:"card-elevation-"};var uq={variant:O9.ELEVATED,interactive:!1,fullWidth:!1,clickable:!1,draggable:!1},SQ=(J)=>{let $={...J};if(J.header)$.headerConfig=J.header;if(J.content)$.contentConfig=J.content;if(J.media)$.mediaConfig=J.media;if(J.actions)$.actionsConfig=J.actions;return $},bQ=(J,$)=>{if($.mediaConfig&&(!$.mediaConfig.position||$.mediaConfig.position==="top")){let Q=K7({...$.mediaConfig,position:void 0});J.addMedia(Q,"top")}if($.headerConfig){let Q=i7($.headerConfig);J.setHeader(Q)}if($.contentConfig){let Q=c7($.contentConfig);J.addContent(Q)}if($.mediaConfig&&$.mediaConfig.position==="bottom"){let Q=K7({...$.mediaConfig,position:void 0});J.addMedia(Q,"bottom")}if($.actionsConfig){let Q=j7($.actionsConfig);J.setActions(Q)}if(Array.isArray($.buttons)&&$.buttons.length>0)Promise.resolve().then(() => (l9(),IQ)).then(({default:Q})=>{let Z=$.buttons.map((j)=>Q(j).element),q=j7({actions:Z,align:$.actionsConfig?.align||"end"});J.setActions(q)}).catch((Q)=>{console.error("Error processing buttons:",Q)})},vQ=(J={})=>d(uq,J,"card"),CQ=(J)=>{let $=J.interactive||J.clickable,Q=$?"button":"region",Z={};if(J.aria)Object.entries(J.aria).forEach(([q,j])=>{if(j!==void 0){let K=q.startsWith("aria-")?q:`aria-${q}`;Z[K]=j}});if(!Z.role&&!J.aria?.role)Z.role=Q;if($&&!Z.tabindex)Z.tabindex="0";return p(J,{tag:"div",className:[J.class,J.fullWidth?`${J.prefix}-card--full-width`:null,$?`${J.prefix}-card--interactive`:null],attributes:Z,forwardEvents:{click:()=>!!J.clickable,mouseenter:()=>!!$,mouseleave:()=>!!$,keydown:()=>!!$,focus:()=>!!$,blur:()=>!!$},interactive:$})},EQ=(J)=>({lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}}),r9=G7,hQ=(J)=>{let $=J.config;if($.interactive||$.clickable)J.element.addEventListener("mouseenter",()=>{if($.variant===O9.ELEVATED)J.element.style.setProperty("--card-elevation",String(r9.LEVEL2))}),J.element.addEventListener("mouseleave",()=>{if($.variant===O9.ELEVATED)J.element.style.setProperty("--card-elevation",String(r9.LEVEL1))}),J.element.addEventListener("keydown",(Z)=>{if((Z.key==="Enter"||Z.key===" ")&&$.clickable)Z.preventDefault(),J.element.click()}),J.element.addEventListener("focus",()=>{J.element.classList.add(`${J.getClass("card")}--focused`)}),J.element.addEventListener("blur",()=>{J.element.classList.remove(`${J.getClass("card")}--focused`)});if($.draggable)J.element.setAttribute("draggable","true"),J.element.addEventListener("dragstart",(Z)=>{if(J.element.style.setProperty("--card-elevation",String(r9.LEVEL4)),J.element.classList.add(`${J.getClass("card")}--dragging`),J.emit?.("dragstart",{event:Z}),Z.dataTransfer){let q=J.element.querySelector(`.${J.getClass("card")}-header-title`)?.textContent||"Card";Z.dataTransfer.setData("text/plain",q)}}),J.element.addEventListener("dragend",(Z)=>{J.element.style.setProperty("--card-elevation",String(r9.LEVEL1)),J.element.classList.remove(`${J.getClass("card")}--dragging`),J.emit?.("dragend",{event:Z})});return J};y6();A6();var uQ=(J={})=>($)=>{let Q=J.initialState||!1,Z=null,q=Q;function j(K){if(q=K,K&&!Z)Z=v({tag:"div",className:`${u}-card-loading-overlay`,container:$.element,attributes:{role:"progressbar","aria-busy":"true","aria-label":"Loading"}}),v({tag:"div",className:`${u}-card-loading-spinner`,container:Z}),$.element.classList.add(`${u}-card--state-loading`),$.element.setAttribute("aria-busy","true");else if(!K&&Z)Z.remove(),Z=null,$.element.classList.remove(`${u}-card--state-loading`),$.element.setAttribute("aria-busy","false")}if(Q)j(!0);return{...$,loading:{isLoading:()=>q,setLoading:j}}},p$=(J)=>{if(J.config.variant==="elevated")J.element.style.setProperty("--card-elevation",String(r9.LEVEL1));else J.element.style.setProperty("--card-elevation",String(r9.LEVEL0));return J},fQ=(J={})=>($)=>{let Q=J.initialExpanded||!1,Z=Q,q=J.expandableContent,j=v({tag:"button",className:`${u}-card-expand-button`,attributes:{"aria-expanded":Z?"true":"false","aria-label":Z?"Collapse content":"Expand content","aria-controls":q?.id||`${$.element.id||"card"}-expandable-content`}}),K=$.element.querySelector(`.${u}-card-actions`);if(K)K.appendChild(j);else v({tag:"div",className:`${u}-card-actions`,container:$.element,attributes:{role:"group"}}).appendChild(j);if(q){if(q.classList.add(`${u}-card-expandable-content`),!q.id)q.id=`${$.element.id||"card"}-expandable-content`;if(!Q)q.style.display="none",q.setAttribute("aria-hidden","true");else q.setAttribute("aria-hidden","false");$.element.appendChild(q)}function G(z){if(Z=z,q)q.style.display=z?"block":"none",q.setAttribute("aria-hidden",z?"false":"true");if(j.setAttribute("aria-expanded",z?"true":"false"),j.setAttribute("aria-label",z?"Collapse content":"Expand content"),z)$.element.classList.add(`${u}-card--expanded`);else $.element.classList.remove(`${u}-card--expanded`);$.emit?.("expandedChanged",{expanded:z})}function W(){G(!Z)}return j.addEventListener("click",(z)=>{z.stopPropagation(),W()}),j.addEventListener("keydown",(z)=>{if(z.key==="Enter"||z.key===" ")z.preventDefault(),W()}),{...$,expandable:{isExpanded:()=>Z,setExpanded:G,toggleExpanded:W}}},gQ=(J={})=>($)=>{let Q=J.threshold||100,Z=0,q=0;$.element.setAttribute("aria-description","Swipeable card. Swipe left or right to perform actions.");let j=v({tag:"button",className:`${u}-card-swipe-left-action`,text:"Swipe Left Action",container:$.element,attributes:{"aria-label":"Perform swipe left action",style:"position: absolute; left: -9999px; top: -9999px; visibility: hidden;"}}),K=v({tag:"button",className:`${u}-card-swipe-right-action`,text:"Swipe Right Action",container:$.element,attributes:{"aria-label":"Perform swipe right action",style:"position: absolute; left: -9999px; top: -9999px; visibility: hidden;"}});j.addEventListener("click",()=>{if(J.onSwipeLeft)$.element.style.transform="translateX(-100%)",$.element.style.transition="transform 0.3s ease",J.onSwipeLeft($)}),K.addEventListener("click",()=>{if(J.onSwipeRight)$.element.style.transform="translateX(100%)",$.element.style.transition="transform 0.3s ease",J.onSwipeRight($)});function G(Y){Z=Y.touches[0].clientX,$.element.style.transition="none"}function W(Y){if(!Z)return;q=Y.touches[0].clientX;let U=q-Z;$.element.style.transform=`translateX(${U}px)`}function z(){if(!Z)return;$.element.style.transition="transform 0.3s ease";let Y=q-Z;if(Math.abs(Y)>=Q)if(Y>0&&J.onSwipeRight)$.element.style.transform="translateX(100%)",J.onSwipeRight($);else if(Y<0&&J.onSwipeLeft)$.element.style.transform="translateX(-100%)",J.onSwipeLeft($);else $.element.style.transform="translateX(0)";else $.element.style.transform="translateX(0)";Z=0,q=0}return $.element.addEventListener("touchstart",G),$.element.addEventListener("touchmove",W),$.element.addEventListener("touchend",z),$.element.classList.add(`${u}-card--swipeable`),{...$,swipeable:{reset:()=>{$.element.style.transition="transform 0.3s ease",$.element.style.transform="translateX(0)"}}}};var fq=(J={})=>{let $=SQ(J),Q=vQ($);try{let Z=b(S,g(),E(CQ(Q)),K6(Q),Q.clickable?T6(Q):(q)=>q,C(),hQ,p$,(q)=>d$(EQ(q))(q))(Q);return bQ(Z,$),Z}catch(Z){throw console.error("Card creation error:",Z instanceof Error?Z.message:String(Z)),new Error(`Failed to create card: ${Z instanceof Error?Z.message:String(Z)}`)}},i1=fq;J6();c();o();var U9={MULTI_BROWSE:"multi-browse",UNCONTAINED:"uncontained",HERO:"hero",FULL_SCREEN:"full-screen"},o1={DEFAULT:"default",SNAP:"snap"},dQ={LARGE:"large",MEDIUM:"medium",SMALL:"small"},o7={SLIDE:"slide",FADE:"fade",NONE:"none"},p9={SLIDE_CHANGE:"slide-change",SLIDE_CHANGED:"slide-changed",RESIZE:"resize"},F6={INITIAL_SLIDE:0,LOOP:!0,TRANSITION:o7.SLIDE,TRANSITION_DURATION:300,BORDER_RADIUS:16,GAP:8,LAYOUT:U9.MULTI_BROWSE,SCROLL_BEHAVIOR:o1.SNAP,SMALL_ITEM_WIDTH:48,ITEM_WIDTHS:{[U9.MULTI_BROWSE]:{LARGE:240,MEDIUM:180,SMALL:48},[U9.UNCONTAINED]:{LARGE:240,MEDIUM:240,SMALL:240},[U9.HERO]:{LARGE:300,MEDIUM:240,SMALL:48},[U9.FULL_SCREEN]:{LARGE:"100%",MEDIUM:"100%",SMALL:"100%"}}};var t1=(J)=>($)=>{let Q={...$},Z=J.layout||F6.LAYOUT,q=()=>{let F=document.createElement("div");return F.className=`${$.getClass("carousel")}-wrapper`,F.dataset.layout=Z,$.element.appendChild(F),F},j=document.createElement("div");if(j.className=`${$.getClass("carousel")}-slides`,j.setAttribute("role","list"),j.setAttribute("aria-label","Carousel Slides"),J.scrollBehavior==="snap")j.dataset.snapScroll="true";j.dataset.gap=`${J.gap||F6.GAP}`;let K=q();K.appendChild(j);let G=J.initialSlide||0,W=0,z=[],Y=[];function U(F){if(Y[F]?.size)return Y[F].size;switch(Z){case"multi-browse":if(F===0||F===1)return"large";if(F===2)return"medium";return"small";case"uncontained":return"large";case"hero":return F===0?"large":"small";case"full-screen":return"large";default:return"large"}}function X(){let F=j.clientWidth,N=typeof F6.ITEM_WIDTHS[Z].LARGE==="number"?F6.ITEM_WIDTHS[Z].LARGE:F,O=typeof F6.ITEM_WIDTHS[Z].MEDIUM==="number"?F6.ITEM_WIDTHS[Z].MEDIUM:F*0.75,P=typeof F6.ITEM_WIDTHS[Z].SMALL==="number"?F6.ITEM_WIDTHS[Z].SMALL:F6.SMALL_ITEM_WIDTH;if(J.largeItemMaxWidth&&typeof J.largeItemMaxWidth==="number")N=Math.min(N,J.largeItemMaxWidth);if(J.smallItemWidth&&typeof J.smallItemWidth==="number")P=J.smallItemWidth;if(Z==="full-screen")N=F,O=F,P=F;z.forEach((L,D)=>{let R=U(D);switch(R){case"large":L.style.width=`${N}px`;break;case"medium":L.style.width=`${O}px`;break;case"small":L.style.width=`${P}px`;break}L.className=`${$.getClass("carousel")}-slide ${$.getClass("carousel")}-slide--${R}`;let w=L.querySelector(`.${$.getClass("carousel")}-slide-title`),A=L.querySelector(`.${$.getClass("carousel")}-slide-description`);if(w)if(R==="small"&&Z!=="uncontained")w.classList.add("visually-hidden");else w.classList.remove("visually-hidden");if(A)if(R==="small"||R==="medium"&&Z==="multi-browse")A.classList.add("visually-hidden");else A.classList.remove("visually-hidden")})}function _(F,N){let O=document.createElement("div");O.className=`${$.getClass("carousel")}-slide`,O.setAttribute("role","listitem"),O.setAttribute("aria-roledescription","slide"),O.dataset.borderRadius=`${J.borderRadius||F6.BORDER_RADIUS}`;let P=document.createElement("div");P.className=`${$.getClass("carousel")}-slide-image`;let L=document.createElement("img");if(L.src=F.image,L.alt=F.title||"Carousel slide",P.appendChild(L),F.accent){let R=document.createElement("div");if(R.className=`${$.getClass("carousel")}-slide-overlay`,F.accent)R.style.backgroundColor=F.accent;P.appendChild(R)}let D=document.createElement("div");if(D.className=`${$.getClass("carousel")}-slide-content`,F.title){let R=document.createElement("div");if(R.className=`${$.getClass("carousel")}-slide-title`,R.textContent=F.title,Z==="full-screen")D.appendChild(R);else P.appendChild(R)}if(F.description){let R=document.createElement("div");R.className=`${$.getClass("carousel")}-slide-description`,R.textContent=F.description,D.appendChild(R)}if(F.buttonText){let R=document.createElement("a");if(R.className=`${$.getClass("carousel")}-slide-button`,R.textContent=F.buttonText,F.buttonUrl)R.href=F.buttonUrl;if(F.accent)R.style.backgroundColor=F.accent;D.appendChild(R)}if(O.appendChild(P),O.appendChild(D),N!==void 0&&N>=0&&N<=Y.length)Y.splice(N,0,F);else Y.push(F);if(N!==void 0&&N>=0&&N<=z.length)if(N<z.length)j.insertBefore(O,z[N]),z.splice(N,0,O);else j.appendChild(O),z.push(O);else j.appendChild(O),z.push(O);return W++,X(),O}let H=()=>{if(J.showAllLink===!1)return;let F=document.createElement("div");F.className=`${$.getClass("carousel")}-show-all`,F.setAttribute("role","button"),F.setAttribute("tabindex","0"),F.setAttribute("aria-label","Show all items");let N=document.createElement("span");N.textContent="Show all",F.appendChild(N),K.appendChild(F),F.addEventListener("click",()=>{if(J.onShowAll&&typeof J.onShowAll==="function")J.onShowAll()}),F.addEventListener("keydown",(O)=>{if(O.key==="Enter"||O.key===" "){if(J.onShowAll&&typeof J.onShowAll==="function")J.onShowAll();O.preventDefault()}})};if(J.slides&&J.slides.length>0)J.slides.forEach((F)=>{_(F)});if(J.showAllLink!==!1&&Z!=="full-screen")H();let B=()=>{X();let F=new CustomEvent(p9.RESIZE,{detail:{width:j.clientWidth}});$.element.dispatchEvent(F)};window.addEventListener("resize",B),setTimeout(X,0);let k=(F)=>{if(F<0||F>=W)if(J.loop)if(F<0)F=W-1;else F=0;else return Q;if(G!==F){let N=new CustomEvent(p9.SLIDE_CHANGE,{detail:{previousSlide:G,nextSlide:F}});$.element.dispatchEvent(N),G=F,z.forEach((L,D)=>{if(D===G)L.classList.add(`${$.getClass("carousel")}-slide--active`),L.setAttribute("aria-current","true");else L.classList.remove(`${$.getClass("carousel")}-slide--active`),L.removeAttribute("aria-current")});let O=J.scrollBehavior==="snap"?"smooth":"auto";if(z[F])if(Z==="hero"&&J.centered){let L=z[F].offsetWidth,D=j.clientWidth,R=z[F].offsetLeft;j.scrollTo({left:R-D/2+L/2,behavior:O})}else z[F].scrollIntoView({behavior:O,block:"nearest",inline:"start"});let P=new CustomEvent(p9.SLIDE_CHANGED,{detail:{currentSlide:G}});$.element.dispatchEvent(P)}return Q};if(Object.assign(Q,{slides:{addSlide:(F,N)=>{return _(F,N),Q.slides},removeSlide:(F)=>{if(F>=0&&F<z.length){if(j.removeChild(z[F]),z.splice(F,1),Y.splice(F,1),W--,G>=W)G=W-1;if(G<0)G=0;X()}return Q.slides},updateSlide:(F,N)=>{if(F>=0&&F<z.length){Y[F]=N;let O=z[F],P=O.querySelector("img");if(P)P.src=N.image,P.alt=N.title||"Carousel slide";let L=O.querySelector(`.${$.getClass("carousel")}-slide-title`);if(L&&N.title)L.textContent=N.title;let D=O.querySelector(`.${$.getClass("carousel")}-slide-description`);if(D&&N.description)D.textContent=N.description;let R=O.querySelector(`.${$.getClass("carousel")}-slide-overlay`);if(R&&N.accent)R.style.backgroundColor=N.accent;let w=O.querySelector(`.${$.getClass("carousel")}-slide-button`);if(w)if(N.buttonText){if(w.textContent=N.buttonText,N.buttonUrl)w.href=N.buttonUrl;if(N.accent)w.style.backgroundColor=N.accent}else w.parentElement?.removeChild(w);else if(N.buttonText){let A=O.querySelector(`.${$.getClass("carousel")}-slide-content`);if(A){let x=document.createElement("a");if(x.className=`${$.getClass("carousel")}-slide-button`,x.textContent=N.buttonText,N.buttonUrl)x.href=N.buttonUrl;if(N.accent)x.style.backgroundColor=N.accent;A.appendChild(x)}}if(N.size)X()}return Q.slides},getSlide:(F)=>{if(F>=0&&F<Y.length)return Y[F];return null},getCount:()=>W,getElements:()=>[...z]},slidesContainer:j,slideData:Y,wrapper:K,getCurrentSlide:()=>G,goTo:k,next:()=>k(G+1),prev:()=>k(G-1),enableLoop:()=>{return J.loop=!0,Q},disableLoop:()=>{return J.loop=!1,Q},setBorderRadius:(F)=>{return J.borderRadius=F,z.forEach((N)=>{N.dataset.borderRadius=`${F}`}),Q},setGap:(F)=>{return J.gap=F,j.dataset.gap=`${F}`,Q},updateLayout:(F)=>{return J.layout=F,K.dataset.layout=F,$.element.dataset.layout=F,Object.values(U9).forEach((N)=>{$.element.classList.remove(`${$.getClass("carousel")}-layout--${N}`)}),$.element.classList.add(`${$.getClass("carousel")}-layout--${F}`),X(),Q},lifecycle:{...$.lifecycle||{},destroy:()=>{if(window.removeEventListener("resize",B),$.lifecycle&&$.lifecycle.destroy)$.lifecycle.destroy()}}}),J.transition)$.element.classList.add(`${$.getClass("carousel")}-transition--${J.transition}`);if(J.scrollBehavior==="snap")j.addEventListener("scroll",()=>{clearTimeout(Q.scrollTimeout),Q.scrollTimeout=setTimeout(()=>{let F=0,N=1/0,O=j.scrollLeft,P=j.clientWidth;if(z.forEach((L,D)=>{let w=L.offsetLeft+L.offsetWidth/2,A=O+P/2,x=Math.abs(w-A);if(x<N)N=x,F=D}),F!==G){G=F,z.forEach((D,R)=>{if(R===G)D.classList.add(`${$.getClass("carousel")}-slide--active`),D.setAttribute("aria-current","true");else D.classList.remove(`${$.getClass("carousel")}-slide--active`),D.removeAttribute("aria-current")});let L=new CustomEvent(p9.SLIDE_CHANGED,{detail:{currentSlide:G}});$.element.dispatchEvent(L)}},150)});return Q};var n1=(J)=>($)=>{let Q,Z,q,j=!1,K=0,G=0,W,z=J.scrollBehavior||"default",Y=(N)=>{if(N.button!==0)return;cancelAnimationFrame(W),Q=N.clientX,Z=$.slidesContainer.scrollLeft,q=Q,j=!0,G=Date.now(),K=0,$.slidesContainer.dataset.touchAction="none",$.element.dataset.dragging="true",$.slidesContainer.style.scrollBehavior="auto",$.element.setPointerCapture(N.pointerId),N.preventDefault()},U=(N)=>{if(!j)return;let O=N.clientX-Q;$.slidesContainer.scrollLeft=Z-O;let P=Date.now(),L=P-G;if(L>0)K=(N.clientX-q)/L;q=N.clientX,G=P,N.preventDefault()},X=()=>{let N=$.slides.getElements(),O=$.slidesContainer.clientWidth,P=$.slidesContainer.scrollLeft,L=J.layout==="hero"&&J.centered,D=0,R=1/0;return N.forEach((w)=>{let A;if(L)A=w.offsetLeft+w.offsetWidth/2-O/2;else A=w.offsetLeft;let x=Math.abs(A-P);if(x<R)R=x,D=A}),D},_=(N,O,P)=>{let L=Date.now(),D=O-N,R=500;if(Math.abs(P)>0.5)R=Math.min(R,300);let w=()=>{let A=Date.now()-L,x=Math.min(A/R,1);x=1-Math.pow(1-x,3);let I=N+D*x;if($.slidesContainer.scrollLeft=I,x<1)W=requestAnimationFrame(w)};W=requestAnimationFrame(w)},H=(N)=>{if(!j)return;if(j=!1,delete $.element.dataset.dragging,$.element.releasePointerCapture(N.pointerId),z==="snap"){let O=X();_($.slidesContainer.scrollLeft,O,K)}else if(Math.abs(K)>0.5){let O=K*100,P=$.slidesContainer.scrollLeft-O;_($.slidesContainer.scrollLeft,P,K)}K=0,setTimeout(()=>{$.slidesContainer.style.scrollBehavior=""},0)},B=(N)=>{if(j)j=!1,delete $.element.dataset.dragging,$.element.releasePointerCapture(N.pointerId),$.slidesContainer.style.scrollBehavior=""},k=(N)=>{if(J.layout==="full-screen")return;N.preventDefault();let P=(N.deltaY||N.deltaX)*0.5;if(z==="snap")$.slidesContainer.scrollLeft+=P,clearTimeout($.wheelSnapTimeout),$.wheelSnapTimeout=setTimeout(()=>{let L=X();_($.slidesContainer.scrollLeft,L,0)},150);else $.slidesContainer.scrollLeft+=P},M=()=>{if(J.layout!=="multi-browse"||!$.element.dataset.enableParallax)return;let N=$.slides.getElements(),O=$.slidesContainer.clientWidth,P=$.slidesContainer.scrollLeft;N.forEach((L)=>{let{offsetLeft:D,offsetWidth:R}=L,w=D+R/2,A=P+O/2,x=w-A,I=Math.max(-1,Math.min(1,x/(O/2))),r=L.querySelector(`.${$.getClass("carousel")}-slide-image img`);if(r)r.style.transform=`translateX(${I*-5}%)`})},V=()=>{M()};if(J.layout==="multi-browse")$.element.dataset.enableParallax="true";$.element.dataset.swipe="true",$.slidesContainer.addEventListener("pointerdown",Y),window.addEventListener("pointermove",U),window.addEventListener("pointerup",H),window.addEventListener("pointercancel",B),$.slidesContainer.addEventListener("wheel",k,{passive:!1}),$.slidesContainer.addEventListener("scroll",V,{passive:!0});let F=(N)=>{if($.element!==document.activeElement)return;switch(N.key){case"ArrowLeft":if($.prev)$.prev();else $.slidesContainer.scrollBy({left:-200,behavior:z==="snap"?"smooth":"auto"});N.preventDefault();break;case"ArrowRight":if($.next)$.next();else $.slidesContainer.scrollBy({left:200,behavior:z==="snap"?"smooth":"auto"});N.preventDefault();break;case"Home":if($.goTo)$.goTo(0);N.preventDefault();break;case"End":if($.goTo&&$.slides.getCount)$.goTo($.slides.getCount()-1);N.preventDefault();break}};return $.element.setAttribute("tabindex","0"),$.element.addEventListener("keydown",F),$.element.setAttribute("aria-label","Carousel"),{...$,lifecycle:{...$.lifecycle,destroy:()=>{if(cancelAnimationFrame(W),$.slidesContainer.removeEventListener("pointerdown",Y),window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",H),window.removeEventListener("pointercancel",B),$.slidesContainer.removeEventListener("wheel",k),$.slidesContainer.removeEventListener("scroll",V),$.element.removeEventListener("keydown",F),$.lifecycle&&$.lifecycle.destroy)$.lifecycle.destroy()}}}};var lQ=(J)=>($)=>{let Q={element:$.element,slides:{addSlide:(Z,q)=>{return J.slides.addSlide(Z,q),Q.slides},removeSlide:(Z)=>{return J.slides.removeSlide(Z),Q.slides},updateSlide:(Z,q)=>{return J.slides.updateSlide(Z,q),Q.slides},getSlide:(Z)=>{if($.slideData&&Z>=0&&Z<$.slideData.length)return $.slideData[Z];return null},getCount:J.slides.getCount,getElements:J.slides.getElements},lifecycle:{destroy:J.lifecycle.destroy},getClass:$.getClass,next(){return $.next(),this},prev(){return $.prev(),this},goTo(Z){return $.goTo(Z),this},getCurrentSlide:$.getCurrentSlide,addSlide(Z,q){return J.slides.addSlide(Z,q),this},removeSlide(Z){return J.slides.removeSlide(Z),this},enableLoop(){return $.enableLoop(),this},disableLoop(){return $.disableLoop(),this},setBorderRadius(Z){if($.setBorderRadius)$.setBorderRadius(Z);return this},setGap(Z){if($.setGap)$.setGap(Z);return this},destroy(){J.lifecycle.destroy()},on(Z,q){if($.on)$.on(Z,q);else if($.element.addEventListener)$.element.addEventListener(Z,q);return this},off(Z,q){if($.off)$.off(Z,q);else if($.element.removeEventListener)$.element.removeEventListener(Z,q);return this},addClass(...Z){if($.addClass)$.addClass(...Z);else Z.forEach((q)=>$.element.classList.add(q));return this}};return Q};t();var gq={initialSlide:F6.INITIAL_SLIDE,loop:F6.LOOP,transition:o7.SLIDE,transitionDuration:F6.TRANSITION_DURATION,borderRadius:F6.BORDER_RADIUS,gap:F6.GAP,prefix:"carousel",showAllLink:!0},rQ=(J={})=>d(gq,J,"carousel"),pQ=(J)=>{let $={role:"region","aria-roledescription":"carousel","aria-live":"polite"},Q={"data-transition":J.transition,"data-loop":J.loop?"true":"false"};return p(J,{tag:"div",attributes:{...$,...Q},className:J.class,forwardEvents:{keydown:!0,focus:!0,blur:!0}})};var dq=(J={})=>{J.layout=J.layout||"multi-browse",J.scrollBehavior=J.scrollBehavior||lq(J.layout);let $=rQ(J);try{let Z={...b(S,g(),E(pQ($)))($)};rq(Z,J);let q=t1($)(Z),j=n1($)(q),K=C()(j),G={slides:{addSlide:K.slides.addSlide,removeSlide:K.slides.removeSlide,updateSlide:K.slides.updateSlide,getCount:K.slides.getCount,getElements:K.slides.getElements},lifecycle:{destroy:K.lifecycle.destroy}},W=lQ(G)(K);return W.element.dataset.layout=J.layout,W.element.dataset.scrollBehavior=J.scrollBehavior,W}catch(Q){throw console.error("Carousel creation error:",Q),new Error(`Failed to create carousel: ${Q.message}`)}};function lq(J){switch(J){case"multi-browse":case"hero":case"full-screen":return"snap";case"uncontained":return"default";default:return"default"}}function rq(J,$){switch(J.element.classList.add(`${J.getClass("carousel")}-layout--${$.layout}`),$.layout){case"multi-browse":J.element.dataset.enableParallax="true",J.element.dataset.layout="multi-browse";break;case"uncontained":J.element.style.overflow="visible",J.element.dataset.layout="uncontained";break;case"hero":if(J.element.dataset.largeItemFocus="true",J.element.dataset.layout="hero",$.centered)J.element.dataset.centered="true";break;case"full-screen":J.element.style.width="100%",J.element.style.height="100%",J.element.style.maxWidth="100vw",J.element.style.maxHeight="100vh",J.element.dataset.verticalScroll="true",J.element.dataset.layout="full-screen",$.scrollBehavior="snap";break}if($.scrollBehavior==="snap")J.element.dataset.snapScroll="true";else J.element.dataset.snapScroll="false"}var e1=dq;J6();c();o();var sQ=({disabled:J,lifecycle:$,checkable:Q})=>(Z)=>({...Z,element:Z.element,input:Z.input,getValue:Z.getValue||(()=>""),setValue(q){return Z.setValue?.(q),this},check(){return Q.check(),this},uncheck(){return Q.uncheck(),this},toggle(){return Q.toggle(),this},isChecked(){return Q.isChecked()},setIndeterminate(q){return Z.setIndeterminate?.(q),this},setLabel(q){return Z.text?.setText(q),this},getLabel(){return Z.text?.getText()||""},on(q,j){return Z.on?.(q,j),this},off(q,j){return Z.off?.(q,j),this},enable(){return J.enable(),this},disable(){return J.disable(),this},destroy(){$.destroy()}});t();var pq={variant:"filled",labelPosition:"end"},mQ=(J={})=>d(pq,J,"checkbox"),aQ=(J)=>p(J,{tag:"div",className:J.class,interactive:!0}),cQ=(J)=>($)=>{let Q=document.createElement("span");return Q.className=`${J.prefix}-checkbox-icon`,Q.innerHTML=`
|
|
10
10
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" fill="currentColor">
|
|
11
11
|
<path d="M9.55 14.6L6.35 11.4l-1.9 1.9L9.55 18.4l10.9-10.9-1.9-1.9z"/>
|
|
12
12
|
</svg>
|
|
13
|
-
`,$.element.appendChild(Q),$},iQ=(J)=>($)=>{let Q=J.labelPosition||"end",Z=`${J.prefix}-checkbox--label-${Q}`;return $.element.classList.add(Z),$},oQ=(J)=>({disabled:{enable:J.disabled?.enable,disable:J.disabled?.disable},lifecycle:{destroy:J.lifecycle?.destroy},checkable:{check:J.checkable?.check,uncheck:J.checkable?.uncheck,toggle:J.checkable?.toggle,isChecked:J.checkable?.isChecked}});var sq=(J,$)=>{let Q=S9($)(J);if($.indeterminate)Q.input.indeterminate=!0;return Q.setIndeterminate=(Z)=>{return Q.input.indeterminate=Z,Q.element.classList.toggle(`${$.prefix}-checkbox--indeterminate`,Z),Q},Q},mq=(J={})=>{let $=mQ(J);try{return b(S,g(),E(aQ($)),I9($),cQ($),z9($),iQ($),(Z)=>sq(Z,$),G6($),C(),(Z)=>sQ(oQ(Z))(Z))($)}catch(Q){throw console.error("Checkbox creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create checkbox: ${Q instanceof Error?Q.message:String(Q)}`)}},$J=mq;var s$={FILLED:"filled",OUTLINED:"outlined"},m$={START:"start",END:"end"},JJ={CHECKED:"checked",INDETERMINATE:"indeterminate",DISABLED:"disabled",FOCUSED:"focused"},QJ={ROOT:"checkbox",INPUT:"checkbox-input",ICON:"checkbox-icon",LABEL:"checkbox-label"};J6();c();o();var tQ=({disabled:J,lifecycle:$})=>(Q)=>{let Z=Q.element.classList.contains(`${Q.getClass("chip")}--selected`),q=Q.element.getAttribute("data-value")||null;return{...Q,element:Q.element,getValue(){let j=Q.element.getAttribute("data-value");if(j!==null)return q=j,j;if(q!==null)return Q.element.setAttribute("data-value",q),q;let G=Q.element.querySelector(`.${Q.getClass("chip")}-text`);if(G&&G.textContent){let K=G.textContent;if(K.includes(" Theme"))q=K.replace(" Theme","").toLowerCase();else q=K.toLowerCase().replace(/\s+/g,"-");return Q.element.setAttribute("data-value",q),q}return null},setValue(j){if(j!==null&&j!==void 0)q=j,Q.element.setAttribute("data-value",j);else q=null,Q.element.removeAttribute("data-value");return this},isDisabled(){return Q.element.getAttribute("aria-disabled")==="true"},enable(){return J.enable(),Q.element.classList.remove(`${Q.getClass("chip")}--disabled`),Q.element.setAttribute("aria-disabled","false"),Q.element.setAttribute("tabindex","0"),this},disable(){return J.disable(),Q.element.classList.add(`${Q.getClass("chip")}--disabled`),Q.element.setAttribute("aria-disabled","true"),Q.element.setAttribute("tabindex","-1"),this},setText(j){let G=`.${Q.getClass("chip")}-content`,K=Q.element.querySelector(G)||Q.element,z=`.${Q.getClass("chip")}-text`,W=Q.element.querySelector(z);if(!W&&j){W=document.createElement("span"),W.className=`${Q.getClass("chip")}-text`;let Y=Q.element.querySelector(`.${Q.getClass("chip")}-leading-icon`);if(Y)K.insertBefore(W,Y.nextSibling);else K.insertBefore(W,K.firstChild)}if(W){if(W.textContent=j||"",!j&&W.parentNode)W.parentNode.removeChild(W)}return this},getText(){let j=Q.element.querySelector(`.${Q.getClass("chip")}-text`);return j?j.textContent||"":""},setIcon(j){return this.setLeadingIcon(j)},getIcon(){let j=Q.element.querySelector(`.${Q.getClass("chip")}-leading-icon`);return j?j.innerHTML:""},setLeadingIcon(j){let G=Q.element.querySelector(`.${Q.getClass("chip")}-content`)||Q.element,K=`.${Q.getClass("chip")}-leading-icon`,z=Q.element.querySelector(K);if(!z&&j)z=document.createElement("span"),z.className=`${Q.getClass("chip")}-leading-icon`,G.insertBefore(z,G.firstChild);if(z){if(z.innerHTML=j||"",!j&&z.parentNode)z.parentNode.removeChild(z)}return this},setTrailingIcon(j,G){let K=Q.element.querySelector(`.${Q.getClass("chip")}-content`)||Q.element,z=`.${Q.getClass("chip")}-trailing-icon`,W=Q.element.querySelector(z);if(!W&&j){if(W=document.createElement("span"),W.className=`${Q.getClass("chip")}-trailing-icon`,K.appendChild(W),G)W.addEventListener("click",(Y)=>{Y.stopPropagation(),G(this)})}if(W){if(W.innerHTML=j||"",!j&&W.parentNode)W.parentNode.removeChild(W)}return this},isSelected(){return Z},setSelected(j){if(Z=!!j,j)Q.element.classList.add(`${Q.getClass("chip")}--selected`),Q.element.setAttribute("aria-selected","true");else Q.element.classList.remove(`${Q.getClass("chip")}--selected`),Q.element.setAttribute("aria-selected","false");return this},toggleSelected(){return this.setSelected(!Z)},destroy(){$.destroy()}}};t();var aq={variant:"filled",ripple:!0},nQ=(J={})=>d(aq,J,"chip"),eQ=(J)=>{let $={role:"button",tabindex:"0"};if(J.disabled===!0)$["aria-disabled"]="true";if(J.selected===!0)$["aria-selected"]="true";else if(J.selected===!1)$["aria-selected"]="false";let Q=[J.class,J.selected?`${J.prefix}-chip--selected`:null];return p(J,{tag:"div",attributes:$,className:Q,forwardEvents:{click:(Z)=>Z.element.getAttribute("aria-disabled")!=="true",keydown:(Z,q)=>{if(q.key===" "||q.key==="Enter")return q.preventDefault(),Z.element.click(),!0;return!1},focus:!0,blur:!0}})},$Z=(J)=>({disabled:{enable:()=>J.disabled?.enable(),disable:()=>J.disabled?.disable()},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var cq=(J={})=>{let $=nQ(J);try{let Q=b(S,g(),E(eQ($)),K6($),G6($),T6($),C())($),Z=document.createElement("div");if(Z.className=`${Q.getClass("chip")}-content`,Z.style.display="flex",Z.style.alignItems="center",Z.style.gap="8px",Z.style.width="100%",Q.element.appendChild(Z),J.leadingIcon||J.icon){let j=document.createElement("span");j.className=`${Q.getClass("chip")}-leading-icon`,j.innerHTML=J.leadingIcon||J.icon||"",Z.appendChild(j)}if(J.text){let j=document.createElement("span");j.className=`${Q.getClass("chip")}-text`,j.textContent=J.text,Z.appendChild(j)}if(J.trailingIcon){let j=document.createElement("span");if(j.className=`${Q.getClass("chip")}-trailing-icon`,j.innerHTML=J.trailingIcon,J.onTrailingIconClick)j.addEventListener("click",(G)=>{G.stopPropagation(),J.onTrailingIconClick(Q)});Z.appendChild(j)}if(J.selected)Q.element.classList.add(`${Q.getClass("chip")}--selected`),Q.element.setAttribute("aria-selected","true");if(J.value)Q.element.setAttribute("data-value",J.value);let q=tQ($Z(Q))(Q);if(!Q.element.hasAttribute("data-value")&&J.text)q.getValue();if(J.variant==="filter"||J.variant==="assist"||J.variant==="suggestion"||J.selectable)Q.element.addEventListener("click",()=>{if(q.isDisabled())return;let j=q.isSelected();q.toggleSelected();let G=q.isSelected();if(J.onChange&&j!==G)J.onChange(G,q);if(J.onSelect)J.onSelect(q)});return q}catch(Q){throw console.error("Chip creation error:",Q),new Error(`Failed to create chip: ${Q.message}`)}},t7=cq;c();o();var n7=(J)=>($)=>{if(!J.schema)return console.warn("No schema definition found in component config"),$;return{...$,schema:J.schema}};A6();var ZJ=(J)=>($)=>{if(!J.icon||!$.schema)return $;try{let Q=J.prefix||$.config?.prefix||"mtrl",Z=J.componentName||$.componentName||"component",q=JSON.parse(JSON.stringify($.schema)),j=J.iconPosition||"start",G=q.element.options.className||[],K=`${Q}-${Z}--icon`;if(Array.isArray(G)){if(!G.includes(K))G.push(K)}else if(typeof G==="string"){if(!G.includes(K))q.element.options.className=`${G} ${K}`.trim()}else q.element.options.className=[K];let z={name:"icon",creator:v,options:{tag:"span",className:[`${Q}-${Z}-icon`,`${Q}-${Z}-icon--${j}`],html:J.icon}};if(J.iconSize){let W=z.options.className;if(Array.isArray(W))W.push(`${Q}-${Z}-icon--${J.iconSize}`)}if(j==="start"){let W={...q.element.children};q.element.children={icon:z,...W}}else q.element.children.icon=z;return{...$,schema:q}}catch(Q){return console.warn("Error enhancing schema with icon:",Q),$}};A6();var e7=(J)=>($)=>{if(!J.label||!$.schema)return $;try{let Q=J.prefix||$.config?.prefix||"mtrl",Z=J.componentName||$.componentName||"component",q=JSON.parse(JSON.stringify($.schema)),j=J.labelPosition||"start",G=J.label,K=null;if(J.required)K={requiredIndicator:{name:"requiredIndicator",creator:v,options:{tag:"span",className:`${Q}-${Z}-label-required`,text:"*",attributes:{"aria-hidden":"true"}}}},G=J.label;let z={name:"label",creator:v,options:{tag:"label",className:[`${Q}-${Z}-label`,`${Q}-${Z}-label--${j}`],attributes:{for:J.id},text:G}};if(K)z.children=K;if(j==="end"||j==="bottom")q.element.children.label=z;else{let W={...q.element.children};q.element.children={label:z,...W}}return{...$,schema:q}}catch(Q){return console.warn("Error enhancing schema with label:",Q),$}};v$();var $$=()=>(J)=>{if(!J.schema)return J;try{let $=c5(J.schema),Q=$.getAll(),Z=J.config?.parent;if(typeof Z==="string")Z=document.querySelector(Z);if(Z&&$.element)Z.appendChild($.element);return{...J,element:$.element,components:Q}}catch($){throw console.error("Failed to create DOM structure:",$),new Error(`Failed to create component DOM: ${$.message}`)}};var qJ=(J)=>($)=>{let Q={scrollable:J.scrollable===!0,vertical:J.vertical===!0};return{...$,layout:{setScrollable(Z){if(Q.scrollable=Z,$.element)if(Z)$.element.classList.add(`${$.getClass("chips")}--scrollable`);else $.element.classList.remove(`${$.getClass("chips")}--scrollable`);return this},isScrollable(){return Q.scrollable},setVertical(Z){if(Q.vertical=Z,$.element)if(Z)$.element.classList.add(`${$.getClass("chips")}--vertical`);else $.element.classList.remove(`${$.getClass("chips")}--vertical`);return this},isVertical(){return Q.vertical}}}};var jJ=(J)=>($)=>{return{...$,chipInstances:[],onCreated(){if(typeof $.onCreated==="function")$.onCreated();if(Array.isArray(J.chips)&&J.chips.length>0)J.chips.forEach((Z)=>{this.chips?.addChip?.(Z)})}}};var KJ={FILLED:"filled",OUTLINED:"outlined",ELEVATED:"elevated",ASSIST:"assist",FILTER:"filter",INPUT:"input",SUGGESTION:"suggestion"},GJ={CHANGE:"change",SELECT:"select",DESELECT:"deselect",REMOVE:"remove"},X9={CHANGE:"change",ADD:"add",REMOVE:"remove"};var zJ=(J)=>($)=>{if(!$.element||!$.components)return console.warn("Cannot initialize chips controller: missing element or components"),$;let Q={change:[],add:[],remove:[]},Z=-1,q=(k,...N)=>{if(Q[k])Q[k].forEach((F)=>F(...N))},j=(k)=>{if(k.isSelected())k.element.classList.add(`${$.getClass("chip")}--selected`),k.element.setAttribute("aria-selected","true");else k.element.classList.remove(`${$.getClass("chip")}--selected`),k.element.setAttribute("aria-selected","false");if(!J.multiSelect){if($.chipInstances.forEach((O)=>{if(O!==k&&O.isSelected())O.setSelected(!1),O.element.classList.remove(`${$.getClass("chip")}--selected`),O.element.setAttribute("aria-selected","false")}),!k.isSelected()&&U().length===0)k.setSelected(!0),k.element.classList.add(`${$.getClass("chip")}--selected`),k.element.setAttribute("aria-selected","true")}let F=$.chipInstances.filter((O)=>O.isSelected()).map((O)=>O.getValue()),V=k?k.getValue():null;if(typeof J.onChange==="function")J.onChange(F,V);q(X9.CHANGE,F,V)},G=(k)=>{if($.chipInstances.length===0)return;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," "].includes(k.key))return;if(k.key==="Enter"||k.key===" "){if(Z>=0&&Z<$.chipInstances.length){k.preventDefault();let N=$.chipInstances[Z];if(!N.isDisabled()){if(N.toggleSelected(),N.isSelected())N.element.classList.add(`${$.getClass("chip")}--selected`),N.element.setAttribute("aria-selected","true");else N.element.classList.remove(`${$.getClass("chip")}--selected`),N.element.setAttribute("aria-selected","false");j(N)}return}}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(k.key)){k.preventDefault();let N=$.layout&&$.layout.isVertical(),F=Z;if(Z===-1)F=0;else if(N&&k.key==="ArrowUp"||!N&&k.key==="ArrowLeft")F=Math.max(0,Z-1);else if(N&&k.key==="ArrowDown"||!N&&k.key==="ArrowRight")F=Math.min($.chipInstances.length-1,Z+1);if(F!==Z){if(Z>=0&&Z<$.chipInstances.length)$.chipInstances[Z].element.blur();if(Z=F,$.chipInstances[Z].element.focus(),$.layout&&$.layout.isScrollable())K(Z)}}},K=(k)=>{if(!($.layout&&$.layout.isScrollable()))return;let F=typeof k==="number"?k:$.chipInstances.indexOf(k);if(F>=0&&F<$.chipInstances.length){let V=$.chipInstances[F].element,O=$.components.chipContainer||$.element,P=O.getBoundingClientRect(),L=V.getBoundingClientRect();if($.layout&&$.layout.isVertical()){let R=V.offsetTop-O.offsetTop-P.height/2+L.height/2;O.scrollTo({top:Math.max(0,R),behavior:"smooth"})}else{let R=V.offsetLeft-O.offsetLeft-P.width/2+L.width/2;O.scrollTo({left:Math.max(0,R),behavior:"smooth"})}}},z=(k)=>{let N=t7({...k,onSelect:k.onSelect}),F=$.components.chipContainer||$.element,V=document.createDocumentFragment();return V.appendChild(N.element),F.appendChild(V),$.chipInstances.push(N),N.element.addEventListener("click",()=>{if(!N.isDisabled()){if(N.toggleSelected(),N.isSelected())N.element.classList.add(`${$.getClass("chip")}--selected`),N.element.setAttribute("aria-selected","true");else N.element.classList.remove(`${$.getClass("chip")}--selected`),N.element.setAttribute("aria-selected","false");j(N),Z=$.chipInstances.indexOf(N)}}),N.element.addEventListener("keydown",G),q(X9.ADD,N),N},W=(k)=>{let N=typeof k==="number"?k:$.chipInstances.indexOf(k);if(N>=0&&N<$.chipInstances.length){let F=$.chipInstances[N];if(q(X9.REMOVE,F),F.destroy(),$.chipInstances.splice(N,1),N===Z)Z=-1;else if(N<Z)Z--}},Y=()=>{return[...$.chipInstances]},U=()=>{return $.chipInstances.filter((k)=>k.isSelected())},X=()=>{return U().map((k)=>k.getValue())},_=(k,N=!0,F=!J.multiSelect)=>{let V=Array.isArray(k)?k:[k],O=!1;if(F)$.chipInstances.forEach((P)=>{if(!V.includes(P.getValue())&&P.isSelected())P.setSelected(!1),P.element.classList.remove(`${$.getClass("chip")}--selected`),P.element.setAttribute("aria-selected","false"),O=!0});if($.chipInstances.forEach((P)=>{if(V.includes(P.getValue())&&!P.isSelected())P.setSelected(!0),P.element.classList.add(`${$.getClass("chip")}--selected`),P.element.setAttribute("aria-selected","true"),O=!0}),O&&N){let P=X();q(X9.CHANGE,P,null)}},H=(k=!0)=>{let F=X().length>0;if($.chipInstances.forEach((V)=>{V.setSelected(!1),V.element.classList.remove(`${$.getClass("chip")}--selected`),V.element.setAttribute("aria-selected","false")}),F&&k)q(X9.CHANGE,[],null)},B=()=>{$.chipInstances.forEach((k)=>{k.element.addEventListener("keydown",G)})},M=()=>{$.chipInstances.forEach((k)=>{k.element.removeEventListener("keydown",G)})};if(B(),$.element)$.element.addEventListener("keydown",G);if($.lifecycle){let k=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{$.chipInstances.forEach((N)=>{N.element.removeEventListener("keydown",G)}),$.chipInstances.forEach((N)=>N.destroy()),$.chipInstances.length=0,Object.keys(Q).forEach((N)=>{Q[N]=[]}),k()}}return{...$,chips:{addChip:z,removeChip:W,getChips:Y,getSelectedChips:U,getSelectedValues:X,selectByValue:_,clearSelection:H,scrollToChip:K},keyboard:{enable:B,disable:M},on(k,N){if(!Q[k])Q[k]=[];return Q[k].push(N),this},off(k,N){if(Q[k]){let F=Q[k].indexOf(N);if(F!==-1)Q[k].splice(F,1)}return this}}};var JZ=(J)=>($)=>{return{...$,element:$.element,addChip(Q){if(J.chips&&typeof J.chips.addChip==="function")J.chips.addChip(Q);return this},removeChip(Q){if(J.chips&&typeof J.chips.removeChip==="function")J.chips.removeChip(Q);return this},getChips(){if(J.chips&&typeof J.chips.getChips==="function")return J.chips.getChips();return[]},getSelectedChips(){if(J.chips&&typeof J.chips.getSelectedChips==="function")return J.chips.getSelectedChips();return[]},getSelectedValues(){if(J.chips&&typeof J.chips.getSelectedValues==="function")return J.chips.getSelectedValues();return[]},selectByValue(Q,Z=!0){if(J.chips&&typeof J.chips.selectByValue==="function")J.chips.selectByValue(Q,Z);return this},clearSelection(){if(J.chips&&typeof J.chips.clearSelection==="function")J.chips.clearSelection();return this},setScrollable(Q){if(J.layout&&typeof J.layout.setScrollable==="function")J.layout.setScrollable(Q);return this},setVertical(Q){if(J.layout&&typeof J.layout.setVertical==="function")J.layout.setVertical(Q);return this},setLabel(Q){if(J.label&&typeof J.label.setText==="function")J.label.setText(Q);return this},getLabel(){if(J.label&&typeof J.label.getText==="function")return J.label.getText();return""},setLabelPosition(Q){if(J.label&&typeof J.label.setPosition==="function")J.label.setPosition(Q);return this},getLabelPosition(){if(J.label&&typeof J.label.getPosition==="function")return J.label.getPosition();return"start"},scrollToChip(Q){if(J.chips&&typeof J.chips.scrollToChip==="function")J.chips.scrollToChip(Q);return this},enableKeyboardNavigation(){if(J.keyboard&&typeof J.keyboard.enableKeyboardNavigation==="function")J.keyboard.enableKeyboardNavigation();return this},on(Q,Z){if(J.events&&typeof J.events.on==="function")J.events.on(Q,Z);return this},off(Q,Z){if(J.events&&typeof J.events.off==="function")J.events.off(Q,Z);return this},destroy(){if(J.lifecycle&&typeof J.lifecycle.destroy==="function")J.lifecycle.destroy()}}};t();function QZ(J,$){let Q=(z)=>J.getClass(z),Z=$.scrollable===!0,q=$.vertical===!0,j=$.multiSelect===!0,G=$.label&&$.label.trim().length>0,K=$.labelPosition||"start";return{element:{options:{className:[Q("chips"),Z?Q("chips--scrollable"):null,q?Q("chips--vertical"):null,G?Q("chips--with-label"):null,G&&K==="end"?Q("chips--label-end"):null,$.class].filter(Boolean),attributes:{role:"group","aria-multiselectable":j?"true":"false"}},children:{...G?{label:{options:{tag:"label",className:Q("chips-label"),text:$.label}}}:{},chipContainer:{options:{className:Q("chips-container")}}}}}}var iq={chips:[],scrollable:!1,vertical:!1,multiSelect:!1,onChange:null,selector:null,labelPosition:"start"},ZZ=(J={})=>{let $=d(iq,J,"chips"),Q={componentName:"chips",config:$,getClass:(Z)=>{let q=$.prefix||"mtrl";return Z?`${q}-${Z}`:q}};return $.schema=QZ(Q,$),$};var qZ=(J)=>({chips:{addChip:function($){if(J.chips&&typeof J.chips.addChip==="function")return J.chips.addChip($);return null},removeChip:($)=>J.chips?.removeChip?.($),getChips:()=>J.chips?.getChips?.()??[],getSelectedChips:()=>J.chips?.getSelectedChips?.()??[],getSelectedValues:()=>J.chips?.getSelectedValues?.()??[],selectByValue:($)=>J.chips?.selectByValue?.($),clearSelection:()=>J.chips?.clearSelection?.(),scrollToChip:($)=>J.chips?.scrollToChip?.($)},layout:{setScrollable:($)=>J.layout?.setScrollable?.($),isScrollable:()=>J.layout?.isScrollable?.()??!1,setVertical:($)=>J.layout?.setVertical?.($),isVertical:()=>J.layout?.isVertical?.()??!1},label:{setText:($)=>J.label?.setText?.($),getText:()=>J.label?.getText?.()??"",setPosition:($)=>J.label?.setPosition?.($),getPosition:()=>J.label?.getPosition?.()??"start"},keyboard:{enableKeyboardNavigation:()=>J.keyboard?.enable?.(),disableKeyboardNavigation:()=>J.keyboard?.disable?.()},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var oq=(J={})=>{let $=ZZ(J);try{let Q=b(S,g(),n7($),qJ($),e7($),jJ($),$$(),zJ($),C())($),Z=qZ(Q),q=JZ(Z)(Q);if($.on&&typeof q.on==="function")Object.entries($.on).forEach(([j,G])=>{if(typeof G==="function")q.on(j,G)});return q}catch(Q){throw console.error("Chips creation error:",Q),new Error(`Failed to create chip: ${Q.message}`)}},jZ=oq;y6();J6();c();o();var KZ=["S","M","T","W","T","F","S"],a$=["January","February","March","April","May","June","July","August","September","October","November","December"],c$=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],WJ="MM/DD/YYYY",GZ="today",i$="selected",zZ="outside-month",WZ="range-start",YZ="range-end",UZ="range-middle";var S6=(J)=>{if(!J)return null;if(J instanceof Date)return isNaN(J.getTime())?null:J;if(typeof J==="string"){let $=new Date(J);return isNaN($.getTime())?null:$}return null},R9=(J,$="MM/DD/YYYY")=>{if(!J||!(J instanceof Date)||isNaN(J.getTime()))return"";let Q="",Z=0;while(Z<$.length)if($.substring(Z,Z+4)==="MMMM")Q+=a$[J.getMonth()],Z+=4;else if($.substring(Z,Z+3)==="MMM")Q+=c$[J.getMonth()],Z+=3;else if($.substring(Z,Z+2)==="MM")Q+=(J.getMonth()+1).toString().padStart(2,"0"),Z+=2;else if($.substring(Z,Z+1)==="M")Q+=J.getMonth()+1,Z+=1;else if($.substring(Z,Z+4)==="YYYY")Q+=J.getFullYear(),Z+=4;else if($.substring(Z,Z+2)==="YY")Q+=J.getFullYear().toString().slice(-2),Z+=2;else if($.substring(Z,Z+2)==="DD")Q+=J.getDate().toString().padStart(2,"0"),Z+=2;else if($.substring(Z,Z+1)==="D")Q+=J.getDate(),Z+=1;else Q+=$[Z],Z+=1;return Q},XZ=(J,$)=>{return new Date(J,$+1,0).getDate()},tq=(J,$)=>{return new Date(J,$,1).getDay()},P9=(J,$)=>{return J.getDate()===$.getDate()&&J.getMonth()===$.getMonth()&&J.getFullYear()===$.getFullYear()},nq=(J,$,Q)=>{let Z=J.getTime();return Z>=$.getTime()&&Z<=Q.getTime()},BZ=(J,$,Q=null,Z=null,q=null,j=null)=>{let G=new Date;G.setHours(0,0,0,0);let K=[],z=tq(J,$),W=XZ(J,$-1);for(let _=z-1;_>=0;_--){let H=new Date(J,$-1,W-_),B=q&&H<q||j&&H>j;K.push({date:H,day:H.getDate(),isCurrentMonth:!1,isToday:P9(H,G),isSelected:Q?P9(H,Q):!1,isDisabled:B})}let Y=XZ(J,$);for(let _=1;_<=Y;_++){let H=new Date(J,$,_),B=Q?P9(H,Q):!1,M=q&&H<q||j&&H>j,k={date:H,day:_,isCurrentMonth:!0,isToday:P9(H,G),isSelected:B,isDisabled:M};if(Q&&Z)k.isRangeStart=P9(H,Q),k.isRangeEnd=P9(H,Z),k.isRangeMiddle=nq(H,Q,Z)&&!k.isRangeStart&&!k.isRangeEnd;K.push(k)}let X=42-K.length;for(let _=1;_<=X;_++){let H=new Date(J,$+1,_),B=q&&H<q||j&&H>j;K.push({date:H,day:_,isCurrentMonth:!1,isToday:P9(H,G),isSelected:Q?P9(H,Q):!1,isDisabled:B})}return K},FZ=(J,$=10)=>{let Q=[],Z=J-$,q=J+$;for(let j=Z;j<=q;j++)Q.push(j);return Q};var YJ=(J,$)=>{let Q=new Date(J);return Q.setMonth(Q.getMonth()+$),Q};var HZ=(J,{disabled:$,lifecycle:Q,events:Z})=>(q)=>{let j={goToDate(G){let K=S6(G);if(!K)return;J.currentMonth=K.getMonth(),J.currentYear=K.getFullYear(),J.updateCalendar()},nextMonth(){let G=YJ(new Date(J.currentYear,J.currentMonth,1),1);J.currentMonth=G.getMonth(),J.currentYear=G.getFullYear(),J.updateCalendar()},prevMonth(){let G=YJ(new Date(J.currentYear,J.currentMonth,1),-1);J.currentMonth=G.getMonth(),J.currentYear=G.getFullYear(),J.updateCalendar()},nextYear(){J.currentYear+=1,J.updateCalendar()},prevYear(){J.currentYear-=1,J.updateCalendar()},showDayView(){J.currentView="day",J.updateCalendar()},showMonthView(){J.currentView="month",J.updateCalendar()},showYearView(){J.currentView="year",J.updateCalendar()},getCurrentView(){return J.currentView}};return{...q,element:q.element,input:J.input,calendar:j,open(){return J.isOpen=!0,J.render(),Z.emit("open",{value:this.getValue()}),this},close(){return J.isOpen=!1,J.render(),Z.emit("close",{value:this.getValue()}),this},getValue(){if(!J.selectedDate)return null;if(J.selectionMode==="range"&&J.rangeEndDate)return[new Date(J.selectedDate),new Date(J.rangeEndDate)];return new Date(J.selectedDate)},setValue(G){if(Array.isArray(G)&&J.selectionMode==="range"){let z=S6(G[0]),W=S6(G[1]);if(z&&W){if(J.selectedDate=z,J.rangeEndDate=W,z>W)J.selectedDate=W,J.rangeEndDate=z;if(J.updateInputValue(),J.isOpen)J.currentMonth=J.selectedDate.getMonth(),J.currentYear=J.selectedDate.getFullYear(),J.updateCalendar();Z.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this}let K=S6(G);if(K){if(J.selectedDate=K,J.rangeEndDate=null,J.updateInputValue(),J.isOpen)J.currentMonth=K.getMonth(),J.currentYear=K.getFullYear(),J.updateCalendar();Z.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this},getFormattedValue(){if(!J.selectedDate)return"";if(J.selectionMode==="range"&&J.rangeEndDate){let G=R9(J.selectedDate,J.dateFormat),K=R9(J.rangeEndDate,J.dateFormat);return`${G} - ${K}`}return R9(J.selectedDate,J.dateFormat)},clear(){if(J.selectedDate=null,J.rangeEndDate=null,J.updateInputValue(),J.isOpen)J.updateCalendar();return Z.emit("change",{value:null,formattedValue:""}),this},enable(){return $.enable(),J.input.disabled=!1,this},disable(){return $.disable(),J.input.disabled=!0,this},setMinDate(G){let K=S6(G);if(K){if(J.minDate=K,J.isOpen)J.updateCalendar()}return this},setMaxDate(G){let K=S6(G);if(K){if(J.maxDate=K,J.isOpen)J.updateCalendar()}return this},destroy(){if(document.removeEventListener("click",J.outsideClickHandler),J.calendarElement&&J.calendarElement.parentNode)J.calendarElement.parentNode.removeChild(J.calendarElement);Q.destroy()},on(G,K){return Z.on(G,K),this},off(G,K){return Z.off(G,K),this}}};t();var eq={variant:"docked",initialView:"day",selectionMode:"single",dateFormat:WJ,animate:!0},kZ=(J={})=>{let $=d(eq,J,"datepicker");if($.closeOnSelect===void 0)$.closeOnSelect=$.variant!=="docked";return $},MZ=(J)=>{return p(J,{tag:"div",attributes:{role:"application","aria-label":"Date Picker",tabindex:"-1"},className:[`${J.prefix}-datepicker-container`,J.class],forwardEvents:{keydown:!0,click:!0},interactive:!0})},VZ=(J)=>{let $={type:"text",placeholder:J.placeholder||J.dateFormat,autocomplete:"off",readonly:!0};if(J.disabled===!0)$.disabled=!0;return p(J,{tag:"input",attributes:$,className:`${J.prefix}-datepicker-input`,forwardEvents:{focus:!0,blur:!0,click:!0},interactive:!0})},NZ=(J)=>{return p(J,{tag:"div",attributes:{role:"dialog","aria-modal":J.variant!=="docked"?"true":"false"},className:[`${J.prefix}-datepicker-calendar`,`${J.prefix}-datepicker-${J.variant}`,J.selectionMode==="range"?`${J.prefix}-datepicker-range`:""],forwardEvents:{keydown:!0,click:!0}})},_Z=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()},events:{on:J.on,off:J.off,emit:J.emit}});A6();var $j=({currentMonth:J,currentYear:$,currentView:Q,prefix:Z,emit:q})=>{let j=v({tag:"div",className:`${Z}-datepicker-header`}),G=v({tag:"button",className:`${Z}-datepicker-month-selector`,text:a$[J],attributes:{type:"button","aria-label":"Select month"}}),K=v({tag:"button",className:`${Z}-datepicker-year-selector`,text:$.toString(),attributes:{type:"button","aria-label":"Select year"}}),z=v({tag:"div",className:`${Z}-datepicker-nav-controls`}),W=v({tag:"button",className:`${Z}-datepicker-prev-btn`,html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>',attributes:{type:"button","aria-label":Q==="day"?"Previous month":Q==="month"?"Previous year":"Previous year range"}}),Y=v({tag:"button",className:`${Z}-datepicker-next-btn`,html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>',attributes:{type:"button","aria-label":Q==="day"?"Next month":Q==="month"?"Next year":"Next year range"}});return G.addEventListener("click",(U)=>{U.stopPropagation(),q("viewChange",{view:"month"})}),K.addEventListener("click",(U)=>{U.stopPropagation(),q("viewChange",{view:"year"})}),W.addEventListener("click",(U)=>{if(U.stopPropagation(),Q==="day")q("prevMonth");else if(Q==="month")q("prevYear");else q("prevYearRange")}),Y.addEventListener("click",(U)=>{if(U.stopPropagation(),Q==="day")q("nextMonth");else if(Q==="month")q("nextYear");else q("nextYearRange")}),j.appendChild(G),j.appendChild(K),z.appendChild(W),z.appendChild(Y),j.appendChild(z),j},Jj=(J)=>{let $=v({tag:"div",className:`${J}-datepicker-weekdays`});return KZ.forEach((Q)=>{let Z=v({tag:"span",className:`${J}-datepicker-weekday`,text:Q});$.appendChild(Z)}),$},Qj=({currentYear:J,currentMonth:$,selectedDate:Q,rangeEndDate:Z,minDate:q,maxDate:j,prefix:G,emit:K})=>{let z=v({tag:"div",className:`${G}-datepicker-days`});return BZ(J,$,Q,Z,q,j).forEach((Y)=>{let U=[`${G}-datepicker-day`,Y.isCurrentMonth?"":zZ,Y.isToday?GZ:"",Y.isSelected?i$:"",Y.isDisabled?"disabled":"",Y.isRangeStart?WZ:"",Y.isRangeEnd?YZ:"",Y.isRangeMiddle?UZ:""].filter(Boolean).join(" "),X=v({tag:"button",className:U,text:Y.day.toString(),attributes:{type:"button","aria-label":Y.date.toLocaleDateString(),"aria-selected":Y.isSelected?"true":"false","aria-disabled":Y.isDisabled?"true":"false","data-date":Y.date.toISOString(),disabled:Y.isDisabled}});X.addEventListener("click",(_)=>{if(_.stopPropagation(),!Y.isDisabled)K("dateSelected",{date:Y.date})}),z.appendChild(X)}),z},Zj=({currentMonth:J,prefix:$,emit:Q})=>{let Z=v({tag:"div",className:`${$}-datepicker-months`});return c$.forEach((q,j)=>{let G=j===J,K=v({tag:"button",className:`${$}-datepicker-month ${G?i$:""}`,text:q,attributes:{type:"button","aria-selected":G?"true":"false","data-month":j.toString()}});K.addEventListener("click",(z)=>{z.stopPropagation(),Q("monthSelected",{month:j})}),Z.appendChild(K)}),Z},qj=({currentYear:J,prefix:$,emit:Q})=>{let Z=v({tag:"div",className:`${$}-datepicker-years`});return FZ(J,10).forEach((j)=>{let G=j===J,K=v({tag:"button",className:`${$}-datepicker-year ${G?i$:""}`,text:j.toString(),attributes:{type:"button","aria-selected":G?"true":"false","data-year":j.toString()}});K.addEventListener("click",(z)=>{z.stopPropagation(),Q("yearSelected",{year:j})}),Z.appendChild(K)}),Z},jj=({prefix:J,emit:$})=>{let Q=v({tag:"div",className:`${J}-datepicker-footer`}),Z=v({tag:"button",className:`${J}-datepicker-cancel ${J}-button ${J}-button--text`,text:"Cancel",attributes:{type:"button"}}),q=v({tag:"button",className:`${J}-datepicker-ok ${J}-button ${J}-button--text`,text:"OK",attributes:{type:"button"}});return Z.addEventListener("click",(j)=>{j.stopPropagation(),$("cancel")}),q.addEventListener("click",(j)=>{j.stopPropagation(),$("confirm")}),Q.appendChild(Z),Q.appendChild(q),Q},LZ=(J,$)=>{let{prefix:Q,currentView:Z,currentMonth:q,currentYear:j,selectedDate:G,rangeEndDate:K,minDate:z,maxDate:W,variant:Y}=J,U=v({tag:"div",className:`${Q}-datepicker-calendar-content`}),X=$j({currentMonth:q,currentYear:j,currentView:Z,prefix:Q,emit:$});if(U.appendChild(X),Z==="day"){let _=Jj(Q);U.appendChild(_);let H=Qj({currentYear:j,currentMonth:q,selectedDate:G,rangeEndDate:K,minDate:z,maxDate:W,prefix:Q,emit:$});U.appendChild(H)}else if(Z==="month"){let _=Zj({currentMonth:q,prefix:Q,emit:$});U.appendChild(_)}else if(Z==="year"){let _=qj({currentYear:j,prefix:Q,emit:$});U.appendChild(_)}if(Y!=="docked"){let _=jj({prefix:Q,emit:$});U.appendChild(_)}return U};A6();var Kj=(J={})=>{let $=kZ(J);try{let Q={isOpen:!1,selectedDate:null,rangeEndDate:null,currentView:$.initialView,currentMonth:new Date().getMonth(),currentYear:new Date().getFullYear(),minDate:$.minDate?S6($.minDate):null,maxDate:$.maxDate?S6($.maxDate):null,dateFormat:$.dateFormat,variant:$.variant,selectionMode:$.selectionMode,closeOnSelect:$.closeOnSelect,prefix:$.prefix||u,calendarElement:null,input:null,updateInputValue(){if(!this.input)return;if(!this.selectedDate){this.input.value="";return}if(this.selectionMode==="range"&&this.rangeEndDate){let G=R9(this.selectedDate,this.dateFormat),K=R9(this.rangeEndDate,this.dateFormat);this.input.value=`${G} - ${K}`;return}this.input.value=R9(this.selectedDate,this.dateFormat)},updateCalendar(){if(!this.isOpen||!this.calendarElement)return;this.calendarElement.innerHTML="";let G=LZ(this,(K,z)=>{switch(K){case"dateSelected":this.handleDateSelection(z.date);break;case"monthSelected":this.currentMonth=z.month,this.currentView="day",this.updateCalendar();break;case"yearSelected":this.currentYear=z.year,this.currentView="month",this.updateCalendar();break;case"viewChange":this.currentView=z.view,this.updateCalendar();break;case"prevMonth":this.prevMonth();break;case"nextMonth":this.nextMonth();break;case"prevYear":this.prevYear();break;case"nextYear":this.nextYear();break;case"prevYearRange":this.currentYear-=20,this.updateCalendar();break;case"nextYearRange":this.currentYear+=20,this.updateCalendar();break;case"cancel":this.isOpen=!1,this.render();break;case"confirm":this.isOpen=!1,this.render();break}});this.calendarElement.appendChild(G)},handleDateSelection(G){if(this.selectionMode==="range")if(!this.selectedDate||this.selectedDate&&this.rangeEndDate)this.selectedDate=G,this.rangeEndDate=null;else{if(G<this.selectedDate)this.rangeEndDate=this.selectedDate,this.selectedDate=G;else this.rangeEndDate=G;if(this.closeOnSelect)this.isOpen=!1}else if(this.selectedDate=G,this.closeOnSelect)this.isOpen=!1;this.updateInputValue(),this.updateCalendar(),Z.emit("change",{value:this.selectedDate,rangeEndDate:this.rangeEndDate,formattedValue:this.input.value})},prevMonth(){if(this.currentMonth===0)this.currentMonth=11,this.currentYear--;else this.currentMonth--;this.updateCalendar()},nextMonth(){if(this.currentMonth===11)this.currentMonth=0,this.currentYear++;else this.currentMonth++;this.updateCalendar()},prevYear(){this.currentYear--,this.updateCalendar()},nextYear(){this.currentYear++,this.updateCalendar()},render(){if(this.calendarElement)if(this.isOpen)this.calendarElement.style.display="block",this.updateCalendar(),setTimeout(()=>{this.calendarElement.focus()},10);else this.calendarElement.style.display="none"}};if($.value)if(Array.isArray($.value)&&$.selectionMode==="range"){let G=S6($.value[0]),K=S6($.value[1]);if(G&&K)Q.selectedDate=G,Q.rangeEndDate=K,Q.currentMonth=G.getMonth(),Q.currentYear=G.getFullYear()}else{let G=S6($.value);if(G)Q.selectedDate=G,Q.currentMonth=G.getMonth(),Q.currentYear=G.getFullYear()}let Z=b(S,g(),E(MZ($)),G6($),C())($),q=b(S,E(VZ($)))($);Q.input=q.element,Z.element.appendChild(Q.input),Q.updateInputValue();let j=NZ($);return Q.calendarElement=v({tag:"div",className:j.className,attributes:j.attributes}),Q.calendarElement.style.display="none",Z.element.appendChild(Q.calendarElement),Q.input.addEventListener("click",()=>{if(!Z.element.classList.contains("disabled"))if(Q.isOpen=!Q.isOpen,Q.render(),Q.isOpen)Z.emit("open",{value:Q.selectedDate});else Z.emit("close",{value:Q.selectedDate})}),Q.calendarElement.addEventListener("click",(G)=>{G.stopPropagation()}),document.addEventListener("click",(G)=>{if(Q.isOpen&&!Z.element.contains(G.target))Q.isOpen=!1,Q.render(),Z.emit("close",{value:Q.selectedDate})}),HZ(Q,_Z(Z))(Z)}catch(Q){throw console.error("DatePicker creation error:",Q),new Error(`Failed to create DatePicker: ${Q.message}`)}},UJ=Kj;J6();c();o();t();var Gj={size:"medium",animation:"scale",footerAlignment:"right",open:!1,closeButton:!0,closeOnOverlayClick:!0,closeOnEscape:!0,modal:!0,autofocus:!0,trapFocus:!0,divider:!1,animationDuration:150,buttons:[]},DZ=(J={})=>d(Gj,J,"dialog"),OZ=(J)=>{return p(J,{tag:"div",attributes:{},className:J.class})},PZ=(J)=>{return{tag:"div",attributes:{"aria-modal":J.modal===!1?!1:!0,role:"dialog",tabindex:-1},className:""}},RZ=(J)=>({visibility:{open:()=>J.visibility.open(),close:()=>J.visibility.close(),toggle:($)=>J.visibility.toggle($),isOpen:()=>J.visibility.isOpen()},content:{setTitle:($)=>J.content.setTitle($),getTitle:()=>J.content.getTitle(),setSubtitle:($)=>J.content.setSubtitle($),getSubtitle:()=>J.content.getSubtitle(),setContent:($)=>J.content.setContent($),getContent:()=>J.content.getContent(),getHeaderElement:()=>J.content.getHeaderElement(),getContentElement:()=>J.content.getContentElement(),getFooterElement:()=>J.content.getFooterElement()},buttons:{addButton:($)=>J.buttons.addButton($),removeButton:($)=>J.buttons.removeButton($),getButtons:()=>J.buttons.getButtons(),setFooterAlignment:($)=>J.buttons.setFooterAlignment($)},focus:{trapFocus:()=>J.focus.trapFocus(),releaseFocus:()=>J.focus.releaseFocus()},size:{setSize:($)=>J.size.setSize($)},divider:{toggleDivider:($)=>J.divider.toggleDivider($),hasDivider:()=>J.divider.hasDivider()},events:{on:($,Q)=>J.on($,Q),off:($,Q)=>J.off($,Q),trigger:($,Q)=>J.emit($,Q)},lifecycle:{destroy:()=>J.lifecycle.destroy()}});l9();J6();t();var zj={orientation:"horizontal",variant:"full-width",thickness:1},AZ=(J={})=>{return d(zj,J,"divider")};var wZ=(J)=>($)=>{let Q=J.orientation||"horizontal";$.element.classList.add(`${$.getClass("divider")}--${Q}`);let Z=J.thickness||1;if(Q==="horizontal")$.element.style.height=`${Z}px`,$.element.style.width="100%";else $.element.style.width=`${Z}px`,$.element.style.height="100%";return{...$,getOrientation(){return Q},setOrientation(q){if($.element.classList.remove(`${$.getClass("divider")}--${Q}`),$.element.classList.add(`${$.getClass("divider")}--${q}`),q==="horizontal")$.element.style.height=`${Z}px`,$.element.style.width="100%",$.element.style.marginTop="",$.element.style.marginBottom="";else $.element.style.width=`${Z}px`,$.element.style.height="100%",$.element.style.marginLeft="",$.element.style.marginRight="";return this}}},xZ=(J)=>($)=>{let Q=J.variant||"full-width",Z=J.orientation||"horizontal";if(Q==="inset"||Q==="middle-inset")if(Z==="horizontal"){let q=J.insetStart!==void 0?J.insetStart:16,j=J.insetEnd!==void 0?J.insetEnd:Q==="middle-inset"?16:0;$.element.style.marginLeft=`${q}px`,$.element.style.marginRight=`${j}px`}else{let q=J.insetStart!==void 0?J.insetStart:16,j=J.insetEnd!==void 0?J.insetEnd:Q==="middle-inset"?16:0;$.element.style.marginTop=`${q}px`,$.element.style.marginBottom=`${j}px`}return{...$,getVariant(){return Q},setVariant(q){$.element.classList.remove(`${$.getClass("divider")}--${Q}`),$.element.classList.add(`${$.getClass("divider")}--${q}`);let j=$.getOrientation?$.getOrientation():Z;if(q==="full-width")if(j==="horizontal")$.element.style.marginLeft="",$.element.style.marginRight="";else $.element.style.marginTop="",$.element.style.marginBottom="";else{let G=J.insetStart!==void 0?J.insetStart:16,K=J.insetEnd!==void 0?J.insetEnd:q==="middle-inset"?16:0;if(j==="horizontal")$.element.style.marginLeft=`${G}px`,$.element.style.marginRight=`${K}px`;else $.element.style.marginTop=`${G}px`,$.element.style.marginBottom=`${K}px`}return this},setInset(q,j){let G=$.getOrientation?$.getOrientation():Z;if(($.getVariant?$.getVariant():Q)!=="full-width")if(G==="horizontal"){if(q!==void 0)$.element.style.marginLeft=`${q}px`;if(j!==void 0)$.element.style.marginRight=`${j}px`}else{if(q!==void 0)$.element.style.marginTop=`${q}px`;if(j!==void 0)$.element.style.marginBottom=`${j}px`}return this}}},yZ=(J)=>($)=>{if(J.color)$.element.style.backgroundColor=J.color;let Q=J.thickness||1,Z=J.orientation||"horizontal";if(Z==="horizontal")$.element.style.height=`${Q}px`;else $.element.style.width=`${Q}px`;return{...$,setThickness(q){if(($.getOrientation?$.getOrientation():Z)==="horizontal")$.element.style.height=`${q}px`;else $.element.style.width=`${q}px`;return this},setColor(q){return $.element.style.backgroundColor=q,this}}};var s9=(J={})=>{let $=AZ(J);return b(S,E({tag:"hr",componentName:"divider",className:J.class}),wZ($),K6($),xZ($),yZ($))($)};T9();var z7={OPEN:"open",CLOSE:"close",BEFORE_OPEN:"beforeopen",BEFORE_CLOSE:"beforeclose",AFTER_OPEN:"afteropen",AFTER_CLOSE:"afterclose"},TZ=(J)=>($)=>{let Q=PZ(J),Z=document.createElement(Q.tag||"div");if(Z.classList.add($.getClass("dialog-overlay")),Q.attributes&&typeof Q.attributes==="object")Object.entries(Q.attributes).forEach(([M,k])=>{if(M&&typeof M==="string"&&k!==void 0)Z.setAttribute(M,String(k))});if(J.zIndex)Z.style.zIndex=String(J.zIndex);let q=()=>{let M=document.createElement("div");M.classList.add($.getClass("dialog-header"));let k=document.createElement("div");if(k.classList.add($.getClass("dialog-header-content")),M.appendChild(k),J.title){let N=document.createElement("h2");N.classList.add($.getClass("dialog-header-title")),N.textContent=J.title,k.appendChild(N)}if(J.subtitle){let N=document.createElement("p");N.classList.add($.getClass("dialog-header-subtitle")),N.textContent=J.subtitle,k.appendChild(N)}if(J.closeButton!==!1){let N=document.createElement("button");N.classList.add($.getClass("dialog-header-close")),N.setAttribute("aria-label","Close dialog"),N.innerHTML=`
|
|
13
|
+
`,$.element.appendChild(Q),$},iQ=(J)=>($)=>{let Q=J.labelPosition||"end",Z=`${J.prefix}-checkbox--label-${Q}`;return $.element.classList.add(Z),$},oQ=(J)=>({disabled:{enable:J.disabled?.enable,disable:J.disabled?.disable},lifecycle:{destroy:J.lifecycle?.destroy},checkable:{check:J.checkable?.check,uncheck:J.checkable?.uncheck,toggle:J.checkable?.toggle,isChecked:J.checkable?.isChecked}});var sq=(J,$)=>{let Q=S9($)(J);if($.indeterminate)Q.input.indeterminate=!0;return Q.setIndeterminate=(Z)=>{return Q.input.indeterminate=Z,Q.element.classList.toggle(`${$.prefix}-checkbox--indeterminate`,Z),Q},Q},mq=(J={})=>{let $=mQ(J);try{return b(S,g(),E(aQ($)),I9($),cQ($),z9($),iQ($),(Z)=>sq(Z,$),G6($),C(),(Z)=>sQ(oQ(Z))(Z))($)}catch(Q){throw console.error("Checkbox creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create checkbox: ${Q instanceof Error?Q.message:String(Q)}`)}},$J=mq;var s$={FILLED:"filled",OUTLINED:"outlined"},m$={START:"start",END:"end"},JJ={CHECKED:"checked",INDETERMINATE:"indeterminate",DISABLED:"disabled",FOCUSED:"focused"},QJ={ROOT:"checkbox",INPUT:"checkbox-input",ICON:"checkbox-icon",LABEL:"checkbox-label"};J6();c();o();var tQ=({disabled:J,lifecycle:$})=>(Q)=>{let Z=Q.element.classList.contains(`${Q.getClass("chip")}--selected`),q=Q.element.getAttribute("data-value")||null;return{...Q,element:Q.element,getValue(){let j=Q.element.getAttribute("data-value");if(j!==null)return q=j,j;if(q!==null)return Q.element.setAttribute("data-value",q),q;let K=Q.element.querySelector(`.${Q.getClass("chip")}-text`);if(K&&K.textContent){let G=K.textContent;if(G.includes(" Theme"))q=G.replace(" Theme","").toLowerCase();else q=G.toLowerCase().replace(/\s+/g,"-");return Q.element.setAttribute("data-value",q),q}return null},setValue(j){if(j!==null&&j!==void 0)q=j,Q.element.setAttribute("data-value",j);else q=null,Q.element.removeAttribute("data-value");return this},isDisabled(){return Q.element.getAttribute("aria-disabled")==="true"},enable(){return J.enable(),Q.element.classList.remove(`${Q.getClass("chip")}--disabled`),Q.element.setAttribute("aria-disabled","false"),Q.element.setAttribute("tabindex","0"),this},disable(){return J.disable(),Q.element.classList.add(`${Q.getClass("chip")}--disabled`),Q.element.setAttribute("aria-disabled","true"),Q.element.setAttribute("tabindex","-1"),this},setText(j){let K=`.${Q.getClass("chip")}-content`,G=Q.element.querySelector(K)||Q.element,W=`.${Q.getClass("chip")}-text`,z=Q.element.querySelector(W);if(!z&&j){z=document.createElement("span"),z.className=`${Q.getClass("chip")}-text`;let Y=Q.element.querySelector(`.${Q.getClass("chip")}-leading-icon`);if(Y)G.insertBefore(z,Y.nextSibling);else G.insertBefore(z,G.firstChild)}if(z){if(z.textContent=j||"",!j&&z.parentNode)z.parentNode.removeChild(z)}return this},getText(){let j=Q.element.querySelector(`.${Q.getClass("chip")}-text`);return j?j.textContent||"":""},setIcon(j){return this.setLeadingIcon(j)},getIcon(){let j=Q.element.querySelector(`.${Q.getClass("chip")}-leading-icon`);return j?j.innerHTML:""},setLeadingIcon(j){let K=Q.element.querySelector(`.${Q.getClass("chip")}-content`)||Q.element,G=`.${Q.getClass("chip")}-leading-icon`,W=Q.element.querySelector(G);if(!W&&j)W=document.createElement("span"),W.className=`${Q.getClass("chip")}-leading-icon`,K.insertBefore(W,K.firstChild);if(W){if(W.innerHTML=j||"",!j&&W.parentNode)W.parentNode.removeChild(W)}return this},setTrailingIcon(j,K){let G=Q.element.querySelector(`.${Q.getClass("chip")}-content`)||Q.element,W=`.${Q.getClass("chip")}-trailing-icon`,z=Q.element.querySelector(W);if(!z&&j){if(z=document.createElement("span"),z.className=`${Q.getClass("chip")}-trailing-icon`,G.appendChild(z),K)z.addEventListener("click",(Y)=>{Y.stopPropagation(),K(this)})}if(z){if(z.innerHTML=j||"",!j&&z.parentNode)z.parentNode.removeChild(z)}return this},isSelected(){return Z},setSelected(j){if(Z=!!j,j)Q.element.classList.add(`${Q.getClass("chip")}--selected`),Q.element.setAttribute("aria-selected","true");else Q.element.classList.remove(`${Q.getClass("chip")}--selected`),Q.element.setAttribute("aria-selected","false");return this},toggleSelected(){return this.setSelected(!Z)},destroy(){$.destroy()}}};t();var aq={variant:"filled",ripple:!0},nQ=(J={})=>d(aq,J,"chip"),eQ=(J)=>{let $={role:"button",tabindex:"0"};if(J.disabled===!0)$["aria-disabled"]="true";if(J.selected===!0)$["aria-selected"]="true";else if(J.selected===!1)$["aria-selected"]="false";let Q=[J.class,J.selected?`${J.prefix}-chip--selected`:null];return p(J,{tag:"div",attributes:$,className:Q,forwardEvents:{click:(Z)=>Z.element.getAttribute("aria-disabled")!=="true",keydown:(Z,q)=>{if(q.key===" "||q.key==="Enter")return q.preventDefault(),Z.element.click(),!0;return!1},focus:!0,blur:!0}})},$Z=(J)=>({disabled:{enable:()=>J.disabled?.enable(),disable:()=>J.disabled?.disable()},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var cq=(J={})=>{let $=nQ(J);try{let Q=b(S,g(),E(eQ($)),K6($),G6($),T6($),C())($),Z=document.createElement("div");if(Z.className=`${Q.getClass("chip")}-content`,Z.style.display="flex",Z.style.alignItems="center",Z.style.gap="8px",Z.style.width="100%",Q.element.appendChild(Z),J.leadingIcon||J.icon){let j=document.createElement("span");j.className=`${Q.getClass("chip")}-leading-icon`,j.innerHTML=J.leadingIcon||J.icon||"",Z.appendChild(j)}if(J.text){let j=document.createElement("span");j.className=`${Q.getClass("chip")}-text`,j.textContent=J.text,Z.appendChild(j)}if(J.trailingIcon){let j=document.createElement("span");if(j.className=`${Q.getClass("chip")}-trailing-icon`,j.innerHTML=J.trailingIcon,J.onTrailingIconClick)j.addEventListener("click",(K)=>{K.stopPropagation(),J.onTrailingIconClick(Q)});Z.appendChild(j)}if(J.selected)Q.element.classList.add(`${Q.getClass("chip")}--selected`),Q.element.setAttribute("aria-selected","true");if(J.value)Q.element.setAttribute("data-value",J.value);let q=tQ($Z(Q))(Q);if(!Q.element.hasAttribute("data-value")&&J.text)q.getValue();if(J.variant==="filter"||J.variant==="assist"||J.variant==="suggestion"||J.selectable)Q.element.addEventListener("click",()=>{if(q.isDisabled())return;let j=q.isSelected();q.toggleSelected();let K=q.isSelected();if(J.onChange&&j!==K)J.onChange(K,q);if(J.onSelect)J.onSelect(q)});return q}catch(Q){throw console.error("Chip creation error:",Q),new Error(`Failed to create chip: ${Q.message}`)}},t7=cq;c();o();var n7=(J)=>($)=>{if(!J.schema)return console.warn("No schema definition found in component config"),$;return{...$,schema:J.schema}};A6();var ZJ=(J)=>($)=>{if(!J.icon||!$.schema)return $;try{let Q=J.prefix||$.config?.prefix||"mtrl",Z=J.componentName||$.componentName||"component",q=JSON.parse(JSON.stringify($.schema)),j=J.iconPosition||"start",K=q.element.options.className||[],G=`${Q}-${Z}--icon`;if(Array.isArray(K)){if(!K.includes(G))K.push(G)}else if(typeof K==="string"){if(!K.includes(G))q.element.options.className=`${K} ${G}`.trim()}else q.element.options.className=[G];let W={name:"icon",creator:v,options:{tag:"span",className:[`${Q}-${Z}-icon`,`${Q}-${Z}-icon--${j}`],html:J.icon}};if(J.iconSize){let z=W.options.className;if(Array.isArray(z))z.push(`${Q}-${Z}-icon--${J.iconSize}`)}if(j==="start"){let z={...q.element.children};q.element.children={icon:W,...z}}else q.element.children.icon=W;return{...$,schema:q}}catch(Q){return console.warn("Error enhancing schema with icon:",Q),$}};A6();var e7=(J)=>($)=>{if(!J.label||!$.schema)return $;try{let Q=J.prefix||$.config?.prefix||"mtrl",Z=J.componentName||$.componentName||"component",q=JSON.parse(JSON.stringify($.schema)),j=J.labelPosition||"start",K=J.label,G=null;if(J.required)G={requiredIndicator:{name:"requiredIndicator",creator:v,options:{tag:"span",className:`${Q}-${Z}-label-required`,text:"*",attributes:{"aria-hidden":"true"}}}},K=J.label;let W={name:"label",creator:v,options:{tag:"label",className:[`${Q}-${Z}-label`,`${Q}-${Z}-label--${j}`],attributes:{for:J.id},text:K}};if(G)W.children=G;if(j==="end"||j==="bottom")q.element.children.label=W;else{let z={...q.element.children};q.element.children={label:W,...z}}return{...$,schema:q}}catch(Q){return console.warn("Error enhancing schema with label:",Q),$}};v$();var $$=()=>(J)=>{if(!J.schema)return J;try{let $=c5(J.schema),Q=$.getAll(),Z=J.config?.parent;if(typeof Z==="string")Z=document.querySelector(Z);if(Z&&$.element)Z.appendChild($.element);return{...J,element:$.element,components:Q}}catch($){throw console.error("Failed to create DOM structure:",$),new Error(`Failed to create component DOM: ${$.message}`)}};var qJ=(J)=>($)=>{let Q={scrollable:J.scrollable===!0,vertical:J.vertical===!0};return{...$,layout:{setScrollable(Z){if(Q.scrollable=Z,$.element)if(Z)$.element.classList.add(`${$.getClass("chips")}--scrollable`);else $.element.classList.remove(`${$.getClass("chips")}--scrollable`);return this},isScrollable(){return Q.scrollable},setVertical(Z){if(Q.vertical=Z,$.element)if(Z)$.element.classList.add(`${$.getClass("chips")}--vertical`);else $.element.classList.remove(`${$.getClass("chips")}--vertical`);return this},isVertical(){return Q.vertical}}}};var jJ=(J)=>($)=>{return{...$,chipInstances:[],onCreated(){if(typeof $.onCreated==="function")$.onCreated();if(Array.isArray(J.chips)&&J.chips.length>0)J.chips.forEach((Z)=>{this.chips?.addChip?.(Z)})}}};var KJ={FILLED:"filled",OUTLINED:"outlined",ELEVATED:"elevated",ASSIST:"assist",FILTER:"filter",INPUT:"input",SUGGESTION:"suggestion"},GJ={CHANGE:"change",SELECT:"select",DESELECT:"deselect",REMOVE:"remove"},X9={CHANGE:"change",ADD:"add",REMOVE:"remove"};var zJ=(J)=>($)=>{if(!$.element||!$.components)return console.warn("Cannot initialize chips controller: missing element or components"),$;let Q={change:[],add:[],remove:[]},Z=-1,q=(M,...V)=>{if(Q[M])Q[M].forEach((F)=>F(...V))},j=(M)=>{if(M.isSelected())M.element.classList.add(`${$.getClass("chip")}--selected`),M.element.setAttribute("aria-selected","true");else M.element.classList.remove(`${$.getClass("chip")}--selected`),M.element.setAttribute("aria-selected","false");if(!J.multiSelect){if($.chipInstances.forEach((O)=>{if(O!==M&&O.isSelected())O.setSelected(!1),O.element.classList.remove(`${$.getClass("chip")}--selected`),O.element.setAttribute("aria-selected","false")}),!M.isSelected()&&U().length===0)M.setSelected(!0),M.element.classList.add(`${$.getClass("chip")}--selected`),M.element.setAttribute("aria-selected","true")}let F=$.chipInstances.filter((O)=>O.isSelected()).map((O)=>O.getValue()),N=M?M.getValue():null;if(typeof J.onChange==="function")J.onChange(F,N);q(X9.CHANGE,F,N)},K=(M)=>{if($.chipInstances.length===0)return;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," "].includes(M.key))return;if(M.key==="Enter"||M.key===" "){if(Z>=0&&Z<$.chipInstances.length){M.preventDefault();let V=$.chipInstances[Z];if(!V.isDisabled()){if(V.toggleSelected(),V.isSelected())V.element.classList.add(`${$.getClass("chip")}--selected`),V.element.setAttribute("aria-selected","true");else V.element.classList.remove(`${$.getClass("chip")}--selected`),V.element.setAttribute("aria-selected","false");j(V)}return}}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(M.key)){M.preventDefault();let V=$.layout&&$.layout.isVertical(),F=Z;if(Z===-1)F=0;else if(V&&M.key==="ArrowUp"||!V&&M.key==="ArrowLeft")F=Math.max(0,Z-1);else if(V&&M.key==="ArrowDown"||!V&&M.key==="ArrowRight")F=Math.min($.chipInstances.length-1,Z+1);if(F!==Z){if(Z>=0&&Z<$.chipInstances.length)$.chipInstances[Z].element.blur();if(Z=F,$.chipInstances[Z].element.focus(),$.layout&&$.layout.isScrollable())G(Z)}}},G=(M)=>{if(!($.layout&&$.layout.isScrollable()))return;let F=typeof M==="number"?M:$.chipInstances.indexOf(M);if(F>=0&&F<$.chipInstances.length){let N=$.chipInstances[F].element,O=$.components.chipContainer||$.element,P=O.getBoundingClientRect(),L=N.getBoundingClientRect();if($.layout&&$.layout.isVertical()){let R=N.offsetTop-O.offsetTop-P.height/2+L.height/2;O.scrollTo({top:Math.max(0,R),behavior:"smooth"})}else{let R=N.offsetLeft-O.offsetLeft-P.width/2+L.width/2;O.scrollTo({left:Math.max(0,R),behavior:"smooth"})}}},W=(M)=>{let V=t7({...M,onSelect:M.onSelect}),F=$.components.chipContainer||$.element,N=document.createDocumentFragment();return N.appendChild(V.element),F.appendChild(N),$.chipInstances.push(V),V.element.addEventListener("click",()=>{if(!V.isDisabled()){if(V.toggleSelected(),V.isSelected())V.element.classList.add(`${$.getClass("chip")}--selected`),V.element.setAttribute("aria-selected","true");else V.element.classList.remove(`${$.getClass("chip")}--selected`),V.element.setAttribute("aria-selected","false");j(V),Z=$.chipInstances.indexOf(V)}}),V.element.addEventListener("keydown",K),q(X9.ADD,V),V},z=(M)=>{let V=typeof M==="number"?M:$.chipInstances.indexOf(M);if(V>=0&&V<$.chipInstances.length){let F=$.chipInstances[V];if(q(X9.REMOVE,F),F.destroy(),$.chipInstances.splice(V,1),V===Z)Z=-1;else if(V<Z)Z--}},Y=()=>{return[...$.chipInstances]},U=()=>{return $.chipInstances.filter((M)=>M.isSelected())},X=()=>{return U().map((M)=>M.getValue())},_=(M,V=!0,F=!J.multiSelect)=>{let N=Array.isArray(M)?M:[M],O=!1;if(F)$.chipInstances.forEach((P)=>{if(!N.includes(P.getValue())&&P.isSelected())P.setSelected(!1),P.element.classList.remove(`${$.getClass("chip")}--selected`),P.element.setAttribute("aria-selected","false"),O=!0});if($.chipInstances.forEach((P)=>{if(N.includes(P.getValue())&&!P.isSelected())P.setSelected(!0),P.element.classList.add(`${$.getClass("chip")}--selected`),P.element.setAttribute("aria-selected","true"),O=!0}),O&&V){let P=X();q(X9.CHANGE,P,null)}},H=(M=!0)=>{let F=X().length>0;if($.chipInstances.forEach((N)=>{N.setSelected(!1),N.element.classList.remove(`${$.getClass("chip")}--selected`),N.element.setAttribute("aria-selected","false")}),F&&M)q(X9.CHANGE,[],null)},B=()=>{$.chipInstances.forEach((M)=>{M.element.addEventListener("keydown",K)})},k=()=>{$.chipInstances.forEach((M)=>{M.element.removeEventListener("keydown",K)})};if(B(),$.element)$.element.addEventListener("keydown",K);if($.lifecycle){let M=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{$.chipInstances.forEach((V)=>{V.element.removeEventListener("keydown",K)}),$.chipInstances.forEach((V)=>V.destroy()),$.chipInstances.length=0,Object.keys(Q).forEach((V)=>{Q[V]=[]}),M()}}return{...$,chips:{addChip:W,removeChip:z,getChips:Y,getSelectedChips:U,getSelectedValues:X,selectByValue:_,clearSelection:H,scrollToChip:G},keyboard:{enable:B,disable:k},on(M,V){if(!Q[M])Q[M]=[];return Q[M].push(V),this},off(M,V){if(Q[M]){let F=Q[M].indexOf(V);if(F!==-1)Q[M].splice(F,1)}return this}}};var JZ=(J)=>($)=>{return{...$,element:$.element,addChip(Q){if(J.chips&&typeof J.chips.addChip==="function")J.chips.addChip(Q);return this},removeChip(Q){if(J.chips&&typeof J.chips.removeChip==="function")J.chips.removeChip(Q);return this},getChips(){if(J.chips&&typeof J.chips.getChips==="function")return J.chips.getChips();return[]},getSelectedChips(){if(J.chips&&typeof J.chips.getSelectedChips==="function")return J.chips.getSelectedChips();return[]},getSelectedValues(){if(J.chips&&typeof J.chips.getSelectedValues==="function")return J.chips.getSelectedValues();return[]},selectByValue(Q,Z=!0){if(J.chips&&typeof J.chips.selectByValue==="function")J.chips.selectByValue(Q,Z);return this},clearSelection(){if(J.chips&&typeof J.chips.clearSelection==="function")J.chips.clearSelection();return this},setScrollable(Q){if(J.layout&&typeof J.layout.setScrollable==="function")J.layout.setScrollable(Q);return this},setVertical(Q){if(J.layout&&typeof J.layout.setVertical==="function")J.layout.setVertical(Q);return this},setLabel(Q){if(J.label&&typeof J.label.setText==="function")J.label.setText(Q);return this},getLabel(){if(J.label&&typeof J.label.getText==="function")return J.label.getText();return""},setLabelPosition(Q){if(J.label&&typeof J.label.setPosition==="function")J.label.setPosition(Q);return this},getLabelPosition(){if(J.label&&typeof J.label.getPosition==="function")return J.label.getPosition();return"start"},scrollToChip(Q){if(J.chips&&typeof J.chips.scrollToChip==="function")J.chips.scrollToChip(Q);return this},enableKeyboardNavigation(){if(J.keyboard&&typeof J.keyboard.enableKeyboardNavigation==="function")J.keyboard.enableKeyboardNavigation();return this},on(Q,Z){if(J.events&&typeof J.events.on==="function")J.events.on(Q,Z);return this},off(Q,Z){if(J.events&&typeof J.events.off==="function")J.events.off(Q,Z);return this},destroy(){if(J.lifecycle&&typeof J.lifecycle.destroy==="function")J.lifecycle.destroy()}}};t();function QZ(J,$){let Q=(W)=>J.getClass(W),Z=$.scrollable===!0,q=$.vertical===!0,j=$.multiSelect===!0,K=$.label&&$.label.trim().length>0,G=$.labelPosition||"start";return{element:{options:{className:[Q("chips"),Z?Q("chips--scrollable"):null,q?Q("chips--vertical"):null,K?Q("chips--with-label"):null,K&&G==="end"?Q("chips--label-end"):null,$.class].filter(Boolean),attributes:{role:"group","aria-multiselectable":j?"true":"false"}},children:{...K?{label:{options:{tag:"label",className:Q("chips-label"),text:$.label}}}:{},chipContainer:{options:{className:Q("chips-container")}}}}}}var iq={chips:[],scrollable:!1,vertical:!1,multiSelect:!1,onChange:null,selector:null,labelPosition:"start"},ZZ=(J={})=>{let $=d(iq,J,"chips"),Q={componentName:"chips",config:$,getClass:(Z)=>{let q=$.prefix||"mtrl";return Z?`${q}-${Z}`:q}};return $.schema=QZ(Q,$),$};var qZ=(J)=>({chips:{addChip:function($){if(J.chips&&typeof J.chips.addChip==="function")return J.chips.addChip($);return null},removeChip:($)=>J.chips?.removeChip?.($),getChips:()=>J.chips?.getChips?.()??[],getSelectedChips:()=>J.chips?.getSelectedChips?.()??[],getSelectedValues:()=>J.chips?.getSelectedValues?.()??[],selectByValue:($)=>J.chips?.selectByValue?.($),clearSelection:()=>J.chips?.clearSelection?.(),scrollToChip:($)=>J.chips?.scrollToChip?.($)},layout:{setScrollable:($)=>J.layout?.setScrollable?.($),isScrollable:()=>J.layout?.isScrollable?.()??!1,setVertical:($)=>J.layout?.setVertical?.($),isVertical:()=>J.layout?.isVertical?.()??!1},label:{setText:($)=>J.label?.setText?.($),getText:()=>J.label?.getText?.()??"",setPosition:($)=>J.label?.setPosition?.($),getPosition:()=>J.label?.getPosition?.()??"start"},keyboard:{enableKeyboardNavigation:()=>J.keyboard?.enable?.(),disableKeyboardNavigation:()=>J.keyboard?.disable?.()},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var oq=(J={})=>{let $=ZZ(J);try{let Q=b(S,g(),n7($),qJ($),e7($),jJ($),$$(),zJ($),C())($),Z=qZ(Q),q=JZ(Z)(Q);if($.on&&typeof q.on==="function")Object.entries($.on).forEach(([j,K])=>{if(typeof K==="function")q.on(j,K)});return q}catch(Q){throw console.error("Chips creation error:",Q),new Error(`Failed to create chip: ${Q.message}`)}},jZ=oq;y6();J6();c();o();var KZ=["S","M","T","W","T","F","S"],a$=["January","February","March","April","May","June","July","August","September","October","November","December"],c$=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],WJ="MM/DD/YYYY",GZ="today",i$="selected",zZ="outside-month",WZ="range-start",YZ="range-end",UZ="range-middle";var S6=(J)=>{if(!J)return null;if(J instanceof Date)return isNaN(J.getTime())?null:J;if(typeof J==="string"){let $=new Date(J);return isNaN($.getTime())?null:$}return null},R9=(J,$="MM/DD/YYYY")=>{if(!J||!(J instanceof Date)||isNaN(J.getTime()))return"";let Q="",Z=0;while(Z<$.length)if($.substring(Z,Z+4)==="MMMM")Q+=a$[J.getMonth()],Z+=4;else if($.substring(Z,Z+3)==="MMM")Q+=c$[J.getMonth()],Z+=3;else if($.substring(Z,Z+2)==="MM")Q+=(J.getMonth()+1).toString().padStart(2,"0"),Z+=2;else if($.substring(Z,Z+1)==="M")Q+=J.getMonth()+1,Z+=1;else if($.substring(Z,Z+4)==="YYYY")Q+=J.getFullYear(),Z+=4;else if($.substring(Z,Z+2)==="YY")Q+=J.getFullYear().toString().slice(-2),Z+=2;else if($.substring(Z,Z+2)==="DD")Q+=J.getDate().toString().padStart(2,"0"),Z+=2;else if($.substring(Z,Z+1)==="D")Q+=J.getDate(),Z+=1;else Q+=$[Z],Z+=1;return Q},XZ=(J,$)=>{return new Date(J,$+1,0).getDate()},tq=(J,$)=>{return new Date(J,$,1).getDay()},P9=(J,$)=>{return J.getDate()===$.getDate()&&J.getMonth()===$.getMonth()&&J.getFullYear()===$.getFullYear()},nq=(J,$,Q)=>{let Z=J.getTime();return Z>=$.getTime()&&Z<=Q.getTime()},BZ=(J,$,Q=null,Z=null,q=null,j=null)=>{let K=new Date;K.setHours(0,0,0,0);let G=[],W=tq(J,$),z=XZ(J,$-1);for(let _=W-1;_>=0;_--){let H=new Date(J,$-1,z-_),B=q&&H<q||j&&H>j;G.push({date:H,day:H.getDate(),isCurrentMonth:!1,isToday:P9(H,K),isSelected:Q?P9(H,Q):!1,isDisabled:B})}let Y=XZ(J,$);for(let _=1;_<=Y;_++){let H=new Date(J,$,_),B=Q?P9(H,Q):!1,k=q&&H<q||j&&H>j,M={date:H,day:_,isCurrentMonth:!0,isToday:P9(H,K),isSelected:B,isDisabled:k};if(Q&&Z)M.isRangeStart=P9(H,Q),M.isRangeEnd=P9(H,Z),M.isRangeMiddle=nq(H,Q,Z)&&!M.isRangeStart&&!M.isRangeEnd;G.push(M)}let X=42-G.length;for(let _=1;_<=X;_++){let H=new Date(J,$+1,_),B=q&&H<q||j&&H>j;G.push({date:H,day:_,isCurrentMonth:!1,isToday:P9(H,K),isSelected:Q?P9(H,Q):!1,isDisabled:B})}return G},FZ=(J,$=10)=>{let Q=[],Z=J-$,q=J+$;for(let j=Z;j<=q;j++)Q.push(j);return Q};var YJ=(J,$)=>{let Q=new Date(J);return Q.setMonth(Q.getMonth()+$),Q};var HZ=(J,{disabled:$,lifecycle:Q,events:Z})=>(q)=>{let j={goToDate(K){let G=S6(K);if(!G)return;J.currentMonth=G.getMonth(),J.currentYear=G.getFullYear(),J.updateCalendar()},nextMonth(){let K=YJ(new Date(J.currentYear,J.currentMonth,1),1);J.currentMonth=K.getMonth(),J.currentYear=K.getFullYear(),J.updateCalendar()},prevMonth(){let K=YJ(new Date(J.currentYear,J.currentMonth,1),-1);J.currentMonth=K.getMonth(),J.currentYear=K.getFullYear(),J.updateCalendar()},nextYear(){J.currentYear+=1,J.updateCalendar()},prevYear(){J.currentYear-=1,J.updateCalendar()},showDayView(){J.currentView="day",J.updateCalendar()},showMonthView(){J.currentView="month",J.updateCalendar()},showYearView(){J.currentView="year",J.updateCalendar()},getCurrentView(){return J.currentView}};return{...q,element:q.element,input:J.input,calendar:j,open(){return J.isOpen=!0,J.render(),Z.emit("open",{value:this.getValue()}),this},close(){return J.isOpen=!1,J.render(),Z.emit("close",{value:this.getValue()}),this},getValue(){if(!J.selectedDate)return null;if(J.selectionMode==="range"&&J.rangeEndDate)return[new Date(J.selectedDate),new Date(J.rangeEndDate)];return new Date(J.selectedDate)},setValue(K){if(Array.isArray(K)&&J.selectionMode==="range"){let W=S6(K[0]),z=S6(K[1]);if(W&&z){if(J.selectedDate=W,J.rangeEndDate=z,W>z)J.selectedDate=z,J.rangeEndDate=W;if(J.updateInputValue(),J.isOpen)J.currentMonth=J.selectedDate.getMonth(),J.currentYear=J.selectedDate.getFullYear(),J.updateCalendar();Z.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this}let G=S6(K);if(G){if(J.selectedDate=G,J.rangeEndDate=null,J.updateInputValue(),J.isOpen)J.currentMonth=G.getMonth(),J.currentYear=G.getFullYear(),J.updateCalendar();Z.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this},getFormattedValue(){if(!J.selectedDate)return"";if(J.selectionMode==="range"&&J.rangeEndDate){let K=R9(J.selectedDate,J.dateFormat),G=R9(J.rangeEndDate,J.dateFormat);return`${K} - ${G}`}return R9(J.selectedDate,J.dateFormat)},clear(){if(J.selectedDate=null,J.rangeEndDate=null,J.updateInputValue(),J.isOpen)J.updateCalendar();return Z.emit("change",{value:null,formattedValue:""}),this},enable(){return $.enable(),J.input.disabled=!1,this},disable(){return $.disable(),J.input.disabled=!0,this},setMinDate(K){let G=S6(K);if(G){if(J.minDate=G,J.isOpen)J.updateCalendar()}return this},setMaxDate(K){let G=S6(K);if(G){if(J.maxDate=G,J.isOpen)J.updateCalendar()}return this},destroy(){if(document.removeEventListener("click",J.outsideClickHandler),J.calendarElement&&J.calendarElement.parentNode)J.calendarElement.parentNode.removeChild(J.calendarElement);Q.destroy()},on(K,G){return Z.on(K,G),this},off(K,G){return Z.off(K,G),this}}};t();var eq={variant:"docked",initialView:"day",selectionMode:"single",dateFormat:WJ,animate:!0},MZ=(J={})=>{let $=d(eq,J,"datepicker");if($.closeOnSelect===void 0)$.closeOnSelect=$.variant!=="docked";return $},kZ=(J)=>{return p(J,{tag:"div",attributes:{role:"application","aria-label":"Date Picker",tabindex:"-1"},className:[`${J.prefix}-datepicker-container`,J.class],forwardEvents:{keydown:!0,click:!0},interactive:!0})},NZ=(J)=>{let $={type:"text",placeholder:J.placeholder||J.dateFormat,autocomplete:"off",readonly:!0};if(J.disabled===!0)$.disabled=!0;return p(J,{tag:"input",attributes:$,className:`${J.prefix}-datepicker-input`,forwardEvents:{focus:!0,blur:!0,click:!0},interactive:!0})},VZ=(J)=>{return p(J,{tag:"div",attributes:{role:"dialog","aria-modal":J.variant!=="docked"?"true":"false"},className:[`${J.prefix}-datepicker-calendar`,`${J.prefix}-datepicker-${J.variant}`,J.selectionMode==="range"?`${J.prefix}-datepicker-range`:""],forwardEvents:{keydown:!0,click:!0}})},_Z=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()},events:{on:J.on,off:J.off,emit:J.emit}});A6();var $j=({currentMonth:J,currentYear:$,currentView:Q,prefix:Z,emit:q})=>{let j=v({tag:"div",className:`${Z}-datepicker-header`}),K=v({tag:"button",className:`${Z}-datepicker-month-selector`,text:a$[J],attributes:{type:"button","aria-label":"Select month"}}),G=v({tag:"button",className:`${Z}-datepicker-year-selector`,text:$.toString(),attributes:{type:"button","aria-label":"Select year"}}),W=v({tag:"div",className:`${Z}-datepicker-nav-controls`}),z=v({tag:"button",className:`${Z}-datepicker-prev-btn`,html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>',attributes:{type:"button","aria-label":Q==="day"?"Previous month":Q==="month"?"Previous year":"Previous year range"}}),Y=v({tag:"button",className:`${Z}-datepicker-next-btn`,html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>',attributes:{type:"button","aria-label":Q==="day"?"Next month":Q==="month"?"Next year":"Next year range"}});return K.addEventListener("click",(U)=>{U.stopPropagation(),q("viewChange",{view:"month"})}),G.addEventListener("click",(U)=>{U.stopPropagation(),q("viewChange",{view:"year"})}),z.addEventListener("click",(U)=>{if(U.stopPropagation(),Q==="day")q("prevMonth");else if(Q==="month")q("prevYear");else q("prevYearRange")}),Y.addEventListener("click",(U)=>{if(U.stopPropagation(),Q==="day")q("nextMonth");else if(Q==="month")q("nextYear");else q("nextYearRange")}),j.appendChild(K),j.appendChild(G),W.appendChild(z),W.appendChild(Y),j.appendChild(W),j},Jj=(J)=>{let $=v({tag:"div",className:`${J}-datepicker-weekdays`});return KZ.forEach((Q)=>{let Z=v({tag:"span",className:`${J}-datepicker-weekday`,text:Q});$.appendChild(Z)}),$},Qj=({currentYear:J,currentMonth:$,selectedDate:Q,rangeEndDate:Z,minDate:q,maxDate:j,prefix:K,emit:G})=>{let W=v({tag:"div",className:`${K}-datepicker-days`});return BZ(J,$,Q,Z,q,j).forEach((Y)=>{let U=[`${K}-datepicker-day`,Y.isCurrentMonth?"":zZ,Y.isToday?GZ:"",Y.isSelected?i$:"",Y.isDisabled?"disabled":"",Y.isRangeStart?WZ:"",Y.isRangeEnd?YZ:"",Y.isRangeMiddle?UZ:""].filter(Boolean).join(" "),X=v({tag:"button",className:U,text:Y.day.toString(),attributes:{type:"button","aria-label":Y.date.toLocaleDateString(),"aria-selected":Y.isSelected?"true":"false","aria-disabled":Y.isDisabled?"true":"false","data-date":Y.date.toISOString(),disabled:Y.isDisabled}});X.addEventListener("click",(_)=>{if(_.stopPropagation(),!Y.isDisabled)G("dateSelected",{date:Y.date})}),W.appendChild(X)}),W},Zj=({currentMonth:J,prefix:$,emit:Q})=>{let Z=v({tag:"div",className:`${$}-datepicker-months`});return c$.forEach((q,j)=>{let K=j===J,G=v({tag:"button",className:`${$}-datepicker-month ${K?i$:""}`,text:q,attributes:{type:"button","aria-selected":K?"true":"false","data-month":j.toString()}});G.addEventListener("click",(W)=>{W.stopPropagation(),Q("monthSelected",{month:j})}),Z.appendChild(G)}),Z},qj=({currentYear:J,prefix:$,emit:Q})=>{let Z=v({tag:"div",className:`${$}-datepicker-years`});return FZ(J,10).forEach((j)=>{let K=j===J,G=v({tag:"button",className:`${$}-datepicker-year ${K?i$:""}`,text:j.toString(),attributes:{type:"button","aria-selected":K?"true":"false","data-year":j.toString()}});G.addEventListener("click",(W)=>{W.stopPropagation(),Q("yearSelected",{year:j})}),Z.appendChild(G)}),Z},jj=({prefix:J,emit:$})=>{let Q=v({tag:"div",className:`${J}-datepicker-footer`}),Z=v({tag:"button",className:`${J}-datepicker-cancel ${J}-button ${J}-button--text`,text:"Cancel",attributes:{type:"button"}}),q=v({tag:"button",className:`${J}-datepicker-ok ${J}-button ${J}-button--text`,text:"OK",attributes:{type:"button"}});return Z.addEventListener("click",(j)=>{j.stopPropagation(),$("cancel")}),q.addEventListener("click",(j)=>{j.stopPropagation(),$("confirm")}),Q.appendChild(Z),Q.appendChild(q),Q},LZ=(J,$)=>{let{prefix:Q,currentView:Z,currentMonth:q,currentYear:j,selectedDate:K,rangeEndDate:G,minDate:W,maxDate:z,variant:Y}=J,U=v({tag:"div",className:`${Q}-datepicker-calendar-content`}),X=$j({currentMonth:q,currentYear:j,currentView:Z,prefix:Q,emit:$});if(U.appendChild(X),Z==="day"){let _=Jj(Q);U.appendChild(_);let H=Qj({currentYear:j,currentMonth:q,selectedDate:K,rangeEndDate:G,minDate:W,maxDate:z,prefix:Q,emit:$});U.appendChild(H)}else if(Z==="month"){let _=Zj({currentMonth:q,prefix:Q,emit:$});U.appendChild(_)}else if(Z==="year"){let _=qj({currentYear:j,prefix:Q,emit:$});U.appendChild(_)}if(Y!=="docked"){let _=jj({prefix:Q,emit:$});U.appendChild(_)}return U};A6();var Kj=(J={})=>{let $=MZ(J);try{let Q={isOpen:!1,selectedDate:null,rangeEndDate:null,currentView:$.initialView,currentMonth:new Date().getMonth(),currentYear:new Date().getFullYear(),minDate:$.minDate?S6($.minDate):null,maxDate:$.maxDate?S6($.maxDate):null,dateFormat:$.dateFormat,variant:$.variant,selectionMode:$.selectionMode,closeOnSelect:$.closeOnSelect,prefix:$.prefix||u,calendarElement:null,input:null,updateInputValue(){if(!this.input)return;if(!this.selectedDate){this.input.value="";return}if(this.selectionMode==="range"&&this.rangeEndDate){let K=R9(this.selectedDate,this.dateFormat),G=R9(this.rangeEndDate,this.dateFormat);this.input.value=`${K} - ${G}`;return}this.input.value=R9(this.selectedDate,this.dateFormat)},updateCalendar(){if(!this.isOpen||!this.calendarElement)return;this.calendarElement.innerHTML="";let K=LZ(this,(G,W)=>{switch(G){case"dateSelected":this.handleDateSelection(W.date);break;case"monthSelected":this.currentMonth=W.month,this.currentView="day",this.updateCalendar();break;case"yearSelected":this.currentYear=W.year,this.currentView="month",this.updateCalendar();break;case"viewChange":this.currentView=W.view,this.updateCalendar();break;case"prevMonth":this.prevMonth();break;case"nextMonth":this.nextMonth();break;case"prevYear":this.prevYear();break;case"nextYear":this.nextYear();break;case"prevYearRange":this.currentYear-=20,this.updateCalendar();break;case"nextYearRange":this.currentYear+=20,this.updateCalendar();break;case"cancel":this.isOpen=!1,this.render();break;case"confirm":this.isOpen=!1,this.render();break}});this.calendarElement.appendChild(K)},handleDateSelection(K){if(this.selectionMode==="range")if(!this.selectedDate||this.selectedDate&&this.rangeEndDate)this.selectedDate=K,this.rangeEndDate=null;else{if(K<this.selectedDate)this.rangeEndDate=this.selectedDate,this.selectedDate=K;else this.rangeEndDate=K;if(this.closeOnSelect)this.isOpen=!1}else if(this.selectedDate=K,this.closeOnSelect)this.isOpen=!1;this.updateInputValue(),this.updateCalendar(),Z.emit("change",{value:this.selectedDate,rangeEndDate:this.rangeEndDate,formattedValue:this.input.value})},prevMonth(){if(this.currentMonth===0)this.currentMonth=11,this.currentYear--;else this.currentMonth--;this.updateCalendar()},nextMonth(){if(this.currentMonth===11)this.currentMonth=0,this.currentYear++;else this.currentMonth++;this.updateCalendar()},prevYear(){this.currentYear--,this.updateCalendar()},nextYear(){this.currentYear++,this.updateCalendar()},render(){if(this.calendarElement)if(this.isOpen)this.calendarElement.style.display="block",this.updateCalendar(),setTimeout(()=>{this.calendarElement.focus()},10);else this.calendarElement.style.display="none"}};if($.value)if(Array.isArray($.value)&&$.selectionMode==="range"){let K=S6($.value[0]),G=S6($.value[1]);if(K&&G)Q.selectedDate=K,Q.rangeEndDate=G,Q.currentMonth=K.getMonth(),Q.currentYear=K.getFullYear()}else{let K=S6($.value);if(K)Q.selectedDate=K,Q.currentMonth=K.getMonth(),Q.currentYear=K.getFullYear()}let Z=b(S,g(),E(kZ($)),G6($),C())($),q=b(S,E(NZ($)))($);Q.input=q.element,Z.element.appendChild(Q.input),Q.updateInputValue();let j=VZ($);return Q.calendarElement=v({tag:"div",className:j.className,attributes:j.attributes}),Q.calendarElement.style.display="none",Z.element.appendChild(Q.calendarElement),Q.input.addEventListener("click",()=>{if(!Z.element.classList.contains("disabled"))if(Q.isOpen=!Q.isOpen,Q.render(),Q.isOpen)Z.emit("open",{value:Q.selectedDate});else Z.emit("close",{value:Q.selectedDate})}),Q.calendarElement.addEventListener("click",(K)=>{K.stopPropagation()}),document.addEventListener("click",(K)=>{if(Q.isOpen&&!Z.element.contains(K.target))Q.isOpen=!1,Q.render(),Z.emit("close",{value:Q.selectedDate})}),HZ(Q,_Z(Z))(Z)}catch(Q){throw console.error("DatePicker creation error:",Q),new Error(`Failed to create DatePicker: ${Q.message}`)}},UJ=Kj;J6();c();o();t();var Gj={size:"medium",animation:"scale",footerAlignment:"right",open:!1,closeButton:!0,closeOnOverlayClick:!0,closeOnEscape:!0,modal:!0,autofocus:!0,trapFocus:!0,divider:!1,animationDuration:150,buttons:[]},DZ=(J={})=>d(Gj,J,"dialog"),OZ=(J)=>{return p(J,{tag:"div",attributes:{},className:J.class})},PZ=(J)=>{return{tag:"div",attributes:{"aria-modal":J.modal===!1?!1:!0,role:"dialog",tabindex:-1},className:""}},RZ=(J)=>({visibility:{open:()=>J.visibility.open(),close:()=>J.visibility.close(),toggle:($)=>J.visibility.toggle($),isOpen:()=>J.visibility.isOpen()},content:{setTitle:($)=>J.content.setTitle($),getTitle:()=>J.content.getTitle(),setSubtitle:($)=>J.content.setSubtitle($),getSubtitle:()=>J.content.getSubtitle(),setContent:($)=>J.content.setContent($),getContent:()=>J.content.getContent(),getHeaderElement:()=>J.content.getHeaderElement(),getContentElement:()=>J.content.getContentElement(),getFooterElement:()=>J.content.getFooterElement()},buttons:{addButton:($)=>J.buttons.addButton($),removeButton:($)=>J.buttons.removeButton($),getButtons:()=>J.buttons.getButtons(),setFooterAlignment:($)=>J.buttons.setFooterAlignment($)},focus:{trapFocus:()=>J.focus.trapFocus(),releaseFocus:()=>J.focus.releaseFocus()},size:{setSize:($)=>J.size.setSize($)},divider:{toggleDivider:($)=>J.divider.toggleDivider($),hasDivider:()=>J.divider.hasDivider()},events:{on:($,Q)=>J.on($,Q),off:($,Q)=>J.off($,Q),trigger:($,Q)=>J.emit($,Q)},lifecycle:{destroy:()=>J.lifecycle.destroy()}});l9();J6();t();var zj={orientation:"horizontal",variant:"full-width",thickness:1},AZ=(J={})=>{return d(zj,J,"divider")};var wZ=(J)=>($)=>{let Q=J.orientation||"horizontal";$.element.classList.add(`${$.getClass("divider")}--${Q}`);let Z=J.thickness||1;if(Q==="horizontal")$.element.style.height=`${Z}px`,$.element.style.width="100%";else $.element.style.width=`${Z}px`,$.element.style.height="100%";return{...$,getOrientation(){return Q},setOrientation(q){if($.element.classList.remove(`${$.getClass("divider")}--${Q}`),$.element.classList.add(`${$.getClass("divider")}--${q}`),q==="horizontal")$.element.style.height=`${Z}px`,$.element.style.width="100%",$.element.style.marginTop="",$.element.style.marginBottom="";else $.element.style.width=`${Z}px`,$.element.style.height="100%",$.element.style.marginLeft="",$.element.style.marginRight="";return this}}},xZ=(J)=>($)=>{let Q=J.variant||"full-width",Z=J.orientation||"horizontal";if(Q==="inset"||Q==="middle-inset")if(Z==="horizontal"){let q=J.insetStart!==void 0?J.insetStart:16,j=J.insetEnd!==void 0?J.insetEnd:Q==="middle-inset"?16:0;$.element.style.marginLeft=`${q}px`,$.element.style.marginRight=`${j}px`}else{let q=J.insetStart!==void 0?J.insetStart:16,j=J.insetEnd!==void 0?J.insetEnd:Q==="middle-inset"?16:0;$.element.style.marginTop=`${q}px`,$.element.style.marginBottom=`${j}px`}return{...$,getVariant(){return Q},setVariant(q){$.element.classList.remove(`${$.getClass("divider")}--${Q}`),$.element.classList.add(`${$.getClass("divider")}--${q}`);let j=$.getOrientation?$.getOrientation():Z;if(q==="full-width")if(j==="horizontal")$.element.style.marginLeft="",$.element.style.marginRight="";else $.element.style.marginTop="",$.element.style.marginBottom="";else{let K=J.insetStart!==void 0?J.insetStart:16,G=J.insetEnd!==void 0?J.insetEnd:q==="middle-inset"?16:0;if(j==="horizontal")$.element.style.marginLeft=`${K}px`,$.element.style.marginRight=`${G}px`;else $.element.style.marginTop=`${K}px`,$.element.style.marginBottom=`${G}px`}return this},setInset(q,j){let K=$.getOrientation?$.getOrientation():Z;if(($.getVariant?$.getVariant():Q)!=="full-width")if(K==="horizontal"){if(q!==void 0)$.element.style.marginLeft=`${q}px`;if(j!==void 0)$.element.style.marginRight=`${j}px`}else{if(q!==void 0)$.element.style.marginTop=`${q}px`;if(j!==void 0)$.element.style.marginBottom=`${j}px`}return this}}},yZ=(J)=>($)=>{if(J.color)$.element.style.backgroundColor=J.color;let Q=J.thickness||1,Z=J.orientation||"horizontal";if(Z==="horizontal")$.element.style.height=`${Q}px`;else $.element.style.width=`${Q}px`;return{...$,setThickness(q){if(($.getOrientation?$.getOrientation():Z)==="horizontal")$.element.style.height=`${q}px`;else $.element.style.width=`${q}px`;return this},setColor(q){return $.element.style.backgroundColor=q,this}}};var s9=(J={})=>{let $=AZ(J);return b(S,E({tag:"hr",componentName:"divider",className:J.class}),wZ($),K6($),xZ($),yZ($))($)};T9();var z7={OPEN:"open",CLOSE:"close",BEFORE_OPEN:"beforeopen",BEFORE_CLOSE:"beforeclose",AFTER_OPEN:"afteropen",AFTER_CLOSE:"afterclose"},TZ=(J)=>($)=>{let Q=PZ(J),Z=document.createElement(Q.tag||"div");if(Z.classList.add($.getClass("dialog-overlay")),Q.attributes&&typeof Q.attributes==="object")Object.entries(Q.attributes).forEach(([k,M])=>{if(k&&typeof k==="string"&&M!==void 0)Z.setAttribute(k,String(M))});if(J.zIndex)Z.style.zIndex=String(J.zIndex);let q=()=>{let k=document.createElement("div");k.classList.add($.getClass("dialog-header"));let M=document.createElement("div");if(M.classList.add($.getClass("dialog-header-content")),k.appendChild(M),J.title){let V=document.createElement("h2");V.classList.add($.getClass("dialog-header-title")),V.textContent=J.title,M.appendChild(V)}if(J.subtitle){let V=document.createElement("p");V.classList.add($.getClass("dialog-header-subtitle")),V.textContent=J.subtitle,M.appendChild(V)}if(J.closeButton!==!1){let V=document.createElement("button");V.classList.add($.getClass("dialog-header-close")),V.setAttribute("aria-label","Close dialog"),V.innerHTML=`
|
|
14
14
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
15
15
|
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
16
16
|
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
17
17
|
</svg>
|
|
18
|
-
`,N.addEventListener("click",(F)=>{if(F.preventDefault(),F.stopPropagation(),$&&$.emit)$.emit("dialog:close",{source:"closeButton"})}),M.appendChild(N)}return M},j=()=>{let M=document.createElement("div");if(M.classList.add($.getClass("dialog-content")),J.content)M.innerHTML=J.content;return M},G=()=>{let M=document.createElement("div");M.classList.add($.getClass("dialog-footer"));let k=J.footerAlignment||"right";if(k!=="right")f(M,`${$.getClass("dialog-footer")}--${k}`);if(Array.isArray(J.buttons)&&J.buttons.length>0)J.buttons.forEach((N)=>SZ(M,N,$));return M},K=()=>{return s9({variant:"full-width",class:$.getClass("dialog-divider")})},z=q(),W=j(),Y=Array.isArray(J.buttons)&&J.buttons.length>0?G():null;f($.element,$.getClass("dialog"));let U=J.size||"medium";if(U!=="medium")f($.element,`${$.getClass("dialog")}--${U}`);let X=J.animation||"scale";if(X!=="scale")f($.element,`${$.getClass("dialog")}--${X}`);$.element.appendChild(z);let _=null,H=null;if(J.divider){if(_=K(),_.element.classList.add($.getClass("dialog-header-divider")),$.element.appendChild(_.element),Y)H=K(),H.element.classList.add($.getClass("dialog-footer-divider"))}if($.element.appendChild(W),H)$.element.appendChild(H.element);if(Y)$.element.appendChild(Y);Z.appendChild($.element);let B=J.container||document.body;return B.appendChild(Z),{...$,overlay:Z,structure:{header:z,content:W,footer:Y,headerDivider:_,footerDivider:H,container:B}}},IZ=()=>(J)=>{return{...J,divider:{toggleDivider($){if($&&!J.structure.headerDivider){let Q=s9({variant:"full-width",class:`${J.getClass("dialog-divider")} ${J.getClass("dialog-header-divider")}`});if(J.element.insertBefore(Q.element,J.structure.content),J.structure.headerDivider=Q,J.structure.footer&&!J.structure.footerDivider){let Z=s9({variant:"full-width",class:`${J.getClass("dialog-divider")} ${J.getClass("dialog-footer-divider")}`});J.element.insertBefore(Z.element,J.structure.footer),J.structure.footerDivider=Z}}else if(!$){if(J.structure.headerDivider)J.structure.headerDivider.element.remove(),J.structure.headerDivider=null;if(J.structure.footerDivider)J.structure.footerDivider.element.remove(),J.structure.footerDivider=null}return J},hasDivider(){return J.structure.headerDivider!==null}}}},SZ=(J,$,Q)=>{let{text:Z,variant:q="text",onClick:j,closeDialog:G=!0,autofocus:K=!1,attributes:z={}}=$,W=e6({text:Z,variant:q,...z});if(W.on("click",(Y)=>{console.log("button click");let U=G;if(typeof j==="function")try{if(j(Y,Q)===!1)U=!1}catch(X){console.error("Error in onClick handler:",X)}if(U){if(Q&&Q.emit)Q.emit("dialog:close",{source:"button",text:Z})}}),K)W.element.setAttribute("autofocus","true");if(J.appendChild(W.element),!Q._buttons)Q._buttons=[];Q._buttons.push({config:$,instance:W})},bZ=()=>(J)=>{let $=J.config.open===!0,Q=J.config.animationDuration||150,Z='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',q=null,j=()=>{if(!J.config.trapFocus)return;let X=J.element.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(X.length===0)return;let _=X[0],H=X[X.length-1];if(J.config.autofocus){let M=J.element.querySelector("[autofocus]");if(M)M.focus();else _.focus()}J.element.addEventListener("keydown",B);function B(M){if(M.key!=="Tab")return;if(M.shiftKey){if(document.activeElement===_)H.focus(),M.preventDefault()}else if(document.activeElement===H)_.focus(),M.preventDefault()}},G=()=>{if(!J.config.trapFocus)return;if(J.element.removeEventListener("keydown",X),q)q.focus(),q=null;function X(){}},K=()=>{if(J.config.closeOnOverlayClick!==!1)J.overlay.addEventListener("click",W);if(J.config.closeOnEscape!==!1)document.addEventListener("keydown",Y)},z=()=>{J.overlay.removeEventListener("click",W),document.removeEventListener("keydown",Y)};function W(X){if(X.target===J.overlay)U.close()}function Y(X){if(X.key==="Escape"&&U.isOpen())U.close()}if($)f(J.overlay,`${J.getClass("dialog-overlay")}--visible`),f(J.element,`${J.getClass("dialog")}--visible`),j(),K();let U={open(){if(this.isOpen())return;q=document.activeElement;let X={dialog:J,defaultPrevented:!1,preventDefault:()=>{X.defaultPrevented=!0}};if(typeof J.emit==="function")J.emit(z7.BEFORE_OPEN,X);if(X.defaultPrevented)return;if(J.overlay&&!J.overlay.parentNode)(J.structure.container||document.body).appendChild(J.overlay);f(J.overlay,`${J.getClass("dialog-overlay")}--visible`),setTimeout(()=>{if(f(J.element,`${J.getClass("dialog")}--visible`),j(),K(),typeof J.emit==="function")J.emit(z7.OPEN,{dialog:J}),setTimeout(()=>{J.emit(z7.AFTER_OPEN,{dialog:J})},Q)},10)},close(){console.log("Dialog close method called");let X={dialog:J,defaultPrevented:!1,preventDefault:()=>{X.defaultPrevented=!0}};if(typeof J.emit==="function")J.emit(z7.BEFORE_CLOSE,X);if(X.defaultPrevented){console.log("Dialog close prevented by event handler");return}let _=`${J.getClass("dialog")}--visible`,H=`${J.getClass("dialog-overlay")}--visible`;if(q6(J.element,_),q6(J.overlay,H),G(),z(),typeof J.emit==="function")J.emit(z7.CLOSE,{dialog:J});setTimeout(()=>{if(J.overlay&&J.overlay.parentNode)J.overlay.parentNode.removeChild(J.overlay);if(typeof J.emit==="function")J.emit(z7.AFTER_CLOSE,{dialog:J})},Q)},toggle(X){if(X===void 0)this.isOpen()?this.close():this.open();else if(X)this.open();else this.close()},isOpen(){return J.element.classList.contains(`${J.getClass("dialog")}--visible`)}};if(J&&J.on)J.on("dialog:close",()=>{U.close()});return{...J,visibility:U}},vZ=()=>(J)=>{let $=J.structure.header,Q=J.structure.content,Z=J.structure.footer;return{...J,content:{setTitle(q){let j=$.querySelector(`.${J.getClass("dialog-header-title")}`);if(!j&&q)j=document.createElement("h2"),j.classList.add(J.getClass("dialog-header-title")),$.querySelector(`.${J.getClass("dialog-header-content")}`).appendChild(j);if(j)j.textContent=q},getTitle(){let q=$.querySelector(`.${J.getClass("dialog-header-title")}`);return q?q.textContent||"":""},setSubtitle(q){let j=$.querySelector(`.${J.getClass("dialog-header-subtitle")}`);if(!j&&q)j=document.createElement("p"),j.classList.add(J.getClass("dialog-header-subtitle")),$.querySelector(`.${J.getClass("dialog-header-content")}`).appendChild(j);if(j)j.textContent=q},getSubtitle(){let q=$.querySelector(`.${J.getClass("dialog-header-subtitle")}`);return q?q.textContent||"":""},setContent(q){Q.innerHTML=q},getContent(){return Q.innerHTML},getHeaderElement(){return $},getContentElement(){return Q},getFooterElement(){return Z}}}},CZ=()=>(J)=>{if(!J._buttons)J._buttons=[];return{...J,buttons:{addButton($){let Q=J.structure.footer;if(!Q){Q=document.createElement("div"),Q.classList.add(J.getClass("dialog-footer"));let Z=J.config.footerAlignment||"right";if(Z!=="right")f(Q,`${J.getClass("dialog-footer")}--${Z}`);J.element.appendChild(Q),J.structure.footer=Q}SZ(Q,$,J)},removeButton($){if(typeof $==="number"){if($>=0&&$<J._buttons.length)J._buttons[$].instance.destroy(),J._buttons.splice($,1)}else{let Q=J._buttons.findIndex((Z)=>Z.config.text===$);if(Q!==-1)J._buttons[Q].instance.destroy(),J._buttons.splice(Q,1)}if(J._buttons.length===0&&J.structure.footer)J.element.removeChild(J.structure.footer),J.structure.footer=null},getButtons(){return J._buttons.map(($)=>$.config)},setFooterAlignment($){if(!J.structure.footer)return;if(["right","left","center","space-between"].forEach((Z)=>{if(Z!=="right")q6(J.structure.footer,`${J.getClass("dialog-footer")}--${Z}`)}),$!=="right")f(J.structure.footer,`${J.getClass("dialog-footer")}--${$}`)}}}},EZ=()=>(J)=>{return{...J,size:{setSize($){if(["small","medium","large","fullwidth","fullscreen"].forEach((Z)=>{q6(J.element,`${J.getClass("dialog")}--${Z}`)}),$!=="medium")f(J.element,`${J.getClass("dialog")}--${$}`)}}}},hZ=()=>(J)=>{return{...J,confirm($){return new Promise((Q)=>{let{title:Z="Confirm",message:q,confirmText:j="Yes",cancelText:G="No",confirmVariant:K="filled",cancelVariant:z="text",size:W="small"}=$;J.content.setTitle(Z),J.content.setContent(`<p>${q}</p>`),J.size.setSize(W),J._buttons.forEach((Y)=>Y.instance.destroy()),J._buttons=[],J.buttons.addButton({text:j,variant:K,onClick:()=>{Q(!0)}}),J.buttons.addButton({text:G,variant:z,onClick:()=>{Q(!1)}}),J.visibility.open()})}}};T9();var uZ=(J)=>($)=>({...$,open(){return J.visibility.open(),this},close(){return J.visibility.close(),this},toggle(Q){return J.visibility.toggle(Q),this},isOpen(){return J.visibility.isOpen()},setTitle(Q){return J.content.setTitle(Q),this},getTitle(){return J.content.getTitle()},setSubtitle(Q){return J.content.setSubtitle(Q),this},getSubtitle(){return J.content.getSubtitle()},setContent(Q){return J.content.setContent(Q),this},getContent(){return J.content.getContent()},addButton(Q){return J.buttons.addButton(Q),this},removeButton(Q){return J.buttons.removeButton(Q),this},getButtons(){return J.buttons.getButtons()},setFooterAlignment(Q){return J.buttons.setFooterAlignment(Q),this},toggleDivider(Q){return J.divider.toggleDivider(Q),this},hasDivider(){return J.divider.hasDivider()},setSize(Q){return J.size.setSize(Q),this},on(Q,Z){return J.events.on(Q,Z),this},off(Q,Z){return J.events.off(Q,Z),this},getHeaderElement(){return J.content.getHeaderElement()},getContentElement(){return J.content.getContentElement()},getFooterElement(){return J.content.getFooterElement()},confirm(Q){if($.confirm)return $.confirm(Q||{message:"Are you sure?"});return Promise.resolve(!1)},destroy(){if(console.log("destroy",this.isOpen()),this.isOpen()){let Q=`${$.getClass("dialog")}--visible`,Z=`${$.getClass("dialog-overlay")}--visible`;if(q6($.element,Q),q6($.overlay,Z),J.focus&&J.focus.releaseFocus)J.focus.releaseFocus()}if(J.lifecycle.destroy(),$.overlay&&$.overlay.parentNode)$.overlay.parentNode.removeChild($.overlay)},element:$.element,overlay:$.overlay});var Wj=(J={})=>{let $=DZ(J);try{let Q=b(S,g(),E(OZ($)),TZ($),bZ(),vZ(),CZ(),EZ(),IZ(),hZ(),C(),(Z)=>uZ(RZ(Z))(Z))($);if($.on)Object.entries($.on).forEach(([Z,q])=>{if(typeof q==="function")Q.on(Z,q)});return Q}catch(Q){throw console.error("Dialog creation error:",Q),new Error(`Failed to create dialog: ${Q.message}`)}},XJ=Wj;J6();c();o();var fZ=({disabled:J,lifecycle:$,className:Q})=>(Z)=>({...Z,element:Z.element,getValue:()=>Z.element.value,setValue(q){return Z.element.value=q,this},enable(){return J.enable(),this},disable(){return J.disable(),this},setIcon(q){return Z.icon.setIcon(q),this},getIcon(){return Z.icon.getIcon()},setPosition(q){return["top-right","top-left","bottom-right","bottom-left"].forEach((G)=>{Z.element.classList.remove(`${Q}--${G}`)}),Z.element.classList.add(`${Q}--${q}`),this},getPosition(){let q=["top-right","top-left","bottom-right","bottom-left"];for(let j of q)if(Z.element.classList.contains(`${Q}--${j}`))return j;return null},lower(){return Z.element.classList.add(`${Q}--lowered`),this},raise(){return Z.element.classList.remove(`${Q}--lowered`),this},destroy(){$.destroy()}});t();var Yj={variant:"primary",size:"default",type:"button",ripple:!0},gZ=(J={})=>d(Yj,J,"fab"),dZ=(J)=>{let $={type:J.type||"button","aria-label":J.ariaLabel||(J.icon?"action":void 0)};if(J.disabled===!0)$.disabled=!0;let Q=[];if(Q.push(`fab--${J.size||"default"}`),J.animate)Q.push("fab--animate-enter");if(J.position)Q.push(`fab--${J.position}`);if(J.disabled===!0)Q.push("fab--disabled");let Z={...J,className:Q};return p(Z,{tag:"button",attributes:$,forwardEvents:{click:(q)=>!q.element.disabled,focus:!0,blur:!0},interactive:!0})},lZ=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()},className:J.getClass("fab")});var Uj=(J={})=>{let $=gZ(J);try{return b(S,g(),E(dZ($)),K6($),G9($),G6($),T6($),C(),(Z)=>fZ(lZ(Z))(Z))($)}catch(Q){throw console.error("FAB creation error:",Q),new Error(`Failed to create FAB: ${Q.message}`)}},o$=Uj;J6();c();o();var rZ=({disabled:J,lifecycle:$,text:Q,className:Z})=>(q)=>({...q,element:q.element,getValue:()=>q.element.value,setValue(j){return q.element.value=j,this},enable(){return J.enable(),this},disable(){return J.disable(),this},setIcon(j){return q.icon.setIcon(j),this},getIcon(){return q.icon.getIcon()},setText(j){return Q.setText(j),this},getText(){return Q.getText()},setPosition(j){return["top-right","top-left","bottom-right","bottom-left"].forEach((K)=>{q.element.classList.remove(`${Z}--${K}`)}),q.element.classList.add(`${Z}--${j}`),this},getPosition(){let j=["top-right","top-left","bottom-right","bottom-left"];for(let G of j)if(q.element.classList.contains(`${Z}--${G}`))return G;return null},lower(){return q.element.classList.add(`${Z}--lowered`),this},raise(){return q.element.classList.remove(`${Z}--lowered`),this},collapse(){q.element.classList.add(`${Z}--collapsed`);let j=new CustomEvent("collapse",{bubbles:!0,cancelable:!0});return q.element.dispatchEvent(j),this},expand(){q.element.classList.remove(`${Z}--collapsed`);let j=new CustomEvent("expand",{bubbles:!0,cancelable:!0});return q.element.dispatchEvent(j),this},destroy(){$.destroy()}});t();var Xj={variant:"primary",type:"button",ripple:!0,iconPosition:"start",width:"fixed"},pZ=(J={})=>d(Xj,J,"extended-fab"),sZ=(J)=>{let $={type:J.type||"button","aria-label":J.ariaLabel||J.text||(J.icon?"action":void 0)},Q=[`${J.prefix}-extended-fab`];if(J.variant)Q.push(`${J.prefix}-extended-fab--${J.variant}`);if(J.width)Q.push(`${J.prefix}-extended-fab--${J.width}`);if(J.animate)Q.push(`${J.prefix}-extended-fab--animate-enter`);if(J.position)Q.push(`${J.prefix}-extended-fab--${J.position}`);if(J.collapseOnScroll)Q.push(`${J.prefix}-extended-fab--collapsible`);if(J.class)Q.push(J.class);if(J.disabled===!0)$.disabled=!0,Q.push(`${J.prefix}-extended-fab--disabled`);return p(J,{tag:"button",attributes:$,className:Q,forwardEvents:{click:(Z)=>!Z.element.disabled,focus:!0,blur:!0},interactive:!0})},mZ=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()},className:J.getClass("extended-fab"),text:{setText:($)=>J.text.setText($),getText:()=>J.text.getText()}});var Bj=(J={})=>{let $=pZ(J),Q=(Z)=>{if($.collapseOnScroll){let q=window.scrollY,j=!1,G=10,K=()=>{if(!j)window.requestAnimationFrame(()=>{let W=window.scrollY,Y=W-q;if(Y>G)Z.collapse();else if(Y<-G)Z.expand();if(W<=0)Z.expand();q=W,j=!1}),j=!0};window.addEventListener("scroll",K,{passive:!0}),requestAnimationFrame(()=>{Z.expand()});let z=Z.destroy;Z.destroy=()=>{window.removeEventListener("scroll",K),z.call(Z)}}};try{let Z=b(S,g(),E(sZ($)),K6($),G9($),K9($),G6($),T6($),C(),(q)=>rZ(mZ(q))(q))($);return Q(Z),Z}catch(Z){throw console.error("Extended FAB creation error:",Z),new Error(`Failed to create Extended FAB: ${Z.message}`)}},t$=Bj;J6();c();o();var aZ=!1,Fj=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize menu controller: missing element"),$;let Q={visible:J.visible||!1,items:J.items||[],position:J.position,selectedItemId:null,activeItemIndex:-1,component:$},Z={triggerEvent(F,V={},O){let P={menu:Q.component,...V,originalEvent:O,preventDefault:()=>{P.defaultPrevented=!0},defaultPrevented:!1};return $.emit(F,P),P}},q=()=>{if($.opener&&typeof $.opener.getOpener==="function")return $.opener.getOpener();let{opener:F}=J;if(typeof F==="string"){let V=document.querySelector(F);if(!V)return console.warn(`Menu opener not found: ${F}`),null;return V}if(typeof F==="object"&&F!==null&&"element"in F)return F.element;return F},j=(F,V)=>{let O=document.createElement("li"),P=`${$.getClass("menu-item")}`;if(O.className=P,O.setAttribute("role","menuitem"),O.setAttribute("tabindex","-1"),O.setAttribute("data-id",F.id),O.setAttribute("data-index",V.toString()),F.disabled)O.classList.add(`${P}--disabled`),O.setAttribute("aria-disabled","true");else O.setAttribute("aria-disabled","false");if(Q.selectedItemId&&F.id===Q.selectedItemId)O.classList.add(`${P}--selected`),O.setAttribute("aria-selected","true");else O.setAttribute("aria-selected","false");if(F.hasSubmenu)O.classList.add(`${P}--submenu`),O.setAttribute("aria-haspopup","true"),O.setAttribute("aria-expanded","false");let L=document.createElement("span");if(L.className=`${$.getClass("menu-item-content")}`,F.icon){let R=document.createElement("span");R.className=`${$.getClass("menu-item-icon")}`,R.innerHTML=F.icon,L.appendChild(R)}let D=document.createElement("span");if(D.className=`${$.getClass("menu-item-text")}`,D.textContent=F.text,L.appendChild(D),F.shortcut){let R=document.createElement("span");R.className=`${$.getClass("menu-item-shortcut")}`,R.textContent=F.shortcut,L.appendChild(R)}if(O.appendChild(L),!F.disabled){if(O.addEventListener("click",(R)=>W(R,F,V)),O.addEventListener("keydown",(R)=>{if(R.key==="Enter"||R.key===" ")R.preventDefault(),W(R,F,V)}),O.addEventListener("focus",()=>{Q.activeItemIndex=V}),F.hasSubmenu&&J.openSubmenuOnHover)O.addEventListener("mouseenter",()=>{if($.submenu)$.submenu.handleSubmenuHover(F,V,O)}),O.addEventListener("mouseleave",(R)=>{if($.submenu)$.submenu.handleSubmenuLeave(R)})}return O},G=(F,V)=>{let O=document.createElement("li");if(O.className=`${$.getClass("menu-divider")}`,O.setAttribute("role","separator"),O.setAttribute("data-index",V.toString()),F.id)O.setAttribute("id",F.id);return O},K=()=>{let F=document.createElement("ul");F.className=`${$.getClass("menu-list")}`,F.setAttribute("role","menu"),Q.items.forEach((V,O)=>{if("type"in V&&V.type==="divider")F.appendChild(G(V,O));else F.appendChild(j(V,O))}),$.element.innerHTML="",$.element.appendChild(F)},z=(F)=>{for(let V of Q.items){if("id"in V&&V.id===F)return V;if("submenu"in V&&Array.isArray(V.submenu)){for(let O of V.submenu)if("id"in O&&O.id===F)return O}}return null},W=(F,V,O)=>{if(F.preventDefault(),F.stopPropagation(),V.disabled)return;if(V.hasSubmenu&&$.submenu){$.submenu.handleSubmenuClick(V,O,F.currentTarget);return}let P=Z.triggerEvent("select",{item:V,itemId:V.id,itemData:V.data},F);if(J.closeOnSelect&&!P.defaultPrevented)X(F,!0)},Y=(F)=>{if(!$.element)return;$.element.querySelectorAll(`.${$.getClass("menu-item")}`).forEach((O)=>{if(O.getAttribute("data-id")===F)O.classList.add(`${$.getClass("menu-item--selected")}`),O.setAttribute("aria-selected","true");else O.classList.remove(`${$.getClass("menu-item--selected")}`),O.setAttribute("aria-selected","false")}),Q.selectedItemId=F},U=(F,V="mouse")=>{if(Q.visible)return;if(Q.visible=!0,document.removeEventListener("click",H),!$.element.parentNode)$.element.classList.remove(`${$.getClass("menu--visible")}`),$.element.setAttribute("aria-hidden","true"),$.element.style.transform="scaleY(0)",$.element.style.opacity="0",document.body.appendChild($.element);let O=q();if(O&&$.position)$.position.positionMenu(O);setTimeout(()=>{$.element.setAttribute("aria-hidden","false"),$.element.style.transform="",$.element.style.opacity="",$.element.getBoundingClientRect(),$.element.classList.add(`${$.getClass("menu--visible")}`),setTimeout(()=>{if($.keyboard&&$.keyboard.handleInitialFocus)$.keyboard.handleInitialFocus($.element,V);else if(V==="keyboard"){let P=Array.from($.element.querySelectorAll(`.${$.getClass("menu-item")}:not(.${$.getClass("menu-item--disabled")})`));if(P.length>0)P.forEach((L)=>{L.tabIndex=-1}),P[0].tabIndex=0,P[0].focus();else $.element.tabIndex=0,$.element.focus()}else{$.element.tabIndex=-1;let P=Array.from($.element.querySelectorAll(`.${$.getClass("menu-item")}:not(.${$.getClass("menu-item--disabled")})`));if(P.length>0)P.forEach((L)=>{L.tabIndex=-1}),P[0].tabIndex=0}},100),setTimeout(()=>{if(J.closeOnClickOutside&&Q.visible)document.addEventListener("click",H);if(J.closeOnEscape)document.addEventListener("keydown",B);window.addEventListener("resize",M,{passive:!0}),window.addEventListener("scroll",k,{passive:!0})},0)},20),Z.triggerEvent("open",{},F)},X=(F,V=!0)=>{if(!Q.visible)return;if($.emit("menu-closing",{event:F,restoreFocus:V}),$.submenu)$.submenu.closeAllSubmenus();setTimeout(()=>{Q.visible=!1,$.element.setAttribute("aria-hidden","true"),$.element.classList.remove(`${$.getClass("menu--visible")}`),document.removeEventListener("click",H),document.removeEventListener("keydown",B),window.removeEventListener("resize",M),window.removeEventListener("scroll",k),Z.triggerEvent("close",{restoreFocus:V},F),setTimeout(()=>{if($.element.parentNode&&!Q.visible)$.element.parentNode.removeChild($.element)},300)},50)},_=(F,V="mouse")=>{if(Q.visible)X(F);else{if(F){if(F instanceof KeyboardEvent)V="keyboard";else if(F instanceof MouseEvent)V="mouse"}U(F,V)}},H=(F)=>{if(aZ){aZ=!1;return}if($.element.contains(F.target))return;let V=q();if(V&&V.contains(F.target))return;if($.submenu&&$.submenu.hasOpenSubmenu()){let O=$.submenu.getActiveSubmenus();for(let P of O)if(P.element.contains(F.target))return}X(F,!1)},B=(F)=>{let V=$.element.contains(F.target),O=$.submenu&&$.submenu.hasOpenSubmenu()&&$.submenu.getActiveSubmenus().some((P)=>P.element.contains(F.target));if(Q.visible){if(V||O){if(F.key==="Escape")F.preventDefault(),X(F,!0)}else if($.keyboard&&$.keyboard.handleMenuKeydown)$.keyboard.handleMenuKeydown(F,Q,{closeMenu:X,closeSubmenu:$.submenu?$.submenu.closeSubmenu:null,findItemById:z,handleSubmenuClick:$.submenu?$.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:$.submenu?$.submenu.handleNestedSubmenuClick:null})}},M=()=>{if(Q.visible){let F=q();if(F&&$.position)$.position.positionMenu(F)}},k=()=>{if(Q.visible)window.requestAnimationFrame(()=>{let F=q();if(F&&$.position)$.position.positionMenu(F)})},N=()=>{if(K(),$.keyboard&&$.keyboard.setupKeyboardHandlers)$.keyboard.setupKeyboardHandlers($.element,Q,{closeMenu:X,closeSubmenu:$.submenu?$.submenu.closeSubmenu:null,findItemById:z,handleSubmenuClick:$.submenu?$.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:$.submenu?$.submenu.handleNestedSubmenuClick:null});if(Q.visible){let F=q();if(F&&$.position)$.position.positionMenu(F);if($.element.classList.add(`${$.getClass("menu--visible")}`),J.closeOnClickOutside)document.addEventListener("click",H);if(J.closeOnEscape)document.addEventListener("keydown",B);window.addEventListener("resize",M),window.addEventListener("scroll",k)}};if($.on("create-menu-items",(F)=>{let{items:V,container:O,onItemCreated:P}=F;V.forEach((L,D)=>{let R;if("type"in L&&L.type==="divider")R=G(L,D);else R=j(L,D);if(O.appendChild(R),P)P(R)})}),setTimeout(N,0),$.lifecycle){let F=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{document.removeEventListener("click",H),document.removeEventListener("keydown",B),window.removeEventListener("resize",M),window.removeEventListener("scroll",k),F()}}return{...$,menu:{open:(F,V="mouse")=>{return U(F,V),$},close:(F,V=!0)=>{return X(F,V),$},toggle:(F,V="mouse")=>{return _(F,V),$},isOpen:()=>Q.visible,setItems:(F)=>{return Q.items=F,K(),$},getItems:()=>Q.items,setPosition:(F)=>{if(Q.position=F,Q.visible){let V=q();if(V&&$.position)$.position.positionMenu(V)}return $},getPosition:()=>Q.position,setSelected:(F)=>{return Y(F),$},getSelected:()=>Q.selectedItemId}}},BJ=Fj;var Hj=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize menu opener: missing element"),$;let Q=!1;document.addEventListener("keydown",(B)=>{Q=B.key==="Tab",setTimeout(()=>{Q=!1},100)});let Z={openerElement:null,openerComponent:null,activeClass:""},q=(B)=>{if(!B)return{element:null,component:null};if(typeof B==="string"){let M=document.querySelector(B);if(!M)return console.warn(`Menu opener not found: ${B}`),{element:null,component:null};return{element:M,component:null}}if(typeof B==="object"&&B!==null){if("element"in B&&B.element instanceof HTMLElement)return{element:B.element,component:B};if("getElement"in B&&typeof B.getElement==="function"){let M=B.getElement();if(M instanceof HTMLElement)return{element:M,component:B}}if("input"in B&&B.input instanceof HTMLElement)return{element:B.input,component:B};if(B instanceof HTMLElement)return{element:B,component:null}}return console.warn("Invalid opener type:",B),{element:null,component:null}},j=(B)=>{let M=$.getClass("").split("-")[0];if(B.tagName==="BUTTON")return`${M}-button--active`;else if(B.classList.contains(`${M}-chip`))return`${M}-chip--selected`;else if(B.classList.contains(`${M}-textfield`)||B.classList.contains(`${M}-select`))return`${M}-textfield--focused`;else return`${M}-menu-opener--active`},G=(B)=>{let{element:M,component:k}=B;if(!M)return;if(Z.openerElement&&Z.openerElement!==M)X();Z.openerElement=M,Z.openerComponent=k,Z.activeClass=j(M),M.addEventListener("click",W),M.addEventListener("keydown",Y),M.addEventListener("blur",U),M.setAttribute("aria-haspopup","true"),M.setAttribute("aria-expanded","false");let N=$.element.id;if(!N)N=`menu-${Date.now()}-${Math.floor(Math.random()*1000)}`,$.element.id=N;M.setAttribute("aria-controls",N)},K=(B)=>{if(!Z.openerElement)return;if(Z.openerComponent&&typeof Z.openerComponent.setActive==="function"){Z.openerComponent.setActive(B);return}if(Z.openerComponent&&"selected"in Z.openerComponent){Z.openerComponent.selected=B;return}if(Z.openerComponent&&typeof Z.openerComponent.focus==="function"&&typeof Z.openerComponent.blur==="function"){if(B)Z.openerComponent.focus();else Z.openerComponent.blur();return}if(Z.openerElement.classList)if(B)Z.openerElement.classList.add(Z.activeClass);else Z.openerElement.classList.remove(Z.activeClass)},z=()=>{if(!Z.openerElement)return;if(Z.openerComponent&&typeof Z.openerComponent.focus==="function"){requestAnimationFrame(()=>{Z.openerComponent.focus()});return}if(Z.openerComponent&&"input"in Z.openerComponent&&Z.openerComponent.input instanceof HTMLElement){requestAnimationFrame(()=>{Z.openerComponent.input.focus()});return}requestAnimationFrame(()=>{Z.openerElement.focus()})},W=(B)=>{if(B.preventDefault(),$.menu)if($.menu.isOpen())$.menu.close(B);else $.menu.open(B,"mouse")},Y=(B)=>{if(!$.menu)return;let M=$.menu.isOpen();switch(B.key){case"Enter":case" ":case"ArrowDown":case"Down":if(B.preventDefault(),!M)$.menu.open(B,"keyboard");break;case"Escape":if(M)B.preventDefault(),$.menu.close(B);break;case"ArrowUp":case"Up":if(B.preventDefault(),!M)$.menu.open(B,"keyboard"),setTimeout(()=>{let k=$.element.querySelectorAll(`.${$.getClass("menu-item")}:not(.${$.getClass("menu-item--disabled")})`);if(k.length>0){k.forEach((F)=>F.setAttribute("tabindex","-1"));let N=k[k.length-1];N.setAttribute("tabindex","0"),N.focus()}},100);break}},U=(B)=>{if(!$.menu||!$.menu.isOpen())return;let M=B.relatedTarget;if(Q){setTimeout(()=>{if($.menu&&$.menu.isOpen())$.menu.close(B,!1)},10);return}if(M){if($.element.contains(M))return;if(M.getAttribute("aria-haspopup")==="true"||M.closest('[aria-haspopup="true"]'))return}setTimeout(()=>{if($.menu&&$.menu.isOpen())$.menu.close(B,!1)},50)},X=()=>{if(Z.openerElement)Z.openerElement.removeEventListener("click",W),Z.openerElement.removeEventListener("keydown",Y),Z.openerElement.removeEventListener("blur",U),Z.openerElement.removeAttribute("aria-haspopup"),Z.openerElement.removeAttribute("aria-expanded"),Z.openerElement.removeAttribute("aria-controls"),K(!1);Z.openerComponent=null,Z.openerElement=null,Z.activeClass=""},{element:_,component:H}=q(J.opener);if(G({element:_,component:H}),$.lifecycle){let B=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{X(),B()}}return $.on("open",()=>{if(Z.openerElement)Z.openerElement.setAttribute("aria-expanded","true"),K(!0)}),$.on("close",(B)=>{if(Z.openerElement){if(Z.openerElement.setAttribute("aria-expanded","false"),K(!1),B.restoreFocus&&!Q)z()}}),{...$,opener:{setOpener(B){let M=q(B);if(M.element)G(M);return $},getOpener(){return Z.openerElement},getOpenerComponent(){return Z.openerComponent},setActive(B){return K(B),$},focus(){return z(),$}}}},FJ=Hj;var kj=(J,$)=>{let Q=(j,G,K,z=!1)=>{if(!j||!G)return;j.style.position="absolute";let W=window.pageXOffset||document.documentElement.scrollLeft,Y=window.pageYOffset||document.documentElement.scrollTop,U=j.cloneNode(!0);U.style.visibility="hidden",U.style.display="block",U.style.position="absolute",U.style.top="0",U.style.left="0",U.style.transform="none",U.style.opacity="0",U.style.pointerEvents="none",U.classList.add(`${J.getClass("menu--visible")}`),document.body.appendChild(U);let X=G.getBoundingClientRect(),_=U.getBoundingClientRect(),H=window.innerWidth,B=window.innerHeight;document.body.removeChild(U);let M=$.offset!==void 0?$.offset:8,k=0,N=0,F=K;if(z){if(F=K||"right-start",F.startsWith("right")&&X.right+_.width+M>H-16)F=F.replace("right","left");else if(F.startsWith("left")&&X.left-_.width-M<16)F=F.replace("left","right");if(X.top+_.height>B-48){if(F==="right-start")F="right-end";else if(F==="left-start")F="left-end"}}else switch(K){case"top-start":case"top":case"top-end":if(X.top<_.height+M+48)F=K.replace("top","bottom");break;case"bottom-start":case"bottom":case"bottom-end":if(X.bottom+_.height+M+48>B){if(X.top>B-X.bottom)F=K.replace("bottom","top")}break;case"right-start":case"right":case"left-start":case"left":if(X.bottom+_.height>B-48){if(K==="right-start")F="right-end";else if(K==="left-start")F="left-end";else if(K==="right")k=X.top-(_.height-X.height)-M;else if(K==="left")k=X.top-(_.height-X.height)-M}break}if(["position-top","position-bottom","position-right","position-left"].forEach((R)=>{j.classList.remove(`${J.getClass("menu")}--${R}`)}),F.startsWith("top")||F==="right-end"||F==="left-end"||F==="right"&&k<X.top||F==="left"&&k<X.top)j.classList.add(`${J.getClass("menu")}--position-top`);else if(F.startsWith("left"))j.classList.add(`${J.getClass("menu")}--position-left`);else if(F.startsWith("right"))j.classList.add(`${J.getClass("menu")}--position-right`);else j.classList.add(`${J.getClass("menu")}--position-bottom`);switch(F){case"top-start":k=X.top+Y-_.height-M,N=X.left+W;break;case"top":k=X.top+Y-_.height-M,N=X.left+W+X.width/2-_.width/2;break;case"top-end":k=X.top+Y-_.height-M,N=X.right+W-_.width;break;case"right-start":k=X.top+Y,N=X.right+W+M;break;case"right":if(k===0)k=X.top+Y+X.height/2-_.height/2;else k+=Y;N=X.right+W+M;break;case"right-end":k=X.bottom+Y-_.height,N=X.right+W+M;break;case"bottom-start":k=X.bottom+Y+M,N=X.left+W;break;case"bottom":k=X.bottom+Y+M,N=X.left+W+X.width/2-_.width/2;break;case"bottom-end":k=X.bottom+Y+M,N=X.right+W-_.width;break;case"left-start":k=X.top+Y,N=X.left+W-_.width-M;break;case"left":if(k===0)k=X.top+Y+X.height/2-_.height/2;else k+=Y;N=X.left+W-_.width-M;break;case"left-end":k=X.bottom+Y-_.height,N=X.left+W-_.width-M;break}let P=48;if(k-Y<P)k=P+Y;let L=48;if(k-Y+_.height>B-L){let R=B-(k-Y)-L,w=Math.min(_.height,100),A=Math.max(R,w);if(j.style.maxHeight=`${A}px`,$.maxHeight){let x=parseInt($.maxHeight,10);if(!isNaN(x)&&x<parseInt(j.style.maxHeight||"0",10))j.style.maxHeight=$.maxHeight}}else if($.maxHeight)j.style.maxHeight=$.maxHeight;if($.width==="100%"&&!z)j.style.width=`${X.width}px`;if(j.style.top=`${Math.max(P+Y,k)}px`,j.style.left=`${Math.max(16+W,N)}px`,N-W+_.width>H-16)j.style.left="auto",j.style.right="16px"};return{positionMenu:(j)=>{if(!j||!J.element)return;Q(J.element,j,$.position,!1)},positionSubmenu:(j,G,K=1)=>{if(!j||!G)return;let z=K%2===1?"right-start":"left-start";j.style.zIndex=`${1000+K*10}`,Q(j,G,z,!0)},positionElement:Q}},Mj=(J)=>($)=>{if(!$.element)return $;let Q=kj($,J);return{...$,position:Q}},HJ=Mj;var Vj=(J)=>{let $=!1;(()=>{document.addEventListener("keydown",(z)=>{$=z.key==="Tab",setTimeout(()=>{$=!1},100)})})();let Z=()=>{let W=document.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])');return Array.from(W).filter((Y)=>{return Y.offsetParent!==null&&!Y.classList.contains("hidden")})},q=(z,W)=>{if(W==="keyboard"){let Y=Array.from(z.querySelectorAll(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`));if(Y.length>0)Y[0].setAttribute("tabindex","0"),Y[0].focus();else z.setAttribute("tabindex","0"),z.focus()}else{z.setAttribute("tabindex","-1");let Y=z.querySelector(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`);if(Y)Y.setAttribute("tabindex","0")}},j=(z,W,Y)=>{let U=W.activeSubmenu&&W.activeSubmenu.contains(z.target),X=U?W.activeSubmenu:J.element,_=Array.from(X.querySelectorAll(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`));if(_.length===0)return;let H=document.activeElement,B=-1;if(H&&_.includes(H))B=_.indexOf(H);let M=(k)=>{if(_[k])_[k].focus()};switch(z.key){case"ArrowDown":case"Down":if(z.preventDefault(),B<0)M(0);else if(B<_.length-1)M(B+1);else M(0);break;case"ArrowUp":case"Up":if(z.preventDefault(),B<0)M(_.length-1);else if(B>0)M(B-1);else M(_.length-1);break;case"Home":z.preventDefault(),M(0);break;case"End":z.preventDefault(),M(_.length-1);break;case"Enter":case" ":if(z.preventDefault(),B>=0)_[B].click();break;case"ArrowRight":case"Right":if(z.preventDefault(),U){if(B>=0&&_[B].classList.contains(`${J.getClass("menu-item--submenu")}`)){let N=_[B],F=parseInt(N.getAttribute("data-index"),10),O=N.closest(`.${J.getClass("menu--submenu")}`)?.getAttribute("data-parent-item"),P=Y.findItemById(O);if(P&&P.submenu){let L=P.submenu[F];Y.handleNestedSubmenuClick(L,F,N)}}}else if(B>=0&&_[B].classList.contains(`${J.getClass("menu-item--submenu")}`)){let N=_[B],F=parseInt(N.getAttribute("data-index"),10),V=W.items[F];Y.handleSubmenuClick(V,F,N)}break;case"ArrowLeft":case"Left":if(z.preventDefault(),U)if(W.activeSubmenuItem){let N=W.activeSubmenuItem,F=parseInt(X.getAttribute("data-level")||"1",10);if(Y.closeSubmenu(F),N)N.focus()}else Y.closeSubmenu(1);break;case"Escape":if(z.preventDefault(),U)if(W.activeSubmenuItem){let N=W.activeSubmenuItem,F=parseInt(X.getAttribute("data-level")||"1",10);if(Y.closeSubmenu(F),N)N.focus()}else Y.closeSubmenu(1);else Y.closeMenu(z,!0);break;case"Tab":z.preventDefault();let k=J.opener?.getOpener?.();if(Y.closeMenu(z,!0),k)setTimeout(()=>{if(z.shiftKey);else{let N=Z(),F=N.indexOf(k);if(F>=0&&F<N.length-1)N[F+1].focus()}},0);break}};return{handleInitialFocus:q,handleMenuKeydown:j,setupKeyboardHandlers:(z,W,Y)=>{let U=z.querySelectorAll(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`);if(U.forEach((X)=>{X.tabIndex=-1}),U.length>0)U[0].tabIndex=0;z.addEventListener("keydown",(X)=>j(X,W,Y))},isTabNavigationActive:()=>$,getFocusableElements:Z}},Nj=()=>(J)=>{if(!J.element)return J;let $=Vj(J);return{...J,keyboard:$}},kJ=Nj;var _j=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize menu submenu: missing element"),$;let Q={activeSubmenu:null,activeSubmenuItem:null,submenuLevel:0,activeSubmenus:[],submenuTimer:null,hoverIntent:{timer:null,activeItem:null},component:$},Z=()=>{if(Q.hoverIntent.timer)clearTimeout(Q.hoverIntent.timer),Q.hoverIntent.timer=null,Q.hoverIntent.activeItem=null},q=()=>{if(Q.submenuTimer)clearTimeout(Q.submenuTimer),Q.submenuTimer=null},j=(N,F,V)=>{if(!J.openSubmenuOnHover||!N.hasSubmenu)return;Z(),q(),Q.hoverIntent.activeItem=V,Q.hoverIntent.timer=setTimeout(()=>{if(V.matches(":hover")){if(Q.activeSubmenuItem!==V)W(N,F,V)}Q.hoverIntent.timer=null},100)},G=()=>{Z(),q(),Q.submenuTimer=setTimeout(()=>{let{activeSubmenu:N,activeSubmenuItem:F}=Q;if(N&&F){let V=N.matches(":hover"),O=F.matches(":hover");if(!V&&!O)Y(Q.submenuLevel)}Q.submenuTimer=null},300)},K=(N,F,V)=>{if(!N.submenu||!N.hasSubmenu)return;let O=V.getAttribute("aria-expanded")==="true";if(Q.activeSubmenus.some((L)=>L.isOpening))return;if(O){let L=parseInt(V.closest(`.${$.getClass("menu--submenu")}`)?.getAttribute("data-level")||"0",10);Y(L+1),V.setAttribute("aria-expanded","false")}else W(N,F,V)},z=(N,F,V)=>{if(!N.submenu||!N.hasSubmenu)return;let O=V.getAttribute("aria-expanded")==="true";if(Q.activeSubmenus.some((L)=>L.isOpening))return;if(O){let L=parseInt(V.closest(`.${$.getClass("menu--submenu")}`)?.getAttribute("data-level")||"1",10);Y(L+1)}else W(N,F,V)},W=(N,F,V)=>{if(!N.submenu||!N.hasSubmenu)return;let O=V.closest(`.${$.getClass("menu--submenu")}`)?parseInt(V.closest(`.${$.getClass("menu--submenu")}`).getAttribute("data-level")||"0",10)+1:1;if(Y(O),Q.activeSubmenus.findIndex((w)=>w.menuItem===V&&w.isOpening)>=0)return;V.setAttribute("aria-expanded","true");let L=document.createElement("div");L.className=`${$.getClass("menu")} ${$.getClass("menu--submenu")}`,L.setAttribute("role","menu"),L.setAttribute("tabindex","-1"),L.setAttribute("data-level",O.toString()),L.setAttribute("data-parent-item",N.id),L.style.zIndex=`${1000+O*10}`;let D=document.createElement("ul");D.className=`${$.getClass("menu-list")}`;let R=[];if($.emit("create-menu-items",{items:N.submenu,container:D,level:O,onItemCreated:(w)=>{if(!w.classList.contains(`${$.getClass("menu-item--disabled")}`))R.push(w)}}),L.appendChild(D),document.body.appendChild(L),$.position&&$.position.positionSubmenu)$.position.positionSubmenu(L,V,O);if($.keyboard&&$.keyboard.setupKeyboardHandlers)$.keyboard.setupKeyboardHandlers(L,{activeSubmenus:Q.activeSubmenus},{closeSubmenu:Y,handleNestedSubmenuClick:z});L.addEventListener("mouseenter",()=>{q()}),L.addEventListener("mouseleave",()=>{G()}),Q.activeSubmenu=L,Q.activeSubmenuItem=V,Q.activeSubmenus.push({element:L,menuItem:V,level:O,isOpening:!0}),Q.submenuLevel=O,document.addEventListener("click",X),window.addEventListener("resize",_,{passive:!0}),window.addEventListener("scroll",H,{passive:!0}),requestAnimationFrame(()=>{L.classList.add(`${$.getClass("menu--visible")}`),setTimeout(()=>{let w=Q.activeSubmenus.findIndex((A)=>A.element===L);if(w!==-1)Q.activeSubmenus[w].isOpening=!1;if(R.length>0){if(O>=2||document.activeElement===V)R[0].setAttribute("tabindex","0"),R[0].focus()}},300)}),$.emit("submenu-opened",{submenuElement:L,parentItem:V,level:O,item:N})},Y=(N)=>{Z(),q();let F=[];for(let V=Q.activeSubmenus.length-1;V>=0;V--)if(Q.activeSubmenus[V].level>=N){let O=Q.activeSubmenus[V];if(O.menuItem)O.menuItem.setAttribute("aria-expanded","false");O.element.classList.remove(`${$.getClass("menu--visible")}`),setTimeout(()=>{if(O.element.parentNode)O.element.parentNode.removeChild(O.element)},200),F.push(V)}if(F.forEach((V)=>{Q.activeSubmenus.splice(V,1)}),Q.activeSubmenus.length>0){let V=Q.activeSubmenus[Q.activeSubmenus.length-1];if(Q.activeSubmenu=V.element,Q.activeSubmenuItem=V.menuItem,Q.submenuLevel=V.level,V.menuItem)V.menuItem.focus()}else Q.activeSubmenu=null,Q.activeSubmenuItem=null,Q.submenuLevel=0;$.emit("submenu-closed",{level:N})},U=()=>{if(Z(),q(),Q.activeSubmenus.length===0)return;[...Q.activeSubmenus].forEach((N)=>{if(N.menuItem)N.menuItem.setAttribute("aria-expanded","false");N.element.classList.remove(`${$.getClass("menu--visible")}`),setTimeout(()=>{if(N.element.parentNode)N.element.parentNode.removeChild(N.element)},200)}),Q.activeSubmenu=null,Q.activeSubmenuItem=null,Q.activeSubmenus=[],Q.submenuLevel=0,document.removeEventListener("click",X),window.removeEventListener("resize",_),window.removeEventListener("scroll",H),$.emit("all-submenus-closed",{})},X=(N)=>{if(!Q.activeSubmenu)return;let{activeSubmenu:F,activeSubmenuItem:V}=Q;if(F.contains(N.target)||V&&V.contains(N.target))return;U()},_=()=>{if(Q.activeSubmenu&&Q.activeSubmenuItem&&$.position)$.position.positionSubmenu(Q.activeSubmenu,Q.activeSubmenuItem,Q.submenuLevel)},H=()=>{window.requestAnimationFrame(()=>{if(Q.activeSubmenu&&Q.activeSubmenuItem&&$.position)$.position.positionSubmenu(Q.activeSubmenu,Q.activeSubmenuItem,Q.submenuLevel)})},B=()=>{return Q.activeSubmenus.length>0},M=()=>{return Q.submenuLevel},k=()=>{return[...Q.activeSubmenus]};if($.lifecycle){let N=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{if(Z(),q(),document.removeEventListener("click",X),window.removeEventListener("resize",_),window.removeEventListener("scroll",H),Q.activeSubmenus.length>0)Q.activeSubmenus.forEach((F)=>{if(F.element.parentNode)F.element.parentNode.removeChild(F.element)});N()}}return $.on("menu-closing",()=>{U()}),{...$,submenu:{openSubmenu:W,closeSubmenu:Y,closeAllSubmenus:U,handleSubmenuClick:K,handleNestedSubmenuClick:z,handleSubmenuHover:j,handleSubmenuLeave:G,hasOpenSubmenu:B,getSubmenuLevel:M,getActiveSubmenus:k}}},MJ=_j;var cZ=({menu:J,opener:$,events:Q,lifecycle:Z})=>(q)=>{return{element:q.element,open(G,K="mouse"){if(G&&!K){if(G instanceof KeyboardEvent)K="keyboard"}return J.open(G,K),this},close(G,K=!0,z=!1){return J.close(G,K,z),this},toggle(G,K){if(G&&!K){if(G instanceof KeyboardEvent)K="keyboard";else if(G instanceof MouseEvent)K="mouse"}return J.toggle(G,K),this},isOpen(){return J.isOpen()},setItems(G){return J.setItems(G),this},getItems(){return J.getItems()},setOpener(G){return $.setOpener(G),this},getOpener(){return $.getOpener()},setPosition(G){return J.setPosition(G),this},getPosition(){return J.getPosition()},setSelected(G){return J.setSelected(G),this},getSelected(){return J.getSelected()},on(G,K){if(Q?.on)Q.on(G,K);else if(q.on)q.on(G,K);return this},off(G,K){if(Q?.off)Q.off(G,K);else if(q.off)q.off(G,K);return this},destroy(){Z.destroy()}}};t();var n$={BOTTOM_START:"bottom-start",BOTTOM:"bottom",BOTTOM_END:"bottom-end",TOP_START:"top-start",TOP:"top",TOP_END:"top-end",RIGHT_START:"right-start",RIGHT:"right",RIGHT_END:"right-end",LEFT_START:"left-start",LEFT:"left",LEFT_END:"left-end"},a6={POSITION:n$.BOTTOM_START,OFFSET:0,CLOSE_ON_SELECT:!0,CLOSE_ON_CLICK_OUTSIDE:!0,CLOSE_ON_ESCAPE:!0,OPEN_SUBMENU_ON_HOVER:!0,AUTO_FLIP:!0},VJ={MOUSE:"mouse",KEYBOARD:"keyboard"},NJ={ITEM:"item",DIVIDER:"divider"},_J={OPEN:"open",CLOSE:"close",SELECT:"select"},J$={CONTAINER:"menu",VISIBLE:"menu--visible",INNER:"menu__inner",ITEM:"menu__item",ITEM_DISABLED:"menu__item--disabled",ITEM_SELECTED:"menu__item--selected",ITEM_HAS_SUBMENU:"menu__item--has-submenu",DIVIDER:"menu__divider",ITEM_ICON:"menu__item-icon",ITEM_TEXT:"menu__item-text",ITEM_SHORTCUT:"menu__item-shortcut",SUBMENU_INDICATOR:"menu__submenu-indicator"};var Lj={items:[],position:a6.POSITION,closeOnSelect:a6.CLOSE_ON_SELECT,closeOnClickOutside:a6.CLOSE_ON_CLICK_OUTSIDE,closeOnEscape:a6.CLOSE_ON_ESCAPE,openSubmenuOnHover:a6.OPEN_SUBMENU_ON_HOVER,offset:a6.OFFSET,autoFlip:a6.AUTO_FLIP,visible:!1},iZ=(J)=>{if(!J.opener)throw new Error("Menu component requires an opener element or selector");return d(Lj,J,"menu")},oZ=(J)=>{let $={};if(J.width)$.width=J.width;if(J.maxHeight)$.maxHeight=J.maxHeight;let Q={role:"menu",tabindex:"-1","aria-hidden":(!J.visible).toString(),style:Object.entries($).map(([Z,q])=>`${Z}: ${q}`).join(";")};return p(J,{tag:"div",attributes:Q,className:[J.visible?J$.VISIBLE:null,J.class].filter(Boolean),forwardEvents:{keydown:!0}})},tZ=(J)=>({menu:{open:($,Q)=>J.menu?.open($,Q),close:($,Q,Z)=>J.menu?.close($,Q,Z),toggle:($,Q)=>J.menu?.toggle($,Q),isOpen:()=>J.menu?.isOpen()||!1,setItems:($)=>J.menu?.setItems($),getItems:()=>J.menu?.getItems()||[],setPosition:($)=>J.menu?.setPosition($),getPosition:()=>J.menu?.getPosition(),setSelected:($)=>J.menu?.setSelected($),getSelected:()=>J.menu?.getSelected()},opener:{setOpener:($)=>J.opener?.setOpener($),getOpener:()=>J.opener?.getOpener()},submenu:{hasOpenSubmenu:()=>J.submenu?.hasOpenSubmenu()||!1,closeAllSubmenus:()=>J.submenu?.closeAllSubmenus()},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy()}});var Dj=(J)=>{try{let $=iZ(J);return b(S,g(),E(oZ($)),HJ($),kJ(),MJ($),BJ($),FJ($),C(),(Z)=>cZ(tZ(Z))(Z))($)}catch($){throw console.error("Menu creation error:",$),new Error(`Failed to create menu: ${$.message}`)}},Q$=Dj;J6();c();o();var nZ=(J)=>($)=>{return{...$,element:$.element,items:$.items||new Map,addItem(Z){if(typeof $.addItem==="function")$.addItem(Z);return this},removeItem(Z){if(typeof $.removeItem==="function")$.removeItem(Z);return this},getItem(Z){if(typeof $.getItem==="function")return $.getItem(Z);return this.items.get(Z)},getAllItems(){if(typeof $.getAllItems==="function")return $.getAllItems();return Array.from(this.items.values())},getActive(){if(typeof $.getActive==="function")return $.getActive();return null},getItemPath(Z){if(typeof $.getItemPath==="function")return $.getItemPath(Z);return[]},setActive(Z){if(typeof $.handleItemClick==="function")$.handleItemClick(Z);else if(typeof $.setActive==="function")$.setActive(Z);else{let q=this.items.get(Z);if(q&&q.element){if($.emit)$.emit("change",{id:Z,item:q,source:"api"})}}return this},enable(){if(J.disabled.enable)J.disabled.enable();return this},disable(){if(J.disabled.disable)J.disabled.disable();return this},expand(){if(this.element.classList.remove(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","false"),$.emit)$.emit("expanded",{source:"api"});return this},collapse(){if(this.element.classList.add(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","true"),$.emit)$.emit("collapsed",{source:"api"});return this},isExpanded(){return!this.element.classList.contains(`${this.element.className.split(" ")[0]}--hidden`)},toggle(){return this.isExpanded()?this.collapse():this.expand()},on(Z,q){if($.on)$.on(Z,q);return this},off(Z,q){if($.off)$.off(Z,q);return this},destroy(){if(J.lifecycle.destroy)J.lifecycle.destroy()}}};var e$={RAIL:"rail",DRAWER:"drawer",BAR:"bar",MODAL:"modal",STANDARD:"standard"},$8={LEFT:"left",RIGHT:"right",TOP:"top",BOTTOM:"bottom"},J8={FIXED:"fixed",DISMISSIBLE:"dismissible",MODAL:"modal"},LJ={ACTIVE:"active",DISABLED:"disabled",EXPANDED:"expanded",COLLAPSED:"collapsed",HOVERED:"hovered",FOCUSED:"focused",PRESSED:"pressed"},Z$={CHANGE:"change",EXPAND:"expand",COLLAPSE:"collapse",GROUP_EXPAND:"group:expand",GROUP_COLLAPSE:"group:collapse"},B9={VARIANT:e$.STANDARD,POSITION:$8.LEFT,BEHAVIOR:J8.FIXED,EXPANDED:!1,SHOW_LABELS:!0,SCRIM_ENABLED:!0},n={CONTAINER:"nav",VARIANT_PREFIX:"nav--",POSITION_PREFIX:"nav--pos-",BEHAVIOR_PREFIX:"nav--",EXPANDED:"nav--expanded",DISABLED:"nav--disabled",ITEM:"nav-item",ITEM_CONTAINER:"nav-item-container",ICON:"nav-item-icon",LABEL:"nav-item-label",BADGE:"nav-item-badge",DIVIDER:"nav-divider",SCRIM:"nav-scrim",GROUP:"nav-group",GROUP_TITLE:"nav-group-title",SUBTITLE:"nav-subtitle",NESTED_CONTAINER:"nav-nested-container",NESTED_ITEM:"nav-nested-item",EXPAND_ICON:"nav-expand-icon",ACTIVE:"nav-item--active",ITEM_DISABLED:"nav-item--disabled"};var Oj=(J)=>{let $=document.createElement("span");return $.className=`${J}-${n.EXPAND_ICON}`,$.innerHTML=`
|
|
18
|
+
`,V.addEventListener("click",(F)=>{if(F.preventDefault(),F.stopPropagation(),$&&$.emit)$.emit("dialog:close",{source:"closeButton"})}),k.appendChild(V)}return k},j=()=>{let k=document.createElement("div");if(k.classList.add($.getClass("dialog-content")),J.content)k.innerHTML=J.content;return k},K=()=>{let k=document.createElement("div");k.classList.add($.getClass("dialog-footer"));let M=J.footerAlignment||"right";if(M!=="right")f(k,`${$.getClass("dialog-footer")}--${M}`);if(Array.isArray(J.buttons)&&J.buttons.length>0)J.buttons.forEach((V)=>SZ(k,V,$));return k},G=()=>{return s9({variant:"full-width",class:$.getClass("dialog-divider")})},W=q(),z=j(),Y=Array.isArray(J.buttons)&&J.buttons.length>0?K():null;f($.element,$.getClass("dialog"));let U=J.size||"medium";if(U!=="medium")f($.element,`${$.getClass("dialog")}--${U}`);let X=J.animation||"scale";if(X!=="scale")f($.element,`${$.getClass("dialog")}--${X}`);$.element.appendChild(W);let _=null,H=null;if(J.divider){if(_=G(),_.element.classList.add($.getClass("dialog-header-divider")),$.element.appendChild(_.element),Y)H=G(),H.element.classList.add($.getClass("dialog-footer-divider"))}if($.element.appendChild(z),H)$.element.appendChild(H.element);if(Y)$.element.appendChild(Y);Z.appendChild($.element);let B=J.container||document.body;return B.appendChild(Z),{...$,overlay:Z,structure:{header:W,content:z,footer:Y,headerDivider:_,footerDivider:H,container:B}}},IZ=()=>(J)=>{return{...J,divider:{toggleDivider($){if($&&!J.structure.headerDivider){let Q=s9({variant:"full-width",class:`${J.getClass("dialog-divider")} ${J.getClass("dialog-header-divider")}`});if(J.element.insertBefore(Q.element,J.structure.content),J.structure.headerDivider=Q,J.structure.footer&&!J.structure.footerDivider){let Z=s9({variant:"full-width",class:`${J.getClass("dialog-divider")} ${J.getClass("dialog-footer-divider")}`});J.element.insertBefore(Z.element,J.structure.footer),J.structure.footerDivider=Z}}else if(!$){if(J.structure.headerDivider)J.structure.headerDivider.element.remove(),J.structure.headerDivider=null;if(J.structure.footerDivider)J.structure.footerDivider.element.remove(),J.structure.footerDivider=null}return J},hasDivider(){return J.structure.headerDivider!==null}}}},SZ=(J,$,Q)=>{let{text:Z,variant:q="text",onClick:j,closeDialog:K=!0,autofocus:G=!1,attributes:W={}}=$,z=e6({text:Z,variant:q,...W});if(z.on("click",(Y)=>{console.log("button click");let U=K;if(typeof j==="function")try{if(j(Y,Q)===!1)U=!1}catch(X){console.error("Error in onClick handler:",X)}if(U){if(Q&&Q.emit)Q.emit("dialog:close",{source:"button",text:Z})}}),G)z.element.setAttribute("autofocus","true");if(J.appendChild(z.element),!Q._buttons)Q._buttons=[];Q._buttons.push({config:$,instance:z})},bZ=()=>(J)=>{let $=J.config.open===!0,Q=J.config.animationDuration||150,Z='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',q=null,j=()=>{if(!J.config.trapFocus)return;let X=J.element.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(X.length===0)return;let _=X[0],H=X[X.length-1];if(J.config.autofocus){let k=J.element.querySelector("[autofocus]");if(k)k.focus();else _.focus()}J.element.addEventListener("keydown",B);function B(k){if(k.key!=="Tab")return;if(k.shiftKey){if(document.activeElement===_)H.focus(),k.preventDefault()}else if(document.activeElement===H)_.focus(),k.preventDefault()}},K=()=>{if(!J.config.trapFocus)return;if(J.element.removeEventListener("keydown",X),q)q.focus(),q=null;function X(){}},G=()=>{if(J.config.closeOnOverlayClick!==!1)J.overlay.addEventListener("click",z);if(J.config.closeOnEscape!==!1)document.addEventListener("keydown",Y)},W=()=>{J.overlay.removeEventListener("click",z),document.removeEventListener("keydown",Y)};function z(X){if(X.target===J.overlay)U.close()}function Y(X){if(X.key==="Escape"&&U.isOpen())U.close()}if($)f(J.overlay,`${J.getClass("dialog-overlay")}--visible`),f(J.element,`${J.getClass("dialog")}--visible`),j(),G();let U={open(){if(this.isOpen())return;q=document.activeElement;let X={dialog:J,defaultPrevented:!1,preventDefault:()=>{X.defaultPrevented=!0}};if(typeof J.emit==="function")J.emit(z7.BEFORE_OPEN,X);if(X.defaultPrevented)return;if(J.overlay&&!J.overlay.parentNode)(J.structure.container||document.body).appendChild(J.overlay);f(J.overlay,`${J.getClass("dialog-overlay")}--visible`),setTimeout(()=>{if(f(J.element,`${J.getClass("dialog")}--visible`),j(),G(),typeof J.emit==="function")J.emit(z7.OPEN,{dialog:J}),setTimeout(()=>{J.emit(z7.AFTER_OPEN,{dialog:J})},Q)},10)},close(){console.log("Dialog close method called");let X={dialog:J,defaultPrevented:!1,preventDefault:()=>{X.defaultPrevented=!0}};if(typeof J.emit==="function")J.emit(z7.BEFORE_CLOSE,X);if(X.defaultPrevented){console.log("Dialog close prevented by event handler");return}let _=`${J.getClass("dialog")}--visible`,H=`${J.getClass("dialog-overlay")}--visible`;if(q6(J.element,_),q6(J.overlay,H),K(),W(),typeof J.emit==="function")J.emit(z7.CLOSE,{dialog:J});setTimeout(()=>{if(J.overlay&&J.overlay.parentNode)J.overlay.parentNode.removeChild(J.overlay);if(typeof J.emit==="function")J.emit(z7.AFTER_CLOSE,{dialog:J})},Q)},toggle(X){if(X===void 0)this.isOpen()?this.close():this.open();else if(X)this.open();else this.close()},isOpen(){return J.element.classList.contains(`${J.getClass("dialog")}--visible`)}};if(J&&J.on)J.on("dialog:close",()=>{U.close()});return{...J,visibility:U}},vZ=()=>(J)=>{let $=J.structure.header,Q=J.structure.content,Z=J.structure.footer;return{...J,content:{setTitle(q){let j=$.querySelector(`.${J.getClass("dialog-header-title")}`);if(!j&&q)j=document.createElement("h2"),j.classList.add(J.getClass("dialog-header-title")),$.querySelector(`.${J.getClass("dialog-header-content")}`).appendChild(j);if(j)j.textContent=q},getTitle(){let q=$.querySelector(`.${J.getClass("dialog-header-title")}`);return q?q.textContent||"":""},setSubtitle(q){let j=$.querySelector(`.${J.getClass("dialog-header-subtitle")}`);if(!j&&q)j=document.createElement("p"),j.classList.add(J.getClass("dialog-header-subtitle")),$.querySelector(`.${J.getClass("dialog-header-content")}`).appendChild(j);if(j)j.textContent=q},getSubtitle(){let q=$.querySelector(`.${J.getClass("dialog-header-subtitle")}`);return q?q.textContent||"":""},setContent(q){Q.innerHTML=q},getContent(){return Q.innerHTML},getHeaderElement(){return $},getContentElement(){return Q},getFooterElement(){return Z}}}},CZ=()=>(J)=>{if(!J._buttons)J._buttons=[];return{...J,buttons:{addButton($){let Q=J.structure.footer;if(!Q){Q=document.createElement("div"),Q.classList.add(J.getClass("dialog-footer"));let Z=J.config.footerAlignment||"right";if(Z!=="right")f(Q,`${J.getClass("dialog-footer")}--${Z}`);J.element.appendChild(Q),J.structure.footer=Q}SZ(Q,$,J)},removeButton($){if(typeof $==="number"){if($>=0&&$<J._buttons.length)J._buttons[$].instance.destroy(),J._buttons.splice($,1)}else{let Q=J._buttons.findIndex((Z)=>Z.config.text===$);if(Q!==-1)J._buttons[Q].instance.destroy(),J._buttons.splice(Q,1)}if(J._buttons.length===0&&J.structure.footer)J.element.removeChild(J.structure.footer),J.structure.footer=null},getButtons(){return J._buttons.map(($)=>$.config)},setFooterAlignment($){if(!J.structure.footer)return;if(["right","left","center","space-between"].forEach((Z)=>{if(Z!=="right")q6(J.structure.footer,`${J.getClass("dialog-footer")}--${Z}`)}),$!=="right")f(J.structure.footer,`${J.getClass("dialog-footer")}--${$}`)}}}},EZ=()=>(J)=>{return{...J,size:{setSize($){if(["small","medium","large","fullwidth","fullscreen"].forEach((Z)=>{q6(J.element,`${J.getClass("dialog")}--${Z}`)}),$!=="medium")f(J.element,`${J.getClass("dialog")}--${$}`)}}}},hZ=()=>(J)=>{return{...J,confirm($){return new Promise((Q)=>{let{title:Z="Confirm",message:q,confirmText:j="Yes",cancelText:K="No",confirmVariant:G="filled",cancelVariant:W="text",size:z="small"}=$;J.content.setTitle(Z),J.content.setContent(`<p>${q}</p>`),J.size.setSize(z),J._buttons.forEach((Y)=>Y.instance.destroy()),J._buttons=[],J.buttons.addButton({text:j,variant:G,onClick:()=>{Q(!0)}}),J.buttons.addButton({text:K,variant:W,onClick:()=>{Q(!1)}}),J.visibility.open()})}}};T9();var uZ=(J)=>($)=>({...$,open(){return J.visibility.open(),this},close(){return J.visibility.close(),this},toggle(Q){return J.visibility.toggle(Q),this},isOpen(){return J.visibility.isOpen()},setTitle(Q){return J.content.setTitle(Q),this},getTitle(){return J.content.getTitle()},setSubtitle(Q){return J.content.setSubtitle(Q),this},getSubtitle(){return J.content.getSubtitle()},setContent(Q){return J.content.setContent(Q),this},getContent(){return J.content.getContent()},addButton(Q){return J.buttons.addButton(Q),this},removeButton(Q){return J.buttons.removeButton(Q),this},getButtons(){return J.buttons.getButtons()},setFooterAlignment(Q){return J.buttons.setFooterAlignment(Q),this},toggleDivider(Q){return J.divider.toggleDivider(Q),this},hasDivider(){return J.divider.hasDivider()},setSize(Q){return J.size.setSize(Q),this},on(Q,Z){return J.events.on(Q,Z),this},off(Q,Z){return J.events.off(Q,Z),this},getHeaderElement(){return J.content.getHeaderElement()},getContentElement(){return J.content.getContentElement()},getFooterElement(){return J.content.getFooterElement()},confirm(Q){if($.confirm)return $.confirm(Q||{message:"Are you sure?"});return Promise.resolve(!1)},destroy(){if(console.log("destroy",this.isOpen()),this.isOpen()){let Q=`${$.getClass("dialog")}--visible`,Z=`${$.getClass("dialog-overlay")}--visible`;if(q6($.element,Q),q6($.overlay,Z),J.focus&&J.focus.releaseFocus)J.focus.releaseFocus()}if(J.lifecycle.destroy(),$.overlay&&$.overlay.parentNode)$.overlay.parentNode.removeChild($.overlay)},element:$.element,overlay:$.overlay});var Wj=(J={})=>{let $=DZ(J);try{let Q=b(S,g(),E(OZ($)),TZ($),bZ(),vZ(),CZ(),EZ(),IZ(),hZ(),C(),(Z)=>uZ(RZ(Z))(Z))($);if($.on)Object.entries($.on).forEach(([Z,q])=>{if(typeof q==="function")Q.on(Z,q)});return Q}catch(Q){throw console.error("Dialog creation error:",Q),new Error(`Failed to create dialog: ${Q.message}`)}},XJ=Wj;J6();c();o();var fZ=({disabled:J,lifecycle:$,className:Q})=>(Z)=>({...Z,element:Z.element,getValue:()=>Z.element.value,setValue(q){return Z.element.value=q,this},enable(){return J.enable(),this},disable(){return J.disable(),this},setIcon(q){return Z.icon.setIcon(q),this},getIcon(){return Z.icon.getIcon()},setPosition(q){return["top-right","top-left","bottom-right","bottom-left"].forEach((K)=>{Z.element.classList.remove(`${Q}--${K}`)}),Z.element.classList.add(`${Q}--${q}`),this},getPosition(){let q=["top-right","top-left","bottom-right","bottom-left"];for(let j of q)if(Z.element.classList.contains(`${Q}--${j}`))return j;return null},lower(){return Z.element.classList.add(`${Q}--lowered`),this},raise(){return Z.element.classList.remove(`${Q}--lowered`),this},destroy(){$.destroy()}});t();var Yj={variant:"primary",size:"default",type:"button",ripple:!0},gZ=(J={})=>d(Yj,J,"fab"),dZ=(J)=>{let $={type:J.type||"button","aria-label":J.ariaLabel||(J.icon?"action":void 0)};if(J.disabled===!0)$.disabled=!0;let Q=[];if(Q.push(`fab--${J.size||"default"}`),J.animate)Q.push("fab--animate-enter");if(J.position)Q.push(`fab--${J.position}`);if(J.disabled===!0)Q.push("fab--disabled");let Z={...J,className:Q};return p(Z,{tag:"button",attributes:$,forwardEvents:{click:(q)=>!q.element.disabled,focus:!0,blur:!0},interactive:!0})},lZ=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()},className:J.getClass("fab")});var Uj=(J={})=>{let $=gZ(J);try{return b(S,g(),E(dZ($)),K6($),G9($),G6($),T6($),C(),(Z)=>fZ(lZ(Z))(Z))($)}catch(Q){throw console.error("FAB creation error:",Q),new Error(`Failed to create FAB: ${Q.message}`)}},o$=Uj;J6();c();o();var rZ=({disabled:J,lifecycle:$,text:Q,className:Z})=>(q)=>({...q,element:q.element,getValue:()=>q.element.value,setValue(j){return q.element.value=j,this},enable(){return J.enable(),this},disable(){return J.disable(),this},setIcon(j){return q.icon.setIcon(j),this},getIcon(){return q.icon.getIcon()},setText(j){return Q.setText(j),this},getText(){return Q.getText()},setPosition(j){return["top-right","top-left","bottom-right","bottom-left"].forEach((G)=>{q.element.classList.remove(`${Z}--${G}`)}),q.element.classList.add(`${Z}--${j}`),this},getPosition(){let j=["top-right","top-left","bottom-right","bottom-left"];for(let K of j)if(q.element.classList.contains(`${Z}--${K}`))return K;return null},lower(){return q.element.classList.add(`${Z}--lowered`),this},raise(){return q.element.classList.remove(`${Z}--lowered`),this},collapse(){q.element.classList.add(`${Z}--collapsed`);let j=new CustomEvent("collapse",{bubbles:!0,cancelable:!0});return q.element.dispatchEvent(j),this},expand(){q.element.classList.remove(`${Z}--collapsed`);let j=new CustomEvent("expand",{bubbles:!0,cancelable:!0});return q.element.dispatchEvent(j),this},destroy(){$.destroy()}});t();var Xj={variant:"primary",type:"button",ripple:!0,iconPosition:"start",width:"fixed"},pZ=(J={})=>d(Xj,J,"extended-fab"),sZ=(J)=>{let $={type:J.type||"button","aria-label":J.ariaLabel||J.text||(J.icon?"action":void 0)},Q=[`${J.prefix}-extended-fab`];if(J.variant)Q.push(`${J.prefix}-extended-fab--${J.variant}`);if(J.width)Q.push(`${J.prefix}-extended-fab--${J.width}`);if(J.animate)Q.push(`${J.prefix}-extended-fab--animate-enter`);if(J.position)Q.push(`${J.prefix}-extended-fab--${J.position}`);if(J.collapseOnScroll)Q.push(`${J.prefix}-extended-fab--collapsible`);if(J.class)Q.push(J.class);if(J.disabled===!0)$.disabled=!0,Q.push(`${J.prefix}-extended-fab--disabled`);return p(J,{tag:"button",attributes:$,className:Q,forwardEvents:{click:(Z)=>!Z.element.disabled,focus:!0,blur:!0},interactive:!0})},mZ=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()},className:J.getClass("extended-fab"),text:{setText:($)=>J.text.setText($),getText:()=>J.text.getText()}});var Bj=(J={})=>{let $=pZ(J),Q=(Z)=>{if($.collapseOnScroll){let q=window.scrollY,j=!1,K=10,G=()=>{if(!j)window.requestAnimationFrame(()=>{let z=window.scrollY,Y=z-q;if(Y>K)Z.collapse();else if(Y<-K)Z.expand();if(z<=0)Z.expand();q=z,j=!1}),j=!0};window.addEventListener("scroll",G,{passive:!0}),requestAnimationFrame(()=>{Z.expand()});let W=Z.destroy;Z.destroy=()=>{window.removeEventListener("scroll",G),W.call(Z)}}};try{let Z=b(S,g(),E(sZ($)),K6($),G9($),K9($),G6($),T6($),C(),(q)=>rZ(mZ(q))(q))($);return Q(Z),Z}catch(Z){throw console.error("Extended FAB creation error:",Z),new Error(`Failed to create Extended FAB: ${Z.message}`)}},t$=Bj;J6();c();o();var aZ=!1,Fj=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize menu controller: missing element"),$;let Q={visible:J.visible||!1,items:J.items||[],position:J.position,selectedItemId:null,activeItemIndex:-1,component:$},Z={triggerEvent(F,N={},O){let P={menu:Q.component,...N,originalEvent:O,preventDefault:()=>{P.defaultPrevented=!0},defaultPrevented:!1};return $.emit(F,P),P}},q=()=>{if($.opener&&typeof $.opener.getOpener==="function")return $.opener.getOpener();let{opener:F}=J;if(typeof F==="string"){let N=document.querySelector(F);if(!N)return console.warn(`Menu opener not found: ${F}`),null;return N}if(typeof F==="object"&&F!==null&&"element"in F)return F.element;return F},j=(F,N)=>{let O=document.createElement("li"),P=`${$.getClass("menu-item")}`;if(O.className=P,O.setAttribute("role","menuitem"),O.setAttribute("tabindex","-1"),O.setAttribute("data-id",F.id),O.setAttribute("data-index",N.toString()),F.disabled)O.classList.add(`${P}--disabled`),O.setAttribute("aria-disabled","true");else O.setAttribute("aria-disabled","false");if(Q.selectedItemId&&F.id===Q.selectedItemId)O.classList.add(`${P}--selected`),O.setAttribute("aria-selected","true");else O.setAttribute("aria-selected","false");if(F.hasSubmenu)O.classList.add(`${P}--submenu`),O.setAttribute("aria-haspopup","true"),O.setAttribute("aria-expanded","false");let L=document.createElement("span");if(L.className=`${$.getClass("menu-item-content")}`,F.icon){let R=document.createElement("span");R.className=`${$.getClass("menu-item-icon")}`,R.innerHTML=F.icon,L.appendChild(R)}let D=document.createElement("span");if(D.className=`${$.getClass("menu-item-text")}`,D.textContent=F.text,L.appendChild(D),F.shortcut){let R=document.createElement("span");R.className=`${$.getClass("menu-item-shortcut")}`,R.textContent=F.shortcut,L.appendChild(R)}if(O.appendChild(L),!F.disabled){if(O.addEventListener("click",(R)=>z(R,F,N)),O.addEventListener("keydown",(R)=>{if(R.key==="Enter"||R.key===" ")R.preventDefault(),z(R,F,N)}),O.addEventListener("focus",()=>{Q.activeItemIndex=N}),F.hasSubmenu&&J.openSubmenuOnHover)O.addEventListener("mouseenter",()=>{if($.submenu)$.submenu.handleSubmenuHover(F,N,O)}),O.addEventListener("mouseleave",(R)=>{if($.submenu)$.submenu.handleSubmenuLeave(R)})}return O},K=(F,N)=>{let O=document.createElement("li");if(O.className=`${$.getClass("menu-divider")}`,O.setAttribute("role","separator"),O.setAttribute("data-index",N.toString()),F.id)O.setAttribute("id",F.id);return O},G=()=>{let F=document.createElement("ul");F.className=`${$.getClass("menu-list")}`,F.setAttribute("role","menu"),Q.items.forEach((N,O)=>{if("type"in N&&N.type==="divider")F.appendChild(K(N,O));else F.appendChild(j(N,O))}),$.element.innerHTML="",$.element.appendChild(F)},W=(F)=>{for(let N of Q.items){if("id"in N&&N.id===F)return N;if("submenu"in N&&Array.isArray(N.submenu)){for(let O of N.submenu)if("id"in O&&O.id===F)return O}}return null},z=(F,N,O)=>{if(F.preventDefault(),F.stopPropagation(),N.disabled)return;if(N.hasSubmenu&&$.submenu){$.submenu.handleSubmenuClick(N,O,F.currentTarget);return}let P=Z.triggerEvent("select",{item:N,itemId:N.id,itemData:N.data},F);if(J.closeOnSelect&&!P.defaultPrevented)X(F,!0)},Y=(F)=>{if(!$.element)return;$.element.querySelectorAll(`.${$.getClass("menu-item")}`).forEach((O)=>{if(O.getAttribute("data-id")===F)O.classList.add(`${$.getClass("menu-item--selected")}`),O.setAttribute("aria-selected","true");else O.classList.remove(`${$.getClass("menu-item--selected")}`),O.setAttribute("aria-selected","false")}),Q.selectedItemId=F},U=(F,N="mouse")=>{if(Q.visible)return;if(Q.visible=!0,document.removeEventListener("click",H),!$.element.parentNode)$.element.classList.remove(`${$.getClass("menu--visible")}`),$.element.setAttribute("aria-hidden","true"),$.element.style.transform="scaleY(0)",$.element.style.opacity="0",document.body.appendChild($.element);let O=q();if(O&&$.position)$.position.positionMenu(O);setTimeout(()=>{$.element.setAttribute("aria-hidden","false"),$.element.style.transform="",$.element.style.opacity="",$.element.getBoundingClientRect(),$.element.classList.add(`${$.getClass("menu--visible")}`),setTimeout(()=>{if($.keyboard&&$.keyboard.handleInitialFocus)$.keyboard.handleInitialFocus($.element,N);else if(N==="keyboard"){let P=Array.from($.element.querySelectorAll(`.${$.getClass("menu-item")}:not(.${$.getClass("menu-item--disabled")})`));if(P.length>0)P.forEach((L)=>{L.tabIndex=-1}),P[0].tabIndex=0,P[0].focus();else $.element.tabIndex=0,$.element.focus()}else{$.element.tabIndex=-1;let P=Array.from($.element.querySelectorAll(`.${$.getClass("menu-item")}:not(.${$.getClass("menu-item--disabled")})`));if(P.length>0)P.forEach((L)=>{L.tabIndex=-1}),P[0].tabIndex=0}},100),setTimeout(()=>{if(J.closeOnClickOutside&&Q.visible)document.addEventListener("click",H);if(J.closeOnEscape)document.addEventListener("keydown",B);window.addEventListener("resize",k,{passive:!0}),window.addEventListener("scroll",M,{passive:!0})},0)},20),Z.triggerEvent("open",{},F)},X=(F,N=!0)=>{if(!Q.visible)return;if($.emit("menu-closing",{event:F,restoreFocus:N}),$.submenu)$.submenu.closeAllSubmenus();setTimeout(()=>{Q.visible=!1,$.element.setAttribute("aria-hidden","true"),$.element.classList.remove(`${$.getClass("menu--visible")}`),document.removeEventListener("click",H),document.removeEventListener("keydown",B),window.removeEventListener("resize",k),window.removeEventListener("scroll",M),Z.triggerEvent("close",{restoreFocus:N},F),setTimeout(()=>{if($.element.parentNode&&!Q.visible)$.element.parentNode.removeChild($.element)},300)},50)},_=(F,N="mouse")=>{if(Q.visible)X(F);else{if(F){if(F instanceof KeyboardEvent)N="keyboard";else if(F instanceof MouseEvent)N="mouse"}U(F,N)}},H=(F)=>{if(aZ){aZ=!1;return}if($.element.contains(F.target))return;let N=q();if(N&&N.contains(F.target))return;if($.submenu&&$.submenu.hasOpenSubmenu()){let O=$.submenu.getActiveSubmenus();for(let P of O)if(P.element.contains(F.target))return}X(F,!1)},B=(F)=>{let N=$.element.contains(F.target),O=$.submenu&&$.submenu.hasOpenSubmenu()&&$.submenu.getActiveSubmenus().some((P)=>P.element.contains(F.target));if(Q.visible){if(N||O){if(F.key==="Escape")F.preventDefault(),X(F,!0)}else if($.keyboard&&$.keyboard.handleMenuKeydown)$.keyboard.handleMenuKeydown(F,Q,{closeMenu:X,closeSubmenu:$.submenu?$.submenu.closeSubmenu:null,findItemById:W,handleSubmenuClick:$.submenu?$.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:$.submenu?$.submenu.handleNestedSubmenuClick:null})}},k=()=>{if(Q.visible){let F=q();if(F&&$.position)$.position.positionMenu(F)}},M=()=>{if(Q.visible)window.requestAnimationFrame(()=>{let F=q();if(F&&$.position)$.position.positionMenu(F)})},V=()=>{if(G(),$.keyboard&&$.keyboard.setupKeyboardHandlers)$.keyboard.setupKeyboardHandlers($.element,Q,{closeMenu:X,closeSubmenu:$.submenu?$.submenu.closeSubmenu:null,findItemById:W,handleSubmenuClick:$.submenu?$.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:$.submenu?$.submenu.handleNestedSubmenuClick:null});if(Q.visible){let F=q();if(F&&$.position)$.position.positionMenu(F);if($.element.classList.add(`${$.getClass("menu--visible")}`),J.closeOnClickOutside)document.addEventListener("click",H);if(J.closeOnEscape)document.addEventListener("keydown",B);window.addEventListener("resize",k),window.addEventListener("scroll",M)}};if($.on("create-menu-items",(F)=>{let{items:N,container:O,onItemCreated:P}=F;N.forEach((L,D)=>{let R;if("type"in L&&L.type==="divider")R=K(L,D);else R=j(L,D);if(O.appendChild(R),P)P(R)})}),setTimeout(V,0),$.lifecycle){let F=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{document.removeEventListener("click",H),document.removeEventListener("keydown",B),window.removeEventListener("resize",k),window.removeEventListener("scroll",M),F()}}return{...$,menu:{open:(F,N="mouse")=>{return U(F,N),$},close:(F,N=!0)=>{return X(F,N),$},toggle:(F,N="mouse")=>{return _(F,N),$},isOpen:()=>Q.visible,setItems:(F)=>{return Q.items=F,G(),$},getItems:()=>Q.items,setPosition:(F)=>{if(Q.position=F,Q.visible){let N=q();if(N&&$.position)$.position.positionMenu(N)}return $},getPosition:()=>Q.position,setSelected:(F)=>{return Y(F),$},getSelected:()=>Q.selectedItemId}}},BJ=Fj;var Hj=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize menu opener: missing element"),$;let Q=!1;document.addEventListener("keydown",(B)=>{Q=B.key==="Tab",setTimeout(()=>{Q=!1},100)});let Z={openerElement:null,openerComponent:null,activeClass:""},q=(B)=>{if(!B)return{element:null,component:null};if(typeof B==="string"){let k=document.querySelector(B);if(!k)return console.warn(`Menu opener not found: ${B}`),{element:null,component:null};return{element:k,component:null}}if(typeof B==="object"&&B!==null){if("element"in B&&B.element instanceof HTMLElement)return{element:B.element,component:B};if("getElement"in B&&typeof B.getElement==="function"){let k=B.getElement();if(k instanceof HTMLElement)return{element:k,component:B}}if("input"in B&&B.input instanceof HTMLElement)return{element:B.input,component:B};if(B instanceof HTMLElement)return{element:B,component:null}}return console.warn("Invalid opener type:",B),{element:null,component:null}},j=(B)=>{let k=$.getClass("").split("-")[0];if(B.tagName==="BUTTON")return`${k}-button--active`;else if(B.classList.contains(`${k}-chip`))return`${k}-chip--selected`;else if(B.classList.contains(`${k}-textfield`)||B.classList.contains(`${k}-select`))return`${k}-textfield--focused`;else return`${k}-menu-opener--active`},K=(B)=>{let{element:k,component:M}=B;if(!k)return;if(Z.openerElement&&Z.openerElement!==k)X();Z.openerElement=k,Z.openerComponent=M,Z.activeClass=j(k),k.addEventListener("click",z),k.addEventListener("keydown",Y),k.addEventListener("blur",U),k.setAttribute("aria-haspopup","true"),k.setAttribute("aria-expanded","false");let V=$.element.id;if(!V)V=`menu-${Date.now()}-${Math.floor(Math.random()*1000)}`,$.element.id=V;k.setAttribute("aria-controls",V)},G=(B)=>{if(!Z.openerElement)return;if(Z.openerComponent&&typeof Z.openerComponent.setActive==="function"){Z.openerComponent.setActive(B);return}if(Z.openerComponent&&"selected"in Z.openerComponent){Z.openerComponent.selected=B;return}if(Z.openerComponent&&typeof Z.openerComponent.focus==="function"&&typeof Z.openerComponent.blur==="function"){if(B)Z.openerComponent.focus();else Z.openerComponent.blur();return}if(Z.openerElement.classList)if(B)Z.openerElement.classList.add(Z.activeClass);else Z.openerElement.classList.remove(Z.activeClass)},W=()=>{if(!Z.openerElement)return;if(Z.openerComponent&&typeof Z.openerComponent.focus==="function"){requestAnimationFrame(()=>{Z.openerComponent.focus()});return}if(Z.openerComponent&&"input"in Z.openerComponent&&Z.openerComponent.input instanceof HTMLElement){requestAnimationFrame(()=>{Z.openerComponent.input.focus()});return}requestAnimationFrame(()=>{Z.openerElement.focus()})},z=(B)=>{if(B.preventDefault(),$.menu)if($.menu.isOpen())$.menu.close(B);else $.menu.open(B,"mouse")},Y=(B)=>{if(!$.menu)return;let k=$.menu.isOpen();switch(B.key){case"Enter":case" ":case"ArrowDown":case"Down":if(B.preventDefault(),!k)$.menu.open(B,"keyboard");break;case"Escape":if(k)B.preventDefault(),$.menu.close(B);break;case"ArrowUp":case"Up":if(B.preventDefault(),!k)$.menu.open(B,"keyboard"),setTimeout(()=>{let M=$.element.querySelectorAll(`.${$.getClass("menu-item")}:not(.${$.getClass("menu-item--disabled")})`);if(M.length>0){M.forEach((F)=>F.setAttribute("tabindex","-1"));let V=M[M.length-1];V.setAttribute("tabindex","0"),V.focus()}},100);break}},U=(B)=>{if(!$.menu||!$.menu.isOpen())return;let k=B.relatedTarget;if(Q){setTimeout(()=>{if($.menu&&$.menu.isOpen())$.menu.close(B,!1)},10);return}if(k){if($.element.contains(k))return;if(k.getAttribute("aria-haspopup")==="true"||k.closest('[aria-haspopup="true"]'))return}setTimeout(()=>{if($.menu&&$.menu.isOpen())$.menu.close(B,!1)},50)},X=()=>{if(Z.openerElement)Z.openerElement.removeEventListener("click",z),Z.openerElement.removeEventListener("keydown",Y),Z.openerElement.removeEventListener("blur",U),Z.openerElement.removeAttribute("aria-haspopup"),Z.openerElement.removeAttribute("aria-expanded"),Z.openerElement.removeAttribute("aria-controls"),G(!1);Z.openerComponent=null,Z.openerElement=null,Z.activeClass=""},{element:_,component:H}=q(J.opener);if(K({element:_,component:H}),$.lifecycle){let B=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{X(),B()}}return $.on("open",()=>{if(Z.openerElement)Z.openerElement.setAttribute("aria-expanded","true"),G(!0)}),$.on("close",(B)=>{if(Z.openerElement){if(Z.openerElement.setAttribute("aria-expanded","false"),G(!1),B.restoreFocus&&!Q)W()}}),{...$,opener:{setOpener(B){let k=q(B);if(k.element)K(k);return $},getOpener(){return Z.openerElement},getOpenerComponent(){return Z.openerComponent},setActive(B){return G(B),$},focus(){return W(),$}}}},FJ=Hj;var Mj=(J,$)=>{let Q=(j,K,G,W=!1)=>{if(!j||!K)return;j.style.position="absolute";let z=window.pageXOffset||document.documentElement.scrollLeft,Y=window.pageYOffset||document.documentElement.scrollTop,U=j.cloneNode(!0);U.style.visibility="hidden",U.style.display="block",U.style.position="absolute",U.style.top="0",U.style.left="0",U.style.transform="none",U.style.opacity="0",U.style.pointerEvents="none",U.classList.add(`${J.getClass("menu--visible")}`),document.body.appendChild(U);let X=K.getBoundingClientRect(),_=U.getBoundingClientRect(),H=window.innerWidth,B=window.innerHeight;document.body.removeChild(U);let k=$.offset!==void 0?$.offset:8,M=0,V=0,F=G;if(W){if(F=G||"right-start",F.startsWith("right")&&X.right+_.width+k>H-16)F=F.replace("right","left");else if(F.startsWith("left")&&X.left-_.width-k<16)F=F.replace("left","right");if(X.top+_.height>B-48){if(F==="right-start")F="right-end";else if(F==="left-start")F="left-end"}}else switch(G){case"top-start":case"top":case"top-end":if(X.top<_.height+k+48)F=G.replace("top","bottom");break;case"bottom-start":case"bottom":case"bottom-end":if(X.bottom+_.height+k+48>B){if(X.top>B-X.bottom)F=G.replace("bottom","top")}break;case"right-start":case"right":case"left-start":case"left":if(X.bottom+_.height>B-48){if(G==="right-start")F="right-end";else if(G==="left-start")F="left-end";else if(G==="right")M=X.top-(_.height-X.height)-k;else if(G==="left")M=X.top-(_.height-X.height)-k}break}if(["position-top","position-bottom","position-right","position-left"].forEach((R)=>{j.classList.remove(`${J.getClass("menu")}--${R}`)}),F.startsWith("top")||F==="right-end"||F==="left-end"||F==="right"&&M<X.top||F==="left"&&M<X.top)j.classList.add(`${J.getClass("menu")}--position-top`);else if(F.startsWith("left"))j.classList.add(`${J.getClass("menu")}--position-left`);else if(F.startsWith("right"))j.classList.add(`${J.getClass("menu")}--position-right`);else j.classList.add(`${J.getClass("menu")}--position-bottom`);switch(F){case"top-start":M=X.top+Y-_.height-k,V=X.left+z;break;case"top":M=X.top+Y-_.height-k,V=X.left+z+X.width/2-_.width/2;break;case"top-end":M=X.top+Y-_.height-k,V=X.right+z-_.width;break;case"right-start":M=X.top+Y,V=X.right+z+k;break;case"right":if(M===0)M=X.top+Y+X.height/2-_.height/2;else M+=Y;V=X.right+z+k;break;case"right-end":M=X.bottom+Y-_.height,V=X.right+z+k;break;case"bottom-start":M=X.bottom+Y+k,V=X.left+z;break;case"bottom":M=X.bottom+Y+k,V=X.left+z+X.width/2-_.width/2;break;case"bottom-end":M=X.bottom+Y+k,V=X.right+z-_.width;break;case"left-start":M=X.top+Y,V=X.left+z-_.width-k;break;case"left":if(M===0)M=X.top+Y+X.height/2-_.height/2;else M+=Y;V=X.left+z-_.width-k;break;case"left-end":M=X.bottom+Y-_.height,V=X.left+z-_.width-k;break}let P=48;if(M-Y<P)M=P+Y;let L=48;if(M-Y+_.height>B-L){let R=B-(M-Y)-L,w=Math.min(_.height,100),A=Math.max(R,w);if(j.style.maxHeight=`${A}px`,$.maxHeight){let x=parseInt($.maxHeight,10);if(!isNaN(x)&&x<parseInt(j.style.maxHeight||"0",10))j.style.maxHeight=$.maxHeight}}else if($.maxHeight)j.style.maxHeight=$.maxHeight;if($.width==="100%"&&!W)j.style.width=`${X.width}px`;if(j.style.top=`${Math.max(P+Y,M)}px`,j.style.left=`${Math.max(16+z,V)}px`,V-z+_.width>H-16)j.style.left="auto",j.style.right="16px"};return{positionMenu:(j)=>{if(!j||!J.element)return;Q(J.element,j,$.position,!1)},positionSubmenu:(j,K,G=1)=>{if(!j||!K)return;let W=G%2===1?"right-start":"left-start";j.style.zIndex=`${1000+G*10}`,Q(j,K,W,!0)},positionElement:Q}},kj=(J)=>($)=>{if(!$.element)return $;let Q=Mj($,J);return{...$,position:Q}},HJ=kj;var Nj=(J)=>{let $=!1;(()=>{document.addEventListener("keydown",(W)=>{$=W.key==="Tab",setTimeout(()=>{$=!1},100)})})();let Z=()=>{let z=document.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])');return Array.from(z).filter((Y)=>{return Y.offsetParent!==null&&!Y.classList.contains("hidden")})},q=(W,z)=>{if(z==="keyboard"){let Y=Array.from(W.querySelectorAll(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`));if(Y.length>0)Y[0].setAttribute("tabindex","0"),Y[0].focus();else W.setAttribute("tabindex","0"),W.focus()}else{W.setAttribute("tabindex","-1");let Y=W.querySelector(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`);if(Y)Y.setAttribute("tabindex","0")}},j=(W,z,Y)=>{let U=z.activeSubmenu&&z.activeSubmenu.contains(W.target),X=U?z.activeSubmenu:J.element,_=Array.from(X.querySelectorAll(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`));if(_.length===0)return;let H=document.activeElement,B=-1;if(H&&_.includes(H))B=_.indexOf(H);let k=(M)=>{if(_[M])_[M].focus()};switch(W.key){case"ArrowDown":case"Down":if(W.preventDefault(),B<0)k(0);else if(B<_.length-1)k(B+1);else k(0);break;case"ArrowUp":case"Up":if(W.preventDefault(),B<0)k(_.length-1);else if(B>0)k(B-1);else k(_.length-1);break;case"Home":W.preventDefault(),k(0);break;case"End":W.preventDefault(),k(_.length-1);break;case"Enter":case" ":if(W.preventDefault(),B>=0)_[B].click();break;case"ArrowRight":case"Right":if(W.preventDefault(),U){if(B>=0&&_[B].classList.contains(`${J.getClass("menu-item--submenu")}`)){let V=_[B],F=parseInt(V.getAttribute("data-index"),10),O=V.closest(`.${J.getClass("menu--submenu")}`)?.getAttribute("data-parent-item"),P=Y.findItemById(O);if(P&&P.submenu){let L=P.submenu[F];Y.handleNestedSubmenuClick(L,F,V)}}}else if(B>=0&&_[B].classList.contains(`${J.getClass("menu-item--submenu")}`)){let V=_[B],F=parseInt(V.getAttribute("data-index"),10),N=z.items[F];Y.handleSubmenuClick(N,F,V)}break;case"ArrowLeft":case"Left":if(W.preventDefault(),U)if(z.activeSubmenuItem){let V=z.activeSubmenuItem,F=parseInt(X.getAttribute("data-level")||"1",10);if(Y.closeSubmenu(F),V)V.focus()}else Y.closeSubmenu(1);break;case"Escape":if(W.preventDefault(),U)if(z.activeSubmenuItem){let V=z.activeSubmenuItem,F=parseInt(X.getAttribute("data-level")||"1",10);if(Y.closeSubmenu(F),V)V.focus()}else Y.closeSubmenu(1);else Y.closeMenu(W,!0);break;case"Tab":W.preventDefault();let M=J.opener?.getOpener?.();if(Y.closeMenu(W,!0),M)setTimeout(()=>{if(W.shiftKey);else{let V=Z(),F=V.indexOf(M);if(F>=0&&F<V.length-1)V[F+1].focus()}},0);break}};return{handleInitialFocus:q,handleMenuKeydown:j,setupKeyboardHandlers:(W,z,Y)=>{let U=W.querySelectorAll(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`);if(U.forEach((X)=>{X.tabIndex=-1}),U.length>0)U[0].tabIndex=0;W.addEventListener("keydown",(X)=>j(X,z,Y))},isTabNavigationActive:()=>$,getFocusableElements:Z}},Vj=()=>(J)=>{if(!J.element)return J;let $=Nj(J);return{...J,keyboard:$}},MJ=Vj;var _j=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize menu submenu: missing element"),$;let Q={activeSubmenu:null,activeSubmenuItem:null,submenuLevel:0,activeSubmenus:[],submenuTimer:null,hoverIntent:{timer:null,activeItem:null},component:$},Z=()=>{if(Q.hoverIntent.timer)clearTimeout(Q.hoverIntent.timer),Q.hoverIntent.timer=null,Q.hoverIntent.activeItem=null},q=()=>{if(Q.submenuTimer)clearTimeout(Q.submenuTimer),Q.submenuTimer=null},j=(V,F,N)=>{if(!J.openSubmenuOnHover||!V.hasSubmenu)return;Z(),q(),Q.hoverIntent.activeItem=N,Q.hoverIntent.timer=setTimeout(()=>{if(N.matches(":hover")){if(Q.activeSubmenuItem!==N)z(V,F,N)}Q.hoverIntent.timer=null},100)},K=()=>{Z(),q(),Q.submenuTimer=setTimeout(()=>{let{activeSubmenu:V,activeSubmenuItem:F}=Q;if(V&&F){let N=V.matches(":hover"),O=F.matches(":hover");if(!N&&!O)Y(Q.submenuLevel)}Q.submenuTimer=null},300)},G=(V,F,N)=>{if(!V.submenu||!V.hasSubmenu)return;let O=N.getAttribute("aria-expanded")==="true";if(Q.activeSubmenus.some((L)=>L.isOpening))return;if(O){let L=parseInt(N.closest(`.${$.getClass("menu--submenu")}`)?.getAttribute("data-level")||"0",10);Y(L+1),N.setAttribute("aria-expanded","false")}else z(V,F,N)},W=(V,F,N)=>{if(!V.submenu||!V.hasSubmenu)return;let O=N.getAttribute("aria-expanded")==="true";if(Q.activeSubmenus.some((L)=>L.isOpening))return;if(O){let L=parseInt(N.closest(`.${$.getClass("menu--submenu")}`)?.getAttribute("data-level")||"1",10);Y(L+1)}else z(V,F,N)},z=(V,F,N)=>{if(!V.submenu||!V.hasSubmenu)return;let O=N.closest(`.${$.getClass("menu--submenu")}`)?parseInt(N.closest(`.${$.getClass("menu--submenu")}`).getAttribute("data-level")||"0",10)+1:1;if(Y(O),Q.activeSubmenus.findIndex((w)=>w.menuItem===N&&w.isOpening)>=0)return;N.setAttribute("aria-expanded","true");let L=document.createElement("div");L.className=`${$.getClass("menu")} ${$.getClass("menu--submenu")}`,L.setAttribute("role","menu"),L.setAttribute("tabindex","-1"),L.setAttribute("data-level",O.toString()),L.setAttribute("data-parent-item",V.id),L.style.zIndex=`${1000+O*10}`;let D=document.createElement("ul");D.className=`${$.getClass("menu-list")}`;let R=[];if($.emit("create-menu-items",{items:V.submenu,container:D,level:O,onItemCreated:(w)=>{if(!w.classList.contains(`${$.getClass("menu-item--disabled")}`))R.push(w)}}),L.appendChild(D),document.body.appendChild(L),$.position&&$.position.positionSubmenu)$.position.positionSubmenu(L,N,O);if($.keyboard&&$.keyboard.setupKeyboardHandlers)$.keyboard.setupKeyboardHandlers(L,{activeSubmenus:Q.activeSubmenus},{closeSubmenu:Y,handleNestedSubmenuClick:W});L.addEventListener("mouseenter",()=>{q()}),L.addEventListener("mouseleave",()=>{K()}),Q.activeSubmenu=L,Q.activeSubmenuItem=N,Q.activeSubmenus.push({element:L,menuItem:N,level:O,isOpening:!0}),Q.submenuLevel=O,document.addEventListener("click",X),window.addEventListener("resize",_,{passive:!0}),window.addEventListener("scroll",H,{passive:!0}),requestAnimationFrame(()=>{L.classList.add(`${$.getClass("menu--visible")}`),setTimeout(()=>{let w=Q.activeSubmenus.findIndex((A)=>A.element===L);if(w!==-1)Q.activeSubmenus[w].isOpening=!1;if(R.length>0){if(O>=2||document.activeElement===N)R[0].setAttribute("tabindex","0"),R[0].focus()}},300)}),$.emit("submenu-opened",{submenuElement:L,parentItem:N,level:O,item:V})},Y=(V)=>{Z(),q();let F=[];for(let N=Q.activeSubmenus.length-1;N>=0;N--)if(Q.activeSubmenus[N].level>=V){let O=Q.activeSubmenus[N];if(O.menuItem)O.menuItem.setAttribute("aria-expanded","false");O.element.classList.remove(`${$.getClass("menu--visible")}`),setTimeout(()=>{if(O.element.parentNode)O.element.parentNode.removeChild(O.element)},200),F.push(N)}if(F.forEach((N)=>{Q.activeSubmenus.splice(N,1)}),Q.activeSubmenus.length>0){let N=Q.activeSubmenus[Q.activeSubmenus.length-1];if(Q.activeSubmenu=N.element,Q.activeSubmenuItem=N.menuItem,Q.submenuLevel=N.level,N.menuItem)N.menuItem.focus()}else Q.activeSubmenu=null,Q.activeSubmenuItem=null,Q.submenuLevel=0;$.emit("submenu-closed",{level:V})},U=()=>{if(Z(),q(),Q.activeSubmenus.length===0)return;[...Q.activeSubmenus].forEach((V)=>{if(V.menuItem)V.menuItem.setAttribute("aria-expanded","false");V.element.classList.remove(`${$.getClass("menu--visible")}`),setTimeout(()=>{if(V.element.parentNode)V.element.parentNode.removeChild(V.element)},200)}),Q.activeSubmenu=null,Q.activeSubmenuItem=null,Q.activeSubmenus=[],Q.submenuLevel=0,document.removeEventListener("click",X),window.removeEventListener("resize",_),window.removeEventListener("scroll",H),$.emit("all-submenus-closed",{})},X=(V)=>{if(!Q.activeSubmenu)return;let{activeSubmenu:F,activeSubmenuItem:N}=Q;if(F.contains(V.target)||N&&N.contains(V.target))return;U()},_=()=>{if(Q.activeSubmenu&&Q.activeSubmenuItem&&$.position)$.position.positionSubmenu(Q.activeSubmenu,Q.activeSubmenuItem,Q.submenuLevel)},H=()=>{window.requestAnimationFrame(()=>{if(Q.activeSubmenu&&Q.activeSubmenuItem&&$.position)$.position.positionSubmenu(Q.activeSubmenu,Q.activeSubmenuItem,Q.submenuLevel)})},B=()=>{return Q.activeSubmenus.length>0},k=()=>{return Q.submenuLevel},M=()=>{return[...Q.activeSubmenus]};if($.lifecycle){let V=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{if(Z(),q(),document.removeEventListener("click",X),window.removeEventListener("resize",_),window.removeEventListener("scroll",H),Q.activeSubmenus.length>0)Q.activeSubmenus.forEach((F)=>{if(F.element.parentNode)F.element.parentNode.removeChild(F.element)});V()}}return $.on("menu-closing",()=>{U()}),{...$,submenu:{openSubmenu:z,closeSubmenu:Y,closeAllSubmenus:U,handleSubmenuClick:G,handleNestedSubmenuClick:W,handleSubmenuHover:j,handleSubmenuLeave:K,hasOpenSubmenu:B,getSubmenuLevel:k,getActiveSubmenus:M}}},kJ=_j;var cZ=({menu:J,opener:$,events:Q,lifecycle:Z})=>(q)=>{return{element:q.element,open(K,G="mouse"){if(K&&!G){if(K instanceof KeyboardEvent)G="keyboard"}return J.open(K,G),this},close(K,G=!0,W=!1){return J.close(K,G,W),this},toggle(K,G){if(K&&!G){if(K instanceof KeyboardEvent)G="keyboard";else if(K instanceof MouseEvent)G="mouse"}return J.toggle(K,G),this},isOpen(){return J.isOpen()},setItems(K){return J.setItems(K),this},getItems(){return J.getItems()},setOpener(K){return $.setOpener(K),this},getOpener(){return $.getOpener()},setPosition(K){return J.setPosition(K),this},getPosition(){return J.getPosition()},setSelected(K){return J.setSelected(K),this},getSelected(){return J.getSelected()},on(K,G){if(Q?.on)Q.on(K,G);else if(q.on)q.on(K,G);return this},off(K,G){if(Q?.off)Q.off(K,G);else if(q.off)q.off(K,G);return this},destroy(){Z.destroy()}}};t();var n$={BOTTOM_START:"bottom-start",BOTTOM:"bottom",BOTTOM_END:"bottom-end",TOP_START:"top-start",TOP:"top",TOP_END:"top-end",RIGHT_START:"right-start",RIGHT:"right",RIGHT_END:"right-end",LEFT_START:"left-start",LEFT:"left",LEFT_END:"left-end"},a6={POSITION:n$.BOTTOM_START,OFFSET:0,CLOSE_ON_SELECT:!0,CLOSE_ON_CLICK_OUTSIDE:!0,CLOSE_ON_ESCAPE:!0,OPEN_SUBMENU_ON_HOVER:!0,AUTO_FLIP:!0},NJ={MOUSE:"mouse",KEYBOARD:"keyboard"},VJ={ITEM:"item",DIVIDER:"divider"},_J={OPEN:"open",CLOSE:"close",SELECT:"select"},J$={CONTAINER:"menu",VISIBLE:"menu--visible",INNER:"menu__inner",ITEM:"menu__item",ITEM_DISABLED:"menu__item--disabled",ITEM_SELECTED:"menu__item--selected",ITEM_HAS_SUBMENU:"menu__item--has-submenu",DIVIDER:"menu__divider",ITEM_ICON:"menu__item-icon",ITEM_TEXT:"menu__item-text",ITEM_SHORTCUT:"menu__item-shortcut",SUBMENU_INDICATOR:"menu__submenu-indicator"};var Lj={items:[],position:a6.POSITION,closeOnSelect:a6.CLOSE_ON_SELECT,closeOnClickOutside:a6.CLOSE_ON_CLICK_OUTSIDE,closeOnEscape:a6.CLOSE_ON_ESCAPE,openSubmenuOnHover:a6.OPEN_SUBMENU_ON_HOVER,offset:a6.OFFSET,autoFlip:a6.AUTO_FLIP,visible:!1},iZ=(J)=>{if(!J.opener)throw new Error("Menu component requires an opener element or selector");return d(Lj,J,"menu")},oZ=(J)=>{let $={};if(J.width)$.width=J.width;if(J.maxHeight)$.maxHeight=J.maxHeight;let Q={role:"menu",tabindex:"-1","aria-hidden":(!J.visible).toString(),style:Object.entries($).map(([Z,q])=>`${Z}: ${q}`).join(";")};return p(J,{tag:"div",attributes:Q,className:[J.visible?J$.VISIBLE:null,J.class].filter(Boolean),forwardEvents:{keydown:!0}})},tZ=(J)=>({menu:{open:($,Q)=>J.menu?.open($,Q),close:($,Q,Z)=>J.menu?.close($,Q,Z),toggle:($,Q)=>J.menu?.toggle($,Q),isOpen:()=>J.menu?.isOpen()||!1,setItems:($)=>J.menu?.setItems($),getItems:()=>J.menu?.getItems()||[],setPosition:($)=>J.menu?.setPosition($),getPosition:()=>J.menu?.getPosition(),setSelected:($)=>J.menu?.setSelected($),getSelected:()=>J.menu?.getSelected()},opener:{setOpener:($)=>J.opener?.setOpener($),getOpener:()=>J.opener?.getOpener()},submenu:{hasOpenSubmenu:()=>J.submenu?.hasOpenSubmenu()||!1,closeAllSubmenus:()=>J.submenu?.closeAllSubmenus()},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy()}});var Dj=(J)=>{try{let $=iZ(J);return b(S,g(),E(oZ($)),HJ($),MJ(),kJ($),BJ($),FJ($),C(),(Z)=>cZ(tZ(Z))(Z))($)}catch($){throw console.error("Menu creation error:",$),new Error(`Failed to create menu: ${$.message}`)}},Q$=Dj;J6();c();o();var nZ=(J)=>($)=>{return{...$,element:$.element,items:$.items||new Map,addItem(Z){if(typeof $.addItem==="function")$.addItem(Z);return this},removeItem(Z){if(typeof $.removeItem==="function")$.removeItem(Z);return this},getItem(Z){if(typeof $.getItem==="function")return $.getItem(Z);return this.items.get(Z)},getAllItems(){if(typeof $.getAllItems==="function")return $.getAllItems();return Array.from(this.items.values())},getActive(){if(typeof $.getActive==="function")return $.getActive();return null},getItemPath(Z){if(typeof $.getItemPath==="function")return $.getItemPath(Z);return[]},setActive(Z){if(typeof $.handleItemClick==="function")$.handleItemClick(Z);else if(typeof $.setActive==="function")$.setActive(Z);else{let q=this.items.get(Z);if(q&&q.element){if($.emit)$.emit("change",{id:Z,item:q,source:"api"})}}return this},enable(){if(J.disabled.enable)J.disabled.enable();return this},disable(){if(J.disabled.disable)J.disabled.disable();return this},expand(){if(this.element.classList.remove(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","false"),$.emit)$.emit("expanded",{source:"api"});return this},collapse(){if(this.element.classList.add(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","true"),$.emit)$.emit("collapsed",{source:"api"});return this},isExpanded(){return!this.element.classList.contains(`${this.element.className.split(" ")[0]}--hidden`)},toggle(){return this.isExpanded()?this.collapse():this.expand()},on(Z,q){if($.on)$.on(Z,q);return this},off(Z,q){if($.off)$.off(Z,q);return this},destroy(){if(J.lifecycle.destroy)J.lifecycle.destroy()}}};var e$={RAIL:"rail",DRAWER:"drawer",BAR:"bar",MODAL:"modal",STANDARD:"standard"},$8={LEFT:"left",RIGHT:"right",TOP:"top",BOTTOM:"bottom"},J8={FIXED:"fixed",DISMISSIBLE:"dismissible",MODAL:"modal"},LJ={ACTIVE:"active",DISABLED:"disabled",EXPANDED:"expanded",COLLAPSED:"collapsed",HOVERED:"hovered",FOCUSED:"focused",PRESSED:"pressed"},Z$={CHANGE:"change",EXPAND:"expand",COLLAPSE:"collapse",GROUP_EXPAND:"group:expand",GROUP_COLLAPSE:"group:collapse"},B9={VARIANT:e$.STANDARD,POSITION:$8.LEFT,BEHAVIOR:J8.FIXED,EXPANDED:!1,SHOW_LABELS:!0,SCRIM_ENABLED:!0},n={CONTAINER:"nav",VARIANT_PREFIX:"nav--",POSITION_PREFIX:"nav--pos-",BEHAVIOR_PREFIX:"nav--",EXPANDED:"nav--expanded",DISABLED:"nav--disabled",ITEM:"nav-item",ITEM_CONTAINER:"nav-item-container",ICON:"nav-item-icon",LABEL:"nav-item-label",BADGE:"nav-item-badge",DIVIDER:"nav-divider",SCRIM:"nav-scrim",GROUP:"nav-group",GROUP_TITLE:"nav-group-title",SUBTITLE:"nav-subtitle",NESTED_CONTAINER:"nav-nested-container",NESTED_ITEM:"nav-nested-item",EXPAND_ICON:"nav-expand-icon",ACTIVE:"nav-item--active",ITEM_DISABLED:"nav-item--disabled"};var Oj=(J)=>{let $=document.createElement("span");return $.className=`${J}-${n.EXPAND_ICON}`,$.innerHTML=`
|
|
19
19
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
20
20
|
<polyline points="9 18 15 12 9 6"></polyline>
|
|
21
21
|
</svg>
|
|
22
|
-
`,$},Pj=(J,$,Q)=>{let Z=document.createElement("div");return Z.className=`${$}-${n.NESTED_CONTAINER}`,Z.setAttribute("role","menu"),Z.hidden=!0,J.forEach((q)=>{Q(q,Z,$)}),Z},Q8=(J,$,Q)=>{let Z=document.createElement("div");Z.className=`${Q}-${n.ITEM_CONTAINER}`;let q=$.getAttribute("role")==="menu",j=$.getAttribute("role")==="tablist",
|
|
23
|
-
.mtrl-nav-item:not([disabled]):not([aria-disabled="true"])`));if(
|
|
22
|
+
`,$},Pj=(J,$,Q)=>{let Z=document.createElement("div");return Z.className=`${$}-${n.NESTED_CONTAINER}`,Z.setAttribute("role","menu"),Z.hidden=!0,J.forEach((q)=>{Q(q,Z,$)}),Z},Q8=(J,$,Q)=>{let Z=document.createElement("div");Z.className=`${Q}-${n.ITEM_CONTAINER}`;let q=$.getAttribute("role")==="menu",j=$.getAttribute("role")==="tablist",K=$.closest(`.${Q}-nav--drawer, .${Q}-nav--drawer-modal, .${Q}-nav--drawer-standard`)!==null,G=document.createElement("button");if(G.className=`${Q}-${n.ITEM}`,G.type="button",J.items?.length)if(K)G.setAttribute("role","button"),G.setAttribute("aria-expanded",J.expanded?"true":"false"),G.setAttribute("aria-haspopup","menu");else G.setAttribute("role","button");else if(q)G.setAttribute("role","menuitem");else if(j)G.setAttribute("role","tab"),G.setAttribute("aria-selected",J.active?"true":"false"),G.setAttribute("tabindex",J.active?"0":"-1");if(J.id)G.dataset.id=J.id;if(J.disabled)G.disabled=!0,G.setAttribute("aria-disabled","true");if(J.icon){let W=document.createElement("span");W.className=`${Q}-${n.ICON}`,W.innerHTML=J.icon,G.appendChild(W)}if(J.label){let W=document.createElement("a");W.className=`${Q}-${n.LABEL}`,W.textContent=J.label,W.href=`/${J.id}`,W.style.textDecoration="none",W.style.color="inherit",W.style.pointerEvents="none",W.setAttribute("title",J.label),G.appendChild(W),G.setAttribute("aria-label",J.label)}if(J.badge){let W=document.createElement("span");W.className=`${Q}-${n.BADGE}`,W.textContent=J.badge,W.setAttribute("aria-label",`${J.badge} notifications`),G.appendChild(W)}if(J.active&&!J.items?.length){if(G.classList.add(`${Q}-${n.ACTIVE}`),!j)G.setAttribute("aria-current","page")}if(Z.appendChild(G),J.items?.length&&K){let W=Oj(Q);G.appendChild(W);let z=Pj(J.items,Q,Q8);z.hidden=!J.expanded,Z.appendChild(z),G.addEventListener("click",(Y)=>{Y.stopPropagation();let U=G.getAttribute("aria-expanded")==="true";if(G.setAttribute("aria-expanded",(!U).toString()),z.hidden=U,W.style)W.style.transform=U?"":"rotate(90deg)"})}return $.appendChild(Z),G},DJ=(J,$)=>{let Q=J.closest(`.${$}-${n.ITEM_CONTAINER}`);if(!Q)return[];let Z=Q.querySelector(`.${$}-${n.NESTED_CONTAINER}`);if(!Z)return[];return Array.from(Z.querySelectorAll(`.${$}-${n.ITEM}`)).reduce((j,K)=>{return[...j,K,...DJ(K,$)]},[])};function Rj(J,$){if(!J)return null;let Q=J.getAttribute("data-id");if(Q)return Q;if(J.classList.contains(`${$}-nav--rail`))return"rail";if(J.classList.contains(`${$}-nav--drawer`))return"drawer";return null}var eZ=(J)=>($)=>{let Q=new Map,Z=null,q=J.prefix||"mtrl",j=(W,z)=>{if(Q.set(W.id,{element:z,config:W}),W.items?.length)W.items.forEach((Y)=>{let U=z.closest(`.${q}-${n.ITEM_CONTAINER}`);if(U){let X=U.querySelector(`.${q}-${n.NESTED_CONTAINER}`);if(X){let _=X.querySelector(`[data-id="${Y.id}"]`);if(_)j(Y,_)}}})},K=(W,z,Y)=>{let U=W.getAttribute("role");if(Y){if(W.classList.add(`${q}-${n.ACTIVE}`),U==="tab")W.setAttribute("aria-selected","true"),W.setAttribute("tabindex","0");else if(!W.getAttribute("aria-haspopup"))W.setAttribute("aria-current","page")}else if(W.classList.remove(`${q}-${n.ACTIVE}`),U==="tab")W.setAttribute("aria-selected","false"),W.setAttribute("tabindex","-1");else if(W.hasAttribute("aria-current"))W.removeAttribute("aria-current")};if(J.items)J.items.forEach((W)=>{let z=Q8(W,$.element,q);if(j(W,z),W.active)Z={element:z,config:W},K(z,Z,!0)});if($.emit)$.element.addEventListener("mouseover",(W)=>{let Y=W.target.closest("[data-id]");if(Y){let U=Y.dataset.id;if(U)$.emit("mouseover",{id:U,clientX:W.clientX,clientY:W.clientY,target:Y,item:Q.get(U)})}},{passive:!0}),$.element.addEventListener("mouseenter",(W)=>{let z=$.element.dataset.id||$.componentName||"nav";$.emit("mouseenter",{clientX:W.clientX,clientY:W.clientY,id:z})},{passive:!0}),$.element.addEventListener("mouseleave",(W)=>{let z=W.relatedTarget,Y=Rj(z,q),U=$.element.dataset.id||$.componentName||"nav";$.emit("mouseleave",{clientX:W.clientX,clientY:W.clientY,relatedTargetId:Y,id:U})});if($.lifecycle){let W=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(Q.clear(),W)W()}}let G=(W)=>{let z=[W],Y=Q.get(W);if(!Y)return z;let U=Y.element.closest(`.${q}-${n.ITEM_CONTAINER}`);if(!U)return z;let X=U.parentElement;if(!X||!X.classList.contains(`${q}-${n.NESTED_CONTAINER}`))return z;let _=X;while(_){let H=_.parentElement;if(!H||!H.classList.contains(`${q}-${n.ITEM_CONTAINER}`))break;let B=H.querySelector(`.${q}-${n.ITEM}[data-id]`);if(!B)break;let k=B.getAttribute("data-id");if(!k)break;z.unshift(k);let M=H.parentElement;if(!M||!M.classList.contains(`${q}-${n.NESTED_CONTAINER}`))break;_=M}return z};return{...$,items:Q,addItem(W){if(Q.has(W.id))return this;let z=Q8(W,$.element,q);if(j(W,z),W.active)this.setActive(W.id);if($.emit)$.emit("itemAdded",{id:W.id,item:{element:z,config:W}});return this},removeItem(W){let z=Q.get(W);if(!z)return this;if(DJ(z.element,q).forEach((X)=>{let _=X.dataset.id;if(_)Q.delete(_)}),Z?.config.id===W)Z=null;let U=z.element.closest(`.${q}-${n.ITEM_CONTAINER}`);if(U)U.remove();if(Q.delete(W),$.emit)$.emit("itemRemoved",{id:W,item:z});return this},getItem:(W)=>Q.get(W),getAllItems:()=>Array.from(Q.values()),getActive:()=>Z,getItemPath:(W)=>G(W),setActive(W){let z=Q.get(W);if(!z||z.config.disabled)return this;if(Z)K(Z.element,Z,!1);if(K(z.element,z,!0),Z=z,G(W).forEach((U)=>{let X=Q.get(U);if(X){let _=X.element,H=_.closest(`.${q}-${n.ITEM_CONTAINER}`);if(H){let B=H.querySelector(`.${q}-${n.NESTED_CONTAINER}`);if(B)_.setAttribute("aria-expanded","true"),B.hidden=!1}}}),$.emit)$.emit(Z$.CHANGE,{id:W,item:z,previousItem:Z,path:G(W)});return this}}};var $9={ITEM:"nav-item",ITEM_CONTAINER:"nav-item-container",ICON:"nav-item-icon",LABEL:"nav-item-label",BADGE:"nav-item-badge",DIVIDER:"nav-divider",SCRIM:"nav-scrim",GROUP:"nav-group",GROUP_TITLE:"nav-group-title",SUBTITLE:"nav-subtitle",NESTED_CONTAINER:"nav-nested-container",NESTED_ITEM:"nav-nested-item",EXPAND_ICON:"nav-expand-icon"};var $2=(J)=>($)=>{let Q=J.prefix||"mtrl",Z=(K,G)=>{if(!K)return;let W=K.getAttribute("role");if(G){if(K.classList.add(`${Q}-${$9.ITEM}--active`),W==="tab")K.setAttribute("aria-selected","true"),K.setAttribute("tabindex","0");else if(!K.getAttribute("aria-haspopup"))K.setAttribute("aria-current","page")}else if(K.classList.remove(`${Q}-${$9.ITEM}--active`),W==="tab")K.setAttribute("aria-selected","false"),K.setAttribute("tabindex","-1");else if(K.hasAttribute("aria-current"))K.removeAttribute("aria-current")},q=(K)=>{if(K.getAttribute("aria-expanded")===null)return!1;let W=K.getAttribute("aria-expanded")==="true";K.setAttribute("aria-expanded",(!W).toString());let z=K.closest(`.${Q}-${$9.ITEM_CONTAINER}, .mtrl-nav-item-container`);if(z){let U=z.querySelector(`.${Q}-${$9.NESTED_CONTAINER}, .mtrl-nav-nested-container`);if(U){U.hidden=W;let X=K.querySelector(`.${Q}-${$9.EXPAND_ICON}, .mtrl-nav-expand-icon`);if(X&&X.style)X.style.transform=W?"":"rotate(90deg)"}}let Y=K.dataset.id;if(Y&&$.emit)$.emit("expandToggle",{id:Y,expanded:!W});return!0},j={...$,handleItemClick(K){if(!$.items)return;let G=$.items.get(K);if(!G)return;let W=$.element.querySelector(`.${Q}-${$9.ITEM}--active, .mtrl-nav-item--active`);if(W)Z(W,!1);if(G.element)Z(G.element,!0);if($.emit){let z=$.getItemPath?$.getItemPath(K):[];$.emit("change",{id:K,item:G,previousItem:W?{element:W,config:{id:W.dataset.id}}:null,path:z,source:"userAction"})}}};return $.element.addEventListener("click",(K)=>{let G=K.target,W=G.closest(`.${Q}-${$9.ITEM}, .mtrl-nav-item`);if(!W){if(!G.closest("[data-id]"))return}let z=W||G.closest("[data-id]");if(z.hasAttribute("disabled")||z.getAttribute("aria-disabled")==="true")return;let Y=z.dataset.id;if(!Y)return;if(q(z))return;j.handleItemClick(Y)}),$.element.addEventListener("keydown",(K)=>{if(!["Enter"," ","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"].includes(K.key))return;let G=["rail","drawer"].includes($.variant||""),W=["bar"].includes($.variant||"");if(K.key==="Enter"||K.key===" "){let _=document.activeElement;if(_&&_.classList.contains(`${Q}-${$9.ITEM}`)){if(K.preventDefault(),_.dataset.id)_.click()}return}let z=Array.from($.element.querySelectorAll(`.${Q}-${$9.ITEM}:not([disabled]):not([aria-disabled="true"]),
|
|
23
|
+
.mtrl-nav-item:not([disabled]):not([aria-disabled="true"])`));if(z.length===0)return;let Y=document.activeElement,U=z.indexOf(Y),X=-1;if(G&&(K.key==="ArrowDown"||K.key==="ArrowRight")||W&&K.key==="ArrowRight")X=U<0?0:(U+1)%z.length;else if(G&&(K.key==="ArrowUp"||K.key==="ArrowLeft")||W&&K.key==="ArrowLeft")X=U<0?z.length-1:(U-1+z.length)%z.length;else if(K.key==="Home")X=0;else if(K.key==="End")X=z.length-1;if(X>=0)K.preventDefault(),z[X].focus()}),j};t();var Aj={variant:B9.VARIANT,position:B9.POSITION,behavior:B9.BEHAVIOR,items:[],showLabels:B9.SHOW_LABELS,scrimEnabled:B9.SCRIM_ENABLED},J2=(J={})=>d(Aj,J,"nav"),Q2=(J)=>{let $=J.variant?`${J.prefix}-${n.VARIANT_PREFIX}${J.variant}`:"",Q=J.position?`${J.prefix}-${n.POSITION_PREFIX}${J.position}`:"",Z=J.class||"",q=[$,Q,Z].filter(Boolean);return p(J,{tag:"nav",attributes:{role:"navigation","aria-label":J.ariaLabel||"Main Navigation"},className:q})},Z2=(J)=>({disabled:{enable:J.disabled?.enable||(()=>{}),disable:J.disabled?.disable||(()=>{})},lifecycle:{destroy:J.lifecycle?.destroy||(()=>{})}});var wj=(J,$)=>{let{element:Q}=J,Z=$.variant||"rail",q=$.prefix||"mtrl";if(Q.setAttribute("aria-label",$.ariaLabel||"Main Navigation"),Z==="bar")if(!$.items?.some((K)=>K.items?.length))Q.setAttribute("role","tablist"),Q.setAttribute("aria-orientation","horizontal");else Q.setAttribute("role","menubar"),Q.setAttribute("aria-orientation","horizontal");else Q.setAttribute("role","navigation");if((Z==="modal"||Z==="drawer"&&$.behavior==="dismissible")&&!$.expanded)Q.classList.add(`${q}-nav--hidden`)},xj=(J={})=>{let $=J2(J);try{let Z=b(S,g(),E(Q2($)),K6($),P7($),eZ($),$2($),G6($),C(),(q)=>nZ(Z2(q))(q))($);if(wj(Z,$),$.disabled)Z.disable();if(Z.element.dataset.componentType="navigation",$.variant)Z.element.dataset.variant=$.variant;return Z}catch(Q){throw new Error(`Failed to create navigation: ${Q instanceof Error?Q.message:String(Q)}`)}},W7=xj;t6();J6();c();o();var q2=(J)=>($)=>{let Q=[],Z=$.getClass("radios"),q=J.value||"";if($.element.classList.add(`${Z}--${J.direction||"vertical"}`),J.disabled)$.element.classList.add(`${Z}--disabled`);let j=(W)=>{let z=document.createElement("div");z.classList.add(`${Z}-item`);let Y=document.createElement("input");if(Y.type="radio",Y.name=J.name,Y.value=W.value,Y.classList.add(`${Z}-input`),q===W.value)Y.checked=!0;if(J.disabled||W.disabled)Y.disabled=!0,z.classList.add(`${Z}-item--disabled`);let U=document.createElement("label");U.classList.add(`${Z}-label`);let X=document.createElement("span");X.classList.add(`${Z}-control`);let _=document.createElement("span");if(_.classList.add(`${Z}-circle`),J.ripple!==!1){let M=document.createElement("span");M.classList.add(`${Z}-ripple`),X.appendChild(M)}X.appendChild(_);let H=document.createElement("span");if(H.classList.add(`${Z}-text`),H.textContent=W.label,W.labelBefore)U.classList.add(`${Z}-label--before`),U.appendChild(H),U.appendChild(X);else U.appendChild(X),U.appendChild(H);let B=`${Z}-${W.value}-${Math.random().toString(36).substring(2,9)}`;Y.id=B,U.htmlFor=B,z.appendChild(Y),z.appendChild(U);let k=(M)=>{if(Y.checked){if(q=W.value,Q.forEach((V)=>{if(V.input!==Y)V.input.checked=!1}),$.events&&typeof $.events.emit==="function")$.events.emit("change",{value:W.value,originalEvent:M,option:W});else if(typeof $.on==="function"){let V=new CustomEvent("change",{detail:{value:W.value,originalEvent:M,option:W}});$.element.dispatchEvent(V)}}};return Y.addEventListener("change",k),{element:z,input:Y,label:U,config:W,destroy:()=>{if(Y.removeEventListener("change",k),z.parentNode)z.parentNode.removeChild(z)}}},K=(W)=>{let z=j(W);return $.element.appendChild(z.element),Q.push(z),$},G=(W)=>{let z=Q.findIndex((Y)=>Y.config.value===W);if(z!==-1){if(Q[z].destroy(),Q.splice(z,1),q===W)q=""}return $};if(J.options&&Array.isArray(J.options))J.options.forEach((W)=>K(W));if(!$.events)$.events={on:(W,z)=>{$.element.addEventListener(W,(Y)=>z(Y.detail))},off:(W,z)=>{$.element.removeEventListener(W,z)},emit:(W,z)=>{let Y=new CustomEvent(W,{detail:z});$.element.dispatchEvent(Y)}};return{...$,radios:Q,getValue:()=>q,setValue:(W)=>{return q=W,Q.forEach((z)=>{z.input.checked=z.config.value===W}),$},getSelected:()=>{let W=Q.find((z)=>z.config.value===q);return W?W.config:null},addOption:K,removeOption:G,enable:()=>{return $.element.classList.remove(`${Z}--disabled`),Q.forEach((W)=>{if(W.input.disabled=W.config.disabled||!1,!W.config.disabled)W.element.classList.remove(`${Z}-item--disabled`)}),$},disable:()=>{return $.element.classList.add(`${Z}--disabled`),Q.forEach((W)=>{W.input.disabled=!0,W.element.classList.add(`${Z}-item--disabled`)}),$},enableOption:(W)=>{let z=Q.find((Y)=>Y.config.value===W);if(z){if(z.config.disabled=!1,z.input.disabled=$.element.classList.contains(`${Z}--disabled`),!z.input.disabled)z.element.classList.remove(`${Z}-item--disabled`)}return $},disableOption:(W)=>{let z=Q.find((Y)=>Y.config.value===W);if(z)z.config.disabled=!0,z.input.disabled=!0,z.element.classList.add(`${Z}-item--disabled`);return $}}};var j2=({disabled:J,lifecycle:$})=>(Q)=>{if(!Q.events)Q.events={on:(q,j)=>{Q.element.addEventListener(q,(K)=>j(K.detail))},off:(q,j)=>{Q.element.removeEventListener(q,j)},emit:(q,j)=>{let K=new CustomEvent(q,{detail:j});Q.element.dispatchEvent(K)}};else if(!Q.events.emit)Q.events.emit=(q,j)=>{let K=new CustomEvent(q,{detail:j});Q.element.dispatchEvent(K)};return{element:Q.element,radios:Q.radios,lifecycle:{destroy:$.destroy},getClass:Q.getClass,getValue:()=>Q.getValue(),setValue(q){return Q.setValue(q),this},getSelected:()=>Q.getSelected(),addOption(q){return Q.addOption(q),this},removeOption(q){return Q.removeOption(q),this},enable(){return J.enable(),this},disable(){return J.disable(),this},enableOption(q){return Q.enableOption(q),this},disableOption(q){return Q.disableOption(q),this},on(q,j){return Q.events.on(q,j),this},off(q,j){return Q.events.off(q,j),this},destroy(){Q.radios.forEach((q)=>q.destroy()),$.destroy()}}};t();var yj={name:"",direction:"vertical",disabled:!1,ripple:!0,options:[]},K2=(J)=>d(yj,J,"radios"),G2=(J)=>{return p(J,{tag:"div",attributes:{role:"radiogroup"},className:J.class})},z2=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var Tj=(J)=>{if(!J.name)J.name=`radios-${Math.random().toString(36).substring(2,9)}`;let $=K2(J);try{return b(S,g(),E(G2($)),q2($),G6($),C(),(Z)=>j2(z2(Z))(Z))($)}catch(Q){throw console.error("Radios creation error:",Q),new Error(`Failed to create radios component: ${Q.message}`)}},OJ=Tj;var PJ={CHECKED:"checked",UNCHECKED:"unchecked",DISABLED:"disabled",FOCUSED:"focused"},Z8={VERTICAL:"vertical",HORIZONTAL:"horizontal"},q8={STANDARD:"standard",FILLED:"filled",OUTLINED:"outlined"},j8={RIGHT:"right",LEFT:"left"},K8={SMALL:"small",MEDIUM:"medium",LARGE:"large"},RJ={CHANGE:"change",FOCUS:"focus",BLUR:"blur"},AJ={VARIANT:q8.STANDARD,DIRECTION:Z8.VERTICAL,LABEL_POSITION:j8.RIGHT,SIZE:K8.MEDIUM},wJ={GROUP:"radio-group",RADIO:"radio",INPUT:"radio__input",LABEL:"radio__label",CONTROL:"radio__control",DOT:"radio__dot",FOCUS_RING:"radio__focus-ring",RIPPLE:"radio__ripple",CHECKED:"radio--checked",DISABLED:"radio--disabled",FOCUSED:"radio--focused",LABEL_RIGHT:"radio--label-right",LABEL_LEFT:"radio--label-left",SMALL:"radio--small",MEDIUM:"radio--medium",LARGE:"radio--large"};c();o();A6();var xJ=(J)=>($)=>{let Q=J.disabled===!0,q=(J.variant||"bar")==="view",j=J.placeholder||"Search",K=J.value||"",G=(F)=>$.getClass(F),W={type:"text",placeholder:j,value:K,"aria-label":j};if(Q)W.disabled="disabled";let z=v({tag:"div",className:G("search-container"),container:$.element,attributes:{style:`
|
|
24
24
|
${J.minWidth?`min-width: ${J.minWidth}px;`:""}
|
|
25
25
|
${J.maxWidth?`max-width: ${J.maxWidth}px;`:""}
|
|
26
26
|
${J.fullWidth?"width: 100%;":""}
|
|
27
|
-
`}}),Y=v({tag:"div",className:K("search-leading-icon"),container:W,html:J.leadingIcon||"",attributes:{role:"button",tabindex:Q?"-1":"0","aria-label":"Search"}}),U=v({tag:"div",className:K("search-input-wrapper"),container:W}),X=v({tag:"input",className:K("search-input"),container:U,attributes:z}),_=v({tag:"div",className:[K("search-clear-button"),G?"":K("search-clear-button--hidden")],container:W,html:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',attributes:{role:"button",tabindex:Q||!G?"-1":"0","aria-label":"Clear search"}}),H,B,M;if(J.trailingIcon)H=v({tag:"div",className:K("search-trailing-icon"),container:W,html:J.trailingIcon,attributes:{role:"button",tabindex:Q?"-1":"0","aria-label":"Search option"}});if(J.trailingIcon2)B=v({tag:"div",className:K("search-trailing-icon"),container:W,html:J.trailingIcon2,attributes:{role:"button",tabindex:Q?"-1":"0","aria-label":"Search option"}});if(J.avatar)M=v({tag:"div",className:K("search-avatar"),container:W,html:J.avatar});let k,N;if(q||J.suggestions)k=v({tag:"div",className:K("search-divider")}),N=v({tag:"div",className:K("search-suggestions-container"),container:$.element});return $.element.classList.add($.getClass("search")),$.element.setAttribute("role","search"),$.element.setAttribute("aria-disabled",Q?"true":"false"),Ij($,J,q,Q),{...$,structure:{container:W,input:X,inputWrapper:U,leadingIcon:Y,clearButton:_,trailingIcon:H,trailingIcon2:B,avatar:M,divider:k,suggestionsContainer:N}}};function Ij(J,$,Q,Z){let q=J.getClass("search");if(J.element.classList.add(`${q}--${$.variant||"bar"}`),Z)J.element.classList.add(`${q}--disabled`);if(Q)J.element.classList.add(`${q}--expanded`);if($.fullWidth)J.element.classList.add(`${q}--fullwidth`)}var G8={BAR:"bar",VIEW:"view"},yJ=(J)=>($)=>{if(J.disabled===!0)setTimeout(()=>{Z()},0);function Z(){if($.element.classList.add(`${$.getClass("search")}--disabled`),$.element.setAttribute("aria-disabled","true"),$.structure?.input)$.structure.input.disabled=!0;[$.structure?.leadingIcon,$.structure?.clearButton,$.structure?.trailingIcon,$.structure?.trailingIcon2].filter(Boolean).forEach((K)=>{K.tabIndex=-1,K.setAttribute("aria-disabled","true")})}function q(){if($.element.classList.remove(`${$.getClass("search")}--disabled`),$.element.setAttribute("aria-disabled","false"),$.structure?.input)$.structure.input.disabled=!1;if([$.structure?.leadingIcon,$.structure?.clearButton,$.structure?.trailingIcon,$.structure?.trailingIcon2].filter(Boolean).forEach((K)=>{K.tabIndex=0,K.setAttribute("aria-disabled","false")}),$.structure?.clearButton&&$.structure.input&&!$.structure.input.value)$.structure.clearButton.tabIndex=-1}function j(){return Object.values(G8).find((G)=>$.element.classList.contains(`${$.getClass("search")}--${G}`))||G8.BAR}return{...$,disabled:{enable(){return q(),this},disable(){return Z(),this},isDisabled(){return $.element.classList.contains(`${$.getClass("search")}--disabled`)}},appearance:{setVariant(G){if(j()===G)return this;if(Object.values(G8).forEach((z)=>{$.element.classList.remove(`${$.getClass("search")}--${z}`)}),$.element.classList.add(`${$.getClass("search")}--${G}`),G===G8.VIEW)$.element.classList.add(`${$.getClass("search")}--expanded`);else $.element.classList.remove(`${$.getClass("search")}--expanded`);return this},getVariant(){return j()}}}};var TJ=(J)=>($)=>{if(!$.emit)console.warn("Search component requires event emission capability");if(!$.structure)return console.error("Search component missing structure"),$;let{input:Q,leadingIcon:Z,clearButton:q,trailingIcon:j,trailingIcon2:G,avatar:K,divider:z,suggestionsContainer:W}=$.structure,Y={value:J.value||"",placeholder:J.placeholder||"Search",suggestions:J.suggestions||[],isFocused:!1,isExpanded:J.variant==="view",component:$},U={triggerEvent(L,D=null){let R={search:Y.component,value:Y.value,originalEvent:D,preventDefault:()=>{R.defaultPrevented=!0},defaultPrevented:!1};if($.emit)$.emit(L,R);let w=`on${L.charAt(0).toUpperCase()+L.slice(1)}`;if(J[w]&&typeof J[w]==="function")J[w](Y.value);return R}},X=(L,D=!0)=>{if(Y.value=L,Q)Q.value=L;if(q)if(L){if(q.classList.remove(`${$.getClass("search-clear-button")}--hidden`),!$.disabled?.isDisabled())q.tabIndex=0}else q.classList.add(`${$.getClass("search-clear-button")}--hidden`),q.tabIndex=-1;if(D)U.triggerEvent("input")},_=()=>{if(Y.value){if(U.triggerEvent("submit"),!Y.isExpanded)M()}},H=(L=!0)=>{if(X("",L),Q)Q.focus();if(L)U.triggerEvent("clear")},B=()=>{if(W)F()},M=()=>{if(W)W.classList.remove(`${$.getClass("search-suggestions-container")}--visible`)},k=()=>{if(Y.isExpanded)return;if(Y.isExpanded=!0,$.element.classList.add(`${$.getClass("search")}--expanded`),!$.element.classList.contains(`${$.getClass("search")}--view`))$.element.classList.remove(`${$.getClass("search")}--bar`),$.element.classList.add(`${$.getClass("search")}--view`);if(B(),Q)setTimeout(()=>{Q.focus()},50)},N=()=>{if(!Y.isExpanded)return;if(Y.isExpanded=!1,$.element.classList.remove(`${$.getClass("search")}--expanded`),!$.element.classList.contains(`${$.getClass("search")}--bar`))$.element.classList.remove(`${$.getClass("search")}--view`),$.element.classList.add(`${$.getClass("search")}--bar`);if(M(),Q)Q.blur()},F=()=>{if(!W||!Y.suggestions||!Y.suggestions.length)return;W.innerHTML="";let L=document.createElement("ul");if(L.className=$.getClass("search-suggestions-list"),L.setAttribute("role","listbox"),Y.suggestions.forEach((D)=>{let R=document.createElement("li");if(R.className=$.getClass("search-suggestion-item"),R.setAttribute("role","option"),R.tabIndex=0,typeof D==="string"){if(R.textContent=D,Y.value&&D.toLowerCase().includes(Y.value.toLowerCase())){let w=D.toLowerCase().indexOf(Y.value.toLowerCase()),A=D.slice(0,w),x=D.slice(w,w+Y.value.length),I=D.slice(w+Y.value.length);R.innerHTML=`${A}<strong>${x}</strong>${I}`}}else{if(D.icon){let A=document.createElement("span");A.className=$.getClass("search-suggestion-icon"),A.innerHTML=D.icon,R.appendChild(A)}let w=document.createElement("span");if(w.className=$.getClass("search-suggestion-text"),w.textContent=D.text,Y.value&&D.text.toLowerCase().includes(Y.value.toLowerCase())){let A=D.text.toLowerCase().indexOf(Y.value.toLowerCase()),x=D.text.slice(0,A),I=D.text.slice(A,A+Y.value.length),r=D.text.slice(A+Y.value.length);w.innerHTML=`${x}<strong>${I}</strong>${r}`}if(R.appendChild(w),D.value)R.dataset.value=D.value}R.addEventListener("click",(w)=>{w.preventDefault(),w.stopPropagation();let A=R.dataset.value||(typeof D==="string"?D:D.text);X(A),_()}),L.appendChild(R)}),J.showDividers&&z&&z.parentElement!==W){let D=z.cloneNode(!0);W.appendChild(D)}W.appendChild(L),W.classList.add(`${$.getClass("search-suggestions-container")}--visible`)},V=()=>{if(Q)Q.addEventListener("input",(L)=>{if(X(L.target.value),Y.isExpanded)B()}),Q.addEventListener("focus",(L)=>{if(Y.isFocused=!0,$.element.classList.add(`${$.getClass("search")}--focused`),!Y.isExpanded&&J.variant==="bar")k();U.triggerEvent("focus",L)}),Q.addEventListener("blur",(L)=>{if($.element.contains(L.relatedTarget))return;Y.isFocused=!1,$.element.classList.remove(`${$.getClass("search")}--focused`),setTimeout(()=>{if(!Y.isFocused){if(M(),Y.isExpanded&&J.variant==="bar")N()}},200),U.triggerEvent("blur",L)}),Q.addEventListener("keydown",(L)=>{if(L.key==="Enter")L.preventDefault(),_();else if(L.key==="Escape"){if(L.preventDefault(),Y.value)H();else if(Y.isExpanded&&J.variant==="bar")N()}});if(Z)Z.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;if(Y.isExpanded)N();else k();U.triggerEvent("iconClick",L)}),Z.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),Z.click()});if(q)q.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;H()}),q.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),q.click()});if(j)j.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;U.triggerEvent("iconClick",L)}),j.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),j.click()});if(G)G.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;U.triggerEvent("iconClick",L)}),G.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),G.click()});document.addEventListener("click",(L)=>{if(!$.element.contains(L.target)&&Y.isExpanded){if(M(),Y.isExpanded&&J.variant==="bar")N()}})},O=()=>{if(!$.element)return;document.removeEventListener("click",(L)=>{if(!$.element.contains(L.target)&&Y.isExpanded){if(M(),Y.isExpanded&&J.variant==="bar")N()}})},P=()=>{if(J.value&&Q){if(Q.value=J.value,q&&J.showClearButton!==!1)q.classList.remove(`${$.getClass("search-clear-button")}--hidden`)}if(Q)Q.setAttribute("role","searchbox"),Q.setAttribute("aria-label",Y.placeholder||"Search");if(V(),Y.isExpanded&&J.suggestions&&J.suggestions.length>0)B()};if($.lifecycle){let L=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{O(),L()}}return P(),{...$,search:{setValue(L,D=!0){return X(L,D),this},getValue(){return Y.value},setPlaceholder(L){if(Y.placeholder=L,Q)Q.placeholder=L,Q.setAttribute("aria-label",L);return this},getPlaceholder(){return Y.placeholder},focus(){if(Q&&!$.disabled?.isDisabled())Q.focus();return this},blur(){if(Q)Q.blur();return this},expand(){return k(),this},collapse(){return N(),this},clear(){return H(),this},submit(){return _(),this},setSuggestions(L){if(Y.suggestions=L,Y.isExpanded)F();return this},showSuggestions(L){if(L)B();else M();return this}},icons:{setLeadingIcon(L){if(Z)Z.innerHTML=L||"";return this},setTrailingIcon(L){if(j)j.innerHTML=L||"";return this},setTrailingIcon2(L){if(G)G.innerHTML=L||"";return this},setAvatar(L){if(K)K.innerHTML=L||"";return this},showClearButton(L){if(q)if(L)q.classList.remove(`${$.getClass("search-clear-button")}--hidden`);else q.classList.add(`${$.getClass("search-clear-button")}--hidden`);return this}}}};var W2=(J)=>($)=>{return{element:$.element,setValue(Z,q=!0){return J.search.setValue(Z,q),this},getValue(){return J.search.getValue()},setPlaceholder(Z){return J.search.setPlaceholder(Z),this},getPlaceholder(){return J.search.getPlaceholder()},setLeadingIcon(Z){return J.icons.setLeadingIcon(Z),this},setTrailingIcon(Z){return J.icons.setTrailingIcon(Z),this},setTrailingIcon2(Z){return J.icons.setTrailingIcon2(Z),this},setAvatar(Z){return J.icons.setAvatar(Z),this},showClearButton(Z){return J.icons.showClearButton(Z),this},setSuggestions(Z){return J.search.setSuggestions(Z),this},showSuggestions(Z){return J.search.showSuggestions(Z),this},focus(){return J.search.focus(),this},blur(){return J.search.blur(),this},expand(){return J.search.expand(),this},collapse(){return J.search.collapse(),this},clear(){return J.search.clear(),this},submit(){return J.search.submit(),this},enable(){return J.disabled.enable(),this},disable(){return J.disabled.disable(),this},isDisabled(){return J.disabled.isDisabled()},on(Z,q){return J.events.on(Z,q),this},off(Z,q){return J.events.off(Z,q),this},destroy(){if(J.lifecycle?.destroy)J.lifecycle.destroy()}}};t();var Y7={STANDARD:"standard",BAR:"bar",RAIL:"rail",DRAWER:"drawer",MODAL:"modal"},IJ={FOCUSED:"focused",EXPANDED:"expanded",COLLAPSED:"collapsed",POPULATED:"populated",DISABLED:"disabled",SUGGESTING:"suggesting"},SJ={FOCUS:"focus",BLUR:"blur",INPUT:"input",SUBMIT:"submit",CLEAR:"clear",ICON_CLICK:"iconClick"},U7={SEARCH:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>',CLEAR:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',BACK:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>',SETTINGS:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>'},c6={VARIANT:Y7.STANDARD,PLACEHOLDER:"Search",VALUE:"",LEADING_ICON:U7.SEARCH,SHOW_CLEAR_BUTTON:!0,MAX_WIDTH:480,MIN_WIDTH:240,FULL_WIDTH:!1,SHOW_DIVIDERS:!0},bJ={CONTAINER:"search",VARIANT_PREFIX:"search--",INPUT:"search__input",LEADING_ICON:"search__leading-icon",TRAILING_ICON:"search__trailing-icon",TRAILING_ICON2:"search__trailing-icon2",AVATAR:"search__avatar",CLEAR_BUTTON:"search__clear-button",SUGGESTIONS:"search__suggestions",SUGGESTION_ITEM:"search__suggestion-item",SUGGESTION_DIVIDER:"search__suggestion-divider",SUGGESTION_ICON:"search__suggestion-icon",SUGGESTION_TEXT:"search__suggestion-text",FOCUSED:"search--focused",EXPANDED:"search--expanded",POPULATED:"search--populated",DISABLED:"search--disabled",FULL_WIDTH:"search--full-width",SUGGESTING:"search--suggesting"};var Sj={variant:Y7.BAR,disabled:!1,placeholder:c6.PLACEHOLDER,value:c6.VALUE,leadingIcon:U7.SEARCH,showClearButton:c6.SHOW_CLEAR_BUTTON,minWidth:c6.MIN_WIDTH,maxWidth:c6.MAX_WIDTH,fullWidth:c6.FULL_WIDTH,showDividers:c6.SHOW_DIVIDERS},Y2=(J={})=>d(Sj,J,"search"),U2=(J)=>p(J,{tag:"div",attributes:{role:"search","aria-disabled":J.disabled===!0?"true":"false"},className:J.class}),X2=(J)=>({search:{setValue:($,Q)=>J.search?.setValue($,Q),getValue:()=>J.search?.getValue()??"",setPlaceholder:($)=>J.search?.setPlaceholder($),getPlaceholder:()=>J.search?.getPlaceholder()??"",focus:()=>J.search?.focus(),blur:()=>J.search?.blur(),expand:()=>J.search?.expand(),collapse:()=>J.search?.collapse(),clear:()=>J.search?.clear(),submit:()=>J.search?.submit(),setSuggestions:($)=>J.search?.setSuggestions($),showSuggestions:($)=>J.search?.showSuggestions($)},disabled:{enable:()=>J.disabled?.enable?.(),disable:()=>J.disabled?.disable?.(),isDisabled:()=>J.disabled?.isDisabled?.()??!1},appearance:{setColor:($)=>J.appearance?.setColor?.($),getColor:()=>J.appearance?.getColor?.()??"",setSize:($)=>J.appearance?.setSize?.($),getSize:()=>J.appearance?.getSize?.()??""},icons:{setLeadingIcon:($)=>J.icons?.setLeadingIcon?.($),setTrailingIcon:($)=>J.icons?.setTrailingIcon?.($),setTrailingIcon2:($)=>J.icons?.setTrailingIcon2?.($),setAvatar:($)=>J.icons?.setAvatar?.($),showClearButton:($)=>J.icons?.showClearButton?.($)},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var bj=(J={})=>{let $=Y2(J);try{let Q=b(S,g(),E(U2($)),xJ($),yJ($),TJ($),C())($),Z=X2(Q),q=W2(Z)(Q);if($.on&&typeof q.on==="function")Object.entries($.on).forEach(([j,G])=>{if(typeof G==="function")q.on(j,G)});return q}catch(Q){throw console.error("Search creation error:",Q),new Error(`Failed to create search: ${Q.message}`)}},vJ=bj;c();o();var q$;((Q)=>{Q.SINGLE="single";Q.MULTI="multi"})(q$||={});var j$;((Z)=>{Z.DEFAULT="default";Z.COMFORTABLE="comfortable";Z.COMPACT="compact"})(j$||={});t();var z8={SINGLE:"single",MULTI:"multi"},W8={DEFAULT:"default",COMFORTABLE:"comfortable",COMPACT:"compact"},CJ={CHANGE:"change"},m9={MODE:z8.SINGLE,DENSITY:W8.DEFAULT,RIPPLE:!0,RIPPLE_DURATION:300,RIPPLE_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",RIPPLE_OPACITY:["0.2","0"]},B2=`
|
|
27
|
+
`}}),Y=v({tag:"div",className:G("search-leading-icon"),container:z,html:J.leadingIcon||"",attributes:{role:"button",tabindex:Q?"-1":"0","aria-label":"Search"}}),U=v({tag:"div",className:G("search-input-wrapper"),container:z}),X=v({tag:"input",className:G("search-input"),container:U,attributes:W}),_=v({tag:"div",className:[G("search-clear-button"),K?"":G("search-clear-button--hidden")],container:z,html:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',attributes:{role:"button",tabindex:Q||!K?"-1":"0","aria-label":"Clear search"}}),H,B,k;if(J.trailingIcon)H=v({tag:"div",className:G("search-trailing-icon"),container:z,html:J.trailingIcon,attributes:{role:"button",tabindex:Q?"-1":"0","aria-label":"Search option"}});if(J.trailingIcon2)B=v({tag:"div",className:G("search-trailing-icon"),container:z,html:J.trailingIcon2,attributes:{role:"button",tabindex:Q?"-1":"0","aria-label":"Search option"}});if(J.avatar)k=v({tag:"div",className:G("search-avatar"),container:z,html:J.avatar});let M,V;if(q||J.suggestions)M=v({tag:"div",className:G("search-divider")}),V=v({tag:"div",className:G("search-suggestions-container"),container:$.element});return $.element.classList.add($.getClass("search")),$.element.setAttribute("role","search"),$.element.setAttribute("aria-disabled",Q?"true":"false"),Ij($,J,q,Q),{...$,structure:{container:z,input:X,inputWrapper:U,leadingIcon:Y,clearButton:_,trailingIcon:H,trailingIcon2:B,avatar:k,divider:M,suggestionsContainer:V}}};function Ij(J,$,Q,Z){let q=J.getClass("search");if(J.element.classList.add(`${q}--${$.variant||"bar"}`),Z)J.element.classList.add(`${q}--disabled`);if(Q)J.element.classList.add(`${q}--expanded`);if($.fullWidth)J.element.classList.add(`${q}--fullwidth`)}var G8={BAR:"bar",VIEW:"view"},yJ=(J)=>($)=>{if(J.disabled===!0)setTimeout(()=>{Z()},0);function Z(){if($.element.classList.add(`${$.getClass("search")}--disabled`),$.element.setAttribute("aria-disabled","true"),$.structure?.input)$.structure.input.disabled=!0;[$.structure?.leadingIcon,$.structure?.clearButton,$.structure?.trailingIcon,$.structure?.trailingIcon2].filter(Boolean).forEach((G)=>{G.tabIndex=-1,G.setAttribute("aria-disabled","true")})}function q(){if($.element.classList.remove(`${$.getClass("search")}--disabled`),$.element.setAttribute("aria-disabled","false"),$.structure?.input)$.structure.input.disabled=!1;if([$.structure?.leadingIcon,$.structure?.clearButton,$.structure?.trailingIcon,$.structure?.trailingIcon2].filter(Boolean).forEach((G)=>{G.tabIndex=0,G.setAttribute("aria-disabled","false")}),$.structure?.clearButton&&$.structure.input&&!$.structure.input.value)$.structure.clearButton.tabIndex=-1}function j(){return Object.values(G8).find((K)=>$.element.classList.contains(`${$.getClass("search")}--${K}`))||G8.BAR}return{...$,disabled:{enable(){return q(),this},disable(){return Z(),this},isDisabled(){return $.element.classList.contains(`${$.getClass("search")}--disabled`)}},appearance:{setVariant(K){if(j()===K)return this;if(Object.values(G8).forEach((W)=>{$.element.classList.remove(`${$.getClass("search")}--${W}`)}),$.element.classList.add(`${$.getClass("search")}--${K}`),K===G8.VIEW)$.element.classList.add(`${$.getClass("search")}--expanded`);else $.element.classList.remove(`${$.getClass("search")}--expanded`);return this},getVariant(){return j()}}}};var TJ=(J)=>($)=>{if(!$.emit)console.warn("Search component requires event emission capability");if(!$.structure)return console.error("Search component missing structure"),$;let{input:Q,leadingIcon:Z,clearButton:q,trailingIcon:j,trailingIcon2:K,avatar:G,divider:W,suggestionsContainer:z}=$.structure,Y={value:J.value||"",placeholder:J.placeholder||"Search",suggestions:J.suggestions||[],isFocused:!1,isExpanded:J.variant==="view",component:$},U={triggerEvent(L,D=null){let R={search:Y.component,value:Y.value,originalEvent:D,preventDefault:()=>{R.defaultPrevented=!0},defaultPrevented:!1};if($.emit)$.emit(L,R);let w=`on${L.charAt(0).toUpperCase()+L.slice(1)}`;if(J[w]&&typeof J[w]==="function")J[w](Y.value);return R}},X=(L,D=!0)=>{if(Y.value=L,Q)Q.value=L;if(q)if(L){if(q.classList.remove(`${$.getClass("search-clear-button")}--hidden`),!$.disabled?.isDisabled())q.tabIndex=0}else q.classList.add(`${$.getClass("search-clear-button")}--hidden`),q.tabIndex=-1;if(D)U.triggerEvent("input")},_=()=>{if(Y.value){if(U.triggerEvent("submit"),!Y.isExpanded)k()}},H=(L=!0)=>{if(X("",L),Q)Q.focus();if(L)U.triggerEvent("clear")},B=()=>{if(z)F()},k=()=>{if(z)z.classList.remove(`${$.getClass("search-suggestions-container")}--visible`)},M=()=>{if(Y.isExpanded)return;if(Y.isExpanded=!0,$.element.classList.add(`${$.getClass("search")}--expanded`),!$.element.classList.contains(`${$.getClass("search")}--view`))$.element.classList.remove(`${$.getClass("search")}--bar`),$.element.classList.add(`${$.getClass("search")}--view`);if(B(),Q)setTimeout(()=>{Q.focus()},50)},V=()=>{if(!Y.isExpanded)return;if(Y.isExpanded=!1,$.element.classList.remove(`${$.getClass("search")}--expanded`),!$.element.classList.contains(`${$.getClass("search")}--bar`))$.element.classList.remove(`${$.getClass("search")}--view`),$.element.classList.add(`${$.getClass("search")}--bar`);if(k(),Q)Q.blur()},F=()=>{if(!z||!Y.suggestions||!Y.suggestions.length)return;z.innerHTML="";let L=document.createElement("ul");if(L.className=$.getClass("search-suggestions-list"),L.setAttribute("role","listbox"),Y.suggestions.forEach((D)=>{let R=document.createElement("li");if(R.className=$.getClass("search-suggestion-item"),R.setAttribute("role","option"),R.tabIndex=0,typeof D==="string"){if(R.textContent=D,Y.value&&D.toLowerCase().includes(Y.value.toLowerCase())){let w=D.toLowerCase().indexOf(Y.value.toLowerCase()),A=D.slice(0,w),x=D.slice(w,w+Y.value.length),I=D.slice(w+Y.value.length);R.innerHTML=`${A}<strong>${x}</strong>${I}`}}else{if(D.icon){let A=document.createElement("span");A.className=$.getClass("search-suggestion-icon"),A.innerHTML=D.icon,R.appendChild(A)}let w=document.createElement("span");if(w.className=$.getClass("search-suggestion-text"),w.textContent=D.text,Y.value&&D.text.toLowerCase().includes(Y.value.toLowerCase())){let A=D.text.toLowerCase().indexOf(Y.value.toLowerCase()),x=D.text.slice(0,A),I=D.text.slice(A,A+Y.value.length),r=D.text.slice(A+Y.value.length);w.innerHTML=`${x}<strong>${I}</strong>${r}`}if(R.appendChild(w),D.value)R.dataset.value=D.value}R.addEventListener("click",(w)=>{w.preventDefault(),w.stopPropagation();let A=R.dataset.value||(typeof D==="string"?D:D.text);X(A),_()}),L.appendChild(R)}),J.showDividers&&W&&W.parentElement!==z){let D=W.cloneNode(!0);z.appendChild(D)}z.appendChild(L),z.classList.add(`${$.getClass("search-suggestions-container")}--visible`)},N=()=>{if(Q)Q.addEventListener("input",(L)=>{if(X(L.target.value),Y.isExpanded)B()}),Q.addEventListener("focus",(L)=>{if(Y.isFocused=!0,$.element.classList.add(`${$.getClass("search")}--focused`),!Y.isExpanded&&J.variant==="bar")M();U.triggerEvent("focus",L)}),Q.addEventListener("blur",(L)=>{if($.element.contains(L.relatedTarget))return;Y.isFocused=!1,$.element.classList.remove(`${$.getClass("search")}--focused`),setTimeout(()=>{if(!Y.isFocused){if(k(),Y.isExpanded&&J.variant==="bar")V()}},200),U.triggerEvent("blur",L)}),Q.addEventListener("keydown",(L)=>{if(L.key==="Enter")L.preventDefault(),_();else if(L.key==="Escape"){if(L.preventDefault(),Y.value)H();else if(Y.isExpanded&&J.variant==="bar")V()}});if(Z)Z.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;if(Y.isExpanded)V();else M();U.triggerEvent("iconClick",L)}),Z.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),Z.click()});if(q)q.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;H()}),q.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),q.click()});if(j)j.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;U.triggerEvent("iconClick",L)}),j.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),j.click()});if(K)K.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;U.triggerEvent("iconClick",L)}),K.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),K.click()});document.addEventListener("click",(L)=>{if(!$.element.contains(L.target)&&Y.isExpanded){if(k(),Y.isExpanded&&J.variant==="bar")V()}})},O=()=>{if(!$.element)return;document.removeEventListener("click",(L)=>{if(!$.element.contains(L.target)&&Y.isExpanded){if(k(),Y.isExpanded&&J.variant==="bar")V()}})},P=()=>{if(J.value&&Q){if(Q.value=J.value,q&&J.showClearButton!==!1)q.classList.remove(`${$.getClass("search-clear-button")}--hidden`)}if(Q)Q.setAttribute("role","searchbox"),Q.setAttribute("aria-label",Y.placeholder||"Search");if(N(),Y.isExpanded&&J.suggestions&&J.suggestions.length>0)B()};if($.lifecycle){let L=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{O(),L()}}return P(),{...$,search:{setValue(L,D=!0){return X(L,D),this},getValue(){return Y.value},setPlaceholder(L){if(Y.placeholder=L,Q)Q.placeholder=L,Q.setAttribute("aria-label",L);return this},getPlaceholder(){return Y.placeholder},focus(){if(Q&&!$.disabled?.isDisabled())Q.focus();return this},blur(){if(Q)Q.blur();return this},expand(){return M(),this},collapse(){return V(),this},clear(){return H(),this},submit(){return _(),this},setSuggestions(L){if(Y.suggestions=L,Y.isExpanded)F();return this},showSuggestions(L){if(L)B();else k();return this}},icons:{setLeadingIcon(L){if(Z)Z.innerHTML=L||"";return this},setTrailingIcon(L){if(j)j.innerHTML=L||"";return this},setTrailingIcon2(L){if(K)K.innerHTML=L||"";return this},setAvatar(L){if(G)G.innerHTML=L||"";return this},showClearButton(L){if(q)if(L)q.classList.remove(`${$.getClass("search-clear-button")}--hidden`);else q.classList.add(`${$.getClass("search-clear-button")}--hidden`);return this}}}};var W2=(J)=>($)=>{return{element:$.element,setValue(Z,q=!0){return J.search.setValue(Z,q),this},getValue(){return J.search.getValue()},setPlaceholder(Z){return J.search.setPlaceholder(Z),this},getPlaceholder(){return J.search.getPlaceholder()},setLeadingIcon(Z){return J.icons.setLeadingIcon(Z),this},setTrailingIcon(Z){return J.icons.setTrailingIcon(Z),this},setTrailingIcon2(Z){return J.icons.setTrailingIcon2(Z),this},setAvatar(Z){return J.icons.setAvatar(Z),this},showClearButton(Z){return J.icons.showClearButton(Z),this},setSuggestions(Z){return J.search.setSuggestions(Z),this},showSuggestions(Z){return J.search.showSuggestions(Z),this},focus(){return J.search.focus(),this},blur(){return J.search.blur(),this},expand(){return J.search.expand(),this},collapse(){return J.search.collapse(),this},clear(){return J.search.clear(),this},submit(){return J.search.submit(),this},enable(){return J.disabled.enable(),this},disable(){return J.disabled.disable(),this},isDisabled(){return J.disabled.isDisabled()},on(Z,q){return J.events.on(Z,q),this},off(Z,q){return J.events.off(Z,q),this},destroy(){if(J.lifecycle?.destroy)J.lifecycle.destroy()}}};t();var Y7={STANDARD:"standard",BAR:"bar",RAIL:"rail",DRAWER:"drawer",MODAL:"modal"},IJ={FOCUSED:"focused",EXPANDED:"expanded",COLLAPSED:"collapsed",POPULATED:"populated",DISABLED:"disabled",SUGGESTING:"suggesting"},SJ={FOCUS:"focus",BLUR:"blur",INPUT:"input",SUBMIT:"submit",CLEAR:"clear",ICON_CLICK:"iconClick"},U7={SEARCH:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>',CLEAR:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',BACK:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>',SETTINGS:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>'},c6={VARIANT:Y7.STANDARD,PLACEHOLDER:"Search",VALUE:"",LEADING_ICON:U7.SEARCH,SHOW_CLEAR_BUTTON:!0,MAX_WIDTH:480,MIN_WIDTH:240,FULL_WIDTH:!1,SHOW_DIVIDERS:!0},bJ={CONTAINER:"search",VARIANT_PREFIX:"search--",INPUT:"search__input",LEADING_ICON:"search__leading-icon",TRAILING_ICON:"search__trailing-icon",TRAILING_ICON2:"search__trailing-icon2",AVATAR:"search__avatar",CLEAR_BUTTON:"search__clear-button",SUGGESTIONS:"search__suggestions",SUGGESTION_ITEM:"search__suggestion-item",SUGGESTION_DIVIDER:"search__suggestion-divider",SUGGESTION_ICON:"search__suggestion-icon",SUGGESTION_TEXT:"search__suggestion-text",FOCUSED:"search--focused",EXPANDED:"search--expanded",POPULATED:"search--populated",DISABLED:"search--disabled",FULL_WIDTH:"search--full-width",SUGGESTING:"search--suggesting"};var Sj={variant:Y7.BAR,disabled:!1,placeholder:c6.PLACEHOLDER,value:c6.VALUE,leadingIcon:U7.SEARCH,showClearButton:c6.SHOW_CLEAR_BUTTON,minWidth:c6.MIN_WIDTH,maxWidth:c6.MAX_WIDTH,fullWidth:c6.FULL_WIDTH,showDividers:c6.SHOW_DIVIDERS},Y2=(J={})=>d(Sj,J,"search"),U2=(J)=>p(J,{tag:"div",attributes:{role:"search","aria-disabled":J.disabled===!0?"true":"false"},className:J.class}),X2=(J)=>({search:{setValue:($,Q)=>J.search?.setValue($,Q),getValue:()=>J.search?.getValue()??"",setPlaceholder:($)=>J.search?.setPlaceholder($),getPlaceholder:()=>J.search?.getPlaceholder()??"",focus:()=>J.search?.focus(),blur:()=>J.search?.blur(),expand:()=>J.search?.expand(),collapse:()=>J.search?.collapse(),clear:()=>J.search?.clear(),submit:()=>J.search?.submit(),setSuggestions:($)=>J.search?.setSuggestions($),showSuggestions:($)=>J.search?.showSuggestions($)},disabled:{enable:()=>J.disabled?.enable?.(),disable:()=>J.disabled?.disable?.(),isDisabled:()=>J.disabled?.isDisabled?.()??!1},appearance:{setColor:($)=>J.appearance?.setColor?.($),getColor:()=>J.appearance?.getColor?.()??"",setSize:($)=>J.appearance?.setSize?.($),getSize:()=>J.appearance?.getSize?.()??""},icons:{setLeadingIcon:($)=>J.icons?.setLeadingIcon?.($),setTrailingIcon:($)=>J.icons?.setTrailingIcon?.($),setTrailingIcon2:($)=>J.icons?.setTrailingIcon2?.($),setAvatar:($)=>J.icons?.setAvatar?.($),showClearButton:($)=>J.icons?.showClearButton?.($)},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var bj=(J={})=>{let $=Y2(J);try{let Q=b(S,g(),E(U2($)),xJ($),yJ($),TJ($),C())($),Z=X2(Q),q=W2(Z)(Q);if($.on&&typeof q.on==="function")Object.entries($.on).forEach(([j,K])=>{if(typeof K==="function")q.on(j,K)});return q}catch(Q){throw console.error("Search creation error:",Q),new Error(`Failed to create search: ${Q.message}`)}},vJ=bj;c();o();var q$;((Q)=>{Q.SINGLE="single";Q.MULTI="multi"})(q$||={});var j$;((Z)=>{Z.DEFAULT="default";Z.COMFORTABLE="comfortable";Z.COMPACT="compact"})(j$||={});t();var z8={SINGLE:"single",MULTI:"multi"},W8={DEFAULT:"default",COMFORTABLE:"comfortable",COMPACT:"compact"},CJ={CHANGE:"change"},m9={MODE:z8.SINGLE,DENSITY:W8.DEFAULT,RIPPLE:!0,RIPPLE_DURATION:300,RIPPLE_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",RIPPLE_OPACITY:["0.2","0"]},B2=`
|
|
28
28
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
29
29
|
<polyline points="20 6 9 17 4 12"></polyline>
|
|
30
|
-
</svg>`,EJ={CHECKMARK:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>'},hJ={CONTAINER:"segmented-button",SEGMENT:"segmented-button__segment",SELECTED:"segmented-button__segment--selected",DISABLED:"segmented-button__segment--disabled",HAS_ICON:"segmented-button__segment--has-icon",ICON:"segmented-button__icon",LABEL:"segmented-button__label",CHECKMARK:"segmented-button__checkmark",RIPPLE:"segmented-button__ripple",SINGLE_MODE:"segmented-button--single",MULTI_MODE:"segmented-button--multi",DEFAULT_DENSITY:"segmented-button--density-default",COMFORTABLE_DENSITY:"segmented-button--density-comfortable",COMPACT_DENSITY:"segmented-button--density-compact"};var vj={mode:m9.MODE,ripple:m9.RIPPLE,density:m9.DENSITY},F2=(J={})=>d(vj,J,"segmented-button"),H2=(J)=>{let $=J.density||"default";return{tag:"div",componentName:"segmented-button",attributes:{role:"group","aria-label":"Segmented button","data-mode":J.mode||"single","data-density":$},className:[J.class,J.disabled?`${J.prefix}-segmented-button--disabled`:null,$!=="default"?`${J.prefix}-segmented-button--${$}`:null],interactive:!0}},uJ=(J)=>{switch(J){case"compact":return{"--segment-padding":"4px 8px","--segment-height":"28px","--segment-font-size":"0.8125rem"};case"comfortable":return{"--segment-padding":"6px 12px","--segment-height":"32px","--segment-font-size":"0.875rem"};case"default":default:return{"--segment-padding":"8px 16px","--segment-height":"36px","--segment-font-size":"0.875rem"}}};l9();var Y8=(J,$,Q,Z=!1,q={ripple:!0,rippleConfig:{}})=>{let j=Z||J.disabled,G=J.icon,K=J.checkmarkIcon||B2,z=e6({text:J.text,icon:J.selected&&J.text&&G?K:G,value:J.value||J.text||"",disabled:j,ripple:q.ripple,rippleConfig:q.rippleConfig,class:J.class});if(z.element.classList.add(`${Q}-segmented-button-segment`),J.selected)z.element.classList.add(`${Q}-segment--selected`),z.element.setAttribute("aria-pressed","true");else z.element.setAttribute("aria-pressed","false");$.appendChild(z.element);let W=(U)=>{if(z.element.classList.toggle(`${Q}-segment--selected`,U),z.element.setAttribute("aria-pressed",U?"true":"false"),J.text&&G)if(U)z.setIcon(K);else z.setIcon(G)},Y=J.selected||!1;return{element:z.element,value:J.value||J.text||"",isSelected(){return Y},setSelected(U){Y=U,W(U)},isDisabled(){return z.disabled?.isDisabled?.()||!1},setDisabled(U){if(U)z.disable();else z.enable()},destroy(){z.destroy()}}};var Cj=(J={})=>{let $=F2(J),Q=$.mode||"single",Z=$.density||"default",q=C6();try{let j=b(S,g(),E(H2($)),C())($),G=uJ(Z);Object.entries(G).forEach(([H,B])=>{j.element.style.setProperty(H,B)});let K=[];if($.segments&&$.segments.length)$.segments.forEach((H)=>{let B=Y8(H,j.element,$.prefix,$.disabled,{ripple:$.ripple,rippleConfig:$.rippleConfig});K.push(B)});if(Q==="single"&&!K.some((H)=>H.isSelected())){let H=K.find((B)=>!B.isDisabled());if(H)H.setSelected(!0)}let z=(H)=>{let B=H.currentTarget,M=K.find((F)=>F.element===B);if(!M||M.isDisabled())return;let k=Y();if(Q==="single")K.forEach((F)=>{F.setSelected(F===M)});else M.setSelected(!M.isSelected());let N=Y();if(k.length!==N.length||k.some((F)=>!N.includes(F))||N.some((F)=>!k.includes(F)))q.emit("change",{selected:W(),value:N,oldValue:k})};K.forEach((H)=>{H.element.addEventListener("click",z)});let W=()=>K.filter((H)=>H.isSelected()),Y=()=>W().map((H)=>H.value),U=(H)=>K.find((B)=>B.value===H),X=(H)=>{if(["default","comfortable","compact"].forEach((M)=>{if(M!=="default")j.element.classList.remove(`${$.prefix}-segmented-button--${M}`)}),H!=="default")j.element.classList.add(`${$.prefix}-segmented-button--${H}`);j.element.setAttribute("data-density",H);let B=uJ(H);Object.entries(B).forEach(([M,k])=>{j.element.style.setProperty(M,k)})};return{element:j.element,segments:K,getSelected:W,getValue(){return Y()},select(H){let B=U(H);if(B&&!B.isDisabled()){let M=Y();if(Q==="single")K.forEach((N)=>N.setSelected(N===B));else B.setSelected(!0);let k=Y();if(M.join(",")!==k.join(","))q.emit("change",{selected:W(),value:k,oldValue:M})}return this},deselect(H){let B=U(H);if(B&&!B.isDisabled())if(Q==="single"){if(W().length>1||!B.isSelected()){let k=Y();B.setSelected(!1);let N=Y();if(k.join(",")!==N.join(","))q.emit("change",{selected:W(),value:N,oldValue:k})}}else{let M=Y();B.setSelected(!1);let k=Y();if(M.join(",")!==k.join(","))q.emit("change",{selected:W(),value:k,oldValue:M})}return this},enable(){return j.element.classList.remove(`${$.prefix}-segmented-button--disabled`),K.forEach((H)=>{if(!$.segments?.find((B)=>B.value===H.value)?.disabled)H.setDisabled(!1)}),this},disable(){return j.element.classList.add(`${$.prefix}-segmented-button--disabled`),K.forEach((H)=>{H.setDisabled(!0)}),this},enableSegment(H){let B=U(H);if(B)B.setDisabled(!1);return this},disableSegment(H){let B=U(H);if(B)B.setDisabled(!0);return this},setDensity(H){return X(H),this},getDensity(){return j.element.getAttribute("data-density")||"default"},on(H,B){return q.on(H,B),this},off(H,B){return q.off(H,B),this},destroy(){K.forEach((H)=>{H.element.removeEventListener("click",z),H.destroy()}),q.clear(),j.lifecycle.destroy()}}}catch(j){throw console.error("Segmented Button creation error:",j),new Error(`Failed to create segmented button: ${j.message}`)}},U8=Cj;J6();c();o();var f6={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"},X7={OPEN:"open",CLOSE:"close",DRAG_START:"dragstart",DRAG_END:"dragend"};var fJ=(J)=>($)=>{let{position:Q=f6.BOTTOM}=J,Z=`${$.getClass("sheet")}--${Q.toLowerCase()}`;return $.element.classList.add(Z),{...$,position:{setPosition(q){$.element.classList.remove(Z);let j=`${$.getClass("sheet")}--${q.toLowerCase()}`;$.element.classList.add(j)},getPosition(){return Q}}}};var gJ=(J)=>($)=>{let{content:Q=""}=J,Z=document.createElement("div");return Z.className=`${$.getClass("sheet")}-content`,Z.innerHTML=Q,$.container=document.createElement("div"),$.container.className=`${$.getClass("sheet")}-container`,$.container.appendChild(Z),$.element.appendChild($.container),{...$,content:{setContent(q){return Z.innerHTML=q,this},getContent(){return Z.innerHTML},getElement(){return Z}}}};var dJ=(J)=>($)=>{let{title:Q=""}=J,Z=null;if(Q||J.dragHandle){if(Z=document.createElement("div"),Z.className=`${$.getClass("sheet")}-title`,Q)Z.textContent=Q;if($.container.insertBefore(Z,$.container.firstChild),J.dragHandle){let q=document.createElement("div");q.className=`${$.getClass("sheet")}-handle`,$.container.insertBefore(q,$.container.firstChild),$.dragHandle={element:q,setVisible(j){q.style.display=j?"block":"none"}}}}return{...$,title:{setTitle(q){if(!Z&&q)Z=document.createElement("div"),Z.className=`${$.getClass("sheet")}-title`,$.container.insertBefore(Z,$.content.getElement());if(Z)Z.textContent=q;return this},getTitle(){return Z?Z.textContent||"":""},getElement(){return Z}}}};var lJ=(J)=>($)=>{let{open:Q=!1,dismissible:Z=!0}=J,q=Q,j=document.createElement("div");if(j.className=`${$.getClass("sheet")}-scrim`,$.element.parentNode?.insertBefore(j,$.element.nextSibling),Z)$.element.classList.add(`${$.getClass("sheet")}--dismissible`),j.addEventListener("click",()=>{if(Z)K()});if(Q)$.element.classList.add(`${$.getClass("sheet")}--open`);if(J.elevation)$.element.classList.add(`${$.getClass("sheet")}--elevation-${J.elevation}`);document.addEventListener("keydown",(z)=>{if(z.key==="Escape"&&q&&Z)K()});function G(){if(!q){if(q=!0,$.element.classList.add(`${$.getClass("sheet")}--open`),$.events.emit(X7.OPEN),J.onOpen)J.onOpen()}}function K(){if(q){if(q=!1,$.element.classList.remove(`${$.getClass("sheet")}--open`),$.events.emit(X7.CLOSE),J.onClose)J.onClose()}}return{...$,state:{open:G,close:K,isOpen(){return q},setDismissible(z){if(z)$.element.classList.add(`${$.getClass("sheet")}--dismissible`);else $.element.classList.remove(`${$.getClass("sheet")}--dismissible`)}},initialize(){if(j.parentNode!==$.element.parentNode)$.element.parentNode?.insertBefore(j,$.element.nextSibling)}}};var rJ=(J)=>($)=>{if(J.enableGestures===!1)return $;let Q=J.position||f6.BOTTOM,Z=0,q=0,j=!1,G=$.dragHandle?.element||$.element,K=(X)=>{if(!$.state.isOpen())return;if(j=!0,document.body.style.userSelect="none",X.type==="touchstart")Z=X.touches[0].clientY,q=X.touches[0].clientX;else Z=X.clientY,q=X.clientX,document.addEventListener("mousemove",z),document.addEventListener("mouseup",W);$.events.emit(X7.DRAG_START)},z=(X)=>{if(!j)return;let _,H;if(X.type==="touchmove")_=X.touches[0].clientY,H=X.touches[0].clientX;else _=X.clientY,H=X.clientX;let B=0;switch(Q){case f6.BOTTOM:if(B=_-Z,B<0)B=0;$.element.style.transform=`translateY(${B}px)`;break;case f6.TOP:if(B=Z-_,B<0)B=0;$.element.style.transform=`translateY(-${B}px)`;break;case f6.LEFT:if(B=q-H,B<0)B=0;$.element.style.transform=`translateX(-${B}px)`;break;case f6.RIGHT:if(B=H-q,B<0)B=0;$.element.style.transform=`translateX(${B}px)`;break}let M=Q===f6.BOTTOM||Q===f6.TOP?$.element.offsetHeight:$.element.offsetWidth,k=Math.min(B/M,1),N=$.element.nextElementSibling;if(N&&N.classList.contains(`${$.getClass("sheet")}-scrim`))N.style.opacity=`${0.32*(1-k)}`},W=()=>{if(!j)return;j=!1,document.body.style.userSelect="",document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",W);let X=Q===f6.BOTTOM||Q===f6.TOP?$.element.offsetHeight:$.element.offsetWidth,_=0;if($.element.style.transform){let H=$.element.style.transform.match(/translate[XY]\(([^p]+)px\)/);_=H?parseFloat(H[1]):0}if(_>X*0.3)$.state.close();else{$.element.style.transform="";let H=$.element.nextElementSibling;if(H&&H.classList.contains(`${$.getClass("sheet")}-scrim`))H.style.opacity=""}$.events.emit(X7.DRAG_END)};G.addEventListener("touchstart",K),G.addEventListener("touchmove",z),G.addEventListener("touchend",W),G.addEventListener("mousedown",K);let Y=()=>{G.removeEventListener("touchstart",K),G.removeEventListener("touchmove",z),G.removeEventListener("touchend",W),G.removeEventListener("mousedown",K),document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",W)},U=$.lifecycle?.destroy||(()=>{});return $.lifecycle={...$.lifecycle,destroy:()=>{Y(),U()}},$};var k2=({state:J,lifecycle:$})=>(Q)=>({...Q,element:Q.element,container:Q.container,open(){return J.open(),this},close(){return J.close(),this},setContent(Z){return Q.content.setContent(Z),this},getContent(){return Q.content.getContent()},setTitle(Z){return Q.title.setTitle(Z),this},getTitle(){return Q.title.getTitle()},setDragHandle(Z){if(Q.dragHandle)Q.dragHandle.setVisible(Z);return this},setMaxHeight(Z){return Q.container.style.maxHeight=Z,this},destroy(){$.destroy()},initialize(){if(Q.initialize)Q.initialize();return this}});t();var A9={STANDARD:"standard",MODAL:"modal",EXPANDED:"expanded"},a9={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"},pJ={OPEN:"open",CLOSE:"close",DRAG_START:"dragstart",DRAG_END:"dragend"},X8={LEVEL_1:1,LEVEL_2:2,LEVEL_3:3,LEVEL_4:4,LEVEL_5:5},F9={VARIANT:A9.STANDARD,POSITION:a9.BOTTOM,OPEN:!1,DISMISSIBLE:!0,DRAG_HANDLE:!0,ELEVATION:X8.LEVEL_3,TITLE:"",CONTENT:"",MAX_HEIGHT:"80%",ENABLE_GESTURES:!0},sJ={DURATION:300,TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",DELAY:0},mJ={MIN_VELOCITY:0.3,MIN_DISTANCE:30,DISMISS_THRESHOLD:0.3},aJ={CONTAINER:"sheet",SCRIM:"sheet__scrim",PANEL:"sheet__panel",DRAG_HANDLE:"sheet__drag-handle",TITLE:"sheet__title",CONTENT:"sheet__content",STANDARD:"sheet--standard",MODAL:"sheet--modal",EXPANDED:"sheet--expanded",BOTTOM:"sheet--bottom",TOP:"sheet--top",LEFT:"sheet--left",RIGHT:"sheet--right",OPEN:"sheet--open",DRAGGING:"sheet--dragging",ELEVATION_PREFIX:"sheet--elevation-"};var Ej={variant:A9.STANDARD,position:a9.BOTTOM,open:F9.OPEN,dismissible:F9.DISMISSIBLE,dragHandle:F9.DRAG_HANDLE,elevation:F9.ELEVATION,enableGestures:F9.ENABLE_GESTURES},M2=(J={})=>d(Ej,J,"sheet"),V2=(J)=>{return p(J,{tag:"div",attributes:{role:"dialog","aria-modal":J.variant===A9.MODAL?"true":"false"},className:J.class,forwardEvents:{click:!0,keydown:!0}})},N2=(J)=>({state:{open:()=>J.state.open(),close:()=>J.state.close()},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var hj=(J={})=>{let $=M2(J);try{let Q=b(S,g(),E(V2($)),K6($),fJ($),gJ($),dJ($),lJ($),rJ($),C(),(Z)=>k2(N2(Z))(Z))($);return Q.initialize(),Q}catch(Q){throw console.error("Sheet creation error:",Q),new Error(`Failed to create sheet: ${Q.message}`)}},cJ=hj;c();o();A6();var iJ=(J)=>($)=>{if(!J.range||!J.secondValue||!$.schema)return $;try{let Q=J.min||0,Z=J.max||100,q=J.secondValue,j=(q-Q)/(Z-Q)*100,G=J.valueFormatter||((X)=>X.toString()),K=J.disabled===!0,z=$.getClass,W=JSON.parse(JSON.stringify($.schema)),Y=W.element.options.className||[];if(Array.isArray(Y))Y.push(z("slider--range"));else W.element.options.className=`${Y} ${z("slider--range")}`.trim();let U=W.element.children.container.children;return U.secondHandle={name:"secondHandle",creator:v,options:{tag:"div",className:z("slider-handle"),attributes:{role:"slider","aria-valuemin":String(Q),"aria-valuemax":String(Z),"aria-valuenow":String(q),"aria-orientation":"horizontal",tabindex:K?"-1":"0","aria-disabled":K?"true":"false","data-value":String(q),"data-handle-index":"1"},style:{left:`${j}%`}}},U.secondValueBubble={name:"secondValueBubble",creator:v,options:{tag:"div",className:z("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"1"},text:G(q),style:{left:`${j}%`}}},{...$,schema:W}}catch(Q){return console.warn("Error enhancing structure with range functionality:",Q),$}};var J9={PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",ERROR:"error"},D6={XS:16,S:24,M:40,L:56,XL:80},Z6={HANDLE_SIZE:16,SMALL_HANDLE_HEIGHT:48,HANDLE_HEIGHT_OFFSET:16,MIN_HEIGHT:40,TRACK_RADIUS:3,SMALL_TRACK_EXTERNAL_RADIUS:10,LARGE_TRACK_RADIUS_RATIO:0.35,TICK_SIZE:4,DOT_SIZE:4,HANDLE_GAP:8,HANDLE_GAP_PRESSED_REDUCTION:2,CENTER_GAP:4,EDGE_PADDING:7},H6={CHANGE:"change",INPUT:"input",FOCUS:"focus",BLUR:"blur",START:"start",END:"end"},K$={START:"start",END:"end"},M6={MIN:0,MAX:100,VALUE:0,STEP:1,DISABLED:!1,COLOR:J9.PRIMARY,SIZE:"XS",TICKS:!1,SHOW_VALUE:!0,SNAP_TO_STEPS:!0,RANGE:!1,CENTERED:!1,ICON_POSITION:K$.START,LABEL_POSITION:K$.START},oJ={ROOT:"slider",CONTAINER:"slider__container",FILL:"slider__fill",HANDLE:"slider__handle",HANDLE_SECOND:"slider__handle--second",LABEL:"slider__label",VALUE:"slider__value",ICON:"slider__icon",DISABLED:"slider--disabled",FOCUSED:"slider--focused",DRAGGING:"slider--dragging",RANGE:"slider--range",PRIMARY:"slider--primary",SECONDARY:"slider--secondary",TERTIARY:"slider--tertiary",ERROR:"slider--error"};var tJ=(J)=>($)=>{if(J.disabled===!0)setTimeout(()=>{Z()},0);function Z(){if($.element.classList.add(`${$.getClass("slider")}--disabled`),$.element.setAttribute("aria-disabled","true"),$.structure?.handle)$.structure.handle.tabIndex=-1,$.structure.handle.setAttribute("aria-disabled","true");if(J.range&&$.structure?.secondHandle)$.structure.secondHandle.tabIndex=-1,$.structure.secondHandle.setAttribute("aria-disabled","true");if($.drawCanvas)$.drawCanvas()}function q(){if($.element.classList.remove(`${$.getClass("slider")}--disabled`),$.element.setAttribute("aria-disabled","false"),$.structure?.handle)$.structure.handle.tabIndex=0,$.structure.handle.setAttribute("aria-disabled","false");if(J.range&&$.structure?.secondHandle)$.structure.secondHandle.tabIndex=0,$.structure.secondHandle.setAttribute("aria-disabled","false");if($.drawCanvas)$.drawCanvas()}function j(){return Object.values(J9).find((K)=>$.element.classList.contains(`${$.getClass("slider")}--${K}`))||J9.PRIMARY}function G(){return Object.keys(D6).find((W)=>$.element.classList.contains(`${$.getClass("slider")}--${W.toLowerCase()}`))||"XS"}return{...$,disabled:{enable(){return q(),this},disable(){return Z(),this},isDisabled(){return $.element.classList.contains(`${$.getClass("slider")}--disabled`)}},appearance:{setColor(K){if(Object.values(J9).forEach((z)=>{$.element.classList.remove(`${$.getClass("slider")}--${z}`)}),K!==J9.PRIMARY)$.element.classList.add(`${$.getClass("slider")}--${K}`);return this},getColor(){return j()},setSize(K){Object.keys(D6).forEach((Y)=>{$.element.classList.remove(`${$.getClass("slider")}--${Y.toLowerCase()}`)});let W;if(typeof K==="string"&&K in D6)W=K;else if(typeof K==="number"){let Y=Object.entries(D6).find(([,U])=>U===K);W=Y?Y[0]:"XS"}else W="XS";return $.element.classList.add(`${$.getClass("slider")}--${W.toLowerCase()}`),this},getSize(){return G()},showTicks(K){if(J.ticks=K,$.slider)$.slider.regenerateTicks();return this},showCurrentValue(K){return J.showValue=K,this}}}};var _2=(J,$,Q,Z)=>{let q=$.component?.components||{},{container:j=null,handle:G=null,valueBubble:K=null,secondHandle:z=null,secondValueBubble:W=null}=q,{getValueFromPosition:Y=()=>0,roundToStep:U=(y)=>y,clamp:X=(y)=>y,showValueBubble:_=()=>{},render:H=()=>{}}=Q,{triggerEvent:B=()=>({defaultPrevented:!1})}=Z,M=!1,k=0,N=3,F=null,V=()=>{if($.valueHideTimer)clearTimeout($.valueHideTimer),$.valueHideTimer=null},O=()=>{if(V(),K)_(K,!1);if(W)_(W,!1)},P=(y)=>{if(O(),y&&J.showValue)_(y,!0)},L=(y,l=0)=>{if(V(),!y||!J.showValue)return;if(l>0)$.valueHideTimer=setTimeout(()=>{_(y,!1)},l);else _(y,!1)},D=()=>{if(G)G.classList.remove(`${$.component.getClass("slider-handle")}--focused`);if(z)z.classList.remove(`${$.component.getClass("slider-handle")}--focused`);try{let y=$.component.getClass("slider-handle--focused");if(document.querySelectorAll(`.${y}`).forEach((l)=>{l.classList.remove(y)}),document.activeElement?.classList.contains($.component.getClass("slider-handle")))document.activeElement.blur()}catch(y){console.warn("Error clearing keyboard focus:",y)}},R=(y,l=!1)=>{if(!$.component||$.component.disabled&&$.component.disabled.isDisabled())return;y.preventDefault(),y.stopPropagation(),O(),D(),k=y.type.includes("touch")?y.touches[0].clientX:y.clientX,$.dragging=!1,$.pressed=!0,M=!1,$.activeHandle=l?"second":"first",$.activeBubble=l?W:K,P($.activeBubble),document.addEventListener("mousemove",A),document.addEventListener("mouseup",x),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",x),H(),B(H6.START,y)},w=(y)=>{if(!$.component||$.component.disabled&&$.component.disabled.isDisabled()||!j)return;y.preventDefault(),O(),D();let l=!1;try{let m=y.type.includes("touch")?y.touches[0].clientX:y.clientX,s=Y(m);if(J.snapToSteps&&$.step>0)s=U(s);if(s=X(s,$.min,$.max),J.range&&$.secondValue!==null){let k9=Math.abs(s-$.value);l=Math.abs(s-$.secondValue)<k9,l?$.secondValue=s:$.value=s}else if(J.centered&&$.component.slider&&$.component.slider.setValue)$.component.slider.setValue(s,!1);else $.value=s;H(),B(H6.INPUT,y)}catch(m){console.warn("Error handling track click:",m)}if($.activeHandle=l?"second":"first",$.activeBubble=l?W:K,k=y.type.includes("touch")?y.touches[0].clientX:y.clientX,J.centered&&!J.range)P($.activeBubble),document.addEventListener("mousemove",A),document.addEventListener("mouseup",x),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",x),$.pressed=!1,B(H6.START,y);else $.dragging=!1,$.pressed=!1,M=!1,P($.activeBubble),document.addEventListener("mousemove",A),document.addEventListener("mouseup",x),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",x),H(),B(H6.START,y)},A=(y)=>{if(!$.activeHandle||!j)return;y.preventDefault();try{let l=y.type.includes("touch")?y.touches[0].clientX:y.clientX;if(!M&&Math.abs(l-k)>=N)M=!0,$.dragging=!0,$.component.element.classList.add(`${$.component.getClass("slider")}--dragging`);let m=Y(l);if(J.snapToSteps&&$.step>0)m=U(m);m=X(m,$.min,$.max);let s=$.activeHandle==="second";if(J.range&&$.secondValue!==null)if(s)if(m>=$.value)$.secondValue=m;else L($.activeBubble,0),$.secondValue=$.value,$.value=m,$.activeHandle="first",$.activeBubble=K,P($.activeBubble);else if(m<=$.secondValue)$.value=m;else L($.activeBubble,0),$.value=$.secondValue,$.secondValue=m,$.activeHandle="second",$.activeBubble=W,P($.activeBubble);else{if(J.centered)$.previousValue=$.value;$.value=m}H(),B(H6.INPUT,y)}catch(l){console.warn("Error during slider drag:",l)}},x=(y)=>{if(!$.activeHandle)return;y.preventDefault(),$.dragging=!1,$.pressed=!1,M=!1,$.component.element.classList.remove(`${$.component.getClass("slider")}--dragging`),L($.activeBubble,1000),document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",x),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",x),$.activeHandle=null,H(),B(H6.CHANGE,y),B(H6.END,y)},I=(y,l=!1)=>{if($.component.disabled&&$.component.disabled.isDisabled())return;let m=$.step||1,s=l?$.secondValue:$.value,k9=y.shiftKey?m*10:m;if(y.key==="Tab")return;let L6=!1;switch(y.key){case"ArrowRight":case"ArrowUp":y.preventDefault(),s=Math.min(s+k9,$.max),L6=!0;break;case"ArrowLeft":case"ArrowDown":y.preventDefault(),s=Math.max(s-k9,$.min),L6=!0;break;case"Home":y.preventDefault(),s=$.min,L6=!0;break;case"End":y.preventDefault(),s=$.max,L6=!0;break;case"PageUp":y.preventDefault(),s=Math.min(s+m*10,$.max),L6=!0;break;case"PageDown":y.preventDefault(),s=Math.max(s-m*10,$.min),L6=!0;break;default:return}if(!L6)return;if($.activeBubble=l?W:K,P($.activeBubble),l)$.secondValue=s;else{if(J.centered)$.previousValue=$.value;$.value=s}H(),B(H6.INPUT,y),B(H6.CHANGE,y)},r=(y,l=!1)=>{if($.component.disabled&&$.component.disabled.isDisabled())return;let m=l?z:G;if(F&&F!==m)O();F=m,m.classList.add(`${$.component.getClass("slider-handle")}--focused`),P(l?W:K),$.activeBubble=l?W:K,B(H6.FOCUS,y)},a=(y,l=!1)=>{(l?z:G).classList.remove(`${$.component.getClass("slider-handle")}--focused`);let s=y.relatedTarget;if(!s||s!==(l?G:z))L(l?W:K,200);B(H6.BLUR,y)};return{handleHandleMouseDown:R,handleTrackMouseDown:w,handleMouseMove:A,handleMouseUp:x,handleKeyDown:I,handleFocus:r,handleBlur:a,setupEventListeners:()=>{if(!$.component||!$.component.components){console.warn("Cannot set up event listeners: missing component structure");return}if(j.addEventListener("mousedown",w),j.addEventListener("touchstart",w,{passive:!1}),G.addEventListener("mousedown",(y)=>R(y,!1)),G.addEventListener("touchstart",(y)=>R(y,!1),{passive:!1}),G.addEventListener("keydown",(y)=>I(y,!1)),G.addEventListener("focus",(y)=>r(y,!1)),G.addEventListener("blur",(y)=>a(y,!1)),J.range&&z)z.addEventListener("mousedown",(y)=>R(y,!0)),z.addEventListener("touchstart",(y)=>R(y,!0),{passive:!1}),z.addEventListener("keydown",(y)=>I(y,!0)),z.addEventListener("focus",(y)=>r(y,!0)),z.addEventListener("blur",(y)=>a(y,!0))},cleanupEventListeners:()=>{if(!$.component||!$.component.components)return;if(j)j.removeEventListener("mousedown",w),j.removeEventListener("touchstart",w);if(G)G.removeEventListener("mousedown",(y)=>R(y,!1)),G.removeEventListener("touchstart",(y)=>R(y,!1)),G.removeEventListener("keydown",(y)=>I(y,!1)),G.removeEventListener("focus",(y)=>r(y,!1)),G.removeEventListener("blur",(y)=>a(y,!1));if(J.range&&z)z.removeEventListener("mousedown",(y)=>R(y,!0)),z.removeEventListener("touchstart",(y)=>R(y,!0)),z.removeEventListener("keydown",(y)=>I(y,!0)),z.removeEventListener("focus",(y)=>r(y,!0)),z.removeEventListener("blur",(y)=>a(y,!0));document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",x),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",x)},showActiveBubble:P,hideActiveBubble:L,hideAllBubbles:O,clearKeyboardFocus:D}};var nJ=(J)=>($)=>{if(!$.element||!$.components)return console.warn("Cannot initialize slider controller: missing element or components"),$;let Q={component:$,value:J.value!==void 0?J.value:0,secondValue:J.secondValue!==void 0?J.secondValue:null,min:J.min!==void 0?J.min:0,max:J.max!==void 0?J.max:100,step:J.step!==void 0?J.step:1,dragging:!1,pressed:!1,activeHandle:null,activeBubble:null,valueHideTimer:null},Z={triggerEvent(V,O=null){let P={slider:Q.component,value:Q.value,secondValue:Q.secondValue,originalEvent:O,preventDefault:()=>{P.defaultPrevented=!0},defaultPrevented:!1};return Q.component.emit(V,P),P}},q=()=>{if(!Q.component?.components)return{};return Q.component.components},j=(V)=>{let O=Q.max-Q.min;return O===0?0:(V-Q.min)/O*100},G=()=>{let V=q(),{handle:O,container:P}=V;if(!O||!P)return null;try{let L=O.getBoundingClientRect(),D=P.getBoundingClientRect(),R=L.width||Z6.HANDLE_SIZE,w=D.width,A=Z6.EDGE_PADDING/w*100,I=(Q.activeHandle?6:8)/w*100;return{handleSize:R,trackSize:w,edgeConstraint:A,paddingPercent:I}}catch(L){return console.warn("Error calculating track dimensions:",L),{handleSize:Z6.HANDLE_SIZE,trackSize:200,edgeConstraint:3,paddingPercent:4}}},K=(V,O=200)=>{let P=Z6.EDGE_PADDING/O*100,L=P,D=100-P,R=D-L;if(V<=0)return L;if(V>=100)return D;return L+V/100*R},z=(V)=>{let O=q(),{handle:P,container:L}=O;if(!P||!L)return Q.min;try{let D=L.getBoundingClientRect(),R=Q.max-Q.min,w=D.left+Z6.EDGE_PADDING,A=D.right-Z6.EDGE_PADDING,x=A-w,r=(Math.max(w,Math.min(A,V))-w)/x;return Q.min+r*R}catch(D){return console.warn("Error calculating value from position:",D),Q.min}},W=(V)=>{let O=Q.step;if(!O||O<=0)return V;let P=Math.round((V-Q.min)/O);return Q.min+P*O},Y=(V,O,P)=>Math.min(Math.max(V,O),P),U=()=>{let V=q(),{handle:O,container:P,valueBubble:L,secondHandle:D,secondValueBubble:R}=V;if(!O||!P)return;let w=G();if(!w)return;let{trackSize:A}=w,x=j(Q.value),I=K(x,A);if(O.style.left=`${I}%`,O.style.transform="translate(-50%, -50%)",L)L.style.left=`${I}%`,L.style.transform="translateX(-50%)";if(J.range&&D&&Q.secondValue!==null){let r=j(Q.secondValue),a=K(r,A);if(D.style.left=`${a}%`,D.style.transform="translate(-50%, -50%)",R)R.style.left=`${a}%`,R.style.transform="translateX(-50%)"}if(O)O.setAttribute("aria-valuenow",String(Q.value))},X=()=>{let V=q(),{valueBubble:O,secondValueBubble:P}=V;if(!O)return;let L=J.valueFormatter||((D)=>D.toString());if(O.textContent=L(Q.value),J.range&&P&&Q.secondValue!==null)P.textContent=L(Q.secondValue)},_=(V,O)=>{if(!V||!J.showValue)return;let P=Q.component.getClass("slider-value");V.classList[O?"add":"remove"](`${P}--visible`)},H=()=>{},B=()=>{},M=()=>{try{if(U(),X(),$.drawCanvas)$.drawCanvas(Q)}catch(V){console.warn("Error rendering UI:",V)}},N=_2(J,Q,{getPercentage:j,getValueFromPosition:z,roundToStep:W,clamp:Y,showValueBubble:_,updateUi:M,render:M},Z),F=()=>{try{if(!$.components||!$.components.handle){console.warn("Cannot initialize slider controller: missing required components");return}$.element.setAttribute("aria-valuemin",String(Q.min)),$.element.setAttribute("aria-valuemax",String(Q.max)),$.element.setAttribute("aria-valuenow",String(Q.value));let{handle:V,secondHandle:O}=$.components;if(V){if(V.setAttribute("aria-valuemin",String(Q.min)),V.setAttribute("aria-valuemax",String(Q.max)),V.setAttribute("aria-valuenow",String(Q.value)),J.range&&O&&Q.secondValue!==null)O.setAttribute("aria-valuemin",String(Q.min)),O.setAttribute("aria-valuemax",String(Q.max)),O.setAttribute("aria-valuenow",String(Q.secondValue))}N.setupEventListeners(),M()}catch(V){console.error("Error initializing slider controller:",V)}};if($.lifecycle){let V=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{N.cleanupEventListeners(),V()}}return setTimeout(()=>{F()},0),{...$,slider:{setValue(V,O=!0){let P=Y(V,Q.min,Q.max);if(Q.value=P,M(),O)Z.triggerEvent(H6.CHANGE);return this},getValue(){return Q.value},setSecondValue(V,O=!0){if(!J.range)return this;let P=Y(V,Q.min,Q.max);if(Q.secondValue=P,M(),O)Z.triggerEvent(H6.CHANGE);return this},getSecondValue(){return J.range?Q.secondValue:null},setMin(V){if(Q.min=V,$.element.setAttribute("aria-valuemin",String(V)),$.components?.handle)$.components.handle.setAttribute("aria-valuemin",String(V));if(J.range&&$.components?.secondHandle)$.components.secondHandle.setAttribute("aria-valuemin",String(V));if(Q.value<V)Q.value=V;if(J.range&&Q.secondValue!==null&&Q.secondValue<V)Q.secondValue=V;if(J.ticks||J.tickLabels)H();return M(),this},getMin(){return Q.min},setMax(V){if(Q.max=V,$.element.setAttribute("aria-valuemax",String(V)),$.components?.handle)$.components.handle.setAttribute("aria-valuemax",String(V));if(J.range&&$.components?.secondHandle)$.components.secondHandle.setAttribute("aria-valuemax",String(V));if(Q.value>V)Q.value=V;if(J.range&&Q.secondValue!==null&&Q.secondValue>V)Q.secondValue=V;if(J.ticks||J.tickLabels)H();return M(),this},getMax(){return Q.max},setStep(V){if(Q.step=V,$.element.classList[V>0?"add":"remove"](`${$.getClass("slider")}--discrete`),J.ticks||J.tickLabels)H(),B();return this},getStep(){return Q.step},regenerateTicks(){return M(),this},updateUi(){return M(),this}}}};Y9();l1();var uj=(J)=>J?.disabled?.isDisabled?.()||J?.element?.classList?.contains?.(`${J?.getClass?.("slider")}--disabled`)||!1,$0=(J,$,Q="track")=>{let Z=uj($),q=J.color||"primary";if(Z){let G=B6("sys-color-on-surface",{fallback:"#000000"});return{primary:v7(G,0.38),secondary:v7(G,0.12)}}if(Q==="tick")return{primary:B6(`sys-color-on-${q}`,{fallback:"#ffffff"}),secondary:B6(`sys-color-${q}`,{fallback:"#1976d2"})};let j=B6(`sys-color-${q}`,{fallback:"#1976d2"});return{primary:j,secondary:v7(j,0.24)}},B8=(J,$,Q)=>(J-$)/(Q-$)*100,b6=(J,$,Q,Z,q,j,G)=>{if(Z>0)C1(J,$,Q,Z,q,j,j,G)},G$=(J)=>{if(typeof J==="number")return Math.max(J,D6.XS);if(typeof J==="string"&&J in D6)return D6[J];return D6.XS},J0=(J)=>{let $=G$(J);if($<=D6.S)return Z6.SMALL_HANDLE_HEIGHT;return $+Z6.HANDLE_HEIGHT_OFFSET},fj=(J)=>{let $=G$(J);if($<=D6.S)return Z6.SMALL_TRACK_EXTERNAL_RADIUS;return $*Z6.LARGE_TRACK_RADIUS_RATIO},L2=(J,$,Q)=>{let Z=G$(Q?.size),q=J0(Q?.size),j=J.parentElement;if(!j)return;let G=Math.max(j.getBoundingClientRect().width||j.offsetWidth,200),K=Math.max(q+20,Z+32,Z6.MIN_HEIGHT);j.style.height=`${K}px`,f1($,G,K)},D2=(J,$)=>{let Q=J.parentElement;if(!Q)throw new Error("Canvas must have a parent element");let Z=G$($?.size),q=J0($?.size),j=Math.max(Q.getBoundingClientRect().width||Q.offsetWidth,200),G=Math.max(q+20,Z+32,Z6.MIN_HEIGHT);return Q.style.height=`${G}px`,u1(J,j,G)},F8=(J,$)=>{let Q=Z6.EDGE_PADDING/$*100,Z=Q,q=100-Q,j=q-Z;if(J<=0)return Z;if(J>=100)return q;return Z+J/100*j},gj=(J,$,Q,Z,q,j)=>{let G=Q/2,K=G$(Z.size),z=fj(Z.size),W=Z6.TRACK_RADIUS,Y=v1(J,0,G-K/2,$,K,z),{primary:U,secondary:X}=$0(Z,j),_=B8(q.value,q.min,q.max),H=F8(_,$),B=q.pressed?Z6.HANDLE_GAP_PRESSED_REDUCTION:0,M=Z6.HANDLE_GAP-B,N=Z6.CENTER_GAP/2/$*100,F=M/$*100;if(Z.centered){let V=B8(0,q.min,q.max),O=F8(V,$),P=Math.abs(H-O)<F,L=q.value>=0;if(P){let D=(H-F)/100*$;if(D>0)b6(J,0,G-K/2,D,K,W,X);let R=(H+F)/100*$,w=$-R;if(w>0)b6(J,R,G-K/2,w,K,W,X)}else if(L){let D=(O-N)/100*$;if(D>0)b6(J,0,G-K/2,D,K,W,X);let R=(O+N)/100*$,w=(H-F)/100*$-R;if(w>0)b6(J,R,G-K/2,w,K,W,U);let A=(H+F)/100*$,x=$-A;if(x>0)b6(J,A,G-K/2,x,K,W,X)}else{let D=(H-F)/100*$;if(D>0)b6(J,0,G-K/2,D,K,W,X);let R=(H+F)/100*$,w=(O-N)/100*$-R;if(w>0)b6(J,R,G-K/2,w,K,W,U);let A=(O+N)/100*$,x=$-A;if(x>0)b6(J,A,G-K/2,x,K,W,X)}}else if(Z.range&&q.secondValue!==null){let V=B8(q.secondValue,q.min,q.max),O=F8(V,$),P=Math.min(H,O),L=Math.max(H,O),D=H<=O,R=q.pressed&&q.activeHandle==="first"?Z6.HANDLE_GAP_PRESSED_REDUCTION:0,w=q.pressed&&q.activeHandle==="second"?Z6.HANDLE_GAP_PRESSED_REDUCTION:0,A=Z6.HANDLE_GAP-R,x=Z6.HANDLE_GAP-w,I=D?A/$*100:x/$*100,r=D?x/$*100:A/$*100,a=(P-I)/100*$;if(a>0)b6(J,0,G-K/2,a,K,W,X);let V6=(P+I)/100*$,i=(L-r)/100*$-V6;if(i>K)b6(J,V6,G-K/2,i,K,W,U);let y=(L+r)/100*$,l=$-y;if(l>0)b6(J,y,G-K/2,l,K,W,X)}else{let V=(H-F)/100*$;if(V>0)b6(J,0,G-K/2,V,K,W,U);let O=(H+F)/100*$,P=$-O;if(P>0)b6(J,O,G-K/2,P,K,W,X)}Y()},dj=(J,$,Q,Z,q,j)=>{if(!Z.ticks)return;let G=Z6.TICK_SIZE,K=Q/2,{primary:z,secondary:W}=$0(Z,j,"tick"),Y=Math.floor((q.max-q.min)/q.step);for(let U=0;U<=Y;U++){let X=q.min+U*q.step;if(X>q.max)continue;let _=B8(X,q.min,q.max),B=F8(_,$)/100*$,M=Math.abs(X-q.value)<q.step*0.1,k=Z.range&&q.secondValue!==null&&Math.abs(X-q.secondValue)<q.step*0.1;if(M||k)continue;let N=!1;if(Z.centered)N=q.value>=0?X>=0&&X<=q.value:X>=q.value&&X<=0;else if(Z.range&&q.secondValue!==null){let F=Math.min(q.value,q.secondValue),V=Math.max(q.value,q.secondValue);N=X>=F&&X<=V}else N=X<=q.value;J.fillStyle=N?z:W,J.globalAlpha=N?1:0.5,J.beginPath(),J.arc(B,K,G/2,0,Math.PI*2),J.fill()}J.globalAlpha=1},lj=(J,$,Q,Z,q)=>{if(Z.ticks)return;let j=Z6.DOT_SIZE,G=Q/2,K=Z6.EDGE_PADDING,{primary:z}=$0(Z,q,"dot");J.fillStyle=z,J.beginPath(),J.arc($-K,G,j/2,0,Math.PI*2),J.fill()},eJ=(J,$,Q,Z)=>{let{ctx:q,width:j,height:G}=J;if(j===0||G===0)return;E1(q,j,G),lj(q,j,G,$,Z),gj(q,j,G,$,Q,Z),dj(q,j,G,$,Q,Z)},O2=(J,$)=>{let Q=J0($),{handle:Z,secondHandle:q}=J.components||{};if(Z)Z.style.height=`${Q}px`;if(q)q.style.height=`${Q}px`},rj=(J,$,Q)=>{if(J)return{value:J.value,secondValue:J.secondValue,min:J.min,max:J.max,step:J.step,pressed:J.pressed||!1,activeHandle:J.activeHandle||null};if($?.slider)return{value:$.slider.getValue(),secondValue:$.slider.getSecondValue(),min:$.slider.getMin(),max:$.slider.getMax(),step:$.slider.getStep(),pressed:!1,activeHandle:null};return Q||{value:0,secondValue:null,min:0,max:100,step:1,pressed:!1,activeHandle:null}},Q0=(J)=>($)=>{let Q=d1(`${$.getClass("slider-canvas")}`,{zIndex:"1"}),Z=$.components?.container;if(Z)Z.insertBefore(Q,Z.firstChild);else $.element.appendChild(Q);let q=null,j=null,G=null,K=J.size||"XS",z=rj(null,$,{value:J.value||0,secondValue:J.secondValue||null,min:J.min||0,max:J.max||100,step:J.step||1,pressed:!1,activeHandle:null}),W={animatedValue:z.value,animatedSecondValue:z.secondValue,targetValue:z.value,targetSecondValue:z.secondValue,startValue:z.value,startSecondValue:z.secondValue,startTime:0,duration:h1.MEDIUM,animationFrame:null};if($.animationState=W,g1(()=>{try{return q=D2(Q,{...J,size:K}),$.ctx=q.ctx,!0}catch(M){return console.warn("Slider canvas initialization failed:",M),!1}},()=>{O2($,K)}),J.color&&J.color!=="primary")$.element.classList.add(`${$.getClass("slider")}--${J.color}`);$.canvas=Q;let Y=()=>{if(!q)return;eJ(q,{...J,size:K},{...z,value:W.animatedValue,secondValue:W.animatedSecondValue},$)},U=(M)=>{if(!q)return;let N=(M||performance.now())-W.startTime,F=Math.min(N/W.duration,1),V=f$(F),O=W.startValue,P=W.targetValue;if(W.animatedValue=O+(P-O)*V,W.targetSecondValue!==null&&W.animatedSecondValue!==null){let{startSecondValue:L,targetSecondValue:D}=W;W.animatedSecondValue=L+(D-L)*V}if(Y(),F<1)W.animationFrame=requestAnimationFrame((L)=>U(L));else W.animationFrame=null},X=(M)=>{if(!q){console.warn("Canvas context not ready");return}L2(Q,q,{...J,size:K});let k,N=!1;if(M)k={value:M.value,secondValue:M.secondValue,min:M.min,max:M.max,step:M.step,pressed:M.pressed||!1,activeHandle:M.activeHandle||null},N=M.dragging||!1,z={...k};else if($.slider)k={value:$.slider.getValue(),secondValue:$.slider.getSecondValue(),min:$.slider.getMin(),max:$.slider.getMax(),step:$.slider.getStep()},z={...k};else k={...z};let F=k.value!==W.targetValue,V=k.secondValue!==W.targetSecondValue;if((F||V)&&!N){if(W.startValue=W.animatedValue,W.startSecondValue=W.animatedSecondValue,W.targetValue=k.value,W.targetSecondValue=k.secondValue,W.animationFrame)cancelAnimationFrame(W.animationFrame);W.startTime=performance.now(),U()}else if(N){if(W.animatedValue=k.value,W.animatedSecondValue=k.secondValue,W.targetValue=k.value,W.targetSecondValue=k.secondValue,W.startValue=k.value,W.startSecondValue=k.secondValue,W.animationFrame)cancelAnimationFrame(W.animationFrame),W.animationFrame=null;eJ(q,{...J,size:K},M||k,$)}else eJ(q,{...J,size:K},M||k,$)},_=()=>{if(!q)return;try{let M=D2(Q,{...J,size:K});$.ctx=M.ctx,Object.assign(q,M),Y()}catch(M){console.warn("Slider canvas resize failed:",M)}};j=C7($.element,Q,_);let H=()=>Y();G=g$(J.color||"primary",H),requestAnimationFrame(()=>{X()}),$.drawCanvas=X,$.resize=_,$.setSize=(M)=>{if(K=M,q)L2(Q,q,{...J,size:K}),Y();O2($,K)},$.getSize=()=>K;let B=$.appearance?.setColor;if(B)$.appearance.setColor=(M)=>{if(B(M),J.color&&J.color!=="primary")$.element.classList.remove(`${$.getClass("slider")}--${J.color}`);if(M&&M!=="primary")$.element.classList.add(`${$.getClass("slider")}--${M}`);if(J.color=M,G)G(),G=null;G=g$(M,H),X()};if($.lifecycle){let M=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{if(j)j();if(G)G();if(W.animationFrame)cancelAnimationFrame(W.animationFrame);M()}}return $};var P2=(J)=>($)=>{return{...$,element:$.element,setValue(Q,Z=!0){return J.slider.setValue(Q,Z),this},getValue(){return J.slider.getValue()},setSecondValue(Q,Z=!0){return J.slider.setSecondValue(Q,Z),this},getSecondValue(){return J.slider.getSecondValue()},setMin(Q){return J.slider.setMin(Q),this},getMin(){return J.slider.getMin()},setMax(Q){return J.slider.setMax(Q),this},getMax(){return J.slider.getMax()},setStep(Q){return J.slider.setStep(Q),this},getStep(){return J.slider.getStep()},enable(){return J.disabled.enable(),this},disable(){return J.disabled.disable(),this},isDisabled(){return J.disabled.isDisabled()},setColor(Q){return J.appearance.setColor(Q),this},getColor(){return J.appearance.getColor()},setSize(Q){return J.appearance.setSize(Q),this},getSize(){return J.appearance.getSize()},showTicks(Q){return J.appearance.showTicks(Q),this},showCurrentValue(Q){return J.appearance.showCurrentValue(Q),this},setLabel(Q){if(J.text?.setText)J.text.setText(Q);return this},getLabel(){return J.text?.getText?J.text.getText():""},setIcon(Q){if(J.icon?.setIcon)J.icon.setIcon(Q);return this},getIcon(){return J.icon?.getIcon?J.icon.getIcon():""},on(Q,Z){if(J.events?.on)J.events.on(Q,Z);return this},off(Q,Z){if(J.events?.off)J.events.off(Q,Z);return this},destroy(){if(J.lifecycle?.destroy)J.lifecycle.destroy()}}};t();function R2(J,$){let Q=(W)=>J.getClass(W),Z=$.min||0,q=$.max||100,j=$.value!==void 0?$.value:Z,G=$.disabled===!0,K=$.valueFormatter||((W)=>W.toString()),z=(j-Z)/(q-Z)*100;return{element:{options:{className:[Q("slider"),$.class].filter(Boolean),attributes:{tabindex:"-1",role:"none","aria-disabled":G?"true":"false"}},children:{container:{options:{className:Q("slider-container"),style:{position:"relative"}},children:{handle:{options:{className:Q("slider-handle"),attributes:{role:"slider","aria-valuemin":String(Z),"aria-valuemax":String(q),"aria-valuenow":String(j),"aria-orientation":"horizontal",tabindex:G?"-1":"0","aria-disabled":G?"true":"false","data-value":String(j),"data-handle-index":"0"},style:{left:`${z}%`}}},valueBubble:{options:{className:Q("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"0"},text:K(j),style:{left:`${z}%`}}}}}}}}}var pj={min:M6.MIN,max:M6.MAX,value:M6.VALUE,step:M6.STEP,disabled:M6.DISABLED,color:M6.COLOR,size:M6.SIZE,ticks:M6.TICKS,showValue:M6.SHOW_VALUE,snapToSteps:M6.SNAP_TO_STEPS,range:M6.RANGE,centered:M6.CENTERED,iconPosition:M6.ICON_POSITION,labelPosition:M6.LABEL_POSITION,valueFormatter:(J)=>J.toString()},A2=(J={})=>{let $=d(pj,J,"slider"),Q={componentName:"slider",config:$,getClass:(Z)=>{return`${$.prefix||"mtrl"}-${Z}`}};return $.schema=R2(Q,$),$};var w2=(J)=>({slider:{setValue:($,Q)=>J.slider?.setValue($,Q),getValue:()=>J.slider?.getValue()??0,setSecondValue:($,Q)=>J.slider?.setSecondValue($,Q),getSecondValue:()=>J.slider?.getSecondValue()??null,setMin:($)=>J.slider?.setMin($),getMin:()=>J.slider?.getMin()??0,setMax:($)=>J.slider?.setMax($),getMax:()=>J.slider?.getMax()??100,setStep:($)=>J.slider?.setStep($),getStep:()=>J.slider?.getStep()??1,regenerateTicks:()=>J.slider?.regenerateTicks?.()},disabled:{enable:()=>J.disabled?.enable?.(),disable:()=>J.disabled?.disable?.(),isDisabled:()=>J.disabled?.isDisabled?.()??!1},appearance:{setColor:($)=>J.appearance?.setColor?.($),getColor:()=>J.appearance?.getColor?.()??"primary",setSize:($)=>J.setSize?.($),getSize:()=>J.getSize?.()??"XS",showTicks:($)=>J.appearance?.showTicks?.($),showCurrentValue:($)=>J.appearance?.showCurrentValue?.($)},text:{setText:($)=>J.label?.setText?.($),getText:()=>J.label?.getText?.()??""},icon:{setIcon:($)=>J.icon?.setIcon?.($),getIcon:()=>J.icon?.getIcon?.()??""},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var sj=(J={})=>{let $=A2(J);try{let Q=b(S,g(),n7($),ZJ($),e7($),iJ($),$$(),Q0($),tJ($),nJ($),C())($),Z=w2(Q),q=P2(Z)(Q);if($.on&&typeof q.on==="function")Object.entries($.on).forEach(([j,G])=>{if(typeof G==="function")q.on(j,G)});return q}catch(Q){throw console.error("Slider creation error:",Q),new Error(`Failed to create slider: ${Q.message}`)}},Z0=sj;J6();c();var x2=(J)=>($)=>{if(!J.action)return $;let Q=document.createElement("button");return Q.className=`${J.prefix}-snackbar-action`,Q.textContent=J.action,$.element.appendChild(Q),{...$,actionButton:Q}},y2=(J)=>($)=>{let Q=null,Z=()=>{if(Q)clearTimeout(Q),Q=null;if(typeof J.duration==="number"&&J.duration>0)Q=window.setTimeout(()=>{if($.element&&$.emit)$.emit("dismiss")},J.duration)},q=()=>{if(Q)clearTimeout(Q),Q=null},j=$.lifecycle?.destroy;if($.lifecycle)$.lifecycle.destroy=()=>{if(q(),j)j.call($.lifecycle)};return{...$,timer:{start:Z,stop:q}}};var H8={BASIC:"basic",ACTION:"action"},Q9={CENTER:"center",START:"start",END:"end"},q0={VISIBLE:"visible",HIDDEN:"hidden"},j0={OPEN:"open",CLOSE:"close",ACTION:"action",DISMISS:"dismiss"},c9={VARIANT:H8.BASIC,POSITION:Q9.CENTER,DURATION:4000,Z_INDEX:1000,ANIMATION_DURATION:300},K0={ROOT:"snackbar",BASIC:"snackbar--basic",ACTION:"snackbar--action",CENTER:"snackbar--center",START:"snackbar--start",END:"snackbar--end",VISIBLE:"snackbar--visible",HIDDEN:"snackbar--hidden",MESSAGE:"snackbar__message",ACTION_BUTTON:"snackbar__action"};var T2=(J)=>($)=>{let Q=J.position||Q9.CENTER,Z=J.prefix||"mtrl",q=`${Z}-snackbar--${Q}`;$.element.classList.add(q);let j=(G)=>{$.element.classList.remove(q);let K=`${Z}-snackbar--${G}`;if($.element.classList.add(K),$.element.classList.contains(`${Z}-snackbar--visible`))if(G===Q9.CENTER)$.element.style.transform="translateX(-50%) scale(1)";else $.element.style.transform="scale(1)"};return{...$,position:{getPosition:()=>Q,setPosition:(G)=>{if(Object.values(Q9).includes(G))return j(G),$;else return console.warn(`Invalid position: ${G}. Using default: ${Q9.CENTER}`),j(Q9.CENTER),$}}}};o();var I2=({lifecycle:J,queue:$})=>(Q)=>{if(!$)throw new Error("Snackbar queue is required");let Z=!1,q={element:Q.element,actionButton:Q.actionButton,timer:Q.timer,position:Q.position,state:Z?"visible":"hidden",show(){if(Z)return this;return Z=!0,this.state="visible",$.add({...this,_show:()=>{document.body.appendChild(Q.element);let j=Q.element.offsetHeight;if(Q.element.classList.add(`${Q.getClass?.("snackbar")}--visible`),Q.timer)Q.timer.start();return this}}),this},hide(){if(!Z)return this;if(Z=!1,this.state="hidden",Q.timer)Q.timer.stop();let j=(G)=>{if(G.propertyName!=="opacity")return;if(Q.element.removeEventListener("transitionend",j),Q.element.parentNode)Q.element.remove()};return Q.element.addEventListener("transitionend",j),Q.element.classList.remove(`${Q.getClass?.("snackbar")}--visible`),this},setMessage(j){return Q.text?.setText(j),this},getMessage(){return Q.text?.getText()||""},setAction(j){if(Q.actionButton)Q.actionButton.textContent=j;return this},getAction(){return Q.actionButton?Q.actionButton.textContent||"":""},setDuration(){return this},getDuration(){return 0},setPosition(j){if(Q.position?.setPosition)Q.position.setPosition(j);return this},getPosition(){return Q.position?.getPosition?.()||"center"},on(j,G){return Q.on?.(j,G),this},off(j,G){return Q.off?.(j,G),this},destroy(){if(Z&&Q.element.parentNode)Q.element.remove();if(Q.timer)Q.timer.stop();J.destroy()}};if(Q.actionButton)Q.actionButton.addEventListener("click",()=>{Q.emit?.("action"),Q.emit?.("dismiss")});if(Q.on){let j=()=>{if(Z)q.hide()};Q.on("dismiss",j);let G=J.destroy;J.destroy=()=>{Q.off?.("dismiss",j),G?.call(J)}}return q};var S2=()=>{let J=[],$=!1,Q=()=>{if(J.length===0){$=!1;return}$=!0;let Z=J[0],q=()=>{if(J.shift(),Z.off?.("dismiss",q),J.length===0)$=!1;else setTimeout(Q,200)};Z.on?.("dismiss",q),Z._show()};return{add(Z){if(!Z._show)throw new Error("Snackbar must implement _show method");if(J.push(Z),!$)Q()},clear(){J.length=0,$=!1},getLength(){return J.length}}};t();var mj={variant:c9.VARIANT,position:c9.POSITION,duration:c9.DURATION},b2=(J)=>d(mj,J,"snackbar"),v2=(J)=>p(J,{tag:"div",className:J.class}),C2=(J)=>({...J,text:J.message}),E2=(J,$)=>({lifecycle:{destroy:J.lifecycle?.destroy||(()=>{})},queue:$});var aj=S2(),cj=(J)=>{if(!J.message)throw new Error("Snackbar message is required");let $=b2(J);try{return b(S,g(),E(v2($)),K6($),T2($),K9(C2($)),x2($),C(),y2($),(Z)=>I2(E2(Z,aj))(Z))($)}catch(Q){throw console.error("Snackbar creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create snackbar: ${Q instanceof Error?Q.message:String(Q)}`)}},G0=cj;J6();c();o();var h2=({disabled:J,lifecycle:$,checkable:Q})=>(Z)=>({...Z,element:Z.element,input:Z.input,getValue:Z.getValue||(()=>""),setValue(q){return Z.setValue?.(q),this},check(){return Q.check(),this},uncheck(){return Q.uncheck(),this},toggle(){return Q.toggle(),this},isChecked(){return Q.isChecked()},setLabel(q){return Z.text?.setText(q),this},getLabel(){return Z.text?.getText()||""},supportingTextElement:Z.supportingTextElement||null,setSupportingText(q,j){if(Z.setSupportingText)Z.setSupportingText(q,j);return this},removeSupportingText(){if(Z.removeSupportingText)Z.removeSupportingText();return this},on(q,j){return Z.on?.(q,j),this},off(q,j){return Z.off?.(q,j),this},enable(){return J.enable(),this},disable(){return J.disable(),this},destroy(){$.destroy()}});o();var u2=(J,$,Q)=>{let Z=$||"mtrl",q=Q||"switch",j=J.element.querySelector(`.${Z}-${q}-container`);if(!j){j=document.createElement("div"),j.className=`${Z}-${q}-container`;let K=J.element.querySelector(`.${Z}-${q}-input`),z=J.element.querySelector(`.${Z}-${q}-track`),W=[];if(K)W.push(K);if(z)W.push(z);let Y=document.createElement("div");Y.className=`${Z}-${q}-content`;let U=J.element.querySelector(`.${Z}-${q}-label`);if(U)Y.appendChild(U);return j.appendChild(Y),W.forEach((X)=>j.appendChild(X)),J.element.appendChild(j),{container:j,contentWrapper:Y}}let G=J.element.querySelector(`.${Z}-${q}-content`);if(!G){G=document.createElement("div"),G.className=`${Z}-${q}-content`;let K=J.element.querySelector(`.${Z}-${q}-label`);if(K)G.appendChild(K);j.insertBefore(G,j.firstChild)}return{container:j,contentWrapper:G}},k8=(J)=>($)=>{let Q=J.prefix||"mtrl",Z=J.componentName||"switch",{contentWrapper:q}=u2($,Q,Z),j=null;if(J.supportingText){if(j=document.createElement("div"),j.className=`${Q}-${Z}-helper`,j.textContent=J.supportingText,J.error)j.classList.add(`${Q}-${Z}-helper--error`),$.element.classList.add(`${Q}-${Z}--error`);q.appendChild(j)}if("lifecycle"in $&&$.lifecycle&&typeof $.lifecycle==="object"&&"destroy"in $.lifecycle&&j){let G=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(j)j.remove();G.call($.lifecycle)}}return{...$,supportingTextElement:j,setSupportingText(G,K=!1){let{contentWrapper:z}=u2($,Q,Z),W=this.supportingTextElement;if(!W)W=document.createElement("div"),W.className=`${Q}-${Z}-helper`,z.appendChild(W),this.supportingTextElement=W;return W.textContent=G,W.classList.toggle(`${Q}-${Z}-helper--error`,K),$.element.classList.toggle(`${Q}-${Z}--error`,K),this},removeSupportingText(){if(this.supportingTextElement&&this.supportingTextElement.parentNode)this.supportingTextElement.remove(),this.supportingTextElement=null,$.element.classList.remove(`${Q}-${Z}--error`);return this}}},f2=(J)=>($)=>{let Q={...J,prefix:J.prefix||"mtrl",componentName:J.componentName||"switch"};return A7(Q)($)};t();var ij={prefix:"mtrl",componentName:"switch"},g2=(J={})=>d(ij,J,"switch"),d2=(J)=>p(J,{tag:"div",className:J.class,interactive:!0}),l2=(J)=>({disabled:{enable:J.disabled?.enable,disable:J.disabled?.disable},lifecycle:{destroy:J.lifecycle?.destroy},checkable:{check:J.checkable?.check,uncheck:J.checkable?.uncheck,toggle:J.checkable?.toggle,isChecked:J.checkable?.isChecked}});var oj=(J={})=>{let $=g2(J);try{return b(S,g(),E(d2($)),z9($),I9($),f2($),k8($),S9($),G6($),C(),(Z)=>h2(l2(Z))(Z))($)}catch(Q){throw console.error("Switch creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create switch: ${Q instanceof Error?Q.message:String(Q)}`)}},z0=oj;var M8={START:"start",END:"end"},W0={CHECKED:"checked",UNCHECKED:"unchecked",DISABLED:"disabled",ENABLED:"enabled"},Y0={CHANGE:"change",FOCUS:"focus",BLUR:"blur"},U0={CHECKED:!1,DISABLED:!1,REQUIRED:!1,LABEL_POSITION:M8.END,VALUE:"on"},X0={ROOT:"switch",CONTAINER:"switch-container",CONTENT:"switch-content",LABEL:"switch-label",INPUT:"switch-input",TRACK:"switch-track",THUMB:"switch-thumb",LABEL_START:"switch--label-start",LABEL_END:"switch--label-end",CHECKED:"switch--checked",DISABLED:"switch--disabled",ERROR:"switch--error",HELPER:"switch-helper",HELPER_ERROR:"switch-helper--error",FOCUSED:"switch--focused"};J6();c();o();J6();c();o();var z$={PRIMARY:"primary",SECONDARY:"secondary"},B7={ACTIVE:"active",INACTIVE:"inactive",DISABLED:"disabled"},V8={FIXED:"fixed",DYNAMIC:"dynamic",CONTENT:"content",AUTO:"auto"},B0={CLICK:"click",FOCUS:"focus",BLUR:"blur"},N8={CHANGE:"change"},w9={VARIANT:z$.PRIMARY,SCROLLABLE:!0,SHOW_DIVIDER:!0,INDICATOR_HEIGHT:3,INDICATOR_WIDTH_STRATEGY:V8.AUTO,INDICATOR_FIXED_WIDTH:40,INDICATOR_ANIMATION_DURATION:250,INDICATOR_ANIMATION_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",ICON_SIZE:"24px",RIPPLE:!0},F7={ICON_ONLY:"icon-only",TEXT_ONLY:"text-only",ICON_AND_TEXT:"icon-and-text"},F0={ROOT:"tabs",PRIMARY:"tabs--primary",SECONDARY:"tabs--secondary",SCROLLABLE:"tabs--scrollable",SCROLL:"tabs-scroll",DIVIDER:"tabs-divider",INDICATOR:"tabs-indicator"},H0={ROOT:"tab",ACTIVE:"tab--active",INACTIVE:"tab--inactive",DISABLED:"tab--disabled",TEXT:"tab-text",ICON:"tab-icon",RIPPLE:"tab-ripple",PRIMARY:"tab--primary",SECONDARY:"tab--secondary",CONTAINER:"tab-container",BADGE:"tab-badge"};t();c();var tj={state:B7.INACTIVE,componentName:"tab",ripple:w9.RIPPLE},nj={variant:w9.VARIANT,scrollable:w9.SCROLLABLE,showDivider:w9.SHOW_DIVIDER,componentName:"tabs"},r2=(J={})=>d(nj,J,"tabs"),p2=(J={})=>d(tj,J,"tab"),s2=(J)=>{let $={tag:"div",attributes:{role:"tablist","aria-orientation":"horizontal"},className:[`${J.prefix}-tabs`,`${J.prefix}-tabs--${J.variant||"primary"}`,J.class]};return(Q)=>E($)(Q)};l9();w7();var H7=(J={})=>{let $=p2(J);try{let Q=b(S,g(),C())($),Z=e6({text:$.text,icon:$.icon,iconSize:$.iconSize,disabled:$.disabled,ripple:$.ripple!==!1,rippleConfig:{duration:400,timing:"cubic-bezier(0.4, 0, 0.2, 1)",opacity:["0.2","0"],...$.rippleConfig||{}},value:$.value,prefix:$.prefix,variant:"text",class:`${$.prefix}-tab`});if(Q.element=Z.element,Q.element.setAttribute("role","tab"),Q.element.setAttribute("aria-selected",$.state==="active"?"true":"false"),$.value)Q.element.setAttribute("id",`tab-${$.value}`),Q.element.setAttribute("aria-controls",`tabpanel-${$.value}`);if($.state==="active")Q.element.classList.add(`${Q.getClass("tab")}--active`);Z.on("click",(j)=>{if(Q.emit)Q.emit("click",j)});let q={...Q,button:Z,element:Z.element,badge:null,getValue(){return Z.getValue()},setValue(j){let G=j||"";return Z.setValue(G),this.element.setAttribute("id",`tab-${G}`),this.element.setAttribute("aria-controls",`tabpanel-${G}`),this},activate(){this.element.classList.add(`${this.getClass("tab")}--active`),this.element.setAttribute("aria-selected","true");let j=new CustomEvent("tab:activated",{bubbles:!0,detail:{value:this.getValue()}});return this.element.dispatchEvent(j),this},deactivate(){return this.element.classList.remove(`${this.getClass("tab")}--active`),this.element.setAttribute("aria-selected","false"),this},isActive(){return this.element.classList.contains(`${this.getClass("tab")}--active`)},enable(){return Z.enable(),this.element.removeAttribute("aria-disabled"),this},disable(){return Z.disable(),this.element.setAttribute("aria-disabled","true"),this},setText(j){return Z.setText(j),this.updateLayoutStyle(),this},getText(){return Z.getText()},setIcon(j){return Z.setIcon(j),this.updateLayoutStyle(),this},getIcon(){return Z.getIcon()},setBadge(j){if(!this.badge){let G={content:j,standalone:!1,target:this.element,prefix:$.prefix,...$.badgeConfig||{}};this.badge=e9(G)}else this.badge.setContent(j),this.badge.show();return this.element.setAttribute("data-has-badge","true"),this},getBadge(){return this.badge?this.badge.getContent():""},showBadge(){if(this.badge)this.badge.show(),this.element.setAttribute("data-has-badge","true");return this},hideBadge(){if(this.badge)this.badge.hide(),this.element.setAttribute("data-has-badge","false");return this},getBadgeComponent(){return this.badge},destroy(){if(this.badge)this.badge.destroy();if(Z.destroy)Z.destroy();Q.lifecycle.destroy()},updateLayoutStyle(){let j=!!this.getText(),G=!!this.getIcon(),K="";if(j&&G)K=F7.ICON_AND_TEXT;else if(G)K=F7.ICON_ONLY;else K=F7.TEXT_ONLY;if(Object.values(F7).forEach((z)=>{this.element.classList.remove(`${this.getClass("tab")}--${z}`)}),this.element.classList.add(`${this.getClass("tab")}--${K}`),K===F7.ICON_ONLY&&j)this.element.setAttribute("aria-label",this.getText());else this.element.removeAttribute("aria-label")}};if($.badge!==void 0)q.setBadge($.badge);return q.updateLayoutStyle(),q}catch(Q){throw console.error("Tab creation error:",Q),new Error(`Failed to create tab: ${Q.message}`)}};var m2=({lifecycle:J})=>($)=>({...$,element:$.element,addTab(Q){let Z={...Q,prefix:$.config.prefix,variant:Q.variant||$.config.variant};if(Z.value===void 0)Z.value="";let q=H7(Z);if($.tabs.push(q),$.tabsContainer.appendChild(q.element),q.on&&typeof q.on==="function")q.on("click",(G)=>$.handleTabClick(G,q));return q.element.addEventListener("click",(G)=>{$.handleTabClick(G,q)}),q},add(Q){if($.tabs.push(Q),$.tabsContainer.appendChild(Q.element),Q.on&&typeof Q.on==="function")Q.on("click",(q)=>$.handleTabClick(q,Q));return Q.element.addEventListener("click",(q)=>{$.handleTabClick(q,Q)}),this},getTabs(){return[...$.tabs]},getActiveTab(){return $.tabs.find((Q)=>Q.isActive())||null},setActiveTab(Q){let Z=typeof Q==="string"?$.tabs.find((q)=>q.getValue()===Q):Q;if(!Z)return this;if($.tabs.forEach((q)=>q.deactivate()),Z.activate(),$.emit)$.emit("change",{tab:Z,value:Z.getValue()});return this},removeTab(Q){let Z=typeof Q==="string"?$.tabs.find((j)=>j.getValue()===Q):Q;if(!Z)return this;let q=$.tabs.indexOf(Z);if(q!==-1)$.tabs.splice(q,1);if(Z.element.parentNode)Z.element.parentNode.removeChild(Z.element);return Z.destroy(),this},on(Q,Z){if($.on)$.on(Q,Z);return this},off(Q,Z){if($.off)$.off(Q,Z);return this},destroy(){$.tabs.forEach((Q)=>Q.destroy()),$.tabs.length=0,J.destroy()}}),a2=(J)=>({lifecycle:{destroy:()=>J.lifecycle.destroy()}});function c2(J){if(typeof J.getActiveTab==="function")return J.getActiveTab();if(Array.isArray(J.tabs))return J.tabs.find(($)=>$.isActive&&$.isActive());return null}function _8(J){let $=c2(J);if(!$)return;if(typeof $.getValue!=="function")return;let Q=$.getValue();document.querySelectorAll('[role="tabpanel"]').forEach((q)=>{if(q.getAttribute("aria-labelledby")?.replace("tab-","")===Q)q.removeAttribute("hidden"),q.setAttribute("tabindex","0");else q.setAttribute("hidden","true"),q.setAttribute("tabindex","-1")})}function L8(J){if(!J.element)return;J.element.addEventListener("keydown",($)=>{if($.target!==$.currentTarget)return;if(typeof J.getTabs!=="function"||typeof J.setActiveTab!=="function")return;let Q=J.getTabs(),Z=c2(J),q=Z?Q.indexOf(Z):-1,j=q;switch($.key){case"ArrowRight":case"ArrowDown":j=q<Q.length-1?q+1:0;break;case"ArrowLeft":case"ArrowUp":j=q>0?q-1:Q.length-1;break;case"Home":j=0;break;case"End":j=Q.length-1;break;default:return}if(j!==q&&Q[j])$.preventDefault(),Q[j].element.focus(),J.setActiveTab(Q[j])})}var ej={widthStrategy:"auto",fixedWidth:40,animationDuration:250,animationTiming:"cubic-bezier(0.4, 0, 0.2, 1)",visible:!0,prefix:"mtrl",variant:"primary"},D8=(J={})=>{let $={...ej,...J},Q=$.prefix||"mtrl",Z=document.createElement("div");if(Z.className=`${Q}-tabs-indicator`,Z.style.transition=`transform ${$.animationDuration}ms ${$.animationTiming},
|
|
31
|
-
width ${$.animationDuration}ms ${$.animationTiming}`,Z.style.width=`${$.fixedWidth}px`,!$.visible)Z.style.opacity="0";let q=null,j=(H)=>{if($.widthStrategy==="auto"){if($.variant==="secondary")return H.element.offsetWidth;let B=H.element.querySelector(`.${Q}-tab-text`)||H.element.querySelector(`.${Q}-button-text`);if(B)return B.clientWidth;return Math.max(H.element.offsetWidth/2,30)}switch($.widthStrategy){case"dynamic":return Math.max(H.element.offsetWidth/2,30);case"content":let B=H.element.querySelector(`.${Q}-button-text`)||H.element.querySelector(`.${Q}-tab-text`);if(B)return Math.max(B.clientWidth,30);return $.fixedWidth||40;case"fixed":default:return $.fixedWidth||40}},
|
|
32
|
-
width ${$.animationDuration}ms ${$.animationTiming}`},10)};return{element:Z,moveToTab:
|
|
30
|
+
</svg>`,EJ={CHECKMARK:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>'},hJ={CONTAINER:"segmented-button",SEGMENT:"segmented-button__segment",SELECTED:"segmented-button__segment--selected",DISABLED:"segmented-button__segment--disabled",HAS_ICON:"segmented-button__segment--has-icon",ICON:"segmented-button__icon",LABEL:"segmented-button__label",CHECKMARK:"segmented-button__checkmark",RIPPLE:"segmented-button__ripple",SINGLE_MODE:"segmented-button--single",MULTI_MODE:"segmented-button--multi",DEFAULT_DENSITY:"segmented-button--density-default",COMFORTABLE_DENSITY:"segmented-button--density-comfortable",COMPACT_DENSITY:"segmented-button--density-compact"};var vj={mode:m9.MODE,ripple:m9.RIPPLE,density:m9.DENSITY},F2=(J={})=>d(vj,J,"segmented-button"),H2=(J)=>{let $=J.density||"default";return{tag:"div",componentName:"segmented-button",attributes:{role:"group","aria-label":"Segmented button","data-mode":J.mode||"single","data-density":$},className:[J.class,J.disabled?`${J.prefix}-segmented-button--disabled`:null,$!=="default"?`${J.prefix}-segmented-button--${$}`:null],interactive:!0}},uJ=(J)=>{switch(J){case"compact":return{"--segment-padding":"4px 8px","--segment-height":"28px","--segment-font-size":"0.8125rem"};case"comfortable":return{"--segment-padding":"6px 12px","--segment-height":"32px","--segment-font-size":"0.875rem"};case"default":default:return{"--segment-padding":"8px 16px","--segment-height":"36px","--segment-font-size":"0.875rem"}}};l9();var Y8=(J,$,Q,Z=!1,q={ripple:!0,rippleConfig:{}})=>{let j=Z||J.disabled,K=J.icon,G=J.checkmarkIcon||B2,W=e6({text:J.text,icon:J.selected&&J.text&&K?G:K,value:J.value||J.text||"",disabled:j,ripple:q.ripple,rippleConfig:q.rippleConfig,class:J.class});if(W.element.classList.add(`${Q}-segmented-button-segment`),J.selected)W.element.classList.add(`${Q}-segment--selected`),W.element.setAttribute("aria-pressed","true");else W.element.setAttribute("aria-pressed","false");$.appendChild(W.element);let z=(U)=>{if(W.element.classList.toggle(`${Q}-segment--selected`,U),W.element.setAttribute("aria-pressed",U?"true":"false"),J.text&&K)if(U)W.setIcon(G);else W.setIcon(K)},Y=J.selected||!1;return{element:W.element,value:J.value||J.text||"",isSelected(){return Y},setSelected(U){Y=U,z(U)},isDisabled(){return W.disabled?.isDisabled?.()||!1},setDisabled(U){if(U)W.disable();else W.enable()},destroy(){W.destroy()}}};var Cj=(J={})=>{let $=F2(J),Q=$.mode||"single",Z=$.density||"default",q=C6();try{let j=b(S,g(),E(H2($)),C())($),K=uJ(Z);Object.entries(K).forEach(([H,B])=>{j.element.style.setProperty(H,B)});let G=[];if($.segments&&$.segments.length)$.segments.forEach((H)=>{let B=Y8(H,j.element,$.prefix,$.disabled,{ripple:$.ripple,rippleConfig:$.rippleConfig});G.push(B)});if(Q==="single"&&!G.some((H)=>H.isSelected())){let H=G.find((B)=>!B.isDisabled());if(H)H.setSelected(!0)}let W=(H)=>{let B=H.currentTarget,k=G.find((F)=>F.element===B);if(!k||k.isDisabled())return;let M=Y();if(Q==="single")G.forEach((F)=>{F.setSelected(F===k)});else k.setSelected(!k.isSelected());let V=Y();if(M.length!==V.length||M.some((F)=>!V.includes(F))||V.some((F)=>!M.includes(F)))q.emit("change",{selected:z(),value:V,oldValue:M})};G.forEach((H)=>{H.element.addEventListener("click",W)});let z=()=>G.filter((H)=>H.isSelected()),Y=()=>z().map((H)=>H.value),U=(H)=>G.find((B)=>B.value===H),X=(H)=>{if(["default","comfortable","compact"].forEach((k)=>{if(k!=="default")j.element.classList.remove(`${$.prefix}-segmented-button--${k}`)}),H!=="default")j.element.classList.add(`${$.prefix}-segmented-button--${H}`);j.element.setAttribute("data-density",H);let B=uJ(H);Object.entries(B).forEach(([k,M])=>{j.element.style.setProperty(k,M)})};return{element:j.element,segments:G,getSelected:z,getValue(){return Y()},select(H){let B=U(H);if(B&&!B.isDisabled()){let k=Y();if(Q==="single")G.forEach((V)=>V.setSelected(V===B));else B.setSelected(!0);let M=Y();if(k.join(",")!==M.join(","))q.emit("change",{selected:z(),value:M,oldValue:k})}return this},deselect(H){let B=U(H);if(B&&!B.isDisabled())if(Q==="single"){if(z().length>1||!B.isSelected()){let M=Y();B.setSelected(!1);let V=Y();if(M.join(",")!==V.join(","))q.emit("change",{selected:z(),value:V,oldValue:M})}}else{let k=Y();B.setSelected(!1);let M=Y();if(k.join(",")!==M.join(","))q.emit("change",{selected:z(),value:M,oldValue:k})}return this},enable(){return j.element.classList.remove(`${$.prefix}-segmented-button--disabled`),G.forEach((H)=>{if(!$.segments?.find((B)=>B.value===H.value)?.disabled)H.setDisabled(!1)}),this},disable(){return j.element.classList.add(`${$.prefix}-segmented-button--disabled`),G.forEach((H)=>{H.setDisabled(!0)}),this},enableSegment(H){let B=U(H);if(B)B.setDisabled(!1);return this},disableSegment(H){let B=U(H);if(B)B.setDisabled(!0);return this},setDensity(H){return X(H),this},getDensity(){return j.element.getAttribute("data-density")||"default"},on(H,B){return q.on(H,B),this},off(H,B){return q.off(H,B),this},destroy(){G.forEach((H)=>{H.element.removeEventListener("click",W),H.destroy()}),q.clear(),j.lifecycle.destroy()}}}catch(j){throw console.error("Segmented Button creation error:",j),new Error(`Failed to create segmented button: ${j.message}`)}},U8=Cj;J6();c();o();var f6={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"},X7={OPEN:"open",CLOSE:"close",DRAG_START:"dragstart",DRAG_END:"dragend"};var fJ=(J)=>($)=>{let{position:Q=f6.BOTTOM}=J,Z=`${$.getClass("sheet")}--${Q.toLowerCase()}`;return $.element.classList.add(Z),{...$,position:{setPosition(q){$.element.classList.remove(Z);let j=`${$.getClass("sheet")}--${q.toLowerCase()}`;$.element.classList.add(j)},getPosition(){return Q}}}};var gJ=(J)=>($)=>{let{content:Q=""}=J,Z=document.createElement("div");return Z.className=`${$.getClass("sheet")}-content`,Z.innerHTML=Q,$.container=document.createElement("div"),$.container.className=`${$.getClass("sheet")}-container`,$.container.appendChild(Z),$.element.appendChild($.container),{...$,content:{setContent(q){return Z.innerHTML=q,this},getContent(){return Z.innerHTML},getElement(){return Z}}}};var dJ=(J)=>($)=>{let{title:Q=""}=J,Z=null;if(Q||J.dragHandle){if(Z=document.createElement("div"),Z.className=`${$.getClass("sheet")}-title`,Q)Z.textContent=Q;if($.container.insertBefore(Z,$.container.firstChild),J.dragHandle){let q=document.createElement("div");q.className=`${$.getClass("sheet")}-handle`,$.container.insertBefore(q,$.container.firstChild),$.dragHandle={element:q,setVisible(j){q.style.display=j?"block":"none"}}}}return{...$,title:{setTitle(q){if(!Z&&q)Z=document.createElement("div"),Z.className=`${$.getClass("sheet")}-title`,$.container.insertBefore(Z,$.content.getElement());if(Z)Z.textContent=q;return this},getTitle(){return Z?Z.textContent||"":""},getElement(){return Z}}}};var lJ=(J)=>($)=>{let{open:Q=!1,dismissible:Z=!0}=J,q=Q,j=document.createElement("div");if(j.className=`${$.getClass("sheet")}-scrim`,$.element.parentNode?.insertBefore(j,$.element.nextSibling),Z)$.element.classList.add(`${$.getClass("sheet")}--dismissible`),j.addEventListener("click",()=>{if(Z)G()});if(Q)$.element.classList.add(`${$.getClass("sheet")}--open`);if(J.elevation)$.element.classList.add(`${$.getClass("sheet")}--elevation-${J.elevation}`);document.addEventListener("keydown",(W)=>{if(W.key==="Escape"&&q&&Z)G()});function K(){if(!q){if(q=!0,$.element.classList.add(`${$.getClass("sheet")}--open`),$.events.emit(X7.OPEN),J.onOpen)J.onOpen()}}function G(){if(q){if(q=!1,$.element.classList.remove(`${$.getClass("sheet")}--open`),$.events.emit(X7.CLOSE),J.onClose)J.onClose()}}return{...$,state:{open:K,close:G,isOpen(){return q},setDismissible(W){if(W)$.element.classList.add(`${$.getClass("sheet")}--dismissible`);else $.element.classList.remove(`${$.getClass("sheet")}--dismissible`)}},initialize(){if(j.parentNode!==$.element.parentNode)$.element.parentNode?.insertBefore(j,$.element.nextSibling)}}};var rJ=(J)=>($)=>{if(J.enableGestures===!1)return $;let Q=J.position||f6.BOTTOM,Z=0,q=0,j=!1,K=$.dragHandle?.element||$.element,G=(X)=>{if(!$.state.isOpen())return;if(j=!0,document.body.style.userSelect="none",X.type==="touchstart")Z=X.touches[0].clientY,q=X.touches[0].clientX;else Z=X.clientY,q=X.clientX,document.addEventListener("mousemove",W),document.addEventListener("mouseup",z);$.events.emit(X7.DRAG_START)},W=(X)=>{if(!j)return;let _,H;if(X.type==="touchmove")_=X.touches[0].clientY,H=X.touches[0].clientX;else _=X.clientY,H=X.clientX;let B=0;switch(Q){case f6.BOTTOM:if(B=_-Z,B<0)B=0;$.element.style.transform=`translateY(${B}px)`;break;case f6.TOP:if(B=Z-_,B<0)B=0;$.element.style.transform=`translateY(-${B}px)`;break;case f6.LEFT:if(B=q-H,B<0)B=0;$.element.style.transform=`translateX(-${B}px)`;break;case f6.RIGHT:if(B=H-q,B<0)B=0;$.element.style.transform=`translateX(${B}px)`;break}let k=Q===f6.BOTTOM||Q===f6.TOP?$.element.offsetHeight:$.element.offsetWidth,M=Math.min(B/k,1),V=$.element.nextElementSibling;if(V&&V.classList.contains(`${$.getClass("sheet")}-scrim`))V.style.opacity=`${0.32*(1-M)}`},z=()=>{if(!j)return;j=!1,document.body.style.userSelect="",document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",z);let X=Q===f6.BOTTOM||Q===f6.TOP?$.element.offsetHeight:$.element.offsetWidth,_=0;if($.element.style.transform){let H=$.element.style.transform.match(/translate[XY]\(([^p]+)px\)/);_=H?parseFloat(H[1]):0}if(_>X*0.3)$.state.close();else{$.element.style.transform="";let H=$.element.nextElementSibling;if(H&&H.classList.contains(`${$.getClass("sheet")}-scrim`))H.style.opacity=""}$.events.emit(X7.DRAG_END)};K.addEventListener("touchstart",G),K.addEventListener("touchmove",W),K.addEventListener("touchend",z),K.addEventListener("mousedown",G);let Y=()=>{K.removeEventListener("touchstart",G),K.removeEventListener("touchmove",W),K.removeEventListener("touchend",z),K.removeEventListener("mousedown",G),document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",z)},U=$.lifecycle?.destroy||(()=>{});return $.lifecycle={...$.lifecycle,destroy:()=>{Y(),U()}},$};var M2=({state:J,lifecycle:$})=>(Q)=>({...Q,element:Q.element,container:Q.container,open(){return J.open(),this},close(){return J.close(),this},setContent(Z){return Q.content.setContent(Z),this},getContent(){return Q.content.getContent()},setTitle(Z){return Q.title.setTitle(Z),this},getTitle(){return Q.title.getTitle()},setDragHandle(Z){if(Q.dragHandle)Q.dragHandle.setVisible(Z);return this},setMaxHeight(Z){return Q.container.style.maxHeight=Z,this},destroy(){$.destroy()},initialize(){if(Q.initialize)Q.initialize();return this}});t();var A9={STANDARD:"standard",MODAL:"modal",EXPANDED:"expanded"},a9={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"},pJ={OPEN:"open",CLOSE:"close",DRAG_START:"dragstart",DRAG_END:"dragend"},X8={LEVEL_1:1,LEVEL_2:2,LEVEL_3:3,LEVEL_4:4,LEVEL_5:5},F9={VARIANT:A9.STANDARD,POSITION:a9.BOTTOM,OPEN:!1,DISMISSIBLE:!0,DRAG_HANDLE:!0,ELEVATION:X8.LEVEL_3,TITLE:"",CONTENT:"",MAX_HEIGHT:"80%",ENABLE_GESTURES:!0},sJ={DURATION:300,TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",DELAY:0},mJ={MIN_VELOCITY:0.3,MIN_DISTANCE:30,DISMISS_THRESHOLD:0.3},aJ={CONTAINER:"sheet",SCRIM:"sheet__scrim",PANEL:"sheet__panel",DRAG_HANDLE:"sheet__drag-handle",TITLE:"sheet__title",CONTENT:"sheet__content",STANDARD:"sheet--standard",MODAL:"sheet--modal",EXPANDED:"sheet--expanded",BOTTOM:"sheet--bottom",TOP:"sheet--top",LEFT:"sheet--left",RIGHT:"sheet--right",OPEN:"sheet--open",DRAGGING:"sheet--dragging",ELEVATION_PREFIX:"sheet--elevation-"};var Ej={variant:A9.STANDARD,position:a9.BOTTOM,open:F9.OPEN,dismissible:F9.DISMISSIBLE,dragHandle:F9.DRAG_HANDLE,elevation:F9.ELEVATION,enableGestures:F9.ENABLE_GESTURES},k2=(J={})=>d(Ej,J,"sheet"),N2=(J)=>{return p(J,{tag:"div",attributes:{role:"dialog","aria-modal":J.variant===A9.MODAL?"true":"false"},className:J.class,forwardEvents:{click:!0,keydown:!0}})},V2=(J)=>({state:{open:()=>J.state.open(),close:()=>J.state.close()},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var hj=(J={})=>{let $=k2(J);try{let Q=b(S,g(),E(N2($)),K6($),fJ($),gJ($),dJ($),lJ($),rJ($),C(),(Z)=>M2(V2(Z))(Z))($);return Q.initialize(),Q}catch(Q){throw console.error("Sheet creation error:",Q),new Error(`Failed to create sheet: ${Q.message}`)}},cJ=hj;c();o();A6();var iJ=(J)=>($)=>{if(!J.range||!J.secondValue||!$.schema)return $;try{let Q=J.min||0,Z=J.max||100,q=J.secondValue,j=(q-Q)/(Z-Q)*100,K=J.valueFormatter||((X)=>X.toString()),G=J.disabled===!0,W=$.getClass,z=JSON.parse(JSON.stringify($.schema)),Y=z.element.options.className||[];if(Array.isArray(Y))Y.push(W("slider--range"));else z.element.options.className=`${Y} ${W("slider--range")}`.trim();let U=z.element.children.container.children;return U.secondHandle={name:"secondHandle",creator:v,options:{tag:"div",className:W("slider-handle"),attributes:{role:"slider","aria-valuemin":String(Q),"aria-valuemax":String(Z),"aria-valuenow":String(q),"aria-orientation":"horizontal",tabindex:G?"-1":"0","aria-disabled":G?"true":"false","data-value":String(q),"data-handle-index":"1"},style:{left:`${j}%`}}},U.secondValueBubble={name:"secondValueBubble",creator:v,options:{tag:"div",className:W("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"1"},text:K(q),style:{left:`${j}%`}}},{...$,schema:z}}catch(Q){return console.warn("Error enhancing structure with range functionality:",Q),$}};var J9={PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",ERROR:"error"},D6={XS:16,S:24,M:40,L:56,XL:80},Z6={HANDLE_SIZE:16,SMALL_HANDLE_HEIGHT:48,HANDLE_HEIGHT_OFFSET:16,MIN_HEIGHT:40,TRACK_RADIUS:3,SMALL_TRACK_EXTERNAL_RADIUS:10,LARGE_TRACK_RADIUS_RATIO:0.35,TICK_SIZE:4,DOT_SIZE:4,HANDLE_GAP:8,HANDLE_GAP_PRESSED_REDUCTION:2,CENTER_GAP:4,EDGE_PADDING:7},H6={CHANGE:"change",INPUT:"input",FOCUS:"focus",BLUR:"blur",START:"start",END:"end"},K$={START:"start",END:"end"},N6={MIN:0,MAX:100,VALUE:0,STEP:1,DISABLED:!1,COLOR:J9.PRIMARY,SIZE:"XS",TICKS:!1,SHOW_VALUE:!0,SNAP_TO_STEPS:!0,RANGE:!1,CENTERED:!1,ICON_POSITION:K$.START,LABEL_POSITION:K$.START},oJ={ROOT:"slider",CONTAINER:"slider__container",FILL:"slider__fill",HANDLE:"slider__handle",HANDLE_SECOND:"slider__handle--second",LABEL:"slider__label",VALUE:"slider__value",ICON:"slider__icon",DISABLED:"slider--disabled",FOCUSED:"slider--focused",DRAGGING:"slider--dragging",RANGE:"slider--range",PRIMARY:"slider--primary",SECONDARY:"slider--secondary",TERTIARY:"slider--tertiary",ERROR:"slider--error"};var tJ=(J)=>($)=>{if(J.disabled===!0)setTimeout(()=>{Z()},0);function Z(){if($.element.classList.add(`${$.getClass("slider")}--disabled`),$.element.setAttribute("aria-disabled","true"),$.structure?.handle)$.structure.handle.tabIndex=-1,$.structure.handle.setAttribute("aria-disabled","true");if(J.range&&$.structure?.secondHandle)$.structure.secondHandle.tabIndex=-1,$.structure.secondHandle.setAttribute("aria-disabled","true");if($.drawCanvas)$.drawCanvas()}function q(){if($.element.classList.remove(`${$.getClass("slider")}--disabled`),$.element.setAttribute("aria-disabled","false"),$.structure?.handle)$.structure.handle.tabIndex=0,$.structure.handle.setAttribute("aria-disabled","false");if(J.range&&$.structure?.secondHandle)$.structure.secondHandle.tabIndex=0,$.structure.secondHandle.setAttribute("aria-disabled","false");if($.drawCanvas)$.drawCanvas()}function j(){return Object.values(J9).find((G)=>$.element.classList.contains(`${$.getClass("slider")}--${G}`))||J9.PRIMARY}function K(){return Object.keys(D6).find((z)=>$.element.classList.contains(`${$.getClass("slider")}--${z.toLowerCase()}`))||"XS"}return{...$,disabled:{enable(){return q(),this},disable(){return Z(),this},isDisabled(){return $.element.classList.contains(`${$.getClass("slider")}--disabled`)}},appearance:{setColor(G){if(Object.values(J9).forEach((W)=>{$.element.classList.remove(`${$.getClass("slider")}--${W}`)}),G!==J9.PRIMARY)$.element.classList.add(`${$.getClass("slider")}--${G}`);return this},getColor(){return j()},setSize(G){Object.keys(D6).forEach((Y)=>{$.element.classList.remove(`${$.getClass("slider")}--${Y.toLowerCase()}`)});let z;if(typeof G==="string"&&G in D6)z=G;else if(typeof G==="number"){let Y=Object.entries(D6).find(([,U])=>U===G);z=Y?Y[0]:"XS"}else z="XS";return $.element.classList.add(`${$.getClass("slider")}--${z.toLowerCase()}`),this},getSize(){return K()},showTicks(G){if(J.ticks=G,$.slider)$.slider.regenerateTicks();return this},showCurrentValue(G){return J.showValue=G,this}}}};var _2=(J,$,Q,Z)=>{let q=$.component?.components||{},{container:j=null,handle:K=null,valueBubble:G=null,secondHandle:W=null,secondValueBubble:z=null}=q,{getValueFromPosition:Y=()=>0,roundToStep:U=(y)=>y,clamp:X=(y)=>y,showValueBubble:_=()=>{},render:H=()=>{}}=Q,{triggerEvent:B=()=>({defaultPrevented:!1})}=Z,k=!1,M=0,V=3,F=null,N=()=>{if($.valueHideTimer)clearTimeout($.valueHideTimer),$.valueHideTimer=null},O=()=>{if(N(),G)_(G,!1);if(z)_(z,!1)},P=(y)=>{if(O(),y&&J.showValue)_(y,!0)},L=(y,l=0)=>{if(N(),!y||!J.showValue)return;if(l>0)$.valueHideTimer=setTimeout(()=>{_(y,!1)},l);else _(y,!1)},D=()=>{if(K)K.classList.remove(`${$.component.getClass("slider-handle")}--focused`);if(W)W.classList.remove(`${$.component.getClass("slider-handle")}--focused`);try{let y=$.component.getClass("slider-handle--focused");if(document.querySelectorAll(`.${y}`).forEach((l)=>{l.classList.remove(y)}),document.activeElement?.classList.contains($.component.getClass("slider-handle")))document.activeElement.blur()}catch(y){console.warn("Error clearing keyboard focus:",y)}},R=(y,l=!1)=>{if(!$.component||$.component.disabled&&$.component.disabled.isDisabled())return;y.preventDefault(),y.stopPropagation(),O(),D(),M=y.type.includes("touch")?y.touches[0].clientX:y.clientX,$.dragging=!1,$.pressed=!0,k=!1,$.activeHandle=l?"second":"first",$.activeBubble=l?z:G,P($.activeBubble),document.addEventListener("mousemove",A),document.addEventListener("mouseup",x),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",x),H(),B(H6.START,y)},w=(y)=>{if(!$.component||$.component.disabled&&$.component.disabled.isDisabled()||!j)return;y.preventDefault(),O(),D();let l=!1;try{let m=y.type.includes("touch")?y.touches[0].clientX:y.clientX,s=Y(m);if(J.snapToSteps&&$.step>0)s=U(s);if(s=X(s,$.min,$.max),J.range&&$.secondValue!==null){let M9=Math.abs(s-$.value);l=Math.abs(s-$.secondValue)<M9,l?$.secondValue=s:$.value=s}else if(J.centered&&$.component.slider&&$.component.slider.setValue)$.component.slider.setValue(s,!1);else $.value=s;H(),B(H6.INPUT,y)}catch(m){console.warn("Error handling track click:",m)}if($.activeHandle=l?"second":"first",$.activeBubble=l?z:G,M=y.type.includes("touch")?y.touches[0].clientX:y.clientX,J.centered&&!J.range)P($.activeBubble),document.addEventListener("mousemove",A),document.addEventListener("mouseup",x),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",x),$.pressed=!1,B(H6.START,y);else $.dragging=!1,$.pressed=!1,k=!1,P($.activeBubble),document.addEventListener("mousemove",A),document.addEventListener("mouseup",x),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",x),H(),B(H6.START,y)},A=(y)=>{if(!$.activeHandle||!j)return;y.preventDefault();try{let l=y.type.includes("touch")?y.touches[0].clientX:y.clientX;if(!k&&Math.abs(l-M)>=V)k=!0,$.dragging=!0,$.component.element.classList.add(`${$.component.getClass("slider")}--dragging`);let m=Y(l);if(J.snapToSteps&&$.step>0)m=U(m);m=X(m,$.min,$.max);let s=$.activeHandle==="second";if(J.range&&$.secondValue!==null)if(s)if(m>=$.value)$.secondValue=m;else L($.activeBubble,0),$.secondValue=$.value,$.value=m,$.activeHandle="first",$.activeBubble=G,P($.activeBubble);else if(m<=$.secondValue)$.value=m;else L($.activeBubble,0),$.value=$.secondValue,$.secondValue=m,$.activeHandle="second",$.activeBubble=z,P($.activeBubble);else{if(J.centered)$.previousValue=$.value;$.value=m}H(),B(H6.INPUT,y)}catch(l){console.warn("Error during slider drag:",l)}},x=(y)=>{if(!$.activeHandle)return;y.preventDefault(),$.dragging=!1,$.pressed=!1,k=!1,$.component.element.classList.remove(`${$.component.getClass("slider")}--dragging`),L($.activeBubble,1000),document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",x),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",x),$.activeHandle=null,H(),B(H6.CHANGE,y),B(H6.END,y)},I=(y,l=!1)=>{if($.component.disabled&&$.component.disabled.isDisabled())return;let m=$.step||1,s=l?$.secondValue:$.value,M9=y.shiftKey?m*10:m;if(y.key==="Tab")return;let L6=!1;switch(y.key){case"ArrowRight":case"ArrowUp":y.preventDefault(),s=Math.min(s+M9,$.max),L6=!0;break;case"ArrowLeft":case"ArrowDown":y.preventDefault(),s=Math.max(s-M9,$.min),L6=!0;break;case"Home":y.preventDefault(),s=$.min,L6=!0;break;case"End":y.preventDefault(),s=$.max,L6=!0;break;case"PageUp":y.preventDefault(),s=Math.min(s+m*10,$.max),L6=!0;break;case"PageDown":y.preventDefault(),s=Math.max(s-m*10,$.min),L6=!0;break;default:return}if(!L6)return;if($.activeBubble=l?z:G,P($.activeBubble),l)$.secondValue=s;else{if(J.centered)$.previousValue=$.value;$.value=s}H(),B(H6.INPUT,y),B(H6.CHANGE,y)},r=(y,l=!1)=>{if($.component.disabled&&$.component.disabled.isDisabled())return;let m=l?W:K;if(F&&F!==m)O();F=m,m.classList.add(`${$.component.getClass("slider-handle")}--focused`),P(l?z:G),$.activeBubble=l?z:G,B(H6.FOCUS,y)},a=(y,l=!1)=>{(l?W:K).classList.remove(`${$.component.getClass("slider-handle")}--focused`);let s=y.relatedTarget;if(!s||s!==(l?K:W))L(l?z:G,200);B(H6.BLUR,y)};return{handleHandleMouseDown:R,handleTrackMouseDown:w,handleMouseMove:A,handleMouseUp:x,handleKeyDown:I,handleFocus:r,handleBlur:a,setupEventListeners:()=>{if(!$.component||!$.component.components){console.warn("Cannot set up event listeners: missing component structure");return}if(j.addEventListener("mousedown",w),j.addEventListener("touchstart",w,{passive:!1}),K.addEventListener("mousedown",(y)=>R(y,!1)),K.addEventListener("touchstart",(y)=>R(y,!1),{passive:!1}),K.addEventListener("keydown",(y)=>I(y,!1)),K.addEventListener("focus",(y)=>r(y,!1)),K.addEventListener("blur",(y)=>a(y,!1)),J.range&&W)W.addEventListener("mousedown",(y)=>R(y,!0)),W.addEventListener("touchstart",(y)=>R(y,!0),{passive:!1}),W.addEventListener("keydown",(y)=>I(y,!0)),W.addEventListener("focus",(y)=>r(y,!0)),W.addEventListener("blur",(y)=>a(y,!0))},cleanupEventListeners:()=>{if(!$.component||!$.component.components)return;if(j)j.removeEventListener("mousedown",w),j.removeEventListener("touchstart",w);if(K)K.removeEventListener("mousedown",(y)=>R(y,!1)),K.removeEventListener("touchstart",(y)=>R(y,!1)),K.removeEventListener("keydown",(y)=>I(y,!1)),K.removeEventListener("focus",(y)=>r(y,!1)),K.removeEventListener("blur",(y)=>a(y,!1));if(J.range&&W)W.removeEventListener("mousedown",(y)=>R(y,!0)),W.removeEventListener("touchstart",(y)=>R(y,!0)),W.removeEventListener("keydown",(y)=>I(y,!0)),W.removeEventListener("focus",(y)=>r(y,!0)),W.removeEventListener("blur",(y)=>a(y,!0));document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",x),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",x)},showActiveBubble:P,hideActiveBubble:L,hideAllBubbles:O,clearKeyboardFocus:D}};var nJ=(J)=>($)=>{if(!$.element||!$.components)return console.warn("Cannot initialize slider controller: missing element or components"),$;let Q={component:$,value:J.value!==void 0?J.value:0,secondValue:J.secondValue!==void 0?J.secondValue:null,min:J.min!==void 0?J.min:0,max:J.max!==void 0?J.max:100,step:J.step!==void 0?J.step:1,dragging:!1,pressed:!1,activeHandle:null,activeBubble:null,valueHideTimer:null},Z={triggerEvent(N,O=null){let P={slider:Q.component,value:Q.value,secondValue:Q.secondValue,originalEvent:O,preventDefault:()=>{P.defaultPrevented=!0},defaultPrevented:!1};return Q.component.emit(N,P),P}},q=()=>{if(!Q.component?.components)return{};return Q.component.components},j=(N)=>{let O=Q.max-Q.min;return O===0?0:(N-Q.min)/O*100},K=()=>{let N=q(),{handle:O,container:P}=N;if(!O||!P)return null;try{let L=O.getBoundingClientRect(),D=P.getBoundingClientRect(),R=L.width||Z6.HANDLE_SIZE,w=D.width,A=Z6.EDGE_PADDING/w*100,I=(Q.activeHandle?6:8)/w*100;return{handleSize:R,trackSize:w,edgeConstraint:A,paddingPercent:I}}catch(L){return console.warn("Error calculating track dimensions:",L),{handleSize:Z6.HANDLE_SIZE,trackSize:200,edgeConstraint:3,paddingPercent:4}}},G=(N,O=200)=>{let P=Z6.EDGE_PADDING/O*100,L=P,D=100-P,R=D-L;if(N<=0)return L;if(N>=100)return D;return L+N/100*R},W=(N)=>{let O=q(),{handle:P,container:L}=O;if(!P||!L)return Q.min;try{let D=L.getBoundingClientRect(),R=Q.max-Q.min,w=D.left+Z6.EDGE_PADDING,A=D.right-Z6.EDGE_PADDING,x=A-w,r=(Math.max(w,Math.min(A,N))-w)/x;return Q.min+r*R}catch(D){return console.warn("Error calculating value from position:",D),Q.min}},z=(N)=>{let O=Q.step;if(!O||O<=0)return N;let P=Math.round((N-Q.min)/O);return Q.min+P*O},Y=(N,O,P)=>Math.min(Math.max(N,O),P),U=()=>{let N=q(),{handle:O,container:P,valueBubble:L,secondHandle:D,secondValueBubble:R}=N;if(!O||!P)return;let w=K();if(!w)return;let{trackSize:A}=w,x=j(Q.value),I=G(x,A);if(O.style.left=`${I}%`,O.style.transform="translate(-50%, -50%)",L)L.style.left=`${I}%`,L.style.transform="translateX(-50%)";if(J.range&&D&&Q.secondValue!==null){let r=j(Q.secondValue),a=G(r,A);if(D.style.left=`${a}%`,D.style.transform="translate(-50%, -50%)",R)R.style.left=`${a}%`,R.style.transform="translateX(-50%)"}if(O)O.setAttribute("aria-valuenow",String(Q.value))},X=()=>{let N=q(),{valueBubble:O,secondValueBubble:P}=N;if(!O)return;let L=J.valueFormatter||((D)=>D.toString());if(O.textContent=L(Q.value),J.range&&P&&Q.secondValue!==null)P.textContent=L(Q.secondValue)},_=(N,O)=>{if(!N||!J.showValue)return;let P=Q.component.getClass("slider-value");N.classList[O?"add":"remove"](`${P}--visible`)},H=()=>{},B=()=>{},k=()=>{try{if(U(),X(),$.drawCanvas)$.drawCanvas(Q)}catch(N){console.warn("Error rendering UI:",N)}},V=_2(J,Q,{getPercentage:j,getValueFromPosition:W,roundToStep:z,clamp:Y,showValueBubble:_,updateUi:k,render:k},Z),F=()=>{try{if(!$.components||!$.components.handle){console.warn("Cannot initialize slider controller: missing required components");return}$.element.setAttribute("aria-valuemin",String(Q.min)),$.element.setAttribute("aria-valuemax",String(Q.max)),$.element.setAttribute("aria-valuenow",String(Q.value));let{handle:N,secondHandle:O}=$.components;if(N){if(N.setAttribute("aria-valuemin",String(Q.min)),N.setAttribute("aria-valuemax",String(Q.max)),N.setAttribute("aria-valuenow",String(Q.value)),J.range&&O&&Q.secondValue!==null)O.setAttribute("aria-valuemin",String(Q.min)),O.setAttribute("aria-valuemax",String(Q.max)),O.setAttribute("aria-valuenow",String(Q.secondValue))}V.setupEventListeners(),k()}catch(N){console.error("Error initializing slider controller:",N)}};if($.lifecycle){let N=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{V.cleanupEventListeners(),N()}}return setTimeout(()=>{F()},0),{...$,slider:{setValue(N,O=!0){let P=Y(N,Q.min,Q.max);if(Q.value=P,k(),O)Z.triggerEvent(H6.CHANGE);return this},getValue(){return Q.value},setSecondValue(N,O=!0){if(!J.range)return this;let P=Y(N,Q.min,Q.max);if(Q.secondValue=P,k(),O)Z.triggerEvent(H6.CHANGE);return this},getSecondValue(){return J.range?Q.secondValue:null},setMin(N){if(Q.min=N,$.element.setAttribute("aria-valuemin",String(N)),$.components?.handle)$.components.handle.setAttribute("aria-valuemin",String(N));if(J.range&&$.components?.secondHandle)$.components.secondHandle.setAttribute("aria-valuemin",String(N));if(Q.value<N)Q.value=N;if(J.range&&Q.secondValue!==null&&Q.secondValue<N)Q.secondValue=N;if(J.ticks||J.tickLabels)H();return k(),this},getMin(){return Q.min},setMax(N){if(Q.max=N,$.element.setAttribute("aria-valuemax",String(N)),$.components?.handle)$.components.handle.setAttribute("aria-valuemax",String(N));if(J.range&&$.components?.secondHandle)$.components.secondHandle.setAttribute("aria-valuemax",String(N));if(Q.value>N)Q.value=N;if(J.range&&Q.secondValue!==null&&Q.secondValue>N)Q.secondValue=N;if(J.ticks||J.tickLabels)H();return k(),this},getMax(){return Q.max},setStep(N){if(Q.step=N,$.element.classList[N>0?"add":"remove"](`${$.getClass("slider")}--discrete`),J.ticks||J.tickLabels)H(),B();return this},getStep(){return Q.step},regenerateTicks(){return k(),this},updateUi(){return k(),this}}}};Y9();l1();var uj=(J)=>J?.disabled?.isDisabled?.()||J?.element?.classList?.contains?.(`${J?.getClass?.("slider")}--disabled`)||!1,$0=(J,$,Q="track")=>{let Z=uj($),q=J.color||"primary";if(Z){let K=B6("sys-color-on-surface",{fallback:"#000000"});return{primary:v7(K,0.38),secondary:v7(K,0.12)}}if(Q==="tick")return{primary:B6(`sys-color-on-${q}`,{fallback:"#ffffff"}),secondary:B6(`sys-color-${q}`,{fallback:"#1976d2"})};let j=B6(`sys-color-${q}`,{fallback:"#1976d2"});return{primary:j,secondary:v7(j,0.24)}},B8=(J,$,Q)=>(J-$)/(Q-$)*100,b6=(J,$,Q,Z,q,j,K)=>{if(Z>0)C1(J,$,Q,Z,q,j,j,K)},G$=(J)=>{if(typeof J==="number")return Math.max(J,D6.XS);if(typeof J==="string"&&J in D6)return D6[J];return D6.XS},J0=(J)=>{let $=G$(J);if($<=D6.S)return Z6.SMALL_HANDLE_HEIGHT;return $+Z6.HANDLE_HEIGHT_OFFSET},fj=(J)=>{let $=G$(J);if($<=D6.S)return Z6.SMALL_TRACK_EXTERNAL_RADIUS;return $*Z6.LARGE_TRACK_RADIUS_RATIO},L2=(J,$,Q)=>{let Z=G$(Q?.size),q=J0(Q?.size),j=J.parentElement;if(!j)return;let K=Math.max(j.getBoundingClientRect().width||j.offsetWidth,200),G=Math.max(q+20,Z+32,Z6.MIN_HEIGHT);j.style.height=`${G}px`,f1($,K,G)},D2=(J,$)=>{let Q=J.parentElement;if(!Q)throw new Error("Canvas must have a parent element");let Z=G$($?.size),q=J0($?.size),j=Math.max(Q.getBoundingClientRect().width||Q.offsetWidth,200),K=Math.max(q+20,Z+32,Z6.MIN_HEIGHT);return Q.style.height=`${K}px`,u1(J,j,K)},F8=(J,$)=>{let Q=Z6.EDGE_PADDING/$*100,Z=Q,q=100-Q,j=q-Z;if(J<=0)return Z;if(J>=100)return q;return Z+J/100*j},gj=(J,$,Q,Z,q,j)=>{let K=Q/2,G=G$(Z.size),W=fj(Z.size),z=Z6.TRACK_RADIUS,Y=v1(J,0,K-G/2,$,G,W),{primary:U,secondary:X}=$0(Z,j),_=B8(q.value,q.min,q.max),H=F8(_,$),B=q.pressed?Z6.HANDLE_GAP_PRESSED_REDUCTION:0,k=Z6.HANDLE_GAP-B,V=Z6.CENTER_GAP/2/$*100,F=k/$*100;if(Z.centered){let N=B8(0,q.min,q.max),O=F8(N,$),P=Math.abs(H-O)<F,L=q.value>=0;if(P){let D=(H-F)/100*$;if(D>0)b6(J,0,K-G/2,D,G,z,X);let R=(H+F)/100*$,w=$-R;if(w>0)b6(J,R,K-G/2,w,G,z,X)}else if(L){let D=(O-V)/100*$;if(D>0)b6(J,0,K-G/2,D,G,z,X);let R=(O+V)/100*$,w=(H-F)/100*$-R;if(w>0)b6(J,R,K-G/2,w,G,z,U);let A=(H+F)/100*$,x=$-A;if(x>0)b6(J,A,K-G/2,x,G,z,X)}else{let D=(H-F)/100*$;if(D>0)b6(J,0,K-G/2,D,G,z,X);let R=(H+F)/100*$,w=(O-V)/100*$-R;if(w>0)b6(J,R,K-G/2,w,G,z,U);let A=(O+V)/100*$,x=$-A;if(x>0)b6(J,A,K-G/2,x,G,z,X)}}else if(Z.range&&q.secondValue!==null){let N=B8(q.secondValue,q.min,q.max),O=F8(N,$),P=Math.min(H,O),L=Math.max(H,O),D=H<=O,R=q.pressed&&q.activeHandle==="first"?Z6.HANDLE_GAP_PRESSED_REDUCTION:0,w=q.pressed&&q.activeHandle==="second"?Z6.HANDLE_GAP_PRESSED_REDUCTION:0,A=Z6.HANDLE_GAP-R,x=Z6.HANDLE_GAP-w,I=D?A/$*100:x/$*100,r=D?x/$*100:A/$*100,a=(P-I)/100*$;if(a>0)b6(J,0,K-G/2,a,G,z,X);let V6=(P+I)/100*$,i=(L-r)/100*$-V6;if(i>G)b6(J,V6,K-G/2,i,G,z,U);let y=(L+r)/100*$,l=$-y;if(l>0)b6(J,y,K-G/2,l,G,z,X)}else{let N=(H-F)/100*$;if(N>0)b6(J,0,K-G/2,N,G,z,U);let O=(H+F)/100*$,P=$-O;if(P>0)b6(J,O,K-G/2,P,G,z,X)}Y()},dj=(J,$,Q,Z,q,j)=>{if(!Z.ticks)return;let K=Z6.TICK_SIZE,G=Q/2,{primary:W,secondary:z}=$0(Z,j,"tick"),Y=Math.floor((q.max-q.min)/q.step);for(let U=0;U<=Y;U++){let X=q.min+U*q.step;if(X>q.max)continue;let _=B8(X,q.min,q.max),B=F8(_,$)/100*$,k=Math.abs(X-q.value)<q.step*0.1,M=Z.range&&q.secondValue!==null&&Math.abs(X-q.secondValue)<q.step*0.1;if(k||M)continue;let V=!1;if(Z.centered)V=q.value>=0?X>=0&&X<=q.value:X>=q.value&&X<=0;else if(Z.range&&q.secondValue!==null){let F=Math.min(q.value,q.secondValue),N=Math.max(q.value,q.secondValue);V=X>=F&&X<=N}else V=X<=q.value;J.fillStyle=V?W:z,J.globalAlpha=V?1:0.5,J.beginPath(),J.arc(B,G,K/2,0,Math.PI*2),J.fill()}J.globalAlpha=1},lj=(J,$,Q,Z,q)=>{if(Z.ticks)return;let j=Z6.DOT_SIZE,K=Q/2,G=Z6.EDGE_PADDING,{primary:W}=$0(Z,q,"dot");J.fillStyle=W,J.beginPath(),J.arc($-G,K,j/2,0,Math.PI*2),J.fill()},eJ=(J,$,Q,Z)=>{let{ctx:q,width:j,height:K}=J;if(j===0||K===0)return;E1(q,j,K),lj(q,j,K,$,Z),gj(q,j,K,$,Q,Z),dj(q,j,K,$,Q,Z)},O2=(J,$)=>{let Q=J0($),{handle:Z,secondHandle:q}=J.components||{};if(Z)Z.style.height=`${Q}px`;if(q)q.style.height=`${Q}px`},rj=(J,$,Q)=>{if(J)return{value:J.value,secondValue:J.secondValue,min:J.min,max:J.max,step:J.step,pressed:J.pressed||!1,activeHandle:J.activeHandle||null};if($?.slider)return{value:$.slider.getValue(),secondValue:$.slider.getSecondValue(),min:$.slider.getMin(),max:$.slider.getMax(),step:$.slider.getStep(),pressed:!1,activeHandle:null};return Q||{value:0,secondValue:null,min:0,max:100,step:1,pressed:!1,activeHandle:null}},Q0=(J)=>($)=>{let Q=d1(`${$.getClass("slider-canvas")}`,{zIndex:"1"}),Z=$.components?.container;if(Z)Z.insertBefore(Q,Z.firstChild);else $.element.appendChild(Q);let q=null,j=null,K=null,G=J.size||"XS",W=rj(null,$,{value:J.value||0,secondValue:J.secondValue||null,min:J.min||0,max:J.max||100,step:J.step||1,pressed:!1,activeHandle:null}),z={animatedValue:W.value,animatedSecondValue:W.secondValue,targetValue:W.value,targetSecondValue:W.secondValue,startValue:W.value,startSecondValue:W.secondValue,startTime:0,duration:h1.MEDIUM,animationFrame:null};if($.animationState=z,g1(()=>{try{return q=D2(Q,{...J,size:G}),$.ctx=q.ctx,!0}catch(k){return console.warn("Slider canvas initialization failed:",k),!1}},()=>{O2($,G)}),J.color&&J.color!=="primary")$.element.classList.add(`${$.getClass("slider")}--${J.color}`);$.canvas=Q;let Y=()=>{if(!q)return;eJ(q,{...J,size:G},{...W,value:z.animatedValue,secondValue:z.animatedSecondValue},$)},U=(k)=>{if(!q)return;let V=(k||performance.now())-z.startTime,F=Math.min(V/z.duration,1),N=f$(F),O=z.startValue,P=z.targetValue;if(z.animatedValue=O+(P-O)*N,z.targetSecondValue!==null&&z.animatedSecondValue!==null){let{startSecondValue:L,targetSecondValue:D}=z;z.animatedSecondValue=L+(D-L)*N}if(Y(),F<1)z.animationFrame=requestAnimationFrame((L)=>U(L));else z.animationFrame=null},X=(k)=>{if(!q){console.warn("Canvas context not ready");return}L2(Q,q,{...J,size:G});let M,V=!1;if(k)M={value:k.value,secondValue:k.secondValue,min:k.min,max:k.max,step:k.step,pressed:k.pressed||!1,activeHandle:k.activeHandle||null},V=k.dragging||!1,W={...M};else if($.slider)M={value:$.slider.getValue(),secondValue:$.slider.getSecondValue(),min:$.slider.getMin(),max:$.slider.getMax(),step:$.slider.getStep()},W={...M};else M={...W};let F=M.value!==z.targetValue,N=M.secondValue!==z.targetSecondValue;if((F||N)&&!V){if(z.startValue=z.animatedValue,z.startSecondValue=z.animatedSecondValue,z.targetValue=M.value,z.targetSecondValue=M.secondValue,z.animationFrame)cancelAnimationFrame(z.animationFrame);z.startTime=performance.now(),U()}else if(V){if(z.animatedValue=M.value,z.animatedSecondValue=M.secondValue,z.targetValue=M.value,z.targetSecondValue=M.secondValue,z.startValue=M.value,z.startSecondValue=M.secondValue,z.animationFrame)cancelAnimationFrame(z.animationFrame),z.animationFrame=null;eJ(q,{...J,size:G},k||M,$)}else eJ(q,{...J,size:G},k||M,$)},_=()=>{if(!q)return;try{let k=D2(Q,{...J,size:G});$.ctx=k.ctx,Object.assign(q,k),Y()}catch(k){console.warn("Slider canvas resize failed:",k)}};j=C7($.element,Q,_);let H=()=>Y();K=g$(J.color||"primary",H),requestAnimationFrame(()=>{X()}),$.drawCanvas=X,$.resize=_,$.setSize=(k)=>{if(G=k,q)L2(Q,q,{...J,size:G}),Y();O2($,G)},$.getSize=()=>G;let B=$.appearance?.setColor;if(B)$.appearance.setColor=(k)=>{if(B(k),J.color&&J.color!=="primary")$.element.classList.remove(`${$.getClass("slider")}--${J.color}`);if(k&&k!=="primary")$.element.classList.add(`${$.getClass("slider")}--${k}`);if(J.color=k,K)K(),K=null;K=g$(k,H),X()};if($.lifecycle){let k=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{if(j)j();if(K)K();if(z.animationFrame)cancelAnimationFrame(z.animationFrame);k()}}return $};var P2=(J)=>($)=>{return{...$,element:$.element,setValue(Q,Z=!0){return J.slider.setValue(Q,Z),this},getValue(){return J.slider.getValue()},setSecondValue(Q,Z=!0){return J.slider.setSecondValue(Q,Z),this},getSecondValue(){return J.slider.getSecondValue()},setMin(Q){return J.slider.setMin(Q),this},getMin(){return J.slider.getMin()},setMax(Q){return J.slider.setMax(Q),this},getMax(){return J.slider.getMax()},setStep(Q){return J.slider.setStep(Q),this},getStep(){return J.slider.getStep()},enable(){return J.disabled.enable(),this},disable(){return J.disabled.disable(),this},isDisabled(){return J.disabled.isDisabled()},setColor(Q){return J.appearance.setColor(Q),this},getColor(){return J.appearance.getColor()},setSize(Q){return J.appearance.setSize(Q),this},getSize(){return J.appearance.getSize()},showTicks(Q){return J.appearance.showTicks(Q),this},showCurrentValue(Q){return J.appearance.showCurrentValue(Q),this},setLabel(Q){if(J.text?.setText)J.text.setText(Q);return this},getLabel(){return J.text?.getText?J.text.getText():""},setIcon(Q){if(J.icon?.setIcon)J.icon.setIcon(Q);return this},getIcon(){return J.icon?.getIcon?J.icon.getIcon():""},on(Q,Z){if(J.events?.on)J.events.on(Q,Z);return this},off(Q,Z){if(J.events?.off)J.events.off(Q,Z);return this},destroy(){if(J.lifecycle?.destroy)J.lifecycle.destroy()}}};t();function R2(J,$){let Q=(z)=>J.getClass(z),Z=$.min||0,q=$.max||100,j=$.value!==void 0?$.value:Z,K=$.disabled===!0,G=$.valueFormatter||((z)=>z.toString()),W=(j-Z)/(q-Z)*100;return{element:{options:{className:[Q("slider"),$.class].filter(Boolean),attributes:{tabindex:"-1",role:"none","aria-disabled":K?"true":"false"}},children:{container:{options:{className:Q("slider-container"),style:{position:"relative"}},children:{handle:{options:{className:Q("slider-handle"),attributes:{role:"slider","aria-valuemin":String(Z),"aria-valuemax":String(q),"aria-valuenow":String(j),"aria-orientation":"horizontal",tabindex:K?"-1":"0","aria-disabled":K?"true":"false","data-value":String(j),"data-handle-index":"0"},style:{left:`${W}%`}}},valueBubble:{options:{className:Q("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"0"},text:G(j),style:{left:`${W}%`}}}}}}}}}var pj={min:N6.MIN,max:N6.MAX,value:N6.VALUE,step:N6.STEP,disabled:N6.DISABLED,color:N6.COLOR,size:N6.SIZE,ticks:N6.TICKS,showValue:N6.SHOW_VALUE,snapToSteps:N6.SNAP_TO_STEPS,range:N6.RANGE,centered:N6.CENTERED,iconPosition:N6.ICON_POSITION,labelPosition:N6.LABEL_POSITION,valueFormatter:(J)=>J.toString()},A2=(J={})=>{let $=d(pj,J,"slider"),Q={componentName:"slider",config:$,getClass:(Z)=>{return`${$.prefix||"mtrl"}-${Z}`}};return $.schema=R2(Q,$),$};var w2=(J)=>({slider:{setValue:($,Q)=>J.slider?.setValue($,Q),getValue:()=>J.slider?.getValue()??0,setSecondValue:($,Q)=>J.slider?.setSecondValue($,Q),getSecondValue:()=>J.slider?.getSecondValue()??null,setMin:($)=>J.slider?.setMin($),getMin:()=>J.slider?.getMin()??0,setMax:($)=>J.slider?.setMax($),getMax:()=>J.slider?.getMax()??100,setStep:($)=>J.slider?.setStep($),getStep:()=>J.slider?.getStep()??1,regenerateTicks:()=>J.slider?.regenerateTicks?.()},disabled:{enable:()=>J.disabled?.enable?.(),disable:()=>J.disabled?.disable?.(),isDisabled:()=>J.disabled?.isDisabled?.()??!1},appearance:{setColor:($)=>J.appearance?.setColor?.($),getColor:()=>J.appearance?.getColor?.()??"primary",setSize:($)=>J.setSize?.($),getSize:()=>J.getSize?.()??"XS",showTicks:($)=>J.appearance?.showTicks?.($),showCurrentValue:($)=>J.appearance?.showCurrentValue?.($)},text:{setText:($)=>J.label?.setText?.($),getText:()=>J.label?.getText?.()??""},icon:{setIcon:($)=>J.icon?.setIcon?.($),getIcon:()=>J.icon?.getIcon?.()??""},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var sj=(J={})=>{let $=A2(J);try{let Q=b(S,g(),n7($),ZJ($),e7($),iJ($),$$(),Q0($),tJ($),nJ($),C())($),Z=w2(Q),q=P2(Z)(Q);if($.on&&typeof q.on==="function")Object.entries($.on).forEach(([j,K])=>{if(typeof K==="function")q.on(j,K)});return q}catch(Q){throw console.error("Slider creation error:",Q),new Error(`Failed to create slider: ${Q.message}`)}},Z0=sj;J6();c();var x2=(J)=>($)=>{if(!J.action)return $;let Q=document.createElement("button");return Q.className=`${J.prefix}-snackbar-action`,Q.textContent=J.action,$.element.appendChild(Q),{...$,actionButton:Q}},y2=(J)=>($)=>{let Q=null,Z=()=>{if(Q)clearTimeout(Q),Q=null;if(typeof J.duration==="number"&&J.duration>0)Q=window.setTimeout(()=>{if($.element&&$.emit)$.emit("dismiss")},J.duration)},q=()=>{if(Q)clearTimeout(Q),Q=null},j=$.lifecycle?.destroy;if($.lifecycle)$.lifecycle.destroy=()=>{if(q(),j)j.call($.lifecycle)};return{...$,timer:{start:Z,stop:q}}};var H8={BASIC:"basic",ACTION:"action"},Q9={CENTER:"center",START:"start",END:"end"},q0={VISIBLE:"visible",HIDDEN:"hidden"},j0={OPEN:"open",CLOSE:"close",ACTION:"action",DISMISS:"dismiss"},c9={VARIANT:H8.BASIC,POSITION:Q9.CENTER,DURATION:4000,Z_INDEX:1000,ANIMATION_DURATION:300},K0={ROOT:"snackbar",BASIC:"snackbar--basic",ACTION:"snackbar--action",CENTER:"snackbar--center",START:"snackbar--start",END:"snackbar--end",VISIBLE:"snackbar--visible",HIDDEN:"snackbar--hidden",MESSAGE:"snackbar__message",ACTION_BUTTON:"snackbar__action"};var T2=(J)=>($)=>{let Q=J.position||Q9.CENTER,Z=J.prefix||"mtrl",q=`${Z}-snackbar--${Q}`;$.element.classList.add(q);let j=(K)=>{$.element.classList.remove(q);let G=`${Z}-snackbar--${K}`;if($.element.classList.add(G),$.element.classList.contains(`${Z}-snackbar--visible`))if(K===Q9.CENTER)$.element.style.transform="translateX(-50%) scale(1)";else $.element.style.transform="scale(1)"};return{...$,position:{getPosition:()=>Q,setPosition:(K)=>{if(Object.values(Q9).includes(K))return j(K),$;else return console.warn(`Invalid position: ${K}. Using default: ${Q9.CENTER}`),j(Q9.CENTER),$}}}};o();var I2=({lifecycle:J,queue:$})=>(Q)=>{if(!$)throw new Error("Snackbar queue is required");let Z=!1,q={element:Q.element,actionButton:Q.actionButton,timer:Q.timer,position:Q.position,state:Z?"visible":"hidden",show(){if(Z)return this;return Z=!0,this.state="visible",$.add({...this,_show:()=>{document.body.appendChild(Q.element);let j=Q.element.offsetHeight;if(Q.element.classList.add(`${Q.getClass?.("snackbar")}--visible`),Q.timer)Q.timer.start();return this}}),this},hide(){if(!Z)return this;if(Z=!1,this.state="hidden",Q.timer)Q.timer.stop();let j=(K)=>{if(K.propertyName!=="opacity")return;if(Q.element.removeEventListener("transitionend",j),Q.element.parentNode)Q.element.remove()};return Q.element.addEventListener("transitionend",j),Q.element.classList.remove(`${Q.getClass?.("snackbar")}--visible`),this},setMessage(j){return Q.text?.setText(j),this},getMessage(){return Q.text?.getText()||""},setAction(j){if(Q.actionButton)Q.actionButton.textContent=j;return this},getAction(){return Q.actionButton?Q.actionButton.textContent||"":""},setDuration(){return this},getDuration(){return 0},setPosition(j){if(Q.position?.setPosition)Q.position.setPosition(j);return this},getPosition(){return Q.position?.getPosition?.()||"center"},on(j,K){return Q.on?.(j,K),this},off(j,K){return Q.off?.(j,K),this},destroy(){if(Z&&Q.element.parentNode)Q.element.remove();if(Q.timer)Q.timer.stop();J.destroy()}};if(Q.actionButton)Q.actionButton.addEventListener("click",()=>{Q.emit?.("action"),Q.emit?.("dismiss")});if(Q.on){let j=()=>{if(Z)q.hide()};Q.on("dismiss",j);let K=J.destroy;J.destroy=()=>{Q.off?.("dismiss",j),K?.call(J)}}return q};var S2=()=>{let J=[],$=!1,Q=()=>{if(J.length===0){$=!1;return}$=!0;let Z=J[0],q=()=>{if(J.shift(),Z.off?.("dismiss",q),J.length===0)$=!1;else setTimeout(Q,200)};Z.on?.("dismiss",q),Z._show()};return{add(Z){if(!Z._show)throw new Error("Snackbar must implement _show method");if(J.push(Z),!$)Q()},clear(){J.length=0,$=!1},getLength(){return J.length}}};t();var mj={variant:c9.VARIANT,position:c9.POSITION,duration:c9.DURATION},b2=(J)=>d(mj,J,"snackbar"),v2=(J)=>p(J,{tag:"div",className:J.class}),C2=(J)=>({...J,text:J.message}),E2=(J,$)=>({lifecycle:{destroy:J.lifecycle?.destroy||(()=>{})},queue:$});var aj=S2(),cj=(J)=>{if(!J.message)throw new Error("Snackbar message is required");let $=b2(J);try{return b(S,g(),E(v2($)),K6($),T2($),K9(C2($)),x2($),C(),y2($),(Z)=>I2(E2(Z,aj))(Z))($)}catch(Q){throw console.error("Snackbar creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create snackbar: ${Q instanceof Error?Q.message:String(Q)}`)}},G0=cj;J6();c();o();var h2=({disabled:J,lifecycle:$,checkable:Q})=>(Z)=>({...Z,element:Z.element,input:Z.input,getValue:Z.getValue||(()=>""),setValue(q){return Z.setValue?.(q),this},check(){return Q.check(),this},uncheck(){return Q.uncheck(),this},toggle(){return Q.toggle(),this},isChecked(){return Q.isChecked()},setLabel(q){return Z.text?.setText(q),this},getLabel(){return Z.text?.getText()||""},supportingTextElement:Z.supportingTextElement||null,setSupportingText(q,j){if(Z.setSupportingText)Z.setSupportingText(q,j);return this},removeSupportingText(){if(Z.removeSupportingText)Z.removeSupportingText();return this},on(q,j){return Z.on?.(q,j),this},off(q,j){return Z.off?.(q,j),this},enable(){return J.enable(),this},disable(){return J.disable(),this},destroy(){$.destroy()}});o();var u2=(J,$,Q)=>{let Z=$||"mtrl",q=Q||"switch",j=J.element.querySelector(`.${Z}-${q}-container`);if(!j){j=document.createElement("div"),j.className=`${Z}-${q}-container`;let G=J.element.querySelector(`.${Z}-${q}-input`),W=J.element.querySelector(`.${Z}-${q}-track`),z=[];if(G)z.push(G);if(W)z.push(W);let Y=document.createElement("div");Y.className=`${Z}-${q}-content`;let U=J.element.querySelector(`.${Z}-${q}-label`);if(U)Y.appendChild(U);return j.appendChild(Y),z.forEach((X)=>j.appendChild(X)),J.element.appendChild(j),{container:j,contentWrapper:Y}}let K=J.element.querySelector(`.${Z}-${q}-content`);if(!K){K=document.createElement("div"),K.className=`${Z}-${q}-content`;let G=J.element.querySelector(`.${Z}-${q}-label`);if(G)K.appendChild(G);j.insertBefore(K,j.firstChild)}return{container:j,contentWrapper:K}},M8=(J)=>($)=>{let Q=J.prefix||"mtrl",Z=J.componentName||"switch",{contentWrapper:q}=u2($,Q,Z),j=null;if(J.supportingText){if(j=document.createElement("div"),j.className=`${Q}-${Z}-helper`,j.textContent=J.supportingText,J.error)j.classList.add(`${Q}-${Z}-helper--error`),$.element.classList.add(`${Q}-${Z}--error`);q.appendChild(j)}if("lifecycle"in $&&$.lifecycle&&typeof $.lifecycle==="object"&&"destroy"in $.lifecycle&&j){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(j)j.remove();K.call($.lifecycle)}}return{...$,supportingTextElement:j,setSupportingText(K,G=!1){let{contentWrapper:W}=u2($,Q,Z),z=this.supportingTextElement;if(!z)z=document.createElement("div"),z.className=`${Q}-${Z}-helper`,W.appendChild(z),this.supportingTextElement=z;return z.textContent=K,z.classList.toggle(`${Q}-${Z}-helper--error`,G),$.element.classList.toggle(`${Q}-${Z}--error`,G),this},removeSupportingText(){if(this.supportingTextElement&&this.supportingTextElement.parentNode)this.supportingTextElement.remove(),this.supportingTextElement=null,$.element.classList.remove(`${Q}-${Z}--error`);return this}}},f2=(J)=>($)=>{let Q={...J,prefix:J.prefix||"mtrl",componentName:J.componentName||"switch"};return A7(Q)($)};t();var ij={prefix:"mtrl",componentName:"switch"},g2=(J={})=>d(ij,J,"switch"),d2=(J)=>p(J,{tag:"div",className:J.class,interactive:!0}),l2=(J)=>({disabled:{enable:J.disabled?.enable,disable:J.disabled?.disable},lifecycle:{destroy:J.lifecycle?.destroy},checkable:{check:J.checkable?.check,uncheck:J.checkable?.uncheck,toggle:J.checkable?.toggle,isChecked:J.checkable?.isChecked}});var oj=(J={})=>{let $=g2(J);try{return b(S,g(),E(d2($)),z9($),I9($),f2($),M8($),S9($),G6($),C(),(Z)=>h2(l2(Z))(Z))($)}catch(Q){throw console.error("Switch creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create switch: ${Q instanceof Error?Q.message:String(Q)}`)}},z0=oj;var k8={START:"start",END:"end"},W0={CHECKED:"checked",UNCHECKED:"unchecked",DISABLED:"disabled",ENABLED:"enabled"},Y0={CHANGE:"change",FOCUS:"focus",BLUR:"blur"},U0={CHECKED:!1,DISABLED:!1,REQUIRED:!1,LABEL_POSITION:k8.END,VALUE:"on"},X0={ROOT:"switch",CONTAINER:"switch-container",CONTENT:"switch-content",LABEL:"switch-label",INPUT:"switch-input",TRACK:"switch-track",THUMB:"switch-thumb",LABEL_START:"switch--label-start",LABEL_END:"switch--label-end",CHECKED:"switch--checked",DISABLED:"switch--disabled",ERROR:"switch--error",HELPER:"switch-helper",HELPER_ERROR:"switch-helper--error",FOCUSED:"switch--focused"};J6();c();o();J6();c();o();var z$={PRIMARY:"primary",SECONDARY:"secondary"},B7={ACTIVE:"active",INACTIVE:"inactive",DISABLED:"disabled"},N8={FIXED:"fixed",DYNAMIC:"dynamic",CONTENT:"content",AUTO:"auto"},B0={CLICK:"click",FOCUS:"focus",BLUR:"blur"},V8={CHANGE:"change"},w9={VARIANT:z$.PRIMARY,SCROLLABLE:!0,SHOW_DIVIDER:!0,INDICATOR_HEIGHT:3,INDICATOR_WIDTH_STRATEGY:N8.AUTO,INDICATOR_FIXED_WIDTH:40,INDICATOR_ANIMATION_DURATION:250,INDICATOR_ANIMATION_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",ICON_SIZE:"24px",RIPPLE:!0},F7={ICON_ONLY:"icon-only",TEXT_ONLY:"text-only",ICON_AND_TEXT:"icon-and-text"},F0={ROOT:"tabs",PRIMARY:"tabs--primary",SECONDARY:"tabs--secondary",SCROLLABLE:"tabs--scrollable",SCROLL:"tabs-scroll",DIVIDER:"tabs-divider",INDICATOR:"tabs-indicator"},H0={ROOT:"tab",ACTIVE:"tab--active",INACTIVE:"tab--inactive",DISABLED:"tab--disabled",TEXT:"tab-text",ICON:"tab-icon",RIPPLE:"tab-ripple",PRIMARY:"tab--primary",SECONDARY:"tab--secondary",CONTAINER:"tab-container",BADGE:"tab-badge"};t();c();var tj={state:B7.INACTIVE,componentName:"tab",ripple:w9.RIPPLE},nj={variant:w9.VARIANT,scrollable:w9.SCROLLABLE,showDivider:w9.SHOW_DIVIDER,componentName:"tabs"},r2=(J={})=>d(nj,J,"tabs"),p2=(J={})=>d(tj,J,"tab"),s2=(J)=>{let $={tag:"div",attributes:{role:"tablist","aria-orientation":"horizontal"},className:[`${J.prefix}-tabs`,`${J.prefix}-tabs--${J.variant||"primary"}`,J.class]};return(Q)=>E($)(Q)};l9();w7();var H7=(J={})=>{let $=p2(J);try{let Q=b(S,g(),C())($),Z=e6({text:$.text,icon:$.icon,iconSize:$.iconSize,disabled:$.disabled,ripple:$.ripple!==!1,rippleConfig:{duration:400,timing:"cubic-bezier(0.4, 0, 0.2, 1)",opacity:["0.2","0"],...$.rippleConfig||{}},value:$.value,prefix:$.prefix,variant:"text",class:`${$.prefix}-tab`});if(Q.element=Z.element,Q.element.setAttribute("role","tab"),Q.element.setAttribute("aria-selected",$.state==="active"?"true":"false"),$.value)Q.element.setAttribute("id",`tab-${$.value}`),Q.element.setAttribute("aria-controls",`tabpanel-${$.value}`);if($.state==="active")Q.element.classList.add(`${Q.getClass("tab")}--active`);Z.on("click",(j)=>{if(Q.emit)Q.emit("click",j)});let q={...Q,button:Z,element:Z.element,badge:null,getValue(){return Z.getValue()},setValue(j){let K=j||"";return Z.setValue(K),this.element.setAttribute("id",`tab-${K}`),this.element.setAttribute("aria-controls",`tabpanel-${K}`),this},activate(){this.element.classList.add(`${this.getClass("tab")}--active`),this.element.setAttribute("aria-selected","true");let j=new CustomEvent("tab:activated",{bubbles:!0,detail:{value:this.getValue()}});return this.element.dispatchEvent(j),this},deactivate(){return this.element.classList.remove(`${this.getClass("tab")}--active`),this.element.setAttribute("aria-selected","false"),this},isActive(){return this.element.classList.contains(`${this.getClass("tab")}--active`)},enable(){return Z.enable(),this.element.removeAttribute("aria-disabled"),this},disable(){return Z.disable(),this.element.setAttribute("aria-disabled","true"),this},setText(j){return Z.setText(j),this.updateLayoutStyle(),this},getText(){return Z.getText()},setIcon(j){return Z.setIcon(j),this.updateLayoutStyle(),this},getIcon(){return Z.getIcon()},setBadge(j){if(!this.badge){let K={content:j,standalone:!1,target:this.element,prefix:$.prefix,...$.badgeConfig||{}};this.badge=e9(K)}else this.badge.setContent(j),this.badge.show();return this.element.setAttribute("data-has-badge","true"),this},getBadge(){return this.badge?this.badge.getContent():""},showBadge(){if(this.badge)this.badge.show(),this.element.setAttribute("data-has-badge","true");return this},hideBadge(){if(this.badge)this.badge.hide(),this.element.setAttribute("data-has-badge","false");return this},getBadgeComponent(){return this.badge},destroy(){if(this.badge)this.badge.destroy();if(Z.destroy)Z.destroy();Q.lifecycle.destroy()},updateLayoutStyle(){let j=!!this.getText(),K=!!this.getIcon(),G="";if(j&&K)G=F7.ICON_AND_TEXT;else if(K)G=F7.ICON_ONLY;else G=F7.TEXT_ONLY;if(Object.values(F7).forEach((W)=>{this.element.classList.remove(`${this.getClass("tab")}--${W}`)}),this.element.classList.add(`${this.getClass("tab")}--${G}`),G===F7.ICON_ONLY&&j)this.element.setAttribute("aria-label",this.getText());else this.element.removeAttribute("aria-label")}};if($.badge!==void 0)q.setBadge($.badge);return q.updateLayoutStyle(),q}catch(Q){throw console.error("Tab creation error:",Q),new Error(`Failed to create tab: ${Q.message}`)}};var m2=({lifecycle:J})=>($)=>({...$,element:$.element,addTab(Q){let Z={...Q,prefix:$.config.prefix,variant:Q.variant||$.config.variant};if(Z.value===void 0)Z.value="";let q=H7(Z);if($.tabs.push(q),$.tabsContainer.appendChild(q.element),q.on&&typeof q.on==="function")q.on("click",(K)=>$.handleTabClick(K,q));return q.element.addEventListener("click",(K)=>{$.handleTabClick(K,q)}),q},add(Q){if($.tabs.push(Q),$.tabsContainer.appendChild(Q.element),Q.on&&typeof Q.on==="function")Q.on("click",(q)=>$.handleTabClick(q,Q));return Q.element.addEventListener("click",(q)=>{$.handleTabClick(q,Q)}),this},getTabs(){return[...$.tabs]},getActiveTab(){return $.tabs.find((Q)=>Q.isActive())||null},setActiveTab(Q){let Z=typeof Q==="string"?$.tabs.find((q)=>q.getValue()===Q):Q;if(!Z)return this;if($.tabs.forEach((q)=>q.deactivate()),Z.activate(),$.emit)$.emit("change",{tab:Z,value:Z.getValue()});return this},removeTab(Q){let Z=typeof Q==="string"?$.tabs.find((j)=>j.getValue()===Q):Q;if(!Z)return this;let q=$.tabs.indexOf(Z);if(q!==-1)$.tabs.splice(q,1);if(Z.element.parentNode)Z.element.parentNode.removeChild(Z.element);return Z.destroy(),this},on(Q,Z){if($.on)$.on(Q,Z);return this},off(Q,Z){if($.off)$.off(Q,Z);return this},destroy(){$.tabs.forEach((Q)=>Q.destroy()),$.tabs.length=0,J.destroy()}}),a2=(J)=>({lifecycle:{destroy:()=>J.lifecycle.destroy()}});function c2(J){if(typeof J.getActiveTab==="function")return J.getActiveTab();if(Array.isArray(J.tabs))return J.tabs.find(($)=>$.isActive&&$.isActive());return null}function _8(J){let $=c2(J);if(!$)return;if(typeof $.getValue!=="function")return;let Q=$.getValue();document.querySelectorAll('[role="tabpanel"]').forEach((q)=>{if(q.getAttribute("aria-labelledby")?.replace("tab-","")===Q)q.removeAttribute("hidden"),q.setAttribute("tabindex","0");else q.setAttribute("hidden","true"),q.setAttribute("tabindex","-1")})}function L8(J){if(!J.element)return;J.element.addEventListener("keydown",($)=>{if($.target!==$.currentTarget)return;if(typeof J.getTabs!=="function"||typeof J.setActiveTab!=="function")return;let Q=J.getTabs(),Z=c2(J),q=Z?Q.indexOf(Z):-1,j=q;switch($.key){case"ArrowRight":case"ArrowDown":j=q<Q.length-1?q+1:0;break;case"ArrowLeft":case"ArrowUp":j=q>0?q-1:Q.length-1;break;case"Home":j=0;break;case"End":j=Q.length-1;break;default:return}if(j!==q&&Q[j])$.preventDefault(),Q[j].element.focus(),J.setActiveTab(Q[j])})}var ej={widthStrategy:"auto",fixedWidth:40,animationDuration:250,animationTiming:"cubic-bezier(0.4, 0, 0.2, 1)",visible:!0,prefix:"mtrl",variant:"primary"},D8=(J={})=>{let $={...ej,...J},Q=$.prefix||"mtrl",Z=document.createElement("div");if(Z.className=`${Q}-tabs-indicator`,Z.style.transition=`transform ${$.animationDuration}ms ${$.animationTiming},
|
|
31
|
+
width ${$.animationDuration}ms ${$.animationTiming}`,Z.style.width=`${$.fixedWidth}px`,!$.visible)Z.style.opacity="0";let q=null,j=(H)=>{if($.widthStrategy==="auto"){if($.variant==="secondary")return H.element.offsetWidth;let B=H.element.querySelector(`.${Q}-tab-text`)||H.element.querySelector(`.${Q}-button-text`);if(B)return B.clientWidth;return Math.max(H.element.offsetWidth/2,30)}switch($.widthStrategy){case"dynamic":return Math.max(H.element.offsetWidth/2,30);case"content":let B=H.element.querySelector(`.${Q}-button-text`)||H.element.querySelector(`.${Q}-tab-text`);if(B)return Math.max(B.clientWidth,30);return $.fixedWidth||40;case"fixed":default:return $.fixedWidth||40}},K=(H)=>{let B=H.parentElement;if(!B)return console.error("Tab has no parent element, cannot position indicator"),{left:0,width:H.offsetWidth};let k=H.getBoundingClientRect(),M=B.getBoundingClientRect();return{left:k.left-M.left,width:k.width}},G=(H,B)=>{let{left:k,width:M}=K(H.element);if($.variant!=="secondary"&&($.widthStrategy==="auto"||$.widthStrategy==="content")){let V=H.element.querySelector(`.${Q}-tab-text`)||H.element.querySelector(`.${Q}-button-text`);if(V){let F=V.getBoundingClientRect(),N=H.element.getBoundingClientRect(),O=F.left-N.left;return{left:k+O}}}if(B<M)return{left:k+(M-B)/2};return{left:k}},W=(H,B=!1)=>{if(!H||!H.element){console.error("Invalid tab or tab has no element");return}q=H;let k=j(H),{left:M}=G(H,k);if(B)Z.style.transition="none",Z.offsetHeight;if(Z.style.width=`${k}px`,Z.style.transform=`translateX(${M}px)`,B)setTimeout(()=>{Z.style.transition=`transform ${$.animationDuration}ms ${$.animationTiming},
|
|
32
|
+
width ${$.animationDuration}ms ${$.animationTiming}`},10)};return{element:Z,moveToTab:W,show:()=>{Z.style.opacity="1"},hide:()=>{Z.style.opacity="0"},setColor:(H)=>{Z.style.backgroundColor=H},update:()=>{if(q)W(q,!0)},destroy:()=>{if(Z.parentNode)Z.parentNode.removeChild(Z);q=null}}};var O8=(J)=>($)=>{let Q=[],Z=$.scrollContainer||$.element;if(Array.isArray(J.tabs))J.tabs.forEach((G)=>{let W={...G,prefix:J.prefix,variant:G.variant||J.variant},z=H7(W);Q.push(z),Z.appendChild(z.element)});let q=()=>{return[...Q]},j=()=>{return Q.find((G)=>G.isActive())||null},K=(G,W)=>{if(G&&typeof G.preventDefault==="function")G.preventDefault();if(W.disabled&&W.disabled.isDisabled&&W.disabled.isDisabled())return;Q.forEach((Y)=>Y.deactivate()),W.activate();let z=W.getValue();if(_8({tabs:Q,getActiveTab:()=>Q.find((Y)=>Y.isActive())||null}),typeof $.emit==="function")$.emit("change",{tab:W,value:z})};return Q.forEach((G)=>{if(G.on&&typeof G.on==="function")G.on("click",(W)=>K(W,G));G.element.addEventListener("click",(W)=>K(W,G))}),{...$,tabs:Q,tabsContainer:Z,handleTabClick:K,getTabs:q,getActiveTab:j}},P8=(J)=>($)=>{if(J.scrollable===!1)return $;$.element.classList.add(`${$.getClass("tabs")}--scrollable`);let Q=document.createElement("div");Q.className=`${$.getClass("tabs")}-scroll`;while($.element.firstChild)Q.appendChild($.element.firstChild);return $.element.appendChild(Q),{...$,scrollContainer:Q}},R8=(J)=>($)=>{if(J.showDivider===!1)return $;let Q=document.createElement("div");return Q.className=`${$.getClass("tabs")}-divider`,$.element.appendChild(Q),$},A8=(J)=>($)=>{let Q=J.indicator||{},Z=D8({prefix:J.prefix,widthStrategy:Q.widthStrategy||J.indicatorWidthStrategy||"auto",height:Q.height||J.indicatorHeight||3,fixedWidth:Q.fixedWidth||40,animationDuration:Q.animationDuration||250,animationTiming:Q.animationTiming||"cubic-bezier(0.4, 0, 0.2, 1)",color:Q.color,variant:J.variant??"primary"}),q=$.scrollContainer||$.element;if(!q)throw console.error("No scroll container found - cannot add indicator"),new Error("Failed to create tabs: No scroll container found");q.appendChild(Z.element);let j=$.handleTabClick;$.handleTabClick=function(Y,U){if(U.disabled&&U.disabled.isDisabled&&U.disabled.isDisabled())return;j.call(this,Y,U),setTimeout(()=>{Z.moveToTab(U)},10)},setTimeout(()=>{let Y=$.tabs.find((U)=>U.isActive());if(Y)Z.moveToTab(Y,!0)},50);let K=()=>{let Y=$.tabs.find((U)=>U.isActive());if(Y)Z.moveToTab(Y,!0)};if(q)q.addEventListener("scroll",K);let G=new ResizeObserver(()=>{let Y=$.tabs.find((U)=>U.isActive());if(Y)Z.moveToTab(Y,!0)});G.observe(q);let W=new MutationObserver((Y)=>{for(let U of Y)if(U.type==="attributes"&&U.attributeName==="class"&&U.target.classList.contains(`${J.prefix}-tab--active`)){let X=U.target,_=$.tabs.find((H)=>H.element===X);if(_)Z.moveToTab(_)}});if(Array.isArray($.tabs))$.tabs.forEach((Y)=>{if(Y.element)W.observe(Y.element,{attributes:!0})});let z=$.destroy||(()=>{});return $.destroy=function(){if(Z.destroy(),G.disconnect(),W.disconnect(),q)q.removeEventListener("scroll",K);if(typeof z==="function")z.call(this)},{...$,indicator:Z,getIndicator:()=>Z}};var i2=(J)=>{let{tabs:$=[],onChange:Q,indicator:Z}=J,q=null,j=$.find((Y)=>Y.isActive());if(j){if(q=j,Z)setTimeout(()=>{Z.moveToTab(j,!0)},50)}let K=(Y)=>{if(!Y.element)return;let U=Y.element.querySelector(`.${Y.getClass("tab")}-ripple`);if(!U)return;let X=document.createElement("span");X.className="ripple",X.style.width="100%",X.style.height="100%",X.style.left="0",X.style.top="0",X.style.animation="ripple-effect 0.4s cubic-bezier(0.4, 0, 0.2, 1)",U.appendChild(X),setTimeout(()=>{X.remove()},400)};return{activateTab:(Y,U=!1)=>{if(!Y||q===Y)return;if(q)q.deactivate();if(Y.activate(),q=Y,Z)setTimeout(()=>{Z.moveToTab(Y,U)},10);if(!U)K(Y);if(Q)Q({tab:Y,value:Y.getValue()})},getActiveTab:()=>{return q},destroy:()=>{q=null}}},o2=()=>{if(document.getElementById("tab-state-styles"))return;let J=document.createElement("style");J.id="tab-state-styles",J.textContent=`
|
|
33
33
|
@keyframes ripple-effect {
|
|
34
34
|
0% {
|
|
35
35
|
transform: scale(0);
|
|
@@ -40,7 +40,7 @@ var{defineProperty:C8,getOwnPropertyNames:a3,getOwnPropertyDescriptor:c3}=Object
|
|
|
40
40
|
opacity: 0;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
`,document.head.appendChild(J)};var $K=(J={})=>{let $=r2(J);o2();try{let Q=b(S,g(),s2($),P8($),O8($),R8($),A8($),C(),(Z)=>m2(a2(Z))(Z))($);return L8(Q),Q}catch(Q){throw console.error("Tabs creation error:",Q),new Error(`Failed to create tabs: ${Q.message}`)}},t2=$K;var n2=(J,$={})=>{let{enabled:Q=!0,showButtons:Z=!1,appearance:q="fade"}=$;if(!Q)return;let j=J.element.querySelector(`.${J.getClass("tabs")}-scroll`);if(!j)return;let G=document.createElement("div");G.className=`${J.getClass("tabs")}-scroll-indicator ${J.getClass("tabs")}-scroll-indicator--left`,G.classList.add(`${J.getClass("tabs")}-scroll-indicator--${q}`);let K=document.createElement("div");if(K.className=`${J.getClass("tabs")}-scroll-indicator ${J.getClass("tabs")}-scroll-indicator--right`,K.classList.add(`${J.getClass("tabs")}-scroll-indicator--${q}`),J.element.appendChild(G),J.element.appendChild(K),Z){let U=document.createElement("button");U.className=`${J.getClass("tabs")}-scroll-button ${J.getClass("tabs")}-scroll-button--left`,U.setAttribute("aria-label","Scroll tabs left"),U.innerHTML='<svg viewBox="0 0 24 24"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>';let X=document.createElement("button");X.className=`${J.getClass("tabs")}-scroll-button ${J.getClass("tabs")}-scroll-button--right`,X.setAttribute("aria-label","Scroll tabs right"),X.innerHTML='<svg viewBox="0 0 24 24"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',J.element.appendChild(U),J.element.appendChild(X),U.addEventListener("click",()=>{j.scrollBy({left:-100,behavior:"smooth"})}),X.addEventListener("click",()=>{j.scrollBy({left:100,behavior:"smooth"})})}let z=()=>{let{scrollLeft:U,scrollWidth:X,clientWidth:_}=j;if(G.classList.toggle("visible",U>0),K.classList.toggle("visible",U+_<X-1),Z){let H=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--left`),B=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--right`);if(H)H.disabled=U<=0;if(B)B.disabled=U+_>=X-1}};z(),j.addEventListener("scroll",z);let W=new ResizeObserver(z);W.observe(j);let Y=J.destroy;J.destroy=function(){if(W)W.disconnect();if(j.removeEventListener("scroll",z),G.parentNode)G.parentNode.removeChild(G);if(K.parentNode)K.parentNode.removeChild(K);if(Z){let U=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--left`),X=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--right`);if(U&&U.parentNode)U.parentNode.removeChild(U);if(X&&X.parentNode)X.parentNode.removeChild(X)}Y.call(this)}};var k0={SMALL:600,MEDIUM:904,LARGE:1240},e2=(J,$={})=>{if($.responsive===!1)return;let Q={small:$.breakpoints?.small||k0.SMALL,medium:$.breakpoints?.medium||k0.MEDIUM,large:$.breakpoints?.large||k0.LARGE},Z={layout:$.smallScreen?.layout||"icon-only",maxVisibleTabs:$.smallScreen?.maxVisibleTabs||4},q=new Map,j=J.getTabs();j.forEach((W)=>{let Y="text-only";if(W.getIcon()&&W.getText())Y="icon-and-text";else if(W.getIcon())Y="icon-only";q.set(W,Y)});let G=()=>{if(window.innerWidth<Q.small)j.forEach((Y)=>{if(Z.layout==="icon-only"&&!Y.getIcon())return;if(Z.layout==="icon-only"&&Y.getIcon())Y.element.classList.remove(`${Y.getClass("tab")}--icon-and-text`),Y.element.classList.remove(`${Y.getClass("tab")}--text-only`),Y.element.classList.add(`${Y.getClass("tab")}--icon-only`);else if(Z.layout==="text-only")Y.element.classList.remove(`${Y.getClass("tab")}--icon-and-text`),Y.element.classList.remove(`${Y.getClass("tab")}--icon-only`),Y.element.classList.add(`${Y.getClass("tab")}--text-only`)}),J.element.classList.add(`${J.getClass("tabs")}--responsive-small`);else j.forEach((Y)=>{let U=q.get(Y)||"text-only";Y.element.classList.remove(`${Y.getClass("tab")}--icon-only`),Y.element.classList.remove(`${Y.getClass("tab")}--text-only`),Y.element.classList.remove(`${Y.getClass("tab")}--icon-and-text`),Y.element.classList.add(`${Y.getClass("tab")}--${U}`)}),J.element.classList.remove(`${J.getClass("tabs")}--responsive-small`)};G();let K=new ResizeObserver(G);K.observe(document.body),J._resizeObserver=K;let z=J.destroy;J.destroy=function(){if(this._resizeObserver)this._resizeObserver.disconnect();z.call(this)}};var $3=t2;J6();c();o();var J3=({disabled:J,lifecycle:$})=>(Q)=>({element:Q.element,input:Q.input,getValue:Q.getValue||(()=>""),setValue(Z){return Q.setValue?.(Z),this},setAttribute(Z,q){return Q.setAttribute?.(Z,q),this},getAttribute(Z){return Q.getAttribute?.(Z)||null},removeAttribute(Z){return Q.removeAttribute?.(Z),this},setVariant(Z){let q=Q.config?.prefix||"mtrl",j=Q.config?.componentName||"textfield";if(Q.element.classList.remove(`${q}-${j}--filled`,`${q}-${j}--outlined`),Q.element.classList.add(`${q}-${j}--${Z}`),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10);return this},getVariant(){let Z=Q.config?.prefix||"mtrl",q=Q.config?.componentName||"textfield";if(Q.element.classList.contains(`${Z}-${q}--outlined`))return"outlined";return"filled"},setLabel(Z){if(Q.label?.setText(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10);return this},getLabel(){return Q.label?.getText()||""},leadingIcon:Q.leadingIcon||null,setLeadingIcon(Z){if(Q.setLeadingIcon){if(Q.setLeadingIcon(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removeLeadingIcon(){if(Q.removeLeadingIcon){if(Q.removeLeadingIcon(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},trailingIcon:Q.trailingIcon||null,setTrailingIcon(Z){if(Q.setTrailingIcon){if(Q.setTrailingIcon(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removeTrailingIcon(){if(Q.removeTrailingIcon){if(Q.removeTrailingIcon(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},supportingTextElement:Q.supportingTextElement||null,setSupportingText(Z,q){if(Q.setSupportingText)Q.setSupportingText(Z,q);return this},removeSupportingText(){if(Q.removeSupportingText)Q.removeSupportingText();return this},prefixTextElement:Q.prefixTextElement||null,setPrefixText(Z){if(Q.setPrefixText){if(Q.setPrefixText(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removePrefixText(){if(Q.removePrefixText){if(Q.removePrefixText(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},suffixTextElement:Q.suffixTextElement||null,setSuffixText(Z){if(Q.setSuffixText){if(Q.setSuffixText(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removeSuffixText(){if(Q.removeSuffixText){if(Q.removeSuffixText(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},updatePositions(){if(Q.updateElementPositions)Q.updateElementPositions();return this},setDensity(Z){if(Q.density?.set)Q.density.set(Z);return this},getDensity(){return Q.density?.current||"default"},on(Z,q){return Q.on?.(Z,q),this},off(Z,q){return Q.off?.(Z,q),this},enable(){return J.enable(),this},disable(){return J.disable(),this},destroy(){$.destroy()}});var M0=(J)=>($)=>{if(!J.leadingIcon)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-leading-icon`,Z.innerHTML=J.leadingIcon,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-leading-icon`),$.input)$.input.classList.add(`${Q}-${J.componentName||"textfield"}-input--with-leading-icon`);if("lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return setTimeout(()=>{let q=$.element.querySelector(`.${Q}-${J.componentName||"textfield"}-label`);if(q){if(!$.element.classList.contains(`${Q}-${J.componentName||"textfield"}--with-prefix`))q.style.left="44px"}},10),{...$,leadingIcon:Z,setLeadingIcon(q){return Z.innerHTML=q,this},removeLeadingIcon(){if(Z.parentNode){if(Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-leading-icon`),$.input)$.input.classList.remove(`${Q}-${J.componentName||"textfield"}-input--with-leading-icon`);if(!$.element.classList.contains(`${Q}-${J.componentName||"textfield"}--with-prefix`)){let q=$.element.querySelector(`.${Q}-${J.componentName||"textfield"}-label`);if(q)q.style.left=""}this.leadingIcon=null}return this}}};var V0=(J)=>($)=>{if(!J.trailingIcon)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-trailing-icon`,Z.innerHTML=J.trailingIcon,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-trailing-icon`),$.input)$.input.classList.add(`${Q}-${J.componentName||"textfield"}-input--with-trailing-icon`);if("lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,trailingIcon:Z,setTrailingIcon(q){return Z.innerHTML=q,this},removeTrailingIcon(){if(Z.parentNode){if(Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-trailing-icon`),$.input)$.input.classList.remove(`${Q}-${J.componentName||"textfield"}-input--with-trailing-icon`);this.trailingIcon=null}return this}}};var N0=(J)=>($)=>{if(!J.prefixText)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-prefix`,Z.textContent=J.prefixText,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-prefix`),"lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,prefixTextElement:Z,setPrefixText(q){return Z.textContent=q,this},removePrefixText(){if(Z.parentNode){Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-prefix`);let q=$.element.querySelector(`.${Q}-${J.componentName||"textfield"}-label`);if(q)q.style.left="";this.prefixTextElement=null}return this}}};var _0=(J)=>($)=>{if(!J.suffixText)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-suffix`,Z.textContent=J.suffixText,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-suffix`),"lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,suffixTextElement:Z,setSuffixText(q){return Z.textContent=q,this},removeSuffixText(){if(Z.parentNode)Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-suffix`),this.suffixTextElement=null;return this}}};var L0=(J)=>($)=>{if(!J.supportingText)return $;let Q=J.prefix||"mtrl",Z=document.createElement("div");if(Z.className=`${Q}-${J.componentName||"textfield"}-helper`,Z.textContent=J.supportingText,J.error)Z.classList.add(`${Q}-${J.componentName||"textfield"}-helper--error`),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--error`);if($.element.appendChild(Z),"lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,supportingTextElement:Z,setSupportingText(q,j=!1){return Z.textContent=q,Z.classList.toggle(`${Q}-${J.componentName||"textfield"}-helper--error`,j),$.element.classList.toggle(`${Q}-${J.componentName||"textfield"}--error`,j),this},removeSupportingText(){if(Z.parentNode)Z.remove(),this.supportingTextElement=null,$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--error`);return this}}};M1();var D0=()=>(J)=>{let $=J.config.prefix||"mtrl",Q=J.config.componentName||"textfield",Z=new WeakMap,q=new WeakMap,j=new WeakMap,G=()=>{if(!J.element||!J.element.isConnected)return J;let z=J.element.querySelector(`.${$}-${Q}-label`),W=J.element.querySelector(`.${$}-${Q}-prefix`),Y=J.element.querySelector(`.${$}-${Q}-suffix`),U=J.element.classList.contains(`${$}-${Q}--outlined`),X=J.element.classList.contains(`${$}-${Q}--focused`),_=J.element.classList.contains(`${$}-${Q}--empty`),H=J.element.classList.contains(`${$}-${Q}--with-leading-icon`);if(U&&z){let{color:B,element:M}=_9(J.element);if(X||!_){if(z.style.backgroundColor=B,z.style.paddingLeft="4px",z.style.paddingRight="4px",M&&!Z.has(J.element)){let k=new MutationObserver(()=>{let{color:V}=_9(J.element);z.style.backgroundColor=V});k.observe(M,{attributes:!0,attributeFilter:["style","class"]}),Z.set(J.element,k);let N=M.parentElement,F=[];while(N&&N!==document.documentElement){let V=new MutationObserver(()=>{let{color:O}=_9(J.element);z.style.backgroundColor=O});V.observe(N,{attributes:!0,attributeFilter:["style","class","data-theme","data-theme-mode"]}),F.push(V),N=N.parentElement}if(F.length)q.set(J.element,F)}if(!j.has(J.element)){let k=()=>{let{color:N}=_9(J.element);if(X||!_)z.style.backgroundColor=N};document.addEventListener("themechange",k),j.set(J.element,k)}}else z.style.backgroundColor="",z.style.padding=""}if(W&&J.input){let M=W.getBoundingClientRect().width+4+12;if(J.input.style.paddingLeft=`${M}px`,z){let k=M;if(H)k=Math.max(k,44);if(!X&&_)z.style.left=`${k}px`;else z.style.left="12px"}}else if(H&&z){if(U)if(!X&&_)z.style.left="44px";else z.style.left="12px"}if(Y&&J.input){let M=Y.getBoundingClientRect().width+4+12;J.input.style.paddingRight=`${M}px`}return J},K=()=>{if(J.input){if(J.input.addEventListener("focus",()=>{J.element.classList.add(`${$}-${Q}--focused`),setTimeout(G,10)}),J.input.addEventListener("blur",()=>{J.element.classList.remove(`${$}-${Q}--focused`),setTimeout(G,10)}),J.input.addEventListener("input",()=>{let W=!J.input.value;J.element.classList.toggle(`${$}-${Q}--empty`,W),setTimeout(G,10)}),!J.input.value)J.element.classList.add(`${$}-${Q}--empty`)}window.addEventListener("resize",G),new MutationObserver(()=>{if(J.element.isConnected)G()}).observe(document.body,{childList:!0,subtree:!0})};if(setTimeout(()=>{K(),G()},0),"lifecycle"in J&&J.lifecycle?.destroy){let z=J.lifecycle.destroy;J.lifecycle.destroy=()=>{window.removeEventListener("resize",G);let W=Z.get(J.element);if(W)W.disconnect(),Z.delete(J.element);let Y=q.get(J.element);if(Y)Y.forEach((X)=>X.disconnect()),q.delete(J.element);let U=j.get(J.element);if(U)document.removeEventListener("themechange",U),j.delete(J.element);z.call(J.lifecycle)}}return{...J,updateElementPositions:()=>{return G(),J}}};var O0=(J)=>($)=>{let Q=J.prefix||"mtrl",Z=J.componentName||"textfield",q=J.density||"default";if(q!=="default")$.element.classList.add(`${Q}-${Z}--density-${q}`);if($.element.setAttribute("data-density",q),$.input)j($.input,q);function j(K,z){K.setAttribute("data-density",z)}let G=(K)=>{if(["default","compact"].forEach((z)=>{$.element.classList.remove(`${Q}-${Z}--density-${z}`)}),K!=="default")$.element.classList.add(`${Q}-${Z}--density-${K}`);if($.element.setAttribute("data-density",K),$.input)$.input.setAttribute("data-density",K);if($.density)$.density.current=K;if($.updateElementPositions)setTimeout(()=>$.updateElementPositions(),10)};return $.density={current:q,set:G},$};t();var W$={FILLED:"filled",OUTLINED:"outlined"},P0={ACTIVE:"active",INACTIVE:"inactive",DISABLED:"disabled"},w8={TEXT:"text",PASSWORD:"password",EMAIL:"email",NUMBER:"number",TEL:"tel",URL:"url",SEARCH:"search",MULTILINE:"multiline"},R0={CHANGE:"change",INPUT:"input",FOCUS:"focus",BLUR:"blur",ENTER:"enter",KEYDOWN:"keydown",KEYUP:"keyup"},A0={DEFAULT:"default",COMPACT:"compact"},k7={TYPE:w8.TEXT,VARIANT:W$.FILLED,DENSITY:A0.DEFAULT,DISABLED:!1,REQUIRED:!1,ERROR:!1,FLOAT_LABEL:!0,ANIMATION_DURATION:150},w0={ROOT:"textfield",INPUT:"textfield-input",LABEL:"textfield-label",CONTAINER:"textfield-container",FILLED:"textfield--filled",OUTLINED:"textfield--outlined",FOCUSED:"textfield--focused",DISABLED:"textfield--disabled",ERROR:"textfield--error",REQUIRED:"textfield--required",LABEL_FLOATING:"textfield-label--floating",SUPPORTING_TEXT:"textfield-supporting-text",SUPPORTING_TEXT_ERROR:"textfield-supporting-text--error",LEADING_ICON:"textfield-leading-icon",TRAILING_ICON:"textfield-trailing-icon",PREFIX_TEXT:"textfield-prefix-text",SUFFIX_TEXT:"textfield-suffix-text",OUTLINE:"textfield-outline",MULTILINE:"textfield--multiline"};var JK={type:k7.TYPE,variant:k7.VARIANT},Q3=(J={})=>d(JK,J,"textfield"),Z3=(J)=>p(J,{tag:"div",className:J.class}),q3=(J)=>({disabled:{enable:J.disabled?.enable,disable:J.disabled?.disable},lifecycle:{destroy:J.lifecycle?.destroy}});var QK=(J={})=>{let $=Q3(J);try{return b(S,g(),E(Z3($)),K6($),O0($),R7($),z9($),M0($),V0($),N0($),_0($),L0($),G6($),C(),D0(),(Z)=>J3(q3(Z))(Z))($)}catch(Q){throw console.error("Textfield creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create textfield: ${Q instanceof Error?Q.message:String(Q)}`)}},Y$=QK;y6();J6();c();o();var M7;((Q)=>{Q.DIAL="dial";Q.INPUT="input"})(M7||={});var U$;((Q)=>{Q.VERTICAL="vertical";Q.HORIZONTAL="horizontal"})(U$||={});var i9;((Q)=>{Q.AMPM="12h";Q.MILITARY="24h"})(i9||={});var o9;((Q)=>{Q.AM="AM";Q.PM="PM"})(o9||={});t();var x8={DIAL:"dial",INPUT:"input"},y8={VERTICAL:"vertical",HORIZONTAL:"horizontal"},T8={AMPM:"12h",MILITARY:"24h"},x0={AM:"AM",PM:"PM"},_6={CHANGE:"change",OPEN:"open",CLOSE:"close",CONFIRM:"confirm",CANCEL:"cancel"},Z9={DIAMETER:256,INNER_RADIUS:65,OUTER_RADIUS:110,NUMBER_SIZE:40,CENTER_SIZE:8,HAND_SIZE:36,TRACK_WIDTH:2},y0={HOURS_12:Array.from({length:12},(J,$)=>$===0?12:$),HOURS_24:Array.from({length:24},(J,$)=>$),MINUTES:Array.from({length:60},(J,$)=>$),SECONDS:Array.from({length:60},(J,$)=>$)},V7={MODAL:1050,DIALOG:1051},Q6={CONTAINER:".mtrl-time-picker",MODAL:".mtrl-time-picker-modal",DIALOG:".mtrl-time-picker-dialog",TITLE:".mtrl-time-picker-title",CONTENT:".mtrl-time-picker-content",DIAL:".mtrl-time-picker-dial",DIAL_CANVAS:".mtrl-time-picker-dial-canvas",DIAL_FACE:".mtrl-time-picker-dial-face",DIAL_HAND:".mtrl-time-picker-dial-hand",DIAL_CENTER:".mtrl-time-picker-dial-center",DIAL_NUMBERS:".mtrl-time-picker-dial-numbers",DIAL_NUMBER:".mtrl-time-picker-dial-number",INPUT_CONTAINER:".mtrl-time-picker-input-container",HOURS_INPUT:".mtrl-time-picker-hours",MINUTES_INPUT:".mtrl-time-picker-minutes",SECONDS_INPUT:".mtrl-time-picker-seconds",SEPARATOR:".mtrl-time-picker-separator",PERIOD_CONTAINER:".mtrl-time-picker-period",PERIOD_AM:".mtrl-time-picker-period-am",PERIOD_PM:".mtrl-time-picker-period-pm",ACTIONS:".mtrl-time-picker-actions",TOGGLE_TYPE_BUTTON:".mtrl-time-picker-toggle-type",CANCEL_BUTTON:".mtrl-time-picker-cancel",CONFIRM_BUTTON:".mtrl-time-picker-confirm"},g6={CLOCK:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
43
|
+
`,document.head.appendChild(J)};var $K=(J={})=>{let $=r2(J);o2();try{let Q=b(S,g(),s2($),P8($),O8($),R8($),A8($),C(),(Z)=>m2(a2(Z))(Z))($);return L8(Q),Q}catch(Q){throw console.error("Tabs creation error:",Q),new Error(`Failed to create tabs: ${Q.message}`)}},t2=$K;var n2=(J,$={})=>{let{enabled:Q=!0,showButtons:Z=!1,appearance:q="fade"}=$;if(!Q)return;let j=J.element.querySelector(`.${J.getClass("tabs")}-scroll`);if(!j)return;let K=document.createElement("div");K.className=`${J.getClass("tabs")}-scroll-indicator ${J.getClass("tabs")}-scroll-indicator--left`,K.classList.add(`${J.getClass("tabs")}-scroll-indicator--${q}`);let G=document.createElement("div");if(G.className=`${J.getClass("tabs")}-scroll-indicator ${J.getClass("tabs")}-scroll-indicator--right`,G.classList.add(`${J.getClass("tabs")}-scroll-indicator--${q}`),J.element.appendChild(K),J.element.appendChild(G),Z){let U=document.createElement("button");U.className=`${J.getClass("tabs")}-scroll-button ${J.getClass("tabs")}-scroll-button--left`,U.setAttribute("aria-label","Scroll tabs left"),U.innerHTML='<svg viewBox="0 0 24 24"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>';let X=document.createElement("button");X.className=`${J.getClass("tabs")}-scroll-button ${J.getClass("tabs")}-scroll-button--right`,X.setAttribute("aria-label","Scroll tabs right"),X.innerHTML='<svg viewBox="0 0 24 24"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',J.element.appendChild(U),J.element.appendChild(X),U.addEventListener("click",()=>{j.scrollBy({left:-100,behavior:"smooth"})}),X.addEventListener("click",()=>{j.scrollBy({left:100,behavior:"smooth"})})}let W=()=>{let{scrollLeft:U,scrollWidth:X,clientWidth:_}=j;if(K.classList.toggle("visible",U>0),G.classList.toggle("visible",U+_<X-1),Z){let H=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--left`),B=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--right`);if(H)H.disabled=U<=0;if(B)B.disabled=U+_>=X-1}};W(),j.addEventListener("scroll",W);let z=new ResizeObserver(W);z.observe(j);let Y=J.destroy;J.destroy=function(){if(z)z.disconnect();if(j.removeEventListener("scroll",W),K.parentNode)K.parentNode.removeChild(K);if(G.parentNode)G.parentNode.removeChild(G);if(Z){let U=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--left`),X=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--right`);if(U&&U.parentNode)U.parentNode.removeChild(U);if(X&&X.parentNode)X.parentNode.removeChild(X)}Y.call(this)}};var M0={SMALL:600,MEDIUM:904,LARGE:1240},e2=(J,$={})=>{if($.responsive===!1)return;let Q={small:$.breakpoints?.small||M0.SMALL,medium:$.breakpoints?.medium||M0.MEDIUM,large:$.breakpoints?.large||M0.LARGE},Z={layout:$.smallScreen?.layout||"icon-only",maxVisibleTabs:$.smallScreen?.maxVisibleTabs||4},q=new Map,j=J.getTabs();j.forEach((z)=>{let Y="text-only";if(z.getIcon()&&z.getText())Y="icon-and-text";else if(z.getIcon())Y="icon-only";q.set(z,Y)});let K=()=>{if(window.innerWidth<Q.small)j.forEach((Y)=>{if(Z.layout==="icon-only"&&!Y.getIcon())return;if(Z.layout==="icon-only"&&Y.getIcon())Y.element.classList.remove(`${Y.getClass("tab")}--icon-and-text`),Y.element.classList.remove(`${Y.getClass("tab")}--text-only`),Y.element.classList.add(`${Y.getClass("tab")}--icon-only`);else if(Z.layout==="text-only")Y.element.classList.remove(`${Y.getClass("tab")}--icon-and-text`),Y.element.classList.remove(`${Y.getClass("tab")}--icon-only`),Y.element.classList.add(`${Y.getClass("tab")}--text-only`)}),J.element.classList.add(`${J.getClass("tabs")}--responsive-small`);else j.forEach((Y)=>{let U=q.get(Y)||"text-only";Y.element.classList.remove(`${Y.getClass("tab")}--icon-only`),Y.element.classList.remove(`${Y.getClass("tab")}--text-only`),Y.element.classList.remove(`${Y.getClass("tab")}--icon-and-text`),Y.element.classList.add(`${Y.getClass("tab")}--${U}`)}),J.element.classList.remove(`${J.getClass("tabs")}--responsive-small`)};K();let G=new ResizeObserver(K);G.observe(document.body),J._resizeObserver=G;let W=J.destroy;J.destroy=function(){if(this._resizeObserver)this._resizeObserver.disconnect();W.call(this)}};var $3=t2;J6();c();o();var J3=({disabled:J,lifecycle:$})=>(Q)=>({element:Q.element,input:Q.input,getValue:Q.getValue||(()=>""),setValue(Z){return Q.setValue?.(Z),this},setAttribute(Z,q){return Q.setAttribute?.(Z,q),this},getAttribute(Z){return Q.getAttribute?.(Z)||null},removeAttribute(Z){return Q.removeAttribute?.(Z),this},setVariant(Z){let q=Q.config?.prefix||"mtrl",j=Q.config?.componentName||"textfield";if(Q.element.classList.remove(`${q}-${j}--filled`,`${q}-${j}--outlined`),Q.element.classList.add(`${q}-${j}--${Z}`),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10);return this},getVariant(){let Z=Q.config?.prefix||"mtrl",q=Q.config?.componentName||"textfield";if(Q.element.classList.contains(`${Z}-${q}--outlined`))return"outlined";return"filled"},setLabel(Z){if(Q.label?.setText(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10);return this},getLabel(){return Q.label?.getText()||""},leadingIcon:Q.leadingIcon||null,setLeadingIcon(Z){if(Q.setLeadingIcon){if(Q.setLeadingIcon(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removeLeadingIcon(){if(Q.removeLeadingIcon){if(Q.removeLeadingIcon(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},trailingIcon:Q.trailingIcon||null,setTrailingIcon(Z){if(Q.setTrailingIcon){if(Q.setTrailingIcon(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removeTrailingIcon(){if(Q.removeTrailingIcon){if(Q.removeTrailingIcon(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},supportingTextElement:Q.supportingTextElement||null,setSupportingText(Z,q){if(Q.setSupportingText)Q.setSupportingText(Z,q);return this},removeSupportingText(){if(Q.removeSupportingText)Q.removeSupportingText();return this},prefixTextElement:Q.prefixTextElement||null,setPrefixText(Z){if(Q.setPrefixText){if(Q.setPrefixText(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removePrefixText(){if(Q.removePrefixText){if(Q.removePrefixText(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},suffixTextElement:Q.suffixTextElement||null,setSuffixText(Z){if(Q.setSuffixText){if(Q.setSuffixText(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removeSuffixText(){if(Q.removeSuffixText){if(Q.removeSuffixText(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},updatePositions(){if(Q.input&&Q.element){let Z=Q.input.value&&Q.input.value.length>0,q=Q.input.matches?.(":-webkit-autofill")||!1;if(Z||q)Q.element.classList.remove(`${Q.config?.prefix||"mtrl"}-textfield--empty`);else Q.element.classList.add(`${Q.config?.prefix||"mtrl"}-textfield--empty`)}if(Q.updateElementPositions)Q.updateElementPositions();return this},setDensity(Z){if(Q.density?.set)Q.density.set(Z);return this},getDensity(){return Q.density?.current||"default"},on(Z,q){return Q.on?.(Z,q),this},off(Z,q){return Q.off?.(Z,q),this},enable(){return J.enable(),this},disable(){return J.disable(),this},destroy(){$.destroy()}});var k0=(J)=>($)=>{if(!J.leadingIcon)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-leading-icon`,Z.innerHTML=J.leadingIcon,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-leading-icon`),$.input)$.input.classList.add(`${Q}-${J.componentName||"textfield"}-input--with-leading-icon`);if("lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return setTimeout(()=>{let q=$.element.querySelector(`.${Q}-${J.componentName||"textfield"}-label`);if(q){if(!$.element.classList.contains(`${Q}-${J.componentName||"textfield"}--with-prefix`))q.style.left="44px"}},10),{...$,leadingIcon:Z,setLeadingIcon(q){return Z.innerHTML=q,this},removeLeadingIcon(){if(Z.parentNode){if(Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-leading-icon`),$.input)$.input.classList.remove(`${Q}-${J.componentName||"textfield"}-input--with-leading-icon`);if(!$.element.classList.contains(`${Q}-${J.componentName||"textfield"}--with-prefix`)){let q=$.element.querySelector(`.${Q}-${J.componentName||"textfield"}-label`);if(q)q.style.left=""}this.leadingIcon=null}return this}}};var N0=(J)=>($)=>{if(!J.trailingIcon)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-trailing-icon`,Z.innerHTML=J.trailingIcon,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-trailing-icon`),$.input)$.input.classList.add(`${Q}-${J.componentName||"textfield"}-input--with-trailing-icon`);if("lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,trailingIcon:Z,setTrailingIcon(q){return Z.innerHTML=q,this},removeTrailingIcon(){if(Z.parentNode){if(Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-trailing-icon`),$.input)$.input.classList.remove(`${Q}-${J.componentName||"textfield"}-input--with-trailing-icon`);this.trailingIcon=null}return this}}};var V0=(J)=>($)=>{if(!J.prefixText)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-prefix`,Z.textContent=J.prefixText,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-prefix`),"lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,prefixTextElement:Z,setPrefixText(q){return Z.textContent=q,this},removePrefixText(){if(Z.parentNode){Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-prefix`);let q=$.element.querySelector(`.${Q}-${J.componentName||"textfield"}-label`);if(q)q.style.left="";this.prefixTextElement=null}return this}}};var _0=(J)=>($)=>{if(!J.suffixText)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-suffix`,Z.textContent=J.suffixText,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-suffix`),"lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,suffixTextElement:Z,setSuffixText(q){return Z.textContent=q,this},removeSuffixText(){if(Z.parentNode)Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-suffix`),this.suffixTextElement=null;return this}}};var L0=(J)=>($)=>{if(!J.supportingText)return $;let Q=J.prefix||"mtrl",Z=document.createElement("div");if(Z.className=`${Q}-${J.componentName||"textfield"}-helper`,Z.textContent=J.supportingText,J.error)Z.classList.add(`${Q}-${J.componentName||"textfield"}-helper--error`),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--error`);if($.element.appendChild(Z),"lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,supportingTextElement:Z,setSupportingText(q,j=!1){return Z.textContent=q,Z.classList.toggle(`${Q}-${J.componentName||"textfield"}-helper--error`,j),$.element.classList.toggle(`${Q}-${J.componentName||"textfield"}--error`,j),this},removeSupportingText(){if(Z.parentNode)Z.remove(),this.supportingTextElement=null,$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--error`);return this}}};k1();var D0=()=>(J)=>{let $=J.config.prefix||"mtrl",Q=J.config.componentName||"textfield",Z=new WeakMap,q=new WeakMap,j=new WeakMap,K=new WeakMap,G=()=>{if(!J.element||!J.element.isConnected)return J;let z=J.element.querySelector(`.${$}-${Q}-label`),Y=J.element.querySelector(`.${$}-${Q}-prefix`),U=J.element.querySelector(`.${$}-${Q}-suffix`),X=J.element.classList.contains(`${$}-${Q}--outlined`),_=J.element.classList.contains(`${$}-${Q}--focused`),H=J.element.classList.contains(`${$}-${Q}--empty`),B=J.element.classList.contains(`${$}-${Q}--with-leading-icon`);if(X&&z){let{color:k,element:M}=_9(J.element);if(_||!H){if(z.style.backgroundColor=k,z.style.paddingLeft="4px",z.style.paddingRight="4px",M&&!Z.has(J.element)){let V=new MutationObserver(()=>{let{color:O}=_9(J.element);z.style.backgroundColor=O});V.observe(M,{attributes:!0,attributeFilter:["style","class"]}),Z.set(J.element,V);let F=M.parentElement,N=[];while(F&&F!==document.documentElement){let O=new MutationObserver(()=>{let{color:P}=_9(J.element);z.style.backgroundColor=P});O.observe(F,{attributes:!0,attributeFilter:["style","class","data-theme","data-theme-mode"]}),N.push(O),F=F.parentElement}if(N.length)q.set(J.element,N)}if(!j.has(J.element)){let V=()=>{let{color:F}=_9(J.element);if(_||!H)z.style.backgroundColor=F};document.addEventListener("themechange",V),j.set(J.element,V)}}else z.style.backgroundColor="",z.style.padding=""}if(Y&&J.input){let M=Y.getBoundingClientRect().width+4+12;if(J.input.style.paddingLeft=`${M}px`,z){let V=M;if(B)V=Math.max(V,44);if(!_&&H)z.style.left=`${V}px`;else z.style.left="12px"}}else if(B&&z){if(X)if(!_&&H)z.style.left="44px";else z.style.left="12px"}if(U&&J.input){let M=U.getBoundingClientRect().width+4+12;J.input.style.paddingRight=`${M}px`}return J},W=()=>{let z=new MutationObserver((Y)=>{Y.forEach((U)=>{if(U.type==="attributes"&&U.attributeName==="class")setTimeout(G,10)})});z.observe(J.element,{attributes:!0,attributeFilter:["class"]}),window.addEventListener("resize",G),K.set(J.element,z)};if(setTimeout(()=>{W(),G()},0),"lifecycle"in J&&J.lifecycle?.destroy){let z=J.lifecycle.destroy;J.lifecycle.destroy=()=>{window.removeEventListener("resize",G);let Y=K.get(J.element);if(Y)Y.disconnect(),K.delete(J.element);let U=Z.get(J.element);if(U)U.disconnect(),Z.delete(J.element);let X=q.get(J.element);if(X)X.forEach((H)=>H.disconnect()),q.delete(J.element);let _=j.get(J.element);if(_)document.removeEventListener("themechange",_),j.delete(J.element);z.call(J.lifecycle)}}return{...J,updateElementPositions:()=>{return G(),J}}};var O0=(J)=>($)=>{let Q=J.prefix||"mtrl",Z=J.componentName||"textfield",q=J.density||"default";if(q!=="default")$.element.classList.add(`${Q}-${Z}--density-${q}`);if($.element.setAttribute("data-density",q),$.input)j($.input,q);function j(G,W){G.setAttribute("data-density",W)}let K=(G)=>{if(["default","compact"].forEach((W)=>{$.element.classList.remove(`${Q}-${Z}--density-${W}`)}),G!=="default")$.element.classList.add(`${Q}-${Z}--density-${G}`);if($.element.setAttribute("data-density",G),$.input)$.input.setAttribute("data-density",G);if($.density)$.density.current=G;if($.updateElementPositions)setTimeout(()=>$.updateElementPositions(),10)};return $.density={current:q,set:K},$};t();var W$={FILLED:"filled",OUTLINED:"outlined"},P0={ACTIVE:"active",INACTIVE:"inactive",DISABLED:"disabled"},w8={TEXT:"text",PASSWORD:"password",EMAIL:"email",NUMBER:"number",TEL:"tel",URL:"url",SEARCH:"search",MULTILINE:"multiline"},R0={CHANGE:"change",INPUT:"input",FOCUS:"focus",BLUR:"blur",ENTER:"enter",KEYDOWN:"keydown",KEYUP:"keyup"},A0={DEFAULT:"default",COMPACT:"compact"},M7={TYPE:w8.TEXT,VARIANT:W$.FILLED,DENSITY:A0.DEFAULT,DISABLED:!1,REQUIRED:!1,ERROR:!1,FLOAT_LABEL:!0,ANIMATION_DURATION:150},w0={ROOT:"textfield",INPUT:"textfield-input",LABEL:"textfield-label",CONTAINER:"textfield-container",FILLED:"textfield--filled",OUTLINED:"textfield--outlined",FOCUSED:"textfield--focused",DISABLED:"textfield--disabled",ERROR:"textfield--error",REQUIRED:"textfield--required",LABEL_FLOATING:"textfield-label--floating",SUPPORTING_TEXT:"textfield-supporting-text",SUPPORTING_TEXT_ERROR:"textfield-supporting-text--error",LEADING_ICON:"textfield-leading-icon",TRAILING_ICON:"textfield-trailing-icon",PREFIX_TEXT:"textfield-prefix-text",SUFFIX_TEXT:"textfield-suffix-text",OUTLINE:"textfield-outline",MULTILINE:"textfield--multiline"};var JK={type:M7.TYPE,variant:M7.VARIANT},Q3=(J={})=>d(JK,J,"textfield"),Z3=(J)=>p(J,{tag:"div",className:J.class}),q3=(J)=>({disabled:{enable:J.disabled?.enable,disable:J.disabled?.disable},lifecycle:{destroy:J.lifecycle?.destroy}});var QK=(J={})=>{let $=Q3(J);try{return b(S,g(),E(Z3($)),K6($),O0($),R7($),z9($),k0($),N0($),V0($),_0($),L0($),G6($),C(),D0(),(Z)=>J3(q3(Z))(Z))($)}catch(Q){throw console.error("Textfield creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create textfield: ${Q instanceof Error?Q.message:String(Q)}`)}},Y$=QK;y6();J6();c();o();var k7;((Q)=>{Q.DIAL="dial";Q.INPUT="input"})(k7||={});var U$;((Q)=>{Q.VERTICAL="vertical";Q.HORIZONTAL="horizontal"})(U$||={});var i9;((Q)=>{Q.AMPM="12h";Q.MILITARY="24h"})(i9||={});var o9;((Q)=>{Q.AM="AM";Q.PM="PM"})(o9||={});t();var x8={DIAL:"dial",INPUT:"input"},y8={VERTICAL:"vertical",HORIZONTAL:"horizontal"},T8={AMPM:"12h",MILITARY:"24h"},x0={AM:"AM",PM:"PM"},_6={CHANGE:"change",OPEN:"open",CLOSE:"close",CONFIRM:"confirm",CANCEL:"cancel"},Z9={DIAMETER:256,INNER_RADIUS:65,OUTER_RADIUS:110,NUMBER_SIZE:40,CENTER_SIZE:8,HAND_SIZE:36,TRACK_WIDTH:2},y0={HOURS_12:Array.from({length:12},(J,$)=>$===0?12:$),HOURS_24:Array.from({length:24},(J,$)=>$),MINUTES:Array.from({length:60},(J,$)=>$),SECONDS:Array.from({length:60},(J,$)=>$)},N7={MODAL:1050,DIALOG:1051},Q6={CONTAINER:".mtrl-time-picker",MODAL:".mtrl-time-picker-modal",DIALOG:".mtrl-time-picker-dialog",TITLE:".mtrl-time-picker-title",CONTENT:".mtrl-time-picker-content",DIAL:".mtrl-time-picker-dial",DIAL_CANVAS:".mtrl-time-picker-dial-canvas",DIAL_FACE:".mtrl-time-picker-dial-face",DIAL_HAND:".mtrl-time-picker-dial-hand",DIAL_CENTER:".mtrl-time-picker-dial-center",DIAL_NUMBERS:".mtrl-time-picker-dial-numbers",DIAL_NUMBER:".mtrl-time-picker-dial-number",INPUT_CONTAINER:".mtrl-time-picker-input-container",HOURS_INPUT:".mtrl-time-picker-hours",MINUTES_INPUT:".mtrl-time-picker-minutes",SECONDS_INPUT:".mtrl-time-picker-seconds",SEPARATOR:".mtrl-time-picker-separator",PERIOD_CONTAINER:".mtrl-time-picker-period",PERIOD_AM:".mtrl-time-picker-period-am",PERIOD_PM:".mtrl-time-picker-period-pm",ACTIONS:".mtrl-time-picker-actions",TOGGLE_TYPE_BUTTON:".mtrl-time-picker-toggle-type",CANCEL_BUTTON:".mtrl-time-picker-cancel",CONFIRM_BUTTON:".mtrl-time-picker-confirm"},g6={CLOCK:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
44
44
|
<circle cx="12" cy="12" r="10"></circle>
|
|
45
45
|
<polyline points="12 6 12 12 16 14"></polyline>
|
|
46
46
|
</svg>`,KEYBOARD:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
@@ -54,11 +54,11 @@ var{defineProperty:C8,getOwnPropertyNames:a3,getOwnPropertyDescriptor:c3}=Object
|
|
|
54
54
|
<line x1="14" y1="12" x2="14" y2="12"></line>
|
|
55
55
|
<line x1="18" y1="12" x2="18" y2="12"></line>
|
|
56
56
|
<line x1="6" y1="16" x2="18" y2="16"></line>
|
|
57
|
-
</svg>`},i6={TYPE:x8.DIAL,FORMAT:T8.AMPM,ORIENTATION:y8.VERTICAL,SHOW_SECONDS:!1,CLOSE_ON_SELECT:!0,MINUTE_STEP:1,SECOND_STEP:1,CANCEL_TEXT:"Cancel",CONFIRM_TEXT:"OK",IS_OPEN:!1,CLOCK_ICON:g6.CLOCK,KEYBOARD_ICON:g6.KEYBOARD},T0={ROOT:"time-picker",OPEN:"time-picker--open",MODAL:"time-picker-modal",DIALOG:"time-picker-dialog",DIALOG_DIAL:"time-picker-dialog--dial",DIALOG_INPUT:"time-picker-dialog--input",DIALOG_VERTICAL:"time-picker-dialog--vertical",DIALOG_HORIZONTAL:"time-picker-dialog--horizontal",DIALOG_12H:"time-picker-dialog--12h",DIALOG_24H:"time-picker-dialog--24h",TITLE:"time-picker-title",CONTENT:"time-picker-content",DIAL:"time-picker-dial",DIAL_CANVAS:"time-picker-dial-canvas",DIAL_FACE:"time-picker-dial-face",DIAL_HAND:"time-picker-dial-hand",DIAL_CENTER:"time-picker-dial-center",DIAL_NUMBERS:"time-picker-dial-numbers",DIAL_NUMBER:"time-picker-dial-number",DIAL_NUMBER_ACTIVE:"time-picker-dial-number--active",INPUT_CONTAINER:"time-picker-input-container",HOURS_INPUT:"time-picker-hours",MINUTES_INPUT:"time-picker-minutes",SECONDS_INPUT:"time-picker-seconds",SEPARATOR:"time-picker-separator",PERIOD_CONTAINER:"time-picker-period",PERIOD_AM:"time-picker-period-am",PERIOD_PM:"time-picker-period-pm",PERIOD_ACTIVE:"time-picker-period--active",ACTIONS:"time-picker-actions",TOGGLE_TYPE:"time-picker-toggle-type",CANCEL:"time-picker-cancel",CONFIRM:"time-picker-confirm"};var ZK={type:"dial",format:"12h",orientation:"vertical",showSeconds:i6.SHOW_SECONDS,closeOnSelect:i6.CLOSE_ON_SELECT,minuteStep:i6.MINUTE_STEP,secondStep:i6.SECOND_STEP,cancelText:i6.CANCEL_TEXT,confirmText:i6.CONFIRM_TEXT,isOpen:i6.IS_OPEN,clockIcon:g6.CLOCK,keyboardIcon:g6.KEYBOARD},j3=(J={})=>d(ZK,J,"time-picker"),K3=(J)=>{return p(J,{tag:"div",attributes:{role:"dialog","aria-modal":"true","aria-labelledby":`${J.prefix}-time-picker-title`},className:[J.class,J.isOpen?`${J.prefix}-time-picker--open`:""],forwardEvents:{click:!0,keydown:!0},interactive:!0})};var G3=(J)=>({events:{on:($,Q)=>J.on($,Q),off:($,Q)=>J.off($,Q),emit:($,Q)=>J.emit($,Q)},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var $6=(J)=>{return J.toString().padStart(2,"0")},z3=(J,$)=>{try{let Q=J.split(":"),Z=parseInt(Q[0],10),q=parseInt(Q[1],10),j=Q[2]?parseInt(Q[2],10):0;if(isNaN(Z)||Z<0||Z>23||isNaN(q)||q<0||q>59||isNaN(j)||j<0||j>59)throw new Error("Invalid time format");let G=Z>=12?"PM":"AM";return{hours:Z,minutes:q,seconds:j,period:G}}catch(Q){console.error("Error parsing time:",Q);let Z=new Date,q=Z.getHours(),j=Z.getMinutes(),G=Z.getSeconds(),K=q>=12?"PM":"AM";return{hours:q,minutes:j,seconds:G,period:K}}},W3=(J,$)=>{let{hours:Q,minutes:Z,seconds:q}=J;if($){if(q!==void 0)return`${$6(Q)}:${$6(Z)}:${$6(q)}`;return`${$6(Q)}:${$6(Z)}`}else{let j=Q%12;if(j===0)j=12;if(q!==void 0)return`${$6(j)}:${$6(Z)}:${$6(q)} ${J.period}`;return`${$6(j)}:${$6(Z)} ${J.period}`}};var Y3=(J)=>{let $=J>=12?"PM":"AM",Q=J%12;if(Q===0)Q=12;return{hours:Q,period:$}};var j6={...Z9,KNOB_SIZE:45,CENTER_SIZE:8,NUMBER_SIZE:24,INNER_RADIUS:75,OUTER_RADIUS:100,TRACK_WIDTH:1.5,HAND_WIDTH:2};function qK(J){let $=document.documentElement,Q=getComputedStyle($),Z=Q.getPropertyValue(`--${J}-sys-color-primary`).trim()||"#6750A4",q=Q.getPropertyValue(`--${J}-sys-color-on-primary`).trim()||"#FFFFFF",j=Q.getPropertyValue(`--${J}-sys-color-on-surface`).trim()||"#1C1B1F",G=Q.getPropertyValue(`--${J}-sys-color-primary-rgb`).trim()||"103, 80, 164",z=`rgba(${Q.getPropertyValue(`--${J}-sys-color-on-surface-rgb`).trim()||"28, 27, 31"}, 0.05)`,W=`rgba(${G}, 0.1)`;return{primaryColor:Z,onPrimaryColor:q,onSurfaceColor:j,bgColor:z,selectedBgColor:W}}var P6=(J,$,Q)=>{let Z=J.getContext("2d");if(!Z){console.error("Could not get canvas context");return}let q=qK(Q.prefix),j=window.devicePixelRatio||1;J.width=j6.DIAMETER*j,J.height=j6.DIAMETER*j,Z.scale(j,j);let G=j6.DIAMETER/2,K=j6.DIAMETER/2,z=j6.DIAMETER/2;if(Z.clearRect(0,0,J.width,J.height),Z.beginPath(),Z.arc(G,K,z-2,0,2*Math.PI),Z.fillStyle=q.bgColor,Z.fill(),Z.beginPath(),Z.arc(G,K,j6.CENTER_SIZE/2,0,2*Math.PI),Z.fillStyle=q.primaryColor,Z.fill(),Q.activeSelector==="hour")if(Q.format==="24h")KK(Z,G,K,z,$.hours,q);else jK(Z,G,K,z,$.hours%12||12,q);else if(Q.activeSelector==="minute")U3(Z,G,K,z,$.minutes,q);else if(Q.activeSelector==="second"&&Q.showSeconds)U3(Z,G,K,z,$.seconds||0,q);GK(Z,G,K,$,Q,q)},jK=(J,$,Q,Z,q,j)=>{let G=j6.OUTER_RADIUS;for(let K=1;K<=12;K++){let z=K/6*Math.PI-Math.PI/2,W=$+G*Math.cos(z),Y=Q+G*Math.sin(z),U=K===q;if(U)J.beginPath(),J.arc(W,Y,j6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="16px Roboto, Arial, sans-serif",J.fillStyle=U?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(K.toString(),W,Y+2)}},KK=(J,$,Q,Z,q,j)=>{let G=j6.OUTER_RADIUS;for(let z=1;z<=12;z++){let W=z/6*Math.PI-Math.PI/2,Y=$+G*Math.cos(W),U=Q+G*Math.sin(W),X=z===q;if(X)J.beginPath(),J.arc(Y,U,j6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="16px Roboto, Arial, sans-serif",J.fillStyle=X?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(z.toString(),Y,U+2)}let K=j6.INNER_RADIUS;for(let z=13;z<=24;z++){let W=z===24?0:z,Y=(z-12)/6*Math.PI-Math.PI/2,U=$+K*Math.cos(Y),X=Q+K*Math.sin(Y),_=W===q;if(_)J.beginPath(),J.arc(U,X,j6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="14px Roboto, Arial, sans-serif",J.fillStyle=_?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText($6(W),U,X+2)}},U3=(J,$,Q,Z,q,j)=>{let G=j6.OUTER_RADIUS;for(let K=0;K<60;K+=5){let z=K/30*Math.PI-Math.PI/2,W=$+G*Math.cos(z),Y=Q+G*Math.sin(z),U=K===q;if(U)J.beginPath(),J.arc(W,Y,j6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="16px Roboto, Arial, sans-serif",J.fillStyle=U?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText($6(K),W,Y)}if(q%5!==0){let K=q/30*Math.PI-Math.PI/2,z=$+G*Math.cos(K),W=Q+G*Math.sin(K);J.beginPath(),J.arc(z,W,j6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill(),J.font="16px Roboto, Arial, sans-serif",J.fillStyle=j.primaryColor,J.textAlign="center",J.textBaseline="middle",J.fillText($6(q),z,W)}},GK=(J,$,Q,Z,q,j)=>{let G,K;if(q.activeSelector==="hour")if(q.format==="24h")if(Z.hours>=12)G=(Z.hours%12||12)/6*Math.PI-Math.PI/2,K=j6.INNER_RADIUS;else{let U=Z.hours;if(U===0)U=12;G=U/6*Math.PI-Math.PI/2,K=j6.OUTER_RADIUS}else G=(Z.hours%12||12)/6*Math.PI-Math.PI/2,K=j6.OUTER_RADIUS;else if(q.activeSelector==="minute")G=Z.minutes/30*Math.PI-Math.PI/2,K=j6.OUTER_RADIUS;else if(q.activeSelector==="second")G=(Z.seconds||0)/30*Math.PI-Math.PI/2,K=j6.OUTER_RADIUS;else return;J.beginPath(),J.moveTo($,Q),J.lineTo($+K*Math.cos(G),Q+K*Math.sin(G)),J.lineWidth=j6.HAND_WIDTH,J.strokeStyle=j.primaryColor,J.stroke();let z=$+K*Math.cos(G),W=Q+K*Math.sin(G);J.beginPath(),J.arc(z,W,j6.KNOB_SIZE/2,0,2*Math.PI),J.fillStyle=j.primaryColor,J.fill(),J.font="16px Roboto, Arial, sans-serif",J.fillStyle=j.onPrimaryColor,J.textAlign="center",J.textBaseline="middle";let Y="";if(q.activeSelector==="hour")if(q.format==="24h")Y=$6(Z.hours);else Y=String(Z.hours%12||12);else if(q.activeSelector==="minute")Y=$6(Z.minutes);else if(q.activeSelector==="second")Y=$6(Z.seconds||0);J.fillText(Y,z,W)},I8=(J,$,Q,Z)=>{let q=j6.DIAMETER/2,j=j6.DIAMETER/2,G=$-q,K=Q-j,z=Math.sqrt(G*G+K*K),W=Math.atan2(K,G)+Math.PI/2;if(W<0)W+=2*Math.PI;if(Z.activeSelector==="hour")if(Z.format==="24h"){let Y=(j6.INNER_RADIUS+j6.OUTER_RADIUS)/2,U=z<Y,X=Math.round(W/(Math.PI/6))%12;if(U&&X!==0)X+=12;else if(!U&&X===0)X=12;else if(U&&X===0)X=0;return X}else{let Y=Math.round(W/(Math.PI/6))%12;if(Y===0)Y=12;return Y}else if(Z.activeSelector==="minute"||Z.activeSelector==="second")return Math.round(W/(Math.PI/30))%60;return null};var d6=(J,$,Q,Z)=>{if(J.innerHTML="",Q.title){let L=document.createElement("div");L.className=`${Q.prefix}-time-picker-title`,L.textContent=Q.title,L.id=`${Q.prefix}-time-picker-title`,J.appendChild(L)}let q=document.createElement("div");q.className=`${Q.prefix}-time-picker-content`,J.appendChild(q);let j=document.createElement("div");j.className=`${Q.prefix}-time-picker-input-container`,q.appendChild(j);let{hours:G}=Q.format==="24h"?{hours:$.hours}:Y3($.hours),K=document.createElement("div");K.className=`${Q.prefix}-time-picker-time-input-field`;let z=document.createElement("input");z.type="number",z.className=`${Q.prefix}-time-picker-hours`,z.min=Q.format==="24h"?"0":"1",z.max=Q.format==="24h"?"23":"12",z.value=$6(G),z.setAttribute("data-type","hour"),z.setAttribute("inputmode","numeric"),z.setAttribute("pattern","[0-9]*"),K.appendChild(z),j.appendChild(K);let W=document.createElement("div");W.className=`${Q.prefix}-time-picker-separator`,W.textContent=":",j.appendChild(W);let Y=document.createElement("div");Y.className=`${Q.prefix}-time-picker-time-input-field`;let U=document.createElement("input");U.type="number",U.className=`${Q.prefix}-time-picker-minutes`,U.min="0",U.max="59",U.value=$6($.minutes),U.setAttribute("data-type","minute"),U.setAttribute("inputmode","numeric"),U.setAttribute("pattern","[0-9]*"),Y.appendChild(U),j.appendChild(Y);let X;if(Q.showSeconds){let L=document.createElement("div");L.className=`${Q.prefix}-time-picker-separator`,L.textContent=":",j.appendChild(L);let D=document.createElement("div");D.className=`${Q.prefix}-time-picker-time-input-field`,X=document.createElement("input"),X.type="number",X.className=`${Q.prefix}-time-picker-seconds`,X.min="0",X.max="59",X.value=$6($.seconds||0),X.setAttribute("data-type","second"),X.setAttribute("inputmode","numeric"),X.setAttribute("pattern","[0-9]*");let R=document.createElement("label");R.className=`${Q.prefix}-time-picker-input-label`,R.textContent="Second",D.appendChild(X),D.appendChild(R),j.appendChild(D)}if(Q.format==="12h"){let L=document.createElement("div");L.className=`${Q.prefix}-time-picker-period`;let D=document.createElement("div");D.className=`${Q.prefix}-time-picker-period-am ${$.period==="AM"?`${Q.prefix}-time-picker-period--selected`:""}`,D.textContent="AM",D.setAttribute("role","button"),D.setAttribute("tabindex","0"),D.setAttribute("aria-pressed",$.period==="AM"?"true":"false");let R=document.createElement("div");R.className=`${Q.prefix}-time-picker-period-pm ${$.period==="PM"?`${Q.prefix}-time-picker-period--selected`:""}`,R.textContent="PM",R.setAttribute("role","button"),R.setAttribute("tabindex","0"),R.setAttribute("aria-pressed",$.period==="PM"?"true":"false"),L.appendChild(D),L.appendChild(R),j.appendChild(L)}let _=document.createElement("div");_.className=`${Q.prefix}-time-picker-dial`,_.style.display=Q.type==="dial"?"block":"none",q.appendChild(_);let H=document.createElement("canvas");H.className=`${Q.prefix}-time-picker-dial-canvas`,H.width=Z9.DIAMETER,H.height=Z9.DIAMETER,H.style.width=`${Z9.DIAMETER}px`,H.style.height=`${Z9.DIAMETER}px`,_.appendChild(H);let B=document.createElement("div");B.className=`${Q.prefix}-time-picker-actions`,J.appendChild(B);let M=document.createElement("button");M.className=`${Q.prefix}-time-picker-toggle-type`,M.setAttribute("aria-label",Q.type==="dial"?"Switch to keyboard input":"Switch to dial selector"),M.innerHTML=Q.type==="dial"?Q.keyboardIcon||g6.KEYBOARD:Q.clockIcon||g6.CLOCK,B.appendChild(M);let k=document.createElement("div");k.className=`${Q.prefix}-time-picker-action-buttons`,B.appendChild(k);let N=document.createElement("button");N.className=`${Q.prefix}-time-picker-cancel`,N.textContent=Q.cancelText||"Cancel",N.setAttribute("type","button"),k.appendChild(N);let F=document.createElement("button");F.className=`${Q.prefix}-time-picker-confirm`,F.textContent=Q.confirmText||"OK",F.setAttribute("type","button"),k.appendChild(F);let V="hour";if(Q.type==="dial")setTimeout(()=>{P6(H,$,{type:Q.type,format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V})},0);M.addEventListener("click",()=>{if(_.style.display==="none")_.style.display="block",M.innerHTML=Q.keyboardIcon||g6.KEYBOARD,M.setAttribute("aria-label","Switch to keyboard input"),setTimeout(()=>{H.focus(),document.querySelectorAll(`.${Q.prefix}-time-picker-hours`).forEach((w)=>w.setAttribute("data-active","true")),document.querySelectorAll(`.${Q.prefix}-time-picker-minutes`).forEach((w)=>w.setAttribute("data-active","false")),document.querySelectorAll(`.${Q.prefix}-time-picker-seconds`).forEach((w)=>w.setAttribute("data-active","false")),P6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:"hour"})},50);else _.style.display="none",M.innerHTML=Q.clockIcon||g6.CLOCK,M.setAttribute("aria-label","Switch to dial selector"),setTimeout(()=>{z.focus(),z.select()},50)});let O=(L)=>{let D=L.target,R=D.getAttribute("data-type"),w=D.value;if(w==="")return;let A=parseInt(w,10);if(isNaN(A))return;if(R==="hour"){let x=A;if(Q.format==="12h"){if(A<0)x=1;if(A>12)x=12;if($.period==="PM"&&x!==12)x+=12;else if($.period==="AM"&&x===12)x=0}else{if(A<0)x=0;if(A>23)x=23}if($.hours=x,V="hour",z.setAttribute("data-active","true"),U.setAttribute("data-active","false"),X)X.setAttribute("data-active","false");if(P6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V}),Z)Z("hours",x)}else if(R==="minute"){let x=A;if(A<0)x=0;if(A>59)x=59;if($.minutes=x,V="minute",z.setAttribute("data-active","false"),U.setAttribute("data-active","true"),X)X.setAttribute("data-active","false");if(P6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V}),Z)Z("minutes",x)}else if(R==="second"){let x=A;if(A<0)x=0;if(A>59)x=59;if($.seconds=x,V="second",z.setAttribute("data-active","false"),U.setAttribute("data-active","false"),X)X.setAttribute("data-active","true");if(P6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V}),Z)Z("seconds",x)}};if(z.addEventListener("input",O),U.addEventListener("input",O),X)X.addEventListener("input",O);if(z.addEventListener("keyup",(L)=>{if(L.key==="Enter")U.focus(),U.select()}),U.addEventListener("keyup",(L)=>{if(L.key==="Enter")if(Q.showSeconds&&X)X.focus(),X.select();else F.focus()}),X)X.addEventListener("keyup",(L)=>{if(L.key==="Enter")F.focus()});let P=(L)=>{if($.period!==L){let D=$.period;if($.period=L,D==="AM"&&L==="PM"){if($.hours<12)$.hours+=12}else if(D==="PM"&&L==="AM"){if($.hours>=12)$.hours-=12}if(Q.format==="12h"){let w=$.hours===0?12:$.hours>12?$.hours-12:$.hours;z.value=$6(w)}document.querySelectorAll(`.${Q.prefix}-time-picker-period-am, .${Q.prefix}-time-picker-period-pm`).forEach((w)=>{w.classList.remove(`${Q.prefix}-time-picker-period--selected`),w.setAttribute("aria-pressed","false")});let R=document.querySelector(`.${Q.prefix}-time-picker-period-${L.toLowerCase()}`);if(R)R.classList.add(`${Q.prefix}-time-picker-period--selected`),R.setAttribute("aria-pressed","true");if(_.style.display==="block")P6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V});if(Z)Z("hours",$.hours)}};if(Q.format==="12h"){let L=document.querySelector(`.${Q.prefix}-time-picker-period-am`),D=document.querySelector(`.${Q.prefix}-time-picker-period-pm`);if(L)L.addEventListener("click",()=>{P("AM")});if(D)D.addEventListener("click",()=>{P("PM")})}if(Q.type==="dial"||_.style.display==="block"){if(H.addEventListener("click",(L)=>{let D=H.getBoundingClientRect(),R=L.clientX-D.left,w=L.clientY-D.top,A=I8(H,R,w,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V});if(A!==null){if(V==="hour"){let x=A;if(Q.format==="12h"){if($.period==="PM"&&A!==12)x+=12;else if($.period==="AM"&&A===12)x=0}if($.hours=x,Q.format==="12h"){let I=x===0?12:x>12?x-12:x;z.value=$6(I)}else z.value=$6(x);if(Z)Z("hours",x)}else if(V==="minute"){if($.minutes=A,U.value=$6(A),Z)Z("minutes",A)}else if(V==="second"&&X){if($.seconds=A,X.value=$6(A),Z)Z("seconds",A)}P6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V})}}),z.addEventListener("click",()=>{if(_.style.display==="block"){if(V="hour",z.setAttribute("data-active","true"),U.setAttribute("data-active","false"),X)X.setAttribute("data-active","false");P6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V})}}),U.addEventListener("click",()=>{if(_.style.display==="block"){if(V="minute",z.setAttribute("data-active","false"),U.setAttribute("data-active","true"),X)X.setAttribute("data-active","false");P6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V})}}),X)X.addEventListener("click",()=>{if(_.style.display==="block")V="second",z.setAttribute("data-active","false"),U.setAttribute("data-active","false"),X.setAttribute("data-active","true"),P6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V})})}};var X3=(J,$,Q,Z,q,j)=>{let G=!!q.isOpen,K=(U)=>{if(U.key==="Escape")W.close(),j.events.emit(_6.CANCEL)},z=(U)=>{if(U.target===$)W.close()},W={element:J.element,modalElement:$,dialogElement:Q,isOpen:G,open(){if(G)return this;if($.style.display="block",$.offsetWidth,$.classList.add("active"),Q.classList.add("active"),document.addEventListener("keydown",K),$.addEventListener("click",z),G=!0,J.element.classList.add(`${q.prefix}-time-picker--open`),setTimeout(()=>{d6(Q,Z,q)},50),j.events.emit(_6.OPEN),q.onOpen)q.onOpen();return this},close(){if(!G)return this;if($.classList.remove("active"),Q.classList.remove("active"),setTimeout(()=>{$.style.display="none"},300),document.removeEventListener("keydown",K),$.removeEventListener("click",z),G=!1,J.element.classList.remove(`${q.prefix}-time-picker--open`),j.events.emit(_6.CLOSE),q.onClose)q.onClose();return this},toggle(){return G?this.close():this.open()},getValue(){return W3(Z,q.format==="24h")},getTimeObject(){return{...Z}},setValue(U){try{let X=U.split(":"),_=parseInt(X[0],10),H=parseInt(X[1],10),B=X[2]?parseInt(X[2],10):0;if(isNaN(_)||_<0||_>23||isNaN(H)||H<0||H>59||isNaN(B)||B<0||B>59)throw new Error("Invalid time format. Use HH:MM or HH:MM:SS (24-hour format).");if(Z.hours=_,Z.minutes=H,Z.seconds=B,Z.period=_>=12?"PM":"AM",d6(Q,Z,q),j.events.emit(_6.CHANGE,this.getValue()),q.onChange)q.onChange(this.getValue())}catch(X){console.error("Error setting time value:",X)}return this},setType(U){if(q.type===U)return this;return q.type=U,Q.classList.remove(`${q.prefix}-time-picker-dialog--${"dial"}`,`${q.prefix}-time-picker-dialog--${"input"}`),Q.classList.add(`${q.prefix}-time-picker-dialog--${U}`),d6(Q,Z,q),this},getType(){return q.type},setFormat(U){if(q.format===U)return this;if(q.format=U,Q.classList.remove(`${q.prefix}-time-picker-dialog--${"12h"}`,`${q.prefix}-time-picker-dialog--${"24h"}`),Q.classList.add(`${q.prefix}-time-picker-dialog--${U}`),U==="24h")Z.period=Z.hours>=12?"PM":"AM";else Z.period=Z.hours>=12?"PM":"AM";return d6(Q,Z,q),j.events.emit(_6.CHANGE,this.getValue()),this},getFormat(){return q.format},setOrientation(U){if(q.orientation===U)return this;return q.orientation=U,Q.classList.remove(`${q.prefix}-time-picker-dialog--${"vertical"}`,`${q.prefix}-time-picker-dialog--${"horizontal"}`),Q.classList.add(`${q.prefix}-time-picker-dialog--${U}`),d6(Q,Z,q),this},getOrientation(){return q.orientation},setTitle(U){q.title=U;let X=Q.querySelector(Q6.TITLE);if(X)X.textContent=U;else d6(Q,Z,q);return this},getTitle(){return q.title||""},destroy(){if(G)this.close();if($&&$.parentNode)$.parentNode.removeChild($);j.lifecycle.destroy()},on(U,X){return j.events.on(U,X),this},off(U,X){return j.events.off(U,X),this}};Q.addEventListener("click",(U)=>{let X=U.target;if(X.closest(Q6.CANCEL_BUTTON)){if(W.close(),j.events.emit(_6.CANCEL),q.onCancel)q.onCancel()}if(X.closest(Q6.CONFIRM_BUTTON)){if(W.close(),j.events.emit(_6.CONFIRM,W.getValue()),q.onConfirm)q.onConfirm(W.getValue())}if(X.closest(Q6.TOGGLE_TYPE_BUTTON)){let _=q.type==="dial"?"input":"dial";W.setType(_)}if(X.closest(Q6.PERIOD_AM)){if(Z.period!=="AM"){if(Z.period="AM",Z.hours>=12)Z.hours-=12;if(d6(Q,Z,q),j.events.emit(_6.CHANGE,W.getValue()),q.onChange)q.onChange(W.getValue())}}if(X.closest(Q6.PERIOD_PM)){if(Z.period!=="PM"){if(Z.period="PM",Z.hours<12)Z.hours+=12;if(d6(Q,Z,q),j.events.emit(_6.CHANGE,W.getValue()),q.onChange)q.onChange(W.getValue())}}if(X.closest(Q6.DIAL_CANVAS)){if(q.type==="dial"){let _=X,H=_.getBoundingClientRect(),B=U.clientX-H.left,M=U.clientY-H.top,k="hour",N=Q.querySelector(Q6.HOURS_INPUT),F=Q.querySelector(Q6.MINUTES_INPUT),V=Q.querySelector(Q6.SECONDS_INPUT);if(N&&N.getAttribute("data-active")==="true")k="hour";else if(F&&F.getAttribute("data-active")==="true")k="minute";else if(q.showSeconds&&V&&V.getAttribute("data-active")==="true")k="second";let O=I8(_,B,M,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:k});if(O!==null){if(k==="hour"){let P=O;if(q.format==="12h"){if(Z.period==="PM"&&O!==12)P+=12;else if(Z.period==="AM"&&O===12)P=0}if(Z.hours!==P){Z.hours=P;let L=N;if(L)L.textContent=$6(q.format==="24h"?P:P%12||12);let D=Q.querySelector(Q6.DIAL_CANVAS);if(D)P6(D,Z,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:k});if(j.events.emit(_6.CHANGE,W.getValue()),q.onChange)q.onChange(W.getValue())}}else if(k==="minute"){if(Z.minutes!==O){Z.minutes=O;let P=F;if(P)P.textContent=$6(O);let L=Q.querySelector(Q6.DIAL_CANVAS);if(L)P6(L,Z,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:k});if(j.events.emit(_6.CHANGE,W.getValue()),q.onChange)q.onChange(W.getValue())}}else if(k==="second"&&q.showSeconds){if(Z.seconds!==O){Z.seconds=O;let P=V;if(P)P.textContent=$6(O);let L=Q.querySelector(Q6.DIAL_CANVAS);if(L)P6(L,Z,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:k});if(j.events.emit(_6.CHANGE,W.getValue()),q.onChange)q.onChange(W.getValue())}}}}}});let Y=(U)=>{let X=U.target,_=X.getAttribute("data-type"),H=parseInt(X.value,10);if(isNaN(H))return;if(_==="hour"){let B=H;if(q.format==="12h"){if(H<1)B=12;if(H>12)B=1;if(Z.period==="PM"&&B!==12)B+=12;else if(Z.period==="AM"&&B===12)B=0}else{if(H<0)B=0;if(H>23)B=23}Z.hours=B}else if(_==="minute"){let B=H;if(B<0)B=0;if(B>59)B=59;Z.minutes=B}else if(_==="second"){let B=H;if(B<0)B=0;if(B>59)B=59;Z.seconds=B}if(d6(Q,Z,q),j.events.emit(_6.CHANGE,W.getValue()),q.onChange)q.onChange(W.getValue())};return Q.addEventListener("change",(U)=>{let X=U.target;if(X.matches(Q6.HOURS_INPUT)||X.matches(Q6.MINUTES_INPUT)||X.matches(Q6.SECONDS_INPUT))Y(U)}),Q.addEventListener("keyup",(U)=>{let X=U.target;if(X.matches(Q6.HOURS_INPUT)||X.matches(Q6.MINUTES_INPUT)||X.matches(Q6.SECONDS_INPUT)){if(U.key==="Enter"){if(Y(U),X.matches(Q6.HOURS_INPUT)){let _=Q.querySelector(Q6.MINUTES_INPUT);if(_)_.focus()}else if(X.matches(Q6.MINUTES_INPUT))if(q.showSeconds){let _=Q.querySelector(Q6.SECONDS_INPUT);if(_)_.focus()}else{let _=Q.querySelector(Q6.CONFIRM_BUTTON);if(_)_.focus()}else if(X.matches(Q6.SECONDS_INPUT)){let _=Q.querySelector(Q6.CONFIRM_BUTTON);if(_)_.focus()}}}}),W};var zK=(J={})=>{let $=j3(J);try{let Q=b(S,g(),E(K3($)),C())($),Z=document.createElement("div");Z.className=`${u}-time-picker-modal`,Z.style.display="none",Z.style.position="fixed",Z.style.top="0",Z.style.left="0",Z.style.width="100%",Z.style.height="100%",Z.style.backgroundColor="rgba(0, 0, 0, 0.4)",Z.style.zIndex=V7.MODAL.toString(),Z.setAttribute("role","presentation");let q=document.createElement("div");q.className=[`${u}-time-picker-dialog`,`${u}-time-picker-dialog--${$.type}`,`${u}-time-picker-dialog--${$.orientation}`,`${u}-time-picker-dialog--${$.format}`].join(" "),q.style.position="absolute",q.style.top="50%",q.style.left="50%",q.style.transform="translate(-50%, -50%)",q.style.zIndex=V7.DIALOG.toString(),Z.appendChild(q),(typeof $.container==="string"?document.querySelector($.container)||document.body:$.container||document.body).appendChild(Z);let G;if($.value)G=z3($.value,$.format);else{let z=new Date;G={hours:z.getHours(),minutes:z.getMinutes(),seconds:$.showSeconds?z.getSeconds():0,period:z.getHours()>=12?"PM":"AM"}}d6(q,G,$);let K=X3(Q,Z,q,G,$,G3(Q));if($.isOpen)setTimeout(()=>K.open(),0);return K}catch(Q){throw console.error("TimePicker creation error:",Q),new Error(`Failed to create time picker: ${Q.message}`)}},I0=zK;J6();t();var S8={SMALL:"small",MEDIUM:"medium",LARGE:"large",CENTER:"center"},S0={DEFAULT:"default",SCROLLED:"scrolled",FIXED:"fixed"},H9={TAG:"header",TYPE:S8.SMALL,SCROLLABLE:!0,COMPRESSIBLE:!0,SCROLL_THRESHOLD:4},b0={ROOT:"top-app-bar",SMALL:"top-app-bar--small",MEDIUM:"top-app-bar--medium",LARGE:"top-app-bar--large",CENTER:"top-app-bar--center",SCROLLED:"top-app-bar--scrolled",FIXED:"top-app-bar--fixed",ROW:"top-app-bar-row",SECTION:"top-app-bar-section",SECTION_LEADING:"top-app-bar-section--leading",SECTION_HEADLINE:"top-app-bar-section--headline",SECTION_TRAILING:"top-app-bar-section--trailing",TITLE:"top-app-bar-title"};var WK={tag:H9.TAG,type:H9.TYPE,scrollable:H9.SCROLLABLE,compressible:H9.COMPRESSIBLE,scrollThreshold:H9.SCROLL_THRESHOLD},B3=(J={})=>d(WK,J,"top-app-bar");var F3=(J={})=>{let $=B3(J),Q=S($),Z=()=>{let B=document.createElement("div");B.className=`${Q.getClass("top-app-bar")}-leading`;let M=document.createElement("h1");if(M.className=`${Q.getClass("top-app-bar")}-headline`,$.title)M.textContent=$.title;let k=document.createElement("div");return k.className=`${Q.getClass("top-app-bar")}-trailing`,{leadingContainer:B,headlineElement:M,trailingContainer:k}},{leadingContainer:q,headlineElement:j,trailingContainer:G}=Z(),K=()=>{let B=[$.class];if($.type!=="small")B.push(`${Q.getClass("top-app-bar")}--${$.type}`);if($.compressible&&($.type==="medium"||$.type==="large"))B.push(`${Q.getClass("top-app-bar")}--compressible`);return B.filter(Boolean)},z=E({tag:$.tag,componentName:"top-app-bar",className:K(),attributes:{role:"banner","aria-label":"Top app bar"},interactive:!0})(Q),W=g()(z),Y=C()(W);(()=>{if($.type==="medium"||$.type==="large"){let B=document.createElement("div");B.className=`${Q.getClass("top-app-bar")}-row`,B.appendChild(q),B.appendChild(G);let M=document.createElement("div");M.className=`${Q.getClass("top-app-bar")}-row`,M.appendChild(j),Y.element.appendChild(B),Y.element.appendChild(M)}else Y.element.appendChild(q),Y.element.appendChild(j),Y.element.appendChild(G)})();let X=!1;if($.scrollable){let B=()=>{let k=window.scrollY>$.scrollThreshold;if(X!==k){if(X=k,X)Y.element.classList.add(`${Q.getClass("top-app-bar")}--scrolled`);else Y.element.classList.remove(`${Q.getClass("top-app-bar")}--scrolled`);$.onScroll?.(X)}};window.addEventListener("scroll",B,{passive:!0}),B();let M=Y.lifecycle.destroy;Y.lifecycle.destroy=()=>{window.removeEventListener("scroll",B),M()}}let _=(B)=>{while(Y.element.firstChild)Y.element.removeChild(Y.element.firstChild);if(["small","medium","large","center"].forEach((M)=>{Y.element.classList.remove(`${Q.getClass("top-app-bar")}--${M}`)}),B!=="small")Y.element.classList.add(`${Q.getClass("top-app-bar")}--${B}`);if(Y.element.classList.toggle(`${Q.getClass("top-app-bar")}--compressible`,$.compressible&&(B==="medium"||B==="large")),B==="medium"||B==="large"){let M=document.createElement("div");M.className=`${Q.getClass("top-app-bar")}-row`,M.appendChild(q),M.appendChild(G);let k=document.createElement("div");k.className=`${Q.getClass("top-app-bar")}-row`,k.appendChild(j),Y.element.appendChild(M),Y.element.appendChild(k)}else Y.element.appendChild(q),Y.element.appendChild(j),Y.element.appendChild(G)};return{...Y,setTitle(B){return j.textContent=B,this},getTitle(){return j.textContent||""},addLeadingElement(B){return q.appendChild(B),this},addTrailingElement(B){return G.appendChild(B),this},setType(B){return $.type=B,_(B),this},setScrollState(B){if(X=B,B)this.element.classList.add(`${Q.getClass("top-app-bar")}--scrolled`);else this.element.classList.remove(`${Q.getClass("top-app-bar")}--scrolled`);return this},getHeadlineElement(){return j},getLeadingContainer(){return q},getTrailingContainer(){return G}}};var H3=F3;y6();J6();c();o();var R6={TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left",TOP_START:"top-start",TOP_END:"top-end",RIGHT_START:"right-start",RIGHT_END:"right-end",BOTTOM_START:"bottom-start",BOTTOM_END:"bottom-end",LEFT_START:"left-start",LEFT_END:"left-end"};var k3=8;var M3=({lifecycle:J})=>($)=>{let Q=null,Z=R6.BOTTOM,q=!1,j=null,G=null,K=300,z=100,W=!0,Y=!0,U=document.createElement("div");U.className=`${$.getClass("tooltip")}__arrow`,$.element.appendChild(U),document.body.appendChild($.element),$.element.setAttribute("aria-hidden","true");let X=()=>{if(!Q)return{top:0,left:0};let P=$.element.getBoundingClientRect(),L=Q.getBoundingClientRect(),D=window.scrollY||window.pageYOffset,R=window.scrollX||window.pageXOffset,w=k3,A=0,x=0,I;switch(Z){case R6.TOP:A=L.top+D-P.height-w,x=L.left+R+L.width/2-P.width/2,I="bottom";break;case R6.TOP_START:A=L.top+D-P.height-w,x=L.left+R,I="bottom-start";break;case R6.TOP_END:A=L.top+D-P.height-w,x=L.left+R+L.width-P.width,I="bottom-end";break;case R6.RIGHT:A=L.top+D+L.height/2-P.height/2,x=L.left+R+L.width+w,I="left";break;case R6.RIGHT_START:A=L.top+D,x=L.left+R+L.width+w,I="left-start";break;case R6.RIGHT_END:A=L.top+D+L.height-P.height,x=L.left+R+L.width+w,I="left-end";break;case R6.BOTTOM:A=L.top+D+L.height+w,x=L.left+R+L.width/2-P.width/2,I="top";break;case R6.BOTTOM_START:A=L.top+D+L.height+w,x=L.left+R,I="top-start";break;case R6.BOTTOM_END:A=L.top+D+L.height+w,x=L.left+R+L.width-P.width,I="top-end";break;case R6.LEFT:A=L.top+D+L.height/2-P.height/2,x=L.left+R-P.width-w,I="right";break;case R6.LEFT_START:A=L.top+D,x=L.left+R-P.width-w,I="right-start";break;case R6.LEFT_END:A=L.top+D+L.height-P.height,x=L.left+R-P.width-w,I="right-end";break;default:A=L.top+D+L.height+w,x=L.left+R+L.width/2-P.width/2,I="top"}let r=window.innerWidth;if(x<0)x=0;else if(x+P.width>r)x=r-P.width;return{top:A,left:x,arrowPosition:I}},_=(P)=>{if(Y)P.addEventListener("mouseenter",B),P.addEventListener("mouseleave",M);if(W)P.addEventListener("focus",k),P.addEventListener("blur",N)},H=(P)=>{if(P)P.removeEventListener("mouseenter",B),P.removeEventListener("mouseleave",M),P.removeEventListener("focus",k),P.removeEventListener("blur",N)},B=()=>F.show(),M=()=>F.hide(),k=()=>F.show(),N=()=>F.hide(),F={element:$.element,target:Q,lifecycle:J,getClass:$.getClass,setText(P){let L=document.createTextNode(P);while($.element.firstChild!==U)$.element.removeChild($.element.firstChild);if($.element.insertBefore(L,U),q)this.updatePosition();return this},getText(){let P=$.element.cloneNode(!0),L=P.querySelector(`.${$.getClass("tooltip")}__arrow`);if(L)L.remove();return P.textContent||""},setPosition(P){Z=P;let L=$.getClass("tooltip"),D=Object.values(R6).map((R)=>`${L}--${R}`);if($.element.classList.remove(...D),$.element.classList.add(`${L}--${P}`),q)this.updatePosition();return this},getPosition(){return Z},setTarget(P){if(Q)H(Q);if(Q=P,this.target=P,Q.setAttribute("aria-describedby",$.element.id),_(Q),q)this.updatePosition();return this},show(P=!1){if(j!==null)window.clearTimeout(j),j=null;if(G!==null)window.clearTimeout(G),G=null;let L=()=>{if(!Q)return this;$.element.setAttribute("aria-hidden","false"),$.element.classList.add(`${$.getClass("tooltip")}--visible`),q=!0,this.updatePosition(),window.addEventListener("resize",V),window.addEventListener("scroll",O)};if(P)L();else j=window.setTimeout(L,K);return this},hide(P=!1){if(G!==null)window.clearTimeout(G),G=null;if(j!==null)window.clearTimeout(j),j=null;let L=()=>{$.element.setAttribute("aria-hidden","true"),$.element.classList.remove(`${$.getClass("tooltip")}--visible`),q=!1,window.removeEventListener("resize",V),window.removeEventListener("scroll",O)};if(P)L();else G=window.setTimeout(L,z);return this},isVisible(){return q},updatePosition(){if(!Q)return this;let{top:P,left:L,arrowPosition:D}=X();if($.element.style.top=`${Math.round(P)}px`,$.element.style.left=`${Math.round(L)}px`,D)U.className=`${$.getClass("tooltip")}__arrow`,U.classList.add(`${$.getClass("tooltip")}__arrow--${D}`);return this},destroy(){if(j!==null)window.clearTimeout(j);if(G!==null)window.clearTimeout(G);if(Q)H(Q),Q.removeAttribute("aria-describedby");if(window.removeEventListener("resize",V),window.removeEventListener("scroll",O),$.element.parentNode)$.element.parentNode.removeChild($.element);J.destroy()}},V=()=>{F.updatePosition()},O=()=>{F.updatePosition()};return F};t();var b8={TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left",TOP_START:"top-start",TOP_END:"top-end",RIGHT_START:"right-start",RIGHT_END:"right-end",BOTTOM_START:"bottom-start",BOTTOM_END:"bottom-end",LEFT_START:"left-start",LEFT_END:"left-end"},v8={DEFAULT:"default",RICH:"rich",PLAIN:"plain"},v0={SHOW:"show",HIDE:"hide",ENTER:"enter",LEAVE:"leave"},l6={POSITION:b8.BOTTOM,VARIANT:v8.DEFAULT,VISIBLE:!1,SHOW_DELAY:300,HIDE_DELAY:100,OFFSET:8,ARROW_SIZE:8,SHOW_ON_FOCUS:!0,SHOW_ON_HOVER:!0,RICH:!1},C0={ROOT:"tooltip",CONTAINER:"tooltip-container",ARROW:"tooltip-arrow",CONTENT:"tooltip-content",VISIBLE:"tooltip--visible",HIDDEN:"tooltip--hidden",DEFAULT:"tooltip--default",RICH:"tooltip--rich",PLAIN:"tooltip--plain",POSITION_PREFIX:"tooltip--"};var YK={position:l6.POSITION,variant:l6.VARIANT,visible:l6.VISIBLE,showDelay:l6.SHOW_DELAY,hideDelay:l6.HIDE_DELAY,showOnFocus:l6.SHOW_ON_FOCUS,showOnHover:l6.SHOW_ON_HOVER,rich:l6.RICH},V3=(J={})=>d(YK,J,"tooltip"),N3=(J)=>{let $={role:"tooltip","aria-hidden":"true"};if(J.zIndex!==void 0)$.style=`z-index: ${J.zIndex};`;return p(J,{tag:"div",attributes:$,className:[J.class,`${J.prefix}-tooltip--${J.position}`,`${J.prefix}-tooltip--${J.variant}`],text:J.text||""})},_3=(J)=>({lifecycle:{destroy:()=>J.lifecycle.destroy()}});var UK=()=>{return`${u}-tooltip-${Math.random().toString(36).substring(2,9)}`},XK=(J={})=>{let $=V3(J);try{let Q=b(S,E(N3($)),C(),(Z)=>M3(_3(Z))(Z))($);if(Q.element.id=UK(),$.target)Q.setTarget($.target);if($.text)Q.setText($.text);if($.visible)Q.show(!0);return Q}catch(Q){throw console.error("Tooltip creation error:",Q),new Error(`Failed to create tooltip: ${Q.message}`)}},E0=XK;w7();l9();c();o();S1();var BK=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize list manager: missing element"),$;let Q=J.renderItem,Z=null,q=(K,z,W)=>{let Y=Q?Q(K,z,W):j(K,W);if(Y&&K.id&&!Y.hasAttribute("data-id"))Y.setAttribute("data-id",K.id);if(Z)Z(K,Y);return Y};function j(K,z){let W=z||document.createElement("div");return W.className=e.ITEM,W.textContent=K.text||K.title||K.headline||K.name||K.id,W}let G=u$(J.collection,$.element,{...J,renderItem:q,afterLoad:(K)=>{if($.emit(M9.LOAD,K),J.afterLoad)J.afterLoad(K)}});if(G.setRenderHook=(K)=>{Z=K},$.lifecycle&&$.lifecycle.destroy){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{G.destroy(),K()}}return{...$,list:G}},h0=BK;v9();r7();var FK=(J)=>($)=>{if(!$.element||!J.trackSelection)return $;let Q=new Set;if(Array.isArray(J.items))J.items.forEach((K)=>{if(K.selected)Q.add(K.id)});if(Array.isArray(J.initialSelection))J.initialSelection.forEach((K)=>{Q.add(K)});let Z=()=>{if(!$.list){setTimeout(Z,0);return}if(typeof $.list.setRenderHook==="function")$.list.setRenderHook((K,z)=>{if(Q.has(K.id)){if(!O6(z,e.SELECTED))f(z,e.SELECTED)}else if(O6(z,e.SELECTED))q6(z,e.SELECTED)})};Z();let q=(K)=>{if(!K.target.closest("[data-id]"))return;let z=K.target.closest("[data-id]"),W=z.getAttribute("data-id");if(!W)return;let Y=$.list?.getAllItems().find((X)=>X.id===W);if(!Y)return;let U={item:Y,element:z,originalEvent:K,component:$,preventDefault:()=>{U.defaultPrevented=!0},defaultPrevented:!1};if($.emit(M9.SELECT,U),U.defaultPrevented)return;if(J.multiSelect)if(Q.has(W))Q.delete(W),q6(z,e.SELECTED);else Q.add(W),f(z,e.SELECTED);else if(O6(z,e.SELECTED))Q.clear(),q6(z,e.SELECTED);else $.element.querySelectorAll(`.${u}-${e.SELECTED}`).forEach((H)=>{q6(H,e.SELECTED)}),Q.clear(),Q.add(W),f(z,e.SELECTED)};$.element.addEventListener("click",q);let j=()=>{$.element.querySelectorAll("[data-id]").forEach((z)=>{let W=z.getAttribute("data-id"),Y=Q.has(W);if(Y&&!O6(z,e.SELECTED))f(z,e.SELECTED);else if(!Y&&O6(z,e.SELECTED))q6(z,e.SELECTED)})},G=(K,z)=>{if(z)Q.add(K);else Q.delete(K);let W=$.element.querySelector(`[data-id="${K}"]`);if(W){if(z&&!O6(W,e.SELECTED))f(W,e.SELECTED);else if(!z&&O6(W,e.SELECTED))q6(W,e.SELECTED)}};if($.lifecycle&&$.lifecycle.destroy){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{$.element.removeEventListener("click",q),K()}}return{...$,getSelectedItems:()=>{return($.list?.getAllItems()||[]).filter((z)=>Q.has(z.id))},getSelectedItemIds:()=>Array.from(Q),isItemSelected:(K)=>Q.has(K),selectItem:(K)=>{return G(K,!0),$},deselectItem:(K)=>{return G(K,!1),$},clearSelection:()=>{if(Q.size>0)Q.clear(),$.element.querySelectorAll(`.${u}-${e.SELECTED}`).forEach((z)=>q6(z,e.SELECTED));return $},setSelection:(K)=>{if(!K?.length&&Q.size===0)return $;if(Q.clear(),Array.isArray(K))K.forEach((z)=>Q.add(z));return j(),$}}},u0=FK;var L3=({list:J,events:$,lifecycle:Q})=>(Z)=>({...Z,element:Z.element,refresh:async()=>{return await J.refresh(),Z},loadMore:async()=>{return await J.loadMore()},scrollToItem:(q,j="start")=>{return J.scrollToItem(q,j),Z},getVisibleItems:()=>J.getVisibleItems(),getAllItems:()=>J.getAllItems(),isLoading:()=>J.isLoading(),hasNextPage:()=>J.hasNextPage(),on:(q,j)=>{return $.on(q,j),Z},off:(q,j)=>{return $.off(q,j),Z},destroy:()=>{Q.destroy()}});t();var HK={collection:j9.COLLECTION,transform:(J)=>J,baseUrl:j9.BASE_URL,items:[],pageSize:j9.PAGE_SIZE,renderBufferSize:j9.RENDER_BUFFER_SIZE,renderItem:null,trackSelection:!0,multiSelect:!1},D3=(J={})=>{if(!J.renderItem&&!Array.isArray(J.items))throw new Error("List requires either static items or a renderItem function");if(Array.isArray(J.items)&&!J.renderItem)J.renderItem=($)=>{let Q=document.createElement("div");return Q.className="mtrl-list-item",Q.textContent=$.text||$.title||$.headline||$.name||$.id,Q};return d(HK,J,"list")},O3=(J)=>{let $={role:"list",tabindex:"0"};if(J.ariaLabel)$["aria-label"]=J.ariaLabel;return p(J,{tag:"div",attributes:$,className:[e.CONTAINER,J.class],forwardEvents:{scroll:!0,keydown:!0}})},P3=(J)=>({list:{refresh:J.list?.refresh,loadMore:J.list?.loadMore,scrollToItem:J.list?.scrollToItem,getVisibleItems:J.list?.getVisibleItems,getAllItems:J.list?.getAllItems,isLoading:J.list?.isLoading,hasNextPage:J.list?.hasNextPage},events:{on:J.on,off:J.off},lifecycle:{destroy:J.lifecycle?.destroy}});var kK=(J={})=>{try{let $=D3(J);return b(S,g(),E(O3($)),h0($),u0($),C(),(Z)=>L3(P3(Z))(Z))($)}catch($){throw console.error("List creation error:",$),new Error(`Failed to create list: ${$.message}`)}},f0=kK;var R3=(J={})=>{return{rail:null,drawer:null,activeSection:J.activeSection||null,activeSubsection:J.activeSubsection||null,items:J.items||{},mouseInDrawer:!1,mouseInRail:!1,hoverTimer:null,closeTimer:null,processingChange:!1,isMobile:!1,overlayElement:null,closeButtonElement:null,resizeObserver:null,outsideClickHandler:null,outsideClickHandlerSet:!1}},g0=(J={})=>{return{animateDrawer:J.animateDrawer!==!1,showLabelsOnRail:J.showLabelsOnRail!==!1,hideDrawerOnClick:J.hideDrawerOnClick||!1,expanded:J.expanded===!0,hoverDelay:J.hoverDelay||200,closeDelay:J.closeDelay||100,railOptions:J.railOptions||{},drawerOptions:J.drawerOptions||{}}},d0=(J={})=>{return{breakpoint:J.breakpoint||960,lockBodyScroll:J.lockBodyScroll!==!1,hideOnClickOutside:J.hideOnClickOutside!==!1,enableSwipeGestures:J.enableSwipeGestures!==!1,optimizeForTouch:J.optimizeForTouch!==!1,overlayClass:J.overlayClass||"mtrl-nav-overlay",closeButtonClass:J.closeButtonClass||"mtrl-nav-close-btn",bodyLockClass:J.bodyLockClass||"mtrl-body-drawer-open"}};D7();var A3=(J,$,Q,Z)=>{if(!J.drawer||!$||!J.items[$])return;let j=J.items[$].items||[];if(j.length===0){Z();return}let G=J.drawer.getAllItems();if(G?.length>0)G.forEach((K)=>{J.drawer.removeItem(K.config.id)});j.forEach((K)=>{J.drawer.addItem(K)}),Q()},w3=(J,$)=>{let Q=Object.keys(J.items||{}).map((q)=>({id:q,label:J.items[q]?.label||q,icon:J.items[q]?.icon||"",active:q===J.activeSection})),Z=W7({variant:"rail",position:"left",showLabels:$.showLabelsOnRail,items:Q,...$.railOptions});return document.body.appendChild(Z.element),Z},x3=(J,$)=>{let Q=W7({variant:"drawer",position:"left",items:[],...$.drawerOptions});if(document.body.appendChild(Q.element),Q.element.dataset.id="drawer",!$.expanded)Q.element.classList.add("mtrl-nav--hidden"),Q.element.setAttribute("aria-hidden","true");return Q},y3=(J,$)=>{if(!J.drawer)return;if(J.drawer.element.classList.remove("mtrl-nav--hidden"),J.drawer.element.setAttribute("aria-hidden","false"),J.isMobile){if(J.overlayElement)J.overlayElement.classList.add("active"),J.overlayElement.setAttribute("aria-hidden","false");if($.lockBodyScroll)document.body.classList.add($.bodyLockClass);if(J.closeButtonElement)J.closeButtonElement.style.display="flex"}},T3=(J,$)=>{if(!J.drawer)return;if(J.drawer.element.classList.add("mtrl-nav--hidden"),J.drawer.element.setAttribute("aria-hidden","true"),J.overlayElement)J.overlayElement.classList.remove("active"),J.overlayElement.setAttribute("aria-hidden","true");if($.lockBodyScroll)document.body.classList.remove($.bodyLockClass)},I3=(J)=>{if(!J.drawer)return!1;return!J.drawer.element.classList.contains("mtrl-nav--hidden")},S3=(J,$,Q,Z,q)=>{let j=J.isMobile;if(J.isMobile=window.innerWidth<=$.breakpoint||L4(),j!==J.isMobile){if(J.isMobile)Q();else Z();if(q.onViewChange)q.onViewChange({mobile:J.isMobile,previousMobile:j,width:window.innerWidth})}},b3=(J)=>{if(J.overlayElement&&J.overlayElement.parentNode)J.overlayElement.parentNode.removeChild(J.overlayElement),J.overlayElement=null;if(J.rail)J.rail.destroy(),J.rail=null;if(J.drawer)J.drawer.destroy(),J.drawer=null;J.activeSection=null,J.activeSubsection=null,J.mouseInDrawer=!1,J.mouseInRail=!1,J.processingChange=!1,J.isMobile=!1},v3=(J,$,Q,Z)=>{if(!$||!J.items[$])return;if(J.activeSection===$&&J.activeSubsection===Q)return;if(J.activeSection=$,J.rail)J.rail.setActive($,Z);if(Q&&J.drawer)J.activeSubsection=Q,J.drawer.setActive(Q,Z)};var C3=(J,$,Q,Z,q,j)=>{let G=J.rail;if(!G)return;G.on("change",(K)=>{let z=K?.id;if(!z||J.processingChange)return;let W=K?.source==="userAction";if(J.processingChange=!0,J.activeSection=z,Q(z),j.onSectionChange&&W)j.onSectionChange(z,{source:W?"userClick":"programmatic"});setTimeout(()=>{J.processingChange=!1},50)}),G.on("mouseover",(K)=>{let z=K?.id;if(J.mouseInRail=!0,clearTimeout(J.hoverTimer),J.hoverTimer=null,z)if(J.items[z]?.items?.length>0)J.hoverTimer=window.setTimeout(()=>{Q(z)},$.hoverDelay);else J.closeTimer=window.setTimeout(()=>{if(J.mouseInRail&&!J.mouseInDrawer)q()},$.hoverDelay)}),G.on("mouseenter",()=>{J.mouseInRail=!0,clearTimeout(J.closeTimer),J.closeTimer=null}),G.on("mouseleave",()=>{if(J.mouseInRail=!1,clearTimeout(J.hoverTimer),J.hoverTimer=null,!J.mouseInDrawer)J.closeTimer=window.setTimeout(()=>{if(!J.mouseInRail&&!J.mouseInDrawer)q()},$.closeDelay)})},E3=(J,$,Q,Z)=>{let q=J.drawer;if(!q)return;if(typeof q.on==="function")q.on("change",(j)=>{let G=j.id;if(J.activeSubsection=G,$.hideDrawerOnClick)Q();if(Z.onItemSelect)Z.onItemSelect(j)}),q.on("mouseenter",()=>{J.mouseInDrawer=!0,clearTimeout(J.hoverTimer),clearTimeout(J.closeTimer),J.hoverTimer=null,J.closeTimer=null}),q.on("mouseleave",()=>{if(J.mouseInDrawer=!1,!J.mouseInRail)J.closeTimer=window.setTimeout(()=>{if(!J.mouseInDrawer&&!J.mouseInRail)Q()},$.closeDelay)})},h3=(J,$)=>{if(window.ResizeObserver)J.resizeObserver=new ResizeObserver(()=>{$()}),J.resizeObserver.observe(document.body);else window.addEventListener("resize",$);window.addEventListener("orientationchange",()=>{setTimeout($,100)})},u3=(J,$)=>{if(J.resizeObserver)J.resizeObserver.disconnect(),J.resizeObserver=null;else window.removeEventListener("resize",$);if(window.removeEventListener("orientationchange",$),J.outsideClickHandler){let Q="ontouchend"in window?"touchend":"click";document.removeEventListener(Q,J.outsideClickHandler)}clearTimeout(J.hoverTimer),clearTimeout(J.closeTimer),J.hoverTimer=null,J.closeTimer=null};D7();var MK=(J,$,Q)=>{if(J.overlayElement)return J.overlayElement;return J.overlayElement=document.createElement("div"),J.overlayElement.className=$.overlayClass,J.overlayElement.setAttribute("aria-hidden","true"),document.body.appendChild(J.overlayElement),J.overlayElement.addEventListener("click",(Z)=>{if(Z.target===J.overlayElement)Q()}),J.overlayElement},VK=(J,$,Q)=>{if(!J.drawer||J.closeButtonElement)return null;if(J.closeButtonElement=document.createElement("button"),J.closeButtonElement.className=$.closeButtonClass,J.closeButtonElement.setAttribute("aria-label","Close navigation"),J.closeButtonElement.innerHTML=`
|
|
57
|
+
</svg>`},i6={TYPE:x8.DIAL,FORMAT:T8.AMPM,ORIENTATION:y8.VERTICAL,SHOW_SECONDS:!1,CLOSE_ON_SELECT:!0,MINUTE_STEP:1,SECOND_STEP:1,CANCEL_TEXT:"Cancel",CONFIRM_TEXT:"OK",IS_OPEN:!1,CLOCK_ICON:g6.CLOCK,KEYBOARD_ICON:g6.KEYBOARD},T0={ROOT:"time-picker",OPEN:"time-picker--open",MODAL:"time-picker-modal",DIALOG:"time-picker-dialog",DIALOG_DIAL:"time-picker-dialog--dial",DIALOG_INPUT:"time-picker-dialog--input",DIALOG_VERTICAL:"time-picker-dialog--vertical",DIALOG_HORIZONTAL:"time-picker-dialog--horizontal",DIALOG_12H:"time-picker-dialog--12h",DIALOG_24H:"time-picker-dialog--24h",TITLE:"time-picker-title",CONTENT:"time-picker-content",DIAL:"time-picker-dial",DIAL_CANVAS:"time-picker-dial-canvas",DIAL_FACE:"time-picker-dial-face",DIAL_HAND:"time-picker-dial-hand",DIAL_CENTER:"time-picker-dial-center",DIAL_NUMBERS:"time-picker-dial-numbers",DIAL_NUMBER:"time-picker-dial-number",DIAL_NUMBER_ACTIVE:"time-picker-dial-number--active",INPUT_CONTAINER:"time-picker-input-container",HOURS_INPUT:"time-picker-hours",MINUTES_INPUT:"time-picker-minutes",SECONDS_INPUT:"time-picker-seconds",SEPARATOR:"time-picker-separator",PERIOD_CONTAINER:"time-picker-period",PERIOD_AM:"time-picker-period-am",PERIOD_PM:"time-picker-period-pm",PERIOD_ACTIVE:"time-picker-period--active",ACTIONS:"time-picker-actions",TOGGLE_TYPE:"time-picker-toggle-type",CANCEL:"time-picker-cancel",CONFIRM:"time-picker-confirm"};var ZK={type:"dial",format:"12h",orientation:"vertical",showSeconds:i6.SHOW_SECONDS,closeOnSelect:i6.CLOSE_ON_SELECT,minuteStep:i6.MINUTE_STEP,secondStep:i6.SECOND_STEP,cancelText:i6.CANCEL_TEXT,confirmText:i6.CONFIRM_TEXT,isOpen:i6.IS_OPEN,clockIcon:g6.CLOCK,keyboardIcon:g6.KEYBOARD},j3=(J={})=>d(ZK,J,"time-picker"),K3=(J)=>{return p(J,{tag:"div",attributes:{role:"dialog","aria-modal":"true","aria-labelledby":`${J.prefix}-time-picker-title`},className:[J.class,J.isOpen?`${J.prefix}-time-picker--open`:""],forwardEvents:{click:!0,keydown:!0},interactive:!0})};var G3=(J)=>({events:{on:($,Q)=>J.on($,Q),off:($,Q)=>J.off($,Q),emit:($,Q)=>J.emit($,Q)},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var $6=(J)=>{return J.toString().padStart(2,"0")},z3=(J,$)=>{try{let Q=J.split(":"),Z=parseInt(Q[0],10),q=parseInt(Q[1],10),j=Q[2]?parseInt(Q[2],10):0;if(isNaN(Z)||Z<0||Z>23||isNaN(q)||q<0||q>59||isNaN(j)||j<0||j>59)throw new Error("Invalid time format");let K=Z>=12?"PM":"AM";return{hours:Z,minutes:q,seconds:j,period:K}}catch(Q){console.error("Error parsing time:",Q);let Z=new Date,q=Z.getHours(),j=Z.getMinutes(),K=Z.getSeconds(),G=q>=12?"PM":"AM";return{hours:q,minutes:j,seconds:K,period:G}}},W3=(J,$)=>{let{hours:Q,minutes:Z,seconds:q}=J;if($){if(q!==void 0)return`${$6(Q)}:${$6(Z)}:${$6(q)}`;return`${$6(Q)}:${$6(Z)}`}else{let j=Q%12;if(j===0)j=12;if(q!==void 0)return`${$6(j)}:${$6(Z)}:${$6(q)} ${J.period}`;return`${$6(j)}:${$6(Z)} ${J.period}`}};var Y3=(J)=>{let $=J>=12?"PM":"AM",Q=J%12;if(Q===0)Q=12;return{hours:Q,period:$}};var j6={...Z9,KNOB_SIZE:45,CENTER_SIZE:8,NUMBER_SIZE:24,INNER_RADIUS:75,OUTER_RADIUS:100,TRACK_WIDTH:1.5,HAND_WIDTH:2};function qK(J){let $=document.documentElement,Q=getComputedStyle($),Z=Q.getPropertyValue(`--${J}-sys-color-primary`).trim()||"#6750A4",q=Q.getPropertyValue(`--${J}-sys-color-on-primary`).trim()||"#FFFFFF",j=Q.getPropertyValue(`--${J}-sys-color-on-surface`).trim()||"#1C1B1F",K=Q.getPropertyValue(`--${J}-sys-color-primary-rgb`).trim()||"103, 80, 164",W=`rgba(${Q.getPropertyValue(`--${J}-sys-color-on-surface-rgb`).trim()||"28, 27, 31"}, 0.05)`,z=`rgba(${K}, 0.1)`;return{primaryColor:Z,onPrimaryColor:q,onSurfaceColor:j,bgColor:W,selectedBgColor:z}}var P6=(J,$,Q)=>{let Z=J.getContext("2d");if(!Z){console.error("Could not get canvas context");return}let q=qK(Q.prefix),j=window.devicePixelRatio||1;J.width=j6.DIAMETER*j,J.height=j6.DIAMETER*j,Z.scale(j,j);let K=j6.DIAMETER/2,G=j6.DIAMETER/2,W=j6.DIAMETER/2;if(Z.clearRect(0,0,J.width,J.height),Z.beginPath(),Z.arc(K,G,W-2,0,2*Math.PI),Z.fillStyle=q.bgColor,Z.fill(),Z.beginPath(),Z.arc(K,G,j6.CENTER_SIZE/2,0,2*Math.PI),Z.fillStyle=q.primaryColor,Z.fill(),Q.activeSelector==="hour")if(Q.format==="24h")KK(Z,K,G,W,$.hours,q);else jK(Z,K,G,W,$.hours%12||12,q);else if(Q.activeSelector==="minute")U3(Z,K,G,W,$.minutes,q);else if(Q.activeSelector==="second"&&Q.showSeconds)U3(Z,K,G,W,$.seconds||0,q);GK(Z,K,G,$,Q,q)},jK=(J,$,Q,Z,q,j)=>{let K=j6.OUTER_RADIUS;for(let G=1;G<=12;G++){let W=G/6*Math.PI-Math.PI/2,z=$+K*Math.cos(W),Y=Q+K*Math.sin(W),U=G===q;if(U)J.beginPath(),J.arc(z,Y,j6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="16px Roboto, Arial, sans-serif",J.fillStyle=U?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(G.toString(),z,Y+2)}},KK=(J,$,Q,Z,q,j)=>{let K=j6.OUTER_RADIUS;for(let W=1;W<=12;W++){let z=W/6*Math.PI-Math.PI/2,Y=$+K*Math.cos(z),U=Q+K*Math.sin(z),X=W===q;if(X)J.beginPath(),J.arc(Y,U,j6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="16px Roboto, Arial, sans-serif",J.fillStyle=X?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(W.toString(),Y,U+2)}let G=j6.INNER_RADIUS;for(let W=13;W<=24;W++){let z=W===24?0:W,Y=(W-12)/6*Math.PI-Math.PI/2,U=$+G*Math.cos(Y),X=Q+G*Math.sin(Y),_=z===q;if(_)J.beginPath(),J.arc(U,X,j6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="14px Roboto, Arial, sans-serif",J.fillStyle=_?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText($6(z),U,X+2)}},U3=(J,$,Q,Z,q,j)=>{let K=j6.OUTER_RADIUS;for(let G=0;G<60;G+=5){let W=G/30*Math.PI-Math.PI/2,z=$+K*Math.cos(W),Y=Q+K*Math.sin(W),U=G===q;if(U)J.beginPath(),J.arc(z,Y,j6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="16px Roboto, Arial, sans-serif",J.fillStyle=U?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText($6(G),z,Y)}if(q%5!==0){let G=q/30*Math.PI-Math.PI/2,W=$+K*Math.cos(G),z=Q+K*Math.sin(G);J.beginPath(),J.arc(W,z,j6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill(),J.font="16px Roboto, Arial, sans-serif",J.fillStyle=j.primaryColor,J.textAlign="center",J.textBaseline="middle",J.fillText($6(q),W,z)}},GK=(J,$,Q,Z,q,j)=>{let K,G;if(q.activeSelector==="hour")if(q.format==="24h")if(Z.hours>=12)K=(Z.hours%12||12)/6*Math.PI-Math.PI/2,G=j6.INNER_RADIUS;else{let U=Z.hours;if(U===0)U=12;K=U/6*Math.PI-Math.PI/2,G=j6.OUTER_RADIUS}else K=(Z.hours%12||12)/6*Math.PI-Math.PI/2,G=j6.OUTER_RADIUS;else if(q.activeSelector==="minute")K=Z.minutes/30*Math.PI-Math.PI/2,G=j6.OUTER_RADIUS;else if(q.activeSelector==="second")K=(Z.seconds||0)/30*Math.PI-Math.PI/2,G=j6.OUTER_RADIUS;else return;J.beginPath(),J.moveTo($,Q),J.lineTo($+G*Math.cos(K),Q+G*Math.sin(K)),J.lineWidth=j6.HAND_WIDTH,J.strokeStyle=j.primaryColor,J.stroke();let W=$+G*Math.cos(K),z=Q+G*Math.sin(K);J.beginPath(),J.arc(W,z,j6.KNOB_SIZE/2,0,2*Math.PI),J.fillStyle=j.primaryColor,J.fill(),J.font="16px Roboto, Arial, sans-serif",J.fillStyle=j.onPrimaryColor,J.textAlign="center",J.textBaseline="middle";let Y="";if(q.activeSelector==="hour")if(q.format==="24h")Y=$6(Z.hours);else Y=String(Z.hours%12||12);else if(q.activeSelector==="minute")Y=$6(Z.minutes);else if(q.activeSelector==="second")Y=$6(Z.seconds||0);J.fillText(Y,W,z)},I8=(J,$,Q,Z)=>{let q=j6.DIAMETER/2,j=j6.DIAMETER/2,K=$-q,G=Q-j,W=Math.sqrt(K*K+G*G),z=Math.atan2(G,K)+Math.PI/2;if(z<0)z+=2*Math.PI;if(Z.activeSelector==="hour")if(Z.format==="24h"){let Y=(j6.INNER_RADIUS+j6.OUTER_RADIUS)/2,U=W<Y,X=Math.round(z/(Math.PI/6))%12;if(U&&X!==0)X+=12;else if(!U&&X===0)X=12;else if(U&&X===0)X=0;return X}else{let Y=Math.round(z/(Math.PI/6))%12;if(Y===0)Y=12;return Y}else if(Z.activeSelector==="minute"||Z.activeSelector==="second")return Math.round(z/(Math.PI/30))%60;return null};var d6=(J,$,Q,Z)=>{if(J.innerHTML="",Q.title){let L=document.createElement("div");L.className=`${Q.prefix}-time-picker-title`,L.textContent=Q.title,L.id=`${Q.prefix}-time-picker-title`,J.appendChild(L)}let q=document.createElement("div");q.className=`${Q.prefix}-time-picker-content`,J.appendChild(q);let j=document.createElement("div");j.className=`${Q.prefix}-time-picker-input-container`,q.appendChild(j);let{hours:K}=Q.format==="24h"?{hours:$.hours}:Y3($.hours),G=document.createElement("div");G.className=`${Q.prefix}-time-picker-time-input-field`;let W=document.createElement("input");W.type="number",W.className=`${Q.prefix}-time-picker-hours`,W.min=Q.format==="24h"?"0":"1",W.max=Q.format==="24h"?"23":"12",W.value=$6(K),W.setAttribute("data-type","hour"),W.setAttribute("inputmode","numeric"),W.setAttribute("pattern","[0-9]*"),G.appendChild(W),j.appendChild(G);let z=document.createElement("div");z.className=`${Q.prefix}-time-picker-separator`,z.textContent=":",j.appendChild(z);let Y=document.createElement("div");Y.className=`${Q.prefix}-time-picker-time-input-field`;let U=document.createElement("input");U.type="number",U.className=`${Q.prefix}-time-picker-minutes`,U.min="0",U.max="59",U.value=$6($.minutes),U.setAttribute("data-type","minute"),U.setAttribute("inputmode","numeric"),U.setAttribute("pattern","[0-9]*"),Y.appendChild(U),j.appendChild(Y);let X;if(Q.showSeconds){let L=document.createElement("div");L.className=`${Q.prefix}-time-picker-separator`,L.textContent=":",j.appendChild(L);let D=document.createElement("div");D.className=`${Q.prefix}-time-picker-time-input-field`,X=document.createElement("input"),X.type="number",X.className=`${Q.prefix}-time-picker-seconds`,X.min="0",X.max="59",X.value=$6($.seconds||0),X.setAttribute("data-type","second"),X.setAttribute("inputmode","numeric"),X.setAttribute("pattern","[0-9]*");let R=document.createElement("label");R.className=`${Q.prefix}-time-picker-input-label`,R.textContent="Second",D.appendChild(X),D.appendChild(R),j.appendChild(D)}if(Q.format==="12h"){let L=document.createElement("div");L.className=`${Q.prefix}-time-picker-period`;let D=document.createElement("div");D.className=`${Q.prefix}-time-picker-period-am ${$.period==="AM"?`${Q.prefix}-time-picker-period--selected`:""}`,D.textContent="AM",D.setAttribute("role","button"),D.setAttribute("tabindex","0"),D.setAttribute("aria-pressed",$.period==="AM"?"true":"false");let R=document.createElement("div");R.className=`${Q.prefix}-time-picker-period-pm ${$.period==="PM"?`${Q.prefix}-time-picker-period--selected`:""}`,R.textContent="PM",R.setAttribute("role","button"),R.setAttribute("tabindex","0"),R.setAttribute("aria-pressed",$.period==="PM"?"true":"false"),L.appendChild(D),L.appendChild(R),j.appendChild(L)}let _=document.createElement("div");_.className=`${Q.prefix}-time-picker-dial`,_.style.display=Q.type==="dial"?"block":"none",q.appendChild(_);let H=document.createElement("canvas");H.className=`${Q.prefix}-time-picker-dial-canvas`,H.width=Z9.DIAMETER,H.height=Z9.DIAMETER,H.style.width=`${Z9.DIAMETER}px`,H.style.height=`${Z9.DIAMETER}px`,_.appendChild(H);let B=document.createElement("div");B.className=`${Q.prefix}-time-picker-actions`,J.appendChild(B);let k=document.createElement("button");k.className=`${Q.prefix}-time-picker-toggle-type`,k.setAttribute("aria-label",Q.type==="dial"?"Switch to keyboard input":"Switch to dial selector"),k.innerHTML=Q.type==="dial"?Q.keyboardIcon||g6.KEYBOARD:Q.clockIcon||g6.CLOCK,B.appendChild(k);let M=document.createElement("div");M.className=`${Q.prefix}-time-picker-action-buttons`,B.appendChild(M);let V=document.createElement("button");V.className=`${Q.prefix}-time-picker-cancel`,V.textContent=Q.cancelText||"Cancel",V.setAttribute("type","button"),M.appendChild(V);let F=document.createElement("button");F.className=`${Q.prefix}-time-picker-confirm`,F.textContent=Q.confirmText||"OK",F.setAttribute("type","button"),M.appendChild(F);let N="hour";if(Q.type==="dial")setTimeout(()=>{P6(H,$,{type:Q.type,format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N})},0);k.addEventListener("click",()=>{if(_.style.display==="none")_.style.display="block",k.innerHTML=Q.keyboardIcon||g6.KEYBOARD,k.setAttribute("aria-label","Switch to keyboard input"),setTimeout(()=>{H.focus(),document.querySelectorAll(`.${Q.prefix}-time-picker-hours`).forEach((w)=>w.setAttribute("data-active","true")),document.querySelectorAll(`.${Q.prefix}-time-picker-minutes`).forEach((w)=>w.setAttribute("data-active","false")),document.querySelectorAll(`.${Q.prefix}-time-picker-seconds`).forEach((w)=>w.setAttribute("data-active","false")),P6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:"hour"})},50);else _.style.display="none",k.innerHTML=Q.clockIcon||g6.CLOCK,k.setAttribute("aria-label","Switch to dial selector"),setTimeout(()=>{W.focus(),W.select()},50)});let O=(L)=>{let D=L.target,R=D.getAttribute("data-type"),w=D.value;if(w==="")return;let A=parseInt(w,10);if(isNaN(A))return;if(R==="hour"){let x=A;if(Q.format==="12h"){if(A<0)x=1;if(A>12)x=12;if($.period==="PM"&&x!==12)x+=12;else if($.period==="AM"&&x===12)x=0}else{if(A<0)x=0;if(A>23)x=23}if($.hours=x,N="hour",W.setAttribute("data-active","true"),U.setAttribute("data-active","false"),X)X.setAttribute("data-active","false");if(P6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N}),Z)Z("hours",x)}else if(R==="minute"){let x=A;if(A<0)x=0;if(A>59)x=59;if($.minutes=x,N="minute",W.setAttribute("data-active","false"),U.setAttribute("data-active","true"),X)X.setAttribute("data-active","false");if(P6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N}),Z)Z("minutes",x)}else if(R==="second"){let x=A;if(A<0)x=0;if(A>59)x=59;if($.seconds=x,N="second",W.setAttribute("data-active","false"),U.setAttribute("data-active","false"),X)X.setAttribute("data-active","true");if(P6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N}),Z)Z("seconds",x)}};if(W.addEventListener("input",O),U.addEventListener("input",O),X)X.addEventListener("input",O);if(W.addEventListener("keyup",(L)=>{if(L.key==="Enter")U.focus(),U.select()}),U.addEventListener("keyup",(L)=>{if(L.key==="Enter")if(Q.showSeconds&&X)X.focus(),X.select();else F.focus()}),X)X.addEventListener("keyup",(L)=>{if(L.key==="Enter")F.focus()});let P=(L)=>{if($.period!==L){let D=$.period;if($.period=L,D==="AM"&&L==="PM"){if($.hours<12)$.hours+=12}else if(D==="PM"&&L==="AM"){if($.hours>=12)$.hours-=12}if(Q.format==="12h"){let w=$.hours===0?12:$.hours>12?$.hours-12:$.hours;W.value=$6(w)}document.querySelectorAll(`.${Q.prefix}-time-picker-period-am, .${Q.prefix}-time-picker-period-pm`).forEach((w)=>{w.classList.remove(`${Q.prefix}-time-picker-period--selected`),w.setAttribute("aria-pressed","false")});let R=document.querySelector(`.${Q.prefix}-time-picker-period-${L.toLowerCase()}`);if(R)R.classList.add(`${Q.prefix}-time-picker-period--selected`),R.setAttribute("aria-pressed","true");if(_.style.display==="block")P6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N});if(Z)Z("hours",$.hours)}};if(Q.format==="12h"){let L=document.querySelector(`.${Q.prefix}-time-picker-period-am`),D=document.querySelector(`.${Q.prefix}-time-picker-period-pm`);if(L)L.addEventListener("click",()=>{P("AM")});if(D)D.addEventListener("click",()=>{P("PM")})}if(Q.type==="dial"||_.style.display==="block"){if(H.addEventListener("click",(L)=>{let D=H.getBoundingClientRect(),R=L.clientX-D.left,w=L.clientY-D.top,A=I8(H,R,w,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N});if(A!==null){if(N==="hour"){let x=A;if(Q.format==="12h"){if($.period==="PM"&&A!==12)x+=12;else if($.period==="AM"&&A===12)x=0}if($.hours=x,Q.format==="12h"){let I=x===0?12:x>12?x-12:x;W.value=$6(I)}else W.value=$6(x);if(Z)Z("hours",x)}else if(N==="minute"){if($.minutes=A,U.value=$6(A),Z)Z("minutes",A)}else if(N==="second"&&X){if($.seconds=A,X.value=$6(A),Z)Z("seconds",A)}P6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N})}}),W.addEventListener("click",()=>{if(_.style.display==="block"){if(N="hour",W.setAttribute("data-active","true"),U.setAttribute("data-active","false"),X)X.setAttribute("data-active","false");P6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N})}}),U.addEventListener("click",()=>{if(_.style.display==="block"){if(N="minute",W.setAttribute("data-active","false"),U.setAttribute("data-active","true"),X)X.setAttribute("data-active","false");P6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N})}}),X)X.addEventListener("click",()=>{if(_.style.display==="block")N="second",W.setAttribute("data-active","false"),U.setAttribute("data-active","false"),X.setAttribute("data-active","true"),P6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N})})}};var X3=(J,$,Q,Z,q,j)=>{let K=!!q.isOpen,G=(U)=>{if(U.key==="Escape")z.close(),j.events.emit(_6.CANCEL)},W=(U)=>{if(U.target===$)z.close()},z={element:J.element,modalElement:$,dialogElement:Q,isOpen:K,open(){if(K)return this;if($.style.display="block",$.offsetWidth,$.classList.add("active"),Q.classList.add("active"),document.addEventListener("keydown",G),$.addEventListener("click",W),K=!0,J.element.classList.add(`${q.prefix}-time-picker--open`),setTimeout(()=>{d6(Q,Z,q)},50),j.events.emit(_6.OPEN),q.onOpen)q.onOpen();return this},close(){if(!K)return this;if($.classList.remove("active"),Q.classList.remove("active"),setTimeout(()=>{$.style.display="none"},300),document.removeEventListener("keydown",G),$.removeEventListener("click",W),K=!1,J.element.classList.remove(`${q.prefix}-time-picker--open`),j.events.emit(_6.CLOSE),q.onClose)q.onClose();return this},toggle(){return K?this.close():this.open()},getValue(){return W3(Z,q.format==="24h")},getTimeObject(){return{...Z}},setValue(U){try{let X=U.split(":"),_=parseInt(X[0],10),H=parseInt(X[1],10),B=X[2]?parseInt(X[2],10):0;if(isNaN(_)||_<0||_>23||isNaN(H)||H<0||H>59||isNaN(B)||B<0||B>59)throw new Error("Invalid time format. Use HH:MM or HH:MM:SS (24-hour format).");if(Z.hours=_,Z.minutes=H,Z.seconds=B,Z.period=_>=12?"PM":"AM",d6(Q,Z,q),j.events.emit(_6.CHANGE,this.getValue()),q.onChange)q.onChange(this.getValue())}catch(X){console.error("Error setting time value:",X)}return this},setType(U){if(q.type===U)return this;return q.type=U,Q.classList.remove(`${q.prefix}-time-picker-dialog--${"dial"}`,`${q.prefix}-time-picker-dialog--${"input"}`),Q.classList.add(`${q.prefix}-time-picker-dialog--${U}`),d6(Q,Z,q),this},getType(){return q.type},setFormat(U){if(q.format===U)return this;if(q.format=U,Q.classList.remove(`${q.prefix}-time-picker-dialog--${"12h"}`,`${q.prefix}-time-picker-dialog--${"24h"}`),Q.classList.add(`${q.prefix}-time-picker-dialog--${U}`),U==="24h")Z.period=Z.hours>=12?"PM":"AM";else Z.period=Z.hours>=12?"PM":"AM";return d6(Q,Z,q),j.events.emit(_6.CHANGE,this.getValue()),this},getFormat(){return q.format},setOrientation(U){if(q.orientation===U)return this;return q.orientation=U,Q.classList.remove(`${q.prefix}-time-picker-dialog--${"vertical"}`,`${q.prefix}-time-picker-dialog--${"horizontal"}`),Q.classList.add(`${q.prefix}-time-picker-dialog--${U}`),d6(Q,Z,q),this},getOrientation(){return q.orientation},setTitle(U){q.title=U;let X=Q.querySelector(Q6.TITLE);if(X)X.textContent=U;else d6(Q,Z,q);return this},getTitle(){return q.title||""},destroy(){if(K)this.close();if($&&$.parentNode)$.parentNode.removeChild($);j.lifecycle.destroy()},on(U,X){return j.events.on(U,X),this},off(U,X){return j.events.off(U,X),this}};Q.addEventListener("click",(U)=>{let X=U.target;if(X.closest(Q6.CANCEL_BUTTON)){if(z.close(),j.events.emit(_6.CANCEL),q.onCancel)q.onCancel()}if(X.closest(Q6.CONFIRM_BUTTON)){if(z.close(),j.events.emit(_6.CONFIRM,z.getValue()),q.onConfirm)q.onConfirm(z.getValue())}if(X.closest(Q6.TOGGLE_TYPE_BUTTON)){let _=q.type==="dial"?"input":"dial";z.setType(_)}if(X.closest(Q6.PERIOD_AM)){if(Z.period!=="AM"){if(Z.period="AM",Z.hours>=12)Z.hours-=12;if(d6(Q,Z,q),j.events.emit(_6.CHANGE,z.getValue()),q.onChange)q.onChange(z.getValue())}}if(X.closest(Q6.PERIOD_PM)){if(Z.period!=="PM"){if(Z.period="PM",Z.hours<12)Z.hours+=12;if(d6(Q,Z,q),j.events.emit(_6.CHANGE,z.getValue()),q.onChange)q.onChange(z.getValue())}}if(X.closest(Q6.DIAL_CANVAS)){if(q.type==="dial"){let _=X,H=_.getBoundingClientRect(),B=U.clientX-H.left,k=U.clientY-H.top,M="hour",V=Q.querySelector(Q6.HOURS_INPUT),F=Q.querySelector(Q6.MINUTES_INPUT),N=Q.querySelector(Q6.SECONDS_INPUT);if(V&&V.getAttribute("data-active")==="true")M="hour";else if(F&&F.getAttribute("data-active")==="true")M="minute";else if(q.showSeconds&&N&&N.getAttribute("data-active")==="true")M="second";let O=I8(_,B,k,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:M});if(O!==null){if(M==="hour"){let P=O;if(q.format==="12h"){if(Z.period==="PM"&&O!==12)P+=12;else if(Z.period==="AM"&&O===12)P=0}if(Z.hours!==P){Z.hours=P;let L=V;if(L)L.textContent=$6(q.format==="24h"?P:P%12||12);let D=Q.querySelector(Q6.DIAL_CANVAS);if(D)P6(D,Z,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:M});if(j.events.emit(_6.CHANGE,z.getValue()),q.onChange)q.onChange(z.getValue())}}else if(M==="minute"){if(Z.minutes!==O){Z.minutes=O;let P=F;if(P)P.textContent=$6(O);let L=Q.querySelector(Q6.DIAL_CANVAS);if(L)P6(L,Z,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:M});if(j.events.emit(_6.CHANGE,z.getValue()),q.onChange)q.onChange(z.getValue())}}else if(M==="second"&&q.showSeconds){if(Z.seconds!==O){Z.seconds=O;let P=N;if(P)P.textContent=$6(O);let L=Q.querySelector(Q6.DIAL_CANVAS);if(L)P6(L,Z,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:M});if(j.events.emit(_6.CHANGE,z.getValue()),q.onChange)q.onChange(z.getValue())}}}}}});let Y=(U)=>{let X=U.target,_=X.getAttribute("data-type"),H=parseInt(X.value,10);if(isNaN(H))return;if(_==="hour"){let B=H;if(q.format==="12h"){if(H<1)B=12;if(H>12)B=1;if(Z.period==="PM"&&B!==12)B+=12;else if(Z.period==="AM"&&B===12)B=0}else{if(H<0)B=0;if(H>23)B=23}Z.hours=B}else if(_==="minute"){let B=H;if(B<0)B=0;if(B>59)B=59;Z.minutes=B}else if(_==="second"){let B=H;if(B<0)B=0;if(B>59)B=59;Z.seconds=B}if(d6(Q,Z,q),j.events.emit(_6.CHANGE,z.getValue()),q.onChange)q.onChange(z.getValue())};return Q.addEventListener("change",(U)=>{let X=U.target;if(X.matches(Q6.HOURS_INPUT)||X.matches(Q6.MINUTES_INPUT)||X.matches(Q6.SECONDS_INPUT))Y(U)}),Q.addEventListener("keyup",(U)=>{let X=U.target;if(X.matches(Q6.HOURS_INPUT)||X.matches(Q6.MINUTES_INPUT)||X.matches(Q6.SECONDS_INPUT)){if(U.key==="Enter"){if(Y(U),X.matches(Q6.HOURS_INPUT)){let _=Q.querySelector(Q6.MINUTES_INPUT);if(_)_.focus()}else if(X.matches(Q6.MINUTES_INPUT))if(q.showSeconds){let _=Q.querySelector(Q6.SECONDS_INPUT);if(_)_.focus()}else{let _=Q.querySelector(Q6.CONFIRM_BUTTON);if(_)_.focus()}else if(X.matches(Q6.SECONDS_INPUT)){let _=Q.querySelector(Q6.CONFIRM_BUTTON);if(_)_.focus()}}}}),z};var zK=(J={})=>{let $=j3(J);try{let Q=b(S,g(),E(K3($)),C())($),Z=document.createElement("div");Z.className=`${u}-time-picker-modal`,Z.style.display="none",Z.style.position="fixed",Z.style.top="0",Z.style.left="0",Z.style.width="100%",Z.style.height="100%",Z.style.backgroundColor="rgba(0, 0, 0, 0.4)",Z.style.zIndex=N7.MODAL.toString(),Z.setAttribute("role","presentation");let q=document.createElement("div");q.className=[`${u}-time-picker-dialog`,`${u}-time-picker-dialog--${$.type}`,`${u}-time-picker-dialog--${$.orientation}`,`${u}-time-picker-dialog--${$.format}`].join(" "),q.style.position="absolute",q.style.top="50%",q.style.left="50%",q.style.transform="translate(-50%, -50%)",q.style.zIndex=N7.DIALOG.toString(),Z.appendChild(q),(typeof $.container==="string"?document.querySelector($.container)||document.body:$.container||document.body).appendChild(Z);let K;if($.value)K=z3($.value,$.format);else{let W=new Date;K={hours:W.getHours(),minutes:W.getMinutes(),seconds:$.showSeconds?W.getSeconds():0,period:W.getHours()>=12?"PM":"AM"}}d6(q,K,$);let G=X3(Q,Z,q,K,$,G3(Q));if($.isOpen)setTimeout(()=>G.open(),0);return G}catch(Q){throw console.error("TimePicker creation error:",Q),new Error(`Failed to create time picker: ${Q.message}`)}},I0=zK;J6();t();var S8={SMALL:"small",MEDIUM:"medium",LARGE:"large",CENTER:"center"},S0={DEFAULT:"default",SCROLLED:"scrolled",FIXED:"fixed"},H9={TAG:"header",TYPE:S8.SMALL,SCROLLABLE:!0,COMPRESSIBLE:!0,SCROLL_THRESHOLD:4},b0={ROOT:"top-app-bar",SMALL:"top-app-bar--small",MEDIUM:"top-app-bar--medium",LARGE:"top-app-bar--large",CENTER:"top-app-bar--center",SCROLLED:"top-app-bar--scrolled",FIXED:"top-app-bar--fixed",ROW:"top-app-bar-row",SECTION:"top-app-bar-section",SECTION_LEADING:"top-app-bar-section--leading",SECTION_HEADLINE:"top-app-bar-section--headline",SECTION_TRAILING:"top-app-bar-section--trailing",TITLE:"top-app-bar-title"};var WK={tag:H9.TAG,type:H9.TYPE,scrollable:H9.SCROLLABLE,compressible:H9.COMPRESSIBLE,scrollThreshold:H9.SCROLL_THRESHOLD},B3=(J={})=>d(WK,J,"top-app-bar");var F3=(J={})=>{let $=B3(J),Q=S($),Z=()=>{let B=document.createElement("div");B.className=`${Q.getClass("top-app-bar")}-leading`;let k=document.createElement("h1");if(k.className=`${Q.getClass("top-app-bar")}-headline`,$.title)k.textContent=$.title;let M=document.createElement("div");return M.className=`${Q.getClass("top-app-bar")}-trailing`,{leadingContainer:B,headlineElement:k,trailingContainer:M}},{leadingContainer:q,headlineElement:j,trailingContainer:K}=Z(),G=()=>{let B=[$.class];if($.type!=="small")B.push(`${Q.getClass("top-app-bar")}--${$.type}`);if($.compressible&&($.type==="medium"||$.type==="large"))B.push(`${Q.getClass("top-app-bar")}--compressible`);return B.filter(Boolean)},W=E({tag:$.tag,componentName:"top-app-bar",className:G(),attributes:{role:"banner","aria-label":"Top app bar"},interactive:!0})(Q),z=g()(W),Y=C()(z);(()=>{if($.type==="medium"||$.type==="large"){let B=document.createElement("div");B.className=`${Q.getClass("top-app-bar")}-row`,B.appendChild(q),B.appendChild(K);let k=document.createElement("div");k.className=`${Q.getClass("top-app-bar")}-row`,k.appendChild(j),Y.element.appendChild(B),Y.element.appendChild(k)}else Y.element.appendChild(q),Y.element.appendChild(j),Y.element.appendChild(K)})();let X=!1;if($.scrollable){let B=()=>{let M=window.scrollY>$.scrollThreshold;if(X!==M){if(X=M,X)Y.element.classList.add(`${Q.getClass("top-app-bar")}--scrolled`);else Y.element.classList.remove(`${Q.getClass("top-app-bar")}--scrolled`);$.onScroll?.(X)}};window.addEventListener("scroll",B,{passive:!0}),B();let k=Y.lifecycle.destroy;Y.lifecycle.destroy=()=>{window.removeEventListener("scroll",B),k()}}let _=(B)=>{while(Y.element.firstChild)Y.element.removeChild(Y.element.firstChild);if(["small","medium","large","center"].forEach((k)=>{Y.element.classList.remove(`${Q.getClass("top-app-bar")}--${k}`)}),B!=="small")Y.element.classList.add(`${Q.getClass("top-app-bar")}--${B}`);if(Y.element.classList.toggle(`${Q.getClass("top-app-bar")}--compressible`,$.compressible&&(B==="medium"||B==="large")),B==="medium"||B==="large"){let k=document.createElement("div");k.className=`${Q.getClass("top-app-bar")}-row`,k.appendChild(q),k.appendChild(K);let M=document.createElement("div");M.className=`${Q.getClass("top-app-bar")}-row`,M.appendChild(j),Y.element.appendChild(k),Y.element.appendChild(M)}else Y.element.appendChild(q),Y.element.appendChild(j),Y.element.appendChild(K)};return{...Y,setTitle(B){return j.textContent=B,this},getTitle(){return j.textContent||""},addLeadingElement(B){return q.appendChild(B),this},addTrailingElement(B){return K.appendChild(B),this},setType(B){return $.type=B,_(B),this},setScrollState(B){if(X=B,B)this.element.classList.add(`${Q.getClass("top-app-bar")}--scrolled`);else this.element.classList.remove(`${Q.getClass("top-app-bar")}--scrolled`);return this},getHeadlineElement(){return j},getLeadingContainer(){return q},getTrailingContainer(){return K}}};var H3=F3;y6();J6();c();o();var R6={TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left",TOP_START:"top-start",TOP_END:"top-end",RIGHT_START:"right-start",RIGHT_END:"right-end",BOTTOM_START:"bottom-start",BOTTOM_END:"bottom-end",LEFT_START:"left-start",LEFT_END:"left-end"};var M3=8;var k3=({lifecycle:J})=>($)=>{let Q=null,Z=R6.BOTTOM,q=!1,j=null,K=null,G=300,W=100,z=!0,Y=!0,U=document.createElement("div");U.className=`${$.getClass("tooltip")}__arrow`,$.element.appendChild(U),document.body.appendChild($.element),$.element.setAttribute("aria-hidden","true");let X=()=>{if(!Q)return{top:0,left:0};let P=$.element.getBoundingClientRect(),L=Q.getBoundingClientRect(),D=window.scrollY||window.pageYOffset,R=window.scrollX||window.pageXOffset,w=M3,A=0,x=0,I;switch(Z){case R6.TOP:A=L.top+D-P.height-w,x=L.left+R+L.width/2-P.width/2,I="bottom";break;case R6.TOP_START:A=L.top+D-P.height-w,x=L.left+R,I="bottom-start";break;case R6.TOP_END:A=L.top+D-P.height-w,x=L.left+R+L.width-P.width,I="bottom-end";break;case R6.RIGHT:A=L.top+D+L.height/2-P.height/2,x=L.left+R+L.width+w,I="left";break;case R6.RIGHT_START:A=L.top+D,x=L.left+R+L.width+w,I="left-start";break;case R6.RIGHT_END:A=L.top+D+L.height-P.height,x=L.left+R+L.width+w,I="left-end";break;case R6.BOTTOM:A=L.top+D+L.height+w,x=L.left+R+L.width/2-P.width/2,I="top";break;case R6.BOTTOM_START:A=L.top+D+L.height+w,x=L.left+R,I="top-start";break;case R6.BOTTOM_END:A=L.top+D+L.height+w,x=L.left+R+L.width-P.width,I="top-end";break;case R6.LEFT:A=L.top+D+L.height/2-P.height/2,x=L.left+R-P.width-w,I="right";break;case R6.LEFT_START:A=L.top+D,x=L.left+R-P.width-w,I="right-start";break;case R6.LEFT_END:A=L.top+D+L.height-P.height,x=L.left+R-P.width-w,I="right-end";break;default:A=L.top+D+L.height+w,x=L.left+R+L.width/2-P.width/2,I="top"}let r=window.innerWidth;if(x<0)x=0;else if(x+P.width>r)x=r-P.width;return{top:A,left:x,arrowPosition:I}},_=(P)=>{if(Y)P.addEventListener("mouseenter",B),P.addEventListener("mouseleave",k);if(z)P.addEventListener("focus",M),P.addEventListener("blur",V)},H=(P)=>{if(P)P.removeEventListener("mouseenter",B),P.removeEventListener("mouseleave",k),P.removeEventListener("focus",M),P.removeEventListener("blur",V)},B=()=>F.show(),k=()=>F.hide(),M=()=>F.show(),V=()=>F.hide(),F={element:$.element,target:Q,lifecycle:J,getClass:$.getClass,setText(P){let L=document.createTextNode(P);while($.element.firstChild!==U)$.element.removeChild($.element.firstChild);if($.element.insertBefore(L,U),q)this.updatePosition();return this},getText(){let P=$.element.cloneNode(!0),L=P.querySelector(`.${$.getClass("tooltip")}__arrow`);if(L)L.remove();return P.textContent||""},setPosition(P){Z=P;let L=$.getClass("tooltip"),D=Object.values(R6).map((R)=>`${L}--${R}`);if($.element.classList.remove(...D),$.element.classList.add(`${L}--${P}`),q)this.updatePosition();return this},getPosition(){return Z},setTarget(P){if(Q)H(Q);if(Q=P,this.target=P,Q.setAttribute("aria-describedby",$.element.id),_(Q),q)this.updatePosition();return this},show(P=!1){if(j!==null)window.clearTimeout(j),j=null;if(K!==null)window.clearTimeout(K),K=null;let L=()=>{if(!Q)return this;$.element.setAttribute("aria-hidden","false"),$.element.classList.add(`${$.getClass("tooltip")}--visible`),q=!0,this.updatePosition(),window.addEventListener("resize",N),window.addEventListener("scroll",O)};if(P)L();else j=window.setTimeout(L,G);return this},hide(P=!1){if(K!==null)window.clearTimeout(K),K=null;if(j!==null)window.clearTimeout(j),j=null;let L=()=>{$.element.setAttribute("aria-hidden","true"),$.element.classList.remove(`${$.getClass("tooltip")}--visible`),q=!1,window.removeEventListener("resize",N),window.removeEventListener("scroll",O)};if(P)L();else K=window.setTimeout(L,W);return this},isVisible(){return q},updatePosition(){if(!Q)return this;let{top:P,left:L,arrowPosition:D}=X();if($.element.style.top=`${Math.round(P)}px`,$.element.style.left=`${Math.round(L)}px`,D)U.className=`${$.getClass("tooltip")}__arrow`,U.classList.add(`${$.getClass("tooltip")}__arrow--${D}`);return this},destroy(){if(j!==null)window.clearTimeout(j);if(K!==null)window.clearTimeout(K);if(Q)H(Q),Q.removeAttribute("aria-describedby");if(window.removeEventListener("resize",N),window.removeEventListener("scroll",O),$.element.parentNode)$.element.parentNode.removeChild($.element);J.destroy()}},N=()=>{F.updatePosition()},O=()=>{F.updatePosition()};return F};t();var b8={TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left",TOP_START:"top-start",TOP_END:"top-end",RIGHT_START:"right-start",RIGHT_END:"right-end",BOTTOM_START:"bottom-start",BOTTOM_END:"bottom-end",LEFT_START:"left-start",LEFT_END:"left-end"},v8={DEFAULT:"default",RICH:"rich",PLAIN:"plain"},v0={SHOW:"show",HIDE:"hide",ENTER:"enter",LEAVE:"leave"},l6={POSITION:b8.BOTTOM,VARIANT:v8.DEFAULT,VISIBLE:!1,SHOW_DELAY:300,HIDE_DELAY:100,OFFSET:8,ARROW_SIZE:8,SHOW_ON_FOCUS:!0,SHOW_ON_HOVER:!0,RICH:!1},C0={ROOT:"tooltip",CONTAINER:"tooltip-container",ARROW:"tooltip-arrow",CONTENT:"tooltip-content",VISIBLE:"tooltip--visible",HIDDEN:"tooltip--hidden",DEFAULT:"tooltip--default",RICH:"tooltip--rich",PLAIN:"tooltip--plain",POSITION_PREFIX:"tooltip--"};var YK={position:l6.POSITION,variant:l6.VARIANT,visible:l6.VISIBLE,showDelay:l6.SHOW_DELAY,hideDelay:l6.HIDE_DELAY,showOnFocus:l6.SHOW_ON_FOCUS,showOnHover:l6.SHOW_ON_HOVER,rich:l6.RICH},N3=(J={})=>d(YK,J,"tooltip"),V3=(J)=>{let $={role:"tooltip","aria-hidden":"true"};if(J.zIndex!==void 0)$.style=`z-index: ${J.zIndex};`;return p(J,{tag:"div",attributes:$,className:[J.class,`${J.prefix}-tooltip--${J.position}`,`${J.prefix}-tooltip--${J.variant}`],text:J.text||""})},_3=(J)=>({lifecycle:{destroy:()=>J.lifecycle.destroy()}});var UK=()=>{return`${u}-tooltip-${Math.random().toString(36).substring(2,9)}`},XK=(J={})=>{let $=N3(J);try{let Q=b(S,E(V3($)),C(),(Z)=>k3(_3(Z))(Z))($);if(Q.element.id=UK(),$.target)Q.setTarget($.target);if($.text)Q.setText($.text);if($.visible)Q.show(!0);return Q}catch(Q){throw console.error("Tooltip creation error:",Q),new Error(`Failed to create tooltip: ${Q.message}`)}},E0=XK;w7();l9();c();o();S1();var BK=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize list manager: missing element"),$;let Q=J.renderItem,Z=null,q=(G,W,z)=>{let Y=Q?Q(G,W,z):j(G,z);if(Y&&G.id&&!Y.hasAttribute("data-id"))Y.setAttribute("data-id",G.id);if(Z)Z(G,Y);return Y};function j(G,W){let z=W||document.createElement("div");return z.className=e.ITEM,z.textContent=G.text||G.title||G.headline||G.name||G.id,z}let K=u$(J.collection,$.element,{...J,renderItem:q,afterLoad:(G)=>{if($.emit(k9.LOAD,G),J.afterLoad)J.afterLoad(G)}});if(K.setRenderHook=(G)=>{Z=G},$.lifecycle&&$.lifecycle.destroy){let G=$.lifecycle.destroy;$.lifecycle.destroy=()=>{K.destroy(),G()}}return{...$,list:K}},h0=BK;v9();r7();var FK=(J)=>($)=>{if(!$.element||!J.trackSelection)return $;let Q=new Set;if(Array.isArray(J.items))J.items.forEach((G)=>{if(G.selected)Q.add(G.id)});if(Array.isArray(J.initialSelection))J.initialSelection.forEach((G)=>{Q.add(G)});let Z=()=>{if(!$.list){setTimeout(Z,0);return}if(typeof $.list.setRenderHook==="function")$.list.setRenderHook((G,W)=>{if(Q.has(G.id)){if(!O6(W,e.SELECTED))f(W,e.SELECTED)}else if(O6(W,e.SELECTED))q6(W,e.SELECTED)})};Z();let q=(G)=>{if(!G.target.closest("[data-id]"))return;let W=G.target.closest("[data-id]"),z=W.getAttribute("data-id");if(!z)return;let Y=$.list?.getAllItems().find((X)=>X.id===z);if(!Y)return;let U={item:Y,element:W,originalEvent:G,component:$,preventDefault:()=>{U.defaultPrevented=!0},defaultPrevented:!1};if($.emit(k9.SELECT,U),U.defaultPrevented)return;if(J.multiSelect)if(Q.has(z))Q.delete(z),q6(W,e.SELECTED);else Q.add(z),f(W,e.SELECTED);else if(O6(W,e.SELECTED))Q.clear(),q6(W,e.SELECTED);else $.element.querySelectorAll(`.${u}-${e.SELECTED}`).forEach((H)=>{q6(H,e.SELECTED)}),Q.clear(),Q.add(z),f(W,e.SELECTED)};$.element.addEventListener("click",q);let j=()=>{$.element.querySelectorAll("[data-id]").forEach((W)=>{let z=W.getAttribute("data-id"),Y=Q.has(z);if(Y&&!O6(W,e.SELECTED))f(W,e.SELECTED);else if(!Y&&O6(W,e.SELECTED))q6(W,e.SELECTED)})},K=(G,W)=>{if(W)Q.add(G);else Q.delete(G);let z=$.element.querySelector(`[data-id="${G}"]`);if(z){if(W&&!O6(z,e.SELECTED))f(z,e.SELECTED);else if(!W&&O6(z,e.SELECTED))q6(z,e.SELECTED)}};if($.lifecycle&&$.lifecycle.destroy){let G=$.lifecycle.destroy;$.lifecycle.destroy=()=>{$.element.removeEventListener("click",q),G()}}return{...$,getSelectedItems:()=>{return($.list?.getAllItems()||[]).filter((W)=>Q.has(W.id))},getSelectedItemIds:()=>Array.from(Q),isItemSelected:(G)=>Q.has(G),selectItem:(G)=>{return K(G,!0),$},deselectItem:(G)=>{return K(G,!1),$},clearSelection:()=>{if(Q.size>0)Q.clear(),$.element.querySelectorAll(`.${u}-${e.SELECTED}`).forEach((W)=>q6(W,e.SELECTED));return $},setSelection:(G)=>{if(!G?.length&&Q.size===0)return $;if(Q.clear(),Array.isArray(G))G.forEach((W)=>Q.add(W));return j(),$}}},u0=FK;var L3=({list:J,events:$,lifecycle:Q})=>(Z)=>({...Z,element:Z.element,refresh:async()=>{return await J.refresh(),Z},loadMore:async()=>{return await J.loadMore()},scrollToItem:(q,j="start")=>{return J.scrollToItem(q,j),Z},getVisibleItems:()=>J.getVisibleItems(),getAllItems:()=>J.getAllItems(),isLoading:()=>J.isLoading(),hasNextPage:()=>J.hasNextPage(),on:(q,j)=>{return $.on(q,j),Z},off:(q,j)=>{return $.off(q,j),Z},destroy:()=>{Q.destroy()}});t();var HK={collection:j9.COLLECTION,transform:(J)=>J,baseUrl:j9.BASE_URL,items:[],pageSize:j9.PAGE_SIZE,renderBufferSize:j9.RENDER_BUFFER_SIZE,renderItem:null,trackSelection:!0,multiSelect:!1},D3=(J={})=>{if(!J.renderItem&&!Array.isArray(J.items))throw new Error("List requires either static items or a renderItem function");if(Array.isArray(J.items)&&!J.renderItem)J.renderItem=($)=>{let Q=document.createElement("div");return Q.className="mtrl-list-item",Q.textContent=$.text||$.title||$.headline||$.name||$.id,Q};return d(HK,J,"list")},O3=(J)=>{let $={role:"list",tabindex:"0"};if(J.ariaLabel)$["aria-label"]=J.ariaLabel;return p(J,{tag:"div",attributes:$,className:[e.CONTAINER,J.class],forwardEvents:{scroll:!0,keydown:!0}})},P3=(J)=>({list:{refresh:J.list?.refresh,loadMore:J.list?.loadMore,scrollToItem:J.list?.scrollToItem,getVisibleItems:J.list?.getVisibleItems,getAllItems:J.list?.getAllItems,isLoading:J.list?.isLoading,hasNextPage:J.list?.hasNextPage},events:{on:J.on,off:J.off},lifecycle:{destroy:J.lifecycle?.destroy}});var MK=(J={})=>{try{let $=D3(J);return b(S,g(),E(O3($)),h0($),u0($),C(),(Z)=>L3(P3(Z))(Z))($)}catch($){throw console.error("List creation error:",$),new Error(`Failed to create list: ${$.message}`)}},f0=MK;var R3=(J={})=>{return{rail:null,drawer:null,activeSection:J.activeSection||null,activeSubsection:J.activeSubsection||null,items:J.items||{},mouseInDrawer:!1,mouseInRail:!1,hoverTimer:null,closeTimer:null,processingChange:!1,isMobile:!1,overlayElement:null,closeButtonElement:null,resizeObserver:null,outsideClickHandler:null,outsideClickHandlerSet:!1}},g0=(J={})=>{return{animateDrawer:J.animateDrawer!==!1,showLabelsOnRail:J.showLabelsOnRail!==!1,hideDrawerOnClick:J.hideDrawerOnClick||!1,expanded:J.expanded===!0,hoverDelay:J.hoverDelay||200,closeDelay:J.closeDelay||100,railOptions:J.railOptions||{},drawerOptions:J.drawerOptions||{}}},d0=(J={})=>{return{breakpoint:J.breakpoint||960,lockBodyScroll:J.lockBodyScroll!==!1,hideOnClickOutside:J.hideOnClickOutside!==!1,enableSwipeGestures:J.enableSwipeGestures!==!1,optimizeForTouch:J.optimizeForTouch!==!1,overlayClass:J.overlayClass||"mtrl-nav-overlay",closeButtonClass:J.closeButtonClass||"mtrl-nav-close-btn",bodyLockClass:J.bodyLockClass||"mtrl-body-drawer-open"}};D7();var A3=(J,$,Q,Z)=>{if(!J.drawer||!$||!J.items[$])return;let j=J.items[$].items||[];if(j.length===0){Z();return}let K=J.drawer.getAllItems();if(K?.length>0)K.forEach((G)=>{J.drawer.removeItem(G.config.id)});j.forEach((G)=>{J.drawer.addItem(G)}),Q()},w3=(J,$)=>{let Q=Object.keys(J.items||{}).map((q)=>({id:q,label:J.items[q]?.label||q,icon:J.items[q]?.icon||"",active:q===J.activeSection})),Z=W7({variant:"rail",position:"left",showLabels:$.showLabelsOnRail,items:Q,...$.railOptions});return document.body.appendChild(Z.element),Z},x3=(J,$)=>{let Q=W7({variant:"drawer",position:"left",items:[],...$.drawerOptions});if(document.body.appendChild(Q.element),Q.element.dataset.id="drawer",!$.expanded)Q.element.classList.add("mtrl-nav--hidden"),Q.element.setAttribute("aria-hidden","true");return Q},y3=(J,$)=>{if(!J.drawer)return;if(J.drawer.element.classList.remove("mtrl-nav--hidden"),J.drawer.element.setAttribute("aria-hidden","false"),J.isMobile){if(J.overlayElement)J.overlayElement.classList.add("active"),J.overlayElement.setAttribute("aria-hidden","false");if($.lockBodyScroll)document.body.classList.add($.bodyLockClass);if(J.closeButtonElement)J.closeButtonElement.style.display="flex"}},T3=(J,$)=>{if(!J.drawer)return;if(J.drawer.element.classList.add("mtrl-nav--hidden"),J.drawer.element.setAttribute("aria-hidden","true"),J.overlayElement)J.overlayElement.classList.remove("active"),J.overlayElement.setAttribute("aria-hidden","true");if($.lockBodyScroll)document.body.classList.remove($.bodyLockClass)},I3=(J)=>{if(!J.drawer)return!1;return!J.drawer.element.classList.contains("mtrl-nav--hidden")},S3=(J,$,Q,Z,q)=>{let j=J.isMobile;if(J.isMobile=window.innerWidth<=$.breakpoint||L4(),j!==J.isMobile){if(J.isMobile)Q();else Z();if(q.onViewChange)q.onViewChange({mobile:J.isMobile,previousMobile:j,width:window.innerWidth})}},b3=(J)=>{if(J.overlayElement&&J.overlayElement.parentNode)J.overlayElement.parentNode.removeChild(J.overlayElement),J.overlayElement=null;if(J.rail)J.rail.destroy(),J.rail=null;if(J.drawer)J.drawer.destroy(),J.drawer=null;J.activeSection=null,J.activeSubsection=null,J.mouseInDrawer=!1,J.mouseInRail=!1,J.processingChange=!1,J.isMobile=!1},v3=(J,$,Q,Z)=>{if(!$||!J.items[$])return;if(J.activeSection===$&&J.activeSubsection===Q)return;if(J.activeSection=$,J.rail)J.rail.setActive($,Z);if(Q&&J.drawer)J.activeSubsection=Q,J.drawer.setActive(Q,Z)};var C3=(J,$,Q,Z,q,j)=>{let K=J.rail;if(!K)return;K.on("change",(G)=>{let W=G?.id;if(!W||J.processingChange)return;let z=G?.source==="userAction";if(J.processingChange=!0,J.activeSection=W,Q(W),j.onSectionChange&&z)j.onSectionChange(W,{source:z?"userClick":"programmatic"});setTimeout(()=>{J.processingChange=!1},50)}),K.on("mouseover",(G)=>{let W=G?.id;if(J.mouseInRail=!0,clearTimeout(J.hoverTimer),J.hoverTimer=null,W)if(J.items[W]?.items?.length>0)J.hoverTimer=window.setTimeout(()=>{Q(W)},$.hoverDelay);else J.closeTimer=window.setTimeout(()=>{if(J.mouseInRail&&!J.mouseInDrawer)q()},$.hoverDelay)}),K.on("mouseenter",()=>{J.mouseInRail=!0,clearTimeout(J.closeTimer),J.closeTimer=null}),K.on("mouseleave",()=>{if(J.mouseInRail=!1,clearTimeout(J.hoverTimer),J.hoverTimer=null,!J.mouseInDrawer)J.closeTimer=window.setTimeout(()=>{if(!J.mouseInRail&&!J.mouseInDrawer)q()},$.closeDelay)})},E3=(J,$,Q,Z)=>{let q=J.drawer;if(!q)return;if(typeof q.on==="function")q.on("change",(j)=>{let K=j.id;if(J.activeSubsection=K,$.hideDrawerOnClick)Q();if(Z.onItemSelect)Z.onItemSelect(j)}),q.on("mouseenter",()=>{J.mouseInDrawer=!0,clearTimeout(J.hoverTimer),clearTimeout(J.closeTimer),J.hoverTimer=null,J.closeTimer=null}),q.on("mouseleave",()=>{if(J.mouseInDrawer=!1,!J.mouseInRail)J.closeTimer=window.setTimeout(()=>{if(!J.mouseInDrawer&&!J.mouseInRail)Q()},$.closeDelay)})},h3=(J,$)=>{if(window.ResizeObserver)J.resizeObserver=new ResizeObserver(()=>{$()}),J.resizeObserver.observe(document.body);else window.addEventListener("resize",$);window.addEventListener("orientationchange",()=>{setTimeout($,100)})},u3=(J,$)=>{if(J.resizeObserver)J.resizeObserver.disconnect(),J.resizeObserver=null;else window.removeEventListener("resize",$);if(window.removeEventListener("orientationchange",$),J.outsideClickHandler){let Q="ontouchend"in window?"touchend":"click";document.removeEventListener(Q,J.outsideClickHandler)}clearTimeout(J.hoverTimer),clearTimeout(J.closeTimer),J.hoverTimer=null,J.closeTimer=null};D7();var kK=(J,$,Q)=>{if(J.overlayElement)return J.overlayElement;return J.overlayElement=document.createElement("div"),J.overlayElement.className=$.overlayClass,J.overlayElement.setAttribute("aria-hidden","true"),document.body.appendChild(J.overlayElement),J.overlayElement.addEventListener("click",(Z)=>{if(Z.target===J.overlayElement)Q()}),J.overlayElement},NK=(J,$,Q)=>{if(!J.drawer||J.closeButtonElement)return null;if(J.closeButtonElement=document.createElement("button"),J.closeButtonElement.className=$.closeButtonClass,J.closeButtonElement.setAttribute("aria-label","Close navigation"),J.closeButtonElement.innerHTML=`
|
|
58
58
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
59
59
|
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
60
60
|
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
61
61
|
</svg>
|
|
62
|
-
`,J.closeButtonElement.addEventListener("click",()=>{Q()}),v6()&&$.optimizeForTouch)J.closeButtonElement.style.minWidth=`${d8.COMFORTABLE}px`,J.closeButtonElement.style.minHeight=`${d8.COMFORTABLE}px`,J.closeButtonElement.addEventListener("touchstart",()=>{J.closeButtonElement.classList.add("active")},{passive:!0}),J.closeButtonElement.addEventListener("touchend",()=>{setTimeout(()=>{J.closeButtonElement.classList.remove("active")},N9.FEEDBACK_DURATION)},{passive:!0});return J.drawer.element.appendChild(J.closeButtonElement),J.closeButtonElement},f3=(J,$,Q,Z)=>{let{drawer:q,rail:j}=J;if(!q||!j)return;if(MK(J,$,Q),VK(J,$,Q),NK(J,$,Q,Z),$.enableSwipeGestures&&v6())_K(J,Q,Z);Q()},NK=(J,$,Q,Z)=>{if(!$.hideOnClickOutside)return;if(J.outsideClickHandlerSet)return;J.outsideClickHandlerSet=!0;let q=v6()?"touchend":"click",j=(G)=>{if(!J.isMobile||!Z())return;let z=p6(G).target;if(J.drawer.element.contains(z)||J.rail.element.contains(z))return;Q()};J.outsideClickHandler=j,document.addEventListener(q,j,v6()?{passive:!0}:!1)},_K=(J,$,Q,Z)=>{let{drawer:q,rail:j}=J;if(!q||!j)return;let G=0,K=0;j.element.addEventListener("touchstart",(z)=>{let W=z.touches[0];G=W.clientX,K=W.clientY},{passive:!0}),j.element.addEventListener("touchmove",(z)=>{if(!J.isMobile||Q()||!Z)return;let W=z.touches[0],Y=W.clientX-G,U=W.clientY-K;if(Math.abs(Y)>Math.abs(U)&&Y>N9.SWIPE_THRESHOLD)Z()},{passive:!0}),q.element.addEventListener("touchstart",(z)=>{let W=z.touches[0];G=W.clientX,K=W.clientY},{passive:!0}),q.element.addEventListener("touchmove",(z)=>{if(!J.isMobile||!Q())return;let Y=z.touches[0].clientX-G;if(Y<0){if(q.element.style.transform=`translateX(${Y/2}px)`,Y<-N9.SWIPE_THRESHOLD)$()}},{passive:!0}),q.element.addEventListener("touchend",()=>{if(q.element.style.transform)q.element.style.transition="transform 0.2s ease",q.element.style.transform="",setTimeout(()=>{q.element.style.transition=""},200)},{passive:!0})},g3=(J,$)=>{if(J.overlayElement)J.overlayElement.classList.remove("active"),J.overlayElement.setAttribute("aria-hidden","true");if(J.closeButtonElement)J.closeButtonElement.style.display="none";document.body.classList.remove($.bodyLockClass)};var LK=(J={})=>{let $=R3(J),Q=g0(J),Z=d0(J),q={initialize:()=>q,cleanup:()=>{},navigateTo:()=>{},getRail:()=>$.rail,getDrawer:()=>$.drawer,getActiveSection:()=>$.activeSection,getActiveSubsection:()=>$.activeSubsection,showDrawer:()=>{},hideDrawer:()=>{},isDrawerVisible:()=>!1,configure:()=>q,setProcessingChange:()=>{},isProcessingChange:()=>!1,isMobile:()=>$.isMobile,checkMobileState:()=>{},onSectionChange:void 0,onItemSelect:void 0,onViewChange:void 0},j=()=>y3($,Z),G=()=>T3($,Z),K=()=>I3($),z=(B)=>{A3($,B,j,G)},W=()=>{f3($,Z,G,K)},Y=()=>{S3($,Z,W,()=>g3($,Z),q)},U=(B,M,k)=>{v3($,B,M,k)},X=()=>{if($.rail=w3($,Q),$.drawer=x3($,Q),C3($,Q,z,j,G,q),E3($,Q,G,q),h3($,Y),J.activeSection&&$.items[J.activeSection]){if($.activeSection=J.activeSection,$.rail)$.rail.setActive(J.activeSection);if(z(J.activeSection),J.expanded===!0)j();else G()}return Y(),q},_=()=>{u3($,Y),b3($)},H=(B)=>{return Object.assign(J,B),Object.assign(Q,g0({...J,...B})),Object.assign(Z,d0({...J,...B})),q};return q.initialize=X,q.cleanup=_,q.navigateTo=U,q.showDrawer=j,q.hideDrawer=G,q.isDrawerVisible=K,q.configure=H,q.setProcessingChange=(B)=>{$.processingChange=B},q.isProcessingChange=()=>$.processingChange,q.isMobile=()=>$.isMobile,q.checkMobileState=Y,q},d3=LK;N1();t6();J6();c();o();var l3=(J)=>($)=>{let Q="";if(J.value){let j=(J.options||[]).find((G)=>G.id===J.value);if(j)Q=j.text}let Z='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M7 10l5 5 5-5H7z"/></svg>',q=Y$({label:J.label,variant:J.variant||"filled",density:J.density||"default",value:Q,name:J.name,disabled:J.disabled,required:J.required,supportingText:J.supportingText,error:J.error,trailingIcon:Z,readonly:!0});return q.element.classList.add(`${J.prefix||"mtrl"}-select`),{...$,element:q.element,textfield:q}},l0=(J)=>{return J.map(($)=>{if("type"in $&&$.type==="divider")return $;let Q={id:$.id.toString(),text:$.text,icon:$.icon,disabled:$.disabled,hasSubmenu:!1,data:$};if($.hasSubmenu&&Array.isArray($.submenu))Q.hasSubmenu=!0,Q.submenu=l0($.submenu);return Q})},r3=(J)=>($)=>{if(!$.textfield)return console.warn("Cannot add menu: textfield not found"),$;let Q={options:J.options||[],selectedOption:null};if(J.value)Q.selectedOption=Q.options.find((G)=>G.id===J.value);let Z=l0(Q.options),q=Q$({opener:$.textfield,items:Z,position:J.placement||"bottom-start",width:"100%",class:"select-menu",closeOnSelect:!0,closeOnClickOutside:!0,closeOnEscape:!0,offset:0});q.on("select",(G)=>{if(!G.item||G.item.hasSubmenu)return;let K=G.item.data;if(!K||!("id"in K)||!("text"in K)){console.warn("Invalid menu selection: missing required data properties");return}if(Q.selectedOption=K,$.textfield.setValue(K.text),q.setSelected(K.id),$.emit)$.emit("change",{select:$,value:K.id,text:K.text,option:K,originalEvent:G.originalEvent,preventDefault:()=>{G.defaultPrevented=!0},defaultPrevented:!1})}),$.textfield.element.addEventListener("keydown",(G)=>{if($.textfield.input.disabled)return;if((G.key==="Enter"||G.key===" "||G.key==="ArrowDown")&&!q.isOpen()){if(G.preventDefault(),q.open(G,"keyboard"),$.emit)$.emit("open",{select:$,originalEvent:G,preventDefault:()=>{},defaultPrevented:!1})}else if(G.key==="Escape"&&q.isOpen())G.preventDefault(),q.close(G)}),q.on("open",()=>{$.textfield.element.classList.add(`${J.prefix||"mtrl"}-select--open`);let G=J.prefix||"mtrl";if($.textfield.element.classList.add(`${G}-textfield--focused`),$.textfield.element.classList.contains(`${G}-textfield--filled`))$.textfield.element.classList.add(`${G}-textfield--filled-focused`)}),q.on("close",(G)=>{if($.textfield.element.classList.remove(`${J.prefix||"mtrl"}-select--open`),setTimeout(()=>{let K=J.prefix||"mtrl";if(document.activeElement===$.textfield.input||$.textfield.element.contains(document.activeElement)){if($.textfield.element.classList.add(`${K}-textfield--focused`),$.textfield.element.classList.contains(`${K}-textfield--filled`))$.textfield.element.classList.add(`${K}-textfield--filled-focused`)}else if($.textfield.element.classList.remove(`${K}-textfield--focused`),$.textfield.element.classList.contains(`${K}-textfield--filled`))$.textfield.element.classList.remove(`${K}-textfield--filled-focused`)},10),$.emit)$.emit("close",{select:$,originalEvent:G.originalEvent,preventDefault:()=>{},defaultPrevented:!1})});let j=()=>{if(!Q.selectedOption)return;q.setSelected(Q.selectedOption.id)};return q.on("open",()=>{setTimeout(j,50)}),{...$,menu:q,select:{getValue:()=>Q.selectedOption?.id||null,setValue:(G)=>{let K=Q.options.find((z)=>("id"in z)&&z.id===G);if(K&&"text"in K)Q.selectedOption=K,$.textfield.setValue(K.text),q.setSelected(K.id);return $},getText:()=>Q.selectedOption?.text||"",getSelectedOption:()=>Q.selectedOption,getOptions:()=>[...Q.options],setOptions:(G)=>{Q.options=G;let K=l0(G);if(q.setItems(K),Q.selectedOption&&!G.find((z)=>("id"in z)&&z.id===Q.selectedOption.id))Q.selectedOption=null,$.textfield.setValue("");return $},open:(G,K="mouse")=>{return q.open(G,K),$},close:(G)=>{return q.close(G),$},isOpen:()=>q.isOpen()}}};var p3=(J)=>($)=>({...$,element:$.element,textfield:$.textfield,menu:$.menu,getValue:J.select.getValue,setValue(Q){return J.select.setValue(Q),this},getText:J.select.getText,getSelectedOption:J.select.getSelectedOption,getOptions:J.select.getOptions,setOptions(Q){return J.select.setOptions(Q),this},open(Q="mouse"){if($.menu&&typeof $.menu.open==="function")$.menu.open(void 0,Q);else J.select.open();return this},close(){return J.select.close(),this},isOpen:J.select.isOpen,setDensity(Q){if($.textfield?.setDensity)$.textfield.setDensity(Q);return this},getDensity(){if($.textfield?.getDensity)return $.textfield.getDensity();return"default"},on(Q,Z){if(J.events?.on)J.events.on(Q,Z);else if($.on)$.on(Q,Z);return this},off(Q,Z){if(J.events?.off)J.events.off(Q,Z);else if($.off)$.off(Q,Z);return this},enable(){return J.disabled.enable(),this},disable(){return J.disabled.disable(),this},destroy(){J.lifecycle.destroy()}});t();var DK={options:[],variant:y9.VARIANT,placement:y9.PLACEMENT},s3=(J={options:[]})=>d(DK,J,"select"),m3=(J)=>({select:{getValue:J.select?.getValue||(()=>null),setValue:J.select?.setValue||(()=>J),getText:J.select?.getText||(()=>""),getSelectedOption:J.select?.getSelectedOption||(()=>null),getOptions:J.select?.getOptions||(()=>[]),setOptions:J.select?.setOptions||(()=>J),open:J.select?.open||(()=>J),close:J.select?.close||(()=>J),isOpen:J.select?.isOpen||(()=>!1)},events:{on:J.on||(()=>J),off:J.off||(()=>J)},disabled:{enable:()=>{if(J.textfield?.enable)J.textfield.enable();return J},disable:()=>{if(J.textfield?.disable)J.textfield.disable();return J}},lifecycle:{destroy:()=>{if(J.textfield?.destroy)J.textfield.destroy();if(J.menu?.destroy)J.menu.destroy();if(J.lifecycle?.destroy)J.lifecycle.destroy()}}});var OK=(J)=>{try{let $=s3(J),Q=b(S,g(),l3($),r3($),C(),(Z)=>p3(m3(Z))(Z))($);if(J.on){if(J.on.change)Q.on("change",J.on.change);if(J.on.open)Q.on("open",J.on.open);if(J.on.close)Q.on("close",J.on.close)}return Q}catch($){throw console.error("Select creation error:",$),new Error(`Failed to create select: ${$.message}`)}},r0=OK;r7();r7();v$();R1();B1();p1();var p0={DOCKED:"docked",MODAL:"modal",MODAL_INPUT:"modal-input"},s0={DAY:"day",MONTH:"month",YEAR:"year"},m0={SINGLE:"single",RANGE:"range"},a0=["S","M","T","W","T","F","S"],c0=["January","February","March","April","May","June","July","August","September","October","November","December"],i0=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],o0="MM/DD/YYYY";var t0={SMALL:"small",MEDIUM:"medium",LARGE:"large",FULLWIDTH:"fullwidth",FULLSCREEN:"fullscreen"},n0={SCALE:"scale",SLIDE_UP:"slide-up",SLIDE_DOWN:"slide-down",FADE:"fade"},e0={RIGHT:"right",LEFT:"left",CENTER:"center",SPACE_BETWEEN:"space-between"};var $4={TEXT:"text",FILLED:"filled",OUTLINED:"outlined",TONAL:"tonal"},J4="Yes",Q4="No";var Z4={PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",SURFACE:"surface"},q4={SMALL:"small",DEFAULT:"default",LARGE:"large"},j4={TOP_RIGHT:"top-right",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left"};t6();var PK=q7,RK=q7,AK=q7;
|
|
62
|
+
`,J.closeButtonElement.addEventListener("click",()=>{Q()}),v6()&&$.optimizeForTouch)J.closeButtonElement.style.minWidth=`${d8.COMFORTABLE}px`,J.closeButtonElement.style.minHeight=`${d8.COMFORTABLE}px`,J.closeButtonElement.addEventListener("touchstart",()=>{J.closeButtonElement.classList.add("active")},{passive:!0}),J.closeButtonElement.addEventListener("touchend",()=>{setTimeout(()=>{J.closeButtonElement.classList.remove("active")},V9.FEEDBACK_DURATION)},{passive:!0});return J.drawer.element.appendChild(J.closeButtonElement),J.closeButtonElement},f3=(J,$,Q,Z)=>{let{drawer:q,rail:j}=J;if(!q||!j)return;if(kK(J,$,Q),NK(J,$,Q),VK(J,$,Q,Z),$.enableSwipeGestures&&v6())_K(J,Q,Z);Q()},VK=(J,$,Q,Z)=>{if(!$.hideOnClickOutside)return;if(J.outsideClickHandlerSet)return;J.outsideClickHandlerSet=!0;let q=v6()?"touchend":"click",j=(K)=>{if(!J.isMobile||!Z())return;let W=p6(K).target;if(J.drawer.element.contains(W)||J.rail.element.contains(W))return;Q()};J.outsideClickHandler=j,document.addEventListener(q,j,v6()?{passive:!0}:!1)},_K=(J,$,Q,Z)=>{let{drawer:q,rail:j}=J;if(!q||!j)return;let K=0,G=0;j.element.addEventListener("touchstart",(W)=>{let z=W.touches[0];K=z.clientX,G=z.clientY},{passive:!0}),j.element.addEventListener("touchmove",(W)=>{if(!J.isMobile||Q()||!Z)return;let z=W.touches[0],Y=z.clientX-K,U=z.clientY-G;if(Math.abs(Y)>Math.abs(U)&&Y>V9.SWIPE_THRESHOLD)Z()},{passive:!0}),q.element.addEventListener("touchstart",(W)=>{let z=W.touches[0];K=z.clientX,G=z.clientY},{passive:!0}),q.element.addEventListener("touchmove",(W)=>{if(!J.isMobile||!Q())return;let Y=W.touches[0].clientX-K;if(Y<0){if(q.element.style.transform=`translateX(${Y/2}px)`,Y<-V9.SWIPE_THRESHOLD)$()}},{passive:!0}),q.element.addEventListener("touchend",()=>{if(q.element.style.transform)q.element.style.transition="transform 0.2s ease",q.element.style.transform="",setTimeout(()=>{q.element.style.transition=""},200)},{passive:!0})},g3=(J,$)=>{if(J.overlayElement)J.overlayElement.classList.remove("active"),J.overlayElement.setAttribute("aria-hidden","true");if(J.closeButtonElement)J.closeButtonElement.style.display="none";document.body.classList.remove($.bodyLockClass)};var LK=(J={})=>{let $=R3(J),Q=g0(J),Z=d0(J),q={initialize:()=>q,cleanup:()=>{},navigateTo:()=>{},getRail:()=>$.rail,getDrawer:()=>$.drawer,getActiveSection:()=>$.activeSection,getActiveSubsection:()=>$.activeSubsection,showDrawer:()=>{},hideDrawer:()=>{},isDrawerVisible:()=>!1,configure:()=>q,setProcessingChange:()=>{},isProcessingChange:()=>!1,isMobile:()=>$.isMobile,checkMobileState:()=>{},onSectionChange:void 0,onItemSelect:void 0,onViewChange:void 0},j=()=>y3($,Z),K=()=>T3($,Z),G=()=>I3($),W=(B)=>{A3($,B,j,K)},z=()=>{f3($,Z,K,G)},Y=()=>{S3($,Z,z,()=>g3($,Z),q)},U=(B,k,M)=>{v3($,B,k,M)},X=()=>{if($.rail=w3($,Q),$.drawer=x3($,Q),C3($,Q,W,j,K,q),E3($,Q,K,q),h3($,Y),J.activeSection&&$.items[J.activeSection]){if($.activeSection=J.activeSection,$.rail)$.rail.setActive(J.activeSection);if(W(J.activeSection),J.expanded===!0)j();else K()}return Y(),q},_=()=>{u3($,Y),b3($)},H=(B)=>{return Object.assign(J,B),Object.assign(Q,g0({...J,...B})),Object.assign(Z,d0({...J,...B})),q};return q.initialize=X,q.cleanup=_,q.navigateTo=U,q.showDrawer=j,q.hideDrawer=K,q.isDrawerVisible=G,q.configure=H,q.setProcessingChange=(B)=>{$.processingChange=B},q.isProcessingChange=()=>$.processingChange,q.isMobile=()=>$.isMobile,q.checkMobileState=Y,q},d3=LK;V1();t6();J6();c();o();var l3=(J)=>($)=>{let Q="";if(J.value){let j=(J.options||[]).find((K)=>K.id===J.value);if(j)Q=j.text}let Z='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M7 10l5 5 5-5H7z"/></svg>',q=Y$({label:J.label,variant:J.variant||"filled",density:J.density||"default",value:Q,name:J.name,disabled:J.disabled,required:J.required,supportingText:J.supportingText,error:J.error,trailingIcon:Z,readonly:!0});return q.element.classList.add(`${J.prefix||"mtrl"}-select`),{...$,element:q.element,textfield:q}},l0=(J)=>{return J.map(($)=>{if("type"in $&&$.type==="divider")return $;let Q={id:$.id.toString(),text:$.text,icon:$.icon,disabled:$.disabled,hasSubmenu:!1,data:$};if($.hasSubmenu&&Array.isArray($.submenu))Q.hasSubmenu=!0,Q.submenu=l0($.submenu);return Q})},r3=(J)=>($)=>{if(!$.textfield)return console.warn("Cannot add menu: textfield not found"),$;let Q={options:J.options||[],selectedOption:null};if(J.value)Q.selectedOption=Q.options.find((K)=>K.id===J.value);let Z=l0(Q.options),q=Q$({opener:$.textfield,items:Z,position:J.placement||"bottom-start",width:"100%",class:"select-menu",closeOnSelect:!0,closeOnClickOutside:!0,closeOnEscape:!0,offset:0});q.on("select",(K)=>{if(!K.item||K.item.hasSubmenu)return;let G=K.item.data;if(!G||!("id"in G)||!("text"in G)){console.warn("Invalid menu selection: missing required data properties");return}if(Q.selectedOption=G,$.textfield.setValue(G.text),q.setSelected(G.id),$.emit)$.emit("change",{select:$,value:G.id,text:G.text,option:G,originalEvent:K.originalEvent,preventDefault:()=>{K.defaultPrevented=!0},defaultPrevented:!1})}),$.textfield.element.addEventListener("keydown",(K)=>{if($.textfield.input.disabled)return;if((K.key==="Enter"||K.key===" "||K.key==="ArrowDown")&&!q.isOpen()){if(K.preventDefault(),q.open(K,"keyboard"),$.emit)$.emit("open",{select:$,originalEvent:K,preventDefault:()=>{},defaultPrevented:!1})}else if(K.key==="Escape"&&q.isOpen())K.preventDefault(),q.close(K)}),q.on("open",()=>{$.textfield.element.classList.add(`${J.prefix||"mtrl"}-select--open`);let K=J.prefix||"mtrl";if($.textfield.element.classList.add(`${K}-textfield--focused`),$.textfield.element.classList.contains(`${K}-textfield--filled`))$.textfield.element.classList.add(`${K}-textfield--filled-focused`)}),q.on("close",(K)=>{if($.textfield.element.classList.remove(`${J.prefix||"mtrl"}-select--open`),setTimeout(()=>{let G=J.prefix||"mtrl";if(document.activeElement===$.textfield.input||$.textfield.element.contains(document.activeElement)){if($.textfield.element.classList.add(`${G}-textfield--focused`),$.textfield.element.classList.contains(`${G}-textfield--filled`))$.textfield.element.classList.add(`${G}-textfield--filled-focused`)}else if($.textfield.element.classList.remove(`${G}-textfield--focused`),$.textfield.element.classList.contains(`${G}-textfield--filled`))$.textfield.element.classList.remove(`${G}-textfield--filled-focused`)},10),$.emit)$.emit("close",{select:$,originalEvent:K.originalEvent,preventDefault:()=>{},defaultPrevented:!1})});let j=()=>{if(!Q.selectedOption)return;q.setSelected(Q.selectedOption.id)};return q.on("open",()=>{setTimeout(j,50)}),{...$,menu:q,select:{getValue:()=>Q.selectedOption?.id||null,setValue:(K)=>{let G=Q.options.find((W)=>("id"in W)&&W.id===K);if(G&&"text"in G)Q.selectedOption=G,$.textfield.setValue(G.text),q.setSelected(G.id);return $},getText:()=>Q.selectedOption?.text||"",getSelectedOption:()=>Q.selectedOption,getOptions:()=>[...Q.options],setOptions:(K)=>{Q.options=K;let G=l0(K);if(q.setItems(G),Q.selectedOption&&!K.find((W)=>("id"in W)&&W.id===Q.selectedOption.id))Q.selectedOption=null,$.textfield.setValue("");return $},open:(K,G="mouse")=>{return q.open(K,G),$},close:(K)=>{return q.close(K),$},isOpen:()=>q.isOpen()}}};var p3=(J)=>($)=>({...$,element:$.element,textfield:$.textfield,menu:$.menu,getValue:J.select.getValue,setValue(Q){return J.select.setValue(Q),this},getText:J.select.getText,getSelectedOption:J.select.getSelectedOption,getOptions:J.select.getOptions,setOptions(Q){return J.select.setOptions(Q),this},open(Q="mouse"){if($.menu&&typeof $.menu.open==="function")$.menu.open(void 0,Q);else J.select.open();return this},close(){return J.select.close(),this},isOpen:J.select.isOpen,setDensity(Q){if($.textfield?.setDensity)$.textfield.setDensity(Q);return this},getDensity(){if($.textfield?.getDensity)return $.textfield.getDensity();return"default"},on(Q,Z){if(J.events?.on)J.events.on(Q,Z);else if($.on)$.on(Q,Z);return this},off(Q,Z){if(J.events?.off)J.events.off(Q,Z);else if($.off)$.off(Q,Z);return this},enable(){return J.disabled.enable(),this},disable(){return J.disabled.disable(),this},destroy(){J.lifecycle.destroy()}});t();var DK={options:[],variant:y9.VARIANT,placement:y9.PLACEMENT},s3=(J={options:[]})=>d(DK,J,"select"),m3=(J)=>({select:{getValue:J.select?.getValue||(()=>null),setValue:J.select?.setValue||(()=>J),getText:J.select?.getText||(()=>""),getSelectedOption:J.select?.getSelectedOption||(()=>null),getOptions:J.select?.getOptions||(()=>[]),setOptions:J.select?.setOptions||(()=>J),open:J.select?.open||(()=>J),close:J.select?.close||(()=>J),isOpen:J.select?.isOpen||(()=>!1)},events:{on:J.on||(()=>J),off:J.off||(()=>J)},disabled:{enable:()=>{if(J.textfield?.enable)J.textfield.enable();return J},disable:()=>{if(J.textfield?.disable)J.textfield.disable();return J}},lifecycle:{destroy:()=>{if(J.textfield?.destroy)J.textfield.destroy();if(J.menu?.destroy)J.menu.destroy();if(J.lifecycle?.destroy)J.lifecycle.destroy()}}});var OK=(J)=>{try{let $=s3(J),Q=b(S,g(),l3($),r3($),C(),(Z)=>p3(m3(Z))(Z))($);if(J.on){if(J.on.change)Q.on("change",J.on.change);if(J.on.open)Q.on("open",J.on.open);if(J.on.close)Q.on("close",J.on.close)}return Q}catch($){throw console.error("Select creation error:",$),new Error(`Failed to create select: ${$.message}`)}},r0=OK;r7();r7();v$();R1();B1();p1();var p0={DOCKED:"docked",MODAL:"modal",MODAL_INPUT:"modal-input"},s0={DAY:"day",MONTH:"month",YEAR:"year"},m0={SINGLE:"single",RANGE:"range"},a0=["S","M","T","W","T","F","S"],c0=["January","February","March","April","May","June","July","August","September","October","November","December"],i0=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],o0="MM/DD/YYYY";var t0={SMALL:"small",MEDIUM:"medium",LARGE:"large",FULLWIDTH:"fullwidth",FULLSCREEN:"fullscreen"},n0={SCALE:"scale",SLIDE_UP:"slide-up",SLIDE_DOWN:"slide-down",FADE:"fade"},e0={RIGHT:"right",LEFT:"left",CENTER:"center",SPACE_BETWEEN:"space-between"};var $4={TEXT:"text",FILLED:"filled",OUTLINED:"outlined",TONAL:"tonal"},J4="Yes",Q4="No";var Z4={PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",SURFACE:"surface"},q4={SMALL:"small",DEFAULT:"default",LARGE:"large"},j4={TOP_RIGHT:"top-right",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left"};t6();var PK=q7,RK=q7,AK=q7;
|
|
63
63
|
|
|
64
|
-
//# debugId=
|
|
64
|
+
//# debugId=96BACFC86EC4C0BE64756E2164756E21
|