@rettangoli/ui 1.9.2 → 1.10.0

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,26 +12,26 @@ var rettangoli=(()=>{var _e=`
12
12
  bottom: 0;
13
13
  z-index: 1;
14
14
  }
15
- `,Ke=({linkElement:e,href:t,newTab:s,rel:r})=>{e.href=t,s?e.target="_blank":e.removeAttribute("target"),r!=null?e.rel=r:s?e.rel="noopener noreferrer":e.removeAttribute("rel")},xe=({shadowRoot:e,slotElement:t,linkElement:s,href:r,newTab:i,rel:n})=>{if(t.parentNode!==e&&e.appendChild(t),!r)return s&&s.parentNode===e&&e.removeChild(s),null;let o=s||document.createElement("a");return Ke({linkElement:o,href:r,newTab:i,rel:n}),o.parentNode!==e&&e.appendChild(o),o},jt=({shadowRoot:e,childElement:t,linkElement:s,href:r,newTab:i,rel:n})=>{if(!r)return s?(t.parentNode===s&&e.appendChild(t),s.parentNode===e&&e.removeChild(s),null):(t.parentNode!==e&&e.appendChild(t),null);let o=s||document.createElement("a");return Ke({linkElement:o,href:r,newTab:i,rel:n}),t.parentNode!==o&&o.appendChild(t),o.parentNode!==e&&e.appendChild(o),o};var te=["default","sm","md","lg","xl"],F=()=>te.reduce((e,t)=>(e[t]={},e),{}),rr=["sm","md","lg","xl"],Qn=({size:e,attr:t})=>e==="default"?t:`${e}-${t}`,Zn=({size:e,includeDefault:t=!0})=>{if(e==="default")return["default"];let s=rr.indexOf(e);if(s===-1)return t?["default"]:[];let r=rr.slice(s);return t&&r.push("default"),r},Se=({element:e,size:t,attr:s,includeDefault:r=!0})=>{let i=Zn({size:t,includeDefault:r});for(let n of i){let o=Qn({size:n,attr:s}),p=e.getAttribute(o);if(p!==null)return p}return null};var Xn=/^([1-9]|1[0-2])fg$/,eo=/^([1-9]\d*)\/([1-9]\d*)fb$/,Bt=e=>typeof e=="string"&&Xn.test(e),ct=e=>{if(typeof e!="string")return null;let t=e.match(eo);if(!t)return null;let s=Number(t[1]),r=Number(t[2]);return!Number.isInteger(s)||!Number.isInteger(r)||r<=0||s>r?null:{numerator:s,denominator:r}};function ir({numerator:e,denominator:t,gapVar:s}){return e===t?"100%":e===1?`calc((100% - ((${t} - 1) * ${s})) / ${t})`:`calc(((100% - ((${t} - 1) * ${s})) * ${e}) / ${t})`}var K=({styleBucket:e,axis:t,dimension:s,fillValue:r,allowFlexGrow:i=!1,flexMinDimension:n="0",lockBounds:o=!0})=>{let p=()=>{!i||t!=="width"||(e["flex-grow"]="0",e["flex-shrink"]="1",e["flex-basis"]="auto")},l=()=>{e[`min-${t}`]="unset",e[`max-${t}`]="unset"};if(s===void 0)return;if(s==="f"){p(),e[t]=r,l();return}if(i&&Bt(s)){e["flex-grow"]=s.slice(0,-2),e["flex-basis"]="0%",e[`min-${t}`]=n,e[`max-${t}`]="unset";return}let a=i?ct(s):null;if(a){e["flex-grow"]="0",e["flex-shrink"]="0",e["flex-basis"]=ir({...a,gapVar:"var(--rtgl-flex-gap, 0px)"}),e[`min-${t}`]=n,e[`max-${t}`]="unset";return}p(),e[t]=s,o&&(e[`min-${t}`]=s,e[`max-${t}`]=s)},Ue=({style:e,width:t,fillValue:s="var(--width-stretch)",allowFlexGrow:r=!0,flexMinWidth:i="0"})=>{if(t==="f"){e.width=s,e.flexGrow="",e.flexBasis="",e.minWidth="";return}if(r&&Bt(t)){e.width="",e.flexGrow=t.slice(0,-2),e.flexShrink="",e.flexBasis="0%",e.minWidth=i;return}let n=r?ct(t):null;if(n){e.width="",e.flexGrow="0",e.flexShrink="0",e.flexBasis=ir({...n,gapVar:"var(--rtgl-flex-gap, 0px)"}),e.minWidth=i;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 to=e=>`${e}`.trim().replace(/\s*\/\s*/g,"/"),He=e=>{if(e==null)return;let t=to(e);if(t.length!==0)return typeof CSS<"u"&&typeof CSS.supports=="function"?CSS.supports("aspect-ratio",t)?t:void 0:t};function O(e,...t){let s="";return e.forEach((r,i)=>{s+=r+(t[i]||"")}),s}var so=["sm","md","lg","xl"],nr={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"},pe=Object.keys(nr),W=e=>e.concat(so.flatMap(t=>e.map(s=>`${t}-${s}`))),Ae={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)"},Y=(e,t={},s=null)=>{let r="";for(let[i,n]of Object.entries(Ae)){i!=="default"&&(r+=`${n} {`);for(let[o,p]of Object.entries(e))for(let[l,a]of Object.entries(p)){let c=nr[o],d=a.startsWith("--")?`var(${a})`:a,h=i==="default"?o:`${i}-${o}`,f=i==="default"?`h-${o}`:`${i}-h-${o}`,u=(y,m=!1)=>{let b=m?`:host([${y}="${l}"]:hover)`:`:host([${y}="${l}"])`;if(s)return s.split(",").map(_=>`${b} ${_.trim()}`).join(", ");let g=t[o];return g?`${b} ${g}`:b};if(c){let m=c.split(" ").map(b=>`${b}: ${d};`).join(" ");r+=`
15
+ `,Ke=({linkElement:e,href:t,newTab:s,rel:i})=>{e.href=t,s?e.target="_blank":e.removeAttribute("target"),i!=null?e.rel=i:s?e.rel="noopener noreferrer":e.removeAttribute("rel")},xe=({shadowRoot:e,slotElement:t,linkElement:s,href:i,newTab:r,rel:n})=>{if(t.parentNode!==e&&e.appendChild(t),!i)return s&&s.parentNode===e&&e.removeChild(s),null;let o=s||document.createElement("a");return Ke({linkElement:o,href:i,newTab:r,rel:n}),o.parentNode!==e&&e.appendChild(o),o},jt=({shadowRoot:e,childElement:t,linkElement:s,href:i,newTab:r,rel:n})=>{if(!i)return s?(t.parentNode===s&&e.appendChild(t),s.parentNode===e&&e.removeChild(s),null):(t.parentNode!==e&&e.appendChild(t),null);let o=s||document.createElement("a");return Ke({linkElement:o,href:i,newTab:r,rel:n}),t.parentNode!==o&&o.appendChild(t),o.parentNode!==e&&e.appendChild(o),o};var te=["default","sm","md","lg","xl"],F=()=>te.reduce((e,t)=>(e[t]={},e),{}),ii=["sm","md","lg","xl"],Qn=({size:e,attr:t})=>e==="default"?t:`${e}-${t}`,Zn=({size:e,includeDefault:t=!0})=>{if(e==="default")return["default"];let s=ii.indexOf(e);if(s===-1)return t?["default"]:[];let i=ii.slice(s);return t&&i.push("default"),i},Se=({element:e,size:t,attr:s,includeDefault:i=!0})=>{let r=Zn({size:t,includeDefault:i});for(let n of r){let o=Qn({size:n,attr:s}),p=e.getAttribute(o);if(p!==null)return p}return null};var Xn=/^([1-9]|1[0-2])fg$/,eo=/^([1-9]\d*)\/([1-9]\d*)fb$/,Bt=e=>typeof e=="string"&&Xn.test(e),ct=e=>{if(typeof e!="string")return null;let t=e.match(eo);if(!t)return null;let s=Number(t[1]),i=Number(t[2]);return!Number.isInteger(s)||!Number.isInteger(i)||i<=0||s>i?null:{numerator:s,denominator:i}};function ri({numerator:e,denominator:t,gapVar:s}){return e===t?"100%":e===1?`calc((100% - ((${t} - 1) * ${s})) / ${t})`:`calc(((100% - ((${t} - 1) * ${s})) * ${e}) / ${t})`}var K=({styleBucket:e,axis:t,dimension:s,fillValue:i,allowFlexGrow:r=!1,flexMinDimension:n="0",lockBounds:o=!0})=>{let p=()=>{!r||t!=="width"||(e["flex-grow"]="0",e["flex-shrink"]="1",e["flex-basis"]="auto")},l=()=>{e[`min-${t}`]="unset",e[`max-${t}`]="unset"};if(s===void 0)return;if(s==="f"){p(),e[t]=i,l();return}if(r&&Bt(s)){e["flex-grow"]=s.slice(0,-2),e["flex-basis"]="0%",e[`min-${t}`]=n,e[`max-${t}`]="unset";return}let a=r?ct(s):null;if(a){e["flex-grow"]="0",e["flex-shrink"]="0",e["flex-basis"]=ri({...a,gapVar:"var(--rtgl-flex-gap, 0px)"}),e[`min-${t}`]=n,e[`max-${t}`]="unset";return}p(),e[t]=s,o&&(e[`min-${t}`]=s,e[`max-${t}`]=s)},Ue=({style:e,width:t,fillValue:s="var(--width-stretch)",allowFlexGrow:i=!0,flexMinWidth:r="0"})=>{if(t==="f"){e.width=s,e.flexGrow="",e.flexBasis="",e.minWidth="";return}if(i&&Bt(t)){e.width="",e.flexGrow=t.slice(0,-2),e.flexShrink="",e.flexBasis="0%",e.minWidth=r;return}let n=i?ct(t):null;if(n){e.width="",e.flexGrow="0",e.flexShrink="0",e.flexBasis=ri({...n,gapVar:"var(--rtgl-flex-gap, 0px)"}),e.minWidth=r;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 to=e=>`${e}`.trim().replace(/\s*\/\s*/g,"/"),He=e=>{if(e==null)return;let t=to(e);if(t.length!==0)return typeof CSS<"u"&&typeof CSS.supports=="function"?CSS.supports("aspect-ratio",t)?t:void 0:t};function O(e,...t){let s="";return e.forEach((i,r)=>{s+=i+(t[r]||"")}),s}var so=["sm","md","lg","xl"],ni={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"},pe=Object.keys(ni),M=e=>e.concat(so.flatMap(t=>e.map(s=>`${t}-${s}`))),Ae={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)"},Y=(e,t={},s=null)=>{let i="";for(let[r,n]of Object.entries(Ae)){r!=="default"&&(i+=`${n} {`);for(let[o,p]of Object.entries(e))for(let[l,a]of Object.entries(p)){let c=ni[o],d=a.startsWith("--")?`var(${a})`:a,h=r==="default"?o:`${r}-${o}`,f=r==="default"?`h-${o}`:`${r}-h-${o}`,u=(y,m=!1)=>{let b=m?`:host([${y}="${l}"]:hover)`:`:host([${y}="${l}"])`;if(s)return s.split(",").map(_=>`${b} ${_.trim()}`).join(", ");let g=t[o];return g?`${b} ${g}`:b};if(c){let m=c.split(" ").map(b=>`${b}: ${d};`).join(" ");i+=`
16
16
  ${u(h)}{
17
17
  ${m}
18
18
  }
19
19
  ${u(f,!0)}{
20
20
  ${m}
21
21
  }
22
- `}else r+=`
22
+ `}else i+=`
23
23
  ${u(h)}{
24
24
  ${a}
25
25
  }
26
26
  ${u(f,!0)}{
27
27
  ${a}
28
28
  }
29
- `}i!=="default"&&(r+="}")}return r};function ro(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var io=e=>/%$/.test(e),no=e=>/^([1-9]|1[0-2])fg$/.test(e),T=e=>{if(e!=null)return no(e)||io(e)?e:ro(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 G(e,t=":host"){let s="",r=["default","xl","lg","md","sm"];for(let i of r){let n=Ae[i];if(!e[i]||Object.keys(e[i]).length===0)continue;i!=="default"&&(s+=`${n} {
30
- `);let o="";for(let[p,l]of Object.entries(e[i]))l!=null&&(o+=`${p}: ${l} !important;
29
+ `}r!=="default"&&(i+="}")}return i};function io(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var ro=e=>/%$/.test(e),no=e=>/^([1-9]|1[0-2])fg$/.test(e),T=e=>{if(e!=null)return no(e)||ro(e)?e:io(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 G(e,t=":host"){let s="",i=["default","xl","lg","md","sm"];for(let r of i){let n=Ae[r];if(!e[r]||Object.keys(e[r]).length===0)continue;r!=="default"&&(s+=`${n} {
30
+ `);let o="";for(let[p,l]of Object.entries(e[r]))l!=null&&(o+=`${p}: ${l} !important;
31
31
  `);s+=`${t} {
32
32
  ${o.trim()}
33
33
  }
34
- `,i!=="default"&&(s+=`}
34
+ `,r!=="default"&&(s+=`}
35
35
  `)}return s}var oo={mt:L,mr:L,mb:L,ml:L,m:L,mh:L,mv:L,s:{sm:`
36
36
  height: 28px;
37
37
  padding-left: 12px;
@@ -81,7 +81,7 @@ var rettangoli=(()=>{var _e=`
81
81
  `,lk:`
82
82
  background-color: transparent;
83
83
  color: var(--foreground);
84
- `}},or=Y(oo,{},".surface");var ao=[{prefix:"sm",maxWidth:640},{prefix:"md",maxWidth:768},{prefix:"lg",maxWidth:1024},{prefix:"xl",maxWidth:1280}],zt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
84
+ `}},oi=Y(oo,{},".surface");var ao=[{prefix:"sm",maxWidth:640},{prefix:"md",maxWidth:768},{prefix:"lg",maxWidth:1024},{prefix:"xl",maxWidth:1280}],zt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
85
85
  :host {
86
86
  display: inline-flex;
87
87
  }
@@ -252,8 +252,8 @@ var rettangoli=(()=>{var _e=`
252
252
  color: inherit;
253
253
  }
254
254
 
255
- ${or}
256
- `))}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,s,r){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:s,maxWidth:r}of ao){let i=`${s}-s`;if(t<=r&&this.hasAttribute(i))return this.getAttribute(i)}return this.getAttribute("s")}_updateButton(){this.shadow.innerHTML="";let t=this.hasAttribute("disabled"),s=this.getAttribute("href"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel"),n=s&&!t,o=n?"a":"button";if(this._surfaceElement.tagName.toLowerCase()!==o){let p=document.createElement(o);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?(Ke({linkElement:this._surfaceElement,href:s,newTab:r,rel:i}),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},s=this._resolveResponsiveSizeToken(),r=18;this.hasAttribute("sq")?r={sm:14,lg:22}[s]||18:r=t[s]||18;let i=this.getAttribute("pre");i&&(this._prefixIcon=document.createElement("rtgl-svg"),this._prefixIcon.setAttribute("svg",i),this._prefixIcon.setAttribute("wh",r.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",r.toString()),this._suffixIcon.style.color="inherit",this._surfaceElement.appendChild(this._suffixIcon))}_updateWidth(){let t=T(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()}},ar=({render:e,html:t})=>zt;var lo=({numerator:e,denominator:t,gapVar:s})=>e===t?"100%":e===1?`calc((100% - ((${t} - 1) * ${s})) / ${t})`:`calc(((100% - ((${t} - 1) * ${s})) * ${e}) / ${t})`,ut=({index:e,maxIndex:t})=>!Number.isFinite(e)||!Number.isFinite(t)||t<0?0:Math.min(Math.max(Math.trunc(e),0),t),Wt=({value:e,defaultValue:t=!1})=>{if(e==null)return t;let s=`${e}`.trim().toLowerCase();return s.length===0?!0:!(s==="false"||s==="0"||s==="no"||s==="off"||s==="none")},Mt=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"},lr=({slideLeft:e,slideWidth:t,viewportWidth:s,scrollPaddingInlineStart:r=0,scrollPaddingInlineEnd:i=0,snapAlign:n="center",maxScrollLeft:o=Number.POSITIVE_INFINITY})=>{if(!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(s))return 0;let p=r,l=s-i,a=Math.max(l-p,0),c;n==="start"?c=e-p:n==="end"?c=e+t-l:c=e+t/2-(p+a/2);let d=Number.isFinite(o)?Math.max(o,0):Number.POSITIVE_INFINITY;return Math.min(Math.max(c,0),d)},pr=({slideWidthCss:e,snapAlign:t="center"})=>`${t??""}`.trim().toLowerCase()!=="center"?"0px":`max(calc((100% - (${e&&`${e}`.trim().length>0?`${e}`.trim():"100%"})) / 2), 0px)`,dr=({slideWidth:e,gapVar:t="var(--rtgl-carousel-gap, 0px)"})=>{if(e==null||`${e}`.trim()===""||e==="f")return"100%";let s=ct(`${e}`.trim());return s?lo({...s,gapVar:t}):T(`${e}`.trim())??"100%"};var po=["a","button","input","select","textarea","label","summary","[contenteditable]"].join(", "),Ft=e=>{if(e==null)return null;let t=`${e}`.trim();return t.length>0?t:null},co=e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,cr=e=>{let t="http://www.w3.org/2000/svg",s=document.createElementNS(t,"svg");s.setAttribute("viewBox","0 0 24 24"),s.setAttribute("aria-hidden","true"),s.setAttribute("focusable","false");let r=document.createElementNS(t,"path");return r.setAttribute("d",e==="left"?"M15 18 9 12l6-6":"M9 18l6-6-6-6"),r.setAttribute("fill","none"),r.setAttribute("stroke","currentColor"),r.setAttribute("stroke-width","2"),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round"),s.appendChild(r),s},Kt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
255
+ ${oi}
256
+ `))}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,s,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:s,maxWidth:i}of ao){let r=`${s}-s`;if(t<=i&&this.hasAttribute(r))return this.getAttribute(r)}return this.getAttribute("s")}_updateButton(){this.shadow.innerHTML="";let t=this.hasAttribute("disabled"),s=this.getAttribute("href"),i=this.hasAttribute("new-tab"),r=this.getAttribute("rel"),n=s&&!t,o=n?"a":"button";if(this._surfaceElement.tagName.toLowerCase()!==o){let p=document.createElement(o);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?(Ke({linkElement:this._surfaceElement,href:s,newTab:i,rel:r}),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},s=this._resolveResponsiveSizeToken(),i=18;this.hasAttribute("sq")?i={sm:14,lg:22}[s]||18:i=t[s]||18;let r=this.getAttribute("pre");r&&(this._prefixIcon=document.createElement("rtgl-svg"),this._prefixIcon.setAttribute("svg",r),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=T(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()}},ai=({render:e,html:t})=>zt;var lo=({numerator:e,denominator:t,gapVar:s})=>e===t?"100%":e===1?`calc((100% - ((${t} - 1) * ${s})) / ${t})`:`calc(((100% - ((${t} - 1) * ${s})) * ${e}) / ${t})`,ut=({index:e,maxIndex:t})=>!Number.isFinite(e)||!Number.isFinite(t)||t<0?0:Math.min(Math.max(Math.trunc(e),0),t),Mt=({value:e,defaultValue:t=!1})=>{if(e==null)return t;let s=`${e}`.trim().toLowerCase();return s.length===0?!0:!(s==="false"||s==="0"||s==="no"||s==="off"||s==="none")},Wt=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"},li=({slideLeft:e,slideWidth:t,viewportWidth:s,scrollPaddingInlineStart:i=0,scrollPaddingInlineEnd:r=0,snapAlign:n="center",maxScrollLeft:o=Number.POSITIVE_INFINITY})=>{if(!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(s))return 0;let p=i,l=s-r,a=Math.max(l-p,0),c;n==="start"?c=e-p:n==="end"?c=e+t-l:c=e+t/2-(p+a/2);let d=Number.isFinite(o)?Math.max(o,0):Number.POSITIVE_INFINITY;return Math.min(Math.max(c,0),d)},pi=({slideWidthCss:e,snapAlign:t="center"})=>`${t??""}`.trim().toLowerCase()!=="center"?"0px":`max(calc((100% - (${e&&`${e}`.trim().length>0?`${e}`.trim():"100%"})) / 2), 0px)`,di=({slideWidth:e,gapVar:t="var(--rtgl-carousel-gap, 0px)"})=>{if(e==null||`${e}`.trim()===""||e==="f")return"100%";let s=ct(`${e}`.trim());return s?lo({...s,gapVar:t}):T(`${e}`.trim())??"100%"};var po=["a","button","input","select","textarea","label","summary","[contenteditable]"].join(", "),Ft=e=>{if(e==null)return null;let t=`${e}`.trim();return t.length>0?t:null},co=e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,ci=e=>{let t="http://www.w3.org/2000/svg",s=document.createElementNS(t,"svg");s.setAttribute("viewBox","0 0 24 24"),s.setAttribute("aria-hidden","true"),s.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"),s.appendChild(i),s},Kt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
257
257
  :host {
258
258
  display: block;
259
259
  width: 100%;
@@ -448,7 +448,7 @@ var rettangoli=(()=>{var _e=`
448
448
  border-color: var(--foreground);
449
449
  transform: scale(1.2);
450
450
  }
451
- `))}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(cr("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(cr("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 s=Number(t);this.setAttribute("index",Number.isFinite(s)?`${s}`:"0")}get snap(){return Mt(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,s,r){if(s!==r){if(t==="index"){if(this._isReflectingIndex){this._isReflectingIndex=!1;return}this.goTo(Number(r),{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 Wt({value:this.getAttribute("nav"),defaultValue:!0})}_showsPagerControls(){return Wt({value:this.getAttribute("pager"),defaultValue:!1})}goTo(t,s={}){if(!this._slides.length){this._setCurrentIndex(0,{emit:!1,reflect:!0});return}let r=ut({index:Number(t),maxIndex:this._slides.length-1}),i=this._slides[r],n=s.behavior??"smooth";i&&(this._scrollViewportTo(this._getSlideTargetScrollLeft(i),{behavior:n}),this._setCurrentIndex(r))}_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 s=t.clientX-this._dragState.startX;!this._dragState.dragging&&Math.abs(s)>6&&(this._dragState.dragging=!0,this._setDraggingState(!0)),this._dragState.dragging&&(t.preventDefault(),this._viewportElement.scrollLeft=this._dragState.startScrollLeft-s)}_handlePointerUp(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let s=this._dragState.dragging,r=s?this._findNearestSlideIndex():this._currentIndex;this._viewportElement.hasPointerCapture(t.pointerId)&&this._viewportElement.releasePointerCapture(t.pointerId),this._dragState=null,this._setDraggingState(!1),this._removePointerListeners(),s&&(this._clickSuppressUntil=performance.now()+250,this.snap?this.goTo(r,{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(s=>s instanceof Element&&s.matches(po))}_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,s=this._currentIndex,r=Number.POSITIVE_INFINITY;return this._slides.forEach((i,n)=>{let o=Math.abs(this._getSlideTargetScrollLeft(i)-t);o<r&&(s=n,r=o)}),s}_syncSlides(){let t=new Set(this._slides),s=this._slotElement.assignedElements({flatten:!0}).filter(r=>!r.hasAttribute("hidden"));t.forEach(r=>{s.includes(r)||(this._restoreSlideStyles(r),r.removeAttribute("data-rtgl-carousel-active"))}),this._slides=s,this._slides.forEach(r=>{this._slideStyleCache.has(r)||this._slideStyleCache.set(r,{flex:r.style.flex,width:r.style.width,minWidth:r.style.minWidth,maxWidth:r.style.maxWidth,boxSizing:r.style.boxSizing,scrollSnapAlign:r.style.scrollSnapAlign,scrollSnapStop:r.style.scrollSnapStop})}),this._buildPager(),this._setCurrentIndex(ut({index:this._currentIndex,maxIndex:this._slides.length-1}),{emit:!1,reflect:!0})}_restoreSlideStyles(t){let s=this._slideStyleCache.get(t);s&&(t.style.flex=s.flex,t.style.width=s.width,t.style.minWidth=s.minWidth,t.style.maxWidth=s.maxWidth,t.style.boxSizing=s.boxSizing,t.style.scrollSnapAlign=s.scrollSnapAlign,t.style.scrollSnapStop=s.scrollSnapStop)}_updateLayoutStyles(){let t=dr({slideWidth:this.getAttribute("sw")}),s=Ft(this.getAttribute("sna"))??"center",r=Mt(this.getAttribute("snap")),i=T(this.getAttribute("g"))??"var(--spacing-md)",n=T(this.getAttribute("spi"))??"0px",o=Ft(this.getAttribute("sbh"))??"smooth",p=pr({slideWidthCss:t,snapAlign:s});this.style.setProperty("--rtgl-carousel-slide-width",t),this.style.setProperty("--rtgl-carousel-gap",i),this.style.setProperty("--rtgl-carousel-scroll-snap-type",r),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",o),this.style.setProperty("--rtgl-carousel-snap-align",s),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=s,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,s={}){let r=s.behavior??"smooth",i=Math.min(Math.max(t,0),Math.max(this._viewportElement.scrollWidth-this._viewportElement.clientWidth,0));if(r!=="smooth"||Math.abs(i-this._viewportElement.scrollLeft)<1){this._cancelScrollAnimation(),this._viewportElement.scrollLeft=i;return}this._cancelScrollAnimation();let n=this._viewportElement.scrollLeft,o=i-n,p=Math.min(720,Math.max(420,Math.abs(o)*.35)),l=performance.now();this._setAnimatingScrollState(!0);let a=c=>{let d=c-l,h=Math.min(d/p,1),f=co(h);if(this._viewportElement.scrollLeft=n+o*f,h<1){this._scrollAnimationFrame=requestAnimationFrame(a);return}this._viewportElement.scrollLeft=i,this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1)};this._scrollAnimationFrame=requestAnimationFrame(a)}_cancelScrollAnimation(){this._scrollAnimationFrame!==null&&(cancelAnimationFrame(this._scrollAnimationFrame),this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1))}_buildPager(){this._pagerElement.replaceChildren(),this._pagerButtons=[],this._slides.forEach((t,s)=>{let r=document.createElement("button");r.type="button",r.setAttribute("part","pager-button"),r.setAttribute("aria-label",`Go to slide ${s+1}`),r.setAttribute("title",`Go to slide ${s+1}`),r.addEventListener("click",()=>{this.goTo(s)}),this._pagerElement.appendChild(r),this._pagerButtons.push(r)}),this._updateControls()}_updateControls(){let t=this._slides.length>0,s=this._slides.length>1,r=this._currentIndex<=0,i=this._currentIndex>=this._slides.length-1,n=s&&this._showsNavControls(),o=s&&this._showsPagerControls();this._prevButton.hidden=!n,this._nextButton.hidden=!n,this._pagerElement.hidden=!o,this._controlsElement.hidden=!o,this._prevButton.disabled=!t||r,this._nextButton.disabled=!t||i,this._pagerButtons.forEach((p,l)=>{let a=l===this._currentIndex;p.classList.toggle("is-active",a),p.disabled=a,p.setAttribute("part",a?"pager-button pager-button-active":"pager-button"),a?p.setAttribute("aria-current","true"):p.removeAttribute("aria-current")})}_setCurrentIndex(t,s={}){let r=ut({index:t,maxIndex:this._slides.length-1}),i=s.emit??!0,n=s.reflect??!0,o=this._currentIndex;this._currentIndex=r,this._slides.forEach((p,l)=>{l===r?p.setAttribute("data-rtgl-carousel-active","true"):p.removeAttribute("data-rtgl-carousel-active")}),this._updateControls(),n&&this.getAttribute("index")!==`${r}`&&(this._isReflectingIndex=!0,this.setAttribute("index",`${r}`)),i&&o!==r&&this.dispatchEvent(new CustomEvent("index-change",{detail:{index:r},bubbles:!0}))}_resolveScrollInlinePosition(){let t=Ft(this.getAttribute("sna"))??"center";return t==="start"||t==="end"||t==="center"?t:"center"}_getSlideTargetScrollLeft(t){let s=this._viewportElement.getBoundingClientRect(),r=t.getBoundingClientRect();if(s.width<=0||r.width<=0)return this._viewportElement.scrollLeft;let i=getComputedStyle(this._viewportElement),n=this._viewportElement.scrollLeft,o=r.left-s.left+n;return lr({slideLeft:o,slideWidth:r.width,viewportWidth:s.width,scrollPaddingInlineStart:this._parsePx(i.scrollPaddingInlineStart),scrollPaddingInlineEnd:this._parsePx(i.scrollPaddingInlineEnd),snapAlign:this._resolveScrollInlinePosition(),maxScrollLeft:this._viewportElement.scrollWidth-this._viewportElement.clientWidth})}_parsePx(t){let s=Number.parseFloat(t);return Number.isFinite(s)?s: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="")}},ur=()=>Kt;var uo={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"}},P=Y(uo);var ht=O`
451
+ `))}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(ci("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(ci("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 s=Number(t);this.setAttribute("index",Number.isFinite(s)?`${s}`:"0")}get snap(){return Wt(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,s,i){if(s!==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 Mt({value:this.getAttribute("nav"),defaultValue:!0})}_showsPagerControls(){return Mt({value:this.getAttribute("pager"),defaultValue:!1})}goTo(t,s={}){if(!this._slides.length){this._setCurrentIndex(0,{emit:!1,reflect:!0});return}let i=ut({index:Number(t),maxIndex:this._slides.length-1}),r=this._slides[i],n=s.behavior??"smooth";r&&(this._scrollViewportTo(this._getSlideTargetScrollLeft(r),{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 s=t.clientX-this._dragState.startX;!this._dragState.dragging&&Math.abs(s)>6&&(this._dragState.dragging=!0,this._setDraggingState(!0)),this._dragState.dragging&&(t.preventDefault(),this._viewportElement.scrollLeft=this._dragState.startScrollLeft-s)}_handlePointerUp(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let s=this._dragState.dragging,i=s?this._findNearestSlideIndex():this._currentIndex;this._viewportElement.hasPointerCapture(t.pointerId)&&this._viewportElement.releasePointerCapture(t.pointerId),this._dragState=null,this._setDraggingState(!1),this._removePointerListeners(),s&&(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(s=>s instanceof Element&&s.matches(po))}_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,s=this._currentIndex,i=Number.POSITIVE_INFINITY;return this._slides.forEach((r,n)=>{let o=Math.abs(this._getSlideTargetScrollLeft(r)-t);o<i&&(s=n,i=o)}),s}_syncSlides(){let t=new Set(this._slides),s=this._slotElement.assignedElements({flatten:!0}).filter(i=>!i.hasAttribute("hidden"));t.forEach(i=>{s.includes(i)||(this._restoreSlideStyles(i),i.removeAttribute("data-rtgl-carousel-active"))}),this._slides=s,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(ut({index:this._currentIndex,maxIndex:this._slides.length-1}),{emit:!1,reflect:!0})}_restoreSlideStyles(t){let s=this._slideStyleCache.get(t);s&&(t.style.flex=s.flex,t.style.width=s.width,t.style.minWidth=s.minWidth,t.style.maxWidth=s.maxWidth,t.style.boxSizing=s.boxSizing,t.style.scrollSnapAlign=s.scrollSnapAlign,t.style.scrollSnapStop=s.scrollSnapStop)}_updateLayoutStyles(){let t=di({slideWidth:this.getAttribute("sw")}),s=Ft(this.getAttribute("sna"))??"center",i=Wt(this.getAttribute("snap")),r=T(this.getAttribute("g"))??"var(--spacing-md)",n=T(this.getAttribute("spi"))??"0px",o=Ft(this.getAttribute("sbh"))??"smooth",p=pi({slideWidthCss:t,snapAlign:s});this.style.setProperty("--rtgl-carousel-slide-width",t),this.style.setProperty("--rtgl-carousel-gap",r),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",o),this.style.setProperty("--rtgl-carousel-snap-align",s),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=s,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,s={}){let i=s.behavior??"smooth",r=Math.min(Math.max(t,0),Math.max(this._viewportElement.scrollWidth-this._viewportElement.clientWidth,0));if(i!=="smooth"||Math.abs(r-this._viewportElement.scrollLeft)<1){this._cancelScrollAnimation(),this._viewportElement.scrollLeft=r;return}this._cancelScrollAnimation();let n=this._viewportElement.scrollLeft,o=r-n,p=Math.min(720,Math.max(420,Math.abs(o)*.35)),l=performance.now();this._setAnimatingScrollState(!0);let a=c=>{let d=c-l,h=Math.min(d/p,1),f=co(h);if(this._viewportElement.scrollLeft=n+o*f,h<1){this._scrollAnimationFrame=requestAnimationFrame(a);return}this._viewportElement.scrollLeft=r,this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1)};this._scrollAnimationFrame=requestAnimationFrame(a)}_cancelScrollAnimation(){this._scrollAnimationFrame!==null&&(cancelAnimationFrame(this._scrollAnimationFrame),this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1))}_buildPager(){this._pagerElement.replaceChildren(),this._pagerButtons=[],this._slides.forEach((t,s)=>{let i=document.createElement("button");i.type="button",i.setAttribute("part","pager-button"),i.setAttribute("aria-label",`Go to slide ${s+1}`),i.setAttribute("title",`Go to slide ${s+1}`),i.addEventListener("click",()=>{this.goTo(s)}),this._pagerElement.appendChild(i),this._pagerButtons.push(i)}),this._updateControls()}_updateControls(){let t=this._slides.length>0,s=this._slides.length>1,i=this._currentIndex<=0,r=this._currentIndex>=this._slides.length-1,n=s&&this._showsNavControls(),o=s&&this._showsPagerControls();this._prevButton.hidden=!n,this._nextButton.hidden=!n,this._pagerElement.hidden=!o,this._controlsElement.hidden=!o,this._prevButton.disabled=!t||i,this._nextButton.disabled=!t||r,this._pagerButtons.forEach((p,l)=>{let a=l===this._currentIndex;p.classList.toggle("is-active",a),p.disabled=a,p.setAttribute("part",a?"pager-button pager-button-active":"pager-button"),a?p.setAttribute("aria-current","true"):p.removeAttribute("aria-current")})}_setCurrentIndex(t,s={}){let i=ut({index:t,maxIndex:this._slides.length-1}),r=s.emit??!0,n=s.reflect??!0,o=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}`)),r&&o!==i&&this.dispatchEvent(new CustomEvent("index-change",{detail:{index:i},bubbles:!0}))}_resolveScrollInlinePosition(){let t=Ft(this.getAttribute("sna"))??"center";return t==="start"||t==="end"||t==="center"?t:"center"}_getSlideTargetScrollLeft(t){let s=this._viewportElement.getBoundingClientRect(),i=t.getBoundingClientRect();if(s.width<=0||i.width<=0)return this._viewportElement.scrollLeft;let r=getComputedStyle(this._viewportElement),n=this._viewportElement.scrollLeft,o=i.left-s.left+n;return li({slideLeft:o,slideWidth:i.width,viewportWidth:s.width,scrollPaddingInlineStart:this._parsePx(r.scrollPaddingInlineStart),scrollPaddingInlineEnd:this._parsePx(r.scrollPaddingInlineEnd),snapAlign:this._resolveScrollInlinePosition(),maxScrollLeft:this._viewportElement.scrollWidth-this._viewportElement.clientWidth})}_parsePx(t){let s=Number.parseFloat(t);return Number.isFinite(s)?s: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="")}},ui=()=>Kt;var uo={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"}},D=Y(uo);var ht=O`
452
452
  :host([sh]:not([sv])) {
453
453
  overflow-x: auto;
454
454
  flex-wrap: nowrap;
@@ -570,7 +570,7 @@ var rettangoli=(()=>{var _e=`
570
570
  left: 0;
571
571
  top: 0;
572
572
  height: 100%;
573
- `},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:qe,bwt:qe,bwr:qe,bwb:qe,bwl:qe,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",su:"--surface",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"}},ft=Y(ho);var fo={mt:L,mr:L,mb:L,ml:L,m:L,mh:L,mv:L},M=Y(fo);var Ve=O`
573
+ `},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:qe,bwt:qe,bwr:qe,bwb:qe,bwl:qe,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",su:"--surface",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"}},ft=Y(ho);var fo={mt:L,mr:L,mb:L,ml:L,m:L,mh:L,mv:L},W=Y(fo);var Ve=O`
574
574
  a, a:link, a:visited, a:hover, a:active {
575
575
  color: inherit;
576
576
  text-decoration: none;
@@ -595,12 +595,12 @@ var rettangoli=(()=>{var _e=`
595
595
  }
596
596
 
597
597
  ${ht}
598
- ${M}
599
- ${P}
598
+ ${W}
599
+ ${D}
600
600
  ${ft}
601
601
  ${Ve}
602
602
  ${_e}
603
- `))}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",...W([...pe,"cols","op","wh","w","h","hide","show","sh","sv","z","overflow"])]}_styles=F();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),s=this.hasAttribute("new-tab"),r=this.getAttribute("rel");this._linkElement=xe({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:s,rel:r})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=F(),te.forEach(s=>{let r=f=>`${s==="default"?"":`${s}-`}${f}`,i=this.getAttribute(r("wh")),n=T(i===null?this.getAttribute(r("w")):i),o=T(i===null?this.getAttribute(r("h")):i),p=yo(this.getAttribute(r("cols"))),l=this.getAttribute(r("op")),a=this.getAttribute(r("z"));p!==null&&(this._styles[s]["grid-template-columns"]=p),a!==null&&(this._styles[s]["z-index"]=a),l!==null&&(this._styles[s].opacity=l),K({styleBucket:this._styles[s],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),K({styleBucket:this._styles[s],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(r("hide"))&&(this._styles[s].display="none"),this.hasAttribute(r("show"))&&(this._styles[s].display="grid");let c=this.hasAttribute(r("sh")),d=this.hasAttribute(r("sv")),h=this.getAttribute(r("overflow"));c&&d?(this._styles[s].overflow="auto",this._styles[s]["scrollbar-gutter"]="stable"):c?(this._styles[s]["overflow-x"]="auto",this._styles[s]["scrollbar-gutter"]="stable"):d&&(this._styles[s]["overflow-y"]="auto",this._styles[s]["scrollbar-gutter"]="stable"),h==="hidden"&&(this._styles[s].overflow="hidden")});let t=G(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,s,r){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}s!==r&&this.updateStyles()}},hr=({render:e,html:t})=>Ut;var fr=O`
603
+ `))}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",...M([...pe,"cols","op","wh","w","h","hide","show","sh","sv","z","overflow"])]}_styles=F();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),s=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=xe({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:s,rel:i})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=F(),te.forEach(s=>{let i=f=>`${s==="default"?"":`${s}-`}${f}`,r=this.getAttribute(i("wh")),n=T(r===null?this.getAttribute(i("w")):r),o=T(r===null?this.getAttribute(i("h")):r),p=yo(this.getAttribute(i("cols"))),l=this.getAttribute(i("op")),a=this.getAttribute(i("z"));p!==null&&(this._styles[s]["grid-template-columns"]=p),a!==null&&(this._styles[s]["z-index"]=a),l!==null&&(this._styles[s].opacity=l),K({styleBucket:this._styles[s],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),K({styleBucket:this._styles[s],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(i("hide"))&&(this._styles[s].display="none"),this.hasAttribute(i("show"))&&(this._styles[s].display="grid");let c=this.hasAttribute(i("sh")),d=this.hasAttribute(i("sv")),h=this.getAttribute(i("overflow"));c&&d?(this._styles[s].overflow="auto",this._styles[s]["scrollbar-gutter"]="stable"):c?(this._styles[s]["overflow-x"]="auto",this._styles[s]["scrollbar-gutter"]="stable"):d&&(this._styles[s]["overflow-y"]="auto",this._styles[s]["scrollbar-gutter"]="stable"),h==="hidden"&&(this._styles[s].overflow="hidden")});let t=G(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,s,i){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}s!==i&&this.updateStyles()}},hi=({render:e,html:t})=>Ut;var fi=O`
604
604
 
605
605
  :host([d="h"]) {
606
606
  flex-direction: row;
@@ -688,13 +688,13 @@ var rettangoli=(()=>{var _e=`
688
688
 
689
689
 
690
690
  ${ht}
691
- ${fr}
692
- ${M}
693
- ${P}
691
+ ${fi}
692
+ ${W}
693
+ ${D}
694
694
  ${ft}
695
695
  ${Ve}
696
696
  ${_e}
697
- `))}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",...W([...pe,"op","wh","w","h","ar","bgi","bgs","bgp","bgr","hsb","hide","show","sh","sv","z","d","ah","av","wrap","no-wrap","overflow","stretch"])]}_styles=F();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),s=this.hasAttribute("new-tab"),r=this.getAttribute("rel");this._linkElement=xe({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:s,rel:r})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=F(),te.forEach(s=>{let r=z=>`${s==="default"?"":`${s}-`}${z}`,i=this.getAttribute(r("wh")),n=T(i===null?this.getAttribute(r("w")):i),o=T(i===null?this.getAttribute(r("h")):i),p=this.getAttribute(r("op")),l=this.getAttribute(r("z")),a=He(this.getAttribute(r("ar"))),c=yt(this.getAttribute(r("bgi"))),d=yt(this.getAttribute(r("bgs"))),h=yt(this.getAttribute(r("bgp"))),f=yt(this.getAttribute(r("bgr")));l!==null&&(this._styles[s]["z-index"]=l),p!==null&&(this._styles[s].opacity=p),a!==void 0&&(this._styles[s]["aspect-ratio"]=a),c!==null&&(this._styles[s]["background-image"]=c),d!==null&&(this._styles[s]["background-size"]=d),h!==null&&(this._styles[s]["background-position"]=h),f!==null&&(this._styles[s]["background-repeat"]=f),K({styleBucket:this._styles[s],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),K({styleBucket:this._styles[s],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(r("hide"))&&(this._styles[s].display="none"),this.hasAttribute(r("show"))&&(this._styles[s].display="flex");let u=this.getAttribute(r("d")),y=this.getAttribute(r("ah")),m=this.getAttribute(r("av")),b=Se({element:this,size:s,attr:"d"});u==="h"?this._styles[s]["flex-direction"]="row":u==="v"?this._styles[s]["flex-direction"]="column":s==="default"&&!u&&["sm","md","lg","xl"].some(B=>this.hasAttribute(`${B}-d`))&&(this._styles[s]["flex-direction"]="column");let g=b==="h",_=b==="v"||!b;g&&(y==="c"?this._styles[s]["justify-content"]="center":y==="e"?this._styles[s]["justify-content"]="flex-end":y==="s"&&(this._styles[s]["justify-content"]="flex-start"),m==="c"?(this._styles[s]["align-items"]="center",this._styles[s]["align-content"]="center"):m==="e"?(this._styles[s]["align-items"]="flex-end",this._styles[s]["align-content"]="flex-end"):m==="s"&&(this._styles[s]["align-items"]="flex-start")),_&&(y!==null||m!==null)&&(y==="c"?this._styles[s]["align-items"]="center":y==="e"?this._styles[s]["align-items"]="flex-end":y==="s"&&(this._styles[s]["align-items"]="flex-start"),m==="c"?this._styles[s]["justify-content"]="center":m==="e"?this._styles[s]["justify-content"]="flex-end":m==="s"&&(this._styles[s]["justify-content"]="flex-start"));let S=this.hasAttribute(r("wrap")),A=this.hasAttribute(r("no-wrap"));S&&(this._styles[s]["flex-wrap"]="wrap"),A&&(this._styles[s]["flex-wrap"]="nowrap"),this.hasAttribute(r("stretch"))&&(this._styles[s]["align-self"]="stretch");let k=this.hasAttribute(r("sh")),C=this.hasAttribute(r("sv")),I=this.hasAttribute(r("hsb")),V=this.getAttribute(r("overflow"));k&&C?(this._styles[s].overflow="auto",this._styles[s]["scrollbar-gutter"]="stable",this._styles[s]["flex-wrap"]="nowrap"):k?(this._styles[s]["overflow-x"]="auto",this._styles[s]["scrollbar-gutter"]="stable",this._styles[s]["flex-wrap"]="nowrap"):C&&(this._styles[s]["overflow-y"]="auto",this._styles[s]["scrollbar-gutter"]="stable",this._styles[s]["flex-wrap"]="nowrap"),V==="hidden"&&(this._styles[s].overflow="hidden",this._styles[s]["flex-wrap"]="nowrap"),I&&(this._styles[s]["-ms-overflow-style"]="none",this._styles[s]["scrollbar-gutter"]="auto",this._styles[s]["scrollbar-width"]="none")});let t=G(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,s,r){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}s!==r&&this.updateStyles()}},yr=({render:e,html:t})=>Ht;var mo={ta:{s:"text-align: start;",c:"text-align: center;",e:"text-align: end;",j:"text-align: justify;"},s:{h1:`
697
+ `))}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",...M([...pe,"op","wh","w","h","ar","bgi","bgs","bgp","bgr","hsb","hide","show","sh","sv","z","d","ah","av","wrap","no-wrap","overflow","stretch"])]}_styles=F();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),s=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=xe({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:s,rel:i})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=F(),te.forEach(s=>{let i=z=>`${s==="default"?"":`${s}-`}${z}`,r=this.getAttribute(i("wh")),n=T(r===null?this.getAttribute(i("w")):r),o=T(r===null?this.getAttribute(i("h")):r),p=this.getAttribute(i("op")),l=this.getAttribute(i("z")),a=He(this.getAttribute(i("ar"))),c=yt(this.getAttribute(i("bgi"))),d=yt(this.getAttribute(i("bgs"))),h=yt(this.getAttribute(i("bgp"))),f=yt(this.getAttribute(i("bgr")));l!==null&&(this._styles[s]["z-index"]=l),p!==null&&(this._styles[s].opacity=p),a!==void 0&&(this._styles[s]["aspect-ratio"]=a),c!==null&&(this._styles[s]["background-image"]=c),d!==null&&(this._styles[s]["background-size"]=d),h!==null&&(this._styles[s]["background-position"]=h),f!==null&&(this._styles[s]["background-repeat"]=f),K({styleBucket:this._styles[s],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),K({styleBucket:this._styles[s],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(i("hide"))&&(this._styles[s].display="none"),this.hasAttribute(i("show"))&&(this._styles[s].display="flex");let u=this.getAttribute(i("d")),y=this.getAttribute(i("ah")),m=this.getAttribute(i("av")),b=Se({element:this,size:s,attr:"d"});u==="h"?this._styles[s]["flex-direction"]="row":u==="v"?this._styles[s]["flex-direction"]="column":s==="default"&&!u&&["sm","md","lg","xl"].some(B=>this.hasAttribute(`${B}-d`))&&(this._styles[s]["flex-direction"]="column");let g=b==="h",_=b==="v"||!b;g&&(y==="c"?this._styles[s]["justify-content"]="center":y==="e"?this._styles[s]["justify-content"]="flex-end":y==="s"&&(this._styles[s]["justify-content"]="flex-start"),m==="c"?(this._styles[s]["align-items"]="center",this._styles[s]["align-content"]="center"):m==="e"?(this._styles[s]["align-items"]="flex-end",this._styles[s]["align-content"]="flex-end"):m==="s"&&(this._styles[s]["align-items"]="flex-start")),_&&(y!==null||m!==null)&&(y==="c"?this._styles[s]["align-items"]="center":y==="e"?this._styles[s]["align-items"]="flex-end":y==="s"&&(this._styles[s]["align-items"]="flex-start"),m==="c"?this._styles[s]["justify-content"]="center":m==="e"?this._styles[s]["justify-content"]="flex-end":m==="s"&&(this._styles[s]["justify-content"]="flex-start"));let S=this.hasAttribute(i("wrap")),A=this.hasAttribute(i("no-wrap"));S&&(this._styles[s]["flex-wrap"]="wrap"),A&&(this._styles[s]["flex-wrap"]="nowrap"),this.hasAttribute(i("stretch"))&&(this._styles[s]["align-self"]="stretch");let E=this.hasAttribute(i("sh")),C=this.hasAttribute(i("sv")),I=this.hasAttribute(i("hsb")),V=this.getAttribute(i("overflow"));E&&C?(this._styles[s].overflow="auto",this._styles[s]["scrollbar-gutter"]="stable",this._styles[s]["flex-wrap"]="nowrap"):E?(this._styles[s]["overflow-x"]="auto",this._styles[s]["scrollbar-gutter"]="stable",this._styles[s]["flex-wrap"]="nowrap"):C&&(this._styles[s]["overflow-y"]="auto",this._styles[s]["scrollbar-gutter"]="stable",this._styles[s]["flex-wrap"]="nowrap"),V==="hidden"&&(this._styles[s].overflow="hidden",this._styles[s]["flex-wrap"]="nowrap"),I&&(this._styles[s]["-ms-overflow-style"]="none",this._styles[s]["scrollbar-gutter"]="auto",this._styles[s]["scrollbar-width"]="none")});let t=G(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,s,i){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}s!==i&&this.updateStyles()}},yi=({render:e,html:t})=>Ht;var mo={ta:{s:"text-align: start;",c:"text-align: center;",e:"text-align: end;",j:"text-align: justify;"},s:{h1:`
698
698
  font-size: var(--h1-font-size);
699
699
  font-weight: var(--h1-font-weight);
700
700
  line-height: var(--h1-line-height);
@@ -734,7 +734,7 @@ var rettangoli=(()=>{var _e=`
734
734
  font-weight: var(--xs-font-weight);
735
735
  line-height: var(--xs-line-height);
736
736
  letter-spacing: var(--xs-letter-spacing);
737
- `}},mr=Y(mo);var go={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);"}},mt=Y(go);var qt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
737
+ `}},mi=Y(mo);var go={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);"}},mt=Y(go);var qt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
738
738
  :host {
739
739
  display: block;
740
740
  font-size: var(--md-font-size);
@@ -754,11 +754,11 @@ var rettangoli=(()=>{var _e=`
754
754
  color: var(--anchor-color-hover);
755
755
  }
756
756
  ${_e}
757
- ${mr}
757
+ ${mi}
758
758
  ${mt}
759
- ${M}
760
- ${P}
761
- `))}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","break-long-tokens"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,s,r){t==="href"||t==="new-tab"||t==="rel"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=T(this.getAttribute("w")),s=this.hasAttribute("ellipsis"),r=this.hasAttribute("break-long-tokens");s?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap",this.style.overflowWrap="",this.style.wordBreak=""):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace="",this.style.overflowWrap=r?"anywhere":"",this.style.wordBreak=r?"break-word":""),Ue({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),s=this.hasAttribute("new-tab"),r=this.getAttribute("rel");this._linkElement=xe({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:s,rel:r})}},gr=({render:e,html:t})=>qt;var Ye={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},bo={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);",su:"background-color: var(--surface);",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:Ye,bwt:Ye,bwr:Ye,bwb:Ye,bwl:Ye,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",su:"--surface",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=>Y(bo,{},e);var vo={mt:L,mr:L,mb:L,ml:L,m:L,mh:L,mv:L},vr=e=>Y(vo,{},e);var Yt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
759
+ ${W}
760
+ ${D}
761
+ `))}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","break-long-tokens"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,s,i){t==="href"||t==="new-tab"||t==="rel"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=T(this.getAttribute("w")),s=this.hasAttribute("ellipsis"),i=this.hasAttribute("break-long-tokens");s?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap",this.style.overflowWrap="",this.style.wordBreak=""):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace="",this.style.overflowWrap=i?"anywhere":"",this.style.wordBreak=i?"break-word":""),Ue({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),s=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=xe({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:s,rel:i})}},gi=({render:e,html:t})=>qt;var Ye={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},bo={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);",su:"background-color: var(--surface);",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:Ye,bwt:Ye,bwr:Ye,bwb:Ye,bwl:Ye,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",su:"--surface",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"}},bi=e=>Y(bo,{},e);var vo={mt:L,mr:L,mb:L,ml:L,m:L,mh:L,mv:L},vi=e=>Y(vo,{},e);var Yt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
762
762
  :host {
763
763
  display: contents;
764
764
  }
@@ -793,10 +793,10 @@ var rettangoli=(()=>{var _e=`
793
793
  width: 100%;
794
794
  }
795
795
 
796
- ${br("img, a")}
797
- ${vr("img, a")}
798
- ${P}
799
- `))}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 W([...pe,"key","src","alt","href","new-tab","rel","wh","w","h","ar","hide","show","op","z","of"])}_styles=F();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),s=this.hasAttribute("new-tab"),r=this.getAttribute("rel");this._linkElement=jt({shadowRoot:this.shadow,childElement:this._imgElement,linkElement:this._linkElement,href:t,newTab:s,rel:r})}connectedCallback(){this._updateImageAttributes(),this.updateStyles()}attributeChangedCallback(t,s,r){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}if(t==="src"||t==="alt"){this._updateImageAttributes();return}s!==r&&this.updateStyles()}updateStyles(){this._styles=F(),te.forEach(s=>{let r=c=>`${s==="default"?"":`${s}-`}${c}`,i=this.getAttribute(r("wh")),n=T(i===null?this.getAttribute(r("w")):i),o=T(i===null?this.getAttribute(r("h")):i),p=this.getAttribute(r("op")),l=this.getAttribute(r("z")),a=He(this.getAttribute(r("ar")));l!==null&&(this._styles[s]["z-index"]=l),p!==null&&(this._styles[s].opacity=p),a!==void 0&&(this._styles[s]["aspect-ratio"]=a),K({styleBucket:this._styles[s],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),K({styleBucket:this._styles[s],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(r("hide"))&&(this._styles[s].display="none !important"),this.hasAttribute(r("show"))&&(this._styles[s].display="block !important")});let t=G(this._styles,"img, a");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_updateImageAttributes(){let t=this.getAttribute("src"),s=this.getAttribute("alt");t!==null?this._imgElement.setAttribute("src",t):this._imgElement.removeAttribute("src"),s!==null?this._imgElement.setAttribute("alt",s):this._imgElement.removeAttribute("alt")}},wr=({render:e,html:t})=>Yt;var wo={s:{sm:`
796
+ ${bi("img, a")}
797
+ ${vi("img, a")}
798
+ ${D}
799
+ `))}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 M([...pe,"key","src","alt","href","new-tab","rel","wh","w","h","ar","hide","show","op","z","of"])}_styles=F();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),s=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=jt({shadowRoot:this.shadow,childElement:this._imgElement,linkElement:this._linkElement,href:t,newTab:s,rel:i})}connectedCallback(){this._updateImageAttributes(),this.updateStyles()}attributeChangedCallback(t,s,i){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}if(t==="src"||t==="alt"){this._updateImageAttributes();return}s!==i&&this.updateStyles()}updateStyles(){this._styles=F(),te.forEach(s=>{let i=c=>`${s==="default"?"":`${s}-`}${c}`,r=this.getAttribute(i("wh")),n=T(r===null?this.getAttribute(i("w")):r),o=T(r===null?this.getAttribute(i("h")):r),p=this.getAttribute(i("op")),l=this.getAttribute(i("z")),a=He(this.getAttribute(i("ar")));l!==null&&(this._styles[s]["z-index"]=l),p!==null&&(this._styles[s].opacity=p),a!==void 0&&(this._styles[s]["aspect-ratio"]=a),K({styleBucket:this._styles[s],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),K({styleBucket:this._styles[s],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[s].display="none !important"),this.hasAttribute(i("show"))&&(this._styles[s].display="block !important")});let t=G(this._styles,"img, a");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_updateImageAttributes(){let t=this.getAttribute("src"),s=this.getAttribute("alt");t!==null?this._imgElement.setAttribute("src",t):this._imgElement.removeAttribute("src"),s!==null?this._imgElement.setAttribute("alt",s):this._imgElement.removeAttribute("alt")}},wi=({render:e,html:t})=>Yt;var wo={s:{sm:`
800
800
  height: 20px;
801
801
  padding-left: 8px;
802
802
  padding-right: 8px;
@@ -849,7 +849,7 @@ var rettangoli=(()=>{var _e=`
849
849
  background-color: var(--destructive);
850
850
  color: var(--destructive-foreground);
851
851
  border-color: transparent;
852
- `}},_r=Y(wo,{},".surface");var Gt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
852
+ `}},_i=Y(wo,{},".surface");var Gt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
853
853
  :host {
854
854
  display: inline-flex;
855
855
  min-width: 0;
@@ -945,13 +945,13 @@ var rettangoli=(()=>{var _e=`
945
945
  opacity: 1;
946
946
  }
947
947
 
948
- ${_r}
948
+ ${_i}
949
949
  :host .surface {
950
950
  border-radius: var(--tag-border-radius) !important;
951
951
  }
952
- ${M}
953
- ${P}
954
- `))}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,s,r){if(t==="w"){this._updateWidth();return}s!==r&&this._updateStructure()}_updateWidth(){let t=T(this.getAttribute("w"));Ue({style:this.style,width:t,flexMinWidth:"0"})}_createIconElement(t,s){let r=document.createElement("rtgl-svg");return r.className=t,r.setAttribute("part",s),r.setAttribute("aria-hidden","true"),r}_syncIcon({iconName:t,element:s,className:r,part:i,insertBeforeElement:n}){if(!t)return s&&s.remove(),null;let o=s||this._createIconElement(r,i);return o.setAttribute("svg",t),o.parentNode!==this._surfaceElement?this._surfaceElement.insertBefore(o,n):o.nextSibling!==n&&this._surfaceElement.insertBefore(o,n),o}_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}))}},xr=({render:e,html:t})=>Gt;var Sr=O`
952
+ ${W}
953
+ ${D}
954
+ `))}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,s,i){if(t==="w"){this._updateWidth();return}s!==i&&this._updateStructure()}_updateWidth(){let t=T(this.getAttribute("w"));Ue({style:this.style,width:t,flexMinWidth:"0"})}_createIconElement(t,s){let i=document.createElement("rtgl-svg");return i.className=t,i.setAttribute("part",s),i.setAttribute("aria-hidden","true"),i}_syncIcon({iconName:t,element:s,className:i,part:r,insertBeforeElement:n}){if(!t)return s&&s.remove(),null;let o=s||this._createIconElement(i,r);return o.setAttribute("svg",t),o.parentNode!==this._surfaceElement?this._surfaceElement.insertBefore(o,n):o.nextSibling!==n&&this._surfaceElement.insertBefore(o,n),o}_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}))}},xi=({render:e,html:t})=>Gt;var Si=O`
955
955
  :host([pt="xs"]) svg {
956
956
  padding-top: var(--spacing-xs);
957
957
  }
@@ -1093,10 +1093,10 @@ var rettangoli=(()=>{var _e=`
1093
1093
  }
1094
1094
 
1095
1095
  ${mt}
1096
- ${Sr}
1097
- ${M}
1098
- ${P}
1099
- `))}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,s){e._icons[t]=s}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,s,r){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),s=T(t===null?this.getAttribute("w"):t),r=T(t===null?this.getAttribute("h"):t);s!=null?this.style.width=s:this.style.width="",r!=null?this.style.height=r:this.style.height=""}getBoundingClientRect(){let t=this.shadow.querySelector("svg");return t?t.getBoundingClientRect():super.getBoundingClientRect()}_render(){try{let t=this.getAttribute("svg"),s=e._icons[t]||(window.rtglIcons||{})[t];if(s){this.shadow.innerHTML=s;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},Ar=({render:e,html:t})=>Jt;var _o=["mt","mr","mb","ml","m","mh","mv","cur"],Qt=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(O`
1096
+ ${Si}
1097
+ ${W}
1098
+ ${D}
1099
+ `))}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,s){e._icons[t]=s}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,s,i){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),s=T(t===null?this.getAttribute("w"):t),i=T(t===null?this.getAttribute("h"):t);s!=null?this.style.width=s:this.style.width="",i!=null?this.style.height=i:this.style.height=""}getBoundingClientRect(){let t=this.shadow.querySelector("svg");return t?t.getBoundingClientRect():super.getBoundingClientRect()}_render(){try{let t=this.getAttribute("svg"),s=e._icons[t]||(window.rtglIcons||{})[t];if(s){this.shadow.innerHTML=s;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},Ai=({render:e,html:t})=>Jt;var _o=["mt","mr","mb","ml","m","mh","mv","cur"],Qt=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(O`
1100
1100
  :host {
1101
1101
  display: contents;
1102
1102
  }
@@ -1158,9 +1158,9 @@ var rettangoli=(()=>{var _e=`
1158
1158
  input[type="datetime-local"]::-webkit-date-and-time-value {
1159
1159
  text-align: left;
1160
1160
  }
1161
- ${M}
1162
- ${P}
1163
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=F(),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",...W([..._o,"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,s,r){if(s!==r){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=F(),te.forEach(s=>{let r=a=>`${s==="default"?"":`${s}-`}${a}`,i=this.getAttribute(r("wh")),n=T(i===null?this.getAttribute(r("w")):i),o=T(i===null?this.getAttribute(r("h")):i),p=this.getAttribute(r("op")),l=this.getAttribute(r("z"));l!==null&&(this._styles[s]["z-index"]=l),p!==null&&(this._styles[s].opacity=p),K({styleBucket:this._styles[s],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),K({styleBucket:this._styles[s],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(r("hide"))&&(this._styles[s].display="none"),this.hasAttribute(r("show"))&&(this._styles[s].display="block")});let t=G(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,s){if(s==null||s==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,s)}_syncValueAttribute(){this._inputElement.value=this.getAttribute("value")??""}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("type"),r=new Set(["text","password","date","time","datetime-local"]).has(t)?t:"text",i=this.getAttribute("min"),n=this.getAttribute("max"),o=this.getAttribute("step"),p=this.hasAttribute("disabled");this._setOrRemoveInputAttribute("type",r),this._setOrRemoveInputAttribute("min",i),this._setOrRemoveInputAttribute("max",n),this._setOrRemoveInputAttribute("step",o),p?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},ve=({render:e,html:t})=>Qt;var xo=ve({}),Ge="date",Zt=class extends xo{connectedCallback(){this.getAttribute("type")!==Ge&&super.setAttribute("type",Ge),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,s,r){if(t==="type"&&r!==Ge){this.getAttribute("type")!==Ge&&super.setAttribute("type",Ge);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,s,r)}},kr=({render:e,html:t})=>Zt;var So=ve({}),Je="time",Xt=class extends So{connectedCallback(){this.getAttribute("type")!==Je&&super.setAttribute("type",Je),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,s,r){if(t==="type"&&r!==Je){this.getAttribute("type")!==Je&&super.setAttribute("type",Je);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,s,r)}},Er=({render:e,html:t})=>Xt;var Ao=ve({}),Qe="datetime-local",es=class extends Ao{connectedCallback(){this.getAttribute("type")!==Qe&&super.setAttribute("type",Qe),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,s,r){if(t==="type"&&r!==Qe){this.getAttribute("type")!==Qe&&super.setAttribute("type",Qe);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,s,r)}},$r=({render:e,html:t})=>es;var ko=["mt","mr","mb","ml","m","mh","mv","cur"],ts=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(O`
1161
+ ${W}
1162
+ ${D}
1163
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=F(),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",...M([..._o,"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,s,i){if(s!==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=F(),te.forEach(s=>{let i=a=>`${s==="default"?"":`${s}-`}${a}`,r=this.getAttribute(i("wh")),n=T(r===null?this.getAttribute(i("w")):r),o=T(r===null?this.getAttribute(i("h")):r),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[s]["z-index"]=l),p!==null&&(this._styles[s].opacity=p),K({styleBucket:this._styles[s],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),K({styleBucket:this._styles[s],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[s].display="none"),this.hasAttribute(i("show"))&&(this._styles[s].display="block")});let t=G(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,s){if(s==null||s==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,s)}_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",r=this.getAttribute("min"),n=this.getAttribute("max"),o=this.getAttribute("step"),p=this.hasAttribute("disabled");this._setOrRemoveInputAttribute("type",i),this._setOrRemoveInputAttribute("min",r),this._setOrRemoveInputAttribute("max",n),this._setOrRemoveInputAttribute("step",o),p?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},ve=({render:e,html:t})=>Qt;var xo=ve({}),Ge="date",Zt=class extends xo{connectedCallback(){this.getAttribute("type")!==Ge&&super.setAttribute("type",Ge),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,s,i){if(t==="type"&&i!==Ge){this.getAttribute("type")!==Ge&&super.setAttribute("type",Ge);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,s,i)}},Ei=({render:e,html:t})=>Zt;var So=ve({}),Je="time",Xt=class extends So{connectedCallback(){this.getAttribute("type")!==Je&&super.setAttribute("type",Je),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,s,i){if(t==="type"&&i!==Je){this.getAttribute("type")!==Je&&super.setAttribute("type",Je);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,s,i)}},ki=({render:e,html:t})=>Xt;var Ao=ve({}),Qe="datetime-local",es=class extends Ao{connectedCallback(){this.getAttribute("type")!==Qe&&super.setAttribute("type",Qe),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,s,i){if(t==="type"&&i!==Qe){this.getAttribute("type")!==Qe&&super.setAttribute("type",Qe);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,s,i)}},$i=({render:e,html:t})=>es;var Eo=["mt","mr","mb","ml","m","mh","mv","cur"],ts=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(O`
1164
1164
  :host {
1165
1165
  display: contents;
1166
1166
  }
@@ -1193,9 +1193,9 @@ var rettangoli=(()=>{var _e=`
1193
1193
  input:disabled {
1194
1194
  cursor: not-allowed;
1195
1195
  }
1196
- ${M}
1197
- ${P}
1198
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=F(),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",...W([...ko,"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,{commit:s=!1}={})=>{if(this._inputElement.value.trim()===""){if(this._inputElement.validity.badInput)return;this.dispatchEvent(new CustomEvent(t,{detail:{value:null},bubbles:!0}));return}let i=this._inputElement.valueAsNumber;if(!Number.isNaN(i)){let n=s?this._clampValueToBounds(i):i;s&&(this._inputElement.value=n.toString()),this.dispatchEvent(new CustomEvent(t,{detail:{value:n},bubbles:!0}))}};_onInput=()=>{this._emitValueEvent("value-input")};_onChange=()=>{this._emitValueEvent("value-change",{commit:!0})};attributeChangedCallback(t,s,r){if(s!==r){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=F(),te.forEach(s=>{let r=a=>`${s==="default"?"":`${s}-`}${a}`,i=this.getAttribute(r("wh")),n=T(i===null?this.getAttribute(r("w")):i),o=T(i===null?this.getAttribute(r("h")):i),p=this.getAttribute(r("op")),l=this.getAttribute(r("z"));l!==null&&(this._styles[s]["z-index"]=l),p!==null&&(this._styles[s].opacity=p),K({styleBucket:this._styles[s],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),K({styleBucket:this._styles[s],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(r("hide"))&&(this._styles[s].display="none"),this.hasAttribute(r("show"))&&(this._styles[s].display="block")});let t=G(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,s){if(s==null||s==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,s)}_clampValueToBounds(t){let s=t,r=this.getAttribute("min");if(r!==null){let n=parseFloat(r);isNaN(n)||(s=Math.max(s,n))}let i=this.getAttribute("max");if(i!==null){let n=parseFloat(i);isNaN(n)||(s=Math.min(s,n))}return s}_syncValueAttribute(){let t=this.getAttribute("value");if(t==null||t===""){this._inputElement.value="";return}let s=parseFloat(t);if(isNaN(s)){this._inputElement.value="";return}let r=this._clampValueToBounds(s);this._inputElement.value=r.toString()}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("step"),s=this.getAttribute("min"),r=this.getAttribute("max"),i=this.hasAttribute("disabled");this._inputElement.setAttribute("type","number"),this._setOrRemoveInputAttribute("step",t),this._setOrRemoveInputAttribute("min",s),this._setOrRemoveInputAttribute("max",r),i?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},Cr=({render:e,html:t})=>ts;var ss=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
1196
+ ${W}
1197
+ ${D}
1198
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=F(),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",...M([...Eo,"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,{commit:s=!1}={})=>{if(this._inputElement.value.trim()===""){if(this._inputElement.validity.badInput)return;this.dispatchEvent(new CustomEvent(t,{detail:{value:null},bubbles:!0}));return}let r=this._inputElement.valueAsNumber;if(!Number.isNaN(r)){let n=s?this._clampValueToBounds(r):r;s&&(this._inputElement.value=n.toString()),this.dispatchEvent(new CustomEvent(t,{detail:{value:n},bubbles:!0}))}};_onInput=()=>{this._emitValueEvent("value-input")};_onChange=()=>{this._emitValueEvent("value-change",{commit:!0})};attributeChangedCallback(t,s,i){if(s!==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=F(),te.forEach(s=>{let i=a=>`${s==="default"?"":`${s}-`}${a}`,r=this.getAttribute(i("wh")),n=T(r===null?this.getAttribute(i("w")):r),o=T(r===null?this.getAttribute(i("h")):r),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[s]["z-index"]=l),p!==null&&(this._styles[s].opacity=p),K({styleBucket:this._styles[s],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),K({styleBucket:this._styles[s],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[s].display="none"),this.hasAttribute(i("show"))&&(this._styles[s].display="block")});let t=G(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,s){if(s==null||s==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,s)}_clampValueToBounds(t){let s=t,i=this.getAttribute("min");if(i!==null){let n=parseFloat(i);isNaN(n)||(s=Math.max(s,n))}let r=this.getAttribute("max");if(r!==null){let n=parseFloat(r);isNaN(n)||(s=Math.min(s,n))}return s}_syncValueAttribute(){let t=this.getAttribute("value");if(t==null||t===""){this._inputElement.value="";return}let s=parseFloat(t);if(isNaN(s)){this._inputElement.value="";return}let i=this._clampValueToBounds(s);this._inputElement.value=i.toString()}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("step"),s=this.getAttribute("min"),i=this.getAttribute("max"),r=this.hasAttribute("disabled");this._inputElement.setAttribute("type","number"),this._setOrRemoveInputAttribute("step",t),this._setOrRemoveInputAttribute("min",s),this._setOrRemoveInputAttribute("max",i),r?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},Ci=({render:e,html:t})=>ts;var ss=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
1199
1199
  :host {
1200
1200
  display: contents;
1201
1201
  }
@@ -1221,9 +1221,9 @@ var rettangoli=(()=>{var _e=`
1221
1221
  textarea:disabled {
1222
1222
  cursor: not-allowed;
1223
1223
  }
1224
- ${M}
1225
- ${P}
1226
- `))}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",...W([...pe,"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,s,r){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 o=h=>`${n==="default"?"":`${n}-`}${h}`,p=this.getAttribute(o("wh")),l=T(p===null?this.getAttribute(o("w")):p),a=T(p===null?this.getAttribute(o("h")):p),c=this.getAttribute(o("op")),d=this.getAttribute(o("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),a==="f"?this._styles[n].height="100%":a!==void 0&&(this._styles[n].height=a,this._styles[n]["min-height"]=a,this._styles[n]["max-height"]=a),this.hasAttribute(o("hide"))&&(this._styles[n].display="none"),this.hasAttribute(o("show"))&&(this._styles[n].display="block")});let i=G(this._styles,"textarea");i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateTextareaAttributes(){let t=this.getAttribute("cols"),s=this.getAttribute("rows"),r=this.hasAttribute("disabled");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),s!==null?this._textareaElement.setAttribute("rows",s):this._textareaElement.removeAttribute("rows"),r?this._textareaElement.setAttribute("disabled",""):this._textareaElement.removeAttribute("disabled")}},Ir=({render:e,html:t})=>ss;var Eo=["mt","mr","mb","ml","m","mh","mv","cur"],$o=/^#[0-9a-fA-F]{6}$/,rs=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
1224
+ ${W}
1225
+ ${D}
1226
+ `))}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",...M([...pe,"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,s,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 o=h=>`${n==="default"?"":`${n}-`}${h}`,p=this.getAttribute(o("wh")),l=T(p===null?this.getAttribute(o("w")):p),a=T(p===null?this.getAttribute(o("h")):p),c=this.getAttribute(o("op")),d=this.getAttribute(o("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),a==="f"?this._styles[n].height="100%":a!==void 0&&(this._styles[n].height=a,this._styles[n]["min-height"]=a,this._styles[n]["max-height"]=a),this.hasAttribute(o("hide"))&&(this._styles[n].display="none"),this.hasAttribute(o("show"))&&(this._styles[n].display="block")});let r=G(this._styles,"textarea");r!==this._lastStyleString&&(this._styleElement.textContent=r,this._lastStyleString=r)}_updateTextareaAttributes(){let t=this.getAttribute("cols"),s=this.getAttribute("rows"),i=this.hasAttribute("disabled");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),s!==null?this._textareaElement.setAttribute("rows",s):this._textareaElement.removeAttribute("rows"),i?this._textareaElement.setAttribute("disabled",""):this._textareaElement.removeAttribute("disabled")}},Ii=({render:e,html:t})=>ss;var ko=["mt","mr","mb","ml","m","mh","mv","cur"],$o=/^#[0-9a-fA-F]{6}$/,is=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
1227
1227
  :host {
1228
1228
  display: contents;
1229
1229
  }
@@ -1244,9 +1244,9 @@ var rettangoli=(()=>{var _e=`
1244
1244
  cursor: not-allowed;
1245
1245
  opacity: 0.5;
1246
1246
  }
1247
- ${M}
1248
- ${P}
1249
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=F(),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",...W([...Eo,"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,s,r){if(s!==r){if(t==="key"){this._syncValueAttribute();return}if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=F(),te.forEach(s=>{let r=a=>`${s==="default"?"":`${s}-`}${a}`,i=this.getAttribute(r("wh")),n=T(i===null?this.getAttribute(r("w")):i),o=T(i===null?this.getAttribute(r("h")):i),p=this.getAttribute(r("op")),l=this.getAttribute(r("z"));l!==null&&(this._styles[s]["z-index"]=l),p!==null&&(this._styles[s].opacity=p),K({styleBucket:this._styles[s],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),K({styleBucket:this._styles[s],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(r("hide"))&&(this._styles[s].display="none"),this.hasAttribute(r("show"))&&(this._styles[s].display="block")});let t=G(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=$o.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()}},Or=({render:e,html:t})=>rs;var is=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
1247
+ ${W}
1248
+ ${D}
1249
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=F(),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",...M([...ko,"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,s,i){if(s!==i){if(t==="key"){this._syncValueAttribute();return}if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=F(),te.forEach(s=>{let i=a=>`${s==="default"?"":`${s}-`}${a}`,r=this.getAttribute(i("wh")),n=T(r===null?this.getAttribute(i("w")):r),o=T(r===null?this.getAttribute(i("h")):r),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[s]["z-index"]=l),p!==null&&(this._styles[s].opacity=p),K({styleBucket:this._styles[s],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),K({styleBucket:this._styles[s],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[s].display="none"),this.hasAttribute(i("show"))&&(this._styles[s].display="block")});let t=G(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=$o.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()}},Oi=({render:e,html:t})=>is;var rs=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
1250
1250
  :host {
1251
1251
  display: contents;
1252
1252
  }
@@ -1298,9 +1298,9 @@ var rettangoli=(()=>{var _e=`
1298
1298
  input[type="range"]:disabled::-moz-range-thumb {
1299
1299
  cursor: not-allowed;
1300
1300
  }
1301
- ${M}
1302
- ${P}
1303
- `))}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",...W([...pe,"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,s,r){if(t==="key"&&s!==r){requestAnimationFrame(()=>{let n=this.getAttribute("value"),o=this.getAttribute("min")||"0";this._inputElement.value=n??o});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 o=h=>`${n==="default"?"":`${n}-`}${h}`,p=this.getAttribute(o("wh")),l=T(p===null?this.getAttribute(o("w")):p),a=T(p===null?this.getAttribute(o("h")):p),c=this.getAttribute(o("op")),d=this.getAttribute(o("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),a==="f"?this._styles[n].height="100%":a!==void 0&&(this._styles[n].height=a,this._styles[n]["min-height"]=a,this._styles[n]["max-height"]=a),this.hasAttribute(o("hide"))&&(this._styles[n].display="none"),this.hasAttribute(o("show"))&&(this._styles[n].display="block")});let i=G(this._styles,'input[type="range"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("value"),s=this.getAttribute("min"),r=this.getAttribute("max"),i=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null?this._inputElement.value=t:this._inputElement.value=s??0,s!==null?this._inputElement.min=s:this._inputElement.min="0",r!==null?this._inputElement.max=r:this._inputElement.max="100",i!==null?this._inputElement.step=i:this._inputElement.step="1",n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Tr=({render:e,html:t})=>is;var ns=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
1301
+ ${W}
1302
+ ${D}
1303
+ `))}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",...M([...pe,"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,s,i){if(t==="key"&&s!==i){requestAnimationFrame(()=>{let n=this.getAttribute("value"),o=this.getAttribute("min")||"0";this._inputElement.value=n??o});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 o=h=>`${n==="default"?"":`${n}-`}${h}`,p=this.getAttribute(o("wh")),l=T(p===null?this.getAttribute(o("w")):p),a=T(p===null?this.getAttribute(o("h")):p),c=this.getAttribute(o("op")),d=this.getAttribute(o("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),a==="f"?this._styles[n].height="100%":a!==void 0&&(this._styles[n].height=a,this._styles[n]["min-height"]=a,this._styles[n]["max-height"]=a),this.hasAttribute(o("hide"))&&(this._styles[n].display="none"),this.hasAttribute(o("show"))&&(this._styles[n].display="block")});let r=G(this._styles,'input[type="range"]');r!==this._lastStyleString&&(this._styleElement.textContent=r,this._lastStyleString=r)}_updateInputAttributes(){let t=this.getAttribute("value"),s=this.getAttribute("min"),i=this.getAttribute("max"),r=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null?this._inputElement.value=t:this._inputElement.value=s??0,s!==null?this._inputElement.min=s:this._inputElement.min="0",i!==null?this._inputElement.max=i:this._inputElement.max="100",r!==null?this._inputElement.step=r:this._inputElement.step="1",n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Ti=({render:e,html:t})=>rs;var ns=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
1304
1304
  :host {
1305
1305
  display: inline-flex;
1306
1306
  }
@@ -1367,9 +1367,9 @@ var rettangoli=(()=>{var _e=`
1367
1367
  cursor: not-allowed;
1368
1368
  opacity: 0.5;
1369
1369
  }
1370
- ${M}
1371
- ${P}
1372
- `))}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",...W([...pe,"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,s,r){if(t==="key"&&s!==r){requestAnimationFrame(()=>{let n=this.hasAttribute("checked");this._inputElement.checked=n});return}if(t==="checked"){this._inputElement.checked=r!==null;return}if(t==="disabled"){r!==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 o=h=>`${n==="default"?"":`${n}-`}${h}`,p=this.getAttribute(o("wh")),l=T(p===null?this.getAttribute(o("w")):p),a=T(p===null?this.getAttribute(o("h")):p),c=this.getAttribute(o("op")),d=this.getAttribute(o("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),a==="f"?this._styles[n].height="100%":a!==void 0&&(this._styles[n].height=a,this._styles[n]["min-height"]=a,this._styles[n]["max-height"]=a),this.hasAttribute(o("hide"))&&(this._styles[n].display="none"),this.hasAttribute(o("show"))&&(this._styles[n].display="block")});let i=G(this._styles,'input[type="checkbox"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}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"),s=t??"";this._labelSlotElement.textContent!==s&&(this._labelSlotElement.textContent=s);let i=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,o=i||n;o&&!this.hasAttribute("has-label")?this.setAttribute("has-label",""):!o&&this.hasAttribute("has-label")&&this.removeAttribute("has-label")}finally{this._isSyncingLabelState=!1}}}},Lr=({render:e,html:t})=>ns;var os=40,Co=6,Io=["sm","md","lg","xl"],as=32,ls=8,Ze="data-rtgl-active-layout",Oo=`:host([${Ze}="fixed"])`,To=e=>e.replace(/^@media\s+/,""),Lo=e=>O`
1370
+ ${W}
1371
+ ${D}
1372
+ `))}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",...M([...pe,"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,s,i){if(t==="key"&&s!==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 o=h=>`${n==="default"?"":`${n}-`}${h}`,p=this.getAttribute(o("wh")),l=T(p===null?this.getAttribute(o("w")):p),a=T(p===null?this.getAttribute(o("h")):p),c=this.getAttribute(o("op")),d=this.getAttribute(o("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),a==="f"?this._styles[n].height="100%":a!==void 0&&(this._styles[n].height=a,this._styles[n]["min-height"]=a,this._styles[n]["max-height"]=a),this.hasAttribute(o("hide"))&&(this._styles[n].display="none"),this.hasAttribute(o("show"))&&(this._styles[n].display="block")});let r=G(this._styles,'input[type="checkbox"]');r!==this._lastStyleString&&(this._styleElement.textContent=r,this._lastStyleString=r)}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"),s=t??"";this._labelSlotElement.textContent!==s&&(this._labelSlotElement.textContent=s);let r=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,o=r||n;o&&!this.hasAttribute("has-label")?this.setAttribute("has-label",""):!o&&this.hasAttribute("has-label")&&this.removeAttribute("has-label")}finally{this._isSyncingLabelState=!1}}}},Li=({render:e,html:t})=>ns;var os=40,Co=6,Io=["sm","md","lg","xl"],as=32,ls=8,Ze="data-rtgl-active-layout",Oo=`:host([${Ze}="fixed"])`,To=new Set(["date","datetime-local","month","time","week"]),Lo=e=>e.replace(/^@media\s+/,""),Vo=e=>O`
1373
1373
  ${e} dialog {
1374
1374
  width: 100vw !important;
1375
1375
  max-width: 100vw !important;
@@ -1548,7 +1548,7 @@ var rettangoli=(()=>{var _e=`
1548
1548
  }
1549
1549
  }
1550
1550
 
1551
- ${Lo(Oo)}
1551
+ ${Vo(Oo)}
1552
1552
 
1553
1553
  :host([no-padding]) slot[name="content"] {
1554
1554
  margin-left: 0;
@@ -1556,7 +1556,22 @@ var rettangoli=(()=>{var _e=`
1556
1556
  max-width: 100vw;
1557
1557
  padding: 0;
1558
1558
  }
1559
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this._dialogElement.tabIndex=-1,this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._closeButtonElement=null,this._isConnected=!1,this._adaptiveFrameId=null,this._layoutRetryCount=0,this._observedContentElement=null,this._managedLongTokenTextElements=new Set,this._contentMutationObserver=typeof MutationObserver<"u"?new MutationObserver(()=>{this._syncLongTokenWrapping()}):null,this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._scheduleAdaptiveCentering()}):null,this._onSlotChange=()=>{this._syncLongTokenWrapping(),this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0})},this._onWindowResize=()=>{this._updateActiveLayoutAttribute(),this._scheduleAdaptiveCentering({resetRetries:!0})},this._onDialogScroll=()=>{this._updateCloseButtonPosition()},this._onCloseButtonClick=t=>{t.preventDefault(),t.stopPropagation(),this._attemptClose()},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","close-button",...W(["layout"])]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}disconnectedCallback(){this._isConnected=!1,this._clearManagedLongTokenWrapping(),this._stopAdaptiveObservers(),this._slotElement&&this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,s,r){t==="open"?r!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():r===null&&this._dialogElement.open&&this._hideModal():t==="s"||t.endsWith("layout")?(this._updateActiveLayoutAttribute(),this._scheduleAdaptiveCentering({resetRetries:!0})):t==="w"?this._updateWidth():t==="close-button"&&(this._updateCloseButton(),this._updateCloseButtonPosition())}_updateDialog(){this._updateWidth(),this._updateCloseButton(),this._updateActiveLayoutAttribute()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_updateCloseButton(){this._closeButtonElement&&(this._closeButtonElement.setAttribute("aria-label","Close dialog"),this._closeButtonElement.hidden=!this.hasAttribute("close-button"))}_createCloseButtonElement(){let t=document.createElement("button");return t.type="button",t.className="close-button",t.addEventListener("click",this._onCloseButtonClick),t}_clearManagedLongTokenWrapping(){for(let t of this._managedLongTokenTextElements)t?.isConnected&&t.removeAttribute("break-long-tokens");this._managedLongTokenTextElements.clear()}_collectTextElements(t,s){if(!(!t||t.nodeType!==Node.ELEMENT_NODE)){t.localName==="rtgl-text"&&s.push(t);for(let r of t.children)this._collectTextElements(r,s);if(t.shadowRoot)for(let r of t.shadowRoot.children)this._collectTextElements(r,s)}}_syncLongTokenWrapping(){if(this._clearManagedLongTokenWrapping(),!this._slotElement)return;let t=this._slotElement.assignedNodes({flatten:!0}),s=[];for(let r of t)this._collectTextElements(r,s);for(let r of s)r.hasAttribute("ellipsis")||r.hasAttribute("break-long-tokens")||(r.setAttribute("break-long-tokens",""),this._managedLongTokenTextElements.add(r))}_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._closeButtonElement||(this._closeButtonElement=this._createCloseButtonElement(),this._dialogElement.appendChild(this._closeButtonElement)),this._updateCloseButton(),this._updateActiveLayoutAttribute(),this._dialogElement.showModal(),this.shadow.activeElement===this._closeButtonElement&&this._dialogElement.focus({preventScroll:!0}),this._dialogElement.scrollTop=0,window.addEventListener("resize",this._onWindowResize),this._dialogElement.addEventListener("scroll",this._onDialogScroll,{passive:!0}),this._syncLongTokenWrapping(),this._observeAssignedContent(),this._layoutRetryCount=0,this._applyAdaptiveCentering())}_hideModal(){this._dialogElement.open&&(this._clearManagedLongTokenWrapping(),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._closeButtonElement&&(this._closeButtonElement.removeEventListener("click",this._onCloseButtonClick),this._dialogElement.removeChild(this._closeButtonElement),this._closeButtonElement=null),this._dialogElement.style.height="",this._dialogElement.style.removeProperty("--rtgl-dialog-close-top"),this._dialogElement.style.removeProperty("--rtgl-dialog-close-left"))}_stopAdaptiveObservers(){this._adaptiveFrameId!==null&&(cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=null),this._layoutRetryCount=0,window.removeEventListener("resize",this._onWindowResize),this._dialogElement.removeEventListener("scroll",this._onDialogScroll),this._resizeObserver&&this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._contentMutationObserver&&this._contentMutationObserver.disconnect(),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&&!this._contentMutationObserver)return;let t=this._getAssignedContentElement();this._observedContentElement!==t&&(this._observedContentElement&&(this._resizeObserver&&this._resizeObserver.unobserve(this._observedContentElement),this._contentMutationObserver&&this._contentMutationObserver.disconnect()),this._observedContentElement=t,this._observedContentElement&&(this._resizeObserver&&this._resizeObserver.observe(this._observedContentElement),this._contentMutationObserver&&this._contentMutationObserver.observe(this._observedContentElement,{childList:!0,subtree:!0}),this._syncLongTokenWrapping()))}_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()})}))}_getActiveResponsiveSize(){if(typeof window>"u"||typeof window.matchMedia!="function")return"default";for(let t of Io){let s=Ae[t];if(s&&window.matchMedia(To(s)).matches)return t}return"default"}_getActiveLayout(){return Se({element:this,size:this._getActiveResponsiveSize(),attr:"layout"})||"centered"}_isFixedLayoutActive(){return this._updateActiveLayoutAttribute()==="fixed"}_updateActiveLayoutAttribute(){let t=this._getActiveLayout();return t==="fixed"?this.getAttribute(Ze)!=="fixed"&&this.setAttribute(Ze,"fixed"):this.hasAttribute(Ze)&&this.removeAttribute(Ze),t}_updateCloseButtonPosition(){if(!this._slotElement||!this._closeButtonElement||!this._dialogElement.open)return;let t=Math.round(this._slotElement.getBoundingClientRect().width),s=Math.round(this._dialogElement.scrollTop),r=Math.round(this._dialogElement.scrollLeft),i=Math.max(0,Math.round(this._slotElement.offsetTop)+s+ls),n=Math.max(0,Math.round(this._slotElement.offsetLeft)+r+t-as-ls);this._dialogElement.style.setProperty("--rtgl-dialog-close-top",`${i}px`),this._dialogElement.style.setProperty("--rtgl-dialog-close-left",`${n}px`)}_applyAdaptiveCentering(){if(!this._slotElement||!this._dialogElement.open)return;if(this._isFixedLayoutActive()){this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.style.height="",this._updateCloseButtonPosition(),this._layoutRetryCount=0;return}this._observeAssignedContent();let t=this._getAssignedContentElement(),s=t?Math.round(t.getBoundingClientRect().height):0;if(s<=0){this._layoutRetryCount<Co&&(this._layoutRetryCount+=1,this._scheduleAdaptiveCentering());return}this._layoutRetryCount=0;let r=window.innerHeight;if(s>=r-2*os){this._slotElement.style.marginTop=`${os}px`,this._slotElement.style.marginBottom=`${os}px`,this._dialogElement.style.height="100vh",this._updateCloseButtonPosition();return}let i=r-s,n=Math.floor(i/2);this._slotElement.style.marginTop=`${n}px`,this._slotElement.style.marginBottom=`${n}px`,this._dialogElement.style.height="auto",this._updateCloseButtonPosition()}get dialog(){return this._dialogElement}},Vr=({render:e,html:t})=>ps;var Rr=({x:e,y:t,width:s,height:r,place:i,viewportWidth:n,viewportHeight:o,offset:p=8,padding:l=8})=>{let a=e,c=t;switch(i){case"t":a=e-s/2,c=t-r-p;break;case"ts":a=e,c=t-r-p;break;case"te":a=e-s,c=t-r-p;break;case"r":a=e+p,c=t-r/2;break;case"rs":a=e+p,c=t;break;case"re":a=e+p,c=t-r;break;case"b":a=e-s/2,c=t+p;break;case"bs":a=e,c=t+p;break;case"be":a=e-s,c=t+p;break;case"l":a=e-s-p,c=t-r/2;break;case"ls":a=e-s-p,c=t;break;case"le":a=e-s-p,c=t-r;break;case"center":case"c":a=(n-s)/2,c=(o-r)/2;break;default:a=e,c=t+p;break}return{left:Math.max(l,Math.min(a,n-s-l)),top:Math.max(l,Math.min(c,o-r-l))}};var Nr="data-rtgl-popover-content",ds="min-width: 200px; max-width: 400px; box-sizing: border-box;",Xe="data-rtgl-active-overlay",Pr="data-rtgl-active-place",Vo=["sm","md","lg","xl"],Ro=e=>e.replace(/^@media\s+/,""),Dr=(e,t=!1)=>{if(e==null)return t;if(typeof e=="boolean")return e;let s=`${e}`.trim().toLowerCase();return!["false","0","no","off"].includes(s)},cs=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
1559
+
1560
+ :host([bare]) dialog::backdrop {
1561
+ background-color: transparent;
1562
+ }
1563
+
1564
+ :host([bare]) slot[name="content"] {
1565
+ animation: none;
1566
+ background-color: transparent !important;
1567
+ border: none;
1568
+ border-radius: 0;
1569
+ margin-left: 0;
1570
+ margin-right: 0;
1571
+ max-width: 100vw;
1572
+ padding: 0;
1573
+ }
1574
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this._dialogElement.tabIndex=-1,this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._closeButtonElement=null,this._isConnected=!1,this._adaptiveFrameId=null,this._layoutRetryCount=0,this._observedContentElement=null,this._managedLongTokenTextElements=new Set,this._contentMutationObserver=typeof MutationObserver<"u"?new MutationObserver(()=>{this._syncLongTokenWrapping()}):null,this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._scheduleAdaptiveCentering()}):null,this._onSlotChange=()=>{this._syncLongTokenWrapping(),this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0})},this._onWindowResize=()=>{this._updateActiveLayoutAttribute(),this._scheduleAdaptiveCentering({resetRetries:!0})},this._onDialogScroll=()=>{this._updateCloseButtonPosition()},this._onDialogKeyDown=t=>{this._containTabFocus(t)},this._onCloseButtonClick=t=>{t.preventDefault(),t.stopPropagation(),this._attemptClose()},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()}),this._dialogElement.addEventListener("keydown",this._onDialogKeyDown)}_attemptClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","w","s","close-button",...M(["layout"])]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}disconnectedCallback(){this._isConnected=!1,this._clearManagedLongTokenWrapping(),this._stopAdaptiveObservers(),this._slotElement&&this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,s,i){t==="open"?i!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():i===null&&this._dialogElement.open&&this._hideModal():t==="s"||t.endsWith("layout")?(this._updateActiveLayoutAttribute(),this._scheduleAdaptiveCentering({resetRetries:!0})):t==="w"?this._updateWidth():t==="close-button"&&(this._updateCloseButton(),this._updateCloseButtonPosition())}_updateDialog(){this._updateWidth(),this._updateCloseButton(),this._updateActiveLayoutAttribute()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_updateCloseButton(){this._closeButtonElement&&(this._closeButtonElement.setAttribute("aria-label","Close dialog"),this._closeButtonElement.hidden=!this.hasAttribute("close-button"))}_createCloseButtonElement(){let t=document.createElement("button");return t.type="button",t.className="close-button",t.addEventListener("click",this._onCloseButtonClick),t}_isTabbableElement(t){return this._isTabbableElementIgnoringRadioGroup(t)?!(t instanceof HTMLInputElement&&t.type==="radio"&&!this._isTabbableRadio(t)):!1}_getComposedParent(t){if(t.assignedSlot)return t.assignedSlot;if(t.parentElement)return t.parentElement;let s=t.getRootNode?.();return s instanceof ShadowRoot?s.host:null}_hasInertComposedAncestor(t){let s=t;for(;s;){if(s instanceof HTMLElement&&s.inert)return!0;s=this._getComposedParent(s)}return!1}_isEditingHost(t){if(!(t instanceof HTMLElement)||!t.isContentEditable)return!1;let s=this._getComposedParent(t);return!(s instanceof HTMLElement&&s.isContentEditable)}_getSequentialTabIndex(t){return typeof t.tabIndex=="number"&&t.tabIndex>=0?t.tabIndex:!t.hasAttribute("tabindex")&&this._isEditingHost(t)?0:null}_isHiddenByClosedDetails(t){let s=t,i=this._getComposedParent(s);for(;i;){if(i instanceof HTMLDetailsElement&&!i.open){let r=[...i.children].find(n=>n instanceof HTMLElement&&n.localName==="summary");if(s!==r)return!0}s=i,i=this._getComposedParent(s)}return!1}_isInsideDialog(t){let s=t;for(;s;){if(s===this._dialogElement)return!0;s=this._getComposedParent(s)}return!1}_isTabbableRadio(t){if(!t.name)return!0;let i=[...t.getRootNode().querySelectorAll("input[type='radio']")].filter(n=>n.name===t.name&&n.form===t.form&&this._isInsideDialog(n)&&this._isTabbableElementIgnoringRadioGroup(n)),r=i.find(n=>n.checked);return t===(r??i[0])}_isTabbableElementIgnoringRadioGroup(t){if(!(t instanceof Element)||this._getSequentialTabIndex(t)===null||t.matches(":disabled")||t instanceof HTMLInputElement&&t.type==="hidden"||this._hasInertComposedAncestor(t)||this._isHiddenByClosedDetails(t))return!1;let s=getComputedStyle(t),i=s.display!=="none"&&s.visibility!=="hidden"&&s.visibility!=="collapse";return t instanceof HTMLAreaElement?i&&this._hasVisibleAssociatedImage(t):t.getClientRects().length>0&&i}_hasVisibleAssociatedImage(t){let s=t.closest("map[name]");if(!(s instanceof HTMLMapElement)||!s.name)return!1;let i=s.getRootNode();return i instanceof Document||i instanceof ShadowRoot?[...i.querySelectorAll("img[usemap]")].some(r=>{if(r.getAttribute("usemap")?.trim()!==`#${s.name}`||this._hasInertComposedAncestor(r)||this._isHiddenByClosedDetails(r))return!1;let o=getComputedStyle(r);return r.getClientRects().length>0&&o.display!=="none"&&o.visibility!=="hidden"&&o.visibility!=="collapse"}):!1}_appendTabScope(t,s,i){let r=t.hasAttribute("tabindex");if(r&&t.tabIndex<0)return;let n=[];this._collectTabOrderItems(s,n);let o=[];this._isTabbableElement(t)&&o.push(t),o.push(...this._sortTabOrderItems(n)),o.length>0&&i.push({tabIndex:r?t.tabIndex:0,elements:o})}_collectTabOrderItems(t,s){for(let i of t)if(i instanceof Element){if(i instanceof HTMLSlotElement){let r=i.assignedElements(),n=r.length>0?r:[...i.children];this._appendTabScope(i,n,s);continue}if(i.shadowRoot){this._appendTabScope(i,[...i.shadowRoot.children],s);continue}this._isTabbableElement(i)&&s.push({tabIndex:this._getSequentialTabIndex(i),elements:[i]}),this._collectTabOrderItems(i.children,s)}}_sortTabOrderItems(t){let s=t.map((r,n)=>({...r,documentOrder:n})).filter(r=>r.tabIndex>0).sort((r,n)=>r.tabIndex-n.tabIndex||r.documentOrder-n.documentOrder),i=t.filter(r=>r.tabIndex===0);return[...s,...i].flatMap(r=>r.elements)}_getTabbableElements(){let t=[];return this._collectTabOrderItems(this._dialogElement.children,t),this._sortTabOrderItems(t)}_getDeepActiveElement(){let t=document.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}_hasNativeInternalTabSequence(t){return t instanceof HTMLInputElement&&To.has(t.type)}_deferNativeTabContainment(t){setTimeout(()=>{if(!this._dialogElement.matches(":modal"))return;let s=this._getDeepActiveElement();if(s&&this._isInsideDialog(s))return;let i=this._getTabbableElements(),r=t?i[i.length-1]:i[0];r?r.focus({preventScroll:!0}):this._dialogElement.focus({preventScroll:!0})},0)}_containTabFocus(t){if(t.key!=="Tab"||t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey||!this._isTabEventOwnedByDialog(t))return;let s=this._getTabbableElements();if(s.length===0){t.preventDefault(),this._dialogElement.focus({preventScroll:!0});return}let i=this._getDeepActiveElement(),r=s[0],n=s[s.length-1],o=t.shiftKey&&(i===r||i===this._dialogElement),p=!t.shiftKey&&i===n;if(!o&&!p)return;if(this._hasNativeInternalTabSequence(i)){this._deferNativeTabContainment(o);return}t.preventDefault(),(o?n:r).focus({preventScroll:!0})}_isTabEventOwnedByDialog(t){for(let s of t.composedPath())if(s instanceof HTMLDialogElement){if(s===this._dialogElement)return!0;if(s.matches(":modal"))return!1}return!1}_clearManagedLongTokenWrapping(){for(let t of this._managedLongTokenTextElements)t?.isConnected&&t.removeAttribute("break-long-tokens");this._managedLongTokenTextElements.clear()}_collectTextElements(t,s){if(!(!t||t.nodeType!==Node.ELEMENT_NODE)){t.localName==="rtgl-text"&&s.push(t);for(let i of t.children)this._collectTextElements(i,s);if(t.shadowRoot)for(let i of t.shadowRoot.children)this._collectTextElements(i,s)}}_syncLongTokenWrapping(){if(this._clearManagedLongTokenWrapping(),!this._slotElement)return;let t=this._slotElement.assignedNodes({flatten:!0}),s=[];for(let i of t)this._collectTextElements(i,s);for(let i of s)i.hasAttribute("ellipsis")||i.hasAttribute("break-long-tokens")||(i.setAttribute("break-long-tokens",""),this._managedLongTokenTextElements.add(i))}_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._closeButtonElement||(this._closeButtonElement=this._createCloseButtonElement(),this._dialogElement.appendChild(this._closeButtonElement)),this._updateCloseButton(),this._updateActiveLayoutAttribute(),this._dialogElement.showModal(),this.shadow.activeElement===this._closeButtonElement&&this._dialogElement.focus({preventScroll:!0}),this._dialogElement.scrollTop=0,window.addEventListener("resize",this._onWindowResize),this._dialogElement.addEventListener("scroll",this._onDialogScroll,{passive:!0}),this._syncLongTokenWrapping(),this._observeAssignedContent(),this._layoutRetryCount=0,this._applyAdaptiveCentering())}_hideModal(){this._dialogElement.open&&(this._clearManagedLongTokenWrapping(),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._closeButtonElement&&(this._closeButtonElement.removeEventListener("click",this._onCloseButtonClick),this._dialogElement.removeChild(this._closeButtonElement),this._closeButtonElement=null),this._dialogElement.style.height="",this._dialogElement.style.removeProperty("--rtgl-dialog-close-top"),this._dialogElement.style.removeProperty("--rtgl-dialog-close-left"))}_stopAdaptiveObservers(){this._adaptiveFrameId!==null&&(cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=null),this._layoutRetryCount=0,window.removeEventListener("resize",this._onWindowResize),this._dialogElement.removeEventListener("scroll",this._onDialogScroll),this._resizeObserver&&this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._contentMutationObserver&&this._contentMutationObserver.disconnect(),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&&!this._contentMutationObserver)return;let t=this._getAssignedContentElement();this._observedContentElement!==t&&(this._observedContentElement&&(this._resizeObserver&&this._resizeObserver.unobserve(this._observedContentElement),this._contentMutationObserver&&this._contentMutationObserver.disconnect()),this._observedContentElement=t,this._observedContentElement&&(this._resizeObserver&&this._resizeObserver.observe(this._observedContentElement),this._contentMutationObserver&&this._contentMutationObserver.observe(this._observedContentElement,{childList:!0,subtree:!0}),this._syncLongTokenWrapping()))}_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()})}))}_getActiveResponsiveSize(){if(typeof window>"u"||typeof window.matchMedia!="function")return"default";for(let t of Io){let s=Ae[t];if(s&&window.matchMedia(Lo(s)).matches)return t}return"default"}_getActiveLayout(){return Se({element:this,size:this._getActiveResponsiveSize(),attr:"layout"})||"centered"}_isFixedLayoutActive(){return this._updateActiveLayoutAttribute()==="fixed"}_updateActiveLayoutAttribute(){let t=this._getActiveLayout();return t==="fixed"?this.getAttribute(Ze)!=="fixed"&&this.setAttribute(Ze,"fixed"):this.hasAttribute(Ze)&&this.removeAttribute(Ze),t}_updateCloseButtonPosition(){if(!this._slotElement||!this._closeButtonElement||!this._dialogElement.open)return;let t=Math.round(this._slotElement.getBoundingClientRect().width),s=Math.round(this._dialogElement.scrollTop),i=Math.round(this._dialogElement.scrollLeft),r=Math.max(0,Math.round(this._slotElement.offsetTop)+s+ls),n=Math.max(0,Math.round(this._slotElement.offsetLeft)+i+t-as-ls);this._dialogElement.style.setProperty("--rtgl-dialog-close-top",`${r}px`),this._dialogElement.style.setProperty("--rtgl-dialog-close-left",`${n}px`)}_applyAdaptiveCentering(){if(!this._slotElement||!this._dialogElement.open)return;if(this._isFixedLayoutActive()){this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.style.height="",this._updateCloseButtonPosition(),this._layoutRetryCount=0;return}this._observeAssignedContent();let t=this._getAssignedContentElement(),s=t?Math.round(t.getBoundingClientRect().height):0;if(s<=0){this._layoutRetryCount<Co&&(this._layoutRetryCount+=1,this._scheduleAdaptiveCentering());return}this._layoutRetryCount=0;let i=window.innerHeight;if(s>=i-2*os){this._slotElement.style.marginTop=`${os}px`,this._slotElement.style.marginBottom=`${os}px`,this._dialogElement.style.height="100vh",this._updateCloseButtonPosition();return}let r=i-s,n=Math.floor(r/2);this._slotElement.style.marginTop=`${n}px`,this._slotElement.style.marginBottom=`${n}px`,this._dialogElement.style.height="auto",this._updateCloseButtonPosition()}get dialog(){return this._dialogElement}},Vi=({render:e,html:t})=>ps;var Ri=({x:e,y:t,width:s,height:i,place:r,viewportWidth:n,viewportHeight:o,offset:p=8,padding:l=8})=>{let a=e,c=t;switch(r){case"t":a=e-s/2,c=t-i-p;break;case"ts":a=e,c=t-i-p;break;case"te":a=e-s,c=t-i-p;break;case"r":a=e+p,c=t-i/2;break;case"rs":a=e+p,c=t;break;case"re":a=e+p,c=t-i;break;case"b":a=e-s/2,c=t+p;break;case"bs":a=e,c=t+p;break;case"be":a=e-s,c=t+p;break;case"l":a=e-s-p,c=t-i/2;break;case"ls":a=e-s-p,c=t;break;case"le":a=e-s-p,c=t-i;break;case"center":case"c":a=(n-s)/2,c=(o-i)/2;break;default:a=e,c=t+p;break}return{left:Math.max(l,Math.min(a,n-s-l)),top:Math.max(l,Math.min(c,o-i-l))}};var Ni="data-rtgl-popover-content",ds="min-width: 200px; max-width: 400px; box-sizing: border-box;",Xe="data-rtgl-active-overlay",Di="data-rtgl-active-place",Ro=["sm","md","lg","xl"],No=e=>e.replace(/^@media\s+/,""),Pi=(e,t=!1)=>{if(e==null)return t;if(typeof e=="boolean")return e;let s=`${e}`.trim().toLowerCase();return!["false","0","no","off"].includes(s)},cs=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
1560
1575
  :host {
1561
1576
  display: contents;
1562
1577
  }
@@ -1609,19 +1624,19 @@ var rettangoli=(()=>{var _e=`
1609
1624
  slot[name="content"] {
1610
1625
  display: contents;
1611
1626
  }
1612
- `))}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 s=t.composedPath();(s[0]===this._dialogElement||s[0].nodeName==="DIALOG"&&s[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let s=t.composedPath();(s[0]===this._dialogElement||s[0].nodeName==="DIALOG"&&s[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._contentWrapper=null,this._isOpen=!1,this._positionFrameId=null,this._revealFrameId=null,this._positionVersion=0,this._isObservingResize=!1,this._isModalOpen=!1,this._observedContentWrapper=null,this._onWindowResize=()=>{this._updateActiveStateAttributes(),this._syncDialogMode(),this._schedulePositionUpdate()},this._resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>{this._isOpen&&this._schedulePositionUpdate()}):null}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y",...W(["place","overlay","no-overlay"]),"content-w","content-h","content-wh","content-g","content-sv","content-hsb","content-ph","content-pv","content-bgc","content-style"]}connectedCallback(){this._syncContentWrapper({reposition:!1}),this._updateActiveStateAttributes(),this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._cancelScheduledPositionUpdate(),this._stopResizeObserver(),window.removeEventListener("resize",this._onWindowResize),this._isOpen&&this._dialogElement.open&&this._dialogElement.close(),this._isModalOpen=!1}attributeChangedCallback(t,s,r){t==="open"?r!==null&&!this._isOpen?this.isConnected&&this._show():r===null&&this._isOpen&&this._hide():t==="x"||t==="y"||t.endsWith("place")?(this._updateActiveStateAttributes(),this._isOpen&&this._schedulePositionUpdate()):t.endsWith("overlay")?(this._updateActiveStateAttributes(),this._isOpen&&(this._syncDialogMode(),this._schedulePositionUpdate())):t.startsWith("content-")&&this._syncContentWrapper()}_getActiveResponsiveSize(){if(typeof window>"u"||typeof window.matchMedia!="function")return"default";for(let t of Vo){let s=Ae[t];if(s&&window.matchMedia(Ro(s)).matches)return t}return"default"}_getActiveResponsiveAttribute(t){return Se({element:this,size:this._getActiveResponsiveSize(),attr:t})}_getActivePlace(){return this._getActiveResponsiveAttribute("place")||"bs"}_isOverlayActive(){return Dr(this._getActiveResponsiveAttribute("overlay"),!1)}_isNoOverlayActive(){return Dr(this._getActiveResponsiveAttribute("no-overlay"),!1)}_shouldUseModalDialog(){return this._isOverlayActive()||!this._isNoOverlayActive()}_updateActiveStateAttributes(){let t=this._getActivePlace(),s=this._isOverlayActive();this.getAttribute(Pr)!==t&&this.setAttribute(Pr,t),s?this.getAttribute(Xe)!=="true"&&this.setAttribute(Xe,"true"):this.hasAttribute(Xe)&&this.removeAttribute(Xe)}_openDialogElement(){this._dialogElement.open||(this._shouldUseModalDialog()?(this._dialogElement.showModal(),this._isModalOpen=!0):(this._dialogElement.show(),this._isModalOpen=!1))}_syncDialogMode(){!this._isOpen||!this._dialogElement.open||this._shouldUseModalDialog()===this._isModalOpen||(this._dialogElement.close(),this._isModalOpen=!1,this._openDialogElement())}_isIgnorableTextNode(t){return t?.nodeType===Node.TEXT_NODE&&t.textContent?.trim()===""}_ensureContentWrapper(){if(this._contentWrapper?.parentNode===this)return this._contentWrapper;let t=Array.from(this.children).find(s=>s.hasAttribute(Nr));return t?this._contentWrapper=t:(this._contentWrapper=document.createElement("rtgl-view"),this._contentWrapper.setAttribute(Nr,""),this._contentWrapper.setAttribute("part","content"),this._contentWrapper.setAttribute("bgc","su"),this._contentWrapper.setAttribute("bw","xs"),this._contentWrapper.setAttribute("bc","bo"),this._contentWrapper.setAttribute("br","md"),this._contentWrapper.setAttribute("ph","sm"),this._contentWrapper.setAttribute("pv","sm"),this._contentWrapper.setAttribute("style",ds)),this._contentWrapper.parentNode!==this&&this.appendChild(this._contentWrapper),this._contentWrapper}_syncContentWrapperAttributes(){let t=this._ensureContentWrapper(),s=[["content-w","w"],["content-h","h"],["content-wh","wh"],["content-g","g"],["content-sv","sv"],["content-hsb","hsb"]];for(let[i,n]of s){let o=this.getAttribute(i);o===null?t.removeAttribute(n):t.setAttribute(n,o)}t.setAttribute("bgc",this.getAttribute("content-bgc")||"su"),t.setAttribute("ph",this.getAttribute("content-ph")||"sm"),t.setAttribute("pv",this.getAttribute("content-pv")||"sm");let r=this.getAttribute("content-style");t.setAttribute("style",r?`${ds} ${r}`:ds)}_syncContentWrapper({reposition:t=!0}={}){let s=this._ensureContentWrapper(),r=Array.from(this.childNodes).filter(n=>n!==s&&!this._isIgnorableTextNode(n));for(let n of r)n.nodeType===Node.ELEMENT_NODE&&n.getAttribute("slot")==="content"&&n.removeAttribute("slot"),s.appendChild(n);this._syncContentWrapperAttributes(),Array.from(s.childNodes).some(n=>!this._isIgnorableTextNode(n))||this.hasAttribute("open")?s.setAttribute("slot","content"):s.removeAttribute("slot"),t&&this._isOpen&&this._schedulePositionUpdate()}_show(){this._isOpen||(this._syncContentWrapper({reposition:!1}),this._updateActiveStateAttributes(),this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._startResizeObserver(),window.addEventListener("resize",this._onWindowResize),this._dialogElement.open?this._schedulePositionUpdate():setTimeout(()=>{this._isOpen&&this._dialogElement&&!this._dialogElement.open&&this._openDialogElement(),this._schedulePositionUpdate()},0))}_hide(){this._isOpen&&(this._isOpen=!1,this._cancelScheduledPositionUpdate(),this._stopResizeObserver(),window.removeEventListener("resize",this._onWindowResize),this._dialogElement.open&&this._dialogElement.close(),this._isModalOpen=!1,this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_startResizeObserver(){this._resizeObserver&&(this._isObservingResize||(this._resizeObserver.observe(this._popoverContainer),this._isObservingResize=!0),this._contentWrapper&&this._observedContentWrapper!==this._contentWrapper&&(this._observedContentWrapper&&this._resizeObserver.unobserve(this._observedContentWrapper),this._resizeObserver.observe(this._contentWrapper),this._observedContentWrapper=this._contentWrapper))}_stopResizeObserver(){this._resizeObserver?.disconnect(),this._isObservingResize=!1,this._observedContentWrapper=null}_cancelScheduledPositionUpdate(){this._positionFrameId!==null&&(cancelAnimationFrame(this._positionFrameId),this._positionFrameId=null),this._revealFrameId!==null&&(cancelAnimationFrame(this._revealFrameId),this._revealFrameId=null),this._positionVersion+=1,this.removeAttribute("positioned")}_readCoordinateAttr(t){let s=parseFloat(this.getAttribute(t)||"0");return Number.isFinite(s)?s:0}_schedulePositionUpdate(){this._isOpen&&(this.removeAttribute("positioned"),this._positionVersion+=1,this._positionFrameId===null&&(this._positionFrameId=requestAnimationFrame(()=>{if(this._positionFrameId=null,!this._isOpen)return;if(!this._dialogElement.open){this._schedulePositionUpdate();return}this._syncContentWrapper({reposition:!1}),this._startResizeObserver();let t=this._readCoordinateAttr("x"),s=this._readCoordinateAttr("y"),r=this._getActivePlace();this._updateActiveStateAttributes();let i=this._popoverContainer.getBoundingClientRect(),{left:n,top:o}=this._calculatePosition(t,s,i.width,i.height,r);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${o}px`;let p=this._positionVersion;this._revealFrameId=requestAnimationFrame(()=>{this._revealFrameId=null,this._isOpen&&this._positionVersion===p&&this.setAttribute("positioned","")})})))}_calculatePosition(t,s,r,i,n){return Rr({x:t,y:s,width:r,height:i,place:n,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight})}get popover(){return this._popoverContainer}get content(){return this._contentWrapper}refreshContent(){this._syncContentWrapper()}},jr=({render:e,html:t})=>cs;var No=(e,t)=>{let{store:s,render:r}=e;s.toggleOpen({}),r()},Po=Object.freeze(Object.defineProperty({__proto__:null,handleClickHeader:No},Symbol.toStringTag,{value:"Module"})),Do=()=>Object.freeze({open:!1}),jo=["id","class","style","slot","label","content"],Bo=(e={})=>Object.entries(e).filter(([t])=>!jo.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),zo=({state:e,props:t})=>({label:t.label||"",content:t.content||"",openClass:e.open?"content-wrapper open":"content-wrapper",chevronIcon:e.open?"chevronUp":"chevronDown",containerAttrString:Bo(t)}),Wo=({state:e})=>{e.open=!e.open},Mo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Do,selectViewData:zo,toggleOpen:Wo},Symbol.toStringTag,{value:"Module"})),Fo=(e,t)=>{let{dispatchEvent:s,props:r}=e,i=t._event,n=Number(i.currentTarget.dataset.index),o=Array.isArray(r.items)?r.items[n]:void 0;if(o){if(o.disabled||o.current){i.preventDefault();return}typeof o.href=="string"&&o.href.length>0||i.preventDefault(),s(new CustomEvent("item-click",{detail:{id:o.id,path:o.path,href:o.href,item:o,index:n,trigger:i.type}}))}},Ko=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:Fo},Symbol.toStringTag,{value:"Module"})),Uo=()=>Object.freeze({}),Ho=["id","class","style","slot","items","sep","max","separator"],qo=(e={})=>Object.entries(e).filter(([t])=>!Ho.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Yo=e=>{if(e==null||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t},Go=e=>`${e}`.replace(/"/g,"&quot;"),Jo=(e,t)=>{if(!t||t<3||e.length<=t)return e;let s=t-2;return[e[0],{isEllipsis:!0,label:"..."},...e.slice(-s)]},Qo=e=>e.map((t,s)=>{let r=typeof t.href=="string"&&t.href.length>0,i=t.path!==void 0&&t.path!==null&&`${t.path}`!="",n=!!t.current,o=!!t.disabled,p=!n&&!o&&(r||i||!!t.click),l=t.rel||(t.newTab?"noopener noreferrer":""),a=[t.newTab?'target="_blank"':"",l?`rel="${Go(l)}"`:""].filter(Boolean).join(" ");return{...t,label:t.label||"",index:s,href:r?t.href:void 0,path:i?t.path:void 0,isCurrent:n,isDisabled:o,isInteractive:p,linkExtraAttrs:a,c:n?"fg":"mu-fg"}}),Zo=({props:e})=>{let t=qo(e),s=Array.isArray(e.items)?e.items:[],r=Yo(e.max),i=e.sep||"breadcrumb-arrow",n=Qo(s),o=Jo(n,r),p=[];return o.forEach((l,a)=>{p.push(l),a<o.length-1&&p.push({isSeparator:!0})}),{containerAttrString:t,items:p,sep:i}},Xo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Uo,selectViewData:Zo},Symbol.toStringTag,{value:"Module"})),ea=["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"],Br={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"}},ta=(e={})=>Object.entries(e).filter(([t])=>!ea.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),sa=()=>Object.freeze({}),ra=({props:e={}})=>{let t=Br[e.size]?e.size:"md",s=Br[t];return{containerAttrString:ta(e),cardAttrString:s.cardAttrString,headerAttrString:s.headerAttrString,headingSize:s.headingSize,subheadingSize:s.subheadingSize,head:e.head||"",desc:e.desc||"",hasHeader:!!(e.head||e.desc),size:t}},ia=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:sa,selectViewData:ra},Symbol.toStringTag,{value:"Module"})),na=(e={})=>e.type==="section"||e.type==="label"?"section":e.type==="separator"?"separator":"item",oa=(e,t)=>{let{render:s,refs:r}=e,{oldProps:i={},newProps:n={}}=t,o=i.items!==n.items&&!!n.open;s(),o&&r?.popover?.refreshContent?.()},aa=(e,t)=>{let{dispatchEvent:s}=e;s(new CustomEvent("close"))},la=(e,t)=>{let{dispatchEvent:s,props:r}=e,i=t._event,n=Number(i.currentTarget.dataset.index??i.currentTarget.id.slice(6)),o=r.items[n],p=na(o);if(!o||p!=="item"||o.disabled){i.preventDefault();return}o.href||i.preventDefault(),s(new CustomEvent("item-click",{detail:{index:n,item:o,id:o.id,path:o.path,href:o.href,trigger:i.type}}))},pa=Object.freeze(Object.defineProperty({__proto__:null,handleClickMenuItem:la,handleClosePopover:aa,handleOnUpdate:oa},Symbol.toStringTag,{value:"Module"})),da=()=>Object.freeze({}),Ai=e=>`${e}`.replace(/"/g,"&quot;"),ca=[["overlay","overlay"],["noOverlay","no-overlay"],["smPlace","sm-place"],["mdPlace","md-place"],["lgPlace","lg-place"],["xlPlace","xl-place"],["smOverlay","sm-overlay"],["mdOverlay","md-overlay"],["lgOverlay","lg-overlay"],["xlOverlay","xl-overlay"],["smNoOverlay","sm-no-overlay"],["mdNoOverlay","md-no-overlay"],["lgNoOverlay","lg-no-overlay"],["xlNoOverlay","xl-no-overlay"]],ua=(e={})=>ca.filter(([t])=>e[t]!==void 0&&e[t]!==null).map(([t,s])=>{let r=e[t];return r===!0?s:`${s}="${Ai(r)}"`}).join(" "),ha=(e={})=>e.type==="section"||e.type==="label"?"section":e.type==="separator"?"separator":"item",fa=e=>e.map((t,s)=>{let r=ha(t),i=r==="separator",n=r==="section",o=r==="item",p=!!t.disabled,l=o&&!p,a=Object.prototype.hasOwnProperty.call(t,"icon"),c=typeof t.icon=="string"&&t.icon.length>0?t.icon:"",d=typeof t.shortcut=="string"&&t.shortcut.length>0?t.shortcut:typeof t.suffixText=="string"&&t.suffixText.length>0?t.suffixText:"",h=p?"mu-fg":"fg",f=p?"mu":"",u=p?"":"ac",y=h,m="mu-fg",b=typeof t.href=="string"&&t.href.length>0,g=t.rel||(t.newTab?"noopener noreferrer":""),_=[t.newTab?'target="_blank"':"",g?`rel="${Ai(g)}"`:""].filter(Boolean).join(" ");return{...t,index:s,type:r,isSeparator:i,isSection:n,isItem:o,isDisabled:p,isInteractive:l,hasIconSlot:a,icon:c,hasIcon:c.length>0,suffixText:d,hasSuffixText:d.length>0,hasHref:b,linkExtraAttrs:_,c:h,bgc:f,hoverBgc:u,iconColor:y,suffixTextColor:m}}),ya=({props:e})=>{let t=Array.isArray(e.items)?e.items:[];return{items:fa(t),open:!!e.open,x:e.x||0,y:e.y||0,w:e.w||"300",h:e.h||"300",place:e.place||"bs",popoverAttrString:ua(e)}},ma=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:da,selectViewData:ya},Symbol.toStringTag,{value:"Module"})),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},D={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},ws={NOT:0},$=class extends Error{constructor(e){super(`Parse Error: ${e}`),this.name="JemplParseError"}},de=class extends Error{constructor(e){super(`Render Error: ${e}`),this.name="JemplRenderError"}},zr=e=>{if(!e||e.trim()==="")throw new $("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let s=e.includes("===")?"==":"!=";throw new $(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${s}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let s of t)if(e.trim().endsWith(s))throw new $(`Incomplete comparison expression - missing right operand (got: '${e}')`)},ga=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,s]=e.split(" in ");if(!s||s.trim()==="")throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);let r=t.includes(",")?t.split(",").map(i=>i.trim()):[t.trim()];for(let i of r){if(!i)throw new $(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(i))throw new $(`Invalid loop syntax (got: '$for ${e}')`)}},ba=(e,t,s=!1)=>{if(t===null)return new de(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new de(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return s?new de(`Cannot iterate over non-array value in loop '${e}' - got ${r} instead`):new de(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},va=(e,t)=>{let s=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new de(`Unknown function '${e}' (${s})`)},wa=(e,t,s={})=>{let r={},i={};s&&typeof s=="object"&&(s.functions!==void 0||s.partials!==void 0?(r=s.functions||{},i=s.partials||{}):typeof s=="object"&&(r=s));let n=R(e,{functions:r,partials:i},t,{});return n===void 0?{}:n},R=(e,t,s,r)=>{if(t.functions,e.var&&!e.type)return U(e.var,s,r);if(e.type===w.LITERAL)return e.value;if(e.type===w.VARIABLE)return U(e.path,s,r);if(e.type===w.INTERPOLATION)return xa(e.parts,t,s,r);switch(e.type){case w.FUNCTION:return ki(e,t,s,r);case w.BINARY:return Ei(e,t,s,r);case w.UNARY:return $i(e,t,s,r);case w.CONDITIONAL:return Aa(e,t,s,r);case w.LOOP:return Ia(e,t,s,r);case w.OBJECT:return Ta(e,t,s,r);case w.ARRAY:return La(e,t,s,r);case w.PARTIAL:return Va(e,t,s,r);case w.PATH_REFERENCE:return Ra(e,t,s,r);default:throw new Error(`Unknown node type: ${e.type}`)}},Wr=new Map,_a=e=>{let t=[],s="",r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(n==="[")s&&(t.push({type:"property",value:s}),s=""),r=!0;else if(n==="]"){if(r&&s){let o=s.trim();if(/^\d+$/.test(o))t.push({type:"index",value:parseInt(o,10)});else if(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'")){let p=o.slice(1,-1);t.push({type:"property",value:p})}else t.push({type:"property",value:o});s=""}r=!1}else s+=n}return s&&t.push({type:"property",value:s}),t},U=(e,t,s)=>{if(!e)return;if(e in s)return s[e];let r=Wr.get(e);if(!r){let n=[],o="",p=0;for(let l=0;l<e.length;l++){let a=e[l];a==="["?(p++,o+=a):a==="]"?(p--,o+=a):a==="."&&p===0?o&&(n.push(o),o=""):o+=a}o&&n.push(o),r=[];for(let l of n){let a=_a(l.trim());r.push(...a)}Wr.set(e,r)}let i=t;for(let n=0;n<r.length;n++){let o=r[n];if(o.type==="property"&&o.value in s){i=s[o.value];continue}if(i==null)return;(o.type==="property"||o.type==="index")&&(i=i[o.value])}return i},xa=(e,t,s,r)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let o=R(n,t,s,r);i.push(o!=null?String(o):"")}return i.join("")},ki=(e,t,s,r)=>{let i=t.functions||t,n=i[e.name];if(!n)throw va(e.name,i);let o=e.args.map(p=>R(p,t,s,r));return n(...o)},Be=(e,t,s,r)=>{if(e.var&&!e.type)return U(e.var,s,r);switch(e.type){case w.VARIABLE:return U(e.path,s,r);case w.LITERAL:return e.value;case w.BINARY:return Ei(e,t,s,r);case w.UNARY:return $i(e,t,s,r);case w.FUNCTION:return ki(e,t,s,r);default:return R(e,t,s,r)}},Ei=(e,t,s,r)=>{if(e.op===D.AND||e.op===D.OR){let o=Be(e.left,t,s,r),p=Be(e.right,t,s,r);switch(e.op){case D.AND:return o&&p;case D.OR:return o||p}}let i=R(e.left,t,s,r),n=R(e.right,t,s,r);switch(e.op){case D.EQ:return i==n;case D.NEQ:return i!=n;case D.GT:return i>n;case D.LT:return i<n;case D.GTE:return i>=n;case D.LTE:return i<=n;case D.IN:return Array.isArray(n)?n.includes(i):!1;case D.ADD:if(typeof i!="number"||typeof n!="number")throw new de(`Arithmetic operations require numbers. Got ${typeof i} + ${typeof n}`);return i+n;case D.SUBTRACT:if(typeof i!="number"||typeof n!="number")throw new de(`Arithmetic operations require numbers. Got ${typeof i} - ${typeof n}`);return i-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},$i=(e,t,s,r)=>{let i=e.op===ws.NOT?Be(e.operand,t,s,r):R(e.operand,t,s,r);switch(e.op){case ws.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Sa=(e,t,s,r)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===w.VARIABLE)if(U(i.path,s,r)){let n=e.bodies[0];if(n.type===w.OBJECT&&n.properties.length<=5){let o={};for(let p of n.properties){let l=p.parsedKey?R(p.parsedKey,t,s,r):p.key,a=p.value;if(a.type===w.LITERAL)o[l]=a.value;else if(a.type===w.VARIABLE)o[l]=U(a.path,s,r);else if(a.type===w.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let h=U(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=R(d,t,s,r);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=R(a,t,s,r)}return o}}else{let n=e.bodies[1];if(n.type===w.OBJECT&&n.properties.length<=5){let o={};for(let p of n.properties){let l=p.parsedKey?R(p.parsedKey,t,s,r):p.key,a=p.value;if(a.type===w.LITERAL)o[l]=a.value;else if(a.type===w.VARIABLE)o[l]=U(a.path,s,r);else if(a.type===w.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let h=U(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=R(d,t,s,r);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=R(a,t,s,r)}return o}}}return null},Aa=(e,t,s,r)=>{let i=Sa(e,t,s,r);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||Be(o,t,s,r))return R(e.bodies[n],t,s,r)}return Ci},ka=(e,t)=>{let s=e.body,r=e.itemVar;if(s.type===w.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===w.VARIABLE){let i=s.conditions[0].path,n=s.bodies[0];if(i.startsWith(r+".")){let o=i.substring(r.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 a=t[l];if(a[o]){let c={};for(let d of n.properties){let h=d.key,f=d.value;if(f.type===w.LITERAL)c[h]=f.value;else if(f.type===w.VARIABLE){let u=f.path;if(u===r)c[h]=a;else if(u.startsWith(r+".")){let y=u.substring(r.length+1);c[h]=a[y]}else return null}else if(f.type===w.INTERPOLATION){let u=[],y=!0;for(let m of f.parts)if(typeof m=="string")u.push(m);else if(m.type===w.VARIABLE){let b=m.path;if(b===r)u.push(a!=null?String(a):"");else if(b.startsWith(r+".")){let g=b.substring(r.length+1),_=a[g];u.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[h]=u.join("")}else return null}p.push(c)}}return p}}}return null},Ea=(e,t)=>{let s=e.body,r=e.itemVar,i=ka(e,t);if(i!==null)return i;if(s.type===w.OBJECT&&s.properties.length<=5&&!s.whenCondition){for(let p of s.properties)if(p.parsedKey)return null;let n=[],o=!0;for(let p of s.properties){let l=p.key,a=p.value;if(a.type===w.LITERAL)n.push({key:l,type:"literal",value:a.value});else if(a.type===w.VARIABLE){let c=a.path;if(c===r)n.push({key:l,type:"item"});else if(c.startsWith(r+".")){let d=c.substring(r.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:l,type:"prop",prop:d});else{o=!1;break}}else{o=!1;break}}else if(a.type===w.INTERPOLATION&&a.parts.length===1){let c=a.parts[0];if(c.type===w.VARIABLE){let d=c.path;if(d===r)n.push({key:l,type:"item_string"});else if(d.startsWith(r+".")){let h=d.substring(r.length+1);if(!h.includes(".")&&!h.includes("["))n.push({key:l,type:"prop_string",prop:h});else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}if(o){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 a=t[l];p[l]={id:a.id,title:a.title!=null?String(a.title):"",completed:a.completed}}else for(let l=0;l<t.length;l++){let a=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]=a;else if(d.type==="prop")c[d.key]=a[d.prop];else if(d.type==="item_string")c[d.key]=a!=null?String(a):"";else if(d.type==="prop_string"){let h=a[d.prop];c[d.key]=h!=null?String(h):""}p[l]=c}return p}}return null},$a=(e,t,s,r,i)=>{let n=[],o=e.body;if(o.type===w.OBJECT&&o.fast!==!1){let p=e.itemVar,l=e.indexVar;for(let a=0;a<i.length;a++){let c=i[a],d={},h={...r,[p]:c,...l&&{[l]:a}};h.__paths__||(h.__paths__=r.__paths__||{});let f=e.iterable.path||"";if(r&&r.__paths__&&f){let u=f.split("."),y=u[0];y in r.__paths__&&(f=r.__paths__[y],u.length>1&&(f+="."+u.slice(1).join(".")))}h.__paths__={...h.__paths__,[p]:`${f}[${a}]`,...l&&{[l]:a}};for(let u of o.properties){let y=u.parsedKey?R(u.parsedKey,t,s,h):u.key,m=u.value;if(m.type===w.LITERAL)d[y]=m.value;else if(m.type===w.VARIABLE){let b=m.path;if(b===p)d[y]=c;else if(b===l)d[y]=a;else if(b.startsWith(p+".")){let g=b.substring(p.length+1);!g.includes(".")&&!g.includes("[")?d[y]=c[g]:d[y]=U(b,s,{...r,[p]:c,...l&&{[l]:a}})}else d[y]=U(b,s,{...r,[p]:c,...l&&{[l]:a}})}else if(m.type===w.INTERPOLATION){let b=[];for(let g of m.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=a;else if(_.startsWith(p+".")){let A=_.substring(p.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=U(_,s,{...r,[p]:c,...l&&{[l]:a}})}else S=U(_,s,{...r,[p]:c,...l&&{[l]:a}});b.push(S!=null?String(S):"")}else{let _={...r,[p]:c,...l&&{[l]:a}},S=R(g,t,s,_);b.push(S!=null?String(S):"")}d[y]=b.join("")}else{let b={...r,[p]:c,...l&&{[l]:a}};d[y]=R(m,t,s,b)}}n.push(d)}return n}return null},Ca=(e,t,s)=>{let r=e.body;if(r.type===w.OBJECT&&r.properties.length===1&&r.properties[0].key==="$if item.visible"){let i=r.properties[0].value;if(i.type===w.CONDITIONAL&&i.conditions.length===1&&i.conditions[0].type===w.VARIABLE&&i.conditions[0].path==="item.visible"){let n=i.bodies[0];if(n.type===w.OBJECT&&n.properties.length===2){let o=n.properties[0],p=n.properties[1];if(o.key==="id"&&o.value.type===w.VARIABLE&&o.value.path==="item.id"&&p.key==="$if item.highlighted"&&p.value.type===w.CONDITIONAL){let l=[];for(let a=0;a<t.length;a++){let c=t[a];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},Ia=(e,t,s,r)=>{let i=R(e.iterable,t,s,r);if(!Array.isArray(i)){let a,c=!1;if(e.iterable.type===w.FUNCTION){c=!0;let h=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(", ");a=`${e.iterable.name}(${h})`}else a=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${a}`;throw ba(d,i,c)}if(!e.indexVar){let a=Ca(e,i,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=Ea(e,i);if(a!==null)return a}let n=$a(e,t,s,r,i);if(n!==null)return n;let o=[],p=e.iterable.path||"";if(r&&r.__paths__&&p){let a=p.split("."),c=a[0];c in r.__paths__&&(p=r.__paths__[c],a.length>1&&(p+="."+a.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(a=>a.type===w.OBJECT&&a.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let a=0;a<i.length;a++){let c=e.indexVar?{...r,[e.itemVar]:i[a],[e.indexVar]:a}:{...r,[e.itemVar]:i[a]};c.__paths__||(c.__paths__=r.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${p}[${a}]`},e.indexVar&&(c.__paths__[e.indexVar]=a);let d=R(e.body,t,s,c);if(Array.isArray(d)&&d.length===1&&!l){let h=d[0];o.push(h===void 0?{}:h)}else o.push(d===void 0?{}:d)}return o},Oa=(e,t,s,r)=>{if(e.whenCondition)return null;if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?R(i.parsedKey,t,s,r):i.key,o=i.value;if(o.type===w.OBJECT&&o.properties.length<=10&&!o.whenCondition){let p={},l={},a=!0;for(let c of o.properties){let d=c.parsedKey?R(c.parsedKey,t,s,r):c.key,h=c.value;if(h.type===w.LITERAL)l[d]=h.value;else if(h.type===w.VARIABLE)l[d]=U(h.path,s,r);else if(h.type===w.INTERPOLATION){let f=[];for(let u of h.parts)if(typeof u=="string")f.push(u);else if(u.type===w.VARIABLE){let y=U(u.path,s,r);f.push(y!=null?String(y):"")}else{a=!1;break}if(!a)break;l[d]=f.join("")}else if(h.type===w.OBJECT&&h.properties.length<=5){let f={};for(let u of h.properties){let y=u.key,m=u.value;if(m.type===w.LITERAL)f[y]=m.value;else if(m.type===w.VARIABLE)f[y]=U(m.path,s,r);else if(m.type===w.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=U(g.path,s,r);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[y]=b.join("")}else{a=!1;break}}if(!a)break;l[d]=f}else{a=!1;break}}if(a)return p[n]=l,p}}return null},Ta=(e,t,s,r)=>{let i=t.functions||t;if(e.whenCondition&&!Be(e.whenCondition,i,s,r))return;let n=Oa(e,t,s,r);if(n!==null)return n;if(e.fast){let l={};for(let a of e.properties){let c=a.parsedKey?R(a.parsedKey,t,s,r):a.key,d=a.value;if(d.type===w.LITERAL)l[c]=d.value;else if(d.type===w.VARIABLE)l[c]=U(d.path,s,r);else if(d.type===w.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===w.VARIABLE){let u=U(f.path,s,r);h.push(u!=null?String(u):"")}else{let u=R(f,t,s,r);h.push(u!=null?String(u):"")}l[c]=h.join("")}else l[c]=R(d,t,s,r)}return l}let o={},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 a=R(l.value,t,s,r);if(!p&&a!==null&&a!==void 0)return Array.isArray(a)&&a.length===1?a[0]:a;typeof a=="object"&&a!==null&&!Array.isArray(a)&&Object.assign(o,a)}else if(l.key.startsWith("$for ")){if(e.properties.length===1)return R(l.value,t,s,r)}else{let a=l.value;if(a&&a.type===w.OBJECT&&a.properties){let c=a.properties.find(d=>d.key.startsWith("$for "));if(c){let d=R(c.value,t,s,r);d!==void 0&&(o[l.key]=d)}else{let d=R(l.value,t,s,r);d!==void 0&&(o[l.key]=d)}}else{let c=l.parsedKey?R(l.parsedKey,t,s,r):l.key,d=R(l.value,t,s,r);d!==void 0&&(o[c]=d)}}return o},Ci={},La=(e,t,s,r)=>{let i=[];for(let n of e.items)if(n.type===w.LOOP){let o=R(n,t,s,r);Array.isArray(o)&&n.flatten!==!1?i.push(...o):i.push(o)}else{let o=R(n,t,s,r);o!==Ci&&o!==void 0&&i.push(o)}return i},Va=(e,t,s,r)=>{let{name:i,data:n,whenCondition:o}=e,p=t.partials||{},l=t.functions||t;if(o&&!Be(o,l,s,r))return;if(!p[i])throw new de(`Partial '${i}' is not defined`);let a=r._partialStack||[];if(a.includes(i))throw new de(`Circular partial reference detected: ${i}`);let c=p[i],d=s,h={...r,_partialStack:[...a,i]};if(r){d={...s};for(let f of Object.keys(r))f.startsWith("_")||(d[f]=r[f])}if(n){let f=R(n,t,s,r);d={...d,...f}}return R(c,t,d,h)},Ra=(e,t,s,r)=>{let{path:i}=e,n=i.split("."),o=n[0],p=n.slice(1);if(!r||!(o in r))throw new de(`Path reference '#{${i}}' refers to '${o}' which is not a loop variable in the current scope`);if(r.__paths__||(r.__paths__={}),!(o in r.__paths__))throw new de(`Path reference '#{${i}}' cannot be resolved - path tracking may not be initialized properly`);let l=r.__paths__[o];if(typeof l=="number"){if(p.length>0)throw new de(`Path reference '#{${i}}' - cannot access properties on index variable '${o}'`);return String(l)}return p.length>0&&(l+="."+p.join(".")),l},Na=/\$\{([^}]*)\}/g,Pa=/#\{([^}]*)\}/g,Ii=(e,t={})=>{let s=e.match(/^(\w+)\((.*)\)$/);if(!s)return{isFunction:!1};let[,r,i]=s,n=Da(i,t);return{isFunction:!0,type:w.FUNCTION,name:r,args:n}},Da=(e,t={})=>e.trim()?ja(e).map(s=>Ba(s.trim(),t)):[],ja=e=>{let t=[],s="",r=0,i=!1,n="";for(let o=0;o<e.length;o++){let p=e[o],l=o>0?e[o-1]:"";!i&&(p==='"'||p==="'")?(i=!0,n=p,s+=p):i&&p===n&&l!=="\\"?(i=!1,n="",s+=p):!i&&p==="("?(r++,s+=p):!i&&p===")"?(r--,s+=p):!i&&p===","&&r===0?(t.push(s),s=""):s+=p}return s&&t.push(s),t},Ba=(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 s=Ii(e,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};let r=e.trim(),i=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:o,type:p}of i){let l=0;for(;l<r.length;){let a=Re(r.substring(l),o);if(a===-1)break;let c=l+a;c>n&&(n=c),l=c+o.length}}if(n!==-1)try{return Z(r,t)}catch{return{type:w.VARIABLE,path:r}}return{type:w.VARIABLE,path:r}},Oi=/^\w+\(.*\)$/,za=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,Wa=e=>{if(!(!e||e.trim()===""||Oi.test(e))&&za.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}"`)},Mr=e=>{let t=e.trim();if(Oi.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:w.PATH_REFERENCE,path:t}},vt=(e,t={})=>{let s=e.trim();Wa(s);let r=Ii(s,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};if(s.includes("[")&&!/[\s+\-*/%|&?:]/.test(s)){let i=0;for(let n of s)n==="["?i++:n==="]"&&i--;if(i!==0)throw new Error("Invalid array index syntax")}return{type:w.VARIABLE,path:s}},Ti=(e,t={})=>{let s=e,r=[];(e.includes("\\${")||e.includes("\\#{"))&&(s=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),s=s.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),s=s.replace(/\\(\$\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\(#\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\DOUBLE_ESC_VAR/g,"\\"),s=s.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let i=[...s.matchAll(Na)],n=[...s.matchAll(Pa)],o=[...i.map(a=>({match:a,type:"variable"})),...n.map(a=>({match:a,type:"pathref"}))].sort((a,c)=>a.match.index-c.match.index);if(o.length===0){let a=s;for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);return{type:w.LITERAL,value:a}}if(o.length===1&&o[0].match[0]===s&&r.length===0){let{match:a,type:c}=o[0];try{return c==="variable"?vt(a[1],t):Mr(a[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:w.LITERAL,value:s};throw d}}let p=[],l=0;for(let{match:a,type:c}of o){let[d,h]=a,f=a.index;if(f>l){let u=s.substring(l,f);for(let y=0;y<r.length;y++)u=u.replace(`__ESCAPED_${y}__`,r[y]);u&&p.push(u)}try{let u;c==="variable"?u=vt(h.trim(),t):u=Mr(h.trim()),p.push(u)}catch(u){if(u.message==="Invalid array index syntax")p.push(d);else throw u}l=f+d.length}if(l<s.length){let a=s.substring(l);for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);a&&p.push(a)}return{type:w.INTERPOLATION,parts:p}},$e=(e,t)=>typeof e=="string"?Ti(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Fa(e,t):Ka(e,t):{type:w.LITERAL,value:e},Ma=e=>{let{$each:t,...s}=e;if(typeof t!="string")throw new $("$each value must be a non-empty string");let r=t.trim();if(r==="")throw new $("$each value must be a non-empty string");if(Object.keys(s).length===0)throw new $("Empty $each body not allowed");if(s.$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 ${r}`]:s}},Fa=(e,t)=>{let s=[],r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let l=Ma(n),a=Object.keys(l);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let c=Fr(a[0],l[a[0]],t,!0);s.push(c),r=!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=Fr(p[0],n[p[0]],t);s.push(l),r=!0;continue}}let o=$e(n,t);s.push(o),(o.type===w.FUNCTION||o.type===w.CONDITIONAL||o.type===w.LOOP||o.type===w.PARTIAL||o.type===w.OBJECT&&!o.fast||o.type===w.ARRAY&&!o.fast)&&(r=!0)}return{type:w.ARRAY,items:s,fast:!r}},Ka=(e,t)=>{let s=[],r=!1,i=null,n=Object.entries(e),o=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"],a=[];for(let[b]of n)for(let g of l)if(b===g||b.startsWith(g+" ")||b.startsWith(g+"#")){a.push(g);break}if(a.length>0)throw new $(`Cannot use $partial with ${a.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...h}=e,f={},u=!1;for(let[b,g]of Object.entries(h)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=g,u=!0}let y=null;if(u&&(y=$e(f,t),y.type===w.OBJECT)){let b=!1;for(let g of y.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&&(y.fast=!1)}let m={type:w.PARTIAL,name:c,data:y};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new $("Empty condition expression after '$when'");b=Z(d,t)}else b={type:w.LITERAL,value:d};m.whenCondition=b}return m}for(let[l,a]of n)if(l==="$when"){if(i!==null)throw new $("Multiple '$when' directives on the same object are not allowed");if(a==null)throw new $("Missing condition expression after '$when'");let c=typeof a=="string"?a:JSON.stringify(a);if(c.trim()==="")throw new $("Empty condition expression after '$when'");i=Z(c,t),r=!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(;o<n.length;){let[l,a]=n[o];if(l==="$when"){o++;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,o,t);s.push({key:l,value:c.node}),r=!0,o=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=$e(a,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)&&(r=!0);let d=Ti(l,t),h={key:l,value:c};(d.type!==w.LITERAL||d.value!==l)&&(h.parsedKey=d),s.push(h),o++}}}let p={type:w.OBJECT,properties:s,fast:!r};return i&&(p.whenCondition=i),p},Ua=(e,t,s={})=>{let r=[],i=[],n=t,[o,p]=e[n],l=null,a;if(o.startsWith("$if#")){let d=o.match(/^\$if#(\w+)\s+(.+)$/);if(d)l=d[1],a=d[2];else throw new $(`Invalid conditional syntax: ${o}`)}else a=o.substring(4),a.endsWith(":")&&(a=a.slice(0,-1).trim());zr(a);let c=Z(a,s);for(r.push(c),i.push($e(p,s)),n++;n<e.length;){let[d,h]=e[n],f=!1,u;if(l?d.startsWith(`$elif#${l} `)?(u=d.substring(`$elif#${l} `.length),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d===`$else#${l}`||d===`$else#${l}:`)&&(f=!0,u=null):d.startsWith("$elif ")?(u=d.substring(6),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,u=null),f){if(u===null)r.push(null);else{zr(u);let y=Z(u,s);r.push(y)}if(i.push($e(h,s)),n++,u===null)break}else break}return{node:{type:w.CONDITIONAL,conditions:r,bodies:i,id:l},nextIndex:n}},Z=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let a=e.slice(1,-1),c=0,d=!0;for(let h=0;h<a.length;h++)if(a[h]==="("?c++:a[h]===")"&&c--,c<0){d=!1;break}if(d&&c===0)return Z(a,t)}let s=Re(e,"||");if(s!==-1)return{type:w.BINARY,op:D.OR,left:Z(e.substring(0,s).trim(),t),right:Z(e.substring(s+2).trim(),t)};let r=Re(e,"&&");if(r!==-1)return{type:w.BINARY,op:D.AND,left:Z(e.substring(0,r).trim(),t),right:Z(e.substring(r+2).trim(),t)};let i=[{op:">=",type:D.GTE},{op:"<=",type:D.LTE},{op:"==",type:D.EQ},{op:"!=",type:D.NEQ},{op:">",type:D.GT},{op:"<",type:D.LT},{op:" in ",type:D.IN}];for(let{op:a,type:c}of i){let d=Re(e,a);if(d!==-1)return{type:w.BINARY,op:c,left:Z(e.substring(0,d).trim(),t),right:Z(e.substring(d+a.length).trim(),t)}}let n=-1,o=null,p=[{op:" + ",type:D.ADD},{op:" - ",type:D.SUBTRACT}];for(let{op:a,type:c}of p){let d=0;for(;d<e.length;){let h=Re(e.substring(d),a);if(h===-1)break;let f=d+h;f>n&&(n=f,o={op:a,type:c}),d=f+a.length}}if(n!==-1&&o)return{type:w.BINARY,op:o.type,left:Z(e.substring(0,n).trim(),t),right:Z(e.substring(n+o.op.length).trim(),t)};let l=[" * "," / "," % "];for(let a of l)if(Re(e,a)!==-1)throw new $(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:w.UNARY,op:ws.NOT,operand:Z(e.substring(1).trim(),t)}:Li(e,t)},Re=(e,t)=>{let s=0,r=0;for(;r<=e.length-t.length;){if(e[r]==="(")s++;else if(e[r]===")")s--;else if(s===0&&e.substring(r,r+t.length)===t)return r;r++}return-1},Ha=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}},Li=(e,t)=>{let s=e.trim();if(s.match(/^(\w+)\((.*)\)$/))return vt(s,t);let r=Ha(s);if(r.type===w.LITERAL)return r;if(/^[a-zA-Z_$][\w.$]*$/.test(s))return{type:w.VARIABLE,path:s};try{return vt(s,t)}catch(i){if(i.message&&i.message.includes("not supported"))return r;throw i}},qa=(e,t=!1)=>{try{ga(e)}catch(s){if(s instanceof $&&t){let r=s.message.replace(/\$for/g,"$each");throw new $(r.replace("Parse Error: ",""))}throw s}},Fr=(e,t,s,r=!1)=>{let i=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(i);if(!n){let m=r?"$each":"$for";throw new $(`Invalid loop syntax (got: '${e.replace("$for",m)}')`)}let o=n[1],p=n[2].trim();qa(p,r);let l=p.match(/^(.+?)\s+in\s+(.+)$/);if(!l){let m=r?"$each":"$for";throw new $(`Invalid loop syntax - missing 'in' keyword (got: '${m} ${p}')`)}let a=l[1].trim(),c=l[2].trim(),d,h=null;if(a.includes(",")){let m=a.split(",").map(b=>b.trim());if(m.length!==2)throw new $(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=m[0],h=m[1]}else d=a;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new $(`Reserved variable name: ${d}`);if(h&&f.includes(h))throw new $(`Reserved variable name: ${h}`);let u=Li(c,s),y=$e(t,s);return{type:w.LOOP,itemVar:d,indexVar:h,iterable:u,body:y,flatten:o!=="nested"}},Kr=(e,t={})=>{let{functions:s={}}=t;return $e(e,s)},Ya=()=>Date.now(),Ga=Object.freeze(Object.defineProperty({__proto__:null,now:Ya},Symbol.toStringTag,{value:"Module"})),Ja=(e,t,s={})=>{let{functions:r={},partials:i={}}=s,n={...Ga,...r},o=Kr(e,{functions:n}),p={};for(let[l,a]of Object.entries(i))p[l]=Kr(a,{functions:n});return wa(o,t,{functions:n,partials:p})},zs=e=>e!==null&&typeof e=="object",wt=e=>zs(e)&&!Array.isArray(e),Qa=e=>typeof e=="string"&&e.includes("."),Vi=e=>typeof e=="string"&&/[\[\]]/.test(e);function Ri(e,t){let s={};for(let r of t){if(typeof r!="string"||r.length===0)continue;let i=ne(e,r);i!==void 0&&he(s,r,i)}return s}function Za(e){if(!wt(e)||!Array.isArray(e.fields))return e;let t=(s=[])=>s.map(r=>{if(!wt(r))return r;if(typeof r.$when=="string"&&r.$when.trim().length>0){let{$when:i,...n}=r,o=Array.isArray(n.fields)?{...n,fields:t(n.fields)}:n;return{[`$if ${i}`]:o}}return Array.isArray(r.fields)?{...r,fields:t(r.fields)}:r});return{...e,fields:t(e.fields)}}var ne=(e,t,s=void 0)=>{if(!t||!zs(e)||Vi(t))return s;let r=t.split(".").filter(n=>n!==""),i=e;for(let n of r){if(i==null||!(n in i))return Object.prototype.hasOwnProperty.call(e,t)?e[t]:s;i=i[n]}return i},he=(e,t,s)=>{if(!zs(e)||typeof t!="string"||t.length===0||Vi(t))return e;let r=t.split(".").filter(n=>n!=="");if(r.length===0)return e;Qa(t)&&Object.prototype.hasOwnProperty.call(e,t)&&delete e[t];let i=e;for(let n=0;n<r.length-1;n++){let o=r[n];(!(o in i)||typeof i[o]!="object"||i[o]===null)&&(i[o]={}),i=i[o]}return i[r[r.length-1]]=s,e},Xa=["id","class","style","slot","form","defaultValues","disabled","context"],el=(e={})=>Object.entries(e).filter(([t,s])=>!(Xa.includes(t)||s==null||typeof s=="object"||typeof s=="function")).map(([t,s])=>`${t}=${String(s)}`).join(" "),tl={email:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,url:/^https?:\/\/.+/},ue={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}`},sl="input-date",rl="input-time",il="input-datetime",nl=/^(\d{4})-(\d{2})-(\d{2})$/,ol=/^(\d{2}):(\d{2})(?::(\d{2}))?$/,al=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}(?::\d{2})?)$/,ll=e=>{if(typeof e!="string")return null;let t=nl.exec(e);if(!t)return null;let s=Number(t[1]),r=Number(t[2]),i=Number(t[3]);if(!Number.isInteger(s)||!Number.isInteger(r)||!Number.isInteger(i)||r<1||r>12||i<1||i>31)return null;let n=new Date(Date.UTC(s,r-1,i));return n.getUTCFullYear()===s&&n.getUTCMonth()===r-1&&n.getUTCDate()===i?{year:s,month:r,day:i}:null},pl=e=>{if(typeof e!="string")return null;let t=ol.exec(e);if(!t)return null;let s=Number(t[1]),r=Number(t[2]),i=t[3]===void 0?0:Number(t[3]);return!Number.isInteger(s)||!Number.isInteger(r)||!Number.isInteger(i)||s<0||s>23||r<0||r>59||i<0||i>59?null:{hour:s,minute:r,second:i}},Ni=e=>{let t=pl(e);return t?`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}`:null},Pi=e=>ll(e)?e:null,dl=e=>{if(typeof e!="string")return null;let t=al.exec(e);if(!t)return null;let s=Pi(t[1]),r=Ni(t[2]);return!s||!r?null:`${s}T${r}`},cl=e=>e===sl?{normalize:Pi,invalidMessage:ue.invalidDate}:e===rl?{normalize:Ni,invalidMessage:ue.invalidTime}:e===il?{normalize:dl,invalidMessage:ue.invalidDateTime}:null,ul=(e,t)=>{let s=cl(e.type);if(!s||t==null||t==="")return null;let r=s.normalize(String(t));if(!r)return s.invalidMessage;if(e.min!==void 0&&e.min!==null&&String(e.min)!==""){let i=s.normalize(String(e.min));if(i&&r<i)return ue.minTemporal(String(e.min))}if(e.max!==void 0&&e.max!==null&&String(e.max)!==""){let i=s.normalize(String(e.max));if(i&&r>i)return ue.maxTemporal(String(e.max))}return null},It=(e,t)=>{if(e.required){let r=t==null||t===""||Array.isArray(t)&&t.length===0||typeof t=="boolean"&&t===!1,i=e.type==="input-number"&&t===null;if(e.type==="input-number"?i:r)return typeof e.required=="object"&&e.required.message?e.required.message:ue.required}let s=ul(e,t);if(s)return s;if(Array.isArray(e.rules))for(let r of e.rules){let i=hl(r,t);if(i)return i}return null},hl=(e,t)=>{if(t==null||t==="")return null;let s=String(t);switch(e.rule){case"minLength":return s.length<e.value?e.message||ue.minLength(e.value):null;case"maxLength":return s.length>e.value?e.message||ue.maxLength(e.value):null;case"pattern":{let r=tl[e.value];if(!r)try{r=new RegExp(e.value)}catch{return e.message||ue.pattern}return r.test(s)?null:e.message||ue.pattern}default:return null}},Ot=(e,t)=>{let s={},r=ie(e);for(let i of r){let n=ne(t,i.name),o=It(i,n);o&&(s[i.name]=o)}return{valid:Object.keys(s).length===0,errors:s}},fl=["section","read-only-text","slot"],Ws=e=>!fl.includes(e.type),ie=e=>{let t=[];for(let s of e)s.type==="section"&&Array.isArray(s.fields)?t.push(...ie(s.fields)):Ws(s)&&t.push(s);return t},Ms=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":case"segmented-control":return null;case"tag-select":return[];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}},Fs=(e,t=0)=>{let s=[],r=t;for(let i of e)if(i.type==="section"){if(s.push({...i,_isSection:!0,_idx:r}),r++,Array.isArray(i.fields)){let n=Fs(i.fields,r);s.push(...n),r+=n.length}}else s.push({...i,_isSection:!1,_idx:r}),r++;return s},yl=()=>Object.freeze({formValues:{},errors:{},reactiveMode:!1,tooltipState:{open:!1,x:0,y:0,content:""}}),ee=({state:e,props:t})=>{let{form:s={}}=t||{},r=Za(s),i=wt(t?.context)?t.context:{},n=wt(e?.formValues)?e.formValues:{},o={...i,...n,formValues:n};return Object.keys(o).length>0?Ja(r,o):r},ml=({state:e,props:t})=>{let s=el(t),r=ee({state:e,props:t}),i=r.fields||[],n=!!t?.disabled,o=Fs(i);o.forEach(d=>{if(d._isSection)return;let h=Ws(d);if(d._disabled=n||!!d.disabled,h&&d.name&&(d._error=e.errors[d.name]||null),d.type==="input-text"&&(d._inputType=d.inputType||"text"),d.type==="select"||d.type==="tag-select"||d.type==="segmented-control"){let f=ne(e.formValues,d.name);d._selectedValue=f!==void 0?f:null,d._selectedValues=Array.isArray(f)?f:[],d.placeholder=d.placeholder||"",d.noClear=d.clearable===!1}if(d.type==="image"){let f=ne(e.formValues,d.name);d._imageSrc=f&&String(f).trim()?f:null,d.placeholderText=d.placeholderText||"No Image"}if(d.type==="read-only-text"&&(d.content=d.content||""),d.type==="checkbox"){let f=typeof d.content=="string"?d.content:typeof d.checkboxLabel=="string"?d.checkboxLabel:"";d._checkboxText=f}});let p=r.actions||{buttons:[]},l=p.layout||"split",a=(p.buttons||[]).map((d,h)=>({...d,_globalIdx:h,variant:d.variant||"se",_disabled:n||!!d.disabled,pre:d.pre||"",suf:d.suf||""})),c;return l==="split"?c={_layout:"split",buttons:a,_leftButtons:a.filter(d=>d.align==="left"),_rightButtons:a.filter(d=>d.align!=="left")}:c={_layout:l,buttons:a,_allButtons:a},{containerAttrString:s,title:r?.title||"",description:r?.description||"",flatFields:o,actions:c,formValues:e.formValues,tooltipState:e.tooltipState}},Te=({state:e,props:t})=>{let s=ee({state:e,props:t}),r=ie(s.fields||[]);return Ri(e.formValues,r.map(i=>i.name).filter(i=>typeof i=="string"&&i.length>0))},gl=({state:e,props:t},s={})=>{let{name:r,value:i}=s;r&&(he(e.formValues,r,i),at({state:e,props:t}))},at=({state:e,props:t})=>{if(!t)return;let s=ee({state:e,props:t}),r=ie(s.fields||[]);e.formValues=Ri(e.formValues,r.map(i=>i.name).filter(i=>typeof i=="string"&&i.length>0))},bl=({state:e},t={})=>{let{values:s}=t;!s||typeof s!="object"||Object.keys(s).forEach(r=>{he(e.formValues,r,s[r])})},vl=({state:e},t={})=>{let{defaultValues:s={}}=t;e.formValues=s?structuredClone(s):{},e.errors={},e.reactiveMode=!1},wl=({state:e},t={})=>{e.errors=t.errors||{}},_l=({state:e},t={})=>{let{name:s}=t;s&&e.errors[s]&&delete e.errors[s]},xl=({state:e})=>{e.reactiveMode=!0},Sl=({state:e},t={})=>{let{x:s,y:r,content:i}=t;e.tooltipState={open:!0,x:s,y:r,content:i}},Al=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},kl=Object.freeze(Object.defineProperty({__proto__:null,clearFieldError:_l,collectAllDataFields:ie,createInitialState:yl,flattenFields:Fs,get:ne,getDefaultValue:Ms,hideTooltip:Al,isDataField:Ws,pruneHiddenValues:at,resetFormValues:vl,selectForm:ee,selectFormValues:Te,selectViewData:ml,set:he,setErrors:wl,setFormFieldValue:gl,setFormValues:bl,setReactiveMode:xl,showTooltip:Sl,validateField:It,validateForm:Ot},Symbol.toStringTag,{value:"Module"})),Di=({field:e,target:t,value:s})=>{!e||!t||["slider-with-input","popover-input"].includes(e.type)&&(s==null?t.removeAttribute("value"):t.setAttribute("value",String(s)))},ji=({form:e,formValues:t={},refs:s,formDisabled:r=!1})=>{let i=e.fields||[],n=0,o=p=>{for(let l of p){if(l.type==="section"){n++,Array.isArray(l.fields)&&o(l.fields);continue}let a=s[`field${n}`];if(n++,!a)continue;let c=r||!!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=ne(t,l.name);if(d==null?a.removeAttribute("value"):a.setAttribute("value",String(d)),l.type==="slider-with-input"&&a.store?.setValue){let h=Number(d??0);a.store.setValue({value:Number.isFinite(h)?h:0}),typeof a.render=="function"&&a.render()}l.type==="popover-input"&&a.store?.setValue&&(a.store.setValue({value:d==null?"":String(d)}),typeof a.render=="function"&&a.render())}if(l.type==="tag-select"&&a.store?.updateSelectedValues){let d=ne(t,l.name);a.store.updateSelectedValues({values:Array.isArray(d)?d:[]}),typeof a.render=="function"&&a.render()}l.type==="checkbox"&&(ne(t,l.name)?a.setAttribute("checked",""):a.removeAttribute("checked")),["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input"].includes(l.type)&&l.placeholder&&a.getAttribute("placeholder")!==l.placeholder&&(l.placeholder===void 0||l.placeholder===null?a.removeAttribute("placeholder"):a.setAttribute("placeholder",l.placeholder)),c?a.setAttribute("disabled",""):a.removeAttribute("disabled")}};o(i)},Bi=(e,t)=>{let s=t?.defaultValues||{},r={};Object.keys(s).forEach(p=>{he(r,p,s[p])});let i=ee({state:{formValues:r},props:t}),n=ie(i.fields||[]),o={};for(let p of n){let l=ne(s,p.name);l!==void 0?he(o,p.name,l):he(o,p.name,Ms(p))}e.resetFormValues({defaultValues:o})},El=e=>{let{store:t,props:s}=e;Bi(t,s)},$l=e=>{let{props:t,refs:s,render:r}=e,i=e.store.getState(),n=ee({state:i,props:t});ji({form:n,formValues:i.formValues,refs:s,formDisabled:!!t?.disabled}),r()},Cl=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n,refs:o}=e,p=!!r?.disabled;s?.key!==r?.key&&Bi(i,r);let l=i.getState();at({state:l,props:r});let a=ee({state:l,props:r});ji({form:a,formValues:l.formValues,refs:o,formDisabled:p}),n()},Il=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event,p=o.currentTarget.dataset.fieldName;if(!p||!o.detail||!Object.prototype.hasOwnProperty.call(o.detail,"value"))return;let l=o.detail.value;s.setFormFieldValue({name:p,value:l});let a=s.getState();at({state:a,props:n});let c=ee({state:a,props:n}),d=ie(c.fields||[]).find(h=>h.name===p);if(Di({field:d,target:o.currentTarget,value:l}),a.reactiveMode&&d){let h=It(d,l);h?s.setErrors({errors:{...a.errors,[p]:h}}):s.clearFieldError({name:p})}i(),r(new CustomEvent("form-input",{bubbles:!0,detail:{name:p,value:l,values:Te({state:s.getState(),props:n})}}))},Ol=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event,p=o.currentTarget.dataset.fieldName;if(!p||!o.detail||!Object.prototype.hasOwnProperty.call(o.detail,"value"))return;let l=o.detail.value;s.setFormFieldValue({name:p,value:l});let a=s.getState();at({state:a,props:n});let c=ee({state:a,props:n}),d=ie(c.fields||[]).find(h=>h.name===p);if(Di({field:d,target:o.currentTarget,value:l}),a.reactiveMode&&d){let h=It(d,l);h?s.setErrors({errors:{...a.errors,[p]:h}}):s.clearFieldError({name:p})}i(),r(new CustomEvent("form-change",{bubbles:!0,detail:{name:p,value:l,values:Te({state:s.getState(),props:n})}}))},Tl=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event.currentTarget.dataset.actionId;if(!o)return;let p=s.getState(),l=ee({state:p,props:n}),a=((l.actions||{}).buttons||[]).find(d=>d.id===o),c=Te({state:p,props:n});if(a&&a.validate){let d=ie(l.fields||[]),{valid:h,errors:f}=Ot(d,p.formValues);s.setErrors({errors:f}),h||s.setReactiveMode(),i(),r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:o,values:c,valid:h,errors:f}}))}else r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:o,values:c}}))},Ll=(e,t)=>{let s=t._event;s.type==="contextmenu"&&s.preventDefault();let{store:r,dispatchEvent:i,props:n}=e,o=s.currentTarget.dataset.fieldName;i(new CustomEvent("form-field-event",{bubbles:!0,detail:{name:o,event:s.type,values:Te({state:r.getState(),props:n})}}))},Vl=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event;if(o.key==="Enter"&&!o.shiftKey){let p=o.target;if(p.tagName==="TEXTAREA"||p.tagName==="RTGL-TEXTAREA")return;o.preventDefault();let l=s.getState(),a=ee({state:l,props:n}),c=(a.actions||{}).buttons||[],d=c.find(f=>f.validate)||c[0];if(!d)return;let h=Te({state:l,props:n});if(d.validate){let f=ie(a.fields||[]),{valid:u,errors:y}=Ot(f,l.formValues);s.setErrors({errors:y}),u||s.setReactiveMode(),i(),r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h,valid:u,errors:y}}))}else r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h}}))}},Rl=(e,t)=>{let{store:s,render:r,props:i}=e,n=t._event,o=n.currentTarget.dataset.fieldName,p=ee({state:s.getState(),props:i}),l=ie(p.fields||[]).find(a=>a.name===o);if(l&&l.tooltip){let a=n.currentTarget.getBoundingClientRect();s.showTooltip({x:a.left+a.width/2,y:a.top-8,content:typeof l.tooltip=="string"?l.tooltip:l.tooltip.content||""}),r()}},Nl=e=>{let{store:t,render:s}=e;t.hideTooltip({}),s()},Pl=Object.freeze(Object.defineProperty({__proto__:null,handleActionClick:Tl,handleAfterMount:$l,handleBeforeMount:El,handleImageClick:Ll,handleKeyDown:Vl,handleOnUpdate:Cl,handleTooltipMouseEnter:Rl,handleTooltipMouseLeave:Nl,handleValueChange:Ol,handleValueInput:Il},Symbol.toStringTag,{value:"Module"})),Dl=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"],jl=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input","slider-with-input"],Bl=({ref:e,fieldType:t,value:s,forceRefresh:r=!1})=>{if(Dl.includes(t)){if(r&&e.removeAttribute("value"),s==null){if(jl.includes(t)&&r){if(t==="popover-input"){e.removeAttribute("value");return}e.setAttribute("value","");return}e.removeAttribute("value");return}e.setAttribute("value",String(s))}},zi=({ref:e,value:t})=>{if(e){if(e?.store?.updateSelectedValues)e.store.updateSelectedValues({values:Array.isArray(t)?t:[]});else if(e?.store?.updateSelectedValue)e.store.updateSelectedValue({value:t});else return;typeof e.render=="function"&&e.render()}},zl=e=>{let t=new Map;return!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("[data-field-name]").forEach(s=>{let r=s.getAttribute("data-field-name");r&&t.set(r,s)}),t},Ur=e=>e?.renderTarget?e.renderTarget:e?.shadowRoot?e.shadowRoot:e?.shadow,Wl=({root:e,values:t={}})=>{!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("rtgl-select[data-field-name], rtgl-tag-select[data-field-name], rtgl-segmented-control[data-field-name]").forEach(s=>{let r=s.dataset?.fieldName;if(!r)return;let i=ne(t,r);zi({ref:s,value:i})})},Ml=function(){let e=this.store.getState();return Te({state:e,props:this.props})},Fl=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 s=this.store.getState(),r=ee({state:s,props:this.props}),i=ie(r.fields||[]),n=zl(Ur(this));for(let p of i){if(!p.name)continue;let l=n.get(p.name);if(!l)continue;let a=Object.prototype.hasOwnProperty.call(t,p.name),c=ne(t,p.name);if(!a&&c===void 0)continue;let d=ne(s.formValues,p.name);Bl({ref:l,fieldType:p.type,value:d,forceRefresh:!0}),["select","tag-select","segmented-control"].includes(p.type)&&zi({ref:l,value:d}),p.type==="checkbox"&&(d?l.setAttribute("checked",""):l.removeAttribute("checked"))}this.render();let o=()=>{let p=this.store.getState();Wl({root:Ur(this),values:p.formValues})};o(),setTimeout(()=>{o()},0)},Kl=function(){let e=this.store.getState(),t=ee({state:e,props:this.props}),s=ie(t.fields||[]),{valid:r,errors:i}=Ot(s,e.formValues);return this.store.setErrors({errors:i}),r||this.store.setReactiveMode(),this.render(),{valid:r,errors:i}},Ul=function(){let e=this.props?.defaultValues||{},t={};Object.keys(e).forEach(n=>{he(t,n,e[n])});let s=ee({state:{formValues:t},props:this.props}),r=ie(s.fields||[]),i={};for(let n of r){let o=ne(e,n.name);o!==void 0?he(i,n.name,o):he(i,n.name,Ms(n))}this.store.resetFormValues({defaultValues:i}),this.setValues(i)},Hl=Object.freeze(Object.defineProperty({__proto__:null,getValues:Ml,reset:Ul,setValues:Fl,validate:Kl},Symbol.toStringTag,{value:"Module"})),Hr=3e3,ql=180,_t=new WeakMap,Wi=e=>{e&&(typeof e.componentDialogBodyHost?.replaceChildren=="function"&&e.componentDialogBodyHost.replaceChildren(),delete e.componentDialogBody)},Yl=e=>{let t=e.selectUiType();return t==="dropdown"||t==="formDialog"||t==="componentDialog"?null:e.selectConfig().mode==="confirm"?!1:null},fe=({store:e,render:t,globalUI:s,refs:r,emitResult:i=!1,result:n})=>{if(!e.selectIsOpen())return;let o=n!==void 0?n:Yl(e);Wi(r),e.closeAll(),t(),i&&s.emit("event",o)},Mi=({store:e,render:t,globalUI:s,refs:r,error:i})=>{Wi(r),e.selectIsOpen()&&(e.closeAll(),t()),s.emit("error",i)},lt=({store:e,render:t,globalUI:s,refs:r})=>{e.selectIsOpen()&&fe({store:e,render:t,globalUI:s,refs:r,emitResult:!0})},pt=(e,{rejectOnError:t=!1}={})=>new Promise((s,r)=>{let i=null,n=e.once("event",o=>{i?.(),s(o)});t&&(i=e.once("error",o=>{n?.(),r(o)}))}),Gl=e=>{let t=_t.get(e);return t||(t=new Map,_t.set(e,t)),t},Jl=(e,t)=>{let s=_t.get(e),r=s?.get(t);r&&(clearTimeout(r.exitTimerId),clearTimeout(r.removeTimerId),s.delete(t))},Ql=e=>{let t=_t.get(e);if(t){for(let s of t.values())clearTimeout(s.exitTimerId),clearTimeout(s.removeTimerId);t.clear()}},Zl=({store:e,render:t,globalUI:s},r)=>{Jl(s,r);let i=Gl(s),n=setTimeout(()=>{e.setToastPhase?.({id:r,phase:"exiting"}),t()},Math.max(0,Hr-ql)),o=setTimeout(()=>{i.delete(r),e.removeToast({id:r}),t()},Hr);i.set(r,{exitTimerId:n,removeTimerId:o})},Xl=(e,t)=>{setTimeout(()=>{let{store:s,refs:r}=e;if(!s.selectIsOpen()||s.selectUiType()!=="formDialog")return;let i=s.selectFormDialogConfig?.();if(!i||i.key!==t||typeof i.mount!="function")return;let n=r.formDialog;n&&i.mount(n)},0)},ep=(e,t)=>{setTimeout(()=>{let{store:s,refs:r,render:i,globalUI:n}=e;if(!s.selectIsOpen()||s.selectUiType()!=="componentDialog")return;let o=s.selectComponentDialogConfig?.();if(!o||o.key!==t)return;let p=r.componentDialogBodyHost;if(p)try{let l=document.createElement(o.component);Object.entries(o.props??{}).forEach(([a,c])=>{l[a]=c}),p.replaceChildren(l),r.componentDialogBody=l}catch(l){Mi({store:s,render:i,globalUI:n,refs:r,error:l})}},0)},us=(e,t)=>!e.selectIsOpen()||e.selectUiType()!=="componentDialog"?!1:e.selectComponentDialogConfig?.()?.key===t,tp=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0})},sp=e=>{let{store:t,render:s,globalUI:r,refs:i}=e,n=t.selectConfig().mode==="confirm"?!0:null;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0,result:n})},rp=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0,result:!1})},ip=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0,result:null})},np=(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t._event,{index:p,item:l}=o.detail;fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:{index:p,item:l}})},op=(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;return lt({store:s,render:r,globalUI:i,refs:n}),s.setAlertConfig(o),r(),pt(i)},ap=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;return lt({store:s,render:r,globalUI:i,refs:n}),s.setConfirmConfig(o),r(),pt(i)},lp=(e,t)=>{let{store:s,render:r,globalUI:i}=e;s.addToast(t),r();let n=s.selectToasts?.()??[],o=n[n.length-1]?.id;o&&Zl({store:s,render:r,globalUI:i},o)},pp=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;return lt({store:s,render:r,globalUI:i,refs:n}),s.setDropdownConfig(o),r(),pt(i)},dp=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;lt({store:s,render:r,globalUI:i,refs:n}),s.setFormDialogConfig(o),r();let p=s.selectFormDialogConfig?.().key;return Xl(e,p),pt(i)},cp=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;lt({store:s,render:r,globalUI:i,refs:n}),s.setComponentDialogConfig(o),r();let p=s.selectComponentDialogConfig?.().key;return ep(e,p),pt(i,{rejectOnError:!0})},up=(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t._event?.detail??{};o.valid!==!1&&fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:o})},hp=(e,t)=>{let{store:s,refs:r}=e,i=t._event?.detail??{},n=s.selectFormDialogConfig?.();typeof n?.onFieldEvent=="function"&&n.onFieldEvent({detail:i,formEl:r.formDialog??null})},fp=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;Ql(r);let n=(t.selectToasts?.().length??0)>0;if(n&&t.clearToasts(),t.selectIsOpen()){fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0});return}n&&s()},yp=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t._event,p=Number(o?.currentTarget?.dataset?.actionIndex),l=s.selectComponentDialogConfig?.(),a=l?.key,c=Number.isInteger(p)?l?.actions?.buttons?.[p]:null;if(c){if(c.role==="cancel"){fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:{actionId:c.id}});return}try{let d=n.componentDialogBody;if(!d||typeof d.validate!="function"||typeof d.getValues!="function")throw new Error(`component dialog body '${l?.component??"unknown"}' must implement validate() and getValues()`);if(c.validate){let f=await d.validate();if(!us(s,a))return;if(!f||typeof f!="object"||typeof f.valid!="boolean")throw new Error("component dialog body validate() must return { valid, errors? }");if(f.valid===!1)return}let h=await d.getValues();if(!us(s,a))return;fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:{actionId:c.id,values:h}})}catch(d){if(!us(s,a))return;Mi({store:s,render:r,globalUI:i,refs:n,error:d})}}},mp=Object.freeze(Object.defineProperty({__proto__:null,handleCancel:rp,handleCloseAll:fp,handleComponentDialogAction:yp,handleConfirm:sp,handleDialogClose:tp,handleDropdownClose:ip,handleDropdownItemClick:np,handleFormAction:up,handleFormFieldEvent:hp,handleShowAlert:op,handleShowComponentDialog:cp,handleShowConfirm:ap,handleShowDropdownMenu:pp,handleShowFormDialog:dp,handleShowToast:lp},Symbol.toStringTag,{value:"Module"})),gp=new Set(["sm","md","lg","f"]),bp=new Set(["sm","md","lg"]),vp=new Set(["active","exiting"]),wp=new Set(["top","bottom"]),_p=new Set(["confirm","cancel"]),Fi=[["overlay","overlay"],["noOverlay","no-overlay"],["smPlace","sm-place"],["mdPlace","md-place"],["lgPlace","lg-place"],["xlPlace","xl-place"],["smOverlay","sm-overlay"],["mdOverlay","md-overlay"],["lgOverlay","lg-overlay"],["xlOverlay","xl-overlay"],["smNoOverlay","sm-no-overlay"],["mdNoOverlay","md-no-overlay"],["lgNoOverlay","lg-no-overlay"],["xlNoOverlay","xl-no-overlay"]],xp=Object.freeze([{id:"cancel",label:"Cancel",variant:"se",align:"left",role:"cancel"},{id:"confirm",label:"OK",variant:"pr",role:"confirm",validate:!0}]),_s=e=>!e||typeof e!="object"||Array.isArray(e)?{}:e,Sp=e=>`${e}`.replace(/"/g,"&quot;"),Ap=(e={},t,s)=>e[t]!==void 0?e[t]:e[s],kp=(e={})=>Fi.reduce((t,[s,r])=>{let i=Ap(e,s,r);return i!=null&&(t[s]=i),t},{}),Ep=(e={})=>Fi.filter(([t])=>e[t]!==void 0&&e[t]!==null).map(([t,s])=>{let r=e[t];return r===!0?s:`${s}="${Sp(r)}"`}).join(" "),je=(e,t="md")=>gp.has(e)?e:t,Ki=(e,t="sm")=>bp.has(e)?e:t,Ui=(e,t="active")=>vp.has(e)?e:t,Hi=(e,t="top")=>wp.has(e)?e:t,Ks=e=>{let t=(Array.isArray(e?.buttons)&&e.buttons.length>0?e.buttons:xp).map((s,r)=>{if(!s||typeof s!="object"||Array.isArray(s))throw new Error("component dialog buttons must be objects");if(typeof s.id!="string"||s.id.length===0)throw new Error("component dialog button id is required");if(typeof s.label!="string"||s.label.length===0)throw new Error("component dialog button label is required");if(!_p.has(s.role))throw new Error("component dialog button role must be 'confirm' or 'cancel'");return{...s,_globalIdx:r,variant:s.variant??(s.role==="confirm"?"pr":"se"),align:s.align??(s.role==="cancel"?"left":"right"),validate:s.role==="confirm"?!!s.validate:!1,_disabled:!!s.disabled,pre:s.pre??"",suf:s.suf??""}});return{_layout:"split",buttons:t,_leftButtons:t.filter(s=>s.align==="left"),_rightButtons:t.filter(s=>s.align!=="left")}},qi=()=>({title:"",description:"",size:"md",component:"",props:{},actions:Ks(),key:0}),$p=()=>Object.freeze({isOpen:!1,uiType:"dialog",nextToastId:0,toasts:[],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},componentDialogConfig:qi()}),Cp=({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},Ip=({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},Op=({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",...kp(t)},e.uiType="dropdown",e.isOpen=!0},Tp=({state:e},t={})=>{if(!t.form||typeof t.form!="object"||Array.isArray(t.form))throw new Error("form object is required for showFormDialog");let s=e.formDialogConfig?.key??0;e.formDialogConfig={form:t.form,defaultValues:_s(t.defaultValues),context:_s(t.context),disabled:!!t.disabled,size:je(t.size,"md"),key:s+1,onFieldEvent:typeof t.onFieldEvent=="function"?t.onFieldEvent:null,mount:typeof t.mount=="function"?t.mount:null},e.uiType="formDialog",e.isOpen=!0},Lp=({state:e},t={})=>{if(typeof t.component!="string"||!t.component.includes("-"))throw new Error("component tag name is required for showComponentDialog");let s=e.componentDialogConfig?.key??0;e.componentDialogConfig={title:typeof t.title=="string"?t.title:"",description:typeof t.description=="string"?t.description:"",size:je(t.size,"md"),component:t.component,props:_s(t.props),actions:Ks(t.actions),key:s+1},e.uiType="componentDialog",e.isOpen=!0},Vp=({state:e},t={})=>{if(typeof t.message!="string"||t.message.length===0)throw new Error("message is required for showToast");let s=(e.nextToastId??0)+1,r={id:`toast-${s}`,message:t.message,size:Ki(t.size??t.s,"sm"),position:Hi(t.position,"top"),phase:"active"};e.nextToastId=s,e.toasts=[...e.toasts??[],r]},Rp=({state:e},t={})=>{typeof t.id!="string"||t.id.length===0||(e.toasts=(e.toasts??[]).filter(s=>s.id!==t.id))},Np=({state:e},t={})=>{typeof t.id!="string"||t.id.length===0||(e.toasts=(e.toasts??[]).map(s=>s.id!==t.id?s:{...s,phase:Ui(t.phase,"active")}))},Pp=({state:e})=>{e.toasts=[]},Dp=({state:e})=>{e.isOpen=!1,e.uiType="dialog"},jp=({state:e})=>e.config,Bp=({state:e})=>e.dropdownConfig,zp=({state:e})=>e.formDialogConfig,Wp=({state:e})=>e.componentDialogConfig,Mp=({state:e})=>e.uiType,Fp=({state:e})=>e.isOpen,Kp=({state:e})=>e.toasts??[],Up=({state:e})=>{let t=e.isOpen&&e.uiType==="dialog",s=e.isOpen&&e.uiType==="formDialog",r=e.isOpen&&e.uiType==="componentDialog",i=e.componentDialogConfig??qi(),n=Array.isArray(e.toasts)?e.toasts.map(o=>({...o,size:Ki(o.size,"sm"),position:Hi(o.position,"top"),phase:Ui(o.phase,"active")})):[];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",popoverAttrString:Ep(e.dropdownConfig)},formDialogConfig:{form:e.formDialogConfig?.form??{fields:[],actions:{buttons:[]}},defaultValues:e.formDialogConfig?.defaultValues??{},context:e.formDialogConfig?.context??{},disabled:!!e.formDialogConfig?.disabled,size:je(e.formDialogConfig?.size,"md"),key:e.formDialogConfig?.key??0},componentDialogConfig:{title:i.title??"",description:i.description??"",size:je(i.size,"md"),component:i.component??"",props:i.props??{},actions:i.actions??Ks(),key:i.key??0},toasts:n,topToasts:n.filter(o=>o.position==="top"),bottomToasts:n.filter(o=>o.position==="bottom"),isDialogOpen:t,isFormDialogOpen:s,isComponentDialogOpen:r,isDialogContainerOpen:t||s||r,isDropdownOpen:e.isOpen&&e.uiType==="dropdown",dialogSize:r?je(i.size,"md"):s?je(e.formDialogConfig?.size,"md"):"sm"}},Hp=Object.freeze(Object.defineProperty({__proto__:null,addToast:Vp,clearToasts:Pp,closeAll:Dp,createInitialState:$p,removeToast:Rp,selectComponentDialogConfig:Wp,selectConfig:jp,selectDropdownConfig:Bp,selectFormDialogConfig:zp,selectIsOpen:Fp,selectToasts:Kp,selectUiType:Mp,selectViewData:Up,setAlertConfig:Cp,setComponentDialogConfig:Lp,setConfirmConfig:Ip,setDropdownConfig:Op,setFormDialogConfig:Tp,setToastPhase:Np},Symbol.toStringTag,{value:"Module"})),qp=(e,t)=>{let{dispatchEvent:s,store:r}=e;t._event,console.log("handle click start",r.selectPath()),s(new CustomEvent("start-click",{detail:{path:r.selectPath()}}))},Yp=Object.freeze(Object.defineProperty({__proto__:null,handleClickStart:qp},Symbol.toStringTag,{value:"Module"})),Gp=()=>Object.freeze({}),Jp=["id","class","style","slot","start"],Qp=(e={})=>Object.entries(e).filter(([t])=>!Jp.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Zp=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}}}},Xp=({props:e})=>{let t=Zp(e.start)||e.start;return{containerAttrString:Qp(e),start:t||{label:"",image:{src:"",width:32,height:32,alt:""}}}},ed=({props:e})=>e.start?.path,td=({state:e})=>{},sd=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Gp,selectPath:ed,selectViewData:Xp,setState:td},Symbol.toStringTag,{value:"Module"})),qr=e=>{let t=e.querySelectorAll("h1[id], h2[id], h3[id], h4[id], rtgl-text[id]");return Array.from(t)},rd=e=>e.map(t=>{let s=1,r=t.tagName.toLowerCase();return r==="h1"?s=1:r==="h2"?s=2:r==="h3"?s=3:r==="h4"?s=4:r==="rtgl-text"&&(s=parseInt(t.getAttribute("data-level")||"1",10)),{id:t.id,href:`#${t.id}`,title:t.textContent,level:s}}),Yr=(e,t,s)=>{let{store:r,render:i}=s,n,o=-1/0;if(e.forEach(p=>{let l=p.getBoundingClientRect();l.top<=t&&l.top>o&&(o=l.top,n=p.id)}),!n){let p=1/0;e.forEach(l=>{let a=l.getBoundingClientRect();a.top>t&&a.top<p&&(p=a.top,n=l.id)})}n&&n!==r.selectCurrentId()&&(r.setCurrentId({id:n}),i())},id=(e,t,s,r)=>{let{store:i,render:n}=r,o=null,p=()=>{o=null;let d=qr(e);i.setItems({items:rd(d)}),Yr(d,s,r),n()},l=()=>{o===null&&(o=requestAnimationFrame(p))},a=()=>{Yr(qr(e),s,r)};l(),t.addEventListener("scroll",a,{passive:!0});let c=new MutationObserver(()=>{l()});return c.observe(e,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["id","data-level"]}),()=>{o!==null&&cancelAnimationFrame(o),c.disconnect(),t.removeEventListener("scroll",a)}},nd=e=>{let{props:t}=e,s=()=>{};return requestAnimationFrame(()=>{let r=document.getElementById(t.targetId);if(!r)return;let i=window;t.scrollContainerId&&(i=document.getElementById(t.scrollContainerId)||window);let n=parseInt(t.offsetTop||"100",10);s=id(r,i,n,e)}),()=>{s()}},od=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:nd},Symbol.toStringTag,{value:"Module"})),ad=()=>Object.freeze({items:[],currentId:null,contentContainer:null}),ld=({state:e})=>{let t=((s,r)=>{let i=new Set,n=s.findIndex(p=>p.id===r);if(n===-1)return i;let o=s[n].level;for(let p=n-1;p>=0;p--)if(s[p].level<o){let l=s[p].level;i.add(s[p].id);for(let a=p-1;a>=0;a--)s[a].level<l&&(i.add(s[a].id),l=s[a].level);break}return i})(e.items,e.currentId);return{items:e.items.map(s=>{let r={1:"0",2:"12px",3:"24px",4:"32px"},i=s.id===e.currentId,n=t.has(s.id),o=i||n;return{...s,c:o?"fg":"mu-fg",ml:r[s.level]||"",bc:o?"fg":"mu-fg"}}),currentId:e.currentId}},pd=({state:e})=>e,dd=({state:e})=>e.currentId,cd=({state:e},t={})=>{e.items=Array.isArray(t.items)?t.items:[]},ud=({state:e},t={})=>{e.currentId=t.id},hd=({state:e},t={})=>{e.contentContainer=t.container},fd=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:ad,selectCurrentId:dd,selectState:pd,selectViewData:ld,setContentContainer:hd,setCurrentId:ud,setItems:cd},Symbol.toStringTag,{value:"Module"})),dt=e=>e==null||e===!0?"":String(e),Yi=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=dt(t);s.setValue({value:n}),s.closePopover({}),i(new CustomEvent("value-change",{detail:{value:n},bubbles:!0})),r()},yd=e=>{let{store:t,props:s}=e;if(s.value!==void 0){let r=dt(s.value);t.setValue({value:r}),t.setTempValue({value:r})}},md=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n}=e;if(s?.value!==r?.value){let o=dt(r?.value);i.setValue({value:o}),i.getState().isOpen||i.setTempValue({value:o})}n()},gd=(e,t)=>{let{store:s,render:r,refs:i,props:n}=e;if(n.disabled)return;let o=t._event,p=dt(n.value);s.setValue({value:p}),s.setTempValue({value:p}),s.openPopover({position:{x:o.currentTarget.getBoundingClientRect().left,y:o.currentTarget.getBoundingClientRect().bottom}}),r(),setTimeout(()=>{let{input:l}=i;if(!l)return;l.value=p,l.focus();let a=l.shadowRoot?.querySelector("input, textarea");a&&typeof a.focus=="function"&&a.focus()},50)},bd=(e,t)=>{let{store:s,render:r}=e;s.closePopover({}),r()},vd=(e,t)=>{let{store:s}=e,r=t._event,i=dt(r.detail.value);s.setTempValue({value:i})},wd=e=>{let{store:t,refs:s}=e,{input:r}=s,i=r?r.value:t.getState().tempValue;Yi(e,i)},_d=(e,t)=>{let{store:s,refs:r}=e,i=t._event;if(i.key==="Enter"){i.preventDefault(),i.stopPropagation();let{input:n}=r,o=n?n.value:s.getState().tempValue;Yi(e,o)}else i.key==="Escape"&&(i.preventDefault(),i.stopPropagation(),s.closePopover({}),e.render())},xd=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:yd,handleInputChange:vd,handleInputKeydown:_d,handleOnUpdate:md,handlePopoverClose:bd,handleSubmitClick:wd,handleTextClick:gd},Symbol.toStringTag,{value:"Module"})),Sd=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),Ad=({props:e,state:t})=>{let s=typeof t.value=="string"&&t.value.length>0,r=s?t.value:"-",i=typeof e.placeholder=="string"?e.placeholder:"",n=typeof e.label=="string"?e.label:"",o=!!e.disabled;return{isOpen:t.isOpen,position:t.position,value:r,valueColor:s?"fg":"mu-fg",tempValue:t.tempValue,placeholder:i,label:n,disabled:o}},kd=({state:e},t={})=>{e.tempValue=t.value},Ed=({state:e},t={})=>{let{position:s}=t;e.position=s,e.isOpen=!0,e.hasUnsavedChanges=!1},$d=({state:e})=>{e.isOpen=!1,e.tempValue=""},Cd=({state:e},t={})=>{e.value=t.value},Id=({state:e})=>e.value,Od=Object.freeze(Object.defineProperty({__proto__:null,closePopover:$d,createInitialState:Sd,openPopover:Ed,selectValue:Id,selectViewData:Ad,setTempValue:kd,setValue:Cd},Symbol.toStringTag,{value:"Module"})),le=(e,t)=>{if(e===t)return!0;if(e==null||t==null||typeof e!="object"||typeof t!="object")return!1;let s=Object.keys(e),r=Object.keys(t);if(s.length!==r.length)return!1;for(let i of s)if(!r.includes(i)||!le(e[i],t[i]))return!1;return!0},Gr=({dispatchEvent:e,value:t,label:s,index:r,item:i})=>{e(new CustomEvent("value-change",{detail:{value:t,label:s,index:r,item:i},bubbles:!0}))},Td=e=>{let{store:t,props:s,render:r}=e;if(s.selectedValue!==null&&s.selectedValue!==void 0&&s.options){let i=s.options.find(n=>le(n.value,s.selectedValue));i&&(t.updateSelectedValue({value:i.value}),r())}},Ld=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n}=e,o=!1;s.selectedValue!==r.selectedValue&&(i.updateSelectedValue({value:r.selectedValue}),o=!0),o&&n()},Gi=(e,t)=>{let{render:s,dispatchEvent:r,props:i,store:n}=e;if(i.disabled)return;let o=t._event;o.stopPropagation();let p=o.currentTarget.id.slice(6),l=Number(p),a=i.options[l],c=Object.prototype.hasOwnProperty.call(i||{},"selectedValue"),d=n.selectSelectedValue(),h=c?!0:n.selectHasSelectedValue(),f=a?h&&le(a.value,d):!1;if(a){if(f&&!i.noClear){n.clearSelectedValue({}),i.onChange&&typeof i.onChange=="function"&&i.onChange(void 0),Gr({dispatchEvent:r,value:void 0,label:void 0,index:null,item:void 0}),s();return}n.updateSelectedValue({value:a.value}),i.onChange&&typeof i.onChange=="function"&&i.onChange(a.value),Gr({dispatchEvent:r,value:a.value,label:a.label,index:l,item:a}),s()}},Vd=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Gi(e,t))},Rd=(e,t)=>{let{store:s,render:r}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(6),10);s.setHoveredOption({optionId:n}),r()},Nd=e=>{let{store:t,render:s}=e;t.clearHoveredOption({}),s()},Ji=(e,t)=>{if(e.props.disabled)return;let{render:s,dispatchEvent:r}=e,{_event:i}=t;i.stopPropagation(),r(new CustomEvent("add-option-click",{bubbles:!0})),s()},Pd=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Ji(e,t))},Dd=e=>{let{store:t,render:s}=e;t.setHoveredAddOption({isHovered:!0}),s()},jd=e=>{let{store:t,render:s}=e;t.setHoveredAddOption({isHovered:!1}),s()},Bd=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:Ji,handleAddOptionKeyDown:Pd,handleAddOptionMouseEnter:Dd,handleAddOptionMouseLeave:jd,handleBeforeMount:Td,handleOnUpdate:Ld,handleOptionClick:Gi,handleOptionKeyDown:Vd,handleOptionMouseEnter:Rd,handleOptionMouseLeave:Nd},Symbol.toStringTag,{value:"Module"})),zd=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],Wd=(e={})=>Object.entries(e).filter(([t])=>!zd.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Md=()=>Object.freeze({selectedValue:null,hasSelectedValue:!1,hoveredOptionId:null,hoveredAddOption:!1}),Fd=({state:e,props:t})=>{let s=Wd(t),r=!!t.disabled,i=Object.prototype.hasOwnProperty.call(t||{},"selectedValue"),n=i?t.selectedValue:e.selectedValue,o=i?!0:!!e.hasSelectedValue,p=t.options||[],l=p.map((a,c)=>{let d=o&&le(a.value,n),h=e.hoveredOptionId===c;return{...a,isSelected:d,bgc:d?"ac":h&&!r?"mu":"",textColor:d?"ac-fg":"fg",borderLeftWidth:c===0?"none":"xs",cursor:r?"not-allowed":"pointer",tabIndex:r?-1:0}});return{containerAttrString:s,isDisabled:r,options:l,selectedValue:n,hasSelectedValue:o,ariaLabel:t.placeholder||"Segmented control",showAddOption:!r&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"mu":"",addOptionBorderLeftWidth:p.length===0?"none":"xs"}},Kd=({state:e})=>e,Ud=({state:e})=>e.selectedValue,Hd=({state:e})=>!!e.hasSelectedValue,qd=({state:e},t={})=>{e.selectedValue=t.value,e.hasSelectedValue=!0},Yd=({state:e})=>{e.selectedValue=void 0,e.hasSelectedValue=!1},Gd=({state:e},t={})=>{e.hoveredOptionId=t.optionId},Jd=({state:e})=>{e.hoveredOptionId=null},Qd=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},Zd=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:Jd,clearSelectedValue:Yd,createInitialState:Md,selectHasSelectedValue:Hd,selectSelectedValue:Ud,selectState:Kd,selectViewData:Fd,setHoveredAddOption:Qd,setHoveredOption:Gd,updateSelectedValue:qd},Symbol.toStringTag,{value:"Module"})),Us=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Xd=(e={})=>{let t=e.searchInput;if(!t)return;typeof t.focus=="function"&&t.focus();let s=t.shadowRoot?.querySelector("input, textarea");s&&typeof s.focus=="function"&&s.focus()},Qi=(e={},t=10)=>{let s=e.popover;if(s?.hasAttribute?.("open")){if(s.hasAttribute("positioned")||t===0){Xd(e);return}setTimeout(()=>Qi(e,t-1),16)}},ec=(e={})=>{e?.popover?.refreshContent?.()},tc=(e={})=>e.detail&&Object.prototype.hasOwnProperty.call(e.detail,"value")?e.detail.value:e.currentTarget?.value??"",sc=e=>{let{store:t,props:s,render:r}=e;if(s.selectedValue!==null&&s.selectedValue!==void 0&&s.options){let i=s.options.find(n=>Us(n)==="item"&&le(n.value,s.selectedValue));i&&(t.updateSelectedValue({value:i?.value}),r())}},rc=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n,refs:o}=e,p=!1,l=!1;r?.disabled&&!s?.disabled&&(i.closeOptionsPopover({}),p=!0),s.selectedValue!==r.selectedValue&&(i.updateSelectedValue({value:r.selectedValue}),p=!0),s.options!==r.options&&(p=!0,l=!0),s.searchable!==r.searchable&&(i.setSearchQuery?.({query:""}),p=!0,l=!0),(s.searchPlaceholder!==r.searchPlaceholder||s.emptySearchLabel!==r.emptySearchLabel)&&(p=!0,l=!0),p&&(n(),l&&i.selectState?.().isOpen&&ec(o))},Zi=(e,t)=>{let{store:s,render:r,refs:i,props:n}=e;if(n.disabled)return;t._event.stopPropagation();let o=i.selectButton.getBoundingClientRect(),p=s.selectSelectedValue(),l=p!==null?p:n.selectedValue,a=null;l!=null&&n.options&&(a=n.options.findIndex(c=>Us(c)==="item"&&le(c.value,l)),a===-1&&(a=null)),s.openOptionsPopover({position:{y:o.bottom+12,x:o.left-24},selectedIndex:a}),r(),n.searchable&&Qi(i)},ic=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Zi(e,t))},nc=e=>{let{store:t,render:s}=e;t.closeOptionsPopover({}),s()},oc=(e,t)=>{let{store:s,render:r}=e,i=t._event;i.stopPropagation(),s.setSearchQuery({query:tc(i)}),r()},ac=(e,t)=>{let{store:s,render:r}=e,i=t._event;i.stopPropagation(),i.key==="Escape"&&(i.preventDefault(),s.closeOptionsPopover({}),r())},lc=(e,t)=>{let{render:s,dispatchEvent:r,props:i,store:n}=e;if(i.disabled)return;let o=t._event;o.stopPropagation();let p=o.currentTarget.id.slice(6),l=Number(p),a=i.options[p];Us(a)==="item"&&(n.updateSelectedValue({value:a?.value}),i.onChange&&typeof i.onChange=="function"&&i.onChange(a.value),r(new CustomEvent("value-change",{detail:{value:a.value,label:a.label,index:l,item:a},bubbles:!0})),s())},pc=(e,t)=>{let{store:s,render:r}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(6),10);s.setHoveredOption({optionId:n}),r()},dc=(e,t)=>{let{store:s,render:r}=e;s.clearHoveredOption({}),r()},cc=(e,t)=>{let{store:s,render:r,dispatchEvent:i,props:n}=e;n.disabled||(t._event.stopPropagation(),s.clearSelectedValue({}),n.onChange&&typeof n.onChange=="function"&&n.onChange(void 0),i(new CustomEvent("value-change",{detail:{value:void 0,label:void 0,index:null,item:void 0},bubbles:!0})),r())},uc=(e,t)=>{if(e.props.disabled)return;let{store:s,render:r,dispatchEvent:i}=e,{_event:n}=t;n.stopPropagation(),s.closeOptionsPopover({}),i(new CustomEvent("add-option-click",{bubbles:!0})),r()},hc=(e,t)=>{let{store:s,render:r}=e;s.setHoveredAddOption({isHovered:!0}),r()},fc=(e,t)=>{let{store:s,render:r}=e;s.setHoveredAddOption({isHovered:!1}),r()},yc=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:uc,handleAddOptionMouseEnter:hc,handleAddOptionMouseLeave:fc,handleBeforeMount:sc,handleButtonClick:Zi,handleButtonKeyDown:ic,handleClearClick:cc,handleClickOptionsPopoverOverlay:nc,handleOnUpdate:rc,handleOptionClick:lc,handleOptionMouseEnter:pc,handleOptionMouseLeave:dc,handleSearchInput:oc,handleSearchKeyDown:ac},Symbol.toStringTag,{value:"Module"})),mc=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled","searchable","searchPlaceholder","emptySearchLabel"],gc=(e={})=>Object.entries(e).filter(([t])=>!mc.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),bc=(e,t)=>Object.prototype.hasOwnProperty.call(e||{},t),Hs=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Jr=(e={})=>Hs(e)==="item",Xi=(e={})=>typeof e.icon=="string"&&e.icon.length>0?e.icon:"",en=(e={})=>typeof e.shortcut=="string"&&e.shortcut.length>0?e.shortcut:typeof e.suffixText=="string"&&e.suffixText.length>0?e.suffixText:"",tn=e=>e==null?"":String(e).trim().toLowerCase(),Qr=(e={},t="")=>t?String(e.label??"").toLowerCase().includes(t):!0,vc=(e=[])=>{let t=[],s={section:null,entries:[]};return e.forEach((r,i)=>{let n={option:r,index:i,type:Hs(r)};if(n.type==="section"){(s.section||s.entries.length>0)&&t.push(s),s={section:n,entries:[]};return}s.entries.push(n)}),(s.section||s.entries.length>0)&&t.push(s),t},wc=(e=[],t="")=>{let s=tn(t);return s?vc(e).flatMap(r=>{let i=r.section?Qr(r.section.option,s):!1,n=r.entries.map(l=>l.type!=="item"?!1:i||Qr(l.option,s)),o=n.some(Boolean);if(!i&&!o)return[];let p=[];return r.section&&p.push(r.section),r.entries.forEach((l,a)=>{if(l.type==="item"){n[a]&&p.push(l);return}if(l.type!=="separator")return;let c=n.slice(0,a).some(Boolean),d=n.slice(a+1).some(Boolean);c&&d&&p.push(l)}),p.map(({option:l,index:a})=>({option:l,index:a}))}):e.map((r,i)=>({option:r,index:i}))},_c=(e={},t,s,r,i)=>{let n=Hs(e),o=n==="section",p=n==="separator",l=n==="item";if(o)return{...e,index:t,type:n,isSection:o,isSeparator:p,isItem:l};if(p)return{...e,index:t,type:n,isSection:o,isSeparator:p,isItem:l};let a=le(e.value,s),c=r===t,d=Xi(e),h=en(e);return{...e,index:t,type:n,isSection:o,isSeparator:p,isItem:l,isSelected:a,bgc:c?"ac":a?"mu":"",hasIconSlot:i,icon:d,hasIcon:d.length>0,iconColor:"fg",c:"fg",suffixText:h,hasSuffixText:h.length>0,suffixTextColor:"mu-fg"}},xc=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,hoveredOptionId:null,hoveredAddOption:!1,searchQuery:""}),Sc=({state:e,props:t})=>{let s=gc(t),r=!!t.disabled,i=Object.prototype.hasOwnProperty.call(t||{},"selectedValue")?t.selectedValue:e.selectedValue,n=t.placeholder||"Select an option",o=!0,p=t.options||[],l=p.find(S=>Jr(S)&&le(S.value,i));l&&(n=l.label,o=!1);let a=p.some(S=>Jr(S)&&bc(S,"icon")),c=wc(p,t.searchable?e.searchQuery:""),d=new Set(c.map(({index:S})=>S)),h=p.map((S,A)=>({..._c(S,A,i,e.hoveredOptionId,a),isSearchHidden:!d.has(A)})),f=h.filter(S=>!S.isSearchHidden),u=Xi(l),y=en(l),m=t.searchable?e.searchQuery:"",b=tn(m).length>0,g=f.some(S=>S.isItem),_=!!t.searchable&&b&&!g;return{containerAttrString:s,isDisabled:r,isOpen:e.isOpen,position:e.position,options:f,renderOptions:h,selectedValue:i,selectedLabel:n,selectedLabelColor:o?"mu-fg":"fg",selectedIcon:u,hasSelectedIcon:u.length>0,selectedIconColor:o?"mu-fg":"fg",selectedSuffixText:y,hasSelectedSuffixText:y.length>0,selectedSuffixTextColor:"mu-fg",selectButtonCursor:r?"not-allowed":"pointer",selectButtonHoverBorderColor:r?"bo":"ac",selectButtonTabIndex:r?-1:0,hasValue:i!=null,showClear:!r&&!t.noClear&&i!=null,showAddOption:!r&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"ac":"",showSearch:!r&&!!t.searchable,searchQuery:m,searchPlaceholder:t.searchPlaceholder||"Search options",showEmptySearch:_,hideEmptySearch:!_,emptySearchLabel:t.emptySearchLabel||"No matching options"}},Ac=({state:e})=>e,kc=({state:e})=>e.selectedValue,Ec=({state:e},t={})=>{let{position:s,selectedIndex:r}=t;e.position=s,e.isOpen=!0,e.searchQuery="",r!=null&&(e.hoveredOptionId=r)},$c=({state:e})=>{e.isOpen=!1,e.searchQuery=""},Cc=({state:e},t={})=>{e.selectedValue=t.value,e.isOpen=!1,e.searchQuery=""},Ic=({state:e})=>{e.selectedValue=void 0},Oc=({state:e},t={})=>{e.hoveredOptionId=t.optionId},Tc=({state:e})=>{e.hoveredOptionId=null},Lc=({state:e})=>{e.selectedValue=void 0},Vc=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},Rc=({state:e},t={})=>{e.searchQuery=t.query===void 0||t.query===null?"":String(t.query),e.hoveredOptionId=null},Nc=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:Tc,clearSelectedValue:Lc,closeOptionsPopover:$c,createInitialState:xc,openOptionsPopover:Ec,resetSelection:Ic,selectSelectedValue:kc,selectState:Ac,selectViewData:Sc,setHoveredAddOption:Vc,setHoveredOption:Oc,setSearchQuery:Rc,updateSelectedValue:Cc},Symbol.toStringTag,{value:"Module"})),Zr=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},Pc=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?Zr(e.tooltip):Zr(e.showCompactTooltip),Dc=(e,t)=>{let{store:s,dispatchEvent:r}=e,i=t._event,n,o=s.selectHeader();i.currentTarget.id==="headerLabel"?n=o.labelPath:i.currentTarget.id==="headerImage"?n=o.image.path:i.currentTarget.id==="header"&&(n=o.path),r(new CustomEvent("header-click",{detail:{path:n},bubbles:!0,composed:!0}))},jc=(e,t)=>{let{store:s,dispatchEvent:r,render:i}=e,n=t._event,o=n.currentTarget.dataset.itemId||n.currentTarget.id.slice(4),p=s.selectItem(o);s.hideTooltip({}),i(),r(new CustomEvent("item-click",{detail:{item:p},bubbles:!0,composed:!0}))},Bc=(e,t)=>{let{props:s,store:r,render:i}=e;if(!Pc(s)||(s.mode||"full")==="full")return;let n=t._event,o=n.currentTarget.dataset.itemId||n.currentTarget.id.slice(4),p=r.selectItem(o);if(!p||p.type==="groupLabel")return;let l=n.currentTarget.getBoundingClientRect(),a=p.tooltip||p.label||p.title;a&&(r.showTooltip({x:l.right,y:l.top+l.height/2,place:"r",content:a}),i())},zc=e=>{let{store:t,render:s}=e;t.hideTooltip({}),s()},Wc=Object.freeze(Object.defineProperty({__proto__:null,handleHeaderClick:Dc,handleItemClick:jc,handleItemMouseEnter:Bc,handleItemMouseLeave:zc},Symbol.toStringTag,{value:"Module"})),Mc=()=>Object.freeze({tooltipState:{open:!1,x:0,y:0,place:"r",content:""}}),Fc=["id","class","style","slot","header","items","selectedItemId","mode","hideHeader","tooltip","showCompactTooltip","w","bwr"],Kc=(e={})=>Object.entries(e).filter(([t])=>!Fc.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),st=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}}}},xs=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},Uc=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?xs(e.tooltip):xs(e.showCompactTooltip),Hc=(e,t)=>e!=null&&e!==""?e:t==="full"?272:64,Xr=(e={})=>e.label!==void 0&&e.label!==null?e.label:e.title!==void 0&&e.title!==null?e.title:"";function qs(e,t=null){let s=[];for(let r of e){let i=r.id||r.href||r.path,n=i!=null&&t===i,o=Xr(r);if(s.push({id:i,label:o,title:r.title??o,href:r.href,type:r.type||"item",icon:r.icon,testId:r.testId,tooltip:r.tooltip,path:r.path,hrefAttr:r.href?`href=${r.href}`:"",isSelected:n,itemBgc:n?"ac":"bg",itemHoverBgc:n?"ac":"mu"}),r.items&&Array.isArray(r.items))for(let p of r.items){let l=p.id||p.href||p.path,a=l!=null&&t===l,c=Xr(p);s.push({id:l,label:c,title:p.title??c,href:p.href,type:p.type||"item",icon:p.icon,testId:p.testId,tooltip:p.tooltip,path:p.path,hrefAttr:p.href?`href=${p.href}`:"",isSelected:a,itemBgc:a?"ac":"bg",itemHoverBgc:a?"ac":"mu"})}}return s}var qc=({state:e,props:t})=>{let s=st(t.header)||t.header,r=st(t.items)||t.items,i=t.selectedItemId,n=Kc(t),o=t.mode||"full",p=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},l=r?qs(r,i):[],a=!xs(t.hideHeader),c=Uc(t),d=t.bwr||"xs",h=Hc(t.w,o),f=o==="full"?"fs":"c",u=o==="full"?"fs":"c",y=o==="full"?"lg":"sm",m=o==="full"?"md":"sm",b=o==="shrunk-lg"?48:40,g=o==="shrunk-lg"?28:20,_=o==="shrunk-lg"?"md":"sm",S=o==="full",A=o==="full",k=c&&!S,C=o==="full"?"fs":"c",I=o==="full"?"":`ah=${u}`,V=o==="full"?"f":b;return{containerAttrString:n,mode:o,header:p,items:l,sidebarWidth:h,headerAlign:f,itemAlign:u,headerPadding:y,itemPadding:m,itemHeight:b,iconSize:g,firstLetterSize:_,showLabels:S,showGroupLabels:A,itemContentAlign:C,itemAlignAttr:I,itemWidth:V,headerWidth:V,selectedItemId:i,ah:o==="shrunk-lg"||o==="shrunk-md"?"c":"",listAttrString:o==="full"?"d=v sv":"d=v sv hsb",showHeader:a,enableCompactTooltip:k,rightBorderWidth:d,tooltipState:e.tooltipState||{open:!1,x:0,y:0,place:"r",content:""}}},Yc=({props:e})=>st(e.header)||e.header,Gc=({state:e,props:t})=>{let s=st(t.items)||t.items;return(s?qs(s):[]).find(r=>r.active)},Jc=({props:e},t)=>{let s=st(e.items)||e.items;return(s?qs(s):[]).find(r=>r.id===t)},Qc=({state:e})=>{},Zc=({state:e},t={})=>{let{x:s,y:r,place:i="r",content:n=""}=t;e.tooltipState={open:!0,x:s,y:r,place:i,content:n}},Xc=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},eu=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Mc,hideTooltip:Xc,selectActiveItem:Gc,selectHeader:Yc,selectItem:Jc,selectViewData:qc,setState:Qc,showTooltip:Zc},Symbol.toStringTag,{value:"Module"})),tu=e=>{let{store:t,props:s}=e;t.setValue({value:s.value??0})},su=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n}=e,o=s?.key!==r?.key,p=s?.value!==r?.value;if(o||p){let l=r?.value??0;i.setValue({value:l}),n()}},ru=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=t._event,o=Number(n.detail.value),p=(typeof n.composedPath=="function"?n.composedPath():[]).find(l=>l?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;s.setValue({value:o}),p&&typeof p.setAttribute=="function"&&p.setAttribute("value",String(o)),r(),i(new CustomEvent("value-change",{detail:{value:o},bubbles:!0}))},iu=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=t._event,o=Number(n.detail.value),p=(typeof n.composedPath=="function"?n.composedPath():[]).find(l=>l?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;s.setValue({value:o}),p&&typeof p.setAttribute=="function"&&p.setAttribute("value",String(o)),r(),i(new CustomEvent("value-input",{detail:{value:o},bubbles:!0}))},nu=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:tu,handleOnUpdate:su,handleValueChange:ru,handleValueInput:iu},Symbol.toStringTag,{value:"Module"})),ou=()=>Object.freeze({value:0}),au=({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}),lu=({state:e},t={})=>{e.value=t.value},pu=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:ou,selectViewData:au,setValue:lu},Symbol.toStringTag,{value:"Module"})),du=e=>{},cu=(e,t)=>{let{dispatchEvent:s,props:r}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(3),10),o=r.data?.rows?.[n];o&&s(new CustomEvent("row-click",{detail:{rowIndex:n,rowData:o}}))},uu=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=t._event.currentTarget.dataset.columnKey,o=s.selectSortInfo(),p="asc";o.column===n&&(o.direction==="asc"?p="desc":o.direction==="desc"&&(p=null)),p?s.setSortColumn({column:n,direction:p}):s.clearSort(),r(),i(new CustomEvent("header-click",{detail:{column:n,direction:p,sortInfo:p?{column:n,direction:p}:null}}))},hu=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:du,handleHeaderClick:uu,handleRowClick:cu},Symbol.toStringTag,{value:"Module"})),fu=()=>Object.freeze({sortColumn:null,sortDirection:null}),yu=["id","class","style","slot","data"],mu=(e={})=>Object.entries(e).filter(([t])=>!yu.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),gu=(e,t)=>{let s=t.split("."),r=e;for(let i of s){if(r==null)return null;r=r[i]}return r},bu=({state:e,props:t})=>{let s=mu(t),r=t.data||{columns:[],rows:[]},i=r.rows.map((n,o)=>{let p=r.columns.map(l=>{let a=gu(n,l.key);return{key:l.key,value:a!=null?String(a):""}});return{index:o,cells:p}});return{containerAttrString:s,columns:r.columns||[],rows:i||[]}},vu=({state:e})=>e,wu=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),_u=({state:e},{column:t,direction:s}={})=>{e.sortColumn=t,e.sortDirection=s},xu=({state:e})=>{e.sortColumn=null,e.sortDirection=null},Su=Object.freeze(Object.defineProperty({__proto__:null,clearSort:xu,createInitialState:fu,selectSortInfo:wu,selectState:vu,selectViewData:bu,setSortColumn:_u},Symbol.toStringTag,{value:"Module"})),Au=(e,t)=>{let{dispatchEvent:s}=e,r=t._event.currentTarget.dataset.id;s(new CustomEvent("item-click",{detail:{id:r}}))},ku=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:Au},Symbol.toStringTag,{value:"Module"})),Eu=()=>Object.freeze({}),$u=["id","class","style","slot","items","selectedTab"],Cu=(e={})=>Object.entries(e).filter(([t])=>!$u.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Iu=({props:e})=>{let t=Cu(e),s=e.items||[],r=e.selectedTab,i=s.map(n=>({...n,isSelected:n.id===r,bgColor:n.id===r?"ac":"",borderColor:n.id===r?"":"tr",textColor:n.id===r?"":"mu-fg"}));return{containerAttrString:t,items:i,selectedTab:r}},Ou=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Eu,selectViewData:Iu},Symbol.toStringTag,{value:"Module"})),Tu=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",sn=e=>Array.isArray(e)?[...e]:[],rn=e=>{if(!e||typeof e.getBoundingClientRect!="function")return;let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.bottom+12),w:Math.max(Math.round(t.width),240)}},Ss=({store:e,props:t})=>e.selectHasSelectedValues()?e.selectSelectedValues():sn(t.selectedValues),nn=({store:e,props:t})=>Array.isArray(t?.draftSelectedValues)?sn(t.draftSelectedValues):e.getState().isOpen?e.selectDraftSelectedValues():Ss({store:e,props:t}),Lu=({dispatchEvent:e,value:t,operation:s,changedValue:r,label:i,index:n,item:o})=>{e(new CustomEvent("value-change",{detail:{value:t,operation:s,changedValue:r,label:i,index:n,item:o},bubbles:!0}))},Vu=({dispatchEvent:e,value:t})=>{e(new CustomEvent("draft-value-change",{detail:{value:t},bubbles:!0}))},ze=({dispatchEvent:e,open:t})=>{e(new CustomEvent("open-change",{detail:{open:t},bubbles:!0}))},Ys=({store:e,props:t,refs:s}={})=>{let r=rn(s?.trigger);return r?(e.openOptionsPopover({position:r,values:nn({store:e,props:t})}),!0):!1},Ru=e=>{let{store:t,props:s,render:r,refs:i}=e,n=!1;s.selectedValues!==void 0&&(t.updateSelectedValues({values:s.selectedValues,syncDraft:s.draftSelectedValues===void 0,preserveDraft:Array.isArray(s.draftSelectedValues)}),n=!0),Array.isArray(s.draftSelectedValues)&&(t.updateDraftSelectedValues({values:s.draftSelectedValues}),n=!0),s.open===!0&&!s.disabled&&Ys(e)&&(n=!0),n&&r()},Nu=e=>{let{props:t,render:s,store:r,dispatchEvent:i}=e;if(t.disabled){t.open===!0&&ze({dispatchEvent:i,open:!1});return}t.open===!0&&!r.getState().isOpen&&Ys(e)&&s()},Pu=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n,refs:o}=e,p=!1;if(r?.disabled&&!s?.disabled){let l=i.getState().isOpen;i.closeOptionsPopover({}),l&&ze({dispatchEvent:e.dispatchEvent,open:!1}),p=!0}if(s.selectedValues!==r.selectedValues&&(i.updateSelectedValues({values:r.selectedValues,syncDraft:r.draftSelectedValues===void 0,preserveDraft:Array.isArray(r.draftSelectedValues)}),p=!0),s.draftSelectedValues!==r.draftSelectedValues&&(i.updateDraftSelectedValues({values:Array.isArray(r?.draftSelectedValues)?r.draftSelectedValues:Ss({store:i,props:r})}),p=!0),s.open!==r.open&&r.open!==void 0&&(r.open?r.disabled?ze({dispatchEvent:e.dispatchEvent,open:!1}):Ys({store:i,props:r,refs:o})&&(p=!0):(i.closeOptionsPopover({}),p=!0)),s.options!==r.options){let l=Ss({store:i,props:r}).length>0;(i.getState().isOpen||l)&&(p=!0)}p&&n()},on=(e,t)=>{let{store:s,render:r,refs:i,props:n,dispatchEvent:o}=e;if(n.disabled)return;t._event.stopPropagation();let p=rn(i.trigger);p&&(s.openOptionsPopover({position:p,values:nn({store:s,props:n})}),ze({dispatchEvent:o,open:!0}),r())},Du=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),on(e,t))},ju=e=>{let{store:t,render:s,dispatchEvent:r}=e;t.closeOptionsPopover({}),ze({dispatchEvent:r,open:!1}),s()},an=(e,t)=>{let{render:s,props:r,store:i,dispatchEvent:n}=e;if(r.disabled)return;let o=t._event;o.stopPropagation();let p=o.currentTarget.id.slice(6),l=Number(p),a=r.options[l];!a||Tu(a)!=="item"||(i.toggleDraftSelectedValue({value:a.value}),Vu({dispatchEvent:n,value:i.selectDraftSelectedValues()}),s())},Bu=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),an(e,t))},zu=(e,t)=>{let{store:s,props:r,render:i,dispatchEvent:n}=e;if(r.disabled)return;t._event.stopPropagation();let o=s.selectDraftSelectedValues();s.commitDraftSelectedValues({}),r.onChange&&typeof r.onChange=="function"&&r.onChange(o),Lu({dispatchEvent:n,value:o,operation:"set",changedValue:void 0,label:void 0,index:null,item:void 0}),ze({dispatchEvent:n,open:!1}),i()},Wu=(e,t)=>{let{props:s,dispatchEvent:r}=e;s.disabled||s.noAdd||(t._event.stopPropagation(),r(new CustomEvent("add-option-click",{bubbles:!0,composed:!0})))},Mu=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:Wu,handleAfterMount:Nu,handleBeforeMount:Ru,handleOnUpdate:Pu,handleOptionClick:an,handleOptionKeyDown:Bu,handlePopoverClose:ju,handleSubmitClick:zu,handleTriggerClick:on,handleTriggerKeyDown:Du},Symbol.toStringTag,{value:"Module"})),ln=e=>{if(!e||typeof e.getBoundingClientRect!="function")return null;let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.bottom+12),w:Math.max(Math.round(t.width),240)}},Tt=e=>Array.isArray(e)?[...e]:[],xt=e=>{typeof e.render=="function"&&e.render()},pn=e=>e.store?.selectHasSelectedValues?.()?e.store?.selectSelectedValues?.()||[]:Tt(e.props?.selectedValues),Gs=(e,t=[])=>{let s=ln(e.refs?.trigger);return!s||!e.store?.openOptionsPopover?!1:(e.store.openOptionsPopover({position:s,values:t}),!0)},dn=(e,t=[],s=!1)=>e.store?.getState?.()?.isOpen&&e.store?.updateDraftSelectedValues?(e.store.updateDraftSelectedValues({values:t}),!0):s?Gs(e,t):!1,Fu=function(e={}){let t=this.store?.getState?.(),s=Array.isArray(e.values)?Tt(e.values):this.store?.selectDraftSelectedValues?.()||[];if(t?.isOpen){let r=ln(this.refs?.trigger);r&&this.store.openOptionsPopover({position:r,values:s})}else e.keepOpen&&Gs(this,s.length>0?s:pn(this));xt(this)},Ku=function(e={}){let t=Tt(e.values);dn(this,t,!!e.keepOpen)&&xt(this)},Uu=function(e={}){if(!Object.prototype.hasOwnProperty.call(e||{},"value"))return;let t=this.store?.getState?.(),s=t?.isOpen?this.store?.selectDraftSelectedValues?.()||[]:pn(this);if(s.some(i=>le(i,e.value))){e.keepOpen&&!t?.isOpen&&Gs(this,s)&&xt(this);return}let r=[...Tt(s),e.value];dn(this,r,!!e.keepOpen)&&xt(this)},Hu=Object.freeze(Object.defineProperty({__proto__:null,appendDraftSelectedValue:Uu,refreshPopover:Fu,setDraftSelectedValues:Ku},Symbol.toStringTag,{value:"Module"})),qu=["id","class","style","slot","placeholder","options","open","selectedValues","draftSelectedValues","onChange","addOption","noAdd","disabled"],Yu=(e={})=>Object.entries(e).filter(([t])=>!qu.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Gu=(e,t)=>Object.prototype.hasOwnProperty.call(e||{},t),cn=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",un=(e={})=>cn(e)==="item",hn=(e={})=>typeof e.icon=="string"&&e.icon.length>0?e.icon:"",Ju=(e={})=>typeof e.shortcut=="string"&&e.shortcut.length>0?e.shortcut:typeof e.suffixText=="string"&&e.suffixText.length>0?e.suffixText:"",ye=e=>Array.isArray(e)?[...e]:[],Qu=(e=[],t=[])=>e.length!==t.length?!1:e.every((s,r)=>le(s,t[r])),Zu=(e=[],t)=>e.some(s=>le(s,t)),fn=({state:e,props:t})=>e.hasSelectedValues?ye(e.selectedValues):ye(t.selectedValues),Xu=({state:e,props:t})=>e.isOpen?ye(e.draftSelectedValues):fn({state:e,props:t}),eh=e=>e==null?"":String(e),th=(e=[],t)=>e.find(s=>un(s)&&le(s.value,t)),As=({isSelected:e=!0,isAddChip:t=!1}={})=>{let s=["--tag-border-radius: var(--border-radius-md)","--muted-foreground: var(--foreground)"];return(t||!e)&&s.push("--muted: color-mix(in srgb, var(--muted) 82%, var(--background) 18%)"),`${s.join("; ")};`},sh=({option:e={},index:t,selectedValues:s=[],hasIconColumn:r=!1})=>{let i=cn(e),n=i==="section",o=i==="separator",p=i==="item";if(n||o)return{...e,index:t,type:i,isSection:n,isSeparator:o,isItem:p};let l=Zu(s,e.value),a=hn(e),c=Ju(e),d=l?c||"Added":c;return{...e,index:t,type:i,isSection:n,isSeparator:o,isItem:p,isSelected:l,hasIconSlot:r,icon:a,hasIcon:a.length>0,cursor:"pointer",tagStyle:As({isSelected:l}),suffixText:d,hasSuffixText:d.length>0}},rh=()=>Object.freeze({isOpen:!1,position:{x:0,y:0,w:240},selectedValues:[],draftSelectedValues:[],hasSelectedValues:!1}),ih=({state:e,props:t})=>{let s=Yu(t),r=!!t.disabled,i=fn({state:e,props:t}),n=Xu({state:e,props:t}),o=(e.isOpen||i.length>0)&&Array.isArray(t.options)?t.options:[],p=o.some(f=>un(f)&&Gu(f,"icon")),l=o.map((f,u)=>sh({option:f,index:u,selectedValues:n,hasIconColumn:p})),a=i.map((f,u)=>{let y=th(o,f),m=y?hn(y):"";return{value:f,selectionIndex:u,label:y?.label||eh(f),icon:m,hasIcon:m.length>0,testId:`tag-select-tag-${u}`}}),c=l.some(f=>f.isItem),d=!Qu(i,n),h=a.length>0?a.map(f=>({...f,tagStyle:As({isSelected:!0})})):[{value:void 0,selectionIndex:"",label:t.placeholder||"Add tag",icon:"",testId:"",tagStyle:As({isAddChip:!0})}];return{containerAttrString:s,isDisabled:r,isOpen:e.isOpen,position:e.position,options:l,hasSelectableOptions:c,placeholder:t.placeholder||"Add tag",triggerTags:h,triggerCursor:r?"not-allowed":"pointer",triggerTabIndex:r?-1:0,showAddOption:!r&&!t.noAdd,addOptionLabel:t.addOption?.label||"Add tag",hasDraftChanges:d,submitDisabled:r,submitLabel:"Save"}},nh=({state:e})=>ye(e.selectedValues),oh=({state:e})=>!!e.hasSelectedValues,ah=({state:e})=>ye(e.draftSelectedValues),lh=({state:e},t={})=>{let{position:s,values:r}=t;e.position={...e.position,...s||{}},e.draftSelectedValues=ye(r),e.isOpen=!0},ph=({state:e})=>{e.isOpen=!1,e.draftSelectedValues=[]},dh=({state:e},t={})=>{e.draftSelectedValues=ye(t.values)},ch=({state:e},t={})=>{let s=ye(t.values);e.selectedValues=s,e.hasSelectedValues=!0,(t.syncDraft||!e.isOpen)&&!t.preserveDraft&&(e.draftSelectedValues=[...s])},uh=({state:e},t={})=>{let s=ye(e.draftSelectedValues),r=t.value,i=s.findIndex(n=>le(n,r));if(i>=0){e.draftSelectedValues=s.filter((n,o)=>o!==i);return}e.draftSelectedValues=[...s,r]},hh=({state:e})=>{e.selectedValues=ye(e.draftSelectedValues),e.hasSelectedValues=!0,e.isOpen=!1,e.draftSelectedValues=[]},fh=Object.freeze(Object.defineProperty({__proto__:null,closeOptionsPopover:ph,commitDraftSelectedValues:hh,createInitialState:rh,openOptionsPopover:lh,selectDraftSelectedValues:ah,selectHasSelectedValues:oh,selectSelectedValues:nh,selectViewData:ih,toggleDraftSelectedValue:uh,updateDraftSelectedValues:dh,updateSelectedValues:ch},Symbol.toStringTag,{value:"Module"})),yh=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),mh=()=>Object.freeze({}),ei={sm:{textSize:"sm",padding:"md",maxWidth:"min(320px, calc(100vw - 16px))"},md:{textSize:"sm",padding:"md",maxWidth:"min(360px, calc(100vw - 16px))"},lg:{textSize:"md",padding:"lg",maxWidth:"min(420px, calc(100vw - 16px))"}},gh=({props:e})=>{let t=ei[e.s]?e.s:"sm",s=ei[t];return{open:!!e.open,x:e.x||0,y:e.y||0,place:e.place||"t",content:e.content||"",textSize:s.textSize,padding:s.padding,contentStyle:`padding: 0; min-width: 0; max-width: ${s.maxWidth};`}},bh=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:mh,selectViewData:gh},Symbol.toStringTag,{value:"Module"})),vh=async e=>{let{props:t,store:s,render:r,refs:i}=e,{waveformData:n}=t;s.setWaveformData({data:n}),r();let o=i.canvas;o&&yn(n,o)},wh=async(e,t)=>{let{store:s,render:r,refs:i,props:n}=e,{waveformData:o}=n;if(!o){console.log("waveform handleOnUpdate: no waveformData provided");return}s.setWaveformData({data:o}),r();let p=i.canvas;p&&yn(o,p)};async function yn(e,t){let s=t.getContext("2d"),r=t.getBoundingClientRect(),i=r.width,n=r.height;t.width=i,t.height=n;let o=t.width,p=t.height;if(s.clearRect(0,0,o,p),s.fillStyle="#1a1a1a",s.fillRect(0,0,o,p),!e||!e.amplitudes)return;let l=e.amplitudes,a=p/2,c=s.createLinearGradient(0,0,0,p);c.addColorStop(0,"#404040"),c.addColorStop(.5,"#A1A1A1"),c.addColorStop(1,"#404040");let d=Math.max(1,o/l.length),h=.2;for(let f=0;f<l.length;f++){let u=l[f]/255*(p*.85),y=f*d,m=a-u/2;s.fillStyle=c,s.fillRect(y,m,Math.max(1,d*(1-h)),u)}s.strokeStyle="rgba(255, 255, 255, 0.1)",s.lineWidth=1,s.beginPath(),s.moveTo(0,a),s.lineTo(o,a),s.stroke(),s.shadowBlur=10,s.shadowColor="#2196F3"}var _h=Object.freeze(Object.defineProperty({__proto__:null,handleAfterMount:vh,handleOnUpdate:wh},Symbol.toStringTag,{value:"Module"})),xh=()=>Object.freeze({waveformData:null}),Sh=({state:e},t={})=>{e.waveformData=t.data},Ah=({state:e,props:t})=>({isLoading:t.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:t.waveformData}),kh=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:xh,selectViewData:Ah,setWaveformData:Sh},Symbol.toStringTag,{value:"Module"})),mn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),gn=e=>e.replace(/-([a-z0-9])/g,(t,s)=>s.toUpperCase()),ks=e=>{if(e!=null)return e===""?!0:e},St=(e,t)=>{let s=e.getAttribute(t);if(s!==null)return ks(s);let r=mn(t);if(r!==t){let i=e.getAttribute(r);if(i!==null)return ks(i)}},hs=Symbol("rtglReactivePropValues"),fs=Symbol("rtglNativeHostStyle"),Eh=(e,t)=>{let s=Object.getPrototypeOf(e);for(;s;){let r=Object.getOwnPropertyDescriptor(s,t);if(r)return r;s=Object.getPrototypeOf(s)}},bn=e=>{if(!e||typeof e!="object")return;if(Object.prototype.hasOwnProperty.call(e,fs))return e[fs];let t=Eh(e,"style"),s;return typeof t?.get=="function"?s=t.get.call(e):e.style&&typeof e.style=="object"&&(s=e.style),s&&typeof s=="object"&&Object.defineProperty(e,fs,{value:s,enumerable:!1,configurable:!1,writable:!1}),s},$h=e=>(Object.prototype.hasOwnProperty.call(e,hs)||Object.defineProperty(e,hs,{value:Object.create(null),enumerable:!1,configurable:!1,writable:!1}),e[hs]),Ch=({source:e,allowedKeys:t=[],onPropChange:s})=>{let r=$h(e);t.includes("style")&&bn(e),t.forEach(i=>{if(typeof i!="string"||i.length===0)return;let n=Object.prototype.hasOwnProperty.call(e,i)?e[i]:void 0,o=Object.prototype.hasOwnProperty.call(e,i);o&&delete e[i],Object.defineProperty(e,i,{configurable:!0,enumerable:!0,get(){return Object.prototype.hasOwnProperty.call(r,i)?r[i]:St(e,i)},set(p){let l=Object.prototype.hasOwnProperty.call(r,i)?r[i]:St(e,i);p===void 0?delete r[i]:r[i]=p,l!==p&&s?.({propName:i,oldValue:l,newValue:p})}}),o&&(r[i]=n)})},Ih=(e,t)=>{let s=new Set(t);return new Proxy({},{get(r,i){if(typeof i=="string"&&s.has(i)){let n=e[i];return n!==void 0?n:St(e,i)}},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(r,i){return typeof i=="string"&&s.has(i)},ownKeys(){return[...s]},getOwnPropertyDescriptor(r,i){if(typeof i=="string"&&s.has(i))return{configurable:!0,enumerable:!0,get:()=>{let n=e[i];return n!==void 0?n:St(e,i)}}}})},Oh=({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 s=e.methods;if(!s||typeof s!="object"||Array.isArray(s))throw new Error("methods must be an object schema with a properties map.");if(Object.prototype.hasOwnProperty.call(s,"type")&&s.type!=="object")throw new Error("methods.type must be 'object'.");if(!s.properties||typeof s.properties!="object"||Array.isArray(s.properties))throw new Error("methods.properties must be an object keyed by method name.");for(let r of Object.keys(s.properties))if(!t.includes(r))throw new Error(`method '${r}' is declared in schema but missing in .methods.js exports.`)}return!0},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},j={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},Es={NOT:0},E=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},re=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}},ti=e=>{if(!e||e.trim()==="")throw new E("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let s=e.includes("===")?"==":"!=";throw new E(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${s}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let s of t)if(e.trim().endsWith(s))throw new E(`Incomplete comparison expression - missing right operand (got: '${e}')`)},Th=e=>{if(e.trim().endsWith(" in"))throw new E(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new E(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,s]=e.split(" in ");if(!s||s.trim()==="")throw new E(`Missing iterable expression after 'in' (got: '$for ${e}')`);let r=t.includes(",")?t.split(",").map(i=>i.trim()):[t.trim()];for(let i of r){if(!i)throw new E(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(i))throw new E(`Invalid loop syntax (got: '$for ${e}')`)}},Lh=(e,t,s=!1)=>{if(t===null)return new re(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new re(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return s?new re(`Cannot iterate over non-array value in loop '${e}' - got ${r} instead`):new re(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},Vh=(e,t)=>{let s=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new re(`Unknown function '${e}' (${s})`)},vn=(e,t,s={})=>{let r={},i={};s&&typeof s=="object"&&(s.functions!==void 0||s.partials!==void 0?(r=s.functions||{},i=s.partials||{}):typeof s=="object"&&(r=s));let n=N(e,{functions:r,partials:i},t,{});return n===void 0?{}:n},N=(e,t,s,r)=>{if(t.functions,e.var&&!e.type)return H(e.var,s,r);if(e.type===v.LITERAL)return e.value;if(e.type===v.VARIABLE)return H(e.path,s,r);if(e.type===v.INTERPOLATION)return Nh(e.parts,t,s,r);switch(e.type){case v.FUNCTION:return wn(e,t,s,r);case v.BINARY:return _n(e,t,s,r);case v.UNARY:return xn(e,t,s,r);case v.CONDITIONAL:return Dh(e,t,s,r);case v.LOOP:return Mh(e,t,s,r);case v.OBJECT:return Kh(e,t,s,r);case v.ARRAY:return Uh(e,t,s,r);case v.PARTIAL:return Hh(e,t,s,r);case v.PATH_REFERENCE:return qh(e,t,s,r);default:throw new Error(`Unknown node type: ${e.type}`)}},si=new Map,Rh=e=>{let t=[],s="",r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(n==="[")s&&(t.push({type:"property",value:s}),s=""),r=!0;else if(n==="]"){if(r&&s){let o=s.trim();if(/^\d+$/.test(o))t.push({type:"index",value:parseInt(o,10)});else if(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'")){let p=o.slice(1,-1);t.push({type:"property",value:p})}else t.push({type:"property",value:o});s=""}r=!1}else s+=n}return s&&t.push({type:"property",value:s}),t},H=(e,t,s)=>{if(!e)return;if(e in s)return s[e];let r=si.get(e);if(!r){let n=[],o="",p=0;for(let l=0;l<e.length;l++){let a=e[l];a==="["?(p++,o+=a):a==="]"?(p--,o+=a):a==="."&&p===0?o&&(n.push(o),o=""):o+=a}o&&n.push(o),r=[];for(let l of n){let a=Rh(l.trim());r.push(...a)}si.set(e,r)}let i=t;for(let n=0;n<r.length;n++){let o=r[n];if(o.type==="property"&&o.value in s){i=s[o.value];continue}if(i==null)return;(o.type==="property"||o.type==="index")&&(i=i[o.value])}return i},Nh=(e,t,s,r)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let o=N(n,t,s,r);i.push(o!=null?String(o):"")}return i.join("")},wn=(e,t,s,r)=>{let i=t.functions||t,n=i[e.name];if(!n)throw Vh(e.name,i);let o=e.args.map(p=>N(p,t,s,r));return n(...o)},We=(e,t,s,r)=>{if(e.var&&!e.type)return H(e.var,s,r);switch(e.type){case v.VARIABLE:return H(e.path,s,r);case v.LITERAL:return e.value;case v.BINARY:return _n(e,t,s,r);case v.UNARY:return xn(e,t,s,r);case v.FUNCTION:return wn(e,t,s,r);default:return N(e,t,s,r)}},_n=(e,t,s,r)=>{if(e.op===j.AND||e.op===j.OR){let o=We(e.left,t,s,r),p=We(e.right,t,s,r);switch(e.op){case j.AND:return o&&p;case j.OR:return o||p}}let i=N(e.left,t,s,r),n=N(e.right,t,s,r);switch(e.op){case j.EQ:return i==n;case j.NEQ:return i!=n;case j.GT:return i>n;case j.LT:return i<n;case j.GTE:return i>=n;case j.LTE:return i<=n;case j.IN:return Array.isArray(n)?n.includes(i):!1;case j.ADD:if(typeof i!="number"||typeof n!="number")throw new re(`Arithmetic operations require numbers. Got ${typeof i} + ${typeof n}`);return i+n;case j.SUBTRACT:if(typeof i!="number"||typeof n!="number")throw new re(`Arithmetic operations require numbers. Got ${typeof i} - ${typeof n}`);return i-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},xn=(e,t,s,r)=>{let i=e.op===Es.NOT?We(e.operand,t,s,r):N(e.operand,t,s,r);switch(e.op){case Es.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Ph=(e,t,s,r)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===v.VARIABLE)if(H(i.path,s,r)){let n=e.bodies[0];if(n.type===v.OBJECT&&n.properties.length<=5){let o={};for(let p of n.properties){let l=p.parsedKey?N(p.parsedKey,t,s,r):p.key,a=p.value;if(a.type===v.LITERAL)o[l]=a.value;else if(a.type===v.VARIABLE)o[l]=H(a.path,s,r);else if(a.type===v.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let h=H(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=N(d,t,s,r);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=N(a,t,s,r)}return o}}else{let n=e.bodies[1];if(n.type===v.OBJECT&&n.properties.length<=5){let o={};for(let p of n.properties){let l=p.parsedKey?N(p.parsedKey,t,s,r):p.key,a=p.value;if(a.type===v.LITERAL)o[l]=a.value;else if(a.type===v.VARIABLE)o[l]=H(a.path,s,r);else if(a.type===v.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let h=H(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=N(d,t,s,r);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=N(a,t,s,r)}return o}}}return null},Dh=(e,t,s,r)=>{let i=Ph(e,t,s,r);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||We(o,t,s,r))return N(e.bodies[n],t,s,r)}return Sn},jh=(e,t)=>{let s=e.body,r=e.itemVar;if(s.type===v.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===v.VARIABLE){let i=s.conditions[0].path,n=s.bodies[0];if(i.startsWith(r+".")){let o=i.substring(r.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 a=t[l];if(a[o]){let c={};for(let d of n.properties){let h=d.key,f=d.value;if(f.type===v.LITERAL)c[h]=f.value;else if(f.type===v.VARIABLE){let u=f.path;if(u===r)c[h]=a;else if(u.startsWith(r+".")){let y=u.substring(r.length+1);c[h]=a[y]}else return null}else if(f.type===v.INTERPOLATION){let u=[],y=!0;for(let m of f.parts)if(typeof m=="string")u.push(m);else if(m.type===v.VARIABLE){let b=m.path;if(b===r)u.push(a!=null?String(a):"");else if(b.startsWith(r+".")){let g=b.substring(r.length+1),_=a[g];u.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[h]=u.join("")}else return null}p.push(c)}}return p}}}return null},Bh=(e,t)=>{let s=e.body,r=e.itemVar,i=jh(e,t);if(i!==null)return i;if(s.type===v.OBJECT&&s.properties.length<=5&&!s.whenCondition){for(let p of s.properties)if(p.parsedKey)return null;let n=[],o=!0;for(let p of s.properties){let l=p.key,a=p.value;if(a.type===v.LITERAL)n.push({key:l,type:"literal",value:a.value});else if(a.type===v.VARIABLE){let c=a.path;if(c===r)n.push({key:l,type:"item"});else if(c.startsWith(r+".")){let d=c.substring(r.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:l,type:"prop",prop:d});else{o=!1;break}}else{o=!1;break}}else if(a.type===v.INTERPOLATION&&a.parts.length===1){let c=a.parts[0];if(c.type===v.VARIABLE){let d=c.path;if(d===r)n.push({key:l,type:"item_string"});else if(d.startsWith(r+".")){let h=d.substring(r.length+1);if(!h.includes(".")&&!h.includes("["))n.push({key:l,type:"prop_string",prop:h});else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}if(o){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 a=t[l];p[l]={id:a.id,title:a.title!=null?String(a.title):"",completed:a.completed}}else for(let l=0;l<t.length;l++){let a=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]=a;else if(d.type==="prop")c[d.key]=a[d.prop];else if(d.type==="item_string")c[d.key]=a!=null?String(a):"";else if(d.type==="prop_string"){let h=a[d.prop];c[d.key]=h!=null?String(h):""}p[l]=c}return p}}return null},zh=(e,t,s,r,i)=>{let n=[],o=e.body;if(o.type===v.OBJECT&&o.fast!==!1){let p=e.itemVar,l=e.indexVar;for(let a=0;a<i.length;a++){let c=i[a],d={},h={...r,[p]:c,...l&&{[l]:a}};h.__paths__||(h.__paths__=r.__paths__||{});let f=e.iterable.path||"";if(r&&r.__paths__&&f){let u=f.split("."),y=u[0];y in r.__paths__&&(f=r.__paths__[y],u.length>1&&(f+="."+u.slice(1).join(".")))}h.__paths__={...h.__paths__,[p]:`${f}[${a}]`,...l&&{[l]:a}};for(let u of o.properties){let y=u.parsedKey?N(u.parsedKey,t,s,h):u.key,m=u.value;if(m.type===v.LITERAL)d[y]=m.value;else if(m.type===v.VARIABLE){let b=m.path;if(b===p)d[y]=c;else if(b===l)d[y]=a;else if(b.startsWith(p+".")){let g=b.substring(p.length+1);!g.includes(".")&&!g.includes("[")?d[y]=c[g]:d[y]=H(b,s,{...r,[p]:c,...l&&{[l]:a}})}else d[y]=H(b,s,{...r,[p]:c,...l&&{[l]:a}})}else if(m.type===v.INTERPOLATION){let b=[];for(let g of m.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=a;else if(_.startsWith(p+".")){let A=_.substring(p.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=H(_,s,{...r,[p]:c,...l&&{[l]:a}})}else S=H(_,s,{...r,[p]:c,...l&&{[l]:a}});b.push(S!=null?String(S):"")}else{let _={...r,[p]:c,...l&&{[l]:a}},S=N(g,t,s,_);b.push(S!=null?String(S):"")}d[y]=b.join("")}else{let b={...r,[p]:c,...l&&{[l]:a}};d[y]=N(m,t,s,b)}}n.push(d)}return n}return null},Wh=(e,t,s)=>{let r=e.body;if(r.type===v.OBJECT&&r.properties.length===1&&r.properties[0].key==="$if item.visible"){let i=r.properties[0].value;if(i.type===v.CONDITIONAL&&i.conditions.length===1&&i.conditions[0].type===v.VARIABLE&&i.conditions[0].path==="item.visible"){let n=i.bodies[0];if(n.type===v.OBJECT&&n.properties.length===2){let o=n.properties[0],p=n.properties[1];if(o.key==="id"&&o.value.type===v.VARIABLE&&o.value.path==="item.id"&&p.key==="$if item.highlighted"&&p.value.type===v.CONDITIONAL){let l=[];for(let a=0;a<t.length;a++){let c=t[a];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},Mh=(e,t,s,r)=>{let i=N(e.iterable,t,s,r);if(!Array.isArray(i)){let a,c=!1;if(e.iterable.type===v.FUNCTION){c=!0;let h=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(", ");a=`${e.iterable.name}(${h})`}else a=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${a}`;throw Lh(d,i,c)}if(!e.indexVar){let a=Wh(e,i,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=Bh(e,i);if(a!==null)return a}let n=zh(e,t,s,r,i);if(n!==null)return n;let o=[],p=e.iterable.path||"";if(r&&r.__paths__&&p){let a=p.split("."),c=a[0];c in r.__paths__&&(p=r.__paths__[c],a.length>1&&(p+="."+a.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(a=>a.type===v.OBJECT&&a.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let a=0;a<i.length;a++){let c=e.indexVar?{...r,[e.itemVar]:i[a],[e.indexVar]:a}:{...r,[e.itemVar]:i[a]};c.__paths__||(c.__paths__=r.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${p}[${a}]`},e.indexVar&&(c.__paths__[e.indexVar]=a);let d=N(e.body,t,s,c);if(Array.isArray(d)&&d.length===1&&!l){let h=d[0];o.push(h===void 0?{}:h)}else o.push(d===void 0?{}:d)}return o},Fh=(e,t,s,r)=>{if(e.whenCondition)return null;if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?N(i.parsedKey,t,s,r):i.key,o=i.value;if(o.type===v.OBJECT&&o.properties.length<=10&&!o.whenCondition){let p={},l={},a=!0;for(let c of o.properties){let d=c.parsedKey?N(c.parsedKey,t,s,r):c.key,h=c.value;if(h.type===v.LITERAL)l[d]=h.value;else if(h.type===v.VARIABLE)l[d]=H(h.path,s,r);else if(h.type===v.INTERPOLATION){let f=[];for(let u of h.parts)if(typeof u=="string")f.push(u);else if(u.type===v.VARIABLE){let y=H(u.path,s,r);f.push(y!=null?String(y):"")}else{a=!1;break}if(!a)break;l[d]=f.join("")}else if(h.type===v.OBJECT&&h.properties.length<=5){let f={};for(let u of h.properties){let y=u.key,m=u.value;if(m.type===v.LITERAL)f[y]=m.value;else if(m.type===v.VARIABLE)f[y]=H(m.path,s,r);else if(m.type===v.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=H(g.path,s,r);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[y]=b.join("")}else{a=!1;break}}if(!a)break;l[d]=f}else{a=!1;break}}if(a)return p[n]=l,p}}return null},Kh=(e,t,s,r)=>{let i=t.functions||t;if(e.whenCondition&&!We(e.whenCondition,i,s,r))return;let n=Fh(e,t,s,r);if(n!==null)return n;if(e.fast){let l={};for(let a of e.properties){let c=a.parsedKey?N(a.parsedKey,t,s,r):a.key,d=a.value;if(d.type===v.LITERAL)l[c]=d.value;else if(d.type===v.VARIABLE)l[c]=H(d.path,s,r);else if(d.type===v.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===v.VARIABLE){let u=H(f.path,s,r);h.push(u!=null?String(u):"")}else{let u=N(f,t,s,r);h.push(u!=null?String(u):"")}l[c]=h.join("")}else l[c]=N(d,t,s,r)}return l}let o={},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 a=N(l.value,t,s,r);if(!p&&a!==null&&a!==void 0)return Array.isArray(a)&&a.length===1?a[0]:a;typeof a=="object"&&a!==null&&!Array.isArray(a)&&Object.assign(o,a)}else if(l.key.startsWith("$for ")){if(e.properties.length===1)return N(l.value,t,s,r)}else{let a=l.value;if(a&&a.type===v.OBJECT&&a.properties){let c=a.properties.find(d=>d.key.startsWith("$for "));if(c){let d=N(c.value,t,s,r);d!==void 0&&(o[l.key]=d)}else{let d=N(l.value,t,s,r);d!==void 0&&(o[l.key]=d)}}else{let c=l.parsedKey?N(l.parsedKey,t,s,r):l.key,d=N(l.value,t,s,r);d!==void 0&&(o[c]=d)}}return o},Sn={},Uh=(e,t,s,r)=>{let i=[];for(let n of e.items)if(n.type===v.LOOP){let o=N(n,t,s,r);Array.isArray(o)&&n.flatten!==!1?i.push(...o):i.push(o)}else{let o=N(n,t,s,r);o!==Sn&&o!==void 0&&i.push(o)}return i},Hh=(e,t,s,r)=>{let{name:i,data:n,whenCondition:o}=e,p=t.partials||{},l=t.functions||t;if(o&&!We(o,l,s,r))return;if(!p[i])throw new re(`Partial '${i}' is not defined`);let a=r._partialStack||[];if(a.includes(i))throw new re(`Circular partial reference detected: ${i}`);let c=p[i],d=s,h={...r,_partialStack:[...a,i]};if(r){d={...s};for(let f of Object.keys(r))f.startsWith("_")||(d[f]=r[f])}if(n){let f=N(n,t,s,r);d={...d,...f}}return N(c,t,d,h)},qh=(e,t,s,r)=>{let{path:i}=e,n=i.split("."),o=n[0],p=n.slice(1);if(!r||!(o in r))throw new re(`Path reference '#{${i}}' refers to '${o}' which is not a loop variable in the current scope`);if(r.__paths__||(r.__paths__={}),!(o in r.__paths__))throw new re(`Path reference '#{${i}}' cannot be resolved - path tracking may not be initialized properly`);let l=r.__paths__[o];if(typeof l=="number"){if(p.length>0)throw new re(`Path reference '#{${i}}' - cannot access properties on index variable '${o}'`);return String(l)}return p.length>0&&(l+="."+p.join(".")),l},Yh=/\$\{([^}]*)\}/g,Gh=/#\{([^}]*)\}/g,An=(e,t={})=>{let s=e.match(/^(\w+)\((.*)\)$/);if(!s)return{isFunction:!1};let[,r,i]=s,n=Jh(i,t);return{isFunction:!0,type:v.FUNCTION,name:r,args:n}},Jh=(e,t={})=>e.trim()?Qh(e).map(s=>Zh(s.trim(),t)):[],Qh=e=>{let t=[],s="",r=0,i=!1,n="";for(let o=0;o<e.length;o++){let p=e[o],l=o>0?e[o-1]:"";!i&&(p==='"'||p==="'")?(i=!0,n=p,s+=p):i&&p===n&&l!=="\\"?(i=!1,n="",s+=p):!i&&p==="("?(r++,s+=p):!i&&p===")"?(r--,s+=p):!i&&p===","&&r===0?(t.push(s),s=""):s+=p}return s&&t.push(s),t},Zh=(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 s=An(e,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};let r=e.trim(),i=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:o,type:p}of i){let l=0;for(;l<r.length;){let a=Ne(r.substring(l),o);if(a===-1)break;let c=l+a;c>n&&(n=c),l=c+o.length}}if(n!==-1)try{return X(r,t)}catch{return{type:v.VARIABLE,path:r}}return{type:v.VARIABLE,path:r}},kn=/^\w+\(.*\)$/,Xh=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,ef=e=>{if(!(!e||e.trim()===""||kn.test(e))&&Xh.test(e))throw e.includes("?")&&e.includes(":")?new E(`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 E(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new E(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},ri=e=>{let t=e.trim();if(kn.test(t))throw new E(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new E(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new E(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new E(`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 E(`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}},At=(e,t={})=>{let s=e.trim();ef(s);let r=An(s,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};if(s.includes("[")&&!/[\s+\-*/%|&?:]/.test(s)){let i=0;for(let n of s)n==="["?i++:n==="]"&&i--;if(i!==0)throw new Error("Invalid array index syntax")}return{type:v.VARIABLE,path:s}},En=(e,t={})=>{let s=e,r=[];(e.includes("\\${")||e.includes("\\#{"))&&(s=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),s=s.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),s=s.replace(/\\(\$\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\(#\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\DOUBLE_ESC_VAR/g,"\\"),s=s.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let i=[...s.matchAll(Yh)],n=[...s.matchAll(Gh)],o=[...i.map(a=>({match:a,type:"variable"})),...n.map(a=>({match:a,type:"pathref"}))].sort((a,c)=>a.match.index-c.match.index);if(o.length===0){let a=s;for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);return{type:v.LITERAL,value:a}}if(o.length===1&&o[0].match[0]===s&&r.length===0){let{match:a,type:c}=o[0];try{return c==="variable"?At(a[1],t):ri(a[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:v.LITERAL,value:s};throw d}}let p=[],l=0;for(let{match:a,type:c}of o){let[d,h]=a,f=a.index;if(f>l){let u=s.substring(l,f);for(let y=0;y<r.length;y++)u=u.replace(`__ESCAPED_${y}__`,r[y]);u&&p.push(u)}try{let u;c==="variable"?u=At(h.trim(),t):u=ri(h.trim()),p.push(u)}catch(u){if(u.message==="Invalid array index syntax")p.push(d);else throw u}l=f+d.length}if(l<s.length){let a=s.substring(l);for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);a&&p.push(a)}return{type:v.INTERPOLATION,parts:p}},Ce=(e,t)=>typeof e=="string"?En(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?sf(e,t):rf(e,t):{type:v.LITERAL,value:e},tf=e=>{let{$each:t,...s}=e;if(typeof t!="string")throw new E("$each value must be a non-empty string");let r=t.trim();if(r==="")throw new E("$each value must be a non-empty string");if(Object.keys(s).length===0)throw new E("Empty $each body not allowed");if(s.$partial!==void 0)throw new E("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${r}`]:s}},sf=(e,t)=>{let s=[],r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let l=tf(n),a=Object.keys(l);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let c=ii(a[0],l[a[0]],t,!0);s.push(c),r=!0;continue}}catch(l){throw l instanceof E?l:new E(l.message)}let p=Object.keys(n);if(p.length===1&&/^\$for(?::\w+)?\s/.test(p[0])){let l=ii(p[0],n[p[0]],t);s.push(l),r=!0;continue}}let o=Ce(n,t);s.push(o),(o.type===v.FUNCTION||o.type===v.CONDITIONAL||o.type===v.LOOP||o.type===v.PARTIAL||o.type===v.OBJECT&&!o.fast||o.type===v.ARRAY&&!o.fast)&&(r=!0)}return{type:v.ARRAY,items:s,fast:!r}},rf=(e,t)=>{let s=[],r=!1,i=null,n=Object.entries(e),o=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new E("$partial value must be a string");if(e.$partial.trim()==="")throw new E("$partial value cannot be an empty string");let l=["$if","$elif","$else","$for"],a=[];for(let[b]of n)for(let g of l)if(b===g||b.startsWith(g+" ")||b.startsWith(g+"#")){a.push(g);break}if(a.length>0)throw new E(`Cannot use $partial with ${a.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...h}=e,f={},u=!1;for(let[b,g]of Object.entries(h)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=g,u=!0}let y=null;if(u&&(y=Ce(f,t),y.type===v.OBJECT)){let b=!1;for(let g of y.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&&(y.fast=!1)}let m={type:v.PARTIAL,name:c,data:y};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new E("Empty condition expression after '$when'");b=X(d,t)}else b={type:v.LITERAL,value:d};m.whenCondition=b}return m}for(let[l,a]of n)if(l==="$when"){if(i!==null)throw new E("Multiple '$when' directives on the same object are not allowed");if(a==null)throw new E("Missing condition expression after '$when'");let c=typeof a=="string"?a:JSON.stringify(a);if(c.trim()==="")throw new E("Empty condition expression after '$when'");i=X(c,t),r=!0}else if(l.startsWith("$when#")||l.startsWith("$when "))throw new E("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;o<n.length;){let[l,a]=n[o];if(l==="$when"){o++;continue}if(l==="$each")throw new E("$each can only be used inside arrays");if(l.startsWith("$if ")||l.match(/^\$if#\w+\s/)||l.match(/^\$if\s+\w+.*:$/)){let c=nf(n,o,t);s.push({key:l,value:c.node}),r=!0,o=c.nextIndex}else if(/^\$for(?::\w+)?\s/.test(l)){let c=l.match(/^\$for(?::(\w+))?\s/)?.[1]||"",d=c?`:${c}`:"";throw new E(`$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 E(`'${l.split(" ")[0]}' without matching '$if'`);if(l==="$if"||l==="$if:")throw new E("Missing condition expression after '$if'");{let c=Ce(a,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)&&(r=!0);let d=En(l,t),h={key:l,value:c};(d.type!==v.LITERAL||d.value!==l)&&(h.parsedKey=d),s.push(h),o++}}}let p={type:v.OBJECT,properties:s,fast:!r};return i&&(p.whenCondition=i),p},nf=(e,t,s={})=>{let r=[],i=[],n=t,[o,p]=e[n],l=null,a;if(o.startsWith("$if#")){let d=o.match(/^\$if#(\w+)\s+(.+)$/);if(d)l=d[1],a=d[2];else throw new E(`Invalid conditional syntax: ${o}`)}else a=o.substring(4),a.endsWith(":")&&(a=a.slice(0,-1).trim());ti(a);let c=X(a,s);for(r.push(c),i.push(Ce(p,s)),n++;n<e.length;){let[d,h]=e[n],f=!1,u;if(l?d.startsWith(`$elif#${l} `)?(u=d.substring(`$elif#${l} `.length),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d===`$else#${l}`||d===`$else#${l}:`)&&(f=!0,u=null):d.startsWith("$elif ")?(u=d.substring(6),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,u=null),f){if(u===null)r.push(null);else{ti(u);let y=X(u,s);r.push(y)}if(i.push(Ce(h,s)),n++,u===null)break}else break}return{node:{type:v.CONDITIONAL,conditions:r,bodies:i,id:l},nextIndex:n}},X=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let a=e.slice(1,-1),c=0,d=!0;for(let h=0;h<a.length;h++)if(a[h]==="("?c++:a[h]===")"&&c--,c<0){d=!1;break}if(d&&c===0)return X(a,t)}let s=Ne(e,"||");if(s!==-1)return{type:v.BINARY,op:j.OR,left:X(e.substring(0,s).trim(),t),right:X(e.substring(s+2).trim(),t)};let r=Ne(e,"&&");if(r!==-1)return{type:v.BINARY,op:j.AND,left:X(e.substring(0,r).trim(),t),right:X(e.substring(r+2).trim(),t)};let i=[{op:">=",type:j.GTE},{op:"<=",type:j.LTE},{op:"==",type:j.EQ},{op:"!=",type:j.NEQ},{op:">",type:j.GT},{op:"<",type:j.LT},{op:" in ",type:j.IN}];for(let{op:a,type:c}of i){let d=Ne(e,a);if(d!==-1)return{type:v.BINARY,op:c,left:X(e.substring(0,d).trim(),t),right:X(e.substring(d+a.length).trim(),t)}}let n=-1,o=null,p=[{op:" + ",type:j.ADD},{op:" - ",type:j.SUBTRACT}];for(let{op:a,type:c}of p){let d=0;for(;d<e.length;){let h=Ne(e.substring(d),a);if(h===-1)break;let f=d+h;f>n&&(n=f,o={op:a,type:c}),d=f+a.length}}if(n!==-1&&o)return{type:v.BINARY,op:o.type,left:X(e.substring(0,n).trim(),t),right:X(e.substring(n+o.op.length).trim(),t)};let l=[" * "," / "," % "];for(let a of l)if(Ne(e,a)!==-1)throw new E(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:v.UNARY,op:Es.NOT,operand:X(e.substring(1).trim(),t)}:$n(e,t)},Ne=(e,t)=>{let s=0,r=0;for(;r<=e.length-t.length;){if(e[r]==="(")s++;else if(e[r]===")")s--;else if(s===0&&e.substring(r,r+t.length)===t)return r;r++}return-1},of=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}},$n=(e,t)=>{let s=e.trim();if(s.match(/^(\w+)\((.*)\)$/))return At(s,t);let r=of(s);if(r.type===v.LITERAL)return r;if(/^[a-zA-Z_$][\w.$]*$/.test(s))return{type:v.VARIABLE,path:s};try{return At(s,t)}catch(i){if(i.message&&i.message.includes("not supported"))return r;throw i}},af=(e,t=!1)=>{try{Th(e)}catch(s){if(s instanceof E&&t){let r=s.message.replace(/\$for/g,"$each");throw new E(r.replace("Parse Error: ",""))}throw s}},ii=(e,t,s,r=!1)=>{let i=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(i);if(!n){let m=r?"$each":"$for";throw new E(`Invalid loop syntax (got: '${e.replace("$for",m)}')`)}let o=n[1],p=n[2].trim();af(p,r);let l=p.match(/^(.+?)\s+in\s+(.+)$/);if(!l){let m=r?"$each":"$for";throw new E(`Invalid loop syntax - missing 'in' keyword (got: '${m} ${p}')`)}let a=l[1].trim(),c=l[2].trim(),d,h=null;if(a.includes(",")){let m=a.split(",").map(b=>b.trim());if(m.length!==2)throw new E(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=m[0],h=m[1]}else d=a;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new E(`Reserved variable name: ${d}`);if(h&&f.includes(h))throw new E(`Reserved variable name: ${h}`);let u=$n(c,s),y=Ce(t,s);return{type:v.LOOP,itemVar:d,indexVar:h,iterable:u,body:y,flatten:o!=="nested"}},$s=(e,t={})=>{let{functions:s={}}=t;return Ce(e,s)},lf=()=>Date.now(),pf=Object.freeze(Object.defineProperty({__proto__:null,now:lf},Symbol.toStringTag,{value:"Module"})),Cn=(e,t,s={})=>{let{functions:r={},partials:i={}}=s,n={...pf,...r},o=$s(e,{functions:n}),p={};for(let[l,a]of Object.entries(i))p[l]=$s(a,{functions:n});return vn(o,t,{functions:n,partials:p})},rt=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),df=(e,t)=>{!t||typeof t!="object"||Object.entries(t).forEach(([s,r])=>{if(s==="default")throw new Error("[Methods] Invalid method name 'default'. Use named exports in .methods.js; default export is not supported.");if(typeof r=="function"){if(s in e)throw new Error(`[Methods] Cannot define method '${s}' because it already exists on the component instance.`);Object.defineProperty(e,s,{configurable:!0,enumerable:!1,writable:!1,value:(i={})=>{let n=i===void 0?{}:i;if(!rt(n))throw new Error(`[Methods] Method '${s}' expects payload to be an object.`);return r.call(e,n)}})}})},In=Symbol.for("immer-nothing"),ni=Symbol.for("immer-draftable"),oe=Symbol.for("immer-state");function ce(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Me=Object.getPrototypeOf;function Fe(e){return!!e&&!!e[oe]}function Ie(e){return e?On(e)||Array.isArray(e)||!!e[ni]||!!e.constructor?.[ni]||Vt(e)||Rt(e):!1}var cf=Object.prototype.constructor.toString();function On(e){if(!e||typeof e!="object")return!1;let t=Me(e);if(t===null)return!0;let s=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return s===Object?!0:typeof s=="function"&&Function.toString.call(s)===cf}function kt(e,t){Lt(e)===0?Reflect.ownKeys(e).forEach(s=>{t(s,e[s],e)}):e.forEach((s,r)=>t(r,s,e))}function Lt(e){let t=e[oe];return t?t.type_:Array.isArray(e)?1:Vt(e)?2:Rt(e)?3:0}function Cs(e,t){return Lt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Tn(e,t,s){let r=Lt(e);r===2?e.set(t,s):r===3?e.add(s):e[t]=s}function uf(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Vt(e){return e instanceof Map}function Rt(e){return e instanceof Set}function ke(e){return e.copy_||e.base_}function Is(e,t){if(Vt(e))return new Map(e);if(Rt(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let s=On(e);if(t===!0||t==="class_only"&&!s){let r=Object.getOwnPropertyDescriptors(e);delete r[oe];let i=Reflect.ownKeys(r);for(let n=0;n<i.length;n++){let o=i[n],p=r[o];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(r[o]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[o]})}return Object.create(Me(e),r)}else{let r=Me(e);if(r!==null&&s)return{...e};let i=Object.create(r);return Object.assign(i,e)}}function Js(e,t=!1){return Nt(e)||Fe(e)||!Ie(e)||(Lt(e)>1&&(e.set=e.add=e.clear=e.delete=hf),Object.freeze(e),t&&Object.entries(e).forEach(([s,r])=>Js(r,!0))),e}function hf(){ce(2)}function Nt(e){return Object.isFrozen(e)}var ff={};function Oe(e){let t=ff[e];return t||ce(0,e),t}var it;function Ln(){return it}function yf(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function oi(e,t){t&&(Oe("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Os(e){Ts(e),e.drafts_.forEach(mf),e.drafts_=null}function Ts(e){e===it&&(it=e.parent_)}function ai(e){return it=yf(it,e)}function mf(e){let t=e[oe];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function li(e,t){t.unfinalizedDrafts_=t.drafts_.length;let s=t.drafts_[0];return e!==void 0&&e!==s?(s[oe].modified_&&(Os(t),ce(4)),Ie(e)&&(e=Et(t,e),t.parent_||$t(t,e)),t.patches_&&Oe("Patches").generateReplacementPatches_(s[oe].base_,e,t.patches_,t.inversePatches_)):e=Et(t,s,[]),Os(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==In?e:void 0}function Et(e,t,s){if(Nt(t))return t;let r=t[oe];if(!r)return kt(t,(i,n)=>pi(e,r,t,i,n,s)),t;if(r.scope_!==e)return t;if(!r.modified_)return $t(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;let i=r.copy_,n=i,o=!1;r.type_===3&&(n=new Set(i),i.clear(),o=!0),kt(n,(p,l)=>pi(e,r,i,p,l,s,o)),$t(e,i,!1),s&&e.patches_&&Oe("Patches").generatePatches_(r,s,e.patches_,e.inversePatches_)}return r.copy_}function pi(e,t,s,r,i,n,o){if(Fe(i)){let p=n&&t&&t.type_!==3&&!Cs(t.assigned_,r)?n.concat(r):void 0,l=Et(e,i,p);if(Tn(s,r,l),Fe(l))e.canAutoFreeze_=!1;else return}else o&&s.add(i);if(Ie(i)&&!Nt(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Et(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(s,r)&&$t(e,i)}}function $t(e,t,s=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Js(t,s)}function gf(e,t){let s=Array.isArray(e),r={type_:s?1:0,scope_:t?t.scope_:Ln(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=r,n=Qs;s&&(i=[r],n=nt);let{revoke:o,proxy:p}=Proxy.revocable(i,n);return r.draft_=p,r.revoke_=o,p}var Qs={get(e,t){if(t===oe)return e;let s=ke(e);if(!Cs(s,t))return bf(e,s,t);let r=s[t];return e.finalized_||!Ie(r)?r:r===ys(e.base_,t)?(ms(e),e.copy_[t]=Vs(r,e)):r},has(e,t){return t in ke(e)},ownKeys(e){return Reflect.ownKeys(ke(e))},set(e,t,s){let r=Vn(ke(e),t);if(r?.set)return r.set.call(e.draft_,s),!0;if(!e.modified_){let i=ys(ke(e),t),n=i?.[oe];if(n&&n.base_===s)return e.copy_[t]=s,e.assigned_[t]=!1,!0;if(uf(s,i)&&(s!==void 0||Cs(e.base_,t)))return!0;ms(e),Ls(e)}return e.copy_[t]===s&&(s!==void 0||t in e.copy_)||Number.isNaN(s)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=s,e.assigned_[t]=!0),!0},deleteProperty(e,t){return ys(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ms(e),Ls(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let s=ke(e),r=Reflect.getOwnPropertyDescriptor(s,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:s[t]}},defineProperty(){ce(11)},getPrototypeOf(e){return Me(e.base_)},setPrototypeOf(){ce(12)}},nt={};kt(Qs,(e,t)=>{nt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});nt.deleteProperty=function(e,t){return nt.set.call(this,e,t,void 0)};nt.set=function(e,t,s){return Qs.set.call(this,e[0],t,s,e[0])};function ys(e,t){let s=e[oe];return(s?ke(s):e)[t]}function bf(e,t,s){let r=Vn(t,s);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function Vn(e,t){if(!(t in e))return;let s=Me(e);for(;s;){let r=Object.getOwnPropertyDescriptor(s,t);if(r)return r;s=Me(s)}}function Ls(e){e.modified_||(e.modified_=!0,e.parent_&&Ls(e.parent_))}function ms(e){e.copy_||(e.copy_=Is(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var vf=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,s,r)=>{if(typeof t=="function"&&typeof s!="function"){let n=s;s=t;let o=this;return function(p=n,...l){return o.produce(p,a=>s.call(this,a,...l))}}typeof s!="function"&&ce(6),r!==void 0&&typeof r!="function"&&ce(7);let i;if(Ie(t)){let n=ai(this),o=Vs(t,void 0),p=!0;try{i=s(o),p=!1}finally{p?Os(n):Ts(n)}return oi(n,r),li(i,n)}else if(!t||typeof t!="object"){if(i=s(t),i===void 0&&(i=t),i===In&&(i=void 0),this.autoFreeze_&&Js(i,!0),r){let n=[],o=[];Oe("Patches").generateReplacementPatches_(t,i,n,o),r(n,o)}return i}else ce(1,t)},this.produceWithPatches=(t,s)=>{if(typeof t=="function")return(n,...o)=>this.produceWithPatches(n,p=>t(p,...o));let r,i;return[this.produce(t,s,(n,o)=>{r=n,i=o}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Ie(e)||ce(8),Fe(e)&&(e=wf(e));let t=ai(this),s=Vs(e,void 0);return s[oe].isManual_=!0,Ts(t),s}finishDraft(e,t){let s=e&&e[oe];(!s||!s.isManual_)&&ce(9);let{scope_:r}=s;return oi(r,t),li(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let s;for(s=t.length-1;s>=0;s--){let i=t[s];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}s>-1&&(t=t.slice(s+1));let r=Oe("Patches").applyPatches_;return Fe(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Vs(e,t){let s=Vt(e)?Oe("MapSet").proxyMap_(e,t):Rt(e)?Oe("MapSet").proxySet_(e,t):gf(e,t);return(t?t.scope_:Ln()).drafts_.push(s),s}function wf(e){return Fe(e)||ce(10,e),Rn(e)}function Rn(e){if(!Ie(e)||Nt(e))return e;let t=e[oe],s;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,s=Is(e,t.scope_.immer_.useStrictShallowCopy_)}else s=Is(e,!0);return kt(s,(r,i)=>{Tn(s,r,Rn(i))}),t&&(t.finalized_=!1),s}var ae=new vf,_f=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 xf=(e,t,s,r={})=>{let{createInitialState:i,...n}=e,o={},p={},l={},a=c=>({state:c,props:t,constants:s,i18n:r.getI18n?.()||{},locale:r.locale});return i&&(l=i({props:t,constants:s})),Object.entries(n).forEach(([c,d])=>{if(c.startsWith("select")){o[c]=(...h)=>d(a(l),...h);return}p[c]=(h={})=>{let f=h===void 0?{}:h;if(!rt(f))throw new Error(`[Store] Action '${c}' expects payload to be an object.`);return l=_f(l,u=>d(a(u),f)),l}}),{getState:()=>l,...p,...o}},Nn=e=>!rt(e)||Object.isFrozen(e)?e:(Object.values(e).forEach(t=>{Nn(t)}),Object.freeze(e)),Sf=({setupConstants:e,fileConstants:t})=>{let s=rt(e)?e:{},r=rt(t)?t:{};return Nn({...s,...r})},Af=(e,t)=>{if(!t||typeof t!="object")return"";let s="",r=n=>Object.entries(n).map(([o,p])=>` ${o}: ${p};`).join(`
1613
- `),i=(n,o)=>{if(typeof o!="object"||o===null)return"";if(n.startsWith("@")){let l=Object.entries(o).map(([a,c])=>{let d=r(c);return` ${a} {
1627
+ `))}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 s=t.composedPath();(s[0]===this._dialogElement||s[0].nodeName==="DIALOG"&&s[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let s=t.composedPath();(s[0]===this._dialogElement||s[0].nodeName==="DIALOG"&&s[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._contentWrapper=null,this._isOpen=!1,this._positionFrameId=null,this._revealFrameId=null,this._positionVersion=0,this._isObservingResize=!1,this._isModalOpen=!1,this._observedContentWrapper=null,this._onWindowResize=()=>{this._updateActiveStateAttributes(),this._syncDialogMode(),this._schedulePositionUpdate()},this._resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>{this._isOpen&&this._schedulePositionUpdate()}):null}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y",...M(["place","overlay","no-overlay"]),"content-w","content-h","content-wh","content-g","content-sv","content-hsb","content-ph","content-pv","content-bgc","content-style"]}connectedCallback(){this._syncContentWrapper({reposition:!1}),this._updateActiveStateAttributes(),this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._cancelScheduledPositionUpdate(),this._stopResizeObserver(),window.removeEventListener("resize",this._onWindowResize),this._isOpen&&this._dialogElement.open&&this._dialogElement.close(),this._isModalOpen=!1}attributeChangedCallback(t,s,i){t==="open"?i!==null&&!this._isOpen?this.isConnected&&this._show():i===null&&this._isOpen&&this._hide():t==="x"||t==="y"||t.endsWith("place")?(this._updateActiveStateAttributes(),this._isOpen&&this._schedulePositionUpdate()):t.endsWith("overlay")?(this._updateActiveStateAttributes(),this._isOpen&&(this._syncDialogMode(),this._schedulePositionUpdate())):t.startsWith("content-")&&this._syncContentWrapper()}_getActiveResponsiveSize(){if(typeof window>"u"||typeof window.matchMedia!="function")return"default";for(let t of Ro){let s=Ae[t];if(s&&window.matchMedia(No(s)).matches)return t}return"default"}_getActiveResponsiveAttribute(t){return Se({element:this,size:this._getActiveResponsiveSize(),attr:t})}_getActivePlace(){return this._getActiveResponsiveAttribute("place")||"bs"}_isOverlayActive(){return Pi(this._getActiveResponsiveAttribute("overlay"),!1)}_isNoOverlayActive(){return Pi(this._getActiveResponsiveAttribute("no-overlay"),!1)}_shouldUseModalDialog(){return this._isOverlayActive()||!this._isNoOverlayActive()}_updateActiveStateAttributes(){let t=this._getActivePlace(),s=this._isOverlayActive();this.getAttribute(Di)!==t&&this.setAttribute(Di,t),s?this.getAttribute(Xe)!=="true"&&this.setAttribute(Xe,"true"):this.hasAttribute(Xe)&&this.removeAttribute(Xe)}_openDialogElement(){this._dialogElement.open||(this._shouldUseModalDialog()?(this._dialogElement.showModal(),this._isModalOpen=!0):(this._dialogElement.show(),this._isModalOpen=!1))}_syncDialogMode(){!this._isOpen||!this._dialogElement.open||this._shouldUseModalDialog()===this._isModalOpen||(this._dialogElement.close(),this._isModalOpen=!1,this._openDialogElement())}_isIgnorableTextNode(t){return t?.nodeType===Node.TEXT_NODE&&t.textContent?.trim()===""}_ensureContentWrapper(){if(this._contentWrapper?.parentNode===this)return this._contentWrapper;let t=Array.from(this.children).find(s=>s.hasAttribute(Ni));return t?this._contentWrapper=t:(this._contentWrapper=document.createElement("rtgl-view"),this._contentWrapper.setAttribute(Ni,""),this._contentWrapper.setAttribute("part","content"),this._contentWrapper.setAttribute("bgc","su"),this._contentWrapper.setAttribute("bw","xs"),this._contentWrapper.setAttribute("bc","bo"),this._contentWrapper.setAttribute("br","md"),this._contentWrapper.setAttribute("ph","sm"),this._contentWrapper.setAttribute("pv","sm"),this._contentWrapper.setAttribute("style",ds)),this._contentWrapper.parentNode!==this&&this.appendChild(this._contentWrapper),this._contentWrapper}_syncContentWrapperAttributes(){let t=this._ensureContentWrapper(),s=[["content-w","w"],["content-h","h"],["content-wh","wh"],["content-g","g"],["content-sv","sv"],["content-hsb","hsb"]];for(let[r,n]of s){let o=this.getAttribute(r);o===null?t.removeAttribute(n):t.setAttribute(n,o)}t.setAttribute("bgc",this.getAttribute("content-bgc")||"su"),t.setAttribute("ph",this.getAttribute("content-ph")||"sm"),t.setAttribute("pv",this.getAttribute("content-pv")||"sm");let i=this.getAttribute("content-style");t.setAttribute("style",i?`${ds} ${i}`:ds)}_syncContentWrapper({reposition:t=!0}={}){let s=this._ensureContentWrapper(),i=Array.from(this.childNodes).filter(n=>n!==s&&!this._isIgnorableTextNode(n));for(let n of i)n.nodeType===Node.ELEMENT_NODE&&n.getAttribute("slot")==="content"&&n.removeAttribute("slot"),s.appendChild(n);this._syncContentWrapperAttributes(),Array.from(s.childNodes).some(n=>!this._isIgnorableTextNode(n))||this.hasAttribute("open")?s.setAttribute("slot","content"):s.removeAttribute("slot"),t&&this._isOpen&&this._schedulePositionUpdate()}_show(){this._isOpen||(this._syncContentWrapper({reposition:!1}),this._updateActiveStateAttributes(),this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._startResizeObserver(),window.addEventListener("resize",this._onWindowResize),this._dialogElement.open?this._schedulePositionUpdate():setTimeout(()=>{this._isOpen&&this._dialogElement&&!this._dialogElement.open&&this._openDialogElement(),this._schedulePositionUpdate()},0))}_hide(){this._isOpen&&(this._isOpen=!1,this._cancelScheduledPositionUpdate(),this._stopResizeObserver(),window.removeEventListener("resize",this._onWindowResize),this._dialogElement.open&&this._dialogElement.close(),this._isModalOpen=!1,this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_startResizeObserver(){this._resizeObserver&&(this._isObservingResize||(this._resizeObserver.observe(this._popoverContainer),this._isObservingResize=!0),this._contentWrapper&&this._observedContentWrapper!==this._contentWrapper&&(this._observedContentWrapper&&this._resizeObserver.unobserve(this._observedContentWrapper),this._resizeObserver.observe(this._contentWrapper),this._observedContentWrapper=this._contentWrapper))}_stopResizeObserver(){this._resizeObserver?.disconnect(),this._isObservingResize=!1,this._observedContentWrapper=null}_cancelScheduledPositionUpdate(){this._positionFrameId!==null&&(cancelAnimationFrame(this._positionFrameId),this._positionFrameId=null),this._revealFrameId!==null&&(cancelAnimationFrame(this._revealFrameId),this._revealFrameId=null),this._positionVersion+=1,this.removeAttribute("positioned")}_readCoordinateAttr(t){let s=parseFloat(this.getAttribute(t)||"0");return Number.isFinite(s)?s:0}_schedulePositionUpdate(){this._isOpen&&(this.removeAttribute("positioned"),this._positionVersion+=1,this._positionFrameId===null&&(this._positionFrameId=requestAnimationFrame(()=>{if(this._positionFrameId=null,!this._isOpen)return;if(!this._dialogElement.open){this._schedulePositionUpdate();return}this._syncContentWrapper({reposition:!1}),this._startResizeObserver();let t=this._readCoordinateAttr("x"),s=this._readCoordinateAttr("y"),i=this._getActivePlace();this._updateActiveStateAttributes();let r=this._popoverContainer.getBoundingClientRect(),{left:n,top:o}=this._calculatePosition(t,s,r.width,r.height,i);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${o}px`;let p=this._positionVersion;this._revealFrameId=requestAnimationFrame(()=>{this._revealFrameId=null,this._isOpen&&this._positionVersion===p&&this.setAttribute("positioned","")})})))}_calculatePosition(t,s,i,r,n){return Ri({x:t,y:s,width:i,height:r,place:n,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight})}get popover(){return this._popoverContainer}get content(){return this._contentWrapper}refreshContent(){this._syncContentWrapper()}},ji=({render:e,html:t})=>cs;var Do=(e,t)=>{let{store:s,render:i}=e;s.toggleOpen({}),i()},Po=Object.freeze(Object.defineProperty({__proto__:null,handleClickHeader:Do},Symbol.toStringTag,{value:"Module"})),jo=()=>Object.freeze({open:!1}),Bo=["id","class","style","slot","label","content"],zo=(e={})=>Object.entries(e).filter(([t])=>!Bo.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Mo=({state:e,props:t})=>({label:t.label||"",content:t.content||"",openClass:e.open?"content-wrapper open":"content-wrapper",chevronIcon:e.open?"chevronUp":"chevronDown",containerAttrString:zo(t)}),Wo=({state:e})=>{e.open=!e.open},Fo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:jo,selectViewData:Mo,toggleOpen:Wo},Symbol.toStringTag,{value:"Module"})),Ko=(e,t)=>{let{dispatchEvent:s,props:i}=e,r=t._event,n=Number(r.currentTarget.dataset.index),o=Array.isArray(i.items)?i.items[n]:void 0;if(o){if(o.disabled||o.current){r.preventDefault();return}typeof o.href=="string"&&o.href.length>0||r.preventDefault(),s(new CustomEvent("item-click",{detail:{id:o.id,path:o.path,href:o.href,item:o,index:n,trigger:r.type}}))}},Uo=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:Ko},Symbol.toStringTag,{value:"Module"})),Ho=()=>Object.freeze({}),qo=["id","class","style","slot","items","sep","max","separator"],Yo=(e={})=>Object.entries(e).filter(([t])=>!qo.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Go=e=>{if(e==null||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t},Jo=e=>`${e}`.replace(/"/g,"&quot;"),Qo=(e,t)=>{if(!t||t<3||e.length<=t)return e;let s=t-2;return[e[0],{isEllipsis:!0,label:"..."},...e.slice(-s)]},Zo=e=>e.map((t,s)=>{let i=typeof t.href=="string"&&t.href.length>0,r=t.path!==void 0&&t.path!==null&&`${t.path}`!="",n=!!t.current,o=!!t.disabled,p=!n&&!o&&(i||r||!!t.click),l=t.rel||(t.newTab?"noopener noreferrer":""),a=[t.newTab?'target="_blank"':"",l?`rel="${Jo(l)}"`:""].filter(Boolean).join(" ");return{...t,label:t.label||"",index:s,href:i?t.href:void 0,path:r?t.path:void 0,isCurrent:n,isDisabled:o,isInteractive:p,linkExtraAttrs:a,c:n?"fg":"mu-fg"}}),Xo=({props:e})=>{let t=Yo(e),s=Array.isArray(e.items)?e.items:[],i=Go(e.max),r=e.sep||"breadcrumb-arrow",n=Zo(s),o=Qo(n,i),p=[];return o.forEach((l,a)=>{p.push(l),a<o.length-1&&p.push({isSeparator:!0})}),{containerAttrString:t,items:p,sep:r}},ea=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Ho,selectViewData:Xo},Symbol.toStringTag,{value:"Module"})),ta=["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"],Bi={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"}},sa=(e={})=>Object.entries(e).filter(([t])=>!ta.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),ia=()=>Object.freeze({}),ra=({props:e={}})=>{let t=Bi[e.size]?e.size:"md",s=Bi[t];return{containerAttrString:sa(e),cardAttrString:s.cardAttrString,headerAttrString:s.headerAttrString,headingSize:s.headingSize,subheadingSize:s.subheadingSize,head:e.head||"",desc:e.desc||"",hasHeader:!!(e.head||e.desc),size:t}},na=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:ia,selectViewData:ra},Symbol.toStringTag,{value:"Module"})),oa=(e={})=>e.type==="section"||e.type==="label"?"section":e.type==="separator"?"separator":"item",aa=(e,t)=>{let{render:s,refs:i}=e,{oldProps:r={},newProps:n={}}=t,o=r.items!==n.items&&!!n.open;s(),o&&i?.popover?.refreshContent?.()},la=(e,t)=>{let{dispatchEvent:s}=e;s(new CustomEvent("close"))},pa=(e,t)=>{let{dispatchEvent:s,props:i}=e,r=t._event,n=Number(r.currentTarget.dataset.index??r.currentTarget.id.slice(6)),o=i.items[n],p=oa(o);if(!o||p!=="item"||o.disabled){r.preventDefault();return}o.href||r.preventDefault(),s(new CustomEvent("item-click",{detail:{index:n,item:o,id:o.id,path:o.path,href:o.href,trigger:r.type}}))},da=Object.freeze(Object.defineProperty({__proto__:null,handleClickMenuItem:pa,handleClosePopover:la,handleOnUpdate:aa},Symbol.toStringTag,{value:"Module"})),ca=()=>Object.freeze({}),Ar=e=>`${e}`.replace(/"/g,"&quot;"),ua=[["overlay","overlay"],["noOverlay","no-overlay"],["smPlace","sm-place"],["mdPlace","md-place"],["lgPlace","lg-place"],["xlPlace","xl-place"],["smOverlay","sm-overlay"],["mdOverlay","md-overlay"],["lgOverlay","lg-overlay"],["xlOverlay","xl-overlay"],["smNoOverlay","sm-no-overlay"],["mdNoOverlay","md-no-overlay"],["lgNoOverlay","lg-no-overlay"],["xlNoOverlay","xl-no-overlay"]],ha=(e={})=>ua.filter(([t])=>e[t]!==void 0&&e[t]!==null).map(([t,s])=>{let i=e[t];return i===!0?s:`${s}="${Ar(i)}"`}).join(" "),fa=(e={})=>e.type==="section"||e.type==="label"?"section":e.type==="separator"?"separator":"item",ya=e=>e.map((t,s)=>{let i=fa(t),r=i==="separator",n=i==="section",o=i==="item",p=!!t.disabled,l=o&&!p,a=Object.prototype.hasOwnProperty.call(t,"icon"),c=typeof t.icon=="string"&&t.icon.length>0?t.icon:"",d=typeof t.shortcut=="string"&&t.shortcut.length>0?t.shortcut:typeof t.suffixText=="string"&&t.suffixText.length>0?t.suffixText:"",h=p?"mu-fg":"fg",f=p?"mu":"",u=p?"":"ac",y=h,m="mu-fg",b=typeof t.href=="string"&&t.href.length>0,g=t.rel||(t.newTab?"noopener noreferrer":""),_=[t.newTab?'target="_blank"':"",g?`rel="${Ar(g)}"`:""].filter(Boolean).join(" ");return{...t,index:s,type:i,isSeparator:r,isSection:n,isItem:o,isDisabled:p,isInteractive:l,hasIconSlot:a,icon:c,hasIcon:c.length>0,suffixText:d,hasSuffixText:d.length>0,hasHref:b,linkExtraAttrs:_,c:h,bgc:f,hoverBgc:u,iconColor:y,suffixTextColor:m}}),ma=({props:e})=>{let t=Array.isArray(e.items)?e.items:[];return{items:ya(t),open:!!e.open,x:e.x||0,y:e.y||0,w:e.w||"300",h:e.h||"300",place:e.place||"bs",popoverAttrString:ha(e)}},ga=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:ca,selectViewData:ma},Symbol.toStringTag,{value:"Module"})),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},P={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},ws={NOT:0},$=class extends Error{constructor(e){super(`Parse Error: ${e}`),this.name="JemplParseError"}},de=class extends Error{constructor(e){super(`Render Error: ${e}`),this.name="JemplRenderError"}},zi=e=>{if(!e||e.trim()==="")throw new $("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let s=e.includes("===")?"==":"!=";throw new $(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${s}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let s of t)if(e.trim().endsWith(s))throw new $(`Incomplete comparison expression - missing right operand (got: '${e}')`)},ba=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,s]=e.split(" in ");if(!s||s.trim()==="")throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);let i=t.includes(",")?t.split(",").map(r=>r.trim()):[t.trim()];for(let r of i){if(!r)throw new $(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(r))throw new $(`Invalid loop syntax (got: '$for ${e}')`)}},va=(e,t,s=!1)=>{if(t===null)return new de(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new de(`Cannot iterate over undefined value at '$for ${e}'`);let i=typeof t;return s?new de(`Cannot iterate over non-array value in loop '${e}' - got ${i} instead`):new de(`Cannot iterate over non-array value (got: ${i}) at '$for ${e}'`)},wa=(e,t)=>{let s=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new de(`Unknown function '${e}' (${s})`)},_a=(e,t,s={})=>{let i={},r={};s&&typeof s=="object"&&(s.functions!==void 0||s.partials!==void 0?(i=s.functions||{},r=s.partials||{}):typeof s=="object"&&(i=s));let n=R(e,{functions:i,partials:r},t,{});return n===void 0?{}:n},R=(e,t,s,i)=>{if(t.functions,e.var&&!e.type)return U(e.var,s,i);if(e.type===w.LITERAL)return e.value;if(e.type===w.VARIABLE)return U(e.path,s,i);if(e.type===w.INTERPOLATION)return Sa(e.parts,t,s,i);switch(e.type){case w.FUNCTION:return Er(e,t,s,i);case w.BINARY:return kr(e,t,s,i);case w.UNARY:return $r(e,t,s,i);case w.CONDITIONAL:return Ea(e,t,s,i);case w.LOOP:return Oa(e,t,s,i);case w.OBJECT:return La(e,t,s,i);case w.ARRAY:return Va(e,t,s,i);case w.PARTIAL:return Ra(e,t,s,i);case w.PATH_REFERENCE:return Na(e,t,s,i);default:throw new Error(`Unknown node type: ${e.type}`)}},Mi=new Map,xa=e=>{let t=[],s="",i=!1;for(let r=0;r<e.length;r++){let n=e[r];if(n==="[")s&&(t.push({type:"property",value:s}),s=""),i=!0;else if(n==="]"){if(i&&s){let o=s.trim();if(/^\d+$/.test(o))t.push({type:"index",value:parseInt(o,10)});else if(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'")){let p=o.slice(1,-1);t.push({type:"property",value:p})}else t.push({type:"property",value:o});s=""}i=!1}else s+=n}return s&&t.push({type:"property",value:s}),t},U=(e,t,s)=>{if(!e)return;if(e in s)return s[e];let i=Mi.get(e);if(!i){let n=[],o="",p=0;for(let l=0;l<e.length;l++){let a=e[l];a==="["?(p++,o+=a):a==="]"?(p--,o+=a):a==="."&&p===0?o&&(n.push(o),o=""):o+=a}o&&n.push(o),i=[];for(let l of n){let a=xa(l.trim());i.push(...a)}Mi.set(e,i)}let r=t;for(let n=0;n<i.length;n++){let o=i[n];if(o.type==="property"&&o.value in s){r=s[o.value];continue}if(r==null)return;(o.type==="property"||o.type==="index")&&(r=r[o.value])}return r},Sa=(e,t,s,i)=>{let r=[];for(let n of e)if(typeof n=="string")r.push(n);else{let o=R(n,t,s,i);r.push(o!=null?String(o):"")}return r.join("")},Er=(e,t,s,i)=>{let r=t.functions||t,n=r[e.name];if(!n)throw wa(e.name,r);let o=e.args.map(p=>R(p,t,s,i));return n(...o)},Be=(e,t,s,i)=>{if(e.var&&!e.type)return U(e.var,s,i);switch(e.type){case w.VARIABLE:return U(e.path,s,i);case w.LITERAL:return e.value;case w.BINARY:return kr(e,t,s,i);case w.UNARY:return $r(e,t,s,i);case w.FUNCTION:return Er(e,t,s,i);default:return R(e,t,s,i)}},kr=(e,t,s,i)=>{if(e.op===P.AND||e.op===P.OR){let o=Be(e.left,t,s,i),p=Be(e.right,t,s,i);switch(e.op){case P.AND:return o&&p;case P.OR:return o||p}}let r=R(e.left,t,s,i),n=R(e.right,t,s,i);switch(e.op){case P.EQ:return r==n;case P.NEQ:return r!=n;case P.GT:return r>n;case P.LT:return r<n;case P.GTE:return r>=n;case P.LTE:return r<=n;case P.IN:return Array.isArray(n)?n.includes(r):!1;case P.ADD:if(typeof r!="number"||typeof n!="number")throw new de(`Arithmetic operations require numbers. Got ${typeof r} + ${typeof n}`);return r+n;case P.SUBTRACT:if(typeof r!="number"||typeof n!="number")throw new de(`Arithmetic operations require numbers. Got ${typeof r} - ${typeof n}`);return r-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},$r=(e,t,s,i)=>{let r=e.op===ws.NOT?Be(e.operand,t,s,i):R(e.operand,t,s,i);switch(e.op){case ws.NOT:return!r;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Aa=(e,t,s,i)=>{if(e.conditions.length===2&&e.conditions[1]===null){let r=e.conditions[0];if(r.type===w.VARIABLE)if(U(r.path,s,i)){let n=e.bodies[0];if(n.type===w.OBJECT&&n.properties.length<=5){let o={};for(let p of n.properties){let l=p.parsedKey?R(p.parsedKey,t,s,i):p.key,a=p.value;if(a.type===w.LITERAL)o[l]=a.value;else if(a.type===w.VARIABLE)o[l]=U(a.path,s,i);else if(a.type===w.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let h=U(d.path,s,i);c.push(h!=null?String(h):"")}else{let h=R(d,t,s,i);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=R(a,t,s,i)}return o}}else{let n=e.bodies[1];if(n.type===w.OBJECT&&n.properties.length<=5){let o={};for(let p of n.properties){let l=p.parsedKey?R(p.parsedKey,t,s,i):p.key,a=p.value;if(a.type===w.LITERAL)o[l]=a.value;else if(a.type===w.VARIABLE)o[l]=U(a.path,s,i);else if(a.type===w.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let h=U(d.path,s,i);c.push(h!=null?String(h):"")}else{let h=R(d,t,s,i);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=R(a,t,s,i)}return o}}}return null},Ea=(e,t,s,i)=>{let r=Aa(e,t,s,i);if(r!==null)return r;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||Be(o,t,s,i))return R(e.bodies[n],t,s,i)}return Cr},ka=(e,t)=>{let s=e.body,i=e.itemVar;if(s.type===w.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===w.VARIABLE){let r=s.conditions[0].path,n=s.bodies[0];if(r.startsWith(i+".")){let o=r.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 a=t[l];if(a[o]){let c={};for(let d of n.properties){let h=d.key,f=d.value;if(f.type===w.LITERAL)c[h]=f.value;else if(f.type===w.VARIABLE){let u=f.path;if(u===i)c[h]=a;else if(u.startsWith(i+".")){let y=u.substring(i.length+1);c[h]=a[y]}else return null}else if(f.type===w.INTERPOLATION){let u=[],y=!0;for(let m of f.parts)if(typeof m=="string")u.push(m);else if(m.type===w.VARIABLE){let b=m.path;if(b===i)u.push(a!=null?String(a):"");else if(b.startsWith(i+".")){let g=b.substring(i.length+1),_=a[g];u.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[h]=u.join("")}else return null}p.push(c)}}return p}}}return null},$a=(e,t)=>{let s=e.body,i=e.itemVar,r=ka(e,t);if(r!==null)return r;if(s.type===w.OBJECT&&s.properties.length<=5&&!s.whenCondition){for(let p of s.properties)if(p.parsedKey)return null;let n=[],o=!0;for(let p of s.properties){let l=p.key,a=p.value;if(a.type===w.LITERAL)n.push({key:l,type:"literal",value:a.value});else if(a.type===w.VARIABLE){let c=a.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{o=!1;break}}else{o=!1;break}}else if(a.type===w.INTERPOLATION&&a.parts.length===1){let c=a.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 h=d.substring(i.length+1);if(!h.includes(".")&&!h.includes("["))n.push({key:l,type:"prop_string",prop:h});else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}if(o){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 a=t[l];p[l]={id:a.id,title:a.title!=null?String(a.title):"",completed:a.completed}}else for(let l=0;l<t.length;l++){let a=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]=a;else if(d.type==="prop")c[d.key]=a[d.prop];else if(d.type==="item_string")c[d.key]=a!=null?String(a):"";else if(d.type==="prop_string"){let h=a[d.prop];c[d.key]=h!=null?String(h):""}p[l]=c}return p}}return null},Ca=(e,t,s,i,r)=>{let n=[],o=e.body;if(o.type===w.OBJECT&&o.fast!==!1){let p=e.itemVar,l=e.indexVar;for(let a=0;a<r.length;a++){let c=r[a],d={},h={...i,[p]:c,...l&&{[l]:a}};h.__paths__||(h.__paths__=i.__paths__||{});let f=e.iterable.path||"";if(i&&i.__paths__&&f){let u=f.split("."),y=u[0];y in i.__paths__&&(f=i.__paths__[y],u.length>1&&(f+="."+u.slice(1).join(".")))}h.__paths__={...h.__paths__,[p]:`${f}[${a}]`,...l&&{[l]:a}};for(let u of o.properties){let y=u.parsedKey?R(u.parsedKey,t,s,h):u.key,m=u.value;if(m.type===w.LITERAL)d[y]=m.value;else if(m.type===w.VARIABLE){let b=m.path;if(b===p)d[y]=c;else if(b===l)d[y]=a;else if(b.startsWith(p+".")){let g=b.substring(p.length+1);!g.includes(".")&&!g.includes("[")?d[y]=c[g]:d[y]=U(b,s,{...i,[p]:c,...l&&{[l]:a}})}else d[y]=U(b,s,{...i,[p]:c,...l&&{[l]:a}})}else if(m.type===w.INTERPOLATION){let b=[];for(let g of m.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=a;else if(_.startsWith(p+".")){let A=_.substring(p.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=U(_,s,{...i,[p]:c,...l&&{[l]:a}})}else S=U(_,s,{...i,[p]:c,...l&&{[l]:a}});b.push(S!=null?String(S):"")}else{let _={...i,[p]:c,...l&&{[l]:a}},S=R(g,t,s,_);b.push(S!=null?String(S):"")}d[y]=b.join("")}else{let b={...i,[p]:c,...l&&{[l]:a}};d[y]=R(m,t,s,b)}}n.push(d)}return n}return null},Ia=(e,t,s)=>{let i=e.body;if(i.type===w.OBJECT&&i.properties.length===1&&i.properties[0].key==="$if item.visible"){let r=i.properties[0].value;if(r.type===w.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===w.VARIABLE&&r.conditions[0].path==="item.visible"){let n=r.bodies[0];if(n.type===w.OBJECT&&n.properties.length===2){let o=n.properties[0],p=n.properties[1];if(o.key==="id"&&o.value.type===w.VARIABLE&&o.value.path==="item.id"&&p.key==="$if item.highlighted"&&p.value.type===w.CONDITIONAL){let l=[];for(let a=0;a<t.length;a++){let c=t[a];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},Oa=(e,t,s,i)=>{let r=R(e.iterable,t,s,i);if(!Array.isArray(r)){let a,c=!1;if(e.iterable.type===w.FUNCTION){c=!0;let h=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(", ");a=`${e.iterable.name}(${h})`}else a=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${a}`;throw va(d,r,c)}if(!e.indexVar){let a=Ia(e,r,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=$a(e,r);if(a!==null)return a}let n=Ca(e,t,s,i,r);if(n!==null)return n;let o=[],p=e.iterable.path||"";if(i&&i.__paths__&&p){let a=p.split("."),c=a[0];c in i.__paths__&&(p=i.__paths__[c],a.length>1&&(p+="."+a.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(a=>a.type===w.OBJECT&&a.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let a=0;a<r.length;a++){let c=e.indexVar?{...i,[e.itemVar]:r[a],[e.indexVar]:a}:{...i,[e.itemVar]:r[a]};c.__paths__||(c.__paths__=i.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${p}[${a}]`},e.indexVar&&(c.__paths__[e.indexVar]=a);let d=R(e.body,t,s,c);if(Array.isArray(d)&&d.length===1&&!l){let h=d[0];o.push(h===void 0?{}:h)}else o.push(d===void 0?{}:d)}return o},Ta=(e,t,s,i)=>{if(e.whenCondition)return null;if(e.properties.length===1){let r=e.properties[0],n=r.parsedKey?R(r.parsedKey,t,s,i):r.key,o=r.value;if(o.type===w.OBJECT&&o.properties.length<=10&&!o.whenCondition){let p={},l={},a=!0;for(let c of o.properties){let d=c.parsedKey?R(c.parsedKey,t,s,i):c.key,h=c.value;if(h.type===w.LITERAL)l[d]=h.value;else if(h.type===w.VARIABLE)l[d]=U(h.path,s,i);else if(h.type===w.INTERPOLATION){let f=[];for(let u of h.parts)if(typeof u=="string")f.push(u);else if(u.type===w.VARIABLE){let y=U(u.path,s,i);f.push(y!=null?String(y):"")}else{a=!1;break}if(!a)break;l[d]=f.join("")}else if(h.type===w.OBJECT&&h.properties.length<=5){let f={};for(let u of h.properties){let y=u.key,m=u.value;if(m.type===w.LITERAL)f[y]=m.value;else if(m.type===w.VARIABLE)f[y]=U(m.path,s,i);else if(m.type===w.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=U(g.path,s,i);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[y]=b.join("")}else{a=!1;break}}if(!a)break;l[d]=f}else{a=!1;break}}if(a)return p[n]=l,p}}return null},La=(e,t,s,i)=>{let r=t.functions||t;if(e.whenCondition&&!Be(e.whenCondition,r,s,i))return;let n=Ta(e,t,s,i);if(n!==null)return n;if(e.fast){let l={};for(let a of e.properties){let c=a.parsedKey?R(a.parsedKey,t,s,i):a.key,d=a.value;if(d.type===w.LITERAL)l[c]=d.value;else if(d.type===w.VARIABLE)l[c]=U(d.path,s,i);else if(d.type===w.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===w.VARIABLE){let u=U(f.path,s,i);h.push(u!=null?String(u):"")}else{let u=R(f,t,s,i);h.push(u!=null?String(u):"")}l[c]=h.join("")}else l[c]=R(d,t,s,i)}return l}let o={},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 a=R(l.value,t,s,i);if(!p&&a!==null&&a!==void 0)return Array.isArray(a)&&a.length===1?a[0]:a;typeof a=="object"&&a!==null&&!Array.isArray(a)&&Object.assign(o,a)}else if(l.key.startsWith("$for ")){if(e.properties.length===1)return R(l.value,t,s,i)}else{let a=l.value;if(a&&a.type===w.OBJECT&&a.properties){let c=a.properties.find(d=>d.key.startsWith("$for "));if(c){let d=R(c.value,t,s,i);d!==void 0&&(o[l.key]=d)}else{let d=R(l.value,t,s,i);d!==void 0&&(o[l.key]=d)}}else{let c=l.parsedKey?R(l.parsedKey,t,s,i):l.key,d=R(l.value,t,s,i);d!==void 0&&(o[c]=d)}}return o},Cr={},Va=(e,t,s,i)=>{let r=[];for(let n of e.items)if(n.type===w.LOOP){let o=R(n,t,s,i);Array.isArray(o)&&n.flatten!==!1?r.push(...o):r.push(o)}else{let o=R(n,t,s,i);o!==Cr&&o!==void 0&&r.push(o)}return r},Ra=(e,t,s,i)=>{let{name:r,data:n,whenCondition:o}=e,p=t.partials||{},l=t.functions||t;if(o&&!Be(o,l,s,i))return;if(!p[r])throw new de(`Partial '${r}' is not defined`);let a=i._partialStack||[];if(a.includes(r))throw new de(`Circular partial reference detected: ${r}`);let c=p[r],d=s,h={...i,_partialStack:[...a,r]};if(i){d={...s};for(let f of Object.keys(i))f.startsWith("_")||(d[f]=i[f])}if(n){let f=R(n,t,s,i);d={...d,...f}}return R(c,t,d,h)},Na=(e,t,s,i)=>{let{path:r}=e,n=r.split("."),o=n[0],p=n.slice(1);if(!i||!(o in i))throw new de(`Path reference '#{${r}}' refers to '${o}' which is not a loop variable in the current scope`);if(i.__paths__||(i.__paths__={}),!(o in i.__paths__))throw new de(`Path reference '#{${r}}' cannot be resolved - path tracking may not be initialized properly`);let l=i.__paths__[o];if(typeof l=="number"){if(p.length>0)throw new de(`Path reference '#{${r}}' - cannot access properties on index variable '${o}'`);return String(l)}return p.length>0&&(l+="."+p.join(".")),l},Da=/\$\{([^}]*)\}/g,Pa=/#\{([^}]*)\}/g,Ir=(e,t={})=>{let s=e.match(/^(\w+)\((.*)\)$/);if(!s)return{isFunction:!1};let[,i,r]=s,n=ja(r,t);return{isFunction:!0,type:w.FUNCTION,name:i,args:n}},ja=(e,t={})=>e.trim()?Ba(e).map(s=>za(s.trim(),t)):[],Ba=e=>{let t=[],s="",i=0,r=!1,n="";for(let o=0;o<e.length;o++){let p=e[o],l=o>0?e[o-1]:"";!r&&(p==='"'||p==="'")?(r=!0,n=p,s+=p):r&&p===n&&l!=="\\"?(r=!1,n="",s+=p):!r&&p==="("?(i++,s+=p):!r&&p===")"?(i--,s+=p):!r&&p===","&&i===0?(t.push(s),s=""):s+=p}return s&&t.push(s),t},za=(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 s=Ir(e,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};let i=e.trim(),r=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:o,type:p}of r){let l=0;for(;l<i.length;){let a=Re(i.substring(l),o);if(a===-1)break;let c=l+a;c>n&&(n=c),l=c+o.length}}if(n!==-1)try{return Z(i,t)}catch{return{type:w.VARIABLE,path:i}}return{type:w.VARIABLE,path:i}},Or=/^\w+\(.*\)$/,Ma=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,Wa=e=>{if(!(!e||e.trim()===""||Or.test(e))&&Ma.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}"`)},Wi=e=>{let t=e.trim();if(Or.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:w.PATH_REFERENCE,path:t}},vt=(e,t={})=>{let s=e.trim();Wa(s);let i=Ir(s,t);if(i.isFunction)return{type:i.type,name:i.name,args:i.args};if(s.includes("[")&&!/[\s+\-*/%|&?:]/.test(s)){let r=0;for(let n of s)n==="["?r++:n==="]"&&r--;if(r!==0)throw new Error("Invalid array index syntax")}return{type:w.VARIABLE,path:s}},Tr=(e,t={})=>{let s=e,i=[];(e.includes("\\${")||e.includes("\\#{"))&&(s=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),s=s.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),s=s.replace(/\\(\$\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),s=s.replace(/\\(#\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),s=s.replace(/\\DOUBLE_ESC_VAR/g,"\\"),s=s.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let r=[...s.matchAll(Da)],n=[...s.matchAll(Pa)],o=[...r.map(a=>({match:a,type:"variable"})),...n.map(a=>({match:a,type:"pathref"}))].sort((a,c)=>a.match.index-c.match.index);if(o.length===0){let a=s;for(let c=0;c<i.length;c++)a=a.replace(`__ESCAPED_${c}__`,i[c]);return{type:w.LITERAL,value:a}}if(o.length===1&&o[0].match[0]===s&&i.length===0){let{match:a,type:c}=o[0];try{return c==="variable"?vt(a[1],t):Wi(a[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:w.LITERAL,value:s};throw d}}let p=[],l=0;for(let{match:a,type:c}of o){let[d,h]=a,f=a.index;if(f>l){let u=s.substring(l,f);for(let y=0;y<i.length;y++)u=u.replace(`__ESCAPED_${y}__`,i[y]);u&&p.push(u)}try{let u;c==="variable"?u=vt(h.trim(),t):u=Wi(h.trim()),p.push(u)}catch(u){if(u.message==="Invalid array index syntax")p.push(d);else throw u}l=f+d.length}if(l<s.length){let a=s.substring(l);for(let c=0;c<i.length;c++)a=a.replace(`__ESCAPED_${c}__`,i[c]);a&&p.push(a)}return{type:w.INTERPOLATION,parts:p}},$e=(e,t)=>typeof e=="string"?Tr(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Ka(e,t):Ua(e,t):{type:w.LITERAL,value:e},Fa=e=>{let{$each:t,...s}=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(s).length===0)throw new $("Empty $each body not allowed");if(s.$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}`]:s}},Ka=(e,t)=>{let s=[],i=!1;for(let r=0;r<e.length;r++){let n=e[r];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let l=Fa(n),a=Object.keys(l);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let c=Fi(a[0],l[a[0]],t,!0);s.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=Fi(p[0],n[p[0]],t);s.push(l),i=!0;continue}}let o=$e(n,t);s.push(o),(o.type===w.FUNCTION||o.type===w.CONDITIONAL||o.type===w.LOOP||o.type===w.PARTIAL||o.type===w.OBJECT&&!o.fast||o.type===w.ARRAY&&!o.fast)&&(i=!0)}return{type:w.ARRAY,items:s,fast:!i}},Ua=(e,t)=>{let s=[],i=!1,r=null,n=Object.entries(e),o=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"],a=[];for(let[b]of n)for(let g of l)if(b===g||b.startsWith(g+" ")||b.startsWith(g+"#")){a.push(g);break}if(a.length>0)throw new $(`Cannot use $partial with ${a.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...h}=e,f={},u=!1;for(let[b,g]of Object.entries(h)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=g,u=!0}let y=null;if(u&&(y=$e(f,t),y.type===w.OBJECT)){let b=!1;for(let g of y.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&&(y.fast=!1)}let m={type:w.PARTIAL,name:c,data:y};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new $("Empty condition expression after '$when'");b=Z(d,t)}else b={type:w.LITERAL,value:d};m.whenCondition=b}return m}for(let[l,a]of n)if(l==="$when"){if(r!==null)throw new $("Multiple '$when' directives on the same object are not allowed");if(a==null)throw new $("Missing condition expression after '$when'");let c=typeof a=="string"?a:JSON.stringify(a);if(c.trim()==="")throw new $("Empty condition expression after '$when'");r=Z(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(;o<n.length;){let[l,a]=n[o];if(l==="$when"){o++;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,o,t);s.push({key:l,value:c.node}),i=!0,o=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=$e(a,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=Tr(l,t),h={key:l,value:c};(d.type!==w.LITERAL||d.value!==l)&&(h.parsedKey=d),s.push(h),o++}}}let p={type:w.OBJECT,properties:s,fast:!i};return r&&(p.whenCondition=r),p},Ha=(e,t,s={})=>{let i=[],r=[],n=t,[o,p]=e[n],l=null,a;if(o.startsWith("$if#")){let d=o.match(/^\$if#(\w+)\s+(.+)$/);if(d)l=d[1],a=d[2];else throw new $(`Invalid conditional syntax: ${o}`)}else a=o.substring(4),a.endsWith(":")&&(a=a.slice(0,-1).trim());zi(a);let c=Z(a,s);for(i.push(c),r.push($e(p,s)),n++;n<e.length;){let[d,h]=e[n],f=!1,u;if(l?d.startsWith(`$elif#${l} `)?(u=d.substring(`$elif#${l} `.length),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d===`$else#${l}`||d===`$else#${l}:`)&&(f=!0,u=null):d.startsWith("$elif ")?(u=d.substring(6),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,u=null),f){if(u===null)i.push(null);else{zi(u);let y=Z(u,s);i.push(y)}if(r.push($e(h,s)),n++,u===null)break}else break}return{node:{type:w.CONDITIONAL,conditions:i,bodies:r,id:l},nextIndex:n}},Z=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let a=e.slice(1,-1),c=0,d=!0;for(let h=0;h<a.length;h++)if(a[h]==="("?c++:a[h]===")"&&c--,c<0){d=!1;break}if(d&&c===0)return Z(a,t)}let s=Re(e,"||");if(s!==-1)return{type:w.BINARY,op:P.OR,left:Z(e.substring(0,s).trim(),t),right:Z(e.substring(s+2).trim(),t)};let i=Re(e,"&&");if(i!==-1)return{type:w.BINARY,op:P.AND,left:Z(e.substring(0,i).trim(),t),right:Z(e.substring(i+2).trim(),t)};let r=[{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:a,type:c}of r){let d=Re(e,a);if(d!==-1)return{type:w.BINARY,op:c,left:Z(e.substring(0,d).trim(),t),right:Z(e.substring(d+a.length).trim(),t)}}let n=-1,o=null,p=[{op:" + ",type:P.ADD},{op:" - ",type:P.SUBTRACT}];for(let{op:a,type:c}of p){let d=0;for(;d<e.length;){let h=Re(e.substring(d),a);if(h===-1)break;let f=d+h;f>n&&(n=f,o={op:a,type:c}),d=f+a.length}}if(n!==-1&&o)return{type:w.BINARY,op:o.type,left:Z(e.substring(0,n).trim(),t),right:Z(e.substring(n+o.op.length).trim(),t)};let l=[" * "," / "," % "];for(let a of l)if(Re(e,a)!==-1)throw new $(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:w.UNARY,op:ws.NOT,operand:Z(e.substring(1).trim(),t)}:Lr(e,t)},Re=(e,t)=>{let s=0,i=0;for(;i<=e.length-t.length;){if(e[i]==="(")s++;else if(e[i]===")")s--;else if(s===0&&e.substring(i,i+t.length)===t)return i;i++}return-1},qa=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}},Lr=(e,t)=>{let s=e.trim();if(s.match(/^(\w+)\((.*)\)$/))return vt(s,t);let i=qa(s);if(i.type===w.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(s))return{type:w.VARIABLE,path:s};try{return vt(s,t)}catch(r){if(r.message&&r.message.includes("not supported"))return i;throw r}},Ya=(e,t=!1)=>{try{ba(e)}catch(s){if(s instanceof $&&t){let i=s.message.replace(/\$for/g,"$each");throw new $(i.replace("Parse Error: ",""))}throw s}},Fi=(e,t,s,i=!1)=>{let r=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(r);if(!n){let m=i?"$each":"$for";throw new $(`Invalid loop syntax (got: '${e.replace("$for",m)}')`)}let o=n[1],p=n[2].trim();Ya(p,i);let l=p.match(/^(.+?)\s+in\s+(.+)$/);if(!l){let m=i?"$each":"$for";throw new $(`Invalid loop syntax - missing 'in' keyword (got: '${m} ${p}')`)}let a=l[1].trim(),c=l[2].trim(),d,h=null;if(a.includes(",")){let m=a.split(",").map(b=>b.trim());if(m.length!==2)throw new $(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=m[0],h=m[1]}else d=a;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new $(`Reserved variable name: ${d}`);if(h&&f.includes(h))throw new $(`Reserved variable name: ${h}`);let u=Lr(c,s),y=$e(t,s);return{type:w.LOOP,itemVar:d,indexVar:h,iterable:u,body:y,flatten:o!=="nested"}},Ki=(e,t={})=>{let{functions:s={}}=t;return $e(e,s)},Ga=()=>Date.now(),Ja=Object.freeze(Object.defineProperty({__proto__:null,now:Ga},Symbol.toStringTag,{value:"Module"})),Qa=(e,t,s={})=>{let{functions:i={},partials:r={}}=s,n={...Ja,...i},o=Ki(e,{functions:n}),p={};for(let[l,a]of Object.entries(r))p[l]=Ki(a,{functions:n});return _a(o,t,{functions:n,partials:p})},zs=e=>e!==null&&typeof e=="object",wt=e=>zs(e)&&!Array.isArray(e),Za=e=>typeof e=="string"&&e.includes("."),Vr=e=>typeof e=="string"&&/[\[\]]/.test(e);function Rr(e,t){let s={};for(let i of t){if(typeof i!="string"||i.length===0)continue;let r=ne(e,i);r!==void 0&&he(s,i,r)}return s}function Xa(e){if(!wt(e)||!Array.isArray(e.fields))return e;let t=(s=[])=>s.map(i=>{if(!wt(i))return i;if(typeof i.$when=="string"&&i.$when.trim().length>0){let{$when:r,...n}=i,o=Array.isArray(n.fields)?{...n,fields:t(n.fields)}:n;return{[`$if ${r}`]:o}}return Array.isArray(i.fields)?{...i,fields:t(i.fields)}:i});return{...e,fields:t(e.fields)}}var ne=(e,t,s=void 0)=>{if(!t||!zs(e)||Vr(t))return s;let i=t.split(".").filter(n=>n!==""),r=e;for(let n of i){if(r==null||!(n in r))return Object.prototype.hasOwnProperty.call(e,t)?e[t]:s;r=r[n]}return r},he=(e,t,s)=>{if(!zs(e)||typeof t!="string"||t.length===0||Vr(t))return e;let i=t.split(".").filter(n=>n!=="");if(i.length===0)return e;Za(t)&&Object.prototype.hasOwnProperty.call(e,t)&&delete e[t];let r=e;for(let n=0;n<i.length-1;n++){let o=i[n];(!(o in r)||typeof r[o]!="object"||r[o]===null)&&(r[o]={}),r=r[o]}return r[i[i.length-1]]=s,e},el=["id","class","style","slot","form","defaultValues","disabled","context"],tl=(e={})=>Object.entries(e).filter(([t,s])=>!(el.includes(t)||s==null||typeof s=="object"||typeof s=="function")).map(([t,s])=>`${t}=${String(s)}`).join(" "),sl={email:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,url:/^https?:\/\/.+/},ue={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}`},il="input-date",rl="input-time",nl="input-datetime",ol=/^(\d{4})-(\d{2})-(\d{2})$/,al=/^(\d{2}):(\d{2})(?::(\d{2}))?$/,ll=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}(?::\d{2})?)$/,pl=e=>{if(typeof e!="string")return null;let t=ol.exec(e);if(!t)return null;let s=Number(t[1]),i=Number(t[2]),r=Number(t[3]);if(!Number.isInteger(s)||!Number.isInteger(i)||!Number.isInteger(r)||i<1||i>12||r<1||r>31)return null;let n=new Date(Date.UTC(s,i-1,r));return n.getUTCFullYear()===s&&n.getUTCMonth()===i-1&&n.getUTCDate()===r?{year:s,month:i,day:r}:null},dl=e=>{if(typeof e!="string")return null;let t=al.exec(e);if(!t)return null;let s=Number(t[1]),i=Number(t[2]),r=t[3]===void 0?0:Number(t[3]);return!Number.isInteger(s)||!Number.isInteger(i)||!Number.isInteger(r)||s<0||s>23||i<0||i>59||r<0||r>59?null:{hour:s,minute:i,second:r}},Nr=e=>{let t=dl(e);return t?`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}`:null},Dr=e=>pl(e)?e:null,cl=e=>{if(typeof e!="string")return null;let t=ll.exec(e);if(!t)return null;let s=Dr(t[1]),i=Nr(t[2]);return!s||!i?null:`${s}T${i}`},ul=e=>e===il?{normalize:Dr,invalidMessage:ue.invalidDate}:e===rl?{normalize:Nr,invalidMessage:ue.invalidTime}:e===nl?{normalize:cl,invalidMessage:ue.invalidDateTime}:null,hl=(e,t)=>{let s=ul(e.type);if(!s||t==null||t==="")return null;let i=s.normalize(String(t));if(!i)return s.invalidMessage;if(e.min!==void 0&&e.min!==null&&String(e.min)!==""){let r=s.normalize(String(e.min));if(r&&i<r)return ue.minTemporal(String(e.min))}if(e.max!==void 0&&e.max!==null&&String(e.max)!==""){let r=s.normalize(String(e.max));if(r&&i>r)return ue.maxTemporal(String(e.max))}return null},It=(e,t)=>{if(e.required){let i=t==null||t===""||Array.isArray(t)&&t.length===0||typeof t=="boolean"&&t===!1,r=e.type==="input-number"&&t===null;if(e.type==="input-number"?r:i)return typeof e.required=="object"&&e.required.message?e.required.message:ue.required}let s=hl(e,t);if(s)return s;if(Array.isArray(e.rules))for(let i of e.rules){let r=fl(i,t);if(r)return r}return null},fl=(e,t)=>{if(t==null||t==="")return null;let s=String(t);switch(e.rule){case"minLength":return s.length<e.value?e.message||ue.minLength(e.value):null;case"maxLength":return s.length>e.value?e.message||ue.maxLength(e.value):null;case"pattern":{let i=sl[e.value];if(!i)try{i=new RegExp(e.value)}catch{return e.message||ue.pattern}return i.test(s)?null:e.message||ue.pattern}default:return null}},Ot=(e,t)=>{let s={},i=re(e);for(let r of i){let n=ne(t,r.name),o=It(r,n);o&&(s[r.name]=o)}return{valid:Object.keys(s).length===0,errors:s}},yl=["section","read-only-text","slot"],Ms=e=>!yl.includes(e.type),re=e=>{let t=[];for(let s of e)s.type==="section"&&Array.isArray(s.fields)?t.push(...re(s.fields)):Ms(s)&&t.push(s);return t},Ws=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":case"segmented-control":return null;case"tag-select":return[];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}},Fs=(e,t=0)=>{let s=[],i=t;for(let r of e)if(r.type==="section"){if(s.push({...r,_isSection:!0,_idx:i}),i++,Array.isArray(r.fields)){let n=Fs(r.fields,i);s.push(...n),i+=n.length}}else s.push({...r,_isSection:!1,_idx:i}),i++;return s},ml=()=>Object.freeze({formValues:{},errors:{},reactiveMode:!1,tooltipState:{open:!1,x:0,y:0,content:""}}),ee=({state:e,props:t})=>{let{form:s={}}=t||{},i=Xa(s),r=wt(t?.context)?t.context:{},n=wt(e?.formValues)?e.formValues:{},o={...r,...n,formValues:n};return Object.keys(o).length>0?Qa(i,o):i},gl=({state:e,props:t})=>{let s=tl(t),i=ee({state:e,props:t}),r=i.fields||[],n=!!t?.disabled,o=Fs(r);o.forEach(d=>{if(d._isSection)return;let h=Ms(d);if(d._disabled=n||!!d.disabled,h&&d.name&&(d._error=e.errors[d.name]||null),d.type==="input-text"&&(d._inputType=d.inputType||"text"),d.type==="select"||d.type==="tag-select"||d.type==="segmented-control"){let f=ne(e.formValues,d.name);d._selectedValue=f!==void 0?f:null,d._selectedValues=Array.isArray(f)?f:[],d.placeholder=d.placeholder||"",d.noClear=d.clearable===!1}if(d.type==="image"){let f=ne(e.formValues,d.name);d._imageSrc=f&&String(f).trim()?f:null,d.placeholderText=d.placeholderText||"No Image"}if(d.type==="read-only-text"&&(d.content=d.content||""),d.type==="checkbox"){let f=typeof d.content=="string"?d.content:typeof d.checkboxLabel=="string"?d.checkboxLabel:"";d._checkboxText=f}});let p=i.actions||{buttons:[]},l=p.layout||"split",a=(p.buttons||[]).map((d,h)=>({...d,_globalIdx:h,variant:d.variant||"se",_disabled:n||!!d.disabled,pre:d.pre||"",suf:d.suf||""})),c;return l==="split"?c={_layout:"split",buttons:a,_leftButtons:a.filter(d=>d.align==="left"),_rightButtons:a.filter(d=>d.align!=="left")}:c={_layout:l,buttons:a,_allButtons:a},{containerAttrString:s,title:i?.title||"",description:i?.description||"",flatFields:o,actions:c,formValues:e.formValues,tooltipState:e.tooltipState}},Te=({state:e,props:t})=>{let s=ee({state:e,props:t}),i=re(s.fields||[]);return Rr(e.formValues,i.map(r=>r.name).filter(r=>typeof r=="string"&&r.length>0))},bl=({state:e,props:t},s={})=>{let{name:i,value:r}=s;i&&(he(e.formValues,i,r),at({state:e,props:t}))},at=({state:e,props:t})=>{if(!t)return;let s=ee({state:e,props:t}),i=re(s.fields||[]);e.formValues=Rr(e.formValues,i.map(r=>r.name).filter(r=>typeof r=="string"&&r.length>0))},vl=({state:e},t={})=>{let{values:s}=t;!s||typeof s!="object"||Object.keys(s).forEach(i=>{he(e.formValues,i,s[i])})},wl=({state:e},t={})=>{let{defaultValues:s={}}=t;e.formValues=s?structuredClone(s):{},e.errors={},e.reactiveMode=!1},_l=({state:e},t={})=>{e.errors=t.errors||{}},xl=({state:e},t={})=>{let{name:s}=t;s&&e.errors[s]&&delete e.errors[s]},Sl=({state:e})=>{e.reactiveMode=!0},Al=({state:e},t={})=>{let{x:s,y:i,content:r}=t;e.tooltipState={open:!0,x:s,y:i,content:r}},El=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},kl=Object.freeze(Object.defineProperty({__proto__:null,clearFieldError:xl,collectAllDataFields:re,createInitialState:ml,flattenFields:Fs,get:ne,getDefaultValue:Ws,hideTooltip:El,isDataField:Ms,pruneHiddenValues:at,resetFormValues:wl,selectForm:ee,selectFormValues:Te,selectViewData:gl,set:he,setErrors:_l,setFormFieldValue:bl,setFormValues:vl,setReactiveMode:Sl,showTooltip:Al,validateField:It,validateForm:Ot},Symbol.toStringTag,{value:"Module"})),Pr=({field:e,target:t,value:s})=>{!e||!t||["slider-with-input","popover-input"].includes(e.type)&&(s==null?t.removeAttribute("value"):t.setAttribute("value",String(s)))},jr=({form:e,formValues:t={},refs:s,formDisabled:i=!1})=>{let r=e.fields||[],n=0,o=p=>{for(let l of p){if(l.type==="section"){n++,Array.isArray(l.fields)&&o(l.fields);continue}let a=s[`field${n}`];if(n++,!a)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=ne(t,l.name);if(d==null?a.removeAttribute("value"):a.setAttribute("value",String(d)),l.type==="slider-with-input"&&a.store?.setValue){let h=Number(d??0);a.store.setValue({value:Number.isFinite(h)?h:0}),typeof a.render=="function"&&a.render()}l.type==="popover-input"&&a.store?.setValue&&(a.store.setValue({value:d==null?"":String(d)}),typeof a.render=="function"&&a.render())}if(l.type==="tag-select"&&a.store?.updateSelectedValues){let d=ne(t,l.name);a.store.updateSelectedValues({values:Array.isArray(d)?d:[]}),typeof a.render=="function"&&a.render()}l.type==="checkbox"&&(ne(t,l.name)?a.setAttribute("checked",""):a.removeAttribute("checked")),["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input"].includes(l.type)&&l.placeholder&&a.getAttribute("placeholder")!==l.placeholder&&(l.placeholder===void 0||l.placeholder===null?a.removeAttribute("placeholder"):a.setAttribute("placeholder",l.placeholder)),c?a.setAttribute("disabled",""):a.removeAttribute("disabled")}};o(r)},Br=(e,t)=>{let s=t?.defaultValues||{},i={};Object.keys(s).forEach(p=>{he(i,p,s[p])});let r=ee({state:{formValues:i},props:t}),n=re(r.fields||[]),o={};for(let p of n){let l=ne(s,p.name);l!==void 0?he(o,p.name,l):he(o,p.name,Ws(p))}e.resetFormValues({defaultValues:o})},$l=e=>{let{store:t,props:s}=e;Br(t,s)},Cl=e=>{let{props:t,refs:s,render:i}=e,r=e.store.getState(),n=ee({state:r,props:t});jr({form:n,formValues:r.formValues,refs:s,formDisabled:!!t?.disabled}),i()},Il=(e,t)=>{let{oldProps:s,newProps:i}=t,{store:r,render:n,refs:o}=e,p=!!i?.disabled;s?.key!==i?.key&&Br(r,i);let l=r.getState();at({state:l,props:i});let a=ee({state:l,props:i});jr({form:a,formValues:l.formValues,refs:o,formDisabled:p}),n()},Ol=(e,t)=>{let{store:s,dispatchEvent:i,render:r,props:n}=e,o=t._event,p=o.currentTarget.dataset.fieldName;if(!p||!o.detail||!Object.prototype.hasOwnProperty.call(o.detail,"value"))return;let l=o.detail.value;s.setFormFieldValue({name:p,value:l});let a=s.getState();at({state:a,props:n});let c=ee({state:a,props:n}),d=re(c.fields||[]).find(h=>h.name===p);if(Pr({field:d,target:o.currentTarget,value:l}),a.reactiveMode&&d){let h=It(d,l);h?s.setErrors({errors:{...a.errors,[p]:h}}):s.clearFieldError({name:p})}r(),i(new CustomEvent("form-input",{bubbles:!0,detail:{name:p,value:l,values:Te({state:s.getState(),props:n})}}))},Tl=(e,t)=>{let{store:s,dispatchEvent:i,render:r,props:n}=e,o=t._event,p=o.currentTarget.dataset.fieldName;if(!p||!o.detail||!Object.prototype.hasOwnProperty.call(o.detail,"value"))return;let l=o.detail.value;s.setFormFieldValue({name:p,value:l});let a=s.getState();at({state:a,props:n});let c=ee({state:a,props:n}),d=re(c.fields||[]).find(h=>h.name===p);if(Pr({field:d,target:o.currentTarget,value:l}),a.reactiveMode&&d){let h=It(d,l);h?s.setErrors({errors:{...a.errors,[p]:h}}):s.clearFieldError({name:p})}r(),i(new CustomEvent("form-change",{bubbles:!0,detail:{name:p,value:l,values:Te({state:s.getState(),props:n})}}))},Ll=(e,t)=>{let{store:s,dispatchEvent:i,render:r,props:n}=e,o=t._event.currentTarget.dataset.actionId;if(!o)return;let p=s.getState(),l=ee({state:p,props:n}),a=((l.actions||{}).buttons||[]).find(d=>d.id===o),c=Te({state:p,props:n});if(a&&a.validate){let d=re(l.fields||[]),{valid:h,errors:f}=Ot(d,p.formValues);s.setErrors({errors:f}),h||s.setReactiveMode(),r(),i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:o,values:c,valid:h,errors:f}}))}else i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:o,values:c}}))},Vl=(e,t)=>{let s=t._event;s.type==="contextmenu"&&s.preventDefault();let{store:i,dispatchEvent:r,props:n}=e,o=s.currentTarget.dataset.fieldName;r(new CustomEvent("form-field-event",{bubbles:!0,detail:{name:o,event:s.type,values:Te({state:i.getState(),props:n})}}))},Rl=(e,t)=>{let{store:s,dispatchEvent:i,render:r,props:n}=e,o=t._event;if(o.key==="Enter"&&!o.shiftKey){let p=o.target;if(p.tagName==="TEXTAREA"||p.tagName==="RTGL-TEXTAREA")return;o.preventDefault();let l=s.getState(),a=ee({state:l,props:n}),c=(a.actions||{}).buttons||[],d=c.find(f=>f.validate)||c[0];if(!d)return;let h=Te({state:l,props:n});if(d.validate){let f=re(a.fields||[]),{valid:u,errors:y}=Ot(f,l.formValues);s.setErrors({errors:y}),u||s.setReactiveMode(),r(),i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h,valid:u,errors:y}}))}else i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h}}))}},Nl=(e,t)=>{let{store:s,render:i,props:r}=e,n=t._event,o=n.currentTarget.dataset.fieldName,p=ee({state:s.getState(),props:r}),l=re(p.fields||[]).find(a=>a.name===o);if(l&&l.tooltip){let a=n.currentTarget.getBoundingClientRect();s.showTooltip({x:a.left+a.width/2,y:a.top-8,content:typeof l.tooltip=="string"?l.tooltip:l.tooltip.content||""}),i()}},Dl=e=>{let{store:t,render:s}=e;t.hideTooltip({}),s()},Pl=Object.freeze(Object.defineProperty({__proto__:null,handleActionClick:Ll,handleAfterMount:Cl,handleBeforeMount:$l,handleImageClick:Vl,handleKeyDown:Rl,handleOnUpdate:Il,handleTooltipMouseEnter:Nl,handleTooltipMouseLeave:Dl,handleValueChange:Tl,handleValueInput:Ol},Symbol.toStringTag,{value:"Module"})),jl=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"],Bl=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input","slider-with-input"],zl=({ref:e,fieldType:t,value:s,forceRefresh:i=!1})=>{if(jl.includes(t)){if(i&&e.removeAttribute("value"),s==null){if(Bl.includes(t)&&i){if(t==="popover-input"){e.removeAttribute("value");return}e.setAttribute("value","");return}e.removeAttribute("value");return}e.setAttribute("value",String(s))}},zr=({ref:e,value:t})=>{if(e){if(e?.store?.updateSelectedValues)e.store.updateSelectedValues({values:Array.isArray(t)?t:[]});else if(e?.store?.updateSelectedValue)e.store.updateSelectedValue({value:t});else return;typeof e.render=="function"&&e.render()}},Ml=e=>{let t=new Map;return!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("[data-field-name]").forEach(s=>{let i=s.getAttribute("data-field-name");i&&t.set(i,s)}),t},Ui=e=>e?.renderTarget?e.renderTarget:e?.shadowRoot?e.shadowRoot:e?.shadow,Wl=({root:e,values:t={}})=>{!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("rtgl-select[data-field-name], rtgl-tag-select[data-field-name], rtgl-segmented-control[data-field-name]").forEach(s=>{let i=s.dataset?.fieldName;if(!i)return;let r=ne(t,i);zr({ref:s,value:r})})},Fl=function(){let e=this.store.getState();return Te({state:e,props:this.props})},Kl=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 s=this.store.getState(),i=ee({state:s,props:this.props}),r=re(i.fields||[]),n=Ml(Ui(this));for(let p of r){if(!p.name)continue;let l=n.get(p.name);if(!l)continue;let a=Object.prototype.hasOwnProperty.call(t,p.name),c=ne(t,p.name);if(!a&&c===void 0)continue;let d=ne(s.formValues,p.name);zl({ref:l,fieldType:p.type,value:d,forceRefresh:!0}),["select","tag-select","segmented-control"].includes(p.type)&&zr({ref:l,value:d}),p.type==="checkbox"&&(d?l.setAttribute("checked",""):l.removeAttribute("checked"))}this.render();let o=()=>{let p=this.store.getState();Wl({root:Ui(this),values:p.formValues})};o(),setTimeout(()=>{o()},0)},Ul=function(){let e=this.store.getState(),t=ee({state:e,props:this.props}),s=re(t.fields||[]),{valid:i,errors:r}=Ot(s,e.formValues);return this.store.setErrors({errors:r}),i||this.store.setReactiveMode(),this.render(),{valid:i,errors:r}},Hl=function(){let e=this.props?.defaultValues||{},t={};Object.keys(e).forEach(n=>{he(t,n,e[n])});let s=ee({state:{formValues:t},props:this.props}),i=re(s.fields||[]),r={};for(let n of i){let o=ne(e,n.name);o!==void 0?he(r,n.name,o):he(r,n.name,Ws(n))}this.store.resetFormValues({defaultValues:r}),this.setValues(r)},ql=Object.freeze(Object.defineProperty({__proto__:null,getValues:Fl,reset:Hl,setValues:Kl,validate:Ul},Symbol.toStringTag,{value:"Module"})),Hi=3e3,Yl=180,_t=new WeakMap,Mr=e=>{e&&(typeof e.componentDialogBodyHost?.replaceChildren=="function"&&e.componentDialogBodyHost.replaceChildren(),delete e.componentDialogBody)},Gl=e=>{let t=e.selectUiType();return t==="dropdown"||t==="formDialog"||t==="componentDialog"?null:e.selectConfig().mode==="confirm"?!1:null},fe=({store:e,render:t,globalUI:s,refs:i,emitResult:r=!1,result:n})=>{if(!e.selectIsOpen())return;let o=n!==void 0?n:Gl(e);Mr(i),e.closeAll(),t(),r&&s.emit("event",o)},Wr=({store:e,render:t,globalUI:s,refs:i,error:r})=>{Mr(i),e.selectIsOpen()&&(e.closeAll(),t()),s.emit("error",r)},lt=({store:e,render:t,globalUI:s,refs:i})=>{e.selectIsOpen()&&fe({store:e,render:t,globalUI:s,refs:i,emitResult:!0})},pt=(e,{rejectOnError:t=!1}={})=>new Promise((s,i)=>{let r=null,n=e.once("event",o=>{r?.(),s(o)});t&&(r=e.once("error",o=>{n?.(),i(o)}))}),Jl=e=>{let t=_t.get(e);return t||(t=new Map,_t.set(e,t)),t},Ql=(e,t)=>{let s=_t.get(e),i=s?.get(t);i&&(clearTimeout(i.exitTimerId),clearTimeout(i.removeTimerId),s.delete(t))},Zl=e=>{let t=_t.get(e);if(t){for(let s of t.values())clearTimeout(s.exitTimerId),clearTimeout(s.removeTimerId);t.clear()}},Xl=({store:e,render:t,globalUI:s},i)=>{Ql(s,i);let r=Jl(s),n=setTimeout(()=>{e.setToastPhase?.({id:i,phase:"exiting"}),t()},Math.max(0,Hi-Yl)),o=setTimeout(()=>{r.delete(i),e.removeToast({id:i}),t()},Hi);r.set(i,{exitTimerId:n,removeTimerId:o})},ep=(e,t)=>{setTimeout(()=>{let{store:s,refs:i}=e;if(!s.selectIsOpen()||s.selectUiType()!=="formDialog")return;let r=s.selectFormDialogConfig?.();if(!r||r.key!==t||typeof r.mount!="function")return;let n=i.formDialog;n&&r.mount(n)},0)},tp=(e,t)=>{setTimeout(()=>{let{store:s,refs:i,render:r,globalUI:n}=e;if(!s.selectIsOpen()||s.selectUiType()!=="componentDialog")return;let o=s.selectComponentDialogConfig?.();if(!o||o.key!==t)return;let p=i.componentDialogBodyHost;if(p)try{let l=document.createElement(o.component);Object.entries(o.props??{}).forEach(([a,c])=>{l[a]=c}),p.replaceChildren(l),i.componentDialogBody=l}catch(l){Wr({store:s,render:r,globalUI:n,refs:i,error:l})}},0)},us=(e,t)=>!e.selectIsOpen()||e.selectUiType()!=="componentDialog"?!1:e.selectComponentDialogConfig?.()?.key===t,sp=e=>{let{store:t,render:s,globalUI:i,refs:r}=e;fe({store:t,render:s,globalUI:i,refs:r,emitResult:!0})},ip=e=>{let{store:t,render:s,globalUI:i,refs:r}=e,n=t.selectConfig().mode==="confirm"?!0:null;fe({store:t,render:s,globalUI:i,refs:r,emitResult:!0,result:n})},rp=e=>{let{store:t,render:s,globalUI:i,refs:r}=e;fe({store:t,render:s,globalUI:i,refs:r,emitResult:!0,result:!1})},np=e=>{let{store:t,render:s,globalUI:i,refs:r}=e;fe({store:t,render:s,globalUI:i,refs:r,emitResult:!0,result:null})},op=(e,t)=>{let{store:s,render:i,globalUI:r,refs:n}=e,o=t._event,{index:p,item:l}=o.detail;fe({store:s,render:i,globalUI:r,refs:n,emitResult:!0,result:{index:p,item:l}})},ap=(e,t)=>{let{store:s,render:i,globalUI:r,refs:n}=e,o=t;return lt({store:s,render:i,globalUI:r,refs:n}),s.setAlertConfig(o),i(),pt(r)},lp=async(e,t)=>{let{store:s,render:i,globalUI:r,refs:n}=e,o=t;return lt({store:s,render:i,globalUI:r,refs:n}),s.setConfirmConfig(o),i(),pt(r)},pp=(e,t)=>{let{store:s,render:i,globalUI:r}=e;s.addToast(t),i();let n=s.selectToasts?.()??[],o=n[n.length-1]?.id;o&&Xl({store:s,render:i,globalUI:r},o)},dp=async(e,t)=>{let{store:s,render:i,globalUI:r,refs:n}=e,o=t;return lt({store:s,render:i,globalUI:r,refs:n}),s.setDropdownConfig(o),i(),pt(r)},cp=async(e,t)=>{let{store:s,render:i,globalUI:r,refs:n}=e,o=t;lt({store:s,render:i,globalUI:r,refs:n}),s.setFormDialogConfig(o),i();let p=s.selectFormDialogConfig?.().key;return ep(e,p),pt(r)},up=async(e,t)=>{let{store:s,render:i,globalUI:r,refs:n}=e,o=t;lt({store:s,render:i,globalUI:r,refs:n}),s.setComponentDialogConfig(o),i();let p=s.selectComponentDialogConfig?.().key;return tp(e,p),pt(r,{rejectOnError:!0})},hp=(e,t)=>{let{store:s,render:i,globalUI:r,refs:n}=e,o=t._event?.detail??{};o.valid!==!1&&fe({store:s,render:i,globalUI:r,refs:n,emitResult:!0,result:o})},fp=(e,t)=>{let{store:s,refs:i}=e,r=t._event?.detail??{},n=s.selectFormDialogConfig?.();typeof n?.onFieldEvent=="function"&&n.onFieldEvent({detail:r,formEl:i.formDialog??null})},yp=e=>{let{store:t,render:s,globalUI:i,refs:r}=e;Zl(i);let n=(t.selectToasts?.().length??0)>0;if(n&&t.clearToasts(),t.selectIsOpen()){fe({store:t,render:s,globalUI:i,refs:r,emitResult:!0});return}n&&s()},mp=async(e,t)=>{let{store:s,render:i,globalUI:r,refs:n}=e,o=t._event,p=Number(o?.currentTarget?.dataset?.actionIndex),l=s.selectComponentDialogConfig?.(),a=l?.key,c=Number.isInteger(p)?l?.actions?.buttons?.[p]:null;if(c){if(c.role==="cancel"){fe({store:s,render:i,globalUI:r,refs:n,emitResult:!0,result:{actionId:c.id}});return}try{let d=n.componentDialogBody;if(!d||typeof d.validate!="function"||typeof d.getValues!="function")throw new Error(`component dialog body '${l?.component??"unknown"}' must implement validate() and getValues()`);if(c.validate){let f=await d.validate();if(!us(s,a))return;if(!f||typeof f!="object"||typeof f.valid!="boolean")throw new Error("component dialog body validate() must return { valid, errors? }");if(f.valid===!1)return}let h=await d.getValues();if(!us(s,a))return;fe({store:s,render:i,globalUI:r,refs:n,emitResult:!0,result:{actionId:c.id,values:h}})}catch(d){if(!us(s,a))return;Wr({store:s,render:i,globalUI:r,refs:n,error:d})}}},gp=Object.freeze(Object.defineProperty({__proto__:null,handleCancel:rp,handleCloseAll:yp,handleComponentDialogAction:mp,handleConfirm:ip,handleDialogClose:sp,handleDropdownClose:np,handleDropdownItemClick:op,handleFormAction:hp,handleFormFieldEvent:fp,handleShowAlert:ap,handleShowComponentDialog:up,handleShowConfirm:lp,handleShowDropdownMenu:dp,handleShowFormDialog:cp,handleShowToast:pp},Symbol.toStringTag,{value:"Module"})),bp=new Set(["sm","md","lg","f"]),vp=new Set(["sm","md","lg"]),wp=new Set(["active","exiting"]),_p=new Set(["top","bottom"]),xp=new Set(["confirm","cancel"]),Fr=[["overlay","overlay"],["noOverlay","no-overlay"],["smPlace","sm-place"],["mdPlace","md-place"],["lgPlace","lg-place"],["xlPlace","xl-place"],["smOverlay","sm-overlay"],["mdOverlay","md-overlay"],["lgOverlay","lg-overlay"],["xlOverlay","xl-overlay"],["smNoOverlay","sm-no-overlay"],["mdNoOverlay","md-no-overlay"],["lgNoOverlay","lg-no-overlay"],["xlNoOverlay","xl-no-overlay"]],Sp=Object.freeze([{id:"cancel",label:"Cancel",variant:"se",align:"left",role:"cancel"},{id:"confirm",label:"OK",variant:"pr",role:"confirm",validate:!0}]),_s=e=>!e||typeof e!="object"||Array.isArray(e)?{}:e,Ap=e=>`${e}`.replace(/"/g,"&quot;"),Ep=(e={},t,s)=>e[t]!==void 0?e[t]:e[s],kp=(e={})=>Fr.reduce((t,[s,i])=>{let r=Ep(e,s,i);return r!=null&&(t[s]=r),t},{}),$p=(e={})=>Fr.filter(([t])=>e[t]!==void 0&&e[t]!==null).map(([t,s])=>{let i=e[t];return i===!0?s:`${s}="${Ap(i)}"`}).join(" "),je=(e,t="md")=>bp.has(e)?e:t,Kr=(e,t="sm")=>vp.has(e)?e:t,Ur=(e,t="active")=>wp.has(e)?e:t,Hr=(e,t="top")=>_p.has(e)?e:t,Ks=e=>{let t=(Array.isArray(e?.buttons)&&e.buttons.length>0?e.buttons:Sp).map((s,i)=>{if(!s||typeof s!="object"||Array.isArray(s))throw new Error("component dialog buttons must be objects");if(typeof s.id!="string"||s.id.length===0)throw new Error("component dialog button id is required");if(typeof s.label!="string"||s.label.length===0)throw new Error("component dialog button label is required");if(!xp.has(s.role))throw new Error("component dialog button role must be 'confirm' or 'cancel'");return{...s,_globalIdx:i,variant:s.variant??(s.role==="confirm"?"pr":"se"),align:s.align??(s.role==="cancel"?"left":"right"),validate:s.role==="confirm"?!!s.validate:!1,_disabled:!!s.disabled,pre:s.pre??"",suf:s.suf??""}});return{_layout:"split",buttons:t,_leftButtons:t.filter(s=>s.align==="left"),_rightButtons:t.filter(s=>s.align!=="left")}},qr=()=>({title:"",description:"",size:"md",component:"",props:{},actions:Ks(),key:0}),Cp=()=>Object.freeze({isOpen:!1,uiType:"dialog",nextToastId:0,toasts:[],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},componentDialogConfig:qr()}),Ip=({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},Op=({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},Tp=({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",...kp(t)},e.uiType="dropdown",e.isOpen=!0},Lp=({state:e},t={})=>{if(!t.form||typeof t.form!="object"||Array.isArray(t.form))throw new Error("form object is required for showFormDialog");let s=e.formDialogConfig?.key??0;e.formDialogConfig={form:t.form,defaultValues:_s(t.defaultValues),context:_s(t.context),disabled:!!t.disabled,size:je(t.size,"md"),key:s+1,onFieldEvent:typeof t.onFieldEvent=="function"?t.onFieldEvent:null,mount:typeof t.mount=="function"?t.mount:null},e.uiType="formDialog",e.isOpen=!0},Vp=({state:e},t={})=>{if(typeof t.component!="string"||!t.component.includes("-"))throw new Error("component tag name is required for showComponentDialog");let s=e.componentDialogConfig?.key??0;e.componentDialogConfig={title:typeof t.title=="string"?t.title:"",description:typeof t.description=="string"?t.description:"",size:je(t.size,"md"),component:t.component,props:_s(t.props),actions:Ks(t.actions),key:s+1},e.uiType="componentDialog",e.isOpen=!0},Rp=({state:e},t={})=>{if(typeof t.message!="string"||t.message.length===0)throw new Error("message is required for showToast");let s=(e.nextToastId??0)+1,i={id:`toast-${s}`,message:t.message,size:Kr(t.size??t.s,"sm"),position:Hr(t.position,"top"),phase:"active"};e.nextToastId=s,e.toasts=[...e.toasts??[],i]},Np=({state:e},t={})=>{typeof t.id!="string"||t.id.length===0||(e.toasts=(e.toasts??[]).filter(s=>s.id!==t.id))},Dp=({state:e},t={})=>{typeof t.id!="string"||t.id.length===0||(e.toasts=(e.toasts??[]).map(s=>s.id!==t.id?s:{...s,phase:Ur(t.phase,"active")}))},Pp=({state:e})=>{e.toasts=[]},jp=({state:e})=>{e.isOpen=!1,e.uiType="dialog"},Bp=({state:e})=>e.config,zp=({state:e})=>e.dropdownConfig,Mp=({state:e})=>e.formDialogConfig,Wp=({state:e})=>e.componentDialogConfig,Fp=({state:e})=>e.uiType,Kp=({state:e})=>e.isOpen,Up=({state:e})=>e.toasts??[],Hp=({state:e})=>{let t=e.isOpen&&e.uiType==="dialog",s=e.isOpen&&e.uiType==="formDialog",i=e.isOpen&&e.uiType==="componentDialog",r=e.componentDialogConfig??qr(),n=Array.isArray(e.toasts)?e.toasts.map(o=>({...o,size:Kr(o.size,"sm"),position:Hr(o.position,"top"),phase:Ur(o.phase,"active")})):[];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",popoverAttrString:$p(e.dropdownConfig)},formDialogConfig:{form:e.formDialogConfig?.form??{fields:[],actions:{buttons:[]}},defaultValues:e.formDialogConfig?.defaultValues??{},context:e.formDialogConfig?.context??{},disabled:!!e.formDialogConfig?.disabled,size:je(e.formDialogConfig?.size,"md"),key:e.formDialogConfig?.key??0},componentDialogConfig:{title:r.title??"",description:r.description??"",size:je(r.size,"md"),component:r.component??"",props:r.props??{},actions:r.actions??Ks(),key:r.key??0},toasts:n,topToasts:n.filter(o=>o.position==="top"),bottomToasts:n.filter(o=>o.position==="bottom"),isDialogOpen:t,isFormDialogOpen:s,isComponentDialogOpen:i,isDialogContainerOpen:t||s||i,isDropdownOpen:e.isOpen&&e.uiType==="dropdown",dialogSize:i?je(r.size,"md"):s?je(e.formDialogConfig?.size,"md"):"sm"}},qp=Object.freeze(Object.defineProperty({__proto__:null,addToast:Rp,clearToasts:Pp,closeAll:jp,createInitialState:Cp,removeToast:Np,selectComponentDialogConfig:Wp,selectConfig:Bp,selectDropdownConfig:zp,selectFormDialogConfig:Mp,selectIsOpen:Kp,selectToasts:Up,selectUiType:Fp,selectViewData:Hp,setAlertConfig:Ip,setComponentDialogConfig:Vp,setConfirmConfig:Op,setDropdownConfig:Tp,setFormDialogConfig:Lp,setToastPhase:Dp},Symbol.toStringTag,{value:"Module"})),Yp=(e,t)=>{let{dispatchEvent:s,store:i}=e;t._event,console.log("handle click start",i.selectPath()),s(new CustomEvent("start-click",{detail:{path:i.selectPath()}}))},Gp=Object.freeze(Object.defineProperty({__proto__:null,handleClickStart:Yp},Symbol.toStringTag,{value:"Module"})),Jp=()=>Object.freeze({}),Qp=["id","class","style","slot","start"],Zp=(e={})=>Object.entries(e).filter(([t])=>!Qp.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Xp=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}}}},ed=({props:e})=>{let t=Xp(e.start)||e.start;return{containerAttrString:Zp(e),start:t||{label:"",image:{src:"",width:32,height:32,alt:""}}}},td=({props:e})=>e.start?.path,sd=({state:e})=>{},id=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Jp,selectPath:td,selectViewData:ed,setState:sd},Symbol.toStringTag,{value:"Module"})),qi=e=>{let t=e.querySelectorAll("h1[id], h2[id], h3[id], h4[id], rtgl-text[id]");return Array.from(t)},rd=e=>e.map(t=>{let s=1,i=t.tagName.toLowerCase();return i==="h1"?s=1:i==="h2"?s=2:i==="h3"?s=3:i==="h4"?s=4:i==="rtgl-text"&&(s=parseInt(t.getAttribute("data-level")||"1",10)),{id:t.id,href:`#${t.id}`,title:t.textContent,level:s}}),Yi=(e,t,s)=>{let{store:i,render:r}=s,n,o=-1/0;if(e.forEach(p=>{let l=p.getBoundingClientRect();l.top<=t&&l.top>o&&(o=l.top,n=p.id)}),!n){let p=1/0;e.forEach(l=>{let a=l.getBoundingClientRect();a.top>t&&a.top<p&&(p=a.top,n=l.id)})}n&&n!==i.selectCurrentId()&&(i.setCurrentId({id:n}),r())},nd=(e,t,s,i)=>{let{store:r,render:n}=i,o=null,p=()=>{o=null;let d=qi(e);r.setItems({items:rd(d)}),Yi(d,s,i),n()},l=()=>{o===null&&(o=requestAnimationFrame(p))},a=()=>{Yi(qi(e),s,i)};l(),t.addEventListener("scroll",a,{passive:!0});let c=new MutationObserver(()=>{l()});return c.observe(e,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["id","data-level"]}),()=>{o!==null&&cancelAnimationFrame(o),c.disconnect(),t.removeEventListener("scroll",a)}},od=e=>{let{props:t}=e,s=()=>{};return requestAnimationFrame(()=>{let i=document.getElementById(t.targetId);if(!i)return;let r=window;t.scrollContainerId&&(r=document.getElementById(t.scrollContainerId)||window);let n=parseInt(t.offsetTop||"100",10);s=nd(i,r,n,e)}),()=>{s()}},ad=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:od},Symbol.toStringTag,{value:"Module"})),ld=()=>Object.freeze({items:[],currentId:null,contentContainer:null}),pd=({state:e})=>{let t=((s,i)=>{let r=new Set,n=s.findIndex(p=>p.id===i);if(n===-1)return r;let o=s[n].level;for(let p=n-1;p>=0;p--)if(s[p].level<o){let l=s[p].level;r.add(s[p].id);for(let a=p-1;a>=0;a--)s[a].level<l&&(r.add(s[a].id),l=s[a].level);break}return r})(e.items,e.currentId);return{items:e.items.map(s=>{let i={1:"0",2:"12px",3:"24px",4:"32px"},r=s.id===e.currentId,n=t.has(s.id),o=r||n;return{...s,c:o?"fg":"mu-fg",ml:i[s.level]||"",bc:o?"fg":"mu-fg"}}),currentId:e.currentId}},dd=({state:e})=>e,cd=({state:e})=>e.currentId,ud=({state:e},t={})=>{e.items=Array.isArray(t.items)?t.items:[]},hd=({state:e},t={})=>{e.currentId=t.id},fd=({state:e},t={})=>{e.contentContainer=t.container},yd=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:ld,selectCurrentId:cd,selectState:dd,selectViewData:pd,setContentContainer:fd,setCurrentId:hd,setItems:ud},Symbol.toStringTag,{value:"Module"})),dt=e=>e==null||e===!0?"":String(e),Yr=(e,t)=>{let{store:s,render:i,dispatchEvent:r}=e,n=dt(t);s.setValue({value:n}),s.closePopover({}),r(new CustomEvent("value-change",{detail:{value:n},bubbles:!0})),i()},md=e=>{let{store:t,props:s}=e;if(s.value!==void 0){let i=dt(s.value);t.setValue({value:i}),t.setTempValue({value:i})}},gd=(e,t)=>{let{oldProps:s,newProps:i}=t,{store:r,render:n}=e;if(s?.value!==i?.value){let o=dt(i?.value);r.setValue({value:o}),r.getState().isOpen||r.setTempValue({value:o})}n()},bd=(e,t)=>{let{store:s,render:i,refs:r,props:n}=e;if(n.disabled)return;let o=t._event,p=dt(n.value);s.setValue({value:p}),s.setTempValue({value:p}),s.openPopover({position:{x:o.currentTarget.getBoundingClientRect().left,y:o.currentTarget.getBoundingClientRect().bottom}}),i(),setTimeout(()=>{let{input:l}=r;if(!l)return;l.value=p,l.focus();let a=l.shadowRoot?.querySelector("input, textarea");a&&typeof a.focus=="function"&&a.focus()},50)},vd=(e,t)=>{let{store:s,render:i}=e;s.closePopover({}),i()},wd=(e,t)=>{let{store:s}=e,i=t._event,r=dt(i.detail.value);s.setTempValue({value:r})},_d=e=>{let{store:t,refs:s}=e,{input:i}=s,r=i?i.value:t.getState().tempValue;Yr(e,r)},xd=(e,t)=>{let{store:s,refs:i}=e,r=t._event;if(r.key==="Enter"){r.preventDefault(),r.stopPropagation();let{input:n}=i,o=n?n.value:s.getState().tempValue;Yr(e,o)}else r.key==="Escape"&&(r.preventDefault(),r.stopPropagation(),s.closePopover({}),e.render())},Sd=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:md,handleInputChange:wd,handleInputKeydown:xd,handleOnUpdate:gd,handlePopoverClose:vd,handleSubmitClick:_d,handleTextClick:bd},Symbol.toStringTag,{value:"Module"})),Ad=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),Ed=({props:e,state:t})=>{let s=typeof t.value=="string"&&t.value.length>0,i=s?t.value:"-",r=typeof e.placeholder=="string"?e.placeholder:"",n=typeof e.label=="string"?e.label:"",o=!!e.disabled;return{isOpen:t.isOpen,position:t.position,value:i,valueColor:s?"fg":"mu-fg",tempValue:t.tempValue,placeholder:r,label:n,disabled:o}},kd=({state:e},t={})=>{e.tempValue=t.value},$d=({state:e},t={})=>{let{position:s}=t;e.position=s,e.isOpen=!0,e.hasUnsavedChanges=!1},Cd=({state:e})=>{e.isOpen=!1,e.tempValue=""},Id=({state:e},t={})=>{e.value=t.value},Od=({state:e})=>e.value,Td=Object.freeze(Object.defineProperty({__proto__:null,closePopover:Cd,createInitialState:Ad,openPopover:$d,selectValue:Od,selectViewData:Ed,setTempValue:kd,setValue:Id},Symbol.toStringTag,{value:"Module"})),le=(e,t)=>{if(e===t)return!0;if(e==null||t==null||typeof e!="object"||typeof t!="object")return!1;let s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(let r of s)if(!i.includes(r)||!le(e[r],t[r]))return!1;return!0},Gi=({dispatchEvent:e,value:t,label:s,index:i,item:r})=>{e(new CustomEvent("value-change",{detail:{value:t,label:s,index:i,item:r},bubbles:!0}))},Ld=e=>{let{store:t,props:s,render:i}=e;if(s.selectedValue!==null&&s.selectedValue!==void 0&&s.options){let r=s.options.find(n=>le(n.value,s.selectedValue));r&&(t.updateSelectedValue({value:r.value}),i())}},Vd=(e,t)=>{let{oldProps:s,newProps:i}=t,{store:r,render:n}=e,o=!1;s.selectedValue!==i.selectedValue&&(r.updateSelectedValue({value:i.selectedValue}),o=!0),o&&n()},Gr=(e,t)=>{let{render:s,dispatchEvent:i,props:r,store:n}=e;if(r.disabled)return;let o=t._event;o.stopPropagation();let p=o.currentTarget.id.slice(6),l=Number(p),a=r.options[l],c=Object.prototype.hasOwnProperty.call(r||{},"selectedValue"),d=n.selectSelectedValue(),h=c?!0:n.selectHasSelectedValue(),f=a?h&&le(a.value,d):!1;if(a){if(f&&!r.noClear){n.clearSelectedValue({}),r.onChange&&typeof r.onChange=="function"&&r.onChange(void 0),Gi({dispatchEvent:i,value:void 0,label:void 0,index:null,item:void 0}),s();return}n.updateSelectedValue({value:a.value}),r.onChange&&typeof r.onChange=="function"&&r.onChange(a.value),Gi({dispatchEvent:i,value:a.value,label:a.label,index:l,item:a}),s()}},Rd=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Gr(e,t))},Nd=(e,t)=>{let{store:s,render:i}=e,r=t._event,n=parseInt(r.currentTarget.id.slice(6),10);s.setHoveredOption({optionId:n}),i()},Dd=e=>{let{store:t,render:s}=e;t.clearHoveredOption({}),s()},Jr=(e,t)=>{if(e.props.disabled)return;let{render:s,dispatchEvent:i}=e,{_event:r}=t;r.stopPropagation(),i(new CustomEvent("add-option-click",{bubbles:!0})),s()},Pd=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Jr(e,t))},jd=e=>{let{store:t,render:s}=e;t.setHoveredAddOption({isHovered:!0}),s()},Bd=e=>{let{store:t,render:s}=e;t.setHoveredAddOption({isHovered:!1}),s()},zd=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:Jr,handleAddOptionKeyDown:Pd,handleAddOptionMouseEnter:jd,handleAddOptionMouseLeave:Bd,handleBeforeMount:Ld,handleOnUpdate:Vd,handleOptionClick:Gr,handleOptionKeyDown:Rd,handleOptionMouseEnter:Nd,handleOptionMouseLeave:Dd},Symbol.toStringTag,{value:"Module"})),Md=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],Wd=(e={})=>Object.entries(e).filter(([t])=>!Md.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Fd=()=>Object.freeze({selectedValue:null,hasSelectedValue:!1,hoveredOptionId:null,hoveredAddOption:!1}),Kd=({state:e,props:t})=>{let s=Wd(t),i=!!t.disabled,r=Object.prototype.hasOwnProperty.call(t||{},"selectedValue"),n=r?t.selectedValue:e.selectedValue,o=r?!0:!!e.hasSelectedValue,p=t.options||[],l=p.map((a,c)=>{let d=o&&le(a.value,n),h=e.hoveredOptionId===c;return{...a,isSelected:d,bgc:d?"ac":h&&!i?"mu":"",textColor:d?"ac-fg":"fg",borderLeftWidth:c===0?"none":"xs",cursor:i?"not-allowed":"pointer",tabIndex:i?-1:0}});return{containerAttrString:s,isDisabled:i,options:l,selectedValue:n,hasSelectedValue:o,ariaLabel:t.placeholder||"Segmented control",showAddOption:!i&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"mu":"",addOptionBorderLeftWidth:p.length===0?"none":"xs"}},Ud=({state:e})=>e,Hd=({state:e})=>e.selectedValue,qd=({state:e})=>!!e.hasSelectedValue,Yd=({state:e},t={})=>{e.selectedValue=t.value,e.hasSelectedValue=!0},Gd=({state:e})=>{e.selectedValue=void 0,e.hasSelectedValue=!1},Jd=({state:e},t={})=>{e.hoveredOptionId=t.optionId},Qd=({state:e})=>{e.hoveredOptionId=null},Zd=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},Xd=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:Qd,clearSelectedValue:Gd,createInitialState:Fd,selectHasSelectedValue:qd,selectSelectedValue:Hd,selectState:Ud,selectViewData:Kd,setHoveredAddOption:Zd,setHoveredOption:Jd,updateSelectedValue:Yd},Symbol.toStringTag,{value:"Module"})),Us=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",ec=(e={})=>{let t=e.searchInput;if(!t)return;typeof t.focus=="function"&&t.focus();let s=t.shadowRoot?.querySelector("input, textarea");s&&typeof s.focus=="function"&&s.focus()},Qr=(e={},t=10)=>{let s=e.popover;if(s?.hasAttribute?.("open")){if(s.hasAttribute("positioned")||t===0){ec(e);return}setTimeout(()=>Qr(e,t-1),16)}},tc=(e={})=>{e?.popover?.refreshContent?.()},sc=(e={})=>e.detail&&Object.prototype.hasOwnProperty.call(e.detail,"value")?e.detail.value:e.currentTarget?.value??"",ic=e=>{let{store:t,props:s,render:i}=e;if(s.selectedValue!==null&&s.selectedValue!==void 0&&s.options){let r=s.options.find(n=>Us(n)==="item"&&le(n.value,s.selectedValue));r&&(t.updateSelectedValue({value:r?.value}),i())}},rc=(e,t)=>{let{oldProps:s,newProps:i}=t,{store:r,render:n,refs:o}=e,p=!1,l=!1;i?.disabled&&!s?.disabled&&(r.closeOptionsPopover({}),p=!0),s.selectedValue!==i.selectedValue&&(r.updateSelectedValue({value:i.selectedValue}),p=!0),s.options!==i.options&&(p=!0,l=!0),s.searchable!==i.searchable&&(r.setSearchQuery?.({query:""}),p=!0,l=!0),(s.searchPlaceholder!==i.searchPlaceholder||s.emptySearchLabel!==i.emptySearchLabel)&&(p=!0,l=!0),p&&(n(),l&&r.selectState?.().isOpen&&tc(o))},Zr=(e,t)=>{let{store:s,render:i,refs:r,props:n}=e;if(n.disabled)return;t._event.stopPropagation();let o=r.selectButton.getBoundingClientRect(),p=s.selectSelectedValue(),l=p!==null?p:n.selectedValue,a=null;l!=null&&n.options&&(a=n.options.findIndex(c=>Us(c)==="item"&&le(c.value,l)),a===-1&&(a=null)),s.openOptionsPopover({position:{y:o.bottom+12,x:o.left-24},selectedIndex:a}),i(),n.searchable&&Qr(r)},nc=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Zr(e,t))},oc=e=>{let{store:t,render:s}=e;t.closeOptionsPopover({}),s()},ac=(e,t)=>{let{store:s,render:i}=e,r=t._event;r.stopPropagation(),s.setSearchQuery({query:sc(r)}),i()},lc=(e,t)=>{let{store:s,render:i}=e,r=t._event;r.stopPropagation(),r.key==="Escape"&&(r.preventDefault(),s.closeOptionsPopover({}),i())},pc=(e,t)=>{let{render:s,dispatchEvent:i,props:r,store:n}=e;if(r.disabled)return;let o=t._event;o.stopPropagation();let p=o.currentTarget.id.slice(6),l=Number(p),a=r.options[p];Us(a)==="item"&&(n.updateSelectedValue({value:a?.value}),r.onChange&&typeof r.onChange=="function"&&r.onChange(a.value),i(new CustomEvent("value-change",{detail:{value:a.value,label:a.label,index:l,item:a},bubbles:!0})),s())},dc=(e,t)=>{let{store:s,render:i}=e,r=t._event,n=parseInt(r.currentTarget.id.slice(6),10);s.setHoveredOption({optionId:n}),i()},cc=(e,t)=>{let{store:s,render:i}=e;s.clearHoveredOption({}),i()},uc=(e,t)=>{let{store:s,render:i,dispatchEvent:r,props:n}=e;n.disabled||(t._event.stopPropagation(),s.clearSelectedValue({}),n.onChange&&typeof n.onChange=="function"&&n.onChange(void 0),r(new CustomEvent("value-change",{detail:{value:void 0,label:void 0,index:null,item:void 0},bubbles:!0})),i())},hc=(e,t)=>{if(e.props.disabled)return;let{store:s,render:i,dispatchEvent:r}=e,{_event:n}=t;n.stopPropagation(),s.closeOptionsPopover({}),r(new CustomEvent("add-option-click",{bubbles:!0})),i()},fc=(e,t)=>{let{store:s,render:i}=e;s.setHoveredAddOption({isHovered:!0}),i()},yc=(e,t)=>{let{store:s,render:i}=e;s.setHoveredAddOption({isHovered:!1}),i()},mc=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:hc,handleAddOptionMouseEnter:fc,handleAddOptionMouseLeave:yc,handleBeforeMount:ic,handleButtonClick:Zr,handleButtonKeyDown:nc,handleClearClick:uc,handleClickOptionsPopoverOverlay:oc,handleOnUpdate:rc,handleOptionClick:pc,handleOptionMouseEnter:dc,handleOptionMouseLeave:cc,handleSearchInput:ac,handleSearchKeyDown:lc},Symbol.toStringTag,{value:"Module"})),gc=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled","searchable","searchPlaceholder","emptySearchLabel"],bc=(e={})=>Object.entries(e).filter(([t])=>!gc.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),vc=(e,t)=>Object.prototype.hasOwnProperty.call(e||{},t),Hs=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Ji=(e={})=>Hs(e)==="item",Xr=(e={})=>typeof e.icon=="string"&&e.icon.length>0?e.icon:"",en=(e={})=>typeof e.shortcut=="string"&&e.shortcut.length>0?e.shortcut:typeof e.suffixText=="string"&&e.suffixText.length>0?e.suffixText:"",tn=e=>e==null?"":String(e).trim().toLowerCase(),Qi=(e={},t="")=>t?String(e.label??"").toLowerCase().includes(t):!0,wc=(e=[])=>{let t=[],s={section:null,entries:[]};return e.forEach((i,r)=>{let n={option:i,index:r,type:Hs(i)};if(n.type==="section"){(s.section||s.entries.length>0)&&t.push(s),s={section:n,entries:[]};return}s.entries.push(n)}),(s.section||s.entries.length>0)&&t.push(s),t},_c=(e=[],t="")=>{let s=tn(t);return s?wc(e).flatMap(i=>{let r=i.section?Qi(i.section.option,s):!1,n=i.entries.map(l=>l.type!=="item"?!1:r||Qi(l.option,s)),o=n.some(Boolean);if(!r&&!o)return[];let p=[];return i.section&&p.push(i.section),i.entries.forEach((l,a)=>{if(l.type==="item"){n[a]&&p.push(l);return}if(l.type!=="separator")return;let c=n.slice(0,a).some(Boolean),d=n.slice(a+1).some(Boolean);c&&d&&p.push(l)}),p.map(({option:l,index:a})=>({option:l,index:a}))}):e.map((i,r)=>({option:i,index:r}))},xc=(e={},t,s,i,r)=>{let n=Hs(e),o=n==="section",p=n==="separator",l=n==="item";if(o)return{...e,index:t,type:n,isSection:o,isSeparator:p,isItem:l};if(p)return{...e,index:t,type:n,isSection:o,isSeparator:p,isItem:l};let a=le(e.value,s),c=i===t,d=Xr(e),h=en(e);return{...e,index:t,type:n,isSection:o,isSeparator:p,isItem:l,isSelected:a,bgc:c?"ac":a?"mu":"",hasIconSlot:r,icon:d,hasIcon:d.length>0,iconColor:"fg",c:"fg",suffixText:h,hasSuffixText:h.length>0,suffixTextColor:"mu-fg"}},Sc=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,hoveredOptionId:null,hoveredAddOption:!1,searchQuery:""}),Ac=({state:e,props:t})=>{let s=bc(t),i=!!t.disabled,r=Object.prototype.hasOwnProperty.call(t||{},"selectedValue")?t.selectedValue:e.selectedValue,n=t.placeholder||"Select an option",o=!0,p=t.options||[],l=p.find(S=>Ji(S)&&le(S.value,r));l&&(n=l.label,o=!1);let a=p.some(S=>Ji(S)&&vc(S,"icon")),c=_c(p,t.searchable?e.searchQuery:""),d=new Set(c.map(({index:S})=>S)),h=p.map((S,A)=>({...xc(S,A,r,e.hoveredOptionId,a),isSearchHidden:!d.has(A)})),f=h.filter(S=>!S.isSearchHidden),u=Xr(l),y=en(l),m=t.searchable?e.searchQuery:"",b=tn(m).length>0,g=f.some(S=>S.isItem),_=!!t.searchable&&b&&!g;return{containerAttrString:s,isDisabled:i,isOpen:e.isOpen,position:e.position,options:f,renderOptions:h,selectedValue:r,selectedLabel:n,selectedLabelColor:o?"mu-fg":"fg",selectedIcon:u,hasSelectedIcon:u.length>0,selectedIconColor:o?"mu-fg":"fg",selectedSuffixText:y,hasSelectedSuffixText:y.length>0,selectedSuffixTextColor:"mu-fg",selectButtonCursor:i?"not-allowed":"pointer",selectButtonHoverBorderColor:i?"bo":"ac",selectButtonTabIndex:i?-1:0,hasValue:r!=null,showClear:!i&&!t.noClear&&r!=null,showAddOption:!i&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"ac":"",showSearch:!i&&!!t.searchable,searchQuery:m,searchPlaceholder:t.searchPlaceholder||"Search options",showEmptySearch:_,hideEmptySearch:!_,emptySearchLabel:t.emptySearchLabel||"No matching options"}},Ec=({state:e})=>e,kc=({state:e})=>e.selectedValue,$c=({state:e},t={})=>{let{position:s,selectedIndex:i}=t;e.position=s,e.isOpen=!0,e.searchQuery="",i!=null&&(e.hoveredOptionId=i)},Cc=({state:e})=>{e.isOpen=!1,e.searchQuery=""},Ic=({state:e},t={})=>{e.selectedValue=t.value,e.isOpen=!1,e.searchQuery=""},Oc=({state:e})=>{e.selectedValue=void 0},Tc=({state:e},t={})=>{e.hoveredOptionId=t.optionId},Lc=({state:e})=>{e.hoveredOptionId=null},Vc=({state:e})=>{e.selectedValue=void 0},Rc=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},Nc=({state:e},t={})=>{e.searchQuery=t.query===void 0||t.query===null?"":String(t.query),e.hoveredOptionId=null},Dc=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:Lc,clearSelectedValue:Vc,closeOptionsPopover:Cc,createInitialState:Sc,openOptionsPopover:$c,resetSelection:Oc,selectSelectedValue:kc,selectState:Ec,selectViewData:Ac,setHoveredAddOption:Rc,setHoveredOption:Tc,setSearchQuery:Nc,updateSelectedValue:Ic},Symbol.toStringTag,{value:"Module"})),Zi=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},Pc=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?Zi(e.tooltip):Zi(e.showCompactTooltip),jc=(e,t)=>{let{store:s,dispatchEvent:i}=e,r=t._event,n,o=s.selectHeader();r.currentTarget.id==="headerLabel"?n=o.labelPath:r.currentTarget.id==="headerImage"?n=o.image.path:r.currentTarget.id==="header"&&(n=o.path),i(new CustomEvent("header-click",{detail:{path:n},bubbles:!0,composed:!0}))},Bc=(e,t)=>{let{store:s,dispatchEvent:i,render:r}=e,n=t._event,o=n.currentTarget.dataset.itemId||n.currentTarget.id.slice(4),p=s.selectItem(o);s.hideTooltip({}),r(),i(new CustomEvent("item-click",{detail:{item:p},bubbles:!0,composed:!0}))},zc=(e,t)=>{let{props:s,store:i,render:r}=e;if(!Pc(s)||(s.mode||"full")==="full")return;let n=t._event,o=n.currentTarget.dataset.itemId||n.currentTarget.id.slice(4),p=i.selectItem(o);if(!p||p.type==="groupLabel")return;let l=n.currentTarget.getBoundingClientRect(),a=p.tooltip||p.label||p.title;a&&(i.showTooltip({x:l.right,y:l.top+l.height/2,place:"r",content:a}),r())},Mc=e=>{let{store:t,render:s}=e;t.hideTooltip({}),s()},Wc=Object.freeze(Object.defineProperty({__proto__:null,handleHeaderClick:jc,handleItemClick:Bc,handleItemMouseEnter:zc,handleItemMouseLeave:Mc},Symbol.toStringTag,{value:"Module"})),Fc=()=>Object.freeze({tooltipState:{open:!1,x:0,y:0,place:"r",content:""}}),Kc=["id","class","style","slot","header","items","selectedItemId","mode","hideHeader","tooltip","showCompactTooltip","w","bwr"],Uc=(e={})=>Object.entries(e).filter(([t])=>!Kc.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),st=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}}}},xs=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},Hc=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?xs(e.tooltip):xs(e.showCompactTooltip),qc=(e,t)=>e!=null&&e!==""?e:t==="full"?272:64,Xi=(e={})=>e.label!==void 0&&e.label!==null?e.label:e.title!==void 0&&e.title!==null?e.title:"";function qs(e,t=null){let s=[];for(let i of e){let r=i.id||i.href||i.path,n=r!=null&&t===r,o=Xi(i);if(s.push({id:r,label:o,title:i.title??o,href:i.href,type:i.type||"item",icon:i.icon,testId:i.testId,tooltip:i.tooltip,path:i.path,hrefAttr:i.href?`href=${i.href}`:"",isSelected:n,itemBgc:n?"ac":"bg",itemHoverBgc:n?"ac":"mu"}),i.items&&Array.isArray(i.items))for(let p of i.items){let l=p.id||p.href||p.path,a=l!=null&&t===l,c=Xi(p);s.push({id:l,label:c,title:p.title??c,href:p.href,type:p.type||"item",icon:p.icon,testId:p.testId,tooltip:p.tooltip,path:p.path,hrefAttr:p.href?`href=${p.href}`:"",isSelected:a,itemBgc:a?"ac":"bg",itemHoverBgc:a?"ac":"mu"})}}return s}var Yc=({state:e,props:t})=>{let s=st(t.header)||t.header,i=st(t.items)||t.items,r=t.selectedItemId,n=Uc(t),o=t.mode||"full",p=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},l=i?qs(i,r):[],a=!xs(t.hideHeader),c=Hc(t),d=t.bwr||"xs",h=qc(t.w,o),f=o==="full"?"fs":"c",u=o==="full"?"fs":"c",y=o==="full"?"lg":"sm",m=o==="full"?"md":"sm",b=o==="shrunk-lg"?48:40,g=o==="shrunk-lg"?28:20,_=o==="shrunk-lg"?"md":"sm",S=o==="full",A=o==="full",E=c&&!S,C=o==="full"?"fs":"c",I=o==="full"?"":`ah=${u}`,V=o==="full"?"f":b;return{containerAttrString:n,mode:o,header:p,items:l,sidebarWidth:h,headerAlign:f,itemAlign:u,headerPadding:y,itemPadding:m,itemHeight:b,iconSize:g,firstLetterSize:_,showLabels:S,showGroupLabels:A,itemContentAlign:C,itemAlignAttr:I,itemWidth:V,headerWidth:V,selectedItemId:r,ah:o==="shrunk-lg"||o==="shrunk-md"?"c":"",listAttrString:o==="full"?"d=v sv":"d=v sv hsb",showHeader:a,enableCompactTooltip:E,rightBorderWidth:d,tooltipState:e.tooltipState||{open:!1,x:0,y:0,place:"r",content:""}}},Gc=({props:e})=>st(e.header)||e.header,Jc=({state:e,props:t})=>{let s=st(t.items)||t.items;return(s?qs(s):[]).find(i=>i.active)},Qc=({props:e},t)=>{let s=st(e.items)||e.items;return(s?qs(s):[]).find(i=>i.id===t)},Zc=({state:e})=>{},Xc=({state:e},t={})=>{let{x:s,y:i,place:r="r",content:n=""}=t;e.tooltipState={open:!0,x:s,y:i,place:r,content:n}},eu=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},tu=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Fc,hideTooltip:eu,selectActiveItem:Jc,selectHeader:Gc,selectItem:Qc,selectViewData:Yc,setState:Zc,showTooltip:Xc},Symbol.toStringTag,{value:"Module"})),su=e=>{let{store:t,props:s}=e;t.setValue({value:s.value??0})},iu=(e,t)=>{let{oldProps:s,newProps:i}=t,{store:r,render:n}=e,o=s?.key!==i?.key,p=s?.value!==i?.value;if(o||p){let l=i?.value??0;r.setValue({value:l}),n()}},ru=(e,t)=>{let{store:s,render:i,dispatchEvent:r}=e,n=t._event,o=Number(n.detail.value),p=(typeof n.composedPath=="function"?n.composedPath():[]).find(l=>l?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;s.setValue({value:o}),p&&typeof p.setAttribute=="function"&&p.setAttribute("value",String(o)),i(),r(new CustomEvent("value-change",{detail:{value:o},bubbles:!0}))},nu=(e,t)=>{let{store:s,render:i,dispatchEvent:r}=e,n=t._event,o=Number(n.detail.value),p=(typeof n.composedPath=="function"?n.composedPath():[]).find(l=>l?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;s.setValue({value:o}),p&&typeof p.setAttribute=="function"&&p.setAttribute("value",String(o)),i(),r(new CustomEvent("value-input",{detail:{value:o},bubbles:!0}))},ou=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:su,handleOnUpdate:iu,handleValueChange:ru,handleValueInput:nu},Symbol.toStringTag,{value:"Module"})),au=()=>Object.freeze({value:0}),lu=({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}),pu=({state:e},t={})=>{e.value=t.value},du=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:au,selectViewData:lu,setValue:pu},Symbol.toStringTag,{value:"Module"})),cu=e=>{},uu=(e,t)=>{let{dispatchEvent:s,props:i}=e,r=t._event,n=parseInt(r.currentTarget.id.slice(3),10),o=i.data?.rows?.[n];o&&s(new CustomEvent("row-click",{detail:{rowIndex:n,rowData:o}}))},hu=(e,t)=>{let{store:s,render:i,dispatchEvent:r}=e,n=t._event.currentTarget.dataset.columnKey,o=s.selectSortInfo(),p="asc";o.column===n&&(o.direction==="asc"?p="desc":o.direction==="desc"&&(p=null)),p?s.setSortColumn({column:n,direction:p}):s.clearSort(),i(),r(new CustomEvent("header-click",{detail:{column:n,direction:p,sortInfo:p?{column:n,direction:p}:null}}))},fu=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:cu,handleHeaderClick:hu,handleRowClick:uu},Symbol.toStringTag,{value:"Module"})),yu=()=>Object.freeze({sortColumn:null,sortDirection:null}),mu=["id","class","style","slot","data"],gu=(e={})=>Object.entries(e).filter(([t])=>!mu.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),bu=(e,t)=>{let s=t.split("."),i=e;for(let r of s){if(i==null)return null;i=i[r]}return i},vu=({state:e,props:t})=>{let s=gu(t),i=t.data||{columns:[],rows:[]},r=i.rows.map((n,o)=>{let p=i.columns.map(l=>{let a=bu(n,l.key);return{key:l.key,value:a!=null?String(a):""}});return{index:o,cells:p}});return{containerAttrString:s,columns:i.columns||[],rows:r||[]}},wu=({state:e})=>e,_u=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),xu=({state:e},{column:t,direction:s}={})=>{e.sortColumn=t,e.sortDirection=s},Su=({state:e})=>{e.sortColumn=null,e.sortDirection=null},Au=Object.freeze(Object.defineProperty({__proto__:null,clearSort:Su,createInitialState:yu,selectSortInfo:_u,selectState:wu,selectViewData:vu,setSortColumn:xu},Symbol.toStringTag,{value:"Module"})),Eu=(e,t)=>{let{dispatchEvent:s}=e,i=t._event.currentTarget.dataset.id;s(new CustomEvent("item-click",{detail:{id:i}}))},ku=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:Eu},Symbol.toStringTag,{value:"Module"})),$u=()=>Object.freeze({}),Cu=["id","class","style","slot","items","selectedTab"],Iu=(e={})=>Object.entries(e).filter(([t])=>!Cu.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Ou=({props:e})=>{let t=Iu(e),s=e.items||[],i=e.selectedTab,r=s.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:r,selectedTab:i}},Tu=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:$u,selectViewData:Ou},Symbol.toStringTag,{value:"Module"})),Lu=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",sn=e=>Array.isArray(e)?[...e]:[],rn=e=>{if(!e||typeof e.getBoundingClientRect!="function")return;let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.bottom+12),w:Math.max(Math.round(t.width),240)}},Ss=({store:e,props:t})=>e.selectHasSelectedValues()?e.selectSelectedValues():sn(t.selectedValues),nn=({store:e,props:t})=>Array.isArray(t?.draftSelectedValues)?sn(t.draftSelectedValues):e.getState().isOpen?e.selectDraftSelectedValues():Ss({store:e,props:t}),Vu=({dispatchEvent:e,value:t,operation:s,changedValue:i,label:r,index:n,item:o})=>{e(new CustomEvent("value-change",{detail:{value:t,operation:s,changedValue:i,label:r,index:n,item:o},bubbles:!0}))},Ru=({dispatchEvent:e,value:t})=>{e(new CustomEvent("draft-value-change",{detail:{value:t},bubbles:!0}))},ze=({dispatchEvent:e,open:t})=>{e(new CustomEvent("open-change",{detail:{open:t},bubbles:!0}))},Ys=({store:e,props:t,refs:s}={})=>{let i=rn(s?.trigger);return i?(e.openOptionsPopover({position:i,values:nn({store:e,props:t})}),!0):!1},Nu=e=>{let{store:t,props:s,render:i,refs:r}=e,n=!1;s.selectedValues!==void 0&&(t.updateSelectedValues({values:s.selectedValues,syncDraft:s.draftSelectedValues===void 0,preserveDraft:Array.isArray(s.draftSelectedValues)}),n=!0),Array.isArray(s.draftSelectedValues)&&(t.updateDraftSelectedValues({values:s.draftSelectedValues}),n=!0),s.open===!0&&!s.disabled&&Ys(e)&&(n=!0),n&&i()},Du=e=>{let{props:t,render:s,store:i,dispatchEvent:r}=e;if(t.disabled){t.open===!0&&ze({dispatchEvent:r,open:!1});return}t.open===!0&&!i.getState().isOpen&&Ys(e)&&s()},Pu=(e,t)=>{let{oldProps:s,newProps:i}=t,{store:r,render:n,refs:o}=e,p=!1;if(i?.disabled&&!s?.disabled){let l=r.getState().isOpen;r.closeOptionsPopover({}),l&&ze({dispatchEvent:e.dispatchEvent,open:!1}),p=!0}if(s.selectedValues!==i.selectedValues&&(r.updateSelectedValues({values:i.selectedValues,syncDraft:i.draftSelectedValues===void 0,preserveDraft:Array.isArray(i.draftSelectedValues)}),p=!0),s.draftSelectedValues!==i.draftSelectedValues&&(r.updateDraftSelectedValues({values:Array.isArray(i?.draftSelectedValues)?i.draftSelectedValues:Ss({store:r,props:i})}),p=!0),s.open!==i.open&&i.open!==void 0&&(i.open?i.disabled?ze({dispatchEvent:e.dispatchEvent,open:!1}):Ys({store:r,props:i,refs:o})&&(p=!0):(r.closeOptionsPopover({}),p=!0)),s.options!==i.options){let l=Ss({store:r,props:i}).length>0;(r.getState().isOpen||l)&&(p=!0)}p&&n()},on=(e,t)=>{let{store:s,render:i,refs:r,props:n,dispatchEvent:o}=e;if(n.disabled)return;t._event.stopPropagation();let p=rn(r.trigger);p&&(s.openOptionsPopover({position:p,values:nn({store:s,props:n})}),ze({dispatchEvent:o,open:!0}),i())},ju=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),on(e,t))},Bu=e=>{let{store:t,render:s,dispatchEvent:i}=e;t.closeOptionsPopover({}),ze({dispatchEvent:i,open:!1}),s()},an=(e,t)=>{let{render:s,props:i,store:r,dispatchEvent:n}=e;if(i.disabled)return;let o=t._event;o.stopPropagation();let p=o.currentTarget.id.slice(6),l=Number(p),a=i.options[l];!a||Lu(a)!=="item"||(r.toggleDraftSelectedValue({value:a.value}),Ru({dispatchEvent:n,value:r.selectDraftSelectedValues()}),s())},zu=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),an(e,t))},Mu=(e,t)=>{let{store:s,props:i,render:r,dispatchEvent:n}=e;if(i.disabled)return;t._event.stopPropagation();let o=s.selectDraftSelectedValues();s.commitDraftSelectedValues({}),i.onChange&&typeof i.onChange=="function"&&i.onChange(o),Vu({dispatchEvent:n,value:o,operation:"set",changedValue:void 0,label:void 0,index:null,item:void 0}),ze({dispatchEvent:n,open:!1}),r()},Wu=(e,t)=>{let{props:s,dispatchEvent:i}=e;s.disabled||s.noAdd||(t._event.stopPropagation(),i(new CustomEvent("add-option-click",{bubbles:!0,composed:!0})))},Fu=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:Wu,handleAfterMount:Du,handleBeforeMount:Nu,handleOnUpdate:Pu,handleOptionClick:an,handleOptionKeyDown:zu,handlePopoverClose:Bu,handleSubmitClick:Mu,handleTriggerClick:on,handleTriggerKeyDown:ju},Symbol.toStringTag,{value:"Module"})),ln=e=>{if(!e||typeof e.getBoundingClientRect!="function")return null;let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.bottom+12),w:Math.max(Math.round(t.width),240)}},Tt=e=>Array.isArray(e)?[...e]:[],xt=e=>{typeof e.render=="function"&&e.render()},pn=e=>e.store?.selectHasSelectedValues?.()?e.store?.selectSelectedValues?.()||[]:Tt(e.props?.selectedValues),Gs=(e,t=[])=>{let s=ln(e.refs?.trigger);return!s||!e.store?.openOptionsPopover?!1:(e.store.openOptionsPopover({position:s,values:t}),!0)},dn=(e,t=[],s=!1)=>e.store?.getState?.()?.isOpen&&e.store?.updateDraftSelectedValues?(e.store.updateDraftSelectedValues({values:t}),!0):s?Gs(e,t):!1,Ku=function(e={}){let t=this.store?.getState?.(),s=Array.isArray(e.values)?Tt(e.values):this.store?.selectDraftSelectedValues?.()||[];if(t?.isOpen){let i=ln(this.refs?.trigger);i&&this.store.openOptionsPopover({position:i,values:s})}else e.keepOpen&&Gs(this,s.length>0?s:pn(this));xt(this)},Uu=function(e={}){let t=Tt(e.values);dn(this,t,!!e.keepOpen)&&xt(this)},Hu=function(e={}){if(!Object.prototype.hasOwnProperty.call(e||{},"value"))return;let t=this.store?.getState?.(),s=t?.isOpen?this.store?.selectDraftSelectedValues?.()||[]:pn(this);if(s.some(r=>le(r,e.value))){e.keepOpen&&!t?.isOpen&&Gs(this,s)&&xt(this);return}let i=[...Tt(s),e.value];dn(this,i,!!e.keepOpen)&&xt(this)},qu=Object.freeze(Object.defineProperty({__proto__:null,appendDraftSelectedValue:Hu,refreshPopover:Ku,setDraftSelectedValues:Uu},Symbol.toStringTag,{value:"Module"})),Yu=["id","class","style","slot","placeholder","options","open","selectedValues","draftSelectedValues","onChange","addOption","noAdd","disabled"],Gu=(e={})=>Object.entries(e).filter(([t])=>!Yu.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Ju=(e,t)=>Object.prototype.hasOwnProperty.call(e||{},t),cn=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",un=(e={})=>cn(e)==="item",hn=(e={})=>typeof e.icon=="string"&&e.icon.length>0?e.icon:"",Qu=(e={})=>typeof e.shortcut=="string"&&e.shortcut.length>0?e.shortcut:typeof e.suffixText=="string"&&e.suffixText.length>0?e.suffixText:"",ye=e=>Array.isArray(e)?[...e]:[],Zu=(e=[],t=[])=>e.length!==t.length?!1:e.every((s,i)=>le(s,t[i])),Xu=(e=[],t)=>e.some(s=>le(s,t)),fn=({state:e,props:t})=>e.hasSelectedValues?ye(e.selectedValues):ye(t.selectedValues),eh=({state:e,props:t})=>e.isOpen?ye(e.draftSelectedValues):fn({state:e,props:t}),th=e=>e==null?"":String(e),sh=(e=[],t)=>e.find(s=>un(s)&&le(s.value,t)),As=({isSelected:e=!0,isAddChip:t=!1}={})=>{let s=["--tag-border-radius: var(--border-radius-md)","--muted-foreground: var(--foreground)"];return(t||!e)&&s.push("--muted: color-mix(in srgb, var(--muted) 82%, var(--background) 18%)"),`${s.join("; ")};`},ih=({option:e={},index:t,selectedValues:s=[],hasIconColumn:i=!1})=>{let r=cn(e),n=r==="section",o=r==="separator",p=r==="item";if(n||o)return{...e,index:t,type:r,isSection:n,isSeparator:o,isItem:p};let l=Xu(s,e.value),a=hn(e),c=Qu(e),d=l?c||"Added":c;return{...e,index:t,type:r,isSection:n,isSeparator:o,isItem:p,isSelected:l,hasIconSlot:i,icon:a,hasIcon:a.length>0,cursor:"pointer",tagStyle:As({isSelected:l}),suffixText:d,hasSuffixText:d.length>0}},rh=()=>Object.freeze({isOpen:!1,position:{x:0,y:0,w:240},selectedValues:[],draftSelectedValues:[],hasSelectedValues:!1}),nh=({state:e,props:t})=>{let s=Gu(t),i=!!t.disabled,r=fn({state:e,props:t}),n=eh({state:e,props:t}),o=(e.isOpen||r.length>0)&&Array.isArray(t.options)?t.options:[],p=o.some(f=>un(f)&&Ju(f,"icon")),l=o.map((f,u)=>ih({option:f,index:u,selectedValues:n,hasIconColumn:p})),a=r.map((f,u)=>{let y=sh(o,f),m=y?hn(y):"";return{value:f,selectionIndex:u,label:y?.label||th(f),icon:m,hasIcon:m.length>0,testId:`tag-select-tag-${u}`}}),c=l.some(f=>f.isItem),d=!Zu(r,n),h=a.length>0?a.map(f=>({...f,tagStyle:As({isSelected:!0})})):[{value:void 0,selectionIndex:"",label:t.placeholder||"Add tag",icon:"",testId:"",tagStyle:As({isAddChip:!0})}];return{containerAttrString:s,isDisabled:i,isOpen:e.isOpen,position:e.position,options:l,hasSelectableOptions:c,placeholder:t.placeholder||"Add tag",triggerTags:h,triggerCursor:i?"not-allowed":"pointer",triggerTabIndex:i?-1:0,showAddOption:!i&&!t.noAdd,addOptionLabel:t.addOption?.label||"Add tag",hasDraftChanges:d,submitDisabled:i,submitLabel:"Save"}},oh=({state:e})=>ye(e.selectedValues),ah=({state:e})=>!!e.hasSelectedValues,lh=({state:e})=>ye(e.draftSelectedValues),ph=({state:e},t={})=>{let{position:s,values:i}=t;e.position={...e.position,...s||{}},e.draftSelectedValues=ye(i),e.isOpen=!0},dh=({state:e})=>{e.isOpen=!1,e.draftSelectedValues=[]},ch=({state:e},t={})=>{e.draftSelectedValues=ye(t.values)},uh=({state:e},t={})=>{let s=ye(t.values);e.selectedValues=s,e.hasSelectedValues=!0,(t.syncDraft||!e.isOpen)&&!t.preserveDraft&&(e.draftSelectedValues=[...s])},hh=({state:e},t={})=>{let s=ye(e.draftSelectedValues),i=t.value,r=s.findIndex(n=>le(n,i));if(r>=0){e.draftSelectedValues=s.filter((n,o)=>o!==r);return}e.draftSelectedValues=[...s,i]},fh=({state:e})=>{e.selectedValues=ye(e.draftSelectedValues),e.hasSelectedValues=!0,e.isOpen=!1,e.draftSelectedValues=[]},yh=Object.freeze(Object.defineProperty({__proto__:null,closeOptionsPopover:dh,commitDraftSelectedValues:fh,createInitialState:rh,openOptionsPopover:ph,selectDraftSelectedValues:lh,selectHasSelectedValues:ah,selectSelectedValues:oh,selectViewData:nh,toggleDraftSelectedValue:hh,updateDraftSelectedValues:ch,updateSelectedValues:uh},Symbol.toStringTag,{value:"Module"})),mh=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),gh=()=>Object.freeze({}),er={sm:{textSize:"sm",padding:"md",maxWidth:"min(320px, calc(100vw - 16px))"},md:{textSize:"sm",padding:"md",maxWidth:"min(360px, calc(100vw - 16px))"},lg:{textSize:"md",padding:"lg",maxWidth:"min(420px, calc(100vw - 16px))"}},bh=({props:e})=>{let t=er[e.s]?e.s:"sm",s=er[t];return{open:!!e.open,x:e.x||0,y:e.y||0,place:e.place||"t",content:e.content||"",textSize:s.textSize,padding:s.padding,contentStyle:`padding: 0; min-width: 0; max-width: ${s.maxWidth};`}},vh=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:gh,selectViewData:bh},Symbol.toStringTag,{value:"Module"})),wh=async e=>{let{props:t,store:s,render:i,refs:r}=e,{waveformData:n}=t;s.setWaveformData({data:n}),i();let o=r.canvas;o&&yn(n,o)},_h=async(e,t)=>{let{store:s,render:i,refs:r,props:n}=e,{waveformData:o}=n;if(!o){console.log("waveform handleOnUpdate: no waveformData provided");return}s.setWaveformData({data:o}),i();let p=r.canvas;p&&yn(o,p)};async function yn(e,t){let s=t.getContext("2d"),i=t.getBoundingClientRect(),r=i.width,n=i.height;t.width=r,t.height=n;let o=t.width,p=t.height;if(s.clearRect(0,0,o,p),s.fillStyle="#1a1a1a",s.fillRect(0,0,o,p),!e||!e.amplitudes)return;let l=e.amplitudes,a=p/2,c=s.createLinearGradient(0,0,0,p);c.addColorStop(0,"#404040"),c.addColorStop(.5,"#A1A1A1"),c.addColorStop(1,"#404040");let d=Math.max(1,o/l.length),h=.2;for(let f=0;f<l.length;f++){let u=l[f]/255*(p*.85),y=f*d,m=a-u/2;s.fillStyle=c,s.fillRect(y,m,Math.max(1,d*(1-h)),u)}s.strokeStyle="rgba(255, 255, 255, 0.1)",s.lineWidth=1,s.beginPath(),s.moveTo(0,a),s.lineTo(o,a),s.stroke(),s.shadowBlur=10,s.shadowColor="#2196F3"}var xh=Object.freeze(Object.defineProperty({__proto__:null,handleAfterMount:wh,handleOnUpdate:_h},Symbol.toStringTag,{value:"Module"})),Sh=()=>Object.freeze({waveformData:null}),Ah=({state:e},t={})=>{e.waveformData=t.data},Eh=({state:e,props:t})=>({isLoading:t.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:t.waveformData}),kh=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Sh,selectViewData:Eh,setWaveformData:Ah},Symbol.toStringTag,{value:"Module"})),mn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),gn=e=>e.replace(/-([a-z0-9])/g,(t,s)=>s.toUpperCase()),Es=e=>{if(e!=null)return e===""?!0:e},St=(e,t)=>{let s=e.getAttribute(t);if(s!==null)return Es(s);let i=mn(t);if(i!==t){let r=e.getAttribute(i);if(r!==null)return Es(r)}},hs=Symbol("rtglReactivePropValues"),fs=Symbol("rtglNativeHostStyle"),$h=(e,t)=>{let s=Object.getPrototypeOf(e);for(;s;){let i=Object.getOwnPropertyDescriptor(s,t);if(i)return i;s=Object.getPrototypeOf(s)}},bn=e=>{if(!e||typeof e!="object")return;if(Object.prototype.hasOwnProperty.call(e,fs))return e[fs];let t=$h(e,"style"),s;return typeof t?.get=="function"?s=t.get.call(e):e.style&&typeof e.style=="object"&&(s=e.style),s&&typeof s=="object"&&Object.defineProperty(e,fs,{value:s,enumerable:!1,configurable:!1,writable:!1}),s},Ch=e=>(Object.prototype.hasOwnProperty.call(e,hs)||Object.defineProperty(e,hs,{value:Object.create(null),enumerable:!1,configurable:!1,writable:!1}),e[hs]),Ih=({source:e,allowedKeys:t=[],onPropChange:s})=>{let i=Ch(e);t.includes("style")&&bn(e),t.forEach(r=>{if(typeof r!="string"||r.length===0)return;let n=Object.prototype.hasOwnProperty.call(e,r)?e[r]:void 0,o=Object.prototype.hasOwnProperty.call(e,r);o&&delete e[r],Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get(){return Object.prototype.hasOwnProperty.call(i,r)?i[r]:St(e,r)},set(p){let l=Object.prototype.hasOwnProperty.call(i,r)?i[r]:St(e,r);p===void 0?delete i[r]:i[r]=p,l!==p&&s?.({propName:r,oldValue:l,newValue:p})}}),o&&(i[r]=n)})},Oh=(e,t)=>{let s=new Set(t);return new Proxy({},{get(i,r){if(typeof r=="string"&&s.has(r)){let n=e[r];return n!==void 0?n:St(e,r)}},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,r){return typeof r=="string"&&s.has(r)},ownKeys(){return[...s]},getOwnPropertyDescriptor(i,r){if(typeof r=="string"&&s.has(r))return{configurable:!0,enumerable:!0,get:()=>{let n=e[r];return n!==void 0?n:St(e,r)}}}})},Th=({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 s=e.methods;if(!s||typeof s!="object"||Array.isArray(s))throw new Error("methods must be an object schema with a properties map.");if(Object.prototype.hasOwnProperty.call(s,"type")&&s.type!=="object")throw new Error("methods.type must be 'object'.");if(!s.properties||typeof s.properties!="object"||Array.isArray(s.properties))throw new Error("methods.properties must be an object keyed by method name.");for(let i of Object.keys(s.properties))if(!t.includes(i))throw new Error(`method '${i}' is declared in schema but missing in .methods.js exports.`)}return!0},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},j={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},ks={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"}},tr=e=>{if(!e||e.trim()==="")throw new k("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let s=e.includes("===")?"==":"!=";throw new k(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${s}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let s of t)if(e.trim().endsWith(s))throw new k(`Incomplete comparison expression - missing right operand (got: '${e}')`)},Lh=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,s]=e.split(" in ");if(!s||s.trim()==="")throw new k(`Missing iterable expression after 'in' (got: '$for ${e}')`);let i=t.includes(",")?t.split(",").map(r=>r.trim()):[t.trim()];for(let r of i){if(!r)throw new k(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(r))throw new k(`Invalid loop syntax (got: '$for ${e}')`)}},Vh=(e,t,s=!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 s?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}'`)},Rh=(e,t)=>{let s=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new ie(`Unknown function '${e}' (${s})`)},vn=(e,t,s={})=>{let i={},r={};s&&typeof s=="object"&&(s.functions!==void 0||s.partials!==void 0?(i=s.functions||{},r=s.partials||{}):typeof s=="object"&&(i=s));let n=N(e,{functions:i,partials:r},t,{});return n===void 0?{}:n},N=(e,t,s,i)=>{if(t.functions,e.var&&!e.type)return H(e.var,s,i);if(e.type===v.LITERAL)return e.value;if(e.type===v.VARIABLE)return H(e.path,s,i);if(e.type===v.INTERPOLATION)return Dh(e.parts,t,s,i);switch(e.type){case v.FUNCTION:return wn(e,t,s,i);case v.BINARY:return _n(e,t,s,i);case v.UNARY:return xn(e,t,s,i);case v.CONDITIONAL:return jh(e,t,s,i);case v.LOOP:return Fh(e,t,s,i);case v.OBJECT:return Uh(e,t,s,i);case v.ARRAY:return Hh(e,t,s,i);case v.PARTIAL:return qh(e,t,s,i);case v.PATH_REFERENCE:return Yh(e,t,s,i);default:throw new Error(`Unknown node type: ${e.type}`)}},sr=new Map,Nh=e=>{let t=[],s="",i=!1;for(let r=0;r<e.length;r++){let n=e[r];if(n==="[")s&&(t.push({type:"property",value:s}),s=""),i=!0;else if(n==="]"){if(i&&s){let o=s.trim();if(/^\d+$/.test(o))t.push({type:"index",value:parseInt(o,10)});else if(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'")){let p=o.slice(1,-1);t.push({type:"property",value:p})}else t.push({type:"property",value:o});s=""}i=!1}else s+=n}return s&&t.push({type:"property",value:s}),t},H=(e,t,s)=>{if(!e)return;if(e in s)return s[e];let i=sr.get(e);if(!i){let n=[],o="",p=0;for(let l=0;l<e.length;l++){let a=e[l];a==="["?(p++,o+=a):a==="]"?(p--,o+=a):a==="."&&p===0?o&&(n.push(o),o=""):o+=a}o&&n.push(o),i=[];for(let l of n){let a=Nh(l.trim());i.push(...a)}sr.set(e,i)}let r=t;for(let n=0;n<i.length;n++){let o=i[n];if(o.type==="property"&&o.value in s){r=s[o.value];continue}if(r==null)return;(o.type==="property"||o.type==="index")&&(r=r[o.value])}return r},Dh=(e,t,s,i)=>{let r=[];for(let n of e)if(typeof n=="string")r.push(n);else{let o=N(n,t,s,i);r.push(o!=null?String(o):"")}return r.join("")},wn=(e,t,s,i)=>{let r=t.functions||t,n=r[e.name];if(!n)throw Rh(e.name,r);let o=e.args.map(p=>N(p,t,s,i));return n(...o)},Me=(e,t,s,i)=>{if(e.var&&!e.type)return H(e.var,s,i);switch(e.type){case v.VARIABLE:return H(e.path,s,i);case v.LITERAL:return e.value;case v.BINARY:return _n(e,t,s,i);case v.UNARY:return xn(e,t,s,i);case v.FUNCTION:return wn(e,t,s,i);default:return N(e,t,s,i)}},_n=(e,t,s,i)=>{if(e.op===j.AND||e.op===j.OR){let o=Me(e.left,t,s,i),p=Me(e.right,t,s,i);switch(e.op){case j.AND:return o&&p;case j.OR:return o||p}}let r=N(e.left,t,s,i),n=N(e.right,t,s,i);switch(e.op){case j.EQ:return r==n;case j.NEQ:return r!=n;case j.GT:return r>n;case j.LT:return r<n;case j.GTE:return r>=n;case j.LTE:return r<=n;case j.IN:return Array.isArray(n)?n.includes(r):!1;case j.ADD:if(typeof r!="number"||typeof n!="number")throw new ie(`Arithmetic operations require numbers. Got ${typeof r} + ${typeof n}`);return r+n;case j.SUBTRACT:if(typeof r!="number"||typeof n!="number")throw new ie(`Arithmetic operations require numbers. Got ${typeof r} - ${typeof n}`);return r-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},xn=(e,t,s,i)=>{let r=e.op===ks.NOT?Me(e.operand,t,s,i):N(e.operand,t,s,i);switch(e.op){case ks.NOT:return!r;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Ph=(e,t,s,i)=>{if(e.conditions.length===2&&e.conditions[1]===null){let r=e.conditions[0];if(r.type===v.VARIABLE)if(H(r.path,s,i)){let n=e.bodies[0];if(n.type===v.OBJECT&&n.properties.length<=5){let o={};for(let p of n.properties){let l=p.parsedKey?N(p.parsedKey,t,s,i):p.key,a=p.value;if(a.type===v.LITERAL)o[l]=a.value;else if(a.type===v.VARIABLE)o[l]=H(a.path,s,i);else if(a.type===v.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let h=H(d.path,s,i);c.push(h!=null?String(h):"")}else{let h=N(d,t,s,i);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=N(a,t,s,i)}return o}}else{let n=e.bodies[1];if(n.type===v.OBJECT&&n.properties.length<=5){let o={};for(let p of n.properties){let l=p.parsedKey?N(p.parsedKey,t,s,i):p.key,a=p.value;if(a.type===v.LITERAL)o[l]=a.value;else if(a.type===v.VARIABLE)o[l]=H(a.path,s,i);else if(a.type===v.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let h=H(d.path,s,i);c.push(h!=null?String(h):"")}else{let h=N(d,t,s,i);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=N(a,t,s,i)}return o}}}return null},jh=(e,t,s,i)=>{let r=Ph(e,t,s,i);if(r!==null)return r;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||Me(o,t,s,i))return N(e.bodies[n],t,s,i)}return Sn},Bh=(e,t)=>{let s=e.body,i=e.itemVar;if(s.type===v.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===v.VARIABLE){let r=s.conditions[0].path,n=s.bodies[0];if(r.startsWith(i+".")){let o=r.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 a=t[l];if(a[o]){let c={};for(let d of n.properties){let h=d.key,f=d.value;if(f.type===v.LITERAL)c[h]=f.value;else if(f.type===v.VARIABLE){let u=f.path;if(u===i)c[h]=a;else if(u.startsWith(i+".")){let y=u.substring(i.length+1);c[h]=a[y]}else return null}else if(f.type===v.INTERPOLATION){let u=[],y=!0;for(let m of f.parts)if(typeof m=="string")u.push(m);else if(m.type===v.VARIABLE){let b=m.path;if(b===i)u.push(a!=null?String(a):"");else if(b.startsWith(i+".")){let g=b.substring(i.length+1),_=a[g];u.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[h]=u.join("")}else return null}p.push(c)}}return p}}}return null},zh=(e,t)=>{let s=e.body,i=e.itemVar,r=Bh(e,t);if(r!==null)return r;if(s.type===v.OBJECT&&s.properties.length<=5&&!s.whenCondition){for(let p of s.properties)if(p.parsedKey)return null;let n=[],o=!0;for(let p of s.properties){let l=p.key,a=p.value;if(a.type===v.LITERAL)n.push({key:l,type:"literal",value:a.value});else if(a.type===v.VARIABLE){let c=a.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{o=!1;break}}else{o=!1;break}}else if(a.type===v.INTERPOLATION&&a.parts.length===1){let c=a.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 h=d.substring(i.length+1);if(!h.includes(".")&&!h.includes("["))n.push({key:l,type:"prop_string",prop:h});else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}if(o){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 a=t[l];p[l]={id:a.id,title:a.title!=null?String(a.title):"",completed:a.completed}}else for(let l=0;l<t.length;l++){let a=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]=a;else if(d.type==="prop")c[d.key]=a[d.prop];else if(d.type==="item_string")c[d.key]=a!=null?String(a):"";else if(d.type==="prop_string"){let h=a[d.prop];c[d.key]=h!=null?String(h):""}p[l]=c}return p}}return null},Mh=(e,t,s,i,r)=>{let n=[],o=e.body;if(o.type===v.OBJECT&&o.fast!==!1){let p=e.itemVar,l=e.indexVar;for(let a=0;a<r.length;a++){let c=r[a],d={},h={...i,[p]:c,...l&&{[l]:a}};h.__paths__||(h.__paths__=i.__paths__||{});let f=e.iterable.path||"";if(i&&i.__paths__&&f){let u=f.split("."),y=u[0];y in i.__paths__&&(f=i.__paths__[y],u.length>1&&(f+="."+u.slice(1).join(".")))}h.__paths__={...h.__paths__,[p]:`${f}[${a}]`,...l&&{[l]:a}};for(let u of o.properties){let y=u.parsedKey?N(u.parsedKey,t,s,h):u.key,m=u.value;if(m.type===v.LITERAL)d[y]=m.value;else if(m.type===v.VARIABLE){let b=m.path;if(b===p)d[y]=c;else if(b===l)d[y]=a;else if(b.startsWith(p+".")){let g=b.substring(p.length+1);!g.includes(".")&&!g.includes("[")?d[y]=c[g]:d[y]=H(b,s,{...i,[p]:c,...l&&{[l]:a}})}else d[y]=H(b,s,{...i,[p]:c,...l&&{[l]:a}})}else if(m.type===v.INTERPOLATION){let b=[];for(let g of m.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=a;else if(_.startsWith(p+".")){let A=_.substring(p.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=H(_,s,{...i,[p]:c,...l&&{[l]:a}})}else S=H(_,s,{...i,[p]:c,...l&&{[l]:a}});b.push(S!=null?String(S):"")}else{let _={...i,[p]:c,...l&&{[l]:a}},S=N(g,t,s,_);b.push(S!=null?String(S):"")}d[y]=b.join("")}else{let b={...i,[p]:c,...l&&{[l]:a}};d[y]=N(m,t,s,b)}}n.push(d)}return n}return null},Wh=(e,t,s)=>{let i=e.body;if(i.type===v.OBJECT&&i.properties.length===1&&i.properties[0].key==="$if item.visible"){let r=i.properties[0].value;if(r.type===v.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===v.VARIABLE&&r.conditions[0].path==="item.visible"){let n=r.bodies[0];if(n.type===v.OBJECT&&n.properties.length===2){let o=n.properties[0],p=n.properties[1];if(o.key==="id"&&o.value.type===v.VARIABLE&&o.value.path==="item.id"&&p.key==="$if item.highlighted"&&p.value.type===v.CONDITIONAL){let l=[];for(let a=0;a<t.length;a++){let c=t[a];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},Fh=(e,t,s,i)=>{let r=N(e.iterable,t,s,i);if(!Array.isArray(r)){let a,c=!1;if(e.iterable.type===v.FUNCTION){c=!0;let h=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(", ");a=`${e.iterable.name}(${h})`}else a=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${a}`;throw Vh(d,r,c)}if(!e.indexVar){let a=Wh(e,r,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=zh(e,r);if(a!==null)return a}let n=Mh(e,t,s,i,r);if(n!==null)return n;let o=[],p=e.iterable.path||"";if(i&&i.__paths__&&p){let a=p.split("."),c=a[0];c in i.__paths__&&(p=i.__paths__[c],a.length>1&&(p+="."+a.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(a=>a.type===v.OBJECT&&a.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let a=0;a<r.length;a++){let c=e.indexVar?{...i,[e.itemVar]:r[a],[e.indexVar]:a}:{...i,[e.itemVar]:r[a]};c.__paths__||(c.__paths__=i.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${p}[${a}]`},e.indexVar&&(c.__paths__[e.indexVar]=a);let d=N(e.body,t,s,c);if(Array.isArray(d)&&d.length===1&&!l){let h=d[0];o.push(h===void 0?{}:h)}else o.push(d===void 0?{}:d)}return o},Kh=(e,t,s,i)=>{if(e.whenCondition)return null;if(e.properties.length===1){let r=e.properties[0],n=r.parsedKey?N(r.parsedKey,t,s,i):r.key,o=r.value;if(o.type===v.OBJECT&&o.properties.length<=10&&!o.whenCondition){let p={},l={},a=!0;for(let c of o.properties){let d=c.parsedKey?N(c.parsedKey,t,s,i):c.key,h=c.value;if(h.type===v.LITERAL)l[d]=h.value;else if(h.type===v.VARIABLE)l[d]=H(h.path,s,i);else if(h.type===v.INTERPOLATION){let f=[];for(let u of h.parts)if(typeof u=="string")f.push(u);else if(u.type===v.VARIABLE){let y=H(u.path,s,i);f.push(y!=null?String(y):"")}else{a=!1;break}if(!a)break;l[d]=f.join("")}else if(h.type===v.OBJECT&&h.properties.length<=5){let f={};for(let u of h.properties){let y=u.key,m=u.value;if(m.type===v.LITERAL)f[y]=m.value;else if(m.type===v.VARIABLE)f[y]=H(m.path,s,i);else if(m.type===v.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=H(g.path,s,i);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[y]=b.join("")}else{a=!1;break}}if(!a)break;l[d]=f}else{a=!1;break}}if(a)return p[n]=l,p}}return null},Uh=(e,t,s,i)=>{let r=t.functions||t;if(e.whenCondition&&!Me(e.whenCondition,r,s,i))return;let n=Kh(e,t,s,i);if(n!==null)return n;if(e.fast){let l={};for(let a of e.properties){let c=a.parsedKey?N(a.parsedKey,t,s,i):a.key,d=a.value;if(d.type===v.LITERAL)l[c]=d.value;else if(d.type===v.VARIABLE)l[c]=H(d.path,s,i);else if(d.type===v.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===v.VARIABLE){let u=H(f.path,s,i);h.push(u!=null?String(u):"")}else{let u=N(f,t,s,i);h.push(u!=null?String(u):"")}l[c]=h.join("")}else l[c]=N(d,t,s,i)}return l}let o={},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 a=N(l.value,t,s,i);if(!p&&a!==null&&a!==void 0)return Array.isArray(a)&&a.length===1?a[0]:a;typeof a=="object"&&a!==null&&!Array.isArray(a)&&Object.assign(o,a)}else if(l.key.startsWith("$for ")){if(e.properties.length===1)return N(l.value,t,s,i)}else{let a=l.value;if(a&&a.type===v.OBJECT&&a.properties){let c=a.properties.find(d=>d.key.startsWith("$for "));if(c){let d=N(c.value,t,s,i);d!==void 0&&(o[l.key]=d)}else{let d=N(l.value,t,s,i);d!==void 0&&(o[l.key]=d)}}else{let c=l.parsedKey?N(l.parsedKey,t,s,i):l.key,d=N(l.value,t,s,i);d!==void 0&&(o[c]=d)}}return o},Sn={},Hh=(e,t,s,i)=>{let r=[];for(let n of e.items)if(n.type===v.LOOP){let o=N(n,t,s,i);Array.isArray(o)&&n.flatten!==!1?r.push(...o):r.push(o)}else{let o=N(n,t,s,i);o!==Sn&&o!==void 0&&r.push(o)}return r},qh=(e,t,s,i)=>{let{name:r,data:n,whenCondition:o}=e,p=t.partials||{},l=t.functions||t;if(o&&!Me(o,l,s,i))return;if(!p[r])throw new ie(`Partial '${r}' is not defined`);let a=i._partialStack||[];if(a.includes(r))throw new ie(`Circular partial reference detected: ${r}`);let c=p[r],d=s,h={...i,_partialStack:[...a,r]};if(i){d={...s};for(let f of Object.keys(i))f.startsWith("_")||(d[f]=i[f])}if(n){let f=N(n,t,s,i);d={...d,...f}}return N(c,t,d,h)},Yh=(e,t,s,i)=>{let{path:r}=e,n=r.split("."),o=n[0],p=n.slice(1);if(!i||!(o in i))throw new ie(`Path reference '#{${r}}' refers to '${o}' which is not a loop variable in the current scope`);if(i.__paths__||(i.__paths__={}),!(o in i.__paths__))throw new ie(`Path reference '#{${r}}' cannot be resolved - path tracking may not be initialized properly`);let l=i.__paths__[o];if(typeof l=="number"){if(p.length>0)throw new ie(`Path reference '#{${r}}' - cannot access properties on index variable '${o}'`);return String(l)}return p.length>0&&(l+="."+p.join(".")),l},Gh=/\$\{([^}]*)\}/g,Jh=/#\{([^}]*)\}/g,An=(e,t={})=>{let s=e.match(/^(\w+)\((.*)\)$/);if(!s)return{isFunction:!1};let[,i,r]=s,n=Qh(r,t);return{isFunction:!0,type:v.FUNCTION,name:i,args:n}},Qh=(e,t={})=>e.trim()?Zh(e).map(s=>Xh(s.trim(),t)):[],Zh=e=>{let t=[],s="",i=0,r=!1,n="";for(let o=0;o<e.length;o++){let p=e[o],l=o>0?e[o-1]:"";!r&&(p==='"'||p==="'")?(r=!0,n=p,s+=p):r&&p===n&&l!=="\\"?(r=!1,n="",s+=p):!r&&p==="("?(i++,s+=p):!r&&p===")"?(i--,s+=p):!r&&p===","&&i===0?(t.push(s),s=""):s+=p}return s&&t.push(s),t},Xh=(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 s=An(e,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};let i=e.trim(),r=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:o,type:p}of r){let l=0;for(;l<i.length;){let a=Ne(i.substring(l),o);if(a===-1)break;let c=l+a;c>n&&(n=c),l=c+o.length}}if(n!==-1)try{return X(i,t)}catch{return{type:v.VARIABLE,path:i}}return{type:v.VARIABLE,path:i}},En=/^\w+\(.*\)$/,ef=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,tf=e=>{if(!(!e||e.trim()===""||En.test(e))&&ef.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}"`)},ir=e=>{let t=e.trim();if(En.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:v.PATH_REFERENCE,path:t}},At=(e,t={})=>{let s=e.trim();tf(s);let i=An(s,t);if(i.isFunction)return{type:i.type,name:i.name,args:i.args};if(s.includes("[")&&!/[\s+\-*/%|&?:]/.test(s)){let r=0;for(let n of s)n==="["?r++:n==="]"&&r--;if(r!==0)throw new Error("Invalid array index syntax")}return{type:v.VARIABLE,path:s}},kn=(e,t={})=>{let s=e,i=[];(e.includes("\\${")||e.includes("\\#{"))&&(s=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),s=s.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),s=s.replace(/\\(\$\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),s=s.replace(/\\(#\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),s=s.replace(/\\DOUBLE_ESC_VAR/g,"\\"),s=s.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let r=[...s.matchAll(Gh)],n=[...s.matchAll(Jh)],o=[...r.map(a=>({match:a,type:"variable"})),...n.map(a=>({match:a,type:"pathref"}))].sort((a,c)=>a.match.index-c.match.index);if(o.length===0){let a=s;for(let c=0;c<i.length;c++)a=a.replace(`__ESCAPED_${c}__`,i[c]);return{type:v.LITERAL,value:a}}if(o.length===1&&o[0].match[0]===s&&i.length===0){let{match:a,type:c}=o[0];try{return c==="variable"?At(a[1],t):ir(a[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:v.LITERAL,value:s};throw d}}let p=[],l=0;for(let{match:a,type:c}of o){let[d,h]=a,f=a.index;if(f>l){let u=s.substring(l,f);for(let y=0;y<i.length;y++)u=u.replace(`__ESCAPED_${y}__`,i[y]);u&&p.push(u)}try{let u;c==="variable"?u=At(h.trim(),t):u=ir(h.trim()),p.push(u)}catch(u){if(u.message==="Invalid array index syntax")p.push(d);else throw u}l=f+d.length}if(l<s.length){let a=s.substring(l);for(let c=0;c<i.length;c++)a=a.replace(`__ESCAPED_${c}__`,i[c]);a&&p.push(a)}return{type:v.INTERPOLATION,parts:p}},Ce=(e,t)=>typeof e=="string"?kn(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?rf(e,t):nf(e,t):{type:v.LITERAL,value:e},sf=e=>{let{$each:t,...s}=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(s).length===0)throw new k("Empty $each body not allowed");if(s.$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}`]:s}},rf=(e,t)=>{let s=[],i=!1;for(let r=0;r<e.length;r++){let n=e[r];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let l=sf(n),a=Object.keys(l);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let c=rr(a[0],l[a[0]],t,!0);s.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=rr(p[0],n[p[0]],t);s.push(l),i=!0;continue}}let o=Ce(n,t);s.push(o),(o.type===v.FUNCTION||o.type===v.CONDITIONAL||o.type===v.LOOP||o.type===v.PARTIAL||o.type===v.OBJECT&&!o.fast||o.type===v.ARRAY&&!o.fast)&&(i=!0)}return{type:v.ARRAY,items:s,fast:!i}},nf=(e,t)=>{let s=[],i=!1,r=null,n=Object.entries(e),o=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"],a=[];for(let[b]of n)for(let g of l)if(b===g||b.startsWith(g+" ")||b.startsWith(g+"#")){a.push(g);break}if(a.length>0)throw new k(`Cannot use $partial with ${a.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...h}=e,f={},u=!1;for(let[b,g]of Object.entries(h)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=g,u=!0}let y=null;if(u&&(y=Ce(f,t),y.type===v.OBJECT)){let b=!1;for(let g of y.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&&(y.fast=!1)}let m={type:v.PARTIAL,name:c,data:y};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new k("Empty condition expression after '$when'");b=X(d,t)}else b={type:v.LITERAL,value:d};m.whenCondition=b}return m}for(let[l,a]of n)if(l==="$when"){if(r!==null)throw new k("Multiple '$when' directives on the same object are not allowed");if(a==null)throw new k("Missing condition expression after '$when'");let c=typeof a=="string"?a:JSON.stringify(a);if(c.trim()==="")throw new k("Empty condition expression after '$when'");r=X(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(;o<n.length;){let[l,a]=n[o];if(l==="$when"){o++;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=of(n,o,t);s.push({key:l,value:c.node}),i=!0,o=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=Ce(a,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=kn(l,t),h={key:l,value:c};(d.type!==v.LITERAL||d.value!==l)&&(h.parsedKey=d),s.push(h),o++}}}let p={type:v.OBJECT,properties:s,fast:!i};return r&&(p.whenCondition=r),p},of=(e,t,s={})=>{let i=[],r=[],n=t,[o,p]=e[n],l=null,a;if(o.startsWith("$if#")){let d=o.match(/^\$if#(\w+)\s+(.+)$/);if(d)l=d[1],a=d[2];else throw new k(`Invalid conditional syntax: ${o}`)}else a=o.substring(4),a.endsWith(":")&&(a=a.slice(0,-1).trim());tr(a);let c=X(a,s);for(i.push(c),r.push(Ce(p,s)),n++;n<e.length;){let[d,h]=e[n],f=!1,u;if(l?d.startsWith(`$elif#${l} `)?(u=d.substring(`$elif#${l} `.length),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d===`$else#${l}`||d===`$else#${l}:`)&&(f=!0,u=null):d.startsWith("$elif ")?(u=d.substring(6),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,u=null),f){if(u===null)i.push(null);else{tr(u);let y=X(u,s);i.push(y)}if(r.push(Ce(h,s)),n++,u===null)break}else break}return{node:{type:v.CONDITIONAL,conditions:i,bodies:r,id:l},nextIndex:n}},X=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let a=e.slice(1,-1),c=0,d=!0;for(let h=0;h<a.length;h++)if(a[h]==="("?c++:a[h]===")"&&c--,c<0){d=!1;break}if(d&&c===0)return X(a,t)}let s=Ne(e,"||");if(s!==-1)return{type:v.BINARY,op:j.OR,left:X(e.substring(0,s).trim(),t),right:X(e.substring(s+2).trim(),t)};let i=Ne(e,"&&");if(i!==-1)return{type:v.BINARY,op:j.AND,left:X(e.substring(0,i).trim(),t),right:X(e.substring(i+2).trim(),t)};let r=[{op:">=",type:j.GTE},{op:"<=",type:j.LTE},{op:"==",type:j.EQ},{op:"!=",type:j.NEQ},{op:">",type:j.GT},{op:"<",type:j.LT},{op:" in ",type:j.IN}];for(let{op:a,type:c}of r){let d=Ne(e,a);if(d!==-1)return{type:v.BINARY,op:c,left:X(e.substring(0,d).trim(),t),right:X(e.substring(d+a.length).trim(),t)}}let n=-1,o=null,p=[{op:" + ",type:j.ADD},{op:" - ",type:j.SUBTRACT}];for(let{op:a,type:c}of p){let d=0;for(;d<e.length;){let h=Ne(e.substring(d),a);if(h===-1)break;let f=d+h;f>n&&(n=f,o={op:a,type:c}),d=f+a.length}}if(n!==-1&&o)return{type:v.BINARY,op:o.type,left:X(e.substring(0,n).trim(),t),right:X(e.substring(n+o.op.length).trim(),t)};let l=[" * "," / "," % "];for(let a of l)if(Ne(e,a)!==-1)throw new k(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:v.UNARY,op:ks.NOT,operand:X(e.substring(1).trim(),t)}:$n(e,t)},Ne=(e,t)=>{let s=0,i=0;for(;i<=e.length-t.length;){if(e[i]==="(")s++;else if(e[i]===")")s--;else if(s===0&&e.substring(i,i+t.length)===t)return i;i++}return-1},af=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}},$n=(e,t)=>{let s=e.trim();if(s.match(/^(\w+)\((.*)\)$/))return At(s,t);let i=af(s);if(i.type===v.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(s))return{type:v.VARIABLE,path:s};try{return At(s,t)}catch(r){if(r.message&&r.message.includes("not supported"))return i;throw r}},lf=(e,t=!1)=>{try{Lh(e)}catch(s){if(s instanceof k&&t){let i=s.message.replace(/\$for/g,"$each");throw new k(i.replace("Parse Error: ",""))}throw s}},rr=(e,t,s,i=!1)=>{let r=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(r);if(!n){let m=i?"$each":"$for";throw new k(`Invalid loop syntax (got: '${e.replace("$for",m)}')`)}let o=n[1],p=n[2].trim();lf(p,i);let l=p.match(/^(.+?)\s+in\s+(.+)$/);if(!l){let m=i?"$each":"$for";throw new k(`Invalid loop syntax - missing 'in' keyword (got: '${m} ${p}')`)}let a=l[1].trim(),c=l[2].trim(),d,h=null;if(a.includes(",")){let m=a.split(",").map(b=>b.trim());if(m.length!==2)throw new k(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=m[0],h=m[1]}else d=a;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new k(`Reserved variable name: ${d}`);if(h&&f.includes(h))throw new k(`Reserved variable name: ${h}`);let u=$n(c,s),y=Ce(t,s);return{type:v.LOOP,itemVar:d,indexVar:h,iterable:u,body:y,flatten:o!=="nested"}},$s=(e,t={})=>{let{functions:s={}}=t;return Ce(e,s)},pf=()=>Date.now(),df=Object.freeze(Object.defineProperty({__proto__:null,now:pf},Symbol.toStringTag,{value:"Module"})),Cn=(e,t,s={})=>{let{functions:i={},partials:r={}}=s,n={...df,...i},o=$s(e,{functions:n}),p={};for(let[l,a]of Object.entries(r))p[l]=$s(a,{functions:n});return vn(o,t,{functions:n,partials:p})},it=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),cf=(e,t)=>{!t||typeof t!="object"||Object.entries(t).forEach(([s,i])=>{if(s==="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(s in e)throw new Error(`[Methods] Cannot define method '${s}' because it already exists on the component instance.`);Object.defineProperty(e,s,{configurable:!0,enumerable:!1,writable:!1,value:(r={})=>{let n=r===void 0?{}:r;if(!it(n))throw new Error(`[Methods] Method '${s}' expects payload to be an object.`);return i.call(e,n)}})}})},In=Symbol.for("immer-nothing"),nr=Symbol.for("immer-draftable"),oe=Symbol.for("immer-state");function ce(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var We=Object.getPrototypeOf;function Fe(e){return!!e&&!!e[oe]}function Ie(e){return e?On(e)||Array.isArray(e)||!!e[nr]||!!e.constructor?.[nr]||Vt(e)||Rt(e):!1}var uf=Object.prototype.constructor.toString();function On(e){if(!e||typeof e!="object")return!1;let t=We(e);if(t===null)return!0;let s=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return s===Object?!0:typeof s=="function"&&Function.toString.call(s)===uf}function Et(e,t){Lt(e)===0?Reflect.ownKeys(e).forEach(s=>{t(s,e[s],e)}):e.forEach((s,i)=>t(i,s,e))}function Lt(e){let t=e[oe];return t?t.type_:Array.isArray(e)?1:Vt(e)?2:Rt(e)?3:0}function Cs(e,t){return Lt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Tn(e,t,s){let i=Lt(e);i===2?e.set(t,s):i===3?e.add(s):e[t]=s}function hf(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Vt(e){return e instanceof Map}function Rt(e){return e instanceof Set}function Ee(e){return e.copy_||e.base_}function Is(e,t){if(Vt(e))return new Map(e);if(Rt(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let s=On(e);if(t===!0||t==="class_only"&&!s){let i=Object.getOwnPropertyDescriptors(e);delete i[oe];let r=Reflect.ownKeys(i);for(let n=0;n<r.length;n++){let o=r[n],p=i[o];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(i[o]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[o]})}return Object.create(We(e),i)}else{let i=We(e);if(i!==null&&s)return{...e};let r=Object.create(i);return Object.assign(r,e)}}function Js(e,t=!1){return Nt(e)||Fe(e)||!Ie(e)||(Lt(e)>1&&(e.set=e.add=e.clear=e.delete=ff),Object.freeze(e),t&&Object.entries(e).forEach(([s,i])=>Js(i,!0))),e}function ff(){ce(2)}function Nt(e){return Object.isFrozen(e)}var yf={};function Oe(e){let t=yf[e];return t||ce(0,e),t}var rt;function Ln(){return rt}function mf(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function or(e,t){t&&(Oe("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Os(e){Ts(e),e.drafts_.forEach(gf),e.drafts_=null}function Ts(e){e===rt&&(rt=e.parent_)}function ar(e){return rt=mf(rt,e)}function gf(e){let t=e[oe];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function lr(e,t){t.unfinalizedDrafts_=t.drafts_.length;let s=t.drafts_[0];return e!==void 0&&e!==s?(s[oe].modified_&&(Os(t),ce(4)),Ie(e)&&(e=kt(t,e),t.parent_||$t(t,e)),t.patches_&&Oe("Patches").generateReplacementPatches_(s[oe].base_,e,t.patches_,t.inversePatches_)):e=kt(t,s,[]),Os(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==In?e:void 0}function kt(e,t,s){if(Nt(t))return t;let i=t[oe];if(!i)return Et(t,(r,n)=>pr(e,i,t,r,n,s)),t;if(i.scope_!==e)return t;if(!i.modified_)return $t(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;let r=i.copy_,n=r,o=!1;i.type_===3&&(n=new Set(r),r.clear(),o=!0),Et(n,(p,l)=>pr(e,i,r,p,l,s,o)),$t(e,r,!1),s&&e.patches_&&Oe("Patches").generatePatches_(i,s,e.patches_,e.inversePatches_)}return i.copy_}function pr(e,t,s,i,r,n,o){if(Fe(r)){let p=n&&t&&t.type_!==3&&!Cs(t.assigned_,i)?n.concat(i):void 0,l=kt(e,r,p);if(Tn(s,i,l),Fe(l))e.canAutoFreeze_=!1;else return}else o&&s.add(r);if(Ie(r)&&!Nt(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;kt(e,r),(!t||!t.scope_.parent_)&&typeof i!="symbol"&&Object.prototype.propertyIsEnumerable.call(s,i)&&$t(e,r)}}function $t(e,t,s=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Js(t,s)}function bf(e,t){let s=Array.isArray(e),i={type_:s?1:0,scope_:t?t.scope_:Ln(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},r=i,n=Qs;s&&(r=[i],n=nt);let{revoke:o,proxy:p}=Proxy.revocable(r,n);return i.draft_=p,i.revoke_=o,p}var Qs={get(e,t){if(t===oe)return e;let s=Ee(e);if(!Cs(s,t))return vf(e,s,t);let i=s[t];return e.finalized_||!Ie(i)?i:i===ys(e.base_,t)?(ms(e),e.copy_[t]=Vs(i,e)):i},has(e,t){return t in Ee(e)},ownKeys(e){return Reflect.ownKeys(Ee(e))},set(e,t,s){let i=Vn(Ee(e),t);if(i?.set)return i.set.call(e.draft_,s),!0;if(!e.modified_){let r=ys(Ee(e),t),n=r?.[oe];if(n&&n.base_===s)return e.copy_[t]=s,e.assigned_[t]=!1,!0;if(hf(s,r)&&(s!==void 0||Cs(e.base_,t)))return!0;ms(e),Ls(e)}return e.copy_[t]===s&&(s!==void 0||t in e.copy_)||Number.isNaN(s)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=s,e.assigned_[t]=!0),!0},deleteProperty(e,t){return ys(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ms(e),Ls(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let s=Ee(e),i=Reflect.getOwnPropertyDescriptor(s,t);return i&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:i.enumerable,value:s[t]}},defineProperty(){ce(11)},getPrototypeOf(e){return We(e.base_)},setPrototypeOf(){ce(12)}},nt={};Et(Qs,(e,t)=>{nt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});nt.deleteProperty=function(e,t){return nt.set.call(this,e,t,void 0)};nt.set=function(e,t,s){return Qs.set.call(this,e[0],t,s,e[0])};function ys(e,t){let s=e[oe];return(s?Ee(s):e)[t]}function vf(e,t,s){let i=Vn(t,s);return i?"value"in i?i.value:i.get?.call(e.draft_):void 0}function Vn(e,t){if(!(t in e))return;let s=We(e);for(;s;){let i=Object.getOwnPropertyDescriptor(s,t);if(i)return i;s=We(s)}}function Ls(e){e.modified_||(e.modified_=!0,e.parent_&&Ls(e.parent_))}function ms(e){e.copy_||(e.copy_=Is(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var wf=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,s,i)=>{if(typeof t=="function"&&typeof s!="function"){let n=s;s=t;let o=this;return function(p=n,...l){return o.produce(p,a=>s.call(this,a,...l))}}typeof s!="function"&&ce(6),i!==void 0&&typeof i!="function"&&ce(7);let r;if(Ie(t)){let n=ar(this),o=Vs(t,void 0),p=!0;try{r=s(o),p=!1}finally{p?Os(n):Ts(n)}return or(n,i),lr(r,n)}else if(!t||typeof t!="object"){if(r=s(t),r===void 0&&(r=t),r===In&&(r=void 0),this.autoFreeze_&&Js(r,!0),i){let n=[],o=[];Oe("Patches").generateReplacementPatches_(t,r,n,o),i(n,o)}return r}else ce(1,t)},this.produceWithPatches=(t,s)=>{if(typeof t=="function")return(n,...o)=>this.produceWithPatches(n,p=>t(p,...o));let i,r;return[this.produce(t,s,(n,o)=>{i=n,r=o}),i,r]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Ie(e)||ce(8),Fe(e)&&(e=_f(e));let t=ar(this),s=Vs(e,void 0);return s[oe].isManual_=!0,Ts(t),s}finishDraft(e,t){let s=e&&e[oe];(!s||!s.isManual_)&&ce(9);let{scope_:i}=s;return or(i,t),lr(void 0,i)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let s;for(s=t.length-1;s>=0;s--){let r=t[s];if(r.path.length===0&&r.op==="replace"){e=r.value;break}}s>-1&&(t=t.slice(s+1));let i=Oe("Patches").applyPatches_;return Fe(e)?i(e,t):this.produce(e,r=>i(r,t))}};function Vs(e,t){let s=Vt(e)?Oe("MapSet").proxyMap_(e,t):Rt(e)?Oe("MapSet").proxySet_(e,t):bf(e,t);return(t?t.scope_:Ln()).drafts_.push(s),s}function _f(e){return Fe(e)||ce(10,e),Rn(e)}function Rn(e){if(!Ie(e)||Nt(e))return e;let t=e[oe],s;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,s=Is(e,t.scope_.immer_.useStrictShallowCopy_)}else s=Is(e,!0);return Et(s,(i,r)=>{Tn(s,i,Rn(r))}),t&&(t.finalized_=!1),s}var ae=new wf,xf=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 Sf=(e,t,s,i={})=>{let{createInitialState:r,...n}=e,o={},p={},l={},a=c=>({state:c,props:t,constants:s,i18n:i.getI18n?.()||{},locale:i.locale});return r&&(l=r({props:t,constants:s})),Object.entries(n).forEach(([c,d])=>{if(c.startsWith("select")){o[c]=(...h)=>d(a(l),...h);return}p[c]=(h={})=>{let f=h===void 0?{}:h;if(!it(f))throw new Error(`[Store] Action '${c}' expects payload to be an object.`);return l=xf(l,u=>d(a(u),f)),l}}),{getState:()=>l,...p,...o}},Nn=e=>!it(e)||Object.isFrozen(e)?e:(Object.values(e).forEach(t=>{Nn(t)}),Object.freeze(e)),Af=({setupConstants:e,fileConstants:t})=>{let s=it(e)?e:{},i=it(t)?t:{};return Nn({...s,...i})},Ef=(e,t)=>{if(!t||typeof t!="object")return"";let s="",i=n=>Object.entries(n).map(([o,p])=>` ${o}: ${p};`).join(`
1628
+ `),r=(n,o)=>{if(typeof o!="object"||o===null)return"";if(n.startsWith("@")){let l=Object.entries(o).map(([a,c])=>{let d=i(c);return` ${a} {
1614
1629
  ${d.split(`
1615
1630
  `).map(h=>h?` ${h}`:"").join(`
1616
1631
  `)}
1617
1632
  }`}).join(`
1618
1633
  `);return`${n} {
1619
1634
  ${l}
1620
- }`}let p=r(o);return`${n} {
1635
+ }`}let p=i(o);return`${n} {
1621
1636
  ${p}
1622
- }`};return Object.entries(t).forEach(([n,o])=>{let p=i(n,o);p&&(s+=(s?`
1637
+ }`};return Object.entries(t).forEach(([n,o])=>{let p=r(n,o);p&&(s+=(s?`
1623
1638
 
1624
- `:"")+p)}),s},Rs=e=>Array.isArray(e)?e.reduce((t,s)=>{if(Array.isArray(s))t.push(...Rs(s));else{if(s&&typeof s=="object"){let r=Object.entries(s);if(r.length>0){let[i,n]=r[0];Array.isArray(n)&&(s={[i]:Rs(n)})}}t.push(s)}return t},[]):e,gs=":",kf=new Set(["__proto__","constructor","prototype"]),Ef=/^[A-Za-z_][A-Za-z0-9_.:-]*$/,di=e=>Ef.test(e),ci=(e,t)=>{if(!t)return e;let s=[],r="",i=!1;for(let n=0;n<t.length;n++){let o=t[n];if(!i&&o===".")r&&(s.push(r),r="");else if(!i&&o==="[")r&&(s.push(r),r=""),i=!0;else if(i&&o==="]"){if(r){if(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))s.push(r.slice(1,-1));else{let p=Number(r);s.push(Number.isNaN(p)?r:p)}r=""}i=!1}else r+=o}return r&&s.push(r),s.reduce((n,o)=>{if(n==null)return;let p=typeof o=="number"?o:String(o);if(!(typeof p=="string"&&kf.has(p)))return n[p]},e)},$f=e=>e.replace(/-([a-z0-9])/g,(t,s)=>s.toUpperCase()),Cf=({attrsString:e="",viewData:t={},tagName:s,isWebComponent:r})=>{let i={},n={},o=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=$f(g);if(!A)throw new Error(`[Parser] Invalid ${S} prop name on '${s}'.`);if(Object.prototype.hasOwnProperty.call(n,A))throw new Error(`[Parser] Duplicate prop binding '${A}' on '${s}'. Use only one of 'name=value' or ':name=\${expr}'.`);n[A]=_},l=(g,_)=>{if(!di(g))throw new Error(`[Parser] Invalid ${_} attribute name '${g}' on '${s}'.`)};if(!e)return{attrs:i,props:n};let a=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,c,d=new Set;for(;(c=a.exec(e))!==null;){let g=c[1],_=c[2]??c[3]??c[4]??"";if(d.add(g),g.startsWith(".")){i[g]=_;continue}if(g.startsWith(gs)){let S=g.substring(1),A=_;if(c[4]!==void 0&&c[4]!==""){let k=c[4],C=ci(t,k);C!==void 0&&(A=C)}p(S,A,"property-form");continue}if(g.startsWith("?")){let S=g.substring(1);l(S,"boolean toggle");let A=_;o(S);let k;A==="true"?k=!0:A==="false"||A===""?k=!1:k=ci(t,A),k&&(i[S]=""),r&&S!=="id"&&p(S,!!k,"boolean attribute-form");continue}l(g,"binding"),i[g]=_,r&&g!=="id"&&p(g,_,"attribute-form")}let h=e,f=[],u,y=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g;for(;(u=y.exec(e))!==null;)f.push(u[0]);f.forEach(g=>{h=h.replace(g," ")});let m=/(\S+?)(?=\s|$)/g,b;for(;(b=m.exec(h))!==null;){let g=b[1];if(!g.startsWith(".")&&!(d.has(g)||g.startsWith(gs)||g.includes("="))){if(g.startsWith("?")){let _=g.substring(1);l(_,"boolean toggle"),o(_),i[_]="",r&&_!=="id"&&p(_,!0,"boolean attribute-form");continue}if(!di(g))throw new Error(`[Parser] Invalid attribute token '${g}' on '${s}'.`);!d.has(g)&&!g.startsWith(gs)&&!g.includes("=")&&(i[g]="",r&&g!=="id"&&p(g,!0,"boolean attribute-form"))}}return{attrs:i,props:n}},Ns=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,If=/^\$for\s+([A-Za-z_][A-Za-z0-9_]*)(?:\s*,\s*([A-Za-z_][A-Za-z0-9_]*))?\s+in\s+.+$/,Pn=/^\$\{([^{}]+)\}$/,Of=/^[A-Za-z_][A-Za-z0-9_]*(?:(?:\.[A-Za-z_][A-Za-z0-9_]*)|\[(?:\d+|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')\])*$/,ui=new WeakSet,Zs=(e,t,s)=>{let r=new Set(e);return t&&r.add(t),s&&r.add(s),r},Tf=(e,t)=>{if(typeof e!="string")return t;let s=e.match(If);return s?Zs(t,s[1],s[2]):t},Dn=e=>{if(typeof e!="string"||!e.includes(":")&&!e.includes("."))return null;Ns.lastIndex=0;let t;for(;(t=Ns.exec(e))!==null;){let s=t[1];if(s.startsWith("."))return{bindingName:s,rawValue:t[2]??t[3]??t[4]??"",key:e};if(!s.startsWith(":"))continue;let r=t[2]!==void 0||t[3]!==void 0,i=t[2]??t[3]??t[4]??"";if(r||!Pn.test(i))return{bindingName:s,rawValue:i,key:e}}return null},Ps=(e,t=new Set)=>{if(Array.isArray(e)){for(let s of e){let r=Ps(s,t);if(r)return r}return null}if(!e||typeof e!="object")return null;for(let[s,r]of Object.entries(e)){let i=Dn(s);if(i)return i;let n=Tf(s,t),o=Ps(r,n);if(o)return o}return null},Pe=(e,t=new Set)=>{if(!e||typeof e!="object")return null;if(Array.isArray(e)){for(let s of e){let r=Pe(s,t);if(r)return r}return null}if(e.type===v.LOOP){let s=Zs(t,e.itemVar,e.indexVar);return Pe(e.body,s)}if(e.type===v.ARRAY&&Array.isArray(e.items))return Pe(e.items,t);if(e.type===v.OBJECT&&Array.isArray(e.properties)){for(let s of e.properties){let r=Dn(s.key);if(r)return r;let i=Pe(s.value,t);if(i)return i}return null}for(let s of Object.values(e)){let r=Pe(s,t);if(r)return r}return null},Lf=e=>$s([{[e]:""}])?.items?.[0]?.properties?.[0]?.parsedKey,Vf=e=>{let t=e.match(Pn);return t?t[1].trim():null},Rf=e=>{let t=e.match(/^([A-Za-z_][A-Za-z0-9_]*)/);return t?t[1]:null},Nf=(e,t)=>{let s=!1,r=e.replace(Ns,(i,n,o,p,l)=>{if(!n.startsWith(":"))return i;let a=o??p??l??"",c=Vf(a);if(!c||!Of.test(c))return i;let d=Rf(c);if(!d)return i;let h=t.has(d)?`#{${c}}`:c;return h===a?i:(s=!0,`${n}=${h}`)});return s?r:e},De=(e,t=new Set)=>{if(!(!e||typeof e!="object")){if(Array.isArray(e)){e.forEach(s=>De(s,t));return}if(e.type===v.LOOP){let s=Zs(t,e.itemVar,e.indexVar);De(e.body,s);return}if(e.type===v.ARRAY&&Array.isArray(e.items)){e.items.forEach(s=>De(s,t));return}if(e.type===v.OBJECT&&Array.isArray(e.properties)){e.properties.forEach(s=>{let r=Nf(s.key,t);if(r!==s.key){s.key=r;let i=Lf(r);i?s.parsedKey=i:delete s.parsedKey}De(s.value,t)});return}Object.values(e).forEach(s=>{De(s,t)})}},Pf=e=>e?e.type&&typeof e.type=="number"?Pe(e):Ps(e):null,Df=e=>{if(!e||typeof e!="object"||ui.has(e))return;let t=Pf(e);if(t)throw new Error(`Property-form bindings must use ':prop=\${value}' syntax. Found '${t.bindingName}=${t.rawValue}' in '${t.key}'.`);De(e),ui.add(e)},jf=/^[a-z][a-zA-Z0-9]*\*?$/,Bf=/^[a-zA-Z][a-zA-Z0-9_-]*\*?$/,zf=/^[a-z][a-zA-Z0-9]*$/,hi=new Set(["window","document"]),jn=e=>Object.entries(e||{}).map(([t,s])=>{if(hi.has(t))return{refKey:t,refConfig:s,targetType:"global",isWildcard:!1,prefix:t};let r="id",i=t;t.startsWith(".")?(r="class",i=t.slice(1)):t.startsWith("#")&&(r="id",i=t.slice(1));let n=i.endsWith("*")?i.slice(0,-1):i;if(hi.has(n))throw new Error(`[Parser] Invalid ref key '${t}'. Reserved global keys must be exactly 'window' or 'document'.`);if(r==="id"&&!jf.test(i))throw new Error(`[Parser] Invalid ref key '${t}'. Use camelCase IDs (optional '#', optional '*') or class refs with '.' prefix.`);if(r==="class"&&!Bf.test(i))throw new Error(`[Parser] Invalid ref key '${t}'. Class refs must start with '.' and use class-compatible names (optional '*').`);let o=i.endsWith("*"),p=o?i.slice(0,-1):i;return{refKey:t,refConfig:s,targetType:r,isWildcard:o,prefix:p}}),Wf=e=>{if(!zf.test(e))throw new Error(`[Parser] Invalid element id '${e}' for refs. Use camelCase ids only. Kebab-case ids are not supported.`)},fi=({value:e,prefix:t,isWildcard:s})=>typeof e!="string"||e.length===0?!1:s?e.startsWith(t):e===t,Bn=({elementIdForRefs:e,classNames:t=[],refMatchers:s})=>{let r=[],i=Array.isArray(t)?t:[];return s.forEach(n=>{if(n.targetType==="global")return;if(n.targetType==="id"){fi({value:e,prefix:n.prefix,isWildcard:n.isWildcard})&&r.push({...n,matchedValue:e});return}let o=i.find(p=>fi({value:p,prefix:n.prefix,isWildcard:n.isWildcard}));o&&r.push({...n,matchedValue:o})}),r.length===0?null:(r.sort((n,o)=>{let p=n.targetType==="id"?2:1,l=o.targetType==="id"?2:1;return p!==l?l-p:!n.isWildcard&&o.isWildcard?-1:n.isWildcard&&!o.isWildcard?1:o.prefix.length-n.prefix.length}),r[0])},et=({optionName:e,optionValue:t,eventType:s,refKey:r})=>{if(t!==void 0&&typeof t!="boolean")throw new Error(`[Parser] Invalid '${e}' for event '${s}' on ref '${r}'. Expected boolean.`)},yi=({optionName:e,optionValue:t,eventType:s,refKey:r})=>{if(t!==void 0&&(typeof t!="number"||Number.isNaN(t)||!Number.isFinite(t)||t<0))throw new Error(`[Parser] Invalid '${e}' for event '${s}' on ref '${r}'. Expected non-negative number.`)},Mf=({eventType:e,eventConfig:t,refKey:s})=>{if(typeof t!="object"||t===null)throw new Error(`[Parser] Invalid event config for event '${e}' on ref '${s}'.`);let r=Object.prototype.hasOwnProperty.call(t,"debounce"),i=Object.prototype.hasOwnProperty.call(t,"throttle");if(et({optionName:"preventDefault",optionValue:t.preventDefault,eventType:e,refKey:s}),et({optionName:"stopPropagation",optionValue:t.stopPropagation,eventType:e,refKey:s}),et({optionName:"stopImmediatePropagation",optionValue:t.stopImmediatePropagation,eventType:e,refKey:s}),et({optionName:"targetOnly",optionValue:t.targetOnly,eventType:e,refKey:s}),et({optionName:"once",optionValue:t.once,eventType:e,refKey:s}),yi({optionName:"debounce",optionValue:t.debounce,eventType:e,refKey:s}),yi({optionName:"throttle",optionValue:t.throttle,eventType:e,refKey:s}),r&&i)throw new Error(`[Parser] Event '${e}' on ref '${s}' 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:r,hasThrottle:i}},zn=e=>(e.__eventRateLimitState||Object.defineProperty(e,"__eventRateLimitState",{value:new Map,enumerable:!1,configurable:!0}),e.__eventRateLimitState),Ff=({eventConfig:e,handlers:t,onMissingHandler:s,parseAndRenderFn:r,getPayloadContext:i})=>{let n=o=>{let p=e.payload&&typeof e.payload=="object"&&!Array.isArray(e.payload)?e.payload:{};if(typeof r!="function")return p;let l=typeof i=="function"?i():{};return r(p,{...l&&typeof l=="object"?l:{},_event:o})};if(e.action){if(typeof t.handleCallStoreAction!="function")throw new Error(`[Runtime] Action listener '${e.action}' requires handlers.handleCallStoreAction.`);return o=>{let p=n(o);t.handleCallStoreAction({...p,_event:o,_action:e.action})}}return e.handler&&t[e.handler]?o=>{let p=n(o);t[e.handler]({...p,_event:o})}:(e.handler&&s?.(e.handler),null)},Kf=({eventConfig:e,callback:t,hasDebounce:s,hasThrottle:r,stateKey:i,eventRateLimitState:n,fallbackCurrentTarget:o=null,nowFn:p=Date.now,setTimeoutFn:l=setTimeout,clearTimeoutFn:a=clearTimeout})=>c=>{let d=n.get(i)||{},h=c.currentTarget||o;if(e.once)if(h){if(d.onceTargets||(d.onceTargets=new WeakSet),d.onceTargets.has(h)){n.set(i,d);return}d.onceTargets.add(h)}else if(d.onceTriggered){n.set(i,d);return}else d.onceTriggered=!0;if(e.targetOnly&&c.target!==c.currentTarget){n.set(i,d);return}if(e.preventDefault&&c.preventDefault(),e.stopImmediatePropagation?c.stopImmediatePropagation():e.stopPropagation&&c.stopPropagation(),s){d.debounceTimer&&a(d.debounceTimer),d.debounceTimer=l(()=>{let f=d.debounceTimer;try{t(c)}catch(u){throw a(f),d.debounceTimer=null,u}d.debounceTimer=null},e.debounce),n.set(i,d);return}if(r){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(i,d),t(c);return}n.set(i,d);return}n.set(i,d),t(c)},Wn=({eventType:e,eventConfig:t,refKey:s,handlers:r,eventRateLimitState:i,stateKey:n,fallbackCurrentTarget:o=null,parseAndRenderFn:p,getPayloadContext:l,onMissingHandler:a,nowFn:c=Date.now,setTimeoutFn:d=setTimeout,clearTimeoutFn:h=clearTimeout})=>{let{hasDebounce:f,hasThrottle:u}=Mf({eventType:e,eventConfig:t,refKey:s}),y=Ff({eventConfig:t,handlers:r,onMissingHandler:a,parseAndRenderFn:p,getPayloadContext:l});return y?Kf({eventConfig:t,callback:y,hasDebounce:f,hasThrottle:u,stateKey:n,eventRateLimitState:i,fallbackCurrentTarget:o,nowFn:c,setTimeoutFn:d,clearTimeoutFn:h}):null},Uf=({h:e,template:t,viewData:s,refs:r,handlers:i,createComponentUpdateHook:n})=>{Df(t);let o=vn(t,s,{}),p=Rs(o),l=Hf({h:e,items:p,refs:r,handlers:i,viewData:s,createComponentUpdateHook:n});return e("div",{style:{display:"contents"}},l)},Hf=({h:e,items:t,refs:s={},handlers:r={},viewData:i={},createComponentUpdateHook:n})=>{if(!Array.isArray(t))throw new Error("[Parser] Input to createVirtualDom must be an array, got "+typeof t);let o=jn(s),p=o.some(a=>a.targetType==="id");function l(a,c=""){return a.map((d,h)=>{let f=c?`${c}.${h}`:String(h);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 u=Object.entries(d);if(u.length===0)return null;let[y,m]=u[0];if(!isNaN(Number(y)))return Array.isArray(m)?l(m,f):typeof m=="object"&&m!==null&&Object.entries(m).length>0?l([m],f):String(m);u.length>1&&console.warn("Item has multiple keys, processing only the first:",y);let b,g,_=y.indexOf(" ");_===-1?(b=y,g=""):(b=y.substring(0,_),g=y.substring(_+1).trim());let S=b.split(/[.#]/)[0],A=S.includes("-"),k,C;try{({attrs:k,props:C}=Cf({attrsString:g,viewData:i,tagName:S,isWebComponent:A}))}catch(q){throw new Error(`[Parser] Failed to parse bindings for selector '${b}' with attrs '${g}': ${q.message}`)}let I=b.match(/#([^.#\s]+)/);I&&!Object.prototype.hasOwnProperty.call(k,"id")&&(k.id=I[1]);let V=null;k.id&&(V=k.id);let z=(b.match(/\.([^.#]+)/g)||[]).map(q=>q.substring(1)),B=typeof k.class=="string"?k.class.split(/\s+/).filter(Boolean):[],J=[...new Set([...z,...B])],Q=Object.create(null),ge=null;if(!A){z.forEach(Le=>{Q[Le]=!0});let q=b.match(/#([^.#\s]+)/);q&&(ge=q[1])}let we;typeof m=="string"||typeof m=="number"?we=String(m):Array.isArray(m)?we=l(m,f):we=[],ge&&!A&&(k.id=ge);let Pt=Object.create(null);if(o.length>0){p&&V&&Wf(V);let q=Bn({elementIdForRefs:V,classNames:J,refMatchers:o});if(q){let Le=q.refKey,tr=q.matchedValue||V||Le;if(q.refConfig&&q.refConfig.eventListeners){let Hn=q.refConfig.eventListeners,qn=zn(r);Object.entries(Hn).forEach(([Dt,Yn])=>{let Gn=`${Le}:${tr}:${Dt}`,sr=Wn({eventType:Dt,eventConfig:Yn,refKey:Le,handlers:r,eventRateLimitState:qn,stateKey:Gn,parseAndRenderFn:Cn,getPayloadContext:()=>i,onMissingHandler:Jn=>{console.warn(`[Parser] Handler '${Jn}' for refKey '${Le}' (matching '${tr}') is referenced but not found in available handlers.`)}});sr&&(Pt[Dt]=sr)})}}}let be={};if(V?be.key=V:b&&(be.key=`${b}-${f}`),Object.keys(k).length>0&&(be.attrs=k),Object.keys(Q).length>0&&(be.class=Q),Object.keys(Pt).length>0&&(be.on=Pt),Object.keys(C).length>0&&(be.props=C),A&&typeof n=="function"){let q=n({selector:b,tagName:S});q&&(be.hook=q)}try{return e(S,be,we)}catch(q){throw new Error(`[Parser] Error creating virtual node for '${S}': ${q.message}`)}}).filter(Boolean)}return l(t)},qf=({baseDeps:e,refs:t,dispatchEvent:s,store:r,render:i})=>{let n={...e,refs:t,dispatchEvent:s,store:r,render:i};return e?.__rtglI18nRuntime&&(Object.defineProperty(n,"i18n",{enumerable:!0,configurable:!0,get(){return e.__rtglI18nRuntime.getMessages()}}),n.locale=e.__rtglI18nRuntime.locale),n},Yf=({store:e,render:t,parseAndRenderFn:s})=>r=>{let{_event:i,_action:n}=r,o=s(r,{_event:i});if(!e[n])throw new Error(`[Store] Action 'store.${n}' is not defined.`);e[n](o),t()},Gf=({handlers:e,deps:t,parseAndRenderFn:s})=>{let r={handleCallStoreAction:Yf({store:t.store,render:t.render,parseAndRenderFn:s})};return Object.keys(e||{}).forEach(i=>{r[i]=n=>e[i](t,n)}),r},Jf=e=>{if(e&&typeof e.then=="function")throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");return e},Qf=({handlers:e,deps:t})=>{if(!e?.handleBeforeMount)return;let s=e.handleBeforeMount(t);return Jf(s)},Zf=({handlers:e,deps:t})=>{e?.handleAfterMount&&e.handleAfterMount(t)},Xf=({attributeName:e,oldValue:t,newValue:s,deps:r,propsSchemaKeys:i,toCamelCase:n,normalizeAttributeValue:o})=>{let p=n(e),l={};i.forEach(h=>{let f=r.props[h];f!==void 0&&(l[h]=f)});let a={...l},c=o(t),d=o(s);return c===void 0?delete a[p]:a[p]=c,d===void 0?delete l[p]:l[p]=d,{changedProp:p,oldProps:a,newProps:l}},ey=({propName:e,oldValue:t,newValue:s,deps:r,propsSchemaKeys:i})=>{let n={};i.forEach(p=>{let l=r.props[p];l!==void 0&&(n[p]=l)});let o={...n};return t===void 0?delete o[e]:o[e]=t,s===void 0?delete n[e]:n[e]=s,{changedProp:e,oldProps:o,newProps:n}},ty=({refKey:e,targets:t})=>e==="window"?t.window:e==="document"?t.document:null,sy=({refs:e={},handlers:t={},targets:s={window:globalThis.window,document:globalThis.document},parseAndRenderFn:r,getPayloadContext:i,timing:n={nowFn:Date.now,setTimeoutFn:setTimeout,clearTimeoutFn:clearTimeout},warnFn:o=console.warn})=>{let p=[],l=new Set,a=zn(t);return Object.entries(e).forEach(([c,d])=>{if(c!=="window"&&c!=="document")return;let h=ty({refKey:c,targets:s});!h||!d?.eventListeners||Object.entries(d.eventListeners).forEach(([f,u])=>{let y=`${c}:${f}`;l.add(y);let m=Wn({eventType:f,eventConfig:u,refKey:c,handlers:t,eventRateLimitState:a,stateKey:y,fallbackCurrentTarget:h,parseAndRenderFn:r,getPayloadContext:i,nowFn:n.nowFn,setTimeoutFn:n.setTimeoutFn,clearTimeoutFn:n.clearTimeoutFn,onMissingHandler:b=>{o(`[Runtime] Handler '${b}' for global ref '${c}' is referenced but not found in available handlers.`)}});m&&(h.addEventListener(f,m),p.push(()=>{h.removeEventListener(f,m)}))})}),()=>{p.forEach(c=>c()),l.forEach(c=>{let d=a.get(c);d&&d.debounceTimer&&n.clearTimeoutFn(d.debounceTimer),a.delete(c)})}},ry=e=>jn(e),iy=e=>{let t=[],s=e?.data?.class;s&&typeof s=="object"&&Object.entries(s).forEach(([i,n])=>{n&&t.push(i)});let r=e?.data?.attrs?.class;return typeof r=="string"&&r.split(/\s+/).filter(Boolean).forEach(i=>t.push(i)),[...new Set(t)]},ny=({rootVNode:e,refs:t})=>{let s={},r=ry(t),i=n=>{if(!n||typeof n!="object")return;let o=n?.data?.attrs?.id,p=iy(n),l=Bn({elementIdForRefs:o,classNames:p,refMatchers:r});if(n.elm&&l){let a=o||l.refKey;s[a]=n.elm}Array.isArray(n.children)&&n.children.forEach(i)};return i(e),s},oy=({propsSchemaKeys:e=[],toKebabCase:t})=>{let s=new Set(["key"]);return e.forEach(r=>{s.add(r),s.add(t(r))}),[...s]},ay=({baseDeps:e,refs:t,dispatchEvent:s,store:r,render:i})=>qf({baseDeps:e,refs:t,dispatchEvent:s,store:r,render:i}),ly=({refIds:e,nextRefIds:t={}})=>(Object.keys(e).forEach(s=>{delete e[s]}),Object.assign(e,t),e),py=({transformedHandlers:e,clearTimerFn:t=clearTimeout})=>{let s=e?.__eventRateLimitState;if(!(s instanceof Map))return 0;let r=0;return s.forEach(i=>{i&&i.debounceTimer&&(t(i.debounceTimer),r+=1)}),s.clear(),r},Xs=({instance:e})=>ay({baseDeps:e.deps,refs:e.refIds,dispatchEvent:e.dispatchEvent.bind(e),store:e.store,render:e.render.bind(e)}),dy=({instance:e,parseAndRenderFn:t,renderFn:s,createTransformedHandlersFn:r=Gf,runBeforeMountFn:i=Qf,attachGlobalRefListenersFn:n=sy,runAfterMountFn:o=Zf})=>{let p=Xs({instance:e});return e.transformedHandlers=r({handlers:e.handlers,deps:p,parseAndRenderFn:t}),e._unmountCallback=i({handlers:e.handlers,deps:p}),e._globalListenersCleanup=n({refs:e.refs,handlers:e.transformedHandlers,parseAndRenderFn:t,getPayloadContext:()=>e.viewData}),s(),o({handlers:e.handlers,deps:p}),p},cy=({instance:e,clearTimerFn:t=clearTimeout})=>(e._unmountCallback&&e._unmountCallback(),e._globalListenersCleanup&&e._globalListenersCleanup(),py({transformedHandlers:e.transformedHandlers,clearTimerFn:t})),uy=({instance:e,attributeName:t,oldValue:s,newValue:r,scheduleFrameFn:i})=>{if(!(s===r||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=Xs({instance:e}),o=Xf({attributeName:t,oldValue:s,newValue:r,deps:n,propsSchemaKeys:e._propsSchemaKeys,toCamelCase:gn,normalizeAttributeValue:ks});e.handlers.handleOnUpdate(n,o);return}i(()=>{e.render()})}},hy=({instance:e,propName:t,oldValue:s,newValue:r,scheduleFrameFn:i})=>{if(!(s===r||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=Xs({instance:e}),o=ey({propName:t,oldValue:s,newValue:r,deps:n,propsSchemaKeys:e._propsSchemaKeys});e.handlers.handleOnUpdate(n,o);return}i(()=>{e.render()})}},fy=({instance:e,createComponentUpdateHookFn:t,parseViewFn:s=Uf,collectRefElementsFn:r=ny,onError:i=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=s({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 o=r({rootVNode:e._oldVNode,refs:e.refs});return ly({refIds:e.refIds,nextRefIds:o}),e._oldVNode}catch(n){return i(n),e._oldVNode||null}},yy=`
1639
+ `:"")+p)}),s},Rs=e=>Array.isArray(e)?e.reduce((t,s)=>{if(Array.isArray(s))t.push(...Rs(s));else{if(s&&typeof s=="object"){let i=Object.entries(s);if(i.length>0){let[r,n]=i[0];Array.isArray(n)&&(s={[r]:Rs(n)})}}t.push(s)}return t},[]):e,gs=":",kf=new Set(["__proto__","constructor","prototype"]),$f=/^[A-Za-z_][A-Za-z0-9_.:-]*$/,dr=e=>$f.test(e),cr=(e,t)=>{if(!t)return e;let s=[],i="",r=!1;for(let n=0;n<t.length;n++){let o=t[n];if(!r&&o===".")i&&(s.push(i),i="");else if(!r&&o==="[")i&&(s.push(i),i=""),r=!0;else if(r&&o==="]"){if(i){if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))s.push(i.slice(1,-1));else{let p=Number(i);s.push(Number.isNaN(p)?i:p)}i=""}r=!1}else i+=o}return i&&s.push(i),s.reduce((n,o)=>{if(n==null)return;let p=typeof o=="number"?o:String(o);if(!(typeof p=="string"&&kf.has(p)))return n[p]},e)},Cf=e=>e.replace(/-([a-z0-9])/g,(t,s)=>s.toUpperCase()),If=({attrsString:e="",viewData:t={},tagName:s,isWebComponent:i})=>{let r={},n={},o=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=Cf(g);if(!A)throw new Error(`[Parser] Invalid ${S} prop name on '${s}'.`);if(Object.prototype.hasOwnProperty.call(n,A))throw new Error(`[Parser] Duplicate prop binding '${A}' on '${s}'. Use only one of 'name=value' or ':name=\${expr}'.`);n[A]=_},l=(g,_)=>{if(!dr(g))throw new Error(`[Parser] Invalid ${_} attribute name '${g}' on '${s}'.`)};if(!e)return{attrs:r,props:n};let a=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,c,d=new Set;for(;(c=a.exec(e))!==null;){let g=c[1],_=c[2]??c[3]??c[4]??"";if(d.add(g),g.startsWith(".")){r[g]=_;continue}if(g.startsWith(gs)){let S=g.substring(1),A=_;if(c[4]!==void 0&&c[4]!==""){let E=c[4],C=cr(t,E);C!==void 0&&(A=C)}p(S,A,"property-form");continue}if(g.startsWith("?")){let S=g.substring(1);l(S,"boolean toggle");let A=_;o(S);let E;A==="true"?E=!0:A==="false"||A===""?E=!1:E=cr(t,A),E&&(r[S]=""),i&&S!=="id"&&p(S,!!E,"boolean attribute-form");continue}l(g,"binding"),r[g]=_,i&&g!=="id"&&p(g,_,"attribute-form")}let h=e,f=[],u,y=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g;for(;(u=y.exec(e))!==null;)f.push(u[0]);f.forEach(g=>{h=h.replace(g," ")});let m=/(\S+?)(?=\s|$)/g,b;for(;(b=m.exec(h))!==null;){let g=b[1];if(!g.startsWith(".")&&!(d.has(g)||g.startsWith(gs)||g.includes("="))){if(g.startsWith("?")){let _=g.substring(1);l(_,"boolean toggle"),o(_),r[_]="",i&&_!=="id"&&p(_,!0,"boolean attribute-form");continue}if(!dr(g))throw new Error(`[Parser] Invalid attribute token '${g}' on '${s}'.`);!d.has(g)&&!g.startsWith(gs)&&!g.includes("=")&&(r[g]="",i&&g!=="id"&&p(g,!0,"boolean attribute-form"))}}return{attrs:r,props:n}},Ns=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,Of=/^\$for\s+([A-Za-z_][A-Za-z0-9_]*)(?:\s*,\s*([A-Za-z_][A-Za-z0-9_]*))?\s+in\s+.+$/,Dn=/^\$\{([^{}]+)\}$/,Tf=/^[A-Za-z_][A-Za-z0-9_]*(?:(?:\.[A-Za-z_][A-Za-z0-9_]*)|\[(?:\d+|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')\])*$/,ur=new WeakSet,Zs=(e,t,s)=>{let i=new Set(e);return t&&i.add(t),s&&i.add(s),i},Lf=(e,t)=>{if(typeof e!="string")return t;let s=e.match(Of);return s?Zs(t,s[1],s[2]):t},Pn=e=>{if(typeof e!="string"||!e.includes(":")&&!e.includes("."))return null;Ns.lastIndex=0;let t;for(;(t=Ns.exec(e))!==null;){let s=t[1];if(s.startsWith("."))return{bindingName:s,rawValue:t[2]??t[3]??t[4]??"",key:e};if(!s.startsWith(":"))continue;let i=t[2]!==void 0||t[3]!==void 0,r=t[2]??t[3]??t[4]??"";if(i||!Dn.test(r))return{bindingName:s,rawValue:r,key:e}}return null},Ds=(e,t=new Set)=>{if(Array.isArray(e)){for(let s of e){let i=Ds(s,t);if(i)return i}return null}if(!e||typeof e!="object")return null;for(let[s,i]of Object.entries(e)){let r=Pn(s);if(r)return r;let n=Lf(s,t),o=Ds(i,n);if(o)return o}return null},De=(e,t=new Set)=>{if(!e||typeof e!="object")return null;if(Array.isArray(e)){for(let s of e){let i=De(s,t);if(i)return i}return null}if(e.type===v.LOOP){let s=Zs(t,e.itemVar,e.indexVar);return De(e.body,s)}if(e.type===v.ARRAY&&Array.isArray(e.items))return De(e.items,t);if(e.type===v.OBJECT&&Array.isArray(e.properties)){for(let s of e.properties){let i=Pn(s.key);if(i)return i;let r=De(s.value,t);if(r)return r}return null}for(let s of Object.values(e)){let i=De(s,t);if(i)return i}return null},Vf=e=>$s([{[e]:""}])?.items?.[0]?.properties?.[0]?.parsedKey,Rf=e=>{let t=e.match(Dn);return t?t[1].trim():null},Nf=e=>{let t=e.match(/^([A-Za-z_][A-Za-z0-9_]*)/);return t?t[1]:null},Df=(e,t)=>{let s=!1,i=e.replace(Ns,(r,n,o,p,l)=>{if(!n.startsWith(":"))return r;let a=o??p??l??"",c=Rf(a);if(!c||!Tf.test(c))return r;let d=Nf(c);if(!d)return r;let h=t.has(d)?`#{${c}}`:c;return h===a?r:(s=!0,`${n}=${h}`)});return s?i:e},Pe=(e,t=new Set)=>{if(!(!e||typeof e!="object")){if(Array.isArray(e)){e.forEach(s=>Pe(s,t));return}if(e.type===v.LOOP){let s=Zs(t,e.itemVar,e.indexVar);Pe(e.body,s);return}if(e.type===v.ARRAY&&Array.isArray(e.items)){e.items.forEach(s=>Pe(s,t));return}if(e.type===v.OBJECT&&Array.isArray(e.properties)){e.properties.forEach(s=>{let i=Df(s.key,t);if(i!==s.key){s.key=i;let r=Vf(i);r?s.parsedKey=r:delete s.parsedKey}Pe(s.value,t)});return}Object.values(e).forEach(s=>{Pe(s,t)})}},Pf=e=>e?e.type&&typeof e.type=="number"?De(e):Ds(e):null,jf=e=>{if(!e||typeof e!="object"||ur.has(e))return;let t=Pf(e);if(t)throw new Error(`Property-form bindings must use ':prop=\${value}' syntax. Found '${t.bindingName}=${t.rawValue}' in '${t.key}'.`);Pe(e),ur.add(e)},Bf=/^[a-z][a-zA-Z0-9]*\*?$/,zf=/^[a-zA-Z][a-zA-Z0-9_-]*\*?$/,Mf=/^[a-z][a-zA-Z0-9]*$/,hr=new Set(["window","document"]),jn=e=>Object.entries(e||{}).map(([t,s])=>{if(hr.has(t))return{refKey:t,refConfig:s,targetType:"global",isWildcard:!1,prefix:t};let i="id",r=t;t.startsWith(".")?(i="class",r=t.slice(1)):t.startsWith("#")&&(i="id",r=t.slice(1));let n=r.endsWith("*")?r.slice(0,-1):r;if(hr.has(n))throw new Error(`[Parser] Invalid ref key '${t}'. Reserved global keys must be exactly 'window' or 'document'.`);if(i==="id"&&!Bf.test(r))throw new Error(`[Parser] Invalid ref key '${t}'. Use camelCase IDs (optional '#', optional '*') or class refs with '.' prefix.`);if(i==="class"&&!zf.test(r))throw new Error(`[Parser] Invalid ref key '${t}'. Class refs must start with '.' and use class-compatible names (optional '*').`);let o=r.endsWith("*"),p=o?r.slice(0,-1):r;return{refKey:t,refConfig:s,targetType:i,isWildcard:o,prefix:p}}),Wf=e=>{if(!Mf.test(e))throw new Error(`[Parser] Invalid element id '${e}' for refs. Use camelCase ids only. Kebab-case ids are not supported.`)},fr=({value:e,prefix:t,isWildcard:s})=>typeof e!="string"||e.length===0?!1:s?e.startsWith(t):e===t,Bn=({elementIdForRefs:e,classNames:t=[],refMatchers:s})=>{let i=[],r=Array.isArray(t)?t:[];return s.forEach(n=>{if(n.targetType==="global")return;if(n.targetType==="id"){fr({value:e,prefix:n.prefix,isWildcard:n.isWildcard})&&i.push({...n,matchedValue:e});return}let o=r.find(p=>fr({value:p,prefix:n.prefix,isWildcard:n.isWildcard}));o&&i.push({...n,matchedValue:o})}),i.length===0?null:(i.sort((n,o)=>{let p=n.targetType==="id"?2:1,l=o.targetType==="id"?2:1;return p!==l?l-p:!n.isWildcard&&o.isWildcard?-1:n.isWildcard&&!o.isWildcard?1:o.prefix.length-n.prefix.length}),i[0])},et=({optionName:e,optionValue:t,eventType:s,refKey:i})=>{if(t!==void 0&&typeof t!="boolean")throw new Error(`[Parser] Invalid '${e}' for event '${s}' on ref '${i}'. Expected boolean.`)},yr=({optionName:e,optionValue:t,eventType:s,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 '${s}' on ref '${i}'. Expected non-negative number.`)},Ff=({eventType:e,eventConfig:t,refKey:s})=>{if(typeof t!="object"||t===null)throw new Error(`[Parser] Invalid event config for event '${e}' on ref '${s}'.`);let i=Object.prototype.hasOwnProperty.call(t,"debounce"),r=Object.prototype.hasOwnProperty.call(t,"throttle");if(et({optionName:"preventDefault",optionValue:t.preventDefault,eventType:e,refKey:s}),et({optionName:"stopPropagation",optionValue:t.stopPropagation,eventType:e,refKey:s}),et({optionName:"stopImmediatePropagation",optionValue:t.stopImmediatePropagation,eventType:e,refKey:s}),et({optionName:"targetOnly",optionValue:t.targetOnly,eventType:e,refKey:s}),et({optionName:"once",optionValue:t.once,eventType:e,refKey:s}),yr({optionName:"debounce",optionValue:t.debounce,eventType:e,refKey:s}),yr({optionName:"throttle",optionValue:t.throttle,eventType:e,refKey:s}),i&&r)throw new Error(`[Parser] Event '${e}' on ref '${s}' 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:r}},zn=e=>(e.__eventRateLimitState||Object.defineProperty(e,"__eventRateLimitState",{value:new Map,enumerable:!1,configurable:!0}),e.__eventRateLimitState),Kf=({eventConfig:e,handlers:t,onMissingHandler:s,parseAndRenderFn:i,getPayloadContext:r})=>{let n=o=>{let p=e.payload&&typeof e.payload=="object"&&!Array.isArray(e.payload)?e.payload:{};if(typeof i!="function")return p;let l=typeof r=="function"?r():{};return i(p,{...l&&typeof l=="object"?l:{},_event:o})};if(e.action){if(typeof t.handleCallStoreAction!="function")throw new Error(`[Runtime] Action listener '${e.action}' requires handlers.handleCallStoreAction.`);return o=>{let p=n(o);t.handleCallStoreAction({...p,_event:o,_action:e.action})}}return e.handler&&t[e.handler]?o=>{let p=n(o);t[e.handler]({...p,_event:o})}:(e.handler&&s?.(e.handler),null)},Uf=({eventConfig:e,callback:t,hasDebounce:s,hasThrottle:i,stateKey:r,eventRateLimitState:n,fallbackCurrentTarget:o=null,nowFn:p=Date.now,setTimeoutFn:l=setTimeout,clearTimeoutFn:a=clearTimeout})=>c=>{let d=n.get(r)||{},h=c.currentTarget||o;if(e.once)if(h){if(d.onceTargets||(d.onceTargets=new WeakSet),d.onceTargets.has(h)){n.set(r,d);return}d.onceTargets.add(h)}else if(d.onceTriggered){n.set(r,d);return}else d.onceTriggered=!0;if(e.targetOnly&&c.target!==c.currentTarget){n.set(r,d);return}if(e.preventDefault&&c.preventDefault(),e.stopImmediatePropagation?c.stopImmediatePropagation():e.stopPropagation&&c.stopPropagation(),s){d.debounceTimer&&a(d.debounceTimer),d.debounceTimer=l(()=>{let f=d.debounceTimer;try{t(c)}catch(u){throw a(f),d.debounceTimer=null,u}d.debounceTimer=null},e.debounce),n.set(r,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(r,d),t(c);return}n.set(r,d);return}n.set(r,d),t(c)},Mn=({eventType:e,eventConfig:t,refKey:s,handlers:i,eventRateLimitState:r,stateKey:n,fallbackCurrentTarget:o=null,parseAndRenderFn:p,getPayloadContext:l,onMissingHandler:a,nowFn:c=Date.now,setTimeoutFn:d=setTimeout,clearTimeoutFn:h=clearTimeout})=>{let{hasDebounce:f,hasThrottle:u}=Ff({eventType:e,eventConfig:t,refKey:s}),y=Kf({eventConfig:t,handlers:i,onMissingHandler:a,parseAndRenderFn:p,getPayloadContext:l});return y?Uf({eventConfig:t,callback:y,hasDebounce:f,hasThrottle:u,stateKey:n,eventRateLimitState:r,fallbackCurrentTarget:o,nowFn:c,setTimeoutFn:d,clearTimeoutFn:h}):null},Hf=({h:e,template:t,viewData:s,refs:i,handlers:r,createComponentUpdateHook:n})=>{jf(t);let o=vn(t,s,{}),p=Rs(o),l=qf({h:e,items:p,refs:i,handlers:r,viewData:s,createComponentUpdateHook:n});return e("div",{style:{display:"contents"}},l)},qf=({h:e,items:t,refs:s={},handlers:i={},viewData:r={},createComponentUpdateHook:n})=>{if(!Array.isArray(t))throw new Error("[Parser] Input to createVirtualDom must be an array, got "+typeof t);let o=jn(s),p=o.some(a=>a.targetType==="id");function l(a,c=""){return a.map((d,h)=>{let f=c?`${c}.${h}`:String(h);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 u=Object.entries(d);if(u.length===0)return null;let[y,m]=u[0];if(!isNaN(Number(y)))return Array.isArray(m)?l(m,f):typeof m=="object"&&m!==null&&Object.entries(m).length>0?l([m],f):String(m);u.length>1&&console.warn("Item has multiple keys, processing only the first:",y);let b,g,_=y.indexOf(" ");_===-1?(b=y,g=""):(b=y.substring(0,_),g=y.substring(_+1).trim());let S=b.split(/[.#]/)[0],A=S.includes("-"),E,C;try{({attrs:E,props:C}=If({attrsString:g,viewData:r,tagName:S,isWebComponent:A}))}catch(q){throw new Error(`[Parser] Failed to parse bindings for selector '${b}' with attrs '${g}': ${q.message}`)}let I=b.match(/#([^.#\s]+)/);I&&!Object.prototype.hasOwnProperty.call(E,"id")&&(E.id=I[1]);let V=null;E.id&&(V=E.id);let z=(b.match(/\.([^.#]+)/g)||[]).map(q=>q.substring(1)),B=typeof E.class=="string"?E.class.split(/\s+/).filter(Boolean):[],J=[...new Set([...z,...B])],Q=Object.create(null),ge=null;if(!A){z.forEach(Le=>{Q[Le]=!0});let q=b.match(/#([^.#\s]+)/);q&&(ge=q[1])}let we;typeof m=="string"||typeof m=="number"?we=String(m):Array.isArray(m)?we=l(m,f):we=[],ge&&!A&&(E.id=ge);let Dt=Object.create(null);if(o.length>0){p&&V&&Wf(V);let q=Bn({elementIdForRefs:V,classNames:J,refMatchers:o});if(q){let Le=q.refKey,ti=q.matchedValue||V||Le;if(q.refConfig&&q.refConfig.eventListeners){let Hn=q.refConfig.eventListeners,qn=zn(i);Object.entries(Hn).forEach(([Pt,Yn])=>{let Gn=`${Le}:${ti}:${Pt}`,si=Mn({eventType:Pt,eventConfig:Yn,refKey:Le,handlers:i,eventRateLimitState:qn,stateKey:Gn,parseAndRenderFn:Cn,getPayloadContext:()=>r,onMissingHandler:Jn=>{console.warn(`[Parser] Handler '${Jn}' for refKey '${Le}' (matching '${ti}') is referenced but not found in available handlers.`)}});si&&(Dt[Pt]=si)})}}}let be={};if(V?be.key=V:b&&(be.key=`${b}-${f}`),Object.keys(E).length>0&&(be.attrs=E),Object.keys(Q).length>0&&(be.class=Q),Object.keys(Dt).length>0&&(be.on=Dt),Object.keys(C).length>0&&(be.props=C),A&&typeof n=="function"){let q=n({selector:b,tagName:S});q&&(be.hook=q)}try{return e(S,be,we)}catch(q){throw new Error(`[Parser] Error creating virtual node for '${S}': ${q.message}`)}}).filter(Boolean)}return l(t)},Yf=({baseDeps:e,refs:t,dispatchEvent:s,store:i,render:r})=>{let n={...e,refs:t,dispatchEvent:s,store:i,render:r};return e?.__rtglI18nRuntime&&(Object.defineProperty(n,"i18n",{enumerable:!0,configurable:!0,get(){return e.__rtglI18nRuntime.getMessages()}}),n.locale=e.__rtglI18nRuntime.locale),n},Gf=({store:e,render:t,parseAndRenderFn:s})=>i=>{let{_event:r,_action:n}=i,o=s(i,{_event:r});if(!e[n])throw new Error(`[Store] Action 'store.${n}' is not defined.`);e[n](o),t()},Jf=({handlers:e,deps:t,parseAndRenderFn:s})=>{let i={handleCallStoreAction:Gf({store:t.store,render:t.render,parseAndRenderFn:s})};return Object.keys(e||{}).forEach(r=>{i[r]=n=>e[r](t,n)}),i},Qf=e=>{if(e&&typeof e.then=="function")throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");return e},Zf=({handlers:e,deps:t})=>{if(!e?.handleBeforeMount)return;let s=e.handleBeforeMount(t);return Qf(s)},Xf=({handlers:e,deps:t})=>{e?.handleAfterMount&&e.handleAfterMount(t)},ey=({attributeName:e,oldValue:t,newValue:s,deps:i,propsSchemaKeys:r,toCamelCase:n,normalizeAttributeValue:o})=>{let p=n(e),l={};r.forEach(h=>{let f=i.props[h];f!==void 0&&(l[h]=f)});let a={...l},c=o(t),d=o(s);return c===void 0?delete a[p]:a[p]=c,d===void 0?delete l[p]:l[p]=d,{changedProp:p,oldProps:a,newProps:l}},ty=({propName:e,oldValue:t,newValue:s,deps:i,propsSchemaKeys:r})=>{let n={};r.forEach(p=>{let l=i.props[p];l!==void 0&&(n[p]=l)});let o={...n};return t===void 0?delete o[e]:o[e]=t,s===void 0?delete n[e]:n[e]=s,{changedProp:e,oldProps:o,newProps:n}},sy=({refKey:e,targets:t})=>e==="window"?t.window:e==="document"?t.document:null,iy=({refs:e={},handlers:t={},targets:s={window:globalThis.window,document:globalThis.document},parseAndRenderFn:i,getPayloadContext:r,timing:n={nowFn:Date.now,setTimeoutFn:setTimeout,clearTimeoutFn:clearTimeout},warnFn:o=console.warn})=>{let p=[],l=new Set,a=zn(t);return Object.entries(e).forEach(([c,d])=>{if(c!=="window"&&c!=="document")return;let h=sy({refKey:c,targets:s});!h||!d?.eventListeners||Object.entries(d.eventListeners).forEach(([f,u])=>{let y=`${c}:${f}`;l.add(y);let m=Mn({eventType:f,eventConfig:u,refKey:c,handlers:t,eventRateLimitState:a,stateKey:y,fallbackCurrentTarget:h,parseAndRenderFn:i,getPayloadContext:r,nowFn:n.nowFn,setTimeoutFn:n.setTimeoutFn,clearTimeoutFn:n.clearTimeoutFn,onMissingHandler:b=>{o(`[Runtime] Handler '${b}' for global ref '${c}' is referenced but not found in available handlers.`)}});m&&(h.addEventListener(f,m),p.push(()=>{h.removeEventListener(f,m)}))})}),()=>{p.forEach(c=>c()),l.forEach(c=>{let d=a.get(c);d&&d.debounceTimer&&n.clearTimeoutFn(d.debounceTimer),a.delete(c)})}},ry=e=>jn(e),ny=e=>{let t=[],s=e?.data?.class;s&&typeof s=="object"&&Object.entries(s).forEach(([r,n])=>{n&&t.push(r)});let i=e?.data?.attrs?.class;return typeof i=="string"&&i.split(/\s+/).filter(Boolean).forEach(r=>t.push(r)),[...new Set(t)]},oy=({rootVNode:e,refs:t})=>{let s={},i=ry(t),r=n=>{if(!n||typeof n!="object")return;let o=n?.data?.attrs?.id,p=ny(n),l=Bn({elementIdForRefs:o,classNames:p,refMatchers:i});if(n.elm&&l){let a=o||l.refKey;s[a]=n.elm}Array.isArray(n.children)&&n.children.forEach(r)};return r(e),s},ay=({propsSchemaKeys:e=[],toKebabCase:t})=>{let s=new Set(["key"]);return e.forEach(i=>{s.add(i),s.add(t(i))}),[...s]},ly=({baseDeps:e,refs:t,dispatchEvent:s,store:i,render:r})=>Yf({baseDeps:e,refs:t,dispatchEvent:s,store:i,render:r}),py=({refIds:e,nextRefIds:t={}})=>(Object.keys(e).forEach(s=>{delete e[s]}),Object.assign(e,t),e),dy=({transformedHandlers:e,clearTimerFn:t=clearTimeout})=>{let s=e?.__eventRateLimitState;if(!(s instanceof Map))return 0;let i=0;return s.forEach(r=>{r&&r.debounceTimer&&(t(r.debounceTimer),i+=1)}),s.clear(),i},Xs=({instance:e})=>ly({baseDeps:e.deps,refs:e.refIds,dispatchEvent:e.dispatchEvent.bind(e),store:e.store,render:e.render.bind(e)}),cy=({instance:e,parseAndRenderFn:t,renderFn:s,createTransformedHandlersFn:i=Jf,runBeforeMountFn:r=Zf,attachGlobalRefListenersFn:n=iy,runAfterMountFn:o=Xf})=>{let p=Xs({instance:e});return e.transformedHandlers=i({handlers:e.handlers,deps:p,parseAndRenderFn:t}),e._unmountCallback=r({handlers:e.handlers,deps:p}),e._globalListenersCleanup=n({refs:e.refs,handlers:e.transformedHandlers,parseAndRenderFn:t,getPayloadContext:()=>e.viewData}),s(),o({handlers:e.handlers,deps:p}),p},uy=({instance:e,clearTimerFn:t=clearTimeout})=>(e._unmountCallback&&e._unmountCallback(),e._globalListenersCleanup&&e._globalListenersCleanup(),dy({transformedHandlers:e.transformedHandlers,clearTimerFn:t})),hy=({instance:e,attributeName:t,oldValue:s,newValue:i,scheduleFrameFn:r})=>{if(!(s===i||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=Xs({instance:e}),o=ey({attributeName:t,oldValue:s,newValue:i,deps:n,propsSchemaKeys:e._propsSchemaKeys,toCamelCase:gn,normalizeAttributeValue:Es});e.handlers.handleOnUpdate(n,o);return}r(()=>{e.render()})}},fy=({instance:e,propName:t,oldValue:s,newValue:i,scheduleFrameFn:r})=>{if(!(s===i||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=Xs({instance:e}),o=ty({propName:t,oldValue:s,newValue:i,deps:n,propsSchemaKeys:e._propsSchemaKeys});e.handlers.handleOnUpdate(n,o);return}r(()=>{e.render()})}},yy=({instance:e,createComponentUpdateHookFn:t,parseViewFn:s=Hf,collectRefElementsFn:i=oy,onError:r=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=s({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 o=i({rootVNode:e._oldVNode,refs:e.refs});return py({refIds:e.refIds,nextRefIds:o}),e._oldVNode}catch(n){return r(n),e._oldVNode||null}},my=`
1625
1640
  a, a:link, a:visited, a:hover, a:active {
1626
1641
  display: contents;
1627
1642
  color: inherit;
@@ -1633,4 +1648,4 @@ ${p}
1633
1648
  font: inherit;
1634
1649
  cursor: pointer;
1635
1650
  }
1636
- `,er="data-rtgl-render-target",Mn="__rtglRenderTarget",Ds=e=>!e||typeof e!="object"?!1:typeof e.getAttribute=="function"?e.getAttribute(er)!==null:e[Mn]===!0,mi=e=>{!e||typeof e!="object"||(typeof e.setAttribute=="function"?e.setAttribute(er,""):e[Mn]=!0)},my=e=>{if(!(!e||typeof e!="object"))return typeof e.querySelector=="function"?e.querySelector(`[${er}]`)??e.firstElementChild:Array.isArray(e.childNodes)?e.childNodes.find(Ds)??e.childNodes[0]:Array.isArray(e.children)?e.children.find(Ds)??e.children[0]:e.firstElementChild},gy=({host:e,cssText:t,createStyleSheet:s=()=>new CSSStyleSheet,createElement:r=i=>document.createElement(i)})=>{let i=e.shadowRoot??e.attachShadow({mode:"open"}),n=s();n.replaceSync(yy);let o=[n];if(t){let a=s();a.replaceSync(t),o.push(a)}i.adoptedStyleSheets=o;let p=my(i);p?(p.style.cssText="display: contents;",Ds(p)||mi(p)):(p=r("div"),p.style.cssText="display: contents;",mi(p),i.appendChild(p)),p.parentNode!==i&&i.appendChild(p);let l=bn(e);return l&&typeof l=="object"&&(l.display="contents"),{shadow:i,renderTarget:p,adoptedStyleSheets:o}},js=(e,t=requestAnimationFrame)=>t(e),by=({scheduleFrameFn:e=js}={})=>({update:(t,s)=>{let r=t.data?.props||{},i=s.data?.props||{};if(JSON.stringify(r)===JSON.stringify(i))return;let n=s.elm;!n||typeof n.render!="function"||(n.setAttribute("isDirty","true"),e(()=>{if(n.render(),n.removeAttribute("isDirty"),n.handlers&&n.handlers.handleOnUpdate){let o={...n.deps,store:n.store,render:n.render.bind(n),handlers:n.handlers,dispatchEvent:n.dispatchEvent.bind(n),refs:n.refIds||{}};n.handlers.handleOnUpdate(o,{oldProps:r,newProps:i})}}))}}),vy=({elementName:e,propsSchema:t,propsSchemaKeys:s,template:r,refs:i,styles:n,handlers:o,methods:p,constants:l,store:a,patch:c,h:d,deps:h})=>{class f extends HTMLElement{elementName;styles;_snabbdomH;store;props;propsSchema;template;handlers;methods;constants;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_globalListenersCleanup;_oldVNode;deps;i18nRuntime;_i18nUnsubscribe;_propsSchemaKeys=[];cssText;static get observedAttributes(){return["key"]}get viewData(){let m={};return this.store.selectViewData&&(m=this.store.selectViewData()),{...m,i18n:this.i18nRuntime?.getMessages?.()||{}}}connectedCallback(){let m=gy({host:this,cssText:this.cssText});this.shadow=m.shadow,this.renderTarget=m.renderTarget,this.i18nRuntime?.subscribe&&!this._i18nUnsubscribe&&(this._i18nUnsubscribe=this.i18nRuntime.subscribe(()=>{this.render()})),dy({instance:this,parseAndRenderFn:Cn,renderFn:this.render})}disconnectedCallback(){this._i18nUnsubscribe&&(this._i18nUnsubscribe(),this._i18nUnsubscribe=void 0),cy({instance:this,clearTimerFn:clearTimeout})}attributeChangedCallback(m,b,g){uy({instance:this,attributeName:m,oldValue:b,newValue:g,scheduleFrameFn:js})}render=()=>{fy({instance:this,createComponentUpdateHookFn:by})}}class u extends f{static get observedAttributes(){return oy({propsSchemaKeys:s,toKebabCase:mn})}constructor(){super(),this.constants=Sf({setupConstants:h?.constants,fileConstants:l}),this.propsSchema=t,Ch({source:this,allowedKeys:s,onPropChange:({propName:m,oldValue:b,newValue:g})=>{hy({instance:this,propName:m,oldValue:b,newValue:g,scheduleFrameFn:js})}}),this.props=t?Ih(this,s):{},this._propsSchemaKeys=s,this.elementName=e,this.styles=n,this.i18nRuntime=h?.__rtglI18nRuntime,this.store=xf(a,this.props,this.constants,{getI18n:()=>this.i18nRuntime?.getMessages?.()||{},locale:this.i18nRuntime?.locale}),this.template=r,this.handlers=o,this.methods=p,this.refs=i,this.patch=c,this.deps={...h,locale:this.i18nRuntime?.locale||h?.locale,store:this.store,render:this.render,handlers:o,props:this.props,constants:this.constants},this.i18nRuntime&&Object.defineProperty(this.deps,"i18n",{enumerable:!0,configurable:!0,get:()=>this.i18nRuntime.getMessages()}),df(this,this.methods),this._snabbdomH=d,this.cssText=Af(e,n)}}return u};function ot(e,t,s,r,i){let n=t===void 0?void 0:t.key;return{sel:e,data:t,children:s,text:r,elm:i,key:n}}var Ct=Array.isArray;function bt(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function wy(e,t){return document.createElement(e,t)}function _y(e,t,s){return document.createElementNS(e,t,s)}function xy(){return Ee(document.createDocumentFragment())}function Sy(e){return document.createTextNode(e)}function Ay(e){return document.createComment(e)}function ky(e,t,s){if(me(e)){let r=e;for(;r&&me(r);)r=Ee(r).parent;e=r??e}me(t)&&(t=Ee(t,e)),s&&me(s)&&(s=Ee(s).firstChildNode),e.insertBefore(t,s)}function Ey(e,t){e.removeChild(t)}function $y(e,t){me(t)&&(t=Ee(t,e)),e.appendChild(t)}function Fn(e){if(me(e)){for(;e&&me(e);)e=Ee(e).parent;return e??null}return e.parentNode}function Cy(e){var t;if(me(e)){let s=Ee(e),r=Fn(s);if(r&&s.lastChildNode){let i=Array.from(r.childNodes),n=i.indexOf(s.lastChildNode);return(t=i[n+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function Iy(e){return e.tagName}function Oy(e,t){e.textContent=t}function Ty(e){return e.textContent}function Ly(e){return e.nodeType===1}function Vy(e){return e.nodeType===3}function Ry(e){return e.nodeType===8}function me(e){return e.nodeType===11}function Ee(e,t){var s,r,i;let n=e;return(s=n.parent)!==null&&s!==void 0||(n.parent=t??null),(r=n.firstChildNode)!==null&&r!==void 0||(n.firstChildNode=e.firstChild),(i=n.lastChildNode)!==null&&i!==void 0||(n.lastChildNode=e.lastChild),n}var Ny={createElement:wy,createElementNS:_y,createTextNode:Sy,createDocumentFragment:xy,createComment:Ay,insertBefore:ky,removeChild:Ey,appendChild:$y,parentNode:Fn,nextSibling:Cy,tagName:Iy,setTextContent:Oy,getTextContent:Ty,isElement:Ly,isText:Vy,isComment:Ry,isDocumentFragment:me};function gt(e){return e===void 0}function se(e){return e!==void 0}var bs=ot("",{},[],void 0,void 0);function tt(e,t){var s,r;let i=e.key===t.key,n=((s=e.data)===null||s===void 0?void 0:s.is)===((r=t.data)===null||r===void 0?void 0:r.is),o=e.sel===t.sel,p=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return o&&i&&n&&p}function Py(){throw new Error("The document fragment is not supported on this platform.")}function Dy(e,t){return e.isElement(t)}function jy(e,t){return e.isDocumentFragment(t)}function By(e,t,s){var r;let i={};for(let n=t;n<=s;++n){let o=(r=e[n])===null||r===void 0?void 0:r.key;o!==void 0&&(i[o]=n)}return i}var zy=["create","update","remove","destroy","pre","post"];function Wy(e,t,s){let r={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=Ny;for(let u of zy)for(let y of e){let m=y[u];m!==void 0&&r[u].push(m)}function n(u){let y=u.id?"#"+u.id:"",m=u.getAttribute("class"),b=m?"."+m.split(" ").join("."):"";return ot(i.tagName(u).toLowerCase()+y+b,{},[],void 0,u)}function o(u){return ot(void 0,{},[],void 0,u)}function p(u,y){return function(){if(--y===0){let m=i.parentNode(u);m!==null&&i.removeChild(m,u)}}}function l(u,y){var m,b,g,_;let S,A=u.data;if(A!==void 0){let I=(m=A.hook)===null||m===void 0?void 0:m.init;se(I)&&(I(u),A=u.data)}let k=u.children,C=u.sel;if(C==="!")gt(u.text)&&(u.text=""),u.elm=i.createComment(u.text);else if(C==="")u.elm=i.createTextNode(u.text);else if(C!==void 0){let I=C.indexOf("#"),V=C.indexOf(".",I),z=I>0?I:C.length,B=V>0?V:C.length,J=I!==-1||V!==-1?C.slice(0,Math.min(z,B)):C,Q=u.elm=se(A)&&se(S=A.ns)?i.createElementNS(S,J,A):i.createElement(J,A);for(z<B&&Q.setAttribute("id",C.slice(z+1,B)),V>0&&Q.setAttribute("class",C.slice(B+1).replace(/\./g," ")),S=0;S<r.create.length;++S)r.create[S](bs,u);if(bt(u.text)&&(!Ct(k)||k.length===0)&&i.appendChild(Q,i.createTextNode(u.text)),Ct(k))for(S=0;S<k.length;++S){let we=k[S];we!=null&&i.appendChild(Q,l(we,y))}let ge=u.data.hook;se(ge)&&((b=ge.create)===null||b===void 0||b.call(ge,bs,u),ge.insert&&y.push(u))}else if(!((g=void 0)===null||g===void 0)&&g.fragments&&u.children){for(u.elm=((_=i.createDocumentFragment)!==null&&_!==void 0?_:Py)(),S=0;S<r.create.length;++S)r.create[S](bs,u);for(S=0;S<u.children.length;++S){let I=u.children[S];I!=null&&i.appendChild(u.elm,l(I,y))}}else u.elm=i.createTextNode(u.text);return u.elm}function a(u,y,m,b,g,_){for(;b<=g;++b){let S=m[b];S!=null&&i.insertBefore(u,l(S,_),y)}}function c(u){var y,m;let b=u.data;if(b!==void 0){(m=(y=b?.hook)===null||y===void 0?void 0:y.destroy)===null||m===void 0||m.call(y,u);for(let g=0;g<r.destroy.length;++g)r.destroy[g](u);if(u.children!==void 0)for(let g=0;g<u.children.length;++g){let _=u.children[g];_!=null&&typeof _!="string"&&c(_)}}}function d(u,y,m,b){for(var g,_;m<=b;++m){let S,A,k=y[m];if(k!=null)if(se(k.sel)){c(k),S=r.remove.length+1,A=p(k.elm,S);for(let I=0;I<r.remove.length;++I)r.remove[I](k,A);let C=(_=(g=k?.data)===null||g===void 0?void 0:g.hook)===null||_===void 0?void 0:_.remove;se(C)?C(k,A):A()}else k.children?(c(k),d(u,k.children,0,k.children.length-1)):i.removeChild(u,k.elm)}}function h(u,y,m,b){let g=0,_=0,S=y.length-1,A=y[0],k=y[S],C=m.length-1,I=m[0],V=m[C],z,B,J,Q;for(;g<=S&&_<=C;)A==null?A=y[++g]:k==null?k=y[--S]:I==null?I=m[++_]:V==null?V=m[--C]:tt(A,I)?(f(A,I,b),A=y[++g],I=m[++_]):tt(k,V)?(f(k,V,b),k=y[--S],V=m[--C]):tt(A,V)?(f(A,V,b),i.insertBefore(u,A.elm,i.nextSibling(k.elm)),A=y[++g],V=m[--C]):tt(k,I)?(f(k,I,b),i.insertBefore(u,k.elm,A.elm),k=y[--S],I=m[++_]):(z===void 0&&(z=By(y,g,S)),B=z[I.key],gt(B)?(i.insertBefore(u,l(I,b),A.elm),I=m[++_]):gt(z[V.key])?(i.insertBefore(u,l(V,b),i.nextSibling(k.elm)),V=m[--C]):(J=y[B],J.sel!==I.sel?i.insertBefore(u,l(I,b),A.elm):(f(J,I,b),y[B]=void 0,i.insertBefore(u,J.elm,A.elm)),I=m[++_]));_<=C&&(Q=m[C+1]==null?null:m[C+1].elm,a(u,Q,m,_,C,b)),g<=S&&d(u,y,g,S)}function f(u,y,m){var b,g,_,S,A,k,C,I;let V=(b=y.data)===null||b===void 0?void 0:b.hook;(g=V?.prepatch)===null||g===void 0||g.call(V,u,y);let z=y.elm=u.elm;if(u===y)return;if(y.data!==void 0||se(y.text)&&y.text!==u.text){(_=y.data)!==null&&_!==void 0||(y.data={}),(S=u.data)!==null&&S!==void 0||(u.data={});for(let Q=0;Q<r.update.length;++Q)r.update[Q](u,y);(C=(k=(A=y.data)===null||A===void 0?void 0:A.hook)===null||k===void 0?void 0:k.update)===null||C===void 0||C.call(k,u,y)}let B=u.children,J=y.children;gt(y.text)?se(B)&&se(J)?B!==J&&h(z,B,J,m):se(J)?(se(u.text)&&i.setTextContent(z,""),a(z,null,J,0,J.length-1,m)):se(B)?d(z,B,0,B.length-1):se(u.text)&&i.setTextContent(z,""):u.text!==y.text&&(se(B)&&d(z,B,0,B.length-1),i.setTextContent(z,y.text)),(I=V?.postpatch)===null||I===void 0||I.call(V,u,y)}return function(u,y){let m,b,g,_=[];for(m=0;m<r.pre.length;++m)r.pre[m]();for(Dy(i,u)?u=n(u):jy(i,u)&&(u=o(u)),tt(u,y)?f(u,y,_):(b=u.elm,g=i.parentNode(b),l(y,_),g!==null&&(i.insertBefore(g,y.elm,i.nextSibling(b)),d(g,[u],0,0))),m=0;m<_.length;++m)_[m].data.hook.insert(_[m]);for(m=0;m<r.post.length;++m)r.post[m]();return y}}function gi(e,t){let s,r,i=t.elm,n=e.data.class,o=t.data.class;if(!(!n&&!o)&&n!==o){n=n||{},o=o||{};for(r in n)n[r]&&!Object.prototype.hasOwnProperty.call(o,r)&&i.classList.remove(r);for(r in o)s=o[r],s!==n[r]&&i.classList[s?"add":"remove"](r)}}var My={create:gi,update:gi};function bi(e,t){let s,r,i,n=t.elm,o=e.data.props,p=t.data.props;if(!(!o&&!p)&&o!==p){o=o||{},p=p||{};for(s in p)r=p[s],i=o[s],i!==r&&(s!=="value"||n[s]!==r)&&(n[s]=r)}}var Fy={create:bi,update:bi},Ky="http://www.w3.org/1999/xlink",Uy="http://www.w3.org/2000/xmlns/",Hy="http://www.w3.org/XML/1998/namespace",vi=58,qy=120,Yy=109;function wi(e,t){let s,r=t.elm,i=e.data.attrs,n=t.data.attrs;if(!(!i&&!n)&&i!==n){i=i||{},n=n||{};for(s in n){let o=n[s];i[s]!==o&&(o===!0?r.setAttribute(s,""):o===!1?r.removeAttribute(s):s.charCodeAt(0)!==qy?r.setAttribute(s,o):s.charCodeAt(3)===vi?r.setAttributeNS(Hy,s,o):s.charCodeAt(5)===vi?s.charCodeAt(1)===Yy?r.setAttributeNS(Uy,s,o):r.setAttributeNS(Ky,s,o):r.setAttribute(s,o))}for(s in i)s in n||r.removeAttribute(s)}}var Gy={create:wi,update:wi},_i=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,Jy=function(e){_i(function(){_i(e)})},Bs=!1;function Qy(e,t,s){Jy(function(){e[t]=s})}function xi(e,t){let s,r,i=t.elm,n=e.data.style,o=t.data.style;if(!n&&!o||n===o)return;n=n||{},o=o||{};let p="delayed"in n;for(r in n)r in o||(r[0]==="-"&&r[1]==="-"?i.style.removeProperty(r):i.style[r]="");for(r in o)if(s=o[r],r==="delayed"&&o.delayed)for(let l in o.delayed)s=o.delayed[l],(!p||s!==n.delayed[l])&&Qy(i.style,l,s);else r!=="remove"&&s!==n[r]&&(r[0]==="-"&&r[1]==="-"?i.style.setProperty(r,s):i.style[r]=s)}function Zy(e){let t,s,r=e.elm,i=e.data.style;if(!(!i||!(t=i.destroy)))for(s in t)r.style[s]=t[s]}function Xy(e,t){let s=e.data.style;if(!s||!s.remove){t();return}Bs||(e.elm.offsetLeft,Bs=!0);let r,i=e.elm,n=0,o=s.remove,p=0,l=[];for(r in o)l.push(r),i.style[r]=o[r];let a=getComputedStyle(i)["transition-property"].split(", ");for(;n<a.length;++n)l.indexOf(a[n])!==-1&&p++;i.addEventListener("transitionend",function(c){c.target===i&&--p,p===0&&t()})}function em(){Bs=!1}var tm={pre:em,create:xi,update:xi,destroy:Zy,remove:Xy};function Kn(e,t,s){if(typeof e=="function")e.call(t,s,t);else if(typeof e=="object")for(let r=0;r<e.length;r++)Kn(e[r],t,s)}function sm(e,t){let s=e.type,r=t.data.on;r&&r[s]&&Kn(r[s],t,e)}function rm(){return function e(t){sm(t,e.vnode)}}function vs(e,t){let s=e.data.on,r=e.listener,i=e.elm,n=t&&t.data.on,o=t&&t.elm,p;if(s!==n){if(s&&r)if(n)for(p in s)n[p]||i.removeEventListener(p,r,!1);else for(p in s)i.removeEventListener(p,r,!1);if(n){let l=t.listener=e.listener||rm();if(l.vnode=t,s)for(p in n)s[p]||o.addEventListener(p,l,!1);else for(p in n)o.addEventListener(p,l,!1)}}}var im={create:vs,update:vs,destroy:vs},nm=()=>Wy([My,Fy,Gy,tm,im]);function Un(e,t,s){if(e.ns="http://www.w3.org/2000/svg",s!=="foreignObject"&&t!==void 0)for(let r=0;r<t.length;++r){let i=t[r];if(typeof i=="string")continue;let n=i.data;n!==void 0&&Un(n,i.children,i.sel)}}function om(e,t,s){let r={},i,n,o;if(s!==void 0?(t!==null&&(r=t),Ct(s)?i=s:bt(s)?n=s.toString():s&&s.sel&&(i=[s])):t!=null&&(Ct(t)?i=t:bt(t)?n=t.toString():t&&t.sel?i=[t]:r=t),i!==void 0)for(o=0;o<i.length;++o)bt(i[o])&&(i[o]=ot(void 0,void 0,void 0,i[o],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&Un(r,i,e),ot(e,r,i,n,void 0)}var am=nm(),lm=({handlers:e,methods:t,constants:s,schema:r,view:i,store:n},o)=>{if(!i)throw new Error("view is not defined");if(!r||typeof r!="object"||Array.isArray(r))throw new Error("schema is required. Define component metadata in .schema.yaml.");let p=r,{template:l,refs:a,styles:c}=i;Oh({schema:p,methodExports:Object.keys(t||{})});let d=p.componentName,h=p.propsSchema,f=h?.properties?[...new Set(Object.keys(h.properties).map(u=>gn(u)))]:[];return vy({elementName:d,propsSchema:h,propsSchemaKeys:f,template:l,refs:a,styles:c,handlers:e,methods:t,constants:s,store:n,patch:am,h:om,deps:o})},pm=e=>{let t={};return{once:(s,r)=>{t[s]||(t[s]=[]);let i=(...n)=>{r(...n),t[s]=t[s].filter(o=>o!==i)};return t[s].push(i),()=>{t[s]=(t[s]??[]).filter(n=>n!==i)}},emit:(s,...r)=>{t[s]&&[...t[s]].forEach(i=>{i(...r)})},showAlert:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showConfirm:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showFormDialog:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showComponentDialog:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showDropdownMenu:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showToast:s=>{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.")}}},dm=pm(),cm={globalUI:dm},Si={components:cm},um={componentName:"rtgl-accordion-item",propsSchema:{type:"object",properties:{label:{type:"string"},content:{type:"string"},w:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},hm={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}},fm={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:{}}},ym={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}},mm={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:{}}},gm={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}},bm={componentName:"rtgl-dropdown-menu",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["section","item","separator","label"]},id:{type:"string"},icon:{type:"string"},path:{type:"string"},href:{type:"string"},shortcut:{type:"string"},suffixText:{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"},overlay:{type:"boolean"},"no-overlay":{type:"boolean"},"sm-place":{type:"string"},"md-place":{type:"string"},"lg-place":{type:"string"},"xl-place":{type:"string"},"sm-overlay":{type:"boolean"},"md-overlay":{type:"boolean"},"lg-overlay":{type:"boolean"},"xl-overlay":{type:"boolean"},"sm-no-overlay":{type:"boolean"},"md-no-overlay":{type:"boolean"},"lg-no-overlay":{type:"boolean"},"xl-no-overlay":{type:"boolean"},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:{}}},vm={refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},styles:{a:{display:"block",width:"100%","text-decoration":"none",color:"inherit"},".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} ${popoverAttrString} content-w=${w} content-h=${h} content-sv=true content-g=xs content-pv=sm",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.isSection",value:{type:6,conditions:[{type:1,path:"item.isSection"},{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 p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs 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 p=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f p=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},{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} p=md cur=pointer bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},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:!1}],fast:!1},{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} p=md cur=pointer bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},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:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=sm",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0}],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"}," ",{type:1,path:"popoverAttrString"}," content-w=",{type:1,path:"w"}," content-h=",{type:1,path:"h"}," content-sv=true content-g=xs content-pv=sm"]}}],fast:!1}],fast:!1}},wm={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"}}}},_m={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=${field.options} ?no-clear=${field.noClear} :selectedValue=${field._selectedValue} :placeholder=${field.placeholder} ?disabled=${field._disabled} ?searchable=${field.searchable} :searchPlaceholder=${field.searchPlaceholder} :emptySearchLabel=${field.emptySearchLabel}",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=",{type:1,path:"field.options"}," ?no-clear=",{type:1,path:"field.noClear"}," :selectedValue=",{type:1,path:"field._selectedValue"}," :placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}," ?searchable=",{type:1,path:"field.searchable"}," :searchPlaceholder=",{type:1,path:"field.searchPlaceholder"}," :emptySearchLabel=",{type:1,path:"field.emptySearchLabel"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "tag-select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"tag-select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-tag-select#field${field._idx} data-field-name=${field.name} w=f :options=${field.options} :selectedValues=${field._selectedValues} :placeholder=${field.placeholder} :addOption=${field.addOption} ?no-add=${field.noAdd} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-tag-select#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=",{type:1,path:"field.options"}," :selectedValues=",{type:1,path:"field._selectedValues"}," :placeholder=",{type:1,path:"field.placeholder"}," :addOption=",{type:1,path:"field.addOption"}," ?no-add=",{type:1,path:"field.noAdd"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "segmented-control"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"segmented-control"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-segmented-control#field${field._idx} data-field-name=${field.name} w=f :options=${field.options} ?no-clear=${field.noClear} :selectedValue=${field._selectedValue} :placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-segmented-control#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=",{type:1,path:"field.options"}," ?no-clear=",{type:1,path:"field.noClear"}," :selectedValue=",{type:1,path:"field._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}},xm={componentName:"rtgl-global-ui",propsSchema:{type:"object",properties:{}},events:[],methods:{type:"object",properties:{}}},Sm={refs:{dialog:{eventListeners:{close:{handler:"handleDialogClose"}}},confirmButton:{eventListeners:{click:{handler:"handleConfirm"}}},cancelButton:{eventListeners:{click:{handler:"handleCancel"}}},componentDialogBodyHost:{},"componentDialogAction*":{eventListeners:{click:{handler:"handleComponentDialogAction"}}},formDialog:{eventListeners:{"form-action":{handler:"handleFormAction"},"form-field-event":{handler:"handleFormFieldEvent"}}},dropdownMenu:{eventListeners:{close:{handler:"handleDropdownClose"},"item-click":{handler:"handleDropdownItemClick"}}}},styles:{".toast-layer":{"pointer-events":"none"},".toast-card":{"pointer-events":"auto","box-sizing":"border-box",width:"33vw","max-width":"calc(100vw - 2 * var(--spacing-lg))",opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 180ms cubic-bezier(0.16, 1, 0.3, 1), transform 180ms cubic-bezier(0.16, 1, 0.3, 1)","will-change":"opacity, transform"},".toast-card-top":{animation:"toast-in-top 220ms cubic-bezier(0.16, 1, 0.3, 1)"},".toast-card-bottom":{animation:"toast-in-bottom 220ms cubic-bezier(0.16, 1, 0.3, 1)"},".toast-card-md":{width:"50vw"},".toast-card-lg":{width:"80vw"},".toast-card-top.toast-card-exiting":{opacity:0,transform:"translateY(calc(var(--spacing-sm) * -0.5)) scale(0.98)"},".toast-card-bottom.toast-card-exiting":{opacity:0,transform:"translateY(calc(var(--spacing-sm) * 0.5)) scale(0.98)"},".toast-message":{"overflow-wrap":"anywhere"},"@keyframes toast-in-top":{from:{opacity:0,transform:"translateY(calc(var(--spacing-sm) * -1)) scale(0.96)"},to:{opacity:1,transform:"translateY(0) scale(1)"}},"@keyframes toast-in-bottom":{from:{opacity:0,transform:"translateY(var(--spacing-sm)) scale(0.96)"},to:{opacity:1,transform:"translateY(0) scale(1)"}},"@media (prefers-reduced-motion: reduce)":{".toast-card":{animation:"none",transition:"none"}},"@media only screen and (max-width: 768px)":{".toast-card":{width:"calc(100vw - 2 * var(--spacing-lg))"}}},template:{type:9,items:[{type:8,properties:[{key:"$if topToasts.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"topToasts.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-layer toast-layer-top" pos=fix edge=t z=2100 w=f ah=c g=sm ph=md pt=xl',value:{type:9,items:[{type:7,itemVar:"toast",indexVar:"i",iterable:{type:1,path:"topToasts"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-card toast-card-top toast-card-${toast.size} toast-card-${toast.phase}" key=toast-${toast.id} bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text class=toast-message ta=c w=f",value:{type:1,path:"toast.message"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view class="toast-card toast-card-top toast-card-',{type:1,path:"toast.size"}," toast-card-",{type:1,path:"toast.phase"},'" key=toast-',{type:1,path:"toast.id"}," bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if bottomToasts.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"bottomToasts.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-layer toast-layer-bottom" pos=fix edge=b z=2100 w=f ah=c g=sm ph=md pb=xl',value:{type:9,items:[{type:7,itemVar:"toast",indexVar:"i",iterable:{type:1,path:"bottomToasts"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-card toast-card-bottom toast-card-${toast.size} toast-card-${toast.phase}" key=toast-${toast.id} bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text class=toast-message ta=c w=f",value:{type:1,path:"toast.message"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view class="toast-card toast-card-bottom toast-card-',{type:1,path:"toast.size"}," toast-card-",{type:1,path:"toast.phase"},'" key=toast-',{type:1,path:"toast.id"}," bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{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=",{type:1,path:"formDialogConfig.form"}," :defaultValues=",{type:1,path:"formDialogConfig.defaultValues"}," :context=",{type:1,path:"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 isComponentDialogOpen",value:{type:6,conditions:[{type:1,path:"isComponentDialogOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"$if componentDialogConfig.title || componentDialogConfig.description",value:{type:6,conditions:[{type:4,op:7,left:{type:1,path:"componentDialogConfig.title"},right:{type:1,path:"componentDialogConfig.description"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if componentDialogConfig.title",value:{type:6,conditions:[{type:1,path:"componentDialogConfig.title"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"componentDialogConfig.title"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if componentDialogConfig.description",value:{type:6,conditions:[{type:1,path:"componentDialogConfig.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"componentDialogConfig.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view#componentDialogBodyHost w=f key=component-dialog-body-${componentDialogConfig.key}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view#componentDialogBodyHost w=f key=component-dialog-body-",{type:1,path:"componentDialogConfig.key"}]}}],fast:!0},{type:8,properties:[{key:"$if componentDialogConfig.actions.buttons.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"componentDialogConfig.actions.buttons.length"},right:{type:0,value:0}}],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:"componentDialogConfig.actions._leftButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#componentDialogAction${button._globalIdx} data-action-id=${button.id} data-action-index=${button._globalIdx} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#componentDialogAction",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," data-action-index=",{type:1,path:"button._globalIdx"}," 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:"componentDialogConfig.actions._rightButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#componentDialogAction${button._globalIdx} data-action-id=${button.id} data-action-index=${button._globalIdx} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#componentDialogAction",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," data-action-index=",{type:1,path:"button._globalIdx"}," 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}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if !isFormDialogOpen && !isComponentDialogOpen",value:{type:6,conditions:[{type:4,op:6,left:{type:5,op:0,operand:{type:1,path:"isFormDialogOpen"}},right:{type:5,op:0,operand:{type:1,path:"isComponentDialogOpen"}}}],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} ${dropdownConfig.popoverAttrString} :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"}," ",{type:1,path:"dropdownConfig.popoverAttrString"}," :items=",{type:1,path:"dropdownConfig.items"}," key=dropdown-",{type:1,path:"isDropdownOpen"}]}}],fast:!0}],fast:!1}},Am={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:{}}},km={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}},Em={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:{}}},$m={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}},Cm={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:{}}},Im={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} content-g=md content-w=240 content-pv=sm",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},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," content-g=md content-w=240 content-pv=sm"]}}],fast:!0}],fast:!0}},Om={componentName:"rtgl-segmented-control",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:{}}},Tm={refs:{"option*":{eventListeners:{click:{handler:"handleOptionClick"},keydown:{handler:"handleOptionKeyDown"},mouseenter:{handler:"handleOptionMouseEnter"},mouseleave:{handler:"handleOptionMouseLeave"}}},optionAdd:{eventListeners:{click:{handler:"handleAddOptionClick"},keydown:{handler:"handleAddOptionKeyDown"},mouseenter:{handler:"handleAddOptionMouseEnter"},mouseleave:{handler:"handleAddOptionMouseLeave"}}}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view d=h bw=xs bc=bo br=md bgc=bg overflow=hidden ${containerAttrString} role="group" aria-label=${ariaLabel}',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} d=h av=c ah=c w=1fg ph=lg pv=md cur=${option.cursor} bgc=${option.bgc} bwl=${option.borderLeftWidth} bc=bo data-testid=${option.testId} role="button" tabindex=${option.tabIndex} aria-pressed=${option.isSelected} aria-disabled=${isDisabled}',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${option.textColor} ta=c",value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"option.textColor"}," ta=c"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," d=h av=c ah=c w=1fg ph=lg pv=md cur=",{type:1,path:"option.cursor"}," bgc=",{type:1,path:"option.bgc"}," bwl=",{type:1,path:"option.borderLeftWidth"}," bc=bo data-testid=",{type:1,path:"option.testId"},' role="button" tabindex=',{type:1,path:"option.tabIndex"}," aria-pressed=",{type:1,path:"option.isSelected"}," aria-disabled=",{type:1,path:"isDisabled"}]}}],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#optionAdd d=h av=c ah=c w=1fg ph=lg pv=md cur=pointer bgc=${addOptionBgc} bwl=${addOptionBorderLeftWidth} bc=bo data-testid="segmented-control-add-option" role="button" tabindex=0',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=ac ta=c",value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#optionAdd d=h av=c ah=c w=1fg ph=lg pv=md cur=pointer bgc=",{type:1,path:"addOptionBgc"}," bwl=",{type:1,path:"addOptionBorderLeftWidth"},' bc=bo data-testid="segmented-control-add-option" role="button" tabindex=0']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h bw=xs bc=bo br=md bgc=bg overflow=hidden ",{type:1,path:"containerAttrString"},' role="group" aria-label=',{type:1,path:"ariaLabel"}]}}],fast:!1}],fast:!1}},Lm={componentName:"rtgl-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{type:{type:"string",enum:["section","item","separator"]},label:{type:"string"},value:{type:"any"},icon:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},testId:{type:"string"}}}},selectedValue:{type:"any"},onChange:{type:"function"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},disabled:{type:"boolean"},searchable:{type:"boolean"},searchPlaceholder:{type:"string"},emptySearchLabel:{type:"string"},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}},Vm={refs:{selectButton:{eventListeners:{click:{handler:"handleButtonClick"},keydown:{handler:"handleButtonKeyDown"}}},clearButton:{eventListeners:{click:{handler:"handleClearClick"}}},searchInput:{eventListeners:{"value-input":{handler:"handleSearchInput",stopPropagation:!0},keydown:{handler:"handleSearchKeyDown",stopPropagation:!0}}},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"}}}},styles:{".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view#selectButton style="display: inline-flex;" d=h av=c h=32 ph=md bw=xs bc=bo h-bc=${selectButtonHoverBorderColor} br=md bgc=su cur=${selectButtonCursor} ${containerAttrString} data-testid="select-button" role="button" tabindex=${selectButtonTabIndex} aria-disabled=${isDisabled}',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c ah=s w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if hasSelectedIcon",value:{type:6,conditions:[{type:1,path:"hasSelectedIcon"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg svg=${selectedIcon} wh=16 c=${selectedIconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg svg=",{type:1,path:"selectedIcon"}," wh=16 c=",{type:1,path:"selectedIconColor"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{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}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if hasSelectedSuffixText",value:{type:6,conditions:[{type:1,path:"hasSelectedSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${selectedSuffixTextColor} ta=e",value:{type:1,path:"selectedSuffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"selectedSuffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{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 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 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-view#selectButton style="display: inline-flex;" d=h av=c h=32 ph=md bw=xs bc=bo h-bc=',{type:1,path:"selectButtonHoverBorderColor"}," br=md bgc=su cur=",{type:1,path:"selectButtonCursor"}," ",{type:1,path:"containerAttrString"},' data-testid="select-button" role="button" tabindex=',{type:1,path:"selectButtonTabIndex"}," aria-disabled=",{type:1,path:"isDisabled"}]}}],fast:!1},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=rs content-wh=300 content-g=xs content-sv=true ?content-hsb=${showSearch} content-pv=sm",value:{type:9,items:[{type:8,properties:[{key:"$if showSearch",value:{type:6,conditions:[{type:1,path:"showSearch"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f mt=md mh=md mb=xs",value:{type:9,items:[{type:8,properties:[{key:'rtgl-input#searchInput w=f s=sm value=${searchQuery} placeholder="${searchPlaceholder}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#searchInput w=f s=sm value=",{type:1,path:"searchQuery"},' placeholder="',{type:1,path:"searchPlaceholder"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"renderOptions"},body:{type:9,items:[{type:8,properties:[{key:"$if option.isSection",value:{type:6,conditions:[{type:1,path:"option.isSection"},{type:1,path:"option.isItem"},{type:1,path:"option.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md ?hide=${option.isSearchHidden}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view w=f p=md ?hide=",{type:1,path:"option.isSearchHidden"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${option.index} w=f ph=lg pv=md cur=pointer bgc=${option.bgc} data-testid=${option.testId} ?hide=${option.isSearchHidden}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if option.hasIconSlot",value:{type:6,conditions:[{type:1,path:"option.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if option.hasIcon",value:{type:6,conditions:[{type:1,path:"option.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${option.icon} c=${option.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"option.icon"}," c=",{type:1,path:"option.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${option.c} w=1fg ellipsis",value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"option.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if option.hasSuffixText",value:{type:6,conditions:[{type:1,path:"option.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${option.suffixTextColor} ta=e",value:{type:1,path:"option.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"option.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"option.index"}," w=f ph=lg pv=md cur=pointer bgc=",{type:1,path:"option.bgc"}," data-testid=",{type:1,path:"option.testId"}," ?hide=",{type:1,path:"option.isSearchHidden"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=sm ?hide=${option.isSearchHidden}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view w=f h=1 bgc=mu mv=sm ?hide=",{type:1,path:"option.isSearchHidden"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0},{type:8,properties:[{key:"$if showSearch",value:{type:6,conditions:[{type:1,path:"showSearch"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f ph=lg pv=md ?hide=${hideEmptySearch}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"emptySearchLabel"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view w=f ph=lg pv=md ?hide=",{type:1,path:"hideEmptySearch"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{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 bgc=${addOptionBgc} data-testid="select-add-option"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm 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 bgc=",{type:1,path:"addOptionBgc"},' data-testid="select-add-option"']}}],fast:!0}],fast:!0}],id:null}}],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 content-wh=300 content-g=xs content-sv=true ?content-hsb=",{type:1,path:"showSearch"}," content-pv=sm"]}}],fast:!1}],fast:!1}},Rm={componentName:"rtgl-sidebar",propsSchema:{type:"object",properties:{mode:{type:"string"},hideHeader:{type:"boolean",default:!1},tooltip:{type:"boolean",default:!1},showCompactTooltip:{type:"boolean",default:!1,description:"Deprecated alias for tooltip. Use tooltip instead."},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:{label:{type:"string"},title:{type:"string",description:"Deprecated item text field. Use label instead."},slug:{type:"string"},type:{type:"string",description:"Item row type. Supports item, groupLabel, divider, and spacer."},tooltip:{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:{}}},Nm={refs:{headerImage:{eventListeners:{click:{handler:"handleHeaderClick"}}},headerLabel:{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item*":{eventListeners:{click:{handler:"handleItemClick"},mouseenter:{handler:"handleItemMouseEnter"},mouseleave:{handler:"handleItemMouseLeave"}}}},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 == "divider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"divider"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"spacer"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"groupLabel"}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f pv=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=1 w=f bgc=mu",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view h=1fg w=f",value:{type:0,value:null}}],fast:!0}],fast:!0},{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.label"}}],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} aria-label="${item.label}"',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.label"}}],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.label"}}],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.label.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"},' aria-label="',{type:1,path:"item.label"},'"']}}],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},{type:8,properties:[{key:"$if enableCompactTooltip",value:{type:6,conditions:[{type:1,path:"enableCompactTooltip"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-tooltip#tooltip s="md" ?open=${tooltipState.open} x=${tooltipState.x} y=${tooltipState.y} place=${tooltipState.place} content="${tooltipState.content}"',value:{type:0,value:null},parsedKey:{type:2,parts:['rtgl-tooltip#tooltip s="md" ?open=',{type:1,path:"tooltipState.open"}," x=",{type:1,path:"tooltipState.x"}," y=",{type:1,path:"tooltipState.y"}," place=",{type:1,path:"tooltipState.place"},' content="',{type:1,path:"tooltipState.content"},'"']}}],fast:!0}],fast:!0}],id:null}}],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}},Pm={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:{}}},Dm={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}},jm={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:{}}},Bm={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}},zm={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:{}}},Wm={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}},Mm={componentName:"rtgl-tag-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{type:{type:"string",enum:["section","item","separator"]},label:{type:"string"},value:{type:"any"},icon:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},testId:{type:"string"}}}},selectedValues:{type:"array",items:{type:"any"}},draftSelectedValues:{type:"array",items:{type:"any"}},open:{type:"boolean"},onChange:{type:"function"},addOption:{type:"object",properties:{label:{type:"string"}}},noAdd:{type:"boolean"},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"draft-value-change":{},"open-change":{},"add-option-click":{}},methods:{type:"object",properties:{refreshPopover:{description:"Recomputes the open popover position and rerenders the current options and draft values.",params:["values","keepOpen"],returns:"void"},setDraftSelectedValues:{description:"Replaces the draft-only selection without committing `selectedValues`; optionally reopens the popover around the trigger when `keepOpen` is true.",params:["values","keepOpen"],returns:"void"},appendDraftSelectedValue:{description:"Adds a value to the draft-only selection without committing `selectedValues`; optionally reopens the popover around the trigger when `keepOpen` is true.",params:["value","keepOpen"],returns:"void"}}}},Fm={refs:{trigger:{eventListeners:{click:{handler:"handleTriggerClick"},keydown:{handler:"handleTriggerKeyDown"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},"option*":{eventListeners:{click:{handler:"handleOptionClick"},keydown:{handler:"handleOptionKeyDown"}}},submitButton:{eventListeners:{click:{handler:"handleSubmitClick"}}},addOptionButton:{eventListeners:{click:{handler:"handleAddOptionClick"}}}},styles:{".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view#trigger d=h av=c g=sm cur=${triggerCursor} ${containerAttrString} data-testid="tag-select-trigger" role="button" tabindex=${triggerTabIndex} aria-disabled=${isDisabled} style="min-height: 24px;"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c wrap g=sm w=1fg",value:{type:9,items:[{type:7,itemVar:"tag",indexVar:"i",iterable:{type:1,path:"triggerTags"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-tag data-selection-index=${tag.selectionIndex} pre=${tag.icon} data-testid=${tag.testId} v=mu style="${tag.tagStyle}"',value:{type:1,path:"tag.label"},parsedKey:{type:2,parts:["rtgl-tag data-selection-index=",{type:1,path:"tag.selectionIndex"}," pre=",{type:1,path:"tag.icon"}," data-testid=",{type:1,path:"tag.testId"},' v=mu style="',{type:1,path:"tag.tagStyle"},'"']}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#trigger d=h av=c g=sm cur=",{type:1,path:"triggerCursor"}," ",{type:1,path:"containerAttrString"},' data-testid="tag-select-trigger" role="button" tabindex=',{type:1,path:"triggerTabIndex"}," aria-disabled=",{type:1,path:"isDisabled"},' style="min-height: 24px;"']}}],fast:!1},{type:8,properties:[{key:"$if isOpen",value:{type:6,conditions:[{type:1,path:"isOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=bs content-w=${position.w} content-g=sm content-sv=true content-ph=md content-pv=md",value:{type:9,items:[{type:8,properties:[{key:"$if !hasSelectableOptions",value:{type:6,conditions:[{type:5,op:0,operand:{type:1,path:"hasSelectableOptions"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:0,value:"No tags available"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h wrap g=sm w=f",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"$if option.isSection",value:{type:6,conditions:[{type:1,path:"option.isSection"},{type:1,path:"option.isItem"},{type:1,path:"option.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f pt=xs",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-view#option${option.index} cur=${option.cursor} data-testid=${option.testId} role="button" tabindex=0 aria-pressed=${option.isSelected}',value:{type:9,items:[{type:8,properties:[{key:'rtgl-tag v=mu pre=${option.icon} style="${option.tagStyle}"',value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-tag v=mu pre=",{type:1,path:"option.icon"},' style="',{type:1,path:"option.tagStyle"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"option.index"}," cur=",{type:1,path:"option.cursor"}," data-testid=",{type:1,path:"option.testId"},' role="button" tabindex=0 aria-pressed=',{type:1,path:"option.isSelected"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=xs",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},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-button#addOptionButton v=gh s=sm pre=plus data-testid="tag-select-add-option"',value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h av=c g=sm w=f pt=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-button#submitButton v=pr s=sm data-testid="tag-select-submit" ?disabled=${submitDisabled}',value:{type:1,path:"submitLabel"},parsedKey:{type:2,parts:['rtgl-button#submitButton v=pr s=sm data-testid="tag-select-submit" ?disabled=',{type:1,path:"submitDisabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],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=bs content-w=",{type:1,path:"position.w"}," content-g=sm content-sv=true content-ph=md content-pv=md"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}},Km={componentName:"rtgl-tooltip",propsSchema:{type:"object",properties:{open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},s:{type:"string",enum:["sm","md","lg"]},content:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},Um={template:{type:9,items:[{type:8,properties:[{key:'rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} no-overlay content-bgc=mu content-style="${contentStyle}"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view p=${padding} ah=s av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text ta=s s=${textSize} c=fg",value:{type:1,path:"content"},parsedKey:{type:2,parts:["rtgl-text ta=s s=",{type:1,path:"textSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view p=",{type:1,path:"padding"}," ah=s av=c"]}}],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 content-bgc=mu content-style="',{type:1,path:"contentStyle"},'"']}}],fast:!0}],fast:!0},refs:{}},Hm={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:{}}},qm={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=Po;x.components.accordionItem.schema=um;x.components.accordionItem.store=Mo;x.components.accordionItem.view=hm;x.components.breadcrumb={};x.components.breadcrumb.handlers=Ko;x.components.breadcrumb.schema=fm;x.components.breadcrumb.store=Xo;x.components.breadcrumb.view=ym;x.components.card={};x.components.card.schema=mm;x.components.card.store=ia;x.components.card.view=gm;x.components.dropdownMenu={};x.components.dropdownMenu.handlers=pa;x.components.dropdownMenu.schema=bm;x.components.dropdownMenu.store=ma;x.components.dropdownMenu.view=vm;x.components.form={};x.components.form.handlers=Pl;x.components.form.methods=Hl;x.components.form.schema=wm;x.components.form.store=kl;x.components.form.view=_m;x.components.globalUi={};x.components.globalUi.handlers=mp;x.components.globalUi.schema=xm;x.components.globalUi.store=Hp;x.components.globalUi.view=Sm;x.components.navbar={};x.components.navbar.handlers=Yp;x.components.navbar.schema=Am;x.components.navbar.store=sd;x.components.navbar.view=km;x.components.pageOutline={};x.components.pageOutline.handlers=od;x.components.pageOutline.schema=Em;x.components.pageOutline.store=fd;x.components.pageOutline.view=$m;x.components.popoverInput={};x.components.popoverInput.handlers=xd;x.components.popoverInput.schema=Cm;x.components.popoverInput.store=Od;x.components.popoverInput.view=Im;x.components.segmentedControl={};x.components.segmentedControl.handlers=Bd;x.components.segmentedControl.schema=Om;x.components.segmentedControl.store=Zd;x.components.segmentedControl.view=Tm;x.components.select={};x.components.select.handlers=yc;x.components.select.schema=Lm;x.components.select.store=Nc;x.components.select.view=Vm;x.components.sidebar={};x.components.sidebar.handlers=Wc;x.components.sidebar.schema=Rm;x.components.sidebar.store=eu;x.components.sidebar.view=Nm;x.components.sliderInput={};x.components.sliderInput.handlers=nu;x.components.sliderInput.schema=Pm;x.components.sliderInput.store=pu;x.components.sliderInput.view=Dm;x.components.table={};x.components.table.handlers=hu;x.components.table.schema=jm;x.components.table.store=Su;x.components.table.view=Bm;x.components.tabs={};x.components.tabs.handlers=ku;x.components.tabs.schema=zm;x.components.tabs.store=Ou;x.components.tabs.view=Wm;x.components.tagSelect={};x.components.tagSelect.handlers=Mu;x.components.tagSelect.methods=Hu;x.components.tagSelect.schema=Mm;x.components.tagSelect.store=fh;x.components.tagSelect.view=Fm;x.components.tooltip={};x.components.tooltip.handlers=yh;x.components.tooltip.schema=Km;x.components.tooltip.store=bh;x.components.tooltip.view=Um;x.components.waveform={};x.components.waveform.handlers=_h;x.components.waveform.schema=Hm;x.components.waveform.store=kh;x.components.waveform.view=qm;var Ym={};Object.keys(x).forEach(e=>{Object.keys(x[e]).forEach(t=>{let s=x[e][t],r={...Si&&Si[e]||{},...Ym},i=lm({...s},r),n=s.schema?.componentName;if(!n)throw new Error(`[Build] Missing schema.componentName for ${e}/${t}. Define it in .schema.yaml.`);customElements.define(n,i)})});customElements.define("rtgl-button",ar({}));customElements.define("rtgl-carousel",ur({}));customElements.define("rtgl-grid",hr({}));customElements.define("rtgl-view",yr({}));customElements.define("rtgl-text",gr({}));customElements.define("rtgl-image",wr({}));customElements.define("rtgl-tag",xr({}));customElements.define("rtgl-svg",Ar({}));customElements.define("rtgl-input",ve({}));customElements.define("rtgl-input-date",kr({}));customElements.define("rtgl-input-time",Er({}));customElements.define("rtgl-input-datetime",$r({}));customElements.define("rtgl-input-number",Cr({}));customElements.define("rtgl-textarea",Ir({}));customElements.define("rtgl-color-picker",Or({}));customElements.define("rtgl-slider",Tr({}));customElements.define("rtgl-checkbox",Lr({}));customElements.define("rtgl-dialog",Vr({}));customElements.define("rtgl-popover",jr({}));})();
1651
+ `,ei="data-rtgl-render-target",Wn="__rtglRenderTarget",Ps=e=>!e||typeof e!="object"?!1:typeof e.getAttribute=="function"?e.getAttribute(ei)!==null:e[Wn]===!0,mr=e=>{!e||typeof e!="object"||(typeof e.setAttribute=="function"?e.setAttribute(ei,""):e[Wn]=!0)},gy=e=>{if(!(!e||typeof e!="object"))return typeof e.querySelector=="function"?e.querySelector(`[${ei}]`)??e.firstElementChild:Array.isArray(e.childNodes)?e.childNodes.find(Ps)??e.childNodes[0]:Array.isArray(e.children)?e.children.find(Ps)??e.children[0]:e.firstElementChild},by=({host:e,cssText:t,createStyleSheet:s=()=>new CSSStyleSheet,createElement:i=r=>document.createElement(r)})=>{let r=e.shadowRoot??e.attachShadow({mode:"open"}),n=s();n.replaceSync(my);let o=[n];if(t){let a=s();a.replaceSync(t),o.push(a)}r.adoptedStyleSheets=o;let p=gy(r);p?(p.style.cssText="display: contents;",Ps(p)||mr(p)):(p=i("div"),p.style.cssText="display: contents;",mr(p),r.appendChild(p)),p.parentNode!==r&&r.appendChild(p);let l=bn(e);return l&&typeof l=="object"&&(l.display="contents"),{shadow:r,renderTarget:p,adoptedStyleSheets:o}},js=(e,t=requestAnimationFrame)=>t(e),vy=({scheduleFrameFn:e=js}={})=>({update:(t,s)=>{let i=t.data?.props||{},r=s.data?.props||{};if(JSON.stringify(i)===JSON.stringify(r))return;let n=s.elm;!n||typeof n.render!="function"||(n.setAttribute("isDirty","true"),e(()=>{if(n.render(),n.removeAttribute("isDirty"),n.handlers&&n.handlers.handleOnUpdate){let o={...n.deps,store:n.store,render:n.render.bind(n),handlers:n.handlers,dispatchEvent:n.dispatchEvent.bind(n),refs:n.refIds||{}};n.handlers.handleOnUpdate(o,{oldProps:i,newProps:r})}}))}}),wy=({elementName:e,propsSchema:t,propsSchemaKeys:s,template:i,refs:r,styles:n,handlers:o,methods:p,constants:l,store:a,patch:c,h:d,deps:h})=>{class f extends HTMLElement{elementName;styles;_snabbdomH;store;props;propsSchema;template;handlers;methods;constants;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_globalListenersCleanup;_oldVNode;deps;i18nRuntime;_i18nUnsubscribe;_propsSchemaKeys=[];cssText;static get observedAttributes(){return["key"]}get viewData(){let m={};return this.store.selectViewData&&(m=this.store.selectViewData()),{...m,i18n:this.i18nRuntime?.getMessages?.()||{}}}connectedCallback(){let m=by({host:this,cssText:this.cssText});this.shadow=m.shadow,this.renderTarget=m.renderTarget,this.i18nRuntime?.subscribe&&!this._i18nUnsubscribe&&(this._i18nUnsubscribe=this.i18nRuntime.subscribe(()=>{this.render()})),cy({instance:this,parseAndRenderFn:Cn,renderFn:this.render})}disconnectedCallback(){this._i18nUnsubscribe&&(this._i18nUnsubscribe(),this._i18nUnsubscribe=void 0),uy({instance:this,clearTimerFn:clearTimeout})}attributeChangedCallback(m,b,g){hy({instance:this,attributeName:m,oldValue:b,newValue:g,scheduleFrameFn:js})}render=()=>{yy({instance:this,createComponentUpdateHookFn:vy})}}class u extends f{static get observedAttributes(){return ay({propsSchemaKeys:s,toKebabCase:mn})}constructor(){super(),this.constants=Af({setupConstants:h?.constants,fileConstants:l}),this.propsSchema=t,Ih({source:this,allowedKeys:s,onPropChange:({propName:m,oldValue:b,newValue:g})=>{fy({instance:this,propName:m,oldValue:b,newValue:g,scheduleFrameFn:js})}}),this.props=t?Oh(this,s):{},this._propsSchemaKeys=s,this.elementName=e,this.styles=n,this.i18nRuntime=h?.__rtglI18nRuntime,this.store=Sf(a,this.props,this.constants,{getI18n:()=>this.i18nRuntime?.getMessages?.()||{},locale:this.i18nRuntime?.locale}),this.template=i,this.handlers=o,this.methods=p,this.refs=r,this.patch=c,this.deps={...h,locale:this.i18nRuntime?.locale||h?.locale,store:this.store,render:this.render,handlers:o,props:this.props,constants:this.constants},this.i18nRuntime&&Object.defineProperty(this.deps,"i18n",{enumerable:!0,configurable:!0,get:()=>this.i18nRuntime.getMessages()}),cf(this,this.methods),this._snabbdomH=d,this.cssText=Ef(e,n)}}return u};function ot(e,t,s,i,r){let n=t===void 0?void 0:t.key;return{sel:e,data:t,children:s,text:i,elm:r,key:n}}var Ct=Array.isArray;function bt(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function _y(e,t){return document.createElement(e,t)}function xy(e,t,s){return document.createElementNS(e,t,s)}function Sy(){return ke(document.createDocumentFragment())}function Ay(e){return document.createTextNode(e)}function Ey(e){return document.createComment(e)}function ky(e,t,s){if(me(e)){let i=e;for(;i&&me(i);)i=ke(i).parent;e=i??e}me(t)&&(t=ke(t,e)),s&&me(s)&&(s=ke(s).firstChildNode),e.insertBefore(t,s)}function $y(e,t){e.removeChild(t)}function Cy(e,t){me(t)&&(t=ke(t,e)),e.appendChild(t)}function Fn(e){if(me(e)){for(;e&&me(e);)e=ke(e).parent;return e??null}return e.parentNode}function Iy(e){var t;if(me(e)){let s=ke(e),i=Fn(s);if(i&&s.lastChildNode){let r=Array.from(i.childNodes),n=r.indexOf(s.lastChildNode);return(t=r[n+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function Oy(e){return e.tagName}function Ty(e,t){e.textContent=t}function Ly(e){return e.textContent}function Vy(e){return e.nodeType===1}function Ry(e){return e.nodeType===3}function Ny(e){return e.nodeType===8}function me(e){return e.nodeType===11}function ke(e,t){var s,i,r;let n=e;return(s=n.parent)!==null&&s!==void 0||(n.parent=t??null),(i=n.firstChildNode)!==null&&i!==void 0||(n.firstChildNode=e.firstChild),(r=n.lastChildNode)!==null&&r!==void 0||(n.lastChildNode=e.lastChild),n}var Dy={createElement:_y,createElementNS:xy,createTextNode:Ay,createDocumentFragment:Sy,createComment:Ey,insertBefore:ky,removeChild:$y,appendChild:Cy,parentNode:Fn,nextSibling:Iy,tagName:Oy,setTextContent:Ty,getTextContent:Ly,isElement:Vy,isText:Ry,isComment:Ny,isDocumentFragment:me};function gt(e){return e===void 0}function se(e){return e!==void 0}var bs=ot("",{},[],void 0,void 0);function tt(e,t){var s,i;let r=e.key===t.key,n=((s=e.data)===null||s===void 0?void 0:s.is)===((i=t.data)===null||i===void 0?void 0:i.is),o=e.sel===t.sel,p=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return o&&r&&n&&p}function Py(){throw new Error("The document fragment is not supported on this platform.")}function jy(e,t){return e.isElement(t)}function By(e,t){return e.isDocumentFragment(t)}function zy(e,t,s){var i;let r={};for(let n=t;n<=s;++n){let o=(i=e[n])===null||i===void 0?void 0:i.key;o!==void 0&&(r[o]=n)}return r}var My=["create","update","remove","destroy","pre","post"];function Wy(e,t,s){let i={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},r=Dy;for(let u of My)for(let y of e){let m=y[u];m!==void 0&&i[u].push(m)}function n(u){let y=u.id?"#"+u.id:"",m=u.getAttribute("class"),b=m?"."+m.split(" ").join("."):"";return ot(r.tagName(u).toLowerCase()+y+b,{},[],void 0,u)}function o(u){return ot(void 0,{},[],void 0,u)}function p(u,y){return function(){if(--y===0){let m=r.parentNode(u);m!==null&&r.removeChild(m,u)}}}function l(u,y){var m,b,g,_;let S,A=u.data;if(A!==void 0){let I=(m=A.hook)===null||m===void 0?void 0:m.init;se(I)&&(I(u),A=u.data)}let E=u.children,C=u.sel;if(C==="!")gt(u.text)&&(u.text=""),u.elm=r.createComment(u.text);else if(C==="")u.elm=r.createTextNode(u.text);else if(C!==void 0){let I=C.indexOf("#"),V=C.indexOf(".",I),z=I>0?I:C.length,B=V>0?V:C.length,J=I!==-1||V!==-1?C.slice(0,Math.min(z,B)):C,Q=u.elm=se(A)&&se(S=A.ns)?r.createElementNS(S,J,A):r.createElement(J,A);for(z<B&&Q.setAttribute("id",C.slice(z+1,B)),V>0&&Q.setAttribute("class",C.slice(B+1).replace(/\./g," ")),S=0;S<i.create.length;++S)i.create[S](bs,u);if(bt(u.text)&&(!Ct(E)||E.length===0)&&r.appendChild(Q,r.createTextNode(u.text)),Ct(E))for(S=0;S<E.length;++S){let we=E[S];we!=null&&r.appendChild(Q,l(we,y))}let ge=u.data.hook;se(ge)&&((b=ge.create)===null||b===void 0||b.call(ge,bs,u),ge.insert&&y.push(u))}else if(!((g=void 0)===null||g===void 0)&&g.fragments&&u.children){for(u.elm=((_=r.createDocumentFragment)!==null&&_!==void 0?_:Py)(),S=0;S<i.create.length;++S)i.create[S](bs,u);for(S=0;S<u.children.length;++S){let I=u.children[S];I!=null&&r.appendChild(u.elm,l(I,y))}}else u.elm=r.createTextNode(u.text);return u.elm}function a(u,y,m,b,g,_){for(;b<=g;++b){let S=m[b];S!=null&&r.insertBefore(u,l(S,_),y)}}function c(u){var y,m;let b=u.data;if(b!==void 0){(m=(y=b?.hook)===null||y===void 0?void 0:y.destroy)===null||m===void 0||m.call(y,u);for(let g=0;g<i.destroy.length;++g)i.destroy[g](u);if(u.children!==void 0)for(let g=0;g<u.children.length;++g){let _=u.children[g];_!=null&&typeof _!="string"&&c(_)}}}function d(u,y,m,b){for(var g,_;m<=b;++m){let S,A,E=y[m];if(E!=null)if(se(E.sel)){c(E),S=i.remove.length+1,A=p(E.elm,S);for(let I=0;I<i.remove.length;++I)i.remove[I](E,A);let C=(_=(g=E?.data)===null||g===void 0?void 0:g.hook)===null||_===void 0?void 0:_.remove;se(C)?C(E,A):A()}else E.children?(c(E),d(u,E.children,0,E.children.length-1)):r.removeChild(u,E.elm)}}function h(u,y,m,b){let g=0,_=0,S=y.length-1,A=y[0],E=y[S],C=m.length-1,I=m[0],V=m[C],z,B,J,Q;for(;g<=S&&_<=C;)A==null?A=y[++g]:E==null?E=y[--S]:I==null?I=m[++_]:V==null?V=m[--C]:tt(A,I)?(f(A,I,b),A=y[++g],I=m[++_]):tt(E,V)?(f(E,V,b),E=y[--S],V=m[--C]):tt(A,V)?(f(A,V,b),r.insertBefore(u,A.elm,r.nextSibling(E.elm)),A=y[++g],V=m[--C]):tt(E,I)?(f(E,I,b),r.insertBefore(u,E.elm,A.elm),E=y[--S],I=m[++_]):(z===void 0&&(z=zy(y,g,S)),B=z[I.key],gt(B)?(r.insertBefore(u,l(I,b),A.elm),I=m[++_]):gt(z[V.key])?(r.insertBefore(u,l(V,b),r.nextSibling(E.elm)),V=m[--C]):(J=y[B],J.sel!==I.sel?r.insertBefore(u,l(I,b),A.elm):(f(J,I,b),y[B]=void 0,r.insertBefore(u,J.elm,A.elm)),I=m[++_]));_<=C&&(Q=m[C+1]==null?null:m[C+1].elm,a(u,Q,m,_,C,b)),g<=S&&d(u,y,g,S)}function f(u,y,m){var b,g,_,S,A,E,C,I;let V=(b=y.data)===null||b===void 0?void 0:b.hook;(g=V?.prepatch)===null||g===void 0||g.call(V,u,y);let z=y.elm=u.elm;if(u===y)return;if(y.data!==void 0||se(y.text)&&y.text!==u.text){(_=y.data)!==null&&_!==void 0||(y.data={}),(S=u.data)!==null&&S!==void 0||(u.data={});for(let Q=0;Q<i.update.length;++Q)i.update[Q](u,y);(C=(E=(A=y.data)===null||A===void 0?void 0:A.hook)===null||E===void 0?void 0:E.update)===null||C===void 0||C.call(E,u,y)}let B=u.children,J=y.children;gt(y.text)?se(B)&&se(J)?B!==J&&h(z,B,J,m):se(J)?(se(u.text)&&r.setTextContent(z,""),a(z,null,J,0,J.length-1,m)):se(B)?d(z,B,0,B.length-1):se(u.text)&&r.setTextContent(z,""):u.text!==y.text&&(se(B)&&d(z,B,0,B.length-1),r.setTextContent(z,y.text)),(I=V?.postpatch)===null||I===void 0||I.call(V,u,y)}return function(u,y){let m,b,g,_=[];for(m=0;m<i.pre.length;++m)i.pre[m]();for(jy(r,u)?u=n(u):By(r,u)&&(u=o(u)),tt(u,y)?f(u,y,_):(b=u.elm,g=r.parentNode(b),l(y,_),g!==null&&(r.insertBefore(g,y.elm,r.nextSibling(b)),d(g,[u],0,0))),m=0;m<_.length;++m)_[m].data.hook.insert(_[m]);for(m=0;m<i.post.length;++m)i.post[m]();return y}}function gr(e,t){let s,i,r=t.elm,n=e.data.class,o=t.data.class;if(!(!n&&!o)&&n!==o){n=n||{},o=o||{};for(i in n)n[i]&&!Object.prototype.hasOwnProperty.call(o,i)&&r.classList.remove(i);for(i in o)s=o[i],s!==n[i]&&r.classList[s?"add":"remove"](i)}}var Fy={create:gr,update:gr};function br(e,t){let s,i,r,n=t.elm,o=e.data.props,p=t.data.props;if(!(!o&&!p)&&o!==p){o=o||{},p=p||{};for(s in p)i=p[s],r=o[s],r!==i&&(s!=="value"||n[s]!==i)&&(n[s]=i)}}var Ky={create:br,update:br},Uy="http://www.w3.org/1999/xlink",Hy="http://www.w3.org/2000/xmlns/",qy="http://www.w3.org/XML/1998/namespace",vr=58,Yy=120,Gy=109;function wr(e,t){let s,i=t.elm,r=e.data.attrs,n=t.data.attrs;if(!(!r&&!n)&&r!==n){r=r||{},n=n||{};for(s in n){let o=n[s];r[s]!==o&&(o===!0?i.setAttribute(s,""):o===!1?i.removeAttribute(s):s.charCodeAt(0)!==Yy?i.setAttribute(s,o):s.charCodeAt(3)===vr?i.setAttributeNS(qy,s,o):s.charCodeAt(5)===vr?s.charCodeAt(1)===Gy?i.setAttributeNS(Hy,s,o):i.setAttributeNS(Uy,s,o):i.setAttribute(s,o))}for(s in r)s in n||i.removeAttribute(s)}}var Jy={create:wr,update:wr},_r=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,Qy=function(e){_r(function(){_r(e)})},Bs=!1;function Zy(e,t,s){Qy(function(){e[t]=s})}function xr(e,t){let s,i,r=t.elm,n=e.data.style,o=t.data.style;if(!n&&!o||n===o)return;n=n||{},o=o||{};let p="delayed"in n;for(i in n)i in o||(i[0]==="-"&&i[1]==="-"?r.style.removeProperty(i):r.style[i]="");for(i in o)if(s=o[i],i==="delayed"&&o.delayed)for(let l in o.delayed)s=o.delayed[l],(!p||s!==n.delayed[l])&&Zy(r.style,l,s);else i!=="remove"&&s!==n[i]&&(i[0]==="-"&&i[1]==="-"?r.style.setProperty(i,s):r.style[i]=s)}function Xy(e){let t,s,i=e.elm,r=e.data.style;if(!(!r||!(t=r.destroy)))for(s in t)i.style[s]=t[s]}function em(e,t){let s=e.data.style;if(!s||!s.remove){t();return}Bs||(e.elm.offsetLeft,Bs=!0);let i,r=e.elm,n=0,o=s.remove,p=0,l=[];for(i in o)l.push(i),r.style[i]=o[i];let a=getComputedStyle(r)["transition-property"].split(", ");for(;n<a.length;++n)l.indexOf(a[n])!==-1&&p++;r.addEventListener("transitionend",function(c){c.target===r&&--p,p===0&&t()})}function tm(){Bs=!1}var sm={pre:tm,create:xr,update:xr,destroy:Xy,remove:em};function Kn(e,t,s){if(typeof e=="function")e.call(t,s,t);else if(typeof e=="object")for(let i=0;i<e.length;i++)Kn(e[i],t,s)}function im(e,t){let s=e.type,i=t.data.on;i&&i[s]&&Kn(i[s],t,e)}function rm(){return function e(t){im(t,e.vnode)}}function vs(e,t){let s=e.data.on,i=e.listener,r=e.elm,n=t&&t.data.on,o=t&&t.elm,p;if(s!==n){if(s&&i)if(n)for(p in s)n[p]||r.removeEventListener(p,i,!1);else for(p in s)r.removeEventListener(p,i,!1);if(n){let l=t.listener=e.listener||rm();if(l.vnode=t,s)for(p in n)s[p]||o.addEventListener(p,l,!1);else for(p in n)o.addEventListener(p,l,!1)}}}var nm={create:vs,update:vs,destroy:vs},om=()=>Wy([Fy,Ky,Jy,sm,nm]);function Un(e,t,s){if(e.ns="http://www.w3.org/2000/svg",s!=="foreignObject"&&t!==void 0)for(let i=0;i<t.length;++i){let r=t[i];if(typeof r=="string")continue;let n=r.data;n!==void 0&&Un(n,r.children,r.sel)}}function am(e,t,s){let i={},r,n,o;if(s!==void 0?(t!==null&&(i=t),Ct(s)?r=s:bt(s)?n=s.toString():s&&s.sel&&(r=[s])):t!=null&&(Ct(t)?r=t:bt(t)?n=t.toString():t&&t.sel?r=[t]:i=t),r!==void 0)for(o=0;o<r.length;++o)bt(r[o])&&(r[o]=ot(void 0,void 0,void 0,r[o],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&Un(i,r,e),ot(e,i,r,n,void 0)}var lm=om(),pm=({handlers:e,methods:t,constants:s,schema:i,view:r,store:n},o)=>{if(!r)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:a,styles:c}=r;Th({schema:p,methodExports:Object.keys(t||{})});let d=p.componentName,h=p.propsSchema,f=h?.properties?[...new Set(Object.keys(h.properties).map(u=>gn(u)))]:[];return wy({elementName:d,propsSchema:h,propsSchemaKeys:f,template:l,refs:a,styles:c,handlers:e,methods:t,constants:s,store:n,patch:lm,h:am,deps:o})},dm=e=>{let t={};return{once:(s,i)=>{t[s]||(t[s]=[]);let r=(...n)=>{i(...n),t[s]=t[s].filter(o=>o!==r)};return t[s].push(r),()=>{t[s]=(t[s]??[]).filter(n=>n!==r)}},emit:(s,...i)=>{t[s]&&[...t[s]].forEach(r=>{r(...i)})},showAlert:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showConfirm:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showFormDialog:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showComponentDialog:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showDropdownMenu:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showToast:s=>{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.")}}},cm=dm(),um={globalUI:cm},Sr={components:um},hm={componentName:"rtgl-accordion-item",propsSchema:{type:"object",properties:{label:{type:"string"},content:{type:"string"},w:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},fm={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}},ym={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:{}}},mm={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}},gm={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:{}}},bm={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}},vm={componentName:"rtgl-dropdown-menu",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["section","item","separator","label"]},id:{type:"string"},icon:{type:"string"},path:{type:"string"},href:{type:"string"},shortcut:{type:"string"},suffixText:{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"},overlay:{type:"boolean"},"no-overlay":{type:"boolean"},"sm-place":{type:"string"},"md-place":{type:"string"},"lg-place":{type:"string"},"xl-place":{type:"string"},"sm-overlay":{type:"boolean"},"md-overlay":{type:"boolean"},"lg-overlay":{type:"boolean"},"xl-overlay":{type:"boolean"},"sm-no-overlay":{type:"boolean"},"md-no-overlay":{type:"boolean"},"lg-no-overlay":{type:"boolean"},"xl-no-overlay":{type:"boolean"},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:{}}},wm={refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},styles:{a:{display:"block",width:"100%","text-decoration":"none",color:"inherit"},".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} ${popoverAttrString} content-w=${w} content-h=${h} content-sv=true content-g=xs content-pv=sm",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.isSection",value:{type:6,conditions:[{type:1,path:"item.isSection"},{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 p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs 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 p=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f p=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},{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} p=md cur=pointer bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},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:!1}],fast:!1},{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} p=md cur=pointer bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},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:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=sm",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0}],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"}," ",{type:1,path:"popoverAttrString"}," content-w=",{type:1,path:"w"}," content-h=",{type:1,path:"h"}," content-sv=true content-g=xs content-pv=sm"]}}],fast:!1}],fast:!1}},_m={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"}}}},xm={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=${field.options} ?no-clear=${field.noClear} :selectedValue=${field._selectedValue} :placeholder=${field.placeholder} ?disabled=${field._disabled} ?searchable=${field.searchable} :searchPlaceholder=${field.searchPlaceholder} :emptySearchLabel=${field.emptySearchLabel}",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=",{type:1,path:"field.options"}," ?no-clear=",{type:1,path:"field.noClear"}," :selectedValue=",{type:1,path:"field._selectedValue"}," :placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}," ?searchable=",{type:1,path:"field.searchable"}," :searchPlaceholder=",{type:1,path:"field.searchPlaceholder"}," :emptySearchLabel=",{type:1,path:"field.emptySearchLabel"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "tag-select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"tag-select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-tag-select#field${field._idx} data-field-name=${field.name} w=f :options=${field.options} :selectedValues=${field._selectedValues} :placeholder=${field.placeholder} :addOption=${field.addOption} ?no-add=${field.noAdd} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-tag-select#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=",{type:1,path:"field.options"}," :selectedValues=",{type:1,path:"field._selectedValues"}," :placeholder=",{type:1,path:"field.placeholder"}," :addOption=",{type:1,path:"field.addOption"}," ?no-add=",{type:1,path:"field.noAdd"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "segmented-control"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"segmented-control"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-segmented-control#field${field._idx} data-field-name=${field.name} w=f :options=${field.options} ?no-clear=${field.noClear} :selectedValue=${field._selectedValue} :placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-segmented-control#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=",{type:1,path:"field.options"}," ?no-clear=",{type:1,path:"field.noClear"}," :selectedValue=",{type:1,path:"field._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}},Sm={componentName:"rtgl-global-ui",propsSchema:{type:"object",properties:{}},events:[],methods:{type:"object",properties:{}}},Am={refs:{dialog:{eventListeners:{close:{handler:"handleDialogClose"}}},confirmButton:{eventListeners:{click:{handler:"handleConfirm"}}},cancelButton:{eventListeners:{click:{handler:"handleCancel"}}},componentDialogBodyHost:{},"componentDialogAction*":{eventListeners:{click:{handler:"handleComponentDialogAction"}}},formDialog:{eventListeners:{"form-action":{handler:"handleFormAction"},"form-field-event":{handler:"handleFormFieldEvent"}}},dropdownMenu:{eventListeners:{close:{handler:"handleDropdownClose"},"item-click":{handler:"handleDropdownItemClick"}}}},styles:{".toast-layer":{"pointer-events":"none"},".toast-card":{"pointer-events":"auto","box-sizing":"border-box",width:"33vw","max-width":"calc(100vw - 2 * var(--spacing-lg))",opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 180ms cubic-bezier(0.16, 1, 0.3, 1), transform 180ms cubic-bezier(0.16, 1, 0.3, 1)","will-change":"opacity, transform"},".toast-card-top":{animation:"toast-in-top 220ms cubic-bezier(0.16, 1, 0.3, 1)"},".toast-card-bottom":{animation:"toast-in-bottom 220ms cubic-bezier(0.16, 1, 0.3, 1)"},".toast-card-md":{width:"50vw"},".toast-card-lg":{width:"80vw"},".toast-card-top.toast-card-exiting":{opacity:0,transform:"translateY(calc(var(--spacing-sm) * -0.5)) scale(0.98)"},".toast-card-bottom.toast-card-exiting":{opacity:0,transform:"translateY(calc(var(--spacing-sm) * 0.5)) scale(0.98)"},".toast-message":{"overflow-wrap":"anywhere"},"@keyframes toast-in-top":{from:{opacity:0,transform:"translateY(calc(var(--spacing-sm) * -1)) scale(0.96)"},to:{opacity:1,transform:"translateY(0) scale(1)"}},"@keyframes toast-in-bottom":{from:{opacity:0,transform:"translateY(var(--spacing-sm)) scale(0.96)"},to:{opacity:1,transform:"translateY(0) scale(1)"}},"@media (prefers-reduced-motion: reduce)":{".toast-card":{animation:"none",transition:"none"}},"@media only screen and (max-width: 768px)":{".toast-card":{width:"calc(100vw - 2 * var(--spacing-lg))"}}},template:{type:9,items:[{type:8,properties:[{key:"$if topToasts.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"topToasts.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-layer toast-layer-top" pos=fix edge=t z=2100 w=f ah=c g=sm ph=md pt=xl',value:{type:9,items:[{type:7,itemVar:"toast",indexVar:"i",iterable:{type:1,path:"topToasts"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-card toast-card-top toast-card-${toast.size} toast-card-${toast.phase}" key=toast-${toast.id} bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text class=toast-message ta=c w=f",value:{type:1,path:"toast.message"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view class="toast-card toast-card-top toast-card-',{type:1,path:"toast.size"}," toast-card-",{type:1,path:"toast.phase"},'" key=toast-',{type:1,path:"toast.id"}," bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if bottomToasts.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"bottomToasts.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-layer toast-layer-bottom" pos=fix edge=b z=2100 w=f ah=c g=sm ph=md pb=xl',value:{type:9,items:[{type:7,itemVar:"toast",indexVar:"i",iterable:{type:1,path:"bottomToasts"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-card toast-card-bottom toast-card-${toast.size} toast-card-${toast.phase}" key=toast-${toast.id} bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text class=toast-message ta=c w=f",value:{type:1,path:"toast.message"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view class="toast-card toast-card-bottom toast-card-',{type:1,path:"toast.size"}," toast-card-",{type:1,path:"toast.phase"},'" key=toast-',{type:1,path:"toast.id"}," bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{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=",{type:1,path:"formDialogConfig.form"}," :defaultValues=",{type:1,path:"formDialogConfig.defaultValues"}," :context=",{type:1,path:"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 isComponentDialogOpen",value:{type:6,conditions:[{type:1,path:"isComponentDialogOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"$if componentDialogConfig.title || componentDialogConfig.description",value:{type:6,conditions:[{type:4,op:7,left:{type:1,path:"componentDialogConfig.title"},right:{type:1,path:"componentDialogConfig.description"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if componentDialogConfig.title",value:{type:6,conditions:[{type:1,path:"componentDialogConfig.title"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"componentDialogConfig.title"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if componentDialogConfig.description",value:{type:6,conditions:[{type:1,path:"componentDialogConfig.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"componentDialogConfig.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view#componentDialogBodyHost w=f key=component-dialog-body-${componentDialogConfig.key}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view#componentDialogBodyHost w=f key=component-dialog-body-",{type:1,path:"componentDialogConfig.key"}]}}],fast:!0},{type:8,properties:[{key:"$if componentDialogConfig.actions.buttons.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"componentDialogConfig.actions.buttons.length"},right:{type:0,value:0}}],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:"componentDialogConfig.actions._leftButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#componentDialogAction${button._globalIdx} data-action-id=${button.id} data-action-index=${button._globalIdx} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#componentDialogAction",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," data-action-index=",{type:1,path:"button._globalIdx"}," 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:"componentDialogConfig.actions._rightButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#componentDialogAction${button._globalIdx} data-action-id=${button.id} data-action-index=${button._globalIdx} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#componentDialogAction",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," data-action-index=",{type:1,path:"button._globalIdx"}," 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}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if !isFormDialogOpen && !isComponentDialogOpen",value:{type:6,conditions:[{type:4,op:6,left:{type:5,op:0,operand:{type:1,path:"isFormDialogOpen"}},right:{type:5,op:0,operand:{type:1,path:"isComponentDialogOpen"}}}],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} ${dropdownConfig.popoverAttrString} :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"}," ",{type:1,path:"dropdownConfig.popoverAttrString"}," :items=",{type:1,path:"dropdownConfig.items"}," key=dropdown-",{type:1,path:"isDropdownOpen"}]}}],fast:!0}],fast:!1}},Em={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:{}}},km={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}},$m={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:{}}},Cm={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}},Im={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:{}}},Om={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} content-g=md content-w=240 content-pv=sm",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},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," content-g=md content-w=240 content-pv=sm"]}}],fast:!0}],fast:!0}},Tm={componentName:"rtgl-segmented-control",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:{}}},Lm={refs:{"option*":{eventListeners:{click:{handler:"handleOptionClick"},keydown:{handler:"handleOptionKeyDown"},mouseenter:{handler:"handleOptionMouseEnter"},mouseleave:{handler:"handleOptionMouseLeave"}}},optionAdd:{eventListeners:{click:{handler:"handleAddOptionClick"},keydown:{handler:"handleAddOptionKeyDown"},mouseenter:{handler:"handleAddOptionMouseEnter"},mouseleave:{handler:"handleAddOptionMouseLeave"}}}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view d=h bw=xs bc=bo br=md bgc=bg overflow=hidden ${containerAttrString} role="group" aria-label=${ariaLabel}',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} d=h av=c ah=c w=1fg ph=lg pv=md cur=${option.cursor} bgc=${option.bgc} bwl=${option.borderLeftWidth} bc=bo data-testid=${option.testId} role="button" tabindex=${option.tabIndex} aria-pressed=${option.isSelected} aria-disabled=${isDisabled}',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${option.textColor} ta=c",value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"option.textColor"}," ta=c"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," d=h av=c ah=c w=1fg ph=lg pv=md cur=",{type:1,path:"option.cursor"}," bgc=",{type:1,path:"option.bgc"}," bwl=",{type:1,path:"option.borderLeftWidth"}," bc=bo data-testid=",{type:1,path:"option.testId"},' role="button" tabindex=',{type:1,path:"option.tabIndex"}," aria-pressed=",{type:1,path:"option.isSelected"}," aria-disabled=",{type:1,path:"isDisabled"}]}}],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#optionAdd d=h av=c ah=c w=1fg ph=lg pv=md cur=pointer bgc=${addOptionBgc} bwl=${addOptionBorderLeftWidth} bc=bo data-testid="segmented-control-add-option" role="button" tabindex=0',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=ac ta=c",value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#optionAdd d=h av=c ah=c w=1fg ph=lg pv=md cur=pointer bgc=",{type:1,path:"addOptionBgc"}," bwl=",{type:1,path:"addOptionBorderLeftWidth"},' bc=bo data-testid="segmented-control-add-option" role="button" tabindex=0']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h bw=xs bc=bo br=md bgc=bg overflow=hidden ",{type:1,path:"containerAttrString"},' role="group" aria-label=',{type:1,path:"ariaLabel"}]}}],fast:!1}],fast:!1}},Vm={componentName:"rtgl-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{type:{type:"string",enum:["section","item","separator"]},label:{type:"string"},value:{type:"any"},icon:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},testId:{type:"string"}}}},selectedValue:{type:"any"},onChange:{type:"function"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},disabled:{type:"boolean"},searchable:{type:"boolean"},searchPlaceholder:{type:"string"},emptySearchLabel:{type:"string"},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}},Rm={refs:{selectButton:{eventListeners:{click:{handler:"handleButtonClick"},keydown:{handler:"handleButtonKeyDown"}}},clearButton:{eventListeners:{click:{handler:"handleClearClick"}}},searchInput:{eventListeners:{"value-input":{handler:"handleSearchInput",stopPropagation:!0},keydown:{handler:"handleSearchKeyDown",stopPropagation:!0}}},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"}}}},styles:{".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view#selectButton style="display: inline-flex;" d=h av=c h=32 ph=md bw=xs bc=bo h-bc=${selectButtonHoverBorderColor} br=md bgc=su cur=${selectButtonCursor} ${containerAttrString} data-testid="select-button" role="button" tabindex=${selectButtonTabIndex} aria-disabled=${isDisabled}',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c ah=s w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if hasSelectedIcon",value:{type:6,conditions:[{type:1,path:"hasSelectedIcon"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg svg=${selectedIcon} wh=16 c=${selectedIconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg svg=",{type:1,path:"selectedIcon"}," wh=16 c=",{type:1,path:"selectedIconColor"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{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}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if hasSelectedSuffixText",value:{type:6,conditions:[{type:1,path:"hasSelectedSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${selectedSuffixTextColor} ta=e",value:{type:1,path:"selectedSuffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"selectedSuffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{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 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 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-view#selectButton style="display: inline-flex;" d=h av=c h=32 ph=md bw=xs bc=bo h-bc=',{type:1,path:"selectButtonHoverBorderColor"}," br=md bgc=su cur=",{type:1,path:"selectButtonCursor"}," ",{type:1,path:"containerAttrString"},' data-testid="select-button" role="button" tabindex=',{type:1,path:"selectButtonTabIndex"}," aria-disabled=",{type:1,path:"isDisabled"}]}}],fast:!1},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=rs content-wh=300 content-g=xs content-sv=true ?content-hsb=${showSearch} content-pv=sm",value:{type:9,items:[{type:8,properties:[{key:"$if showSearch",value:{type:6,conditions:[{type:1,path:"showSearch"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f mt=md mh=md mb=xs",value:{type:9,items:[{type:8,properties:[{key:'rtgl-input#searchInput w=f s=sm value=${searchQuery} placeholder="${searchPlaceholder}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#searchInput w=f s=sm value=",{type:1,path:"searchQuery"},' placeholder="',{type:1,path:"searchPlaceholder"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"renderOptions"},body:{type:9,items:[{type:8,properties:[{key:"$if option.isSection",value:{type:6,conditions:[{type:1,path:"option.isSection"},{type:1,path:"option.isItem"},{type:1,path:"option.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md ?hide=${option.isSearchHidden}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view w=f p=md ?hide=",{type:1,path:"option.isSearchHidden"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${option.index} w=f ph=lg pv=md cur=pointer bgc=${option.bgc} data-testid=${option.testId} ?hide=${option.isSearchHidden}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if option.hasIconSlot",value:{type:6,conditions:[{type:1,path:"option.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if option.hasIcon",value:{type:6,conditions:[{type:1,path:"option.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${option.icon} c=${option.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"option.icon"}," c=",{type:1,path:"option.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${option.c} w=1fg ellipsis",value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"option.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if option.hasSuffixText",value:{type:6,conditions:[{type:1,path:"option.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${option.suffixTextColor} ta=e",value:{type:1,path:"option.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"option.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"option.index"}," w=f ph=lg pv=md cur=pointer bgc=",{type:1,path:"option.bgc"}," data-testid=",{type:1,path:"option.testId"}," ?hide=",{type:1,path:"option.isSearchHidden"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=sm ?hide=${option.isSearchHidden}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view w=f h=1 bgc=mu mv=sm ?hide=",{type:1,path:"option.isSearchHidden"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0},{type:8,properties:[{key:"$if showSearch",value:{type:6,conditions:[{type:1,path:"showSearch"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f ph=lg pv=md ?hide=${hideEmptySearch}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"emptySearchLabel"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view w=f ph=lg pv=md ?hide=",{type:1,path:"hideEmptySearch"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{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 bgc=${addOptionBgc} data-testid="select-add-option"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm 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 bgc=",{type:1,path:"addOptionBgc"},' data-testid="select-add-option"']}}],fast:!0}],fast:!0}],id:null}}],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 content-wh=300 content-g=xs content-sv=true ?content-hsb=",{type:1,path:"showSearch"}," content-pv=sm"]}}],fast:!1}],fast:!1}},Nm={componentName:"rtgl-sidebar",propsSchema:{type:"object",properties:{mode:{type:"string"},hideHeader:{type:"boolean",default:!1},tooltip:{type:"boolean",default:!1},showCompactTooltip:{type:"boolean",default:!1,description:"Deprecated alias for tooltip. Use tooltip instead."},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:{label:{type:"string"},title:{type:"string",description:"Deprecated item text field. Use label instead."},slug:{type:"string"},type:{type:"string",description:"Item row type. Supports item, groupLabel, divider, and spacer."},tooltip:{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:{}}},Dm={refs:{headerImage:{eventListeners:{click:{handler:"handleHeaderClick"}}},headerLabel:{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item*":{eventListeners:{click:{handler:"handleItemClick"},mouseenter:{handler:"handleItemMouseEnter"},mouseleave:{handler:"handleItemMouseLeave"}}}},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 == "divider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"divider"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"spacer"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"groupLabel"}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f pv=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=1 w=f bgc=mu",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view h=1fg w=f",value:{type:0,value:null}}],fast:!0}],fast:!0},{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.label"}}],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} aria-label="${item.label}"',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.label"}}],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.label"}}],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.label.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"},' aria-label="',{type:1,path:"item.label"},'"']}}],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},{type:8,properties:[{key:"$if enableCompactTooltip",value:{type:6,conditions:[{type:1,path:"enableCompactTooltip"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-tooltip#tooltip s="md" ?open=${tooltipState.open} x=${tooltipState.x} y=${tooltipState.y} place=${tooltipState.place} content="${tooltipState.content}"',value:{type:0,value:null},parsedKey:{type:2,parts:['rtgl-tooltip#tooltip s="md" ?open=',{type:1,path:"tooltipState.open"}," x=",{type:1,path:"tooltipState.x"}," y=",{type:1,path:"tooltipState.y"}," place=",{type:1,path:"tooltipState.place"},' content="',{type:1,path:"tooltipState.content"},'"']}}],fast:!0}],fast:!0}],id:null}}],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}},Pm={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:{}}},jm={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}},Bm={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:{}}},zm={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}},Mm={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:{}}},Wm={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}},Fm={componentName:"rtgl-tag-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{type:{type:"string",enum:["section","item","separator"]},label:{type:"string"},value:{type:"any"},icon:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},testId:{type:"string"}}}},selectedValues:{type:"array",items:{type:"any"}},draftSelectedValues:{type:"array",items:{type:"any"}},open:{type:"boolean"},onChange:{type:"function"},addOption:{type:"object",properties:{label:{type:"string"}}},noAdd:{type:"boolean"},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"draft-value-change":{},"open-change":{},"add-option-click":{}},methods:{type:"object",properties:{refreshPopover:{description:"Recomputes the open popover position and rerenders the current options and draft values.",params:["values","keepOpen"],returns:"void"},setDraftSelectedValues:{description:"Replaces the draft-only selection without committing `selectedValues`; optionally reopens the popover around the trigger when `keepOpen` is true.",params:["values","keepOpen"],returns:"void"},appendDraftSelectedValue:{description:"Adds a value to the draft-only selection without committing `selectedValues`; optionally reopens the popover around the trigger when `keepOpen` is true.",params:["value","keepOpen"],returns:"void"}}}},Km={refs:{trigger:{eventListeners:{click:{handler:"handleTriggerClick"},keydown:{handler:"handleTriggerKeyDown"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},"option*":{eventListeners:{click:{handler:"handleOptionClick"},keydown:{handler:"handleOptionKeyDown"}}},submitButton:{eventListeners:{click:{handler:"handleSubmitClick"}}},addOptionButton:{eventListeners:{click:{handler:"handleAddOptionClick"}}}},styles:{".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view#trigger d=h av=c g=sm cur=${triggerCursor} ${containerAttrString} data-testid="tag-select-trigger" role="button" tabindex=${triggerTabIndex} aria-disabled=${isDisabled} style="min-height: 24px;"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c wrap g=sm w=1fg",value:{type:9,items:[{type:7,itemVar:"tag",indexVar:"i",iterable:{type:1,path:"triggerTags"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-tag data-selection-index=${tag.selectionIndex} pre=${tag.icon} data-testid=${tag.testId} v=mu style="${tag.tagStyle}"',value:{type:1,path:"tag.label"},parsedKey:{type:2,parts:["rtgl-tag data-selection-index=",{type:1,path:"tag.selectionIndex"}," pre=",{type:1,path:"tag.icon"}," data-testid=",{type:1,path:"tag.testId"},' v=mu style="',{type:1,path:"tag.tagStyle"},'"']}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#trigger d=h av=c g=sm cur=",{type:1,path:"triggerCursor"}," ",{type:1,path:"containerAttrString"},' data-testid="tag-select-trigger" role="button" tabindex=',{type:1,path:"triggerTabIndex"}," aria-disabled=",{type:1,path:"isDisabled"},' style="min-height: 24px;"']}}],fast:!1},{type:8,properties:[{key:"$if isOpen",value:{type:6,conditions:[{type:1,path:"isOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=bs content-w=${position.w} content-g=sm content-sv=true content-ph=md content-pv=md",value:{type:9,items:[{type:8,properties:[{key:"$if !hasSelectableOptions",value:{type:6,conditions:[{type:5,op:0,operand:{type:1,path:"hasSelectableOptions"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:0,value:"No tags available"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h wrap g=sm w=f",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"$if option.isSection",value:{type:6,conditions:[{type:1,path:"option.isSection"},{type:1,path:"option.isItem"},{type:1,path:"option.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f pt=xs",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-view#option${option.index} cur=${option.cursor} data-testid=${option.testId} role="button" tabindex=0 aria-pressed=${option.isSelected}',value:{type:9,items:[{type:8,properties:[{key:'rtgl-tag v=mu pre=${option.icon} style="${option.tagStyle}"',value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-tag v=mu pre=",{type:1,path:"option.icon"},' style="',{type:1,path:"option.tagStyle"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"option.index"}," cur=",{type:1,path:"option.cursor"}," data-testid=",{type:1,path:"option.testId"},' role="button" tabindex=0 aria-pressed=',{type:1,path:"option.isSelected"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=xs",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},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-button#addOptionButton v=gh s=sm pre=plus data-testid="tag-select-add-option"',value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h av=c g=sm w=f pt=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-button#submitButton v=pr s=sm data-testid="tag-select-submit" ?disabled=${submitDisabled}',value:{type:1,path:"submitLabel"},parsedKey:{type:2,parts:['rtgl-button#submitButton v=pr s=sm data-testid="tag-select-submit" ?disabled=',{type:1,path:"submitDisabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],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=bs content-w=",{type:1,path:"position.w"}," content-g=sm content-sv=true content-ph=md content-pv=md"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}},Um={componentName:"rtgl-tooltip",propsSchema:{type:"object",properties:{open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},s:{type:"string",enum:["sm","md","lg"]},content:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},Hm={template:{type:9,items:[{type:8,properties:[{key:'rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} no-overlay content-bgc=mu content-style="${contentStyle}"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view p=${padding} ah=s av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text ta=s s=${textSize} c=fg",value:{type:1,path:"content"},parsedKey:{type:2,parts:["rtgl-text ta=s s=",{type:1,path:"textSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view p=",{type:1,path:"padding"}," ah=s av=c"]}}],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 content-bgc=mu content-style="',{type:1,path:"contentStyle"},'"']}}],fast:!0}],fast:!0},refs:{}},qm={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:{}}},Ym={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=Po;x.components.accordionItem.schema=hm;x.components.accordionItem.store=Fo;x.components.accordionItem.view=fm;x.components.breadcrumb={};x.components.breadcrumb.handlers=Uo;x.components.breadcrumb.schema=ym;x.components.breadcrumb.store=ea;x.components.breadcrumb.view=mm;x.components.card={};x.components.card.schema=gm;x.components.card.store=na;x.components.card.view=bm;x.components.dropdownMenu={};x.components.dropdownMenu.handlers=da;x.components.dropdownMenu.schema=vm;x.components.dropdownMenu.store=ga;x.components.dropdownMenu.view=wm;x.components.form={};x.components.form.handlers=Pl;x.components.form.methods=ql;x.components.form.schema=_m;x.components.form.store=kl;x.components.form.view=xm;x.components.globalUi={};x.components.globalUi.handlers=gp;x.components.globalUi.schema=Sm;x.components.globalUi.store=qp;x.components.globalUi.view=Am;x.components.navbar={};x.components.navbar.handlers=Gp;x.components.navbar.schema=Em;x.components.navbar.store=id;x.components.navbar.view=km;x.components.pageOutline={};x.components.pageOutline.handlers=ad;x.components.pageOutline.schema=$m;x.components.pageOutline.store=yd;x.components.pageOutline.view=Cm;x.components.popoverInput={};x.components.popoverInput.handlers=Sd;x.components.popoverInput.schema=Im;x.components.popoverInput.store=Td;x.components.popoverInput.view=Om;x.components.segmentedControl={};x.components.segmentedControl.handlers=zd;x.components.segmentedControl.schema=Tm;x.components.segmentedControl.store=Xd;x.components.segmentedControl.view=Lm;x.components.select={};x.components.select.handlers=mc;x.components.select.schema=Vm;x.components.select.store=Dc;x.components.select.view=Rm;x.components.sidebar={};x.components.sidebar.handlers=Wc;x.components.sidebar.schema=Nm;x.components.sidebar.store=tu;x.components.sidebar.view=Dm;x.components.sliderInput={};x.components.sliderInput.handlers=ou;x.components.sliderInput.schema=Pm;x.components.sliderInput.store=du;x.components.sliderInput.view=jm;x.components.table={};x.components.table.handlers=fu;x.components.table.schema=Bm;x.components.table.store=Au;x.components.table.view=zm;x.components.tabs={};x.components.tabs.handlers=ku;x.components.tabs.schema=Mm;x.components.tabs.store=Tu;x.components.tabs.view=Wm;x.components.tagSelect={};x.components.tagSelect.handlers=Fu;x.components.tagSelect.methods=qu;x.components.tagSelect.schema=Fm;x.components.tagSelect.store=yh;x.components.tagSelect.view=Km;x.components.tooltip={};x.components.tooltip.handlers=mh;x.components.tooltip.schema=Um;x.components.tooltip.store=vh;x.components.tooltip.view=Hm;x.components.waveform={};x.components.waveform.handlers=xh;x.components.waveform.schema=qm;x.components.waveform.store=kh;x.components.waveform.view=Ym;var Gm={};Object.keys(x).forEach(e=>{Object.keys(x[e]).forEach(t=>{let s=x[e][t],i={...Sr&&Sr[e]||{},...Gm},r=pm({...s},i),n=s.schema?.componentName;if(!n)throw new Error(`[Build] Missing schema.componentName for ${e}/${t}. Define it in .schema.yaml.`);customElements.define(n,r)})});customElements.define("rtgl-button",ai({}));customElements.define("rtgl-carousel",ui({}));customElements.define("rtgl-grid",hi({}));customElements.define("rtgl-view",yi({}));customElements.define("rtgl-text",gi({}));customElements.define("rtgl-image",wi({}));customElements.define("rtgl-tag",xi({}));customElements.define("rtgl-svg",Ai({}));customElements.define("rtgl-input",ve({}));customElements.define("rtgl-input-date",Ei({}));customElements.define("rtgl-input-time",ki({}));customElements.define("rtgl-input-datetime",$i({}));customElements.define("rtgl-input-number",Ci({}));customElements.define("rtgl-textarea",Ii({}));customElements.define("rtgl-color-picker",Oi({}));customElements.define("rtgl-slider",Ti({}));customElements.define("rtgl-checkbox",Li({}));customElements.define("rtgl-dialog",Vi({}));customElements.define("rtgl-popover",ji({}));})();