@rettangoli/ui 1.0.13 → 1.0.15

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.
@@ -12,12 +12,12 @@ var rettangoli=(()=>{var ve=`
12
12
  bottom: 0;
13
13
  z-index: 1;
14
14
  }
15
- `,Pe=({linkElement:e,href:t,newTab:r,rel:i})=>{e.href=t,r?e.target="_blank":e.removeAttribute("target"),i!=null?e.rel=i:r?e.rel="noopener noreferrer":e.removeAttribute("rel")},we=({shadowRoot:e,slotElement:t,linkElement:r,href:i,newTab:s,rel:n})=>{if(t.parentNode!==e&&e.appendChild(t),!i)return r&&r.parentNode===e&&e.removeChild(r),null;let a=r||document.createElement("a");return Pe({linkElement:a,href:i,newTab:s,rel:n}),a.parentNode!==e&&e.appendChild(a),a},At=({shadowRoot:e,childElement:t,linkElement:r,href:i,newTab:s,rel:n})=>{if(!i)return r?(t.parentNode===r&&e.appendChild(t),r.parentNode===e&&e.removeChild(r),null):(t.parentNode!==e&&e.appendChild(t),null);let a=r||document.createElement("a");return Pe({linkElement:a,href:i,newTab:s,rel:n}),t.parentNode!==a&&a.appendChild(t),a.parentNode!==e&&e.appendChild(a),a};var te=["default","sm","md","lg","xl"],M=()=>te.reduce((e,t)=>(e[t]={},e),{}),xr=["sm","md","lg","xl"],Cs=({size:e,attr:t})=>e==="default"?t:`${e}-${t}`,Is=({size:e,includeDefault:t=!0})=>{if(e==="default")return["default"];let r=xr.indexOf(e);if(r===-1)return t?["default"]:[];let i=xr.slice(r);return t&&i.push("default"),i},Et=({element:e,size:t,attr:r,includeDefault:i=!0})=>{let s=Is({size:t,includeDefault:i});for(let n of s){let a=Cs({size:n,attr:r}),p=e.getAttribute(a);if(p!==null)return p}return null};var Ts=/^([1-9]|1[0-2])fg$/,Os=/^([1-9]\d*)\/([1-9]\d*)fb$/,kt=e=>typeof e=="string"&&Ts.test(e),tt=e=>{if(typeof e!="string")return null;let t=e.match(Os);if(!t)return null;let r=Number(t[1]),i=Number(t[2]);return!Number.isInteger(r)||!Number.isInteger(i)||i<=0||r>i?null:{numerator:r,denominator:i}};function Sr({numerator:e,denominator:t,gapVar:r}){return e===t?"100%":e===1?`calc((100% - ((${t} - 1) * ${r})) / ${t})`:`calc(((100% - ((${t} - 1) * ${r})) * ${e}) / ${t})`}var K=({styleBucket:e,axis:t,dimension:r,fillValue:i,allowFlexGrow:s=!1,flexMinDimension:n="0",lockBounds:a=!0})=>{let p=()=>{!s||t!=="width"||(e["flex-grow"]="0",e["flex-shrink"]="1",e["flex-basis"]="auto")},l=()=>{e[`min-${t}`]="unset",e[`max-${t}`]="unset"};if(r===void 0)return;if(r==="f"){p(),e[t]=i,l();return}if(s&&kt(r)){e["flex-grow"]=r.slice(0,-2),e["flex-basis"]="0%",e[`min-${t}`]=n,e[`max-${t}`]="unset";return}let o=s?tt(r):null;if(o){e["flex-grow"]="0",e["flex-shrink"]="0",e["flex-basis"]=Sr({...o,gapVar:"var(--rtgl-flex-gap, 0px)"}),e[`min-${t}`]=n,e[`max-${t}`]="unset";return}p(),e[t]=r,a&&(e[`min-${t}`]=r,e[`max-${t}`]=r)},Be=({style:e,width:t,fillValue:r="var(--width-stretch)",allowFlexGrow:i=!0,flexMinWidth:s="0"})=>{if(t==="f"){e.width=r,e.flexGrow="",e.flexBasis="",e.minWidth="";return}if(i&&kt(t)){e.width="",e.flexGrow=t.slice(0,-2),e.flexShrink="",e.flexBasis="0%",e.minWidth=s;return}let n=i?tt(t):null;if(n){e.width="",e.flexGrow="0",e.flexShrink="0",e.flexBasis=Sr({...n,gapVar:"var(--rtgl-flex-gap, 0px)"}),e.minWidth=s;return}if(t!=null){e.width=t,e.flexGrow="",e.flexShrink="",e.flexBasis="",e.minWidth="";return}e.width="",e.flexGrow="",e.flexShrink="",e.flexBasis="",e.minWidth=""};var Ls=e=>`${e}`.trim().replace(/\s*\/\s*/g,"/"),De=e=>{if(e==null)return;let t=Ls(e);if(t.length!==0)return typeof CSS<"u"&&typeof CSS.supports=="function"?CSS.supports("aspect-ratio",t)?t:void 0:t};function I(e,...t){let r="";return e.forEach((i,s)=>{r+=i+(t[s]||"")}),r}var Ns=["sm","md","lg","xl"],Ar={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom",pt:"padding-top",pr:"padding-right",pb:"padding-bottom",pl:"padding-left",p:"padding",ph:"padding-left padding-right",pv:"padding-top padding-bottom",g:"gap --rtgl-flex-gap",gv:"row-gap --rtgl-flex-gap",gh:"column-gap --rtgl-flex-gap",bw:"border-width",bwt:"border-top-width",bwr:"border-right-width",bwb:"border-bottom-width",bwl:"border-left-width",bc:"border-color",br:"border-radius",pos:"position",shadow:"box-shadow",cur:"cursor"},oe=Object.keys(Ar),G=e=>e.concat(Ns.flatMap(t=>e.map(r=>`${t}-${r}`))),Er={default:void 0,xl:"@media only screen and (max-width: 1280px)",lg:"@media only screen and (max-width: 1024px)",md:"@media only screen and (max-width: 768px)",sm:"@media only screen and (max-width: 640px)"},J=(e,t={},r=null)=>{let i="";for(let[s,n]of Object.entries(Er)){s!=="default"&&(i+=`${n} {`);for(let[a,p]of Object.entries(e))for(let[l,o]of Object.entries(p)){let c=Ar[a],d=o.startsWith("--")?`var(${o})`:o,u=s==="default"?a:`${s}-${a}`,f=s==="default"?`h-${a}`:`${s}-h-${a}`,h=(m,g=!1)=>{let b=g?`:host([${m}="${l}"]:hover)`:`:host([${m}="${l}"])`;if(r)return r.split(",").map(_=>`${b} ${_.trim()}`).join(", ");let y=t[a];return y?`${b} ${y}`:b};if(c){let g=c.split(" ").map(b=>`${b}: ${d};`).join(" ");i+=`
15
+ `,je=({linkElement:e,href:t,newTab:r,rel:i})=>{e.href=t,r?e.target="_blank":e.removeAttribute("target"),i!=null?e.rel=i:r?e.rel="noopener noreferrer":e.removeAttribute("rel")},we=({shadowRoot:e,slotElement:t,linkElement:r,href:i,newTab:s,rel:n})=>{if(t.parentNode!==e&&e.appendChild(t),!i)return r&&r.parentNode===e&&e.removeChild(r),null;let a=r||document.createElement("a");return je({linkElement:a,href:i,newTab:s,rel:n}),a.parentNode!==e&&e.appendChild(a),a},At=({shadowRoot:e,childElement:t,linkElement:r,href:i,newTab:s,rel:n})=>{if(!i)return r?(t.parentNode===r&&e.appendChild(t),r.parentNode===e&&e.removeChild(r),null):(t.parentNode!==e&&e.appendChild(t),null);let a=r||document.createElement("a");return je({linkElement:a,href:i,newTab:s,rel:n}),t.parentNode!==a&&a.appendChild(t),a.parentNode!==e&&e.appendChild(a),a};var te=["default","sm","md","lg","xl"],W=()=>te.reduce((e,t)=>(e[t]={},e),{}),xr=["sm","md","lg","xl"],Cs=({size:e,attr:t})=>e==="default"?t:`${e}-${t}`,Is=({size:e,includeDefault:t=!0})=>{if(e==="default")return["default"];let r=xr.indexOf(e);if(r===-1)return t?["default"]:[];let i=xr.slice(r);return t&&i.push("default"),i},Et=({element:e,size:t,attr:r,includeDefault:i=!0})=>{let s=Is({size:t,includeDefault:i});for(let n of s){let a=Cs({size:n,attr:r}),p=e.getAttribute(a);if(p!==null)return p}return null};var Ts=/^([1-9]|1[0-2])fg$/,Os=/^([1-9]\d*)\/([1-9]\d*)fb$/,kt=e=>typeof e=="string"&&Ts.test(e),et=e=>{if(typeof e!="string")return null;let t=e.match(Os);if(!t)return null;let r=Number(t[1]),i=Number(t[2]);return!Number.isInteger(r)||!Number.isInteger(i)||i<=0||r>i?null:{numerator:r,denominator:i}};function Sr({numerator:e,denominator:t,gapVar:r}){return e===t?"100%":e===1?`calc((100% - ((${t} - 1) * ${r})) / ${t})`:`calc(((100% - ((${t} - 1) * ${r})) * ${e}) / ${t})`}var M=({styleBucket:e,axis:t,dimension:r,fillValue:i,allowFlexGrow:s=!1,flexMinDimension:n="0",lockBounds:a=!0})=>{let p=()=>{!s||t!=="width"||(e["flex-grow"]="0",e["flex-shrink"]="1",e["flex-basis"]="auto")},l=()=>{e[`min-${t}`]="unset",e[`max-${t}`]="unset"};if(r===void 0)return;if(r==="f"){p(),e[t]=i,l();return}if(s&&kt(r)){e["flex-grow"]=r.slice(0,-2),e["flex-basis"]="0%",e[`min-${t}`]=n,e[`max-${t}`]="unset";return}let o=s?et(r):null;if(o){e["flex-grow"]="0",e["flex-shrink"]="0",e["flex-basis"]=Sr({...o,gapVar:"var(--rtgl-flex-gap, 0px)"}),e[`min-${t}`]=n,e[`max-${t}`]="unset";return}p(),e[t]=r,a&&(e[`min-${t}`]=r,e[`max-${t}`]=r)},Pe=({style:e,width:t,fillValue:r="var(--width-stretch)",allowFlexGrow:i=!0,flexMinWidth:s="0"})=>{if(t==="f"){e.width=r,e.flexGrow="",e.flexBasis="",e.minWidth="";return}if(i&&kt(t)){e.width="",e.flexGrow=t.slice(0,-2),e.flexShrink="",e.flexBasis="0%",e.minWidth=s;return}let n=i?et(t):null;if(n){e.width="",e.flexGrow="0",e.flexShrink="0",e.flexBasis=Sr({...n,gapVar:"var(--rtgl-flex-gap, 0px)"}),e.minWidth=s;return}if(t!=null){e.width=t,e.flexGrow="",e.flexShrink="",e.flexBasis="",e.minWidth="";return}e.width="",e.flexGrow="",e.flexShrink="",e.flexBasis="",e.minWidth=""};var Ls=e=>`${e}`.trim().replace(/\s*\/\s*/g,"/"),Be=e=>{if(e==null)return;let t=Ls(e);if(t.length!==0)return typeof CSS<"u"&&typeof CSS.supports=="function"?CSS.supports("aspect-ratio",t)?t:void 0:t};function I(e,...t){let r="";return e.forEach((i,s)=>{r+=i+(t[s]||"")}),r}var Ns=["sm","md","lg","xl"],Ar={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom",pt:"padding-top",pr:"padding-right",pb:"padding-bottom",pl:"padding-left",p:"padding",ph:"padding-left padding-right",pv:"padding-top padding-bottom",g:"gap --rtgl-flex-gap",gv:"row-gap --rtgl-flex-gap",gh:"column-gap --rtgl-flex-gap",bw:"border-width",bwt:"border-top-width",bwr:"border-right-width",bwb:"border-bottom-width",bwl:"border-left-width",bc:"border-color",br:"border-radius",pos:"position",shadow:"box-shadow",cur:"cursor"},oe=Object.keys(Ar),q=e=>e.concat(Ns.flatMap(t=>e.map(r=>`${t}-${r}`))),Er={default:void 0,xl:"@media only screen and (max-width: 1280px)",lg:"@media only screen and (max-width: 1024px)",md:"@media only screen and (max-width: 768px)",sm:"@media only screen and (max-width: 640px)"},G=(e,t={},r=null)=>{let i="";for(let[s,n]of Object.entries(Er)){s!=="default"&&(i+=`${n} {`);for(let[a,p]of Object.entries(e))for(let[l,o]of Object.entries(p)){let c=Ar[a],d=o.startsWith("--")?`var(${o})`:o,u=s==="default"?a:`${s}-${a}`,f=s==="default"?`h-${a}`:`${s}-h-${a}`,h=(m,y=!1)=>{let b=y?`:host([${m}="${l}"]:hover)`:`:host([${m}="${l}"])`;if(r)return r.split(",").map(_=>`${b} ${_.trim()}`).join(", ");let g=t[a];return g?`${b} ${g}`:b};if(c){let y=c.split(" ").map(b=>`${b}: ${d};`).join(" ");i+=`
16
16
  ${h(u)}{
17
- ${g}
17
+ ${y}
18
18
  }
19
19
  ${h(f,!0)}{
20
- ${g}
20
+ ${y}
21
21
  }
22
22
  `}else i+=`
23
23
  ${h(u)}{
@@ -26,7 +26,7 @@ var rettangoli=(()=>{var ve=`
26
26
  ${h(f,!0)}{
27
27
  ${o}
28
28
  }
29
- `}s!=="default"&&(i+="}")}return i};function Rs(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var Vs=e=>/%$/.test(e),js=e=>/^([1-9]|1[0-2])fg$/.test(e),C=e=>{if(e!=null)return js(e)||Vs(e)?e:Rs(e)?`${e}px`:Object.keys(L).includes(e)?`var(${L[e]})`:e},L={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function Y(e,t=":host"){let r="",i=["default","xl","lg","md","sm"];for(let s of i){let n=Er[s];if(!e[s]||Object.keys(e[s]).length===0)continue;s!=="default"&&(r+=`${n} {
29
+ `}s!=="default"&&(i+="}")}return i};function Rs(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var Vs=e=>/%$/.test(e),js=e=>/^([1-9]|1[0-2])fg$/.test(e),C=e=>{if(e!=null)return js(e)||Vs(e)?e:Rs(e)?`${e}px`:Object.keys(L).includes(e)?`var(${L[e]})`:e},L={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function J(e,t=":host"){let r="",i=["default","xl","lg","md","sm"];for(let s of i){let n=Er[s];if(!e[s]||Object.keys(e[s]).length===0)continue;s!=="default"&&(r+=`${n} {
30
30
  `);let a="";for(let[p,l]of Object.entries(e[s]))l!=null&&(a+=`${p}: ${l} !important;
31
31
  `);r+=`${t} {
32
32
  ${a.trim()}
@@ -81,7 +81,7 @@ var rettangoli=(()=>{var ve=`
81
81
  `,lk:`
82
82
  background-color: transparent;
83
83
  color: var(--foreground);
84
- `}},kr=J(Ps,{},".surface");var Bs=[{prefix:"sm",maxWidth:640},{prefix:"md",maxWidth:768},{prefix:"lg",maxWidth:1024},{prefix:"xl",maxWidth:1280}],$t=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
84
+ `}},kr=G(Ps,{},".surface");var Bs=[{prefix:"sm",maxWidth:640},{prefix:"md",maxWidth:768},{prefix:"lg",maxWidth:1024},{prefix:"xl",maxWidth:1280}],$t=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
85
85
  :host {
86
86
  display: inline-flex;
87
87
  }
@@ -249,7 +249,7 @@ var rettangoli=(()=>{var ve=`
249
249
  }
250
250
 
251
251
  ${kr}
252
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._containerElement=null,this._surfaceElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._prefixIcon=null,this._suffixIcon=null,this._surfaceElement.className="surface",this._surfaceElement.appendChild(this._slotElement),this._onWindowResize=this._onWindowResize.bind(this)}static get observedAttributes(){return["key","href","new-tab","rel","w","pre","suf","disabled","v","s","sq","sm-s","md-s","lg-s","xl-s"]}connectedCallback(){window.addEventListener("resize",this._onWindowResize),this._updateButton()}disconnectedCallback(){window.removeEventListener("resize",this._onWindowResize)}attributeChangedCallback(t,r,i){this._updateButton()}_onWindowResize(){(this.hasAttribute("sm-s")||this.hasAttribute("md-s")||this.hasAttribute("lg-s")||this.hasAttribute("xl-s"))&&this._updateIcon()}_resolveResponsiveSizeToken(){let t=window.innerWidth;for(let{prefix:r,maxWidth:i}of Bs){let s=`${r}-s`;if(t<=i&&this.hasAttribute(s))return this.getAttribute(s)}return this.getAttribute("s")}_updateButton(){this.shadow.innerHTML="";let t=this.hasAttribute("disabled"),r=this.getAttribute("href"),i=this.hasAttribute("new-tab"),s=this.getAttribute("rel"),n=r&&!t,a=n?"a":"button";if(this._surfaceElement.tagName.toLowerCase()!==a){let p=document.createElement(a);p.className="surface",p.appendChild(this._slotElement),this._surfaceElement=p}this._updateIcon(),this.hasAttribute("sq")?(this.style.width="",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):this._updateWidth(),n?(Pe({linkElement:this._surfaceElement,href:r,newTab:i,rel:s}),this._surfaceElement.removeAttribute("disabled")):(this._surfaceElement.removeAttribute("href"),this._surfaceElement.removeAttribute("target"),this._surfaceElement.removeAttribute("rel"),t?this._surfaceElement.setAttribute("disabled",""):this._surfaceElement.removeAttribute("disabled")),this.shadow.appendChild(this._surfaceElement),this._containerElement=this._surfaceElement}_updateIcon(){this._prefixIcon&&(this._prefixIcon.remove(),this._prefixIcon=null),this._suffixIcon&&(this._suffixIcon.remove(),this._suffixIcon=null);let t={sm:14,md:18,lg:22},r=this._resolveResponsiveSizeToken(),i=18;this.hasAttribute("sq")?i={sm:14,lg:22}[r]||18:i=t[r]||18;let s=this.getAttribute("pre");s&&(this._prefixIcon=document.createElement("rtgl-svg"),this._prefixIcon.setAttribute("svg",s),this._prefixIcon.setAttribute("wh",i.toString()),this._prefixIcon.style.color="inherit",this._surfaceElement.insertBefore(this._prefixIcon,this._slotElement));let n=this.getAttribute("suf");n&&(this._suffixIcon=document.createElement("rtgl-svg"),this._suffixIcon.setAttribute("svg",n),this._suffixIcon.setAttribute("wh",i.toString()),this._suffixIcon.style.color="inherit",this._surfaceElement.appendChild(this._suffixIcon))}_updateWidth(){let t=C(this.getAttribute("w"));t==="f"?(this.style.width="var(--width-stretch)",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):t!=null?(this.style.width=t,this.style.minWidth=t,this.style.maxWidth=t,this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):(this.style.width="",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth="")}getBoundingClientRect(){return this._surfaceElement?this._surfaceElement.getBoundingClientRect():super.getBoundingClientRect()}},$r=({render:e,html:t})=>$t;var Ds=({numerator:e,denominator:t,gapVar:r})=>e===t?"100%":e===1?`calc((100% - ((${t} - 1) * ${r})) / ${t})`:`calc(((100% - ((${t} - 1) * ${r})) * ${e}) / ${t})`,rt=({index:e,maxIndex:t})=>!Number.isFinite(e)||!Number.isFinite(t)||t<0?0:Math.min(Math.max(Math.trunc(e),0),t),Ct=({value:e,defaultValue:t=!1})=>{if(e==null)return t;let r=`${e}`.trim().toLowerCase();return r.length===0?!0:!(r==="false"||r==="0"||r==="no"||r==="off"||r==="none")},It=e=>{if(e==null)return"x mandatory";let t=`${e}`.trim().toLowerCase();return t===""||t==="true"||t==="1"||t==="yes"?"x mandatory":t==="false"||t==="0"||t==="no"||t==="off"||t==="none"?"none":"x mandatory"},Cr=({slideLeft:e,slideWidth:t,viewportWidth:r,scrollPaddingInlineStart:i=0,scrollPaddingInlineEnd:s=0,snapAlign:n="center",maxScrollLeft:a=Number.POSITIVE_INFINITY})=>{if(!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(r))return 0;let p=i,l=r-s,o=Math.max(l-p,0),c;n==="start"?c=e-p:n==="end"?c=e+t-l:c=e+t/2-(p+o/2);let d=Number.isFinite(a)?Math.max(a,0):Number.POSITIVE_INFINITY;return Math.min(Math.max(c,0),d)},Ir=({slideWidthCss:e,snapAlign:t="center"})=>`${t??""}`.trim().toLowerCase()!=="center"?"0px":`max(calc((100% - (${e&&`${e}`.trim().length>0?`${e}`.trim():"100%"})) / 2), 0px)`,Tr=({slideWidth:e,gapVar:t="var(--rtgl-carousel-gap, 0px)"})=>{if(e==null||`${e}`.trim()===""||e==="f")return"100%";let r=tt(`${e}`.trim());return r?Ds({...r,gapVar:t}):C(`${e}`.trim())??"100%"};var zs=["a","button","input","select","textarea","label","summary","[contenteditable]"].join(", "),Tt=e=>{if(e==null)return null;let t=`${e}`.trim();return t.length>0?t:null},Fs=e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,Or=e=>{let t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("viewBox","0 0 24 24"),r.setAttribute("aria-hidden","true"),r.setAttribute("focusable","false");let i=document.createElementNS(t,"path");return i.setAttribute("d",e==="left"?"M15 18 9 12l6-6":"M9 18l6-6-6-6"),i.setAttribute("fill","none"),i.setAttribute("stroke","currentColor"),i.setAttribute("stroke-width","2"),i.setAttribute("stroke-linecap","round"),i.setAttribute("stroke-linejoin","round"),r.appendChild(i),r},Ot=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
252
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._containerElement=null,this._surfaceElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._prefixIcon=null,this._suffixIcon=null,this._surfaceElement.className="surface",this._surfaceElement.appendChild(this._slotElement),this._onWindowResize=this._onWindowResize.bind(this)}static get observedAttributes(){return["key","href","new-tab","rel","w","pre","suf","disabled","v","s","sq","sm-s","md-s","lg-s","xl-s"]}connectedCallback(){window.addEventListener("resize",this._onWindowResize),this._updateButton()}disconnectedCallback(){window.removeEventListener("resize",this._onWindowResize)}attributeChangedCallback(t,r,i){this._updateButton()}_onWindowResize(){(this.hasAttribute("sm-s")||this.hasAttribute("md-s")||this.hasAttribute("lg-s")||this.hasAttribute("xl-s"))&&this._updateIcon()}_resolveResponsiveSizeToken(){let t=window.innerWidth;for(let{prefix:r,maxWidth:i}of Bs){let s=`${r}-s`;if(t<=i&&this.hasAttribute(s))return this.getAttribute(s)}return this.getAttribute("s")}_updateButton(){this.shadow.innerHTML="";let t=this.hasAttribute("disabled"),r=this.getAttribute("href"),i=this.hasAttribute("new-tab"),s=this.getAttribute("rel"),n=r&&!t,a=n?"a":"button";if(this._surfaceElement.tagName.toLowerCase()!==a){let p=document.createElement(a);p.className="surface",p.appendChild(this._slotElement),this._surfaceElement=p}this._updateIcon(),this.hasAttribute("sq")?(this.style.width="",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):this._updateWidth(),n?(je({linkElement:this._surfaceElement,href:r,newTab:i,rel:s}),this._surfaceElement.removeAttribute("disabled")):(this._surfaceElement.removeAttribute("href"),this._surfaceElement.removeAttribute("target"),this._surfaceElement.removeAttribute("rel"),t?this._surfaceElement.setAttribute("disabled",""):this._surfaceElement.removeAttribute("disabled")),this.shadow.appendChild(this._surfaceElement),this._containerElement=this._surfaceElement}_updateIcon(){this._prefixIcon&&(this._prefixIcon.remove(),this._prefixIcon=null),this._suffixIcon&&(this._suffixIcon.remove(),this._suffixIcon=null);let t={sm:14,md:18,lg:22},r=this._resolveResponsiveSizeToken(),i=18;this.hasAttribute("sq")?i={sm:14,lg:22}[r]||18:i=t[r]||18;let s=this.getAttribute("pre");s&&(this._prefixIcon=document.createElement("rtgl-svg"),this._prefixIcon.setAttribute("svg",s),this._prefixIcon.setAttribute("wh",i.toString()),this._prefixIcon.style.color="inherit",this._surfaceElement.insertBefore(this._prefixIcon,this._slotElement));let n=this.getAttribute("suf");n&&(this._suffixIcon=document.createElement("rtgl-svg"),this._suffixIcon.setAttribute("svg",n),this._suffixIcon.setAttribute("wh",i.toString()),this._suffixIcon.style.color="inherit",this._surfaceElement.appendChild(this._suffixIcon))}_updateWidth(){let t=C(this.getAttribute("w"));t==="f"?(this.style.width="var(--width-stretch)",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):t!=null?(this.style.width=t,this.style.minWidth=t,this.style.maxWidth=t,this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):(this.style.width="",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth="")}getBoundingClientRect(){return this._surfaceElement?this._surfaceElement.getBoundingClientRect():super.getBoundingClientRect()}},$r=({render:e,html:t})=>$t;var Ds=({numerator:e,denominator:t,gapVar:r})=>e===t?"100%":e===1?`calc((100% - ((${t} - 1) * ${r})) / ${t})`:`calc(((100% - ((${t} - 1) * ${r})) * ${e}) / ${t})`,tt=({index:e,maxIndex:t})=>!Number.isFinite(e)||!Number.isFinite(t)||t<0?0:Math.min(Math.max(Math.trunc(e),0),t),Ct=({value:e,defaultValue:t=!1})=>{if(e==null)return t;let r=`${e}`.trim().toLowerCase();return r.length===0?!0:!(r==="false"||r==="0"||r==="no"||r==="off"||r==="none")},It=e=>{if(e==null)return"x mandatory";let t=`${e}`.trim().toLowerCase();return t===""||t==="true"||t==="1"||t==="yes"?"x mandatory":t==="false"||t==="0"||t==="no"||t==="off"||t==="none"?"none":"x mandatory"},Cr=({slideLeft:e,slideWidth:t,viewportWidth:r,scrollPaddingInlineStart:i=0,scrollPaddingInlineEnd:s=0,snapAlign:n="center",maxScrollLeft:a=Number.POSITIVE_INFINITY})=>{if(!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(r))return 0;let p=i,l=r-s,o=Math.max(l-p,0),c;n==="start"?c=e-p:n==="end"?c=e+t-l:c=e+t/2-(p+o/2);let d=Number.isFinite(a)?Math.max(a,0):Number.POSITIVE_INFINITY;return Math.min(Math.max(c,0),d)},Ir=({slideWidthCss:e,snapAlign:t="center"})=>`${t??""}`.trim().toLowerCase()!=="center"?"0px":`max(calc((100% - (${e&&`${e}`.trim().length>0?`${e}`.trim():"100%"})) / 2), 0px)`,Tr=({slideWidth:e,gapVar:t="var(--rtgl-carousel-gap, 0px)"})=>{if(e==null||`${e}`.trim()===""||e==="f")return"100%";let r=et(`${e}`.trim());return r?Ds({...r,gapVar:t}):C(`${e}`.trim())??"100%"};var zs=["a","button","input","select","textarea","label","summary","[contenteditable]"].join(", "),Tt=e=>{if(e==null)return null;let t=`${e}`.trim();return t.length>0?t:null},Fs=e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,Or=e=>{let t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("viewBox","0 0 24 24"),r.setAttribute("aria-hidden","true"),r.setAttribute("focusable","false");let i=document.createElementNS(t,"path");return i.setAttribute("d",e==="left"?"M15 18 9 12l6-6":"M9 18l6-6-6-6"),i.setAttribute("fill","none"),i.setAttribute("stroke","currentColor"),i.setAttribute("stroke-width","2"),i.setAttribute("stroke-linecap","round"),i.setAttribute("stroke-linejoin","round"),r.appendChild(i),r},Ot=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
253
253
  :host {
254
254
  display: block;
255
255
  width: 100%;
@@ -444,7 +444,7 @@ var rettangoli=(()=>{var ve=`
444
444
  border-color: var(--foreground);
445
445
  transform: scale(1.2);
446
446
  }
447
- `))}static get observedAttributes(){return["index","sw","sna","g","spi","sbh","snap","nav","pager"]}constructor(){super(),e.initializeStyleSheet(),this._slides=[],this._pagerButtons=[],this._currentIndex=0,this._clickSuppressUntil=0,this._dragState=null,this._scrollFrame=null,this._resizeFrame=null,this._scrollAnimationFrame=null,this._isReflectingIndex=!1,this._slideStyleCache=new WeakMap,this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._rootElement=document.createElement("div"),this._rootElement.id="root",this._viewportShellElement=document.createElement("div"),this._viewportShellElement.id="viewport-shell",this._viewportShellElement.setAttribute("part","viewport-shell"),this._viewportElement=document.createElement("div"),this._viewportElement.id="viewport",this._viewportElement.tabIndex=0,this._viewportElement.setAttribute("part","viewport"),this._slotElement=document.createElement("slot"),this._viewportElement.appendChild(this._slotElement),this._controlsElement=document.createElement("div"),this._controlsElement.id="controls",this._controlsElement.setAttribute("part","controls"),this._controlsElement.hidden=!0,this._prevButton=document.createElement("button"),this._prevButton.id="prev-button",this._prevButton.type="button",this._prevButton.hidden=!0,this._prevButton.append(Or("left")),this._prevButton.setAttribute("part","nav-button prev-button"),this._prevButton.setAttribute("aria-label","Previous slide"),this._pagerElement=document.createElement("div"),this._pagerElement.id="pager",this._pagerElement.setAttribute("part","pager"),this._pagerElement.hidden=!0,this._nextButton=document.createElement("button"),this._nextButton.id="next-button",this._nextButton.type="button",this._nextButton.hidden=!0,this._nextButton.append(Or("right")),this._nextButton.setAttribute("part","nav-button next-button"),this._nextButton.setAttribute("aria-label","Next slide"),this._viewportShellElement.append(this._viewportElement,this._prevButton,this._nextButton),this._controlsElement.append(this._pagerElement),this._rootElement.append(this._viewportShellElement,this._controlsElement),this.shadow.append(this._rootElement),this._handleSlotChange=this._handleSlotChange.bind(this),this._handleClickPrev=this._handleClickPrev.bind(this),this._handleClickNext=this._handleClickNext.bind(this),this._handleViewportKeydown=this._handleViewportKeydown.bind(this),this._handleViewportScroll=this._handleViewportScroll.bind(this),this._handleViewportPointerDown=this._handleViewportPointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._handleViewportClickCapture=this._handleViewportClickCapture.bind(this),this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._resizeFrame!==null&&cancelAnimationFrame(this._resizeFrame),this._resizeFrame=requestAnimationFrame(()=>{this._resizeFrame=null,!(this._dragState?.dragging||!this._slides.length)&&this.goTo(this._currentIndex,{behavior:"auto"})})}):null}get index(){return this._currentIndex}set index(t){let r=Number(t);this.setAttribute("index",Number.isFinite(r)?`${r}`:"0")}get snap(){return It(this.getAttribute("snap"))!=="none"}set snap(t){if(t===!1||`${t}`.trim().toLowerCase()==="false"){this.setAttribute("snap","false");return}this.setAttribute("snap","true")}connectedCallback(){this._slotElement.addEventListener("slotchange",this._handleSlotChange),this._prevButton.addEventListener("click",this._handleClickPrev),this._nextButton.addEventListener("click",this._handleClickNext),this._viewportElement.addEventListener("keydown",this._handleViewportKeydown),this._viewportElement.addEventListener("scroll",this._handleViewportScroll,{passive:!0}),this._viewportElement.addEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.addEventListener("click",this._handleViewportClickCapture,!0),this._resizeObserver?.observe(this._viewportElement),this._syncSlides(),this._updateLayoutStyles();let t=this.hasAttribute("index")?Number(this.getAttribute("index")):0;this.goTo(t,{behavior:"auto"})}disconnectedCallback(){this._slotElement.removeEventListener("slotchange",this._handleSlotChange),this._prevButton.removeEventListener("click",this._handleClickPrev),this._nextButton.removeEventListener("click",this._handleClickNext),this._viewportElement.removeEventListener("keydown",this._handleViewportKeydown),this._viewportElement.removeEventListener("scroll",this._handleViewportScroll),this._viewportElement.removeEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.removeEventListener("click",this._handleViewportClickCapture,!0),this._removePointerListeners(),this._resizeObserver?.disconnect(),this._scrollFrame!==null&&(cancelAnimationFrame(this._scrollFrame),this._scrollFrame=null),this._resizeFrame!==null&&(cancelAnimationFrame(this._resizeFrame),this._resizeFrame=null),this._cancelScrollAnimation(),this._setDraggingState(!1),this._slides.forEach(t=>{this._restoreSlideStyles(t),t.removeAttribute("data-rtgl-carousel-active")})}attributeChangedCallback(t,r,i){if(r!==i){if(t==="index"){if(this._isReflectingIndex){this._isReflectingIndex=!1;return}this.goTo(Number(i),{behavior:"smooth"});return}if(t==="nav"||t==="pager"){this._updateControls();return}this._updateLayoutStyles()}}next(){this.goTo(this._currentIndex+1)}prev(){this.goTo(this._currentIndex-1)}_showsNavControls(){return Ct({value:this.getAttribute("nav"),defaultValue:!0})}_showsPagerControls(){return Ct({value:this.getAttribute("pager"),defaultValue:!1})}goTo(t,r={}){if(!this._slides.length){this._setCurrentIndex(0,{emit:!1,reflect:!0});return}let i=rt({index:Number(t),maxIndex:this._slides.length-1}),s=this._slides[i],n=r.behavior??"smooth";s&&(this._scrollViewportTo(this._getSlideTargetScrollLeft(s),{behavior:n}),this._setCurrentIndex(i))}_handleSlotChange(){this._syncSlides(),this._updateLayoutStyles(),this.goTo(this._currentIndex,{behavior:"auto"})}_handleClickPrev(){this.prev()}_handleClickNext(){this.next()}_handleViewportKeydown(t){t.key==="ArrowRight"?(t.preventDefault(),this.next()):t.key==="ArrowLeft"&&(t.preventDefault(),this.prev())}_handleViewportScroll(){this._scrollAnimationFrame===null&&(this._dragState?.dragging||this._requestSyncFromScroll())}_handleViewportPointerDown(t){t.pointerType==="mouse"&&(t.button!==0||!this._slides.length||this._eventTargetsInteractiveElement(t)||(this._cancelScrollAnimation(),this._dragState={pointerId:t.pointerId,startX:t.clientX,startScrollLeft:this._viewportElement.scrollLeft,dragging:!1},this._viewportElement.setPointerCapture(t.pointerId),this._viewportElement.addEventListener("pointermove",this._handlePointerMove),this._viewportElement.addEventListener("pointerup",this._handlePointerUp),this._viewportElement.addEventListener("pointercancel",this._handlePointerUp)))}_handlePointerMove(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let r=t.clientX-this._dragState.startX;!this._dragState.dragging&&Math.abs(r)>6&&(this._dragState.dragging=!0,this._setDraggingState(!0)),this._dragState.dragging&&(t.preventDefault(),this._viewportElement.scrollLeft=this._dragState.startScrollLeft-r)}_handlePointerUp(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let r=this._dragState.dragging,i=r?this._findNearestSlideIndex():this._currentIndex;this._viewportElement.hasPointerCapture(t.pointerId)&&this._viewportElement.releasePointerCapture(t.pointerId),this._dragState=null,this._setDraggingState(!1),this._removePointerListeners(),r&&(this._clickSuppressUntil=performance.now()+250,this.snap?this.goTo(i,{behavior:"smooth"}):this._requestSyncFromScroll())}_handleViewportClickCapture(t){performance.now()<this._clickSuppressUntil&&(t.preventDefault(),t.stopPropagation())}_removePointerListeners(){this._viewportElement.removeEventListener("pointermove",this._handlePointerMove),this._viewportElement.removeEventListener("pointerup",this._handlePointerUp),this._viewportElement.removeEventListener("pointercancel",this._handlePointerUp)}_eventTargetsInteractiveElement(t){return t.composedPath().some(r=>r instanceof Element&&r.matches(zs))}_requestSyncFromScroll(){this._scrollFrame!==null&&cancelAnimationFrame(this._scrollFrame),this._scrollFrame=requestAnimationFrame(()=>{this._scrollFrame=null;let t=this._findNearestSlideIndex();this._setCurrentIndex(t)})}_findNearestSlideIndex(){if(!this._slides.length)return 0;let t=this._viewportElement.scrollLeft,r=this._currentIndex,i=Number.POSITIVE_INFINITY;return this._slides.forEach((s,n)=>{let a=Math.abs(this._getSlideTargetScrollLeft(s)-t);a<i&&(r=n,i=a)}),r}_syncSlides(){let t=new Set(this._slides),r=this._slotElement.assignedElements({flatten:!0}).filter(i=>!i.hasAttribute("hidden"));t.forEach(i=>{r.includes(i)||(this._restoreSlideStyles(i),i.removeAttribute("data-rtgl-carousel-active"))}),this._slides=r,this._slides.forEach(i=>{this._slideStyleCache.has(i)||this._slideStyleCache.set(i,{flex:i.style.flex,width:i.style.width,minWidth:i.style.minWidth,maxWidth:i.style.maxWidth,boxSizing:i.style.boxSizing,scrollSnapAlign:i.style.scrollSnapAlign,scrollSnapStop:i.style.scrollSnapStop})}),this._buildPager(),this._setCurrentIndex(rt({index:this._currentIndex,maxIndex:this._slides.length-1}),{emit:!1,reflect:!0})}_restoreSlideStyles(t){let r=this._slideStyleCache.get(t);r&&(t.style.flex=r.flex,t.style.width=r.width,t.style.minWidth=r.minWidth,t.style.maxWidth=r.maxWidth,t.style.boxSizing=r.boxSizing,t.style.scrollSnapAlign=r.scrollSnapAlign,t.style.scrollSnapStop=r.scrollSnapStop)}_updateLayoutStyles(){let t=Tr({slideWidth:this.getAttribute("sw")}),r=Tt(this.getAttribute("sna"))??"center",i=It(this.getAttribute("snap")),s=C(this.getAttribute("g"))??"var(--spacing-md)",n=C(this.getAttribute("spi"))??"0px",a=Tt(this.getAttribute("sbh"))??"smooth",p=Ir({slideWidthCss:t,snapAlign:r});this.style.setProperty("--rtgl-carousel-slide-width",t),this.style.setProperty("--rtgl-carousel-gap",s),this.style.setProperty("--rtgl-carousel-scroll-snap-type",i),this.style.setProperty("--rtgl-carousel-scroll-padding-inline",n),this.style.setProperty("--rtgl-carousel-edge-padding-inline",p),this.style.setProperty("--rtgl-carousel-scroll-behavior",a),this.style.setProperty("--rtgl-carousel-snap-align",r),this._slides.forEach(l=>{l.style.flex=`0 0 ${t}`,l.style.width=t,l.style.minWidth="0",l.style.maxWidth="unset",l.style.boxSizing="border-box",l.style.scrollSnapAlign=r,l.style.scrollSnapStop="always"})}_setDraggingState(t){if(t){this.setAttribute("dragging",""),this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this.removeAttribute("dragging"),this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior=""}_scrollViewportTo(t,r={}){let i=r.behavior??"smooth",s=Math.min(Math.max(t,0),Math.max(this._viewportElement.scrollWidth-this._viewportElement.clientWidth,0));if(i!=="smooth"||Math.abs(s-this._viewportElement.scrollLeft)<1){this._cancelScrollAnimation(),this._viewportElement.scrollLeft=s;return}this._cancelScrollAnimation();let n=this._viewportElement.scrollLeft,a=s-n,p=Math.min(720,Math.max(420,Math.abs(a)*.35)),l=performance.now();this._setAnimatingScrollState(!0);let o=c=>{let d=c-l,u=Math.min(d/p,1),f=Fs(u);if(this._viewportElement.scrollLeft=n+a*f,u<1){this._scrollAnimationFrame=requestAnimationFrame(o);return}this._viewportElement.scrollLeft=s,this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1)};this._scrollAnimationFrame=requestAnimationFrame(o)}_cancelScrollAnimation(){this._scrollAnimationFrame!==null&&(cancelAnimationFrame(this._scrollAnimationFrame),this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1))}_buildPager(){this._pagerElement.replaceChildren(),this._pagerButtons=[],this._slides.forEach((t,r)=>{let i=document.createElement("button");i.type="button",i.setAttribute("part","pager-button"),i.setAttribute("aria-label",`Go to slide ${r+1}`),i.setAttribute("title",`Go to slide ${r+1}`),i.addEventListener("click",()=>{this.goTo(r)}),this._pagerElement.appendChild(i),this._pagerButtons.push(i)}),this._updateControls()}_updateControls(){let t=this._slides.length>0,r=this._slides.length>1,i=this._currentIndex<=0,s=this._currentIndex>=this._slides.length-1,n=r&&this._showsNavControls(),a=r&&this._showsPagerControls();this._prevButton.hidden=!n,this._nextButton.hidden=!n,this._pagerElement.hidden=!a,this._controlsElement.hidden=!a,this._prevButton.disabled=!t||i,this._nextButton.disabled=!t||s,this._pagerButtons.forEach((p,l)=>{let o=l===this._currentIndex;p.classList.toggle("is-active",o),p.disabled=o,p.setAttribute("part",o?"pager-button pager-button-active":"pager-button"),o?p.setAttribute("aria-current","true"):p.removeAttribute("aria-current")})}_setCurrentIndex(t,r={}){let i=rt({index:t,maxIndex:this._slides.length-1}),s=r.emit??!0,n=r.reflect??!0,a=this._currentIndex;this._currentIndex=i,this._slides.forEach((p,l)=>{l===i?p.setAttribute("data-rtgl-carousel-active","true"):p.removeAttribute("data-rtgl-carousel-active")}),this._updateControls(),n&&this.getAttribute("index")!==`${i}`&&(this._isReflectingIndex=!0,this.setAttribute("index",`${i}`)),s&&a!==i&&this.dispatchEvent(new CustomEvent("index-change",{detail:{index:i},bubbles:!0}))}_resolveScrollInlinePosition(){let t=Tt(this.getAttribute("sna"))??"center";return t==="start"||t==="end"||t==="center"?t:"center"}_getSlideTargetScrollLeft(t){let r=this._viewportElement.getBoundingClientRect(),i=t.getBoundingClientRect();if(r.width<=0||i.width<=0)return this._viewportElement.scrollLeft;let s=getComputedStyle(this._viewportElement),n=this._viewportElement.scrollLeft,a=i.left-r.left+n;return Cr({slideLeft:a,slideWidth:i.width,viewportWidth:r.width,scrollPaddingInlineStart:this._parsePx(s.scrollPaddingInlineStart),scrollPaddingInlineEnd:this._parsePx(s.scrollPaddingInlineEnd),snapAlign:this._resolveScrollInlinePosition(),maxScrollLeft:this._viewportElement.scrollWidth-this._viewportElement.clientWidth})}_parsePx(t){let r=Number.parseFloat(t);return Number.isFinite(r)?r:0}_setAnimatingScrollState(t){if(t){this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this._dragState?.dragging||(this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior="")}},Lr=()=>Ot;var Ws={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out"}},j=J(Ws);var it=I`
447
+ `))}static get observedAttributes(){return["index","sw","sna","g","spi","sbh","snap","nav","pager"]}constructor(){super(),e.initializeStyleSheet(),this._slides=[],this._pagerButtons=[],this._currentIndex=0,this._clickSuppressUntil=0,this._dragState=null,this._scrollFrame=null,this._resizeFrame=null,this._scrollAnimationFrame=null,this._isReflectingIndex=!1,this._slideStyleCache=new WeakMap,this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._rootElement=document.createElement("div"),this._rootElement.id="root",this._viewportShellElement=document.createElement("div"),this._viewportShellElement.id="viewport-shell",this._viewportShellElement.setAttribute("part","viewport-shell"),this._viewportElement=document.createElement("div"),this._viewportElement.id="viewport",this._viewportElement.tabIndex=0,this._viewportElement.setAttribute("part","viewport"),this._slotElement=document.createElement("slot"),this._viewportElement.appendChild(this._slotElement),this._controlsElement=document.createElement("div"),this._controlsElement.id="controls",this._controlsElement.setAttribute("part","controls"),this._controlsElement.hidden=!0,this._prevButton=document.createElement("button"),this._prevButton.id="prev-button",this._prevButton.type="button",this._prevButton.hidden=!0,this._prevButton.append(Or("left")),this._prevButton.setAttribute("part","nav-button prev-button"),this._prevButton.setAttribute("aria-label","Previous slide"),this._pagerElement=document.createElement("div"),this._pagerElement.id="pager",this._pagerElement.setAttribute("part","pager"),this._pagerElement.hidden=!0,this._nextButton=document.createElement("button"),this._nextButton.id="next-button",this._nextButton.type="button",this._nextButton.hidden=!0,this._nextButton.append(Or("right")),this._nextButton.setAttribute("part","nav-button next-button"),this._nextButton.setAttribute("aria-label","Next slide"),this._viewportShellElement.append(this._viewportElement,this._prevButton,this._nextButton),this._controlsElement.append(this._pagerElement),this._rootElement.append(this._viewportShellElement,this._controlsElement),this.shadow.append(this._rootElement),this._handleSlotChange=this._handleSlotChange.bind(this),this._handleClickPrev=this._handleClickPrev.bind(this),this._handleClickNext=this._handleClickNext.bind(this),this._handleViewportKeydown=this._handleViewportKeydown.bind(this),this._handleViewportScroll=this._handleViewportScroll.bind(this),this._handleViewportPointerDown=this._handleViewportPointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._handleViewportClickCapture=this._handleViewportClickCapture.bind(this),this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._resizeFrame!==null&&cancelAnimationFrame(this._resizeFrame),this._resizeFrame=requestAnimationFrame(()=>{this._resizeFrame=null,!(this._dragState?.dragging||!this._slides.length)&&this.goTo(this._currentIndex,{behavior:"auto"})})}):null}get index(){return this._currentIndex}set index(t){let r=Number(t);this.setAttribute("index",Number.isFinite(r)?`${r}`:"0")}get snap(){return It(this.getAttribute("snap"))!=="none"}set snap(t){if(t===!1||`${t}`.trim().toLowerCase()==="false"){this.setAttribute("snap","false");return}this.setAttribute("snap","true")}connectedCallback(){this._slotElement.addEventListener("slotchange",this._handleSlotChange),this._prevButton.addEventListener("click",this._handleClickPrev),this._nextButton.addEventListener("click",this._handleClickNext),this._viewportElement.addEventListener("keydown",this._handleViewportKeydown),this._viewportElement.addEventListener("scroll",this._handleViewportScroll,{passive:!0}),this._viewportElement.addEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.addEventListener("click",this._handleViewportClickCapture,!0),this._resizeObserver?.observe(this._viewportElement),this._syncSlides(),this._updateLayoutStyles();let t=this.hasAttribute("index")?Number(this.getAttribute("index")):0;this.goTo(t,{behavior:"auto"})}disconnectedCallback(){this._slotElement.removeEventListener("slotchange",this._handleSlotChange),this._prevButton.removeEventListener("click",this._handleClickPrev),this._nextButton.removeEventListener("click",this._handleClickNext),this._viewportElement.removeEventListener("keydown",this._handleViewportKeydown),this._viewportElement.removeEventListener("scroll",this._handleViewportScroll),this._viewportElement.removeEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.removeEventListener("click",this._handleViewportClickCapture,!0),this._removePointerListeners(),this._resizeObserver?.disconnect(),this._scrollFrame!==null&&(cancelAnimationFrame(this._scrollFrame),this._scrollFrame=null),this._resizeFrame!==null&&(cancelAnimationFrame(this._resizeFrame),this._resizeFrame=null),this._cancelScrollAnimation(),this._setDraggingState(!1),this._slides.forEach(t=>{this._restoreSlideStyles(t),t.removeAttribute("data-rtgl-carousel-active")})}attributeChangedCallback(t,r,i){if(r!==i){if(t==="index"){if(this._isReflectingIndex){this._isReflectingIndex=!1;return}this.goTo(Number(i),{behavior:"smooth"});return}if(t==="nav"||t==="pager"){this._updateControls();return}this._updateLayoutStyles()}}next(){this.goTo(this._currentIndex+1)}prev(){this.goTo(this._currentIndex-1)}_showsNavControls(){return Ct({value:this.getAttribute("nav"),defaultValue:!0})}_showsPagerControls(){return Ct({value:this.getAttribute("pager"),defaultValue:!1})}goTo(t,r={}){if(!this._slides.length){this._setCurrentIndex(0,{emit:!1,reflect:!0});return}let i=tt({index:Number(t),maxIndex:this._slides.length-1}),s=this._slides[i],n=r.behavior??"smooth";s&&(this._scrollViewportTo(this._getSlideTargetScrollLeft(s),{behavior:n}),this._setCurrentIndex(i))}_handleSlotChange(){this._syncSlides(),this._updateLayoutStyles(),this.goTo(this._currentIndex,{behavior:"auto"})}_handleClickPrev(){this.prev()}_handleClickNext(){this.next()}_handleViewportKeydown(t){t.key==="ArrowRight"?(t.preventDefault(),this.next()):t.key==="ArrowLeft"&&(t.preventDefault(),this.prev())}_handleViewportScroll(){this._scrollAnimationFrame===null&&(this._dragState?.dragging||this._requestSyncFromScroll())}_handleViewportPointerDown(t){t.pointerType==="mouse"&&(t.button!==0||!this._slides.length||this._eventTargetsInteractiveElement(t)||(this._cancelScrollAnimation(),this._dragState={pointerId:t.pointerId,startX:t.clientX,startScrollLeft:this._viewportElement.scrollLeft,dragging:!1},this._viewportElement.setPointerCapture(t.pointerId),this._viewportElement.addEventListener("pointermove",this._handlePointerMove),this._viewportElement.addEventListener("pointerup",this._handlePointerUp),this._viewportElement.addEventListener("pointercancel",this._handlePointerUp)))}_handlePointerMove(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let r=t.clientX-this._dragState.startX;!this._dragState.dragging&&Math.abs(r)>6&&(this._dragState.dragging=!0,this._setDraggingState(!0)),this._dragState.dragging&&(t.preventDefault(),this._viewportElement.scrollLeft=this._dragState.startScrollLeft-r)}_handlePointerUp(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let r=this._dragState.dragging,i=r?this._findNearestSlideIndex():this._currentIndex;this._viewportElement.hasPointerCapture(t.pointerId)&&this._viewportElement.releasePointerCapture(t.pointerId),this._dragState=null,this._setDraggingState(!1),this._removePointerListeners(),r&&(this._clickSuppressUntil=performance.now()+250,this.snap?this.goTo(i,{behavior:"smooth"}):this._requestSyncFromScroll())}_handleViewportClickCapture(t){performance.now()<this._clickSuppressUntil&&(t.preventDefault(),t.stopPropagation())}_removePointerListeners(){this._viewportElement.removeEventListener("pointermove",this._handlePointerMove),this._viewportElement.removeEventListener("pointerup",this._handlePointerUp),this._viewportElement.removeEventListener("pointercancel",this._handlePointerUp)}_eventTargetsInteractiveElement(t){return t.composedPath().some(r=>r instanceof Element&&r.matches(zs))}_requestSyncFromScroll(){this._scrollFrame!==null&&cancelAnimationFrame(this._scrollFrame),this._scrollFrame=requestAnimationFrame(()=>{this._scrollFrame=null;let t=this._findNearestSlideIndex();this._setCurrentIndex(t)})}_findNearestSlideIndex(){if(!this._slides.length)return 0;let t=this._viewportElement.scrollLeft,r=this._currentIndex,i=Number.POSITIVE_INFINITY;return this._slides.forEach((s,n)=>{let a=Math.abs(this._getSlideTargetScrollLeft(s)-t);a<i&&(r=n,i=a)}),r}_syncSlides(){let t=new Set(this._slides),r=this._slotElement.assignedElements({flatten:!0}).filter(i=>!i.hasAttribute("hidden"));t.forEach(i=>{r.includes(i)||(this._restoreSlideStyles(i),i.removeAttribute("data-rtgl-carousel-active"))}),this._slides=r,this._slides.forEach(i=>{this._slideStyleCache.has(i)||this._slideStyleCache.set(i,{flex:i.style.flex,width:i.style.width,minWidth:i.style.minWidth,maxWidth:i.style.maxWidth,boxSizing:i.style.boxSizing,scrollSnapAlign:i.style.scrollSnapAlign,scrollSnapStop:i.style.scrollSnapStop})}),this._buildPager(),this._setCurrentIndex(tt({index:this._currentIndex,maxIndex:this._slides.length-1}),{emit:!1,reflect:!0})}_restoreSlideStyles(t){let r=this._slideStyleCache.get(t);r&&(t.style.flex=r.flex,t.style.width=r.width,t.style.minWidth=r.minWidth,t.style.maxWidth=r.maxWidth,t.style.boxSizing=r.boxSizing,t.style.scrollSnapAlign=r.scrollSnapAlign,t.style.scrollSnapStop=r.scrollSnapStop)}_updateLayoutStyles(){let t=Tr({slideWidth:this.getAttribute("sw")}),r=Tt(this.getAttribute("sna"))??"center",i=It(this.getAttribute("snap")),s=C(this.getAttribute("g"))??"var(--spacing-md)",n=C(this.getAttribute("spi"))??"0px",a=Tt(this.getAttribute("sbh"))??"smooth",p=Ir({slideWidthCss:t,snapAlign:r});this.style.setProperty("--rtgl-carousel-slide-width",t),this.style.setProperty("--rtgl-carousel-gap",s),this.style.setProperty("--rtgl-carousel-scroll-snap-type",i),this.style.setProperty("--rtgl-carousel-scroll-padding-inline",n),this.style.setProperty("--rtgl-carousel-edge-padding-inline",p),this.style.setProperty("--rtgl-carousel-scroll-behavior",a),this.style.setProperty("--rtgl-carousel-snap-align",r),this._slides.forEach(l=>{l.style.flex=`0 0 ${t}`,l.style.width=t,l.style.minWidth="0",l.style.maxWidth="unset",l.style.boxSizing="border-box",l.style.scrollSnapAlign=r,l.style.scrollSnapStop="always"})}_setDraggingState(t){if(t){this.setAttribute("dragging",""),this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this.removeAttribute("dragging"),this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior=""}_scrollViewportTo(t,r={}){let i=r.behavior??"smooth",s=Math.min(Math.max(t,0),Math.max(this._viewportElement.scrollWidth-this._viewportElement.clientWidth,0));if(i!=="smooth"||Math.abs(s-this._viewportElement.scrollLeft)<1){this._cancelScrollAnimation(),this._viewportElement.scrollLeft=s;return}this._cancelScrollAnimation();let n=this._viewportElement.scrollLeft,a=s-n,p=Math.min(720,Math.max(420,Math.abs(a)*.35)),l=performance.now();this._setAnimatingScrollState(!0);let o=c=>{let d=c-l,u=Math.min(d/p,1),f=Fs(u);if(this._viewportElement.scrollLeft=n+a*f,u<1){this._scrollAnimationFrame=requestAnimationFrame(o);return}this._viewportElement.scrollLeft=s,this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1)};this._scrollAnimationFrame=requestAnimationFrame(o)}_cancelScrollAnimation(){this._scrollAnimationFrame!==null&&(cancelAnimationFrame(this._scrollAnimationFrame),this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1))}_buildPager(){this._pagerElement.replaceChildren(),this._pagerButtons=[],this._slides.forEach((t,r)=>{let i=document.createElement("button");i.type="button",i.setAttribute("part","pager-button"),i.setAttribute("aria-label",`Go to slide ${r+1}`),i.setAttribute("title",`Go to slide ${r+1}`),i.addEventListener("click",()=>{this.goTo(r)}),this._pagerElement.appendChild(i),this._pagerButtons.push(i)}),this._updateControls()}_updateControls(){let t=this._slides.length>0,r=this._slides.length>1,i=this._currentIndex<=0,s=this._currentIndex>=this._slides.length-1,n=r&&this._showsNavControls(),a=r&&this._showsPagerControls();this._prevButton.hidden=!n,this._nextButton.hidden=!n,this._pagerElement.hidden=!a,this._controlsElement.hidden=!a,this._prevButton.disabled=!t||i,this._nextButton.disabled=!t||s,this._pagerButtons.forEach((p,l)=>{let o=l===this._currentIndex;p.classList.toggle("is-active",o),p.disabled=o,p.setAttribute("part",o?"pager-button pager-button-active":"pager-button"),o?p.setAttribute("aria-current","true"):p.removeAttribute("aria-current")})}_setCurrentIndex(t,r={}){let i=tt({index:t,maxIndex:this._slides.length-1}),s=r.emit??!0,n=r.reflect??!0,a=this._currentIndex;this._currentIndex=i,this._slides.forEach((p,l)=>{l===i?p.setAttribute("data-rtgl-carousel-active","true"):p.removeAttribute("data-rtgl-carousel-active")}),this._updateControls(),n&&this.getAttribute("index")!==`${i}`&&(this._isReflectingIndex=!0,this.setAttribute("index",`${i}`)),s&&a!==i&&this.dispatchEvent(new CustomEvent("index-change",{detail:{index:i},bubbles:!0}))}_resolveScrollInlinePosition(){let t=Tt(this.getAttribute("sna"))??"center";return t==="start"||t==="end"||t==="center"?t:"center"}_getSlideTargetScrollLeft(t){let r=this._viewportElement.getBoundingClientRect(),i=t.getBoundingClientRect();if(r.width<=0||i.width<=0)return this._viewportElement.scrollLeft;let s=getComputedStyle(this._viewportElement),n=this._viewportElement.scrollLeft,a=i.left-r.left+n;return Cr({slideLeft:a,slideWidth:i.width,viewportWidth:r.width,scrollPaddingInlineStart:this._parsePx(s.scrollPaddingInlineStart),scrollPaddingInlineEnd:this._parsePx(s.scrollPaddingInlineEnd),snapAlign:this._resolveScrollInlinePosition(),maxScrollLeft:this._viewportElement.scrollWidth-this._viewportElement.clientWidth})}_parsePx(t){let r=Number.parseFloat(t);return Number.isFinite(r)?r:0}_setAnimatingScrollState(t){if(t){this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this._dragState?.dragging||(this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior="")}},Lr=()=>Ot;var Ws={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out"}},j=G(Ws);var rt=I`
448
448
  :host([sh]:not([sv])) {
449
449
  overflow-x: auto;
450
450
  flex-wrap: nowrap;
@@ -491,8 +491,40 @@ var rettangoli=(()=>{var ve=`
491
491
  overflow: hidden;
492
492
  flex-wrap: nowrap;
493
493
  }
494
+ :host([hsb])::-webkit-scrollbar {
495
+ width: 0;
496
+ height: 0;
497
+ }
494
498
 
495
- `;var ze={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},Ms={bgc:{pr:`
499
+ @media only screen and (max-width: 1280px) {
500
+ :host([xl-hsb])::-webkit-scrollbar {
501
+ width: 0;
502
+ height: 0;
503
+ }
504
+ }
505
+
506
+ @media only screen and (max-width: 1024px) {
507
+ :host([lg-hsb])::-webkit-scrollbar {
508
+ width: 0;
509
+ height: 0;
510
+ }
511
+ }
512
+
513
+ @media only screen and (max-width: 768px) {
514
+ :host([md-hsb])::-webkit-scrollbar {
515
+ width: 0;
516
+ height: 0;
517
+ }
518
+ }
519
+
520
+ @media only screen and (max-width: 640px) {
521
+ :host([sm-hsb])::-webkit-scrollbar {
522
+ width: 0;
523
+ height: 0;
524
+ }
525
+ }
526
+
527
+ `;var De={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},Ms={bgc:{pr:`
496
528
  background-color: var(--primary);
497
529
  `,se:`
498
530
  background-color: var(--secondary);
@@ -532,7 +564,7 @@ var rettangoli=(()=>{var ve=`
532
564
  left: 0;
533
565
  top: 0;
534
566
  height: 100%;
535
- `},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:L,pr:L,pb:L,pl:L,p:L,ph:L,pv:L,g:L,gv:L,gh:L,bw:ze,bwt:ze,bwr:ze,bwb:ze,bwl:ze,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},st=J(Ms);var Ks={mt:L,mr:L,mb:L,ml:L,m:L,mh:L,mv:L},F=J(Ks);var Te=I`
567
+ `},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:L,pr:L,pb:L,pl:L,p:L,ph:L,pv:L,g:L,gv:L,gh:L,bw:De,bwt:De,bwr:De,bwb:De,bwl:De,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},it=G(Ms);var Ks={mt:L,mr:L,mb:L,ml:L,m:L,mh:L,mv:L},F=G(Ks);var Ie=I`
536
568
  a, a:link, a:visited, a:hover, a:active {
537
569
  color: inherit;
538
570
  text-decoration: none;
@@ -556,13 +588,13 @@ var rettangoli=(()=>{var ve=`
556
588
  border-color: var(--border);
557
589
  }
558
590
 
559
- ${it}
591
+ ${rt}
560
592
  ${F}
561
593
  ${j}
562
- ${st}
563
- ${Te}
594
+ ${it}
595
+ ${Ie}
564
596
  ${ve}
565
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...G([...oe,"cols","op","wh","w","h","hide","show","sh","sv","z","overflow"])]}_styles=M();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=we({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:r,rel:i})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=M(),te.forEach(r=>{let i=f=>`${r==="default"?"":`${r}-`}${f}`,s=this.getAttribute(i("wh")),n=C(s===null?this.getAttribute(i("w")):s),a=C(s===null?this.getAttribute(i("h")):s),p=Us(this.getAttribute(i("cols"))),l=this.getAttribute(i("op")),o=this.getAttribute(i("z"));p!==null&&(this._styles[r]["grid-template-columns"]=p),o!==null&&(this._styles[r]["z-index"]=o),l!==null&&(this._styles[r].opacity=l),K({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),K({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="grid");let c=this.hasAttribute(i("sh")),d=this.hasAttribute(i("sv")),u=this.getAttribute(i("overflow"));c&&d?(this._styles[r].overflow="auto",this._styles[r]["scrollbar-gutter"]="stable"):c?(this._styles[r]["overflow-x"]="auto",this._styles[r]["scrollbar-gutter"]="stable"):d&&(this._styles[r]["overflow-y"]="auto",this._styles[r]["scrollbar-gutter"]="stable"),u==="hidden"&&(this._styles[r].overflow="hidden")});let t=Y(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,r,i){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}r!==i&&this.updateStyles()}},Nr=({render:e,html:t})=>Lt;var Rr=I`
597
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...q([...oe,"cols","op","wh","w","h","hide","show","sh","sv","z","overflow"])]}_styles=W();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=we({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:r,rel:i})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=W(),te.forEach(r=>{let i=f=>`${r==="default"?"":`${r}-`}${f}`,s=this.getAttribute(i("wh")),n=C(s===null?this.getAttribute(i("w")):s),a=C(s===null?this.getAttribute(i("h")):s),p=Us(this.getAttribute(i("cols"))),l=this.getAttribute(i("op")),o=this.getAttribute(i("z"));p!==null&&(this._styles[r]["grid-template-columns"]=p),o!==null&&(this._styles[r]["z-index"]=o),l!==null&&(this._styles[r].opacity=l),M({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),M({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="grid");let c=this.hasAttribute(i("sh")),d=this.hasAttribute(i("sv")),u=this.getAttribute(i("overflow"));c&&d?(this._styles[r].overflow="auto",this._styles[r]["scrollbar-gutter"]="stable"):c?(this._styles[r]["overflow-x"]="auto",this._styles[r]["scrollbar-gutter"]="stable"):d&&(this._styles[r]["overflow-y"]="auto",this._styles[r]["scrollbar-gutter"]="stable"),u==="hidden"&&(this._styles[r].overflow="hidden")});let t=J(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,r,i){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}r!==i&&this.updateStyles()}},Nr=({render:e,html:t})=>Lt;var Rr=I`
566
598
 
567
599
  :host([d="h"]) {
568
600
  flex-direction: row;
@@ -633,7 +665,7 @@ var rettangoli=(()=>{var ve=`
633
665
  justify-content: center;
634
666
  }
635
667
  }
636
- `;var _e=e=>{if(e==null)return null;let t=`${e}`.trim();return t.length>0?t:null},Hs=e=>{let t=_e(e);return t===null?null:C(t)},Nt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
668
+ `;var st=e=>{if(e==null)return null;let t=`${e}`.trim();return t.length>0?t:null},Nt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
637
669
  slot {
638
670
  display: contents;
639
671
  }
@@ -649,14 +681,14 @@ var rettangoli=(()=>{var ve=`
649
681
  }
650
682
 
651
683
 
652
- ${it}
684
+ ${rt}
653
685
  ${Rr}
654
686
  ${F}
655
687
  ${j}
656
- ${st}
657
- ${Te}
688
+ ${it}
689
+ ${Ie}
658
690
  ${ve}
659
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...G([...oe,"op","wh","w","h","ar","bgi","bgs","bgp","bgr","sbh","spi","stg","hide","show","sh","sv","z","d","ah","av","wrap","no-wrap","overflow"])]}_styles=M();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=we({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:r,rel:i})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=M(),te.forEach(r=>{let i=W=>`${r==="default"?"":`${r}-`}${W}`,s=this.getAttribute(i("wh")),n=C(s===null?this.getAttribute(i("w")):s),a=C(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z")),o=De(this.getAttribute(i("ar"))),c=_e(this.getAttribute(i("bgi"))),d=_e(this.getAttribute(i("bgs"))),u=_e(this.getAttribute(i("bgp"))),f=_e(this.getAttribute(i("bgr"))),h=_e(this.getAttribute(i("sbh"))),m=Hs(this.getAttribute(i("spi"))),g=_e(this.getAttribute(i("stg")));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),o!==void 0&&(this._styles[r]["aspect-ratio"]=o),c!==null&&(this._styles[r]["background-image"]=c),d!==null&&(this._styles[r]["background-size"]=d),u!==null&&(this._styles[r]["background-position"]=u),f!==null&&(this._styles[r]["background-repeat"]=f),h!==null&&(this._styles[r]["scroll-behavior"]=h),m!==null&&(this._styles[r]["scroll-padding-inline"]=m),g!==null&&(this._styles[r]["scroll-target-group"]=g),K({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),K({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="flex");let b=this.getAttribute(i("d")),y=this.getAttribute(i("ah")),_=this.getAttribute(i("av")),S=Et({element:this,size:r,attr:"d"});b==="h"?this._styles[r]["flex-direction"]="row":b==="v"?this._styles[r]["flex-direction"]="column":r==="default"&&!b&&["sm","md","lg","xl"].some(X=>this.hasAttribute(`${X}-d`))&&(this._styles[r]["flex-direction"]="column");let A=S==="h",E=S==="v"||!S;A&&(y==="c"?this._styles[r]["justify-content"]="center":y==="e"?this._styles[r]["justify-content"]="flex-end":y==="s"&&(this._styles[r]["justify-content"]="flex-start"),_==="c"?(this._styles[r]["align-items"]="center",this._styles[r]["align-content"]="center"):_==="e"?(this._styles[r]["align-items"]="flex-end",this._styles[r]["align-content"]="flex-end"):_==="s"&&(this._styles[r]["align-items"]="flex-start")),E&&(y!==null||_!==null)&&(y==="c"?this._styles[r]["align-items"]="center":y==="e"?this._styles[r]["align-items"]="flex-end":y==="s"&&(this._styles[r]["align-items"]="flex-start"),_==="c"?this._styles[r]["justify-content"]="center":_==="e"?this._styles[r]["justify-content"]="flex-end":_==="s"&&(this._styles[r]["justify-content"]="flex-start"));let O=this.hasAttribute(i("wrap")),T=this.hasAttribute(i("no-wrap"));O&&(this._styles[r]["flex-wrap"]="wrap"),T&&(this._styles[r]["flex-wrap"]="nowrap");let V=this.hasAttribute(i("sh")),z=this.hasAttribute(i("sv")),D=this.getAttribute(i("overflow"));V&&z?(this._styles[r].overflow="auto",this._styles[r]["scrollbar-gutter"]="stable",this._styles[r]["flex-wrap"]="nowrap"):V?(this._styles[r]["overflow-x"]="auto",this._styles[r]["scrollbar-gutter"]="stable",this._styles[r]["flex-wrap"]="nowrap"):z&&(this._styles[r]["overflow-y"]="auto",this._styles[r]["scrollbar-gutter"]="stable",this._styles[r]["flex-wrap"]="nowrap"),D==="hidden"&&(this._styles[r].overflow="hidden",this._styles[r]["flex-wrap"]="nowrap")});let t=Y(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,r,i){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}r!==i&&this.updateStyles()}},Vr=({render:e,html:t})=>Nt;var qs={ta:{s:"text-align: start;",c:"text-align: center;",e:"text-align: end;",j:"text-align: justify;"},s:{h1:`
691
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...q([...oe,"op","wh","w","h","ar","bgi","bgs","bgp","bgr","hsb","hide","show","sh","sv","z","d","ah","av","wrap","no-wrap","overflow"])]}_styles=W();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=we({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:r,rel:i})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=W(),te.forEach(r=>{let i=z=>`${r==="default"?"":`${r}-`}${z}`,s=this.getAttribute(i("wh")),n=C(s===null?this.getAttribute(i("w")):s),a=C(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z")),o=Be(this.getAttribute(i("ar"))),c=st(this.getAttribute(i("bgi"))),d=st(this.getAttribute(i("bgs"))),u=st(this.getAttribute(i("bgp"))),f=st(this.getAttribute(i("bgr")));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),o!==void 0&&(this._styles[r]["aspect-ratio"]=o),c!==null&&(this._styles[r]["background-image"]=c),d!==null&&(this._styles[r]["background-size"]=d),u!==null&&(this._styles[r]["background-position"]=u),f!==null&&(this._styles[r]["background-repeat"]=f),M({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),M({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="flex");let h=this.getAttribute(i("d")),m=this.getAttribute(i("ah")),y=this.getAttribute(i("av")),b=Et({element:this,size:r,attr:"d"});h==="h"?this._styles[r]["flex-direction"]="row":h==="v"?this._styles[r]["flex-direction"]="column":r==="default"&&!h&&["sm","md","lg","xl"].some(D=>this.hasAttribute(`${D}-d`))&&(this._styles[r]["flex-direction"]="column");let g=b==="h",_=b==="v"||!b;g&&(m==="c"?this._styles[r]["justify-content"]="center":m==="e"?this._styles[r]["justify-content"]="flex-end":m==="s"&&(this._styles[r]["justify-content"]="flex-start"),y==="c"?(this._styles[r]["align-items"]="center",this._styles[r]["align-content"]="center"):y==="e"?(this._styles[r]["align-items"]="flex-end",this._styles[r]["align-content"]="flex-end"):y==="s"&&(this._styles[r]["align-items"]="flex-start")),_&&(m!==null||y!==null)&&(m==="c"?this._styles[r]["align-items"]="center":m==="e"?this._styles[r]["align-items"]="flex-end":m==="s"&&(this._styles[r]["align-items"]="flex-start"),y==="c"?this._styles[r]["justify-content"]="center":y==="e"?this._styles[r]["justify-content"]="flex-end":y==="s"&&(this._styles[r]["justify-content"]="flex-start"));let S=this.hasAttribute(i("wrap")),A=this.hasAttribute(i("no-wrap"));S&&(this._styles[r]["flex-wrap"]="wrap"),A&&(this._styles[r]["flex-wrap"]="nowrap");let E=this.hasAttribute(i("sh")),T=this.hasAttribute(i("sv")),O=this.hasAttribute(i("hsb")),V=this.getAttribute(i("overflow"));E&&T?(this._styles[r].overflow="auto",this._styles[r]["scrollbar-gutter"]="stable",this._styles[r]["flex-wrap"]="nowrap"):E?(this._styles[r]["overflow-x"]="auto",this._styles[r]["scrollbar-gutter"]="stable",this._styles[r]["flex-wrap"]="nowrap"):T&&(this._styles[r]["overflow-y"]="auto",this._styles[r]["scrollbar-gutter"]="stable",this._styles[r]["flex-wrap"]="nowrap"),V==="hidden"&&(this._styles[r].overflow="hidden",this._styles[r]["flex-wrap"]="nowrap"),O&&(this._styles[r]["-ms-overflow-style"]="none",this._styles[r]["scrollbar-gutter"]="auto",this._styles[r]["scrollbar-width"]="none")});let t=J(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,r,i){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}r!==i&&this.updateStyles()}},Vr=({render:e,html:t})=>Nt;var Hs={ta:{s:"text-align: start;",c:"text-align: center;",e:"text-align: end;",j:"text-align: justify;"},s:{h1:`
660
692
  font-size: var(--h1-font-size);
661
693
  font-weight: var(--h1-font-weight);
662
694
  line-height: var(--h1-line-height);
@@ -696,7 +728,7 @@ var rettangoli=(()=>{var ve=`
696
728
  font-weight: var(--xs-font-weight);
697
729
  line-height: var(--xs-line-height);
698
730
  letter-spacing: var(--xs-letter-spacing);
699
- `}},jr=J(qs);var Gs={c:{pr:"color: var(--primary);",se:"color: var(--secondary);",de:"color: var(--destructive);",fg:"color: var(--foreground);",bg:"color: var(--background);",mu:"color: var(--muted-foreground);",ac:"color: var(--accent);",bo:"color: var(--border);",tr:"color: transparent;","pr-fg":"color: var(--primary-foreground);","se-fg":"color: var(--secondary-foreground);","de-fg":"color: var(--destructive-foreground);","mu-fg":"color: var(--muted-foreground);","ac-fg":"color: var(--accent-foreground);"}},nt=J(Gs);var Rt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
731
+ `}},jr=G(Hs);var qs={c:{pr:"color: var(--primary);",se:"color: var(--secondary);",de:"color: var(--destructive);",fg:"color: var(--foreground);",bg:"color: var(--background);",mu:"color: var(--muted-foreground);",ac:"color: var(--accent);",bo:"color: var(--border);",tr:"color: transparent;","pr-fg":"color: var(--primary-foreground);","se-fg":"color: var(--secondary-foreground);","de-fg":"color: var(--destructive-foreground);","mu-fg":"color: var(--muted-foreground);","ac-fg":"color: var(--accent-foreground);"}},nt=G(qs);var Rt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
700
732
  :host {
701
733
  display: block;
702
734
  font-size: var(--md-font-size);
@@ -720,7 +752,7 @@ var rettangoli=(()=>{var ve=`
720
752
  ${nt}
721
753
  ${F}
722
754
  ${j}
723
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","new-tab","rel"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,r,i){t==="href"||t==="new-tab"||t==="rel"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=C(this.getAttribute("w"));this.hasAttribute("ellipsis")?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace=""),Be({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=we({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:r,rel:i})}},Pr=({render:e,html:t})=>Rt;var Fe={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},Js={bgc:{pr:"background-color: var(--primary);",se:"background-color: var(--secondary);",de:"background-color: var(--destructive);",fg:"background-color: var(--foreground);",bg:"background-color: var(--background);",mu:"background-color: var(--muted);",ac:"background-color: var(--accent);",bo:"background-color: var(--border);"},pos:{rel:"relative",abs:"absolute",fix:"fixed"},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},bw:Fe,bwt:Fe,bwr:Fe,bwb:Fe,bwl:Fe,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},Br=e=>J(Js,{},e);var Ys={mt:L,mr:L,mb:L,ml:L,m:L,mh:L,mv:L},Dr=e=>J(Ys,{},e);var Vt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
755
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","new-tab","rel"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,r,i){t==="href"||t==="new-tab"||t==="rel"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=C(this.getAttribute("w"));this.hasAttribute("ellipsis")?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace=""),Pe({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=we({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:r,rel:i})}},Pr=({render:e,html:t})=>Rt;var ze={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},Gs={bgc:{pr:"background-color: var(--primary);",se:"background-color: var(--secondary);",de:"background-color: var(--destructive);",fg:"background-color: var(--foreground);",bg:"background-color: var(--background);",mu:"background-color: var(--muted);",ac:"background-color: var(--accent);",bo:"background-color: var(--border);"},pos:{rel:"relative",abs:"absolute",fix:"fixed"},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},bw:ze,bwt:ze,bwr:ze,bwb:ze,bwl:ze,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},Br=e=>G(Gs,{},e);var Js={mt:L,mr:L,mb:L,ml:L,m:L,mh:L,mv:L},Dr=e=>G(Js,{},e);var Vt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
724
756
  :host {
725
757
  display: contents;
726
758
  }
@@ -747,7 +779,7 @@ var rettangoli=(()=>{var ve=`
747
779
  height: auto;
748
780
  }
749
781
 
750
- ${Te}
782
+ ${Ie}
751
783
 
752
784
  a {
753
785
  display: block;
@@ -758,7 +790,7 @@ var rettangoli=(()=>{var ve=`
758
790
  ${Br("img, a")}
759
791
  ${Dr("img, a")}
760
792
  ${j}
761
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return G([...oe,"key","src","alt","href","new-tab","rel","wh","w","h","ar","hide","show","op","z","of"])}_styles=M();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=At({shadowRoot:this.shadow,childElement:this._imgElement,linkElement:this._linkElement,href:t,newTab:r,rel:i})}connectedCallback(){this._updateImageAttributes(),this.updateStyles()}attributeChangedCallback(t,r,i){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}if(t==="src"||t==="alt"){this._updateImageAttributes();return}r!==i&&this.updateStyles()}updateStyles(){this._styles=M(),te.forEach(r=>{let i=c=>`${r==="default"?"":`${r}-`}${c}`,s=this.getAttribute(i("wh")),n=C(s===null?this.getAttribute(i("w")):s),a=C(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z")),o=De(this.getAttribute(i("ar")));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),o!==void 0&&(this._styles[r]["aspect-ratio"]=o),K({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),K({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none !important"),this.hasAttribute(i("show"))&&(this._styles[r].display="block !important")});let t=Y(this._styles,"img, a");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_updateImageAttributes(){let t=this.getAttribute("src"),r=this.getAttribute("alt");t!==null?this._imgElement.setAttribute("src",t):this._imgElement.removeAttribute("src"),r!==null?this._imgElement.setAttribute("alt",r):this._imgElement.removeAttribute("alt")}},zr=({render:e,html:t})=>Vt;var Xs={s:{sm:`
793
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return q([...oe,"key","src","alt","href","new-tab","rel","wh","w","h","ar","hide","show","op","z","of"])}_styles=W();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=At({shadowRoot:this.shadow,childElement:this._imgElement,linkElement:this._linkElement,href:t,newTab:r,rel:i})}connectedCallback(){this._updateImageAttributes(),this.updateStyles()}attributeChangedCallback(t,r,i){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}if(t==="src"||t==="alt"){this._updateImageAttributes();return}r!==i&&this.updateStyles()}updateStyles(){this._styles=W(),te.forEach(r=>{let i=c=>`${r==="default"?"":`${r}-`}${c}`,s=this.getAttribute(i("wh")),n=C(s===null?this.getAttribute(i("w")):s),a=C(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z")),o=Be(this.getAttribute(i("ar")));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),o!==void 0&&(this._styles[r]["aspect-ratio"]=o),M({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),M({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none !important"),this.hasAttribute(i("show"))&&(this._styles[r].display="block !important")});let t=J(this._styles,"img, a");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_updateImageAttributes(){let t=this.getAttribute("src"),r=this.getAttribute("alt");t!==null?this._imgElement.setAttribute("src",t):this._imgElement.removeAttribute("src"),r!==null?this._imgElement.setAttribute("alt",r):this._imgElement.removeAttribute("alt")}},zr=({render:e,html:t})=>Vt;var Ys={s:{sm:`
762
794
  height: 20px;
763
795
  padding-left: 8px;
764
796
  padding-right: 8px;
@@ -811,7 +843,7 @@ var rettangoli=(()=>{var ve=`
811
843
  background-color: var(--destructive);
812
844
  color: var(--destructive-foreground);
813
845
  border-color: transparent;
814
- `}},Fr=J(Xs,{},".surface");var jt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
846
+ `}},Fr=G(Ys,{},".surface");var jt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
815
847
  :host {
816
848
  display: inline-flex;
817
849
  min-width: 0;
@@ -913,7 +945,7 @@ var rettangoli=(()=>{var ve=`
913
945
  }
914
946
  ${F}
915
947
  ${j}
916
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._surfaceElement=document.createElement("span"),this._surfaceElement.className="surface",this._surfaceElement.setAttribute("part","surface"),this._labelElement=document.createElement("span"),this._labelElement.className="label",this._labelElement.setAttribute("part","label"),this._slotElement=document.createElement("slot"),this._labelElement.appendChild(this._slotElement),this._surfaceElement.appendChild(this._labelElement),this.shadow.appendChild(this._surfaceElement),this._prefixIcon=null,this._suffixIcon=null,this._removeButton=null,this._onRemoveClick=this._onRemoveClick.bind(this)}static get observedAttributes(){return["key","pre","suf","removable","w"]}connectedCallback(){this._updateWidth(),this._updateStructure()}attributeChangedCallback(t,r,i){if(t==="w"){this._updateWidth();return}r!==i&&this._updateStructure()}_updateWidth(){let t=C(this.getAttribute("w"));Be({style:this.style,width:t,flexMinWidth:"0"})}_createIconElement(t,r){let i=document.createElement("rtgl-svg");return i.className=t,i.setAttribute("part",r),i.setAttribute("aria-hidden","true"),i}_syncIcon({iconName:t,element:r,className:i,part:s,insertBeforeElement:n}){if(!t)return r&&r.remove(),null;let a=r||this._createIconElement(i,s);return a.setAttribute("svg",t),a.parentNode!==this._surfaceElement?this._surfaceElement.insertBefore(a,n):a.nextSibling!==n&&this._surfaceElement.insertBefore(a,n),a}_syncRemoveButton(){if(!this.hasAttribute("removable")){this._removeButton&&(this._removeButton.removeEventListener("click",this._onRemoveClick),this._removeButton.remove(),this._removeButton=null);return}this._removeButton||(this._removeButton=document.createElement("button"),this._removeButton.type="button",this._removeButton.className="removeButton",this._removeButton.setAttribute("part","remove-button"),this._removeButton.setAttribute("aria-label","Remove tag"),this._removeButton.addEventListener("click",this._onRemoveClick),this._surfaceElement.appendChild(this._removeButton))}_updateStructure(){this._prefixIcon=this._syncIcon({iconName:this.getAttribute("pre"),element:this._prefixIcon,className:"prefixIcon",part:"prefix-icon",insertBeforeElement:this._labelElement}),this._syncRemoveButton(),this._suffixIcon=this._syncIcon({iconName:this.getAttribute("suf"),element:this._suffixIcon,className:"suffixIcon",part:"suffix-icon",insertBeforeElement:this._removeButton})}_onRemoveClick(t){t.preventDefault(),t.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-click",{detail:{value:this.getAttribute("value")},bubbles:!0,composed:!0}))}},Wr=({render:e,html:t})=>jt;var Mr=I`
948
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._surfaceElement=document.createElement("span"),this._surfaceElement.className="surface",this._surfaceElement.setAttribute("part","surface"),this._labelElement=document.createElement("span"),this._labelElement.className="label",this._labelElement.setAttribute("part","label"),this._slotElement=document.createElement("slot"),this._labelElement.appendChild(this._slotElement),this._surfaceElement.appendChild(this._labelElement),this.shadow.appendChild(this._surfaceElement),this._prefixIcon=null,this._suffixIcon=null,this._removeButton=null,this._onRemoveClick=this._onRemoveClick.bind(this)}static get observedAttributes(){return["key","pre","suf","removable","w"]}connectedCallback(){this._updateWidth(),this._updateStructure()}attributeChangedCallback(t,r,i){if(t==="w"){this._updateWidth();return}r!==i&&this._updateStructure()}_updateWidth(){let t=C(this.getAttribute("w"));Pe({style:this.style,width:t,flexMinWidth:"0"})}_createIconElement(t,r){let i=document.createElement("rtgl-svg");return i.className=t,i.setAttribute("part",r),i.setAttribute("aria-hidden","true"),i}_syncIcon({iconName:t,element:r,className:i,part:s,insertBeforeElement:n}){if(!t)return r&&r.remove(),null;let a=r||this._createIconElement(i,s);return a.setAttribute("svg",t),a.parentNode!==this._surfaceElement?this._surfaceElement.insertBefore(a,n):a.nextSibling!==n&&this._surfaceElement.insertBefore(a,n),a}_syncRemoveButton(){if(!this.hasAttribute("removable")){this._removeButton&&(this._removeButton.removeEventListener("click",this._onRemoveClick),this._removeButton.remove(),this._removeButton=null);return}this._removeButton||(this._removeButton=document.createElement("button"),this._removeButton.type="button",this._removeButton.className="removeButton",this._removeButton.setAttribute("part","remove-button"),this._removeButton.setAttribute("aria-label","Remove tag"),this._removeButton.addEventListener("click",this._onRemoveClick),this._surfaceElement.appendChild(this._removeButton))}_updateStructure(){this._prefixIcon=this._syncIcon({iconName:this.getAttribute("pre"),element:this._prefixIcon,className:"prefixIcon",part:"prefix-icon",insertBeforeElement:this._labelElement}),this._syncRemoveButton(),this._suffixIcon=this._syncIcon({iconName:this.getAttribute("suf"),element:this._suffixIcon,className:"suffixIcon",part:"suffix-icon",insertBeforeElement:this._removeButton})}_onRemoveClick(t){t.preventDefault(),t.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-click",{detail:{value:this.getAttribute("value")},bubbles:!0,composed:!0}))}},Wr=({render:e,html:t})=>jt;var Mr=I`
917
949
  :host([pt="xs"]) svg {
918
950
  padding-top: var(--spacing-xs);
919
951
  }
@@ -1038,7 +1070,7 @@ var rettangoli=(()=>{var ve=`
1038
1070
  ${Mr}
1039
1071
  ${F}
1040
1072
  ${j}
1041
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return e._icons}static addIcon(t,r){e._icons[t]=r}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,r,i){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),r=C(t===null?this.getAttribute("w"):t),i=C(t===null?this.getAttribute("h"):t);r!=null?this.style.width=r:this.style.width="",i!=null?this.style.height=i:this.style.height=""}_render(){try{let t=this.getAttribute("svg"),r=e._icons[t]||(window.rtglIcons||{})[t];if(r){this.shadow.innerHTML=r;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},Kr=({render:e,html:t})=>Pt;var Qs=["mt","mr","mb","ml","m","mh","mv","cur"],Bt=class e extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["type","disabled","min","max","step","s"];static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
1073
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return e._icons}static addIcon(t,r){e._icons[t]=r}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,r,i){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),r=C(t===null?this.getAttribute("w"):t),i=C(t===null?this.getAttribute("h"):t);r!=null?this.style.width=r:this.style.width="",i!=null?this.style.height=i:this.style.height=""}_render(){try{let t=this.getAttribute("svg"),r=e._icons[t]||(window.rtglIcons||{})[t];if(r){this.shadow.innerHTML=r;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},Kr=({render:e,html:t})=>Pt;var Xs=["mt","mr","mb","ml","m","mh","mv","cur"],Bt=class e extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["type","disabled","min","max","step","s"];static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
1042
1074
  :host {
1043
1075
  display: contents;
1044
1076
  }
@@ -1102,7 +1134,7 @@ var rettangoli=(()=>{var ve=`
1102
1134
  }
1103
1135
  ${F}
1104
1136
  ${j}
1105
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=M(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","min","max","step","s",...G([...Qs,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,r,i){if(r!==i){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(e.inputSpecificAttributes.includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=M(),te.forEach(r=>{let i=o=>`${r==="default"?"":`${r}-`}${o}`,s=this.getAttribute(i("wh")),n=C(s===null?this.getAttribute(i("w")):s),a=C(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),K({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),K({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="block")});let t=Y(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,r){if(r==null||r==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,r)}_syncValueAttribute(){this._inputElement.value=this.getAttribute("value")??""}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("type"),i=new Set(["text","password","date","time","datetime-local"]).has(t)?t:"text",s=this.getAttribute("min"),n=this.getAttribute("max"),a=this.getAttribute("step"),p=this.hasAttribute("disabled");this._setOrRemoveInputAttribute("type",i),this._setOrRemoveInputAttribute("min",s),this._setOrRemoveInputAttribute("max",n),this._setOrRemoveInputAttribute("step",a),p?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},ye=({render:e,html:t})=>Bt;var Zs=ye({}),We="date",Dt=class extends Zs{connectedCallback(){this.getAttribute("type")!==We&&super.setAttribute("type",We),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,r,i){if(t==="type"&&i!==We){this.getAttribute("type")!==We&&super.setAttribute("type",We);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,r,i)}},Ur=({render:e,html:t})=>Dt;var en=ye({}),Me="time",zt=class extends en{connectedCallback(){this.getAttribute("type")!==Me&&super.setAttribute("type",Me),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,r,i){if(t==="type"&&i!==Me){this.getAttribute("type")!==Me&&super.setAttribute("type",Me);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,r,i)}},Hr=({render:e,html:t})=>zt;var tn=ye({}),Ke="datetime-local",Ft=class extends tn{connectedCallback(){this.getAttribute("type")!==Ke&&super.setAttribute("type",Ke),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,r,i){if(t==="type"&&i!==Ke){this.getAttribute("type")!==Ke&&super.setAttribute("type",Ke);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,r,i)}},qr=({render:e,html:t})=>Ft;var rn=["mt","mr","mb","ml","m","mh","mv","cur"],Wt=class e extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["disabled","step","min","max","s"];static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
1137
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=W(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","min","max","step","s",...q([...Xs,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,r,i){if(r!==i){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(e.inputSpecificAttributes.includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=W(),te.forEach(r=>{let i=o=>`${r==="default"?"":`${r}-`}${o}`,s=this.getAttribute(i("wh")),n=C(s===null?this.getAttribute(i("w")):s),a=C(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),M({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),M({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="block")});let t=J(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,r){if(r==null||r==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,r)}_syncValueAttribute(){this._inputElement.value=this.getAttribute("value")??""}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("type"),i=new Set(["text","password","date","time","datetime-local"]).has(t)?t:"text",s=this.getAttribute("min"),n=this.getAttribute("max"),a=this.getAttribute("step"),p=this.hasAttribute("disabled");this._setOrRemoveInputAttribute("type",i),this._setOrRemoveInputAttribute("min",s),this._setOrRemoveInputAttribute("max",n),this._setOrRemoveInputAttribute("step",a),p?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},ye=({render:e,html:t})=>Bt;var Qs=ye({}),Fe="date",Dt=class extends Qs{connectedCallback(){this.getAttribute("type")!==Fe&&super.setAttribute("type",Fe),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,r,i){if(t==="type"&&i!==Fe){this.getAttribute("type")!==Fe&&super.setAttribute("type",Fe);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,r,i)}},Ur=({render:e,html:t})=>Dt;var Zs=ye({}),We="time",zt=class extends Zs{connectedCallback(){this.getAttribute("type")!==We&&super.setAttribute("type",We),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,r,i){if(t==="type"&&i!==We){this.getAttribute("type")!==We&&super.setAttribute("type",We);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,r,i)}},Hr=({render:e,html:t})=>zt;var en=ye({}),Me="datetime-local",Ft=class extends en{connectedCallback(){this.getAttribute("type")!==Me&&super.setAttribute("type",Me),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,r,i){if(t==="type"&&i!==Me){this.getAttribute("type")!==Me&&super.setAttribute("type",Me);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,r,i)}},qr=({render:e,html:t})=>Ft;var tn=["mt","mr","mb","ml","m","mh","mv","cur"],Wt=class e extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["disabled","step","min","max","s"];static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
1106
1138
  :host {
1107
1139
  display: contents;
1108
1140
  }
@@ -1137,7 +1169,7 @@ var rettangoli=(()=>{var ve=`
1137
1169
  }
1138
1170
  ${F}
1139
1171
  ${j}
1140
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=M(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","placeholder","disabled","value","step","min","max","s",...G([...rn,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_emitValueEvent=t=>{let r=this._inputElement.value;if(r.trim()===""){this.dispatchEvent(new CustomEvent(t,{detail:{value:null},bubbles:!0}));return}let i=parseFloat(r);isNaN(i)||(i=this._clampValueToBounds(i),this._inputElement.value=i.toString(),this.dispatchEvent(new CustomEvent(t,{detail:{value:i},bubbles:!0})))};_onInput=()=>{this._emitValueEvent("value-input")};_onChange=()=>{this._emitValueEvent("value-change")};attributeChangedCallback(t,r,i){if(r!==i){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(e.inputSpecificAttributes.includes(t)){this._updateInputAttributes(),(t==="min"||t==="max")&&this._syncValueAttribute();return}this.updateStyles()}}updateStyles(){this._styles=M(),te.forEach(r=>{let i=o=>`${r==="default"?"":`${r}-`}${o}`,s=this.getAttribute(i("wh")),n=C(s===null?this.getAttribute(i("w")):s),a=C(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),K({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),K({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="block")});let t=Y(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,r){if(r==null||r==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,r)}_clampValueToBounds(t){let r=t,i=this.getAttribute("min");if(i!==null){let n=parseFloat(i);isNaN(n)||(r=Math.max(r,n))}let s=this.getAttribute("max");if(s!==null){let n=parseFloat(s);isNaN(n)||(r=Math.min(r,n))}return r}_syncValueAttribute(){let t=this.getAttribute("value");if(t==null||t===""){this._inputElement.value="";return}let r=parseFloat(t);if(isNaN(r)){this._inputElement.value="";return}let i=this._clampValueToBounds(r);this._inputElement.value=i.toString()}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("step"),r=this.getAttribute("min"),i=this.getAttribute("max"),s=this.hasAttribute("disabled");this._inputElement.setAttribute("type","number"),this._setOrRemoveInputAttribute("step",t),this._setOrRemoveInputAttribute("min",r),this._setOrRemoveInputAttribute("max",i),s?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},Gr=({render:e,html:t})=>Wt;var Mt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
1172
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=W(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","placeholder","disabled","value","step","min","max","s",...q([...tn,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_emitValueEvent=t=>{let r=this._inputElement.value;if(r.trim()===""){this.dispatchEvent(new CustomEvent(t,{detail:{value:null},bubbles:!0}));return}let i=parseFloat(r);isNaN(i)||(i=this._clampValueToBounds(i),this._inputElement.value=i.toString(),this.dispatchEvent(new CustomEvent(t,{detail:{value:i},bubbles:!0})))};_onInput=()=>{this._emitValueEvent("value-input")};_onChange=()=>{this._emitValueEvent("value-change")};attributeChangedCallback(t,r,i){if(r!==i){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(e.inputSpecificAttributes.includes(t)){this._updateInputAttributes(),(t==="min"||t==="max")&&this._syncValueAttribute();return}this.updateStyles()}}updateStyles(){this._styles=W(),te.forEach(r=>{let i=o=>`${r==="default"?"":`${r}-`}${o}`,s=this.getAttribute(i("wh")),n=C(s===null?this.getAttribute(i("w")):s),a=C(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),M({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),M({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="block")});let t=J(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,r){if(r==null||r==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,r)}_clampValueToBounds(t){let r=t,i=this.getAttribute("min");if(i!==null){let n=parseFloat(i);isNaN(n)||(r=Math.max(r,n))}let s=this.getAttribute("max");if(s!==null){let n=parseFloat(s);isNaN(n)||(r=Math.min(r,n))}return r}_syncValueAttribute(){let t=this.getAttribute("value");if(t==null||t===""){this._inputElement.value="";return}let r=parseFloat(t);if(isNaN(r)){this._inputElement.value="";return}let i=this._clampValueToBounds(r);this._inputElement.value=i.toString()}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("step"),r=this.getAttribute("min"),i=this.getAttribute("max"),s=this.hasAttribute("disabled");this._inputElement.setAttribute("type","number"),this._setOrRemoveInputAttribute("step",t),this._setOrRemoveInputAttribute("min",r),this._setOrRemoveInputAttribute("max",i),s?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},Gr=({render:e,html:t})=>Wt;var Mt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
1141
1173
  :host {
1142
1174
  display: contents;
1143
1175
  }
@@ -1165,7 +1197,7 @@ var rettangoli=(()=>{var ve=`
1165
1197
  }
1166
1198
  ${F}
1167
1199
  ${j}
1168
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._textareaElement=document.createElement("textarea"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onInput),this._textareaElement.addEventListener("change",this._onChange)}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._textareaElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._textareaElement.value},bubbles:!0}))};static get observedAttributes(){return["key","placeholder","disabled","value","cols","rows",...G([...oe,"wh","w","h","hide","show","op","z"])]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}focus(){this._textareaElement&&this._textareaElement.focus()}select(){this._textareaElement&&this._textareaElement.select()}attributeChangedCallback(t,r,i){if(t==="key"){requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""});return}if(t==="value"&&requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""}),t==="placeholder"&&requestAnimationFrame(()=>{let n=this.getAttribute("placeholder");n===void 0||n==="null"?this._textareaElement.removeAttribute("placeholder"):this._textareaElement.setAttribute("placeholder",n??"")}),["cols","rows","disabled"].includes(t)){this._updateTextareaAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=u=>`${n==="default"?"":`${n}-`}${u}`,p=this.getAttribute(a("wh")),l=C(p===null?this.getAttribute(a("w")):p),o=C(p===null?this.getAttribute(a("h")):p),c=this.getAttribute(a("op")),d=this.getAttribute(a("z"));d!==null&&(this._styles[n]["z-index"]=d),c!==null&&(this._styles[n].opacity=c),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),o==="f"?this._styles[n].height="100%":o!==void 0&&(this._styles[n].height=o,this._styles[n]["min-height"]=o,this._styles[n]["max-height"]=o),this.hasAttribute(a("hide"))&&(this._styles[n].display="none"),this.hasAttribute(a("show"))&&(this._styles[n].display="block")});let s=Y(this._styles,"textarea");s!==this._lastStyleString&&(this._styleElement.textContent=s,this._lastStyleString=s)}_updateTextareaAttributes(){let t=this.getAttribute("cols"),r=this.getAttribute("rows"),i=this.hasAttribute("disabled");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),r!==null?this._textareaElement.setAttribute("rows",r):this._textareaElement.removeAttribute("rows"),i?this._textareaElement.setAttribute("disabled",""):this._textareaElement.removeAttribute("disabled")}},Jr=({render:e,html:t})=>Mt;var sn=["mt","mr","mb","ml","m","mh","mv","cur"],nn=/^#[0-9a-fA-F]{6}$/,Kt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
1200
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._textareaElement=document.createElement("textarea"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onInput),this._textareaElement.addEventListener("change",this._onChange)}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._textareaElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._textareaElement.value},bubbles:!0}))};static get observedAttributes(){return["key","placeholder","disabled","value","cols","rows",...q([...oe,"wh","w","h","hide","show","op","z"])]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}focus(){this._textareaElement&&this._textareaElement.focus()}select(){this._textareaElement&&this._textareaElement.select()}attributeChangedCallback(t,r,i){if(t==="key"){requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""});return}if(t==="value"&&requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""}),t==="placeholder"&&requestAnimationFrame(()=>{let n=this.getAttribute("placeholder");n===void 0||n==="null"?this._textareaElement.removeAttribute("placeholder"):this._textareaElement.setAttribute("placeholder",n??"")}),["cols","rows","disabled"].includes(t)){this._updateTextareaAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=u=>`${n==="default"?"":`${n}-`}${u}`,p=this.getAttribute(a("wh")),l=C(p===null?this.getAttribute(a("w")):p),o=C(p===null?this.getAttribute(a("h")):p),c=this.getAttribute(a("op")),d=this.getAttribute(a("z"));d!==null&&(this._styles[n]["z-index"]=d),c!==null&&(this._styles[n].opacity=c),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),o==="f"?this._styles[n].height="100%":o!==void 0&&(this._styles[n].height=o,this._styles[n]["min-height"]=o,this._styles[n]["max-height"]=o),this.hasAttribute(a("hide"))&&(this._styles[n].display="none"),this.hasAttribute(a("show"))&&(this._styles[n].display="block")});let s=J(this._styles,"textarea");s!==this._lastStyleString&&(this._styleElement.textContent=s,this._lastStyleString=s)}_updateTextareaAttributes(){let t=this.getAttribute("cols"),r=this.getAttribute("rows"),i=this.hasAttribute("disabled");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),r!==null?this._textareaElement.setAttribute("rows",r):this._textareaElement.removeAttribute("rows"),i?this._textareaElement.setAttribute("disabled",""):this._textareaElement.removeAttribute("disabled")}},Jr=({render:e,html:t})=>Mt;var rn=["mt","mr","mb","ml","m","mh","mv","cur"],sn=/^#[0-9a-fA-F]{6}$/,Kt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
1169
1201
  :host {
1170
1202
  display: contents;
1171
1203
  }
@@ -1188,7 +1220,7 @@ var rettangoli=(()=>{var ve=`
1188
1220
  }
1189
1221
  ${F}
1190
1222
  ${j}
1191
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=M(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="color",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("change",this._onChange),this._inputElement.addEventListener("input",this._onInput)}static get observedAttributes(){return["key","value","disabled",...G([...sn,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,r,i){if(r!==i){if(t==="key"){this._syncValueAttribute();return}if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=M(),te.forEach(r=>{let i=o=>`${r==="default"?"":`${r}-`}${o}`,s=this.getAttribute(i("wh")),n=C(s===null?this.getAttribute(i("w")):s),a=C(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),K({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),K({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="block")});let t=Y(this._styles,'input[type="color"]');t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_syncValueAttribute(){let t=this.getAttribute("value");if(t===null){this._inputElement.value="#000000";return}this._inputElement.value=nn.test(t)?t:"#000000"}_updateInputAttributes(){let t=this.hasAttribute("disabled");this._syncValueAttribute(),t?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this.updateStyles()}},Yr=({render:e,html:t})=>Kt;var Ut=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
1223
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=W(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="color",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("change",this._onChange),this._inputElement.addEventListener("input",this._onInput)}static get observedAttributes(){return["key","value","disabled",...q([...rn,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,r,i){if(r!==i){if(t==="key"){this._syncValueAttribute();return}if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=W(),te.forEach(r=>{let i=o=>`${r==="default"?"":`${r}-`}${o}`,s=this.getAttribute(i("wh")),n=C(s===null?this.getAttribute(i("w")):s),a=C(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),M({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),M({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="block")});let t=J(this._styles,'input[type="color"]');t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_syncValueAttribute(){let t=this.getAttribute("value");if(t===null){this._inputElement.value="#000000";return}this._inputElement.value=sn.test(t)?t:"#000000"}_updateInputAttributes(){let t=this.hasAttribute("disabled");this._syncValueAttribute(),t?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this.updateStyles()}},Yr=({render:e,html:t})=>Kt;var Ut=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
1192
1224
  :host {
1193
1225
  display: contents;
1194
1226
  }
@@ -1242,7 +1274,7 @@ var rettangoli=(()=>{var ve=`
1242
1274
  }
1243
1275
  ${F}
1244
1276
  ${j}
1245
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",...G([...oe,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};attributeChangedCallback(t,r,i){if(t==="key"&&r!==i){requestAnimationFrame(()=>{let n=this.getAttribute("value"),a=this.getAttribute("min")||"0";this._inputElement.value=n??a});return}if(["value","min","max","step","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=u=>`${n==="default"?"":`${n}-`}${u}`,p=this.getAttribute(a("wh")),l=C(p===null?this.getAttribute(a("w")):p),o=C(p===null?this.getAttribute(a("h")):p),c=this.getAttribute(a("op")),d=this.getAttribute(a("z"));d!==null&&(this._styles[n]["z-index"]=d),c!==null&&(this._styles[n].opacity=c),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),o==="f"?this._styles[n].height="100%":o!==void 0&&(this._styles[n].height=o,this._styles[n]["min-height"]=o,this._styles[n]["max-height"]=o),this.hasAttribute(a("hide"))&&(this._styles[n].display="none"),this.hasAttribute(a("show"))&&(this._styles[n].display="block")});let s=Y(this._styles,'input[type="range"]');s!==this._lastStyleString&&(this._styleElement.textContent=s,this._lastStyleString=s)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.getAttribute("min"),i=this.getAttribute("max"),s=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null?this._inputElement.value=t:this._inputElement.value=r??0,r!==null?this._inputElement.min=r:this._inputElement.min="0",i!==null?this._inputElement.max=i:this._inputElement.max="100",s!==null?this._inputElement.step=s:this._inputElement.step="1",n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Xr=({render:e,html:t})=>Ut;var Ht=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
1277
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",...q([...oe,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};attributeChangedCallback(t,r,i){if(t==="key"&&r!==i){requestAnimationFrame(()=>{let n=this.getAttribute("value"),a=this.getAttribute("min")||"0";this._inputElement.value=n??a});return}if(["value","min","max","step","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=u=>`${n==="default"?"":`${n}-`}${u}`,p=this.getAttribute(a("wh")),l=C(p===null?this.getAttribute(a("w")):p),o=C(p===null?this.getAttribute(a("h")):p),c=this.getAttribute(a("op")),d=this.getAttribute(a("z"));d!==null&&(this._styles[n]["z-index"]=d),c!==null&&(this._styles[n].opacity=c),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),o==="f"?this._styles[n].height="100%":o!==void 0&&(this._styles[n].height=o,this._styles[n]["min-height"]=o,this._styles[n]["max-height"]=o),this.hasAttribute(a("hide"))&&(this._styles[n].display="none"),this.hasAttribute(a("show"))&&(this._styles[n].display="block")});let s=J(this._styles,'input[type="range"]');s!==this._lastStyleString&&(this._styleElement.textContent=s,this._lastStyleString=s)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.getAttribute("min"),i=this.getAttribute("max"),s=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null?this._inputElement.value=t:this._inputElement.value=r??0,r!==null?this._inputElement.min=r:this._inputElement.min="0",i!==null?this._inputElement.max=i:this._inputElement.max="100",s!==null?this._inputElement.step=s:this._inputElement.step="1",n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Xr=({render:e,html:t})=>Ut;var Ht=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
1246
1278
  :host {
1247
1279
  display: inline-flex;
1248
1280
  }
@@ -1311,7 +1343,7 @@ var rettangoli=(()=>{var ve=`
1311
1343
  }
1312
1344
  ${F}
1313
1345
  ${j}
1314
- `))}constructor(){super(),this._isSyncingLabelState=!1,e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="checkbox",this._wrapperElement=document.createElement("label"),this._wrapperElement.className="checkbox-wrapper",this._labelElement=document.createElement("span"),this._labelElement.className="checkbox-label",this._labelSlotElement=document.createElement("slot"),this._labelSlotElement.addEventListener("slotchange",()=>{this._updateLabelState()}),this._labelElement.appendChild(this._labelSlotElement),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this._wrapperElement.appendChild(this._inputElement),this._wrapperElement.appendChild(this._labelElement),this.shadow.appendChild(this._wrapperElement),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","checked","disabled","label",...G([...oe,"wh","w","h","hide","show","op","z"])]}get checked(){return this._inputElement.checked}set checked(t){this._inputElement.checked=!!t}get value(){return this._inputElement.checked}set value(t){this._inputElement.checked=!!t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.checked},bubbles:!0}))};attributeChangedCallback(t,r,i){if(t==="key"&&r!==i){requestAnimationFrame(()=>{let n=this.hasAttribute("checked");this._inputElement.checked=n});return}if(t==="checked"){this._inputElement.checked=i!==null;return}if(t==="disabled"){i!==null?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled");return}if(t==="label"){this._updateLabelState();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=u=>`${n==="default"?"":`${n}-`}${u}`,p=this.getAttribute(a("wh")),l=C(p===null?this.getAttribute(a("w")):p),o=C(p===null?this.getAttribute(a("h")):p),c=this.getAttribute(a("op")),d=this.getAttribute(a("z"));d!==null&&(this._styles[n]["z-index"]=d),c!==null&&(this._styles[n].opacity=c),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),o==="f"?this._styles[n].height="100%":o!==void 0&&(this._styles[n].height=o,this._styles[n]["min-height"]=o,this._styles[n]["max-height"]=o),this.hasAttribute(a("hide"))&&(this._styles[n].display="none"),this.hasAttribute(a("show"))&&(this._styles[n].display="block")});let s=Y(this._styles,'input[type="checkbox"]');s!==this._lastStyleString&&(this._styleElement.textContent=s,this._lastStyleString=s)}connectedCallback(){let t=this.hasAttribute("checked");this._inputElement.checked=t,this.hasAttribute("disabled")&&this._inputElement.setAttribute("disabled",""),this._updateLabelState()}_updateLabelState(){if(!this._isSyncingLabelState){this._isSyncingLabelState=!0;try{let t=this.getAttribute("label"),r=t??"";this._labelSlotElement.textContent!==r&&(this._labelSlotElement.textContent=r);let s=this._labelSlotElement.assignedNodes({flatten:!0}).some(p=>p.nodeType===Node.TEXT_NODE?p.textContent.trim().length>0:p.nodeType===Node.ELEMENT_NODE),n=typeof t=="string"&&t.trim().length>0,a=s||n;a&&!this.hasAttribute("has-label")?this.setAttribute("has-label",""):!a&&this.hasAttribute("has-label")&&this.removeAttribute("has-label")}finally{this._isSyncingLabelState=!1}}}},Qr=({render:e,html:t})=>Ht;var qt=40,an=6,Gt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
1346
+ `))}constructor(){super(),this._isSyncingLabelState=!1,e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="checkbox",this._wrapperElement=document.createElement("label"),this._wrapperElement.className="checkbox-wrapper",this._labelElement=document.createElement("span"),this._labelElement.className="checkbox-label",this._labelSlotElement=document.createElement("slot"),this._labelSlotElement.addEventListener("slotchange",()=>{this._updateLabelState()}),this._labelElement.appendChild(this._labelSlotElement),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this._wrapperElement.appendChild(this._inputElement),this._wrapperElement.appendChild(this._labelElement),this.shadow.appendChild(this._wrapperElement),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","checked","disabled","label",...q([...oe,"wh","w","h","hide","show","op","z"])]}get checked(){return this._inputElement.checked}set checked(t){this._inputElement.checked=!!t}get value(){return this._inputElement.checked}set value(t){this._inputElement.checked=!!t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.checked},bubbles:!0}))};attributeChangedCallback(t,r,i){if(t==="key"&&r!==i){requestAnimationFrame(()=>{let n=this.hasAttribute("checked");this._inputElement.checked=n});return}if(t==="checked"){this._inputElement.checked=i!==null;return}if(t==="disabled"){i!==null?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled");return}if(t==="label"){this._updateLabelState();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=u=>`${n==="default"?"":`${n}-`}${u}`,p=this.getAttribute(a("wh")),l=C(p===null?this.getAttribute(a("w")):p),o=C(p===null?this.getAttribute(a("h")):p),c=this.getAttribute(a("op")),d=this.getAttribute(a("z"));d!==null&&(this._styles[n]["z-index"]=d),c!==null&&(this._styles[n].opacity=c),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),o==="f"?this._styles[n].height="100%":o!==void 0&&(this._styles[n].height=o,this._styles[n]["min-height"]=o,this._styles[n]["max-height"]=o),this.hasAttribute(a("hide"))&&(this._styles[n].display="none"),this.hasAttribute(a("show"))&&(this._styles[n].display="block")});let s=J(this._styles,'input[type="checkbox"]');s!==this._lastStyleString&&(this._styleElement.textContent=s,this._lastStyleString=s)}connectedCallback(){let t=this.hasAttribute("checked");this._inputElement.checked=t,this.hasAttribute("disabled")&&this._inputElement.setAttribute("disabled",""),this._updateLabelState()}_updateLabelState(){if(!this._isSyncingLabelState){this._isSyncingLabelState=!0;try{let t=this.getAttribute("label"),r=t??"";this._labelSlotElement.textContent!==r&&(this._labelSlotElement.textContent=r);let s=this._labelSlotElement.assignedNodes({flatten:!0}).some(p=>p.nodeType===Node.TEXT_NODE?p.textContent.trim().length>0:p.nodeType===Node.ELEMENT_NODE),n=typeof t=="string"&&t.trim().length>0,a=s||n;a&&!this.hasAttribute("has-label")?this.setAttribute("has-label",""):!a&&this.hasAttribute("has-label")&&this.removeAttribute("has-label")}finally{this._isSyncingLabelState=!1}}}},Qr=({render:e,html:t})=>Ht;var qt=40,nn=6,Gt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
1315
1347
  :host {
1316
1348
  display: contents;
1317
1349
  }
@@ -1388,7 +1420,7 @@ var rettangoli=(()=>{var ve=`
1388
1420
  animation: none;
1389
1421
  }
1390
1422
  }
1391
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._adaptiveFrameId=null,this._layoutRetryCount=0,this._observedContentElement=null,this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._scheduleAdaptiveCentering()}):null,this._onSlotChange=()=>{this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0})},this._onWindowResize=()=>{this._scheduleAdaptiveCentering({resetRetries:!0})},this._mouseDownInContent=!1,this._dialogElement.addEventListener("mousedown",t=>{this._mouseDownInContent=t.target!==this._dialogElement}),this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&this._attemptClose(),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&(t.preventDefault(),this._attemptClose()),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._attemptClose()})}_attemptClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}disconnectedCallback(){this._isConnected=!1,this._stopAdaptiveObservers(),this._slotElement&&this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,r,i){t==="open"?i!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():i===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._slotElement.addEventListener("slotchange",this._onSlotChange),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0,window.addEventListener("resize",this._onWindowResize),this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0}))}_hideModal(){this._dialogElement.open&&(this._stopAdaptiveObservers(),this._dialogElement.close(),this._slotElement&&(this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.removeChild(this._slotElement),this._slotElement=null),this._dialogElement.style.height="")}_stopAdaptiveObservers(){this._adaptiveFrameId!==null&&(cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=null),this._layoutRetryCount=0,window.removeEventListener("resize",this._onWindowResize),this._resizeObserver&&this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=null}_getAssignedContentElement(){if(!this._slotElement)return null;let t=this._slotElement.assignedElements({flatten:!0});return t.length>0?t[0]:null}_observeAssignedContent(){if(!this._resizeObserver)return;let t=this._getAssignedContentElement();this._observedContentElement!==t&&(this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=t,this._observedContentElement&&this._resizeObserver.observe(this._observedContentElement))}_scheduleAdaptiveCentering({resetRetries:t=!1}={}){!this._slotElement||!this._dialogElement.open||(t&&(this._layoutRetryCount=0),this._adaptiveFrameId!==null&&cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=null,this._applyAdaptiveCentering()})}))}_applyAdaptiveCentering(){if(!this._slotElement||!this._dialogElement.open)return;this._observeAssignedContent();let t=this._getAssignedContentElement(),r=t?Math.round(t.getBoundingClientRect().height):0;if(r<=0){this._layoutRetryCount<an&&(this._layoutRetryCount+=1,this._scheduleAdaptiveCentering());return}this._layoutRetryCount=0;let i=window.innerHeight;if(r>=i-2*qt){this._slotElement.style.marginTop=`${qt}px`,this._slotElement.style.marginBottom=`${qt}px`,this._dialogElement.style.height="100vh";return}let s=i-r,n=Math.floor(s/2);this._slotElement.style.marginTop=`${n}px`,this._slotElement.style.marginBottom=`${n}px`,this._dialogElement.style.height="auto"}get dialog(){return this._dialogElement}},Zr=({render:e,html:t})=>Gt;var Jt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
1423
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._adaptiveFrameId=null,this._layoutRetryCount=0,this._observedContentElement=null,this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._scheduleAdaptiveCentering()}):null,this._onSlotChange=()=>{this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0})},this._onWindowResize=()=>{this._scheduleAdaptiveCentering({resetRetries:!0})},this._mouseDownInContent=!1,this._dialogElement.addEventListener("mousedown",t=>{this._mouseDownInContent=t.target!==this._dialogElement}),this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&this._attemptClose(),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&(t.preventDefault(),this._attemptClose()),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._attemptClose()})}_attemptClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}disconnectedCallback(){this._isConnected=!1,this._stopAdaptiveObservers(),this._slotElement&&this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,r,i){t==="open"?i!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():i===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._slotElement.addEventListener("slotchange",this._onSlotChange),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0,window.addEventListener("resize",this._onWindowResize),this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0}))}_hideModal(){this._dialogElement.open&&(this._stopAdaptiveObservers(),this._dialogElement.close(),this._slotElement&&(this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.removeChild(this._slotElement),this._slotElement=null),this._dialogElement.style.height="")}_stopAdaptiveObservers(){this._adaptiveFrameId!==null&&(cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=null),this._layoutRetryCount=0,window.removeEventListener("resize",this._onWindowResize),this._resizeObserver&&this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=null}_getAssignedContentElement(){if(!this._slotElement)return null;let t=this._slotElement.assignedElements({flatten:!0});return t.length>0?t[0]:null}_observeAssignedContent(){if(!this._resizeObserver)return;let t=this._getAssignedContentElement();this._observedContentElement!==t&&(this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=t,this._observedContentElement&&this._resizeObserver.observe(this._observedContentElement))}_scheduleAdaptiveCentering({resetRetries:t=!1}={}){!this._slotElement||!this._dialogElement.open||(t&&(this._layoutRetryCount=0),this._adaptiveFrameId!==null&&cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=null,this._applyAdaptiveCentering()})}))}_applyAdaptiveCentering(){if(!this._slotElement||!this._dialogElement.open)return;this._observeAssignedContent();let t=this._getAssignedContentElement(),r=t?Math.round(t.getBoundingClientRect().height):0;if(r<=0){this._layoutRetryCount<nn&&(this._layoutRetryCount+=1,this._scheduleAdaptiveCentering());return}this._layoutRetryCount=0;let i=window.innerHeight;if(r>=i-2*qt){this._slotElement.style.marginTop=`${qt}px`,this._slotElement.style.marginBottom=`${qt}px`,this._dialogElement.style.height="100vh";return}let s=i-r,n=Math.floor(s/2);this._slotElement.style.marginTop=`${n}px`,this._slotElement.style.marginBottom=`${n}px`,this._dialogElement.style.height="auto"}get dialog(){return this._dialogElement}},Zr=({render:e,html:t})=>Gt;var Jt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
1392
1424
  :host {
1393
1425
  display: contents;
1394
1426
  }
@@ -1442,7 +1474,7 @@ var rettangoli=(()=>{var ve=`
1442
1474
  min-width: 200px;
1443
1475
  max-width: 400px;
1444
1476
  }
1445
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let r=t.composedPath();(r[0]===this._dialogElement||r[0].nodeName==="DIALOG"&&r[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let r=t.composedPath();(r[0]===this._dialogElement||r[0].nodeName==="DIALOG"&&r[0]===this._dialogElement)&&(t.preventDefault(),this._emitClose())}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._emitClose()}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._isOpen=!1}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y","place","no-overlay"]}connectedCallback(){this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._isOpen&&this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,r,i){t==="open"?i!==null&&!this._isOpen?this.isConnected&&this._show():i===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="place")&&this._isOpen?this._updatePosition():t==="no-overlay"&&r!==i&&this._isOpen&&(this._hide(),this._show())}_show(){this._isOpen||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._dialogElement.open||setTimeout(()=>{this._dialogElement&&!this._dialogElement.open&&(this.hasAttribute("no-overlay")?this._dialogElement.show():this._dialogElement.showModal())},0),requestAnimationFrame(()=>{this._updatePosition()}))}_hide(){this._isOpen&&(this._isOpen=!1,this._dialogElement.open&&this._dialogElement.close(),this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_updatePosition(){let t=parseFloat(this.getAttribute("x")||"0"),r=parseFloat(this.getAttribute("y")||"0"),i=this.getAttribute("place")||"bs";this.removeAttribute("positioned"),requestAnimationFrame(()=>{let s=this._popoverContainer.getBoundingClientRect(),{left:n,top:a}=this._calculatePosition(t,r,s.width,s.height,i);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${a}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,r,i,s,n){let p=t,l=r;switch(n){case"t":p=t-i/2,l=r-s-8;break;case"ts":p=t,l=r-s-8;break;case"te":p=t-i,l=r-s-8;break;case"r":p=t+8,l=r-s/2;break;case"rs":p=t+8,l=r;break;case"re":p=t+8,l=r-s;break;case"b":p=t-i/2,l=r+8;break;case"bs":p=t,l=r+8;break;case"be":p=t-i,l=r+8;break;case"l":p=t-i-8,l=r-s/2;break;case"ls":p=t-i-8,l=r;break;case"le":p=t-i-8,l=r-s;break;default:p=t,l=r+8;break}let o=8;return p=Math.max(o,Math.min(p,window.innerWidth-i-o)),l=Math.max(o,Math.min(l,window.innerHeight-s-o)),{left:p,top:l}}get popover(){return this._popoverContainer}},ei=({render:e,html:t})=>Jt;var on=(e,t)=>{let{store:r,render:i}=e;r.toggleOpen({}),i()},ln=Object.freeze(Object.defineProperty({__proto__:null,handleClickHeader:on},Symbol.toStringTag,{value:"Module"})),pn=()=>Object.freeze({open:!1}),dn=["id","class","style","slot","label","content"],cn=(e={})=>Object.entries(e).filter(([t])=>!dn.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),hn=({state:e,props:t})=>({label:t.label||"",content:t.content||"",openClass:e.open?"content-wrapper open":"content-wrapper",chevronIcon:e.open?"chevronUp":"chevronDown",containerAttrString:cn(t)}),un=({state:e})=>{e.open=!e.open},fn=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:pn,selectViewData:hn,toggleOpen:un},Symbol.toStringTag,{value:"Module"})),mn=(e,t)=>{let{dispatchEvent:r,props:i}=e,s=t._event,n=Number(s.currentTarget.dataset.index),a=Array.isArray(i.items)?i.items[n]:void 0;if(a){if(a.disabled||a.current){s.preventDefault();return}typeof a.href=="string"&&a.href.length>0||s.preventDefault(),r(new CustomEvent("item-click",{detail:{id:a.id,path:a.path,href:a.href,item:a,index:n,trigger:s.type}}))}},yn=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:mn},Symbol.toStringTag,{value:"Module"})),gn=()=>Object.freeze({}),bn=["id","class","style","slot","items","sep","max","separator"],vn=(e={})=>Object.entries(e).filter(([t])=>!bn.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),wn=e=>{if(e==null||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t},_n=e=>`${e}`.replace(/"/g,"&quot;"),xn=(e,t)=>{if(!t||t<3||e.length<=t)return e;let r=t-2;return[e[0],{isEllipsis:!0,label:"..."},...e.slice(-r)]},Sn=e=>e.map((t,r)=>{let i=typeof t.href=="string"&&t.href.length>0,s=t.path!==void 0&&t.path!==null&&`${t.path}`!="",n=!!t.current,a=!!t.disabled,p=!n&&!a&&(i||s||!!t.click),l=t.rel||(t.newTab?"noopener noreferrer":""),o=[t.newTab?'target="_blank"':"",l?`rel="${_n(l)}"`:""].filter(Boolean).join(" ");return{...t,label:t.label||"",index:r,href:i?t.href:void 0,path:s?t.path:void 0,isCurrent:n,isDisabled:a,isInteractive:p,linkExtraAttrs:o,c:n?"fg":"mu-fg"}}),An=({props:e})=>{let t=vn(e),r=Array.isArray(e.items)?e.items:[],i=wn(e.max),s=e.sep||"breadcrumb-arrow",n=Sn(r),a=xn(n,i),p=[];return a.forEach((l,o)=>{p.push(l),o<a.length-1&&p.push({isSeparator:!0})}),{containerAttrString:t,items:p,sep:s}},En=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:gn,selectViewData:An},Symbol.toStringTag,{value:"Module"})),kn=["id","class","style","slot","head","desc","size","d","ah","av","wrap","noWrap","g","gh","gv","p","pt","pr","pb","pl","pv","ph","bw","bwt","bwr","bwb","bwl","bc","br","shadow","bgc","href","newTab","rel","cur","sv","sh","overflow"],ti={sm:{cardAttrString:"p=md sm-p=sm g=md sm-g=sm",headerAttrString:"g=xs",headingSize:"lg",subheadingSize:"sm"},md:{cardAttrString:"p=lg md-p=md sm-p=md g=lg md-g=md sm-g=md",headerAttrString:"g=sm",headingSize:"h4",subheadingSize:"sm"},lg:{cardAttrString:"p=xl lg-p=lg md-p=md sm-p=md g=lg md-g=md sm-g=md",headerAttrString:"g=sm",headingSize:"h3",subheadingSize:"md"}},$n=(e={})=>Object.entries(e).filter(([t])=>!kn.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Cn=()=>Object.freeze({}),In=({props:e={}})=>{let t=ti[e.size]?e.size:"md",r=ti[t];return{containerAttrString:$n(e),cardAttrString:r.cardAttrString,headerAttrString:r.headerAttrString,headingSize:r.headingSize,subheadingSize:r.subheadingSize,head:e.head||"",desc:e.desc||"",hasHeader:!!(e.head||e.desc),size:t}},Tn=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Cn,selectViewData:In},Symbol.toStringTag,{value:"Module"})),On=(e,t)=>{let{dispatchEvent:r}=e;r(new CustomEvent("close"))},Ln=(e,t)=>{let{dispatchEvent:r,props:i}=e,s=t._event,n=Number(s.currentTarget.dataset.index??s.currentTarget.id.slice(6)),a=i.items[n],p=a?.type||"item";if(!a||p!=="item"||a.disabled){s.preventDefault();return}a.href||s.preventDefault(),r(new CustomEvent("item-click",{detail:{index:n,item:a,id:a.id,path:a.path,href:a.href,trigger:s.type}}))},Nn=Object.freeze(Object.defineProperty({__proto__:null,handleClickMenuItem:Ln,handleClosePopover:On},Symbol.toStringTag,{value:"Module"})),Rn=()=>Object.freeze({}),Vn=e=>`${e}`.replace(/"/g,"&quot;"),jn=e=>e.map((t,r)=>{let i=t.type||"item",s=i==="separator",n=i==="label",a=i==="item",p=!!t.disabled,l=a&&!p,o=p?"mu-fg":"fg",c=p?"mu":"",d=p?"":"ac",u=typeof t.href=="string"&&t.href.length>0,f=t.rel||(t.newTab?"noopener noreferrer":""),h=[t.newTab?'target="_blank"':"",f?`rel="${Vn(f)}"`:""].filter(Boolean).join(" ");return{...t,index:r,type:i,isSeparator:s,isLabel:n,isItem:a,isDisabled:p,isInteractive:l,hasHref:u,linkExtraAttrs:h,c:o,bgc:c,hoverBgc:d}}),Pn=({props:e})=>{let t=Array.isArray(e.items)?e.items:[];return{items:jn(t),open:!!e.open,x:e.x||0,y:e.y||0,w:e.w||"300",h:e.h||"300",place:e.place||"bs"}},Bn=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Rn,selectViewData:Pn},Symbol.toStringTag,{value:"Module"})),v={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9,PARTIAL:10,PATH_REFERENCE:11},P={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},tr={NOT:0},$=class extends Error{constructor(e){super(`Parse Error: ${e}`),this.name="JemplParseError"}},le=class extends Error{constructor(e){super(`Render Error: ${e}`),this.name="JemplRenderError"}},ri=e=>{if(!e||e.trim()==="")throw new $("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new $(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${r}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let r of t)if(e.trim().endsWith(r))throw new $(`Incomplete comparison expression - missing right operand (got: '${e}')`)},Dn=e=>{if(e.trim().endsWith(" in"))throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new $(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);let i=t.includes(",")?t.split(",").map(s=>s.trim()):[t.trim()];for(let s of i){if(!s)throw new $(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(s))throw new $(`Invalid loop syntax (got: '$for ${e}')`)}},zn=(e,t,r=!1)=>{if(t===null)return new le(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new le(`Cannot iterate over undefined value at '$for ${e}'`);let i=typeof t;return r?new le(`Cannot iterate over non-array value in loop '${e}' - got ${i} instead`):new le(`Cannot iterate over non-array value (got: ${i}) at '$for ${e}'`)},Fn=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new le(`Unknown function '${e}' (${r})`)},Wn=(e,t,r={})=>{let i={},s={};r&&typeof r=="object"&&(r.functions!==void 0||r.partials!==void 0?(i=r.functions||{},s=r.partials||{}):typeof r=="object"&&(i=r));let n=N(e,{functions:i,partials:s},t,{});return n===void 0?{}:n},N=(e,t,r,i)=>{if(t.functions,e.var&&!e.type)return U(e.var,r,i);if(e.type===v.LITERAL)return e.value;if(e.type===v.VARIABLE)return U(e.path,r,i);if(e.type===v.INTERPOLATION)return Kn(e.parts,t,r,i);switch(e.type){case v.FUNCTION:return Li(e,t,r,i);case v.BINARY:return Ni(e,t,r,i);case v.UNARY:return Ri(e,t,r,i);case v.CONDITIONAL:return Hn(e,t,r,i);case v.LOOP:return Xn(e,t,r,i);case v.OBJECT:return Zn(e,t,r,i);case v.ARRAY:return ea(e,t,r,i);case v.PARTIAL:return ta(e,t,r,i);case v.PATH_REFERENCE:return ra(e,t,r,i);default:throw new Error(`Unknown node type: ${e.type}`)}},ii=new Map,Mn=e=>{let t=[],r="",i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(n==="[")r&&(t.push({type:"property",value:r}),r=""),i=!0;else if(n==="]"){if(i&&r){let a=r.trim();if(/^\d+$/.test(a))t.push({type:"index",value:parseInt(a,10)});else if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")){let p=a.slice(1,-1);t.push({type:"property",value:p})}else t.push({type:"property",value:a});r=""}i=!1}else r+=n}return r&&t.push({type:"property",value:r}),t},U=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let i=ii.get(e);if(!i){let n=[],a="",p=0;for(let l=0;l<e.length;l++){let o=e[l];o==="["?(p++,a+=o):o==="]"?(p--,a+=o):o==="."&&p===0?a&&(n.push(a),a=""):a+=o}a&&n.push(a),i=[];for(let l of n){let o=Mn(l.trim());i.push(...o)}ii.set(e,i)}let s=t;for(let n=0;n<i.length;n++){let a=i[n];if(a.type==="property"&&a.value in r){s=r[a.value];continue}if(s==null)return;(a.type==="property"||a.type==="index")&&(s=s[a.value])}return s},Kn=(e,t,r,i)=>{let s=[];for(let n of e)if(typeof n=="string")s.push(n);else{let a=N(n,t,r,i);s.push(a!=null?String(a):"")}return s.join("")},Li=(e,t,r,i)=>{let s=t.functions||t,n=s[e.name];if(!n)throw Fn(e.name,s);let a=e.args.map(p=>N(p,t,r,i));return n(...a)},Ne=(e,t,r,i)=>{if(e.var&&!e.type)return U(e.var,r,i);switch(e.type){case v.VARIABLE:return U(e.path,r,i);case v.LITERAL:return e.value;case v.BINARY:return Ni(e,t,r,i);case v.UNARY:return Ri(e,t,r,i);case v.FUNCTION:return Li(e,t,r,i);default:return N(e,t,r,i)}},Ni=(e,t,r,i)=>{if(e.op===P.AND||e.op===P.OR){let a=Ne(e.left,t,r,i),p=Ne(e.right,t,r,i);switch(e.op){case P.AND:return a&&p;case P.OR:return a||p}}let s=N(e.left,t,r,i),n=N(e.right,t,r,i);switch(e.op){case P.EQ:return s==n;case P.NEQ:return s!=n;case P.GT:return s>n;case P.LT:return s<n;case P.GTE:return s>=n;case P.LTE:return s<=n;case P.IN:return Array.isArray(n)?n.includes(s):!1;case P.ADD:if(typeof s!="number"||typeof n!="number")throw new le(`Arithmetic operations require numbers. Got ${typeof s} + ${typeof n}`);return s+n;case P.SUBTRACT:if(typeof s!="number"||typeof n!="number")throw new le(`Arithmetic operations require numbers. Got ${typeof s} - ${typeof n}`);return s-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},Ri=(e,t,r,i)=>{let s=e.op===tr.NOT?Ne(e.operand,t,r,i):N(e.operand,t,r,i);switch(e.op){case tr.NOT:return!s;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Un=(e,t,r,i)=>{if(e.conditions.length===2&&e.conditions[1]===null){let s=e.conditions[0];if(s.type===v.VARIABLE)if(U(s.path,r,i)){let n=e.bodies[0];if(n.type===v.OBJECT&&n.properties.length<=5){let a={};for(let p of n.properties){let l=p.parsedKey?N(p.parsedKey,t,r,i):p.key,o=p.value;if(o.type===v.LITERAL)a[l]=o.value;else if(o.type===v.VARIABLE)a[l]=U(o.path,r,i);else if(o.type===v.INTERPOLATION){let c=[];for(let d of o.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let u=U(d.path,r,i);c.push(u!=null?String(u):"")}else{let u=N(d,t,r,i);c.push(u!=null?String(u):"")}a[l]=c.join("")}else a[l]=N(o,t,r,i)}return a}}else{let n=e.bodies[1];if(n.type===v.OBJECT&&n.properties.length<=5){let a={};for(let p of n.properties){let l=p.parsedKey?N(p.parsedKey,t,r,i):p.key,o=p.value;if(o.type===v.LITERAL)a[l]=o.value;else if(o.type===v.VARIABLE)a[l]=U(o.path,r,i);else if(o.type===v.INTERPOLATION){let c=[];for(let d of o.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let u=U(d.path,r,i);c.push(u!=null?String(u):"")}else{let u=N(d,t,r,i);c.push(u!=null?String(u):"")}a[l]=c.join("")}else a[l]=N(o,t,r,i)}return a}}}return null},Hn=(e,t,r,i)=>{let s=Un(e,t,r,i);if(s!==null)return s;for(let n=0;n<e.conditions.length;n++){let a=e.conditions[n];if(a===null||Ne(a,t,r,i))return N(e.bodies[n],t,r,i)}return Vi},qn=(e,t)=>{let r=e.body,i=e.itemVar;if(r.type===v.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===v.VARIABLE){let s=r.conditions[0].path,n=r.bodies[0];if(s.startsWith(i+".")){let a=s.substring(i.length+1);if(n.type===v.OBJECT&&n.properties.length<=5){for(let l of n.properties)if(l.parsedKey)return null;let p=[];for(let l=0;l<t.length;l++){let o=t[l];if(o[a]){let c={};for(let d of n.properties){let u=d.key,f=d.value;if(f.type===v.LITERAL)c[u]=f.value;else if(f.type===v.VARIABLE){let h=f.path;if(h===i)c[u]=o;else if(h.startsWith(i+".")){let m=h.substring(i.length+1);c[u]=o[m]}else return null}else if(f.type===v.INTERPOLATION){let h=[],m=!0;for(let g of f.parts)if(typeof g=="string")h.push(g);else if(g.type===v.VARIABLE){let b=g.path;if(b===i)h.push(o!=null?String(o):"");else if(b.startsWith(i+".")){let y=b.substring(i.length+1),_=o[y];h.push(_!=null?String(_):"")}else{m=!1;break}}else{m=!1;break}if(!m)return null;c[u]=h.join("")}else return null}p.push(c)}}return p}}}return null},Gn=(e,t)=>{let r=e.body,i=e.itemVar,s=qn(e,t);if(s!==null)return s;if(r.type===v.OBJECT&&r.properties.length<=5&&!r.whenCondition){for(let p of r.properties)if(p.parsedKey)return null;let n=[],a=!0;for(let p of r.properties){let l=p.key,o=p.value;if(o.type===v.LITERAL)n.push({key:l,type:"literal",value:o.value});else if(o.type===v.VARIABLE){let c=o.path;if(c===i)n.push({key:l,type:"item"});else if(c.startsWith(i+".")){let d=c.substring(i.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:l,type:"prop",prop:d});else{a=!1;break}}else{a=!1;break}}else if(o.type===v.INTERPOLATION&&o.parts.length===1){let c=o.parts[0];if(c.type===v.VARIABLE){let d=c.path;if(d===i)n.push({key:l,type:"item_string"});else if(d.startsWith(i+".")){let u=d.substring(i.length+1);if(!u.includes(".")&&!u.includes("["))n.push({key:l,type:"prop_string",prop:u});else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}if(a){let p=new Array(t.length);if(n.length===3&&n[0].type==="prop"&&n[0].key==="id"&&n[1].type==="prop_string"&&n[1].key==="title"&&n[2].type==="prop"&&n[2].key==="completed")for(let l=0;l<t.length;l++){let o=t[l];p[l]={id:o.id,title:o.title!=null?String(o.title):"",completed:o.completed}}else for(let l=0;l<t.length;l++){let o=t[l],c={};for(let d of n)if(d.type==="literal")c[d.key]=d.value;else if(d.type==="item")c[d.key]=o;else if(d.type==="prop")c[d.key]=o[d.prop];else if(d.type==="item_string")c[d.key]=o!=null?String(o):"";else if(d.type==="prop_string"){let u=o[d.prop];c[d.key]=u!=null?String(u):""}p[l]=c}return p}}return null},Jn=(e,t,r,i,s)=>{let n=[],a=e.body;if(a.type===v.OBJECT&&a.fast!==!1){let p=e.itemVar,l=e.indexVar;for(let o=0;o<s.length;o++){let c=s[o],d={},u={...i,[p]:c,...l&&{[l]:o}};u.__paths__||(u.__paths__=i.__paths__||{});let f=e.iterable.path||"";if(i&&i.__paths__&&f){let h=f.split("."),m=h[0];m in i.__paths__&&(f=i.__paths__[m],h.length>1&&(f+="."+h.slice(1).join(".")))}u.__paths__={...u.__paths__,[p]:`${f}[${o}]`,...l&&{[l]:o}};for(let h of a.properties){let m=h.parsedKey?N(h.parsedKey,t,r,u):h.key,g=h.value;if(g.type===v.LITERAL)d[m]=g.value;else if(g.type===v.VARIABLE){let b=g.path;if(b===p)d[m]=c;else if(b===l)d[m]=o;else if(b.startsWith(p+".")){let y=b.substring(p.length+1);!y.includes(".")&&!y.includes("[")?d[m]=c[y]:d[m]=U(b,r,{...i,[p]:c,...l&&{[l]:o}})}else d[m]=U(b,r,{...i,[p]:c,...l&&{[l]:o}})}else if(g.type===v.INTERPOLATION){let b=[];for(let y of g.parts)if(typeof y=="string")b.push(y);else if(y.type===v.VARIABLE){let _=y.path,S;if(_===p)S=c;else if(_===l)S=o;else if(_.startsWith(p+".")){let A=_.substring(p.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=U(_,r,{...i,[p]:c,...l&&{[l]:o}})}else S=U(_,r,{...i,[p]:c,...l&&{[l]:o}});b.push(S!=null?String(S):"")}else{let _={...i,[p]:c,...l&&{[l]:o}},S=N(y,t,r,_);b.push(S!=null?String(S):"")}d[m]=b.join("")}else{let b={...i,[p]:c,...l&&{[l]:o}};d[m]=N(g,t,r,b)}}n.push(d)}return n}return null},Yn=(e,t,r)=>{let i=e.body;if(i.type===v.OBJECT&&i.properties.length===1&&i.properties[0].key==="$if item.visible"){let s=i.properties[0].value;if(s.type===v.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===v.VARIABLE&&s.conditions[0].path==="item.visible"){let n=s.bodies[0];if(n.type===v.OBJECT&&n.properties.length===2){let a=n.properties[0],p=n.properties[1];if(a.key==="id"&&a.value.type===v.VARIABLE&&a.value.path==="item.id"&&p.key==="$if item.highlighted"&&p.value.type===v.CONDITIONAL){let l=[];for(let o=0;o<t.length;o++){let c=t[o];if(c.visible){let d={id:c.id};c.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${c.name}`):(d.highlight=!1,d.message=c.name),l.push(d)}}return l}}}}return null},Xn=(e,t,r,i)=>{let s=N(e.iterable,t,r,i);if(!Array.isArray(s)){let o,c=!1;if(e.iterable.type===v.FUNCTION){c=!0;let u=e.iterable.args.map(f=>f.type===v.LITERAL?typeof f.value=="string"?`'${f.value}'`:String(f.value):f.type===v.VARIABLE?f.path:f.type===v.FUNCTION?`${f.name}(...)`:"?").join(", ");o=`${e.iterable.name}(${u})`}else o=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${o}`;throw zn(d,s,c)}if(!e.indexVar){let o=Yn(e,s,e.itemVar);if(o!==null)return o}if(!e.indexVar){let o=Gn(e,s);if(o!==null)return o}let n=Jn(e,t,r,i,s);if(n!==null)return n;let a=[],p=e.iterable.path||"";if(i&&i.__paths__&&p){let o=p.split("."),c=o[0];c in i.__paths__&&(p=i.__paths__[c],o.length>1&&(p+="."+o.slice(1).join(".")))}let l=!1;e.body.type===v.ARRAY&&(e.body.items.length<=1?l=!1:l=e.body._shouldPreserveArray??=e.body.items.some(o=>o.type===v.OBJECT&&o.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let o=0;o<s.length;o++){let c=e.indexVar?{...i,[e.itemVar]:s[o],[e.indexVar]:o}:{...i,[e.itemVar]:s[o]};c.__paths__||(c.__paths__=i.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${p}[${o}]`},e.indexVar&&(c.__paths__[e.indexVar]=o);let d=N(e.body,t,r,c);if(Array.isArray(d)&&d.length===1&&!l){let u=d[0];a.push(u===void 0?{}:u)}else a.push(d===void 0?{}:d)}return a},Qn=(e,t,r,i)=>{if(e.whenCondition)return null;if(e.properties.length===1){let s=e.properties[0],n=s.parsedKey?N(s.parsedKey,t,r,i):s.key,a=s.value;if(a.type===v.OBJECT&&a.properties.length<=10&&!a.whenCondition){let p={},l={},o=!0;for(let c of a.properties){let d=c.parsedKey?N(c.parsedKey,t,r,i):c.key,u=c.value;if(u.type===v.LITERAL)l[d]=u.value;else if(u.type===v.VARIABLE)l[d]=U(u.path,r,i);else if(u.type===v.INTERPOLATION){let f=[];for(let h of u.parts)if(typeof h=="string")f.push(h);else if(h.type===v.VARIABLE){let m=U(h.path,r,i);f.push(m!=null?String(m):"")}else{o=!1;break}if(!o)break;l[d]=f.join("")}else if(u.type===v.OBJECT&&u.properties.length<=5){let f={};for(let h of u.properties){let m=h.key,g=h.value;if(g.type===v.LITERAL)f[m]=g.value;else if(g.type===v.VARIABLE)f[m]=U(g.path,r,i);else if(g.type===v.INTERPOLATION){let b=[];for(let y of g.parts)if(typeof y=="string")b.push(y);else if(y.type===v.VARIABLE){let _=U(y.path,r,i);b.push(_!=null?String(_):"")}else{o=!1;break}if(!o)break;f[m]=b.join("")}else{o=!1;break}}if(!o)break;l[d]=f}else{o=!1;break}}if(o)return p[n]=l,p}}return null},Zn=(e,t,r,i)=>{let s=t.functions||t;if(e.whenCondition&&!Ne(e.whenCondition,s,r,i))return;let n=Qn(e,t,r,i);if(n!==null)return n;if(e.fast){let l={};for(let o of e.properties){let c=o.parsedKey?N(o.parsedKey,t,r,i):o.key,d=o.value;if(d.type===v.LITERAL)l[c]=d.value;else if(d.type===v.VARIABLE)l[c]=U(d.path,r,i);else if(d.type===v.INTERPOLATION){let u=[];for(let f of d.parts)if(typeof f=="string")u.push(f);else if(f.type===v.VARIABLE){let h=U(f.path,r,i);u.push(h!=null?String(h):"")}else{let h=N(f,t,r,i);u.push(h!=null?String(h):"")}l[c]=u.join("")}else l[c]=N(d,t,r,i)}return l}let a={},p=!1;for(let l of e.properties)if(!l.key.startsWith("$if ")&&!l.key.match(/^\$if\s+\w+.*:?$/)&&!l.key.startsWith("$elif")&&!l.key.startsWith("$else")&&!l.key.startsWith("$for ")){p=!0;break}for(let l of e.properties)if(l.key.startsWith("$if ")||l.key.match(/^\$if\s+\w+.*:?$/)){let o=N(l.value,t,r,i);if(!p&&o!==null&&o!==void 0)return Array.isArray(o)&&o.length===1?o[0]:o;typeof o=="object"&&o!==null&&!Array.isArray(o)&&Object.assign(a,o)}else if(l.key.startsWith("$for ")){if(e.properties.length===1)return N(l.value,t,r,i)}else{let o=l.value;if(o&&o.type===v.OBJECT&&o.properties){let c=o.properties.find(d=>d.key.startsWith("$for "));if(c){let d=N(c.value,t,r,i);d!==void 0&&(a[l.key]=d)}else{let d=N(l.value,t,r,i);d!==void 0&&(a[l.key]=d)}}else{let c=l.parsedKey?N(l.parsedKey,t,r,i):l.key,d=N(l.value,t,r,i);d!==void 0&&(a[c]=d)}}return a},Vi={},ea=(e,t,r,i)=>{let s=[];for(let n of e.items)if(n.type===v.LOOP){let a=N(n,t,r,i);Array.isArray(a)&&n.flatten!==!1?s.push(...a):s.push(a)}else{let a=N(n,t,r,i);a!==Vi&&a!==void 0&&s.push(a)}return s},ta=(e,t,r,i)=>{let{name:s,data:n,whenCondition:a}=e,p=t.partials||{},l=t.functions||t;if(a&&!Ne(a,l,r,i))return;if(!p[s])throw new le(`Partial '${s}' is not defined`);let o=i._partialStack||[];if(o.includes(s))throw new le(`Circular partial reference detected: ${s}`);let c=p[s],d=r,u={...i,_partialStack:[...o,s]};if(i){d={...r};for(let f of Object.keys(i))f.startsWith("_")||(d[f]=i[f])}if(n){let f=N(n,t,r,i);d={...d,...f}}return N(c,t,d,u)},ra=(e,t,r,i)=>{let{path:s}=e,n=s.split("."),a=n[0],p=n.slice(1);if(!i||!(a in i))throw new le(`Path reference '#{${s}}' refers to '${a}' which is not a loop variable in the current scope`);if(i.__paths__||(i.__paths__={}),!(a in i.__paths__))throw new le(`Path reference '#{${s}}' cannot be resolved - path tracking may not be initialized properly`);let l=i.__paths__[a];if(typeof l=="number"){if(p.length>0)throw new le(`Path reference '#{${s}}' - cannot access properties on index variable '${a}'`);return String(l)}return p.length>0&&(l+="."+p.join(".")),l},ia=/\$\{([^}]*)\}/g,sa=/#\{([^}]*)\}/g,ji=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,i,s]=r,n=na(s,t);return{isFunction:!0,type:v.FUNCTION,name:i,args:n}},na=(e,t={})=>e.trim()?aa(e).map(r=>oa(r.trim(),t)):[],aa=e=>{let t=[],r="",i=0,s=!1,n="";for(let a=0;a<e.length;a++){let p=e[a],l=a>0?e[a-1]:"";!s&&(p==='"'||p==="'")?(s=!0,n=p,r+=p):s&&p===n&&l!=="\\"?(s=!1,n="",r+=p):!s&&p==="("?(i++,r+=p):!s&&p===")"?(i--,r+=p):!s&&p===","&&i===0?(t.push(r),r=""):r+=p}return r&&t.push(r),t},oa=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:v.LITERAL,value:parseFloat(e)};if(e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};let r=ji(e,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};let i=e.trim(),s=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:a,type:p}of s){let l=0;for(;l<i.length;){let o=Oe(i.substring(l),a);if(o===-1)break;let c=l+o;c>n&&(n=c),l=c+a.length}}if(n!==-1)try{return Q(i,t)}catch{return{type:v.VARIABLE,path:i}}return{type:v.VARIABLE,path:i}},Pi=/^\w+\(.*\)$/,la=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,pa=e=>{if(!(!e||e.trim()===""||Pi.test(e))&&la.test(e))throw e.includes("?")&&e.includes(":")?new $(`Complex expressions not supported in variable replacements - consider calculating the value in your data instead. Offending expression: "${e}"`):e.includes("||")||e.includes("&&")||e.includes("??")?new $(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new $(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},si=e=>{let t=e.trim();if(Pi.test(t))throw new $(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new $(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new $(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new $(`Logical operators not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("?")&&t.includes(":"))throw new $(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:v.PATH_REFERENCE,path:t}},lt=(e,t={})=>{let r=e.trim();pa(r);let i=ji(r,t);if(i.isFunction)return{type:i.type,name:i.name,args:i.args};if(r.includes("[")&&!/[\s+\-*/%|&?:]/.test(r)){let s=0;for(let n of r)n==="["?s++:n==="]"&&s--;if(s!==0)throw new Error("Invalid array index syntax")}return{type:v.VARIABLE,path:r}},Bi=(e,t={})=>{let r=e,i=[];(e.includes("\\${")||e.includes("\\#{"))&&(r=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),r=r.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),r=r.replace(/\\(\$\{[^}]*\})/g,(o,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\(#\{[^}]*\})/g,(o,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\DOUBLE_ESC_VAR/g,"\\"),r=r.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let s=[...r.matchAll(ia)],n=[...r.matchAll(sa)],a=[...s.map(o=>({match:o,type:"variable"})),...n.map(o=>({match:o,type:"pathref"}))].sort((o,c)=>o.match.index-c.match.index);if(a.length===0){let o=r;for(let c=0;c<i.length;c++)o=o.replace(`__ESCAPED_${c}__`,i[c]);return{type:v.LITERAL,value:o}}if(a.length===1&&a[0].match[0]===r&&i.length===0){let{match:o,type:c}=a[0];try{return c==="variable"?lt(o[1],t):si(o[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:v.LITERAL,value:r};throw d}}let p=[],l=0;for(let{match:o,type:c}of a){let[d,u]=o,f=o.index;if(f>l){let h=r.substring(l,f);for(let m=0;m<i.length;m++)h=h.replace(`__ESCAPED_${m}__`,i[m]);h&&p.push(h)}try{let h;c==="variable"?h=lt(u.trim(),t):h=si(u.trim()),p.push(h)}catch(h){if(h.message==="Invalid array index syntax")p.push(d);else throw h}l=f+d.length}if(l<r.length){let o=r.substring(l);for(let c=0;c<i.length;c++)o=o.replace(`__ESCAPED_${c}__`,i[c]);o&&p.push(o)}return{type:v.INTERPOLATION,parts:p}},Ae=(e,t)=>typeof e=="string"?Bi(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?ca(e,t):ha(e,t):{type:v.LITERAL,value:e},da=e=>{let{$each:t,...r}=e;if(typeof t!="string")throw new $("$each value must be a non-empty string");let i=t.trim();if(i==="")throw new $("$each value must be a non-empty string");if(Object.keys(r).length===0)throw new $("Empty $each body not allowed");if(r.$partial!==void 0)throw new $("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${i}`]:r}},ca=(e,t)=>{let r=[],i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let l=da(n),o=Object.keys(l);if(o.length===1&&/^\$for(?::\w+)?\s/.test(o[0])){let c=ni(o[0],l[o[0]],t,!0);r.push(c),i=!0;continue}}catch(l){throw l instanceof $?l:new $(l.message)}let p=Object.keys(n);if(p.length===1&&/^\$for(?::\w+)?\s/.test(p[0])){let l=ni(p[0],n[p[0]],t);r.push(l),i=!0;continue}}let a=Ae(n,t);r.push(a),(a.type===v.FUNCTION||a.type===v.CONDITIONAL||a.type===v.LOOP||a.type===v.PARTIAL||a.type===v.OBJECT&&!a.fast||a.type===v.ARRAY&&!a.fast)&&(i=!0)}return{type:v.ARRAY,items:r,fast:!i}},ha=(e,t)=>{let r=[],i=!1,s=null,n=Object.entries(e),a=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new $("$partial value must be a string");if(e.$partial.trim()==="")throw new $("$partial value cannot be an empty string");let l=["$if","$elif","$else","$for"],o=[];for(let[b]of n)for(let y of l)if(b===y||b.startsWith(y+" ")||b.startsWith(y+"#")){o.push(y);break}if(o.length>0)throw new $(`Cannot use $partial with ${o.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...u}=e,f={},h=!1;for(let[b,y]of Object.entries(u)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=y,h=!0}let m=null;if(h&&(m=Ae(f,t),m.type===v.OBJECT)){let b=!1;for(let y of m.properties)if(y.value.type===v.VARIABLE||y.value.type===v.INTERPOLATION||y.value.type===v.FUNCTION||y.value.type===v.CONDITIONAL||y.value.type===v.OBJECT&&!y.value.fast||y.value.type===v.ARRAY&&!y.value.fast){b=!0;break}b&&(m.fast=!1)}let g={type:v.PARTIAL,name:c,data:m};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new $("Empty condition expression after '$when'");b=Q(d,t)}else b={type:v.LITERAL,value:d};g.whenCondition=b}return g}for(let[l,o]of n)if(l==="$when"){if(s!==null)throw new $("Multiple '$when' directives on the same object are not allowed");if(o==null)throw new $("Missing condition expression after '$when'");let c=typeof o=="string"?o:JSON.stringify(o);if(c.trim()==="")throw new $("Empty condition expression after '$when'");s=Q(c,t),i=!0}else if(l.startsWith("$when#")||l.startsWith("$when "))throw new $("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;a<n.length;){let[l,o]=n[a];if(l==="$when"){a++;continue}if(l==="$each")throw new $("$each can only be used inside arrays");if(l.startsWith("$if ")||l.match(/^\$if#\w+\s/)||l.match(/^\$if\s+\w+.*:$/)){let c=ua(n,a,t);r.push({key:l,value:c.node}),i=!0,a=c.nextIndex}else if(/^\$for(?::\w+)?\s/.test(l)){let c=l.match(/^\$for(?::(\w+))?\s/)?.[1]||"",d=c?`:${c}`:"";throw new $(`$for loops must be inside arrays - use '- $for${d} item in items:' instead of '$for${d} item in items:'. For cleaner object generation syntax, consider using $each.`)}else{if(l.startsWith("$elif ")||l.startsWith("$else"))throw new $(`'${l.split(" ")[0]}' without matching '$if'`);if(l==="$if"||l==="$if:")throw new $("Missing condition expression after '$if'");{let c=Ae(o,t);(c.type===v.FUNCTION||c.type===v.CONDITIONAL||c.type===v.PARTIAL||c.type===v.OBJECT&&!c.fast||c.type===v.ARRAY&&!c.fast)&&(i=!0);let d=Bi(l,t),u={key:l,value:c};(d.type!==v.LITERAL||d.value!==l)&&(u.parsedKey=d),r.push(u),a++}}}let p={type:v.OBJECT,properties:r,fast:!i};return s&&(p.whenCondition=s),p},ua=(e,t,r={})=>{let i=[],s=[],n=t,[a,p]=e[n],l=null,o;if(a.startsWith("$if#")){let d=a.match(/^\$if#(\w+)\s+(.+)$/);if(d)l=d[1],o=d[2];else throw new $(`Invalid conditional syntax: ${a}`)}else o=a.substring(4),o.endsWith(":")&&(o=o.slice(0,-1).trim());ri(o);let c=Q(o,r);for(i.push(c),s.push(Ae(p,r)),n++;n<e.length;){let[d,u]=e[n],f=!1,h;if(l?d.startsWith(`$elif#${l} `)?(h=d.substring(`$elif#${l} `.length),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(d===`$else#${l}`||d===`$else#${l}:`)&&(f=!0,h=null):d.startsWith("$elif ")?(h=d.substring(6),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,h=null),f){if(h===null)i.push(null);else{ri(h);let m=Q(h,r);i.push(m)}if(s.push(Ae(u,r)),n++,h===null)break}else break}return{node:{type:v.CONDITIONAL,conditions:i,bodies:s,id:l},nextIndex:n}},Q=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let o=e.slice(1,-1),c=0,d=!0;for(let u=0;u<o.length;u++)if(o[u]==="("?c++:o[u]===")"&&c--,c<0){d=!1;break}if(d&&c===0)return Q(o,t)}let r=Oe(e,"||");if(r!==-1)return{type:v.BINARY,op:P.OR,left:Q(e.substring(0,r).trim(),t),right:Q(e.substring(r+2).trim(),t)};let i=Oe(e,"&&");if(i!==-1)return{type:v.BINARY,op:P.AND,left:Q(e.substring(0,i).trim(),t),right:Q(e.substring(i+2).trim(),t)};let s=[{op:">=",type:P.GTE},{op:"<=",type:P.LTE},{op:"==",type:P.EQ},{op:"!=",type:P.NEQ},{op:">",type:P.GT},{op:"<",type:P.LT},{op:" in ",type:P.IN}];for(let{op:o,type:c}of s){let d=Oe(e,o);if(d!==-1)return{type:v.BINARY,op:c,left:Q(e.substring(0,d).trim(),t),right:Q(e.substring(d+o.length).trim(),t)}}let n=-1,a=null,p=[{op:" + ",type:P.ADD},{op:" - ",type:P.SUBTRACT}];for(let{op:o,type:c}of p){let d=0;for(;d<e.length;){let u=Oe(e.substring(d),o);if(u===-1)break;let f=d+u;f>n&&(n=f,a={op:o,type:c}),d=f+o.length}}if(n!==-1&&a)return{type:v.BINARY,op:a.type,left:Q(e.substring(0,n).trim(),t),right:Q(e.substring(n+a.op.length).trim(),t)};let l=[" * "," / "," % "];for(let o of l)if(Oe(e,o)!==-1)throw new $(`Arithmetic operations are not allowed in conditionals: "${o}"`);return e.startsWith("!")?{type:v.UNARY,op:tr.NOT,operand:Q(e.substring(1).trim(),t)}:Di(e,t)},Oe=(e,t)=>{let r=0,i=0;for(;i<=e.length-t.length;){if(e[i]==="(")r++;else if(e[i]===")")r--;else if(r===0&&e.substring(i,i+t.length)===t)return i;i++}return-1},fa=e=>{if(e=e.trim(),e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:v.LITERAL,value:""};if(e==="{}")return{type:v.LITERAL,value:{}};if(e==="[]")return{type:v.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:v.LITERAL,value:t}:{type:v.VARIABLE,path:e}},Di=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return lt(r,t);let i=fa(r);if(i.type===v.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:v.VARIABLE,path:r};try{return lt(r,t)}catch(s){if(s.message&&s.message.includes("not supported"))return i;throw s}},ma=(e,t=!1)=>{try{Dn(e)}catch(r){if(r instanceof $&&t){let i=r.message.replace(/\$for/g,"$each");throw new $(i.replace("Parse Error: ",""))}throw r}},ni=(e,t,r,i=!1)=>{let s=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(s);if(!n){let g=i?"$each":"$for";throw new $(`Invalid loop syntax (got: '${e.replace("$for",g)}')`)}let a=n[1],p=n[2].trim();ma(p,i);let l=p.match(/^(.+?)\s+in\s+(.+)$/);if(!l){let g=i?"$each":"$for";throw new $(`Invalid loop syntax - missing 'in' keyword (got: '${g} ${p}')`)}let o=l[1].trim(),c=l[2].trim(),d,u=null;if(o.includes(",")){let g=o.split(",").map(b=>b.trim());if(g.length!==2)throw new $(`Invalid loop variables: ${o}. Expected format: "item" or "item, index"`);d=g[0],u=g[1]}else d=o;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new $(`Reserved variable name: ${d}`);if(u&&f.includes(u))throw new $(`Reserved variable name: ${u}`);let h=Di(c,r),m=Ae(t,r);return{type:v.LOOP,itemVar:d,indexVar:u,iterable:h,body:m,flatten:a!=="nested"}},ai=(e,t={})=>{let{functions:r={}}=t;return Ae(e,r)},ya=()=>Date.now(),ga=Object.freeze(Object.defineProperty({__proto__:null,now:ya},Symbol.toStringTag,{value:"Module"})),ba=(e,t,r={})=>{let{functions:i={},partials:s={}}=r,n={...ga,...i},a=ai(e,{functions:n}),p={};for(let[l,o]of Object.entries(s))p[l]=ai(o,{functions:n});return Wn(a,t,{functions:n,partials:p})},ur=e=>e!==null&&typeof e=="object",pt=e=>ur(e)&&!Array.isArray(e),va=e=>typeof e=="string"&&e.includes("."),zi=e=>typeof e=="string"&&/[\[\]]/.test(e);function Fi(e,t){let r={};for(let i of t){if(typeof i!="string"||i.length===0)continue;let s=pe(e,i);s!==void 0&&he(r,i,s)}return r}function wa(e){if(!pt(e)||!Array.isArray(e.fields))return e;let t=(r=[])=>r.map(i=>{if(!pt(i))return i;if(typeof i.$when=="string"&&i.$when.trim().length>0){let{$when:s,...n}=i,a=Array.isArray(n.fields)?{...n,fields:t(n.fields)}:n;return{[`$if ${s}`]:a}}return Array.isArray(i.fields)?{...i,fields:t(i.fields)}:i});return{...e,fields:t(e.fields)}}var pe=(e,t,r=void 0)=>{if(!t||!ur(e)||zi(t))return r;let i=t.split(".").filter(n=>n!==""),s=e;for(let n of i){if(s==null||!(n in s))return Object.prototype.hasOwnProperty.call(e,t)?e[t]:r;s=s[n]}return s},he=(e,t,r)=>{if(!ur(e)||typeof t!="string"||t.length===0||zi(t))return e;let i=t.split(".").filter(n=>n!=="");if(i.length===0)return e;va(t)&&Object.prototype.hasOwnProperty.call(e,t)&&delete e[t];let s=e;for(let n=0;n<i.length-1;n++){let a=i[n];(!(a in s)||typeof s[a]!="object"||s[a]===null)&&(s[a]={}),s=s[a]}return s[i[i.length-1]]=r,e},_a=["id","class","style","slot","form","defaultValues","disabled","context"],xa=(e={})=>Object.entries(e).filter(([t,r])=>!(_a.includes(t)||r==null||typeof r=="object"||typeof r=="function")).map(([t,r])=>`${t}=${String(r)}`).join(" "),Sa={email:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,url:/^https?:\/\/.+/},ce={required:"This field is required",minLength:e=>`Must be at least ${e} characters`,maxLength:e=>`Must be at most ${e} characters`,pattern:"Invalid format",invalidDate:"Invalid date format",invalidTime:"Invalid time format",invalidDateTime:"Invalid date and time format",minTemporal:e=>`Must be on or after ${e}`,maxTemporal:e=>`Must be on or before ${e}`},Aa="input-date",Ea="input-time",ka="input-datetime",$a=/^(\d{4})-(\d{2})-(\d{2})$/,Ca=/^(\d{2}):(\d{2})(?::(\d{2}))?$/,Ia=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}(?::\d{2})?)$/,Ta=e=>{if(typeof e!="string")return null;let t=$a.exec(e);if(!t)return null;let r=Number(t[1]),i=Number(t[2]),s=Number(t[3]);if(!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(s)||i<1||i>12||s<1||s>31)return null;let n=new Date(Date.UTC(r,i-1,s));return n.getUTCFullYear()===r&&n.getUTCMonth()===i-1&&n.getUTCDate()===s?{year:r,month:i,day:s}:null},Oa=e=>{if(typeof e!="string")return null;let t=Ca.exec(e);if(!t)return null;let r=Number(t[1]),i=Number(t[2]),s=t[3]===void 0?0:Number(t[3]);return!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(s)||r<0||r>23||i<0||i>59||s<0||s>59?null:{hour:r,minute:i,second:s}},Wi=e=>{let t=Oa(e);return t?`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}`:null},Mi=e=>Ta(e)?e:null,La=e=>{if(typeof e!="string")return null;let t=Ia.exec(e);if(!t)return null;let r=Mi(t[1]),i=Wi(t[2]);return!r||!i?null:`${r}T${i}`},Na=e=>e===Aa?{normalize:Mi,invalidMessage:ce.invalidDate}:e===Ea?{normalize:Wi,invalidMessage:ce.invalidTime}:e===ka?{normalize:La,invalidMessage:ce.invalidDateTime}:null,Ra=(e,t)=>{let r=Na(e.type);if(!r||t==null||t==="")return null;let i=r.normalize(String(t));if(!i)return r.invalidMessage;if(e.min!==void 0&&e.min!==null&&String(e.min)!==""){let s=r.normalize(String(e.min));if(s&&i<s)return ce.minTemporal(String(e.min))}if(e.max!==void 0&&e.max!==null&&String(e.max)!==""){let s=r.normalize(String(e.max));if(s&&i>s)return ce.maxTemporal(String(e.max))}return null},mt=(e,t)=>{if(e.required){let i=t==null||t===""||typeof t=="boolean"&&t===!1,s=e.type==="input-number"&&t===null;if(e.type==="input-number"?s:i)return typeof e.required=="object"&&e.required.message?e.required.message:ce.required}let r=Ra(e,t);if(r)return r;if(Array.isArray(e.rules))for(let i of e.rules){let s=Va(i,t);if(s)return s}return null},Va=(e,t)=>{if(t==null||t==="")return null;let r=String(t);switch(e.rule){case"minLength":return r.length<e.value?e.message||ce.minLength(e.value):null;case"maxLength":return r.length>e.value?e.message||ce.maxLength(e.value):null;case"pattern":{let i=Sa[e.value];if(!i)try{i=new RegExp(e.value)}catch{return e.message||ce.pattern}return i.test(r)?null:e.message||ce.pattern}default:return null}},yt=(e,t)=>{let r={},i=se(e);for(let s of i){let n=pe(t,s.name),a=mt(s,n);a&&(r[s.name]=a)}return{valid:Object.keys(r).length===0,errors:r}},ja=["section","read-only-text","slot"],fr=e=>!ja.includes(e.type),se=e=>{let t=[];for(let r of e)r.type==="section"&&Array.isArray(r.fields)?t.push(...se(r.fields)):fr(r)&&t.push(r);return t},mr=e=>{switch(e.type){case"input-text":case"input-date":case"input-time":case"input-datetime":case"input-textarea":case"popover-input":return"";case"input-number":return null;case"select":return null;case"checkbox":return!1;case"color-picker":return"#000000";case"slider":case"slider-with-input":return e.min!==void 0?e.min:0;case"image":return null;default:return null}},yr=(e,t=0)=>{let r=[],i=t;for(let s of e)if(s.type==="section"){if(r.push({...s,_isSection:!0,_idx:i}),i++,Array.isArray(s.fields)){let n=yr(s.fields,i);r.push(...n),i+=n.length}}else r.push({...s,_isSection:!1,_idx:i}),i++;return r},Pa=()=>Object.freeze({formValues:{},errors:{},reactiveMode:!1,tooltipState:{open:!1,x:0,y:0,content:""}}),ee=({state:e,props:t})=>{let{form:r={}}=t||{},i=wa(r),s=pt(t?.context)?t.context:{},n=pt(e?.formValues)?e.formValues:{},a={...s,...n,formValues:n};return Object.keys(a).length>0?ba(i,a):i},Ba=({state:e,props:t})=>{let r=xa(t),i=ee({state:e,props:t}),s=i.fields||[],n=!!t?.disabled,a=yr(s);a.forEach((d,u)=>{if(d._arrIdx=u,d._isSection)return;let f=fr(d);if(d._disabled=n||!!d.disabled,f&&d.name&&(d._error=e.errors[d.name]||null),d.type==="input-text"&&(d._inputType=d.inputType||"text"),d.type==="select"){let h=pe(e.formValues,d.name);d._selectedValue=h!==void 0?h:null,d.placeholder=d.placeholder||"",d.noClear=d.clearable===!1}if(d.type==="image"){let h=pe(e.formValues,d.name);d._imageSrc=h&&String(h).trim()?h:null,d.placeholderText=d.placeholderText||"No Image"}if(d.type==="read-only-text"&&(d.content=d.content||""),d.type==="checkbox"){let h=typeof d.content=="string"?d.content:typeof d.checkboxLabel=="string"?d.checkboxLabel:"";d._checkboxText=h}});let p=i.actions||{buttons:[]},l=p.layout||"split",o=(p.buttons||[]).map((d,u)=>({...d,_globalIdx:u,variant:d.variant||"se",_disabled:n||!!d.disabled,pre:d.pre||"",suf:d.suf||""})),c;return l==="split"?c={_layout:"split",buttons:o,_leftButtons:o.filter(d=>d.align==="left"),_rightButtons:o.filter(d=>d.align!=="left")}:c={_layout:l,buttons:o,_allButtons:o},{containerAttrString:r,title:i?.title||"",description:i?.description||"",flatFields:a,actions:c,formValues:e.formValues,tooltipState:e.tooltipState}},Ce=({state:e,props:t})=>{let r=ee({state:e,props:t}),i=se(r.fields||[]);return Fi(e.formValues,i.map(s=>s.name).filter(s=>typeof s=="string"&&s.length>0))},Da=({state:e,props:t},r={})=>{let{name:i,value:s}=r;i&&(he(e.formValues,i,s),Ze({state:e,props:t}))},Ze=({state:e,props:t})=>{if(!t)return;let r=ee({state:e,props:t}),i=se(r.fields||[]);e.formValues=Fi(e.formValues,i.map(s=>s.name).filter(s=>typeof s=="string"&&s.length>0))},za=({state:e},t={})=>{let{values:r}=t;!r||typeof r!="object"||Object.keys(r).forEach(i=>{he(e.formValues,i,r[i])})},Fa=({state:e},t={})=>{let{defaultValues:r={}}=t;e.formValues=r?structuredClone(r):{},e.errors={},e.reactiveMode=!1},Wa=({state:e},t={})=>{e.errors=t.errors||{}},Ma=({state:e},t={})=>{let{name:r}=t;r&&e.errors[r]&&delete e.errors[r]},Ka=({state:e})=>{e.reactiveMode=!0},Ua=({state:e},t={})=>{let{x:r,y:i,content:s}=t;e.tooltipState={open:!0,x:r,y:i,content:s}},Ha=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},qa=Object.freeze(Object.defineProperty({__proto__:null,clearFieldError:Ma,collectAllDataFields:se,createInitialState:Pa,flattenFields:yr,get:pe,getDefaultValue:mr,hideTooltip:Ha,isDataField:fr,pruneHiddenValues:Ze,resetFormValues:Fa,selectForm:ee,selectFormValues:Ce,selectViewData:Ba,set:he,setErrors:Wa,setFormFieldValue:Da,setFormValues:za,setReactiveMode:Ka,showTooltip:Ua,validateField:mt,validateForm:yt},Symbol.toStringTag,{value:"Module"})),Ki=({field:e,target:t,value:r})=>{!e||!t||["slider-with-input","popover-input"].includes(e.type)&&(r==null?t.removeAttribute("value"):t.setAttribute("value",String(r)))},Ui=({form:e,formValues:t={},refs:r,formDisabled:i=!1})=>{let s=e.fields||[],n=0,a=p=>{for(let l of p){if(l.type==="section"){n++,Array.isArray(l.fields)&&a(l.fields);continue}let o=r[`field${n}`];if(n++,!o)continue;let c=i||!!l.disabled;if(["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"].includes(l.type)){let d=pe(t,l.name);if(d==null?o.removeAttribute("value"):o.setAttribute("value",String(d)),l.type==="slider-with-input"&&o.store?.setValue){let u=Number(d??0);o.store.setValue({value:Number.isFinite(u)?u:0}),typeof o.render=="function"&&o.render()}l.type==="popover-input"&&o.store?.setValue&&(o.store.setValue({value:d==null?"":String(d)}),typeof o.render=="function"&&o.render())}l.type==="checkbox"&&(pe(t,l.name)?o.setAttribute("checked",""):o.removeAttribute("checked")),["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input"].includes(l.type)&&l.placeholder&&o.getAttribute("placeholder")!==l.placeholder&&(l.placeholder===void 0||l.placeholder===null?o.removeAttribute("placeholder"):o.setAttribute("placeholder",l.placeholder)),c?o.setAttribute("disabled",""):o.removeAttribute("disabled")}};a(s)},Ga=(e,t)=>{let r=t?.defaultValues||{},i={};Object.keys(r).forEach(p=>{he(i,p,r[p])});let s=ee({state:{formValues:i},props:t}),n=se(s.fields||[]),a={};for(let p of n){let l=pe(r,p.name);l!==void 0?he(a,p.name,l):he(a,p.name,mr(p))}e.resetFormValues({defaultValues:a})},Ja=e=>{let{store:t,props:r}=e;Ga(t,r)},Ya=e=>{let{props:t,refs:r,render:i}=e,s=e.store.getState(),n=ee({state:s,props:t});Ui({form:n,formValues:s.formValues,refs:r,formDisabled:!!t?.disabled}),i()},Xa=(e,t)=>{let{newProps:r}=t,{store:i,render:s,refs:n}=e,a=!!r?.disabled,p=i.getState();Ze({state:p,props:r});let l=ee({state:p,props:r});Ui({form:l,formValues:p.formValues,refs:n,formDisabled:a}),s()},Qa=(e,t)=>{let{store:r,dispatchEvent:i,render:s,props:n}=e,a=t._event,p=a.currentTarget.dataset.fieldName;if(!p||!a.detail||!Object.prototype.hasOwnProperty.call(a.detail,"value"))return;let l=a.detail.value;r.setFormFieldValue({name:p,value:l});let o=r.getState();Ze({state:o,props:n});let c=ee({state:o,props:n}),d=se(c.fields||[]).find(u=>u.name===p);if(Ki({field:d,target:a.currentTarget,value:l}),o.reactiveMode&&d){let u=mt(d,l);u?r.setErrors({errors:{...o.errors,[p]:u}}):r.clearFieldError({name:p})}s(),i(new CustomEvent("form-input",{bubbles:!0,detail:{name:p,value:l,values:Ce({state:r.getState(),props:n})}}))},Za=(e,t)=>{let{store:r,dispatchEvent:i,render:s,props:n}=e,a=t._event,p=a.currentTarget.dataset.fieldName;if(!p||!a.detail||!Object.prototype.hasOwnProperty.call(a.detail,"value"))return;let l=a.detail.value;r.setFormFieldValue({name:p,value:l});let o=r.getState();Ze({state:o,props:n});let c=ee({state:o,props:n}),d=se(c.fields||[]).find(u=>u.name===p);if(Ki({field:d,target:a.currentTarget,value:l}),o.reactiveMode&&d){let u=mt(d,l);u?r.setErrors({errors:{...o.errors,[p]:u}}):r.clearFieldError({name:p})}s(),i(new CustomEvent("form-change",{bubbles:!0,detail:{name:p,value:l,values:Ce({state:r.getState(),props:n})}}))},eo=(e,t)=>{let{store:r,dispatchEvent:i,render:s,props:n}=e,a=t._event.currentTarget.dataset.actionId;if(!a)return;let p=r.getState(),l=ee({state:p,props:n}),o=((l.actions||{}).buttons||[]).find(d=>d.id===a),c=Ce({state:p,props:n});if(o&&o.validate){let d=se(l.fields||[]),{valid:u,errors:f}=yt(d,p.formValues);r.setErrors({errors:f}),u||r.setReactiveMode(),s(),i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:a,values:c,valid:u,errors:f}}))}else i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:a,values:c}}))},to=(e,t)=>{let r=t._event;r.type==="contextmenu"&&r.preventDefault();let{store:i,dispatchEvent:s,props:n}=e,a=r.currentTarget.dataset.fieldName;s(new CustomEvent("form-field-event",{bubbles:!0,detail:{name:a,event:r.type,values:Ce({state:i.getState(),props:n})}}))},ro=(e,t)=>{let{store:r,dispatchEvent:i,render:s,props:n}=e,a=t._event;if(a.key==="Enter"&&!a.shiftKey){let p=a.target;if(p.tagName==="TEXTAREA"||p.tagName==="RTGL-TEXTAREA")return;a.preventDefault();let l=r.getState(),o=ee({state:l,props:n}),c=(o.actions||{}).buttons||[],d=c.find(f=>f.validate)||c[0];if(!d)return;let u=Ce({state:l,props:n});if(d.validate){let f=se(o.fields||[]),{valid:h,errors:m}=yt(f,l.formValues);r.setErrors({errors:m}),h||r.setReactiveMode(),s(),i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:u,valid:h,errors:m}}))}else i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:u}}))}},io=(e,t)=>{let{store:r,render:i,props:s}=e,n=t._event,a=n.currentTarget.dataset.fieldName,p=ee({state:r.getState(),props:s}),l=se(p.fields||[]).find(o=>o.name===a);if(l&&l.tooltip){let o=n.currentTarget.getBoundingClientRect();r.showTooltip({x:o.left+o.width/2,y:o.top-8,content:typeof l.tooltip=="string"?l.tooltip:l.tooltip.content||""}),i()}},so=e=>{let{store:t,render:r}=e;t.hideTooltip({}),r()},no=Object.freeze(Object.defineProperty({__proto__:null,handleActionClick:eo,handleAfterMount:Ya,handleBeforeMount:Ja,handleImageClick:to,handleKeyDown:ro,handleOnUpdate:Xa,handleTooltipMouseEnter:io,handleTooltipMouseLeave:so,handleValueChange:Za,handleValueInput:Qa},Symbol.toStringTag,{value:"Module"})),ao=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"],oo=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input","slider-with-input"],lo=({ref:e,fieldType:t,value:r,forceRefresh:i=!1})=>{if(ao.includes(t)){if(i&&e.removeAttribute("value"),r==null){if(oo.includes(t)&&i){if(t==="popover-input"){e.removeAttribute("value");return}e.setAttribute("value","");return}e.removeAttribute("value");return}e.setAttribute("value",String(r))}},Hi=({ref:e,value:t})=>{e&&e?.store?.updateSelectedValue&&(e.store.updateSelectedValue({value:t}),typeof e.render=="function"&&e.render())},po=e=>{let t=new Map;return!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("[data-field-name]").forEach(r=>{let i=r.getAttribute("data-field-name");i&&t.set(i,r)}),t},oi=e=>e?.renderTarget?e.renderTarget:e?.shadowRoot?e.shadowRoot:e?.shadow,co=({root:e,values:t={}})=>{!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("rtgl-select[data-field-name]").forEach(r=>{let i=r.dataset?.fieldName;if(!i)return;let s=pe(t,i);Hi({ref:r,value:s})})},ho=function(){let e=this.store.getState();return Ce({state:e,props:this.props})},uo=function(e={}){let t=e&&typeof e=="object"&&e.values&&typeof e.values=="object"?e.values:e;if(!t||typeof t!="object"||Array.isArray(t))return;this.store.setFormValues({values:t}),this.store.pruneHiddenValues();let r=this.store.getState(),i=ee({state:r,props:this.props}),s=se(i.fields||[]),n=po(oi(this));for(let p of s){if(!p.name)continue;let l=n.get(p.name);if(!l)continue;let o=Object.prototype.hasOwnProperty.call(t,p.name),c=pe(t,p.name);if(!o&&c===void 0)continue;let d=pe(r.formValues,p.name);lo({ref:l,fieldType:p.type,value:d,forceRefresh:!0}),typeof l?.tagName=="string"&&l.tagName.toUpperCase()==="RTGL-SELECT"&&Hi({ref:l,value:d}),p.type==="checkbox"&&(d?l.setAttribute("checked",""):l.removeAttribute("checked"))}this.render();let a=()=>{let p=this.store.getState();co({root:oi(this),values:p.formValues})};a(),setTimeout(()=>{a()},0)},fo=function(){let e=this.store.getState(),t=ee({state:e,props:this.props}),r=se(t.fields||[]),{valid:i,errors:s}=yt(r,e.formValues);return this.store.setErrors({errors:s}),i||this.store.setReactiveMode(),this.render(),{valid:i,errors:s}},mo=function(){let e=this.props?.defaultValues||{},t={};Object.keys(e).forEach(n=>{he(t,n,e[n])});let r=ee({state:{formValues:t},props:this.props}),i=se(r.fields||[]),s={};for(let n of i){let a=pe(e,n.name);a!==void 0?he(s,n.name,a):he(s,n.name,mr(n))}this.store.resetFormValues({defaultValues:s}),this.setValues(s)},yo=Object.freeze(Object.defineProperty({__proto__:null,getValues:ho,reset:mo,setValues:uo,validate:fo},Symbol.toStringTag,{value:"Module"})),go=e=>{let t=e.selectUiType();return t==="dropdown"||t==="formDialog"?null:e.selectConfig().mode==="confirm"?!1:null},ge=({store:e,render:t,globalUI:r,emitResult:i=!1,result:s})=>{if(!e.selectIsOpen())return;let n=s!==void 0?s:go(e);e.closeAll(),t(),i&&r.emit("event",n)},gt=({store:e,render:t,globalUI:r})=>{e.selectIsOpen()&&ge({store:e,render:t,globalUI:r,emitResult:!0})},bo=(e,t)=>{setTimeout(()=>{let{store:r,refs:i}=e;if(!r.selectIsOpen()||r.selectUiType()!=="formDialog")return;let s=r.selectFormDialogConfig?.();if(!s||s.key!==t||typeof s.mount!="function")return;let n=i.formDialog;n&&s.mount(n)},0)},vo=e=>{let{store:t,render:r,globalUI:i}=e;ge({store:t,render:r,globalUI:i,emitResult:!0})},wo=e=>{let{store:t,render:r,globalUI:i}=e,s=t.selectConfig().mode==="confirm"?!0:null;ge({store:t,render:r,globalUI:i,emitResult:!0,result:s})},_o=e=>{let{store:t,render:r,globalUI:i}=e;ge({store:t,render:r,globalUI:i,emitResult:!0,result:!1})},xo=e=>{let{store:t,render:r,globalUI:i}=e;ge({store:t,render:r,globalUI:i,emitResult:!0,result:null})},So=(e,t)=>{let{store:r,render:i,globalUI:s}=e,n=t._event,{index:a,item:p}=n.detail;ge({store:r,render:i,globalUI:s,emitResult:!0,result:{index:a,item:p}})},Ao=(e,t)=>{let{store:r,render:i,globalUI:s}=e,n=t;return gt({store:r,render:i,globalUI:s}),r.setAlertConfig(n),i(),new Promise(a=>{s.once("event",()=>{a()})})},Eo=async(e,t)=>{let{store:r,render:i,globalUI:s}=e,n=t;return gt({store:r,render:i,globalUI:s}),r.setConfirmConfig(n),i(),new Promise(a=>{s.once("event",p=>{a(p)})})},ko=async(e,t)=>{let{store:r,render:i,globalUI:s}=e,n=t;return gt({store:r,render:i,globalUI:s}),r.setDropdownConfig(n),i(),new Promise(a=>{s.once("event",p=>{a(p)})})},$o=async(e,t)=>{let{store:r,render:i,globalUI:s}=e,n=t;gt({store:r,render:i,globalUI:s}),r.setFormDialogConfig(n),i();let a=r.selectFormDialogConfig?.().key;return bo(e,a),new Promise(p=>{s.once("event",l=>{p(l)})})},Co=(e,t)=>{let{store:r,render:i,globalUI:s}=e,n=t._event?.detail||{};n.valid!==!1&&ge({store:r,render:i,globalUI:s,emitResult:!0,result:n})},Io=(e,t)=>{let{store:r,refs:i}=e,s=t._event?.detail||{},n=r.selectFormDialogConfig?.();typeof n?.onFieldEvent=="function"&&n.onFieldEvent({detail:s,formEl:i.formDialog||null})},To=e=>{let{store:t,render:r,globalUI:i}=e;ge({store:t,render:r,globalUI:i,emitResult:!0})},Oo=Object.freeze(Object.defineProperty({__proto__:null,handleCancel:_o,handleCloseAll:To,handleConfirm:wo,handleDialogClose:vo,handleDropdownClose:xo,handleDropdownItemClick:So,handleFormAction:Co,handleFormFieldEvent:Io,handleShowAlert:Ao,handleShowConfirm:Eo,handleShowDropdownMenu:ko,handleShowFormDialog:$o},Symbol.toStringTag,{value:"Module"})),Lo=new Set(["sm","md","lg","f"]),li=e=>!e||typeof e!="object"||Array.isArray(e)?{}:e,rr=(e,t="md")=>Lo.has(e)?e:t,No=()=>Object.freeze({isOpen:!1,uiType:"dialog",config:{status:void 0,title:"",message:"",confirmText:"OK",cancelText:"Cancel",mode:"alert"},dropdownConfig:{items:[],x:0,y:0,place:"bs"},formDialogConfig:{form:null,defaultValues:{},context:{},disabled:!1,size:"md",key:0,onFieldEvent:null,mount:null}}),Ro=({state:e},t={})=>{if(!t.message)throw new Error("message is required for showAlert");e.config={status:t.status||void 0,title:t.title||"",message:t.message,confirmText:t.confirmText||"OK",cancelText:"",mode:"alert"},e.uiType="dialog",e.isOpen=!0},Vo=({state:e},t={})=>{if(!t.message)throw new Error("message is required for showConfirm");e.config={status:t.status||void 0,title:t.title||"",message:t.message,confirmText:t.confirmText||"Yes",cancelText:t.cancelText||"Cancel",mode:"confirm"},e.uiType="dialog",e.isOpen=!0},jo=({state:e},t={})=>{if(!t.items||!Array.isArray(t.items))throw new Error("items array is required for showDropdown");e.dropdownConfig={items:t.items,x:t.x||0,y:t.y||0,place:t.place||"bs"},e.uiType="dropdown",e.isOpen=!0},Po=({state:e},t={})=>{if(!t.form||typeof t.form!="object"||Array.isArray(t.form))throw new Error("form object is required for showFormDialog");let r=e.formDialogConfig?.key||0;e.formDialogConfig={form:t.form,defaultValues:li(t.defaultValues),context:li(t.context),disabled:!!t.disabled,size:rr(t.size,"md"),key:r+1,onFieldEvent:typeof t.onFieldEvent=="function"?t.onFieldEvent:null,mount:typeof t.mount=="function"?t.mount:null},e.uiType="formDialog",e.isOpen=!0},Bo=({state:e})=>{e.isOpen=!1,e.uiType="dialog"},Do=({state:e})=>e.config,zo=({state:e})=>e.dropdownConfig,Fo=({state:e})=>e.formDialogConfig,Wo=({state:e})=>e.uiType,Mo=({state:e})=>e.isOpen,Ko=({state:e})=>{let t=e.isOpen&&e.uiType==="dialog",r=e.isOpen&&e.uiType==="formDialog";return{isOpen:e.isOpen,uiType:e.uiType,config:e.config,dropdownConfig:{items:e.dropdownConfig?.items||[],x:e.dropdownConfig?.x||0,y:e.dropdownConfig?.y||0,place:e.dropdownConfig?.place||"bs"},formDialogConfig:{form:e.formDialogConfig?.form||{fields:[],actions:{buttons:[]}},defaultValues:e.formDialogConfig?.defaultValues||{},context:e.formDialogConfig?.context||{},disabled:!!e.formDialogConfig?.disabled,size:rr(e.formDialogConfig?.size,"md"),key:e.formDialogConfig?.key||0},isDialogOpen:t,isFormDialogOpen:r,isDialogContainerOpen:t||r,isDropdownOpen:e.isOpen&&e.uiType==="dropdown",dialogSize:r?rr(e.formDialogConfig?.size,"md"):"sm"}},Uo=Object.freeze(Object.defineProperty({__proto__:null,closeAll:Bo,createInitialState:No,selectConfig:Do,selectDropdownConfig:zo,selectFormDialogConfig:Fo,selectIsOpen:Mo,selectUiType:Wo,selectViewData:Ko,setAlertConfig:Ro,setConfirmConfig:Vo,setDropdownConfig:jo,setFormDialogConfig:Po},Symbol.toStringTag,{value:"Module"})),Ho=(e,t)=>{let{dispatchEvent:r,store:i}=e;t._event,console.log("handle click start",i.selectPath()),r(new CustomEvent("start-click",{detail:{path:i.selectPath()}}))},qo=Object.freeze(Object.defineProperty({__proto__:null,handleClickStart:Ho},Symbol.toStringTag,{value:"Module"})),Go=()=>Object.freeze({}),Jo=["id","class","style","slot","start"],Yo=(e={})=>Object.entries(e).filter(([t])=>!Jo.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Xo=e=>{if(e!=null){if(typeof e=="object")return e;if(typeof e=="string")try{return JSON.parse(decodeURIComponent(e))}catch{try{return JSON.parse(e)}catch{return}}}},Qo=({props:e})=>{let t=Xo(e.start)||e.start;return{containerAttrString:Yo(e),start:t||{label:"",image:{src:"",width:32,height:32,alt:""}}}},Zo=({props:e})=>e.start?.path,el=({state:e})=>{},tl=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Go,selectPath:Zo,selectViewData:Qo,setState:el},Symbol.toStringTag,{value:"Module"})),pi=(e,t,r)=>{let{store:i,render:s}=r,n,a=-1/0;if(e.forEach(p=>{let l=p.getBoundingClientRect();l.top<=t&&l.top>a&&(a=l.top,n=p.id)}),!n){let p=1/0;e.forEach(l=>{let o=l.getBoundingClientRect();o.top>t&&o.top<p&&(p=o.top,n=l.id)})}n&&n!==i.selectCurrentId()&&(i.setCurrentId({id:n}),s())},rl=(e,t,r,i)=>{let{store:s,render:n}=i,a=e.querySelectorAll("h1[id], h2[id], h3[id], h4[id], rtgl-text[id]"),p=Array.from(a),l=p.map(c=>{let d=1,u=c.tagName.toLowerCase();return u==="h1"?d=1:u==="h2"?d=2:u==="h3"?d=3:u==="h4"?d=4:u==="rtgl-text"&&(d=parseInt(c.getAttribute("data-level")||"1",10)),{id:c.id,href:`#${c.id}`,title:c.textContent,level:d}});s.setItems({items:l}),pi(p,r,i),n();let o=pi.bind(void 0,p,r,i);return t.addEventListener("scroll",o,{passive:!0}),()=>{t.removeEventListener("scroll",o)}},il=e=>{let{props:t}=e,r=()=>{};return requestAnimationFrame(()=>{let i=document.getElementById(t.targetId);if(!i)return;let s=window;t.scrollContainerId&&(s=document.getElementById(t.scrollContainerId)||window);let n=parseInt(t.offsetTop||"100",10);r=rl(i,s,n,e)}),()=>{r()}},sl=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:il},Symbol.toStringTag,{value:"Module"})),nl=()=>Object.freeze({items:[],currentId:null,contentContainer:null}),al=({state:e})=>{let t=((r,i)=>{let s=new Set,n=r.findIndex(p=>p.id===i);if(n===-1)return s;let a=r[n].level;for(let p=n-1;p>=0;p--)if(r[p].level<a){let l=r[p].level;s.add(r[p].id);for(let o=p-1;o>=0;o--)r[o].level<l&&(s.add(r[o].id),l=r[o].level);break}return s})(e.items,e.currentId);return{items:e.items.map(r=>{let i={1:"0",2:"12px",3:"24px",4:"32px"},s=r.id===e.currentId,n=t.has(r.id),a=s||n;return{...r,c:a?"fg":"mu-fg",ml:i[r.level]||"",bc:a?"fg":"mu-fg"}}),currentId:e.currentId}},ol=({state:e})=>e,ll=({state:e})=>e.currentId,pl=({state:e},t={})=>{e.items=Array.isArray(t.items)?t.items:[]},dl=({state:e},t={})=>{e.currentId=t.id},cl=({state:e},t={})=>{e.contentContainer=t.container},hl=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:nl,selectCurrentId:ll,selectState:ol,selectViewData:al,setContentContainer:cl,setCurrentId:dl,setItems:pl},Symbol.toStringTag,{value:"Module"})),et=e=>e==null||e===!0?"":String(e),qi=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=e,n=et(t);r.setValue({value:n}),r.closePopover({}),s(new CustomEvent("value-change",{detail:{value:n},bubbles:!0})),i()},ul=e=>{let{store:t,props:r}=e;if(r.value!==void 0){let i=et(r.value);t.setValue({value:i}),t.setTempValue({value:i})}},fl=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n}=e;if(r?.value!==i?.value){let a=et(i?.value);s.setValue({value:a}),s.getState().isOpen||s.setTempValue({value:a})}n()},ml=(e,t)=>{let{store:r,render:i,refs:s,props:n}=e;if(n.disabled)return;let a=t._event,p=et(n.value);r.setValue({value:p}),r.setTempValue({value:p}),r.openPopover({position:{x:a.currentTarget.getBoundingClientRect().left,y:a.currentTarget.getBoundingClientRect().bottom}}),i(),setTimeout(()=>{let{input:l}=s;if(!l)return;l.value=p,l.focus();let o=l.shadowRoot?.querySelector("input, textarea");o&&typeof o.focus=="function"&&o.focus()},50)},yl=(e,t)=>{let{store:r,render:i}=e;r.closePopover({}),i()},gl=(e,t)=>{let{store:r}=e,i=t._event,s=et(i.detail.value);r.setTempValue({value:s})},bl=e=>{let{store:t,refs:r}=e,{input:i}=r,s=i?i.value:t.getState().tempValue;qi(e,s)},vl=(e,t)=>{let{store:r,refs:i}=e,s=t._event;if(s.key==="Enter"){s.preventDefault(),s.stopPropagation();let{input:n}=i,a=n?n.value:r.getState().tempValue;qi(e,a)}else s.key==="Escape"&&(s.preventDefault(),s.stopPropagation(),r.closePopover({}),e.render())},wl=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:ul,handleInputChange:gl,handleInputKeydown:vl,handleOnUpdate:fl,handlePopoverClose:yl,handleSubmitClick:bl,handleTextClick:ml},Symbol.toStringTag,{value:"Module"})),_l=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),xl=({props:e,state:t})=>{let r=typeof t.value=="string"&&t.value.length>0,i=r?t.value:"-",s=typeof e.placeholder=="string"?e.placeholder:"",n=typeof e.label=="string"?e.label:"",a=!!e.disabled;return{isOpen:t.isOpen,position:t.position,value:i,valueColor:r?"fg":"mu-fg",tempValue:t.tempValue,placeholder:s,label:n,disabled:a}},Sl=({state:e},t={})=>{e.tempValue=t.value},Al=({state:e},t={})=>{let{position:r}=t;e.position=r,e.isOpen=!0,e.hasUnsavedChanges=!1},El=({state:e})=>{e.isOpen=!1,e.tempValue=""},kl=({state:e},t={})=>{e.value=t.value},$l=({state:e})=>e.value,Cl=Object.freeze(Object.defineProperty({__proto__:null,closePopover:El,createInitialState:_l,openPopover:Al,selectValue:$l,selectViewData:xl,setTempValue:Sl,setValue:kl},Symbol.toStringTag,{value:"Module"})),qe=(e,t)=>{if(e===t)return!0;if(e==null||t==null||typeof e!="object"||typeof t!="object")return!1;let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let s of r)if(!i.includes(s)||!qe(e[s],t[s]))return!1;return!0},Il=e=>{let{store:t,props:r,render:i}=e;if(r.selectedValue!==null&&r.selectedValue!==void 0&&r.options){let s=r.options.find(n=>qe(n.value,r.selectedValue));s&&(t.updateSelectedValue({value:s?.value}),i())}},Tl=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n}=e,a=!1;i?.disabled&&!r?.disabled&&(s.closeOptionsPopover({}),a=!0),r.selectedValue!==i.selectedValue&&(s.updateSelectedValue({value:i.selectedValue}),a=!0),a&&n()},Ol=(e,t)=>{let{store:r,render:i,refs:s,props:n}=e;if(n.disabled)return;t._event.stopPropagation();let a=s.selectButton,p=a.firstElementChild,l=p?p.getBoundingClientRect():a.getBoundingClientRect(),o=r.selectSelectedValue(),c=o!==null?o:n.selectedValue,d=null;c!=null&&n.options&&(d=n.options.findIndex(u=>qe(u.value,c)),d===-1&&(d=null)),r.openOptionsPopover({position:{y:l.bottom+12,x:l.left-24},selectedIndex:d}),i()},Ll=e=>{let{store:t,render:r}=e;t.closeOptionsPopover({}),r()},Nl=(e,t)=>{let{render:r,dispatchEvent:i,props:s,store:n}=e;if(s.disabled)return;let a=t._event;a.stopPropagation();let p=a.currentTarget.id.slice(6),l=Number(p),o=s.options[p];n.updateSelectedValue({value:o?.value}),s.onChange&&typeof s.onChange=="function"&&s.onChange(o.value),i(new CustomEvent("value-change",{detail:{value:o.value,label:o.label,index:l,item:o},bubbles:!0})),r()},Rl=(e,t)=>{let{store:r,render:i}=e,s=t._event,n=parseInt(s.currentTarget.id.slice(6),10);r.setHoveredOption({optionId:n}),i()},Vl=(e,t)=>{let{store:r,render:i}=e;r.clearHoveredOption({}),i()},jl=(e,t)=>{let{store:r,render:i,dispatchEvent:s,props:n}=e;n.disabled||(t._event.stopPropagation(),r.clearSelectedValue({}),n.onChange&&typeof n.onChange=="function"&&n.onChange(void 0),s(new CustomEvent("value-change",{detail:{value:void 0,label:void 0,index:null,item:void 0},bubbles:!0})),i())},Pl=(e,t)=>{if(e.props.disabled)return;let{store:r,render:i,dispatchEvent:s}=e,{_event:n}=t;n.stopPropagation(),r.closeOptionsPopover({}),s(new CustomEvent("add-option-click",{bubbles:!0})),i()},Bl=(e,t)=>{let{store:r,render:i}=e;r.setHoveredAddOption({isHovered:!0}),i()},Dl=(e,t)=>{let{store:r,render:i}=e;r.setHoveredAddOption({isHovered:!1}),i()},zl=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:Pl,handleAddOptionMouseEnter:Bl,handleAddOptionMouseLeave:Dl,handleBeforeMount:Il,handleButtonClick:Ol,handleClearClick:jl,handleClickOptionsPopoverOverlay:Ll,handleOnUpdate:Tl,handleOptionClick:Nl,handleOptionMouseEnter:Rl,handleOptionMouseLeave:Vl},Symbol.toStringTag,{value:"Module"})),Fl=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],Wl=(e={})=>Object.entries(e).filter(([t])=>!Fl.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Ml=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,hoveredOptionId:null,hoveredAddOption:!1}),Kl=({state:e,props:t})=>{let r=Wl(t),i=!!t.disabled,s=Object.prototype.hasOwnProperty.call(t||{},"selectedValue")?t.selectedValue:e.selectedValue,n=t.placeholder||"Select an option",a=!0,p=t.options||[],l=p.find(c=>qe(c.value,s));l&&(n=l.label,a=!1);let o=p.map((c,d)=>{let u=qe(c.value,s),f=e.hoveredOptionId===d;return{...c,isSelected:u,bgc:f?"ac":u?"mu":""}});return{containerAttrString:r,isDisabled:i,isOpen:e.isOpen,position:e.position,options:o,selectedValue:s,selectedLabel:n,selectedLabelColor:a?"mu-fg":"fg",hasValue:s!=null,showClear:!i&&!t.noClear&&s!=null,showAddOption:!i&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"ac":""}},Ul=({state:e})=>e,Hl=({state:e})=>e.selectedValue,ql=({state:e},t={})=>{let{position:r,selectedIndex:i}=t;e.position=r,e.isOpen=!0,i!=null&&(e.hoveredOptionId=i)},Gl=({state:e})=>{e.isOpen=!1},Jl=({state:e},t={})=>{e.selectedValue=t.value,e.isOpen=!1},Yl=({state:e})=>{e.selectedValue=void 0},Xl=({state:e},t={})=>{e.hoveredOptionId=t.optionId},Ql=({state:e})=>{e.hoveredOptionId=null},Zl=({state:e})=>{e.selectedValue=void 0},ep=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},tp=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:Ql,clearSelectedValue:Zl,closeOptionsPopover:Gl,createInitialState:Ml,openOptionsPopover:ql,resetSelection:Yl,selectSelectedValue:Hl,selectState:Ul,selectViewData:Kl,setHoveredAddOption:ep,setHoveredOption:Xl,updateSelectedValue:Jl},Symbol.toStringTag,{value:"Module"})),rp=(e,t)=>{let{store:r,dispatchEvent:i}=e,s=t._event,n,a=r.selectHeader();s.currentTarget.id==="headerLabel"?n=a.labelPath:s.currentTarget.id==="headerImage"?n=a.image.path:s.currentTarget.id==="header"&&(n=a.path),i(new CustomEvent("header-click",{detail:{path:n},bubbles:!0,composed:!0}))},ip=(e,t)=>{let{store:r,dispatchEvent:i}=e,s=t._event,n=s.currentTarget.dataset.itemId||s.currentTarget.id.slice(4),a=r.selectItem(n);i(new CustomEvent("item-click",{detail:{item:a},bubbles:!0,composed:!0}))},sp=Object.freeze(Object.defineProperty({__proto__:null,handleHeaderClick:rp,handleItemClick:ip},Symbol.toStringTag,{value:"Module"})),np=()=>Object.freeze({}),ap=["id","class","style","slot","header","items","selectedItemId","mode","hideHeader","w","bwr"],op=(e={})=>Object.entries(e).filter(([t])=>!ap.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Ge=e=>{if(e!=null){if(typeof e=="object")return e;if(typeof e=="string")try{return JSON.parse(decodeURIComponent(e))}catch{try{return JSON.parse(e)}catch{return}}}},lp=e=>{if(e===!0)return!0;if(e===!1||e===void 0||e===null)return!1;if(typeof e=="string"){let t=e.trim().toLowerCase();return t===""||t==="true"}return!1},pp=(e,t)=>e!=null&&e!==""?e:t==="full"?272:64;function gr(e,t=null){let r=[];for(let i of e){let s=i.id||i.href||i.path,n=t===s;if(r.push({id:s,title:i.title,href:i.href,type:i.type||"item",icon:i.icon,hrefAttr:i.href?`href=${i.href}`:"",isSelected:n,itemBgc:n?"ac":"bg",itemHoverBgc:n?"ac":"mu"}),i.items&&Array.isArray(i.items))for(let a of i.items){let p=a.id||a.href||a.path,l=t===p;r.push({id:p,title:a.title,href:a.href,type:a.type||"item",icon:a.icon,hrefAttr:a.href?`href=${a.href}`:"",isSelected:l,itemBgc:l?"ac":"bg",itemHoverBgc:l?"ac":"mu"})}}return r}var dp=({props:e})=>{let t=Ge(e.header)||e.header,r=Ge(e.items)||e.items,i=e.selectedItemId,s=op(e),n=e.mode||"full",a=t||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},p=r?gr(r,i):[],l=!lp(e.hideHeader),o=e.bwr||"xs",c=pp(e.w,n),d=n==="full"?"fs":"c",u=n==="full"?"fs":"c",f=n==="full"?"lg":"sm",h=n==="full"?"md":"sm",m=n==="shrunk-lg"?48:40,g=n==="shrunk-lg"?28:20,b=n==="shrunk-lg"?"md":"sm",y=n==="full",_=n==="full",S=n==="full"?"fs":"c",A=n==="full"?"":`ah=${u}`,E=n==="full"?"f":m;return{containerAttrString:s,mode:n,header:a,items:p,sidebarWidth:c,headerAlign:d,itemAlign:u,headerPadding:f,itemPadding:h,itemHeight:m,iconSize:g,firstLetterSize:b,showLabels:y,showGroupLabels:_,itemContentAlign:S,itemAlignAttr:A,itemWidth:E,headerWidth:E,selectedItemId:i,ah:n==="shrunk-lg"||n==="shrunk-md"?"c":"",showHeader:l,rightBorderWidth:o}},cp=({props:e})=>Ge(e.header)||e.header,hp=({state:e,props:t})=>{let r=Ge(t.items)||t.items;return(r?gr(r):[]).find(i=>i.active)},up=({props:e},t)=>{let r=Ge(e.items)||e.items;return(r?gr(r):[]).find(i=>i.id===t)},fp=({state:e})=>{},mp=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:np,selectActiveItem:hp,selectHeader:cp,selectItem:up,selectViewData:dp,setState:fp},Symbol.toStringTag,{value:"Module"})),yp=e=>{let{store:t,props:r}=e;t.setValue({value:r.value??0})},gp=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n}=e,a=r?.key!==i?.key,p=r?.value!==i?.value;if(a||p){let l=i?.value??0;s.setValue({value:l}),n()}},bp=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=e,n=t._event,a=Number(n.detail.value),p=(typeof n.composedPath=="function"?n.composedPath():[]).find(l=>l?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;r.setValue({value:a}),p&&typeof p.setAttribute=="function"&&p.setAttribute("value",String(a)),i(),s(new CustomEvent("value-change",{detail:{value:a},bubbles:!0}))},vp=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=e,n=t._event,a=Number(n.detail.value),p=(typeof n.composedPath=="function"?n.composedPath():[]).find(l=>l?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;r.setValue({value:a}),p&&typeof p.setAttribute=="function"&&p.setAttribute("value",String(a)),i(),s(new CustomEvent("value-input",{detail:{value:a},bubbles:!0}))},wp=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:yp,handleOnUpdate:gp,handleValueChange:bp,handleValueInput:vp},Symbol.toStringTag,{value:"Module"})),_p=()=>Object.freeze({value:0}),xp=({state:e,props:t})=>({key:t.key,value:e.value,w:t.w||"",min:t.min||0,max:t.max||100,step:t.step||1,disabled:!!t.disabled}),Sp=({state:e},t={})=>{e.value=t.value},Ap=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:_p,selectViewData:xp,setValue:Sp},Symbol.toStringTag,{value:"Module"})),Ep=e=>{},kp=(e,t)=>{let{dispatchEvent:r,props:i}=e,s=t._event,n=parseInt(s.currentTarget.id.slice(3),10),a=i.data?.rows?.[n];a&&r(new CustomEvent("row-click",{detail:{rowIndex:n,rowData:a}}))},$p=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=e,n=t._event.currentTarget.dataset.columnKey,a=r.selectSortInfo(),p="asc";a.column===n&&(a.direction==="asc"?p="desc":a.direction==="desc"&&(p=null)),p?r.setSortColumn({column:n,direction:p}):r.clearSort(),i(),s(new CustomEvent("header-click",{detail:{column:n,direction:p,sortInfo:p?{column:n,direction:p}:null}}))},Cp=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Ep,handleHeaderClick:$p,handleRowClick:kp},Symbol.toStringTag,{value:"Module"})),Ip=()=>Object.freeze({sortColumn:null,sortDirection:null}),Tp=["id","class","style","slot","data"],Op=(e={})=>Object.entries(e).filter(([t])=>!Tp.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Lp=(e,t)=>{let r=t.split("."),i=e;for(let s of r){if(i==null)return null;i=i[s]}return i},Np=({state:e,props:t})=>{let r=Op(t),i=t.data||{columns:[],rows:[]},s=i.rows.map((n,a)=>{let p=i.columns.map(l=>{let o=Lp(n,l.key);return{key:l.key,value:o!=null?String(o):""}});return{index:a,cells:p}});return{containerAttrString:r,columns:i.columns||[],rows:s||[]}},Rp=({state:e})=>e,Vp=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),jp=({state:e},{column:t,direction:r}={})=>{e.sortColumn=t,e.sortDirection=r},Pp=({state:e})=>{e.sortColumn=null,e.sortDirection=null},Bp=Object.freeze(Object.defineProperty({__proto__:null,clearSort:Pp,createInitialState:Ip,selectSortInfo:Vp,selectState:Rp,selectViewData:Np,setSortColumn:jp},Symbol.toStringTag,{value:"Module"})),Dp=(e,t)=>{let{dispatchEvent:r}=e,i=t._event.currentTarget.dataset.id;r(new CustomEvent("item-click",{detail:{id:i}}))},zp=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:Dp},Symbol.toStringTag,{value:"Module"})),Fp=()=>Object.freeze({}),Wp=["id","class","style","slot","items","selectedTab"],Mp=(e={})=>Object.entries(e).filter(([t])=>!Wp.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Kp=({props:e})=>{let t=Mp(e),r=e.items||[],i=e.selectedTab,s=r.map(n=>({...n,isSelected:n.id===i,bgColor:n.id===i?"ac":"",borderColor:n.id===i?"":"tr",textColor:n.id===i?"":"mu-fg"}));return{containerAttrString:t,items:s,selectedTab:i}},Up=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Fp,selectViewData:Kp},Symbol.toStringTag,{value:"Module"})),Hp=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),qp=()=>Object.freeze({}),Gp=({props:e})=>({open:!!e.open,x:e.x||0,y:e.y||0,place:e.place||"t",content:e.content||""}),Jp=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:qp,selectViewData:Gp},Symbol.toStringTag,{value:"Module"})),Yp=async e=>{let{props:t,store:r,render:i,refs:s}=e,{waveformData:n}=t;r.setWaveformData({data:n}),i();let a=s.canvas;a&&Gi(n,a)},Xp=async(e,t)=>{let{store:r,render:i,refs:s,props:n}=e,{waveformData:a}=n;if(!a){console.log("waveform handleOnUpdate: no waveformData provided");return}r.setWaveformData({data:a}),i();let p=s.canvas;p&&Gi(a,p)};async function Gi(e,t){let r=t.getContext("2d"),i=t.getBoundingClientRect(),s=i.width,n=i.height;t.width=s,t.height=n;let a=t.width,p=t.height;if(r.clearRect(0,0,a,p),r.fillStyle="#1a1a1a",r.fillRect(0,0,a,p),!e||!e.amplitudes)return;let l=e.amplitudes,o=p/2,c=r.createLinearGradient(0,0,0,p);c.addColorStop(0,"#404040"),c.addColorStop(.5,"#A1A1A1"),c.addColorStop(1,"#404040");let d=Math.max(1,a/l.length),u=.2;for(let f=0;f<l.length;f++){let h=l[f]/255*(p*.85),m=f*d,g=o-h/2;r.fillStyle=c,r.fillRect(m,g,Math.max(1,d*(1-u)),h)}r.strokeStyle="rgba(255, 255, 255, 0.1)",r.lineWidth=1,r.beginPath(),r.moveTo(0,o),r.lineTo(a,o),r.stroke(),r.shadowBlur=10,r.shadowColor="#2196F3"}var Qp=Object.freeze(Object.defineProperty({__proto__:null,handleAfterMount:Yp,handleOnUpdate:Xp},Symbol.toStringTag,{value:"Module"})),Zp=()=>Object.freeze({waveformData:null}),ed=({state:e},t={})=>{e.waveformData=t.data},td=({state:e,props:t})=>({isLoading:t.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:t.waveformData}),rd=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Zp,selectViewData:td,setWaveformData:ed},Symbol.toStringTag,{value:"Module"})),Ji=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yi=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase()),ir=e=>{if(e!=null)return e===""?!0:e},di=(e,t)=>{let r=e.getAttribute(t);if(r!==null)return ir(r);let i=Ji(t);if(i!==t){let s=e.getAttribute(i);if(s!==null)return ir(s)}},id=(e,t)=>{let r=new Set(t);return new Proxy({},{get(i,s){if(typeof s=="string"&&r.has(s)){let n=e[s];return n!==void 0?n:di(e,s)}},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(i,s){return typeof s=="string"&&r.has(s)},ownKeys(){return[...r]},getOwnPropertyDescriptor(i,s){if(typeof s=="string"&&r.has(s))return{configurable:!0,enumerable:!0,get:()=>{let n=e[s];return n!==void 0?n:di(e,s)}}}})},sd=({schema:e,methodExports:t=[]})=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("componentName is required.");if(typeof e.componentName!="string"||e.componentName.trim()==="")throw new Error("componentName is required.");if(Object.prototype.hasOwnProperty.call(e,"attrsSchema"))throw new Error("attrsSchema is not supported.");if(Object.prototype.hasOwnProperty.call(e,"methods")){let r=e.methods;if(!r||typeof r!="object"||Array.isArray(r))throw new Error("methods must be an object schema with a properties map.");if(Object.prototype.hasOwnProperty.call(r,"type")&&r.type!=="object")throw new Error("methods.type must be 'object'.");if(!r.properties||typeof r.properties!="object"||Array.isArray(r.properties))throw new Error("methods.properties must be an object keyed by method name.");for(let i of Object.keys(r.properties))if(!t.includes(i))throw new Error(`method '${i}' is declared in schema but missing in .methods.js exports.`)}return!0},w={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9,PARTIAL:10,PATH_REFERENCE:11},B={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},sr={NOT:0},k=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},ie=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}},ci=e=>{if(!e||e.trim()==="")throw new k("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new k(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${r}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let r of t)if(e.trim().endsWith(r))throw new k(`Incomplete comparison expression - missing right operand (got: '${e}')`)},nd=e=>{if(e.trim().endsWith(" in"))throw new k(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new k(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new k(`Missing iterable expression after 'in' (got: '$for ${e}')`);let i=t.includes(",")?t.split(",").map(s=>s.trim()):[t.trim()];for(let s of i){if(!s)throw new k(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(s))throw new k(`Invalid loop syntax (got: '$for ${e}')`)}},ad=(e,t,r=!1)=>{if(t===null)return new ie(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new ie(`Cannot iterate over undefined value at '$for ${e}'`);let i=typeof t;return r?new ie(`Cannot iterate over non-array value in loop '${e}' - got ${i} instead`):new ie(`Cannot iterate over non-array value (got: ${i}) at '$for ${e}'`)},od=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new ie(`Unknown function '${e}' (${r})`)},Xi=(e,t,r={})=>{let i={},s={};r&&typeof r=="object"&&(r.functions!==void 0||r.partials!==void 0?(i=r.functions||{},s=r.partials||{}):typeof r=="object"&&(i=r));let n=R(e,{functions:i,partials:s},t,{});return n===void 0?{}:n},R=(e,t,r,i)=>{if(t.functions,e.var&&!e.type)return H(e.var,r,i);if(e.type===w.LITERAL)return e.value;if(e.type===w.VARIABLE)return H(e.path,r,i);if(e.type===w.INTERPOLATION)return pd(e.parts,t,r,i);switch(e.type){case w.FUNCTION:return Qi(e,t,r,i);case w.BINARY:return Zi(e,t,r,i);case w.UNARY:return es(e,t,r,i);case w.CONDITIONAL:return cd(e,t,r,i);case w.LOOP:return yd(e,t,r,i);case w.OBJECT:return bd(e,t,r,i);case w.ARRAY:return vd(e,t,r,i);case w.PARTIAL:return wd(e,t,r,i);case w.PATH_REFERENCE:return _d(e,t,r,i);default:throw new Error(`Unknown node type: ${e.type}`)}},hi=new Map,ld=e=>{let t=[],r="",i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(n==="[")r&&(t.push({type:"property",value:r}),r=""),i=!0;else if(n==="]"){if(i&&r){let a=r.trim();if(/^\d+$/.test(a))t.push({type:"index",value:parseInt(a,10)});else if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")){let p=a.slice(1,-1);t.push({type:"property",value:p})}else t.push({type:"property",value:a});r=""}i=!1}else r+=n}return r&&t.push({type:"property",value:r}),t},H=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let i=hi.get(e);if(!i){let n=[],a="",p=0;for(let l=0;l<e.length;l++){let o=e[l];o==="["?(p++,a+=o):o==="]"?(p--,a+=o):o==="."&&p===0?a&&(n.push(a),a=""):a+=o}a&&n.push(a),i=[];for(let l of n){let o=ld(l.trim());i.push(...o)}hi.set(e,i)}let s=t;for(let n=0;n<i.length;n++){let a=i[n];if(a.type==="property"&&a.value in r){s=r[a.value];continue}if(s==null)return;(a.type==="property"||a.type==="index")&&(s=s[a.value])}return s},pd=(e,t,r,i)=>{let s=[];for(let n of e)if(typeof n=="string")s.push(n);else{let a=R(n,t,r,i);s.push(a!=null?String(a):"")}return s.join("")},Qi=(e,t,r,i)=>{let s=t.functions||t,n=s[e.name];if(!n)throw od(e.name,s);let a=e.args.map(p=>R(p,t,r,i));return n(...a)},Re=(e,t,r,i)=>{if(e.var&&!e.type)return H(e.var,r,i);switch(e.type){case w.VARIABLE:return H(e.path,r,i);case w.LITERAL:return e.value;case w.BINARY:return Zi(e,t,r,i);case w.UNARY:return es(e,t,r,i);case w.FUNCTION:return Qi(e,t,r,i);default:return R(e,t,r,i)}},Zi=(e,t,r,i)=>{if(e.op===B.AND||e.op===B.OR){let a=Re(e.left,t,r,i),p=Re(e.right,t,r,i);switch(e.op){case B.AND:return a&&p;case B.OR:return a||p}}let s=R(e.left,t,r,i),n=R(e.right,t,r,i);switch(e.op){case B.EQ:return s==n;case B.NEQ:return s!=n;case B.GT:return s>n;case B.LT:return s<n;case B.GTE:return s>=n;case B.LTE:return s<=n;case B.IN:return Array.isArray(n)?n.includes(s):!1;case B.ADD:if(typeof s!="number"||typeof n!="number")throw new ie(`Arithmetic operations require numbers. Got ${typeof s} + ${typeof n}`);return s+n;case B.SUBTRACT:if(typeof s!="number"||typeof n!="number")throw new ie(`Arithmetic operations require numbers. Got ${typeof s} - ${typeof n}`);return s-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},es=(e,t,r,i)=>{let s=e.op===sr.NOT?Re(e.operand,t,r,i):R(e.operand,t,r,i);switch(e.op){case sr.NOT:return!s;default:throw new Error(`Unknown unary operator: ${e.op}`)}},dd=(e,t,r,i)=>{if(e.conditions.length===2&&e.conditions[1]===null){let s=e.conditions[0];if(s.type===w.VARIABLE)if(H(s.path,r,i)){let n=e.bodies[0];if(n.type===w.OBJECT&&n.properties.length<=5){let a={};for(let p of n.properties){let l=p.parsedKey?R(p.parsedKey,t,r,i):p.key,o=p.value;if(o.type===w.LITERAL)a[l]=o.value;else if(o.type===w.VARIABLE)a[l]=H(o.path,r,i);else if(o.type===w.INTERPOLATION){let c=[];for(let d of o.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let u=H(d.path,r,i);c.push(u!=null?String(u):"")}else{let u=R(d,t,r,i);c.push(u!=null?String(u):"")}a[l]=c.join("")}else a[l]=R(o,t,r,i)}return a}}else{let n=e.bodies[1];if(n.type===w.OBJECT&&n.properties.length<=5){let a={};for(let p of n.properties){let l=p.parsedKey?R(p.parsedKey,t,r,i):p.key,o=p.value;if(o.type===w.LITERAL)a[l]=o.value;else if(o.type===w.VARIABLE)a[l]=H(o.path,r,i);else if(o.type===w.INTERPOLATION){let c=[];for(let d of o.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let u=H(d.path,r,i);c.push(u!=null?String(u):"")}else{let u=R(d,t,r,i);c.push(u!=null?String(u):"")}a[l]=c.join("")}else a[l]=R(o,t,r,i)}return a}}}return null},cd=(e,t,r,i)=>{let s=dd(e,t,r,i);if(s!==null)return s;for(let n=0;n<e.conditions.length;n++){let a=e.conditions[n];if(a===null||Re(a,t,r,i))return R(e.bodies[n],t,r,i)}return ts},hd=(e,t)=>{let r=e.body,i=e.itemVar;if(r.type===w.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===w.VARIABLE){let s=r.conditions[0].path,n=r.bodies[0];if(s.startsWith(i+".")){let a=s.substring(i.length+1);if(n.type===w.OBJECT&&n.properties.length<=5){for(let l of n.properties)if(l.parsedKey)return null;let p=[];for(let l=0;l<t.length;l++){let o=t[l];if(o[a]){let c={};for(let d of n.properties){let u=d.key,f=d.value;if(f.type===w.LITERAL)c[u]=f.value;else if(f.type===w.VARIABLE){let h=f.path;if(h===i)c[u]=o;else if(h.startsWith(i+".")){let m=h.substring(i.length+1);c[u]=o[m]}else return null}else if(f.type===w.INTERPOLATION){let h=[],m=!0;for(let g of f.parts)if(typeof g=="string")h.push(g);else if(g.type===w.VARIABLE){let b=g.path;if(b===i)h.push(o!=null?String(o):"");else if(b.startsWith(i+".")){let y=b.substring(i.length+1),_=o[y];h.push(_!=null?String(_):"")}else{m=!1;break}}else{m=!1;break}if(!m)return null;c[u]=h.join("")}else return null}p.push(c)}}return p}}}return null},ud=(e,t)=>{let r=e.body,i=e.itemVar,s=hd(e,t);if(s!==null)return s;if(r.type===w.OBJECT&&r.properties.length<=5&&!r.whenCondition){for(let p of r.properties)if(p.parsedKey)return null;let n=[],a=!0;for(let p of r.properties){let l=p.key,o=p.value;if(o.type===w.LITERAL)n.push({key:l,type:"literal",value:o.value});else if(o.type===w.VARIABLE){let c=o.path;if(c===i)n.push({key:l,type:"item"});else if(c.startsWith(i+".")){let d=c.substring(i.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:l,type:"prop",prop:d});else{a=!1;break}}else{a=!1;break}}else if(o.type===w.INTERPOLATION&&o.parts.length===1){let c=o.parts[0];if(c.type===w.VARIABLE){let d=c.path;if(d===i)n.push({key:l,type:"item_string"});else if(d.startsWith(i+".")){let u=d.substring(i.length+1);if(!u.includes(".")&&!u.includes("["))n.push({key:l,type:"prop_string",prop:u});else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}if(a){let p=new Array(t.length);if(n.length===3&&n[0].type==="prop"&&n[0].key==="id"&&n[1].type==="prop_string"&&n[1].key==="title"&&n[2].type==="prop"&&n[2].key==="completed")for(let l=0;l<t.length;l++){let o=t[l];p[l]={id:o.id,title:o.title!=null?String(o.title):"",completed:o.completed}}else for(let l=0;l<t.length;l++){let o=t[l],c={};for(let d of n)if(d.type==="literal")c[d.key]=d.value;else if(d.type==="item")c[d.key]=o;else if(d.type==="prop")c[d.key]=o[d.prop];else if(d.type==="item_string")c[d.key]=o!=null?String(o):"";else if(d.type==="prop_string"){let u=o[d.prop];c[d.key]=u!=null?String(u):""}p[l]=c}return p}}return null},fd=(e,t,r,i,s)=>{let n=[],a=e.body;if(a.type===w.OBJECT&&a.fast!==!1){let p=e.itemVar,l=e.indexVar;for(let o=0;o<s.length;o++){let c=s[o],d={},u={...i,[p]:c,...l&&{[l]:o}};u.__paths__||(u.__paths__=i.__paths__||{});let f=e.iterable.path||"";if(i&&i.__paths__&&f){let h=f.split("."),m=h[0];m in i.__paths__&&(f=i.__paths__[m],h.length>1&&(f+="."+h.slice(1).join(".")))}u.__paths__={...u.__paths__,[p]:`${f}[${o}]`,...l&&{[l]:o}};for(let h of a.properties){let m=h.parsedKey?R(h.parsedKey,t,r,u):h.key,g=h.value;if(g.type===w.LITERAL)d[m]=g.value;else if(g.type===w.VARIABLE){let b=g.path;if(b===p)d[m]=c;else if(b===l)d[m]=o;else if(b.startsWith(p+".")){let y=b.substring(p.length+1);!y.includes(".")&&!y.includes("[")?d[m]=c[y]:d[m]=H(b,r,{...i,[p]:c,...l&&{[l]:o}})}else d[m]=H(b,r,{...i,[p]:c,...l&&{[l]:o}})}else if(g.type===w.INTERPOLATION){let b=[];for(let y of g.parts)if(typeof y=="string")b.push(y);else if(y.type===w.VARIABLE){let _=y.path,S;if(_===p)S=c;else if(_===l)S=o;else if(_.startsWith(p+".")){let A=_.substring(p.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=H(_,r,{...i,[p]:c,...l&&{[l]:o}})}else S=H(_,r,{...i,[p]:c,...l&&{[l]:o}});b.push(S!=null?String(S):"")}else{let _={...i,[p]:c,...l&&{[l]:o}},S=R(y,t,r,_);b.push(S!=null?String(S):"")}d[m]=b.join("")}else{let b={...i,[p]:c,...l&&{[l]:o}};d[m]=R(g,t,r,b)}}n.push(d)}return n}return null},md=(e,t,r)=>{let i=e.body;if(i.type===w.OBJECT&&i.properties.length===1&&i.properties[0].key==="$if item.visible"){let s=i.properties[0].value;if(s.type===w.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===w.VARIABLE&&s.conditions[0].path==="item.visible"){let n=s.bodies[0];if(n.type===w.OBJECT&&n.properties.length===2){let a=n.properties[0],p=n.properties[1];if(a.key==="id"&&a.value.type===w.VARIABLE&&a.value.path==="item.id"&&p.key==="$if item.highlighted"&&p.value.type===w.CONDITIONAL){let l=[];for(let o=0;o<t.length;o++){let c=t[o];if(c.visible){let d={id:c.id};c.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${c.name}`):(d.highlight=!1,d.message=c.name),l.push(d)}}return l}}}}return null},yd=(e,t,r,i)=>{let s=R(e.iterable,t,r,i);if(!Array.isArray(s)){let o,c=!1;if(e.iterable.type===w.FUNCTION){c=!0;let u=e.iterable.args.map(f=>f.type===w.LITERAL?typeof f.value=="string"?`'${f.value}'`:String(f.value):f.type===w.VARIABLE?f.path:f.type===w.FUNCTION?`${f.name}(...)`:"?").join(", ");o=`${e.iterable.name}(${u})`}else o=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${o}`;throw ad(d,s,c)}if(!e.indexVar){let o=md(e,s,e.itemVar);if(o!==null)return o}if(!e.indexVar){let o=ud(e,s);if(o!==null)return o}let n=fd(e,t,r,i,s);if(n!==null)return n;let a=[],p=e.iterable.path||"";if(i&&i.__paths__&&p){let o=p.split("."),c=o[0];c in i.__paths__&&(p=i.__paths__[c],o.length>1&&(p+="."+o.slice(1).join(".")))}let l=!1;e.body.type===w.ARRAY&&(e.body.items.length<=1?l=!1:l=e.body._shouldPreserveArray??=e.body.items.some(o=>o.type===w.OBJECT&&o.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let o=0;o<s.length;o++){let c=e.indexVar?{...i,[e.itemVar]:s[o],[e.indexVar]:o}:{...i,[e.itemVar]:s[o]};c.__paths__||(c.__paths__=i.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${p}[${o}]`},e.indexVar&&(c.__paths__[e.indexVar]=o);let d=R(e.body,t,r,c);if(Array.isArray(d)&&d.length===1&&!l){let u=d[0];a.push(u===void 0?{}:u)}else a.push(d===void 0?{}:d)}return a},gd=(e,t,r,i)=>{if(e.whenCondition)return null;if(e.properties.length===1){let s=e.properties[0],n=s.parsedKey?R(s.parsedKey,t,r,i):s.key,a=s.value;if(a.type===w.OBJECT&&a.properties.length<=10&&!a.whenCondition){let p={},l={},o=!0;for(let c of a.properties){let d=c.parsedKey?R(c.parsedKey,t,r,i):c.key,u=c.value;if(u.type===w.LITERAL)l[d]=u.value;else if(u.type===w.VARIABLE)l[d]=H(u.path,r,i);else if(u.type===w.INTERPOLATION){let f=[];for(let h of u.parts)if(typeof h=="string")f.push(h);else if(h.type===w.VARIABLE){let m=H(h.path,r,i);f.push(m!=null?String(m):"")}else{o=!1;break}if(!o)break;l[d]=f.join("")}else if(u.type===w.OBJECT&&u.properties.length<=5){let f={};for(let h of u.properties){let m=h.key,g=h.value;if(g.type===w.LITERAL)f[m]=g.value;else if(g.type===w.VARIABLE)f[m]=H(g.path,r,i);else if(g.type===w.INTERPOLATION){let b=[];for(let y of g.parts)if(typeof y=="string")b.push(y);else if(y.type===w.VARIABLE){let _=H(y.path,r,i);b.push(_!=null?String(_):"")}else{o=!1;break}if(!o)break;f[m]=b.join("")}else{o=!1;break}}if(!o)break;l[d]=f}else{o=!1;break}}if(o)return p[n]=l,p}}return null},bd=(e,t,r,i)=>{let s=t.functions||t;if(e.whenCondition&&!Re(e.whenCondition,s,r,i))return;let n=gd(e,t,r,i);if(n!==null)return n;if(e.fast){let l={};for(let o of e.properties){let c=o.parsedKey?R(o.parsedKey,t,r,i):o.key,d=o.value;if(d.type===w.LITERAL)l[c]=d.value;else if(d.type===w.VARIABLE)l[c]=H(d.path,r,i);else if(d.type===w.INTERPOLATION){let u=[];for(let f of d.parts)if(typeof f=="string")u.push(f);else if(f.type===w.VARIABLE){let h=H(f.path,r,i);u.push(h!=null?String(h):"")}else{let h=R(f,t,r,i);u.push(h!=null?String(h):"")}l[c]=u.join("")}else l[c]=R(d,t,r,i)}return l}let a={},p=!1;for(let l of e.properties)if(!l.key.startsWith("$if ")&&!l.key.match(/^\$if\s+\w+.*:?$/)&&!l.key.startsWith("$elif")&&!l.key.startsWith("$else")&&!l.key.startsWith("$for ")){p=!0;break}for(let l of e.properties)if(l.key.startsWith("$if ")||l.key.match(/^\$if\s+\w+.*:?$/)){let o=R(l.value,t,r,i);if(!p&&o!==null&&o!==void 0)return Array.isArray(o)&&o.length===1?o[0]:o;typeof o=="object"&&o!==null&&!Array.isArray(o)&&Object.assign(a,o)}else if(l.key.startsWith("$for ")){if(e.properties.length===1)return R(l.value,t,r,i)}else{let o=l.value;if(o&&o.type===w.OBJECT&&o.properties){let c=o.properties.find(d=>d.key.startsWith("$for "));if(c){let d=R(c.value,t,r,i);d!==void 0&&(a[l.key]=d)}else{let d=R(l.value,t,r,i);d!==void 0&&(a[l.key]=d)}}else{let c=l.parsedKey?R(l.parsedKey,t,r,i):l.key,d=R(l.value,t,r,i);d!==void 0&&(a[c]=d)}}return a},ts={},vd=(e,t,r,i)=>{let s=[];for(let n of e.items)if(n.type===w.LOOP){let a=R(n,t,r,i);Array.isArray(a)&&n.flatten!==!1?s.push(...a):s.push(a)}else{let a=R(n,t,r,i);a!==ts&&a!==void 0&&s.push(a)}return s},wd=(e,t,r,i)=>{let{name:s,data:n,whenCondition:a}=e,p=t.partials||{},l=t.functions||t;if(a&&!Re(a,l,r,i))return;if(!p[s])throw new ie(`Partial '${s}' is not defined`);let o=i._partialStack||[];if(o.includes(s))throw new ie(`Circular partial reference detected: ${s}`);let c=p[s],d=r,u={...i,_partialStack:[...o,s]};if(i){d={...r};for(let f of Object.keys(i))f.startsWith("_")||(d[f]=i[f])}if(n){let f=R(n,t,r,i);d={...d,...f}}return R(c,t,d,u)},_d=(e,t,r,i)=>{let{path:s}=e,n=s.split("."),a=n[0],p=n.slice(1);if(!i||!(a in i))throw new ie(`Path reference '#{${s}}' refers to '${a}' which is not a loop variable in the current scope`);if(i.__paths__||(i.__paths__={}),!(a in i.__paths__))throw new ie(`Path reference '#{${s}}' cannot be resolved - path tracking may not be initialized properly`);let l=i.__paths__[a];if(typeof l=="number"){if(p.length>0)throw new ie(`Path reference '#{${s}}' - cannot access properties on index variable '${a}'`);return String(l)}return p.length>0&&(l+="."+p.join(".")),l},xd=/\$\{([^}]*)\}/g,Sd=/#\{([^}]*)\}/g,rs=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,i,s]=r,n=Ad(s,t);return{isFunction:!0,type:w.FUNCTION,name:i,args:n}},Ad=(e,t={})=>e.trim()?Ed(e).map(r=>kd(r.trim(),t)):[],Ed=e=>{let t=[],r="",i=0,s=!1,n="";for(let a=0;a<e.length;a++){let p=e[a],l=a>0?e[a-1]:"";!s&&(p==='"'||p==="'")?(s=!0,n=p,r+=p):s&&p===n&&l!=="\\"?(s=!1,n="",r+=p):!s&&p==="("?(i++,r+=p):!s&&p===")"?(i--,r+=p):!s&&p===","&&i===0?(t.push(r),r=""):r+=p}return r&&t.push(r),t},kd=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:w.LITERAL,value:parseFloat(e)};if(e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};let r=rs(e,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};let i=e.trim(),s=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:a,type:p}of s){let l=0;for(;l<i.length;){let o=Le(i.substring(l),a);if(o===-1)break;let c=l+o;c>n&&(n=c),l=c+a.length}}if(n!==-1)try{return Z(i,t)}catch{return{type:w.VARIABLE,path:i}}return{type:w.VARIABLE,path:i}},is=/^\w+\(.*\)$/,$d=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,Cd=e=>{if(!(!e||e.trim()===""||is.test(e))&&$d.test(e))throw e.includes("?")&&e.includes(":")?new k(`Complex expressions not supported in variable replacements - consider calculating the value in your data instead. Offending expression: "${e}"`):e.includes("||")||e.includes("&&")||e.includes("??")?new k(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new k(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},ui=e=>{let t=e.trim();if(is.test(t))throw new k(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new k(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new k(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new k(`Logical operators not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("?")&&t.includes(":"))throw new k(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:w.PATH_REFERENCE,path:t}},dt=(e,t={})=>{let r=e.trim();Cd(r);let i=rs(r,t);if(i.isFunction)return{type:i.type,name:i.name,args:i.args};if(r.includes("[")&&!/[\s+\-*/%|&?:]/.test(r)){let s=0;for(let n of r)n==="["?s++:n==="]"&&s--;if(s!==0)throw new Error("Invalid array index syntax")}return{type:w.VARIABLE,path:r}},ss=(e,t={})=>{let r=e,i=[];(e.includes("\\${")||e.includes("\\#{"))&&(r=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),r=r.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),r=r.replace(/\\(\$\{[^}]*\})/g,(o,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\(#\{[^}]*\})/g,(o,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\DOUBLE_ESC_VAR/g,"\\"),r=r.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let s=[...r.matchAll(xd)],n=[...r.matchAll(Sd)],a=[...s.map(o=>({match:o,type:"variable"})),...n.map(o=>({match:o,type:"pathref"}))].sort((o,c)=>o.match.index-c.match.index);if(a.length===0){let o=r;for(let c=0;c<i.length;c++)o=o.replace(`__ESCAPED_${c}__`,i[c]);return{type:w.LITERAL,value:o}}if(a.length===1&&a[0].match[0]===r&&i.length===0){let{match:o,type:c}=a[0];try{return c==="variable"?dt(o[1],t):ui(o[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:w.LITERAL,value:r};throw d}}let p=[],l=0;for(let{match:o,type:c}of a){let[d,u]=o,f=o.index;if(f>l){let h=r.substring(l,f);for(let m=0;m<i.length;m++)h=h.replace(`__ESCAPED_${m}__`,i[m]);h&&p.push(h)}try{let h;c==="variable"?h=dt(u.trim(),t):h=ui(u.trim()),p.push(h)}catch(h){if(h.message==="Invalid array index syntax")p.push(d);else throw h}l=f+d.length}if(l<r.length){let o=r.substring(l);for(let c=0;c<i.length;c++)o=o.replace(`__ESCAPED_${c}__`,i[c]);o&&p.push(o)}return{type:w.INTERPOLATION,parts:p}},Ee=(e,t)=>typeof e=="string"?ss(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Td(e,t):Od(e,t):{type:w.LITERAL,value:e},Id=e=>{let{$each:t,...r}=e;if(typeof t!="string")throw new k("$each value must be a non-empty string");let i=t.trim();if(i==="")throw new k("$each value must be a non-empty string");if(Object.keys(r).length===0)throw new k("Empty $each body not allowed");if(r.$partial!==void 0)throw new k("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${i}`]:r}},Td=(e,t)=>{let r=[],i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let l=Id(n),o=Object.keys(l);if(o.length===1&&/^\$for(?::\w+)?\s/.test(o[0])){let c=fi(o[0],l[o[0]],t,!0);r.push(c),i=!0;continue}}catch(l){throw l instanceof k?l:new k(l.message)}let p=Object.keys(n);if(p.length===1&&/^\$for(?::\w+)?\s/.test(p[0])){let l=fi(p[0],n[p[0]],t);r.push(l),i=!0;continue}}let a=Ee(n,t);r.push(a),(a.type===w.FUNCTION||a.type===w.CONDITIONAL||a.type===w.LOOP||a.type===w.PARTIAL||a.type===w.OBJECT&&!a.fast||a.type===w.ARRAY&&!a.fast)&&(i=!0)}return{type:w.ARRAY,items:r,fast:!i}},Od=(e,t)=>{let r=[],i=!1,s=null,n=Object.entries(e),a=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new k("$partial value must be a string");if(e.$partial.trim()==="")throw new k("$partial value cannot be an empty string");let l=["$if","$elif","$else","$for"],o=[];for(let[b]of n)for(let y of l)if(b===y||b.startsWith(y+" ")||b.startsWith(y+"#")){o.push(y);break}if(o.length>0)throw new k(`Cannot use $partial with ${o.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...u}=e,f={},h=!1;for(let[b,y]of Object.entries(u)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=y,h=!0}let m=null;if(h&&(m=Ee(f,t),m.type===w.OBJECT)){let b=!1;for(let y of m.properties)if(y.value.type===w.VARIABLE||y.value.type===w.INTERPOLATION||y.value.type===w.FUNCTION||y.value.type===w.CONDITIONAL||y.value.type===w.OBJECT&&!y.value.fast||y.value.type===w.ARRAY&&!y.value.fast){b=!0;break}b&&(m.fast=!1)}let g={type:w.PARTIAL,name:c,data:m};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new k("Empty condition expression after '$when'");b=Z(d,t)}else b={type:w.LITERAL,value:d};g.whenCondition=b}return g}for(let[l,o]of n)if(l==="$when"){if(s!==null)throw new k("Multiple '$when' directives on the same object are not allowed");if(o==null)throw new k("Missing condition expression after '$when'");let c=typeof o=="string"?o:JSON.stringify(o);if(c.trim()==="")throw new k("Empty condition expression after '$when'");s=Z(c,t),i=!0}else if(l.startsWith("$when#")||l.startsWith("$when "))throw new k("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;a<n.length;){let[l,o]=n[a];if(l==="$when"){a++;continue}if(l==="$each")throw new k("$each can only be used inside arrays");if(l.startsWith("$if ")||l.match(/^\$if#\w+\s/)||l.match(/^\$if\s+\w+.*:$/)){let c=Ld(n,a,t);r.push({key:l,value:c.node}),i=!0,a=c.nextIndex}else if(/^\$for(?::\w+)?\s/.test(l)){let c=l.match(/^\$for(?::(\w+))?\s/)?.[1]||"",d=c?`:${c}`:"";throw new k(`$for loops must be inside arrays - use '- $for${d} item in items:' instead of '$for${d} item in items:'. For cleaner object generation syntax, consider using $each.`)}else{if(l.startsWith("$elif ")||l.startsWith("$else"))throw new k(`'${l.split(" ")[0]}' without matching '$if'`);if(l==="$if"||l==="$if:")throw new k("Missing condition expression after '$if'");{let c=Ee(o,t);(c.type===w.FUNCTION||c.type===w.CONDITIONAL||c.type===w.PARTIAL||c.type===w.OBJECT&&!c.fast||c.type===w.ARRAY&&!c.fast)&&(i=!0);let d=ss(l,t),u={key:l,value:c};(d.type!==w.LITERAL||d.value!==l)&&(u.parsedKey=d),r.push(u),a++}}}let p={type:w.OBJECT,properties:r,fast:!i};return s&&(p.whenCondition=s),p},Ld=(e,t,r={})=>{let i=[],s=[],n=t,[a,p]=e[n],l=null,o;if(a.startsWith("$if#")){let d=a.match(/^\$if#(\w+)\s+(.+)$/);if(d)l=d[1],o=d[2];else throw new k(`Invalid conditional syntax: ${a}`)}else o=a.substring(4),o.endsWith(":")&&(o=o.slice(0,-1).trim());ci(o);let c=Z(o,r);for(i.push(c),s.push(Ee(p,r)),n++;n<e.length;){let[d,u]=e[n],f=!1,h;if(l?d.startsWith(`$elif#${l} `)?(h=d.substring(`$elif#${l} `.length),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(d===`$else#${l}`||d===`$else#${l}:`)&&(f=!0,h=null):d.startsWith("$elif ")?(h=d.substring(6),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,h=null),f){if(h===null)i.push(null);else{ci(h);let m=Z(h,r);i.push(m)}if(s.push(Ee(u,r)),n++,h===null)break}else break}return{node:{type:w.CONDITIONAL,conditions:i,bodies:s,id:l},nextIndex:n}},Z=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let o=e.slice(1,-1),c=0,d=!0;for(let u=0;u<o.length;u++)if(o[u]==="("?c++:o[u]===")"&&c--,c<0){d=!1;break}if(d&&c===0)return Z(o,t)}let r=Le(e,"||");if(r!==-1)return{type:w.BINARY,op:B.OR,left:Z(e.substring(0,r).trim(),t),right:Z(e.substring(r+2).trim(),t)};let i=Le(e,"&&");if(i!==-1)return{type:w.BINARY,op:B.AND,left:Z(e.substring(0,i).trim(),t),right:Z(e.substring(i+2).trim(),t)};let s=[{op:">=",type:B.GTE},{op:"<=",type:B.LTE},{op:"==",type:B.EQ},{op:"!=",type:B.NEQ},{op:">",type:B.GT},{op:"<",type:B.LT},{op:" in ",type:B.IN}];for(let{op:o,type:c}of s){let d=Le(e,o);if(d!==-1)return{type:w.BINARY,op:c,left:Z(e.substring(0,d).trim(),t),right:Z(e.substring(d+o.length).trim(),t)}}let n=-1,a=null,p=[{op:" + ",type:B.ADD},{op:" - ",type:B.SUBTRACT}];for(let{op:o,type:c}of p){let d=0;for(;d<e.length;){let u=Le(e.substring(d),o);if(u===-1)break;let f=d+u;f>n&&(n=f,a={op:o,type:c}),d=f+o.length}}if(n!==-1&&a)return{type:w.BINARY,op:a.type,left:Z(e.substring(0,n).trim(),t),right:Z(e.substring(n+a.op.length).trim(),t)};let l=[" * "," / "," % "];for(let o of l)if(Le(e,o)!==-1)throw new k(`Arithmetic operations are not allowed in conditionals: "${o}"`);return e.startsWith("!")?{type:w.UNARY,op:sr.NOT,operand:Z(e.substring(1).trim(),t)}:ns(e,t)},Le=(e,t)=>{let r=0,i=0;for(;i<=e.length-t.length;){if(e[i]==="(")r++;else if(e[i]===")")r--;else if(r===0&&e.substring(i,i+t.length)===t)return i;i++}return-1},Nd=e=>{if(e=e.trim(),e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:w.LITERAL,value:""};if(e==="{}")return{type:w.LITERAL,value:{}};if(e==="[]")return{type:w.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:w.LITERAL,value:t}:{type:w.VARIABLE,path:e}},ns=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return dt(r,t);let i=Nd(r);if(i.type===w.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:w.VARIABLE,path:r};try{return dt(r,t)}catch(s){if(s.message&&s.message.includes("not supported"))return i;throw s}},Rd=(e,t=!1)=>{try{nd(e)}catch(r){if(r instanceof k&&t){let i=r.message.replace(/\$for/g,"$each");throw new k(i.replace("Parse Error: ",""))}throw r}},fi=(e,t,r,i=!1)=>{let s=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(s);if(!n){let g=i?"$each":"$for";throw new k(`Invalid loop syntax (got: '${e.replace("$for",g)}')`)}let a=n[1],p=n[2].trim();Rd(p,i);let l=p.match(/^(.+?)\s+in\s+(.+)$/);if(!l){let g=i?"$each":"$for";throw new k(`Invalid loop syntax - missing 'in' keyword (got: '${g} ${p}')`)}let o=l[1].trim(),c=l[2].trim(),d,u=null;if(o.includes(",")){let g=o.split(",").map(b=>b.trim());if(g.length!==2)throw new k(`Invalid loop variables: ${o}. Expected format: "item" or "item, index"`);d=g[0],u=g[1]}else d=o;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new k(`Reserved variable name: ${d}`);if(u&&f.includes(u))throw new k(`Reserved variable name: ${u}`);let h=ns(c,r),m=Ee(t,r);return{type:w.LOOP,itemVar:d,indexVar:u,iterable:h,body:m,flatten:a!=="nested"}},mi=(e,t={})=>{let{functions:r={}}=t;return Ee(e,r)},Vd=()=>Date.now(),jd=Object.freeze(Object.defineProperty({__proto__:null,now:Vd},Symbol.toStringTag,{value:"Module"})),as=(e,t,r={})=>{let{functions:i={},partials:s={}}=r,n={...jd,...i},a=mi(e,{functions:n}),p={};for(let[l,o]of Object.entries(s))p[l]=mi(o,{functions:n});return Xi(a,t,{functions:n,partials:p})},Je=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Pd=(e,t)=>{!t||typeof t!="object"||Object.entries(t).forEach(([r,i])=>{if(r==="default")throw new Error("[Methods] Invalid method name 'default'. Use named exports in .methods.js; default export is not supported.");if(typeof i=="function"){if(r in e)throw new Error(`[Methods] Cannot define method '${r}' because it already exists on the component instance.`);Object.defineProperty(e,r,{configurable:!0,enumerable:!1,writable:!1,value:(s={})=>{let n=s===void 0?{}:s;if(!Je(n))throw new Error(`[Methods] Method '${r}' expects payload to be an object.`);return i.call(e,n)}})}})},os=Symbol.for("immer-nothing"),yi=Symbol.for("immer-draftable"),ne=Symbol.for("immer-state");function de(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ve=Object.getPrototypeOf;function je(e){return!!e&&!!e[ne]}function ke(e){return e?ls(e)||Array.isArray(e)||!!e[yi]||!!e.constructor?.[yi]||vt(e)||wt(e):!1}var Bd=Object.prototype.constructor.toString();function ls(e){if(!e||typeof e!="object")return!1;let t=Ve(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===Bd}function ct(e,t){bt(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,i)=>t(i,r,e))}function bt(e){let t=e[ne];return t?t.type_:Array.isArray(e)?1:vt(e)?2:wt(e)?3:0}function nr(e,t){return bt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ps(e,t,r){let i=bt(e);i===2?e.set(t,r):i===3?e.add(r):e[t]=r}function Dd(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function vt(e){return e instanceof Map}function wt(e){return e instanceof Set}function xe(e){return e.copy_||e.base_}function ar(e,t){if(vt(e))return new Map(e);if(wt(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=ls(e);if(t===!0||t==="class_only"&&!r){let i=Object.getOwnPropertyDescriptors(e);delete i[ne];let s=Reflect.ownKeys(i);for(let n=0;n<s.length;n++){let a=s[n],p=i[a];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(i[a]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[a]})}return Object.create(Ve(e),i)}else{let i=Ve(e);if(i!==null&&r)return{...e};let s=Object.create(i);return Object.assign(s,e)}}function br(e,t=!1){return _t(e)||je(e)||!ke(e)||(bt(e)>1&&(e.set=e.add=e.clear=e.delete=zd),Object.freeze(e),t&&Object.entries(e).forEach(([r,i])=>br(i,!0))),e}function zd(){de(2)}function _t(e){return Object.isFrozen(e)}var Fd={};function $e(e){let t=Fd[e];return t||de(0,e),t}var Ye;function ds(){return Ye}function Wd(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function gi(e,t){t&&($e("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function or(e){lr(e),e.drafts_.forEach(Md),e.drafts_=null}function lr(e){e===Ye&&(Ye=e.parent_)}function bi(e){return Ye=Wd(Ye,e)}function Md(e){let t=e[ne];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function vi(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[ne].modified_&&(or(t),de(4)),ke(e)&&(e=ht(t,e),t.parent_||ut(t,e)),t.patches_&&$e("Patches").generateReplacementPatches_(r[ne].base_,e,t.patches_,t.inversePatches_)):e=ht(t,r,[]),or(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==os?e:void 0}function ht(e,t,r){if(_t(t))return t;let i=t[ne];if(!i)return ct(t,(s,n)=>wi(e,i,t,s,n,r)),t;if(i.scope_!==e)return t;if(!i.modified_)return ut(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;let s=i.copy_,n=s,a=!1;i.type_===3&&(n=new Set(s),s.clear(),a=!0),ct(n,(p,l)=>wi(e,i,s,p,l,r,a)),ut(e,s,!1),r&&e.patches_&&$e("Patches").generatePatches_(i,r,e.patches_,e.inversePatches_)}return i.copy_}function wi(e,t,r,i,s,n,a){if(je(s)){let p=n&&t&&t.type_!==3&&!nr(t.assigned_,i)?n.concat(i):void 0,l=ht(e,s,p);if(ps(r,i,l),je(l))e.canAutoFreeze_=!1;else return}else a&&r.add(s);if(ke(s)&&!_t(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ht(e,s),(!t||!t.scope_.parent_)&&typeof i!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,i)&&ut(e,s)}}function ut(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&br(t,r)}function Kd(e,t){let r=Array.isArray(e),i={type_:r?1:0,scope_:t?t.scope_:ds(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},s=i,n=vr;r&&(s=[i],n=Xe);let{revoke:a,proxy:p}=Proxy.revocable(s,n);return i.draft_=p,i.revoke_=a,p}var vr={get(e,t){if(t===ne)return e;let r=xe(e);if(!nr(r,t))return Ud(e,r,t);let i=r[t];return e.finalized_||!ke(i)?i:i===Yt(e.base_,t)?(Xt(e),e.copy_[t]=dr(i,e)):i},has(e,t){return t in xe(e)},ownKeys(e){return Reflect.ownKeys(xe(e))},set(e,t,r){let i=cs(xe(e),t);if(i?.set)return i.set.call(e.draft_,r),!0;if(!e.modified_){let s=Yt(xe(e),t),n=s?.[ne];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Dd(r,s)&&(r!==void 0||nr(e.base_,t)))return!0;Xt(e),pr(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Yt(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Xt(e),pr(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=xe(e),i=Reflect.getOwnPropertyDescriptor(r,t);return i&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:i.enumerable,value:r[t]}},defineProperty(){de(11)},getPrototypeOf(e){return Ve(e.base_)},setPrototypeOf(){de(12)}},Xe={};ct(vr,(e,t)=>{Xe[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Xe.deleteProperty=function(e,t){return Xe.set.call(this,e,t,void 0)};Xe.set=function(e,t,r){return vr.set.call(this,e[0],t,r,e[0])};function Yt(e,t){let r=e[ne];return(r?xe(r):e)[t]}function Ud(e,t,r){let i=cs(t,r);return i?"value"in i?i.value:i.get?.call(e.draft_):void 0}function cs(e,t){if(!(t in e))return;let r=Ve(e);for(;r;){let i=Object.getOwnPropertyDescriptor(r,t);if(i)return i;r=Ve(r)}}function pr(e){e.modified_||(e.modified_=!0,e.parent_&&pr(e.parent_))}function Xt(e){e.copy_||(e.copy_=ar(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Hd=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,i)=>{if(typeof t=="function"&&typeof r!="function"){let n=r;r=t;let a=this;return function(p=n,...l){return a.produce(p,o=>r.call(this,o,...l))}}typeof r!="function"&&de(6),i!==void 0&&typeof i!="function"&&de(7);let s;if(ke(t)){let n=bi(this),a=dr(t,void 0),p=!0;try{s=r(a),p=!1}finally{p?or(n):lr(n)}return gi(n,i),vi(s,n)}else if(!t||typeof t!="object"){if(s=r(t),s===void 0&&(s=t),s===os&&(s=void 0),this.autoFreeze_&&br(s,!0),i){let n=[],a=[];$e("Patches").generateReplacementPatches_(t,s,n,a),i(n,a)}return s}else de(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(n,...a)=>this.produceWithPatches(n,p=>t(p,...a));let i,s;return[this.produce(t,r,(n,a)=>{i=n,s=a}),i,s]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ke(e)||de(8),je(e)&&(e=qd(e));let t=bi(this),r=dr(e,void 0);return r[ne].isManual_=!0,lr(t),r}finishDraft(e,t){let r=e&&e[ne];(!r||!r.isManual_)&&de(9);let{scope_:i}=r;return gi(i,t),vi(void 0,i)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let s=t[r];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}r>-1&&(t=t.slice(r+1));let i=$e("Patches").applyPatches_;return je(e)?i(e,t):this.produce(e,s=>i(s,t))}};function dr(e,t){let r=vt(e)?$e("MapSet").proxyMap_(e,t):wt(e)?$e("MapSet").proxySet_(e,t):Kd(e,t);return(t?t.scope_:ds()).drafts_.push(r),r}function qd(e){return je(e)||de(10,e),hs(e)}function hs(e){if(!ke(e)||_t(e))return e;let t=e[ne],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ar(e,t.scope_.immer_.useStrictShallowCopy_)}else r=ar(e,!0);return ct(r,(i,s)=>{ps(r,i,hs(s))}),t&&(t.finalized_=!1),r}var ae=new Hd,Gd=ae.produce;ae.produceWithPatches.bind(ae);ae.setAutoFreeze.bind(ae);ae.setUseStrictShallowCopy.bind(ae);ae.applyPatches.bind(ae);ae.createDraft.bind(ae);ae.finishDraft.bind(ae);var Jd=(e,t,r)=>{let{createInitialState:i,...s}=e,n={},a={},p={};return i&&(p=i({props:t,constants:r})),Object.entries(s).forEach(([l,o])=>{if(l.startsWith("select")){n[l]=(...c)=>o({state:p,props:t,constants:r},...c);return}a[l]=(c={})=>{let d=c===void 0?{}:c;if(!Je(d))throw new Error(`[Store] Action '${l}' expects payload to be an object.`);return p=Gd(p,u=>o({state:u,props:t,constants:r},d)),p}}),{getState:()=>p,...a,...n}},us=e=>!Je(e)||Object.isFrozen(e)?e:(Object.values(e).forEach(t=>{us(t)}),Object.freeze(e)),Yd=({setupConstants:e,fileConstants:t})=>{let r=Je(e)?e:{},i=Je(t)?t:{};return us({...r,...i})},Xd=(e,t)=>{if(!t||typeof t!="object")return"";let r="",i=n=>Object.entries(n).map(([a,p])=>` ${a}: ${p};`).join(`
1477
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let r=t.composedPath();(r[0]===this._dialogElement||r[0].nodeName==="DIALOG"&&r[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let r=t.composedPath();(r[0]===this._dialogElement||r[0].nodeName==="DIALOG"&&r[0]===this._dialogElement)&&(t.preventDefault(),this._emitClose())}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._emitClose()}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._isOpen=!1}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y","place","no-overlay"]}connectedCallback(){this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._isOpen&&this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,r,i){t==="open"?i!==null&&!this._isOpen?this.isConnected&&this._show():i===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="place")&&this._isOpen?this._updatePosition():t==="no-overlay"&&r!==i&&this._isOpen&&(this._hide(),this._show())}_show(){this._isOpen||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._dialogElement.open||setTimeout(()=>{this._dialogElement&&!this._dialogElement.open&&(this.hasAttribute("no-overlay")?this._dialogElement.show():this._dialogElement.showModal())},0),requestAnimationFrame(()=>{this._updatePosition()}))}_hide(){this._isOpen&&(this._isOpen=!1,this._dialogElement.open&&this._dialogElement.close(),this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_updatePosition(){let t=parseFloat(this.getAttribute("x")||"0"),r=parseFloat(this.getAttribute("y")||"0"),i=this.getAttribute("place")||"bs";this.removeAttribute("positioned"),requestAnimationFrame(()=>{let s=this._popoverContainer.getBoundingClientRect(),{left:n,top:a}=this._calculatePosition(t,r,s.width,s.height,i);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${a}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,r,i,s,n){let p=t,l=r;switch(n){case"t":p=t-i/2,l=r-s-8;break;case"ts":p=t,l=r-s-8;break;case"te":p=t-i,l=r-s-8;break;case"r":p=t+8,l=r-s/2;break;case"rs":p=t+8,l=r;break;case"re":p=t+8,l=r-s;break;case"b":p=t-i/2,l=r+8;break;case"bs":p=t,l=r+8;break;case"be":p=t-i,l=r+8;break;case"l":p=t-i-8,l=r-s/2;break;case"ls":p=t-i-8,l=r;break;case"le":p=t-i-8,l=r-s;break;default:p=t,l=r+8;break}let o=8;return p=Math.max(o,Math.min(p,window.innerWidth-i-o)),l=Math.max(o,Math.min(l,window.innerHeight-s-o)),{left:p,top:l}}get popover(){return this._popoverContainer}},ei=({render:e,html:t})=>Jt;var an=(e,t)=>{let{store:r,render:i}=e;r.toggleOpen({}),i()},on=Object.freeze(Object.defineProperty({__proto__:null,handleClickHeader:an},Symbol.toStringTag,{value:"Module"})),ln=()=>Object.freeze({open:!1}),pn=["id","class","style","slot","label","content"],dn=(e={})=>Object.entries(e).filter(([t])=>!pn.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),cn=({state:e,props:t})=>({label:t.label||"",content:t.content||"",openClass:e.open?"content-wrapper open":"content-wrapper",chevronIcon:e.open?"chevronUp":"chevronDown",containerAttrString:dn(t)}),hn=({state:e})=>{e.open=!e.open},un=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:ln,selectViewData:cn,toggleOpen:hn},Symbol.toStringTag,{value:"Module"})),fn=(e,t)=>{let{dispatchEvent:r,props:i}=e,s=t._event,n=Number(s.currentTarget.dataset.index),a=Array.isArray(i.items)?i.items[n]:void 0;if(a){if(a.disabled||a.current){s.preventDefault();return}typeof a.href=="string"&&a.href.length>0||s.preventDefault(),r(new CustomEvent("item-click",{detail:{id:a.id,path:a.path,href:a.href,item:a,index:n,trigger:s.type}}))}},mn=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:fn},Symbol.toStringTag,{value:"Module"})),yn=()=>Object.freeze({}),gn=["id","class","style","slot","items","sep","max","separator"],bn=(e={})=>Object.entries(e).filter(([t])=>!gn.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),vn=e=>{if(e==null||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t},wn=e=>`${e}`.replace(/"/g,"&quot;"),_n=(e,t)=>{if(!t||t<3||e.length<=t)return e;let r=t-2;return[e[0],{isEllipsis:!0,label:"..."},...e.slice(-r)]},xn=e=>e.map((t,r)=>{let i=typeof t.href=="string"&&t.href.length>0,s=t.path!==void 0&&t.path!==null&&`${t.path}`!="",n=!!t.current,a=!!t.disabled,p=!n&&!a&&(i||s||!!t.click),l=t.rel||(t.newTab?"noopener noreferrer":""),o=[t.newTab?'target="_blank"':"",l?`rel="${wn(l)}"`:""].filter(Boolean).join(" ");return{...t,label:t.label||"",index:r,href:i?t.href:void 0,path:s?t.path:void 0,isCurrent:n,isDisabled:a,isInteractive:p,linkExtraAttrs:o,c:n?"fg":"mu-fg"}}),Sn=({props:e})=>{let t=bn(e),r=Array.isArray(e.items)?e.items:[],i=vn(e.max),s=e.sep||"breadcrumb-arrow",n=xn(r),a=_n(n,i),p=[];return a.forEach((l,o)=>{p.push(l),o<a.length-1&&p.push({isSeparator:!0})}),{containerAttrString:t,items:p,sep:s}},An=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:yn,selectViewData:Sn},Symbol.toStringTag,{value:"Module"})),En=["id","class","style","slot","head","desc","size","d","ah","av","wrap","noWrap","g","gh","gv","p","pt","pr","pb","pl","pv","ph","bw","bwt","bwr","bwb","bwl","bc","br","shadow","bgc","href","newTab","rel","cur","sv","sh","overflow"],ti={sm:{cardAttrString:"p=md sm-p=sm g=md sm-g=sm",headerAttrString:"g=xs",headingSize:"lg",subheadingSize:"sm"},md:{cardAttrString:"p=lg md-p=md sm-p=md g=lg md-g=md sm-g=md",headerAttrString:"g=sm",headingSize:"h4",subheadingSize:"sm"},lg:{cardAttrString:"p=xl lg-p=lg md-p=md sm-p=md g=lg md-g=md sm-g=md",headerAttrString:"g=sm",headingSize:"h3",subheadingSize:"md"}},kn=(e={})=>Object.entries(e).filter(([t])=>!En.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),$n=()=>Object.freeze({}),Cn=({props:e={}})=>{let t=ti[e.size]?e.size:"md",r=ti[t];return{containerAttrString:kn(e),cardAttrString:r.cardAttrString,headerAttrString:r.headerAttrString,headingSize:r.headingSize,subheadingSize:r.subheadingSize,head:e.head||"",desc:e.desc||"",hasHeader:!!(e.head||e.desc),size:t}},In=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:$n,selectViewData:Cn},Symbol.toStringTag,{value:"Module"})),Tn=(e,t)=>{let{dispatchEvent:r}=e;r(new CustomEvent("close"))},On=(e,t)=>{let{dispatchEvent:r,props:i}=e,s=t._event,n=Number(s.currentTarget.dataset.index??s.currentTarget.id.slice(6)),a=i.items[n],p=a?.type||"item";if(!a||p!=="item"||a.disabled){s.preventDefault();return}a.href||s.preventDefault(),r(new CustomEvent("item-click",{detail:{index:n,item:a,id:a.id,path:a.path,href:a.href,trigger:s.type}}))},Ln=Object.freeze(Object.defineProperty({__proto__:null,handleClickMenuItem:On,handleClosePopover:Tn},Symbol.toStringTag,{value:"Module"})),Nn=()=>Object.freeze({}),Rn=e=>`${e}`.replace(/"/g,"&quot;"),Vn=e=>e.map((t,r)=>{let i=t.type||"item",s=i==="separator",n=i==="label",a=i==="item",p=!!t.disabled,l=a&&!p,o=p?"mu-fg":"fg",c=p?"mu":"",d=p?"":"ac",u=typeof t.href=="string"&&t.href.length>0,f=t.rel||(t.newTab?"noopener noreferrer":""),h=[t.newTab?'target="_blank"':"",f?`rel="${Rn(f)}"`:""].filter(Boolean).join(" ");return{...t,index:r,type:i,isSeparator:s,isLabel:n,isItem:a,isDisabled:p,isInteractive:l,hasHref:u,linkExtraAttrs:h,c:o,bgc:c,hoverBgc:d}}),jn=({props:e})=>{let t=Array.isArray(e.items)?e.items:[];return{items:Vn(t),open:!!e.open,x:e.x||0,y:e.y||0,w:e.w||"300",h:e.h||"300",place:e.place||"bs"}},Pn=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Nn,selectViewData:jn},Symbol.toStringTag,{value:"Module"})),v={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9,PARTIAL:10,PATH_REFERENCE:11},P={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},tr={NOT:0},$=class extends Error{constructor(e){super(`Parse Error: ${e}`),this.name="JemplParseError"}},le=class extends Error{constructor(e){super(`Render Error: ${e}`),this.name="JemplRenderError"}},ri=e=>{if(!e||e.trim()==="")throw new $("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new $(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${r}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let r of t)if(e.trim().endsWith(r))throw new $(`Incomplete comparison expression - missing right operand (got: '${e}')`)},Bn=e=>{if(e.trim().endsWith(" in"))throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new $(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);let i=t.includes(",")?t.split(",").map(s=>s.trim()):[t.trim()];for(let s of i){if(!s)throw new $(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(s))throw new $(`Invalid loop syntax (got: '$for ${e}')`)}},Dn=(e,t,r=!1)=>{if(t===null)return new le(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new le(`Cannot iterate over undefined value at '$for ${e}'`);let i=typeof t;return r?new le(`Cannot iterate over non-array value in loop '${e}' - got ${i} instead`):new le(`Cannot iterate over non-array value (got: ${i}) at '$for ${e}'`)},zn=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new le(`Unknown function '${e}' (${r})`)},Fn=(e,t,r={})=>{let i={},s={};r&&typeof r=="object"&&(r.functions!==void 0||r.partials!==void 0?(i=r.functions||{},s=r.partials||{}):typeof r=="object"&&(i=r));let n=N(e,{functions:i,partials:s},t,{});return n===void 0?{}:n},N=(e,t,r,i)=>{if(t.functions,e.var&&!e.type)return K(e.var,r,i);if(e.type===v.LITERAL)return e.value;if(e.type===v.VARIABLE)return K(e.path,r,i);if(e.type===v.INTERPOLATION)return Mn(e.parts,t,r,i);switch(e.type){case v.FUNCTION:return Li(e,t,r,i);case v.BINARY:return Ni(e,t,r,i);case v.UNARY:return Ri(e,t,r,i);case v.CONDITIONAL:return Un(e,t,r,i);case v.LOOP:return Yn(e,t,r,i);case v.OBJECT:return Qn(e,t,r,i);case v.ARRAY:return Zn(e,t,r,i);case v.PARTIAL:return ea(e,t,r,i);case v.PATH_REFERENCE:return ta(e,t,r,i);default:throw new Error(`Unknown node type: ${e.type}`)}},ii=new Map,Wn=e=>{let t=[],r="",i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(n==="[")r&&(t.push({type:"property",value:r}),r=""),i=!0;else if(n==="]"){if(i&&r){let a=r.trim();if(/^\d+$/.test(a))t.push({type:"index",value:parseInt(a,10)});else if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")){let p=a.slice(1,-1);t.push({type:"property",value:p})}else t.push({type:"property",value:a});r=""}i=!1}else r+=n}return r&&t.push({type:"property",value:r}),t},K=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let i=ii.get(e);if(!i){let n=[],a="",p=0;for(let l=0;l<e.length;l++){let o=e[l];o==="["?(p++,a+=o):o==="]"?(p--,a+=o):o==="."&&p===0?a&&(n.push(a),a=""):a+=o}a&&n.push(a),i=[];for(let l of n){let o=Wn(l.trim());i.push(...o)}ii.set(e,i)}let s=t;for(let n=0;n<i.length;n++){let a=i[n];if(a.type==="property"&&a.value in r){s=r[a.value];continue}if(s==null)return;(a.type==="property"||a.type==="index")&&(s=s[a.value])}return s},Mn=(e,t,r,i)=>{let s=[];for(let n of e)if(typeof n=="string")s.push(n);else{let a=N(n,t,r,i);s.push(a!=null?String(a):"")}return s.join("")},Li=(e,t,r,i)=>{let s=t.functions||t,n=s[e.name];if(!n)throw zn(e.name,s);let a=e.args.map(p=>N(p,t,r,i));return n(...a)},Le=(e,t,r,i)=>{if(e.var&&!e.type)return K(e.var,r,i);switch(e.type){case v.VARIABLE:return K(e.path,r,i);case v.LITERAL:return e.value;case v.BINARY:return Ni(e,t,r,i);case v.UNARY:return Ri(e,t,r,i);case v.FUNCTION:return Li(e,t,r,i);default:return N(e,t,r,i)}},Ni=(e,t,r,i)=>{if(e.op===P.AND||e.op===P.OR){let a=Le(e.left,t,r,i),p=Le(e.right,t,r,i);switch(e.op){case P.AND:return a&&p;case P.OR:return a||p}}let s=N(e.left,t,r,i),n=N(e.right,t,r,i);switch(e.op){case P.EQ:return s==n;case P.NEQ:return s!=n;case P.GT:return s>n;case P.LT:return s<n;case P.GTE:return s>=n;case P.LTE:return s<=n;case P.IN:return Array.isArray(n)?n.includes(s):!1;case P.ADD:if(typeof s!="number"||typeof n!="number")throw new le(`Arithmetic operations require numbers. Got ${typeof s} + ${typeof n}`);return s+n;case P.SUBTRACT:if(typeof s!="number"||typeof n!="number")throw new le(`Arithmetic operations require numbers. Got ${typeof s} - ${typeof n}`);return s-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},Ri=(e,t,r,i)=>{let s=e.op===tr.NOT?Le(e.operand,t,r,i):N(e.operand,t,r,i);switch(e.op){case tr.NOT:return!s;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Kn=(e,t,r,i)=>{if(e.conditions.length===2&&e.conditions[1]===null){let s=e.conditions[0];if(s.type===v.VARIABLE)if(K(s.path,r,i)){let n=e.bodies[0];if(n.type===v.OBJECT&&n.properties.length<=5){let a={};for(let p of n.properties){let l=p.parsedKey?N(p.parsedKey,t,r,i):p.key,o=p.value;if(o.type===v.LITERAL)a[l]=o.value;else if(o.type===v.VARIABLE)a[l]=K(o.path,r,i);else if(o.type===v.INTERPOLATION){let c=[];for(let d of o.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let u=K(d.path,r,i);c.push(u!=null?String(u):"")}else{let u=N(d,t,r,i);c.push(u!=null?String(u):"")}a[l]=c.join("")}else a[l]=N(o,t,r,i)}return a}}else{let n=e.bodies[1];if(n.type===v.OBJECT&&n.properties.length<=5){let a={};for(let p of n.properties){let l=p.parsedKey?N(p.parsedKey,t,r,i):p.key,o=p.value;if(o.type===v.LITERAL)a[l]=o.value;else if(o.type===v.VARIABLE)a[l]=K(o.path,r,i);else if(o.type===v.INTERPOLATION){let c=[];for(let d of o.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let u=K(d.path,r,i);c.push(u!=null?String(u):"")}else{let u=N(d,t,r,i);c.push(u!=null?String(u):"")}a[l]=c.join("")}else a[l]=N(o,t,r,i)}return a}}}return null},Un=(e,t,r,i)=>{let s=Kn(e,t,r,i);if(s!==null)return s;for(let n=0;n<e.conditions.length;n++){let a=e.conditions[n];if(a===null||Le(a,t,r,i))return N(e.bodies[n],t,r,i)}return Vi},Hn=(e,t)=>{let r=e.body,i=e.itemVar;if(r.type===v.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===v.VARIABLE){let s=r.conditions[0].path,n=r.bodies[0];if(s.startsWith(i+".")){let a=s.substring(i.length+1);if(n.type===v.OBJECT&&n.properties.length<=5){for(let l of n.properties)if(l.parsedKey)return null;let p=[];for(let l=0;l<t.length;l++){let o=t[l];if(o[a]){let c={};for(let d of n.properties){let u=d.key,f=d.value;if(f.type===v.LITERAL)c[u]=f.value;else if(f.type===v.VARIABLE){let h=f.path;if(h===i)c[u]=o;else if(h.startsWith(i+".")){let m=h.substring(i.length+1);c[u]=o[m]}else return null}else if(f.type===v.INTERPOLATION){let h=[],m=!0;for(let y of f.parts)if(typeof y=="string")h.push(y);else if(y.type===v.VARIABLE){let b=y.path;if(b===i)h.push(o!=null?String(o):"");else if(b.startsWith(i+".")){let g=b.substring(i.length+1),_=o[g];h.push(_!=null?String(_):"")}else{m=!1;break}}else{m=!1;break}if(!m)return null;c[u]=h.join("")}else return null}p.push(c)}}return p}}}return null},qn=(e,t)=>{let r=e.body,i=e.itemVar,s=Hn(e,t);if(s!==null)return s;if(r.type===v.OBJECT&&r.properties.length<=5&&!r.whenCondition){for(let p of r.properties)if(p.parsedKey)return null;let n=[],a=!0;for(let p of r.properties){let l=p.key,o=p.value;if(o.type===v.LITERAL)n.push({key:l,type:"literal",value:o.value});else if(o.type===v.VARIABLE){let c=o.path;if(c===i)n.push({key:l,type:"item"});else if(c.startsWith(i+".")){let d=c.substring(i.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:l,type:"prop",prop:d});else{a=!1;break}}else{a=!1;break}}else if(o.type===v.INTERPOLATION&&o.parts.length===1){let c=o.parts[0];if(c.type===v.VARIABLE){let d=c.path;if(d===i)n.push({key:l,type:"item_string"});else if(d.startsWith(i+".")){let u=d.substring(i.length+1);if(!u.includes(".")&&!u.includes("["))n.push({key:l,type:"prop_string",prop:u});else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}if(a){let p=new Array(t.length);if(n.length===3&&n[0].type==="prop"&&n[0].key==="id"&&n[1].type==="prop_string"&&n[1].key==="title"&&n[2].type==="prop"&&n[2].key==="completed")for(let l=0;l<t.length;l++){let o=t[l];p[l]={id:o.id,title:o.title!=null?String(o.title):"",completed:o.completed}}else for(let l=0;l<t.length;l++){let o=t[l],c={};for(let d of n)if(d.type==="literal")c[d.key]=d.value;else if(d.type==="item")c[d.key]=o;else if(d.type==="prop")c[d.key]=o[d.prop];else if(d.type==="item_string")c[d.key]=o!=null?String(o):"";else if(d.type==="prop_string"){let u=o[d.prop];c[d.key]=u!=null?String(u):""}p[l]=c}return p}}return null},Gn=(e,t,r,i,s)=>{let n=[],a=e.body;if(a.type===v.OBJECT&&a.fast!==!1){let p=e.itemVar,l=e.indexVar;for(let o=0;o<s.length;o++){let c=s[o],d={},u={...i,[p]:c,...l&&{[l]:o}};u.__paths__||(u.__paths__=i.__paths__||{});let f=e.iterable.path||"";if(i&&i.__paths__&&f){let h=f.split("."),m=h[0];m in i.__paths__&&(f=i.__paths__[m],h.length>1&&(f+="."+h.slice(1).join(".")))}u.__paths__={...u.__paths__,[p]:`${f}[${o}]`,...l&&{[l]:o}};for(let h of a.properties){let m=h.parsedKey?N(h.parsedKey,t,r,u):h.key,y=h.value;if(y.type===v.LITERAL)d[m]=y.value;else if(y.type===v.VARIABLE){let b=y.path;if(b===p)d[m]=c;else if(b===l)d[m]=o;else if(b.startsWith(p+".")){let g=b.substring(p.length+1);!g.includes(".")&&!g.includes("[")?d[m]=c[g]:d[m]=K(b,r,{...i,[p]:c,...l&&{[l]:o}})}else d[m]=K(b,r,{...i,[p]:c,...l&&{[l]:o}})}else if(y.type===v.INTERPOLATION){let b=[];for(let g of y.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=g.path,S;if(_===p)S=c;else if(_===l)S=o;else if(_.startsWith(p+".")){let A=_.substring(p.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=K(_,r,{...i,[p]:c,...l&&{[l]:o}})}else S=K(_,r,{...i,[p]:c,...l&&{[l]:o}});b.push(S!=null?String(S):"")}else{let _={...i,[p]:c,...l&&{[l]:o}},S=N(g,t,r,_);b.push(S!=null?String(S):"")}d[m]=b.join("")}else{let b={...i,[p]:c,...l&&{[l]:o}};d[m]=N(y,t,r,b)}}n.push(d)}return n}return null},Jn=(e,t,r)=>{let i=e.body;if(i.type===v.OBJECT&&i.properties.length===1&&i.properties[0].key==="$if item.visible"){let s=i.properties[0].value;if(s.type===v.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===v.VARIABLE&&s.conditions[0].path==="item.visible"){let n=s.bodies[0];if(n.type===v.OBJECT&&n.properties.length===2){let a=n.properties[0],p=n.properties[1];if(a.key==="id"&&a.value.type===v.VARIABLE&&a.value.path==="item.id"&&p.key==="$if item.highlighted"&&p.value.type===v.CONDITIONAL){let l=[];for(let o=0;o<t.length;o++){let c=t[o];if(c.visible){let d={id:c.id};c.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${c.name}`):(d.highlight=!1,d.message=c.name),l.push(d)}}return l}}}}return null},Yn=(e,t,r,i)=>{let s=N(e.iterable,t,r,i);if(!Array.isArray(s)){let o,c=!1;if(e.iterable.type===v.FUNCTION){c=!0;let u=e.iterable.args.map(f=>f.type===v.LITERAL?typeof f.value=="string"?`'${f.value}'`:String(f.value):f.type===v.VARIABLE?f.path:f.type===v.FUNCTION?`${f.name}(...)`:"?").join(", ");o=`${e.iterable.name}(${u})`}else o=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${o}`;throw Dn(d,s,c)}if(!e.indexVar){let o=Jn(e,s,e.itemVar);if(o!==null)return o}if(!e.indexVar){let o=qn(e,s);if(o!==null)return o}let n=Gn(e,t,r,i,s);if(n!==null)return n;let a=[],p=e.iterable.path||"";if(i&&i.__paths__&&p){let o=p.split("."),c=o[0];c in i.__paths__&&(p=i.__paths__[c],o.length>1&&(p+="."+o.slice(1).join(".")))}let l=!1;e.body.type===v.ARRAY&&(e.body.items.length<=1?l=!1:l=e.body._shouldPreserveArray??=e.body.items.some(o=>o.type===v.OBJECT&&o.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let o=0;o<s.length;o++){let c=e.indexVar?{...i,[e.itemVar]:s[o],[e.indexVar]:o}:{...i,[e.itemVar]:s[o]};c.__paths__||(c.__paths__=i.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${p}[${o}]`},e.indexVar&&(c.__paths__[e.indexVar]=o);let d=N(e.body,t,r,c);if(Array.isArray(d)&&d.length===1&&!l){let u=d[0];a.push(u===void 0?{}:u)}else a.push(d===void 0?{}:d)}return a},Xn=(e,t,r,i)=>{if(e.whenCondition)return null;if(e.properties.length===1){let s=e.properties[0],n=s.parsedKey?N(s.parsedKey,t,r,i):s.key,a=s.value;if(a.type===v.OBJECT&&a.properties.length<=10&&!a.whenCondition){let p={},l={},o=!0;for(let c of a.properties){let d=c.parsedKey?N(c.parsedKey,t,r,i):c.key,u=c.value;if(u.type===v.LITERAL)l[d]=u.value;else if(u.type===v.VARIABLE)l[d]=K(u.path,r,i);else if(u.type===v.INTERPOLATION){let f=[];for(let h of u.parts)if(typeof h=="string")f.push(h);else if(h.type===v.VARIABLE){let m=K(h.path,r,i);f.push(m!=null?String(m):"")}else{o=!1;break}if(!o)break;l[d]=f.join("")}else if(u.type===v.OBJECT&&u.properties.length<=5){let f={};for(let h of u.properties){let m=h.key,y=h.value;if(y.type===v.LITERAL)f[m]=y.value;else if(y.type===v.VARIABLE)f[m]=K(y.path,r,i);else if(y.type===v.INTERPOLATION){let b=[];for(let g of y.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=K(g.path,r,i);b.push(_!=null?String(_):"")}else{o=!1;break}if(!o)break;f[m]=b.join("")}else{o=!1;break}}if(!o)break;l[d]=f}else{o=!1;break}}if(o)return p[n]=l,p}}return null},Qn=(e,t,r,i)=>{let s=t.functions||t;if(e.whenCondition&&!Le(e.whenCondition,s,r,i))return;let n=Xn(e,t,r,i);if(n!==null)return n;if(e.fast){let l={};for(let o of e.properties){let c=o.parsedKey?N(o.parsedKey,t,r,i):o.key,d=o.value;if(d.type===v.LITERAL)l[c]=d.value;else if(d.type===v.VARIABLE)l[c]=K(d.path,r,i);else if(d.type===v.INTERPOLATION){let u=[];for(let f of d.parts)if(typeof f=="string")u.push(f);else if(f.type===v.VARIABLE){let h=K(f.path,r,i);u.push(h!=null?String(h):"")}else{let h=N(f,t,r,i);u.push(h!=null?String(h):"")}l[c]=u.join("")}else l[c]=N(d,t,r,i)}return l}let a={},p=!1;for(let l of e.properties)if(!l.key.startsWith("$if ")&&!l.key.match(/^\$if\s+\w+.*:?$/)&&!l.key.startsWith("$elif")&&!l.key.startsWith("$else")&&!l.key.startsWith("$for ")){p=!0;break}for(let l of e.properties)if(l.key.startsWith("$if ")||l.key.match(/^\$if\s+\w+.*:?$/)){let o=N(l.value,t,r,i);if(!p&&o!==null&&o!==void 0)return Array.isArray(o)&&o.length===1?o[0]:o;typeof o=="object"&&o!==null&&!Array.isArray(o)&&Object.assign(a,o)}else if(l.key.startsWith("$for ")){if(e.properties.length===1)return N(l.value,t,r,i)}else{let o=l.value;if(o&&o.type===v.OBJECT&&o.properties){let c=o.properties.find(d=>d.key.startsWith("$for "));if(c){let d=N(c.value,t,r,i);d!==void 0&&(a[l.key]=d)}else{let d=N(l.value,t,r,i);d!==void 0&&(a[l.key]=d)}}else{let c=l.parsedKey?N(l.parsedKey,t,r,i):l.key,d=N(l.value,t,r,i);d!==void 0&&(a[c]=d)}}return a},Vi={},Zn=(e,t,r,i)=>{let s=[];for(let n of e.items)if(n.type===v.LOOP){let a=N(n,t,r,i);Array.isArray(a)&&n.flatten!==!1?s.push(...a):s.push(a)}else{let a=N(n,t,r,i);a!==Vi&&a!==void 0&&s.push(a)}return s},ea=(e,t,r,i)=>{let{name:s,data:n,whenCondition:a}=e,p=t.partials||{},l=t.functions||t;if(a&&!Le(a,l,r,i))return;if(!p[s])throw new le(`Partial '${s}' is not defined`);let o=i._partialStack||[];if(o.includes(s))throw new le(`Circular partial reference detected: ${s}`);let c=p[s],d=r,u={...i,_partialStack:[...o,s]};if(i){d={...r};for(let f of Object.keys(i))f.startsWith("_")||(d[f]=i[f])}if(n){let f=N(n,t,r,i);d={...d,...f}}return N(c,t,d,u)},ta=(e,t,r,i)=>{let{path:s}=e,n=s.split("."),a=n[0],p=n.slice(1);if(!i||!(a in i))throw new le(`Path reference '#{${s}}' refers to '${a}' which is not a loop variable in the current scope`);if(i.__paths__||(i.__paths__={}),!(a in i.__paths__))throw new le(`Path reference '#{${s}}' cannot be resolved - path tracking may not be initialized properly`);let l=i.__paths__[a];if(typeof l=="number"){if(p.length>0)throw new le(`Path reference '#{${s}}' - cannot access properties on index variable '${a}'`);return String(l)}return p.length>0&&(l+="."+p.join(".")),l},ra=/\$\{([^}]*)\}/g,ia=/#\{([^}]*)\}/g,ji=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,i,s]=r,n=sa(s,t);return{isFunction:!0,type:v.FUNCTION,name:i,args:n}},sa=(e,t={})=>e.trim()?na(e).map(r=>aa(r.trim(),t)):[],na=e=>{let t=[],r="",i=0,s=!1,n="";for(let a=0;a<e.length;a++){let p=e[a],l=a>0?e[a-1]:"";!s&&(p==='"'||p==="'")?(s=!0,n=p,r+=p):s&&p===n&&l!=="\\"?(s=!1,n="",r+=p):!s&&p==="("?(i++,r+=p):!s&&p===")"?(i--,r+=p):!s&&p===","&&i===0?(t.push(r),r=""):r+=p}return r&&t.push(r),t},aa=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:v.LITERAL,value:parseFloat(e)};if(e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};let r=ji(e,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};let i=e.trim(),s=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:a,type:p}of s){let l=0;for(;l<i.length;){let o=Te(i.substring(l),a);if(o===-1)break;let c=l+o;c>n&&(n=c),l=c+a.length}}if(n!==-1)try{return Q(i,t)}catch{return{type:v.VARIABLE,path:i}}return{type:v.VARIABLE,path:i}},Pi=/^\w+\(.*\)$/,oa=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,la=e=>{if(!(!e||e.trim()===""||Pi.test(e))&&oa.test(e))throw e.includes("?")&&e.includes(":")?new $(`Complex expressions not supported in variable replacements - consider calculating the value in your data instead. Offending expression: "${e}"`):e.includes("||")||e.includes("&&")||e.includes("??")?new $(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new $(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},si=e=>{let t=e.trim();if(Pi.test(t))throw new $(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new $(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new $(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new $(`Logical operators not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("?")&&t.includes(":"))throw new $(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:v.PATH_REFERENCE,path:t}},lt=(e,t={})=>{let r=e.trim();la(r);let i=ji(r,t);if(i.isFunction)return{type:i.type,name:i.name,args:i.args};if(r.includes("[")&&!/[\s+\-*/%|&?:]/.test(r)){let s=0;for(let n of r)n==="["?s++:n==="]"&&s--;if(s!==0)throw new Error("Invalid array index syntax")}return{type:v.VARIABLE,path:r}},Bi=(e,t={})=>{let r=e,i=[];(e.includes("\\${")||e.includes("\\#{"))&&(r=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),r=r.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),r=r.replace(/\\(\$\{[^}]*\})/g,(o,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\(#\{[^}]*\})/g,(o,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\DOUBLE_ESC_VAR/g,"\\"),r=r.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let s=[...r.matchAll(ra)],n=[...r.matchAll(ia)],a=[...s.map(o=>({match:o,type:"variable"})),...n.map(o=>({match:o,type:"pathref"}))].sort((o,c)=>o.match.index-c.match.index);if(a.length===0){let o=r;for(let c=0;c<i.length;c++)o=o.replace(`__ESCAPED_${c}__`,i[c]);return{type:v.LITERAL,value:o}}if(a.length===1&&a[0].match[0]===r&&i.length===0){let{match:o,type:c}=a[0];try{return c==="variable"?lt(o[1],t):si(o[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:v.LITERAL,value:r};throw d}}let p=[],l=0;for(let{match:o,type:c}of a){let[d,u]=o,f=o.index;if(f>l){let h=r.substring(l,f);for(let m=0;m<i.length;m++)h=h.replace(`__ESCAPED_${m}__`,i[m]);h&&p.push(h)}try{let h;c==="variable"?h=lt(u.trim(),t):h=si(u.trim()),p.push(h)}catch(h){if(h.message==="Invalid array index syntax")p.push(d);else throw h}l=f+d.length}if(l<r.length){let o=r.substring(l);for(let c=0;c<i.length;c++)o=o.replace(`__ESCAPED_${c}__`,i[c]);o&&p.push(o)}return{type:v.INTERPOLATION,parts:p}},Se=(e,t)=>typeof e=="string"?Bi(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?da(e,t):ca(e,t):{type:v.LITERAL,value:e},pa=e=>{let{$each:t,...r}=e;if(typeof t!="string")throw new $("$each value must be a non-empty string");let i=t.trim();if(i==="")throw new $("$each value must be a non-empty string");if(Object.keys(r).length===0)throw new $("Empty $each body not allowed");if(r.$partial!==void 0)throw new $("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${i}`]:r}},da=(e,t)=>{let r=[],i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let l=pa(n),o=Object.keys(l);if(o.length===1&&/^\$for(?::\w+)?\s/.test(o[0])){let c=ni(o[0],l[o[0]],t,!0);r.push(c),i=!0;continue}}catch(l){throw l instanceof $?l:new $(l.message)}let p=Object.keys(n);if(p.length===1&&/^\$for(?::\w+)?\s/.test(p[0])){let l=ni(p[0],n[p[0]],t);r.push(l),i=!0;continue}}let a=Se(n,t);r.push(a),(a.type===v.FUNCTION||a.type===v.CONDITIONAL||a.type===v.LOOP||a.type===v.PARTIAL||a.type===v.OBJECT&&!a.fast||a.type===v.ARRAY&&!a.fast)&&(i=!0)}return{type:v.ARRAY,items:r,fast:!i}},ca=(e,t)=>{let r=[],i=!1,s=null,n=Object.entries(e),a=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new $("$partial value must be a string");if(e.$partial.trim()==="")throw new $("$partial value cannot be an empty string");let l=["$if","$elif","$else","$for"],o=[];for(let[b]of n)for(let g of l)if(b===g||b.startsWith(g+" ")||b.startsWith(g+"#")){o.push(g);break}if(o.length>0)throw new $(`Cannot use $partial with ${o.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...u}=e,f={},h=!1;for(let[b,g]of Object.entries(u)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=g,h=!0}let m=null;if(h&&(m=Se(f,t),m.type===v.OBJECT)){let b=!1;for(let g of m.properties)if(g.value.type===v.VARIABLE||g.value.type===v.INTERPOLATION||g.value.type===v.FUNCTION||g.value.type===v.CONDITIONAL||g.value.type===v.OBJECT&&!g.value.fast||g.value.type===v.ARRAY&&!g.value.fast){b=!0;break}b&&(m.fast=!1)}let y={type:v.PARTIAL,name:c,data:m};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new $("Empty condition expression after '$when'");b=Q(d,t)}else b={type:v.LITERAL,value:d};y.whenCondition=b}return y}for(let[l,o]of n)if(l==="$when"){if(s!==null)throw new $("Multiple '$when' directives on the same object are not allowed");if(o==null)throw new $("Missing condition expression after '$when'");let c=typeof o=="string"?o:JSON.stringify(o);if(c.trim()==="")throw new $("Empty condition expression after '$when'");s=Q(c,t),i=!0}else if(l.startsWith("$when#")||l.startsWith("$when "))throw new $("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;a<n.length;){let[l,o]=n[a];if(l==="$when"){a++;continue}if(l==="$each")throw new $("$each can only be used inside arrays");if(l.startsWith("$if ")||l.match(/^\$if#\w+\s/)||l.match(/^\$if\s+\w+.*:$/)){let c=ha(n,a,t);r.push({key:l,value:c.node}),i=!0,a=c.nextIndex}else if(/^\$for(?::\w+)?\s/.test(l)){let c=l.match(/^\$for(?::(\w+))?\s/)?.[1]||"",d=c?`:${c}`:"";throw new $(`$for loops must be inside arrays - use '- $for${d} item in items:' instead of '$for${d} item in items:'. For cleaner object generation syntax, consider using $each.`)}else{if(l.startsWith("$elif ")||l.startsWith("$else"))throw new $(`'${l.split(" ")[0]}' without matching '$if'`);if(l==="$if"||l==="$if:")throw new $("Missing condition expression after '$if'");{let c=Se(o,t);(c.type===v.FUNCTION||c.type===v.CONDITIONAL||c.type===v.PARTIAL||c.type===v.OBJECT&&!c.fast||c.type===v.ARRAY&&!c.fast)&&(i=!0);let d=Bi(l,t),u={key:l,value:c};(d.type!==v.LITERAL||d.value!==l)&&(u.parsedKey=d),r.push(u),a++}}}let p={type:v.OBJECT,properties:r,fast:!i};return s&&(p.whenCondition=s),p},ha=(e,t,r={})=>{let i=[],s=[],n=t,[a,p]=e[n],l=null,o;if(a.startsWith("$if#")){let d=a.match(/^\$if#(\w+)\s+(.+)$/);if(d)l=d[1],o=d[2];else throw new $(`Invalid conditional syntax: ${a}`)}else o=a.substring(4),o.endsWith(":")&&(o=o.slice(0,-1).trim());ri(o);let c=Q(o,r);for(i.push(c),s.push(Se(p,r)),n++;n<e.length;){let[d,u]=e[n],f=!1,h;if(l?d.startsWith(`$elif#${l} `)?(h=d.substring(`$elif#${l} `.length),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(d===`$else#${l}`||d===`$else#${l}:`)&&(f=!0,h=null):d.startsWith("$elif ")?(h=d.substring(6),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,h=null),f){if(h===null)i.push(null);else{ri(h);let m=Q(h,r);i.push(m)}if(s.push(Se(u,r)),n++,h===null)break}else break}return{node:{type:v.CONDITIONAL,conditions:i,bodies:s,id:l},nextIndex:n}},Q=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let o=e.slice(1,-1),c=0,d=!0;for(let u=0;u<o.length;u++)if(o[u]==="("?c++:o[u]===")"&&c--,c<0){d=!1;break}if(d&&c===0)return Q(o,t)}let r=Te(e,"||");if(r!==-1)return{type:v.BINARY,op:P.OR,left:Q(e.substring(0,r).trim(),t),right:Q(e.substring(r+2).trim(),t)};let i=Te(e,"&&");if(i!==-1)return{type:v.BINARY,op:P.AND,left:Q(e.substring(0,i).trim(),t),right:Q(e.substring(i+2).trim(),t)};let s=[{op:">=",type:P.GTE},{op:"<=",type:P.LTE},{op:"==",type:P.EQ},{op:"!=",type:P.NEQ},{op:">",type:P.GT},{op:"<",type:P.LT},{op:" in ",type:P.IN}];for(let{op:o,type:c}of s){let d=Te(e,o);if(d!==-1)return{type:v.BINARY,op:c,left:Q(e.substring(0,d).trim(),t),right:Q(e.substring(d+o.length).trim(),t)}}let n=-1,a=null,p=[{op:" + ",type:P.ADD},{op:" - ",type:P.SUBTRACT}];for(let{op:o,type:c}of p){let d=0;for(;d<e.length;){let u=Te(e.substring(d),o);if(u===-1)break;let f=d+u;f>n&&(n=f,a={op:o,type:c}),d=f+o.length}}if(n!==-1&&a)return{type:v.BINARY,op:a.type,left:Q(e.substring(0,n).trim(),t),right:Q(e.substring(n+a.op.length).trim(),t)};let l=[" * "," / "," % "];for(let o of l)if(Te(e,o)!==-1)throw new $(`Arithmetic operations are not allowed in conditionals: "${o}"`);return e.startsWith("!")?{type:v.UNARY,op:tr.NOT,operand:Q(e.substring(1).trim(),t)}:Di(e,t)},Te=(e,t)=>{let r=0,i=0;for(;i<=e.length-t.length;){if(e[i]==="(")r++;else if(e[i]===")")r--;else if(r===0&&e.substring(i,i+t.length)===t)return i;i++}return-1},ua=e=>{if(e=e.trim(),e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:v.LITERAL,value:""};if(e==="{}")return{type:v.LITERAL,value:{}};if(e==="[]")return{type:v.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:v.LITERAL,value:t}:{type:v.VARIABLE,path:e}},Di=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return lt(r,t);let i=ua(r);if(i.type===v.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:v.VARIABLE,path:r};try{return lt(r,t)}catch(s){if(s.message&&s.message.includes("not supported"))return i;throw s}},fa=(e,t=!1)=>{try{Bn(e)}catch(r){if(r instanceof $&&t){let i=r.message.replace(/\$for/g,"$each");throw new $(i.replace("Parse Error: ",""))}throw r}},ni=(e,t,r,i=!1)=>{let s=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(s);if(!n){let y=i?"$each":"$for";throw new $(`Invalid loop syntax (got: '${e.replace("$for",y)}')`)}let a=n[1],p=n[2].trim();fa(p,i);let l=p.match(/^(.+?)\s+in\s+(.+)$/);if(!l){let y=i?"$each":"$for";throw new $(`Invalid loop syntax - missing 'in' keyword (got: '${y} ${p}')`)}let o=l[1].trim(),c=l[2].trim(),d,u=null;if(o.includes(",")){let y=o.split(",").map(b=>b.trim());if(y.length!==2)throw new $(`Invalid loop variables: ${o}. Expected format: "item" or "item, index"`);d=y[0],u=y[1]}else d=o;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new $(`Reserved variable name: ${d}`);if(u&&f.includes(u))throw new $(`Reserved variable name: ${u}`);let h=Di(c,r),m=Se(t,r);return{type:v.LOOP,itemVar:d,indexVar:u,iterable:h,body:m,flatten:a!=="nested"}},ai=(e,t={})=>{let{functions:r={}}=t;return Se(e,r)},ma=()=>Date.now(),ya=Object.freeze(Object.defineProperty({__proto__:null,now:ma},Symbol.toStringTag,{value:"Module"})),ga=(e,t,r={})=>{let{functions:i={},partials:s={}}=r,n={...ya,...i},a=ai(e,{functions:n}),p={};for(let[l,o]of Object.entries(s))p[l]=ai(o,{functions:n});return Fn(a,t,{functions:n,partials:p})},ur=e=>e!==null&&typeof e=="object",pt=e=>ur(e)&&!Array.isArray(e),ba=e=>typeof e=="string"&&e.includes("."),zi=e=>typeof e=="string"&&/[\[\]]/.test(e);function Fi(e,t){let r={};for(let i of t){if(typeof i!="string"||i.length===0)continue;let s=pe(e,i);s!==void 0&&he(r,i,s)}return r}function va(e){if(!pt(e)||!Array.isArray(e.fields))return e;let t=(r=[])=>r.map(i=>{if(!pt(i))return i;if(typeof i.$when=="string"&&i.$when.trim().length>0){let{$when:s,...n}=i,a=Array.isArray(n.fields)?{...n,fields:t(n.fields)}:n;return{[`$if ${s}`]:a}}return Array.isArray(i.fields)?{...i,fields:t(i.fields)}:i});return{...e,fields:t(e.fields)}}var pe=(e,t,r=void 0)=>{if(!t||!ur(e)||zi(t))return r;let i=t.split(".").filter(n=>n!==""),s=e;for(let n of i){if(s==null||!(n in s))return Object.prototype.hasOwnProperty.call(e,t)?e[t]:r;s=s[n]}return s},he=(e,t,r)=>{if(!ur(e)||typeof t!="string"||t.length===0||zi(t))return e;let i=t.split(".").filter(n=>n!=="");if(i.length===0)return e;ba(t)&&Object.prototype.hasOwnProperty.call(e,t)&&delete e[t];let s=e;for(let n=0;n<i.length-1;n++){let a=i[n];(!(a in s)||typeof s[a]!="object"||s[a]===null)&&(s[a]={}),s=s[a]}return s[i[i.length-1]]=r,e},wa=["id","class","style","slot","form","defaultValues","disabled","context"],_a=(e={})=>Object.entries(e).filter(([t,r])=>!(wa.includes(t)||r==null||typeof r=="object"||typeof r=="function")).map(([t,r])=>`${t}=${String(r)}`).join(" "),xa={email:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,url:/^https?:\/\/.+/},ce={required:"This field is required",minLength:e=>`Must be at least ${e} characters`,maxLength:e=>`Must be at most ${e} characters`,pattern:"Invalid format",invalidDate:"Invalid date format",invalidTime:"Invalid time format",invalidDateTime:"Invalid date and time format",minTemporal:e=>`Must be on or after ${e}`,maxTemporal:e=>`Must be on or before ${e}`},Sa="input-date",Aa="input-time",Ea="input-datetime",ka=/^(\d{4})-(\d{2})-(\d{2})$/,$a=/^(\d{2}):(\d{2})(?::(\d{2}))?$/,Ca=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}(?::\d{2})?)$/,Ia=e=>{if(typeof e!="string")return null;let t=ka.exec(e);if(!t)return null;let r=Number(t[1]),i=Number(t[2]),s=Number(t[3]);if(!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(s)||i<1||i>12||s<1||s>31)return null;let n=new Date(Date.UTC(r,i-1,s));return n.getUTCFullYear()===r&&n.getUTCMonth()===i-1&&n.getUTCDate()===s?{year:r,month:i,day:s}:null},Ta=e=>{if(typeof e!="string")return null;let t=$a.exec(e);if(!t)return null;let r=Number(t[1]),i=Number(t[2]),s=t[3]===void 0?0:Number(t[3]);return!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(s)||r<0||r>23||i<0||i>59||s<0||s>59?null:{hour:r,minute:i,second:s}},Wi=e=>{let t=Ta(e);return t?`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}`:null},Mi=e=>Ia(e)?e:null,Oa=e=>{if(typeof e!="string")return null;let t=Ca.exec(e);if(!t)return null;let r=Mi(t[1]),i=Wi(t[2]);return!r||!i?null:`${r}T${i}`},La=e=>e===Sa?{normalize:Mi,invalidMessage:ce.invalidDate}:e===Aa?{normalize:Wi,invalidMessage:ce.invalidTime}:e===Ea?{normalize:Oa,invalidMessage:ce.invalidDateTime}:null,Na=(e,t)=>{let r=La(e.type);if(!r||t==null||t==="")return null;let i=r.normalize(String(t));if(!i)return r.invalidMessage;if(e.min!==void 0&&e.min!==null&&String(e.min)!==""){let s=r.normalize(String(e.min));if(s&&i<s)return ce.minTemporal(String(e.min))}if(e.max!==void 0&&e.max!==null&&String(e.max)!==""){let s=r.normalize(String(e.max));if(s&&i>s)return ce.maxTemporal(String(e.max))}return null},mt=(e,t)=>{if(e.required){let i=t==null||t===""||typeof t=="boolean"&&t===!1,s=e.type==="input-number"&&t===null;if(e.type==="input-number"?s:i)return typeof e.required=="object"&&e.required.message?e.required.message:ce.required}let r=Na(e,t);if(r)return r;if(Array.isArray(e.rules))for(let i of e.rules){let s=Ra(i,t);if(s)return s}return null},Ra=(e,t)=>{if(t==null||t==="")return null;let r=String(t);switch(e.rule){case"minLength":return r.length<e.value?e.message||ce.minLength(e.value):null;case"maxLength":return r.length>e.value?e.message||ce.maxLength(e.value):null;case"pattern":{let i=xa[e.value];if(!i)try{i=new RegExp(e.value)}catch{return e.message||ce.pattern}return i.test(r)?null:e.message||ce.pattern}default:return null}},yt=(e,t)=>{let r={},i=se(e);for(let s of i){let n=pe(t,s.name),a=mt(s,n);a&&(r[s.name]=a)}return{valid:Object.keys(r).length===0,errors:r}},Va=["section","read-only-text","slot"],fr=e=>!Va.includes(e.type),se=e=>{let t=[];for(let r of e)r.type==="section"&&Array.isArray(r.fields)?t.push(...se(r.fields)):fr(r)&&t.push(r);return t},mr=e=>{switch(e.type){case"input-text":case"input-date":case"input-time":case"input-datetime":case"input-textarea":case"popover-input":return"";case"input-number":return null;case"select":return null;case"checkbox":return!1;case"color-picker":return"#000000";case"slider":case"slider-with-input":return e.min!==void 0?e.min:0;case"image":return null;default:return null}},yr=(e,t=0)=>{let r=[],i=t;for(let s of e)if(s.type==="section"){if(r.push({...s,_isSection:!0,_idx:i}),i++,Array.isArray(s.fields)){let n=yr(s.fields,i);r.push(...n),i+=n.length}}else r.push({...s,_isSection:!1,_idx:i}),i++;return r},ja=()=>Object.freeze({formValues:{},errors:{},reactiveMode:!1,tooltipState:{open:!1,x:0,y:0,content:""}}),ee=({state:e,props:t})=>{let{form:r={}}=t||{},i=va(r),s=pt(t?.context)?t.context:{},n=pt(e?.formValues)?e.formValues:{},a={...s,...n,formValues:n};return Object.keys(a).length>0?ga(i,a):i},Pa=({state:e,props:t})=>{let r=_a(t),i=ee({state:e,props:t}),s=i.fields||[],n=!!t?.disabled,a=yr(s);a.forEach((d,u)=>{if(d._arrIdx=u,d._isSection)return;let f=fr(d);if(d._disabled=n||!!d.disabled,f&&d.name&&(d._error=e.errors[d.name]||null),d.type==="input-text"&&(d._inputType=d.inputType||"text"),d.type==="select"){let h=pe(e.formValues,d.name);d._selectedValue=h!==void 0?h:null,d.placeholder=d.placeholder||"",d.noClear=d.clearable===!1}if(d.type==="image"){let h=pe(e.formValues,d.name);d._imageSrc=h&&String(h).trim()?h:null,d.placeholderText=d.placeholderText||"No Image"}if(d.type==="read-only-text"&&(d.content=d.content||""),d.type==="checkbox"){let h=typeof d.content=="string"?d.content:typeof d.checkboxLabel=="string"?d.checkboxLabel:"";d._checkboxText=h}});let p=i.actions||{buttons:[]},l=p.layout||"split",o=(p.buttons||[]).map((d,u)=>({...d,_globalIdx:u,variant:d.variant||"se",_disabled:n||!!d.disabled,pre:d.pre||"",suf:d.suf||""})),c;return l==="split"?c={_layout:"split",buttons:o,_leftButtons:o.filter(d=>d.align==="left"),_rightButtons:o.filter(d=>d.align!=="left")}:c={_layout:l,buttons:o,_allButtons:o},{containerAttrString:r,title:i?.title||"",description:i?.description||"",flatFields:a,actions:c,formValues:e.formValues,tooltipState:e.tooltipState}},$e=({state:e,props:t})=>{let r=ee({state:e,props:t}),i=se(r.fields||[]);return Fi(e.formValues,i.map(s=>s.name).filter(s=>typeof s=="string"&&s.length>0))},Ba=({state:e,props:t},r={})=>{let{name:i,value:s}=r;i&&(he(e.formValues,i,s),Qe({state:e,props:t}))},Qe=({state:e,props:t})=>{if(!t)return;let r=ee({state:e,props:t}),i=se(r.fields||[]);e.formValues=Fi(e.formValues,i.map(s=>s.name).filter(s=>typeof s=="string"&&s.length>0))},Da=({state:e},t={})=>{let{values:r}=t;!r||typeof r!="object"||Object.keys(r).forEach(i=>{he(e.formValues,i,r[i])})},za=({state:e},t={})=>{let{defaultValues:r={}}=t;e.formValues=r?structuredClone(r):{},e.errors={},e.reactiveMode=!1},Fa=({state:e},t={})=>{e.errors=t.errors||{}},Wa=({state:e},t={})=>{let{name:r}=t;r&&e.errors[r]&&delete e.errors[r]},Ma=({state:e})=>{e.reactiveMode=!0},Ka=({state:e},t={})=>{let{x:r,y:i,content:s}=t;e.tooltipState={open:!0,x:r,y:i,content:s}},Ua=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},Ha=Object.freeze(Object.defineProperty({__proto__:null,clearFieldError:Wa,collectAllDataFields:se,createInitialState:ja,flattenFields:yr,get:pe,getDefaultValue:mr,hideTooltip:Ua,isDataField:fr,pruneHiddenValues:Qe,resetFormValues:za,selectForm:ee,selectFormValues:$e,selectViewData:Pa,set:he,setErrors:Fa,setFormFieldValue:Ba,setFormValues:Da,setReactiveMode:Ma,showTooltip:Ka,validateField:mt,validateForm:yt},Symbol.toStringTag,{value:"Module"})),Ki=({field:e,target:t,value:r})=>{!e||!t||["slider-with-input","popover-input"].includes(e.type)&&(r==null?t.removeAttribute("value"):t.setAttribute("value",String(r)))},Ui=({form:e,formValues:t={},refs:r,formDisabled:i=!1})=>{let s=e.fields||[],n=0,a=p=>{for(let l of p){if(l.type==="section"){n++,Array.isArray(l.fields)&&a(l.fields);continue}let o=r[`field${n}`];if(n++,!o)continue;let c=i||!!l.disabled;if(["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"].includes(l.type)){let d=pe(t,l.name);if(d==null?o.removeAttribute("value"):o.setAttribute("value",String(d)),l.type==="slider-with-input"&&o.store?.setValue){let u=Number(d??0);o.store.setValue({value:Number.isFinite(u)?u:0}),typeof o.render=="function"&&o.render()}l.type==="popover-input"&&o.store?.setValue&&(o.store.setValue({value:d==null?"":String(d)}),typeof o.render=="function"&&o.render())}l.type==="checkbox"&&(pe(t,l.name)?o.setAttribute("checked",""):o.removeAttribute("checked")),["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input"].includes(l.type)&&l.placeholder&&o.getAttribute("placeholder")!==l.placeholder&&(l.placeholder===void 0||l.placeholder===null?o.removeAttribute("placeholder"):o.setAttribute("placeholder",l.placeholder)),c?o.setAttribute("disabled",""):o.removeAttribute("disabled")}};a(s)},qa=(e,t)=>{let r=t?.defaultValues||{},i={};Object.keys(r).forEach(p=>{he(i,p,r[p])});let s=ee({state:{formValues:i},props:t}),n=se(s.fields||[]),a={};for(let p of n){let l=pe(r,p.name);l!==void 0?he(a,p.name,l):he(a,p.name,mr(p))}e.resetFormValues({defaultValues:a})},Ga=e=>{let{store:t,props:r}=e;qa(t,r)},Ja=e=>{let{props:t,refs:r,render:i}=e,s=e.store.getState(),n=ee({state:s,props:t});Ui({form:n,formValues:s.formValues,refs:r,formDisabled:!!t?.disabled}),i()},Ya=(e,t)=>{let{newProps:r}=t,{store:i,render:s,refs:n}=e,a=!!r?.disabled,p=i.getState();Qe({state:p,props:r});let l=ee({state:p,props:r});Ui({form:l,formValues:p.formValues,refs:n,formDisabled:a}),s()},Xa=(e,t)=>{let{store:r,dispatchEvent:i,render:s,props:n}=e,a=t._event,p=a.currentTarget.dataset.fieldName;if(!p||!a.detail||!Object.prototype.hasOwnProperty.call(a.detail,"value"))return;let l=a.detail.value;r.setFormFieldValue({name:p,value:l});let o=r.getState();Qe({state:o,props:n});let c=ee({state:o,props:n}),d=se(c.fields||[]).find(u=>u.name===p);if(Ki({field:d,target:a.currentTarget,value:l}),o.reactiveMode&&d){let u=mt(d,l);u?r.setErrors({errors:{...o.errors,[p]:u}}):r.clearFieldError({name:p})}s(),i(new CustomEvent("form-input",{bubbles:!0,detail:{name:p,value:l,values:$e({state:r.getState(),props:n})}}))},Qa=(e,t)=>{let{store:r,dispatchEvent:i,render:s,props:n}=e,a=t._event,p=a.currentTarget.dataset.fieldName;if(!p||!a.detail||!Object.prototype.hasOwnProperty.call(a.detail,"value"))return;let l=a.detail.value;r.setFormFieldValue({name:p,value:l});let o=r.getState();Qe({state:o,props:n});let c=ee({state:o,props:n}),d=se(c.fields||[]).find(u=>u.name===p);if(Ki({field:d,target:a.currentTarget,value:l}),o.reactiveMode&&d){let u=mt(d,l);u?r.setErrors({errors:{...o.errors,[p]:u}}):r.clearFieldError({name:p})}s(),i(new CustomEvent("form-change",{bubbles:!0,detail:{name:p,value:l,values:$e({state:r.getState(),props:n})}}))},Za=(e,t)=>{let{store:r,dispatchEvent:i,render:s,props:n}=e,a=t._event.currentTarget.dataset.actionId;if(!a)return;let p=r.getState(),l=ee({state:p,props:n}),o=((l.actions||{}).buttons||[]).find(d=>d.id===a),c=$e({state:p,props:n});if(o&&o.validate){let d=se(l.fields||[]),{valid:u,errors:f}=yt(d,p.formValues);r.setErrors({errors:f}),u||r.setReactiveMode(),s(),i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:a,values:c,valid:u,errors:f}}))}else i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:a,values:c}}))},eo=(e,t)=>{let r=t._event;r.type==="contextmenu"&&r.preventDefault();let{store:i,dispatchEvent:s,props:n}=e,a=r.currentTarget.dataset.fieldName;s(new CustomEvent("form-field-event",{bubbles:!0,detail:{name:a,event:r.type,values:$e({state:i.getState(),props:n})}}))},to=(e,t)=>{let{store:r,dispatchEvent:i,render:s,props:n}=e,a=t._event;if(a.key==="Enter"&&!a.shiftKey){let p=a.target;if(p.tagName==="TEXTAREA"||p.tagName==="RTGL-TEXTAREA")return;a.preventDefault();let l=r.getState(),o=ee({state:l,props:n}),c=(o.actions||{}).buttons||[],d=c.find(f=>f.validate)||c[0];if(!d)return;let u=$e({state:l,props:n});if(d.validate){let f=se(o.fields||[]),{valid:h,errors:m}=yt(f,l.formValues);r.setErrors({errors:m}),h||r.setReactiveMode(),s(),i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:u,valid:h,errors:m}}))}else i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:u}}))}},ro=(e,t)=>{let{store:r,render:i,props:s}=e,n=t._event,a=n.currentTarget.dataset.fieldName,p=ee({state:r.getState(),props:s}),l=se(p.fields||[]).find(o=>o.name===a);if(l&&l.tooltip){let o=n.currentTarget.getBoundingClientRect();r.showTooltip({x:o.left+o.width/2,y:o.top-8,content:typeof l.tooltip=="string"?l.tooltip:l.tooltip.content||""}),i()}},io=e=>{let{store:t,render:r}=e;t.hideTooltip({}),r()},so=Object.freeze(Object.defineProperty({__proto__:null,handleActionClick:Za,handleAfterMount:Ja,handleBeforeMount:Ga,handleImageClick:eo,handleKeyDown:to,handleOnUpdate:Ya,handleTooltipMouseEnter:ro,handleTooltipMouseLeave:io,handleValueChange:Qa,handleValueInput:Xa},Symbol.toStringTag,{value:"Module"})),no=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"],ao=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input","slider-with-input"],oo=({ref:e,fieldType:t,value:r,forceRefresh:i=!1})=>{if(no.includes(t)){if(i&&e.removeAttribute("value"),r==null){if(ao.includes(t)&&i){if(t==="popover-input"){e.removeAttribute("value");return}e.setAttribute("value","");return}e.removeAttribute("value");return}e.setAttribute("value",String(r))}},Hi=({ref:e,value:t})=>{e&&e?.store?.updateSelectedValue&&(e.store.updateSelectedValue({value:t}),typeof e.render=="function"&&e.render())},lo=e=>{let t=new Map;return!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("[data-field-name]").forEach(r=>{let i=r.getAttribute("data-field-name");i&&t.set(i,r)}),t},oi=e=>e?.renderTarget?e.renderTarget:e?.shadowRoot?e.shadowRoot:e?.shadow,po=({root:e,values:t={}})=>{!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("rtgl-select[data-field-name]").forEach(r=>{let i=r.dataset?.fieldName;if(!i)return;let s=pe(t,i);Hi({ref:r,value:s})})},co=function(){let e=this.store.getState();return $e({state:e,props:this.props})},ho=function(e={}){let t=e&&typeof e=="object"&&e.values&&typeof e.values=="object"?e.values:e;if(!t||typeof t!="object"||Array.isArray(t))return;this.store.setFormValues({values:t}),this.store.pruneHiddenValues();let r=this.store.getState(),i=ee({state:r,props:this.props}),s=se(i.fields||[]),n=lo(oi(this));for(let p of s){if(!p.name)continue;let l=n.get(p.name);if(!l)continue;let o=Object.prototype.hasOwnProperty.call(t,p.name),c=pe(t,p.name);if(!o&&c===void 0)continue;let d=pe(r.formValues,p.name);oo({ref:l,fieldType:p.type,value:d,forceRefresh:!0}),typeof l?.tagName=="string"&&l.tagName.toUpperCase()==="RTGL-SELECT"&&Hi({ref:l,value:d}),p.type==="checkbox"&&(d?l.setAttribute("checked",""):l.removeAttribute("checked"))}this.render();let a=()=>{let p=this.store.getState();po({root:oi(this),values:p.formValues})};a(),setTimeout(()=>{a()},0)},uo=function(){let e=this.store.getState(),t=ee({state:e,props:this.props}),r=se(t.fields||[]),{valid:i,errors:s}=yt(r,e.formValues);return this.store.setErrors({errors:s}),i||this.store.setReactiveMode(),this.render(),{valid:i,errors:s}},fo=function(){let e=this.props?.defaultValues||{},t={};Object.keys(e).forEach(n=>{he(t,n,e[n])});let r=ee({state:{formValues:t},props:this.props}),i=se(r.fields||[]),s={};for(let n of i){let a=pe(e,n.name);a!==void 0?he(s,n.name,a):he(s,n.name,mr(n))}this.store.resetFormValues({defaultValues:s}),this.setValues(s)},mo=Object.freeze(Object.defineProperty({__proto__:null,getValues:co,reset:fo,setValues:ho,validate:uo},Symbol.toStringTag,{value:"Module"})),yo=e=>{let t=e.selectUiType();return t==="dropdown"||t==="formDialog"?null:e.selectConfig().mode==="confirm"?!1:null},ge=({store:e,render:t,globalUI:r,emitResult:i=!1,result:s})=>{if(!e.selectIsOpen())return;let n=s!==void 0?s:yo(e);e.closeAll(),t(),i&&r.emit("event",n)},gt=({store:e,render:t,globalUI:r})=>{e.selectIsOpen()&&ge({store:e,render:t,globalUI:r,emitResult:!0})},go=(e,t)=>{setTimeout(()=>{let{store:r,refs:i}=e;if(!r.selectIsOpen()||r.selectUiType()!=="formDialog")return;let s=r.selectFormDialogConfig?.();if(!s||s.key!==t||typeof s.mount!="function")return;let n=i.formDialog;n&&s.mount(n)},0)},bo=e=>{let{store:t,render:r,globalUI:i}=e;ge({store:t,render:r,globalUI:i,emitResult:!0})},vo=e=>{let{store:t,render:r,globalUI:i}=e,s=t.selectConfig().mode==="confirm"?!0:null;ge({store:t,render:r,globalUI:i,emitResult:!0,result:s})},wo=e=>{let{store:t,render:r,globalUI:i}=e;ge({store:t,render:r,globalUI:i,emitResult:!0,result:!1})},_o=e=>{let{store:t,render:r,globalUI:i}=e;ge({store:t,render:r,globalUI:i,emitResult:!0,result:null})},xo=(e,t)=>{let{store:r,render:i,globalUI:s}=e,n=t._event,{index:a,item:p}=n.detail;ge({store:r,render:i,globalUI:s,emitResult:!0,result:{index:a,item:p}})},So=(e,t)=>{let{store:r,render:i,globalUI:s}=e,n=t;return gt({store:r,render:i,globalUI:s}),r.setAlertConfig(n),i(),new Promise(a=>{s.once("event",()=>{a()})})},Ao=async(e,t)=>{let{store:r,render:i,globalUI:s}=e,n=t;return gt({store:r,render:i,globalUI:s}),r.setConfirmConfig(n),i(),new Promise(a=>{s.once("event",p=>{a(p)})})},Eo=async(e,t)=>{let{store:r,render:i,globalUI:s}=e,n=t;return gt({store:r,render:i,globalUI:s}),r.setDropdownConfig(n),i(),new Promise(a=>{s.once("event",p=>{a(p)})})},ko=async(e,t)=>{let{store:r,render:i,globalUI:s}=e,n=t;gt({store:r,render:i,globalUI:s}),r.setFormDialogConfig(n),i();let a=r.selectFormDialogConfig?.().key;return go(e,a),new Promise(p=>{s.once("event",l=>{p(l)})})},$o=(e,t)=>{let{store:r,render:i,globalUI:s}=e,n=t._event?.detail||{};n.valid!==!1&&ge({store:r,render:i,globalUI:s,emitResult:!0,result:n})},Co=(e,t)=>{let{store:r,refs:i}=e,s=t._event?.detail||{},n=r.selectFormDialogConfig?.();typeof n?.onFieldEvent=="function"&&n.onFieldEvent({detail:s,formEl:i.formDialog||null})},Io=e=>{let{store:t,render:r,globalUI:i}=e;ge({store:t,render:r,globalUI:i,emitResult:!0})},To=Object.freeze(Object.defineProperty({__proto__:null,handleCancel:wo,handleCloseAll:Io,handleConfirm:vo,handleDialogClose:bo,handleDropdownClose:_o,handleDropdownItemClick:xo,handleFormAction:$o,handleFormFieldEvent:Co,handleShowAlert:So,handleShowConfirm:Ao,handleShowDropdownMenu:Eo,handleShowFormDialog:ko},Symbol.toStringTag,{value:"Module"})),Oo=new Set(["sm","md","lg","f"]),li=e=>!e||typeof e!="object"||Array.isArray(e)?{}:e,rr=(e,t="md")=>Oo.has(e)?e:t,Lo=()=>Object.freeze({isOpen:!1,uiType:"dialog",config:{status:void 0,title:"",message:"",confirmText:"OK",cancelText:"Cancel",mode:"alert"},dropdownConfig:{items:[],x:0,y:0,place:"bs"},formDialogConfig:{form:null,defaultValues:{},context:{},disabled:!1,size:"md",key:0,onFieldEvent:null,mount:null}}),No=({state:e},t={})=>{if(!t.message)throw new Error("message is required for showAlert");e.config={status:t.status||void 0,title:t.title||"",message:t.message,confirmText:t.confirmText||"OK",cancelText:"",mode:"alert"},e.uiType="dialog",e.isOpen=!0},Ro=({state:e},t={})=>{if(!t.message)throw new Error("message is required for showConfirm");e.config={status:t.status||void 0,title:t.title||"",message:t.message,confirmText:t.confirmText||"Yes",cancelText:t.cancelText||"Cancel",mode:"confirm"},e.uiType="dialog",e.isOpen=!0},Vo=({state:e},t={})=>{if(!t.items||!Array.isArray(t.items))throw new Error("items array is required for showDropdown");e.dropdownConfig={items:t.items,x:t.x||0,y:t.y||0,place:t.place||"bs"},e.uiType="dropdown",e.isOpen=!0},jo=({state:e},t={})=>{if(!t.form||typeof t.form!="object"||Array.isArray(t.form))throw new Error("form object is required for showFormDialog");let r=e.formDialogConfig?.key||0;e.formDialogConfig={form:t.form,defaultValues:li(t.defaultValues),context:li(t.context),disabled:!!t.disabled,size:rr(t.size,"md"),key:r+1,onFieldEvent:typeof t.onFieldEvent=="function"?t.onFieldEvent:null,mount:typeof t.mount=="function"?t.mount:null},e.uiType="formDialog",e.isOpen=!0},Po=({state:e})=>{e.isOpen=!1,e.uiType="dialog"},Bo=({state:e})=>e.config,Do=({state:e})=>e.dropdownConfig,zo=({state:e})=>e.formDialogConfig,Fo=({state:e})=>e.uiType,Wo=({state:e})=>e.isOpen,Mo=({state:e})=>{let t=e.isOpen&&e.uiType==="dialog",r=e.isOpen&&e.uiType==="formDialog";return{isOpen:e.isOpen,uiType:e.uiType,config:e.config,dropdownConfig:{items:e.dropdownConfig?.items||[],x:e.dropdownConfig?.x||0,y:e.dropdownConfig?.y||0,place:e.dropdownConfig?.place||"bs"},formDialogConfig:{form:e.formDialogConfig?.form||{fields:[],actions:{buttons:[]}},defaultValues:e.formDialogConfig?.defaultValues||{},context:e.formDialogConfig?.context||{},disabled:!!e.formDialogConfig?.disabled,size:rr(e.formDialogConfig?.size,"md"),key:e.formDialogConfig?.key||0},isDialogOpen:t,isFormDialogOpen:r,isDialogContainerOpen:t||r,isDropdownOpen:e.isOpen&&e.uiType==="dropdown",dialogSize:r?rr(e.formDialogConfig?.size,"md"):"sm"}},Ko=Object.freeze(Object.defineProperty({__proto__:null,closeAll:Po,createInitialState:Lo,selectConfig:Bo,selectDropdownConfig:Do,selectFormDialogConfig:zo,selectIsOpen:Wo,selectUiType:Fo,selectViewData:Mo,setAlertConfig:No,setConfirmConfig:Ro,setDropdownConfig:Vo,setFormDialogConfig:jo},Symbol.toStringTag,{value:"Module"})),Uo=(e,t)=>{let{dispatchEvent:r,store:i}=e;t._event,console.log("handle click start",i.selectPath()),r(new CustomEvent("start-click",{detail:{path:i.selectPath()}}))},Ho=Object.freeze(Object.defineProperty({__proto__:null,handleClickStart:Uo},Symbol.toStringTag,{value:"Module"})),qo=()=>Object.freeze({}),Go=["id","class","style","slot","start"],Jo=(e={})=>Object.entries(e).filter(([t])=>!Go.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Yo=e=>{if(e!=null){if(typeof e=="object")return e;if(typeof e=="string")try{return JSON.parse(decodeURIComponent(e))}catch{try{return JSON.parse(e)}catch{return}}}},Xo=({props:e})=>{let t=Yo(e.start)||e.start;return{containerAttrString:Jo(e),start:t||{label:"",image:{src:"",width:32,height:32,alt:""}}}},Qo=({props:e})=>e.start?.path,Zo=({state:e})=>{},el=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:qo,selectPath:Qo,selectViewData:Xo,setState:Zo},Symbol.toStringTag,{value:"Module"})),pi=(e,t,r)=>{let{store:i,render:s}=r,n,a=-1/0;if(e.forEach(p=>{let l=p.getBoundingClientRect();l.top<=t&&l.top>a&&(a=l.top,n=p.id)}),!n){let p=1/0;e.forEach(l=>{let o=l.getBoundingClientRect();o.top>t&&o.top<p&&(p=o.top,n=l.id)})}n&&n!==i.selectCurrentId()&&(i.setCurrentId({id:n}),s())},tl=(e,t,r,i)=>{let{store:s,render:n}=i,a=e.querySelectorAll("h1[id], h2[id], h3[id], h4[id], rtgl-text[id]"),p=Array.from(a),l=p.map(c=>{let d=1,u=c.tagName.toLowerCase();return u==="h1"?d=1:u==="h2"?d=2:u==="h3"?d=3:u==="h4"?d=4:u==="rtgl-text"&&(d=parseInt(c.getAttribute("data-level")||"1",10)),{id:c.id,href:`#${c.id}`,title:c.textContent,level:d}});s.setItems({items:l}),pi(p,r,i),n();let o=pi.bind(void 0,p,r,i);return t.addEventListener("scroll",o,{passive:!0}),()=>{t.removeEventListener("scroll",o)}},rl=e=>{let{props:t}=e,r=()=>{};return requestAnimationFrame(()=>{let i=document.getElementById(t.targetId);if(!i)return;let s=window;t.scrollContainerId&&(s=document.getElementById(t.scrollContainerId)||window);let n=parseInt(t.offsetTop||"100",10);r=tl(i,s,n,e)}),()=>{r()}},il=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:rl},Symbol.toStringTag,{value:"Module"})),sl=()=>Object.freeze({items:[],currentId:null,contentContainer:null}),nl=({state:e})=>{let t=((r,i)=>{let s=new Set,n=r.findIndex(p=>p.id===i);if(n===-1)return s;let a=r[n].level;for(let p=n-1;p>=0;p--)if(r[p].level<a){let l=r[p].level;s.add(r[p].id);for(let o=p-1;o>=0;o--)r[o].level<l&&(s.add(r[o].id),l=r[o].level);break}return s})(e.items,e.currentId);return{items:e.items.map(r=>{let i={1:"0",2:"12px",3:"24px",4:"32px"},s=r.id===e.currentId,n=t.has(r.id),a=s||n;return{...r,c:a?"fg":"mu-fg",ml:i[r.level]||"",bc:a?"fg":"mu-fg"}}),currentId:e.currentId}},al=({state:e})=>e,ol=({state:e})=>e.currentId,ll=({state:e},t={})=>{e.items=Array.isArray(t.items)?t.items:[]},pl=({state:e},t={})=>{e.currentId=t.id},dl=({state:e},t={})=>{e.contentContainer=t.container},cl=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:sl,selectCurrentId:ol,selectState:al,selectViewData:nl,setContentContainer:dl,setCurrentId:pl,setItems:ll},Symbol.toStringTag,{value:"Module"})),Ze=e=>e==null||e===!0?"":String(e),qi=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=e,n=Ze(t);r.setValue({value:n}),r.closePopover({}),s(new CustomEvent("value-change",{detail:{value:n},bubbles:!0})),i()},hl=e=>{let{store:t,props:r}=e;if(r.value!==void 0){let i=Ze(r.value);t.setValue({value:i}),t.setTempValue({value:i})}},ul=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n}=e;if(r?.value!==i?.value){let a=Ze(i?.value);s.setValue({value:a}),s.getState().isOpen||s.setTempValue({value:a})}n()},fl=(e,t)=>{let{store:r,render:i,refs:s,props:n}=e;if(n.disabled)return;let a=t._event,p=Ze(n.value);r.setValue({value:p}),r.setTempValue({value:p}),r.openPopover({position:{x:a.currentTarget.getBoundingClientRect().left,y:a.currentTarget.getBoundingClientRect().bottom}}),i(),setTimeout(()=>{let{input:l}=s;if(!l)return;l.value=p,l.focus();let o=l.shadowRoot?.querySelector("input, textarea");o&&typeof o.focus=="function"&&o.focus()},50)},ml=(e,t)=>{let{store:r,render:i}=e;r.closePopover({}),i()},yl=(e,t)=>{let{store:r}=e,i=t._event,s=Ze(i.detail.value);r.setTempValue({value:s})},gl=e=>{let{store:t,refs:r}=e,{input:i}=r,s=i?i.value:t.getState().tempValue;qi(e,s)},bl=(e,t)=>{let{store:r,refs:i}=e,s=t._event;if(s.key==="Enter"){s.preventDefault(),s.stopPropagation();let{input:n}=i,a=n?n.value:r.getState().tempValue;qi(e,a)}else s.key==="Escape"&&(s.preventDefault(),s.stopPropagation(),r.closePopover({}),e.render())},vl=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:hl,handleInputChange:yl,handleInputKeydown:bl,handleOnUpdate:ul,handlePopoverClose:ml,handleSubmitClick:gl,handleTextClick:fl},Symbol.toStringTag,{value:"Module"})),wl=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),_l=({props:e,state:t})=>{let r=typeof t.value=="string"&&t.value.length>0,i=r?t.value:"-",s=typeof e.placeholder=="string"?e.placeholder:"",n=typeof e.label=="string"?e.label:"",a=!!e.disabled;return{isOpen:t.isOpen,position:t.position,value:i,valueColor:r?"fg":"mu-fg",tempValue:t.tempValue,placeholder:s,label:n,disabled:a}},xl=({state:e},t={})=>{e.tempValue=t.value},Sl=({state:e},t={})=>{let{position:r}=t;e.position=r,e.isOpen=!0,e.hasUnsavedChanges=!1},Al=({state:e})=>{e.isOpen=!1,e.tempValue=""},El=({state:e},t={})=>{e.value=t.value},kl=({state:e})=>e.value,$l=Object.freeze(Object.defineProperty({__proto__:null,closePopover:Al,createInitialState:wl,openPopover:Sl,selectValue:kl,selectViewData:_l,setTempValue:xl,setValue:El},Symbol.toStringTag,{value:"Module"})),He=(e,t)=>{if(e===t)return!0;if(e==null||t==null||typeof e!="object"||typeof t!="object")return!1;let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let s of r)if(!i.includes(s)||!He(e[s],t[s]))return!1;return!0},Cl=e=>{let{store:t,props:r,render:i}=e;if(r.selectedValue!==null&&r.selectedValue!==void 0&&r.options){let s=r.options.find(n=>He(n.value,r.selectedValue));s&&(t.updateSelectedValue({value:s?.value}),i())}},Il=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n}=e,a=!1;i?.disabled&&!r?.disabled&&(s.closeOptionsPopover({}),a=!0),r.selectedValue!==i.selectedValue&&(s.updateSelectedValue({value:i.selectedValue}),a=!0),a&&n()},Tl=(e,t)=>{let{store:r,render:i,refs:s,props:n}=e;if(n.disabled)return;t._event.stopPropagation();let a=s.selectButton,p=a.firstElementChild,l=p?p.getBoundingClientRect():a.getBoundingClientRect(),o=r.selectSelectedValue(),c=o!==null?o:n.selectedValue,d=null;c!=null&&n.options&&(d=n.options.findIndex(u=>He(u.value,c)),d===-1&&(d=null)),r.openOptionsPopover({position:{y:l.bottom+12,x:l.left-24},selectedIndex:d}),i()},Ol=e=>{let{store:t,render:r}=e;t.closeOptionsPopover({}),r()},Ll=(e,t)=>{let{render:r,dispatchEvent:i,props:s,store:n}=e;if(s.disabled)return;let a=t._event;a.stopPropagation();let p=a.currentTarget.id.slice(6),l=Number(p),o=s.options[p];n.updateSelectedValue({value:o?.value}),s.onChange&&typeof s.onChange=="function"&&s.onChange(o.value),i(new CustomEvent("value-change",{detail:{value:o.value,label:o.label,index:l,item:o},bubbles:!0})),r()},Nl=(e,t)=>{let{store:r,render:i}=e,s=t._event,n=parseInt(s.currentTarget.id.slice(6),10);r.setHoveredOption({optionId:n}),i()},Rl=(e,t)=>{let{store:r,render:i}=e;r.clearHoveredOption({}),i()},Vl=(e,t)=>{let{store:r,render:i,dispatchEvent:s,props:n}=e;n.disabled||(t._event.stopPropagation(),r.clearSelectedValue({}),n.onChange&&typeof n.onChange=="function"&&n.onChange(void 0),s(new CustomEvent("value-change",{detail:{value:void 0,label:void 0,index:null,item:void 0},bubbles:!0})),i())},jl=(e,t)=>{if(e.props.disabled)return;let{store:r,render:i,dispatchEvent:s}=e,{_event:n}=t;n.stopPropagation(),r.closeOptionsPopover({}),s(new CustomEvent("add-option-click",{bubbles:!0})),i()},Pl=(e,t)=>{let{store:r,render:i}=e;r.setHoveredAddOption({isHovered:!0}),i()},Bl=(e,t)=>{let{store:r,render:i}=e;r.setHoveredAddOption({isHovered:!1}),i()},Dl=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:jl,handleAddOptionMouseEnter:Pl,handleAddOptionMouseLeave:Bl,handleBeforeMount:Cl,handleButtonClick:Tl,handleClearClick:Vl,handleClickOptionsPopoverOverlay:Ol,handleOnUpdate:Il,handleOptionClick:Ll,handleOptionMouseEnter:Nl,handleOptionMouseLeave:Rl},Symbol.toStringTag,{value:"Module"})),zl=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],Fl=(e={})=>Object.entries(e).filter(([t])=>!zl.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Wl=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,hoveredOptionId:null,hoveredAddOption:!1}),Ml=({state:e,props:t})=>{let r=Fl(t),i=!!t.disabled,s=Object.prototype.hasOwnProperty.call(t||{},"selectedValue")?t.selectedValue:e.selectedValue,n=t.placeholder||"Select an option",a=!0,p=t.options||[],l=p.find(c=>He(c.value,s));l&&(n=l.label,a=!1);let o=p.map((c,d)=>{let u=He(c.value,s),f=e.hoveredOptionId===d;return{...c,isSelected:u,bgc:f?"ac":u?"mu":""}});return{containerAttrString:r,isDisabled:i,isOpen:e.isOpen,position:e.position,options:o,selectedValue:s,selectedLabel:n,selectedLabelColor:a?"mu-fg":"fg",hasValue:s!=null,showClear:!i&&!t.noClear&&s!=null,showAddOption:!i&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"ac":""}},Kl=({state:e})=>e,Ul=({state:e})=>e.selectedValue,Hl=({state:e},t={})=>{let{position:r,selectedIndex:i}=t;e.position=r,e.isOpen=!0,i!=null&&(e.hoveredOptionId=i)},ql=({state:e})=>{e.isOpen=!1},Gl=({state:e},t={})=>{e.selectedValue=t.value,e.isOpen=!1},Jl=({state:e})=>{e.selectedValue=void 0},Yl=({state:e},t={})=>{e.hoveredOptionId=t.optionId},Xl=({state:e})=>{e.hoveredOptionId=null},Ql=({state:e})=>{e.selectedValue=void 0},Zl=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},ep=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:Xl,clearSelectedValue:Ql,closeOptionsPopover:ql,createInitialState:Wl,openOptionsPopover:Hl,resetSelection:Jl,selectSelectedValue:Ul,selectState:Kl,selectViewData:Ml,setHoveredAddOption:Zl,setHoveredOption:Yl,updateSelectedValue:Gl},Symbol.toStringTag,{value:"Module"})),tp=(e,t)=>{let{store:r,dispatchEvent:i}=e,s=t._event,n,a=r.selectHeader();s.currentTarget.id==="headerLabel"?n=a.labelPath:s.currentTarget.id==="headerImage"?n=a.image.path:s.currentTarget.id==="header"&&(n=a.path),i(new CustomEvent("header-click",{detail:{path:n},bubbles:!0,composed:!0}))},rp=(e,t)=>{let{store:r,dispatchEvent:i}=e,s=t._event,n=s.currentTarget.dataset.itemId||s.currentTarget.id.slice(4),a=r.selectItem(n);i(new CustomEvent("item-click",{detail:{item:a},bubbles:!0,composed:!0}))},ip=Object.freeze(Object.defineProperty({__proto__:null,handleHeaderClick:tp,handleItemClick:rp},Symbol.toStringTag,{value:"Module"})),sp=()=>Object.freeze({}),np=["id","class","style","slot","header","items","selectedItemId","mode","hideHeader","w","bwr"],ap=(e={})=>Object.entries(e).filter(([t])=>!np.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),qe=e=>{if(e!=null){if(typeof e=="object")return e;if(typeof e=="string")try{return JSON.parse(decodeURIComponent(e))}catch{try{return JSON.parse(e)}catch{return}}}},op=e=>{if(e===!0)return!0;if(e===!1||e===void 0||e===null)return!1;if(typeof e=="string"){let t=e.trim().toLowerCase();return t===""||t==="true"}return!1},lp=(e,t)=>e!=null&&e!==""?e:t==="full"?272:64;function gr(e,t=null){let r=[];for(let i of e){let s=i.id||i.href||i.path,n=t===s;if(r.push({id:s,title:i.title,href:i.href,type:i.type||"item",icon:i.icon,hrefAttr:i.href?`href=${i.href}`:"",isSelected:n,itemBgc:n?"ac":"bg",itemHoverBgc:n?"ac":"mu"}),i.items&&Array.isArray(i.items))for(let a of i.items){let p=a.id||a.href||a.path,l=t===p;r.push({id:p,title:a.title,href:a.href,type:a.type||"item",icon:a.icon,hrefAttr:a.href?`href=${a.href}`:"",isSelected:l,itemBgc:l?"ac":"bg",itemHoverBgc:l?"ac":"mu"})}}return r}var pp=({props:e})=>{let t=qe(e.header)||e.header,r=qe(e.items)||e.items,i=e.selectedItemId,s=ap(e),n=e.mode||"full",a=t||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},p=r?gr(r,i):[],l=!op(e.hideHeader),o=e.bwr||"xs",c=lp(e.w,n),d=n==="full"?"fs":"c",u=n==="full"?"fs":"c",f=n==="full"?"lg":"sm",h=n==="full"?"md":"sm",m=n==="shrunk-lg"?48:40,y=n==="shrunk-lg"?28:20,b=n==="shrunk-lg"?"md":"sm",g=n==="full",_=n==="full",S=n==="full"?"fs":"c",A=n==="full"?"":`ah=${u}`,E=n==="full"?"f":m;return{containerAttrString:s,mode:n,header:a,items:p,sidebarWidth:c,headerAlign:d,itemAlign:u,headerPadding:f,itemPadding:h,itemHeight:m,iconSize:y,firstLetterSize:b,showLabels:g,showGroupLabels:_,itemContentAlign:S,itemAlignAttr:A,itemWidth:E,headerWidth:E,selectedItemId:i,ah:n==="shrunk-lg"||n==="shrunk-md"?"c":"",listAttrString:n==="full"?"sv":"sv hsb",showHeader:l,rightBorderWidth:o}},dp=({props:e})=>qe(e.header)||e.header,cp=({state:e,props:t})=>{let r=qe(t.items)||t.items;return(r?gr(r):[]).find(i=>i.active)},hp=({props:e},t)=>{let r=qe(e.items)||e.items;return(r?gr(r):[]).find(i=>i.id===t)},up=({state:e})=>{},fp=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:sp,selectActiveItem:cp,selectHeader:dp,selectItem:hp,selectViewData:pp,setState:up},Symbol.toStringTag,{value:"Module"})),mp=e=>{let{store:t,props:r}=e;t.setValue({value:r.value??0})},yp=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n}=e,a=r?.key!==i?.key,p=r?.value!==i?.value;if(a||p){let l=i?.value??0;s.setValue({value:l}),n()}},gp=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=e,n=t._event,a=Number(n.detail.value),p=(typeof n.composedPath=="function"?n.composedPath():[]).find(l=>l?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;r.setValue({value:a}),p&&typeof p.setAttribute=="function"&&p.setAttribute("value",String(a)),i(),s(new CustomEvent("value-change",{detail:{value:a},bubbles:!0}))},bp=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=e,n=t._event,a=Number(n.detail.value),p=(typeof n.composedPath=="function"?n.composedPath():[]).find(l=>l?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;r.setValue({value:a}),p&&typeof p.setAttribute=="function"&&p.setAttribute("value",String(a)),i(),s(new CustomEvent("value-input",{detail:{value:a},bubbles:!0}))},vp=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:mp,handleOnUpdate:yp,handleValueChange:gp,handleValueInput:bp},Symbol.toStringTag,{value:"Module"})),wp=()=>Object.freeze({value:0}),_p=({state:e,props:t})=>({key:t.key,value:e.value,w:t.w||"",min:t.min||0,max:t.max||100,step:t.step||1,disabled:!!t.disabled}),xp=({state:e},t={})=>{e.value=t.value},Sp=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:wp,selectViewData:_p,setValue:xp},Symbol.toStringTag,{value:"Module"})),Ap=e=>{},Ep=(e,t)=>{let{dispatchEvent:r,props:i}=e,s=t._event,n=parseInt(s.currentTarget.id.slice(3),10),a=i.data?.rows?.[n];a&&r(new CustomEvent("row-click",{detail:{rowIndex:n,rowData:a}}))},kp=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=e,n=t._event.currentTarget.dataset.columnKey,a=r.selectSortInfo(),p="asc";a.column===n&&(a.direction==="asc"?p="desc":a.direction==="desc"&&(p=null)),p?r.setSortColumn({column:n,direction:p}):r.clearSort(),i(),s(new CustomEvent("header-click",{detail:{column:n,direction:p,sortInfo:p?{column:n,direction:p}:null}}))},$p=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Ap,handleHeaderClick:kp,handleRowClick:Ep},Symbol.toStringTag,{value:"Module"})),Cp=()=>Object.freeze({sortColumn:null,sortDirection:null}),Ip=["id","class","style","slot","data"],Tp=(e={})=>Object.entries(e).filter(([t])=>!Ip.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Op=(e,t)=>{let r=t.split("."),i=e;for(let s of r){if(i==null)return null;i=i[s]}return i},Lp=({state:e,props:t})=>{let r=Tp(t),i=t.data||{columns:[],rows:[]},s=i.rows.map((n,a)=>{let p=i.columns.map(l=>{let o=Op(n,l.key);return{key:l.key,value:o!=null?String(o):""}});return{index:a,cells:p}});return{containerAttrString:r,columns:i.columns||[],rows:s||[]}},Np=({state:e})=>e,Rp=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),Vp=({state:e},{column:t,direction:r}={})=>{e.sortColumn=t,e.sortDirection=r},jp=({state:e})=>{e.sortColumn=null,e.sortDirection=null},Pp=Object.freeze(Object.defineProperty({__proto__:null,clearSort:jp,createInitialState:Cp,selectSortInfo:Rp,selectState:Np,selectViewData:Lp,setSortColumn:Vp},Symbol.toStringTag,{value:"Module"})),Bp=(e,t)=>{let{dispatchEvent:r}=e,i=t._event.currentTarget.dataset.id;r(new CustomEvent("item-click",{detail:{id:i}}))},Dp=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:Bp},Symbol.toStringTag,{value:"Module"})),zp=()=>Object.freeze({}),Fp=["id","class","style","slot","items","selectedTab"],Wp=(e={})=>Object.entries(e).filter(([t])=>!Fp.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Mp=({props:e})=>{let t=Wp(e),r=e.items||[],i=e.selectedTab,s=r.map(n=>({...n,isSelected:n.id===i,bgColor:n.id===i?"ac":"",borderColor:n.id===i?"":"tr",textColor:n.id===i?"":"mu-fg"}));return{containerAttrString:t,items:s,selectedTab:i}},Kp=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:zp,selectViewData:Mp},Symbol.toStringTag,{value:"Module"})),Up=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Hp=()=>Object.freeze({}),qp=({props:e})=>({open:!!e.open,x:e.x||0,y:e.y||0,place:e.place||"t",content:e.content||""}),Gp=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Hp,selectViewData:qp},Symbol.toStringTag,{value:"Module"})),Jp=async e=>{let{props:t,store:r,render:i,refs:s}=e,{waveformData:n}=t;r.setWaveformData({data:n}),i();let a=s.canvas;a&&Gi(n,a)},Yp=async(e,t)=>{let{store:r,render:i,refs:s,props:n}=e,{waveformData:a}=n;if(!a){console.log("waveform handleOnUpdate: no waveformData provided");return}r.setWaveformData({data:a}),i();let p=s.canvas;p&&Gi(a,p)};async function Gi(e,t){let r=t.getContext("2d"),i=t.getBoundingClientRect(),s=i.width,n=i.height;t.width=s,t.height=n;let a=t.width,p=t.height;if(r.clearRect(0,0,a,p),r.fillStyle="#1a1a1a",r.fillRect(0,0,a,p),!e||!e.amplitudes)return;let l=e.amplitudes,o=p/2,c=r.createLinearGradient(0,0,0,p);c.addColorStop(0,"#404040"),c.addColorStop(.5,"#A1A1A1"),c.addColorStop(1,"#404040");let d=Math.max(1,a/l.length),u=.2;for(let f=0;f<l.length;f++){let h=l[f]/255*(p*.85),m=f*d,y=o-h/2;r.fillStyle=c,r.fillRect(m,y,Math.max(1,d*(1-u)),h)}r.strokeStyle="rgba(255, 255, 255, 0.1)",r.lineWidth=1,r.beginPath(),r.moveTo(0,o),r.lineTo(a,o),r.stroke(),r.shadowBlur=10,r.shadowColor="#2196F3"}var Xp=Object.freeze(Object.defineProperty({__proto__:null,handleAfterMount:Jp,handleOnUpdate:Yp},Symbol.toStringTag,{value:"Module"})),Qp=()=>Object.freeze({waveformData:null}),Zp=({state:e},t={})=>{e.waveformData=t.data},ed=({state:e,props:t})=>({isLoading:t.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:t.waveformData}),td=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Qp,selectViewData:ed,setWaveformData:Zp},Symbol.toStringTag,{value:"Module"})),Ji=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yi=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase()),ir=e=>{if(e!=null)return e===""?!0:e},di=(e,t)=>{let r=e.getAttribute(t);if(r!==null)return ir(r);let i=Ji(t);if(i!==t){let s=e.getAttribute(i);if(s!==null)return ir(s)}},rd=(e,t)=>{let r=new Set(t);return new Proxy({},{get(i,s){if(typeof s=="string"&&r.has(s)){let n=e[s];return n!==void 0?n:di(e,s)}},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(i,s){return typeof s=="string"&&r.has(s)},ownKeys(){return[...r]},getOwnPropertyDescriptor(i,s){if(typeof s=="string"&&r.has(s))return{configurable:!0,enumerable:!0,get:()=>{let n=e[s];return n!==void 0?n:di(e,s)}}}})},id=({schema:e,methodExports:t=[]})=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("componentName is required.");if(typeof e.componentName!="string"||e.componentName.trim()==="")throw new Error("componentName is required.");if(Object.prototype.hasOwnProperty.call(e,"attrsSchema"))throw new Error("attrsSchema is not supported.");if(Object.prototype.hasOwnProperty.call(e,"methods")){let r=e.methods;if(!r||typeof r!="object"||Array.isArray(r))throw new Error("methods must be an object schema with a properties map.");if(Object.prototype.hasOwnProperty.call(r,"type")&&r.type!=="object")throw new Error("methods.type must be 'object'.");if(!r.properties||typeof r.properties!="object"||Array.isArray(r.properties))throw new Error("methods.properties must be an object keyed by method name.");for(let i of Object.keys(r.properties))if(!t.includes(i))throw new Error(`method '${i}' is declared in schema but missing in .methods.js exports.`)}return!0},w={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9,PARTIAL:10,PATH_REFERENCE:11},B={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},sr={NOT:0},k=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},ie=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}},ci=e=>{if(!e||e.trim()==="")throw new k("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new k(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${r}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let r of t)if(e.trim().endsWith(r))throw new k(`Incomplete comparison expression - missing right operand (got: '${e}')`)},sd=e=>{if(e.trim().endsWith(" in"))throw new k(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new k(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new k(`Missing iterable expression after 'in' (got: '$for ${e}')`);let i=t.includes(",")?t.split(",").map(s=>s.trim()):[t.trim()];for(let s of i){if(!s)throw new k(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(s))throw new k(`Invalid loop syntax (got: '$for ${e}')`)}},nd=(e,t,r=!1)=>{if(t===null)return new ie(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new ie(`Cannot iterate over undefined value at '$for ${e}'`);let i=typeof t;return r?new ie(`Cannot iterate over non-array value in loop '${e}' - got ${i} instead`):new ie(`Cannot iterate over non-array value (got: ${i}) at '$for ${e}'`)},ad=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new ie(`Unknown function '${e}' (${r})`)},Xi=(e,t,r={})=>{let i={},s={};r&&typeof r=="object"&&(r.functions!==void 0||r.partials!==void 0?(i=r.functions||{},s=r.partials||{}):typeof r=="object"&&(i=r));let n=R(e,{functions:i,partials:s},t,{});return n===void 0?{}:n},R=(e,t,r,i)=>{if(t.functions,e.var&&!e.type)return U(e.var,r,i);if(e.type===w.LITERAL)return e.value;if(e.type===w.VARIABLE)return U(e.path,r,i);if(e.type===w.INTERPOLATION)return ld(e.parts,t,r,i);switch(e.type){case w.FUNCTION:return Qi(e,t,r,i);case w.BINARY:return Zi(e,t,r,i);case w.UNARY:return es(e,t,r,i);case w.CONDITIONAL:return dd(e,t,r,i);case w.LOOP:return md(e,t,r,i);case w.OBJECT:return gd(e,t,r,i);case w.ARRAY:return bd(e,t,r,i);case w.PARTIAL:return vd(e,t,r,i);case w.PATH_REFERENCE:return wd(e,t,r,i);default:throw new Error(`Unknown node type: ${e.type}`)}},hi=new Map,od=e=>{let t=[],r="",i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(n==="[")r&&(t.push({type:"property",value:r}),r=""),i=!0;else if(n==="]"){if(i&&r){let a=r.trim();if(/^\d+$/.test(a))t.push({type:"index",value:parseInt(a,10)});else if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")){let p=a.slice(1,-1);t.push({type:"property",value:p})}else t.push({type:"property",value:a});r=""}i=!1}else r+=n}return r&&t.push({type:"property",value:r}),t},U=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let i=hi.get(e);if(!i){let n=[],a="",p=0;for(let l=0;l<e.length;l++){let o=e[l];o==="["?(p++,a+=o):o==="]"?(p--,a+=o):o==="."&&p===0?a&&(n.push(a),a=""):a+=o}a&&n.push(a),i=[];for(let l of n){let o=od(l.trim());i.push(...o)}hi.set(e,i)}let s=t;for(let n=0;n<i.length;n++){let a=i[n];if(a.type==="property"&&a.value in r){s=r[a.value];continue}if(s==null)return;(a.type==="property"||a.type==="index")&&(s=s[a.value])}return s},ld=(e,t,r,i)=>{let s=[];for(let n of e)if(typeof n=="string")s.push(n);else{let a=R(n,t,r,i);s.push(a!=null?String(a):"")}return s.join("")},Qi=(e,t,r,i)=>{let s=t.functions||t,n=s[e.name];if(!n)throw ad(e.name,s);let a=e.args.map(p=>R(p,t,r,i));return n(...a)},Ne=(e,t,r,i)=>{if(e.var&&!e.type)return U(e.var,r,i);switch(e.type){case w.VARIABLE:return U(e.path,r,i);case w.LITERAL:return e.value;case w.BINARY:return Zi(e,t,r,i);case w.UNARY:return es(e,t,r,i);case w.FUNCTION:return Qi(e,t,r,i);default:return R(e,t,r,i)}},Zi=(e,t,r,i)=>{if(e.op===B.AND||e.op===B.OR){let a=Ne(e.left,t,r,i),p=Ne(e.right,t,r,i);switch(e.op){case B.AND:return a&&p;case B.OR:return a||p}}let s=R(e.left,t,r,i),n=R(e.right,t,r,i);switch(e.op){case B.EQ:return s==n;case B.NEQ:return s!=n;case B.GT:return s>n;case B.LT:return s<n;case B.GTE:return s>=n;case B.LTE:return s<=n;case B.IN:return Array.isArray(n)?n.includes(s):!1;case B.ADD:if(typeof s!="number"||typeof n!="number")throw new ie(`Arithmetic operations require numbers. Got ${typeof s} + ${typeof n}`);return s+n;case B.SUBTRACT:if(typeof s!="number"||typeof n!="number")throw new ie(`Arithmetic operations require numbers. Got ${typeof s} - ${typeof n}`);return s-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},es=(e,t,r,i)=>{let s=e.op===sr.NOT?Ne(e.operand,t,r,i):R(e.operand,t,r,i);switch(e.op){case sr.NOT:return!s;default:throw new Error(`Unknown unary operator: ${e.op}`)}},pd=(e,t,r,i)=>{if(e.conditions.length===2&&e.conditions[1]===null){let s=e.conditions[0];if(s.type===w.VARIABLE)if(U(s.path,r,i)){let n=e.bodies[0];if(n.type===w.OBJECT&&n.properties.length<=5){let a={};for(let p of n.properties){let l=p.parsedKey?R(p.parsedKey,t,r,i):p.key,o=p.value;if(o.type===w.LITERAL)a[l]=o.value;else if(o.type===w.VARIABLE)a[l]=U(o.path,r,i);else if(o.type===w.INTERPOLATION){let c=[];for(let d of o.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let u=U(d.path,r,i);c.push(u!=null?String(u):"")}else{let u=R(d,t,r,i);c.push(u!=null?String(u):"")}a[l]=c.join("")}else a[l]=R(o,t,r,i)}return a}}else{let n=e.bodies[1];if(n.type===w.OBJECT&&n.properties.length<=5){let a={};for(let p of n.properties){let l=p.parsedKey?R(p.parsedKey,t,r,i):p.key,o=p.value;if(o.type===w.LITERAL)a[l]=o.value;else if(o.type===w.VARIABLE)a[l]=U(o.path,r,i);else if(o.type===w.INTERPOLATION){let c=[];for(let d of o.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let u=U(d.path,r,i);c.push(u!=null?String(u):"")}else{let u=R(d,t,r,i);c.push(u!=null?String(u):"")}a[l]=c.join("")}else a[l]=R(o,t,r,i)}return a}}}return null},dd=(e,t,r,i)=>{let s=pd(e,t,r,i);if(s!==null)return s;for(let n=0;n<e.conditions.length;n++){let a=e.conditions[n];if(a===null||Ne(a,t,r,i))return R(e.bodies[n],t,r,i)}return ts},cd=(e,t)=>{let r=e.body,i=e.itemVar;if(r.type===w.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===w.VARIABLE){let s=r.conditions[0].path,n=r.bodies[0];if(s.startsWith(i+".")){let a=s.substring(i.length+1);if(n.type===w.OBJECT&&n.properties.length<=5){for(let l of n.properties)if(l.parsedKey)return null;let p=[];for(let l=0;l<t.length;l++){let o=t[l];if(o[a]){let c={};for(let d of n.properties){let u=d.key,f=d.value;if(f.type===w.LITERAL)c[u]=f.value;else if(f.type===w.VARIABLE){let h=f.path;if(h===i)c[u]=o;else if(h.startsWith(i+".")){let m=h.substring(i.length+1);c[u]=o[m]}else return null}else if(f.type===w.INTERPOLATION){let h=[],m=!0;for(let y of f.parts)if(typeof y=="string")h.push(y);else if(y.type===w.VARIABLE){let b=y.path;if(b===i)h.push(o!=null?String(o):"");else if(b.startsWith(i+".")){let g=b.substring(i.length+1),_=o[g];h.push(_!=null?String(_):"")}else{m=!1;break}}else{m=!1;break}if(!m)return null;c[u]=h.join("")}else return null}p.push(c)}}return p}}}return null},hd=(e,t)=>{let r=e.body,i=e.itemVar,s=cd(e,t);if(s!==null)return s;if(r.type===w.OBJECT&&r.properties.length<=5&&!r.whenCondition){for(let p of r.properties)if(p.parsedKey)return null;let n=[],a=!0;for(let p of r.properties){let l=p.key,o=p.value;if(o.type===w.LITERAL)n.push({key:l,type:"literal",value:o.value});else if(o.type===w.VARIABLE){let c=o.path;if(c===i)n.push({key:l,type:"item"});else if(c.startsWith(i+".")){let d=c.substring(i.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:l,type:"prop",prop:d});else{a=!1;break}}else{a=!1;break}}else if(o.type===w.INTERPOLATION&&o.parts.length===1){let c=o.parts[0];if(c.type===w.VARIABLE){let d=c.path;if(d===i)n.push({key:l,type:"item_string"});else if(d.startsWith(i+".")){let u=d.substring(i.length+1);if(!u.includes(".")&&!u.includes("["))n.push({key:l,type:"prop_string",prop:u});else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}if(a){let p=new Array(t.length);if(n.length===3&&n[0].type==="prop"&&n[0].key==="id"&&n[1].type==="prop_string"&&n[1].key==="title"&&n[2].type==="prop"&&n[2].key==="completed")for(let l=0;l<t.length;l++){let o=t[l];p[l]={id:o.id,title:o.title!=null?String(o.title):"",completed:o.completed}}else for(let l=0;l<t.length;l++){let o=t[l],c={};for(let d of n)if(d.type==="literal")c[d.key]=d.value;else if(d.type==="item")c[d.key]=o;else if(d.type==="prop")c[d.key]=o[d.prop];else if(d.type==="item_string")c[d.key]=o!=null?String(o):"";else if(d.type==="prop_string"){let u=o[d.prop];c[d.key]=u!=null?String(u):""}p[l]=c}return p}}return null},ud=(e,t,r,i,s)=>{let n=[],a=e.body;if(a.type===w.OBJECT&&a.fast!==!1){let p=e.itemVar,l=e.indexVar;for(let o=0;o<s.length;o++){let c=s[o],d={},u={...i,[p]:c,...l&&{[l]:o}};u.__paths__||(u.__paths__=i.__paths__||{});let f=e.iterable.path||"";if(i&&i.__paths__&&f){let h=f.split("."),m=h[0];m in i.__paths__&&(f=i.__paths__[m],h.length>1&&(f+="."+h.slice(1).join(".")))}u.__paths__={...u.__paths__,[p]:`${f}[${o}]`,...l&&{[l]:o}};for(let h of a.properties){let m=h.parsedKey?R(h.parsedKey,t,r,u):h.key,y=h.value;if(y.type===w.LITERAL)d[m]=y.value;else if(y.type===w.VARIABLE){let b=y.path;if(b===p)d[m]=c;else if(b===l)d[m]=o;else if(b.startsWith(p+".")){let g=b.substring(p.length+1);!g.includes(".")&&!g.includes("[")?d[m]=c[g]:d[m]=U(b,r,{...i,[p]:c,...l&&{[l]:o}})}else d[m]=U(b,r,{...i,[p]:c,...l&&{[l]:o}})}else if(y.type===w.INTERPOLATION){let b=[];for(let g of y.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=g.path,S;if(_===p)S=c;else if(_===l)S=o;else if(_.startsWith(p+".")){let A=_.substring(p.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=U(_,r,{...i,[p]:c,...l&&{[l]:o}})}else S=U(_,r,{...i,[p]:c,...l&&{[l]:o}});b.push(S!=null?String(S):"")}else{let _={...i,[p]:c,...l&&{[l]:o}},S=R(g,t,r,_);b.push(S!=null?String(S):"")}d[m]=b.join("")}else{let b={...i,[p]:c,...l&&{[l]:o}};d[m]=R(y,t,r,b)}}n.push(d)}return n}return null},fd=(e,t,r)=>{let i=e.body;if(i.type===w.OBJECT&&i.properties.length===1&&i.properties[0].key==="$if item.visible"){let s=i.properties[0].value;if(s.type===w.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===w.VARIABLE&&s.conditions[0].path==="item.visible"){let n=s.bodies[0];if(n.type===w.OBJECT&&n.properties.length===2){let a=n.properties[0],p=n.properties[1];if(a.key==="id"&&a.value.type===w.VARIABLE&&a.value.path==="item.id"&&p.key==="$if item.highlighted"&&p.value.type===w.CONDITIONAL){let l=[];for(let o=0;o<t.length;o++){let c=t[o];if(c.visible){let d={id:c.id};c.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${c.name}`):(d.highlight=!1,d.message=c.name),l.push(d)}}return l}}}}return null},md=(e,t,r,i)=>{let s=R(e.iterable,t,r,i);if(!Array.isArray(s)){let o,c=!1;if(e.iterable.type===w.FUNCTION){c=!0;let u=e.iterable.args.map(f=>f.type===w.LITERAL?typeof f.value=="string"?`'${f.value}'`:String(f.value):f.type===w.VARIABLE?f.path:f.type===w.FUNCTION?`${f.name}(...)`:"?").join(", ");o=`${e.iterable.name}(${u})`}else o=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${o}`;throw nd(d,s,c)}if(!e.indexVar){let o=fd(e,s,e.itemVar);if(o!==null)return o}if(!e.indexVar){let o=hd(e,s);if(o!==null)return o}let n=ud(e,t,r,i,s);if(n!==null)return n;let a=[],p=e.iterable.path||"";if(i&&i.__paths__&&p){let o=p.split("."),c=o[0];c in i.__paths__&&(p=i.__paths__[c],o.length>1&&(p+="."+o.slice(1).join(".")))}let l=!1;e.body.type===w.ARRAY&&(e.body.items.length<=1?l=!1:l=e.body._shouldPreserveArray??=e.body.items.some(o=>o.type===w.OBJECT&&o.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let o=0;o<s.length;o++){let c=e.indexVar?{...i,[e.itemVar]:s[o],[e.indexVar]:o}:{...i,[e.itemVar]:s[o]};c.__paths__||(c.__paths__=i.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${p}[${o}]`},e.indexVar&&(c.__paths__[e.indexVar]=o);let d=R(e.body,t,r,c);if(Array.isArray(d)&&d.length===1&&!l){let u=d[0];a.push(u===void 0?{}:u)}else a.push(d===void 0?{}:d)}return a},yd=(e,t,r,i)=>{if(e.whenCondition)return null;if(e.properties.length===1){let s=e.properties[0],n=s.parsedKey?R(s.parsedKey,t,r,i):s.key,a=s.value;if(a.type===w.OBJECT&&a.properties.length<=10&&!a.whenCondition){let p={},l={},o=!0;for(let c of a.properties){let d=c.parsedKey?R(c.parsedKey,t,r,i):c.key,u=c.value;if(u.type===w.LITERAL)l[d]=u.value;else if(u.type===w.VARIABLE)l[d]=U(u.path,r,i);else if(u.type===w.INTERPOLATION){let f=[];for(let h of u.parts)if(typeof h=="string")f.push(h);else if(h.type===w.VARIABLE){let m=U(h.path,r,i);f.push(m!=null?String(m):"")}else{o=!1;break}if(!o)break;l[d]=f.join("")}else if(u.type===w.OBJECT&&u.properties.length<=5){let f={};for(let h of u.properties){let m=h.key,y=h.value;if(y.type===w.LITERAL)f[m]=y.value;else if(y.type===w.VARIABLE)f[m]=U(y.path,r,i);else if(y.type===w.INTERPOLATION){let b=[];for(let g of y.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=U(g.path,r,i);b.push(_!=null?String(_):"")}else{o=!1;break}if(!o)break;f[m]=b.join("")}else{o=!1;break}}if(!o)break;l[d]=f}else{o=!1;break}}if(o)return p[n]=l,p}}return null},gd=(e,t,r,i)=>{let s=t.functions||t;if(e.whenCondition&&!Ne(e.whenCondition,s,r,i))return;let n=yd(e,t,r,i);if(n!==null)return n;if(e.fast){let l={};for(let o of e.properties){let c=o.parsedKey?R(o.parsedKey,t,r,i):o.key,d=o.value;if(d.type===w.LITERAL)l[c]=d.value;else if(d.type===w.VARIABLE)l[c]=U(d.path,r,i);else if(d.type===w.INTERPOLATION){let u=[];for(let f of d.parts)if(typeof f=="string")u.push(f);else if(f.type===w.VARIABLE){let h=U(f.path,r,i);u.push(h!=null?String(h):"")}else{let h=R(f,t,r,i);u.push(h!=null?String(h):"")}l[c]=u.join("")}else l[c]=R(d,t,r,i)}return l}let a={},p=!1;for(let l of e.properties)if(!l.key.startsWith("$if ")&&!l.key.match(/^\$if\s+\w+.*:?$/)&&!l.key.startsWith("$elif")&&!l.key.startsWith("$else")&&!l.key.startsWith("$for ")){p=!0;break}for(let l of e.properties)if(l.key.startsWith("$if ")||l.key.match(/^\$if\s+\w+.*:?$/)){let o=R(l.value,t,r,i);if(!p&&o!==null&&o!==void 0)return Array.isArray(o)&&o.length===1?o[0]:o;typeof o=="object"&&o!==null&&!Array.isArray(o)&&Object.assign(a,o)}else if(l.key.startsWith("$for ")){if(e.properties.length===1)return R(l.value,t,r,i)}else{let o=l.value;if(o&&o.type===w.OBJECT&&o.properties){let c=o.properties.find(d=>d.key.startsWith("$for "));if(c){let d=R(c.value,t,r,i);d!==void 0&&(a[l.key]=d)}else{let d=R(l.value,t,r,i);d!==void 0&&(a[l.key]=d)}}else{let c=l.parsedKey?R(l.parsedKey,t,r,i):l.key,d=R(l.value,t,r,i);d!==void 0&&(a[c]=d)}}return a},ts={},bd=(e,t,r,i)=>{let s=[];for(let n of e.items)if(n.type===w.LOOP){let a=R(n,t,r,i);Array.isArray(a)&&n.flatten!==!1?s.push(...a):s.push(a)}else{let a=R(n,t,r,i);a!==ts&&a!==void 0&&s.push(a)}return s},vd=(e,t,r,i)=>{let{name:s,data:n,whenCondition:a}=e,p=t.partials||{},l=t.functions||t;if(a&&!Ne(a,l,r,i))return;if(!p[s])throw new ie(`Partial '${s}' is not defined`);let o=i._partialStack||[];if(o.includes(s))throw new ie(`Circular partial reference detected: ${s}`);let c=p[s],d=r,u={...i,_partialStack:[...o,s]};if(i){d={...r};for(let f of Object.keys(i))f.startsWith("_")||(d[f]=i[f])}if(n){let f=R(n,t,r,i);d={...d,...f}}return R(c,t,d,u)},wd=(e,t,r,i)=>{let{path:s}=e,n=s.split("."),a=n[0],p=n.slice(1);if(!i||!(a in i))throw new ie(`Path reference '#{${s}}' refers to '${a}' which is not a loop variable in the current scope`);if(i.__paths__||(i.__paths__={}),!(a in i.__paths__))throw new ie(`Path reference '#{${s}}' cannot be resolved - path tracking may not be initialized properly`);let l=i.__paths__[a];if(typeof l=="number"){if(p.length>0)throw new ie(`Path reference '#{${s}}' - cannot access properties on index variable '${a}'`);return String(l)}return p.length>0&&(l+="."+p.join(".")),l},_d=/\$\{([^}]*)\}/g,xd=/#\{([^}]*)\}/g,rs=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,i,s]=r,n=Sd(s,t);return{isFunction:!0,type:w.FUNCTION,name:i,args:n}},Sd=(e,t={})=>e.trim()?Ad(e).map(r=>Ed(r.trim(),t)):[],Ad=e=>{let t=[],r="",i=0,s=!1,n="";for(let a=0;a<e.length;a++){let p=e[a],l=a>0?e[a-1]:"";!s&&(p==='"'||p==="'")?(s=!0,n=p,r+=p):s&&p===n&&l!=="\\"?(s=!1,n="",r+=p):!s&&p==="("?(i++,r+=p):!s&&p===")"?(i--,r+=p):!s&&p===","&&i===0?(t.push(r),r=""):r+=p}return r&&t.push(r),t},Ed=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:w.LITERAL,value:parseFloat(e)};if(e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};let r=rs(e,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};let i=e.trim(),s=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:a,type:p}of s){let l=0;for(;l<i.length;){let o=Oe(i.substring(l),a);if(o===-1)break;let c=l+o;c>n&&(n=c),l=c+a.length}}if(n!==-1)try{return Z(i,t)}catch{return{type:w.VARIABLE,path:i}}return{type:w.VARIABLE,path:i}},is=/^\w+\(.*\)$/,kd=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,$d=e=>{if(!(!e||e.trim()===""||is.test(e))&&kd.test(e))throw e.includes("?")&&e.includes(":")?new k(`Complex expressions not supported in variable replacements - consider calculating the value in your data instead. Offending expression: "${e}"`):e.includes("||")||e.includes("&&")||e.includes("??")?new k(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new k(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},ui=e=>{let t=e.trim();if(is.test(t))throw new k(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new k(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new k(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new k(`Logical operators not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("?")&&t.includes(":"))throw new k(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:w.PATH_REFERENCE,path:t}},dt=(e,t={})=>{let r=e.trim();$d(r);let i=rs(r,t);if(i.isFunction)return{type:i.type,name:i.name,args:i.args};if(r.includes("[")&&!/[\s+\-*/%|&?:]/.test(r)){let s=0;for(let n of r)n==="["?s++:n==="]"&&s--;if(s!==0)throw new Error("Invalid array index syntax")}return{type:w.VARIABLE,path:r}},ss=(e,t={})=>{let r=e,i=[];(e.includes("\\${")||e.includes("\\#{"))&&(r=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),r=r.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),r=r.replace(/\\(\$\{[^}]*\})/g,(o,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\(#\{[^}]*\})/g,(o,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\DOUBLE_ESC_VAR/g,"\\"),r=r.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let s=[...r.matchAll(_d)],n=[...r.matchAll(xd)],a=[...s.map(o=>({match:o,type:"variable"})),...n.map(o=>({match:o,type:"pathref"}))].sort((o,c)=>o.match.index-c.match.index);if(a.length===0){let o=r;for(let c=0;c<i.length;c++)o=o.replace(`__ESCAPED_${c}__`,i[c]);return{type:w.LITERAL,value:o}}if(a.length===1&&a[0].match[0]===r&&i.length===0){let{match:o,type:c}=a[0];try{return c==="variable"?dt(o[1],t):ui(o[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:w.LITERAL,value:r};throw d}}let p=[],l=0;for(let{match:o,type:c}of a){let[d,u]=o,f=o.index;if(f>l){let h=r.substring(l,f);for(let m=0;m<i.length;m++)h=h.replace(`__ESCAPED_${m}__`,i[m]);h&&p.push(h)}try{let h;c==="variable"?h=dt(u.trim(),t):h=ui(u.trim()),p.push(h)}catch(h){if(h.message==="Invalid array index syntax")p.push(d);else throw h}l=f+d.length}if(l<r.length){let o=r.substring(l);for(let c=0;c<i.length;c++)o=o.replace(`__ESCAPED_${c}__`,i[c]);o&&p.push(o)}return{type:w.INTERPOLATION,parts:p}},Ae=(e,t)=>typeof e=="string"?ss(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Id(e,t):Td(e,t):{type:w.LITERAL,value:e},Cd=e=>{let{$each:t,...r}=e;if(typeof t!="string")throw new k("$each value must be a non-empty string");let i=t.trim();if(i==="")throw new k("$each value must be a non-empty string");if(Object.keys(r).length===0)throw new k("Empty $each body not allowed");if(r.$partial!==void 0)throw new k("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${i}`]:r}},Id=(e,t)=>{let r=[],i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let l=Cd(n),o=Object.keys(l);if(o.length===1&&/^\$for(?::\w+)?\s/.test(o[0])){let c=fi(o[0],l[o[0]],t,!0);r.push(c),i=!0;continue}}catch(l){throw l instanceof k?l:new k(l.message)}let p=Object.keys(n);if(p.length===1&&/^\$for(?::\w+)?\s/.test(p[0])){let l=fi(p[0],n[p[0]],t);r.push(l),i=!0;continue}}let a=Ae(n,t);r.push(a),(a.type===w.FUNCTION||a.type===w.CONDITIONAL||a.type===w.LOOP||a.type===w.PARTIAL||a.type===w.OBJECT&&!a.fast||a.type===w.ARRAY&&!a.fast)&&(i=!0)}return{type:w.ARRAY,items:r,fast:!i}},Td=(e,t)=>{let r=[],i=!1,s=null,n=Object.entries(e),a=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new k("$partial value must be a string");if(e.$partial.trim()==="")throw new k("$partial value cannot be an empty string");let l=["$if","$elif","$else","$for"],o=[];for(let[b]of n)for(let g of l)if(b===g||b.startsWith(g+" ")||b.startsWith(g+"#")){o.push(g);break}if(o.length>0)throw new k(`Cannot use $partial with ${o.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...u}=e,f={},h=!1;for(let[b,g]of Object.entries(u)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=g,h=!0}let m=null;if(h&&(m=Ae(f,t),m.type===w.OBJECT)){let b=!1;for(let g of m.properties)if(g.value.type===w.VARIABLE||g.value.type===w.INTERPOLATION||g.value.type===w.FUNCTION||g.value.type===w.CONDITIONAL||g.value.type===w.OBJECT&&!g.value.fast||g.value.type===w.ARRAY&&!g.value.fast){b=!0;break}b&&(m.fast=!1)}let y={type:w.PARTIAL,name:c,data:m};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new k("Empty condition expression after '$when'");b=Z(d,t)}else b={type:w.LITERAL,value:d};y.whenCondition=b}return y}for(let[l,o]of n)if(l==="$when"){if(s!==null)throw new k("Multiple '$when' directives on the same object are not allowed");if(o==null)throw new k("Missing condition expression after '$when'");let c=typeof o=="string"?o:JSON.stringify(o);if(c.trim()==="")throw new k("Empty condition expression after '$when'");s=Z(c,t),i=!0}else if(l.startsWith("$when#")||l.startsWith("$when "))throw new k("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;a<n.length;){let[l,o]=n[a];if(l==="$when"){a++;continue}if(l==="$each")throw new k("$each can only be used inside arrays");if(l.startsWith("$if ")||l.match(/^\$if#\w+\s/)||l.match(/^\$if\s+\w+.*:$/)){let c=Od(n,a,t);r.push({key:l,value:c.node}),i=!0,a=c.nextIndex}else if(/^\$for(?::\w+)?\s/.test(l)){let c=l.match(/^\$for(?::(\w+))?\s/)?.[1]||"",d=c?`:${c}`:"";throw new k(`$for loops must be inside arrays - use '- $for${d} item in items:' instead of '$for${d} item in items:'. For cleaner object generation syntax, consider using $each.`)}else{if(l.startsWith("$elif ")||l.startsWith("$else"))throw new k(`'${l.split(" ")[0]}' without matching '$if'`);if(l==="$if"||l==="$if:")throw new k("Missing condition expression after '$if'");{let c=Ae(o,t);(c.type===w.FUNCTION||c.type===w.CONDITIONAL||c.type===w.PARTIAL||c.type===w.OBJECT&&!c.fast||c.type===w.ARRAY&&!c.fast)&&(i=!0);let d=ss(l,t),u={key:l,value:c};(d.type!==w.LITERAL||d.value!==l)&&(u.parsedKey=d),r.push(u),a++}}}let p={type:w.OBJECT,properties:r,fast:!i};return s&&(p.whenCondition=s),p},Od=(e,t,r={})=>{let i=[],s=[],n=t,[a,p]=e[n],l=null,o;if(a.startsWith("$if#")){let d=a.match(/^\$if#(\w+)\s+(.+)$/);if(d)l=d[1],o=d[2];else throw new k(`Invalid conditional syntax: ${a}`)}else o=a.substring(4),o.endsWith(":")&&(o=o.slice(0,-1).trim());ci(o);let c=Z(o,r);for(i.push(c),s.push(Ae(p,r)),n++;n<e.length;){let[d,u]=e[n],f=!1,h;if(l?d.startsWith(`$elif#${l} `)?(h=d.substring(`$elif#${l} `.length),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(d===`$else#${l}`||d===`$else#${l}:`)&&(f=!0,h=null):d.startsWith("$elif ")?(h=d.substring(6),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,h=null),f){if(h===null)i.push(null);else{ci(h);let m=Z(h,r);i.push(m)}if(s.push(Ae(u,r)),n++,h===null)break}else break}return{node:{type:w.CONDITIONAL,conditions:i,bodies:s,id:l},nextIndex:n}},Z=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let o=e.slice(1,-1),c=0,d=!0;for(let u=0;u<o.length;u++)if(o[u]==="("?c++:o[u]===")"&&c--,c<0){d=!1;break}if(d&&c===0)return Z(o,t)}let r=Oe(e,"||");if(r!==-1)return{type:w.BINARY,op:B.OR,left:Z(e.substring(0,r).trim(),t),right:Z(e.substring(r+2).trim(),t)};let i=Oe(e,"&&");if(i!==-1)return{type:w.BINARY,op:B.AND,left:Z(e.substring(0,i).trim(),t),right:Z(e.substring(i+2).trim(),t)};let s=[{op:">=",type:B.GTE},{op:"<=",type:B.LTE},{op:"==",type:B.EQ},{op:"!=",type:B.NEQ},{op:">",type:B.GT},{op:"<",type:B.LT},{op:" in ",type:B.IN}];for(let{op:o,type:c}of s){let d=Oe(e,o);if(d!==-1)return{type:w.BINARY,op:c,left:Z(e.substring(0,d).trim(),t),right:Z(e.substring(d+o.length).trim(),t)}}let n=-1,a=null,p=[{op:" + ",type:B.ADD},{op:" - ",type:B.SUBTRACT}];for(let{op:o,type:c}of p){let d=0;for(;d<e.length;){let u=Oe(e.substring(d),o);if(u===-1)break;let f=d+u;f>n&&(n=f,a={op:o,type:c}),d=f+o.length}}if(n!==-1&&a)return{type:w.BINARY,op:a.type,left:Z(e.substring(0,n).trim(),t),right:Z(e.substring(n+a.op.length).trim(),t)};let l=[" * "," / "," % "];for(let o of l)if(Oe(e,o)!==-1)throw new k(`Arithmetic operations are not allowed in conditionals: "${o}"`);return e.startsWith("!")?{type:w.UNARY,op:sr.NOT,operand:Z(e.substring(1).trim(),t)}:ns(e,t)},Oe=(e,t)=>{let r=0,i=0;for(;i<=e.length-t.length;){if(e[i]==="(")r++;else if(e[i]===")")r--;else if(r===0&&e.substring(i,i+t.length)===t)return i;i++}return-1},Ld=e=>{if(e=e.trim(),e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:w.LITERAL,value:""};if(e==="{}")return{type:w.LITERAL,value:{}};if(e==="[]")return{type:w.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:w.LITERAL,value:t}:{type:w.VARIABLE,path:e}},ns=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return dt(r,t);let i=Ld(r);if(i.type===w.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:w.VARIABLE,path:r};try{return dt(r,t)}catch(s){if(s.message&&s.message.includes("not supported"))return i;throw s}},Nd=(e,t=!1)=>{try{sd(e)}catch(r){if(r instanceof k&&t){let i=r.message.replace(/\$for/g,"$each");throw new k(i.replace("Parse Error: ",""))}throw r}},fi=(e,t,r,i=!1)=>{let s=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(s);if(!n){let y=i?"$each":"$for";throw new k(`Invalid loop syntax (got: '${e.replace("$for",y)}')`)}let a=n[1],p=n[2].trim();Nd(p,i);let l=p.match(/^(.+?)\s+in\s+(.+)$/);if(!l){let y=i?"$each":"$for";throw new k(`Invalid loop syntax - missing 'in' keyword (got: '${y} ${p}')`)}let o=l[1].trim(),c=l[2].trim(),d,u=null;if(o.includes(",")){let y=o.split(",").map(b=>b.trim());if(y.length!==2)throw new k(`Invalid loop variables: ${o}. Expected format: "item" or "item, index"`);d=y[0],u=y[1]}else d=o;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new k(`Reserved variable name: ${d}`);if(u&&f.includes(u))throw new k(`Reserved variable name: ${u}`);let h=ns(c,r),m=Ae(t,r);return{type:w.LOOP,itemVar:d,indexVar:u,iterable:h,body:m,flatten:a!=="nested"}},mi=(e,t={})=>{let{functions:r={}}=t;return Ae(e,r)},Rd=()=>Date.now(),Vd=Object.freeze(Object.defineProperty({__proto__:null,now:Rd},Symbol.toStringTag,{value:"Module"})),as=(e,t,r={})=>{let{functions:i={},partials:s={}}=r,n={...Vd,...i},a=mi(e,{functions:n}),p={};for(let[l,o]of Object.entries(s))p[l]=mi(o,{functions:n});return Xi(a,t,{functions:n,partials:p})},Ge=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),jd=(e,t)=>{!t||typeof t!="object"||Object.entries(t).forEach(([r,i])=>{if(r==="default")throw new Error("[Methods] Invalid method name 'default'. Use named exports in .methods.js; default export is not supported.");if(typeof i=="function"){if(r in e)throw new Error(`[Methods] Cannot define method '${r}' because it already exists on the component instance.`);Object.defineProperty(e,r,{configurable:!0,enumerable:!1,writable:!1,value:(s={})=>{let n=s===void 0?{}:s;if(!Ge(n))throw new Error(`[Methods] Method '${r}' expects payload to be an object.`);return i.call(e,n)}})}})},os=Symbol.for("immer-nothing"),yi=Symbol.for("immer-draftable"),ne=Symbol.for("immer-state");function de(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Re=Object.getPrototypeOf;function Ve(e){return!!e&&!!e[ne]}function Ee(e){return e?ls(e)||Array.isArray(e)||!!e[yi]||!!e.constructor?.[yi]||vt(e)||wt(e):!1}var Pd=Object.prototype.constructor.toString();function ls(e){if(!e||typeof e!="object")return!1;let t=Re(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===Pd}function ct(e,t){bt(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,i)=>t(i,r,e))}function bt(e){let t=e[ne];return t?t.type_:Array.isArray(e)?1:vt(e)?2:wt(e)?3:0}function nr(e,t){return bt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ps(e,t,r){let i=bt(e);i===2?e.set(t,r):i===3?e.add(r):e[t]=r}function Bd(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function vt(e){return e instanceof Map}function wt(e){return e instanceof Set}function _e(e){return e.copy_||e.base_}function ar(e,t){if(vt(e))return new Map(e);if(wt(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=ls(e);if(t===!0||t==="class_only"&&!r){let i=Object.getOwnPropertyDescriptors(e);delete i[ne];let s=Reflect.ownKeys(i);for(let n=0;n<s.length;n++){let a=s[n],p=i[a];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(i[a]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[a]})}return Object.create(Re(e),i)}else{let i=Re(e);if(i!==null&&r)return{...e};let s=Object.create(i);return Object.assign(s,e)}}function br(e,t=!1){return _t(e)||Ve(e)||!Ee(e)||(bt(e)>1&&(e.set=e.add=e.clear=e.delete=Dd),Object.freeze(e),t&&Object.entries(e).forEach(([r,i])=>br(i,!0))),e}function Dd(){de(2)}function _t(e){return Object.isFrozen(e)}var zd={};function ke(e){let t=zd[e];return t||de(0,e),t}var Je;function ds(){return Je}function Fd(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function gi(e,t){t&&(ke("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function or(e){lr(e),e.drafts_.forEach(Wd),e.drafts_=null}function lr(e){e===Je&&(Je=e.parent_)}function bi(e){return Je=Fd(Je,e)}function Wd(e){let t=e[ne];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function vi(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[ne].modified_&&(or(t),de(4)),Ee(e)&&(e=ht(t,e),t.parent_||ut(t,e)),t.patches_&&ke("Patches").generateReplacementPatches_(r[ne].base_,e,t.patches_,t.inversePatches_)):e=ht(t,r,[]),or(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==os?e:void 0}function ht(e,t,r){if(_t(t))return t;let i=t[ne];if(!i)return ct(t,(s,n)=>wi(e,i,t,s,n,r)),t;if(i.scope_!==e)return t;if(!i.modified_)return ut(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;let s=i.copy_,n=s,a=!1;i.type_===3&&(n=new Set(s),s.clear(),a=!0),ct(n,(p,l)=>wi(e,i,s,p,l,r,a)),ut(e,s,!1),r&&e.patches_&&ke("Patches").generatePatches_(i,r,e.patches_,e.inversePatches_)}return i.copy_}function wi(e,t,r,i,s,n,a){if(Ve(s)){let p=n&&t&&t.type_!==3&&!nr(t.assigned_,i)?n.concat(i):void 0,l=ht(e,s,p);if(ps(r,i,l),Ve(l))e.canAutoFreeze_=!1;else return}else a&&r.add(s);if(Ee(s)&&!_t(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ht(e,s),(!t||!t.scope_.parent_)&&typeof i!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,i)&&ut(e,s)}}function ut(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&br(t,r)}function Md(e,t){let r=Array.isArray(e),i={type_:r?1:0,scope_:t?t.scope_:ds(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},s=i,n=vr;r&&(s=[i],n=Ye);let{revoke:a,proxy:p}=Proxy.revocable(s,n);return i.draft_=p,i.revoke_=a,p}var vr={get(e,t){if(t===ne)return e;let r=_e(e);if(!nr(r,t))return Kd(e,r,t);let i=r[t];return e.finalized_||!Ee(i)?i:i===Yt(e.base_,t)?(Xt(e),e.copy_[t]=dr(i,e)):i},has(e,t){return t in _e(e)},ownKeys(e){return Reflect.ownKeys(_e(e))},set(e,t,r){let i=cs(_e(e),t);if(i?.set)return i.set.call(e.draft_,r),!0;if(!e.modified_){let s=Yt(_e(e),t),n=s?.[ne];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Bd(r,s)&&(r!==void 0||nr(e.base_,t)))return!0;Xt(e),pr(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Yt(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Xt(e),pr(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=_e(e),i=Reflect.getOwnPropertyDescriptor(r,t);return i&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:i.enumerable,value:r[t]}},defineProperty(){de(11)},getPrototypeOf(e){return Re(e.base_)},setPrototypeOf(){de(12)}},Ye={};ct(vr,(e,t)=>{Ye[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ye.deleteProperty=function(e,t){return Ye.set.call(this,e,t,void 0)};Ye.set=function(e,t,r){return vr.set.call(this,e[0],t,r,e[0])};function Yt(e,t){let r=e[ne];return(r?_e(r):e)[t]}function Kd(e,t,r){let i=cs(t,r);return i?"value"in i?i.value:i.get?.call(e.draft_):void 0}function cs(e,t){if(!(t in e))return;let r=Re(e);for(;r;){let i=Object.getOwnPropertyDescriptor(r,t);if(i)return i;r=Re(r)}}function pr(e){e.modified_||(e.modified_=!0,e.parent_&&pr(e.parent_))}function Xt(e){e.copy_||(e.copy_=ar(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ud=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,i)=>{if(typeof t=="function"&&typeof r!="function"){let n=r;r=t;let a=this;return function(p=n,...l){return a.produce(p,o=>r.call(this,o,...l))}}typeof r!="function"&&de(6),i!==void 0&&typeof i!="function"&&de(7);let s;if(Ee(t)){let n=bi(this),a=dr(t,void 0),p=!0;try{s=r(a),p=!1}finally{p?or(n):lr(n)}return gi(n,i),vi(s,n)}else if(!t||typeof t!="object"){if(s=r(t),s===void 0&&(s=t),s===os&&(s=void 0),this.autoFreeze_&&br(s,!0),i){let n=[],a=[];ke("Patches").generateReplacementPatches_(t,s,n,a),i(n,a)}return s}else de(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(n,...a)=>this.produceWithPatches(n,p=>t(p,...a));let i,s;return[this.produce(t,r,(n,a)=>{i=n,s=a}),i,s]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Ee(e)||de(8),Ve(e)&&(e=Hd(e));let t=bi(this),r=dr(e,void 0);return r[ne].isManual_=!0,lr(t),r}finishDraft(e,t){let r=e&&e[ne];(!r||!r.isManual_)&&de(9);let{scope_:i}=r;return gi(i,t),vi(void 0,i)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let s=t[r];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}r>-1&&(t=t.slice(r+1));let i=ke("Patches").applyPatches_;return Ve(e)?i(e,t):this.produce(e,s=>i(s,t))}};function dr(e,t){let r=vt(e)?ke("MapSet").proxyMap_(e,t):wt(e)?ke("MapSet").proxySet_(e,t):Md(e,t);return(t?t.scope_:ds()).drafts_.push(r),r}function Hd(e){return Ve(e)||de(10,e),hs(e)}function hs(e){if(!Ee(e)||_t(e))return e;let t=e[ne],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ar(e,t.scope_.immer_.useStrictShallowCopy_)}else r=ar(e,!0);return ct(r,(i,s)=>{ps(r,i,hs(s))}),t&&(t.finalized_=!1),r}var ae=new Ud,qd=ae.produce;ae.produceWithPatches.bind(ae);ae.setAutoFreeze.bind(ae);ae.setUseStrictShallowCopy.bind(ae);ae.applyPatches.bind(ae);ae.createDraft.bind(ae);ae.finishDraft.bind(ae);var Gd=(e,t,r)=>{let{createInitialState:i,...s}=e,n={},a={},p={};return i&&(p=i({props:t,constants:r})),Object.entries(s).forEach(([l,o])=>{if(l.startsWith("select")){n[l]=(...c)=>o({state:p,props:t,constants:r},...c);return}a[l]=(c={})=>{let d=c===void 0?{}:c;if(!Ge(d))throw new Error(`[Store] Action '${l}' expects payload to be an object.`);return p=qd(p,u=>o({state:u,props:t,constants:r},d)),p}}),{getState:()=>p,...a,...n}},us=e=>!Ge(e)||Object.isFrozen(e)?e:(Object.values(e).forEach(t=>{us(t)}),Object.freeze(e)),Jd=({setupConstants:e,fileConstants:t})=>{let r=Ge(e)?e:{},i=Ge(t)?t:{};return us({...r,...i})},Yd=(e,t)=>{if(!t||typeof t!="object")return"";let r="",i=n=>Object.entries(n).map(([a,p])=>` ${a}: ${p};`).join(`
1446
1478
  `),s=(n,a)=>{if(typeof a!="object"||a===null)return"";if(n.startsWith("@")){let l=Object.entries(a).map(([o,c])=>{let d=i(c);return` ${o} {
1447
1479
  ${d.split(`
1448
1480
  `).map(u=>u?` ${u}`:"").join(`
@@ -1454,7 +1486,7 @@ ${l}
1454
1486
  ${p}
1455
1487
  }`};return Object.entries(t).forEach(([n,a])=>{let p=s(n,a);p&&(r+=(r?`
1456
1488
 
1457
- `:"")+p)}),r},cr=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...cr(r));else{if(r&&typeof r=="object"){let i=Object.entries(r);if(i.length>0){let[s,n]=i[0];Array.isArray(n)&&(r={[s]:cr(n)})}}t.push(r)}return t},[]):e,Qt=":",Qd=new Set(["__proto__","constructor","prototype"]),Zd=/^[A-Za-z_][A-Za-z0-9_.:-]*$/,_i=e=>Zd.test(e),xi=(e,t)=>{if(!t)return e;let r=[],i="",s=!1;for(let n=0;n<t.length;n++){let a=t[n];if(!s&&a===".")i&&(r.push(i),i="");else if(!s&&a==="[")i&&(r.push(i),i=""),s=!0;else if(s&&a==="]"){if(i){if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))r.push(i.slice(1,-1));else{let p=Number(i);r.push(Number.isNaN(p)?i:p)}i=""}s=!1}else i+=a}return i&&r.push(i),r.reduce((n,a)=>{if(n==null)return;let p=typeof a=="number"?a:String(a);if(!(typeof p=="string"&&Qd.has(p)))return n[p]},e)},ec=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase()),tc=({attrsString:e="",viewData:t={},tagName:r,isWebComponent:i})=>{let s={},n={},a=y=>{if(y==="role"||y.startsWith("aria-")||y.startsWith("data-"))throw new Error(`[Parser] Invalid boolean attribute '?${y}'. Use normal binding for value-carrying attributes such as aria-*, data-*, and role.`)},p=(y,_,S)=>{let A=ec(y);if(!A)throw new Error(`[Parser] Invalid ${S} prop name on '${r}'.`);if(Object.prototype.hasOwnProperty.call(n,A))throw new Error(`[Parser] Duplicate prop binding '${A}' on '${r}'. Use only one of 'name=value' or ':name=value'.`);n[A]=_},l=(y,_)=>{if(!_i(y))throw new Error(`[Parser] Invalid ${_} attribute name '${y}' on '${r}'.`)};if(!e)return{attrs:s,props:n};let o=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,c,d=new Set;for(;(c=o.exec(e))!==null;){let y=c[1],_=c[2]??c[3]??c[4]??"";if(d.add(y),y.startsWith(".")){s[y]=_;continue}if(y.startsWith(Qt)){let S=y.substring(1),A=_;if(c[4]!==void 0&&c[4]!==""){let E=c[4],O=xi(t,E);O!==void 0&&(A=O)}p(S,A,"property-form");continue}if(y.startsWith("?")){let S=y.substring(1);l(S,"boolean toggle");let A=_;a(S);let E;A==="true"?E=!0:A==="false"||A===""?E=!1:E=xi(t,A),E&&(s[S]=""),i&&S!=="id"&&p(S,!!E,"boolean attribute-form");continue}l(y,"binding"),s[y]=_,i&&y!=="id"&&p(y,_,"attribute-form")}let u=e,f=[],h,m=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g;for(;(h=m.exec(e))!==null;)f.push(h[0]);f.forEach(y=>{u=u.replace(y," ")});let g=/(\S+?)(?=\s|$)/g,b;for(;(b=g.exec(u))!==null;){let y=b[1];if(!y.startsWith(".")&&!(d.has(y)||y.startsWith(Qt)||y.includes("="))){if(y.startsWith("?")){let _=y.substring(1);l(_,"boolean toggle"),a(_),s[_]="",i&&_!=="id"&&p(_,!0,"boolean attribute-form");continue}if(!_i(y))throw new Error(`[Parser] Invalid attribute token '${y}' on '${r}'.`);!d.has(y)&&!y.startsWith(Qt)&&!y.includes("=")&&(s[y]="",i&&y!=="id"&&p(y,!0,"boolean attribute-form"))}}return{attrs:s,props:n}},rc=/^[a-z][a-zA-Z0-9]*\*?$/,ic=/^[a-zA-Z][a-zA-Z0-9_-]*\*?$/,sc=/^[a-z][a-zA-Z0-9]*$/,Si=new Set(["window","document"]),fs=e=>Object.entries(e||{}).map(([t,r])=>{if(Si.has(t))return{refKey:t,refConfig:r,targetType:"global",isWildcard:!1,prefix:t};let i="id",s=t;t.startsWith(".")?(i="class",s=t.slice(1)):t.startsWith("#")&&(i="id",s=t.slice(1));let n=s.endsWith("*")?s.slice(0,-1):s;if(Si.has(n))throw new Error(`[Parser] Invalid ref key '${t}'. Reserved global keys must be exactly 'window' or 'document'.`);if(i==="id"&&!rc.test(s))throw new Error(`[Parser] Invalid ref key '${t}'. Use camelCase IDs (optional '#', optional '*') or class refs with '.' prefix.`);if(i==="class"&&!ic.test(s))throw new Error(`[Parser] Invalid ref key '${t}'. Class refs must start with '.' and use class-compatible names (optional '*').`);let a=s.endsWith("*"),p=a?s.slice(0,-1):s;return{refKey:t,refConfig:r,targetType:i,isWildcard:a,prefix:p}}),nc=e=>{if(!sc.test(e))throw new Error(`[Parser] Invalid element id '${e}' for refs. Use camelCase ids only. Kebab-case ids are not supported.`)},Ai=({value:e,prefix:t,isWildcard:r})=>typeof e!="string"||e.length===0?!1:r?e.startsWith(t):e===t,ms=({elementIdForRefs:e,classNames:t=[],refMatchers:r})=>{let i=[],s=Array.isArray(t)?t:[];return r.forEach(n=>{if(n.targetType==="global")return;if(n.targetType==="id"){Ai({value:e,prefix:n.prefix,isWildcard:n.isWildcard})&&i.push({...n,matchedValue:e});return}let a=s.find(p=>Ai({value:p,prefix:n.prefix,isWildcard:n.isWildcard}));a&&i.push({...n,matchedValue:a})}),i.length===0?null:(i.sort((n,a)=>{let p=n.targetType==="id"?2:1,l=a.targetType==="id"?2:1;return p!==l?l-p:!n.isWildcard&&a.isWildcard?-1:n.isWildcard&&!a.isWildcard?1:a.prefix.length-n.prefix.length}),i[0])},Ue=({optionName:e,optionValue:t,eventType:r,refKey:i})=>{if(t!==void 0&&typeof t!="boolean")throw new Error(`[Parser] Invalid '${e}' for event '${r}' on ref '${i}'. Expected boolean.`)},Ei=({optionName:e,optionValue:t,eventType:r,refKey:i})=>{if(t!==void 0&&(typeof t!="number"||Number.isNaN(t)||!Number.isFinite(t)||t<0))throw new Error(`[Parser] Invalid '${e}' for event '${r}' on ref '${i}'. Expected non-negative number.`)},ac=({eventType:e,eventConfig:t,refKey:r})=>{if(typeof t!="object"||t===null)throw new Error(`[Parser] Invalid event config for event '${e}' on ref '${r}'.`);let i=Object.prototype.hasOwnProperty.call(t,"debounce"),s=Object.prototype.hasOwnProperty.call(t,"throttle");if(Ue({optionName:"preventDefault",optionValue:t.preventDefault,eventType:e,refKey:r}),Ue({optionName:"stopPropagation",optionValue:t.stopPropagation,eventType:e,refKey:r}),Ue({optionName:"stopImmediatePropagation",optionValue:t.stopImmediatePropagation,eventType:e,refKey:r}),Ue({optionName:"targetOnly",optionValue:t.targetOnly,eventType:e,refKey:r}),Ue({optionName:"once",optionValue:t.once,eventType:e,refKey:r}),Ei({optionName:"debounce",optionValue:t.debounce,eventType:e,refKey:r}),Ei({optionName:"throttle",optionValue:t.throttle,eventType:e,refKey:r}),i&&s)throw new Error(`[Parser] Event '${e}' on ref '${r}' cannot define both 'debounce' and 'throttle'.`);if(t.handler&&t.action)throw new Error("Each listener can have handler or action but not both");if(!t.handler&&!t.action)throw new Error("Each listener must define either handler or action");return{hasDebounce:i,hasThrottle:s}},ys=e=>(e.__eventRateLimitState||Object.defineProperty(e,"__eventRateLimitState",{value:new Map,enumerable:!1,configurable:!0}),e.__eventRateLimitState),oc=({eventConfig:e,handlers:t,onMissingHandler:r,parseAndRenderFn:i})=>{let s=n=>{let a=e.payload&&typeof e.payload=="object"&&!Array.isArray(e.payload)?e.payload:{};return typeof i!="function"?a:i(a,{_event:n})};if(e.action){if(typeof t.handleCallStoreAction!="function")throw new Error(`[Runtime] Action listener '${e.action}' requires handlers.handleCallStoreAction.`);return n=>{let a=s(n);t.handleCallStoreAction({...a,_event:n,_action:e.action})}}return e.handler&&t[e.handler]?n=>{let a=s(n);t[e.handler]({...a,_event:n})}:(e.handler&&r?.(e.handler),null)},lc=({eventConfig:e,callback:t,hasDebounce:r,hasThrottle:i,stateKey:s,eventRateLimitState:n,fallbackCurrentTarget:a=null,nowFn:p=Date.now,setTimeoutFn:l=setTimeout,clearTimeoutFn:o=clearTimeout})=>c=>{let d=n.get(s)||{},u=c.currentTarget||a;if(e.once)if(u){if(d.onceTargets||(d.onceTargets=new WeakSet),d.onceTargets.has(u)){n.set(s,d);return}d.onceTargets.add(u)}else if(d.onceTriggered){n.set(s,d);return}else d.onceTriggered=!0;if(e.targetOnly&&c.target!==c.currentTarget){n.set(s,d);return}if(e.preventDefault&&c.preventDefault(),e.stopImmediatePropagation?c.stopImmediatePropagation():e.stopPropagation&&c.stopPropagation(),r){d.debounceTimer&&o(d.debounceTimer),d.debounceTimer=l(()=>{let f=d.debounceTimer;try{t(c)}catch(h){throw o(f),d.debounceTimer=null,h}d.debounceTimer=null},e.debounce),n.set(s,d);return}if(i){Object.prototype.hasOwnProperty.call(d,"lastThrottleAt")||(d.lastThrottleAt=void 0);let f=p();if(d.lastThrottleAt===void 0||f-d.lastThrottleAt>=e.throttle){d.lastThrottleAt=f,n.set(s,d),t(c);return}n.set(s,d);return}n.set(s,d),t(c)},gs=({eventType:e,eventConfig:t,refKey:r,handlers:i,eventRateLimitState:s,stateKey:n,fallbackCurrentTarget:a=null,parseAndRenderFn:p,onMissingHandler:l,nowFn:o=Date.now,setTimeoutFn:c=setTimeout,clearTimeoutFn:d=clearTimeout})=>{let{hasDebounce:u,hasThrottle:f}=ac({eventType:e,eventConfig:t,refKey:r}),h=oc({eventConfig:t,handlers:i,onMissingHandler:l,parseAndRenderFn:p});return h?lc({eventConfig:t,callback:h,hasDebounce:u,hasThrottle:f,stateKey:n,eventRateLimitState:s,fallbackCurrentTarget:a,nowFn:o,setTimeoutFn:c,clearTimeoutFn:d}):null},pc=({h:e,template:t,viewData:r,refs:i,handlers:s,createComponentUpdateHook:n})=>{let a=Xi(t,r,{}),p=cr(a),l=dc({h:e,items:p,refs:i,handlers:s,viewData:r,createComponentUpdateHook:n});return e("div",{style:{display:"contents"}},l)},dc=({h:e,items:t,refs:r={},handlers:i={},viewData:s={},createComponentUpdateHook:n})=>{if(!Array.isArray(t))throw new Error("[Parser] Input to createVirtualDom must be an array, got "+typeof t);let a=fs(r),p=a.some(o=>o.targetType==="id");function l(o,c=""){return o.map((d,u)=>{let f=c?`${c}.${u}`:String(u);if(typeof d=="string"||typeof d=="number")return String(d);if(typeof d!="object"||d===null)return console.warn("Skipping invalid item in DOM structure:",d),null;let h=Object.entries(d);if(h.length===0)return null;let[m,g]=h[0];if(!isNaN(Number(m)))return Array.isArray(g)?l(g,f):typeof g=="object"&&g!==null&&Object.entries(g).length>0?l([g],f):String(g);h.length>1&&console.warn("Item has multiple keys, processing only the first:",m);let b,y,_=m.indexOf(" ");_===-1?(b=m,y=""):(b=m.substring(0,_),y=m.substring(_+1).trim());let S=b.split(/[.#]/)[0],A=S.includes("-"),E,O;try{({attrs:E,props:O}=tc({attrsString:y,viewData:s,tagName:S,isWebComponent:A}))}catch(q){throw new Error(`[Parser] Failed to parse bindings for selector '${b}' with attrs '${y}': ${q.message}`)}let T=b.match(/#([^.#\s]+)/);T&&!Object.prototype.hasOwnProperty.call(E,"id")&&(E.id=T[1]);let V=null;E.id&&(V=E.id);let z=(b.match(/\.([^.#]+)/g)||[]).map(q=>q.substring(1)),D=typeof E.class=="string"?E.class.split(/\s+/).filter(Boolean):[],W=[...new Set([...z,...D])],X=Object.create(null),fe=null;if(!A){z.forEach(Ie=>{X[Ie]=!0});let q=b.match(/#([^.#\s]+)/);q&&(fe=q[1])}let be;typeof g=="string"||typeof g=="number"?be=String(g):Array.isArray(g)?be=l(g,f):be=[],fe&&!A&&(E.id=fe);let xt=Object.create(null);if(a.length>0){p&&V&&nc(V);let q=ms({elementIdForRefs:V,classNames:W,refMatchers:a});if(q){let Ie=q.refKey,wr=q.matchedValue||V||Ie;if(q.refConfig&&q.refConfig.eventListeners){let Ss=q.refConfig.eventListeners,As=ys(i);Object.entries(Ss).forEach(([St,Es])=>{let ks=`${Ie}:${wr}:${St}`,_r=gs({eventType:St,eventConfig:Es,refKey:Ie,handlers:i,eventRateLimitState:As,stateKey:ks,parseAndRenderFn:as,onMissingHandler:$s=>{console.warn(`[Parser] Handler '${$s}' for refKey '${Ie}' (matching '${wr}') is referenced but not found in available handlers.`)}});_r&&(xt[St]=_r)})}}}let me={};if(V?me.key=V:b&&(me.key=`${b}-${f}`),Object.keys(E).length>0&&(me.attrs=E),Object.keys(X).length>0&&(me.class=X),Object.keys(xt).length>0&&(me.on=xt),Object.keys(O).length>0&&(me.props=O),A&&typeof n=="function"){let q=n({selector:b,tagName:S});q&&(me.hook=q)}try{return e(S,me,be)}catch(q){throw new Error(`[Parser] Error creating virtual node for '${S}': ${q.message}`)}}).filter(Boolean)}return l(t)},cc=({baseDeps:e,refs:t,dispatchEvent:r,store:i,render:s})=>({...e,refs:t,dispatchEvent:r,store:i,render:s}),hc=({store:e,render:t,parseAndRenderFn:r})=>i=>{let{_event:s,_action:n}=i,a=r(i,{_event:s});if(!e[n])throw new Error(`[Store] Action 'store.${n}' is not defined.`);e[n](a),t()},uc=({handlers:e,deps:t,parseAndRenderFn:r})=>{let i={handleCallStoreAction:hc({store:t.store,render:t.render,parseAndRenderFn:r})};return Object.keys(e||{}).forEach(s=>{i[s]=n=>e[s](t,n)}),i},fc=e=>{if(e&&typeof e.then=="function")throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");return e},mc=({handlers:e,deps:t})=>{if(!e?.handleBeforeMount)return;let r=e.handleBeforeMount(t);return fc(r)},yc=({handlers:e,deps:t})=>{e?.handleAfterMount&&e.handleAfterMount(t)},gc=({attributeName:e,oldValue:t,newValue:r,deps:i,propsSchemaKeys:s,toCamelCase:n,normalizeAttributeValue:a})=>{let p=n(e),l={};s.forEach(u=>{let f=i.props[u];f!==void 0&&(l[u]=f)});let o={...l},c=a(t),d=a(r);return c===void 0?delete o[p]:o[p]=c,d===void 0?delete l[p]:l[p]=d,{changedProp:p,oldProps:o,newProps:l}},bc=({refKey:e,targets:t})=>e==="window"?t.window:e==="document"?t.document:null,vc=({refs:e={},handlers:t={},targets:r={window:globalThis.window,document:globalThis.document},parseAndRenderFn:i,timing:s={nowFn:Date.now,setTimeoutFn:setTimeout,clearTimeoutFn:clearTimeout},warnFn:n=console.warn})=>{let a=[],p=new Set,l=ys(t);return Object.entries(e).forEach(([o,c])=>{if(o!=="window"&&o!=="document")return;let d=bc({refKey:o,targets:r});!d||!c?.eventListeners||Object.entries(c.eventListeners).forEach(([u,f])=>{let h=`${o}:${u}`;p.add(h);let m=gs({eventType:u,eventConfig:f,refKey:o,handlers:t,eventRateLimitState:l,stateKey:h,fallbackCurrentTarget:d,parseAndRenderFn:i,nowFn:s.nowFn,setTimeoutFn:s.setTimeoutFn,clearTimeoutFn:s.clearTimeoutFn,onMissingHandler:g=>{n(`[Runtime] Handler '${g}' for global ref '${o}' is referenced but not found in available handlers.`)}});m&&(d.addEventListener(u,m),a.push(()=>{d.removeEventListener(u,m)}))})}),()=>{a.forEach(o=>o()),p.forEach(o=>{let c=l.get(o);c&&c.debounceTimer&&s.clearTimeoutFn(c.debounceTimer),l.delete(o)})}},wc=e=>fs(e),_c=e=>{let t=[],r=e?.data?.class;r&&typeof r=="object"&&Object.entries(r).forEach(([s,n])=>{n&&t.push(s)});let i=e?.data?.attrs?.class;return typeof i=="string"&&i.split(/\s+/).filter(Boolean).forEach(s=>t.push(s)),[...new Set(t)]},xc=({rootVNode:e,refs:t})=>{let r={},i=wc(t),s=n=>{if(!n||typeof n!="object")return;let a=n?.data?.attrs?.id,p=_c(n),l=ms({elementIdForRefs:a,classNames:p,refMatchers:i});if(n.elm&&l){let o=a||l.refKey;r[o]=n.elm}Array.isArray(n.children)&&n.children.forEach(s)};return s(e),r},Sc=({propsSchemaKeys:e=[],toKebabCase:t})=>{let r=new Set(["key"]);return e.forEach(i=>{r.add(i),r.add(t(i))}),[...r]},Ac=({baseDeps:e,refs:t,dispatchEvent:r,store:i,render:s})=>cc({baseDeps:e,refs:t,dispatchEvent:r,store:i,render:s}),Ec=({refIds:e,nextRefIds:t={}})=>(Object.keys(e).forEach(r=>{delete e[r]}),Object.assign(e,t),e),kc=({transformedHandlers:e,clearTimerFn:t=clearTimeout})=>{let r=e?.__eventRateLimitState;if(!(r instanceof Map))return 0;let i=0;return r.forEach(s=>{s&&s.debounceTimer&&(t(s.debounceTimer),i+=1)}),r.clear(),i},bs=({instance:e})=>Ac({baseDeps:e.deps,refs:e.refIds,dispatchEvent:e.dispatchEvent.bind(e),store:e.store,render:e.render.bind(e)}),$c=({instance:e,parseAndRenderFn:t,renderFn:r,createTransformedHandlersFn:i=uc,runBeforeMountFn:s=mc,attachGlobalRefListenersFn:n=vc,runAfterMountFn:a=yc})=>{let p=bs({instance:e});return e.transformedHandlers=i({handlers:e.handlers,deps:p,parseAndRenderFn:t}),e._unmountCallback=s({handlers:e.handlers,deps:p}),e._globalListenersCleanup=n({refs:e.refs,handlers:e.transformedHandlers,parseAndRenderFn:t}),r(),a({handlers:e.handlers,deps:p}),p},Cc=({instance:e,clearTimerFn:t=clearTimeout})=>(e._unmountCallback&&e._unmountCallback(),e._globalListenersCleanup&&e._globalListenersCleanup(),kc({transformedHandlers:e.transformedHandlers,clearTimerFn:t})),Ic=({instance:e,attributeName:t,oldValue:r,newValue:i,scheduleFrameFn:s})=>{if(!(r===i||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=bs({instance:e}),a=gc({attributeName:t,oldValue:r,newValue:i,deps:n,propsSchemaKeys:e._propsSchemaKeys,toCamelCase:Yi,normalizeAttributeValue:ir});e.handlers.handleOnUpdate(n,a);return}s(()=>{e.render()})}},Tc=({instance:e,createComponentUpdateHookFn:t,parseViewFn:r=pc,collectRefElementsFn:i=xc,onError:s=n=>{console.error("Error during render:",n)}})=>{if(!e.patch)return console.error("Patch function is not defined!"),null;if(!e.template)return console.error("Template is not defined!"),null;try{let n=r({h:e._snabbdomH,template:e.template,viewData:e.viewData,refs:e.refs,handlers:e.transformedHandlers,createComponentUpdateHook:t});e._oldVNode?e._oldVNode=e.patch(e._oldVNode,n):e._oldVNode=e.patch(e.renderTarget,n);let a=i({rootVNode:e._oldVNode,refs:e.refs});return Ec({refIds:e.refIds,nextRefIds:a}),e._oldVNode}catch(n){return s(n),e._oldVNode||null}},Oc=`
1489
+ `:"")+p)}),r},cr=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...cr(r));else{if(r&&typeof r=="object"){let i=Object.entries(r);if(i.length>0){let[s,n]=i[0];Array.isArray(n)&&(r={[s]:cr(n)})}}t.push(r)}return t},[]):e,Qt=":",Xd=new Set(["__proto__","constructor","prototype"]),Qd=/^[A-Za-z_][A-Za-z0-9_.:-]*$/,_i=e=>Qd.test(e),xi=(e,t)=>{if(!t)return e;let r=[],i="",s=!1;for(let n=0;n<t.length;n++){let a=t[n];if(!s&&a===".")i&&(r.push(i),i="");else if(!s&&a==="[")i&&(r.push(i),i=""),s=!0;else if(s&&a==="]"){if(i){if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))r.push(i.slice(1,-1));else{let p=Number(i);r.push(Number.isNaN(p)?i:p)}i=""}s=!1}else i+=a}return i&&r.push(i),r.reduce((n,a)=>{if(n==null)return;let p=typeof a=="number"?a:String(a);if(!(typeof p=="string"&&Xd.has(p)))return n[p]},e)},Zd=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase()),ec=({attrsString:e="",viewData:t={},tagName:r,isWebComponent:i})=>{let s={},n={},a=g=>{if(g==="role"||g.startsWith("aria-")||g.startsWith("data-"))throw new Error(`[Parser] Invalid boolean attribute '?${g}'. Use normal binding for value-carrying attributes such as aria-*, data-*, and role.`)},p=(g,_,S)=>{let A=Zd(g);if(!A)throw new Error(`[Parser] Invalid ${S} prop name on '${r}'.`);if(Object.prototype.hasOwnProperty.call(n,A))throw new Error(`[Parser] Duplicate prop binding '${A}' on '${r}'. Use only one of 'name=value' or ':name=value'.`);n[A]=_},l=(g,_)=>{if(!_i(g))throw new Error(`[Parser] Invalid ${_} attribute name '${g}' on '${r}'.`)};if(!e)return{attrs:s,props:n};let o=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,c,d=new Set;for(;(c=o.exec(e))!==null;){let g=c[1],_=c[2]??c[3]??c[4]??"";if(d.add(g),g.startsWith(".")){s[g]=_;continue}if(g.startsWith(Qt)){let S=g.substring(1),A=_;if(c[4]!==void 0&&c[4]!==""){let E=c[4],T=xi(t,E);T!==void 0&&(A=T)}p(S,A,"property-form");continue}if(g.startsWith("?")){let S=g.substring(1);l(S,"boolean toggle");let A=_;a(S);let E;A==="true"?E=!0:A==="false"||A===""?E=!1:E=xi(t,A),E&&(s[S]=""),i&&S!=="id"&&p(S,!!E,"boolean attribute-form");continue}l(g,"binding"),s[g]=_,i&&g!=="id"&&p(g,_,"attribute-form")}let u=e,f=[],h,m=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g;for(;(h=m.exec(e))!==null;)f.push(h[0]);f.forEach(g=>{u=u.replace(g," ")});let y=/(\S+?)(?=\s|$)/g,b;for(;(b=y.exec(u))!==null;){let g=b[1];if(!g.startsWith(".")&&!(d.has(g)||g.startsWith(Qt)||g.includes("="))){if(g.startsWith("?")){let _=g.substring(1);l(_,"boolean toggle"),a(_),s[_]="",i&&_!=="id"&&p(_,!0,"boolean attribute-form");continue}if(!_i(g))throw new Error(`[Parser] Invalid attribute token '${g}' on '${r}'.`);!d.has(g)&&!g.startsWith(Qt)&&!g.includes("=")&&(s[g]="",i&&g!=="id"&&p(g,!0,"boolean attribute-form"))}}return{attrs:s,props:n}},tc=/^[a-z][a-zA-Z0-9]*\*?$/,rc=/^[a-zA-Z][a-zA-Z0-9_-]*\*?$/,ic=/^[a-z][a-zA-Z0-9]*$/,Si=new Set(["window","document"]),fs=e=>Object.entries(e||{}).map(([t,r])=>{if(Si.has(t))return{refKey:t,refConfig:r,targetType:"global",isWildcard:!1,prefix:t};let i="id",s=t;t.startsWith(".")?(i="class",s=t.slice(1)):t.startsWith("#")&&(i="id",s=t.slice(1));let n=s.endsWith("*")?s.slice(0,-1):s;if(Si.has(n))throw new Error(`[Parser] Invalid ref key '${t}'. Reserved global keys must be exactly 'window' or 'document'.`);if(i==="id"&&!tc.test(s))throw new Error(`[Parser] Invalid ref key '${t}'. Use camelCase IDs (optional '#', optional '*') or class refs with '.' prefix.`);if(i==="class"&&!rc.test(s))throw new Error(`[Parser] Invalid ref key '${t}'. Class refs must start with '.' and use class-compatible names (optional '*').`);let a=s.endsWith("*"),p=a?s.slice(0,-1):s;return{refKey:t,refConfig:r,targetType:i,isWildcard:a,prefix:p}}),sc=e=>{if(!ic.test(e))throw new Error(`[Parser] Invalid element id '${e}' for refs. Use camelCase ids only. Kebab-case ids are not supported.`)},Ai=({value:e,prefix:t,isWildcard:r})=>typeof e!="string"||e.length===0?!1:r?e.startsWith(t):e===t,ms=({elementIdForRefs:e,classNames:t=[],refMatchers:r})=>{let i=[],s=Array.isArray(t)?t:[];return r.forEach(n=>{if(n.targetType==="global")return;if(n.targetType==="id"){Ai({value:e,prefix:n.prefix,isWildcard:n.isWildcard})&&i.push({...n,matchedValue:e});return}let a=s.find(p=>Ai({value:p,prefix:n.prefix,isWildcard:n.isWildcard}));a&&i.push({...n,matchedValue:a})}),i.length===0?null:(i.sort((n,a)=>{let p=n.targetType==="id"?2:1,l=a.targetType==="id"?2:1;return p!==l?l-p:!n.isWildcard&&a.isWildcard?-1:n.isWildcard&&!a.isWildcard?1:a.prefix.length-n.prefix.length}),i[0])},Ke=({optionName:e,optionValue:t,eventType:r,refKey:i})=>{if(t!==void 0&&typeof t!="boolean")throw new Error(`[Parser] Invalid '${e}' for event '${r}' on ref '${i}'. Expected boolean.`)},Ei=({optionName:e,optionValue:t,eventType:r,refKey:i})=>{if(t!==void 0&&(typeof t!="number"||Number.isNaN(t)||!Number.isFinite(t)||t<0))throw new Error(`[Parser] Invalid '${e}' for event '${r}' on ref '${i}'. Expected non-negative number.`)},nc=({eventType:e,eventConfig:t,refKey:r})=>{if(typeof t!="object"||t===null)throw new Error(`[Parser] Invalid event config for event '${e}' on ref '${r}'.`);let i=Object.prototype.hasOwnProperty.call(t,"debounce"),s=Object.prototype.hasOwnProperty.call(t,"throttle");if(Ke({optionName:"preventDefault",optionValue:t.preventDefault,eventType:e,refKey:r}),Ke({optionName:"stopPropagation",optionValue:t.stopPropagation,eventType:e,refKey:r}),Ke({optionName:"stopImmediatePropagation",optionValue:t.stopImmediatePropagation,eventType:e,refKey:r}),Ke({optionName:"targetOnly",optionValue:t.targetOnly,eventType:e,refKey:r}),Ke({optionName:"once",optionValue:t.once,eventType:e,refKey:r}),Ei({optionName:"debounce",optionValue:t.debounce,eventType:e,refKey:r}),Ei({optionName:"throttle",optionValue:t.throttle,eventType:e,refKey:r}),i&&s)throw new Error(`[Parser] Event '${e}' on ref '${r}' cannot define both 'debounce' and 'throttle'.`);if(t.handler&&t.action)throw new Error("Each listener can have handler or action but not both");if(!t.handler&&!t.action)throw new Error("Each listener must define either handler or action");return{hasDebounce:i,hasThrottle:s}},ys=e=>(e.__eventRateLimitState||Object.defineProperty(e,"__eventRateLimitState",{value:new Map,enumerable:!1,configurable:!0}),e.__eventRateLimitState),ac=({eventConfig:e,handlers:t,onMissingHandler:r,parseAndRenderFn:i})=>{let s=n=>{let a=e.payload&&typeof e.payload=="object"&&!Array.isArray(e.payload)?e.payload:{};return typeof i!="function"?a:i(a,{_event:n})};if(e.action){if(typeof t.handleCallStoreAction!="function")throw new Error(`[Runtime] Action listener '${e.action}' requires handlers.handleCallStoreAction.`);return n=>{let a=s(n);t.handleCallStoreAction({...a,_event:n,_action:e.action})}}return e.handler&&t[e.handler]?n=>{let a=s(n);t[e.handler]({...a,_event:n})}:(e.handler&&r?.(e.handler),null)},oc=({eventConfig:e,callback:t,hasDebounce:r,hasThrottle:i,stateKey:s,eventRateLimitState:n,fallbackCurrentTarget:a=null,nowFn:p=Date.now,setTimeoutFn:l=setTimeout,clearTimeoutFn:o=clearTimeout})=>c=>{let d=n.get(s)||{},u=c.currentTarget||a;if(e.once)if(u){if(d.onceTargets||(d.onceTargets=new WeakSet),d.onceTargets.has(u)){n.set(s,d);return}d.onceTargets.add(u)}else if(d.onceTriggered){n.set(s,d);return}else d.onceTriggered=!0;if(e.targetOnly&&c.target!==c.currentTarget){n.set(s,d);return}if(e.preventDefault&&c.preventDefault(),e.stopImmediatePropagation?c.stopImmediatePropagation():e.stopPropagation&&c.stopPropagation(),r){d.debounceTimer&&o(d.debounceTimer),d.debounceTimer=l(()=>{let f=d.debounceTimer;try{t(c)}catch(h){throw o(f),d.debounceTimer=null,h}d.debounceTimer=null},e.debounce),n.set(s,d);return}if(i){Object.prototype.hasOwnProperty.call(d,"lastThrottleAt")||(d.lastThrottleAt=void 0);let f=p();if(d.lastThrottleAt===void 0||f-d.lastThrottleAt>=e.throttle){d.lastThrottleAt=f,n.set(s,d),t(c);return}n.set(s,d);return}n.set(s,d),t(c)},gs=({eventType:e,eventConfig:t,refKey:r,handlers:i,eventRateLimitState:s,stateKey:n,fallbackCurrentTarget:a=null,parseAndRenderFn:p,onMissingHandler:l,nowFn:o=Date.now,setTimeoutFn:c=setTimeout,clearTimeoutFn:d=clearTimeout})=>{let{hasDebounce:u,hasThrottle:f}=nc({eventType:e,eventConfig:t,refKey:r}),h=ac({eventConfig:t,handlers:i,onMissingHandler:l,parseAndRenderFn:p});return h?oc({eventConfig:t,callback:h,hasDebounce:u,hasThrottle:f,stateKey:n,eventRateLimitState:s,fallbackCurrentTarget:a,nowFn:o,setTimeoutFn:c,clearTimeoutFn:d}):null},lc=({h:e,template:t,viewData:r,refs:i,handlers:s,createComponentUpdateHook:n})=>{let a=Xi(t,r,{}),p=cr(a),l=pc({h:e,items:p,refs:i,handlers:s,viewData:r,createComponentUpdateHook:n});return e("div",{style:{display:"contents"}},l)},pc=({h:e,items:t,refs:r={},handlers:i={},viewData:s={},createComponentUpdateHook:n})=>{if(!Array.isArray(t))throw new Error("[Parser] Input to createVirtualDom must be an array, got "+typeof t);let a=fs(r),p=a.some(o=>o.targetType==="id");function l(o,c=""){return o.map((d,u)=>{let f=c?`${c}.${u}`:String(u);if(typeof d=="string"||typeof d=="number")return String(d);if(typeof d!="object"||d===null)return console.warn("Skipping invalid item in DOM structure:",d),null;let h=Object.entries(d);if(h.length===0)return null;let[m,y]=h[0];if(!isNaN(Number(m)))return Array.isArray(y)?l(y,f):typeof y=="object"&&y!==null&&Object.entries(y).length>0?l([y],f):String(y);h.length>1&&console.warn("Item has multiple keys, processing only the first:",m);let b,g,_=m.indexOf(" ");_===-1?(b=m,g=""):(b=m.substring(0,_),g=m.substring(_+1).trim());let S=b.split(/[.#]/)[0],A=S.includes("-"),E,T;try{({attrs:E,props:T}=ec({attrsString:g,viewData:s,tagName:S,isWebComponent:A}))}catch(H){throw new Error(`[Parser] Failed to parse bindings for selector '${b}' with attrs '${g}': ${H.message}`)}let O=b.match(/#([^.#\s]+)/);O&&!Object.prototype.hasOwnProperty.call(E,"id")&&(E.id=O[1]);let V=null;E.id&&(V=E.id);let z=(b.match(/\.([^.#]+)/g)||[]).map(H=>H.substring(1)),D=typeof E.class=="string"?E.class.split(/\s+/).filter(Boolean):[],Y=[...new Set([...z,...D])],X=Object.create(null),fe=null;if(!A){z.forEach(Ce=>{X[Ce]=!0});let H=b.match(/#([^.#\s]+)/);H&&(fe=H[1])}let be;typeof y=="string"||typeof y=="number"?be=String(y):Array.isArray(y)?be=l(y,f):be=[],fe&&!A&&(E.id=fe);let xt=Object.create(null);if(a.length>0){p&&V&&sc(V);let H=ms({elementIdForRefs:V,classNames:Y,refMatchers:a});if(H){let Ce=H.refKey,wr=H.matchedValue||V||Ce;if(H.refConfig&&H.refConfig.eventListeners){let Ss=H.refConfig.eventListeners,As=ys(i);Object.entries(Ss).forEach(([St,Es])=>{let ks=`${Ce}:${wr}:${St}`,_r=gs({eventType:St,eventConfig:Es,refKey:Ce,handlers:i,eventRateLimitState:As,stateKey:ks,parseAndRenderFn:as,onMissingHandler:$s=>{console.warn(`[Parser] Handler '${$s}' for refKey '${Ce}' (matching '${wr}') is referenced but not found in available handlers.`)}});_r&&(xt[St]=_r)})}}}let me={};if(V?me.key=V:b&&(me.key=`${b}-${f}`),Object.keys(E).length>0&&(me.attrs=E),Object.keys(X).length>0&&(me.class=X),Object.keys(xt).length>0&&(me.on=xt),Object.keys(T).length>0&&(me.props=T),A&&typeof n=="function"){let H=n({selector:b,tagName:S});H&&(me.hook=H)}try{return e(S,me,be)}catch(H){throw new Error(`[Parser] Error creating virtual node for '${S}': ${H.message}`)}}).filter(Boolean)}return l(t)},dc=({baseDeps:e,refs:t,dispatchEvent:r,store:i,render:s})=>({...e,refs:t,dispatchEvent:r,store:i,render:s}),cc=({store:e,render:t,parseAndRenderFn:r})=>i=>{let{_event:s,_action:n}=i,a=r(i,{_event:s});if(!e[n])throw new Error(`[Store] Action 'store.${n}' is not defined.`);e[n](a),t()},hc=({handlers:e,deps:t,parseAndRenderFn:r})=>{let i={handleCallStoreAction:cc({store:t.store,render:t.render,parseAndRenderFn:r})};return Object.keys(e||{}).forEach(s=>{i[s]=n=>e[s](t,n)}),i},uc=e=>{if(e&&typeof e.then=="function")throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");return e},fc=({handlers:e,deps:t})=>{if(!e?.handleBeforeMount)return;let r=e.handleBeforeMount(t);return uc(r)},mc=({handlers:e,deps:t})=>{e?.handleAfterMount&&e.handleAfterMount(t)},yc=({attributeName:e,oldValue:t,newValue:r,deps:i,propsSchemaKeys:s,toCamelCase:n,normalizeAttributeValue:a})=>{let p=n(e),l={};s.forEach(u=>{let f=i.props[u];f!==void 0&&(l[u]=f)});let o={...l},c=a(t),d=a(r);return c===void 0?delete o[p]:o[p]=c,d===void 0?delete l[p]:l[p]=d,{changedProp:p,oldProps:o,newProps:l}},gc=({refKey:e,targets:t})=>e==="window"?t.window:e==="document"?t.document:null,bc=({refs:e={},handlers:t={},targets:r={window:globalThis.window,document:globalThis.document},parseAndRenderFn:i,timing:s={nowFn:Date.now,setTimeoutFn:setTimeout,clearTimeoutFn:clearTimeout},warnFn:n=console.warn})=>{let a=[],p=new Set,l=ys(t);return Object.entries(e).forEach(([o,c])=>{if(o!=="window"&&o!=="document")return;let d=gc({refKey:o,targets:r});!d||!c?.eventListeners||Object.entries(c.eventListeners).forEach(([u,f])=>{let h=`${o}:${u}`;p.add(h);let m=gs({eventType:u,eventConfig:f,refKey:o,handlers:t,eventRateLimitState:l,stateKey:h,fallbackCurrentTarget:d,parseAndRenderFn:i,nowFn:s.nowFn,setTimeoutFn:s.setTimeoutFn,clearTimeoutFn:s.clearTimeoutFn,onMissingHandler:y=>{n(`[Runtime] Handler '${y}' for global ref '${o}' is referenced but not found in available handlers.`)}});m&&(d.addEventListener(u,m),a.push(()=>{d.removeEventListener(u,m)}))})}),()=>{a.forEach(o=>o()),p.forEach(o=>{let c=l.get(o);c&&c.debounceTimer&&s.clearTimeoutFn(c.debounceTimer),l.delete(o)})}},vc=e=>fs(e),wc=e=>{let t=[],r=e?.data?.class;r&&typeof r=="object"&&Object.entries(r).forEach(([s,n])=>{n&&t.push(s)});let i=e?.data?.attrs?.class;return typeof i=="string"&&i.split(/\s+/).filter(Boolean).forEach(s=>t.push(s)),[...new Set(t)]},_c=({rootVNode:e,refs:t})=>{let r={},i=vc(t),s=n=>{if(!n||typeof n!="object")return;let a=n?.data?.attrs?.id,p=wc(n),l=ms({elementIdForRefs:a,classNames:p,refMatchers:i});if(n.elm&&l){let o=a||l.refKey;r[o]=n.elm}Array.isArray(n.children)&&n.children.forEach(s)};return s(e),r},xc=({propsSchemaKeys:e=[],toKebabCase:t})=>{let r=new Set(["key"]);return e.forEach(i=>{r.add(i),r.add(t(i))}),[...r]},Sc=({baseDeps:e,refs:t,dispatchEvent:r,store:i,render:s})=>dc({baseDeps:e,refs:t,dispatchEvent:r,store:i,render:s}),Ac=({refIds:e,nextRefIds:t={}})=>(Object.keys(e).forEach(r=>{delete e[r]}),Object.assign(e,t),e),Ec=({transformedHandlers:e,clearTimerFn:t=clearTimeout})=>{let r=e?.__eventRateLimitState;if(!(r instanceof Map))return 0;let i=0;return r.forEach(s=>{s&&s.debounceTimer&&(t(s.debounceTimer),i+=1)}),r.clear(),i},bs=({instance:e})=>Sc({baseDeps:e.deps,refs:e.refIds,dispatchEvent:e.dispatchEvent.bind(e),store:e.store,render:e.render.bind(e)}),kc=({instance:e,parseAndRenderFn:t,renderFn:r,createTransformedHandlersFn:i=hc,runBeforeMountFn:s=fc,attachGlobalRefListenersFn:n=bc,runAfterMountFn:a=mc})=>{let p=bs({instance:e});return e.transformedHandlers=i({handlers:e.handlers,deps:p,parseAndRenderFn:t}),e._unmountCallback=s({handlers:e.handlers,deps:p}),e._globalListenersCleanup=n({refs:e.refs,handlers:e.transformedHandlers,parseAndRenderFn:t}),r(),a({handlers:e.handlers,deps:p}),p},$c=({instance:e,clearTimerFn:t=clearTimeout})=>(e._unmountCallback&&e._unmountCallback(),e._globalListenersCleanup&&e._globalListenersCleanup(),Ec({transformedHandlers:e.transformedHandlers,clearTimerFn:t})),Cc=({instance:e,attributeName:t,oldValue:r,newValue:i,scheduleFrameFn:s})=>{if(!(r===i||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=bs({instance:e}),a=yc({attributeName:t,oldValue:r,newValue:i,deps:n,propsSchemaKeys:e._propsSchemaKeys,toCamelCase:Yi,normalizeAttributeValue:ir});e.handlers.handleOnUpdate(n,a);return}s(()=>{e.render()})}},Ic=({instance:e,createComponentUpdateHookFn:t,parseViewFn:r=lc,collectRefElementsFn:i=_c,onError:s=n=>{console.error("Error during render:",n)}})=>{if(!e.patch)return console.error("Patch function is not defined!"),null;if(!e.template)return console.error("Template is not defined!"),null;try{let n=r({h:e._snabbdomH,template:e.template,viewData:e.viewData,refs:e.refs,handlers:e.transformedHandlers,createComponentUpdateHook:t});e._oldVNode?e._oldVNode=e.patch(e._oldVNode,n):e._oldVNode=e.patch(e.renderTarget,n);let a=i({rootVNode:e._oldVNode,refs:e.refs});return Ac({refIds:e.refIds,nextRefIds:a}),e._oldVNode}catch(n){return s(n),e._oldVNode||null}},Tc=`
1458
1490
  a, a:link, a:visited, a:hover, a:active {
1459
1491
  display: contents;
1460
1492
  color: inherit;
@@ -1466,4 +1498,4 @@ ${p}
1466
1498
  font: inherit;
1467
1499
  cursor: pointer;
1468
1500
  }
1469
- `,Lc=({host:e,cssText:t,createStyleSheet:r=()=>new CSSStyleSheet,createElement:i=s=>document.createElement(s)})=>{let s=e.attachShadow({mode:"open"}),n=r();n.replaceSync(Oc);let a=[n];if(t){let l=r();l.replaceSync(t),a.push(l)}s.adoptedStyleSheets=a;let p=i("div");return p.style.cssText="display: contents;",s.appendChild(p),p.parentNode||e.appendChild(p),e.style.display="contents",{shadow:s,renderTarget:p,adoptedStyleSheets:a}},vs=(e,t=requestAnimationFrame)=>t(e),Nc=({scheduleFrameFn:e=vs}={})=>({update:(t,r)=>{let i=t.data?.props||{},s=r.data?.props||{};if(JSON.stringify(i)===JSON.stringify(s))return;let n=r.elm;!n||typeof n.render!="function"||(n.setAttribute("isDirty","true"),e(()=>{if(n.render(),n.removeAttribute("isDirty"),n.handlers&&n.handlers.handleOnUpdate){let a={...n.deps,store:n.store,render:n.render.bind(n),handlers:n.handlers,dispatchEvent:n.dispatchEvent.bind(n),refs:n.refIds||{}};n.handlers.handleOnUpdate(a,{oldProps:i,newProps:s})}}))}}),Rc=({elementName:e,propsSchema:t,propsSchemaKeys:r,template:i,refs:s,styles:n,handlers:a,methods:p,constants:l,store:o,patch:c,h:d,deps:u})=>{class f extends HTMLElement{elementName;styles;_snabbdomH;store;props;propsSchema;template;handlers;methods;constants;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_globalListenersCleanup;_oldVNode;deps;_propsSchemaKeys=[];cssText;static get observedAttributes(){return["key"]}get viewData(){let g={};return this.store.selectViewData&&(g=this.store.selectViewData()),g}connectedCallback(){let g=Lc({host:this,cssText:this.cssText});this.shadow=g.shadow,this.renderTarget=g.renderTarget,$c({instance:this,parseAndRenderFn:as,renderFn:this.render})}disconnectedCallback(){Cc({instance:this,clearTimerFn:clearTimeout})}attributeChangedCallback(g,b,y){Ic({instance:this,attributeName:g,oldValue:b,newValue:y,scheduleFrameFn:vs})}render=()=>{Tc({instance:this,createComponentUpdateHookFn:Nc})}}class h extends f{static get observedAttributes(){return Sc({propsSchemaKeys:r,toKebabCase:Ji})}constructor(){super(),this.constants=Yd({setupConstants:u?.constants,fileConstants:l}),this.propsSchema=t,this.props=t?id(this,r):{},this._propsSchemaKeys=r,this.elementName=e,this.styles=n,this.store=Jd(o,this.props,this.constants),this.template=i,this.handlers=a,this.methods=p,this.refs=s,this.patch=c,this.deps={...u,store:this.store,render:this.render,handlers:a,props:this.props,constants:this.constants},Pd(this,this.methods),this._snabbdomH=d,this.cssText=Xd(e,n)}}return h};function Qe(e,t,r,i,s){let n=t===void 0?void 0:t.key;return{sel:e,data:t,children:r,text:i,elm:s,key:n}}var ft=Array.isArray;function ot(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function Vc(e,t){return document.createElement(e,t)}function jc(e,t,r){return document.createElementNS(e,t,r)}function Pc(){return Se(document.createDocumentFragment())}function Bc(e){return document.createTextNode(e)}function Dc(e){return document.createComment(e)}function zc(e,t,r){if(ue(e)){let i=e;for(;i&&ue(i);)i=Se(i).parent;e=i??e}ue(t)&&(t=Se(t,e)),r&&ue(r)&&(r=Se(r).firstChildNode),e.insertBefore(t,r)}function Fc(e,t){e.removeChild(t)}function Wc(e,t){ue(t)&&(t=Se(t,e)),e.appendChild(t)}function ws(e){if(ue(e)){for(;e&&ue(e);)e=Se(e).parent;return e??null}return e.parentNode}function Mc(e){var t;if(ue(e)){let r=Se(e),i=ws(r);if(i&&r.lastChildNode){let s=Array.from(i.childNodes),n=s.indexOf(r.lastChildNode);return(t=s[n+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function Kc(e){return e.tagName}function Uc(e,t){e.textContent=t}function Hc(e){return e.textContent}function qc(e){return e.nodeType===1}function Gc(e){return e.nodeType===3}function Jc(e){return e.nodeType===8}function ue(e){return e.nodeType===11}function Se(e,t){var r,i,s;let n=e;return(r=n.parent)!==null&&r!==void 0||(n.parent=t??null),(i=n.firstChildNode)!==null&&i!==void 0||(n.firstChildNode=e.firstChild),(s=n.lastChildNode)!==null&&s!==void 0||(n.lastChildNode=e.lastChild),n}var Yc={createElement:Vc,createElementNS:jc,createTextNode:Bc,createDocumentFragment:Pc,createComment:Dc,insertBefore:zc,removeChild:Fc,appendChild:Wc,parentNode:ws,nextSibling:Mc,tagName:Kc,setTextContent:Uc,getTextContent:Hc,isElement:qc,isText:Gc,isComment:Jc,isDocumentFragment:ue};function at(e){return e===void 0}function re(e){return e!==void 0}var Zt=Qe("",{},[],void 0,void 0);function He(e,t){var r,i;let s=e.key===t.key,n=((r=e.data)===null||r===void 0?void 0:r.is)===((i=t.data)===null||i===void 0?void 0:i.is),a=e.sel===t.sel,p=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return a&&s&&n&&p}function Xc(){throw new Error("The document fragment is not supported on this platform.")}function Qc(e,t){return e.isElement(t)}function Zc(e,t){return e.isDocumentFragment(t)}function eh(e,t,r){var i;let s={};for(let n=t;n<=r;++n){let a=(i=e[n])===null||i===void 0?void 0:i.key;a!==void 0&&(s[a]=n)}return s}var th=["create","update","remove","destroy","pre","post"];function rh(e,t,r){let i={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},s=Yc;for(let h of th)for(let m of e){let g=m[h];g!==void 0&&i[h].push(g)}function n(h){let m=h.id?"#"+h.id:"",g=h.getAttribute("class"),b=g?"."+g.split(" ").join("."):"";return Qe(s.tagName(h).toLowerCase()+m+b,{},[],void 0,h)}function a(h){return Qe(void 0,{},[],void 0,h)}function p(h,m){return function(){if(--m===0){let g=s.parentNode(h);g!==null&&s.removeChild(g,h)}}}function l(h,m){var g,b,y,_;let S,A=h.data;if(A!==void 0){let T=(g=A.hook)===null||g===void 0?void 0:g.init;re(T)&&(T(h),A=h.data)}let E=h.children,O=h.sel;if(O==="!")at(h.text)&&(h.text=""),h.elm=s.createComment(h.text);else if(O==="")h.elm=s.createTextNode(h.text);else if(O!==void 0){let T=O.indexOf("#"),V=O.indexOf(".",T),z=T>0?T:O.length,D=V>0?V:O.length,W=T!==-1||V!==-1?O.slice(0,Math.min(z,D)):O,X=h.elm=re(A)&&re(S=A.ns)?s.createElementNS(S,W,A):s.createElement(W,A);for(z<D&&X.setAttribute("id",O.slice(z+1,D)),V>0&&X.setAttribute("class",O.slice(D+1).replace(/\./g," ")),S=0;S<i.create.length;++S)i.create[S](Zt,h);if(ot(h.text)&&(!ft(E)||E.length===0)&&s.appendChild(X,s.createTextNode(h.text)),ft(E))for(S=0;S<E.length;++S){let be=E[S];be!=null&&s.appendChild(X,l(be,m))}let fe=h.data.hook;re(fe)&&((b=fe.create)===null||b===void 0||b.call(fe,Zt,h),fe.insert&&m.push(h))}else if(!((y=void 0)===null||y===void 0)&&y.fragments&&h.children){for(h.elm=((_=s.createDocumentFragment)!==null&&_!==void 0?_:Xc)(),S=0;S<i.create.length;++S)i.create[S](Zt,h);for(S=0;S<h.children.length;++S){let T=h.children[S];T!=null&&s.appendChild(h.elm,l(T,m))}}else h.elm=s.createTextNode(h.text);return h.elm}function o(h,m,g,b,y,_){for(;b<=y;++b){let S=g[b];S!=null&&s.insertBefore(h,l(S,_),m)}}function c(h){var m,g;let b=h.data;if(b!==void 0){(g=(m=b?.hook)===null||m===void 0?void 0:m.destroy)===null||g===void 0||g.call(m,h);for(let y=0;y<i.destroy.length;++y)i.destroy[y](h);if(h.children!==void 0)for(let y=0;y<h.children.length;++y){let _=h.children[y];_!=null&&typeof _!="string"&&c(_)}}}function d(h,m,g,b){for(var y,_;g<=b;++g){let S,A,E=m[g];if(E!=null)if(re(E.sel)){c(E),S=i.remove.length+1,A=p(E.elm,S);for(let T=0;T<i.remove.length;++T)i.remove[T](E,A);let O=(_=(y=E?.data)===null||y===void 0?void 0:y.hook)===null||_===void 0?void 0:_.remove;re(O)?O(E,A):A()}else E.children?(c(E),d(h,E.children,0,E.children.length-1)):s.removeChild(h,E.elm)}}function u(h,m,g,b){let y=0,_=0,S=m.length-1,A=m[0],E=m[S],O=g.length-1,T=g[0],V=g[O],z,D,W,X;for(;y<=S&&_<=O;)A==null?A=m[++y]:E==null?E=m[--S]:T==null?T=g[++_]:V==null?V=g[--O]:He(A,T)?(f(A,T,b),A=m[++y],T=g[++_]):He(E,V)?(f(E,V,b),E=m[--S],V=g[--O]):He(A,V)?(f(A,V,b),s.insertBefore(h,A.elm,s.nextSibling(E.elm)),A=m[++y],V=g[--O]):He(E,T)?(f(E,T,b),s.insertBefore(h,E.elm,A.elm),E=m[--S],T=g[++_]):(z===void 0&&(z=eh(m,y,S)),D=z[T.key],at(D)?(s.insertBefore(h,l(T,b),A.elm),T=g[++_]):at(z[V.key])?(s.insertBefore(h,l(V,b),s.nextSibling(E.elm)),V=g[--O]):(W=m[D],W.sel!==T.sel?s.insertBefore(h,l(T,b),A.elm):(f(W,T,b),m[D]=void 0,s.insertBefore(h,W.elm,A.elm)),T=g[++_]));_<=O&&(X=g[O+1]==null?null:g[O+1].elm,o(h,X,g,_,O,b)),y<=S&&d(h,m,y,S)}function f(h,m,g){var b,y,_,S,A,E,O,T;let V=(b=m.data)===null||b===void 0?void 0:b.hook;(y=V?.prepatch)===null||y===void 0||y.call(V,h,m);let z=m.elm=h.elm;if(h===m)return;if(m.data!==void 0||re(m.text)&&m.text!==h.text){(_=m.data)!==null&&_!==void 0||(m.data={}),(S=h.data)!==null&&S!==void 0||(h.data={});for(let X=0;X<i.update.length;++X)i.update[X](h,m);(O=(E=(A=m.data)===null||A===void 0?void 0:A.hook)===null||E===void 0?void 0:E.update)===null||O===void 0||O.call(E,h,m)}let D=h.children,W=m.children;at(m.text)?re(D)&&re(W)?D!==W&&u(z,D,W,g):re(W)?(re(h.text)&&s.setTextContent(z,""),o(z,null,W,0,W.length-1,g)):re(D)?d(z,D,0,D.length-1):re(h.text)&&s.setTextContent(z,""):h.text!==m.text&&(re(D)&&d(z,D,0,D.length-1),s.setTextContent(z,m.text)),(T=V?.postpatch)===null||T===void 0||T.call(V,h,m)}return function(h,m){let g,b,y,_=[];for(g=0;g<i.pre.length;++g)i.pre[g]();for(Qc(s,h)?h=n(h):Zc(s,h)&&(h=a(h)),He(h,m)?f(h,m,_):(b=h.elm,y=s.parentNode(b),l(m,_),y!==null&&(s.insertBefore(y,m.elm,s.nextSibling(b)),d(y,[h],0,0))),g=0;g<_.length;++g)_[g].data.hook.insert(_[g]);for(g=0;g<i.post.length;++g)i.post[g]();return m}}function ki(e,t){let r,i,s=t.elm,n=e.data.class,a=t.data.class;if(!(!n&&!a)&&n!==a){n=n||{},a=a||{};for(i in n)n[i]&&!Object.prototype.hasOwnProperty.call(a,i)&&s.classList.remove(i);for(i in a)r=a[i],r!==n[i]&&s.classList[r?"add":"remove"](i)}}var ih={create:ki,update:ki};function $i(e,t){let r,i,s,n=t.elm,a=e.data.props,p=t.data.props;if(!(!a&&!p)&&a!==p){a=a||{},p=p||{};for(r in p)i=p[r],s=a[r],s!==i&&(r!=="value"||n[r]!==i)&&(n[r]=i)}}var sh={create:$i,update:$i},nh="http://www.w3.org/1999/xlink",ah="http://www.w3.org/2000/xmlns/",oh="http://www.w3.org/XML/1998/namespace",Ci=58,lh=120,ph=109;function Ii(e,t){let r,i=t.elm,s=e.data.attrs,n=t.data.attrs;if(!(!s&&!n)&&s!==n){s=s||{},n=n||{};for(r in n){let a=n[r];s[r]!==a&&(a===!0?i.setAttribute(r,""):a===!1?i.removeAttribute(r):r.charCodeAt(0)!==lh?i.setAttribute(r,a):r.charCodeAt(3)===Ci?i.setAttributeNS(oh,r,a):r.charCodeAt(5)===Ci?r.charCodeAt(1)===ph?i.setAttributeNS(ah,r,a):i.setAttributeNS(nh,r,a):i.setAttribute(r,a))}for(r in s)r in n||i.removeAttribute(r)}}var dh={create:Ii,update:Ii},Ti=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,ch=function(e){Ti(function(){Ti(e)})},hr=!1;function hh(e,t,r){ch(function(){e[t]=r})}function Oi(e,t){let r,i,s=t.elm,n=e.data.style,a=t.data.style;if(!n&&!a||n===a)return;n=n||{},a=a||{};let p="delayed"in n;for(i in n)i in a||(i[0]==="-"&&i[1]==="-"?s.style.removeProperty(i):s.style[i]="");for(i in a)if(r=a[i],i==="delayed"&&a.delayed)for(let l in a.delayed)r=a.delayed[l],(!p||r!==n.delayed[l])&&hh(s.style,l,r);else i!=="remove"&&r!==n[i]&&(i[0]==="-"&&i[1]==="-"?s.style.setProperty(i,r):s.style[i]=r)}function uh(e){let t,r,i=e.elm,s=e.data.style;if(!(!s||!(t=s.destroy)))for(r in t)i.style[r]=t[r]}function fh(e,t){let r=e.data.style;if(!r||!r.remove){t();return}hr||(e.elm.offsetLeft,hr=!0);let i,s=e.elm,n=0,a=r.remove,p=0,l=[];for(i in a)l.push(i),s.style[i]=a[i];let o=getComputedStyle(s)["transition-property"].split(", ");for(;n<o.length;++n)l.indexOf(o[n])!==-1&&p++;s.addEventListener("transitionend",function(c){c.target===s&&--p,p===0&&t()})}function mh(){hr=!1}var yh={pre:mh,create:Oi,update:Oi,destroy:uh,remove:fh};function _s(e,t,r){if(typeof e=="function")e.call(t,r,t);else if(typeof e=="object")for(let i=0;i<e.length;i++)_s(e[i],t,r)}function gh(e,t){let r=e.type,i=t.data.on;i&&i[r]&&_s(i[r],t,e)}function bh(){return function e(t){gh(t,e.vnode)}}function er(e,t){let r=e.data.on,i=e.listener,s=e.elm,n=t&&t.data.on,a=t&&t.elm,p;if(r!==n){if(r&&i)if(n)for(p in r)n[p]||s.removeEventListener(p,i,!1);else for(p in r)s.removeEventListener(p,i,!1);if(n){let l=t.listener=e.listener||bh();if(l.vnode=t,r)for(p in n)r[p]||a.addEventListener(p,l,!1);else for(p in n)a.addEventListener(p,l,!1)}}}var vh={create:er,update:er,destroy:er},wh=()=>rh([ih,sh,dh,yh,vh]);function xs(e,t,r){if(e.ns="http://www.w3.org/2000/svg",r!=="foreignObject"&&t!==void 0)for(let i=0;i<t.length;++i){let s=t[i];if(typeof s=="string")continue;let n=s.data;n!==void 0&&xs(n,s.children,s.sel)}}function _h(e,t,r){let i={},s,n,a;if(r!==void 0?(t!==null&&(i=t),ft(r)?s=r:ot(r)?n=r.toString():r&&r.sel&&(s=[r])):t!=null&&(ft(t)?s=t:ot(t)?n=t.toString():t&&t.sel?s=[t]:i=t),s!==void 0)for(a=0;a<s.length;++a)ot(s[a])&&(s[a]=Qe(void 0,void 0,void 0,s[a],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&xs(i,s,e),Qe(e,i,s,n,void 0)}var xh=wh(),Sh=({handlers:e,methods:t,constants:r,schema:i,view:s,store:n},a)=>{if(!s)throw new Error("view is not defined");if(!i||typeof i!="object"||Array.isArray(i))throw new Error("schema is required. Define component metadata in .schema.yaml.");let p=i,{template:l,refs:o,styles:c}=s;sd({schema:p,methodExports:Object.keys(t||{})});let d=p.componentName,u=p.propsSchema,f=u?.properties?[...new Set(Object.keys(u.properties).map(h=>Yi(h)))]:[];return Rc({elementName:d,propsSchema:u,propsSchemaKeys:f,template:l,refs:o,styles:c,handlers:e,methods:t,constants:r,store:n,patch:xh,h:_h,deps:a})},Ah=e=>{let t={};return{once:(r,i)=>{t[r]||(t[r]=[]);let s=(...n)=>{i(...n),t[r]=t[r].filter(a=>a!==s)};t[r].push(s)},emit:(r,...i)=>{t[r]&&t[r].forEach(s=>{s(...i)})},showAlert:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showConfirm:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showFormDialog:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showDropdownMenu:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},closeAll:async()=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")}}},Eh=Ah(),kh={globalUI:Eh},$h={components:kh},Ch={componentName:"rtgl-accordion-item",propsSchema:{type:"object",properties:{label:{type:"string"},content:{type:"string"},w:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},Ih={refs:{header:{eventListeners:{click:{handler:"handleClickHeader"}}}},styles:{".content-wrapper":{display:"grid","grid-template-rows":"0fr",transition:"grid-template-rows 0.2s ease-out"},".content-wrapper.open":{"grid-template-rows":"1fr"},".content-inner":{overflow:"hidden"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=v ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c w=f pv=md cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-svg svg=${chevronIcon} wh=16 c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg svg=",{type:1,path:"chevronIcon"}," wh=16 c=mu-fg"]}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:'div class="${openClass}"',value:{type:9,items:[{type:8,properties:[{key:"div class=content-inner",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view pb=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"content"}}],fast:!0},{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['div class="',{type:1,path:"openClass"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=v ",{type:1,path:"containerAttrString"}]}}],fast:!0}],fast:!0}},Th={componentName:"rtgl-breadcrumb",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},href:{type:"string"},path:{type:"string"},current:{type:"boolean"},disabled:{type:"boolean"},click:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"}}}},sep:{type:"string",default:"breadcrumb-arrow"},max:{type:"number"}}},events:{"item-click":{type:"object",properties:{id:{type:"string"},path:{type:"string"},href:{type:"string"},item:{type:"object"},index:{type:"number"},trigger:{type:"string"}}}},methods:{type:"object",properties:{}}},Oh={refs:{"item*":{eventListeners:{click:{handler:"handleClickItem"}}}},styles:{a:{"text-decoration":"none",color:"inherit"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md p=sm ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isSeparator",value:{type:6,conditions:[{type:1,path:"item.isSeparator"},{type:1,path:"item.isEllipsis"},{type:4,op:6,left:{type:1,path:"item.isInteractive"},right:{type:1,path:"item.href"}},{type:1,path:"item.isInteractive"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${sep} c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"sep"}," c=mu-fg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#item${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#item",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#item${i} data-index=${item.index} cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#item",{type:1,path:"i"}," data-index=",{type:1,path:"item.index"}," cur=pointer"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md p=sm ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Lh={componentName:"rtgl-card",propsSchema:{type:"object",properties:{head:{type:"string"},desc:{type:"string"},size:{type:"string",enum:["sm","md","lg"]}}},events:[],methods:{type:"object",properties:{}}},Nh={styles:{":host":{display:"block"},slot:{display:"block","min-width":0},".rtgl-card-body":{"min-width":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="rtgl-card" d=v w=f bgc=bg bw=xs bc=bo br=xl shadow=sm ${cardAttrString} ${containerAttrString}',value:{type:9,items:[{type:8,properties:[{key:"$if hasHeader",value:{type:6,conditions:[{type:1,path:"hasHeader"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="rtgl-card-header" d=v w=f ${headerAttrString}',value:{type:9,items:[{type:8,properties:[{key:"$if head",value:{type:6,conditions:[{type:1,path:"head"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-text class="rtgl-card-heading" s=${headingSize} w=f',value:{type:1,path:"head"},parsedKey:{type:2,parts:['rtgl-text class="rtgl-card-heading" s=',{type:1,path:"headingSize"}," w=f"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if desc",value:{type:6,conditions:[{type:1,path:"desc"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-text class="rtgl-card-desc" s=${subheadingSize} c=mu-fg w=f',value:{type:1,path:"desc"},parsedKey:{type:2,parts:['rtgl-text class="rtgl-card-desc" s=',{type:1,path:"subheadingSize"}," c=mu-fg w=f"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:['rtgl-view class="rtgl-card-header" d=v w=f ',{type:1,path:"headerAttrString"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"div class=rtgl-card-body",value:{type:9,items:[{type:8,properties:[{key:"slot",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:['rtgl-view class="rtgl-card" d=v w=f bgc=bg bw=xs bc=bo br=xl shadow=sm ',{type:1,path:"cardAttrString"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Rh={componentName:"rtgl-dropdown-menu",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["label","item","separator"]},id:{type:"string"},path:{type:"string"},href:{type:"string"},disabled:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"},testId:{type:"string"}}}},open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},w:{type:"string"},h:{type:"string"}}},events:{close:{type:"object"},"item-click":{type:"object",properties:{index:{type:"number"},item:{type:"object"},id:{type:"string"},path:{type:"string"},href:{type:"string"},trigger:{type:"string"}}}},methods:{type:"object",properties:{}}},Vh={refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},styles:{a:{display:"block",width:"100%","text-decoration":"none",color:"inherit"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=${w} h=${h} sv g=xs slot=content bgc=mu br=md",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isLabel",value:{type:6,conditions:[{type:1,path:"item.isLabel"},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.isDisabled"}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:4,op:6,left:{type:1,path:"item.hasHref"},right:{type:1,path:"item.linkExtraAttrs"}}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.hasHref"}},{type:1,path:"item.isItem"},{type:1,path:"item.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f ph=lg pv=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f ph=lg pv=md br=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view w=f ph=lg pv=md br=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} ph=lg pv=md cur=pointer br=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} ph=lg pv=md cur=pointer br=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f h-bgc=${item.hoverBgc} ph=lg pv=md cur=pointer br=md bgc=${item.bgc} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f h-bgc=",{type:1,path:"item.hoverBgc"}," ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"item.bgc"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 ph=lg mv=md bgc=bo",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=",{type:1,path:"w"}," h=",{type:1,path:"h"}," sv g=xs slot=content bgc=mu br=md"]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," place=",{type:1,path:"place"}]}}],fast:!1}],fast:!1}},jh={componentName:"rtgl-form",propsSchema:{type:"object",properties:{form:{type:"object"},defaultValues:{type:"object"},context:{type:"object"},disabled:{type:"boolean"}}},events:{"form-input":{},"form-change":{},"form-field-event":{},"form-action":{}},methods:{type:"object",properties:{getValues:{type:"function"},setValues:{type:"function"},validate:{type:"function"},reset:{type:"function"}}}},Ph={refs:{formContainer:{eventListeners:{keydown:{handler:"handleKeyDown"}}},"action*":{eventListeners:{click:{handler:"handleActionClick"}}},"tooltipIcon*":{eventListeners:{mouseenter:{handler:"handleTooltipMouseEnter"},mouseleave:{handler:"handleTooltipMouseLeave"}}},"field*":{eventListeners:{"value-input":{handler:"handleValueInput"},"value-change":{handler:"handleValueChange"}}},"image*":{eventListeners:{click:{handler:"handleImageClick"},contextmenu:{handler:"handleImageClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#formContainer w=f p=md g=lg ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if title",value:{type:6,conditions:[{type:1,path:"title"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"title"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if description",value:{type:6,conditions:[{type:1,path:"description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view g=lg w=f",value:{type:9,items:[{type:7,itemVar:"field",indexVar:"i",iterable:{type:1,path:"flatFields"},body:{type:9,items:[{type:8,properties:[{key:"$if field._isSection",value:{type:6,conditions:[{type:1,path:"field._isSection"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"$if field.label",value:{type:6,conditions:[{type:1,path:"field.label"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=md",value:{type:1,path:"field.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.description",value:{type:6,conditions:[{type:1,path:"field.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if !field._isSection",value:{type:6,conditions:[{type:5,op:0,operand:{type:1,path:"field._isSection"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=f",value:{type:9,items:[{type:8,properties:[{key:"$if field.label || field.description",value:{type:6,conditions:[{type:4,op:7,left:{type:1,path:"field.label"},right:{type:1,path:"field.description"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=md av=c",value:{type:9,items:[{type:8,properties:[{key:"$if field.label",value:{type:6,conditions:[{type:1,path:"field.label"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"field.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.required",value:{type:6,conditions:[{type:1,path:"field.required"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=fg s=sm",value:{type:0,value:"*"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.tooltip",value:{type:6,conditions:[{type:1,path:"field.tooltip"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#tooltipIcon${field._idx} data-field-name=${field.name} svg="info" wh=16 c=mu-fg cur=help ml=xs',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg#tooltipIcon",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' svg="info" wh=16 c=mu-fg cur=help ml=xs']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if field.description",value:{type:6,conditions:[{type:1,path:"field.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#field${field._idx} data-field-name=${field.name} w=f type=${field._inputType} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f type=",{type:1,path:"field._inputType"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-date"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-date"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-date#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-date#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-time"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-time"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-time#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-time#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-datetime"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-datetime"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-datetime#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-datetime#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-number"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-number"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-textarea"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-textarea"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-textarea#field${field._idx} data-field-name=${field.name} w=f rows=${field.rows} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-textarea#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f rows=",{type:1,path:"field.rows"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-select#field${field._idx} data-field-name=${field.name} w=f :options=flatFields[${field._arrIdx}].options ?no-clear=${field.noClear} :selectedValue=flatFields[${field._arrIdx}]._selectedValue :placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=flatFields[",{type:1,path:"field._arrIdx"},"].options ?no-clear=",{type:1,path:"field.noClear"}," :selectedValue=flatFields[",{type:1,path:"field._arrIdx"},"]._selectedValue :placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "color-picker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"color-picker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#field${field._idx} data-field-name=${field.name} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slider"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slider-with-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slider-with-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider-input#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "popover-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"popover-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-popover-input#field${field._idx} data-field-name=${field.name} label="${field.label}" placeholder=${field.placeholder} ?disabled=${field._disabled}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-popover-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field.label"},'" placeholder=',{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "checkbox"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"checkbox"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-checkbox#field${field._idx} data-field-name=${field.name} label="${field._checkboxText}" ?disabled=${field._disabled}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-checkbox#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field._checkboxText"},'" ?disabled=',{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "image" && field._imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"image"}},right:{type:1,path:"field._imageSrc"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image#image${field._idx} data-field-name=${field.name} src=${field._imageSrc} w=${field.width} h=${field.height} cur=pointer",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image#image",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," src=",{type:1,path:"field._imageSrc"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=pointer"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "image" && !field._imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"image"}},right:{type:5,op:0,operand:{type:1,path:"field._imageSrc"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#image${field._idx} data-field-name=${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=pointer p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg ta=c",value:{type:1,path:"field.placeholderText"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#image",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," bc=ac bw=sm ah=c av=c cur=pointer p=md"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "read-only-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"read-only-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"field.content"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slot"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slot"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'slot#fieldSlot${field._idx} name=${field.slot} style="display: contents;"',value:{type:0,value:null},parsedKey:{type:2,parts:["slot#fieldSlot",{type:1,path:"field._idx"}," name=",{type:1,path:"field.slot"},' style="display: contents;"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field._error",value:{type:6,conditions:[{type:1,path:"field._error"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=de",value:{type:1,path:"field._error"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if actions.buttons.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"actions.buttons.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'$if actions._layout == "split"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"split"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h w=f g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._leftButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=sm ah=e w=1fg",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._rightButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if actions._layout == "vertical"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"vertical"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._allButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} w=f ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," w=f ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if actions._layout == "stretch"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"stretch"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._allButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} w=f ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," w=f ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'rtgl-tooltip ?open=${tooltipState.open} x=${tooltipState.x} y=${tooltipState.y} place="t" content="${tooltipState.content}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-tooltip ?open=",{type:1,path:"tooltipState.open"}," x=",{type:1,path:"tooltipState.x"}," y=",{type:1,path:"tooltipState.y"},' place="t" content="',{type:1,path:"tooltipState.content"},'"']}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#formContainer w=f p=md g=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Bh={componentName:"rtgl-global-ui",propsSchema:{type:"object",properties:{}},events:[],methods:{type:"object",properties:{}}},Dh={refs:{dialog:{eventListeners:{close:{handler:"handleDialogClose"}}},confirmButton:{eventListeners:{click:{handler:"handleConfirm"}}},cancelButton:{eventListeners:{click:{handler:"handleCancel"}}},formDialog:{eventListeners:{"form-action":{handler:"handleFormAction"},"form-field-event":{handler:"handleFormFieldEvent"}}},dropdownMenu:{eventListeners:{close:{handler:"handleDropdownClose"},"item-click":{handler:"handleDropdownItemClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-dialog#dialog ?open=${isDialogContainerOpen} s=${dialogSize}",value:{type:9,items:[{type:8,properties:[{key:"$if isFormDialogOpen",value:{type:6,conditions:[{type:1,path:"isFormDialogOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-form#formDialog slot=content :form=formDialogConfig.form :defaultValues=formDialogConfig.defaultValues :context=formDialogConfig.context ?disabled=${formDialogConfig.disabled} key=form-dialog-${formDialogConfig.key}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-form#formDialog slot=content :form=formDialogConfig.form :defaultValues=formDialogConfig.defaultValues :context=formDialogConfig.context ?disabled=",{type:1,path:"formDialogConfig.disabled"}," key=form-dialog-",{type:1,path:"formDialogConfig.key"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if !isFormDialogOpen",value:{type:6,conditions:[{type:5,op:0,operand:{type:1,path:"isFormDialogOpen"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if config.title",value:{type:6,conditions:[{type:1,path:"config.title"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"config.title"}}],fast:!0},{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=md mt=lg w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"$if config.mode == 'confirm'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"config.mode"},right:{type:0,value:"confirm"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-button#cancelButton v=se",value:{type:1,path:"config.cancelText"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-button#confirmButton v=pr",value:{type:1,path:"config.confirmText"}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-dialog#dialog ?open=",{type:1,path:"isDialogContainerOpen"}," s=",{type:1,path:"dialogSize"}]}}],fast:!1},{type:8,properties:[{key:"rtgl-dropdown-menu#dropdownMenu ?open=${isDropdownOpen} x=${dropdownConfig.x} y=${dropdownConfig.y} place=${dropdownConfig.place} :items=dropdownConfig.items key=dropdown-${isDropdownOpen}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-dropdown-menu#dropdownMenu ?open=",{type:1,path:"isDropdownOpen"}," x=",{type:1,path:"dropdownConfig.x"}," y=",{type:1,path:"dropdownConfig.y"}," place=",{type:1,path:"dropdownConfig.place"}," :items=dropdownConfig.items key=dropdown-",{type:1,path:"isDropdownOpen"}]}}],fast:!0}],fast:!1}},zh={componentName:"rtgl-navbar",propsSchema:{type:"object",properties:{start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}}}}}},events:{"start-click":{type:"object",properties:{path:{type:"string"}}}},methods:{type:"object",properties:{}}},Fh={refs:{start:{eventListeners:{click:{handler:"handleClickStart"}}}},anchors:[[{"rtgl-text s=lg":"${start.label}"},{"$if start.image && start.image.src":[{"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}":null}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view bgc=bg d=h h=48 av=c w=f ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if start.href",value:{type:6,conditions:[{type:1,path:"start.href"},{type:1,path:"start.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${start.href}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a href=",{type:1,path:"start.href"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#start d=h av=c g=md cur=pointer",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view d=h av=c g=lg",value:{type:9,items:[{type:8,properties:[{key:"slot name=right",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view bgc=bg d=h h=48 av=c w=f ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Wh={componentName:"rtgl-page-outline",propsSchema:{type:"object",properties:{targetId:{type:"string"},scrollContainerId:{type:"string"},offsetTop:{type:"string"}}},events:{onItemClick:{type:"object"}},methods:{type:"object",properties:{}}},Mh={refs:{},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=272 d=v pr=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1fg sv mt=xl",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view d=h bwl=xs bc="${item.bc}" pv=sm av=c href=${item.href} pl=md',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=${item.ml}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view w=",{type:1,path:"item.ml"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} h-c=fg",value:{type:1,path:"item.title"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," h-c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view d=h bwl=xs bc="',{type:1,path:"item.bc"},'" pv=sm av=c href=',{type:1,path:"item.href"}," pl=md"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}},Kh={componentName:"rtgl-popover-input",propsSchema:{type:"object",properties:{value:{type:"string"},placeholder:{type:"string"},label:{type:"string"},autoFocus:{type:"boolean"},disabled:{type:"boolean",default:!1}}},events:{"value-change":{}},methods:{type:"object",properties:{}}},Uh={refs:{textDisplay:{eventListeners:{click:{handler:"handleTextClick"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},input:{eventListeners:{"value-input":{handler:"handleInputChange"},keydown:{handler:"handleInputKeydown"}}},submit:{eventListeners:{click:{handler:"handleSubmitClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#textDisplay w=f cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${valueColor}",value:{type:1,path:"value"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"valueColor"}]}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=240 slot=content bgc=mu br=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-input#input w=f placeholder=${placeholder} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=f placeholder=",{type:1,path:"placeholder"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#submit ?disabled=${disabled}",value:{type:0,value:"Submit"},parsedKey:{type:2,parts:["rtgl-button#submit ?disabled=",{type:1,path:"disabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}]}}],fast:!0}],fast:!0}},Hh={componentName:"rtgl-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"any"},testId:{type:"string"}}}},selectedValue:{type:"any"},onChange:{type:"function"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}},qh={refs:{selectButton:{eventListeners:{click:{handler:"handleButtonClick"}}},clearButton:{eventListeners:{click:{handler:"handleClearClick"}}},popover:{eventListeners:{close:{handler:"handleClickOptionsPopoverOverlay"}}},"option*":{eventListeners:{click:{handler:"handleOptionClick"},mouseenter:{handler:"handleOptionMouseEnter"},mouseleave:{handler:"handleOptionMouseLeave"}}},optionAdd:{eventListeners:{click:{handler:"handleAddOptionClick"},mouseenter:{handler:"handleAddOptionMouseEnter"},mouseleave:{handler:"handleAddOptionMouseLeave"}}}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-button#selectButton v=ol ${containerAttrString} ?disabled=${isDisabled} data-testid="select-button"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c ah=s w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text w=1fg ta=s c=${selectedLabelColor} ellipsis",value:{type:1,path:"selectedLabel"},parsedKey:{type:2,parts:["rtgl-text w=1fg ta=s c=",{type:1,path:"selectedLabelColor"}," ellipsis"]}}],fast:!0},{type:8,properties:[{key:"$if showClear",value:{type:6,conditions:[{type:1,path:"showClear"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#clearButton ml=md svg=x wh=16 c=mu-fg cur=pointer data-testid="select-clear-button"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-svg ml=md svg=chevronDown wh=16 c=mu-fg",value:{type:0,value:null}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-button#selectButton v=ol ",{type:1,path:"containerAttrString"}," ?disabled=",{type:1,path:"isDisabled"},' data-testid="select-button"']}}],fast:!1},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=rs",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=mu br=md sv=true",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f ph=lg pv=md cur=pointer br=md bgc=${option.bgc} data-testid=${option.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text ta=s",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"option.bgc"}," data-testid=",{type:1,path:"option.testId"}]}}],fast:!0}],fast:!0},flatten:!0},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f bw=xs bc=mu bwt=sm",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-view#optionAdd w=f ph=lg pv=md cur=pointer br=md bgc=${addOptionBgc} data-testid="select-add-option"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=ac",value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#optionAdd w=f ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"addOptionBgc"},' data-testid="select-add-option"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," place=rs"]}}],fast:!1}],fast:!1}},Gh={componentName:"rtgl-sidebar",propsSchema:{type:"object",properties:{mode:{type:"string"},hideHeader:{type:"boolean",default:!1},w:{type:"string"},bwr:{type:"string"},selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},testId:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},items:{type:"array"},testId:{type:"string"}}}}}},events:{"header-click":{type:"object",properties:{path:{type:"string"}}},"item-click":{type:"object",properties:{item:{type:"object"}}}},methods:{type:"object",properties:{}}},Jh={refs:{headerImage:{eventListeners:{click:{handler:"handleHeaderClick"}}},headerLabel:{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item*":{eventListeners:{click:{handler:"handleItemClick"}}}},anchors:[[{"$if header.image && header.image.src":[{"$if header.image.href":[{"a href=${header.image.href}":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],"$elif header.image.path":[{"rtgl-view#headerImage cur=pointer":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],$else:[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}]},{"$if header.label && showLabels":[{"$if header.labelHref":[{"rtgl-text href=${header.labelHref} s=lg":"${header.label}"}],"$elif header.labelPath":[{"rtgl-view#headerLabel cur=pointer":[{"rtgl-text s=lg":"${header.label}"}]}],$else:[{"rtgl-text s=lg":"${header.label}"}]}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=${sidebarWidth} d=v bwr=${rightBorderWidth} ah=${ah} ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if showHeader",value:{type:6,conditions:[{type:1,path:"showHeader"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view ph=${headerPadding} pv=lg",value:{type:9,items:[{type:8,properties:[{key:"$if header.href",value:{type:6,conditions:[{type:1,path:"header.href"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view href=${header.href} d=h av=c ah=${headerAlign} g=lg w=${headerWidth}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerImage cur=pointer",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerLabel cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view href=",{type:1,path:"header.href"}," d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c ah=${headerAlign} g=lg w=${headerWidth} cur=pointer data-testid=${header.testId}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerImage cur=pointer",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerLabel cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#header d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}," cur=pointer data-testid=",{type:1,path:"header.testId"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view ph=",{type:1,path:"headerPadding"}," pv=lg"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=f h=1fg sv ph=${headerPadding} pb=lg g=xs ah=${ah}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'$if item.type == "groupLabel"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"groupLabel"}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showGroupLabels",value:{type:6,conditions:[{type:1,path:"showGroupLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=32 av=c ph=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=1 bgc=mu",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#item${i} data-item-id=${item.id} ${item.hrefAttr} h=${itemHeight} av=c ${itemAlignAttr} ph=${itemPadding} w=${itemWidth} h-bgc=${item.itemHoverBgc} br=lg bgc=${item.itemBgc} cur=pointer data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"$if item.icon",value:{type:6,conditions:[{type:1,path:"item.icon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=${itemContentAlign} g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h ah=",{type:1,path:"itemContentAlign"}," g=sm"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=${iconSize} svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=",{type:1,path:"iconSize"}," svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=${iconSize} br=f bgc=mu av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=${firstLetterSize} c=fg",value:{type:1,path:"item.title.charAt(0).toUpperCase()"},parsedKey:{type:2,parts:["rtgl-text s=",{type:1,path:"firstLetterSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view wh=",{type:1,path:"iconSize"}," br=f bgc=mu av=c ah=c"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#item",{type:1,path:"i"}," data-item-id=",{type:1,path:"item.id"}," ",{type:1,path:"item.hrefAttr"}," h=",{type:1,path:"itemHeight"}," av=c ",{type:1,path:"itemAlignAttr"}," ph=",{type:1,path:"itemPadding"}," w=",{type:1,path:"itemWidth"}," h-bgc=",{type:1,path:"item.itemHoverBgc"}," br=lg bgc=",{type:1,path:"item.itemBgc"}," cur=pointer data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=1fg sv ph=",{type:1,path:"headerPadding"}," pb=lg g=xs ah=",{type:1,path:"ah"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{type:1,path:"sidebarWidth"}," d=v bwr=",{type:1,path:"rightBorderWidth"}," ah=",{type:1,path:"ah"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Yh={componentName:"rtgl-slider-input",propsSchema:{type:"object",properties:{key:{type:"string"},value:{type:"string",default:"0"},w:{type:"string",default:""},min:{type:"string",default:"0"},max:{type:"string",default:"100"},step:{type:"string",default:"1"},disabled:{type:"boolean",default:!1}}},events:{"value-input":{},"value-change":{}},methods:{type:"object",properties:{}}},Xh={refs:{input:{eventListeners:{"value-input":{handler:"handleValueInput"},"value-change":{handler:"handleValueChange"}}},slider:{eventListeners:{"value-change":{handler:"handleValueChange"},"value-input":{handler:"handleValueInput"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=${w}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-slider#slider key=${key} w=f type=range min=${min} max=${max} step=${step} value=${value} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider key=",{type:1,path:"key"}," w=f type=range min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=84",value:{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#input key=${key} w=f min=${min} max=${max} step=${step} value=${value} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#input key=",{type:1,path:"key"}," w=f min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md w=",{type:1,path:"w"}]}}],fast:!0}],fast:!0}},Qh={componentName:"rtgl-table",propsSchema:{type:"object",properties:{data:{type:"object",properties:{columns:{type:"array",items:{type:"object",properties:{key:{type:"string"},label:{type:"string"}}}},rows:{type:"array",items:{type:"object"}}}},responsive:{type:"boolean",default:!0}}},events:{},methods:{type:"object",properties:{}}},Zh={refs:{"row*":{eventListeners:{click:{handler:"handleRowClick"}}},"header*":{eventListeners:{click:{handler:"handleHeaderClick"}}}},styles:{table:{width:"100%","border-collapse":"collapse","border-spacing":0},thead:{"border-bottom":"2px solid var(--border)"},th:{padding:"12px","text-align":"left","font-weight":500,color:"var(--foreground)","background-color":"var(--muted)",cursor:"pointer",position:"sticky",top:0,"z-index":1},"tbody tr":{"border-bottom":"1px solid var(--border)"},"tbody tr:last-child":{"border-bottom":"none"},td:{padding:"12px",color:"var(--foreground)"},".table-container":{width:"100%",height:"100%",overflow:"auto"},".empty-state":{"text-align":"center",padding:"24px",color:"var(--muted-foreground)"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view.table-container ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if rows.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"rows.length"},right:{type:0,value:0}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"table",value:{type:9,items:[{type:8,properties:[{key:"thead",value:{type:9,items:[{type:8,properties:[{key:"tr",value:{type:9,items:[{type:7,itemVar:"column",indexVar:"i",iterable:{type:1,path:"columns"},body:{type:9,items:[{type:8,properties:[{key:"th#header${i} data-column-key=${column.key}",value:{type:1,path:"column.label"},parsedKey:{type:2,parts:["th#header",{type:1,path:"i"}," data-column-key=",{type:1,path:"column.key"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"tbody",value:{type:9,items:[{type:7,itemVar:"row",indexVar:"rowIndex",iterable:{type:1,path:"rows"},body:{type:9,items:[{type:8,properties:[{key:"tr#row${rowIndex}",value:{type:9,items:[{type:7,itemVar:"cell",indexVar:"cellIndex",iterable:{type:1,path:"row.cells"},body:{type:9,items:[{type:8,properties:[{key:"td",value:{type:1,path:"cell.value"}}],fast:!0}],fast:!0},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["tr#row",{type:1,path:"rowIndex"}]}}],fast:!1}],fast:!1},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view.empty-state w=f p=xl",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"No data available"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view.table-container ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},eu={componentName:"rtgl-tabs",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},testId:{type:"string"}}}},selectedTab:{type:"string"}}},events:{"item-click":{type:"object",properties:{id:{type:"string"}}}},methods:{type:"object",properties:{}}},tu={refs:{"tab*":{eventListeners:{click:{handler:"handleClickItem"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm bgc=mu p=sm br=lg ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#tab${i} data-id=${item.id} cur=pointer bgc=${item.bgColor} bw=xs bc=${item.borderColor} pv=md ph=lg br=lg data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.textColor}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.textColor"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#tab",{type:1,path:"i"}," data-id=",{type:1,path:"item.id"}," cur=pointer bgc=",{type:1,path:"item.bgColor"}," bw=xs bc=",{type:1,path:"item.borderColor"}," pv=md ph=lg br=lg data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h g=sm bgc=mu p=sm br=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},ru={componentName:"rtgl-tooltip",propsSchema:{type:"object",properties:{open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},content:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},iu={template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} no-overlay",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content bgc=bg bc=bo br=md p=sm ah=c av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text ta=c s=sm c=fg",value:{type:1,path:"content"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," place=",{type:1,path:"place"}," no-overlay"]}}],fast:!0}],fast:!0},refs:{}},su={componentName:"rtgl-waveform",propsSchema:{type:"object",properties:{w:{type:"string",description:"Width of the waveform visualizer",default:"250"},h:{type:"string",description:"Height of the waveform visualizer",default:"150"},cur:{type:"string",description:"cursor"},waveformData:{type:"object",description:"File ID of the waveform data in object storage"},isLoading:{type:"boolean",description:"Whether the waveform data is currently being loaded"}}},events:[],methods:{type:"object",properties:{}}},nu={refs:{canvas:{selector:"canvas"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view pos=rel w=${w} h=${h} cur=${cur}",value:{type:9,items:[{type:8,properties:[{key:"$if isLoading",value:{type:6,conditions:[{type:1,path:"isLoading"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"..."}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'canvas#canvas style="width:100%; height:100%;"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view pos=rel w=",{type:1,path:"w"}," h=",{type:1,path:"h"}," cur=",{type:1,path:"cur"}]}}],fast:!1}],fast:!1}},x={};x.components={};x.components.accordionItem={};x.components.accordionItem.handlers=ln;x.components.accordionItem.schema=Ch;x.components.accordionItem.store=fn;x.components.accordionItem.view=Ih;x.components.breadcrumb={};x.components.breadcrumb.handlers=yn;x.components.breadcrumb.schema=Th;x.components.breadcrumb.store=En;x.components.breadcrumb.view=Oh;x.components.card={};x.components.card.schema=Lh;x.components.card.store=Tn;x.components.card.view=Nh;x.components.dropdownMenu={};x.components.dropdownMenu.handlers=Nn;x.components.dropdownMenu.schema=Rh;x.components.dropdownMenu.store=Bn;x.components.dropdownMenu.view=Vh;x.components.form={};x.components.form.handlers=no;x.components.form.methods=yo;x.components.form.schema=jh;x.components.form.store=qa;x.components.form.view=Ph;x.components.globalUi={};x.components.globalUi.handlers=Oo;x.components.globalUi.schema=Bh;x.components.globalUi.store=Uo;x.components.globalUi.view=Dh;x.components.navbar={};x.components.navbar.handlers=qo;x.components.navbar.schema=zh;x.components.navbar.store=tl;x.components.navbar.view=Fh;x.components.pageOutline={};x.components.pageOutline.handlers=sl;x.components.pageOutline.schema=Wh;x.components.pageOutline.store=hl;x.components.pageOutline.view=Mh;x.components.popoverInput={};x.components.popoverInput.handlers=wl;x.components.popoverInput.schema=Kh;x.components.popoverInput.store=Cl;x.components.popoverInput.view=Uh;x.components.select={};x.components.select.handlers=zl;x.components.select.schema=Hh;x.components.select.store=tp;x.components.select.view=qh;x.components.sidebar={};x.components.sidebar.handlers=sp;x.components.sidebar.schema=Gh;x.components.sidebar.store=mp;x.components.sidebar.view=Jh;x.components.sliderInput={};x.components.sliderInput.handlers=wp;x.components.sliderInput.schema=Yh;x.components.sliderInput.store=Ap;x.components.sliderInput.view=Xh;x.components.table={};x.components.table.handlers=Cp;x.components.table.schema=Qh;x.components.table.store=Bp;x.components.table.view=Zh;x.components.tabs={};x.components.tabs.handlers=zp;x.components.tabs.schema=eu;x.components.tabs.store=Up;x.components.tabs.view=tu;x.components.tooltip={};x.components.tooltip.handlers=Hp;x.components.tooltip.schema=ru;x.components.tooltip.store=Jp;x.components.tooltip.view=iu;x.components.waveform={};x.components.waveform.handlers=Qp;x.components.waveform.schema=su;x.components.waveform.store=rd;x.components.waveform.view=nu;Object.keys(x).forEach(e=>{Object.keys(x[e]).forEach(t=>{let r=x[e][t],i=Sh({...r},$h[e]),s=r.schema?.componentName;if(!s)throw new Error(`[Build] Missing schema.componentName for ${e}/${t}. Define it in .schema.yaml.`);customElements.define(s,i)})});customElements.define("rtgl-button",$r({}));customElements.define("rtgl-carousel",Lr({}));customElements.define("rtgl-grid",Nr({}));customElements.define("rtgl-view",Vr({}));customElements.define("rtgl-text",Pr({}));customElements.define("rtgl-image",zr({}));customElements.define("rtgl-tag",Wr({}));customElements.define("rtgl-svg",Kr({}));customElements.define("rtgl-input",ye({}));customElements.define("rtgl-input-date",Ur({}));customElements.define("rtgl-input-time",Hr({}));customElements.define("rtgl-input-datetime",qr({}));customElements.define("rtgl-input-number",Gr({}));customElements.define("rtgl-textarea",Jr({}));customElements.define("rtgl-color-picker",Yr({}));customElements.define("rtgl-slider",Xr({}));customElements.define("rtgl-checkbox",Qr({}));customElements.define("rtgl-dialog",Zr({}));customElements.define("rtgl-popover",ei({}));})();
1501
+ `,Oc=({host:e,cssText:t,createStyleSheet:r=()=>new CSSStyleSheet,createElement:i=s=>document.createElement(s)})=>{let s=e.attachShadow({mode:"open"}),n=r();n.replaceSync(Tc);let a=[n];if(t){let l=r();l.replaceSync(t),a.push(l)}s.adoptedStyleSheets=a;let p=i("div");return p.style.cssText="display: contents;",s.appendChild(p),p.parentNode||e.appendChild(p),e.style.display="contents",{shadow:s,renderTarget:p,adoptedStyleSheets:a}},vs=(e,t=requestAnimationFrame)=>t(e),Lc=({scheduleFrameFn:e=vs}={})=>({update:(t,r)=>{let i=t.data?.props||{},s=r.data?.props||{};if(JSON.stringify(i)===JSON.stringify(s))return;let n=r.elm;!n||typeof n.render!="function"||(n.setAttribute("isDirty","true"),e(()=>{if(n.render(),n.removeAttribute("isDirty"),n.handlers&&n.handlers.handleOnUpdate){let a={...n.deps,store:n.store,render:n.render.bind(n),handlers:n.handlers,dispatchEvent:n.dispatchEvent.bind(n),refs:n.refIds||{}};n.handlers.handleOnUpdate(a,{oldProps:i,newProps:s})}}))}}),Nc=({elementName:e,propsSchema:t,propsSchemaKeys:r,template:i,refs:s,styles:n,handlers:a,methods:p,constants:l,store:o,patch:c,h:d,deps:u})=>{class f extends HTMLElement{elementName;styles;_snabbdomH;store;props;propsSchema;template;handlers;methods;constants;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_globalListenersCleanup;_oldVNode;deps;_propsSchemaKeys=[];cssText;static get observedAttributes(){return["key"]}get viewData(){let y={};return this.store.selectViewData&&(y=this.store.selectViewData()),y}connectedCallback(){let y=Oc({host:this,cssText:this.cssText});this.shadow=y.shadow,this.renderTarget=y.renderTarget,kc({instance:this,parseAndRenderFn:as,renderFn:this.render})}disconnectedCallback(){$c({instance:this,clearTimerFn:clearTimeout})}attributeChangedCallback(y,b,g){Cc({instance:this,attributeName:y,oldValue:b,newValue:g,scheduleFrameFn:vs})}render=()=>{Ic({instance:this,createComponentUpdateHookFn:Lc})}}class h extends f{static get observedAttributes(){return xc({propsSchemaKeys:r,toKebabCase:Ji})}constructor(){super(),this.constants=Jd({setupConstants:u?.constants,fileConstants:l}),this.propsSchema=t,this.props=t?rd(this,r):{},this._propsSchemaKeys=r,this.elementName=e,this.styles=n,this.store=Gd(o,this.props,this.constants),this.template=i,this.handlers=a,this.methods=p,this.refs=s,this.patch=c,this.deps={...u,store:this.store,render:this.render,handlers:a,props:this.props,constants:this.constants},jd(this,this.methods),this._snabbdomH=d,this.cssText=Yd(e,n)}}return h};function Xe(e,t,r,i,s){let n=t===void 0?void 0:t.key;return{sel:e,data:t,children:r,text:i,elm:s,key:n}}var ft=Array.isArray;function ot(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function Rc(e,t){return document.createElement(e,t)}function Vc(e,t,r){return document.createElementNS(e,t,r)}function jc(){return xe(document.createDocumentFragment())}function Pc(e){return document.createTextNode(e)}function Bc(e){return document.createComment(e)}function Dc(e,t,r){if(ue(e)){let i=e;for(;i&&ue(i);)i=xe(i).parent;e=i??e}ue(t)&&(t=xe(t,e)),r&&ue(r)&&(r=xe(r).firstChildNode),e.insertBefore(t,r)}function zc(e,t){e.removeChild(t)}function Fc(e,t){ue(t)&&(t=xe(t,e)),e.appendChild(t)}function ws(e){if(ue(e)){for(;e&&ue(e);)e=xe(e).parent;return e??null}return e.parentNode}function Wc(e){var t;if(ue(e)){let r=xe(e),i=ws(r);if(i&&r.lastChildNode){let s=Array.from(i.childNodes),n=s.indexOf(r.lastChildNode);return(t=s[n+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function Mc(e){return e.tagName}function Kc(e,t){e.textContent=t}function Uc(e){return e.textContent}function Hc(e){return e.nodeType===1}function qc(e){return e.nodeType===3}function Gc(e){return e.nodeType===8}function ue(e){return e.nodeType===11}function xe(e,t){var r,i,s;let n=e;return(r=n.parent)!==null&&r!==void 0||(n.parent=t??null),(i=n.firstChildNode)!==null&&i!==void 0||(n.firstChildNode=e.firstChild),(s=n.lastChildNode)!==null&&s!==void 0||(n.lastChildNode=e.lastChild),n}var Jc={createElement:Rc,createElementNS:Vc,createTextNode:Pc,createDocumentFragment:jc,createComment:Bc,insertBefore:Dc,removeChild:zc,appendChild:Fc,parentNode:ws,nextSibling:Wc,tagName:Mc,setTextContent:Kc,getTextContent:Uc,isElement:Hc,isText:qc,isComment:Gc,isDocumentFragment:ue};function at(e){return e===void 0}function re(e){return e!==void 0}var Zt=Xe("",{},[],void 0,void 0);function Ue(e,t){var r,i;let s=e.key===t.key,n=((r=e.data)===null||r===void 0?void 0:r.is)===((i=t.data)===null||i===void 0?void 0:i.is),a=e.sel===t.sel,p=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return a&&s&&n&&p}function Yc(){throw new Error("The document fragment is not supported on this platform.")}function Xc(e,t){return e.isElement(t)}function Qc(e,t){return e.isDocumentFragment(t)}function Zc(e,t,r){var i;let s={};for(let n=t;n<=r;++n){let a=(i=e[n])===null||i===void 0?void 0:i.key;a!==void 0&&(s[a]=n)}return s}var eh=["create","update","remove","destroy","pre","post"];function th(e,t,r){let i={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},s=Jc;for(let h of eh)for(let m of e){let y=m[h];y!==void 0&&i[h].push(y)}function n(h){let m=h.id?"#"+h.id:"",y=h.getAttribute("class"),b=y?"."+y.split(" ").join("."):"";return Xe(s.tagName(h).toLowerCase()+m+b,{},[],void 0,h)}function a(h){return Xe(void 0,{},[],void 0,h)}function p(h,m){return function(){if(--m===0){let y=s.parentNode(h);y!==null&&s.removeChild(y,h)}}}function l(h,m){var y,b,g,_;let S,A=h.data;if(A!==void 0){let O=(y=A.hook)===null||y===void 0?void 0:y.init;re(O)&&(O(h),A=h.data)}let E=h.children,T=h.sel;if(T==="!")at(h.text)&&(h.text=""),h.elm=s.createComment(h.text);else if(T==="")h.elm=s.createTextNode(h.text);else if(T!==void 0){let O=T.indexOf("#"),V=T.indexOf(".",O),z=O>0?O:T.length,D=V>0?V:T.length,Y=O!==-1||V!==-1?T.slice(0,Math.min(z,D)):T,X=h.elm=re(A)&&re(S=A.ns)?s.createElementNS(S,Y,A):s.createElement(Y,A);for(z<D&&X.setAttribute("id",T.slice(z+1,D)),V>0&&X.setAttribute("class",T.slice(D+1).replace(/\./g," ")),S=0;S<i.create.length;++S)i.create[S](Zt,h);if(ot(h.text)&&(!ft(E)||E.length===0)&&s.appendChild(X,s.createTextNode(h.text)),ft(E))for(S=0;S<E.length;++S){let be=E[S];be!=null&&s.appendChild(X,l(be,m))}let fe=h.data.hook;re(fe)&&((b=fe.create)===null||b===void 0||b.call(fe,Zt,h),fe.insert&&m.push(h))}else if(!((g=void 0)===null||g===void 0)&&g.fragments&&h.children){for(h.elm=((_=s.createDocumentFragment)!==null&&_!==void 0?_:Yc)(),S=0;S<i.create.length;++S)i.create[S](Zt,h);for(S=0;S<h.children.length;++S){let O=h.children[S];O!=null&&s.appendChild(h.elm,l(O,m))}}else h.elm=s.createTextNode(h.text);return h.elm}function o(h,m,y,b,g,_){for(;b<=g;++b){let S=y[b];S!=null&&s.insertBefore(h,l(S,_),m)}}function c(h){var m,y;let b=h.data;if(b!==void 0){(y=(m=b?.hook)===null||m===void 0?void 0:m.destroy)===null||y===void 0||y.call(m,h);for(let g=0;g<i.destroy.length;++g)i.destroy[g](h);if(h.children!==void 0)for(let g=0;g<h.children.length;++g){let _=h.children[g];_!=null&&typeof _!="string"&&c(_)}}}function d(h,m,y,b){for(var g,_;y<=b;++y){let S,A,E=m[y];if(E!=null)if(re(E.sel)){c(E),S=i.remove.length+1,A=p(E.elm,S);for(let O=0;O<i.remove.length;++O)i.remove[O](E,A);let T=(_=(g=E?.data)===null||g===void 0?void 0:g.hook)===null||_===void 0?void 0:_.remove;re(T)?T(E,A):A()}else E.children?(c(E),d(h,E.children,0,E.children.length-1)):s.removeChild(h,E.elm)}}function u(h,m,y,b){let g=0,_=0,S=m.length-1,A=m[0],E=m[S],T=y.length-1,O=y[0],V=y[T],z,D,Y,X;for(;g<=S&&_<=T;)A==null?A=m[++g]:E==null?E=m[--S]:O==null?O=y[++_]:V==null?V=y[--T]:Ue(A,O)?(f(A,O,b),A=m[++g],O=y[++_]):Ue(E,V)?(f(E,V,b),E=m[--S],V=y[--T]):Ue(A,V)?(f(A,V,b),s.insertBefore(h,A.elm,s.nextSibling(E.elm)),A=m[++g],V=y[--T]):Ue(E,O)?(f(E,O,b),s.insertBefore(h,E.elm,A.elm),E=m[--S],O=y[++_]):(z===void 0&&(z=Zc(m,g,S)),D=z[O.key],at(D)?(s.insertBefore(h,l(O,b),A.elm),O=y[++_]):at(z[V.key])?(s.insertBefore(h,l(V,b),s.nextSibling(E.elm)),V=y[--T]):(Y=m[D],Y.sel!==O.sel?s.insertBefore(h,l(O,b),A.elm):(f(Y,O,b),m[D]=void 0,s.insertBefore(h,Y.elm,A.elm)),O=y[++_]));_<=T&&(X=y[T+1]==null?null:y[T+1].elm,o(h,X,y,_,T,b)),g<=S&&d(h,m,g,S)}function f(h,m,y){var b,g,_,S,A,E,T,O;let V=(b=m.data)===null||b===void 0?void 0:b.hook;(g=V?.prepatch)===null||g===void 0||g.call(V,h,m);let z=m.elm=h.elm;if(h===m)return;if(m.data!==void 0||re(m.text)&&m.text!==h.text){(_=m.data)!==null&&_!==void 0||(m.data={}),(S=h.data)!==null&&S!==void 0||(h.data={});for(let X=0;X<i.update.length;++X)i.update[X](h,m);(T=(E=(A=m.data)===null||A===void 0?void 0:A.hook)===null||E===void 0?void 0:E.update)===null||T===void 0||T.call(E,h,m)}let D=h.children,Y=m.children;at(m.text)?re(D)&&re(Y)?D!==Y&&u(z,D,Y,y):re(Y)?(re(h.text)&&s.setTextContent(z,""),o(z,null,Y,0,Y.length-1,y)):re(D)?d(z,D,0,D.length-1):re(h.text)&&s.setTextContent(z,""):h.text!==m.text&&(re(D)&&d(z,D,0,D.length-1),s.setTextContent(z,m.text)),(O=V?.postpatch)===null||O===void 0||O.call(V,h,m)}return function(h,m){let y,b,g,_=[];for(y=0;y<i.pre.length;++y)i.pre[y]();for(Xc(s,h)?h=n(h):Qc(s,h)&&(h=a(h)),Ue(h,m)?f(h,m,_):(b=h.elm,g=s.parentNode(b),l(m,_),g!==null&&(s.insertBefore(g,m.elm,s.nextSibling(b)),d(g,[h],0,0))),y=0;y<_.length;++y)_[y].data.hook.insert(_[y]);for(y=0;y<i.post.length;++y)i.post[y]();return m}}function ki(e,t){let r,i,s=t.elm,n=e.data.class,a=t.data.class;if(!(!n&&!a)&&n!==a){n=n||{},a=a||{};for(i in n)n[i]&&!Object.prototype.hasOwnProperty.call(a,i)&&s.classList.remove(i);for(i in a)r=a[i],r!==n[i]&&s.classList[r?"add":"remove"](i)}}var rh={create:ki,update:ki};function $i(e,t){let r,i,s,n=t.elm,a=e.data.props,p=t.data.props;if(!(!a&&!p)&&a!==p){a=a||{},p=p||{};for(r in p)i=p[r],s=a[r],s!==i&&(r!=="value"||n[r]!==i)&&(n[r]=i)}}var ih={create:$i,update:$i},sh="http://www.w3.org/1999/xlink",nh="http://www.w3.org/2000/xmlns/",ah="http://www.w3.org/XML/1998/namespace",Ci=58,oh=120,lh=109;function Ii(e,t){let r,i=t.elm,s=e.data.attrs,n=t.data.attrs;if(!(!s&&!n)&&s!==n){s=s||{},n=n||{};for(r in n){let a=n[r];s[r]!==a&&(a===!0?i.setAttribute(r,""):a===!1?i.removeAttribute(r):r.charCodeAt(0)!==oh?i.setAttribute(r,a):r.charCodeAt(3)===Ci?i.setAttributeNS(ah,r,a):r.charCodeAt(5)===Ci?r.charCodeAt(1)===lh?i.setAttributeNS(nh,r,a):i.setAttributeNS(sh,r,a):i.setAttribute(r,a))}for(r in s)r in n||i.removeAttribute(r)}}var ph={create:Ii,update:Ii},Ti=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,dh=function(e){Ti(function(){Ti(e)})},hr=!1;function ch(e,t,r){dh(function(){e[t]=r})}function Oi(e,t){let r,i,s=t.elm,n=e.data.style,a=t.data.style;if(!n&&!a||n===a)return;n=n||{},a=a||{};let p="delayed"in n;for(i in n)i in a||(i[0]==="-"&&i[1]==="-"?s.style.removeProperty(i):s.style[i]="");for(i in a)if(r=a[i],i==="delayed"&&a.delayed)for(let l in a.delayed)r=a.delayed[l],(!p||r!==n.delayed[l])&&ch(s.style,l,r);else i!=="remove"&&r!==n[i]&&(i[0]==="-"&&i[1]==="-"?s.style.setProperty(i,r):s.style[i]=r)}function hh(e){let t,r,i=e.elm,s=e.data.style;if(!(!s||!(t=s.destroy)))for(r in t)i.style[r]=t[r]}function uh(e,t){let r=e.data.style;if(!r||!r.remove){t();return}hr||(e.elm.offsetLeft,hr=!0);let i,s=e.elm,n=0,a=r.remove,p=0,l=[];for(i in a)l.push(i),s.style[i]=a[i];let o=getComputedStyle(s)["transition-property"].split(", ");for(;n<o.length;++n)l.indexOf(o[n])!==-1&&p++;s.addEventListener("transitionend",function(c){c.target===s&&--p,p===0&&t()})}function fh(){hr=!1}var mh={pre:fh,create:Oi,update:Oi,destroy:hh,remove:uh};function _s(e,t,r){if(typeof e=="function")e.call(t,r,t);else if(typeof e=="object")for(let i=0;i<e.length;i++)_s(e[i],t,r)}function yh(e,t){let r=e.type,i=t.data.on;i&&i[r]&&_s(i[r],t,e)}function gh(){return function e(t){yh(t,e.vnode)}}function er(e,t){let r=e.data.on,i=e.listener,s=e.elm,n=t&&t.data.on,a=t&&t.elm,p;if(r!==n){if(r&&i)if(n)for(p in r)n[p]||s.removeEventListener(p,i,!1);else for(p in r)s.removeEventListener(p,i,!1);if(n){let l=t.listener=e.listener||gh();if(l.vnode=t,r)for(p in n)r[p]||a.addEventListener(p,l,!1);else for(p in n)a.addEventListener(p,l,!1)}}}var bh={create:er,update:er,destroy:er},vh=()=>th([rh,ih,ph,mh,bh]);function xs(e,t,r){if(e.ns="http://www.w3.org/2000/svg",r!=="foreignObject"&&t!==void 0)for(let i=0;i<t.length;++i){let s=t[i];if(typeof s=="string")continue;let n=s.data;n!==void 0&&xs(n,s.children,s.sel)}}function wh(e,t,r){let i={},s,n,a;if(r!==void 0?(t!==null&&(i=t),ft(r)?s=r:ot(r)?n=r.toString():r&&r.sel&&(s=[r])):t!=null&&(ft(t)?s=t:ot(t)?n=t.toString():t&&t.sel?s=[t]:i=t),s!==void 0)for(a=0;a<s.length;++a)ot(s[a])&&(s[a]=Xe(void 0,void 0,void 0,s[a],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&xs(i,s,e),Xe(e,i,s,n,void 0)}var _h=vh(),xh=({handlers:e,methods:t,constants:r,schema:i,view:s,store:n},a)=>{if(!s)throw new Error("view is not defined");if(!i||typeof i!="object"||Array.isArray(i))throw new Error("schema is required. Define component metadata in .schema.yaml.");let p=i,{template:l,refs:o,styles:c}=s;id({schema:p,methodExports:Object.keys(t||{})});let d=p.componentName,u=p.propsSchema,f=u?.properties?[...new Set(Object.keys(u.properties).map(h=>Yi(h)))]:[];return Nc({elementName:d,propsSchema:u,propsSchemaKeys:f,template:l,refs:o,styles:c,handlers:e,methods:t,constants:r,store:n,patch:_h,h:wh,deps:a})},Sh=e=>{let t={};return{once:(r,i)=>{t[r]||(t[r]=[]);let s=(...n)=>{i(...n),t[r]=t[r].filter(a=>a!==s)};t[r].push(s)},emit:(r,...i)=>{t[r]&&t[r].forEach(s=>{s(...i)})},showAlert:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showConfirm:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showFormDialog:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showDropdownMenu:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},closeAll:async()=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")}}},Ah=Sh(),Eh={globalUI:Ah},kh={components:Eh},$h={componentName:"rtgl-accordion-item",propsSchema:{type:"object",properties:{label:{type:"string"},content:{type:"string"},w:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},Ch={refs:{header:{eventListeners:{click:{handler:"handleClickHeader"}}}},styles:{".content-wrapper":{display:"grid","grid-template-rows":"0fr",transition:"grid-template-rows 0.2s ease-out"},".content-wrapper.open":{"grid-template-rows":"1fr"},".content-inner":{overflow:"hidden"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=v ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c w=f pv=md cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-svg svg=${chevronIcon} wh=16 c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg svg=",{type:1,path:"chevronIcon"}," wh=16 c=mu-fg"]}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:'div class="${openClass}"',value:{type:9,items:[{type:8,properties:[{key:"div class=content-inner",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view pb=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"content"}}],fast:!0},{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['div class="',{type:1,path:"openClass"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=v ",{type:1,path:"containerAttrString"}]}}],fast:!0}],fast:!0}},Ih={componentName:"rtgl-breadcrumb",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},href:{type:"string"},path:{type:"string"},current:{type:"boolean"},disabled:{type:"boolean"},click:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"}}}},sep:{type:"string",default:"breadcrumb-arrow"},max:{type:"number"}}},events:{"item-click":{type:"object",properties:{id:{type:"string"},path:{type:"string"},href:{type:"string"},item:{type:"object"},index:{type:"number"},trigger:{type:"string"}}}},methods:{type:"object",properties:{}}},Th={refs:{"item*":{eventListeners:{click:{handler:"handleClickItem"}}}},styles:{a:{"text-decoration":"none",color:"inherit"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md p=sm ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isSeparator",value:{type:6,conditions:[{type:1,path:"item.isSeparator"},{type:1,path:"item.isEllipsis"},{type:4,op:6,left:{type:1,path:"item.isInteractive"},right:{type:1,path:"item.href"}},{type:1,path:"item.isInteractive"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${sep} c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"sep"}," c=mu-fg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#item${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#item",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#item${i} data-index=${item.index} cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#item",{type:1,path:"i"}," data-index=",{type:1,path:"item.index"}," cur=pointer"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md p=sm ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Oh={componentName:"rtgl-card",propsSchema:{type:"object",properties:{head:{type:"string"},desc:{type:"string"},size:{type:"string",enum:["sm","md","lg"]}}},events:[],methods:{type:"object",properties:{}}},Lh={styles:{":host":{display:"block"},slot:{display:"block","min-width":0},".rtgl-card-body":{"min-width":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="rtgl-card" d=v w=f bgc=bg bw=xs bc=bo br=xl shadow=sm ${cardAttrString} ${containerAttrString}',value:{type:9,items:[{type:8,properties:[{key:"$if hasHeader",value:{type:6,conditions:[{type:1,path:"hasHeader"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="rtgl-card-header" d=v w=f ${headerAttrString}',value:{type:9,items:[{type:8,properties:[{key:"$if head",value:{type:6,conditions:[{type:1,path:"head"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-text class="rtgl-card-heading" s=${headingSize} w=f',value:{type:1,path:"head"},parsedKey:{type:2,parts:['rtgl-text class="rtgl-card-heading" s=',{type:1,path:"headingSize"}," w=f"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if desc",value:{type:6,conditions:[{type:1,path:"desc"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-text class="rtgl-card-desc" s=${subheadingSize} c=mu-fg w=f',value:{type:1,path:"desc"},parsedKey:{type:2,parts:['rtgl-text class="rtgl-card-desc" s=',{type:1,path:"subheadingSize"}," c=mu-fg w=f"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:['rtgl-view class="rtgl-card-header" d=v w=f ',{type:1,path:"headerAttrString"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"div class=rtgl-card-body",value:{type:9,items:[{type:8,properties:[{key:"slot",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:['rtgl-view class="rtgl-card" d=v w=f bgc=bg bw=xs bc=bo br=xl shadow=sm ',{type:1,path:"cardAttrString"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Nh={componentName:"rtgl-dropdown-menu",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["label","item","separator"]},id:{type:"string"},path:{type:"string"},href:{type:"string"},disabled:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"},testId:{type:"string"}}}},open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},w:{type:"string"},h:{type:"string"}}},events:{close:{type:"object"},"item-click":{type:"object",properties:{index:{type:"number"},item:{type:"object"},id:{type:"string"},path:{type:"string"},href:{type:"string"},trigger:{type:"string"}}}},methods:{type:"object",properties:{}}},Rh={refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},styles:{a:{display:"block",width:"100%","text-decoration":"none",color:"inherit"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=${w} h=${h} sv g=xs slot=content bgc=mu br=md",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isLabel",value:{type:6,conditions:[{type:1,path:"item.isLabel"},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.isDisabled"}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:4,op:6,left:{type:1,path:"item.hasHref"},right:{type:1,path:"item.linkExtraAttrs"}}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.hasHref"}},{type:1,path:"item.isItem"},{type:1,path:"item.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f ph=lg pv=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f ph=lg pv=md br=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view w=f ph=lg pv=md br=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} ph=lg pv=md cur=pointer br=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} ph=lg pv=md cur=pointer br=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f h-bgc=${item.hoverBgc} ph=lg pv=md cur=pointer br=md bgc=${item.bgc} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f h-bgc=",{type:1,path:"item.hoverBgc"}," ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"item.bgc"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 ph=lg mv=md bgc=bo",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=",{type:1,path:"w"}," h=",{type:1,path:"h"}," sv g=xs slot=content bgc=mu br=md"]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," place=",{type:1,path:"place"}]}}],fast:!1}],fast:!1}},Vh={componentName:"rtgl-form",propsSchema:{type:"object",properties:{form:{type:"object"},defaultValues:{type:"object"},context:{type:"object"},disabled:{type:"boolean"}}},events:{"form-input":{},"form-change":{},"form-field-event":{},"form-action":{}},methods:{type:"object",properties:{getValues:{type:"function"},setValues:{type:"function"},validate:{type:"function"},reset:{type:"function"}}}},jh={refs:{formContainer:{eventListeners:{keydown:{handler:"handleKeyDown"}}},"action*":{eventListeners:{click:{handler:"handleActionClick"}}},"tooltipIcon*":{eventListeners:{mouseenter:{handler:"handleTooltipMouseEnter"},mouseleave:{handler:"handleTooltipMouseLeave"}}},"field*":{eventListeners:{"value-input":{handler:"handleValueInput"},"value-change":{handler:"handleValueChange"}}},"image*":{eventListeners:{click:{handler:"handleImageClick"},contextmenu:{handler:"handleImageClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#formContainer w=f p=md g=lg ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if title",value:{type:6,conditions:[{type:1,path:"title"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"title"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if description",value:{type:6,conditions:[{type:1,path:"description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view g=lg w=f",value:{type:9,items:[{type:7,itemVar:"field",indexVar:"i",iterable:{type:1,path:"flatFields"},body:{type:9,items:[{type:8,properties:[{key:"$if field._isSection",value:{type:6,conditions:[{type:1,path:"field._isSection"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"$if field.label",value:{type:6,conditions:[{type:1,path:"field.label"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=md",value:{type:1,path:"field.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.description",value:{type:6,conditions:[{type:1,path:"field.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if !field._isSection",value:{type:6,conditions:[{type:5,op:0,operand:{type:1,path:"field._isSection"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=f",value:{type:9,items:[{type:8,properties:[{key:"$if field.label || field.description",value:{type:6,conditions:[{type:4,op:7,left:{type:1,path:"field.label"},right:{type:1,path:"field.description"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=md av=c",value:{type:9,items:[{type:8,properties:[{key:"$if field.label",value:{type:6,conditions:[{type:1,path:"field.label"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"field.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.required",value:{type:6,conditions:[{type:1,path:"field.required"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=fg s=sm",value:{type:0,value:"*"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.tooltip",value:{type:6,conditions:[{type:1,path:"field.tooltip"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#tooltipIcon${field._idx} data-field-name=${field.name} svg="info" wh=16 c=mu-fg cur=help ml=xs',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg#tooltipIcon",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' svg="info" wh=16 c=mu-fg cur=help ml=xs']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if field.description",value:{type:6,conditions:[{type:1,path:"field.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#field${field._idx} data-field-name=${field.name} w=f type=${field._inputType} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f type=",{type:1,path:"field._inputType"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-date"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-date"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-date#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-date#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-time"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-time"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-time#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-time#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-datetime"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-datetime"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-datetime#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-datetime#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-number"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-number"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-textarea"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-textarea"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-textarea#field${field._idx} data-field-name=${field.name} w=f rows=${field.rows} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-textarea#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f rows=",{type:1,path:"field.rows"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-select#field${field._idx} data-field-name=${field.name} w=f :options=flatFields[${field._arrIdx}].options ?no-clear=${field.noClear} :selectedValue=flatFields[${field._arrIdx}]._selectedValue :placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=flatFields[",{type:1,path:"field._arrIdx"},"].options ?no-clear=",{type:1,path:"field.noClear"}," :selectedValue=flatFields[",{type:1,path:"field._arrIdx"},"]._selectedValue :placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "color-picker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"color-picker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#field${field._idx} data-field-name=${field.name} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slider"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slider-with-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slider-with-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider-input#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "popover-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"popover-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-popover-input#field${field._idx} data-field-name=${field.name} label="${field.label}" placeholder=${field.placeholder} ?disabled=${field._disabled}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-popover-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field.label"},'" placeholder=',{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "checkbox"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"checkbox"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-checkbox#field${field._idx} data-field-name=${field.name} label="${field._checkboxText}" ?disabled=${field._disabled}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-checkbox#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field._checkboxText"},'" ?disabled=',{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "image" && field._imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"image"}},right:{type:1,path:"field._imageSrc"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image#image${field._idx} data-field-name=${field.name} src=${field._imageSrc} w=${field.width} h=${field.height} cur=pointer",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image#image",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," src=",{type:1,path:"field._imageSrc"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=pointer"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "image" && !field._imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"image"}},right:{type:5,op:0,operand:{type:1,path:"field._imageSrc"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#image${field._idx} data-field-name=${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=pointer p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg ta=c",value:{type:1,path:"field.placeholderText"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#image",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," bc=ac bw=sm ah=c av=c cur=pointer p=md"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "read-only-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"read-only-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"field.content"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slot"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slot"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'slot#fieldSlot${field._idx} name=${field.slot} style="display: contents;"',value:{type:0,value:null},parsedKey:{type:2,parts:["slot#fieldSlot",{type:1,path:"field._idx"}," name=",{type:1,path:"field.slot"},' style="display: contents;"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field._error",value:{type:6,conditions:[{type:1,path:"field._error"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=de",value:{type:1,path:"field._error"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if actions.buttons.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"actions.buttons.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'$if actions._layout == "split"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"split"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h w=f g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._leftButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=sm ah=e w=1fg",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._rightButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if actions._layout == "vertical"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"vertical"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._allButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} w=f ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," w=f ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if actions._layout == "stretch"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"stretch"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._allButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} w=f ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," w=f ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'rtgl-tooltip ?open=${tooltipState.open} x=${tooltipState.x} y=${tooltipState.y} place="t" content="${tooltipState.content}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-tooltip ?open=",{type:1,path:"tooltipState.open"}," x=",{type:1,path:"tooltipState.x"}," y=",{type:1,path:"tooltipState.y"},' place="t" content="',{type:1,path:"tooltipState.content"},'"']}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#formContainer w=f p=md g=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Ph={componentName:"rtgl-global-ui",propsSchema:{type:"object",properties:{}},events:[],methods:{type:"object",properties:{}}},Bh={refs:{dialog:{eventListeners:{close:{handler:"handleDialogClose"}}},confirmButton:{eventListeners:{click:{handler:"handleConfirm"}}},cancelButton:{eventListeners:{click:{handler:"handleCancel"}}},formDialog:{eventListeners:{"form-action":{handler:"handleFormAction"},"form-field-event":{handler:"handleFormFieldEvent"}}},dropdownMenu:{eventListeners:{close:{handler:"handleDropdownClose"},"item-click":{handler:"handleDropdownItemClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-dialog#dialog ?open=${isDialogContainerOpen} s=${dialogSize}",value:{type:9,items:[{type:8,properties:[{key:"$if isFormDialogOpen",value:{type:6,conditions:[{type:1,path:"isFormDialogOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-form#formDialog slot=content :form=formDialogConfig.form :defaultValues=formDialogConfig.defaultValues :context=formDialogConfig.context ?disabled=${formDialogConfig.disabled} key=form-dialog-${formDialogConfig.key}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-form#formDialog slot=content :form=formDialogConfig.form :defaultValues=formDialogConfig.defaultValues :context=formDialogConfig.context ?disabled=",{type:1,path:"formDialogConfig.disabled"}," key=form-dialog-",{type:1,path:"formDialogConfig.key"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if !isFormDialogOpen",value:{type:6,conditions:[{type:5,op:0,operand:{type:1,path:"isFormDialogOpen"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if config.title",value:{type:6,conditions:[{type:1,path:"config.title"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"config.title"}}],fast:!0},{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=md mt=lg w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"$if config.mode == 'confirm'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"config.mode"},right:{type:0,value:"confirm"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-button#cancelButton v=se",value:{type:1,path:"config.cancelText"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-button#confirmButton v=pr",value:{type:1,path:"config.confirmText"}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-dialog#dialog ?open=",{type:1,path:"isDialogContainerOpen"}," s=",{type:1,path:"dialogSize"}]}}],fast:!1},{type:8,properties:[{key:"rtgl-dropdown-menu#dropdownMenu ?open=${isDropdownOpen} x=${dropdownConfig.x} y=${dropdownConfig.y} place=${dropdownConfig.place} :items=dropdownConfig.items key=dropdown-${isDropdownOpen}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-dropdown-menu#dropdownMenu ?open=",{type:1,path:"isDropdownOpen"}," x=",{type:1,path:"dropdownConfig.x"}," y=",{type:1,path:"dropdownConfig.y"}," place=",{type:1,path:"dropdownConfig.place"}," :items=dropdownConfig.items key=dropdown-",{type:1,path:"isDropdownOpen"}]}}],fast:!0}],fast:!1}},Dh={componentName:"rtgl-navbar",propsSchema:{type:"object",properties:{start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}}}}}},events:{"start-click":{type:"object",properties:{path:{type:"string"}}}},methods:{type:"object",properties:{}}},zh={refs:{start:{eventListeners:{click:{handler:"handleClickStart"}}}},anchors:[[{"rtgl-text s=lg":"${start.label}"},{"$if start.image && start.image.src":[{"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}":null}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view bgc=bg d=h h=48 av=c w=f ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if start.href",value:{type:6,conditions:[{type:1,path:"start.href"},{type:1,path:"start.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${start.href}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a href=",{type:1,path:"start.href"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#start d=h av=c g=md cur=pointer",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view d=h av=c g=lg",value:{type:9,items:[{type:8,properties:[{key:"slot name=right",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view bgc=bg d=h h=48 av=c w=f ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Fh={componentName:"rtgl-page-outline",propsSchema:{type:"object",properties:{targetId:{type:"string"},scrollContainerId:{type:"string"},offsetTop:{type:"string"}}},events:{onItemClick:{type:"object"}},methods:{type:"object",properties:{}}},Wh={refs:{},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=272 d=v pr=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1fg sv mt=xl",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view d=h bwl=xs bc="${item.bc}" pv=sm av=c href=${item.href} pl=md',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=${item.ml}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view w=",{type:1,path:"item.ml"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} h-c=fg",value:{type:1,path:"item.title"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," h-c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view d=h bwl=xs bc="',{type:1,path:"item.bc"},'" pv=sm av=c href=',{type:1,path:"item.href"}," pl=md"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}},Mh={componentName:"rtgl-popover-input",propsSchema:{type:"object",properties:{value:{type:"string"},placeholder:{type:"string"},label:{type:"string"},autoFocus:{type:"boolean"},disabled:{type:"boolean",default:!1}}},events:{"value-change":{}},methods:{type:"object",properties:{}}},Kh={refs:{textDisplay:{eventListeners:{click:{handler:"handleTextClick"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},input:{eventListeners:{"value-input":{handler:"handleInputChange"},keydown:{handler:"handleInputKeydown"}}},submit:{eventListeners:{click:{handler:"handleSubmitClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#textDisplay w=f cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${valueColor}",value:{type:1,path:"value"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"valueColor"}]}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=240 slot=content bgc=mu br=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-input#input w=f placeholder=${placeholder} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=f placeholder=",{type:1,path:"placeholder"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#submit ?disabled=${disabled}",value:{type:0,value:"Submit"},parsedKey:{type:2,parts:["rtgl-button#submit ?disabled=",{type:1,path:"disabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}]}}],fast:!0}],fast:!0}},Uh={componentName:"rtgl-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"any"},testId:{type:"string"}}}},selectedValue:{type:"any"},onChange:{type:"function"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}},Hh={refs:{selectButton:{eventListeners:{click:{handler:"handleButtonClick"}}},clearButton:{eventListeners:{click:{handler:"handleClearClick"}}},popover:{eventListeners:{close:{handler:"handleClickOptionsPopoverOverlay"}}},"option*":{eventListeners:{click:{handler:"handleOptionClick"},mouseenter:{handler:"handleOptionMouseEnter"},mouseleave:{handler:"handleOptionMouseLeave"}}},optionAdd:{eventListeners:{click:{handler:"handleAddOptionClick"},mouseenter:{handler:"handleAddOptionMouseEnter"},mouseleave:{handler:"handleAddOptionMouseLeave"}}}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-button#selectButton v=ol ${containerAttrString} ?disabled=${isDisabled} data-testid="select-button"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c ah=s w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text w=1fg ta=s c=${selectedLabelColor} ellipsis",value:{type:1,path:"selectedLabel"},parsedKey:{type:2,parts:["rtgl-text w=1fg ta=s c=",{type:1,path:"selectedLabelColor"}," ellipsis"]}}],fast:!0},{type:8,properties:[{key:"$if showClear",value:{type:6,conditions:[{type:1,path:"showClear"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#clearButton ml=md svg=x wh=16 c=mu-fg cur=pointer data-testid="select-clear-button"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-svg ml=md svg=chevronDown wh=16 c=mu-fg",value:{type:0,value:null}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-button#selectButton v=ol ",{type:1,path:"containerAttrString"}," ?disabled=",{type:1,path:"isDisabled"},' data-testid="select-button"']}}],fast:!1},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=rs",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=mu br=md sv=true",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f ph=lg pv=md cur=pointer br=md bgc=${option.bgc} data-testid=${option.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text ta=s",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"option.bgc"}," data-testid=",{type:1,path:"option.testId"}]}}],fast:!0}],fast:!0},flatten:!0},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f bw=xs bc=mu bwt=sm",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-view#optionAdd w=f ph=lg pv=md cur=pointer br=md bgc=${addOptionBgc} data-testid="select-add-option"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=ac",value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#optionAdd w=f ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"addOptionBgc"},' data-testid="select-add-option"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," place=rs"]}}],fast:!1}],fast:!1}},qh={componentName:"rtgl-sidebar",propsSchema:{type:"object",properties:{mode:{type:"string"},hideHeader:{type:"boolean",default:!1},w:{type:"string"},bwr:{type:"string"},selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},testId:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},items:{type:"array"},testId:{type:"string"}}}}}},events:{"header-click":{type:"object",properties:{path:{type:"string"}}},"item-click":{type:"object",properties:{item:{type:"object"}}}},methods:{type:"object",properties:{}}},Gh={refs:{headerImage:{eventListeners:{click:{handler:"handleHeaderClick"}}},headerLabel:{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item*":{eventListeners:{click:{handler:"handleItemClick"}}}},anchors:[[{"$if header.image && header.image.src":[{"$if header.image.href":[{"a href=${header.image.href}":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],"$elif header.image.path":[{"rtgl-view#headerImage cur=pointer":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],$else:[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}]},{"$if header.label && showLabels":[{"$if header.labelHref":[{"rtgl-text href=${header.labelHref} s=lg":"${header.label}"}],"$elif header.labelPath":[{"rtgl-view#headerLabel cur=pointer":[{"rtgl-text s=lg":"${header.label}"}]}],$else:[{"rtgl-text s=lg":"${header.label}"}]}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=${sidebarWidth} d=v bwr=${rightBorderWidth} ah=${ah} ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if showHeader",value:{type:6,conditions:[{type:1,path:"showHeader"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view ph=${headerPadding} pv=lg",value:{type:9,items:[{type:8,properties:[{key:"$if header.href",value:{type:6,conditions:[{type:1,path:"header.href"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view href=${header.href} d=h av=c ah=${headerAlign} g=lg w=${headerWidth}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerImage cur=pointer",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerLabel cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view href=",{type:1,path:"header.href"}," d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c ah=${headerAlign} g=lg w=${headerWidth} cur=pointer data-testid=${header.testId}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerImage cur=pointer",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerLabel cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#header d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}," cur=pointer data-testid=",{type:1,path:"header.testId"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view ph=",{type:1,path:"headerPadding"}," pv=lg"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=f h=1fg ph=${headerPadding} pb=lg g=xs ah=${ah} ${listAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'$if item.type == "groupLabel"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"groupLabel"}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showGroupLabels",value:{type:6,conditions:[{type:1,path:"showGroupLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=32 av=c ph=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=1 bgc=mu",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#item${i} data-item-id=${item.id} ${item.hrefAttr} h=${itemHeight} av=c ${itemAlignAttr} ph=${itemPadding} w=${itemWidth} h-bgc=${item.itemHoverBgc} br=lg bgc=${item.itemBgc} cur=pointer data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"$if item.icon",value:{type:6,conditions:[{type:1,path:"item.icon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=${itemContentAlign} g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h ah=",{type:1,path:"itemContentAlign"}," g=sm"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=${iconSize} svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=",{type:1,path:"iconSize"}," svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=${iconSize} br=f bgc=mu av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=${firstLetterSize} c=fg",value:{type:1,path:"item.title.charAt(0).toUpperCase()"},parsedKey:{type:2,parts:["rtgl-text s=",{type:1,path:"firstLetterSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view wh=",{type:1,path:"iconSize"}," br=f bgc=mu av=c ah=c"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#item",{type:1,path:"i"}," data-item-id=",{type:1,path:"item.id"}," ",{type:1,path:"item.hrefAttr"}," h=",{type:1,path:"itemHeight"}," av=c ",{type:1,path:"itemAlignAttr"}," ph=",{type:1,path:"itemPadding"}," w=",{type:1,path:"itemWidth"}," h-bgc=",{type:1,path:"item.itemHoverBgc"}," br=lg bgc=",{type:1,path:"item.itemBgc"}," cur=pointer data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=1fg ph=",{type:1,path:"headerPadding"}," pb=lg g=xs ah=",{type:1,path:"ah"}," ",{type:1,path:"listAttrString"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{type:1,path:"sidebarWidth"}," d=v bwr=",{type:1,path:"rightBorderWidth"}," ah=",{type:1,path:"ah"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Jh={componentName:"rtgl-slider-input",propsSchema:{type:"object",properties:{key:{type:"string"},value:{type:"string",default:"0"},w:{type:"string",default:""},min:{type:"string",default:"0"},max:{type:"string",default:"100"},step:{type:"string",default:"1"},disabled:{type:"boolean",default:!1}}},events:{"value-input":{},"value-change":{}},methods:{type:"object",properties:{}}},Yh={refs:{input:{eventListeners:{"value-input":{handler:"handleValueInput"},"value-change":{handler:"handleValueChange"}}},slider:{eventListeners:{"value-change":{handler:"handleValueChange"},"value-input":{handler:"handleValueInput"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=${w}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-slider#slider key=${key} w=f type=range min=${min} max=${max} step=${step} value=${value} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider key=",{type:1,path:"key"}," w=f type=range min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=84",value:{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#input key=${key} w=f min=${min} max=${max} step=${step} value=${value} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#input key=",{type:1,path:"key"}," w=f min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md w=",{type:1,path:"w"}]}}],fast:!0}],fast:!0}},Xh={componentName:"rtgl-table",propsSchema:{type:"object",properties:{data:{type:"object",properties:{columns:{type:"array",items:{type:"object",properties:{key:{type:"string"},label:{type:"string"}}}},rows:{type:"array",items:{type:"object"}}}},responsive:{type:"boolean",default:!0}}},events:{},methods:{type:"object",properties:{}}},Qh={refs:{"row*":{eventListeners:{click:{handler:"handleRowClick"}}},"header*":{eventListeners:{click:{handler:"handleHeaderClick"}}}},styles:{table:{width:"100%","border-collapse":"collapse","border-spacing":0},thead:{"border-bottom":"2px solid var(--border)"},th:{padding:"12px","text-align":"left","font-weight":500,color:"var(--foreground)","background-color":"var(--muted)",cursor:"pointer",position:"sticky",top:0,"z-index":1},"tbody tr":{"border-bottom":"1px solid var(--border)"},"tbody tr:last-child":{"border-bottom":"none"},td:{padding:"12px",color:"var(--foreground)"},".table-container":{width:"100%",height:"100%",overflow:"auto"},".empty-state":{"text-align":"center",padding:"24px",color:"var(--muted-foreground)"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view.table-container ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if rows.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"rows.length"},right:{type:0,value:0}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"table",value:{type:9,items:[{type:8,properties:[{key:"thead",value:{type:9,items:[{type:8,properties:[{key:"tr",value:{type:9,items:[{type:7,itemVar:"column",indexVar:"i",iterable:{type:1,path:"columns"},body:{type:9,items:[{type:8,properties:[{key:"th#header${i} data-column-key=${column.key}",value:{type:1,path:"column.label"},parsedKey:{type:2,parts:["th#header",{type:1,path:"i"}," data-column-key=",{type:1,path:"column.key"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"tbody",value:{type:9,items:[{type:7,itemVar:"row",indexVar:"rowIndex",iterable:{type:1,path:"rows"},body:{type:9,items:[{type:8,properties:[{key:"tr#row${rowIndex}",value:{type:9,items:[{type:7,itemVar:"cell",indexVar:"cellIndex",iterable:{type:1,path:"row.cells"},body:{type:9,items:[{type:8,properties:[{key:"td",value:{type:1,path:"cell.value"}}],fast:!0}],fast:!0},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["tr#row",{type:1,path:"rowIndex"}]}}],fast:!1}],fast:!1},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view.empty-state w=f p=xl",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"No data available"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view.table-container ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Zh={componentName:"rtgl-tabs",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},testId:{type:"string"}}}},selectedTab:{type:"string"}}},events:{"item-click":{type:"object",properties:{id:{type:"string"}}}},methods:{type:"object",properties:{}}},eu={refs:{"tab*":{eventListeners:{click:{handler:"handleClickItem"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm bgc=mu p=sm br=lg ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#tab${i} data-id=${item.id} cur=pointer bgc=${item.bgColor} bw=xs bc=${item.borderColor} pv=md ph=lg br=lg data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.textColor}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.textColor"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#tab",{type:1,path:"i"}," data-id=",{type:1,path:"item.id"}," cur=pointer bgc=",{type:1,path:"item.bgColor"}," bw=xs bc=",{type:1,path:"item.borderColor"}," pv=md ph=lg br=lg data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h g=sm bgc=mu p=sm br=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},tu={componentName:"rtgl-tooltip",propsSchema:{type:"object",properties:{open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},content:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},ru={template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} no-overlay",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content bc=bo br=md p=sm ah=c av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text ta=c s=sm c=fg",value:{type:1,path:"content"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," place=",{type:1,path:"place"}," no-overlay"]}}],fast:!0}],fast:!0},refs:{}},iu={componentName:"rtgl-waveform",propsSchema:{type:"object",properties:{w:{type:"string",description:"Width of the waveform visualizer",default:"250"},h:{type:"string",description:"Height of the waveform visualizer",default:"150"},cur:{type:"string",description:"cursor"},waveformData:{type:"object",description:"File ID of the waveform data in object storage"},isLoading:{type:"boolean",description:"Whether the waveform data is currently being loaded"}}},events:[],methods:{type:"object",properties:{}}},su={refs:{canvas:{selector:"canvas"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view pos=rel w=${w} h=${h} cur=${cur}",value:{type:9,items:[{type:8,properties:[{key:"$if isLoading",value:{type:6,conditions:[{type:1,path:"isLoading"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"..."}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'canvas#canvas style="width:100%; height:100%;"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view pos=rel w=",{type:1,path:"w"}," h=",{type:1,path:"h"}," cur=",{type:1,path:"cur"}]}}],fast:!1}],fast:!1}},x={};x.components={};x.components.accordionItem={};x.components.accordionItem.handlers=on;x.components.accordionItem.schema=$h;x.components.accordionItem.store=un;x.components.accordionItem.view=Ch;x.components.breadcrumb={};x.components.breadcrumb.handlers=mn;x.components.breadcrumb.schema=Ih;x.components.breadcrumb.store=An;x.components.breadcrumb.view=Th;x.components.card={};x.components.card.schema=Oh;x.components.card.store=In;x.components.card.view=Lh;x.components.dropdownMenu={};x.components.dropdownMenu.handlers=Ln;x.components.dropdownMenu.schema=Nh;x.components.dropdownMenu.store=Pn;x.components.dropdownMenu.view=Rh;x.components.form={};x.components.form.handlers=so;x.components.form.methods=mo;x.components.form.schema=Vh;x.components.form.store=Ha;x.components.form.view=jh;x.components.globalUi={};x.components.globalUi.handlers=To;x.components.globalUi.schema=Ph;x.components.globalUi.store=Ko;x.components.globalUi.view=Bh;x.components.navbar={};x.components.navbar.handlers=Ho;x.components.navbar.schema=Dh;x.components.navbar.store=el;x.components.navbar.view=zh;x.components.pageOutline={};x.components.pageOutline.handlers=il;x.components.pageOutline.schema=Fh;x.components.pageOutline.store=cl;x.components.pageOutline.view=Wh;x.components.popoverInput={};x.components.popoverInput.handlers=vl;x.components.popoverInput.schema=Mh;x.components.popoverInput.store=$l;x.components.popoverInput.view=Kh;x.components.select={};x.components.select.handlers=Dl;x.components.select.schema=Uh;x.components.select.store=ep;x.components.select.view=Hh;x.components.sidebar={};x.components.sidebar.handlers=ip;x.components.sidebar.schema=qh;x.components.sidebar.store=fp;x.components.sidebar.view=Gh;x.components.sliderInput={};x.components.sliderInput.handlers=vp;x.components.sliderInput.schema=Jh;x.components.sliderInput.store=Sp;x.components.sliderInput.view=Yh;x.components.table={};x.components.table.handlers=$p;x.components.table.schema=Xh;x.components.table.store=Pp;x.components.table.view=Qh;x.components.tabs={};x.components.tabs.handlers=Dp;x.components.tabs.schema=Zh;x.components.tabs.store=Kp;x.components.tabs.view=eu;x.components.tooltip={};x.components.tooltip.handlers=Up;x.components.tooltip.schema=tu;x.components.tooltip.store=Gp;x.components.tooltip.view=ru;x.components.waveform={};x.components.waveform.handlers=Xp;x.components.waveform.schema=iu;x.components.waveform.store=td;x.components.waveform.view=su;Object.keys(x).forEach(e=>{Object.keys(x[e]).forEach(t=>{let r=x[e][t],i=xh({...r},kh[e]),s=r.schema?.componentName;if(!s)throw new Error(`[Build] Missing schema.componentName for ${e}/${t}. Define it in .schema.yaml.`);customElements.define(s,i)})});customElements.define("rtgl-button",$r({}));customElements.define("rtgl-carousel",Lr({}));customElements.define("rtgl-grid",Nr({}));customElements.define("rtgl-view",Vr({}));customElements.define("rtgl-text",Pr({}));customElements.define("rtgl-image",zr({}));customElements.define("rtgl-tag",Wr({}));customElements.define("rtgl-svg",Kr({}));customElements.define("rtgl-input",ye({}));customElements.define("rtgl-input-date",Ur({}));customElements.define("rtgl-input-time",Hr({}));customElements.define("rtgl-input-datetime",qr({}));customElements.define("rtgl-input-number",Gr({}));customElements.define("rtgl-textarea",Jr({}));customElements.define("rtgl-color-picker",Yr({}));customElements.define("rtgl-slider",Xr({}));customElements.define("rtgl-checkbox",Qr({}));customElements.define("rtgl-dialog",Zr({}));customElements.define("rtgl-popover",ei({}));})();