@rettangoli/ui 1.2.2 → 1.2.4

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,7 +12,7 @@ var rettangoli=(()=>{var we=`
12
12
  bottom: 0;
13
13
  z-index: 1;
14
14
  }
15
- `,ze=({linkElement:e,href:t,newTab:r,rel:i})=>{e.href=t,r?e.target="_blank":e.removeAttribute("target"),i!=null?e.rel=i:r?e.rel="noopener noreferrer":e.removeAttribute("rel")},_e=({shadowRoot:e,slotElement:t,linkElement:r,href:i,newTab:s,rel:n})=>{if(t.parentNode!==e&&e.appendChild(t),!i)return r&&r.parentNode===e&&e.removeChild(r),null;let o=r||document.createElement("a");return ze({linkElement:o,href:i,newTab:s,rel:n}),o.parentNode!==e&&e.appendChild(o),o},It=({shadowRoot:e,childElement:t,linkElement:r,href:i,newTab:s,rel:n})=>{if(!i)return r?(t.parentNode===r&&e.appendChild(t),r.parentNode===e&&e.removeChild(r),null):(t.parentNode!==e&&e.appendChild(t),null);let o=r||document.createElement("a");return ze({linkElement:o,href:i,newTab:s,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),{}),Pr=["sm","md","lg","xl"],tn=({size:e,attr:t})=>e==="default"?t:`${e}-${t}`,rn=({size:e,includeDefault:t=!0})=>{if(e==="default")return["default"];let r=Pr.indexOf(e);if(r===-1)return t?["default"]:[];let i=Pr.slice(r);return t&&i.push("default"),i},Ot=({element:e,size:t,attr:r,includeDefault:i=!0})=>{let s=rn({size:t,includeDefault:i});for(let n of s){let o=tn({size:n,attr:r}),p=e.getAttribute(o);if(p!==null)return p}return null};var sn=/^([1-9]|1[0-2])fg$/,nn=/^([1-9]\d*)\/([1-9]\d*)fb$/,Tt=e=>typeof e=="string"&&sn.test(e),nt=e=>{if(typeof e!="string")return null;let t=e.match(nn);if(!t)return null;let r=Number(t[1]),i=Number(t[2]);return!Number.isInteger(r)||!Number.isInteger(i)||i<=0||r>i?null:{numerator:r,denominator:i}};function Br({numerator:e,denominator:t,gapVar:r}){return e===t?"100%":e===1?`calc((100% - ((${t} - 1) * ${r})) / ${t})`:`calc(((100% - ((${t} - 1) * ${r})) * ${e}) / ${t})`}var M=({styleBucket:e,axis:t,dimension:r,fillValue:i,allowFlexGrow:s=!1,flexMinDimension:n="0",lockBounds:o=!0})=>{let p=()=>{!s||t!=="width"||(e["flex-grow"]="0",e["flex-shrink"]="1",e["flex-basis"]="auto")},l=()=>{e[`min-${t}`]="unset",e[`max-${t}`]="unset"};if(r===void 0)return;if(r==="f"){p(),e[t]=i,l();return}if(s&&Tt(r)){e["flex-grow"]=r.slice(0,-2),e["flex-basis"]="0%",e[`min-${t}`]=n,e[`max-${t}`]="unset";return}let a=s?nt(r):null;if(a){e["flex-grow"]="0",e["flex-shrink"]="0",e["flex-basis"]=Br({...a,gapVar:"var(--rtgl-flex-gap, 0px)"}),e[`min-${t}`]=n,e[`max-${t}`]="unset";return}p(),e[t]=r,o&&(e[`min-${t}`]=r,e[`max-${t}`]=r)},We=({style:e,width:t,fillValue:r="var(--width-stretch)",allowFlexGrow:i=!0,flexMinWidth:s="0"})=>{if(t==="f"){e.width=r,e.flexGrow="",e.flexBasis="",e.minWidth="";return}if(i&&Tt(t)){e.width="",e.flexGrow=t.slice(0,-2),e.flexShrink="",e.flexBasis="0%",e.minWidth=s;return}let n=i?nt(t):null;if(n){e.width="",e.flexGrow="0",e.flexShrink="0",e.flexBasis=Br({...n,gapVar:"var(--rtgl-flex-gap, 0px)"}),e.minWidth=s;return}if(t!=null){e.width=t,e.flexGrow="",e.flexShrink="",e.flexBasis="",e.minWidth="";return}e.width="",e.flexGrow="",e.flexShrink="",e.flexBasis="",e.minWidth=""};var on=e=>`${e}`.trim().replace(/\s*\/\s*/g,"/"),Fe=e=>{if(e==null)return;let t=on(e);if(t.length!==0)return typeof CSS<"u"&&typeof CSS.supports=="function"?CSS.supports("aspect-ratio",t)?t:void 0:t};function T(e,...t){let r="";return e.forEach((i,s)=>{r+=i+(t[s]||"")}),r}var an=["sm","md","lg","xl"],zr={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"},ae=Object.keys(zr),q=e=>e.concat(an.flatMap(t=>e.map(r=>`${t}-${r}`))),Wr={default:void 0,xl:"@media only screen and (max-width: 1280px)",lg:"@media only screen and (max-width: 1024px)",md:"@media only screen and (max-width: 768px)",sm:"@media only screen and (max-width: 640px)"},G=(e,t={},r=null)=>{let i="";for(let[s,n]of Object.entries(Wr)){s!=="default"&&(i+=`${n} {`);for(let[o,p]of Object.entries(e))for(let[l,a]of Object.entries(p)){let c=zr[o],d=a.startsWith("--")?`var(${a})`:a,h=s==="default"?o:`${s}-${o}`,f=s==="default"?`h-${o}`:`${s}-h-${o}`,u=(m,y=!1)=>{let b=y?`:host([${m}="${l}"]:hover)`:`:host([${m}="${l}"])`;if(r)return r.split(",").map(_=>`${b} ${_.trim()}`).join(", ");let g=t[o];return g?`${b} ${g}`:b};if(c){let y=c.split(" ").map(b=>`${b}: ${d};`).join(" ");i+=`
15
+ `,ze=({linkElement:e,href:t,newTab:r,rel:i})=>{e.href=t,r?e.target="_blank":e.removeAttribute("target"),i!=null?e.rel=i:r?e.rel="noopener noreferrer":e.removeAttribute("rel")},_e=({shadowRoot:e,slotElement:t,linkElement:r,href:i,newTab:s,rel:n})=>{if(t.parentNode!==e&&e.appendChild(t),!i)return r&&r.parentNode===e&&e.removeChild(r),null;let o=r||document.createElement("a");return ze({linkElement:o,href:i,newTab:s,rel:n}),o.parentNode!==e&&e.appendChild(o),o},It=({shadowRoot:e,childElement:t,linkElement:r,href:i,newTab:s,rel:n})=>{if(!i)return r?(t.parentNode===r&&e.appendChild(t),r.parentNode===e&&e.removeChild(r),null):(t.parentNode!==e&&e.appendChild(t),null);let o=r||document.createElement("a");return ze({linkElement:o,href:i,newTab:s,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),{}),zr=["sm","md","lg","xl"],on=({size:e,attr:t})=>e==="default"?t:`${e}-${t}`,an=({size:e,includeDefault:t=!0})=>{if(e==="default")return["default"];let r=zr.indexOf(e);if(r===-1)return t?["default"]:[];let i=zr.slice(r);return t&&i.push("default"),i},Ot=({element:e,size:t,attr:r,includeDefault:i=!0})=>{let s=an({size:t,includeDefault:i});for(let n of s){let o=on({size:n,attr:r}),p=e.getAttribute(o);if(p!==null)return p}return null};var ln=/^([1-9]|1[0-2])fg$/,pn=/^([1-9]\d*)\/([1-9]\d*)fb$/,Tt=e=>typeof e=="string"&&ln.test(e),nt=e=>{if(typeof e!="string")return null;let t=e.match(pn);if(!t)return null;let r=Number(t[1]),i=Number(t[2]);return!Number.isInteger(r)||!Number.isInteger(i)||i<=0||r>i?null:{numerator:r,denominator:i}};function Wr({numerator:e,denominator:t,gapVar:r}){return e===t?"100%":e===1?`calc((100% - ((${t} - 1) * ${r})) / ${t})`:`calc(((100% - ((${t} - 1) * ${r})) * ${e}) / ${t})`}var M=({styleBucket:e,axis:t,dimension:r,fillValue:i,allowFlexGrow:s=!1,flexMinDimension:n="0",lockBounds:o=!0})=>{let p=()=>{!s||t!=="width"||(e["flex-grow"]="0",e["flex-shrink"]="1",e["flex-basis"]="auto")},l=()=>{e[`min-${t}`]="unset",e[`max-${t}`]="unset"};if(r===void 0)return;if(r==="f"){p(),e[t]=i,l();return}if(s&&Tt(r)){e["flex-grow"]=r.slice(0,-2),e["flex-basis"]="0%",e[`min-${t}`]=n,e[`max-${t}`]="unset";return}let a=s?nt(r):null;if(a){e["flex-grow"]="0",e["flex-shrink"]="0",e["flex-basis"]=Wr({...a,gapVar:"var(--rtgl-flex-gap, 0px)"}),e[`min-${t}`]=n,e[`max-${t}`]="unset";return}p(),e[t]=r,o&&(e[`min-${t}`]=r,e[`max-${t}`]=r)},We=({style:e,width:t,fillValue:r="var(--width-stretch)",allowFlexGrow:i=!0,flexMinWidth:s="0"})=>{if(t==="f"){e.width=r,e.flexGrow="",e.flexBasis="",e.minWidth="";return}if(i&&Tt(t)){e.width="",e.flexGrow=t.slice(0,-2),e.flexShrink="",e.flexBasis="0%",e.minWidth=s;return}let n=i?nt(t):null;if(n){e.width="",e.flexGrow="0",e.flexShrink="0",e.flexBasis=Wr({...n,gapVar:"var(--rtgl-flex-gap, 0px)"}),e.minWidth=s;return}if(t!=null){e.width=t,e.flexGrow="",e.flexShrink="",e.flexBasis="",e.minWidth="";return}e.width="",e.flexGrow="",e.flexShrink="",e.flexBasis="",e.minWidth=""};var dn=e=>`${e}`.trim().replace(/\s*\/\s*/g,"/"),Fe=e=>{if(e==null)return;let t=dn(e);if(t.length!==0)return typeof CSS<"u"&&typeof CSS.supports=="function"?CSS.supports("aspect-ratio",t)?t:void 0:t};function T(e,...t){let r="";return e.forEach((i,s)=>{r+=i+(t[s]||"")}),r}var cn=["sm","md","lg","xl"],Fr={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"},ae=Object.keys(Fr),q=e=>e.concat(cn.flatMap(t=>e.map(r=>`${t}-${r}`))),Mr={default:void 0,xl:"@media only screen and (max-width: 1280px)",lg:"@media only screen and (max-width: 1024px)",md:"@media only screen and (max-width: 768px)",sm:"@media only screen and (max-width: 640px)"},G=(e,t={},r=null)=>{let i="";for(let[s,n]of Object.entries(Mr)){s!=="default"&&(i+=`${n} {`);for(let[o,p]of Object.entries(e))for(let[l,a]of Object.entries(p)){let c=Fr[o],d=a.startsWith("--")?`var(${a})`:a,h=s==="default"?o:`${s}-${o}`,f=s==="default"?`h-${o}`:`${s}-h-${o}`,u=(m,y=!1)=>{let b=y?`:host([${m}="${l}"]:hover)`:`:host([${m}="${l}"])`;if(r)return r.split(",").map(_=>`${b} ${_.trim()}`).join(", ");let g=t[o];return g?`${b} ${g}`:b};if(c){let y=c.split(" ").map(b=>`${b}: ${d};`).join(" ");i+=`
16
16
  ${u(h)}{
17
17
  ${y}
18
18
  }
@@ -26,13 +26,13 @@ var rettangoli=(()=>{var we=`
26
26
  ${u(f,!0)}{
27
27
  ${a}
28
28
  }
29
- `}s!=="default"&&(i+="}")}return i};function ln(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var pn=e=>/%$/.test(e),dn=e=>/^([1-9]|1[0-2])fg$/.test(e),O=e=>{if(e!=null)return dn(e)||pn(e)?e:ln(e)?`${e}px`:Object.keys(L).includes(e)?`var(${L[e]})`:e},L={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function Y(e,t=":host"){let r="",i=["default","xl","lg","md","sm"];for(let s of i){let n=Wr[s];if(!e[s]||Object.keys(e[s]).length===0)continue;s!=="default"&&(r+=`${n} {
29
+ `}s!=="default"&&(i+="}")}return i};function un(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var hn=e=>/%$/.test(e),fn=e=>/^([1-9]|1[0-2])fg$/.test(e),O=e=>{if(e!=null)return fn(e)||hn(e)?e:un(e)?`${e}px`:Object.keys(L).includes(e)?`var(${L[e]})`:e},L={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function Y(e,t=":host"){let r="",i=["default","xl","lg","md","sm"];for(let s of i){let n=Mr[s];if(!e[s]||Object.keys(e[s]).length===0)continue;s!=="default"&&(r+=`${n} {
30
30
  `);let o="";for(let[p,l]of Object.entries(e[s]))l!=null&&(o+=`${p}: ${l} !important;
31
31
  `);r+=`${t} {
32
32
  ${o.trim()}
33
33
  }
34
34
  `,s!=="default"&&(r+=`}
35
- `)}return r}var cn={mt:L,mr:L,mb:L,ml:L,m:L,mh:L,mv:L,s:{sm:`
35
+ `)}return r}var mn={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;
38
38
  padding-right: 12px;
@@ -81,7 +81,7 @@ var rettangoli=(()=>{var we=`
81
81
  `,lk:`
82
82
  background-color: transparent;
83
83
  color: var(--foreground);
84
- `}},Fr=G(cn,{},".surface");var un=[{prefix:"sm",maxWidth:640},{prefix:"md",maxWidth:768},{prefix:"lg",maxWidth:1024},{prefix:"xl",maxWidth:1280}],Lt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
84
+ `}},Kr=G(mn,{},".surface");var yn=[{prefix:"sm",maxWidth:640},{prefix:"md",maxWidth:768},{prefix:"lg",maxWidth:1024},{prefix:"xl",maxWidth:1280}],Lt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
85
85
  :host {
86
86
  display: inline-flex;
87
87
  }
@@ -252,8 +252,8 @@ var rettangoli=(()=>{var we=`
252
252
  color: inherit;
253
253
  }
254
254
 
255
- ${Fr}
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,r,i){this._updateButton()}_onWindowResize(){(this.hasAttribute("sm-s")||this.hasAttribute("md-s")||this.hasAttribute("lg-s")||this.hasAttribute("xl-s"))&&this._updateIcon()}_resolveResponsiveSizeToken(){let t=window.innerWidth;for(let{prefix:r,maxWidth:i}of un){let s=`${r}-s`;if(t<=i&&this.hasAttribute(s))return this.getAttribute(s)}return this.getAttribute("s")}_updateButton(){this.shadow.innerHTML="";let t=this.hasAttribute("disabled"),r=this.getAttribute("href"),i=this.hasAttribute("new-tab"),s=this.getAttribute("rel"),n=r&&!t,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?(ze({linkElement:this._surfaceElement,href:r,newTab:i,rel:s}),this._surfaceElement.removeAttribute("disabled")):(this._surfaceElement.removeAttribute("href"),this._surfaceElement.removeAttribute("target"),this._surfaceElement.removeAttribute("rel"),t?this._surfaceElement.setAttribute("disabled",""):this._surfaceElement.removeAttribute("disabled")),this.shadow.appendChild(this._surfaceElement),this._containerElement=this._surfaceElement}_updateIcon(){this._prefixIcon&&(this._prefixIcon.remove(),this._prefixIcon=null),this._suffixIcon&&(this._suffixIcon.remove(),this._suffixIcon=null);let t={sm:14,md:18,lg:22},r=this._resolveResponsiveSizeToken(),i=18;this.hasAttribute("sq")?i={sm:14,lg:22}[r]||18:i=t[r]||18;let s=this.getAttribute("pre");s&&(this._prefixIcon=document.createElement("rtgl-svg"),this._prefixIcon.setAttribute("svg",s),this._prefixIcon.setAttribute("wh",i.toString()),this._prefixIcon.style.color="inherit",this._surfaceElement.insertBefore(this._prefixIcon,this._slotElement));let n=this.getAttribute("suf");n&&(this._suffixIcon=document.createElement("rtgl-svg"),this._suffixIcon.setAttribute("svg",n),this._suffixIcon.setAttribute("wh",i.toString()),this._suffixIcon.style.color="inherit",this._surfaceElement.appendChild(this._suffixIcon))}_updateWidth(){let t=O(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()}},Mr=({render:e,html:t})=>Lt;var hn=({numerator:e,denominator:t,gapVar:r})=>e===t?"100%":e===1?`calc((100% - ((${t} - 1) * ${r})) / ${t})`:`calc(((100% - ((${t} - 1) * ${r})) * ${e}) / ${t})`,ot=({index:e,maxIndex:t})=>!Number.isFinite(e)||!Number.isFinite(t)||t<0?0:Math.min(Math.max(Math.trunc(e),0),t),Nt=({value:e,defaultValue:t=!1})=>{if(e==null)return t;let r=`${e}`.trim().toLowerCase();return r.length===0?!0:!(r==="false"||r==="0"||r==="no"||r==="off"||r==="none")},Vt=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"},Kr=({slideLeft:e,slideWidth:t,viewportWidth:r,scrollPaddingInlineStart:i=0,scrollPaddingInlineEnd:s=0,snapAlign:n="center",maxScrollLeft:o=Number.POSITIVE_INFINITY})=>{if(!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(r))return 0;let p=i,l=r-s,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)},Ur=({slideWidthCss:e,snapAlign:t="center"})=>`${t??""}`.trim().toLowerCase()!=="center"?"0px":`max(calc((100% - (${e&&`${e}`.trim().length>0?`${e}`.trim():"100%"})) / 2), 0px)`,Hr=({slideWidth:e,gapVar:t="var(--rtgl-carousel-gap, 0px)"})=>{if(e==null||`${e}`.trim()===""||e==="f")return"100%";let r=nt(`${e}`.trim());return r?hn({...r,gapVar:t}):O(`${e}`.trim())??"100%"};var fn=["a","button","input","select","textarea","label","summary","[contenteditable]"].join(", "),Rt=e=>{if(e==null)return null;let t=`${e}`.trim();return t.length>0?t:null},mn=e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,qr=e=>{let t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("viewBox","0 0 24 24"),r.setAttribute("aria-hidden","true"),r.setAttribute("focusable","false");let i=document.createElementNS(t,"path");return i.setAttribute("d",e==="left"?"M15 18 9 12l6-6":"M9 18l6-6-6-6"),i.setAttribute("fill","none"),i.setAttribute("stroke","currentColor"),i.setAttribute("stroke-width","2"),i.setAttribute("stroke-linecap","round"),i.setAttribute("stroke-linejoin","round"),r.appendChild(i),r},jt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
255
+ ${Kr}
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,r,i){this._updateButton()}_onWindowResize(){(this.hasAttribute("sm-s")||this.hasAttribute("md-s")||this.hasAttribute("lg-s")||this.hasAttribute("xl-s"))&&this._updateIcon()}_resolveResponsiveSizeToken(){let t=window.innerWidth;for(let{prefix:r,maxWidth:i}of yn){let s=`${r}-s`;if(t<=i&&this.hasAttribute(s))return this.getAttribute(s)}return this.getAttribute("s")}_updateButton(){this.shadow.innerHTML="";let t=this.hasAttribute("disabled"),r=this.getAttribute("href"),i=this.hasAttribute("new-tab"),s=this.getAttribute("rel"),n=r&&!t,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?(ze({linkElement:this._surfaceElement,href:r,newTab:i,rel:s}),this._surfaceElement.removeAttribute("disabled")):(this._surfaceElement.removeAttribute("href"),this._surfaceElement.removeAttribute("target"),this._surfaceElement.removeAttribute("rel"),t?this._surfaceElement.setAttribute("disabled",""):this._surfaceElement.removeAttribute("disabled")),this.shadow.appendChild(this._surfaceElement),this._containerElement=this._surfaceElement}_updateIcon(){this._prefixIcon&&(this._prefixIcon.remove(),this._prefixIcon=null),this._suffixIcon&&(this._suffixIcon.remove(),this._suffixIcon=null);let t={sm:14,md:18,lg:22},r=this._resolveResponsiveSizeToken(),i=18;this.hasAttribute("sq")?i={sm:14,lg:22}[r]||18:i=t[r]||18;let s=this.getAttribute("pre");s&&(this._prefixIcon=document.createElement("rtgl-svg"),this._prefixIcon.setAttribute("svg",s),this._prefixIcon.setAttribute("wh",i.toString()),this._prefixIcon.style.color="inherit",this._surfaceElement.insertBefore(this._prefixIcon,this._slotElement));let n=this.getAttribute("suf");n&&(this._suffixIcon=document.createElement("rtgl-svg"),this._suffixIcon.setAttribute("svg",n),this._suffixIcon.setAttribute("wh",i.toString()),this._suffixIcon.style.color="inherit",this._surfaceElement.appendChild(this._suffixIcon))}_updateWidth(){let t=O(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()}},Ur=({render:e,html:t})=>Lt;var gn=({numerator:e,denominator:t,gapVar:r})=>e===t?"100%":e===1?`calc((100% - ((${t} - 1) * ${r})) / ${t})`:`calc(((100% - ((${t} - 1) * ${r})) * ${e}) / ${t})`,ot=({index:e,maxIndex:t})=>!Number.isFinite(e)||!Number.isFinite(t)||t<0?0:Math.min(Math.max(Math.trunc(e),0),t),Nt=({value:e,defaultValue:t=!1})=>{if(e==null)return t;let r=`${e}`.trim().toLowerCase();return r.length===0?!0:!(r==="false"||r==="0"||r==="no"||r==="off"||r==="none")},Vt=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"},Hr=({slideLeft:e,slideWidth:t,viewportWidth:r,scrollPaddingInlineStart:i=0,scrollPaddingInlineEnd:s=0,snapAlign:n="center",maxScrollLeft:o=Number.POSITIVE_INFINITY})=>{if(!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(r))return 0;let p=i,l=r-s,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)},qr=({slideWidthCss:e,snapAlign:t="center"})=>`${t??""}`.trim().toLowerCase()!=="center"?"0px":`max(calc((100% - (${e&&`${e}`.trim().length>0?`${e}`.trim():"100%"})) / 2), 0px)`,Gr=({slideWidth:e,gapVar:t="var(--rtgl-carousel-gap, 0px)"})=>{if(e==null||`${e}`.trim()===""||e==="f")return"100%";let r=nt(`${e}`.trim());return r?gn({...r,gapVar:t}):O(`${e}`.trim())??"100%"};var bn=["a","button","input","select","textarea","label","summary","[contenteditable]"].join(", "),Rt=e=>{if(e==null)return null;let t=`${e}`.trim();return t.length>0?t:null},vn=e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,Yr=e=>{let t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("viewBox","0 0 24 24"),r.setAttribute("aria-hidden","true"),r.setAttribute("focusable","false");let i=document.createElementNS(t,"path");return i.setAttribute("d",e==="left"?"M15 18 9 12l6-6":"M9 18l6-6-6-6"),i.setAttribute("fill","none"),i.setAttribute("stroke","currentColor"),i.setAttribute("stroke-width","2"),i.setAttribute("stroke-linecap","round"),i.setAttribute("stroke-linejoin","round"),r.appendChild(i),r},jt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
257
257
  :host {
258
258
  display: block;
259
259
  width: 100%;
@@ -448,7 +448,7 @@ var rettangoli=(()=>{var we=`
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(qr("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(qr("right")),this._nextButton.setAttribute("part","nav-button next-button"),this._nextButton.setAttribute("aria-label","Next slide"),this._viewportShellElement.append(this._viewportElement,this._prevButton,this._nextButton),this._controlsElement.append(this._pagerElement),this._rootElement.append(this._viewportShellElement,this._controlsElement),this.shadow.append(this._rootElement),this._handleSlotChange=this._handleSlotChange.bind(this),this._handleClickPrev=this._handleClickPrev.bind(this),this._handleClickNext=this._handleClickNext.bind(this),this._handleViewportKeydown=this._handleViewportKeydown.bind(this),this._handleViewportScroll=this._handleViewportScroll.bind(this),this._handleViewportPointerDown=this._handleViewportPointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._handleViewportClickCapture=this._handleViewportClickCapture.bind(this),this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._resizeFrame!==null&&cancelAnimationFrame(this._resizeFrame),this._resizeFrame=requestAnimationFrame(()=>{this._resizeFrame=null,!(this._dragState?.dragging||!this._slides.length)&&this.goTo(this._currentIndex,{behavior:"auto"})})}):null}get index(){return this._currentIndex}set index(t){let r=Number(t);this.setAttribute("index",Number.isFinite(r)?`${r}`:"0")}get snap(){return Vt(this.getAttribute("snap"))!=="none"}set snap(t){if(t===!1||`${t}`.trim().toLowerCase()==="false"){this.setAttribute("snap","false");return}this.setAttribute("snap","true")}connectedCallback(){this._slotElement.addEventListener("slotchange",this._handleSlotChange),this._prevButton.addEventListener("click",this._handleClickPrev),this._nextButton.addEventListener("click",this._handleClickNext),this._viewportElement.addEventListener("keydown",this._handleViewportKeydown),this._viewportElement.addEventListener("scroll",this._handleViewportScroll,{passive:!0}),this._viewportElement.addEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.addEventListener("click",this._handleViewportClickCapture,!0),this._resizeObserver?.observe(this._viewportElement),this._syncSlides(),this._updateLayoutStyles();let t=this.hasAttribute("index")?Number(this.getAttribute("index")):0;this.goTo(t,{behavior:"auto"})}disconnectedCallback(){this._slotElement.removeEventListener("slotchange",this._handleSlotChange),this._prevButton.removeEventListener("click",this._handleClickPrev),this._nextButton.removeEventListener("click",this._handleClickNext),this._viewportElement.removeEventListener("keydown",this._handleViewportKeydown),this._viewportElement.removeEventListener("scroll",this._handleViewportScroll),this._viewportElement.removeEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.removeEventListener("click",this._handleViewportClickCapture,!0),this._removePointerListeners(),this._resizeObserver?.disconnect(),this._scrollFrame!==null&&(cancelAnimationFrame(this._scrollFrame),this._scrollFrame=null),this._resizeFrame!==null&&(cancelAnimationFrame(this._resizeFrame),this._resizeFrame=null),this._cancelScrollAnimation(),this._setDraggingState(!1),this._slides.forEach(t=>{this._restoreSlideStyles(t),t.removeAttribute("data-rtgl-carousel-active")})}attributeChangedCallback(t,r,i){if(r!==i){if(t==="index"){if(this._isReflectingIndex){this._isReflectingIndex=!1;return}this.goTo(Number(i),{behavior:"smooth"});return}if(t==="nav"||t==="pager"){this._updateControls();return}this._updateLayoutStyles()}}next(){this.goTo(this._currentIndex+1)}prev(){this.goTo(this._currentIndex-1)}_showsNavControls(){return Nt({value:this.getAttribute("nav"),defaultValue:!0})}_showsPagerControls(){return Nt({value:this.getAttribute("pager"),defaultValue:!1})}goTo(t,r={}){if(!this._slides.length){this._setCurrentIndex(0,{emit:!1,reflect:!0});return}let i=ot({index:Number(t),maxIndex:this._slides.length-1}),s=this._slides[i],n=r.behavior??"smooth";s&&(this._scrollViewportTo(this._getSlideTargetScrollLeft(s),{behavior:n}),this._setCurrentIndex(i))}_handleSlotChange(){this._syncSlides(),this._updateLayoutStyles(),this.goTo(this._currentIndex,{behavior:"auto"})}_handleClickPrev(){this.prev()}_handleClickNext(){this.next()}_handleViewportKeydown(t){t.key==="ArrowRight"?(t.preventDefault(),this.next()):t.key==="ArrowLeft"&&(t.preventDefault(),this.prev())}_handleViewportScroll(){this._scrollAnimationFrame===null&&(this._dragState?.dragging||this._requestSyncFromScroll())}_handleViewportPointerDown(t){t.pointerType==="mouse"&&(t.button!==0||!this._slides.length||this._eventTargetsInteractiveElement(t)||(this._cancelScrollAnimation(),this._dragState={pointerId:t.pointerId,startX:t.clientX,startScrollLeft:this._viewportElement.scrollLeft,dragging:!1},this._viewportElement.setPointerCapture(t.pointerId),this._viewportElement.addEventListener("pointermove",this._handlePointerMove),this._viewportElement.addEventListener("pointerup",this._handlePointerUp),this._viewportElement.addEventListener("pointercancel",this._handlePointerUp)))}_handlePointerMove(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let r=t.clientX-this._dragState.startX;!this._dragState.dragging&&Math.abs(r)>6&&(this._dragState.dragging=!0,this._setDraggingState(!0)),this._dragState.dragging&&(t.preventDefault(),this._viewportElement.scrollLeft=this._dragState.startScrollLeft-r)}_handlePointerUp(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let r=this._dragState.dragging,i=r?this._findNearestSlideIndex():this._currentIndex;this._viewportElement.hasPointerCapture(t.pointerId)&&this._viewportElement.releasePointerCapture(t.pointerId),this._dragState=null,this._setDraggingState(!1),this._removePointerListeners(),r&&(this._clickSuppressUntil=performance.now()+250,this.snap?this.goTo(i,{behavior:"smooth"}):this._requestSyncFromScroll())}_handleViewportClickCapture(t){performance.now()<this._clickSuppressUntil&&(t.preventDefault(),t.stopPropagation())}_removePointerListeners(){this._viewportElement.removeEventListener("pointermove",this._handlePointerMove),this._viewportElement.removeEventListener("pointerup",this._handlePointerUp),this._viewportElement.removeEventListener("pointercancel",this._handlePointerUp)}_eventTargetsInteractiveElement(t){return t.composedPath().some(r=>r instanceof Element&&r.matches(fn))}_requestSyncFromScroll(){this._scrollFrame!==null&&cancelAnimationFrame(this._scrollFrame),this._scrollFrame=requestAnimationFrame(()=>{this._scrollFrame=null;let t=this._findNearestSlideIndex();this._setCurrentIndex(t)})}_findNearestSlideIndex(){if(!this._slides.length)return 0;let t=this._viewportElement.scrollLeft,r=this._currentIndex,i=Number.POSITIVE_INFINITY;return this._slides.forEach((s,n)=>{let o=Math.abs(this._getSlideTargetScrollLeft(s)-t);o<i&&(r=n,i=o)}),r}_syncSlides(){let t=new Set(this._slides),r=this._slotElement.assignedElements({flatten:!0}).filter(i=>!i.hasAttribute("hidden"));t.forEach(i=>{r.includes(i)||(this._restoreSlideStyles(i),i.removeAttribute("data-rtgl-carousel-active"))}),this._slides=r,this._slides.forEach(i=>{this._slideStyleCache.has(i)||this._slideStyleCache.set(i,{flex:i.style.flex,width:i.style.width,minWidth:i.style.minWidth,maxWidth:i.style.maxWidth,boxSizing:i.style.boxSizing,scrollSnapAlign:i.style.scrollSnapAlign,scrollSnapStop:i.style.scrollSnapStop})}),this._buildPager(),this._setCurrentIndex(ot({index:this._currentIndex,maxIndex:this._slides.length-1}),{emit:!1,reflect:!0})}_restoreSlideStyles(t){let r=this._slideStyleCache.get(t);r&&(t.style.flex=r.flex,t.style.width=r.width,t.style.minWidth=r.minWidth,t.style.maxWidth=r.maxWidth,t.style.boxSizing=r.boxSizing,t.style.scrollSnapAlign=r.scrollSnapAlign,t.style.scrollSnapStop=r.scrollSnapStop)}_updateLayoutStyles(){let t=Hr({slideWidth:this.getAttribute("sw")}),r=Rt(this.getAttribute("sna"))??"center",i=Vt(this.getAttribute("snap")),s=O(this.getAttribute("g"))??"var(--spacing-md)",n=O(this.getAttribute("spi"))??"0px",o=Rt(this.getAttribute("sbh"))??"smooth",p=Ur({slideWidthCss:t,snapAlign:r});this.style.setProperty("--rtgl-carousel-slide-width",t),this.style.setProperty("--rtgl-carousel-gap",s),this.style.setProperty("--rtgl-carousel-scroll-snap-type",i),this.style.setProperty("--rtgl-carousel-scroll-padding-inline",n),this.style.setProperty("--rtgl-carousel-edge-padding-inline",p),this.style.setProperty("--rtgl-carousel-scroll-behavior",o),this.style.setProperty("--rtgl-carousel-snap-align",r),this._slides.forEach(l=>{l.style.flex=`0 0 ${t}`,l.style.width=t,l.style.minWidth="0",l.style.maxWidth="unset",l.style.boxSizing="border-box",l.style.scrollSnapAlign=r,l.style.scrollSnapStop="always"})}_setDraggingState(t){if(t){this.setAttribute("dragging",""),this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this.removeAttribute("dragging"),this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior=""}_scrollViewportTo(t,r={}){let i=r.behavior??"smooth",s=Math.min(Math.max(t,0),Math.max(this._viewportElement.scrollWidth-this._viewportElement.clientWidth,0));if(i!=="smooth"||Math.abs(s-this._viewportElement.scrollLeft)<1){this._cancelScrollAnimation(),this._viewportElement.scrollLeft=s;return}this._cancelScrollAnimation();let n=this._viewportElement.scrollLeft,o=s-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=mn(h);if(this._viewportElement.scrollLeft=n+o*f,h<1){this._scrollAnimationFrame=requestAnimationFrame(a);return}this._viewportElement.scrollLeft=s,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,r)=>{let i=document.createElement("button");i.type="button",i.setAttribute("part","pager-button"),i.setAttribute("aria-label",`Go to slide ${r+1}`),i.setAttribute("title",`Go to slide ${r+1}`),i.addEventListener("click",()=>{this.goTo(r)}),this._pagerElement.appendChild(i),this._pagerButtons.push(i)}),this._updateControls()}_updateControls(){let t=this._slides.length>0,r=this._slides.length>1,i=this._currentIndex<=0,s=this._currentIndex>=this._slides.length-1,n=r&&this._showsNavControls(),o=r&&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||s,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,r={}){let i=ot({index:t,maxIndex:this._slides.length-1}),s=r.emit??!0,n=r.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}`)),s&&o!==i&&this.dispatchEvent(new CustomEvent("index-change",{detail:{index:i},bubbles:!0}))}_resolveScrollInlinePosition(){let t=Rt(this.getAttribute("sna"))??"center";return t==="start"||t==="end"||t==="center"?t:"center"}_getSlideTargetScrollLeft(t){let r=this._viewportElement.getBoundingClientRect(),i=t.getBoundingClientRect();if(r.width<=0||i.width<=0)return this._viewportElement.scrollLeft;let s=getComputedStyle(this._viewportElement),n=this._viewportElement.scrollLeft,o=i.left-r.left+n;return Kr({slideLeft:o,slideWidth:i.width,viewportWidth:r.width,scrollPaddingInlineStart:this._parsePx(s.scrollPaddingInlineStart),scrollPaddingInlineEnd:this._parsePx(s.scrollPaddingInlineEnd),snapAlign:this._resolveScrollInlinePosition(),maxScrollLeft:this._viewportElement.scrollWidth-this._viewportElement.clientWidth})}_parsePx(t){let r=Number.parseFloat(t);return Number.isFinite(r)?r:0}_setAnimatingScrollState(t){if(t){this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this._dragState?.dragging||(this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior="")}},Gr=()=>jt;var yn={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out"}},j=G(yn);var at=T`
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(Yr("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(Yr("right")),this._nextButton.setAttribute("part","nav-button next-button"),this._nextButton.setAttribute("aria-label","Next slide"),this._viewportShellElement.append(this._viewportElement,this._prevButton,this._nextButton),this._controlsElement.append(this._pagerElement),this._rootElement.append(this._viewportShellElement,this._controlsElement),this.shadow.append(this._rootElement),this._handleSlotChange=this._handleSlotChange.bind(this),this._handleClickPrev=this._handleClickPrev.bind(this),this._handleClickNext=this._handleClickNext.bind(this),this._handleViewportKeydown=this._handleViewportKeydown.bind(this),this._handleViewportScroll=this._handleViewportScroll.bind(this),this._handleViewportPointerDown=this._handleViewportPointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._handleViewportClickCapture=this._handleViewportClickCapture.bind(this),this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._resizeFrame!==null&&cancelAnimationFrame(this._resizeFrame),this._resizeFrame=requestAnimationFrame(()=>{this._resizeFrame=null,!(this._dragState?.dragging||!this._slides.length)&&this.goTo(this._currentIndex,{behavior:"auto"})})}):null}get index(){return this._currentIndex}set index(t){let r=Number(t);this.setAttribute("index",Number.isFinite(r)?`${r}`:"0")}get snap(){return Vt(this.getAttribute("snap"))!=="none"}set snap(t){if(t===!1||`${t}`.trim().toLowerCase()==="false"){this.setAttribute("snap","false");return}this.setAttribute("snap","true")}connectedCallback(){this._slotElement.addEventListener("slotchange",this._handleSlotChange),this._prevButton.addEventListener("click",this._handleClickPrev),this._nextButton.addEventListener("click",this._handleClickNext),this._viewportElement.addEventListener("keydown",this._handleViewportKeydown),this._viewportElement.addEventListener("scroll",this._handleViewportScroll,{passive:!0}),this._viewportElement.addEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.addEventListener("click",this._handleViewportClickCapture,!0),this._resizeObserver?.observe(this._viewportElement),this._syncSlides(),this._updateLayoutStyles();let t=this.hasAttribute("index")?Number(this.getAttribute("index")):0;this.goTo(t,{behavior:"auto"})}disconnectedCallback(){this._slotElement.removeEventListener("slotchange",this._handleSlotChange),this._prevButton.removeEventListener("click",this._handleClickPrev),this._nextButton.removeEventListener("click",this._handleClickNext),this._viewportElement.removeEventListener("keydown",this._handleViewportKeydown),this._viewportElement.removeEventListener("scroll",this._handleViewportScroll),this._viewportElement.removeEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.removeEventListener("click",this._handleViewportClickCapture,!0),this._removePointerListeners(),this._resizeObserver?.disconnect(),this._scrollFrame!==null&&(cancelAnimationFrame(this._scrollFrame),this._scrollFrame=null),this._resizeFrame!==null&&(cancelAnimationFrame(this._resizeFrame),this._resizeFrame=null),this._cancelScrollAnimation(),this._setDraggingState(!1),this._slides.forEach(t=>{this._restoreSlideStyles(t),t.removeAttribute("data-rtgl-carousel-active")})}attributeChangedCallback(t,r,i){if(r!==i){if(t==="index"){if(this._isReflectingIndex){this._isReflectingIndex=!1;return}this.goTo(Number(i),{behavior:"smooth"});return}if(t==="nav"||t==="pager"){this._updateControls();return}this._updateLayoutStyles()}}next(){this.goTo(this._currentIndex+1)}prev(){this.goTo(this._currentIndex-1)}_showsNavControls(){return Nt({value:this.getAttribute("nav"),defaultValue:!0})}_showsPagerControls(){return Nt({value:this.getAttribute("pager"),defaultValue:!1})}goTo(t,r={}){if(!this._slides.length){this._setCurrentIndex(0,{emit:!1,reflect:!0});return}let i=ot({index:Number(t),maxIndex:this._slides.length-1}),s=this._slides[i],n=r.behavior??"smooth";s&&(this._scrollViewportTo(this._getSlideTargetScrollLeft(s),{behavior:n}),this._setCurrentIndex(i))}_handleSlotChange(){this._syncSlides(),this._updateLayoutStyles(),this.goTo(this._currentIndex,{behavior:"auto"})}_handleClickPrev(){this.prev()}_handleClickNext(){this.next()}_handleViewportKeydown(t){t.key==="ArrowRight"?(t.preventDefault(),this.next()):t.key==="ArrowLeft"&&(t.preventDefault(),this.prev())}_handleViewportScroll(){this._scrollAnimationFrame===null&&(this._dragState?.dragging||this._requestSyncFromScroll())}_handleViewportPointerDown(t){t.pointerType==="mouse"&&(t.button!==0||!this._slides.length||this._eventTargetsInteractiveElement(t)||(this._cancelScrollAnimation(),this._dragState={pointerId:t.pointerId,startX:t.clientX,startScrollLeft:this._viewportElement.scrollLeft,dragging:!1},this._viewportElement.setPointerCapture(t.pointerId),this._viewportElement.addEventListener("pointermove",this._handlePointerMove),this._viewportElement.addEventListener("pointerup",this._handlePointerUp),this._viewportElement.addEventListener("pointercancel",this._handlePointerUp)))}_handlePointerMove(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let r=t.clientX-this._dragState.startX;!this._dragState.dragging&&Math.abs(r)>6&&(this._dragState.dragging=!0,this._setDraggingState(!0)),this._dragState.dragging&&(t.preventDefault(),this._viewportElement.scrollLeft=this._dragState.startScrollLeft-r)}_handlePointerUp(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let r=this._dragState.dragging,i=r?this._findNearestSlideIndex():this._currentIndex;this._viewportElement.hasPointerCapture(t.pointerId)&&this._viewportElement.releasePointerCapture(t.pointerId),this._dragState=null,this._setDraggingState(!1),this._removePointerListeners(),r&&(this._clickSuppressUntil=performance.now()+250,this.snap?this.goTo(i,{behavior:"smooth"}):this._requestSyncFromScroll())}_handleViewportClickCapture(t){performance.now()<this._clickSuppressUntil&&(t.preventDefault(),t.stopPropagation())}_removePointerListeners(){this._viewportElement.removeEventListener("pointermove",this._handlePointerMove),this._viewportElement.removeEventListener("pointerup",this._handlePointerUp),this._viewportElement.removeEventListener("pointercancel",this._handlePointerUp)}_eventTargetsInteractiveElement(t){return t.composedPath().some(r=>r instanceof Element&&r.matches(bn))}_requestSyncFromScroll(){this._scrollFrame!==null&&cancelAnimationFrame(this._scrollFrame),this._scrollFrame=requestAnimationFrame(()=>{this._scrollFrame=null;let t=this._findNearestSlideIndex();this._setCurrentIndex(t)})}_findNearestSlideIndex(){if(!this._slides.length)return 0;let t=this._viewportElement.scrollLeft,r=this._currentIndex,i=Number.POSITIVE_INFINITY;return this._slides.forEach((s,n)=>{let o=Math.abs(this._getSlideTargetScrollLeft(s)-t);o<i&&(r=n,i=o)}),r}_syncSlides(){let t=new Set(this._slides),r=this._slotElement.assignedElements({flatten:!0}).filter(i=>!i.hasAttribute("hidden"));t.forEach(i=>{r.includes(i)||(this._restoreSlideStyles(i),i.removeAttribute("data-rtgl-carousel-active"))}),this._slides=r,this._slides.forEach(i=>{this._slideStyleCache.has(i)||this._slideStyleCache.set(i,{flex:i.style.flex,width:i.style.width,minWidth:i.style.minWidth,maxWidth:i.style.maxWidth,boxSizing:i.style.boxSizing,scrollSnapAlign:i.style.scrollSnapAlign,scrollSnapStop:i.style.scrollSnapStop})}),this._buildPager(),this._setCurrentIndex(ot({index:this._currentIndex,maxIndex:this._slides.length-1}),{emit:!1,reflect:!0})}_restoreSlideStyles(t){let r=this._slideStyleCache.get(t);r&&(t.style.flex=r.flex,t.style.width=r.width,t.style.minWidth=r.minWidth,t.style.maxWidth=r.maxWidth,t.style.boxSizing=r.boxSizing,t.style.scrollSnapAlign=r.scrollSnapAlign,t.style.scrollSnapStop=r.scrollSnapStop)}_updateLayoutStyles(){let t=Gr({slideWidth:this.getAttribute("sw")}),r=Rt(this.getAttribute("sna"))??"center",i=Vt(this.getAttribute("snap")),s=O(this.getAttribute("g"))??"var(--spacing-md)",n=O(this.getAttribute("spi"))??"0px",o=Rt(this.getAttribute("sbh"))??"smooth",p=qr({slideWidthCss:t,snapAlign:r});this.style.setProperty("--rtgl-carousel-slide-width",t),this.style.setProperty("--rtgl-carousel-gap",s),this.style.setProperty("--rtgl-carousel-scroll-snap-type",i),this.style.setProperty("--rtgl-carousel-scroll-padding-inline",n),this.style.setProperty("--rtgl-carousel-edge-padding-inline",p),this.style.setProperty("--rtgl-carousel-scroll-behavior",o),this.style.setProperty("--rtgl-carousel-snap-align",r),this._slides.forEach(l=>{l.style.flex=`0 0 ${t}`,l.style.width=t,l.style.minWidth="0",l.style.maxWidth="unset",l.style.boxSizing="border-box",l.style.scrollSnapAlign=r,l.style.scrollSnapStop="always"})}_setDraggingState(t){if(t){this.setAttribute("dragging",""),this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this.removeAttribute("dragging"),this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior=""}_scrollViewportTo(t,r={}){let i=r.behavior??"smooth",s=Math.min(Math.max(t,0),Math.max(this._viewportElement.scrollWidth-this._viewportElement.clientWidth,0));if(i!=="smooth"||Math.abs(s-this._viewportElement.scrollLeft)<1){this._cancelScrollAnimation(),this._viewportElement.scrollLeft=s;return}this._cancelScrollAnimation();let n=this._viewportElement.scrollLeft,o=s-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=vn(h);if(this._viewportElement.scrollLeft=n+o*f,h<1){this._scrollAnimationFrame=requestAnimationFrame(a);return}this._viewportElement.scrollLeft=s,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,r)=>{let i=document.createElement("button");i.type="button",i.setAttribute("part","pager-button"),i.setAttribute("aria-label",`Go to slide ${r+1}`),i.setAttribute("title",`Go to slide ${r+1}`),i.addEventListener("click",()=>{this.goTo(r)}),this._pagerElement.appendChild(i),this._pagerButtons.push(i)}),this._updateControls()}_updateControls(){let t=this._slides.length>0,r=this._slides.length>1,i=this._currentIndex<=0,s=this._currentIndex>=this._slides.length-1,n=r&&this._showsNavControls(),o=r&&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||s,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,r={}){let i=ot({index:t,maxIndex:this._slides.length-1}),s=r.emit??!0,n=r.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}`)),s&&o!==i&&this.dispatchEvent(new CustomEvent("index-change",{detail:{index:i},bubbles:!0}))}_resolveScrollInlinePosition(){let t=Rt(this.getAttribute("sna"))??"center";return t==="start"||t==="end"||t==="center"?t:"center"}_getSlideTargetScrollLeft(t){let r=this._viewportElement.getBoundingClientRect(),i=t.getBoundingClientRect();if(r.width<=0||i.width<=0)return this._viewportElement.scrollLeft;let s=getComputedStyle(this._viewportElement),n=this._viewportElement.scrollLeft,o=i.left-r.left+n;return Hr({slideLeft:o,slideWidth:i.width,viewportWidth:r.width,scrollPaddingInlineStart:this._parsePx(s.scrollPaddingInlineStart),scrollPaddingInlineEnd:this._parsePx(s.scrollPaddingInlineEnd),snapAlign:this._resolveScrollInlinePosition(),maxScrollLeft:this._viewportElement.scrollWidth-this._viewportElement.clientWidth})}_parsePx(t){let r=Number.parseFloat(t);return Number.isFinite(r)?r:0}_setAnimatingScrollState(t){if(t){this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this._dragState?.dragging||(this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior="")}},Jr=()=>jt;var wn={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out"}},j=G(wn);var at=T`
452
452
  :host([sh]:not([sv])) {
453
453
  overflow-x: auto;
454
454
  flex-wrap: nowrap;
@@ -528,7 +528,7 @@ var rettangoli=(()=>{var we=`
528
528
  }
529
529
  }
530
530
 
531
- `;var Me={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},gn={bgc:{pr:`
531
+ `;var Me={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},_n={bgc:{pr:`
532
532
  background-color: var(--primary);
533
533
  `,se:`
534
534
  background-color: var(--secondary);
@@ -568,7 +568,7 @@ var rettangoli=(()=>{var we=`
568
568
  left: 0;
569
569
  top: 0;
570
570
  height: 100%;
571
- `},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:Me,bwt:Me,bwr:Me,bwb:Me,bwl:Me,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},lt=G(gn);var bn={mt:L,mr:L,mb:L,ml:L,m:L,mh:L,mv:L},W=G(bn);var Oe=T`
571
+ `},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:Me,bwt:Me,bwr:Me,bwb:Me,bwl:Me,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},lt=G(_n);var xn={mt:L,mr:L,mb:L,ml:L,m:L,mh:L,mv:L},W=G(xn);var Oe=T`
572
572
  a, a:link, a:visited, a:hover, a:active {
573
573
  color: inherit;
574
574
  text-decoration: none;
@@ -578,7 +578,7 @@ var rettangoli=(()=>{var we=`
578
578
  margin: 0;
579
579
  font: inherit;
580
580
  }
581
- `;var vn=e=>{if(e==null)return null;let t=e.trim();return t===""?null:/^[1-9]\d*$/.test(t)?`repeat(${t}, minmax(0, 1fr))`:t},Dt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
581
+ `;var Sn=e=>{if(e==null)return null;let t=e.trim();return t===""?null:/^[1-9]\d*$/.test(t)?`repeat(${t}, minmax(0, 1fr))`:t},Dt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
582
582
  slot {
583
583
  display: contents;
584
584
  }
@@ -598,7 +598,7 @@ var rettangoli=(()=>{var we=`
598
598
  ${lt}
599
599
  ${Oe}
600
600
  ${we}
601
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...q([...ae,"cols","op","wh","w","h","hide","show","sh","sv","z","overflow"])]}_styles=F();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=_e({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:r,rel:i})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=F(),te.forEach(r=>{let i=f=>`${r==="default"?"":`${r}-`}${f}`,s=this.getAttribute(i("wh")),n=O(s===null?this.getAttribute(i("w")):s),o=O(s===null?this.getAttribute(i("h")):s),p=vn(this.getAttribute(i("cols"))),l=this.getAttribute(i("op")),a=this.getAttribute(i("z"));p!==null&&(this._styles[r]["grid-template-columns"]=p),a!==null&&(this._styles[r]["z-index"]=a),l!==null&&(this._styles[r].opacity=l),M({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),M({styleBucket:this._styles[r],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="grid");let c=this.hasAttribute(i("sh")),d=this.hasAttribute(i("sv")),h=this.getAttribute(i("overflow"));c&&d?(this._styles[r].overflow="auto",this._styles[r]["scrollbar-gutter"]="stable"):c?(this._styles[r]["overflow-x"]="auto",this._styles[r]["scrollbar-gutter"]="stable"):d&&(this._styles[r]["overflow-y"]="auto",this._styles[r]["scrollbar-gutter"]="stable"),h==="hidden"&&(this._styles[r].overflow="hidden")});let t=Y(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,r,i){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}r!==i&&this.updateStyles()}},Yr=({render:e,html:t})=>Dt;var Jr=T`
601
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...q([...ae,"cols","op","wh","w","h","hide","show","sh","sv","z","overflow"])]}_styles=F();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=_e({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:r,rel:i})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=F(),te.forEach(r=>{let i=f=>`${r==="default"?"":`${r}-`}${f}`,s=this.getAttribute(i("wh")),n=O(s===null?this.getAttribute(i("w")):s),o=O(s===null?this.getAttribute(i("h")):s),p=Sn(this.getAttribute(i("cols"))),l=this.getAttribute(i("op")),a=this.getAttribute(i("z"));p!==null&&(this._styles[r]["grid-template-columns"]=p),a!==null&&(this._styles[r]["z-index"]=a),l!==null&&(this._styles[r].opacity=l),M({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),M({styleBucket:this._styles[r],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="grid");let c=this.hasAttribute(i("sh")),d=this.hasAttribute(i("sv")),h=this.getAttribute(i("overflow"));c&&d?(this._styles[r].overflow="auto",this._styles[r]["scrollbar-gutter"]="stable"):c?(this._styles[r]["overflow-x"]="auto",this._styles[r]["scrollbar-gutter"]="stable"):d&&(this._styles[r]["overflow-y"]="auto",this._styles[r]["scrollbar-gutter"]="stable"),h==="hidden"&&(this._styles[r].overflow="hidden")});let t=Y(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,r,i){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}r!==i&&this.updateStyles()}},Zr=({render:e,html:t})=>Dt;var Xr=T`
602
602
 
603
603
  :host([d="h"]) {
604
604
  flex-direction: row;
@@ -686,13 +686,13 @@ var rettangoli=(()=>{var we=`
686
686
 
687
687
 
688
688
  ${at}
689
- ${Jr}
689
+ ${Xr}
690
690
  ${W}
691
691
  ${j}
692
692
  ${lt}
693
693
  ${Oe}
694
694
  ${we}
695
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...q([...ae,"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"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=_e({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:r,rel:i})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=F(),te.forEach(r=>{let i=z=>`${r==="default"?"":`${r}-`}${z}`,s=this.getAttribute(i("wh")),n=O(s===null?this.getAttribute(i("w")):s),o=O(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z")),a=Fe(this.getAttribute(i("ar"))),c=pt(this.getAttribute(i("bgi"))),d=pt(this.getAttribute(i("bgs"))),h=pt(this.getAttribute(i("bgp"))),f=pt(this.getAttribute(i("bgr")));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),a!==void 0&&(this._styles[r]["aspect-ratio"]=a),c!==null&&(this._styles[r]["background-image"]=c),d!==null&&(this._styles[r]["background-size"]=d),h!==null&&(this._styles[r]["background-position"]=h),f!==null&&(this._styles[r]["background-repeat"]=f),M({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),M({styleBucket:this._styles[r],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="flex");let u=this.getAttribute(i("d")),m=this.getAttribute(i("ah")),y=this.getAttribute(i("av")),b=Ot({element:this,size:r,attr:"d"});u==="h"?this._styles[r]["flex-direction"]="row":u==="v"?this._styles[r]["flex-direction"]="column":r==="default"&&!u&&["sm","md","lg","xl"].some(B=>this.hasAttribute(`${B}-d`))&&(this._styles[r]["flex-direction"]="column");let g=b==="h",_=b==="v"||!b;g&&(m==="c"?this._styles[r]["justify-content"]="center":m==="e"?this._styles[r]["justify-content"]="flex-end":m==="s"&&(this._styles[r]["justify-content"]="flex-start"),y==="c"?(this._styles[r]["align-items"]="center",this._styles[r]["align-content"]="center"):y==="e"?(this._styles[r]["align-items"]="flex-end",this._styles[r]["align-content"]="flex-end"):y==="s"&&(this._styles[r]["align-items"]="flex-start")),_&&(m!==null||y!==null)&&(m==="c"?this._styles[r]["align-items"]="center":m==="e"?this._styles[r]["align-items"]="flex-end":m==="s"&&(this._styles[r]["align-items"]="flex-start"),y==="c"?this._styles[r]["justify-content"]="center":y==="e"?this._styles[r]["justify-content"]="flex-end":y==="s"&&(this._styles[r]["justify-content"]="flex-start"));let S=this.hasAttribute(i("wrap")),A=this.hasAttribute(i("no-wrap"));S&&(this._styles[r]["flex-wrap"]="wrap"),A&&(this._styles[r]["flex-wrap"]="nowrap"),this.hasAttribute(i("stretch"))&&(this._styles[r]["align-self"]="stretch");let E=this.hasAttribute(i("sh")),C=this.hasAttribute(i("sv")),I=this.hasAttribute(i("hsb")),N=this.getAttribute(i("overflow"));E&&C?(this._styles[r].overflow="auto",this._styles[r]["scrollbar-gutter"]="stable",this._styles[r]["flex-wrap"]="nowrap"):E?(this._styles[r]["overflow-x"]="auto",this._styles[r]["scrollbar-gutter"]="stable",this._styles[r]["flex-wrap"]="nowrap"):C&&(this._styles[r]["overflow-y"]="auto",this._styles[r]["scrollbar-gutter"]="stable",this._styles[r]["flex-wrap"]="nowrap"),N==="hidden"&&(this._styles[r].overflow="hidden",this._styles[r]["flex-wrap"]="nowrap"),I&&(this._styles[r]["-ms-overflow-style"]="none",this._styles[r]["scrollbar-gutter"]="auto",this._styles[r]["scrollbar-width"]="none")});let t=Y(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,r,i){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}r!==i&&this.updateStyles()}},Zr=({render:e,html:t})=>Pt;var wn={ta:{s:"text-align: start;",c:"text-align: center;",e:"text-align: end;",j:"text-align: justify;"},s:{h1:`
695
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...q([...ae,"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"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=_e({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:r,rel:i})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=F(),te.forEach(r=>{let i=z=>`${r==="default"?"":`${r}-`}${z}`,s=this.getAttribute(i("wh")),n=O(s===null?this.getAttribute(i("w")):s),o=O(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z")),a=Fe(this.getAttribute(i("ar"))),c=pt(this.getAttribute(i("bgi"))),d=pt(this.getAttribute(i("bgs"))),h=pt(this.getAttribute(i("bgp"))),f=pt(this.getAttribute(i("bgr")));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),a!==void 0&&(this._styles[r]["aspect-ratio"]=a),c!==null&&(this._styles[r]["background-image"]=c),d!==null&&(this._styles[r]["background-size"]=d),h!==null&&(this._styles[r]["background-position"]=h),f!==null&&(this._styles[r]["background-repeat"]=f),M({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),M({styleBucket:this._styles[r],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="flex");let u=this.getAttribute(i("d")),m=this.getAttribute(i("ah")),y=this.getAttribute(i("av")),b=Ot({element:this,size:r,attr:"d"});u==="h"?this._styles[r]["flex-direction"]="row":u==="v"?this._styles[r]["flex-direction"]="column":r==="default"&&!u&&["sm","md","lg","xl"].some(B=>this.hasAttribute(`${B}-d`))&&(this._styles[r]["flex-direction"]="column");let g=b==="h",_=b==="v"||!b;g&&(m==="c"?this._styles[r]["justify-content"]="center":m==="e"?this._styles[r]["justify-content"]="flex-end":m==="s"&&(this._styles[r]["justify-content"]="flex-start"),y==="c"?(this._styles[r]["align-items"]="center",this._styles[r]["align-content"]="center"):y==="e"?(this._styles[r]["align-items"]="flex-end",this._styles[r]["align-content"]="flex-end"):y==="s"&&(this._styles[r]["align-items"]="flex-start")),_&&(m!==null||y!==null)&&(m==="c"?this._styles[r]["align-items"]="center":m==="e"?this._styles[r]["align-items"]="flex-end":m==="s"&&(this._styles[r]["align-items"]="flex-start"),y==="c"?this._styles[r]["justify-content"]="center":y==="e"?this._styles[r]["justify-content"]="flex-end":y==="s"&&(this._styles[r]["justify-content"]="flex-start"));let S=this.hasAttribute(i("wrap")),A=this.hasAttribute(i("no-wrap"));S&&(this._styles[r]["flex-wrap"]="wrap"),A&&(this._styles[r]["flex-wrap"]="nowrap"),this.hasAttribute(i("stretch"))&&(this._styles[r]["align-self"]="stretch");let E=this.hasAttribute(i("sh")),C=this.hasAttribute(i("sv")),I=this.hasAttribute(i("hsb")),N=this.getAttribute(i("overflow"));E&&C?(this._styles[r].overflow="auto",this._styles[r]["scrollbar-gutter"]="stable",this._styles[r]["flex-wrap"]="nowrap"):E?(this._styles[r]["overflow-x"]="auto",this._styles[r]["scrollbar-gutter"]="stable",this._styles[r]["flex-wrap"]="nowrap"):C&&(this._styles[r]["overflow-y"]="auto",this._styles[r]["scrollbar-gutter"]="stable",this._styles[r]["flex-wrap"]="nowrap"),N==="hidden"&&(this._styles[r].overflow="hidden",this._styles[r]["flex-wrap"]="nowrap"),I&&(this._styles[r]["-ms-overflow-style"]="none",this._styles[r]["scrollbar-gutter"]="auto",this._styles[r]["scrollbar-width"]="none")});let t=Y(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,r,i){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}r!==i&&this.updateStyles()}},Qr=({render:e,html:t})=>Pt;var An={ta:{s:"text-align: start;",c:"text-align: center;",e:"text-align: end;",j:"text-align: justify;"},s:{h1:`
696
696
  font-size: var(--h1-font-size);
697
697
  font-weight: var(--h1-font-weight);
698
698
  line-height: var(--h1-line-height);
@@ -732,7 +732,7 @@ var rettangoli=(()=>{var we=`
732
732
  font-weight: var(--xs-font-weight);
733
733
  line-height: var(--xs-line-height);
734
734
  letter-spacing: var(--xs-letter-spacing);
735
- `}},Xr=G(wn);var _n={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);"}},dt=G(_n);var Bt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
735
+ `}},ei=G(An);var En={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);"}},dt=G(En);var Bt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
736
736
  :host {
737
737
  display: block;
738
738
  font-size: var(--md-font-size);
@@ -752,11 +752,11 @@ var rettangoli=(()=>{var we=`
752
752
  color: var(--anchor-color-hover);
753
753
  }
754
754
  ${we}
755
- ${Xr}
755
+ ${ei}
756
756
  ${dt}
757
757
  ${W}
758
758
  ${j}
759
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","new-tab","rel"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,r,i){t==="href"||t==="new-tab"||t==="rel"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=O(this.getAttribute("w"));this.hasAttribute("ellipsis")?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace=""),We({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=_e({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:r,rel:i})}},Qr=({render:e,html:t})=>Bt;var Ke={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},xn={bgc:{pr:"background-color: var(--primary);",se:"background-color: var(--secondary);",de:"background-color: var(--destructive);",fg:"background-color: var(--foreground);",bg:"background-color: var(--background);",mu:"background-color: var(--muted);",ac:"background-color: var(--accent);",bo:"background-color: var(--border);"},pos:{rel:"relative",abs:"absolute",fix:"fixed"},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},bw:Ke,bwt:Ke,bwr:Ke,bwb:Ke,bwl:Ke,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},ei=e=>G(xn,{},e);var Sn={mt:L,mr:L,mb:L,ml:L,m:L,mh:L,mv:L},ti=e=>G(Sn,{},e);var zt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
759
+ `))}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,r,i){t==="href"||t==="new-tab"||t==="rel"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=O(this.getAttribute("w")),r=this.hasAttribute("ellipsis"),i=this.hasAttribute("break-long-tokens");r?(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":""),We({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=_e({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:r,rel:i})}},ti=({render:e,html:t})=>Bt;var Ke={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},kn={bgc:{pr:"background-color: var(--primary);",se:"background-color: var(--secondary);",de:"background-color: var(--destructive);",fg:"background-color: var(--foreground);",bg:"background-color: var(--background);",mu:"background-color: var(--muted);",ac:"background-color: var(--accent);",bo:"background-color: var(--border);"},pos:{rel:"relative",abs:"absolute",fix:"fixed"},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},bw:Ke,bwt:Ke,bwr:Ke,bwb:Ke,bwl:Ke,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},ri=e=>G(kn,{},e);var $n={mt:L,mr:L,mb:L,ml:L,m:L,mh:L,mv:L},ii=e=>G($n,{},e);var zt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
760
760
  :host {
761
761
  display: contents;
762
762
  }
@@ -791,10 +791,10 @@ var rettangoli=(()=>{var we=`
791
791
  width: 100%;
792
792
  }
793
793
 
794
- ${ei("img, a")}
795
- ${ti("img, a")}
794
+ ${ri("img, a")}
795
+ ${ii("img, a")}
796
796
  ${j}
797
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return q([...ae,"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"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=It({shadowRoot:this.shadow,childElement:this._imgElement,linkElement:this._linkElement,href:t,newTab:r,rel:i})}connectedCallback(){this._updateImageAttributes(),this.updateStyles()}attributeChangedCallback(t,r,i){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}if(t==="src"||t==="alt"){this._updateImageAttributes();return}r!==i&&this.updateStyles()}updateStyles(){this._styles=F(),te.forEach(r=>{let i=c=>`${r==="default"?"":`${r}-`}${c}`,s=this.getAttribute(i("wh")),n=O(s===null?this.getAttribute(i("w")):s),o=O(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z")),a=Fe(this.getAttribute(i("ar")));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),a!==void 0&&(this._styles[r]["aspect-ratio"]=a),M({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),M({styleBucket:this._styles[r],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none !important"),this.hasAttribute(i("show"))&&(this._styles[r].display="block !important")});let t=Y(this._styles,"img, a");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_updateImageAttributes(){let t=this.getAttribute("src"),r=this.getAttribute("alt");t!==null?this._imgElement.setAttribute("src",t):this._imgElement.removeAttribute("src"),r!==null?this._imgElement.setAttribute("alt",r):this._imgElement.removeAttribute("alt")}},ri=({render:e,html:t})=>zt;var An={s:{sm:`
797
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return q([...ae,"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"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=It({shadowRoot:this.shadow,childElement:this._imgElement,linkElement:this._linkElement,href:t,newTab:r,rel:i})}connectedCallback(){this._updateImageAttributes(),this.updateStyles()}attributeChangedCallback(t,r,i){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}if(t==="src"||t==="alt"){this._updateImageAttributes();return}r!==i&&this.updateStyles()}updateStyles(){this._styles=F(),te.forEach(r=>{let i=c=>`${r==="default"?"":`${r}-`}${c}`,s=this.getAttribute(i("wh")),n=O(s===null?this.getAttribute(i("w")):s),o=O(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z")),a=Fe(this.getAttribute(i("ar")));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),a!==void 0&&(this._styles[r]["aspect-ratio"]=a),M({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),M({styleBucket:this._styles[r],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none !important"),this.hasAttribute(i("show"))&&(this._styles[r].display="block !important")});let t=Y(this._styles,"img, a");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_updateImageAttributes(){let t=this.getAttribute("src"),r=this.getAttribute("alt");t!==null?this._imgElement.setAttribute("src",t):this._imgElement.removeAttribute("src"),r!==null?this._imgElement.setAttribute("alt",r):this._imgElement.removeAttribute("alt")}},si=({render:e,html:t})=>zt;var Cn={s:{sm:`
798
798
  height: 20px;
799
799
  padding-left: 8px;
800
800
  padding-right: 8px;
@@ -847,7 +847,7 @@ var rettangoli=(()=>{var we=`
847
847
  background-color: var(--destructive);
848
848
  color: var(--destructive-foreground);
849
849
  border-color: transparent;
850
- `}},ii=G(An,{},".surface");var Wt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
850
+ `}},ni=G(Cn,{},".surface");var Wt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
851
851
  :host {
852
852
  display: inline-flex;
853
853
  min-width: 0;
@@ -943,13 +943,13 @@ var rettangoli=(()=>{var we=`
943
943
  opacity: 1;
944
944
  }
945
945
 
946
- ${ii}
946
+ ${ni}
947
947
  :host .surface {
948
948
  border-radius: var(--tag-border-radius) !important;
949
949
  }
950
950
  ${W}
951
951
  ${j}
952
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._surfaceElement=document.createElement("span"),this._surfaceElement.className="surface",this._surfaceElement.setAttribute("part","surface"),this._labelElement=document.createElement("span"),this._labelElement.className="label",this._labelElement.setAttribute("part","label"),this._slotElement=document.createElement("slot"),this._labelElement.appendChild(this._slotElement),this._surfaceElement.appendChild(this._labelElement),this.shadow.appendChild(this._surfaceElement),this._prefixIcon=null,this._suffixIcon=null,this._removeButton=null,this._onRemoveClick=this._onRemoveClick.bind(this)}static get observedAttributes(){return["key","pre","suf","removable","w"]}connectedCallback(){this._updateWidth(),this._updateStructure()}attributeChangedCallback(t,r,i){if(t==="w"){this._updateWidth();return}r!==i&&this._updateStructure()}_updateWidth(){let t=O(this.getAttribute("w"));We({style:this.style,width:t,flexMinWidth:"0"})}_createIconElement(t,r){let i=document.createElement("rtgl-svg");return i.className=t,i.setAttribute("part",r),i.setAttribute("aria-hidden","true"),i}_syncIcon({iconName:t,element:r,className:i,part:s,insertBeforeElement:n}){if(!t)return r&&r.remove(),null;let o=r||this._createIconElement(i,s);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}))}},si=({render:e,html:t})=>Wt;var ni=T`
952
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._surfaceElement=document.createElement("span"),this._surfaceElement.className="surface",this._surfaceElement.setAttribute("part","surface"),this._labelElement=document.createElement("span"),this._labelElement.className="label",this._labelElement.setAttribute("part","label"),this._slotElement=document.createElement("slot"),this._labelElement.appendChild(this._slotElement),this._surfaceElement.appendChild(this._labelElement),this.shadow.appendChild(this._surfaceElement),this._prefixIcon=null,this._suffixIcon=null,this._removeButton=null,this._onRemoveClick=this._onRemoveClick.bind(this)}static get observedAttributes(){return["key","pre","suf","removable","w"]}connectedCallback(){this._updateWidth(),this._updateStructure()}attributeChangedCallback(t,r,i){if(t==="w"){this._updateWidth();return}r!==i&&this._updateStructure()}_updateWidth(){let t=O(this.getAttribute("w"));We({style:this.style,width:t,flexMinWidth:"0"})}_createIconElement(t,r){let i=document.createElement("rtgl-svg");return i.className=t,i.setAttribute("part",r),i.setAttribute("aria-hidden","true"),i}_syncIcon({iconName:t,element:r,className:i,part:s,insertBeforeElement:n}){if(!t)return r&&r.remove(),null;let o=r||this._createIconElement(i,s);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}))}},oi=({render:e,html:t})=>Wt;var ai=T`
953
953
  :host([pt="xs"]) svg {
954
954
  padding-top: var(--spacing-xs);
955
955
  }
@@ -1071,10 +1071,10 @@ var rettangoli=(()=>{var we=`
1071
1071
  flex-shrink: 0;
1072
1072
  }
1073
1073
  ${dt}
1074
- ${ni}
1074
+ ${ai}
1075
1075
  ${W}
1076
1076
  ${j}
1077
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return e._icons}static addIcon(t,r){e._icons[t]=r}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,r,i){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),r=O(t===null?this.getAttribute("w"):t),i=O(t===null?this.getAttribute("h"):t);r!=null?this.style.width=r:this.style.width="",i!=null?this.style.height=i:this.style.height=""}_render(){try{let t=this.getAttribute("svg"),r=e._icons[t]||(window.rtglIcons||{})[t];if(r){this.shadow.innerHTML=r;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},oi=({render:e,html:t})=>Ft;var En=["mt","mr","mb","ml","m","mh","mv","cur"],Mt=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(T`
1077
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return e._icons}static addIcon(t,r){e._icons[t]=r}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,r,i){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),r=O(t===null?this.getAttribute("w"):t),i=O(t===null?this.getAttribute("h"):t);r!=null?this.style.width=r:this.style.width="",i!=null?this.style.height=i:this.style.height=""}_render(){try{let t=this.getAttribute("svg"),r=e._icons[t]||(window.rtglIcons||{})[t];if(r){this.shadow.innerHTML=r;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},li=({render:e,html:t})=>Ft;var In=["mt","mr","mb","ml","m","mh","mv","cur"],Mt=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(T`
1078
1078
  :host {
1079
1079
  display: contents;
1080
1080
  }
@@ -1138,7 +1138,7 @@ var rettangoli=(()=>{var we=`
1138
1138
  }
1139
1139
  ${W}
1140
1140
  ${j}
1141
- `))}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",...q([...En,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,r,i){if(r!==i){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(e.inputSpecificAttributes.includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=F(),te.forEach(r=>{let i=a=>`${r==="default"?"":`${r}-`}${a}`,s=this.getAttribute(i("wh")),n=O(s===null?this.getAttribute(i("w")):s),o=O(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),M({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),M({styleBucket:this._styles[r],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="block")});let t=Y(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,r){if(r==null||r==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,r)}_syncValueAttribute(){this._inputElement.value=this.getAttribute("value")??""}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("type"),i=new Set(["text","password","date","time","datetime-local"]).has(t)?t:"text",s=this.getAttribute("min"),n=this.getAttribute("max"),o=this.getAttribute("step"),p=this.hasAttribute("disabled");this._setOrRemoveInputAttribute("type",i),this._setOrRemoveInputAttribute("min",s),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()}},ge=({render:e,html:t})=>Mt;var kn=ge({}),Ue="date",Kt=class extends kn{connectedCallback(){this.getAttribute("type")!==Ue&&super.setAttribute("type",Ue),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,r,i){if(t==="type"&&i!==Ue){this.getAttribute("type")!==Ue&&super.setAttribute("type",Ue);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,r,i)}},ai=({render:e,html:t})=>Kt;var $n=ge({}),He="time",Ut=class extends $n{connectedCallback(){this.getAttribute("type")!==He&&super.setAttribute("type",He),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,r,i){if(t==="type"&&i!==He){this.getAttribute("type")!==He&&super.setAttribute("type",He);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,r,i)}},li=({render:e,html:t})=>Ut;var Cn=ge({}),qe="datetime-local",Ht=class extends Cn{connectedCallback(){this.getAttribute("type")!==qe&&super.setAttribute("type",qe),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,r,i){if(t==="type"&&i!==qe){this.getAttribute("type")!==qe&&super.setAttribute("type",qe);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,r,i)}},pi=({render:e,html:t})=>Ht;var In=["mt","mr","mb","ml","m","mh","mv","cur"],qt=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(T`
1141
+ `))}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",...q([...In,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,r,i){if(r!==i){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(e.inputSpecificAttributes.includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=F(),te.forEach(r=>{let i=a=>`${r==="default"?"":`${r}-`}${a}`,s=this.getAttribute(i("wh")),n=O(s===null?this.getAttribute(i("w")):s),o=O(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),M({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),M({styleBucket:this._styles[r],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="block")});let t=Y(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,r){if(r==null||r==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,r)}_syncValueAttribute(){this._inputElement.value=this.getAttribute("value")??""}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("type"),i=new Set(["text","password","date","time","datetime-local"]).has(t)?t:"text",s=this.getAttribute("min"),n=this.getAttribute("max"),o=this.getAttribute("step"),p=this.hasAttribute("disabled");this._setOrRemoveInputAttribute("type",i),this._setOrRemoveInputAttribute("min",s),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()}},ge=({render:e,html:t})=>Mt;var On=ge({}),Ue="date",Kt=class extends On{connectedCallback(){this.getAttribute("type")!==Ue&&super.setAttribute("type",Ue),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,r,i){if(t==="type"&&i!==Ue){this.getAttribute("type")!==Ue&&super.setAttribute("type",Ue);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,r,i)}},pi=({render:e,html:t})=>Kt;var Tn=ge({}),He="time",Ut=class extends Tn{connectedCallback(){this.getAttribute("type")!==He&&super.setAttribute("type",He),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,r,i){if(t==="type"&&i!==He){this.getAttribute("type")!==He&&super.setAttribute("type",He);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,r,i)}},di=({render:e,html:t})=>Ut;var Ln=ge({}),qe="datetime-local",Ht=class extends Ln{connectedCallback(){this.getAttribute("type")!==qe&&super.setAttribute("type",qe),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,r,i){if(t==="type"&&i!==qe){this.getAttribute("type")!==qe&&super.setAttribute("type",qe);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,r,i)}},ci=({render:e,html:t})=>Ht;var Nn=["mt","mr","mb","ml","m","mh","mv","cur"],qt=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(T`
1142
1142
  :host {
1143
1143
  display: contents;
1144
1144
  }
@@ -1173,7 +1173,7 @@ var rettangoli=(()=>{var we=`
1173
1173
  }
1174
1174
  ${W}
1175
1175
  ${j}
1176
- `))}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",...q([...In,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_emitValueEvent=t=>{let r=this._inputElement.value;if(r.trim()===""){this.dispatchEvent(new CustomEvent(t,{detail:{value:null},bubbles:!0}));return}let i=parseFloat(r);isNaN(i)||(i=this._clampValueToBounds(i),this._inputElement.value=i.toString(),this.dispatchEvent(new CustomEvent(t,{detail:{value:i},bubbles:!0})))};_onInput=()=>{this._emitValueEvent("value-input")};_onChange=()=>{this._emitValueEvent("value-change")};attributeChangedCallback(t,r,i){if(r!==i){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(e.inputSpecificAttributes.includes(t)){this._updateInputAttributes(),(t==="min"||t==="max")&&this._syncValueAttribute();return}this.updateStyles()}}updateStyles(){this._styles=F(),te.forEach(r=>{let i=a=>`${r==="default"?"":`${r}-`}${a}`,s=this.getAttribute(i("wh")),n=O(s===null?this.getAttribute(i("w")):s),o=O(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),M({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),M({styleBucket:this._styles[r],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="block")});let t=Y(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,r){if(r==null||r==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,r)}_clampValueToBounds(t){let r=t,i=this.getAttribute("min");if(i!==null){let n=parseFloat(i);isNaN(n)||(r=Math.max(r,n))}let s=this.getAttribute("max");if(s!==null){let n=parseFloat(s);isNaN(n)||(r=Math.min(r,n))}return r}_syncValueAttribute(){let t=this.getAttribute("value");if(t==null||t===""){this._inputElement.value="";return}let r=parseFloat(t);if(isNaN(r)){this._inputElement.value="";return}let i=this._clampValueToBounds(r);this._inputElement.value=i.toString()}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("step"),r=this.getAttribute("min"),i=this.getAttribute("max"),s=this.hasAttribute("disabled");this._inputElement.setAttribute("type","number"),this._setOrRemoveInputAttribute("step",t),this._setOrRemoveInputAttribute("min",r),this._setOrRemoveInputAttribute("max",i),s?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},di=({render:e,html:t})=>qt;var Gt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
1176
+ `))}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",...q([...Nn,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_emitValueEvent=t=>{let r=this._inputElement.value;if(r.trim()===""){this.dispatchEvent(new CustomEvent(t,{detail:{value:null},bubbles:!0}));return}let i=parseFloat(r);isNaN(i)||(i=this._clampValueToBounds(i),this._inputElement.value=i.toString(),this.dispatchEvent(new CustomEvent(t,{detail:{value:i},bubbles:!0})))};_onInput=()=>{this._emitValueEvent("value-input")};_onChange=()=>{this._emitValueEvent("value-change")};attributeChangedCallback(t,r,i){if(r!==i){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(e.inputSpecificAttributes.includes(t)){this._updateInputAttributes(),(t==="min"||t==="max")&&this._syncValueAttribute();return}this.updateStyles()}}updateStyles(){this._styles=F(),te.forEach(r=>{let i=a=>`${r==="default"?"":`${r}-`}${a}`,s=this.getAttribute(i("wh")),n=O(s===null?this.getAttribute(i("w")):s),o=O(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),M({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),M({styleBucket:this._styles[r],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="block")});let t=Y(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,r){if(r==null||r==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,r)}_clampValueToBounds(t){let r=t,i=this.getAttribute("min");if(i!==null){let n=parseFloat(i);isNaN(n)||(r=Math.max(r,n))}let s=this.getAttribute("max");if(s!==null){let n=parseFloat(s);isNaN(n)||(r=Math.min(r,n))}return r}_syncValueAttribute(){let t=this.getAttribute("value");if(t==null||t===""){this._inputElement.value="";return}let r=parseFloat(t);if(isNaN(r)){this._inputElement.value="";return}let i=this._clampValueToBounds(r);this._inputElement.value=i.toString()}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("step"),r=this.getAttribute("min"),i=this.getAttribute("max"),s=this.hasAttribute("disabled");this._inputElement.setAttribute("type","number"),this._setOrRemoveInputAttribute("step",t),this._setOrRemoveInputAttribute("min",r),this._setOrRemoveInputAttribute("max",i),s?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},ui=({render:e,html:t})=>qt;var Gt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
1177
1177
  :host {
1178
1178
  display: contents;
1179
1179
  }
@@ -1201,7 +1201,7 @@ var rettangoli=(()=>{var we=`
1201
1201
  }
1202
1202
  ${W}
1203
1203
  ${j}
1204
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._textareaElement=document.createElement("textarea"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onInput),this._textareaElement.addEventListener("change",this._onChange)}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._textareaElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._textareaElement.value},bubbles:!0}))};static get observedAttributes(){return["key","placeholder","disabled","value","cols","rows",...q([...ae,"wh","w","h","hide","show","op","z"])]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}focus(){this._textareaElement&&this._textareaElement.focus()}select(){this._textareaElement&&this._textareaElement.select()}attributeChangedCallback(t,r,i){if(t==="key"){requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""});return}if(t==="value"&&requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""}),t==="placeholder"&&requestAnimationFrame(()=>{let n=this.getAttribute("placeholder");n===void 0||n==="null"?this._textareaElement.removeAttribute("placeholder"):this._textareaElement.setAttribute("placeholder",n??"")}),["cols","rows","disabled"].includes(t)){this._updateTextareaAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let o=h=>`${n==="default"?"":`${n}-`}${h}`,p=this.getAttribute(o("wh")),l=O(p===null?this.getAttribute(o("w")):p),a=O(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 s=Y(this._styles,"textarea");s!==this._lastStyleString&&(this._styleElement.textContent=s,this._lastStyleString=s)}_updateTextareaAttributes(){let t=this.getAttribute("cols"),r=this.getAttribute("rows"),i=this.hasAttribute("disabled");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),r!==null?this._textareaElement.setAttribute("rows",r):this._textareaElement.removeAttribute("rows"),i?this._textareaElement.setAttribute("disabled",""):this._textareaElement.removeAttribute("disabled")}},ci=({render:e,html:t})=>Gt;var On=["mt","mr","mb","ml","m","mh","mv","cur"],Tn=/^#[0-9a-fA-F]{6}$/,Yt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
1204
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._textareaElement=document.createElement("textarea"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onInput),this._textareaElement.addEventListener("change",this._onChange)}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._textareaElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._textareaElement.value},bubbles:!0}))};static get observedAttributes(){return["key","placeholder","disabled","value","cols","rows",...q([...ae,"wh","w","h","hide","show","op","z"])]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}focus(){this._textareaElement&&this._textareaElement.focus()}select(){this._textareaElement&&this._textareaElement.select()}attributeChangedCallback(t,r,i){if(t==="key"){requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""});return}if(t==="value"&&requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""}),t==="placeholder"&&requestAnimationFrame(()=>{let n=this.getAttribute("placeholder");n===void 0||n==="null"?this._textareaElement.removeAttribute("placeholder"):this._textareaElement.setAttribute("placeholder",n??"")}),["cols","rows","disabled"].includes(t)){this._updateTextareaAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let o=h=>`${n==="default"?"":`${n}-`}${h}`,p=this.getAttribute(o("wh")),l=O(p===null?this.getAttribute(o("w")):p),a=O(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 s=Y(this._styles,"textarea");s!==this._lastStyleString&&(this._styleElement.textContent=s,this._lastStyleString=s)}_updateTextareaAttributes(){let t=this.getAttribute("cols"),r=this.getAttribute("rows"),i=this.hasAttribute("disabled");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),r!==null?this._textareaElement.setAttribute("rows",r):this._textareaElement.removeAttribute("rows"),i?this._textareaElement.setAttribute("disabled",""):this._textareaElement.removeAttribute("disabled")}},hi=({render:e,html:t})=>Gt;var Vn=["mt","mr","mb","ml","m","mh","mv","cur"],Rn=/^#[0-9a-fA-F]{6}$/,Yt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
1205
1205
  :host {
1206
1206
  display: contents;
1207
1207
  }
@@ -1224,7 +1224,7 @@ var rettangoli=(()=>{var we=`
1224
1224
  }
1225
1225
  ${W}
1226
1226
  ${j}
1227
- `))}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",...q([...On,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,r,i){if(r!==i){if(t==="key"){this._syncValueAttribute();return}if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=F(),te.forEach(r=>{let i=a=>`${r==="default"?"":`${r}-`}${a}`,s=this.getAttribute(i("wh")),n=O(s===null?this.getAttribute(i("w")):s),o=O(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),M({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),M({styleBucket:this._styles[r],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="block")});let t=Y(this._styles,'input[type="color"]');t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_syncValueAttribute(){let t=this.getAttribute("value");if(t===null){this._inputElement.value="#000000";return}this._inputElement.value=Tn.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()}},ui=({render:e,html:t})=>Yt;var Jt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
1227
+ `))}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",...q([...Vn,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,r,i){if(r!==i){if(t==="key"){this._syncValueAttribute();return}if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=F(),te.forEach(r=>{let i=a=>`${r==="default"?"":`${r}-`}${a}`,s=this.getAttribute(i("wh")),n=O(s===null?this.getAttribute(i("w")):s),o=O(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),M({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),M({styleBucket:this._styles[r],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="block")});let t=Y(this._styles,'input[type="color"]');t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_syncValueAttribute(){let t=this.getAttribute("value");if(t===null){this._inputElement.value="#000000";return}this._inputElement.value=Rn.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()}},fi=({render:e,html:t})=>Yt;var Jt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
1228
1228
  :host {
1229
1229
  display: contents;
1230
1230
  }
@@ -1278,7 +1278,7 @@ var rettangoli=(()=>{var we=`
1278
1278
  }
1279
1279
  ${W}
1280
1280
  ${j}
1281
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",...q([...ae,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};attributeChangedCallback(t,r,i){if(t==="key"&&r!==i){requestAnimationFrame(()=>{let n=this.getAttribute("value"),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=O(p===null?this.getAttribute(o("w")):p),a=O(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 s=Y(this._styles,'input[type="range"]');s!==this._lastStyleString&&(this._styleElement.textContent=s,this._lastStyleString=s)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.getAttribute("min"),i=this.getAttribute("max"),s=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null?this._inputElement.value=t:this._inputElement.value=r??0,r!==null?this._inputElement.min=r:this._inputElement.min="0",i!==null?this._inputElement.max=i:this._inputElement.max="100",s!==null?this._inputElement.step=s:this._inputElement.step="1",n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},hi=({render:e,html:t})=>Jt;var Zt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
1281
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",...q([...ae,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};attributeChangedCallback(t,r,i){if(t==="key"&&r!==i){requestAnimationFrame(()=>{let n=this.getAttribute("value"),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=O(p===null?this.getAttribute(o("w")):p),a=O(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 s=Y(this._styles,'input[type="range"]');s!==this._lastStyleString&&(this._styleElement.textContent=s,this._lastStyleString=s)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.getAttribute("min"),i=this.getAttribute("max"),s=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null?this._inputElement.value=t:this._inputElement.value=r??0,r!==null?this._inputElement.min=r:this._inputElement.min="0",i!==null?this._inputElement.max=i:this._inputElement.max="100",s!==null?this._inputElement.step=s:this._inputElement.step="1",n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},mi=({render:e,html:t})=>Jt;var Zt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
1282
1282
  :host {
1283
1283
  display: inline-flex;
1284
1284
  }
@@ -1347,7 +1347,7 @@ var rettangoli=(()=>{var we=`
1347
1347
  }
1348
1348
  ${W}
1349
1349
  ${j}
1350
- `))}constructor(){super(),this._isSyncingLabelState=!1,e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="checkbox",this._wrapperElement=document.createElement("label"),this._wrapperElement.className="checkbox-wrapper",this._labelElement=document.createElement("span"),this._labelElement.className="checkbox-label",this._labelSlotElement=document.createElement("slot"),this._labelSlotElement.addEventListener("slotchange",()=>{this._updateLabelState()}),this._labelElement.appendChild(this._labelSlotElement),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this._wrapperElement.appendChild(this._inputElement),this._wrapperElement.appendChild(this._labelElement),this.shadow.appendChild(this._wrapperElement),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","checked","disabled","label",...q([...ae,"wh","w","h","hide","show","op","z"])]}get checked(){return this._inputElement.checked}set checked(t){this._inputElement.checked=!!t}get value(){return this._inputElement.checked}set value(t){this._inputElement.checked=!!t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.checked},bubbles:!0}))};attributeChangedCallback(t,r,i){if(t==="key"&&r!==i){requestAnimationFrame(()=>{let n=this.hasAttribute("checked");this._inputElement.checked=n});return}if(t==="checked"){this._inputElement.checked=i!==null;return}if(t==="disabled"){i!==null?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled");return}if(t==="label"){this._updateLabelState();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let o=h=>`${n==="default"?"":`${n}-`}${h}`,p=this.getAttribute(o("wh")),l=O(p===null?this.getAttribute(o("w")):p),a=O(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 s=Y(this._styles,'input[type="checkbox"]');s!==this._lastStyleString&&(this._styleElement.textContent=s,this._lastStyleString=s)}connectedCallback(){let t=this.hasAttribute("checked");this._inputElement.checked=t,this.hasAttribute("disabled")&&this._inputElement.setAttribute("disabled",""),this._updateLabelState()}_updateLabelState(){if(!this._isSyncingLabelState){this._isSyncingLabelState=!0;try{let t=this.getAttribute("label"),r=t??"";this._labelSlotElement.textContent!==r&&(this._labelSlotElement.textContent=r);let s=this._labelSlotElement.assignedNodes({flatten:!0}).some(p=>p.nodeType===Node.TEXT_NODE?p.textContent.trim().length>0:p.nodeType===Node.ELEMENT_NODE),n=typeof t=="string"&&t.trim().length>0,o=s||n;o&&!this.hasAttribute("has-label")?this.setAttribute("has-label",""):!o&&this.hasAttribute("has-label")&&this.removeAttribute("has-label")}finally{this._isSyncingLabelState=!1}}}},fi=({render:e,html:t})=>Zt;var Xt=40,Ln=6,Qt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
1350
+ `))}constructor(){super(),this._isSyncingLabelState=!1,e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="checkbox",this._wrapperElement=document.createElement("label"),this._wrapperElement.className="checkbox-wrapper",this._labelElement=document.createElement("span"),this._labelElement.className="checkbox-label",this._labelSlotElement=document.createElement("slot"),this._labelSlotElement.addEventListener("slotchange",()=>{this._updateLabelState()}),this._labelElement.appendChild(this._labelSlotElement),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this._wrapperElement.appendChild(this._inputElement),this._wrapperElement.appendChild(this._labelElement),this.shadow.appendChild(this._wrapperElement),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","checked","disabled","label",...q([...ae,"wh","w","h","hide","show","op","z"])]}get checked(){return this._inputElement.checked}set checked(t){this._inputElement.checked=!!t}get value(){return this._inputElement.checked}set value(t){this._inputElement.checked=!!t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.checked},bubbles:!0}))};attributeChangedCallback(t,r,i){if(t==="key"&&r!==i){requestAnimationFrame(()=>{let n=this.hasAttribute("checked");this._inputElement.checked=n});return}if(t==="checked"){this._inputElement.checked=i!==null;return}if(t==="disabled"){i!==null?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled");return}if(t==="label"){this._updateLabelState();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let o=h=>`${n==="default"?"":`${n}-`}${h}`,p=this.getAttribute(o("wh")),l=O(p===null?this.getAttribute(o("w")):p),a=O(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 s=Y(this._styles,'input[type="checkbox"]');s!==this._lastStyleString&&(this._styleElement.textContent=s,this._lastStyleString=s)}connectedCallback(){let t=this.hasAttribute("checked");this._inputElement.checked=t,this.hasAttribute("disabled")&&this._inputElement.setAttribute("disabled",""),this._updateLabelState()}_updateLabelState(){if(!this._isSyncingLabelState){this._isSyncingLabelState=!0;try{let t=this.getAttribute("label"),r=t??"";this._labelSlotElement.textContent!==r&&(this._labelSlotElement.textContent=r);let s=this._labelSlotElement.assignedNodes({flatten:!0}).some(p=>p.nodeType===Node.TEXT_NODE?p.textContent.trim().length>0:p.nodeType===Node.ELEMENT_NODE),n=typeof t=="string"&&t.trim().length>0,o=s||n;o&&!this.hasAttribute("has-label")?this.setAttribute("has-label",""):!o&&this.hasAttribute("has-label")&&this.removeAttribute("has-label")}finally{this._isSyncingLabelState=!1}}}},yi=({render:e,html:t})=>Zt;var Xt=40,jn=6,Qt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
1351
1351
  :host {
1352
1352
  display: contents;
1353
1353
  }
@@ -1424,7 +1424,7 @@ var rettangoli=(()=>{var we=`
1424
1424
  animation: none;
1425
1425
  }
1426
1426
  }
1427
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._adaptiveFrameId=null,this._layoutRetryCount=0,this._observedContentElement=null,this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._scheduleAdaptiveCentering()}):null,this._onSlotChange=()=>{this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0})},this._onWindowResize=()=>{this._scheduleAdaptiveCentering({resetRetries:!0})},this._mouseDownInContent=!1,this._dialogElement.addEventListener("mousedown",t=>{this._mouseDownInContent=t.target!==this._dialogElement}),this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&this._attemptClose(),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&(t.preventDefault(),this._attemptClose()),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._attemptClose()})}_attemptClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}disconnectedCallback(){this._isConnected=!1,this._stopAdaptiveObservers(),this._slotElement&&this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,r,i){t==="open"?i!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():i===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._slotElement.addEventListener("slotchange",this._onSlotChange),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0,window.addEventListener("resize",this._onWindowResize),this._observeAssignedContent(),this._layoutRetryCount=0,this._applyAdaptiveCentering())}_hideModal(){this._dialogElement.open&&(this._stopAdaptiveObservers(),this._dialogElement.close(),this._slotElement&&(this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.removeChild(this._slotElement),this._slotElement=null),this._dialogElement.style.height="")}_stopAdaptiveObservers(){this._adaptiveFrameId!==null&&(cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=null),this._layoutRetryCount=0,window.removeEventListener("resize",this._onWindowResize),this._resizeObserver&&this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=null}_getAssignedContentElement(){if(!this._slotElement)return null;let t=this._slotElement.assignedElements({flatten:!0});return t.length>0?t[0]:null}_observeAssignedContent(){if(!this._resizeObserver)return;let t=this._getAssignedContentElement();this._observedContentElement!==t&&(this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=t,this._observedContentElement&&this._resizeObserver.observe(this._observedContentElement))}_scheduleAdaptiveCentering({resetRetries:t=!1}={}){!this._slotElement||!this._dialogElement.open||(t&&(this._layoutRetryCount=0),this._adaptiveFrameId!==null&&cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=null,this._applyAdaptiveCentering()})}))}_applyAdaptiveCentering(){if(!this._slotElement||!this._dialogElement.open)return;this._observeAssignedContent();let t=this._getAssignedContentElement(),r=t?Math.round(t.getBoundingClientRect().height):0;if(r<=0){this._layoutRetryCount<Ln&&(this._layoutRetryCount+=1,this._scheduleAdaptiveCentering());return}this._layoutRetryCount=0;let i=window.innerHeight;if(r>=i-2*Xt){this._slotElement.style.marginTop=`${Xt}px`,this._slotElement.style.marginBottom=`${Xt}px`,this._dialogElement.style.height="100vh";return}let s=i-r,n=Math.floor(s/2);this._slotElement.style.marginTop=`${n}px`,this._slotElement.style.marginBottom=`${n}px`,this._dialogElement.style.height="auto"}get dialog(){return this._dialogElement}},mi=({render:e,html:t})=>Qt;var yi="data-rtgl-popover-content",er="min-width: 200px; max-width: 400px; box-sizing: border-box;",tr=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
1427
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._adaptiveFrameId=null,this._layoutRetryCount=0,this._observedContentElement=null,this._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._scheduleAdaptiveCentering({resetRetries:!0})},this._mouseDownInContent=!1,this._dialogElement.addEventListener("mousedown",t=>{this._mouseDownInContent=t.target!==this._dialogElement}),this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&this._attemptClose(),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&(t.preventDefault(),this._attemptClose()),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._attemptClose()})}_attemptClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}disconnectedCallback(){this._isConnected=!1,this._clearManagedLongTokenWrapping(),this._stopAdaptiveObservers(),this._slotElement&&this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,r,i){t==="open"?i!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():i===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_clearManagedLongTokenWrapping(){for(let t of this._managedLongTokenTextElements)t?.isConnected&&t.removeAttribute("break-long-tokens");this._managedLongTokenTextElements.clear()}_collectTextElements(t,r){if(!(!t||t.nodeType!==Node.ELEMENT_NODE)){t.localName==="rtgl-text"&&r.push(t);for(let i of t.children)this._collectTextElements(i,r);if(t.shadowRoot)for(let i of t.shadowRoot.children)this._collectTextElements(i,r)}}_syncLongTokenWrapping(){if(this._clearManagedLongTokenWrapping(),!this._slotElement)return;let t=this._slotElement.assignedNodes({flatten:!0}),r=[];for(let i of t)this._collectTextElements(i,r);for(let i of r)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._dialogElement.showModal(),this._dialogElement.scrollTop=0,window.addEventListener("resize",this._onWindowResize),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._dialogElement.style.height="")}_stopAdaptiveObservers(){this._adaptiveFrameId!==null&&(cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=null),this._layoutRetryCount=0,window.removeEventListener("resize",this._onWindowResize),this._resizeObserver&&this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._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()})}))}_applyAdaptiveCentering(){if(!this._slotElement||!this._dialogElement.open)return;this._observeAssignedContent();let t=this._getAssignedContentElement(),r=t?Math.round(t.getBoundingClientRect().height):0;if(r<=0){this._layoutRetryCount<jn&&(this._layoutRetryCount+=1,this._scheduleAdaptiveCentering());return}this._layoutRetryCount=0;let i=window.innerHeight;if(r>=i-2*Xt){this._slotElement.style.marginTop=`${Xt}px`,this._slotElement.style.marginBottom=`${Xt}px`,this._dialogElement.style.height="100vh";return}let s=i-r,n=Math.floor(s/2);this._slotElement.style.marginTop=`${n}px`,this._slotElement.style.marginBottom=`${n}px`,this._dialogElement.style.height="auto"}get dialog(){return this._dialogElement}},gi=({render:e,html:t})=>Qt;var bi="data-rtgl-popover-content",er="min-width: 200px; max-width: 400px; box-sizing: border-box;",tr=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
1428
1428
  :host {
1429
1429
  display: contents;
1430
1430
  }
@@ -1473,7 +1473,7 @@ var rettangoli=(()=>{var we=`
1473
1473
  slot[name="content"] {
1474
1474
  display: contents;
1475
1475
  }
1476
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let r=t.composedPath();(r[0]===this._dialogElement||r[0].nodeName==="DIALOG"&&r[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let r=t.composedPath();(r[0]===this._dialogElement||r[0].nodeName==="DIALOG"&&r[0]===this._dialogElement)&&(t.preventDefault(),this._emitClose())}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._emitClose()}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._contentWrapper=null,this._isOpen=!1}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y","place","no-overlay","content-w","content-h","content-wh","content-g","content-sv","content-pv","content-bgc","content-style"]}connectedCallback(){this._syncContentWrapper({reposition:!1}),this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._isOpen&&this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,r,i){t==="open"?i!==null&&!this._isOpen?this.isConnected&&this._show():i===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="place")&&this._isOpen?this._updatePosition():t==="no-overlay"&&r!==i&&this._isOpen?(this._hide(),this._show()):t.startsWith("content-")&&this._syncContentWrapper()}_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(r=>r.hasAttribute(yi));return t?this._contentWrapper=t:(this._contentWrapper=document.createElement("rtgl-view"),this._contentWrapper.setAttribute(yi,""),this._contentWrapper.setAttribute("part","content"),this._contentWrapper.setAttribute("bgc","bg"),this._contentWrapper.setAttribute("bw","xs"),this._contentWrapper.setAttribute("bc","bo"),this._contentWrapper.setAttribute("br","md"),this._contentWrapper.setAttribute("ph","md"),this._contentWrapper.setAttribute("pv","md"),this._contentWrapper.setAttribute("style",er)),this._contentWrapper.parentNode!==this&&this.appendChild(this._contentWrapper),this._contentWrapper}_syncContentWrapperAttributes(){let t=this._ensureContentWrapper(),r=[["content-w","w"],["content-h","h"],["content-wh","wh"],["content-g","g"],["content-sv","sv"]];for(let[s,n]of r){let o=this.getAttribute(s);o===null?t.removeAttribute(n):t.setAttribute(n,o)}t.setAttribute("bgc",this.getAttribute("content-bgc")||"bg"),t.setAttribute("ph","md"),t.setAttribute("pv",this.getAttribute("content-pv")||"md");let i=this.getAttribute("content-style");t.setAttribute("style",i?`${er} ${i}`:er)}_syncContentWrapper({reposition:t=!0}={}){let r=this._ensureContentWrapper(),i=Array.from(this.childNodes).filter(n=>n!==r&&!this._isIgnorableTextNode(n));for(let n of i)n.nodeType===Node.ELEMENT_NODE&&n.getAttribute("slot")==="content"&&n.removeAttribute("slot"),r.appendChild(n);this._syncContentWrapperAttributes(),Array.from(r.childNodes).some(n=>!this._isIgnorableTextNode(n))?r.setAttribute("slot","content"):r.removeAttribute("slot"),t&&this._isOpen&&this._updatePosition()}_show(){this._isOpen||(this._syncContentWrapper({reposition:!1}),this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._dialogElement.open||setTimeout(()=>{this._dialogElement&&!this._dialogElement.open&&(this.hasAttribute("no-overlay")?this._dialogElement.show():this._dialogElement.showModal())},0),requestAnimationFrame(()=>{this._updatePosition()}))}_hide(){this._isOpen&&(this._isOpen=!1,this._dialogElement.open&&this._dialogElement.close(),this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_updatePosition(){let t=parseFloat(this.getAttribute("x")||"0"),r=parseFloat(this.getAttribute("y")||"0"),i=this.getAttribute("place")||"bs";this.removeAttribute("positioned"),requestAnimationFrame(()=>{this._syncContentWrapper({reposition:!1});let s=this._popoverContainer.getBoundingClientRect(),{left:n,top:o}=this._calculatePosition(t,r,s.width,s.height,i);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${o}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,r,i,s,n){let p=t,l=r;switch(n){case"t":p=t-i/2,l=r-s-8;break;case"ts":p=t,l=r-s-8;break;case"te":p=t-i,l=r-s-8;break;case"r":p=t+8,l=r-s/2;break;case"rs":p=t+8,l=r;break;case"re":p=t+8,l=r-s;break;case"b":p=t-i/2,l=r+8;break;case"bs":p=t,l=r+8;break;case"be":p=t-i,l=r+8;break;case"l":p=t-i-8,l=r-s/2;break;case"ls":p=t-i-8,l=r;break;case"le":p=t-i-8,l=r-s;break;default:p=t,l=r+8;break}let a=8;return p=Math.max(a,Math.min(p,window.innerWidth-i-a)),l=Math.max(a,Math.min(l,window.innerHeight-s-a)),{left:p,top:l}}get popover(){return this._popoverContainer}get content(){return this._contentWrapper}},gi=({render:e,html:t})=>tr;var Nn=(e,t)=>{let{store:r,render:i}=e;r.toggleOpen({}),i()},Vn=Object.freeze(Object.defineProperty({__proto__:null,handleClickHeader:Nn},Symbol.toStringTag,{value:"Module"})),Rn=()=>Object.freeze({open:!1}),jn=["id","class","style","slot","label","content"],Dn=(e={})=>Object.entries(e).filter(([t])=>!jn.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Pn=({state:e,props:t})=>({label:t.label||"",content:t.content||"",openClass:e.open?"content-wrapper open":"content-wrapper",chevronIcon:e.open?"chevronUp":"chevronDown",containerAttrString:Dn(t)}),Bn=({state:e})=>{e.open=!e.open},zn=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Rn,selectViewData:Pn,toggleOpen:Bn},Symbol.toStringTag,{value:"Module"})),Wn=(e,t)=>{let{dispatchEvent:r,props:i}=e,s=t._event,n=Number(s.currentTarget.dataset.index),o=Array.isArray(i.items)?i.items[n]:void 0;if(o){if(o.disabled||o.current){s.preventDefault();return}typeof o.href=="string"&&o.href.length>0||s.preventDefault(),r(new CustomEvent("item-click",{detail:{id:o.id,path:o.path,href:o.href,item:o,index:n,trigger:s.type}}))}},Fn=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:Wn},Symbol.toStringTag,{value:"Module"})),Mn=()=>Object.freeze({}),Kn=["id","class","style","slot","items","sep","max","separator"],Un=(e={})=>Object.entries(e).filter(([t])=>!Kn.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Hn=e=>{if(e==null||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t},qn=e=>`${e}`.replace(/"/g,"&quot;"),Gn=(e,t)=>{if(!t||t<3||e.length<=t)return e;let r=t-2;return[e[0],{isEllipsis:!0,label:"..."},...e.slice(-r)]},Yn=e=>e.map((t,r)=>{let i=typeof t.href=="string"&&t.href.length>0,s=t.path!==void 0&&t.path!==null&&`${t.path}`!="",n=!!t.current,o=!!t.disabled,p=!n&&!o&&(i||s||!!t.click),l=t.rel||(t.newTab?"noopener noreferrer":""),a=[t.newTab?'target="_blank"':"",l?`rel="${qn(l)}"`:""].filter(Boolean).join(" ");return{...t,label:t.label||"",index:r,href:i?t.href:void 0,path:s?t.path:void 0,isCurrent:n,isDisabled:o,isInteractive:p,linkExtraAttrs:a,c:n?"fg":"mu-fg"}}),Jn=({props:e})=>{let t=Un(e),r=Array.isArray(e.items)?e.items:[],i=Hn(e.max),s=e.sep||"breadcrumb-arrow",n=Yn(r),o=Gn(n,i),p=[];return o.forEach((l,a)=>{p.push(l),a<o.length-1&&p.push({isSeparator:!0})}),{containerAttrString:t,items:p,sep:s}},Zn=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Mn,selectViewData:Jn},Symbol.toStringTag,{value:"Module"})),Xn=["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"}},Qn=(e={})=>Object.entries(e).filter(([t])=>!Xn.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),eo=()=>Object.freeze({}),to=({props:e={}})=>{let t=bi[e.size]?e.size:"md",r=bi[t];return{containerAttrString:Qn(e),cardAttrString:r.cardAttrString,headerAttrString:r.headerAttrString,headingSize:r.headingSize,subheadingSize:r.subheadingSize,head:e.head||"",desc:e.desc||"",hasHeader:!!(e.head||e.desc),size:t}},ro=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:eo,selectViewData:to},Symbol.toStringTag,{value:"Module"})),io=(e,t)=>{let{dispatchEvent:r}=e;r(new CustomEvent("close"))},so=(e,t)=>{let{dispatchEvent:r,props:i}=e,s=t._event,n=Number(s.currentTarget.dataset.index??s.currentTarget.id.slice(6)),o=i.items[n],p=o?.type||"item";if(!o||p!=="item"||o.disabled){s.preventDefault();return}o.href||s.preventDefault(),r(new CustomEvent("item-click",{detail:{index:n,item:o,id:o.id,path:o.path,href:o.href,trigger:s.type}}))},no=Object.freeze(Object.defineProperty({__proto__:null,handleClickMenuItem:so,handleClosePopover:io},Symbol.toStringTag,{value:"Module"})),oo=()=>Object.freeze({}),ao=e=>`${e}`.replace(/"/g,"&quot;"),lo=e=>e.map((t,r)=>{let i=t.type||"item",s=i==="separator",n=i==="label",o=i==="item",p=!!t.disabled,l=o&&!p,a=p?"mu-fg":"fg",c=p?"mu":"",d=p?"":"ac",h=typeof t.href=="string"&&t.href.length>0,f=t.rel||(t.newTab?"noopener noreferrer":""),u=[t.newTab?'target="_blank"':"",f?`rel="${ao(f)}"`:""].filter(Boolean).join(" ");return{...t,index:r,type:i,isSeparator:s,isLabel:n,isItem:o,isDisabled:p,isInteractive:l,hasHref:h,linkExtraAttrs:u,c:a,bgc:c,hoverBgc:d}}),po=({props:e})=>{let t=Array.isArray(e.items)?e.items:[];return{items:lo(t),open:!!e.open,x:e.x||0,y:e.y||0,w:e.w||"300",h:e.h||"300",place:e.place||"bs"}},co=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:oo,selectViewData:po},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},pr={NOT:0},$=class extends Error{constructor(e){super(`Parse Error: ${e}`),this.name="JemplParseError"}},le=class extends Error{constructor(e){super(`Render Error: ${e}`),this.name="JemplRenderError"}},vi=e=>{if(!e||e.trim()==="")throw new $("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new $(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${r}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let r of t)if(e.trim().endsWith(r))throw new $(`Incomplete comparison expression - missing right operand (got: '${e}')`)},uo=e=>{if(e.trim().endsWith(" in"))throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new $(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);let i=t.includes(",")?t.split(",").map(s=>s.trim()):[t.trim()];for(let s of i){if(!s)throw new $(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(s))throw new $(`Invalid loop syntax (got: '$for ${e}')`)}},ho=(e,t,r=!1)=>{if(t===null)return new le(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new le(`Cannot iterate over undefined value at '$for ${e}'`);let i=typeof t;return r?new le(`Cannot iterate over non-array value in loop '${e}' - got ${i} instead`):new le(`Cannot iterate over non-array value (got: ${i}) at '$for ${e}'`)},fo=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new le(`Unknown function '${e}' (${r})`)},mo=(e,t,r={})=>{let i={},s={};r&&typeof r=="object"&&(r.functions!==void 0||r.partials!==void 0?(i=r.functions||{},s=r.partials||{}):typeof r=="object"&&(i=r));let n=V(e,{functions:i,partials:s},t,{});return n===void 0?{}:n},V=(e,t,r,i)=>{if(t.functions,e.var&&!e.type)return K(e.var,r,i);if(e.type===w.LITERAL)return e.value;if(e.type===w.VARIABLE)return K(e.path,r,i);if(e.type===w.INTERPOLATION)return go(e.parts,t,r,i);switch(e.type){case w.FUNCTION:return Xi(e,t,r,i);case w.BINARY:return Qi(e,t,r,i);case w.UNARY:return es(e,t,r,i);case w.CONDITIONAL:return vo(e,t,r,i);case w.LOOP:return Ao(e,t,r,i);case w.OBJECT:return ko(e,t,r,i);case w.ARRAY:return $o(e,t,r,i);case w.PARTIAL:return Co(e,t,r,i);case w.PATH_REFERENCE:return Io(e,t,r,i);default:throw new Error(`Unknown node type: ${e.type}`)}},wi=new Map,yo=e=>{let t=[],r="",i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(n==="[")r&&(t.push({type:"property",value:r}),r=""),i=!0;else if(n==="]"){if(i&&r){let o=r.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});r=""}i=!1}else r+=n}return r&&t.push({type:"property",value:r}),t},K=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let i=wi.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=yo(l.trim());i.push(...a)}wi.set(e,i)}let s=t;for(let n=0;n<i.length;n++){let o=i[n];if(o.type==="property"&&o.value in r){s=r[o.value];continue}if(s==null)return;(o.type==="property"||o.type==="index")&&(s=s[o.value])}return s},go=(e,t,r,i)=>{let s=[];for(let n of e)if(typeof n=="string")s.push(n);else{let o=V(n,t,r,i);s.push(o!=null?String(o):"")}return s.join("")},Xi=(e,t,r,i)=>{let s=t.functions||t,n=s[e.name];if(!n)throw fo(e.name,s);let o=e.args.map(p=>V(p,t,r,i));return n(...o)},je=(e,t,r,i)=>{if(e.var&&!e.type)return K(e.var,r,i);switch(e.type){case w.VARIABLE:return K(e.path,r,i);case w.LITERAL:return e.value;case w.BINARY:return Qi(e,t,r,i);case w.UNARY:return es(e,t,r,i);case w.FUNCTION:return Xi(e,t,r,i);default:return V(e,t,r,i)}},Qi=(e,t,r,i)=>{if(e.op===D.AND||e.op===D.OR){let o=je(e.left,t,r,i),p=je(e.right,t,r,i);switch(e.op){case D.AND:return o&&p;case D.OR:return o||p}}let s=V(e.left,t,r,i),n=V(e.right,t,r,i);switch(e.op){case D.EQ:return s==n;case D.NEQ:return s!=n;case D.GT:return s>n;case D.LT:return s<n;case D.GTE:return s>=n;case D.LTE:return s<=n;case D.IN:return Array.isArray(n)?n.includes(s):!1;case D.ADD:if(typeof s!="number"||typeof n!="number")throw new le(`Arithmetic operations require numbers. Got ${typeof s} + ${typeof n}`);return s+n;case D.SUBTRACT:if(typeof s!="number"||typeof n!="number")throw new le(`Arithmetic operations require numbers. Got ${typeof s} - ${typeof n}`);return s-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},es=(e,t,r,i)=>{let s=e.op===pr.NOT?je(e.operand,t,r,i):V(e.operand,t,r,i);switch(e.op){case pr.NOT:return!s;default:throw new Error(`Unknown unary operator: ${e.op}`)}},bo=(e,t,r,i)=>{if(e.conditions.length===2&&e.conditions[1]===null){let s=e.conditions[0];if(s.type===w.VARIABLE)if(K(s.path,r,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?V(p.parsedKey,t,r,i):p.key,a=p.value;if(a.type===w.LITERAL)o[l]=a.value;else if(a.type===w.VARIABLE)o[l]=K(a.path,r,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=K(d.path,r,i);c.push(h!=null?String(h):"")}else{let h=V(d,t,r,i);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=V(a,t,r,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?V(p.parsedKey,t,r,i):p.key,a=p.value;if(a.type===w.LITERAL)o[l]=a.value;else if(a.type===w.VARIABLE)o[l]=K(a.path,r,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=K(d.path,r,i);c.push(h!=null?String(h):"")}else{let h=V(d,t,r,i);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=V(a,t,r,i)}return o}}}return null},vo=(e,t,r,i)=>{let s=bo(e,t,r,i);if(s!==null)return s;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||je(o,t,r,i))return V(e.bodies[n],t,r,i)}return ts},wo=(e,t)=>{let r=e.body,i=e.itemVar;if(r.type===w.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===w.VARIABLE){let s=r.conditions[0].path,n=r.bodies[0];if(s.startsWith(i+".")){let o=s.substring(i.length+1);if(n.type===w.OBJECT&&n.properties.length<=5){for(let l of n.properties)if(l.parsedKey)return null;let p=[];for(let l=0;l<t.length;l++){let 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 m=u.substring(i.length+1);c[h]=a[m]}else return null}else if(f.type===w.INTERPOLATION){let u=[],m=!0;for(let y of f.parts)if(typeof y=="string")u.push(y);else if(y.type===w.VARIABLE){let b=y.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{m=!1;break}}else{m=!1;break}if(!m)return null;c[h]=u.join("")}else return null}p.push(c)}}return p}}}return null},_o=(e,t)=>{let r=e.body,i=e.itemVar,s=wo(e,t);if(s!==null)return s;if(r.type===w.OBJECT&&r.properties.length<=5&&!r.whenCondition){for(let p of r.properties)if(p.parsedKey)return null;let n=[],o=!0;for(let p of r.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},xo=(e,t,r,i,s)=>{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<s.length;a++){let c=s[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("."),m=u[0];m in i.__paths__&&(f=i.__paths__[m],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 m=u.parsedKey?V(u.parsedKey,t,r,h):u.key,y=u.value;if(y.type===w.LITERAL)d[m]=y.value;else if(y.type===w.VARIABLE){let b=y.path;if(b===p)d[m]=c;else if(b===l)d[m]=a;else if(b.startsWith(p+".")){let g=b.substring(p.length+1);!g.includes(".")&&!g.includes("[")?d[m]=c[g]:d[m]=K(b,r,{...i,[p]:c,...l&&{[l]:a}})}else d[m]=K(b,r,{...i,[p]:c,...l&&{[l]:a}})}else if(y.type===w.INTERPOLATION){let b=[];for(let g of y.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=g.path,S;if(_===p)S=c;else if(_===l)S=a;else if(_.startsWith(p+".")){let A=_.substring(p.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=K(_,r,{...i,[p]:c,...l&&{[l]:a}})}else S=K(_,r,{...i,[p]:c,...l&&{[l]:a}});b.push(S!=null?String(S):"")}else{let _={...i,[p]:c,...l&&{[l]:a}},S=V(g,t,r,_);b.push(S!=null?String(S):"")}d[m]=b.join("")}else{let b={...i,[p]:c,...l&&{[l]:a}};d[m]=V(y,t,r,b)}}n.push(d)}return n}return null},So=(e,t,r)=>{let i=e.body;if(i.type===w.OBJECT&&i.properties.length===1&&i.properties[0].key==="$if item.visible"){let s=i.properties[0].value;if(s.type===w.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===w.VARIABLE&&s.conditions[0].path==="item.visible"){let n=s.bodies[0];if(n.type===w.OBJECT&&n.properties.length===2){let 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},Ao=(e,t,r,i)=>{let s=V(e.iterable,t,r,i);if(!Array.isArray(s)){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 ho(d,s,c)}if(!e.indexVar){let a=So(e,s,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=_o(e,s);if(a!==null)return a}let n=xo(e,t,r,i,s);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<s.length;a++){let c=e.indexVar?{...i,[e.itemVar]:s[a],[e.indexVar]:a}:{...i,[e.itemVar]:s[a]};c.__paths__||(c.__paths__=i.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${p}[${a}]`},e.indexVar&&(c.__paths__[e.indexVar]=a);let d=V(e.body,t,r,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},Eo=(e,t,r,i)=>{if(e.whenCondition)return null;if(e.properties.length===1){let s=e.properties[0],n=s.parsedKey?V(s.parsedKey,t,r,i):s.key,o=s.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?V(c.parsedKey,t,r,i):c.key,h=c.value;if(h.type===w.LITERAL)l[d]=h.value;else if(h.type===w.VARIABLE)l[d]=K(h.path,r,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 m=K(u.path,r,i);f.push(m!=null?String(m):"")}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 m=u.key,y=u.value;if(y.type===w.LITERAL)f[m]=y.value;else if(y.type===w.VARIABLE)f[m]=K(y.path,r,i);else if(y.type===w.INTERPOLATION){let b=[];for(let g of y.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=K(g.path,r,i);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[m]=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},ko=(e,t,r,i)=>{let s=t.functions||t;if(e.whenCondition&&!je(e.whenCondition,s,r,i))return;let n=Eo(e,t,r,i);if(n!==null)return n;if(e.fast){let l={};for(let a of e.properties){let c=a.parsedKey?V(a.parsedKey,t,r,i):a.key,d=a.value;if(d.type===w.LITERAL)l[c]=d.value;else if(d.type===w.VARIABLE)l[c]=K(d.path,r,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=K(f.path,r,i);h.push(u!=null?String(u):"")}else{let u=V(f,t,r,i);h.push(u!=null?String(u):"")}l[c]=h.join("")}else l[c]=V(d,t,r,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=V(l.value,t,r,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 V(l.value,t,r,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=V(c.value,t,r,i);d!==void 0&&(o[l.key]=d)}else{let d=V(l.value,t,r,i);d!==void 0&&(o[l.key]=d)}}else{let c=l.parsedKey?V(l.parsedKey,t,r,i):l.key,d=V(l.value,t,r,i);d!==void 0&&(o[c]=d)}}return o},ts={},$o=(e,t,r,i)=>{let s=[];for(let n of e.items)if(n.type===w.LOOP){let o=V(n,t,r,i);Array.isArray(o)&&n.flatten!==!1?s.push(...o):s.push(o)}else{let o=V(n,t,r,i);o!==ts&&o!==void 0&&s.push(o)}return s},Co=(e,t,r,i)=>{let{name:s,data:n,whenCondition:o}=e,p=t.partials||{},l=t.functions||t;if(o&&!je(o,l,r,i))return;if(!p[s])throw new le(`Partial '${s}' is not defined`);let a=i._partialStack||[];if(a.includes(s))throw new le(`Circular partial reference detected: ${s}`);let c=p[s],d=r,h={...i,_partialStack:[...a,s]};if(i){d={...r};for(let f of Object.keys(i))f.startsWith("_")||(d[f]=i[f])}if(n){let f=V(n,t,r,i);d={...d,...f}}return V(c,t,d,h)},Io=(e,t,r,i)=>{let{path:s}=e,n=s.split("."),o=n[0],p=n.slice(1);if(!i||!(o in i))throw new le(`Path reference '#{${s}}' refers to '${o}' which is not a loop variable in the current scope`);if(i.__paths__||(i.__paths__={}),!(o in i.__paths__))throw new le(`Path reference '#{${s}}' 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 le(`Path reference '#{${s}}' - cannot access properties on index variable '${o}'`);return String(l)}return p.length>0&&(l+="."+p.join(".")),l},Oo=/\$\{([^}]*)\}/g,To=/#\{([^}]*)\}/g,rs=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,i,s]=r,n=Lo(s,t);return{isFunction:!0,type:w.FUNCTION,name:i,args:n}},Lo=(e,t={})=>e.trim()?No(e).map(r=>Vo(r.trim(),t)):[],No=e=>{let t=[],r="",i=0,s=!1,n="";for(let o=0;o<e.length;o++){let p=e[o],l=o>0?e[o-1]:"";!s&&(p==='"'||p==="'")?(s=!0,n=p,r+=p):s&&p===n&&l!=="\\"?(s=!1,n="",r+=p):!s&&p==="("?(i++,r+=p):!s&&p===")"?(i--,r+=p):!s&&p===","&&i===0?(t.push(r),r=""):r+=p}return r&&t.push(r),t},Vo=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:w.LITERAL,value:parseFloat(e)};if(e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};let r=rs(e,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};let i=e.trim(),s=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:o,type:p}of s){let l=0;for(;l<i.length;){let a=Te(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:w.VARIABLE,path:i}}return{type:w.VARIABLE,path:i}},is=/^\w+\(.*\)$/,Ro=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,jo=e=>{if(!(!e||e.trim()===""||is.test(e))&&Ro.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}"`)},_i=e=>{let t=e.trim();if(is.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}},ht=(e,t={})=>{let r=e.trim();jo(r);let i=rs(r,t);if(i.isFunction)return{type:i.type,name:i.name,args:i.args};if(r.includes("[")&&!/[\s+\-*/%|&?:]/.test(r)){let s=0;for(let n of r)n==="["?s++:n==="]"&&s--;if(s!==0)throw new Error("Invalid array index syntax")}return{type:w.VARIABLE,path:r}},ss=(e,t={})=>{let r=e,i=[];(e.includes("\\${")||e.includes("\\#{"))&&(r=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),r=r.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),r=r.replace(/\\(\$\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\(#\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\DOUBLE_ESC_VAR/g,"\\"),r=r.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let s=[...r.matchAll(Oo)],n=[...r.matchAll(To)],o=[...s.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=r;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]===r&&i.length===0){let{match:a,type:c}=o[0];try{return c==="variable"?ht(a[1],t):_i(a[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:w.LITERAL,value:r};throw d}}let p=[],l=0;for(let{match:a,type:c}of o){let[d,h]=a,f=a.index;if(f>l){let u=r.substring(l,f);for(let m=0;m<i.length;m++)u=u.replace(`__ESCAPED_${m}__`,i[m]);u&&p.push(u)}try{let u;c==="variable"?u=ht(h.trim(),t):u=_i(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<r.length){let a=r.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}},Ae=(e,t)=>typeof e=="string"?ss(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Po(e,t):Bo(e,t):{type:w.LITERAL,value:e},Do=e=>{let{$each:t,...r}=e;if(typeof t!="string")throw new $("$each value must be a non-empty string");let i=t.trim();if(i==="")throw new $("$each value must be a non-empty string");if(Object.keys(r).length===0)throw new $("Empty $each body not allowed");if(r.$partial!==void 0)throw new $("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${i}`]:r}},Po=(e,t)=>{let r=[],i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let l=Do(n),a=Object.keys(l);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let c=xi(a[0],l[a[0]],t,!0);r.push(c),i=!0;continue}}catch(l){throw l instanceof $?l:new $(l.message)}let p=Object.keys(n);if(p.length===1&&/^\$for(?::\w+)?\s/.test(p[0])){let l=xi(p[0],n[p[0]],t);r.push(l),i=!0;continue}}let o=Ae(n,t);r.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:r,fast:!i}},Bo=(e,t)=>{let r=[],i=!1,s=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 m=null;if(u&&(m=Ae(f,t),m.type===w.OBJECT)){let b=!1;for(let g of m.properties)if(g.value.type===w.VARIABLE||g.value.type===w.INTERPOLATION||g.value.type===w.FUNCTION||g.value.type===w.CONDITIONAL||g.value.type===w.OBJECT&&!g.value.fast||g.value.type===w.ARRAY&&!g.value.fast){b=!0;break}b&&(m.fast=!1)}let y={type:w.PARTIAL,name:c,data:m};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new $("Empty condition expression after '$when'");b=X(d,t)}else b={type:w.LITERAL,value:d};y.whenCondition=b}return y}for(let[l,a]of n)if(l==="$when"){if(s!==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'");s=X(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=zo(n,o,t);r.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=Ae(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=ss(l,t),h={key:l,value:c};(d.type!==w.LITERAL||d.value!==l)&&(h.parsedKey=d),r.push(h),o++}}}let p={type:w.OBJECT,properties:r,fast:!i};return s&&(p.whenCondition=s),p},zo=(e,t,r={})=>{let i=[],s=[],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());vi(a);let c=X(a,r);for(i.push(c),s.push(Ae(p,r)),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{vi(u);let m=X(u,r);i.push(m)}if(s.push(Ae(h,r)),n++,u===null)break}else break}return{node:{type:w.CONDITIONAL,conditions:i,bodies:s,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 r=Te(e,"||");if(r!==-1)return{type:w.BINARY,op:D.OR,left:X(e.substring(0,r).trim(),t),right:X(e.substring(r+2).trim(),t)};let i=Te(e,"&&");if(i!==-1)return{type:w.BINARY,op:D.AND,left:X(e.substring(0,i).trim(),t),right:X(e.substring(i+2).trim(),t)};let s=[{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 s){let d=Te(e,a);if(d!==-1)return{type:w.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:D.ADD},{op:" - ",type:D.SUBTRACT}];for(let{op:a,type:c}of p){let d=0;for(;d<e.length;){let h=Te(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: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(Te(e,a)!==-1)throw new $(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:w.UNARY,op:pr.NOT,operand:X(e.substring(1).trim(),t)}:ns(e,t)},Te=(e,t)=>{let r=0,i=0;for(;i<=e.length-t.length;){if(e[i]==="(")r++;else if(e[i]===")")r--;else if(r===0&&e.substring(i,i+t.length)===t)return i;i++}return-1},Wo=e=>{if(e=e.trim(),e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:w.LITERAL,value:""};if(e==="{}")return{type:w.LITERAL,value:{}};if(e==="[]")return{type:w.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:w.LITERAL,value:t}:{type:w.VARIABLE,path:e}},ns=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return ht(r,t);let i=Wo(r);if(i.type===w.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:w.VARIABLE,path:r};try{return ht(r,t)}catch(s){if(s.message&&s.message.includes("not supported"))return i;throw s}},Fo=(e,t=!1)=>{try{uo(e)}catch(r){if(r instanceof $&&t){let i=r.message.replace(/\$for/g,"$each");throw new $(i.replace("Parse Error: ",""))}throw r}},xi=(e,t,r,i=!1)=>{let s=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(s);if(!n){let y=i?"$each":"$for";throw new $(`Invalid loop syntax (got: '${e.replace("$for",y)}')`)}let o=n[1],p=n[2].trim();Fo(p,i);let l=p.match(/^(.+?)\s+in\s+(.+)$/);if(!l){let y=i?"$each":"$for";throw new $(`Invalid loop syntax - missing 'in' keyword (got: '${y} ${p}')`)}let a=l[1].trim(),c=l[2].trim(),d,h=null;if(a.includes(",")){let y=a.split(",").map(b=>b.trim());if(y.length!==2)throw new $(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=y[0],h=y[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=ns(c,r),m=Ae(t,r);return{type:w.LOOP,itemVar:d,indexVar:h,iterable:u,body:m,flatten:o!=="nested"}},Si=(e,t={})=>{let{functions:r={}}=t;return Ae(e,r)},Mo=()=>Date.now(),Ko=Object.freeze(Object.defineProperty({__proto__:null,now:Mo},Symbol.toStringTag,{value:"Module"})),Uo=(e,t,r={})=>{let{functions:i={},partials:s={}}=r,n={...Ko,...i},o=Si(e,{functions:n}),p={};for(let[l,a]of Object.entries(s))p[l]=Si(a,{functions:n});return mo(o,t,{functions:n,partials:p})},kr=e=>e!==null&&typeof e=="object",ft=e=>kr(e)&&!Array.isArray(e),Ho=e=>typeof e=="string"&&e.includes("."),os=e=>typeof e=="string"&&/[\[\]]/.test(e);function as(e,t){let r={};for(let i of t){if(typeof i!="string"||i.length===0)continue;let s=pe(e,i);s!==void 0&&ue(r,i,s)}return r}function qo(e){if(!ft(e)||!Array.isArray(e.fields))return e;let t=(r=[])=>r.map(i=>{if(!ft(i))return i;if(typeof i.$when=="string"&&i.$when.trim().length>0){let{$when:s,...n}=i,o=Array.isArray(n.fields)?{...n,fields:t(n.fields)}:n;return{[`$if ${s}`]:o}}return Array.isArray(i.fields)?{...i,fields:t(i.fields)}:i});return{...e,fields:t(e.fields)}}var pe=(e,t,r=void 0)=>{if(!t||!kr(e)||os(t))return r;let i=t.split(".").filter(n=>n!==""),s=e;for(let n of i){if(s==null||!(n in s))return Object.prototype.hasOwnProperty.call(e,t)?e[t]:r;s=s[n]}return s},ue=(e,t,r)=>{if(!kr(e)||typeof t!="string"||t.length===0||os(t))return e;let i=t.split(".").filter(n=>n!=="");if(i.length===0)return e;Ho(t)&&Object.prototype.hasOwnProperty.call(e,t)&&delete e[t];let s=e;for(let n=0;n<i.length-1;n++){let o=i[n];(!(o in s)||typeof s[o]!="object"||s[o]===null)&&(s[o]={}),s=s[o]}return s[i[i.length-1]]=r,e},Go=["id","class","style","slot","form","defaultValues","disabled","context"],Yo=(e={})=>Object.entries(e).filter(([t,r])=>!(Go.includes(t)||r==null||typeof r=="object"||typeof r=="function")).map(([t,r])=>`${t}=${String(r)}`).join(" "),Jo={email:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,url:/^https?:\/\/.+/},ce={required:"This field is required",minLength:e=>`Must be at least ${e} characters`,maxLength:e=>`Must be at most ${e} characters`,pattern:"Invalid format",invalidDate:"Invalid date format",invalidTime:"Invalid time format",invalidDateTime:"Invalid date and time format",minTemporal:e=>`Must be on or after ${e}`,maxTemporal:e=>`Must be on or before ${e}`},Zo="input-date",Xo="input-time",Qo="input-datetime",ea=/^(\d{4})-(\d{2})-(\d{2})$/,ta=/^(\d{2}):(\d{2})(?::(\d{2}))?$/,ra=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}(?::\d{2})?)$/,ia=e=>{if(typeof e!="string")return null;let t=ea.exec(e);if(!t)return null;let r=Number(t[1]),i=Number(t[2]),s=Number(t[3]);if(!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(s)||i<1||i>12||s<1||s>31)return null;let n=new Date(Date.UTC(r,i-1,s));return n.getUTCFullYear()===r&&n.getUTCMonth()===i-1&&n.getUTCDate()===s?{year:r,month:i,day:s}:null},sa=e=>{if(typeof e!="string")return null;let t=ta.exec(e);if(!t)return null;let r=Number(t[1]),i=Number(t[2]),s=t[3]===void 0?0:Number(t[3]);return!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(s)||r<0||r>23||i<0||i>59||s<0||s>59?null:{hour:r,minute:i,second:s}},ls=e=>{let t=sa(e);return t?`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}`:null},ps=e=>ia(e)?e:null,na=e=>{if(typeof e!="string")return null;let t=ra.exec(e);if(!t)return null;let r=ps(t[1]),i=ls(t[2]);return!r||!i?null:`${r}T${i}`},oa=e=>e===Zo?{normalize:ps,invalidMessage:ce.invalidDate}:e===Xo?{normalize:ls,invalidMessage:ce.invalidTime}:e===Qo?{normalize:na,invalidMessage:ce.invalidDateTime}:null,aa=(e,t)=>{let r=oa(e.type);if(!r||t==null||t==="")return null;let i=r.normalize(String(t));if(!i)return r.invalidMessage;if(e.min!==void 0&&e.min!==null&&String(e.min)!==""){let s=r.normalize(String(e.min));if(s&&i<s)return ce.minTemporal(String(e.min))}if(e.max!==void 0&&e.max!==null&&String(e.max)!==""){let s=r.normalize(String(e.max));if(s&&i>s)return ce.maxTemporal(String(e.max))}return null},_t=(e,t)=>{if(e.required){let i=t==null||t===""||typeof t=="boolean"&&t===!1,s=e.type==="input-number"&&t===null;if(e.type==="input-number"?s:i)return typeof e.required=="object"&&e.required.message?e.required.message:ce.required}let r=aa(e,t);if(r)return r;if(Array.isArray(e.rules))for(let i of e.rules){let s=la(i,t);if(s)return s}return null},la=(e,t)=>{if(t==null||t==="")return null;let r=String(t);switch(e.rule){case"minLength":return r.length<e.value?e.message||ce.minLength(e.value):null;case"maxLength":return r.length>e.value?e.message||ce.maxLength(e.value):null;case"pattern":{let i=Jo[e.value];if(!i)try{i=new RegExp(e.value)}catch{return e.message||ce.pattern}return i.test(r)?null:e.message||ce.pattern}default:return null}},xt=(e,t)=>{let r={},i=se(e);for(let s of i){let n=pe(t,s.name),o=_t(s,n);o&&(r[s.name]=o)}return{valid:Object.keys(r).length===0,errors:r}},pa=["section","read-only-text","slot"],$r=e=>!pa.includes(e.type),se=e=>{let t=[];for(let r of e)r.type==="section"&&Array.isArray(r.fields)?t.push(...se(r.fields)):$r(r)&&t.push(r);return t},Cr=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"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}},Ir=(e,t=0)=>{let r=[],i=t;for(let s of e)if(s.type==="section"){if(r.push({...s,_isSection:!0,_idx:i}),i++,Array.isArray(s.fields)){let n=Ir(s.fields,i);r.push(...n),i+=n.length}}else r.push({...s,_isSection:!1,_idx:i}),i++;return r},da=()=>Object.freeze({formValues:{},errors:{},reactiveMode:!1,tooltipState:{open:!1,x:0,y:0,content:""}}),ee=({state:e,props:t})=>{let{form:r={}}=t||{},i=qo(r),s=ft(t?.context)?t.context:{},n=ft(e?.formValues)?e.formValues:{},o={...s,...n,formValues:n};return Object.keys(o).length>0?Uo(i,o):i},ca=({state:e,props:t})=>{let r=Yo(t),i=ee({state:e,props:t}),s=i.fields||[],n=!!t?.disabled,o=Ir(s);o.forEach(d=>{if(d._isSection)return;let h=$r(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==="segmented-control"){let f=pe(e.formValues,d.name);d._selectedValue=f!==void 0?f:null,d.placeholder=d.placeholder||"",d.noClear=d.clearable===!1}if(d.type==="image"){let f=pe(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:r,title:i?.title||"",description:i?.description||"",flatFields:o,actions:c,formValues:e.formValues,tooltipState:e.tooltipState}},Ce=({state:e,props:t})=>{let r=ee({state:e,props:t}),i=se(r.fields||[]);return as(e.formValues,i.map(s=>s.name).filter(s=>typeof s=="string"&&s.length>0))},ua=({state:e,props:t},r={})=>{let{name:i,value:s}=r;i&&(ue(e.formValues,i,s),tt({state:e,props:t}))},tt=({state:e,props:t})=>{if(!t)return;let r=ee({state:e,props:t}),i=se(r.fields||[]);e.formValues=as(e.formValues,i.map(s=>s.name).filter(s=>typeof s=="string"&&s.length>0))},ha=({state:e},t={})=>{let{values:r}=t;!r||typeof r!="object"||Object.keys(r).forEach(i=>{ue(e.formValues,i,r[i])})},fa=({state:e},t={})=>{let{defaultValues:r={}}=t;e.formValues=r?structuredClone(r):{},e.errors={},e.reactiveMode=!1},ma=({state:e},t={})=>{e.errors=t.errors||{}},ya=({state:e},t={})=>{let{name:r}=t;r&&e.errors[r]&&delete e.errors[r]},ga=({state:e})=>{e.reactiveMode=!0},ba=({state:e},t={})=>{let{x:r,y:i,content:s}=t;e.tooltipState={open:!0,x:r,y:i,content:s}},va=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},wa=Object.freeze(Object.defineProperty({__proto__:null,clearFieldError:ya,collectAllDataFields:se,createInitialState:da,flattenFields:Ir,get:pe,getDefaultValue:Cr,hideTooltip:va,isDataField:$r,pruneHiddenValues:tt,resetFormValues:fa,selectForm:ee,selectFormValues:Ce,selectViewData:ca,set:ue,setErrors:ma,setFormFieldValue:ua,setFormValues:ha,setReactiveMode:ga,showTooltip:ba,validateField:_t,validateForm:xt},Symbol.toStringTag,{value:"Module"})),ds=({field:e,target:t,value:r})=>{!e||!t||["slider-with-input","popover-input"].includes(e.type)&&(r==null?t.removeAttribute("value"):t.setAttribute("value",String(r)))},cs=({form:e,formValues:t={},refs:r,formDisabled:i=!1})=>{let s=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=r[`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=pe(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())}l.type==="checkbox"&&(pe(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(s)},us=(e,t)=>{let r=t?.defaultValues||{},i={};Object.keys(r).forEach(p=>{ue(i,p,r[p])});let s=ee({state:{formValues:i},props:t}),n=se(s.fields||[]),o={};for(let p of n){let l=pe(r,p.name);l!==void 0?ue(o,p.name,l):ue(o,p.name,Cr(p))}e.resetFormValues({defaultValues:o})},_a=e=>{let{store:t,props:r}=e;us(t,r)},xa=e=>{let{props:t,refs:r,render:i}=e,s=e.store.getState(),n=ee({state:s,props:t});cs({form:n,formValues:s.formValues,refs:r,formDisabled:!!t?.disabled}),i()},Sa=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n,refs:o}=e,p=!!i?.disabled;r?.key!==i?.key&&us(s,i);let l=s.getState();tt({state:l,props:i});let a=ee({state:l,props:i});cs({form:a,formValues:l.formValues,refs:o,formDisabled:p}),n()},Aa=(e,t)=>{let{store:r,dispatchEvent:i,render:s,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;r.setFormFieldValue({name:p,value:l});let a=r.getState();tt({state:a,props:n});let c=ee({state:a,props:n}),d=se(c.fields||[]).find(h=>h.name===p);if(ds({field:d,target:o.currentTarget,value:l}),a.reactiveMode&&d){let h=_t(d,l);h?r.setErrors({errors:{...a.errors,[p]:h}}):r.clearFieldError({name:p})}s(),i(new CustomEvent("form-input",{bubbles:!0,detail:{name:p,value:l,values:Ce({state:r.getState(),props:n})}}))},Ea=(e,t)=>{let{store:r,dispatchEvent:i,render:s,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;r.setFormFieldValue({name:p,value:l});let a=r.getState();tt({state:a,props:n});let c=ee({state:a,props:n}),d=se(c.fields||[]).find(h=>h.name===p);if(ds({field:d,target:o.currentTarget,value:l}),a.reactiveMode&&d){let h=_t(d,l);h?r.setErrors({errors:{...a.errors,[p]:h}}):r.clearFieldError({name:p})}s(),i(new CustomEvent("form-change",{bubbles:!0,detail:{name:p,value:l,values:Ce({state:r.getState(),props:n})}}))},ka=(e,t)=>{let{store:r,dispatchEvent:i,render:s,props:n}=e,o=t._event.currentTarget.dataset.actionId;if(!o)return;let p=r.getState(),l=ee({state:p,props:n}),a=((l.actions||{}).buttons||[]).find(d=>d.id===o),c=Ce({state:p,props:n});if(a&&a.validate){let d=se(l.fields||[]),{valid:h,errors:f}=xt(d,p.formValues);r.setErrors({errors:f}),h||r.setReactiveMode(),s(),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}}))},$a=(e,t)=>{let r=t._event;r.type==="contextmenu"&&r.preventDefault();let{store:i,dispatchEvent:s,props:n}=e,o=r.currentTarget.dataset.fieldName;s(new CustomEvent("form-field-event",{bubbles:!0,detail:{name:o,event:r.type,values:Ce({state:i.getState(),props:n})}}))},Ca=(e,t)=>{let{store:r,dispatchEvent:i,render:s,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=r.getState(),a=ee({state:l,props:n}),c=(a.actions||{}).buttons||[],d=c.find(f=>f.validate)||c[0];if(!d)return;let h=Ce({state:l,props:n});if(d.validate){let f=se(a.fields||[]),{valid:u,errors:m}=xt(f,l.formValues);r.setErrors({errors:m}),u||r.setReactiveMode(),s(),i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h,valid:u,errors:m}}))}else i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h}}))}},Ia=(e,t)=>{let{store:r,render:i,props:s}=e,n=t._event,o=n.currentTarget.dataset.fieldName,p=ee({state:r.getState(),props:s}),l=se(p.fields||[]).find(a=>a.name===o);if(l&&l.tooltip){let a=n.currentTarget.getBoundingClientRect();r.showTooltip({x:a.left+a.width/2,y:a.top-8,content:typeof l.tooltip=="string"?l.tooltip:l.tooltip.content||""}),i()}},Oa=e=>{let{store:t,render:r}=e;t.hideTooltip({}),r()},Ta=Object.freeze(Object.defineProperty({__proto__:null,handleActionClick:ka,handleAfterMount:xa,handleBeforeMount:_a,handleImageClick:$a,handleKeyDown:Ca,handleOnUpdate:Sa,handleTooltipMouseEnter:Ia,handleTooltipMouseLeave:Oa,handleValueChange:Ea,handleValueInput:Aa},Symbol.toStringTag,{value:"Module"})),La=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"],Na=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input","slider-with-input"],Va=({ref:e,fieldType:t,value:r,forceRefresh:i=!1})=>{if(La.includes(t)){if(i&&e.removeAttribute("value"),r==null){if(Na.includes(t)&&i){if(t==="popover-input"){e.removeAttribute("value");return}e.setAttribute("value","");return}e.removeAttribute("value");return}e.setAttribute("value",String(r))}},hs=({ref:e,value:t})=>{e&&e?.store?.updateSelectedValue&&(e.store.updateSelectedValue({value:t}),typeof e.render=="function"&&e.render())},Ra=e=>{let t=new Map;return!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("[data-field-name]").forEach(r=>{let i=r.getAttribute("data-field-name");i&&t.set(i,r)}),t},Ai=e=>e?.renderTarget?e.renderTarget:e?.shadowRoot?e.shadowRoot:e?.shadow,ja=({root:e,values:t={}})=>{!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("rtgl-select[data-field-name], rtgl-segmented-control[data-field-name]").forEach(r=>{let i=r.dataset?.fieldName;if(!i)return;let s=pe(t,i);hs({ref:r,value:s})})},Da=function(){let e=this.store.getState();return Ce({state:e,props:this.props})},Pa=function(e={}){let t=e&&typeof e=="object"&&e.values&&typeof e.values=="object"?e.values:e;if(!t||typeof t!="object"||Array.isArray(t))return;this.store.setFormValues({values:t}),this.store.pruneHiddenValues();let r=this.store.getState(),i=ee({state:r,props:this.props}),s=se(i.fields||[]),n=Ra(Ai(this));for(let p of s){if(!p.name)continue;let l=n.get(p.name);if(!l)continue;let a=Object.prototype.hasOwnProperty.call(t,p.name),c=pe(t,p.name);if(!a&&c===void 0)continue;let d=pe(r.formValues,p.name);Va({ref:l,fieldType:p.type,value:d,forceRefresh:!0}),typeof l?.tagName=="string"&&l.tagName.toUpperCase()==="RTGL-SELECT"&&hs({ref:l,value:d}),p.type==="checkbox"&&(d?l.setAttribute("checked",""):l.removeAttribute("checked"))}this.render();let o=()=>{let p=this.store.getState();ja({root:Ai(this),values:p.formValues})};o(),setTimeout(()=>{o()},0)},Ba=function(){let e=this.store.getState(),t=ee({state:e,props:this.props}),r=se(t.fields||[]),{valid:i,errors:s}=xt(r,e.formValues);return this.store.setErrors({errors:s}),i||this.store.setReactiveMode(),this.render(),{valid:i,errors:s}},za=function(){let e=this.props?.defaultValues||{},t={};Object.keys(e).forEach(n=>{ue(t,n,e[n])});let r=ee({state:{formValues:t},props:this.props}),i=se(r.fields||[]),s={};for(let n of i){let o=pe(e,n.name);o!==void 0?ue(s,n.name,o):ue(s,n.name,Cr(n))}this.store.resetFormValues({defaultValues:s}),this.setValues(s)},Wa=Object.freeze(Object.defineProperty({__proto__:null,getValues:Da,reset:za,setValues:Pa,validate:Ba},Symbol.toStringTag,{value:"Module"})),fs=e=>{e&&(typeof e.componentDialogBodyHost?.replaceChildren=="function"&&e.componentDialogBodyHost.replaceChildren(),delete e.componentDialogBody)},Fa=e=>{let t=e.selectUiType();return t==="dropdown"||t==="formDialog"||t==="componentDialog"?null:e.selectConfig().mode==="confirm"?!1:null},he=({store:e,render:t,globalUI:r,refs:i,emitResult:s=!1,result:n})=>{if(!e.selectIsOpen())return;let o=n!==void 0?n:Fa(e);fs(i),e.closeAll(),t(),s&&r.emit("event",o)},ms=({store:e,render:t,globalUI:r,refs:i,error:s})=>{fs(i),e.selectIsOpen()&&(e.closeAll(),t()),r.emit("error",s)},rt=({store:e,render:t,globalUI:r,refs:i})=>{e.selectIsOpen()&&he({store:e,render:t,globalUI:r,refs:i,emitResult:!0})},it=(e,{rejectOnError:t=!1}={})=>new Promise((r,i)=>{let s=null,n=e.once("event",o=>{s?.(),r(o)});t&&(s=e.once("error",o=>{n?.(),i(o)}))}),Ma=(e,t)=>{setTimeout(()=>{let{store:r,refs:i}=e;if(!r.selectIsOpen()||r.selectUiType()!=="formDialog")return;let s=r.selectFormDialogConfig?.();if(!s||s.key!==t||typeof s.mount!="function")return;let n=i.formDialog;n&&s.mount(n)},0)},Ka=(e,t)=>{setTimeout(()=>{let{store:r,refs:i,render:s,globalUI:n}=e;if(!r.selectIsOpen()||r.selectUiType()!=="componentDialog")return;let o=r.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){ms({store:r,render:s,globalUI:n,refs:i,error:l})}},0)},rr=(e,t)=>!e.selectIsOpen()||e.selectUiType()!=="componentDialog"?!1:e.selectComponentDialogConfig?.()?.key===t,Ua=e=>{let{store:t,render:r,globalUI:i,refs:s}=e;he({store:t,render:r,globalUI:i,refs:s,emitResult:!0})},Ha=e=>{let{store:t,render:r,globalUI:i,refs:s}=e,n=t.selectConfig().mode==="confirm"?!0:null;he({store:t,render:r,globalUI:i,refs:s,emitResult:!0,result:n})},qa=e=>{let{store:t,render:r,globalUI:i,refs:s}=e;he({store:t,render:r,globalUI:i,refs:s,emitResult:!0,result:!1})},Ga=e=>{let{store:t,render:r,globalUI:i,refs:s}=e;he({store:t,render:r,globalUI:i,refs:s,emitResult:!0,result:null})},Ya=(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t._event,{index:p,item:l}=o.detail;he({store:r,render:i,globalUI:s,refs:n,emitResult:!0,result:{index:p,item:l}})},Ja=(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t;return rt({store:r,render:i,globalUI:s,refs:n}),r.setAlertConfig(o),i(),it(s)},Za=async(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t;return rt({store:r,render:i,globalUI:s,refs:n}),r.setConfirmConfig(o),i(),it(s)},Xa=async(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t;return rt({store:r,render:i,globalUI:s,refs:n}),r.setDropdownConfig(o),i(),it(s)},Qa=async(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t;rt({store:r,render:i,globalUI:s,refs:n}),r.setFormDialogConfig(o),i();let p=r.selectFormDialogConfig?.().key;return Ma(e,p),it(s)},el=async(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t;rt({store:r,render:i,globalUI:s,refs:n}),r.setComponentDialogConfig(o),i();let p=r.selectComponentDialogConfig?.().key;return Ka(e,p),it(s,{rejectOnError:!0})},tl=(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t._event?.detail??{};o.valid!==!1&&he({store:r,render:i,globalUI:s,refs:n,emitResult:!0,result:o})},rl=(e,t)=>{let{store:r,refs:i}=e,s=t._event?.detail??{},n=r.selectFormDialogConfig?.();typeof n?.onFieldEvent=="function"&&n.onFieldEvent({detail:s,formEl:i.formDialog??null})},il=e=>{let{store:t,render:r,globalUI:i,refs:s}=e;he({store:t,render:r,globalUI:i,refs:s,emitResult:!0})},sl=async(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t._event,p=Number(o?.currentTarget?.dataset?.actionIndex),l=r.selectComponentDialogConfig?.(),a=l?.key,c=Number.isInteger(p)?l?.actions?.buttons?.[p]:null;if(c){if(c.role==="cancel"){he({store:r,render:i,globalUI:s,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(!rr(r,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(!rr(r,a))return;he({store:r,render:i,globalUI:s,refs:n,emitResult:!0,result:{actionId:c.id,values:h}})}catch(d){if(!rr(r,a))return;ms({store:r,render:i,globalUI:s,refs:n,error:d})}}},nl=Object.freeze(Object.defineProperty({__proto__:null,handleCancel:qa,handleCloseAll:il,handleComponentDialogAction:sl,handleConfirm:Ha,handleDialogClose:Ua,handleDropdownClose:Ga,handleDropdownItemClick:Ya,handleFormAction:tl,handleFormFieldEvent:rl,handleShowAlert:Ja,handleShowComponentDialog:el,handleShowConfirm:Za,handleShowDropdownMenu:Xa,handleShowFormDialog:Qa},Symbol.toStringTag,{value:"Module"})),ol=new Set(["sm","md","lg","f"]),al=new Set(["confirm","cancel"]),ll=Object.freeze([{id:"cancel",label:"Cancel",variant:"se",align:"left",role:"cancel"},{id:"confirm",label:"OK",variant:"pr",role:"confirm",validate:!0}]),dr=e=>!e||typeof e!="object"||Array.isArray(e)?{}:e,Re=(e,t="md")=>ol.has(e)?e:t,Or=e=>{let t=(Array.isArray(e?.buttons)&&e.buttons.length>0?e.buttons:ll).map((r,i)=>{if(!r||typeof r!="object"||Array.isArray(r))throw new Error("component dialog buttons must be objects");if(typeof r.id!="string"||r.id.length===0)throw new Error("component dialog button id is required");if(typeof r.label!="string"||r.label.length===0)throw new Error("component dialog button label is required");if(!al.has(r.role))throw new Error("component dialog button role must be 'confirm' or 'cancel'");return{...r,_globalIdx:i,variant:r.variant??(r.role==="confirm"?"pr":"se"),align:r.align??(r.role==="cancel"?"left":"right"),validate:r.role==="confirm"?!!r.validate:!1,_disabled:!!r.disabled,pre:r.pre??"",suf:r.suf??""}});return{_layout:"split",buttons:t,_leftButtons:t.filter(r=>r.align==="left"),_rightButtons:t.filter(r=>r.align!=="left")}},ys=()=>({title:"",description:"",size:"md",component:"",props:{},actions:Or(),key:0}),pl=()=>Object.freeze({isOpen:!1,uiType:"dialog",config:{status:void 0,title:"",message:"",confirmText:"OK",cancelText:"Cancel",mode:"alert"},dropdownConfig:{items:[],x:0,y:0,place:"bs"},formDialogConfig:{form:null,defaultValues:{},context:{},disabled:!1,size:"md",key:0,onFieldEvent:null,mount:null},componentDialogConfig:ys()}),dl=({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},cl=({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},ul=({state:e},t={})=>{if(!t.items||!Array.isArray(t.items))throw new Error("items array is required for showDropdown");e.dropdownConfig={items:t.items,x:t.x??0,y:t.y??0,place:t.place??"bs"},e.uiType="dropdown",e.isOpen=!0},hl=({state:e},t={})=>{if(!t.form||typeof t.form!="object"||Array.isArray(t.form))throw new Error("form object is required for showFormDialog");let r=e.formDialogConfig?.key??0;e.formDialogConfig={form:t.form,defaultValues:dr(t.defaultValues),context:dr(t.context),disabled:!!t.disabled,size:Re(t.size,"md"),key:r+1,onFieldEvent:typeof t.onFieldEvent=="function"?t.onFieldEvent:null,mount:typeof t.mount=="function"?t.mount:null},e.uiType="formDialog",e.isOpen=!0},fl=({state:e},t={})=>{if(typeof t.component!="string"||!t.component.includes("-"))throw new Error("component tag name is required for showComponentDialog");let r=e.componentDialogConfig?.key??0;e.componentDialogConfig={title:typeof t.title=="string"?t.title:"",description:typeof t.description=="string"?t.description:"",size:Re(t.size,"md"),component:t.component,props:dr(t.props),actions:Or(t.actions),key:r+1},e.uiType="componentDialog",e.isOpen=!0},ml=({state:e})=>{e.isOpen=!1,e.uiType="dialog"},yl=({state:e})=>e.config,gl=({state:e})=>e.dropdownConfig,bl=({state:e})=>e.formDialogConfig,vl=({state:e})=>e.componentDialogConfig,wl=({state:e})=>e.uiType,_l=({state:e})=>e.isOpen,xl=({state:e})=>{let t=e.isOpen&&e.uiType==="dialog",r=e.isOpen&&e.uiType==="formDialog",i=e.isOpen&&e.uiType==="componentDialog",s=e.componentDialogConfig??ys();return{isOpen:e.isOpen,uiType:e.uiType,config:e.config,dropdownConfig:{items:e.dropdownConfig?.items??[],x:e.dropdownConfig?.x??0,y:e.dropdownConfig?.y??0,place:e.dropdownConfig?.place??"bs"},formDialogConfig:{form:e.formDialogConfig?.form??{fields:[],actions:{buttons:[]}},defaultValues:e.formDialogConfig?.defaultValues??{},context:e.formDialogConfig?.context??{},disabled:!!e.formDialogConfig?.disabled,size:Re(e.formDialogConfig?.size,"md"),key:e.formDialogConfig?.key??0},componentDialogConfig:{title:s.title??"",description:s.description??"",size:Re(s.size,"md"),component:s.component??"",props:s.props??{},actions:s.actions??Or(),key:s.key??0},isDialogOpen:t,isFormDialogOpen:r,isComponentDialogOpen:i,isDialogContainerOpen:t||r||i,isDropdownOpen:e.isOpen&&e.uiType==="dropdown",dialogSize:i?Re(s.size,"md"):r?Re(e.formDialogConfig?.size,"md"):"sm"}},Sl=Object.freeze(Object.defineProperty({__proto__:null,closeAll:ml,createInitialState:pl,selectComponentDialogConfig:vl,selectConfig:yl,selectDropdownConfig:gl,selectFormDialogConfig:bl,selectIsOpen:_l,selectUiType:wl,selectViewData:xl,setAlertConfig:dl,setComponentDialogConfig:fl,setConfirmConfig:cl,setDropdownConfig:ul,setFormDialogConfig:hl},Symbol.toStringTag,{value:"Module"})),Al=(e,t)=>{let{dispatchEvent:r,store:i}=e;t._event,console.log("handle click start",i.selectPath()),r(new CustomEvent("start-click",{detail:{path:i.selectPath()}}))},El=Object.freeze(Object.defineProperty({__proto__:null,handleClickStart:Al},Symbol.toStringTag,{value:"Module"})),kl=()=>Object.freeze({}),$l=["id","class","style","slot","start"],Cl=(e={})=>Object.entries(e).filter(([t])=>!$l.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Il=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}}}},Ol=({props:e})=>{let t=Il(e.start)||e.start;return{containerAttrString:Cl(e),start:t||{label:"",image:{src:"",width:32,height:32,alt:""}}}},Tl=({props:e})=>e.start?.path,Ll=({state:e})=>{},Nl=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:kl,selectPath:Tl,selectViewData:Ol,setState:Ll},Symbol.toStringTag,{value:"Module"})),Ei=e=>{let t=e.querySelectorAll("h1[id], h2[id], h3[id], h4[id], rtgl-text[id]");return Array.from(t)},Vl=e=>e.map(t=>{let r=1,i=t.tagName.toLowerCase();return i==="h1"?r=1:i==="h2"?r=2:i==="h3"?r=3:i==="h4"?r=4:i==="rtgl-text"&&(r=parseInt(t.getAttribute("data-level")||"1",10)),{id:t.id,href:`#${t.id}`,title:t.textContent,level:r}}),ki=(e,t,r)=>{let{store:i,render:s}=r,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}),s())},Rl=(e,t,r,i)=>{let{store:s,render:n}=i,o=null,p=()=>{o=null;let d=Ei(e);s.setItems({items:Vl(d)}),ki(d,r,i),n()},l=()=>{o===null&&(o=requestAnimationFrame(p))},a=()=>{ki(Ei(e),r,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)}},jl=e=>{let{props:t}=e,r=()=>{};return requestAnimationFrame(()=>{let i=document.getElementById(t.targetId);if(!i)return;let s=window;t.scrollContainerId&&(s=document.getElementById(t.scrollContainerId)||window);let n=parseInt(t.offsetTop||"100",10);r=Rl(i,s,n,e)}),()=>{r()}},Dl=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:jl},Symbol.toStringTag,{value:"Module"})),Pl=()=>Object.freeze({items:[],currentId:null,contentContainer:null}),Bl=({state:e})=>{let t=((r,i)=>{let s=new Set,n=r.findIndex(p=>p.id===i);if(n===-1)return s;let o=r[n].level;for(let p=n-1;p>=0;p--)if(r[p].level<o){let l=r[p].level;s.add(r[p].id);for(let a=p-1;a>=0;a--)r[a].level<l&&(s.add(r[a].id),l=r[a].level);break}return s})(e.items,e.currentId);return{items:e.items.map(r=>{let i={1:"0",2:"12px",3:"24px",4:"32px"},s=r.id===e.currentId,n=t.has(r.id),o=s||n;return{...r,c:o?"fg":"mu-fg",ml:i[r.level]||"",bc:o?"fg":"mu-fg"}}),currentId:e.currentId}},zl=({state:e})=>e,Wl=({state:e})=>e.currentId,Fl=({state:e},t={})=>{e.items=Array.isArray(t.items)?t.items:[]},Ml=({state:e},t={})=>{e.currentId=t.id},Kl=({state:e},t={})=>{e.contentContainer=t.container},Ul=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Pl,selectCurrentId:Wl,selectState:zl,selectViewData:Bl,setContentContainer:Kl,setCurrentId:Ml,setItems:Fl},Symbol.toStringTag,{value:"Module"})),st=e=>e==null||e===!0?"":String(e),gs=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=e,n=st(t);r.setValue({value:n}),r.closePopover({}),s(new CustomEvent("value-change",{detail:{value:n},bubbles:!0})),i()},Hl=e=>{let{store:t,props:r}=e;if(r.value!==void 0){let i=st(r.value);t.setValue({value:i}),t.setTempValue({value:i})}},ql=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n}=e;if(r?.value!==i?.value){let o=st(i?.value);s.setValue({value:o}),s.getState().isOpen||s.setTempValue({value:o})}n()},Gl=(e,t)=>{let{store:r,render:i,refs:s,props:n}=e;if(n.disabled)return;let o=t._event,p=st(n.value);r.setValue({value:p}),r.setTempValue({value:p}),r.openPopover({position:{x:o.currentTarget.getBoundingClientRect().left,y:o.currentTarget.getBoundingClientRect().bottom}}),i(),setTimeout(()=>{let{input:l}=s;if(!l)return;l.value=p,l.focus();let a=l.shadowRoot?.querySelector("input, textarea");a&&typeof a.focus=="function"&&a.focus()},50)},Yl=(e,t)=>{let{store:r,render:i}=e;r.closePopover({}),i()},Jl=(e,t)=>{let{store:r}=e,i=t._event,s=st(i.detail.value);r.setTempValue({value:s})},Zl=e=>{let{store:t,refs:r}=e,{input:i}=r,s=i?i.value:t.getState().tempValue;gs(e,s)},Xl=(e,t)=>{let{store:r,refs:i}=e,s=t._event;if(s.key==="Enter"){s.preventDefault(),s.stopPropagation();let{input:n}=i,o=n?n.value:r.getState().tempValue;gs(e,o)}else s.key==="Escape"&&(s.preventDefault(),s.stopPropagation(),r.closePopover({}),e.render())},Ql=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Hl,handleInputChange:Jl,handleInputKeydown:Xl,handleOnUpdate:ql,handlePopoverClose:Yl,handleSubmitClick:Zl,handleTextClick:Gl},Symbol.toStringTag,{value:"Module"})),ep=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),tp=({props:e,state:t})=>{let r=typeof t.value=="string"&&t.value.length>0,i=r?t.value:"-",s=typeof e.placeholder=="string"?e.placeholder:"",n=typeof e.label=="string"?e.label:"",o=!!e.disabled;return{isOpen:t.isOpen,position:t.position,value:i,valueColor:r?"fg":"mu-fg",tempValue:t.tempValue,placeholder:s,label:n,disabled:o}},rp=({state:e},t={})=>{e.tempValue=t.value},ip=({state:e},t={})=>{let{position:r}=t;e.position=r,e.isOpen=!0,e.hasUnsavedChanges=!1},sp=({state:e})=>{e.isOpen=!1,e.tempValue=""},np=({state:e},t={})=>{e.value=t.value},op=({state:e})=>e.value,ap=Object.freeze(Object.defineProperty({__proto__:null,closePopover:sp,createInitialState:ep,openPopover:ip,selectValue:op,selectViewData:tp,setTempValue:rp,setValue:np},Symbol.toStringTag,{value:"Module"})),be=(e,t)=>{if(e===t)return!0;if(e==null||t==null||typeof e!="object"||typeof t!="object")return!1;let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let s of r)if(!i.includes(s)||!be(e[s],t[s]))return!1;return!0},$i=({dispatchEvent:e,value:t,label:r,index:i,item:s})=>{e(new CustomEvent("value-change",{detail:{value:t,label:r,index:i,item:s},bubbles:!0}))},lp=e=>{let{store:t,props:r,render:i}=e;if(r.selectedValue!==null&&r.selectedValue!==void 0&&r.options){let s=r.options.find(n=>be(n.value,r.selectedValue));s&&(t.updateSelectedValue({value:s.value}),i())}},pp=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n}=e,o=!1;r.selectedValue!==i.selectedValue&&(s.updateSelectedValue({value:i.selectedValue}),o=!0),o&&n()},bs=(e,t)=>{let{render:r,dispatchEvent:i,props:s,store:n}=e;if(s.disabled)return;let o=t._event;o.stopPropagation();let p=o.currentTarget.id.slice(6),l=Number(p),a=s.options[l],c=Object.prototype.hasOwnProperty.call(s||{},"selectedValue"),d=n.selectSelectedValue(),h=c?!0:n.selectHasSelectedValue(),f=a?h&&be(a.value,d):!1;if(a){if(f&&!s.noClear){n.clearSelectedValue({}),s.onChange&&typeof s.onChange=="function"&&s.onChange(void 0),$i({dispatchEvent:i,value:void 0,label:void 0,index:null,item:void 0}),r();return}n.updateSelectedValue({value:a.value}),s.onChange&&typeof s.onChange=="function"&&s.onChange(a.value),$i({dispatchEvent:i,value:a.value,label:a.label,index:l,item:a}),r()}},dp=(e,t)=>{let r=t._event;r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),bs(e,t))},cp=(e,t)=>{let{store:r,render:i}=e,s=t._event,n=parseInt(s.currentTarget.id.slice(6),10);r.setHoveredOption({optionId:n}),i()},up=e=>{let{store:t,render:r}=e;t.clearHoveredOption({}),r()},vs=(e,t)=>{if(e.props.disabled)return;let{render:r,dispatchEvent:i}=e,{_event:s}=t;s.stopPropagation(),i(new CustomEvent("add-option-click",{bubbles:!0})),r()},hp=(e,t)=>{let r=t._event;r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),vs(e,t))},fp=e=>{let{store:t,render:r}=e;t.setHoveredAddOption({isHovered:!0}),r()},mp=e=>{let{store:t,render:r}=e;t.setHoveredAddOption({isHovered:!1}),r()},yp=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:vs,handleAddOptionKeyDown:hp,handleAddOptionMouseEnter:fp,handleAddOptionMouseLeave:mp,handleBeforeMount:lp,handleOnUpdate:pp,handleOptionClick:bs,handleOptionKeyDown:dp,handleOptionMouseEnter:cp,handleOptionMouseLeave:up},Symbol.toStringTag,{value:"Module"})),gp=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],bp=(e={})=>Object.entries(e).filter(([t])=>!gp.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),vp=()=>Object.freeze({selectedValue:null,hasSelectedValue:!1,hoveredOptionId:null,hoveredAddOption:!1}),wp=({state:e,props:t})=>{let r=bp(t),i=!!t.disabled,s=Object.prototype.hasOwnProperty.call(t||{},"selectedValue"),n=s?t.selectedValue:e.selectedValue,o=s?!0:!!e.hasSelectedValue,p=t.options||[],l=p.map((a,c)=>{let d=o&&be(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:r,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"}},_p=({state:e})=>e,xp=({state:e})=>e.selectedValue,Sp=({state:e})=>!!e.hasSelectedValue,Ap=({state:e},t={})=>{e.selectedValue=t.value,e.hasSelectedValue=!0},Ep=({state:e})=>{e.selectedValue=void 0,e.hasSelectedValue=!1},kp=({state:e},t={})=>{e.hoveredOptionId=t.optionId},$p=({state:e})=>{e.hoveredOptionId=null},Cp=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},Ip=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:$p,clearSelectedValue:Ep,createInitialState:vp,selectHasSelectedValue:Sp,selectSelectedValue:xp,selectState:_p,selectViewData:wp,setHoveredAddOption:Cp,setHoveredOption:kp,updateSelectedValue:Ap},Symbol.toStringTag,{value:"Module"})),Op=e=>{let{store:t,props:r,render:i}=e;if(r.selectedValue!==null&&r.selectedValue!==void 0&&r.options){let s=r.options.find(n=>be(n.value,r.selectedValue));s&&(t.updateSelectedValue({value:s?.value}),i())}},Tp=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n}=e,o=!1;i?.disabled&&!r?.disabled&&(s.closeOptionsPopover({}),o=!0),r.selectedValue!==i.selectedValue&&(s.updateSelectedValue({value:i.selectedValue}),o=!0),o&&n()},ws=(e,t)=>{let{store:r,render:i,refs:s,props:n}=e;if(n.disabled)return;t._event.stopPropagation();let o=s.selectButton.getBoundingClientRect(),p=r.selectSelectedValue(),l=p!==null?p:n.selectedValue,a=null;l!=null&&n.options&&(a=n.options.findIndex(c=>be(c.value,l)),a===-1&&(a=null)),r.openOptionsPopover({position:{y:o.bottom+12,x:o.left-24},selectedIndex:a}),i()},Lp=(e,t)=>{let r=t._event;r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),ws(e,t))},Np=e=>{let{store:t,render:r}=e;t.closeOptionsPopover({}),r()},Vp=(e,t)=>{let{render:r,dispatchEvent:i,props:s,store:n}=e;if(s.disabled)return;let o=t._event;o.stopPropagation();let p=o.currentTarget.id.slice(6),l=Number(p),a=s.options[p];n.updateSelectedValue({value:a?.value}),s.onChange&&typeof s.onChange=="function"&&s.onChange(a.value),i(new CustomEvent("value-change",{detail:{value:a.value,label:a.label,index:l,item:a},bubbles:!0})),r()},Rp=(e,t)=>{let{store:r,render:i}=e,s=t._event,n=parseInt(s.currentTarget.id.slice(6),10);r.setHoveredOption({optionId:n}),i()},jp=(e,t)=>{let{store:r,render:i}=e;r.clearHoveredOption({}),i()},Dp=(e,t)=>{let{store:r,render:i,dispatchEvent:s,props:n}=e;n.disabled||(t._event.stopPropagation(),r.clearSelectedValue({}),n.onChange&&typeof n.onChange=="function"&&n.onChange(void 0),s(new CustomEvent("value-change",{detail:{value:void 0,label:void 0,index:null,item:void 0},bubbles:!0})),i())},Pp=(e,t)=>{if(e.props.disabled)return;let{store:r,render:i,dispatchEvent:s}=e,{_event:n}=t;n.stopPropagation(),r.closeOptionsPopover({}),s(new CustomEvent("add-option-click",{bubbles:!0})),i()},Bp=(e,t)=>{let{store:r,render:i}=e;r.setHoveredAddOption({isHovered:!0}),i()},zp=(e,t)=>{let{store:r,render:i}=e;r.setHoveredAddOption({isHovered:!1}),i()},Wp=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:Pp,handleAddOptionMouseEnter:Bp,handleAddOptionMouseLeave:zp,handleBeforeMount:Op,handleButtonClick:ws,handleButtonKeyDown:Lp,handleClearClick:Dp,handleClickOptionsPopoverOverlay:Np,handleOnUpdate:Tp,handleOptionClick:Vp,handleOptionMouseEnter:Rp,handleOptionMouseLeave:jp},Symbol.toStringTag,{value:"Module"})),Fp=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],Mp=(e={})=>Object.entries(e).filter(([t])=>!Fp.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Kp=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,hoveredOptionId:null,hoveredAddOption:!1}),Up=({state:e,props:t})=>{let r=Mp(t),i=!!t.disabled,s=Object.prototype.hasOwnProperty.call(t||{},"selectedValue")?t.selectedValue:e.selectedValue,n=t.placeholder||"Select an option",o=!0,p=t.options||[],l=p.find(c=>be(c.value,s));l&&(n=l.label,o=!1);let a=p.map((c,d)=>{let h=be(c.value,s),f=e.hoveredOptionId===d;return{...c,isSelected:h,bgc:f?"ac":h?"mu":""}});return{containerAttrString:r,isDisabled:i,isOpen:e.isOpen,position:e.position,options:a,selectedValue:s,selectedLabel:n,selectedLabelColor:o?"mu-fg":"fg",selectButtonCursor:i?"not-allowed":"pointer",selectButtonHoverBorderColor:i?"bo":"ac",selectButtonTabIndex:i?-1:0,hasValue:s!=null,showClear:!i&&!t.noClear&&s!=null,showAddOption:!i&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"ac":""}},Hp=({state:e})=>e,qp=({state:e})=>e.selectedValue,Gp=({state:e},t={})=>{let{position:r,selectedIndex:i}=t;e.position=r,e.isOpen=!0,i!=null&&(e.hoveredOptionId=i)},Yp=({state:e})=>{e.isOpen=!1},Jp=({state:e},t={})=>{e.selectedValue=t.value,e.isOpen=!1},Zp=({state:e})=>{e.selectedValue=void 0},Xp=({state:e},t={})=>{e.hoveredOptionId=t.optionId},Qp=({state:e})=>{e.hoveredOptionId=null},ed=({state:e})=>{e.selectedValue=void 0},td=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},rd=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:Qp,clearSelectedValue:ed,closeOptionsPopover:Yp,createInitialState:Kp,openOptionsPopover:Gp,resetSelection:Zp,selectSelectedValue:qp,selectState:Hp,selectViewData:Up,setHoveredAddOption:td,setHoveredOption:Xp,updateSelectedValue:Jp},Symbol.toStringTag,{value:"Module"})),Ci=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},id=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?Ci(e.tooltip):Ci(e.showCompactTooltip),sd=(e,t)=>{let{store:r,dispatchEvent:i}=e,s=t._event,n,o=r.selectHeader();s.currentTarget.id==="headerLabel"?n=o.labelPath:s.currentTarget.id==="headerImage"?n=o.image.path:s.currentTarget.id==="header"&&(n=o.path),i(new CustomEvent("header-click",{detail:{path:n},bubbles:!0,composed:!0}))},nd=(e,t)=>{let{store:r,dispatchEvent:i,render:s}=e,n=t._event,o=n.currentTarget.dataset.itemId||n.currentTarget.id.slice(4),p=r.selectItem(o);r.hideTooltip({}),s(),i(new CustomEvent("item-click",{detail:{item:p},bubbles:!0,composed:!0}))},od=(e,t)=>{let{props:r,store:i,render:s}=e;if(!id(r)||(r.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}),s())},ad=e=>{let{store:t,render:r}=e;t.hideTooltip({}),r()},ld=Object.freeze(Object.defineProperty({__proto__:null,handleHeaderClick:sd,handleItemClick:nd,handleItemMouseEnter:od,handleItemMouseLeave:ad},Symbol.toStringTag,{value:"Module"})),pd=()=>Object.freeze({tooltipState:{open:!1,x:0,y:0,place:"r",content:""}}),dd=["id","class","style","slot","header","items","selectedItemId","mode","hideHeader","tooltip","showCompactTooltip","w","bwr"],cd=(e={})=>Object.entries(e).filter(([t])=>!dd.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Je=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}}}},cr=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},ud=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?cr(e.tooltip):cr(e.showCompactTooltip),hd=(e,t)=>e!=null&&e!==""?e:t==="full"?272:64,Ii=(e={})=>e.label!==void 0&&e.label!==null?e.label:e.title!==void 0&&e.title!==null?e.title:"";function Tr(e,t=null){let r=[];for(let i of e){let s=i.id||i.href||i.path,n=s!=null&&t===s,o=Ii(i);if(r.push({id:s,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=Ii(p);r.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 r}var fd=({state:e,props:t})=>{let r=Je(t.header)||t.header,i=Je(t.items)||t.items,s=t.selectedItemId,n=cd(t),o=t.mode||"full",p=r||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},l=i?Tr(i,s):[],a=!cr(t.hideHeader),c=ud(t),d=t.bwr||"xs",h=hd(t.w,o),f=o==="full"?"fs":"c",u=o==="full"?"fs":"c",m=o==="full"?"lg":"sm",y=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}`,N=o==="full"?"f":b;return{containerAttrString:n,mode:o,header:p,items:l,sidebarWidth:h,headerAlign:f,itemAlign:u,headerPadding:m,itemPadding:y,itemHeight:b,iconSize:g,firstLetterSize:_,showLabels:S,showGroupLabels:A,itemContentAlign:C,itemAlignAttr:I,itemWidth:N,headerWidth:N,selectedItemId:s,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:""}}},md=({props:e})=>Je(e.header)||e.header,yd=({state:e,props:t})=>{let r=Je(t.items)||t.items;return(r?Tr(r):[]).find(i=>i.active)},gd=({props:e},t)=>{let r=Je(e.items)||e.items;return(r?Tr(r):[]).find(i=>i.id===t)},bd=({state:e})=>{},vd=({state:e},t={})=>{let{x:r,y:i,place:s="r",content:n=""}=t;e.tooltipState={open:!0,x:r,y:i,place:s,content:n}},wd=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},_d=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:pd,hideTooltip:wd,selectActiveItem:yd,selectHeader:md,selectItem:gd,selectViewData:fd,setState:bd,showTooltip:vd},Symbol.toStringTag,{value:"Module"})),xd=e=>{let{store:t,props:r}=e;t.setValue({value:r.value??0})},Sd=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n}=e,o=r?.key!==i?.key,p=r?.value!==i?.value;if(o||p){let l=i?.value??0;s.setValue({value:l}),n()}},Ad=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=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;r.setValue({value:o}),p&&typeof p.setAttribute=="function"&&p.setAttribute("value",String(o)),i(),s(new CustomEvent("value-change",{detail:{value:o},bubbles:!0}))},Ed=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=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;r.setValue({value:o}),p&&typeof p.setAttribute=="function"&&p.setAttribute("value",String(o)),i(),s(new CustomEvent("value-input",{detail:{value:o},bubbles:!0}))},kd=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:xd,handleOnUpdate:Sd,handleValueChange:Ad,handleValueInput:Ed},Symbol.toStringTag,{value:"Module"})),$d=()=>Object.freeze({value:0}),Cd=({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}),Id=({state:e},t={})=>{e.value=t.value},Od=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:$d,selectViewData:Cd,setValue:Id},Symbol.toStringTag,{value:"Module"})),Td=e=>{},Ld=(e,t)=>{let{dispatchEvent:r,props:i}=e,s=t._event,n=parseInt(s.currentTarget.id.slice(3),10),o=i.data?.rows?.[n];o&&r(new CustomEvent("row-click",{detail:{rowIndex:n,rowData:o}}))},Nd=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=e,n=t._event.currentTarget.dataset.columnKey,o=r.selectSortInfo(),p="asc";o.column===n&&(o.direction==="asc"?p="desc":o.direction==="desc"&&(p=null)),p?r.setSortColumn({column:n,direction:p}):r.clearSort(),i(),s(new CustomEvent("header-click",{detail:{column:n,direction:p,sortInfo:p?{column:n,direction:p}:null}}))},Vd=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Td,handleHeaderClick:Nd,handleRowClick:Ld},Symbol.toStringTag,{value:"Module"})),Rd=()=>Object.freeze({sortColumn:null,sortDirection:null}),jd=["id","class","style","slot","data"],Dd=(e={})=>Object.entries(e).filter(([t])=>!jd.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Pd=(e,t)=>{let r=t.split("."),i=e;for(let s of r){if(i==null)return null;i=i[s]}return i},Bd=({state:e,props:t})=>{let r=Dd(t),i=t.data||{columns:[],rows:[]},s=i.rows.map((n,o)=>{let p=i.columns.map(l=>{let a=Pd(n,l.key);return{key:l.key,value:a!=null?String(a):""}});return{index:o,cells:p}});return{containerAttrString:r,columns:i.columns||[],rows:s||[]}},zd=({state:e})=>e,Wd=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),Fd=({state:e},{column:t,direction:r}={})=>{e.sortColumn=t,e.sortDirection=r},Md=({state:e})=>{e.sortColumn=null,e.sortDirection=null},Kd=Object.freeze(Object.defineProperty({__proto__:null,clearSort:Md,createInitialState:Rd,selectSortInfo:Wd,selectState:zd,selectViewData:Bd,setSortColumn:Fd},Symbol.toStringTag,{value:"Module"})),Ud=(e,t)=>{let{dispatchEvent:r}=e,i=t._event.currentTarget.dataset.id;r(new CustomEvent("item-click",{detail:{id:i}}))},Hd=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:Ud},Symbol.toStringTag,{value:"Module"})),qd=()=>Object.freeze({}),Gd=["id","class","style","slot","items","selectedTab"],Yd=(e={})=>Object.entries(e).filter(([t])=>!Gd.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Jd=({props:e})=>{let t=Yd(e),r=e.items||[],i=e.selectedTab,s=r.map(n=>({...n,isSelected:n.id===i,bgColor:n.id===i?"ac":"",borderColor:n.id===i?"":"tr",textColor:n.id===i?"":"mu-fg"}));return{containerAttrString:t,items:s,selectedTab:i}},Zd=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:qd,selectViewData:Jd},Symbol.toStringTag,{value:"Module"})),Xd=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Qd=()=>Object.freeze({}),Oi={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))"}},ec=({props:e})=>{let t=Oi[e.s]?e.s:"sm",r=Oi[t];return{open:!!e.open,x:e.x||0,y:e.y||0,place:e.place||"t",content:e.content||"",textSize:r.textSize,padding:r.padding,contentStyle:`padding: 0; min-width: 0; max-width: ${r.maxWidth};`}},tc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Qd,selectViewData:ec},Symbol.toStringTag,{value:"Module"})),rc=async e=>{let{props:t,store:r,render:i,refs:s}=e,{waveformData:n}=t;r.setWaveformData({data:n}),i();let o=s.canvas;o&&_s(n,o)},ic=async(e,t)=>{let{store:r,render:i,refs:s,props:n}=e,{waveformData:o}=n;if(!o){console.log("waveform handleOnUpdate: no waveformData provided");return}r.setWaveformData({data:o}),i();let p=s.canvas;p&&_s(o,p)};async function _s(e,t){let r=t.getContext("2d"),i=t.getBoundingClientRect(),s=i.width,n=i.height;t.width=s,t.height=n;let o=t.width,p=t.height;if(r.clearRect(0,0,o,p),r.fillStyle="#1a1a1a",r.fillRect(0,0,o,p),!e||!e.amplitudes)return;let l=e.amplitudes,a=p/2,c=r.createLinearGradient(0,0,0,p);c.addColorStop(0,"#404040"),c.addColorStop(.5,"#A1A1A1"),c.addColorStop(1,"#404040");let d=Math.max(1,o/l.length),h=.2;for(let f=0;f<l.length;f++){let u=l[f]/255*(p*.85),m=f*d,y=a-u/2;r.fillStyle=c,r.fillRect(m,y,Math.max(1,d*(1-h)),u)}r.strokeStyle="rgba(255, 255, 255, 0.1)",r.lineWidth=1,r.beginPath(),r.moveTo(0,a),r.lineTo(o,a),r.stroke(),r.shadowBlur=10,r.shadowColor="#2196F3"}var sc=Object.freeze(Object.defineProperty({__proto__:null,handleAfterMount:rc,handleOnUpdate:ic},Symbol.toStringTag,{value:"Module"})),nc=()=>Object.freeze({waveformData:null}),oc=({state:e},t={})=>{e.waveformData=t.data},ac=({state:e,props:t})=>({isLoading:t.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:t.waveformData}),lc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:nc,selectViewData:ac,setWaveformData:oc},Symbol.toStringTag,{value:"Module"})),xs=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ss=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase()),ur=e=>{if(e!=null)return e===""?!0:e},mt=(e,t)=>{let r=e.getAttribute(t);if(r!==null)return ur(r);let i=xs(t);if(i!==t){let s=e.getAttribute(i);if(s!==null)return ur(s)}},ir=Symbol("rtglReactivePropValues"),pc=e=>(Object.prototype.hasOwnProperty.call(e,ir)||Object.defineProperty(e,ir,{value:Object.create(null),enumerable:!1,configurable:!1,writable:!1}),e[ir]),dc=({source:e,allowedKeys:t=[],onPropChange:r})=>{let i=pc(e);t.forEach(s=>{if(typeof s!="string"||s.length===0)return;let n=Object.prototype.hasOwnProperty.call(e,s)?e[s]:void 0,o=Object.prototype.hasOwnProperty.call(e,s);o&&delete e[s],Object.defineProperty(e,s,{configurable:!0,enumerable:!0,get(){return Object.prototype.hasOwnProperty.call(i,s)?i[s]:mt(e,s)},set(p){let l=Object.prototype.hasOwnProperty.call(i,s)?i[s]:mt(e,s);p===void 0?delete i[s]:i[s]=p,l!==p&&r?.({propName:s,oldValue:l,newValue:p})}}),o&&(i[s]=n)})},cc=(e,t)=>{let r=new Set(t);return new Proxy({},{get(i,s){if(typeof s=="string"&&r.has(s)){let n=e[s];return n!==void 0?n:mt(e,s)}},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(i,s){return typeof s=="string"&&r.has(s)},ownKeys(){return[...r]},getOwnPropertyDescriptor(i,s){if(typeof s=="string"&&r.has(s))return{configurable:!0,enumerable:!0,get:()=>{let n=e[s];return n!==void 0?n:mt(e,s)}}}})},uc=({schema:e,methodExports:t=[]})=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("componentName is required.");if(typeof e.componentName!="string"||e.componentName.trim()==="")throw new Error("componentName is required.");if(Object.prototype.hasOwnProperty.call(e,"attrsSchema"))throw new Error("attrsSchema is not supported.");if(Object.prototype.hasOwnProperty.call(e,"methods")){let r=e.methods;if(!r||typeof r!="object"||Array.isArray(r))throw new Error("methods must be an object schema with a properties map.");if(Object.prototype.hasOwnProperty.call(r,"type")&&r.type!=="object")throw new Error("methods.type must be 'object'.");if(!r.properties||typeof r.properties!="object"||Array.isArray(r.properties))throw new Error("methods.properties must be an object keyed by method name.");for(let i of Object.keys(r.properties))if(!t.includes(i))throw new Error(`method '${i}' is declared in schema but missing in .methods.js exports.`)}return!0},v={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9,PARTIAL:10,PATH_REFERENCE:11},P={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},hr={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"}},Ti=e=>{if(!e||e.trim()==="")throw new k("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new k(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${r}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let r of t)if(e.trim().endsWith(r))throw new k(`Incomplete comparison expression - missing right operand (got: '${e}')`)},hc=e=>{if(e.trim().endsWith(" in"))throw new k(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new k(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new k(`Missing iterable expression after 'in' (got: '$for ${e}')`);let i=t.includes(",")?t.split(",").map(s=>s.trim()):[t.trim()];for(let s of i){if(!s)throw new k(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(s))throw new k(`Invalid loop syntax (got: '$for ${e}')`)}},fc=(e,t,r=!1)=>{if(t===null)return new ie(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new ie(`Cannot iterate over undefined value at '$for ${e}'`);let i=typeof t;return r?new ie(`Cannot iterate over non-array value in loop '${e}' - got ${i} instead`):new ie(`Cannot iterate over non-array value (got: ${i}) at '$for ${e}'`)},mc=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new ie(`Unknown function '${e}' (${r})`)},As=(e,t,r={})=>{let i={},s={};r&&typeof r=="object"&&(r.functions!==void 0||r.partials!==void 0?(i=r.functions||{},s=r.partials||{}):typeof r=="object"&&(i=r));let n=R(e,{functions:i,partials:s},t,{});return n===void 0?{}:n},R=(e,t,r,i)=>{if(t.functions,e.var&&!e.type)return U(e.var,r,i);if(e.type===v.LITERAL)return e.value;if(e.type===v.VARIABLE)return U(e.path,r,i);if(e.type===v.INTERPOLATION)return gc(e.parts,t,r,i);switch(e.type){case v.FUNCTION:return Es(e,t,r,i);case v.BINARY:return ks(e,t,r,i);case v.UNARY:return $s(e,t,r,i);case v.CONDITIONAL:return vc(e,t,r,i);case v.LOOP:return Ac(e,t,r,i);case v.OBJECT:return kc(e,t,r,i);case v.ARRAY:return $c(e,t,r,i);case v.PARTIAL:return Cc(e,t,r,i);case v.PATH_REFERENCE:return Ic(e,t,r,i);default:throw new Error(`Unknown node type: ${e.type}`)}},Li=new Map,yc=e=>{let t=[],r="",i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(n==="[")r&&(t.push({type:"property",value:r}),r=""),i=!0;else if(n==="]"){if(i&&r){let o=r.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});r=""}i=!1}else r+=n}return r&&t.push({type:"property",value:r}),t},U=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let i=Li.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=yc(l.trim());i.push(...a)}Li.set(e,i)}let s=t;for(let n=0;n<i.length;n++){let o=i[n];if(o.type==="property"&&o.value in r){s=r[o.value];continue}if(s==null)return;(o.type==="property"||o.type==="index")&&(s=s[o.value])}return s},gc=(e,t,r,i)=>{let s=[];for(let n of e)if(typeof n=="string")s.push(n);else{let o=R(n,t,r,i);s.push(o!=null?String(o):"")}return s.join("")},Es=(e,t,r,i)=>{let s=t.functions||t,n=s[e.name];if(!n)throw mc(e.name,s);let o=e.args.map(p=>R(p,t,r,i));return n(...o)},De=(e,t,r,i)=>{if(e.var&&!e.type)return U(e.var,r,i);switch(e.type){case v.VARIABLE:return U(e.path,r,i);case v.LITERAL:return e.value;case v.BINARY:return ks(e,t,r,i);case v.UNARY:return $s(e,t,r,i);case v.FUNCTION:return Es(e,t,r,i);default:return R(e,t,r,i)}},ks=(e,t,r,i)=>{if(e.op===P.AND||e.op===P.OR){let o=De(e.left,t,r,i),p=De(e.right,t,r,i);switch(e.op){case P.AND:return o&&p;case P.OR:return o||p}}let s=R(e.left,t,r,i),n=R(e.right,t,r,i);switch(e.op){case P.EQ:return s==n;case P.NEQ:return s!=n;case P.GT:return s>n;case P.LT:return s<n;case P.GTE:return s>=n;case P.LTE:return s<=n;case P.IN:return Array.isArray(n)?n.includes(s):!1;case P.ADD:if(typeof s!="number"||typeof n!="number")throw new ie(`Arithmetic operations require numbers. Got ${typeof s} + ${typeof n}`);return s+n;case P.SUBTRACT:if(typeof s!="number"||typeof n!="number")throw new ie(`Arithmetic operations require numbers. Got ${typeof s} - ${typeof n}`);return s-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},$s=(e,t,r,i)=>{let s=e.op===hr.NOT?De(e.operand,t,r,i):R(e.operand,t,r,i);switch(e.op){case hr.NOT:return!s;default:throw new Error(`Unknown unary operator: ${e.op}`)}},bc=(e,t,r,i)=>{if(e.conditions.length===2&&e.conditions[1]===null){let s=e.conditions[0];if(s.type===v.VARIABLE)if(U(s.path,r,i)){let n=e.bodies[0];if(n.type===v.OBJECT&&n.properties.length<=5){let o={};for(let p of n.properties){let l=p.parsedKey?R(p.parsedKey,t,r,i):p.key,a=p.value;if(a.type===v.LITERAL)o[l]=a.value;else if(a.type===v.VARIABLE)o[l]=U(a.path,r,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=U(d.path,r,i);c.push(h!=null?String(h):"")}else{let h=R(d,t,r,i);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=R(a,t,r,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?R(p.parsedKey,t,r,i):p.key,a=p.value;if(a.type===v.LITERAL)o[l]=a.value;else if(a.type===v.VARIABLE)o[l]=U(a.path,r,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=U(d.path,r,i);c.push(h!=null?String(h):"")}else{let h=R(d,t,r,i);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=R(a,t,r,i)}return o}}}return null},vc=(e,t,r,i)=>{let s=bc(e,t,r,i);if(s!==null)return s;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||De(o,t,r,i))return R(e.bodies[n],t,r,i)}return Cs},wc=(e,t)=>{let r=e.body,i=e.itemVar;if(r.type===v.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===v.VARIABLE){let s=r.conditions[0].path,n=r.bodies[0];if(s.startsWith(i+".")){let o=s.substring(i.length+1);if(n.type===v.OBJECT&&n.properties.length<=5){for(let l of n.properties)if(l.parsedKey)return null;let p=[];for(let l=0;l<t.length;l++){let 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 m=u.substring(i.length+1);c[h]=a[m]}else return null}else if(f.type===v.INTERPOLATION){let u=[],m=!0;for(let y of f.parts)if(typeof y=="string")u.push(y);else if(y.type===v.VARIABLE){let b=y.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{m=!1;break}}else{m=!1;break}if(!m)return null;c[h]=u.join("")}else return null}p.push(c)}}return p}}}return null},_c=(e,t)=>{let r=e.body,i=e.itemVar,s=wc(e,t);if(s!==null)return s;if(r.type===v.OBJECT&&r.properties.length<=5&&!r.whenCondition){for(let p of r.properties)if(p.parsedKey)return null;let n=[],o=!0;for(let p of r.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},xc=(e,t,r,i,s)=>{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<s.length;a++){let c=s[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("."),m=u[0];m in i.__paths__&&(f=i.__paths__[m],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 m=u.parsedKey?R(u.parsedKey,t,r,h):u.key,y=u.value;if(y.type===v.LITERAL)d[m]=y.value;else if(y.type===v.VARIABLE){let b=y.path;if(b===p)d[m]=c;else if(b===l)d[m]=a;else if(b.startsWith(p+".")){let g=b.substring(p.length+1);!g.includes(".")&&!g.includes("[")?d[m]=c[g]:d[m]=U(b,r,{...i,[p]:c,...l&&{[l]:a}})}else d[m]=U(b,r,{...i,[p]:c,...l&&{[l]:a}})}else if(y.type===v.INTERPOLATION){let b=[];for(let g of y.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=g.path,S;if(_===p)S=c;else if(_===l)S=a;else if(_.startsWith(p+".")){let A=_.substring(p.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=U(_,r,{...i,[p]:c,...l&&{[l]:a}})}else S=U(_,r,{...i,[p]:c,...l&&{[l]:a}});b.push(S!=null?String(S):"")}else{let _={...i,[p]:c,...l&&{[l]:a}},S=R(g,t,r,_);b.push(S!=null?String(S):"")}d[m]=b.join("")}else{let b={...i,[p]:c,...l&&{[l]:a}};d[m]=R(y,t,r,b)}}n.push(d)}return n}return null},Sc=(e,t,r)=>{let i=e.body;if(i.type===v.OBJECT&&i.properties.length===1&&i.properties[0].key==="$if item.visible"){let s=i.properties[0].value;if(s.type===v.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===v.VARIABLE&&s.conditions[0].path==="item.visible"){let n=s.bodies[0];if(n.type===v.OBJECT&&n.properties.length===2){let 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},Ac=(e,t,r,i)=>{let s=R(e.iterable,t,r,i);if(!Array.isArray(s)){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 fc(d,s,c)}if(!e.indexVar){let a=Sc(e,s,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=_c(e,s);if(a!==null)return a}let n=xc(e,t,r,i,s);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<s.length;a++){let c=e.indexVar?{...i,[e.itemVar]:s[a],[e.indexVar]:a}:{...i,[e.itemVar]:s[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,r,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},Ec=(e,t,r,i)=>{if(e.whenCondition)return null;if(e.properties.length===1){let s=e.properties[0],n=s.parsedKey?R(s.parsedKey,t,r,i):s.key,o=s.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?R(c.parsedKey,t,r,i):c.key,h=c.value;if(h.type===v.LITERAL)l[d]=h.value;else if(h.type===v.VARIABLE)l[d]=U(h.path,r,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 m=U(u.path,r,i);f.push(m!=null?String(m):"")}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 m=u.key,y=u.value;if(y.type===v.LITERAL)f[m]=y.value;else if(y.type===v.VARIABLE)f[m]=U(y.path,r,i);else if(y.type===v.INTERPOLATION){let b=[];for(let g of y.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=U(g.path,r,i);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[m]=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},kc=(e,t,r,i)=>{let s=t.functions||t;if(e.whenCondition&&!De(e.whenCondition,s,r,i))return;let n=Ec(e,t,r,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,r,i):a.key,d=a.value;if(d.type===v.LITERAL)l[c]=d.value;else if(d.type===v.VARIABLE)l[c]=U(d.path,r,i);else if(d.type===v.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===v.VARIABLE){let u=U(f.path,r,i);h.push(u!=null?String(u):"")}else{let u=R(f,t,r,i);h.push(u!=null?String(u):"")}l[c]=h.join("")}else l[c]=R(d,t,r,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,r,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,r,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=R(c.value,t,r,i);d!==void 0&&(o[l.key]=d)}else{let d=R(l.value,t,r,i);d!==void 0&&(o[l.key]=d)}}else{let c=l.parsedKey?R(l.parsedKey,t,r,i):l.key,d=R(l.value,t,r,i);d!==void 0&&(o[c]=d)}}return o},Cs={},$c=(e,t,r,i)=>{let s=[];for(let n of e.items)if(n.type===v.LOOP){let o=R(n,t,r,i);Array.isArray(o)&&n.flatten!==!1?s.push(...o):s.push(o)}else{let o=R(n,t,r,i);o!==Cs&&o!==void 0&&s.push(o)}return s},Cc=(e,t,r,i)=>{let{name:s,data:n,whenCondition:o}=e,p=t.partials||{},l=t.functions||t;if(o&&!De(o,l,r,i))return;if(!p[s])throw new ie(`Partial '${s}' is not defined`);let a=i._partialStack||[];if(a.includes(s))throw new ie(`Circular partial reference detected: ${s}`);let c=p[s],d=r,h={...i,_partialStack:[...a,s]};if(i){d={...r};for(let f of Object.keys(i))f.startsWith("_")||(d[f]=i[f])}if(n){let f=R(n,t,r,i);d={...d,...f}}return R(c,t,d,h)},Ic=(e,t,r,i)=>{let{path:s}=e,n=s.split("."),o=n[0],p=n.slice(1);if(!i||!(o in i))throw new ie(`Path reference '#{${s}}' 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 '#{${s}}' 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 '#{${s}}' - cannot access properties on index variable '${o}'`);return String(l)}return p.length>0&&(l+="."+p.join(".")),l},Oc=/\$\{([^}]*)\}/g,Tc=/#\{([^}]*)\}/g,Is=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,i,s]=r,n=Lc(s,t);return{isFunction:!0,type:v.FUNCTION,name:i,args:n}},Lc=(e,t={})=>e.trim()?Nc(e).map(r=>Vc(r.trim(),t)):[],Nc=e=>{let t=[],r="",i=0,s=!1,n="";for(let o=0;o<e.length;o++){let p=e[o],l=o>0?e[o-1]:"";!s&&(p==='"'||p==="'")?(s=!0,n=p,r+=p):s&&p===n&&l!=="\\"?(s=!1,n="",r+=p):!s&&p==="("?(i++,r+=p):!s&&p===")"?(i--,r+=p):!s&&p===","&&i===0?(t.push(r),r=""):r+=p}return r&&t.push(r),t},Vc=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:v.LITERAL,value:parseFloat(e)};if(e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};let r=Is(e,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};let i=e.trim(),s=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:o,type:p}of s){let l=0;for(;l<i.length;){let a=Le(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 Q(i,t)}catch{return{type:v.VARIABLE,path:i}}return{type:v.VARIABLE,path:i}},Os=/^\w+\(.*\)$/,Rc=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,jc=e=>{if(!(!e||e.trim()===""||Os.test(e))&&Rc.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}"`)},Ni=e=>{let t=e.trim();if(Os.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}},yt=(e,t={})=>{let r=e.trim();jc(r);let i=Is(r,t);if(i.isFunction)return{type:i.type,name:i.name,args:i.args};if(r.includes("[")&&!/[\s+\-*/%|&?:]/.test(r)){let s=0;for(let n of r)n==="["?s++:n==="]"&&s--;if(s!==0)throw new Error("Invalid array index syntax")}return{type:v.VARIABLE,path:r}},Ts=(e,t={})=>{let r=e,i=[];(e.includes("\\${")||e.includes("\\#{"))&&(r=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),r=r.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),r=r.replace(/\\(\$\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\(#\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\DOUBLE_ESC_VAR/g,"\\"),r=r.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let s=[...r.matchAll(Oc)],n=[...r.matchAll(Tc)],o=[...s.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=r;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]===r&&i.length===0){let{match:a,type:c}=o[0];try{return c==="variable"?yt(a[1],t):Ni(a[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:v.LITERAL,value:r};throw d}}let p=[],l=0;for(let{match:a,type:c}of o){let[d,h]=a,f=a.index;if(f>l){let u=r.substring(l,f);for(let m=0;m<i.length;m++)u=u.replace(`__ESCAPED_${m}__`,i[m]);u&&p.push(u)}try{let u;c==="variable"?u=yt(h.trim(),t):u=Ni(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<r.length){let a=r.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}},Ee=(e,t)=>typeof e=="string"?Ts(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Pc(e,t):Bc(e,t):{type:v.LITERAL,value:e},Dc=e=>{let{$each:t,...r}=e;if(typeof t!="string")throw new k("$each value must be a non-empty string");let i=t.trim();if(i==="")throw new k("$each value must be a non-empty string");if(Object.keys(r).length===0)throw new k("Empty $each body not allowed");if(r.$partial!==void 0)throw new k("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${i}`]:r}},Pc=(e,t)=>{let r=[],i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let l=Dc(n),a=Object.keys(l);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let c=Vi(a[0],l[a[0]],t,!0);r.push(c),i=!0;continue}}catch(l){throw l instanceof k?l:new k(l.message)}let p=Object.keys(n);if(p.length===1&&/^\$for(?::\w+)?\s/.test(p[0])){let l=Vi(p[0],n[p[0]],t);r.push(l),i=!0;continue}}let o=Ee(n,t);r.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:r,fast:!i}},Bc=(e,t)=>{let r=[],i=!1,s=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 m=null;if(u&&(m=Ee(f,t),m.type===v.OBJECT)){let b=!1;for(let g of m.properties)if(g.value.type===v.VARIABLE||g.value.type===v.INTERPOLATION||g.value.type===v.FUNCTION||g.value.type===v.CONDITIONAL||g.value.type===v.OBJECT&&!g.value.fast||g.value.type===v.ARRAY&&!g.value.fast){b=!0;break}b&&(m.fast=!1)}let y={type:v.PARTIAL,name:c,data:m};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new k("Empty condition expression after '$when'");b=Q(d,t)}else b={type:v.LITERAL,value:d};y.whenCondition=b}return y}for(let[l,a]of n)if(l==="$when"){if(s!==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'");s=Q(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=zc(n,o,t);r.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=Ee(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=Ts(l,t),h={key:l,value:c};(d.type!==v.LITERAL||d.value!==l)&&(h.parsedKey=d),r.push(h),o++}}}let p={type:v.OBJECT,properties:r,fast:!i};return s&&(p.whenCondition=s),p},zc=(e,t,r={})=>{let i=[],s=[],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());Ti(a);let c=Q(a,r);for(i.push(c),s.push(Ee(p,r)),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{Ti(u);let m=Q(u,r);i.push(m)}if(s.push(Ee(h,r)),n++,u===null)break}else break}return{node:{type:v.CONDITIONAL,conditions:i,bodies:s,id:l},nextIndex:n}},Q=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let 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 Q(a,t)}let r=Le(e,"||");if(r!==-1)return{type:v.BINARY,op:P.OR,left:Q(e.substring(0,r).trim(),t),right:Q(e.substring(r+2).trim(),t)};let i=Le(e,"&&");if(i!==-1)return{type:v.BINARY,op:P.AND,left:Q(e.substring(0,i).trim(),t),right:Q(e.substring(i+2).trim(),t)};let s=[{op:">=",type:P.GTE},{op:"<=",type:P.LTE},{op:"==",type:P.EQ},{op:"!=",type:P.NEQ},{op:">",type:P.GT},{op:"<",type:P.LT},{op:" in ",type:P.IN}];for(let{op:a,type:c}of s){let d=Le(e,a);if(d!==-1)return{type:v.BINARY,op:c,left:Q(e.substring(0,d).trim(),t),right:Q(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=Le(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:Q(e.substring(0,n).trim(),t),right:Q(e.substring(n+o.op.length).trim(),t)};let l=[" * "," / "," % "];for(let a of l)if(Le(e,a)!==-1)throw new k(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:v.UNARY,op:hr.NOT,operand:Q(e.substring(1).trim(),t)}:Ls(e,t)},Le=(e,t)=>{let r=0,i=0;for(;i<=e.length-t.length;){if(e[i]==="(")r++;else if(e[i]===")")r--;else if(r===0&&e.substring(i,i+t.length)===t)return i;i++}return-1},Wc=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}},Ls=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return yt(r,t);let i=Wc(r);if(i.type===v.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:v.VARIABLE,path:r};try{return yt(r,t)}catch(s){if(s.message&&s.message.includes("not supported"))return i;throw s}},Fc=(e,t=!1)=>{try{hc(e)}catch(r){if(r instanceof k&&t){let i=r.message.replace(/\$for/g,"$each");throw new k(i.replace("Parse Error: ",""))}throw r}},Vi=(e,t,r,i=!1)=>{let s=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(s);if(!n){let y=i?"$each":"$for";throw new k(`Invalid loop syntax (got: '${e.replace("$for",y)}')`)}let o=n[1],p=n[2].trim();Fc(p,i);let l=p.match(/^(.+?)\s+in\s+(.+)$/);if(!l){let y=i?"$each":"$for";throw new k(`Invalid loop syntax - missing 'in' keyword (got: '${y} ${p}')`)}let a=l[1].trim(),c=l[2].trim(),d,h=null;if(a.includes(",")){let y=a.split(",").map(b=>b.trim());if(y.length!==2)throw new k(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=y[0],h=y[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=Ls(c,r),m=Ee(t,r);return{type:v.LOOP,itemVar:d,indexVar:h,iterable:u,body:m,flatten:o!=="nested"}},fr=(e,t={})=>{let{functions:r={}}=t;return Ee(e,r)},Mc=()=>Date.now(),Kc=Object.freeze(Object.defineProperty({__proto__:null,now:Mc},Symbol.toStringTag,{value:"Module"})),Ns=(e,t,r={})=>{let{functions:i={},partials:s={}}=r,n={...Kc,...i},o=fr(e,{functions:n}),p={};for(let[l,a]of Object.entries(s))p[l]=fr(a,{functions:n});return As(o,t,{functions:n,partials:p})},Ze=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Uc=(e,t)=>{!t||typeof t!="object"||Object.entries(t).forEach(([r,i])=>{if(r==="default")throw new Error("[Methods] Invalid method name 'default'. Use named exports in .methods.js; default export is not supported.");if(typeof i=="function"){if(r in e)throw new Error(`[Methods] Cannot define method '${r}' because it already exists on the component instance.`);Object.defineProperty(e,r,{configurable:!0,enumerable:!1,writable:!1,value:(s={})=>{let n=s===void 0?{}:s;if(!Ze(n))throw new Error(`[Methods] Method '${r}' expects payload to be an object.`);return i.call(e,n)}})}})},Vs=Symbol.for("immer-nothing"),Ri=Symbol.for("immer-draftable"),ne=Symbol.for("immer-state");function de(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Pe=Object.getPrototypeOf;function Be(e){return!!e&&!!e[ne]}function ke(e){return e?Rs(e)||Array.isArray(e)||!!e[Ri]||!!e.constructor?.[Ri]||At(e)||Et(e):!1}var Hc=Object.prototype.constructor.toString();function Rs(e){if(!e||typeof e!="object")return!1;let t=Pe(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===Hc}function gt(e,t){St(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,i)=>t(i,r,e))}function St(e){let t=e[ne];return t?t.type_:Array.isArray(e)?1:At(e)?2:Et(e)?3:0}function mr(e,t){return St(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function js(e,t,r){let i=St(e);i===2?e.set(t,r):i===3?e.add(r):e[t]=r}function qc(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function At(e){return e instanceof Map}function Et(e){return e instanceof Set}function xe(e){return e.copy_||e.base_}function yr(e,t){if(At(e))return new Map(e);if(Et(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Rs(e);if(t===!0||t==="class_only"&&!r){let i=Object.getOwnPropertyDescriptors(e);delete i[ne];let s=Reflect.ownKeys(i);for(let n=0;n<s.length;n++){let o=s[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(Pe(e),i)}else{let i=Pe(e);if(i!==null&&r)return{...e};let s=Object.create(i);return Object.assign(s,e)}}function Lr(e,t=!1){return kt(e)||Be(e)||!ke(e)||(St(e)>1&&(e.set=e.add=e.clear=e.delete=Gc),Object.freeze(e),t&&Object.entries(e).forEach(([r,i])=>Lr(i,!0))),e}function Gc(){de(2)}function kt(e){return Object.isFrozen(e)}var Yc={};function $e(e){let t=Yc[e];return t||de(0,e),t}var Xe;function Ds(){return Xe}function Jc(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ji(e,t){t&&($e("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function gr(e){br(e),e.drafts_.forEach(Zc),e.drafts_=null}function br(e){e===Xe&&(Xe=e.parent_)}function Di(e){return Xe=Jc(Xe,e)}function Zc(e){let t=e[ne];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Pi(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[ne].modified_&&(gr(t),de(4)),ke(e)&&(e=bt(t,e),t.parent_||vt(t,e)),t.patches_&&$e("Patches").generateReplacementPatches_(r[ne].base_,e,t.patches_,t.inversePatches_)):e=bt(t,r,[]),gr(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Vs?e:void 0}function bt(e,t,r){if(kt(t))return t;let i=t[ne];if(!i)return gt(t,(s,n)=>Bi(e,i,t,s,n,r)),t;if(i.scope_!==e)return t;if(!i.modified_)return vt(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;let s=i.copy_,n=s,o=!1;i.type_===3&&(n=new Set(s),s.clear(),o=!0),gt(n,(p,l)=>Bi(e,i,s,p,l,r,o)),vt(e,s,!1),r&&e.patches_&&$e("Patches").generatePatches_(i,r,e.patches_,e.inversePatches_)}return i.copy_}function Bi(e,t,r,i,s,n,o){if(Be(s)){let p=n&&t&&t.type_!==3&&!mr(t.assigned_,i)?n.concat(i):void 0,l=bt(e,s,p);if(js(r,i,l),Be(l))e.canAutoFreeze_=!1;else return}else o&&r.add(s);if(ke(s)&&!kt(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;bt(e,s),(!t||!t.scope_.parent_)&&typeof i!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,i)&&vt(e,s)}}function vt(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Lr(t,r)}function Xc(e,t){let r=Array.isArray(e),i={type_:r?1:0,scope_:t?t.scope_:Ds(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},s=i,n=Nr;r&&(s=[i],n=Qe);let{revoke:o,proxy:p}=Proxy.revocable(s,n);return i.draft_=p,i.revoke_=o,p}var Nr={get(e,t){if(t===ne)return e;let r=xe(e);if(!mr(r,t))return Qc(e,r,t);let i=r[t];return e.finalized_||!ke(i)?i:i===sr(e.base_,t)?(nr(e),e.copy_[t]=wr(i,e)):i},has(e,t){return t in xe(e)},ownKeys(e){return Reflect.ownKeys(xe(e))},set(e,t,r){let i=Ps(xe(e),t);if(i?.set)return i.set.call(e.draft_,r),!0;if(!e.modified_){let s=sr(xe(e),t),n=s?.[ne];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(qc(r,s)&&(r!==void 0||mr(e.base_,t)))return!0;nr(e),vr(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return sr(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,nr(e),vr(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=xe(e),i=Reflect.getOwnPropertyDescriptor(r,t);return i&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:i.enumerable,value:r[t]}},defineProperty(){de(11)},getPrototypeOf(e){return Pe(e.base_)},setPrototypeOf(){de(12)}},Qe={};gt(Nr,(e,t)=>{Qe[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Qe.deleteProperty=function(e,t){return Qe.set.call(this,e,t,void 0)};Qe.set=function(e,t,r){return Nr.set.call(this,e[0],t,r,e[0])};function sr(e,t){let r=e[ne];return(r?xe(r):e)[t]}function Qc(e,t,r){let i=Ps(t,r);return i?"value"in i?i.value:i.get?.call(e.draft_):void 0}function Ps(e,t){if(!(t in e))return;let r=Pe(e);for(;r;){let i=Object.getOwnPropertyDescriptor(r,t);if(i)return i;r=Pe(r)}}function vr(e){e.modified_||(e.modified_=!0,e.parent_&&vr(e.parent_))}function nr(e){e.copy_||(e.copy_=yr(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var eu=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,i)=>{if(typeof t=="function"&&typeof r!="function"){let n=r;r=t;let o=this;return function(p=n,...l){return o.produce(p,a=>r.call(this,a,...l))}}typeof r!="function"&&de(6),i!==void 0&&typeof i!="function"&&de(7);let s;if(ke(t)){let n=Di(this),o=wr(t,void 0),p=!0;try{s=r(o),p=!1}finally{p?gr(n):br(n)}return ji(n,i),Pi(s,n)}else if(!t||typeof t!="object"){if(s=r(t),s===void 0&&(s=t),s===Vs&&(s=void 0),this.autoFreeze_&&Lr(s,!0),i){let n=[],o=[];$e("Patches").generateReplacementPatches_(t,s,n,o),i(n,o)}return s}else de(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(n,...o)=>this.produceWithPatches(n,p=>t(p,...o));let i,s;return[this.produce(t,r,(n,o)=>{i=n,s=o}),i,s]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ke(e)||de(8),Be(e)&&(e=tu(e));let t=Di(this),r=wr(e,void 0);return r[ne].isManual_=!0,br(t),r}finishDraft(e,t){let r=e&&e[ne];(!r||!r.isManual_)&&de(9);let{scope_:i}=r;return ji(i,t),Pi(void 0,i)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let s=t[r];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}r>-1&&(t=t.slice(r+1));let i=$e("Patches").applyPatches_;return Be(e)?i(e,t):this.produce(e,s=>i(s,t))}};function wr(e,t){let r=At(e)?$e("MapSet").proxyMap_(e,t):Et(e)?$e("MapSet").proxySet_(e,t):Xc(e,t);return(t?t.scope_:Ds()).drafts_.push(r),r}function tu(e){return Be(e)||de(10,e),Bs(e)}function Bs(e){if(!ke(e)||kt(e))return e;let t=e[ne],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=yr(e,t.scope_.immer_.useStrictShallowCopy_)}else r=yr(e,!0);return gt(r,(i,s)=>{js(r,i,Bs(s))}),t&&(t.finalized_=!1),r}var oe=new eu,ru=oe.produce;oe.produceWithPatches.bind(oe);oe.setAutoFreeze.bind(oe);oe.setUseStrictShallowCopy.bind(oe);oe.applyPatches.bind(oe);oe.createDraft.bind(oe);oe.finishDraft.bind(oe);var iu=(e,t,r)=>{let{createInitialState:i,...s}=e,n={},o={},p={};return i&&(p=i({props:t,constants:r})),Object.entries(s).forEach(([l,a])=>{if(l.startsWith("select")){n[l]=(...c)=>a({state:p,props:t,constants:r},...c);return}o[l]=(c={})=>{let d=c===void 0?{}:c;if(!Ze(d))throw new Error(`[Store] Action '${l}' expects payload to be an object.`);return p=ru(p,h=>a({state:h,props:t,constants:r},d)),p}}),{getState:()=>p,...o,...n}},zs=e=>!Ze(e)||Object.isFrozen(e)?e:(Object.values(e).forEach(t=>{zs(t)}),Object.freeze(e)),su=({setupConstants:e,fileConstants:t})=>{let r=Ze(e)?e:{},i=Ze(t)?t:{};return zs({...r,...i})},nu=(e,t)=>{if(!t||typeof t!="object")return"";let r="",i=n=>Object.entries(n).map(([o,p])=>` ${o}: ${p};`).join(`
1476
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let r=t.composedPath();(r[0]===this._dialogElement||r[0].nodeName==="DIALOG"&&r[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let r=t.composedPath();(r[0]===this._dialogElement||r[0].nodeName==="DIALOG"&&r[0]===this._dialogElement)&&(t.preventDefault(),this._emitClose())}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._emitClose()}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._contentWrapper=null,this._isOpen=!1}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y","place","no-overlay","content-w","content-h","content-wh","content-g","content-sv","content-pv","content-bgc","content-style"]}connectedCallback(){this._syncContentWrapper({reposition:!1}),this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._isOpen&&this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,r,i){t==="open"?i!==null&&!this._isOpen?this.isConnected&&this._show():i===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="place")&&this._isOpen?this._updatePosition():t==="no-overlay"&&r!==i&&this._isOpen?(this._hide(),this._show()):t.startsWith("content-")&&this._syncContentWrapper()}_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(r=>r.hasAttribute(bi));return t?this._contentWrapper=t:(this._contentWrapper=document.createElement("rtgl-view"),this._contentWrapper.setAttribute(bi,""),this._contentWrapper.setAttribute("part","content"),this._contentWrapper.setAttribute("bgc","bg"),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",er)),this._contentWrapper.parentNode!==this&&this.appendChild(this._contentWrapper),this._contentWrapper}_syncContentWrapperAttributes(){let t=this._ensureContentWrapper(),r=[["content-w","w"],["content-h","h"],["content-wh","wh"],["content-g","g"],["content-sv","sv"]];for(let[s,n]of r){let o=this.getAttribute(s);o===null?t.removeAttribute(n):t.setAttribute(n,o)}t.setAttribute("bgc",this.getAttribute("content-bgc")||"bg"),t.setAttribute("ph","sm"),t.setAttribute("pv",this.getAttribute("content-pv")||"sm");let i=this.getAttribute("content-style");t.setAttribute("style",i?`${er} ${i}`:er)}_syncContentWrapper({reposition:t=!0}={}){let r=this._ensureContentWrapper(),i=Array.from(this.childNodes).filter(n=>n!==r&&!this._isIgnorableTextNode(n));for(let n of i)n.nodeType===Node.ELEMENT_NODE&&n.getAttribute("slot")==="content"&&n.removeAttribute("slot"),r.appendChild(n);this._syncContentWrapperAttributes(),Array.from(r.childNodes).some(n=>!this._isIgnorableTextNode(n))?r.setAttribute("slot","content"):r.removeAttribute("slot"),t&&this._isOpen&&this._updatePosition()}_show(){this._isOpen||(this._syncContentWrapper({reposition:!1}),this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._dialogElement.open||setTimeout(()=>{this._dialogElement&&!this._dialogElement.open&&(this.hasAttribute("no-overlay")?this._dialogElement.show():this._dialogElement.showModal())},0),requestAnimationFrame(()=>{this._updatePosition()}))}_hide(){this._isOpen&&(this._isOpen=!1,this._dialogElement.open&&this._dialogElement.close(),this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_updatePosition(){let t=parseFloat(this.getAttribute("x")||"0"),r=parseFloat(this.getAttribute("y")||"0"),i=this.getAttribute("place")||"bs";this.removeAttribute("positioned"),requestAnimationFrame(()=>{this._syncContentWrapper({reposition:!1});let s=this._popoverContainer.getBoundingClientRect(),{left:n,top:o}=this._calculatePosition(t,r,s.width,s.height,i);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${o}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,r,i,s,n){let p=t,l=r;switch(n){case"t":p=t-i/2,l=r-s-8;break;case"ts":p=t,l=r-s-8;break;case"te":p=t-i,l=r-s-8;break;case"r":p=t+8,l=r-s/2;break;case"rs":p=t+8,l=r;break;case"re":p=t+8,l=r-s;break;case"b":p=t-i/2,l=r+8;break;case"bs":p=t,l=r+8;break;case"be":p=t-i,l=r+8;break;case"l":p=t-i-8,l=r-s/2;break;case"ls":p=t-i-8,l=r;break;case"le":p=t-i-8,l=r-s;break;default:p=t,l=r+8;break}let a=8;return p=Math.max(a,Math.min(p,window.innerWidth-i-a)),l=Math.max(a,Math.min(l,window.innerHeight-s-a)),{left:p,top:l}}get popover(){return this._popoverContainer}get content(){return this._contentWrapper}},vi=({render:e,html:t})=>tr;var Dn=(e,t)=>{let{store:r,render:i}=e;r.toggleOpen({}),i()},Pn=Object.freeze(Object.defineProperty({__proto__:null,handleClickHeader:Dn},Symbol.toStringTag,{value:"Module"})),Bn=()=>Object.freeze({open:!1}),zn=["id","class","style","slot","label","content"],Wn=(e={})=>Object.entries(e).filter(([t])=>!zn.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Fn=({state:e,props:t})=>({label:t.label||"",content:t.content||"",openClass:e.open?"content-wrapper open":"content-wrapper",chevronIcon:e.open?"chevronUp":"chevronDown",containerAttrString:Wn(t)}),Mn=({state:e})=>{e.open=!e.open},Kn=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Bn,selectViewData:Fn,toggleOpen:Mn},Symbol.toStringTag,{value:"Module"})),Un=(e,t)=>{let{dispatchEvent:r,props:i}=e,s=t._event,n=Number(s.currentTarget.dataset.index),o=Array.isArray(i.items)?i.items[n]:void 0;if(o){if(o.disabled||o.current){s.preventDefault();return}typeof o.href=="string"&&o.href.length>0||s.preventDefault(),r(new CustomEvent("item-click",{detail:{id:o.id,path:o.path,href:o.href,item:o,index:n,trigger:s.type}}))}},Hn=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:Un},Symbol.toStringTag,{value:"Module"})),qn=()=>Object.freeze({}),Gn=["id","class","style","slot","items","sep","max","separator"],Yn=(e={})=>Object.entries(e).filter(([t])=>!Gn.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Jn=e=>{if(e==null||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t},Zn=e=>`${e}`.replace(/"/g,"&quot;"),Xn=(e,t)=>{if(!t||t<3||e.length<=t)return e;let r=t-2;return[e[0],{isEllipsis:!0,label:"..."},...e.slice(-r)]},Qn=e=>e.map((t,r)=>{let i=typeof t.href=="string"&&t.href.length>0,s=t.path!==void 0&&t.path!==null&&`${t.path}`!="",n=!!t.current,o=!!t.disabled,p=!n&&!o&&(i||s||!!t.click),l=t.rel||(t.newTab?"noopener noreferrer":""),a=[t.newTab?'target="_blank"':"",l?`rel="${Zn(l)}"`:""].filter(Boolean).join(" ");return{...t,label:t.label||"",index:r,href:i?t.href:void 0,path:s?t.path:void 0,isCurrent:n,isDisabled:o,isInteractive:p,linkExtraAttrs:a,c:n?"fg":"mu-fg"}}),eo=({props:e})=>{let t=Yn(e),r=Array.isArray(e.items)?e.items:[],i=Jn(e.max),s=e.sep||"breadcrumb-arrow",n=Qn(r),o=Xn(n,i),p=[];return o.forEach((l,a)=>{p.push(l),a<o.length-1&&p.push({isSeparator:!0})}),{containerAttrString:t,items:p,sep:s}},to=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:qn,selectViewData:eo},Symbol.toStringTag,{value:"Module"})),ro=["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"],wi={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"}},io=(e={})=>Object.entries(e).filter(([t])=>!ro.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),so=()=>Object.freeze({}),no=({props:e={}})=>{let t=wi[e.size]?e.size:"md",r=wi[t];return{containerAttrString:io(e),cardAttrString:r.cardAttrString,headerAttrString:r.headerAttrString,headingSize:r.headingSize,subheadingSize:r.subheadingSize,head:e.head||"",desc:e.desc||"",hasHeader:!!(e.head||e.desc),size:t}},oo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:so,selectViewData:no},Symbol.toStringTag,{value:"Module"})),ao=(e,t)=>{let{dispatchEvent:r}=e;r(new CustomEvent("close"))},lo=(e,t)=>{let{dispatchEvent:r,props:i}=e,s=t._event,n=Number(s.currentTarget.dataset.index??s.currentTarget.id.slice(6)),o=i.items[n],p=o?.type||"item";if(!o||p!=="item"||o.disabled){s.preventDefault();return}o.href||s.preventDefault(),r(new CustomEvent("item-click",{detail:{index:n,item:o,id:o.id,path:o.path,href:o.href,trigger:s.type}}))},po=Object.freeze(Object.defineProperty({__proto__:null,handleClickMenuItem:lo,handleClosePopover:ao},Symbol.toStringTag,{value:"Module"})),co=()=>Object.freeze({}),uo=e=>`${e}`.replace(/"/g,"&quot;"),ho=e=>e.map((t,r)=>{let i=t.type||"item",s=i==="separator",n=i==="label",o=i==="item",p=!!t.disabled,l=o&&!p,a=p?"mu-fg":"fg",c=p?"mu":"",d=p?"":"ac",h=typeof t.href=="string"&&t.href.length>0,f=t.rel||(t.newTab?"noopener noreferrer":""),u=[t.newTab?'target="_blank"':"",f?`rel="${uo(f)}"`:""].filter(Boolean).join(" ");return{...t,index:r,type:i,isSeparator:s,isLabel:n,isItem:o,isDisabled:p,isInteractive:l,hasHref:h,linkExtraAttrs:u,c:a,bgc:c,hoverBgc:d}}),fo=({props:e})=>{let t=Array.isArray(e.items)?e.items:[];return{items:ho(t),open:!!e.open,x:e.x||0,y:e.y||0,w:e.w||"300",h:e.h||"300",place:e.place||"bs"}},mo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:co,selectViewData:fo},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},pr={NOT:0},$=class extends Error{constructor(e){super(`Parse Error: ${e}`),this.name="JemplParseError"}},le=class extends Error{constructor(e){super(`Render Error: ${e}`),this.name="JemplRenderError"}},_i=e=>{if(!e||e.trim()==="")throw new $("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new $(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${r}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let r of t)if(e.trim().endsWith(r))throw new $(`Incomplete comparison expression - missing right operand (got: '${e}')`)},yo=e=>{if(e.trim().endsWith(" in"))throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new $(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);let i=t.includes(",")?t.split(",").map(s=>s.trim()):[t.trim()];for(let s of i){if(!s)throw new $(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(s))throw new $(`Invalid loop syntax (got: '$for ${e}')`)}},go=(e,t,r=!1)=>{if(t===null)return new le(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new le(`Cannot iterate over undefined value at '$for ${e}'`);let i=typeof t;return r?new le(`Cannot iterate over non-array value in loop '${e}' - got ${i} instead`):new le(`Cannot iterate over non-array value (got: ${i}) at '$for ${e}'`)},bo=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new le(`Unknown function '${e}' (${r})`)},vo=(e,t,r={})=>{let i={},s={};r&&typeof r=="object"&&(r.functions!==void 0||r.partials!==void 0?(i=r.functions||{},s=r.partials||{}):typeof r=="object"&&(i=r));let n=V(e,{functions:i,partials:s},t,{});return n===void 0?{}:n},V=(e,t,r,i)=>{if(t.functions,e.var&&!e.type)return K(e.var,r,i);if(e.type===w.LITERAL)return e.value;if(e.type===w.VARIABLE)return K(e.path,r,i);if(e.type===w.INTERPOLATION)return _o(e.parts,t,r,i);switch(e.type){case w.FUNCTION:return ts(e,t,r,i);case w.BINARY:return rs(e,t,r,i);case w.UNARY:return is(e,t,r,i);case w.CONDITIONAL:return So(e,t,r,i);case w.LOOP:return Co(e,t,r,i);case w.OBJECT:return Oo(e,t,r,i);case w.ARRAY:return To(e,t,r,i);case w.PARTIAL:return Lo(e,t,r,i);case w.PATH_REFERENCE:return No(e,t,r,i);default:throw new Error(`Unknown node type: ${e.type}`)}},xi=new Map,wo=e=>{let t=[],r="",i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(n==="[")r&&(t.push({type:"property",value:r}),r=""),i=!0;else if(n==="]"){if(i&&r){let o=r.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});r=""}i=!1}else r+=n}return r&&t.push({type:"property",value:r}),t},K=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let i=xi.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=wo(l.trim());i.push(...a)}xi.set(e,i)}let s=t;for(let n=0;n<i.length;n++){let o=i[n];if(o.type==="property"&&o.value in r){s=r[o.value];continue}if(s==null)return;(o.type==="property"||o.type==="index")&&(s=s[o.value])}return s},_o=(e,t,r,i)=>{let s=[];for(let n of e)if(typeof n=="string")s.push(n);else{let o=V(n,t,r,i);s.push(o!=null?String(o):"")}return s.join("")},ts=(e,t,r,i)=>{let s=t.functions||t,n=s[e.name];if(!n)throw bo(e.name,s);let o=e.args.map(p=>V(p,t,r,i));return n(...o)},je=(e,t,r,i)=>{if(e.var&&!e.type)return K(e.var,r,i);switch(e.type){case w.VARIABLE:return K(e.path,r,i);case w.LITERAL:return e.value;case w.BINARY:return rs(e,t,r,i);case w.UNARY:return is(e,t,r,i);case w.FUNCTION:return ts(e,t,r,i);default:return V(e,t,r,i)}},rs=(e,t,r,i)=>{if(e.op===D.AND||e.op===D.OR){let o=je(e.left,t,r,i),p=je(e.right,t,r,i);switch(e.op){case D.AND:return o&&p;case D.OR:return o||p}}let s=V(e.left,t,r,i),n=V(e.right,t,r,i);switch(e.op){case D.EQ:return s==n;case D.NEQ:return s!=n;case D.GT:return s>n;case D.LT:return s<n;case D.GTE:return s>=n;case D.LTE:return s<=n;case D.IN:return Array.isArray(n)?n.includes(s):!1;case D.ADD:if(typeof s!="number"||typeof n!="number")throw new le(`Arithmetic operations require numbers. Got ${typeof s} + ${typeof n}`);return s+n;case D.SUBTRACT:if(typeof s!="number"||typeof n!="number")throw new le(`Arithmetic operations require numbers. Got ${typeof s} - ${typeof n}`);return s-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},is=(e,t,r,i)=>{let s=e.op===pr.NOT?je(e.operand,t,r,i):V(e.operand,t,r,i);switch(e.op){case pr.NOT:return!s;default:throw new Error(`Unknown unary operator: ${e.op}`)}},xo=(e,t,r,i)=>{if(e.conditions.length===2&&e.conditions[1]===null){let s=e.conditions[0];if(s.type===w.VARIABLE)if(K(s.path,r,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?V(p.parsedKey,t,r,i):p.key,a=p.value;if(a.type===w.LITERAL)o[l]=a.value;else if(a.type===w.VARIABLE)o[l]=K(a.path,r,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=K(d.path,r,i);c.push(h!=null?String(h):"")}else{let h=V(d,t,r,i);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=V(a,t,r,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?V(p.parsedKey,t,r,i):p.key,a=p.value;if(a.type===w.LITERAL)o[l]=a.value;else if(a.type===w.VARIABLE)o[l]=K(a.path,r,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=K(d.path,r,i);c.push(h!=null?String(h):"")}else{let h=V(d,t,r,i);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=V(a,t,r,i)}return o}}}return null},So=(e,t,r,i)=>{let s=xo(e,t,r,i);if(s!==null)return s;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||je(o,t,r,i))return V(e.bodies[n],t,r,i)}return ss},Ao=(e,t)=>{let r=e.body,i=e.itemVar;if(r.type===w.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===w.VARIABLE){let s=r.conditions[0].path,n=r.bodies[0];if(s.startsWith(i+".")){let o=s.substring(i.length+1);if(n.type===w.OBJECT&&n.properties.length<=5){for(let l of n.properties)if(l.parsedKey)return null;let p=[];for(let l=0;l<t.length;l++){let 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 m=u.substring(i.length+1);c[h]=a[m]}else return null}else if(f.type===w.INTERPOLATION){let u=[],m=!0;for(let y of f.parts)if(typeof y=="string")u.push(y);else if(y.type===w.VARIABLE){let b=y.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{m=!1;break}}else{m=!1;break}if(!m)return null;c[h]=u.join("")}else return null}p.push(c)}}return p}}}return null},Eo=(e,t)=>{let r=e.body,i=e.itemVar,s=Ao(e,t);if(s!==null)return s;if(r.type===w.OBJECT&&r.properties.length<=5&&!r.whenCondition){for(let p of r.properties)if(p.parsedKey)return null;let n=[],o=!0;for(let p of r.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},ko=(e,t,r,i,s)=>{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<s.length;a++){let c=s[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("."),m=u[0];m in i.__paths__&&(f=i.__paths__[m],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 m=u.parsedKey?V(u.parsedKey,t,r,h):u.key,y=u.value;if(y.type===w.LITERAL)d[m]=y.value;else if(y.type===w.VARIABLE){let b=y.path;if(b===p)d[m]=c;else if(b===l)d[m]=a;else if(b.startsWith(p+".")){let g=b.substring(p.length+1);!g.includes(".")&&!g.includes("[")?d[m]=c[g]:d[m]=K(b,r,{...i,[p]:c,...l&&{[l]:a}})}else d[m]=K(b,r,{...i,[p]:c,...l&&{[l]:a}})}else if(y.type===w.INTERPOLATION){let b=[];for(let g of y.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=g.path,S;if(_===p)S=c;else if(_===l)S=a;else if(_.startsWith(p+".")){let A=_.substring(p.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=K(_,r,{...i,[p]:c,...l&&{[l]:a}})}else S=K(_,r,{...i,[p]:c,...l&&{[l]:a}});b.push(S!=null?String(S):"")}else{let _={...i,[p]:c,...l&&{[l]:a}},S=V(g,t,r,_);b.push(S!=null?String(S):"")}d[m]=b.join("")}else{let b={...i,[p]:c,...l&&{[l]:a}};d[m]=V(y,t,r,b)}}n.push(d)}return n}return null},$o=(e,t,r)=>{let i=e.body;if(i.type===w.OBJECT&&i.properties.length===1&&i.properties[0].key==="$if item.visible"){let s=i.properties[0].value;if(s.type===w.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===w.VARIABLE&&s.conditions[0].path==="item.visible"){let n=s.bodies[0];if(n.type===w.OBJECT&&n.properties.length===2){let 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},Co=(e,t,r,i)=>{let s=V(e.iterable,t,r,i);if(!Array.isArray(s)){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 go(d,s,c)}if(!e.indexVar){let a=$o(e,s,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=Eo(e,s);if(a!==null)return a}let n=ko(e,t,r,i,s);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<s.length;a++){let c=e.indexVar?{...i,[e.itemVar]:s[a],[e.indexVar]:a}:{...i,[e.itemVar]:s[a]};c.__paths__||(c.__paths__=i.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${p}[${a}]`},e.indexVar&&(c.__paths__[e.indexVar]=a);let d=V(e.body,t,r,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},Io=(e,t,r,i)=>{if(e.whenCondition)return null;if(e.properties.length===1){let s=e.properties[0],n=s.parsedKey?V(s.parsedKey,t,r,i):s.key,o=s.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?V(c.parsedKey,t,r,i):c.key,h=c.value;if(h.type===w.LITERAL)l[d]=h.value;else if(h.type===w.VARIABLE)l[d]=K(h.path,r,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 m=K(u.path,r,i);f.push(m!=null?String(m):"")}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 m=u.key,y=u.value;if(y.type===w.LITERAL)f[m]=y.value;else if(y.type===w.VARIABLE)f[m]=K(y.path,r,i);else if(y.type===w.INTERPOLATION){let b=[];for(let g of y.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=K(g.path,r,i);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[m]=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},Oo=(e,t,r,i)=>{let s=t.functions||t;if(e.whenCondition&&!je(e.whenCondition,s,r,i))return;let n=Io(e,t,r,i);if(n!==null)return n;if(e.fast){let l={};for(let a of e.properties){let c=a.parsedKey?V(a.parsedKey,t,r,i):a.key,d=a.value;if(d.type===w.LITERAL)l[c]=d.value;else if(d.type===w.VARIABLE)l[c]=K(d.path,r,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=K(f.path,r,i);h.push(u!=null?String(u):"")}else{let u=V(f,t,r,i);h.push(u!=null?String(u):"")}l[c]=h.join("")}else l[c]=V(d,t,r,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=V(l.value,t,r,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 V(l.value,t,r,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=V(c.value,t,r,i);d!==void 0&&(o[l.key]=d)}else{let d=V(l.value,t,r,i);d!==void 0&&(o[l.key]=d)}}else{let c=l.parsedKey?V(l.parsedKey,t,r,i):l.key,d=V(l.value,t,r,i);d!==void 0&&(o[c]=d)}}return o},ss={},To=(e,t,r,i)=>{let s=[];for(let n of e.items)if(n.type===w.LOOP){let o=V(n,t,r,i);Array.isArray(o)&&n.flatten!==!1?s.push(...o):s.push(o)}else{let o=V(n,t,r,i);o!==ss&&o!==void 0&&s.push(o)}return s},Lo=(e,t,r,i)=>{let{name:s,data:n,whenCondition:o}=e,p=t.partials||{},l=t.functions||t;if(o&&!je(o,l,r,i))return;if(!p[s])throw new le(`Partial '${s}' is not defined`);let a=i._partialStack||[];if(a.includes(s))throw new le(`Circular partial reference detected: ${s}`);let c=p[s],d=r,h={...i,_partialStack:[...a,s]};if(i){d={...r};for(let f of Object.keys(i))f.startsWith("_")||(d[f]=i[f])}if(n){let f=V(n,t,r,i);d={...d,...f}}return V(c,t,d,h)},No=(e,t,r,i)=>{let{path:s}=e,n=s.split("."),o=n[0],p=n.slice(1);if(!i||!(o in i))throw new le(`Path reference '#{${s}}' refers to '${o}' which is not a loop variable in the current scope`);if(i.__paths__||(i.__paths__={}),!(o in i.__paths__))throw new le(`Path reference '#{${s}}' 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 le(`Path reference '#{${s}}' - cannot access properties on index variable '${o}'`);return String(l)}return p.length>0&&(l+="."+p.join(".")),l},Vo=/\$\{([^}]*)\}/g,Ro=/#\{([^}]*)\}/g,ns=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,i,s]=r,n=jo(s,t);return{isFunction:!0,type:w.FUNCTION,name:i,args:n}},jo=(e,t={})=>e.trim()?Do(e).map(r=>Po(r.trim(),t)):[],Do=e=>{let t=[],r="",i=0,s=!1,n="";for(let o=0;o<e.length;o++){let p=e[o],l=o>0?e[o-1]:"";!s&&(p==='"'||p==="'")?(s=!0,n=p,r+=p):s&&p===n&&l!=="\\"?(s=!1,n="",r+=p):!s&&p==="("?(i++,r+=p):!s&&p===")"?(i--,r+=p):!s&&p===","&&i===0?(t.push(r),r=""):r+=p}return r&&t.push(r),t},Po=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:w.LITERAL,value:parseFloat(e)};if(e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};let r=ns(e,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};let i=e.trim(),s=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:o,type:p}of s){let l=0;for(;l<i.length;){let a=Te(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:w.VARIABLE,path:i}}return{type:w.VARIABLE,path:i}},os=/^\w+\(.*\)$/,Bo=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,zo=e=>{if(!(!e||e.trim()===""||os.test(e))&&Bo.test(e))throw e.includes("?")&&e.includes(":")?new $(`Complex expressions not supported in variable replacements - consider calculating the value in your data instead. Offending expression: "${e}"`):e.includes("||")||e.includes("&&")||e.includes("??")?new $(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new $(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},Si=e=>{let t=e.trim();if(os.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}},ht=(e,t={})=>{let r=e.trim();zo(r);let i=ns(r,t);if(i.isFunction)return{type:i.type,name:i.name,args:i.args};if(r.includes("[")&&!/[\s+\-*/%|&?:]/.test(r)){let s=0;for(let n of r)n==="["?s++:n==="]"&&s--;if(s!==0)throw new Error("Invalid array index syntax")}return{type:w.VARIABLE,path:r}},as=(e,t={})=>{let r=e,i=[];(e.includes("\\${")||e.includes("\\#{"))&&(r=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),r=r.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),r=r.replace(/\\(\$\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\(#\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\DOUBLE_ESC_VAR/g,"\\"),r=r.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let s=[...r.matchAll(Vo)],n=[...r.matchAll(Ro)],o=[...s.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=r;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]===r&&i.length===0){let{match:a,type:c}=o[0];try{return c==="variable"?ht(a[1],t):Si(a[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:w.LITERAL,value:r};throw d}}let p=[],l=0;for(let{match:a,type:c}of o){let[d,h]=a,f=a.index;if(f>l){let u=r.substring(l,f);for(let m=0;m<i.length;m++)u=u.replace(`__ESCAPED_${m}__`,i[m]);u&&p.push(u)}try{let u;c==="variable"?u=ht(h.trim(),t):u=Si(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<r.length){let a=r.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}},Ae=(e,t)=>typeof e=="string"?as(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Fo(e,t):Mo(e,t):{type:w.LITERAL,value:e},Wo=e=>{let{$each:t,...r}=e;if(typeof t!="string")throw new $("$each value must be a non-empty string");let i=t.trim();if(i==="")throw new $("$each value must be a non-empty string");if(Object.keys(r).length===0)throw new $("Empty $each body not allowed");if(r.$partial!==void 0)throw new $("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${i}`]:r}},Fo=(e,t)=>{let r=[],i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let l=Wo(n),a=Object.keys(l);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let c=Ai(a[0],l[a[0]],t,!0);r.push(c),i=!0;continue}}catch(l){throw l instanceof $?l:new $(l.message)}let p=Object.keys(n);if(p.length===1&&/^\$for(?::\w+)?\s/.test(p[0])){let l=Ai(p[0],n[p[0]],t);r.push(l),i=!0;continue}}let o=Ae(n,t);r.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:r,fast:!i}},Mo=(e,t)=>{let r=[],i=!1,s=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 m=null;if(u&&(m=Ae(f,t),m.type===w.OBJECT)){let b=!1;for(let g of m.properties)if(g.value.type===w.VARIABLE||g.value.type===w.INTERPOLATION||g.value.type===w.FUNCTION||g.value.type===w.CONDITIONAL||g.value.type===w.OBJECT&&!g.value.fast||g.value.type===w.ARRAY&&!g.value.fast){b=!0;break}b&&(m.fast=!1)}let y={type:w.PARTIAL,name:c,data:m};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new $("Empty condition expression after '$when'");b=X(d,t)}else b={type:w.LITERAL,value:d};y.whenCondition=b}return y}for(let[l,a]of n)if(l==="$when"){if(s!==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'");s=X(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=Ko(n,o,t);r.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=Ae(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=as(l,t),h={key:l,value:c};(d.type!==w.LITERAL||d.value!==l)&&(h.parsedKey=d),r.push(h),o++}}}let p={type:w.OBJECT,properties:r,fast:!i};return s&&(p.whenCondition=s),p},Ko=(e,t,r={})=>{let i=[],s=[],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());_i(a);let c=X(a,r);for(i.push(c),s.push(Ae(p,r)),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{_i(u);let m=X(u,r);i.push(m)}if(s.push(Ae(h,r)),n++,u===null)break}else break}return{node:{type:w.CONDITIONAL,conditions:i,bodies:s,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 r=Te(e,"||");if(r!==-1)return{type:w.BINARY,op:D.OR,left:X(e.substring(0,r).trim(),t),right:X(e.substring(r+2).trim(),t)};let i=Te(e,"&&");if(i!==-1)return{type:w.BINARY,op:D.AND,left:X(e.substring(0,i).trim(),t),right:X(e.substring(i+2).trim(),t)};let s=[{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 s){let d=Te(e,a);if(d!==-1)return{type:w.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:D.ADD},{op:" - ",type:D.SUBTRACT}];for(let{op:a,type:c}of p){let d=0;for(;d<e.length;){let h=Te(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: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(Te(e,a)!==-1)throw new $(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:w.UNARY,op:pr.NOT,operand:X(e.substring(1).trim(),t)}:ls(e,t)},Te=(e,t)=>{let r=0,i=0;for(;i<=e.length-t.length;){if(e[i]==="(")r++;else if(e[i]===")")r--;else if(r===0&&e.substring(i,i+t.length)===t)return i;i++}return-1},Uo=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}},ls=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return ht(r,t);let i=Uo(r);if(i.type===w.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:w.VARIABLE,path:r};try{return ht(r,t)}catch(s){if(s.message&&s.message.includes("not supported"))return i;throw s}},Ho=(e,t=!1)=>{try{yo(e)}catch(r){if(r instanceof $&&t){let i=r.message.replace(/\$for/g,"$each");throw new $(i.replace("Parse Error: ",""))}throw r}},Ai=(e,t,r,i=!1)=>{let s=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(s);if(!n){let y=i?"$each":"$for";throw new $(`Invalid loop syntax (got: '${e.replace("$for",y)}')`)}let o=n[1],p=n[2].trim();Ho(p,i);let l=p.match(/^(.+?)\s+in\s+(.+)$/);if(!l){let y=i?"$each":"$for";throw new $(`Invalid loop syntax - missing 'in' keyword (got: '${y} ${p}')`)}let a=l[1].trim(),c=l[2].trim(),d,h=null;if(a.includes(",")){let y=a.split(",").map(b=>b.trim());if(y.length!==2)throw new $(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=y[0],h=y[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=ls(c,r),m=Ae(t,r);return{type:w.LOOP,itemVar:d,indexVar:h,iterable:u,body:m,flatten:o!=="nested"}},Ei=(e,t={})=>{let{functions:r={}}=t;return Ae(e,r)},qo=()=>Date.now(),Go=Object.freeze(Object.defineProperty({__proto__:null,now:qo},Symbol.toStringTag,{value:"Module"})),Yo=(e,t,r={})=>{let{functions:i={},partials:s={}}=r,n={...Go,...i},o=Ei(e,{functions:n}),p={};for(let[l,a]of Object.entries(s))p[l]=Ei(a,{functions:n});return vo(o,t,{functions:n,partials:p})},$r=e=>e!==null&&typeof e=="object",ft=e=>$r(e)&&!Array.isArray(e),Jo=e=>typeof e=="string"&&e.includes("."),ps=e=>typeof e=="string"&&/[\[\]]/.test(e);function ds(e,t){let r={};for(let i of t){if(typeof i!="string"||i.length===0)continue;let s=pe(e,i);s!==void 0&&ue(r,i,s)}return r}function Zo(e){if(!ft(e)||!Array.isArray(e.fields))return e;let t=(r=[])=>r.map(i=>{if(!ft(i))return i;if(typeof i.$when=="string"&&i.$when.trim().length>0){let{$when:s,...n}=i,o=Array.isArray(n.fields)?{...n,fields:t(n.fields)}:n;return{[`$if ${s}`]:o}}return Array.isArray(i.fields)?{...i,fields:t(i.fields)}:i});return{...e,fields:t(e.fields)}}var pe=(e,t,r=void 0)=>{if(!t||!$r(e)||ps(t))return r;let i=t.split(".").filter(n=>n!==""),s=e;for(let n of i){if(s==null||!(n in s))return Object.prototype.hasOwnProperty.call(e,t)?e[t]:r;s=s[n]}return s},ue=(e,t,r)=>{if(!$r(e)||typeof t!="string"||t.length===0||ps(t))return e;let i=t.split(".").filter(n=>n!=="");if(i.length===0)return e;Jo(t)&&Object.prototype.hasOwnProperty.call(e,t)&&delete e[t];let s=e;for(let n=0;n<i.length-1;n++){let o=i[n];(!(o in s)||typeof s[o]!="object"||s[o]===null)&&(s[o]={}),s=s[o]}return s[i[i.length-1]]=r,e},Xo=["id","class","style","slot","form","defaultValues","disabled","context"],Qo=(e={})=>Object.entries(e).filter(([t,r])=>!(Xo.includes(t)||r==null||typeof r=="object"||typeof r=="function")).map(([t,r])=>`${t}=${String(r)}`).join(" "),ea={email:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,url:/^https?:\/\/.+/},ce={required:"This field is required",minLength:e=>`Must be at least ${e} characters`,maxLength:e=>`Must be at most ${e} characters`,pattern:"Invalid format",invalidDate:"Invalid date format",invalidTime:"Invalid time format",invalidDateTime:"Invalid date and time format",minTemporal:e=>`Must be on or after ${e}`,maxTemporal:e=>`Must be on or before ${e}`},ta="input-date",ra="input-time",ia="input-datetime",sa=/^(\d{4})-(\d{2})-(\d{2})$/,na=/^(\d{2}):(\d{2})(?::(\d{2}))?$/,oa=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}(?::\d{2})?)$/,aa=e=>{if(typeof e!="string")return null;let t=sa.exec(e);if(!t)return null;let r=Number(t[1]),i=Number(t[2]),s=Number(t[3]);if(!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(s)||i<1||i>12||s<1||s>31)return null;let n=new Date(Date.UTC(r,i-1,s));return n.getUTCFullYear()===r&&n.getUTCMonth()===i-1&&n.getUTCDate()===s?{year:r,month:i,day:s}:null},la=e=>{if(typeof e!="string")return null;let t=na.exec(e);if(!t)return null;let r=Number(t[1]),i=Number(t[2]),s=t[3]===void 0?0:Number(t[3]);return!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(s)||r<0||r>23||i<0||i>59||s<0||s>59?null:{hour:r,minute:i,second:s}},cs=e=>{let t=la(e);return t?`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}`:null},us=e=>aa(e)?e:null,pa=e=>{if(typeof e!="string")return null;let t=oa.exec(e);if(!t)return null;let r=us(t[1]),i=cs(t[2]);return!r||!i?null:`${r}T${i}`},da=e=>e===ta?{normalize:us,invalidMessage:ce.invalidDate}:e===ra?{normalize:cs,invalidMessage:ce.invalidTime}:e===ia?{normalize:pa,invalidMessage:ce.invalidDateTime}:null,ca=(e,t)=>{let r=da(e.type);if(!r||t==null||t==="")return null;let i=r.normalize(String(t));if(!i)return r.invalidMessage;if(e.min!==void 0&&e.min!==null&&String(e.min)!==""){let s=r.normalize(String(e.min));if(s&&i<s)return ce.minTemporal(String(e.min))}if(e.max!==void 0&&e.max!==null&&String(e.max)!==""){let s=r.normalize(String(e.max));if(s&&i>s)return ce.maxTemporal(String(e.max))}return null},_t=(e,t)=>{if(e.required){let i=t==null||t===""||typeof t=="boolean"&&t===!1,s=e.type==="input-number"&&t===null;if(e.type==="input-number"?s:i)return typeof e.required=="object"&&e.required.message?e.required.message:ce.required}let r=ca(e,t);if(r)return r;if(Array.isArray(e.rules))for(let i of e.rules){let s=ua(i,t);if(s)return s}return null},ua=(e,t)=>{if(t==null||t==="")return null;let r=String(t);switch(e.rule){case"minLength":return r.length<e.value?e.message||ce.minLength(e.value):null;case"maxLength":return r.length>e.value?e.message||ce.maxLength(e.value):null;case"pattern":{let i=ea[e.value];if(!i)try{i=new RegExp(e.value)}catch{return e.message||ce.pattern}return i.test(r)?null:e.message||ce.pattern}default:return null}},xt=(e,t)=>{let r={},i=se(e);for(let s of i){let n=pe(t,s.name),o=_t(s,n);o&&(r[s.name]=o)}return{valid:Object.keys(r).length===0,errors:r}},ha=["section","read-only-text","slot"],Cr=e=>!ha.includes(e.type),se=e=>{let t=[];for(let r of e)r.type==="section"&&Array.isArray(r.fields)?t.push(...se(r.fields)):Cr(r)&&t.push(r);return t},Ir=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"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}},Or=(e,t=0)=>{let r=[],i=t;for(let s of e)if(s.type==="section"){if(r.push({...s,_isSection:!0,_idx:i}),i++,Array.isArray(s.fields)){let n=Or(s.fields,i);r.push(...n),i+=n.length}}else r.push({...s,_isSection:!1,_idx:i}),i++;return r},fa=()=>Object.freeze({formValues:{},errors:{},reactiveMode:!1,tooltipState:{open:!1,x:0,y:0,content:""}}),ee=({state:e,props:t})=>{let{form:r={}}=t||{},i=Zo(r),s=ft(t?.context)?t.context:{},n=ft(e?.formValues)?e.formValues:{},o={...s,...n,formValues:n};return Object.keys(o).length>0?Yo(i,o):i},ma=({state:e,props:t})=>{let r=Qo(t),i=ee({state:e,props:t}),s=i.fields||[],n=!!t?.disabled,o=Or(s);o.forEach(d=>{if(d._isSection)return;let h=Cr(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==="segmented-control"){let f=pe(e.formValues,d.name);d._selectedValue=f!==void 0?f:null,d.placeholder=d.placeholder||"",d.noClear=d.clearable===!1}if(d.type==="image"){let f=pe(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:r,title:i?.title||"",description:i?.description||"",flatFields:o,actions:c,formValues:e.formValues,tooltipState:e.tooltipState}},Ce=({state:e,props:t})=>{let r=ee({state:e,props:t}),i=se(r.fields||[]);return ds(e.formValues,i.map(s=>s.name).filter(s=>typeof s=="string"&&s.length>0))},ya=({state:e,props:t},r={})=>{let{name:i,value:s}=r;i&&(ue(e.formValues,i,s),tt({state:e,props:t}))},tt=({state:e,props:t})=>{if(!t)return;let r=ee({state:e,props:t}),i=se(r.fields||[]);e.formValues=ds(e.formValues,i.map(s=>s.name).filter(s=>typeof s=="string"&&s.length>0))},ga=({state:e},t={})=>{let{values:r}=t;!r||typeof r!="object"||Object.keys(r).forEach(i=>{ue(e.formValues,i,r[i])})},ba=({state:e},t={})=>{let{defaultValues:r={}}=t;e.formValues=r?structuredClone(r):{},e.errors={},e.reactiveMode=!1},va=({state:e},t={})=>{e.errors=t.errors||{}},wa=({state:e},t={})=>{let{name:r}=t;r&&e.errors[r]&&delete e.errors[r]},_a=({state:e})=>{e.reactiveMode=!0},xa=({state:e},t={})=>{let{x:r,y:i,content:s}=t;e.tooltipState={open:!0,x:r,y:i,content:s}},Sa=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},Aa=Object.freeze(Object.defineProperty({__proto__:null,clearFieldError:wa,collectAllDataFields:se,createInitialState:fa,flattenFields:Or,get:pe,getDefaultValue:Ir,hideTooltip:Sa,isDataField:Cr,pruneHiddenValues:tt,resetFormValues:ba,selectForm:ee,selectFormValues:Ce,selectViewData:ma,set:ue,setErrors:va,setFormFieldValue:ya,setFormValues:ga,setReactiveMode:_a,showTooltip:xa,validateField:_t,validateForm:xt},Symbol.toStringTag,{value:"Module"})),hs=({field:e,target:t,value:r})=>{!e||!t||["slider-with-input","popover-input"].includes(e.type)&&(r==null?t.removeAttribute("value"):t.setAttribute("value",String(r)))},fs=({form:e,formValues:t={},refs:r,formDisabled:i=!1})=>{let s=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=r[`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=pe(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())}l.type==="checkbox"&&(pe(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(s)},ms=(e,t)=>{let r=t?.defaultValues||{},i={};Object.keys(r).forEach(p=>{ue(i,p,r[p])});let s=ee({state:{formValues:i},props:t}),n=se(s.fields||[]),o={};for(let p of n){let l=pe(r,p.name);l!==void 0?ue(o,p.name,l):ue(o,p.name,Ir(p))}e.resetFormValues({defaultValues:o})},Ea=e=>{let{store:t,props:r}=e;ms(t,r)},ka=e=>{let{props:t,refs:r,render:i}=e,s=e.store.getState(),n=ee({state:s,props:t});fs({form:n,formValues:s.formValues,refs:r,formDisabled:!!t?.disabled}),i()},$a=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n,refs:o}=e,p=!!i?.disabled;r?.key!==i?.key&&ms(s,i);let l=s.getState();tt({state:l,props:i});let a=ee({state:l,props:i});fs({form:a,formValues:l.formValues,refs:o,formDisabled:p}),n()},Ca=(e,t)=>{let{store:r,dispatchEvent:i,render:s,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;r.setFormFieldValue({name:p,value:l});let a=r.getState();tt({state:a,props:n});let c=ee({state:a,props:n}),d=se(c.fields||[]).find(h=>h.name===p);if(hs({field:d,target:o.currentTarget,value:l}),a.reactiveMode&&d){let h=_t(d,l);h?r.setErrors({errors:{...a.errors,[p]:h}}):r.clearFieldError({name:p})}s(),i(new CustomEvent("form-input",{bubbles:!0,detail:{name:p,value:l,values:Ce({state:r.getState(),props:n})}}))},Ia=(e,t)=>{let{store:r,dispatchEvent:i,render:s,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;r.setFormFieldValue({name:p,value:l});let a=r.getState();tt({state:a,props:n});let c=ee({state:a,props:n}),d=se(c.fields||[]).find(h=>h.name===p);if(hs({field:d,target:o.currentTarget,value:l}),a.reactiveMode&&d){let h=_t(d,l);h?r.setErrors({errors:{...a.errors,[p]:h}}):r.clearFieldError({name:p})}s(),i(new CustomEvent("form-change",{bubbles:!0,detail:{name:p,value:l,values:Ce({state:r.getState(),props:n})}}))},Oa=(e,t)=>{let{store:r,dispatchEvent:i,render:s,props:n}=e,o=t._event.currentTarget.dataset.actionId;if(!o)return;let p=r.getState(),l=ee({state:p,props:n}),a=((l.actions||{}).buttons||[]).find(d=>d.id===o),c=Ce({state:p,props:n});if(a&&a.validate){let d=se(l.fields||[]),{valid:h,errors:f}=xt(d,p.formValues);r.setErrors({errors:f}),h||r.setReactiveMode(),s(),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}}))},Ta=(e,t)=>{let r=t._event;r.type==="contextmenu"&&r.preventDefault();let{store:i,dispatchEvent:s,props:n}=e,o=r.currentTarget.dataset.fieldName;s(new CustomEvent("form-field-event",{bubbles:!0,detail:{name:o,event:r.type,values:Ce({state:i.getState(),props:n})}}))},La=(e,t)=>{let{store:r,dispatchEvent:i,render:s,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=r.getState(),a=ee({state:l,props:n}),c=(a.actions||{}).buttons||[],d=c.find(f=>f.validate)||c[0];if(!d)return;let h=Ce({state:l,props:n});if(d.validate){let f=se(a.fields||[]),{valid:u,errors:m}=xt(f,l.formValues);r.setErrors({errors:m}),u||r.setReactiveMode(),s(),i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h,valid:u,errors:m}}))}else i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h}}))}},Na=(e,t)=>{let{store:r,render:i,props:s}=e,n=t._event,o=n.currentTarget.dataset.fieldName,p=ee({state:r.getState(),props:s}),l=se(p.fields||[]).find(a=>a.name===o);if(l&&l.tooltip){let a=n.currentTarget.getBoundingClientRect();r.showTooltip({x:a.left+a.width/2,y:a.top-8,content:typeof l.tooltip=="string"?l.tooltip:l.tooltip.content||""}),i()}},Va=e=>{let{store:t,render:r}=e;t.hideTooltip({}),r()},Ra=Object.freeze(Object.defineProperty({__proto__:null,handleActionClick:Oa,handleAfterMount:ka,handleBeforeMount:Ea,handleImageClick:Ta,handleKeyDown:La,handleOnUpdate:$a,handleTooltipMouseEnter:Na,handleTooltipMouseLeave:Va,handleValueChange:Ia,handleValueInput:Ca},Symbol.toStringTag,{value:"Module"})),ja=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"],Da=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input","slider-with-input"],Pa=({ref:e,fieldType:t,value:r,forceRefresh:i=!1})=>{if(ja.includes(t)){if(i&&e.removeAttribute("value"),r==null){if(Da.includes(t)&&i){if(t==="popover-input"){e.removeAttribute("value");return}e.setAttribute("value","");return}e.removeAttribute("value");return}e.setAttribute("value",String(r))}},ys=({ref:e,value:t})=>{e&&e?.store?.updateSelectedValue&&(e.store.updateSelectedValue({value:t}),typeof e.render=="function"&&e.render())},Ba=e=>{let t=new Map;return!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("[data-field-name]").forEach(r=>{let i=r.getAttribute("data-field-name");i&&t.set(i,r)}),t},ki=e=>e?.renderTarget?e.renderTarget:e?.shadowRoot?e.shadowRoot:e?.shadow,za=({root:e,values:t={}})=>{!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("rtgl-select[data-field-name], rtgl-segmented-control[data-field-name]").forEach(r=>{let i=r.dataset?.fieldName;if(!i)return;let s=pe(t,i);ys({ref:r,value:s})})},Wa=function(){let e=this.store.getState();return Ce({state:e,props:this.props})},Fa=function(e={}){let t=e&&typeof e=="object"&&e.values&&typeof e.values=="object"?e.values:e;if(!t||typeof t!="object"||Array.isArray(t))return;this.store.setFormValues({values:t}),this.store.pruneHiddenValues();let r=this.store.getState(),i=ee({state:r,props:this.props}),s=se(i.fields||[]),n=Ba(ki(this));for(let p of s){if(!p.name)continue;let l=n.get(p.name);if(!l)continue;let a=Object.prototype.hasOwnProperty.call(t,p.name),c=pe(t,p.name);if(!a&&c===void 0)continue;let d=pe(r.formValues,p.name);Pa({ref:l,fieldType:p.type,value:d,forceRefresh:!0}),typeof l?.tagName=="string"&&l.tagName.toUpperCase()==="RTGL-SELECT"&&ys({ref:l,value:d}),p.type==="checkbox"&&(d?l.setAttribute("checked",""):l.removeAttribute("checked"))}this.render();let o=()=>{let p=this.store.getState();za({root:ki(this),values:p.formValues})};o(),setTimeout(()=>{o()},0)},Ma=function(){let e=this.store.getState(),t=ee({state:e,props:this.props}),r=se(t.fields||[]),{valid:i,errors:s}=xt(r,e.formValues);return this.store.setErrors({errors:s}),i||this.store.setReactiveMode(),this.render(),{valid:i,errors:s}},Ka=function(){let e=this.props?.defaultValues||{},t={};Object.keys(e).forEach(n=>{ue(t,n,e[n])});let r=ee({state:{formValues:t},props:this.props}),i=se(r.fields||[]),s={};for(let n of i){let o=pe(e,n.name);o!==void 0?ue(s,n.name,o):ue(s,n.name,Ir(n))}this.store.resetFormValues({defaultValues:s}),this.setValues(s)},Ua=Object.freeze(Object.defineProperty({__proto__:null,getValues:Wa,reset:Ka,setValues:Fa,validate:Ma},Symbol.toStringTag,{value:"Module"})),gs=e=>{e&&(typeof e.componentDialogBodyHost?.replaceChildren=="function"&&e.componentDialogBodyHost.replaceChildren(),delete e.componentDialogBody)},Ha=e=>{let t=e.selectUiType();return t==="dropdown"||t==="formDialog"||t==="componentDialog"?null:e.selectConfig().mode==="confirm"?!1:null},he=({store:e,render:t,globalUI:r,refs:i,emitResult:s=!1,result:n})=>{if(!e.selectIsOpen())return;let o=n!==void 0?n:Ha(e);gs(i),e.closeAll(),t(),s&&r.emit("event",o)},bs=({store:e,render:t,globalUI:r,refs:i,error:s})=>{gs(i),e.selectIsOpen()&&(e.closeAll(),t()),r.emit("error",s)},rt=({store:e,render:t,globalUI:r,refs:i})=>{e.selectIsOpen()&&he({store:e,render:t,globalUI:r,refs:i,emitResult:!0})},it=(e,{rejectOnError:t=!1}={})=>new Promise((r,i)=>{let s=null,n=e.once("event",o=>{s?.(),r(o)});t&&(s=e.once("error",o=>{n?.(),i(o)}))}),qa=(e,t)=>{setTimeout(()=>{let{store:r,refs:i}=e;if(!r.selectIsOpen()||r.selectUiType()!=="formDialog")return;let s=r.selectFormDialogConfig?.();if(!s||s.key!==t||typeof s.mount!="function")return;let n=i.formDialog;n&&s.mount(n)},0)},Ga=(e,t)=>{setTimeout(()=>{let{store:r,refs:i,render:s,globalUI:n}=e;if(!r.selectIsOpen()||r.selectUiType()!=="componentDialog")return;let o=r.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){bs({store:r,render:s,globalUI:n,refs:i,error:l})}},0)},rr=(e,t)=>!e.selectIsOpen()||e.selectUiType()!=="componentDialog"?!1:e.selectComponentDialogConfig?.()?.key===t,Ya=e=>{let{store:t,render:r,globalUI:i,refs:s}=e;he({store:t,render:r,globalUI:i,refs:s,emitResult:!0})},Ja=e=>{let{store:t,render:r,globalUI:i,refs:s}=e,n=t.selectConfig().mode==="confirm"?!0:null;he({store:t,render:r,globalUI:i,refs:s,emitResult:!0,result:n})},Za=e=>{let{store:t,render:r,globalUI:i,refs:s}=e;he({store:t,render:r,globalUI:i,refs:s,emitResult:!0,result:!1})},Xa=e=>{let{store:t,render:r,globalUI:i,refs:s}=e;he({store:t,render:r,globalUI:i,refs:s,emitResult:!0,result:null})},Qa=(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t._event,{index:p,item:l}=o.detail;he({store:r,render:i,globalUI:s,refs:n,emitResult:!0,result:{index:p,item:l}})},el=(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t;return rt({store:r,render:i,globalUI:s,refs:n}),r.setAlertConfig(o),i(),it(s)},tl=async(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t;return rt({store:r,render:i,globalUI:s,refs:n}),r.setConfirmConfig(o),i(),it(s)},rl=async(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t;return rt({store:r,render:i,globalUI:s,refs:n}),r.setDropdownConfig(o),i(),it(s)},il=async(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t;rt({store:r,render:i,globalUI:s,refs:n}),r.setFormDialogConfig(o),i();let p=r.selectFormDialogConfig?.().key;return qa(e,p),it(s)},sl=async(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t;rt({store:r,render:i,globalUI:s,refs:n}),r.setComponentDialogConfig(o),i();let p=r.selectComponentDialogConfig?.().key;return Ga(e,p),it(s,{rejectOnError:!0})},nl=(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t._event?.detail??{};o.valid!==!1&&he({store:r,render:i,globalUI:s,refs:n,emitResult:!0,result:o})},ol=(e,t)=>{let{store:r,refs:i}=e,s=t._event?.detail??{},n=r.selectFormDialogConfig?.();typeof n?.onFieldEvent=="function"&&n.onFieldEvent({detail:s,formEl:i.formDialog??null})},al=e=>{let{store:t,render:r,globalUI:i,refs:s}=e;he({store:t,render:r,globalUI:i,refs:s,emitResult:!0})},ll=async(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t._event,p=Number(o?.currentTarget?.dataset?.actionIndex),l=r.selectComponentDialogConfig?.(),a=l?.key,c=Number.isInteger(p)?l?.actions?.buttons?.[p]:null;if(c){if(c.role==="cancel"){he({store:r,render:i,globalUI:s,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(!rr(r,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(!rr(r,a))return;he({store:r,render:i,globalUI:s,refs:n,emitResult:!0,result:{actionId:c.id,values:h}})}catch(d){if(!rr(r,a))return;bs({store:r,render:i,globalUI:s,refs:n,error:d})}}},pl=Object.freeze(Object.defineProperty({__proto__:null,handleCancel:Za,handleCloseAll:al,handleComponentDialogAction:ll,handleConfirm:Ja,handleDialogClose:Ya,handleDropdownClose:Xa,handleDropdownItemClick:Qa,handleFormAction:nl,handleFormFieldEvent:ol,handleShowAlert:el,handleShowComponentDialog:sl,handleShowConfirm:tl,handleShowDropdownMenu:rl,handleShowFormDialog:il},Symbol.toStringTag,{value:"Module"})),dl=new Set(["sm","md","lg","f"]),cl=new Set(["confirm","cancel"]),ul=Object.freeze([{id:"cancel",label:"Cancel",variant:"se",align:"left",role:"cancel"},{id:"confirm",label:"OK",variant:"pr",role:"confirm",validate:!0}]),dr=e=>!e||typeof e!="object"||Array.isArray(e)?{}:e,Re=(e,t="md")=>dl.has(e)?e:t,Tr=e=>{let t=(Array.isArray(e?.buttons)&&e.buttons.length>0?e.buttons:ul).map((r,i)=>{if(!r||typeof r!="object"||Array.isArray(r))throw new Error("component dialog buttons must be objects");if(typeof r.id!="string"||r.id.length===0)throw new Error("component dialog button id is required");if(typeof r.label!="string"||r.label.length===0)throw new Error("component dialog button label is required");if(!cl.has(r.role))throw new Error("component dialog button role must be 'confirm' or 'cancel'");return{...r,_globalIdx:i,variant:r.variant??(r.role==="confirm"?"pr":"se"),align:r.align??(r.role==="cancel"?"left":"right"),validate:r.role==="confirm"?!!r.validate:!1,_disabled:!!r.disabled,pre:r.pre??"",suf:r.suf??""}});return{_layout:"split",buttons:t,_leftButtons:t.filter(r=>r.align==="left"),_rightButtons:t.filter(r=>r.align!=="left")}},vs=()=>({title:"",description:"",size:"md",component:"",props:{},actions:Tr(),key:0}),hl=()=>Object.freeze({isOpen:!1,uiType:"dialog",config:{status:void 0,title:"",message:"",confirmText:"OK",cancelText:"Cancel",mode:"alert"},dropdownConfig:{items:[],x:0,y:0,place:"bs"},formDialogConfig:{form:null,defaultValues:{},context:{},disabled:!1,size:"md",key:0,onFieldEvent:null,mount:null},componentDialogConfig:vs()}),fl=({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},ml=({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},yl=({state:e},t={})=>{if(!t.items||!Array.isArray(t.items))throw new Error("items array is required for showDropdown");e.dropdownConfig={items:t.items,x:t.x??0,y:t.y??0,place:t.place??"bs"},e.uiType="dropdown",e.isOpen=!0},gl=({state:e},t={})=>{if(!t.form||typeof t.form!="object"||Array.isArray(t.form))throw new Error("form object is required for showFormDialog");let r=e.formDialogConfig?.key??0;e.formDialogConfig={form:t.form,defaultValues:dr(t.defaultValues),context:dr(t.context),disabled:!!t.disabled,size:Re(t.size,"md"),key:r+1,onFieldEvent:typeof t.onFieldEvent=="function"?t.onFieldEvent:null,mount:typeof t.mount=="function"?t.mount:null},e.uiType="formDialog",e.isOpen=!0},bl=({state:e},t={})=>{if(typeof t.component!="string"||!t.component.includes("-"))throw new Error("component tag name is required for showComponentDialog");let r=e.componentDialogConfig?.key??0;e.componentDialogConfig={title:typeof t.title=="string"?t.title:"",description:typeof t.description=="string"?t.description:"",size:Re(t.size,"md"),component:t.component,props:dr(t.props),actions:Tr(t.actions),key:r+1},e.uiType="componentDialog",e.isOpen=!0},vl=({state:e})=>{e.isOpen=!1,e.uiType="dialog"},wl=({state:e})=>e.config,_l=({state:e})=>e.dropdownConfig,xl=({state:e})=>e.formDialogConfig,Sl=({state:e})=>e.componentDialogConfig,Al=({state:e})=>e.uiType,El=({state:e})=>e.isOpen,kl=({state:e})=>{let t=e.isOpen&&e.uiType==="dialog",r=e.isOpen&&e.uiType==="formDialog",i=e.isOpen&&e.uiType==="componentDialog",s=e.componentDialogConfig??vs();return{isOpen:e.isOpen,uiType:e.uiType,config:e.config,dropdownConfig:{items:e.dropdownConfig?.items??[],x:e.dropdownConfig?.x??0,y:e.dropdownConfig?.y??0,place:e.dropdownConfig?.place??"bs"},formDialogConfig:{form:e.formDialogConfig?.form??{fields:[],actions:{buttons:[]}},defaultValues:e.formDialogConfig?.defaultValues??{},context:e.formDialogConfig?.context??{},disabled:!!e.formDialogConfig?.disabled,size:Re(e.formDialogConfig?.size,"md"),key:e.formDialogConfig?.key??0},componentDialogConfig:{title:s.title??"",description:s.description??"",size:Re(s.size,"md"),component:s.component??"",props:s.props??{},actions:s.actions??Tr(),key:s.key??0},isDialogOpen:t,isFormDialogOpen:r,isComponentDialogOpen:i,isDialogContainerOpen:t||r||i,isDropdownOpen:e.isOpen&&e.uiType==="dropdown",dialogSize:i?Re(s.size,"md"):r?Re(e.formDialogConfig?.size,"md"):"sm"}},$l=Object.freeze(Object.defineProperty({__proto__:null,closeAll:vl,createInitialState:hl,selectComponentDialogConfig:Sl,selectConfig:wl,selectDropdownConfig:_l,selectFormDialogConfig:xl,selectIsOpen:El,selectUiType:Al,selectViewData:kl,setAlertConfig:fl,setComponentDialogConfig:bl,setConfirmConfig:ml,setDropdownConfig:yl,setFormDialogConfig:gl},Symbol.toStringTag,{value:"Module"})),Cl=(e,t)=>{let{dispatchEvent:r,store:i}=e;t._event,console.log("handle click start",i.selectPath()),r(new CustomEvent("start-click",{detail:{path:i.selectPath()}}))},Il=Object.freeze(Object.defineProperty({__proto__:null,handleClickStart:Cl},Symbol.toStringTag,{value:"Module"})),Ol=()=>Object.freeze({}),Tl=["id","class","style","slot","start"],Ll=(e={})=>Object.entries(e).filter(([t])=>!Tl.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Nl=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}}}},Vl=({props:e})=>{let t=Nl(e.start)||e.start;return{containerAttrString:Ll(e),start:t||{label:"",image:{src:"",width:32,height:32,alt:""}}}},Rl=({props:e})=>e.start?.path,jl=({state:e})=>{},Dl=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Ol,selectPath:Rl,selectViewData:Vl,setState:jl},Symbol.toStringTag,{value:"Module"})),$i=e=>{let t=e.querySelectorAll("h1[id], h2[id], h3[id], h4[id], rtgl-text[id]");return Array.from(t)},Pl=e=>e.map(t=>{let r=1,i=t.tagName.toLowerCase();return i==="h1"?r=1:i==="h2"?r=2:i==="h3"?r=3:i==="h4"?r=4:i==="rtgl-text"&&(r=parseInt(t.getAttribute("data-level")||"1",10)),{id:t.id,href:`#${t.id}`,title:t.textContent,level:r}}),Ci=(e,t,r)=>{let{store:i,render:s}=r,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}),s())},Bl=(e,t,r,i)=>{let{store:s,render:n}=i,o=null,p=()=>{o=null;let d=$i(e);s.setItems({items:Pl(d)}),Ci(d,r,i),n()},l=()=>{o===null&&(o=requestAnimationFrame(p))},a=()=>{Ci($i(e),r,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)}},zl=e=>{let{props:t}=e,r=()=>{};return requestAnimationFrame(()=>{let i=document.getElementById(t.targetId);if(!i)return;let s=window;t.scrollContainerId&&(s=document.getElementById(t.scrollContainerId)||window);let n=parseInt(t.offsetTop||"100",10);r=Bl(i,s,n,e)}),()=>{r()}},Wl=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:zl},Symbol.toStringTag,{value:"Module"})),Fl=()=>Object.freeze({items:[],currentId:null,contentContainer:null}),Ml=({state:e})=>{let t=((r,i)=>{let s=new Set,n=r.findIndex(p=>p.id===i);if(n===-1)return s;let o=r[n].level;for(let p=n-1;p>=0;p--)if(r[p].level<o){let l=r[p].level;s.add(r[p].id);for(let a=p-1;a>=0;a--)r[a].level<l&&(s.add(r[a].id),l=r[a].level);break}return s})(e.items,e.currentId);return{items:e.items.map(r=>{let i={1:"0",2:"12px",3:"24px",4:"32px"},s=r.id===e.currentId,n=t.has(r.id),o=s||n;return{...r,c:o?"fg":"mu-fg",ml:i[r.level]||"",bc:o?"fg":"mu-fg"}}),currentId:e.currentId}},Kl=({state:e})=>e,Ul=({state:e})=>e.currentId,Hl=({state:e},t={})=>{e.items=Array.isArray(t.items)?t.items:[]},ql=({state:e},t={})=>{e.currentId=t.id},Gl=({state:e},t={})=>{e.contentContainer=t.container},Yl=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Fl,selectCurrentId:Ul,selectState:Kl,selectViewData:Ml,setContentContainer:Gl,setCurrentId:ql,setItems:Hl},Symbol.toStringTag,{value:"Module"})),st=e=>e==null||e===!0?"":String(e),ws=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=e,n=st(t);r.setValue({value:n}),r.closePopover({}),s(new CustomEvent("value-change",{detail:{value:n},bubbles:!0})),i()},Jl=e=>{let{store:t,props:r}=e;if(r.value!==void 0){let i=st(r.value);t.setValue({value:i}),t.setTempValue({value:i})}},Zl=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n}=e;if(r?.value!==i?.value){let o=st(i?.value);s.setValue({value:o}),s.getState().isOpen||s.setTempValue({value:o})}n()},Xl=(e,t)=>{let{store:r,render:i,refs:s,props:n}=e;if(n.disabled)return;let o=t._event,p=st(n.value);r.setValue({value:p}),r.setTempValue({value:p}),r.openPopover({position:{x:o.currentTarget.getBoundingClientRect().left,y:o.currentTarget.getBoundingClientRect().bottom}}),i(),setTimeout(()=>{let{input:l}=s;if(!l)return;l.value=p,l.focus();let a=l.shadowRoot?.querySelector("input, textarea");a&&typeof a.focus=="function"&&a.focus()},50)},Ql=(e,t)=>{let{store:r,render:i}=e;r.closePopover({}),i()},ep=(e,t)=>{let{store:r}=e,i=t._event,s=st(i.detail.value);r.setTempValue({value:s})},tp=e=>{let{store:t,refs:r}=e,{input:i}=r,s=i?i.value:t.getState().tempValue;ws(e,s)},rp=(e,t)=>{let{store:r,refs:i}=e,s=t._event;if(s.key==="Enter"){s.preventDefault(),s.stopPropagation();let{input:n}=i,o=n?n.value:r.getState().tempValue;ws(e,o)}else s.key==="Escape"&&(s.preventDefault(),s.stopPropagation(),r.closePopover({}),e.render())},ip=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Jl,handleInputChange:ep,handleInputKeydown:rp,handleOnUpdate:Zl,handlePopoverClose:Ql,handleSubmitClick:tp,handleTextClick:Xl},Symbol.toStringTag,{value:"Module"})),sp=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),np=({props:e,state:t})=>{let r=typeof t.value=="string"&&t.value.length>0,i=r?t.value:"-",s=typeof e.placeholder=="string"?e.placeholder:"",n=typeof e.label=="string"?e.label:"",o=!!e.disabled;return{isOpen:t.isOpen,position:t.position,value:i,valueColor:r?"fg":"mu-fg",tempValue:t.tempValue,placeholder:s,label:n,disabled:o}},op=({state:e},t={})=>{e.tempValue=t.value},ap=({state:e},t={})=>{let{position:r}=t;e.position=r,e.isOpen=!0,e.hasUnsavedChanges=!1},lp=({state:e})=>{e.isOpen=!1,e.tempValue=""},pp=({state:e},t={})=>{e.value=t.value},dp=({state:e})=>e.value,cp=Object.freeze(Object.defineProperty({__proto__:null,closePopover:lp,createInitialState:sp,openPopover:ap,selectValue:dp,selectViewData:np,setTempValue:op,setValue:pp},Symbol.toStringTag,{value:"Module"})),be=(e,t)=>{if(e===t)return!0;if(e==null||t==null||typeof e!="object"||typeof t!="object")return!1;let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let s of r)if(!i.includes(s)||!be(e[s],t[s]))return!1;return!0},Ii=({dispatchEvent:e,value:t,label:r,index:i,item:s})=>{e(new CustomEvent("value-change",{detail:{value:t,label:r,index:i,item:s},bubbles:!0}))},up=e=>{let{store:t,props:r,render:i}=e;if(r.selectedValue!==null&&r.selectedValue!==void 0&&r.options){let s=r.options.find(n=>be(n.value,r.selectedValue));s&&(t.updateSelectedValue({value:s.value}),i())}},hp=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n}=e,o=!1;r.selectedValue!==i.selectedValue&&(s.updateSelectedValue({value:i.selectedValue}),o=!0),o&&n()},_s=(e,t)=>{let{render:r,dispatchEvent:i,props:s,store:n}=e;if(s.disabled)return;let o=t._event;o.stopPropagation();let p=o.currentTarget.id.slice(6),l=Number(p),a=s.options[l],c=Object.prototype.hasOwnProperty.call(s||{},"selectedValue"),d=n.selectSelectedValue(),h=c?!0:n.selectHasSelectedValue(),f=a?h&&be(a.value,d):!1;if(a){if(f&&!s.noClear){n.clearSelectedValue({}),s.onChange&&typeof s.onChange=="function"&&s.onChange(void 0),Ii({dispatchEvent:i,value:void 0,label:void 0,index:null,item:void 0}),r();return}n.updateSelectedValue({value:a.value}),s.onChange&&typeof s.onChange=="function"&&s.onChange(a.value),Ii({dispatchEvent:i,value:a.value,label:a.label,index:l,item:a}),r()}},fp=(e,t)=>{let r=t._event;r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),_s(e,t))},mp=(e,t)=>{let{store:r,render:i}=e,s=t._event,n=parseInt(s.currentTarget.id.slice(6),10);r.setHoveredOption({optionId:n}),i()},yp=e=>{let{store:t,render:r}=e;t.clearHoveredOption({}),r()},xs=(e,t)=>{if(e.props.disabled)return;let{render:r,dispatchEvent:i}=e,{_event:s}=t;s.stopPropagation(),i(new CustomEvent("add-option-click",{bubbles:!0})),r()},gp=(e,t)=>{let r=t._event;r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),xs(e,t))},bp=e=>{let{store:t,render:r}=e;t.setHoveredAddOption({isHovered:!0}),r()},vp=e=>{let{store:t,render:r}=e;t.setHoveredAddOption({isHovered:!1}),r()},wp=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:xs,handleAddOptionKeyDown:gp,handleAddOptionMouseEnter:bp,handleAddOptionMouseLeave:vp,handleBeforeMount:up,handleOnUpdate:hp,handleOptionClick:_s,handleOptionKeyDown:fp,handleOptionMouseEnter:mp,handleOptionMouseLeave:yp},Symbol.toStringTag,{value:"Module"})),_p=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],xp=(e={})=>Object.entries(e).filter(([t])=>!_p.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Sp=()=>Object.freeze({selectedValue:null,hasSelectedValue:!1,hoveredOptionId:null,hoveredAddOption:!1}),Ap=({state:e,props:t})=>{let r=xp(t),i=!!t.disabled,s=Object.prototype.hasOwnProperty.call(t||{},"selectedValue"),n=s?t.selectedValue:e.selectedValue,o=s?!0:!!e.hasSelectedValue,p=t.options||[],l=p.map((a,c)=>{let d=o&&be(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:r,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"}},Ep=({state:e})=>e,kp=({state:e})=>e.selectedValue,$p=({state:e})=>!!e.hasSelectedValue,Cp=({state:e},t={})=>{e.selectedValue=t.value,e.hasSelectedValue=!0},Ip=({state:e})=>{e.selectedValue=void 0,e.hasSelectedValue=!1},Op=({state:e},t={})=>{e.hoveredOptionId=t.optionId},Tp=({state:e})=>{e.hoveredOptionId=null},Lp=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},Np=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:Tp,clearSelectedValue:Ip,createInitialState:Sp,selectHasSelectedValue:$p,selectSelectedValue:kp,selectState:Ep,selectViewData:Ap,setHoveredAddOption:Lp,setHoveredOption:Op,updateSelectedValue:Cp},Symbol.toStringTag,{value:"Module"})),Vp=e=>{let{store:t,props:r,render:i}=e;if(r.selectedValue!==null&&r.selectedValue!==void 0&&r.options){let s=r.options.find(n=>be(n.value,r.selectedValue));s&&(t.updateSelectedValue({value:s?.value}),i())}},Rp=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n}=e,o=!1;i?.disabled&&!r?.disabled&&(s.closeOptionsPopover({}),o=!0),r.selectedValue!==i.selectedValue&&(s.updateSelectedValue({value:i.selectedValue}),o=!0),o&&n()},Ss=(e,t)=>{let{store:r,render:i,refs:s,props:n}=e;if(n.disabled)return;t._event.stopPropagation();let o=s.selectButton.getBoundingClientRect(),p=r.selectSelectedValue(),l=p!==null?p:n.selectedValue,a=null;l!=null&&n.options&&(a=n.options.findIndex(c=>be(c.value,l)),a===-1&&(a=null)),r.openOptionsPopover({position:{y:o.bottom+12,x:o.left-24},selectedIndex:a}),i()},jp=(e,t)=>{let r=t._event;r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),Ss(e,t))},Dp=e=>{let{store:t,render:r}=e;t.closeOptionsPopover({}),r()},Pp=(e,t)=>{let{render:r,dispatchEvent:i,props:s,store:n}=e;if(s.disabled)return;let o=t._event;o.stopPropagation();let p=o.currentTarget.id.slice(6),l=Number(p),a=s.options[p];n.updateSelectedValue({value:a?.value}),s.onChange&&typeof s.onChange=="function"&&s.onChange(a.value),i(new CustomEvent("value-change",{detail:{value:a.value,label:a.label,index:l,item:a},bubbles:!0})),r()},Bp=(e,t)=>{let{store:r,render:i}=e,s=t._event,n=parseInt(s.currentTarget.id.slice(6),10);r.setHoveredOption({optionId:n}),i()},zp=(e,t)=>{let{store:r,render:i}=e;r.clearHoveredOption({}),i()},Wp=(e,t)=>{let{store:r,render:i,dispatchEvent:s,props:n}=e;n.disabled||(t._event.stopPropagation(),r.clearSelectedValue({}),n.onChange&&typeof n.onChange=="function"&&n.onChange(void 0),s(new CustomEvent("value-change",{detail:{value:void 0,label:void 0,index:null,item:void 0},bubbles:!0})),i())},Fp=(e,t)=>{if(e.props.disabled)return;let{store:r,render:i,dispatchEvent:s}=e,{_event:n}=t;n.stopPropagation(),r.closeOptionsPopover({}),s(new CustomEvent("add-option-click",{bubbles:!0})),i()},Mp=(e,t)=>{let{store:r,render:i}=e;r.setHoveredAddOption({isHovered:!0}),i()},Kp=(e,t)=>{let{store:r,render:i}=e;r.setHoveredAddOption({isHovered:!1}),i()},Up=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:Fp,handleAddOptionMouseEnter:Mp,handleAddOptionMouseLeave:Kp,handleBeforeMount:Vp,handleButtonClick:Ss,handleButtonKeyDown:jp,handleClearClick:Wp,handleClickOptionsPopoverOverlay:Dp,handleOnUpdate:Rp,handleOptionClick:Pp,handleOptionMouseEnter:Bp,handleOptionMouseLeave:zp},Symbol.toStringTag,{value:"Module"})),Hp=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],qp=(e={})=>Object.entries(e).filter(([t])=>!Hp.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Gp=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,hoveredOptionId:null,hoveredAddOption:!1}),Yp=({state:e,props:t})=>{let r=qp(t),i=!!t.disabled,s=Object.prototype.hasOwnProperty.call(t||{},"selectedValue")?t.selectedValue:e.selectedValue,n=t.placeholder||"Select an option",o=!0,p=t.options||[],l=p.find(c=>be(c.value,s));l&&(n=l.label,o=!1);let a=p.map((c,d)=>{let h=be(c.value,s),f=e.hoveredOptionId===d;return{...c,isSelected:h,bgc:f?"ac":h?"mu":""}});return{containerAttrString:r,isDisabled:i,isOpen:e.isOpen,position:e.position,options:a,selectedValue:s,selectedLabel:n,selectedLabelColor:o?"mu-fg":"fg",selectButtonCursor:i?"not-allowed":"pointer",selectButtonHoverBorderColor:i?"bo":"ac",selectButtonTabIndex:i?-1:0,hasValue:s!=null,showClear:!i&&!t.noClear&&s!=null,showAddOption:!i&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"ac":""}},Jp=({state:e})=>e,Zp=({state:e})=>e.selectedValue,Xp=({state:e},t={})=>{let{position:r,selectedIndex:i}=t;e.position=r,e.isOpen=!0,i!=null&&(e.hoveredOptionId=i)},Qp=({state:e})=>{e.isOpen=!1},ed=({state:e},t={})=>{e.selectedValue=t.value,e.isOpen=!1},td=({state:e})=>{e.selectedValue=void 0},rd=({state:e},t={})=>{e.hoveredOptionId=t.optionId},id=({state:e})=>{e.hoveredOptionId=null},sd=({state:e})=>{e.selectedValue=void 0},nd=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},od=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:id,clearSelectedValue:sd,closeOptionsPopover:Qp,createInitialState:Gp,openOptionsPopover:Xp,resetSelection:td,selectSelectedValue:Zp,selectState:Jp,selectViewData:Yp,setHoveredAddOption:nd,setHoveredOption:rd,updateSelectedValue:ed},Symbol.toStringTag,{value:"Module"})),Oi=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},ad=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?Oi(e.tooltip):Oi(e.showCompactTooltip),ld=(e,t)=>{let{store:r,dispatchEvent:i}=e,s=t._event,n,o=r.selectHeader();s.currentTarget.id==="headerLabel"?n=o.labelPath:s.currentTarget.id==="headerImage"?n=o.image.path:s.currentTarget.id==="header"&&(n=o.path),i(new CustomEvent("header-click",{detail:{path:n},bubbles:!0,composed:!0}))},pd=(e,t)=>{let{store:r,dispatchEvent:i,render:s}=e,n=t._event,o=n.currentTarget.dataset.itemId||n.currentTarget.id.slice(4),p=r.selectItem(o);r.hideTooltip({}),s(),i(new CustomEvent("item-click",{detail:{item:p},bubbles:!0,composed:!0}))},dd=(e,t)=>{let{props:r,store:i,render:s}=e;if(!ad(r)||(r.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}),s())},cd=e=>{let{store:t,render:r}=e;t.hideTooltip({}),r()},ud=Object.freeze(Object.defineProperty({__proto__:null,handleHeaderClick:ld,handleItemClick:pd,handleItemMouseEnter:dd,handleItemMouseLeave:cd},Symbol.toStringTag,{value:"Module"})),hd=()=>Object.freeze({tooltipState:{open:!1,x:0,y:0,place:"r",content:""}}),fd=["id","class","style","slot","header","items","selectedItemId","mode","hideHeader","tooltip","showCompactTooltip","w","bwr"],md=(e={})=>Object.entries(e).filter(([t])=>!fd.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Je=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}}}},cr=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},yd=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?cr(e.tooltip):cr(e.showCompactTooltip),gd=(e,t)=>e!=null&&e!==""?e:t==="full"?272:64,Ti=(e={})=>e.label!==void 0&&e.label!==null?e.label:e.title!==void 0&&e.title!==null?e.title:"";function Lr(e,t=null){let r=[];for(let i of e){let s=i.id||i.href||i.path,n=s!=null&&t===s,o=Ti(i);if(r.push({id:s,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=Ti(p);r.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 r}var bd=({state:e,props:t})=>{let r=Je(t.header)||t.header,i=Je(t.items)||t.items,s=t.selectedItemId,n=md(t),o=t.mode||"full",p=r||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},l=i?Lr(i,s):[],a=!cr(t.hideHeader),c=yd(t),d=t.bwr||"xs",h=gd(t.w,o),f=o==="full"?"fs":"c",u=o==="full"?"fs":"c",m=o==="full"?"lg":"sm",y=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}`,N=o==="full"?"f":b;return{containerAttrString:n,mode:o,header:p,items:l,sidebarWidth:h,headerAlign:f,itemAlign:u,headerPadding:m,itemPadding:y,itemHeight:b,iconSize:g,firstLetterSize:_,showLabels:S,showGroupLabels:A,itemContentAlign:C,itemAlignAttr:I,itemWidth:N,headerWidth:N,selectedItemId:s,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:""}}},vd=({props:e})=>Je(e.header)||e.header,wd=({state:e,props:t})=>{let r=Je(t.items)||t.items;return(r?Lr(r):[]).find(i=>i.active)},_d=({props:e},t)=>{let r=Je(e.items)||e.items;return(r?Lr(r):[]).find(i=>i.id===t)},xd=({state:e})=>{},Sd=({state:e},t={})=>{let{x:r,y:i,place:s="r",content:n=""}=t;e.tooltipState={open:!0,x:r,y:i,place:s,content:n}},Ad=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},Ed=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:hd,hideTooltip:Ad,selectActiveItem:wd,selectHeader:vd,selectItem:_d,selectViewData:bd,setState:xd,showTooltip:Sd},Symbol.toStringTag,{value:"Module"})),kd=e=>{let{store:t,props:r}=e;t.setValue({value:r.value??0})},$d=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n}=e,o=r?.key!==i?.key,p=r?.value!==i?.value;if(o||p){let l=i?.value??0;s.setValue({value:l}),n()}},Cd=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=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;r.setValue({value:o}),p&&typeof p.setAttribute=="function"&&p.setAttribute("value",String(o)),i(),s(new CustomEvent("value-change",{detail:{value:o},bubbles:!0}))},Id=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=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;r.setValue({value:o}),p&&typeof p.setAttribute=="function"&&p.setAttribute("value",String(o)),i(),s(new CustomEvent("value-input",{detail:{value:o},bubbles:!0}))},Od=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:kd,handleOnUpdate:$d,handleValueChange:Cd,handleValueInput:Id},Symbol.toStringTag,{value:"Module"})),Td=()=>Object.freeze({value:0}),Ld=({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}),Nd=({state:e},t={})=>{e.value=t.value},Vd=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Td,selectViewData:Ld,setValue:Nd},Symbol.toStringTag,{value:"Module"})),Rd=e=>{},jd=(e,t)=>{let{dispatchEvent:r,props:i}=e,s=t._event,n=parseInt(s.currentTarget.id.slice(3),10),o=i.data?.rows?.[n];o&&r(new CustomEvent("row-click",{detail:{rowIndex:n,rowData:o}}))},Dd=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=e,n=t._event.currentTarget.dataset.columnKey,o=r.selectSortInfo(),p="asc";o.column===n&&(o.direction==="asc"?p="desc":o.direction==="desc"&&(p=null)),p?r.setSortColumn({column:n,direction:p}):r.clearSort(),i(),s(new CustomEvent("header-click",{detail:{column:n,direction:p,sortInfo:p?{column:n,direction:p}:null}}))},Pd=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Rd,handleHeaderClick:Dd,handleRowClick:jd},Symbol.toStringTag,{value:"Module"})),Bd=()=>Object.freeze({sortColumn:null,sortDirection:null}),zd=["id","class","style","slot","data"],Wd=(e={})=>Object.entries(e).filter(([t])=>!zd.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Fd=(e,t)=>{let r=t.split("."),i=e;for(let s of r){if(i==null)return null;i=i[s]}return i},Md=({state:e,props:t})=>{let r=Wd(t),i=t.data||{columns:[],rows:[]},s=i.rows.map((n,o)=>{let p=i.columns.map(l=>{let a=Fd(n,l.key);return{key:l.key,value:a!=null?String(a):""}});return{index:o,cells:p}});return{containerAttrString:r,columns:i.columns||[],rows:s||[]}},Kd=({state:e})=>e,Ud=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),Hd=({state:e},{column:t,direction:r}={})=>{e.sortColumn=t,e.sortDirection=r},qd=({state:e})=>{e.sortColumn=null,e.sortDirection=null},Gd=Object.freeze(Object.defineProperty({__proto__:null,clearSort:qd,createInitialState:Bd,selectSortInfo:Ud,selectState:Kd,selectViewData:Md,setSortColumn:Hd},Symbol.toStringTag,{value:"Module"})),Yd=(e,t)=>{let{dispatchEvent:r}=e,i=t._event.currentTarget.dataset.id;r(new CustomEvent("item-click",{detail:{id:i}}))},Jd=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:Yd},Symbol.toStringTag,{value:"Module"})),Zd=()=>Object.freeze({}),Xd=["id","class","style","slot","items","selectedTab"],Qd=(e={})=>Object.entries(e).filter(([t])=>!Xd.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),ec=({props:e})=>{let t=Qd(e),r=e.items||[],i=e.selectedTab,s=r.map(n=>({...n,isSelected:n.id===i,bgColor:n.id===i?"ac":"",borderColor:n.id===i?"":"tr",textColor:n.id===i?"":"mu-fg"}));return{containerAttrString:t,items:s,selectedTab:i}},tc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Zd,selectViewData:ec},Symbol.toStringTag,{value:"Module"})),rc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),ic=()=>Object.freeze({}),Li={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))"}},sc=({props:e})=>{let t=Li[e.s]?e.s:"sm",r=Li[t];return{open:!!e.open,x:e.x||0,y:e.y||0,place:e.place||"t",content:e.content||"",textSize:r.textSize,padding:r.padding,contentStyle:`padding: 0; min-width: 0; max-width: ${r.maxWidth};`}},nc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:ic,selectViewData:sc},Symbol.toStringTag,{value:"Module"})),oc=async e=>{let{props:t,store:r,render:i,refs:s}=e,{waveformData:n}=t;r.setWaveformData({data:n}),i();let o=s.canvas;o&&As(n,o)},ac=async(e,t)=>{let{store:r,render:i,refs:s,props:n}=e,{waveformData:o}=n;if(!o){console.log("waveform handleOnUpdate: no waveformData provided");return}r.setWaveformData({data:o}),i();let p=s.canvas;p&&As(o,p)};async function As(e,t){let r=t.getContext("2d"),i=t.getBoundingClientRect(),s=i.width,n=i.height;t.width=s,t.height=n;let o=t.width,p=t.height;if(r.clearRect(0,0,o,p),r.fillStyle="#1a1a1a",r.fillRect(0,0,o,p),!e||!e.amplitudes)return;let l=e.amplitudes,a=p/2,c=r.createLinearGradient(0,0,0,p);c.addColorStop(0,"#404040"),c.addColorStop(.5,"#A1A1A1"),c.addColorStop(1,"#404040");let d=Math.max(1,o/l.length),h=.2;for(let f=0;f<l.length;f++){let u=l[f]/255*(p*.85),m=f*d,y=a-u/2;r.fillStyle=c,r.fillRect(m,y,Math.max(1,d*(1-h)),u)}r.strokeStyle="rgba(255, 255, 255, 0.1)",r.lineWidth=1,r.beginPath(),r.moveTo(0,a),r.lineTo(o,a),r.stroke(),r.shadowBlur=10,r.shadowColor="#2196F3"}var lc=Object.freeze(Object.defineProperty({__proto__:null,handleAfterMount:oc,handleOnUpdate:ac},Symbol.toStringTag,{value:"Module"})),pc=()=>Object.freeze({waveformData:null}),dc=({state:e},t={})=>{e.waveformData=t.data},cc=({state:e,props:t})=>({isLoading:t.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:t.waveformData}),uc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:pc,selectViewData:cc,setWaveformData:dc},Symbol.toStringTag,{value:"Module"})),Es=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ks=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase()),ur=e=>{if(e!=null)return e===""?!0:e},mt=(e,t)=>{let r=e.getAttribute(t);if(r!==null)return ur(r);let i=Es(t);if(i!==t){let s=e.getAttribute(i);if(s!==null)return ur(s)}},ir=Symbol("rtglReactivePropValues"),hc=e=>(Object.prototype.hasOwnProperty.call(e,ir)||Object.defineProperty(e,ir,{value:Object.create(null),enumerable:!1,configurable:!1,writable:!1}),e[ir]),fc=({source:e,allowedKeys:t=[],onPropChange:r})=>{let i=hc(e);t.forEach(s=>{if(typeof s!="string"||s.length===0)return;let n=Object.prototype.hasOwnProperty.call(e,s)?e[s]:void 0,o=Object.prototype.hasOwnProperty.call(e,s);o&&delete e[s],Object.defineProperty(e,s,{configurable:!0,enumerable:!0,get(){return Object.prototype.hasOwnProperty.call(i,s)?i[s]:mt(e,s)},set(p){let l=Object.prototype.hasOwnProperty.call(i,s)?i[s]:mt(e,s);p===void 0?delete i[s]:i[s]=p,l!==p&&r?.({propName:s,oldValue:l,newValue:p})}}),o&&(i[s]=n)})},mc=(e,t)=>{let r=new Set(t);return new Proxy({},{get(i,s){if(typeof s=="string"&&r.has(s)){let n=e[s];return n!==void 0?n:mt(e,s)}},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(i,s){return typeof s=="string"&&r.has(s)},ownKeys(){return[...r]},getOwnPropertyDescriptor(i,s){if(typeof s=="string"&&r.has(s))return{configurable:!0,enumerable:!0,get:()=>{let n=e[s];return n!==void 0?n:mt(e,s)}}}})},yc=({schema:e,methodExports:t=[]})=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("componentName is required.");if(typeof e.componentName!="string"||e.componentName.trim()==="")throw new Error("componentName is required.");if(Object.prototype.hasOwnProperty.call(e,"attrsSchema"))throw new Error("attrsSchema is not supported.");if(Object.prototype.hasOwnProperty.call(e,"methods")){let r=e.methods;if(!r||typeof r!="object"||Array.isArray(r))throw new Error("methods must be an object schema with a properties map.");if(Object.prototype.hasOwnProperty.call(r,"type")&&r.type!=="object")throw new Error("methods.type must be 'object'.");if(!r.properties||typeof r.properties!="object"||Array.isArray(r.properties))throw new Error("methods.properties must be an object keyed by method name.");for(let i of Object.keys(r.properties))if(!t.includes(i))throw new Error(`method '${i}' is declared in schema but missing in .methods.js exports.`)}return!0},v={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9,PARTIAL:10,PATH_REFERENCE:11},P={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},hr={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"}},Ni=e=>{if(!e||e.trim()==="")throw new k("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new k(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${r}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let r of t)if(e.trim().endsWith(r))throw new k(`Incomplete comparison expression - missing right operand (got: '${e}')`)},gc=e=>{if(e.trim().endsWith(" in"))throw new k(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new k(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new k(`Missing iterable expression after 'in' (got: '$for ${e}')`);let i=t.includes(",")?t.split(",").map(s=>s.trim()):[t.trim()];for(let s of i){if(!s)throw new k(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(s))throw new k(`Invalid loop syntax (got: '$for ${e}')`)}},bc=(e,t,r=!1)=>{if(t===null)return new ie(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new ie(`Cannot iterate over undefined value at '$for ${e}'`);let i=typeof t;return r?new ie(`Cannot iterate over non-array value in loop '${e}' - got ${i} instead`):new ie(`Cannot iterate over non-array value (got: ${i}) at '$for ${e}'`)},vc=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new ie(`Unknown function '${e}' (${r})`)},$s=(e,t,r={})=>{let i={},s={};r&&typeof r=="object"&&(r.functions!==void 0||r.partials!==void 0?(i=r.functions||{},s=r.partials||{}):typeof r=="object"&&(i=r));let n=R(e,{functions:i,partials:s},t,{});return n===void 0?{}:n},R=(e,t,r,i)=>{if(t.functions,e.var&&!e.type)return U(e.var,r,i);if(e.type===v.LITERAL)return e.value;if(e.type===v.VARIABLE)return U(e.path,r,i);if(e.type===v.INTERPOLATION)return _c(e.parts,t,r,i);switch(e.type){case v.FUNCTION:return Cs(e,t,r,i);case v.BINARY:return Is(e,t,r,i);case v.UNARY:return Os(e,t,r,i);case v.CONDITIONAL:return Sc(e,t,r,i);case v.LOOP:return Cc(e,t,r,i);case v.OBJECT:return Oc(e,t,r,i);case v.ARRAY:return Tc(e,t,r,i);case v.PARTIAL:return Lc(e,t,r,i);case v.PATH_REFERENCE:return Nc(e,t,r,i);default:throw new Error(`Unknown node type: ${e.type}`)}},Vi=new Map,wc=e=>{let t=[],r="",i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(n==="[")r&&(t.push({type:"property",value:r}),r=""),i=!0;else if(n==="]"){if(i&&r){let o=r.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});r=""}i=!1}else r+=n}return r&&t.push({type:"property",value:r}),t},U=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let i=Vi.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=wc(l.trim());i.push(...a)}Vi.set(e,i)}let s=t;for(let n=0;n<i.length;n++){let o=i[n];if(o.type==="property"&&o.value in r){s=r[o.value];continue}if(s==null)return;(o.type==="property"||o.type==="index")&&(s=s[o.value])}return s},_c=(e,t,r,i)=>{let s=[];for(let n of e)if(typeof n=="string")s.push(n);else{let o=R(n,t,r,i);s.push(o!=null?String(o):"")}return s.join("")},Cs=(e,t,r,i)=>{let s=t.functions||t,n=s[e.name];if(!n)throw vc(e.name,s);let o=e.args.map(p=>R(p,t,r,i));return n(...o)},De=(e,t,r,i)=>{if(e.var&&!e.type)return U(e.var,r,i);switch(e.type){case v.VARIABLE:return U(e.path,r,i);case v.LITERAL:return e.value;case v.BINARY:return Is(e,t,r,i);case v.UNARY:return Os(e,t,r,i);case v.FUNCTION:return Cs(e,t,r,i);default:return R(e,t,r,i)}},Is=(e,t,r,i)=>{if(e.op===P.AND||e.op===P.OR){let o=De(e.left,t,r,i),p=De(e.right,t,r,i);switch(e.op){case P.AND:return o&&p;case P.OR:return o||p}}let s=R(e.left,t,r,i),n=R(e.right,t,r,i);switch(e.op){case P.EQ:return s==n;case P.NEQ:return s!=n;case P.GT:return s>n;case P.LT:return s<n;case P.GTE:return s>=n;case P.LTE:return s<=n;case P.IN:return Array.isArray(n)?n.includes(s):!1;case P.ADD:if(typeof s!="number"||typeof n!="number")throw new ie(`Arithmetic operations require numbers. Got ${typeof s} + ${typeof n}`);return s+n;case P.SUBTRACT:if(typeof s!="number"||typeof n!="number")throw new ie(`Arithmetic operations require numbers. Got ${typeof s} - ${typeof n}`);return s-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},Os=(e,t,r,i)=>{let s=e.op===hr.NOT?De(e.operand,t,r,i):R(e.operand,t,r,i);switch(e.op){case hr.NOT:return!s;default:throw new Error(`Unknown unary operator: ${e.op}`)}},xc=(e,t,r,i)=>{if(e.conditions.length===2&&e.conditions[1]===null){let s=e.conditions[0];if(s.type===v.VARIABLE)if(U(s.path,r,i)){let n=e.bodies[0];if(n.type===v.OBJECT&&n.properties.length<=5){let o={};for(let p of n.properties){let l=p.parsedKey?R(p.parsedKey,t,r,i):p.key,a=p.value;if(a.type===v.LITERAL)o[l]=a.value;else if(a.type===v.VARIABLE)o[l]=U(a.path,r,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=U(d.path,r,i);c.push(h!=null?String(h):"")}else{let h=R(d,t,r,i);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=R(a,t,r,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?R(p.parsedKey,t,r,i):p.key,a=p.value;if(a.type===v.LITERAL)o[l]=a.value;else if(a.type===v.VARIABLE)o[l]=U(a.path,r,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=U(d.path,r,i);c.push(h!=null?String(h):"")}else{let h=R(d,t,r,i);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=R(a,t,r,i)}return o}}}return null},Sc=(e,t,r,i)=>{let s=xc(e,t,r,i);if(s!==null)return s;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||De(o,t,r,i))return R(e.bodies[n],t,r,i)}return Ts},Ac=(e,t)=>{let r=e.body,i=e.itemVar;if(r.type===v.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===v.VARIABLE){let s=r.conditions[0].path,n=r.bodies[0];if(s.startsWith(i+".")){let o=s.substring(i.length+1);if(n.type===v.OBJECT&&n.properties.length<=5){for(let l of n.properties)if(l.parsedKey)return null;let p=[];for(let l=0;l<t.length;l++){let 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 m=u.substring(i.length+1);c[h]=a[m]}else return null}else if(f.type===v.INTERPOLATION){let u=[],m=!0;for(let y of f.parts)if(typeof y=="string")u.push(y);else if(y.type===v.VARIABLE){let b=y.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{m=!1;break}}else{m=!1;break}if(!m)return null;c[h]=u.join("")}else return null}p.push(c)}}return p}}}return null},Ec=(e,t)=>{let r=e.body,i=e.itemVar,s=Ac(e,t);if(s!==null)return s;if(r.type===v.OBJECT&&r.properties.length<=5&&!r.whenCondition){for(let p of r.properties)if(p.parsedKey)return null;let n=[],o=!0;for(let p of r.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},kc=(e,t,r,i,s)=>{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<s.length;a++){let c=s[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("."),m=u[0];m in i.__paths__&&(f=i.__paths__[m],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 m=u.parsedKey?R(u.parsedKey,t,r,h):u.key,y=u.value;if(y.type===v.LITERAL)d[m]=y.value;else if(y.type===v.VARIABLE){let b=y.path;if(b===p)d[m]=c;else if(b===l)d[m]=a;else if(b.startsWith(p+".")){let g=b.substring(p.length+1);!g.includes(".")&&!g.includes("[")?d[m]=c[g]:d[m]=U(b,r,{...i,[p]:c,...l&&{[l]:a}})}else d[m]=U(b,r,{...i,[p]:c,...l&&{[l]:a}})}else if(y.type===v.INTERPOLATION){let b=[];for(let g of y.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=g.path,S;if(_===p)S=c;else if(_===l)S=a;else if(_.startsWith(p+".")){let A=_.substring(p.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=U(_,r,{...i,[p]:c,...l&&{[l]:a}})}else S=U(_,r,{...i,[p]:c,...l&&{[l]:a}});b.push(S!=null?String(S):"")}else{let _={...i,[p]:c,...l&&{[l]:a}},S=R(g,t,r,_);b.push(S!=null?String(S):"")}d[m]=b.join("")}else{let b={...i,[p]:c,...l&&{[l]:a}};d[m]=R(y,t,r,b)}}n.push(d)}return n}return null},$c=(e,t,r)=>{let i=e.body;if(i.type===v.OBJECT&&i.properties.length===1&&i.properties[0].key==="$if item.visible"){let s=i.properties[0].value;if(s.type===v.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===v.VARIABLE&&s.conditions[0].path==="item.visible"){let n=s.bodies[0];if(n.type===v.OBJECT&&n.properties.length===2){let 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},Cc=(e,t,r,i)=>{let s=R(e.iterable,t,r,i);if(!Array.isArray(s)){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 bc(d,s,c)}if(!e.indexVar){let a=$c(e,s,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=Ec(e,s);if(a!==null)return a}let n=kc(e,t,r,i,s);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<s.length;a++){let c=e.indexVar?{...i,[e.itemVar]:s[a],[e.indexVar]:a}:{...i,[e.itemVar]:s[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,r,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},Ic=(e,t,r,i)=>{if(e.whenCondition)return null;if(e.properties.length===1){let s=e.properties[0],n=s.parsedKey?R(s.parsedKey,t,r,i):s.key,o=s.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?R(c.parsedKey,t,r,i):c.key,h=c.value;if(h.type===v.LITERAL)l[d]=h.value;else if(h.type===v.VARIABLE)l[d]=U(h.path,r,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 m=U(u.path,r,i);f.push(m!=null?String(m):"")}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 m=u.key,y=u.value;if(y.type===v.LITERAL)f[m]=y.value;else if(y.type===v.VARIABLE)f[m]=U(y.path,r,i);else if(y.type===v.INTERPOLATION){let b=[];for(let g of y.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=U(g.path,r,i);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[m]=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},Oc=(e,t,r,i)=>{let s=t.functions||t;if(e.whenCondition&&!De(e.whenCondition,s,r,i))return;let n=Ic(e,t,r,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,r,i):a.key,d=a.value;if(d.type===v.LITERAL)l[c]=d.value;else if(d.type===v.VARIABLE)l[c]=U(d.path,r,i);else if(d.type===v.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===v.VARIABLE){let u=U(f.path,r,i);h.push(u!=null?String(u):"")}else{let u=R(f,t,r,i);h.push(u!=null?String(u):"")}l[c]=h.join("")}else l[c]=R(d,t,r,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,r,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,r,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=R(c.value,t,r,i);d!==void 0&&(o[l.key]=d)}else{let d=R(l.value,t,r,i);d!==void 0&&(o[l.key]=d)}}else{let c=l.parsedKey?R(l.parsedKey,t,r,i):l.key,d=R(l.value,t,r,i);d!==void 0&&(o[c]=d)}}return o},Ts={},Tc=(e,t,r,i)=>{let s=[];for(let n of e.items)if(n.type===v.LOOP){let o=R(n,t,r,i);Array.isArray(o)&&n.flatten!==!1?s.push(...o):s.push(o)}else{let o=R(n,t,r,i);o!==Ts&&o!==void 0&&s.push(o)}return s},Lc=(e,t,r,i)=>{let{name:s,data:n,whenCondition:o}=e,p=t.partials||{},l=t.functions||t;if(o&&!De(o,l,r,i))return;if(!p[s])throw new ie(`Partial '${s}' is not defined`);let a=i._partialStack||[];if(a.includes(s))throw new ie(`Circular partial reference detected: ${s}`);let c=p[s],d=r,h={...i,_partialStack:[...a,s]};if(i){d={...r};for(let f of Object.keys(i))f.startsWith("_")||(d[f]=i[f])}if(n){let f=R(n,t,r,i);d={...d,...f}}return R(c,t,d,h)},Nc=(e,t,r,i)=>{let{path:s}=e,n=s.split("."),o=n[0],p=n.slice(1);if(!i||!(o in i))throw new ie(`Path reference '#{${s}}' 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 '#{${s}}' 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 '#{${s}}' - cannot access properties on index variable '${o}'`);return String(l)}return p.length>0&&(l+="."+p.join(".")),l},Vc=/\$\{([^}]*)\}/g,Rc=/#\{([^}]*)\}/g,Ls=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,i,s]=r,n=jc(s,t);return{isFunction:!0,type:v.FUNCTION,name:i,args:n}},jc=(e,t={})=>e.trim()?Dc(e).map(r=>Pc(r.trim(),t)):[],Dc=e=>{let t=[],r="",i=0,s=!1,n="";for(let o=0;o<e.length;o++){let p=e[o],l=o>0?e[o-1]:"";!s&&(p==='"'||p==="'")?(s=!0,n=p,r+=p):s&&p===n&&l!=="\\"?(s=!1,n="",r+=p):!s&&p==="("?(i++,r+=p):!s&&p===")"?(i--,r+=p):!s&&p===","&&i===0?(t.push(r),r=""):r+=p}return r&&t.push(r),t},Pc=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:v.LITERAL,value:parseFloat(e)};if(e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};let r=Ls(e,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};let i=e.trim(),s=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:o,type:p}of s){let l=0;for(;l<i.length;){let a=Le(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 Q(i,t)}catch{return{type:v.VARIABLE,path:i}}return{type:v.VARIABLE,path:i}},Ns=/^\w+\(.*\)$/,Bc=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,zc=e=>{if(!(!e||e.trim()===""||Ns.test(e))&&Bc.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}"`)},Ri=e=>{let t=e.trim();if(Ns.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}},yt=(e,t={})=>{let r=e.trim();zc(r);let i=Ls(r,t);if(i.isFunction)return{type:i.type,name:i.name,args:i.args};if(r.includes("[")&&!/[\s+\-*/%|&?:]/.test(r)){let s=0;for(let n of r)n==="["?s++:n==="]"&&s--;if(s!==0)throw new Error("Invalid array index syntax")}return{type:v.VARIABLE,path:r}},Vs=(e,t={})=>{let r=e,i=[];(e.includes("\\${")||e.includes("\\#{"))&&(r=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),r=r.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),r=r.replace(/\\(\$\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\(#\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\DOUBLE_ESC_VAR/g,"\\"),r=r.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let s=[...r.matchAll(Vc)],n=[...r.matchAll(Rc)],o=[...s.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=r;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]===r&&i.length===0){let{match:a,type:c}=o[0];try{return c==="variable"?yt(a[1],t):Ri(a[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:v.LITERAL,value:r};throw d}}let p=[],l=0;for(let{match:a,type:c}of o){let[d,h]=a,f=a.index;if(f>l){let u=r.substring(l,f);for(let m=0;m<i.length;m++)u=u.replace(`__ESCAPED_${m}__`,i[m]);u&&p.push(u)}try{let u;c==="variable"?u=yt(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<r.length){let a=r.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}},Ee=(e,t)=>typeof e=="string"?Vs(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Fc(e,t):Mc(e,t):{type:v.LITERAL,value:e},Wc=e=>{let{$each:t,...r}=e;if(typeof t!="string")throw new k("$each value must be a non-empty string");let i=t.trim();if(i==="")throw new k("$each value must be a non-empty string");if(Object.keys(r).length===0)throw new k("Empty $each body not allowed");if(r.$partial!==void 0)throw new k("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${i}`]:r}},Fc=(e,t)=>{let r=[],i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let l=Wc(n),a=Object.keys(l);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let c=ji(a[0],l[a[0]],t,!0);r.push(c),i=!0;continue}}catch(l){throw l instanceof k?l:new k(l.message)}let p=Object.keys(n);if(p.length===1&&/^\$for(?::\w+)?\s/.test(p[0])){let l=ji(p[0],n[p[0]],t);r.push(l),i=!0;continue}}let o=Ee(n,t);r.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:r,fast:!i}},Mc=(e,t)=>{let r=[],i=!1,s=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 m=null;if(u&&(m=Ee(f,t),m.type===v.OBJECT)){let b=!1;for(let g of m.properties)if(g.value.type===v.VARIABLE||g.value.type===v.INTERPOLATION||g.value.type===v.FUNCTION||g.value.type===v.CONDITIONAL||g.value.type===v.OBJECT&&!g.value.fast||g.value.type===v.ARRAY&&!g.value.fast){b=!0;break}b&&(m.fast=!1)}let y={type:v.PARTIAL,name:c,data:m};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new k("Empty condition expression after '$when'");b=Q(d,t)}else b={type:v.LITERAL,value:d};y.whenCondition=b}return y}for(let[l,a]of n)if(l==="$when"){if(s!==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'");s=Q(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=Kc(n,o,t);r.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=Ee(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=Vs(l,t),h={key:l,value:c};(d.type!==v.LITERAL||d.value!==l)&&(h.parsedKey=d),r.push(h),o++}}}let p={type:v.OBJECT,properties:r,fast:!i};return s&&(p.whenCondition=s),p},Kc=(e,t,r={})=>{let i=[],s=[],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());Ni(a);let c=Q(a,r);for(i.push(c),s.push(Ee(p,r)),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{Ni(u);let m=Q(u,r);i.push(m)}if(s.push(Ee(h,r)),n++,u===null)break}else break}return{node:{type:v.CONDITIONAL,conditions:i,bodies:s,id:l},nextIndex:n}},Q=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let 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 Q(a,t)}let r=Le(e,"||");if(r!==-1)return{type:v.BINARY,op:P.OR,left:Q(e.substring(0,r).trim(),t),right:Q(e.substring(r+2).trim(),t)};let i=Le(e,"&&");if(i!==-1)return{type:v.BINARY,op:P.AND,left:Q(e.substring(0,i).trim(),t),right:Q(e.substring(i+2).trim(),t)};let s=[{op:">=",type:P.GTE},{op:"<=",type:P.LTE},{op:"==",type:P.EQ},{op:"!=",type:P.NEQ},{op:">",type:P.GT},{op:"<",type:P.LT},{op:" in ",type:P.IN}];for(let{op:a,type:c}of s){let d=Le(e,a);if(d!==-1)return{type:v.BINARY,op:c,left:Q(e.substring(0,d).trim(),t),right:Q(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=Le(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:Q(e.substring(0,n).trim(),t),right:Q(e.substring(n+o.op.length).trim(),t)};let l=[" * "," / "," % "];for(let a of l)if(Le(e,a)!==-1)throw new k(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:v.UNARY,op:hr.NOT,operand:Q(e.substring(1).trim(),t)}:Rs(e,t)},Le=(e,t)=>{let r=0,i=0;for(;i<=e.length-t.length;){if(e[i]==="(")r++;else if(e[i]===")")r--;else if(r===0&&e.substring(i,i+t.length)===t)return i;i++}return-1},Uc=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}},Rs=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return yt(r,t);let i=Uc(r);if(i.type===v.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:v.VARIABLE,path:r};try{return yt(r,t)}catch(s){if(s.message&&s.message.includes("not supported"))return i;throw s}},Hc=(e,t=!1)=>{try{gc(e)}catch(r){if(r instanceof k&&t){let i=r.message.replace(/\$for/g,"$each");throw new k(i.replace("Parse Error: ",""))}throw r}},ji=(e,t,r,i=!1)=>{let s=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(s);if(!n){let y=i?"$each":"$for";throw new k(`Invalid loop syntax (got: '${e.replace("$for",y)}')`)}let o=n[1],p=n[2].trim();Hc(p,i);let l=p.match(/^(.+?)\s+in\s+(.+)$/);if(!l){let y=i?"$each":"$for";throw new k(`Invalid loop syntax - missing 'in' keyword (got: '${y} ${p}')`)}let a=l[1].trim(),c=l[2].trim(),d,h=null;if(a.includes(",")){let y=a.split(",").map(b=>b.trim());if(y.length!==2)throw new k(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=y[0],h=y[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=Rs(c,r),m=Ee(t,r);return{type:v.LOOP,itemVar:d,indexVar:h,iterable:u,body:m,flatten:o!=="nested"}},fr=(e,t={})=>{let{functions:r={}}=t;return Ee(e,r)},qc=()=>Date.now(),Gc=Object.freeze(Object.defineProperty({__proto__:null,now:qc},Symbol.toStringTag,{value:"Module"})),js=(e,t,r={})=>{let{functions:i={},partials:s={}}=r,n={...Gc,...i},o=fr(e,{functions:n}),p={};for(let[l,a]of Object.entries(s))p[l]=fr(a,{functions:n});return $s(o,t,{functions:n,partials:p})},Ze=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Yc=(e,t)=>{!t||typeof t!="object"||Object.entries(t).forEach(([r,i])=>{if(r==="default")throw new Error("[Methods] Invalid method name 'default'. Use named exports in .methods.js; default export is not supported.");if(typeof i=="function"){if(r in e)throw new Error(`[Methods] Cannot define method '${r}' because it already exists on the component instance.`);Object.defineProperty(e,r,{configurable:!0,enumerable:!1,writable:!1,value:(s={})=>{let n=s===void 0?{}:s;if(!Ze(n))throw new Error(`[Methods] Method '${r}' expects payload to be an object.`);return i.call(e,n)}})}})},Ds=Symbol.for("immer-nothing"),Di=Symbol.for("immer-draftable"),ne=Symbol.for("immer-state");function de(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Pe=Object.getPrototypeOf;function Be(e){return!!e&&!!e[ne]}function ke(e){return e?Ps(e)||Array.isArray(e)||!!e[Di]||!!e.constructor?.[Di]||At(e)||Et(e):!1}var Jc=Object.prototype.constructor.toString();function Ps(e){if(!e||typeof e!="object")return!1;let t=Pe(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===Jc}function gt(e,t){St(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,i)=>t(i,r,e))}function St(e){let t=e[ne];return t?t.type_:Array.isArray(e)?1:At(e)?2:Et(e)?3:0}function mr(e,t){return St(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Bs(e,t,r){let i=St(e);i===2?e.set(t,r):i===3?e.add(r):e[t]=r}function Zc(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function At(e){return e instanceof Map}function Et(e){return e instanceof Set}function xe(e){return e.copy_||e.base_}function yr(e,t){if(At(e))return new Map(e);if(Et(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Ps(e);if(t===!0||t==="class_only"&&!r){let i=Object.getOwnPropertyDescriptors(e);delete i[ne];let s=Reflect.ownKeys(i);for(let n=0;n<s.length;n++){let o=s[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(Pe(e),i)}else{let i=Pe(e);if(i!==null&&r)return{...e};let s=Object.create(i);return Object.assign(s,e)}}function Nr(e,t=!1){return kt(e)||Be(e)||!ke(e)||(St(e)>1&&(e.set=e.add=e.clear=e.delete=Xc),Object.freeze(e),t&&Object.entries(e).forEach(([r,i])=>Nr(i,!0))),e}function Xc(){de(2)}function kt(e){return Object.isFrozen(e)}var Qc={};function $e(e){let t=Qc[e];return t||de(0,e),t}var Xe;function zs(){return Xe}function eu(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Pi(e,t){t&&($e("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function gr(e){br(e),e.drafts_.forEach(tu),e.drafts_=null}function br(e){e===Xe&&(Xe=e.parent_)}function Bi(e){return Xe=eu(Xe,e)}function tu(e){let t=e[ne];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function zi(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[ne].modified_&&(gr(t),de(4)),ke(e)&&(e=bt(t,e),t.parent_||vt(t,e)),t.patches_&&$e("Patches").generateReplacementPatches_(r[ne].base_,e,t.patches_,t.inversePatches_)):e=bt(t,r,[]),gr(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ds?e:void 0}function bt(e,t,r){if(kt(t))return t;let i=t[ne];if(!i)return gt(t,(s,n)=>Wi(e,i,t,s,n,r)),t;if(i.scope_!==e)return t;if(!i.modified_)return vt(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;let s=i.copy_,n=s,o=!1;i.type_===3&&(n=new Set(s),s.clear(),o=!0),gt(n,(p,l)=>Wi(e,i,s,p,l,r,o)),vt(e,s,!1),r&&e.patches_&&$e("Patches").generatePatches_(i,r,e.patches_,e.inversePatches_)}return i.copy_}function Wi(e,t,r,i,s,n,o){if(Be(s)){let p=n&&t&&t.type_!==3&&!mr(t.assigned_,i)?n.concat(i):void 0,l=bt(e,s,p);if(Bs(r,i,l),Be(l))e.canAutoFreeze_=!1;else return}else o&&r.add(s);if(ke(s)&&!kt(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;bt(e,s),(!t||!t.scope_.parent_)&&typeof i!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,i)&&vt(e,s)}}function vt(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Nr(t,r)}function ru(e,t){let r=Array.isArray(e),i={type_:r?1:0,scope_:t?t.scope_:zs(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},s=i,n=Vr;r&&(s=[i],n=Qe);let{revoke:o,proxy:p}=Proxy.revocable(s,n);return i.draft_=p,i.revoke_=o,p}var Vr={get(e,t){if(t===ne)return e;let r=xe(e);if(!mr(r,t))return iu(e,r,t);let i=r[t];return e.finalized_||!ke(i)?i:i===sr(e.base_,t)?(nr(e),e.copy_[t]=wr(i,e)):i},has(e,t){return t in xe(e)},ownKeys(e){return Reflect.ownKeys(xe(e))},set(e,t,r){let i=Ws(xe(e),t);if(i?.set)return i.set.call(e.draft_,r),!0;if(!e.modified_){let s=sr(xe(e),t),n=s?.[ne];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Zc(r,s)&&(r!==void 0||mr(e.base_,t)))return!0;nr(e),vr(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return sr(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,nr(e),vr(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=xe(e),i=Reflect.getOwnPropertyDescriptor(r,t);return i&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:i.enumerable,value:r[t]}},defineProperty(){de(11)},getPrototypeOf(e){return Pe(e.base_)},setPrototypeOf(){de(12)}},Qe={};gt(Vr,(e,t)=>{Qe[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Qe.deleteProperty=function(e,t){return Qe.set.call(this,e,t,void 0)};Qe.set=function(e,t,r){return Vr.set.call(this,e[0],t,r,e[0])};function sr(e,t){let r=e[ne];return(r?xe(r):e)[t]}function iu(e,t,r){let i=Ws(t,r);return i?"value"in i?i.value:i.get?.call(e.draft_):void 0}function Ws(e,t){if(!(t in e))return;let r=Pe(e);for(;r;){let i=Object.getOwnPropertyDescriptor(r,t);if(i)return i;r=Pe(r)}}function vr(e){e.modified_||(e.modified_=!0,e.parent_&&vr(e.parent_))}function nr(e){e.copy_||(e.copy_=yr(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var su=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,i)=>{if(typeof t=="function"&&typeof r!="function"){let n=r;r=t;let o=this;return function(p=n,...l){return o.produce(p,a=>r.call(this,a,...l))}}typeof r!="function"&&de(6),i!==void 0&&typeof i!="function"&&de(7);let s;if(ke(t)){let n=Bi(this),o=wr(t,void 0),p=!0;try{s=r(o),p=!1}finally{p?gr(n):br(n)}return Pi(n,i),zi(s,n)}else if(!t||typeof t!="object"){if(s=r(t),s===void 0&&(s=t),s===Ds&&(s=void 0),this.autoFreeze_&&Nr(s,!0),i){let n=[],o=[];$e("Patches").generateReplacementPatches_(t,s,n,o),i(n,o)}return s}else de(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(n,...o)=>this.produceWithPatches(n,p=>t(p,...o));let i,s;return[this.produce(t,r,(n,o)=>{i=n,s=o}),i,s]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ke(e)||de(8),Be(e)&&(e=nu(e));let t=Bi(this),r=wr(e,void 0);return r[ne].isManual_=!0,br(t),r}finishDraft(e,t){let r=e&&e[ne];(!r||!r.isManual_)&&de(9);let{scope_:i}=r;return Pi(i,t),zi(void 0,i)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let s=t[r];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}r>-1&&(t=t.slice(r+1));let i=$e("Patches").applyPatches_;return Be(e)?i(e,t):this.produce(e,s=>i(s,t))}};function wr(e,t){let r=At(e)?$e("MapSet").proxyMap_(e,t):Et(e)?$e("MapSet").proxySet_(e,t):ru(e,t);return(t?t.scope_:zs()).drafts_.push(r),r}function nu(e){return Be(e)||de(10,e),Fs(e)}function Fs(e){if(!ke(e)||kt(e))return e;let t=e[ne],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=yr(e,t.scope_.immer_.useStrictShallowCopy_)}else r=yr(e,!0);return gt(r,(i,s)=>{Bs(r,i,Fs(s))}),t&&(t.finalized_=!1),r}var oe=new su,ou=oe.produce;oe.produceWithPatches.bind(oe);oe.setAutoFreeze.bind(oe);oe.setUseStrictShallowCopy.bind(oe);oe.applyPatches.bind(oe);oe.createDraft.bind(oe);oe.finishDraft.bind(oe);var au=(e,t,r)=>{let{createInitialState:i,...s}=e,n={},o={},p={};return i&&(p=i({props:t,constants:r})),Object.entries(s).forEach(([l,a])=>{if(l.startsWith("select")){n[l]=(...c)=>a({state:p,props:t,constants:r},...c);return}o[l]=(c={})=>{let d=c===void 0?{}:c;if(!Ze(d))throw new Error(`[Store] Action '${l}' expects payload to be an object.`);return p=ou(p,h=>a({state:h,props:t,constants:r},d)),p}}),{getState:()=>p,...o,...n}},Ms=e=>!Ze(e)||Object.isFrozen(e)?e:(Object.values(e).forEach(t=>{Ms(t)}),Object.freeze(e)),lu=({setupConstants:e,fileConstants:t})=>{let r=Ze(e)?e:{},i=Ze(t)?t:{};return Ms({...r,...i})},pu=(e,t)=>{if(!t||typeof t!="object")return"";let r="",i=n=>Object.entries(n).map(([o,p])=>` ${o}: ${p};`).join(`
1477
1477
  `),s=(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} {
1478
1478
  ${d.split(`
1479
1479
  `).map(h=>h?` ${h}`:"").join(`
@@ -1485,7 +1485,7 @@ ${l}
1485
1485
  ${p}
1486
1486
  }`};return Object.entries(t).forEach(([n,o])=>{let p=s(n,o);p&&(r+=(r?`
1487
1487
 
1488
- `:"")+p)}),r},_r=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(..._r(r));else{if(r&&typeof r=="object"){let i=Object.entries(r);if(i.length>0){let[s,n]=i[0];Array.isArray(n)&&(r={[s]:_r(n)})}}t.push(r)}return t},[]):e,or=":",ou=new Set(["__proto__","constructor","prototype"]),au=/^[A-Za-z_][A-Za-z0-9_.:-]*$/,zi=e=>au.test(e),Wi=(e,t)=>{if(!t)return e;let r=[],i="",s=!1;for(let n=0;n<t.length;n++){let o=t[n];if(!s&&o===".")i&&(r.push(i),i="");else if(!s&&o==="[")i&&(r.push(i),i=""),s=!0;else if(s&&o==="]"){if(i){if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))r.push(i.slice(1,-1));else{let p=Number(i);r.push(Number.isNaN(p)?i:p)}i=""}s=!1}else i+=o}return i&&r.push(i),r.reduce((n,o)=>{if(n==null)return;let p=typeof o=="number"?o:String(o);if(!(typeof p=="string"&&ou.has(p)))return n[p]},e)},lu=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase()),pu=({attrsString:e="",viewData:t={},tagName:r,isWebComponent:i})=>{let s={},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=lu(g);if(!A)throw new Error(`[Parser] Invalid ${S} prop name on '${r}'.`);if(Object.prototype.hasOwnProperty.call(n,A))throw new Error(`[Parser] Duplicate prop binding '${A}' on '${r}'. Use only one of 'name=value' or ':name=\${expr}'.`);n[A]=_},l=(g,_)=>{if(!zi(g))throw new Error(`[Parser] Invalid ${_} attribute name '${g}' on '${r}'.`)};if(!e)return{attrs:s,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(".")){s[g]=_;continue}if(g.startsWith(or)){let S=g.substring(1),A=_;if(c[4]!==void 0&&c[4]!==""){let E=c[4],C=Wi(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=Wi(t,A),E&&(s[S]=""),i&&S!=="id"&&p(S,!!E,"boolean attribute-form");continue}l(g,"binding"),s[g]=_,i&&g!=="id"&&p(g,_,"attribute-form")}let h=e,f=[],u,m=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g;for(;(u=m.exec(e))!==null;)f.push(u[0]);f.forEach(g=>{h=h.replace(g," ")});let y=/(\S+?)(?=\s|$)/g,b;for(;(b=y.exec(h))!==null;){let g=b[1];if(!g.startsWith(".")&&!(d.has(g)||g.startsWith(or)||g.includes("="))){if(g.startsWith("?")){let _=g.substring(1);l(_,"boolean toggle"),o(_),s[_]="",i&&_!=="id"&&p(_,!0,"boolean attribute-form");continue}if(!zi(g))throw new Error(`[Parser] Invalid attribute token '${g}' on '${r}'.`);!d.has(g)&&!g.startsWith(or)&&!g.includes("=")&&(s[g]="",i&&g!=="id"&&p(g,!0,"boolean attribute-form"))}}return{attrs:s,props:n}},xr=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,du=/^\$for\s+([A-Za-z_][A-Za-z0-9_]*)(?:\s*,\s*([A-Za-z_][A-Za-z0-9_]*))?\s+in\s+.+$/,Ws=/^\$\{([^{}]+)\}$/,cu=/^[A-Za-z_][A-Za-z0-9_]*(?:(?:\.[A-Za-z_][A-Za-z0-9_]*)|\[(?:\d+|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')\])*$/,Fi=new WeakSet,Vr=(e,t,r)=>{let i=new Set(e);return t&&i.add(t),r&&i.add(r),i},uu=(e,t)=>{if(typeof e!="string")return t;let r=e.match(du);return r?Vr(t,r[1],r[2]):t},Fs=e=>{if(typeof e!="string"||!e.includes(":")&&!e.includes("."))return null;xr.lastIndex=0;let t;for(;(t=xr.exec(e))!==null;){let r=t[1];if(r.startsWith("."))return{bindingName:r,rawValue:t[2]??t[3]??t[4]??"",key:e};if(!r.startsWith(":"))continue;let i=t[2]!==void 0||t[3]!==void 0,s=t[2]??t[3]??t[4]??"";if(i||!Ws.test(s))return{bindingName:r,rawValue:s,key:e}}return null},Sr=(e,t=new Set)=>{if(Array.isArray(e)){for(let r of e){let i=Sr(r,t);if(i)return i}return null}if(!e||typeof e!="object")return null;for(let[r,i]of Object.entries(e)){let s=Fs(r);if(s)return s;let n=uu(r,t),o=Sr(i,n);if(o)return o}return null},Ne=(e,t=new Set)=>{if(!e||typeof e!="object")return null;if(Array.isArray(e)){for(let r of e){let i=Ne(r,t);if(i)return i}return null}if(e.type===v.LOOP){let r=Vr(t,e.itemVar,e.indexVar);return Ne(e.body,r)}if(e.type===v.ARRAY&&Array.isArray(e.items))return Ne(e.items,t);if(e.type===v.OBJECT&&Array.isArray(e.properties)){for(let r of e.properties){let i=Fs(r.key);if(i)return i;let s=Ne(r.value,t);if(s)return s}return null}for(let r of Object.values(e)){let i=Ne(r,t);if(i)return i}return null},hu=e=>fr([{[e]:""}])?.items?.[0]?.properties?.[0]?.parsedKey,fu=e=>{let t=e.match(Ws);return t?t[1].trim():null},mu=e=>{let t=e.match(/^([A-Za-z_][A-Za-z0-9_]*)/);return t?t[1]:null},yu=(e,t)=>{let r=!1,i=e.replace(xr,(s,n,o,p,l)=>{if(!n.startsWith(":"))return s;let a=o??p??l??"",c=fu(a);if(!c||!cu.test(c))return s;let d=mu(c);if(!d)return s;let h=t.has(d)?`#{${c}}`:c;return h===a?s:(r=!0,`${n}=${h}`)});return r?i:e},Ve=(e,t=new Set)=>{if(!(!e||typeof e!="object")){if(Array.isArray(e)){e.forEach(r=>Ve(r,t));return}if(e.type===v.LOOP){let r=Vr(t,e.itemVar,e.indexVar);Ve(e.body,r);return}if(e.type===v.ARRAY&&Array.isArray(e.items)){e.items.forEach(r=>Ve(r,t));return}if(e.type===v.OBJECT&&Array.isArray(e.properties)){e.properties.forEach(r=>{let i=yu(r.key,t);if(i!==r.key){r.key=i;let s=hu(i);s?r.parsedKey=s:delete r.parsedKey}Ve(r.value,t)});return}Object.values(e).forEach(r=>{Ve(r,t)})}},gu=e=>e?e.type&&typeof e.type=="number"?Ne(e):Sr(e):null,bu=e=>{if(!e||typeof e!="object"||Fi.has(e))return;let t=gu(e);if(t)throw new Error(`Property-form bindings must use ':prop=\${value}' syntax. Found '${t.bindingName}=${t.rawValue}' in '${t.key}'.`);Ve(e),Fi.add(e)},vu=/^[a-z][a-zA-Z0-9]*\*?$/,wu=/^[a-zA-Z][a-zA-Z0-9_-]*\*?$/,_u=/^[a-z][a-zA-Z0-9]*$/,Mi=new Set(["window","document"]),Ms=e=>Object.entries(e||{}).map(([t,r])=>{if(Mi.has(t))return{refKey:t,refConfig:r,targetType:"global",isWildcard:!1,prefix:t};let i="id",s=t;t.startsWith(".")?(i="class",s=t.slice(1)):t.startsWith("#")&&(i="id",s=t.slice(1));let n=s.endsWith("*")?s.slice(0,-1):s;if(Mi.has(n))throw new Error(`[Parser] Invalid ref key '${t}'. Reserved global keys must be exactly 'window' or 'document'.`);if(i==="id"&&!vu.test(s))throw new Error(`[Parser] Invalid ref key '${t}'. Use camelCase IDs (optional '#', optional '*') or class refs with '.' prefix.`);if(i==="class"&&!wu.test(s))throw new Error(`[Parser] Invalid ref key '${t}'. Class refs must start with '.' and use class-compatible names (optional '*').`);let o=s.endsWith("*"),p=o?s.slice(0,-1):s;return{refKey:t,refConfig:r,targetType:i,isWildcard:o,prefix:p}}),xu=e=>{if(!_u.test(e))throw new Error(`[Parser] Invalid element id '${e}' for refs. Use camelCase ids only. Kebab-case ids are not supported.`)},Ki=({value:e,prefix:t,isWildcard:r})=>typeof e!="string"||e.length===0?!1:r?e.startsWith(t):e===t,Ks=({elementIdForRefs:e,classNames:t=[],refMatchers:r})=>{let i=[],s=Array.isArray(t)?t:[];return r.forEach(n=>{if(n.targetType==="global")return;if(n.targetType==="id"){Ki({value:e,prefix:n.prefix,isWildcard:n.isWildcard})&&i.push({...n,matchedValue:e});return}let o=s.find(p=>Ki({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])},Ge=({optionName:e,optionValue:t,eventType:r,refKey:i})=>{if(t!==void 0&&typeof t!="boolean")throw new Error(`[Parser] Invalid '${e}' for event '${r}' on ref '${i}'. Expected boolean.`)},Ui=({optionName:e,optionValue:t,eventType:r,refKey:i})=>{if(t!==void 0&&(typeof t!="number"||Number.isNaN(t)||!Number.isFinite(t)||t<0))throw new Error(`[Parser] Invalid '${e}' for event '${r}' on ref '${i}'. Expected non-negative number.`)},Su=({eventType:e,eventConfig:t,refKey:r})=>{if(typeof t!="object"||t===null)throw new Error(`[Parser] Invalid event config for event '${e}' on ref '${r}'.`);let i=Object.prototype.hasOwnProperty.call(t,"debounce"),s=Object.prototype.hasOwnProperty.call(t,"throttle");if(Ge({optionName:"preventDefault",optionValue:t.preventDefault,eventType:e,refKey:r}),Ge({optionName:"stopPropagation",optionValue:t.stopPropagation,eventType:e,refKey:r}),Ge({optionName:"stopImmediatePropagation",optionValue:t.stopImmediatePropagation,eventType:e,refKey:r}),Ge({optionName:"targetOnly",optionValue:t.targetOnly,eventType:e,refKey:r}),Ge({optionName:"once",optionValue:t.once,eventType:e,refKey:r}),Ui({optionName:"debounce",optionValue:t.debounce,eventType:e,refKey:r}),Ui({optionName:"throttle",optionValue:t.throttle,eventType:e,refKey:r}),i&&s)throw new Error(`[Parser] Event '${e}' on ref '${r}' cannot define both 'debounce' and 'throttle'.`);if(t.handler&&t.action)throw new Error("Each listener can have handler or action but not both");if(!t.handler&&!t.action)throw new Error("Each listener must define either handler or action");return{hasDebounce:i,hasThrottle:s}},Us=e=>(e.__eventRateLimitState||Object.defineProperty(e,"__eventRateLimitState",{value:new Map,enumerable:!1,configurable:!0}),e.__eventRateLimitState),Au=({eventConfig:e,handlers:t,onMissingHandler:r,parseAndRenderFn:i})=>{let s=n=>{let o=e.payload&&typeof e.payload=="object"&&!Array.isArray(e.payload)?e.payload:{};return typeof i!="function"?o:i(o,{_event:n})};if(e.action){if(typeof t.handleCallStoreAction!="function")throw new Error(`[Runtime] Action listener '${e.action}' requires handlers.handleCallStoreAction.`);return n=>{let o=s(n);t.handleCallStoreAction({...o,_event:n,_action:e.action})}}return e.handler&&t[e.handler]?n=>{let o=s(n);t[e.handler]({...o,_event:n})}:(e.handler&&r?.(e.handler),null)},Eu=({eventConfig:e,callback:t,hasDebounce:r,hasThrottle:i,stateKey:s,eventRateLimitState:n,fallbackCurrentTarget:o=null,nowFn:p=Date.now,setTimeoutFn:l=setTimeout,clearTimeoutFn:a=clearTimeout})=>c=>{let d=n.get(s)||{},h=c.currentTarget||o;if(e.once)if(h){if(d.onceTargets||(d.onceTargets=new WeakSet),d.onceTargets.has(h)){n.set(s,d);return}d.onceTargets.add(h)}else if(d.onceTriggered){n.set(s,d);return}else d.onceTriggered=!0;if(e.targetOnly&&c.target!==c.currentTarget){n.set(s,d);return}if(e.preventDefault&&c.preventDefault(),e.stopImmediatePropagation?c.stopImmediatePropagation():e.stopPropagation&&c.stopPropagation(),r){d.debounceTimer&&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(s,d);return}if(i){Object.prototype.hasOwnProperty.call(d,"lastThrottleAt")||(d.lastThrottleAt=void 0);let f=p();if(d.lastThrottleAt===void 0||f-d.lastThrottleAt>=e.throttle){d.lastThrottleAt=f,n.set(s,d),t(c);return}n.set(s,d);return}n.set(s,d),t(c)},Hs=({eventType:e,eventConfig:t,refKey:r,handlers:i,eventRateLimitState:s,stateKey:n,fallbackCurrentTarget:o=null,parseAndRenderFn:p,onMissingHandler:l,nowFn:a=Date.now,setTimeoutFn:c=setTimeout,clearTimeoutFn:d=clearTimeout})=>{let{hasDebounce:h,hasThrottle:f}=Su({eventType:e,eventConfig:t,refKey:r}),u=Au({eventConfig:t,handlers:i,onMissingHandler:l,parseAndRenderFn:p});return u?Eu({eventConfig:t,callback:u,hasDebounce:h,hasThrottle:f,stateKey:n,eventRateLimitState:s,fallbackCurrentTarget:o,nowFn:a,setTimeoutFn:c,clearTimeoutFn:d}):null},ku=({h:e,template:t,viewData:r,refs:i,handlers:s,createComponentUpdateHook:n})=>{bu(t);let o=As(t,r,{}),p=_r(o),l=$u({h:e,items:p,refs:i,handlers:s,viewData:r,createComponentUpdateHook:n});return e("div",{style:{display:"contents"}},l)},$u=({h:e,items:t,refs:r={},handlers:i={},viewData:s={},createComponentUpdateHook:n})=>{if(!Array.isArray(t))throw new Error("[Parser] Input to createVirtualDom must be an array, got "+typeof t);let o=Ms(r),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[m,y]=u[0];if(!isNaN(Number(m)))return Array.isArray(y)?l(y,f):typeof y=="object"&&y!==null&&Object.entries(y).length>0?l([y],f):String(y);u.length>1&&console.warn("Item has multiple keys, processing only the first:",m);let b,g,_=m.indexOf(" ");_===-1?(b=m,g=""):(b=m.substring(0,_),g=m.substring(_+1).trim());let S=b.split(/[.#]/)[0],A=S.includes("-"),E,C;try{({attrs:E,props:C}=pu({attrsString:g,viewData:s,tagName:S,isWebComponent:A}))}catch(H){throw new Error(`[Parser] Failed to parse bindings for selector '${b}' with attrs '${g}': ${H.message}`)}let I=b.match(/#([^.#\s]+)/);I&&!Object.prototype.hasOwnProperty.call(E,"id")&&(E.id=I[1]);let N=null;E.id&&(N=E.id);let z=(b.match(/\.([^.#]+)/g)||[]).map(H=>H.substring(1)),B=typeof E.class=="string"?E.class.split(/\s+/).filter(Boolean):[],J=[...new Set([...z,...B])],Z=Object.create(null),me=null;if(!A){z.forEach(Ie=>{Z[Ie]=!0});let H=b.match(/#([^.#\s]+)/);H&&(me=H[1])}let ve;typeof y=="string"||typeof y=="number"?ve=String(y):Array.isArray(y)?ve=l(y,f):ve=[],me&&!A&&(E.id=me);let $t=Object.create(null);if(o.length>0){p&&N&&xu(N);let H=Ks({elementIdForRefs:N,classNames:J,refMatchers:o});if(H){let Ie=H.refKey,jr=H.matchedValue||N||Ie;if(H.refConfig&&H.refConfig.eventListeners){let Js=H.refConfig.eventListeners,Zs=Us(i);Object.entries(Js).forEach(([Ct,Xs])=>{let Qs=`${Ie}:${jr}:${Ct}`,Dr=Hs({eventType:Ct,eventConfig:Xs,refKey:Ie,handlers:i,eventRateLimitState:Zs,stateKey:Qs,parseAndRenderFn:Ns,onMissingHandler:en=>{console.warn(`[Parser] Handler '${en}' for refKey '${Ie}' (matching '${jr}') is referenced but not found in available handlers.`)}});Dr&&($t[Ct]=Dr)})}}}let ye={};if(N?ye.key=N:b&&(ye.key=`${b}-${f}`),Object.keys(E).length>0&&(ye.attrs=E),Object.keys(Z).length>0&&(ye.class=Z),Object.keys($t).length>0&&(ye.on=$t),Object.keys(C).length>0&&(ye.props=C),A&&typeof n=="function"){let H=n({selector:b,tagName:S});H&&(ye.hook=H)}try{return e(S,ye,ve)}catch(H){throw new Error(`[Parser] Error creating virtual node for '${S}': ${H.message}`)}}).filter(Boolean)}return l(t)},Cu=({baseDeps:e,refs:t,dispatchEvent:r,store:i,render:s})=>({...e,refs:t,dispatchEvent:r,store:i,render:s}),Iu=({store:e,render:t,parseAndRenderFn:r})=>i=>{let{_event:s,_action:n}=i,o=r(i,{_event:s});if(!e[n])throw new Error(`[Store] Action 'store.${n}' is not defined.`);e[n](o),t()},Ou=({handlers:e,deps:t,parseAndRenderFn:r})=>{let i={handleCallStoreAction:Iu({store:t.store,render:t.render,parseAndRenderFn:r})};return Object.keys(e||{}).forEach(s=>{i[s]=n=>e[s](t,n)}),i},Tu=e=>{if(e&&typeof e.then=="function")throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");return e},Lu=({handlers:e,deps:t})=>{if(!e?.handleBeforeMount)return;let r=e.handleBeforeMount(t);return Tu(r)},Nu=({handlers:e,deps:t})=>{e?.handleAfterMount&&e.handleAfterMount(t)},Vu=({attributeName:e,oldValue:t,newValue:r,deps:i,propsSchemaKeys:s,toCamelCase:n,normalizeAttributeValue:o})=>{let p=n(e),l={};s.forEach(h=>{let f=i.props[h];f!==void 0&&(l[h]=f)});let a={...l},c=o(t),d=o(r);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}},Ru=({propName:e,oldValue:t,newValue:r,deps:i,propsSchemaKeys:s})=>{let n={};s.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,r===void 0?delete n[e]:n[e]=r,{changedProp:e,oldProps:o,newProps:n}},ju=({refKey:e,targets:t})=>e==="window"?t.window:e==="document"?t.document:null,Du=({refs:e={},handlers:t={},targets:r={window:globalThis.window,document:globalThis.document},parseAndRenderFn:i,timing:s={nowFn:Date.now,setTimeoutFn:setTimeout,clearTimeoutFn:clearTimeout},warnFn:n=console.warn})=>{let o=[],p=new Set,l=Us(t);return Object.entries(e).forEach(([a,c])=>{if(a!=="window"&&a!=="document")return;let d=ju({refKey:a,targets:r});!d||!c?.eventListeners||Object.entries(c.eventListeners).forEach(([h,f])=>{let u=`${a}:${h}`;p.add(u);let m=Hs({eventType:h,eventConfig:f,refKey:a,handlers:t,eventRateLimitState:l,stateKey:u,fallbackCurrentTarget:d,parseAndRenderFn:i,nowFn:s.nowFn,setTimeoutFn:s.setTimeoutFn,clearTimeoutFn:s.clearTimeoutFn,onMissingHandler:y=>{n(`[Runtime] Handler '${y}' for global ref '${a}' is referenced but not found in available handlers.`)}});m&&(d.addEventListener(h,m),o.push(()=>{d.removeEventListener(h,m)}))})}),()=>{o.forEach(a=>a()),p.forEach(a=>{let c=l.get(a);c&&c.debounceTimer&&s.clearTimeoutFn(c.debounceTimer),l.delete(a)})}},Pu=e=>Ms(e),Bu=e=>{let t=[],r=e?.data?.class;r&&typeof r=="object"&&Object.entries(r).forEach(([s,n])=>{n&&t.push(s)});let i=e?.data?.attrs?.class;return typeof i=="string"&&i.split(/\s+/).filter(Boolean).forEach(s=>t.push(s)),[...new Set(t)]},zu=({rootVNode:e,refs:t})=>{let r={},i=Pu(t),s=n=>{if(!n||typeof n!="object")return;let o=n?.data?.attrs?.id,p=Bu(n),l=Ks({elementIdForRefs:o,classNames:p,refMatchers:i});if(n.elm&&l){let a=o||l.refKey;r[a]=n.elm}Array.isArray(n.children)&&n.children.forEach(s)};return s(e),r},Wu=({propsSchemaKeys:e=[],toKebabCase:t})=>{let r=new Set(["key"]);return e.forEach(i=>{r.add(i),r.add(t(i))}),[...r]},Fu=({baseDeps:e,refs:t,dispatchEvent:r,store:i,render:s})=>Cu({baseDeps:e,refs:t,dispatchEvent:r,store:i,render:s}),Mu=({refIds:e,nextRefIds:t={}})=>(Object.keys(e).forEach(r=>{delete e[r]}),Object.assign(e,t),e),Ku=({transformedHandlers:e,clearTimerFn:t=clearTimeout})=>{let r=e?.__eventRateLimitState;if(!(r instanceof Map))return 0;let i=0;return r.forEach(s=>{s&&s.debounceTimer&&(t(s.debounceTimer),i+=1)}),r.clear(),i},Rr=({instance:e})=>Fu({baseDeps:e.deps,refs:e.refIds,dispatchEvent:e.dispatchEvent.bind(e),store:e.store,render:e.render.bind(e)}),Uu=({instance:e,parseAndRenderFn:t,renderFn:r,createTransformedHandlersFn:i=Ou,runBeforeMountFn:s=Lu,attachGlobalRefListenersFn:n=Du,runAfterMountFn:o=Nu})=>{let p=Rr({instance:e});return e.transformedHandlers=i({handlers:e.handlers,deps:p,parseAndRenderFn:t}),e._unmountCallback=s({handlers:e.handlers,deps:p}),e._globalListenersCleanup=n({refs:e.refs,handlers:e.transformedHandlers,parseAndRenderFn:t}),r(),o({handlers:e.handlers,deps:p}),p},Hu=({instance:e,clearTimerFn:t=clearTimeout})=>(e._unmountCallback&&e._unmountCallback(),e._globalListenersCleanup&&e._globalListenersCleanup(),Ku({transformedHandlers:e.transformedHandlers,clearTimerFn:t})),qu=({instance:e,attributeName:t,oldValue:r,newValue:i,scheduleFrameFn:s})=>{if(!(r===i||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=Rr({instance:e}),o=Vu({attributeName:t,oldValue:r,newValue:i,deps:n,propsSchemaKeys:e._propsSchemaKeys,toCamelCase:Ss,normalizeAttributeValue:ur});e.handlers.handleOnUpdate(n,o);return}s(()=>{e.render()})}},Gu=({instance:e,propName:t,oldValue:r,newValue:i,scheduleFrameFn:s})=>{if(!(r===i||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=Rr({instance:e}),o=Ru({propName:t,oldValue:r,newValue:i,deps:n,propsSchemaKeys:e._propsSchemaKeys});e.handlers.handleOnUpdate(n,o);return}s(()=>{e.render()})}},Yu=({instance:e,createComponentUpdateHookFn:t,parseViewFn:r=ku,collectRefElementsFn:i=zu,onError:s=n=>{console.error("Error during render:",n)}})=>{if(!e.patch)return console.error("Patch function is not defined!"),null;if(!e.template)return console.error("Template is not defined!"),null;try{let n=r({h:e._snabbdomH,template:e.template,viewData:e.viewData,refs:e.refs,handlers:e.transformedHandlers,createComponentUpdateHook:t});e._oldVNode?e._oldVNode=e.patch(e._oldVNode,n):e._oldVNode=e.patch(e.renderTarget,n);let o=i({rootVNode:e._oldVNode,refs:e.refs});return Mu({refIds:e.refIds,nextRefIds:o}),e._oldVNode}catch(n){return s(n),e._oldVNode||null}},Ju=`
1488
+ `:"")+p)}),r},_r=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(..._r(r));else{if(r&&typeof r=="object"){let i=Object.entries(r);if(i.length>0){let[s,n]=i[0];Array.isArray(n)&&(r={[s]:_r(n)})}}t.push(r)}return t},[]):e,or=":",du=new Set(["__proto__","constructor","prototype"]),cu=/^[A-Za-z_][A-Za-z0-9_.:-]*$/,Fi=e=>cu.test(e),Mi=(e,t)=>{if(!t)return e;let r=[],i="",s=!1;for(let n=0;n<t.length;n++){let o=t[n];if(!s&&o===".")i&&(r.push(i),i="");else if(!s&&o==="[")i&&(r.push(i),i=""),s=!0;else if(s&&o==="]"){if(i){if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))r.push(i.slice(1,-1));else{let p=Number(i);r.push(Number.isNaN(p)?i:p)}i=""}s=!1}else i+=o}return i&&r.push(i),r.reduce((n,o)=>{if(n==null)return;let p=typeof o=="number"?o:String(o);if(!(typeof p=="string"&&du.has(p)))return n[p]},e)},uu=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase()),hu=({attrsString:e="",viewData:t={},tagName:r,isWebComponent:i})=>{let s={},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=uu(g);if(!A)throw new Error(`[Parser] Invalid ${S} prop name on '${r}'.`);if(Object.prototype.hasOwnProperty.call(n,A))throw new Error(`[Parser] Duplicate prop binding '${A}' on '${r}'. Use only one of 'name=value' or ':name=\${expr}'.`);n[A]=_},l=(g,_)=>{if(!Fi(g))throw new Error(`[Parser] Invalid ${_} attribute name '${g}' on '${r}'.`)};if(!e)return{attrs:s,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(".")){s[g]=_;continue}if(g.startsWith(or)){let S=g.substring(1),A=_;if(c[4]!==void 0&&c[4]!==""){let E=c[4],C=Mi(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=Mi(t,A),E&&(s[S]=""),i&&S!=="id"&&p(S,!!E,"boolean attribute-form");continue}l(g,"binding"),s[g]=_,i&&g!=="id"&&p(g,_,"attribute-form")}let h=e,f=[],u,m=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g;for(;(u=m.exec(e))!==null;)f.push(u[0]);f.forEach(g=>{h=h.replace(g," ")});let y=/(\S+?)(?=\s|$)/g,b;for(;(b=y.exec(h))!==null;){let g=b[1];if(!g.startsWith(".")&&!(d.has(g)||g.startsWith(or)||g.includes("="))){if(g.startsWith("?")){let _=g.substring(1);l(_,"boolean toggle"),o(_),s[_]="",i&&_!=="id"&&p(_,!0,"boolean attribute-form");continue}if(!Fi(g))throw new Error(`[Parser] Invalid attribute token '${g}' on '${r}'.`);!d.has(g)&&!g.startsWith(or)&&!g.includes("=")&&(s[g]="",i&&g!=="id"&&p(g,!0,"boolean attribute-form"))}}return{attrs:s,props:n}},xr=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,fu=/^\$for\s+([A-Za-z_][A-Za-z0-9_]*)(?:\s*,\s*([A-Za-z_][A-Za-z0-9_]*))?\s+in\s+.+$/,Ks=/^\$\{([^{}]+)\}$/,mu=/^[A-Za-z_][A-Za-z0-9_]*(?:(?:\.[A-Za-z_][A-Za-z0-9_]*)|\[(?:\d+|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')\])*$/,Ki=new WeakSet,Rr=(e,t,r)=>{let i=new Set(e);return t&&i.add(t),r&&i.add(r),i},yu=(e,t)=>{if(typeof e!="string")return t;let r=e.match(fu);return r?Rr(t,r[1],r[2]):t},Us=e=>{if(typeof e!="string"||!e.includes(":")&&!e.includes("."))return null;xr.lastIndex=0;let t;for(;(t=xr.exec(e))!==null;){let r=t[1];if(r.startsWith("."))return{bindingName:r,rawValue:t[2]??t[3]??t[4]??"",key:e};if(!r.startsWith(":"))continue;let i=t[2]!==void 0||t[3]!==void 0,s=t[2]??t[3]??t[4]??"";if(i||!Ks.test(s))return{bindingName:r,rawValue:s,key:e}}return null},Sr=(e,t=new Set)=>{if(Array.isArray(e)){for(let r of e){let i=Sr(r,t);if(i)return i}return null}if(!e||typeof e!="object")return null;for(let[r,i]of Object.entries(e)){let s=Us(r);if(s)return s;let n=yu(r,t),o=Sr(i,n);if(o)return o}return null},Ne=(e,t=new Set)=>{if(!e||typeof e!="object")return null;if(Array.isArray(e)){for(let r of e){let i=Ne(r,t);if(i)return i}return null}if(e.type===v.LOOP){let r=Rr(t,e.itemVar,e.indexVar);return Ne(e.body,r)}if(e.type===v.ARRAY&&Array.isArray(e.items))return Ne(e.items,t);if(e.type===v.OBJECT&&Array.isArray(e.properties)){for(let r of e.properties){let i=Us(r.key);if(i)return i;let s=Ne(r.value,t);if(s)return s}return null}for(let r of Object.values(e)){let i=Ne(r,t);if(i)return i}return null},gu=e=>fr([{[e]:""}])?.items?.[0]?.properties?.[0]?.parsedKey,bu=e=>{let t=e.match(Ks);return t?t[1].trim():null},vu=e=>{let t=e.match(/^([A-Za-z_][A-Za-z0-9_]*)/);return t?t[1]:null},wu=(e,t)=>{let r=!1,i=e.replace(xr,(s,n,o,p,l)=>{if(!n.startsWith(":"))return s;let a=o??p??l??"",c=bu(a);if(!c||!mu.test(c))return s;let d=vu(c);if(!d)return s;let h=t.has(d)?`#{${c}}`:c;return h===a?s:(r=!0,`${n}=${h}`)});return r?i:e},Ve=(e,t=new Set)=>{if(!(!e||typeof e!="object")){if(Array.isArray(e)){e.forEach(r=>Ve(r,t));return}if(e.type===v.LOOP){let r=Rr(t,e.itemVar,e.indexVar);Ve(e.body,r);return}if(e.type===v.ARRAY&&Array.isArray(e.items)){e.items.forEach(r=>Ve(r,t));return}if(e.type===v.OBJECT&&Array.isArray(e.properties)){e.properties.forEach(r=>{let i=wu(r.key,t);if(i!==r.key){r.key=i;let s=gu(i);s?r.parsedKey=s:delete r.parsedKey}Ve(r.value,t)});return}Object.values(e).forEach(r=>{Ve(r,t)})}},_u=e=>e?e.type&&typeof e.type=="number"?Ne(e):Sr(e):null,xu=e=>{if(!e||typeof e!="object"||Ki.has(e))return;let t=_u(e);if(t)throw new Error(`Property-form bindings must use ':prop=\${value}' syntax. Found '${t.bindingName}=${t.rawValue}' in '${t.key}'.`);Ve(e),Ki.add(e)},Su=/^[a-z][a-zA-Z0-9]*\*?$/,Au=/^[a-zA-Z][a-zA-Z0-9_-]*\*?$/,Eu=/^[a-z][a-zA-Z0-9]*$/,Ui=new Set(["window","document"]),Hs=e=>Object.entries(e||{}).map(([t,r])=>{if(Ui.has(t))return{refKey:t,refConfig:r,targetType:"global",isWildcard:!1,prefix:t};let i="id",s=t;t.startsWith(".")?(i="class",s=t.slice(1)):t.startsWith("#")&&(i="id",s=t.slice(1));let n=s.endsWith("*")?s.slice(0,-1):s;if(Ui.has(n))throw new Error(`[Parser] Invalid ref key '${t}'. Reserved global keys must be exactly 'window' or 'document'.`);if(i==="id"&&!Su.test(s))throw new Error(`[Parser] Invalid ref key '${t}'. Use camelCase IDs (optional '#', optional '*') or class refs with '.' prefix.`);if(i==="class"&&!Au.test(s))throw new Error(`[Parser] Invalid ref key '${t}'. Class refs must start with '.' and use class-compatible names (optional '*').`);let o=s.endsWith("*"),p=o?s.slice(0,-1):s;return{refKey:t,refConfig:r,targetType:i,isWildcard:o,prefix:p}}),ku=e=>{if(!Eu.test(e))throw new Error(`[Parser] Invalid element id '${e}' for refs. Use camelCase ids only. Kebab-case ids are not supported.`)},Hi=({value:e,prefix:t,isWildcard:r})=>typeof e!="string"||e.length===0?!1:r?e.startsWith(t):e===t,qs=({elementIdForRefs:e,classNames:t=[],refMatchers:r})=>{let i=[],s=Array.isArray(t)?t:[];return r.forEach(n=>{if(n.targetType==="global")return;if(n.targetType==="id"){Hi({value:e,prefix:n.prefix,isWildcard:n.isWildcard})&&i.push({...n,matchedValue:e});return}let o=s.find(p=>Hi({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])},Ge=({optionName:e,optionValue:t,eventType:r,refKey:i})=>{if(t!==void 0&&typeof t!="boolean")throw new Error(`[Parser] Invalid '${e}' for event '${r}' on ref '${i}'. Expected boolean.`)},qi=({optionName:e,optionValue:t,eventType:r,refKey:i})=>{if(t!==void 0&&(typeof t!="number"||Number.isNaN(t)||!Number.isFinite(t)||t<0))throw new Error(`[Parser] Invalid '${e}' for event '${r}' on ref '${i}'. Expected non-negative number.`)},$u=({eventType:e,eventConfig:t,refKey:r})=>{if(typeof t!="object"||t===null)throw new Error(`[Parser] Invalid event config for event '${e}' on ref '${r}'.`);let i=Object.prototype.hasOwnProperty.call(t,"debounce"),s=Object.prototype.hasOwnProperty.call(t,"throttle");if(Ge({optionName:"preventDefault",optionValue:t.preventDefault,eventType:e,refKey:r}),Ge({optionName:"stopPropagation",optionValue:t.stopPropagation,eventType:e,refKey:r}),Ge({optionName:"stopImmediatePropagation",optionValue:t.stopImmediatePropagation,eventType:e,refKey:r}),Ge({optionName:"targetOnly",optionValue:t.targetOnly,eventType:e,refKey:r}),Ge({optionName:"once",optionValue:t.once,eventType:e,refKey:r}),qi({optionName:"debounce",optionValue:t.debounce,eventType:e,refKey:r}),qi({optionName:"throttle",optionValue:t.throttle,eventType:e,refKey:r}),i&&s)throw new Error(`[Parser] Event '${e}' on ref '${r}' cannot define both 'debounce' and 'throttle'.`);if(t.handler&&t.action)throw new Error("Each listener can have handler or action but not both");if(!t.handler&&!t.action)throw new Error("Each listener must define either handler or action");return{hasDebounce:i,hasThrottle:s}},Gs=e=>(e.__eventRateLimitState||Object.defineProperty(e,"__eventRateLimitState",{value:new Map,enumerable:!1,configurable:!0}),e.__eventRateLimitState),Cu=({eventConfig:e,handlers:t,onMissingHandler:r,parseAndRenderFn:i})=>{let s=n=>{let o=e.payload&&typeof e.payload=="object"&&!Array.isArray(e.payload)?e.payload:{};return typeof i!="function"?o:i(o,{_event:n})};if(e.action){if(typeof t.handleCallStoreAction!="function")throw new Error(`[Runtime] Action listener '${e.action}' requires handlers.handleCallStoreAction.`);return n=>{let o=s(n);t.handleCallStoreAction({...o,_event:n,_action:e.action})}}return e.handler&&t[e.handler]?n=>{let o=s(n);t[e.handler]({...o,_event:n})}:(e.handler&&r?.(e.handler),null)},Iu=({eventConfig:e,callback:t,hasDebounce:r,hasThrottle:i,stateKey:s,eventRateLimitState:n,fallbackCurrentTarget:o=null,nowFn:p=Date.now,setTimeoutFn:l=setTimeout,clearTimeoutFn:a=clearTimeout})=>c=>{let d=n.get(s)||{},h=c.currentTarget||o;if(e.once)if(h){if(d.onceTargets||(d.onceTargets=new WeakSet),d.onceTargets.has(h)){n.set(s,d);return}d.onceTargets.add(h)}else if(d.onceTriggered){n.set(s,d);return}else d.onceTriggered=!0;if(e.targetOnly&&c.target!==c.currentTarget){n.set(s,d);return}if(e.preventDefault&&c.preventDefault(),e.stopImmediatePropagation?c.stopImmediatePropagation():e.stopPropagation&&c.stopPropagation(),r){d.debounceTimer&&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(s,d);return}if(i){Object.prototype.hasOwnProperty.call(d,"lastThrottleAt")||(d.lastThrottleAt=void 0);let f=p();if(d.lastThrottleAt===void 0||f-d.lastThrottleAt>=e.throttle){d.lastThrottleAt=f,n.set(s,d),t(c);return}n.set(s,d);return}n.set(s,d),t(c)},Ys=({eventType:e,eventConfig:t,refKey:r,handlers:i,eventRateLimitState:s,stateKey:n,fallbackCurrentTarget:o=null,parseAndRenderFn:p,onMissingHandler:l,nowFn:a=Date.now,setTimeoutFn:c=setTimeout,clearTimeoutFn:d=clearTimeout})=>{let{hasDebounce:h,hasThrottle:f}=$u({eventType:e,eventConfig:t,refKey:r}),u=Cu({eventConfig:t,handlers:i,onMissingHandler:l,parseAndRenderFn:p});return u?Iu({eventConfig:t,callback:u,hasDebounce:h,hasThrottle:f,stateKey:n,eventRateLimitState:s,fallbackCurrentTarget:o,nowFn:a,setTimeoutFn:c,clearTimeoutFn:d}):null},Ou=({h:e,template:t,viewData:r,refs:i,handlers:s,createComponentUpdateHook:n})=>{xu(t);let o=$s(t,r,{}),p=_r(o),l=Tu({h:e,items:p,refs:i,handlers:s,viewData:r,createComponentUpdateHook:n});return e("div",{style:{display:"contents"}},l)},Tu=({h:e,items:t,refs:r={},handlers:i={},viewData:s={},createComponentUpdateHook:n})=>{if(!Array.isArray(t))throw new Error("[Parser] Input to createVirtualDom must be an array, got "+typeof t);let o=Hs(r),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[m,y]=u[0];if(!isNaN(Number(m)))return Array.isArray(y)?l(y,f):typeof y=="object"&&y!==null&&Object.entries(y).length>0?l([y],f):String(y);u.length>1&&console.warn("Item has multiple keys, processing only the first:",m);let b,g,_=m.indexOf(" ");_===-1?(b=m,g=""):(b=m.substring(0,_),g=m.substring(_+1).trim());let S=b.split(/[.#]/)[0],A=S.includes("-"),E,C;try{({attrs:E,props:C}=hu({attrsString:g,viewData:s,tagName:S,isWebComponent:A}))}catch(H){throw new Error(`[Parser] Failed to parse bindings for selector '${b}' with attrs '${g}': ${H.message}`)}let I=b.match(/#([^.#\s]+)/);I&&!Object.prototype.hasOwnProperty.call(E,"id")&&(E.id=I[1]);let N=null;E.id&&(N=E.id);let z=(b.match(/\.([^.#]+)/g)||[]).map(H=>H.substring(1)),B=typeof E.class=="string"?E.class.split(/\s+/).filter(Boolean):[],J=[...new Set([...z,...B])],Z=Object.create(null),me=null;if(!A){z.forEach(Ie=>{Z[Ie]=!0});let H=b.match(/#([^.#\s]+)/);H&&(me=H[1])}let ve;typeof y=="string"||typeof y=="number"?ve=String(y):Array.isArray(y)?ve=l(y,f):ve=[],me&&!A&&(E.id=me);let $t=Object.create(null);if(o.length>0){p&&N&&ku(N);let H=qs({elementIdForRefs:N,classNames:J,refMatchers:o});if(H){let Ie=H.refKey,Pr=H.matchedValue||N||Ie;if(H.refConfig&&H.refConfig.eventListeners){let en=H.refConfig.eventListeners,tn=Gs(i);Object.entries(en).forEach(([Ct,rn])=>{let sn=`${Ie}:${Pr}:${Ct}`,Br=Ys({eventType:Ct,eventConfig:rn,refKey:Ie,handlers:i,eventRateLimitState:tn,stateKey:sn,parseAndRenderFn:js,onMissingHandler:nn=>{console.warn(`[Parser] Handler '${nn}' for refKey '${Ie}' (matching '${Pr}') is referenced but not found in available handlers.`)}});Br&&($t[Ct]=Br)})}}}let ye={};if(N?ye.key=N:b&&(ye.key=`${b}-${f}`),Object.keys(E).length>0&&(ye.attrs=E),Object.keys(Z).length>0&&(ye.class=Z),Object.keys($t).length>0&&(ye.on=$t),Object.keys(C).length>0&&(ye.props=C),A&&typeof n=="function"){let H=n({selector:b,tagName:S});H&&(ye.hook=H)}try{return e(S,ye,ve)}catch(H){throw new Error(`[Parser] Error creating virtual node for '${S}': ${H.message}`)}}).filter(Boolean)}return l(t)},Lu=({baseDeps:e,refs:t,dispatchEvent:r,store:i,render:s})=>({...e,refs:t,dispatchEvent:r,store:i,render:s}),Nu=({store:e,render:t,parseAndRenderFn:r})=>i=>{let{_event:s,_action:n}=i,o=r(i,{_event:s});if(!e[n])throw new Error(`[Store] Action 'store.${n}' is not defined.`);e[n](o),t()},Vu=({handlers:e,deps:t,parseAndRenderFn:r})=>{let i={handleCallStoreAction:Nu({store:t.store,render:t.render,parseAndRenderFn:r})};return Object.keys(e||{}).forEach(s=>{i[s]=n=>e[s](t,n)}),i},Ru=e=>{if(e&&typeof e.then=="function")throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");return e},ju=({handlers:e,deps:t})=>{if(!e?.handleBeforeMount)return;let r=e.handleBeforeMount(t);return Ru(r)},Du=({handlers:e,deps:t})=>{e?.handleAfterMount&&e.handleAfterMount(t)},Pu=({attributeName:e,oldValue:t,newValue:r,deps:i,propsSchemaKeys:s,toCamelCase:n,normalizeAttributeValue:o})=>{let p=n(e),l={};s.forEach(h=>{let f=i.props[h];f!==void 0&&(l[h]=f)});let a={...l},c=o(t),d=o(r);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}},Bu=({propName:e,oldValue:t,newValue:r,deps:i,propsSchemaKeys:s})=>{let n={};s.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,r===void 0?delete n[e]:n[e]=r,{changedProp:e,oldProps:o,newProps:n}},zu=({refKey:e,targets:t})=>e==="window"?t.window:e==="document"?t.document:null,Wu=({refs:e={},handlers:t={},targets:r={window:globalThis.window,document:globalThis.document},parseAndRenderFn:i,timing:s={nowFn:Date.now,setTimeoutFn:setTimeout,clearTimeoutFn:clearTimeout},warnFn:n=console.warn})=>{let o=[],p=new Set,l=Gs(t);return Object.entries(e).forEach(([a,c])=>{if(a!=="window"&&a!=="document")return;let d=zu({refKey:a,targets:r});!d||!c?.eventListeners||Object.entries(c.eventListeners).forEach(([h,f])=>{let u=`${a}:${h}`;p.add(u);let m=Ys({eventType:h,eventConfig:f,refKey:a,handlers:t,eventRateLimitState:l,stateKey:u,fallbackCurrentTarget:d,parseAndRenderFn:i,nowFn:s.nowFn,setTimeoutFn:s.setTimeoutFn,clearTimeoutFn:s.clearTimeoutFn,onMissingHandler:y=>{n(`[Runtime] Handler '${y}' for global ref '${a}' is referenced but not found in available handlers.`)}});m&&(d.addEventListener(h,m),o.push(()=>{d.removeEventListener(h,m)}))})}),()=>{o.forEach(a=>a()),p.forEach(a=>{let c=l.get(a);c&&c.debounceTimer&&s.clearTimeoutFn(c.debounceTimer),l.delete(a)})}},Fu=e=>Hs(e),Mu=e=>{let t=[],r=e?.data?.class;r&&typeof r=="object"&&Object.entries(r).forEach(([s,n])=>{n&&t.push(s)});let i=e?.data?.attrs?.class;return typeof i=="string"&&i.split(/\s+/).filter(Boolean).forEach(s=>t.push(s)),[...new Set(t)]},Ku=({rootVNode:e,refs:t})=>{let r={},i=Fu(t),s=n=>{if(!n||typeof n!="object")return;let o=n?.data?.attrs?.id,p=Mu(n),l=qs({elementIdForRefs:o,classNames:p,refMatchers:i});if(n.elm&&l){let a=o||l.refKey;r[a]=n.elm}Array.isArray(n.children)&&n.children.forEach(s)};return s(e),r},Uu=({propsSchemaKeys:e=[],toKebabCase:t})=>{let r=new Set(["key"]);return e.forEach(i=>{r.add(i),r.add(t(i))}),[...r]},Hu=({baseDeps:e,refs:t,dispatchEvent:r,store:i,render:s})=>Lu({baseDeps:e,refs:t,dispatchEvent:r,store:i,render:s}),qu=({refIds:e,nextRefIds:t={}})=>(Object.keys(e).forEach(r=>{delete e[r]}),Object.assign(e,t),e),Gu=({transformedHandlers:e,clearTimerFn:t=clearTimeout})=>{let r=e?.__eventRateLimitState;if(!(r instanceof Map))return 0;let i=0;return r.forEach(s=>{s&&s.debounceTimer&&(t(s.debounceTimer),i+=1)}),r.clear(),i},jr=({instance:e})=>Hu({baseDeps:e.deps,refs:e.refIds,dispatchEvent:e.dispatchEvent.bind(e),store:e.store,render:e.render.bind(e)}),Yu=({instance:e,parseAndRenderFn:t,renderFn:r,createTransformedHandlersFn:i=Vu,runBeforeMountFn:s=ju,attachGlobalRefListenersFn:n=Wu,runAfterMountFn:o=Du})=>{let p=jr({instance:e});return e.transformedHandlers=i({handlers:e.handlers,deps:p,parseAndRenderFn:t}),e._unmountCallback=s({handlers:e.handlers,deps:p}),e._globalListenersCleanup=n({refs:e.refs,handlers:e.transformedHandlers,parseAndRenderFn:t}),r(),o({handlers:e.handlers,deps:p}),p},Ju=({instance:e,clearTimerFn:t=clearTimeout})=>(e._unmountCallback&&e._unmountCallback(),e._globalListenersCleanup&&e._globalListenersCleanup(),Gu({transformedHandlers:e.transformedHandlers,clearTimerFn:t})),Zu=({instance:e,attributeName:t,oldValue:r,newValue:i,scheduleFrameFn:s})=>{if(!(r===i||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=jr({instance:e}),o=Pu({attributeName:t,oldValue:r,newValue:i,deps:n,propsSchemaKeys:e._propsSchemaKeys,toCamelCase:ks,normalizeAttributeValue:ur});e.handlers.handleOnUpdate(n,o);return}s(()=>{e.render()})}},Xu=({instance:e,propName:t,oldValue:r,newValue:i,scheduleFrameFn:s})=>{if(!(r===i||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=jr({instance:e}),o=Bu({propName:t,oldValue:r,newValue:i,deps:n,propsSchemaKeys:e._propsSchemaKeys});e.handlers.handleOnUpdate(n,o);return}s(()=>{e.render()})}},Qu=({instance:e,createComponentUpdateHookFn:t,parseViewFn:r=Ou,collectRefElementsFn:i=Ku,onError:s=n=>{console.error("Error during render:",n)}})=>{if(!e.patch)return console.error("Patch function is not defined!"),null;if(!e.template)return console.error("Template is not defined!"),null;try{let n=r({h:e._snabbdomH,template:e.template,viewData:e.viewData,refs:e.refs,handlers:e.transformedHandlers,createComponentUpdateHook:t});e._oldVNode?e._oldVNode=e.patch(e._oldVNode,n):e._oldVNode=e.patch(e.renderTarget,n);let o=i({rootVNode:e._oldVNode,refs:e.refs});return qu({refIds:e.refIds,nextRefIds:o}),e._oldVNode}catch(n){return s(n),e._oldVNode||null}},eh=`
1489
1489
  a, a:link, a:visited, a:hover, a:active {
1490
1490
  display: contents;
1491
1491
  color: inherit;
@@ -1497,4 +1497,4 @@ ${p}
1497
1497
  font: inherit;
1498
1498
  cursor: pointer;
1499
1499
  }
1500
- `,Zu=({host:e,cssText:t,createStyleSheet:r=()=>new CSSStyleSheet,createElement:i=s=>document.createElement(s)})=>{let s=e.attachShadow({mode:"open"}),n=r();n.replaceSync(Ju);let o=[n];if(t){let l=r();l.replaceSync(t),o.push(l)}s.adoptedStyleSheets=o;let p=i("div");return p.style.cssText="display: contents;",s.appendChild(p),p.parentNode||e.appendChild(p),e.style.display="contents",{shadow:s,renderTarget:p,adoptedStyleSheets:o}},Ar=(e,t=requestAnimationFrame)=>t(e),Xu=({scheduleFrameFn:e=Ar}={})=>({update:(t,r)=>{let i=t.data?.props||{},s=r.data?.props||{};if(JSON.stringify(i)===JSON.stringify(s))return;let n=r.elm;!n||typeof n.render!="function"||(n.setAttribute("isDirty","true"),e(()=>{if(n.render(),n.removeAttribute("isDirty"),n.handlers&&n.handlers.handleOnUpdate){let 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:s})}}))}}),Qu=({elementName:e,propsSchema:t,propsSchemaKeys:r,template:i,refs:s,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;_propsSchemaKeys=[];cssText;static get observedAttributes(){return["key"]}get viewData(){let y={};return this.store.selectViewData&&(y=this.store.selectViewData()),y}connectedCallback(){let y=Zu({host:this,cssText:this.cssText});this.shadow=y.shadow,this.renderTarget=y.renderTarget,Uu({instance:this,parseAndRenderFn:Ns,renderFn:this.render})}disconnectedCallback(){Hu({instance:this,clearTimerFn:clearTimeout})}attributeChangedCallback(y,b,g){qu({instance:this,attributeName:y,oldValue:b,newValue:g,scheduleFrameFn:Ar})}render=()=>{Yu({instance:this,createComponentUpdateHookFn:Xu})}}class u extends f{static get observedAttributes(){return Wu({propsSchemaKeys:r,toKebabCase:xs})}constructor(){super(),this.constants=su({setupConstants:h?.constants,fileConstants:l}),this.propsSchema=t,dc({source:this,allowedKeys:r,onPropChange:({propName:y,oldValue:b,newValue:g})=>{Gu({instance:this,propName:y,oldValue:b,newValue:g,scheduleFrameFn:Ar})}}),this.props=t?cc(this,r):{},this._propsSchemaKeys=r,this.elementName=e,this.styles=n,this.store=iu(a,this.props,this.constants),this.template=i,this.handlers=o,this.methods=p,this.refs=s,this.patch=c,this.deps={...h,store:this.store,render:this.render,handlers:o,props:this.props,constants:this.constants},Uc(this,this.methods),this._snabbdomH=d,this.cssText=nu(e,n)}}return u};function et(e,t,r,i,s){let n=t===void 0?void 0:t.key;return{sel:e,data:t,children:r,text:i,elm:s,key:n}}var wt=Array.isArray;function ut(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function eh(e,t){return document.createElement(e,t)}function th(e,t,r){return document.createElementNS(e,t,r)}function rh(){return Se(document.createDocumentFragment())}function ih(e){return document.createTextNode(e)}function sh(e){return document.createComment(e)}function nh(e,t,r){if(fe(e)){let i=e;for(;i&&fe(i);)i=Se(i).parent;e=i??e}fe(t)&&(t=Se(t,e)),r&&fe(r)&&(r=Se(r).firstChildNode),e.insertBefore(t,r)}function oh(e,t){e.removeChild(t)}function ah(e,t){fe(t)&&(t=Se(t,e)),e.appendChild(t)}function qs(e){if(fe(e)){for(;e&&fe(e);)e=Se(e).parent;return e??null}return e.parentNode}function lh(e){var t;if(fe(e)){let r=Se(e),i=qs(r);if(i&&r.lastChildNode){let s=Array.from(i.childNodes),n=s.indexOf(r.lastChildNode);return(t=s[n+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function ph(e){return e.tagName}function dh(e,t){e.textContent=t}function ch(e){return e.textContent}function uh(e){return e.nodeType===1}function hh(e){return e.nodeType===3}function fh(e){return e.nodeType===8}function fe(e){return e.nodeType===11}function Se(e,t){var r,i,s;let n=e;return(r=n.parent)!==null&&r!==void 0||(n.parent=t??null),(i=n.firstChildNode)!==null&&i!==void 0||(n.firstChildNode=e.firstChild),(s=n.lastChildNode)!==null&&s!==void 0||(n.lastChildNode=e.lastChild),n}var mh={createElement:eh,createElementNS:th,createTextNode:ih,createDocumentFragment:rh,createComment:sh,insertBefore:nh,removeChild:oh,appendChild:ah,parentNode:qs,nextSibling:lh,tagName:ph,setTextContent:dh,getTextContent:ch,isElement:uh,isText:hh,isComment:fh,isDocumentFragment:fe};function ct(e){return e===void 0}function re(e){return e!==void 0}var ar=et("",{},[],void 0,void 0);function Ye(e,t){var r,i;let s=e.key===t.key,n=((r=e.data)===null||r===void 0?void 0:r.is)===((i=t.data)===null||i===void 0?void 0:i.is),o=e.sel===t.sel,p=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return o&&s&&n&&p}function yh(){throw new Error("The document fragment is not supported on this platform.")}function gh(e,t){return e.isElement(t)}function bh(e,t){return e.isDocumentFragment(t)}function vh(e,t,r){var i;let s={};for(let n=t;n<=r;++n){let o=(i=e[n])===null||i===void 0?void 0:i.key;o!==void 0&&(s[o]=n)}return s}var wh=["create","update","remove","destroy","pre","post"];function _h(e,t,r){let i={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},s=mh;for(let u of wh)for(let m of e){let y=m[u];y!==void 0&&i[u].push(y)}function n(u){let m=u.id?"#"+u.id:"",y=u.getAttribute("class"),b=y?"."+y.split(" ").join("."):"";return et(s.tagName(u).toLowerCase()+m+b,{},[],void 0,u)}function o(u){return et(void 0,{},[],void 0,u)}function p(u,m){return function(){if(--m===0){let y=s.parentNode(u);y!==null&&s.removeChild(y,u)}}}function l(u,m){var y,b,g,_;let S,A=u.data;if(A!==void 0){let I=(y=A.hook)===null||y===void 0?void 0:y.init;re(I)&&(I(u),A=u.data)}let E=u.children,C=u.sel;if(C==="!")ct(u.text)&&(u.text=""),u.elm=s.createComment(u.text);else if(C==="")u.elm=s.createTextNode(u.text);else if(C!==void 0){let I=C.indexOf("#"),N=C.indexOf(".",I),z=I>0?I:C.length,B=N>0?N:C.length,J=I!==-1||N!==-1?C.slice(0,Math.min(z,B)):C,Z=u.elm=re(A)&&re(S=A.ns)?s.createElementNS(S,J,A):s.createElement(J,A);for(z<B&&Z.setAttribute("id",C.slice(z+1,B)),N>0&&Z.setAttribute("class",C.slice(B+1).replace(/\./g," ")),S=0;S<i.create.length;++S)i.create[S](ar,u);if(ut(u.text)&&(!wt(E)||E.length===0)&&s.appendChild(Z,s.createTextNode(u.text)),wt(E))for(S=0;S<E.length;++S){let ve=E[S];ve!=null&&s.appendChild(Z,l(ve,m))}let me=u.data.hook;re(me)&&((b=me.create)===null||b===void 0||b.call(me,ar,u),me.insert&&m.push(u))}else if(!((g=void 0)===null||g===void 0)&&g.fragments&&u.children){for(u.elm=((_=s.createDocumentFragment)!==null&&_!==void 0?_:yh)(),S=0;S<i.create.length;++S)i.create[S](ar,u);for(S=0;S<u.children.length;++S){let I=u.children[S];I!=null&&s.appendChild(u.elm,l(I,m))}}else u.elm=s.createTextNode(u.text);return u.elm}function a(u,m,y,b,g,_){for(;b<=g;++b){let S=y[b];S!=null&&s.insertBefore(u,l(S,_),m)}}function c(u){var m,y;let b=u.data;if(b!==void 0){(y=(m=b?.hook)===null||m===void 0?void 0:m.destroy)===null||y===void 0||y.call(m,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,m,y,b){for(var g,_;y<=b;++y){let S,A,E=m[y];if(E!=null)if(re(E.sel)){c(E),S=i.remove.length+1,A=p(E.elm,S);for(let 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;re(C)?C(E,A):A()}else E.children?(c(E),d(u,E.children,0,E.children.length-1)):s.removeChild(u,E.elm)}}function h(u,m,y,b){let g=0,_=0,S=m.length-1,A=m[0],E=m[S],C=y.length-1,I=y[0],N=y[C],z,B,J,Z;for(;g<=S&&_<=C;)A==null?A=m[++g]:E==null?E=m[--S]:I==null?I=y[++_]:N==null?N=y[--C]:Ye(A,I)?(f(A,I,b),A=m[++g],I=y[++_]):Ye(E,N)?(f(E,N,b),E=m[--S],N=y[--C]):Ye(A,N)?(f(A,N,b),s.insertBefore(u,A.elm,s.nextSibling(E.elm)),A=m[++g],N=y[--C]):Ye(E,I)?(f(E,I,b),s.insertBefore(u,E.elm,A.elm),E=m[--S],I=y[++_]):(z===void 0&&(z=vh(m,g,S)),B=z[I.key],ct(B)?(s.insertBefore(u,l(I,b),A.elm),I=y[++_]):ct(z[N.key])?(s.insertBefore(u,l(N,b),s.nextSibling(E.elm)),N=y[--C]):(J=m[B],J.sel!==I.sel?s.insertBefore(u,l(I,b),A.elm):(f(J,I,b),m[B]=void 0,s.insertBefore(u,J.elm,A.elm)),I=y[++_]));_<=C&&(Z=y[C+1]==null?null:y[C+1].elm,a(u,Z,y,_,C,b)),g<=S&&d(u,m,g,S)}function f(u,m,y){var b,g,_,S,A,E,C,I;let N=(b=m.data)===null||b===void 0?void 0:b.hook;(g=N?.prepatch)===null||g===void 0||g.call(N,u,m);let z=m.elm=u.elm;if(u===m)return;if(m.data!==void 0||re(m.text)&&m.text!==u.text){(_=m.data)!==null&&_!==void 0||(m.data={}),(S=u.data)!==null&&S!==void 0||(u.data={});for(let Z=0;Z<i.update.length;++Z)i.update[Z](u,m);(C=(E=(A=m.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,m)}let B=u.children,J=m.children;ct(m.text)?re(B)&&re(J)?B!==J&&h(z,B,J,y):re(J)?(re(u.text)&&s.setTextContent(z,""),a(z,null,J,0,J.length-1,y)):re(B)?d(z,B,0,B.length-1):re(u.text)&&s.setTextContent(z,""):u.text!==m.text&&(re(B)&&d(z,B,0,B.length-1),s.setTextContent(z,m.text)),(I=N?.postpatch)===null||I===void 0||I.call(N,u,m)}return function(u,m){let y,b,g,_=[];for(y=0;y<i.pre.length;++y)i.pre[y]();for(gh(s,u)?u=n(u):bh(s,u)&&(u=o(u)),Ye(u,m)?f(u,m,_):(b=u.elm,g=s.parentNode(b),l(m,_),g!==null&&(s.insertBefore(g,m.elm,s.nextSibling(b)),d(g,[u],0,0))),y=0;y<_.length;++y)_[y].data.hook.insert(_[y]);for(y=0;y<i.post.length;++y)i.post[y]();return m}}function Hi(e,t){let r,i,s=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)&&s.classList.remove(i);for(i in o)r=o[i],r!==n[i]&&s.classList[r?"add":"remove"](i)}}var xh={create:Hi,update:Hi};function qi(e,t){let r,i,s,n=t.elm,o=e.data.props,p=t.data.props;if(!(!o&&!p)&&o!==p){o=o||{},p=p||{};for(r in p)i=p[r],s=o[r],s!==i&&(r!=="value"||n[r]!==i)&&(n[r]=i)}}var Sh={create:qi,update:qi},Ah="http://www.w3.org/1999/xlink",Eh="http://www.w3.org/2000/xmlns/",kh="http://www.w3.org/XML/1998/namespace",Gi=58,$h=120,Ch=109;function Yi(e,t){let r,i=t.elm,s=e.data.attrs,n=t.data.attrs;if(!(!s&&!n)&&s!==n){s=s||{},n=n||{};for(r in n){let o=n[r];s[r]!==o&&(o===!0?i.setAttribute(r,""):o===!1?i.removeAttribute(r):r.charCodeAt(0)!==$h?i.setAttribute(r,o):r.charCodeAt(3)===Gi?i.setAttributeNS(kh,r,o):r.charCodeAt(5)===Gi?r.charCodeAt(1)===Ch?i.setAttributeNS(Eh,r,o):i.setAttributeNS(Ah,r,o):i.setAttribute(r,o))}for(r in s)r in n||i.removeAttribute(r)}}var Ih={create:Yi,update:Yi},Ji=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,Oh=function(e){Ji(function(){Ji(e)})},Er=!1;function Th(e,t,r){Oh(function(){e[t]=r})}function Zi(e,t){let r,i,s=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]==="-"?s.style.removeProperty(i):s.style[i]="");for(i in o)if(r=o[i],i==="delayed"&&o.delayed)for(let l in o.delayed)r=o.delayed[l],(!p||r!==n.delayed[l])&&Th(s.style,l,r);else i!=="remove"&&r!==n[i]&&(i[0]==="-"&&i[1]==="-"?s.style.setProperty(i,r):s.style[i]=r)}function Lh(e){let t,r,i=e.elm,s=e.data.style;if(!(!s||!(t=s.destroy)))for(r in t)i.style[r]=t[r]}function Nh(e,t){let r=e.data.style;if(!r||!r.remove){t();return}Er||(e.elm.offsetLeft,Er=!0);let i,s=e.elm,n=0,o=r.remove,p=0,l=[];for(i in o)l.push(i),s.style[i]=o[i];let a=getComputedStyle(s)["transition-property"].split(", ");for(;n<a.length;++n)l.indexOf(a[n])!==-1&&p++;s.addEventListener("transitionend",function(c){c.target===s&&--p,p===0&&t()})}function Vh(){Er=!1}var Rh={pre:Vh,create:Zi,update:Zi,destroy:Lh,remove:Nh};function Gs(e,t,r){if(typeof e=="function")e.call(t,r,t);else if(typeof e=="object")for(let i=0;i<e.length;i++)Gs(e[i],t,r)}function jh(e,t){let r=e.type,i=t.data.on;i&&i[r]&&Gs(i[r],t,e)}function Dh(){return function e(t){jh(t,e.vnode)}}function lr(e,t){let r=e.data.on,i=e.listener,s=e.elm,n=t&&t.data.on,o=t&&t.elm,p;if(r!==n){if(r&&i)if(n)for(p in r)n[p]||s.removeEventListener(p,i,!1);else for(p in r)s.removeEventListener(p,i,!1);if(n){let l=t.listener=e.listener||Dh();if(l.vnode=t,r)for(p in n)r[p]||o.addEventListener(p,l,!1);else for(p in n)o.addEventListener(p,l,!1)}}}var Ph={create:lr,update:lr,destroy:lr},Bh=()=>_h([xh,Sh,Ih,Rh,Ph]);function Ys(e,t,r){if(e.ns="http://www.w3.org/2000/svg",r!=="foreignObject"&&t!==void 0)for(let i=0;i<t.length;++i){let s=t[i];if(typeof s=="string")continue;let n=s.data;n!==void 0&&Ys(n,s.children,s.sel)}}function zh(e,t,r){let i={},s,n,o;if(r!==void 0?(t!==null&&(i=t),wt(r)?s=r:ut(r)?n=r.toString():r&&r.sel&&(s=[r])):t!=null&&(wt(t)?s=t:ut(t)?n=t.toString():t&&t.sel?s=[t]:i=t),s!==void 0)for(o=0;o<s.length;++o)ut(s[o])&&(s[o]=et(void 0,void 0,void 0,s[o],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&Ys(i,s,e),et(e,i,s,n,void 0)}var Wh=Bh(),Fh=({handlers:e,methods:t,constants:r,schema:i,view:s,store:n},o)=>{if(!s)throw new Error("view is not defined");if(!i||typeof i!="object"||Array.isArray(i))throw new Error("schema is required. Define component metadata in .schema.yaml.");let p=i,{template:l,refs:a,styles:c}=s;uc({schema:p,methodExports:Object.keys(t||{})});let d=p.componentName,h=p.propsSchema,f=h?.properties?[...new Set(Object.keys(h.properties).map(u=>Ss(u)))]:[];return Qu({elementName:d,propsSchema:h,propsSchemaKeys:f,template:l,refs:a,styles:c,handlers:e,methods:t,constants:r,store:n,patch:Wh,h:zh,deps:o})},Mh=e=>{let t={};return{once:(r,i)=>{t[r]||(t[r]=[]);let s=(...n)=>{i(...n),t[r]=t[r].filter(o=>o!==s)};return t[r].push(s),()=>{t[r]=(t[r]??[]).filter(n=>n!==s)}},emit:(r,...i)=>{t[r]&&[...t[r]].forEach(s=>{s(...i)})},showAlert:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showConfirm:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showFormDialog:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showComponentDialog:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showDropdownMenu:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},closeAll:async()=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")}}},Kh=Mh(),Uh={globalUI:Kh},Hh={components:Uh},qh={componentName:"rtgl-accordion-item",propsSchema:{type:"object",properties:{label:{type:"string"},content:{type:"string"},w:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},Gh={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}},Yh={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:{}}},Jh={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}},Zh={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:{}}},Xh={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}},Qh={componentName:"rtgl-dropdown-menu",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["label","item","separator"]},id:{type:"string"},path:{type:"string"},href:{type:"string"},disabled:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"},testId:{type:"string"}}}},open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},w:{type:"string"},h:{type:"string"}}},events:{close:{type:"object"},"item-click":{type:"object",properties:{index:{type:"number"},item:{type:"object"},id:{type:"string"},path:{type:"string"},href:{type:"string"},trigger:{type:"string"}}}},methods:{type:"object",properties:{}}},ef={refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},styles:{a:{display:"block",width:"100%","text-decoration":"none",color:"inherit"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} 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.isLabel",value:{type:6,conditions:[{type:1,path:"item.isLabel"},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.isDisabled"}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:4,op:6,left:{type:1,path:"item.hasHref"},right:{type:1,path:"item.linkExtraAttrs"}}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.hasHref"}},{type:1,path:"item.isItem"},{type:1,path:"item.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md bgc=${item.bgc}",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 w=f p=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc}",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 w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc}",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 w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc} data-index=${item.index} data-testid=${item.testId}",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#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:!0}],fast:!0},{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"}," 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}},tf={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"}}}},rf={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}",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"}]}}],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}},sf={componentName:"rtgl-global-ui",propsSchema:{type:"object",properties:{}},events:[],methods:{type:"object",properties:{}}},nf={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"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-dialog#dialog ?open=${isDialogContainerOpen} s=${dialogSize}",value:{type:9,items:[{type:8,properties:[{key:"$if isFormDialogOpen",value:{type:6,conditions:[{type:1,path:"isFormDialogOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-form#formDialog slot=content :form=${formDialogConfig.form} :defaultValues=${formDialogConfig.defaultValues} :context=${formDialogConfig.context} ?disabled=${formDialogConfig.disabled} key=form-dialog-${formDialogConfig.key}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-form#formDialog slot=content :form=",{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} :items=${dropdownConfig.items} key=dropdown-${isDropdownOpen}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-dropdown-menu#dropdownMenu ?open=",{type:1,path:"isDropdownOpen"}," x=",{type:1,path:"dropdownConfig.x"}," y=",{type:1,path:"dropdownConfig.y"}," place=",{type:1,path:"dropdownConfig.place"}," :items=",{type:1,path:"dropdownConfig.items"}," key=dropdown-",{type:1,path:"isDropdownOpen"}]}}],fast:!0}],fast:!1}},of={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:{}}},af={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}},lf={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:{}}},pf={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}},df={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:{}}},cf={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}},uf={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:{}}},hf={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}},ff={componentName:"rtgl-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"any"},testId:{type:"string"}}}},selectedValue:{type:"any"},onChange:{type:"function"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}},mf={refs:{selectButton:{eventListeners:{click:{handler:"handleButtonClick"},keydown:{handler:"handleButtonKeyDown"}}},clearButton:{eventListeners:{click:{handler:"handleClearClick"}}},popover:{eventListeners:{close:{handler:"handleClickOptionsPopoverOverlay"}}},"option*":{eventListeners:{click:{handler:"handleOptionClick"},mouseenter:{handler:"handleOptionMouseEnter"},mouseleave:{handler:"handleOptionMouseLeave"}}},optionAdd:{eventListeners:{click:{handler:"handleAddOptionClick"},mouseenter:{handler:"handleAddOptionMouseEnter"},mouseleave:{handler:"handleAddOptionMouseLeave"}}}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view#selectButton style="display: inline-flex;" d=h av=c h=32 ph=md bw=xs bc=bo h-bc=${selectButtonHoverBorderColor} br=md bgc=bg 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",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text w=1fg ta=s c=${selectedLabelColor} ellipsis",value:{type:1,path:"selectedLabel"},parsedKey:{type:2,parts:["rtgl-text w=1fg ta=s c=",{type:1,path:"selectedLabelColor"}," ellipsis"]}}],fast:!0},{type:8,properties:[{key:"$if showClear",value:{type:6,conditions:[{type:1,path:"showClear"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#clearButton ml=md svg=x wh=16 c=mu-fg cur=pointer data-testid="select-clear-button"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-svg ml=md svg=chevronDown wh=16 c=mu-fg",value:{type:0,value:null}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:['rtgl-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=bg 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-pv=sm",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f ph=lg pv=md cur=pointer bgc=${option.bgc} data-testid=${option.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f ph=lg pv=md cur=pointer bgc=",{type:1,path:"option.bgc"}," data-testid=",{type:1,path:"option.testId"}]}}],fast:!0}],fast:!0},flatten:!0},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f bw=xs bc=mu bwt=sm",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-view#optionAdd w=f ph=lg pv=md cur=pointer 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-pv=sm"]}}],fast:!1}],fast:!1}},yf={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:{}}},gf={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}},bf={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:{}}},vf={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}},wf={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:{}}},_f={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}},xf={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:{}}},Sf={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}},Af={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:{}}},Ef={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:{}},kf={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:{}}},$f={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=Vn;x.components.accordionItem.schema=qh;x.components.accordionItem.store=zn;x.components.accordionItem.view=Gh;x.components.breadcrumb={};x.components.breadcrumb.handlers=Fn;x.components.breadcrumb.schema=Yh;x.components.breadcrumb.store=Zn;x.components.breadcrumb.view=Jh;x.components.card={};x.components.card.schema=Zh;x.components.card.store=ro;x.components.card.view=Xh;x.components.dropdownMenu={};x.components.dropdownMenu.handlers=no;x.components.dropdownMenu.schema=Qh;x.components.dropdownMenu.store=co;x.components.dropdownMenu.view=ef;x.components.form={};x.components.form.handlers=Ta;x.components.form.methods=Wa;x.components.form.schema=tf;x.components.form.store=wa;x.components.form.view=rf;x.components.globalUi={};x.components.globalUi.handlers=nl;x.components.globalUi.schema=sf;x.components.globalUi.store=Sl;x.components.globalUi.view=nf;x.components.navbar={};x.components.navbar.handlers=El;x.components.navbar.schema=of;x.components.navbar.store=Nl;x.components.navbar.view=af;x.components.pageOutline={};x.components.pageOutline.handlers=Dl;x.components.pageOutline.schema=lf;x.components.pageOutline.store=Ul;x.components.pageOutline.view=pf;x.components.popoverInput={};x.components.popoverInput.handlers=Ql;x.components.popoverInput.schema=df;x.components.popoverInput.store=ap;x.components.popoverInput.view=cf;x.components.segmentedControl={};x.components.segmentedControl.handlers=yp;x.components.segmentedControl.schema=uf;x.components.segmentedControl.store=Ip;x.components.segmentedControl.view=hf;x.components.select={};x.components.select.handlers=Wp;x.components.select.schema=ff;x.components.select.store=rd;x.components.select.view=mf;x.components.sidebar={};x.components.sidebar.handlers=ld;x.components.sidebar.schema=yf;x.components.sidebar.store=_d;x.components.sidebar.view=gf;x.components.sliderInput={};x.components.sliderInput.handlers=kd;x.components.sliderInput.schema=bf;x.components.sliderInput.store=Od;x.components.sliderInput.view=vf;x.components.table={};x.components.table.handlers=Vd;x.components.table.schema=wf;x.components.table.store=Kd;x.components.table.view=_f;x.components.tabs={};x.components.tabs.handlers=Hd;x.components.tabs.schema=xf;x.components.tabs.store=Zd;x.components.tabs.view=Sf;x.components.tooltip={};x.components.tooltip.handlers=Xd;x.components.tooltip.schema=Af;x.components.tooltip.store=tc;x.components.tooltip.view=Ef;x.components.waveform={};x.components.waveform.handlers=sc;x.components.waveform.schema=kf;x.components.waveform.store=lc;x.components.waveform.view=$f;Object.keys(x).forEach(e=>{Object.keys(x[e]).forEach(t=>{let r=x[e][t],i=Fh({...r},Hh[e]),s=r.schema?.componentName;if(!s)throw new Error(`[Build] Missing schema.componentName for ${e}/${t}. Define it in .schema.yaml.`);customElements.define(s,i)})});customElements.define("rtgl-button",Mr({}));customElements.define("rtgl-carousel",Gr({}));customElements.define("rtgl-grid",Yr({}));customElements.define("rtgl-view",Zr({}));customElements.define("rtgl-text",Qr({}));customElements.define("rtgl-image",ri({}));customElements.define("rtgl-tag",si({}));customElements.define("rtgl-svg",oi({}));customElements.define("rtgl-input",ge({}));customElements.define("rtgl-input-date",ai({}));customElements.define("rtgl-input-time",li({}));customElements.define("rtgl-input-datetime",pi({}));customElements.define("rtgl-input-number",di({}));customElements.define("rtgl-textarea",ci({}));customElements.define("rtgl-color-picker",ui({}));customElements.define("rtgl-slider",hi({}));customElements.define("rtgl-checkbox",fi({}));customElements.define("rtgl-dialog",mi({}));customElements.define("rtgl-popover",gi({}));})();
1500
+ `,Dr="data-rtgl-render-target",Js="__rtglRenderTarget",Ar=e=>!e||typeof e!="object"?!1:typeof e.getAttribute=="function"?e.getAttribute(Dr)!==null:e[Js]===!0,Gi=e=>{!e||typeof e!="object"||(typeof e.setAttribute=="function"?e.setAttribute(Dr,""):e[Js]=!0)},th=e=>{if(!(!e||typeof e!="object"))return typeof e.querySelector=="function"?e.querySelector(`[${Dr}]`)??e.firstElementChild:Array.isArray(e.childNodes)?e.childNodes.find(Ar)??e.childNodes[0]:Array.isArray(e.children)?e.children.find(Ar)??e.children[0]:e.firstElementChild},rh=({host:e,cssText:t,createStyleSheet:r=()=>new CSSStyleSheet,createElement:i=s=>document.createElement(s)})=>{let s=e.shadowRoot??e.attachShadow({mode:"open"}),n=r();n.replaceSync(eh);let o=[n];if(t){let l=r();l.replaceSync(t),o.push(l)}s.adoptedStyleSheets=o;let p=th(s);return p?(p.style.cssText="display: contents;",Ar(p)||Gi(p)):(p=i("div"),p.style.cssText="display: contents;",Gi(p),s.appendChild(p)),p.parentNode||e.appendChild(p),e.style.display="contents",{shadow:s,renderTarget:p,adoptedStyleSheets:o}},Er=(e,t=requestAnimationFrame)=>t(e),ih=({scheduleFrameFn:e=Er}={})=>({update:(t,r)=>{let i=t.data?.props||{},s=r.data?.props||{};if(JSON.stringify(i)===JSON.stringify(s))return;let n=r.elm;!n||typeof n.render!="function"||(n.setAttribute("isDirty","true"),e(()=>{if(n.render(),n.removeAttribute("isDirty"),n.handlers&&n.handlers.handleOnUpdate){let 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:s})}}))}}),sh=({elementName:e,propsSchema:t,propsSchemaKeys:r,template:i,refs:s,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;_propsSchemaKeys=[];cssText;static get observedAttributes(){return["key"]}get viewData(){let y={};return this.store.selectViewData&&(y=this.store.selectViewData()),y}connectedCallback(){let y=rh({host:this,cssText:this.cssText});this.shadow=y.shadow,this.renderTarget=y.renderTarget,Yu({instance:this,parseAndRenderFn:js,renderFn:this.render})}disconnectedCallback(){Ju({instance:this,clearTimerFn:clearTimeout})}attributeChangedCallback(y,b,g){Zu({instance:this,attributeName:y,oldValue:b,newValue:g,scheduleFrameFn:Er})}render=()=>{Qu({instance:this,createComponentUpdateHookFn:ih})}}class u extends f{static get observedAttributes(){return Uu({propsSchemaKeys:r,toKebabCase:Es})}constructor(){super(),this.constants=lu({setupConstants:h?.constants,fileConstants:l}),this.propsSchema=t,fc({source:this,allowedKeys:r,onPropChange:({propName:y,oldValue:b,newValue:g})=>{Xu({instance:this,propName:y,oldValue:b,newValue:g,scheduleFrameFn:Er})}}),this.props=t?mc(this,r):{},this._propsSchemaKeys=r,this.elementName=e,this.styles=n,this.store=au(a,this.props,this.constants),this.template=i,this.handlers=o,this.methods=p,this.refs=s,this.patch=c,this.deps={...h,store:this.store,render:this.render,handlers:o,props:this.props,constants:this.constants},Yc(this,this.methods),this._snabbdomH=d,this.cssText=pu(e,n)}}return u};function et(e,t,r,i,s){let n=t===void 0?void 0:t.key;return{sel:e,data:t,children:r,text:i,elm:s,key:n}}var wt=Array.isArray;function ut(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function nh(e,t){return document.createElement(e,t)}function oh(e,t,r){return document.createElementNS(e,t,r)}function ah(){return Se(document.createDocumentFragment())}function lh(e){return document.createTextNode(e)}function ph(e){return document.createComment(e)}function dh(e,t,r){if(fe(e)){let i=e;for(;i&&fe(i);)i=Se(i).parent;e=i??e}fe(t)&&(t=Se(t,e)),r&&fe(r)&&(r=Se(r).firstChildNode),e.insertBefore(t,r)}function ch(e,t){e.removeChild(t)}function uh(e,t){fe(t)&&(t=Se(t,e)),e.appendChild(t)}function Zs(e){if(fe(e)){for(;e&&fe(e);)e=Se(e).parent;return e??null}return e.parentNode}function hh(e){var t;if(fe(e)){let r=Se(e),i=Zs(r);if(i&&r.lastChildNode){let s=Array.from(i.childNodes),n=s.indexOf(r.lastChildNode);return(t=s[n+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function fh(e){return e.tagName}function mh(e,t){e.textContent=t}function yh(e){return e.textContent}function gh(e){return e.nodeType===1}function bh(e){return e.nodeType===3}function vh(e){return e.nodeType===8}function fe(e){return e.nodeType===11}function Se(e,t){var r,i,s;let n=e;return(r=n.parent)!==null&&r!==void 0||(n.parent=t??null),(i=n.firstChildNode)!==null&&i!==void 0||(n.firstChildNode=e.firstChild),(s=n.lastChildNode)!==null&&s!==void 0||(n.lastChildNode=e.lastChild),n}var wh={createElement:nh,createElementNS:oh,createTextNode:lh,createDocumentFragment:ah,createComment:ph,insertBefore:dh,removeChild:ch,appendChild:uh,parentNode:Zs,nextSibling:hh,tagName:fh,setTextContent:mh,getTextContent:yh,isElement:gh,isText:bh,isComment:vh,isDocumentFragment:fe};function ct(e){return e===void 0}function re(e){return e!==void 0}var ar=et("",{},[],void 0,void 0);function Ye(e,t){var r,i;let s=e.key===t.key,n=((r=e.data)===null||r===void 0?void 0:r.is)===((i=t.data)===null||i===void 0?void 0:i.is),o=e.sel===t.sel,p=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return o&&s&&n&&p}function _h(){throw new Error("The document fragment is not supported on this platform.")}function xh(e,t){return e.isElement(t)}function Sh(e,t){return e.isDocumentFragment(t)}function Ah(e,t,r){var i;let s={};for(let n=t;n<=r;++n){let o=(i=e[n])===null||i===void 0?void 0:i.key;o!==void 0&&(s[o]=n)}return s}var Eh=["create","update","remove","destroy","pre","post"];function kh(e,t,r){let i={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},s=wh;for(let u of Eh)for(let m of e){let y=m[u];y!==void 0&&i[u].push(y)}function n(u){let m=u.id?"#"+u.id:"",y=u.getAttribute("class"),b=y?"."+y.split(" ").join("."):"";return et(s.tagName(u).toLowerCase()+m+b,{},[],void 0,u)}function o(u){return et(void 0,{},[],void 0,u)}function p(u,m){return function(){if(--m===0){let y=s.parentNode(u);y!==null&&s.removeChild(y,u)}}}function l(u,m){var y,b,g,_;let S,A=u.data;if(A!==void 0){let I=(y=A.hook)===null||y===void 0?void 0:y.init;re(I)&&(I(u),A=u.data)}let E=u.children,C=u.sel;if(C==="!")ct(u.text)&&(u.text=""),u.elm=s.createComment(u.text);else if(C==="")u.elm=s.createTextNode(u.text);else if(C!==void 0){let I=C.indexOf("#"),N=C.indexOf(".",I),z=I>0?I:C.length,B=N>0?N:C.length,J=I!==-1||N!==-1?C.slice(0,Math.min(z,B)):C,Z=u.elm=re(A)&&re(S=A.ns)?s.createElementNS(S,J,A):s.createElement(J,A);for(z<B&&Z.setAttribute("id",C.slice(z+1,B)),N>0&&Z.setAttribute("class",C.slice(B+1).replace(/\./g," ")),S=0;S<i.create.length;++S)i.create[S](ar,u);if(ut(u.text)&&(!wt(E)||E.length===0)&&s.appendChild(Z,s.createTextNode(u.text)),wt(E))for(S=0;S<E.length;++S){let ve=E[S];ve!=null&&s.appendChild(Z,l(ve,m))}let me=u.data.hook;re(me)&&((b=me.create)===null||b===void 0||b.call(me,ar,u),me.insert&&m.push(u))}else if(!((g=void 0)===null||g===void 0)&&g.fragments&&u.children){for(u.elm=((_=s.createDocumentFragment)!==null&&_!==void 0?_:_h)(),S=0;S<i.create.length;++S)i.create[S](ar,u);for(S=0;S<u.children.length;++S){let I=u.children[S];I!=null&&s.appendChild(u.elm,l(I,m))}}else u.elm=s.createTextNode(u.text);return u.elm}function a(u,m,y,b,g,_){for(;b<=g;++b){let S=y[b];S!=null&&s.insertBefore(u,l(S,_),m)}}function c(u){var m,y;let b=u.data;if(b!==void 0){(y=(m=b?.hook)===null||m===void 0?void 0:m.destroy)===null||y===void 0||y.call(m,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,m,y,b){for(var g,_;y<=b;++y){let S,A,E=m[y];if(E!=null)if(re(E.sel)){c(E),S=i.remove.length+1,A=p(E.elm,S);for(let 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;re(C)?C(E,A):A()}else E.children?(c(E),d(u,E.children,0,E.children.length-1)):s.removeChild(u,E.elm)}}function h(u,m,y,b){let g=0,_=0,S=m.length-1,A=m[0],E=m[S],C=y.length-1,I=y[0],N=y[C],z,B,J,Z;for(;g<=S&&_<=C;)A==null?A=m[++g]:E==null?E=m[--S]:I==null?I=y[++_]:N==null?N=y[--C]:Ye(A,I)?(f(A,I,b),A=m[++g],I=y[++_]):Ye(E,N)?(f(E,N,b),E=m[--S],N=y[--C]):Ye(A,N)?(f(A,N,b),s.insertBefore(u,A.elm,s.nextSibling(E.elm)),A=m[++g],N=y[--C]):Ye(E,I)?(f(E,I,b),s.insertBefore(u,E.elm,A.elm),E=m[--S],I=y[++_]):(z===void 0&&(z=Ah(m,g,S)),B=z[I.key],ct(B)?(s.insertBefore(u,l(I,b),A.elm),I=y[++_]):ct(z[N.key])?(s.insertBefore(u,l(N,b),s.nextSibling(E.elm)),N=y[--C]):(J=m[B],J.sel!==I.sel?s.insertBefore(u,l(I,b),A.elm):(f(J,I,b),m[B]=void 0,s.insertBefore(u,J.elm,A.elm)),I=y[++_]));_<=C&&(Z=y[C+1]==null?null:y[C+1].elm,a(u,Z,y,_,C,b)),g<=S&&d(u,m,g,S)}function f(u,m,y){var b,g,_,S,A,E,C,I;let N=(b=m.data)===null||b===void 0?void 0:b.hook;(g=N?.prepatch)===null||g===void 0||g.call(N,u,m);let z=m.elm=u.elm;if(u===m)return;if(m.data!==void 0||re(m.text)&&m.text!==u.text){(_=m.data)!==null&&_!==void 0||(m.data={}),(S=u.data)!==null&&S!==void 0||(u.data={});for(let Z=0;Z<i.update.length;++Z)i.update[Z](u,m);(C=(E=(A=m.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,m)}let B=u.children,J=m.children;ct(m.text)?re(B)&&re(J)?B!==J&&h(z,B,J,y):re(J)?(re(u.text)&&s.setTextContent(z,""),a(z,null,J,0,J.length-1,y)):re(B)?d(z,B,0,B.length-1):re(u.text)&&s.setTextContent(z,""):u.text!==m.text&&(re(B)&&d(z,B,0,B.length-1),s.setTextContent(z,m.text)),(I=N?.postpatch)===null||I===void 0||I.call(N,u,m)}return function(u,m){let y,b,g,_=[];for(y=0;y<i.pre.length;++y)i.pre[y]();for(xh(s,u)?u=n(u):Sh(s,u)&&(u=o(u)),Ye(u,m)?f(u,m,_):(b=u.elm,g=s.parentNode(b),l(m,_),g!==null&&(s.insertBefore(g,m.elm,s.nextSibling(b)),d(g,[u],0,0))),y=0;y<_.length;++y)_[y].data.hook.insert(_[y]);for(y=0;y<i.post.length;++y)i.post[y]();return m}}function Yi(e,t){let r,i,s=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)&&s.classList.remove(i);for(i in o)r=o[i],r!==n[i]&&s.classList[r?"add":"remove"](i)}}var $h={create:Yi,update:Yi};function Ji(e,t){let r,i,s,n=t.elm,o=e.data.props,p=t.data.props;if(!(!o&&!p)&&o!==p){o=o||{},p=p||{};for(r in p)i=p[r],s=o[r],s!==i&&(r!=="value"||n[r]!==i)&&(n[r]=i)}}var Ch={create:Ji,update:Ji},Ih="http://www.w3.org/1999/xlink",Oh="http://www.w3.org/2000/xmlns/",Th="http://www.w3.org/XML/1998/namespace",Zi=58,Lh=120,Nh=109;function Xi(e,t){let r,i=t.elm,s=e.data.attrs,n=t.data.attrs;if(!(!s&&!n)&&s!==n){s=s||{},n=n||{};for(r in n){let o=n[r];s[r]!==o&&(o===!0?i.setAttribute(r,""):o===!1?i.removeAttribute(r):r.charCodeAt(0)!==Lh?i.setAttribute(r,o):r.charCodeAt(3)===Zi?i.setAttributeNS(Th,r,o):r.charCodeAt(5)===Zi?r.charCodeAt(1)===Nh?i.setAttributeNS(Oh,r,o):i.setAttributeNS(Ih,r,o):i.setAttribute(r,o))}for(r in s)r in n||i.removeAttribute(r)}}var Vh={create:Xi,update:Xi},Qi=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,Rh=function(e){Qi(function(){Qi(e)})},kr=!1;function jh(e,t,r){Rh(function(){e[t]=r})}function es(e,t){let r,i,s=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]==="-"?s.style.removeProperty(i):s.style[i]="");for(i in o)if(r=o[i],i==="delayed"&&o.delayed)for(let l in o.delayed)r=o.delayed[l],(!p||r!==n.delayed[l])&&jh(s.style,l,r);else i!=="remove"&&r!==n[i]&&(i[0]==="-"&&i[1]==="-"?s.style.setProperty(i,r):s.style[i]=r)}function Dh(e){let t,r,i=e.elm,s=e.data.style;if(!(!s||!(t=s.destroy)))for(r in t)i.style[r]=t[r]}function Ph(e,t){let r=e.data.style;if(!r||!r.remove){t();return}kr||(e.elm.offsetLeft,kr=!0);let i,s=e.elm,n=0,o=r.remove,p=0,l=[];for(i in o)l.push(i),s.style[i]=o[i];let a=getComputedStyle(s)["transition-property"].split(", ");for(;n<a.length;++n)l.indexOf(a[n])!==-1&&p++;s.addEventListener("transitionend",function(c){c.target===s&&--p,p===0&&t()})}function Bh(){kr=!1}var zh={pre:Bh,create:es,update:es,destroy:Dh,remove:Ph};function Xs(e,t,r){if(typeof e=="function")e.call(t,r,t);else if(typeof e=="object")for(let i=0;i<e.length;i++)Xs(e[i],t,r)}function Wh(e,t){let r=e.type,i=t.data.on;i&&i[r]&&Xs(i[r],t,e)}function Fh(){return function e(t){Wh(t,e.vnode)}}function lr(e,t){let r=e.data.on,i=e.listener,s=e.elm,n=t&&t.data.on,o=t&&t.elm,p;if(r!==n){if(r&&i)if(n)for(p in r)n[p]||s.removeEventListener(p,i,!1);else for(p in r)s.removeEventListener(p,i,!1);if(n){let l=t.listener=e.listener||Fh();if(l.vnode=t,r)for(p in n)r[p]||o.addEventListener(p,l,!1);else for(p in n)o.addEventListener(p,l,!1)}}}var Mh={create:lr,update:lr,destroy:lr},Kh=()=>kh([$h,Ch,Vh,zh,Mh]);function Qs(e,t,r){if(e.ns="http://www.w3.org/2000/svg",r!=="foreignObject"&&t!==void 0)for(let i=0;i<t.length;++i){let s=t[i];if(typeof s=="string")continue;let n=s.data;n!==void 0&&Qs(n,s.children,s.sel)}}function Uh(e,t,r){let i={},s,n,o;if(r!==void 0?(t!==null&&(i=t),wt(r)?s=r:ut(r)?n=r.toString():r&&r.sel&&(s=[r])):t!=null&&(wt(t)?s=t:ut(t)?n=t.toString():t&&t.sel?s=[t]:i=t),s!==void 0)for(o=0;o<s.length;++o)ut(s[o])&&(s[o]=et(void 0,void 0,void 0,s[o],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&Qs(i,s,e),et(e,i,s,n,void 0)}var Hh=Kh(),qh=({handlers:e,methods:t,constants:r,schema:i,view:s,store:n},o)=>{if(!s)throw new Error("view is not defined");if(!i||typeof i!="object"||Array.isArray(i))throw new Error("schema is required. Define component metadata in .schema.yaml.");let p=i,{template:l,refs:a,styles:c}=s;yc({schema:p,methodExports:Object.keys(t||{})});let d=p.componentName,h=p.propsSchema,f=h?.properties?[...new Set(Object.keys(h.properties).map(u=>ks(u)))]:[];return sh({elementName:d,propsSchema:h,propsSchemaKeys:f,template:l,refs:a,styles:c,handlers:e,methods:t,constants:r,store:n,patch:Hh,h:Uh,deps:o})},Gh=e=>{let t={};return{once:(r,i)=>{t[r]||(t[r]=[]);let s=(...n)=>{i(...n),t[r]=t[r].filter(o=>o!==s)};return t[r].push(s),()=>{t[r]=(t[r]??[]).filter(n=>n!==s)}},emit:(r,...i)=>{t[r]&&[...t[r]].forEach(s=>{s(...i)})},showAlert:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showConfirm:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showFormDialog:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showComponentDialog:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showDropdownMenu:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},closeAll:async()=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")}}},Yh=Gh(),Jh={globalUI:Yh},Zh={components:Jh},Xh={componentName:"rtgl-accordion-item",propsSchema:{type:"object",properties:{label:{type:"string"},content:{type:"string"},w:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},Qh={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}},ef={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:{}}},tf={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}},rf={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:{}}},sf={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}},nf={componentName:"rtgl-dropdown-menu",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["label","item","separator"]},id:{type:"string"},path:{type:"string"},href:{type:"string"},disabled:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"},testId:{type:"string"}}}},open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},w:{type:"string"},h:{type:"string"}}},events:{close:{type:"object"},"item-click":{type:"object",properties:{index:{type:"number"},item:{type:"object"},id:{type:"string"},path:{type:"string"},href:{type:"string"},trigger:{type:"string"}}}},methods:{type:"object",properties:{}}},of={refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},styles:{a:{display:"block",width:"100%","text-decoration":"none",color:"inherit"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} 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.isLabel",value:{type:6,conditions:[{type:1,path:"item.isLabel"},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.isDisabled"}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:4,op:6,left:{type:1,path:"item.hasHref"},right:{type:1,path:"item.linkExtraAttrs"}}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.hasHref"}},{type:1,path:"item.isItem"},{type:1,path:"item.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md bgc=${item.bgc}",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 w=f p=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc}",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 w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc}",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 w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc} data-index=${item.index} data-testid=${item.testId}",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#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:!0}],fast:!0},{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"}," 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}},af={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"}}}},lf={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}",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"}]}}],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}},pf={componentName:"rtgl-global-ui",propsSchema:{type:"object",properties:{}},events:[],methods:{type:"object",properties:{}}},df={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"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-dialog#dialog ?open=${isDialogContainerOpen} s=${dialogSize}",value:{type:9,items:[{type:8,properties:[{key:"$if isFormDialogOpen",value:{type:6,conditions:[{type:1,path:"isFormDialogOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-form#formDialog slot=content :form=${formDialogConfig.form} :defaultValues=${formDialogConfig.defaultValues} :context=${formDialogConfig.context} ?disabled=${formDialogConfig.disabled} key=form-dialog-${formDialogConfig.key}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-form#formDialog slot=content :form=",{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} :items=${dropdownConfig.items} key=dropdown-${isDropdownOpen}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-dropdown-menu#dropdownMenu ?open=",{type:1,path:"isDropdownOpen"}," x=",{type:1,path:"dropdownConfig.x"}," y=",{type:1,path:"dropdownConfig.y"}," place=",{type:1,path:"dropdownConfig.place"}," :items=",{type:1,path:"dropdownConfig.items"}," key=dropdown-",{type:1,path:"isDropdownOpen"}]}}],fast:!0}],fast:!1}},cf={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:{}}},uf={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}},hf={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:{}}},ff={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}},mf={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:{}}},yf={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}},gf={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:{}}},bf={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}},vf={componentName:"rtgl-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"any"},testId:{type:"string"}}}},selectedValue:{type:"any"},onChange:{type:"function"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}},wf={refs:{selectButton:{eventListeners:{click:{handler:"handleButtonClick"},keydown:{handler:"handleButtonKeyDown"}}},clearButton:{eventListeners:{click:{handler:"handleClearClick"}}},popover:{eventListeners:{close:{handler:"handleClickOptionsPopoverOverlay"}}},"option*":{eventListeners:{click:{handler:"handleOptionClick"},mouseenter:{handler:"handleOptionMouseEnter"},mouseleave:{handler:"handleOptionMouseLeave"}}},optionAdd:{eventListeners:{click:{handler:"handleAddOptionClick"},mouseenter:{handler:"handleAddOptionMouseEnter"},mouseleave:{handler:"handleAddOptionMouseLeave"}}}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view#selectButton style="display: inline-flex;" d=h av=c h=32 ph=md bw=xs bc=bo h-bc=${selectButtonHoverBorderColor} br=md bgc=bg 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",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text w=1fg ta=s c=${selectedLabelColor} ellipsis",value:{type:1,path:"selectedLabel"},parsedKey:{type:2,parts:["rtgl-text w=1fg ta=s c=",{type:1,path:"selectedLabelColor"}," ellipsis"]}}],fast:!0},{type:8,properties:[{key:"$if showClear",value:{type:6,conditions:[{type:1,path:"showClear"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#clearButton ml=md svg=x wh=16 c=mu-fg cur=pointer data-testid="select-clear-button"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-svg ml=md svg=chevronDown wh=16 c=mu-fg",value:{type:0,value:null}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:['rtgl-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=bg 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-pv=sm",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f ph=lg pv=md cur=pointer bgc=${option.bgc} data-testid=${option.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f ph=lg pv=md cur=pointer bgc=",{type:1,path:"option.bgc"}," data-testid=",{type:1,path:"option.testId"}]}}],fast:!0}],fast:!0},flatten:!0},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f bw=xs bc=mu bwt=sm",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-view#optionAdd w=f ph=lg pv=md cur=pointer 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-pv=sm"]}}],fast:!1}],fast:!1}},_f={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:{}}},xf={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}},Sf={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:{}}},Af={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}},Ef={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:{}}},kf={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}},$f={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:{}}},Cf={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}},If={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:{}}},Of={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:{}},Tf={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:{}}},Lf={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=Pn;x.components.accordionItem.schema=Xh;x.components.accordionItem.store=Kn;x.components.accordionItem.view=Qh;x.components.breadcrumb={};x.components.breadcrumb.handlers=Hn;x.components.breadcrumb.schema=ef;x.components.breadcrumb.store=to;x.components.breadcrumb.view=tf;x.components.card={};x.components.card.schema=rf;x.components.card.store=oo;x.components.card.view=sf;x.components.dropdownMenu={};x.components.dropdownMenu.handlers=po;x.components.dropdownMenu.schema=nf;x.components.dropdownMenu.store=mo;x.components.dropdownMenu.view=of;x.components.form={};x.components.form.handlers=Ra;x.components.form.methods=Ua;x.components.form.schema=af;x.components.form.store=Aa;x.components.form.view=lf;x.components.globalUi={};x.components.globalUi.handlers=pl;x.components.globalUi.schema=pf;x.components.globalUi.store=$l;x.components.globalUi.view=df;x.components.navbar={};x.components.navbar.handlers=Il;x.components.navbar.schema=cf;x.components.navbar.store=Dl;x.components.navbar.view=uf;x.components.pageOutline={};x.components.pageOutline.handlers=Wl;x.components.pageOutline.schema=hf;x.components.pageOutline.store=Yl;x.components.pageOutline.view=ff;x.components.popoverInput={};x.components.popoverInput.handlers=ip;x.components.popoverInput.schema=mf;x.components.popoverInput.store=cp;x.components.popoverInput.view=yf;x.components.segmentedControl={};x.components.segmentedControl.handlers=wp;x.components.segmentedControl.schema=gf;x.components.segmentedControl.store=Np;x.components.segmentedControl.view=bf;x.components.select={};x.components.select.handlers=Up;x.components.select.schema=vf;x.components.select.store=od;x.components.select.view=wf;x.components.sidebar={};x.components.sidebar.handlers=ud;x.components.sidebar.schema=_f;x.components.sidebar.store=Ed;x.components.sidebar.view=xf;x.components.sliderInput={};x.components.sliderInput.handlers=Od;x.components.sliderInput.schema=Sf;x.components.sliderInput.store=Vd;x.components.sliderInput.view=Af;x.components.table={};x.components.table.handlers=Pd;x.components.table.schema=Ef;x.components.table.store=Gd;x.components.table.view=kf;x.components.tabs={};x.components.tabs.handlers=Jd;x.components.tabs.schema=$f;x.components.tabs.store=tc;x.components.tabs.view=Cf;x.components.tooltip={};x.components.tooltip.handlers=rc;x.components.tooltip.schema=If;x.components.tooltip.store=nc;x.components.tooltip.view=Of;x.components.waveform={};x.components.waveform.handlers=lc;x.components.waveform.schema=Tf;x.components.waveform.store=uc;x.components.waveform.view=Lf;Object.keys(x).forEach(e=>{Object.keys(x[e]).forEach(t=>{let r=x[e][t],i=qh({...r},Zh[e]),s=r.schema?.componentName;if(!s)throw new Error(`[Build] Missing schema.componentName for ${e}/${t}. Define it in .schema.yaml.`);customElements.define(s,i)})});customElements.define("rtgl-button",Ur({}));customElements.define("rtgl-carousel",Jr({}));customElements.define("rtgl-grid",Zr({}));customElements.define("rtgl-view",Qr({}));customElements.define("rtgl-text",ti({}));customElements.define("rtgl-image",si({}));customElements.define("rtgl-tag",oi({}));customElements.define("rtgl-svg",li({}));customElements.define("rtgl-input",ge({}));customElements.define("rtgl-input-date",pi({}));customElements.define("rtgl-input-time",di({}));customElements.define("rtgl-input-datetime",ci({}));customElements.define("rtgl-input-number",ui({}));customElements.define("rtgl-textarea",hi({}));customElements.define("rtgl-color-picker",fi({}));customElements.define("rtgl-slider",mi({}));customElements.define("rtgl-checkbox",yi({}));customElements.define("rtgl-dialog",gi({}));customElements.define("rtgl-popover",vi({}));})();