mtrl 0.8.0-next.4 → 0.8.0-next.6
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/index.cjs +12 -12
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +12 -12
- package/dist/index.js.map +2 -2
- package/dist/package.json +2 -2
- package/dist/styles.css +2 -2
- package/package.json +2 -2
- package/src/styles/base/_tokens.scss +46 -0
- package/src/styles/components/_button.scss +17 -0
- package/src/styles/main.scss +3 -10
- package/src/styles/themes/_base-theme.scss +0 -15
package/dist/index.cjs
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* mtrl v0.8.0-next.
|
|
2
|
+
* mtrl v0.8.0-next.6
|
|
3
3
|
* A functional TypeScript component library based on Material Design 3
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
var vm=Object.create;var{getPrototypeOf:Tm,defineProperty:Sn,getOwnPropertyNames:sa,getOwnPropertyDescriptor:Sm}=Object,aa=Object.prototype.hasOwnProperty;function oa(e){return this[e]}var ym,xm,Im=(e,t,n)=>{var r=e!=null&&typeof e==="object";if(r){var i=t?ym??=new WeakMap:xm??=new WeakMap,s=i.get(e);if(s)return s}n=e!=null?vm(Tm(e)):{};let a=t||!e||!e.__esModule?Sn(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let o of sa(e))if(!aa.call(a,o))Sn(a,o,{get:oa.bind(e,o),enumerable:!0})}if(r)i.set(e,a);return a},Lm=(e)=>{var t=(ia??=new WeakMap).get(e),n;if(t)return t;if(t=Sn({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var r of sa(e))if(!aa.call(t,r))Sn(t,r,{get:oa.bind(e,r),enumerable:!(n=Sm(e,r))||n.enumerable})}return ia.set(e,t),t},ia;var Am=(e)=>e;function wm(e,t){this[e]=Am.bind(null,t)}var Wr=(e,t)=>{for(var n in t)Sn(e,n,{get:t[n],enumerable:!0,configurable:!0,set:wm.bind(t,n)})};var X=(e,t)=>()=>(e&&(t=e(e=0)),t);var M=(...e)=>(t)=>e.reduce((n,r)=>r(n),t),la=(...e)=>(t)=>e.reduceRight((n,r)=>r(n),t),da=(...e)=>(t,n={})=>e.reduce((r,i)=>({...r,...i(r,n)}),t);var ua=(e={})=>({element:null,config:e,setup(){return this}});var yn=(e,t={})=>{if(!t)return e;let n=Object.keys(t);if(n.length===1){let r=t[n[0]];if(r!=null)e.setAttribute(n[0],String(r));return e}for(let r in t){let i=t[r];if(i!=null)e.setAttribute(r,String(i))}return e},ca=(e,t=[])=>{for(let n=0;n<t.length;n++)e.removeAttribute(t[n]);return e},ma=(e,t)=>{for(let n=0;n<t.length;n++){let r=t[n];if(r.action==="set"&&r.value!=null)e.setAttribute(r.key,String(r.value));else if(r.action==="remove")e.removeAttribute(r.key)}return e},fa=(e,t)=>e.hasAttribute(t),ga=(e,t,n="")=>e.getAttribute(t)??n;var K="mtrl",pa=(e)=>`mtrl-${e}`,ha=(e,t)=>`${e}--${t}`,Ca=(e,t)=>`${e}-${t}`,Kr,Yr,Ea;var nt=X(()=>{((s)=>{s.BUTTON="button";s.TEXTFIELD="textfield";s.CONTAINER="container";s.SNACKBAR="snackbar";s.SWITCH="switch"})(Kr||={});((s)=>{s.DISABLED="disabled";s.FOCUSED="focused";s.ACTIVE="active";s.LOADING="loading";s.ERROR="error"})(Yr||={});Ea={bem:(e,t,n)=>{let r=e;if(t)r+=`-${t}`;if(n)r+=`--${n}`;return r},join:(...e)=>e.filter(Boolean).join(" ")}});var Ie,Qn,Nm=500,qt=(...e)=>{if(e.length===0)return[];if(e.length===1&&typeof e[0]==="string"){let r=e[0];if(!r)return[];if(!r.includes(" "))return[r];if(Qn.has(r))return Qn.get(r)}let t=new Set,n=[];for(let r of e)if(typeof r==="string"&&r)if(!r.includes(" ")){if(!t.has(r))t.add(r),n.push(r)}else r.split(" ").forEach((i)=>{let s=i.trim();if(s&&!t.has(s))t.add(s),n.push(s)});else if(Array.isArray(r))r.forEach((i)=>{if(typeof i==="string"&&i)i.split(" ").forEach((s)=>{let a=s.trim();if(a&&!t.has(a))t.add(a),n.push(a)})});if(e.length===1&&typeof e[0]==="string"&&n.length<=10){if(Qn.size<Nm)Qn.set(e[0],n)}return n},ee=(e,...t)=>{if(t.length===0)return e;if(t.length===1&&Array.isArray(t[0]))return ee(e,...t[0]);if(t.length===1&&typeof t[0]==="string"){let r=t[0];if(r&&!r.includes(" ")){let i=r.startsWith(Ie)?r:Ie+r;if(!i.includes(" "))return e.classList.add(i),e}}let n=qt(...t);for(let r of n){let i=r.startsWith(Ie)?r:Ie+r;if(i.includes(" "))i.split(" ").forEach((s)=>{let a=s.trim();if(a)e.classList.add(a)});else e.classList.add(i)}return e},Ce=(e,...t)=>{if(t.length===0)return e;if(t.length===1&&Array.isArray(t[0]))return Ce(e,...t[0]);if(t.length===1&&typeof t[0]==="string"){let r=t[0];if(r&&!r.includes(" ")){let i=r.startsWith(Ie)?r:Ie+r;if(!i.includes(" "))return e.classList.remove(i),e}}let n=qt(...t);for(let r of n){let i=r.startsWith(Ie)?r:Ie+r;if(i.includes(" "))i.split(" ").forEach((s)=>{let a=s.trim();if(a)e.classList.remove(a)});else e.classList.remove(i)}return e},Jn=(e,...t)=>{if(t.length===1&&Array.isArray(t[0]))return Jn(e,...t[0]);if(t.length===1&&typeof t[0]==="string"){let r=t[0];if(r&&!r.includes(" ")){let i=r.startsWith(Ie)?r:Ie+r;if(!i.includes(" "))return e.classList.toggle(i),e}}let n=qt(...t);for(let r of n){let i=r.startsWith(Ie)?r:Ie+r;if(i.includes(" "))i.split(" ").forEach((s)=>{let a=s.trim();if(a)e.classList.toggle(a)});else e.classList.toggle(i)}return e},rt=(e,...t)=>{if(t.length===0)return!0;if(t.length===1&&Array.isArray(t[0]))return rt(e,...t[0]);if(t.length===1&&typeof t[0]==="string"){let r=t[0];if(r&&!r.includes(" ")){let i=r.startsWith(Ie)?r:Ie+r;if(!i.includes(" "))return e.classList.contains(i)}}let n=qt(...t);for(let r of n){let i=r.startsWith(Ie)?r:Ie+r;if(i.includes(" ")){let s=i.split(" ").map((a)=>a.trim()).filter(Boolean);for(let a of s)if(!e.classList.contains(a))return!1}else if(!e.classList.contains(i))return!1}return!0};var xn=X(()=>{nt();Ie=`${K}-`,Qn=new Map});class va{pools=new Map;maxSize=20;acquire(e="div"){let t=this.pools.get(e);if(t?.length){let n=t.pop();return n.className="",n.innerHTML="",n.removeAttribute("id"),Object.keys(n.dataset).forEach((r)=>delete n.dataset[r]),n}return document.createElement(e)}release(e){let t=e.tagName.toLowerCase(),n=this.pools.get(t);if(!n)n=[],this.pools.set(t,n);if(n.length<this.maxSize)this.cleanElement(e),n.push(e)}cleanElement(e){let t=e.__eventHandlers;if(t){for(let n in t)e.removeEventListener(n,t[n]);delete e.__eventHandlers}e.className="",e.innerHTML="",e.removeAttribute("id"),Object.keys(e.dataset).forEach((n)=>delete e.dataset[n]),e.parentNode?.removeChild(e)}}var Dm,ba=(e,t,n)=>{if(!t||!n?.emit&&!n?.on)return;e.__eventHandlers={};for(let r in t){let i=t[r],s=(o)=>{let l=!0;if(typeof i==="function")try{l=i({...n,element:e},o)}catch(d){console.warn(`Error in event condition for ${r}:`,d),l=!1}else l=Boolean(i);if(l&&n.emit)n.emit(r,{event:o,element:e,originalEvent:o})};e.__eventHandlers[r]=s;let a=Dm.has(r)?{passive:!0}:void 0;e.addEventListener(r,s,a)}},eh,B=(e={})=>{if(!e||Object.keys(e).length===0)return document.createElement("div");if(typeof e==="string")return document.createElement(e);let t=document.createElement(e.tag||"div");if(e.html)t.innerHTML=e.html;else if(e.text)t.textContent=e.text;if(e.id)t.id=e.id;if(e.name)t.setAttribute("name",e.name);if(e.title)t.title=e.title;if(e.tabIndex!==void 0)t.tabIndex=e.tabIndex;if(e.style)if(typeof e.style==="string")t.setAttribute("style",e.style);else Object.assign(t.style,e.style);if(e.role)t.setAttribute("role",e.role);if(e.ariaLabel)t.setAttribute("aria-label",e.ariaLabel);if(e.ariaDescribedBy)t.setAttribute("aria-describedby",e.ariaDescribedBy);if(e.ariaLabelledBy)t.setAttribute("aria-labelledby",e.ariaLabelledBy);if(e.ariaHidden!==void 0)t.setAttribute("aria-hidden",String(e.ariaHidden));let n=e.className||e.class;if(n)ee(t,n);if(e.rawClass){let r=Array.isArray(e.rawClass)?e.rawClass:e.rawClass.split(" ");t.classList.add(...r.filter(Boolean))}if(e.data)Object.assign(t.dataset,e.data);if(e.attributes)yn(t,e.attributes);for(let r in e)if(!["tag","container","html","text","id","name","title","tabIndex","style","role","ariaLabel","ariaDescribedBy","ariaLabelledBy","ariaHidden","data","class","className","rawClass","attributes","forwardEvents","onCreate","context"].includes(r)){let i=e[r];if(i!=null)t.setAttribute(r,String(i))}if(e.forwardEvents)ba(t,e.forwardEvents,e.context);if(e.container)e.container.appendChild(t);if(e.onCreate)e.onCreate(t,e.context);return t},Ta=(e={})=>{let t=document.createElementNS("http://www.w3.org/2000/svg",e.tag||"svg");if(e.text)t.textContent=e.text;if(e.id)t.id=e.id;if(e.attributes)yn(t,e.attributes);if(e.forwardEvents)ba(t,e.forwardEvents,e.context);if(e.container)e.container.appendChild(t);if(e.onCreate)e.onCreate(t,e.context);return t},Sa=(e)=>{let t=e.__eventHandlers;if(t){for(let n in t)e.removeEventListener(n,t[n]);delete e.__eventHandlers}};var Qe=X(()=>{xn();Dm=new Set(["touchstart","touchmove"]);eh=new va});function Mm(e){return"touches"in e}function Om(e){return"clientX"in e&&"clientY"in e}var ya=()=>{let e=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),t=window.innerWidth<=768;return e||t},er,gt,Xr,ze=()=>("ontouchstart"in window)||navigator.maxTouchPoints>0,Je=(e)=>{if(Mm(e)&&e.touches.length>0){let t=e.touches[0];return{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,target:e.target,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation(),type:e.type}}if(Om(e))return{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,target:e.target,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation(),type:e.type};return{clientX:0,clientY:0,pageX:0,pageY:0,target:e.target,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation(),type:e.type}};var In=X(()=>{er={passive:!0},gt={TARGET_SIZE:44,FEEDBACK_DURATION:200,TAP_THRESHOLD:250,SWIPE_THRESHOLD:50},Xr={MINIMUM:44,COMFORTABLE:48,LARGE:56}});var Rm=(e)=>({getClass:(t)=>`${e}-${t}`,getModifierClass:(t,n)=>`${t}--${n}`,getElementClass:(t,n)=>`${t}-${n}`}),D=(e={})=>({config:e,componentName:e.componentName,...Rm(e.prefix||"mtrl"),touchState:{startTime:0,startPosition:{x:0,y:0},isTouching:!1,activeTarget:null},updateTouchState(t,n){let r=Je(t);if(n==="start")this.touchState={startTime:Date.now(),startPosition:{x:r.clientX,y:r.clientY},isTouching:!0,activeTarget:r.target};else if(n==="end")this.touchState.isTouching=!1,this.touchState.activeTarget=null}}),O=(e={})=>(t)=>{let n=(d)=>{if(s.updateTouchState(d,"start"),l.classList.add(`${s.getClass("touch-active")}`),e.forwardEvents?.touchstart&&"emit"in t)t.emit("touchstart",Je(d))},r=(d)=>{if(!s.touchState.isTouching)return;let u=Date.now()-s.touchState.startTime;if(l.classList.remove(`${s.getClass("touch-active")}`),s.updateTouchState(d,"end"),u<gt.TAP_THRESHOLD&&"emit"in t)t.emit("tap",Je(d));if(e.forwardEvents?.touchend&&"emit"in t)t.emit("touchend",Je(d))},i=(d)=>{if(!s.touchState.isTouching)return;let u=Je(d),f=u.clientX-s.touchState.startPosition.x,c=u.clientY-s.touchState.startPosition.y;if(Math.abs(f)>gt.SWIPE_THRESHOLD&&"emit"in t)t.emit("swipe",{direction:f>0?"right":"left",deltaX:f,deltaY:c});if(e.forwardEvents?.touchmove&&"emit"in t)t.emit("touchmove",{...u,deltaX:f,deltaY:c})},s=t,a=t.config.parent||e.parent;if(typeof a==="string")a=document.querySelector(a);let o={tag:e.tag||"div",className:[s.getClass(e.componentName||s.componentName||"component"),ze()&&e.interactive?s.getClass("interactive"):null,...Array.isArray(e.className)?e.className:[e.className]].filter(Boolean),attributes:e.attributes||{},id:e.id,name:e.name,title:e.title,tabIndex:e.tabIndex,style:e.style,data:e.data,role:e.role,ariaLabel:e.ariaLabel,ariaDescribedBy:e.ariaDescribedBy,ariaLabelledBy:e.ariaLabelledBy,ariaHidden:e.ariaHidden,forwardEvents:e.forwardEvents||{},context:t,container:a},l=B(o);if(ze()&&e.interactive)l.addEventListener("touchstart",n,er),l.addEventListener("touchend",r),l.addEventListener("touchmove",i,er);return{...t,element:l,addClass(...d){return l.classList.add(...d.filter(Boolean)),this},destroy(){if(ze()&&e.interactive)l.removeEventListener("touchstart",n),l.removeEventListener("touchend",r),l.removeEventListener("touchmove",i);Sa(l),l.remove()}}};var te=X(()=>{Qe();In()});var Re=()=>{let e=new Map;return{on:(t,n)=>{let r=e.get(t)||[];return e.set(t,[...r,n]),()=>{let i=e.get(t)||[];e.set(t,i.filter((s)=>s!==n))}},off(t,n){let r=e.get(t)||[];e.set(t,r.filter((i)=>i!==n))},emit:(t,...n)=>{(e.get(t)||[]).forEach((i)=>i(...n))},clear:()=>{e.clear()}}};var k=()=>(e)=>{let t=Re();return{...e,on(n,r){return t.on(n,r),this},off(n,r){return t.off(n,r),this},emit(n,r){return t.emit(n,r),this}}};var xa=()=>{};var _m=(e,t={})=>{let n=null,r=t.prefix||"mtrl",i=(s)=>{let a=document.createElement("span");return a.className=`${r}-${t.componentName||"component"}-text`,a.textContent=s,a};return{setText(s){if(!n&&s)if(n=i(s),t.beforeElement)e.insertBefore(n,t.beforeElement);else e.appendChild(n);else if(n)n.textContent=s;return this},getText(){return n?n.textContent||"":""},getElement(){return n}}},lt=(e)=>(t)=>{let n=_m(t.element,{prefix:e.prefix,componentName:e.componentName||"component"});if(e.text)n.setText(e.text);return{...t,text:n}};var Pm=(e,t={})=>{let n=null,r=t.prefix||"mtrl",i=(s)=>{let a=document.createElement("span");a.className=`${r}-icon`;let o=`${r}-${t.componentName||"component"}-icon`;if(a.classList.add(o),t.iconPosition)a.classList.add(`${o}--${t.iconPosition}`);if(t.iconSize)a.classList.add(`${r}-icon--${t.iconSize}`);return a.innerHTML=s,a};return{setIcon(s){if(!n&&s)if(n=i(s),t.iconPosition==="end")e.appendChild(n);else{let a=e.querySelector(`[class*="${r}-${t.componentName||"component"}-label"]`);if(a)if(a.nextSibling)e.insertBefore(n,a.nextSibling);else e.appendChild(n);else e.insertBefore(n,e.firstChild)}else if(n&&s)n.innerHTML=s;return this},getIcon(){return n?n.innerHTML:""},getElement(){return n}}},Be=(e)=>(t)=>{let n=Pm(t.element,{prefix:e.prefix,componentName:e.componentName||"component",iconPosition:e.iconPosition,iconSize:e.iconSize});if(e.icon)n.setIcon(e.icon);if(t.componentName==="button"&&e.icon&&e.text)t.element.classList.add(`${t.getClass("button")}--icon`);return{...t,icon:n}};var oe=(e)=>(t)=>{if(e.variant&&t.element){let n=`${e.prefix}-${e.componentName}--${e.variant}`;t.element.classList.add(n)}return t};var Ot=(e)=>(t)=>{if(e.size&&t.element){let n=`${e.prefix}-${e.componentName}--${e.size}`;t.element.classList.add(n)}return t};var Ia,Ln=(e)=>(t)=>{if(!e.position||!t.element)return t;let n=Ia[e.position.toUpperCase()]||e.position,r=`${e.prefix}-${e.componentName}--${n}`;return t.element.classList.add(r),{...t,position:{setPosition(s){let a=n,o=`${e.prefix}-${e.componentName}--${a}`,l=`${e.prefix}-${e.componentName}--${s}`;return t.element.classList.remove(o),t.element.classList.add(l),this},getPosition(){return n}}}};var La=X(()=>{((o)=>{o.LEFT="left";o.RIGHT="right";o.TOP="top";o.BOTTOM="bottom";o.START="start";o.END="end";o.CENTER="center"})(Ia||={})});var Aa,jt,hh;var wa=X(()=>{((a)=>{a.LINEAR="linear";a.EASE="ease";a.EASE_IN="ease-in";a.EASE_OUT="ease-out";a.EASE_IN_OUT="ease-in-out";a.MATERIAL="cubic-bezier(0.4, 0.0, 0.2, 1)"})(Aa||={});jt={duration:450,timing:"cubic-bezier(0.4, 0.0, 0.2, 1)",opacity:["0.4","0"]},hh={duration:{type:"number",minimum:0,default:jt.duration},timing:{type:"string",enum:Object.values(Aa),default:jt.timing},opacity:{type:"array",items:{type:"string",pattern:"^[0-1](\\.\\d+)?$"},minItems:2,maxItems:2,default:jt.opacity}}});var km=(e={})=>{let t={...jt,...e,opacity:e.opacity||jt.opacity},n=new WeakMap,r=[],i=()=>{let l=document.createElement("div");return l.className=`${K}-ripple-wave`,l},s=(l,d)=>{if(typeof document.addEventListener==="function")document.addEventListener(l,d),r.push({event:l,handler:d})},a=(l,d)=>{if(typeof document.removeEventListener==="function")document.removeEventListener(l,d),r=r.filter((u)=>!(u.event===l&&u.handler===d))},o=(l,d)=>{if(!d||!d.__rippleContainer)return;let u=d.__rippleContainer,f=d.getBoundingClientRect(),c=i(),C=Math.max(f.width,f.height)*2,g=l.clientX-f.left-C/2,m=l.clientY-f.top-C/2;Object.assign(c.style,{width:`${C}px`,height:`${C}px`,left:`${g}px`,top:`${m}px`}),u.appendChild(c),c.offsetHeight,requestAnimationFrame(()=>{c.classList.add("active")});let p=()=>{a("mouseup",p),a("mouseleave",p),c.classList.remove("active"),c.classList.add("fade-out"),setTimeout(()=>{if(c.parentNode)c.parentNode.removeChild(c);n.get(d)?.delete(c)},t.duration)};s("mouseup",p),s("mouseleave",p)};return{mount:(l)=>{if(!l)return;if(window.getComputedStyle(l).position==="static")l.style.position="relative";let u=l.querySelector(`.${K}-ripple`);if(!u)u=document.createElement("div"),u.className=`${K}-ripple`,l.appendChild(u);l.__rippleContainer=u,n.set(l,new Set);let f=(c)=>o(c,l);if(!l.__rippleHandlers)l.__rippleHandlers=[];l.__rippleHandlers.push(f),l.addEventListener("mousedown",f)},unmount:(l)=>{if(!l)return;if(r.forEach(({event:d,handler:u})=>{a(d,u)}),r=[],l.__rippleHandlers)l.__rippleHandlers.forEach((d)=>{l.removeEventListener("mousedown",d)}),l.__rippleHandlers=[];if(n.has(l)){let d=n.get(l);if(d)d.forEach((u)=>{if(u.parentNode)u.parentNode.removeChild(u)});n.delete(l)}if(l.__rippleContainer&&l.__rippleContainer.parentNode)l.__rippleContainer.parentNode.removeChild(l.__rippleContainer),delete l.__rippleContainer}}},we=(e)=>(t)=>{if(!e.ripple)return t;let n=km(e.rippleConfig);if(n.mount(t.element),t.lifecycle){let r=t.lifecycle.mount,i=t.lifecycle.destroy;t.lifecycle.mount=()=>{r.call(t.lifecycle)},t.lifecycle.destroy=()=>{n.unmount(t.element),i.call(t.lifecycle)}}return{...t,ripple:n}};var Na=X(()=>{wa();nt()});function Da(e){return"emit"in e&&typeof e.emit==="function"}var Rt=(e={})=>(t)=>{let n=document.createElement("input"),r=t.componentName||"component";n.type="checkbox",n.className=`${t.getClass(r)}-input`,n.style.position="absolute",n.style.opacity="0",n.style.cursor="pointer",t.element.setAttribute("role","presentation"),n.setAttribute("role",r);let i={name:e.name,checked:e.checked,required:e.required,disabled:e.disabled,value:e.value||"on","aria-label":e.label||e.ariaLabel};return Object.entries(i).forEach(([s,a])=>{if(a!==null&&a!==void 0)if(s==="disabled"&&a===!0)n.disabled=!0,n.setAttribute("disabled","true");else if(a===!0)n.setAttribute(s,s);else n.setAttribute(s,String(a))}),n.addEventListener("change",(s)=>{if(Da(t))t.emit("change",{checked:n.checked,value:n.value,nativeEvent:s})}),n.addEventListener("keydown",(s)=>{if(s.key===" "||s.key==="Enter"){if(s.preventDefault(),!n.disabled)n.checked=!n.checked,n.dispatchEvent(new Event("change",{bubbles:!0}))}}),t.element.appendChild(n),{...t,input:n,getValue:()=>n.value,setValue(s){if(n.value=s,Da(t))t.emit("value",{value:s});return this}}};var _t=(e={})=>(t)=>{if(!t.input)return t;let n=t.componentName||"component",r=()=>{t.element.classList.toggle(`${t.getClass(n)}--checked`,t.input.checked)};if(e.checked!==void 0)t.input.checked=e.checked;if(r(),t.emit)t.on?.("change",r);return{...t,checkable:{check(){if(!t.input.checked)t.input.checked=!0,r(),t.emit?.("change",{checked:!0,value:t.input.value});return this},uncheck(){if(t.input.checked)t.input.checked=!1,r(),t.emit?.("change",{checked:!1,value:t.input.value});return this},toggle(){return t.input.checked=!t.input.checked,r(),t.emit?.("change",{checked:t.input.checked,value:t.input.value}),this},isChecked(){return t.input.checked}}}};var qr=(e={})=>(t)=>{if(e.variant)t.element.classList.add(`${t.getClass("button")}--${e.variant}`);if(e.size)t.element.classList.add(`${t.getClass("button")}--${e.size}`);return t};function pt(e){return"lifecycle"in e&&e.lifecycle&&typeof e.lifecycle==="object"&&"destroy"in e.lifecycle&&typeof e.lifecycle.destroy==="function"}function ht(e){return"emit"in e&&typeof e.emit==="function"}var An=(e={})=>(t)=>{let n=e.multiline||e.type==="multiline",r=document.createElement(n?"textarea":"input");r.className=`${t.getClass("textfield")}-input`;let i={name:e.name,required:e.required,disabled:e.disabled,maxLength:e.maxLength,pattern:e.pattern,autocomplete:e.autocomplete,value:e.value||"",placeholder:e.placeholder||" "};if(!n)i.type=e.type||"text";else i["data-type"]="multiline";Object.entries(i).forEach(([l,d])=>{if(d!==null&&d!==void 0)if(typeof d==="boolean"){if(d)r.setAttribute(l,"")}else r.setAttribute(l,String(d))});let s=()=>{let l=!r.value;return t.element.classList.toggle(`${t.getClass("textfield")}--empty`,l),l},a=(l=!0)=>{let d=r.value&&r.value.length>0,u=r.matches(":-webkit-autofill"),c=window.getComputedStyle(r).backgroundColor,C=c==="rgb(250, 255, 189)"||c==="rgb(232, 240, 254)"||c==="rgb(250, 255, 0)"||c==="rgba(255, 255, 0, 0.1)";if(d||u||C){if(t.element.classList.remove(`${t.getClass("textfield")}--empty`),l&&ht(t)&&(u||C))t.emit("input",{value:r.value,isEmpty:!1,isAutofilled:!0})}},o=null;if(typeof MutationObserver<"u")o=new MutationObserver((l)=>{l.forEach((d)=>{if(d.type==="attributes"&&(d.attributeName==="value"||d.attributeName==="data-autofilled"))a(!0)})}),o.observe(r,{attributes:!0,attributeFilter:["value","data-autofilled","autocomplete"]});if(r.addEventListener("focus",()=>{if(t.element.classList.add(`${t.getClass("textfield")}--focused`),ht(t))t.emit("focus",{isEmpty:s()});a(!1)}),r.addEventListener("blur",()=>{if(t.element.classList.remove(`${t.getClass("textfield")}--focused`),ht(t))t.emit("blur",{isEmpty:s()});a(!1)}),r.addEventListener("input",()=>{if(ht(t))t.emit("input",{value:r.value,isEmpty:s(),isAutofilled:!1});else s()}),r.addEventListener("change",()=>{let l=s();if(a(!1),ht(t))t.emit("change",{value:r.value,isEmpty:l,isAutofilled:r.matches?.(":-webkit-autofill")||!1})}),r.addEventListener("animationstart",(l)=>{if(l.animationName==="onAutoFillStart"||l.animationName?.includes("autofill"))a()}),s(),setTimeout(()=>{a(!1)},0),n)t.element.classList.add(`${t.getClass("textfield")}--multiline`);if(t.element.appendChild(r),pt(t)){let l=t.lifecycle.destroy;t.lifecycle.destroy=()=>{if(o)o.disconnect();r.remove(),l.call(t.lifecycle)}}return{...t,input:r,setValue(l){return r.value=l||"",s(),this},getValue(){return r.value},setAttribute(l,d){return r.setAttribute(l,d),this},getAttribute(l){return r.getAttribute(l)},removeAttribute(l){return r.removeAttribute(l),this}}};var Ma=()=>{};var et=(e={})=>(t)=>{if(!e.label)return t;let n=document.createElement("label"),r=e.labelPosition||"start";if(n.className=`${e.prefix}-${e.componentName}-label ${e.prefix}-${e.componentName}-label--${r}`,n.textContent=e.label,r==="start")if(t.element.firstChild)t.element.insertBefore(n,t.element.firstChild);else t.element.appendChild(n);else t.element.appendChild(n);if(r&&t.componentName!=="slider")t.element.classList.add(`${e.prefix}-${e.componentName}--label-${r}`);return{...t,label:{setText(s){return n.textContent=s,this},getText(){return n.textContent||""},getElement(){return n}}}};var Bm=`
|
|
6
|
+
var Cm=Object.create;var{getPrototypeOf:Em,defineProperty:Tn,getOwnPropertyNames:sa,getOwnPropertyDescriptor:bm}=Object,Wr=Object.prototype.hasOwnProperty;function aa(e){return this[e]}var vm,Tm,Sm=(e,t,n)=>{var r=e!=null&&typeof e==="object";if(r){var i=t?vm??=new WeakMap:Tm??=new WeakMap,s=i.get(e);if(s)return s}n=e!=null?Cm(Em(e)):{};let a=t||!e||!e.__esModule||!Wr.call(e,"default")?Tn(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let o of sa(e))if(!Wr.call(a,o))Tn(a,o,{get:aa.bind(e,o),enumerable:!0})}if(r)i.set(e,a);return a},ym=(e)=>{var t=(ia??=new WeakMap).get(e),n;if(t)return t;if(t=Tn({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var r of sa(e))if(!Wr.call(t,r))Tn(t,r,{get:aa.bind(e,r),enumerable:!(n=bm(e,r))||n.enumerable})}return ia.set(e,t),t},ia;var xm=(e)=>e;function Im(e,t){this[e]=xm.bind(null,t)}var Lm=(e,t)=>{for(var n in t)Tn(e,n,{get:t[n],enumerable:!0,configurable:!0,set:Im.bind(t,n)})};var X=(e,t,n)=>()=>{if(e)try{t=e(e=0)}catch(r){n=[r]}if(n)throw n[0];return t};var M=(...e)=>(t)=>e.reduce((n,r)=>r(n),t),oa=(...e)=>(t)=>e.reduceRight((n,r)=>r(n),t),la=(...e)=>(t,n={})=>e.reduce((r,i)=>({...r,...i(r,n)}),t);var da=(e={})=>({element:null,config:e,setup(){return this}});var Sn=(e,t={})=>{if(!t)return e;let n=Object.keys(t);if(n.length===1){let r=t[n[0]];if(r!=null)e.setAttribute(n[0],String(r));return e}for(let r in t){let i=t[r];if(i!=null)e.setAttribute(r,String(i))}return e},ua=(e,t=[])=>{for(let n=0;n<t.length;n++)e.removeAttribute(t[n]);return e},ca=(e,t)=>{for(let n=0;n<t.length;n++){let r=t[n];if(r.action==="set"&&r.value!=null)e.setAttribute(r.key,String(r.value));else if(r.action==="remove")e.removeAttribute(r.key)}return e},ma=(e,t)=>e.hasAttribute(t),fa=(e,t,n="")=>e.getAttribute(t)??n;var K="mtrl",ga=(e)=>`mtrl-${e}`,pa=(e,t)=>`${e}--${t}`,ha=(e,t)=>`${e}-${t}`,Kr,Yr,Ca;var nt=X(()=>{((s)=>{s.BUTTON="button";s.TEXTFIELD="textfield";s.CONTAINER="container";s.SNACKBAR="snackbar";s.SWITCH="switch"})(Kr||={});((s)=>{s.DISABLED="disabled";s.FOCUSED="focused";s.ACTIVE="active";s.LOADING="loading";s.ERROR="error"})(Yr||={});Ca={bem:(e,t,n)=>{let r=e;if(t)r+=`-${t}`;if(n)r+=`--${n}`;return r},join:(...e)=>e.filter(Boolean).join(" ")}});var Ie,Zn,Am=500,qt=(...e)=>{if(e.length===0)return[];if(e.length===1&&typeof e[0]==="string"){let r=e[0];if(!r)return[];if(!r.includes(" "))return[r];if(Zn.has(r))return Zn.get(r)}let t=new Set,n=[];for(let r of e)if(typeof r==="string"&&r)if(!r.includes(" ")){if(!t.has(r))t.add(r),n.push(r)}else r.split(" ").forEach((i)=>{let s=i.trim();if(s&&!t.has(s))t.add(s),n.push(s)});else if(Array.isArray(r))r.forEach((i)=>{if(typeof i==="string"&&i)i.split(" ").forEach((s)=>{let a=s.trim();if(a&&!t.has(a))t.add(a),n.push(a)})});if(e.length===1&&typeof e[0]==="string"&&n.length<=10){if(Zn.size<Am)Zn.set(e[0],n)}return n},ee=(e,...t)=>{if(t.length===0)return e;if(t.length===1&&Array.isArray(t[0]))return ee(e,...t[0]);if(t.length===1&&typeof t[0]==="string"){let r=t[0];if(r&&!r.includes(" ")){let i=r.startsWith(Ie)?r:Ie+r;if(!i.includes(" "))return e.classList.add(i),e}}let n=qt(...t);for(let r of n){let i=r.startsWith(Ie)?r:Ie+r;if(i.includes(" "))i.split(" ").forEach((s)=>{let a=s.trim();if(a)e.classList.add(a)});else e.classList.add(i)}return e},Ce=(e,...t)=>{if(t.length===0)return e;if(t.length===1&&Array.isArray(t[0]))return Ce(e,...t[0]);if(t.length===1&&typeof t[0]==="string"){let r=t[0];if(r&&!r.includes(" ")){let i=r.startsWith(Ie)?r:Ie+r;if(!i.includes(" "))return e.classList.remove(i),e}}let n=qt(...t);for(let r of n){let i=r.startsWith(Ie)?r:Ie+r;if(i.includes(" "))i.split(" ").forEach((s)=>{let a=s.trim();if(a)e.classList.remove(a)});else e.classList.remove(i)}return e},Qn=(e,...t)=>{if(t.length===1&&Array.isArray(t[0]))return Qn(e,...t[0]);if(t.length===1&&typeof t[0]==="string"){let r=t[0];if(r&&!r.includes(" ")){let i=r.startsWith(Ie)?r:Ie+r;if(!i.includes(" "))return e.classList.toggle(i),e}}let n=qt(...t);for(let r of n){let i=r.startsWith(Ie)?r:Ie+r;if(i.includes(" "))i.split(" ").forEach((s)=>{let a=s.trim();if(a)e.classList.toggle(a)});else e.classList.toggle(i)}return e},rt=(e,...t)=>{if(t.length===0)return!0;if(t.length===1&&Array.isArray(t[0]))return rt(e,...t[0]);if(t.length===1&&typeof t[0]==="string"){let r=t[0];if(r&&!r.includes(" ")){let i=r.startsWith(Ie)?r:Ie+r;if(!i.includes(" "))return e.classList.contains(i)}}let n=qt(...t);for(let r of n){let i=r.startsWith(Ie)?r:Ie+r;if(i.includes(" ")){let s=i.split(" ").map((a)=>a.trim()).filter(Boolean);for(let a of s)if(!e.classList.contains(a))return!1}else if(!e.classList.contains(i))return!1}return!0};var yn=X(()=>{nt();Ie=`${K}-`,Zn=new Map});class ba{pools=new Map;maxSize=20;acquire(e="div"){let t=this.pools.get(e);if(t?.length){let n=t.pop();return n.className="",n.innerHTML="",n.removeAttribute("id"),Object.keys(n.dataset).forEach((r)=>delete n.dataset[r]),n}return document.createElement(e)}release(e){let t=e.tagName.toLowerCase(),n=this.pools.get(t);if(!n)n=[],this.pools.set(t,n);if(n.length<this.maxSize)this.cleanElement(e),n.push(e)}cleanElement(e){let t=e.__eventHandlers;if(t){for(let n in t)e.removeEventListener(n,t[n]);delete e.__eventHandlers}e.className="",e.innerHTML="",e.removeAttribute("id"),Object.keys(e.dataset).forEach((n)=>delete e.dataset[n]),e.parentNode?.removeChild(e)}}var wm,Ea=(e,t,n)=>{if(!t||!n?.emit&&!n?.on)return;e.__eventHandlers={};for(let r in t){let i=t[r],s=(o)=>{let l=!0;if(typeof i==="function")try{l=i({...n,element:e},o)}catch(d){console.warn(`Error in event condition for ${r}:`,d),l=!1}else l=Boolean(i);if(l&&n.emit)n.emit(r,{event:o,element:e,originalEvent:o})};e.__eventHandlers[r]=s;let a=wm.has(r)?{passive:!0}:void 0;e.addEventListener(r,s,a)}},Qp,B=(e={})=>{if(!e||Object.keys(e).length===0)return document.createElement("div");if(typeof e==="string")return document.createElement(e);let t=document.createElement(e.tag||"div");if(e.html)t.innerHTML=e.html;else if(e.text)t.textContent=e.text;if(e.id)t.id=e.id;if(e.name)t.setAttribute("name",e.name);if(e.title)t.title=e.title;if(e.tabIndex!==void 0)t.tabIndex=e.tabIndex;if(e.style)if(typeof e.style==="string")t.setAttribute("style",e.style);else Object.assign(t.style,e.style);if(e.role)t.setAttribute("role",e.role);if(e.ariaLabel)t.setAttribute("aria-label",e.ariaLabel);if(e.ariaDescribedBy)t.setAttribute("aria-describedby",e.ariaDescribedBy);if(e.ariaLabelledBy)t.setAttribute("aria-labelledby",e.ariaLabelledBy);if(e.ariaHidden!==void 0)t.setAttribute("aria-hidden",String(e.ariaHidden));let n=e.className||e.class;if(n)ee(t,n);if(e.rawClass){let r=Array.isArray(e.rawClass)?e.rawClass:e.rawClass.split(" ");t.classList.add(...r.filter(Boolean))}if(e.data)Object.assign(t.dataset,e.data);if(e.attributes)Sn(t,e.attributes);for(let r in e)if(!["tag","container","html","text","id","name","title","tabIndex","style","role","ariaLabel","ariaDescribedBy","ariaLabelledBy","ariaHidden","data","class","className","rawClass","attributes","forwardEvents","onCreate","context"].includes(r)){let i=e[r];if(i!=null)t.setAttribute(r,String(i))}if(e.forwardEvents)Ea(t,e.forwardEvents,e.context);if(e.container)e.container.appendChild(t);if(e.onCreate)e.onCreate(t,e.context);return t},va=(e={})=>{let t=document.createElementNS("http://www.w3.org/2000/svg",e.tag||"svg");if(e.text)t.textContent=e.text;if(e.id)t.id=e.id;if(e.attributes)Sn(t,e.attributes);if(e.forwardEvents)Ea(t,e.forwardEvents,e.context);if(e.container)e.container.appendChild(t);if(e.onCreate)e.onCreate(t,e.context);return t},Ta=(e)=>{let t=e.__eventHandlers;if(t){for(let n in t)e.removeEventListener(n,t[n]);delete e.__eventHandlers}};var Qe=X(()=>{yn();wm=new Set(["touchstart","touchmove"]);Qp=new ba});function Nm(e){return"touches"in e}function Dm(e){return"clientX"in e&&"clientY"in e}var Sa=()=>{let e=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),t=window.innerWidth<=768;return e||t},Jn,gt,Xr,We=()=>("ontouchstart"in window)||navigator.maxTouchPoints>0,Je=(e)=>{if(Nm(e)&&e.touches.length>0){let t=e.touches[0];return{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,target:e.target,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation(),type:e.type}}if(Dm(e))return{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,target:e.target,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation(),type:e.type};return{clientX:0,clientY:0,pageX:0,pageY:0,target:e.target,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation(),type:e.type}};var xn=X(()=>{Jn={passive:!0},gt={TARGET_SIZE:44,FEEDBACK_DURATION:200,TAP_THRESHOLD:250,SWIPE_THRESHOLD:50},Xr={MINIMUM:44,COMFORTABLE:48,LARGE:56}});var Mm=(e)=>({getClass:(t)=>`${e}-${t}`,getModifierClass:(t,n)=>`${t}--${n}`,getElementClass:(t,n)=>`${t}-${n}`}),D=(e={})=>({config:e,componentName:e.componentName,...Mm(e.prefix||"mtrl"),touchState:{startTime:0,startPosition:{x:0,y:0},isTouching:!1,activeTarget:null},updateTouchState(t,n){let r=Je(t);if(n==="start")this.touchState={startTime:Date.now(),startPosition:{x:r.clientX,y:r.clientY},isTouching:!0,activeTarget:r.target};else if(n==="end")this.touchState.isTouching=!1,this.touchState.activeTarget=null}}),O=(e={})=>(t)=>{let n=(d)=>{if(s.updateTouchState(d,"start"),l.classList.add(`${s.getClass("touch-active")}`),e.forwardEvents?.touchstart&&"emit"in t)t.emit("touchstart",Je(d))},r=(d)=>{if(!s.touchState.isTouching)return;let u=Date.now()-s.touchState.startTime;if(l.classList.remove(`${s.getClass("touch-active")}`),s.updateTouchState(d,"end"),u<gt.TAP_THRESHOLD&&"emit"in t)t.emit("tap",Je(d));if(e.forwardEvents?.touchend&&"emit"in t)t.emit("touchend",Je(d))},i=(d)=>{if(!s.touchState.isTouching)return;let u=Je(d),f=u.clientX-s.touchState.startPosition.x,c=u.clientY-s.touchState.startPosition.y;if(Math.abs(f)>gt.SWIPE_THRESHOLD&&"emit"in t)t.emit("swipe",{direction:f>0?"right":"left",deltaX:f,deltaY:c});if(e.forwardEvents?.touchmove&&"emit"in t)t.emit("touchmove",{...u,deltaX:f,deltaY:c})},s=t,a=t.config.parent||e.parent;if(typeof a==="string")a=document.querySelector(a);let o={tag:e.tag||"div",className:[s.getClass(e.componentName||s.componentName||"component"),We()&&e.interactive?s.getClass("interactive"):null,...Array.isArray(e.className)?e.className:[e.className]].filter(Boolean),attributes:e.attributes||{},id:e.id,name:e.name,title:e.title,tabIndex:e.tabIndex,style:e.style,data:e.data,role:e.role,ariaLabel:e.ariaLabel,ariaDescribedBy:e.ariaDescribedBy,ariaLabelledBy:e.ariaLabelledBy,ariaHidden:e.ariaHidden,forwardEvents:e.forwardEvents||{},context:t,container:a},l=B(o);if(We()&&e.interactive)l.addEventListener("touchstart",n,Jn),l.addEventListener("touchend",r),l.addEventListener("touchmove",i,Jn);return{...t,element:l,addClass(...d){return l.classList.add(...d.filter(Boolean)),this},destroy(){if(We()&&e.interactive)l.removeEventListener("touchstart",n),l.removeEventListener("touchend",r),l.removeEventListener("touchmove",i);Ta(l),l.remove()}}};var te=X(()=>{Qe();xn()});var Re=()=>{let e=new Map;return{on:(t,n)=>{let r=e.get(t)||[];return e.set(t,[...r,n]),()=>{let i=e.get(t)||[];e.set(t,i.filter((s)=>s!==n))}},off(t,n){let r=e.get(t)||[];e.set(t,r.filter((i)=>i!==n))},emit:(t,...n)=>{(e.get(t)||[]).forEach((i)=>i(...n))},clear:()=>{e.clear()}}};var k=()=>(e)=>{let t=Re();return{...e,on(n,r){return t.on(n,r),this},off(n,r){return t.off(n,r),this},emit(n,r){return t.emit(n,r),this}}};var ya=()=>{};var Om=(e,t={})=>{let n=null,r=t.prefix||"mtrl",i=(s)=>{let a=document.createElement("span");return a.className=`${r}-${t.componentName||"component"}-text`,a.textContent=s,a};return{setText(s){if(!n&&s)if(n=i(s),t.beforeElement)e.insertBefore(n,t.beforeElement);else e.appendChild(n);else if(n)n.textContent=s;return this},getText(){return n?n.textContent||"":""},getElement(){return n}}},ot=(e)=>(t)=>{let n=Om(t.element,{prefix:e.prefix,componentName:e.componentName||"component"});if(e.text)n.setText(e.text);return{...t,text:n}};var Rm=(e,t={})=>{let n=null,r=t.prefix||"mtrl",i=(s)=>{let a=document.createElement("span");a.className=`${r}-icon`;let o=`${r}-${t.componentName||"component"}-icon`;if(a.classList.add(o),t.iconPosition)a.classList.add(`${o}--${t.iconPosition}`);if(t.iconSize)a.classList.add(`${r}-icon--${t.iconSize}`);return a.innerHTML=s,a};return{setIcon(s){if(!n&&s)if(n=i(s),t.iconPosition==="end")e.appendChild(n);else{let a=e.querySelector(`[class*="${r}-${t.componentName||"component"}-label"]`);if(a)if(a.nextSibling)e.insertBefore(n,a.nextSibling);else e.appendChild(n);else e.insertBefore(n,e.firstChild)}else if(n&&s)n.innerHTML=s;return this},getIcon(){return n?n.innerHTML:""},getElement(){return n}}},Be=(e)=>(t)=>{let n=Rm(t.element,{prefix:e.prefix,componentName:e.componentName||"component",iconPosition:e.iconPosition,iconSize:e.iconSize});if(e.icon)n.setIcon(e.icon);if(t.componentName==="button"&&e.icon&&e.text)t.element.classList.add(`${t.getClass("button")}--icon`);return{...t,icon:n}};var oe=(e)=>(t)=>{if(e.variant&&t.element){let n=`${e.prefix}-${e.componentName}--${e.variant}`;t.element.classList.add(n)}return t};var Mt=(e)=>(t)=>{if(e.size&&t.element){let n=`${e.prefix}-${e.componentName}--${e.size}`;t.element.classList.add(n)}return t};var xa,In=(e)=>(t)=>{if(!e.position||!t.element)return t;let n=xa[e.position.toUpperCase()]||e.position,r=`${e.prefix}-${e.componentName}--${n}`;return t.element.classList.add(r),{...t,position:{setPosition(s){let a=n,o=`${e.prefix}-${e.componentName}--${a}`,l=`${e.prefix}-${e.componentName}--${s}`;return t.element.classList.remove(o),t.element.classList.add(l),this},getPosition(){return n}}}};var Ia=X(()=>{((o)=>{o.LEFT="left";o.RIGHT="right";o.TOP="top";o.BOTTOM="bottom";o.START="start";o.END="end";o.CENTER="center"})(xa||={})});var La,jt,gh;var Aa=X(()=>{((a)=>{a.LINEAR="linear";a.EASE="ease";a.EASE_IN="ease-in";a.EASE_OUT="ease-out";a.EASE_IN_OUT="ease-in-out";a.MATERIAL="cubic-bezier(0.4, 0.0, 0.2, 1)"})(La||={});jt={duration:450,timing:"cubic-bezier(0.4, 0.0, 0.2, 1)",opacity:["0.4","0"]},gh={duration:{type:"number",minimum:0,default:jt.duration},timing:{type:"string",enum:Object.values(La),default:jt.timing},opacity:{type:"array",items:{type:"string",pattern:"^[0-1](\\.\\d+)?$"},minItems:2,maxItems:2,default:jt.opacity}}});var _m=(e={})=>{let t={...jt,...e,opacity:e.opacity||jt.opacity},n=new WeakMap,r=[],i=()=>{let l=document.createElement("div");return l.className=`${K}-ripple-wave`,l},s=(l,d)=>{if(typeof document.addEventListener==="function")document.addEventListener(l,d),r.push({event:l,handler:d})},a=(l,d)=>{if(typeof document.removeEventListener==="function")document.removeEventListener(l,d),r=r.filter((u)=>!(u.event===l&&u.handler===d))},o=(l,d)=>{if(!d||!d.__rippleContainer)return;let u=d.__rippleContainer,f=d.getBoundingClientRect(),c=i(),C=Math.max(f.width,f.height)*2,g=l.clientX-f.left-C/2,m=l.clientY-f.top-C/2;Object.assign(c.style,{width:`${C}px`,height:`${C}px`,left:`${g}px`,top:`${m}px`}),u.appendChild(c),c.offsetHeight,requestAnimationFrame(()=>{c.classList.add("active")});let p=()=>{a("mouseup",p),a("mouseleave",p),c.classList.remove("active"),c.classList.add("fade-out"),setTimeout(()=>{if(c.parentNode)c.parentNode.removeChild(c);n.get(d)?.delete(c)},t.duration)};s("mouseup",p),s("mouseleave",p)};return{mount:(l)=>{if(!l)return;if(window.getComputedStyle(l).position==="static")l.style.position="relative";let u=l.querySelector(`.${K}-ripple`);if(!u)u=document.createElement("div"),u.className=`${K}-ripple`,l.appendChild(u);l.__rippleContainer=u,n.set(l,new Set);let f=(c)=>o(c,l);if(!l.__rippleHandlers)l.__rippleHandlers=[];l.__rippleHandlers.push(f),l.addEventListener("mousedown",f)},unmount:(l)=>{if(!l)return;if(r.forEach(({event:d,handler:u})=>{a(d,u)}),r=[],l.__rippleHandlers)l.__rippleHandlers.forEach((d)=>{l.removeEventListener("mousedown",d)}),l.__rippleHandlers=[];if(n.has(l)){let d=n.get(l);if(d)d.forEach((u)=>{if(u.parentNode)u.parentNode.removeChild(u)});n.delete(l)}if(l.__rippleContainer&&l.__rippleContainer.parentNode)l.__rippleContainer.parentNode.removeChild(l.__rippleContainer),delete l.__rippleContainer}}},we=(e)=>(t)=>{if(!e.ripple)return t;let n=_m(e.rippleConfig);if(n.mount(t.element),t.lifecycle){let r=t.lifecycle.mount,i=t.lifecycle.destroy;t.lifecycle.mount=()=>{r.call(t.lifecycle)},t.lifecycle.destroy=()=>{n.unmount(t.element),i.call(t.lifecycle)}}return{...t,ripple:n}};var wa=X(()=>{Aa();nt()});function Na(e){return"emit"in e&&typeof e.emit==="function"}var Ot=(e={})=>(t)=>{let n=document.createElement("input"),r=t.componentName||"component";n.type="checkbox",n.className=`${t.getClass(r)}-input`,n.style.position="absolute",n.style.opacity="0",n.style.cursor="pointer",t.element.setAttribute("role","presentation"),n.setAttribute("role",r);let i={name:e.name,checked:e.checked,required:e.required,disabled:e.disabled,value:e.value||"on","aria-label":e.label||e.ariaLabel};return Object.entries(i).forEach(([s,a])=>{if(a!==null&&a!==void 0)if(s==="disabled"&&a===!0)n.disabled=!0,n.setAttribute("disabled","true");else if(a===!0)n.setAttribute(s,s);else n.setAttribute(s,String(a))}),n.addEventListener("change",(s)=>{if(Na(t))t.emit("change",{checked:n.checked,value:n.value,nativeEvent:s})}),n.addEventListener("keydown",(s)=>{if(s.key===" "||s.key==="Enter"){if(s.preventDefault(),!n.disabled)n.checked=!n.checked,n.dispatchEvent(new Event("change",{bubbles:!0}))}}),t.element.appendChild(n),{...t,input:n,getValue:()=>n.value,setValue(s){if(n.value=s,Na(t))t.emit("value",{value:s});return this}}};var Rt=(e={})=>(t)=>{if(!t.input)return t;let n=t.componentName||"component",r=()=>{t.element.classList.toggle(`${t.getClass(n)}--checked`,t.input.checked)};if(e.checked!==void 0)t.input.checked=e.checked;if(r(),t.emit)t.on?.("change",r);return{...t,checkable:{check(){if(!t.input.checked)t.input.checked=!0,r(),t.emit?.("change",{checked:!0,value:t.input.value});return this},uncheck(){if(t.input.checked)t.input.checked=!1,r(),t.emit?.("change",{checked:!1,value:t.input.value});return this},toggle(){return t.input.checked=!t.input.checked,r(),t.emit?.("change",{checked:t.input.checked,value:t.input.value}),this},isChecked(){return t.input.checked}}}};var qr=(e={})=>(t)=>{if(e.variant)t.element.classList.add(`${t.getClass("button")}--${e.variant}`);if(e.size)t.element.classList.add(`${t.getClass("button")}--${e.size}`);return t};function pt(e){return"lifecycle"in e&&e.lifecycle&&typeof e.lifecycle==="object"&&"destroy"in e.lifecycle&&typeof e.lifecycle.destroy==="function"}function ht(e){return"emit"in e&&typeof e.emit==="function"}var Ln=(e={})=>(t)=>{let n=e.multiline||e.type==="multiline",r=document.createElement(n?"textarea":"input");r.className=`${t.getClass("textfield")}-input`;let i={name:e.name,required:e.required,disabled:e.disabled,maxLength:e.maxLength,pattern:e.pattern,autocomplete:e.autocomplete,value:e.value||"",placeholder:e.placeholder||" "};if(!n)i.type=e.type||"text";else i["data-type"]="multiline";Object.entries(i).forEach(([l,d])=>{if(d!==null&&d!==void 0)if(typeof d==="boolean"){if(d)r.setAttribute(l,"")}else r.setAttribute(l,String(d))});let s=()=>{let l=!r.value;return t.element.classList.toggle(`${t.getClass("textfield")}--empty`,l),l},a=(l=!0)=>{let d=r.value&&r.value.length>0,u=r.matches(":-webkit-autofill"),c=window.getComputedStyle(r).backgroundColor,C=c==="rgb(250, 255, 189)"||c==="rgb(232, 240, 254)"||c==="rgb(250, 255, 0)"||c==="rgba(255, 255, 0, 0.1)";if(d||u||C){if(t.element.classList.remove(`${t.getClass("textfield")}--empty`),l&&ht(t)&&(u||C))t.emit("input",{value:r.value,isEmpty:!1,isAutofilled:!0})}},o=null;if(typeof MutationObserver<"u")o=new MutationObserver((l)=>{l.forEach((d)=>{if(d.type==="attributes"&&(d.attributeName==="value"||d.attributeName==="data-autofilled"))a(!0)})}),o.observe(r,{attributes:!0,attributeFilter:["value","data-autofilled","autocomplete"]});if(r.addEventListener("focus",()=>{if(t.element.classList.add(`${t.getClass("textfield")}--focused`),ht(t))t.emit("focus",{isEmpty:s()});a(!1)}),r.addEventListener("blur",()=>{if(t.element.classList.remove(`${t.getClass("textfield")}--focused`),ht(t))t.emit("blur",{isEmpty:s()});a(!1)}),r.addEventListener("input",()=>{if(ht(t))t.emit("input",{value:r.value,isEmpty:s(),isAutofilled:!1});else s()}),r.addEventListener("change",()=>{let l=s();if(a(!1),ht(t))t.emit("change",{value:r.value,isEmpty:l,isAutofilled:r.matches?.(":-webkit-autofill")||!1})}),r.addEventListener("animationstart",(l)=>{if(l.animationName==="onAutoFillStart"||l.animationName?.includes("autofill"))a()}),s(),setTimeout(()=>{a(!1)},0),n)t.element.classList.add(`${t.getClass("textfield")}--multiline`);if(t.element.appendChild(r),pt(t)){let l=t.lifecycle.destroy;t.lifecycle.destroy=()=>{if(o)o.disconnect();r.remove(),l.call(t.lifecycle)}}return{...t,input:r,setValue(l){return r.value=l||"",s(),this},getValue(){return r.value},setAttribute(l,d){return r.setAttribute(l,d),this},getAttribute(l){return r.getAttribute(l)},removeAttribute(l){return r.removeAttribute(l),this}}};var Da=()=>{};var et=(e={})=>(t)=>{if(!e.label)return t;let n=document.createElement("label"),r=e.labelPosition||"start";if(n.className=`${e.prefix}-${e.componentName}-label ${e.prefix}-${e.componentName}-label--${r}`,n.textContent=e.label,r==="start")if(t.element.firstChild)t.element.insertBefore(n,t.element.firstChild);else t.element.appendChild(n);else t.element.appendChild(n);if(r&&t.componentName!=="slider")t.element.classList.add(`${e.prefix}-${e.componentName}--label-${r}`);return{...t,label:{setText(s){return n.textContent=s,this},getText(){return n.textContent||""},getElement(){return n}}}};var Pm=`
|
|
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>`,wn=(e)=>(t)=>{let n=document.createElement("span");n.className=`${e.prefix}-${e.componentName}-track`;let r=document.createElement("span");if(r.className=`${e.prefix}-${e.componentName}-thumb`,n.appendChild(r),e.icon!=="none"){let i=document.createElement("span");i.className=`${e.prefix}-${e.componentName}-thumb-icon`,i.innerHTML=e.icon||Bm,r.appendChild(i)}return t.element.appendChild(n),{...t,track:n,thumb:r}};var tr=(e)=>{let t=new Map;return{on(n,r){return e.addEventListener(n,r),t.set(r,n),this},off(n,r){return e.removeEventListener(n,r),t.delete(r),this},destroy(){t.forEach((n,r)=>{e.removeEventListener(n,r)}),t.clear()},getHandlers(){return new Map(t)}}};var jr=(e)=>(t)=>{let n=tr(e||t.element),r={addListeners(i){return Object.entries(i).forEach(([s,a])=>{n.on(s,a)}),this},removeListeners(i){return Object.entries(i).forEach(([s,a])=>{n.off(s,a)}),this},once(i,s){let a=(o)=>{s(o),n.off(i,a)};return n.on(i,a),this},on(i,s){return n.on(i,s),this},off(i,s){return n.off(i,s),this},destroy(){n.destroy()}};if(pt(t)){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{n.destroy(),i.call(t.lifecycle)}}return{...t,events:r,on:r.on.bind(r),off:r.off.bind(r)}};var Oa=()=>{};var Zt=(e,t,n={})=>{let r=null,i=0,{leading:s=!0,trailing:a=!0}=n;return function(...o){let l=Date.now();if(!i&&!s)i=l;let d=t-(l-i);if(d<=0||d>t){if(r)clearTimeout(r),r=null;i=l,e.apply(this,o)}else if(!r&&a)r=window.setTimeout(()=>{i=s?Date.now():0,r=null,e.apply(this,o)},d)}},Qt=(e,t,n={})=>{let r=null,i=null,s=null,a,o=null,l=0,{leading:d=!1,maxWait:u}=n,f=(m)=>{let p=m-(o||0),h=m-l;return!o||p>=t||p<0||u!==void 0&&h>=u},c=(m)=>{let p=i,h=s;return i=s=null,l=m,a=e.apply(h,p),a},C=(m)=>{if(r=null,i)return c(m);return a},g=(m)=>(l=m,r=window.setTimeout(()=>{C(Date.now())},t),d?c(m):a);return function(...m){let p=Date.now(),h=f(p);if(i=m,s=this,o=p,h){if(r===null)return g(p);if(u!==void 0)r=window.setTimeout(()=>{let b=Date.now();if(f(b))return C(b)},Math.min(t,u-(p-l)))}if(r===null)r=window.setTimeout(()=>{C(Date.now())},t);return a}},nr=(e)=>{let t=!1,n;return function(...r){if(!t)t=!0,n=e.apply(this,r);return n}};var Zr=(e={})=>(t)=>{let n={},r=(a,o,l,d={})=>{if(n[a])i(a);let u=Zt(o,l,d);return t.element.addEventListener(a,u),n[a]={original:o,throttled:u},s},i=(a)=>{let o=n[a];if(o)t.element.removeEventListener(a,o.throttled),delete n[a];return s};if(pt(t)){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{Object.keys(n).forEach((o)=>{let l=n[o];t.element.removeEventListener(o,l.throttled)}),a.call(t.lifecycle)}}if(e.throttledEvents)Object.entries(e.throttledEvents).forEach(([a,o])=>{r(a,o.handler,o.wait,o.options)});let s={...t,addThrottledEvent:r,removeThrottledEvent:i};return s};var Ra=()=>{};function Hm(e){return"lifecycle"in e&&e.lifecycle&&typeof e.lifecycle==="object"&&"destroy"in e.lifecycle&&typeof e.lifecycle.destroy==="function"}var Qr=(e={})=>(t)=>{let n={},r=(a,o,l,d={})=>{if(n[a])i(a);let u=Qt(o,l,d);return t.element.addEventListener(a,u),n[a]={original:o,debounced:u},s},i=(a)=>{let o=n[a];if(o)t.element.removeEventListener(a,o.debounced),delete n[a];return s};if(Hm(t)){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{Object.keys(n).forEach((o)=>{let l=n[o];t.element.removeEventListener(o,l.debounced)}),a.call(t.lifecycle)}}if(e.debouncedEvents)Object.entries(e.debouncedEvents).forEach(([a,o])=>{r(a,o.handler,o.wait,o.options)});let s={...t,addDebouncedEvent:r,removeDebouncedEvent:i};return s};var _a=()=>{};function Jr(e){return"input"in e&&e.input instanceof HTMLElement&&"disabled"in e.input}var de=(e)=>(t)=>{let n=`${t.getClass(e.componentName||t.componentName||"component")}--disabled`,r={enable(){if(t.element.classList.remove(n),Jr(t))t.input.disabled=!1,t.input.removeAttribute("disabled");else{let i=t.element;if("disabled"in i)i.disabled=!1;t.element.removeAttribute("disabled")}return this},disable(){if(t.element.classList.add(n),Jr(t))t.input.disabled=!0,t.input.setAttribute("disabled","true");else{let i=t.element;if("disabled"in i)i.disabled=!0;t.element.setAttribute("disabled","true")}return this},toggle(){if(this.isDisabled())this.enable();else this.disable();return this},isDisabled(){if(Jr(t))return t.input.disabled;let i=t.element;return"disabled"in i&&i.disabled}};if(e.disabled)requestAnimationFrame(()=>{r.disable()});return{...t,disabled:r}};function $m(e){return"events"in e&&e.events&&typeof e.events==="object"&&"destroy"in e.events&&typeof e.events.destroy==="function"}function Vm(e){return"text"in e&&e.text&&typeof e.text==="object"&&"getElement"in e.text&&typeof e.text.getElement==="function"}function Fm(e){return"icon"in e&&e.icon&&typeof e.icon==="object"&&"getElement"in e.icon&&typeof e.icon.getElement==="function"}var P=()=>(e)=>{let t=!1,n=Re();return{...e,lifecycle:{onMount:(i)=>n.on("mount",i),onUnmount:(i)=>n.on("unmount",i),mount:()=>{if(!t)t=!0,n.emit("mount")},unmount:()=>{if(t)t=!1,n.emit("unmount"),n.clear()},isMounted:()=>t,destroy(){if(t)this.unmount();if($m(e))e.events.destroy();if(Vm(e)){let i=e.text.getElement();if(i)i.remove()}if(Fm(e)){let i=e.icon.getElement();if(i)i.remove()}if(e.element)e.element.remove()}}}};var Pa=()=>{};var re=X(()=>{xa();La();Na();Ma();Oa();Ra();_a();Pa()});var se=X(()=>{te();re()});function ei(e,t){Nn[e]=t}function Dn(e){return Nn[e]||{}}function ti(e){Object.assign(Nn,e)}function ni(){Object.keys(Nn).forEach((e)=>{delete Nn[e]})}var Nn;var ri=X(()=>{Nn={}});var _=(e,t={},n)=>{let r=Dn(n),i=t.className!==void 0?t.className:t.class,s=e.className!==void 0?e.className:e.class,a={...e,...r,...t,componentName:n,prefix:K,className:i!==void 0?i:s};if("class"in a&&a.className!==void 0)delete a.class;return a},V=(e,t)=>{let n=e.className||e.class,r=t.className,i=[...Array.isArray(n)?n:[n],...Array.isArray(r)?r:[r]].filter(Boolean),s=t.attributes||{};return{tag:t.tag,componentName:e.componentName,attributes:s,className:i.length>0?i:void 0,rawClass:e.rawClass,id:e.id,name:e.name,title:e.title,tabIndex:e.tabIndex,style:e.style,data:e.data,role:e.role,ariaLabel:e.ariaLabel,ariaDescribedBy:e.ariaDescribedBy,ariaLabelledBy:e.ariaLabelledBy,ariaHidden:e.ariaHidden,html:t.html,text:t.text,forwardEvents:t.forwardEvents||{},interactive:t.interactive}};var ne=X(()=>{nt();ri()});var no=(e)=>{let t=new Map,n=(s,a)=>`${s}_${a.toString()}`,r=(s,a)=>(o)=>{try{s(o)}catch(l){console.error(`Error in ${a} handler:`,l)}},i=(s,a)=>{try{e.removeEventListener(s,a)}catch(o){console.warn(`Failed to remove ${s} listener:`,o)}};return{on(s,a,o={}){let l=r(a,s),d=n(s,a);return t.set(d,{original:a,enhanced:l,event:s,options:o}),e.addEventListener(s,l,o),this},off(s,a){let o=n(s,a),l=t.get(o);if(l)i(s,l.enhanced),t.delete(o);return this},pause(){return t.forEach(({enhanced:s,event:a})=>{i(a,s)}),this},resume(){return t.forEach(({enhanced:s,event:a,options:o})=>{e.addEventListener(a,s,o)}),this},destroy(){t.forEach(({enhanced:s,event:a})=>{i(a,s)}),t.clear()},getHandlers(){return new Map(t)},hasHandler(s,a){let o=n(s,a);return t.has(o)}}};var en=X(()=>{Qe();xn()});var On,it,ro,Ct,be,Et,dt,pe;var Pt=X(()=>{On={LINEAR:"linear",CIRCULAR:"circular"},it={FLAT:"flat",WAVY:"wavy"},ro={CHANGE:"change",COMPLETE:"complete"},Ct={VARIANT:"linear",VALUE:0,MAX:100,BUFFER:0,SHAPE:"flat",SHOW_LABEL:!1,INDETERMINATE:!1},be={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"},Et={LINEAR:{MIN_HEIGHT:4,GAP:4,STOP_INDICATOR:4,HEIGHT:4},CIRCULAR:{SIZE:48,GAP:8},COMMON:{STROKE_WIDTH:4}},dt={THIN:4,THICK:8},pe={LINEAR:{AMPLITUDE:4,SPEED:1,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,FREQUENCY:10,INDETERMINATE_FREQUENCY:16,POWER:0.8,START_TRANSITION_END:0,END_TRANSITION_START:0.92}}});var ii=(e)=>Boolean(e&&typeof e==="object"&&Object.getPrototypeOf(e)===Object.getPrototypeOf({})),si=(e,t)=>{let i=t.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split("."),s=e;for(let a=0,o=i.length;a<o;++a){let l=i[a];if(l in s)s=s[l];else return}return s};var bt=(e,t=17)=>{if(!e||!(e instanceof HTMLElement))return{color:"",element:null};let n=0,r=e;while(r&&n<t){let a=window.getComputedStyle(r).backgroundColor;if(a.startsWith("var(")){let o=a.match(/var\((--[\w-]+)\)/);if(o){let l=o[1];a=window.getComputedStyle(document.documentElement).getPropertyValue(l).trim()||"transparent"}}if(a&&a!=="transparent"&&a!=="rgba(0, 0, 0, 0)"&&a!=="rgba(0,0,0,0)")return{color:a,element:r};r=r.parentElement,n++}let i=window.getComputedStyle(document.body).backgroundColor;if(i!=="transparent"&&i!=="rgba(0, 0, 0, 0)")return{color:i,element:document.body};return{color:"rgb(255, 255, 255)",element:null}};var ai=()=>{};function Te(e,t){let n=`--${K}-${e}`;if(t?.onThemeChange)Jm(t.onThemeChange);let i=getComputedStyle(document.body).getPropertyValue(n).trim();if(!i)i=getComputedStyle(document.documentElement).getPropertyValue(n).trim();if(!i&&t?.fallback)return t.fallback;if(!i)return"";if(typeof t?.alpha==="number"&&/\d+,\s*\d+,\s*\d+/.test(i))return`rgba(${i}, ${t.alpha})`;if(typeof t?.alpha==="number"&&/^#([\da-f]{6}|[\da-f]{3})$/i.test(i)){let s=i.replace("#",""),a,o,l;if(s.length===3)a=parseInt(s[0]+s[0],16),o=parseInt(s[1]+s[1],16),l=parseInt(s[2]+s[2],16);else a=parseInt(s.substring(0,2),16),o=parseInt(s.substring(2,4),16),l=parseInt(s.substring(4,6),16);return`rgba(${a}, ${o}, ${l}, ${t.alpha})`}return i}var ir,vt=null,Qm=()=>{if(vt)return;vt=new MutationObserver((t)=>{for(let n of t)if(n.type==="attributes"&&(n.attributeName==="data-theme"||n.attributeName==="data-theme-mode")){ir.forEach((r)=>r());break}});let e={attributes:!0,attributeFilter:["data-theme","data-theme-mode"]};if(vt.observe(document.documentElement,e),document.body)vt.observe(document.body,e)},Jm=(e)=>{if(!vt)Qm();return ir.add(e),()=>{ir.delete(e)}};var io=X(()=>{nt();ir=new Set;if(typeof window<"u")window.addEventListener("unload",()=>{if(vt)vt.disconnect(),vt=null;ir.clear()})});var Rn=(e,t)=>{let r=document.createElement("canvas").getContext("2d");if(!r)return`rgba(0, 0, 0, ${t})`;r.fillStyle=e;let i=r.fillStyle;if(i.startsWith("#")){let s=i.substring(1),a=parseInt(s.substring(0,2),16),o=parseInt(s.substring(2,4),16),l=parseInt(s.substring(4,6),16);return`rgba(${a}, ${o}, ${l}, ${t})`}if(i.startsWith("rgb")){let s=i.match(/\d+/g);if(s){let[a,o,l]=s;return`rgba(${a}, ${o}, ${l}, ${t})`}}return`rgba(0, 0, 0, ${t})`};var so=(e,t)=>(n,r)=>e(n,r)?t(n,r):n,ao=(...e)=>e.filter(Boolean).join(" ");var kt=X(()=>{In();ai();io()});var _n=(e,t,n)=>{let r=null,i=()=>{if(r)clearTimeout(r);r=window.setTimeout(()=>{n()},100)};if(typeof ResizeObserver<"u"){let s=new ResizeObserver((a)=>{for(let o of a){let{width:l}=o.contentRect,d=parseFloat(t.style.width||"0");if(Math.abs(l-d)>2)i()}});return s.observe(e),()=>{if(r)clearTimeout(r);s.disconnect()}}else return window.addEventListener("resize",i),()=>{if(r)clearTimeout(r);window.removeEventListener("resize",i)}};var oo=(e,t,n,r,i,s,a,o,l)=>{let d=Math.max(100,Math.abs(s-i)*50),u=(s-i)/d,f=pe.CIRCULAR.SPEED*2*Math.PI/1000;e.beginPath();for(let c=0;c<=d;c++){let C=i+u*c,g=C*o+l*f,m=Math.sin(g),h=Math.sign(m)*Math.pow(Math.abs(m),pe.CIRCULAR.POWER)*a,b=r+h,v=t+b*Math.cos(C),E=n+b*Math.sin(C);if(c===0)e.moveTo(v,E);else e.lineTo(v,E)}e.stroke()},lo=(e,t,n,r,i,s=0,a="flat")=>{let{ctx:o,width:l,height:d}=e,u=Pn(t.thickness),f=a==="wavy",c=Math.min(l,d),C=i?pe.CIRCULAR.INDETERMINATE_AMPLITUDE:pe.CIRCULAR.AMPLITUDE,g=c/2-u/2,m=g*(C/100),p=f?Bt(u,m):0,h=g-p,b=l/2,v=d/2;o.clearRect(0,0,l,d);let T=(Et.CIRCULAR.GAP+2*u)/h,S=-Math.PI/2,y=2*Math.PI-T;o.lineWidth=u,o.lineCap="round",o.lineJoin="round";let L=i?pe.CIRCULAR.INDETERMINATE_FREQUENCY:pe.CIRCULAR.FREQUENCY;if(i){let J=s%1333/1333,w=(Oe)=>{let ge=Oe<=0.5?Oe*2:2-Oe*2;return 0.028+0.722*(ge<0.5?2*ge*ge:1-Math.pow(-2*ge+2,2)/2)},G=()=>{let Oe=s/1568*2*Math.PI,ge=Math.floor(s/1333),Ae=s%1333/1333,ke=0;if(Ae>0.5){let ot=(Ae-0.5)*2;ke=0.722*(ot<0.5?2*ot*ot:1-Math.pow(-2*ot+2,2)/2)}return Oe+(ge*0.722+ke)*2*Math.PI},j=w(J)*2*Math.PI,Z=G(),xe=S+Z,ie=xe+j;o.strokeStyle=Te("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"}),o.beginPath();let Ze=T/2;if(o.arc(b,v,h,ie+Ze,xe-Ze+2*Math.PI),o.stroke(),o.strokeStyle=Te("sys-color-primary",{fallback:"#6750A4"}),f)oo(o,b,v,h,xe,ie,p,L,s);else o.beginPath(),o.arc(b,v,h,xe,ie),o.stroke();return}let I=n/r,A=Math.max(I,0.001),N=0.95,R=y;if(I>=N){let Y=(I-N)/(1-N),J=Y*Y;R=y+T*J}if(I<0.99){let J=S+R*A+T/2,w=S+y+T/2;if(J<w)o.strokeStyle=Te("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"}),o.beginPath(),o.arc(b,v,h,J,w),o.stroke()}o.strokeStyle=Te("sys-color-primary",{fallback:"#6750A4"});let U=p;if(f){let Y=pe.CIRCULAR.START_TRANSITION_END,J=pe.CIRCULAR.END_TRANSITION_START;if(I===0&&Y>0)U=0;else if(I>0&&I<=Y){let w=I/Y;U=p*Math.pow(w,2)}else if(I>=J){let w=(I-J)/(1-J),G=1-Math.pow(1-w,2);U=p*(1-G)}if(I>=1)U=0}let H=S,q=S+R*A;if(f)oo(o,b,v,h,H,q,U,L,s);else o.beginPath(),o.arc(b,v,h,H,q),o.stroke()};var uo=X(()=>{Pt();kt();sr()});var kn=(e,t,n)=>{e.strokeStyle=n,e.lineWidth=t,e.lineCap="round"},Tt=(e,t,n,r,i,s,a)=>{if(e.beginPath(),!i||a.amplitude===0)e.moveTo(t,r),e.lineTo(n,r);else{let o=t;for(let l=t;l<=n;l+=1){let d=l*a.frequency+s*a.speed,u=Math.sin(d),f=Math.sign(u)*Math.pow(Math.abs(u),pe.LINEAR.POWER),c=r+f*a.amplitude;if(l===t)e.moveTo(l,c);else e.lineTo(l,c);o=l}if(o<n){let l=n*a.frequency+s*a.speed,d=Math.sin(l),u=Math.sign(d)*Math.pow(Math.abs(d),pe.LINEAR.POWER),f=r+u*a.amplitude;e.lineTo(n,f)}}e.stroke()},co=(e,t)=>{let[n,r,i]=t;if(e<=n)return 0.08+0.5814790000000001*(e/n);else if(e<=r)return 0.661479;else if(i&&e<=i)return 0.661479;return i?0.661479-0.5814790000000001*((e-i)/(1-i)):0.08},mo=(e,t)=>{for(let i=0;i<t.length-1;i++){let[s,a]=t[i],[o,l]=t[i+1];if(e<=o){let d=(e-s)/(o-s);return a+(l-a)*d}}let[n,r]=t[t.length-1];return r+(220-r)*((e-n)/(1-n))},fo=(e,t,n,r,i,s,a=0,o=!0,l="flat")=>{let{ctx:d,width:u,height:f}=e,c=Pn(t.thickness),C=f/2,g=l==="wavy",m=c/2,p=u-m*2,h=Et.LINEAR.GAP,b=n/r,v=0.001,E=Math.max(b,0.001),T=m+p*E;d.clearRect(0,0,u,f);let S=Te("sys-color-primary",{fallback:"#6750A4"}),y=Te("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"});if(s){let q=a%2000/2000,Y=h*2+c/2,J=co(q,[0.3665,0.6915]),w=mo(q,[[0,-120],[0.2,0],[0.5915,83.6714]]),G=q<=0.5?0:co(q,[0.8335,null,0.8335]),j=q<=0.5?-54.8889:mo(q,[[0.5,-54.8889],[0.7,25.0389],[0.85,83.6714]]),xe=[{scale:J,translate:w,start:Math.max(m,m+p*w/100),end:Math.min(u-m,m+p*w/100+p*J)},{scale:G,translate:j,start:Math.max(m,m+p*j/100),end:Math.min(u-m,m+p*j/100+p*G)}].filter((ge)=>ge.end>ge.start).sort((ge,Ae)=>ge.start-Ae.start),ie=[];for(let ge=0;ge<xe.length;ge++){let Ae=xe[ge];if(ie.length===0)ie.push({...Ae});else{let ke=ie[ie.length-1];if(Ae.start<=ke.end+Y)ke.end=Math.max(ke.end,Ae.end);else ie.push({...Ae})}}kn(d,c,y);let Ze=c;if(ie.length===0)Tt(d,m,u-m,C,!1,0,{amplitude:0,frequency:0,speed:0});else{let ge=ie[0].start;if(ge-m>Y+Ze)Tt(d,m,ge-Y,C,!1,0,{amplitude:0,frequency:0,speed:0});if(ie.length===2){if(ie[1].start-ie[0].end>2*Y+Ze)Tt(d,ie[0].end+Y,ie[1].start-Y,C,!1,0,{amplitude:0,frequency:0,speed:0})}let ke=ie[ie.length-1].end;if(u-m-ke>Y+Ze)Tt(d,ke+Y,u-m,C,!1,0,{amplitude:0,frequency:0,speed:0})}kn(d,c,S);let Oe={amplitude:g?Bt(c,pe.LINEAR.INDETERMINATE_AMPLITUDE):0,frequency:pe.LINEAR.INDETERMINATE_FREQUENCY*2*Math.PI/100,speed:0};ie.forEach((ge)=>{Tt(d,ge.start,ge.end,C,g,a,Oe)});return}let L=pe.LINEAR.START_TRANSITION_END,I=pe.LINEAR.END_TRANSITION_START,x=(h+c)/2;kn(d,c,y);let A=b===0?m+c+h:Math.min(T+x,u-m);Tt(d,A,u-m,C,!1,0,{amplitude:0,frequency:0,speed:0}),kn(d,c,S);let N=b>=1?u-m:Math.max(m,T-x),R;if(b===0)R=m+(g?0.1:0);else{let H=c/2;R=Math.max(m+H,N)}let U=g?Bt(c,pe.LINEAR.AMPLITUDE):0;if(g){if(b===0&&L>0)U=0;else if(E<=L)U*=Math.pow(E/L,2);else if(E>=I)U*=Math.pow((1-E)/(1-I),2)}if(Tt(d,m,R,C,g,a,{amplitude:U,frequency:pe.LINEAR.FREQUENCY*2*Math.PI/100,speed:pe.LINEAR.SPEED*2*Math.PI/1000}),i>0&&i>n){kn(d,c,Te("sys-color-secondary-container",{fallback:"#E8DEF8"}));let H=m+p*(i/r);Tt(d,T,H,C,!1,0,{amplitude:0,frequency:0,speed:0})}if(b<1&&o){let H=Math.min(c*0.5,2);d.beginPath(),d.arc(u-m,C,H,0,2*Math.PI),d.fillStyle=S,d.fill()}};var go=X(()=>{Pt();kt();sr()});var Pn=(e="thin")=>{if(typeof e==="number")return e;return e==="thick"?dt.THICK:dt.THIN},Bt=(e,t,n)=>{let i=1+0.3*(4-e)/(e+4),s=t*i;return n?Math.min(s,n):s},oi=(e,t,n,r)=>{let i=window.devicePixelRatio||1,s=Pn(r?.thickness),{ctx:a}=t;if(n){let o=Math.max(24,Math.min(r?.size??Et.CIRCULAR.SIZE,240)),l=0;if(r?.shape==="wavy"){let u=o/2-s/2,f=r?.indeterminate?pe.CIRCULAR.INDETERMINATE_AMPLITUDE:pe.CIRCULAR.AMPLITUDE,c=u*(f/100);l=Bt(s,c)}let d=o+l*2;e.style.width=e.style.height=`${d}px`,e.width=e.height=Math.round(d*i),t.width=t.height=d}else{let o=e.parentElement;if(!o)return;let l=Math.max(o.getBoundingClientRect().width||o.offsetWidth,200),d=0;if(r?.shape==="wavy"){let f=pe.LINEAR.AMPLITUDE,c=Bt(s,f);d=Math.ceil(c*2)}let u=s+d;e.style.width=`${l}px`,e.style.height=`${u}px`,e.width=Math.round(l*i),e.height=Math.round(u*i),t.width=l,t.height=u}a.setTransform(1,0,0,1,0,0),a.scale(i,i)},po=(e,t,n)=>{let r={canvas:e,ctx:e.getContext("2d"),width:0,height:0,pixelRatio:window.devicePixelRatio||1};return oi(e,r,t,n),r},ho=(e)=>(t)=>{let r=e.variant===On.CIRCULAR,i=document.createElement("canvas");i.className=`${t.getClass(be.CONTAINER)}-canvas`,i.style.maxWidth="100%",i.style.maxHeight="100%",i.style.boxSizing="border-box",t.element.appendChild(i);let s=null,a=null,o=null,l=e.thickness,d=e.shape,u=e.size??Et.CIRCULAR.SIZE,f=e.value??0,c=f,C=0,g=()=>{try{return s=po(i,r,{...e,thickness:l,shape:d,size:u}),t.ctx=s.ctx,!0}catch(L){return console.warn("Canvas initialization failed:",L),!1}};if(!g())requestAnimationFrame(()=>{if(!g())setTimeout(g,100)});t.canvas=i,t.animationTime=0,t.animationId=null,t.wavyAnimationId=null,t.valueAnimationId=null,t.currentShape=d;let m=(L=0)=>{if(!t.state?.indeterminate)return;if(t.animationId)cancelAnimationFrame(t.animationId),t.animationId=null;let I=0,x=(A)=>{if(!t.state?.indeterminate){p();return}if(I===0)I=A-L;let N=A-I;t.animationTime=N,v(N),t.animationId=requestAnimationFrame(x)};t.animationId=requestAnimationFrame(x)},p=()=>{if(t.animationId)cancelAnimationFrame(t.animationId),t.animationId=null},h=(L=0)=>{if(t.wavyAnimationId)cancelAnimationFrame(t.wavyAnimationId),t.wavyAnimationId=null;let I=0,x=(A)=>{if(I===0)I=A-L;let N=A-I;t.animationTime=N,v(N),t.wavyAnimationId=requestAnimationFrame(x)};t.wavyAnimationId=requestAnimationFrame(x)},b=()=>{if(t.wavyAnimationId)cancelAnimationFrame(t.wavyAnimationId),t.wavyAnimationId=null},v=(L=0)=>{if(!s)return;let I=t.state,x=I?.value??e.value??0,A=I?.max??e.max??100,N=I?.buffer??e.buffer??0,R=I?.indeterminate??e.indeterminate??!1,U={...e,thickness:l,shape:d,size:u};oi(i,s,r,U);let H=R||!I?x:f;if(r)lo(s,U,H,A,R,L,d);else fo(s,U,H,A,N,R,L,!0,d)},E=()=>{if(!s)return;try{let L=po(i,r,{...e,thickness:l,shape:d,size:u});t.ctx=L.ctx,Object.assign(s,L),v()}catch(L){console.warn("Canvas resize failed:",L)}};a=_n(t.element,i,()=>{if(t.element.offsetWidth>0||r)E()});let T=Te("sys-color-primary",{onThemeChange:v});o=typeof T==="function"?T:null;let S=()=>{if(!s){requestAnimationFrame(S);return}if(v(),t.state?.indeterminate)if(d==="wavy"||!r)h();else m();else if(d==="wavy")h()};requestAnimationFrame(S);let y=(L)=>{if(!s)return;let I={...e,thickness:l,shape:d,size:u,...L};oi(i,s,r,I),v()};if(t.setThickness=(L)=>{l=L,y({thickness:L})},t.setSize=(L)=>{if(!r)return;u=Math.max(24,Math.min(L,240)),y({size:u})},t.getSize=()=>r?u:void 0,t.setShape=(L)=>{if(d===L)return;if(d=L,t.currentShape=d,y({shape:L}),t.state?.indeterminate){let I=t.animationTime||0;if(b(),p(),L==="wavy"||!r)h(I);else m(I)}else if(L==="wavy"){if(!t.wavyAnimationId)h()}else b();v(t.animationTime||0)},t.setValue=(L,I=!0)=>{if(c=Math.max(0,Math.min(t.state.max,L)),t.state.indeterminate)t.setIndeterminate(!1);if(t.valueAnimationId&&I)return;if(t.valueAnimationId)cancelAnimationFrame(t.valueAnimationId),t.valueAnimationId=null;if(!I){if(f=c,v(),d==="wavy"&&!t.state.indeterminate&&!t.wavyAnimationId)h();if(c>=t.state.max)t.element.dispatchEvent(new CustomEvent("complete",{detail:{value:c,max:t.state.max}}));return}let x=f,A=performance.now(),N=A-C,R=300;if(N<300&&C>0)R=Math.max(100,N*0.9);C=A;let U=(H)=>{let q=H-A,Y=Math.min(q/R,1),J=Y<0.5?4*Y*Y*Y:1-Math.pow(-2*Y+2,3)/2;if(f=x+(c-x)*J,!t.wavyAnimationId||d!=="wavy")v(H);if(Y<1)t.valueAnimationId=requestAnimationFrame(U);else{if(f=c,t.valueAnimationId=null,d==="wavy"&&!t.state.indeterminate&&!t.wavyAnimationId)h();if(c>=t.state.max)t.element.dispatchEvent(new CustomEvent("complete",{detail:{value:c,max:t.state.max}}))}};t.valueAnimationId=requestAnimationFrame(U)},t.setIndeterminate=(L)=>{if(!t.state){console.warn("[Progress] No state available for setIndeterminate");return}if(t.state.indeterminate=L,L){if(t.valueAnimationId)cancelAnimationFrame(t.valueAnimationId),t.valueAnimationId=null;if(f=t.state.value,d==="wavy"||!r)h();else m()}else{if(f=t.state.value,p(),d==="wavy"){if(!t.wavyAnimationId)h()}else b();v()}},t.hide=()=>{t.element.classList.add(t.getClass(be.TRANSITION)),t.element.style.opacity="0";let L=()=>{t.element.style.display="none",t.element.removeEventListener("transitionend",L)};return t.element.addEventListener("transitionend",L),[t.animationId,t.wavyAnimationId,t.valueAnimationId].forEach((I)=>{if(I)cancelAnimationFrame(I)}),t.animationId=t.wavyAnimationId=t.valueAnimationId=null,t},t.show=()=>{if(t.element.classList.add(t.getClass(be.TRANSITION)),t.element.style.display="",t.element.style.opacity="0",t.element.offsetHeight,t.element.style.opacity="1",t.state?.indeterminate)if(d==="wavy"||!r)h();else m();else if(d==="wavy")h();return t},t.isVisible=()=>t.element.style.display!=="none"&&t.element.style.opacity!=="0",t.lifecycle){let L=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{if(a)a();if(o)o();[t.animationId,t.wavyAnimationId,t.valueAnimationId].forEach((I)=>{if(I)cancelAnimationFrame(I)}),L()}}return Object.assign(t,{startWavyAnimation:h,stopWavyAnimation:b,startIndeterminateAnimation:m,stopIndeterminateAnimation:p}),{...t,canvas:i,get ctx(){return s?.ctx},draw:v,resize:E}};var sr=X(()=>{Pt();kt();uo();go()});var Co=(e)=>(t)=>{if(e.indeterminate&&t.element)ee(t.element,be.INDETERMINATE),t.element.removeAttribute("aria-valuenow");if(t.element){let s=t.getClass?.(be.CONTAINER)||"";t.element.classList.remove(`${s}--thin`,`${s}--thick`)}if(e.shape&&e.shape!==it.FLAT&&t.element){if(!t.element.classList.contains(t.getClass?.(be.CIRCULAR)||"")){let a=t.getClass?.(be.CONTAINER)||"";ee(t.element,`${a}--${e.shape}`)}}let n={value:e.value??0,max:e.max??100,buffer:e.buffer??0,indeterminate:e.indeterminate===!0,thickness:e.thickness??"thin",shape:e.shape??it.FLAT,labelFormatter:e.labelFormatter??((s,a)=>`${Math.round(s/a*100)}%`),showLabel:e.showLabel},r=t.lifecycle?.init,i=t.lifecycle?.destroy;return t.state=n,t.lifecycle={init:()=>{if(requestAnimationFrame(()=>{try{if(n.indeterminate)t.setIndeterminate?.(!0);else if(t.setValue?.(n.value),e.buffer!==void 0)t.setBuffer?.(n.buffer);if(n.shape!==it.FLAT&&t.setShape)t.setShape(n.shape);if(n.thickness)if(t.setThickness)t.setThickness(n.thickness);else t.state.thickness=n.thickness}catch(s){console.error("Error initializing progress state:",s)}}),r)r()},destroy:()=>{if(i)i()}},{...t,state:n}};var Eo=X(()=>{Pt();en()});var bo=(e)=>(t)=>{let{element:n,getClass:r,canvas:i}=t,s=n.classList.contains(r(be.CIRCULAR)),a=(u,f)=>{n.dispatchEvent(new CustomEvent(u,{detail:f}))},o=(u,f)=>{n.setAttribute("aria-valuenow",u.toString());let c=t.label;if(c){let C=e.label?.formatter||((g,m)=>`${Math.round(g/m*100)}%`);c.textContent=C(u,f)}if(typeof t.draw==="function")t.draw()},l=(u)=>{if(u){if(ee(n,be.INDETERMINATE),n.removeAttribute("aria-valuenow"),!s){if((e.shape?.getShape()||it.FLAT)!=="wavy"&&t.startIndeterminateAnimation)t.startIndeterminateAnimation()}}else if(Ce(n,be.INDETERMINATE),t.stopIndeterminateAnimation)t.stopIndeterminateAnimation();if(typeof t.draw==="function")t.draw()};if(e.state.isIndeterminate())l(!0);let d={element:n,track:i,indicator:i,buffer:i,getClass:r,getValue(){return e.value.getValue()},setValue(u,f=!0){let c=e.value.getValue(),C=e.value.getMax();if(e.value.setValue(u),c!==u){n.setAttribute("aria-valuenow",u.toString());let g=t.label;if(g){let p=e.label?.formatter||((h,b)=>`${Math.round(h/b*100)}%`);g.textContent=p(u,C)}let m={value:u,max:C};if(a(ro.CHANGE,m),t.setValue&&typeof t.setValue==="function")t.setValue(u,f);else o(u,C)}return d},getMax(){return e.value.getMax()},getBuffer:()=>e.buffer.getBuffer(),setBuffer(u){if(e.buffer.setBuffer(u),!e.state.isIndeterminate()&&typeof t.draw==="function")t.draw();return d},setIndeterminate(u){if(e.state.isIndeterminate()===u)return d;return e.state.setIndeterminate(u),l(u),d},isIndeterminate:()=>e.state.isIndeterminate(),showLabel(){if(e.label?.show)e.label.show();return d},hideLabel(){if(e.label?.hide)e.label.hide();return d},setLabelFormatter(u){if(e.label?.format)e.label.format(u);let f=t.label||t.state?.label;if(f)f.textContent=u(e.value.getValue(),e.value.getMax());return d},getThickness(){return e.thickness?.getThickness()||dt.THIN},setThickness(u){if(e.thickness)e.thickness.setThickness(u);if(t.setThickness)t.setThickness(u);return d},getShape(){if(e.shape&&typeof e.shape.getShape==="function")return e.shape.getShape();return it.FLAT},setShape(u){return t.setShape?.(u),d},setSize(u){if(t.setSize)t.setSize(u);return d},getSize(){return t.getSize?t.getSize():void 0},enable(){return e.disabled.enable(),d},disable(){return e.disabled.disable(),d},isDisabled:e.disabled.isDisabled,hide(){if(t.hide)t.hide();return d},show(){if(t.show)t.show();return d},isVisible(){return t.isVisible?t.isVisible():n.style.display!=="none"},on(u,f){return n.addEventListener(u,f),d},off(u,f){return n.removeEventListener(u,f),d},addClass(...u){return u.forEach((f)=>n.classList.add(f)),d},painted(){return new Promise((u)=>requestAnimationFrame(()=>requestAnimationFrame(()=>u())))},destroy(){e.lifecycle.destroy()},disabled:{enable(){e.disabled.enable()},disable(){e.disabled.disable()},isDisabled:e.disabled.isDisabled},lifecycle:{destroy(){e.lifecycle.destroy()}}};if(t.state?.showLabel===!0){if(e.label?.show)e.label.show()}return d};var vo=X(()=>{Pt();en()});var ef,To=(e={})=>_(ef,e,"progress"),So=(e)=>{let t=e.indeterminate===!0,n=e.variant===On.CIRCULAR,r={role:"progressbar","aria-valuemin":"0","aria-valuemax":(e.max||100).toString()};if(!t&&e.value!==void 0)r["aria-valuenow"]=e.value.toString();if(e.disabled===!0)r["aria-disabled"]="true";let i=[e.class,be.CONTAINER,n?be.CIRCULAR:be.LINEAR].filter(Boolean);if(!n&&e.shape&&e.shape!==it.FLAT)i.push(`${be.CONTAINER}--${e.shape}`);return V(e,{tag:"div",attributes:r,className:i})},yo=(e)=>{if(!e.state)e.state={value:0,max:100,buffer:0,indeterminate:!1,thickness:"thin",shape:Ct.SHAPE,labelFormatter:(t,n)=>`${Math.round(t/n*100)}%`};return{value:{getValue:()=>e.state.value,setValue:(t)=>{if(e.state){let n=Math.max(0,Math.min(e.state.max,t));if(e.state.previousValue=e.state.value,e.state.value=n,e.state.label)e.state.label.textContent=e.state.labelFormatter(n,e.state.max);if(typeof e.setValue==="function")e.setValue(n);else if(e.draw)e.draw()}},getMax:()=>e.state.max},buffer:{getBuffer:()=>e.state.buffer,setBuffer:(t)=>{e.state.buffer=Math.max(0,Math.min(e.state.max,t))}},disabled:{enable:()=>e.disabled?.enable?.()||void 0,disable:()=>e.disabled?.disable?.()||void 0,isDisabled:()=>e.disabled?.isDisabled?.()||!1},label:{show:()=>{if(!e.state.label){let t=document.createElement("div");t.className=`${e.getClass(be.LABEL)}`,t.textContent=e.state.labelFormatter(e.state.value,e.state.max),e.element.appendChild(t),e.state.label=t,e.label=t}},hide:()=>{if(e.state.label)e.state.label.remove(),e.state.label=void 0,e.label=void 0},format:(t)=>{e.state.labelFormatter=t},formatter:e.state.labelFormatter},thickness:{getThickness:()=>{let t=e.state.thickness;if(t==="thin")return dt.THIN;else if(t==="thick")return dt.THICK;else if(typeof t==="number")return t;return dt.THIN},setThickness:(t)=>{if(e.state.thickness=t,e.draw)e.draw()}},shape:{getShape:()=>e.state.shape,setShape:(t)=>{if(e.state.shape=t,e.setShape)e.setShape(t)}},state:{setIndeterminate:(t)=>{if(e.state){if(e.state.indeterminate=t,typeof e.setIndeterminate==="function")e.setIndeterminate(t);else if(e.draw)e.draw()}},isIndeterminate:()=>e.state.indeterminate},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()||void 0}}};var xo=X(()=>{ne();Pt();ef={variant:Ct.VARIANT,value:Ct.VALUE,max:Ct.MAX,buffer:Ct.BUFFER,showLabel:Ct.SHOW_LABEL,thickness:"thin",shape:Ct.SHAPE}});var Io={};Wr(Io,{default:()=>ar});var tf=(e={})=>{let t=To(e);try{let n=M(D,k(),O(So(t)),oe(t),de(t),Co(t),ho(t),(r)=>bo(yo(r))(r),P())(t);if(n.lifecycle?.init)n.lifecycle.init();return n}catch(n){throw console.error("Progress creation error:",n),Error(`Failed to create progress: ${n.message}`)}},ar;var li=X(()=>{se();te();re();sr();Eo();vo();xo();ar=tf});var nf=async(e)=>{let{default:t}=await Promise.resolve().then(() => (li(),Io));return t(e)},Lo=(e)=>(t)=>{if(!e.progress)return t;let n={},r=typeof e.progress==="boolean"?{variant:"circular",size:20,thickness:2,indeterminate:!0}:(()=>{let{on:u,...f}=e.progress;if(u)n=u;return{variant:"circular",size:20,thickness:2,indeterminate:!0,...f}})(),i=null,s=null,a=!1,o="",l=async()=>{if(i)return i;if(!s)s=nf(r).then((u)=>(i=u,ee(i.element,t.getClass("button-progress")),i.element.style.display="none",Object.entries(n).forEach(([f,c])=>{i.on(f,c)}),t.progress=i,i));return s},d=()=>{let u=t.element.querySelector(`.${t.getClass("button-icon")}`);if(u&&u.nextSibling)return u.nextSibling;return t.element.firstChild};if(t.showProgress=async function(){let u=await l();if(u.element){if(!t.element.contains(u.element)){let c=d();if(c)t.element.insertBefore(u.element,c);else t.element.appendChild(u.element)}u.element.style.display="",ee(t.element,`${t.getClass("button")}--progress`);let f=t.element.querySelector(`.${t.getClass("button-icon")}`);if(f instanceof HTMLElement)f.style.display="none"}return t},t.showProgressSync=function(){return t.showProgress(),t},t.hideProgress=async function(){if(!i)return t;i.element.style.display="none",Ce(t.element,`${t.getClass("button")}--progress`);let u=t.element.querySelector(`.${t.getClass("button-icon")}`);if(u instanceof HTMLElement)u.style.display="";return t},t.hideProgressSync=function(){return t.hideProgress(),t},t.setProgress=async function(u){return(await l()).setValue(u),t},t.setProgressSync=function(u){return t.setProgress(u),t},t.setIndeterminate=async function(u){return(await l()).setIndeterminate(u),t},t.setIndeterminateSync=function(u){return t.setIndeterminate(u),t},t.setLoading=async function(u,f){if(u&&!a){if(t.setText&&t.getText)o=t.getText();if(a=!0,await t.showProgress(),t.disabled?.disable)t.disabled.disable();if(f&&t.setText)t.setText(f)}else if(!u&&a){if(a=!1,await t.hideProgress(),t.disabled?.enable)t.disabled.enable();if(f&&t.setText)t.setText(f);else if(o&&t.setText)t.setText(o)}return t},t.setLoadingSync=function(u,f){return t.setLoading(u,f),t},t.lifecycle){let u=t.lifecycle.destroy;t.lifecycle.destroy=()=>{if(i)i.destroy();if(i&&i.element.parentNode)i.element.parentNode.removeChild(i.element);u()}}if(e.showProgress)l().then(()=>{t.showProgress()});return t};var Ao=X(()=>{en()});var wo=(e)=>(t)=>{if(!e.toggle)return t;let{element:n}=t,r=t.getClass("button"),i=!1,s=(a)=>{i=a,n.classList.toggle(`${r}--selected`,a),n.setAttribute("aria-pressed",String(a))};if(n.classList.add(`${r}--toggle`),s(e.selected===!0),e.toggleOnClick!==!1)n.addEventListener("click",()=>{if(n.disabled)return;s(!i),t.emit?.("change",{selected:i})});return{...t,toggle:{setSelected:(a)=>{if(a!==i)s(a)},isSelected:()=>i}}};var No=(e={},t={})=>{let n={...e},r=Re(),i=new Map,s=t.middleware||[],a=(l,d)=>{r.emit("change",l,d)},o=(l,d)=>s.reduce((u,f)=>f(u,d),l);return{getState:()=>{let l={};return i.forEach((d,u)=>{l[u]=d(n)}),{...n,...l}},setState:(l)=>{let d={...n},u=typeof l==="function"?l(n):{...n,...l};n=o(u,d),a(n,d)},subscribe:(l)=>r.on("change",l),derive:(l,d)=>(i.set(l,d),()=>{i.delete(l)}),select:(l)=>l(n),reset:()=>{n={...e},a(n,{})}}},Do=(e,t)=>(console.log("State change:",{old:t,new:e,diff:Object.keys(e).reduce((n,r)=>{if(e[r]!==t[r])n[r]={from:t[r],to:e[r]};return n},{})}),e),Mo=(e)=>(t)=>Object.keys(t).reduce((n,r)=>{if(e(t[r],r))n[r]=t[r];return n},{});var Oo=()=>{};var Ro=(e,t={})=>{let n=!1,r=Re();return{onMount:(i)=>r.on("mount",i),onUnmount:(i)=>r.on("unmount",i),mount:()=>{if(!n)n=!0,r.emit("mount")},unmount:()=>{if(n)n=!1,r.emit("unmount"),r.clear()},isMounted:()=>n,destroy(){if(n)this.unmount();if(t.events)t.events.destroy();if(t.text){let i=t.text.getElement();if(i)i.remove()}if(t.icon){let i=t.icon.getElement();if(i)i.remove()}if(e)e.remove()}}};var _o=()=>{};var Po=(e)=>({enable(){return e.disabled=!1,e.removeAttribute("disabled"),this},disable(){return e.disabled=!0,e.setAttribute("disabled","true"),this},toggle(){if(e.disabled)this.enable();else this.disable();return this},isDisabled(){return e.disabled===!0}});var di=(e,t,n,r,i,s)=>{if(r<0||i<0)return;let a=typeof s==="number"?[s,s,s,s]:s,[o,l,d,u]=a;e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-l,n),e.quadraticCurveTo(t+r,n,t+r,n+l),e.lineTo(t+r,n+i-d),e.quadraticCurveTo(t+r,n+i,t+r-d,n+i),e.lineTo(t+u,n+i),e.quadraticCurveTo(t,n+i,t,n+i-u),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath()},rf=(e,t,n,r,i,s,a)=>{if(e.save(),a)e.fillStyle=a;di(e,t,n,r,i,s),e.fill(),e.restore()},ui=(e,t,n,r,i,s)=>(e.save(),di(e,t,n,r,i,s),e.clip(),()=>e.restore()),ci=(e,t,n,r,i,s,a,o)=>{if(r<0||i<0)return;if(e.save(),o)e.fillStyle=o;e.beginPath(),e.moveTo(t+s,n),e.lineTo(t+r-a,n),e.quadraticCurveTo(t+r,n,t+r,n+a),e.lineTo(t+r,n+i-a),e.quadraticCurveTo(t+r,n+i,t+r-a,n+i),e.lineTo(t+s,n+i),e.quadraticCurveTo(t,n+i,t,n+i-s),e.lineTo(t,n+s),e.quadraticCurveTo(t,n,t+s,n),e.closePath(),e.fill(),e.restore()},mi=(e,t,n,r)=>{if(r)e.fillStyle=r,e.fillRect(0,0,t,n);else e.clearRect(0,0,t,n)};var or=(e)=>{let s=e;for(let f=0;f<4;f++){let m=s*s,h=1.6*(m*s)+-1.8000000000000003*m+1.2000000000000002*s-e,b=4.800000000000001*m+-3.6000000000000005*s+1.2000000000000002;if(Math.abs(h)<0.00001)break;s=s-h/b}let a=0,o=3-a,l=1-a-o,d=s*s,u=d*s;return l*u+o*d+a*s},fi,sf;var ko=X(()=>{fi={SHORT:100,MEDIUM:225,LONG:375,EXTRA_LONG:500},sf={linear:(e)=>e,easeIn:(e)=>e*e,easeOut:(e)=>e*(2-e),easeInOut:(e)=>e<0.5?2*e*e:-1+(4-2*e)*e,materialStandard:or}});class Bo{animationId=null;start(e){this.stop();let t=(n)=>{e(n),this.animationId=requestAnimationFrame(t)};this.animationId=requestAnimationFrame(t)}stop(){if(this.animationId!==null)cancelAnimationFrame(this.animationId),this.animationId=null}get isRunning(){return this.animationId!==null}}class Ho{cleanupFunctions=[];add(e){if(e)this.cleanupFunctions.push(e)}cleanup(){this.cleanupFunctions.forEach((e)=>e()),this.cleanupFunctions=[]}}var gi=(e,t,n)=>{let r=window.devicePixelRatio||1,i=e.getContext("2d");return e.style.width=`${t}px`,e.style.height=`${n}px`,e.width=Math.round(t*r),e.height=Math.round(n*r),i.setTransform(1,0,0,1,0,0),i.scale(r,r),{canvas:e,ctx:i,width:t,height:n,pixelRatio:r}},pi=(e,t,n)=>{let{canvas:r,ctx:i,pixelRatio:s}=e;r.style.width=`${t}px`,r.style.height=`${n}px`,r.width=Math.round(t*s),r.height=Math.round(n*s),e.width=t,e.height=n,i.setTransform(1,0,0,1,0,0),i.scale(s,s)},hi=(e,t)=>{if(e())return t?.(),!0;return requestAnimationFrame(()=>{if(e())t?.();else setTimeout(()=>{if(e())t?.()},100)}),!1},lr=(e,t)=>{let n=Te(`sys-color-${e}`,{onThemeChange:t});return typeof n==="function"?n:null},Ci=(e,t={})=>{let n=document.createElement("canvas");return n.className=e,Object.assign(n.style,{position:"absolute",width:"100%",height:"100%",pointerEvents:"none",...t}),n};var $o=X(()=>{kt()});var dr=X(()=>{ko();$o()});var tn=X(()=>{ne();Oo();_o();nt();ri();kt();se();en();dr();dr()});var Vo=({disabled:e,lifecycle:t})=>(n)=>{let r={setText:(a)=>(n.text.setText(a),r),getText:()=>n.text.getText(),getElement:()=>n.text.getElement()},i={setIcon:(a)=>(n.icon.setIcon(a),i),getIcon:()=>n.icon.getIcon(),getElement:()=>n.icon.getElement()},s={element:n.element,text:r,icon:i,disabled:e,lifecycle:t,getClass:n.getClass,on:(a,o)=>{if(n.on)n.on(a,o);return s},off:(a,o)=>{if(n.off)n.off(a,o);return s},addClass:(...a)=>{if(n.addClass)n.addClass(...a);else ee(n.element,...a);return s},getValue:()=>n.element.value,setValue(a){return n.element.value=a,s},enable(){return e.enable(),s},disable(){return e.disable(),s},setText(a){return n.text.setText(a),s},getText(){return n.text.getText()},hasIcon(){let a=n.icon.getElement();return!!a&&!!a.innerHTML.trim()&&!!a.parentNode},setIcon(a){let o=n.componentName||"button",l=n.getClass(o);if(!a){let d=n.icon.getElement();if(d&&d.parentNode)d.parentNode.removeChild(d),n.icon.getElement=()=>null,n.icon.getIcon=()=>"";n.element.classList.remove(`${l}--icon`)}else if(!s.hasIcon()){let d=document.createElement("span");if(d.className=`${n.getClass("button-icon")}`,d.innerHTML=a,n.element.firstChild)n.element.insertBefore(d,n.element.firstChild);else n.element.appendChild(d);n.icon.getElement=()=>d,n.icon.getIcon=()=>a,n.element.classList.add(`${l}--icon`)}else{let d=n.icon.getElement();if(d)d.innerHTML=a}return s},getIcon(){return s.hasIcon()?n.icon.getIcon():""},setVariant(a){let o=n.componentName||"button",l=n.getClass(o);return["filled","tonal","outlined","elevated","text"].map((u)=>`${l}--${u}`).forEach((u)=>{n.element.classList.remove(u)}),n.element.classList.add(`${l}--${a}`),s},getVariant(){let a=n.componentName||"button",o=n.getClass(a),l=["filled","tonal","outlined","elevated","text"];for(let d of l)if(n.element.classList.contains(`${o}--${d}`))return d;return"filled"},getSize(){let a=n.componentName||"button",o=n.getClass(a),l=["xs","s","m","l","xl"];for(let d of l)if(n.element.classList.contains(`${o}--${d}`))return d;return"s"},setSize(a){let o=n.componentName||"button",l=n.getClass(o);return["xs","s","m","l","xl"].map((u)=>`${l}--${u}`).forEach((u)=>{n.element.classList.remove(u)}),n.element.classList.add(`${l}--${a}`),s},getShape(){let a=n.componentName||"button",o=n.getClass(a),l=["round","square"];for(let d of l)if(n.element.classList.contains(`${o}--${d}`))return d;return"round"},setShape(a){let o=n.componentName||"button",l=n.getClass(o);return["round","square"].map((u)=>`${l}--${u}`).forEach((u)=>{n.element.classList.remove(u)}),n.element.classList.add(`${l}--${a}`),s},setActive(a){if(a)n.element.classList.add(`${n.getClass("button")}--active`);else n.element.classList.remove(`${n.getClass("button")}--active`);return s},setSelected(a){return n.toggle?.setSelected(a),s},isSelected:()=>n.toggle?.isSelected()??!1,setAriaLabel(a){return n.element.setAttribute("aria-label",a),s},destroy(){t.destroy()}};if(n.progress)s.progress=n.progress;if(n.showProgress)s.showProgress=async()=>(await n.showProgress(),s);if(n.showProgressSync)s.showProgressSync=()=>(n.showProgressSync(),s);if(n.hideProgress)s.hideProgress=async()=>(await n.hideProgress(),s);if(n.hideProgressSync)s.hideProgressSync=()=>(n.hideProgressSync(),s);if(n.setProgress)s.setProgress=async(a)=>(await n.setProgress(a),s);if(n.setProgressSync)s.setProgressSync=(a)=>(n.setProgressSync(a),s);if(n.setIndeterminate)s.setIndeterminate=async(a)=>(await n.setIndeterminate(a),s);if(n.setIndeterminateSync)s.setIndeterminateSync=(a)=>(n.setIndeterminateSync(a),s);if(n.setLoading)s.setLoading=async(a,o)=>(await n.setLoading(a,o),s);if(n.setLoadingSync)s.setLoadingSync=(a,o)=>(n.setLoadingSync(a,o),s);return s};var Fo=X(()=>{tn()});var Uo,Go,zo,Wo,ur;var Ko=X(()=>{Uo={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",ELEVATED:"elevated",TEXT:"text"},Go={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},zo={ROUND:"round",SQUARE:"square"},Wo={BUTTON:"button",SUBMIT:"submit",RESET:"reset"},ur={DURATION:450,TIMING:"cubic-bezier(0.4, 0.0, 0.2, 1)",OPACITY:["0.7","0"]}});var af,Yo=(e={})=>_(af,e,"button"),Xo=(e)=>{let t={type:e.type||"button"};if(e.disabled===!0)t.disabled=!0;if(e.value!==void 0)t.value=e.value;if(e.ariaLabel)t["aria-label"]=e.ariaLabel;return V(e,{tag:"button",attributes:t,className:e.class,forwardEvents:{click:(n)=>!n.element.disabled,focus:!0,blur:!0}})},qo=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable(),isDisabled:()=>e.disabled.isDisabled()},lifecycle:{destroy:()=>e.lifecycle.destroy()}});var jo=X(()=>{ne();Ko();af={variant:Uo.FILLED,size:Go.S,shape:zo.ROUND,disabled:!1,type:Wo.BUTTON,ripple:!0,rippleConfig:{duration:ur.DURATION,timing:ur.TIMING,opacity:ur.OPACITY}}});var of=(e={})=>{let t=Yo(e);try{return M(D,k(),O(Xo(t)),oe(t),Ot(t),lt(t),Be(t),de(t),wo(t),Lo(t),we(t),P(),(r)=>{if(t.shape&&r.element){let i=`${t.prefix}-${t.componentName}--${t.shape}`;r.element.classList.add(i)}return r},(r)=>Vo(qo(r))(r))(t)}catch(n){throw console.error("Button creation error:",n),Error(`Failed to create button: ${n.message}`)}},We;var Zo=X(()=>{se();te();re();Ao();Fo();jo();We=of});var Qo={};Wr(Qo,{default:()=>We});var Ht=X(()=>{Zo()});var zp={};Wr(zp,{ANIMATION_DURATIONS:()=>fi,AnimationFrameManager:()=>Bo,COMPONENTS:()=>Kr,CleanupManager:()=>Ho,EASING_FUNCTIONS:()=>sf,PREFIX:()=>K,STATES:()=>Yr,addClass:()=>ee,batchAttributes:()=>ma,byString:()=>si,classNames:()=>Ea,clearCanvas:()=>mi,clearGlobalDefaults:()=>ni,clipRoundedRect:()=>ui,compose:()=>la,createBadge:()=>Mn,createBase:()=>D,createBottomAppBar:()=>to,createButton:()=>We,createButtonGroup:()=>bi,createCanvasContext:()=>gi,createCanvasThemeObserver:()=>lr,createCard:()=>vi,createCardActions:()=>Bn,createCardContent:()=>mr,createCardHeader:()=>fr,createCardMedia:()=>Hn,createCarousel:()=>Oi,createCheckbox:()=>_i,createChip:()=>sn,createChips:()=>$i,createComponent:()=>ua,createComponentConfig:()=>_,createDatePicker:()=>Fi,createDialog:()=>Ui,createDisabled:()=>Po,createDivider:()=>Vt,createDrawer:()=>Ki,createElement:()=>B,createElementConfig:()=>V,createEmitter:()=>Re,createEventManager:()=>no,createExtendedFab:()=>Mr,createFab:()=>Dr,createIconButton:()=>nn,createLifecycle:()=>Ro,createList:()=>qi,createMenu:()=>Un,createNavigation:()=>cn,createNavigationSystem:()=>Hu,createProgress:()=>ar,createRadios:()=>ss,createRoundedRectPath:()=>di,createSVGElement:()=>Ta,createSearch:()=>ms,createSegment:()=>kr,createSegmentedButton:()=>Br,createSelect:()=>Is,createSheet:()=>_s,createSlider:()=>Gs,createSnackbar:()=>zs,createStateEventManager:()=>tr,createStore:()=>No,createStyledCanvas:()=>Ci,createSwitch:()=>Ks,createTab:()=>bn,createTabs:()=>tm,createTextfield:()=>Gn,createTimePicker:()=>Xs,createTooltip:()=>qs,createTopAppBar:()=>mm,debounce:()=>Qt,deriveFiltered:()=>Mo,easeOutCubic:()=>or,fillRoundedRect:()=>rf,fillRoundedRectLR:()=>ci,getAttribute:()=>ga,getComponentClass:()=>pa,getComponentDefaults:()=>Dn,getElementClass:()=>Ca,getInheritedBackground:()=>bt,getModifierClass:()=>ha,hasAttribute:()=>fa,hasClass:()=>rt,hasEmit:()=>ht,hasLifecycle:()=>pt,hasTouchSupport:()=>ze,initializeCanvasWithRetry:()=>hi,isObject:()=>ii,joinClasses:()=>ao,loggingMiddleware:()=>Do,normalizeClasses:()=>qt,normalizeEvent:()=>Je,observeCanvasResize:()=>_n,once:()=>nr,pipe:()=>M,removeAttributes:()=>ca,removeClass:()=>Ce,setAttributes:()=>yn,setComponentDefaults:()=>ei,setGlobalDefaults:()=>ti,throttle:()=>Zt,toggleClass:()=>Jn,transform:()=>da,updateCanvasDimensions:()=>pi,when:()=>so,withCheckable:()=>_t,withDebounce:()=>Qr,withDisabled:()=>de,withElement:()=>O,withEnhancedEvents:()=>jr,withEvents:()=>k,withIcon:()=>Be,withInput:()=>Rt,withLifecycle:()=>P,withPosition:()=>Ln,withRipple:()=>we,withSize:()=>Ot,withStyle:()=>qr,withText:()=>lt,withTextInput:()=>An,withTextLabel:()=>et,withThrottle:()=>Zr,withTrack:()=>wn,withVariant:()=>oe});module.exports=Lm(zp);se();te();re();ne();var ka={SMALL:"small",LARGE:"large"},Ba={ERROR:"error",PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",SUCCESS:"success",WARNING:"warning",INFO:"info"},Ha={TOP_RIGHT:"top-right",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left"},rr=4;var Gm={variant:ka.LARGE,color:Ba.ERROR,position:Ha.TOP_RIGHT,label:"",visible:!0},$a=(e={})=>_(Gm,e,"badge"),Va=(e)=>{let t={};if(e.variant!=="small")t.role="status";let n=e.variant==="small"?"":Jt(e.label||"",e.max);return V(e,{tag:"span",attributes:t,className:e.class,text:n})},Fa=(e)=>({visibility:{show:()=>e.visibility.show(),hide:()=>e.visibility.hide(),toggle:(t)=>e.visibility.toggle(t),isVisible:()=>e.visibility.isVisible()},lifecycle:{destroy:()=>e.lifecycle.destroy()}}),Jt=(e,t)=>{if(e===void 0||e===null||e==="")return"";let n=String(e),r=Number(e);if(t!==void 0&&!isNaN(r)&&r>t)n=`${t}+`;if(n.length>rr){let i=Number(e);if(!isNaN(i))if(i>=1000)n="999+";else n=n.substring(0,rr-1)+"+";else n=n.substring(0,rr)}return n};var Ua="small",zm="large",Wm="error",Km="top-right",Ga=()=>(e)=>{if(e.config.visible===!1)e.element.classList.add(`${e.getClass("badge")}--invisible`);return{...e,visibility:{show(){e.element.classList.remove(`${e.getClass("badge")}--invisible`)},hide(){e.element.classList.add(`${e.getClass("badge")}--invisible`)},toggle(n){if(n===void 0)e.element.classList.toggle(`${e.getClass("badge")}--invisible`);else if(n)this.show();else this.hide()},isVisible(){return!e.element.classList.contains(`${e.getClass("badge")}--invisible`)}}}},za=(e)=>(t)=>{let n=e.variant||zm;if(t.element.classList.add(`${t.getClass("badge")}--${n}`),n===Ua)t.element.textContent="",t.element.setAttribute("aria-hidden","true");else if(t.element.setAttribute("role","status"),e.label!==void 0&&e.label!==""){let r=Jt(e.label,e.max);t.element.textContent=r}return t},Wa=(e)=>(t)=>{let n=e.color||Wm;return t.element.classList.add(`${t.getClass("badge")}--${n}`),t},Ka=(e)=>(t)=>{let n=e.position||Km;if(t.element.classList.add(`${t.getClass("badge")}--${n}`),e.target)t.element.classList.add(`${t.getClass("badge")}--positioned`);return t},Ya=(e)=>(t)=>{if(e.max===void 0||e.variant===Ua)return t;if(t.config.max=e.max,e.label!==void 0&&e.label!==""){let n=Jt(e.label,e.max);if(t.element.textContent=n,typeof e.label==="number"&&e.label>e.max)t.element.classList.add(`${t.getClass("badge")}--overflow`)}return t},Xa=(e)=>(t)=>{if(!e.target)return t;let n=document.createElement("div");n.classList.add(t.getClass("badge-wrapper")),n.style.position="relative";let r=e.target.parentNode;if(r)r.replaceChild(n,e.target),n.appendChild(e.target),n.appendChild(t.element),t.wrapper=n;return t};var qa="small",Ym=["error","primary","secondary","tertiary","success","warning","info"],Xm=["small","large"],qm=["top-right","top-left","bottom-right","bottom-left"],ja=({visibility:e,lifecycle:t})=>(n)=>{let r={element:n.element,wrapper:n.wrapper,getClass:n.getClass,setLabel(i){if(n.config.label=i,n.config.variant===qa)return n.element.textContent="",r;let s=Jt(i,n.config.max);if(n.element.textContent=s,n.element.classList.remove(`${n.getClass("badge")}--overflow`),typeof i==="number"&&n.config.max!==void 0&&i>n.config.max)n.element.classList.add(`${n.getClass("badge")}--overflow`);if(s===""||s==="0")r.hide();else r.show();return r},getLabel(){return n.element.textContent||""},setContent(i){return r.setLabel(i)},getContent(){return r.getLabel()},show(){return e.show(),r},hide(){return e.hide(),r},toggle(i){return e.toggle(i),r},isVisible(){return e.isVisible()},setMax(i){if(n.config.max=i,n.config.label!==void 0)r.setLabel(n.config.label);return r},setColor(i){return Ym.forEach((s)=>{n.element.classList.remove(`${n.getClass("badge")}--${s}`)}),n.element.classList.add(`${n.getClass("badge")}--${i}`),r},setVariant(i){if(Xm.forEach((s)=>{n.element.classList.remove(`${n.getClass("badge")}--${s}`)}),n.element.classList.add(`${n.getClass("badge")}--${i}`),n.config.variant=i,i===qa)n.element.textContent="",n.element.setAttribute("aria-hidden","true");else if(n.element.setAttribute("role","status"),n.config.label!==void 0)r.setLabel(n.config.label);return r},setPosition(i){return qm.forEach((s)=>{n.element.classList.remove(`${n.getClass("badge")}--${s}`)}),n.element.classList.add(`${n.getClass("badge")}--${i}`),r},attachTo(i){if(n.wrapper&&n.wrapper.contains(n.element))n.wrapper.removeChild(n.element);let s=document.createElement("div");s.classList.add(n.getClass("badge-wrapper")),s.style.position="relative";let a=i.parentNode;if(a)a.replaceChild(s,i),s.appendChild(i),s.appendChild(n.element),n.element.classList.add(`${n.getClass("badge")}--positioned`),n.wrapper=s,r.wrapper=s;return r},detach(){if(n.wrapper&&n.wrapper.contains(n.element))n.wrapper.removeChild(n.element),n.element.classList.remove(`${n.getClass("badge")}--positioned`),document.body.appendChild(n.element),n.wrapper=void 0,r.wrapper=void 0;return r},destroy(){if(t.destroy(),n.wrapper){let i=n.wrapper.firstChild,s=n.wrapper.parentNode;if(s&&i)s.replaceChild(i,n.wrapper)}},addClass:(...i)=>(n.addClass(...i),r),removeClass:(...i)=>(n.removeClass(...i),r),on:(i,s)=>(n.on(i,s),r),off:(i,s)=>(n.off(i,s),r)};return r};var jm=(e={})=>{let t=$a(e);try{return M(D,k(),O(Va(t)),za(t),Wa(t),Ka(t),Ya(t),Ga(),Xa(t),P(),(r)=>ja(Fa(r))(r))(t)}catch(n){throw console.error("Badge creation error:",n),Error(`Failed to create badge: ${n.message}`)}},Mn=jm;se();ne();var Za={CENTER:"center",END:"end"},Qa=300;var Zm={tag:"div",hasFab:!1,fabPosition:Za.END,autoHide:!1,transitionDuration:Qa},Ja=(e={})=>_(Zm,e,"bottom-app-bar");var eo=(e={})=>{let t=Ja(e),n=D(t),r=document.createElement("div");r.className=`${n.getClass("bottom-app-bar")}-actions`;let i=document.createElement("div");i.className=`${n.getClass("bottom-app-bar")}-fab-container`;let s=O({tag:t.tag,componentName:"bottom-app-bar",className:[t.hasFab?`${n.getClass("bottom-app-bar")}--with-fab`:"",t.fabPosition==="center"?`${n.getClass("bottom-app-bar")}--fab-center`:"",t.class],attributes:{role:"toolbar","aria-label":"Bottom app bar"},interactive:!0})(n),a=k()(s),o=P()(a);o.element.appendChild(r),o.element.appendChild(i);let l=!0,d=window.scrollY;if(t.autoHide){let f=()=>{let C=window.scrollY;if(C>d+10){if(l)u.hide(),t.onVisibilityChange?.(!1)}else if(C<d-10){if(!l)u.show(),t.onVisibilityChange?.(!0)}d=C};window.addEventListener("scroll",f,{passive:!0});let c=o.lifecycle.destroy;o.lifecycle.destroy=()=>{window.removeEventListener("scroll",f),c()}}let u={...o,addAction(f){return r.appendChild(f),this},addFab(f){return i.innerHTML="",i.appendChild(f),this.element.classList.add(`${n.getClass("bottom-app-bar")}--with-fab`),this},show(){return this.element.classList.remove(`${n.getClass("bottom-app-bar")}--hidden`),l=!0,this},hide(){return this.element.classList.add(`${n.getClass("bottom-app-bar")}--hidden`),l=!1,this},isVisible(){return l},getActionsContainer(){return r}};if(t.autoHide&&t.transitionDuration)u.element.style.transition=`transform ${t.transitionDuration}ms ease-in-out`;return u};var to=eo;Ht();te();re();se();te();re();var Jo=(e)=>(t)=>{if(!e.toggle)return{...t,toggleState:{select:function(){return this},deselect:function(){return this},toggle:function(){return this},isSelected:()=>!1,isToggle:()=>!1,setIcon:function(){return this},setSelectedIcon:function(){return this},getSelectedIcon:()=>""}};let n=e.prefix||"mtrl",r=e.componentName||"icon-button",i=`${n}-${r}--selected`,s=e.selected||!1,a=e.icon||"",o=e.selectedIcon||"",l=()=>{if(!t.icon)return;let g=s&&o?o:a;if(g)t.icon.setIcon(g)},d=()=>{t.element.setAttribute("aria-pressed",String(s))},u={select(){if(!s)s=!0,t.element.classList.add(i),l(),d();return this},deselect(){if(s)s=!1,t.element.classList.remove(i),l(),d();return this},toggle(){if(s)this.deselect();else this.select();return this},isSelected(){return s},isToggle(){return!0},setIcon(g){if(a=g,!s)l();return this},setSelectedIcon(g){if(o=g,s)l();return this},getSelectedIcon(){return o}};if(s)t.element.classList.add(i),d(),l();else d();let f=e.toggleOnClick!==!1,c=()=>{u.toggle();let g=new CustomEvent("toggle",{bubbles:!0,detail:{selected:s}});t.element.dispatchEvent(g)};if(f)t.element.addEventListener("click",c);let C=t.lifecycle?.destroy;if(t.lifecycle)t.lifecycle.destroy=()=>{if(f)t.element.removeEventListener("click",c);if(C)C()};return{...t,toggleState:u}};var el=({disabled:e,lifecycle:t,toggleState:n})=>(r)=>{let i=r.componentName||"icon-button",s=r.getClass(i),a={setIcon:(l)=>(r.icon.setIcon(l),a),getIcon:()=>r.icon.getIcon(),getElement:()=>r.icon.getElement()},o={element:r.element,icon:a,disabled:{enable:()=>e.enable(),disable:()=>e.disable(),isDisabled:()=>e.isDisabled()},lifecycle:{destroy:()=>t.destroy()},getClass:r.getClass,getValue:()=>r.element.value,setValue(l){return r.element.value=l,o},getVariant(){let l=["filled","tonal","outlined","standard"];for(let d of l)if(r.element.classList.contains(`${s}--${d}`))return d;return"standard"},setVariant(l){return["filled","tonal","outlined","standard"].forEach((u)=>{r.element.classList.remove(`${s}--${u}`)}),r.element.classList.add(`${s}--${l}`),o},getSize(){let l=["xs","s","m","l","xl"];for(let d of l)if(r.element.classList.contains(`${s}--${d}`))return d;return"s"},setSize(l){if(["xs","s","m","l","xl"].forEach((u)=>{r.element.classList.remove(`${s}--${u}`)}),l!=="s")r.element.classList.add(`${s}--${l}`);return o},getShape(){let l=["round","square"];for(let d of l)if(r.element.classList.contains(`${s}--${d}`))return d;return"round"},setShape(l){if(["round","square"].forEach((u)=>{r.element.classList.remove(`${s}--${u}`)}),l!=="round")r.element.classList.add(`${s}--${l}`);return o},getWidth(){let l=["narrow","default","wide"];for(let d of l)if(r.element.classList.contains(`${s}--${d}`))return d;return"default"},setWidth(l){if(["narrow","default","wide"].forEach((u)=>{r.element.classList.remove(`${s}--${u}`)}),l!=="default")r.element.classList.add(`${s}--${l}`);return o},enable(){return e.enable(),o},disable(){return e.disable(),o},setIcon(l){if(n?.isToggle()&&!n.isSelected())n.setIcon(l);return r.icon.setIcon(l),o},getIcon(){return r.icon.getIcon()},setSelectedIcon(l){if(n)n.setSelectedIcon(l);return o},getSelectedIcon(){return n?.getSelectedIcon()||""},isToggle(){return n?.isToggle()||!1},select(){if(n)n.select();return o},deselect(){if(n)n.deselect();return o},toggleSelected(){if(n)n.toggle();return o},isSelected(){return n?.isSelected()||!1},setAriaLabel(l){return r.element.setAttribute("aria-label",l),o},destroy(){t.destroy()},on(l,d){if(r.on)r.on(l,d);else r.element.addEventListener(l,d);return o},off(l,d){if(r.off)r.off(l,d);else r.element.removeEventListener(l,d);return o},addClass(...l){if(r.addClass)r.addClass(...l);else l.forEach((d)=>r.element.classList.add(d));return o},removeClass(...l){if(r.removeClass)r.removeClass(...l);else l.forEach((d)=>r.element.classList.remove(d));return o}};return o};ne();var tl={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",STANDARD:"standard"},nl={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},rl={ROUND:"round",SQUARE:"square"},il={NARROW:"narrow",DEFAULT:"default",WIDE:"wide"},sl={BUTTON:"button",SUBMIT:"submit",RESET:"reset"};var cr={DURATION:450,TIMING:"cubic-bezier(0.4, 0.0, 0.2, 1)",OPACITY:["0.7","0"]};var lf={variant:tl.STANDARD,size:nl.S,shape:rl.ROUND,width:il.DEFAULT,disabled:!1,type:sl.BUTTON,toggle:!1,selected:!1,ripple:!0,tooltip:!0,rippleConfig:{duration:cr.DURATION,timing:cr.TIMING,opacity:cr.OPACITY}},al=(e={})=>_(lf,e,"icon-button"),ol=(e)=>{let t={type:e.type||"button"};if(e.ariaLabel)t["aria-label"]=e.ariaLabel;if(e.toggle)t["aria-pressed"]=e.selected?"true":"false";if(e.disabled===!0)t.disabled=!0;if(e.value!==void 0)t.value=e.value;let n=[];if(e.size&&e.size!=="s")n.push(`icon-button--${e.size}`);if(e.shape&&e.shape!=="round")n.push(`icon-button--${e.shape}`);if(e.width&&e.width!=="default")n.push(`icon-button--${e.width}`);if(e.toggle)n.push("icon-button--toggle");if(e.toggle&&e.selected)n.push("icon-button--selected");if(e.disabled===!0)n.push("icon-button--disabled");let r=e.className||e.class,i=[...n,...Array.isArray(r)?r:r?[r]:[]],s={...e,className:i};return V(s,{tag:"button",attributes:t,forwardEvents:{click:(a)=>!a.element.disabled,focus:!0,blur:!0},interactive:!0})},ll=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable(),isDisabled:()=>e.disabled.isDisabled()},lifecycle:{destroy:()=>e.lifecycle.destroy()},toggleState:e.toggleState});var df=(e={})=>{let t=al(e);try{return M(D,k(),O(ol(t)),oe(t),Ot(t),Be(t),de(t),Jo(t),we(t),P(),(r)=>{if(t.shape&&t.shape!=="round"&&r.element){let i=`${t.prefix}-${t.componentName}--${t.shape}`;r.element.classList.add(i)}return r},(r)=>{if(t.width&&t.width!=="default"&&r.element){let i=`${t.prefix}-${t.componentName}--${t.width}`;r.element.classList.add(i)}return r},(r)=>el(ll(r))(r))(t)}catch(n){throw console.error("IconButton creation error:",n),Error(`Failed to create icon button: ${n.message}`)}},nn=df;Ht();ne();var uf={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",ELEVATED:"elevated",TEXT:"text"},cf={HORIZONTAL:"horizontal",VERTICAL:"vertical"},tt={DEFAULT:"default",COMFORTABLE:"comfortable",COMPACT:"compact"};var mf={STANDARD:"standard",CONNECTED:"connected"},ff={NONE:"none",SINGLE:"single",MULTI:"multi"},gf={ROUND:"round",SQUARE:"square"},pf={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},Ei={xs:{height:32,icon:20,standardGap:18,connectedCorner:4},s:{height:40,icon:20,standardGap:12,connectedCorner:8},m:{height:56,icon:24,standardGap:8,connectedCorner:8},l:{height:96,icon:32,standardGap:8,connectedCorner:16},xl:{height:136,icon:40,standardGap:8,connectedCorner:20}},dl=2,ul=4;var cl=0.15,ml=4,hf={ALWAYS:"always",SELECTED:"selected"},ue={KIND:mf.STANDARD,SELECTION:ff.NONE,SHAPE:gf.ROUND,SIZE:pf.S,LABELS:hf.ALWAYS,VARIANT:uf.OUTLINED,ORIENTATION:cf.HORIZONTAL,DENSITY:tt.DEFAULT,RIPPLE:!0,EQUAL_WIDTH:!1,RIPPLE_DURATION:300,RIPPLE_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",RIPPLE_OPACITY:["0.2","0"]};var Cf={kind:ue.KIND,selection:ue.SELECTION,shape:ue.SHAPE,size:ue.SIZE,required:!1,variant:ue.VARIANT,orientation:ue.ORIENTATION,density:ue.DENSITY,ripple:ue.RIPPLE,equalWidth:ue.EQUAL_WIDTH,disabled:!1,buttons:[]},fl=(e={})=>_(Cf,e,"button-group"),gl=(e)=>{let t=e.variant||ue.VARIANT,n=e.orientation||ue.ORIENTATION,r=e.density||ue.DENSITY,i=e.kind||ue.KIND,s=e.selection||ue.SELECTION,a=e.labels||ue.LABELS,o=e.shape||ue.SHAPE,l=e.size||ue.SIZE;return{tag:"div",componentName:"button-group",attributes:{role:"group","aria-label":e.ariaLabel||"Button group","data-variant":t,"data-orientation":n,"data-density":r,"data-kind":i,"data-selection":s,"data-shape":o,"data-size":l,"data-labels":a},className:[e.class,a==="selected"?`${e.prefix}-button-group--labels-selected`:null,e.disabled?`${e.prefix}-button-group--disabled`:null,`${e.prefix}-button-group--${n}`,`${e.prefix}-button-group--${t}`,`${e.prefix}-button-group--${i}`,`${e.prefix}-button-group--${o}`,`${e.prefix}-button-group--size-${l}`,s!=="none"?`${e.prefix}-button-group--selectable`:null,r!==tt.DEFAULT?`${e.prefix}-button-group--density-${r}`:null,e.equalWidth?`${e.prefix}-button-group--equal-width`:null],interactive:!0}},Ef={[tt.DEFAULT]:0,[tt.COMFORTABLE]:1,[tt.COMPACT]:2},pl=(e,t,n=tt.DEFAULT)=>{let r=Ei[e||ue.SIZE]||Ei.s,i=t==="connected"?dl:r.standardGap,s=r.height-ml*(Ef[n]??0);return{"--button-group-height":`${s}px`,"--button-group-icon":`${r.icon}px`,"--button-group-gap":`${i}px`,"--button-group-inner-corner":`${r.connectedCorner}px`,"--button-group-pressed-corner":`${ul}px`,"--button-group-radius":`${s/2}px`}},hl=(e,t,n,r)=>{let i=t===0,s=t===n-1,a=n===1,o="";if(a)o=`${r.prefix}-button-group__button--single`;else if(i)o=`${r.prefix}-button-group__button--first`;else if(s)o=`${r.prefix}-button-group__button--last`;else o=`${r.prefix}-button-group__button--middle`;return{...e,variant:r.variant,size:r.size||ue.SIZE,shape:r.shape||ue.SHAPE,disabled:r.disabled||e.disabled,ripple:r.ripple,rippleConfig:r.rippleConfig,class:[`${r.prefix}-button-group__button`,o,e.class].filter(Boolean).join(" ")}};var bf=(e={})=>{let t=fl(e),n=Re(),r=t.variant||ue.VARIANT,i=t.orientation||ue.ORIENTATION,s=t.density||ue.DENSITY,a=t.kind||ue.KIND,o=t.selection||ue.SELECTION,l=Boolean(t.required),d=new Set;try{let u=M(D,k(),O(gl(t)),P())(t),f=(x)=>{Object.entries(pl(t.size,a,x)).forEach(([A,N])=>{u.element.style.setProperty(A,N)})};f(s);let c=[],C=t.buttons||[],g=C.length,m=(x)=>{let A=x._groupConfig;return String(A?.value??A?.id??x._groupIndex)},p=(x,A)=>{let N=`${t.prefix}-button-group__button--selected`;x.element.classList.toggle(N,A),x.element.setAttribute("aria-pressed",String(A));let R=x.toggleState;if(R?.isToggle?.())if(A)R.select();else R.deselect();else x.setSelected?.(A)},h=t.expandedRatio??cl,b=()=>{c.forEach((x)=>{x.element.style.width="",x.element.style.paddingLeft="",x.element.style.paddingRight=""}),document.removeEventListener("pointerup",b),document.removeEventListener("pointercancel",b)},v=(x)=>{if(a!=="standard"||h<=0||i!=="horizontal")return;let A=c.map((G)=>G.element.getBoundingClientRect().width);if(!A[x])return;let N=u.element.ownerDocument.defaultView,R=(G,j)=>N?parseFloat(N.getComputedStyle(c[G].element)[j])||0:0,U=c[x-1]?x-1:-1,H=c[x+1]?x+1:-1,q=U>=0&&H>=0,Y=h*A[x]/(q?2:1),J=0,w=(G,j)=>{let Z=Math.min(Y,R(G,j),A[G]);if(Z<=0)return;c[G].element.style.width=`${A[G]-Z}px`,c[G].element.style[j]=`${R(G,j)-Z}px`,J+=Z};if(U>=0)w(U,"paddingRight");if(H>=0)w(H,"paddingLeft");c[x].element.style.width=`${A[x]+J}px`,document.addEventListener("pointerup",b),document.addEventListener("pointercancel",b)},E=(x,A)=>{let N=c.filter((U)=>d.has(m(U))),R={buttonGroup:I,values:N.map(m),selected:N,button:x,originalEvent:A};n.emit("change",R)},T=(x,A,N,R)=>{if(o==="none")return!1;let U=c.find((H)=>m(H)===x);if(!U)return!1;if(A===d.has(x))return!1;if(!A&&l&&d.size===1)return!1;if(A&&o==="single")for(let H of c){let q=m(H);if(q!==x&&d.has(q))d.delete(q),p(H,!1)}if(A)d.add(x);else d.delete(x);return p(U,A),E(N??U,R),!0};if(C.forEach((x,A)=>{let N=hl(x,A,g,t),R=o!=="none",H=Boolean(x.icon)&&!x.text?nn({...N,toggle:R,toggleOnClick:!1,selectedIcon:x.selectedIcon,variant:N.variant==="text"?"standard":N.variant}):We({...N,toggle:R,toggleOnClick:!1});if(H._groupConfig=x,H._groupIndex=A,R)H.element.setAttribute("aria-pressed","false");H.element.addEventListener("pointerdown",()=>{if(!H.disabled?.isDisabled())v(A)}),H.on("click",(q)=>{if(!H.disabled?.isDisabled()){let Y={buttonGroup:I,button:H,index:A,originalEvent:q};if(n.emit("click",Y),o!=="none"){let J=m(H),w=d.has(J);if(o==="single"){if(!w)T(J,!0,H,q);else if(!l)T(J,!1,H,q)}else T(J,!w,H,q)}}}),H.on("focus",(q)=>{let Y={buttonGroup:I,button:H,index:A,originalEvent:q};n.emit("focus",Y)}),H.on("blur",(q)=>{let Y={buttonGroup:I,button:H,index:A,originalEvent:q};n.emit("blur",Y)}),u.element.appendChild(H.element),c.push(H)}),o!=="none")c.forEach((x)=>{if(x._groupConfig?.selected&&(o==="multi"||d.size===0))d.add(m(x)),p(x,!0)});let S=(x)=>{["filled","tonal","outlined","elevated","text"].forEach((N)=>{u.element.classList.remove(`${t.prefix}-button-group--${N}`)}),u.element.classList.add(`${t.prefix}-button-group--${x}`),u.element.setAttribute("data-variant",x),c.forEach((N)=>{N.setVariant(x)}),r=x},y=(x)=>{u.element.classList.remove(`${t.prefix}-button-group--horizontal`,`${t.prefix}-button-group--vertical`),u.element.classList.add(`${t.prefix}-button-group--${x}`),u.element.setAttribute("data-orientation",x),i=x},L=(x)=>{if(Object.values(tt).forEach((A)=>{if(A!==tt.DEFAULT)u.element.classList.remove(`${t.prefix}-button-group--density-${A}`)}),x!==tt.DEFAULT)u.element.classList.add(`${t.prefix}-button-group--density-${x}`);u.element.setAttribute("data-density",x),f(x),s=x},I={element:u.element,buttons:c,getButton(x){return c[x]},getButtonById(x){return c.find((A)=>{let N=A._groupConfig;return N?.id===x||N?.value===x})},getVariant(){return r},setVariant(x){return S(x),this},getOrientation(){return i},setOrientation(x){return y(x),this},getDensity(){return s},setDensity(x){return L(x),this},enable(){return u.element.classList.remove(`${t.prefix}-button-group--disabled`),c.forEach((x)=>{if(!x._groupConfig?.disabled)x.enable()}),this},disable(){return u.element.classList.add(`${t.prefix}-button-group--disabled`),c.forEach((x)=>{x.disable()}),this},enableButton(x){let A=c[x];if(A)A.enable();return this},getSelected(){return c.filter((x)=>d.has(m(x))).map(m)},isSelected(x){return d.has(x)},select(x){return T(x,!0),this},deselect(x){return T(x,!1),this},toggle(x){return T(x,!d.has(x)),this},getKind(){return a},getSelection(){return o},disableButton(x){let A=c[x];if(A)A.disable();return this},on(x,A){return n.on(x,A),this},off(x,A){return n.off(x,A),this},destroy(){b(),c.forEach((x)=>{x.destroy()}),c.length=0,n.clear(),u.lifecycle.destroy()}};return I}catch(u){throw console.error("Button Group creation error:",u),Error(`Failed to create button group: ${u.message}`)}},bi=bf;se();te();re();var Cl=({lifecycle:e})=>(t)=>({...t,element:t.element,addContent(n){if(n&&n.classList.contains(`${t.getClass("card")}-content`))t.element.appendChild(n);return this},setHeader(n){if(n&&n.classList.contains(`${t.getClass("card")}-header`)){let r=t.element.querySelector(`.${t.getClass("card")}-header`);if(r)r.remove();if(t.element.querySelector(`.${t.getClass("card")}-media`)){let s=t.element.querySelectorAll(`.${t.getClass("card")}-media`),a=s[s.length-1];if(a.nextSibling)t.element.insertBefore(n,a.nextSibling);else t.element.appendChild(n)}else t.element.insertBefore(n,t.element.firstChild)}return this},addMedia(n,r="top"){if(n&&n.classList.contains(`${t.getClass("card")}-media`))if(r==="top")t.element.insertBefore(n,t.element.firstChild);else t.element.appendChild(n);return this},setActions(n){if(n&&n.classList.contains(`${t.getClass("card")}-actions`)){let r=t.element.querySelector(`.${t.getClass("card")}-actions`);if(r)r.remove();t.element.appendChild(n)}return this},makeDraggable(n){if(t.element.setAttribute("draggable","true"),t.element.setAttribute("aria-grabbed","false"),typeof n==="function")t.element.addEventListener("dragstart",(r)=>{t.element.setAttribute("aria-grabbed","true"),n(r)}),t.element.addEventListener("dragend",()=>{t.element.setAttribute("aria-grabbed","false")});return this},focus(){return t.element.focus(),this},destroy(){e.destroy()}});ne();nt();se();te();Qe();var mr=(e={})=>{let t={...e,componentName:"card-content",prefix:K};try{let n=M(D,O({tag:"div",componentName:"card-content",className:[e.class,e.padding===!1?`${K}-card-content--no-padding`:null],attributes:{role:"region",style:"display: block; color: inherit;"}}))(t);if(e.html)n.element.innerHTML=e.html;else if(e.text)n.element.innerHTML=`<p>${e.text}</p>`;if(Array.isArray(e.children))e.children.forEach((r)=>{if(r instanceof HTMLElement)n.element.appendChild(r)});return n.element.classList.add("debug-content"),n.element}catch(n){throw console.error("Card content creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create card content: ${n instanceof Error?n.message:String(n)}`)}},fr=(e={})=>{let t={...e,componentName:"card-header",prefix:K};try{let n=M(D,O({tag:"div",componentName:"card-header",className:e.class,attributes:{role:"heading","aria-level":"3"}}))(t),r=B({tag:"div",className:`${K}-card-header-text`,container:n.element});if(e.title){B({tag:"h3",className:`${K}-card-header-title`,text:e.title,container:r,attributes:{id:`${n.element.id||"card-header"}-title`}});let i=n.element.closest(`.${K}-card`);if(i&&!i.hasAttribute("aria-labelledby"))i.setAttribute("aria-labelledby",`${n.element.id||"card-header"}-title`)}if(e.subtitle)B({tag:"h4",className:`${K}-card-header-subtitle`,text:e.subtitle,container:r});if(e.avatar){let i=typeof e.avatar==="string"?B({tag:"div",className:`${K}-card-header-avatar`,html:e.avatar}):e.avatar,s=i.querySelector("img");if(s&&!s.hasAttribute("alt"))s.setAttribute("alt",""),s.setAttribute("aria-hidden","true");n.element.insertBefore(i,n.element.firstChild)}if(e.action){let i=typeof e.action==="string"?B({tag:"div",className:`${K}-card-header-action`,html:e.action}):e.action;n.element.appendChild(i)}return n.element}catch(n){throw console.error("Card header creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create card header: ${n instanceof Error?n.message:String(n)}`)}},Bn=(e={})=>{let t={...e,componentName:"card-actions",prefix:K};try{let n=M(D,O({tag:"div",componentName:"card-actions",className:[e.class,e.fullBleed?`${K}-card-actions--full-bleed`:null,e.vertical?`${K}-card-actions--vertical`:null,e.align?`${K}-card-actions--${e.align}`:null],attributes:{role:"group"}}))(t);if(Array.isArray(e.actions))e.actions.forEach((r,i)=>{if(r instanceof HTMLElement){if(!r.hasAttribute("aria-label")&&!r.hasAttribute("aria-labelledby")&&r.textContent?.trim()==="")r.setAttribute("aria-label",`Action ${i+1}`);n.element.appendChild(r)}});return n.element}catch(n){throw console.error("Card actions creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create card actions: ${n instanceof Error?n.message:String(n)}`)}},Hn=(e={})=>{let t={...e,componentName:"card-media",prefix:K};try{let n=M(D,O({tag:"div",componentName:"card-media",className:[e.class,e.aspectRatio?`${K}-card-media--${e.aspectRatio.replace(":","-")}`:null,e.contain?`${K}-card-media--contain`:null]}))(t);if(e.element instanceof HTMLElement)n.element.appendChild(e.element);else if(e.src){let r=document.createElement("img");if(r.src=e.src,r.className=`${K}-card-media-img`,r.alt=e.alt||"",!e.alt)r.setAttribute("aria-hidden","true");n.element.appendChild(r)}return n.element}catch(n){throw console.error("Card media creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create card media: ${n instanceof Error?n.message:String(n)}`)}};var gr={ELEVATED:"elevated",FILLED:"filled",OUTLINED:"outlined"},El={LEVEL0:0,LEVEL1:1,LEVEL2:2,LEVEL4:4};var Tf={variant:gr.ELEVATED,interactive:!1,fullWidth:!1,clickable:!1,draggable:!1},bl=(e)=>{let t={...e};if(e.header)t.headerConfig=e.header;if(e.content)t.contentConfig=e.content;if(e.media)t.mediaConfig=e.media;if(e.actions)t.actionsConfig=e.actions;return t},vl=(e,t)=>{if(t.mediaConfig&&(!t.mediaConfig.position||t.mediaConfig.position==="top")){let n=Hn({...t.mediaConfig,position:void 0});e.addMedia(n,"top")}if(t.headerConfig){let n=fr(t.headerConfig);e.setHeader(n)}if(t.contentConfig){let n=mr(t.contentConfig);e.addContent(n)}if(t.mediaConfig&&t.mediaConfig.position==="bottom"){let n=Hn({...t.mediaConfig,position:void 0});e.addMedia(n,"bottom")}if(t.actionsConfig){let n=Bn(t.actionsConfig);e.setActions(n)}if(Array.isArray(t.buttons)&&t.buttons.length>0)Promise.resolve().then(() => (Ht(),Qo)).then(({default:n})=>{let r=t.buttons.map((s)=>n(s).element),i=Bn({actions:r,align:t.actionsConfig?.align||"end"});e.setActions(i)}).catch((n)=>{console.error("Error processing buttons:",n)})},Tl=(e={})=>_(Tf,e,"card"),Sl=(e)=>{let t=e.interactive||e.clickable,n=t?"button":"region",r={};if(e.aria)Object.entries(e.aria).forEach(([i,s])=>{if(s!==void 0){let a=i.startsWith("aria-")?i:`aria-${i}`;r[a]=s}});if(!r.role&&!e.aria?.role)r.role=n;if(t&&!r.tabindex)r.tabindex="0";return V(e,{tag:"div",className:[e.class,e.fullWidth?`${e.prefix}-card--full-width`:null,t?`${e.prefix}-card--interactive`:null],attributes:r,forwardEvents:{click:()=>!!e.clickable,mouseenter:()=>!!t,mouseleave:()=>!!t,keydown:()=>!!t,focus:()=>!!t,blur:()=>!!t},interactive:t})},yl=(e)=>({lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}}),$t=El,xl=(e)=>{let t=e.config;if(t.interactive||t.clickable)e.element.addEventListener("mouseenter",()=>{if(t.variant===gr.ELEVATED)e.element.style.setProperty("--card-elevation",String($t.LEVEL2))}),e.element.addEventListener("mouseleave",()=>{if(t.variant===gr.ELEVATED)e.element.style.setProperty("--card-elevation",String($t.LEVEL1))}),e.element.addEventListener("keydown",(r)=>{if((r.key==="Enter"||r.key===" ")&&t.clickable)r.preventDefault(),e.element.click()}),e.element.addEventListener("focus",()=>{e.element.classList.add(`${e.getClass("card")}--focused`)}),e.element.addEventListener("blur",()=>{e.element.classList.remove(`${e.getClass("card")}--focused`)});if(t.draggable)e.element.setAttribute("draggable","true"),e.element.addEventListener("dragstart",(r)=>{if(e.element.style.setProperty("--card-elevation",String($t.LEVEL4)),e.element.classList.add(`${e.getClass("card")}--dragging`),e.emit?.("dragstart",{event:r}),r.dataTransfer){let i=e.element.querySelector(`.${e.getClass("card")}-header-title`)?.textContent||"Card";r.dataTransfer.setData("text/plain",i)}}),e.element.addEventListener("dragend",(r)=>{e.element.style.setProperty("--card-elevation",String($t.LEVEL1)),e.element.classList.remove(`${e.getClass("card")}--dragging`),e.emit?.("dragend",{event:r})});return e};var Il=(e)=>{if(e.config.variant==="elevated")e.element.style.setProperty("--card-elevation",String($t.LEVEL1));else e.element.style.setProperty("--card-elevation",String($t.LEVEL0));return e};var Sf=(e={})=>{let t=bl(e),n=Tl(t);try{let r=M(D,k(),O(Sl(n)),oe(n),n.clickable?we(n):(i)=>i,P(),xl,Il,(i)=>Cl(yl(i))(i))(n);return vl(r,t),r}catch(r){throw console.error("Card creation error:",r instanceof Error?r.message:String(r)),Error(`Failed to create card: ${r instanceof Error?r.message:String(r)}`)}},vi=Sf;se();te();re();var Ti=(e)=>(t)=>{let n=t.getClass("carousel"),r=document.createElement("div");r.className=`${n}__scroller`;let i=document.createElement("div");i.className=`${n}__track`,r.appendChild(i),t.element.appendChild(r);let s=[],a=[],o=t,l,d=()=>{let g=a.length;a.forEach((m,p)=>{m.dataset.index=String(p),m.setAttribute("aria-label",`${p+1} of ${g}`)})},u=(g,m)=>{if(g.replaceChildren(),m.content!==void 0){if(typeof m.content==="string")g.innerHTML=m.content;else g.appendChild(m.content);return}if(m.image){let p=document.createElement("img");p.className=`${n}__image`,p.src=m.image,p.alt=m.alt??m.title??"",p.draggable=!1,g.appendChild(p)}if(m.title||m.description||m.buttonText){let p=document.createElement("div");if(p.className=`${n}__content`,m.title){let h=document.createElement("div");h.className=`${n}__title`,h.textContent=m.title,p.appendChild(h)}if(m.description){let h=document.createElement("div");h.className=`${n}__description`,h.textContent=m.description,p.appendChild(h)}if(m.buttonText){let h=document.createElement("a");if(h.className=`${n}__button`,h.textContent=m.buttonText,m.buttonUrl)h.href=m.buttonUrl;p.appendChild(h)}g.appendChild(p)}},f=(g)=>{let m=document.createElement("div");return m.className=`${n}__item`,m.setAttribute("role","group"),m.setAttribute("aria-roledescription","slide"),m.tabIndex=0,u(m,g),m},c=()=>{d(),l?.()},C={addSlide(g,m){let p=m!==void 0&&m>=0&&m<=s.length?m:s.length,h=f(g);if(s.splice(p,0,g),p<a.length)i.insertBefore(h,a[p]),a.splice(p,0,h);else i.appendChild(h),a.push(h);return c(),C},removeSlide(g){if(g<0||g>=a.length)return C;return i.removeChild(a[g]),a.splice(g,1),s.splice(g,1),c(),C},updateSlide(g,m){if(g<0||g>=a.length)return C;return s[g]=m,u(a[g],m),C},getSlide:(g)=>s[g]??null,getCount:()=>s.length,getElements:()=>a.slice()};return o.scroller=r,o.track=i,o.slides=C,o.slideElements=a,o.onSlidesChanged=(g)=>{l=g},(e.slides??[]).forEach((g)=>{let m=f(g);s.push(g),a.push(m),i.appendChild(m)}),d(),o};var He={MULTI_BROWSE:"multi-browse",UNCONTAINED:"uncontained",HERO:"hero",HERO_CENTER:"hero-center",FULL_SCREEN:"full-screen"},Ll={CHANGE:"change"},ye={VARIANT:He.MULTI_BROWSE,ITEM_WIDTH:280,GAP:8,GAP_FULL_SCREEN:16,PADDING:16,CORNER_RADIUS:28,MIN_SMALL_ITEM_WIDTH:40,MAX_SMALL_ITEM_WIDTH:56,ANCHOR_SIZE:10,MEDIUM_LARGE_THRESHOLD:0.85,INITIAL_SLIDE:0};ne();var xf={variant:ye.VARIANT,cornerRadius:ye.CORNER_RADIUS,initialSlide:ye.INITIAL_SLIDE,minSmallItemWidth:ye.MIN_SMALL_ITEM_WIDTH,maxSmallItemWidth:ye.MAX_SMALL_ITEM_WIDTH},Si=(e)=>{let t=e.variant||ye.VARIANT,n=t===He.FULL_SCREEN;return{variant:t,gap:e.gap??(n?ye.GAP_FULL_SCREEN:ye.GAP),padding:e.padding??(n?0:ye.PADDING),snap:e.snap??t!==He.UNCONTAINED}},Al=(e={})=>_(xf,e,"carousel"),wl=(e)=>{let{variant:t}=Si(e);return V(e,{tag:"div",attributes:{role:"region","aria-roledescription":"carousel","aria-label":e.ariaLabel||"Carousel"},className:[e.class,`${e.prefix}-carousel--${t}`,t===He.FULL_SCREEN?`${e.prefix}-carousel--vertical`:null],forwardEvents:{focus:!0,blur:!0}})};var Cr=(e)=>e.largeCount+e.mediumCount+e.smallCount,If=(e)=>{if(e.largeCount>0&&e.smallCount>0&&e.mediumCount>0)return e.largeSize>e.mediumSize&&e.mediumSize>e.smallSize;if(e.largeCount>0&&e.smallCount>0)return e.largeSize>e.smallSize;return!0},yi=(e,t)=>If(e)?Math.abs(t-e.largeSize)*e.priority:Number.MAX_VALUE,Lf=(e,t,n,r,i)=>(e-(t+r/2)*n)/(i+r/2),Af=(e,t,n,r,i,s,a,o,l,d,u)=>{let f=d+o+r,c=t-(f-1)*n,C=Math.min(Math.max(i,s),a),g=u*d+l*o+C*r,m=c-g;if(r>0&&m>0)C+=Math.min(m/r,a-C);else if(r>0&&m<0)C+=Math.max(m/r,s-C);C=r>0?C:0;let p=Lf(c,r,C,o,d),h=(p+C)/2;if(o>0&&p!==u){let b=(u-p)*d,v=h*0.1*o,E=Math.min(Math.abs(b),v);if(b>0)h-=E/o,p+=E/d;else h+=E/o,p-=E/d}return{priority:e,smallSize:C,smallCount:r,mediumSize:h,mediumCount:o,largeSize:p,largeCount:d}},Er=(e)=>{let t=null,n=1;for(let r of e.largeCounts)for(let i of e.mediumCounts)for(let s of e.smallCounts){let a=Af(n,e.availableSpace,e.gap,s,e.targetSmallSize,e.minSmallSize,e.maxSmallSize,i,e.targetMediumSize,r,e.targetLargeSize);if(t===null||yi(a,e.targetLargeSize)<yi(t,e.targetLargeSize)){if(t=a,yi(t,e.targetLargeSize)===0)return t}n++}return t};var $e=(e)=>e.findIndex((t)=>t.isFocal),Ye=(e)=>{for(let t=e.length-1;t>=0;t--)if(e[t].isFocal)return t;return-1},vr=(e)=>e.findIndex((t)=>!t.isAnchor),Tr=(e)=>{for(let t=e.length-1;t>=0;t--)if(!e[t].isAnchor)return t;return-1},xi=(e)=>e.findIndex((t)=>t.isPivot),Ml=(e)=>Ye(e)-$e(e)+1,Ii=(e)=>e.reduce((t,n)=>Math.min(t,n.size),Number.MAX_VALUE),Li=(e)=>e.reduce((t,n)=>Math.max(t,n.size),0),Ol=(e)=>{let t=e[$e(e)];return t.offset-t.size/2>=0&&$e(e)===vr(e)},Rl=(e,t)=>{let n=e[Ye(e)];return n.offset+n.size/2<=t&&Ye(e)===Tr(e)},_l=(e,t)=>{for(let n=Ye(e);n<e.length;n++)if(e[n].size===t)return n;return e.length-1},Pl=(e,t)=>{for(let n=$e(e)-1;n>=0;n--)if(e[n].size===t)return n;return 0},kl=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(e[n].unadjustedOffset<t)return e[n];return e[0]},Bl=(e,t)=>e.find((n)=>n.unadjustedOffset>=t)??e[e.length-1],br=(e,t,n)=>e+(t-e)*n,Ai=(e,t,n)=>({size:br(e.size,t.size,n),offset:br(e.offset,t.offset,n),unadjustedOffset:br(e.unadjustedOffset,t.unadjustedOffset,n),isFocal:n<0.5?e.isFocal:t.isFocal,isAnchor:n<0.5?e.isAnchor:t.isAnchor,isPivot:n<0.5?e.isPivot:t.isPivot,cutoff:br(e.cutoff,t.cutoff,n)}),Hl=(e,t,n)=>e.map((r,i)=>Ai(r,t[i],n)),Nl=(e,t)=>t-e/2<0&&t+e/2>0,Dl=(e,t,n)=>t-e/2<n&&t+e/2>n,$l=(e)=>{let t=-1,n=0;if(e.forEach((i,s)=>{if(!i.isAnchor&&i.size>n)t=s,n=i.size}),t<0)return[-1,-1,0];let r=t;while(r<e.length-1&&e[r+1].size===n)r++;return[t,r,n]},Vl=(e,t,n,r,i,s,a,o)=>{if(e.length===0||t<0||t>=e.length)return[];let l=e[t],d=[],u=Nl(l.size,n)?n-l.size/2:Dl(l.size,n,a)?n+l.size/2-a:0;d.push({size:l.size,offset:n,unadjustedOffset:n,isFocal:t>=r&&t<=i,isAnchor:l.isAnchor,isPivot:!0,cutoff:u});let f=n-s/2-o,c=n-s/2-o;for(let C=t-1;C>=0;C--){let g=e[C],m=f-g.size/2,p=c-s/2;d.unshift({size:g.size,offset:m,unadjustedOffset:p,isFocal:C>=r&&C<=i,isAnchor:g.isAnchor,isPivot:!1,cutoff:Nl(g.size,m)?Math.abs(m-g.size/2):0}),f-=g.size+o,c-=s+o}f=n+s/2+o,c=n+s/2+o;for(let C=t+1;C<e.length;C++){let g=e[C],m=f+g.size/2,p=c+s/2;d.push({size:g.size,offset:m,unadjustedOffset:p,isFocal:C>=r&&C<=i,isAnchor:g.isAnchor,isPivot:!1,cutoff:Dl(g.size,m,a)?m+g.size/2-a:0}),f+=g.size+o,c+=s+o}return d},wi=(e,t,n,r,i)=>{let[s,a,o]=$l(i);return Vl(i,n,r,s,a,o,e,t)},wf=(e,t,n,r)=>{let[i,s,a]=$l(r);if(i<0)return[];let o=s-i,l=a/2;if(n==="center"){let d=t===0||o%2===0?0:t/2,u=Math.floor(o/2)*t;l=e/2-a/2*o-d-u}return Vl(r,i,l,i,s,a,e,t)},Sr=(e,t,n,r,i,s)=>{let a=[{size:r,isAnchor:!0}],o=(l,d)=>{for(let u=0;u<d;u++)a.push({size:l,isAnchor:!1})};if(s==="center")o(e.smallSize,Math.floor(e.smallCount/2)),o(e.mediumSize,Math.floor(e.mediumCount/2)),o(e.largeSize,e.largeCount),o(e.mediumSize,Math.ceil(e.mediumCount/2)),o(e.smallSize,Math.ceil(e.smallCount/2));else o(e.largeSize,e.largeCount),o(e.mediumSize,e.mediumCount),o(e.smallSize,e.smallCount);return a.push({size:i,isAnchor:!0}),wf(t,n,s,a)},Fl=(e,t)=>{let n=[];for(let r=e;r>=t;r--)n.push(r);return n},Ul=(e,t,n,r,i)=>{if(e<=0||t<=0)return[];let s=[1],a=[1,0],o=Math.min(t,e),l=Math.min(Math.max(o/3,i.minSmallSize),i.maxSmallSize),d=(o+l)/2;if(e<i.minSmallSize*2)s=[0];let u=e-d*Math.max(...a)-i.maxSmallSize*Math.max(...s),f=Math.max(1,Math.floor(u/o)),c=Math.ceil(e/o),C=Fl(c,f),g={availableSpace:e,gap:n,targetSmallSize:l,minSmallSize:i.minSmallSize,maxSmallSize:i.maxSmallSize,smallCounts:s,targetMediumSize:d,mediumCounts:a,targetLargeSize:o,largeCounts:C},m=Er(g);if(m&&Cr(m)>r){let p=Cr(m)-r,h=m.smallCount,b=m.mediumCount;while(p>0){if(h>0)h-=1;else if(b>1)b-=1;p-=1}m=Er({...g,smallCounts:[h],mediumCounts:[b]})}if(!m)return[];return Sr(m,e,n,i.anchorSize,i.anchorSize,"start")},Gl=(e,t,n,r,i,s)=>{if(e<=0)return[];let a=i&&r>=3,o=r<=1?[0]:a?[2]:[1],l=Math.min(t??e,e),d=Math.min(Math.max(l/3,s.minSmallSize),s.maxSmallSize),u=s.minSmallSize*Math.max(...o)+s.minSmallSize*1.25;if(e<u)o=[0];let f=e-s.minSmallSize*Math.max(...o),c=Math.max(1,Math.floor(f/l)),C=Math.ceil(e/l),g=Er({availableSpace:e,gap:n,targetSmallSize:d,minSmallSize:s.minSmallSize,maxSmallSize:s.maxSmallSize,smallCounts:o,targetMediumSize:0,mediumCounts:[0],targetLargeSize:l,largeCounts:Fl(C,c)});if(!g)return[];let m=a&&r>=Cr(g)?"center":"start";return Sr(g,e,n,s.anchorSize,s.anchorSize,m)},Nf=(e,t,n,r)=>{let i=Math.max(n*1.5,e);if(i>t*r)i=Math.max(n*1.2,e);return i},yr=(e,t,n,r)=>{if(e<=0||t<=0)return[];let i=Math.min(t,e),s=Math.max(1,Math.floor((e+n)/(i+n))),a=Math.max(0,e-s*(i+n)),o=a>0?1:0,l=Nf(r.anchorSize,i,a,r.mediumLargeThreshold),d={priority:0,smallSize:0,smallCount:0,mediumSize:l,mediumCount:o,largeSize:i,largeCount:s},u=Math.min(r.anchorSize,t),f=Math.max(u,l*0.5);return Sr(d,e,n,f,r.anchorSize,"start")},zl=(e,t,n)=>{if(e<=0)return[];return Sr({priority:0,smallSize:0,smallCount:0,mediumSize:0,mediumCount:0,largeSize:e,largeCount:1},e,t,n.anchorSize,n.anchorSize,"start")};var Ni=(e,t,n,r,i)=>{if(i<=n)return e;if(i>=r)return t;return e+(t-e)*((i-n)/(r-n))},xr=(e,t,n,r,i,s)=>{let a=e.filter((d)=>!d.isAnchor).length,o=r/a;return wi(t,n,s,i.offset-o/2+r,e.map((d)=>({size:d.size-Math.abs(o),isAnchor:d.isAnchor}))).map((d,u)=>({...d,unadjustedOffset:e[u].unadjustedOffset}))},Ir=(e,t,n,r,i)=>{let s=t>n?1:-1,a=e[t],o=(a.size-a.cutoff+i)*s,l=e[xi(e)],d=e.slice();return d.splice(t,1),d.splice(n,0,a),wi(r,i,xi(e)+s,l.offset+o,d.map((u)=>({size:u.size,isAnchor:u.isAnchor})))},Df=(e,t,n,r)=>{if(e.length===0)return[];let i=[e];if(Ol(e)){if(r!==0)i.push(xr(e,t,n,r,e[$e(e)],$e(e)));return i}let s=vr(e),o=$e(e)-s;if(o<=0&&e[$e(e)].cutoff>0)return i.push(Ir(e,0,0,t,n)),i;for(let l=0;l<o;l++){let d=i[i.length-1],u=s+l,f=e.length-1;if(u>0){let c=e[u-1].size;f=_l(d,c)-1}i.push(Ir(d,vr(e),f,t,n))}if(r!==0){let l=i[i.length-1];i[i.length-1]=xr(l,t,n,r,l[$e(l)],$e(l))}return i},Mf=(e,t,n,r)=>{if(e.length===0)return[];let i=[e];if(Rl(e,t)){if(r!==0)i.push(xr(e,t,n,-r,e[Ye(e)],Ye(e)));return i}let s=Ye(e),a=Tr(e),o=a-s;if(o<=0&&e[Ye(e)].cutoff>0)return i.push(Ir(e,0,0,t,n)),i;for(let l=0;l<o;l++){let d=i[i.length-1],u=a-l,f=0;if(u<e.length-1){let c=e[u+1].size;f=Pl(d,c)+1}i.push(Ir(d,Tr(e),f,t,n))}if(r!==0){let l=i[i.length-1];i[i.length-1]=xr(l,t,n,-r,l[Ye(l)],Ye(l))}return i},Wl=(e,t,n)=>{let r=[0];if(e===0||t.length===0)return r;for(let i=1;i<t.length;i++){let s=t[i-1],a=t[i],o=n?a[0].unadjustedOffset-s[0].unadjustedOffset:s[s.length-1].unadjustedOffset-a[a.length-1].unadjustedOffset,l=i===t.length-1?1:r[i-1]+o/e;r.push(l)}return r},Kl=(e,t,n,r,i)=>{let s=Df(e,t,n,r),a=Mf(e,t,n,i),o=e.length?e[$e(e)].size:0,l=s.length?Math.max(s[s.length-1][0].unadjustedOffset-s[0][0].unadjustedOffset,r):0,d=a.length?Math.max(a[0][a[0].length-1].unadjustedOffset-a[a.length-1][a[a.length-1].length-1].unadjustedOffset,i):0,u=e.length?Ii(e):0,f=e.length?Li(e):0;for(let c of[...s,...a])u=Math.min(u,Ii(c)),f=Math.max(f,Li(c));return{defaultKeylines:e,startSteps:s,endSteps:a,availableSpace:t,gap:n,beforePadding:r,afterPadding:i,itemSize:o,minItemSize:u,maxItemSize:f,valid:e.length>0&&t!==0&&o!==0,startShiftDistance:l,endShiftDistance:d,startShiftPoints:Wl(l,s,!0),endShiftPoints:Wl(d,a,!1)}},Yl=(e,t,n,r=!1)=>{let i=Math.max(0,t),s=e.startShiftDistance,a=Math.max(0,n-e.endShiftDistance);if(i>=s&&i<=a)return e.defaultKeylines;let o=Ni(1,0,0,s,i),l=e.startShiftPoints,d=e.startSteps;if(i>a){if(o=Ni(0,1,a,n,i),l=e.endShiftPoints,d=e.endSteps,a<0.01&&e.startSteps.length===2&&e.endSteps.length===2)d=[e.startSteps[1],e.endSteps[1]]}let u=0,f=0,c=0,C=l[0];for(let g=1;g<d.length;g++){let m=l[g];if(o<=m){u=g-1,f=g,c=Ni(0,1,C,m,o);break}C=m}if(r)return d[Math.round(c)===0?u:f];return Hl(d[u],d[f],c)},Di=(e,t,n)=>{if(!e.valid)return 0;let r=(d)=>d[$e(d)].unadjustedOffset-e.itemSize/2,i=(d)=>d[Ye(d)].unadjustedOffset-e.itemSize/2,s=Math.round(r(e.defaultKeylines)),a=e.startSteps.length-1;if(t<=a){let d=Math.min(Math.max(a-t,0),a);s=Math.round(r(e.startSteps[d]))}let o=e.endSteps.length-1,l=n-1;if(t>=l-o&&n>Ml(e.defaultKeylines)){let d=Math.min(Math.max(o-(l-t),0),o);s=Math.round(i(e.endSteps[d]))}return s},Xl=(e,t)=>Math.max(0,e.itemSize*t+e.gap*(t-1)-e.availableSpace),ql=(e,t,n,r)=>{let i=e.itemSize+e.gap,s=n*i+e.itemSize/2-r,a=kl(t,s),o=Bl(t,s),l=a===o?1:(s-a.unadjustedOffset)/(o.unadjustedOffset-a.unadjustedOffset),d=Ai(a,o,l),u=d.offset;if(a===o)u+=(s-d.unadjustedOffset)/d.size;return{size:d.size,center:u,keyline:d}};var jl=0.4,Of=4,Mi=(e)=>(t)=>{let{variant:n,gap:r,padding:i,snap:s}=Si(e),a=n===He.FULL_SCREEN,o={minSmallSize:e.minSmallItemWidth??ye.MIN_SMALL_ITEM_WIDTH,maxSmallSize:e.maxSmallItemWidth??ye.MAX_SMALL_ITEM_WIDTH,anchorSize:ye.ANCHOR_SIZE,mediumLargeThreshold:ye.MEDIUM_LARGE_THRESHOLD},l=e.cornerRadius??ye.CORNER_RADIUS,d=typeof window<"u"&&typeof window.matchMedia==="function"?window.matchMedia("(prefers-reduced-motion: reduce)"):null,{element:u,scroller:f,track:c,slideElements:C}=t,g=t.getClass("carousel"),m=`${g}__snap`;u.classList.toggle(`${g}--snap`,s);let p=null,h=0,b=0,v=0,E=[],T=Math.max(0,e.initialSlide??ye.INITIAL_SLIDE),S=new WeakMap,y=null,L=0,I=()=>{y=null,window.clearTimeout(L)},x=(F)=>{y=F,window.clearTimeout(L),L=window.setTimeout(I,1000)},A=()=>a?f.scrollTop:f.scrollLeft,N=(F,Q)=>{let ve=Q&&!d?.matches?"smooth":"auto";if(typeof f.scrollTo==="function")f.scrollTo(a?{top:F,behavior:ve}:{left:F,behavior:ve});else if(a)f.scrollTop=F;else f.scrollLeft=F},R=()=>{t.emit?.(Ll.CHANGE,{index:T})},U=(F)=>{let Q=0,ve=Number.MAX_VALUE;return E.forEach((Se,Ee)=>{let Ge=Math.abs(F-Se);if(Ge<ve)ve=Ge,Q=Ee}),Q},H=(F)=>{let Q=d?.matches===!0,ve=e.itemWidth??ye.ITEM_WIDTH;switch(n){case He.HERO:case He.HERO_CENTER:{let Se=e.itemWidth??null;return Q?yr(F,Math.min(Se??F,F),r,o):Gl(F,Se,r,h,n===He.HERO_CENTER,o)}case He.UNCONTAINED:return yr(F,ve,r,o);case He.FULL_SCREEN:return zl(F,r,o);default:return Q?yr(F,ve,r,o):Ul(F,ve,r,h,o)}},q=()=>{if(h=C.length,b=a?f.clientHeight:f.clientWidth,T=h?Math.min(T,h-1):0,b<=0||h===0){p=null;return}let F=n===He.UNCONTAINED?0:i;if(p=Kl(H(b),b,r,i,F),!p.valid){p=null;return}let Q=p.itemSize+p.gap;v=-Di(p,0,h),E=C.map((Ee,Ge)=>Ge*Q-Di(p,Ge,h)-v);let ve=Math.max(0,E[h-1]??0);c.style[a?"height":"width"]=`${b+ve}px`,c.style[a?"width":"height"]="",c.querySelectorAll(`.${m}`).forEach((Ee)=>Ee.remove());let Se=document.createDocumentFragment();E.forEach((Ee)=>{let Ge=document.createElement("div");Ge.className=m,Ge.style[a?"top":"left"]=`${Ee}px`,Se.appendChild(Ge)}),c.appendChild(Se),C.forEach((Ee)=>{Ee.style[a?"height":"width"]=`${p.itemSize}px`,Ee.style[a?"width":"height"]=""}),u.style.setProperty("--mtrl-carousel-corner",`${l}px`)},Y=()=>{if(!p)return;let F=A(),Q=F+v,ve=Yl(p,Q,Xl(p,h)),Se=p.itemSize,Ee=p.maxItemSize-p.minItemSize;for(let qn=0;qn<h;qn++){let Mt=C[qn],jn=ql(p,ve,qn,Q),Zn=Math.max(0,Math.min(Se,jn.size)),Gr=jn.center-Se/2+F,ta=jn.center+Zn/2<-Se||jn.center-Zn/2>b+Se,zr=Math.max(0,(Se-Zn)/2),na=Ee>0?Math.min(1,Math.max(0,(Zn-p.minItemSize)/Ee)):1,ra=ta?"hidden":`${Math.round(Gr*100)/100}|${Math.round(zr*100)/100}|${na.toFixed(3)}`;if(S.get(Mt)===ra)continue;if(S.set(Mt,ra),ta){Mt.style.visibility="hidden";continue}Mt.style.visibility="",Mt.style.transform=a?`translate3d(0, ${Gr}px, 0)`:`translate3d(${Gr}px, 0, 0)`,Mt.style.clipPath=a?`inset(${zr}px 0 round ${l}px)`:`inset(0 ${zr}px round ${l}px)`,Mt.style.setProperty("--mtrl-carousel-fade",na.toFixed(3))}if(y!==null){if(Math.abs(A()-(E[y]??0))<1)I();return}let Ge=U(A());if(Ge!==T)T=Ge,R()},J=()=>{if(q(),p)x(T),N(E[T]??0,!1);Y()},w=(F)=>{if(!h)return;let Q=Math.min(Math.max(F,0),h-1);if(p)x(Q),N(E[Q]??0,!0);if(Q!==T)T=Q,R()},G=()=>w(T+1),j=()=>w(T-1),Z=(F)=>{let Q=F?.closest?.(`.${g}__item`);return Q?C.indexOf(Q):-1},xe=(F)=>{let Q=Z(F.target);if(Q<0)return;let ve=a?"ArrowDown":"ArrowRight",Se=a?"ArrowUp":"ArrowLeft",Ee=-1;if(F.key===ve)Ee=Q+1;else if(F.key===Se)Ee=Q-1;else if(F.key==="Home")Ee=0;else if(F.key==="End")Ee=h-1;if(Ee<0||Ee>=h)return;F.preventDefault(),C[Ee].focus({preventScroll:!0}),w(Ee)},ie=(F)=>{let Q=Z(F.target);if(Q>=0&&Q!==T)w(Q)},Ze=!1,Oe=!1,ge=0,Ae=0,ke=0,ot=0,Tn=0,js=0,Nt=()=>{window.clearTimeout(js),f.removeEventListener("scrollend",Nt),delete u.dataset.settling},Zs=(F)=>{if(I(),F.pointerType!=="mouse"||F.button!==0||!p)return;Ze=!0,Oe=!1,ge=a?F.clientY:F.clientX,ke=ge,ot=F.timeStamp,Tn=0,Ae=A(),Nt(),u.dataset.settling="true",f.setPointerCapture(F.pointerId)},Qs=(F)=>{if(!Ze)return;let Q=a?F.clientY:F.clientX,ve=Q-ge;if(!Oe&&Math.abs(ve)<Of)return;Oe=!0,u.dataset.dragging="true";let Se=F.timeStamp-ot;if(Se>0)Tn=(Q-ke)/Se;if(ke=Q,ot=F.timeStamp,a)f.scrollTop=Ae-ve;else f.scrollLeft=Ae-ve;F.preventDefault()},Xn=(F)=>{if(!Ze)return;if(Ze=!1,f.hasPointerCapture(F.pointerId))f.releasePointerCapture(F.pointerId);if(delete u.dataset.dragging,!Oe){Nt();return}if(s){let Q=U(A());if(Tn<-jl)Q=Math.min(h-1,Q+1);else if(Tn>jl)Q=Math.max(0,Q-1);w(Q),f.addEventListener("scrollend",Nt,{once:!0}),js=window.setTimeout(Nt,600)}else Nt()},Js=(F)=>{if(Oe)Oe=!1,F.preventDefault(),F.stopPropagation()};f.addEventListener("scroll",Y,{passive:!0}),f.addEventListener("wheel",I,{passive:!0}),f.addEventListener("touchstart",I,{passive:!0}),f.addEventListener("keydown",xe),f.addEventListener("focusin",ie),f.addEventListener("pointerdown",Zs),f.addEventListener("pointermove",Qs),f.addEventListener("pointerup",Xn),f.addEventListener("pointercancel",Xn),f.addEventListener("click",Js,!0),d?.addEventListener?.("change",J);let ea=typeof ResizeObserver==="function"?new ResizeObserver(J):null;ea?.observe(f),t.onSlidesChanged(J),J();let bm=t.lifecycle?.destroy,Dt=t;return Dt.getCurrentSlide=()=>T,Dt.getVariant=()=>n,Dt.next=G,Dt.prev=j,Dt.goTo=w,Dt.lifecycle={destroy:()=>{Nt(),ea?.disconnect(),d?.removeEventListener?.("change",J),I(),f.removeEventListener("scroll",Y),f.removeEventListener("wheel",I),f.removeEventListener("touchstart",I),f.removeEventListener("keydown",xe),f.removeEventListener("focusin",ie),f.removeEventListener("pointerdown",Zs),f.removeEventListener("pointermove",Qs),f.removeEventListener("pointerup",Xn),f.removeEventListener("pointercancel",Xn),f.removeEventListener("click",Js,!0),bm?.()}},Dt};var Zl=()=>(e)=>{let t={element:e.element,slides:e.slides,lifecycle:{destroy:()=>e.lifecycle?.destroy()},getClass:e.getClass,next(){return e.next(),t},prev(){return e.prev(),t},goTo(n){return e.goTo(n),t},getCurrentSlide:()=>e.getCurrentSlide(),getVariant:()=>e.getVariant(),addSlide(n,r){return e.slides.addSlide(n,r),t},removeSlide(n){return e.slides.removeSlide(n),t},destroy(){e.lifecycle?.destroy()},on(n,r){return e.on?.(n,r),t},off(n,r){return e.off?.(n,r),t},addClass(...n){return e.element.classList.add(...n),t}};return t};var Ql=(e={})=>{let t=Al(e);return M(D,k(),O(wl(t)),Ti(t),P(),Mi(t),Zl())(t)},Oi=Ql;se();te();re();var Jl=({disabled:e,lifecycle:t,checkable:n})=>(r)=>({...r,element:r.element,input:r.input,getValue(){return n.isChecked()},setValue(i){if(typeof i==="boolean")if(i)n.check();else n.uncheck();else if(typeof i==="string")if(i==="true"||i==="1")n.check();else n.uncheck();return this},getValueAttribute(){return r.input?.value||""},setValueAttribute(i){if(r.input)r.input.value=i;return this},check(){return n.check(),this},uncheck(){return n.uncheck(),this},toggle(){return n.toggle(),this},isChecked(){return n.isChecked()},setIndeterminate(i){return r.setIndeterminate?.(i),this},setLabel(i){return r.text?.setText(i),this},getLabel(){return r.text?.getText()||""},on(i,s){return r.on?.(i,s),this},off(i,s){return r.off?.(i,s),this},enable(){return e.enable(),this},disable(){return e.disable(),this},destroy(){t.destroy()}});ne();var Rf={variant:"filled",labelPosition:"end"},ed=(e={})=>_(Rf,e,"checkbox"),td=(e)=>V(e,{tag:"div",className:e.class,interactive:!0}),nd=(e)=>(t)=>{let n=document.createElement("span");return n.className=`${e.prefix}-checkbox-icon`,n.innerHTML=`
|
|
9
|
+
</svg>`,An=(e)=>(t)=>{let n=document.createElement("span");n.className=`${e.prefix}-${e.componentName}-track`;let r=document.createElement("span");if(r.className=`${e.prefix}-${e.componentName}-thumb`,n.appendChild(r),e.icon!=="none"){let i=document.createElement("span");i.className=`${e.prefix}-${e.componentName}-thumb-icon`,i.innerHTML=e.icon||Pm,r.appendChild(i)}return t.element.appendChild(n),{...t,track:n,thumb:r}};var er=(e)=>{let t=new Map;return{on(n,r){return e.addEventListener(n,r),t.set(r,n),this},off(n,r){return e.removeEventListener(n,r),t.delete(r),this},destroy(){t.forEach((n,r)=>{e.removeEventListener(n,r)}),t.clear()},getHandlers(){return new Map(t)}}};var jr=(e)=>(t)=>{let n=er(e||t.element),r={addListeners(i){return Object.entries(i).forEach(([s,a])=>{n.on(s,a)}),this},removeListeners(i){return Object.entries(i).forEach(([s,a])=>{n.off(s,a)}),this},once(i,s){let a=(o)=>{s(o),n.off(i,a)};return n.on(i,a),this},on(i,s){return n.on(i,s),this},off(i,s){return n.off(i,s),this},destroy(){n.destroy()}};if(pt(t)){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{n.destroy(),i.call(t.lifecycle)}}return{...t,events:r,on:r.on.bind(r),off:r.off.bind(r)}};var Ma=()=>{};var Zt=(e,t,n={})=>{let r=null,i=0,{leading:s=!0,trailing:a=!0}=n;return function(...o){let l=Date.now();if(!i&&!s)i=l;let d=t-(l-i);if(d<=0||d>t){if(r)clearTimeout(r),r=null;i=l,e.apply(this,o)}else if(!r&&a)r=window.setTimeout(()=>{i=s?Date.now():0,r=null,e.apply(this,o)},d)}},Qt=(e,t,n={})=>{let r=null,i=null,s=null,a,o=null,l=0,{leading:d=!1,maxWait:u}=n,f=(m)=>{let p=m-(o||0),h=m-l;return!o||p>=t||p<0||u!==void 0&&h>=u},c=(m)=>{let p=i,h=s;return i=s=null,l=m,a=e.apply(h,p),a},C=(m)=>{if(r=null,i)return c(m);return a},g=(m)=>(l=m,r=window.setTimeout(()=>{C(Date.now())},t),d?c(m):a);return function(...m){let p=Date.now(),h=f(p);if(i=m,s=this,o=p,h){if(r===null)return g(p);if(u!==void 0)r=window.setTimeout(()=>{let b=Date.now();if(f(b))return C(b)},Math.min(t,u-(p-l)))}if(r===null)r=window.setTimeout(()=>{C(Date.now())},t);return a}},tr=(e)=>{let t=!1,n;return function(...r){if(!t)t=!0,n=e.apply(this,r);return n}};var Zr=(e={})=>(t)=>{let n={},r=(a,o,l,d={})=>{if(n[a])i(a);let u=Zt(o,l,d);return t.element.addEventListener(a,u),n[a]={original:o,throttled:u},s},i=(a)=>{let o=n[a];if(o)t.element.removeEventListener(a,o.throttled),delete n[a];return s};if(pt(t)){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{Object.keys(n).forEach((o)=>{let l=n[o];t.element.removeEventListener(o,l.throttled)}),a.call(t.lifecycle)}}if(e.throttledEvents)Object.entries(e.throttledEvents).forEach(([a,o])=>{r(a,o.handler,o.wait,o.options)});let s={...t,addThrottledEvent:r,removeThrottledEvent:i};return s};var Oa=()=>{};function km(e){return"lifecycle"in e&&e.lifecycle&&typeof e.lifecycle==="object"&&"destroy"in e.lifecycle&&typeof e.lifecycle.destroy==="function"}var Qr=(e={})=>(t)=>{let n={},r=(a,o,l,d={})=>{if(n[a])i(a);let u=Qt(o,l,d);return t.element.addEventListener(a,u),n[a]={original:o,debounced:u},s},i=(a)=>{let o=n[a];if(o)t.element.removeEventListener(a,o.debounced),delete n[a];return s};if(km(t)){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{Object.keys(n).forEach((o)=>{let l=n[o];t.element.removeEventListener(o,l.debounced)}),a.call(t.lifecycle)}}if(e.debouncedEvents)Object.entries(e.debouncedEvents).forEach(([a,o])=>{r(a,o.handler,o.wait,o.options)});let s={...t,addDebouncedEvent:r,removeDebouncedEvent:i};return s};var Ra=()=>{};function Jr(e){return"input"in e&&e.input instanceof HTMLElement&&"disabled"in e.input}var de=(e)=>(t)=>{let n=`${t.getClass(e.componentName||t.componentName||"component")}--disabled`,r={enable(){if(t.element.classList.remove(n),Jr(t))t.input.disabled=!1,t.input.removeAttribute("disabled");else{let i=t.element;if("disabled"in i)i.disabled=!1;t.element.removeAttribute("disabled")}return this},disable(){if(t.element.classList.add(n),Jr(t))t.input.disabled=!0,t.input.setAttribute("disabled","true");else{let i=t.element;if("disabled"in i)i.disabled=!0;t.element.setAttribute("disabled","true")}return this},toggle(){if(this.isDisabled())this.enable();else this.disable();return this},isDisabled(){if(Jr(t))return t.input.disabled;let i=t.element;return"disabled"in i&&i.disabled}};if(e.disabled)requestAnimationFrame(()=>{r.disable()});return{...t,disabled:r}};function Bm(e){return"events"in e&&e.events&&typeof e.events==="object"&&"destroy"in e.events&&typeof e.events.destroy==="function"}function Hm(e){return"text"in e&&e.text&&typeof e.text==="object"&&"getElement"in e.text&&typeof e.text.getElement==="function"}function $m(e){return"icon"in e&&e.icon&&typeof e.icon==="object"&&"getElement"in e.icon&&typeof e.icon.getElement==="function"}var P=()=>(e)=>{let t=!1,n=Re();return{...e,lifecycle:{onMount:(i)=>n.on("mount",i),onUnmount:(i)=>n.on("unmount",i),mount:()=>{if(!t)t=!0,n.emit("mount")},unmount:()=>{if(t)t=!1,n.emit("unmount"),n.clear()},isMounted:()=>t,destroy(){if(t)this.unmount();if(Bm(e))e.events.destroy();if(Hm(e)){let i=e.text.getElement();if(i)i.remove()}if($m(e)){let i=e.icon.getElement();if(i)i.remove()}if(e.element)e.element.remove()}}}};var _a=()=>{};var re=X(()=>{ya();Ia();wa();Da();Ma();Oa();Ra();_a()});var se=X(()=>{te();re()});function ei(e,t){wn[e]=t}function Nn(e){return wn[e]||{}}function ti(e){Object.assign(wn,e)}function ni(){Object.keys(wn).forEach((e)=>{delete wn[e]})}var wn;var ri=X(()=>{wn={}});var _=(e,t={},n)=>{let r=Nn(n),i=t.className!==void 0?t.className:t.class,s=e.className!==void 0?e.className:e.class,a={...e,...r,...t,componentName:n,prefix:K,className:i!==void 0?i:s};if("class"in a&&a.className!==void 0)delete a.class;return a},V=(e,t)=>{let n=e.className||e.class,r=t.className,i=[...Array.isArray(n)?n:[n],...Array.isArray(r)?r:[r]].filter(Boolean),s=t.attributes||{};return{tag:t.tag,componentName:e.componentName,attributes:s,className:i.length>0?i:void 0,rawClass:e.rawClass,id:e.id,name:e.name,title:e.title,tabIndex:e.tabIndex,style:e.style,data:e.data,role:e.role,ariaLabel:e.ariaLabel,ariaDescribedBy:e.ariaDescribedBy,ariaLabelledBy:e.ariaLabelledBy,ariaHidden:e.ariaHidden,html:t.html,text:t.text,forwardEvents:t.forwardEvents||{},interactive:t.interactive}};var ne=X(()=>{nt();ri()});var to=(e)=>{let t=new Map,n=(s,a)=>`${s}_${a.toString()}`,r=(s,a)=>(o)=>{try{s(o)}catch(l){console.error(`Error in ${a} handler:`,l)}},i=(s,a)=>{try{e.removeEventListener(s,a)}catch(o){console.warn(`Failed to remove ${s} listener:`,o)}};return{on(s,a,o={}){let l=r(a,s),d=n(s,a);return t.set(d,{original:a,enhanced:l,event:s,options:o}),e.addEventListener(s,l,o),this},off(s,a){let o=n(s,a),l=t.get(o);if(l)i(s,l.enhanced),t.delete(o);return this},pause(){return t.forEach(({enhanced:s,event:a})=>{i(a,s)}),this},resume(){return t.forEach(({enhanced:s,event:a,options:o})=>{e.addEventListener(a,s,o)}),this},destroy(){t.forEach(({enhanced:s,event:a})=>{i(a,s)}),t.clear()},getHandlers(){return new Map(t)},hasHandler(s,a){let o=n(s,a);return t.has(o)}}};var en=X(()=>{Qe();yn()});var rr,lt,no,Ct,ve,_t,dt,pe;var Pt=X(()=>{rr={LINEAR:"linear",CIRCULAR:"circular"},lt={FLAT:"flat",WAVY:"wavy"},no={CHANGE:"change",COMPLETE:"complete"},Ct={VARIANT:"linear",VALUE:0,MAX:100,BUFFER:0,SHAPE:"flat",SHOW_LABEL:!1,INDETERMINATE:!1},ve={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"},_t={LINEAR:{MIN_HEIGHT:4,GAP:4,STOP_INDICATOR:4,HEIGHT:4},CIRCULAR:{SIZE:48,GAP:8},COMMON:{STROKE_WIDTH:4}},dt={THIN:4,THICK:8},pe={LINEAR:{AMPLITUDE:4,SPEED:1,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,FREQUENCY:10,INDETERMINATE_FREQUENCY:16,POWER:0.8,START_TRANSITION_END:0,END_TRANSITION_START:0.92}}});var ii=(e)=>Boolean(e&&typeof e==="object"&&Object.getPrototypeOf(e)===Object.getPrototypeOf({})),si=(e,t)=>{let i=t.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split("."),s=e;for(let a=0,o=i.length;a<o;++a){let l=i[a];if(l in s)s=s[l];else return}return s};var Et=(e,t=17)=>{if(!e||!(e instanceof HTMLElement))return{color:"",element:null};let n=0,r=e;while(r&&n<t){let a=window.getComputedStyle(r).backgroundColor;if(a.startsWith("var(")){let o=a.match(/var\((--[\w-]+)\)/);if(o){let l=o[1];a=window.getComputedStyle(document.documentElement).getPropertyValue(l).trim()||"transparent"}}if(a&&a!=="transparent"&&a!=="rgba(0, 0, 0, 0)"&&a!=="rgba(0,0,0,0)")return{color:a,element:r};r=r.parentElement,n++}let i=window.getComputedStyle(document.body).backgroundColor;if(i!=="transparent"&&i!=="rgba(0, 0, 0, 0)")return{color:i,element:document.body};return{color:"rgb(255, 255, 255)",element:null}};var ai=()=>{};function Te(e,t){let n=`--${K}-${e}`;if(t?.onThemeChange)Zm(t.onThemeChange);let i=getComputedStyle(document.body).getPropertyValue(n).trim();if(!i)i=getComputedStyle(document.documentElement).getPropertyValue(n).trim();if(!i&&t?.fallback)return t.fallback;if(!i)return"";if(typeof t?.alpha==="number"&&/\d+,\s*\d+,\s*\d+/.test(i))return`rgba(${i}, ${t.alpha})`;if(typeof t?.alpha==="number"&&/^#([\da-f]{6}|[\da-f]{3})$/i.test(i)){let s=i.replace("#",""),a,o,l;if(s.length===3)a=parseInt(s[0]+s[0],16),o=parseInt(s[1]+s[1],16),l=parseInt(s[2]+s[2],16);else a=parseInt(s.substring(0,2),16),o=parseInt(s.substring(2,4),16),l=parseInt(s.substring(4,6),16);return`rgba(${a}, ${o}, ${l}, ${t.alpha})`}return i}var ir,bt=null,jm=()=>{if(bt)return;bt=new MutationObserver((t)=>{for(let n of t)if(n.type==="attributes"&&(n.attributeName==="data-theme"||n.attributeName==="data-theme-mode")){ir.forEach((r)=>r());break}});let e={attributes:!0,attributeFilter:["data-theme","data-theme-mode"]};if(bt.observe(document.documentElement,e),document.body)bt.observe(document.body,e)},Zm=(e)=>{if(!bt)jm();return ir.add(e),()=>{ir.delete(e)}};var ro=X(()=>{nt();ir=new Set;if(typeof window<"u")window.addEventListener("unload",()=>{if(bt)bt.disconnect(),bt=null;ir.clear()})});var Mn=(e,t)=>{let r=document.createElement("canvas").getContext("2d");if(!r)return`rgba(0, 0, 0, ${t})`;r.fillStyle=e;let i=r.fillStyle;if(i.startsWith("#")){let s=i.substring(1),a=parseInt(s.substring(0,2),16),o=parseInt(s.substring(2,4),16),l=parseInt(s.substring(4,6),16);return`rgba(${a}, ${o}, ${l}, ${t})`}if(i.startsWith("rgb")){let s=i.match(/\d+/g);if(s){let[a,o,l]=s;return`rgba(${a}, ${o}, ${l}, ${t})`}}return`rgba(0, 0, 0, ${t})`};var io=(e,t)=>(n,r)=>e(n,r)?t(n,r):n,so=(...e)=>e.filter(Boolean).join(" ");var kt=X(()=>{xn();ai();ro()});var On=(e,t,n)=>{let r=null,i=()=>{if(r)clearTimeout(r);r=window.setTimeout(()=>{n()},100)};if(typeof ResizeObserver<"u"){let s=new ResizeObserver((a)=>{for(let o of a){let{width:l}=o.contentRect,d=parseFloat(t.style.width||"0");if(Math.abs(l-d)>2)i()}});return s.observe(e),()=>{if(r)clearTimeout(r);s.disconnect()}}else return window.addEventListener("resize",i),()=>{if(r)clearTimeout(r);window.removeEventListener("resize",i)}};var ao=(e,t,n,r,i,s,a,o,l)=>{let d=Math.max(100,Math.abs(s-i)*50),u=(s-i)/d,f=pe.CIRCULAR.SPEED*2*Math.PI/1000;e.beginPath();for(let c=0;c<=d;c++){let C=i+u*c,g=C*o+l*f,m=Math.sin(g),h=Math.sign(m)*Math.pow(Math.abs(m),pe.CIRCULAR.POWER)*a,b=r+h,v=t+b*Math.cos(C),E=n+b*Math.sin(C);if(c===0)e.moveTo(v,E);else e.lineTo(v,E)}e.stroke()},oo=(e,t,n,r,i,s=0,a="flat")=>{let{ctx:o,width:l,height:d}=e,u=Rn(t.thickness),f=a==="wavy",c=Math.min(l,d),C=i?pe.CIRCULAR.INDETERMINATE_AMPLITUDE:pe.CIRCULAR.AMPLITUDE,g=c/2-u/2,m=g*(C/100),p=f?Bt(u,m):0,h=g-p,b=l/2,v=d/2;o.clearRect(0,0,l,d);let T=(_t.CIRCULAR.GAP+2*u)/h,S=-Math.PI/2,y=2*Math.PI-T;o.lineWidth=u,o.lineCap="round",o.lineJoin="round";let L=i?pe.CIRCULAR.INDETERMINATE_FREQUENCY:pe.CIRCULAR.FREQUENCY;if(i){let J=s%1333/1333,w=(Oe)=>{let ge=Oe<=0.5?Oe*2:2-Oe*2;return 0.028+0.722*(ge<0.5?2*ge*ge:1-Math.pow(-2*ge+2,2)/2)},G=()=>{let Oe=s/1568*2*Math.PI,ge=Math.floor(s/1333),Ae=s%1333/1333,ke=0;if(Ae>0.5){let at=(Ae-0.5)*2;ke=0.722*(at<0.5?2*at*at:1-Math.pow(-2*at+2,2)/2)}return Oe+(ge*0.722+ke)*2*Math.PI},j=w(J)*2*Math.PI,Z=G(),xe=S+Z,ie=xe+j;o.strokeStyle=Te("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"}),o.beginPath();let Ze=T/2;if(o.arc(b,v,h,ie+Ze,xe-Ze+2*Math.PI),o.stroke(),o.strokeStyle=Te("sys-color-primary",{fallback:"#6750A4"}),f)ao(o,b,v,h,xe,ie,p,L,s);else o.beginPath(),o.arc(b,v,h,xe,ie),o.stroke();return}let I=n/r,A=Math.max(I,0.001),N=0.95,R=y;if(I>=N){let Y=(I-N)/(1-N),J=Y*Y;R=y+T*J}if(I<0.99){let J=S+R*A+T/2,w=S+y+T/2;if(J<w)o.strokeStyle=Te("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"}),o.beginPath(),o.arc(b,v,h,J,w),o.stroke()}o.strokeStyle=Te("sys-color-primary",{fallback:"#6750A4"});let U=p;if(f){let Y=pe.CIRCULAR.START_TRANSITION_END,J=pe.CIRCULAR.END_TRANSITION_START;if(I===0&&Y>0)U=0;else if(I>0&&I<=Y){let w=I/Y;U=p*Math.pow(w,2)}else if(I>=J){let w=(I-J)/(1-J),G=1-Math.pow(1-w,2);U=p*(1-G)}if(I>=1)U=0}let H=S,q=S+R*A;if(f)ao(o,b,v,h,H,q,U,L,s);else o.beginPath(),o.arc(b,v,h,H,q),o.stroke()};var lo=X(()=>{Pt();kt();sr()});var _n=(e,t,n)=>{e.strokeStyle=n,e.lineWidth=t,e.lineCap="round"},vt=(e,t,n,r,i,s,a)=>{if(e.beginPath(),!i||a.amplitude===0)e.moveTo(t,r),e.lineTo(n,r);else{let o=t;for(let l=t;l<=n;l+=1){let d=l*a.frequency+s*a.speed,u=Math.sin(d),f=Math.sign(u)*Math.pow(Math.abs(u),pe.LINEAR.POWER),c=r+f*a.amplitude;if(l===t)e.moveTo(l,c);else e.lineTo(l,c);o=l}if(o<n){let l=n*a.frequency+s*a.speed,d=Math.sin(l),u=Math.sign(d)*Math.pow(Math.abs(d),pe.LINEAR.POWER),f=r+u*a.amplitude;e.lineTo(n,f)}}e.stroke()},uo=(e,t)=>{let[n,r,i]=t;if(e<=n)return 0.08+0.5814790000000001*(e/n);else if(e<=r)return 0.661479;else if(i&&e<=i)return 0.661479;return i?0.661479-0.5814790000000001*((e-i)/(1-i)):0.08},co=(e,t)=>{for(let i=0;i<t.length-1;i++){let[s,a]=t[i],[o,l]=t[i+1];if(e<=o){let d=(e-s)/(o-s);return a+(l-a)*d}}let[n,r]=t[t.length-1];return r+(220-r)*((e-n)/(1-n))},mo=(e,t,n,r,i,s,a=0,o=!0,l="flat")=>{let{ctx:d,width:u,height:f}=e,c=Rn(t.thickness),C=f/2,g=l==="wavy",m=c/2,p=u-m*2,h=_t.LINEAR.GAP,b=n/r,v=0.001,E=Math.max(b,0.001),T=m+p*E;d.clearRect(0,0,u,f);let S=Te("sys-color-primary",{fallback:"#6750A4"}),y=Te("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"});if(s){let q=a%2000/2000,Y=h*2+c/2,J=uo(q,[0.3665,0.6915]),w=co(q,[[0,-120],[0.2,0],[0.5915,83.6714]]),G=q<=0.5?0:uo(q,[0.8335,null,0.8335]),j=q<=0.5?-54.8889:co(q,[[0.5,-54.8889],[0.7,25.0389],[0.85,83.6714]]),xe=[{scale:J,translate:w,start:Math.max(m,m+p*w/100),end:Math.min(u-m,m+p*w/100+p*J)},{scale:G,translate:j,start:Math.max(m,m+p*j/100),end:Math.min(u-m,m+p*j/100+p*G)}].filter((ge)=>ge.end>ge.start).sort((ge,Ae)=>ge.start-Ae.start),ie=[];for(let ge=0;ge<xe.length;ge++){let Ae=xe[ge];if(ie.length===0)ie.push({...Ae});else{let ke=ie[ie.length-1];if(Ae.start<=ke.end+Y)ke.end=Math.max(ke.end,Ae.end);else ie.push({...Ae})}}_n(d,c,y);let Ze=c;if(ie.length===0)vt(d,m,u-m,C,!1,0,{amplitude:0,frequency:0,speed:0});else{let ge=ie[0].start;if(ge-m>Y+Ze)vt(d,m,ge-Y,C,!1,0,{amplitude:0,frequency:0,speed:0});if(ie.length===2){if(ie[1].start-ie[0].end>2*Y+Ze)vt(d,ie[0].end+Y,ie[1].start-Y,C,!1,0,{amplitude:0,frequency:0,speed:0})}let ke=ie[ie.length-1].end;if(u-m-ke>Y+Ze)vt(d,ke+Y,u-m,C,!1,0,{amplitude:0,frequency:0,speed:0})}_n(d,c,S);let Oe={amplitude:g?Bt(c,pe.LINEAR.INDETERMINATE_AMPLITUDE):0,frequency:pe.LINEAR.INDETERMINATE_FREQUENCY*2*Math.PI/100,speed:0};ie.forEach((ge)=>{vt(d,ge.start,ge.end,C,g,a,Oe)});return}let L=pe.LINEAR.START_TRANSITION_END,I=pe.LINEAR.END_TRANSITION_START,x=(h+c)/2;_n(d,c,y);let A=b===0?m+c+h:Math.min(T+x,u-m);vt(d,A,u-m,C,!1,0,{amplitude:0,frequency:0,speed:0}),_n(d,c,S);let N=b>=1?u-m:Math.max(m,T-x),R;if(b===0)R=m+(g?0.1:0);else{let H=c/2;R=Math.max(m+H,N)}let U=g?Bt(c,pe.LINEAR.AMPLITUDE):0;if(g){if(b===0&&L>0)U=0;else if(E<=L)U*=Math.pow(E/L,2);else if(E>=I)U*=Math.pow((1-E)/(1-I),2)}if(vt(d,m,R,C,g,a,{amplitude:U,frequency:pe.LINEAR.FREQUENCY*2*Math.PI/100,speed:pe.LINEAR.SPEED*2*Math.PI/1000}),i>0&&i>n){_n(d,c,Te("sys-color-secondary-container",{fallback:"#E8DEF8"}));let H=m+p*(i/r);vt(d,T,H,C,!1,0,{amplitude:0,frequency:0,speed:0})}if(b<1&&o){let H=Math.min(c*0.5,2);d.beginPath(),d.arc(u-m,C,H,0,2*Math.PI),d.fillStyle=S,d.fill()}};var fo=X(()=>{Pt();kt();sr()});var Rn=(e="thin")=>{if(typeof e==="number")return e;return e==="thick"?dt.THICK:dt.THIN},Bt=(e,t,n)=>{let i=1+0.3*(4-e)/(e+4),s=t*i;return n?Math.min(s,n):s},oi=(e,t,n,r)=>{let i=window.devicePixelRatio||1,s=Rn(r?.thickness),{ctx:a}=t;if(n){let o=Math.max(24,Math.min(r?.size??_t.CIRCULAR.SIZE,240)),l=0;if(r?.shape==="wavy"){let u=o/2-s/2,f=r?.indeterminate?pe.CIRCULAR.INDETERMINATE_AMPLITUDE:pe.CIRCULAR.AMPLITUDE,c=u*(f/100);l=Bt(s,c)}let d=o+l*2;e.style.width=e.style.height=`${d}px`,e.width=e.height=Math.round(d*i),t.width=t.height=d}else{let o=e.parentElement;if(!o)return;let l=Math.max(o.getBoundingClientRect().width||o.offsetWidth,200),d=0;if(r?.shape==="wavy"){let f=pe.LINEAR.AMPLITUDE,c=Bt(s,f);d=Math.ceil(c*2)}let u=s+d;e.style.width=`${l}px`,e.style.height=`${u}px`,e.width=Math.round(l*i),e.height=Math.round(u*i),t.width=l,t.height=u}a.setTransform(1,0,0,1,0,0),a.scale(i,i)},go=(e,t,n)=>{let r={canvas:e,ctx:e.getContext("2d"),width:0,height:0,pixelRatio:window.devicePixelRatio||1};return oi(e,r,t,n),r},po=(e)=>(t)=>{let r=e.variant===rr.CIRCULAR,i=document.createElement("canvas");i.className=`${t.getClass(ve.CONTAINER)}-canvas`,i.style.maxWidth="100%",i.style.maxHeight="100%",i.style.boxSizing="border-box",t.element.appendChild(i);let s=null,a=null,o=null,{thickness:l,shape:d}=e,u=e.size??_t.CIRCULAR.SIZE,f=e.value??0,c=f,C=0,g=()=>{try{return s=go(i,r,{...e,thickness:l,shape:d,size:u}),t.ctx=s.ctx,!0}catch(L){return console.warn("Canvas initialization failed:",L),!1}};if(!g())requestAnimationFrame(()=>{if(!g())setTimeout(g,100)});t.canvas=i,t.animationTime=0,t.animationId=null,t.wavyAnimationId=null,t.valueAnimationId=null,t.currentShape=d;let m=(L=0)=>{if(!t.state?.indeterminate)return;if(t.animationId)cancelAnimationFrame(t.animationId),t.animationId=null;let I=0,x=(A)=>{if(!t.state?.indeterminate){p();return}if(I===0)I=A-L;let N=A-I;t.animationTime=N,v(N),t.animationId=requestAnimationFrame(x)};t.animationId=requestAnimationFrame(x)},p=()=>{if(t.animationId)cancelAnimationFrame(t.animationId),t.animationId=null},h=(L=0)=>{if(t.wavyAnimationId)cancelAnimationFrame(t.wavyAnimationId),t.wavyAnimationId=null;let I=0,x=(A)=>{if(I===0)I=A-L;let N=A-I;t.animationTime=N,v(N),t.wavyAnimationId=requestAnimationFrame(x)};t.wavyAnimationId=requestAnimationFrame(x)},b=()=>{if(t.wavyAnimationId)cancelAnimationFrame(t.wavyAnimationId),t.wavyAnimationId=null},v=(L=0)=>{if(!s)return;let I=t.state,x=I?.value??e.value??0,A=I?.max??e.max??100,N=I?.buffer??e.buffer??0,R=I?.indeterminate??e.indeterminate??!1,U={...e,thickness:l,shape:d,size:u};oi(i,s,r,U);let H=R||!I?x:f;if(r)oo(s,U,H,A,R,L,d);else mo(s,U,H,A,N,R,L,!0,d)},E=()=>{if(!s)return;try{let L=go(i,r,{...e,thickness:l,shape:d,size:u});t.ctx=L.ctx,Object.assign(s,L),v()}catch(L){console.warn("Canvas resize failed:",L)}};a=On(t.element,i,()=>{if(t.element.offsetWidth>0||r)E()});let T=Te("sys-color-primary",{onThemeChange:v});o=typeof T==="function"?T:null;let S=()=>{if(!s){requestAnimationFrame(S);return}if(v(),t.state?.indeterminate)if(d==="wavy"||!r)h();else m();else if(d==="wavy")h()};requestAnimationFrame(S);let y=(L)=>{if(!s)return;let I={...e,thickness:l,shape:d,size:u,...L};oi(i,s,r,I),v()};if(t.setThickness=(L)=>{l=L,y({thickness:L})},t.setSize=(L)=>{if(!r)return;u=Math.max(24,Math.min(L,240)),y({size:u})},t.getSize=()=>r?u:void 0,t.setShape=(L)=>{if(d===L)return;if(d=L,t.currentShape=d,y({shape:L}),t.state?.indeterminate){let I=t.animationTime||0;if(b(),p(),L==="wavy"||!r)h(I);else m(I)}else if(L==="wavy"){if(!t.wavyAnimationId)h()}else b();v(t.animationTime||0)},t.setValue=(L,I=!0)=>{if(c=Math.max(0,Math.min(t.state.max,L)),t.state.indeterminate)t.setIndeterminate(!1);if(t.valueAnimationId&&I)return;if(t.valueAnimationId)cancelAnimationFrame(t.valueAnimationId),t.valueAnimationId=null;if(!I){if(f=c,v(),d==="wavy"&&!t.state.indeterminate&&!t.wavyAnimationId)h();if(c>=t.state.max)t.element.dispatchEvent(new CustomEvent("complete",{detail:{value:c,max:t.state.max}}));return}let x=f,A=performance.now(),N=A-C,R=300;if(N<300&&C>0)R=Math.max(100,N*0.9);C=A;let U=(H)=>{let q=H-A,Y=Math.min(q/R,1),J=Y<0.5?4*Y*Y*Y:1-Math.pow(-2*Y+2,3)/2;if(f=x+(c-x)*J,!t.wavyAnimationId||d!=="wavy")v(H);if(Y<1)t.valueAnimationId=requestAnimationFrame(U);else{if(f=c,t.valueAnimationId=null,d==="wavy"&&!t.state.indeterminate&&!t.wavyAnimationId)h();if(c>=t.state.max)t.element.dispatchEvent(new CustomEvent("complete",{detail:{value:c,max:t.state.max}}))}};t.valueAnimationId=requestAnimationFrame(U)},t.setIndeterminate=(L)=>{if(!t.state){console.warn("[Progress] No state available for setIndeterminate");return}if(t.state.indeterminate=L,L){if(t.valueAnimationId)cancelAnimationFrame(t.valueAnimationId),t.valueAnimationId=null;if(f=t.state.value,d==="wavy"||!r)h();else m()}else{if(f=t.state.value,p(),d==="wavy"){if(!t.wavyAnimationId)h()}else b();v()}},t.hide=()=>{t.element.classList.add(t.getClass(ve.TRANSITION)),t.element.style.opacity="0";let L=()=>{t.element.style.display="none",t.element.removeEventListener("transitionend",L)};return t.element.addEventListener("transitionend",L),[t.animationId,t.wavyAnimationId,t.valueAnimationId].forEach((I)=>{if(I)cancelAnimationFrame(I)}),t.animationId=t.wavyAnimationId=t.valueAnimationId=null,t},t.show=()=>{if(t.element.classList.add(t.getClass(ve.TRANSITION)),t.element.style.display="",t.element.style.opacity="0",t.element.offsetHeight,t.element.style.opacity="1",t.state?.indeterminate)if(d==="wavy"||!r)h();else m();else if(d==="wavy")h();return t},t.isVisible=()=>t.element.style.display!=="none"&&t.element.style.opacity!=="0",t.lifecycle){let L=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{if(a)a();if(o)o();[t.animationId,t.wavyAnimationId,t.valueAnimationId].forEach((I)=>{if(I)cancelAnimationFrame(I)}),L()}}return Object.assign(t,{startWavyAnimation:h,stopWavyAnimation:b,startIndeterminateAnimation:m,stopIndeterminateAnimation:p}),{...t,canvas:i,get ctx(){return s?.ctx},draw:v,resize:E}};var sr=X(()=>{Pt();kt();lo();fo()});var ho=(e)=>(t)=>{if(e.indeterminate&&t.element)ee(t.element,ve.INDETERMINATE),t.element.removeAttribute("aria-valuenow");if(t.element){let s=t.getClass?.(ve.CONTAINER)||"";t.element.classList.remove(`${s}--thin`,`${s}--thick`)}if(e.shape&&e.shape!==lt.FLAT&&t.element){if(!t.element.classList.contains(t.getClass?.(ve.CIRCULAR)||"")){let a=t.getClass?.(ve.CONTAINER)||"";ee(t.element,`${a}--${e.shape}`)}}let n={value:e.value??0,max:e.max??100,buffer:e.buffer??0,indeterminate:e.indeterminate===!0,thickness:e.thickness??"thin",shape:e.shape??lt.FLAT,labelFormatter:e.labelFormatter??((s,a)=>`${Math.round(s/a*100)}%`),showLabel:e.showLabel},r=t.lifecycle?.init,i=t.lifecycle?.destroy;return t.state=n,t.lifecycle={init:()=>{if(requestAnimationFrame(()=>{try{if(n.indeterminate)t.setIndeterminate?.(!0);else if(t.setValue?.(n.value),e.buffer!==void 0)t.setBuffer?.(n.buffer);if(n.shape!==lt.FLAT&&t.setShape)t.setShape(n.shape);if(n.thickness)if(t.setThickness)t.setThickness(n.thickness);else t.state.thickness=n.thickness}catch(s){console.error("Error initializing progress state:",s)}}),r)r()},destroy:()=>{if(i)i()}},{...t,state:n}};var Co=X(()=>{Pt();en()});var Eo=(e)=>(t)=>{let{element:n,getClass:r,canvas:i}=t,s=n.classList.contains(r(ve.CIRCULAR)),a=(u,f)=>{n.dispatchEvent(new CustomEvent(u,{detail:f}))},o=(u,f)=>{n.setAttribute("aria-valuenow",u.toString());let c=t.label;if(c){let C=e.label?.formatter||((g,m)=>`${Math.round(g/m*100)}%`);c.textContent=C(u,f)}if(typeof t.draw==="function")t.draw()},l=(u)=>{if(u){if(ee(n,ve.INDETERMINATE),n.removeAttribute("aria-valuenow"),!s){if((e.shape?.getShape()||lt.FLAT)!=="wavy"&&t.startIndeterminateAnimation)t.startIndeterminateAnimation()}}else if(Ce(n,ve.INDETERMINATE),t.stopIndeterminateAnimation)t.stopIndeterminateAnimation();if(typeof t.draw==="function")t.draw()};if(e.state.isIndeterminate())l(!0);let d={element:n,track:i,indicator:i,buffer:i,getClass:r,getValue(){return e.value.getValue()},setValue(u,f=!0){let c=e.value.getValue(),C=e.value.getMax();if(e.value.setValue(u),c!==u){n.setAttribute("aria-valuenow",u.toString());let g=t.label;if(g){let p=e.label?.formatter||((h,b)=>`${Math.round(h/b*100)}%`);g.textContent=p(u,C)}let m={value:u,max:C};if(a(no.CHANGE,m),t.setValue&&typeof t.setValue==="function")t.setValue(u,f);else o(u,C)}return d},getMax(){return e.value.getMax()},getBuffer:()=>e.buffer.getBuffer(),setBuffer(u){if(e.buffer.setBuffer(u),!e.state.isIndeterminate()&&typeof t.draw==="function")t.draw();return d},setIndeterminate(u){if(e.state.isIndeterminate()===u)return d;return e.state.setIndeterminate(u),l(u),d},isIndeterminate:()=>e.state.isIndeterminate(),showLabel(){if(e.label?.show)e.label.show();return d},hideLabel(){if(e.label?.hide)e.label.hide();return d},setLabelFormatter(u){if(e.label?.format)e.label.format(u);let f=t.label||t.state?.label;if(f)f.textContent=u(e.value.getValue(),e.value.getMax());return d},getThickness(){return e.thickness?.getThickness()||dt.THIN},setThickness(u){if(e.thickness)e.thickness.setThickness(u);if(t.setThickness)t.setThickness(u);return d},getShape(){if(e.shape&&typeof e.shape.getShape==="function")return e.shape.getShape();return lt.FLAT},setShape(u){return t.setShape?.(u),d},setSize(u){if(t.setSize)t.setSize(u);return d},getSize(){return t.getSize?t.getSize():void 0},enable(){return e.disabled.enable(),d},disable(){return e.disabled.disable(),d},isDisabled:e.disabled.isDisabled,hide(){if(t.hide)t.hide();return d},show(){if(t.show)t.show();return d},isVisible(){return t.isVisible?t.isVisible():n.style.display!=="none"},on(u,f){return n.addEventListener(u,f),d},off(u,f){return n.removeEventListener(u,f),d},addClass(...u){return u.forEach((f)=>n.classList.add(f)),d},painted(){return new Promise((u)=>requestAnimationFrame(()=>requestAnimationFrame(()=>u())))},destroy(){e.lifecycle.destroy()},disabled:{enable(){e.disabled.enable()},disable(){e.disabled.disable()},isDisabled:e.disabled.isDisabled},lifecycle:{destroy(){e.lifecycle.destroy()}}};if(t.state?.showLabel===!0){if(e.label?.show)e.label.show()}return d};var bo=X(()=>{Pt();en()});var Qm,vo=(e={})=>_(Qm,e,"progress"),To=(e)=>{let t=e.indeterminate===!0,n=e.variant===rr.CIRCULAR,r={role:"progressbar","aria-valuemin":"0","aria-valuemax":(e.max||100).toString()};if(!t&&e.value!==void 0)r["aria-valuenow"]=e.value.toString();if(e.disabled===!0)r["aria-disabled"]="true";let i=[e.class,ve.CONTAINER,n?ve.CIRCULAR:ve.LINEAR].filter(Boolean);if(!n&&e.shape&&e.shape!==lt.FLAT)i.push(`${ve.CONTAINER}--${e.shape}`);return V(e,{tag:"div",attributes:r,className:i})},So=(e)=>{if(!e.state)e.state={value:0,max:100,buffer:0,indeterminate:!1,thickness:"thin",shape:Ct.SHAPE,labelFormatter:(t,n)=>`${Math.round(t/n*100)}%`};return{value:{getValue:()=>e.state.value,setValue:(t)=>{if(e.state){let n=Math.max(0,Math.min(e.state.max,t));if(e.state.previousValue=e.state.value,e.state.value=n,e.state.label)e.state.label.textContent=e.state.labelFormatter(n,e.state.max);if(typeof e.setValue==="function")e.setValue(n);else if(e.draw)e.draw()}},getMax:()=>e.state.max},buffer:{getBuffer:()=>e.state.buffer,setBuffer:(t)=>{e.state.buffer=Math.max(0,Math.min(e.state.max,t))}},disabled:{enable:()=>e.disabled?.enable?.()||void 0,disable:()=>e.disabled?.disable?.()||void 0,isDisabled:()=>e.disabled?.isDisabled?.()||!1},label:{show:()=>{if(!e.state.label){let t=document.createElement("div");t.className=`${e.getClass(ve.LABEL)}`,t.textContent=e.state.labelFormatter(e.state.value,e.state.max),e.element.appendChild(t),e.state.label=t,e.label=t}},hide:()=>{if(e.state.label)e.state.label.remove(),e.state.label=void 0,e.label=void 0},format:(t)=>{e.state.labelFormatter=t},formatter:e.state.labelFormatter},thickness:{getThickness:()=>{let t=e.state.thickness;if(t==="thin")return dt.THIN;else if(t==="thick")return dt.THICK;else if(typeof t==="number")return t;return dt.THIN},setThickness:(t)=>{if(e.state.thickness=t,e.draw)e.draw()}},shape:{getShape:()=>e.state.shape,setShape:(t)=>{if(e.state.shape=t,e.setShape)e.setShape(t)}},state:{setIndeterminate:(t)=>{if(e.state){if(e.state.indeterminate=t,typeof e.setIndeterminate==="function")e.setIndeterminate(t);else if(e.draw)e.draw()}},isIndeterminate:()=>e.state.indeterminate},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()||void 0}}};var yo=X(()=>{ne();Pt();Qm={variant:Ct.VARIANT,value:Ct.VALUE,max:Ct.MAX,buffer:Ct.BUFFER,showLabel:Ct.SHOW_LABEL,thickness:"thin",shape:Ct.SHAPE}});var Jm=(e={})=>{let t=vo(e);try{let n=M(D,k(),O(To(t)),oe(t),de(t),ho(t),po(t),(r)=>Eo(So(r))(r),P())(t);if(n.lifecycle?.init)n.lifecycle.init();return n}catch(n){throw console.error("Progress creation error:",n),Error(`Failed to create progress: ${n.message}`)}},Pn;var li=X(()=>{se();te();re();sr();Co();bo();yo();Pn=Jm});var ef=async(e)=>{await Promise.resolve().then(() => li());return Pn(e)},xo=(e)=>(t)=>{if(!e.progress)return t;let n={},r=typeof e.progress==="boolean"?{variant:"circular",size:20,thickness:2,indeterminate:!0}:(()=>{let{on:u,...f}=e.progress;if(u)n=u;return{variant:"circular",size:20,thickness:2,indeterminate:!0,...f}})(),i=null,s=null,a=!1,o="",l=async()=>{if(i)return i;if(!s)s=ef(r).then((u)=>(i=u,ee(i.element,t.getClass("button-progress")),i.element.style.display="none",Object.entries(n).forEach(([f,c])=>{i.on(f,c)}),t.progress=i,i));return s},d=()=>{let u=t.element.querySelector(`.${t.getClass("button-icon")}`);if(u&&u.nextSibling)return u.nextSibling;return t.element.firstChild};if(t.showProgress=async function(){let u=await l();if(u.element){if(!t.element.contains(u.element)){let c=d();if(c)t.element.insertBefore(u.element,c);else t.element.appendChild(u.element)}u.element.style.display="",ee(t.element,`${t.getClass("button")}--progress`);let f=t.element.querySelector(`.${t.getClass("button-icon")}`);if(f instanceof HTMLElement)f.style.display="none"}return t},t.showProgressSync=function(){return t.showProgress(),t},t.hideProgress=async function(){if(!i)return t;i.element.style.display="none",Ce(t.element,`${t.getClass("button")}--progress`);let u=t.element.querySelector(`.${t.getClass("button-icon")}`);if(u instanceof HTMLElement)u.style.display="";return t},t.hideProgressSync=function(){return t.hideProgress(),t},t.setProgress=async function(u){return(await l()).setValue(u),t},t.setProgressSync=function(u){return t.setProgress(u),t},t.setIndeterminate=async function(u){return(await l()).setIndeterminate(u),t},t.setIndeterminateSync=function(u){return t.setIndeterminate(u),t},t.setLoading=async function(u,f){if(u&&!a){if(t.setText&&t.getText)o=t.getText();if(a=!0,await t.showProgress(),t.disabled?.disable)t.disabled.disable();if(f&&t.setText)t.setText(f)}else if(!u&&a){if(a=!1,await t.hideProgress(),t.disabled?.enable)t.disabled.enable();if(f&&t.setText)t.setText(f);else if(o&&t.setText)t.setText(o)}return t},t.setLoadingSync=function(u,f){return t.setLoading(u,f),t},t.lifecycle){let u=t.lifecycle.destroy;t.lifecycle.destroy=()=>{if(i)i.destroy();if(i&&i.element.parentNode)i.element.parentNode.removeChild(i.element);u()}}if(e.showProgress)l().then(()=>{t.showProgress()});return t};var Io=X(()=>{en()});var Lo=(e)=>(t)=>{if(!e.toggle)return t;let{element:n}=t,r=t.getClass("button"),i=!1,s=(a)=>{i=a,n.classList.toggle(`${r}--selected`,a),n.setAttribute("aria-pressed",String(a))};if(n.classList.add(`${r}--toggle`),s(e.selected===!0),e.toggleOnClick!==!1)n.addEventListener("click",()=>{if(n.disabled)return;s(!i),t.emit?.("change",{selected:i})});return{...t,toggle:{setSelected:(a)=>{if(a!==i)s(a)},isSelected:()=>i}}};var Ao=(e={},t={})=>{let n={...e},r=Re(),i=new Map,s=t.middleware||[],a=(l,d)=>{r.emit("change",l,d)},o=(l,d)=>s.reduce((u,f)=>f(u,d),l);return{getState:()=>{let l={};return i.forEach((d,u)=>{l[u]=d(n)}),{...n,...l}},setState:(l)=>{let d={...n},u=typeof l==="function"?l(n):{...n,...l};n=o(u,d),a(n,d)},subscribe:(l)=>r.on("change",l),derive:(l,d)=>(i.set(l,d),()=>{i.delete(l)}),select:(l)=>l(n),reset:()=>{n={...e},a(n,{})}}},wo=(e,t)=>(console.log("State change:",{old:t,new:e,diff:Object.keys(e).reduce((n,r)=>{if(e[r]!==t[r])n[r]={from:t[r],to:e[r]};return n},{})}),e),No=(e)=>(t)=>Object.keys(t).reduce((n,r)=>{if(e(t[r],r))n[r]=t[r];return n},{});var Do=()=>{};var Mo=(e,t={})=>{let n=!1,r=Re();return{onMount:(i)=>r.on("mount",i),onUnmount:(i)=>r.on("unmount",i),mount:()=>{if(!n)n=!0,r.emit("mount")},unmount:()=>{if(n)n=!1,r.emit("unmount"),r.clear()},isMounted:()=>n,destroy(){if(n)this.unmount();if(t.events)t.events.destroy();if(t.text){let i=t.text.getElement();if(i)i.remove()}if(t.icon){let i=t.icon.getElement();if(i)i.remove()}if(e)e.remove()}}};var Oo=()=>{};var Ro=(e)=>({enable(){return e.disabled=!1,e.removeAttribute("disabled"),this},disable(){return e.disabled=!0,e.setAttribute("disabled","true"),this},toggle(){if(e.disabled)this.enable();else this.disable();return this},isDisabled(){return e.disabled===!0}});var di=(e,t,n,r,i,s)=>{if(r<0||i<0)return;let a=typeof s==="number"?[s,s,s,s]:s,[o,l,d,u]=a;e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-l,n),e.quadraticCurveTo(t+r,n,t+r,n+l),e.lineTo(t+r,n+i-d),e.quadraticCurveTo(t+r,n+i,t+r-d,n+i),e.lineTo(t+u,n+i),e.quadraticCurveTo(t,n+i,t,n+i-u),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath()},tf=(e,t,n,r,i,s,a)=>{if(e.save(),a)e.fillStyle=a;di(e,t,n,r,i,s),e.fill(),e.restore()},ui=(e,t,n,r,i,s)=>(e.save(),di(e,t,n,r,i,s),e.clip(),()=>e.restore()),ci=(e,t,n,r,i,s,a,o)=>{if(r<0||i<0)return;if(e.save(),o)e.fillStyle=o;e.beginPath(),e.moveTo(t+s,n),e.lineTo(t+r-a,n),e.quadraticCurveTo(t+r,n,t+r,n+a),e.lineTo(t+r,n+i-a),e.quadraticCurveTo(t+r,n+i,t+r-a,n+i),e.lineTo(t+s,n+i),e.quadraticCurveTo(t,n+i,t,n+i-s),e.lineTo(t,n+s),e.quadraticCurveTo(t,n,t+s,n),e.closePath(),e.fill(),e.restore()},mi=(e,t,n,r)=>{if(r)e.fillStyle=r,e.fillRect(0,0,t,n);else e.clearRect(0,0,t,n)};var ar=(e)=>{let s=e;for(let f=0;f<4;f++){let m=s*s,h=1.6*(m*s)+-1.8000000000000003*m+1.2000000000000002*s-e,b=4.800000000000001*m+-3.6000000000000005*s+1.2000000000000002;if(Math.abs(h)<0.00001)break;s=s-h/b}let a=0,o=3-a,l=1-a-o,d=s*s,u=d*s;return l*u+o*d+a*s},fi,nf;var _o=X(()=>{fi={SHORT:100,MEDIUM:225,LONG:375,EXTRA_LONG:500},nf={linear:(e)=>e,easeIn:(e)=>e*e,easeOut:(e)=>e*(2-e),easeInOut:(e)=>e<0.5?2*e*e:-1+(4-2*e)*e,materialStandard:ar}});class Po{animationId=null;start(e){this.stop();let t=(n)=>{e(n),this.animationId=requestAnimationFrame(t)};this.animationId=requestAnimationFrame(t)}stop(){if(this.animationId!==null)cancelAnimationFrame(this.animationId),this.animationId=null}get isRunning(){return this.animationId!==null}}class ko{cleanupFunctions=[];add(e){if(e)this.cleanupFunctions.push(e)}cleanup(){this.cleanupFunctions.forEach((e)=>e()),this.cleanupFunctions=[]}}var gi=(e,t,n)=>{let r=window.devicePixelRatio||1,i=e.getContext("2d");return e.style.width=`${t}px`,e.style.height=`${n}px`,e.width=Math.round(t*r),e.height=Math.round(n*r),i.setTransform(1,0,0,1,0,0),i.scale(r,r),{canvas:e,ctx:i,width:t,height:n,pixelRatio:r}},pi=(e,t,n)=>{let{canvas:r,ctx:i,pixelRatio:s}=e;r.style.width=`${t}px`,r.style.height=`${n}px`,r.width=Math.round(t*s),r.height=Math.round(n*s),e.width=t,e.height=n,i.setTransform(1,0,0,1,0,0),i.scale(s,s)},hi=(e,t)=>{if(e())return t?.(),!0;return requestAnimationFrame(()=>{if(e())t?.();else setTimeout(()=>{if(e())t?.()},100)}),!1},or=(e,t)=>{let n=Te(`sys-color-${e}`,{onThemeChange:t});return typeof n==="function"?n:null},Ci=(e,t={})=>{let n=document.createElement("canvas");return n.className=e,Object.assign(n.style,{position:"absolute",width:"100%",height:"100%",pointerEvents:"none",...t}),n};var Bo=X(()=>{kt()});var lr=X(()=>{_o();Bo()});var tn=X(()=>{ne();Do();Oo();nt();ri();kt();se();en();lr();lr()});var Ho=({disabled:e,lifecycle:t})=>(n)=>{let r={setText:(a)=>(n.text.setText(a),r),getText:()=>n.text.getText(),getElement:()=>n.text.getElement()},i={setIcon:(a)=>(n.icon.setIcon(a),i),getIcon:()=>n.icon.getIcon(),getElement:()=>n.icon.getElement()},s={element:n.element,text:r,icon:i,disabled:e,lifecycle:t,getClass:n.getClass,on:(a,o)=>{if(n.on)n.on(a,o);return s},off:(a,o)=>{if(n.off)n.off(a,o);return s},addClass:(...a)=>{if(n.addClass)n.addClass(...a);else ee(n.element,...a);return s},getValue:()=>n.element.value,setValue(a){return n.element.value=a,s},enable(){return e.enable(),s},disable(){return e.disable(),s},setText(a){return n.text.setText(a),s},getText(){return n.text.getText()},hasIcon(){let a=n.icon.getElement();return!!a&&!!a.innerHTML.trim()&&!!a.parentNode},setIcon(a){let o=n.componentName||"button",l=n.getClass(o);if(!a){let d=n.icon.getElement();if(d&&d.parentNode)d.parentNode.removeChild(d),n.icon.getElement=()=>null,n.icon.getIcon=()=>"";n.element.classList.remove(`${l}--icon`)}else if(!s.hasIcon()){let d=document.createElement("span");if(d.className=`${n.getClass("button-icon")}`,d.innerHTML=a,n.element.firstChild)n.element.insertBefore(d,n.element.firstChild);else n.element.appendChild(d);n.icon.getElement=()=>d,n.icon.getIcon=()=>a,n.element.classList.add(`${l}--icon`)}else{let d=n.icon.getElement();if(d)d.innerHTML=a}return s},getIcon(){return s.hasIcon()?n.icon.getIcon():""},setVariant(a){let o=n.componentName||"button",l=n.getClass(o);return["filled","tonal","outlined","elevated","text"].map((u)=>`${l}--${u}`).forEach((u)=>{n.element.classList.remove(u)}),n.element.classList.add(`${l}--${a}`),s},getVariant(){let a=n.componentName||"button",o=n.getClass(a),l=["filled","tonal","outlined","elevated","text"];for(let d of l)if(n.element.classList.contains(`${o}--${d}`))return d;return"filled"},getSize(){let a=n.componentName||"button",o=n.getClass(a),l=["xs","s","m","l","xl"];for(let d of l)if(n.element.classList.contains(`${o}--${d}`))return d;return"s"},setSize(a){let o=n.componentName||"button",l=n.getClass(o);return["xs","s","m","l","xl"].map((u)=>`${l}--${u}`).forEach((u)=>{n.element.classList.remove(u)}),n.element.classList.add(`${l}--${a}`),s},getShape(){let a=n.componentName||"button",o=n.getClass(a),l=["round","square"];for(let d of l)if(n.element.classList.contains(`${o}--${d}`))return d;return"round"},setShape(a){let o=n.componentName||"button",l=n.getClass(o);return["round","square"].map((u)=>`${l}--${u}`).forEach((u)=>{n.element.classList.remove(u)}),n.element.classList.add(`${l}--${a}`),s},setActive(a){if(a)n.element.classList.add(`${n.getClass("button")}--active`);else n.element.classList.remove(`${n.getClass("button")}--active`);return s},setSelected(a){return n.toggle?.setSelected(a),s},isSelected:()=>n.toggle?.isSelected()??!1,setAriaLabel(a){return n.element.setAttribute("aria-label",a),s},destroy(){t.destroy()}};if(n.progress)s.progress=n.progress;if(n.showProgress)s.showProgress=async()=>(await n.showProgress(),s);if(n.showProgressSync)s.showProgressSync=()=>(n.showProgressSync(),s);if(n.hideProgress)s.hideProgress=async()=>(await n.hideProgress(),s);if(n.hideProgressSync)s.hideProgressSync=()=>(n.hideProgressSync(),s);if(n.setProgress)s.setProgress=async(a)=>(await n.setProgress(a),s);if(n.setProgressSync)s.setProgressSync=(a)=>(n.setProgressSync(a),s);if(n.setIndeterminate)s.setIndeterminate=async(a)=>(await n.setIndeterminate(a),s);if(n.setIndeterminateSync)s.setIndeterminateSync=(a)=>(n.setIndeterminateSync(a),s);if(n.setLoading)s.setLoading=async(a,o)=>(await n.setLoading(a,o),s);if(n.setLoadingSync)s.setLoadingSync=(a,o)=>(n.setLoadingSync(a,o),s);return s};var $o=X(()=>{tn()});var Vo,Fo,Uo,Go,dr;var zo=X(()=>{Vo={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",ELEVATED:"elevated",TEXT:"text"},Fo={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},Uo={ROUND:"round",SQUARE:"square"},Go={BUTTON:"button",SUBMIT:"submit",RESET:"reset"},dr={DURATION:450,TIMING:"cubic-bezier(0.4, 0.0, 0.2, 1)",OPACITY:["0.7","0"]}});var rf,Wo=(e={})=>_(rf,e,"button"),Ko=(e)=>{let t={type:e.type||"button"};if(e.disabled===!0)t.disabled=!0;if(e.value!==void 0)t.value=e.value;if(e.ariaLabel)t["aria-label"]=e.ariaLabel;return V(e,{tag:"button",attributes:t,className:e.class,forwardEvents:{click:(n)=>!n.element.disabled,focus:!0,blur:!0}})},Yo=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable(),isDisabled:()=>e.disabled.isDisabled()},lifecycle:{destroy:()=>e.lifecycle.destroy()}});var Xo=X(()=>{ne();zo();rf={variant:Vo.FILLED,size:Fo.S,shape:Uo.ROUND,disabled:!1,type:Go.BUTTON,ripple:!0,rippleConfig:{duration:dr.DURATION,timing:dr.TIMING,opacity:dr.OPACITY}}});var sf=(e={})=>{let t=Wo(e);try{return M(D,k(),O(Ko(t)),oe(t),Mt(t),ot(t),Be(t),de(t),Lo(t),xo(t),we(t),P(),(r)=>{if(t.shape&&r.element){let i=`${t.prefix}-${t.componentName}--${t.shape}`;r.element.classList.add(i)}return r},(r)=>Ho(Yo(r))(r))(t)}catch(n){throw console.error("Button creation error:",n),Error(`Failed to create button: ${n.message}`)}},He;var qo=X(()=>{se();te();re();Io();$o();Xo();He=sf});var Ht=X(()=>{qo()});var Up={};Lm(Up,{ANIMATION_DURATIONS:()=>fi,AnimationFrameManager:()=>Po,COMPONENTS:()=>Kr,CleanupManager:()=>ko,EASING_FUNCTIONS:()=>nf,PREFIX:()=>K,STATES:()=>Yr,addClass:()=>ee,batchAttributes:()=>ca,byString:()=>si,classNames:()=>Ca,clearCanvas:()=>mi,clearGlobalDefaults:()=>ni,clipRoundedRect:()=>ui,compose:()=>oa,createBadge:()=>Dn,createBase:()=>D,createBottomAppBar:()=>eo,createButton:()=>He,createButtonGroup:()=>bi,createCanvasContext:()=>gi,createCanvasThemeObserver:()=>or,createCard:()=>vi,createCardActions:()=>kn,createCardContent:()=>cr,createCardHeader:()=>mr,createCardMedia:()=>Bn,createCarousel:()=>Oi,createCheckbox:()=>_i,createChip:()=>sn,createChips:()=>$i,createComponent:()=>da,createComponentConfig:()=>_,createDatePicker:()=>Fi,createDialog:()=>Ui,createDisabled:()=>Ro,createDivider:()=>Vt,createDrawer:()=>Ki,createElement:()=>B,createElementConfig:()=>V,createEmitter:()=>Re,createEventManager:()=>to,createExtendedFab:()=>Dr,createFab:()=>Nr,createIconButton:()=>nn,createLifecycle:()=>Mo,createList:()=>qi,createMenu:()=>Fn,createNavigation:()=>cn,createNavigationSystem:()=>Pu,createProgress:()=>Pn,createRadios:()=>ss,createRoundedRectPath:()=>di,createSVGElement:()=>va,createSearch:()=>ms,createSegment:()=>Pr,createSegmentedButton:()=>kr,createSelect:()=>Is,createSheet:()=>_s,createSlider:()=>Gs,createSnackbar:()=>zs,createStateEventManager:()=>er,createStore:()=>Ao,createStyledCanvas:()=>Ci,createSwitch:()=>Ks,createTab:()=>En,createTabs:()=>Qc,createTextfield:()=>Un,createTimePicker:()=>Xs,createTooltip:()=>qs,createTopAppBar:()=>dm,debounce:()=>Qt,deriveFiltered:()=>No,easeOutCubic:()=>ar,fillRoundedRect:()=>tf,fillRoundedRectLR:()=>ci,getAttribute:()=>fa,getComponentClass:()=>ga,getComponentDefaults:()=>Nn,getElementClass:()=>ha,getInheritedBackground:()=>Et,getModifierClass:()=>pa,hasAttribute:()=>ma,hasClass:()=>rt,hasEmit:()=>ht,hasLifecycle:()=>pt,hasTouchSupport:()=>We,initializeCanvasWithRetry:()=>hi,isObject:()=>ii,joinClasses:()=>so,loggingMiddleware:()=>wo,normalizeClasses:()=>qt,normalizeEvent:()=>Je,observeCanvasResize:()=>On,once:()=>tr,pipe:()=>M,removeAttributes:()=>ua,removeClass:()=>Ce,setAttributes:()=>Sn,setComponentDefaults:()=>ei,setGlobalDefaults:()=>ti,throttle:()=>Zt,toggleClass:()=>Qn,transform:()=>la,updateCanvasDimensions:()=>pi,when:()=>io,withCheckable:()=>Rt,withDebounce:()=>Qr,withDisabled:()=>de,withElement:()=>O,withEnhancedEvents:()=>jr,withEvents:()=>k,withIcon:()=>Be,withInput:()=>Ot,withLifecycle:()=>P,withPosition:()=>In,withRipple:()=>we,withSize:()=>Mt,withStyle:()=>qr,withText:()=>ot,withTextInput:()=>Ln,withTextLabel:()=>et,withThrottle:()=>Zr,withTrack:()=>An,withVariant:()=>oe});module.exports=ym(Up);se();te();re();ne();var Pa={SMALL:"small",LARGE:"large"},ka={ERROR:"error",PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",SUCCESS:"success",WARNING:"warning",INFO:"info"},Ba={TOP_RIGHT:"top-right",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left"},nr=4;var Fm={variant:Pa.LARGE,color:ka.ERROR,position:Ba.TOP_RIGHT,label:"",visible:!0},Ha=(e={})=>_(Fm,e,"badge"),$a=(e)=>{let t={};if(e.variant!=="small")t.role="status";let n=e.variant==="small"?"":Jt(e.label||"",e.max);return V(e,{tag:"span",attributes:t,className:e.class,text:n})},Va=(e)=>({visibility:{show:()=>e.visibility.show(),hide:()=>e.visibility.hide(),toggle:(t)=>e.visibility.toggle(t),isVisible:()=>e.visibility.isVisible()},lifecycle:{destroy:()=>e.lifecycle.destroy()}}),Jt=(e,t)=>{if(e===void 0||e===null||e==="")return"";let n=String(e),r=Number(e);if(t!==void 0&&!isNaN(r)&&r>t)n=`${t}+`;if(n.length>nr){let i=Number(e);if(!isNaN(i))if(i>=1000)n="999+";else n=n.substring(0,nr-1)+"+";else n=n.substring(0,nr)}return n};var Fa="small",Um="large",Gm="error",zm="top-right",Ua=()=>(e)=>{if(e.config.visible===!1)e.element.classList.add(`${e.getClass("badge")}--invisible`);return{...e,visibility:{show(){e.element.classList.remove(`${e.getClass("badge")}--invisible`)},hide(){e.element.classList.add(`${e.getClass("badge")}--invisible`)},toggle(n){if(n===void 0)e.element.classList.toggle(`${e.getClass("badge")}--invisible`);else if(n)this.show();else this.hide()},isVisible(){return!e.element.classList.contains(`${e.getClass("badge")}--invisible`)}}}},Ga=(e)=>(t)=>{let n=e.variant||Um;if(t.element.classList.add(`${t.getClass("badge")}--${n}`),n===Fa)t.element.textContent="",t.element.setAttribute("aria-hidden","true");else if(t.element.setAttribute("role","status"),e.label!==void 0&&e.label!==""){let r=Jt(e.label,e.max);t.element.textContent=r}return t},za=(e)=>(t)=>{let n=e.color||Gm;return t.element.classList.add(`${t.getClass("badge")}--${n}`),t},Wa=(e)=>(t)=>{let n=e.position||zm;if(t.element.classList.add(`${t.getClass("badge")}--${n}`),e.target)t.element.classList.add(`${t.getClass("badge")}--positioned`);return t},Ka=(e)=>(t)=>{if(e.max===void 0||e.variant===Fa)return t;if(t.config.max=e.max,e.label!==void 0&&e.label!==""){let n=Jt(e.label,e.max);if(t.element.textContent=n,typeof e.label==="number"&&e.label>e.max)t.element.classList.add(`${t.getClass("badge")}--overflow`)}return t},Ya=(e)=>(t)=>{if(!e.target)return t;let n=document.createElement("div");n.classList.add(t.getClass("badge-wrapper")),n.style.position="relative";let r=e.target.parentNode;if(r)r.replaceChild(n,e.target),n.appendChild(e.target),n.appendChild(t.element),t.wrapper=n;return t};var Xa="small",Wm=["error","primary","secondary","tertiary","success","warning","info"],Km=["small","large"],Ym=["top-right","top-left","bottom-right","bottom-left"],qa=({visibility:e,lifecycle:t})=>(n)=>{let r={element:n.element,wrapper:n.wrapper,getClass:n.getClass,setLabel(i){if(n.config.label=i,n.config.variant===Xa)return n.element.textContent="",r;let s=Jt(i,n.config.max);if(n.element.textContent=s,n.element.classList.remove(`${n.getClass("badge")}--overflow`),typeof i==="number"&&n.config.max!==void 0&&i>n.config.max)n.element.classList.add(`${n.getClass("badge")}--overflow`);if(s===""||s==="0")r.hide();else r.show();return r},getLabel(){return n.element.textContent||""},setContent(i){return r.setLabel(i)},getContent(){return r.getLabel()},show(){return e.show(),r},hide(){return e.hide(),r},toggle(i){return e.toggle(i),r},isVisible(){return e.isVisible()},setMax(i){if(n.config.max=i,n.config.label!==void 0)r.setLabel(n.config.label);return r},setColor(i){return Wm.forEach((s)=>{n.element.classList.remove(`${n.getClass("badge")}--${s}`)}),n.element.classList.add(`${n.getClass("badge")}--${i}`),r},setVariant(i){if(Km.forEach((s)=>{n.element.classList.remove(`${n.getClass("badge")}--${s}`)}),n.element.classList.add(`${n.getClass("badge")}--${i}`),n.config.variant=i,i===Xa)n.element.textContent="",n.element.setAttribute("aria-hidden","true");else if(n.element.setAttribute("role","status"),n.config.label!==void 0)r.setLabel(n.config.label);return r},setPosition(i){return Ym.forEach((s)=>{n.element.classList.remove(`${n.getClass("badge")}--${s}`)}),n.element.classList.add(`${n.getClass("badge")}--${i}`),r},attachTo(i){if(n.wrapper&&n.wrapper.contains(n.element))n.wrapper.removeChild(n.element);let s=document.createElement("div");s.classList.add(n.getClass("badge-wrapper")),s.style.position="relative";let a=i.parentNode;if(a)a.replaceChild(s,i),s.appendChild(i),s.appendChild(n.element),n.element.classList.add(`${n.getClass("badge")}--positioned`),n.wrapper=s,r.wrapper=s;return r},detach(){if(n.wrapper&&n.wrapper.contains(n.element))n.wrapper.removeChild(n.element),n.element.classList.remove(`${n.getClass("badge")}--positioned`),document.body.appendChild(n.element),n.wrapper=void 0,r.wrapper=void 0;return r},destroy(){if(t.destroy(),n.wrapper){let i=n.wrapper.firstChild,s=n.wrapper.parentNode;if(s&&i)s.replaceChild(i,n.wrapper)}},addClass:(...i)=>(n.addClass(...i),r),removeClass:(...i)=>(n.removeClass(...i),r),on:(i,s)=>(n.on(i,s),r),off:(i,s)=>(n.off(i,s),r)};return r};var Xm=(e={})=>{let t=Ha(e);try{return M(D,k(),O($a(t)),Ga(t),za(t),Wa(t),Ka(t),Ua(),Ya(t),P(),(r)=>qa(Va(r))(r))(t)}catch(n){throw console.error("Badge creation error:",n),Error(`Failed to create badge: ${n.message}`)}},Dn=Xm;se();ne();var ja={CENTER:"center",END:"end"},Za=300;var qm={tag:"div",hasFab:!1,fabPosition:ja.END,autoHide:!1,transitionDuration:Za},Qa=(e={})=>_(qm,e,"bottom-app-bar");var Ja=(e={})=>{let t=Qa(e),n=D(t),r=document.createElement("div");r.className=`${n.getClass("bottom-app-bar")}-actions`;let i=document.createElement("div");i.className=`${n.getClass("bottom-app-bar")}-fab-container`;let s=O({tag:t.tag,componentName:"bottom-app-bar",className:[t.hasFab?`${n.getClass("bottom-app-bar")}--with-fab`:"",t.fabPosition==="center"?`${n.getClass("bottom-app-bar")}--fab-center`:"",t.class],attributes:{role:"toolbar","aria-label":"Bottom app bar"},interactive:!0})(n),a=k()(s),o=P()(a);o.element.appendChild(r),o.element.appendChild(i);let l=!0,d=window.scrollY;if(t.autoHide){let f=()=>{let C=window.scrollY;if(C>d+10){if(l)u.hide(),t.onVisibilityChange?.(!1)}else if(C<d-10){if(!l)u.show(),t.onVisibilityChange?.(!0)}d=C};window.addEventListener("scroll",f,{passive:!0});let c=o.lifecycle.destroy;o.lifecycle.destroy=()=>{window.removeEventListener("scroll",f),c()}}let u={...o,addAction(f){return r.appendChild(f),this},addFab(f){return i.innerHTML="",i.appendChild(f),this.element.classList.add(`${n.getClass("bottom-app-bar")}--with-fab`),this},show(){return this.element.classList.remove(`${n.getClass("bottom-app-bar")}--hidden`),l=!0,this},hide(){return this.element.classList.add(`${n.getClass("bottom-app-bar")}--hidden`),l=!1,this},isVisible(){return l},getActionsContainer(){return r}};if(t.autoHide&&t.transitionDuration)u.element.style.transition=`transform ${t.transitionDuration}ms ease-in-out`;return u};var eo=Ja;Ht();te();re();se();te();re();var jo=(e)=>(t)=>{if(!e.toggle)return{...t,toggleState:{select:function(){return this},deselect:function(){return this},toggle:function(){return this},isSelected:()=>!1,isToggle:()=>!1,setIcon:function(){return this},setSelectedIcon:function(){return this},getSelectedIcon:()=>""}};let n=e.prefix||"mtrl",r=e.componentName||"icon-button",i=`${n}-${r}--selected`,s=e.selected||!1,a=e.icon||"",o=e.selectedIcon||"",l=()=>{if(!t.icon)return;let g=s&&o?o:a;if(g)t.icon.setIcon(g)},d=()=>{t.element.setAttribute("aria-pressed",String(s))},u={select(){if(!s)s=!0,t.element.classList.add(i),l(),d();return this},deselect(){if(s)s=!1,t.element.classList.remove(i),l(),d();return this},toggle(){if(s)this.deselect();else this.select();return this},isSelected(){return s},isToggle(){return!0},setIcon(g){if(a=g,!s)l();return this},setSelectedIcon(g){if(o=g,s)l();return this},getSelectedIcon(){return o}};if(s)t.element.classList.add(i),d(),l();else d();let f=e.toggleOnClick!==!1,c=()=>{u.toggle();let g=new CustomEvent("toggle",{bubbles:!0,detail:{selected:s}});t.element.dispatchEvent(g)};if(f)t.element.addEventListener("click",c);let C=t.lifecycle?.destroy;if(t.lifecycle)t.lifecycle.destroy=()=>{if(f)t.element.removeEventListener("click",c);if(C)C()};return{...t,toggleState:u}};var Zo=({disabled:e,lifecycle:t,toggleState:n})=>(r)=>{let i=r.componentName||"icon-button",s=r.getClass(i),a={setIcon:(l)=>(r.icon.setIcon(l),a),getIcon:()=>r.icon.getIcon(),getElement:()=>r.icon.getElement()},o={element:r.element,icon:a,disabled:{enable:()=>e.enable(),disable:()=>e.disable(),isDisabled:()=>e.isDisabled()},lifecycle:{destroy:()=>t.destroy()},getClass:r.getClass,getValue:()=>r.element.value,setValue(l){return r.element.value=l,o},getVariant(){let l=["filled","tonal","outlined","standard"];for(let d of l)if(r.element.classList.contains(`${s}--${d}`))return d;return"standard"},setVariant(l){return["filled","tonal","outlined","standard"].forEach((u)=>{r.element.classList.remove(`${s}--${u}`)}),r.element.classList.add(`${s}--${l}`),o},getSize(){let l=["xs","s","m","l","xl"];for(let d of l)if(r.element.classList.contains(`${s}--${d}`))return d;return"s"},setSize(l){if(["xs","s","m","l","xl"].forEach((u)=>{r.element.classList.remove(`${s}--${u}`)}),l!=="s")r.element.classList.add(`${s}--${l}`);return o},getShape(){let l=["round","square"];for(let d of l)if(r.element.classList.contains(`${s}--${d}`))return d;return"round"},setShape(l){if(["round","square"].forEach((u)=>{r.element.classList.remove(`${s}--${u}`)}),l!=="round")r.element.classList.add(`${s}--${l}`);return o},getWidth(){let l=["narrow","default","wide"];for(let d of l)if(r.element.classList.contains(`${s}--${d}`))return d;return"default"},setWidth(l){if(["narrow","default","wide"].forEach((u)=>{r.element.classList.remove(`${s}--${u}`)}),l!=="default")r.element.classList.add(`${s}--${l}`);return o},enable(){return e.enable(),o},disable(){return e.disable(),o},setIcon(l){if(n?.isToggle()&&!n.isSelected())n.setIcon(l);return r.icon.setIcon(l),o},getIcon(){return r.icon.getIcon()},setSelectedIcon(l){if(n)n.setSelectedIcon(l);return o},getSelectedIcon(){return n?.getSelectedIcon()||""},isToggle(){return n?.isToggle()||!1},select(){if(n)n.select();return o},deselect(){if(n)n.deselect();return o},toggleSelected(){if(n)n.toggle();return o},isSelected(){return n?.isSelected()||!1},setAriaLabel(l){return r.element.setAttribute("aria-label",l),o},destroy(){t.destroy()},on(l,d){if(r.on)r.on(l,d);else r.element.addEventListener(l,d);return o},off(l,d){if(r.off)r.off(l,d);else r.element.removeEventListener(l,d);return o},addClass(...l){if(r.addClass)r.addClass(...l);else l.forEach((d)=>r.element.classList.add(d));return o},removeClass(...l){if(r.removeClass)r.removeClass(...l);else l.forEach((d)=>r.element.classList.remove(d));return o}};return o};ne();var Qo={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",STANDARD:"standard"},Jo={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},el={ROUND:"round",SQUARE:"square"},tl={NARROW:"narrow",DEFAULT:"default",WIDE:"wide"},nl={BUTTON:"button",SUBMIT:"submit",RESET:"reset"};var ur={DURATION:450,TIMING:"cubic-bezier(0.4, 0.0, 0.2, 1)",OPACITY:["0.7","0"]};var af={variant:Qo.STANDARD,size:Jo.S,shape:el.ROUND,width:tl.DEFAULT,disabled:!1,type:nl.BUTTON,toggle:!1,selected:!1,ripple:!0,tooltip:!0,rippleConfig:{duration:ur.DURATION,timing:ur.TIMING,opacity:ur.OPACITY}},rl=(e={})=>_(af,e,"icon-button"),il=(e)=>{let t={type:e.type||"button"};if(e.ariaLabel)t["aria-label"]=e.ariaLabel;if(e.toggle)t["aria-pressed"]=e.selected?"true":"false";if(e.disabled===!0)t.disabled=!0;if(e.value!==void 0)t.value=e.value;let n=[];if(e.size&&e.size!=="s")n.push(`icon-button--${e.size}`);if(e.shape&&e.shape!=="round")n.push(`icon-button--${e.shape}`);if(e.width&&e.width!=="default")n.push(`icon-button--${e.width}`);if(e.toggle)n.push("icon-button--toggle");if(e.toggle&&e.selected)n.push("icon-button--selected");if(e.disabled===!0)n.push("icon-button--disabled");let r=e.className||e.class,i=[...n,...Array.isArray(r)?r:r?[r]:[]],s={...e,className:i};return V(s,{tag:"button",attributes:t,forwardEvents:{click:(a)=>!a.element.disabled,focus:!0,blur:!0},interactive:!0})},sl=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable(),isDisabled:()=>e.disabled.isDisabled()},lifecycle:{destroy:()=>e.lifecycle.destroy()},toggleState:e.toggleState});var of=(e={})=>{let t=rl(e);try{return M(D,k(),O(il(t)),oe(t),Mt(t),Be(t),de(t),jo(t),we(t),P(),(r)=>{if(t.shape&&t.shape!=="round"&&r.element){let i=`${t.prefix}-${t.componentName}--${t.shape}`;r.element.classList.add(i)}return r},(r)=>{if(t.width&&t.width!=="default"&&r.element){let i=`${t.prefix}-${t.componentName}--${t.width}`;r.element.classList.add(i)}return r},(r)=>Zo(sl(r))(r))(t)}catch(n){throw console.error("IconButton creation error:",n),Error(`Failed to create icon button: ${n.message}`)}},nn=of;Ht();ne();var lf={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",ELEVATED:"elevated",TEXT:"text"},df={HORIZONTAL:"horizontal",VERTICAL:"vertical"},tt={DEFAULT:"default",COMFORTABLE:"comfortable",COMPACT:"compact"};var uf={STANDARD:"standard",CONNECTED:"connected"},cf={NONE:"none",SINGLE:"single",MULTI:"multi"},mf={ROUND:"round",SQUARE:"square"},ff={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},Ei={xs:{height:32,icon:20,standardGap:18,connectedCorner:4},s:{height:40,icon:20,standardGap:12,connectedCorner:8},m:{height:56,icon:24,standardGap:8,connectedCorner:8},l:{height:96,icon:32,standardGap:8,connectedCorner:16},xl:{height:136,icon:40,standardGap:8,connectedCorner:20}},al=2,ol=4;var ll=0.15,dl=4,gf={ALWAYS:"always",SELECTED:"selected"},ue={KIND:uf.STANDARD,SELECTION:cf.NONE,SHAPE:mf.ROUND,SIZE:ff.S,LABELS:gf.ALWAYS,VARIANT:lf.OUTLINED,ORIENTATION:df.HORIZONTAL,DENSITY:tt.DEFAULT,RIPPLE:!0,EQUAL_WIDTH:!1,RIPPLE_DURATION:300,RIPPLE_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",RIPPLE_OPACITY:["0.2","0"]};var pf={kind:ue.KIND,selection:ue.SELECTION,shape:ue.SHAPE,size:ue.SIZE,required:!1,variant:ue.VARIANT,orientation:ue.ORIENTATION,density:ue.DENSITY,ripple:ue.RIPPLE,equalWidth:ue.EQUAL_WIDTH,disabled:!1,buttons:[]},ul=(e={})=>_(pf,e,"button-group"),cl=(e)=>{let t=e.variant||ue.VARIANT,n=e.orientation||ue.ORIENTATION,r=e.density||ue.DENSITY,i=e.kind||ue.KIND,s=e.selection||ue.SELECTION,a=e.labels||ue.LABELS,o=e.shape||ue.SHAPE,l=e.size||ue.SIZE;return{tag:"div",componentName:"button-group",attributes:{role:"group","aria-label":e.ariaLabel||"Button group","data-variant":t,"data-orientation":n,"data-density":r,"data-kind":i,"data-selection":s,"data-shape":o,"data-size":l,"data-labels":a},className:[e.class,a==="selected"?`${e.prefix}-button-group--labels-selected`:null,e.disabled?`${e.prefix}-button-group--disabled`:null,`${e.prefix}-button-group--${n}`,`${e.prefix}-button-group--${t}`,`${e.prefix}-button-group--${i}`,`${e.prefix}-button-group--${o}`,`${e.prefix}-button-group--size-${l}`,s!=="none"?`${e.prefix}-button-group--selectable`:null,r!==tt.DEFAULT?`${e.prefix}-button-group--density-${r}`:null,e.equalWidth?`${e.prefix}-button-group--equal-width`:null],interactive:!0}},hf={[tt.DEFAULT]:0,[tt.COMFORTABLE]:1,[tt.COMPACT]:2},ml=(e,t,n=tt.DEFAULT)=>{let r=Ei[e||ue.SIZE]||Ei.s,i=t==="connected"?al:r.standardGap,s=r.height-dl*(hf[n]??0);return{"--button-group-height":`${s}px`,"--button-group-icon":`${r.icon}px`,"--button-group-gap":`${i}px`,"--button-group-inner-corner":`${r.connectedCorner}px`,"--button-group-pressed-corner":`${ol}px`,"--button-group-radius":`${s/2}px`}},fl=(e,t,n,r)=>{let i=t===0,s=t===n-1,a=n===1,o="";if(a)o=`${r.prefix}-button-group__button--single`;else if(i)o=`${r.prefix}-button-group__button--first`;else if(s)o=`${r.prefix}-button-group__button--last`;else o=`${r.prefix}-button-group__button--middle`;return{...e,variant:r.variant,size:r.size||ue.SIZE,shape:r.shape||ue.SHAPE,disabled:r.disabled||e.disabled,ripple:r.ripple,rippleConfig:r.rippleConfig,class:[`${r.prefix}-button-group__button`,o,e.class].filter(Boolean).join(" ")}};var Cf=(e={})=>{let t=ul(e),n=Re(),r=t.variant||ue.VARIANT,i=t.orientation||ue.ORIENTATION,s=t.density||ue.DENSITY,a=t.kind||ue.KIND,o=t.selection||ue.SELECTION,l=Boolean(t.required),d=new Set;try{let u=M(D,k(),O(cl(t)),P())(t),f=(x)=>{Object.entries(ml(t.size,a,x)).forEach(([A,N])=>{u.element.style.setProperty(A,N)})};f(s);let c=[],C=t.buttons||[],g=C.length,m=(x)=>{let A=x._groupConfig;return String(A?.value??A?.id??x._groupIndex)},p=(x,A)=>{let N=`${t.prefix}-button-group__button--selected`;x.element.classList.toggle(N,A),x.element.setAttribute("aria-pressed",String(A));let R=x.toggleState;if(R?.isToggle?.())if(A)R.select();else R.deselect();else x.setSelected?.(A)},h=t.expandedRatio??ll,b=()=>{c.forEach((x)=>{x.element.style.width="",x.element.style.paddingLeft="",x.element.style.paddingRight=""}),document.removeEventListener("pointerup",b),document.removeEventListener("pointercancel",b)},v=(x)=>{if(a!=="standard"||h<=0||i!=="horizontal")return;let A=c.map((G)=>G.element.getBoundingClientRect().width);if(!A[x])return;let N=u.element.ownerDocument.defaultView,R=(G,j)=>N?parseFloat(N.getComputedStyle(c[G].element)[j])||0:0,U=c[x-1]?x-1:-1,H=c[x+1]?x+1:-1,q=U>=0&&H>=0,Y=h*A[x]/(q?2:1),J=0,w=(G,j)=>{let Z=Math.min(Y,R(G,j),A[G]);if(Z<=0)return;c[G].element.style.width=`${A[G]-Z}px`,c[G].element.style[j]=`${R(G,j)-Z}px`,J+=Z};if(U>=0)w(U,"paddingRight");if(H>=0)w(H,"paddingLeft");c[x].element.style.width=`${A[x]+J}px`,document.addEventListener("pointerup",b),document.addEventListener("pointercancel",b)},E=(x,A)=>{let N=c.filter((U)=>d.has(m(U))),R={buttonGroup:I,values:N.map(m),selected:N,button:x,originalEvent:A};n.emit("change",R)},T=(x,A,N,R)=>{if(o==="none")return!1;let U=c.find((H)=>m(H)===x);if(!U)return!1;if(A===d.has(x))return!1;if(!A&&l&&d.size===1)return!1;if(A&&o==="single")for(let H of c){let q=m(H);if(q!==x&&d.has(q))d.delete(q),p(H,!1)}if(A)d.add(x);else d.delete(x);return p(U,A),E(N??U,R),!0};if(C.forEach((x,A)=>{let N=fl(x,A,g,t),R=o!=="none",H=Boolean(x.icon)&&!x.text?nn({...N,toggle:R,toggleOnClick:!1,selectedIcon:x.selectedIcon,variant:N.variant==="text"?"standard":N.variant}):He({...N,toggle:R,toggleOnClick:!1});if(H._groupConfig=x,H._groupIndex=A,R)H.element.setAttribute("aria-pressed","false");H.element.addEventListener("pointerdown",()=>{if(!H.disabled?.isDisabled())v(A)}),H.on("click",(q)=>{if(!H.disabled?.isDisabled()){let Y={buttonGroup:I,button:H,index:A,originalEvent:q};if(n.emit("click",Y),o!=="none"){let J=m(H),w=d.has(J);if(o==="single"){if(!w)T(J,!0,H,q);else if(!l)T(J,!1,H,q)}else T(J,!w,H,q)}}}),H.on("focus",(q)=>{let Y={buttonGroup:I,button:H,index:A,originalEvent:q};n.emit("focus",Y)}),H.on("blur",(q)=>{let Y={buttonGroup:I,button:H,index:A,originalEvent:q};n.emit("blur",Y)}),u.element.appendChild(H.element),c.push(H)}),o!=="none")c.forEach((x)=>{if(x._groupConfig?.selected&&(o==="multi"||d.size===0))d.add(m(x)),p(x,!0)});let S=(x)=>{["filled","tonal","outlined","elevated","text"].forEach((N)=>{u.element.classList.remove(`${t.prefix}-button-group--${N}`)}),u.element.classList.add(`${t.prefix}-button-group--${x}`),u.element.setAttribute("data-variant",x),c.forEach((N)=>{N.setVariant(x)}),r=x},y=(x)=>{u.element.classList.remove(`${t.prefix}-button-group--horizontal`,`${t.prefix}-button-group--vertical`),u.element.classList.add(`${t.prefix}-button-group--${x}`),u.element.setAttribute("data-orientation",x),i=x},L=(x)=>{if(Object.values(tt).forEach((A)=>{if(A!==tt.DEFAULT)u.element.classList.remove(`${t.prefix}-button-group--density-${A}`)}),x!==tt.DEFAULT)u.element.classList.add(`${t.prefix}-button-group--density-${x}`);u.element.setAttribute("data-density",x),f(x),s=x},I={element:u.element,buttons:c,getButton(x){return c[x]},getButtonById(x){return c.find((A)=>{let N=A._groupConfig;return N?.id===x||N?.value===x})},getVariant(){return r},setVariant(x){return S(x),this},getOrientation(){return i},setOrientation(x){return y(x),this},getDensity(){return s},setDensity(x){return L(x),this},enable(){return u.element.classList.remove(`${t.prefix}-button-group--disabled`),c.forEach((x)=>{if(!x._groupConfig?.disabled)x.enable()}),this},disable(){return u.element.classList.add(`${t.prefix}-button-group--disabled`),c.forEach((x)=>{x.disable()}),this},enableButton(x){let A=c[x];if(A)A.enable();return this},getSelected(){return c.filter((x)=>d.has(m(x))).map(m)},isSelected(x){return d.has(x)},select(x){return T(x,!0),this},deselect(x){return T(x,!1),this},toggle(x){return T(x,!d.has(x)),this},getKind(){return a},getSelection(){return o},disableButton(x){let A=c[x];if(A)A.disable();return this},on(x,A){return n.on(x,A),this},off(x,A){return n.off(x,A),this},destroy(){b(),c.forEach((x)=>{x.destroy()}),c.length=0,n.clear(),u.lifecycle.destroy()}};return I}catch(u){throw console.error("Button Group creation error:",u),Error(`Failed to create button group: ${u.message}`)}},bi=Cf;se();te();re();var gl=({lifecycle:e})=>(t)=>({...t,element:t.element,addContent(n){if(n&&n.classList.contains(`${t.getClass("card")}-content`))t.element.appendChild(n);return this},setHeader(n){if(n&&n.classList.contains(`${t.getClass("card")}-header`)){let r=t.element.querySelector(`.${t.getClass("card")}-header`);if(r)r.remove();if(t.element.querySelector(`.${t.getClass("card")}-media`)){let s=t.element.querySelectorAll(`.${t.getClass("card")}-media`),a=s[s.length-1];if(a.nextSibling)t.element.insertBefore(n,a.nextSibling);else t.element.appendChild(n)}else t.element.insertBefore(n,t.element.firstChild)}return this},addMedia(n,r="top"){if(n&&n.classList.contains(`${t.getClass("card")}-media`))if(r==="top")t.element.insertBefore(n,t.element.firstChild);else t.element.appendChild(n);return this},setActions(n){if(n&&n.classList.contains(`${t.getClass("card")}-actions`)){let r=t.element.querySelector(`.${t.getClass("card")}-actions`);if(r)r.remove();t.element.appendChild(n)}return this},makeDraggable(n){if(t.element.setAttribute("draggable","true"),t.element.setAttribute("aria-grabbed","false"),typeof n==="function")t.element.addEventListener("dragstart",(r)=>{t.element.setAttribute("aria-grabbed","true"),n(r)}),t.element.addEventListener("dragend",()=>{t.element.setAttribute("aria-grabbed","false")});return this},focus(){return t.element.focus(),this},destroy(){e.destroy()}});ne();nt();se();te();Qe();var cr=(e={})=>{let t={...e,componentName:"card-content",prefix:K};try{let n=M(D,O({tag:"div",componentName:"card-content",className:[e.class,e.padding===!1?`${K}-card-content--no-padding`:null],attributes:{role:"region",style:"display: block; color: inherit;"}}))(t);if(e.html)n.element.innerHTML=e.html;else if(e.text)n.element.innerHTML=`<p>${e.text}</p>`;if(Array.isArray(e.children))e.children.forEach((r)=>{if(r instanceof HTMLElement)n.element.appendChild(r)});return n.element.classList.add("debug-content"),n.element}catch(n){throw console.error("Card content creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create card content: ${n instanceof Error?n.message:String(n)}`)}},mr=(e={})=>{let t={...e,componentName:"card-header",prefix:K};try{let n=M(D,O({tag:"div",componentName:"card-header",className:e.class,attributes:{role:"heading","aria-level":"3"}}))(t),r=B({tag:"div",className:`${K}-card-header-text`,container:n.element});if(e.title){B({tag:"h3",className:`${K}-card-header-title`,text:e.title,container:r,attributes:{id:`${n.element.id||"card-header"}-title`}});let i=n.element.closest(`.${K}-card`);if(i&&!i.hasAttribute("aria-labelledby"))i.setAttribute("aria-labelledby",`${n.element.id||"card-header"}-title`)}if(e.subtitle)B({tag:"h4",className:`${K}-card-header-subtitle`,text:e.subtitle,container:r});if(e.avatar){let i=typeof e.avatar==="string"?B({tag:"div",className:`${K}-card-header-avatar`,html:e.avatar}):e.avatar,s=i.querySelector("img");if(s&&!s.hasAttribute("alt"))s.setAttribute("alt",""),s.setAttribute("aria-hidden","true");n.element.insertBefore(i,n.element.firstChild)}if(e.action){let i=typeof e.action==="string"?B({tag:"div",className:`${K}-card-header-action`,html:e.action}):e.action;n.element.appendChild(i)}return n.element}catch(n){throw console.error("Card header creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create card header: ${n instanceof Error?n.message:String(n)}`)}},kn=(e={})=>{let t={...e,componentName:"card-actions",prefix:K};try{let n=M(D,O({tag:"div",componentName:"card-actions",className:[e.class,e.fullBleed?`${K}-card-actions--full-bleed`:null,e.vertical?`${K}-card-actions--vertical`:null,e.align?`${K}-card-actions--${e.align}`:null],attributes:{role:"group"}}))(t);if(Array.isArray(e.actions))e.actions.forEach((r,i)=>{if(r instanceof HTMLElement){if(!r.hasAttribute("aria-label")&&!r.hasAttribute("aria-labelledby")&&r.textContent?.trim()==="")r.setAttribute("aria-label",`Action ${i+1}`);n.element.appendChild(r)}});return n.element}catch(n){throw console.error("Card actions creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create card actions: ${n instanceof Error?n.message:String(n)}`)}},Bn=(e={})=>{let t={...e,componentName:"card-media",prefix:K};try{let n=M(D,O({tag:"div",componentName:"card-media",className:[e.class,e.aspectRatio?`${K}-card-media--${e.aspectRatio.replace(":","-")}`:null,e.contain?`${K}-card-media--contain`:null]}))(t);if(e.element instanceof HTMLElement)n.element.appendChild(e.element);else if(e.src){let r=document.createElement("img");if(r.src=e.src,r.className=`${K}-card-media-img`,r.alt=e.alt||"",!e.alt)r.setAttribute("aria-hidden","true");n.element.appendChild(r)}return n.element}catch(n){throw console.error("Card media creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create card media: ${n instanceof Error?n.message:String(n)}`)}};var fr={ELEVATED:"elevated",FILLED:"filled",OUTLINED:"outlined"},pl={LEVEL0:0,LEVEL1:1,LEVEL2:2,LEVEL4:4};var bf={variant:fr.ELEVATED,interactive:!1,fullWidth:!1,clickable:!1,draggable:!1},hl=(e)=>{let t={...e};if(e.header)t.headerConfig=e.header;if(e.content)t.contentConfig=e.content;if(e.media)t.mediaConfig=e.media;if(e.actions)t.actionsConfig=e.actions;return t},Cl=(e,t)=>{if(t.mediaConfig&&(!t.mediaConfig.position||t.mediaConfig.position==="top")){let n=Bn({...t.mediaConfig,position:void 0});e.addMedia(n,"top")}if(t.headerConfig){let n=mr(t.headerConfig);e.setHeader(n)}if(t.contentConfig){let n=cr(t.contentConfig);e.addContent(n)}if(t.mediaConfig&&t.mediaConfig.position==="bottom"){let n=Bn({...t.mediaConfig,position:void 0});e.addMedia(n,"bottom")}if(t.actionsConfig){let n=kn(t.actionsConfig);e.setActions(n)}if(Array.isArray(t.buttons)&&t.buttons.length>0)Promise.resolve().then(() => (Ht(),{})).then(({})=>{let r=t.buttons.map((s)=>He(s).element),i=kn({actions:r,align:t.actionsConfig?.align||"end"});e.setActions(i)}).catch((n)=>{console.error("Error processing buttons:",n)})},El=(e={})=>_(bf,e,"card"),bl=(e)=>{let t=e.interactive||e.clickable,n=t?"button":"region",r={};if(e.aria)Object.entries(e.aria).forEach(([i,s])=>{if(s!==void 0){let a=i.startsWith("aria-")?i:`aria-${i}`;r[a]=s}});if(!r.role&&!e.aria?.role)r.role=n;if(t&&!r.tabindex)r.tabindex="0";return V(e,{tag:"div",className:[e.class,e.fullWidth?`${e.prefix}-card--full-width`:null,t?`${e.prefix}-card--interactive`:null],attributes:r,forwardEvents:{click:()=>!!e.clickable,mouseenter:()=>!!t,mouseleave:()=>!!t,keydown:()=>!!t,focus:()=>!!t,blur:()=>!!t},interactive:t})},vl=(e)=>({lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}}),$t=pl,Tl=(e)=>{let t=e.config;if(t.interactive||t.clickable)e.element.addEventListener("mouseenter",()=>{if(t.variant===fr.ELEVATED)e.element.style.setProperty("--card-elevation",String($t.LEVEL2))}),e.element.addEventListener("mouseleave",()=>{if(t.variant===fr.ELEVATED)e.element.style.setProperty("--card-elevation",String($t.LEVEL1))}),e.element.addEventListener("keydown",(r)=>{if((r.key==="Enter"||r.key===" ")&&t.clickable)r.preventDefault(),e.element.click()}),e.element.addEventListener("focus",()=>{e.element.classList.add(`${e.getClass("card")}--focused`)}),e.element.addEventListener("blur",()=>{e.element.classList.remove(`${e.getClass("card")}--focused`)});if(t.draggable)e.element.setAttribute("draggable","true"),e.element.addEventListener("dragstart",(r)=>{if(e.element.style.setProperty("--card-elevation",String($t.LEVEL4)),e.element.classList.add(`${e.getClass("card")}--dragging`),e.emit?.("dragstart",{event:r}),r.dataTransfer){let i=e.element.querySelector(`.${e.getClass("card")}-header-title`)?.textContent||"Card";r.dataTransfer.setData("text/plain",i)}}),e.element.addEventListener("dragend",(r)=>{e.element.style.setProperty("--card-elevation",String($t.LEVEL1)),e.element.classList.remove(`${e.getClass("card")}--dragging`),e.emit?.("dragend",{event:r})});return e};var Sl=(e)=>{if(e.config.variant==="elevated")e.element.style.setProperty("--card-elevation",String($t.LEVEL1));else e.element.style.setProperty("--card-elevation",String($t.LEVEL0));return e};var vf=(e={})=>{let t=hl(e),n=El(t);try{let r=M(D,k(),O(bl(n)),oe(n),n.clickable?we(n):(i)=>i,P(),Tl,Sl,(i)=>gl(vl(i))(i))(n);return Cl(r,t),r}catch(r){throw console.error("Card creation error:",r instanceof Error?r.message:String(r)),Error(`Failed to create card: ${r instanceof Error?r.message:String(r)}`)}},vi=vf;se();te();re();var Ti=(e)=>(t)=>{let n=t.getClass("carousel"),r=document.createElement("div");r.className=`${n}__scroller`;let i=document.createElement("div");i.className=`${n}__track`,r.appendChild(i),t.element.appendChild(r);let s=[],a=[],o=t,l,d=()=>{let g=a.length;a.forEach((m,p)=>{m.dataset.index=String(p),m.setAttribute("aria-label",`${p+1} of ${g}`)})},u=(g,m)=>{if(g.replaceChildren(),m.content!==void 0){if(typeof m.content==="string")g.innerHTML=m.content;else g.appendChild(m.content);return}if(m.image){let p=document.createElement("img");p.className=`${n}__image`,p.src=m.image,p.alt=m.alt??m.title??"",p.draggable=!1,g.appendChild(p)}if(m.title||m.description||m.buttonText){let p=document.createElement("div");if(p.className=`${n}__content`,m.title){let h=document.createElement("div");h.className=`${n}__title`,h.textContent=m.title,p.appendChild(h)}if(m.description){let h=document.createElement("div");h.className=`${n}__description`,h.textContent=m.description,p.appendChild(h)}if(m.buttonText){let h=document.createElement("a");if(h.className=`${n}__button`,h.textContent=m.buttonText,m.buttonUrl)h.href=m.buttonUrl;p.appendChild(h)}g.appendChild(p)}},f=(g)=>{let m=document.createElement("div");return m.className=`${n}__item`,m.setAttribute("role","group"),m.setAttribute("aria-roledescription","slide"),m.tabIndex=0,u(m,g),m},c=()=>{d(),l?.()},C={addSlide(g,m){let p=m!==void 0&&m>=0&&m<=s.length?m:s.length,h=f(g);if(s.splice(p,0,g),p<a.length)i.insertBefore(h,a[p]),a.splice(p,0,h);else i.appendChild(h),a.push(h);return c(),C},removeSlide(g){if(g<0||g>=a.length)return C;return i.removeChild(a[g]),a.splice(g,1),s.splice(g,1),c(),C},updateSlide(g,m){if(g<0||g>=a.length)return C;return s[g]=m,u(a[g],m),C},getSlide:(g)=>s[g]??null,getCount:()=>s.length,getElements:()=>a.slice()};return o.scroller=r,o.track=i,o.slides=C,o.slideElements=a,o.onSlidesChanged=(g)=>{l=g},(e.slides??[]).forEach((g)=>{let m=f(g);s.push(g),a.push(m),i.appendChild(m)}),d(),o};var $e={MULTI_BROWSE:"multi-browse",UNCONTAINED:"uncontained",HERO:"hero",HERO_CENTER:"hero-center",FULL_SCREEN:"full-screen"},yl={CHANGE:"change"},ye={VARIANT:$e.MULTI_BROWSE,ITEM_WIDTH:280,GAP:8,GAP_FULL_SCREEN:16,PADDING:16,CORNER_RADIUS:28,MIN_SMALL_ITEM_WIDTH:40,MAX_SMALL_ITEM_WIDTH:56,ANCHOR_SIZE:10,MEDIUM_LARGE_THRESHOLD:0.85,INITIAL_SLIDE:0};ne();var Sf={variant:ye.VARIANT,cornerRadius:ye.CORNER_RADIUS,initialSlide:ye.INITIAL_SLIDE,minSmallItemWidth:ye.MIN_SMALL_ITEM_WIDTH,maxSmallItemWidth:ye.MAX_SMALL_ITEM_WIDTH},Si=(e)=>{let t=e.variant||ye.VARIANT,n=t===$e.FULL_SCREEN;return{variant:t,gap:e.gap??(n?ye.GAP_FULL_SCREEN:ye.GAP),padding:e.padding??(n?0:ye.PADDING),snap:e.snap??t!==$e.UNCONTAINED}},xl=(e={})=>_(Sf,e,"carousel"),Il=(e)=>{let{variant:t}=Si(e);return V(e,{tag:"div",attributes:{role:"region","aria-roledescription":"carousel","aria-label":e.ariaLabel||"Carousel"},className:[e.class,`${e.prefix}-carousel--${t}`,t===$e.FULL_SCREEN?`${e.prefix}-carousel--vertical`:null],forwardEvents:{focus:!0,blur:!0}})};var hr=(e)=>e.largeCount+e.mediumCount+e.smallCount,yf=(e)=>{if(e.largeCount>0&&e.smallCount>0&&e.mediumCount>0)return e.largeSize>e.mediumSize&&e.mediumSize>e.smallSize;if(e.largeCount>0&&e.smallCount>0)return e.largeSize>e.smallSize;return!0},yi=(e,t)=>yf(e)?Math.abs(t-e.largeSize)*e.priority:Number.MAX_VALUE,xf=(e,t,n,r,i)=>(e-(t+r/2)*n)/(i+r/2),If=(e,t,n,r,i,s,a,o,l,d,u)=>{let f=d+o+r,c=t-(f-1)*n,C=Math.min(Math.max(i,s),a),g=u*d+l*o+C*r,m=c-g;if(r>0&&m>0)C+=Math.min(m/r,a-C);else if(r>0&&m<0)C+=Math.max(m/r,s-C);C=r>0?C:0;let p=xf(c,r,C,o,d),h=(p+C)/2;if(o>0&&p!==u){let b=(u-p)*d,v=h*0.1*o,E=Math.min(Math.abs(b),v);if(b>0)h-=E/o,p+=E/d;else h+=E/o,p-=E/d}return{priority:e,smallSize:C,smallCount:r,mediumSize:h,mediumCount:o,largeSize:p,largeCount:d}},Cr=(e)=>{let t=null,n=1;for(let r of e.largeCounts)for(let i of e.mediumCounts)for(let s of e.smallCounts){let a=If(n,e.availableSpace,e.gap,s,e.targetSmallSize,e.minSmallSize,e.maxSmallSize,i,e.targetMediumSize,r,e.targetLargeSize);if(t===null||yi(a,e.targetLargeSize)<yi(t,e.targetLargeSize)){if(t=a,yi(t,e.targetLargeSize)===0)return t}n++}return t};var Ve=(e)=>e.findIndex((t)=>t.isFocal),Ye=(e)=>{for(let t=e.length-1;t>=0;t--)if(e[t].isFocal)return t;return-1},br=(e)=>e.findIndex((t)=>!t.isAnchor),vr=(e)=>{for(let t=e.length-1;t>=0;t--)if(!e[t].isAnchor)return t;return-1},xi=(e)=>e.findIndex((t)=>t.isPivot),wl=(e)=>Ye(e)-Ve(e)+1,Ii=(e)=>e.reduce((t,n)=>Math.min(t,n.size),Number.MAX_VALUE),Li=(e)=>e.reduce((t,n)=>Math.max(t,n.size),0),Nl=(e)=>{let t=e[Ve(e)];return t.offset-t.size/2>=0&&Ve(e)===br(e)},Dl=(e,t)=>{let n=e[Ye(e)];return n.offset+n.size/2<=t&&Ye(e)===vr(e)},Ml=(e,t)=>{for(let n=Ye(e);n<e.length;n++)if(e[n].size===t)return n;return e.length-1},Ol=(e,t)=>{for(let n=Ve(e)-1;n>=0;n--)if(e[n].size===t)return n;return 0},Rl=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(e[n].unadjustedOffset<t)return e[n];return e[0]},_l=(e,t)=>e.find((n)=>n.unadjustedOffset>=t)??e[e.length-1],Er=(e,t,n)=>e+(t-e)*n,Ai=(e,t,n)=>({size:Er(e.size,t.size,n),offset:Er(e.offset,t.offset,n),unadjustedOffset:Er(e.unadjustedOffset,t.unadjustedOffset,n),isFocal:n<0.5?e.isFocal:t.isFocal,isAnchor:n<0.5?e.isAnchor:t.isAnchor,isPivot:n<0.5?e.isPivot:t.isPivot,cutoff:Er(e.cutoff,t.cutoff,n)}),Pl=(e,t,n)=>e.map((r,i)=>Ai(r,t[i],n)),Ll=(e,t)=>t-e/2<0&&t+e/2>0,Al=(e,t,n)=>t-e/2<n&&t+e/2>n,kl=(e)=>{let t=-1,n=0;if(e.forEach((i,s)=>{if(!i.isAnchor&&i.size>n)t=s,n=i.size}),t<0)return[-1,-1,0];let r=t;while(r<e.length-1&&e[r+1].size===n)r++;return[t,r,n]},Bl=(e,t,n,r,i,s,a,o)=>{if(e.length===0||t<0||t>=e.length)return[];let l=e[t],d=[],u=Ll(l.size,n)?n-l.size/2:Al(l.size,n,a)?n+l.size/2-a:0;d.push({size:l.size,offset:n,unadjustedOffset:n,isFocal:t>=r&&t<=i,isAnchor:l.isAnchor,isPivot:!0,cutoff:u});let f=n-s/2-o,c=n-s/2-o;for(let C=t-1;C>=0;C--){let g=e[C],m=f-g.size/2,p=c-s/2;d.unshift({size:g.size,offset:m,unadjustedOffset:p,isFocal:C>=r&&C<=i,isAnchor:g.isAnchor,isPivot:!1,cutoff:Ll(g.size,m)?Math.abs(m-g.size/2):0}),f-=g.size+o,c-=s+o}f=n+s/2+o,c=n+s/2+o;for(let C=t+1;C<e.length;C++){let g=e[C],m=f+g.size/2,p=c+s/2;d.push({size:g.size,offset:m,unadjustedOffset:p,isFocal:C>=r&&C<=i,isAnchor:g.isAnchor,isPivot:!1,cutoff:Al(g.size,m,a)?m+g.size/2-a:0}),f+=g.size+o,c+=s+o}return d},wi=(e,t,n,r,i)=>{let[s,a,o]=kl(i);return Bl(i,n,r,s,a,o,e,t)},Lf=(e,t,n,r)=>{let[i,s,a]=kl(r);if(i<0)return[];let o=s-i,l=a/2;if(n==="center"){let d=t===0||o%2===0?0:t/2,u=Math.floor(o/2)*t;l=e/2-a/2*o-d-u}return Bl(r,i,l,i,s,a,e,t)},Tr=(e,t,n,r,i,s)=>{let a=[{size:r,isAnchor:!0}],o=(l,d)=>{for(let u=0;u<d;u++)a.push({size:l,isAnchor:!1})};if(s==="center")o(e.smallSize,Math.floor(e.smallCount/2)),o(e.mediumSize,Math.floor(e.mediumCount/2)),o(e.largeSize,e.largeCount),o(e.mediumSize,Math.ceil(e.mediumCount/2)),o(e.smallSize,Math.ceil(e.smallCount/2));else o(e.largeSize,e.largeCount),o(e.mediumSize,e.mediumCount),o(e.smallSize,e.smallCount);return a.push({size:i,isAnchor:!0}),Lf(t,n,s,a)},Hl=(e,t)=>{let n=[];for(let r=e;r>=t;r--)n.push(r);return n},$l=(e,t,n,r,i)=>{if(e<=0||t<=0)return[];let s=[1],a=[1,0],o=Math.min(t,e),l=Math.min(Math.max(o/3,i.minSmallSize),i.maxSmallSize),d=(o+l)/2;if(e<i.minSmallSize*2)s=[0];let u=e-d*Math.max(...a)-i.maxSmallSize*Math.max(...s),f=Math.max(1,Math.floor(u/o)),c=Math.ceil(e/o),C=Hl(c,f),g={availableSpace:e,gap:n,targetSmallSize:l,minSmallSize:i.minSmallSize,maxSmallSize:i.maxSmallSize,smallCounts:s,targetMediumSize:d,mediumCounts:a,targetLargeSize:o,largeCounts:C},m=Cr(g);if(m&&hr(m)>r){let p=hr(m)-r,h=m.smallCount,b=m.mediumCount;while(p>0){if(h>0)h-=1;else if(b>1)b-=1;p-=1}m=Cr({...g,smallCounts:[h],mediumCounts:[b]})}if(!m)return[];return Tr(m,e,n,i.anchorSize,i.anchorSize,"start")},Vl=(e,t,n,r,i,s)=>{if(e<=0)return[];let a=i&&r>=3,o=r<=1?[0]:a?[2]:[1],l=Math.min(t??e,e),d=Math.min(Math.max(l/3,s.minSmallSize),s.maxSmallSize),u=s.minSmallSize*Math.max(...o)+s.minSmallSize*1.25;if(e<u)o=[0];let f=e-s.minSmallSize*Math.max(...o),c=Math.max(1,Math.floor(f/l)),C=Math.ceil(e/l),g=Cr({availableSpace:e,gap:n,targetSmallSize:d,minSmallSize:s.minSmallSize,maxSmallSize:s.maxSmallSize,smallCounts:o,targetMediumSize:0,mediumCounts:[0],targetLargeSize:l,largeCounts:Hl(C,c)});if(!g)return[];let m=a&&r>=hr(g)?"center":"start";return Tr(g,e,n,s.anchorSize,s.anchorSize,m)},Af=(e,t,n,r)=>{let i=Math.max(n*1.5,e);if(i>t*r)i=Math.max(n*1.2,e);return i},Sr=(e,t,n,r)=>{if(e<=0||t<=0)return[];let i=Math.min(t,e),s=Math.max(1,Math.floor((e+n)/(i+n))),a=Math.max(0,e-s*(i+n)),o=a>0?1:0,l=Af(r.anchorSize,i,a,r.mediumLargeThreshold),d={priority:0,smallSize:0,smallCount:0,mediumSize:l,mediumCount:o,largeSize:i,largeCount:s},u=Math.min(r.anchorSize,t),f=Math.max(u,l*0.5);return Tr(d,e,n,f,r.anchorSize,"start")},Fl=(e,t,n)=>{if(e<=0)return[];return Tr({priority:0,smallSize:0,smallCount:0,mediumSize:0,mediumCount:0,largeSize:e,largeCount:1},e,t,n.anchorSize,n.anchorSize,"start")};var Ni=(e,t,n,r,i)=>{if(i<=n)return e;if(i>=r)return t;return e+(t-e)*((i-n)/(r-n))},yr=(e,t,n,r,i,s)=>{let a=e.filter((d)=>!d.isAnchor).length,o=r/a;return wi(t,n,s,i.offset-o/2+r,e.map((d)=>({size:d.size-Math.abs(o),isAnchor:d.isAnchor}))).map((d,u)=>({...d,unadjustedOffset:e[u].unadjustedOffset}))},xr=(e,t,n,r,i)=>{let s=t>n?1:-1,a=e[t],o=(a.size-a.cutoff+i)*s,l=e[xi(e)],d=e.slice();return d.splice(t,1),d.splice(n,0,a),wi(r,i,xi(e)+s,l.offset+o,d.map((u)=>({size:u.size,isAnchor:u.isAnchor})))},wf=(e,t,n,r)=>{if(e.length===0)return[];let i=[e];if(Nl(e)){if(r!==0)i.push(yr(e,t,n,r,e[Ve(e)],Ve(e)));return i}let s=br(e),o=Ve(e)-s;if(o<=0&&e[Ve(e)].cutoff>0)return i.push(xr(e,0,0,t,n)),i;for(let l=0;l<o;l++){let d=i[i.length-1],u=s+l,f=e.length-1;if(u>0){let c=e[u-1].size;f=Ml(d,c)-1}i.push(xr(d,br(e),f,t,n))}if(r!==0){let l=i[i.length-1];i[i.length-1]=yr(l,t,n,r,l[Ve(l)],Ve(l))}return i},Nf=(e,t,n,r)=>{if(e.length===0)return[];let i=[e];if(Dl(e,t)){if(r!==0)i.push(yr(e,t,n,-r,e[Ye(e)],Ye(e)));return i}let s=Ye(e),a=vr(e),o=a-s;if(o<=0&&e[Ye(e)].cutoff>0)return i.push(xr(e,0,0,t,n)),i;for(let l=0;l<o;l++){let d=i[i.length-1],u=a-l,f=0;if(u<e.length-1){let c=e[u+1].size;f=Ol(d,c)+1}i.push(xr(d,vr(e),f,t,n))}if(r!==0){let l=i[i.length-1];i[i.length-1]=yr(l,t,n,-r,l[Ye(l)],Ye(l))}return i},Ul=(e,t,n)=>{let r=[0];if(e===0||t.length===0)return r;for(let i=1;i<t.length;i++){let s=t[i-1],a=t[i],o=n?a[0].unadjustedOffset-s[0].unadjustedOffset:s[s.length-1].unadjustedOffset-a[a.length-1].unadjustedOffset,l=i===t.length-1?1:r[i-1]+o/e;r.push(l)}return r},Gl=(e,t,n,r,i)=>{let s=wf(e,t,n,r),a=Nf(e,t,n,i),o=e.length?e[Ve(e)].size:0,l=s.length?Math.max(s[s.length-1][0].unadjustedOffset-s[0][0].unadjustedOffset,r):0,d=a.length?Math.max(a[0][a[0].length-1].unadjustedOffset-a[a.length-1][a[a.length-1].length-1].unadjustedOffset,i):0,u=e.length?Ii(e):0,f=e.length?Li(e):0;for(let c of[...s,...a])u=Math.min(u,Ii(c)),f=Math.max(f,Li(c));return{defaultKeylines:e,startSteps:s,endSteps:a,availableSpace:t,gap:n,beforePadding:r,afterPadding:i,itemSize:o,minItemSize:u,maxItemSize:f,valid:e.length>0&&t!==0&&o!==0,startShiftDistance:l,endShiftDistance:d,startShiftPoints:Ul(l,s,!0),endShiftPoints:Ul(d,a,!1)}},zl=(e,t,n,r=!1)=>{let i=Math.max(0,t),s=e.startShiftDistance,a=Math.max(0,n-e.endShiftDistance);if(i>=s&&i<=a)return e.defaultKeylines;let o=Ni(1,0,0,s,i),{startShiftPoints:l,startSteps:d}=e;if(i>a){if(o=Ni(0,1,a,n,i),l=e.endShiftPoints,d=e.endSteps,a<0.01&&e.startSteps.length===2&&e.endSteps.length===2)d=[e.startSteps[1],e.endSteps[1]]}let u=0,f=0,c=0,C=l[0];for(let g=1;g<d.length;g++){let m=l[g];if(o<=m){u=g-1,f=g,c=Ni(0,1,C,m,o);break}C=m}if(r)return d[Math.round(c)===0?u:f];return Pl(d[u],d[f],c)},Di=(e,t,n)=>{if(!e.valid)return 0;let r=(d)=>d[Ve(d)].unadjustedOffset-e.itemSize/2,i=(d)=>d[Ye(d)].unadjustedOffset-e.itemSize/2,s=Math.round(r(e.defaultKeylines)),a=e.startSteps.length-1;if(t<=a){let d=Math.min(Math.max(a-t,0),a);s=Math.round(r(e.startSteps[d]))}let o=e.endSteps.length-1,l=n-1;if(t>=l-o&&n>wl(e.defaultKeylines)){let d=Math.min(Math.max(o-(l-t),0),o);s=Math.round(i(e.endSteps[d]))}return s},Wl=(e,t)=>Math.max(0,e.itemSize*t+e.gap*(t-1)-e.availableSpace),Kl=(e,t,n,r)=>{let i=e.itemSize+e.gap,s=n*i+e.itemSize/2-r,a=Rl(t,s),o=_l(t,s),l=a===o?1:(s-a.unadjustedOffset)/(o.unadjustedOffset-a.unadjustedOffset),d=Ai(a,o,l),u=d.offset;if(a===o)u+=(s-d.unadjustedOffset)/d.size;return{size:d.size,center:u,keyline:d}};var Yl=0.4,Df=4,Mi=(e)=>(t)=>{let{variant:n,gap:r,padding:i,snap:s}=Si(e),a=n===$e.FULL_SCREEN,o={minSmallSize:e.minSmallItemWidth??ye.MIN_SMALL_ITEM_WIDTH,maxSmallSize:e.maxSmallItemWidth??ye.MAX_SMALL_ITEM_WIDTH,anchorSize:ye.ANCHOR_SIZE,mediumLargeThreshold:ye.MEDIUM_LARGE_THRESHOLD},l=e.cornerRadius??ye.CORNER_RADIUS,d=typeof window<"u"&&typeof window.matchMedia==="function"?window.matchMedia("(prefers-reduced-motion: reduce)"):null,{element:u,scroller:f,track:c,slideElements:C}=t,g=t.getClass("carousel"),m=`${g}__snap`;u.classList.toggle(`${g}--snap`,s);let p=null,h=0,b=0,v=0,E=[],T=Math.max(0,e.initialSlide??ye.INITIAL_SLIDE),S=new WeakMap,y=null,L=0,I=()=>{y=null,window.clearTimeout(L)},x=(F)=>{y=F,window.clearTimeout(L),L=window.setTimeout(I,1000)},A=()=>a?f.scrollTop:f.scrollLeft,N=(F,Q)=>{let be=Q&&!d?.matches?"smooth":"auto";if(typeof f.scrollTo==="function")f.scrollTo(a?{top:F,behavior:be}:{left:F,behavior:be});else if(a)f.scrollTop=F;else f.scrollLeft=F},R=()=>{t.emit?.(yl.CHANGE,{index:T})},U=(F)=>{let Q=0,be=Number.MAX_VALUE;return E.forEach((Se,Ee)=>{let ze=Math.abs(F-Se);if(ze<be)be=ze,Q=Ee}),Q},H=(F)=>{let Q=d?.matches===!0,be=e.itemWidth??ye.ITEM_WIDTH;switch(n){case $e.HERO:case $e.HERO_CENTER:{let Se=e.itemWidth??null;return Q?Sr(F,Math.min(Se??F,F),r,o):Vl(F,Se,r,h,n===$e.HERO_CENTER,o)}case $e.UNCONTAINED:return Sr(F,be,r,o);case $e.FULL_SCREEN:return Fl(F,r,o);default:return Q?Sr(F,be,r,o):$l(F,be,r,h,o)}},q=()=>{if(h=C.length,b=a?f.clientHeight:f.clientWidth,T=h?Math.min(T,h-1):0,b<=0||h===0){p=null;return}let F=n===$e.UNCONTAINED?0:i;if(p=Gl(H(b),b,r,i,F),!p.valid){p=null;return}let Q=p.itemSize+p.gap;v=-Di(p,0,h),E=C.map((Ee,ze)=>ze*Q-Di(p,ze,h)-v);let be=Math.max(0,E[h-1]??0);c.style[a?"height":"width"]=`${b+be}px`,c.style[a?"width":"height"]="",c.querySelectorAll(`.${m}`).forEach((Ee)=>Ee.remove());let Se=document.createDocumentFragment();E.forEach((Ee)=>{let ze=document.createElement("div");ze.className=m,ze.style[a?"top":"left"]=`${Ee}px`,Se.appendChild(ze)}),c.appendChild(Se),C.forEach((Ee)=>{Ee.style[a?"height":"width"]=`${p.itemSize}px`,Ee.style[a?"width":"height"]=""}),u.style.setProperty("--mtrl-carousel-corner",`${l}px`)},Y=()=>{if(!p)return;let F=A(),Q=F+v,be=zl(p,Q,Wl(p,h)),Se=p.itemSize,Ee=p.maxItemSize-p.minItemSize;for(let Xn=0;Xn<h;Xn++){let Dt=C[Xn],qn=Kl(p,be,Xn,Q),jn=Math.max(0,Math.min(Se,qn.size)),Gr=qn.center-Se/2+F,ta=qn.center+jn/2<-Se||qn.center-jn/2>b+Se,zr=Math.max(0,(Se-jn)/2),na=Ee>0?Math.min(1,Math.max(0,(jn-p.minItemSize)/Ee)):1,ra=ta?"hidden":`${Math.round(Gr*100)/100}|${Math.round(zr*100)/100}|${na.toFixed(3)}`;if(S.get(Dt)===ra)continue;if(S.set(Dt,ra),ta){Dt.style.visibility="hidden";continue}Dt.style.visibility="",Dt.style.transform=a?`translate3d(0, ${Gr}px, 0)`:`translate3d(${Gr}px, 0, 0)`,Dt.style.clipPath=a?`inset(${zr}px 0 round ${l}px)`:`inset(0 ${zr}px round ${l}px)`,Dt.style.setProperty("--mtrl-carousel-fade",na.toFixed(3))}if(y!==null){if(Math.abs(A()-(E[y]??0))<1)I();return}let ze=U(A());if(ze!==T)T=ze,R()},J=()=>{if(q(),p)x(T),N(E[T]??0,!1);Y()},w=(F)=>{if(!h)return;let Q=Math.min(Math.max(F,0),h-1);if(p)x(Q),N(E[Q]??0,!0);if(Q!==T)T=Q,R()},G=()=>w(T+1),j=()=>w(T-1),Z=(F)=>{let Q=F?.closest?.(`.${g}__item`);return Q?C.indexOf(Q):-1},xe=(F)=>{let Q=Z(F.target);if(Q<0)return;let be=a?"ArrowDown":"ArrowRight",Se=a?"ArrowUp":"ArrowLeft",Ee=-1;if(F.key===be)Ee=Q+1;else if(F.key===Se)Ee=Q-1;else if(F.key==="Home")Ee=0;else if(F.key==="End")Ee=h-1;if(Ee<0||Ee>=h)return;F.preventDefault(),C[Ee].focus({preventScroll:!0}),w(Ee)},ie=(F)=>{let Q=Z(F.target);if(Q>=0&&Q!==T)w(Q)},Ze=!1,Oe=!1,ge=0,Ae=0,ke=0,at=0,vn=0,js=0,wt=()=>{window.clearTimeout(js),f.removeEventListener("scrollend",wt),delete u.dataset.settling},Zs=(F)=>{if(I(),F.pointerType!=="mouse"||F.button!==0||!p)return;Ze=!0,Oe=!1,ge=a?F.clientY:F.clientX,ke=ge,at=F.timeStamp,vn=0,Ae=A(),wt(),u.dataset.settling="true",f.setPointerCapture(F.pointerId)},Qs=(F)=>{if(!Ze)return;let Q=a?F.clientY:F.clientX,be=Q-ge;if(!Oe&&Math.abs(be)<Df)return;Oe=!0,u.dataset.dragging="true";let Se=F.timeStamp-at;if(Se>0)vn=(Q-ke)/Se;if(ke=Q,at=F.timeStamp,a)f.scrollTop=Ae-be;else f.scrollLeft=Ae-be;F.preventDefault()},Yn=(F)=>{if(!Ze)return;if(Ze=!1,f.hasPointerCapture(F.pointerId))f.releasePointerCapture(F.pointerId);if(delete u.dataset.dragging,!Oe){wt();return}if(s){let Q=U(A());if(vn<-Yl)Q=Math.min(h-1,Q+1);else if(vn>Yl)Q=Math.max(0,Q-1);w(Q),f.addEventListener("scrollend",wt,{once:!0}),js=window.setTimeout(wt,600)}else wt()},Js=(F)=>{if(Oe)Oe=!1,F.preventDefault(),F.stopPropagation()};f.addEventListener("scroll",Y,{passive:!0}),f.addEventListener("wheel",I,{passive:!0}),f.addEventListener("touchstart",I,{passive:!0}),f.addEventListener("keydown",xe),f.addEventListener("focusin",ie),f.addEventListener("pointerdown",Zs),f.addEventListener("pointermove",Qs),f.addEventListener("pointerup",Yn),f.addEventListener("pointercancel",Yn),f.addEventListener("click",Js,!0),d?.addEventListener?.("change",J);let ea=typeof ResizeObserver==="function"?new ResizeObserver(J):null;ea?.observe(f),t.onSlidesChanged(J),J();let hm=t.lifecycle?.destroy,Nt=t;return Nt.getCurrentSlide=()=>T,Nt.getVariant=()=>n,Nt.next=G,Nt.prev=j,Nt.goTo=w,Nt.lifecycle={destroy:()=>{wt(),ea?.disconnect(),d?.removeEventListener?.("change",J),I(),f.removeEventListener("scroll",Y),f.removeEventListener("wheel",I),f.removeEventListener("touchstart",I),f.removeEventListener("keydown",xe),f.removeEventListener("focusin",ie),f.removeEventListener("pointerdown",Zs),f.removeEventListener("pointermove",Qs),f.removeEventListener("pointerup",Yn),f.removeEventListener("pointercancel",Yn),f.removeEventListener("click",Js,!0),hm?.()}},Nt};var Xl=()=>(e)=>{let t={element:e.element,slides:e.slides,lifecycle:{destroy:()=>e.lifecycle?.destroy()},getClass:e.getClass,next(){return e.next(),t},prev(){return e.prev(),t},goTo(n){return e.goTo(n),t},getCurrentSlide:()=>e.getCurrentSlide(),getVariant:()=>e.getVariant(),addSlide(n,r){return e.slides.addSlide(n,r),t},removeSlide(n){return e.slides.removeSlide(n),t},destroy(){e.lifecycle?.destroy()},on(n,r){return e.on?.(n,r),t},off(n,r){return e.off?.(n,r),t},addClass(...n){return e.element.classList.add(...n),t}};return t};var ql=(e={})=>{let t=xl(e);return M(D,k(),O(Il(t)),Ti(t),P(),Mi(t),Xl())(t)},Oi=ql;se();te();re();var jl=({disabled:e,lifecycle:t,checkable:n})=>(r)=>({...r,element:r.element,input:r.input,getValue(){return n.isChecked()},setValue(i){if(typeof i==="boolean")if(i)n.check();else n.uncheck();else if(typeof i==="string")if(i==="true"||i==="1")n.check();else n.uncheck();return this},getValueAttribute(){return r.input?.value||""},setValueAttribute(i){if(r.input)r.input.value=i;return this},check(){return n.check(),this},uncheck(){return n.uncheck(),this},toggle(){return n.toggle(),this},isChecked(){return n.isChecked()},setIndeterminate(i){return r.setIndeterminate?.(i),this},setLabel(i){return r.text?.setText(i),this},getLabel(){return r.text?.getText()||""},on(i,s){return r.on?.(i,s),this},off(i,s){return r.off?.(i,s),this},enable(){return e.enable(),this},disable(){return e.disable(),this},destroy(){t.destroy()}});ne();var Mf={variant:"filled",labelPosition:"end"},Zl=(e={})=>_(Mf,e,"checkbox"),Ql=(e)=>V(e,{tag:"div",className:e.class,interactive:!0}),Jl=(e)=>(t)=>{let n=document.createElement("span");return n.className=`${e.prefix}-checkbox-icon`,n.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
|
-
`,t.element.appendChild(n),t},rd=(e)=>(t)=>{let n=e.labelPosition||"end",r=`${e.prefix}-checkbox--label-${n}`;return t.element.classList.add(r),t},id=(e)=>({disabled:{enable:e.disabled?.enable,disable:e.disabled?.disable},lifecycle:{destroy:e.lifecycle?.destroy},checkable:{check:e.checkable?.check,uncheck:e.checkable?.uncheck,toggle:e.checkable?.toggle,isChecked:e.checkable?.isChecked}});var _f=(e,t)=>{let n=_t(t)(e);if(t.indeterminate)n.input.indeterminate=!0;return n.setIndeterminate=(r)=>(n.input.indeterminate=r,n.element.classList.toggle(`${t.prefix}-checkbox--indeterminate`,r),n),n},Pf=(e={})=>{let t=ed(e);try{return M(D,k(),O(td(t)),Rt(t),nd(t),et(t),rd(t),(r)=>_f(r,t),de(t),P(),(r)=>Jl(id(r))(r))(t)}catch(n){throw console.error("Checkbox creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create checkbox: ${n instanceof Error?n.message:String(n)}`)}},_i=Pf;se();te();re();var sd=({disabled:e,lifecycle:t})=>(n)=>{let r=n.element.classList.contains(`${n.getClass("chip")}--selected`),i=n.element.getAttribute("data-value")||null,s=["filled","outlined","elevated","assist","filter","input","suggestion"],a=null;for(let o of s)if(n.element.classList.contains(`${n.getClass("chip")}--${o}`)){a=o;break}return{...n,element:n.element,getValue(){let o=n.element.getAttribute("data-value");if(o!==null)return i=o,o;if(i!==null)return n.element.setAttribute("data-value",i),i;let l=n.element.querySelector(`.${n.getClass("chip")}-text`);if(l&&l.textContent){let d=l.textContent;if(d.includes(" Theme"))i=d.replace(" Theme","").toLowerCase();else i=d.toLowerCase().replace(/\s+/g,"-");return n.element.setAttribute("data-value",i),i}return null},setValue(o){if(o!==null&&o!==void 0)i=o,n.element.setAttribute("data-value",o);else i=null,n.element.removeAttribute("data-value");return this},isDisabled(){return n.element.getAttribute("aria-disabled")==="true"},enable(){return e.enable(),n.element.classList.remove(`${n.getClass("chip")}--disabled`),n.element.setAttribute("aria-disabled","false"),n.element.setAttribute("tabindex","0"),this},disable(){return e.disable(),n.element.classList.add(`${n.getClass("chip")}--disabled`),n.element.setAttribute("aria-disabled","true"),n.element.setAttribute("tabindex","-1"),this},setText(o){let l=`.${n.getClass("chip")}-content`,d=n.element.querySelector(l)||n.element,u=`.${n.getClass("chip")}-text`,f=n.element.querySelector(u);if(!f&&o){f=document.createElement("span"),f.className=`${n.getClass("chip")}-text`;let c=n.element.querySelector(`.${n.getClass("chip")}-leading-icon`);if(c)d.insertBefore(f,c.nextSibling);else d.insertBefore(f,d.firstChild)}if(f){if(f.textContent=o||"",!o&&f.parentNode)f.parentNode.removeChild(f)}return this},getText(){let o=n.element.querySelector(`.${n.getClass("chip")}-text`);return o?o.textContent||"":""},setIcon(o){return this.setLeadingIcon(o)},getIcon(){let o=n.element.querySelector(`.${n.getClass("chip")}-leading-icon`);return o?o.innerHTML:""},setLeadingIcon(o){let l=n.element.querySelector(`.${n.getClass("chip")}-content`)||n.element,d=`.${n.getClass("chip")}-leading-icon`,u=n.element.querySelector(d);if(!u&&o)u=document.createElement("span"),u.className=`${n.getClass("chip")}-leading-icon`,l.insertBefore(u,l.firstChild);if(u){if(u.innerHTML=o||"",!o&&u.parentNode)u.parentNode.removeChild(u)}return this},setTrailingIcon(o,l){let d=n.element.querySelector(`.${n.getClass("chip")}-content`)||n.element,u=`.${n.getClass("chip")}-trailing-icon`,f=n.element.querySelector(u);if(!f&&o){if(f=document.createElement("span"),f.className=`${n.getClass("chip")}-trailing-icon`,d.appendChild(f),l)f.addEventListener("click",(c)=>{c.stopPropagation(),l(this)})}if(f){if(f.innerHTML=o||"",!o&&f.parentNode)f.parentNode.removeChild(f)}return this},isSelected(){return r},setSelected(o){if(r=!!o,o)n.element.classList.add(`${n.getClass("chip")}--selected`),n.element.setAttribute("aria-selected","true");else n.element.classList.remove(`${n.getClass("chip")}--selected`),n.element.setAttribute("aria-selected","false");return this},toggleSelected(){return this.setSelected(!r)},getVariant(){return a},setVariant(o){if(a)n.element.classList.remove(`${n.getClass("chip")}--${a}`);if(o)n.element.classList.add(`${n.getClass("chip")}--${o}`);return a=o,this},destroy(){t.destroy()}}};ne();var kf={variant:"filled",ripple:!0},ad=(e={})=>_(kf,e,"chip"),od=(e)=>{let t={role:"button",tabindex:"0"};if(e.disabled===!0)t["aria-disabled"]="true";if(e.selected===!0)t["aria-selected"]="true";else if(e.selected===!1)t["aria-selected"]="false";let n=[e.class,e.selected?`${e.prefix}-chip--selected`:null];return V(e,{tag:"div",attributes:t,className:n,forwardEvents:{click:(r)=>r.element.getAttribute("aria-disabled")!=="true",keydown:(r,i)=>{if(i.key===" "||i.key==="Enter")return i.preventDefault(),r.element.click(),!0;return!1},focus:!0,blur:!0}})},ld=(e)=>({disabled:{enable:()=>e.disabled?.enable(),disable:()=>e.disabled?.disable()},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}});var Bf=(e={})=>{let t=ad(e);try{let n=M(D,k(),O(od(t)),oe(t),de(t),we(t),P())(t),r=document.createElement("div");if(r.className=`${n.getClass("chip")}-content`,r.style.display="flex",r.style.alignItems="center",r.style.gap="8px",r.style.width="100%",n.element.appendChild(r),e.leadingIcon||e.icon){let a=document.createElement("span");a.className=`${n.getClass("chip")}-leading-icon`,a.innerHTML=e.leadingIcon||e.icon||"",r.appendChild(a)}if(e.text){let a=document.createElement("span");a.className=`${n.getClass("chip")}-text`,a.textContent=e.text,r.appendChild(a)}if(e.trailingIcon){let a=document.createElement("span");if(a.className=`${n.getClass("chip")}-trailing-icon`,a.innerHTML=e.trailingIcon,e.onTrailingIconClick)a.addEventListener("click",(o)=>{o.stopPropagation(),e.onTrailingIconClick(n)});r.appendChild(a)}if(e.selected)n.element.classList.add(`${n.getClass("chip")}--selected`),n.element.setAttribute("aria-selected","true");if(e.value)n.element.setAttribute("data-value",e.value);let i=sd(ld(n))(n);if(!n.element.hasAttribute("data-value")&&e.text)i.getValue();if((e.variant==="filter"||e.variant==="assist"||e.variant==="suggestion"||e.selectable)&&!e.managedSelection)n.element.addEventListener("click",()=>{if(i.isDisabled())return;let a=i.isSelected();i.toggleSelected();let o=i.isSelected();if(e.onChange&&a!==o)e.onChange(o,i);if(e.onSelect)e.onSelect(i)});return i}catch(n){throw console.error("Chip creation error:",n),Error(`Failed to create chip: ${n.message}`)}},sn=Bf;te();re();var Pi=(e)=>(t)=>{let n={scrollable:e.scrollable===!0,vertical:e.vertical===!0};return{...t,layout:{setScrollable(r){if(n.scrollable=r,t.element)if(r)t.element.classList.add(`${t.getClass("chips")}--scrollable`);else t.element.classList.remove(`${t.getClass("chips")}--scrollable`);return this},isScrollable(){return n.scrollable},setVertical(r){if(n.vertical=r,t.element)if(r)t.element.classList.add(`${t.getClass("chips")}--vertical`);else t.element.classList.remove(`${t.getClass("chips")}--vertical`);return this},isVertical(){return n.vertical}}}};var ki=(e)=>(t)=>({...t,chipInstances:[],onCreated(){if(typeof t.onCreated==="function")t.onCreated();if(Array.isArray(e.chips)&&e.chips.length>0)e.chips.forEach((r)=>{this.chips?.addChip?.(r)})}});var an={CHANGE:"change",ADD:"add",REMOVE:"remove"};var Bi=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize chips controller: missing element"),t;let n={change:[],add:[],remove:[]},r=-1,i=(h,...b)=>{if(n[h])n[h].forEach((v)=>v(...b))},s=(h)=>{if(h.isSelected())h.element.classList.add(`${t.getClass("chip")}--selected`),h.element.setAttribute("aria-selected","true");else h.element.classList.remove(`${t.getClass("chip")}--selected`),h.element.setAttribute("aria-selected","false");if(!e.multiSelect){if(t.chipInstances.forEach((T)=>{if(T!==h&&T.isSelected())T.setSelected(!1),T.element.classList.remove(`${t.getClass("chip")}--selected`),T.element.setAttribute("aria-selected","false")}),!h.isSelected()&&f().length===0)h.setSelected(!0),h.element.classList.add(`${t.getClass("chip")}--selected`),h.element.setAttribute("aria-selected","true")}let v=t.chipInstances.filter((T)=>T.isSelected()).map((T)=>T.getValue()),E=h?h.getValue():null;if(typeof e.onChange==="function")e.onChange(v,E);i(an.CHANGE,v,E)},a=(h)=>{if(t.chipInstances.length===0)return;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," "].includes(h.key))return;if(h.key==="Enter"||h.key===" "){if(r>=0&&r<t.chipInstances.length){h.preventDefault();let b=t.chipInstances[r];if(!b.isDisabled()){if(b.toggleSelected(),b.isSelected())b.element.classList.add(`${t.getClass("chip")}--selected`),b.element.setAttribute("aria-selected","true");else b.element.classList.remove(`${t.getClass("chip")}--selected`),b.element.setAttribute("aria-selected","false");s(b)}return}}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(h.key)){h.preventDefault();let b=t.layout&&t.layout.isVertical(),v=r;if(r===-1)v=0;else if(b&&h.key==="ArrowUp"||!b&&h.key==="ArrowLeft")v=Math.max(0,r-1);else if(b&&h.key==="ArrowDown"||!b&&h.key==="ArrowRight")v=Math.min(t.chipInstances.length-1,r+1);if(v!==r){if(r>=0&&r<t.chipInstances.length)t.chipInstances[r].element.blur();if(r=v,t.chipInstances[r].element.focus(),t.layout&&t.layout.isScrollable())o(r)}}},o=(h)=>{if(!(t.layout&&t.layout.isScrollable()))return;let v=typeof h==="number"?h:t.chipInstances.indexOf(h);if(v>=0&&v<t.chipInstances.length){let E=t.chipInstances[v].element,T=t.chipContainer||t.element,S=T.getBoundingClientRect(),y=E.getBoundingClientRect();if(t.layout&&t.layout.isVertical()){let I=E.offsetTop-T.offsetTop-S.height/2+y.height/2;T.scrollTo({top:Math.max(0,I),behavior:"smooth"})}else{let I=E.offsetLeft-T.offsetLeft-S.width/2+y.width/2;T.scrollTo({left:Math.max(0,I),behavior:"smooth"})}}},l=(h)=>{let b=sn({...h,managedSelection:!0,onSelect:h.onSelect}),v=t.chipContainer||t.element,E=document.createDocumentFragment();return E.appendChild(b.element),v.appendChild(E),t.chipInstances.push(b),b.element.addEventListener("click",()=>{if(!b.isDisabled()){if(b.toggleSelected(),b.isSelected())b.element.classList.add(`${t.getClass("chip")}--selected`),b.element.setAttribute("aria-selected","true");else b.element.classList.remove(`${t.getClass("chip")}--selected`),b.element.setAttribute("aria-selected","false");s(b),r=t.chipInstances.indexOf(b)}}),b.element.addEventListener("keydown",a),i(an.ADD,b),b},d=(h)=>{let b=typeof h==="number"?h:t.chipInstances.indexOf(h);if(b>=0&&b<t.chipInstances.length){let v=t.chipInstances[b];if(i(an.REMOVE,v),v.destroy(),t.chipInstances.splice(b,1),b===r)r=-1;else if(b<r)r--}},u=()=>[...t.chipInstances],f=()=>t.chipInstances.filter((h)=>h.isSelected()),c=()=>f().map((h)=>h.getValue()),C=(h,b=!0,v=!e.multiSelect)=>{let E=Array.isArray(h)?h:[h],T=!1;if(v)t.chipInstances.forEach((S)=>{let y=S.getValue();if(!E.includes(y)&&S.isSelected())S.setSelected(!1),S.element.classList.remove(`${t.getClass("chip")}--selected`),S.element.setAttribute("aria-selected","false"),T=!0});if(t.chipInstances.forEach((S)=>{let y=S.getValue();if(E.includes(y)&&!S.isSelected())S.setSelected(!0),S.element.classList.add(`${t.getClass("chip")}--selected`),S.element.setAttribute("aria-selected","true"),T=!0}),T&&b){let S=c();i(an.CHANGE,S,null)}},g=(h=!0)=>{let v=c().length>0;if(t.chipInstances.forEach((E)=>{E.setSelected(!1),E.element.classList.remove(`${t.getClass("chip")}--selected`),E.element.setAttribute("aria-selected","false")}),v&&h)i(an.CHANGE,[],null)},m=()=>{t.chipInstances.forEach((h)=>{h.element.addEventListener("keydown",a)})},p=()=>{t.chipInstances.forEach((h)=>{h.element.removeEventListener("keydown",a)})};if(m(),t.element)t.element.addEventListener("keydown",a);if(t.lifecycle){let h=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{t.chipInstances.forEach((b)=>{b.element.removeEventListener("keydown",a)}),t.chipInstances.forEach((b)=>b.destroy()),t.chipInstances.length=0,Object.keys(n).forEach((b)=>{n[b]=[]}),h()}}return{...t,chips:{addChip:l,removeChip:d,getChips:u,getSelectedChips:f,getSelectedValues:c,selectByValue:C,clearSelection:g,scrollToChip:o},keyboard:{enable:m,disable:p},on(h,b){if(!n[h])n[h]=[];return n[h].push(b),this},off(h,b){if(n[h]){let v=n[h].indexOf(b);if(v!==-1)n[h].splice(v,1)}return this}}};Qe();var Hi=(e)=>(t)=>{let n=(o)=>t.getClass(o),r=e.label&&e.label.trim().length>0,i=e.labelPosition||"start",s;if(r)s=B({tag:"label",className:n("chips-label"),text:e.label,container:t.element});let a=B({tag:"div",className:n("chips-container"),container:t.element});return{...t,chipContainer:a,label:s,getChipContainer:()=>a,getLabel:()=>s||null}};var dd=(e)=>(t)=>({...t,element:t.element,addChip(n){if(e.chips&&typeof e.chips.addChip==="function")e.chips.addChip(n);return this},removeChip(n){if(e.chips&&typeof e.chips.removeChip==="function")e.chips.removeChip(n);return this},getChips(){if(e.chips&&typeof e.chips.getChips==="function")return e.chips.getChips();return[]},getSelectedChips(){if(e.chips&&typeof e.chips.getSelectedChips==="function")return e.chips.getSelectedChips();return[]},getSelectedValues(){if(e.chips&&typeof e.chips.getSelectedValues==="function")return e.chips.getSelectedValues();return[]},getValue(){if(e.chips&&typeof e.chips.getSelectedValues==="function"){let n=e.chips.getSelectedValues();if(!e.config?.multiSelect)return n.length>0?n[0]:null;return n}return e.config?.multiSelect?[]:null},setValue(n){if(e.chips&&typeof e.chips.selectByValue==="function"){if(e.chips.clearSelection)e.chips.clearSelection();let r=[];if(n){if(Array.isArray(n))r=n.filter((i)=>i!=null&&i!=="");else if(typeof n==="string"&&n!=="")r=[n]}if(r.length>0)e.chips.selectByValue(r,!1)}return this},selectByValue(n,r=!0){if(e.chips&&typeof e.chips.selectByValue==="function")e.chips.selectByValue(n,r);return this},clearSelection(){if(e.chips&&typeof e.chips.clearSelection==="function")e.chips.clearSelection();return this},setScrollable(n){if(e.layout&&typeof e.layout.setScrollable==="function")e.layout.setScrollable(n);return this},setVertical(n){if(e.layout&&typeof e.layout.setVertical==="function")e.layout.setVertical(n);return this},setLabel(n){if(e.label&&typeof e.label.setText==="function")e.label.setText(n);return this},getLabel(){if(e.label&&typeof e.label.getText==="function")return e.label.getText();return""},setLabelPosition(n){if(e.label&&typeof e.label.setPosition==="function")e.label.setPosition(n);return this},getLabelPosition(){if(e.label&&typeof e.label.getPosition==="function")return e.label.getPosition();return"start"},scrollToChip(n){if(e.chips&&typeof e.chips.scrollToChip==="function")e.chips.scrollToChip(n);return this},enableKeyboardNavigation(){if(e.keyboard&&typeof e.keyboard.enableKeyboardNavigation==="function")e.keyboard.enableKeyboardNavigation();return this},on(n,r){if(e.events&&typeof e.events.on==="function")e.events.on(n,r);return this},off(n,r){if(e.events&&typeof e.events.off==="function")e.events.off(n,r);return this},destroy(){if(e.lifecycle&&typeof e.lifecycle.destroy==="function")e.lifecycle.destroy()}});ne();var $f={chips:[],scrollable:!1,vertical:!1,multiSelect:!1,onChange:null,selector:null,labelPosition:"start"},ud=(e={})=>_($f,e,"chips"),cd=(e)=>{let t=e.scrollable===!0,n=e.vertical===!0,r=e.multiSelect===!0,i=e.label&&e.label.trim().length>0,s=e.labelPosition||"start",a=["chips",e.class,t?"chips--scrollable":"",n?"chips--vertical":"",i?"chips--with-label":"",i&&s==="end"?"chips--label-end":""].filter(Boolean).join(" ");return V(e,{tag:"div",attributes:{role:"group","aria-multiselectable":r?"true":"false"},className:a})},md=(e,t)=>({config:{multiSelect:t?.multiSelect??!1},chips:{addChip:function(n){if(e.chips&&typeof e.chips.addChip==="function")return e.chips.addChip(n);return null},removeChip:(n)=>e.chips?.removeChip?.(n),getChips:()=>e.chips?.getChips?.()??[],getSelectedChips:()=>e.chips?.getSelectedChips?.()??[],getSelectedValues:()=>e.chips?.getSelectedValues?.()??[],selectByValue:(n)=>e.chips?.selectByValue?.(n),clearSelection:()=>e.chips?.clearSelection?.(),scrollToChip:(n)=>e.chips?.scrollToChip?.(n)},layout:{setScrollable:(n)=>e.layout?.setScrollable?.(n),isScrollable:()=>e.layout?.isScrollable?.()??!1,setVertical:(n)=>e.layout?.setVertical?.(n),isVertical:()=>e.layout?.isVertical?.()??!1},label:{setText:(n)=>e.label?.setText?.(n),getText:()=>e.label?.getText?.()??"",setPosition:(n)=>e.label?.setPosition?.(n),getPosition:()=>e.label?.getPosition?.()??"start"},keyboard:{enableKeyboardNavigation:()=>e.keyboard?.enable?.(),disableKeyboardNavigation:()=>e.keyboard?.disable?.()},events:{on:(n,r)=>e.on?.(n,r),off:(n,r)=>e.off?.(n,r)},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}});var Vf=(e={})=>{let t=ud(e);try{let n=M(D,k(),O(cd(t)),Pi(t),ki(t),Hi(t),Bi(t),P())(t),r=md(n,t),i=dd(r)(n);if(t.on&&typeof i.on==="function")Object.entries(t.on).forEach(([s,a])=>{if(typeof a==="function")i.on(s,a)});if(Array.isArray(t.chips)&&t.chips.length>0)t.chips.forEach((s)=>{i.addChip(s)});return i}catch(n){throw console.error("Chips creation error:",n),Error(`Failed to create chip: ${n.message}`)}},$i=Vf;nt();se();te();re();var fd=["S","M","T","W","T","F","S"],Ar=["January","February","March","April","May","June","July","August","September","October","November","December"],wr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],gd="MM/DD/YYYY",pd="today",Nr="selected",hd="outside-month",Cd="range-start",Ed="range-end",bd="range-middle";var Ve=(e)=>{if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;if(typeof e==="string"){let t=new Date(e);return isNaN(t.getTime())?null:t}return null},yt=(e,t="MM/DD/YYYY")=>{if(!e||!(e instanceof Date)||isNaN(e.getTime()))return"";let n="",r=0;while(r<t.length)if(t.substring(r,r+4)==="MMMM")n+=Ar[e.getMonth()],r+=4;else if(t.substring(r,r+3)==="MMM")n+=wr[e.getMonth()],r+=3;else if(t.substring(r,r+2)==="MM")n+=(e.getMonth()+1).toString().padStart(2,"0"),r+=2;else if(t.substring(r,r+1)==="M")n+=e.getMonth()+1,r+=1;else if(t.substring(r,r+4)==="YYYY")n+=e.getFullYear(),r+=4;else if(t.substring(r,r+2)==="YY")n+=e.getFullYear().toString().slice(-2),r+=2;else if(t.substring(r,r+2)==="DD")n+=e.getDate().toString().padStart(2,"0"),r+=2;else if(t.substring(r,r+1)==="D")n+=e.getDate(),r+=1;else n+=t[r],r+=1;return n},vd=(e,t)=>new Date(e,t+1,0).getDate(),Ff=(e,t)=>new Date(e,t,1).getDay(),St=(e,t)=>e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear(),Uf=(e,t,n)=>{let r=e.getTime();return r>=t.getTime()&&r<=n.getTime()},Td=(e,t,n=null,r=null,i=null,s=null)=>{let a=new Date;a.setHours(0,0,0,0);let o=[],l=Ff(e,t),d=vd(e,t-1);for(let C=l-1;C>=0;C--){let g=new Date(e,t-1,d-C),m=i&&g<i||s&&g>s;o.push({date:g,day:g.getDate(),isCurrentMonth:!1,isToday:St(g,a),isSelected:n?St(g,n):!1,isDisabled:m})}let u=vd(e,t);for(let C=1;C<=u;C++){let g=new Date(e,t,C),m=n?St(g,n):!1,p=i&&g<i||s&&g>s,h={date:g,day:C,isCurrentMonth:!0,isToday:St(g,a),isSelected:m,isDisabled:p};if(n&&r)h.isRangeStart=St(g,n),h.isRangeEnd=St(g,r),h.isRangeMiddle=Uf(g,n,r)&&!h.isRangeStart&&!h.isRangeEnd;o.push(h)}let c=42-o.length;for(let C=1;C<=c;C++){let g=new Date(e,t+1,C),m=i&&g<i||s&&g>s;o.push({date:g,day:C,isCurrentMonth:!1,isToday:St(g,a),isSelected:n?St(g,n):!1,isDisabled:m})}return o},Sd=(e,t=10)=>{let n=[],r=e-t,i=e+t;for(let s=r;s<=i;s++)n.push(s);return n};var Vi=(e,t)=>{let n=new Date(e);return n.setMonth(n.getMonth()+t),n};var yd=(e,{disabled:t,lifecycle:n,events:r})=>(i)=>{let s={goToDate(a){let o=Ve(a);if(!o)return;e.currentMonth=o.getMonth(),e.currentYear=o.getFullYear(),e.updateCalendar()},nextMonth(){let a=Vi(new Date(e.currentYear,e.currentMonth,1),1);e.currentMonth=a.getMonth(),e.currentYear=a.getFullYear(),e.updateCalendar()},prevMonth(){let a=Vi(new Date(e.currentYear,e.currentMonth,1),-1);e.currentMonth=a.getMonth(),e.currentYear=a.getFullYear(),e.updateCalendar()},nextYear(){e.currentYear+=1,e.updateCalendar()},prevYear(){e.currentYear-=1,e.updateCalendar()},showDayView(){e.currentView="day",e.updateCalendar()},showMonthView(){e.currentView="month",e.updateCalendar()},showYearView(){e.currentView="year",e.updateCalendar()},getCurrentView(){return e.currentView}};return{...i,element:i.element,input:e.input,calendar:s,open(){return e.isOpen=!0,e.render(),r.emit("open",{value:this.getValue()}),this},close(){return e.isOpen=!1,e.render(),r.emit("close",{value:this.getValue()}),this},getValue(){if(!e.selectedDate)return null;if(e.selectionMode==="range"&&e.rangeEndDate)return[new Date(e.selectedDate),new Date(e.rangeEndDate)];return new Date(e.selectedDate)},setValue(a){if(Array.isArray(a)&&e.selectionMode==="range"){let l=Ve(a[0]),d=Ve(a[1]);if(l&&d){if(e.selectedDate=l,e.rangeEndDate=d,l>d)e.selectedDate=d,e.rangeEndDate=l;if(e.updateInputValue(),e.isOpen)e.currentMonth=e.selectedDate.getMonth(),e.currentYear=e.selectedDate.getFullYear(),e.updateCalendar();r.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this}let o=Ve(a);if(o){if(e.selectedDate=o,e.rangeEndDate=null,e.updateInputValue(),e.isOpen)e.currentMonth=o.getMonth(),e.currentYear=o.getFullYear(),e.updateCalendar();r.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this},getFormattedValue(){if(!e.selectedDate)return"";if(e.selectionMode==="range"&&e.rangeEndDate){let a=yt(e.selectedDate,e.dateFormat),o=yt(e.rangeEndDate,e.dateFormat);return`${a} - ${o}`}return yt(e.selectedDate,e.dateFormat)},clear(){if(e.selectedDate=null,e.rangeEndDate=null,e.updateInputValue(),e.isOpen)e.updateCalendar();return r.emit("change",{value:null,formattedValue:""}),this},enable(){return t.enable(),e.input.disabled=!1,this},disable(){return t.disable(),e.input.disabled=!0,this},setMinDate(a){let o=Ve(a);if(o){if(e.minDate=o,e.isOpen)e.updateCalendar()}return this},setMaxDate(a){let o=Ve(a);if(o){if(e.maxDate=o,e.isOpen)e.updateCalendar()}return this},destroy(){if(document.removeEventListener("click",e.outsideClickHandler),e.calendarElement&&e.calendarElement.parentNode)e.calendarElement.parentNode.removeChild(e.calendarElement);n.destroy()},on(a,o){return r.on(a,o),this},off(a,o){return r.off(a,o),this}}};ne();var Gf={variant:"docked",initialView:"day",selectionMode:"single",dateFormat:gd,animate:!0},xd=(e={})=>{let t=_(Gf,e,"datepicker");if(t.closeOnSelect===void 0)t.closeOnSelect=t.variant!=="docked";return t},Id=(e)=>V(e,{tag:"div",attributes:{role:"application","aria-label":"Date Picker",tabindex:"-1"},className:[`${e.prefix}-datepicker-container`,e.class],forwardEvents:{keydown:!0,click:!0},interactive:!0}),Ld=(e)=>{let t={type:"text",placeholder:e.placeholder||e.dateFormat,autocomplete:"off",readonly:!0};if(e.disabled===!0)t.disabled=!0;return V(e,{tag:"input",attributes:t,className:`${e.prefix}-datepicker-input`,forwardEvents:{focus:!0,blur:!0,click:!0},interactive:!0})},Ad=(e)=>V(e,{tag:"div",attributes:{role:"dialog","aria-modal":e.variant!=="docked"?"true":"false"},className:[`${e.prefix}-datepicker-calendar`,`${e.prefix}-datepicker-${e.variant}`,e.selectionMode==="range"?`${e.prefix}-datepicker-range`:""],forwardEvents:{keydown:!0,click:!0}}),wd=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable()},lifecycle:{destroy:()=>e.lifecycle.destroy()},events:{on:e.on,off:e.off,emit:e.emit}});Qe();var zf=({currentMonth:e,currentYear:t,currentView:n,prefix:r,emit:i})=>{let s=B({tag:"div",className:`${r}-datepicker-header`}),a=B({tag:"button",className:`${r}-datepicker-month-selector`,text:Ar[e],attributes:{type:"button","aria-label":"Select month"}}),o=B({tag:"button",className:`${r}-datepicker-year-selector`,text:t.toString(),attributes:{type:"button","aria-label":"Select year"}}),l=B({tag:"div",className:`${r}-datepicker-nav-controls`}),d=B({tag:"button",className:`${r}-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":n==="day"?"Previous month":n==="month"?"Previous year":"Previous year range"}}),u=B({tag:"button",className:`${r}-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":n==="day"?"Next month":n==="month"?"Next year":"Next year range"}});return a.addEventListener("click",(f)=>{f.stopPropagation(),i("viewChange",{view:"month"})}),o.addEventListener("click",(f)=>{f.stopPropagation(),i("viewChange",{view:"year"})}),d.addEventListener("click",(f)=>{if(f.stopPropagation(),n==="day")i("prevMonth");else if(n==="month")i("prevYear");else i("prevYearRange")}),u.addEventListener("click",(f)=>{if(f.stopPropagation(),n==="day")i("nextMonth");else if(n==="month")i("nextYear");else i("nextYearRange")}),s.appendChild(a),s.appendChild(o),l.appendChild(d),l.appendChild(u),s.appendChild(l),s},Wf=(e)=>{let t=B({tag:"div",className:`${e}-datepicker-weekdays`});return fd.forEach((n)=>{let r=B({tag:"span",className:`${e}-datepicker-weekday`,text:n});t.appendChild(r)}),t},Kf=({currentYear:e,currentMonth:t,selectedDate:n,rangeEndDate:r,minDate:i,maxDate:s,prefix:a,emit:o})=>{let l=B({tag:"div",className:`${a}-datepicker-days`});return Td(e,t,n,r,i,s).forEach((u)=>{let f=[`${a}-datepicker-day`,u.isCurrentMonth?"":hd,u.isToday?pd:"",u.isSelected?Nr:"",u.isDisabled?"disabled":"",u.isRangeStart?Cd:"",u.isRangeEnd?Ed:"",u.isRangeMiddle?bd:""].filter(Boolean).join(" "),c=B({tag:"button",className:f,text:u.day.toString(),attributes:{type:"button","aria-label":u.date.toLocaleDateString(),"aria-selected":u.isSelected?"true":"false","aria-disabled":u.isDisabled?"true":"false","data-date":u.date.toISOString(),disabled:u.isDisabled}});c.addEventListener("click",(C)=>{if(C.stopPropagation(),!u.isDisabled)o("dateSelected",{date:u.date})}),l.appendChild(c)}),l},Yf=({currentMonth:e,prefix:t,emit:n})=>{let r=B({tag:"div",className:`${t}-datepicker-months`});return wr.forEach((i,s)=>{let a=s===e,o=B({tag:"button",className:`${t}-datepicker-month ${a?Nr:""}`,text:i,attributes:{type:"button","aria-selected":a?"true":"false","data-month":s.toString()}});o.addEventListener("click",(l)=>{l.stopPropagation(),n("monthSelected",{month:s})}),r.appendChild(o)}),r},Xf=({currentYear:e,prefix:t,emit:n})=>{let r=B({tag:"div",className:`${t}-datepicker-years`});return Sd(e,10).forEach((s)=>{let a=s===e,o=B({tag:"button",className:`${t}-datepicker-year ${a?Nr:""}`,text:s.toString(),attributes:{type:"button","aria-selected":a?"true":"false","data-year":s.toString()}});o.addEventListener("click",(l)=>{l.stopPropagation(),n("yearSelected",{year:s})}),r.appendChild(o)}),r},qf=({prefix:e,emit:t})=>{let n=B({tag:"div",className:`${e}-datepicker-footer`}),r=B({tag:"button",className:`${e}-datepicker-cancel ${e}-button ${e}-button--text`,text:"Cancel",attributes:{type:"button"}}),i=B({tag:"button",className:`${e}-datepicker-ok ${e}-button ${e}-button--text`,text:"OK",attributes:{type:"button"}});return r.addEventListener("click",(s)=>{s.stopPropagation(),t("cancel")}),i.addEventListener("click",(s)=>{s.stopPropagation(),t("confirm")}),n.appendChild(r),n.appendChild(i),n},Nd=(e,t)=>{let{prefix:n,currentView:r,currentMonth:i,currentYear:s,selectedDate:a,rangeEndDate:o,minDate:l,maxDate:d,variant:u}=e,f=B({tag:"div",className:`${n}-datepicker-calendar-content`}),c=zf({currentMonth:i,currentYear:s,currentView:r,prefix:n,emit:t});if(f.appendChild(c),r==="day"){let C=Wf(n);f.appendChild(C);let g=Kf({currentYear:s,currentMonth:i,selectedDate:a,rangeEndDate:o,minDate:l,maxDate:d,prefix:n,emit:t});f.appendChild(g)}else if(r==="month"){let C=Yf({currentMonth:i,prefix:n,emit:t});f.appendChild(C)}else if(r==="year"){let C=Xf({currentYear:s,prefix:n,emit:t});f.appendChild(C)}if(u!=="docked"){let C=qf({prefix:n,emit:t});f.appendChild(C)}return f};Qe();var jf=(e={})=>{let t=xd(e);try{let n={isOpen:!1,selectedDate:null,rangeEndDate:null,currentView:t.initialView,currentMonth:new Date().getMonth(),currentYear:new Date().getFullYear(),minDate:t.minDate?Ve(t.minDate):null,maxDate:t.maxDate?Ve(t.maxDate):null,dateFormat:t.dateFormat,variant:t.variant,selectionMode:t.selectionMode,closeOnSelect:t.closeOnSelect,prefix:t.prefix||K,calendarElement:null,input:null,updateInputValue(){if(!this.input)return;if(!this.selectedDate){this.input.value="";return}if(this.selectionMode==="range"&&this.rangeEndDate){let a=yt(this.selectedDate,this.dateFormat),o=yt(this.rangeEndDate,this.dateFormat);this.input.value=`${a} - ${o}`;return}this.input.value=yt(this.selectedDate,this.dateFormat)},updateCalendar(){if(!this.isOpen||!this.calendarElement)return;this.calendarElement.innerHTML="";let a=Nd(this,(o,l)=>{switch(o){case"dateSelected":this.handleDateSelection(l.date);break;case"monthSelected":this.currentMonth=l.month,this.currentView="day",this.updateCalendar();break;case"yearSelected":this.currentYear=l.year,this.currentView="month",this.updateCalendar();break;case"viewChange":this.currentView=l.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(a)},handleDateSelection(a){if(this.selectionMode==="range")if(!this.selectedDate||this.selectedDate&&this.rangeEndDate)this.selectedDate=a,this.rangeEndDate=null;else{if(a<this.selectedDate)this.rangeEndDate=this.selectedDate,this.selectedDate=a;else this.rangeEndDate=a;if(this.closeOnSelect)this.isOpen=!1}else if(this.selectedDate=a,this.closeOnSelect)this.isOpen=!1;this.updateInputValue(),this.updateCalendar(),r.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(t.value)if(Array.isArray(t.value)&&t.selectionMode==="range"){let a=Ve(t.value[0]),o=Ve(t.value[1]);if(a&&o)n.selectedDate=a,n.rangeEndDate=o,n.currentMonth=a.getMonth(),n.currentYear=a.getFullYear()}else{let a=Ve(t.value);if(a)n.selectedDate=a,n.currentMonth=a.getMonth(),n.currentYear=a.getFullYear()}let r=M(D,k(),O(Id(t)),de(t),P())(t),i=M(D,O(Ld(t)))(t);n.input=i.element,r.element.appendChild(n.input),n.updateInputValue();let s=Ad(t);return n.calendarElement=B({tag:"div",className:s.className,attributes:s.attributes}),n.calendarElement.style.display="none",r.element.appendChild(n.calendarElement),n.input.addEventListener("click",()=>{if(!r.element.classList.contains("disabled"))if(n.isOpen=!n.isOpen,n.render(),n.isOpen)r.emit("open",{value:n.selectedDate});else r.emit("close",{value:n.selectedDate})}),n.calendarElement.addEventListener("click",(a)=>{a.stopPropagation()}),document.addEventListener("click",(a)=>{if(n.isOpen&&!r.element.contains(a.target))n.isOpen=!1,n.render(),r.emit("close",{value:n.selectedDate})}),yd(n,wd(r))(r)}catch(n){throw console.error("DatePicker creation error:",n),Error(`Failed to create DatePicker: ${n.message}`)}},Fi=jf;se();te();re();ne();var Qf={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:[]},Dd=(e={})=>_(Qf,e,"dialog"),Md=(e)=>V(e,{tag:"div",attributes:{},className:e.class}),Od=(e)=>({tag:"div",attributes:{"aria-modal":e.modal===!1?!1:!0,role:"dialog",tabindex:-1},className:""}),Rd=(e)=>({visibility:{open:()=>e.visibility.open(),close:()=>e.visibility.close(),toggle:(t)=>e.visibility.toggle(t),isOpen:()=>e.visibility.isOpen()},content:{setTitle:(t)=>e.content.setTitle(t),getTitle:()=>e.content.getTitle(),setSubtitle:(t)=>e.content.setSubtitle(t),getSubtitle:()=>e.content.getSubtitle(),setContent:(t)=>e.content.setContent(t),getContent:()=>e.content.getContent(),getHeaderElement:()=>e.content.getHeaderElement(),getContentElement:()=>e.content.getContentElement(),getFooterElement:()=>e.content.getFooterElement()},buttons:{addButton:(t)=>e.buttons.addButton(t),removeButton:(t)=>e.buttons.removeButton(t),getButtons:()=>e.buttons.getButtons(),setFooterAlignment:(t)=>e.buttons.setFooterAlignment(t)},focus:{trapFocus:()=>e.focus.trapFocus(),releaseFocus:()=>e.focus.releaseFocus()},size:{setSize:(t)=>e.size.setSize(t)},divider:{toggleDivider:(t)=>e.divider.toggleDivider(t),hasDivider:()=>e.divider.hasDivider()},events:{on:(t,n)=>e.on(t,n),off:(t,n)=>e.off(t,n),trigger:(t,n)=>e.emit(t,n)},lifecycle:{destroy:()=>e.lifecycle.destroy()}});Ht();se();ne();var Jf={orientation:"horizontal",variant:"full-width",thickness:1},_d=(e={})=>_(Jf,e,"divider");var Pd=(e)=>(t)=>{let n=e.orientation||"horizontal";t.element.classList.add(`${t.getClass("divider")}--${n}`);let r=e.thickness||1;if(n==="horizontal")t.element.style.height=`${r}px`,t.element.style.width="100%";else t.element.style.width=`${r}px`,t.element.style.height="100%";return{...t,getOrientation(){return n},setOrientation(i){if(t.element.classList.remove(`${t.getClass("divider")}--${n}`),t.element.classList.add(`${t.getClass("divider")}--${i}`),i==="horizontal")t.element.style.height=`${r}px`,t.element.style.width="100%",t.element.style.marginTop="",t.element.style.marginBottom="";else t.element.style.width=`${r}px`,t.element.style.height="100%",t.element.style.marginLeft="",t.element.style.marginRight="";return this}}},kd=(e)=>(t)=>{let n=e.variant||"full-width",r=e.orientation||"horizontal";if(n==="inset"||n==="middle-inset")if(r==="horizontal"){let i=e.insetStart!==void 0?e.insetStart:16,s=e.insetEnd!==void 0?e.insetEnd:n==="middle-inset"?16:0;t.element.style.marginLeft=`${i}px`,t.element.style.marginRight=`${s}px`}else{let i=e.insetStart!==void 0?e.insetStart:16,s=e.insetEnd!==void 0?e.insetEnd:n==="middle-inset"?16:0;t.element.style.marginTop=`${i}px`,t.element.style.marginBottom=`${s}px`}return{...t,getVariant(){return n},setVariant(i){t.element.classList.remove(`${t.getClass("divider")}--${n}`),t.element.classList.add(`${t.getClass("divider")}--${i}`);let s=t.getOrientation?t.getOrientation():r;if(i==="full-width")if(s==="horizontal")t.element.style.marginLeft="",t.element.style.marginRight="";else t.element.style.marginTop="",t.element.style.marginBottom="";else{let a=e.insetStart!==void 0?e.insetStart:16,o=e.insetEnd!==void 0?e.insetEnd:i==="middle-inset"?16:0;if(s==="horizontal")t.element.style.marginLeft=`${a}px`,t.element.style.marginRight=`${o}px`;else t.element.style.marginTop=`${a}px`,t.element.style.marginBottom=`${o}px`}return this},setInset(i,s){let a=t.getOrientation?t.getOrientation():r;if((t.getVariant?t.getVariant():n)!=="full-width")if(a==="horizontal"){if(i!==void 0)t.element.style.marginLeft=`${i}px`;if(s!==void 0)t.element.style.marginRight=`${s}px`}else{if(i!==void 0)t.element.style.marginTop=`${i}px`;if(s!==void 0)t.element.style.marginBottom=`${s}px`}return this}}},Bd=(e)=>(t)=>{if(e.color)t.element.style.backgroundColor=e.color;let n=e.thickness||1,r=e.orientation||"horizontal";if(r==="horizontal")t.element.style.height=`${n}px`;else t.element.style.width=`${n}px`;return{...t,setThickness(i){if((t.getOrientation?t.getOrientation():r)==="horizontal")t.element.style.height=`${i}px`;else t.element.style.width=`${i}px`;return this},setColor(i){return t.element.style.backgroundColor=i,this}}};var Vt=(e={})=>{let t=_d(e);return M(D,O({tag:"hr",componentName:"divider",className:e.class}),Pd(t),oe(t),kd(t),Bd(t))(t)};xn();var on={OPEN:"open",CLOSE:"close",BEFORE_OPEN:"beforeopen",BEFORE_CLOSE:"beforeclose",AFTER_OPEN:"afteropen",AFTER_CLOSE:"afterclose"},Hd=(e)=>(t)=>{let n=Od(e),r=document.createElement(n.tag||"div");if(r.classList.add(t.getClass("dialog-overlay")),n.attributes&&typeof n.attributes==="object")Object.entries(n.attributes).forEach(([p,h])=>{if(p&&typeof p==="string"&&h!==void 0)r.setAttribute(p,String(h))});if(e.zIndex)r.style.zIndex=String(e.zIndex);let i=()=>{let p=document.createElement("div");p.classList.add(t.getClass("dialog-header"));let h=document.createElement("div");if(h.classList.add(t.getClass("dialog-header-content")),p.appendChild(h),e.title){let b=document.createElement("h2");b.classList.add(t.getClass("dialog-header-title")),b.textContent=e.title,h.appendChild(b)}if(e.subtitle){let b=document.createElement("p");b.classList.add(t.getClass("dialog-header-subtitle")),b.textContent=e.subtitle,h.appendChild(b)}if(e.closeButton!==!1){let b=document.createElement("button");b.classList.add(t.getClass("dialog-header-close")),b.setAttribute("aria-label","Close dialog"),b.innerHTML=`
|
|
13
|
+
`,t.element.appendChild(n),t},ed=(e)=>(t)=>{let n=e.labelPosition||"end",r=`${e.prefix}-checkbox--label-${n}`;return t.element.classList.add(r),t},td=(e)=>({disabled:{enable:e.disabled?.enable,disable:e.disabled?.disable},lifecycle:{destroy:e.lifecycle?.destroy},checkable:{check:e.checkable?.check,uncheck:e.checkable?.uncheck,toggle:e.checkable?.toggle,isChecked:e.checkable?.isChecked}});var Of=(e,t)=>{let n=Rt(t)(e);if(t.indeterminate)n.input.indeterminate=!0;return n.setIndeterminate=(r)=>(n.input.indeterminate=r,n.element.classList.toggle(`${t.prefix}-checkbox--indeterminate`,r),n),n},Rf=(e={})=>{let t=Zl(e);try{return M(D,k(),O(Ql(t)),Ot(t),Jl(t),et(t),ed(t),(r)=>Of(r,t),de(t),P(),(r)=>jl(td(r))(r))(t)}catch(n){throw console.error("Checkbox creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create checkbox: ${n instanceof Error?n.message:String(n)}`)}},_i=Rf;se();te();re();var nd=({disabled:e,lifecycle:t})=>(n)=>{let r=n.element.classList.contains(`${n.getClass("chip")}--selected`),i=n.element.getAttribute("data-value")||null,s=["filled","outlined","elevated","assist","filter","input","suggestion"],a=null;for(let o of s)if(n.element.classList.contains(`${n.getClass("chip")}--${o}`)){a=o;break}return{...n,element:n.element,getValue(){let o=n.element.getAttribute("data-value");if(o!==null)return i=o,o;if(i!==null)return n.element.setAttribute("data-value",i),i;let l=n.element.querySelector(`.${n.getClass("chip")}-text`);if(l&&l.textContent){let d=l.textContent;if(d.includes(" Theme"))i=d.replace(" Theme","").toLowerCase();else i=d.toLowerCase().replace(/\s+/g,"-");return n.element.setAttribute("data-value",i),i}return null},setValue(o){if(o!==null&&o!==void 0)i=o,n.element.setAttribute("data-value",o);else i=null,n.element.removeAttribute("data-value");return this},isDisabled(){return n.element.getAttribute("aria-disabled")==="true"},enable(){return e.enable(),n.element.classList.remove(`${n.getClass("chip")}--disabled`),n.element.setAttribute("aria-disabled","false"),n.element.setAttribute("tabindex","0"),this},disable(){return e.disable(),n.element.classList.add(`${n.getClass("chip")}--disabled`),n.element.setAttribute("aria-disabled","true"),n.element.setAttribute("tabindex","-1"),this},setText(o){let l=`.${n.getClass("chip")}-content`,d=n.element.querySelector(l)||n.element,u=`.${n.getClass("chip")}-text`,f=n.element.querySelector(u);if(!f&&o){f=document.createElement("span"),f.className=`${n.getClass("chip")}-text`;let c=n.element.querySelector(`.${n.getClass("chip")}-leading-icon`);if(c)d.insertBefore(f,c.nextSibling);else d.insertBefore(f,d.firstChild)}if(f){if(f.textContent=o||"",!o&&f.parentNode)f.parentNode.removeChild(f)}return this},getText(){let o=n.element.querySelector(`.${n.getClass("chip")}-text`);return o?o.textContent||"":""},setIcon(o){return this.setLeadingIcon(o)},getIcon(){let o=n.element.querySelector(`.${n.getClass("chip")}-leading-icon`);return o?o.innerHTML:""},setLeadingIcon(o){let l=n.element.querySelector(`.${n.getClass("chip")}-content`)||n.element,d=`.${n.getClass("chip")}-leading-icon`,u=n.element.querySelector(d);if(!u&&o)u=document.createElement("span"),u.className=`${n.getClass("chip")}-leading-icon`,l.insertBefore(u,l.firstChild);if(u){if(u.innerHTML=o||"",!o&&u.parentNode)u.parentNode.removeChild(u)}return this},setTrailingIcon(o,l){let d=n.element.querySelector(`.${n.getClass("chip")}-content`)||n.element,u=`.${n.getClass("chip")}-trailing-icon`,f=n.element.querySelector(u);if(!f&&o){if(f=document.createElement("span"),f.className=`${n.getClass("chip")}-trailing-icon`,d.appendChild(f),l)f.addEventListener("click",(c)=>{c.stopPropagation(),l(this)})}if(f){if(f.innerHTML=o||"",!o&&f.parentNode)f.parentNode.removeChild(f)}return this},isSelected(){return r},setSelected(o){if(r=!!o,o)n.element.classList.add(`${n.getClass("chip")}--selected`),n.element.setAttribute("aria-selected","true");else n.element.classList.remove(`${n.getClass("chip")}--selected`),n.element.setAttribute("aria-selected","false");return this},toggleSelected(){return this.setSelected(!r)},getVariant(){return a},setVariant(o){if(a)n.element.classList.remove(`${n.getClass("chip")}--${a}`);if(o)n.element.classList.add(`${n.getClass("chip")}--${o}`);return a=o,this},destroy(){t.destroy()}}};ne();var _f={variant:"filled",ripple:!0},rd=(e={})=>_(_f,e,"chip"),id=(e)=>{let t={role:"button",tabindex:"0"};if(e.disabled===!0)t["aria-disabled"]="true";if(e.selected===!0)t["aria-selected"]="true";else if(e.selected===!1)t["aria-selected"]="false";let n=[e.class,e.selected?`${e.prefix}-chip--selected`:null];return V(e,{tag:"div",attributes:t,className:n,forwardEvents:{click:(r)=>r.element.getAttribute("aria-disabled")!=="true",keydown:(r,i)=>{if(i.key===" "||i.key==="Enter")return i.preventDefault(),r.element.click(),!0;return!1},focus:!0,blur:!0}})},sd=(e)=>({disabled:{enable:()=>e.disabled?.enable(),disable:()=>e.disabled?.disable()},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}});var Pf=(e={})=>{let t=rd(e);try{let n=M(D,k(),O(id(t)),oe(t),de(t),we(t),P())(t),r=document.createElement("div");if(r.className=`${n.getClass("chip")}-content`,r.style.display="flex",r.style.alignItems="center",r.style.gap="8px",r.style.width="100%",n.element.appendChild(r),e.leadingIcon||e.icon){let a=document.createElement("span");a.className=`${n.getClass("chip")}-leading-icon`,a.innerHTML=e.leadingIcon||e.icon||"",r.appendChild(a)}if(e.text){let a=document.createElement("span");a.className=`${n.getClass("chip")}-text`,a.textContent=e.text,r.appendChild(a)}if(e.trailingIcon){let a=document.createElement("span");if(a.className=`${n.getClass("chip")}-trailing-icon`,a.innerHTML=e.trailingIcon,e.onTrailingIconClick)a.addEventListener("click",(o)=>{o.stopPropagation(),e.onTrailingIconClick(n)});r.appendChild(a)}if(e.selected)n.element.classList.add(`${n.getClass("chip")}--selected`),n.element.setAttribute("aria-selected","true");if(e.value)n.element.setAttribute("data-value",e.value);let i=nd(sd(n))(n);if(!n.element.hasAttribute("data-value")&&e.text)i.getValue();if((e.variant==="filter"||e.variant==="assist"||e.variant==="suggestion"||e.selectable)&&!e.managedSelection)n.element.addEventListener("click",()=>{if(i.isDisabled())return;let a=i.isSelected();i.toggleSelected();let o=i.isSelected();if(e.onChange&&a!==o)e.onChange(o,i);if(e.onSelect)e.onSelect(i)});return i}catch(n){throw console.error("Chip creation error:",n),Error(`Failed to create chip: ${n.message}`)}},sn=Pf;te();re();var Pi=(e)=>(t)=>{let n={scrollable:e.scrollable===!0,vertical:e.vertical===!0};return{...t,layout:{setScrollable(r){if(n.scrollable=r,t.element)if(r)t.element.classList.add(`${t.getClass("chips")}--scrollable`);else t.element.classList.remove(`${t.getClass("chips")}--scrollable`);return this},isScrollable(){return n.scrollable},setVertical(r){if(n.vertical=r,t.element)if(r)t.element.classList.add(`${t.getClass("chips")}--vertical`);else t.element.classList.remove(`${t.getClass("chips")}--vertical`);return this},isVertical(){return n.vertical}}}};var ki=(e)=>(t)=>({...t,chipInstances:[],onCreated(){if(typeof t.onCreated==="function")t.onCreated();if(Array.isArray(e.chips)&&e.chips.length>0)e.chips.forEach((r)=>{this.chips?.addChip?.(r)})}});var an={CHANGE:"change",ADD:"add",REMOVE:"remove"};var Bi=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize chips controller: missing element"),t;let n={change:[],add:[],remove:[]},r=-1,i=(h,...b)=>{if(n[h])n[h].forEach((v)=>v(...b))},s=(h)=>{if(h.isSelected())h.element.classList.add(`${t.getClass("chip")}--selected`),h.element.setAttribute("aria-selected","true");else h.element.classList.remove(`${t.getClass("chip")}--selected`),h.element.setAttribute("aria-selected","false");if(!e.multiSelect){if(t.chipInstances.forEach((T)=>{if(T!==h&&T.isSelected())T.setSelected(!1),T.element.classList.remove(`${t.getClass("chip")}--selected`),T.element.setAttribute("aria-selected","false")}),!h.isSelected()&&f().length===0)h.setSelected(!0),h.element.classList.add(`${t.getClass("chip")}--selected`),h.element.setAttribute("aria-selected","true")}let v=t.chipInstances.filter((T)=>T.isSelected()).map((T)=>T.getValue()),E=h?h.getValue():null;if(typeof e.onChange==="function")e.onChange(v,E);i(an.CHANGE,v,E)},a=(h)=>{if(t.chipInstances.length===0)return;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," "].includes(h.key))return;if(h.key==="Enter"||h.key===" "){if(r>=0&&r<t.chipInstances.length){h.preventDefault();let b=t.chipInstances[r];if(!b.isDisabled()){if(b.toggleSelected(),b.isSelected())b.element.classList.add(`${t.getClass("chip")}--selected`),b.element.setAttribute("aria-selected","true");else b.element.classList.remove(`${t.getClass("chip")}--selected`),b.element.setAttribute("aria-selected","false");s(b)}return}}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(h.key)){h.preventDefault();let b=t.layout&&t.layout.isVertical(),v=r;if(r===-1)v=0;else if(b&&h.key==="ArrowUp"||!b&&h.key==="ArrowLeft")v=Math.max(0,r-1);else if(b&&h.key==="ArrowDown"||!b&&h.key==="ArrowRight")v=Math.min(t.chipInstances.length-1,r+1);if(v!==r){if(r>=0&&r<t.chipInstances.length)t.chipInstances[r].element.blur();if(r=v,t.chipInstances[r].element.focus(),t.layout&&t.layout.isScrollable())o(r)}}},o=(h)=>{if(!(t.layout&&t.layout.isScrollable()))return;let v=typeof h==="number"?h:t.chipInstances.indexOf(h);if(v>=0&&v<t.chipInstances.length){let E=t.chipInstances[v].element,T=t.chipContainer||t.element,S=T.getBoundingClientRect(),y=E.getBoundingClientRect();if(t.layout&&t.layout.isVertical()){let I=E.offsetTop-T.offsetTop-S.height/2+y.height/2;T.scrollTo({top:Math.max(0,I),behavior:"smooth"})}else{let I=E.offsetLeft-T.offsetLeft-S.width/2+y.width/2;T.scrollTo({left:Math.max(0,I),behavior:"smooth"})}}},l=(h)=>{let b=sn({...h,managedSelection:!0,onSelect:h.onSelect}),v=t.chipContainer||t.element,E=document.createDocumentFragment();return E.appendChild(b.element),v.appendChild(E),t.chipInstances.push(b),b.element.addEventListener("click",()=>{if(!b.isDisabled()){if(b.toggleSelected(),b.isSelected())b.element.classList.add(`${t.getClass("chip")}--selected`),b.element.setAttribute("aria-selected","true");else b.element.classList.remove(`${t.getClass("chip")}--selected`),b.element.setAttribute("aria-selected","false");s(b),r=t.chipInstances.indexOf(b)}}),b.element.addEventListener("keydown",a),i(an.ADD,b),b},d=(h)=>{let b=typeof h==="number"?h:t.chipInstances.indexOf(h);if(b>=0&&b<t.chipInstances.length){let v=t.chipInstances[b];if(i(an.REMOVE,v),v.destroy(),t.chipInstances.splice(b,1),b===r)r=-1;else if(b<r)r--}},u=()=>[...t.chipInstances],f=()=>t.chipInstances.filter((h)=>h.isSelected()),c=()=>f().map((h)=>h.getValue()),C=(h,b=!0,v=!e.multiSelect)=>{let E=Array.isArray(h)?h:[h],T=!1;if(v)t.chipInstances.forEach((S)=>{let y=S.getValue();if(!E.includes(y)&&S.isSelected())S.setSelected(!1),S.element.classList.remove(`${t.getClass("chip")}--selected`),S.element.setAttribute("aria-selected","false"),T=!0});if(t.chipInstances.forEach((S)=>{let y=S.getValue();if(E.includes(y)&&!S.isSelected())S.setSelected(!0),S.element.classList.add(`${t.getClass("chip")}--selected`),S.element.setAttribute("aria-selected","true"),T=!0}),T&&b){let S=c();i(an.CHANGE,S,null)}},g=(h=!0)=>{let v=c().length>0;if(t.chipInstances.forEach((E)=>{E.setSelected(!1),E.element.classList.remove(`${t.getClass("chip")}--selected`),E.element.setAttribute("aria-selected","false")}),v&&h)i(an.CHANGE,[],null)},m=()=>{t.chipInstances.forEach((h)=>{h.element.addEventListener("keydown",a)})},p=()=>{t.chipInstances.forEach((h)=>{h.element.removeEventListener("keydown",a)})};if(m(),t.element)t.element.addEventListener("keydown",a);if(t.lifecycle){let h=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{t.chipInstances.forEach((b)=>{b.element.removeEventListener("keydown",a)}),t.chipInstances.forEach((b)=>b.destroy()),t.chipInstances.length=0,Object.keys(n).forEach((b)=>{n[b]=[]}),h()}}return{...t,chips:{addChip:l,removeChip:d,getChips:u,getSelectedChips:f,getSelectedValues:c,selectByValue:C,clearSelection:g,scrollToChip:o},keyboard:{enable:m,disable:p},on(h,b){if(!n[h])n[h]=[];return n[h].push(b),this},off(h,b){if(n[h]){let v=n[h].indexOf(b);if(v!==-1)n[h].splice(v,1)}return this}}};Qe();var Hi=(e)=>(t)=>{let n=(o)=>t.getClass(o),r=e.label&&e.label.trim().length>0,i=e.labelPosition||"start",s;if(r)s=B({tag:"label",className:n("chips-label"),text:e.label,container:t.element});let a=B({tag:"div",className:n("chips-container"),container:t.element});return{...t,chipContainer:a,label:s,getChipContainer:()=>a,getLabel:()=>s||null}};var ad=(e)=>(t)=>({...t,element:t.element,addChip(n){if(e.chips&&typeof e.chips.addChip==="function")e.chips.addChip(n);return this},removeChip(n){if(e.chips&&typeof e.chips.removeChip==="function")e.chips.removeChip(n);return this},getChips(){if(e.chips&&typeof e.chips.getChips==="function")return e.chips.getChips();return[]},getSelectedChips(){if(e.chips&&typeof e.chips.getSelectedChips==="function")return e.chips.getSelectedChips();return[]},getSelectedValues(){if(e.chips&&typeof e.chips.getSelectedValues==="function")return e.chips.getSelectedValues();return[]},getValue(){if(e.chips&&typeof e.chips.getSelectedValues==="function"){let n=e.chips.getSelectedValues();if(!e.config?.multiSelect)return n.length>0?n[0]:null;return n}return e.config?.multiSelect?[]:null},setValue(n){if(e.chips&&typeof e.chips.selectByValue==="function"){if(e.chips.clearSelection)e.chips.clearSelection();let r=[];if(n){if(Array.isArray(n))r=n.filter((i)=>i!=null&&i!=="");else if(typeof n==="string"&&n!=="")r=[n]}if(r.length>0)e.chips.selectByValue(r,!1)}return this},selectByValue(n,r=!0){if(e.chips&&typeof e.chips.selectByValue==="function")e.chips.selectByValue(n,r);return this},clearSelection(){if(e.chips&&typeof e.chips.clearSelection==="function")e.chips.clearSelection();return this},setScrollable(n){if(e.layout&&typeof e.layout.setScrollable==="function")e.layout.setScrollable(n);return this},setVertical(n){if(e.layout&&typeof e.layout.setVertical==="function")e.layout.setVertical(n);return this},setLabel(n){if(e.label&&typeof e.label.setText==="function")e.label.setText(n);return this},getLabel(){if(e.label&&typeof e.label.getText==="function")return e.label.getText();return""},setLabelPosition(n){if(e.label&&typeof e.label.setPosition==="function")e.label.setPosition(n);return this},getLabelPosition(){if(e.label&&typeof e.label.getPosition==="function")return e.label.getPosition();return"start"},scrollToChip(n){if(e.chips&&typeof e.chips.scrollToChip==="function")e.chips.scrollToChip(n);return this},enableKeyboardNavigation(){if(e.keyboard&&typeof e.keyboard.enableKeyboardNavigation==="function")e.keyboard.enableKeyboardNavigation();return this},on(n,r){if(e.events&&typeof e.events.on==="function")e.events.on(n,r);return this},off(n,r){if(e.events&&typeof e.events.off==="function")e.events.off(n,r);return this},destroy(){if(e.lifecycle&&typeof e.lifecycle.destroy==="function")e.lifecycle.destroy()}});ne();var Bf={chips:[],scrollable:!1,vertical:!1,multiSelect:!1,onChange:null,selector:null,labelPosition:"start"},od=(e={})=>_(Bf,e,"chips"),ld=(e)=>{let t=e.scrollable===!0,n=e.vertical===!0,r=e.multiSelect===!0,i=e.label&&e.label.trim().length>0,s=e.labelPosition||"start",a=["chips",e.class,t?"chips--scrollable":"",n?"chips--vertical":"",i?"chips--with-label":"",i&&s==="end"?"chips--label-end":""].filter(Boolean).join(" ");return V(e,{tag:"div",attributes:{role:"group","aria-multiselectable":r?"true":"false"},className:a})},dd=(e,t)=>({config:{multiSelect:t?.multiSelect??!1},chips:{addChip:function(n){if(e.chips&&typeof e.chips.addChip==="function")return e.chips.addChip(n);return null},removeChip:(n)=>e.chips?.removeChip?.(n),getChips:()=>e.chips?.getChips?.()??[],getSelectedChips:()=>e.chips?.getSelectedChips?.()??[],getSelectedValues:()=>e.chips?.getSelectedValues?.()??[],selectByValue:(n)=>e.chips?.selectByValue?.(n),clearSelection:()=>e.chips?.clearSelection?.(),scrollToChip:(n)=>e.chips?.scrollToChip?.(n)},layout:{setScrollable:(n)=>e.layout?.setScrollable?.(n),isScrollable:()=>e.layout?.isScrollable?.()??!1,setVertical:(n)=>e.layout?.setVertical?.(n),isVertical:()=>e.layout?.isVertical?.()??!1},label:{setText:(n)=>e.label?.setText?.(n),getText:()=>e.label?.getText?.()??"",setPosition:(n)=>e.label?.setPosition?.(n),getPosition:()=>e.label?.getPosition?.()??"start"},keyboard:{enableKeyboardNavigation:()=>e.keyboard?.enable?.(),disableKeyboardNavigation:()=>e.keyboard?.disable?.()},events:{on:(n,r)=>e.on?.(n,r),off:(n,r)=>e.off?.(n,r)},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}});var Hf=(e={})=>{let t=od(e);try{let n=M(D,k(),O(ld(t)),Pi(t),ki(t),Hi(t),Bi(t),P())(t),r=dd(n,t),i=ad(r)(n);if(t.on&&typeof i.on==="function")Object.entries(t.on).forEach(([s,a])=>{if(typeof a==="function")i.on(s,a)});if(Array.isArray(t.chips)&&t.chips.length>0)t.chips.forEach((s)=>{i.addChip(s)});return i}catch(n){throw console.error("Chips creation error:",n),Error(`Failed to create chip: ${n.message}`)}},$i=Hf;nt();se();te();re();var ud=["S","M","T","W","T","F","S"],Lr=["January","February","March","April","May","June","July","August","September","October","November","December"],Ar=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],cd="MM/DD/YYYY",md="today",wr="selected",fd="outside-month",gd="range-start",pd="range-end",hd="range-middle";var Fe=(e)=>{if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;if(typeof e==="string"){let t=new Date(e);return isNaN(t.getTime())?null:t}return null},St=(e,t="MM/DD/YYYY")=>{if(!e||!(e instanceof Date)||isNaN(e.getTime()))return"";let n="",r=0;while(r<t.length)if(t.substring(r,r+4)==="MMMM")n+=Lr[e.getMonth()],r+=4;else if(t.substring(r,r+3)==="MMM")n+=Ar[e.getMonth()],r+=3;else if(t.substring(r,r+2)==="MM")n+=(e.getMonth()+1).toString().padStart(2,"0"),r+=2;else if(t.substring(r,r+1)==="M")n+=e.getMonth()+1,r+=1;else if(t.substring(r,r+4)==="YYYY")n+=e.getFullYear(),r+=4;else if(t.substring(r,r+2)==="YY")n+=e.getFullYear().toString().slice(-2),r+=2;else if(t.substring(r,r+2)==="DD")n+=e.getDate().toString().padStart(2,"0"),r+=2;else if(t.substring(r,r+1)==="D")n+=e.getDate(),r+=1;else n+=t[r],r+=1;return n},Cd=(e,t)=>new Date(e,t+1,0).getDate(),$f=(e,t)=>new Date(e,t,1).getDay(),Tt=(e,t)=>e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear(),Vf=(e,t,n)=>{let r=e.getTime();return r>=t.getTime()&&r<=n.getTime()},Ed=(e,t,n=null,r=null,i=null,s=null)=>{let a=new Date;a.setHours(0,0,0,0);let o=[],l=$f(e,t),d=Cd(e,t-1);for(let C=l-1;C>=0;C--){let g=new Date(e,t-1,d-C),m=i&&g<i||s&&g>s;o.push({date:g,day:g.getDate(),isCurrentMonth:!1,isToday:Tt(g,a),isSelected:n?Tt(g,n):!1,isDisabled:m})}let u=Cd(e,t);for(let C=1;C<=u;C++){let g=new Date(e,t,C),m=n?Tt(g,n):!1,p=i&&g<i||s&&g>s,h={date:g,day:C,isCurrentMonth:!0,isToday:Tt(g,a),isSelected:m,isDisabled:p};if(n&&r)h.isRangeStart=Tt(g,n),h.isRangeEnd=Tt(g,r),h.isRangeMiddle=Vf(g,n,r)&&!h.isRangeStart&&!h.isRangeEnd;o.push(h)}let c=42-o.length;for(let C=1;C<=c;C++){let g=new Date(e,t+1,C),m=i&&g<i||s&&g>s;o.push({date:g,day:C,isCurrentMonth:!1,isToday:Tt(g,a),isSelected:n?Tt(g,n):!1,isDisabled:m})}return o},bd=(e,t=10)=>{let n=[],r=e-t,i=e+t;for(let s=r;s<=i;s++)n.push(s);return n};var Vi=(e,t)=>{let n=new Date(e);return n.setMonth(n.getMonth()+t),n};var vd=(e,{disabled:t,lifecycle:n,events:r})=>(i)=>{let s={goToDate(a){let o=Fe(a);if(!o)return;e.currentMonth=o.getMonth(),e.currentYear=o.getFullYear(),e.updateCalendar()},nextMonth(){let a=Vi(new Date(e.currentYear,e.currentMonth,1),1);e.currentMonth=a.getMonth(),e.currentYear=a.getFullYear(),e.updateCalendar()},prevMonth(){let a=Vi(new Date(e.currentYear,e.currentMonth,1),-1);e.currentMonth=a.getMonth(),e.currentYear=a.getFullYear(),e.updateCalendar()},nextYear(){e.currentYear+=1,e.updateCalendar()},prevYear(){e.currentYear-=1,e.updateCalendar()},showDayView(){e.currentView="day",e.updateCalendar()},showMonthView(){e.currentView="month",e.updateCalendar()},showYearView(){e.currentView="year",e.updateCalendar()},getCurrentView(){return e.currentView}};return{...i,element:i.element,input:e.input,calendar:s,open(){return e.isOpen=!0,e.render(),r.emit("open",{value:this.getValue()}),this},close(){return e.isOpen=!1,e.render(),r.emit("close",{value:this.getValue()}),this},getValue(){if(!e.selectedDate)return null;if(e.selectionMode==="range"&&e.rangeEndDate)return[new Date(e.selectedDate),new Date(e.rangeEndDate)];return new Date(e.selectedDate)},setValue(a){if(Array.isArray(a)&&e.selectionMode==="range"){let l=Fe(a[0]),d=Fe(a[1]);if(l&&d){if(e.selectedDate=l,e.rangeEndDate=d,l>d)e.selectedDate=d,e.rangeEndDate=l;if(e.updateInputValue(),e.isOpen)e.currentMonth=e.selectedDate.getMonth(),e.currentYear=e.selectedDate.getFullYear(),e.updateCalendar();r.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this}let o=Fe(a);if(o){if(e.selectedDate=o,e.rangeEndDate=null,e.updateInputValue(),e.isOpen)e.currentMonth=o.getMonth(),e.currentYear=o.getFullYear(),e.updateCalendar();r.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this},getFormattedValue(){if(!e.selectedDate)return"";if(e.selectionMode==="range"&&e.rangeEndDate){let a=St(e.selectedDate,e.dateFormat),o=St(e.rangeEndDate,e.dateFormat);return`${a} - ${o}`}return St(e.selectedDate,e.dateFormat)},clear(){if(e.selectedDate=null,e.rangeEndDate=null,e.updateInputValue(),e.isOpen)e.updateCalendar();return r.emit("change",{value:null,formattedValue:""}),this},enable(){return t.enable(),e.input.disabled=!1,this},disable(){return t.disable(),e.input.disabled=!0,this},setMinDate(a){let o=Fe(a);if(o){if(e.minDate=o,e.isOpen)e.updateCalendar()}return this},setMaxDate(a){let o=Fe(a);if(o){if(e.maxDate=o,e.isOpen)e.updateCalendar()}return this},destroy(){if(document.removeEventListener("click",e.outsideClickHandler),e.calendarElement&&e.calendarElement.parentNode)e.calendarElement.parentNode.removeChild(e.calendarElement);n.destroy()},on(a,o){return r.on(a,o),this},off(a,o){return r.off(a,o),this}}};ne();var Ff={variant:"docked",initialView:"day",selectionMode:"single",dateFormat:cd,animate:!0},Td=(e={})=>{let t=_(Ff,e,"datepicker");if(t.closeOnSelect===void 0)t.closeOnSelect=t.variant!=="docked";return t},Sd=(e)=>V(e,{tag:"div",attributes:{role:"application","aria-label":"Date Picker",tabindex:"-1"},className:[`${e.prefix}-datepicker-container`,e.class],forwardEvents:{keydown:!0,click:!0},interactive:!0}),yd=(e)=>{let t={type:"text",placeholder:e.placeholder||e.dateFormat,autocomplete:"off",readonly:!0};if(e.disabled===!0)t.disabled=!0;return V(e,{tag:"input",attributes:t,className:`${e.prefix}-datepicker-input`,forwardEvents:{focus:!0,blur:!0,click:!0},interactive:!0})},xd=(e)=>V(e,{tag:"div",attributes:{role:"dialog","aria-modal":e.variant!=="docked"?"true":"false"},className:[`${e.prefix}-datepicker-calendar`,`${e.prefix}-datepicker-${e.variant}`,e.selectionMode==="range"?`${e.prefix}-datepicker-range`:""],forwardEvents:{keydown:!0,click:!0}}),Id=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable()},lifecycle:{destroy:()=>e.lifecycle.destroy()},events:{on:e.on,off:e.off,emit:e.emit}});Qe();var Uf=({currentMonth:e,currentYear:t,currentView:n,prefix:r,emit:i})=>{let s=B({tag:"div",className:`${r}-datepicker-header`}),a=B({tag:"button",className:`${r}-datepicker-month-selector`,text:Lr[e],attributes:{type:"button","aria-label":"Select month"}}),o=B({tag:"button",className:`${r}-datepicker-year-selector`,text:t.toString(),attributes:{type:"button","aria-label":"Select year"}}),l=B({tag:"div",className:`${r}-datepicker-nav-controls`}),d=B({tag:"button",className:`${r}-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":n==="day"?"Previous month":n==="month"?"Previous year":"Previous year range"}}),u=B({tag:"button",className:`${r}-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":n==="day"?"Next month":n==="month"?"Next year":"Next year range"}});return a.addEventListener("click",(f)=>{f.stopPropagation(),i("viewChange",{view:"month"})}),o.addEventListener("click",(f)=>{f.stopPropagation(),i("viewChange",{view:"year"})}),d.addEventListener("click",(f)=>{if(f.stopPropagation(),n==="day")i("prevMonth");else if(n==="month")i("prevYear");else i("prevYearRange")}),u.addEventListener("click",(f)=>{if(f.stopPropagation(),n==="day")i("nextMonth");else if(n==="month")i("nextYear");else i("nextYearRange")}),s.appendChild(a),s.appendChild(o),l.appendChild(d),l.appendChild(u),s.appendChild(l),s},Gf=(e)=>{let t=B({tag:"div",className:`${e}-datepicker-weekdays`});return ud.forEach((n)=>{let r=B({tag:"span",className:`${e}-datepicker-weekday`,text:n});t.appendChild(r)}),t},zf=({currentYear:e,currentMonth:t,selectedDate:n,rangeEndDate:r,minDate:i,maxDate:s,prefix:a,emit:o})=>{let l=B({tag:"div",className:`${a}-datepicker-days`});return Ed(e,t,n,r,i,s).forEach((u)=>{let f=[`${a}-datepicker-day`,u.isCurrentMonth?"":fd,u.isToday?md:"",u.isSelected?wr:"",u.isDisabled?"disabled":"",u.isRangeStart?gd:"",u.isRangeEnd?pd:"",u.isRangeMiddle?hd:""].filter(Boolean).join(" "),c=B({tag:"button",className:f,text:u.day.toString(),attributes:{type:"button","aria-label":u.date.toLocaleDateString(),"aria-selected":u.isSelected?"true":"false","aria-disabled":u.isDisabled?"true":"false","data-date":u.date.toISOString(),disabled:u.isDisabled}});c.addEventListener("click",(C)=>{if(C.stopPropagation(),!u.isDisabled)o("dateSelected",{date:u.date})}),l.appendChild(c)}),l},Wf=({currentMonth:e,prefix:t,emit:n})=>{let r=B({tag:"div",className:`${t}-datepicker-months`});return Ar.forEach((i,s)=>{let a=s===e,o=B({tag:"button",className:`${t}-datepicker-month ${a?wr:""}`,text:i,attributes:{type:"button","aria-selected":a?"true":"false","data-month":s.toString()}});o.addEventListener("click",(l)=>{l.stopPropagation(),n("monthSelected",{month:s})}),r.appendChild(o)}),r},Kf=({currentYear:e,prefix:t,emit:n})=>{let r=B({tag:"div",className:`${t}-datepicker-years`});return bd(e,10).forEach((s)=>{let a=s===e,o=B({tag:"button",className:`${t}-datepicker-year ${a?wr:""}`,text:s.toString(),attributes:{type:"button","aria-selected":a?"true":"false","data-year":s.toString()}});o.addEventListener("click",(l)=>{l.stopPropagation(),n("yearSelected",{year:s})}),r.appendChild(o)}),r},Yf=({prefix:e,emit:t})=>{let n=B({tag:"div",className:`${e}-datepicker-footer`}),r=B({tag:"button",className:`${e}-datepicker-cancel ${e}-button ${e}-button--text`,text:"Cancel",attributes:{type:"button"}}),i=B({tag:"button",className:`${e}-datepicker-ok ${e}-button ${e}-button--text`,text:"OK",attributes:{type:"button"}});return r.addEventListener("click",(s)=>{s.stopPropagation(),t("cancel")}),i.addEventListener("click",(s)=>{s.stopPropagation(),t("confirm")}),n.appendChild(r),n.appendChild(i),n},Ld=(e,t)=>{let{prefix:n,currentView:r,currentMonth:i,currentYear:s,selectedDate:a,rangeEndDate:o,minDate:l,maxDate:d,variant:u}=e,f=B({tag:"div",className:`${n}-datepicker-calendar-content`}),c=Uf({currentMonth:i,currentYear:s,currentView:r,prefix:n,emit:t});if(f.appendChild(c),r==="day"){let C=Gf(n);f.appendChild(C);let g=zf({currentYear:s,currentMonth:i,selectedDate:a,rangeEndDate:o,minDate:l,maxDate:d,prefix:n,emit:t});f.appendChild(g)}else if(r==="month"){let C=Wf({currentMonth:i,prefix:n,emit:t});f.appendChild(C)}else if(r==="year"){let C=Kf({currentYear:s,prefix:n,emit:t});f.appendChild(C)}if(u!=="docked"){let C=Yf({prefix:n,emit:t});f.appendChild(C)}return f};Qe();var Xf=(e={})=>{let t=Td(e);try{let n={isOpen:!1,selectedDate:null,rangeEndDate:null,currentView:t.initialView,currentMonth:new Date().getMonth(),currentYear:new Date().getFullYear(),minDate:t.minDate?Fe(t.minDate):null,maxDate:t.maxDate?Fe(t.maxDate):null,dateFormat:t.dateFormat,variant:t.variant,selectionMode:t.selectionMode,closeOnSelect:t.closeOnSelect,prefix:t.prefix||K,calendarElement:null,input:null,updateInputValue(){if(!this.input)return;if(!this.selectedDate){this.input.value="";return}if(this.selectionMode==="range"&&this.rangeEndDate){let a=St(this.selectedDate,this.dateFormat),o=St(this.rangeEndDate,this.dateFormat);this.input.value=`${a} - ${o}`;return}this.input.value=St(this.selectedDate,this.dateFormat)},updateCalendar(){if(!this.isOpen||!this.calendarElement)return;this.calendarElement.innerHTML="";let a=Ld(this,(o,l)=>{switch(o){case"dateSelected":this.handleDateSelection(l.date);break;case"monthSelected":this.currentMonth=l.month,this.currentView="day",this.updateCalendar();break;case"yearSelected":this.currentYear=l.year,this.currentView="month",this.updateCalendar();break;case"viewChange":this.currentView=l.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(a)},handleDateSelection(a){if(this.selectionMode==="range")if(!this.selectedDate||this.selectedDate&&this.rangeEndDate)this.selectedDate=a,this.rangeEndDate=null;else{if(a<this.selectedDate)this.rangeEndDate=this.selectedDate,this.selectedDate=a;else this.rangeEndDate=a;if(this.closeOnSelect)this.isOpen=!1}else if(this.selectedDate=a,this.closeOnSelect)this.isOpen=!1;this.updateInputValue(),this.updateCalendar(),r.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(t.value)if(Array.isArray(t.value)&&t.selectionMode==="range"){let a=Fe(t.value[0]),o=Fe(t.value[1]);if(a&&o)n.selectedDate=a,n.rangeEndDate=o,n.currentMonth=a.getMonth(),n.currentYear=a.getFullYear()}else{let a=Fe(t.value);if(a)n.selectedDate=a,n.currentMonth=a.getMonth(),n.currentYear=a.getFullYear()}let r=M(D,k(),O(Sd(t)),de(t),P())(t),i=M(D,O(yd(t)))(t);n.input=i.element,r.element.appendChild(n.input),n.updateInputValue();let s=xd(t);return n.calendarElement=B({tag:"div",className:s.className,attributes:s.attributes}),n.calendarElement.style.display="none",r.element.appendChild(n.calendarElement),n.input.addEventListener("click",()=>{if(!r.element.classList.contains("disabled"))if(n.isOpen=!n.isOpen,n.render(),n.isOpen)r.emit("open",{value:n.selectedDate});else r.emit("close",{value:n.selectedDate})}),n.calendarElement.addEventListener("click",(a)=>{a.stopPropagation()}),document.addEventListener("click",(a)=>{if(n.isOpen&&!r.element.contains(a.target))n.isOpen=!1,n.render(),r.emit("close",{value:n.selectedDate})}),vd(n,Id(r))(r)}catch(n){throw console.error("DatePicker creation error:",n),Error(`Failed to create DatePicker: ${n.message}`)}},Fi=Xf;se();te();re();ne();var jf={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:[]},Ad=(e={})=>_(jf,e,"dialog"),wd=(e)=>V(e,{tag:"div",attributes:{},className:e.class}),Nd=(e)=>({tag:"div",attributes:{"aria-modal":e.modal===!1?!1:!0,role:"dialog",tabindex:-1},className:""}),Dd=(e)=>({visibility:{open:()=>e.visibility.open(),close:()=>e.visibility.close(),toggle:(t)=>e.visibility.toggle(t),isOpen:()=>e.visibility.isOpen()},content:{setTitle:(t)=>e.content.setTitle(t),getTitle:()=>e.content.getTitle(),setSubtitle:(t)=>e.content.setSubtitle(t),getSubtitle:()=>e.content.getSubtitle(),setContent:(t)=>e.content.setContent(t),getContent:()=>e.content.getContent(),getHeaderElement:()=>e.content.getHeaderElement(),getContentElement:()=>e.content.getContentElement(),getFooterElement:()=>e.content.getFooterElement()},buttons:{addButton:(t)=>e.buttons.addButton(t),removeButton:(t)=>e.buttons.removeButton(t),getButtons:()=>e.buttons.getButtons(),setFooterAlignment:(t)=>e.buttons.setFooterAlignment(t)},focus:{trapFocus:()=>e.focus.trapFocus(),releaseFocus:()=>e.focus.releaseFocus()},size:{setSize:(t)=>e.size.setSize(t)},divider:{toggleDivider:(t)=>e.divider.toggleDivider(t),hasDivider:()=>e.divider.hasDivider()},events:{on:(t,n)=>e.on(t,n),off:(t,n)=>e.off(t,n),trigger:(t,n)=>e.emit(t,n)},lifecycle:{destroy:()=>e.lifecycle.destroy()}});Ht();se();ne();var Zf={orientation:"horizontal",variant:"full-width",thickness:1},Md=(e={})=>_(Zf,e,"divider");var Od=(e)=>(t)=>{let n=e.orientation||"horizontal";t.element.classList.add(`${t.getClass("divider")}--${n}`);let r=e.thickness||1;if(n==="horizontal")t.element.style.height=`${r}px`,t.element.style.width="100%";else t.element.style.width=`${r}px`,t.element.style.height="100%";return{...t,getOrientation(){return n},setOrientation(i){if(t.element.classList.remove(`${t.getClass("divider")}--${n}`),t.element.classList.add(`${t.getClass("divider")}--${i}`),i==="horizontal")t.element.style.height=`${r}px`,t.element.style.width="100%",t.element.style.marginTop="",t.element.style.marginBottom="";else t.element.style.width=`${r}px`,t.element.style.height="100%",t.element.style.marginLeft="",t.element.style.marginRight="";return this}}},Rd=(e)=>(t)=>{let n=e.variant||"full-width",r=e.orientation||"horizontal";if(n==="inset"||n==="middle-inset")if(r==="horizontal"){let i=e.insetStart!==void 0?e.insetStart:16,s=e.insetEnd!==void 0?e.insetEnd:n==="middle-inset"?16:0;t.element.style.marginLeft=`${i}px`,t.element.style.marginRight=`${s}px`}else{let i=e.insetStart!==void 0?e.insetStart:16,s=e.insetEnd!==void 0?e.insetEnd:n==="middle-inset"?16:0;t.element.style.marginTop=`${i}px`,t.element.style.marginBottom=`${s}px`}return{...t,getVariant(){return n},setVariant(i){t.element.classList.remove(`${t.getClass("divider")}--${n}`),t.element.classList.add(`${t.getClass("divider")}--${i}`);let s=t.getOrientation?t.getOrientation():r;if(i==="full-width")if(s==="horizontal")t.element.style.marginLeft="",t.element.style.marginRight="";else t.element.style.marginTop="",t.element.style.marginBottom="";else{let a=e.insetStart!==void 0?e.insetStart:16,o=e.insetEnd!==void 0?e.insetEnd:i==="middle-inset"?16:0;if(s==="horizontal")t.element.style.marginLeft=`${a}px`,t.element.style.marginRight=`${o}px`;else t.element.style.marginTop=`${a}px`,t.element.style.marginBottom=`${o}px`}return this},setInset(i,s){let a=t.getOrientation?t.getOrientation():r;if((t.getVariant?t.getVariant():n)!=="full-width")if(a==="horizontal"){if(i!==void 0)t.element.style.marginLeft=`${i}px`;if(s!==void 0)t.element.style.marginRight=`${s}px`}else{if(i!==void 0)t.element.style.marginTop=`${i}px`;if(s!==void 0)t.element.style.marginBottom=`${s}px`}return this}}},_d=(e)=>(t)=>{if(e.color)t.element.style.backgroundColor=e.color;let n=e.thickness||1,r=e.orientation||"horizontal";if(r==="horizontal")t.element.style.height=`${n}px`;else t.element.style.width=`${n}px`;return{...t,setThickness(i){if((t.getOrientation?t.getOrientation():r)==="horizontal")t.element.style.height=`${i}px`;else t.element.style.width=`${i}px`;return this},setColor(i){return t.element.style.backgroundColor=i,this}}};var Vt=(e={})=>{let t=Md(e);return M(D,O({tag:"hr",componentName:"divider",className:e.class}),Od(t),oe(t),Rd(t),_d(t))(t)};yn();var on={OPEN:"open",CLOSE:"close",BEFORE_OPEN:"beforeopen",BEFORE_CLOSE:"beforeclose",AFTER_OPEN:"afteropen",AFTER_CLOSE:"afterclose"},Pd=(e)=>(t)=>{let n=Nd(e),r=document.createElement(n.tag||"div");if(r.classList.add(t.getClass("dialog-overlay")),n.attributes&&typeof n.attributes==="object")Object.entries(n.attributes).forEach(([p,h])=>{if(p&&typeof p==="string"&&h!==void 0)r.setAttribute(p,String(h))});if(e.zIndex)r.style.zIndex=String(e.zIndex);let i=()=>{let p=document.createElement("div");p.classList.add(t.getClass("dialog-header"));let h=document.createElement("div");if(h.classList.add(t.getClass("dialog-header-content")),p.appendChild(h),e.title){let b=document.createElement("h2");b.classList.add(t.getClass("dialog-header-title")),b.textContent=e.title,h.appendChild(b)}if(e.subtitle){let b=document.createElement("p");b.classList.add(t.getClass("dialog-header-subtitle")),b.textContent=e.subtitle,h.appendChild(b)}if(e.closeButton!==!1){let b=document.createElement("button");b.classList.add(t.getClass("dialog-header-close")),b.setAttribute("aria-label","Close dialog"),b.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
|
-
`,b.addEventListener("click",(v)=>{if(v.preventDefault(),v.stopPropagation(),t&&t.emit)t.emit("dialog:close",{source:"closeButton"})}),p.appendChild(b)}return p},s=()=>{let p=document.createElement("div");if(p.classList.add(t.getClass("dialog-content")),e.content)p.innerHTML=e.content;return p},a=()=>{let p=document.createElement("div");p.classList.add(t.getClass("dialog-footer"));let h=e.footerAlignment||"right";if(h!=="right")ee(p,`${t.getClass("dialog-footer")}--${h}`);if(Array.isArray(e.buttons)&&e.buttons.length>0)e.buttons.forEach((b)=>Vd(p,b,t));return p},o=()=>Vt({variant:"full-width",class:t.getClass("dialog-divider")}),l=i(),d=s(),u=Array.isArray(e.buttons)&&e.buttons.length>0?a():null;ee(t.element,t.getClass("dialog"));let f=e.size||"medium";if(f!=="medium")ee(t.element,`${t.getClass("dialog")}--${f}`);let c=e.animation||"scale";if(c!=="scale")ee(t.element,`${t.getClass("dialog")}--${c}`);t.element.appendChild(l);let C=null,g=null;if(e.divider){if(C=o(),C.element.classList.add(t.getClass("dialog-header-divider")),t.element.appendChild(C.element),u)g=o(),g.element.classList.add(t.getClass("dialog-footer-divider"))}if(t.element.appendChild(d),g)t.element.appendChild(g.element);if(u)t.element.appendChild(u);r.appendChild(t.element);let m=e.container||document.body;return m.appendChild(r),{...t,overlay:r,structure:{header:l,content:d,footer:u,headerDivider:C,footerDivider:g,container:m}}},$d=()=>(e)=>({...e,divider:{toggleDivider(t){if(t&&!e.structure.headerDivider){let n=Vt({variant:"full-width",class:`${e.getClass("dialog-divider")} ${e.getClass("dialog-header-divider")}`});if(e.element.insertBefore(n.element,e.structure.content),e.structure.headerDivider=n,e.structure.footer&&!e.structure.footerDivider){let r=Vt({variant:"full-width",class:`${e.getClass("dialog-divider")} ${e.getClass("dialog-footer-divider")}`});e.element.insertBefore(r.element,e.structure.footer),e.structure.footerDivider=r}}else if(!t){if(e.structure.headerDivider)e.structure.headerDivider.element.remove(),e.structure.headerDivider=null;if(e.structure.footerDivider)e.structure.footerDivider.element.remove(),e.structure.footerDivider=null}return e},hasDivider(){return e.structure.headerDivider!==null}}}),Vd=(e,t,n)=>{let{text:r,variant:i="text",onClick:s,closeDialog:a=!0,autofocus:o=!1,attributes:l={}}=t,d=We({text:r,variant:i,...l});if(d.on("click",(u)=>{let f=a;if(typeof s==="function")try{if(s(u,n)===!1)f=!1}catch(c){console.error("Error in onClick handler:",c)}if(f){if(n&&n.emit)n.emit("dialog:close",{source:"button",text:r})}}),o)d.element.setAttribute("autofocus","true");if(e.appendChild(d.element),!n._buttons)n._buttons=[];n._buttons.push({config:t,instance:d})},Fd=()=>(e)=>{let t=e.config.open===!0,n=e.config.animationDuration||150,r='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',i=null,s=!1,a=()=>{if(!e.config.trapFocus)return;let g=e.element.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(g.length===0)return;let m=g[0],p=g[g.length-1];if(e.config.autofocus){let b=e.element.querySelector("[autofocus]");if(b)b.focus();else m.focus()}e.element.addEventListener("keydown",h);function h(b){if(b.key!=="Tab")return;if(b.shiftKey){if(document.activeElement===m)p.focus(),b.preventDefault()}else if(document.activeElement===p)m.focus(),b.preventDefault()}},o=()=>{if(!e.config.trapFocus)return;if(e.element.removeEventListener("keydown",g),i)i.focus(),i=null;function g(){}},l=()=>{if(e.config.closeOnOverlayClick!==!1)e.overlay.addEventListener("mousedown",u),document.addEventListener("mouseup",f);if(e.config.closeOnEscape!==!1)document.addEventListener("keydown",c)},d=()=>{e.overlay.removeEventListener("mousedown",u),document.removeEventListener("mouseup",f),document.removeEventListener("keydown",c)};function u(g){s=g.target===e.overlay}function f(g){if(s&&g.target===e.overlay)C.close();s=!1}function c(g){if(g.key==="Escape"&&C.isOpen())C.close()}if(t)ee(e.overlay,`${e.getClass("dialog-overlay")}--visible`),ee(e.element,`${e.getClass("dialog")}--visible`),a(),l();let C={open(){if(this.isOpen())return;i=document.activeElement;let g={dialog:e,defaultPrevented:!1,preventDefault:()=>{g.defaultPrevented=!0}};if(typeof e.emit==="function")e.emit(on.BEFORE_OPEN,g);if(g.defaultPrevented)return;if(e.overlay&&!e.overlay.parentNode)(e.structure.container||document.body).appendChild(e.overlay);ee(e.overlay,`${e.getClass("dialog-overlay")}--visible`),setTimeout(()=>{if(ee(e.element,`${e.getClass("dialog")}--visible`),a(),l(),typeof e.emit==="function")e.emit(on.OPEN,{dialog:e}),setTimeout(()=>{e.emit(on.AFTER_OPEN,{dialog:e})},n)},10)},close(){let g={dialog:e,defaultPrevented:!1,preventDefault:()=>{g.defaultPrevented=!0}};if(typeof e.emit==="function")e.emit(on.BEFORE_CLOSE,g);if(g.defaultPrevented){console.log("Dialog close prevented by event handler");return}let m=`${e.getClass("dialog")}--visible`,p=`${e.getClass("dialog-overlay")}--visible`;if(Ce(e.element,m),Ce(e.overlay,p),o(),d(),typeof e.emit==="function")e.emit(on.CLOSE,{dialog:e});setTimeout(()=>{if(e.overlay&&e.overlay.parentNode)e.overlay.parentNode.removeChild(e.overlay);if(typeof e.emit==="function")e.emit(on.AFTER_CLOSE,{dialog:e})},n)},toggle(g){if(g===void 0)this.isOpen()?this.close():this.open();else if(g)this.open();else this.close()},isOpen(){return e.element.classList.contains(`${e.getClass("dialog")}--visible`)}};if(e&&e.on)e.on("dialog:close",()=>{C.close()});return{...e,visibility:C}},Ud=()=>(e)=>{let t=e.structure.header,n=e.structure.content,r=e.structure.footer;return{...e,content:{setTitle(i){let s=t.querySelector(`.${e.getClass("dialog-header-title")}`);if(!s&&i)s=document.createElement("h2"),s.classList.add(e.getClass("dialog-header-title")),t.querySelector(`.${e.getClass("dialog-header-content")}`).appendChild(s);if(s)s.textContent=i},getTitle(){let i=t.querySelector(`.${e.getClass("dialog-header-title")}`);return i?i.textContent||"":""},setSubtitle(i){let s=t.querySelector(`.${e.getClass("dialog-header-subtitle")}`);if(!s&&i)s=document.createElement("p"),s.classList.add(e.getClass("dialog-header-subtitle")),t.querySelector(`.${e.getClass("dialog-header-content")}`).appendChild(s);if(s)s.textContent=i},getSubtitle(){let i=t.querySelector(`.${e.getClass("dialog-header-subtitle")}`);return i?i.textContent||"":""},setContent(i){n.innerHTML=i},getContent(){return n.innerHTML},getHeaderElement(){return t},getContentElement(){return n},getFooterElement(){return r}}}},Gd=()=>(e)=>{if(!e._buttons)e._buttons=[];return{...e,buttons:{addButton(t){let n=e.structure.footer;if(!n){n=document.createElement("div"),n.classList.add(e.getClass("dialog-footer"));let r=e.config.footerAlignment||"right";if(r!=="right")ee(n,`${e.getClass("dialog-footer")}--${r}`);e.element.appendChild(n),e.structure.footer=n}Vd(n,t,e)},removeButton(t){if(typeof t==="number"){if(t>=0&&t<e._buttons.length)e._buttons[t].instance.destroy(),e._buttons.splice(t,1)}else{let n=e._buttons.findIndex((r)=>r.config.text===t);if(n!==-1)e._buttons[n].instance.destroy(),e._buttons.splice(n,1)}if(e._buttons.length===0&&e.structure.footer)e.element.removeChild(e.structure.footer),e.structure.footer=null},getButtons(){return e._buttons.map((t)=>t.config)},setFooterAlignment(t){if(!e.structure.footer)return;if(["right","left","center","space-between"].forEach((r)=>{if(r!=="right")Ce(e.structure.footer,`${e.getClass("dialog-footer")}--${r}`)}),t!=="right")ee(e.structure.footer,`${e.getClass("dialog-footer")}--${t}`)}}}},zd=()=>(e)=>({...e,size:{setSize(t){if(["small","medium","large","fullwidth","fullscreen"].forEach((r)=>{Ce(e.element,`${e.getClass("dialog")}--${r}`)}),t!=="medium")ee(e.element,`${e.getClass("dialog")}--${t}`)}}}),Wd=()=>(e)=>({...e,confirm(t){return new Promise((n)=>{let{title:r="Confirm",message:i,confirmText:s="Yes",cancelText:a="No",confirmVariant:o="filled",cancelVariant:l="text",size:d="small"}=t;e.content.setTitle(r),e.content.setContent(`<p>${i}</p>`),e.size.setSize(d),e._buttons.forEach((u)=>u.instance.destroy()),e._buttons=[],e.buttons.addButton({text:s,variant:o,onClick:()=>{n(!0)}}),e.buttons.addButton({text:a,variant:l,onClick:()=>{n(!1)}}),e.visibility.open()})}});xn();var Kd=(e)=>(t)=>({...t,open(){return e.visibility.open(),this},close(){return e.visibility.close(),this},toggle(n){return e.visibility.toggle(n),this},isOpen(){return e.visibility.isOpen()},setTitle(n){return e.content.setTitle(n),this},getTitle(){return e.content.getTitle()},setSubtitle(n){return e.content.setSubtitle(n),this},getSubtitle(){return e.content.getSubtitle()},setContent(n){return e.content.setContent(n),this},getContent(){return e.content.getContent()},addButton(n){return e.buttons.addButton(n),this},removeButton(n){return e.buttons.removeButton(n),this},getButtons(){return e.buttons.getButtons()},setFooterAlignment(n){return e.buttons.setFooterAlignment(n),this},toggleDivider(n){return e.divider.toggleDivider(n),this},hasDivider(){return e.divider.hasDivider()},setSize(n){return e.size.setSize(n),this},on(n,r){return e.events.on(n,r),this},off(n,r){return e.events.off(n,r),this},getHeaderElement(){return e.content.getHeaderElement()},getContentElement(){return e.content.getContentElement()},getFooterElement(){return e.content.getFooterElement()},confirm(n){if(t.confirm)return t.confirm(n||{message:"Are you sure?"});return Promise.resolve(!1)},destroy(){if(this.isOpen()){let n=`${t.getClass("dialog")}--visible`,r=`${t.getClass("dialog-overlay")}--visible`;if(Ce(t.element,n),Ce(t.overlay,r),e.focus&&e.focus.releaseFocus)e.focus.releaseFocus()}if(e.lifecycle.destroy(),t.overlay&&t.overlay.parentNode)t.overlay.parentNode.removeChild(t.overlay)},element:t.element,overlay:t.overlay});var eg=(e={})=>{let t=Dd(e);try{let n=M(D,k(),O(Md(t)),Hd(t),Fd(),Ud(),Gd(),zd(),$d(),Wd(),P(),(r)=>Kd(Rd(r))(r))(t);if(t.on)Object.entries(t.on).forEach(([r,i])=>{if(typeof i==="function")n.on(r,i)});return n}catch(n){throw console.error("Dialog creation error:",n),Error(`Failed to create dialog: ${n.message}`)}},Ui=eg;se();te();re();var tg={STANDARD:"standard",MODAL:"modal"},ng={START:"start",END:"end"};var $n={OPEN:"open",CLOSE:"close",SELECT:"select"};var xt={VARIANT:tg.STANDARD,POSITION:ng.START,OPEN:!1,DISMISSIBLE:!0,WIDTH:360};var rg=(e,t)=>{let n=document.createElement("button");if(n.className=t("drawer__item"),n.setAttribute("role","tab"),n.setAttribute("tabindex","-1"),e.id)n.dataset.id=e.id;if(e.disabled)n.disabled=!0,n.setAttribute("aria-disabled","true");let r=document.createElement("span");if(r.className=t("drawer__active-indicator"),n.appendChild(r),e.icon){let i=document.createElement("span");i.className=t("drawer__item-icon"),i.innerHTML=e.icon,n.appendChild(i)}if(e.label){let i=document.createElement("span");i.className=t("drawer__item-label"),i.textContent=e.label,n.appendChild(i)}if(e.badge){let i=document.createElement("span");i.className=t("drawer__item-badge"),i.textContent=e.badge,n.appendChild(i)}if(e.active)n.classList.add(`${t("drawer__item")}--active`),n.setAttribute("aria-selected","true"),n.setAttribute("tabindex","0");else n.setAttribute("aria-selected","false");return n},ig=(e)=>{let t=document.createElement("hr");return t.className=e("drawer__divider"),t.setAttribute("role","separator"),t},sg=(e,t)=>{let n=document.createElement("div");return n.className=t("drawer__section-label"),n.textContent=e.label||e.sectionLabel||"",n},Gi=(e)=>(t)=>{let n=e.items||[],r=null,i=null,s=n.find((C)=>C.type!=="divider"&&C.type!=="section"&&C.active);if(s?.id)r=s.id;let a=()=>{if(!i)return;i.innerHTML="";let C=0;if(n.forEach((g)=>{let m=g.type||"item";if(m==="divider"){i.appendChild(ig(t.getClass));return}if(m==="section"){i.appendChild(sg(g,t.getClass));return}let p=rg(g,t.getClass);p.dataset.navIndex=String(C),C++,p.addEventListener("click",(h)=>{if(g.id&&!g.disabled){o(g.id);let b={id:g.id,label:g.label||"",index:parseInt(p.dataset.navIndex||"0",10),originalEvent:h};if(t.emit($n.SELECT,b),e.onSelect)e.onSelect(b)}}),i.appendChild(p)}),!r){let g=i.querySelector(`.${t.getClass("drawer__item")}`);if(g)g.setAttribute("tabindex","0")}},o=(C)=>{if(!i)return;let g=`${t.getClass("drawer__item")}--active`;if(i.querySelectorAll(`.${t.getClass("drawer__item")}`).forEach((p)=>{p.classList.remove(g),p.setAttribute("aria-selected","false"),p.setAttribute("tabindex","-1")}),!C){r=null;let p=i.querySelector(`.${t.getClass("drawer__item")}`);if(p)p.setAttribute("tabindex","0")}else{let p=i.querySelector(`[data-id="${C}"]`);if(p)p.classList.add(g),p.setAttribute("aria-selected","true"),p.setAttribute("tabindex","0"),r=C}n=n.map((p)=>({...p,active:p.id===C}))},l=()=>r,d=(C)=>{n=C,r=C.find((m)=>m.type!=="divider"&&m.type!=="section"&&m.active)?.id||null,a()},u=()=>n,f=(C,g)=>{if(!i)return;let m=i.querySelector(`[data-id="${C}"]`);if(!m)return;let p=m.querySelector(`.${t.getClass("drawer__item-badge")}`);if(g){if(!p)p=document.createElement("span"),p.className=t.getClass("drawer__item-badge"),m.appendChild(p);p.textContent=g}else if(p)p.remove();n=n.map((h)=>h.id===C?{...h,badge:g}:h)},c=(C)=>{if(!i)return;let g=Array.from(i.querySelectorAll(`.${t.getClass("drawer__item")}:not([disabled])`));if(!g.length)return;let m=g.indexOf(document.activeElement),p=-1;switch(C.key){case"ArrowDown":C.preventDefault(),p=m<g.length-1?m+1:0;break;case"ArrowUp":C.preventDefault(),p=m>0?m-1:g.length-1;break;case"Home":C.preventDefault(),p=0;break;case"End":C.preventDefault(),p=g.length-1;break;case"Enter":case" ":if(C.preventDefault(),m>=0)g[m].click();return;default:return}if(p>=0&&p<g.length)g.forEach((h)=>h.setAttribute("tabindex","-1")),g[p].setAttribute("tabindex","0"),g[p].focus()};return i=document.createElement("div"),i.className=t.getClass("drawer__items"),i.setAttribute("role","tablist"),i.setAttribute("aria-orientation","vertical"),i.addEventListener("keydown",c),a(),{...t,itemsContainer:i,drawerItems:{setActive:o,getActive:l,setItems:d,getItems:u,setBadge:f,renderItems:a}}};var zi=(e)=>(t)=>{let n=e.variant==="modal",r=e.dismissible!==!1,i=e.open===!0,s=null;if(n){if(s=document.createElement("div"),s.className=t.getClass("drawer__scrim"),r)s.addEventListener("click",()=>{l()})}let a=(u)=>{if(u.key==="Escape"&&i&&n&&r)u.preventDefault(),l()};if(n)document.addEventListener("keydown",a);function o(){if(i)return;if(i=!0,t.element.classList.add(`${t.getClass("drawer")}--open`),n&&s)s.classList.add(`${t.getClass("drawer__scrim")}--visible`),document.body.style.overflow="hidden";if(requestAnimationFrame(()=>{let u=t.element.querySelector(`.${t.getClass("drawer__item")}[tabindex="0"]`);if(u)u.focus();else t.element.focus()}),t.emit($n.OPEN),e.onOpen)e.onOpen()}function l(){if(!i)return;if(i=!1,t.element.classList.remove(`${t.getClass("drawer")}--open`),n&&s)s.classList.remove(`${t.getClass("drawer__scrim")}--visible`),document.body.style.overflow="";if(t.emit($n.CLOSE),e.onClose)e.onClose()}function d(){if(i)l();else o()}if(i){if(t.element.classList.add(`${t.getClass("drawer")}--open`),n&&s)s.classList.add(`${t.getClass("drawer__scrim")}--visible`)}return{...t,scrimElement:s,drawerState:{open:o,close:l,toggle:d,isOpen:()=>i},_stateCleanup:()=>{if(n){if(document.removeEventListener("keydown",a),s&&s.parentNode)s.parentNode.removeChild(s);document.body.style.overflow=""}}}};var Wi=(e)=>(t)=>{let n=null,r=e.headline||"";if(r)n=document.createElement("div"),n.className=t.getClass("drawer__headline"),n.textContent=r;return{...t,headlineElement:n,drawerHeadline:{setHeadline:(a)=>{if(r=a,a){if(!n)n=document.createElement("div"),n.className=t.getClass("drawer__headline");n.textContent=a}else if(n&&n.parentNode)n.parentNode.removeChild(n),n=null},getHeadline:()=>r,getElement:()=>n}}};tn();var Yd=({state:e,items:t,headline:n,lifecycle:r})=>(i)=>{let s={element:i.element,getClass:i.getClass,lifecycle:r,on(a,o){if(i.on)i.on(a,o);return s},off(a,o){if(i.off)i.off(a,o);return s},addClass(...a){if(i.addClass)i.addClass(...a);else ee(i.element,...a);return s},open(){return e.open(),s},close(){return e.close(),s},toggle(){return e.toggle(),s},isOpen(){return e.isOpen()},setActive(a){return t.setActive(a),s},getActive(){return t.getActive()},setItems(a){return t.setItems(a),s},getItems(){return t.getItems()||[]},setBadge(a,o){return t.setBadge(a,o),s},setHeadline(a){return n.setHeadline(a),s},getHeadline(){return n.getHeadline()},destroy(){r.destroy()}};return s};ne();var ag={variant:xt.VARIANT,position:xt.POSITION,open:xt.OPEN,dismissible:xt.DISMISSIBLE,width:xt.WIDTH,items:[]},Xd=(e={})=>_(ag,e,"drawer"),qd=(e)=>{let t=e.variant==="modal",n={};if(t)n.role="dialog",n["aria-modal"]="true";else n.role="navigation";if(e.ariaLabel)n["aria-label"]=e.ariaLabel;return V(e,{tag:"aside",attributes:n,className:[e.dense?`${e.prefix}-drawer--dense`:null,e.class].filter(Boolean),forwardEvents:{click:!0,keydown:!0}})},jd=(e)=>({state:{open:()=>e.drawerState.open(),close:()=>e.drawerState.close(),toggle:()=>e.drawerState.toggle(),isOpen:()=>e.drawerState.isOpen()},items:{setActive:(t)=>e.drawerItems.setActive(t),getActive:()=>e.drawerItems.getActive(),setItems:(t)=>e.drawerItems.setItems(t||[]),getItems:()=>e.drawerItems.getItems(),setBadge:(t,n)=>e.drawerItems.setBadge(t,n)},headline:{setHeadline:(t)=>e.drawerHeadline.setHeadline(t),getHeadline:()=>e.drawerHeadline.getHeadline()},lifecycle:{destroy:()=>{if(e._stateCleanup)e._stateCleanup();e.lifecycle.destroy()}}});var og=(e={})=>{let t=Xd(e);try{return M(D,k(),O(qd(t)),oe(t),Wi(t),Gi(t),zi(t),P(),(r)=>{let i=document.createElement("div");i.className=r.getClass("drawer__sheet");let s=t.width,a=s?typeof s==="number"?`${s}px`:s:`${xt.WIDTH}px`;if(r.element.style.setProperty("--drawer-width",a),r.headlineElement)i.appendChild(r.headlineElement);if(r.itemsContainer)i.appendChild(r.itemsContainer);if(r.scrimElement)r.element.appendChild(r.scrimElement);r.element.appendChild(i);let o=t.position||"start";return r.element.classList.add(`${r.getClass("drawer")}--${o}`),r},(r)=>Yd(jd(r))(r))(t)}catch(n){throw console.error("Drawer creation error:",n),Error(`Failed to create drawer: ${n.message}`)}},Ki=og;se();te();re();var Zd=({disabled:e,lifecycle:t,className:n})=>(r)=>({...r,element:r.element,getValue:()=>r.element.value,setValue(i){return r.element.value=i,this},enable(){return e.enable(),this},disable(){return e.disable(),this},setIcon(i){return r.icon.setIcon(i),this},getIcon(){return r.icon.getIcon()},setPosition(i){return["top-right","top-left","bottom-right","bottom-left"].forEach((a)=>{r.element.classList.remove(`${n}--${a}`)}),r.element.classList.add(`${n}--${i}`),this},getPosition(){let i=["top-right","top-left","bottom-right","bottom-left"];for(let s of i)if(r.element.classList.contains(`${n}--${s}`))return s;return null},lower(){return r.element.classList.add(`${n}--lowered`),this},raise(){return r.element.classList.remove(`${n}--lowered`),this},destroy(){t.destroy()}});ne();var lg={variant:"primary",size:"default",type:"button",ripple:!0},Qd=(e={})=>_(lg,e,"fab"),Jd=(e)=>{let t={type:e.type||"button","aria-label":e.ariaLabel||(e.icon?"action":void 0)};if(e.disabled===!0)t.disabled=!0;let n=[];if(n.push(`fab--${e.size||"default"}`),e.animate)n.push("fab--animate-enter");if(e.position)n.push(`fab--${e.position}`);if(e.disabled===!0)n.push("fab--disabled");let r={...e,className:n};return V(r,{tag:"button",attributes:t,forwardEvents:{click:(i)=>!i.element.disabled,focus:!0,blur:!0},interactive:!0})},eu=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable()},lifecycle:{destroy:()=>e.lifecycle.destroy()},className:e.getClass("fab")});var dg=(e={})=>{let t=Qd(e);try{return M(D,k(),O(Jd(t)),oe(t),Be(t),de(t),we(t),P(),(r)=>Zd(eu(r))(r))(t)}catch(n){throw console.error("FAB creation error:",n),Error(`Failed to create FAB: ${n.message}`)}},Dr=dg;se();te();re();var tu=({disabled:e,lifecycle:t,text:n,className:r})=>(i)=>({...i,element:i.element,getValue:()=>i.element.value,setValue(s){return i.element.value=s,this},enable(){return e.enable(),this},disable(){return e.disable(),this},setIcon(s){return i.icon.setIcon(s),this},getIcon(){return i.icon.getIcon()},setText(s){return n.setText(s),this},getText(){return n.getText()},setPosition(s){return["top-right","top-left","bottom-right","bottom-left"].forEach((o)=>{i.element.classList.remove(`${r}--${o}`)}),i.element.classList.add(`${r}--${s}`),this},getPosition(){let s=["top-right","top-left","bottom-right","bottom-left"];for(let a of s)if(i.element.classList.contains(`${r}--${a}`))return a;return null},lower(){return i.element.classList.add(`${r}--lowered`),this},raise(){return i.element.classList.remove(`${r}--lowered`),this},collapse(){i.element.classList.add(`${r}--collapsed`);let s=new CustomEvent("collapse",{bubbles:!0,cancelable:!0});return i.element.dispatchEvent(s),this},expand(){i.element.classList.remove(`${r}--collapsed`);let s=new CustomEvent("expand",{bubbles:!0,cancelable:!0});return i.element.dispatchEvent(s),this},destroy(){t.destroy()}});ne();var ug={variant:"primary",type:"button",ripple:!0,iconPosition:"start",width:"fixed"},nu=(e={})=>_(ug,e,"extended-fab"),ru=(e)=>{let t={type:e.type||"button","aria-label":e.ariaLabel||e.text||(e.icon?"action":void 0)},n=[`${e.prefix}-extended-fab`];if(e.variant)n.push(`${e.prefix}-extended-fab--${e.variant}`);if(e.width)n.push(`${e.prefix}-extended-fab--${e.width}`);if(e.animate)n.push(`${e.prefix}-extended-fab--animate-enter`);if(e.position)n.push(`${e.prefix}-extended-fab--${e.position}`);if(e.collapseOnScroll)n.push(`${e.prefix}-extended-fab--collapsible`);if(e.class)n.push(e.class);if(e.disabled===!0)t.disabled=!0,n.push(`${e.prefix}-extended-fab--disabled`);return V(e,{tag:"button",attributes:t,className:n,forwardEvents:{click:(r)=>!r.element.disabled,focus:!0,blur:!0},interactive:!0})},iu=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable()},lifecycle:{destroy:()=>e.lifecycle.destroy()},className:e.getClass("extended-fab"),text:{setText:(t)=>e.text.setText(t),getText:()=>e.text.getText()}});var cg=(e={})=>{let t=nu(e),n=(r)=>{if(t.collapseOnScroll){let i=window.scrollY,s=!1,a=10,o=()=>{if(!s)window.requestAnimationFrame(()=>{let d=window.scrollY,u=d-i;if(u>a)r.collapse();else if(u<-a)r.expand();if(d<=0)r.expand();i=d,s=!1}),s=!0};window.addEventListener("scroll",o,{passive:!0}),requestAnimationFrame(()=>{r.expand()});let l=r.destroy;r.destroy=()=>{window.removeEventListener("scroll",o),l.call(r)}}};try{let r=M(D,k(),O(ru(t)),oe(t),Be(t),lt(t),de(t),we(t),P(),(i)=>tu(iu(i))(i))(t);return n(r),r}catch(r){throw console.error("Extended FAB creation error:",r),Error(`Failed to create Extended FAB: ${r.message}`)}},Mr=cg;te();re();var Or={SELECT:"select",LOAD:"load",SCROLL:"scroll"};var he={CONTAINER:"list-container",LIST:"list",ITEM:"list-item",SELECTED:"list-item--selected",LOADING:"list--loading",EMPTY:"list--empty"};var mg=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize list renderer: missing element"),t;let n=e.items||[],r=e.renderItem,i=document.createElement("div");i.className="mtrl-list-content",i.setAttribute("role","list"),t.element.appendChild(i);function s(d,u){let f=document.createElement("div");f.className=he.ITEM,f.setAttribute("role","listitem");let c=document.createElement("div");c.className="mtrl-list-item-content";let C=document.createElement("div");return C.className="mtrl-list-item-text",C.textContent=d.text||d.title||d.headline||d.name||d.id||String(d),c.appendChild(C),f.appendChild(c),f}let a=()=>{if(i.innerHTML="",!n||n.length===0){i.innerHTML='<div class="mtrl-list-empty">No items</div>';return}let d=document.createDocumentFragment();n.forEach((u,f)=>{if(u==null)return;let c=r?r(u,f):s(u,f);if(!c)return;if(!c.classList.contains(he.ITEM))c.classList.add(he.ITEM);if(!c.hasAttribute("role"))c.setAttribute("role","listitem");let C=u?.id||String(f);if(!c.hasAttribute("data-id"))c.setAttribute("data-id",C);d.appendChild(c)}),i.appendChild(d),t.emit?.(Or.LOAD,{items:n,loading:!1,hasNext:!1,hasPrev:!1,component:t}),console.log(`\uD83D\uDCCB Rendered ${n.length} items directly`)},o=(d,u="start",f=!1)=>{let c=i.querySelector(`[data-id="${d}"]`);if(c)c.scrollIntoView({behavior:f?"smooth":"auto",block:u==="center"?"center":u==="end"?"end":"start"})},l=(d,u="start",f=!1)=>{if(d<0||d>=n.length)return;let c=i.children[d];if(c)c.scrollIntoView({behavior:f?"smooth":"auto",block:u==="center"?"center":u==="end"?"end":"start"})};if(a(),t.lifecycle?.destroy){let d=t.lifecycle.destroy;t.lifecycle.destroy=()=>{i.innerHTML="",d()}}return{...t,list:{getItems:()=>n,getAllItems:()=>n,getVisibleItems:()=>n,refresh:a,scrollToItem:o,scrollToIndex:l,loadNext:()=>Promise.resolve({hasNext:!1,items:[]}),loadPage:()=>Promise.resolve({hasNext:!1,items:[]}),loadPrevious:()=>Promise.resolve({hasPrev:!1,items:[]}),scrollNext:()=>Promise.resolve({hasNext:!1,items:[]}),scrollPrevious:()=>Promise.resolve({hasPrev:!1,items:[]}),scrollToItemById:(d,u,f)=>(o(d,u,f),Promise.resolve()),onCollectionChange:()=>()=>{},onPageChange:()=>()=>{},getCurrentPage:()=>1,getPageSize:()=>n.length,getCollection:()=>null,isApiMode:()=>!1,isLoading:()=>!1,hasNextPage:()=>!1}}},Yi=mg;en();tn();var fg=(e)=>(t)=>{if(!t.element||!e.trackSelection)return{...t,getSelectedItems:()=>[],getSelectedItemIds:()=>[],isItemSelected:()=>!1,selectItem:()=>t,deselectItem:()=>t,clearSelection:()=>t,setSelection:()=>t};let n=new Set;if(Array.isArray(e.initialSelection))e.initialSelection.forEach((a)=>n.add(String(a)));if(Array.isArray(e.items))e.items.forEach((a,o)=>{if(a?.selected){let l=a.id||String(o);n.add(String(l))}});let r=()=>{(t.element?.querySelectorAll("[data-id]")||[]).forEach((o)=>{let l=o.getAttribute("data-id"),d=n.has(l);if(d&&!rt(o,he.SELECTED))ee(o,he.SELECTED);else if(!d&&rt(o,he.SELECTED))Ce(o,he.SELECTED)})},i=(a)=>{let o=a.target.closest("[data-id]");if(!o)return;let l=o.getAttribute("data-id");if(!l)return;let d=t.list?.getItems()||[],u=d.find((c)=>String(c?.id)===l);if(!u){let c=parseInt(l,10);if(!isNaN(c)&&c>=0&&c<d.length)u=d[c]}if(!u){console.warn(`Item not found for ID: ${l}`);return}let f={item:u,element:o,originalEvent:a,component:t,preventDefault:()=>{f.defaultPrevented=!0},defaultPrevented:!1};if(t.emit?.(Or.SELECT,f),f.defaultPrevented)return;if(e.multiSelect)if(n.has(l))n.delete(l),Ce(o,he.SELECTED);else n.add(l),ee(o,he.SELECTED);else{let c=rt(o,he.SELECTED);if(t.element.querySelectorAll(`.${K}-${he.SELECTED}`).forEach((g)=>Ce(g,he.SELECTED)),n.clear(),!c)n.add(l),ee(o,he.SELECTED)}},s=(a,o)=>{let l=String(a);if(o)n.add(l);else n.delete(l);let d=t.element.querySelector(`[data-id="${l}"]`);if(d){if(o&&!rt(d,he.SELECTED))ee(d,he.SELECTED);else if(!o&&rt(d,he.SELECTED))Ce(d,he.SELECTED)}};if(t.element.addEventListener("click",i),setTimeout(r,10),t.lifecycle?.destroy){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{t.element.removeEventListener("click",i),a()}}return{...t,getSelectedItems:()=>(t.list?.getItems()||[]).filter((o,l)=>{let d=o?.id||String(l);return n.has(String(d))}),getSelectedItemIds:()=>Array.from(n),isItemSelected:(a)=>n.has(String(a)),selectItem:(a)=>(s(a,!0),t),deselectItem:(a)=>(s(a,!1),t),clearSelection:()=>{if(n.size>0)n.clear(),t.element.querySelectorAll(`.${K}-${he.SELECTED}`).forEach((a)=>Ce(a,he.SELECTED));return t},setSelection:(a)=>{if(n.clear(),Array.isArray(a))a.forEach((o)=>n.add(String(o)));return r(),t}}},Xi=fg;var su=({list:e,selection:t,events:n,lifecycle:r,config:i})=>(s)=>({...s,element:s.element,refresh:async()=>(e.refresh(),s),getAllItems:()=>e.getAllItems(),getVisibleItems:()=>e.getVisibleItems(),scrollToItem:(a,o,l)=>{let d=l!==void 0?l:i?.animate||!1;return e.scrollToItem(a,o,d),s},scrollToIndex:async(a,o,l)=>{let d=l!==void 0?l:i?.animate||!1;return e.scrollToIndex(a,o,d),s},isLoading:()=>e.isLoading(),hasNextPage:()=>e.hasNextPage(),getSelectedItems:()=>t.getSelectedItems(),getSelectedItemIds:()=>t.getSelectedItemIds(),isItemSelected:(a)=>t.isItemSelected(a),selectItem:(a)=>(t.selectItem(a),s),deselectItem:(a)=>(t.deselectItem(a),s),clearSelection:()=>(t.clearSelection(),s),setSelection:(a)=>(t.setSelection(a),s),on:(a,o)=>(n.on(a,o),s),off:(a,o)=>(n.off(a,o),s),destroy:()=>{r.destroy()}});ne();var gg={items:[],trackSelection:!0,multiSelect:!1,animate:!1},au=(e={})=>{if(!Array.isArray(e.items)&&!e.renderItem)throw Error("List requires either items array or renderItem function");if(Array.isArray(e.items)&&e.items.length>0&&!e.renderItem)e.renderItem=(t)=>{let n=document.createElement("div");return n.className="mtrl-list-item",n.textContent=t.text||t.title||t.headline||t.name||t.id||String(t),n};return _(gg,e,"list")},ou=(e)=>{let t={role:"list",tabindex:"0"};if(e.ariaLabel)t["aria-label"]=e.ariaLabel;return V(e,{tag:"div",attributes:t,className:[he.CONTAINER,e.class],forwardEvents:{scroll:!0,keydown:!0}})},lu=(e,t)=>({list:{refresh:e.list?.refresh,getItems:e.list?.getItems,getAllItems:e.list?.getAllItems,getVisibleItems:e.list?.getVisibleItems,scrollToItem:e.list?.scrollToItem,scrollToIndex:e.list?.scrollToIndex,isLoading:()=>!1,hasNextPage:()=>!1},selection:{getSelectedItems:e.getSelectedItems,getSelectedItemIds:e.getSelectedItemIds,isItemSelected:e.isItemSelected,selectItem:e.selectItem,deselectItem:e.deselectItem,clearSelection:e.clearSelection,setSelection:e.setSelection},events:{on:e.on,off:e.off},lifecycle:{destroy:e.lifecycle?.destroy},config:{animate:t?.animate}});var pg=(e={})=>{try{let t=au(e);return console.log(`\uD83D\uDCCB Creating list with ${t.items?.length||0} items`),M(D,k(),O(ou(t)),Yi(t),Xi(t),P(),(r)=>su(lu(r,t))(r))(t)}catch(t){throw console.error("List creation error:",t),Error(`Failed to create list: ${t.message}`)}},qi=pg;se();te();re();var du=!1,hg=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize menu controller: missing element"),t;let n={visible:e.visible||!1,items:e.items||[],position:e.position,selectedItemId:null,activeItemIndex:-1,component:t},r={triggerEvent(v,E={},T){let S={menu:n.component,...E,originalEvent:T,preventDefault:()=>{S.defaultPrevented=!0},defaultPrevented:!1};return t.emit(v,S),S}},i=()=>{if(t.opener&&typeof t.opener.getOpener==="function")return t.opener.getOpener();let{opener:v}=e;if(typeof v==="string"){let E=document.querySelector(v);if(!E)return console.warn(`Menu opener not found: ${v}`),null;return E}if(typeof v==="object"&&v!==null&&"element"in v)return v.element;return v},s=(v,E)=>{let T=document.createElement("li"),S=`${t.getClass("menu-item")}`;if(T.className=S,T.setAttribute("role","menuitem"),T.setAttribute("tabindex","-1"),T.setAttribute("data-id",v.id),T.setAttribute("data-index",E.toString()),v.disabled)T.classList.add(`${S}--disabled`),T.setAttribute("aria-disabled","true");else T.setAttribute("aria-disabled","false");if(n.selectedItemId&&v.id===n.selectedItemId)T.classList.add(`${S}--selected`),T.setAttribute("aria-selected","true");else T.setAttribute("aria-selected","false");if(v.hasSubmenu)T.classList.add(`${S}--submenu`),T.setAttribute("aria-haspopup","true"),T.setAttribute("aria-expanded","false");let y=document.createElement("span");if(y.className=`${t.getClass("menu-item-content")}`,v.icon){let I=document.createElement("span");I.className=`${t.getClass("menu-item-icon")}`,I.innerHTML=v.icon,y.appendChild(I)}let L=document.createElement("span");if(L.className=`${t.getClass("menu-item-text")}`,L.textContent=v.text,y.appendChild(L),v.shortcut){let I=document.createElement("span");I.className=`${t.getClass("menu-item-shortcut")}`,I.textContent=v.shortcut,y.appendChild(I)}if(T.appendChild(y),!v.disabled){if(T.addEventListener("click",(I)=>d(I,v,E)),T.addEventListener("keydown",(I)=>{if(I.key==="Enter"||I.key===" ")I.preventDefault(),d(I,v,E)}),T.addEventListener("focus",()=>{n.activeItemIndex=E}),v.hasSubmenu&&e.openSubmenuOnHover)T.addEventListener("mouseenter",()=>{if(t.submenu)t.submenu.handleSubmenuHover(v,E,T)}),T.addEventListener("mouseleave",(I)=>{if(t.submenu)t.submenu.handleSubmenuLeave(I)})}return T},a=(v,E)=>{let T=document.createElement("li");if(T.className=`${t.getClass("menu-divider")}`,T.setAttribute("role","separator"),T.setAttribute("data-index",E.toString()),v.id)T.setAttribute("id",v.id);return T},o=()=>{let v=document.createElement("ul");v.className=`${t.getClass("menu-list")}`,v.setAttribute("role","menu"),n.items.forEach((E,T)=>{if("type"in E&&E.type==="divider")v.appendChild(a(E,T));else v.appendChild(s(E,T))}),t.element.innerHTML="",t.element.appendChild(v)},l=(v)=>{for(let E of n.items){if("id"in E&&E.id===v)return E;if("submenu"in E&&Array.isArray(E.submenu)){for(let T of E.submenu)if("id"in T&&T.id===v)return T}}return null},d=(v,E,T)=>{if(v.preventDefault(),v.stopPropagation(),E.disabled)return;if(E.hasSubmenu&&t.submenu){t.submenu.handleSubmenuClick(E,T,v.currentTarget);return}let S=r.triggerEvent("select",{item:E,itemId:E.id,itemData:E.data},v);if(e.closeOnSelect&&!S.defaultPrevented)c(v,!0)},u=(v)=>{if(!t.element)return;t.element.querySelectorAll(`.${t.getClass("menu-item")}`).forEach((T)=>{if(T.getAttribute("data-id")===v)T.classList.add(`${t.getClass("menu-item--selected")}`),T.setAttribute("aria-selected","true");else T.classList.remove(`${t.getClass("menu-item--selected")}`),T.setAttribute("aria-selected","false")}),n.selectedItemId=v},f=(v,E="mouse")=>{if(n.visible)return;if(n.visible=!0,document.removeEventListener("click",g),!t.element.parentNode)t.element.classList.remove(`${t.getClass("menu--visible")}`),t.element.setAttribute("aria-hidden","true"),t.element.style.transform="scaleY(0)",t.element.style.opacity="0",(e.container||document.body).appendChild(t.element);setTimeout(()=>{let T=i();if(T&&t.position)t.position.positionMenu(T);t.element.setAttribute("aria-hidden","false"),t.element.style.transform="",t.element.style.opacity="",t.element.getBoundingClientRect(),t.element.classList.add(`${t.getClass("menu--visible")}`),setTimeout(()=>{if(t.keyboard&&t.keyboard.handleInitialFocus)t.keyboard.handleInitialFocus(t.element,E);else if(E==="keyboard"){let S=Array.from(t.element.querySelectorAll(`.${t.getClass("menu-item")}:not(.${t.getClass("menu-item--disabled")})`));if(S.length>0)S.forEach((y)=>{y.tabIndex=-1}),S[0].tabIndex=0,S[0].focus();else t.element.tabIndex=0,t.element.focus()}else{t.element.tabIndex=-1;let S=Array.from(t.element.querySelectorAll(`.${t.getClass("menu-item")}:not(.${t.getClass("menu-item--disabled")})`));if(S.length>0)S.forEach((y)=>{y.tabIndex=-1}),S[0].tabIndex=0}},100),setTimeout(()=>{if(e.closeOnClickOutside&&n.visible)document.addEventListener("click",g);if(e.closeOnEscape)document.addEventListener("keydown",m);window.addEventListener("resize",p,{passive:!0}),window.addEventListener("scroll",h,{passive:!0})},0)},20),r.triggerEvent("open",{},v)},c=(v,E=!0)=>{if(!n.visible)return;if(t.emit("menu-closing",{event:v,restoreFocus:E}),t.submenu)t.submenu.closeAllSubmenus();setTimeout(()=>{n.visible=!1,t.element.setAttribute("aria-hidden","true"),t.element.classList.remove(`${t.getClass("menu--visible")}`),document.removeEventListener("click",g),document.removeEventListener("keydown",m),window.removeEventListener("resize",p),window.removeEventListener("scroll",h),r.triggerEvent("close",{restoreFocus:E},v),setTimeout(()=>{if(t.element.parentNode&&!n.visible)t.element.parentNode.removeChild(t.element)},300)},50)},C=(v,E="mouse")=>{if(n.visible)c(v);else{if(v){if(v instanceof KeyboardEvent)E="keyboard";else if(v instanceof MouseEvent)E="mouse"}f(v,E)}},g=(v)=>{if(du){du=!1;return}if(t.element.contains(v.target))return;let E=i();if(E&&E.contains(v.target))return;if(t.submenu&&t.submenu.hasOpenSubmenu()){let T=t.submenu.getActiveSubmenus();for(let S of T)if(S.element.contains(v.target))return}c(v,!1)},m=(v)=>{let E=t.element.contains(v.target),T=t.submenu&&t.submenu.hasOpenSubmenu()&&t.submenu.getActiveSubmenus().some((S)=>S.element.contains(v.target));if(n.visible){if(E||T){if(v.key==="Escape")v.preventDefault(),c(v,!0)}else if(t.keyboard&&t.keyboard.handleMenuKeydown)t.keyboard.handleMenuKeydown(v,n,{closeMenu:c,closeSubmenu:t.submenu?t.submenu.closeSubmenu:null,findItemById:l,handleSubmenuClick:t.submenu?t.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:t.submenu?t.submenu.handleNestedSubmenuClick:null})}},p=()=>{if(n.visible)if(e.closeOnResize)c(void 0,!0);else{let v=i();if(v&&t.position)t.position.positionMenu(v)}},h=()=>{if(n.visible)window.requestAnimationFrame(()=>{let v=i();if(v&&t.position)t.position.positionMenu(v)})},b=()=>{if(o(),t.keyboard&&t.keyboard.setupKeyboardHandlers)t.keyboard.setupKeyboardHandlers(t.element,n,{closeMenu:c,closeSubmenu:t.submenu?t.submenu.closeSubmenu:null,findItemById:l,handleSubmenuClick:t.submenu?t.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:t.submenu?t.submenu.handleNestedSubmenuClick:null});if(n.visible){let v=i();if(v&&t.position)t.position.positionMenu(v);if(t.element.classList.add(`${t.getClass("menu--visible")}`),e.closeOnClickOutside)document.addEventListener("click",g);if(e.closeOnEscape)document.addEventListener("keydown",m);window.addEventListener("resize",p),window.addEventListener("scroll",h)}};if(t.on("create-menu-items",(v)=>{let{items:E,container:T,onItemCreated:S}=v;E.forEach((y,L)=>{let I;if("type"in y&&y.type==="divider")I=a(y,L);else I=s(y,L);if(T.appendChild(I),S)S(I)})}),setTimeout(b,0),t.lifecycle){let v=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{document.removeEventListener("click",g),document.removeEventListener("keydown",m),window.removeEventListener("resize",p),window.removeEventListener("scroll",h),v()}}return{...t,menu:{open:(v,E="mouse")=>(f(v,E),t),close:(v,E=!0)=>(c(v,E),t),toggle:(v,E="mouse")=>(C(v,E),t),isOpen:()=>n.visible,setItems:(v)=>(n.items=v,o(),t),getItems:()=>n.items,setPosition:(v)=>{if(n.position=v,n.visible){let E=i();if(E&&t.position)t.position.positionMenu(E)}return t},getPosition:()=>n.position,setSelected:(v)=>(u(v),t),getSelected:()=>n.selectedItemId}}},ji=hg;var Cg=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize menu opener: missing element"),t;let n=!1;document.addEventListener("keydown",(m)=>{n=m.key==="Tab",setTimeout(()=>{n=!1},100)});let r={openerElement:null,openerComponent:null,activeClass:""},i=(m)=>{if(!m)return{element:null,component:null};if(typeof m==="string"){let p=document.querySelector(m);if(!p)return console.warn(`Menu opener not found: ${m}`),{element:null,component:null};return{element:p,component:null}}if(typeof m==="object"&&m!==null){if("element"in m&&m.element instanceof HTMLElement)return{element:m.element,component:m};if("getElement"in m&&typeof m.getElement==="function"){let p=m.getElement();if(p instanceof HTMLElement)return{element:p,component:m}}if("input"in m&&m.input instanceof HTMLElement)return{element:m.input,component:m};if(m instanceof HTMLElement)return{element:m,component:null}}return console.warn("Invalid opener type:",m),{element:null,component:null}},s=(m)=>{let p=t.getClass("").split("-")[0];if(m.tagName==="BUTTON")return`${p}-button--active`;else if(m.classList.contains(`${p}-chip`))return`${p}-chip--selected`;else if(m.classList.contains(`${p}-textfield`)||m.classList.contains(`${p}-select`))return`${p}-textfield--focused`;else return`${p}-menu-opener--active`},a=(m)=>{let{element:p,component:h}=m;if(!p)return;if(r.openerElement&&r.openerElement!==p)c();if(r.openerElement=p,r.openerComponent=h,r.activeClass=s(p),!e.manualOpen)p.addEventListener("click",d),p.addEventListener("keydown",u),p.addEventListener("blur",f);p.setAttribute("aria-haspopup","true"),p.setAttribute("aria-expanded","false");let b=t.element.id;if(!b)b=`menu-${Date.now()}-${Math.floor(Math.random()*1000)}`,t.element.id=b;p.setAttribute("aria-controls",b)},o=(m)=>{if(!r.openerElement)return;if(r.openerComponent&&typeof r.openerComponent.setActive==="function"){r.openerComponent.setActive(m);return}if(r.openerComponent&&"selected"in r.openerComponent){r.openerComponent.selected=m;return}if(r.openerComponent&&typeof r.openerComponent.focus==="function"&&typeof r.openerComponent.blur==="function"){if(m)r.openerComponent.focus();else r.openerComponent.blur();return}if(r.openerElement.classList)if(m)r.openerElement.classList.add(r.activeClass);else r.openerElement.classList.remove(r.activeClass)},l=()=>{if(!r.openerElement)return;if(r.openerComponent&&typeof r.openerComponent.focus==="function"){requestAnimationFrame(()=>{r.openerComponent.focus()});return}if(r.openerComponent&&"input"in r.openerComponent&&r.openerComponent.input instanceof HTMLElement){requestAnimationFrame(()=>{r.openerComponent.input.focus()});return}requestAnimationFrame(()=>{r.openerElement.focus()})},d=(m)=>{if(m.preventDefault(),m.stopPropagation(),t.menu)if(t.menu.isOpen())t.menu.close(m);else t.menu.open(m,"mouse")},u=(m)=>{if(!t.menu)return;let p=t.menu.isOpen();switch(m.key){case"Enter":case" ":case"ArrowDown":case"Down":if(m.preventDefault(),!p)t.menu.open(m,"keyboard");break;case"Escape":if(p)m.preventDefault(),t.menu.close(m);break;case"ArrowUp":case"Up":if(m.preventDefault(),!p)t.menu.open(m,"keyboard"),setTimeout(()=>{let h=t.element.querySelectorAll(`.${t.getClass("menu-item")}:not(.${t.getClass("menu-item--disabled")})`);if(h.length>0){h.forEach((v)=>v.setAttribute("tabindex","-1"));let b=h[h.length-1];b.setAttribute("tabindex","0"),b.focus()}},100);break}},f=(m)=>{if(!t.menu||!t.menu.isOpen())return;let p=m.relatedTarget;if(n){setTimeout(()=>{if(t.menu&&t.menu.isOpen())t.menu.close(m,!1)},10);return}if(p){if(t.element.contains(p))return;if(p.getAttribute("aria-haspopup")==="true"||p.closest('[aria-haspopup="true"]'))return}setTimeout(()=>{if(t.menu&&t.menu.isOpen())t.menu.close(m,!1)},50)},c=()=>{if(r.openerElement){if(!e.manualOpen)r.openerElement.removeEventListener("click",d),r.openerElement.removeEventListener("keydown",u),r.openerElement.removeEventListener("blur",f);r.openerElement.removeAttribute("aria-haspopup"),r.openerElement.removeAttribute("aria-expanded"),r.openerElement.removeAttribute("aria-controls"),o(!1)}r.openerComponent=null,r.openerElement=null,r.activeClass=""},{element:C,component:g}=i(e.opener);if(a({element:C,component:g}),t.lifecycle){let m=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{c(),m()}}return t.on("open",()=>{if(r.openerElement)r.openerElement.setAttribute("aria-expanded","true"),o(!0)}),t.on("close",(m)=>{if(r.openerElement){if(r.openerElement.setAttribute("aria-expanded","false"),o(!1),m.restoreFocus&&!n)l()}}),{...t,opener:{setOpener(m){let p=i(m);if(p.element)a(p);return t},getOpener(){return r.openerElement},getOpenerComponent(){return r.openerComponent},setActive(m){return o(m),t},focus(){return l(),t}}}},Zi=Cg;var Eg=(e,t)=>{let n=(s,a,o,l=!1)=>{if(!s||!a)return;let d=t.container&&t.container!==document.body;s.style.position="absolute";let u=d?0:window.pageXOffset||document.documentElement.scrollLeft,f=d?0:window.pageYOffset||document.documentElement.scrollTop,c=a.getBoundingClientRect(),C=s.cloneNode(!0);if(C.style.visibility="hidden",C.style.display="block",C.style.position="absolute",C.style.top="0",C.style.left="0",C.style.transform="none",C.style.opacity="0",C.style.pointerEvents="none",C.classList.add(`${e.getClass("menu--visible")}`),t.width==="100%"&&!l)C.style.width=`${c.width}px`;let g=t.container||document.body;g.appendChild(C);let m=C.getBoundingClientRect(),p=window.innerWidth,h=window.innerHeight;g.removeChild(C);let b=t.offset!==void 0?t.offset:8,v=0,E=0,T=o;if(l){if(T=o||"right-start",T.startsWith("right")&&c.right+m.width+b>p-16)T=T.replace("right","left");else if(T.startsWith("left")&&c.left-m.width-b<16)T=T.replace("left","right");if(c.top+m.height>h-48){if(T==="right-start")T="right-end";else if(T==="left-start")T="left-end"}}else switch(o){case"top-start":case"top":case"top-end":if(c.top<m.height+b+48)T=o.replace("top","bottom");break;case"bottom-start":case"bottom":case"bottom-end":if(c.bottom+m.height+b+48>h){if(c.top>h-c.bottom)T=o.replace("bottom","top")}break;case"right-start":case"right":case"left-start":case"left":if(c.bottom+m.height>h-48){if(o==="right-start")T="right-end";else if(o==="left-start")T="left-end";else if(o==="right")v=c.top-(m.height-c.height)-b;else if(o==="left")v=c.top-(m.height-c.height)-b}break}if(["position-top","position-bottom","position-right","position-left"].forEach((q)=>{s.classList.remove(`${e.getClass("menu")}--${q}`)}),T.startsWith("top")||T==="right-end"||T==="left-end"||T==="right"&&v<c.top||T==="left"&&v<c.top)s.classList.add(`${e.getClass("menu")}--position-top`);else if(T.startsWith("left"))s.classList.add(`${e.getClass("menu")}--position-left`);else if(T.startsWith("right"))s.classList.add(`${e.getClass("menu")}--position-right`);else s.classList.add(`${e.getClass("menu")}--position-bottom`);let L=d&&t.container?t.container.getBoundingClientRect():{top:0,left:0,right:0,bottom:0},I=d?-L.left:u,x=d?-L.top:f;switch(T){case"top-start":v=c.top+x-m.height-b,E=c.left+I;break;case"top":v=c.top+x-m.height-b,E=c.left+I+c.width/2-m.width/2;break;case"top-end":v=c.top+x-m.height-b,E=c.right+I-m.width;break;case"right-start":v=c.top+x,E=c.right+I+b;break;case"right":if(v===0)v=c.top+x+c.height/2-m.height/2;else v+=x;E=c.right+I+b;break;case"right-end":v=c.bottom+x-m.height,E=c.right+I+b;break;case"bottom-start":v=c.bottom+x+b,E=c.left+I;break;case"bottom":v=c.bottom+x+b,E=c.left+I+c.width/2-m.width/2;break;case"bottom-end":v=c.bottom+x+b,E=c.right+I-m.width;break;case"left-start":v=c.top+x,E=c.left+I-m.width-b;break;case"left":if(v===0)v=c.top+x+c.height/2-m.height/2;else v+=x;E=c.left+I-m.width-b;break;case"left-end":v=c.bottom+x-m.height,E=c.left+I-m.width-b;break}if(d){if(s.style.top=`${v}px`,s.style.left=`${E}px`,t.width==="100%"&&!l)s.style.width=`${c.width}px`;if(t.maxHeight)s.style.maxHeight=t.maxHeight;return}let A=48;if(v-f<A)v=A+f;let N=48;if(v-f+m.height>h-N){let q=h-(v-f)-N,Y=Math.min(m.height,100),J=Math.max(q,Y);if(s.style.maxHeight=`${J}px`,t.maxHeight){let w=parseInt(t.maxHeight,10);if(!isNaN(w)&&w<parseInt(s.style.maxHeight||"0",10))s.style.maxHeight=t.maxHeight}}else if(t.maxHeight)s.style.maxHeight=t.maxHeight;if(t.width==="100%"&&!l)s.style.width=`${c.width}px`;let U=Math.max(A+f,v),H=Math.max(16+u,E);if(s.style.top=`${U}px`,s.style.left=`${H}px`,H-u+m.width>p-16)s.style.left="auto",s.style.right="16px"};return{positionMenu:(s)=>{if(!s||!e.element)return;n(e.element,s,t.position,!1)},positionSubmenu:(s,a,o=1)=>{if(!s||!a)return;let l=o%2===1?"right-start":"left-start";s.style.zIndex=`${1000+o*10}`,n(s,a,l,!0)},positionElement:n}},bg=(e)=>(t)=>{if(!t.element)return t;let n=Eg(t,e);return{...t,position:n}},Qi=bg;var vg=(e)=>{let t=!1,n="",r=null,i=500;(()=>{document.addEventListener("keydown",(c)=>{t=c.key==="Tab",setTimeout(()=>{t=!1},100)})})();let a=()=>{let C=document.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])');return Array.from(C).filter((g)=>g.offsetParent!==null&&!g.classList.contains("hidden"))},o=()=>{if(n="",r)clearTimeout(r),r=null},l=(c,C)=>{if(o(),C==="keyboard"){let g=Array.from(c.querySelectorAll(`.${e.getClass("menu-item")}:not(.${e.getClass("menu-item--disabled")})`));if(g.length>0)g[0].setAttribute("tabindex","0"),g[0].focus();else c.setAttribute("tabindex","0"),c.focus()}else{c.setAttribute("tabindex","-1");let g=c.querySelector(`.${e.getClass("menu-item")}:not(.${e.getClass("menu-item--disabled")})`);if(g)g.setAttribute("tabindex","0")}},d=(c,C,g)=>{let m=C.activeSubmenu&&C.activeSubmenu.contains(c.target),p=m?C.activeSubmenu:e.element,h=Array.from(p.querySelectorAll(`.${e.getClass("menu-item")}:not(.${e.getClass("menu-item--disabled")})`));if(h.length===0)return;let b=document.activeElement,v=-1;if(b&&h.includes(b))v=h.indexOf(b);let E=(T)=>{if(h[T])h[T].focus()};if(c.key.length===1&&!c.ctrlKey&&!c.metaKey&&!c.altKey){if(c.preventDefault(),c.stopPropagation(),n+=c.key.toLowerCase(),r)clearTimeout(r);r=setTimeout(()=>{n="",r=null},i);let T=h.findIndex((S)=>(S.querySelector(`.${e.getClass("menu-item-text")}`)?.textContent?.toLowerCase()||"").startsWith(n));if(T!==-1)E(T);else if(n.length>1){let S=n.slice(-1),y=h.findIndex((L)=>(L.querySelector(`.${e.getClass("menu-item-text")}`)?.textContent?.toLowerCase()||"").startsWith(S));if(y!==-1)n=S,E(y)}return}switch(c.key){case"ArrowDown":case"Down":if(c.preventDefault(),c.stopPropagation(),v<0)E(0);else if(v<h.length-1)E(v+1);else E(0);break;case"ArrowUp":case"Up":if(c.preventDefault(),c.stopPropagation(),v<0)E(h.length-1);else if(v>0)E(v-1);else E(h.length-1);break;case"Home":c.preventDefault(),c.stopPropagation(),E(0);break;case"End":c.preventDefault(),c.stopPropagation(),E(h.length-1);break;case"Enter":case" ":if(c.preventDefault(),c.stopPropagation(),v>=0)h[v].click();break;case"ArrowRight":case"Right":if(c.preventDefault(),c.stopPropagation(),m){if(v>=0&&h[v].classList.contains(`${e.getClass("menu-item--submenu")}`)){let S=h[v],y=parseInt(S.getAttribute("data-index"),10),I=S.closest(`.${e.getClass("menu--submenu")}`)?.getAttribute("data-parent-item"),x=g.findItemById(I);if(x&&x.submenu){let A=x.submenu[y];g.handleNestedSubmenuClick(A,y,S)}}}else if(v>=0&&h[v].classList.contains(`${e.getClass("menu-item--submenu")}`)){let S=h[v],y=parseInt(S.getAttribute("data-index"),10),L=C.items[y];g.handleSubmenuClick(L,y,S)}break;case"ArrowLeft":case"Left":if(c.preventDefault(),c.stopPropagation(),m)if(C.activeSubmenuItem){let S=C.activeSubmenuItem,y=parseInt(p.getAttribute("data-level")||"1",10);if(g.closeSubmenu(y),S)S.focus()}else g.closeSubmenu(1);break;case"Escape":if(c.preventDefault(),c.stopPropagation(),m)if(C.activeSubmenuItem){let S=C.activeSubmenuItem,y=parseInt(p.getAttribute("data-level")||"1",10);if(g.closeSubmenu(y),S)S.focus()}else g.closeSubmenu(1);else g.closeMenu(c,!0);break;case"Tab":if(n="",r)clearTimeout(r),r=null;c.preventDefault();let T=e.opener?.getOpener?.();if(g.closeMenu(c,!0),T)setTimeout(()=>{if(c.shiftKey);else{let S=a(),y=S.indexOf(T);if(y>=0&&y<S.length-1)S[y+1].focus()}},0);break}};return{handleInitialFocus:l,handleMenuKeydown:d,setupKeyboardHandlers:(c,C,g)=>{let m=c.querySelectorAll(`.${e.getClass("menu-item")}:not(.${e.getClass("menu-item--disabled")})`);if(m.forEach((p)=>{p.tabIndex=-1}),m.length>0)m[0].tabIndex=0;c.addEventListener("keydown",(p)=>d(p,C,g))},isTabNavigationActive:()=>t,getFocusableElements:a,resetTypeahead:o}},Tg=()=>(e)=>{if(!e.element)return e;let t=vg(e);return{...e,keyboard:t}},Ji=Tg;var Sg=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize menu submenu: missing element"),t;let n={activeSubmenu:null,activeSubmenuItem:null,submenuLevel:0,activeSubmenus:[],submenuTimer:null,hoverIntent:{timer:null,activeItem:null},component:t},r=()=>{if(n.hoverIntent.timer)clearTimeout(n.hoverIntent.timer),n.hoverIntent.timer=null,n.hoverIntent.activeItem=null},i=()=>{if(n.submenuTimer)clearTimeout(n.submenuTimer),n.submenuTimer=null},s=(b,v,E)=>{if(!e.openSubmenuOnHover||!b.hasSubmenu)return;r(),i(),n.hoverIntent.activeItem=E,n.hoverIntent.timer=setTimeout(()=>{if(E.matches(":hover")){if(n.activeSubmenuItem!==E)d(b,v,E)}n.hoverIntent.timer=null},100)},a=()=>{r(),i(),n.submenuTimer=setTimeout(()=>{let{activeSubmenu:b,activeSubmenuItem:v}=n;if(b&&v){let E=b.matches(":hover"),T=v.matches(":hover");if(!E&&!T)u(n.submenuLevel)}n.submenuTimer=null},300)},o=(b,v,E)=>{if(!b.submenu||!b.hasSubmenu)return;let T=E.getAttribute("aria-expanded")==="true";if(n.activeSubmenus.some((y)=>y.isOpening))return;if(T){let y=parseInt(E.closest(`.${t.getClass("menu--submenu")}`)?.getAttribute("data-level")||"0",10);u(y+1),E.setAttribute("aria-expanded","false")}else d(b,v,E)},l=(b,v,E)=>{if(!b.submenu||!b.hasSubmenu)return;let T=E.getAttribute("aria-expanded")==="true";if(n.activeSubmenus.some((y)=>y.isOpening))return;if(T){let y=parseInt(E.closest(`.${t.getClass("menu--submenu")}`)?.getAttribute("data-level")||"1",10);u(y+1)}else d(b,v,E)},d=(b,v,E)=>{if(!b.submenu||!b.hasSubmenu)return;let T=E.closest(`.${t.getClass("menu--submenu")}`)?parseInt(E.closest(`.${t.getClass("menu--submenu")}`).getAttribute("data-level")||"0",10)+1:1;if(u(T),n.activeSubmenus.findIndex((x)=>x.menuItem===E&&x.isOpening)>=0)return;E.setAttribute("aria-expanded","true");let y=document.createElement("div");y.className=`${t.getClass("menu")} ${t.getClass("menu--submenu")}`,y.setAttribute("role","menu"),y.setAttribute("tabindex","-1"),y.setAttribute("data-level",T.toString()),y.setAttribute("data-parent-item",b.id),y.style.zIndex=`${1000+T*10}`;let L=document.createElement("ul");L.className=`${t.getClass("menu-list")}`;let I=[];if(t.emit("create-menu-items",{items:b.submenu,container:L,level:T,onItemCreated:(x)=>{if(!x.classList.contains(`${t.getClass("menu-item--disabled")}`))I.push(x)}}),y.appendChild(L),document.body.appendChild(y),t.position&&t.position.positionSubmenu)t.position.positionSubmenu(y,E,T);if(t.keyboard&&t.keyboard.setupKeyboardHandlers)t.keyboard.setupKeyboardHandlers(y,{activeSubmenus:n.activeSubmenus},{closeSubmenu:u,handleNestedSubmenuClick:l});y.addEventListener("mouseenter",()=>{i()}),y.addEventListener("mouseleave",()=>{a()}),n.activeSubmenu=y,n.activeSubmenuItem=E,n.activeSubmenus.push({element:y,menuItem:E,level:T,isOpening:!0}),n.submenuLevel=T,document.addEventListener("click",c),window.addEventListener("resize",C,{passive:!0}),window.addEventListener("scroll",g,{passive:!0}),requestAnimationFrame(()=>{y.classList.add(`${t.getClass("menu--visible")}`),setTimeout(()=>{let x=n.activeSubmenus.findIndex((A)=>A.element===y);if(x!==-1)n.activeSubmenus[x].isOpening=!1;if(I.length>0){if(T>=2||document.activeElement===E)I[0].setAttribute("tabindex","0"),I[0].focus()}},300)}),t.emit("submenu-opened",{submenuElement:y,parentItem:E,level:T,item:b})},u=(b)=>{r(),i();let v=[];for(let E=n.activeSubmenus.length-1;E>=0;E--)if(n.activeSubmenus[E].level>=b){let T=n.activeSubmenus[E];if(T.menuItem)T.menuItem.setAttribute("aria-expanded","false");T.element.classList.remove(`${t.getClass("menu--visible")}`),setTimeout(()=>{if(T.element.parentNode)T.element.parentNode.removeChild(T.element)},200),v.push(E)}if(v.forEach((E)=>{n.activeSubmenus.splice(E,1)}),n.activeSubmenus.length>0){let E=n.activeSubmenus[n.activeSubmenus.length-1];if(n.activeSubmenu=E.element,n.activeSubmenuItem=E.menuItem,n.submenuLevel=E.level,E.menuItem)E.menuItem.focus()}else n.activeSubmenu=null,n.activeSubmenuItem=null,n.submenuLevel=0;t.emit("submenu-closed",{level:b})},f=()=>{if(r(),i(),n.activeSubmenus.length===0)return;[...n.activeSubmenus].forEach((b)=>{if(b.menuItem)b.menuItem.setAttribute("aria-expanded","false");b.element.classList.remove(`${t.getClass("menu--visible")}`),setTimeout(()=>{if(b.element.parentNode)b.element.parentNode.removeChild(b.element)},200)}),n.activeSubmenu=null,n.activeSubmenuItem=null,n.activeSubmenus=[],n.submenuLevel=0,document.removeEventListener("click",c),window.removeEventListener("resize",C),window.removeEventListener("scroll",g),t.emit("all-submenus-closed",{})},c=(b)=>{if(!n.activeSubmenu)return;let{activeSubmenu:v,activeSubmenuItem:E}=n;if(v.contains(b.target)||E&&E.contains(b.target))return;f()},C=()=>{if(n.activeSubmenu&&n.activeSubmenuItem&&t.position)t.position.positionSubmenu(n.activeSubmenu,n.activeSubmenuItem,n.submenuLevel)},g=()=>{window.requestAnimationFrame(()=>{if(n.activeSubmenu&&n.activeSubmenuItem&&t.position)t.position.positionSubmenu(n.activeSubmenu,n.activeSubmenuItem,n.submenuLevel)})},m=()=>n.activeSubmenus.length>0,p=()=>n.submenuLevel,h=()=>[...n.activeSubmenus];if(t.lifecycle){let b=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{if(r(),i(),document.removeEventListener("click",c),window.removeEventListener("resize",C),window.removeEventListener("scroll",g),n.activeSubmenus.length>0)n.activeSubmenus.forEach((v)=>{if(v.element.parentNode)v.element.parentNode.removeChild(v.element)});b()}}return t.on("menu-closing",()=>{f()}),{...t,submenu:{openSubmenu:d,closeSubmenu:u,closeAllSubmenus:f,handleSubmenuClick:o,handleNestedSubmenuClick:l,handleSubmenuHover:s,handleSubmenuLeave:a,hasOpenSubmenu:m,getSubmenuLevel:p,getActiveSubmenus:h}}},es=Sg;var uu=({menu:e,opener:t,events:n,lifecycle:r})=>(i)=>({element:i.element,open(a,o="mouse"){if(a&&!o){if(a instanceof KeyboardEvent)o="keyboard"}return e.open(a,o),this},close(a,o=!0,l=!1){return e.close(a,o,l),this},toggle(a,o){if(a&&!o){if(a instanceof KeyboardEvent)o="keyboard";else if(a instanceof MouseEvent)o="mouse"}return e.toggle(a,o),this},isOpen(){return e.isOpen()},setItems(a){return e.setItems(a),this},getItems(){return e.getItems()},setOpener(a){return t.setOpener(a),this},getOpener(){return t.getOpener()},setPosition(a){return e.setPosition(a),this},getPosition(){return e.getPosition()},setSelected(a){return e.setSelected(a),this},getSelected(){return e.getSelected()},on(a,o){if(n?.on)n.on(a,o);else if(i.on)i.on(a,o);return this},off(a,o){if(n?.off)n.off(a,o);else if(i.off)i.off(a,o);return this},destroy(){r.destroy()}});ne();var yg={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"},It={POSITION:yg.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};var cu={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",DENSE:"menu--dense"};var xg={items:[],position:It.POSITION,closeOnSelect:It.CLOSE_ON_SELECT,closeOnClickOutside:It.CLOSE_ON_CLICK_OUTSIDE,closeOnEscape:It.CLOSE_ON_ESCAPE,openSubmenuOnHover:It.OPEN_SUBMENU_ON_HOVER,offset:It.OFFSET,autoFlip:It.AUTO_FLIP,visible:!1},mu=(e)=>{if(!e.opener)throw Error("Menu component requires an opener element or selector");return _(xg,e,"menu")},fu=(e)=>{let t={};if(e.width)t.width=e.width;if(e.maxHeight)t.maxHeight=e.maxHeight;let n={role:"menu",tabindex:"-1","aria-hidden":(!e.visible).toString(),style:Object.entries(t).map(([r,i])=>`${r}: ${i}`).join(";")};return V(e,{tag:"div",attributes:n,className:[e.visible?cu.VISIBLE:null,e.dense?`${e.prefix}-menu--dense`:null,e.class].filter(Boolean),forwardEvents:{keydown:!0}})},gu=(e)=>({menu:{open:(t,n)=>e.menu?.open(t,n),close:(t,n,r)=>e.menu?.close(t,n,r),toggle:(t,n)=>e.menu?.toggle(t,n),isOpen:()=>e.menu?.isOpen()||!1,setItems:(t)=>e.menu?.setItems(t),getItems:()=>e.menu?.getItems()||[],setPosition:(t)=>e.menu?.setPosition(t),getPosition:()=>e.menu?.getPosition(),setSelected:(t)=>e.menu?.setSelected(t),getSelected:()=>e.menu?.getSelected()},opener:{setOpener:(t)=>e.opener?.setOpener(t),getOpener:()=>e.opener?.getOpener()},submenu:{hasOpenSubmenu:()=>e.submenu?.hasOpenSubmenu()||!1,closeAllSubmenus:()=>e.submenu?.closeAllSubmenus()},events:{on:(t,n)=>e.on?.(t,n),off:(t,n)=>e.off?.(t,n)},lifecycle:{destroy:()=>e.lifecycle?.destroy()}});var Ig=(e)=>{try{let t=mu(e),n=M(D,k(),O(fu(t)),Qi(t),Ji(),es(t),ji(t),Zi(t),P(),(r)=>uu(gu(r))(r))(t);if(t.on&&typeof n.on==="function")Object.entries(t.on).forEach(([r,i])=>{if(typeof i==="function")n.on(r,i)});return n}catch(t){throw console.error("Menu creation error:",t),Error(`Failed to create menu: ${t.message}`)}},Un=Ig;se();te();re();var pu=(e)=>(t)=>({...t,element:t.element,items:t.items||new Map,addItem(r){if(typeof t.addItem==="function")t.addItem(r);return this},removeItem(r){if(typeof t.removeItem==="function")t.removeItem(r);return this},getItem(r){if(typeof t.getItem==="function")return t.getItem(r);return this.items.get(r)},getAllItems(){if(typeof t.getAllItems==="function")return t.getAllItems();return Array.from(this.items.values())},getActive(){if(typeof t.getActive==="function")return t.getActive();return null},getItemPath(r){if(typeof t.getItemPath==="function")return t.getItemPath(r);return[]},setActive(r){if(typeof t.handleItemClick==="function")t.handleItemClick(r);else if(typeof t.setActive==="function")t.setActive(r);else{let i=this.items.get(r);if(i&&i.element){if(t.emit)t.emit("change",{id:r,item:i,source:"api"})}}return this},enable(){if(e.disabled.enable)e.disabled.enable();return this},disable(){if(e.disabled.disable)e.disabled.disable();return this},expand(){if(this.element.classList.remove(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","false"),t.emit)t.emit("expanded",{source:"api"});return this},collapse(){if(this.element.classList.add(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","true"),t.emit)t.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(r,i){if(t.on)t.on(r,i);return this},off(r,i){if(t.off)t.off(r,i);return this},destroy(){if(e.lifecycle.destroy)e.lifecycle.destroy()}});var Lg={RAIL:"rail",DRAWER:"drawer",BAR:"bar",MODAL:"modal",STANDARD:"standard"},Ag={LEFT:"left",RIGHT:"right",TOP:"top",BOTTOM:"bottom"},wg={FIXED:"fixed",DISMISSIBLE:"dismissible",MODAL:"modal"};var hu={CHANGE:"change",EXPAND:"expand",COLLAPSE:"collapse",GROUP_EXPAND:"group:expand",GROUP_COLLAPSE:"group:collapse"},un={VARIANT:Lg.STANDARD,POSITION:Ag.LEFT,BEHAVIOR:wg.FIXED,EXPANDED:!1,SHOW_LABELS:!0,SCRIM_ENABLED:!0},le={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 Ng=(e)=>{let t=document.createElement("span");return t.className=`${e}-${le.EXPAND_ICON}`,t.innerHTML=`
|
|
18
|
+
`,b.addEventListener("click",(v)=>{if(v.preventDefault(),v.stopPropagation(),t&&t.emit)t.emit("dialog:close",{source:"closeButton"})}),p.appendChild(b)}return p},s=()=>{let p=document.createElement("div");if(p.classList.add(t.getClass("dialog-content")),e.content)p.innerHTML=e.content;return p},a=()=>{let p=document.createElement("div");p.classList.add(t.getClass("dialog-footer"));let h=e.footerAlignment||"right";if(h!=="right")ee(p,`${t.getClass("dialog-footer")}--${h}`);if(Array.isArray(e.buttons)&&e.buttons.length>0)e.buttons.forEach((b)=>Bd(p,b,t));return p},o=()=>Vt({variant:"full-width",class:t.getClass("dialog-divider")}),l=i(),d=s(),u=Array.isArray(e.buttons)&&e.buttons.length>0?a():null;ee(t.element,t.getClass("dialog"));let f=e.size||"medium";if(f!=="medium")ee(t.element,`${t.getClass("dialog")}--${f}`);let c=e.animation||"scale";if(c!=="scale")ee(t.element,`${t.getClass("dialog")}--${c}`);t.element.appendChild(l);let C=null,g=null;if(e.divider){if(C=o(),C.element.classList.add(t.getClass("dialog-header-divider")),t.element.appendChild(C.element),u)g=o(),g.element.classList.add(t.getClass("dialog-footer-divider"))}if(t.element.appendChild(d),g)t.element.appendChild(g.element);if(u)t.element.appendChild(u);r.appendChild(t.element);let m=e.container||document.body;return m.appendChild(r),{...t,overlay:r,structure:{header:l,content:d,footer:u,headerDivider:C,footerDivider:g,container:m}}},kd=()=>(e)=>({...e,divider:{toggleDivider(t){if(t&&!e.structure.headerDivider){let n=Vt({variant:"full-width",class:`${e.getClass("dialog-divider")} ${e.getClass("dialog-header-divider")}`});if(e.element.insertBefore(n.element,e.structure.content),e.structure.headerDivider=n,e.structure.footer&&!e.structure.footerDivider){let r=Vt({variant:"full-width",class:`${e.getClass("dialog-divider")} ${e.getClass("dialog-footer-divider")}`});e.element.insertBefore(r.element,e.structure.footer),e.structure.footerDivider=r}}else if(!t){if(e.structure.headerDivider)e.structure.headerDivider.element.remove(),e.structure.headerDivider=null;if(e.structure.footerDivider)e.structure.footerDivider.element.remove(),e.structure.footerDivider=null}return e},hasDivider(){return e.structure.headerDivider!==null}}}),Bd=(e,t,n)=>{let{text:r,variant:i="text",onClick:s,closeDialog:a=!0,autofocus:o=!1,attributes:l={}}=t,d=He({text:r,variant:i,...l});if(d.on("click",(u)=>{let f=a;if(typeof s==="function")try{if(s(u,n)===!1)f=!1}catch(c){console.error("Error in onClick handler:",c)}if(f){if(n&&n.emit)n.emit("dialog:close",{source:"button",text:r})}}),o)d.element.setAttribute("autofocus","true");if(e.appendChild(d.element),!n._buttons)n._buttons=[];n._buttons.push({config:t,instance:d})},Hd=()=>(e)=>{let t=e.config.open===!0,n=e.config.animationDuration||150,r='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',i=null,s=!1,a=()=>{if(!e.config.trapFocus)return;let g=e.element.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(g.length===0)return;let m=g[0],p=g[g.length-1];if(e.config.autofocus){let b=e.element.querySelector("[autofocus]");if(b)b.focus();else m.focus()}e.element.addEventListener("keydown",h);function h(b){if(b.key!=="Tab")return;if(b.shiftKey){if(document.activeElement===m)p.focus(),b.preventDefault()}else if(document.activeElement===p)m.focus(),b.preventDefault()}},o=()=>{if(!e.config.trapFocus)return;if(e.element.removeEventListener("keydown",g),i)i.focus(),i=null;function g(){}},l=()=>{if(e.config.closeOnOverlayClick!==!1)e.overlay.addEventListener("mousedown",u),document.addEventListener("mouseup",f);if(e.config.closeOnEscape!==!1)document.addEventListener("keydown",c)},d=()=>{e.overlay.removeEventListener("mousedown",u),document.removeEventListener("mouseup",f),document.removeEventListener("keydown",c)};function u(g){s=g.target===e.overlay}function f(g){if(s&&g.target===e.overlay)C.close();s=!1}function c(g){if(g.key==="Escape"&&C.isOpen())C.close()}if(t)ee(e.overlay,`${e.getClass("dialog-overlay")}--visible`),ee(e.element,`${e.getClass("dialog")}--visible`),a(),l();let C={open(){if(this.isOpen())return;i=document.activeElement;let g={dialog:e,defaultPrevented:!1,preventDefault:()=>{g.defaultPrevented=!0}};if(typeof e.emit==="function")e.emit(on.BEFORE_OPEN,g);if(g.defaultPrevented)return;if(e.overlay&&!e.overlay.parentNode)(e.structure.container||document.body).appendChild(e.overlay);ee(e.overlay,`${e.getClass("dialog-overlay")}--visible`),setTimeout(()=>{if(ee(e.element,`${e.getClass("dialog")}--visible`),a(),l(),typeof e.emit==="function")e.emit(on.OPEN,{dialog:e}),setTimeout(()=>{e.emit(on.AFTER_OPEN,{dialog:e})},n)},10)},close(){let g={dialog:e,defaultPrevented:!1,preventDefault:()=>{g.defaultPrevented=!0}};if(typeof e.emit==="function")e.emit(on.BEFORE_CLOSE,g);if(g.defaultPrevented){console.log("Dialog close prevented by event handler");return}let m=`${e.getClass("dialog")}--visible`,p=`${e.getClass("dialog-overlay")}--visible`;if(Ce(e.element,m),Ce(e.overlay,p),o(),d(),typeof e.emit==="function")e.emit(on.CLOSE,{dialog:e});setTimeout(()=>{if(e.overlay&&e.overlay.parentNode)e.overlay.parentNode.removeChild(e.overlay);if(typeof e.emit==="function")e.emit(on.AFTER_CLOSE,{dialog:e})},n)},toggle(g){if(g===void 0)this.isOpen()?this.close():this.open();else if(g)this.open();else this.close()},isOpen(){return e.element.classList.contains(`${e.getClass("dialog")}--visible`)}};if(e&&e.on)e.on("dialog:close",()=>{C.close()});return{...e,visibility:C}},$d=()=>(e)=>{let t=e.structure.header,n=e.structure.content,r=e.structure.footer;return{...e,content:{setTitle(i){let s=t.querySelector(`.${e.getClass("dialog-header-title")}`);if(!s&&i)s=document.createElement("h2"),s.classList.add(e.getClass("dialog-header-title")),t.querySelector(`.${e.getClass("dialog-header-content")}`).appendChild(s);if(s)s.textContent=i},getTitle(){let i=t.querySelector(`.${e.getClass("dialog-header-title")}`);return i?i.textContent||"":""},setSubtitle(i){let s=t.querySelector(`.${e.getClass("dialog-header-subtitle")}`);if(!s&&i)s=document.createElement("p"),s.classList.add(e.getClass("dialog-header-subtitle")),t.querySelector(`.${e.getClass("dialog-header-content")}`).appendChild(s);if(s)s.textContent=i},getSubtitle(){let i=t.querySelector(`.${e.getClass("dialog-header-subtitle")}`);return i?i.textContent||"":""},setContent(i){n.innerHTML=i},getContent(){return n.innerHTML},getHeaderElement(){return t},getContentElement(){return n},getFooterElement(){return r}}}},Vd=()=>(e)=>{if(!e._buttons)e._buttons=[];return{...e,buttons:{addButton(t){let n=e.structure.footer;if(!n){n=document.createElement("div"),n.classList.add(e.getClass("dialog-footer"));let r=e.config.footerAlignment||"right";if(r!=="right")ee(n,`${e.getClass("dialog-footer")}--${r}`);e.element.appendChild(n),e.structure.footer=n}Bd(n,t,e)},removeButton(t){if(typeof t==="number"){if(t>=0&&t<e._buttons.length)e._buttons[t].instance.destroy(),e._buttons.splice(t,1)}else{let n=e._buttons.findIndex((r)=>r.config.text===t);if(n!==-1)e._buttons[n].instance.destroy(),e._buttons.splice(n,1)}if(e._buttons.length===0&&e.structure.footer)e.element.removeChild(e.structure.footer),e.structure.footer=null},getButtons(){return e._buttons.map((t)=>t.config)},setFooterAlignment(t){if(!e.structure.footer)return;if(["right","left","center","space-between"].forEach((r)=>{if(r!=="right")Ce(e.structure.footer,`${e.getClass("dialog-footer")}--${r}`)}),t!=="right")ee(e.structure.footer,`${e.getClass("dialog-footer")}--${t}`)}}}},Fd=()=>(e)=>({...e,size:{setSize(t){if(["small","medium","large","fullwidth","fullscreen"].forEach((r)=>{Ce(e.element,`${e.getClass("dialog")}--${r}`)}),t!=="medium")ee(e.element,`${e.getClass("dialog")}--${t}`)}}}),Ud=()=>(e)=>({...e,confirm(t){return new Promise((n)=>{let{title:r="Confirm",message:i,confirmText:s="Yes",cancelText:a="No",confirmVariant:o="filled",cancelVariant:l="text",size:d="small"}=t;e.content.setTitle(r),e.content.setContent(`<p>${i}</p>`),e.size.setSize(d),e._buttons.forEach((u)=>u.instance.destroy()),e._buttons=[],e.buttons.addButton({text:s,variant:o,onClick:()=>{n(!0)}}),e.buttons.addButton({text:a,variant:l,onClick:()=>{n(!1)}}),e.visibility.open()})}});yn();var Gd=(e)=>(t)=>({...t,open(){return e.visibility.open(),this},close(){return e.visibility.close(),this},toggle(n){return e.visibility.toggle(n),this},isOpen(){return e.visibility.isOpen()},setTitle(n){return e.content.setTitle(n),this},getTitle(){return e.content.getTitle()},setSubtitle(n){return e.content.setSubtitle(n),this},getSubtitle(){return e.content.getSubtitle()},setContent(n){return e.content.setContent(n),this},getContent(){return e.content.getContent()},addButton(n){return e.buttons.addButton(n),this},removeButton(n){return e.buttons.removeButton(n),this},getButtons(){return e.buttons.getButtons()},setFooterAlignment(n){return e.buttons.setFooterAlignment(n),this},toggleDivider(n){return e.divider.toggleDivider(n),this},hasDivider(){return e.divider.hasDivider()},setSize(n){return e.size.setSize(n),this},on(n,r){return e.events.on(n,r),this},off(n,r){return e.events.off(n,r),this},getHeaderElement(){return e.content.getHeaderElement()},getContentElement(){return e.content.getContentElement()},getFooterElement(){return e.content.getFooterElement()},confirm(n){if(t.confirm)return t.confirm(n||{message:"Are you sure?"});return Promise.resolve(!1)},destroy(){if(this.isOpen()){let n=`${t.getClass("dialog")}--visible`,r=`${t.getClass("dialog-overlay")}--visible`;if(Ce(t.element,n),Ce(t.overlay,r),e.focus&&e.focus.releaseFocus)e.focus.releaseFocus()}if(e.lifecycle.destroy(),t.overlay&&t.overlay.parentNode)t.overlay.parentNode.removeChild(t.overlay)},element:t.element,overlay:t.overlay});var Qf=(e={})=>{let t=Ad(e);try{let n=M(D,k(),O(wd(t)),Pd(t),Hd(),$d(),Vd(),Fd(),kd(),Ud(),P(),(r)=>Gd(Dd(r))(r))(t);if(t.on)Object.entries(t.on).forEach(([r,i])=>{if(typeof i==="function")n.on(r,i)});return n}catch(n){throw console.error("Dialog creation error:",n),Error(`Failed to create dialog: ${n.message}`)}},Ui=Qf;se();te();re();var Jf={STANDARD:"standard",MODAL:"modal"},eg={START:"start",END:"end"};var Hn={OPEN:"open",CLOSE:"close",SELECT:"select"};var yt={VARIANT:Jf.STANDARD,POSITION:eg.START,OPEN:!1,DISMISSIBLE:!0,WIDTH:360};var tg=(e,t)=>{let n=document.createElement("button");if(n.className=t("drawer__item"),n.setAttribute("role","tab"),n.setAttribute("tabindex","-1"),e.id)n.dataset.id=e.id;if(e.disabled)n.disabled=!0,n.setAttribute("aria-disabled","true");let r=document.createElement("span");if(r.className=t("drawer__active-indicator"),n.appendChild(r),e.icon){let i=document.createElement("span");i.className=t("drawer__item-icon"),i.innerHTML=e.icon,n.appendChild(i)}if(e.label){let i=document.createElement("span");i.className=t("drawer__item-label"),i.textContent=e.label,n.appendChild(i)}if(e.badge){let i=document.createElement("span");i.className=t("drawer__item-badge"),i.textContent=e.badge,n.appendChild(i)}if(e.active)n.classList.add(`${t("drawer__item")}--active`),n.setAttribute("aria-selected","true"),n.setAttribute("tabindex","0");else n.setAttribute("aria-selected","false");return n},ng=(e)=>{let t=document.createElement("hr");return t.className=e("drawer__divider"),t.setAttribute("role","separator"),t},rg=(e,t)=>{let n=document.createElement("div");return n.className=t("drawer__section-label"),n.textContent=e.label||e.sectionLabel||"",n},Gi=(e)=>(t)=>{let n=e.items||[],r=null,i=null,s=n.find((C)=>C.type!=="divider"&&C.type!=="section"&&C.active);if(s?.id)r=s.id;let a=()=>{if(!i)return;i.innerHTML="";let C=0;if(n.forEach((g)=>{let m=g.type||"item";if(m==="divider"){i.appendChild(ng(t.getClass));return}if(m==="section"){i.appendChild(rg(g,t.getClass));return}let p=tg(g,t.getClass);p.dataset.navIndex=String(C),C++,p.addEventListener("click",(h)=>{if(g.id&&!g.disabled){o(g.id);let b={id:g.id,label:g.label||"",index:parseInt(p.dataset.navIndex||"0",10),originalEvent:h};if(t.emit(Hn.SELECT,b),e.onSelect)e.onSelect(b)}}),i.appendChild(p)}),!r){let g=i.querySelector(`.${t.getClass("drawer__item")}`);if(g)g.setAttribute("tabindex","0")}},o=(C)=>{if(!i)return;let g=`${t.getClass("drawer__item")}--active`;if(i.querySelectorAll(`.${t.getClass("drawer__item")}`).forEach((p)=>{p.classList.remove(g),p.setAttribute("aria-selected","false"),p.setAttribute("tabindex","-1")}),!C){r=null;let p=i.querySelector(`.${t.getClass("drawer__item")}`);if(p)p.setAttribute("tabindex","0")}else{let p=i.querySelector(`[data-id="${C}"]`);if(p)p.classList.add(g),p.setAttribute("aria-selected","true"),p.setAttribute("tabindex","0"),r=C}n=n.map((p)=>({...p,active:p.id===C}))},l=()=>r,d=(C)=>{n=C,r=C.find((m)=>m.type!=="divider"&&m.type!=="section"&&m.active)?.id||null,a()},u=()=>n,f=(C,g)=>{if(!i)return;let m=i.querySelector(`[data-id="${C}"]`);if(!m)return;let p=m.querySelector(`.${t.getClass("drawer__item-badge")}`);if(g){if(!p)p=document.createElement("span"),p.className=t.getClass("drawer__item-badge"),m.appendChild(p);p.textContent=g}else if(p)p.remove();n=n.map((h)=>h.id===C?{...h,badge:g}:h)},c=(C)=>{if(!i)return;let g=Array.from(i.querySelectorAll(`.${t.getClass("drawer__item")}:not([disabled])`));if(!g.length)return;let m=g.indexOf(document.activeElement),p=-1;switch(C.key){case"ArrowDown":C.preventDefault(),p=m<g.length-1?m+1:0;break;case"ArrowUp":C.preventDefault(),p=m>0?m-1:g.length-1;break;case"Home":C.preventDefault(),p=0;break;case"End":C.preventDefault(),p=g.length-1;break;case"Enter":case" ":if(C.preventDefault(),m>=0)g[m].click();return;default:return}if(p>=0&&p<g.length)g.forEach((h)=>h.setAttribute("tabindex","-1")),g[p].setAttribute("tabindex","0"),g[p].focus()};return i=document.createElement("div"),i.className=t.getClass("drawer__items"),i.setAttribute("role","tablist"),i.setAttribute("aria-orientation","vertical"),i.addEventListener("keydown",c),a(),{...t,itemsContainer:i,drawerItems:{setActive:o,getActive:l,setItems:d,getItems:u,setBadge:f,renderItems:a}}};var zi=(e)=>(t)=>{let n=e.variant==="modal",r=e.dismissible!==!1,i=e.open===!0,s=null;if(n){if(s=document.createElement("div"),s.className=t.getClass("drawer__scrim"),r)s.addEventListener("click",()=>{l()})}let a=(u)=>{if(u.key==="Escape"&&i&&n&&r)u.preventDefault(),l()};if(n)document.addEventListener("keydown",a);function o(){if(i)return;if(i=!0,t.element.classList.add(`${t.getClass("drawer")}--open`),n&&s)s.classList.add(`${t.getClass("drawer__scrim")}--visible`),document.body.style.overflow="hidden";if(requestAnimationFrame(()=>{let u=t.element.querySelector(`.${t.getClass("drawer__item")}[tabindex="0"]`);if(u)u.focus();else t.element.focus()}),t.emit(Hn.OPEN),e.onOpen)e.onOpen()}function l(){if(!i)return;if(i=!1,t.element.classList.remove(`${t.getClass("drawer")}--open`),n&&s)s.classList.remove(`${t.getClass("drawer__scrim")}--visible`),document.body.style.overflow="";if(t.emit(Hn.CLOSE),e.onClose)e.onClose()}function d(){if(i)l();else o()}if(i){if(t.element.classList.add(`${t.getClass("drawer")}--open`),n&&s)s.classList.add(`${t.getClass("drawer__scrim")}--visible`)}return{...t,scrimElement:s,drawerState:{open:o,close:l,toggle:d,isOpen:()=>i},_stateCleanup:()=>{if(n){if(document.removeEventListener("keydown",a),s&&s.parentNode)s.parentNode.removeChild(s);document.body.style.overflow=""}}}};var Wi=(e)=>(t)=>{let n=null,r=e.headline||"";if(r)n=document.createElement("div"),n.className=t.getClass("drawer__headline"),n.textContent=r;return{...t,headlineElement:n,drawerHeadline:{setHeadline:(a)=>{if(r=a,a){if(!n)n=document.createElement("div"),n.className=t.getClass("drawer__headline");n.textContent=a}else if(n&&n.parentNode)n.parentNode.removeChild(n),n=null},getHeadline:()=>r,getElement:()=>n}}};tn();var zd=({state:e,items:t,headline:n,lifecycle:r})=>(i)=>{let s={element:i.element,getClass:i.getClass,lifecycle:r,on(a,o){if(i.on)i.on(a,o);return s},off(a,o){if(i.off)i.off(a,o);return s},addClass(...a){if(i.addClass)i.addClass(...a);else ee(i.element,...a);return s},open(){return e.open(),s},close(){return e.close(),s},toggle(){return e.toggle(),s},isOpen(){return e.isOpen()},setActive(a){return t.setActive(a),s},getActive(){return t.getActive()},setItems(a){return t.setItems(a),s},getItems(){return t.getItems()||[]},setBadge(a,o){return t.setBadge(a,o),s},setHeadline(a){return n.setHeadline(a),s},getHeadline(){return n.getHeadline()},destroy(){r.destroy()}};return s};ne();var ig={variant:yt.VARIANT,position:yt.POSITION,open:yt.OPEN,dismissible:yt.DISMISSIBLE,width:yt.WIDTH,items:[]},Wd=(e={})=>_(ig,e,"drawer"),Kd=(e)=>{let t=e.variant==="modal",n={};if(t)n.role="dialog",n["aria-modal"]="true";else n.role="navigation";if(e.ariaLabel)n["aria-label"]=e.ariaLabel;return V(e,{tag:"aside",attributes:n,className:[e.dense?`${e.prefix}-drawer--dense`:null,e.class].filter(Boolean),forwardEvents:{click:!0,keydown:!0}})},Yd=(e)=>({state:{open:()=>e.drawerState.open(),close:()=>e.drawerState.close(),toggle:()=>e.drawerState.toggle(),isOpen:()=>e.drawerState.isOpen()},items:{setActive:(t)=>e.drawerItems.setActive(t),getActive:()=>e.drawerItems.getActive(),setItems:(t)=>e.drawerItems.setItems(t||[]),getItems:()=>e.drawerItems.getItems(),setBadge:(t,n)=>e.drawerItems.setBadge(t,n)},headline:{setHeadline:(t)=>e.drawerHeadline.setHeadline(t),getHeadline:()=>e.drawerHeadline.getHeadline()},lifecycle:{destroy:()=>{if(e._stateCleanup)e._stateCleanup();e.lifecycle.destroy()}}});var sg=(e={})=>{let t=Wd(e);try{return M(D,k(),O(Kd(t)),oe(t),Wi(t),Gi(t),zi(t),P(),(r)=>{let i=document.createElement("div");i.className=r.getClass("drawer__sheet");let s=t.width,a=s?typeof s==="number"?`${s}px`:s:`${yt.WIDTH}px`;if(r.element.style.setProperty("--drawer-width",a),r.headlineElement)i.appendChild(r.headlineElement);if(r.itemsContainer)i.appendChild(r.itemsContainer);if(r.scrimElement)r.element.appendChild(r.scrimElement);r.element.appendChild(i);let o=t.position||"start";return r.element.classList.add(`${r.getClass("drawer")}--${o}`),r},(r)=>zd(Yd(r))(r))(t)}catch(n){throw console.error("Drawer creation error:",n),Error(`Failed to create drawer: ${n.message}`)}},Ki=sg;se();te();re();var Xd=({disabled:e,lifecycle:t,className:n})=>(r)=>({...r,element:r.element,getValue:()=>r.element.value,setValue(i){return r.element.value=i,this},enable(){return e.enable(),this},disable(){return e.disable(),this},setIcon(i){return r.icon.setIcon(i),this},getIcon(){return r.icon.getIcon()},setPosition(i){return["top-right","top-left","bottom-right","bottom-left"].forEach((a)=>{r.element.classList.remove(`${n}--${a}`)}),r.element.classList.add(`${n}--${i}`),this},getPosition(){let i=["top-right","top-left","bottom-right","bottom-left"];for(let s of i)if(r.element.classList.contains(`${n}--${s}`))return s;return null},lower(){return r.element.classList.add(`${n}--lowered`),this},raise(){return r.element.classList.remove(`${n}--lowered`),this},destroy(){t.destroy()}});ne();var ag={variant:"primary",size:"default",type:"button",ripple:!0},qd=(e={})=>_(ag,e,"fab"),jd=(e)=>{let t={type:e.type||"button","aria-label":e.ariaLabel||(e.icon?"action":void 0)};if(e.disabled===!0)t.disabled=!0;let n=[];if(n.push(`fab--${e.size||"default"}`),e.animate)n.push("fab--animate-enter");if(e.position)n.push(`fab--${e.position}`);if(e.disabled===!0)n.push("fab--disabled");let r={...e,className:n};return V(r,{tag:"button",attributes:t,forwardEvents:{click:(i)=>!i.element.disabled,focus:!0,blur:!0},interactive:!0})},Zd=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable()},lifecycle:{destroy:()=>e.lifecycle.destroy()},className:e.getClass("fab")});var og=(e={})=>{let t=qd(e);try{return M(D,k(),O(jd(t)),oe(t),Be(t),de(t),we(t),P(),(r)=>Xd(Zd(r))(r))(t)}catch(n){throw console.error("FAB creation error:",n),Error(`Failed to create FAB: ${n.message}`)}},Nr=og;se();te();re();var Qd=({disabled:e,lifecycle:t,text:n,className:r})=>(i)=>({...i,element:i.element,getValue:()=>i.element.value,setValue(s){return i.element.value=s,this},enable(){return e.enable(),this},disable(){return e.disable(),this},setIcon(s){return i.icon.setIcon(s),this},getIcon(){return i.icon.getIcon()},setText(s){return n.setText(s),this},getText(){return n.getText()},setPosition(s){return["top-right","top-left","bottom-right","bottom-left"].forEach((o)=>{i.element.classList.remove(`${r}--${o}`)}),i.element.classList.add(`${r}--${s}`),this},getPosition(){let s=["top-right","top-left","bottom-right","bottom-left"];for(let a of s)if(i.element.classList.contains(`${r}--${a}`))return a;return null},lower(){return i.element.classList.add(`${r}--lowered`),this},raise(){return i.element.classList.remove(`${r}--lowered`),this},collapse(){i.element.classList.add(`${r}--collapsed`);let s=new CustomEvent("collapse",{bubbles:!0,cancelable:!0});return i.element.dispatchEvent(s),this},expand(){i.element.classList.remove(`${r}--collapsed`);let s=new CustomEvent("expand",{bubbles:!0,cancelable:!0});return i.element.dispatchEvent(s),this},destroy(){t.destroy()}});ne();var lg={variant:"primary",type:"button",ripple:!0,iconPosition:"start",width:"fixed"},Jd=(e={})=>_(lg,e,"extended-fab"),eu=(e)=>{let t={type:e.type||"button","aria-label":e.ariaLabel||e.text||(e.icon?"action":void 0)},n=[`${e.prefix}-extended-fab`];if(e.variant)n.push(`${e.prefix}-extended-fab--${e.variant}`);if(e.width)n.push(`${e.prefix}-extended-fab--${e.width}`);if(e.animate)n.push(`${e.prefix}-extended-fab--animate-enter`);if(e.position)n.push(`${e.prefix}-extended-fab--${e.position}`);if(e.collapseOnScroll)n.push(`${e.prefix}-extended-fab--collapsible`);if(e.class)n.push(e.class);if(e.disabled===!0)t.disabled=!0,n.push(`${e.prefix}-extended-fab--disabled`);return V(e,{tag:"button",attributes:t,className:n,forwardEvents:{click:(r)=>!r.element.disabled,focus:!0,blur:!0},interactive:!0})},tu=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable()},lifecycle:{destroy:()=>e.lifecycle.destroy()},className:e.getClass("extended-fab"),text:{setText:(t)=>e.text.setText(t),getText:()=>e.text.getText()}});var dg=(e={})=>{let t=Jd(e),n=(r)=>{if(t.collapseOnScroll){let i=window.scrollY,s=!1,a=10,o=()=>{if(!s)window.requestAnimationFrame(()=>{let d=window.scrollY,u=d-i;if(u>a)r.collapse();else if(u<-a)r.expand();if(d<=0)r.expand();i=d,s=!1}),s=!0};window.addEventListener("scroll",o,{passive:!0}),requestAnimationFrame(()=>{r.expand()});let l=r.destroy;r.destroy=()=>{window.removeEventListener("scroll",o),l.call(r)}}};try{let r=M(D,k(),O(eu(t)),oe(t),Be(t),ot(t),de(t),we(t),P(),(i)=>Qd(tu(i))(i))(t);return n(r),r}catch(r){throw console.error("Extended FAB creation error:",r),Error(`Failed to create Extended FAB: ${r.message}`)}},Dr=dg;te();re();var Mr={SELECT:"select",LOAD:"load",SCROLL:"scroll"};var he={CONTAINER:"list-container",LIST:"list",ITEM:"list-item",SELECTED:"list-item--selected",LOADING:"list--loading",EMPTY:"list--empty"};var ug=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize list renderer: missing element"),t;let n=e.items||[],r=e.renderItem,i=document.createElement("div");i.className="mtrl-list-content",i.setAttribute("role","list"),t.element.appendChild(i);function s(d,u){let f=document.createElement("div");f.className=he.ITEM,f.setAttribute("role","listitem");let c=document.createElement("div");c.className="mtrl-list-item-content";let C=document.createElement("div");return C.className="mtrl-list-item-text",C.textContent=d.text||d.title||d.headline||d.name||d.id||String(d),c.appendChild(C),f.appendChild(c),f}let a=()=>{if(i.innerHTML="",!n||n.length===0){i.innerHTML='<div class="mtrl-list-empty">No items</div>';return}let d=document.createDocumentFragment();n.forEach((u,f)=>{if(u==null)return;let c=r?r(u,f):s(u,f);if(!c)return;if(!c.classList.contains(he.ITEM))c.classList.add(he.ITEM);if(!c.hasAttribute("role"))c.setAttribute("role","listitem");let C=u?.id||String(f);if(!c.hasAttribute("data-id"))c.setAttribute("data-id",C);d.appendChild(c)}),i.appendChild(d),t.emit?.(Mr.LOAD,{items:n,loading:!1,hasNext:!1,hasPrev:!1,component:t}),console.log(`\uD83D\uDCCB Rendered ${n.length} items directly`)},o=(d,u="start",f=!1)=>{let c=i.querySelector(`[data-id="${d}"]`);if(c)c.scrollIntoView({behavior:f?"smooth":"auto",block:u==="center"?"center":u==="end"?"end":"start"})},l=(d,u="start",f=!1)=>{if(d<0||d>=n.length)return;let c=i.children[d];if(c)c.scrollIntoView({behavior:f?"smooth":"auto",block:u==="center"?"center":u==="end"?"end":"start"})};if(a(),t.lifecycle?.destroy){let d=t.lifecycle.destroy;t.lifecycle.destroy=()=>{i.innerHTML="",d()}}return{...t,list:{getItems:()=>n,getAllItems:()=>n,getVisibleItems:()=>n,refresh:a,scrollToItem:o,scrollToIndex:l,loadNext:()=>Promise.resolve({hasNext:!1,items:[]}),loadPage:()=>Promise.resolve({hasNext:!1,items:[]}),loadPrevious:()=>Promise.resolve({hasPrev:!1,items:[]}),scrollNext:()=>Promise.resolve({hasNext:!1,items:[]}),scrollPrevious:()=>Promise.resolve({hasPrev:!1,items:[]}),scrollToItemById:(d,u,f)=>(o(d,u,f),Promise.resolve()),onCollectionChange:()=>()=>{},onPageChange:()=>()=>{},getCurrentPage:()=>1,getPageSize:()=>n.length,getCollection:()=>null,isApiMode:()=>!1,isLoading:()=>!1,hasNextPage:()=>!1}}},Yi=ug;en();tn();var cg=(e)=>(t)=>{if(!t.element||!e.trackSelection)return{...t,getSelectedItems:()=>[],getSelectedItemIds:()=>[],isItemSelected:()=>!1,selectItem:()=>t,deselectItem:()=>t,clearSelection:()=>t,setSelection:()=>t};let n=new Set;if(Array.isArray(e.initialSelection))e.initialSelection.forEach((a)=>n.add(String(a)));if(Array.isArray(e.items))e.items.forEach((a,o)=>{if(a?.selected){let l=a.id||String(o);n.add(String(l))}});let r=()=>{(t.element?.querySelectorAll("[data-id]")||[]).forEach((o)=>{let l=o.getAttribute("data-id"),d=n.has(l);if(d&&!rt(o,he.SELECTED))ee(o,he.SELECTED);else if(!d&&rt(o,he.SELECTED))Ce(o,he.SELECTED)})},i=(a)=>{let o=a.target.closest("[data-id]");if(!o)return;let l=o.getAttribute("data-id");if(!l)return;let d=t.list?.getItems()||[],u=d.find((c)=>String(c?.id)===l);if(!u){let c=parseInt(l,10);if(!isNaN(c)&&c>=0&&c<d.length)u=d[c]}if(!u){console.warn(`Item not found for ID: ${l}`);return}let f={item:u,element:o,originalEvent:a,component:t,preventDefault:()=>{f.defaultPrevented=!0},defaultPrevented:!1};if(t.emit?.(Mr.SELECT,f),f.defaultPrevented)return;if(e.multiSelect)if(n.has(l))n.delete(l),Ce(o,he.SELECTED);else n.add(l),ee(o,he.SELECTED);else{let c=rt(o,he.SELECTED);if(t.element.querySelectorAll(`.${K}-${he.SELECTED}`).forEach((g)=>Ce(g,he.SELECTED)),n.clear(),!c)n.add(l),ee(o,he.SELECTED)}},s=(a,o)=>{let l=String(a);if(o)n.add(l);else n.delete(l);let d=t.element.querySelector(`[data-id="${l}"]`);if(d){if(o&&!rt(d,he.SELECTED))ee(d,he.SELECTED);else if(!o&&rt(d,he.SELECTED))Ce(d,he.SELECTED)}};if(t.element.addEventListener("click",i),setTimeout(r,10),t.lifecycle?.destroy){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{t.element.removeEventListener("click",i),a()}}return{...t,getSelectedItems:()=>(t.list?.getItems()||[]).filter((o,l)=>{let d=o?.id||String(l);return n.has(String(d))}),getSelectedItemIds:()=>Array.from(n),isItemSelected:(a)=>n.has(String(a)),selectItem:(a)=>(s(a,!0),t),deselectItem:(a)=>(s(a,!1),t),clearSelection:()=>{if(n.size>0)n.clear(),t.element.querySelectorAll(`.${K}-${he.SELECTED}`).forEach((a)=>Ce(a,he.SELECTED));return t},setSelection:(a)=>{if(n.clear(),Array.isArray(a))a.forEach((o)=>n.add(String(o)));return r(),t}}},Xi=cg;var nu=({list:e,selection:t,events:n,lifecycle:r,config:i})=>(s)=>({...s,element:s.element,refresh:async()=>(e.refresh(),s),getAllItems:()=>e.getAllItems(),getVisibleItems:()=>e.getVisibleItems(),scrollToItem:(a,o,l)=>{let d=l!==void 0?l:i?.animate||!1;return e.scrollToItem(a,o,d),s},scrollToIndex:async(a,o,l)=>{let d=l!==void 0?l:i?.animate||!1;return e.scrollToIndex(a,o,d),s},isLoading:()=>e.isLoading(),hasNextPage:()=>e.hasNextPage(),getSelectedItems:()=>t.getSelectedItems(),getSelectedItemIds:()=>t.getSelectedItemIds(),isItemSelected:(a)=>t.isItemSelected(a),selectItem:(a)=>(t.selectItem(a),s),deselectItem:(a)=>(t.deselectItem(a),s),clearSelection:()=>(t.clearSelection(),s),setSelection:(a)=>(t.setSelection(a),s),on:(a,o)=>(n.on(a,o),s),off:(a,o)=>(n.off(a,o),s),destroy:()=>{r.destroy()}});ne();var mg={items:[],trackSelection:!0,multiSelect:!1,animate:!1},ru=(e={})=>{if(!Array.isArray(e.items)&&!e.renderItem)throw Error("List requires either items array or renderItem function");if(Array.isArray(e.items)&&e.items.length>0&&!e.renderItem)e.renderItem=(t)=>{let n=document.createElement("div");return n.className="mtrl-list-item",n.textContent=t.text||t.title||t.headline||t.name||t.id||String(t),n};return _(mg,e,"list")},iu=(e)=>{let t={role:"list",tabindex:"0"};if(e.ariaLabel)t["aria-label"]=e.ariaLabel;return V(e,{tag:"div",attributes:t,className:[he.CONTAINER,e.class],forwardEvents:{scroll:!0,keydown:!0}})},su=(e,t)=>({list:{refresh:e.list?.refresh,getItems:e.list?.getItems,getAllItems:e.list?.getAllItems,getVisibleItems:e.list?.getVisibleItems,scrollToItem:e.list?.scrollToItem,scrollToIndex:e.list?.scrollToIndex,isLoading:()=>!1,hasNextPage:()=>!1},selection:{getSelectedItems:e.getSelectedItems,getSelectedItemIds:e.getSelectedItemIds,isItemSelected:e.isItemSelected,selectItem:e.selectItem,deselectItem:e.deselectItem,clearSelection:e.clearSelection,setSelection:e.setSelection},events:{on:e.on,off:e.off},lifecycle:{destroy:e.lifecycle?.destroy},config:{animate:t?.animate}});var fg=(e={})=>{try{let t=ru(e);return console.log(`\uD83D\uDCCB Creating list with ${t.items?.length||0} items`),M(D,k(),O(iu(t)),Yi(t),Xi(t),P(),(r)=>nu(su(r,t))(r))(t)}catch(t){throw console.error("List creation error:",t),Error(`Failed to create list: ${t.message}`)}},qi=fg;se();te();re();var au=!1,gg=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize menu controller: missing element"),t;let n={visible:e.visible||!1,items:e.items||[],position:e.position,selectedItemId:null,activeItemIndex:-1,component:t},r={triggerEvent(v,E={},T){let S={menu:n.component,...E,originalEvent:T,preventDefault:()=>{S.defaultPrevented=!0},defaultPrevented:!1};return t.emit(v,S),S}},i=()=>{if(t.opener&&typeof t.opener.getOpener==="function")return t.opener.getOpener();let{opener:v}=e;if(typeof v==="string"){let E=document.querySelector(v);if(!E)return console.warn(`Menu opener not found: ${v}`),null;return E}if(typeof v==="object"&&v!==null&&"element"in v)return v.element;return v},s=(v,E)=>{let T=document.createElement("li"),S=`${t.getClass("menu-item")}`;if(T.className=S,T.setAttribute("role","menuitem"),T.setAttribute("tabindex","-1"),T.setAttribute("data-id",v.id),T.setAttribute("data-index",E.toString()),v.disabled)T.classList.add(`${S}--disabled`),T.setAttribute("aria-disabled","true");else T.setAttribute("aria-disabled","false");if(n.selectedItemId&&v.id===n.selectedItemId)T.classList.add(`${S}--selected`),T.setAttribute("aria-selected","true");else T.setAttribute("aria-selected","false");if(v.hasSubmenu)T.classList.add(`${S}--submenu`),T.setAttribute("aria-haspopup","true"),T.setAttribute("aria-expanded","false");let y=document.createElement("span");if(y.className=`${t.getClass("menu-item-content")}`,v.icon){let I=document.createElement("span");I.className=`${t.getClass("menu-item-icon")}`,I.innerHTML=v.icon,y.appendChild(I)}let L=document.createElement("span");if(L.className=`${t.getClass("menu-item-text")}`,L.textContent=v.text,y.appendChild(L),v.shortcut){let I=document.createElement("span");I.className=`${t.getClass("menu-item-shortcut")}`,I.textContent=v.shortcut,y.appendChild(I)}if(T.appendChild(y),!v.disabled){if(T.addEventListener("click",(I)=>d(I,v,E)),T.addEventListener("keydown",(I)=>{if(I.key==="Enter"||I.key===" ")I.preventDefault(),d(I,v,E)}),T.addEventListener("focus",()=>{n.activeItemIndex=E}),v.hasSubmenu&&e.openSubmenuOnHover)T.addEventListener("mouseenter",()=>{if(t.submenu)t.submenu.handleSubmenuHover(v,E,T)}),T.addEventListener("mouseleave",(I)=>{if(t.submenu)t.submenu.handleSubmenuLeave(I)})}return T},a=(v,E)=>{let T=document.createElement("li");if(T.className=`${t.getClass("menu-divider")}`,T.setAttribute("role","separator"),T.setAttribute("data-index",E.toString()),v.id)T.setAttribute("id",v.id);return T},o=()=>{let v=document.createElement("ul");v.className=`${t.getClass("menu-list")}`,v.setAttribute("role","menu"),n.items.forEach((E,T)=>{if("type"in E&&E.type==="divider")v.appendChild(a(E,T));else v.appendChild(s(E,T))}),t.element.innerHTML="",t.element.appendChild(v)},l=(v)=>{for(let E of n.items){if("id"in E&&E.id===v)return E;if("submenu"in E&&Array.isArray(E.submenu)){for(let T of E.submenu)if("id"in T&&T.id===v)return T}}return null},d=(v,E,T)=>{if(v.preventDefault(),v.stopPropagation(),E.disabled)return;if(E.hasSubmenu&&t.submenu){t.submenu.handleSubmenuClick(E,T,v.currentTarget);return}let S=r.triggerEvent("select",{item:E,itemId:E.id,itemData:E.data},v);if(e.closeOnSelect&&!S.defaultPrevented)c(v,!0)},u=(v)=>{if(!t.element)return;t.element.querySelectorAll(`.${t.getClass("menu-item")}`).forEach((T)=>{if(T.getAttribute("data-id")===v)T.classList.add(`${t.getClass("menu-item--selected")}`),T.setAttribute("aria-selected","true");else T.classList.remove(`${t.getClass("menu-item--selected")}`),T.setAttribute("aria-selected","false")}),n.selectedItemId=v},f=(v,E="mouse")=>{if(n.visible)return;if(n.visible=!0,document.removeEventListener("click",g),!t.element.parentNode)t.element.classList.remove(`${t.getClass("menu--visible")}`),t.element.setAttribute("aria-hidden","true"),t.element.style.transform="scaleY(0)",t.element.style.opacity="0",(e.container||document.body).appendChild(t.element);setTimeout(()=>{let T=i();if(T&&t.position)t.position.positionMenu(T);t.element.setAttribute("aria-hidden","false"),t.element.style.transform="",t.element.style.opacity="",t.element.getBoundingClientRect(),t.element.classList.add(`${t.getClass("menu--visible")}`),setTimeout(()=>{if(t.keyboard&&t.keyboard.handleInitialFocus)t.keyboard.handleInitialFocus(t.element,E);else if(E==="keyboard"){let S=Array.from(t.element.querySelectorAll(`.${t.getClass("menu-item")}:not(.${t.getClass("menu-item--disabled")})`));if(S.length>0)S.forEach((y)=>{y.tabIndex=-1}),S[0].tabIndex=0,S[0].focus();else t.element.tabIndex=0,t.element.focus()}else{t.element.tabIndex=-1;let S=Array.from(t.element.querySelectorAll(`.${t.getClass("menu-item")}:not(.${t.getClass("menu-item--disabled")})`));if(S.length>0)S.forEach((y)=>{y.tabIndex=-1}),S[0].tabIndex=0}},100),setTimeout(()=>{if(e.closeOnClickOutside&&n.visible)document.addEventListener("click",g);if(e.closeOnEscape)document.addEventListener("keydown",m);window.addEventListener("resize",p,{passive:!0}),window.addEventListener("scroll",h,{passive:!0})},0)},20),r.triggerEvent("open",{},v)},c=(v,E=!0)=>{if(!n.visible)return;if(t.emit("menu-closing",{event:v,restoreFocus:E}),t.submenu)t.submenu.closeAllSubmenus();setTimeout(()=>{n.visible=!1,t.element.setAttribute("aria-hidden","true"),t.element.classList.remove(`${t.getClass("menu--visible")}`),document.removeEventListener("click",g),document.removeEventListener("keydown",m),window.removeEventListener("resize",p),window.removeEventListener("scroll",h),r.triggerEvent("close",{restoreFocus:E},v),setTimeout(()=>{if(t.element.parentNode&&!n.visible)t.element.parentNode.removeChild(t.element)},300)},50)},C=(v,E="mouse")=>{if(n.visible)c(v);else{if(v){if(v instanceof KeyboardEvent)E="keyboard";else if(v instanceof MouseEvent)E="mouse"}f(v,E)}},g=(v)=>{if(au){au=!1;return}if(t.element.contains(v.target))return;let E=i();if(E&&E.contains(v.target))return;if(t.submenu&&t.submenu.hasOpenSubmenu()){let T=t.submenu.getActiveSubmenus();for(let S of T)if(S.element.contains(v.target))return}c(v,!1)},m=(v)=>{let E=t.element.contains(v.target),T=t.submenu&&t.submenu.hasOpenSubmenu()&&t.submenu.getActiveSubmenus().some((S)=>S.element.contains(v.target));if(n.visible){if(E||T){if(v.key==="Escape")v.preventDefault(),c(v,!0)}else if(t.keyboard&&t.keyboard.handleMenuKeydown)t.keyboard.handleMenuKeydown(v,n,{closeMenu:c,closeSubmenu:t.submenu?t.submenu.closeSubmenu:null,findItemById:l,handleSubmenuClick:t.submenu?t.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:t.submenu?t.submenu.handleNestedSubmenuClick:null})}},p=()=>{if(n.visible)if(e.closeOnResize)c(void 0,!0);else{let v=i();if(v&&t.position)t.position.positionMenu(v)}},h=()=>{if(n.visible)window.requestAnimationFrame(()=>{let v=i();if(v&&t.position)t.position.positionMenu(v)})},b=()=>{if(o(),t.keyboard&&t.keyboard.setupKeyboardHandlers)t.keyboard.setupKeyboardHandlers(t.element,n,{closeMenu:c,closeSubmenu:t.submenu?t.submenu.closeSubmenu:null,findItemById:l,handleSubmenuClick:t.submenu?t.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:t.submenu?t.submenu.handleNestedSubmenuClick:null});if(n.visible){let v=i();if(v&&t.position)t.position.positionMenu(v);if(t.element.classList.add(`${t.getClass("menu--visible")}`),e.closeOnClickOutside)document.addEventListener("click",g);if(e.closeOnEscape)document.addEventListener("keydown",m);window.addEventListener("resize",p),window.addEventListener("scroll",h)}};if(t.on("create-menu-items",(v)=>{let{items:E,container:T,onItemCreated:S}=v;E.forEach((y,L)=>{let I;if("type"in y&&y.type==="divider")I=a(y,L);else I=s(y,L);if(T.appendChild(I),S)S(I)})}),setTimeout(b,0),t.lifecycle){let v=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{document.removeEventListener("click",g),document.removeEventListener("keydown",m),window.removeEventListener("resize",p),window.removeEventListener("scroll",h),v()}}return{...t,menu:{open:(v,E="mouse")=>(f(v,E),t),close:(v,E=!0)=>(c(v,E),t),toggle:(v,E="mouse")=>(C(v,E),t),isOpen:()=>n.visible,setItems:(v)=>(n.items=v,o(),t),getItems:()=>n.items,setPosition:(v)=>{if(n.position=v,n.visible){let E=i();if(E&&t.position)t.position.positionMenu(E)}return t},getPosition:()=>n.position,setSelected:(v)=>(u(v),t),getSelected:()=>n.selectedItemId}}},ji=gg;var pg=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize menu opener: missing element"),t;let n=!1;document.addEventListener("keydown",(m)=>{n=m.key==="Tab",setTimeout(()=>{n=!1},100)});let r={openerElement:null,openerComponent:null,activeClass:""},i=(m)=>{if(!m)return{element:null,component:null};if(typeof m==="string"){let p=document.querySelector(m);if(!p)return console.warn(`Menu opener not found: ${m}`),{element:null,component:null};return{element:p,component:null}}if(typeof m==="object"&&m!==null){if("element"in m&&m.element instanceof HTMLElement)return{element:m.element,component:m};if("getElement"in m&&typeof m.getElement==="function"){let p=m.getElement();if(p instanceof HTMLElement)return{element:p,component:m}}if("input"in m&&m.input instanceof HTMLElement)return{element:m.input,component:m};if(m instanceof HTMLElement)return{element:m,component:null}}return console.warn("Invalid opener type:",m),{element:null,component:null}},s=(m)=>{let p=t.getClass("").split("-")[0];if(m.tagName==="BUTTON")return`${p}-button--active`;else if(m.classList.contains(`${p}-chip`))return`${p}-chip--selected`;else if(m.classList.contains(`${p}-textfield`)||m.classList.contains(`${p}-select`))return`${p}-textfield--focused`;else return`${p}-menu-opener--active`},a=(m)=>{let{element:p,component:h}=m;if(!p)return;if(r.openerElement&&r.openerElement!==p)c();if(r.openerElement=p,r.openerComponent=h,r.activeClass=s(p),!e.manualOpen)p.addEventListener("click",d),p.addEventListener("keydown",u),p.addEventListener("blur",f);p.setAttribute("aria-haspopup","true"),p.setAttribute("aria-expanded","false");let b=t.element.id;if(!b)b=`menu-${Date.now()}-${Math.floor(Math.random()*1000)}`,t.element.id=b;p.setAttribute("aria-controls",b)},o=(m)=>{if(!r.openerElement)return;if(r.openerComponent&&typeof r.openerComponent.setActive==="function"){r.openerComponent.setActive(m);return}if(r.openerComponent&&"selected"in r.openerComponent){r.openerComponent.selected=m;return}if(r.openerComponent&&typeof r.openerComponent.focus==="function"&&typeof r.openerComponent.blur==="function"){if(m)r.openerComponent.focus();else r.openerComponent.blur();return}if(r.openerElement.classList)if(m)r.openerElement.classList.add(r.activeClass);else r.openerElement.classList.remove(r.activeClass)},l=()=>{if(!r.openerElement)return;if(r.openerComponent&&typeof r.openerComponent.focus==="function"){requestAnimationFrame(()=>{r.openerComponent.focus()});return}if(r.openerComponent&&"input"in r.openerComponent&&r.openerComponent.input instanceof HTMLElement){requestAnimationFrame(()=>{r.openerComponent.input.focus()});return}requestAnimationFrame(()=>{r.openerElement.focus()})},d=(m)=>{if(m.preventDefault(),m.stopPropagation(),t.menu)if(t.menu.isOpen())t.menu.close(m);else t.menu.open(m,"mouse")},u=(m)=>{if(!t.menu)return;let p=t.menu.isOpen();switch(m.key){case"Enter":case" ":case"ArrowDown":case"Down":if(m.preventDefault(),!p)t.menu.open(m,"keyboard");break;case"Escape":if(p)m.preventDefault(),t.menu.close(m);break;case"ArrowUp":case"Up":if(m.preventDefault(),!p)t.menu.open(m,"keyboard"),setTimeout(()=>{let h=t.element.querySelectorAll(`.${t.getClass("menu-item")}:not(.${t.getClass("menu-item--disabled")})`);if(h.length>0){h.forEach((v)=>v.setAttribute("tabindex","-1"));let b=h[h.length-1];b.setAttribute("tabindex","0"),b.focus()}},100);break}},f=(m)=>{if(!t.menu||!t.menu.isOpen())return;let p=m.relatedTarget;if(n){setTimeout(()=>{if(t.menu&&t.menu.isOpen())t.menu.close(m,!1)},10);return}if(p){if(t.element.contains(p))return;if(p.getAttribute("aria-haspopup")==="true"||p.closest('[aria-haspopup="true"]'))return}setTimeout(()=>{if(t.menu&&t.menu.isOpen())t.menu.close(m,!1)},50)},c=()=>{if(r.openerElement){if(!e.manualOpen)r.openerElement.removeEventListener("click",d),r.openerElement.removeEventListener("keydown",u),r.openerElement.removeEventListener("blur",f);r.openerElement.removeAttribute("aria-haspopup"),r.openerElement.removeAttribute("aria-expanded"),r.openerElement.removeAttribute("aria-controls"),o(!1)}r.openerComponent=null,r.openerElement=null,r.activeClass=""},{element:C,component:g}=i(e.opener);if(a({element:C,component:g}),t.lifecycle){let m=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{c(),m()}}return t.on("open",()=>{if(r.openerElement)r.openerElement.setAttribute("aria-expanded","true"),o(!0)}),t.on("close",(m)=>{if(r.openerElement){if(r.openerElement.setAttribute("aria-expanded","false"),o(!1),m.restoreFocus&&!n)l()}}),{...t,opener:{setOpener(m){let p=i(m);if(p.element)a(p);return t},getOpener(){return r.openerElement},getOpenerComponent(){return r.openerComponent},setActive(m){return o(m),t},focus(){return l(),t}}}},Zi=pg;var hg=(e,t)=>{let n=(s,a,o,l=!1)=>{if(!s||!a)return;let d=t.container&&t.container!==document.body;s.style.position="absolute";let u=d?0:window.pageXOffset||document.documentElement.scrollLeft,f=d?0:window.pageYOffset||document.documentElement.scrollTop,c=a.getBoundingClientRect(),C=s.cloneNode(!0);if(C.style.visibility="hidden",C.style.display="block",C.style.position="absolute",C.style.top="0",C.style.left="0",C.style.transform="none",C.style.opacity="0",C.style.pointerEvents="none",C.classList.add(`${e.getClass("menu--visible")}`),t.width==="100%"&&!l)C.style.width=`${c.width}px`;let g=t.container||document.body;g.appendChild(C);let m=C.getBoundingClientRect(),{innerWidth:p,innerHeight:h}=window;g.removeChild(C);let b=t.offset!==void 0?t.offset:8,v=0,E=0,T=o;if(l){if(T=o||"right-start",T.startsWith("right")&&c.right+m.width+b>p-16)T=T.replace("right","left");else if(T.startsWith("left")&&c.left-m.width-b<16)T=T.replace("left","right");if(c.top+m.height>h-48){if(T==="right-start")T="right-end";else if(T==="left-start")T="left-end"}}else switch(o){case"top-start":case"top":case"top-end":if(c.top<m.height+b+48)T=o.replace("top","bottom");break;case"bottom-start":case"bottom":case"bottom-end":if(c.bottom+m.height+b+48>h){if(c.top>h-c.bottom)T=o.replace("bottom","top")}break;case"right-start":case"right":case"left-start":case"left":if(c.bottom+m.height>h-48){if(o==="right-start")T="right-end";else if(o==="left-start")T="left-end";else if(o==="right")v=c.top-(m.height-c.height)-b;else if(o==="left")v=c.top-(m.height-c.height)-b}break}if(["position-top","position-bottom","position-right","position-left"].forEach((q)=>{s.classList.remove(`${e.getClass("menu")}--${q}`)}),T.startsWith("top")||T==="right-end"||T==="left-end"||T==="right"&&v<c.top||T==="left"&&v<c.top)s.classList.add(`${e.getClass("menu")}--position-top`);else if(T.startsWith("left"))s.classList.add(`${e.getClass("menu")}--position-left`);else if(T.startsWith("right"))s.classList.add(`${e.getClass("menu")}--position-right`);else s.classList.add(`${e.getClass("menu")}--position-bottom`);let L=d&&t.container?t.container.getBoundingClientRect():{top:0,left:0,right:0,bottom:0},I=d?-L.left:u,x=d?-L.top:f;switch(T){case"top-start":v=c.top+x-m.height-b,E=c.left+I;break;case"top":v=c.top+x-m.height-b,E=c.left+I+c.width/2-m.width/2;break;case"top-end":v=c.top+x-m.height-b,E=c.right+I-m.width;break;case"right-start":v=c.top+x,E=c.right+I+b;break;case"right":if(v===0)v=c.top+x+c.height/2-m.height/2;else v+=x;E=c.right+I+b;break;case"right-end":v=c.bottom+x-m.height,E=c.right+I+b;break;case"bottom-start":v=c.bottom+x+b,E=c.left+I;break;case"bottom":v=c.bottom+x+b,E=c.left+I+c.width/2-m.width/2;break;case"bottom-end":v=c.bottom+x+b,E=c.right+I-m.width;break;case"left-start":v=c.top+x,E=c.left+I-m.width-b;break;case"left":if(v===0)v=c.top+x+c.height/2-m.height/2;else v+=x;E=c.left+I-m.width-b;break;case"left-end":v=c.bottom+x-m.height,E=c.left+I-m.width-b;break}if(d){if(s.style.top=`${v}px`,s.style.left=`${E}px`,t.width==="100%"&&!l)s.style.width=`${c.width}px`;if(t.maxHeight)s.style.maxHeight=t.maxHeight;return}let A=48;if(v-f<A)v=A+f;let N=48;if(v-f+m.height>h-N){let q=h-(v-f)-N,Y=Math.min(m.height,100),J=Math.max(q,Y);if(s.style.maxHeight=`${J}px`,t.maxHeight){let w=parseInt(t.maxHeight,10);if(!isNaN(w)&&w<parseInt(s.style.maxHeight||"0",10))s.style.maxHeight=t.maxHeight}}else if(t.maxHeight)s.style.maxHeight=t.maxHeight;if(t.width==="100%"&&!l)s.style.width=`${c.width}px`;let U=Math.max(A+f,v),H=Math.max(16+u,E);if(s.style.top=`${U}px`,s.style.left=`${H}px`,H-u+m.width>p-16)s.style.left="auto",s.style.right="16px"};return{positionMenu:(s)=>{if(!s||!e.element)return;n(e.element,s,t.position,!1)},positionSubmenu:(s,a,o=1)=>{if(!s||!a)return;let l=o%2===1?"right-start":"left-start";s.style.zIndex=`${1000+o*10}`,n(s,a,l,!0)},positionElement:n}},Cg=(e)=>(t)=>{if(!t.element)return t;let n=hg(t,e);return{...t,position:n}},Qi=Cg;var Eg=(e)=>{let t=!1,n="",r=null,i=500;(()=>{document.addEventListener("keydown",(c)=>{t=c.key==="Tab",setTimeout(()=>{t=!1},100)})})();let a=()=>{let C=document.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])');return Array.from(C).filter((g)=>g.offsetParent!==null&&!g.classList.contains("hidden"))},o=()=>{if(n="",r)clearTimeout(r),r=null},l=(c,C)=>{if(o(),C==="keyboard"){let g=Array.from(c.querySelectorAll(`.${e.getClass("menu-item")}:not(.${e.getClass("menu-item--disabled")})`));if(g.length>0)g[0].setAttribute("tabindex","0"),g[0].focus();else c.setAttribute("tabindex","0"),c.focus()}else{c.setAttribute("tabindex","-1");let g=c.querySelector(`.${e.getClass("menu-item")}:not(.${e.getClass("menu-item--disabled")})`);if(g)g.setAttribute("tabindex","0")}},d=(c,C,g)=>{let m=C.activeSubmenu&&C.activeSubmenu.contains(c.target),p=m?C.activeSubmenu:e.element,h=Array.from(p.querySelectorAll(`.${e.getClass("menu-item")}:not(.${e.getClass("menu-item--disabled")})`));if(h.length===0)return;let b=document.activeElement,v=-1;if(b&&h.includes(b))v=h.indexOf(b);let E=(T)=>{if(h[T])h[T].focus()};if(c.key.length===1&&!c.ctrlKey&&!c.metaKey&&!c.altKey){if(c.preventDefault(),c.stopPropagation(),n+=c.key.toLowerCase(),r)clearTimeout(r);r=setTimeout(()=>{n="",r=null},i);let T=h.findIndex((S)=>(S.querySelector(`.${e.getClass("menu-item-text")}`)?.textContent?.toLowerCase()||"").startsWith(n));if(T!==-1)E(T);else if(n.length>1){let S=n.slice(-1),y=h.findIndex((L)=>(L.querySelector(`.${e.getClass("menu-item-text")}`)?.textContent?.toLowerCase()||"").startsWith(S));if(y!==-1)n=S,E(y)}return}switch(c.key){case"ArrowDown":case"Down":if(c.preventDefault(),c.stopPropagation(),v<0)E(0);else if(v<h.length-1)E(v+1);else E(0);break;case"ArrowUp":case"Up":if(c.preventDefault(),c.stopPropagation(),v<0)E(h.length-1);else if(v>0)E(v-1);else E(h.length-1);break;case"Home":c.preventDefault(),c.stopPropagation(),E(0);break;case"End":c.preventDefault(),c.stopPropagation(),E(h.length-1);break;case"Enter":case" ":if(c.preventDefault(),c.stopPropagation(),v>=0)h[v].click();break;case"ArrowRight":case"Right":if(c.preventDefault(),c.stopPropagation(),m){if(v>=0&&h[v].classList.contains(`${e.getClass("menu-item--submenu")}`)){let S=h[v],y=parseInt(S.getAttribute("data-index"),10),I=S.closest(`.${e.getClass("menu--submenu")}`)?.getAttribute("data-parent-item"),x=g.findItemById(I);if(x&&x.submenu){let A=x.submenu[y];g.handleNestedSubmenuClick(A,y,S)}}}else if(v>=0&&h[v].classList.contains(`${e.getClass("menu-item--submenu")}`)){let S=h[v],y=parseInt(S.getAttribute("data-index"),10),L=C.items[y];g.handleSubmenuClick(L,y,S)}break;case"ArrowLeft":case"Left":if(c.preventDefault(),c.stopPropagation(),m)if(C.activeSubmenuItem){let S=C.activeSubmenuItem,y=parseInt(p.getAttribute("data-level")||"1",10);if(g.closeSubmenu(y),S)S.focus()}else g.closeSubmenu(1);break;case"Escape":if(c.preventDefault(),c.stopPropagation(),m)if(C.activeSubmenuItem){let S=C.activeSubmenuItem,y=parseInt(p.getAttribute("data-level")||"1",10);if(g.closeSubmenu(y),S)S.focus()}else g.closeSubmenu(1);else g.closeMenu(c,!0);break;case"Tab":if(n="",r)clearTimeout(r),r=null;c.preventDefault();let T=e.opener?.getOpener?.();if(g.closeMenu(c,!0),T)setTimeout(()=>{if(c.shiftKey);else{let S=a(),y=S.indexOf(T);if(y>=0&&y<S.length-1)S[y+1].focus()}},0);break}};return{handleInitialFocus:l,handleMenuKeydown:d,setupKeyboardHandlers:(c,C,g)=>{let m=c.querySelectorAll(`.${e.getClass("menu-item")}:not(.${e.getClass("menu-item--disabled")})`);if(m.forEach((p)=>{p.tabIndex=-1}),m.length>0)m[0].tabIndex=0;c.addEventListener("keydown",(p)=>d(p,C,g))},isTabNavigationActive:()=>t,getFocusableElements:a,resetTypeahead:o}},bg=()=>(e)=>{if(!e.element)return e;let t=Eg(e);return{...e,keyboard:t}},Ji=bg;var vg=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize menu submenu: missing element"),t;let n={activeSubmenu:null,activeSubmenuItem:null,submenuLevel:0,activeSubmenus:[],submenuTimer:null,hoverIntent:{timer:null,activeItem:null},component:t},r=()=>{if(n.hoverIntent.timer)clearTimeout(n.hoverIntent.timer),n.hoverIntent.timer=null,n.hoverIntent.activeItem=null},i=()=>{if(n.submenuTimer)clearTimeout(n.submenuTimer),n.submenuTimer=null},s=(b,v,E)=>{if(!e.openSubmenuOnHover||!b.hasSubmenu)return;r(),i(),n.hoverIntent.activeItem=E,n.hoverIntent.timer=setTimeout(()=>{if(E.matches(":hover")){if(n.activeSubmenuItem!==E)d(b,v,E)}n.hoverIntent.timer=null},100)},a=()=>{r(),i(),n.submenuTimer=setTimeout(()=>{let{activeSubmenu:b,activeSubmenuItem:v}=n;if(b&&v){let E=b.matches(":hover"),T=v.matches(":hover");if(!E&&!T)u(n.submenuLevel)}n.submenuTimer=null},300)},o=(b,v,E)=>{if(!b.submenu||!b.hasSubmenu)return;let T=E.getAttribute("aria-expanded")==="true";if(n.activeSubmenus.some((y)=>y.isOpening))return;if(T){let y=parseInt(E.closest(`.${t.getClass("menu--submenu")}`)?.getAttribute("data-level")||"0",10);u(y+1),E.setAttribute("aria-expanded","false")}else d(b,v,E)},l=(b,v,E)=>{if(!b.submenu||!b.hasSubmenu)return;let T=E.getAttribute("aria-expanded")==="true";if(n.activeSubmenus.some((y)=>y.isOpening))return;if(T){let y=parseInt(E.closest(`.${t.getClass("menu--submenu")}`)?.getAttribute("data-level")||"1",10);u(y+1)}else d(b,v,E)},d=(b,v,E)=>{if(!b.submenu||!b.hasSubmenu)return;let T=E.closest(`.${t.getClass("menu--submenu")}`)?parseInt(E.closest(`.${t.getClass("menu--submenu")}`).getAttribute("data-level")||"0",10)+1:1;if(u(T),n.activeSubmenus.findIndex((x)=>x.menuItem===E&&x.isOpening)>=0)return;E.setAttribute("aria-expanded","true");let y=document.createElement("div");y.className=`${t.getClass("menu")} ${t.getClass("menu--submenu")}`,y.setAttribute("role","menu"),y.setAttribute("tabindex","-1"),y.setAttribute("data-level",T.toString()),y.setAttribute("data-parent-item",b.id),y.style.zIndex=`${1000+T*10}`;let L=document.createElement("ul");L.className=`${t.getClass("menu-list")}`;let I=[];if(t.emit("create-menu-items",{items:b.submenu,container:L,level:T,onItemCreated:(x)=>{if(!x.classList.contains(`${t.getClass("menu-item--disabled")}`))I.push(x)}}),y.appendChild(L),document.body.appendChild(y),t.position&&t.position.positionSubmenu)t.position.positionSubmenu(y,E,T);if(t.keyboard&&t.keyboard.setupKeyboardHandlers)t.keyboard.setupKeyboardHandlers(y,{activeSubmenus:n.activeSubmenus},{closeSubmenu:u,handleNestedSubmenuClick:l});y.addEventListener("mouseenter",()=>{i()}),y.addEventListener("mouseleave",()=>{a()}),n.activeSubmenu=y,n.activeSubmenuItem=E,n.activeSubmenus.push({element:y,menuItem:E,level:T,isOpening:!0}),n.submenuLevel=T,document.addEventListener("click",c),window.addEventListener("resize",C,{passive:!0}),window.addEventListener("scroll",g,{passive:!0}),requestAnimationFrame(()=>{y.classList.add(`${t.getClass("menu--visible")}`),setTimeout(()=>{let x=n.activeSubmenus.findIndex((A)=>A.element===y);if(x!==-1)n.activeSubmenus[x].isOpening=!1;if(I.length>0){if(T>=2||document.activeElement===E)I[0].setAttribute("tabindex","0"),I[0].focus()}},300)}),t.emit("submenu-opened",{submenuElement:y,parentItem:E,level:T,item:b})},u=(b)=>{r(),i();let v=[];for(let E=n.activeSubmenus.length-1;E>=0;E--)if(n.activeSubmenus[E].level>=b){let T=n.activeSubmenus[E];if(T.menuItem)T.menuItem.setAttribute("aria-expanded","false");T.element.classList.remove(`${t.getClass("menu--visible")}`),setTimeout(()=>{if(T.element.parentNode)T.element.parentNode.removeChild(T.element)},200),v.push(E)}if(v.forEach((E)=>{n.activeSubmenus.splice(E,1)}),n.activeSubmenus.length>0){let E=n.activeSubmenus[n.activeSubmenus.length-1];if(n.activeSubmenu=E.element,n.activeSubmenuItem=E.menuItem,n.submenuLevel=E.level,E.menuItem)E.menuItem.focus()}else n.activeSubmenu=null,n.activeSubmenuItem=null,n.submenuLevel=0;t.emit("submenu-closed",{level:b})},f=()=>{if(r(),i(),n.activeSubmenus.length===0)return;[...n.activeSubmenus].forEach((b)=>{if(b.menuItem)b.menuItem.setAttribute("aria-expanded","false");b.element.classList.remove(`${t.getClass("menu--visible")}`),setTimeout(()=>{if(b.element.parentNode)b.element.parentNode.removeChild(b.element)},200)}),n.activeSubmenu=null,n.activeSubmenuItem=null,n.activeSubmenus=[],n.submenuLevel=0,document.removeEventListener("click",c),window.removeEventListener("resize",C),window.removeEventListener("scroll",g),t.emit("all-submenus-closed",{})},c=(b)=>{if(!n.activeSubmenu)return;let{activeSubmenu:v,activeSubmenuItem:E}=n;if(v.contains(b.target)||E&&E.contains(b.target))return;f()},C=()=>{if(n.activeSubmenu&&n.activeSubmenuItem&&t.position)t.position.positionSubmenu(n.activeSubmenu,n.activeSubmenuItem,n.submenuLevel)},g=()=>{window.requestAnimationFrame(()=>{if(n.activeSubmenu&&n.activeSubmenuItem&&t.position)t.position.positionSubmenu(n.activeSubmenu,n.activeSubmenuItem,n.submenuLevel)})},m=()=>n.activeSubmenus.length>0,p=()=>n.submenuLevel,h=()=>[...n.activeSubmenus];if(t.lifecycle){let b=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{if(r(),i(),document.removeEventListener("click",c),window.removeEventListener("resize",C),window.removeEventListener("scroll",g),n.activeSubmenus.length>0)n.activeSubmenus.forEach((v)=>{if(v.element.parentNode)v.element.parentNode.removeChild(v.element)});b()}}return t.on("menu-closing",()=>{f()}),{...t,submenu:{openSubmenu:d,closeSubmenu:u,closeAllSubmenus:f,handleSubmenuClick:o,handleNestedSubmenuClick:l,handleSubmenuHover:s,handleSubmenuLeave:a,hasOpenSubmenu:m,getSubmenuLevel:p,getActiveSubmenus:h}}},es=vg;var ou=({menu:e,opener:t,events:n,lifecycle:r})=>(i)=>({element:i.element,open(a,o="mouse"){if(a&&!o){if(a instanceof KeyboardEvent)o="keyboard"}return e.open(a,o),this},close(a,o=!0,l=!1){return e.close(a,o,l),this},toggle(a,o){if(a&&!o){if(a instanceof KeyboardEvent)o="keyboard";else if(a instanceof MouseEvent)o="mouse"}return e.toggle(a,o),this},isOpen(){return e.isOpen()},setItems(a){return e.setItems(a),this},getItems(){return e.getItems()},setOpener(a){return t.setOpener(a),this},getOpener(){return t.getOpener()},setPosition(a){return e.setPosition(a),this},getPosition(){return e.getPosition()},setSelected(a){return e.setSelected(a),this},getSelected(){return e.getSelected()},on(a,o){if(n?.on)n.on(a,o);else if(i.on)i.on(a,o);return this},off(a,o){if(n?.off)n.off(a,o);else if(i.off)i.off(a,o);return this},destroy(){r.destroy()}});ne();var Tg={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"},xt={POSITION:Tg.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};var lu={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",DENSE:"menu--dense"};var Sg={items:[],position:xt.POSITION,closeOnSelect:xt.CLOSE_ON_SELECT,closeOnClickOutside:xt.CLOSE_ON_CLICK_OUTSIDE,closeOnEscape:xt.CLOSE_ON_ESCAPE,openSubmenuOnHover:xt.OPEN_SUBMENU_ON_HOVER,offset:xt.OFFSET,autoFlip:xt.AUTO_FLIP,visible:!1},du=(e)=>{if(!e.opener)throw Error("Menu component requires an opener element or selector");return _(Sg,e,"menu")},uu=(e)=>{let t={};if(e.width)t.width=e.width;if(e.maxHeight)t.maxHeight=e.maxHeight;let n={role:"menu",tabindex:"-1","aria-hidden":(!e.visible).toString(),style:Object.entries(t).map(([r,i])=>`${r}: ${i}`).join(";")};return V(e,{tag:"div",attributes:n,className:[e.visible?lu.VISIBLE:null,e.dense?`${e.prefix}-menu--dense`:null,e.class].filter(Boolean),forwardEvents:{keydown:!0}})},cu=(e)=>({menu:{open:(t,n)=>e.menu?.open(t,n),close:(t,n,r)=>e.menu?.close(t,n,r),toggle:(t,n)=>e.menu?.toggle(t,n),isOpen:()=>e.menu?.isOpen()||!1,setItems:(t)=>e.menu?.setItems(t),getItems:()=>e.menu?.getItems()||[],setPosition:(t)=>e.menu?.setPosition(t),getPosition:()=>e.menu?.getPosition(),setSelected:(t)=>e.menu?.setSelected(t),getSelected:()=>e.menu?.getSelected()},opener:{setOpener:(t)=>e.opener?.setOpener(t),getOpener:()=>e.opener?.getOpener()},submenu:{hasOpenSubmenu:()=>e.submenu?.hasOpenSubmenu()||!1,closeAllSubmenus:()=>e.submenu?.closeAllSubmenus()},events:{on:(t,n)=>e.on?.(t,n),off:(t,n)=>e.off?.(t,n)},lifecycle:{destroy:()=>e.lifecycle?.destroy()}});var yg=(e)=>{try{let t=du(e),n=M(D,k(),O(uu(t)),Qi(t),Ji(),es(t),ji(t),Zi(t),P(),(r)=>ou(cu(r))(r))(t);if(t.on&&typeof n.on==="function")Object.entries(t.on).forEach(([r,i])=>{if(typeof i==="function")n.on(r,i)});return n}catch(t){throw console.error("Menu creation error:",t),Error(`Failed to create menu: ${t.message}`)}},Fn=yg;se();te();re();var mu=(e)=>(t)=>({...t,element:t.element,items:t.items||new Map,addItem(r){if(typeof t.addItem==="function")t.addItem(r);return this},removeItem(r){if(typeof t.removeItem==="function")t.removeItem(r);return this},getItem(r){if(typeof t.getItem==="function")return t.getItem(r);return this.items.get(r)},getAllItems(){if(typeof t.getAllItems==="function")return t.getAllItems();return Array.from(this.items.values())},getActive(){if(typeof t.getActive==="function")return t.getActive();return null},getItemPath(r){if(typeof t.getItemPath==="function")return t.getItemPath(r);return[]},setActive(r){if(typeof t.handleItemClick==="function")t.handleItemClick(r);else if(typeof t.setActive==="function")t.setActive(r);else{let i=this.items.get(r);if(i&&i.element){if(t.emit)t.emit("change",{id:r,item:i,source:"api"})}}return this},enable(){if(e.disabled.enable)e.disabled.enable();return this},disable(){if(e.disabled.disable)e.disabled.disable();return this},expand(){if(this.element.classList.remove(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","false"),t.emit)t.emit("expanded",{source:"api"});return this},collapse(){if(this.element.classList.add(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","true"),t.emit)t.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(r,i){if(t.on)t.on(r,i);return this},off(r,i){if(t.off)t.off(r,i);return this},destroy(){if(e.lifecycle.destroy)e.lifecycle.destroy()}});var xg={RAIL:"rail",DRAWER:"drawer",BAR:"bar",MODAL:"modal",STANDARD:"standard"},Ig={LEFT:"left",RIGHT:"right",TOP:"top",BOTTOM:"bottom"},Lg={FIXED:"fixed",DISMISSIBLE:"dismissible",MODAL:"modal"};var fu={CHANGE:"change",EXPAND:"expand",COLLAPSE:"collapse",GROUP_EXPAND:"group:expand",GROUP_COLLAPSE:"group:collapse"},un={VARIANT:xg.STANDARD,POSITION:Ig.LEFT,BEHAVIOR:Lg.FIXED,EXPANDED:!1,SHOW_LABELS:!0,SCRIM_ENABLED:!0},le={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 Ag=(e)=>{let t=document.createElement("span");return t.className=`${e}-${le.EXPAND_ICON}`,t.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
|
-
`,t},
|
|
23
|
-
.mtrl-nav-item:not([disabled]):not([aria-disabled="true"])`));if(d.length===0)return;let u=document.activeElement,f=d.indexOf(u),c=-1;if(o&&(a.key==="ArrowDown"||a.key==="ArrowRight")||l&&a.key==="ArrowRight")c=f<0?0:(f+1)%d.length;else if(o&&(a.key==="ArrowUp"||a.key==="ArrowLeft")||l&&a.key==="ArrowLeft")c=f<0?d.length-1:(f-1+d.length)%d.length;else if(a.key==="Home")c=0;else if(a.key==="End")c=d.length-1;if(c>=0)a.preventDefault(),d[c].focus()}),s};ne();var
|
|
22
|
+
`,t},wg=(e,t,n)=>{let r=document.createElement("div");return r.className=`${t}-${le.NESTED_CONTAINER}`,r.setAttribute("role","menu"),r.hidden=!0,e.forEach((i)=>{n(i,r,t)}),r},Or=(e,t,n)=>{let r=document.createElement("div");r.className=`${n}-${le.ITEM_CONTAINER}`;let i=t.getAttribute("role")==="menu",s=t.getAttribute("role")==="tablist",a=t.closest(`.${n}-nav--drawer, .${n}-nav--drawer-modal, .${n}-nav--drawer-standard`)!==null,o=document.createElement("button");if(o.className=`${n}-${le.ITEM}`,o.type="button",e.items?.length)if(a)o.setAttribute("role","button"),o.setAttribute("aria-expanded",e.expanded?"true":"false"),o.setAttribute("aria-haspopup","menu");else o.setAttribute("role","button");else if(i)o.setAttribute("role","menuitem");else if(s)o.setAttribute("role","tab"),o.setAttribute("aria-selected",e.active?"true":"false"),o.setAttribute("tabindex",e.active?"0":"-1");if(e.id)o.dataset.id=e.id;if(e.disabled)o.disabled=!0,o.setAttribute("aria-disabled","true");if(e.icon){let l=document.createElement("span");l.className=`${n}-${le.ICON}`,l.innerHTML=e.icon,o.appendChild(l)}if(e.label){let l=document.createElement("a");l.className=`${n}-${le.LABEL}`,l.textContent=e.label,l.href=`/${e.id}`,l.style.textDecoration="none",l.style.color="inherit",l.style.pointerEvents="none",l.setAttribute("title",e.label),o.appendChild(l),o.setAttribute("aria-label",e.label)}if(e.badge){let l=document.createElement("span");l.className=`${n}-${le.BADGE}`,l.textContent=e.badge,l.setAttribute("aria-label",`${e.badge} notifications`),o.appendChild(l)}if(e.active&&!e.items?.length){if(o.classList.add(`${n}-${le.ACTIVE}`),!s)o.setAttribute("aria-current","page")}if(r.appendChild(o),e.items?.length&&a){let l=Ag(n);o.appendChild(l);let d=wg(e.items,n,Or);d.hidden=!e.expanded,r.appendChild(d),o.addEventListener("click",(u)=>{u.stopPropagation();let f=o.getAttribute("aria-expanded")==="true";if(o.setAttribute("aria-expanded",(!f).toString()),d.hidden=f,l.style)l.style.transform=f?"":"rotate(90deg)"})}return t.appendChild(r),o},ts=(e,t)=>{let n=e.closest(`.${t}-${le.ITEM_CONTAINER}`);if(!n)return[];let r=n.querySelector(`.${t}-${le.NESTED_CONTAINER}`);if(!r)return[];return Array.from(r.querySelectorAll(`.${t}-${le.ITEM}`)).reduce((s,a)=>[...s,a,...ts(a,t)],[])};function Ng(e,t){if(!e)return null;let n=e.getAttribute("data-id");if(n)return n;if(e.classList.contains(`${t}-nav--rail`))return"rail";if(e.classList.contains(`${t}-nav--drawer`))return"drawer";return null}var gu=(e)=>(t)=>{let n=new Map,r=null,i=e.prefix||"mtrl",s=(l,d)=>{if(n.set(l.id,{element:d,config:l}),l.items?.length)l.items.forEach((u)=>{let f=d.closest(`.${i}-${le.ITEM_CONTAINER}`);if(f){let c=f.querySelector(`.${i}-${le.NESTED_CONTAINER}`);if(c){let C=c.querySelector(`[data-id="${u.id}"]`);if(C)s(u,C)}}})},a=(l,d,u)=>{let f=l.getAttribute("role");if(u){if(l.classList.add(`${i}-${le.ACTIVE}`),f==="tab")l.setAttribute("aria-selected","true"),l.setAttribute("tabindex","0");else if(!l.getAttribute("aria-haspopup"))l.setAttribute("aria-current","page")}else if(l.classList.remove(`${i}-${le.ACTIVE}`),f==="tab")l.setAttribute("aria-selected","false"),l.setAttribute("tabindex","-1");else if(l.hasAttribute("aria-current"))l.removeAttribute("aria-current")};if(e.items)e.items.forEach((l)=>{let d=Or(l,t.element,i);if(s(l,d),l.active)r={element:d,config:l},a(d,r,!0)});if(t.emit)t.element.addEventListener("mouseover",(l)=>{let u=l.target.closest("[data-id]");if(u){let f=u.dataset.id;if(f)t.emit("mouseover",{id:f,clientX:l.clientX,clientY:l.clientY,target:u,item:n.get(f)})}},{passive:!0}),t.element.addEventListener("mouseenter",(l)=>{let d=t.element.dataset.id||t.componentName||"nav";t.emit("mouseenter",{clientX:l.clientX,clientY:l.clientY,id:d})},{passive:!0}),t.element.addEventListener("mouseleave",(l)=>{let d=l.relatedTarget,u=Ng(d,i),f=t.element.dataset.id||t.componentName||"nav";t.emit("mouseleave",{clientX:l.clientX,clientY:l.clientY,relatedTargetId:u,id:f})});if(t.lifecycle){let l=t.lifecycle.destroy;t.lifecycle.destroy=()=>{if(n.clear(),l)l()}}let o=(l)=>{let d=[l],u=n.get(l);if(!u)return d;let f=u.element.closest(`.${i}-${le.ITEM_CONTAINER}`);if(!f)return d;let c=f.parentElement;if(!c||!c.classList.contains(`${i}-${le.NESTED_CONTAINER}`))return d;let C=c;while(C){let g=C.parentElement;if(!g||!g.classList.contains(`${i}-${le.ITEM_CONTAINER}`))break;let m=g.querySelector(`.${i}-${le.ITEM}[data-id]`);if(!m)break;let p=m.getAttribute("data-id");if(!p)break;d.unshift(p);let h=g.parentElement;if(!h||!h.classList.contains(`${i}-${le.NESTED_CONTAINER}`))break;C=h}return d};return{...t,items:n,addItem(l){if(n.has(l.id))return this;let d=Or(l,t.element,i);if(s(l,d),l.active)this.setActive(l.id);if(t.emit)t.emit("itemAdded",{id:l.id,item:{element:d,config:l}});return this},removeItem(l){let d=n.get(l);if(!d)return this;if(ts(d.element,i).forEach((c)=>{let C=c.dataset.id;if(C)n.delete(C)}),r?.config.id===l)r=null;let f=d.element.closest(`.${i}-${le.ITEM_CONTAINER}`);if(f)f.remove();if(n.delete(l),t.emit)t.emit("itemRemoved",{id:l,item:d});return this},getItem:(l)=>n.get(l),getAllItems:()=>Array.from(n.values()),getActive:()=>r,getItemPath:(l)=>o(l),setActive(l){let d=n.get(l);if(!d||d.config.disabled)return this;if(r)a(r.element,r,!1);if(a(d.element,d,!0),r=d,o(l).forEach((f)=>{let c=n.get(f);if(c){let C=c.element,g=C.closest(`.${i}-${le.ITEM_CONTAINER}`);if(g){let m=g.querySelector(`.${i}-${le.NESTED_CONTAINER}`);if(m)C.setAttribute("aria-expanded","true"),m.hidden=!1}}}),t.emit)t.emit(fu.CHANGE,{id:l,item:d,previousItem:r,path:o(l)});return this}}};var it={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 pu=(e)=>(t)=>{let n=e.prefix||"mtrl",r=(a,o)=>{if(!a)return;let l=a.getAttribute("role");if(o){if(a.classList.add(`${n}-${it.ITEM}--active`),l==="tab")a.setAttribute("aria-selected","true"),a.setAttribute("tabindex","0");else if(!a.getAttribute("aria-haspopup"))a.setAttribute("aria-current","page")}else if(a.classList.remove(`${n}-${it.ITEM}--active`),l==="tab")a.setAttribute("aria-selected","false"),a.setAttribute("tabindex","-1");else if(a.hasAttribute("aria-current"))a.removeAttribute("aria-current")},i=(a)=>{if(a.getAttribute("aria-expanded")===null)return!1;let l=a.getAttribute("aria-expanded")==="true";a.setAttribute("aria-expanded",(!l).toString());let d=a.closest(`.${n}-${it.ITEM_CONTAINER}, .mtrl-nav-item-container`);if(d){let f=d.querySelector(`.${n}-${it.NESTED_CONTAINER}, .mtrl-nav-nested-container`);if(f){f.hidden=l;let c=a.querySelector(`.${n}-${it.EXPAND_ICON}, .mtrl-nav-expand-icon`);if(c&&c.style)c.style.transform=l?"":"rotate(90deg)"}}let u=a.dataset.id;if(u&&t.emit)t.emit("expandToggle",{id:u,expanded:!l});return!0},s={...t,handleItemClick(a){if(!t.items)return;let o=t.items.get(a);if(!o)return;let l=t.element.querySelector(`.${n}-${it.ITEM}--active, .mtrl-nav-item--active`);if(l)r(l,!1);if(o.element)r(o.element,!0);if(t.emit){let d=t.getItemPath?t.getItemPath(a):[];t.emit("change",{id:a,item:o,previousItem:l?{element:l,config:{id:l.dataset.id}}:null,path:d,source:"userAction"})}}};return t.element.addEventListener("click",(a)=>{let o=a.target,l=o.closest(`.${n}-${it.ITEM}, .mtrl-nav-item`);if(!l){if(!o.closest("[data-id]"))return}let d=l||o.closest("[data-id]");if(d.hasAttribute("disabled")||d.getAttribute("aria-disabled")==="true")return;let u=d.dataset.id;if(!u)return;if(i(d))return;s.handleItemClick(u)}),t.element.addEventListener("keydown",(a)=>{if(!["Enter"," ","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"].includes(a.key))return;let o=["rail","drawer"].includes(t.variant||""),l=["bar"].includes(t.variant||"");if(a.key==="Enter"||a.key===" "){let C=document.activeElement;if(C&&C.classList.contains(`${n}-${it.ITEM}`)){if(a.preventDefault(),C.dataset.id)C.click()}return}let d=Array.from(t.element.querySelectorAll(`.${n}-${it.ITEM}:not([disabled]):not([aria-disabled="true"]),
|
|
23
|
+
.mtrl-nav-item:not([disabled]):not([aria-disabled="true"])`));if(d.length===0)return;let u=document.activeElement,f=d.indexOf(u),c=-1;if(o&&(a.key==="ArrowDown"||a.key==="ArrowRight")||l&&a.key==="ArrowRight")c=f<0?0:(f+1)%d.length;else if(o&&(a.key==="ArrowUp"||a.key==="ArrowLeft")||l&&a.key==="ArrowLeft")c=f<0?d.length-1:(f-1+d.length)%d.length;else if(a.key==="Home")c=0;else if(a.key==="End")c=d.length-1;if(c>=0)a.preventDefault(),d[c].focus()}),s};ne();var Dg={variant:un.VARIANT,position:un.POSITION,behavior:un.BEHAVIOR,items:[],showLabels:un.SHOW_LABELS,scrimEnabled:un.SCRIM_ENABLED},hu=(e={})=>_(Dg,e,"nav"),Cu=(e)=>{let t=e.variant?`${e.prefix}-${le.VARIANT_PREFIX}${e.variant}`:"",n=e.position?`${e.prefix}-${le.POSITION_PREFIX}${e.position}`:"",r=e.class||"",i=[t,n,r].filter(Boolean);return V(e,{tag:"nav",attributes:{role:"navigation","aria-label":e.ariaLabel||"Main Navigation"},className:i})},Eu=(e)=>({disabled:{enable:e.disabled?.enable||(()=>{}),disable:e.disabled?.disable||(()=>{})},lifecycle:{destroy:e.lifecycle?.destroy||(()=>{})}});var Mg=(e,t)=>{let{element:n}=e,r=t.variant||"rail",i=t.prefix||"mtrl";if(n.setAttribute("aria-label",t.ariaLabel||"Main Navigation"),r==="bar")if(!t.items?.some((a)=>a.items?.length))n.setAttribute("role","tablist"),n.setAttribute("aria-orientation","horizontal");else n.setAttribute("role","menubar"),n.setAttribute("aria-orientation","horizontal");else n.setAttribute("role","navigation");if((r==="modal"||r==="drawer"&&t.behavior==="dismissible")&&!t.expanded)n.classList.add(`${i}-nav--hidden`)},Og=(e={})=>{let t=hu(e);try{let r=M(D,k(),O(Cu(t)),oe(t),In(t),gu(t),pu(t),de(t),P(),(i)=>mu(Eu(i))(i))(t);if(Mg(r,t),t.disabled)r.disable();if(r.element.dataset.componentType="navigation",t.variant)r.element.dataset.variant=t.variant;return r}catch(n){throw Error(`Failed to create navigation: ${n instanceof Error?n.message:String(n)}`)}},cn=Og;var bu=(e={})=>({rail:null,drawer:null,activeSection:e.activeSection||null,activeSubsection:e.activeSubsection||null,items:e.items||{},mouseInDrawer:!1,mouseInRail:!1,hoverTimer:null,closeTimer:null,processingChange:!1,isMobile:!1,overlayElement:null,closeButtonElement:null,resizeObserver:null,outsideClickHandler:null,outsideClickHandlerSet:!1}),ns=(e={})=>({animateDrawer:e.animateDrawer!==!1,showLabelsOnRail:e.showLabelsOnRail!==!1,hideDrawerOnClick:e.hideDrawerOnClick||!1,expanded:e.expanded===!0,hoverDelay:e.hoverDelay||200,closeDelay:e.closeDelay||100,railOptions:e.railOptions||{},drawerOptions:e.drawerOptions||{}}),rs=(e={})=>({breakpoint:e.breakpoint||960,lockBodyScroll:e.lockBodyScroll!==!1,hideOnClickOutside:e.hideOnClickOutside!==!1,enableSwipeGestures:e.enableSwipeGestures!==!1,optimizeForTouch:e.optimizeForTouch!==!1,overlayClass:e.overlayClass||"mtrl-nav-overlay",closeButtonClass:e.closeButtonClass||"mtrl-nav-close-btn",bodyLockClass:e.bodyLockClass||"mtrl-body-drawer-open"});xn();var vu=(e,t,n,r)=>{if(!e.drawer||!t||!e.items[t])return;let s=e.items[t].items||[];if(s.length===0){r();return}let a=e.drawer.getAllItems();if(a?.length>0)a.forEach((o)=>{e.drawer.removeItem(o.config.id)});s.forEach((o)=>{e.drawer.addItem(o)}),n()},Tu=(e,t)=>{let n=Object.keys(e.items||{}).map((i)=>({id:i,label:e.items[i]?.label||i,icon:e.items[i]?.icon||"",active:i===e.activeSection})),r=cn({variant:"rail",position:"left",showLabels:t.showLabelsOnRail,items:n,...t.railOptions});return document.body.appendChild(r.element),r},Su=(e,t)=>{let n=cn({variant:"drawer",position:"left",items:[],...t.drawerOptions});if(document.body.appendChild(n.element),n.element.dataset.id="drawer",!t.expanded)n.element.classList.add("mtrl-nav--hidden"),n.element.setAttribute("aria-hidden","true");return n},yu=(e,t)=>{if(!e.drawer)return;if(e.drawer.element.classList.remove("mtrl-nav--hidden"),e.drawer.element.setAttribute("aria-hidden","false"),e.isMobile){if(e.overlayElement)e.overlayElement.classList.add("active"),e.overlayElement.setAttribute("aria-hidden","false");if(t.lockBodyScroll)document.body.classList.add(t.bodyLockClass);if(e.closeButtonElement)e.closeButtonElement.style.display="flex"}},xu=(e,t)=>{if(!e.drawer)return;if(e.drawer.element.classList.add("mtrl-nav--hidden"),e.drawer.element.setAttribute("aria-hidden","true"),e.overlayElement)e.overlayElement.classList.remove("active"),e.overlayElement.setAttribute("aria-hidden","true");if(t.lockBodyScroll)document.body.classList.remove(t.bodyLockClass)},Iu=(e)=>{if(!e.drawer)return!1;return!e.drawer.element.classList.contains("mtrl-nav--hidden")},Lu=(e,t,n,r,i)=>{let s=e.isMobile;if(e.isMobile=window.innerWidth<=t.breakpoint||Sa(),s!==e.isMobile){if(e.isMobile)n();else r();if(i.onViewChange)i.onViewChange({mobile:e.isMobile,previousMobile:s,width:window.innerWidth})}},Au=(e)=>{if(e.overlayElement&&e.overlayElement.parentNode)e.overlayElement.parentNode.removeChild(e.overlayElement),e.overlayElement=null;if(e.rail)e.rail.destroy(),e.rail=null;if(e.drawer)e.drawer.destroy(),e.drawer=null;e.activeSection=null,e.activeSubsection=null,e.mouseInDrawer=!1,e.mouseInRail=!1,e.processingChange=!1,e.isMobile=!1},wu=(e,t,n,r)=>{if(!t||!e.items[t])return;if(e.activeSection===t&&e.activeSubsection===n)return;if(e.activeSection=t,e.rail)e.rail.setActive(t,r);if(n&&e.drawer)e.activeSubsection=n,e.drawer.setActive(n,r)};var Nu=(e,t,n,r,i,s)=>{let a=e.rail;if(!a)return;a.on("change",(o)=>{let l=o?.id;if(!l||e.processingChange)return;let d=o?.source==="userAction";if(e.processingChange=!0,e.activeSection=l,n(l),s.onSectionChange&&d)s.onSectionChange(l,{source:d?"userClick":"programmatic"});setTimeout(()=>{e.processingChange=!1},50)}),a.on("mouseover",(o)=>{let l=o?.id;if(e.mouseInRail=!0,clearTimeout(e.hoverTimer),e.hoverTimer=null,l)if(e.items[l]?.items?.length>0)e.hoverTimer=window.setTimeout(()=>{n(l)},t.hoverDelay);else e.closeTimer=window.setTimeout(()=>{if(e.mouseInRail&&!e.mouseInDrawer)i()},t.hoverDelay)}),a.on("mouseenter",()=>{e.mouseInRail=!0,clearTimeout(e.closeTimer),e.closeTimer=null}),a.on("mouseleave",()=>{if(e.mouseInRail=!1,clearTimeout(e.hoverTimer),e.hoverTimer=null,!e.mouseInDrawer)e.closeTimer=window.setTimeout(()=>{if(!e.mouseInRail&&!e.mouseInDrawer)i()},t.closeDelay)})},Du=(e,t,n,r)=>{let i=e.drawer;if(!i)return;if(typeof i.on==="function")i.on("change",(s)=>{let a=s.id;if(e.activeSubsection=a,t.hideDrawerOnClick)n();if(r.onItemSelect)r.onItemSelect(s)}),i.on("mouseenter",()=>{e.mouseInDrawer=!0,clearTimeout(e.hoverTimer),clearTimeout(e.closeTimer),e.hoverTimer=null,e.closeTimer=null}),i.on("mouseleave",()=>{if(e.mouseInDrawer=!1,!e.mouseInRail)e.closeTimer=window.setTimeout(()=>{if(!e.mouseInDrawer&&!e.mouseInRail)n()},t.closeDelay)})},Mu=(e,t)=>{if(window.ResizeObserver)e.resizeObserver=new ResizeObserver(()=>{t()}),e.resizeObserver.observe(document.body);else window.addEventListener("resize",t);window.addEventListener("orientationchange",()=>{setTimeout(t,100)})},Ou=(e,t)=>{if(e.resizeObserver)e.resizeObserver.disconnect(),e.resizeObserver=null;else window.removeEventListener("resize",t);if(window.removeEventListener("orientationchange",t),e.outsideClickHandler){let n="ontouchend"in window?"touchend":"click";document.removeEventListener(n,e.outsideClickHandler)}clearTimeout(e.hoverTimer),clearTimeout(e.closeTimer),e.hoverTimer=null,e.closeTimer=null};xn();var Rg=(e,t,n)=>{if(e.overlayElement)return e.overlayElement;return e.overlayElement=document.createElement("div"),e.overlayElement.className=t.overlayClass,e.overlayElement.setAttribute("aria-hidden","true"),document.body.appendChild(e.overlayElement),e.overlayElement.addEventListener("click",(r)=>{if(r.target===e.overlayElement)n()}),e.overlayElement},_g=(e,t,n)=>{if(!e.drawer||e.closeButtonElement)return null;if(e.closeButtonElement=document.createElement("button"),e.closeButtonElement.className=t.closeButtonClass,e.closeButtonElement.setAttribute("aria-label","Close navigation"),e.closeButtonElement.innerHTML=`
|
|
24
24
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
25
25
|
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
26
26
|
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
27
27
|
</svg>
|
|
28
|
-
`,e.closeButtonElement.addEventListener("click",()=>{n()}),ze()&&t.optimizeForTouch)e.closeButtonElement.style.minWidth=`${Xr.COMFORTABLE}px`,e.closeButtonElement.style.minHeight=`${Xr.COMFORTABLE}px`,e.closeButtonElement.addEventListener("touchstart",()=>{e.closeButtonElement.classList.add("active")},{passive:!0}),e.closeButtonElement.addEventListener("touchend",()=>{setTimeout(()=>{e.closeButtonElement.classList.remove("active")},gt.FEEDBACK_DURATION)},{passive:!0});return e.drawer.element.appendChild(e.closeButtonElement),e.closeButtonElement},ku=(e,t,n,r)=>{let{drawer:i,rail:s}=e;if(!i||!s)return;if(Pg(e,t,n),kg(e,t,n),Bg(e,t,n,r),t.enableSwipeGestures&&ze())Hg(e,n,r);n()},Bg=(e,t,n,r)=>{if(!t.hideOnClickOutside)return;if(e.outsideClickHandlerSet)return;e.outsideClickHandlerSet=!0;let i=ze()?"touchend":"click",s=(a)=>{if(!e.isMobile||!r())return;let l=Je(a).target;if(e.drawer.element.contains(l)||e.rail.element.contains(l))return;n()};e.outsideClickHandler=s,document.addEventListener(i,s,ze()?{passive:!0}:!1)},Hg=(e,t,n,r)=>{let{drawer:i,rail:s}=e;if(!i||!s)return;let a=0,o=0;s.element.addEventListener("touchstart",(l)=>{let d=l.touches[0];a=d.clientX,o=d.clientY},{passive:!0}),s.element.addEventListener("touchmove",(l)=>{if(!e.isMobile||n()||!r)return;let d=l.touches[0],u=d.clientX-a,f=d.clientY-o;if(Math.abs(u)>Math.abs(f)&&u>gt.SWIPE_THRESHOLD)r()},{passive:!0}),i.element.addEventListener("touchstart",(l)=>{let d=l.touches[0];a=d.clientX,o=d.clientY},{passive:!0}),i.element.addEventListener("touchmove",(l)=>{if(!e.isMobile||!n())return;let u=l.touches[0].clientX-a;if(u<0){if(i.element.style.transform=`translateX(${u/2}px)`,u<-gt.SWIPE_THRESHOLD)t()}},{passive:!0}),i.element.addEventListener("touchend",()=>{if(i.element.style.transform)i.element.style.transition="transform 0.2s ease",i.element.style.transform="",setTimeout(()=>{i.element.style.transition=""},200)},{passive:!0})},Bu=(e,t)=>{if(e.overlayElement)e.overlayElement.classList.remove("active"),e.overlayElement.setAttribute("aria-hidden","true");if(e.closeButtonElement)e.closeButtonElement.style.display="none";document.body.classList.remove(t.bodyLockClass)};var $g=(e={})=>{let t=Su(e),n=ns(e),r=rs(e),i={initialize:()=>i,cleanup:()=>{},navigateTo:()=>{},getRail:()=>t.rail,getDrawer:()=>t.drawer,getActiveSection:()=>t.activeSection,getActiveSubsection:()=>t.activeSubsection,showDrawer:()=>{},hideDrawer:()=>{},isDrawerVisible:()=>!1,configure:()=>i,setProcessingChange:()=>{},isProcessingChange:()=>!1,isMobile:()=>t.isMobile,checkMobileState:()=>{},onSectionChange:void 0,onItemSelect:void 0,onViewChange:void 0},s=()=>Lu(t,r),a=()=>Au(t,r),o=()=>wu(t),l=(m)=>{yu(t,m,s,a)},d=()=>{ku(t,r,a,o)},u=()=>{Nu(t,r,d,()=>Bu(t,r),i)},f=(m,p,h)=>{Mu(t,m,p,h)},c=()=>{if(t.rail=xu(t,n),t.drawer=Iu(t,n),Ou(t,n,l,s,a,i),Ru(t,n,a,i),_u(t,u),e.activeSection&&t.items[e.activeSection]){if(t.activeSection=e.activeSection,t.rail)t.rail.setActive(e.activeSection);if(l(e.activeSection),e.expanded===!0)s();else a()}return u(),i},C=()=>{Pu(t,u),Du(t)},g=(m)=>(Object.assign(e,m),Object.assign(n,ns({...e,...m})),Object.assign(r,rs({...e,...m})),i);return i.initialize=c,i.cleanup=C,i.navigateTo=f,i.showDrawer=s,i.hideDrawer=a,i.isDrawerVisible=o,i.configure=g,i.setProcessingChange=(m)=>{t.processingChange=m},i.isProcessingChange=()=>t.processingChange,i.isMobile=()=>t.isMobile,i.checkMobileState=u,i},Hu=$g;li();se();te();re();var $u=(e)=>(t)=>{let n=[],r=t.getClass("radios"),i=e.value||"";if(t.element.classList.add(`${r}--${e.direction||"vertical"}`),e.disabled)t.element.classList.add(`${r}--disabled`);let s=(l)=>{let d=document.createElement("div");d.classList.add(`${r}-item`);let u=document.createElement("input");if(u.type="radio",u.name=e.name,u.value=l.value,u.classList.add(`${r}-input`),i===l.value)u.checked=!0;if(e.disabled||l.disabled)u.disabled=!0,d.classList.add(`${r}-item--disabled`);let f=document.createElement("label");f.classList.add(`${r}-label`);let c=document.createElement("span");c.classList.add(`${r}-control`);let C=document.createElement("span");if(C.classList.add(`${r}-circle`),e.ripple!==!1){let h=document.createElement("span");h.classList.add(`${r}-ripple`),c.appendChild(h)}c.appendChild(C);let g=document.createElement("span");if(g.classList.add(`${r}-text`),g.textContent=l.label,l.labelBefore)f.classList.add(`${r}-label--before`),f.appendChild(g),f.appendChild(c);else f.appendChild(c),f.appendChild(g);let m=`${r}-${l.value}-${Math.random().toString(36).substring(2,9)}`;u.id=m,f.htmlFor=m,d.appendChild(u),d.appendChild(f);let p=(h)=>{if(u.checked){if(i=l.value,n.forEach((b)=>{if(b.input!==u)b.input.checked=!1}),t.events&&typeof t.events.emit==="function")t.events.emit("change",{value:l.value,originalEvent:h,option:l});else if(typeof t.on==="function"){let b=new CustomEvent("change",{detail:{value:l.value,originalEvent:h,option:l}});t.element.dispatchEvent(b)}}};return u.addEventListener("change",p),{element:d,input:u,label:f,config:l,destroy:()=>{if(u.removeEventListener("change",p),d.parentNode)d.parentNode.removeChild(d)}}},a=(l)=>{let d=s(l);return t.element.appendChild(d.element),n.push(d),t},o=(l)=>{let d=n.findIndex((u)=>u.config.value===l);if(d!==-1){if(n[d].destroy(),n.splice(d,1),i===l)i=""}return t};if(e.options&&Array.isArray(e.options))e.options.forEach((l)=>a(l));if(!t.events)t.events={on:(l,d)=>{t.element.addEventListener(l,(u)=>d(u.detail))},off:(l,d)=>{t.element.removeEventListener(l,d)},emit:(l,d)=>{let u=new CustomEvent(l,{detail:d});t.element.dispatchEvent(u)}};return{...t,radios:n,getValue:()=>i,setValue:(l)=>(i=l,n.forEach((d)=>{d.input.checked=d.config.value===l}),t),getSelected:()=>{let l=n.find((d)=>d.config.value===i);return l?l.config:null},addOption:a,removeOption:o,enable:()=>(t.element.classList.remove(`${r}--disabled`),n.forEach((l)=>{if(l.input.disabled=l.config.disabled||!1,!l.config.disabled)l.element.classList.remove(`${r}-item--disabled`)}),t),disable:()=>(t.element.classList.add(`${r}--disabled`),n.forEach((l)=>{l.input.disabled=!0,l.element.classList.add(`${r}-item--disabled`)}),t),enableOption:(l)=>{let d=n.find((u)=>u.config.value===l);if(d){if(d.config.disabled=!1,d.input.disabled=t.element.classList.contains(`${r}--disabled`),!d.input.disabled)d.element.classList.remove(`${r}-item--disabled`)}return t},disableOption:(l)=>{let d=n.find((u)=>u.config.value===l);if(d)d.config.disabled=!0,d.input.disabled=!0,d.element.classList.add(`${r}-item--disabled`);return t}}};var Vu=({disabled:e,lifecycle:t})=>(n)=>{if(!n.events)n.events={on:(i,s)=>{n.element.addEventListener(i,(a)=>s(a.detail))},off:(i,s)=>{n.element.removeEventListener(i,s)},emit:(i,s)=>{let a=new CustomEvent(i,{detail:s});n.element.dispatchEvent(a)}};else if(!n.events.emit)n.events.emit=(i,s)=>{let a=new CustomEvent(i,{detail:s});n.element.dispatchEvent(a)};return{element:n.element,radios:n.radios,lifecycle:{destroy:t.destroy},getClass:n.getClass,getValue:()=>n.getValue(),setValue(i){return n.setValue(i),this},getSelected:()=>n.getSelected(),addOption(i){return n.addOption(i),this},removeOption(i){return n.removeOption(i),this},enable(){return e.enable(),this},disable(){return e.disable(),this},enableOption(i){return n.enableOption(i),this},disableOption(i){return n.disableOption(i),this},on(i,s){return n.events.on(i,s),this},off(i,s){return n.events.off(i,s),this},destroy(){n.radios.forEach((i)=>i.destroy()),t.destroy()}}};ne();var Vg={name:"",direction:"vertical",disabled:!1,ripple:!0,options:[]},Fu=(e)=>_(Vg,e,"radios"),Uu=(e)=>V(e,{tag:"div",attributes:{role:"radiogroup"},className:e.class}),Gu=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable()},lifecycle:{destroy:()=>e.lifecycle.destroy()}});var Fg=(e)=>{if(!e.name)e.name=`radios-${Math.random().toString(36).substring(2,9)}`;let t=Fu(e);try{return M(D,k(),O(Uu(t)),$u(t),de(t),P(),(r)=>Vu(Gu(r))(r))(t)}catch(n){throw console.error("Radios creation error:",n),Error(`Failed to create radios component: ${n.message}`)}},ss=Fg;te();re();var _e={BAR:"bar",VIEW:"view"},Ut={DOCKED:"docked",FULLSCREEN:"fullscreen"},os={BAR_HEIGHT:56,BAR_MIN_WIDTH:360,BAR_MAX_WIDTH:720,VIEW_DOCKED_HEADER_HEIGHT:56,VIEW_DOCKED_MIN_WIDTH:360,VIEW_DOCKED_MAX_WIDTH:720,VIEW_DOCKED_MIN_HEIGHT:240,VIEW_FULLSCREEN_HEADER_HEIGHT:72,PADDING_HORIZONTAL:16,ICON_SIZE:24,AVATAR_SIZE:30,ICON_SPACING:16},Gt={FOCUS:"focus",BLUR:"blur",INPUT:"input",SUBMIT:"submit",CLEAR:"clear",EXPAND:"expand",COLLAPSE:"collapse",SUGGESTION_SELECT:"suggestionSelect"},mt={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>',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>',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>',MIC:'<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 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z"/></svg>',HISTORY:'<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="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"/></svg>'},mn={STATE:_e.BAR,VIEW_MODE:Ut.DOCKED,PLACEHOLDER:"Search",VALUE:"",SHOW_CLEAR_BUTTON:!0,DISABLED:!1,FULL_WIDTH:!1},z={ROOT:"search",STATE_BAR:"search--bar",STATE_VIEW:"search--view",VIEW_DOCKED:"search--docked",VIEW_FULLSCREEN:"search--fullscreen",FOCUSED:"search--focused",DISABLED:"search--disabled",POPULATED:"search--populated",FULL_WIDTH:"search--full-width",CONTAINER:"search__container",HEADER:"search__header",INPUT_WRAPPER:"search__input-wrapper",INPUT:"search__input",DIVIDER:"search__divider",CONTENT:"search__content",LEADING_ICON:"search__leading-icon",TRAILING_ICON:"search__trailing-icon",CLEAR_BUTTON:"search__clear-button",CLEAR_BUTTON_HIDDEN:"search__clear-button--hidden",AVATAR:"search__avatar",SUGGESTIONS:"search__suggestions",SUGGESTION_LIST:"search__suggestion-list",SUGGESTION_ITEM:"search__suggestion-item",SUGGESTION_ITEM_SELECTED:"search__suggestion-item--selected",SUGGESTION_ICON:"search__suggestion-icon",SUGGESTION_TEXT:"search__suggestion-text",SUGGESTION_DIVIDER:"search__suggestion-divider"},fn={ENTER:"Enter",ESCAPE:"Escape",ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",TAB:"Tab"};Qe();var ls=(e)=>(t)=>{let n=e.disabled===!0,r=e.initialState||_e.BAR,i=r===_e.VIEW,s=e.placeholder||"Search",a=e.value||"",o=(S)=>t.getClass?t.getClass(S):S,l=[o(z.ROOT),o(r===_e.BAR?z.STATE_BAR:z.STATE_VIEW),o(e.viewMode==="fullscreen"?z.VIEW_FULLSCREEN:z.VIEW_DOCKED)];if(e.fullWidth)l.push(o(z.FULL_WIDTH));if(n)l.push(o(z.DISABLED));if(a)l.push(o(z.POPULATED));t.element.className=l.filter(Boolean).join(" "),t.element.setAttribute("role","search"),t.element.setAttribute("aria-disabled",n?"true":"false");let d=B({tag:"div",className:o(z.CONTAINER),container:t.element}),u=i?mt.BACK:e.leadingIcon||mt.SEARCH,f=B({tag:"button",className:o(z.LEADING_ICON),container:d,html:u,attributes:{type:"button",tabindex:n?"-1":"0","aria-label":i?"Go back":"Search"}}),c=B({tag:"div",className:o(z.INPUT_WRAPPER),container:d}),C={type:"text",placeholder:s,"aria-label":s};if(a)C.value=a;if(n)C.disabled="disabled";let g=B({tag:"input",className:o(z.INPUT),container:c,attributes:C});if(a)g.value=a;let m=null;if(e.showClearButton!==!1){let S=[o(z.CLEAR_BUTTON)];if(!a)S.push(o(z.CLEAR_BUTTON_HIDDEN));m=B({tag:"button",className:S.join(" "),container:d,html:mt.CLEAR,attributes:{type:"button",tabindex:n||!a?"-1":"0","aria-label":"Clear search"}})}let p=null;if(e.trailingItems&&e.trailingItems.length>0)p=B({tag:"div",className:o("search__trailing"),container:d}),e.trailingItems.forEach((S)=>{let y=S.type==="avatar"?o(z.AVATAR):o(z.TRAILING_ICON);B({tag:S.type==="avatar"?"div":"button",className:y,container:p,html:S.content,attributes:{...S.type!=="avatar"&&{type:"button"},tabindex:n?"-1":"0","aria-label":S.ariaLabel||"","data-trailing-id":S.id}})});let h=null,b=null,v=null,E=null;if(h=B({tag:"div",className:o(z.DIVIDER)}),b=B({tag:"div",className:o(z.CONTENT)}),v=B({tag:"div",className:o(z.SUGGESTIONS),container:b}),E=B({tag:"ul",className:o(z.SUGGESTION_LIST),container:v,attributes:{role:"listbox","aria-label":"Search suggestions"}}),i)t.element.appendChild(h),t.element.appendChild(b);return{...t,structure:{container:d,input:g,inputWrapper:c,leadingIcon:f,clearButton:m,trailingContainer:p,divider:h,suggestionsContainer:v,suggestionsList:E}}};var ds=(e)=>(t)=>{let n=e.initialState||_e.BAR,r=e.viewMode||Ut.DOCKED,i=e.disabled===!0,s=(C)=>t.getClass?t.getClass(C):C,a=()=>{if(n===_e.VIEW||i)return;let{element:C,structure:g}=t;if(n=_e.VIEW,C.classList.remove(s(z.STATE_BAR)),C.classList.add(s(z.STATE_VIEW)),g?.leadingIcon)g.leadingIcon.innerHTML=mt.BACK,g.leadingIcon.setAttribute("aria-label","Go back");if(g?.divider&&!C.contains(g.divider))C.appendChild(g.divider);if(g?.suggestionsContainer?.parentElement&&!C.contains(g.suggestionsContainer.parentElement))C.appendChild(g.suggestionsContainer.parentElement);if(g?.input)requestAnimationFrame(()=>{g.input.focus()});if(t.emit)t.emit("expand",{component:t,state:n,viewMode:r})},o=()=>{if(n===_e.BAR)return;let{element:C,structure:g}=t;if(n=_e.BAR,C.classList.remove(s(z.STATE_VIEW)),C.classList.add(s(z.STATE_BAR)),g?.leadingIcon)g.leadingIcon.innerHTML=e.leadingIcon||mt.SEARCH,g.leadingIcon.setAttribute("aria-label","Search");if(g?.divider&&C.contains(g.divider))C.removeChild(g.divider);if(g?.suggestionsContainer?.parentElement&&C.contains(g.suggestionsContainer.parentElement))C.removeChild(g.suggestionsContainer.parentElement);if(t.emit)t.emit("collapse",{component:t,state:n,viewMode:r})},l=(C)=>{if(C===r)return;let g=t.element;g.classList.remove(s(r===Ut.DOCKED?z.VIEW_DOCKED:z.VIEW_FULLSCREEN)),r=C,g.classList.add(s(C===Ut.DOCKED?z.VIEW_DOCKED:z.VIEW_FULLSCREEN))},d=()=>{i=!0;let{element:C,structure:g}=t;if(C.classList.add(s(z.DISABLED)),C.setAttribute("aria-disabled","true"),g?.input)g.input.disabled=!0;let m=[g?.leadingIcon,g?.clearButton].filter(Boolean);if(g?.trailingContainer)g.trailingContainer.querySelectorAll("button").forEach((h)=>m.push(h));m.forEach((p)=>{if(p)p.tabIndex=-1,p.setAttribute("aria-disabled","true")})},u=()=>{i=!1;let{element:C,structure:g}=t;if(C.classList.remove(s(z.DISABLED)),C.setAttribute("aria-disabled","false"),g?.input)g.input.disabled=!1;let m=[g?.leadingIcon,g?.clearButton].filter(Boolean);if(g?.trailingContainer)g.trailingContainer.querySelectorAll("button").forEach((h)=>m.push(h));if(m.forEach((p)=>{if(p)p.tabIndex=0,p.setAttribute("aria-disabled","false")}),g?.clearButton&&g.input&&!g.input.value)g.clearButton.tabIndex=-1},f=(C)=>{let g=t.element;if(C)g.classList.add(s(z.POPULATED));else g.classList.remove(s(z.POPULATED))},c=(C)=>{let g=t.element;if(C)g.classList.add(s(z.FOCUSED));else g.classList.remove(s(z.FOCUSED))};if(i)setTimeout(()=>{d()},0);return{...t,states:{expand:a,collapse:o,getState:()=>n,isExpanded:()=>n===_e.VIEW,setViewMode:l,getViewMode:()=>r,updatePopulatedState:f,updateFocusedState:c},disabled:{enable(){return u(),this},disable(){return d(),this},isDisabled:()=>i}}};var zu=(e)=>{if(!e)return[];return e.map((t)=>{if(typeof t==="string")return{text:t,value:t};return{...t,value:t.value??t.text}})},us=(e)=>(t)=>{let n=e.value||"",r=e.placeholder||"Search",i=zu(e.suggestions),s=(S)=>t.getClass?t.getClass(S):S,a=(S,y=null,L={})=>{let I={component:t,value:n,originalEvent:y,preventDefault:()=>{I.defaultPrevented=!0},defaultPrevented:!1,...L};return I},o=(S,y=null,L={})=>{let I=a(S,y,L);if(t.emit)t.emit(S,I);let x=`on${S.charAt(0).toUpperCase()}${S.slice(1)}`,A=e[x];if(typeof A==="function")if(S==="suggestionSelect"&&L.suggestion)A(L.suggestion);else A(n);return I},l=(S)=>{let y=t.structure?.clearButton;if(!y)return;if(S){if(y.classList.remove(s(z.CLEAR_BUTTON_HIDDEN)),!t.disabled?.isDisabled())y.tabIndex=0}else y.classList.add(s(z.CLEAR_BUTTON_HIDDEN)),y.tabIndex=-1},d=(S,y=!0)=>{let L=n;n=S;let I=t.structure?.input;if(I&&I.value!==S)I.value=S;if(l(!!S),t.states?.updatePopulatedState)t.states.updatePopulatedState(!!S);if(y&&S!==L)o(Gt.INPUT)},u=()=>n,f=(S)=>{r=S;let y=t.structure?.input;if(y)y.placeholder=S,y.setAttribute("aria-label",S)},c=()=>r,C=(S=!0)=>{d("",!1);let y=t.structure?.input;if(y&&!t.disabled?.isDisabled())y.focus();if(S)o(Gt.CLEAR)},g=()=>{if(n)o(Gt.SUBMIT)},m=()=>{let S=t.structure?.input;if(S&&!t.disabled?.isDisabled())S.focus()},p=()=>{let S=t.structure?.input;if(S)S.blur()},h=(S)=>{i=zu(S)},b=()=>[...i],v=()=>{i=[]},E=(S)=>{d(S.value??S.text,!1),o(Gt.SUGGESTION_SELECT,null,{suggestion:S})},T=()=>{let S=t.structure?.input,y=t.structure?.clearButton,L=t.structure?.leadingIcon;if(!S)return;if(S.addEventListener("input",(I)=>{let x=I.target;d(x.value,!0)}),S.addEventListener("focus",(I)=>{if(t.states?.updateFocusedState)t.states.updateFocusedState(!0);if(o(Gt.FOCUS,I),e.expandOnFocus!==!1&&t.states?.expand)t.states.expand()}),S.addEventListener("blur",(I)=>{if(t.states?.updateFocusedState)t.states.updateFocusedState(!1);if(o(Gt.BLUR,I),e.collapseOnBlur!==!1&&t.states?.collapse){let x=e.collapseDelay??150;setTimeout(()=>{if(document.activeElement!==S)t.states.collapse()},x)}}),S.addEventListener("keydown",(I)=>{switch(I.key){case"Enter":I.preventDefault(),g();break;case"Escape":if(I.preventDefault(),n)C();else if(t.states?.isExpanded?.())t.states.collapse();break;case"ArrowDown":break;case"ArrowUp":break}}),y)y.addEventListener("click",(I)=>{I.preventDefault(),I.stopPropagation(),C()}),y.addEventListener("keydown",(I)=>{if(I.key==="Enter"||I.key===" ")I.preventDefault(),C()});if(L)L.addEventListener("click",(I)=>{if(I.preventDefault(),t.states?.isExpanded?.())t.states.collapse();else t.states?.expand()}),L.addEventListener("keydown",(I)=>{if(I.key==="Enter"||I.key===" ")if(I.preventDefault(),t.states?.isExpanded?.())t.states.collapse();else t.states?.expand()})};return setTimeout(()=>{T()},0),{...t,input:{setValue:d,getValue:u,setPlaceholder:f,getPlaceholder:c,clear:C,submit:g,focus:m,blur:p,setSuggestions:h,getSuggestions:b,clearSuggestions:v,selectSuggestion:E,emitEvent:o}}};Qe();var cs=(e)=>(t)=>{let n=-1,r=[],i=(h)=>t.getClass?t.getClass(h):h,s=()=>{if(t.input?.getSuggestions)return t.input.getSuggestions();return r},a=(h,b)=>{if(!b)return h;let v=h.toLowerCase(),E=b.toLowerCase(),T=v.indexOf(E);if(T===-1)return h;let S=h.slice(0,T),y=h.slice(T,T+b.length),L=h.slice(T+b.length);return`${S}<strong>${y}</strong>${L}`},o=(h,b,v)=>{let E=b===n,T=[i(z.SUGGESTION_ITEM)];if(E)T.push(i(z.SUGGESTION_ITEM_SELECTED));let S=B({tag:"li",className:T.join(" "),attributes:{role:"option","aria-selected":E?"true":"false","data-index":String(b),"data-value":h.value??h.text,tabindex:"-1"}});if(h.icon){let L=B({tag:"span",className:i(z.SUGGESTION_ICON),container:S,html:h.icon})}else{let L=B({tag:"span",className:i(z.SUGGESTION_ICON),container:S,html:mt.HISTORY})}let y=B({tag:"span",className:i(z.SUGGESTION_TEXT),container:S,html:a(h.text,v)});return S},l=()=>B({tag:"li",className:i(z.SUGGESTION_DIVIDER),attributes:{role:"separator","aria-hidden":"true"}}),d=()=>{let h=t.structure?.suggestionsList;if(!h)return;let b=s(),v=t.input?.getValue?.()||"";if(h.innerHTML="",b.length===0)return;let E;b.forEach((S,y)=>{if(S.group&&S.group!==E){if(E!==void 0)h.appendChild(l());E=S.group}let L=o(S,y,v);L.addEventListener("click",(I)=>{I.preventDefault(),I.stopPropagation(),g(y)}),L.addEventListener("mouseenter",()=>{f(y)}),h.appendChild(L)});let T=b.length;h.setAttribute("aria-label",`${T} suggestion${T!==1?"s":""} available`)},u=()=>{let h=t.structure?.suggestionsList;if(h)h.innerHTML="";n=-1},f=(h)=>{let b=t.structure?.suggestionsList;if(!b)return;let v=s();if(h<-1)h=v.length-1;if(h>=v.length)h=-1;if(n>=0){let E=b.querySelector(`[data-index="${n}"]`);if(E)E.classList.remove(i(z.SUGGESTION_ITEM_SELECTED)),E.setAttribute("aria-selected","false")}if(n=h,n>=0){let E=b.querySelector(`[data-index="${n}"]`);if(E)E.classList.add(i(z.SUGGESTION_ITEM_SELECTED)),E.setAttribute("aria-selected","true"),E.scrollIntoView({block:"nearest",behavior:"smooth"})}},c=()=>{f(n+1)},C=()=>{f(n-1)},g=(h)=>{let b=s();if(h<0||h>=b.length)return;let v=b[h];if(t.input?.selectSuggestion)t.input.selectSuggestion(v);if(t.states?.collapse)t.states.collapse()},m=()=>{if(n>=0)return g(n),!0;return!1},p=()=>{let h=t.structure?.input;if(!h)return;h.addEventListener("keydown",(b)=>{let v=s();if(!t.states?.isExpanded?.()||v.length===0)return;switch(b.key){case fn.ARROW_DOWN:b.preventDefault(),c();break;case fn.ARROW_UP:b.preventDefault(),C();break;case fn.ENTER:if(n>=0)b.preventDefault(),m();break;case fn.TAB:if(n>=0)m();break;case fn.ESCAPE:n=-1;break}})};return setTimeout(()=>{p()},0),{...t,suggestions:{render:d,clear:u,setHighlightedIndex:f,getHighlightedIndex:()=>n,highlightNext:c,highlightPrevious:C,select:g,selectHighlighted:m}}};var Wu=(e)=>(t)=>({element:t.element,setValue(r,i=!0){return e.value.setValue(r,i),this},getValue(){return e.value.getValue()},setPlaceholder(r){return e.value.setPlaceholder(r),this},getPlaceholder(){return e.value.getPlaceholder()},expand(){return e.state.expand(),this},collapse(){return e.state.collapse(),this},getState(){return e.state.getState()},isExpanded(){return e.state.isExpanded()},setViewMode(r){return e.state.setViewMode(r),this},getViewMode(){return e.state.getViewMode()},focus(){return e.value.focus(),this},blur(){return e.value.blur(),this},clear(){return e.value.clear(),this},submit(){return e.value.submit(),this},setLeadingIcon(r){return console.warn("setLeadingIcon: Not yet implemented"),this},addTrailingItem(r){return console.warn("addTrailingItem: Not yet implemented"),this},removeTrailingItem(r){return console.warn("removeTrailingItem: Not yet implemented"),this},setTrailingItems(r){return console.warn("setTrailingItems: Not yet implemented"),this},setSuggestions(r){return e.suggestions.set(r),e.suggestions.render(),this},getSuggestions(){return e.suggestions.get()},clearSuggestions(){return e.suggestions.clear(),e.suggestions.render(),this},enable(){return e.disabled.enable(),this},disable(){return e.disabled.disable(),this},isDisabled(){return e.disabled.isDisabled()},on(r,i){return e.events.on(r,i),this},off(r,i){return e.events.off(r,i),this},destroy(){if(e.lifecycle?.destroy)e.lifecycle.destroy()}});ne();var Ug={initialState:_e.BAR,viewMode:Ut.DOCKED,disabled:mn.DISABLED,placeholder:mn.PLACEHOLDER,value:mn.VALUE,leadingIcon:void 0,trailingItems:void 0,suggestions:void 0,showClearButton:mn.SHOW_CLEAR_BUTTON,expandOnFocus:!0,collapseOnBlur:!0,collapseDelay:150,minWidth:os.BAR_MIN_WIDTH,maxWidth:os.BAR_MAX_WIDTH,fullWidth:mn.FULL_WIDTH},Ku=(e={})=>_(Ug,e,"search"),Yu=(e)=>V(e,{tag:"div",attributes:{role:"search","aria-disabled":e.disabled===!0?"true":"false"},className:e.class}),Xu=(e)=>({value:{setValue:(t,n)=>e.input?.setValue?.(t,n),getValue:()=>e.input?.getValue?.()??"",setPlaceholder:(t)=>e.input?.setPlaceholder?.(t),getPlaceholder:()=>e.input?.getPlaceholder?.()??"",clear:()=>e.input?.clear?.(),submit:()=>e.input?.submit?.(),focus:()=>e.input?.focus?.(),blur:()=>e.input?.blur?.()},state:{expand:()=>e.states?.expand?.(),collapse:()=>e.states?.collapse?.(),getState:()=>e.states?.getState?.()??"bar",isExpanded:()=>e.states?.isExpanded?.()??!1,setViewMode:(t)=>e.states?.setViewMode?.(t),getViewMode:()=>e.states?.getViewMode?.()??"docked"},disabled:{enable:()=>e.disabled?.enable?.(),disable:()=>e.disabled?.disable?.(),isDisabled:()=>e.disabled?.isDisabled?.()??!1},suggestions:{set:(t)=>e.input?.setSuggestions?.(t),get:()=>e.input?.getSuggestions?.()??[],clear:()=>e.input?.clearSuggestions?.(),render:()=>e.suggestions?.render?.()},events:{on:(t,n)=>e.on?.(t,n),off:(t,n)=>e.off?.(t,n)},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}});var Gg=(e={})=>{let t=Ku(e);try{let n=M(D,k(),O(Yu(t)),ls(t),ds(t),us(t),cs(t),P())(t),r=Xu(n),i=Wu(r)(n);if(t.on&&typeof i.on==="function")Object.entries(t.on).forEach(([s,a])=>{if(typeof a==="function")i.on(s,a)});return i}catch(n){throw console.error("Search creation error:",n),Error(`Failed to create search: ${n.message}`)}},ms=Gg;se();te();re();se();te();re();var qu=({disabled:e,lifecycle:t})=>(n)=>({element:n.element,input:n.input,getValue:n.getValue||(()=>""),setValue(r){return n.setValue?.(r),this},setAttribute(r,i){return n.setAttribute?.(r,i),this},getAttribute(r){return n.getAttribute?.(r)||null},removeAttribute(r){return n.removeAttribute?.(r),this},setVariant(r){let i=n.config?.prefix||"mtrl",s=n.config?.componentName||"textfield";if(n.element.classList.remove(`${i}-${s}--filled`,`${i}-${s}--outlined`),n.element.classList.add(`${i}-${s}--${r}`),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10);return this},getVariant(){let r=n.config?.prefix||"mtrl",i=n.config?.componentName||"textfield";if(n.element.classList.contains(`${r}-${i}--outlined`))return"outlined";return"filled"},setLabel(r){if(n.label?.setText(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10);return this},getLabel(){return n.label?.getText()||""},leadingIcon:n.leadingIcon||null,setLeadingIcon(r){if(n.setLeadingIcon){if(n.setLeadingIcon(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},removeLeadingIcon(){if(n.removeLeadingIcon){if(n.removeLeadingIcon(),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},trailingIcon:n.trailingIcon||null,setTrailingIcon(r){if(n.setTrailingIcon){if(n.setTrailingIcon(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},removeTrailingIcon(){if(n.removeTrailingIcon){if(n.removeTrailingIcon(),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},supportingTextElement:n.supportingTextElement||null,setSupportingText(r,i){if(n.setSupportingText)n.setSupportingText(r,i);return this},removeSupportingText(){if(n.removeSupportingText)n.removeSupportingText();return this},prefixTextElement:n.prefixTextElement||null,setPrefixText(r){if(n.setPrefixText){if(n.setPrefixText(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},removePrefixText(){if(n.removePrefixText){if(n.removePrefixText(),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},suffixTextElement:n.suffixTextElement||null,setSuffixText(r){if(n.setSuffixText){if(n.setSuffixText(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},removeSuffixText(){if(n.removeSuffixText){if(n.removeSuffixText(),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},updatePositions(){if(n.input&&n.element){let r=n.input.value&&n.input.value.length>0,i=n.input.matches?.(":-webkit-autofill")||!1;if(r||i)n.element.classList.remove(`${n.config?.prefix||"mtrl"}-textfield--empty`);else n.element.classList.add(`${n.config?.prefix||"mtrl"}-textfield--empty`)}if(n.updateElementPositions)n.updateElementPositions();return this},setError(r,i){if(n.setError)n.setError(r,i);return this},isError(){return n.isError?.()||!1},setDensity(r){if(n.density?.set)n.density.set(r);return this},getDensity(){return n.density?.current||"default"},on(r,i){return n.on?.(r,i),this},off(r,i){return n.off?.(r,i),this},enable(){return e.enable(),this},disable(){return e.disable(),this},destroy(){t.destroy()}});var fs=(e)=>(t)=>{if(!e.leadingIcon)return t;let n=e.prefix||"mtrl",r=document.createElement("span");if(r.className=`${n}-${e.componentName||"textfield"}-leading-icon`,r.innerHTML=e.leadingIcon,t.element.appendChild(r),t.element.classList.add(`${n}-${e.componentName||"textfield"}--with-leading-icon`),t.input)t.input.classList.add(`${n}-${e.componentName||"textfield"}-input--with-leading-icon`);if("lifecycle"in t&&t.lifecycle?.destroy){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{r.remove(),i.call(t.lifecycle)}}return setTimeout(()=>{let i=t.element.querySelector(`.${n}-${e.componentName||"textfield"}-label`);if(i){if(!t.element.classList.contains(`${n}-${e.componentName||"textfield"}--with-prefix`))i.style.left="44px"}},10),{...t,leadingIcon:r,setLeadingIcon(i){return r.innerHTML=i,this},removeLeadingIcon(){if(r.parentNode){if(r.remove(),t.element.classList.remove(`${n}-${e.componentName||"textfield"}--with-leading-icon`),t.input)t.input.classList.remove(`${n}-${e.componentName||"textfield"}-input--with-leading-icon`);if(!t.element.classList.contains(`${n}-${e.componentName||"textfield"}--with-prefix`)){let i=t.element.querySelector(`.${n}-${e.componentName||"textfield"}-label`);if(i)i.style.left=""}this.leadingIcon=null}return this}}};var gs=(e)=>(t)=>{if(!e.trailingIcon)return t;let n=e.prefix||"mtrl",r=document.createElement("span");if(r.className=`${n}-${e.componentName||"textfield"}-trailing-icon`,r.innerHTML=e.trailingIcon,t.element.appendChild(r),t.element.classList.add(`${n}-${e.componentName||"textfield"}--with-trailing-icon`),t.input)t.input.classList.add(`${n}-${e.componentName||"textfield"}-input--with-trailing-icon`);if("lifecycle"in t&&t.lifecycle?.destroy){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{r.remove(),i.call(t.lifecycle)}}return{...t,trailingIcon:r,setTrailingIcon(i){return r.innerHTML=i,this},removeTrailingIcon(){if(r.parentNode){if(r.remove(),t.element.classList.remove(`${n}-${e.componentName||"textfield"}--with-trailing-icon`),t.input)t.input.classList.remove(`${n}-${e.componentName||"textfield"}-input--with-trailing-icon`);this.trailingIcon=null}return this}}};var ps=(e)=>(t)=>{if(!e.prefixText)return t;let n=e.prefix||"mtrl",r=document.createElement("span");if(r.className=`${n}-${e.componentName||"textfield"}-prefix`,r.textContent=e.prefixText,t.element.appendChild(r),t.element.classList.add(`${n}-${e.componentName||"textfield"}--with-prefix`),"lifecycle"in t&&t.lifecycle?.destroy){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{r.remove(),i.call(t.lifecycle)}}return{...t,prefixTextElement:r,setPrefixText(i){return r.textContent=i,this},removePrefixText(){if(r.parentNode){r.remove(),t.element.classList.remove(`${n}-${e.componentName||"textfield"}--with-prefix`);let i=t.element.querySelector(`.${n}-${e.componentName||"textfield"}-label`);if(i)i.style.left="";this.prefixTextElement=null}return this}}};var hs=(e)=>(t)=>{if(!e.suffixText)return t;let n=e.prefix||"mtrl",r=document.createElement("span");if(r.className=`${n}-${e.componentName||"textfield"}-suffix`,r.textContent=e.suffixText,t.element.appendChild(r),t.element.classList.add(`${n}-${e.componentName||"textfield"}--with-suffix`),"lifecycle"in t&&t.lifecycle?.destroy){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{r.remove(),i.call(t.lifecycle)}}return{...t,suffixTextElement:r,setSuffixText(i){return r.textContent=i,this},removeSuffixText(){if(r.parentNode)r.remove(),t.element.classList.remove(`${n}-${e.componentName||"textfield"}--with-suffix`),this.suffixTextElement=null;return this}}};var Cs=(e)=>(t)=>{let n=e.prefix||"mtrl",r=e.componentName||"textfield",i=null,s=(a,o=!1)=>{let l=document.createElement("div");if(l.className=`${n}-${r}-helper`,l.textContent=a,o)l.classList.add(`${n}-${r}-helper--error`),t.element.classList.add(`${n}-${r}--error`);return l};if(e.supportingText)i=s(e.supportingText,e.error),t.element.appendChild(i);if("lifecycle"in t&&t.lifecycle?.destroy){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{if(i)i.remove();a.call(t.lifecycle)}}return{...t,supportingTextElement:i,setSupportingText(a,o=!1){if(i)i.remove(),t.element.classList.remove(`${n}-${r}--error`);if(a)i=s(a,o),t.element.appendChild(i),this.supportingTextElement=i;else i=null,this.supportingTextElement=null,t.element.classList.remove(`${n}-${r}--error`);return this},removeSupportingText(){if(i)i.remove(),i=null,this.supportingTextElement=null,t.element.classList.remove(`${n}-${r}--error`);return this}}};ai();var Es=()=>(e)=>{let t=e.config.prefix||"mtrl",n=e.config.componentName||"textfield",r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=()=>{if(!e.element||!e.element.isConnected)return e;let d=e.element.querySelector(`.${t}-${n}-label`),u=e.element.querySelector(`.${t}-${n}-prefix`),f=e.element.querySelector(`.${t}-${n}-suffix`),c=e.element.classList.contains(`${t}-${n}--outlined`),C=e.element.classList.contains(`${t}-${n}--focused`),g=e.element.classList.contains(`${t}-${n}--empty`),m=e.element.classList.contains(`${t}-${n}--with-leading-icon`);if(c&&d){let{color:p,element:h}=bt(e.element);if(C||!g){if(d.style.backgroundColor=p,d.style.paddingLeft="4px",d.style.paddingRight="4px",h&&!r.has(e.element)){let b=new MutationObserver(()=>{let{color:T}=bt(e.element);d.style.backgroundColor=T});b.observe(h,{attributes:!0,attributeFilter:["style","class"]}),r.set(e.element,b);let v=h.parentElement,E=[];while(v&&v!==document.documentElement){let T=new MutationObserver(()=>{let{color:S}=bt(e.element);d.style.backgroundColor=S});T.observe(v,{attributes:!0,attributeFilter:["style","class","data-theme","data-theme-mode"]}),E.push(T),v=v.parentElement}if(E.length)i.set(e.element,E)}if(!s.has(e.element)){let b=()=>{let{color:v}=bt(e.element);if(C||!g)d.style.backgroundColor=v};document.addEventListener("themechange",b),s.set(e.element,b)}}else d.style.backgroundColor="",d.style.padding=""}if(u&&e.input){let h=u.getBoundingClientRect().width+4+12;if(e.input.style.paddingLeft=`${h}px`,d){let b=h;if(m)b=Math.max(b,44);if(!C&&g)d.style.left=`${b}px`;else d.style.left="12px"}}else if(m&&d){if(c)if(!C&&g)d.style.left="44px";else d.style.left="12px"}if(f&&e.input){let h=f.getBoundingClientRect().width+4+12;e.input.style.paddingRight=`${h}px`}return e},l=()=>{let d=new MutationObserver((u)=>{u.forEach((f)=>{if(f.type==="attributes"&&f.attributeName==="class")setTimeout(o,10)})});d.observe(e.element,{attributes:!0,attributeFilter:["class"]}),window.addEventListener("resize",o),a.set(e.element,d)};if(setTimeout(()=>{l(),o()},0),"lifecycle"in e&&e.lifecycle?.destroy){let d=e.lifecycle.destroy;e.lifecycle.destroy=()=>{window.removeEventListener("resize",o);let u=a.get(e.element);if(u)u.disconnect(),a.delete(e.element);let f=r.get(e.element);if(f)f.disconnect(),r.delete(e.element);let c=i.get(e.element);if(c)c.forEach((g)=>g.disconnect()),i.delete(e.element);let C=s.get(e.element);if(C)document.removeEventListener("themechange",C),s.delete(e.element);d.call(e.lifecycle)}}return{...e,updateElementPositions:()=>(o(),e)}};var bs=(e)=>(t)=>{let n=e.prefix||"mtrl",r=e.componentName||"textfield",i=e.density||"default";if(i!=="default")t.element.classList.add(`${n}-${r}--density-${i}`);if(t.element.setAttribute("data-density",i),t.input)s(t.input,i);function s(o,l){o.setAttribute("data-density",l)}let a=(o)=>{if(["default","compact"].forEach((l)=>{t.element.classList.remove(`${n}-${r}--density-${l}`)}),o!=="default")t.element.classList.add(`${n}-${r}--density-${o}`);if(t.element.setAttribute("data-density",o),t.input)t.input.setAttribute("data-density",o);if(t.density)t.density.current=o;if(t.updateElementPositions)setTimeout(()=>t.updateElementPositions(),10)};return t.density={current:i,set:a},t};var vs=(e)=>(t)=>{let n=e.prefix||"mtrl",r=e.componentName||"textfield",i=e.error||!1;if(i)t.element.classList.add(`${n}-${r}--error`);return{...t,errorState:i,setError(s,a){if(i=s,t.element.classList.toggle(`${n}-${r}--error`,s),a!==void 0&&t.setSupportingText){if(a)t.setSupportingText(a,s);else if(!s)t.setSupportingText("",!1)}else if(t.supportingTextElement&&t.setSupportingText){let o=t.supportingTextElement.textContent||"";if(o)t.setSupportingText(o,s)}return this},isError(){return i}}};ne();var zg={FILLED:"filled",OUTLINED:"outlined"};var Wg={TEXT:"text",PASSWORD:"password",EMAIL:"email",NUMBER:"number",TEL:"tel",URL:"url",SEARCH:"search",MULTILINE:"multiline"};var Kg={DEFAULT:"default",COMPACT:"compact"},Ts={TYPE:Wg.TEXT,VARIANT:zg.FILLED,DENSITY:Kg.DEFAULT,DISABLED:!1,REQUIRED:!1,ERROR:!1,FLOAT_LABEL:!0,ANIMATION_DURATION:150};var Yg={type:Ts.TYPE,variant:Ts.VARIANT},ju=(e={})=>_(Yg,e,"textfield"),Zu=(e)=>V(e,{tag:"div",className:e.class}),Qu=(e)=>({disabled:{enable:e.disabled?.enable,disable:e.disabled?.disable},lifecycle:{destroy:e.lifecycle?.destroy}});var Xg=(e={})=>{let t=ju(e);try{return M(D,k(),O(Zu(t)),oe(t),bs(t),An(t),et(t),fs(t),gs(t),ps(t),hs(t),Cs(t),vs(t),de(t),P(),Es(),(r)=>qu(Qu(r))(r))(t)}catch(n){throw console.error("Textfield creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create textfield: ${n instanceof Error?n.message:String(n)}`)}},Gn=Xg;var Ju=(e)=>(t)=>{let n="";if(e.value){let s=(e.options||[]).find((a)=>a.id===e.value);if(s)n=s.text}let r='<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>',i=Gn({label:e.label,variant:e.variant||"filled",density:e.density||"default",value:n,name:e.name,disabled:e.disabled,required:e.required,supportingText:e.supportingText,error:e.error,trailingIcon:r,readonly:!0});if(i.element.classList.add(`${e.prefix||"mtrl"}-select`),i.input)i.input.addEventListener("keydown",(s)=>{if(!["Tab","Escape","ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter"," ","Home","End"].includes(s.key))s.preventDefault()}),i.input.addEventListener("paste",(s)=>{s.preventDefault()}),i.input.addEventListener("cut",(s)=>{s.preventDefault()});return{...t,element:i.element,textfield:i}},ys=(e)=>e.map((t)=>{if("type"in t&&t.type==="divider")return t;let n={id:t.id.toString(),text:t.text,icon:t.icon,disabled:t.disabled,hasSubmenu:!1,data:t};if(t.hasSubmenu&&Array.isArray(t.submenu))n.hasSubmenu=!0,n.submenu=ys(t.submenu);return n}),ec=(e)=>(t)=>{if(!t.textfield)return console.warn("Cannot add menu: textfield not found"),t;let n={options:e.options||[],selectedOption:null};if(e.value)n.selectedOption=n.options.find((a)=>a.id===e.value);let r=ys(n.options),i=Un({opener:t.textfield,items:r,position:e.placement||"bottom-start",width:"100%",class:"select-menu",closeOnSelect:!0,closeOnClickOutside:!0,closeOnEscape:!0,closeOnResize:!0,offset:0,container:t.element});i.on("select",(a)=>{if(!a.item||a.item.hasSubmenu)return;let o=a.item.data;if(!o||!("id"in o)||!("text"in o)){console.warn("Invalid menu selection: missing required data properties");return}if(n.selectedOption=o,t.textfield.setValue(o.text),i.setSelected(o.id),t.emit)t.emit("change",{select:t,value:o.id,text:o.text,option:o,originalEvent:a.originalEvent,preventDefault:()=>{a.defaultPrevented=!0},defaultPrevented:!1})}),t.textfield.element.addEventListener("keydown",(a)=>{if(t.textfield.input.disabled)return;if((a.key==="Enter"||a.key===" "||a.key==="ArrowDown")&&!i.isOpen()){if(a.preventDefault(),i.open(a,"keyboard"),t.emit)t.emit("open",{select:t,originalEvent:a,preventDefault:()=>{},defaultPrevented:!1})}else if(a.key==="Escape"&&i.isOpen())a.preventDefault(),i.close(a)}),i.on("open",()=>{t.textfield.element.classList.add(`${e.prefix||"mtrl"}-select--open`);let a=e.prefix||"mtrl";if(t.textfield.element.classList.add(`${a}-textfield--focused`),t.textfield.element.classList.contains(`${a}-textfield--filled`))t.textfield.element.classList.add(`${a}-textfield--filled-focused`)}),i.on("close",(a)=>{if(t.textfield.element.classList.remove(`${e.prefix||"mtrl"}-select--open`),setTimeout(()=>{let o=e.prefix||"mtrl";if(document.activeElement===t.textfield.input||t.textfield.element.contains(document.activeElement)){if(t.textfield.element.classList.add(`${o}-textfield--focused`),t.textfield.element.classList.contains(`${o}-textfield--filled`))t.textfield.element.classList.add(`${o}-textfield--filled-focused`)}else if(t.textfield.element.classList.remove(`${o}-textfield--focused`),t.textfield.element.classList.contains(`${o}-textfield--filled`))t.textfield.element.classList.remove(`${o}-textfield--filled-focused`)},10),t.emit)t.emit("close",{select:t,originalEvent:a.originalEvent,preventDefault:()=>{},defaultPrevented:!1})});let s=()=>{if(!n.selectedOption)return;i.setSelected(n.selectedOption.id)};return i.on("open",()=>{setTimeout(s,50)}),{...t,menu:i,select:{getValue:()=>n.selectedOption?.id||null,setValue:(a)=>{if(a===null||a===void 0||a==="")return n.selectedOption=null,t.textfield.setValue(""),i.setSelected(null),t;let o=n.options.find((l)=>("id"in l)&&l.id===a);if(o&&"text"in o)n.selectedOption=o,t.textfield.setValue(o.text),i.setSelected(o.id);return t},clear:()=>(n.selectedOption=null,t.textfield.setValue(""),i.setSelected(null),t),getText:()=>n.selectedOption?.text||"",getSelectedOption:()=>n.selectedOption,getOptions:()=>[...n.options],setOptions:(a)=>{n.options=a;let o=ys(a);if(i.setItems(o),n.selectedOption&&!a.find((l)=>("id"in l)&&l.id===n.selectedOption.id))n.selectedOption=null,t.textfield.setValue("");return t},open:(a,o="mouse")=>(i.open(a,o),t),close:(a)=>(i.close(a),t),isOpen:()=>i.isOpen()}}};var tc=(e)=>(t)=>({...t,element:t.element,textfield:t.textfield,menu:t.menu,getValue:e.select.getValue,setValue(n){return e.select.setValue(n),this},clear(){return e.select.clear(),this},getText:e.select.getText,getSelectedOption:e.select.getSelectedOption,getOptions:e.select.getOptions,setOptions(n){return e.select.setOptions(n),this},open(n="mouse"){if(t.menu&&typeof t.menu.open==="function")t.menu.open(void 0,n);else e.select.open();return this},close(){return e.select.close(),this},isOpen:e.select.isOpen,setDensity(n){if(t.textfield?.setDensity)t.textfield.setDensity(n);return this},getDensity(){if(t.textfield?.getDensity)return t.textfield.getDensity();return"default"},on(n,r){if(e.events?.on)e.events.on(n,r);else if(t.on)t.on(n,r);return this},off(n,r){if(e.events?.off)e.events.off(n,r);else if(t.off)t.off(n,r);return this},enable(){return e.disabled.enable(),this},disable(){return e.disabled.disable(),this},setError(n,r){if(t.textfield?.setError)t.textfield.setError(n,r);return this},clearError(){if(t.textfield?.setError)t.textfield.setError(!1);return this},destroy(){e.lifecycle.destroy()}});ne();var qg={FILLED:"filled",OUTLINED:"outlined"},jg={BOTTOM_START:"bottom-start",BOTTOM:"bottom",BOTTOM_END:"bottom-end",TOP_START:"top-start",TOP:"top",TOP_END:"top-end"};var xs={VARIANT:qg.FILLED,PLACEMENT:jg.BOTTOM_START,LABEL:"Select",VALUE:"",REQUIRED:!1,DISABLED:!1,SUPPORTING_TEXT:"",ERROR:!1};var Zg={options:[],variant:xs.VARIANT,placement:xs.PLACEMENT},nc=(e={options:[]})=>_(Zg,e,"select"),rc=(e)=>({select:{getValue:e.select?.getValue||(()=>null),setValue:e.select?.setValue||(()=>e),clear:e.select?.clear||(()=>e),getText:e.select?.getText||(()=>""),getSelectedOption:e.select?.getSelectedOption||(()=>null),getOptions:e.select?.getOptions||(()=>[]),setOptions:e.select?.setOptions||(()=>e),open:e.select?.open||(()=>e),close:e.select?.close||(()=>e),isOpen:e.select?.isOpen||(()=>!1)},events:{on:e.on||(()=>e),off:e.off||(()=>e)},disabled:{enable:()=>{if(e.textfield?.enable)e.textfield.enable();return e},disable:()=>{if(e.textfield?.disable)e.textfield.disable();return e}},lifecycle:{destroy:()=>{if(e.textfield?.destroy)e.textfield.destroy();if(e.menu?.destroy)e.menu.destroy();if(e.lifecycle?.destroy)e.lifecycle.destroy()}}});var Qg=(e)=>{try{let t=nc(e),n=M(D,k(),Ju(t),ec(t),P(),(r)=>tc(rc(r))(r))(t);if(e.on){if(e.on.change)n.on("change",e.on.change);if(e.on.open)n.on("open",e.on.open);if(e.on.close)n.on("close",e.on.close)}return n}catch(t){throw console.error("Select creation error:",t),Error(`Failed to create select: ${t.message}`)}},Is=Qg;te();re();ne();var Jg={SINGLE:"single",MULTI:"multi"},ep={DEFAULT:"default",COMFORTABLE:"comfortable",COMPACT:"compact"};var Pr={MODE:Jg.SINGLE,DENSITY:ep.DEFAULT,RIPPLE:!0,RIPPLE_DURATION:300,RIPPLE_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",RIPPLE_OPACITY:["0.2","0"]},Ls='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>';var tp={mode:Pr.MODE,ripple:Pr.RIPPLE,density:Pr.DENSITY},ic=(e={})=>_(tp,e,"segmented-button"),sc=(e)=>{let t=e.density||"default";return{tag:"div",componentName:"segmented-button",attributes:{role:"group","aria-label":"Segmented button","data-mode":e.mode||"single","data-density":t},className:[e.class,e.disabled?`${e.prefix}-segmented-button--disabled`:null,t!=="default"?`${e.prefix}-segmented-button--${t}`:null],interactive:!0}},As=(e)=>{switch(e){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"}}};Ht();var np=(e,t)=>{let n=document.createElement("span");return n.className=`${e}-segment-checkmark`,n.innerHTML=t||Ls,n},kr=(e,t,n,r=!1,i={ripple:!0,rippleConfig:{}})=>{let s=r||e.disabled,a=e.icon,o=Boolean(e.text),l=Boolean(a),d=l&&!o,u=o&&!l,f=e.checkmarkIcon||Ls,c=We({text:e.text,icon:d?a:l&&e.selected?f:a,value:e.value||e.text||"",disabled:s,ripple:i.ripple,rippleConfig:i.rippleConfig,class:e.class,ariaLabel:e.text||e.value});c.element.classList.add(`${n}-segmented-button-segment`);let C=null;if(u){C=np(n,f);let p=c.element.querySelector(`.${n}-button-text`);if(p)p.parentNode?.insertBefore(C,p);else c.element.prepend(C)}if(e.selected)c.element.classList.add(`${n}-segment--selected`),c.element.setAttribute("aria-pressed","true");else c.element.setAttribute("aria-pressed","false");t.appendChild(c.element);let g=(p)=>{if(c.element.classList.toggle(`${n}-segment--selected`,p),c.element.setAttribute("aria-pressed",p?"true":"false"),d);else if(l&&o)if(p)c.setIcon(f);else c.setIcon(a)},m=e.selected||!1;return{element:c.element,value:e.value||e.text||"",isSelected(){return m},setSelected(p){m=p,g(p)},isDisabled(){return c.disabled?.isDisabled?.()||!1},setDisabled(p){if(p)c.disable();else c.enable()},destroy(){if(C&&C.parentNode)C.parentNode.removeChild(C);c.destroy()}}};var rp=(e={})=>{let t=ic(e),n=t.mode||"single",r=t.density||"default",i=Re();try{let s=M(D,k(),O(sc(t)),P())(t),a=As(r);Object.entries(a).forEach(([g,m])=>{s.element.style.setProperty(g,m)});let o=[];if(t.segments&&t.segments.length)t.segments.forEach((g)=>{let m=kr(g,s.element,t.prefix,t.disabled,{ripple:t.ripple,rippleConfig:t.rippleConfig});o.push(m)});if(n==="single"&&!o.some((g)=>g.isSelected())){let g=o.find((m)=>!m.isDisabled());if(g)g.setSelected(!0)}let l=(g)=>{let m=g.currentTarget,p=o.find((v)=>v.element===m);if(!p||p.isDisabled())return;let h=u();if(n==="single")o.forEach((v)=>{v.setSelected(v===p)});else p.setSelected(!p.isSelected());let b=u();if(h.length!==b.length||h.some((v)=>!b.includes(v))||b.some((v)=>!h.includes(v)))i.emit("change",{selected:d(),value:b,oldValue:h})};o.forEach((g)=>{g.element.addEventListener("click",l)});let d=()=>o.filter((g)=>g.isSelected()),u=()=>d().map((g)=>g.value),f=(g)=>o.find((m)=>m.value===g),c=(g)=>{if(["default","comfortable","compact"].forEach((p)=>{if(p!=="default")s.element.classList.remove(`${t.prefix}-segmented-button--${p}`)}),g!=="default")s.element.classList.add(`${t.prefix}-segmented-button--${g}`);s.element.setAttribute("data-density",g);let m=As(g);Object.entries(m).forEach(([p,h])=>{s.element.style.setProperty(p,h)})};return{element:s.element,segments:o,getSelected:d,getValue(){return u()},select(g){let m=f(g);if(m&&!m.isDisabled()){let p=u();if(n==="single")o.forEach((b)=>b.setSelected(b===m));else m.setSelected(!0);let h=u();if(p.join(",")!==h.join(","))i.emit("change",{selected:d(),value:h,oldValue:p})}return this},deselect(g){let m=f(g);if(m&&!m.isDisabled())if(n==="single"){if(d().length>1||!m.isSelected()){let h=u();m.setSelected(!1);let b=u();if(h.join(",")!==b.join(","))i.emit("change",{selected:d(),value:b,oldValue:h})}}else{let p=u();m.setSelected(!1);let h=u();if(p.join(",")!==h.join(","))i.emit("change",{selected:d(),value:h,oldValue:p})}return this},enable(){return s.element.classList.remove(`${t.prefix}-segmented-button--disabled`),o.forEach((g)=>{if(!t.segments?.find((m)=>m.value===g.value)?.disabled)g.setDisabled(!1)}),this},disable(){return s.element.classList.add(`${t.prefix}-segmented-button--disabled`),o.forEach((g)=>{g.setDisabled(!0)}),this},enableSegment(g){let m=f(g);if(m)m.setDisabled(!1);return this},disableSegment(g){let m=f(g);if(m)m.setDisabled(!0);return this},setDensity(g){return c(g),this},getDensity(){return s.element.getAttribute("data-density")||"default"},on(g,m){return i.on(g,m),this},off(g,m){return i.off(g,m),this},destroy(){o.forEach((g)=>{g.element.removeEventListener("click",l),g.destroy()}),i.clear(),s.lifecycle.destroy()}}}catch(s){throw console.error("Segmented Button creation error:",s),Error(`Failed to create segmented button: ${s.message}`)}},Br=rp;se();te();re();var Xe={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"},gn={OPEN:"open",CLOSE:"close",DRAG_START:"dragstart",DRAG_END:"dragend"};var ws=(e)=>(t)=>{let{position:n=Xe.BOTTOM}=e,r=`${t.getClass("sheet")}--${n.toLowerCase()}`;return t.element.classList.add(r),{...t,position:{setPosition(i){t.element.classList.remove(r);let s=`${t.getClass("sheet")}--${i.toLowerCase()}`;t.element.classList.add(s)},getPosition(){return n}}}};var Ns=(e)=>(t)=>{let{content:n=""}=e,r=document.createElement("div");return r.className=`${t.getClass("sheet")}-content`,r.innerHTML=n,t.container=document.createElement("div"),t.container.className=`${t.getClass("sheet")}-container`,t.container.appendChild(r),t.element.appendChild(t.container),{...t,content:{setContent(i){return r.innerHTML=i,this},getContent(){return r.innerHTML},getElement(){return r}}}};var Ds=(e)=>(t)=>{let{title:n=""}=e,r=null;if(n||e.dragHandle){if(r=document.createElement("div"),r.className=`${t.getClass("sheet")}-title`,n)r.textContent=n;if(t.container.insertBefore(r,t.container.firstChild),e.dragHandle){let i=document.createElement("div");i.className=`${t.getClass("sheet")}-handle`,t.container.insertBefore(i,t.container.firstChild),t.dragHandle={element:i,setVisible(s){i.style.display=s?"block":"none"}}}}return{...t,title:{setTitle(i){if(!r&&i)r=document.createElement("div"),r.className=`${t.getClass("sheet")}-title`,t.container.insertBefore(r,t.content.getElement());if(r)r.textContent=i;return this},getTitle(){return r?r.textContent||"":""},getElement(){return r}}}};var Ms=(e)=>(t)=>{let{open:n=!1,dismissible:r=!0}=e,i=n,s=document.createElement("div");if(s.className=`${t.getClass("sheet")}-scrim`,t.element.parentNode?.insertBefore(s,t.element.nextSibling),r)t.element.classList.add(`${t.getClass("sheet")}--dismissible`),s.addEventListener("click",()=>{if(r)o()});if(n)t.element.classList.add(`${t.getClass("sheet")}--open`);if(e.elevation)t.element.classList.add(`${t.getClass("sheet")}--elevation-${e.elevation}`);document.addEventListener("keydown",(l)=>{if(l.key==="Escape"&&i&&r)o()});function a(){if(!i){if(i=!0,t.element.classList.add(`${t.getClass("sheet")}--open`),t.events.emit(gn.OPEN),e.onOpen)e.onOpen()}}function o(){if(i){if(i=!1,t.element.classList.remove(`${t.getClass("sheet")}--open`),t.events.emit(gn.CLOSE),e.onClose)e.onClose()}}return{...t,state:{open:a,close:o,isOpen(){return i},setDismissible(l){if(l)t.element.classList.add(`${t.getClass("sheet")}--dismissible`);else t.element.classList.remove(`${t.getClass("sheet")}--dismissible`)}},initialize(){if(s.parentNode!==t.element.parentNode)t.element.parentNode?.insertBefore(s,t.element.nextSibling)}}};var Os=(e)=>(t)=>{if(e.enableGestures===!1)return t;let n=e.position||Xe.BOTTOM,r=0,i=0,s=!1,a=t.dragHandle?.element||t.element,o=(c)=>{if(!t.state.isOpen())return;if(s=!0,document.body.style.userSelect="none",c.type==="touchstart")r=c.touches[0].clientY,i=c.touches[0].clientX;else r=c.clientY,i=c.clientX,document.addEventListener("mousemove",l),document.addEventListener("mouseup",d);t.events.emit(gn.DRAG_START)},l=(c)=>{if(!s)return;let C,g;if(c.type==="touchmove")C=c.touches[0].clientY,g=c.touches[0].clientX;else C=c.clientY,g=c.clientX;let m=0;switch(n){case Xe.BOTTOM:if(m=C-r,m<0)m=0;t.element.style.transform=`translateY(${m}px)`;break;case Xe.TOP:if(m=r-C,m<0)m=0;t.element.style.transform=`translateY(-${m}px)`;break;case Xe.LEFT:if(m=i-g,m<0)m=0;t.element.style.transform=`translateX(-${m}px)`;break;case Xe.RIGHT:if(m=g-i,m<0)m=0;t.element.style.transform=`translateX(${m}px)`;break}let p=n===Xe.BOTTOM||n===Xe.TOP?t.element.offsetHeight:t.element.offsetWidth,h=Math.min(m/p,1),b=t.element.nextElementSibling;if(b&&b.classList.contains(`${t.getClass("sheet")}-scrim`))b.style.opacity=`${0.32*(1-h)}`},d=()=>{if(!s)return;s=!1,document.body.style.userSelect="",document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",d);let c=n===Xe.BOTTOM||n===Xe.TOP?t.element.offsetHeight:t.element.offsetWidth,C=0;if(t.element.style.transform){let g=t.element.style.transform.match(/translate[XY]\(([^p]+)px\)/);C=g?parseFloat(g[1]):0}if(C>c*0.3)t.state.close();else{t.element.style.transform="";let g=t.element.nextElementSibling;if(g&&g.classList.contains(`${t.getClass("sheet")}-scrim`))g.style.opacity=""}t.events.emit(gn.DRAG_END)};a.addEventListener("touchstart",o,{passive:!0}),a.addEventListener("touchmove",l,{passive:!0}),a.addEventListener("touchend",d),a.addEventListener("mousedown",o);let u=()=>{a.removeEventListener("touchstart",o),a.removeEventListener("touchmove",l),a.removeEventListener("touchend",d),a.removeEventListener("mousedown",o),document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",d)},f=t.lifecycle?.destroy||(()=>{});return t.lifecycle={...t.lifecycle,destroy:()=>{u(),f()}},t};var oc=({state:e,lifecycle:t})=>(n)=>({...n,element:n.element,container:n.container,open(){return e.open(),this},close(){return e.close(),this},setContent(r){return n.content.setContent(r),this},getContent(){return n.content.getContent()},setTitle(r){return n.title.setTitle(r),this},getTitle(){return n.title.getTitle()},setDragHandle(r){if(n.dragHandle)n.dragHandle.setVisible(r);return this},setMaxHeight(r){return n.container.style.maxHeight=r,this},destroy(){t.destroy()},initialize(){if(n.initialize)n.initialize();return this}});ne();var Hr={STANDARD:"standard",MODAL:"modal",EXPANDED:"expanded"},Rs={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"};var ip={LEVEL_1:1,LEVEL_2:2,LEVEL_3:3,LEVEL_4:4,LEVEL_5:5},pn={VARIANT:Hr.STANDARD,POSITION:Rs.BOTTOM,OPEN:!1,DISMISSIBLE:!0,DRAG_HANDLE:!0,ELEVATION:ip.LEVEL_3,TITLE:"",CONTENT:"",MAX_HEIGHT:"80%",ENABLE_GESTURES:!0};var sp={variant:Hr.STANDARD,position:Rs.BOTTOM,open:pn.OPEN,dismissible:pn.DISMISSIBLE,dragHandle:pn.DRAG_HANDLE,elevation:pn.ELEVATION,enableGestures:pn.ENABLE_GESTURES},lc=(e={})=>_(sp,e,"sheet"),dc=(e)=>V(e,{tag:"div",attributes:{role:"dialog","aria-modal":e.variant===Hr.MODAL?"true":"false"},className:e.class,forwardEvents:{click:!0,keydown:!0}}),uc=(e)=>({state:{open:()=>e.state.open(),close:()=>e.state.close()},lifecycle:{destroy:()=>e.lifecycle.destroy()}});var ap=(e={})=>{let t=lc(e);try{let n=M(D,k(),O(dc(t)),oe(t),ws(t),Ns(t),Ds(t),Ms(t),Os(t),P(),(r)=>oc(uc(r))(r))(t);return n.initialize(),n}catch(n){throw console.error("Sheet creation error:",n),Error(`Failed to create sheet: ${n.message}`)}},_s=ap;te();re();Qe();var Ps=(e)=>(t)=>{if(!e.range||!e.secondValue||!t.schema)return t;try{let n=e.min||0,r=e.max||100,i=e.secondValue,s=(i-n)/(r-n)*100,a=e.valueFormatter||((c)=>c.toString()),o=e.disabled===!0,l=t.getClass,d=JSON.parse(JSON.stringify(t.schema)),u=d.element.options.className||[];if(Array.isArray(u))u.push(l("slider--range"));else d.element.options.className=`${u} ${l("slider--range")}`.trim();let f=d.element.children.container.children;return f.secondHandle={name:"secondHandle",creator:B,options:{tag:"div",className:l("slider-handle"),attributes:{role:"slider","aria-valuemin":String(n),"aria-valuemax":String(r),"aria-valuenow":String(i),"aria-orientation":"horizontal",tabindex:o?"-1":"0","aria-disabled":o?"true":"false","data-value":String(i),"data-handle-index":"1"},style:{left:`${s}%`}}},f.secondValueBubble={name:"secondValueBubble",creator:B,options:{tag:"div",className:l("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"1"},text:a(i),style:{left:`${s}%`}}},{...t,schema:d}}catch(n){return console.warn("Error enhancing structure with range functionality:",n),t}};var Wt={PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",ERROR:"error"},Fe={XS:16,S:24,M:40,L:56,XL:96},ce={HANDLE_SIZE:16,SMALL_HANDLE_HEIGHT:44,HANDLE_HEIGHT_OFFSET:12,MIN_HEIGHT:48,TRACK_RADIUS:3,SMALL_TRACK_EXTERNAL_RADIUS:10,LARGE_TRACK_RADIUS_RATIO:0.35,TICK_SIZE:4,DOT_SIZE:4,HANDLE_GAP:6,HANDLE_GAP_PRESSED_REDUCTION:2,CENTER_GAP:4,EDGE_PADDING:7},Le={CHANGE:"change",INPUT:"input",FOCUS:"focus",BLUR:"blur",START:"start",END:"end"},mc={START:"start",END:"end"},Ne={MIN:0,MAX:100,VALUE:0,STEP:1,DISABLED:!1,COLOR:Wt.PRIMARY,SIZE:"XS",TICKS:!1,SHOW_VALUE:!0,SNAP_TO_STEPS:!0,RANGE:!1,CENTERED:!1,ICON_POSITION:mc.START,LABEL_POSITION:mc.START};var ks=(e)=>(t)=>{if(e.disabled===!0)setTimeout(()=>{r()},0);function r(){if(t.element.classList.add(`${t.getClass("slider")}--disabled`),t.element.setAttribute("aria-disabled","true"),t.structure?.handle)t.structure.handle.tabIndex=-1,t.structure.handle.setAttribute("aria-disabled","true");if(e.range&&t.structure?.secondHandle)t.structure.secondHandle.tabIndex=-1,t.structure.secondHandle.setAttribute("aria-disabled","true");if(t.drawCanvas)t.drawCanvas()}function i(){if(t.element.classList.remove(`${t.getClass("slider")}--disabled`),t.element.setAttribute("aria-disabled","false"),t.structure?.handle)t.structure.handle.tabIndex=0,t.structure.handle.setAttribute("aria-disabled","false");if(e.range&&t.structure?.secondHandle)t.structure.secondHandle.tabIndex=0,t.structure.secondHandle.setAttribute("aria-disabled","false");if(t.drawCanvas)t.drawCanvas()}function s(){return Object.values(Wt).find((o)=>t.element.classList.contains(`${t.getClass("slider")}--${o}`))||Wt.PRIMARY}function a(){return Object.keys(Fe).find((d)=>t.element.classList.contains(`${t.getClass("slider")}--${d.toLowerCase()}`))||"XS"}return{...t,disabled:{enable(){return i(),this},disable(){return r(),this},isDisabled(){return t.element.classList.contains(`${t.getClass("slider")}--disabled`)}},appearance:{setColor(o){if(Object.values(Wt).forEach((l)=>{t.element.classList.remove(`${t.getClass("slider")}--${l}`)}),o!==Wt.PRIMARY)t.element.classList.add(`${t.getClass("slider")}--${o}`);return this},getColor(){return s()},setSize(o){Object.keys(Fe).forEach((u)=>{t.element.classList.remove(`${t.getClass("slider")}--${u.toLowerCase()}`)});let d;if(typeof o==="string"&&o in Fe)d=o;else if(typeof o==="number"){let u=Object.entries(Fe).find(([,f])=>f===o);d=u?u[0]:"XS"}else d="XS";return t.element.classList.add(`${t.getClass("slider")}--${d.toLowerCase()}`),this},getSize(){return a()},showTicks(o){if(e.ticks=o,t.slider)t.slider.regenerateTicks();return this},showCurrentValue(o){return e.showValue=o,this}}}};var fc=(e,t,n,r)=>{let i=t.component?.components||{},s=t.component||{},a=s.container||i.container||null,o=s.handle||i.handle||null,l=s.valueBubble||i.valueBubble||null,d=s.secondHandle||i.secondHandle||null,u=s.secondValueBubble||i.secondValueBubble||null,{getValueFromPosition:f=()=>0,roundToStep:c=(w)=>w,clamp:C=(w)=>w,showValueBubble:g=()=>{},render:m=()=>{}}=n,{triggerEvent:p=()=>({defaultPrevented:!1})}=r,h=!1,b=0,v=3,E=null,T=()=>{if(t.valueHideTimer)clearTimeout(t.valueHideTimer),t.valueHideTimer=null},S=()=>{if(T(),l)g(l,!1);if(u)g(u,!1)},y=(w)=>{if(S(),w&&e.showValue)g(w,!0)},L=(w,G=0)=>{if(T(),!w||!e.showValue)return;if(G>0)t.valueHideTimer=setTimeout(()=>{g(w,!1)},G);else g(w,!1)},I=()=>{if(o)o.classList.remove(`${t.component.getClass("slider-handle")}--focused`);if(d)d.classList.remove(`${t.component.getClass("slider-handle")}--focused`);try{let w=t.component.getClass("slider-handle--focused");if(document.querySelectorAll(`.${w}`).forEach((G)=>{G.classList.remove(w)}),document.activeElement?.classList.contains(t.component.getClass("slider-handle")))document.activeElement.blur()}catch(w){console.warn("Error clearing keyboard focus:",w)}},x=(w,G=!1)=>{if(!t.component||t.component.disabled&&t.component.disabled.isDisabled())return;if(w.type==="mousedown")w.preventDefault();w.stopPropagation(),S(),I(),b=w.type.includes("touch")?w.touches[0].clientX:w.clientX,t.dragging=!1,t.pressed=!0,h=!1,t.activeHandle=G?"second":"first",t.activeBubble=G?u:l,y(t.activeBubble),document.addEventListener("mousemove",N),document.addEventListener("mouseup",R),document.addEventListener("touchmove",N,{passive:!1}),document.addEventListener("touchend",R),m(),p(Le.START,w)},A=(w)=>{if(!t.component||t.component.disabled&&t.component.disabled.isDisabled()||!a)return;if(w.type==="mousedown")w.preventDefault();S(),I();let G=!1;try{let j=w.type.includes("touch")?w.touches[0].clientX:w.clientX,Z=f(j);if(e.snapToSteps&&t.step>0)Z=c(Z);if(Z=C(Z,t.min,t.max),e.range&&t.secondValue!==null){let xe=Math.abs(Z-t.value);G=Math.abs(Z-t.secondValue)<xe,G?t.secondValue=Z:t.value=Z}else if(e.centered&&t.component.slider&&t.component.slider.setValue)t.component.slider.setValue(Z,!1);else t.value=Z;m(),p(Le.INPUT,w)}catch(j){console.warn("Error handling track click:",j)}if(t.activeHandle=G?"second":"first",t.activeBubble=G?u:l,b=w.type.includes("touch")?w.touches[0].clientX:w.clientX,e.centered&&!e.range)y(t.activeBubble),document.addEventListener("mousemove",N),document.addEventListener("mouseup",R),document.addEventListener("touchmove",N,{passive:!1}),document.addEventListener("touchend",R),t.pressed=!1,p(Le.START,w);else t.dragging=!1,t.pressed=!1,h=!1,y(t.activeBubble),document.addEventListener("mousemove",N),document.addEventListener("mouseup",R),document.addEventListener("touchmove",N,{passive:!1}),document.addEventListener("touchend",R),m(),p(Le.START,w)},N=(w)=>{if(!t.activeHandle||!a)return;w.preventDefault();try{let G=w.type.includes("touch")?w.touches[0].clientX:w.clientX;if(!h&&Math.abs(G-b)>=v)h=!0,t.dragging=!0,t.component.element.classList.add(`${t.component.getClass("slider")}--dragging`);let j=f(G);if(e.snapToSteps&&t.step>0)j=c(j);j=C(j,t.min,t.max);let Z=t.activeHandle==="second";if(e.range&&t.secondValue!==null)if(Z)if(j>=t.value)t.secondValue=j;else L(t.activeBubble,0),t.secondValue=t.value,t.value=j,t.activeHandle="first",t.activeBubble=l,y(t.activeBubble);else if(j<=t.secondValue)t.value=j;else L(t.activeBubble,0),t.value=t.secondValue,t.secondValue=j,t.activeHandle="second",t.activeBubble=u,y(t.activeBubble);else{if(e.centered)t.previousValue=t.value;t.value=j}m(),p(Le.INPUT,w)}catch(G){console.warn("Error during slider drag:",G)}},R=(w)=>{if(!t.activeHandle)return;w.preventDefault(),t.dragging=!1,t.pressed=!1,h=!1,t.component.element.classList.remove(`${t.component.getClass("slider")}--dragging`),L(t.activeBubble,1000),document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",R),document.removeEventListener("touchmove",N),document.removeEventListener("touchend",R),t.activeHandle=null,m(),p(Le.CHANGE,w),p(Le.END,w)},U=(w,G=!1)=>{if(t.component.disabled&&t.component.disabled.isDisabled())return;let j=t.step||1,Z=G?t.secondValue:t.value,xe=w.shiftKey?j*10:j;if(w.key==="Tab")return;let ie=!1;switch(w.key){case"ArrowRight":case"ArrowUp":w.preventDefault(),Z=Math.min(Z+xe,t.max),ie=!0;break;case"ArrowLeft":case"ArrowDown":w.preventDefault(),Z=Math.max(Z-xe,t.min),ie=!0;break;case"Home":w.preventDefault(),Z=t.min,ie=!0;break;case"End":w.preventDefault(),Z=t.max,ie=!0;break;case"PageUp":w.preventDefault(),Z=Math.min(Z+j*10,t.max),ie=!0;break;case"PageDown":w.preventDefault(),Z=Math.max(Z-j*10,t.min),ie=!0;break;default:return}if(!ie)return;if(t.activeBubble=G?u:l,y(t.activeBubble),G)t.secondValue=Z;else{if(e.centered)t.previousValue=t.value;t.value=Z}m(),p(Le.INPUT,w),p(Le.CHANGE,w)},H=(w,G=!1)=>{if(t.component.disabled&&t.component.disabled.isDisabled())return;let j=G?d:o;if(E&&E!==j)S();E=j,j.classList.add(`${t.component.getClass("slider-handle")}--focused`),y(G?u:l),t.activeBubble=G?u:l,p(Le.FOCUS,w)},q=(w,G=!1)=>{(G?d:o).classList.remove(`${t.component.getClass("slider-handle")}--focused`);let Z=w.relatedTarget;if(!Z||Z!==(G?o:d))L(G?u:l,200);p(Le.BLUR,w)};return{handleHandleMouseDown:x,handleTrackMouseDown:A,handleMouseMove:N,handleMouseUp:R,handleKeyDown:U,handleFocus:H,handleBlur:q,setupEventListeners:()=>{if(!t.component||!o){console.warn("Cannot set up event listeners: missing component or handle");return}if(a.addEventListener("mousedown",A),a.addEventListener("touchstart",A,{passive:!0}),o.addEventListener("mousedown",(w)=>x(w,!1)),o.addEventListener("touchstart",(w)=>x(w,!1),{passive:!0}),o.addEventListener("keydown",(w)=>U(w,!1)),o.addEventListener("focus",(w)=>H(w,!1)),o.addEventListener("blur",(w)=>q(w,!1)),e.range&&d)d.addEventListener("mousedown",(w)=>x(w,!0)),d.addEventListener("touchstart",(w)=>x(w,!0),{passive:!0}),d.addEventListener("keydown",(w)=>U(w,!0)),d.addEventListener("focus",(w)=>H(w,!0)),d.addEventListener("blur",(w)=>q(w,!0))},cleanupEventListeners:()=>{if(!t.component)return;if(a)a.removeEventListener("mousedown",A),a.removeEventListener("touchstart",A);if(o)o.removeEventListener("mousedown",(w)=>x(w,!1)),o.removeEventListener("touchstart",(w)=>x(w,!1)),o.removeEventListener("keydown",(w)=>U(w,!1)),o.removeEventListener("focus",(w)=>H(w,!1)),o.removeEventListener("blur",(w)=>q(w,!1));if(e.range&&d)d.removeEventListener("mousedown",(w)=>x(w,!0)),d.removeEventListener("touchstart",(w)=>x(w,!0)),d.removeEventListener("keydown",(w)=>U(w,!0)),d.removeEventListener("focus",(w)=>H(w,!0)),d.removeEventListener("blur",(w)=>q(w,!0));document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",R),document.removeEventListener("touchmove",N),document.removeEventListener("touchend",R)},showActiveBubble:y,hideActiveBubble:L,hideAllBubbles:S,clearKeyboardFocus:I}};var Bs=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize slider controller: missing element"),t;let n={component:t,value:e.value!==void 0?e.value:0,secondValue:e.secondValue!==void 0?e.secondValue:null,min:e.min!==void 0?e.min:0,max:e.max!==void 0?e.max:100,step:e.step!==void 0?e.step:1,dragging:!1,pressed:!1,activeHandle:null,activeBubble:null,valueHideTimer:null},r={triggerEvent(E,T=null){let S={slider:n.component,value:n.value,secondValue:n.secondValue,originalEvent:T,preventDefault:()=>{S.defaultPrevented=!0},defaultPrevented:!1};return n.component.emit(E,S),S}},i=()=>{if(!n.component)return{};let E=n.component.components||{},T=n.component;return{container:T.container||E.container,handle:T.handle||E.handle,valueBubble:T.valueBubble||E.valueBubble,secondHandle:T.secondHandle||E.secondHandle,secondValueBubble:T.secondValueBubble||E.secondValueBubble,...E}},s=(E)=>{let T=n.max-n.min;return T===0?0:(E-n.min)/T*100},a=()=>{let E=i(),{handle:T,container:S}=E;if(!T||!S)return null;try{let y=T.getBoundingClientRect(),L=S.getBoundingClientRect(),I=y.width||ce.HANDLE_SIZE,x=L.width,A=ce.EDGE_PADDING/x*100,R=(n.activeHandle?6:8)/x*100;return{handleSize:I,trackSize:x,edgeConstraint:A,paddingPercent:R}}catch(y){return console.warn("Error calculating track dimensions:",y),{handleSize:ce.HANDLE_SIZE,trackSize:200,edgeConstraint:3,paddingPercent:4}}},o=(E,T=200)=>{let S=ce.EDGE_PADDING/T*100,y=S,L=100-S,I=L-y;if(E<=0)return y;if(E>=100)return L;return y+E/100*I},l=(E)=>{let T=i(),{handle:S,container:y}=T;if(!S||!y)return n.min;try{let L=y.getBoundingClientRect(),I=n.max-n.min,x=L.left+ce.EDGE_PADDING,A=L.right-ce.EDGE_PADDING,N=A-x,U=(Math.max(x,Math.min(A,E))-x)/N;return n.min+U*I}catch(L){return console.warn("Error calculating value from position:",L),n.min}},d=(E)=>{let T=n.step;if(!T||T<=0)return E;let S=Math.round((E-n.min)/T);return n.min+S*T},u=(E,T,S)=>Math.min(Math.max(E,T),S),f=()=>{let E=i(),{handle:T,container:S,valueBubble:y,secondHandle:L,secondValueBubble:I}=E;if(!T||!S)return;let x=a();if(!x)return;let{trackSize:A}=x,N=s(n.value),R=o(N,A);if(T.style.left=`${R}%`,T.style.transform="translate(-50%, -50%)",y)y.style.left=`${R}%`,y.style.transform="translateX(-50%)";if(e.range&&L&&n.secondValue!==null){let U=s(n.secondValue),H=o(U,A);if(L.style.left=`${H}%`,L.style.transform="translate(-50%, -50%)",I)I.style.left=`${H}%`,I.style.transform="translateX(-50%)"}if(T)T.setAttribute("aria-valuenow",String(n.value))},c=()=>{let E=i(),{valueBubble:T,secondValueBubble:S}=E;if(!T)return;let y=e.valueFormatter||((L)=>L.toString());if(T.textContent=y(n.value),e.range&&S&&n.secondValue!==null)S.textContent=y(n.secondValue)},C=(E,T)=>{if(!E||!e.showValue)return;let S=n.component.getClass("slider-value");E.classList[T?"add":"remove"](`${S}--visible`)},g=()=>{},m=()=>{},p=()=>{try{if(f(),c(),t.drawCanvas)t.drawCanvas(n)}catch(E){console.warn("Error rendering UI:",E)}},b=fc(e,n,{getPercentage:s,getValueFromPosition:l,roundToStep:d,clamp:u,showValueBubble:C,updateUi:p,render:p},r),v=()=>{try{let E=i();if(!E.handle){console.warn("Cannot initialize slider controller: missing required handle component");return}let{handle:T,secondHandle:S}=E;if(T){if(T.setAttribute("aria-valuemin",String(n.min)),T.setAttribute("aria-valuemax",String(n.max)),T.setAttribute("aria-valuenow",String(n.value)),e.range&&S&&n.secondValue!==null)S.setAttribute("aria-valuemin",String(n.min)),S.setAttribute("aria-valuemax",String(n.max)),S.setAttribute("aria-valuenow",String(n.secondValue))}b.setupEventListeners(),p()}catch(E){console.error("Error initializing slider controller:",E)}};if(t.lifecycle){let E=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{b.cleanupEventListeners(),E()}}return setTimeout(()=>{v()},0),{...t,slider:{setValue(E,T=!0){let S=u(E,n.min,n.max);if(n.value=S,p(),T)r.triggerEvent(Le.CHANGE);return this},getValue(){return n.value},setSecondValue(E,T=!0){if(!e.range)return this;let S=u(E,n.min,n.max);if(n.secondValue=S,p(),T)r.triggerEvent(Le.CHANGE);return this},getSecondValue(){return e.range?n.secondValue:null},setMin(E){n.min=E;let T=i();if(T.handle)T.handle.setAttribute("aria-valuemin",String(E));if(e.range&&T.secondHandle)T.secondHandle.setAttribute("aria-valuemin",String(E));if(n.value<E)n.value=E;if(e.range&&n.secondValue!==null&&n.secondValue<E)n.secondValue=E;if(e.ticks||e.tickLabels)g();return p(),this},getMin(){return n.min},setMax(E){n.max=E;let T=i();if(T.handle)T.handle.setAttribute("aria-valuemax",String(E));if(e.range&&T.secondHandle)T.secondHandle.setAttribute("aria-valuemax",String(E));if(n.value>E)n.value=E;if(e.range&&n.secondValue!==null&&n.secondValue>E)n.secondValue=E;if(e.ticks||e.tickLabels)g();return p(),this},getMax(){return n.max},setStep(E){if(n.step=E,t.element.classList[E>0?"add":"remove"](`${t.getClass("slider")}--discrete`),e.ticks||e.tickLabels)g(),m();return this},getStep(){return n.step},regenerateTicks(){return p(),this},updateUi(){return p(),this}}}};kt();dr();var op=(e)=>e?.disabled?.isDisabled?.()||e?.element?.classList?.contains?.(`${e?.getClass?.("slider")}--disabled`)||!1,$s=(e,t,n="track")=>{let r=op(t),i=e.color||"primary";if(r){let d=Te("sys-color-on-surface",{fallback:"#000000"});return{primary:Rn(d,0.38),secondary:Rn(d,0.12)}}let s=t?.element&&typeof getComputedStyle==="function"?getComputedStyle(t.element):void 0,a=s?.getPropertyValue("--mtrl-slider-color").trim(),o=s?.getPropertyValue("--mtrl-slider-on-color").trim();if(n==="tick")return{primary:o||Te(`sys-color-on-${i}`,{fallback:"#ffffff"}),secondary:a||Te(`sys-color-${i}`,{fallback:"#1976d2"})};let l=a||Te(`sys-color-${i}`,{fallback:"#1976d2"});return{primary:l,secondary:Rn(l,0.24)}},$r=(e,t,n)=>(e-t)/(n-t)*100,Ue=(e,t,n,r,i,s,a)=>{if(r>0)ci(e,t,n,r,i,s,s,a)},zn=(e)=>{if(typeof e==="number")return Math.max(e,Fe.XS);if(typeof e==="string"&&e in Fe)return Fe[e];return Fe.XS},Vs=(e)=>{let t=zn(e);if(t<=Fe.S)return ce.SMALL_HANDLE_HEIGHT;return t+ce.HANDLE_HEIGHT_OFFSET},lp=(e)=>{let t=zn(e);if(t<=Fe.S)return ce.SMALL_TRACK_EXTERNAL_RADIUS;return t*ce.LARGE_TRACK_RADIUS_RATIO},gc=(e,t,n)=>{let r=zn(n?.size),i=Vs(n?.size),s=e.parentElement;if(!s)return;let a=s.getBoundingClientRect().width||s.offsetWidth||200,o=Math.max(i,r,ce.MIN_HEIGHT);s.style.height=`${o}px`,pi(t,a,o)},pc=(e,t)=>{let n=e.parentElement;if(!n)throw Error("Canvas must have a parent element");let r=zn(t?.size),i=Vs(t?.size),s=n.getBoundingClientRect().width||n.offsetWidth||200,a=Math.max(i,r,ce.MIN_HEIGHT);return n.style.height=`${a}px`,gi(e,s,a)},Vr=(e,t)=>{let n=ce.EDGE_PADDING/t*100,r=n,i=100-n,s=i-r;if(e<=0)return r;if(e>=100)return i;return r+e/100*s},dp=(e,t,n,r,i,s)=>{let a=n/2,o=zn(r.size),l=lp(r.size),d=ce.TRACK_RADIUS,u=ui(e,0,a-o/2,t,o,l),{primary:f,secondary:c}=$s(r,s),C=$r(i.value,i.min,i.max),g=Vr(C,t),m=i.pressed?ce.HANDLE_GAP_PRESSED_REDUCTION:0,p=ce.HANDLE_GAP-m,b=ce.CENTER_GAP/2/t*100,v=p/t*100;if(r.centered){let E=$r(0,i.min,i.max),T=Vr(E,t),S=Math.abs(g-T)<v,y=i.value>=0;if(S){let L=(g-v)/100*t;if(L>0)Ue(e,0,a-o/2,L,o,d,c);let I=(g+v)/100*t,x=t-I;if(x>0)Ue(e,I,a-o/2,x,o,d,c)}else if(y){let L=(T-b)/100*t;if(L>0)Ue(e,0,a-o/2,L,o,d,c);let I=(T+b)/100*t,x=(g-v)/100*t-I;if(x>0)Ue(e,I,a-o/2,x,o,d,f);let A=(g+v)/100*t,N=t-A;if(N>0)Ue(e,A,a-o/2,N,o,d,c)}else{let L=(g-v)/100*t;if(L>0)Ue(e,0,a-o/2,L,o,d,c);let I=(g+v)/100*t,x=(T-b)/100*t-I;if(x>0)Ue(e,I,a-o/2,x,o,d,f);let A=(T+b)/100*t,N=t-A;if(N>0)Ue(e,A,a-o/2,N,o,d,c)}}else if(r.range&&i.secondValue!==null){let E=$r(i.secondValue,i.min,i.max),T=Vr(E,t),S=Math.min(g,T),y=Math.max(g,T),L=g<=T,I=i.pressed&&i.activeHandle==="first"?ce.HANDLE_GAP_PRESSED_REDUCTION:0,x=i.pressed&&i.activeHandle==="second"?ce.HANDLE_GAP_PRESSED_REDUCTION:0,A=ce.HANDLE_GAP-I,N=ce.HANDLE_GAP-x,R=L?A/t*100:N/t*100,U=L?N/t*100:A/t*100,H=(S-R)/100*t;if(H>0)Ue(e,0,a-o/2,H,o,d,c);let q=(S+R)/100*t,Y=(y-U)/100*t-q;if(Y>o)Ue(e,q,a-o/2,Y,o,d,f);let J=(y+U)/100*t,w=t-J;if(w>0)Ue(e,J,a-o/2,w,o,d,c)}else{let E=(g-v)/100*t;if(E>0)Ue(e,0,a-o/2,E,o,d,f);let T=(g+v)/100*t,S=t-T;if(S>0)Ue(e,T,a-o/2,S,o,d,c)}u()},up=(e,t,n,r,i,s)=>{if(!r.ticks)return;let a=ce.TICK_SIZE,o=n/2,{primary:l,secondary:d}=$s(r,s,"tick"),u=Math.floor((i.max-i.min)/i.step);for(let f=0;f<=u;f++){let c=i.min+f*i.step;if(c>i.max)continue;let C=$r(c,i.min,i.max),m=Vr(C,t)/100*t,p=Math.abs(c-i.value)<i.step*0.1,h=r.range&&i.secondValue!==null&&Math.abs(c-i.secondValue)<i.step*0.1;if(p||h)continue;let b=!1;if(r.centered)b=i.value>=0?c>=0&&c<=i.value:c>=i.value&&c<=0;else if(r.range&&i.secondValue!==null){let v=Math.min(i.value,i.secondValue),E=Math.max(i.value,i.secondValue);b=c>=v&&c<=E}else b=c<=i.value;e.fillStyle=b?l:d,e.globalAlpha=b?1:0.5,e.beginPath(),e.arc(m,o,a/2,0,Math.PI*2),e.fill()}e.globalAlpha=1},cp=(e,t,n,r,i)=>{if(r.ticks)return;let s=ce.DOT_SIZE,a=n/2,o=ce.EDGE_PADDING,{primary:l}=$s(r,i,"dot");e.fillStyle=l,e.beginPath(),e.arc(t-o,a,s/2,0,Math.PI*2),e.fill()},Hs=(e,t,n,r)=>{let{ctx:i,width:s,height:a}=e;if(s===0||a===0)return;mi(i,s,a),cp(i,s,a,t,r),dp(i,s,a,t,n,r),up(i,s,a,t,n,r)},hc=(e,t)=>{let n=Vs(t),r=e.handle||e.components?.handle,i=e.secondHandle||e.components?.secondHandle;if(r)r.style.height=`${n}px`,r.style.transform="translate(-50%, -50%)";if(i)i.style.height=`${n}px`,i.style.transform="translate(-50%, -50%)"},mp=(e,t,n)=>{if(e)return{value:e.value,secondValue:e.secondValue,min:e.min,max:e.max,step:e.step,pressed:e.pressed||!1,activeHandle:e.activeHandle||null};if(t?.slider)return{value:t.slider.getValue(),secondValue:t.slider.getSecondValue(),min:t.slider.getMin(),max:t.slider.getMax(),step:t.slider.getStep(),pressed:!1,activeHandle:null};return n||{value:0,secondValue:null,min:0,max:100,step:1,pressed:!1,activeHandle:null}},Fs=(e)=>(t)=>{let n=Ci(`${t.getClass("slider-canvas")}`,{zIndex:"1"}),r=t.container||t.components?.container;if(r)r.insertBefore(n,r.firstChild);else t.element.appendChild(n);let i=null,s=null,a=null,o=e.size||"XS",l=mp(null,t,{value:e.value||0,secondValue:e.secondValue||null,min:e.min||0,max:e.max||100,step:e.step||1,pressed:!1,activeHandle:null}),d={animatedValue:l.value,animatedSecondValue:l.secondValue,targetValue:l.value,targetSecondValue:l.secondValue,startValue:l.value,startSecondValue:l.secondValue,startTime:0,duration:fi.MEDIUM,animationFrame:null};if(t.animationState=d,hi(()=>{try{return i=pc(n,{...e,size:o}),t.ctx=i.ctx,!0}catch(p){return console.warn("Slider canvas initialization failed:",p),!1}},()=>{hc(t,o)}),e.color&&e.color!=="primary")t.element.classList.add(`${t.getClass("slider")}--${e.color}`);t.canvas=n;let u=()=>{if(!i)return;Hs(i,{...e,size:o},{...l,value:d.animatedValue,secondValue:d.animatedSecondValue},t)},f=(p)=>{if(!i)return;let b=(p||performance.now())-d.startTime,v=Math.min(b/d.duration,1),E=or(v),T=d.startValue,S=d.targetValue;if(d.animatedValue=T+(S-T)*E,d.targetSecondValue!==null&&d.animatedSecondValue!==null){let{startSecondValue:y,targetSecondValue:L}=d;d.animatedSecondValue=y+(L-y)*E}if(u(),v<1)d.animationFrame=requestAnimationFrame((y)=>f(y));else d.animationFrame=null},c=(p)=>{if(!i){console.warn("Canvas context not ready");return}gc(n,i,{...e,size:o});let h,b=!1;if(p)h={value:p.value,secondValue:p.secondValue,min:p.min,max:p.max,step:p.step,pressed:p.pressed||!1,activeHandle:p.activeHandle||null},b=p.dragging||!1,l={...h};else if(t.slider)h={value:t.slider.getValue(),secondValue:t.slider.getSecondValue(),min:t.slider.getMin(),max:t.slider.getMax(),step:t.slider.getStep()},l={...h};else h={...l};let v=h.value!==d.targetValue,E=h.secondValue!==d.targetSecondValue;if((v||E)&&!b){if(d.startValue=d.animatedValue,d.startSecondValue=d.animatedSecondValue,d.targetValue=h.value,d.targetSecondValue=h.secondValue,d.animationFrame)cancelAnimationFrame(d.animationFrame);d.startTime=performance.now(),f()}else if(b){if(d.animatedValue=h.value,d.animatedSecondValue=h.secondValue,d.targetValue=h.value,d.targetSecondValue=h.secondValue,d.startValue=h.value,d.startSecondValue=h.secondValue,d.animationFrame)cancelAnimationFrame(d.animationFrame),d.animationFrame=null;Hs(i,{...e,size:o},p||h,t)}else Hs(i,{...e,size:o},p||h,t)},C=()=>{if(!i)return;try{let p=pc(n,{...e,size:o});t.ctx=p.ctx,Object.assign(i,p),u()}catch(p){console.warn("Slider canvas resize failed:",p)}};s=_n(t.element,n,C);let g=()=>u();a=lr(e.color||"primary",g),requestAnimationFrame(()=>{c()}),t.drawCanvas=c,t.resize=C,t.setSize=(p)=>{if(o=p,i)gc(n,i,{...e,size:o}),u();hc(t,o)},t.getSize=()=>o;let m=t.appearance?.setColor;if(m)t.appearance.setColor=(p)=>{if(m(p),e.color&&e.color!=="primary")t.element.classList.remove(`${t.getClass("slider")}--${e.color}`);if(p&&p!=="primary")t.element.classList.add(`${t.getClass("slider")}--${p}`);if(e.color=p,a)a(),a=null;a=lr(p,g),c()};if(t.lifecycle){let p=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{if(s)s();if(a)a();if(d.animationFrame)cancelAnimationFrame(d.animationFrame);p()}}return t};Qe();var hn=(e,t)=>(Object.assign(e.style,t),e);var Us=(e)=>(t)=>{let n=(b)=>t.getClass(b),r=e.min||0,i=e.max||100,s=e.value!==void 0?e.value:r,a=e.disabled===!0,o=e.valueFormatter||((b)=>b.toString()),l=(s-r)/(i-r)*100,d=B({tag:"div",className:n("slider-container"),container:t.element});hn(d,{position:"relative"});let u=e.label||"",f=e.range&&u?`${u} minimum`:u,c=u?`${u} maximum`:"",C={role:"slider","aria-valuemin":String(r),"aria-valuemax":String(i),"aria-valuenow":String(s),"aria-orientation":"horizontal",tabindex:a?"-1":"0","aria-disabled":a?"true":"false","data-value":String(s),"data-handle-index":"0"};if(f)C["aria-label"]=f;let g=B({tag:"div",className:n("slider-handle"),attributes:C,container:d});hn(g,{left:`${l}%`});let m=B({tag:"div",className:n("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"0"},text:o(s),container:d});hn(m,{left:`${l}%`});let p,h;if(e.range){let b=e.secondValue!==void 0?e.secondValue:i,v=(b-r)/(i-r)*100,E={role:"slider","aria-valuemin":String(r),"aria-valuemax":String(i),"aria-valuenow":String(b),"aria-orientation":"horizontal",tabindex:a?"-1":"0","aria-disabled":a?"true":"false","data-value":String(b),"data-handle-index":"1"};if(c)E["aria-label"]=c;p=B({tag:"div",className:n("slider-handle"),attributes:E,container:d}),hn(p,{left:`${v}%`}),h=B({tag:"div",className:n("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"1"},text:o(b),container:d}),hn(h,{left:`${v}%`})}return{...t,container:d,handle:g,valueBubble:m,secondHandle:p,secondValueBubble:h,getContainer:()=>d,getHandle:()=>g,getValueBubble:()=>m,getSecondHandle:()=>p||null,getSecondValueBubble:()=>h||null}};var Cc=(e)=>(t)=>({...t,element:t.element,setValue(n,r=!0){return e.slider.setValue(n,r),this},getValue(){return e.slider.getValue()},setSecondValue(n,r=!0){return e.slider.setSecondValue(n,r),this},getSecondValue(){return e.slider.getSecondValue()},setMin(n){return e.slider.setMin(n),this},getMin(){return e.slider.getMin()},setMax(n){return e.slider.setMax(n),this},getMax(){return e.slider.getMax()},setStep(n){return e.slider.setStep(n),this},getStep(){return e.slider.getStep()},enable(){return e.disabled.enable(),this},disable(){return e.disabled.disable(),this},isDisabled(){return e.disabled.isDisabled()},setColor(n){return e.appearance.setColor(n),this},getColor(){return e.appearance.getColor()},setSize(n){return e.appearance.setSize(n),this},getSize(){return e.appearance.getSize()},showTicks(n){return e.appearance.showTicks(n),this},showCurrentValue(n){return e.appearance.showCurrentValue(n),this},setLabel(n){if(e.text?.setText)e.text.setText(n);return this},getLabel(){return e.text?.getText?e.text.getText():""},setIcon(n){if(e.icon?.setIcon)e.icon.setIcon(n);return this},getIcon(){return e.icon?.getIcon?e.icon.getIcon():""},on(n,r){if(e.events?.on)e.events.on(n,r);return this},off(n,r){if(e.events?.off)e.events.off(n,r);return this},destroy(){if(e.lifecycle?.destroy)e.lifecycle.destroy()}});ne();var fp={min:Ne.MIN,max:Ne.MAX,value:Ne.VALUE,step:Ne.STEP,disabled:Ne.DISABLED,color:Ne.COLOR,size:Ne.SIZE,ticks:Ne.TICKS,showValue:Ne.SHOW_VALUE,snapToSteps:Ne.SNAP_TO_STEPS,range:Ne.RANGE,centered:Ne.CENTERED,iconPosition:Ne.ICON_POSITION,labelPosition:Ne.LABEL_POSITION,valueFormatter:(e)=>e.toString()},Ec=(e={})=>_(fp,e,"slider"),bc=(e)=>{let t=["slider",e.class,e.disabled?"slider--disabled":"",e.size&&e.size!=="XS"?`slider--${typeof e.size==="string"?e.size.toLowerCase():e.size}`:"",e.color&&e.color!=="primary"?`slider--${e.color}`:"",e.range?"slider--range":"",e.centered?"slider--centered":"",e.icon?"slider--icon":""].filter(Boolean).join(" "),n={tabindex:"-1"};if(e.disabled)n["aria-disabled"]="true";return V(e,{tag:"div",attributes:n,className:t,forwardEvents:{click:!0,keydown:!0,touchstart:!0,touchmove:!0,touchend:!0,mousedown:!0,mousemove:!0,mouseup:!0},interactive:!0})},vc=(e)=>({slider:{setValue:(t,n)=>e.slider?.setValue(t,n),getValue:()=>e.slider?.getValue()??0,setSecondValue:(t,n)=>e.slider?.setSecondValue(t,n),getSecondValue:()=>e.slider?.getSecondValue()??null,setMin:(t)=>e.slider?.setMin(t),getMin:()=>e.slider?.getMin()??0,setMax:(t)=>e.slider?.setMax(t),getMax:()=>e.slider?.getMax()??100,setStep:(t)=>e.slider?.setStep(t),getStep:()=>e.slider?.getStep()??1,regenerateTicks:()=>e.slider?.regenerateTicks?.()},disabled:{enable:()=>e.disabled?.enable?.(),disable:()=>e.disabled?.disable?.(),isDisabled:()=>e.disabled?.isDisabled?.()??!1},appearance:{setColor:(t)=>e.appearance?.setColor?.(t),getColor:()=>e.appearance?.getColor?.()??"primary",setSize:(t)=>e.setSize?.(t),getSize:()=>e.getSize?.()??"XS",showTicks:(t)=>e.appearance?.showTicks?.(t),showCurrentValue:(t)=>e.appearance?.showCurrentValue?.(t)},text:{setText:(t)=>e.label?.setText?.(t),getText:()=>e.label?.getText?.()??""},icon:{setIcon:(t)=>e.icon?.setIcon?.(t),getIcon:()=>e.icon?.getIcon?.()??""},events:{on:(t,n)=>e.on?.(t,n),off:(t,n)=>e.off?.(t,n)},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}});var gp=(e={})=>{let t=Ec(e);try{let n=M(D,k(),O(bc(t)),Ps(t),Us(t),et(t),Be(t),Fs(t),ks(t),Bs(t),P())(t),r=vc(n),i=Cc(r)(n);if(t.on&&typeof i.on==="function")Object.entries(t.on).forEach(([s,a])=>{if(typeof a==="function")i.on(s,a)});return i}catch(n){throw console.error("Slider creation error:",n),Error(`Failed to create slider: ${n.message}`)}},Gs=gp;se();te();var Tc=(e)=>(t)=>{if(!e.action)return t;let n=document.createElement("button");return n.className=`${e.prefix}-snackbar-action`,n.textContent=e.action,t.element.appendChild(n),{...t,actionButton:n}},Sc=(e)=>(t)=>{let n=null,r=typeof e.duration==="number"?e.duration:0,i=()=>{if(n)clearTimeout(n),n=null;if(r>0)n=window.setTimeout(()=>{if(t.element&&t.emit)t.emit("dismiss")},r)},s=()=>{if(n)clearTimeout(n),n=null},a=(d)=>{r=typeof d==="number"&&d>0?d:0},o=()=>r,l=t.lifecycle?.destroy;if(t.lifecycle)t.lifecycle.destroy=()=>{if(s(),l)l.call(t.lifecycle)};return{...t,timer:{start:i,stop:s,setDuration:a,getDuration:o}}};var pp={BASIC:"basic",ACTION:"action"},Kt={CENTER:"center",START:"start",END:"end"};var Cn={QUEUE:"queue",REPLACE:"replace"};var Yt={VARIANT:pp.BASIC,POSITION:Kt.CENTER,DURATION:4000,QUEUE_BEHAVIOR:Cn.QUEUE,QUEUE_GAP:200,Z_INDEX:1000,ANIMATION_DURATION:300};var yc=(e)=>(t)=>{let n=e.position||Kt.CENTER,r=e.prefix||"mtrl",i=`${r}-snackbar--${n}`;t.element.classList.add(i);let s=(a)=>{t.element.classList.remove(i);let o=`${r}-snackbar--${a}`;if(t.element.classList.add(o),t.element.classList.contains(`${r}-snackbar--visible`))if(a===Kt.CENTER)t.element.style.transform="translateX(-50%) scale(1)";else t.element.style.transform="scale(1)"};return{...t,position:{getPosition:()=>n,setPosition:(a)=>{if(Object.values(Kt).includes(a))return s(a),t;else return console.warn(`Invalid position: ${a}. Using default: ${Kt.CENTER}`),s(Kt.CENTER),t}}}};re();var xc=({lifecycle:e,queue:t,queueBehavior:n})=>(r)=>{if(!t)throw Error("Snackbar queue is required");let i=!1,s={element:r.element,actionButton:r.actionButton,timer:r.timer,position:r.position,state:i?"visible":"hidden",show(){if(i)return this;return i=!0,this.state="visible",t.add({...this,_show:()=>{document.body.appendChild(r.element);let a=r.element.offsetHeight;if(r.element.classList.add(`${r.getClass?.("snackbar")}--visible`),r.timer)r.timer.start();return this},_hide:()=>this.hide()},{behavior:n}),this},hide(){if(!i)return this;if(i=!1,this.state="hidden",r.timer)r.timer.stop();let a=(o)=>{if(o.propertyName!=="opacity")return;if(r.element.removeEventListener("transitionend",a),r.element.parentNode)r.element.remove()};return r.element.addEventListener("transitionend",a),r.element.classList.remove(`${r.getClass?.("snackbar")}--visible`),this},setMessage(a){return r.text?.setText(a),this},getMessage(){return r.text?.getText()||""},setAction(a){if(r.actionButton)r.actionButton.textContent=a;return this},getAction(){return r.actionButton?r.actionButton.textContent||"":""},setDuration(a){if(r.timer?.setDuration?.(a),i&&r.timer)r.timer.start();return this},getDuration(){return r.timer?.getDuration?.()??0},setPosition(a){if(r.position?.setPosition)r.position.setPosition(a);return this},getPosition(){return r.position?.getPosition?.()||"center"},on(a,o){return r.on?.(a,o),this},off(a,o){return r.off?.(a,o),this},destroy(){if(i&&r.element.parentNode)r.element.remove();if(r.timer)r.timer.stop();e.destroy()}};if(r.actionButton)r.actionButton.addEventListener("click",()=>{r.emit?.("action"),r.emit?.("dismiss")});if(r.on){let a=()=>{if(i)s.hide()};r.on("dismiss",a);let o=e.destroy;e.destroy=()=>{r.off?.("dismiss",a),o?.call(e)}}return s};var Ic=(e=Yt.QUEUE_GAP)=>{let t=[],n=null,r=null,i=null,s=()=>{if(i!==null)clearTimeout(i),i=null},a=()=>{if(n&&r)n.off?.("dismiss",r);n=null,r=null},o=()=>{if(s(),n||t.length===0)return;let l=t.shift();n=l;let d=()=>{if(a(),t.length>0)i=setTimeout(()=>{i=null,o()},e)};r=d,l.on?.("dismiss",d),l._show()};return{add(l,d={}){if(!l._show)throw Error("Snackbar must implement _show method");if((d.behavior??Cn.QUEUE)===Cn.REPLACE){if(t.length=0,s(),n)n._hide?.(),a();t.push(l),o();return}if(t.push(l),!n)o()},clear(){if(t.length=0,s(),n)n._hide?.(),a()},getLength(){return t.length+(n?1:0)}}};ne();var hp={variant:Yt.VARIANT,position:Yt.POSITION,duration:Yt.DURATION,queueBehavior:Yt.QUEUE_BEHAVIOR},Lc=(e)=>_(hp,e,"snackbar"),Ac=(e)=>V(e,{tag:"div",className:e.class}),wc=(e)=>({...e,text:e.message}),Nc=(e,t,n)=>({lifecycle:{destroy:e.lifecycle?.destroy||(()=>{})},queue:t,queueBehavior:n?.queueBehavior});var Cp=Ic(),Ep=(e)=>{if(!e.message)throw Error("Snackbar message is required");let t=Lc(e);try{return M(D,k(),O(Ac(t)),oe(t),yc(t),lt(wc(t)),Tc(t),P(),Sc(t),(r)=>xc(Nc(r,Cp,t))(r))(t)}catch(n){throw console.error("Snackbar creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create snackbar: ${n instanceof Error?n.message:String(n)}`)}},zs=Ep;se();te();re();var Dc=({disabled:e,lifecycle:t,checkable:n})=>(r)=>({...r,element:r.element,input:r.input,getValue(){return n.isChecked()},setValue(i){if(typeof i==="boolean")if(i)n.check();else n.uncheck();else if(typeof i==="string")if(i==="true"||i==="1")n.check();else n.uncheck();return this},getValueAttribute(){return r.input?.value||""},setValueAttribute(i){if(r.input)r.input.value=i;return this},check(){return n.check(),this},uncheck(){return n.uncheck(),this},toggle(){return n.toggle(),this},isChecked(){return n.isChecked()},setLabel(i){return r.text?.setText(i),this},getLabel(){return r.text?.getText()||""},supportingTextElement:r.supportingTextElement||null,setSupportingText(i,s){if(r.setSupportingText)r.setSupportingText(i,s);return this},removeSupportingText(){if(r.removeSupportingText)r.removeSupportingText();return this},on(i,s){return r.on?.(i,s),this},off(i,s){return r.off?.(i,s),this},enable(){return e.enable(),this},disable(){return e.disable(),this},destroy(){t.destroy()}});re();var Mc=(e,t,n)=>{let r=t||"mtrl",i=n||"switch",s=e.element.querySelector(`.${r}-${i}-container`);if(!s){s=document.createElement("div"),s.className=`${r}-${i}-container`;let o=e.element.querySelector(`.${r}-${i}-input`),l=e.element.querySelector(`.${r}-${i}-track`),d=[];if(o)d.push(o);if(l)d.push(l);let u=document.createElement("div");u.className=`${r}-${i}-content`;let f=e.element.querySelector(`.${r}-${i}-label`);if(f)u.appendChild(f);return s.appendChild(u),d.forEach((c)=>s.appendChild(c)),e.element.appendChild(s),{container:s,contentWrapper:u}}let a=e.element.querySelector(`.${r}-${i}-content`);if(!a){a=document.createElement("div"),a.className=`${r}-${i}-content`;let o=e.element.querySelector(`.${r}-${i}-label`);if(o)a.appendChild(o);s.insertBefore(a,s.firstChild)}return{container:s,contentWrapper:a}},Oc=(e)=>(t)=>{let n=e.prefix||"mtrl",r=e.componentName||"switch",{contentWrapper:i}=Mc(t,n,r),s=null;if(e.supportingText){if(s=document.createElement("div"),s.className=`${n}-${r}-helper`,s.textContent=e.supportingText,e.error)s.classList.add(`${n}-${r}-helper--error`),t.element.classList.add(`${n}-${r}--error`);i.appendChild(s)}if("lifecycle"in t&&t.lifecycle&&typeof t.lifecycle==="object"&&"destroy"in t.lifecycle&&s){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{if(s)s.remove();a.call(t.lifecycle)}}return{...t,supportingTextElement:s,setSupportingText(a,o=!1){let{contentWrapper:l}=Mc(t,n,r),d=this.supportingTextElement;if(!d)d=document.createElement("div"),d.className=`${n}-${r}-helper`,l.appendChild(d),this.supportingTextElement=d;return d.textContent=a,d.classList.toggle(`${n}-${r}-helper--error`,o),t.element.classList.toggle(`${n}-${r}--error`,o),this},removeSupportingText(){if(this.supportingTextElement&&this.supportingTextElement.parentNode)this.supportingTextElement.remove(),this.supportingTextElement=null,t.element.classList.remove(`${n}-${r}--error`);return this}}},Rc=(e)=>(t)=>{let n={...e,prefix:e.prefix||"mtrl",componentName:e.componentName||"switch"};return wn(n)(t)};ne();var vp={prefix:"mtrl",componentName:"switch"},_c=(e={})=>_(vp,e,"switch"),Pc=(e)=>V(e,{tag:"div",className:e.class,interactive:!0}),kc=(e)=>({disabled:{enable:e.disabled?.enable,disable:e.disabled?.disable},lifecycle:{destroy:e.lifecycle?.destroy},checkable:{check:e.checkable?.check,uncheck:e.checkable?.uncheck,toggle:e.checkable?.toggle,isChecked:e.checkable?.isChecked}});var Tp=(e={})=>{let t=_c(e);try{return M(D,k(),O(Pc(t)),et(t),Rt(t),Rc(t),Oc(t),_t(t),de(t),P(),(r)=>Dc(kc(r))(r))(t)}catch(n){throw console.error("Switch creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create switch: ${n instanceof Error?n.message:String(n)}`)}},Ks=Tp;se();te();re();se();te();re();var Sp={PRIMARY:"primary",SECONDARY:"secondary"},$c={ACTIVE:"active",INACTIVE:"inactive",DISABLED:"disabled"},yp={FIXED:"fixed",DYNAMIC:"dynamic",CONTENT:"content",AUTO:"auto"};var Kn={VARIANT:Sp.PRIMARY,SCROLLABLE:!0,SHOW_DIVIDER:!0,INDICATOR_HEIGHT:3,INDICATOR_WIDTH_STRATEGY:yp.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},En={ICON_ONLY:"icon-only",TEXT_ONLY:"text-only",ICON_AND_TEXT:"icon-and-text"};ne();te();var xp={state:$c.INACTIVE,componentName:"tab",ripple:Kn.RIPPLE},Ip={variant:Kn.VARIANT,scrollable:Kn.SCROLLABLE,showDivider:Kn.SHOW_DIVIDER,componentName:"tabs"},Vc=(e={})=>_(Ip,e,"tabs"),Fc=(e={})=>_(xp,e,"tab"),Uc=(e)=>{let t={tag:"div",attributes:{role:"tablist","aria-orientation":"horizontal"},className:[`${e.prefix}-tabs`,`${e.prefix}-tabs--${e.variant||"primary"}`,e.class]};return(n)=>O(t)(n)};Ht();var bn=(e={})=>{let t=Fc(e);try{let n=M(D,k(),P())(t),r=We({text:t.text,icon:t.icon,iconSize:t.iconSize,disabled:t.disabled,ripple:t.ripple!==!1,rippleConfig:{duration:400,timing:"cubic-bezier(0.4, 0, 0.2, 1)",opacity:["0.2","0"],...t.rippleConfig||{}},value:t.value,prefix:t.prefix,variant:"text",class:`${t.prefix}-tab`});if(n.element=r.element,n.element.setAttribute("role","tab"),n.element.setAttribute("aria-selected",t.state==="active"?"true":"false"),t.value)n.element.setAttribute("id",`tab-${t.value}`),n.element.setAttribute("aria-controls",`tabpanel-${t.value}`);if(t.state==="active")n.element.classList.add(`${n.getClass("tab")}--active`);r.on("click",(s)=>{if(n.emit)n.emit("click",s)});let i={...n,button:r,element:r.element,badge:null,getValue(){return r.getValue()},setValue(s){let a=s||"";return r.setValue(a),this.element.setAttribute("id",`tab-${a}`),this.element.setAttribute("aria-controls",`tabpanel-${a}`),this},activate(){this.element.classList.add(`${this.getClass("tab")}--active`),this.element.setAttribute("aria-selected","true");let s=new CustomEvent("tab:activated",{bubbles:!0,detail:{value:this.getValue()}});return this.element.dispatchEvent(s),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 r.enable(),this.element.removeAttribute("aria-disabled"),this},disable(){return r.disable(),this.element.setAttribute("aria-disabled","true"),this},setText(s){return r.setText(s),this.updateLayoutStyle(),this},getText(){return r.getText()},setIcon(s){return r.setIcon(s),this.updateLayoutStyle(),this},getIcon(){return r.getIcon()},setBadge(s){if(!this.badge){let a={content:s,standalone:!1,target:this.element,prefix:t.prefix,...t.badgeConfig||{}};this.badge=Mn(a)}else this.badge.setContent(s),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(r.destroy)r.destroy();n.lifecycle.destroy()},updateLayoutStyle(){let s=!!this.getText(),a=!!this.getIcon(),o="";if(s&&a)o=En.ICON_AND_TEXT;else if(a)o=En.ICON_ONLY;else o=En.TEXT_ONLY;if(Object.values(En).forEach((l)=>{this.element.classList.remove(`${this.getClass("tab")}--${l}`)}),this.element.classList.add(`${this.getClass("tab")}--${o}`),o===En.ICON_ONLY&&s)this.element.setAttribute("aria-label",this.getText());else this.element.removeAttribute("aria-label")}};if(t.badge!==void 0)i.setBadge(t.badge);return i.updateLayoutStyle(),i}catch(n){throw console.error("Tab creation error:",n),Error(`Failed to create tab: ${n.message}`)}};var Gc=({lifecycle:e})=>(t)=>({...t,element:t.element,addTab(n){let r={...n,prefix:t.config.prefix,variant:n.variant||t.config.variant};if(r.value===void 0)r.value="";let i=bn(r);if(t.tabs.push(i),t.tabsContainer.appendChild(i.element),i.on&&typeof i.on==="function")i.on("click",(a)=>t.handleTabClick(a,i));return i.element.addEventListener("click",(a)=>{t.handleTabClick(a,i)}),i},add(n){if(t.tabs.push(n),t.tabsContainer.appendChild(n.element),n.on&&typeof n.on==="function")n.on("click",(i)=>t.handleTabClick(i,n));return n.element.addEventListener("click",(i)=>{t.handleTabClick(i,n)}),this},getTabs(){return[...t.tabs]},getActiveTab(){return t.tabs.find((n)=>n.isActive())||null},setActiveTab(n){let r=typeof n==="string"?t.tabs.find((i)=>i.getValue()===n):n;if(!r)return this;if(t.tabs.forEach((i)=>i.deactivate()),r.activate(),t.emit)t.emit("change",{tab:r,value:r.getValue()});return this},removeTab(n){let r=typeof n==="string"?t.tabs.find((s)=>s.getValue()===n):n;if(!r)return this;let i=t.tabs.indexOf(r);if(i!==-1)t.tabs.splice(i,1);if(r.element.parentNode)r.element.parentNode.removeChild(r.element);return r.destroy(),this},on(n,r){if(t.on)t.on(n,r);return this},off(n,r){if(t.off)t.off(n,r);return this},destroy(){t.tabs.forEach((n)=>n.destroy()),t.tabs.length=0,e.destroy()}}),zc=(e)=>({lifecycle:{destroy:()=>e.lifecycle.destroy()}});function Wc(e){if(typeof e.getActiveTab==="function")return e.getActiveTab();if(Array.isArray(e.tabs))return e.tabs.find((t)=>t.isActive&&t.isActive());return null}function Kc(e){let t=Wc(e);if(!t)return;if(typeof t.getValue!=="function")return;let n=t.getValue();document.querySelectorAll('[role="tabpanel"]').forEach((i)=>{if(i.getAttribute("aria-labelledby")?.replace("tab-","")===n)i.removeAttribute("hidden"),i.setAttribute("tabindex","0");else i.setAttribute("hidden","true"),i.setAttribute("tabindex","-1")})}function Yc(e){if(!e.element)return;e.element.addEventListener("keydown",(t)=>{if(t.target!==t.currentTarget)return;if(typeof e.getTabs!=="function"||typeof e.setActiveTab!=="function")return;let n=e.getTabs(),r=Wc(e),i=r?n.indexOf(r):-1,s=i;switch(t.key){case"ArrowRight":case"ArrowDown":s=i<n.length-1?i+1:0;break;case"ArrowLeft":case"ArrowUp":s=i>0?i-1:n.length-1;break;case"Home":s=0;break;case"End":s=n.length-1;break;default:return}if(s!==i&&n[s])t.preventDefault(),n[s].element.focus(),e.setActiveTab(n[s])})}var Lp={widthStrategy:"auto",fixedWidth:40,animationDuration:250,animationTiming:"cubic-bezier(0.4, 0, 0.2, 1)",visible:!0,prefix:"mtrl",variant:"primary"},Xc=(e={})=>{let t={...Lp,...e},n=t.prefix||"mtrl",r=document.createElement("div");if(r.className=`${n}-tabs-indicator`,r.style.transition=`transform ${t.animationDuration}ms ${t.animationTiming},
|
|
28
|
+
`,e.closeButtonElement.addEventListener("click",()=>{n()}),We()&&t.optimizeForTouch)e.closeButtonElement.style.minWidth=`${Xr.COMFORTABLE}px`,e.closeButtonElement.style.minHeight=`${Xr.COMFORTABLE}px`,e.closeButtonElement.addEventListener("touchstart",()=>{e.closeButtonElement.classList.add("active")},{passive:!0}),e.closeButtonElement.addEventListener("touchend",()=>{setTimeout(()=>{e.closeButtonElement.classList.remove("active")},gt.FEEDBACK_DURATION)},{passive:!0});return e.drawer.element.appendChild(e.closeButtonElement),e.closeButtonElement},Ru=(e,t,n,r)=>{let{drawer:i,rail:s}=e;if(!i||!s)return;if(Rg(e,t,n),_g(e,t,n),Pg(e,t,n,r),t.enableSwipeGestures&&We())kg(e,n,r);n()},Pg=(e,t,n,r)=>{if(!t.hideOnClickOutside)return;if(e.outsideClickHandlerSet)return;e.outsideClickHandlerSet=!0;let i=We()?"touchend":"click",s=(a)=>{if(!e.isMobile||!r())return;let l=Je(a).target;if(e.drawer.element.contains(l)||e.rail.element.contains(l))return;n()};e.outsideClickHandler=s,document.addEventListener(i,s,We()?{passive:!0}:!1)},kg=(e,t,n,r)=>{let{drawer:i,rail:s}=e;if(!i||!s)return;let a=0,o=0;s.element.addEventListener("touchstart",(l)=>{let d=l.touches[0];a=d.clientX,o=d.clientY},{passive:!0}),s.element.addEventListener("touchmove",(l)=>{if(!e.isMobile||n()||!r)return;let d=l.touches[0],u=d.clientX-a,f=d.clientY-o;if(Math.abs(u)>Math.abs(f)&&u>gt.SWIPE_THRESHOLD)r()},{passive:!0}),i.element.addEventListener("touchstart",(l)=>{let d=l.touches[0];a=d.clientX,o=d.clientY},{passive:!0}),i.element.addEventListener("touchmove",(l)=>{if(!e.isMobile||!n())return;let u=l.touches[0].clientX-a;if(u<0){if(i.element.style.transform=`translateX(${u/2}px)`,u<-gt.SWIPE_THRESHOLD)t()}},{passive:!0}),i.element.addEventListener("touchend",()=>{if(i.element.style.transform)i.element.style.transition="transform 0.2s ease",i.element.style.transform="",setTimeout(()=>{i.element.style.transition=""},200)},{passive:!0})},_u=(e,t)=>{if(e.overlayElement)e.overlayElement.classList.remove("active"),e.overlayElement.setAttribute("aria-hidden","true");if(e.closeButtonElement)e.closeButtonElement.style.display="none";document.body.classList.remove(t.bodyLockClass)};var Bg=(e={})=>{let t=bu(e),n=ns(e),r=rs(e),i={initialize:()=>i,cleanup:()=>{},navigateTo:()=>{},getRail:()=>t.rail,getDrawer:()=>t.drawer,getActiveSection:()=>t.activeSection,getActiveSubsection:()=>t.activeSubsection,showDrawer:()=>{},hideDrawer:()=>{},isDrawerVisible:()=>!1,configure:()=>i,setProcessingChange:()=>{},isProcessingChange:()=>!1,isMobile:()=>t.isMobile,checkMobileState:()=>{},onSectionChange:void 0,onItemSelect:void 0,onViewChange:void 0},s=()=>yu(t,r),a=()=>xu(t,r),o=()=>Iu(t),l=(m)=>{vu(t,m,s,a)},d=()=>{Ru(t,r,a,o)},u=()=>{Lu(t,r,d,()=>_u(t,r),i)},f=(m,p,h)=>{wu(t,m,p,h)},c=()=>{if(t.rail=Tu(t,n),t.drawer=Su(t,n),Nu(t,n,l,s,a,i),Du(t,n,a,i),Mu(t,u),e.activeSection&&t.items[e.activeSection]){if(t.activeSection=e.activeSection,t.rail)t.rail.setActive(e.activeSection);if(l(e.activeSection),e.expanded===!0)s();else a()}return u(),i},C=()=>{Ou(t,u),Au(t)},g=(m)=>(Object.assign(e,m),Object.assign(n,ns({...e,...m})),Object.assign(r,rs({...e,...m})),i);return i.initialize=c,i.cleanup=C,i.navigateTo=f,i.showDrawer=s,i.hideDrawer=a,i.isDrawerVisible=o,i.configure=g,i.setProcessingChange=(m)=>{t.processingChange=m},i.isProcessingChange=()=>t.processingChange,i.isMobile=()=>t.isMobile,i.checkMobileState=u,i},Pu=Bg;li();se();te();re();var ku=(e)=>(t)=>{let n=[],r=t.getClass("radios"),i=e.value||"";if(t.element.classList.add(`${r}--${e.direction||"vertical"}`),e.disabled)t.element.classList.add(`${r}--disabled`);let s=(l)=>{let d=document.createElement("div");d.classList.add(`${r}-item`);let u=document.createElement("input");if(u.type="radio",u.name=e.name,u.value=l.value,u.classList.add(`${r}-input`),i===l.value)u.checked=!0;if(e.disabled||l.disabled)u.disabled=!0,d.classList.add(`${r}-item--disabled`);let f=document.createElement("label");f.classList.add(`${r}-label`);let c=document.createElement("span");c.classList.add(`${r}-control`);let C=document.createElement("span");if(C.classList.add(`${r}-circle`),e.ripple!==!1){let h=document.createElement("span");h.classList.add(`${r}-ripple`),c.appendChild(h)}c.appendChild(C);let g=document.createElement("span");if(g.classList.add(`${r}-text`),g.textContent=l.label,l.labelBefore)f.classList.add(`${r}-label--before`),f.appendChild(g),f.appendChild(c);else f.appendChild(c),f.appendChild(g);let m=`${r}-${l.value}-${Math.random().toString(36).substring(2,9)}`;u.id=m,f.htmlFor=m,d.appendChild(u),d.appendChild(f);let p=(h)=>{if(u.checked){if(i=l.value,n.forEach((b)=>{if(b.input!==u)b.input.checked=!1}),t.events&&typeof t.events.emit==="function")t.events.emit("change",{value:l.value,originalEvent:h,option:l});else if(typeof t.on==="function"){let b=new CustomEvent("change",{detail:{value:l.value,originalEvent:h,option:l}});t.element.dispatchEvent(b)}}};return u.addEventListener("change",p),{element:d,input:u,label:f,config:l,destroy:()=>{if(u.removeEventListener("change",p),d.parentNode)d.parentNode.removeChild(d)}}},a=(l)=>{let d=s(l);return t.element.appendChild(d.element),n.push(d),t},o=(l)=>{let d=n.findIndex((u)=>u.config.value===l);if(d!==-1){if(n[d].destroy(),n.splice(d,1),i===l)i=""}return t};if(e.options&&Array.isArray(e.options))e.options.forEach((l)=>a(l));if(!t.events)t.events={on:(l,d)=>{t.element.addEventListener(l,(u)=>d(u.detail))},off:(l,d)=>{t.element.removeEventListener(l,d)},emit:(l,d)=>{let u=new CustomEvent(l,{detail:d});t.element.dispatchEvent(u)}};return{...t,radios:n,getValue:()=>i,setValue:(l)=>(i=l,n.forEach((d)=>{d.input.checked=d.config.value===l}),t),getSelected:()=>{let l=n.find((d)=>d.config.value===i);return l?l.config:null},addOption:a,removeOption:o,enable:()=>(t.element.classList.remove(`${r}--disabled`),n.forEach((l)=>{if(l.input.disabled=l.config.disabled||!1,!l.config.disabled)l.element.classList.remove(`${r}-item--disabled`)}),t),disable:()=>(t.element.classList.add(`${r}--disabled`),n.forEach((l)=>{l.input.disabled=!0,l.element.classList.add(`${r}-item--disabled`)}),t),enableOption:(l)=>{let d=n.find((u)=>u.config.value===l);if(d){if(d.config.disabled=!1,d.input.disabled=t.element.classList.contains(`${r}--disabled`),!d.input.disabled)d.element.classList.remove(`${r}-item--disabled`)}return t},disableOption:(l)=>{let d=n.find((u)=>u.config.value===l);if(d)d.config.disabled=!0,d.input.disabled=!0,d.element.classList.add(`${r}-item--disabled`);return t}}};var Bu=({disabled:e,lifecycle:t})=>(n)=>{if(!n.events)n.events={on:(i,s)=>{n.element.addEventListener(i,(a)=>s(a.detail))},off:(i,s)=>{n.element.removeEventListener(i,s)},emit:(i,s)=>{let a=new CustomEvent(i,{detail:s});n.element.dispatchEvent(a)}};else if(!n.events.emit)n.events.emit=(i,s)=>{let a=new CustomEvent(i,{detail:s});n.element.dispatchEvent(a)};return{element:n.element,radios:n.radios,lifecycle:{destroy:t.destroy},getClass:n.getClass,getValue:()=>n.getValue(),setValue(i){return n.setValue(i),this},getSelected:()=>n.getSelected(),addOption(i){return n.addOption(i),this},removeOption(i){return n.removeOption(i),this},enable(){return e.enable(),this},disable(){return e.disable(),this},enableOption(i){return n.enableOption(i),this},disableOption(i){return n.disableOption(i),this},on(i,s){return n.events.on(i,s),this},off(i,s){return n.events.off(i,s),this},destroy(){n.radios.forEach((i)=>i.destroy()),t.destroy()}}};ne();var Hg={name:"",direction:"vertical",disabled:!1,ripple:!0,options:[]},Hu=(e)=>_(Hg,e,"radios"),$u=(e)=>V(e,{tag:"div",attributes:{role:"radiogroup"},className:e.class}),Vu=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable()},lifecycle:{destroy:()=>e.lifecycle.destroy()}});var $g=(e)=>{if(!e.name)e.name=`radios-${Math.random().toString(36).substring(2,9)}`;let t=Hu(e);try{return M(D,k(),O($u(t)),ku(t),de(t),P(),(r)=>Bu(Vu(r))(r))(t)}catch(n){throw console.error("Radios creation error:",n),Error(`Failed to create radios component: ${n.message}`)}},ss=$g;te();re();var _e={BAR:"bar",VIEW:"view"},Ut={DOCKED:"docked",FULLSCREEN:"fullscreen"},os={BAR_HEIGHT:56,BAR_MIN_WIDTH:360,BAR_MAX_WIDTH:720,VIEW_DOCKED_HEADER_HEIGHT:56,VIEW_DOCKED_MIN_WIDTH:360,VIEW_DOCKED_MAX_WIDTH:720,VIEW_DOCKED_MIN_HEIGHT:240,VIEW_FULLSCREEN_HEADER_HEIGHT:72,PADDING_HORIZONTAL:16,ICON_SIZE:24,AVATAR_SIZE:30,ICON_SPACING:16},Gt={FOCUS:"focus",BLUR:"blur",INPUT:"input",SUBMIT:"submit",CLEAR:"clear",EXPAND:"expand",COLLAPSE:"collapse",SUGGESTION_SELECT:"suggestionSelect"},mt={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>',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>',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>',MIC:'<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 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z"/></svg>',HISTORY:'<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="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"/></svg>'},mn={STATE:_e.BAR,VIEW_MODE:Ut.DOCKED,PLACEHOLDER:"Search",VALUE:"",SHOW_CLEAR_BUTTON:!0,DISABLED:!1,FULL_WIDTH:!1},z={ROOT:"search",STATE_BAR:"search--bar",STATE_VIEW:"search--view",VIEW_DOCKED:"search--docked",VIEW_FULLSCREEN:"search--fullscreen",FOCUSED:"search--focused",DISABLED:"search--disabled",POPULATED:"search--populated",FULL_WIDTH:"search--full-width",CONTAINER:"search__container",HEADER:"search__header",INPUT_WRAPPER:"search__input-wrapper",INPUT:"search__input",DIVIDER:"search__divider",CONTENT:"search__content",LEADING_ICON:"search__leading-icon",TRAILING_ICON:"search__trailing-icon",CLEAR_BUTTON:"search__clear-button",CLEAR_BUTTON_HIDDEN:"search__clear-button--hidden",AVATAR:"search__avatar",SUGGESTIONS:"search__suggestions",SUGGESTION_LIST:"search__suggestion-list",SUGGESTION_ITEM:"search__suggestion-item",SUGGESTION_ITEM_SELECTED:"search__suggestion-item--selected",SUGGESTION_ICON:"search__suggestion-icon",SUGGESTION_TEXT:"search__suggestion-text",SUGGESTION_DIVIDER:"search__suggestion-divider"},fn={ENTER:"Enter",ESCAPE:"Escape",ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",TAB:"Tab"};Qe();var ls=(e)=>(t)=>{let n=e.disabled===!0,r=e.initialState||_e.BAR,i=r===_e.VIEW,s=e.placeholder||"Search",a=e.value||"",o=(S)=>t.getClass?t.getClass(S):S,l=[o(z.ROOT),o(r===_e.BAR?z.STATE_BAR:z.STATE_VIEW),o(e.viewMode==="fullscreen"?z.VIEW_FULLSCREEN:z.VIEW_DOCKED)];if(e.fullWidth)l.push(o(z.FULL_WIDTH));if(n)l.push(o(z.DISABLED));if(a)l.push(o(z.POPULATED));t.element.className=l.filter(Boolean).join(" "),t.element.setAttribute("role","search"),t.element.setAttribute("aria-disabled",n?"true":"false");let d=B({tag:"div",className:o(z.CONTAINER),container:t.element}),u=i?mt.BACK:e.leadingIcon||mt.SEARCH,f=B({tag:"button",className:o(z.LEADING_ICON),container:d,html:u,attributes:{type:"button",tabindex:n?"-1":"0","aria-label":i?"Go back":"Search"}}),c=B({tag:"div",className:o(z.INPUT_WRAPPER),container:d}),C={type:"text",placeholder:s,"aria-label":s};if(a)C.value=a;if(n)C.disabled="disabled";let g=B({tag:"input",className:o(z.INPUT),container:c,attributes:C});if(a)g.value=a;let m=null;if(e.showClearButton!==!1){let S=[o(z.CLEAR_BUTTON)];if(!a)S.push(o(z.CLEAR_BUTTON_HIDDEN));m=B({tag:"button",className:S.join(" "),container:d,html:mt.CLEAR,attributes:{type:"button",tabindex:n||!a?"-1":"0","aria-label":"Clear search"}})}let p=null;if(e.trailingItems&&e.trailingItems.length>0)p=B({tag:"div",className:o("search__trailing"),container:d}),e.trailingItems.forEach((S)=>{let y=S.type==="avatar"?o(z.AVATAR):o(z.TRAILING_ICON);B({tag:S.type==="avatar"?"div":"button",className:y,container:p,html:S.content,attributes:{...S.type!=="avatar"&&{type:"button"},tabindex:n?"-1":"0","aria-label":S.ariaLabel||"","data-trailing-id":S.id}})});let h=null,b=null,v=null,E=null;if(h=B({tag:"div",className:o(z.DIVIDER)}),b=B({tag:"div",className:o(z.CONTENT)}),v=B({tag:"div",className:o(z.SUGGESTIONS),container:b}),E=B({tag:"ul",className:o(z.SUGGESTION_LIST),container:v,attributes:{role:"listbox","aria-label":"Search suggestions"}}),i)t.element.appendChild(h),t.element.appendChild(b);return{...t,structure:{container:d,input:g,inputWrapper:c,leadingIcon:f,clearButton:m,trailingContainer:p,divider:h,suggestionsContainer:v,suggestionsList:E}}};var ds=(e)=>(t)=>{let n=e.initialState||_e.BAR,r=e.viewMode||Ut.DOCKED,i=e.disabled===!0,s=(C)=>t.getClass?t.getClass(C):C,a=()=>{if(n===_e.VIEW||i)return;let{element:C,structure:g}=t;if(n=_e.VIEW,C.classList.remove(s(z.STATE_BAR)),C.classList.add(s(z.STATE_VIEW)),g?.leadingIcon)g.leadingIcon.innerHTML=mt.BACK,g.leadingIcon.setAttribute("aria-label","Go back");if(g?.divider&&!C.contains(g.divider))C.appendChild(g.divider);if(g?.suggestionsContainer?.parentElement&&!C.contains(g.suggestionsContainer.parentElement))C.appendChild(g.suggestionsContainer.parentElement);if(g?.input)requestAnimationFrame(()=>{g.input.focus()});if(t.emit)t.emit("expand",{component:t,state:n,viewMode:r})},o=()=>{if(n===_e.BAR)return;let{element:C,structure:g}=t;if(n=_e.BAR,C.classList.remove(s(z.STATE_VIEW)),C.classList.add(s(z.STATE_BAR)),g?.leadingIcon)g.leadingIcon.innerHTML=e.leadingIcon||mt.SEARCH,g.leadingIcon.setAttribute("aria-label","Search");if(g?.divider&&C.contains(g.divider))C.removeChild(g.divider);if(g?.suggestionsContainer?.parentElement&&C.contains(g.suggestionsContainer.parentElement))C.removeChild(g.suggestionsContainer.parentElement);if(t.emit)t.emit("collapse",{component:t,state:n,viewMode:r})},l=(C)=>{if(C===r)return;let g=t.element;g.classList.remove(s(r===Ut.DOCKED?z.VIEW_DOCKED:z.VIEW_FULLSCREEN)),r=C,g.classList.add(s(C===Ut.DOCKED?z.VIEW_DOCKED:z.VIEW_FULLSCREEN))},d=()=>{i=!0;let{element:C,structure:g}=t;if(C.classList.add(s(z.DISABLED)),C.setAttribute("aria-disabled","true"),g?.input)g.input.disabled=!0;let m=[g?.leadingIcon,g?.clearButton].filter(Boolean);if(g?.trailingContainer)g.trailingContainer.querySelectorAll("button").forEach((h)=>m.push(h));m.forEach((p)=>{if(p)p.tabIndex=-1,p.setAttribute("aria-disabled","true")})},u=()=>{i=!1;let{element:C,structure:g}=t;if(C.classList.remove(s(z.DISABLED)),C.setAttribute("aria-disabled","false"),g?.input)g.input.disabled=!1;let m=[g?.leadingIcon,g?.clearButton].filter(Boolean);if(g?.trailingContainer)g.trailingContainer.querySelectorAll("button").forEach((h)=>m.push(h));if(m.forEach((p)=>{if(p)p.tabIndex=0,p.setAttribute("aria-disabled","false")}),g?.clearButton&&g.input&&!g.input.value)g.clearButton.tabIndex=-1},f=(C)=>{let g=t.element;if(C)g.classList.add(s(z.POPULATED));else g.classList.remove(s(z.POPULATED))},c=(C)=>{let g=t.element;if(C)g.classList.add(s(z.FOCUSED));else g.classList.remove(s(z.FOCUSED))};if(i)setTimeout(()=>{d()},0);return{...t,states:{expand:a,collapse:o,getState:()=>n,isExpanded:()=>n===_e.VIEW,setViewMode:l,getViewMode:()=>r,updatePopulatedState:f,updateFocusedState:c},disabled:{enable(){return u(),this},disable(){return d(),this},isDisabled:()=>i}}};var Fu=(e)=>{if(!e)return[];return e.map((t)=>{if(typeof t==="string")return{text:t,value:t};return{...t,value:t.value??t.text}})},us=(e)=>(t)=>{let n=e.value||"",r=e.placeholder||"Search",i=Fu(e.suggestions),s=(S)=>t.getClass?t.getClass(S):S,a=(S,y=null,L={})=>{let I={component:t,value:n,originalEvent:y,preventDefault:()=>{I.defaultPrevented=!0},defaultPrevented:!1,...L};return I},o=(S,y=null,L={})=>{let I=a(S,y,L);if(t.emit)t.emit(S,I);let x=`on${S.charAt(0).toUpperCase()}${S.slice(1)}`,A=e[x];if(typeof A==="function")if(S==="suggestionSelect"&&L.suggestion)A(L.suggestion);else A(n);return I},l=(S)=>{let y=t.structure?.clearButton;if(!y)return;if(S){if(y.classList.remove(s(z.CLEAR_BUTTON_HIDDEN)),!t.disabled?.isDisabled())y.tabIndex=0}else y.classList.add(s(z.CLEAR_BUTTON_HIDDEN)),y.tabIndex=-1},d=(S,y=!0)=>{let L=n;n=S;let I=t.structure?.input;if(I&&I.value!==S)I.value=S;if(l(!!S),t.states?.updatePopulatedState)t.states.updatePopulatedState(!!S);if(y&&S!==L)o(Gt.INPUT)},u=()=>n,f=(S)=>{r=S;let y=t.structure?.input;if(y)y.placeholder=S,y.setAttribute("aria-label",S)},c=()=>r,C=(S=!0)=>{d("",!1);let y=t.structure?.input;if(y&&!t.disabled?.isDisabled())y.focus();if(S)o(Gt.CLEAR)},g=()=>{if(n)o(Gt.SUBMIT)},m=()=>{let S=t.structure?.input;if(S&&!t.disabled?.isDisabled())S.focus()},p=()=>{let S=t.structure?.input;if(S)S.blur()},h=(S)=>{i=Fu(S)},b=()=>[...i],v=()=>{i=[]},E=(S)=>{d(S.value??S.text,!1),o(Gt.SUGGESTION_SELECT,null,{suggestion:S})},T=()=>{let S=t.structure?.input,y=t.structure?.clearButton,L=t.structure?.leadingIcon;if(!S)return;if(S.addEventListener("input",(I)=>{let x=I.target;d(x.value,!0)}),S.addEventListener("focus",(I)=>{if(t.states?.updateFocusedState)t.states.updateFocusedState(!0);if(o(Gt.FOCUS,I),e.expandOnFocus!==!1&&t.states?.expand)t.states.expand()}),S.addEventListener("blur",(I)=>{if(t.states?.updateFocusedState)t.states.updateFocusedState(!1);if(o(Gt.BLUR,I),e.collapseOnBlur!==!1&&t.states?.collapse){let x=e.collapseDelay??150;setTimeout(()=>{if(document.activeElement!==S)t.states.collapse()},x)}}),S.addEventListener("keydown",(I)=>{switch(I.key){case"Enter":I.preventDefault(),g();break;case"Escape":if(I.preventDefault(),n)C();else if(t.states?.isExpanded?.())t.states.collapse();break;case"ArrowDown":break;case"ArrowUp":break}}),y)y.addEventListener("click",(I)=>{I.preventDefault(),I.stopPropagation(),C()}),y.addEventListener("keydown",(I)=>{if(I.key==="Enter"||I.key===" ")I.preventDefault(),C()});if(L)L.addEventListener("click",(I)=>{if(I.preventDefault(),t.states?.isExpanded?.())t.states.collapse();else t.states?.expand()}),L.addEventListener("keydown",(I)=>{if(I.key==="Enter"||I.key===" ")if(I.preventDefault(),t.states?.isExpanded?.())t.states.collapse();else t.states?.expand()})};return setTimeout(()=>{T()},0),{...t,input:{setValue:d,getValue:u,setPlaceholder:f,getPlaceholder:c,clear:C,submit:g,focus:m,blur:p,setSuggestions:h,getSuggestions:b,clearSuggestions:v,selectSuggestion:E,emitEvent:o}}};Qe();var cs=(e)=>(t)=>{let n=-1,r=[],i=(h)=>t.getClass?t.getClass(h):h,s=()=>{if(t.input?.getSuggestions)return t.input.getSuggestions();return r},a=(h,b)=>{if(!b)return h;let v=h.toLowerCase(),E=b.toLowerCase(),T=v.indexOf(E);if(T===-1)return h;let S=h.slice(0,T),y=h.slice(T,T+b.length),L=h.slice(T+b.length);return`${S}<strong>${y}</strong>${L}`},o=(h,b,v)=>{let E=b===n,T=[i(z.SUGGESTION_ITEM)];if(E)T.push(i(z.SUGGESTION_ITEM_SELECTED));let S=B({tag:"li",className:T.join(" "),attributes:{role:"option","aria-selected":E?"true":"false","data-index":String(b),"data-value":h.value??h.text,tabindex:"-1"}});if(h.icon){let L=B({tag:"span",className:i(z.SUGGESTION_ICON),container:S,html:h.icon})}else{let L=B({tag:"span",className:i(z.SUGGESTION_ICON),container:S,html:mt.HISTORY})}let y=B({tag:"span",className:i(z.SUGGESTION_TEXT),container:S,html:a(h.text,v)});return S},l=()=>B({tag:"li",className:i(z.SUGGESTION_DIVIDER),attributes:{role:"separator","aria-hidden":"true"}}),d=()=>{let h=t.structure?.suggestionsList;if(!h)return;let b=s(),v=t.input?.getValue?.()||"";if(h.innerHTML="",b.length===0)return;let E;b.forEach((S,y)=>{if(S.group&&S.group!==E){if(E!==void 0)h.appendChild(l());E=S.group}let L=o(S,y,v);L.addEventListener("click",(I)=>{I.preventDefault(),I.stopPropagation(),g(y)}),L.addEventListener("mouseenter",()=>{f(y)}),h.appendChild(L)});let T=b.length;h.setAttribute("aria-label",`${T} suggestion${T!==1?"s":""} available`)},u=()=>{let h=t.structure?.suggestionsList;if(h)h.innerHTML="";n=-1},f=(h)=>{let b=t.structure?.suggestionsList;if(!b)return;let v=s();if(h<-1)h=v.length-1;if(h>=v.length)h=-1;if(n>=0){let E=b.querySelector(`[data-index="${n}"]`);if(E)E.classList.remove(i(z.SUGGESTION_ITEM_SELECTED)),E.setAttribute("aria-selected","false")}if(n=h,n>=0){let E=b.querySelector(`[data-index="${n}"]`);if(E)E.classList.add(i(z.SUGGESTION_ITEM_SELECTED)),E.setAttribute("aria-selected","true"),E.scrollIntoView({block:"nearest",behavior:"smooth"})}},c=()=>{f(n+1)},C=()=>{f(n-1)},g=(h)=>{let b=s();if(h<0||h>=b.length)return;let v=b[h];if(t.input?.selectSuggestion)t.input.selectSuggestion(v);if(t.states?.collapse)t.states.collapse()},m=()=>{if(n>=0)return g(n),!0;return!1},p=()=>{let h=t.structure?.input;if(!h)return;h.addEventListener("keydown",(b)=>{let v=s();if(!t.states?.isExpanded?.()||v.length===0)return;switch(b.key){case fn.ARROW_DOWN:b.preventDefault(),c();break;case fn.ARROW_UP:b.preventDefault(),C();break;case fn.ENTER:if(n>=0)b.preventDefault(),m();break;case fn.TAB:if(n>=0)m();break;case fn.ESCAPE:n=-1;break}})};return setTimeout(()=>{p()},0),{...t,suggestions:{render:d,clear:u,setHighlightedIndex:f,getHighlightedIndex:()=>n,highlightNext:c,highlightPrevious:C,select:g,selectHighlighted:m}}};var Uu=(e)=>(t)=>({element:t.element,setValue(r,i=!0){return e.value.setValue(r,i),this},getValue(){return e.value.getValue()},setPlaceholder(r){return e.value.setPlaceholder(r),this},getPlaceholder(){return e.value.getPlaceholder()},expand(){return e.state.expand(),this},collapse(){return e.state.collapse(),this},getState(){return e.state.getState()},isExpanded(){return e.state.isExpanded()},setViewMode(r){return e.state.setViewMode(r),this},getViewMode(){return e.state.getViewMode()},focus(){return e.value.focus(),this},blur(){return e.value.blur(),this},clear(){return e.value.clear(),this},submit(){return e.value.submit(),this},setLeadingIcon(r){return console.warn("setLeadingIcon: Not yet implemented"),this},addTrailingItem(r){return console.warn("addTrailingItem: Not yet implemented"),this},removeTrailingItem(r){return console.warn("removeTrailingItem: Not yet implemented"),this},setTrailingItems(r){return console.warn("setTrailingItems: Not yet implemented"),this},setSuggestions(r){return e.suggestions.set(r),e.suggestions.render(),this},getSuggestions(){return e.suggestions.get()},clearSuggestions(){return e.suggestions.clear(),e.suggestions.render(),this},enable(){return e.disabled.enable(),this},disable(){return e.disabled.disable(),this},isDisabled(){return e.disabled.isDisabled()},on(r,i){return e.events.on(r,i),this},off(r,i){return e.events.off(r,i),this},destroy(){if(e.lifecycle?.destroy)e.lifecycle.destroy()}});ne();var Vg={initialState:_e.BAR,viewMode:Ut.DOCKED,disabled:mn.DISABLED,placeholder:mn.PLACEHOLDER,value:mn.VALUE,leadingIcon:void 0,trailingItems:void 0,suggestions:void 0,showClearButton:mn.SHOW_CLEAR_BUTTON,expandOnFocus:!0,collapseOnBlur:!0,collapseDelay:150,minWidth:os.BAR_MIN_WIDTH,maxWidth:os.BAR_MAX_WIDTH,fullWidth:mn.FULL_WIDTH},Gu=(e={})=>_(Vg,e,"search"),zu=(e)=>V(e,{tag:"div",attributes:{role:"search","aria-disabled":e.disabled===!0?"true":"false"},className:e.class}),Wu=(e)=>({value:{setValue:(t,n)=>e.input?.setValue?.(t,n),getValue:()=>e.input?.getValue?.()??"",setPlaceholder:(t)=>e.input?.setPlaceholder?.(t),getPlaceholder:()=>e.input?.getPlaceholder?.()??"",clear:()=>e.input?.clear?.(),submit:()=>e.input?.submit?.(),focus:()=>e.input?.focus?.(),blur:()=>e.input?.blur?.()},state:{expand:()=>e.states?.expand?.(),collapse:()=>e.states?.collapse?.(),getState:()=>e.states?.getState?.()??"bar",isExpanded:()=>e.states?.isExpanded?.()??!1,setViewMode:(t)=>e.states?.setViewMode?.(t),getViewMode:()=>e.states?.getViewMode?.()??"docked"},disabled:{enable:()=>e.disabled?.enable?.(),disable:()=>e.disabled?.disable?.(),isDisabled:()=>e.disabled?.isDisabled?.()??!1},suggestions:{set:(t)=>e.input?.setSuggestions?.(t),get:()=>e.input?.getSuggestions?.()??[],clear:()=>e.input?.clearSuggestions?.(),render:()=>e.suggestions?.render?.()},events:{on:(t,n)=>e.on?.(t,n),off:(t,n)=>e.off?.(t,n)},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}});var Fg=(e={})=>{let t=Gu(e);try{let n=M(D,k(),O(zu(t)),ls(t),ds(t),us(t),cs(t),P())(t),r=Wu(n),i=Uu(r)(n);if(t.on&&typeof i.on==="function")Object.entries(t.on).forEach(([s,a])=>{if(typeof a==="function")i.on(s,a)});return i}catch(n){throw console.error("Search creation error:",n),Error(`Failed to create search: ${n.message}`)}},ms=Fg;se();te();re();se();te();re();var Ku=({disabled:e,lifecycle:t})=>(n)=>({element:n.element,input:n.input,getValue:n.getValue||(()=>""),setValue(r){return n.setValue?.(r),this},setAttribute(r,i){return n.setAttribute?.(r,i),this},getAttribute(r){return n.getAttribute?.(r)||null},removeAttribute(r){return n.removeAttribute?.(r),this},setVariant(r){let i=n.config?.prefix||"mtrl",s=n.config?.componentName||"textfield";if(n.element.classList.remove(`${i}-${s}--filled`,`${i}-${s}--outlined`),n.element.classList.add(`${i}-${s}--${r}`),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10);return this},getVariant(){let r=n.config?.prefix||"mtrl",i=n.config?.componentName||"textfield";if(n.element.classList.contains(`${r}-${i}--outlined`))return"outlined";return"filled"},setLabel(r){if(n.label?.setText(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10);return this},getLabel(){return n.label?.getText()||""},leadingIcon:n.leadingIcon||null,setLeadingIcon(r){if(n.setLeadingIcon){if(n.setLeadingIcon(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},removeLeadingIcon(){if(n.removeLeadingIcon){if(n.removeLeadingIcon(),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},trailingIcon:n.trailingIcon||null,setTrailingIcon(r){if(n.setTrailingIcon){if(n.setTrailingIcon(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},removeTrailingIcon(){if(n.removeTrailingIcon){if(n.removeTrailingIcon(),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},supportingTextElement:n.supportingTextElement||null,setSupportingText(r,i){if(n.setSupportingText)n.setSupportingText(r,i);return this},removeSupportingText(){if(n.removeSupportingText)n.removeSupportingText();return this},prefixTextElement:n.prefixTextElement||null,setPrefixText(r){if(n.setPrefixText){if(n.setPrefixText(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},removePrefixText(){if(n.removePrefixText){if(n.removePrefixText(),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},suffixTextElement:n.suffixTextElement||null,setSuffixText(r){if(n.setSuffixText){if(n.setSuffixText(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},removeSuffixText(){if(n.removeSuffixText){if(n.removeSuffixText(),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},updatePositions(){if(n.input&&n.element){let r=n.input.value&&n.input.value.length>0,i=n.input.matches?.(":-webkit-autofill")||!1;if(r||i)n.element.classList.remove(`${n.config?.prefix||"mtrl"}-textfield--empty`);else n.element.classList.add(`${n.config?.prefix||"mtrl"}-textfield--empty`)}if(n.updateElementPositions)n.updateElementPositions();return this},setError(r,i){if(n.setError)n.setError(r,i);return this},isError(){return n.isError?.()||!1},setDensity(r){if(n.density?.set)n.density.set(r);return this},getDensity(){return n.density?.current||"default"},on(r,i){return n.on?.(r,i),this},off(r,i){return n.off?.(r,i),this},enable(){return e.enable(),this},disable(){return e.disable(),this},destroy(){t.destroy()}});var fs=(e)=>(t)=>{if(!e.leadingIcon)return t;let n=e.prefix||"mtrl",r=document.createElement("span");if(r.className=`${n}-${e.componentName||"textfield"}-leading-icon`,r.innerHTML=e.leadingIcon,t.element.appendChild(r),t.element.classList.add(`${n}-${e.componentName||"textfield"}--with-leading-icon`),t.input)t.input.classList.add(`${n}-${e.componentName||"textfield"}-input--with-leading-icon`);if("lifecycle"in t&&t.lifecycle?.destroy){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{r.remove(),i.call(t.lifecycle)}}return setTimeout(()=>{let i=t.element.querySelector(`.${n}-${e.componentName||"textfield"}-label`);if(i){if(!t.element.classList.contains(`${n}-${e.componentName||"textfield"}--with-prefix`))i.style.left="44px"}},10),{...t,leadingIcon:r,setLeadingIcon(i){return r.innerHTML=i,this},removeLeadingIcon(){if(r.parentNode){if(r.remove(),t.element.classList.remove(`${n}-${e.componentName||"textfield"}--with-leading-icon`),t.input)t.input.classList.remove(`${n}-${e.componentName||"textfield"}-input--with-leading-icon`);if(!t.element.classList.contains(`${n}-${e.componentName||"textfield"}--with-prefix`)){let i=t.element.querySelector(`.${n}-${e.componentName||"textfield"}-label`);if(i)i.style.left=""}this.leadingIcon=null}return this}}};var gs=(e)=>(t)=>{if(!e.trailingIcon)return t;let n=e.prefix||"mtrl",r=document.createElement("span");if(r.className=`${n}-${e.componentName||"textfield"}-trailing-icon`,r.innerHTML=e.trailingIcon,t.element.appendChild(r),t.element.classList.add(`${n}-${e.componentName||"textfield"}--with-trailing-icon`),t.input)t.input.classList.add(`${n}-${e.componentName||"textfield"}-input--with-trailing-icon`);if("lifecycle"in t&&t.lifecycle?.destroy){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{r.remove(),i.call(t.lifecycle)}}return{...t,trailingIcon:r,setTrailingIcon(i){return r.innerHTML=i,this},removeTrailingIcon(){if(r.parentNode){if(r.remove(),t.element.classList.remove(`${n}-${e.componentName||"textfield"}--with-trailing-icon`),t.input)t.input.classList.remove(`${n}-${e.componentName||"textfield"}-input--with-trailing-icon`);this.trailingIcon=null}return this}}};var ps=(e)=>(t)=>{if(!e.prefixText)return t;let n=e.prefix||"mtrl",r=document.createElement("span");if(r.className=`${n}-${e.componentName||"textfield"}-prefix`,r.textContent=e.prefixText,t.element.appendChild(r),t.element.classList.add(`${n}-${e.componentName||"textfield"}--with-prefix`),"lifecycle"in t&&t.lifecycle?.destroy){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{r.remove(),i.call(t.lifecycle)}}return{...t,prefixTextElement:r,setPrefixText(i){return r.textContent=i,this},removePrefixText(){if(r.parentNode){r.remove(),t.element.classList.remove(`${n}-${e.componentName||"textfield"}--with-prefix`);let i=t.element.querySelector(`.${n}-${e.componentName||"textfield"}-label`);if(i)i.style.left="";this.prefixTextElement=null}return this}}};var hs=(e)=>(t)=>{if(!e.suffixText)return t;let n=e.prefix||"mtrl",r=document.createElement("span");if(r.className=`${n}-${e.componentName||"textfield"}-suffix`,r.textContent=e.suffixText,t.element.appendChild(r),t.element.classList.add(`${n}-${e.componentName||"textfield"}--with-suffix`),"lifecycle"in t&&t.lifecycle?.destroy){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{r.remove(),i.call(t.lifecycle)}}return{...t,suffixTextElement:r,setSuffixText(i){return r.textContent=i,this},removeSuffixText(){if(r.parentNode)r.remove(),t.element.classList.remove(`${n}-${e.componentName||"textfield"}--with-suffix`),this.suffixTextElement=null;return this}}};var Cs=(e)=>(t)=>{let n=e.prefix||"mtrl",r=e.componentName||"textfield",i=null,s=(a,o=!1)=>{let l=document.createElement("div");if(l.className=`${n}-${r}-helper`,l.textContent=a,o)l.classList.add(`${n}-${r}-helper--error`),t.element.classList.add(`${n}-${r}--error`);return l};if(e.supportingText)i=s(e.supportingText,e.error),t.element.appendChild(i);if("lifecycle"in t&&t.lifecycle?.destroy){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{if(i)i.remove();a.call(t.lifecycle)}}return{...t,supportingTextElement:i,setSupportingText(a,o=!1){if(i)i.remove(),t.element.classList.remove(`${n}-${r}--error`);if(a)i=s(a,o),t.element.appendChild(i),this.supportingTextElement=i;else i=null,this.supportingTextElement=null,t.element.classList.remove(`${n}-${r}--error`);return this},removeSupportingText(){if(i)i.remove(),i=null,this.supportingTextElement=null,t.element.classList.remove(`${n}-${r}--error`);return this}}};ai();var Es=()=>(e)=>{let t=e.config.prefix||"mtrl",n=e.config.componentName||"textfield",r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=()=>{if(!e.element||!e.element.isConnected)return e;let d=e.element.querySelector(`.${t}-${n}-label`),u=e.element.querySelector(`.${t}-${n}-prefix`),f=e.element.querySelector(`.${t}-${n}-suffix`),c=e.element.classList.contains(`${t}-${n}--outlined`),C=e.element.classList.contains(`${t}-${n}--focused`),g=e.element.classList.contains(`${t}-${n}--empty`),m=e.element.classList.contains(`${t}-${n}--with-leading-icon`);if(c&&d){let{color:p,element:h}=Et(e.element);if(C||!g){if(d.style.backgroundColor=p,d.style.paddingLeft="4px",d.style.paddingRight="4px",h&&!r.has(e.element)){let b=new MutationObserver(()=>{let{color:T}=Et(e.element);d.style.backgroundColor=T});b.observe(h,{attributes:!0,attributeFilter:["style","class"]}),r.set(e.element,b);let v=h.parentElement,E=[];while(v&&v!==document.documentElement){let T=new MutationObserver(()=>{let{color:S}=Et(e.element);d.style.backgroundColor=S});T.observe(v,{attributes:!0,attributeFilter:["style","class","data-theme","data-theme-mode"]}),E.push(T),v=v.parentElement}if(E.length)i.set(e.element,E)}if(!s.has(e.element)){let b=()=>{let{color:v}=Et(e.element);if(C||!g)d.style.backgroundColor=v};document.addEventListener("themechange",b),s.set(e.element,b)}}else d.style.backgroundColor="",d.style.padding=""}if(u&&e.input){let h=u.getBoundingClientRect().width+4+12;if(e.input.style.paddingLeft=`${h}px`,d){let b=h;if(m)b=Math.max(b,44);if(!C&&g)d.style.left=`${b}px`;else d.style.left="12px"}}else if(m&&d){if(c)if(!C&&g)d.style.left="44px";else d.style.left="12px"}if(f&&e.input){let h=f.getBoundingClientRect().width+4+12;e.input.style.paddingRight=`${h}px`}return e},l=()=>{let d=new MutationObserver((u)=>{u.forEach((f)=>{if(f.type==="attributes"&&f.attributeName==="class")setTimeout(o,10)})});d.observe(e.element,{attributes:!0,attributeFilter:["class"]}),window.addEventListener("resize",o),a.set(e.element,d)};if(setTimeout(()=>{l(),o()},0),"lifecycle"in e&&e.lifecycle?.destroy){let d=e.lifecycle.destroy;e.lifecycle.destroy=()=>{window.removeEventListener("resize",o);let u=a.get(e.element);if(u)u.disconnect(),a.delete(e.element);let f=r.get(e.element);if(f)f.disconnect(),r.delete(e.element);let c=i.get(e.element);if(c)c.forEach((g)=>g.disconnect()),i.delete(e.element);let C=s.get(e.element);if(C)document.removeEventListener("themechange",C),s.delete(e.element);d.call(e.lifecycle)}}return{...e,updateElementPositions:()=>(o(),e)}};var bs=(e)=>(t)=>{let n=e.prefix||"mtrl",r=e.componentName||"textfield",i=e.density||"default";if(i!=="default")t.element.classList.add(`${n}-${r}--density-${i}`);if(t.element.setAttribute("data-density",i),t.input)s(t.input,i);function s(o,l){o.setAttribute("data-density",l)}let a=(o)=>{if(["default","compact"].forEach((l)=>{t.element.classList.remove(`${n}-${r}--density-${l}`)}),o!=="default")t.element.classList.add(`${n}-${r}--density-${o}`);if(t.element.setAttribute("data-density",o),t.input)t.input.setAttribute("data-density",o);if(t.density)t.density.current=o;if(t.updateElementPositions)setTimeout(()=>t.updateElementPositions(),10)};return t.density={current:i,set:a},t};var vs=(e)=>(t)=>{let n=e.prefix||"mtrl",r=e.componentName||"textfield",i=e.error||!1;if(i)t.element.classList.add(`${n}-${r}--error`);return{...t,errorState:i,setError(s,a){if(i=s,t.element.classList.toggle(`${n}-${r}--error`,s),a!==void 0&&t.setSupportingText){if(a)t.setSupportingText(a,s);else if(!s)t.setSupportingText("",!1)}else if(t.supportingTextElement&&t.setSupportingText){let o=t.supportingTextElement.textContent||"";if(o)t.setSupportingText(o,s)}return this},isError(){return i}}};ne();var Ug={FILLED:"filled",OUTLINED:"outlined"};var Gg={TEXT:"text",PASSWORD:"password",EMAIL:"email",NUMBER:"number",TEL:"tel",URL:"url",SEARCH:"search",MULTILINE:"multiline"};var zg={DEFAULT:"default",COMPACT:"compact"},Ts={TYPE:Gg.TEXT,VARIANT:Ug.FILLED,DENSITY:zg.DEFAULT,DISABLED:!1,REQUIRED:!1,ERROR:!1,FLOAT_LABEL:!0,ANIMATION_DURATION:150};var Wg={type:Ts.TYPE,variant:Ts.VARIANT},Yu=(e={})=>_(Wg,e,"textfield"),Xu=(e)=>V(e,{tag:"div",className:e.class}),qu=(e)=>({disabled:{enable:e.disabled?.enable,disable:e.disabled?.disable},lifecycle:{destroy:e.lifecycle?.destroy}});var Kg=(e={})=>{let t=Yu(e);try{return M(D,k(),O(Xu(t)),oe(t),bs(t),Ln(t),et(t),fs(t),gs(t),ps(t),hs(t),Cs(t),vs(t),de(t),P(),Es(),(r)=>Ku(qu(r))(r))(t)}catch(n){throw console.error("Textfield creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create textfield: ${n instanceof Error?n.message:String(n)}`)}},Un=Kg;var ju=(e)=>(t)=>{let n="";if(e.value){let s=(e.options||[]).find((a)=>a.id===e.value);if(s)n=s.text}let r='<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>',i=Un({label:e.label,variant:e.variant||"filled",density:e.density||"default",value:n,name:e.name,disabled:e.disabled,required:e.required,supportingText:e.supportingText,error:e.error,trailingIcon:r,readonly:!0});if(i.element.classList.add(`${e.prefix||"mtrl"}-select`),i.input)i.input.addEventListener("keydown",(s)=>{if(!["Tab","Escape","ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter"," ","Home","End"].includes(s.key))s.preventDefault()}),i.input.addEventListener("paste",(s)=>{s.preventDefault()}),i.input.addEventListener("cut",(s)=>{s.preventDefault()});return{...t,element:i.element,textfield:i}},ys=(e)=>e.map((t)=>{if("type"in t&&t.type==="divider")return t;let n={id:t.id.toString(),text:t.text,icon:t.icon,disabled:t.disabled,hasSubmenu:!1,data:t};if(t.hasSubmenu&&Array.isArray(t.submenu))n.hasSubmenu=!0,n.submenu=ys(t.submenu);return n}),Zu=(e)=>(t)=>{if(!t.textfield)return console.warn("Cannot add menu: textfield not found"),t;let n={options:e.options||[],selectedOption:null};if(e.value)n.selectedOption=n.options.find((a)=>a.id===e.value);let r=ys(n.options),i=Fn({opener:t.textfield,items:r,position:e.placement||"bottom-start",width:"100%",class:"select-menu",closeOnSelect:!0,closeOnClickOutside:!0,closeOnEscape:!0,closeOnResize:!0,offset:0,container:t.element});i.on("select",(a)=>{if(!a.item||a.item.hasSubmenu)return;let o=a.item.data;if(!o||!("id"in o)||!("text"in o)){console.warn("Invalid menu selection: missing required data properties");return}if(n.selectedOption=o,t.textfield.setValue(o.text),i.setSelected(o.id),t.emit)t.emit("change",{select:t,value:o.id,text:o.text,option:o,originalEvent:a.originalEvent,preventDefault:()=>{a.defaultPrevented=!0},defaultPrevented:!1})}),t.textfield.element.addEventListener("keydown",(a)=>{if(t.textfield.input.disabled)return;if((a.key==="Enter"||a.key===" "||a.key==="ArrowDown")&&!i.isOpen()){if(a.preventDefault(),i.open(a,"keyboard"),t.emit)t.emit("open",{select:t,originalEvent:a,preventDefault:()=>{},defaultPrevented:!1})}else if(a.key==="Escape"&&i.isOpen())a.preventDefault(),i.close(a)}),i.on("open",()=>{t.textfield.element.classList.add(`${e.prefix||"mtrl"}-select--open`);let a=e.prefix||"mtrl";if(t.textfield.element.classList.add(`${a}-textfield--focused`),t.textfield.element.classList.contains(`${a}-textfield--filled`))t.textfield.element.classList.add(`${a}-textfield--filled-focused`)}),i.on("close",(a)=>{if(t.textfield.element.classList.remove(`${e.prefix||"mtrl"}-select--open`),setTimeout(()=>{let o=e.prefix||"mtrl";if(document.activeElement===t.textfield.input||t.textfield.element.contains(document.activeElement)){if(t.textfield.element.classList.add(`${o}-textfield--focused`),t.textfield.element.classList.contains(`${o}-textfield--filled`))t.textfield.element.classList.add(`${o}-textfield--filled-focused`)}else if(t.textfield.element.classList.remove(`${o}-textfield--focused`),t.textfield.element.classList.contains(`${o}-textfield--filled`))t.textfield.element.classList.remove(`${o}-textfield--filled-focused`)},10),t.emit)t.emit("close",{select:t,originalEvent:a.originalEvent,preventDefault:()=>{},defaultPrevented:!1})});let s=()=>{if(!n.selectedOption)return;i.setSelected(n.selectedOption.id)};return i.on("open",()=>{setTimeout(s,50)}),{...t,menu:i,select:{getValue:()=>n.selectedOption?.id||null,setValue:(a)=>{if(a===null||a===void 0||a==="")return n.selectedOption=null,t.textfield.setValue(""),i.setSelected(null),t;let o=n.options.find((l)=>("id"in l)&&l.id===a);if(o&&"text"in o)n.selectedOption=o,t.textfield.setValue(o.text),i.setSelected(o.id);return t},clear:()=>(n.selectedOption=null,t.textfield.setValue(""),i.setSelected(null),t),getText:()=>n.selectedOption?.text||"",getSelectedOption:()=>n.selectedOption,getOptions:()=>[...n.options],setOptions:(a)=>{n.options=a;let o=ys(a);if(i.setItems(o),n.selectedOption&&!a.find((l)=>("id"in l)&&l.id===n.selectedOption.id))n.selectedOption=null,t.textfield.setValue("");return t},open:(a,o="mouse")=>(i.open(a,o),t),close:(a)=>(i.close(a),t),isOpen:()=>i.isOpen()}}};var Qu=(e)=>(t)=>({...t,element:t.element,textfield:t.textfield,menu:t.menu,getValue:e.select.getValue,setValue(n){return e.select.setValue(n),this},clear(){return e.select.clear(),this},getText:e.select.getText,getSelectedOption:e.select.getSelectedOption,getOptions:e.select.getOptions,setOptions(n){return e.select.setOptions(n),this},open(n="mouse"){if(t.menu&&typeof t.menu.open==="function")t.menu.open(void 0,n);else e.select.open();return this},close(){return e.select.close(),this},isOpen:e.select.isOpen,setDensity(n){if(t.textfield?.setDensity)t.textfield.setDensity(n);return this},getDensity(){if(t.textfield?.getDensity)return t.textfield.getDensity();return"default"},on(n,r){if(e.events?.on)e.events.on(n,r);else if(t.on)t.on(n,r);return this},off(n,r){if(e.events?.off)e.events.off(n,r);else if(t.off)t.off(n,r);return this},enable(){return e.disabled.enable(),this},disable(){return e.disabled.disable(),this},setError(n,r){if(t.textfield?.setError)t.textfield.setError(n,r);return this},clearError(){if(t.textfield?.setError)t.textfield.setError(!1);return this},destroy(){e.lifecycle.destroy()}});ne();var Yg={FILLED:"filled",OUTLINED:"outlined"},Xg={BOTTOM_START:"bottom-start",BOTTOM:"bottom",BOTTOM_END:"bottom-end",TOP_START:"top-start",TOP:"top",TOP_END:"top-end"};var xs={VARIANT:Yg.FILLED,PLACEMENT:Xg.BOTTOM_START,LABEL:"Select",VALUE:"",REQUIRED:!1,DISABLED:!1,SUPPORTING_TEXT:"",ERROR:!1};var qg={options:[],variant:xs.VARIANT,placement:xs.PLACEMENT},Ju=(e={options:[]})=>_(qg,e,"select"),ec=(e)=>({select:{getValue:e.select?.getValue||(()=>null),setValue:e.select?.setValue||(()=>e),clear:e.select?.clear||(()=>e),getText:e.select?.getText||(()=>""),getSelectedOption:e.select?.getSelectedOption||(()=>null),getOptions:e.select?.getOptions||(()=>[]),setOptions:e.select?.setOptions||(()=>e),open:e.select?.open||(()=>e),close:e.select?.close||(()=>e),isOpen:e.select?.isOpen||(()=>!1)},events:{on:e.on||(()=>e),off:e.off||(()=>e)},disabled:{enable:()=>{if(e.textfield?.enable)e.textfield.enable();return e},disable:()=>{if(e.textfield?.disable)e.textfield.disable();return e}},lifecycle:{destroy:()=>{if(e.textfield?.destroy)e.textfield.destroy();if(e.menu?.destroy)e.menu.destroy();if(e.lifecycle?.destroy)e.lifecycle.destroy()}}});var jg=(e)=>{try{let t=Ju(e),n=M(D,k(),ju(t),Zu(t),P(),(r)=>Qu(ec(r))(r))(t);if(e.on){if(e.on.change)n.on("change",e.on.change);if(e.on.open)n.on("open",e.on.open);if(e.on.close)n.on("close",e.on.close)}return n}catch(t){throw console.error("Select creation error:",t),Error(`Failed to create select: ${t.message}`)}},Is=jg;te();re();ne();var Zg={SINGLE:"single",MULTI:"multi"},Qg={DEFAULT:"default",COMFORTABLE:"comfortable",COMPACT:"compact"};var _r={MODE:Zg.SINGLE,DENSITY:Qg.DEFAULT,RIPPLE:!0,RIPPLE_DURATION:300,RIPPLE_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",RIPPLE_OPACITY:["0.2","0"]},Ls='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>';var Jg={mode:_r.MODE,ripple:_r.RIPPLE,density:_r.DENSITY},tc=(e={})=>_(Jg,e,"segmented-button"),nc=(e)=>{let t=e.density||"default";return{tag:"div",componentName:"segmented-button",attributes:{role:"group","aria-label":"Segmented button","data-mode":e.mode||"single","data-density":t},className:[e.class,e.disabled?`${e.prefix}-segmented-button--disabled`:null,t!=="default"?`${e.prefix}-segmented-button--${t}`:null],interactive:!0}},As=(e)=>{switch(e){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"}}};Ht();var ep=(e,t)=>{let n=document.createElement("span");return n.className=`${e}-segment-checkmark`,n.innerHTML=t||Ls,n},Pr=(e,t,n,r=!1,i={ripple:!0,rippleConfig:{}})=>{let s=r||e.disabled,a=e.icon,o=Boolean(e.text),l=Boolean(a),d=l&&!o,u=o&&!l,f=e.checkmarkIcon||Ls,c=He({text:e.text,icon:d?a:l&&e.selected?f:a,value:e.value||e.text||"",disabled:s,ripple:i.ripple,rippleConfig:i.rippleConfig,class:e.class,ariaLabel:e.text||e.value});c.element.classList.add(`${n}-segmented-button-segment`);let C=null;if(u){C=ep(n,f);let p=c.element.querySelector(`.${n}-button-text`);if(p)p.parentNode?.insertBefore(C,p);else c.element.prepend(C)}if(e.selected)c.element.classList.add(`${n}-segment--selected`),c.element.setAttribute("aria-pressed","true");else c.element.setAttribute("aria-pressed","false");t.appendChild(c.element);let g=(p)=>{if(c.element.classList.toggle(`${n}-segment--selected`,p),c.element.setAttribute("aria-pressed",p?"true":"false"),d);else if(l&&o)if(p)c.setIcon(f);else c.setIcon(a)},m=e.selected||!1;return{element:c.element,value:e.value||e.text||"",isSelected(){return m},setSelected(p){m=p,g(p)},isDisabled(){return c.disabled?.isDisabled?.()||!1},setDisabled(p){if(p)c.disable();else c.enable()},destroy(){if(C&&C.parentNode)C.parentNode.removeChild(C);c.destroy()}}};var tp=(e={})=>{let t=tc(e),n=t.mode||"single",r=t.density||"default",i=Re();try{let s=M(D,k(),O(nc(t)),P())(t),a=As(r);Object.entries(a).forEach(([g,m])=>{s.element.style.setProperty(g,m)});let o=[];if(t.segments&&t.segments.length)t.segments.forEach((g)=>{let m=Pr(g,s.element,t.prefix,t.disabled,{ripple:t.ripple,rippleConfig:t.rippleConfig});o.push(m)});if(n==="single"&&!o.some((g)=>g.isSelected())){let g=o.find((m)=>!m.isDisabled());if(g)g.setSelected(!0)}let l=(g)=>{let m=g.currentTarget,p=o.find((v)=>v.element===m);if(!p||p.isDisabled())return;let h=u();if(n==="single")o.forEach((v)=>{v.setSelected(v===p)});else p.setSelected(!p.isSelected());let b=u();if(h.length!==b.length||h.some((v)=>!b.includes(v))||b.some((v)=>!h.includes(v)))i.emit("change",{selected:d(),value:b,oldValue:h})};o.forEach((g)=>{g.element.addEventListener("click",l)});let d=()=>o.filter((g)=>g.isSelected()),u=()=>d().map((g)=>g.value),f=(g)=>o.find((m)=>m.value===g),c=(g)=>{if(["default","comfortable","compact"].forEach((p)=>{if(p!=="default")s.element.classList.remove(`${t.prefix}-segmented-button--${p}`)}),g!=="default")s.element.classList.add(`${t.prefix}-segmented-button--${g}`);s.element.setAttribute("data-density",g);let m=As(g);Object.entries(m).forEach(([p,h])=>{s.element.style.setProperty(p,h)})};return{element:s.element,segments:o,getSelected:d,getValue(){return u()},select(g){let m=f(g);if(m&&!m.isDisabled()){let p=u();if(n==="single")o.forEach((b)=>b.setSelected(b===m));else m.setSelected(!0);let h=u();if(p.join(",")!==h.join(","))i.emit("change",{selected:d(),value:h,oldValue:p})}return this},deselect(g){let m=f(g);if(m&&!m.isDisabled())if(n==="single"){if(d().length>1||!m.isSelected()){let h=u();m.setSelected(!1);let b=u();if(h.join(",")!==b.join(","))i.emit("change",{selected:d(),value:b,oldValue:h})}}else{let p=u();m.setSelected(!1);let h=u();if(p.join(",")!==h.join(","))i.emit("change",{selected:d(),value:h,oldValue:p})}return this},enable(){return s.element.classList.remove(`${t.prefix}-segmented-button--disabled`),o.forEach((g)=>{if(!t.segments?.find((m)=>m.value===g.value)?.disabled)g.setDisabled(!1)}),this},disable(){return s.element.classList.add(`${t.prefix}-segmented-button--disabled`),o.forEach((g)=>{g.setDisabled(!0)}),this},enableSegment(g){let m=f(g);if(m)m.setDisabled(!1);return this},disableSegment(g){let m=f(g);if(m)m.setDisabled(!0);return this},setDensity(g){return c(g),this},getDensity(){return s.element.getAttribute("data-density")||"default"},on(g,m){return i.on(g,m),this},off(g,m){return i.off(g,m),this},destroy(){o.forEach((g)=>{g.element.removeEventListener("click",l),g.destroy()}),i.clear(),s.lifecycle.destroy()}}}catch(s){throw console.error("Segmented Button creation error:",s),Error(`Failed to create segmented button: ${s.message}`)}},kr=tp;se();te();re();var Xe={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"},gn={OPEN:"open",CLOSE:"close",DRAG_START:"dragstart",DRAG_END:"dragend"};var ws=(e)=>(t)=>{let{position:n=Xe.BOTTOM}=e,r=`${t.getClass("sheet")}--${n.toLowerCase()}`;return t.element.classList.add(r),{...t,position:{setPosition(i){t.element.classList.remove(r);let s=`${t.getClass("sheet")}--${i.toLowerCase()}`;t.element.classList.add(s)},getPosition(){return n}}}};var Ns=(e)=>(t)=>{let{content:n=""}=e,r=document.createElement("div");return r.className=`${t.getClass("sheet")}-content`,r.innerHTML=n,t.container=document.createElement("div"),t.container.className=`${t.getClass("sheet")}-container`,t.container.appendChild(r),t.element.appendChild(t.container),{...t,content:{setContent(i){return r.innerHTML=i,this},getContent(){return r.innerHTML},getElement(){return r}}}};var Ds=(e)=>(t)=>{let{title:n=""}=e,r=null;if(n||e.dragHandle){if(r=document.createElement("div"),r.className=`${t.getClass("sheet")}-title`,n)r.textContent=n;if(t.container.insertBefore(r,t.container.firstChild),e.dragHandle){let i=document.createElement("div");i.className=`${t.getClass("sheet")}-handle`,t.container.insertBefore(i,t.container.firstChild),t.dragHandle={element:i,setVisible(s){i.style.display=s?"block":"none"}}}}return{...t,title:{setTitle(i){if(!r&&i)r=document.createElement("div"),r.className=`${t.getClass("sheet")}-title`,t.container.insertBefore(r,t.content.getElement());if(r)r.textContent=i;return this},getTitle(){return r?r.textContent||"":""},getElement(){return r}}}};var Ms=(e)=>(t)=>{let{open:n=!1,dismissible:r=!0}=e,i=n,s=document.createElement("div");if(s.className=`${t.getClass("sheet")}-scrim`,t.element.parentNode?.insertBefore(s,t.element.nextSibling),r)t.element.classList.add(`${t.getClass("sheet")}--dismissible`),s.addEventListener("click",()=>{if(r)o()});if(n)t.element.classList.add(`${t.getClass("sheet")}--open`);if(e.elevation)t.element.classList.add(`${t.getClass("sheet")}--elevation-${e.elevation}`);document.addEventListener("keydown",(l)=>{if(l.key==="Escape"&&i&&r)o()});function a(){if(!i){if(i=!0,t.element.classList.add(`${t.getClass("sheet")}--open`),t.events.emit(gn.OPEN),e.onOpen)e.onOpen()}}function o(){if(i){if(i=!1,t.element.classList.remove(`${t.getClass("sheet")}--open`),t.events.emit(gn.CLOSE),e.onClose)e.onClose()}}return{...t,state:{open:a,close:o,isOpen(){return i},setDismissible(l){if(l)t.element.classList.add(`${t.getClass("sheet")}--dismissible`);else t.element.classList.remove(`${t.getClass("sheet")}--dismissible`)}},initialize(){if(s.parentNode!==t.element.parentNode)t.element.parentNode?.insertBefore(s,t.element.nextSibling)}}};var Os=(e)=>(t)=>{if(e.enableGestures===!1)return t;let n=e.position||Xe.BOTTOM,r=0,i=0,s=!1,a=t.dragHandle?.element||t.element,o=(c)=>{if(!t.state.isOpen())return;if(s=!0,document.body.style.userSelect="none",c.type==="touchstart")r=c.touches[0].clientY,i=c.touches[0].clientX;else r=c.clientY,i=c.clientX,document.addEventListener("mousemove",l),document.addEventListener("mouseup",d);t.events.emit(gn.DRAG_START)},l=(c)=>{if(!s)return;let C,g;if(c.type==="touchmove")C=c.touches[0].clientY,g=c.touches[0].clientX;else C=c.clientY,g=c.clientX;let m=0;switch(n){case Xe.BOTTOM:if(m=C-r,m<0)m=0;t.element.style.transform=`translateY(${m}px)`;break;case Xe.TOP:if(m=r-C,m<0)m=0;t.element.style.transform=`translateY(-${m}px)`;break;case Xe.LEFT:if(m=i-g,m<0)m=0;t.element.style.transform=`translateX(-${m}px)`;break;case Xe.RIGHT:if(m=g-i,m<0)m=0;t.element.style.transform=`translateX(${m}px)`;break}let p=n===Xe.BOTTOM||n===Xe.TOP?t.element.offsetHeight:t.element.offsetWidth,h=Math.min(m/p,1),b=t.element.nextElementSibling;if(b&&b.classList.contains(`${t.getClass("sheet")}-scrim`))b.style.opacity=`${0.32*(1-h)}`},d=()=>{if(!s)return;s=!1,document.body.style.userSelect="",document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",d);let c=n===Xe.BOTTOM||n===Xe.TOP?t.element.offsetHeight:t.element.offsetWidth,C=0;if(t.element.style.transform){let g=t.element.style.transform.match(/translate[XY]\(([^p]+)px\)/);C=g?parseFloat(g[1]):0}if(C>c*0.3)t.state.close();else{t.element.style.transform="";let g=t.element.nextElementSibling;if(g&&g.classList.contains(`${t.getClass("sheet")}-scrim`))g.style.opacity=""}t.events.emit(gn.DRAG_END)};a.addEventListener("touchstart",o,{passive:!0}),a.addEventListener("touchmove",l,{passive:!0}),a.addEventListener("touchend",d),a.addEventListener("mousedown",o);let u=()=>{a.removeEventListener("touchstart",o),a.removeEventListener("touchmove",l),a.removeEventListener("touchend",d),a.removeEventListener("mousedown",o),document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",d)},f=t.lifecycle?.destroy||(()=>{});return t.lifecycle={...t.lifecycle,destroy:()=>{u(),f()}},t};var ic=({state:e,lifecycle:t})=>(n)=>({...n,element:n.element,container:n.container,open(){return e.open(),this},close(){return e.close(),this},setContent(r){return n.content.setContent(r),this},getContent(){return n.content.getContent()},setTitle(r){return n.title.setTitle(r),this},getTitle(){return n.title.getTitle()},setDragHandle(r){if(n.dragHandle)n.dragHandle.setVisible(r);return this},setMaxHeight(r){return n.container.style.maxHeight=r,this},destroy(){t.destroy()},initialize(){if(n.initialize)n.initialize();return this}});ne();var Br={STANDARD:"standard",MODAL:"modal",EXPANDED:"expanded"},Rs={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"};var np={LEVEL_1:1,LEVEL_2:2,LEVEL_3:3,LEVEL_4:4,LEVEL_5:5},pn={VARIANT:Br.STANDARD,POSITION:Rs.BOTTOM,OPEN:!1,DISMISSIBLE:!0,DRAG_HANDLE:!0,ELEVATION:np.LEVEL_3,TITLE:"",CONTENT:"",MAX_HEIGHT:"80%",ENABLE_GESTURES:!0};var rp={variant:Br.STANDARD,position:Rs.BOTTOM,open:pn.OPEN,dismissible:pn.DISMISSIBLE,dragHandle:pn.DRAG_HANDLE,elevation:pn.ELEVATION,enableGestures:pn.ENABLE_GESTURES},sc=(e={})=>_(rp,e,"sheet"),ac=(e)=>V(e,{tag:"div",attributes:{role:"dialog","aria-modal":e.variant===Br.MODAL?"true":"false"},className:e.class,forwardEvents:{click:!0,keydown:!0}}),oc=(e)=>({state:{open:()=>e.state.open(),close:()=>e.state.close()},lifecycle:{destroy:()=>e.lifecycle.destroy()}});var ip=(e={})=>{let t=sc(e);try{let n=M(D,k(),O(ac(t)),oe(t),ws(t),Ns(t),Ds(t),Ms(t),Os(t),P(),(r)=>ic(oc(r))(r))(t);return n.initialize(),n}catch(n){throw console.error("Sheet creation error:",n),Error(`Failed to create sheet: ${n.message}`)}},_s=ip;te();re();Qe();var Ps=(e)=>(t)=>{if(!e.range||!e.secondValue||!t.schema)return t;try{let n=e.min||0,r=e.max||100,i=e.secondValue,s=(i-n)/(r-n)*100,a=e.valueFormatter||((c)=>c.toString()),o=e.disabled===!0,l=t.getClass,d=JSON.parse(JSON.stringify(t.schema)),u=d.element.options.className||[];if(Array.isArray(u))u.push(l("slider--range"));else d.element.options.className=`${u} ${l("slider--range")}`.trim();let f=d.element.children.container.children;return f.secondHandle={name:"secondHandle",creator:B,options:{tag:"div",className:l("slider-handle"),attributes:{role:"slider","aria-valuemin":String(n),"aria-valuemax":String(r),"aria-valuenow":String(i),"aria-orientation":"horizontal",tabindex:o?"-1":"0","aria-disabled":o?"true":"false","data-value":String(i),"data-handle-index":"1"},style:{left:`${s}%`}}},f.secondValueBubble={name:"secondValueBubble",creator:B,options:{tag:"div",className:l("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"1"},text:a(i),style:{left:`${s}%`}}},{...t,schema:d}}catch(n){return console.warn("Error enhancing structure with range functionality:",n),t}};var Wt={PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",ERROR:"error"},Ue={XS:16,S:24,M:40,L:56,XL:96},me={HANDLE_SIZE:16,SMALL_HANDLE_HEIGHT:44,HANDLE_HEIGHT_OFFSET:12,MIN_HEIGHT:48,TRACK_RADIUS:3,SMALL_TRACK_EXTERNAL_RADIUS:10,LARGE_TRACK_RADIUS_RATIO:0.35,TICK_SIZE:4,DOT_SIZE:4,HANDLE_GAP:6,HANDLE_GAP_PRESSED_REDUCTION:2,CENTER_GAP:4,EDGE_PADDING:7},Le={CHANGE:"change",INPUT:"input",FOCUS:"focus",BLUR:"blur",START:"start",END:"end"},dc={START:"start",END:"end"},Ne={MIN:0,MAX:100,VALUE:0,STEP:1,DISABLED:!1,COLOR:Wt.PRIMARY,SIZE:"XS",TICKS:!1,SHOW_VALUE:!0,SNAP_TO_STEPS:!0,RANGE:!1,CENTERED:!1,ICON_POSITION:dc.START,LABEL_POSITION:dc.START};var ks=(e)=>(t)=>{if(e.disabled===!0)setTimeout(()=>{r()},0);function r(){if(t.element.classList.add(`${t.getClass("slider")}--disabled`),t.element.setAttribute("aria-disabled","true"),t.structure?.handle)t.structure.handle.tabIndex=-1,t.structure.handle.setAttribute("aria-disabled","true");if(e.range&&t.structure?.secondHandle)t.structure.secondHandle.tabIndex=-1,t.structure.secondHandle.setAttribute("aria-disabled","true");if(t.drawCanvas)t.drawCanvas()}function i(){if(t.element.classList.remove(`${t.getClass("slider")}--disabled`),t.element.setAttribute("aria-disabled","false"),t.structure?.handle)t.structure.handle.tabIndex=0,t.structure.handle.setAttribute("aria-disabled","false");if(e.range&&t.structure?.secondHandle)t.structure.secondHandle.tabIndex=0,t.structure.secondHandle.setAttribute("aria-disabled","false");if(t.drawCanvas)t.drawCanvas()}function s(){return Object.values(Wt).find((o)=>t.element.classList.contains(`${t.getClass("slider")}--${o}`))||Wt.PRIMARY}function a(){return Object.keys(Ue).find((d)=>t.element.classList.contains(`${t.getClass("slider")}--${d.toLowerCase()}`))||"XS"}return{...t,disabled:{enable(){return i(),this},disable(){return r(),this},isDisabled(){return t.element.classList.contains(`${t.getClass("slider")}--disabled`)}},appearance:{setColor(o){if(Object.values(Wt).forEach((l)=>{t.element.classList.remove(`${t.getClass("slider")}--${l}`)}),o!==Wt.PRIMARY)t.element.classList.add(`${t.getClass("slider")}--${o}`);return this},getColor(){return s()},setSize(o){Object.keys(Ue).forEach((u)=>{t.element.classList.remove(`${t.getClass("slider")}--${u.toLowerCase()}`)});let d;if(typeof o==="string"&&o in Ue)d=o;else if(typeof o==="number"){let u=Object.entries(Ue).find(([,f])=>f===o);d=u?u[0]:"XS"}else d="XS";return t.element.classList.add(`${t.getClass("slider")}--${d.toLowerCase()}`),this},getSize(){return a()},showTicks(o){if(e.ticks=o,t.slider)t.slider.regenerateTicks();return this},showCurrentValue(o){return e.showValue=o,this}}}};var uc=(e,t,n,r)=>{let i=t.component?.components||{},s=t.component||{},a=s.container||i.container||null,o=s.handle||i.handle||null,l=s.valueBubble||i.valueBubble||null,d=s.secondHandle||i.secondHandle||null,u=s.secondValueBubble||i.secondValueBubble||null,{getValueFromPosition:f=()=>0,roundToStep:c=(w)=>w,clamp:C=(w)=>w,showValueBubble:g=()=>{},render:m=()=>{}}=n,{triggerEvent:p=()=>({defaultPrevented:!1})}=r,h=!1,b=0,v=3,E=null,T=()=>{if(t.valueHideTimer)clearTimeout(t.valueHideTimer),t.valueHideTimer=null},S=()=>{if(T(),l)g(l,!1);if(u)g(u,!1)},y=(w)=>{if(S(),w&&e.showValue)g(w,!0)},L=(w,G=0)=>{if(T(),!w||!e.showValue)return;if(G>0)t.valueHideTimer=setTimeout(()=>{g(w,!1)},G);else g(w,!1)},I=()=>{if(o)o.classList.remove(`${t.component.getClass("slider-handle")}--focused`);if(d)d.classList.remove(`${t.component.getClass("slider-handle")}--focused`);try{let w=t.component.getClass("slider-handle--focused");if(document.querySelectorAll(`.${w}`).forEach((G)=>{G.classList.remove(w)}),document.activeElement?.classList.contains(t.component.getClass("slider-handle")))document.activeElement.blur()}catch(w){console.warn("Error clearing keyboard focus:",w)}},x=(w,G=!1)=>{if(!t.component||t.component.disabled&&t.component.disabled.isDisabled())return;if(w.type==="mousedown")w.preventDefault();w.stopPropagation(),S(),I(),b=w.type.includes("touch")?w.touches[0].clientX:w.clientX,t.dragging=!1,t.pressed=!0,h=!1,t.activeHandle=G?"second":"first",t.activeBubble=G?u:l,y(t.activeBubble),document.addEventListener("mousemove",N),document.addEventListener("mouseup",R),document.addEventListener("touchmove",N,{passive:!1}),document.addEventListener("touchend",R),m(),p(Le.START,w)},A=(w)=>{if(!t.component||t.component.disabled&&t.component.disabled.isDisabled()||!a)return;if(w.type==="mousedown")w.preventDefault();S(),I();let G=!1;try{let j=w.type.includes("touch")?w.touches[0].clientX:w.clientX,Z=f(j);if(e.snapToSteps&&t.step>0)Z=c(Z);if(Z=C(Z,t.min,t.max),e.range&&t.secondValue!==null){let xe=Math.abs(Z-t.value);G=Math.abs(Z-t.secondValue)<xe,G?t.secondValue=Z:t.value=Z}else if(e.centered&&t.component.slider&&t.component.slider.setValue)t.component.slider.setValue(Z,!1);else t.value=Z;m(),p(Le.INPUT,w)}catch(j){console.warn("Error handling track click:",j)}if(t.activeHandle=G?"second":"first",t.activeBubble=G?u:l,b=w.type.includes("touch")?w.touches[0].clientX:w.clientX,e.centered&&!e.range)y(t.activeBubble),document.addEventListener("mousemove",N),document.addEventListener("mouseup",R),document.addEventListener("touchmove",N,{passive:!1}),document.addEventListener("touchend",R),t.pressed=!1,p(Le.START,w);else t.dragging=!1,t.pressed=!1,h=!1,y(t.activeBubble),document.addEventListener("mousemove",N),document.addEventListener("mouseup",R),document.addEventListener("touchmove",N,{passive:!1}),document.addEventListener("touchend",R),m(),p(Le.START,w)},N=(w)=>{if(!t.activeHandle||!a)return;w.preventDefault();try{let G=w.type.includes("touch")?w.touches[0].clientX:w.clientX;if(!h&&Math.abs(G-b)>=v)h=!0,t.dragging=!0,t.component.element.classList.add(`${t.component.getClass("slider")}--dragging`);let j=f(G);if(e.snapToSteps&&t.step>0)j=c(j);j=C(j,t.min,t.max);let Z=t.activeHandle==="second";if(e.range&&t.secondValue!==null)if(Z)if(j>=t.value)t.secondValue=j;else L(t.activeBubble,0),t.secondValue=t.value,t.value=j,t.activeHandle="first",t.activeBubble=l,y(t.activeBubble);else if(j<=t.secondValue)t.value=j;else L(t.activeBubble,0),t.value=t.secondValue,t.secondValue=j,t.activeHandle="second",t.activeBubble=u,y(t.activeBubble);else{if(e.centered)t.previousValue=t.value;t.value=j}m(),p(Le.INPUT,w)}catch(G){console.warn("Error during slider drag:",G)}},R=(w)=>{if(!t.activeHandle)return;w.preventDefault(),t.dragging=!1,t.pressed=!1,h=!1,t.component.element.classList.remove(`${t.component.getClass("slider")}--dragging`),L(t.activeBubble,1000),document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",R),document.removeEventListener("touchmove",N),document.removeEventListener("touchend",R),t.activeHandle=null,m(),p(Le.CHANGE,w),p(Le.END,w)},U=(w,G=!1)=>{if(t.component.disabled&&t.component.disabled.isDisabled())return;let j=t.step||1,Z=G?t.secondValue:t.value,xe=w.shiftKey?j*10:j;if(w.key==="Tab")return;let ie=!1;switch(w.key){case"ArrowRight":case"ArrowUp":w.preventDefault(),Z=Math.min(Z+xe,t.max),ie=!0;break;case"ArrowLeft":case"ArrowDown":w.preventDefault(),Z=Math.max(Z-xe,t.min),ie=!0;break;case"Home":w.preventDefault(),Z=t.min,ie=!0;break;case"End":w.preventDefault(),Z=t.max,ie=!0;break;case"PageUp":w.preventDefault(),Z=Math.min(Z+j*10,t.max),ie=!0;break;case"PageDown":w.preventDefault(),Z=Math.max(Z-j*10,t.min),ie=!0;break;default:return}if(!ie)return;if(t.activeBubble=G?u:l,y(t.activeBubble),G)t.secondValue=Z;else{if(e.centered)t.previousValue=t.value;t.value=Z}m(),p(Le.INPUT,w),p(Le.CHANGE,w)},H=(w,G=!1)=>{if(t.component.disabled&&t.component.disabled.isDisabled())return;let j=G?d:o;if(E&&E!==j)S();E=j,j.classList.add(`${t.component.getClass("slider-handle")}--focused`),y(G?u:l),t.activeBubble=G?u:l,p(Le.FOCUS,w)},q=(w,G=!1)=>{(G?d:o).classList.remove(`${t.component.getClass("slider-handle")}--focused`);let Z=w.relatedTarget;if(!Z||Z!==(G?o:d))L(G?u:l,200);p(Le.BLUR,w)};return{handleHandleMouseDown:x,handleTrackMouseDown:A,handleMouseMove:N,handleMouseUp:R,handleKeyDown:U,handleFocus:H,handleBlur:q,setupEventListeners:()=>{if(!t.component||!o){console.warn("Cannot set up event listeners: missing component or handle");return}if(a.addEventListener("mousedown",A),a.addEventListener("touchstart",A,{passive:!0}),o.addEventListener("mousedown",(w)=>x(w,!1)),o.addEventListener("touchstart",(w)=>x(w,!1),{passive:!0}),o.addEventListener("keydown",(w)=>U(w,!1)),o.addEventListener("focus",(w)=>H(w,!1)),o.addEventListener("blur",(w)=>q(w,!1)),e.range&&d)d.addEventListener("mousedown",(w)=>x(w,!0)),d.addEventListener("touchstart",(w)=>x(w,!0),{passive:!0}),d.addEventListener("keydown",(w)=>U(w,!0)),d.addEventListener("focus",(w)=>H(w,!0)),d.addEventListener("blur",(w)=>q(w,!0))},cleanupEventListeners:()=>{if(!t.component)return;if(a)a.removeEventListener("mousedown",A),a.removeEventListener("touchstart",A);if(o)o.removeEventListener("mousedown",(w)=>x(w,!1)),o.removeEventListener("touchstart",(w)=>x(w,!1)),o.removeEventListener("keydown",(w)=>U(w,!1)),o.removeEventListener("focus",(w)=>H(w,!1)),o.removeEventListener("blur",(w)=>q(w,!1));if(e.range&&d)d.removeEventListener("mousedown",(w)=>x(w,!0)),d.removeEventListener("touchstart",(w)=>x(w,!0)),d.removeEventListener("keydown",(w)=>U(w,!0)),d.removeEventListener("focus",(w)=>H(w,!0)),d.removeEventListener("blur",(w)=>q(w,!0));document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",R),document.removeEventListener("touchmove",N),document.removeEventListener("touchend",R)},showActiveBubble:y,hideActiveBubble:L,hideAllBubbles:S,clearKeyboardFocus:I}};var Bs=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize slider controller: missing element"),t;let n={component:t,value:e.value!==void 0?e.value:0,secondValue:e.secondValue!==void 0?e.secondValue:null,min:e.min!==void 0?e.min:0,max:e.max!==void 0?e.max:100,step:e.step!==void 0?e.step:1,dragging:!1,pressed:!1,activeHandle:null,activeBubble:null,valueHideTimer:null},r={triggerEvent(E,T=null){let S={slider:n.component,value:n.value,secondValue:n.secondValue,originalEvent:T,preventDefault:()=>{S.defaultPrevented=!0},defaultPrevented:!1};return n.component.emit(E,S),S}},i=()=>{if(!n.component)return{};let E=n.component.components||{},T=n.component;return{container:T.container||E.container,handle:T.handle||E.handle,valueBubble:T.valueBubble||E.valueBubble,secondHandle:T.secondHandle||E.secondHandle,secondValueBubble:T.secondValueBubble||E.secondValueBubble,...E}},s=(E)=>{let T=n.max-n.min;return T===0?0:(E-n.min)/T*100},a=()=>{let E=i(),{handle:T,container:S}=E;if(!T||!S)return null;try{let y=T.getBoundingClientRect(),L=S.getBoundingClientRect(),I=y.width||me.HANDLE_SIZE,x=L.width,A=me.EDGE_PADDING/x*100,R=(n.activeHandle?6:8)/x*100;return{handleSize:I,trackSize:x,edgeConstraint:A,paddingPercent:R}}catch(y){return console.warn("Error calculating track dimensions:",y),{handleSize:me.HANDLE_SIZE,trackSize:200,edgeConstraint:3,paddingPercent:4}}},o=(E,T=200)=>{let S=me.EDGE_PADDING/T*100,y=S,L=100-S,I=L-y;if(E<=0)return y;if(E>=100)return L;return y+E/100*I},l=(E)=>{let T=i(),{handle:S,container:y}=T;if(!S||!y)return n.min;try{let L=y.getBoundingClientRect(),I=n.max-n.min,x=L.left+me.EDGE_PADDING,A=L.right-me.EDGE_PADDING,N=A-x,U=(Math.max(x,Math.min(A,E))-x)/N;return n.min+U*I}catch(L){return console.warn("Error calculating value from position:",L),n.min}},d=(E)=>{let T=n.step;if(!T||T<=0)return E;let S=Math.round((E-n.min)/T);return n.min+S*T},u=(E,T,S)=>Math.min(Math.max(E,T),S),f=()=>{let E=i(),{handle:T,container:S,valueBubble:y,secondHandle:L,secondValueBubble:I}=E;if(!T||!S)return;let x=a();if(!x)return;let{trackSize:A}=x,N=s(n.value),R=o(N,A);if(T.style.left=`${R}%`,T.style.transform="translate(-50%, -50%)",y)y.style.left=`${R}%`,y.style.transform="translateX(-50%)";if(e.range&&L&&n.secondValue!==null){let U=s(n.secondValue),H=o(U,A);if(L.style.left=`${H}%`,L.style.transform="translate(-50%, -50%)",I)I.style.left=`${H}%`,I.style.transform="translateX(-50%)"}if(T)T.setAttribute("aria-valuenow",String(n.value))},c=()=>{let E=i(),{valueBubble:T,secondValueBubble:S}=E;if(!T)return;let y=e.valueFormatter||((L)=>L.toString());if(T.textContent=y(n.value),e.range&&S&&n.secondValue!==null)S.textContent=y(n.secondValue)},C=(E,T)=>{if(!E||!e.showValue)return;let S=n.component.getClass("slider-value");E.classList[T?"add":"remove"](`${S}--visible`)},g=()=>{},m=()=>{},p=()=>{try{if(f(),c(),t.drawCanvas)t.drawCanvas(n)}catch(E){console.warn("Error rendering UI:",E)}},b=uc(e,n,{getPercentage:s,getValueFromPosition:l,roundToStep:d,clamp:u,showValueBubble:C,updateUi:p,render:p},r),v=()=>{try{let E=i();if(!E.handle){console.warn("Cannot initialize slider controller: missing required handle component");return}let{handle:T,secondHandle:S}=E;if(T){if(T.setAttribute("aria-valuemin",String(n.min)),T.setAttribute("aria-valuemax",String(n.max)),T.setAttribute("aria-valuenow",String(n.value)),e.range&&S&&n.secondValue!==null)S.setAttribute("aria-valuemin",String(n.min)),S.setAttribute("aria-valuemax",String(n.max)),S.setAttribute("aria-valuenow",String(n.secondValue))}b.setupEventListeners(),p()}catch(E){console.error("Error initializing slider controller:",E)}};if(t.lifecycle){let E=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{b.cleanupEventListeners(),E()}}return setTimeout(()=>{v()},0),{...t,slider:{setValue(E,T=!0){let S=u(E,n.min,n.max);if(n.value=S,p(),T)r.triggerEvent(Le.CHANGE);return this},getValue(){return n.value},setSecondValue(E,T=!0){if(!e.range)return this;let S=u(E,n.min,n.max);if(n.secondValue=S,p(),T)r.triggerEvent(Le.CHANGE);return this},getSecondValue(){return e.range?n.secondValue:null},setMin(E){n.min=E;let T=i();if(T.handle)T.handle.setAttribute("aria-valuemin",String(E));if(e.range&&T.secondHandle)T.secondHandle.setAttribute("aria-valuemin",String(E));if(n.value<E)n.value=E;if(e.range&&n.secondValue!==null&&n.secondValue<E)n.secondValue=E;if(e.ticks||e.tickLabels)g();return p(),this},getMin(){return n.min},setMax(E){n.max=E;let T=i();if(T.handle)T.handle.setAttribute("aria-valuemax",String(E));if(e.range&&T.secondHandle)T.secondHandle.setAttribute("aria-valuemax",String(E));if(n.value>E)n.value=E;if(e.range&&n.secondValue!==null&&n.secondValue>E)n.secondValue=E;if(e.ticks||e.tickLabels)g();return p(),this},getMax(){return n.max},setStep(E){if(n.step=E,t.element.classList[E>0?"add":"remove"](`${t.getClass("slider")}--discrete`),e.ticks||e.tickLabels)g(),m();return this},getStep(){return n.step},regenerateTicks(){return p(),this},updateUi(){return p(),this}}}};kt();lr();var sp=(e)=>e?.disabled?.isDisabled?.()||e?.element?.classList?.contains?.(`${e?.getClass?.("slider")}--disabled`)||!1,$s=(e,t,n="track")=>{let r=sp(t),i=e.color||"primary";if(r){let d=Te("sys-color-on-surface",{fallback:"#000000"});return{primary:Mn(d,0.38),secondary:Mn(d,0.12)}}let s=t?.element&&typeof getComputedStyle==="function"?getComputedStyle(t.element):void 0,a=s?.getPropertyValue("--mtrl-slider-color").trim(),o=s?.getPropertyValue("--mtrl-slider-on-color").trim();if(n==="tick")return{primary:o||Te(`sys-color-on-${i}`,{fallback:"#ffffff"}),secondary:a||Te(`sys-color-${i}`,{fallback:"#1976d2"})};let l=a||Te(`sys-color-${i}`,{fallback:"#1976d2"});return{primary:l,secondary:Mn(l,0.24)}},Hr=(e,t,n)=>(e-t)/(n-t)*100,Ge=(e,t,n,r,i,s,a)=>{if(r>0)ci(e,t,n,r,i,s,s,a)},Gn=(e)=>{if(typeof e==="number")return Math.max(e,Ue.XS);if(typeof e==="string"&&e in Ue)return Ue[e];return Ue.XS},Vs=(e)=>{let t=Gn(e);if(t<=Ue.S)return me.SMALL_HANDLE_HEIGHT;return t+me.HANDLE_HEIGHT_OFFSET},ap=(e)=>{let t=Gn(e);if(t<=Ue.S)return me.SMALL_TRACK_EXTERNAL_RADIUS;return t*me.LARGE_TRACK_RADIUS_RATIO},cc=(e,t,n)=>{let r=Gn(n?.size),i=Vs(n?.size),s=e.parentElement;if(!s)return;let a=s.getBoundingClientRect().width||s.offsetWidth||200,o=Math.max(i,r,me.MIN_HEIGHT);s.style.height=`${o}px`,pi(t,a,o)},mc=(e,t)=>{let n=e.parentElement;if(!n)throw Error("Canvas must have a parent element");let r=Gn(t?.size),i=Vs(t?.size),s=n.getBoundingClientRect().width||n.offsetWidth||200,a=Math.max(i,r,me.MIN_HEIGHT);return n.style.height=`${a}px`,gi(e,s,a)},$r=(e,t)=>{let n=me.EDGE_PADDING/t*100,r=n,i=100-n,s=i-r;if(e<=0)return r;if(e>=100)return i;return r+e/100*s},op=(e,t,n,r,i,s)=>{let a=n/2,o=Gn(r.size),l=ap(r.size),d=me.TRACK_RADIUS,u=ui(e,0,a-o/2,t,o,l),{primary:f,secondary:c}=$s(r,s),C=Hr(i.value,i.min,i.max),g=$r(C,t),m=i.pressed?me.HANDLE_GAP_PRESSED_REDUCTION:0,p=me.HANDLE_GAP-m,b=me.CENTER_GAP/2/t*100,v=p/t*100;if(r.centered){let E=Hr(0,i.min,i.max),T=$r(E,t),S=Math.abs(g-T)<v,y=i.value>=0;if(S){let L=(g-v)/100*t;if(L>0)Ge(e,0,a-o/2,L,o,d,c);let I=(g+v)/100*t,x=t-I;if(x>0)Ge(e,I,a-o/2,x,o,d,c)}else if(y){let L=(T-b)/100*t;if(L>0)Ge(e,0,a-o/2,L,o,d,c);let I=(T+b)/100*t,x=(g-v)/100*t-I;if(x>0)Ge(e,I,a-o/2,x,o,d,f);let A=(g+v)/100*t,N=t-A;if(N>0)Ge(e,A,a-o/2,N,o,d,c)}else{let L=(g-v)/100*t;if(L>0)Ge(e,0,a-o/2,L,o,d,c);let I=(g+v)/100*t,x=(T-b)/100*t-I;if(x>0)Ge(e,I,a-o/2,x,o,d,f);let A=(T+b)/100*t,N=t-A;if(N>0)Ge(e,A,a-o/2,N,o,d,c)}}else if(r.range&&i.secondValue!==null){let E=Hr(i.secondValue,i.min,i.max),T=$r(E,t),S=Math.min(g,T),y=Math.max(g,T),L=g<=T,I=i.pressed&&i.activeHandle==="first"?me.HANDLE_GAP_PRESSED_REDUCTION:0,x=i.pressed&&i.activeHandle==="second"?me.HANDLE_GAP_PRESSED_REDUCTION:0,A=me.HANDLE_GAP-I,N=me.HANDLE_GAP-x,R=L?A/t*100:N/t*100,U=L?N/t*100:A/t*100,H=(S-R)/100*t;if(H>0)Ge(e,0,a-o/2,H,o,d,c);let q=(S+R)/100*t,Y=(y-U)/100*t-q;if(Y>o)Ge(e,q,a-o/2,Y,o,d,f);let J=(y+U)/100*t,w=t-J;if(w>0)Ge(e,J,a-o/2,w,o,d,c)}else{let E=(g-v)/100*t;if(E>0)Ge(e,0,a-o/2,E,o,d,f);let T=(g+v)/100*t,S=t-T;if(S>0)Ge(e,T,a-o/2,S,o,d,c)}u()},lp=(e,t,n,r,i,s)=>{if(!r.ticks)return;let a=me.TICK_SIZE,o=n/2,{primary:l,secondary:d}=$s(r,s,"tick"),u=Math.floor((i.max-i.min)/i.step);for(let f=0;f<=u;f++){let c=i.min+f*i.step;if(c>i.max)continue;let C=Hr(c,i.min,i.max),m=$r(C,t)/100*t,p=Math.abs(c-i.value)<i.step*0.1,h=r.range&&i.secondValue!==null&&Math.abs(c-i.secondValue)<i.step*0.1;if(p||h)continue;let b=!1;if(r.centered)b=i.value>=0?c>=0&&c<=i.value:c>=i.value&&c<=0;else if(r.range&&i.secondValue!==null){let v=Math.min(i.value,i.secondValue),E=Math.max(i.value,i.secondValue);b=c>=v&&c<=E}else b=c<=i.value;e.fillStyle=b?l:d,e.globalAlpha=b?1:0.5,e.beginPath(),e.arc(m,o,a/2,0,Math.PI*2),e.fill()}e.globalAlpha=1},dp=(e,t,n,r,i)=>{if(r.ticks)return;let s=me.DOT_SIZE,a=n/2,o=me.EDGE_PADDING,{primary:l}=$s(r,i,"dot");e.fillStyle=l,e.beginPath(),e.arc(t-o,a,s/2,0,Math.PI*2),e.fill()},Hs=(e,t,n,r)=>{let{ctx:i,width:s,height:a}=e;if(s===0||a===0)return;mi(i,s,a),dp(i,s,a,t,r),op(i,s,a,t,n,r),lp(i,s,a,t,n,r)},fc=(e,t)=>{let n=Vs(t),r=e.handle||e.components?.handle,i=e.secondHandle||e.components?.secondHandle;if(r)r.style.height=`${n}px`,r.style.transform="translate(-50%, -50%)";if(i)i.style.height=`${n}px`,i.style.transform="translate(-50%, -50%)"},up=(e,t,n)=>{if(e)return{value:e.value,secondValue:e.secondValue,min:e.min,max:e.max,step:e.step,pressed:e.pressed||!1,activeHandle:e.activeHandle||null};if(t?.slider)return{value:t.slider.getValue(),secondValue:t.slider.getSecondValue(),min:t.slider.getMin(),max:t.slider.getMax(),step:t.slider.getStep(),pressed:!1,activeHandle:null};return n||{value:0,secondValue:null,min:0,max:100,step:1,pressed:!1,activeHandle:null}},Fs=(e)=>(t)=>{let n=Ci(`${t.getClass("slider-canvas")}`,{zIndex:"1"}),r=t.container||t.components?.container;if(r)r.insertBefore(n,r.firstChild);else t.element.appendChild(n);let i=null,s=null,a=null,o=e.size||"XS",l=up(null,t,{value:e.value||0,secondValue:e.secondValue||null,min:e.min||0,max:e.max||100,step:e.step||1,pressed:!1,activeHandle:null}),d={animatedValue:l.value,animatedSecondValue:l.secondValue,targetValue:l.value,targetSecondValue:l.secondValue,startValue:l.value,startSecondValue:l.secondValue,startTime:0,duration:fi.MEDIUM,animationFrame:null};if(t.animationState=d,hi(()=>{try{return i=mc(n,{...e,size:o}),t.ctx=i.ctx,!0}catch(p){return console.warn("Slider canvas initialization failed:",p),!1}},()=>{fc(t,o)}),e.color&&e.color!=="primary")t.element.classList.add(`${t.getClass("slider")}--${e.color}`);t.canvas=n;let u=()=>{if(!i)return;Hs(i,{...e,size:o},{...l,value:d.animatedValue,secondValue:d.animatedSecondValue},t)},f=(p)=>{if(!i)return;let b=(p||performance.now())-d.startTime,v=Math.min(b/d.duration,1),E=ar(v),{startValue:T,targetValue:S}=d;if(d.animatedValue=T+(S-T)*E,d.targetSecondValue!==null&&d.animatedSecondValue!==null){let{startSecondValue:y,targetSecondValue:L}=d;d.animatedSecondValue=y+(L-y)*E}if(u(),v<1)d.animationFrame=requestAnimationFrame((y)=>f(y));else d.animationFrame=null},c=(p)=>{if(!i){console.warn("Canvas context not ready");return}cc(n,i,{...e,size:o});let h,b=!1;if(p)h={value:p.value,secondValue:p.secondValue,min:p.min,max:p.max,step:p.step,pressed:p.pressed||!1,activeHandle:p.activeHandle||null},b=p.dragging||!1,l={...h};else if(t.slider)h={value:t.slider.getValue(),secondValue:t.slider.getSecondValue(),min:t.slider.getMin(),max:t.slider.getMax(),step:t.slider.getStep()},l={...h};else h={...l};let v=h.value!==d.targetValue,E=h.secondValue!==d.targetSecondValue;if((v||E)&&!b){if(d.startValue=d.animatedValue,d.startSecondValue=d.animatedSecondValue,d.targetValue=h.value,d.targetSecondValue=h.secondValue,d.animationFrame)cancelAnimationFrame(d.animationFrame);d.startTime=performance.now(),f()}else if(b){if(d.animatedValue=h.value,d.animatedSecondValue=h.secondValue,d.targetValue=h.value,d.targetSecondValue=h.secondValue,d.startValue=h.value,d.startSecondValue=h.secondValue,d.animationFrame)cancelAnimationFrame(d.animationFrame),d.animationFrame=null;Hs(i,{...e,size:o},p||h,t)}else Hs(i,{...e,size:o},p||h,t)},C=()=>{if(!i)return;try{let p=mc(n,{...e,size:o});t.ctx=p.ctx,Object.assign(i,p),u()}catch(p){console.warn("Slider canvas resize failed:",p)}};s=On(t.element,n,C);let g=()=>u();a=or(e.color||"primary",g),requestAnimationFrame(()=>{c()}),t.drawCanvas=c,t.resize=C,t.setSize=(p)=>{if(o=p,i)cc(n,i,{...e,size:o}),u();fc(t,o)},t.getSize=()=>o;let m=t.appearance?.setColor;if(m)t.appearance.setColor=(p)=>{if(m(p),e.color&&e.color!=="primary")t.element.classList.remove(`${t.getClass("slider")}--${e.color}`);if(p&&p!=="primary")t.element.classList.add(`${t.getClass("slider")}--${p}`);if(e.color=p,a)a(),a=null;a=or(p,g),c()};if(t.lifecycle){let p=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{if(s)s();if(a)a();if(d.animationFrame)cancelAnimationFrame(d.animationFrame);p()}}return t};Qe();var hn=(e,t)=>(Object.assign(e.style,t),e);var Us=(e)=>(t)=>{let n=(b)=>t.getClass(b),r=e.min||0,i=e.max||100,s=e.value!==void 0?e.value:r,a=e.disabled===!0,o=e.valueFormatter||((b)=>b.toString()),l=(s-r)/(i-r)*100,d=B({tag:"div",className:n("slider-container"),container:t.element});hn(d,{position:"relative"});let u=e.label||"",f=e.range&&u?`${u} minimum`:u,c=u?`${u} maximum`:"",C={role:"slider","aria-valuemin":String(r),"aria-valuemax":String(i),"aria-valuenow":String(s),"aria-orientation":"horizontal",tabindex:a?"-1":"0","aria-disabled":a?"true":"false","data-value":String(s),"data-handle-index":"0"};if(f)C["aria-label"]=f;let g=B({tag:"div",className:n("slider-handle"),attributes:C,container:d});hn(g,{left:`${l}%`});let m=B({tag:"div",className:n("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"0"},text:o(s),container:d});hn(m,{left:`${l}%`});let p,h;if(e.range){let b=e.secondValue!==void 0?e.secondValue:i,v=(b-r)/(i-r)*100,E={role:"slider","aria-valuemin":String(r),"aria-valuemax":String(i),"aria-valuenow":String(b),"aria-orientation":"horizontal",tabindex:a?"-1":"0","aria-disabled":a?"true":"false","data-value":String(b),"data-handle-index":"1"};if(c)E["aria-label"]=c;p=B({tag:"div",className:n("slider-handle"),attributes:E,container:d}),hn(p,{left:`${v}%`}),h=B({tag:"div",className:n("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"1"},text:o(b),container:d}),hn(h,{left:`${v}%`})}return{...t,container:d,handle:g,valueBubble:m,secondHandle:p,secondValueBubble:h,getContainer:()=>d,getHandle:()=>g,getValueBubble:()=>m,getSecondHandle:()=>p||null,getSecondValueBubble:()=>h||null}};var gc=(e)=>(t)=>({...t,element:t.element,setValue(n,r=!0){return e.slider.setValue(n,r),this},getValue(){return e.slider.getValue()},setSecondValue(n,r=!0){return e.slider.setSecondValue(n,r),this},getSecondValue(){return e.slider.getSecondValue()},setMin(n){return e.slider.setMin(n),this},getMin(){return e.slider.getMin()},setMax(n){return e.slider.setMax(n),this},getMax(){return e.slider.getMax()},setStep(n){return e.slider.setStep(n),this},getStep(){return e.slider.getStep()},enable(){return e.disabled.enable(),this},disable(){return e.disabled.disable(),this},isDisabled(){return e.disabled.isDisabled()},setColor(n){return e.appearance.setColor(n),this},getColor(){return e.appearance.getColor()},setSize(n){return e.appearance.setSize(n),this},getSize(){return e.appearance.getSize()},showTicks(n){return e.appearance.showTicks(n),this},showCurrentValue(n){return e.appearance.showCurrentValue(n),this},setLabel(n){if(e.text?.setText)e.text.setText(n);return this},getLabel(){return e.text?.getText?e.text.getText():""},setIcon(n){if(e.icon?.setIcon)e.icon.setIcon(n);return this},getIcon(){return e.icon?.getIcon?e.icon.getIcon():""},on(n,r){if(e.events?.on)e.events.on(n,r);return this},off(n,r){if(e.events?.off)e.events.off(n,r);return this},destroy(){if(e.lifecycle?.destroy)e.lifecycle.destroy()}});ne();var cp={min:Ne.MIN,max:Ne.MAX,value:Ne.VALUE,step:Ne.STEP,disabled:Ne.DISABLED,color:Ne.COLOR,size:Ne.SIZE,ticks:Ne.TICKS,showValue:Ne.SHOW_VALUE,snapToSteps:Ne.SNAP_TO_STEPS,range:Ne.RANGE,centered:Ne.CENTERED,iconPosition:Ne.ICON_POSITION,labelPosition:Ne.LABEL_POSITION,valueFormatter:(e)=>e.toString()},pc=(e={})=>_(cp,e,"slider"),hc=(e)=>{let t=["slider",e.class,e.disabled?"slider--disabled":"",e.size&&e.size!=="XS"?`slider--${typeof e.size==="string"?e.size.toLowerCase():e.size}`:"",e.color&&e.color!=="primary"?`slider--${e.color}`:"",e.range?"slider--range":"",e.centered?"slider--centered":"",e.icon?"slider--icon":""].filter(Boolean).join(" "),n={tabindex:"-1"};if(e.disabled)n["aria-disabled"]="true";return V(e,{tag:"div",attributes:n,className:t,forwardEvents:{click:!0,keydown:!0,touchstart:!0,touchmove:!0,touchend:!0,mousedown:!0,mousemove:!0,mouseup:!0},interactive:!0})},Cc=(e)=>({slider:{setValue:(t,n)=>e.slider?.setValue(t,n),getValue:()=>e.slider?.getValue()??0,setSecondValue:(t,n)=>e.slider?.setSecondValue(t,n),getSecondValue:()=>e.slider?.getSecondValue()??null,setMin:(t)=>e.slider?.setMin(t),getMin:()=>e.slider?.getMin()??0,setMax:(t)=>e.slider?.setMax(t),getMax:()=>e.slider?.getMax()??100,setStep:(t)=>e.slider?.setStep(t),getStep:()=>e.slider?.getStep()??1,regenerateTicks:()=>e.slider?.regenerateTicks?.()},disabled:{enable:()=>e.disabled?.enable?.(),disable:()=>e.disabled?.disable?.(),isDisabled:()=>e.disabled?.isDisabled?.()??!1},appearance:{setColor:(t)=>e.appearance?.setColor?.(t),getColor:()=>e.appearance?.getColor?.()??"primary",setSize:(t)=>e.setSize?.(t),getSize:()=>e.getSize?.()??"XS",showTicks:(t)=>e.appearance?.showTicks?.(t),showCurrentValue:(t)=>e.appearance?.showCurrentValue?.(t)},text:{setText:(t)=>e.label?.setText?.(t),getText:()=>e.label?.getText?.()??""},icon:{setIcon:(t)=>e.icon?.setIcon?.(t),getIcon:()=>e.icon?.getIcon?.()??""},events:{on:(t,n)=>e.on?.(t,n),off:(t,n)=>e.off?.(t,n)},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}});var mp=(e={})=>{let t=pc(e);try{let n=M(D,k(),O(hc(t)),Ps(t),Us(t),et(t),Be(t),Fs(t),ks(t),Bs(t),P())(t),r=Cc(n),i=gc(r)(n);if(t.on&&typeof i.on==="function")Object.entries(t.on).forEach(([s,a])=>{if(typeof a==="function")i.on(s,a)});return i}catch(n){throw console.error("Slider creation error:",n),Error(`Failed to create slider: ${n.message}`)}},Gs=mp;se();te();var Ec=(e)=>(t)=>{if(!e.action)return t;let n=document.createElement("button");return n.className=`${e.prefix}-snackbar-action`,n.textContent=e.action,t.element.appendChild(n),{...t,actionButton:n}},bc=(e)=>(t)=>{let n=null,r=typeof e.duration==="number"?e.duration:0,i=()=>{if(n)clearTimeout(n),n=null;if(r>0)n=window.setTimeout(()=>{if(t.element&&t.emit)t.emit("dismiss")},r)},s=()=>{if(n)clearTimeout(n),n=null},a=(d)=>{r=typeof d==="number"&&d>0?d:0},o=()=>r,l=t.lifecycle?.destroy;if(t.lifecycle)t.lifecycle.destroy=()=>{if(s(),l)l.call(t.lifecycle)};return{...t,timer:{start:i,stop:s,setDuration:a,getDuration:o}}};var fp={BASIC:"basic",ACTION:"action"},Kt={CENTER:"center",START:"start",END:"end"};var Vr={QUEUE:"queue",REPLACE:"replace"};var Yt={VARIANT:fp.BASIC,POSITION:Kt.CENTER,DURATION:4000,QUEUE_BEHAVIOR:Vr.QUEUE,QUEUE_GAP:200,Z_INDEX:1000,ANIMATION_DURATION:300};var vc=(e)=>(t)=>{let n=e.position||Kt.CENTER,r=e.prefix||"mtrl",i=`${r}-snackbar--${n}`;t.element.classList.add(i);let s=(a)=>{t.element.classList.remove(i);let o=`${r}-snackbar--${a}`;if(t.element.classList.add(o),t.element.classList.contains(`${r}-snackbar--visible`))if(a===Kt.CENTER)t.element.style.transform="translateX(-50%) scale(1)";else t.element.style.transform="scale(1)"};return{...t,position:{getPosition:()=>n,setPosition:(a)=>{if(Object.values(Kt).includes(a))return s(a),t;else return console.warn(`Invalid position: ${a}. Using default: ${Kt.CENTER}`),s(Kt.CENTER),t}}}};re();var Tc=({lifecycle:e,queue:t,queueBehavior:n})=>(r)=>{if(!t)throw Error("Snackbar queue is required");let i=!1,s={element:r.element,actionButton:r.actionButton,timer:r.timer,position:r.position,state:i?"visible":"hidden",show(){if(i)return this;return i=!0,this.state="visible",t.add({...this,_show:()=>{document.body.appendChild(r.element);let a=r.element.offsetHeight;if(r.element.classList.add(`${r.getClass?.("snackbar")}--visible`),r.timer)r.timer.start();return this},_hide:()=>this.hide()},{behavior:n}),this},hide(){if(!i)return this;if(i=!1,this.state="hidden",r.timer)r.timer.stop();let a=(o)=>{if(o.propertyName!=="opacity")return;if(r.element.removeEventListener("transitionend",a),r.element.parentNode)r.element.remove()};return r.element.addEventListener("transitionend",a),r.element.classList.remove(`${r.getClass?.("snackbar")}--visible`),this},setMessage(a){return r.text?.setText(a),this},getMessage(){return r.text?.getText()||""},setAction(a){if(r.actionButton)r.actionButton.textContent=a;return this},getAction(){return r.actionButton?r.actionButton.textContent||"":""},setDuration(a){if(r.timer?.setDuration?.(a),i&&r.timer)r.timer.start();return this},getDuration(){return r.timer?.getDuration?.()??0},setPosition(a){if(r.position?.setPosition)r.position.setPosition(a);return this},getPosition(){return r.position?.getPosition?.()||"center"},on(a,o){return r.on?.(a,o),this},off(a,o){return r.off?.(a,o),this},destroy(){if(i&&r.element.parentNode)r.element.remove();if(r.timer)r.timer.stop();e.destroy()}};if(r.actionButton)r.actionButton.addEventListener("click",()=>{r.emit?.("action"),r.emit?.("dismiss")});if(r.on){let a=()=>{if(i)s.hide()};r.on("dismiss",a);let o=e.destroy;e.destroy=()=>{r.off?.("dismiss",a),o?.call(e)}}return s};var Sc=(e=Yt.QUEUE_GAP)=>{let t=[],n=null,r=null,i=null,s=()=>{if(i!==null)clearTimeout(i),i=null},a=()=>{if(n&&r)n.off?.("dismiss",r);n=null,r=null},o=()=>{if(s(),n||t.length===0)return;let l=t.shift();n=l;let d=()=>{if(a(),t.length>0)i=setTimeout(()=>{i=null,o()},e)};r=d,l.on?.("dismiss",d),l._show()};return{add(l,d={}){if(!l._show)throw Error("Snackbar must implement _show method");if((d.behavior??Vr.QUEUE)===Vr.REPLACE){if(t.length=0,s(),n)n._hide?.(),a();t.push(l),o();return}if(t.push(l),!n)o()},clear(){if(t.length=0,s(),n)n._hide?.(),a()},getLength(){return t.length+(n?1:0)}}};ne();var gp={variant:Yt.VARIANT,position:Yt.POSITION,duration:Yt.DURATION,queueBehavior:Yt.QUEUE_BEHAVIOR},yc=(e)=>_(gp,e,"snackbar"),xc=(e)=>V(e,{tag:"div",className:e.class}),Ic=(e)=>({...e,text:e.message}),Lc=(e,t,n)=>({lifecycle:{destroy:e.lifecycle?.destroy||(()=>{})},queue:t,queueBehavior:n?.queueBehavior});var pp=Sc(),hp=(e)=>{if(!e.message)throw Error("Snackbar message is required");let t=yc(e);try{return M(D,k(),O(xc(t)),oe(t),vc(t),ot(Ic(t)),Ec(t),P(),bc(t),(r)=>Tc(Lc(r,pp,t))(r))(t)}catch(n){throw console.error("Snackbar creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create snackbar: ${n instanceof Error?n.message:String(n)}`)}},zs=hp;se();te();re();var Ac=({disabled:e,lifecycle:t,checkable:n})=>(r)=>({...r,element:r.element,input:r.input,getValue(){return n.isChecked()},setValue(i){if(typeof i==="boolean")if(i)n.check();else n.uncheck();else if(typeof i==="string")if(i==="true"||i==="1")n.check();else n.uncheck();return this},getValueAttribute(){return r.input?.value||""},setValueAttribute(i){if(r.input)r.input.value=i;return this},check(){return n.check(),this},uncheck(){return n.uncheck(),this},toggle(){return n.toggle(),this},isChecked(){return n.isChecked()},setLabel(i){return r.text?.setText(i),this},getLabel(){return r.text?.getText()||""},supportingTextElement:r.supportingTextElement||null,setSupportingText(i,s){if(r.setSupportingText)r.setSupportingText(i,s);return this},removeSupportingText(){if(r.removeSupportingText)r.removeSupportingText();return this},on(i,s){return r.on?.(i,s),this},off(i,s){return r.off?.(i,s),this},enable(){return e.enable(),this},disable(){return e.disable(),this},destroy(){t.destroy()}});re();var wc=(e,t,n)=>{let r=t||"mtrl",i=n||"switch",s=e.element.querySelector(`.${r}-${i}-container`);if(!s){s=document.createElement("div"),s.className=`${r}-${i}-container`;let o=e.element.querySelector(`.${r}-${i}-input`),l=e.element.querySelector(`.${r}-${i}-track`),d=[];if(o)d.push(o);if(l)d.push(l);let u=document.createElement("div");u.className=`${r}-${i}-content`;let f=e.element.querySelector(`.${r}-${i}-label`);if(f)u.appendChild(f);return s.appendChild(u),d.forEach((c)=>s.appendChild(c)),e.element.appendChild(s),{container:s,contentWrapper:u}}let a=e.element.querySelector(`.${r}-${i}-content`);if(!a){a=document.createElement("div"),a.className=`${r}-${i}-content`;let o=e.element.querySelector(`.${r}-${i}-label`);if(o)a.appendChild(o);s.insertBefore(a,s.firstChild)}return{container:s,contentWrapper:a}},Nc=(e)=>(t)=>{let n=e.prefix||"mtrl",r=e.componentName||"switch",{contentWrapper:i}=wc(t,n,r),s=null;if(e.supportingText){if(s=document.createElement("div"),s.className=`${n}-${r}-helper`,s.textContent=e.supportingText,e.error)s.classList.add(`${n}-${r}-helper--error`),t.element.classList.add(`${n}-${r}--error`);i.appendChild(s)}if("lifecycle"in t&&t.lifecycle&&typeof t.lifecycle==="object"&&"destroy"in t.lifecycle&&s){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{if(s)s.remove();a.call(t.lifecycle)}}return{...t,supportingTextElement:s,setSupportingText(a,o=!1){let{contentWrapper:l}=wc(t,n,r),d=this.supportingTextElement;if(!d)d=document.createElement("div"),d.className=`${n}-${r}-helper`,l.appendChild(d),this.supportingTextElement=d;return d.textContent=a,d.classList.toggle(`${n}-${r}-helper--error`,o),t.element.classList.toggle(`${n}-${r}--error`,o),this},removeSupportingText(){if(this.supportingTextElement&&this.supportingTextElement.parentNode)this.supportingTextElement.remove(),this.supportingTextElement=null,t.element.classList.remove(`${n}-${r}--error`);return this}}},Dc=(e)=>(t)=>{let n={...e,prefix:e.prefix||"mtrl",componentName:e.componentName||"switch"};return An(n)(t)};ne();var Ep={prefix:"mtrl",componentName:"switch"},Mc=(e={})=>_(Ep,e,"switch"),Oc=(e)=>V(e,{tag:"div",className:e.class,interactive:!0}),Rc=(e)=>({disabled:{enable:e.disabled?.enable,disable:e.disabled?.disable},lifecycle:{destroy:e.lifecycle?.destroy},checkable:{check:e.checkable?.check,uncheck:e.checkable?.uncheck,toggle:e.checkable?.toggle,isChecked:e.checkable?.isChecked}});var bp=(e={})=>{let t=Mc(e);try{return M(D,k(),O(Oc(t)),et(t),Ot(t),Dc(t),Nc(t),Rt(t),de(t),P(),(r)=>Ac(Rc(r))(r))(t)}catch(n){throw console.error("Switch creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create switch: ${n instanceof Error?n.message:String(n)}`)}},Ks=bp;se();te();re();se();te();re();var vp={PRIMARY:"primary",SECONDARY:"secondary"},kc={ACTIVE:"active",INACTIVE:"inactive",DISABLED:"disabled"},Tp={FIXED:"fixed",DYNAMIC:"dynamic",CONTENT:"content",AUTO:"auto"};var Wn={VARIANT:vp.PRIMARY,SCROLLABLE:!0,SHOW_DIVIDER:!0,INDICATOR_HEIGHT:3,INDICATOR_WIDTH_STRATEGY:Tp.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},Cn={ICON_ONLY:"icon-only",TEXT_ONLY:"text-only",ICON_AND_TEXT:"icon-and-text"};ne();te();var Sp={state:kc.INACTIVE,componentName:"tab",ripple:Wn.RIPPLE},yp={variant:Wn.VARIANT,scrollable:Wn.SCROLLABLE,showDivider:Wn.SHOW_DIVIDER,componentName:"tabs"},Bc=(e={})=>_(yp,e,"tabs"),Hc=(e={})=>_(Sp,e,"tab"),$c=(e)=>{let t={tag:"div",attributes:{role:"tablist","aria-orientation":"horizontal"},className:[`${e.prefix}-tabs`,`${e.prefix}-tabs--${e.variant||"primary"}`,e.class]};return(n)=>O(t)(n)};Ht();var En=(e={})=>{let t=Hc(e);try{let n=M(D,k(),P())(t),r=He({text:t.text,icon:t.icon,iconSize:t.iconSize,disabled:t.disabled,ripple:t.ripple!==!1,rippleConfig:{duration:400,timing:"cubic-bezier(0.4, 0, 0.2, 1)",opacity:["0.2","0"],...t.rippleConfig||{}},value:t.value,prefix:t.prefix,variant:"text",class:`${t.prefix}-tab`});if(n.element=r.element,n.element.setAttribute("role","tab"),n.element.setAttribute("aria-selected",t.state==="active"?"true":"false"),t.value)n.element.setAttribute("id",`tab-${t.value}`),n.element.setAttribute("aria-controls",`tabpanel-${t.value}`);if(t.state==="active")n.element.classList.add(`${n.getClass("tab")}--active`);r.on("click",(s)=>{if(n.emit)n.emit("click",s)});let i={...n,button:r,element:r.element,badge:null,getValue(){return r.getValue()},setValue(s){let a=s||"";return r.setValue(a),this.element.setAttribute("id",`tab-${a}`),this.element.setAttribute("aria-controls",`tabpanel-${a}`),this},activate(){this.element.classList.add(`${this.getClass("tab")}--active`),this.element.setAttribute("aria-selected","true");let s=new CustomEvent("tab:activated",{bubbles:!0,detail:{value:this.getValue()}});return this.element.dispatchEvent(s),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 r.enable(),this.element.removeAttribute("aria-disabled"),this},disable(){return r.disable(),this.element.setAttribute("aria-disabled","true"),this},setText(s){return r.setText(s),this.updateLayoutStyle(),this},getText(){return r.getText()},setIcon(s){return r.setIcon(s),this.updateLayoutStyle(),this},getIcon(){return r.getIcon()},setBadge(s){if(!this.badge){let a={content:s,standalone:!1,target:this.element,prefix:t.prefix,...t.badgeConfig||{}};this.badge=Dn(a)}else this.badge.setContent(s),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(r.destroy)r.destroy();n.lifecycle.destroy()},updateLayoutStyle(){let s=!!this.getText(),a=!!this.getIcon(),o="";if(s&&a)o=Cn.ICON_AND_TEXT;else if(a)o=Cn.ICON_ONLY;else o=Cn.TEXT_ONLY;if(Object.values(Cn).forEach((l)=>{this.element.classList.remove(`${this.getClass("tab")}--${l}`)}),this.element.classList.add(`${this.getClass("tab")}--${o}`),o===Cn.ICON_ONLY&&s)this.element.setAttribute("aria-label",this.getText());else this.element.removeAttribute("aria-label")}};if(t.badge!==void 0)i.setBadge(t.badge);return i.updateLayoutStyle(),i}catch(n){throw console.error("Tab creation error:",n),Error(`Failed to create tab: ${n.message}`)}};var Vc=({lifecycle:e})=>(t)=>({...t,element:t.element,addTab(n){let r={...n,prefix:t.config.prefix,variant:n.variant||t.config.variant};if(r.value===void 0)r.value="";let i=En(r);if(t.tabs.push(i),t.tabsContainer.appendChild(i.element),i.on&&typeof i.on==="function")i.on("click",(a)=>t.handleTabClick(a,i));return i.element.addEventListener("click",(a)=>{t.handleTabClick(a,i)}),i},add(n){if(t.tabs.push(n),t.tabsContainer.appendChild(n.element),n.on&&typeof n.on==="function")n.on("click",(i)=>t.handleTabClick(i,n));return n.element.addEventListener("click",(i)=>{t.handleTabClick(i,n)}),this},getTabs(){return[...t.tabs]},getActiveTab(){return t.tabs.find((n)=>n.isActive())||null},setActiveTab(n){let r=typeof n==="string"?t.tabs.find((i)=>i.getValue()===n):n;if(!r)return this;if(t.tabs.forEach((i)=>i.deactivate()),r.activate(),t.emit)t.emit("change",{tab:r,value:r.getValue()});return this},removeTab(n){let r=typeof n==="string"?t.tabs.find((s)=>s.getValue()===n):n;if(!r)return this;let i=t.tabs.indexOf(r);if(i!==-1)t.tabs.splice(i,1);if(r.element.parentNode)r.element.parentNode.removeChild(r.element);return r.destroy(),this},on(n,r){if(t.on)t.on(n,r);return this},off(n,r){if(t.off)t.off(n,r);return this},destroy(){t.tabs.forEach((n)=>n.destroy()),t.tabs.length=0,e.destroy()}}),Fc=(e)=>({lifecycle:{destroy:()=>e.lifecycle.destroy()}});function Uc(e){if(typeof e.getActiveTab==="function")return e.getActiveTab();if(Array.isArray(e.tabs))return e.tabs.find((t)=>t.isActive&&t.isActive());return null}function Gc(e){let t=Uc(e);if(!t)return;if(typeof t.getValue!=="function")return;let n=t.getValue();document.querySelectorAll('[role="tabpanel"]').forEach((i)=>{if(i.getAttribute("aria-labelledby")?.replace("tab-","")===n)i.removeAttribute("hidden"),i.setAttribute("tabindex","0");else i.setAttribute("hidden","true"),i.setAttribute("tabindex","-1")})}function zc(e){if(!e.element)return;e.element.addEventListener("keydown",(t)=>{if(t.target!==t.currentTarget)return;if(typeof e.getTabs!=="function"||typeof e.setActiveTab!=="function")return;let n=e.getTabs(),r=Uc(e),i=r?n.indexOf(r):-1,s=i;switch(t.key){case"ArrowRight":case"ArrowDown":s=i<n.length-1?i+1:0;break;case"ArrowLeft":case"ArrowUp":s=i>0?i-1:n.length-1;break;case"Home":s=0;break;case"End":s=n.length-1;break;default:return}if(s!==i&&n[s])t.preventDefault(),n[s].element.focus(),e.setActiveTab(n[s])})}var xp={widthStrategy:"auto",fixedWidth:40,animationDuration:250,animationTiming:"cubic-bezier(0.4, 0, 0.2, 1)",visible:!0,prefix:"mtrl",variant:"primary"},Wc=(e={})=>{let t={...xp,...e},n=t.prefix||"mtrl",r=document.createElement("div");if(r.className=`${n}-tabs-indicator`,r.style.transition=`transform ${t.animationDuration}ms ${t.animationTiming},
|
|
29
29
|
width ${t.animationDuration}ms ${t.animationTiming}`,r.style.width=`${t.fixedWidth}px`,!t.visible)r.style.opacity="0";let i=null,s=(g)=>{if(t.widthStrategy==="auto"){if(t.variant==="secondary")return g.element.offsetWidth;let m=g.element.querySelector(`.${n}-tab-text`)||g.element.querySelector(`.${n}-button-text`);if(m)return m.clientWidth;return Math.max(g.element.offsetWidth/2,30)}switch(t.widthStrategy){case"dynamic":return Math.max(g.element.offsetWidth/2,30);case"content":let m=g.element.querySelector(`.${n}-button-text`)||g.element.querySelector(`.${n}-tab-text`);if(m)return Math.max(m.clientWidth,30);return t.fixedWidth||40;case"fixed":default:return t.fixedWidth||40}},a=(g)=>{let m=g.parentElement;if(!m)return console.error("Tab has no parent element, cannot position indicator"),{left:0,width:g.offsetWidth};let p=g.getBoundingClientRect(),h=m.getBoundingClientRect();return{left:p.left-h.left,width:p.width}},o=(g,m)=>{let{left:p,width:h}=a(g.element);if(t.variant!=="secondary"&&(t.widthStrategy==="auto"||t.widthStrategy==="content")){let b=g.element.querySelector(`.${n}-tab-text`)||g.element.querySelector(`.${n}-button-text`);if(b){let v=b.getBoundingClientRect(),E=g.element.getBoundingClientRect(),T=v.left-E.left;return{left:p+T}}}if(m<h)return{left:p+(h-m)/2};return{left:p}},l=(g,m=!1)=>{if(!g||!g.element){console.error("Invalid tab or tab has no element");return}i=g;let p=s(g),{left:h}=o(g,p);if(m)r.style.transition="none",r.offsetHeight;if(r.style.width=`${p}px`,r.style.transform=`translateX(${h}px)`,m)setTimeout(()=>{r.style.transition=`transform ${t.animationDuration}ms ${t.animationTiming},
|
|
30
|
-
width ${t.animationDuration}ms ${t.animationTiming}`},10)};return{element:r,moveToTab:l,show:()=>{r.style.opacity="1"},hide:()=>{r.style.opacity="0"},setColor:(g)=>{r.style.backgroundColor=g},update:()=>{if(i)l(i,!0)},destroy:()=>{if(r.parentNode)r.parentNode.removeChild(r);i=null}}};var
|
|
30
|
+
width ${t.animationDuration}ms ${t.animationTiming}`},10)};return{element:r,moveToTab:l,show:()=>{r.style.opacity="1"},hide:()=>{r.style.opacity="0"},setColor:(g)=>{r.style.backgroundColor=g},update:()=>{if(i)l(i,!0)},destroy:()=>{if(r.parentNode)r.parentNode.removeChild(r);i=null}}};var Kc=(e)=>(t)=>{let n=[],r=t.scrollContainer||t.element;if(Array.isArray(e.tabs))e.tabs.forEach((o)=>{let l={...o,prefix:e.prefix,variant:o.variant||e.variant},d=En(l);n.push(d),r.appendChild(d.element)});let i=()=>[...n],s=()=>n.find((o)=>o.isActive())||null,a=(o,l)=>{if(o&&typeof o.preventDefault==="function")o.preventDefault();if(l.disabled&&l.disabled.isDisabled&&l.disabled.isDisabled())return;n.forEach((u)=>u.deactivate()),l.activate();let d=l.getValue();if(Gc({tabs:n,getActiveTab:()=>n.find((u)=>u.isActive())||null}),typeof t.emit==="function")t.emit("change",{tab:l,value:d})};return n.forEach((o)=>{if(o.on&&typeof o.on==="function")o.on("click",(l)=>a(l,o));o.element.addEventListener("click",(l)=>a(l,o))}),{...t,tabs:n,tabsContainer:r,handleTabClick:a,getTabs:i,getActiveTab:s}},Yc=(e)=>(t)=>{if(e.scrollable===!1)return t;t.element.classList.add(`${t.getClass("tabs")}--scrollable`);let n=document.createElement("div");n.className=`${t.getClass("tabs")}-scroll`;while(t.element.firstChild)n.appendChild(t.element.firstChild);return t.element.appendChild(n),{...t,scrollContainer:n}},Xc=(e)=>(t)=>{if(e.showDivider===!1)return t;let n=document.createElement("div");return n.className=`${t.getClass("tabs")}-divider`,t.element.appendChild(n),t},qc=(e)=>(t)=>{let n=e.indicator||{},r=Wc({prefix:e.prefix,widthStrategy:n.widthStrategy||e.indicatorWidthStrategy||"auto",height:n.height||e.indicatorHeight||3,fixedWidth:n.fixedWidth||40,animationDuration:n.animationDuration||250,animationTiming:n.animationTiming||"cubic-bezier(0.4, 0, 0.2, 1)",color:n.color,variant:e.variant??"primary"}),i=t.scrollContainer||t.element;if(!i)throw console.error("No scroll container found - cannot add indicator"),Error("Failed to create tabs: No scroll container found");i.appendChild(r.element);let s=t.handleTabClick;t.handleTabClick=function(u,f){if(f.disabled&&f.disabled.isDisabled&&f.disabled.isDisabled())return;s.call(this,u,f),setTimeout(()=>{r.moveToTab(f)},10)},setTimeout(()=>{let u=t.tabs.find((f)=>f.isActive());if(u)r.moveToTab(u,!0)},50);let a=()=>{let u=t.tabs.find((f)=>f.isActive());if(u)r.moveToTab(u,!0)};if(i)i.addEventListener("scroll",a);let o=new ResizeObserver(()=>{let u=t.tabs.find((f)=>f.isActive());if(u)r.moveToTab(u,!0)});o.observe(i);let l=new MutationObserver((u)=>{for(let f of u)if(f.type==="attributes"&&f.attributeName==="class"&&f.target.classList.contains(`${e.prefix}-tab--active`)){let c=f.target,C=t.tabs.find((g)=>g.element===c);if(C)r.moveToTab(C)}});if(Array.isArray(t.tabs))t.tabs.forEach((u)=>{if(u.element)l.observe(u.element,{attributes:!0})});let d=t.destroy||(()=>{});return t.destroy=function(){if(r.destroy(),o.disconnect(),l.disconnect(),i)i.removeEventListener("scroll",a);if(typeof d==="function")d.call(this)},{...t,indicator:r,getIndicator:()=>r}};var jc=()=>{if(document.getElementById("tab-state-styles"))return;let e=document.createElement("style");e.id="tab-state-styles",e.textContent=`
|
|
31
31
|
@keyframes ripple-effect {
|
|
32
32
|
0% {
|
|
33
33
|
transform: scale(0);
|
|
@@ -38,7 +38,7 @@ var vm=Object.create;var{getPrototypeOf:Tm,defineProperty:Sn,getOwnPropertyNames
|
|
|
38
38
|
opacity: 0;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
`,document.head.appendChild(e)};var
|
|
41
|
+
`,document.head.appendChild(e)};var Ip=(e={})=>{let t=Bc(e);jc();try{let n=M(D,k(),$c(t),Yc(t),Kc(t),Xc(t),qc(t),P(),(r)=>Vc(Fc(r))(r))(t);return zc(n),n}catch(n){throw console.error("Tabs creation error:",n),Error(`Failed to create tabs: ${n.message}`)}},Zc=Ip;var Qc=Zc;nt();se();te();re();ne();var Lp={DIAL:"dial",INPUT:"input"},Ap={VERTICAL:"vertical",HORIZONTAL:"horizontal"},wp={AMPM:"12h",MILITARY:"24h"};var Pe={CHANGE:"change",OPEN:"open",CLOSE:"close",CONFIRM:"confirm",CANCEL:"cancel"},Xt={DIAMETER:256,INNER_RADIUS:65,OUTER_RADIUS:110,NUMBER_SIZE:40,CENTER_SIZE:8,HAND_SIZE:36,TRACK_WIDTH:2},bD={HOURS_12:Array.from({length:12},(e,t)=>t===0?12:t),HOURS_24:Array.from({length:24},(e,t)=>t),MINUTES:Array.from({length:60},(e,t)=>t),SECONDS:Array.from({length:60},(e,t)=>t)},Ys={MODAL:1050,DIALOG:1051},ce={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"},st={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">
|
|
42
42
|
<circle cx="12" cy="12" r="10"></circle>
|
|
43
43
|
<polyline points="12 6 12 12 16 14"></polyline>
|
|
44
44
|
</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">
|
|
@@ -52,6 +52,6 @@ var vm=Object.create;var{getPrototypeOf:Tm,defineProperty:Sn,getOwnPropertyNames
|
|
|
52
52
|
<line x1="14" y1="12" x2="14" y2="12"></line>
|
|
53
53
|
<line x1="18" y1="12" x2="18" y2="12"></line>
|
|
54
54
|
<line x1="6" y1="16" x2="18" y2="16"></line>
|
|
55
|
-
</svg>`},wt={TYPE:wp.DIAL,FORMAT:Dp.AMPM,ORIENTATION:Np.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:at.CLOCK,KEYBOARD_ICON:at.KEYBOARD};var Mp={type:"dial",format:"12h",orientation:"vertical",showSeconds:wt.SHOW_SECONDS,closeOnSelect:wt.CLOSE_ON_SELECT,minuteStep:wt.MINUTE_STEP,secondStep:wt.SECOND_STEP,cancelText:wt.CANCEL_TEXT,confirmText:wt.CONFIRM_TEXT,isOpen:wt.IS_OPEN,clockIcon:at.CLOCK,keyboardIcon:at.KEYBOARD},nm=(e={})=>_(Mp,e,"time-picker"),rm=(e)=>V(e,{tag:"div",attributes:{role:"dialog","aria-modal":"true","aria-labelledby":`${e.prefix}-time-picker-title`},className:[e.class,e.isOpen?`${e.prefix}-time-picker--open`:""],forwardEvents:{click:!0,keydown:!0},interactive:!0});var im=(e)=>({events:{on:(t,n)=>e.on(t,n),off:(t,n)=>e.off(t,n),emit:(t,n)=>e.emit(t,n)},lifecycle:{destroy:()=>e.lifecycle.destroy()}});var ae=(e)=>e.toString().padStart(2,"0"),sm=(e,t)=>{try{let n=e.split(":"),r=parseInt(n[0],10),i=parseInt(n[1],10),s=n[2]?parseInt(n[2],10):0;if(isNaN(r)||r<0||r>23||isNaN(i)||i<0||i>59||isNaN(s)||s<0||s>59)throw Error("Invalid time format");let a=r>=12?"PM":"AM";return{hours:r,minutes:i,seconds:s,period:a}}catch(n){console.error("Error parsing time:",n);let r=new Date,i=r.getHours(),s=r.getMinutes(),a=r.getSeconds(),o=i>=12?"PM":"AM";return{hours:i,minutes:s,seconds:a,period:o}}},am=(e,t)=>{let{hours:n,minutes:r,seconds:i}=e;if(t){if(i!==void 0)return`${ae(n)}:${ae(r)}:${ae(i)}`;return`${ae(n)}:${ae(r)}`}else{let s=n%12;if(s===0)s=12;if(i!==void 0)return`${ae(s)}:${ae(r)}:${ae(i)} ${e.period}`;return`${ae(s)}:${ae(r)} ${e.period}`}};var om=(e)=>{let t=e>=12?"PM":"AM",n=e%12;if(n===0)n=12;return{hours:n,period:t}};var fe={...Xt,KNOB_SIZE:45,CENTER_SIZE:8,NUMBER_SIZE:24,INNER_RADIUS:75,OUTER_RADIUS:100,TRACK_WIDTH:1.5,HAND_WIDTH:2};function Op(e){let t=document.documentElement,n=getComputedStyle(t),r=n.getPropertyValue(`--${e}-sys-color-primary`).trim()||"#6750A4",i=n.getPropertyValue(`--${e}-sys-color-on-primary`).trim()||"#FFFFFF",s=n.getPropertyValue(`--${e}-sys-color-on-surface`).trim()||"#1C1B1F",a=n.getPropertyValue(`--${e}-sys-color-primary-rgb`).trim()||"103, 80, 164",l=`rgba(${n.getPropertyValue(`--${e}-sys-color-on-surface-rgb`).trim()||"28, 27, 31"}, 0.05)`,d=`rgba(${a}, 0.1)`;return{primaryColor:r,onPrimaryColor:i,onSurfaceColor:s,bgColor:l,selectedBgColor:d}}var De=(e,t,n)=>{let r=e.getContext("2d");if(!r){console.error("Could not get canvas context");return}let i=Op(n.prefix),s=window.devicePixelRatio||1;e.width=fe.DIAMETER*s,e.height=fe.DIAMETER*s,r.scale(s,s);let a=fe.DIAMETER/2,o=fe.DIAMETER/2,l=fe.DIAMETER/2;if(r.clearRect(0,0,e.width,e.height),r.beginPath(),r.arc(a,o,l-2,0,2*Math.PI),r.fillStyle=i.bgColor,r.fill(),r.beginPath(),r.arc(a,o,fe.CENTER_SIZE/2,0,2*Math.PI),r.fillStyle=i.primaryColor,r.fill(),n.activeSelector==="hour")if(n.format==="24h")_p(r,a,o,l,t.hours,i);else Rp(r,a,o,l,t.hours%12||12,i);else if(n.activeSelector==="minute")lm(r,a,o,l,t.minutes,i);else if(n.activeSelector==="second"&&n.showSeconds)lm(r,a,o,l,t.seconds||0,i);Pp(r,a,o,t,n,i)},Rp=(e,t,n,r,i,s)=>{let a=fe.OUTER_RADIUS;for(let o=1;o<=12;o++){let l=o/6*Math.PI-Math.PI/2,d=t+a*Math.cos(l),u=n+a*Math.sin(l),f=o===i;if(f)e.beginPath(),e.arc(d,u,fe.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill();e.font="16px Roboto, Arial, sans-serif",e.fillStyle=f?s.primaryColor:s.onSurfaceColor,e.textAlign="center",e.textBaseline="middle",e.fillText(o.toString(),d,u+2)}},_p=(e,t,n,r,i,s)=>{let a=fe.OUTER_RADIUS;for(let l=1;l<=12;l++){let d=l/6*Math.PI-Math.PI/2,u=t+a*Math.cos(d),f=n+a*Math.sin(d),c=l===i;if(c)e.beginPath(),e.arc(u,f,fe.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill();e.font="16px Roboto, Arial, sans-serif",e.fillStyle=c?s.primaryColor:s.onSurfaceColor,e.textAlign="center",e.textBaseline="middle",e.fillText(l.toString(),u,f+2)}let o=fe.INNER_RADIUS;for(let l=13;l<=24;l++){let d=l===24?0:l,u=(l-12)/6*Math.PI-Math.PI/2,f=t+o*Math.cos(u),c=n+o*Math.sin(u),C=d===i;if(C)e.beginPath(),e.arc(f,c,fe.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill();e.font="14px Roboto, Arial, sans-serif",e.fillStyle=C?s.primaryColor:s.onSurfaceColor,e.textAlign="center",e.textBaseline="middle",e.fillText(ae(d),f,c+2)}},lm=(e,t,n,r,i,s)=>{let a=fe.OUTER_RADIUS;for(let o=0;o<60;o+=5){let l=o/30*Math.PI-Math.PI/2,d=t+a*Math.cos(l),u=n+a*Math.sin(l),f=o===i;if(f)e.beginPath(),e.arc(d,u,fe.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill();e.font="16px Roboto, Arial, sans-serif",e.fillStyle=f?s.primaryColor:s.onSurfaceColor,e.textAlign="center",e.textBaseline="middle",e.fillText(ae(o),d,u)}if(i%5!==0){let o=i/30*Math.PI-Math.PI/2,l=t+a*Math.cos(o),d=n+a*Math.sin(o);e.beginPath(),e.arc(l,d,fe.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill(),e.font="16px Roboto, Arial, sans-serif",e.fillStyle=s.primaryColor,e.textAlign="center",e.textBaseline="middle",e.fillText(ae(i),l,d)}},Pp=(e,t,n,r,i,s)=>{let a,o;if(i.activeSelector==="hour")if(i.format==="24h")if(r.hours>=12)a=(r.hours%12||12)/6*Math.PI-Math.PI/2,o=fe.INNER_RADIUS;else{let f=r.hours;if(f===0)f=12;a=f/6*Math.PI-Math.PI/2,o=fe.OUTER_RADIUS}else a=(r.hours%12||12)/6*Math.PI-Math.PI/2,o=fe.OUTER_RADIUS;else if(i.activeSelector==="minute")a=r.minutes/30*Math.PI-Math.PI/2,o=fe.OUTER_RADIUS;else if(i.activeSelector==="second")a=(r.seconds||0)/30*Math.PI-Math.PI/2,o=fe.OUTER_RADIUS;else return;e.beginPath(),e.moveTo(t,n),e.lineTo(t+o*Math.cos(a),n+o*Math.sin(a)),e.lineWidth=fe.HAND_WIDTH,e.strokeStyle=s.primaryColor,e.stroke();let l=t+o*Math.cos(a),d=n+o*Math.sin(a);e.beginPath(),e.arc(l,d,fe.KNOB_SIZE/2,0,2*Math.PI),e.fillStyle=s.primaryColor,e.fill(),e.font="16px Roboto, Arial, sans-serif",e.fillStyle=s.onPrimaryColor,e.textAlign="center",e.textBaseline="middle";let u="";if(i.activeSelector==="hour")if(i.format==="24h")u=ae(r.hours);else u=String(r.hours%12||12);else if(i.activeSelector==="minute")u=ae(r.minutes);else if(i.activeSelector==="second")u=ae(r.seconds||0);e.fillText(u,l,d)},Fr=(e,t,n,r)=>{let i=fe.DIAMETER/2,s=fe.DIAMETER/2,a=t-i,o=n-s,l=Math.sqrt(a*a+o*o),d=Math.atan2(o,a)+Math.PI/2;if(d<0)d+=2*Math.PI;if(r.activeSelector==="hour")if(r.format==="24h"){let u=(fe.INNER_RADIUS+fe.OUTER_RADIUS)/2,f=l<u,c=Math.round(d/(Math.PI/6))%12;if(f&&c!==0)c+=12;else if(!f&&c===0)c=12;else if(f&&c===0)c=0;return c}else{let u=Math.round(d/(Math.PI/6))%12;if(u===0)u=12;return u}else if(r.activeSelector==="minute"||r.activeSelector==="second")return Math.round(d/(Math.PI/30))%60;return null};var qe=(e,t,n,r)=>{if(e.innerHTML="",n.title){let y=document.createElement("div");y.className=`${n.prefix}-time-picker-title`,y.textContent=n.title,y.id=`${n.prefix}-time-picker-title`,e.appendChild(y)}let i=document.createElement("div");i.className=`${n.prefix}-time-picker-content`,e.appendChild(i);let s=document.createElement("div");s.className=`${n.prefix}-time-picker-input-container`,i.appendChild(s);let{hours:a}=n.format==="24h"?{hours:t.hours}:om(t.hours),o=document.createElement("div");o.className=`${n.prefix}-time-picker-time-input-field`;let l=document.createElement("input");l.type="number",l.className=`${n.prefix}-time-picker-hours`,l.min=n.format==="24h"?"0":"1",l.max=n.format==="24h"?"23":"12",l.value=ae(a),l.setAttribute("data-type","hour"),l.setAttribute("inputmode","numeric"),l.setAttribute("pattern","[0-9]*"),o.appendChild(l),s.appendChild(o);let d=document.createElement("div");d.className=`${n.prefix}-time-picker-separator`,d.textContent=":",s.appendChild(d);let u=document.createElement("div");u.className=`${n.prefix}-time-picker-time-input-field`;let f=document.createElement("input");f.type="number",f.className=`${n.prefix}-time-picker-minutes`,f.min="0",f.max="59",f.value=ae(t.minutes),f.setAttribute("data-type","minute"),f.setAttribute("inputmode","numeric"),f.setAttribute("pattern","[0-9]*"),u.appendChild(f),s.appendChild(u);let c;if(n.showSeconds){let y=document.createElement("div");y.className=`${n.prefix}-time-picker-separator`,y.textContent=":",s.appendChild(y);let L=document.createElement("div");L.className=`${n.prefix}-time-picker-time-input-field`,c=document.createElement("input"),c.type="number",c.className=`${n.prefix}-time-picker-seconds`,c.min="0",c.max="59",c.value=ae(t.seconds||0),c.setAttribute("data-type","second"),c.setAttribute("inputmode","numeric"),c.setAttribute("pattern","[0-9]*");let I=document.createElement("label");I.className=`${n.prefix}-time-picker-input-label`,I.textContent="Second",L.appendChild(c),L.appendChild(I),s.appendChild(L)}if(n.format==="12h"){let y=document.createElement("div");y.className=`${n.prefix}-time-picker-period`;let L=document.createElement("div");L.className=`${n.prefix}-time-picker-period-am ${t.period==="AM"?`${n.prefix}-time-picker-period--selected`:""}`,L.textContent="AM",L.setAttribute("role","button"),L.setAttribute("tabindex","0"),L.setAttribute("aria-pressed",t.period==="AM"?"true":"false");let I=document.createElement("div");I.className=`${n.prefix}-time-picker-period-pm ${t.period==="PM"?`${n.prefix}-time-picker-period--selected`:""}`,I.textContent="PM",I.setAttribute("role","button"),I.setAttribute("tabindex","0"),I.setAttribute("aria-pressed",t.period==="PM"?"true":"false"),y.appendChild(L),y.appendChild(I),s.appendChild(y)}let C=document.createElement("div");C.className=`${n.prefix}-time-picker-dial`,C.style.display=n.type==="dial"?"block":"none",i.appendChild(C);let g=document.createElement("canvas");g.className=`${n.prefix}-time-picker-dial-canvas`,g.width=Xt.DIAMETER,g.height=Xt.DIAMETER,g.style.width=`${Xt.DIAMETER}px`,g.style.height=`${Xt.DIAMETER}px`,C.appendChild(g);let m=document.createElement("div");m.className=`${n.prefix}-time-picker-actions`,e.appendChild(m);let p=document.createElement("button");p.className=`${n.prefix}-time-picker-toggle-type`,p.setAttribute("aria-label",n.type==="dial"?"Switch to keyboard input":"Switch to dial selector"),p.innerHTML=n.type==="dial"?n.keyboardIcon||at.KEYBOARD:n.clockIcon||at.CLOCK,m.appendChild(p);let h=document.createElement("div");h.className=`${n.prefix}-time-picker-action-buttons`,m.appendChild(h);let b=document.createElement("button");b.className=`${n.prefix}-time-picker-cancel`,b.textContent=n.cancelText||"Cancel",b.setAttribute("type","button"),h.appendChild(b);let v=document.createElement("button");v.className=`${n.prefix}-time-picker-confirm`,v.textContent=n.confirmText||"OK",v.setAttribute("type","button"),h.appendChild(v);let E="hour";if(n.type==="dial")setTimeout(()=>{De(g,t,{type:n.type,format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})},0);p.addEventListener("click",()=>{if(C.style.display==="none")C.style.display="block",p.innerHTML=n.keyboardIcon||at.KEYBOARD,p.setAttribute("aria-label","Switch to keyboard input"),setTimeout(()=>{g.focus(),document.querySelectorAll(`.${n.prefix}-time-picker-hours`).forEach((x)=>x.setAttribute("data-active","true")),document.querySelectorAll(`.${n.prefix}-time-picker-minutes`).forEach((x)=>x.setAttribute("data-active","false")),document.querySelectorAll(`.${n.prefix}-time-picker-seconds`).forEach((x)=>x.setAttribute("data-active","false")),De(g,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:"hour"})},50);else C.style.display="none",p.innerHTML=n.clockIcon||at.CLOCK,p.setAttribute("aria-label","Switch to dial selector"),setTimeout(()=>{l.focus(),l.select()},50)});let T=(y)=>{let L=y.target,I=L.getAttribute("data-type"),x=L.value;if(x==="")return;let A=parseInt(x,10);if(isNaN(A))return;if(I==="hour"){let N=A;if(n.format==="12h"){if(A<0)N=1;if(A>12)N=12;if(t.period==="PM"&&N!==12)N+=12;else if(t.period==="AM"&&N===12)N=0}else{if(A<0)N=0;if(A>23)N=23}if(t.hours=N,E="hour",l.setAttribute("data-active","true"),f.setAttribute("data-active","false"),c)c.setAttribute("data-active","false");if(De(g,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E}),r)r("hours",N)}else if(I==="minute"){let N=A;if(A<0)N=0;if(A>59)N=59;if(t.minutes=N,E="minute",l.setAttribute("data-active","false"),f.setAttribute("data-active","true"),c)c.setAttribute("data-active","false");if(De(g,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E}),r)r("minutes",N)}else if(I==="second"){let N=A;if(A<0)N=0;if(A>59)N=59;if(t.seconds=N,E="second",l.setAttribute("data-active","false"),f.setAttribute("data-active","false"),c)c.setAttribute("data-active","true");if(De(g,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E}),r)r("seconds",N)}};if(l.addEventListener("input",T),f.addEventListener("input",T),c)c.addEventListener("input",T);if(l.addEventListener("keyup",(y)=>{if(y.key==="Enter")f.focus(),f.select()}),f.addEventListener("keyup",(y)=>{if(y.key==="Enter")if(n.showSeconds&&c)c.focus(),c.select();else v.focus()}),c)c.addEventListener("keyup",(y)=>{if(y.key==="Enter")v.focus()});let S=(y)=>{if(t.period!==y){let L=t.period;if(t.period=y,L==="AM"&&y==="PM"){if(t.hours<12)t.hours+=12}else if(L==="PM"&&y==="AM"){if(t.hours>=12)t.hours-=12}if(n.format==="12h"){let x=t.hours===0?12:t.hours>12?t.hours-12:t.hours;l.value=ae(x)}document.querySelectorAll(`.${n.prefix}-time-picker-period-am, .${n.prefix}-time-picker-period-pm`).forEach((x)=>{x.classList.remove(`${n.prefix}-time-picker-period--selected`),x.setAttribute("aria-pressed","false")});let I=document.querySelector(`.${n.prefix}-time-picker-period-${y.toLowerCase()}`);if(I)I.classList.add(`${n.prefix}-time-picker-period--selected`),I.setAttribute("aria-pressed","true");if(C.style.display==="block")De(g,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E});if(r)r("hours",t.hours)}};if(n.format==="12h"){let y=document.querySelector(`.${n.prefix}-time-picker-period-am`),L=document.querySelector(`.${n.prefix}-time-picker-period-pm`);if(y)y.addEventListener("click",()=>{S("AM")});if(L)L.addEventListener("click",()=>{S("PM")})}if(n.type==="dial"||C.style.display==="block"){if(g.addEventListener("click",(y)=>{let L=g.getBoundingClientRect(),I=y.clientX-L.left,x=y.clientY-L.top,A=Fr(g,I,x,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E});if(A!==null){if(E==="hour"){let N=A;if(n.format==="12h"){if(t.period==="PM"&&A!==12)N+=12;else if(t.period==="AM"&&A===12)N=0}if(t.hours=N,n.format==="12h"){let R=N===0?12:N>12?N-12:N;l.value=ae(R)}else l.value=ae(N);if(r)r("hours",N)}else if(E==="minute"){if(t.minutes=A,f.value=ae(A),r)r("minutes",A)}else if(E==="second"&&c){if(t.seconds=A,c.value=ae(A),r)r("seconds",A)}De(g,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})}}),l.addEventListener("click",()=>{if(C.style.display==="block"){if(E="hour",l.setAttribute("data-active","true"),f.setAttribute("data-active","false"),c)c.setAttribute("data-active","false");De(g,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})}}),f.addEventListener("click",()=>{if(C.style.display==="block"){if(E="minute",l.setAttribute("data-active","false"),f.setAttribute("data-active","true"),c)c.setAttribute("data-active","false");De(g,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})}}),c)c.addEventListener("click",()=>{if(C.style.display==="block")E="second",l.setAttribute("data-active","false"),f.setAttribute("data-active","false"),c.setAttribute("data-active","true"),De(g,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})})}};var dm=(e,t,n,r,i,s)=>{let a=!!i.isOpen,o=(f)=>{if(f.key==="Escape")d.close(),s.events.emit(Pe.CANCEL)},l=(f)=>{if(f.target===t)d.close()},d={element:e.element,modalElement:t,dialogElement:n,isOpen:a,open(){if(a)return this;if(t.style.display="block",t.offsetWidth,t.classList.add("active"),n.classList.add("active"),document.addEventListener("keydown",o),t.addEventListener("click",l),a=!0,e.element.classList.add(`${i.prefix}-time-picker--open`),setTimeout(()=>{qe(n,r,i)},50),s.events.emit(Pe.OPEN),i.onOpen)i.onOpen();return this},close(){if(!a)return this;if(t.classList.remove("active"),n.classList.remove("active"),setTimeout(()=>{t.style.display="none"},300),document.removeEventListener("keydown",o),t.removeEventListener("click",l),a=!1,e.element.classList.remove(`${i.prefix}-time-picker--open`),s.events.emit(Pe.CLOSE),i.onClose)i.onClose();return this},toggle(){return a?this.close():this.open()},getValue(){return am(r,i.format==="24h")},getTimeObject(){return{...r}},setValue(f){try{let c=f.split(":"),C=parseInt(c[0],10),g=parseInt(c[1],10),m=c[2]?parseInt(c[2],10):0;if(isNaN(C)||C<0||C>23||isNaN(g)||g<0||g>59||isNaN(m)||m<0||m>59)throw Error("Invalid time format. Use HH:MM or HH:MM:SS (24-hour format).");if(r.hours=C,r.minutes=g,r.seconds=m,r.period=C>=12?"PM":"AM",qe(n,r,i),s.events.emit(Pe.CHANGE,this.getValue()),i.onChange)i.onChange(this.getValue())}catch(c){console.error("Error setting time value:",c)}return this},setType(f){if(i.type===f)return this;return i.type=f,n.classList.remove(`${i.prefix}-time-picker-dialog--${"dial"}`,`${i.prefix}-time-picker-dialog--${"input"}`),n.classList.add(`${i.prefix}-time-picker-dialog--${f}`),qe(n,r,i),this},getType(){return i.type},setFormat(f){if(i.format===f)return this;if(i.format=f,n.classList.remove(`${i.prefix}-time-picker-dialog--${"12h"}`,`${i.prefix}-time-picker-dialog--${"24h"}`),n.classList.add(`${i.prefix}-time-picker-dialog--${f}`),f==="24h")r.period=r.hours>=12?"PM":"AM";else r.period=r.hours>=12?"PM":"AM";return qe(n,r,i),s.events.emit(Pe.CHANGE,this.getValue()),this},getFormat(){return i.format},setOrientation(f){if(i.orientation===f)return this;return i.orientation=f,n.classList.remove(`${i.prefix}-time-picker-dialog--${"vertical"}`,`${i.prefix}-time-picker-dialog--${"horizontal"}`),n.classList.add(`${i.prefix}-time-picker-dialog--${f}`),qe(n,r,i),this},getOrientation(){return i.orientation},setTitle(f){i.title=f;let c=n.querySelector(me.TITLE);if(c)c.textContent=f;else qe(n,r,i);return this},getTitle(){return i.title||""},destroy(){if(a)this.close();if(t&&t.parentNode)t.parentNode.removeChild(t);s.lifecycle.destroy()},on(f,c){return s.events.on(f,c),this},off(f,c){return s.events.off(f,c),this}};n.addEventListener("click",(f)=>{let c=f.target;if(c.closest(me.CANCEL_BUTTON)){if(d.close(),s.events.emit(Pe.CANCEL),i.onCancel)i.onCancel()}if(c.closest(me.CONFIRM_BUTTON)){if(d.close(),s.events.emit(Pe.CONFIRM,d.getValue()),i.onConfirm)i.onConfirm(d.getValue())}if(c.closest(me.TOGGLE_TYPE_BUTTON)){let C=i.type==="dial"?"input":"dial";d.setType(C)}if(c.closest(me.PERIOD_AM)){if(r.period!=="AM"){if(r.period="AM",r.hours>=12)r.hours-=12;if(qe(n,r,i),s.events.emit(Pe.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}if(c.closest(me.PERIOD_PM)){if(r.period!=="PM"){if(r.period="PM",r.hours<12)r.hours+=12;if(qe(n,r,i),s.events.emit(Pe.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}if(c.closest(me.DIAL_CANVAS)){if(i.type==="dial"){let C=c,g=C.getBoundingClientRect(),m=f.clientX-g.left,p=f.clientY-g.top,h="hour",b=n.querySelector(me.HOURS_INPUT),v=n.querySelector(me.MINUTES_INPUT),E=n.querySelector(me.SECONDS_INPUT);if(b&&b.getAttribute("data-active")==="true")h="hour";else if(v&&v.getAttribute("data-active")==="true")h="minute";else if(i.showSeconds&&E&&E.getAttribute("data-active")==="true")h="second";let T=Fr(C,m,p,{type:i.type,format:i.format,showSeconds:i.showSeconds,prefix:i.prefix,activeSelector:h});if(T!==null){if(h==="hour"){let S=T;if(i.format==="12h"){if(r.period==="PM"&&T!==12)S+=12;else if(r.period==="AM"&&T===12)S=0}if(r.hours!==S){r.hours=S;let y=b;if(y)y.textContent=ae(i.format==="24h"?S:S%12||12);let L=n.querySelector(me.DIAL_CANVAS);if(L)De(L,r,{type:i.type,format:i.format,showSeconds:i.showSeconds,prefix:i.prefix,activeSelector:h});if(s.events.emit(Pe.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}else if(h==="minute"){if(r.minutes!==T){r.minutes=T;let S=v;if(S)S.textContent=ae(T);let y=n.querySelector(me.DIAL_CANVAS);if(y)De(y,r,{type:i.type,format:i.format,showSeconds:i.showSeconds,prefix:i.prefix,activeSelector:h});if(s.events.emit(Pe.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}else if(h==="second"&&i.showSeconds){if(r.seconds!==T){r.seconds=T;let S=E;if(S)S.textContent=ae(T);let y=n.querySelector(me.DIAL_CANVAS);if(y)De(y,r,{type:i.type,format:i.format,showSeconds:i.showSeconds,prefix:i.prefix,activeSelector:h});if(s.events.emit(Pe.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}}}}});let u=(f)=>{let c=f.target,C=c.getAttribute("data-type"),g=parseInt(c.value,10);if(isNaN(g))return;if(C==="hour"){let m=g;if(i.format==="12h"){if(g<1)m=12;if(g>12)m=1;if(r.period==="PM"&&m!==12)m+=12;else if(r.period==="AM"&&m===12)m=0}else{if(g<0)m=0;if(g>23)m=23}r.hours=m}else if(C==="minute"){let m=g;if(m<0)m=0;if(m>59)m=59;r.minutes=m}else if(C==="second"){let m=g;if(m<0)m=0;if(m>59)m=59;r.seconds=m}if(qe(n,r,i),s.events.emit(Pe.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())};return n.addEventListener("change",(f)=>{let c=f.target;if(c.matches(me.HOURS_INPUT)||c.matches(me.MINUTES_INPUT)||c.matches(me.SECONDS_INPUT))u(f)}),n.addEventListener("keyup",(f)=>{let c=f.target;if(c.matches(me.HOURS_INPUT)||c.matches(me.MINUTES_INPUT)||c.matches(me.SECONDS_INPUT)){if(f.key==="Enter"){if(u(f),c.matches(me.HOURS_INPUT)){let C=n.querySelector(me.MINUTES_INPUT);if(C)C.focus()}else if(c.matches(me.MINUTES_INPUT))if(i.showSeconds){let C=n.querySelector(me.SECONDS_INPUT);if(C)C.focus()}else{let C=n.querySelector(me.CONFIRM_BUTTON);if(C)C.focus()}else if(c.matches(me.SECONDS_INPUT)){let C=n.querySelector(me.CONFIRM_BUTTON);if(C)C.focus()}}}}),d};var kp=(e={})=>{let t=nm(e);try{let n=M(D,k(),O(rm(t)),P())(t),r=document.createElement("div");r.className=`${K}-time-picker-modal`,r.style.display="none",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%",r.style.backgroundColor="rgba(0, 0, 0, 0.4)",r.style.zIndex=Ys.MODAL.toString(),r.setAttribute("role","presentation");let i=document.createElement("div");i.className=[`${K}-time-picker-dialog`,`${K}-time-picker-dialog--${t.type}`,`${K}-time-picker-dialog--${t.orientation}`,`${K}-time-picker-dialog--${t.format}`].join(" "),i.style.position="absolute",i.style.top="50%",i.style.left="50%",i.style.transform="translate(-50%, -50%)",i.style.zIndex=Ys.DIALOG.toString(),r.appendChild(i),(typeof t.container==="string"?document.querySelector(t.container)||document.body:t.container||document.body).appendChild(r);let a;if(t.value)a=sm(t.value,t.format);else{let l=new Date;a={hours:l.getHours(),minutes:l.getMinutes(),seconds:t.showSeconds?l.getSeconds():0,period:l.getHours()>=12?"PM":"AM"}}qe(i,a,t);let o=dm(n,r,i,a,t,im(n));if(t.isOpen)setTimeout(()=>o.open(),0);return o}catch(n){throw console.error("TimePicker creation error:",n),Error(`Failed to create time picker: ${n.message}`)}},Xs=kp;se();ne();var Bp={SMALL:"small",MEDIUM:"medium",LARGE:"large",CENTER:"center"};var vn={TAG:"header",TYPE:Bp.SMALL,SCROLLABLE:!0,COMPRESSIBLE:!0,SCROLL_THRESHOLD:4};var Hp={tag:vn.TAG,type:vn.TYPE,scrollable:vn.SCROLLABLE,compressible:vn.COMPRESSIBLE,scrollThreshold:vn.SCROLL_THRESHOLD},um=(e={})=>_(Hp,e,"top-app-bar");var cm=(e={})=>{let t=um(e),n=D(t),r=()=>{let m=document.createElement("div");m.className=`${n.getClass("top-app-bar")}-leading`;let p=document.createElement("h1");if(p.className=`${n.getClass("top-app-bar")}-headline`,t.title)p.textContent=t.title;let h=document.createElement("div");return h.className=`${n.getClass("top-app-bar")}-trailing`,{leadingContainer:m,headlineElement:p,trailingContainer:h}},{leadingContainer:i,headlineElement:s,trailingContainer:a}=r(),o=()=>{let m=[t.class];if(t.type!=="small")m.push(`${n.getClass("top-app-bar")}--${t.type}`);if(t.compressible&&(t.type==="medium"||t.type==="large"))m.push(`${n.getClass("top-app-bar")}--compressible`);return m.filter(Boolean)},l=O({tag:t.tag,componentName:"top-app-bar",className:o(),attributes:{role:"banner","aria-label":"Top app bar"},interactive:!0})(n),d=k()(l),u=P()(d);(()=>{if(t.type==="medium"||t.type==="large"){let m=document.createElement("div");m.className=`${n.getClass("top-app-bar")}-row`,m.appendChild(i),m.appendChild(a);let p=document.createElement("div");p.className=`${n.getClass("top-app-bar")}-row`,p.appendChild(s),u.element.appendChild(m),u.element.appendChild(p)}else u.element.appendChild(i),u.element.appendChild(s),u.element.appendChild(a)})();let c=!1;if(t.scrollable){let m=()=>{let h=window.scrollY>t.scrollThreshold;if(c!==h){if(c=h,c)u.element.classList.add(`${n.getClass("top-app-bar")}--scrolled`);else u.element.classList.remove(`${n.getClass("top-app-bar")}--scrolled`);t.onScroll?.(c)}};window.addEventListener("scroll",m,{passive:!0}),m();let p=u.lifecycle.destroy;u.lifecycle.destroy=()=>{window.removeEventListener("scroll",m),p()}}let C=(m)=>{while(u.element.firstChild)u.element.removeChild(u.element.firstChild);if(["small","medium","large","center"].forEach((p)=>{u.element.classList.remove(`${n.getClass("top-app-bar")}--${p}`)}),m!=="small")u.element.classList.add(`${n.getClass("top-app-bar")}--${m}`);if(u.element.classList.toggle(`${n.getClass("top-app-bar")}--compressible`,t.compressible&&(m==="medium"||m==="large")),m==="medium"||m==="large"){let p=document.createElement("div");p.className=`${n.getClass("top-app-bar")}-row`,p.appendChild(i),p.appendChild(a);let h=document.createElement("div");h.className=`${n.getClass("top-app-bar")}-row`,h.appendChild(s),u.element.appendChild(p),u.element.appendChild(h)}else u.element.appendChild(i),u.element.appendChild(s),u.element.appendChild(a)};return{...u,setTitle(m){return s.textContent=m,this},getTitle(){return s.textContent||""},addLeadingElement(m){return i.appendChild(m),this},addTrailingElement(m){return a.appendChild(m),this},setType(m){return t.type=m,C(m),this},setScrollState(m){if(c=m,m)this.element.classList.add(`${n.getClass("top-app-bar")}--scrolled`);else this.element.classList.remove(`${n.getClass("top-app-bar")}--scrolled`);return this},getHeadlineElement(){return s},getLeadingContainer(){return i},getTrailingContainer(){return a}}};var mm=cm;nt();se();te();re();var Me={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 fm=8;var gm=({lifecycle:e})=>(t)=>{let n=null,r=Me.BOTTOM,i=!1,s=null,a=null,o=300,l=100,d=!0,u=!0,f=document.createElement("div");f.className=`${t.getClass("tooltip")}__arrow`,t.element.appendChild(f),document.body.appendChild(t.element),t.element.setAttribute("aria-hidden","true");let c=()=>{if(!n)return{top:0,left:0};let S=t.element.getBoundingClientRect(),y=n.getBoundingClientRect(),L=window.scrollY||window.pageYOffset,I=window.scrollX||window.pageXOffset,x=fm,A=0,N=0,R;switch(r){case Me.TOP:A=y.top+L-S.height-x,N=y.left+I+y.width/2-S.width/2,R="bottom";break;case Me.TOP_START:A=y.top+L-S.height-x,N=y.left+I,R="bottom-start";break;case Me.TOP_END:A=y.top+L-S.height-x,N=y.left+I+y.width-S.width,R="bottom-end";break;case Me.RIGHT:A=y.top+L+y.height/2-S.height/2,N=y.left+I+y.width+x,R="left";break;case Me.RIGHT_START:A=y.top+L,N=y.left+I+y.width+x,R="left-start";break;case Me.RIGHT_END:A=y.top+L+y.height-S.height,N=y.left+I+y.width+x,R="left-end";break;case Me.BOTTOM:A=y.top+L+y.height+x,N=y.left+I+y.width/2-S.width/2,R="top";break;case Me.BOTTOM_START:A=y.top+L+y.height+x,N=y.left+I,R="top-start";break;case Me.BOTTOM_END:A=y.top+L+y.height+x,N=y.left+I+y.width-S.width,R="top-end";break;case Me.LEFT:A=y.top+L+y.height/2-S.height/2,N=y.left+I-S.width-x,R="right";break;case Me.LEFT_START:A=y.top+L,N=y.left+I-S.width-x,R="right-start";break;case Me.LEFT_END:A=y.top+L+y.height-S.height,N=y.left+I-S.width-x,R="right-end";break;default:A=y.top+L+y.height+x,N=y.left+I+y.width/2-S.width/2,R="top"}let U=window.innerWidth;if(N<0)N=0;else if(N+S.width>U)N=U-S.width;return{top:A,left:N,arrowPosition:R}},C=(S)=>{if(u)S.addEventListener("mouseenter",m),S.addEventListener("mouseleave",p);if(d)S.addEventListener("focus",h),S.addEventListener("blur",b)},g=(S)=>{if(S)S.removeEventListener("mouseenter",m),S.removeEventListener("mouseleave",p),S.removeEventListener("focus",h),S.removeEventListener("blur",b)},m=()=>v.show(),p=()=>v.hide(),h=()=>v.show(),b=()=>v.hide(),v={element:t.element,target:n,lifecycle:e,getClass:t.getClass,setText(S){let y=document.createTextNode(S);while(t.element.firstChild!==f)t.element.removeChild(t.element.firstChild);if(t.element.insertBefore(y,f),i)this.updatePosition();return this},getText(){let S=t.element.cloneNode(!0),y=S.querySelector(`.${t.getClass("tooltip")}__arrow`);if(y)y.remove();return S.textContent||""},setPosition(S){r=S;let y=t.getClass("tooltip"),L=Object.values(Me).map((I)=>`${y}--${I}`);if(t.element.classList.remove(...L),t.element.classList.add(`${y}--${S}`),i)this.updatePosition();return this},getPosition(){return r},setTarget(S){if(n)g(n);if(n=S,this.target=S,n.setAttribute("aria-describedby",t.element.id),C(n),i)this.updatePosition();return this},show(S=!1){if(s!==null)window.clearTimeout(s),s=null;if(a!==null)window.clearTimeout(a),a=null;let y=()=>{if(!n)return this;t.element.setAttribute("aria-hidden","false"),t.element.classList.add(`${t.getClass("tooltip")}--visible`),i=!0,this.updatePosition(),window.addEventListener("resize",E),window.addEventListener("scroll",T)};if(S)y();else s=window.setTimeout(y,o);return this},hide(S=!1){if(a!==null)window.clearTimeout(a),a=null;if(s!==null)window.clearTimeout(s),s=null;let y=()=>{t.element.setAttribute("aria-hidden","true"),t.element.classList.remove(`${t.getClass("tooltip")}--visible`),i=!1,window.removeEventListener("resize",E),window.removeEventListener("scroll",T)};if(S)y();else a=window.setTimeout(y,l);return this},isVisible(){return i},updatePosition(){if(!n)return this;let{top:S,left:y,arrowPosition:L}=c();if(t.element.style.top=`${Math.round(S)}px`,t.element.style.left=`${Math.round(y)}px`,L)f.className=`${t.getClass("tooltip")}__arrow`,f.classList.add(`${t.getClass("tooltip")}__arrow--${L}`);return this},destroy(){if(s!==null)window.clearTimeout(s);if(a!==null)window.clearTimeout(a);if(n)g(n),n.removeAttribute("aria-describedby");if(window.removeEventListener("resize",E),window.removeEventListener("scroll",T),t.element.parentNode)t.element.parentNode.removeChild(t.element);e.destroy()}},E=()=>{v.updatePosition()},T=()=>{v.updatePosition()};return v};ne();var $p={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"},Vp={DEFAULT:"default",RICH:"rich",PLAIN:"plain"};var ft={POSITION:$p.BOTTOM,VARIANT:Vp.DEFAULT,VISIBLE:!1,SHOW_DELAY:300,HIDE_DELAY:100,OFFSET:8,ARROW_SIZE:8,SHOW_ON_FOCUS:!0,SHOW_ON_HOVER:!0,RICH:!1};var Fp={position:ft.POSITION,variant:ft.VARIANT,visible:ft.VISIBLE,showDelay:ft.SHOW_DELAY,hideDelay:ft.HIDE_DELAY,showOnFocus:ft.SHOW_ON_FOCUS,showOnHover:ft.SHOW_ON_HOVER,rich:ft.RICH},pm=(e={})=>_(Fp,e,"tooltip"),hm=(e)=>{let t={role:"tooltip","aria-hidden":"true"};if(e.zIndex!==void 0)t.style=`z-index: ${e.zIndex};`;return V(e,{tag:"div",attributes:t,className:[e.class,`${e.prefix}-tooltip--${e.position}`,`${e.prefix}-tooltip--${e.variant}`],text:e.text||""})},Cm=(e)=>({lifecycle:{destroy:()=>e.lifecycle.destroy()}});var Up=()=>`${K}-tooltip-${Math.random().toString(36).substring(2,9)}`,Gp=(e={})=>{let t=pm(e);try{let n=M(D,O(hm(t)),P(),(r)=>gm(Cm(r))(r))(t);if(n.element.id=Up(),t.target)n.setTarget(t.target);if(t.text)n.setText(t.text);if(t.visible)n.show(!0);return n}catch(n){throw console.error("Tooltip creation error:",n),Error(`Failed to create tooltip: ${n.message}`)}},qs=Gp;tn();tn();
|
|
55
|
+
</svg>`},At={TYPE:Lp.DIAL,FORMAT:wp.AMPM,ORIENTATION:Ap.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:st.CLOCK,KEYBOARD_ICON:st.KEYBOARD};var Np={type:"dial",format:"12h",orientation:"vertical",showSeconds:At.SHOW_SECONDS,closeOnSelect:At.CLOSE_ON_SELECT,minuteStep:At.MINUTE_STEP,secondStep:At.SECOND_STEP,cancelText:At.CANCEL_TEXT,confirmText:At.CONFIRM_TEXT,isOpen:At.IS_OPEN,clockIcon:st.CLOCK,keyboardIcon:st.KEYBOARD},Jc=(e={})=>_(Np,e,"time-picker"),em=(e)=>V(e,{tag:"div",attributes:{role:"dialog","aria-modal":"true","aria-labelledby":`${e.prefix}-time-picker-title`},className:[e.class,e.isOpen?`${e.prefix}-time-picker--open`:""],forwardEvents:{click:!0,keydown:!0},interactive:!0});var tm=(e)=>({events:{on:(t,n)=>e.on(t,n),off:(t,n)=>e.off(t,n),emit:(t,n)=>e.emit(t,n)},lifecycle:{destroy:()=>e.lifecycle.destroy()}});var ae=(e)=>e.toString().padStart(2,"0"),nm=(e,t)=>{try{let n=e.split(":"),r=parseInt(n[0],10),i=parseInt(n[1],10),s=n[2]?parseInt(n[2],10):0;if(isNaN(r)||r<0||r>23||isNaN(i)||i<0||i>59||isNaN(s)||s<0||s>59)throw Error("Invalid time format");let a=r>=12?"PM":"AM";return{hours:r,minutes:i,seconds:s,period:a}}catch(n){console.error("Error parsing time:",n);let r=new Date,i=r.getHours(),s=r.getMinutes(),a=r.getSeconds(),o=i>=12?"PM":"AM";return{hours:i,minutes:s,seconds:a,period:o}}},rm=(e,t)=>{let{hours:n,minutes:r,seconds:i}=e;if(t){if(i!==void 0)return`${ae(n)}:${ae(r)}:${ae(i)}`;return`${ae(n)}:${ae(r)}`}else{let s=n%12;if(s===0)s=12;if(i!==void 0)return`${ae(s)}:${ae(r)}:${ae(i)} ${e.period}`;return`${ae(s)}:${ae(r)} ${e.period}`}};var im=(e)=>{let t=e>=12?"PM":"AM",n=e%12;if(n===0)n=12;return{hours:n,period:t}};var fe={...Xt,KNOB_SIZE:45,CENTER_SIZE:8,NUMBER_SIZE:24,INNER_RADIUS:75,OUTER_RADIUS:100,TRACK_WIDTH:1.5,HAND_WIDTH:2};function Dp(e){let t=document.documentElement,n=getComputedStyle(t),r=n.getPropertyValue(`--${e}-sys-color-primary`).trim()||"#6750A4",i=n.getPropertyValue(`--${e}-sys-color-on-primary`).trim()||"#FFFFFF",s=n.getPropertyValue(`--${e}-sys-color-on-surface`).trim()||"#1C1B1F",a=n.getPropertyValue(`--${e}-sys-color-primary-rgb`).trim()||"103, 80, 164",l=`rgba(${n.getPropertyValue(`--${e}-sys-color-on-surface-rgb`).trim()||"28, 27, 31"}, 0.05)`,d=`rgba(${a}, 0.1)`;return{primaryColor:r,onPrimaryColor:i,onSurfaceColor:s,bgColor:l,selectedBgColor:d}}var De=(e,t,n)=>{let r=e.getContext("2d");if(!r){console.error("Could not get canvas context");return}let i=Dp(n.prefix),s=window.devicePixelRatio||1;e.width=fe.DIAMETER*s,e.height=fe.DIAMETER*s,r.scale(s,s);let a=fe.DIAMETER/2,o=fe.DIAMETER/2,l=fe.DIAMETER/2;if(r.clearRect(0,0,e.width,e.height),r.beginPath(),r.arc(a,o,l-2,0,2*Math.PI),r.fillStyle=i.bgColor,r.fill(),r.beginPath(),r.arc(a,o,fe.CENTER_SIZE/2,0,2*Math.PI),r.fillStyle=i.primaryColor,r.fill(),n.activeSelector==="hour")if(n.format==="24h")Op(r,a,o,l,t.hours,i);else Mp(r,a,o,l,t.hours%12||12,i);else if(n.activeSelector==="minute")sm(r,a,o,l,t.minutes,i);else if(n.activeSelector==="second"&&n.showSeconds)sm(r,a,o,l,t.seconds||0,i);Rp(r,a,o,t,n,i)},Mp=(e,t,n,r,i,s)=>{let a=fe.OUTER_RADIUS;for(let o=1;o<=12;o++){let l=o/6*Math.PI-Math.PI/2,d=t+a*Math.cos(l),u=n+a*Math.sin(l),f=o===i;if(f)e.beginPath(),e.arc(d,u,fe.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill();e.font="16px Roboto, Arial, sans-serif",e.fillStyle=f?s.primaryColor:s.onSurfaceColor,e.textAlign="center",e.textBaseline="middle",e.fillText(o.toString(),d,u+2)}},Op=(e,t,n,r,i,s)=>{let a=fe.OUTER_RADIUS;for(let l=1;l<=12;l++){let d=l/6*Math.PI-Math.PI/2,u=t+a*Math.cos(d),f=n+a*Math.sin(d),c=l===i;if(c)e.beginPath(),e.arc(u,f,fe.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill();e.font="16px Roboto, Arial, sans-serif",e.fillStyle=c?s.primaryColor:s.onSurfaceColor,e.textAlign="center",e.textBaseline="middle",e.fillText(l.toString(),u,f+2)}let o=fe.INNER_RADIUS;for(let l=13;l<=24;l++){let d=l===24?0:l,u=(l-12)/6*Math.PI-Math.PI/2,f=t+o*Math.cos(u),c=n+o*Math.sin(u),C=d===i;if(C)e.beginPath(),e.arc(f,c,fe.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill();e.font="14px Roboto, Arial, sans-serif",e.fillStyle=C?s.primaryColor:s.onSurfaceColor,e.textAlign="center",e.textBaseline="middle",e.fillText(ae(d),f,c+2)}},sm=(e,t,n,r,i,s)=>{let a=fe.OUTER_RADIUS;for(let o=0;o<60;o+=5){let l=o/30*Math.PI-Math.PI/2,d=t+a*Math.cos(l),u=n+a*Math.sin(l),f=o===i;if(f)e.beginPath(),e.arc(d,u,fe.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill();e.font="16px Roboto, Arial, sans-serif",e.fillStyle=f?s.primaryColor:s.onSurfaceColor,e.textAlign="center",e.textBaseline="middle",e.fillText(ae(o),d,u)}if(i%5!==0){let o=i/30*Math.PI-Math.PI/2,l=t+a*Math.cos(o),d=n+a*Math.sin(o);e.beginPath(),e.arc(l,d,fe.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill(),e.font="16px Roboto, Arial, sans-serif",e.fillStyle=s.primaryColor,e.textAlign="center",e.textBaseline="middle",e.fillText(ae(i),l,d)}},Rp=(e,t,n,r,i,s)=>{let a,o;if(i.activeSelector==="hour")if(i.format==="24h")if(r.hours>=12)a=(r.hours%12||12)/6*Math.PI-Math.PI/2,o=fe.INNER_RADIUS;else{let f=r.hours;if(f===0)f=12;a=f/6*Math.PI-Math.PI/2,o=fe.OUTER_RADIUS}else a=(r.hours%12||12)/6*Math.PI-Math.PI/2,o=fe.OUTER_RADIUS;else if(i.activeSelector==="minute")a=r.minutes/30*Math.PI-Math.PI/2,o=fe.OUTER_RADIUS;else if(i.activeSelector==="second")a=(r.seconds||0)/30*Math.PI-Math.PI/2,o=fe.OUTER_RADIUS;else return;e.beginPath(),e.moveTo(t,n),e.lineTo(t+o*Math.cos(a),n+o*Math.sin(a)),e.lineWidth=fe.HAND_WIDTH,e.strokeStyle=s.primaryColor,e.stroke();let l=t+o*Math.cos(a),d=n+o*Math.sin(a);e.beginPath(),e.arc(l,d,fe.KNOB_SIZE/2,0,2*Math.PI),e.fillStyle=s.primaryColor,e.fill(),e.font="16px Roboto, Arial, sans-serif",e.fillStyle=s.onPrimaryColor,e.textAlign="center",e.textBaseline="middle";let u="";if(i.activeSelector==="hour")if(i.format==="24h")u=ae(r.hours);else u=String(r.hours%12||12);else if(i.activeSelector==="minute")u=ae(r.minutes);else if(i.activeSelector==="second")u=ae(r.seconds||0);e.fillText(u,l,d)},Fr=(e,t,n,r)=>{let i=fe.DIAMETER/2,s=fe.DIAMETER/2,a=t-i,o=n-s,l=Math.sqrt(a*a+o*o),d=Math.atan2(o,a)+Math.PI/2;if(d<0)d+=2*Math.PI;if(r.activeSelector==="hour")if(r.format==="24h"){let u=(fe.INNER_RADIUS+fe.OUTER_RADIUS)/2,f=l<u,c=Math.round(d/(Math.PI/6))%12;if(f&&c!==0)c+=12;else if(!f&&c===0)c=12;else if(f&&c===0)c=0;return c}else{let u=Math.round(d/(Math.PI/6))%12;if(u===0)u=12;return u}else if(r.activeSelector==="minute"||r.activeSelector==="second")return Math.round(d/(Math.PI/30))%60;return null};var qe=(e,t,n,r)=>{if(e.innerHTML="",n.title){let y=document.createElement("div");y.className=`${n.prefix}-time-picker-title`,y.textContent=n.title,y.id=`${n.prefix}-time-picker-title`,e.appendChild(y)}let i=document.createElement("div");i.className=`${n.prefix}-time-picker-content`,e.appendChild(i);let s=document.createElement("div");s.className=`${n.prefix}-time-picker-input-container`,i.appendChild(s);let{hours:a}=n.format==="24h"?{hours:t.hours}:im(t.hours),o=document.createElement("div");o.className=`${n.prefix}-time-picker-time-input-field`;let l=document.createElement("input");l.type="number",l.className=`${n.prefix}-time-picker-hours`,l.min=n.format==="24h"?"0":"1",l.max=n.format==="24h"?"23":"12",l.value=ae(a),l.setAttribute("data-type","hour"),l.setAttribute("inputmode","numeric"),l.setAttribute("pattern","[0-9]*"),o.appendChild(l),s.appendChild(o);let d=document.createElement("div");d.className=`${n.prefix}-time-picker-separator`,d.textContent=":",s.appendChild(d);let u=document.createElement("div");u.className=`${n.prefix}-time-picker-time-input-field`;let f=document.createElement("input");f.type="number",f.className=`${n.prefix}-time-picker-minutes`,f.min="0",f.max="59",f.value=ae(t.minutes),f.setAttribute("data-type","minute"),f.setAttribute("inputmode","numeric"),f.setAttribute("pattern","[0-9]*"),u.appendChild(f),s.appendChild(u);let c;if(n.showSeconds){let y=document.createElement("div");y.className=`${n.prefix}-time-picker-separator`,y.textContent=":",s.appendChild(y);let L=document.createElement("div");L.className=`${n.prefix}-time-picker-time-input-field`,c=document.createElement("input"),c.type="number",c.className=`${n.prefix}-time-picker-seconds`,c.min="0",c.max="59",c.value=ae(t.seconds||0),c.setAttribute("data-type","second"),c.setAttribute("inputmode","numeric"),c.setAttribute("pattern","[0-9]*");let I=document.createElement("label");I.className=`${n.prefix}-time-picker-input-label`,I.textContent="Second",L.appendChild(c),L.appendChild(I),s.appendChild(L)}if(n.format==="12h"){let y=document.createElement("div");y.className=`${n.prefix}-time-picker-period`;let L=document.createElement("div");L.className=`${n.prefix}-time-picker-period-am ${t.period==="AM"?`${n.prefix}-time-picker-period--selected`:""}`,L.textContent="AM",L.setAttribute("role","button"),L.setAttribute("tabindex","0"),L.setAttribute("aria-pressed",t.period==="AM"?"true":"false");let I=document.createElement("div");I.className=`${n.prefix}-time-picker-period-pm ${t.period==="PM"?`${n.prefix}-time-picker-period--selected`:""}`,I.textContent="PM",I.setAttribute("role","button"),I.setAttribute("tabindex","0"),I.setAttribute("aria-pressed",t.period==="PM"?"true":"false"),y.appendChild(L),y.appendChild(I),s.appendChild(y)}let C=document.createElement("div");C.className=`${n.prefix}-time-picker-dial`,C.style.display=n.type==="dial"?"block":"none",i.appendChild(C);let g=document.createElement("canvas");g.className=`${n.prefix}-time-picker-dial-canvas`,g.width=Xt.DIAMETER,g.height=Xt.DIAMETER,g.style.width=`${Xt.DIAMETER}px`,g.style.height=`${Xt.DIAMETER}px`,C.appendChild(g);let m=document.createElement("div");m.className=`${n.prefix}-time-picker-actions`,e.appendChild(m);let p=document.createElement("button");p.className=`${n.prefix}-time-picker-toggle-type`,p.setAttribute("aria-label",n.type==="dial"?"Switch to keyboard input":"Switch to dial selector"),p.innerHTML=n.type==="dial"?n.keyboardIcon||st.KEYBOARD:n.clockIcon||st.CLOCK,m.appendChild(p);let h=document.createElement("div");h.className=`${n.prefix}-time-picker-action-buttons`,m.appendChild(h);let b=document.createElement("button");b.className=`${n.prefix}-time-picker-cancel`,b.textContent=n.cancelText||"Cancel",b.setAttribute("type","button"),h.appendChild(b);let v=document.createElement("button");v.className=`${n.prefix}-time-picker-confirm`,v.textContent=n.confirmText||"OK",v.setAttribute("type","button"),h.appendChild(v);let E="hour";if(n.type==="dial")setTimeout(()=>{De(g,t,{type:n.type,format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})},0);p.addEventListener("click",()=>{if(C.style.display==="none")C.style.display="block",p.innerHTML=n.keyboardIcon||st.KEYBOARD,p.setAttribute("aria-label","Switch to keyboard input"),setTimeout(()=>{g.focus(),document.querySelectorAll(`.${n.prefix}-time-picker-hours`).forEach((x)=>x.setAttribute("data-active","true")),document.querySelectorAll(`.${n.prefix}-time-picker-minutes`).forEach((x)=>x.setAttribute("data-active","false")),document.querySelectorAll(`.${n.prefix}-time-picker-seconds`).forEach((x)=>x.setAttribute("data-active","false")),De(g,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:"hour"})},50);else C.style.display="none",p.innerHTML=n.clockIcon||st.CLOCK,p.setAttribute("aria-label","Switch to dial selector"),setTimeout(()=>{l.focus(),l.select()},50)});let T=(y)=>{let L=y.target,I=L.getAttribute("data-type"),x=L.value;if(x==="")return;let A=parseInt(x,10);if(isNaN(A))return;if(I==="hour"){let N=A;if(n.format==="12h"){if(A<0)N=1;if(A>12)N=12;if(t.period==="PM"&&N!==12)N+=12;else if(t.period==="AM"&&N===12)N=0}else{if(A<0)N=0;if(A>23)N=23}if(t.hours=N,E="hour",l.setAttribute("data-active","true"),f.setAttribute("data-active","false"),c)c.setAttribute("data-active","false");if(De(g,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E}),r)r("hours",N)}else if(I==="minute"){let N=A;if(A<0)N=0;if(A>59)N=59;if(t.minutes=N,E="minute",l.setAttribute("data-active","false"),f.setAttribute("data-active","true"),c)c.setAttribute("data-active","false");if(De(g,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E}),r)r("minutes",N)}else if(I==="second"){let N=A;if(A<0)N=0;if(A>59)N=59;if(t.seconds=N,E="second",l.setAttribute("data-active","false"),f.setAttribute("data-active","false"),c)c.setAttribute("data-active","true");if(De(g,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E}),r)r("seconds",N)}};if(l.addEventListener("input",T),f.addEventListener("input",T),c)c.addEventListener("input",T);if(l.addEventListener("keyup",(y)=>{if(y.key==="Enter")f.focus(),f.select()}),f.addEventListener("keyup",(y)=>{if(y.key==="Enter")if(n.showSeconds&&c)c.focus(),c.select();else v.focus()}),c)c.addEventListener("keyup",(y)=>{if(y.key==="Enter")v.focus()});let S=(y)=>{if(t.period!==y){let L=t.period;if(t.period=y,L==="AM"&&y==="PM"){if(t.hours<12)t.hours+=12}else if(L==="PM"&&y==="AM"){if(t.hours>=12)t.hours-=12}if(n.format==="12h"){let x=t.hours===0?12:t.hours>12?t.hours-12:t.hours;l.value=ae(x)}document.querySelectorAll(`.${n.prefix}-time-picker-period-am, .${n.prefix}-time-picker-period-pm`).forEach((x)=>{x.classList.remove(`${n.prefix}-time-picker-period--selected`),x.setAttribute("aria-pressed","false")});let I=document.querySelector(`.${n.prefix}-time-picker-period-${y.toLowerCase()}`);if(I)I.classList.add(`${n.prefix}-time-picker-period--selected`),I.setAttribute("aria-pressed","true");if(C.style.display==="block")De(g,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E});if(r)r("hours",t.hours)}};if(n.format==="12h"){let y=document.querySelector(`.${n.prefix}-time-picker-period-am`),L=document.querySelector(`.${n.prefix}-time-picker-period-pm`);if(y)y.addEventListener("click",()=>{S("AM")});if(L)L.addEventListener("click",()=>{S("PM")})}if(n.type==="dial"||C.style.display==="block"){if(g.addEventListener("click",(y)=>{let L=g.getBoundingClientRect(),I=y.clientX-L.left,x=y.clientY-L.top,A=Fr(g,I,x,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E});if(A!==null){if(E==="hour"){let N=A;if(n.format==="12h"){if(t.period==="PM"&&A!==12)N+=12;else if(t.period==="AM"&&A===12)N=0}if(t.hours=N,n.format==="12h"){let R=N===0?12:N>12?N-12:N;l.value=ae(R)}else l.value=ae(N);if(r)r("hours",N)}else if(E==="minute"){if(t.minutes=A,f.value=ae(A),r)r("minutes",A)}else if(E==="second"&&c){if(t.seconds=A,c.value=ae(A),r)r("seconds",A)}De(g,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})}}),l.addEventListener("click",()=>{if(C.style.display==="block"){if(E="hour",l.setAttribute("data-active","true"),f.setAttribute("data-active","false"),c)c.setAttribute("data-active","false");De(g,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})}}),f.addEventListener("click",()=>{if(C.style.display==="block"){if(E="minute",l.setAttribute("data-active","false"),f.setAttribute("data-active","true"),c)c.setAttribute("data-active","false");De(g,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})}}),c)c.addEventListener("click",()=>{if(C.style.display==="block")E="second",l.setAttribute("data-active","false"),f.setAttribute("data-active","false"),c.setAttribute("data-active","true"),De(g,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})})}};var am=(e,t,n,r,i,s)=>{let a=!!i.isOpen,o=(f)=>{if(f.key==="Escape")d.close(),s.events.emit(Pe.CANCEL)},l=(f)=>{if(f.target===t)d.close()},d={element:e.element,modalElement:t,dialogElement:n,isOpen:a,open(){if(a)return this;if(t.style.display="block",t.offsetWidth,t.classList.add("active"),n.classList.add("active"),document.addEventListener("keydown",o),t.addEventListener("click",l),a=!0,e.element.classList.add(`${i.prefix}-time-picker--open`),setTimeout(()=>{qe(n,r,i)},50),s.events.emit(Pe.OPEN),i.onOpen)i.onOpen();return this},close(){if(!a)return this;if(t.classList.remove("active"),n.classList.remove("active"),setTimeout(()=>{t.style.display="none"},300),document.removeEventListener("keydown",o),t.removeEventListener("click",l),a=!1,e.element.classList.remove(`${i.prefix}-time-picker--open`),s.events.emit(Pe.CLOSE),i.onClose)i.onClose();return this},toggle(){return a?this.close():this.open()},getValue(){return rm(r,i.format==="24h")},getTimeObject(){return{...r}},setValue(f){try{let c=f.split(":"),C=parseInt(c[0],10),g=parseInt(c[1],10),m=c[2]?parseInt(c[2],10):0;if(isNaN(C)||C<0||C>23||isNaN(g)||g<0||g>59||isNaN(m)||m<0||m>59)throw Error("Invalid time format. Use HH:MM or HH:MM:SS (24-hour format).");if(r.hours=C,r.minutes=g,r.seconds=m,r.period=C>=12?"PM":"AM",qe(n,r,i),s.events.emit(Pe.CHANGE,this.getValue()),i.onChange)i.onChange(this.getValue())}catch(c){console.error("Error setting time value:",c)}return this},setType(f){if(i.type===f)return this;return i.type=f,n.classList.remove(`${i.prefix}-time-picker-dialog--${"dial"}`,`${i.prefix}-time-picker-dialog--${"input"}`),n.classList.add(`${i.prefix}-time-picker-dialog--${f}`),qe(n,r,i),this},getType(){return i.type},setFormat(f){if(i.format===f)return this;if(i.format=f,n.classList.remove(`${i.prefix}-time-picker-dialog--${"12h"}`,`${i.prefix}-time-picker-dialog--${"24h"}`),n.classList.add(`${i.prefix}-time-picker-dialog--${f}`),f==="24h")r.period=r.hours>=12?"PM":"AM";else r.period=r.hours>=12?"PM":"AM";return qe(n,r,i),s.events.emit(Pe.CHANGE,this.getValue()),this},getFormat(){return i.format},setOrientation(f){if(i.orientation===f)return this;return i.orientation=f,n.classList.remove(`${i.prefix}-time-picker-dialog--${"vertical"}`,`${i.prefix}-time-picker-dialog--${"horizontal"}`),n.classList.add(`${i.prefix}-time-picker-dialog--${f}`),qe(n,r,i),this},getOrientation(){return i.orientation},setTitle(f){i.title=f;let c=n.querySelector(ce.TITLE);if(c)c.textContent=f;else qe(n,r,i);return this},getTitle(){return i.title||""},destroy(){if(a)this.close();if(t&&t.parentNode)t.parentNode.removeChild(t);s.lifecycle.destroy()},on(f,c){return s.events.on(f,c),this},off(f,c){return s.events.off(f,c),this}};n.addEventListener("click",(f)=>{let c=f.target;if(c.closest(ce.CANCEL_BUTTON)){if(d.close(),s.events.emit(Pe.CANCEL),i.onCancel)i.onCancel()}if(c.closest(ce.CONFIRM_BUTTON)){if(d.close(),s.events.emit(Pe.CONFIRM,d.getValue()),i.onConfirm)i.onConfirm(d.getValue())}if(c.closest(ce.TOGGLE_TYPE_BUTTON)){let C=i.type==="dial"?"input":"dial";d.setType(C)}if(c.closest(ce.PERIOD_AM)){if(r.period!=="AM"){if(r.period="AM",r.hours>=12)r.hours-=12;if(qe(n,r,i),s.events.emit(Pe.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}if(c.closest(ce.PERIOD_PM)){if(r.period!=="PM"){if(r.period="PM",r.hours<12)r.hours+=12;if(qe(n,r,i),s.events.emit(Pe.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}if(c.closest(ce.DIAL_CANVAS)){if(i.type==="dial"){let C=c,g=C.getBoundingClientRect(),m=f.clientX-g.left,p=f.clientY-g.top,h="hour",b=n.querySelector(ce.HOURS_INPUT),v=n.querySelector(ce.MINUTES_INPUT),E=n.querySelector(ce.SECONDS_INPUT);if(b&&b.getAttribute("data-active")==="true")h="hour";else if(v&&v.getAttribute("data-active")==="true")h="minute";else if(i.showSeconds&&E&&E.getAttribute("data-active")==="true")h="second";let T=Fr(C,m,p,{type:i.type,format:i.format,showSeconds:i.showSeconds,prefix:i.prefix,activeSelector:h});if(T!==null){if(h==="hour"){let S=T;if(i.format==="12h"){if(r.period==="PM"&&T!==12)S+=12;else if(r.period==="AM"&&T===12)S=0}if(r.hours!==S){r.hours=S;let y=b;if(y)y.textContent=ae(i.format==="24h"?S:S%12||12);let L=n.querySelector(ce.DIAL_CANVAS);if(L)De(L,r,{type:i.type,format:i.format,showSeconds:i.showSeconds,prefix:i.prefix,activeSelector:h});if(s.events.emit(Pe.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}else if(h==="minute"){if(r.minutes!==T){r.minutes=T;let S=v;if(S)S.textContent=ae(T);let y=n.querySelector(ce.DIAL_CANVAS);if(y)De(y,r,{type:i.type,format:i.format,showSeconds:i.showSeconds,prefix:i.prefix,activeSelector:h});if(s.events.emit(Pe.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}else if(h==="second"&&i.showSeconds){if(r.seconds!==T){r.seconds=T;let S=E;if(S)S.textContent=ae(T);let y=n.querySelector(ce.DIAL_CANVAS);if(y)De(y,r,{type:i.type,format:i.format,showSeconds:i.showSeconds,prefix:i.prefix,activeSelector:h});if(s.events.emit(Pe.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}}}}});let u=(f)=>{let c=f.target,C=c.getAttribute("data-type"),g=parseInt(c.value,10);if(isNaN(g))return;if(C==="hour"){let m=g;if(i.format==="12h"){if(g<1)m=12;if(g>12)m=1;if(r.period==="PM"&&m!==12)m+=12;else if(r.period==="AM"&&m===12)m=0}else{if(g<0)m=0;if(g>23)m=23}r.hours=m}else if(C==="minute"){let m=g;if(m<0)m=0;if(m>59)m=59;r.minutes=m}else if(C==="second"){let m=g;if(m<0)m=0;if(m>59)m=59;r.seconds=m}if(qe(n,r,i),s.events.emit(Pe.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())};return n.addEventListener("change",(f)=>{let c=f.target;if(c.matches(ce.HOURS_INPUT)||c.matches(ce.MINUTES_INPUT)||c.matches(ce.SECONDS_INPUT))u(f)}),n.addEventListener("keyup",(f)=>{let c=f.target;if(c.matches(ce.HOURS_INPUT)||c.matches(ce.MINUTES_INPUT)||c.matches(ce.SECONDS_INPUT)){if(f.key==="Enter"){if(u(f),c.matches(ce.HOURS_INPUT)){let C=n.querySelector(ce.MINUTES_INPUT);if(C)C.focus()}else if(c.matches(ce.MINUTES_INPUT))if(i.showSeconds){let C=n.querySelector(ce.SECONDS_INPUT);if(C)C.focus()}else{let C=n.querySelector(ce.CONFIRM_BUTTON);if(C)C.focus()}else if(c.matches(ce.SECONDS_INPUT)){let C=n.querySelector(ce.CONFIRM_BUTTON);if(C)C.focus()}}}}),d};var _p=(e={})=>{let t=Jc(e);try{let n=M(D,k(),O(em(t)),P())(t),r=document.createElement("div");r.className=`${K}-time-picker-modal`,r.style.display="none",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%",r.style.backgroundColor="rgba(0, 0, 0, 0.4)",r.style.zIndex=Ys.MODAL.toString(),r.setAttribute("role","presentation");let i=document.createElement("div");i.className=[`${K}-time-picker-dialog`,`${K}-time-picker-dialog--${t.type}`,`${K}-time-picker-dialog--${t.orientation}`,`${K}-time-picker-dialog--${t.format}`].join(" "),i.style.position="absolute",i.style.top="50%",i.style.left="50%",i.style.transform="translate(-50%, -50%)",i.style.zIndex=Ys.DIALOG.toString(),r.appendChild(i),(typeof t.container==="string"?document.querySelector(t.container)||document.body:t.container||document.body).appendChild(r);let a;if(t.value)a=nm(t.value,t.format);else{let l=new Date;a={hours:l.getHours(),minutes:l.getMinutes(),seconds:t.showSeconds?l.getSeconds():0,period:l.getHours()>=12?"PM":"AM"}}qe(i,a,t);let o=am(n,r,i,a,t,tm(n));if(t.isOpen)setTimeout(()=>o.open(),0);return o}catch(n){throw console.error("TimePicker creation error:",n),Error(`Failed to create time picker: ${n.message}`)}},Xs=_p;se();ne();var Pp={SMALL:"small",MEDIUM:"medium",LARGE:"large",CENTER:"center"};var bn={TAG:"header",TYPE:Pp.SMALL,SCROLLABLE:!0,COMPRESSIBLE:!0,SCROLL_THRESHOLD:4};var kp={tag:bn.TAG,type:bn.TYPE,scrollable:bn.SCROLLABLE,compressible:bn.COMPRESSIBLE,scrollThreshold:bn.SCROLL_THRESHOLD},om=(e={})=>_(kp,e,"top-app-bar");var lm=(e={})=>{let t=om(e),n=D(t),r=()=>{let m=document.createElement("div");m.className=`${n.getClass("top-app-bar")}-leading`;let p=document.createElement("h1");if(p.className=`${n.getClass("top-app-bar")}-headline`,t.title)p.textContent=t.title;let h=document.createElement("div");return h.className=`${n.getClass("top-app-bar")}-trailing`,{leadingContainer:m,headlineElement:p,trailingContainer:h}},{leadingContainer:i,headlineElement:s,trailingContainer:a}=r(),o=()=>{let m=[t.class];if(t.type!=="small")m.push(`${n.getClass("top-app-bar")}--${t.type}`);if(t.compressible&&(t.type==="medium"||t.type==="large"))m.push(`${n.getClass("top-app-bar")}--compressible`);return m.filter(Boolean)},l=O({tag:t.tag,componentName:"top-app-bar",className:o(),attributes:{role:"banner","aria-label":"Top app bar"},interactive:!0})(n),d=k()(l),u=P()(d);(()=>{if(t.type==="medium"||t.type==="large"){let m=document.createElement("div");m.className=`${n.getClass("top-app-bar")}-row`,m.appendChild(i),m.appendChild(a);let p=document.createElement("div");p.className=`${n.getClass("top-app-bar")}-row`,p.appendChild(s),u.element.appendChild(m),u.element.appendChild(p)}else u.element.appendChild(i),u.element.appendChild(s),u.element.appendChild(a)})();let c=!1;if(t.scrollable){let m=()=>{let h=window.scrollY>t.scrollThreshold;if(c!==h){if(c=h,c)u.element.classList.add(`${n.getClass("top-app-bar")}--scrolled`);else u.element.classList.remove(`${n.getClass("top-app-bar")}--scrolled`);t.onScroll?.(c)}};window.addEventListener("scroll",m,{passive:!0}),m();let p=u.lifecycle.destroy;u.lifecycle.destroy=()=>{window.removeEventListener("scroll",m),p()}}let C=(m)=>{while(u.element.firstChild)u.element.removeChild(u.element.firstChild);if(["small","medium","large","center"].forEach((p)=>{u.element.classList.remove(`${n.getClass("top-app-bar")}--${p}`)}),m!=="small")u.element.classList.add(`${n.getClass("top-app-bar")}--${m}`);if(u.element.classList.toggle(`${n.getClass("top-app-bar")}--compressible`,t.compressible&&(m==="medium"||m==="large")),m==="medium"||m==="large"){let p=document.createElement("div");p.className=`${n.getClass("top-app-bar")}-row`,p.appendChild(i),p.appendChild(a);let h=document.createElement("div");h.className=`${n.getClass("top-app-bar")}-row`,h.appendChild(s),u.element.appendChild(p),u.element.appendChild(h)}else u.element.appendChild(i),u.element.appendChild(s),u.element.appendChild(a)};return{...u,setTitle(m){return s.textContent=m,this},getTitle(){return s.textContent||""},addLeadingElement(m){return i.appendChild(m),this},addTrailingElement(m){return a.appendChild(m),this},setType(m){return t.type=m,C(m),this},setScrollState(m){if(c=m,m)this.element.classList.add(`${n.getClass("top-app-bar")}--scrolled`);else this.element.classList.remove(`${n.getClass("top-app-bar")}--scrolled`);return this},getHeadlineElement(){return s},getLeadingContainer(){return i},getTrailingContainer(){return a}}};var dm=lm;nt();se();te();re();var Me={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 um=8;var cm=({lifecycle:e})=>(t)=>{let n=null,r=Me.BOTTOM,i=!1,s=null,a=null,o=300,l=100,d=!0,u=!0,f=document.createElement("div");f.className=`${t.getClass("tooltip")}__arrow`,t.element.appendChild(f),document.body.appendChild(t.element),t.element.setAttribute("aria-hidden","true");let c=()=>{if(!n)return{top:0,left:0};let S=t.element.getBoundingClientRect(),y=n.getBoundingClientRect(),L=window.scrollY||window.pageYOffset,I=window.scrollX||window.pageXOffset,x=um,A=0,N=0,R;switch(r){case Me.TOP:A=y.top+L-S.height-x,N=y.left+I+y.width/2-S.width/2,R="bottom";break;case Me.TOP_START:A=y.top+L-S.height-x,N=y.left+I,R="bottom-start";break;case Me.TOP_END:A=y.top+L-S.height-x,N=y.left+I+y.width-S.width,R="bottom-end";break;case Me.RIGHT:A=y.top+L+y.height/2-S.height/2,N=y.left+I+y.width+x,R="left";break;case Me.RIGHT_START:A=y.top+L,N=y.left+I+y.width+x,R="left-start";break;case Me.RIGHT_END:A=y.top+L+y.height-S.height,N=y.left+I+y.width+x,R="left-end";break;case Me.BOTTOM:A=y.top+L+y.height+x,N=y.left+I+y.width/2-S.width/2,R="top";break;case Me.BOTTOM_START:A=y.top+L+y.height+x,N=y.left+I,R="top-start";break;case Me.BOTTOM_END:A=y.top+L+y.height+x,N=y.left+I+y.width-S.width,R="top-end";break;case Me.LEFT:A=y.top+L+y.height/2-S.height/2,N=y.left+I-S.width-x,R="right";break;case Me.LEFT_START:A=y.top+L,N=y.left+I-S.width-x,R="right-start";break;case Me.LEFT_END:A=y.top+L+y.height-S.height,N=y.left+I-S.width-x,R="right-end";break;default:A=y.top+L+y.height+x,N=y.left+I+y.width/2-S.width/2,R="top"}let U=window.innerWidth;if(N<0)N=0;else if(N+S.width>U)N=U-S.width;return{top:A,left:N,arrowPosition:R}},C=(S)=>{if(u)S.addEventListener("mouseenter",m),S.addEventListener("mouseleave",p);if(d)S.addEventListener("focus",h),S.addEventListener("blur",b)},g=(S)=>{if(S)S.removeEventListener("mouseenter",m),S.removeEventListener("mouseleave",p),S.removeEventListener("focus",h),S.removeEventListener("blur",b)},m=()=>v.show(),p=()=>v.hide(),h=()=>v.show(),b=()=>v.hide(),v={element:t.element,target:n,lifecycle:e,getClass:t.getClass,setText(S){let y=document.createTextNode(S);while(t.element.firstChild!==f)t.element.removeChild(t.element.firstChild);if(t.element.insertBefore(y,f),i)this.updatePosition();return this},getText(){let S=t.element.cloneNode(!0),y=S.querySelector(`.${t.getClass("tooltip")}__arrow`);if(y)y.remove();return S.textContent||""},setPosition(S){r=S;let y=t.getClass("tooltip"),L=Object.values(Me).map((I)=>`${y}--${I}`);if(t.element.classList.remove(...L),t.element.classList.add(`${y}--${S}`),i)this.updatePosition();return this},getPosition(){return r},setTarget(S){if(n)g(n);if(n=S,this.target=S,n.setAttribute("aria-describedby",t.element.id),C(n),i)this.updatePosition();return this},show(S=!1){if(s!==null)window.clearTimeout(s),s=null;if(a!==null)window.clearTimeout(a),a=null;let y=()=>{if(!n)return this;t.element.setAttribute("aria-hidden","false"),t.element.classList.add(`${t.getClass("tooltip")}--visible`),i=!0,this.updatePosition(),window.addEventListener("resize",E),window.addEventListener("scroll",T)};if(S)y();else s=window.setTimeout(y,o);return this},hide(S=!1){if(a!==null)window.clearTimeout(a),a=null;if(s!==null)window.clearTimeout(s),s=null;let y=()=>{t.element.setAttribute("aria-hidden","true"),t.element.classList.remove(`${t.getClass("tooltip")}--visible`),i=!1,window.removeEventListener("resize",E),window.removeEventListener("scroll",T)};if(S)y();else a=window.setTimeout(y,l);return this},isVisible(){return i},updatePosition(){if(!n)return this;let{top:S,left:y,arrowPosition:L}=c();if(t.element.style.top=`${Math.round(S)}px`,t.element.style.left=`${Math.round(y)}px`,L)f.className=`${t.getClass("tooltip")}__arrow`,f.classList.add(`${t.getClass("tooltip")}__arrow--${L}`);return this},destroy(){if(s!==null)window.clearTimeout(s);if(a!==null)window.clearTimeout(a);if(n)g(n),n.removeAttribute("aria-describedby");if(window.removeEventListener("resize",E),window.removeEventListener("scroll",T),t.element.parentNode)t.element.parentNode.removeChild(t.element);e.destroy()}},E=()=>{v.updatePosition()},T=()=>{v.updatePosition()};return v};ne();var Bp={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"},Hp={DEFAULT:"default",RICH:"rich",PLAIN:"plain"};var ft={POSITION:Bp.BOTTOM,VARIANT:Hp.DEFAULT,VISIBLE:!1,SHOW_DELAY:300,HIDE_DELAY:100,OFFSET:8,ARROW_SIZE:8,SHOW_ON_FOCUS:!0,SHOW_ON_HOVER:!0,RICH:!1};var $p={position:ft.POSITION,variant:ft.VARIANT,visible:ft.VISIBLE,showDelay:ft.SHOW_DELAY,hideDelay:ft.HIDE_DELAY,showOnFocus:ft.SHOW_ON_FOCUS,showOnHover:ft.SHOW_ON_HOVER,rich:ft.RICH},mm=(e={})=>_($p,e,"tooltip"),fm=(e)=>{let t={role:"tooltip","aria-hidden":"true"};if(e.zIndex!==void 0)t.style=`z-index: ${e.zIndex};`;return V(e,{tag:"div",attributes:t,className:[e.class,`${e.prefix}-tooltip--${e.position}`,`${e.prefix}-tooltip--${e.variant}`],text:e.text||""})},gm=(e)=>({lifecycle:{destroy:()=>e.lifecycle.destroy()}});var Vp=()=>`${K}-tooltip-${Math.random().toString(36).substring(2,9)}`,Fp=(e={})=>{let t=mm(e);try{let n=M(D,O(fm(t)),P(),(r)=>cm(gm(r))(r))(t);if(n.element.id=Vp(),t.target)n.setTarget(t.target);if(t.text)n.setText(t.text);if(t.visible)n.show(!0);return n}catch(n){throw console.error("Tooltip creation error:",n),Error(`Failed to create tooltip: ${n.message}`)}},qs=Fp;tn();tn();
|
|
56
56
|
|
|
57
|
-
//# debugId=
|
|
57
|
+
//# debugId=6DD9BF25DC26209E64756E2164756E21
|