@rettangoli/ui 1.7.4 → 1.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rettangoli-iife-layout.min.js +42 -42
- package/dist/rettangoli-iife-ui.min.js +54 -54
- package/package.json +1 -1
- package/src/common/popover.js +74 -0
- package/src/components/form/form.view.yaml +1 -1
- package/src/components/select/select.handlers.js +11 -1
- package/src/components/tagSelect/tagSelect.handlers.js +1 -1
- package/src/components/tagSelect/tagSelect.schema.yaml +2 -0
- package/src/components/tagSelect/tagSelect.store.js +2 -1
- package/src/primitives/popover.js +117 -81
|
@@ -12,27 +12,27 @@ var rettangoli=(()=>{var _e=`
|
|
|
12
12
|
bottom: 0;
|
|
13
13
|
z-index: 1;
|
|
14
14
|
}
|
|
15
|
-
`,Me=({linkElement:e,href:t,newTab:
|
|
15
|
+
`,Me=({linkElement:e,href:t,newTab:s,rel:r})=>{e.href=t,s?e.target="_blank":e.removeAttribute("target"),r!=null?e.rel=r:s?e.rel="noopener noreferrer":e.removeAttribute("rel")},xe=({shadowRoot:e,slotElement:t,linkElement:s,href:r,newTab:i,rel:n})=>{if(t.parentNode!==e&&e.appendChild(t),!r)return s&&s.parentNode===e&&e.removeChild(s),null;let o=s||document.createElement("a");return Me({linkElement:o,href:r,newTab:i,rel:n}),o.parentNode!==e&&e.appendChild(o),o},Rt=({shadowRoot:e,childElement:t,linkElement:s,href:r,newTab:i,rel:n})=>{if(!r)return s?(t.parentNode===s&&e.appendChild(t),s.parentNode===e&&e.removeChild(s),null):(t.parentNode!==e&&e.appendChild(t),null);let o=s||document.createElement("a");return Me({linkElement:o,href:r,newTab:i,rel:n}),t.parentNode!==o&&o.appendChild(t),o.parentNode!==e&&e.appendChild(o),o};var te=["default","sm","md","lg","xl"],M=()=>te.reduce((e,t)=>(e[t]={},e),{}),Xs=["sm","md","lg","xl"],Dn=({size:e,attr:t})=>e==="default"?t:`${e}-${t}`,Pn=({size:e,includeDefault:t=!0})=>{if(e==="default")return["default"];let s=Xs.indexOf(e);if(s===-1)return t?["default"]:[];let r=Xs.slice(s);return t&&r.push("default"),r},jt=({element:e,size:t,attr:s,includeDefault:r=!0})=>{let i=Pn({size:t,includeDefault:r});for(let n of i){let o=Dn({size:n,attr:s}),l=e.getAttribute(o);if(l!==null)return l}return null};var Bn=/^([1-9]|1[0-2])fg$/,zn=/^([1-9]\d*)\/([1-9]\d*)fb$/,Dt=e=>typeof e=="string"&&Bn.test(e),at=e=>{if(typeof e!="string")return null;let t=e.match(zn);if(!t)return null;let s=Number(t[1]),r=Number(t[2]);return!Number.isInteger(s)||!Number.isInteger(r)||r<=0||s>r?null:{numerator:s,denominator:r}};function Qs({numerator:e,denominator:t,gapVar:s}){return e===t?"100%":e===1?`calc((100% - ((${t} - 1) * ${s})) / ${t})`:`calc(((100% - ((${t} - 1) * ${s})) * ${e}) / ${t})`}var F=({styleBucket:e,axis:t,dimension:s,fillValue:r,allowFlexGrow:i=!1,flexMinDimension:n="0",lockBounds:o=!0})=>{let l=()=>{!i||t!=="width"||(e["flex-grow"]="0",e["flex-shrink"]="1",e["flex-basis"]="auto")},p=()=>{e[`min-${t}`]="unset",e[`max-${t}`]="unset"};if(s===void 0)return;if(s==="f"){l(),e[t]=r,p();return}if(i&&Dt(s)){e["flex-grow"]=s.slice(0,-2),e["flex-basis"]="0%",e[`min-${t}`]=n,e[`max-${t}`]="unset";return}let a=i?at(s):null;if(a){e["flex-grow"]="0",e["flex-shrink"]="0",e["flex-basis"]=Qs({...a,gapVar:"var(--rtgl-flex-gap, 0px)"}),e[`min-${t}`]=n,e[`max-${t}`]="unset";return}l(),e[t]=s,o&&(e[`min-${t}`]=s,e[`max-${t}`]=s)},Fe=({style:e,width:t,fillValue:s="var(--width-stretch)",allowFlexGrow:r=!0,flexMinWidth:i="0"})=>{if(t==="f"){e.width=s,e.flexGrow="",e.flexBasis="",e.minWidth="";return}if(r&&Dt(t)){e.width="",e.flexGrow=t.slice(0,-2),e.flexShrink="",e.flexBasis="0%",e.minWidth=i;return}let n=r?at(t):null;if(n){e.width="",e.flexGrow="0",e.flexShrink="0",e.flexBasis=Qs({...n,gapVar:"var(--rtgl-flex-gap, 0px)"}),e.minWidth=i;return}if(t!=null){e.width=t,e.flexGrow="",e.flexShrink="",e.flexBasis="",e.minWidth="";return}e.width="",e.flexGrow="",e.flexShrink="",e.flexBasis="",e.minWidth=""};var Wn=e=>`${e}`.trim().replace(/\s*\/\s*/g,"/"),Ke=e=>{if(e==null)return;let t=Wn(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 s="";return e.forEach((r,i)=>{s+=r+(t[i]||"")}),s}var Mn=["sm","md","lg","xl"],er={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom",pt:"padding-top",pr:"padding-right",pb:"padding-bottom",pl:"padding-left",p:"padding",ph:"padding-left padding-right",pv:"padding-top padding-bottom",g:"gap --rtgl-flex-gap",gv:"row-gap --rtgl-flex-gap",gh:"column-gap --rtgl-flex-gap",bw:"border-width",bwt:"border-top-width",bwr:"border-right-width",bwb:"border-bottom-width",bwl:"border-left-width",bc:"border-color",br:"border-radius",pos:"position",shadow:"box-shadow",cur:"cursor"},pe=Object.keys(er),q=e=>e.concat(Mn.flatMap(t=>e.map(s=>`${t}-${s}`))),lt={default:void 0,xl:"@media only screen and (max-width: 1280px)",lg:"@media only screen and (max-width: 1024px)",md:"@media only screen and (max-width: 768px)",sm:"@media only screen and (max-width: 640px)"},Y=(e,t={},s=null)=>{let r="";for(let[i,n]of Object.entries(lt)){i!=="default"&&(r+=`${n} {`);for(let[o,l]of Object.entries(e))for(let[p,a]of Object.entries(l)){let c=er[o],d=a.startsWith("--")?`var(${a})`:a,h=i==="default"?o:`${i}-${o}`,f=i==="default"?`h-${o}`:`${i}-h-${o}`,u=(y,m=!1)=>{let b=m?`:host([${y}="${p}"]:hover)`:`:host([${y}="${p}"])`;if(s)return s.split(",").map(_=>`${b} ${_.trim()}`).join(", ");let g=t[o];return g?`${b} ${g}`:b};if(c){let m=c.split(" ").map(b=>`${b}: ${d};`).join(" ");r+=`
|
|
16
16
|
${u(h)}{
|
|
17
17
|
${m}
|
|
18
18
|
}
|
|
19
19
|
${u(f,!0)}{
|
|
20
20
|
${m}
|
|
21
21
|
}
|
|
22
|
-
`}else
|
|
22
|
+
`}else r+=`
|
|
23
23
|
${u(h)}{
|
|
24
24
|
${a}
|
|
25
25
|
}
|
|
26
26
|
${u(f,!0)}{
|
|
27
27
|
${a}
|
|
28
28
|
}
|
|
29
|
-
`}
|
|
30
|
-
`);let o="";for(let[p
|
|
31
|
-
`);
|
|
29
|
+
`}i!=="default"&&(r+="}")}return r};function Fn(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var Kn=e=>/%$/.test(e),Un=e=>/^([1-9]|1[0-2])fg$/.test(e),O=e=>{if(e!=null)return Un(e)||Kn(e)?e:Fn(e)?`${e}px`:Object.keys(L).includes(e)?`var(${L[e]})`:e},L={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function G(e,t=":host"){let s="",r=["default","xl","lg","md","sm"];for(let i of r){let n=lt[i];if(!e[i]||Object.keys(e[i]).length===0)continue;i!=="default"&&(s+=`${n} {
|
|
30
|
+
`);let o="";for(let[l,p]of Object.entries(e[i]))p!=null&&(o+=`${l}: ${p} !important;
|
|
31
|
+
`);s+=`${t} {
|
|
32
32
|
${o.trim()}
|
|
33
33
|
}
|
|
34
|
-
`,
|
|
35
|
-
`)}return
|
|
34
|
+
`,i!=="default"&&(s+=`}
|
|
35
|
+
`)}return s}var Hn={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 _e=`
|
|
|
81
81
|
`,lk:`
|
|
82
82
|
background-color: transparent;
|
|
83
83
|
color: var(--foreground);
|
|
84
|
-
`}},
|
|
84
|
+
`}},tr=Y(Hn,{},".surface");var qn=[{prefix:"sm",maxWidth:640},{prefix:"md",maxWidth:768},{prefix:"lg",maxWidth:1024},{prefix:"xl",maxWidth:1280}],Pt=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 _e=`
|
|
|
252
252
|
color: inherit;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
${
|
|
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
|
|
255
|
+
${tr}
|
|
256
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._containerElement=null,this._surfaceElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._prefixIcon=null,this._suffixIcon=null,this._surfaceElement.className="surface",this._surfaceElement.appendChild(this._slotElement),this._onWindowResize=this._onWindowResize.bind(this)}static get observedAttributes(){return["key","href","new-tab","rel","w","pre","suf","disabled","v","s","sq","sm-s","md-s","lg-s","xl-s"]}connectedCallback(){window.addEventListener("resize",this._onWindowResize),this._updateButton()}disconnectedCallback(){window.removeEventListener("resize",this._onWindowResize)}attributeChangedCallback(t,s,r){this._updateButton()}_onWindowResize(){(this.hasAttribute("sm-s")||this.hasAttribute("md-s")||this.hasAttribute("lg-s")||this.hasAttribute("xl-s"))&&this._updateIcon()}_resolveResponsiveSizeToken(){let t=window.innerWidth;for(let{prefix:s,maxWidth:r}of qn){let i=`${s}-s`;if(t<=r&&this.hasAttribute(i))return this.getAttribute(i)}return this.getAttribute("s")}_updateButton(){this.shadow.innerHTML="";let t=this.hasAttribute("disabled"),s=this.getAttribute("href"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel"),n=s&&!t,o=n?"a":"button";if(this._surfaceElement.tagName.toLowerCase()!==o){let l=document.createElement(o);l.className="surface",l.appendChild(this._slotElement),this._surfaceElement=l}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?(Me({linkElement:this._surfaceElement,href:s,newTab:r,rel:i}),this._surfaceElement.removeAttribute("disabled")):(this._surfaceElement.removeAttribute("href"),this._surfaceElement.removeAttribute("target"),this._surfaceElement.removeAttribute("rel"),t?this._surfaceElement.setAttribute("disabled",""):this._surfaceElement.removeAttribute("disabled")),this.shadow.appendChild(this._surfaceElement),this._containerElement=this._surfaceElement}_updateIcon(){this._prefixIcon&&(this._prefixIcon.remove(),this._prefixIcon=null),this._suffixIcon&&(this._suffixIcon.remove(),this._suffixIcon=null);let t={sm:14,md:18,lg:22},s=this._resolveResponsiveSizeToken(),r=18;this.hasAttribute("sq")?r={sm:14,lg:22}[s]||18:r=t[s]||18;let i=this.getAttribute("pre");i&&(this._prefixIcon=document.createElement("rtgl-svg"),this._prefixIcon.setAttribute("svg",i),this._prefixIcon.setAttribute("wh",r.toString()),this._prefixIcon.style.color="inherit",this._surfaceElement.insertBefore(this._prefixIcon,this._slotElement));let n=this.getAttribute("suf");n&&(this._suffixIcon=document.createElement("rtgl-svg"),this._suffixIcon.setAttribute("svg",n),this._suffixIcon.setAttribute("wh",r.toString()),this._suffixIcon.style.color="inherit",this._surfaceElement.appendChild(this._suffixIcon))}_updateWidth(){let t=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()}},sr=({render:e,html:t})=>Pt;var Yn=({numerator:e,denominator:t,gapVar:s})=>e===t?"100%":e===1?`calc((100% - ((${t} - 1) * ${s})) / ${t})`:`calc(((100% - ((${t} - 1) * ${s})) * ${e}) / ${t})`,pt=({index:e,maxIndex:t})=>!Number.isFinite(e)||!Number.isFinite(t)||t<0?0:Math.min(Math.max(Math.trunc(e),0),t),Bt=({value:e,defaultValue:t=!1})=>{if(e==null)return t;let s=`${e}`.trim().toLowerCase();return s.length===0?!0:!(s==="false"||s==="0"||s==="no"||s==="off"||s==="none")},zt=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"},rr=({slideLeft:e,slideWidth:t,viewportWidth:s,scrollPaddingInlineStart:r=0,scrollPaddingInlineEnd:i=0,snapAlign:n="center",maxScrollLeft:o=Number.POSITIVE_INFINITY})=>{if(!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(s))return 0;let l=r,p=s-i,a=Math.max(p-l,0),c;n==="start"?c=e-l:n==="end"?c=e+t-p:c=e+t/2-(l+a/2);let d=Number.isFinite(o)?Math.max(o,0):Number.POSITIVE_INFINITY;return Math.min(Math.max(c,0),d)},ir=({slideWidthCss:e,snapAlign:t="center"})=>`${t??""}`.trim().toLowerCase()!=="center"?"0px":`max(calc((100% - (${e&&`${e}`.trim().length>0?`${e}`.trim():"100%"})) / 2), 0px)`,nr=({slideWidth:e,gapVar:t="var(--rtgl-carousel-gap, 0px)"})=>{if(e==null||`${e}`.trim()===""||e==="f")return"100%";let s=at(`${e}`.trim());return s?Yn({...s,gapVar:t}):O(`${e}`.trim())??"100%"};var Gn=["a","button","input","select","textarea","label","summary","[contenteditable]"].join(", "),Wt=e=>{if(e==null)return null;let t=`${e}`.trim();return t.length>0?t:null},Jn=e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,or=e=>{let t="http://www.w3.org/2000/svg",s=document.createElementNS(t,"svg");s.setAttribute("viewBox","0 0 24 24"),s.setAttribute("aria-hidden","true"),s.setAttribute("focusable","false");let r=document.createElementNS(t,"path");return r.setAttribute("d",e==="left"?"M15 18 9 12l6-6":"M9 18l6-6-6-6"),r.setAttribute("fill","none"),r.setAttribute("stroke","currentColor"),r.setAttribute("stroke-width","2"),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round"),s.appendChild(r),s},Mt=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 _e=`
|
|
|
448
448
|
border-color: var(--foreground);
|
|
449
449
|
transform: scale(1.2);
|
|
450
450
|
}
|
|
451
|
-
`))}static get observedAttributes(){return["index","sw","sna","g","spi","sbh","snap","nav","pager"]}constructor(){super(),e.initializeStyleSheet(),this._slides=[],this._pagerButtons=[],this._currentIndex=0,this._clickSuppressUntil=0,this._dragState=null,this._scrollFrame=null,this._resizeFrame=null,this._scrollAnimationFrame=null,this._isReflectingIndex=!1,this._slideStyleCache=new WeakMap,this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._rootElement=document.createElement("div"),this._rootElement.id="root",this._viewportShellElement=document.createElement("div"),this._viewportShellElement.id="viewport-shell",this._viewportShellElement.setAttribute("part","viewport-shell"),this._viewportElement=document.createElement("div"),this._viewportElement.id="viewport",this._viewportElement.tabIndex=0,this._viewportElement.setAttribute("part","viewport"),this._slotElement=document.createElement("slot"),this._viewportElement.appendChild(this._slotElement),this._controlsElement=document.createElement("div"),this._controlsElement.id="controls",this._controlsElement.setAttribute("part","controls"),this._controlsElement.hidden=!0,this._prevButton=document.createElement("button"),this._prevButton.id="prev-button",this._prevButton.type="button",this._prevButton.hidden=!0,this._prevButton.append(oi("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(oi("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 zt(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 Bt({value:this.getAttribute("nav"),defaultValue:!0})}_showsPagerControls(){return Bt({value:this.getAttribute("pager"),defaultValue:!1})}goTo(t,r={}){if(!this._slides.length){this._setCurrentIndex(0,{emit:!1,reflect:!0});return}let i=pt({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(Yn))}_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(pt({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=ni({slideWidth:this.getAttribute("sw")}),r=Wt(this.getAttribute("sna"))??"center",i=zt(this.getAttribute("snap")),s=O(this.getAttribute("g"))??"var(--spacing-md)",n=O(this.getAttribute("spi"))??"0px",o=Wt(this.getAttribute("sbh"))??"smooth",p=si({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=Gn(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=pt({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=Wt(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 ii({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="")}},ai=()=>Mt;var Jn={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out"}},D=Y(Jn);var dt=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(or("left")),this._prevButton.setAttribute("part","nav-button prev-button"),this._prevButton.setAttribute("aria-label","Previous slide"),this._pagerElement=document.createElement("div"),this._pagerElement.id="pager",this._pagerElement.setAttribute("part","pager"),this._pagerElement.hidden=!0,this._nextButton=document.createElement("button"),this._nextButton.id="next-button",this._nextButton.type="button",this._nextButton.hidden=!0,this._nextButton.append(or("right")),this._nextButton.setAttribute("part","nav-button next-button"),this._nextButton.setAttribute("aria-label","Next slide"),this._viewportShellElement.append(this._viewportElement,this._prevButton,this._nextButton),this._controlsElement.append(this._pagerElement),this._rootElement.append(this._viewportShellElement,this._controlsElement),this.shadow.append(this._rootElement),this._handleSlotChange=this._handleSlotChange.bind(this),this._handleClickPrev=this._handleClickPrev.bind(this),this._handleClickNext=this._handleClickNext.bind(this),this._handleViewportKeydown=this._handleViewportKeydown.bind(this),this._handleViewportScroll=this._handleViewportScroll.bind(this),this._handleViewportPointerDown=this._handleViewportPointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._handleViewportClickCapture=this._handleViewportClickCapture.bind(this),this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._resizeFrame!==null&&cancelAnimationFrame(this._resizeFrame),this._resizeFrame=requestAnimationFrame(()=>{this._resizeFrame=null,!(this._dragState?.dragging||!this._slides.length)&&this.goTo(this._currentIndex,{behavior:"auto"})})}):null}get index(){return this._currentIndex}set index(t){let s=Number(t);this.setAttribute("index",Number.isFinite(s)?`${s}`:"0")}get snap(){return zt(this.getAttribute("snap"))!=="none"}set snap(t){if(t===!1||`${t}`.trim().toLowerCase()==="false"){this.setAttribute("snap","false");return}this.setAttribute("snap","true")}connectedCallback(){this._slotElement.addEventListener("slotchange",this._handleSlotChange),this._prevButton.addEventListener("click",this._handleClickPrev),this._nextButton.addEventListener("click",this._handleClickNext),this._viewportElement.addEventListener("keydown",this._handleViewportKeydown),this._viewportElement.addEventListener("scroll",this._handleViewportScroll,{passive:!0}),this._viewportElement.addEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.addEventListener("click",this._handleViewportClickCapture,!0),this._resizeObserver?.observe(this._viewportElement),this._syncSlides(),this._updateLayoutStyles();let t=this.hasAttribute("index")?Number(this.getAttribute("index")):0;this.goTo(t,{behavior:"auto"})}disconnectedCallback(){this._slotElement.removeEventListener("slotchange",this._handleSlotChange),this._prevButton.removeEventListener("click",this._handleClickPrev),this._nextButton.removeEventListener("click",this._handleClickNext),this._viewportElement.removeEventListener("keydown",this._handleViewportKeydown),this._viewportElement.removeEventListener("scroll",this._handleViewportScroll),this._viewportElement.removeEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.removeEventListener("click",this._handleViewportClickCapture,!0),this._removePointerListeners(),this._resizeObserver?.disconnect(),this._scrollFrame!==null&&(cancelAnimationFrame(this._scrollFrame),this._scrollFrame=null),this._resizeFrame!==null&&(cancelAnimationFrame(this._resizeFrame),this._resizeFrame=null),this._cancelScrollAnimation(),this._setDraggingState(!1),this._slides.forEach(t=>{this._restoreSlideStyles(t),t.removeAttribute("data-rtgl-carousel-active")})}attributeChangedCallback(t,s,r){if(s!==r){if(t==="index"){if(this._isReflectingIndex){this._isReflectingIndex=!1;return}this.goTo(Number(r),{behavior:"smooth"});return}if(t==="nav"||t==="pager"){this._updateControls();return}this._updateLayoutStyles()}}next(){this.goTo(this._currentIndex+1)}prev(){this.goTo(this._currentIndex-1)}_showsNavControls(){return Bt({value:this.getAttribute("nav"),defaultValue:!0})}_showsPagerControls(){return Bt({value:this.getAttribute("pager"),defaultValue:!1})}goTo(t,s={}){if(!this._slides.length){this._setCurrentIndex(0,{emit:!1,reflect:!0});return}let r=pt({index:Number(t),maxIndex:this._slides.length-1}),i=this._slides[r],n=s.behavior??"smooth";i&&(this._scrollViewportTo(this._getSlideTargetScrollLeft(i),{behavior:n}),this._setCurrentIndex(r))}_handleSlotChange(){this._syncSlides(),this._updateLayoutStyles(),this.goTo(this._currentIndex,{behavior:"auto"})}_handleClickPrev(){this.prev()}_handleClickNext(){this.next()}_handleViewportKeydown(t){t.key==="ArrowRight"?(t.preventDefault(),this.next()):t.key==="ArrowLeft"&&(t.preventDefault(),this.prev())}_handleViewportScroll(){this._scrollAnimationFrame===null&&(this._dragState?.dragging||this._requestSyncFromScroll())}_handleViewportPointerDown(t){t.pointerType==="mouse"&&(t.button!==0||!this._slides.length||this._eventTargetsInteractiveElement(t)||(this._cancelScrollAnimation(),this._dragState={pointerId:t.pointerId,startX:t.clientX,startScrollLeft:this._viewportElement.scrollLeft,dragging:!1},this._viewportElement.setPointerCapture(t.pointerId),this._viewportElement.addEventListener("pointermove",this._handlePointerMove),this._viewportElement.addEventListener("pointerup",this._handlePointerUp),this._viewportElement.addEventListener("pointercancel",this._handlePointerUp)))}_handlePointerMove(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let s=t.clientX-this._dragState.startX;!this._dragState.dragging&&Math.abs(s)>6&&(this._dragState.dragging=!0,this._setDraggingState(!0)),this._dragState.dragging&&(t.preventDefault(),this._viewportElement.scrollLeft=this._dragState.startScrollLeft-s)}_handlePointerUp(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let s=this._dragState.dragging,r=s?this._findNearestSlideIndex():this._currentIndex;this._viewportElement.hasPointerCapture(t.pointerId)&&this._viewportElement.releasePointerCapture(t.pointerId),this._dragState=null,this._setDraggingState(!1),this._removePointerListeners(),s&&(this._clickSuppressUntil=performance.now()+250,this.snap?this.goTo(r,{behavior:"smooth"}):this._requestSyncFromScroll())}_handleViewportClickCapture(t){performance.now()<this._clickSuppressUntil&&(t.preventDefault(),t.stopPropagation())}_removePointerListeners(){this._viewportElement.removeEventListener("pointermove",this._handlePointerMove),this._viewportElement.removeEventListener("pointerup",this._handlePointerUp),this._viewportElement.removeEventListener("pointercancel",this._handlePointerUp)}_eventTargetsInteractiveElement(t){return t.composedPath().some(s=>s instanceof Element&&s.matches(Gn))}_requestSyncFromScroll(){this._scrollFrame!==null&&cancelAnimationFrame(this._scrollFrame),this._scrollFrame=requestAnimationFrame(()=>{this._scrollFrame=null;let t=this._findNearestSlideIndex();this._setCurrentIndex(t)})}_findNearestSlideIndex(){if(!this._slides.length)return 0;let t=this._viewportElement.scrollLeft,s=this._currentIndex,r=Number.POSITIVE_INFINITY;return this._slides.forEach((i,n)=>{let o=Math.abs(this._getSlideTargetScrollLeft(i)-t);o<r&&(s=n,r=o)}),s}_syncSlides(){let t=new Set(this._slides),s=this._slotElement.assignedElements({flatten:!0}).filter(r=>!r.hasAttribute("hidden"));t.forEach(r=>{s.includes(r)||(this._restoreSlideStyles(r),r.removeAttribute("data-rtgl-carousel-active"))}),this._slides=s,this._slides.forEach(r=>{this._slideStyleCache.has(r)||this._slideStyleCache.set(r,{flex:r.style.flex,width:r.style.width,minWidth:r.style.minWidth,maxWidth:r.style.maxWidth,boxSizing:r.style.boxSizing,scrollSnapAlign:r.style.scrollSnapAlign,scrollSnapStop:r.style.scrollSnapStop})}),this._buildPager(),this._setCurrentIndex(pt({index:this._currentIndex,maxIndex:this._slides.length-1}),{emit:!1,reflect:!0})}_restoreSlideStyles(t){let s=this._slideStyleCache.get(t);s&&(t.style.flex=s.flex,t.style.width=s.width,t.style.minWidth=s.minWidth,t.style.maxWidth=s.maxWidth,t.style.boxSizing=s.boxSizing,t.style.scrollSnapAlign=s.scrollSnapAlign,t.style.scrollSnapStop=s.scrollSnapStop)}_updateLayoutStyles(){let t=nr({slideWidth:this.getAttribute("sw")}),s=Wt(this.getAttribute("sna"))??"center",r=zt(this.getAttribute("snap")),i=O(this.getAttribute("g"))??"var(--spacing-md)",n=O(this.getAttribute("spi"))??"0px",o=Wt(this.getAttribute("sbh"))??"smooth",l=ir({slideWidthCss:t,snapAlign:s});this.style.setProperty("--rtgl-carousel-slide-width",t),this.style.setProperty("--rtgl-carousel-gap",i),this.style.setProperty("--rtgl-carousel-scroll-snap-type",r),this.style.setProperty("--rtgl-carousel-scroll-padding-inline",n),this.style.setProperty("--rtgl-carousel-edge-padding-inline",l),this.style.setProperty("--rtgl-carousel-scroll-behavior",o),this.style.setProperty("--rtgl-carousel-snap-align",s),this._slides.forEach(p=>{p.style.flex=`0 0 ${t}`,p.style.width=t,p.style.minWidth="0",p.style.maxWidth="unset",p.style.boxSizing="border-box",p.style.scrollSnapAlign=s,p.style.scrollSnapStop="always"})}_setDraggingState(t){if(t){this.setAttribute("dragging",""),this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this.removeAttribute("dragging"),this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior=""}_scrollViewportTo(t,s={}){let r=s.behavior??"smooth",i=Math.min(Math.max(t,0),Math.max(this._viewportElement.scrollWidth-this._viewportElement.clientWidth,0));if(r!=="smooth"||Math.abs(i-this._viewportElement.scrollLeft)<1){this._cancelScrollAnimation(),this._viewportElement.scrollLeft=i;return}this._cancelScrollAnimation();let n=this._viewportElement.scrollLeft,o=i-n,l=Math.min(720,Math.max(420,Math.abs(o)*.35)),p=performance.now();this._setAnimatingScrollState(!0);let a=c=>{let d=c-p,h=Math.min(d/l,1),f=Jn(h);if(this._viewportElement.scrollLeft=n+o*f,h<1){this._scrollAnimationFrame=requestAnimationFrame(a);return}this._viewportElement.scrollLeft=i,this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1)};this._scrollAnimationFrame=requestAnimationFrame(a)}_cancelScrollAnimation(){this._scrollAnimationFrame!==null&&(cancelAnimationFrame(this._scrollAnimationFrame),this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1))}_buildPager(){this._pagerElement.replaceChildren(),this._pagerButtons=[],this._slides.forEach((t,s)=>{let r=document.createElement("button");r.type="button",r.setAttribute("part","pager-button"),r.setAttribute("aria-label",`Go to slide ${s+1}`),r.setAttribute("title",`Go to slide ${s+1}`),r.addEventListener("click",()=>{this.goTo(s)}),this._pagerElement.appendChild(r),this._pagerButtons.push(r)}),this._updateControls()}_updateControls(){let t=this._slides.length>0,s=this._slides.length>1,r=this._currentIndex<=0,i=this._currentIndex>=this._slides.length-1,n=s&&this._showsNavControls(),o=s&&this._showsPagerControls();this._prevButton.hidden=!n,this._nextButton.hidden=!n,this._pagerElement.hidden=!o,this._controlsElement.hidden=!o,this._prevButton.disabled=!t||r,this._nextButton.disabled=!t||i,this._pagerButtons.forEach((l,p)=>{let a=p===this._currentIndex;l.classList.toggle("is-active",a),l.disabled=a,l.setAttribute("part",a?"pager-button pager-button-active":"pager-button"),a?l.setAttribute("aria-current","true"):l.removeAttribute("aria-current")})}_setCurrentIndex(t,s={}){let r=pt({index:t,maxIndex:this._slides.length-1}),i=s.emit??!0,n=s.reflect??!0,o=this._currentIndex;this._currentIndex=r,this._slides.forEach((l,p)=>{p===r?l.setAttribute("data-rtgl-carousel-active","true"):l.removeAttribute("data-rtgl-carousel-active")}),this._updateControls(),n&&this.getAttribute("index")!==`${r}`&&(this._isReflectingIndex=!0,this.setAttribute("index",`${r}`)),i&&o!==r&&this.dispatchEvent(new CustomEvent("index-change",{detail:{index:r},bubbles:!0}))}_resolveScrollInlinePosition(){let t=Wt(this.getAttribute("sna"))??"center";return t==="start"||t==="end"||t==="center"?t:"center"}_getSlideTargetScrollLeft(t){let s=this._viewportElement.getBoundingClientRect(),r=t.getBoundingClientRect();if(s.width<=0||r.width<=0)return this._viewportElement.scrollLeft;let i=getComputedStyle(this._viewportElement),n=this._viewportElement.scrollLeft,o=r.left-s.left+n;return rr({slideLeft:o,slideWidth:r.width,viewportWidth:s.width,scrollPaddingInlineStart:this._parsePx(i.scrollPaddingInlineStart),scrollPaddingInlineEnd:this._parsePx(i.scrollPaddingInlineEnd),snapAlign:this._resolveScrollInlinePosition(),maxScrollLeft:this._viewportElement.scrollWidth-this._viewportElement.clientWidth})}_parsePx(t){let s=Number.parseFloat(t);return Number.isFinite(s)?s:0}_setAnimatingScrollState(t){if(t){this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this._dragState?.dragging||(this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior="")}},ar=()=>Mt;var Zn={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=Y(Zn);var dt=T`
|
|
452
452
|
:host([sh]:not([sv])) {
|
|
453
453
|
overflow-x: auto;
|
|
454
454
|
flex-wrap: nowrap;
|
|
@@ -528,7 +528,7 @@ var rettangoli=(()=>{var _e=`
|
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
530
|
|
|
531
|
-
`;var Ue={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},
|
|
531
|
+
`;var Ue={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:`
|
|
532
532
|
background-color: var(--primary);
|
|
533
533
|
`,se:`
|
|
534
534
|
background-color: var(--secondary);
|
|
@@ -570,7 +570,7 @@ var rettangoli=(()=>{var _e=`
|
|
|
570
570
|
left: 0;
|
|
571
571
|
top: 0;
|
|
572
572
|
height: 100%;
|
|
573
|
-
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:L,pr:L,pb:L,pl:L,p:L,ph:L,pv:L,g:L,gv:L,gh:L,bw:Ue,bwt:Ue,bwr:Ue,bwb:Ue,bwl:Ue,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",su:"--surface",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},ct=Y(
|
|
573
|
+
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:L,pr:L,pb:L,pl:L,p:L,ph:L,pv:L,g:L,gv:L,gh:L,bw:Ue,bwt:Ue,bwr:Ue,bwb:Ue,bwl:Ue,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",su:"--surface",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},ct=Y(Xn);var Qn={mt:L,mr:L,mb:L,ml:L,m:L,mh:L,mv:L},W=Y(Qn);var Te=T`
|
|
574
574
|
a, a:link, a:visited, a:hover, a:active {
|
|
575
575
|
color: inherit;
|
|
576
576
|
text-decoration: none;
|
|
@@ -580,7 +580,7 @@ var rettangoli=(()=>{var _e=`
|
|
|
580
580
|
margin: 0;
|
|
581
581
|
font: inherit;
|
|
582
582
|
}
|
|
583
|
-
`;var
|
|
583
|
+
`;var eo=e=>{if(e==null)return null;let t=e.trim();return t===""?null:/^[1-9]\d*$/.test(t)?`repeat(${t}, minmax(0, 1fr))`:t},Ft=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
584
584
|
slot {
|
|
585
585
|
display: contents;
|
|
586
586
|
}
|
|
@@ -596,11 +596,11 @@ var rettangoli=(()=>{var _e=`
|
|
|
596
596
|
|
|
597
597
|
${dt}
|
|
598
598
|
${W}
|
|
599
|
-
${
|
|
599
|
+
${j}
|
|
600
600
|
${ct}
|
|
601
601
|
${Te}
|
|
602
602
|
${_e}
|
|
603
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...q([...pe,"cols","op","wh","w","h","hide","show","sh","sv","z","overflow"])]}_styles=M();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),
|
|
603
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...q([...pe,"cols","op","wh","w","h","hide","show","sh","sv","z","overflow"])]}_styles=M();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),s=this.hasAttribute("new-tab"),r=this.getAttribute("rel");this._linkElement=xe({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:s,rel:r})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=M(),te.forEach(s=>{let r=f=>`${s==="default"?"":`${s}-`}${f}`,i=this.getAttribute(r("wh")),n=O(i===null?this.getAttribute(r("w")):i),o=O(i===null?this.getAttribute(r("h")):i),l=eo(this.getAttribute(r("cols"))),p=this.getAttribute(r("op")),a=this.getAttribute(r("z"));l!==null&&(this._styles[s]["grid-template-columns"]=l),a!==null&&(this._styles[s]["z-index"]=a),p!==null&&(this._styles[s].opacity=p),F({styleBucket:this._styles[s],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),F({styleBucket:this._styles[s],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(r("hide"))&&(this._styles[s].display="none"),this.hasAttribute(r("show"))&&(this._styles[s].display="grid");let c=this.hasAttribute(r("sh")),d=this.hasAttribute(r("sv")),h=this.getAttribute(r("overflow"));c&&d?(this._styles[s].overflow="auto",this._styles[s]["scrollbar-gutter"]="stable"):c?(this._styles[s]["overflow-x"]="auto",this._styles[s]["scrollbar-gutter"]="stable"):d&&(this._styles[s]["overflow-y"]="auto",this._styles[s]["scrollbar-gutter"]="stable"),h==="hidden"&&(this._styles[s].overflow="hidden")});let t=G(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,s,r){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}s!==r&&this.updateStyles()}},lr=({render:e,html:t})=>Ft;var pr=T`
|
|
604
604
|
|
|
605
605
|
:host([d="h"]) {
|
|
606
606
|
flex-direction: row;
|
|
@@ -688,13 +688,13 @@ var rettangoli=(()=>{var _e=`
|
|
|
688
688
|
|
|
689
689
|
|
|
690
690
|
${dt}
|
|
691
|
-
${
|
|
691
|
+
${pr}
|
|
692
692
|
${W}
|
|
693
|
-
${
|
|
693
|
+
${j}
|
|
694
694
|
${ct}
|
|
695
695
|
${Te}
|
|
696
696
|
${_e}
|
|
697
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...q([...pe,"op","wh","w","h","ar","bgi","bgs","bgp","bgr","hsb","hide","show","sh","sv","z","d","ah","av","wrap","no-wrap","overflow","stretch"])]}_styles=M();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),
|
|
697
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...q([...pe,"op","wh","w","h","ar","bgi","bgs","bgp","bgr","hsb","hide","show","sh","sv","z","d","ah","av","wrap","no-wrap","overflow","stretch"])]}_styles=M();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),s=this.hasAttribute("new-tab"),r=this.getAttribute("rel");this._linkElement=xe({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:s,rel:r})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=M(),te.forEach(s=>{let r=z=>`${s==="default"?"":`${s}-`}${z}`,i=this.getAttribute(r("wh")),n=O(i===null?this.getAttribute(r("w")):i),o=O(i===null?this.getAttribute(r("h")):i),l=this.getAttribute(r("op")),p=this.getAttribute(r("z")),a=Ke(this.getAttribute(r("ar"))),c=ut(this.getAttribute(r("bgi"))),d=ut(this.getAttribute(r("bgs"))),h=ut(this.getAttribute(r("bgp"))),f=ut(this.getAttribute(r("bgr")));p!==null&&(this._styles[s]["z-index"]=p),l!==null&&(this._styles[s].opacity=l),a!==void 0&&(this._styles[s]["aspect-ratio"]=a),c!==null&&(this._styles[s]["background-image"]=c),d!==null&&(this._styles[s]["background-size"]=d),h!==null&&(this._styles[s]["background-position"]=h),f!==null&&(this._styles[s]["background-repeat"]=f),F({styleBucket:this._styles[s],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),F({styleBucket:this._styles[s],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(r("hide"))&&(this._styles[s].display="none"),this.hasAttribute(r("show"))&&(this._styles[s].display="flex");let u=this.getAttribute(r("d")),y=this.getAttribute(r("ah")),m=this.getAttribute(r("av")),b=jt({element:this,size:s,attr:"d"});u==="h"?this._styles[s]["flex-direction"]="row":u==="v"?this._styles[s]["flex-direction"]="column":s==="default"&&!u&&["sm","md","lg","xl"].some(B=>this.hasAttribute(`${B}-d`))&&(this._styles[s]["flex-direction"]="column");let g=b==="h",_=b==="v"||!b;g&&(y==="c"?this._styles[s]["justify-content"]="center":y==="e"?this._styles[s]["justify-content"]="flex-end":y==="s"&&(this._styles[s]["justify-content"]="flex-start"),m==="c"?(this._styles[s]["align-items"]="center",this._styles[s]["align-content"]="center"):m==="e"?(this._styles[s]["align-items"]="flex-end",this._styles[s]["align-content"]="flex-end"):m==="s"&&(this._styles[s]["align-items"]="flex-start")),_&&(y!==null||m!==null)&&(y==="c"?this._styles[s]["align-items"]="center":y==="e"?this._styles[s]["align-items"]="flex-end":y==="s"&&(this._styles[s]["align-items"]="flex-start"),m==="c"?this._styles[s]["justify-content"]="center":m==="e"?this._styles[s]["justify-content"]="flex-end":m==="s"&&(this._styles[s]["justify-content"]="flex-start"));let S=this.hasAttribute(r("wrap")),A=this.hasAttribute(r("no-wrap"));S&&(this._styles[s]["flex-wrap"]="wrap"),A&&(this._styles[s]["flex-wrap"]="nowrap"),this.hasAttribute(r("stretch"))&&(this._styles[s]["align-self"]="stretch");let k=this.hasAttribute(r("sh")),C=this.hasAttribute(r("sv")),I=this.hasAttribute(r("hsb")),V=this.getAttribute(r("overflow"));k&&C?(this._styles[s].overflow="auto",this._styles[s]["scrollbar-gutter"]="stable",this._styles[s]["flex-wrap"]="nowrap"):k?(this._styles[s]["overflow-x"]="auto",this._styles[s]["scrollbar-gutter"]="stable",this._styles[s]["flex-wrap"]="nowrap"):C&&(this._styles[s]["overflow-y"]="auto",this._styles[s]["scrollbar-gutter"]="stable",this._styles[s]["flex-wrap"]="nowrap"),V==="hidden"&&(this._styles[s].overflow="hidden",this._styles[s]["flex-wrap"]="nowrap"),I&&(this._styles[s]["-ms-overflow-style"]="none",this._styles[s]["scrollbar-gutter"]="auto",this._styles[s]["scrollbar-width"]="none")});let t=G(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,s,r){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}s!==r&&this.updateStyles()}},dr=({render:e,html:t})=>Kt;var to={ta:{s:"text-align: start;",c:"text-align: center;",e:"text-align: end;",j:"text-align: justify;"},s:{h1:`
|
|
698
698
|
font-size: var(--h1-font-size);
|
|
699
699
|
font-weight: var(--h1-font-weight);
|
|
700
700
|
line-height: var(--h1-line-height);
|
|
@@ -734,7 +734,7 @@ var rettangoli=(()=>{var _e=`
|
|
|
734
734
|
font-weight: var(--xs-font-weight);
|
|
735
735
|
line-height: var(--xs-line-height);
|
|
736
736
|
letter-spacing: var(--xs-letter-spacing);
|
|
737
|
-
`}},
|
|
737
|
+
`}},cr=Y(to);var so={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);"}},ht=Y(so);var Ut=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
738
738
|
:host {
|
|
739
739
|
display: block;
|
|
740
740
|
font-size: var(--md-font-size);
|
|
@@ -754,11 +754,11 @@ var rettangoli=(()=>{var _e=`
|
|
|
754
754
|
color: var(--anchor-color-hover);
|
|
755
755
|
}
|
|
756
756
|
${_e}
|
|
757
|
-
${
|
|
757
|
+
${cr}
|
|
758
758
|
${ht}
|
|
759
759
|
${W}
|
|
760
|
-
${
|
|
761
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","new-tab","rel","break-long-tokens"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,r
|
|
760
|
+
${j}
|
|
761
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","new-tab","rel","break-long-tokens"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,s,r){t==="href"||t==="new-tab"||t==="rel"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=O(this.getAttribute("w")),s=this.hasAttribute("ellipsis"),r=this.hasAttribute("break-long-tokens");s?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap",this.style.overflowWrap="",this.style.wordBreak=""):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace="",this.style.overflowWrap=r?"anywhere":"",this.style.wordBreak=r?"break-word":""),Fe({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),s=this.hasAttribute("new-tab"),r=this.getAttribute("rel");this._linkElement=xe({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:s,rel:r})}},ur=({render:e,html:t})=>Ut;var He={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},ro={bgc:{pr:"background-color: var(--primary);",se:"background-color: var(--secondary);",de:"background-color: var(--destructive);",fg:"background-color: var(--foreground);",bg:"background-color: var(--background);",su:"background-color: var(--surface);",mu:"background-color: var(--muted);",ac:"background-color: var(--accent);",bo:"background-color: var(--border);"},pos:{rel:"relative",abs:"absolute",fix:"fixed"},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},bw:He,bwt:He,bwr:He,bwb:He,bwl:He,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",su:"--surface",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},hr=e=>Y(ro,{},e);var io={mt:L,mr:L,mb:L,ml:L,m:L,mh:L,mv:L},fr=e=>Y(io,{},e);var Ht=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
762
762
|
:host {
|
|
763
763
|
display: contents;
|
|
764
764
|
}
|
|
@@ -793,10 +793,10 @@ var rettangoli=(()=>{var _e=`
|
|
|
793
793
|
width: 100%;
|
|
794
794
|
}
|
|
795
795
|
|
|
796
|
-
${
|
|
797
|
-
${
|
|
798
|
-
${
|
|
799
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return q([...pe,"key","src","alt","href","new-tab","rel","wh","w","h","ar","hide","show","op","z","of"])}_styles=M();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),
|
|
796
|
+
${hr("img, a")}
|
|
797
|
+
${fr("img, a")}
|
|
798
|
+
${j}
|
|
799
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return q([...pe,"key","src","alt","href","new-tab","rel","wh","w","h","ar","hide","show","op","z","of"])}_styles=M();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),s=this.hasAttribute("new-tab"),r=this.getAttribute("rel");this._linkElement=Rt({shadowRoot:this.shadow,childElement:this._imgElement,linkElement:this._linkElement,href:t,newTab:s,rel:r})}connectedCallback(){this._updateImageAttributes(),this.updateStyles()}attributeChangedCallback(t,s,r){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}if(t==="src"||t==="alt"){this._updateImageAttributes();return}s!==r&&this.updateStyles()}updateStyles(){this._styles=M(),te.forEach(s=>{let r=c=>`${s==="default"?"":`${s}-`}${c}`,i=this.getAttribute(r("wh")),n=O(i===null?this.getAttribute(r("w")):i),o=O(i===null?this.getAttribute(r("h")):i),l=this.getAttribute(r("op")),p=this.getAttribute(r("z")),a=Ke(this.getAttribute(r("ar")));p!==null&&(this._styles[s]["z-index"]=p),l!==null&&(this._styles[s].opacity=l),a!==void 0&&(this._styles[s]["aspect-ratio"]=a),F({styleBucket:this._styles[s],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),F({styleBucket:this._styles[s],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(r("hide"))&&(this._styles[s].display="none !important"),this.hasAttribute(r("show"))&&(this._styles[s].display="block !important")});let t=G(this._styles,"img, a");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_updateImageAttributes(){let t=this.getAttribute("src"),s=this.getAttribute("alt");t!==null?this._imgElement.setAttribute("src",t):this._imgElement.removeAttribute("src"),s!==null?this._imgElement.setAttribute("alt",s):this._imgElement.removeAttribute("alt")}},yr=({render:e,html:t})=>Ht;var no={s:{sm:`
|
|
800
800
|
height: 20px;
|
|
801
801
|
padding-left: 8px;
|
|
802
802
|
padding-right: 8px;
|
|
@@ -849,7 +849,7 @@ var rettangoli=(()=>{var _e=`
|
|
|
849
849
|
background-color: var(--destructive);
|
|
850
850
|
color: var(--destructive-foreground);
|
|
851
851
|
border-color: transparent;
|
|
852
|
-
`}},
|
|
852
|
+
`}},mr=Y(no,{},".surface");var qt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
853
853
|
:host {
|
|
854
854
|
display: inline-flex;
|
|
855
855
|
min-width: 0;
|
|
@@ -945,13 +945,13 @@ var rettangoli=(()=>{var _e=`
|
|
|
945
945
|
opacity: 1;
|
|
946
946
|
}
|
|
947
947
|
|
|
948
|
-
${
|
|
948
|
+
${mr}
|
|
949
949
|
:host .surface {
|
|
950
950
|
border-radius: var(--tag-border-radius) !important;
|
|
951
951
|
}
|
|
952
952
|
${W}
|
|
953
|
-
${
|
|
954
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._surfaceElement=document.createElement("span"),this._surfaceElement.className="surface",this._surfaceElement.setAttribute("part","surface"),this._labelElement=document.createElement("span"),this._labelElement.className="label",this._labelElement.setAttribute("part","label"),this._slotElement=document.createElement("slot"),this._labelElement.appendChild(this._slotElement),this._surfaceElement.appendChild(this._labelElement),this.shadow.appendChild(this._surfaceElement),this._prefixIcon=null,this._suffixIcon=null,this._removeButton=null,this._onRemoveClick=this._onRemoveClick.bind(this)}static get observedAttributes(){return["key","pre","suf","removable","w"]}connectedCallback(){this._updateWidth(),this._updateStructure()}attributeChangedCallback(t,r
|
|
953
|
+
${j}
|
|
954
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._surfaceElement=document.createElement("span"),this._surfaceElement.className="surface",this._surfaceElement.setAttribute("part","surface"),this._labelElement=document.createElement("span"),this._labelElement.className="label",this._labelElement.setAttribute("part","label"),this._slotElement=document.createElement("slot"),this._labelElement.appendChild(this._slotElement),this._surfaceElement.appendChild(this._labelElement),this.shadow.appendChild(this._surfaceElement),this._prefixIcon=null,this._suffixIcon=null,this._removeButton=null,this._onRemoveClick=this._onRemoveClick.bind(this)}static get observedAttributes(){return["key","pre","suf","removable","w"]}connectedCallback(){this._updateWidth(),this._updateStructure()}attributeChangedCallback(t,s,r){if(t==="w"){this._updateWidth();return}s!==r&&this._updateStructure()}_updateWidth(){let t=O(this.getAttribute("w"));Fe({style:this.style,width:t,flexMinWidth:"0"})}_createIconElement(t,s){let r=document.createElement("rtgl-svg");return r.className=t,r.setAttribute("part",s),r.setAttribute("aria-hidden","true"),r}_syncIcon({iconName:t,element:s,className:r,part:i,insertBeforeElement:n}){if(!t)return s&&s.remove(),null;let o=s||this._createIconElement(r,i);return o.setAttribute("svg",t),o.parentNode!==this._surfaceElement?this._surfaceElement.insertBefore(o,n):o.nextSibling!==n&&this._surfaceElement.insertBefore(o,n),o}_syncRemoveButton(){if(!this.hasAttribute("removable")){this._removeButton&&(this._removeButton.removeEventListener("click",this._onRemoveClick),this._removeButton.remove(),this._removeButton=null);return}this._removeButton||(this._removeButton=document.createElement("button"),this._removeButton.type="button",this._removeButton.className="removeButton",this._removeButton.setAttribute("part","remove-button"),this._removeButton.setAttribute("aria-label","Remove tag"),this._removeButton.addEventListener("click",this._onRemoveClick),this._surfaceElement.appendChild(this._removeButton))}_updateStructure(){this._prefixIcon=this._syncIcon({iconName:this.getAttribute("pre"),element:this._prefixIcon,className:"prefixIcon",part:"prefix-icon",insertBeforeElement:this._labelElement}),this._syncRemoveButton(),this._suffixIcon=this._syncIcon({iconName:this.getAttribute("suf"),element:this._suffixIcon,className:"suffixIcon",part:"suffix-icon",insertBeforeElement:this._removeButton})}_onRemoveClick(t){t.preventDefault(),t.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-click",{detail:{value:this.getAttribute("value")},bubbles:!0,composed:!0}))}},gr=({render:e,html:t})=>qt;var br=T`
|
|
955
955
|
:host([pt="xs"]) svg {
|
|
956
956
|
padding-top: var(--spacing-xs);
|
|
957
957
|
}
|
|
@@ -1093,10 +1093,10 @@ var rettangoli=(()=>{var _e=`
|
|
|
1093
1093
|
}
|
|
1094
1094
|
|
|
1095
1095
|
${ht}
|
|
1096
|
-
${
|
|
1096
|
+
${br}
|
|
1097
1097
|
${W}
|
|
1098
|
-
${
|
|
1099
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return e._icons}static addIcon(t,
|
|
1098
|
+
${j}
|
|
1099
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return e._icons}static addIcon(t,s){e._icons[t]=s}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,s,r){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),s=O(t===null?this.getAttribute("w"):t),r=O(t===null?this.getAttribute("h"):t);s!=null?this.style.width=s:this.style.width="",r!=null?this.style.height=r:this.style.height=""}getBoundingClientRect(){let t=this.shadow.querySelector("svg");return t?t.getBoundingClientRect():super.getBoundingClientRect()}_render(){try{let t=this.getAttribute("svg"),s=e._icons[t]||(window.rtglIcons||{})[t];if(s){this.shadow.innerHTML=s;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},vr=({render:e,html:t})=>Yt;var oo=["mt","mr","mb","ml","m","mh","mv","cur"],Gt=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`
|
|
1100
1100
|
:host {
|
|
1101
1101
|
display: contents;
|
|
1102
1102
|
}
|
|
@@ -1159,8 +1159,8 @@ var rettangoli=(()=>{var _e=`
|
|
|
1159
1159
|
text-align: left;
|
|
1160
1160
|
}
|
|
1161
1161
|
${W}
|
|
1162
|
-
${
|
|
1163
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=M(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","min","max","step","s",...q([...
|
|
1162
|
+
${j}
|
|
1163
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=M(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","min","max","step","s",...q([...oo,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,s,r){if(s!==r){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(e.inputSpecificAttributes.includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=M(),te.forEach(s=>{let r=a=>`${s==="default"?"":`${s}-`}${a}`,i=this.getAttribute(r("wh")),n=O(i===null?this.getAttribute(r("w")):i),o=O(i===null?this.getAttribute(r("h")):i),l=this.getAttribute(r("op")),p=this.getAttribute(r("z"));p!==null&&(this._styles[s]["z-index"]=p),l!==null&&(this._styles[s].opacity=l),F({styleBucket:this._styles[s],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),F({styleBucket:this._styles[s],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(r("hide"))&&(this._styles[s].display="none"),this.hasAttribute(r("show"))&&(this._styles[s].display="block")});let t=G(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,s){if(s==null||s==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,s)}_syncValueAttribute(){this._inputElement.value=this.getAttribute("value")??""}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("type"),r=new Set(["text","password","date","time","datetime-local"]).has(t)?t:"text",i=this.getAttribute("min"),n=this.getAttribute("max"),o=this.getAttribute("step"),l=this.hasAttribute("disabled");this._setOrRemoveInputAttribute("type",r),this._setOrRemoveInputAttribute("min",i),this._setOrRemoveInputAttribute("max",n),this._setOrRemoveInputAttribute("step",o),l?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},ve=({render:e,html:t})=>Gt;var ao=ve({}),qe="date",Jt=class extends ao{connectedCallback(){this.getAttribute("type")!==qe&&super.setAttribute("type",qe),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,s,r){if(t==="type"&&r!==qe){this.getAttribute("type")!==qe&&super.setAttribute("type",qe);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,s,r)}},wr=({render:e,html:t})=>Jt;var lo=ve({}),Ye="time",Zt=class extends lo{connectedCallback(){this.getAttribute("type")!==Ye&&super.setAttribute("type",Ye),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,s,r){if(t==="type"&&r!==Ye){this.getAttribute("type")!==Ye&&super.setAttribute("type",Ye);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,s,r)}},_r=({render:e,html:t})=>Zt;var po=ve({}),Ge="datetime-local",Xt=class extends po{connectedCallback(){this.getAttribute("type")!==Ge&&super.setAttribute("type",Ge),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,s,r){if(t==="type"&&r!==Ge){this.getAttribute("type")!==Ge&&super.setAttribute("type",Ge);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,s,r)}},xr=({render:e,html:t})=>Xt;var co=["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`
|
|
1164
1164
|
:host {
|
|
1165
1165
|
display: contents;
|
|
1166
1166
|
}
|
|
@@ -1194,8 +1194,8 @@ var rettangoli=(()=>{var _e=`
|
|
|
1194
1194
|
cursor: not-allowed;
|
|
1195
1195
|
}
|
|
1196
1196
|
${W}
|
|
1197
|
-
${
|
|
1198
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=M(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","placeholder","disabled","value","step","min","max","s",...q([...
|
|
1197
|
+
${j}
|
|
1198
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=M(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","placeholder","disabled","value","step","min","max","s",...q([...co,"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 s=this._inputElement.value;if(s.trim()===""){this.dispatchEvent(new CustomEvent(t,{detail:{value:null},bubbles:!0}));return}let r=parseFloat(s);isNaN(r)||(r=this._clampValueToBounds(r),this._inputElement.value=r.toString(),this.dispatchEvent(new CustomEvent(t,{detail:{value:r},bubbles:!0})))};_onInput=()=>{this._emitValueEvent("value-input")};_onChange=()=>{this._emitValueEvent("value-change")};attributeChangedCallback(t,s,r){if(s!==r){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(e.inputSpecificAttributes.includes(t)){this._updateInputAttributes(),(t==="min"||t==="max")&&this._syncValueAttribute();return}this.updateStyles()}}updateStyles(){this._styles=M(),te.forEach(s=>{let r=a=>`${s==="default"?"":`${s}-`}${a}`,i=this.getAttribute(r("wh")),n=O(i===null?this.getAttribute(r("w")):i),o=O(i===null?this.getAttribute(r("h")):i),l=this.getAttribute(r("op")),p=this.getAttribute(r("z"));p!==null&&(this._styles[s]["z-index"]=p),l!==null&&(this._styles[s].opacity=l),F({styleBucket:this._styles[s],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),F({styleBucket:this._styles[s],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(r("hide"))&&(this._styles[s].display="none"),this.hasAttribute(r("show"))&&(this._styles[s].display="block")});let t=G(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,s){if(s==null||s==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,s)}_clampValueToBounds(t){let s=t,r=this.getAttribute("min");if(r!==null){let n=parseFloat(r);isNaN(n)||(s=Math.max(s,n))}let i=this.getAttribute("max");if(i!==null){let n=parseFloat(i);isNaN(n)||(s=Math.min(s,n))}return s}_syncValueAttribute(){let t=this.getAttribute("value");if(t==null||t===""){this._inputElement.value="";return}let s=parseFloat(t);if(isNaN(s)){this._inputElement.value="";return}let r=this._clampValueToBounds(s);this._inputElement.value=r.toString()}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("step"),s=this.getAttribute("min"),r=this.getAttribute("max"),i=this.hasAttribute("disabled");this._inputElement.setAttribute("type","number"),this._setOrRemoveInputAttribute("step",t),this._setOrRemoveInputAttribute("min",s),this._setOrRemoveInputAttribute("max",r),i?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},Sr=({render:e,html:t})=>Qt;var es=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
1199
1199
|
:host {
|
|
1200
1200
|
display: contents;
|
|
1201
1201
|
}
|
|
@@ -1222,8 +1222,8 @@ var rettangoli=(()=>{var _e=`
|
|
|
1222
1222
|
cursor: not-allowed;
|
|
1223
1223
|
}
|
|
1224
1224
|
${W}
|
|
1225
|
-
${
|
|
1226
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._textareaElement=document.createElement("textarea"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onInput),this._textareaElement.addEventListener("change",this._onChange)}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._textareaElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._textareaElement.value},bubbles:!0}))};static get observedAttributes(){return["key","placeholder","disabled","value","cols","rows",...q([...pe,"wh","w","h","hide","show","op","z"])]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}focus(){this._textareaElement&&this._textareaElement.focus()}select(){this._textareaElement&&this._textareaElement.select()}attributeChangedCallback(t,r
|
|
1225
|
+
${j}
|
|
1226
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._textareaElement=document.createElement("textarea"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onInput),this._textareaElement.addEventListener("change",this._onChange)}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._textareaElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._textareaElement.value},bubbles:!0}))};static get observedAttributes(){return["key","placeholder","disabled","value","cols","rows",...q([...pe,"wh","w","h","hide","show","op","z"])]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}focus(){this._textareaElement&&this._textareaElement.focus()}select(){this._textareaElement&&this._textareaElement.select()}attributeChangedCallback(t,s,r){if(t==="key"){requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""});return}if(t==="value"&&requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""}),t==="placeholder"&&requestAnimationFrame(()=>{let n=this.getAttribute("placeholder");n===void 0||n==="null"?this._textareaElement.removeAttribute("placeholder"):this._textareaElement.setAttribute("placeholder",n??"")}),["cols","rows","disabled"].includes(t)){this._updateTextareaAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let o=h=>`${n==="default"?"":`${n}-`}${h}`,l=this.getAttribute(o("wh")),p=O(l===null?this.getAttribute(o("w")):l),a=O(l===null?this.getAttribute(o("h")):l),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),p==="f"?this._styles[n].width="var(--width-stretch)":p!==void 0&&(this._styles[n].width=p,this._styles[n]["min-width"]=p,this._styles[n]["max-width"]=p),a==="f"?this._styles[n].height="100%":a!==void 0&&(this._styles[n].height=a,this._styles[n]["min-height"]=a,this._styles[n]["max-height"]=a),this.hasAttribute(o("hide"))&&(this._styles[n].display="none"),this.hasAttribute(o("show"))&&(this._styles[n].display="block")});let i=G(this._styles,"textarea");i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateTextareaAttributes(){let t=this.getAttribute("cols"),s=this.getAttribute("rows"),r=this.hasAttribute("disabled");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),s!==null?this._textareaElement.setAttribute("rows",s):this._textareaElement.removeAttribute("rows"),r?this._textareaElement.setAttribute("disabled",""):this._textareaElement.removeAttribute("disabled")}},Ar=({render:e,html:t})=>es;var uo=["mt","mr","mb","ml","m","mh","mv","cur"],ho=/^#[0-9a-fA-F]{6}$/,ts=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
1227
1227
|
:host {
|
|
1228
1228
|
display: contents;
|
|
1229
1229
|
}
|
|
@@ -1245,8 +1245,8 @@ var rettangoli=(()=>{var _e=`
|
|
|
1245
1245
|
opacity: 0.5;
|
|
1246
1246
|
}
|
|
1247
1247
|
${W}
|
|
1248
|
-
${
|
|
1249
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=M(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="color",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("change",this._onChange),this._inputElement.addEventListener("input",this._onInput)}static get observedAttributes(){return["key","value","disabled",...q([...
|
|
1248
|
+
${j}
|
|
1249
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=M(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="color",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("change",this._onChange),this._inputElement.addEventListener("input",this._onInput)}static get observedAttributes(){return["key","value","disabled",...q([...uo,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,s,r){if(s!==r){if(t==="key"){this._syncValueAttribute();return}if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=M(),te.forEach(s=>{let r=a=>`${s==="default"?"":`${s}-`}${a}`,i=this.getAttribute(r("wh")),n=O(i===null?this.getAttribute(r("w")):i),o=O(i===null?this.getAttribute(r("h")):i),l=this.getAttribute(r("op")),p=this.getAttribute(r("z"));p!==null&&(this._styles[s]["z-index"]=p),l!==null&&(this._styles[s].opacity=l),F({styleBucket:this._styles[s],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),F({styleBucket:this._styles[s],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(r("hide"))&&(this._styles[s].display="none"),this.hasAttribute(r("show"))&&(this._styles[s].display="block")});let t=G(this._styles,'input[type="color"]');t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_syncValueAttribute(){let t=this.getAttribute("value");if(t===null){this._inputElement.value="#000000";return}this._inputElement.value=ho.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()}},kr=({render:e,html:t})=>ts;var ss=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
1250
1250
|
:host {
|
|
1251
1251
|
display: contents;
|
|
1252
1252
|
}
|
|
@@ -1299,8 +1299,8 @@ var rettangoli=(()=>{var _e=`
|
|
|
1299
1299
|
cursor: not-allowed;
|
|
1300
1300
|
}
|
|
1301
1301
|
${W}
|
|
1302
|
-
${
|
|
1303
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",...q([...pe,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};attributeChangedCallback(t,r
|
|
1302
|
+
${j}
|
|
1303
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",...q([...pe,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};attributeChangedCallback(t,s,r){if(t==="key"&&s!==r){requestAnimationFrame(()=>{let n=this.getAttribute("value"),o=this.getAttribute("min")||"0";this._inputElement.value=n??o});return}if(["value","min","max","step","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let o=h=>`${n==="default"?"":`${n}-`}${h}`,l=this.getAttribute(o("wh")),p=O(l===null?this.getAttribute(o("w")):l),a=O(l===null?this.getAttribute(o("h")):l),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),p==="f"?this._styles[n].width="var(--width-stretch)":p!==void 0&&(this._styles[n].width=p,this._styles[n]["min-width"]=p,this._styles[n]["max-width"]=p),a==="f"?this._styles[n].height="100%":a!==void 0&&(this._styles[n].height=a,this._styles[n]["min-height"]=a,this._styles[n]["max-height"]=a),this.hasAttribute(o("hide"))&&(this._styles[n].display="none"),this.hasAttribute(o("show"))&&(this._styles[n].display="block")});let i=G(this._styles,'input[type="range"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("value"),s=this.getAttribute("min"),r=this.getAttribute("max"),i=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null?this._inputElement.value=t:this._inputElement.value=s??0,s!==null?this._inputElement.min=s:this._inputElement.min="0",r!==null?this._inputElement.max=r:this._inputElement.max="100",i!==null?this._inputElement.step=i:this._inputElement.step="1",n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Er=({render:e,html:t})=>ss;var rs=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
1304
1304
|
:host {
|
|
1305
1305
|
display: inline-flex;
|
|
1306
1306
|
}
|
|
@@ -1368,8 +1368,8 @@ var rettangoli=(()=>{var _e=`
|
|
|
1368
1368
|
opacity: 0.5;
|
|
1369
1369
|
}
|
|
1370
1370
|
${W}
|
|
1371
|
-
${
|
|
1372
|
-
`))}constructor(){super(),this._isSyncingLabelState=!1,e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="checkbox",this._wrapperElement=document.createElement("label"),this._wrapperElement.className="checkbox-wrapper",this._labelElement=document.createElement("span"),this._labelElement.className="checkbox-label",this._labelSlotElement=document.createElement("slot"),this._labelSlotElement.addEventListener("slotchange",()=>{this._updateLabelState()}),this._labelElement.appendChild(this._labelSlotElement),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this._wrapperElement.appendChild(this._inputElement),this._wrapperElement.appendChild(this._labelElement),this.shadow.appendChild(this._wrapperElement),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","checked","disabled","label",...q([...pe,"wh","w","h","hide","show","op","z"])]}get checked(){return this._inputElement.checked}set checked(t){this._inputElement.checked=!!t}get value(){return this._inputElement.checked}set value(t){this._inputElement.checked=!!t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.checked},bubbles:!0}))};attributeChangedCallback(t,r
|
|
1371
|
+
${j}
|
|
1372
|
+
`))}constructor(){super(),this._isSyncingLabelState=!1,e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="checkbox",this._wrapperElement=document.createElement("label"),this._wrapperElement.className="checkbox-wrapper",this._labelElement=document.createElement("span"),this._labelElement.className="checkbox-label",this._labelSlotElement=document.createElement("slot"),this._labelSlotElement.addEventListener("slotchange",()=>{this._updateLabelState()}),this._labelElement.appendChild(this._labelSlotElement),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this._wrapperElement.appendChild(this._inputElement),this._wrapperElement.appendChild(this._labelElement),this.shadow.appendChild(this._wrapperElement),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","checked","disabled","label",...q([...pe,"wh","w","h","hide","show","op","z"])]}get checked(){return this._inputElement.checked}set checked(t){this._inputElement.checked=!!t}get value(){return this._inputElement.checked}set value(t){this._inputElement.checked=!!t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.checked},bubbles:!0}))};attributeChangedCallback(t,s,r){if(t==="key"&&s!==r){requestAnimationFrame(()=>{let n=this.hasAttribute("checked");this._inputElement.checked=n});return}if(t==="checked"){this._inputElement.checked=r!==null;return}if(t==="disabled"){r!==null?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled");return}if(t==="label"){this._updateLabelState();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let o=h=>`${n==="default"?"":`${n}-`}${h}`,l=this.getAttribute(o("wh")),p=O(l===null?this.getAttribute(o("w")):l),a=O(l===null?this.getAttribute(o("h")):l),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),p==="f"?this._styles[n].width="var(--width-stretch)":p!==void 0&&(this._styles[n].width=p,this._styles[n]["min-width"]=p,this._styles[n]["max-width"]=p),a==="f"?this._styles[n].height="100%":a!==void 0&&(this._styles[n].height=a,this._styles[n]["min-height"]=a,this._styles[n]["max-height"]=a),this.hasAttribute(o("hide"))&&(this._styles[n].display="none"),this.hasAttribute(o("show"))&&(this._styles[n].display="block")});let i=G(this._styles,'input[type="checkbox"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}connectedCallback(){let t=this.hasAttribute("checked");this._inputElement.checked=t,this.hasAttribute("disabled")&&this._inputElement.setAttribute("disabled",""),this._updateLabelState()}_updateLabelState(){if(!this._isSyncingLabelState){this._isSyncingLabelState=!0;try{let t=this.getAttribute("label"),s=t??"";this._labelSlotElement.textContent!==s&&(this._labelSlotElement.textContent=s);let i=this._labelSlotElement.assignedNodes({flatten:!0}).some(l=>l.nodeType===Node.TEXT_NODE?l.textContent.trim().length>0:l.nodeType===Node.ELEMENT_NODE),n=typeof t=="string"&&t.trim().length>0,o=i||n;o&&!this.hasAttribute("has-label")?this.setAttribute("has-label",""):!o&&this.hasAttribute("has-label")&&this.removeAttribute("has-label")}finally{this._isSyncingLabelState=!1}}}},$r=({render:e,html:t})=>rs;var is=40,fo=6,ns=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
1373
1373
|
:host {
|
|
1374
1374
|
display: contents;
|
|
1375
1375
|
}
|
|
@@ -1456,7 +1456,7 @@ var rettangoli=(()=>{var _e=`
|
|
|
1456
1456
|
animation: none;
|
|
1457
1457
|
}
|
|
1458
1458
|
}
|
|
1459
|
-
`))}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
|
|
1459
|
+
`))}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,s,r){t==="open"?r!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():r===null&&this._dialogElement.open&&this._hideModal():t==="s"?this._scheduleAdaptiveCentering({resetRetries:!0}):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,s){if(!(!t||t.nodeType!==Node.ELEMENT_NODE)){t.localName==="rtgl-text"&&s.push(t);for(let r of t.children)this._collectTextElements(r,s);if(t.shadowRoot)for(let r of t.shadowRoot.children)this._collectTextElements(r,s)}}_syncLongTokenWrapping(){if(this._clearManagedLongTokenWrapping(),!this._slotElement)return;let t=this._slotElement.assignedNodes({flatten:!0}),s=[];for(let r of t)this._collectTextElements(r,s);for(let r of s)r.hasAttribute("ellipsis")||r.hasAttribute("break-long-tokens")||(r.setAttribute("break-long-tokens",""),this._managedLongTokenTextElements.add(r))}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._slotElement.addEventListener("slotchange",this._onSlotChange),this._dialogElement.appendChild(this._slotElement)),this._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(),s=t?Math.round(t.getBoundingClientRect().height):0;if(s<=0){this._layoutRetryCount<fo&&(this._layoutRetryCount+=1,this._scheduleAdaptiveCentering());return}this._layoutRetryCount=0;let r=window.innerHeight;if(s>=r-2*is){this._slotElement.style.marginTop=`${is}px`,this._slotElement.style.marginBottom=`${is}px`,this._dialogElement.style.height="100vh";return}let i=r-s,n=Math.floor(i/2);this._slotElement.style.marginTop=`${n}px`,this._slotElement.style.marginBottom=`${n}px`,this._dialogElement.style.height="auto"}get dialog(){return this._dialogElement}},Cr=({render:e,html:t})=>ns;var Ir=({x:e,y:t,width:s,height:r,place:i,viewportWidth:n,viewportHeight:o,offset:l=8,padding:p=8})=>{let a=e,c=t;switch(i){case"t":a=e-s/2,c=t-r-l;break;case"ts":a=e,c=t-r-l;break;case"te":a=e-s,c=t-r-l;break;case"r":a=e+l,c=t-r/2;break;case"rs":a=e+l,c=t;break;case"re":a=e+l,c=t-r;break;case"b":a=e-s/2,c=t+l;break;case"bs":a=e,c=t+l;break;case"be":a=e-s,c=t+l;break;case"l":a=e-s-l,c=t-r/2;break;case"ls":a=e-s-l,c=t;break;case"le":a=e-s-l,c=t-r;break;default:a=e,c=t+l;break}return{left:Math.max(p,Math.min(a,n-s-p)),top:Math.max(p,Math.min(c,o-r-p))}};var Or="data-rtgl-popover-content",os="min-width: 200px; max-width: 400px; box-sizing: border-box;",as=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
1460
1460
|
:host {
|
|
1461
1461
|
display: contents;
|
|
1462
1462
|
}
|
|
@@ -1505,19 +1505,19 @@ var rettangoli=(()=>{var _e=`
|
|
|
1505
1505
|
slot[name="content"] {
|
|
1506
1506
|
display: contents;
|
|
1507
1507
|
}
|
|
1508
|
-
`))}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-ph","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(Ii));return t?this._contentWrapper=t:(this._contentWrapper=document.createElement("rtgl-view"),this._contentWrapper.setAttribute(Ii,""),this._contentWrapper.setAttribute("part","content"),this._contentWrapper.setAttribute("bgc","su"),this._contentWrapper.setAttribute("bw","xs"),this._contentWrapper.setAttribute("bc","bo"),this._contentWrapper.setAttribute("br","md"),this._contentWrapper.setAttribute("ph","sm"),this._contentWrapper.setAttribute("pv","sm"),this._contentWrapper.setAttribute("style",or)),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")||"su"),t.setAttribute("ph",this.getAttribute("content-ph")||"sm"),t.setAttribute("pv",this.getAttribute("content-pv")||"sm");let i=this.getAttribute("content-style");t.setAttribute("style",i?`${or} ${i}`:or)}_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))||this.hasAttribute("open")?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}},Oi=({render:e,html:t})=>ar;var fo=(e,t)=>{let{store:r,render:i}=e;r.toggleOpen({}),i()},yo=Object.freeze(Object.defineProperty({__proto__:null,handleClickHeader:fo},Symbol.toStringTag,{value:"Module"})),mo=()=>Object.freeze({open:!1}),go=["id","class","style","slot","label","content"],bo=(e={})=>Object.entries(e).filter(([t])=>!go.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),vo=({state:e,props:t})=>({label:t.label||"",content:t.content||"",openClass:e.open?"content-wrapper open":"content-wrapper",chevronIcon:e.open?"chevronUp":"chevronDown",containerAttrString:bo(t)}),wo=({state:e})=>{e.open=!e.open},_o=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:mo,selectViewData:vo,toggleOpen:wo},Symbol.toStringTag,{value:"Module"})),xo=(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}}))}},So=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:xo},Symbol.toStringTag,{value:"Module"})),Ao=()=>Object.freeze({}),ko=["id","class","style","slot","items","sep","max","separator"],Eo=(e={})=>Object.entries(e).filter(([t])=>!ko.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),$o=e=>{if(e==null||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t},Co=e=>`${e}`.replace(/"/g,"""),Io=(e,t)=>{if(!t||t<3||e.length<=t)return e;let r=t-2;return[e[0],{isEllipsis:!0,label:"..."},...e.slice(-r)]},Oo=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="${Co(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"}}),To=({props:e})=>{let t=Eo(e),r=Array.isArray(e.items)?e.items:[],i=$o(e.max),s=e.sep||"breadcrumb-arrow",n=Oo(r),o=Io(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}},Lo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Ao,selectViewData:To},Symbol.toStringTag,{value:"Module"})),Vo=["id","class","style","slot","head","desc","size","d","ah","av","wrap","noWrap","g","gh","gv","p","pt","pr","pb","pl","pv","ph","bw","bwt","bwr","bwb","bwl","bc","br","shadow","bgc","href","newTab","rel","cur","sv","sh","overflow"],Ti={sm:{cardAttrString:"p=md sm-p=sm g=md sm-g=sm",headerAttrString:"g=xs",headingSize:"lg",subheadingSize:"sm"},md:{cardAttrString:"p=lg md-p=md sm-p=md g=lg md-g=md sm-g=md",headerAttrString:"g=sm",headingSize:"h4",subheadingSize:"sm"},lg:{cardAttrString:"p=xl lg-p=lg md-p=md sm-p=md g=lg md-g=md sm-g=md",headerAttrString:"g=sm",headingSize:"h3",subheadingSize:"md"}},No=(e={})=>Object.entries(e).filter(([t])=>!Vo.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),jo=()=>Object.freeze({}),Do=({props:e={}})=>{let t=Ti[e.size]?e.size:"md",r=Ti[t];return{containerAttrString:No(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:jo,selectViewData:Do},Symbol.toStringTag,{value:"Module"})),Po=(e={})=>e.type==="section"||e.type==="label"?"section":e.type==="separator"?"separator":"item",Bo=(e,t)=>{let{dispatchEvent:r}=e;r(new CustomEvent("close"))},zo=(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=Po(o);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}}))},Wo=Object.freeze(Object.defineProperty({__proto__:null,handleClickMenuItem:zo,handleClosePopover:Bo},Symbol.toStringTag,{value:"Module"})),Mo=()=>Object.freeze({}),Fo=e=>`${e}`.replace(/"/g,"""),Ko=(e={})=>e.type==="section"||e.type==="label"?"section":e.type==="separator"?"separator":"item",Uo=e=>e.map((t,r)=>{let i=Ko(t),s=i==="separator",n=i==="section",o=i==="item",p=!!t.disabled,l=o&&!p,a=Object.prototype.hasOwnProperty.call(t,"icon"),c=typeof t.icon=="string"&&t.icon.length>0?t.icon:"",d=typeof t.shortcut=="string"&&t.shortcut.length>0?t.shortcut:typeof t.suffixText=="string"&&t.suffixText.length>0?t.suffixText:"",h=p?"mu-fg":"fg",f=p?"mu":"",u=p?"":"ac",y=h,m="mu-fg",b=typeof t.href=="string"&&t.href.length>0,g=t.rel||(t.newTab?"noopener noreferrer":""),_=[t.newTab?'target="_blank"':"",g?`rel="${Fo(g)}"`:""].filter(Boolean).join(" ");return{...t,index:r,type:i,isSeparator:s,isSection:n,isItem:o,isDisabled:p,isInteractive:l,hasIconSlot:a,icon:c,hasIcon:c.length>0,suffixText:d,hasSuffixText:d.length>0,hasHref:b,linkExtraAttrs:_,c:h,bgc:f,hoverBgc:u,iconColor:y,suffixTextColor:m}}),Ho=({props:e})=>{let t=Array.isArray(e.items)?e.items:[];return{items:Uo(t),open:!!e.open,x:e.x||0,y:e.y||0,w:e.w||"300",h:e.h||"300",place:e.place||"bs"}},qo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Mo,selectViewData:Ho},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},R={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},mr={NOT:0},$=class extends Error{constructor(e){super(`Parse Error: ${e}`),this.name="JemplParseError"}},de=class extends Error{constructor(e){super(`Render Error: ${e}`),this.name="JemplRenderError"}},Li=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 de(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new de(`Cannot iterate over undefined value at '$for ${e}'`);let i=typeof t;return r?new de(`Cannot iterate over non-array value in loop '${e}' - got ${i} instead`):new de(`Cannot iterate over non-array value (got: ${i}) at '$for ${e}'`)},Jo=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new de(`Unknown function '${e}' (${r})`)},Zo=(e,t,r={})=>{let i={},s={};r&&typeof r=="object"&&(r.functions!==void 0||r.partials!==void 0?(i=r.functions||{},s=r.partials||{}):typeof r=="object"&&(i=r));let n=N(e,{functions:i,partials:s},t,{});return n===void 0?{}:n},N=(e,t,r,i)=>{if(t.functions,e.var&&!e.type)return K(e.var,r,i);if(e.type===w.LITERAL)return e.value;if(e.type===w.VARIABLE)return K(e.path,r,i);if(e.type===w.INTERPOLATION)return Qo(e.parts,t,r,i);switch(e.type){case w.FUNCTION:return fs(e,t,r,i);case w.BINARY:return ys(e,t,r,i);case w.UNARY:return ms(e,t,r,i);case w.CONDITIONAL:return ta(e,t,r,i);case w.LOOP:return oa(e,t,r,i);case w.OBJECT:return la(e,t,r,i);case w.ARRAY:return pa(e,t,r,i);case w.PARTIAL:return da(e,t,r,i);case w.PATH_REFERENCE:return ca(e,t,r,i);default:throw new Error(`Unknown node type: ${e.type}`)}},Vi=new Map,Xo=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=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=Xo(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},Qo=(e,t,r,i)=>{let s=[];for(let n of e)if(typeof n=="string")s.push(n);else{let o=N(n,t,r,i);s.push(o!=null?String(o):"")}return s.join("")},fs=(e,t,r,i)=>{let s=t.functions||t,n=s[e.name];if(!n)throw Jo(e.name,s);let o=e.args.map(p=>N(p,t,r,i));return n(...o)},Re=(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 ys(e,t,r,i);case w.UNARY:return ms(e,t,r,i);case w.FUNCTION:return fs(e,t,r,i);default:return N(e,t,r,i)}},ys=(e,t,r,i)=>{if(e.op===R.AND||e.op===R.OR){let o=Re(e.left,t,r,i),p=Re(e.right,t,r,i);switch(e.op){case R.AND:return o&&p;case R.OR:return o||p}}let s=N(e.left,t,r,i),n=N(e.right,t,r,i);switch(e.op){case R.EQ:return s==n;case R.NEQ:return s!=n;case R.GT:return s>n;case R.LT:return s<n;case R.GTE:return s>=n;case R.LTE:return s<=n;case R.IN:return Array.isArray(n)?n.includes(s):!1;case R.ADD:if(typeof s!="number"||typeof n!="number")throw new de(`Arithmetic operations require numbers. Got ${typeof s} + ${typeof n}`);return s+n;case R.SUBTRACT:if(typeof s!="number"||typeof n!="number")throw new de(`Arithmetic operations require numbers. Got ${typeof s} - ${typeof n}`);return s-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},ms=(e,t,r,i)=>{let s=e.op===mr.NOT?Re(e.operand,t,r,i):N(e.operand,t,r,i);switch(e.op){case mr.NOT:return!s;default:throw new Error(`Unknown unary operator: ${e.op}`)}},ea=(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?N(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=N(d,t,r,i);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=N(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?N(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=N(d,t,r,i);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=N(a,t,r,i)}return o}}}return null},ta=(e,t,r,i)=>{let s=ea(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||Re(o,t,r,i))return N(e.bodies[n],t,r,i)}return gs},ra=(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 y=u.substring(i.length+1);c[h]=a[y]}else return null}else if(f.type===w.INTERPOLATION){let u=[],y=!0;for(let m of f.parts)if(typeof m=="string")u.push(m);else if(m.type===w.VARIABLE){let b=m.path;if(b===i)u.push(a!=null?String(a):"");else if(b.startsWith(i+".")){let g=b.substring(i.length+1),_=a[g];u.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[h]=u.join("")}else return null}p.push(c)}}return p}}}return null},ia=(e,t)=>{let r=e.body,i=e.itemVar,s=ra(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},sa=(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("."),y=u[0];y in i.__paths__&&(f=i.__paths__[y],u.length>1&&(f+="."+u.slice(1).join(".")))}h.__paths__={...h.__paths__,[p]:`${f}[${a}]`,...l&&{[l]:a}};for(let u of o.properties){let y=u.parsedKey?N(u.parsedKey,t,r,h):u.key,m=u.value;if(m.type===w.LITERAL)d[y]=m.value;else if(m.type===w.VARIABLE){let b=m.path;if(b===p)d[y]=c;else if(b===l)d[y]=a;else if(b.startsWith(p+".")){let g=b.substring(p.length+1);!g.includes(".")&&!g.includes("[")?d[y]=c[g]:d[y]=K(b,r,{...i,[p]:c,...l&&{[l]:a}})}else d[y]=K(b,r,{...i,[p]:c,...l&&{[l]:a}})}else if(m.type===w.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=g.path,S;if(_===p)S=c;else if(_===l)S=a;else if(_.startsWith(p+".")){let A=_.substring(p.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=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=N(g,t,r,_);b.push(S!=null?String(S):"")}d[y]=b.join("")}else{let b={...i,[p]:c,...l&&{[l]:a}};d[y]=N(m,t,r,b)}}n.push(d)}return n}return null},na=(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},oa=(e,t,r,i)=>{let s=N(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=na(e,s,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=ia(e,s);if(a!==null)return a}let n=sa(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=N(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},aa=(e,t,r,i)=>{if(e.whenCondition)return null;if(e.properties.length===1){let s=e.properties[0],n=s.parsedKey?N(s.parsedKey,t,r,i):s.key,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?N(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 y=K(u.path,r,i);f.push(y!=null?String(y):"")}else{a=!1;break}if(!a)break;l[d]=f.join("")}else if(h.type===w.OBJECT&&h.properties.length<=5){let f={};for(let u of h.properties){let y=u.key,m=u.value;if(m.type===w.LITERAL)f[y]=m.value;else if(m.type===w.VARIABLE)f[y]=K(m.path,r,i);else if(m.type===w.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=K(g.path,r,i);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[y]=b.join("")}else{a=!1;break}}if(!a)break;l[d]=f}else{a=!1;break}}if(a)return p[n]=l,p}}return null},la=(e,t,r,i)=>{let s=t.functions||t;if(e.whenCondition&&!Re(e.whenCondition,s,r,i))return;let n=aa(e,t,r,i);if(n!==null)return n;if(e.fast){let l={};for(let a of e.properties){let c=a.parsedKey?N(a.parsedKey,t,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=N(f,t,r,i);h.push(u!=null?String(u):"")}l[c]=h.join("")}else l[c]=N(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=N(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 N(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=N(c.value,t,r,i);d!==void 0&&(o[l.key]=d)}else{let d=N(l.value,t,r,i);d!==void 0&&(o[l.key]=d)}}else{let c=l.parsedKey?N(l.parsedKey,t,r,i):l.key,d=N(l.value,t,r,i);d!==void 0&&(o[c]=d)}}return o},gs={},pa=(e,t,r,i)=>{let s=[];for(let n of e.items)if(n.type===w.LOOP){let o=N(n,t,r,i);Array.isArray(o)&&n.flatten!==!1?s.push(...o):s.push(o)}else{let o=N(n,t,r,i);o!==gs&&o!==void 0&&s.push(o)}return s},da=(e,t,r,i)=>{let{name:s,data:n,whenCondition:o}=e,p=t.partials||{},l=t.functions||t;if(o&&!Re(o,l,r,i))return;if(!p[s])throw new de(`Partial '${s}' is not defined`);let a=i._partialStack||[];if(a.includes(s))throw new de(`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=N(n,t,r,i);d={...d,...f}}return N(c,t,d,h)},ca=(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 de(`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 de(`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 de(`Path reference '#{${s}}' - cannot access properties on index variable '${o}'`);return String(l)}return p.length>0&&(l+="."+p.join(".")),l},ua=/\$\{([^}]*)\}/g,ha=/#\{([^}]*)\}/g,bs=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,i,s]=r,n=fa(s,t);return{isFunction:!0,type:w.FUNCTION,name:i,args:n}},fa=(e,t={})=>e.trim()?ya(e).map(r=>ma(r.trim(),t)):[],ya=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},ma=(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=bs(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 X(i,t)}catch{return{type:w.VARIABLE,path:i}}return{type:w.VARIABLE,path:i}},vs=/^\w+\(.*\)$/,ga=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,ba=e=>{if(!(!e||e.trim()===""||vs.test(e))&&ga.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}"`)},Ni=e=>{let t=e.trim();if(vs.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}},mt=(e,t={})=>{let r=e.trim();ba(r);let i=bs(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}},ws=(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(ua)],n=[...r.matchAll(ha)],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"?mt(a[1],t):Ni(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 y=0;y<i.length;y++)u=u.replace(`__ESCAPED_${y}__`,i[y]);u&&p.push(u)}try{let u;c==="variable"?u=mt(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:w.INTERPOLATION,parts:p}},ke=(e,t)=>typeof e=="string"?ws(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?wa(e,t):_a(e,t):{type:w.LITERAL,value:e},va=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}},wa=(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=va(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 $?l:new $(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=ke(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}},_a=(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 y=null;if(u&&(y=ke(f,t),y.type===w.OBJECT)){let b=!1;for(let g of y.properties)if(g.value.type===w.VARIABLE||g.value.type===w.INTERPOLATION||g.value.type===w.FUNCTION||g.value.type===w.CONDITIONAL||g.value.type===w.OBJECT&&!g.value.fast||g.value.type===w.ARRAY&&!g.value.fast){b=!0;break}b&&(y.fast=!1)}let m={type:w.PARTIAL,name:c,data:y};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new $("Empty condition expression after '$when'");b=X(d,t)}else b={type:w.LITERAL,value:d};m.whenCondition=b}return m}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=xa(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=ke(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=ws(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},xa=(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());Li(a);let c=X(a,r);for(i.push(c),s.push(ke(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{Li(u);let y=X(u,r);i.push(y)}if(s.push(ke(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=Le(e,"||");if(r!==-1)return{type:w.BINARY,op:R.OR,left:X(e.substring(0,r).trim(),t),right:X(e.substring(r+2).trim(),t)};let i=Le(e,"&&");if(i!==-1)return{type:w.BINARY,op:R.AND,left:X(e.substring(0,i).trim(),t),right:X(e.substring(i+2).trim(),t)};let s=[{op:">=",type:R.GTE},{op:"<=",type:R.LTE},{op:"==",type:R.EQ},{op:"!=",type:R.NEQ},{op:">",type:R.GT},{op:"<",type:R.LT},{op:" in ",type:R.IN}];for(let{op:a,type:c}of s){let d=Le(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:R.ADD},{op:" - ",type:R.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: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(Le(e,a)!==-1)throw new $(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:w.UNARY,op:mr.NOT,operand:X(e.substring(1).trim(),t)}:_s(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},Sa=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}},_s=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return mt(r,t);let i=Sa(r);if(i.type===w.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:w.VARIABLE,path:r};try{return mt(r,t)}catch(s){if(s.message&&s.message.includes("not supported"))return i;throw s}},Aa=(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}},ji=(e,t,r,i=!1)=>{let s=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(s);if(!n){let m=i?"$each":"$for";throw new $(`Invalid loop syntax (got: '${e.replace("$for",m)}')`)}let o=n[1],p=n[2].trim();Aa(p,i);let l=p.match(/^(.+?)\s+in\s+(.+)$/);if(!l){let m=i?"$each":"$for";throw new $(`Invalid loop syntax - missing 'in' keyword (got: '${m} ${p}')`)}let a=l[1].trim(),c=l[2].trim(),d,h=null;if(a.includes(",")){let m=a.split(",").map(b=>b.trim());if(m.length!==2)throw new $(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=m[0],h=m[1]}else d=a;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new $(`Reserved variable name: ${d}`);if(h&&f.includes(h))throw new $(`Reserved variable name: ${h}`);let u=_s(c,r),y=ke(t,r);return{type:w.LOOP,itemVar:d,indexVar:h,iterable:u,body:y,flatten:o!=="nested"}},Di=(e,t={})=>{let{functions:r={}}=t;return ke(e,r)},ka=()=>Date.now(),Ea=Object.freeze(Object.defineProperty({__proto__:null,now:ka},Symbol.toStringTag,{value:"Module"})),$a=(e,t,r={})=>{let{functions:i={},partials:s={}}=r,n={...Ea,...i},o=Di(e,{functions:n}),p={};for(let[l,a]of Object.entries(s))p[l]=Di(a,{functions:n});return Zo(o,t,{functions:n,partials:p})},Dr=e=>e!==null&&typeof e=="object",gt=e=>Dr(e)&&!Array.isArray(e),Ca=e=>typeof e=="string"&&e.includes("."),xs=e=>typeof e=="string"&&/[\[\]]/.test(e);function Ss(e,t){let r={};for(let i of t){if(typeof i!="string"||i.length===0)continue;let s=ne(e,i);s!==void 0&&he(r,i,s)}return r}function Ia(e){if(!gt(e)||!Array.isArray(e.fields))return e;let t=(r=[])=>r.map(i=>{if(!gt(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 ne=(e,t,r=void 0)=>{if(!t||!Dr(e)||xs(t))return r;let i=t.split(".").filter(n=>n!==""),s=e;for(let n of i){if(s==null||!(n in s))return Object.prototype.hasOwnProperty.call(e,t)?e[t]:r;s=s[n]}return s},he=(e,t,r)=>{if(!Dr(e)||typeof t!="string"||t.length===0||xs(t))return e;let i=t.split(".").filter(n=>n!=="");if(i.length===0)return e;Ca(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},Oa=["id","class","style","slot","form","defaultValues","disabled","context"],Ta=(e={})=>Object.entries(e).filter(([t,r])=>!(Oa.includes(t)||r==null||typeof r=="object"||typeof r=="function")).map(([t,r])=>`${t}=${String(r)}`).join(" "),La={email:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,url:/^https?:\/\/.+/},ue={required:"This field is required",minLength:e=>`Must be at least ${e} characters`,maxLength:e=>`Must be at most ${e} characters`,pattern:"Invalid format",invalidDate:"Invalid date format",invalidTime:"Invalid time format",invalidDateTime:"Invalid date and time format",minTemporal:e=>`Must be on or after ${e}`,maxTemporal:e=>`Must be on or before ${e}`},Va="input-date",Na="input-time",ja="input-datetime",Da=/^(\d{4})-(\d{2})-(\d{2})$/,Ra=/^(\d{2}):(\d{2})(?::(\d{2}))?$/,Pa=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}(?::\d{2})?)$/,Ba=e=>{if(typeof e!="string")return null;let t=Da.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},za=e=>{if(typeof e!="string")return null;let t=Ra.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}},As=e=>{let t=za(e);return t?`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}`:null},ks=e=>Ba(e)?e:null,Wa=e=>{if(typeof e!="string")return null;let t=Pa.exec(e);if(!t)return null;let r=ks(t[1]),i=As(t[2]);return!r||!i?null:`${r}T${i}`},Ma=e=>e===Va?{normalize:ks,invalidMessage:ue.invalidDate}:e===Na?{normalize:As,invalidMessage:ue.invalidTime}:e===ja?{normalize:Wa,invalidMessage:ue.invalidDateTime}:null,Fa=(e,t)=>{let r=Ma(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 ue.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 ue.maxTemporal(String(e.max))}return null},Et=(e,t)=>{if(e.required){let i=t==null||t===""||Array.isArray(t)&&t.length===0||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:ue.required}let r=Fa(e,t);if(r)return r;if(Array.isArray(e.rules))for(let i of e.rules){let s=Ka(i,t);if(s)return s}return null},Ka=(e,t)=>{if(t==null||t==="")return null;let r=String(t);switch(e.rule){case"minLength":return r.length<e.value?e.message||ue.minLength(e.value):null;case"maxLength":return r.length>e.value?e.message||ue.maxLength(e.value):null;case"pattern":{let i=La[e.value];if(!i)try{i=new RegExp(e.value)}catch{return e.message||ue.pattern}return i.test(r)?null:e.message||ue.pattern}default:return null}},$t=(e,t)=>{let r={},i=se(e);for(let s of i){let n=ne(t,s.name),o=Et(s,n);o&&(r[s.name]=o)}return{valid:Object.keys(r).length===0,errors:r}},Ua=["section","read-only-text","slot"],Rr=e=>!Ua.includes(e.type),se=e=>{let t=[];for(let r of e)r.type==="section"&&Array.isArray(r.fields)?t.push(...se(r.fields)):Rr(r)&&t.push(r);return t},Pr=e=>{switch(e.type){case"input-text":case"input-date":case"input-time":case"input-datetime":case"input-textarea":case"popover-input":return"";case"input-number":return null;case"select":case"segmented-control":return null;case"tag-select":return[];case"checkbox":return!1;case"color-picker":return"#000000";case"slider":case"slider-with-input":return e.min!==void 0?e.min:0;case"image":return null;default:return null}},Br=(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=Br(s.fields,i);r.push(...n),i+=n.length}}else r.push({...s,_isSection:!1,_idx:i}),i++;return r},Ha=()=>Object.freeze({formValues:{},errors:{},reactiveMode:!1,tooltipState:{open:!1,x:0,y:0,content:""}}),ee=({state:e,props:t})=>{let{form:r={}}=t||{},i=Ia(r),s=gt(t?.context)?t.context:{},n=gt(e?.formValues)?e.formValues:{},o={...s,...n,formValues:n};return Object.keys(o).length>0?$a(i,o):i},qa=({state:e,props:t})=>{let r=Ta(t),i=ee({state:e,props:t}),s=i.fields||[],n=!!t?.disabled,o=Br(s);o.forEach(d=>{if(d._isSection)return;let h=Rr(d);if(d._disabled=n||!!d.disabled,h&&d.name&&(d._error=e.errors[d.name]||null),d.type==="input-text"&&(d._inputType=d.inputType||"text"),d.type==="select"||d.type==="tag-select"||d.type==="segmented-control"){let f=ne(e.formValues,d.name);d._selectedValue=f!==void 0?f:null,d._selectedValues=Array.isArray(f)?f:[],d.placeholder=d.placeholder||"",d.noClear=d.clearable===!1}if(d.type==="image"){let f=ne(e.formValues,d.name);d._imageSrc=f&&String(f).trim()?f:null,d.placeholderText=d.placeholderText||"No Image"}if(d.type==="read-only-text"&&(d.content=d.content||""),d.type==="checkbox"){let f=typeof d.content=="string"?d.content:typeof d.checkboxLabel=="string"?d.checkboxLabel:"";d._checkboxText=f}});let p=i.actions||{buttons:[]},l=p.layout||"split",a=(p.buttons||[]).map((d,h)=>({...d,_globalIdx:h,variant:d.variant||"se",_disabled:n||!!d.disabled,pre:d.pre||"",suf:d.suf||""})),c;return l==="split"?c={_layout:"split",buttons:a,_leftButtons:a.filter(d=>d.align==="left"),_rightButtons:a.filter(d=>d.align!=="left")}:c={_layout:l,buttons:a,_allButtons:a},{containerAttrString:r,title:i?.title||"",description:i?.description||"",flatFields:o,actions:c,formValues:e.formValues,tooltipState:e.tooltipState}},Ie=({state:e,props:t})=>{let r=ee({state:e,props:t}),i=se(r.fields||[]);return Ss(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&&(he(e.formValues,i,s),it({state:e,props:t}))},it=({state:e,props:t})=>{if(!t)return;let r=ee({state:e,props:t}),i=se(r.fields||[]);e.formValues=Ss(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=>{he(e.formValues,i,r[i])})},Ja=({state:e},t={})=>{let{defaultValues:r={}}=t;e.formValues=r?structuredClone(r):{},e.errors={},e.reactiveMode=!1},Za=({state:e},t={})=>{e.errors=t.errors||{}},Xa=({state:e},t={})=>{let{name:r}=t;r&&e.errors[r]&&delete e.errors[r]},Qa=({state:e})=>{e.reactiveMode=!0},el=({state:e},t={})=>{let{x:r,y:i,content:s}=t;e.tooltipState={open:!0,x:r,y:i,content:s}},tl=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},rl=Object.freeze(Object.defineProperty({__proto__:null,clearFieldError:Xa,collectAllDataFields:se,createInitialState:Ha,flattenFields:Br,get:ne,getDefaultValue:Pr,hideTooltip:tl,isDataField:Rr,pruneHiddenValues:it,resetFormValues:Ja,selectForm:ee,selectFormValues:Ie,selectViewData:qa,set:he,setErrors:Za,setFormFieldValue:Ya,setFormValues:Ga,setReactiveMode:Qa,showTooltip:el,validateField:Et,validateForm:$t},Symbol.toStringTag,{value:"Module"})),Es=({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)))},$s=({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=ne(t,l.name);if(d==null?a.removeAttribute("value"):a.setAttribute("value",String(d)),l.type==="slider-with-input"&&a.store?.setValue){let h=Number(d??0);a.store.setValue({value:Number.isFinite(h)?h:0}),typeof a.render=="function"&&a.render()}l.type==="popover-input"&&a.store?.setValue&&(a.store.setValue({value:d==null?"":String(d)}),typeof a.render=="function"&&a.render())}if(l.type==="tag-select"&&a.store?.updateSelectedValues){let d=ne(t,l.name);a.store.updateSelectedValues({values:Array.isArray(d)?d:[]}),typeof a.render=="function"&&a.render()}l.type==="checkbox"&&(ne(t,l.name)?a.setAttribute("checked",""):a.removeAttribute("checked")),["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input"].includes(l.type)&&l.placeholder&&a.getAttribute("placeholder")!==l.placeholder&&(l.placeholder===void 0||l.placeholder===null?a.removeAttribute("placeholder"):a.setAttribute("placeholder",l.placeholder)),c?a.setAttribute("disabled",""):a.removeAttribute("disabled")}};o(s)},Cs=(e,t)=>{let r=t?.defaultValues||{},i={};Object.keys(r).forEach(p=>{he(i,p,r[p])});let s=ee({state:{formValues:i},props:t}),n=se(s.fields||[]),o={};for(let p of n){let l=ne(r,p.name);l!==void 0?he(o,p.name,l):he(o,p.name,Pr(p))}e.resetFormValues({defaultValues:o})},il=e=>{let{store:t,props:r}=e;Cs(t,r)},sl=e=>{let{props:t,refs:r,render:i}=e,s=e.store.getState(),n=ee({state:s,props:t});$s({form:n,formValues:s.formValues,refs:r,formDisabled:!!t?.disabled}),i()},nl=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n,refs:o}=e,p=!!i?.disabled;r?.key!==i?.key&&Cs(s,i);let l=s.getState();it({state:l,props:i});let a=ee({state:l,props:i});$s({form:a,formValues:l.formValues,refs:o,formDisabled:p}),n()},ol=(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();it({state:a,props:n});let c=ee({state:a,props:n}),d=se(c.fields||[]).find(h=>h.name===p);if(Es({field:d,target:o.currentTarget,value:l}),a.reactiveMode&&d){let h=Et(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:Ie({state:r.getState(),props:n})}}))},al=(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();it({state:a,props:n});let c=ee({state:a,props:n}),d=se(c.fields||[]).find(h=>h.name===p);if(Es({field:d,target:o.currentTarget,value:l}),a.reactiveMode&&d){let h=Et(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:Ie({state:r.getState(),props:n})}}))},ll=(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=Ie({state:p,props:n});if(a&&a.validate){let d=se(l.fields||[]),{valid:h,errors:f}=$t(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}}))},pl=(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:Ie({state:i.getState(),props:n})}}))},dl=(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=Ie({state:l,props:n});if(d.validate){let f=se(a.fields||[]),{valid:u,errors:y}=$t(f,l.formValues);r.setErrors({errors:y}),u||r.setReactiveMode(),s(),i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h,valid:u,errors:y}}))}else i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h}}))}},cl=(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()}},ul=e=>{let{store:t,render:r}=e;t.hideTooltip({}),r()},hl=Object.freeze(Object.defineProperty({__proto__:null,handleActionClick:ll,handleAfterMount:sl,handleBeforeMount:il,handleImageClick:pl,handleKeyDown:dl,handleOnUpdate:nl,handleTooltipMouseEnter:cl,handleTooltipMouseLeave:ul,handleValueChange:al,handleValueInput:ol},Symbol.toStringTag,{value:"Module"})),fl=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"],yl=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input","slider-with-input"],ml=({ref:e,fieldType:t,value:r,forceRefresh:i=!1})=>{if(fl.includes(t)){if(i&&e.removeAttribute("value"),r==null){if(yl.includes(t)&&i){if(t==="popover-input"){e.removeAttribute("value");return}e.setAttribute("value","");return}e.removeAttribute("value");return}e.setAttribute("value",String(r))}},Is=({ref:e,value:t})=>{if(e){if(e?.store?.updateSelectedValues)e.store.updateSelectedValues({values:Array.isArray(t)?t:[]});else if(e?.store?.updateSelectedValue)e.store.updateSelectedValue({value:t});else return;typeof e.render=="function"&&e.render()}},gl=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},Ri=e=>e?.renderTarget?e.renderTarget:e?.shadowRoot?e.shadowRoot:e?.shadow,bl=({root:e,values:t={}})=>{!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("rtgl-select[data-field-name], rtgl-tag-select[data-field-name], rtgl-segmented-control[data-field-name]").forEach(r=>{let i=r.dataset?.fieldName;if(!i)return;let s=ne(t,i);Is({ref:r,value:s})})},vl=function(){let e=this.store.getState();return Ie({state:e,props:this.props})},wl=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=gl(Ri(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=ne(t,p.name);if(!a&&c===void 0)continue;let d=ne(r.formValues,p.name);ml({ref:l,fieldType:p.type,value:d,forceRefresh:!0}),["select","tag-select","segmented-control"].includes(p.type)&&Is({ref:l,value:d}),p.type==="checkbox"&&(d?l.setAttribute("checked",""):l.removeAttribute("checked"))}this.render();let o=()=>{let p=this.store.getState();bl({root:Ri(this),values:p.formValues})};o(),setTimeout(()=>{o()},0)},_l=function(){let e=this.store.getState(),t=ee({state:e,props:this.props}),r=se(t.fields||[]),{valid:i,errors:s}=$t(r,e.formValues);return this.store.setErrors({errors:s}),i||this.store.setReactiveMode(),this.render(),{valid:i,errors:s}},xl=function(){let e=this.props?.defaultValues||{},t={};Object.keys(e).forEach(n=>{he(t,n,e[n])});let r=ee({state:{formValues:t},props:this.props}),i=se(r.fields||[]),s={};for(let n of i){let o=ne(e,n.name);o!==void 0?he(s,n.name,o):he(s,n.name,Pr(n))}this.store.resetFormValues({defaultValues:s}),this.setValues(s)},Sl=Object.freeze(Object.defineProperty({__proto__:null,getValues:vl,reset:xl,setValues:wl,validate:_l},Symbol.toStringTag,{value:"Module"})),Pi=3e3,Al=180,bt=new WeakMap,Os=e=>{e&&(typeof e.componentDialogBodyHost?.replaceChildren=="function"&&e.componentDialogBodyHost.replaceChildren(),delete e.componentDialogBody)},kl=e=>{let t=e.selectUiType();return t==="dropdown"||t==="formDialog"||t==="componentDialog"?null:e.selectConfig().mode==="confirm"?!1:null},fe=({store:e,render:t,globalUI:r,refs:i,emitResult:s=!1,result:n})=>{if(!e.selectIsOpen())return;let o=n!==void 0?n:kl(e);Os(i),e.closeAll(),t(),s&&r.emit("event",o)},Ts=({store:e,render:t,globalUI:r,refs:i,error:s})=>{Os(i),e.selectIsOpen()&&(e.closeAll(),t()),r.emit("error",s)},st=({store:e,render:t,globalUI:r,refs:i})=>{e.selectIsOpen()&&fe({store:e,render:t,globalUI:r,refs:i,emitResult:!0})},nt=(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)}))}),El=e=>{let t=bt.get(e);return t||(t=new Map,bt.set(e,t)),t},$l=(e,t)=>{let r=bt.get(e),i=r?.get(t);i&&(clearTimeout(i.exitTimerId),clearTimeout(i.removeTimerId),r.delete(t))},Cl=e=>{let t=bt.get(e);if(t){for(let r of t.values())clearTimeout(r.exitTimerId),clearTimeout(r.removeTimerId);t.clear()}},Il=({store:e,render:t,globalUI:r},i)=>{$l(r,i);let s=El(r),n=setTimeout(()=>{e.setToastPhase?.({id:i,phase:"exiting"}),t()},Math.max(0,Pi-Al)),o=setTimeout(()=>{s.delete(i),e.removeToast({id:i}),t()},Pi);s.set(i,{exitTimerId:n,removeTimerId:o})},Ol=(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)},Tl=(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){Ts({store:r,render:s,globalUI:n,refs:i,error:l})}},0)},lr=(e,t)=>!e.selectIsOpen()||e.selectUiType()!=="componentDialog"?!1:e.selectComponentDialogConfig?.()?.key===t,Ll=e=>{let{store:t,render:r,globalUI:i,refs:s}=e;fe({store:t,render:r,globalUI:i,refs:s,emitResult:!0})},Vl=e=>{let{store:t,render:r,globalUI:i,refs:s}=e,n=t.selectConfig().mode==="confirm"?!0:null;fe({store:t,render:r,globalUI:i,refs:s,emitResult:!0,result:n})},Nl=e=>{let{store:t,render:r,globalUI:i,refs:s}=e;fe({store:t,render:r,globalUI:i,refs:s,emitResult:!0,result:!1})},jl=e=>{let{store:t,render:r,globalUI:i,refs:s}=e;fe({store:t,render:r,globalUI:i,refs:s,emitResult:!0,result:null})},Dl=(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t._event,{index:p,item:l}=o.detail;fe({store:r,render:i,globalUI:s,refs:n,emitResult:!0,result:{index:p,item:l}})},Rl=(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t;return st({store:r,render:i,globalUI:s,refs:n}),r.setAlertConfig(o),i(),nt(s)},Pl=async(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t;return st({store:r,render:i,globalUI:s,refs:n}),r.setConfirmConfig(o),i(),nt(s)},Bl=(e,t)=>{let{store:r,render:i,globalUI:s}=e;r.addToast(t),i();let n=r.selectToasts?.()??[],o=n[n.length-1]?.id;o&&Il({store:r,render:i,globalUI:s},o)},zl=async(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t;return st({store:r,render:i,globalUI:s,refs:n}),r.setDropdownConfig(o),i(),nt(s)},Wl=async(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t;st({store:r,render:i,globalUI:s,refs:n}),r.setFormDialogConfig(o),i();let p=r.selectFormDialogConfig?.().key;return Ol(e,p),nt(s)},Ml=async(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t;st({store:r,render:i,globalUI:s,refs:n}),r.setComponentDialogConfig(o),i();let p=r.selectComponentDialogConfig?.().key;return Tl(e,p),nt(s,{rejectOnError:!0})},Fl=(e,t)=>{let{store:r,render:i,globalUI:s,refs:n}=e,o=t._event?.detail??{};o.valid!==!1&&fe({store:r,render:i,globalUI:s,refs:n,emitResult:!0,result:o})},Kl=(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})},Ul=e=>{let{store:t,render:r,globalUI:i,refs:s}=e;Cl(i);let n=(t.selectToasts?.().length??0)>0;if(n&&t.clearToasts(),t.selectIsOpen()){fe({store:t,render:r,globalUI:i,refs:s,emitResult:!0});return}n&&r()},Hl=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"){fe({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(!lr(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(!lr(r,a))return;fe({store:r,render:i,globalUI:s,refs:n,emitResult:!0,result:{actionId:c.id,values:h}})}catch(d){if(!lr(r,a))return;Ts({store:r,render:i,globalUI:s,refs:n,error:d})}}},ql=Object.freeze(Object.defineProperty({__proto__:null,handleCancel:Nl,handleCloseAll:Ul,handleComponentDialogAction:Hl,handleConfirm:Vl,handleDialogClose:Ll,handleDropdownClose:jl,handleDropdownItemClick:Dl,handleFormAction:Fl,handleFormFieldEvent:Kl,handleShowAlert:Rl,handleShowComponentDialog:Ml,handleShowConfirm:Pl,handleShowDropdownMenu:zl,handleShowFormDialog:Wl,handleShowToast:Bl},Symbol.toStringTag,{value:"Module"})),Yl=new Set(["sm","md","lg","f"]),Gl=new Set(["sm","md","lg"]),Jl=new Set(["active","exiting"]),Zl=new Set(["top","bottom"]),Xl=new Set(["confirm","cancel"]),Ql=Object.freeze([{id:"cancel",label:"Cancel",variant:"se",align:"left",role:"cancel"},{id:"confirm",label:"OK",variant:"pr",role:"confirm",validate:!0}]),gr=e=>!e||typeof e!="object"||Array.isArray(e)?{}:e,De=(e,t="md")=>Yl.has(e)?e:t,Ls=(e,t="sm")=>Gl.has(e)?e:t,Vs=(e,t="active")=>Jl.has(e)?e:t,Ns=(e,t="top")=>Zl.has(e)?e:t,zr=e=>{let t=(Array.isArray(e?.buttons)&&e.buttons.length>0?e.buttons:Ql).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(!Xl.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")}},js=()=>({title:"",description:"",size:"md",component:"",props:{},actions:zr(),key:0}),ep=()=>Object.freeze({isOpen:!1,uiType:"dialog",nextToastId:0,toasts:[],config:{status:void 0,title:"",message:"",confirmText:"OK",cancelText:"Cancel",mode:"alert"},dropdownConfig:{items:[],x:0,y:0,place:"bs"},formDialogConfig:{form:null,defaultValues:{},context:{},disabled:!1,size:"md",key:0,onFieldEvent:null,mount:null},componentDialogConfig:js()}),tp=({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},rp=({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},ip=({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},sp=({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:gr(t.defaultValues),context:gr(t.context),disabled:!!t.disabled,size:De(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},np=({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:De(t.size,"md"),component:t.component,props:gr(t.props),actions:zr(t.actions),key:r+1},e.uiType="componentDialog",e.isOpen=!0},op=({state:e},t={})=>{if(typeof t.message!="string"||t.message.length===0)throw new Error("message is required for showToast");let r=(e.nextToastId??0)+1,i={id:`toast-${r}`,message:t.message,size:Ls(t.size??t.s,"sm"),position:Ns(t.position,"top"),phase:"active"};e.nextToastId=r,e.toasts=[...e.toasts??[],i]},ap=({state:e},t={})=>{typeof t.id!="string"||t.id.length===0||(e.toasts=(e.toasts??[]).filter(r=>r.id!==t.id))},lp=({state:e},t={})=>{typeof t.id!="string"||t.id.length===0||(e.toasts=(e.toasts??[]).map(r=>r.id!==t.id?r:{...r,phase:Vs(t.phase,"active")}))},pp=({state:e})=>{e.toasts=[]},dp=({state:e})=>{e.isOpen=!1,e.uiType="dialog"},cp=({state:e})=>e.config,up=({state:e})=>e.dropdownConfig,hp=({state:e})=>e.formDialogConfig,fp=({state:e})=>e.componentDialogConfig,yp=({state:e})=>e.uiType,mp=({state:e})=>e.isOpen,gp=({state:e})=>e.toasts??[],bp=({state:e})=>{let t=e.isOpen&&e.uiType==="dialog",r=e.isOpen&&e.uiType==="formDialog",i=e.isOpen&&e.uiType==="componentDialog",s=e.componentDialogConfig??js(),n=Array.isArray(e.toasts)?e.toasts.map(o=>({...o,size:Ls(o.size,"sm"),position:Ns(o.position,"top"),phase:Vs(o.phase,"active")})):[];return{isOpen:e.isOpen,uiType:e.uiType,config:e.config,dropdownConfig:{items:e.dropdownConfig?.items??[],x:e.dropdownConfig?.x??0,y:e.dropdownConfig?.y??0,place:e.dropdownConfig?.place??"bs"},formDialogConfig:{form:e.formDialogConfig?.form??{fields:[],actions:{buttons:[]}},defaultValues:e.formDialogConfig?.defaultValues??{},context:e.formDialogConfig?.context??{},disabled:!!e.formDialogConfig?.disabled,size:De(e.formDialogConfig?.size,"md"),key:e.formDialogConfig?.key??0},componentDialogConfig:{title:s.title??"",description:s.description??"",size:De(s.size,"md"),component:s.component??"",props:s.props??{},actions:s.actions??zr(),key:s.key??0},toasts:n,topToasts:n.filter(o=>o.position==="top"),bottomToasts:n.filter(o=>o.position==="bottom"),isDialogOpen:t,isFormDialogOpen:r,isComponentDialogOpen:i,isDialogContainerOpen:t||r||i,isDropdownOpen:e.isOpen&&e.uiType==="dropdown",dialogSize:i?De(s.size,"md"):r?De(e.formDialogConfig?.size,"md"):"sm"}},vp=Object.freeze(Object.defineProperty({__proto__:null,addToast:op,clearToasts:pp,closeAll:dp,createInitialState:ep,removeToast:ap,selectComponentDialogConfig:fp,selectConfig:cp,selectDropdownConfig:up,selectFormDialogConfig:hp,selectIsOpen:mp,selectToasts:gp,selectUiType:yp,selectViewData:bp,setAlertConfig:tp,setComponentDialogConfig:np,setConfirmConfig:rp,setDropdownConfig:ip,setFormDialogConfig:sp,setToastPhase:lp},Symbol.toStringTag,{value:"Module"})),wp=(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()}}))},_p=Object.freeze(Object.defineProperty({__proto__:null,handleClickStart:wp},Symbol.toStringTag,{value:"Module"})),xp=()=>Object.freeze({}),Sp=["id","class","style","slot","start"],Ap=(e={})=>Object.entries(e).filter(([t])=>!Sp.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),kp=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}}}},Ep=({props:e})=>{let t=kp(e.start)||e.start;return{containerAttrString:Ap(e),start:t||{label:"",image:{src:"",width:32,height:32,alt:""}}}},$p=({props:e})=>e.start?.path,Cp=({state:e})=>{},Ip=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:xp,selectPath:$p,selectViewData:Ep,setState:Cp},Symbol.toStringTag,{value:"Module"})),Bi=e=>{let t=e.querySelectorAll("h1[id], h2[id], h3[id], h4[id], rtgl-text[id]");return Array.from(t)},Op=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}}),zi=(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())},Tp=(e,t,r,i)=>{let{store:s,render:n}=i,o=null,p=()=>{o=null;let d=Bi(e);s.setItems({items:Op(d)}),zi(d,r,i),n()},l=()=>{o===null&&(o=requestAnimationFrame(p))},a=()=>{zi(Bi(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)}},Lp=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=Tp(i,s,n,e)}),()=>{r()}},Vp=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Lp},Symbol.toStringTag,{value:"Module"})),Np=()=>Object.freeze({items:[],currentId:null,contentContainer:null}),jp=({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}},Dp=({state:e})=>e,Rp=({state:e})=>e.currentId,Pp=({state:e},t={})=>{e.items=Array.isArray(t.items)?t.items:[]},Bp=({state:e},t={})=>{e.currentId=t.id},zp=({state:e},t={})=>{e.contentContainer=t.container},Wp=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Np,selectCurrentId:Rp,selectState:Dp,selectViewData:jp,setContentContainer:zp,setCurrentId:Bp,setItems:Pp},Symbol.toStringTag,{value:"Module"})),ot=e=>e==null||e===!0?"":String(e),Ds=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=e,n=ot(t);r.setValue({value:n}),r.closePopover({}),s(new CustomEvent("value-change",{detail:{value:n},bubbles:!0})),i()},Mp=e=>{let{store:t,props:r}=e;if(r.value!==void 0){let i=ot(r.value);t.setValue({value:i}),t.setTempValue({value:i})}},Fp=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n}=e;if(r?.value!==i?.value){let o=ot(i?.value);s.setValue({value:o}),s.getState().isOpen||s.setTempValue({value:o})}n()},Kp=(e,t)=>{let{store:r,render:i,refs:s,props:n}=e;if(n.disabled)return;let o=t._event,p=ot(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)},Up=(e,t)=>{let{store:r,render:i}=e;r.closePopover({}),i()},Hp=(e,t)=>{let{store:r}=e,i=t._event,s=ot(i.detail.value);r.setTempValue({value:s})},qp=e=>{let{store:t,refs:r}=e,{input:i}=r,s=i?i.value:t.getState().tempValue;Ds(e,s)},Yp=(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;Ds(e,o)}else s.key==="Escape"&&(s.preventDefault(),s.stopPropagation(),r.closePopover({}),e.render())},Gp=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Mp,handleInputChange:Hp,handleInputKeydown:Yp,handleOnUpdate:Fp,handlePopoverClose:Up,handleSubmitClick:qp,handleTextClick:Kp},Symbol.toStringTag,{value:"Module"})),Jp=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),Zp=({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}},Xp=({state:e},t={})=>{e.tempValue=t.value},Qp=({state:e},t={})=>{let{position:r}=t;e.position=r,e.isOpen=!0,e.hasUnsavedChanges=!1},ed=({state:e})=>{e.isOpen=!1,e.tempValue=""},td=({state:e},t={})=>{e.value=t.value},rd=({state:e})=>e.value,id=Object.freeze(Object.defineProperty({__proto__:null,closePopover:ed,createInitialState:Jp,openPopover:Qp,selectValue:rd,selectViewData:Zp,setTempValue:Xp,setValue:td},Symbol.toStringTag,{value:"Module"})),le=(e,t)=>{if(e===t)return!0;if(e==null||t==null||typeof e!="object"||typeof t!="object")return!1;let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let s of r)if(!i.includes(s)||!le(e[s],t[s]))return!1;return!0},Wi=({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}))},sd=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=>le(n.value,r.selectedValue));s&&(t.updateSelectedValue({value:s.value}),i())}},nd=(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()},Rs=(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&&le(a.value,d):!1;if(a){if(f&&!s.noClear){n.clearSelectedValue({}),s.onChange&&typeof s.onChange=="function"&&s.onChange(void 0),Wi({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),Wi({dispatchEvent:i,value:a.value,label:a.label,index:l,item:a}),r()}},od=(e,t)=>{let r=t._event;r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),Rs(e,t))},ad=(e,t)=>{let{store:r,render:i}=e,s=t._event,n=parseInt(s.currentTarget.id.slice(6),10);r.setHoveredOption({optionId:n}),i()},ld=e=>{let{store:t,render:r}=e;t.clearHoveredOption({}),r()},Ps=(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()},pd=(e,t)=>{let r=t._event;r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),Ps(e,t))},dd=e=>{let{store:t,render:r}=e;t.setHoveredAddOption({isHovered:!0}),r()},cd=e=>{let{store:t,render:r}=e;t.setHoveredAddOption({isHovered:!1}),r()},ud=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:Ps,handleAddOptionKeyDown:pd,handleAddOptionMouseEnter:dd,handleAddOptionMouseLeave:cd,handleBeforeMount:sd,handleOnUpdate:nd,handleOptionClick:Rs,handleOptionKeyDown:od,handleOptionMouseEnter:ad,handleOptionMouseLeave:ld},Symbol.toStringTag,{value:"Module"})),hd=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],fd=(e={})=>Object.entries(e).filter(([t])=>!hd.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),yd=()=>Object.freeze({selectedValue:null,hasSelectedValue:!1,hoveredOptionId:null,hoveredAddOption:!1}),md=({state:e,props:t})=>{let r=fd(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&&le(a.value,n),h=e.hoveredOptionId===c;return{...a,isSelected:d,bgc:d?"ac":h&&!i?"mu":"",textColor:d?"ac-fg":"fg",borderLeftWidth:c===0?"none":"xs",cursor:i?"not-allowed":"pointer",tabIndex:i?-1:0}});return{containerAttrString: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"}},gd=({state:e})=>e,bd=({state:e})=>e.selectedValue,vd=({state:e})=>!!e.hasSelectedValue,wd=({state:e},t={})=>{e.selectedValue=t.value,e.hasSelectedValue=!0},_d=({state:e})=>{e.selectedValue=void 0,e.hasSelectedValue=!1},xd=({state:e},t={})=>{e.hoveredOptionId=t.optionId},Sd=({state:e})=>{e.hoveredOptionId=null},Ad=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},kd=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:Sd,clearSelectedValue:_d,createInitialState:yd,selectHasSelectedValue:vd,selectSelectedValue:bd,selectState:gd,selectViewData:md,setHoveredAddOption:Ad,setHoveredOption:xd,updateSelectedValue:wd},Symbol.toStringTag,{value:"Module"})),Wr=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Ed=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=>Wr(n)==="item"&&le(n.value,r.selectedValue));s&&(t.updateSelectedValue({value:s?.value}),i())}},$d=(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()},Bs=(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=>Wr(c)==="item"&&le(c.value,l)),a===-1&&(a=null)),r.openOptionsPopover({position:{y:o.bottom+12,x:o.left-24},selectedIndex:a}),i()},Cd=(e,t)=>{let r=t._event;r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),Bs(e,t))},Id=e=>{let{store:t,render:r}=e;t.closeOptionsPopover({}),r()},Od=(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];Wr(a)==="item"&&(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())},Td=(e,t)=>{let{store:r,render:i}=e,s=t._event,n=parseInt(s.currentTarget.id.slice(6),10);r.setHoveredOption({optionId:n}),i()},Ld=(e,t)=>{let{store:r,render:i}=e;r.clearHoveredOption({}),i()},Vd=(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())},Nd=(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()},jd=(e,t)=>{let{store:r,render:i}=e;r.setHoveredAddOption({isHovered:!0}),i()},Dd=(e,t)=>{let{store:r,render:i}=e;r.setHoveredAddOption({isHovered:!1}),i()},Rd=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:Nd,handleAddOptionMouseEnter:jd,handleAddOptionMouseLeave:Dd,handleBeforeMount:Ed,handleButtonClick:Bs,handleButtonKeyDown:Cd,handleClearClick:Vd,handleClickOptionsPopoverOverlay:Id,handleOnUpdate:$d,handleOptionClick:Od,handleOptionMouseEnter:Td,handleOptionMouseLeave:Ld},Symbol.toStringTag,{value:"Module"})),Pd=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],Bd=(e={})=>Object.entries(e).filter(([t])=>!Pd.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),zd=(e,t)=>Object.prototype.hasOwnProperty.call(e||{},t),zs=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Mi=(e={})=>zs(e)==="item",Wd=(e={})=>typeof e.icon=="string"&&e.icon.length>0?e.icon:"",Md=(e={})=>typeof e.shortcut=="string"&&e.shortcut.length>0?e.shortcut:typeof e.suffixText=="string"&&e.suffixText.length>0?e.suffixText:"",Fd=(e={},t,r,i,s)=>{let n=zs(e),o=n==="section",p=n==="separator",l=n==="item";if(o)return{...e,index:t,type:n,isSection:o,isSeparator:p,isItem:l};if(p)return{...e,index:t,type:n,isSection:o,isSeparator:p,isItem:l};let a=le(e.value,r),c=i===t,d=Wd(e),h=Md(e);return{...e,index:t,type:n,isSection:o,isSeparator:p,isItem:l,isSelected:a,bgc:c?"ac":a?"mu":"",hasIconSlot:s,icon:d,hasIcon:d.length>0,iconColor:"fg",c:"fg",suffixText:h,hasSuffixText:h.length>0,suffixTextColor:"mu-fg"}},Kd=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,hoveredOptionId:null,hoveredAddOption:!1}),Ud=({state:e,props:t})=>{let r=Bd(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(h=>Mi(h)&&le(h.value,s));l&&(n=l.label,o=!1);let a=p.some(h=>Mi(h)&&zd(h,"icon")),c=p.map((h,f)=>Fd(h,f,s,e.hoveredOptionId,a)),d=c.find(h=>h.isItem&&h.isSelected);return{containerAttrString:r,isDisabled:i,isOpen:e.isOpen,position:e.position,options:c,selectedValue:s,selectedLabel:n,selectedLabelColor:o?"mu-fg":"fg",selectedIcon:d?.icon||"",hasSelectedIcon:!!d?.hasIcon,selectedIconColor:o?"mu-fg":"fg",selectedSuffixText:d?.suffixText||"",hasSelectedSuffixText:!!d?.hasSuffixText,selectedSuffixTextColor:"mu-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":""}},Hd=({state:e})=>e,qd=({state:e})=>e.selectedValue,Yd=({state:e},t={})=>{let{position:r,selectedIndex:i}=t;e.position=r,e.isOpen=!0,i!=null&&(e.hoveredOptionId=i)},Gd=({state:e})=>{e.isOpen=!1},Jd=({state:e},t={})=>{e.selectedValue=t.value,e.isOpen=!1},Zd=({state:e})=>{e.selectedValue=void 0},Xd=({state:e},t={})=>{e.hoveredOptionId=t.optionId},Qd=({state:e})=>{e.hoveredOptionId=null},ec=({state:e})=>{e.selectedValue=void 0},tc=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},rc=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:Qd,clearSelectedValue:ec,closeOptionsPopover:Gd,createInitialState:Kd,openOptionsPopover:Yd,resetSelection:Zd,selectSelectedValue:qd,selectState:Hd,selectViewData:Ud,setHoveredAddOption:tc,setHoveredOption:Xd,updateSelectedValue:Jd},Symbol.toStringTag,{value:"Module"})),Fi=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},ic=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?Fi(e.tooltip):Fi(e.showCompactTooltip),sc=(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}))},nc=(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}))},oc=(e,t)=>{let{props:r,store:i,render:s}=e;if(!ic(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())},ac=e=>{let{store:t,render:r}=e;t.hideTooltip({}),r()},lc=Object.freeze(Object.defineProperty({__proto__:null,handleHeaderClick:sc,handleItemClick:nc,handleItemMouseEnter:oc,handleItemMouseLeave:ac},Symbol.toStringTag,{value:"Module"})),pc=()=>Object.freeze({tooltipState:{open:!1,x:0,y:0,place:"r",content:""}}),dc=["id","class","style","slot","header","items","selectedItemId","mode","hideHeader","tooltip","showCompactTooltip","w","bwr"],cc=(e={})=>Object.entries(e).filter(([t])=>!dc.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Xe=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}}}},br=e=>{if(e===!0)return!0;if(e===!1||e===void 0||e===null)return!1;if(typeof e=="string"){let t=e.trim().toLowerCase();return t===""||t==="true"}return!1},uc=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?br(e.tooltip):br(e.showCompactTooltip),hc=(e,t)=>e!=null&&e!==""?e:t==="full"?272:64,Ki=(e={})=>e.label!==void 0&&e.label!==null?e.label:e.title!==void 0&&e.title!==null?e.title:"";function Mr(e,t=null){let r=[];for(let i of e){let s=i.id||i.href||i.path,n=s!=null&&t===s,o=Ki(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=Ki(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 fc=({state:e,props:t})=>{let r=Xe(t.header)||t.header,i=Xe(t.items)||t.items,s=t.selectedItemId,n=cc(t),o=t.mode||"full",p=r||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},l=i?Mr(i,s):[],a=!br(t.hideHeader),c=uc(t),d=t.bwr||"xs",h=hc(t.w,o),f=o==="full"?"fs":"c",u=o==="full"?"fs":"c",y=o==="full"?"lg":"sm",m=o==="full"?"md":"sm",b=o==="shrunk-lg"?48:40,g=o==="shrunk-lg"?28:20,_=o==="shrunk-lg"?"md":"sm",S=o==="full",A=o==="full",k=c&&!S,C=o==="full"?"fs":"c",I=o==="full"?"":`ah=${u}`,V=o==="full"?"f":b;return{containerAttrString:n,mode:o,header:p,items:l,sidebarWidth:h,headerAlign:f,itemAlign:u,headerPadding:y,itemPadding:m,itemHeight:b,iconSize:g,firstLetterSize:_,showLabels:S,showGroupLabels:A,itemContentAlign:C,itemAlignAttr:I,itemWidth:V,headerWidth:V,selectedItemId:s,ah:o==="shrunk-lg"||o==="shrunk-md"?"c":"",listAttrString:o==="full"?"d=v sv":"d=v sv hsb",showHeader:a,enableCompactTooltip:k,rightBorderWidth:d,tooltipState:e.tooltipState||{open:!1,x:0,y:0,place:"r",content:""}}},yc=({props:e})=>Xe(e.header)||e.header,mc=({state:e,props:t})=>{let r=Xe(t.items)||t.items;return(r?Mr(r):[]).find(i=>i.active)},gc=({props:e},t)=>{let r=Xe(e.items)||e.items;return(r?Mr(r):[]).find(i=>i.id===t)},bc=({state:e})=>{},vc=({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}},wc=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},_c=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:pc,hideTooltip:wc,selectActiveItem:mc,selectHeader:yc,selectItem:gc,selectViewData:fc,setState:bc,showTooltip:vc},Symbol.toStringTag,{value:"Module"})),xc=e=>{let{store:t,props:r}=e;t.setValue({value:r.value??0})},Sc=(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()}},Ac=(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}))},kc=(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}))},Ec=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:xc,handleOnUpdate:Sc,handleValueChange:Ac,handleValueInput:kc},Symbol.toStringTag,{value:"Module"})),$c=()=>Object.freeze({value:0}),Cc=({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}),Ic=({state:e},t={})=>{e.value=t.value},Oc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:$c,selectViewData:Cc,setValue:Ic},Symbol.toStringTag,{value:"Module"})),Tc=e=>{},Lc=(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}}))},Vc=(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}}))},Nc=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Tc,handleHeaderClick:Vc,handleRowClick:Lc},Symbol.toStringTag,{value:"Module"})),jc=()=>Object.freeze({sortColumn:null,sortDirection:null}),Dc=["id","class","style","slot","data"],Rc=(e={})=>Object.entries(e).filter(([t])=>!Dc.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Pc=(e,t)=>{let r=t.split("."),i=e;for(let s of r){if(i==null)return null;i=i[s]}return i},Bc=({state:e,props:t})=>{let r=Rc(t),i=t.data||{columns:[],rows:[]},s=i.rows.map((n,o)=>{let p=i.columns.map(l=>{let a=Pc(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||[]}},zc=({state:e})=>e,Wc=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),Mc=({state:e},{column:t,direction:r}={})=>{e.sortColumn=t,e.sortDirection=r},Fc=({state:e})=>{e.sortColumn=null,e.sortDirection=null},Kc=Object.freeze(Object.defineProperty({__proto__:null,clearSort:Fc,createInitialState:jc,selectSortInfo:Wc,selectState:zc,selectViewData:Bc,setSortColumn:Mc},Symbol.toStringTag,{value:"Module"})),Uc=(e,t)=>{let{dispatchEvent:r}=e,i=t._event.currentTarget.dataset.id;r(new CustomEvent("item-click",{detail:{id:i}}))},Hc=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:Uc},Symbol.toStringTag,{value:"Module"})),qc=()=>Object.freeze({}),Yc=["id","class","style","slot","items","selectedTab"],Gc=(e={})=>Object.entries(e).filter(([t])=>!Yc.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Jc=({props:e})=>{let t=Gc(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}},Zc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:qc,selectViewData:Jc},Symbol.toStringTag,{value:"Module"})),Xc=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Ws=e=>Array.isArray(e)?[...e]:[],Ms=e=>{if(!e||typeof e.getBoundingClientRect!="function")return;let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.bottom+12),w:Math.max(Math.round(t.width),240)}},vr=({store:e,props:t})=>e.selectHasSelectedValues()?e.selectSelectedValues():Ws(t.selectedValues),Fs=({store:e,props:t})=>Array.isArray(t?.draftSelectedValues)?Ws(t.draftSelectedValues):e.getState().isOpen?e.selectDraftSelectedValues():vr({store:e,props:t}),Qc=({dispatchEvent:e,value:t,operation:r,changedValue:i,label:s,index:n,item:o})=>{e(new CustomEvent("value-change",{detail:{value:t,operation:r,changedValue:i,label:s,index:n,item:o},bubbles:!0}))},eu=({dispatchEvent:e,value:t})=>{e(new CustomEvent("draft-value-change",{detail:{value:t},bubbles:!0}))},Pe=({dispatchEvent:e,open:t})=>{e(new CustomEvent("open-change",{detail:{open:t},bubbles:!0}))},Fr=({store:e,props:t,refs:r}={})=>{let i=Ms(r?.trigger);return i?(e.openOptionsPopover({position:i,values:Fs({store:e,props:t})}),!0):!1},tu=e=>{let{store:t,props:r,render:i,refs:s}=e,n=!1;r.selectedValues!==void 0&&(t.updateSelectedValues({values:r.selectedValues,syncDraft:r.draftSelectedValues===void 0,preserveDraft:Array.isArray(r.draftSelectedValues)}),n=!0),Array.isArray(r.draftSelectedValues)&&(t.updateDraftSelectedValues({values:r.draftSelectedValues}),n=!0),r.open===!0&&!r.disabled&&Fr(e)&&(n=!0),n&&i()},ru=e=>{let{props:t,render:r,store:i,dispatchEvent:s}=e;if(t.disabled){t.open===!0&&Pe({dispatchEvent:s,open:!1});return}t.open===!0&&!i.getState().isOpen&&Fr(e)&&r()},iu=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n,refs:o}=e,p=!1;if(i?.disabled&&!r?.disabled){let l=s.getState().isOpen;s.closeOptionsPopover({}),l&&Pe({dispatchEvent:e.dispatchEvent,open:!1}),p=!0}if(r.selectedValues!==i.selectedValues&&(s.updateSelectedValues({values:i.selectedValues,syncDraft:i.draftSelectedValues===void 0,preserveDraft:Array.isArray(i.draftSelectedValues)}),p=!0),r.draftSelectedValues!==i.draftSelectedValues&&(s.updateDraftSelectedValues({values:Array.isArray(i?.draftSelectedValues)?i.draftSelectedValues:vr({store:s,props:i})}),p=!0),r.open!==i.open&&i.open!==void 0&&(i.open?i.disabled?Pe({dispatchEvent:e.dispatchEvent,open:!1}):Fr({store:s,props:i,refs:o})&&(p=!0):(s.closeOptionsPopover({}),p=!0)),r.options!==i.options){let l=vr({store:s,props:i}).length>0;(s.getState().isOpen||l)&&(p=!0)}p&&n()},Ks=(e,t)=>{let{store:r,render:i,refs:s,props:n,dispatchEvent:o}=e;if(n.disabled)return;t._event.stopPropagation();let p=Ms(s.trigger);p&&(r.openOptionsPopover({position:p,values:Fs({store:r,props:n})}),Pe({dispatchEvent:o,open:!0}),i())},su=(e,t)=>{let r=t._event;r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),Ks(e,t))},nu=e=>{let{store:t,render:r,dispatchEvent:i}=e;t.closeOptionsPopover({}),Pe({dispatchEvent:i,open:!1}),r()},Us=(e,t)=>{let{render:r,props:i,store:s,dispatchEvent:n}=e;if(i.disabled)return;let o=t._event;o.stopPropagation();let p=o.currentTarget.id.slice(6),l=Number(p),a=i.options[l];!a||Xc(a)!=="item"||(s.toggleDraftSelectedValue({value:a.value}),eu({dispatchEvent:n,value:s.selectDraftSelectedValues()}),r())},ou=(e,t)=>{let r=t._event;r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),Us(e,t))},au=(e,t)=>{let{store:r,props:i,render:s,dispatchEvent:n}=e;if(i.disabled)return;t._event.stopPropagation();let o=r.selectDraftSelectedValues();r.commitDraftSelectedValues({}),i.onChange&&typeof i.onChange=="function"&&i.onChange(o),Qc({dispatchEvent:n,value:o,operation:"set",changedValue:void 0,label:void 0,index:null,item:void 0}),Pe({dispatchEvent:n,open:!1}),s()},lu=(e,t)=>{let{props:r,dispatchEvent:i}=e;r.disabled||(t._event.stopPropagation(),i(new CustomEvent("add-option-click",{bubbles:!0,composed:!0})))},pu=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:lu,handleAfterMount:ru,handleBeforeMount:tu,handleOnUpdate:iu,handleOptionClick:Us,handleOptionKeyDown:ou,handlePopoverClose:nu,handleSubmitClick:au,handleTriggerClick:Ks,handleTriggerKeyDown:su},Symbol.toStringTag,{value:"Module"})),Hs=e=>{if(!e||typeof e.getBoundingClientRect!="function")return null;let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.bottom+12),w:Math.max(Math.round(t.width),240)}},Ct=e=>Array.isArray(e)?[...e]:[],vt=e=>{typeof e.render=="function"&&e.render()},qs=e=>e.store?.selectHasSelectedValues?.()?e.store?.selectSelectedValues?.()||[]:Ct(e.props?.selectedValues),Kr=(e,t=[])=>{let r=Hs(e.refs?.trigger);return!r||!e.store?.openOptionsPopover?!1:(e.store.openOptionsPopover({position:r,values:t}),!0)},Ys=(e,t=[],r=!1)=>e.store?.getState?.()?.isOpen&&e.store?.updateDraftSelectedValues?(e.store.updateDraftSelectedValues({values:t}),!0):r?Kr(e,t):!1,du=function(e={}){let t=this.store?.getState?.(),r=Array.isArray(e.values)?Ct(e.values):this.store?.selectDraftSelectedValues?.()||[];if(t?.isOpen){let i=Hs(this.refs?.trigger);i&&this.store.openOptionsPopover({position:i,values:r})}else e.keepOpen&&Kr(this,r.length>0?r:qs(this));vt(this)},cu=function(e={}){let t=Ct(e.values);Ys(this,t,!!e.keepOpen)&&vt(this)},uu=function(e={}){if(!Object.prototype.hasOwnProperty.call(e||{},"value"))return;let t=this.store?.getState?.(),r=t?.isOpen?this.store?.selectDraftSelectedValues?.()||[]:qs(this);if(r.some(s=>le(s,e.value))){e.keepOpen&&!t?.isOpen&&Kr(this,r)&&vt(this);return}let i=[...Ct(r),e.value];Ys(this,i,!!e.keepOpen)&&vt(this)},hu=Object.freeze(Object.defineProperty({__proto__:null,appendDraftSelectedValue:uu,refreshPopover:du,setDraftSelectedValues:cu},Symbol.toStringTag,{value:"Module"})),fu=["id","class","style","slot","placeholder","options","open","selectedValues","draftSelectedValues","onChange","addOption","disabled"],yu=(e={})=>Object.entries(e).filter(([t])=>!fu.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),mu=(e,t)=>Object.prototype.hasOwnProperty.call(e||{},t),Gs=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Js=(e={})=>Gs(e)==="item",Zs=(e={})=>typeof e.icon=="string"&&e.icon.length>0?e.icon:"",gu=(e={})=>typeof e.shortcut=="string"&&e.shortcut.length>0?e.shortcut:typeof e.suffixText=="string"&&e.suffixText.length>0?e.suffixText:"",ye=e=>Array.isArray(e)?[...e]:[],bu=(e=[],t=[])=>e.length!==t.length?!1:e.every((r,i)=>le(r,t[i])),vu=(e=[],t)=>e.some(r=>le(r,t)),Xs=({state:e,props:t})=>e.hasSelectedValues?ye(e.selectedValues):ye(t.selectedValues),wu=({state:e,props:t})=>e.isOpen?ye(e.draftSelectedValues):Xs({state:e,props:t}),_u=e=>e==null?"":String(e),xu=(e=[],t)=>e.find(r=>Js(r)&&le(r.value,t)),wr=({isSelected:e=!0,isAddChip:t=!1}={})=>{let r=["--tag-border-radius: var(--border-radius-md)","--muted-foreground: var(--foreground)"];return(t||!e)&&r.push("--muted: color-mix(in srgb, var(--muted) 82%, var(--background) 18%)"),`${r.join("; ")};`},Su=({option:e={},index:t,selectedValues:r=[],hasIconColumn:i=!1})=>{let s=Gs(e),n=s==="section",o=s==="separator",p=s==="item";if(n||o)return{...e,index:t,type:s,isSection:n,isSeparator:o,isItem:p};let l=vu(r,e.value),a=Zs(e),c=gu(e),d=l?c||"Added":c;return{...e,index:t,type:s,isSection:n,isSeparator:o,isItem:p,isSelected:l,hasIconSlot:i,icon:a,hasIcon:a.length>0,cursor:"pointer",tagStyle:wr({isSelected:l}),suffixText:d,hasSuffixText:d.length>0}},Au=()=>Object.freeze({isOpen:!1,position:{x:0,y:0,w:240},selectedValues:[],draftSelectedValues:[],hasSelectedValues:!1}),ku=({state:e,props:t})=>{let r=yu(t),i=!!t.disabled,s=Xs({state:e,props:t}),n=wu({state:e,props:t}),o=(e.isOpen||s.length>0)&&Array.isArray(t.options)?t.options:[],p=o.some(f=>Js(f)&&mu(f,"icon")),l=o.map((f,u)=>Su({option:f,index:u,selectedValues:n,hasIconColumn:p})),a=s.map((f,u)=>{let y=xu(o,f),m=y?Zs(y):"";return{value:f,selectionIndex:u,label:y?.label||_u(f),icon:m,hasIcon:m.length>0,testId:`tag-select-tag-${u}`}}),c=l.some(f=>f.isItem),d=!bu(s,n),h=a.length>0?a.map(f=>({...f,tagStyle:wr({isSelected:!0})})):[{value:void 0,selectionIndex:"",label:t.placeholder||"Add tag",icon:"",testId:"",tagStyle:wr({isAddChip:!0})}];return{containerAttrString:r,isDisabled:i,isOpen:e.isOpen,position:e.position,options:l,hasSelectableOptions:c,placeholder:t.placeholder||"Add tag",triggerTags:h,triggerCursor:i?"not-allowed":"pointer",triggerTabIndex:i?-1:0,showAddOption:!0,addOptionLabel:t.addOption?.label||"Add tag",hasDraftChanges:d,submitDisabled:i,submitLabel:"Save"}},Eu=({state:e})=>ye(e.selectedValues),$u=({state:e})=>!!e.hasSelectedValues,Cu=({state:e})=>ye(e.draftSelectedValues),Iu=({state:e},t={})=>{let{position:r,values:i}=t;e.position={...e.position,...r||{}},e.draftSelectedValues=ye(i),e.isOpen=!0},Ou=({state:e})=>{e.isOpen=!1,e.draftSelectedValues=[]},Tu=({state:e},t={})=>{e.draftSelectedValues=ye(t.values)},Lu=({state:e},t={})=>{let r=ye(t.values);e.selectedValues=r,e.hasSelectedValues=!0,(t.syncDraft||!e.isOpen)&&!t.preserveDraft&&(e.draftSelectedValues=[...r])},Vu=({state:e},t={})=>{let r=ye(e.draftSelectedValues),i=t.value,s=r.findIndex(n=>le(n,i));if(s>=0){e.draftSelectedValues=r.filter((n,o)=>o!==s);return}e.draftSelectedValues=[...r,i]},Nu=({state:e})=>{e.selectedValues=ye(e.draftSelectedValues),e.hasSelectedValues=!0,e.isOpen=!1,e.draftSelectedValues=[]},ju=Object.freeze(Object.defineProperty({__proto__:null,closeOptionsPopover:Ou,commitDraftSelectedValues:Nu,createInitialState:Au,openOptionsPopover:Iu,selectDraftSelectedValues:Cu,selectHasSelectedValues:$u,selectSelectedValues:Eu,selectViewData:ku,toggleDraftSelectedValue:Vu,updateDraftSelectedValues:Tu,updateSelectedValues:Lu},Symbol.toStringTag,{value:"Module"})),Du=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Ru=()=>Object.freeze({}),Ui={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))"}},Pu=({props:e})=>{let t=Ui[e.s]?e.s:"sm",r=Ui[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};`}},Bu=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Ru,selectViewData:Pu},Symbol.toStringTag,{value:"Module"})),zu=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&&Qs(n,o)},Wu=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&&Qs(o,p)};async function Qs(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),y=f*d,m=a-u/2;r.fillStyle=c,r.fillRect(y,m,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 Mu=Object.freeze(Object.defineProperty({__proto__:null,handleAfterMount:zu,handleOnUpdate:Wu},Symbol.toStringTag,{value:"Module"})),Fu=()=>Object.freeze({waveformData:null}),Ku=({state:e},t={})=>{e.waveformData=t.data},Uu=({state:e,props:t})=>({isLoading:t.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:t.waveformData}),Hu=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Fu,selectViewData:Uu,setWaveformData:Ku},Symbol.toStringTag,{value:"Module"})),en=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),tn=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase()),_r=e=>{if(e!=null)return e===""?!0:e},wt=(e,t)=>{let r=e.getAttribute(t);if(r!==null)return _r(r);let i=en(t);if(i!==t){let s=e.getAttribute(i);if(s!==null)return _r(s)}},pr=Symbol("rtglReactivePropValues"),dr=Symbol("rtglNativeHostStyle"),qu=(e,t)=>{let r=Object.getPrototypeOf(e);for(;r;){let i=Object.getOwnPropertyDescriptor(r,t);if(i)return i;r=Object.getPrototypeOf(r)}},rn=e=>{if(!e||typeof e!="object")return;if(Object.prototype.hasOwnProperty.call(e,dr))return e[dr];let t=qu(e,"style"),r;return typeof t?.get=="function"?r=t.get.call(e):e.style&&typeof e.style=="object"&&(r=e.style),r&&typeof r=="object"&&Object.defineProperty(e,dr,{value:r,enumerable:!1,configurable:!1,writable:!1}),r},Yu=e=>(Object.prototype.hasOwnProperty.call(e,pr)||Object.defineProperty(e,pr,{value:Object.create(null),enumerable:!1,configurable:!1,writable:!1}),e[pr]),Gu=({source:e,allowedKeys:t=[],onPropChange:r})=>{let i=Yu(e);t.includes("style")&&rn(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]:wt(e,s)},set(p){let l=Object.prototype.hasOwnProperty.call(i,s)?i[s]:wt(e,s);p===void 0?delete i[s]:i[s]=p,l!==p&&r?.({propName:s,oldValue:l,newValue:p})}}),o&&(i[s]=n)})},Ju=(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:wt(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:wt(e,s)}}}})},Zu=({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},xr={NOT:0},E=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"}},Hi=e=>{if(!e||e.trim()==="")throw new E("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new E(`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 E(`Incomplete comparison expression - missing right operand (got: '${e}')`)},Xu=e=>{if(e.trim().endsWith(" in"))throw new E(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new E(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new E(`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 E(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(s))throw new E(`Invalid loop syntax (got: '$for ${e}')`)}},Qu=(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}'`)},eh=(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})`)},sn=(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=j(e,{functions:i,partials:s},t,{});return n===void 0?{}:n},j=(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 rh(e.parts,t,r,i);switch(e.type){case v.FUNCTION:return nn(e,t,r,i);case v.BINARY:return on(e,t,r,i);case v.UNARY:return an(e,t,r,i);case v.CONDITIONAL:return sh(e,t,r,i);case v.LOOP:return ph(e,t,r,i);case v.OBJECT:return ch(e,t,r,i);case v.ARRAY:return uh(e,t,r,i);case v.PARTIAL:return hh(e,t,r,i);case v.PATH_REFERENCE:return fh(e,t,r,i);default:throw new Error(`Unknown node type: ${e.type}`)}},qi=new Map,th=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=qi.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=th(l.trim());i.push(...a)}qi.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},rh=(e,t,r,i)=>{let s=[];for(let n of e)if(typeof n=="string")s.push(n);else{let o=j(n,t,r,i);s.push(o!=null?String(o):"")}return s.join("")},nn=(e,t,r,i)=>{let s=t.functions||t,n=s[e.name];if(!n)throw eh(e.name,s);let o=e.args.map(p=>j(p,t,r,i));return n(...o)},Be=(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 on(e,t,r,i);case v.UNARY:return an(e,t,r,i);case v.FUNCTION:return nn(e,t,r,i);default:return j(e,t,r,i)}},on=(e,t,r,i)=>{if(e.op===P.AND||e.op===P.OR){let o=Be(e.left,t,r,i),p=Be(e.right,t,r,i);switch(e.op){case P.AND:return o&&p;case P.OR:return o||p}}let s=j(e.left,t,r,i),n=j(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}`)}},an=(e,t,r,i)=>{let s=e.op===xr.NOT?Be(e.operand,t,r,i):j(e.operand,t,r,i);switch(e.op){case xr.NOT:return!s;default:throw new Error(`Unknown unary operator: ${e.op}`)}},ih=(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?j(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=j(d,t,r,i);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=j(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?j(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=j(d,t,r,i);c.push(h!=null?String(h):"")}o[l]=c.join("")}else o[l]=j(a,t,r,i)}return o}}}return null},sh=(e,t,r,i)=>{let s=ih(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||Be(o,t,r,i))return j(e.bodies[n],t,r,i)}return ln},nh=(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 y=u.substring(i.length+1);c[h]=a[y]}else return null}else if(f.type===v.INTERPOLATION){let u=[],y=!0;for(let m of f.parts)if(typeof m=="string")u.push(m);else if(m.type===v.VARIABLE){let b=m.path;if(b===i)u.push(a!=null?String(a):"");else if(b.startsWith(i+".")){let g=b.substring(i.length+1),_=a[g];u.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[h]=u.join("")}else return null}p.push(c)}}return p}}}return null},oh=(e,t)=>{let r=e.body,i=e.itemVar,s=nh(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},ah=(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("."),y=u[0];y in i.__paths__&&(f=i.__paths__[y],u.length>1&&(f+="."+u.slice(1).join(".")))}h.__paths__={...h.__paths__,[p]:`${f}[${a}]`,...l&&{[l]:a}};for(let u of o.properties){let y=u.parsedKey?j(u.parsedKey,t,r,h):u.key,m=u.value;if(m.type===v.LITERAL)d[y]=m.value;else if(m.type===v.VARIABLE){let b=m.path;if(b===p)d[y]=c;else if(b===l)d[y]=a;else if(b.startsWith(p+".")){let g=b.substring(p.length+1);!g.includes(".")&&!g.includes("[")?d[y]=c[g]:d[y]=U(b,r,{...i,[p]:c,...l&&{[l]:a}})}else d[y]=U(b,r,{...i,[p]:c,...l&&{[l]:a}})}else if(m.type===v.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=g.path,S;if(_===p)S=c;else if(_===l)S=a;else if(_.startsWith(p+".")){let A=_.substring(p.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=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=j(g,t,r,_);b.push(S!=null?String(S):"")}d[y]=b.join("")}else{let b={...i,[p]:c,...l&&{[l]:a}};d[y]=j(m,t,r,b)}}n.push(d)}return n}return null},lh=(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},ph=(e,t,r,i)=>{let s=j(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 Qu(d,s,c)}if(!e.indexVar){let a=lh(e,s,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=oh(e,s);if(a!==null)return a}let n=ah(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=j(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},dh=(e,t,r,i)=>{if(e.whenCondition)return null;if(e.properties.length===1){let s=e.properties[0],n=s.parsedKey?j(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?j(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 y=U(u.path,r,i);f.push(y!=null?String(y):"")}else{a=!1;break}if(!a)break;l[d]=f.join("")}else if(h.type===v.OBJECT&&h.properties.length<=5){let f={};for(let u of h.properties){let y=u.key,m=u.value;if(m.type===v.LITERAL)f[y]=m.value;else if(m.type===v.VARIABLE)f[y]=U(m.path,r,i);else if(m.type===v.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=U(g.path,r,i);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[y]=b.join("")}else{a=!1;break}}if(!a)break;l[d]=f}else{a=!1;break}}if(a)return p[n]=l,p}}return null},ch=(e,t,r,i)=>{let s=t.functions||t;if(e.whenCondition&&!Be(e.whenCondition,s,r,i))return;let n=dh(e,t,r,i);if(n!==null)return n;if(e.fast){let l={};for(let a of e.properties){let c=a.parsedKey?j(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=j(f,t,r,i);h.push(u!=null?String(u):"")}l[c]=h.join("")}else l[c]=j(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=j(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 j(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=j(c.value,t,r,i);d!==void 0&&(o[l.key]=d)}else{let d=j(l.value,t,r,i);d!==void 0&&(o[l.key]=d)}}else{let c=l.parsedKey?j(l.parsedKey,t,r,i):l.key,d=j(l.value,t,r,i);d!==void 0&&(o[c]=d)}}return o},ln={},uh=(e,t,r,i)=>{let s=[];for(let n of e.items)if(n.type===v.LOOP){let o=j(n,t,r,i);Array.isArray(o)&&n.flatten!==!1?s.push(...o):s.push(o)}else{let o=j(n,t,r,i);o!==ln&&o!==void 0&&s.push(o)}return s},hh=(e,t,r,i)=>{let{name:s,data:n,whenCondition:o}=e,p=t.partials||{},l=t.functions||t;if(o&&!Be(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=j(n,t,r,i);d={...d,...f}}return j(c,t,d,h)},fh=(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},yh=/\$\{([^}]*)\}/g,mh=/#\{([^}]*)\}/g,pn=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,i,s]=r,n=gh(s,t);return{isFunction:!0,type:v.FUNCTION,name:i,args:n}},gh=(e,t={})=>e.trim()?bh(e).map(r=>vh(r.trim(),t)):[],bh=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},vh=(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=pn(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=Ve(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}},dn=/^\w+\(.*\)$/,wh=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,_h=e=>{if(!(!e||e.trim()===""||dn.test(e))&&wh.test(e))throw e.includes("?")&&e.includes(":")?new E(`Complex expressions not supported in variable replacements - consider calculating the value in your data instead. Offending expression: "${e}"`):e.includes("||")||e.includes("&&")||e.includes("??")?new E(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new E(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},Yi=e=>{let t=e.trim();if(dn.test(t))throw new E(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new E(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new E(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new E(`Logical operators not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("?")&&t.includes(":"))throw new E(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:v.PATH_REFERENCE,path:t}},_t=(e,t={})=>{let r=e.trim();_h(r);let i=pn(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}},cn=(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(yh)],n=[...r.matchAll(mh)],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"?_t(a[1],t):Yi(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 y=0;y<i.length;y++)u=u.replace(`__ESCAPED_${y}__`,i[y]);u&&p.push(u)}try{let u;c==="variable"?u=_t(h.trim(),t):u=Yi(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"?cn(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Sh(e,t):Ah(e,t):{type:v.LITERAL,value:e},xh=e=>{let{$each:t,...r}=e;if(typeof t!="string")throw new E("$each value must be a non-empty string");let i=t.trim();if(i==="")throw new E("$each value must be a non-empty string");if(Object.keys(r).length===0)throw new E("Empty $each body not allowed");if(r.$partial!==void 0)throw new E("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${i}`]:r}},Sh=(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=xh(n),a=Object.keys(l);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let c=Gi(a[0],l[a[0]],t,!0);r.push(c),i=!0;continue}}catch(l){throw l instanceof E?l:new E(l.message)}let p=Object.keys(n);if(p.length===1&&/^\$for(?::\w+)?\s/.test(p[0])){let l=Gi(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}},Ah=(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 E("$partial value must be a string");if(e.$partial.trim()==="")throw new E("$partial value cannot be an empty string");let l=["$if","$elif","$else","$for"],a=[];for(let[b]of n)for(let g of l)if(b===g||b.startsWith(g+" ")||b.startsWith(g+"#")){a.push(g);break}if(a.length>0)throw new E(`Cannot use $partial with ${a.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...h}=e,f={},u=!1;for(let[b,g]of Object.entries(h)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=g,u=!0}let y=null;if(u&&(y=Ee(f,t),y.type===v.OBJECT)){let b=!1;for(let g of y.properties)if(g.value.type===v.VARIABLE||g.value.type===v.INTERPOLATION||g.value.type===v.FUNCTION||g.value.type===v.CONDITIONAL||g.value.type===v.OBJECT&&!g.value.fast||g.value.type===v.ARRAY&&!g.value.fast){b=!0;break}b&&(y.fast=!1)}let m={type:v.PARTIAL,name:c,data:y};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new E("Empty condition expression after '$when'");b=Q(d,t)}else b={type:v.LITERAL,value:d};m.whenCondition=b}return m}for(let[l,a]of n)if(l==="$when"){if(s!==null)throw new E("Multiple '$when' directives on the same object are not allowed");if(a==null)throw new E("Missing condition expression after '$when'");let c=typeof a=="string"?a:JSON.stringify(a);if(c.trim()==="")throw new E("Empty condition expression after '$when'");s=Q(c,t),i=!0}else if(l.startsWith("$when#")||l.startsWith("$when "))throw new E("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;o<n.length;){let[l,a]=n[o];if(l==="$when"){o++;continue}if(l==="$each")throw new E("$each can only be used inside arrays");if(l.startsWith("$if ")||l.match(/^\$if#\w+\s/)||l.match(/^\$if\s+\w+.*:$/)){let c=kh(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 E(`$for loops must be inside arrays - use '- $for${d} item in items:' instead of '$for${d} item in items:'. For cleaner object generation syntax, consider using $each.`)}else{if(l.startsWith("$elif ")||l.startsWith("$else"))throw new E(`'${l.split(" ")[0]}' without matching '$if'`);if(l==="$if"||l==="$if:")throw new E("Missing condition expression after '$if'");{let c=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=cn(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},kh=(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 E(`Invalid conditional syntax: ${o}`)}else a=o.substring(4),a.endsWith(":")&&(a=a.slice(0,-1).trim());Hi(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{Hi(u);let y=Q(u,r);i.push(y)}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=Ve(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=Ve(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=Ve(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=Ve(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(Ve(e,a)!==-1)throw new E(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:v.UNARY,op:xr.NOT,operand:Q(e.substring(1).trim(),t)}:un(e,t)},Ve=(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},Eh=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}},un=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return _t(r,t);let i=Eh(r);if(i.type===v.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:v.VARIABLE,path:r};try{return _t(r,t)}catch(s){if(s.message&&s.message.includes("not supported"))return i;throw s}},$h=(e,t=!1)=>{try{Xu(e)}catch(r){if(r instanceof E&&t){let i=r.message.replace(/\$for/g,"$each");throw new E(i.replace("Parse Error: ",""))}throw r}},Gi=(e,t,r,i=!1)=>{let s=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(s);if(!n){let m=i?"$each":"$for";throw new E(`Invalid loop syntax (got: '${e.replace("$for",m)}')`)}let o=n[1],p=n[2].trim();$h(p,i);let l=p.match(/^(.+?)\s+in\s+(.+)$/);if(!l){let m=i?"$each":"$for";throw new E(`Invalid loop syntax - missing 'in' keyword (got: '${m} ${p}')`)}let a=l[1].trim(),c=l[2].trim(),d,h=null;if(a.includes(",")){let m=a.split(",").map(b=>b.trim());if(m.length!==2)throw new E(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=m[0],h=m[1]}else d=a;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new E(`Reserved variable name: ${d}`);if(h&&f.includes(h))throw new E(`Reserved variable name: ${h}`);let u=un(c,r),y=Ee(t,r);return{type:v.LOOP,itemVar:d,indexVar:h,iterable:u,body:y,flatten:o!=="nested"}},Sr=(e,t={})=>{let{functions:r={}}=t;return Ee(e,r)},Ch=()=>Date.now(),Ih=Object.freeze(Object.defineProperty({__proto__:null,now:Ch},Symbol.toStringTag,{value:"Module"})),hn=(e,t,r={})=>{let{functions:i={},partials:s={}}=r,n={...Ih,...i},o=Sr(e,{functions:n}),p={};for(let[l,a]of Object.entries(s))p[l]=Sr(a,{functions:n});return sn(o,t,{functions:n,partials:p})},Qe=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Oh=(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(!Qe(n))throw new Error(`[Methods] Method '${r}' expects payload to be an object.`);return i.call(e,n)}})}})},fn=Symbol.for("immer-nothing"),Ji=Symbol.for("immer-draftable"),oe=Symbol.for("immer-state");function ce(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ze=Object.getPrototypeOf;function We(e){return!!e&&!!e[oe]}function $e(e){return e?yn(e)||Array.isArray(e)||!!e[Ji]||!!e.constructor?.[Ji]||Ot(e)||Tt(e):!1}var Th=Object.prototype.constructor.toString();function yn(e){if(!e||typeof e!="object")return!1;let t=ze(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)===Th}function xt(e,t){It(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,i)=>t(i,r,e))}function It(e){let t=e[oe];return t?t.type_:Array.isArray(e)?1:Ot(e)?2:Tt(e)?3:0}function Ar(e,t){return It(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function mn(e,t,r){let i=It(e);i===2?e.set(t,r):i===3?e.add(r):e[t]=r}function Lh(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ot(e){return e instanceof Map}function Tt(e){return e instanceof Set}function Se(e){return e.copy_||e.base_}function kr(e,t){if(Ot(e))return new Map(e);if(Tt(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=yn(e);if(t===!0||t==="class_only"&&!r){let i=Object.getOwnPropertyDescriptors(e);delete i[oe];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(ze(e),i)}else{let i=ze(e);if(i!==null&&r)return{...e};let s=Object.create(i);return Object.assign(s,e)}}function Ur(e,t=!1){return Lt(e)||We(e)||!$e(e)||(It(e)>1&&(e.set=e.add=e.clear=e.delete=Vh),Object.freeze(e),t&&Object.entries(e).forEach(([r,i])=>Ur(i,!0))),e}function Vh(){ce(2)}function Lt(e){return Object.isFrozen(e)}var Nh={};function Ce(e){let t=Nh[e];return t||ce(0,e),t}var et;function gn(){return et}function jh(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Zi(e,t){t&&(Ce("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Er(e){$r(e),e.drafts_.forEach(Dh),e.drafts_=null}function $r(e){e===et&&(et=e.parent_)}function Xi(e){return et=jh(et,e)}function Dh(e){let t=e[oe];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Qi(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[oe].modified_&&(Er(t),ce(4)),$e(e)&&(e=St(t,e),t.parent_||At(t,e)),t.patches_&&Ce("Patches").generateReplacementPatches_(r[oe].base_,e,t.patches_,t.inversePatches_)):e=St(t,r,[]),Er(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==fn?e:void 0}function St(e,t,r){if(Lt(t))return t;let i=t[oe];if(!i)return xt(t,(s,n)=>es(e,i,t,s,n,r)),t;if(i.scope_!==e)return t;if(!i.modified_)return At(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),xt(n,(p,l)=>es(e,i,s,p,l,r,o)),At(e,s,!1),r&&e.patches_&&Ce("Patches").generatePatches_(i,r,e.patches_,e.inversePatches_)}return i.copy_}function es(e,t,r,i,s,n,o){if(We(s)){let p=n&&t&&t.type_!==3&&!Ar(t.assigned_,i)?n.concat(i):void 0,l=St(e,s,p);if(mn(r,i,l),We(l))e.canAutoFreeze_=!1;else return}else o&&r.add(s);if($e(s)&&!Lt(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;St(e,s),(!t||!t.scope_.parent_)&&typeof i!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,i)&&At(e,s)}}function At(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ur(t,r)}function Rh(e,t){let r=Array.isArray(e),i={type_:r?1:0,scope_:t?t.scope_:gn(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},s=i,n=Hr;r&&(s=[i],n=tt);let{revoke:o,proxy:p}=Proxy.revocable(s,n);return i.draft_=p,i.revoke_=o,p}var Hr={get(e,t){if(t===oe)return e;let r=Se(e);if(!Ar(r,t))return Ph(e,r,t);let i=r[t];return e.finalized_||!$e(i)?i:i===cr(e.base_,t)?(ur(e),e.copy_[t]=Ir(i,e)):i},has(e,t){return t in Se(e)},ownKeys(e){return Reflect.ownKeys(Se(e))},set(e,t,r){let i=bn(Se(e),t);if(i?.set)return i.set.call(e.draft_,r),!0;if(!e.modified_){let s=cr(Se(e),t),n=s?.[oe];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Lh(r,s)&&(r!==void 0||Ar(e.base_,t)))return!0;ur(e),Cr(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 cr(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ur(e),Cr(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Se(e),i=Reflect.getOwnPropertyDescriptor(r,t);return i&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:i.enumerable,value:r[t]}},defineProperty(){ce(11)},getPrototypeOf(e){return ze(e.base_)},setPrototypeOf(){ce(12)}},tt={};xt(Hr,(e,t)=>{tt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});tt.deleteProperty=function(e,t){return tt.set.call(this,e,t,void 0)};tt.set=function(e,t,r){return Hr.set.call(this,e[0],t,r,e[0])};function cr(e,t){let r=e[oe];return(r?Se(r):e)[t]}function Ph(e,t,r){let i=bn(t,r);return i?"value"in i?i.value:i.get?.call(e.draft_):void 0}function bn(e,t){if(!(t in e))return;let r=ze(e);for(;r;){let i=Object.getOwnPropertyDescriptor(r,t);if(i)return i;r=ze(r)}}function Cr(e){e.modified_||(e.modified_=!0,e.parent_&&Cr(e.parent_))}function ur(e){e.copy_||(e.copy_=kr(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Bh=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"&&ce(6),i!==void 0&&typeof i!="function"&&ce(7);let s;if($e(t)){let n=Xi(this),o=Ir(t,void 0),p=!0;try{s=r(o),p=!1}finally{p?Er(n):$r(n)}return Zi(n,i),Qi(s,n)}else if(!t||typeof t!="object"){if(s=r(t),s===void 0&&(s=t),s===fn&&(s=void 0),this.autoFreeze_&&Ur(s,!0),i){let n=[],o=[];Ce("Patches").generateReplacementPatches_(t,s,n,o),i(n,o)}return s}else ce(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){$e(e)||ce(8),We(e)&&(e=zh(e));let t=Xi(this),r=Ir(e,void 0);return r[oe].isManual_=!0,$r(t),r}finishDraft(e,t){let r=e&&e[oe];(!r||!r.isManual_)&&ce(9);let{scope_:i}=r;return Zi(i,t),Qi(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=Ce("Patches").applyPatches_;return We(e)?i(e,t):this.produce(e,s=>i(s,t))}};function Ir(e,t){let r=Ot(e)?Ce("MapSet").proxyMap_(e,t):Tt(e)?Ce("MapSet").proxySet_(e,t):Rh(e,t);return(t?t.scope_:gn()).drafts_.push(r),r}function zh(e){return We(e)||ce(10,e),vn(e)}function vn(e){if(!$e(e)||Lt(e))return e;let t=e[oe],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=kr(e,t.scope_.immer_.useStrictShallowCopy_)}else r=kr(e,!0);return xt(r,(i,s)=>{mn(r,i,vn(s))}),t&&(t.finalized_=!1),r}var ae=new Bh,Wh=ae.produce;ae.produceWithPatches.bind(ae);ae.setAutoFreeze.bind(ae);ae.setUseStrictShallowCopy.bind(ae);ae.applyPatches.bind(ae);ae.createDraft.bind(ae);ae.finishDraft.bind(ae);var Mh=(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(!Qe(d))throw new Error(`[Store] Action '${l}' expects payload to be an object.`);return p=Wh(p,h=>a({state:h,props:t,constants:r},d)),p}}),{getState:()=>p,...o,...n}},wn=e=>!Qe(e)||Object.isFrozen(e)?e:(Object.values(e).forEach(t=>{wn(t)}),Object.freeze(e)),Fh=({setupConstants:e,fileConstants:t})=>{let r=Qe(e)?e:{},i=Qe(t)?t:{};return wn({...r,...i})},Kh=(e,t)=>{if(!t||typeof t!="object")return"";let r="",i=n=>Object.entries(n).map(([o,p])=>` ${o}: ${p};`).join(`
|
|
1509
|
-
`),
|
|
1508
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let s=t.composedPath();(s[0]===this._dialogElement||s[0].nodeName==="DIALOG"&&s[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let s=t.composedPath();(s[0]===this._dialogElement||s[0].nodeName==="DIALOG"&&s[0]===this._dialogElement)&&(t.preventDefault(),this._emitClose())}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._emitClose()}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._contentWrapper=null,this._isOpen=!1,this._positionFrameId=null,this._revealFrameId=null,this._positionVersion=0,this._isObservingResize=!1,this._observedContentWrapper=null,this._resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>{this._isOpen&&this._schedulePositionUpdate()}):null}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y","place","no-overlay","content-w","content-h","content-wh","content-g","content-sv","content-ph","content-pv","content-bgc","content-style"]}connectedCallback(){this._syncContentWrapper({reposition:!1}),this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._cancelScheduledPositionUpdate(),this._stopResizeObserver(),this._isOpen&&this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,s,r){t==="open"?r!==null&&!this._isOpen?this.isConnected&&this._show():r===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="place")&&this._isOpen?this._schedulePositionUpdate():t==="no-overlay"&&s!==r&&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(s=>s.hasAttribute(Or));return t?this._contentWrapper=t:(this._contentWrapper=document.createElement("rtgl-view"),this._contentWrapper.setAttribute(Or,""),this._contentWrapper.setAttribute("part","content"),this._contentWrapper.setAttribute("bgc","su"),this._contentWrapper.setAttribute("bw","xs"),this._contentWrapper.setAttribute("bc","bo"),this._contentWrapper.setAttribute("br","md"),this._contentWrapper.setAttribute("ph","sm"),this._contentWrapper.setAttribute("pv","sm"),this._contentWrapper.setAttribute("style",os)),this._contentWrapper.parentNode!==this&&this.appendChild(this._contentWrapper),this._contentWrapper}_syncContentWrapperAttributes(){let t=this._ensureContentWrapper(),s=[["content-w","w"],["content-h","h"],["content-wh","wh"],["content-g","g"],["content-sv","sv"]];for(let[i,n]of s){let o=this.getAttribute(i);o===null?t.removeAttribute(n):t.setAttribute(n,o)}t.setAttribute("bgc",this.getAttribute("content-bgc")||"su"),t.setAttribute("ph",this.getAttribute("content-ph")||"sm"),t.setAttribute("pv",this.getAttribute("content-pv")||"sm");let r=this.getAttribute("content-style");t.setAttribute("style",r?`${os} ${r}`:os)}_syncContentWrapper({reposition:t=!0}={}){let s=this._ensureContentWrapper(),r=Array.from(this.childNodes).filter(n=>n!==s&&!this._isIgnorableTextNode(n));for(let n of r)n.nodeType===Node.ELEMENT_NODE&&n.getAttribute("slot")==="content"&&n.removeAttribute("slot"),s.appendChild(n);this._syncContentWrapperAttributes(),Array.from(s.childNodes).some(n=>!this._isIgnorableTextNode(n))||this.hasAttribute("open")?s.setAttribute("slot","content"):s.removeAttribute("slot"),t&&this._isOpen&&this._schedulePositionUpdate()}_show(){this._isOpen||(this._syncContentWrapper({reposition:!1}),this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._startResizeObserver(),this._dialogElement.open?this._schedulePositionUpdate():setTimeout(()=>{this._dialogElement&&!this._dialogElement.open&&(this.hasAttribute("no-overlay")?this._dialogElement.show():this._dialogElement.showModal()),this._schedulePositionUpdate()},0))}_hide(){this._isOpen&&(this._isOpen=!1,this._cancelScheduledPositionUpdate(),this._stopResizeObserver(),this._dialogElement.open&&this._dialogElement.close(),this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_startResizeObserver(){this._resizeObserver&&(this._isObservingResize||(this._resizeObserver.observe(this._popoverContainer),this._isObservingResize=!0),this._contentWrapper&&this._observedContentWrapper!==this._contentWrapper&&(this._observedContentWrapper&&this._resizeObserver.unobserve(this._observedContentWrapper),this._resizeObserver.observe(this._contentWrapper),this._observedContentWrapper=this._contentWrapper))}_stopResizeObserver(){this._resizeObserver?.disconnect(),this._isObservingResize=!1,this._observedContentWrapper=null}_cancelScheduledPositionUpdate(){this._positionFrameId!==null&&(cancelAnimationFrame(this._positionFrameId),this._positionFrameId=null),this._revealFrameId!==null&&(cancelAnimationFrame(this._revealFrameId),this._revealFrameId=null),this._positionVersion+=1,this.removeAttribute("positioned")}_readCoordinateAttr(t){let s=parseFloat(this.getAttribute(t)||"0");return Number.isFinite(s)?s:0}_schedulePositionUpdate(){this._isOpen&&(this.removeAttribute("positioned"),this._positionVersion+=1,this._positionFrameId===null&&(this._positionFrameId=requestAnimationFrame(()=>{if(this._positionFrameId=null,!this._isOpen)return;if(!this._dialogElement.open){this._schedulePositionUpdate();return}this._syncContentWrapper({reposition:!1}),this._startResizeObserver();let t=this._readCoordinateAttr("x"),s=this._readCoordinateAttr("y"),r=this.getAttribute("place")||"bs",i=this._popoverContainer.getBoundingClientRect(),{left:n,top:o}=this._calculatePosition(t,s,i.width,i.height,r);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${o}px`;let l=this._positionVersion;this._revealFrameId=requestAnimationFrame(()=>{this._revealFrameId=null,this._isOpen&&this._positionVersion===l&&this.setAttribute("positioned","")})})))}_calculatePosition(t,s,r,i,n){return Ir({x:t,y:s,width:r,height:i,place:n,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight})}get popover(){return this._popoverContainer}get content(){return this._contentWrapper}refreshContent(){this._syncContentWrapper()}},Tr=({render:e,html:t})=>as;var yo=(e,t)=>{let{store:s,render:r}=e;s.toggleOpen({}),r()},mo=Object.freeze(Object.defineProperty({__proto__:null,handleClickHeader:yo},Symbol.toStringTag,{value:"Module"})),go=()=>Object.freeze({open:!1}),bo=["id","class","style","slot","label","content"],vo=(e={})=>Object.entries(e).filter(([t])=>!bo.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),wo=({state:e,props:t})=>({label:t.label||"",content:t.content||"",openClass:e.open?"content-wrapper open":"content-wrapper",chevronIcon:e.open?"chevronUp":"chevronDown",containerAttrString:vo(t)}),_o=({state:e})=>{e.open=!e.open},xo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:go,selectViewData:wo,toggleOpen:_o},Symbol.toStringTag,{value:"Module"})),So=(e,t)=>{let{dispatchEvent:s,props:r}=e,i=t._event,n=Number(i.currentTarget.dataset.index),o=Array.isArray(r.items)?r.items[n]:void 0;if(o){if(o.disabled||o.current){i.preventDefault();return}typeof o.href=="string"&&o.href.length>0||i.preventDefault(),s(new CustomEvent("item-click",{detail:{id:o.id,path:o.path,href:o.href,item:o,index:n,trigger:i.type}}))}},Ao=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:So},Symbol.toStringTag,{value:"Module"})),ko=()=>Object.freeze({}),Eo=["id","class","style","slot","items","sep","max","separator"],$o=(e={})=>Object.entries(e).filter(([t])=>!Eo.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Co=e=>{if(e==null||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t},Io=e=>`${e}`.replace(/"/g,"""),Oo=(e,t)=>{if(!t||t<3||e.length<=t)return e;let s=t-2;return[e[0],{isEllipsis:!0,label:"..."},...e.slice(-s)]},To=e=>e.map((t,s)=>{let r=typeof t.href=="string"&&t.href.length>0,i=t.path!==void 0&&t.path!==null&&`${t.path}`!="",n=!!t.current,o=!!t.disabled,l=!n&&!o&&(r||i||!!t.click),p=t.rel||(t.newTab?"noopener noreferrer":""),a=[t.newTab?'target="_blank"':"",p?`rel="${Io(p)}"`:""].filter(Boolean).join(" ");return{...t,label:t.label||"",index:s,href:r?t.href:void 0,path:i?t.path:void 0,isCurrent:n,isDisabled:o,isInteractive:l,linkExtraAttrs:a,c:n?"fg":"mu-fg"}}),Lo=({props:e})=>{let t=$o(e),s=Array.isArray(e.items)?e.items:[],r=Co(e.max),i=e.sep||"breadcrumb-arrow",n=To(s),o=Oo(n,r),l=[];return o.forEach((p,a)=>{l.push(p),a<o.length-1&&l.push({isSeparator:!0})}),{containerAttrString:t,items:l,sep:i}},Vo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:ko,selectViewData:Lo},Symbol.toStringTag,{value:"Module"})),No=["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"],Lr={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"}},Ro=(e={})=>Object.entries(e).filter(([t])=>!No.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),jo=()=>Object.freeze({}),Do=({props:e={}})=>{let t=Lr[e.size]?e.size:"md",s=Lr[t];return{containerAttrString:Ro(e),cardAttrString:s.cardAttrString,headerAttrString:s.headerAttrString,headingSize:s.headingSize,subheadingSize:s.subheadingSize,head:e.head||"",desc:e.desc||"",hasHeader:!!(e.head||e.desc),size:t}},Po=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:jo,selectViewData:Do},Symbol.toStringTag,{value:"Module"})),Bo=(e={})=>e.type==="section"||e.type==="label"?"section":e.type==="separator"?"separator":"item",zo=(e,t)=>{let{dispatchEvent:s}=e;s(new CustomEvent("close"))},Wo=(e,t)=>{let{dispatchEvent:s,props:r}=e,i=t._event,n=Number(i.currentTarget.dataset.index??i.currentTarget.id.slice(6)),o=r.items[n],l=Bo(o);if(!o||l!=="item"||o.disabled){i.preventDefault();return}o.href||i.preventDefault(),s(new CustomEvent("item-click",{detail:{index:n,item:o,id:o.id,path:o.path,href:o.href,trigger:i.type}}))},Mo=Object.freeze(Object.defineProperty({__proto__:null,handleClickMenuItem:Wo,handleClosePopover:zo},Symbol.toStringTag,{value:"Module"})),Fo=()=>Object.freeze({}),Ko=e=>`${e}`.replace(/"/g,"""),Uo=(e={})=>e.type==="section"||e.type==="label"?"section":e.type==="separator"?"separator":"item",Ho=e=>e.map((t,s)=>{let r=Uo(t),i=r==="separator",n=r==="section",o=r==="item",l=!!t.disabled,p=o&&!l,a=Object.prototype.hasOwnProperty.call(t,"icon"),c=typeof t.icon=="string"&&t.icon.length>0?t.icon:"",d=typeof t.shortcut=="string"&&t.shortcut.length>0?t.shortcut:typeof t.suffixText=="string"&&t.suffixText.length>0?t.suffixText:"",h=l?"mu-fg":"fg",f=l?"mu":"",u=l?"":"ac",y=h,m="mu-fg",b=typeof t.href=="string"&&t.href.length>0,g=t.rel||(t.newTab?"noopener noreferrer":""),_=[t.newTab?'target="_blank"':"",g?`rel="${Ko(g)}"`:""].filter(Boolean).join(" ");return{...t,index:s,type:r,isSeparator:i,isSection:n,isItem:o,isDisabled:l,isInteractive:p,hasIconSlot:a,icon:c,hasIcon:c.length>0,suffixText:d,hasSuffixText:d.length>0,hasHref:b,linkExtraAttrs:_,c:h,bgc:f,hoverBgc:u,iconColor:y,suffixTextColor:m}}),qo=({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"}},Yo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Fo,selectViewData:qo},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},ms={NOT:0},$=class extends Error{constructor(e){super(`Parse Error: ${e}`),this.name="JemplParseError"}},de=class extends Error{constructor(e){super(`Render Error: ${e}`),this.name="JemplRenderError"}},Vr=e=>{if(!e||e.trim()==="")throw new $("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let s=e.includes("===")?"==":"!=";throw new $(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${s}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let s of t)if(e.trim().endsWith(s))throw new $(`Incomplete comparison expression - missing right operand (got: '${e}')`)},Go=e=>{if(e.trim().endsWith(" in"))throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new $(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,s]=e.split(" in ");if(!s||s.trim()==="")throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);let r=t.includes(",")?t.split(",").map(i=>i.trim()):[t.trim()];for(let i of r){if(!i)throw new $(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(i))throw new $(`Invalid loop syntax (got: '$for ${e}')`)}},Jo=(e,t,s=!1)=>{if(t===null)return new de(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new de(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return s?new de(`Cannot iterate over non-array value in loop '${e}' - got ${r} instead`):new de(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},Zo=(e,t)=>{let s=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new de(`Unknown function '${e}' (${s})`)},Xo=(e,t,s={})=>{let r={},i={};s&&typeof s=="object"&&(s.functions!==void 0||s.partials!==void 0?(r=s.functions||{},i=s.partials||{}):typeof s=="object"&&(r=s));let n=N(e,{functions:r,partials:i},t,{});return n===void 0?{}:n},N=(e,t,s,r)=>{if(t.functions,e.var&&!e.type)return K(e.var,s,r);if(e.type===w.LITERAL)return e.value;if(e.type===w.VARIABLE)return K(e.path,s,r);if(e.type===w.INTERPOLATION)return ea(e.parts,t,s,r);switch(e.type){case w.FUNCTION:return yi(e,t,s,r);case w.BINARY:return mi(e,t,s,r);case w.UNARY:return gi(e,t,s,r);case w.CONDITIONAL:return sa(e,t,s,r);case w.LOOP:return aa(e,t,s,r);case w.OBJECT:return pa(e,t,s,r);case w.ARRAY:return da(e,t,s,r);case w.PARTIAL:return ca(e,t,s,r);case w.PATH_REFERENCE:return ua(e,t,s,r);default:throw new Error(`Unknown node type: ${e.type}`)}},Nr=new Map,Qo=e=>{let t=[],s="",r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(n==="[")s&&(t.push({type:"property",value:s}),s=""),r=!0;else if(n==="]"){if(r&&s){let o=s.trim();if(/^\d+$/.test(o))t.push({type:"index",value:parseInt(o,10)});else if(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'")){let l=o.slice(1,-1);t.push({type:"property",value:l})}else t.push({type:"property",value:o});s=""}r=!1}else s+=n}return s&&t.push({type:"property",value:s}),t},K=(e,t,s)=>{if(!e)return;if(e in s)return s[e];let r=Nr.get(e);if(!r){let n=[],o="",l=0;for(let p=0;p<e.length;p++){let a=e[p];a==="["?(l++,o+=a):a==="]"?(l--,o+=a):a==="."&&l===0?o&&(n.push(o),o=""):o+=a}o&&n.push(o),r=[];for(let p of n){let a=Qo(p.trim());r.push(...a)}Nr.set(e,r)}let i=t;for(let n=0;n<r.length;n++){let o=r[n];if(o.type==="property"&&o.value in s){i=s[o.value];continue}if(i==null)return;(o.type==="property"||o.type==="index")&&(i=i[o.value])}return i},ea=(e,t,s,r)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let o=N(n,t,s,r);i.push(o!=null?String(o):"")}return i.join("")},yi=(e,t,s,r)=>{let i=t.functions||t,n=i[e.name];if(!n)throw Zo(e.name,i);let o=e.args.map(l=>N(l,t,s,r));return n(...o)},De=(e,t,s,r)=>{if(e.var&&!e.type)return K(e.var,s,r);switch(e.type){case w.VARIABLE:return K(e.path,s,r);case w.LITERAL:return e.value;case w.BINARY:return mi(e,t,s,r);case w.UNARY:return gi(e,t,s,r);case w.FUNCTION:return yi(e,t,s,r);default:return N(e,t,s,r)}},mi=(e,t,s,r)=>{if(e.op===D.AND||e.op===D.OR){let o=De(e.left,t,s,r),l=De(e.right,t,s,r);switch(e.op){case D.AND:return o&&l;case D.OR:return o||l}}let i=N(e.left,t,s,r),n=N(e.right,t,s,r);switch(e.op){case D.EQ:return i==n;case D.NEQ:return i!=n;case D.GT:return i>n;case D.LT:return i<n;case D.GTE:return i>=n;case D.LTE:return i<=n;case D.IN:return Array.isArray(n)?n.includes(i):!1;case D.ADD:if(typeof i!="number"||typeof n!="number")throw new de(`Arithmetic operations require numbers. Got ${typeof i} + ${typeof n}`);return i+n;case D.SUBTRACT:if(typeof i!="number"||typeof n!="number")throw new de(`Arithmetic operations require numbers. Got ${typeof i} - ${typeof n}`);return i-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},gi=(e,t,s,r)=>{let i=e.op===ms.NOT?De(e.operand,t,s,r):N(e.operand,t,s,r);switch(e.op){case ms.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},ta=(e,t,s,r)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===w.VARIABLE)if(K(i.path,s,r)){let n=e.bodies[0];if(n.type===w.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?N(l.parsedKey,t,s,r):l.key,a=l.value;if(a.type===w.LITERAL)o[p]=a.value;else if(a.type===w.VARIABLE)o[p]=K(a.path,s,r);else if(a.type===w.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let h=K(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=N(d,t,s,r);c.push(h!=null?String(h):"")}o[p]=c.join("")}else o[p]=N(a,t,s,r)}return o}}else{let n=e.bodies[1];if(n.type===w.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?N(l.parsedKey,t,s,r):l.key,a=l.value;if(a.type===w.LITERAL)o[p]=a.value;else if(a.type===w.VARIABLE)o[p]=K(a.path,s,r);else if(a.type===w.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let h=K(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=N(d,t,s,r);c.push(h!=null?String(h):"")}o[p]=c.join("")}else o[p]=N(a,t,s,r)}return o}}}return null},sa=(e,t,s,r)=>{let i=ta(e,t,s,r);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||De(o,t,s,r))return N(e.bodies[n],t,s,r)}return bi},ra=(e,t)=>{let s=e.body,r=e.itemVar;if(s.type===w.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===w.VARIABLE){let i=s.conditions[0].path,n=s.bodies[0];if(i.startsWith(r+".")){let o=i.substring(r.length+1);if(n.type===w.OBJECT&&n.properties.length<=5){for(let p of n.properties)if(p.parsedKey)return null;let l=[];for(let p=0;p<t.length;p++){let a=t[p];if(a[o]){let c={};for(let d of n.properties){let h=d.key,f=d.value;if(f.type===w.LITERAL)c[h]=f.value;else if(f.type===w.VARIABLE){let u=f.path;if(u===r)c[h]=a;else if(u.startsWith(r+".")){let y=u.substring(r.length+1);c[h]=a[y]}else return null}else if(f.type===w.INTERPOLATION){let u=[],y=!0;for(let m of f.parts)if(typeof m=="string")u.push(m);else if(m.type===w.VARIABLE){let b=m.path;if(b===r)u.push(a!=null?String(a):"");else if(b.startsWith(r+".")){let g=b.substring(r.length+1),_=a[g];u.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[h]=u.join("")}else return null}l.push(c)}}return l}}}return null},ia=(e,t)=>{let s=e.body,r=e.itemVar,i=ra(e,t);if(i!==null)return i;if(s.type===w.OBJECT&&s.properties.length<=5&&!s.whenCondition){for(let l of s.properties)if(l.parsedKey)return null;let n=[],o=!0;for(let l of s.properties){let p=l.key,a=l.value;if(a.type===w.LITERAL)n.push({key:p,type:"literal",value:a.value});else if(a.type===w.VARIABLE){let c=a.path;if(c===r)n.push({key:p,type:"item"});else if(c.startsWith(r+".")){let d=c.substring(r.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:p,type:"prop",prop:d});else{o=!1;break}}else{o=!1;break}}else if(a.type===w.INTERPOLATION&&a.parts.length===1){let c=a.parts[0];if(c.type===w.VARIABLE){let d=c.path;if(d===r)n.push({key:p,type:"item_string"});else if(d.startsWith(r+".")){let h=d.substring(r.length+1);if(!h.includes(".")&&!h.includes("["))n.push({key:p,type:"prop_string",prop:h});else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}if(o){let l=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 p=0;p<t.length;p++){let a=t[p];l[p]={id:a.id,title:a.title!=null?String(a.title):"",completed:a.completed}}else for(let p=0;p<t.length;p++){let a=t[p],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):""}l[p]=c}return l}}return null},na=(e,t,s,r,i)=>{let n=[],o=e.body;if(o.type===w.OBJECT&&o.fast!==!1){let l=e.itemVar,p=e.indexVar;for(let a=0;a<i.length;a++){let c=i[a],d={},h={...r,[l]:c,...p&&{[p]:a}};h.__paths__||(h.__paths__=r.__paths__||{});let f=e.iterable.path||"";if(r&&r.__paths__&&f){let u=f.split("."),y=u[0];y in r.__paths__&&(f=r.__paths__[y],u.length>1&&(f+="."+u.slice(1).join(".")))}h.__paths__={...h.__paths__,[l]:`${f}[${a}]`,...p&&{[p]:a}};for(let u of o.properties){let y=u.parsedKey?N(u.parsedKey,t,s,h):u.key,m=u.value;if(m.type===w.LITERAL)d[y]=m.value;else if(m.type===w.VARIABLE){let b=m.path;if(b===l)d[y]=c;else if(b===p)d[y]=a;else if(b.startsWith(l+".")){let g=b.substring(l.length+1);!g.includes(".")&&!g.includes("[")?d[y]=c[g]:d[y]=K(b,s,{...r,[l]:c,...p&&{[p]:a}})}else d[y]=K(b,s,{...r,[l]:c,...p&&{[p]:a}})}else if(m.type===w.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=g.path,S;if(_===l)S=c;else if(_===p)S=a;else if(_.startsWith(l+".")){let A=_.substring(l.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=K(_,s,{...r,[l]:c,...p&&{[p]:a}})}else S=K(_,s,{...r,[l]:c,...p&&{[p]:a}});b.push(S!=null?String(S):"")}else{let _={...r,[l]:c,...p&&{[p]:a}},S=N(g,t,s,_);b.push(S!=null?String(S):"")}d[y]=b.join("")}else{let b={...r,[l]:c,...p&&{[p]:a}};d[y]=N(m,t,s,b)}}n.push(d)}return n}return null},oa=(e,t,s)=>{let r=e.body;if(r.type===w.OBJECT&&r.properties.length===1&&r.properties[0].key==="$if item.visible"){let i=r.properties[0].value;if(i.type===w.CONDITIONAL&&i.conditions.length===1&&i.conditions[0].type===w.VARIABLE&&i.conditions[0].path==="item.visible"){let n=i.bodies[0];if(n.type===w.OBJECT&&n.properties.length===2){let o=n.properties[0],l=n.properties[1];if(o.key==="id"&&o.value.type===w.VARIABLE&&o.value.path==="item.id"&&l.key==="$if item.highlighted"&&l.value.type===w.CONDITIONAL){let p=[];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),p.push(d)}}return p}}}}return null},aa=(e,t,s,r)=>{let i=N(e.iterable,t,s,r);if(!Array.isArray(i)){let a,c=!1;if(e.iterable.type===w.FUNCTION){c=!0;let h=e.iterable.args.map(f=>f.type===w.LITERAL?typeof f.value=="string"?`'${f.value}'`:String(f.value):f.type===w.VARIABLE?f.path:f.type===w.FUNCTION?`${f.name}(...)`:"?").join(", ");a=`${e.iterable.name}(${h})`}else a=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${a}`;throw Jo(d,i,c)}if(!e.indexVar){let a=oa(e,i,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=ia(e,i);if(a!==null)return a}let n=na(e,t,s,r,i);if(n!==null)return n;let o=[],l=e.iterable.path||"";if(r&&r.__paths__&&l){let a=l.split("."),c=a[0];c in r.__paths__&&(l=r.__paths__[c],a.length>1&&(l+="."+a.slice(1).join(".")))}let p=!1;e.body.type===w.ARRAY&&(e.body.items.length<=1?p=!1:p=e.body._shouldPreserveArray??=e.body.items.some(a=>a.type===w.OBJECT&&a.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let a=0;a<i.length;a++){let c=e.indexVar?{...r,[e.itemVar]:i[a],[e.indexVar]:a}:{...r,[e.itemVar]:i[a]};c.__paths__||(c.__paths__=r.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${l}[${a}]`},e.indexVar&&(c.__paths__[e.indexVar]=a);let d=N(e.body,t,s,c);if(Array.isArray(d)&&d.length===1&&!p){let h=d[0];o.push(h===void 0?{}:h)}else o.push(d===void 0?{}:d)}return o},la=(e,t,s,r)=>{if(e.whenCondition)return null;if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?N(i.parsedKey,t,s,r):i.key,o=i.value;if(o.type===w.OBJECT&&o.properties.length<=10&&!o.whenCondition){let l={},p={},a=!0;for(let c of o.properties){let d=c.parsedKey?N(c.parsedKey,t,s,r):c.key,h=c.value;if(h.type===w.LITERAL)p[d]=h.value;else if(h.type===w.VARIABLE)p[d]=K(h.path,s,r);else if(h.type===w.INTERPOLATION){let f=[];for(let u of h.parts)if(typeof u=="string")f.push(u);else if(u.type===w.VARIABLE){let y=K(u.path,s,r);f.push(y!=null?String(y):"")}else{a=!1;break}if(!a)break;p[d]=f.join("")}else if(h.type===w.OBJECT&&h.properties.length<=5){let f={};for(let u of h.properties){let y=u.key,m=u.value;if(m.type===w.LITERAL)f[y]=m.value;else if(m.type===w.VARIABLE)f[y]=K(m.path,s,r);else if(m.type===w.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=K(g.path,s,r);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[y]=b.join("")}else{a=!1;break}}if(!a)break;p[d]=f}else{a=!1;break}}if(a)return l[n]=p,l}}return null},pa=(e,t,s,r)=>{let i=t.functions||t;if(e.whenCondition&&!De(e.whenCondition,i,s,r))return;let n=la(e,t,s,r);if(n!==null)return n;if(e.fast){let p={};for(let a of e.properties){let c=a.parsedKey?N(a.parsedKey,t,s,r):a.key,d=a.value;if(d.type===w.LITERAL)p[c]=d.value;else if(d.type===w.VARIABLE)p[c]=K(d.path,s,r);else if(d.type===w.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===w.VARIABLE){let u=K(f.path,s,r);h.push(u!=null?String(u):"")}else{let u=N(f,t,s,r);h.push(u!=null?String(u):"")}p[c]=h.join("")}else p[c]=N(d,t,s,r)}return p}let o={},l=!1;for(let p of e.properties)if(!p.key.startsWith("$if ")&&!p.key.match(/^\$if\s+\w+.*:?$/)&&!p.key.startsWith("$elif")&&!p.key.startsWith("$else")&&!p.key.startsWith("$for ")){l=!0;break}for(let p of e.properties)if(p.key.startsWith("$if ")||p.key.match(/^\$if\s+\w+.*:?$/)){let a=N(p.value,t,s,r);if(!l&&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(p.key.startsWith("$for ")){if(e.properties.length===1)return N(p.value,t,s,r)}else{let a=p.value;if(a&&a.type===w.OBJECT&&a.properties){let c=a.properties.find(d=>d.key.startsWith("$for "));if(c){let d=N(c.value,t,s,r);d!==void 0&&(o[p.key]=d)}else{let d=N(p.value,t,s,r);d!==void 0&&(o[p.key]=d)}}else{let c=p.parsedKey?N(p.parsedKey,t,s,r):p.key,d=N(p.value,t,s,r);d!==void 0&&(o[c]=d)}}return o},bi={},da=(e,t,s,r)=>{let i=[];for(let n of e.items)if(n.type===w.LOOP){let o=N(n,t,s,r);Array.isArray(o)&&n.flatten!==!1?i.push(...o):i.push(o)}else{let o=N(n,t,s,r);o!==bi&&o!==void 0&&i.push(o)}return i},ca=(e,t,s,r)=>{let{name:i,data:n,whenCondition:o}=e,l=t.partials||{},p=t.functions||t;if(o&&!De(o,p,s,r))return;if(!l[i])throw new de(`Partial '${i}' is not defined`);let a=r._partialStack||[];if(a.includes(i))throw new de(`Circular partial reference detected: ${i}`);let c=l[i],d=s,h={...r,_partialStack:[...a,i]};if(r){d={...s};for(let f of Object.keys(r))f.startsWith("_")||(d[f]=r[f])}if(n){let f=N(n,t,s,r);d={...d,...f}}return N(c,t,d,h)},ua=(e,t,s,r)=>{let{path:i}=e,n=i.split("."),o=n[0],l=n.slice(1);if(!r||!(o in r))throw new de(`Path reference '#{${i}}' refers to '${o}' which is not a loop variable in the current scope`);if(r.__paths__||(r.__paths__={}),!(o in r.__paths__))throw new de(`Path reference '#{${i}}' cannot be resolved - path tracking may not be initialized properly`);let p=r.__paths__[o];if(typeof p=="number"){if(l.length>0)throw new de(`Path reference '#{${i}}' - cannot access properties on index variable '${o}'`);return String(p)}return l.length>0&&(p+="."+l.join(".")),p},ha=/\$\{([^}]*)\}/g,fa=/#\{([^}]*)\}/g,vi=(e,t={})=>{let s=e.match(/^(\w+)\((.*)\)$/);if(!s)return{isFunction:!1};let[,r,i]=s,n=ya(i,t);return{isFunction:!0,type:w.FUNCTION,name:r,args:n}},ya=(e,t={})=>e.trim()?ma(e).map(s=>ga(s.trim(),t)):[],ma=e=>{let t=[],s="",r=0,i=!1,n="";for(let o=0;o<e.length;o++){let l=e[o],p=o>0?e[o-1]:"";!i&&(l==='"'||l==="'")?(i=!0,n=l,s+=l):i&&l===n&&p!=="\\"?(i=!1,n="",s+=l):!i&&l==="("?(r++,s+=l):!i&&l===")"?(r--,s+=l):!i&&l===","&&r===0?(t.push(s),s=""):s+=l}return s&&t.push(s),t},ga=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:w.LITERAL,value:parseFloat(e)};if(e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};let s=vi(e,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};let r=e.trim(),i=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:o,type:l}of i){let p=0;for(;p<r.length;){let a=Le(r.substring(p),o);if(a===-1)break;let c=p+a;c>n&&(n=c),p=c+o.length}}if(n!==-1)try{return X(r,t)}catch{return{type:w.VARIABLE,path:r}}return{type:w.VARIABLE,path:r}},wi=/^\w+\(.*\)$/,ba=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,va=e=>{if(!(!e||e.trim()===""||wi.test(e))&&ba.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}"`)},Rr=e=>{let t=e.trim();if(wi.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}},mt=(e,t={})=>{let s=e.trim();va(s);let r=vi(s,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};if(s.includes("[")&&!/[\s+\-*/%|&?:]/.test(s)){let i=0;for(let n of s)n==="["?i++:n==="]"&&i--;if(i!==0)throw new Error("Invalid array index syntax")}return{type:w.VARIABLE,path:s}},_i=(e,t={})=>{let s=e,r=[];(e.includes("\\${")||e.includes("\\#{"))&&(s=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),s=s.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),s=s.replace(/\\(\$\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\(#\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\DOUBLE_ESC_VAR/g,"\\"),s=s.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let i=[...s.matchAll(ha)],n=[...s.matchAll(fa)],o=[...i.map(a=>({match:a,type:"variable"})),...n.map(a=>({match:a,type:"pathref"}))].sort((a,c)=>a.match.index-c.match.index);if(o.length===0){let a=s;for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);return{type:w.LITERAL,value:a}}if(o.length===1&&o[0].match[0]===s&&r.length===0){let{match:a,type:c}=o[0];try{return c==="variable"?mt(a[1],t):Rr(a[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:w.LITERAL,value:s};throw d}}let l=[],p=0;for(let{match:a,type:c}of o){let[d,h]=a,f=a.index;if(f>p){let u=s.substring(p,f);for(let y=0;y<r.length;y++)u=u.replace(`__ESCAPED_${y}__`,r[y]);u&&l.push(u)}try{let u;c==="variable"?u=mt(h.trim(),t):u=Rr(h.trim()),l.push(u)}catch(u){if(u.message==="Invalid array index syntax")l.push(d);else throw u}p=f+d.length}if(p<s.length){let a=s.substring(p);for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);a&&l.push(a)}return{type:w.INTERPOLATION,parts:l}},ke=(e,t)=>typeof e=="string"?_i(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?_a(e,t):xa(e,t):{type:w.LITERAL,value:e},wa=e=>{let{$each:t,...s}=e;if(typeof t!="string")throw new $("$each value must be a non-empty string");let r=t.trim();if(r==="")throw new $("$each value must be a non-empty string");if(Object.keys(s).length===0)throw new $("Empty $each body not allowed");if(s.$partial!==void 0)throw new $("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${r}`]:s}},_a=(e,t)=>{let s=[],r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let p=wa(n),a=Object.keys(p);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let c=jr(a[0],p[a[0]],t,!0);s.push(c),r=!0;continue}}catch(p){throw p instanceof $?p:new $(p.message)}let l=Object.keys(n);if(l.length===1&&/^\$for(?::\w+)?\s/.test(l[0])){let p=jr(l[0],n[l[0]],t);s.push(p),r=!0;continue}}let o=ke(n,t);s.push(o),(o.type===w.FUNCTION||o.type===w.CONDITIONAL||o.type===w.LOOP||o.type===w.PARTIAL||o.type===w.OBJECT&&!o.fast||o.type===w.ARRAY&&!o.fast)&&(r=!0)}return{type:w.ARRAY,items:s,fast:!r}},xa=(e,t)=>{let s=[],r=!1,i=null,n=Object.entries(e),o=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new $("$partial value must be a string");if(e.$partial.trim()==="")throw new $("$partial value cannot be an empty string");let p=["$if","$elif","$else","$for"],a=[];for(let[b]of n)for(let g of p)if(b===g||b.startsWith(g+" ")||b.startsWith(g+"#")){a.push(g);break}if(a.length>0)throw new $(`Cannot use $partial with ${a.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...h}=e,f={},u=!1;for(let[b,g]of Object.entries(h)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=g,u=!0}let y=null;if(u&&(y=ke(f,t),y.type===w.OBJECT)){let b=!1;for(let g of y.properties)if(g.value.type===w.VARIABLE||g.value.type===w.INTERPOLATION||g.value.type===w.FUNCTION||g.value.type===w.CONDITIONAL||g.value.type===w.OBJECT&&!g.value.fast||g.value.type===w.ARRAY&&!g.value.fast){b=!0;break}b&&(y.fast=!1)}let m={type:w.PARTIAL,name:c,data:y};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new $("Empty condition expression after '$when'");b=X(d,t)}else b={type:w.LITERAL,value:d};m.whenCondition=b}return m}for(let[p,a]of n)if(p==="$when"){if(i!==null)throw new $("Multiple '$when' directives on the same object are not allowed");if(a==null)throw new $("Missing condition expression after '$when'");let c=typeof a=="string"?a:JSON.stringify(a);if(c.trim()==="")throw new $("Empty condition expression after '$when'");i=X(c,t),r=!0}else if(p.startsWith("$when#")||p.startsWith("$when "))throw new $("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;o<n.length;){let[p,a]=n[o];if(p==="$when"){o++;continue}if(p==="$each")throw new $("$each can only be used inside arrays");if(p.startsWith("$if ")||p.match(/^\$if#\w+\s/)||p.match(/^\$if\s+\w+.*:$/)){let c=Sa(n,o,t);s.push({key:p,value:c.node}),r=!0,o=c.nextIndex}else if(/^\$for(?::\w+)?\s/.test(p)){let c=p.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(p.startsWith("$elif ")||p.startsWith("$else"))throw new $(`'${p.split(" ")[0]}' without matching '$if'`);if(p==="$if"||p==="$if:")throw new $("Missing condition expression after '$if'");{let c=ke(a,t);(c.type===w.FUNCTION||c.type===w.CONDITIONAL||c.type===w.PARTIAL||c.type===w.OBJECT&&!c.fast||c.type===w.ARRAY&&!c.fast)&&(r=!0);let d=_i(p,t),h={key:p,value:c};(d.type!==w.LITERAL||d.value!==p)&&(h.parsedKey=d),s.push(h),o++}}}let l={type:w.OBJECT,properties:s,fast:!r};return i&&(l.whenCondition=i),l},Sa=(e,t,s={})=>{let r=[],i=[],n=t,[o,l]=e[n],p=null,a;if(o.startsWith("$if#")){let d=o.match(/^\$if#(\w+)\s+(.+)$/);if(d)p=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());Vr(a);let c=X(a,s);for(r.push(c),i.push(ke(l,s)),n++;n<e.length;){let[d,h]=e[n],f=!1,u;if(p?d.startsWith(`$elif#${p} `)?(u=d.substring(`$elif#${p} `.length),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d===`$else#${p}`||d===`$else#${p}:`)&&(f=!0,u=null):d.startsWith("$elif ")?(u=d.substring(6),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,u=null),f){if(u===null)r.push(null);else{Vr(u);let y=X(u,s);r.push(y)}if(i.push(ke(h,s)),n++,u===null)break}else break}return{node:{type:w.CONDITIONAL,conditions:r,bodies:i,id:p},nextIndex:n}},X=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let a=e.slice(1,-1),c=0,d=!0;for(let h=0;h<a.length;h++)if(a[h]==="("?c++:a[h]===")"&&c--,c<0){d=!1;break}if(d&&c===0)return X(a,t)}let s=Le(e,"||");if(s!==-1)return{type:w.BINARY,op:D.OR,left:X(e.substring(0,s).trim(),t),right:X(e.substring(s+2).trim(),t)};let r=Le(e,"&&");if(r!==-1)return{type:w.BINARY,op:D.AND,left:X(e.substring(0,r).trim(),t),right:X(e.substring(r+2).trim(),t)};let i=[{op:">=",type:D.GTE},{op:"<=",type:D.LTE},{op:"==",type:D.EQ},{op:"!=",type:D.NEQ},{op:">",type:D.GT},{op:"<",type:D.LT},{op:" in ",type:D.IN}];for(let{op:a,type:c}of i){let d=Le(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,l=[{op:" + ",type:D.ADD},{op:" - ",type:D.SUBTRACT}];for(let{op:a,type:c}of l){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:w.BINARY,op:o.type,left:X(e.substring(0,n).trim(),t),right:X(e.substring(n+o.op.length).trim(),t)};let p=[" * "," / "," % "];for(let a of p)if(Le(e,a)!==-1)throw new $(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:w.UNARY,op:ms.NOT,operand:X(e.substring(1).trim(),t)}:xi(e,t)},Le=(e,t)=>{let s=0,r=0;for(;r<=e.length-t.length;){if(e[r]==="(")s++;else if(e[r]===")")s--;else if(s===0&&e.substring(r,r+t.length)===t)return r;r++}return-1},Aa=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}},xi=(e,t)=>{let s=e.trim();if(s.match(/^(\w+)\((.*)\)$/))return mt(s,t);let r=Aa(s);if(r.type===w.LITERAL)return r;if(/^[a-zA-Z_$][\w.$]*$/.test(s))return{type:w.VARIABLE,path:s};try{return mt(s,t)}catch(i){if(i.message&&i.message.includes("not supported"))return r;throw i}},ka=(e,t=!1)=>{try{Go(e)}catch(s){if(s instanceof $&&t){let r=s.message.replace(/\$for/g,"$each");throw new $(r.replace("Parse Error: ",""))}throw s}},jr=(e,t,s,r=!1)=>{let i=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(i);if(!n){let m=r?"$each":"$for";throw new $(`Invalid loop syntax (got: '${e.replace("$for",m)}')`)}let o=n[1],l=n[2].trim();ka(l,r);let p=l.match(/^(.+?)\s+in\s+(.+)$/);if(!p){let m=r?"$each":"$for";throw new $(`Invalid loop syntax - missing 'in' keyword (got: '${m} ${l}')`)}let a=p[1].trim(),c=p[2].trim(),d,h=null;if(a.includes(",")){let m=a.split(",").map(b=>b.trim());if(m.length!==2)throw new $(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=m[0],h=m[1]}else d=a;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new $(`Reserved variable name: ${d}`);if(h&&f.includes(h))throw new $(`Reserved variable name: ${h}`);let u=xi(c,s),y=ke(t,s);return{type:w.LOOP,itemVar:d,indexVar:h,iterable:u,body:y,flatten:o!=="nested"}},Dr=(e,t={})=>{let{functions:s={}}=t;return ke(e,s)},Ea=()=>Date.now(),$a=Object.freeze(Object.defineProperty({__proto__:null,now:Ea},Symbol.toStringTag,{value:"Module"})),Ca=(e,t,s={})=>{let{functions:r={},partials:i={}}=s,n={...$a,...r},o=Dr(e,{functions:n}),l={};for(let[p,a]of Object.entries(i))l[p]=Dr(a,{functions:n});return Xo(o,t,{functions:n,partials:l})},js=e=>e!==null&&typeof e=="object",gt=e=>js(e)&&!Array.isArray(e),Ia=e=>typeof e=="string"&&e.includes("."),Si=e=>typeof e=="string"&&/[\[\]]/.test(e);function Ai(e,t){let s={};for(let r of t){if(typeof r!="string"||r.length===0)continue;let i=ne(e,r);i!==void 0&&he(s,r,i)}return s}function Oa(e){if(!gt(e)||!Array.isArray(e.fields))return e;let t=(s=[])=>s.map(r=>{if(!gt(r))return r;if(typeof r.$when=="string"&&r.$when.trim().length>0){let{$when:i,...n}=r,o=Array.isArray(n.fields)?{...n,fields:t(n.fields)}:n;return{[`$if ${i}`]:o}}return Array.isArray(r.fields)?{...r,fields:t(r.fields)}:r});return{...e,fields:t(e.fields)}}var ne=(e,t,s=void 0)=>{if(!t||!js(e)||Si(t))return s;let r=t.split(".").filter(n=>n!==""),i=e;for(let n of r){if(i==null||!(n in i))return Object.prototype.hasOwnProperty.call(e,t)?e[t]:s;i=i[n]}return i},he=(e,t,s)=>{if(!js(e)||typeof t!="string"||t.length===0||Si(t))return e;let r=t.split(".").filter(n=>n!=="");if(r.length===0)return e;Ia(t)&&Object.prototype.hasOwnProperty.call(e,t)&&delete e[t];let i=e;for(let n=0;n<r.length-1;n++){let o=r[n];(!(o in i)||typeof i[o]!="object"||i[o]===null)&&(i[o]={}),i=i[o]}return i[r[r.length-1]]=s,e},Ta=["id","class","style","slot","form","defaultValues","disabled","context"],La=(e={})=>Object.entries(e).filter(([t,s])=>!(Ta.includes(t)||s==null||typeof s=="object"||typeof s=="function")).map(([t,s])=>`${t}=${String(s)}`).join(" "),Va={email:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,url:/^https?:\/\/.+/},ue={required:"This field is required",minLength:e=>`Must be at least ${e} characters`,maxLength:e=>`Must be at most ${e} characters`,pattern:"Invalid format",invalidDate:"Invalid date format",invalidTime:"Invalid time format",invalidDateTime:"Invalid date and time format",minTemporal:e=>`Must be on or after ${e}`,maxTemporal:e=>`Must be on or before ${e}`},Na="input-date",Ra="input-time",ja="input-datetime",Da=/^(\d{4})-(\d{2})-(\d{2})$/,Pa=/^(\d{2}):(\d{2})(?::(\d{2}))?$/,Ba=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}(?::\d{2})?)$/,za=e=>{if(typeof e!="string")return null;let t=Da.exec(e);if(!t)return null;let s=Number(t[1]),r=Number(t[2]),i=Number(t[3]);if(!Number.isInteger(s)||!Number.isInteger(r)||!Number.isInteger(i)||r<1||r>12||i<1||i>31)return null;let n=new Date(Date.UTC(s,r-1,i));return n.getUTCFullYear()===s&&n.getUTCMonth()===r-1&&n.getUTCDate()===i?{year:s,month:r,day:i}:null},Wa=e=>{if(typeof e!="string")return null;let t=Pa.exec(e);if(!t)return null;let s=Number(t[1]),r=Number(t[2]),i=t[3]===void 0?0:Number(t[3]);return!Number.isInteger(s)||!Number.isInteger(r)||!Number.isInteger(i)||s<0||s>23||r<0||r>59||i<0||i>59?null:{hour:s,minute:r,second:i}},ki=e=>{let t=Wa(e);return t?`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}`:null},Ei=e=>za(e)?e:null,Ma=e=>{if(typeof e!="string")return null;let t=Ba.exec(e);if(!t)return null;let s=Ei(t[1]),r=ki(t[2]);return!s||!r?null:`${s}T${r}`},Fa=e=>e===Na?{normalize:Ei,invalidMessage:ue.invalidDate}:e===Ra?{normalize:ki,invalidMessage:ue.invalidTime}:e===ja?{normalize:Ma,invalidMessage:ue.invalidDateTime}:null,Ka=(e,t)=>{let s=Fa(e.type);if(!s||t==null||t==="")return null;let r=s.normalize(String(t));if(!r)return s.invalidMessage;if(e.min!==void 0&&e.min!==null&&String(e.min)!==""){let i=s.normalize(String(e.min));if(i&&r<i)return ue.minTemporal(String(e.min))}if(e.max!==void 0&&e.max!==null&&String(e.max)!==""){let i=s.normalize(String(e.max));if(i&&r>i)return ue.maxTemporal(String(e.max))}return null},Et=(e,t)=>{if(e.required){let r=t==null||t===""||Array.isArray(t)&&t.length===0||typeof t=="boolean"&&t===!1,i=e.type==="input-number"&&t===null;if(e.type==="input-number"?i:r)return typeof e.required=="object"&&e.required.message?e.required.message:ue.required}let s=Ka(e,t);if(s)return s;if(Array.isArray(e.rules))for(let r of e.rules){let i=Ua(r,t);if(i)return i}return null},Ua=(e,t)=>{if(t==null||t==="")return null;let s=String(t);switch(e.rule){case"minLength":return s.length<e.value?e.message||ue.minLength(e.value):null;case"maxLength":return s.length>e.value?e.message||ue.maxLength(e.value):null;case"pattern":{let r=Va[e.value];if(!r)try{r=new RegExp(e.value)}catch{return e.message||ue.pattern}return r.test(s)?null:e.message||ue.pattern}default:return null}},$t=(e,t)=>{let s={},r=ie(e);for(let i of r){let n=ne(t,i.name),o=Et(i,n);o&&(s[i.name]=o)}return{valid:Object.keys(s).length===0,errors:s}},Ha=["section","read-only-text","slot"],Ds=e=>!Ha.includes(e.type),ie=e=>{let t=[];for(let s of e)s.type==="section"&&Array.isArray(s.fields)?t.push(...ie(s.fields)):Ds(s)&&t.push(s);return t},Ps=e=>{switch(e.type){case"input-text":case"input-date":case"input-time":case"input-datetime":case"input-textarea":case"popover-input":return"";case"input-number":return null;case"select":case"segmented-control":return null;case"tag-select":return[];case"checkbox":return!1;case"color-picker":return"#000000";case"slider":case"slider-with-input":return e.min!==void 0?e.min:0;case"image":return null;default:return null}},Bs=(e,t=0)=>{let s=[],r=t;for(let i of e)if(i.type==="section"){if(s.push({...i,_isSection:!0,_idx:r}),r++,Array.isArray(i.fields)){let n=Bs(i.fields,r);s.push(...n),r+=n.length}}else s.push({...i,_isSection:!1,_idx:r}),r++;return s},qa=()=>Object.freeze({formValues:{},errors:{},reactiveMode:!1,tooltipState:{open:!1,x:0,y:0,content:""}}),ee=({state:e,props:t})=>{let{form:s={}}=t||{},r=Oa(s),i=gt(t?.context)?t.context:{},n=gt(e?.formValues)?e.formValues:{},o={...i,...n,formValues:n};return Object.keys(o).length>0?Ca(r,o):r},Ya=({state:e,props:t})=>{let s=La(t),r=ee({state:e,props:t}),i=r.fields||[],n=!!t?.disabled,o=Bs(i);o.forEach(d=>{if(d._isSection)return;let h=Ds(d);if(d._disabled=n||!!d.disabled,h&&d.name&&(d._error=e.errors[d.name]||null),d.type==="input-text"&&(d._inputType=d.inputType||"text"),d.type==="select"||d.type==="tag-select"||d.type==="segmented-control"){let f=ne(e.formValues,d.name);d._selectedValue=f!==void 0?f:null,d._selectedValues=Array.isArray(f)?f:[],d.placeholder=d.placeholder||"",d.noClear=d.clearable===!1}if(d.type==="image"){let f=ne(e.formValues,d.name);d._imageSrc=f&&String(f).trim()?f:null,d.placeholderText=d.placeholderText||"No Image"}if(d.type==="read-only-text"&&(d.content=d.content||""),d.type==="checkbox"){let f=typeof d.content=="string"?d.content:typeof d.checkboxLabel=="string"?d.checkboxLabel:"";d._checkboxText=f}});let l=r.actions||{buttons:[]},p=l.layout||"split",a=(l.buttons||[]).map((d,h)=>({...d,_globalIdx:h,variant:d.variant||"se",_disabled:n||!!d.disabled,pre:d.pre||"",suf:d.suf||""})),c;return p==="split"?c={_layout:"split",buttons:a,_leftButtons:a.filter(d=>d.align==="left"),_rightButtons:a.filter(d=>d.align!=="left")}:c={_layout:p,buttons:a,_allButtons:a},{containerAttrString:s,title:r?.title||"",description:r?.description||"",flatFields:o,actions:c,formValues:e.formValues,tooltipState:e.tooltipState}},Ie=({state:e,props:t})=>{let s=ee({state:e,props:t}),r=ie(s.fields||[]);return Ai(e.formValues,r.map(i=>i.name).filter(i=>typeof i=="string"&&i.length>0))},Ga=({state:e,props:t},s={})=>{let{name:r,value:i}=s;r&&(he(e.formValues,r,i),rt({state:e,props:t}))},rt=({state:e,props:t})=>{if(!t)return;let s=ee({state:e,props:t}),r=ie(s.fields||[]);e.formValues=Ai(e.formValues,r.map(i=>i.name).filter(i=>typeof i=="string"&&i.length>0))},Ja=({state:e},t={})=>{let{values:s}=t;!s||typeof s!="object"||Object.keys(s).forEach(r=>{he(e.formValues,r,s[r])})},Za=({state:e},t={})=>{let{defaultValues:s={}}=t;e.formValues=s?structuredClone(s):{},e.errors={},e.reactiveMode=!1},Xa=({state:e},t={})=>{e.errors=t.errors||{}},Qa=({state:e},t={})=>{let{name:s}=t;s&&e.errors[s]&&delete e.errors[s]},el=({state:e})=>{e.reactiveMode=!0},tl=({state:e},t={})=>{let{x:s,y:r,content:i}=t;e.tooltipState={open:!0,x:s,y:r,content:i}},sl=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},rl=Object.freeze(Object.defineProperty({__proto__:null,clearFieldError:Qa,collectAllDataFields:ie,createInitialState:qa,flattenFields:Bs,get:ne,getDefaultValue:Ps,hideTooltip:sl,isDataField:Ds,pruneHiddenValues:rt,resetFormValues:Za,selectForm:ee,selectFormValues:Ie,selectViewData:Ya,set:he,setErrors:Xa,setFormFieldValue:Ga,setFormValues:Ja,setReactiveMode:el,showTooltip:tl,validateField:Et,validateForm:$t},Symbol.toStringTag,{value:"Module"})),$i=({field:e,target:t,value:s})=>{!e||!t||["slider-with-input","popover-input"].includes(e.type)&&(s==null?t.removeAttribute("value"):t.setAttribute("value",String(s)))},Ci=({form:e,formValues:t={},refs:s,formDisabled:r=!1})=>{let i=e.fields||[],n=0,o=l=>{for(let p of l){if(p.type==="section"){n++,Array.isArray(p.fields)&&o(p.fields);continue}let a=s[`field${n}`];if(n++,!a)continue;let c=r||!!p.disabled;if(["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"].includes(p.type)){let d=ne(t,p.name);if(d==null?a.removeAttribute("value"):a.setAttribute("value",String(d)),p.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()}p.type==="popover-input"&&a.store?.setValue&&(a.store.setValue({value:d==null?"":String(d)}),typeof a.render=="function"&&a.render())}if(p.type==="tag-select"&&a.store?.updateSelectedValues){let d=ne(t,p.name);a.store.updateSelectedValues({values:Array.isArray(d)?d:[]}),typeof a.render=="function"&&a.render()}p.type==="checkbox"&&(ne(t,p.name)?a.setAttribute("checked",""):a.removeAttribute("checked")),["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input"].includes(p.type)&&p.placeholder&&a.getAttribute("placeholder")!==p.placeholder&&(p.placeholder===void 0||p.placeholder===null?a.removeAttribute("placeholder"):a.setAttribute("placeholder",p.placeholder)),c?a.setAttribute("disabled",""):a.removeAttribute("disabled")}};o(i)},Ii=(e,t)=>{let s=t?.defaultValues||{},r={};Object.keys(s).forEach(l=>{he(r,l,s[l])});let i=ee({state:{formValues:r},props:t}),n=ie(i.fields||[]),o={};for(let l of n){let p=ne(s,l.name);p!==void 0?he(o,l.name,p):he(o,l.name,Ps(l))}e.resetFormValues({defaultValues:o})},il=e=>{let{store:t,props:s}=e;Ii(t,s)},nl=e=>{let{props:t,refs:s,render:r}=e,i=e.store.getState(),n=ee({state:i,props:t});Ci({form:n,formValues:i.formValues,refs:s,formDisabled:!!t?.disabled}),r()},ol=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n,refs:o}=e,l=!!r?.disabled;s?.key!==r?.key&&Ii(i,r);let p=i.getState();rt({state:p,props:r});let a=ee({state:p,props:r});Ci({form:a,formValues:p.formValues,refs:o,formDisabled:l}),n()},al=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event,l=o.currentTarget.dataset.fieldName;if(!l||!o.detail||!Object.prototype.hasOwnProperty.call(o.detail,"value"))return;let p=o.detail.value;s.setFormFieldValue({name:l,value:p});let a=s.getState();rt({state:a,props:n});let c=ee({state:a,props:n}),d=ie(c.fields||[]).find(h=>h.name===l);if($i({field:d,target:o.currentTarget,value:p}),a.reactiveMode&&d){let h=Et(d,p);h?s.setErrors({errors:{...a.errors,[l]:h}}):s.clearFieldError({name:l})}i(),r(new CustomEvent("form-input",{bubbles:!0,detail:{name:l,value:p,values:Ie({state:s.getState(),props:n})}}))},ll=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event,l=o.currentTarget.dataset.fieldName;if(!l||!o.detail||!Object.prototype.hasOwnProperty.call(o.detail,"value"))return;let p=o.detail.value;s.setFormFieldValue({name:l,value:p});let a=s.getState();rt({state:a,props:n});let c=ee({state:a,props:n}),d=ie(c.fields||[]).find(h=>h.name===l);if($i({field:d,target:o.currentTarget,value:p}),a.reactiveMode&&d){let h=Et(d,p);h?s.setErrors({errors:{...a.errors,[l]:h}}):s.clearFieldError({name:l})}i(),r(new CustomEvent("form-change",{bubbles:!0,detail:{name:l,value:p,values:Ie({state:s.getState(),props:n})}}))},pl=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event.currentTarget.dataset.actionId;if(!o)return;let l=s.getState(),p=ee({state:l,props:n}),a=((p.actions||{}).buttons||[]).find(d=>d.id===o),c=Ie({state:l,props:n});if(a&&a.validate){let d=ie(p.fields||[]),{valid:h,errors:f}=$t(d,l.formValues);s.setErrors({errors:f}),h||s.setReactiveMode(),i(),r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:o,values:c,valid:h,errors:f}}))}else r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:o,values:c}}))},dl=(e,t)=>{let s=t._event;s.type==="contextmenu"&&s.preventDefault();let{store:r,dispatchEvent:i,props:n}=e,o=s.currentTarget.dataset.fieldName;i(new CustomEvent("form-field-event",{bubbles:!0,detail:{name:o,event:s.type,values:Ie({state:r.getState(),props:n})}}))},cl=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event;if(o.key==="Enter"&&!o.shiftKey){let l=o.target;if(l.tagName==="TEXTAREA"||l.tagName==="RTGL-TEXTAREA")return;o.preventDefault();let p=s.getState(),a=ee({state:p,props:n}),c=(a.actions||{}).buttons||[],d=c.find(f=>f.validate)||c[0];if(!d)return;let h=Ie({state:p,props:n});if(d.validate){let f=ie(a.fields||[]),{valid:u,errors:y}=$t(f,p.formValues);s.setErrors({errors:y}),u||s.setReactiveMode(),i(),r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h,valid:u,errors:y}}))}else r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h}}))}},ul=(e,t)=>{let{store:s,render:r,props:i}=e,n=t._event,o=n.currentTarget.dataset.fieldName,l=ee({state:s.getState(),props:i}),p=ie(l.fields||[]).find(a=>a.name===o);if(p&&p.tooltip){let a=n.currentTarget.getBoundingClientRect();s.showTooltip({x:a.left+a.width/2,y:a.top-8,content:typeof p.tooltip=="string"?p.tooltip:p.tooltip.content||""}),r()}},hl=e=>{let{store:t,render:s}=e;t.hideTooltip({}),s()},fl=Object.freeze(Object.defineProperty({__proto__:null,handleActionClick:pl,handleAfterMount:nl,handleBeforeMount:il,handleImageClick:dl,handleKeyDown:cl,handleOnUpdate:ol,handleTooltipMouseEnter:ul,handleTooltipMouseLeave:hl,handleValueChange:ll,handleValueInput:al},Symbol.toStringTag,{value:"Module"})),yl=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"],ml=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input","slider-with-input"],gl=({ref:e,fieldType:t,value:s,forceRefresh:r=!1})=>{if(yl.includes(t)){if(r&&e.removeAttribute("value"),s==null){if(ml.includes(t)&&r){if(t==="popover-input"){e.removeAttribute("value");return}e.setAttribute("value","");return}e.removeAttribute("value");return}e.setAttribute("value",String(s))}},Oi=({ref:e,value:t})=>{if(e){if(e?.store?.updateSelectedValues)e.store.updateSelectedValues({values:Array.isArray(t)?t:[]});else if(e?.store?.updateSelectedValue)e.store.updateSelectedValue({value:t});else return;typeof e.render=="function"&&e.render()}},bl=e=>{let t=new Map;return!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("[data-field-name]").forEach(s=>{let r=s.getAttribute("data-field-name");r&&t.set(r,s)}),t},Pr=e=>e?.renderTarget?e.renderTarget:e?.shadowRoot?e.shadowRoot:e?.shadow,vl=({root:e,values:t={}})=>{!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("rtgl-select[data-field-name], rtgl-tag-select[data-field-name], rtgl-segmented-control[data-field-name]").forEach(s=>{let r=s.dataset?.fieldName;if(!r)return;let i=ne(t,r);Oi({ref:s,value:i})})},wl=function(){let e=this.store.getState();return Ie({state:e,props:this.props})},_l=function(e={}){let t=e&&typeof e=="object"&&e.values&&typeof e.values=="object"?e.values:e;if(!t||typeof t!="object"||Array.isArray(t))return;this.store.setFormValues({values:t}),this.store.pruneHiddenValues();let s=this.store.getState(),r=ee({state:s,props:this.props}),i=ie(r.fields||[]),n=bl(Pr(this));for(let l of i){if(!l.name)continue;let p=n.get(l.name);if(!p)continue;let a=Object.prototype.hasOwnProperty.call(t,l.name),c=ne(t,l.name);if(!a&&c===void 0)continue;let d=ne(s.formValues,l.name);gl({ref:p,fieldType:l.type,value:d,forceRefresh:!0}),["select","tag-select","segmented-control"].includes(l.type)&&Oi({ref:p,value:d}),l.type==="checkbox"&&(d?p.setAttribute("checked",""):p.removeAttribute("checked"))}this.render();let o=()=>{let l=this.store.getState();vl({root:Pr(this),values:l.formValues})};o(),setTimeout(()=>{o()},0)},xl=function(){let e=this.store.getState(),t=ee({state:e,props:this.props}),s=ie(t.fields||[]),{valid:r,errors:i}=$t(s,e.formValues);return this.store.setErrors({errors:i}),r||this.store.setReactiveMode(),this.render(),{valid:r,errors:i}},Sl=function(){let e=this.props?.defaultValues||{},t={};Object.keys(e).forEach(n=>{he(t,n,e[n])});let s=ee({state:{formValues:t},props:this.props}),r=ie(s.fields||[]),i={};for(let n of r){let o=ne(e,n.name);o!==void 0?he(i,n.name,o):he(i,n.name,Ps(n))}this.store.resetFormValues({defaultValues:i}),this.setValues(i)},Al=Object.freeze(Object.defineProperty({__proto__:null,getValues:wl,reset:Sl,setValues:_l,validate:xl},Symbol.toStringTag,{value:"Module"})),Br=3e3,kl=180,bt=new WeakMap,Ti=e=>{e&&(typeof e.componentDialogBodyHost?.replaceChildren=="function"&&e.componentDialogBodyHost.replaceChildren(),delete e.componentDialogBody)},El=e=>{let t=e.selectUiType();return t==="dropdown"||t==="formDialog"||t==="componentDialog"?null:e.selectConfig().mode==="confirm"?!1:null},fe=({store:e,render:t,globalUI:s,refs:r,emitResult:i=!1,result:n})=>{if(!e.selectIsOpen())return;let o=n!==void 0?n:El(e);Ti(r),e.closeAll(),t(),i&&s.emit("event",o)},Li=({store:e,render:t,globalUI:s,refs:r,error:i})=>{Ti(r),e.selectIsOpen()&&(e.closeAll(),t()),s.emit("error",i)},it=({store:e,render:t,globalUI:s,refs:r})=>{e.selectIsOpen()&&fe({store:e,render:t,globalUI:s,refs:r,emitResult:!0})},nt=(e,{rejectOnError:t=!1}={})=>new Promise((s,r)=>{let i=null,n=e.once("event",o=>{i?.(),s(o)});t&&(i=e.once("error",o=>{n?.(),r(o)}))}),$l=e=>{let t=bt.get(e);return t||(t=new Map,bt.set(e,t)),t},Cl=(e,t)=>{let s=bt.get(e),r=s?.get(t);r&&(clearTimeout(r.exitTimerId),clearTimeout(r.removeTimerId),s.delete(t))},Il=e=>{let t=bt.get(e);if(t){for(let s of t.values())clearTimeout(s.exitTimerId),clearTimeout(s.removeTimerId);t.clear()}},Ol=({store:e,render:t,globalUI:s},r)=>{Cl(s,r);let i=$l(s),n=setTimeout(()=>{e.setToastPhase?.({id:r,phase:"exiting"}),t()},Math.max(0,Br-kl)),o=setTimeout(()=>{i.delete(r),e.removeToast({id:r}),t()},Br);i.set(r,{exitTimerId:n,removeTimerId:o})},Tl=(e,t)=>{setTimeout(()=>{let{store:s,refs:r}=e;if(!s.selectIsOpen()||s.selectUiType()!=="formDialog")return;let i=s.selectFormDialogConfig?.();if(!i||i.key!==t||typeof i.mount!="function")return;let n=r.formDialog;n&&i.mount(n)},0)},Ll=(e,t)=>{setTimeout(()=>{let{store:s,refs:r,render:i,globalUI:n}=e;if(!s.selectIsOpen()||s.selectUiType()!=="componentDialog")return;let o=s.selectComponentDialogConfig?.();if(!o||o.key!==t)return;let l=r.componentDialogBodyHost;if(l)try{let p=document.createElement(o.component);Object.entries(o.props??{}).forEach(([a,c])=>{p[a]=c}),l.replaceChildren(p),r.componentDialogBody=p}catch(p){Li({store:s,render:i,globalUI:n,refs:r,error:p})}},0)},ls=(e,t)=>!e.selectIsOpen()||e.selectUiType()!=="componentDialog"?!1:e.selectComponentDialogConfig?.()?.key===t,Vl=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0})},Nl=e=>{let{store:t,render:s,globalUI:r,refs:i}=e,n=t.selectConfig().mode==="confirm"?!0:null;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0,result:n})},Rl=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0,result:!1})},jl=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0,result:null})},Dl=(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t._event,{index:l,item:p}=o.detail;fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:{index:l,item:p}})},Pl=(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;return it({store:s,render:r,globalUI:i,refs:n}),s.setAlertConfig(o),r(),nt(i)},Bl=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;return it({store:s,render:r,globalUI:i,refs:n}),s.setConfirmConfig(o),r(),nt(i)},zl=(e,t)=>{let{store:s,render:r,globalUI:i}=e;s.addToast(t),r();let n=s.selectToasts?.()??[],o=n[n.length-1]?.id;o&&Ol({store:s,render:r,globalUI:i},o)},Wl=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;return it({store:s,render:r,globalUI:i,refs:n}),s.setDropdownConfig(o),r(),nt(i)},Ml=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;it({store:s,render:r,globalUI:i,refs:n}),s.setFormDialogConfig(o),r();let l=s.selectFormDialogConfig?.().key;return Tl(e,l),nt(i)},Fl=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;it({store:s,render:r,globalUI:i,refs:n}),s.setComponentDialogConfig(o),r();let l=s.selectComponentDialogConfig?.().key;return Ll(e,l),nt(i,{rejectOnError:!0})},Kl=(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t._event?.detail??{};o.valid!==!1&&fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:o})},Ul=(e,t)=>{let{store:s,refs:r}=e,i=t._event?.detail??{},n=s.selectFormDialogConfig?.();typeof n?.onFieldEvent=="function"&&n.onFieldEvent({detail:i,formEl:r.formDialog??null})},Hl=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;Il(r);let n=(t.selectToasts?.().length??0)>0;if(n&&t.clearToasts(),t.selectIsOpen()){fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0});return}n&&s()},ql=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t._event,l=Number(o?.currentTarget?.dataset?.actionIndex),p=s.selectComponentDialogConfig?.(),a=p?.key,c=Number.isInteger(l)?p?.actions?.buttons?.[l]:null;if(c){if(c.role==="cancel"){fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:{actionId:c.id}});return}try{let d=n.componentDialogBody;if(!d||typeof d.validate!="function"||typeof d.getValues!="function")throw new Error(`component dialog body '${p?.component??"unknown"}' must implement validate() and getValues()`);if(c.validate){let f=await d.validate();if(!ls(s,a))return;if(!f||typeof f!="object"||typeof f.valid!="boolean")throw new Error("component dialog body validate() must return { valid, errors? }");if(f.valid===!1)return}let h=await d.getValues();if(!ls(s,a))return;fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:{actionId:c.id,values:h}})}catch(d){if(!ls(s,a))return;Li({store:s,render:r,globalUI:i,refs:n,error:d})}}},Yl=Object.freeze(Object.defineProperty({__proto__:null,handleCancel:Rl,handleCloseAll:Hl,handleComponentDialogAction:ql,handleConfirm:Nl,handleDialogClose:Vl,handleDropdownClose:jl,handleDropdownItemClick:Dl,handleFormAction:Kl,handleFormFieldEvent:Ul,handleShowAlert:Pl,handleShowComponentDialog:Fl,handleShowConfirm:Bl,handleShowDropdownMenu:Wl,handleShowFormDialog:Ml,handleShowToast:zl},Symbol.toStringTag,{value:"Module"})),Gl=new Set(["sm","md","lg","f"]),Jl=new Set(["sm","md","lg"]),Zl=new Set(["active","exiting"]),Xl=new Set(["top","bottom"]),Ql=new Set(["confirm","cancel"]),ep=Object.freeze([{id:"cancel",label:"Cancel",variant:"se",align:"left",role:"cancel"},{id:"confirm",label:"OK",variant:"pr",role:"confirm",validate:!0}]),gs=e=>!e||typeof e!="object"||Array.isArray(e)?{}:e,je=(e,t="md")=>Gl.has(e)?e:t,Vi=(e,t="sm")=>Jl.has(e)?e:t,Ni=(e,t="active")=>Zl.has(e)?e:t,Ri=(e,t="top")=>Xl.has(e)?e:t,zs=e=>{let t=(Array.isArray(e?.buttons)&&e.buttons.length>0?e.buttons:ep).map((s,r)=>{if(!s||typeof s!="object"||Array.isArray(s))throw new Error("component dialog buttons must be objects");if(typeof s.id!="string"||s.id.length===0)throw new Error("component dialog button id is required");if(typeof s.label!="string"||s.label.length===0)throw new Error("component dialog button label is required");if(!Ql.has(s.role))throw new Error("component dialog button role must be 'confirm' or 'cancel'");return{...s,_globalIdx:r,variant:s.variant??(s.role==="confirm"?"pr":"se"),align:s.align??(s.role==="cancel"?"left":"right"),validate:s.role==="confirm"?!!s.validate:!1,_disabled:!!s.disabled,pre:s.pre??"",suf:s.suf??""}});return{_layout:"split",buttons:t,_leftButtons:t.filter(s=>s.align==="left"),_rightButtons:t.filter(s=>s.align!=="left")}},ji=()=>({title:"",description:"",size:"md",component:"",props:{},actions:zs(),key:0}),tp=()=>Object.freeze({isOpen:!1,uiType:"dialog",nextToastId:0,toasts:[],config:{status:void 0,title:"",message:"",confirmText:"OK",cancelText:"Cancel",mode:"alert"},dropdownConfig:{items:[],x:0,y:0,place:"bs"},formDialogConfig:{form:null,defaultValues:{},context:{},disabled:!1,size:"md",key:0,onFieldEvent:null,mount:null},componentDialogConfig:ji()}),sp=({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},rp=({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},ip=({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},np=({state:e},t={})=>{if(!t.form||typeof t.form!="object"||Array.isArray(t.form))throw new Error("form object is required for showFormDialog");let s=e.formDialogConfig?.key??0;e.formDialogConfig={form:t.form,defaultValues:gs(t.defaultValues),context:gs(t.context),disabled:!!t.disabled,size:je(t.size,"md"),key:s+1,onFieldEvent:typeof t.onFieldEvent=="function"?t.onFieldEvent:null,mount:typeof t.mount=="function"?t.mount:null},e.uiType="formDialog",e.isOpen=!0},op=({state:e},t={})=>{if(typeof t.component!="string"||!t.component.includes("-"))throw new Error("component tag name is required for showComponentDialog");let s=e.componentDialogConfig?.key??0;e.componentDialogConfig={title:typeof t.title=="string"?t.title:"",description:typeof t.description=="string"?t.description:"",size:je(t.size,"md"),component:t.component,props:gs(t.props),actions:zs(t.actions),key:s+1},e.uiType="componentDialog",e.isOpen=!0},ap=({state:e},t={})=>{if(typeof t.message!="string"||t.message.length===0)throw new Error("message is required for showToast");let s=(e.nextToastId??0)+1,r={id:`toast-${s}`,message:t.message,size:Vi(t.size??t.s,"sm"),position:Ri(t.position,"top"),phase:"active"};e.nextToastId=s,e.toasts=[...e.toasts??[],r]},lp=({state:e},t={})=>{typeof t.id!="string"||t.id.length===0||(e.toasts=(e.toasts??[]).filter(s=>s.id!==t.id))},pp=({state:e},t={})=>{typeof t.id!="string"||t.id.length===0||(e.toasts=(e.toasts??[]).map(s=>s.id!==t.id?s:{...s,phase:Ni(t.phase,"active")}))},dp=({state:e})=>{e.toasts=[]},cp=({state:e})=>{e.isOpen=!1,e.uiType="dialog"},up=({state:e})=>e.config,hp=({state:e})=>e.dropdownConfig,fp=({state:e})=>e.formDialogConfig,yp=({state:e})=>e.componentDialogConfig,mp=({state:e})=>e.uiType,gp=({state:e})=>e.isOpen,bp=({state:e})=>e.toasts??[],vp=({state:e})=>{let t=e.isOpen&&e.uiType==="dialog",s=e.isOpen&&e.uiType==="formDialog",r=e.isOpen&&e.uiType==="componentDialog",i=e.componentDialogConfig??ji(),n=Array.isArray(e.toasts)?e.toasts.map(o=>({...o,size:Vi(o.size,"sm"),position:Ri(o.position,"top"),phase:Ni(o.phase,"active")})):[];return{isOpen:e.isOpen,uiType:e.uiType,config:e.config,dropdownConfig:{items:e.dropdownConfig?.items??[],x:e.dropdownConfig?.x??0,y:e.dropdownConfig?.y??0,place:e.dropdownConfig?.place??"bs"},formDialogConfig:{form:e.formDialogConfig?.form??{fields:[],actions:{buttons:[]}},defaultValues:e.formDialogConfig?.defaultValues??{},context:e.formDialogConfig?.context??{},disabled:!!e.formDialogConfig?.disabled,size:je(e.formDialogConfig?.size,"md"),key:e.formDialogConfig?.key??0},componentDialogConfig:{title:i.title??"",description:i.description??"",size:je(i.size,"md"),component:i.component??"",props:i.props??{},actions:i.actions??zs(),key:i.key??0},toasts:n,topToasts:n.filter(o=>o.position==="top"),bottomToasts:n.filter(o=>o.position==="bottom"),isDialogOpen:t,isFormDialogOpen:s,isComponentDialogOpen:r,isDialogContainerOpen:t||s||r,isDropdownOpen:e.isOpen&&e.uiType==="dropdown",dialogSize:r?je(i.size,"md"):s?je(e.formDialogConfig?.size,"md"):"sm"}},wp=Object.freeze(Object.defineProperty({__proto__:null,addToast:ap,clearToasts:dp,closeAll:cp,createInitialState:tp,removeToast:lp,selectComponentDialogConfig:yp,selectConfig:up,selectDropdownConfig:hp,selectFormDialogConfig:fp,selectIsOpen:gp,selectToasts:bp,selectUiType:mp,selectViewData:vp,setAlertConfig:sp,setComponentDialogConfig:op,setConfirmConfig:rp,setDropdownConfig:ip,setFormDialogConfig:np,setToastPhase:pp},Symbol.toStringTag,{value:"Module"})),_p=(e,t)=>{let{dispatchEvent:s,store:r}=e;t._event,console.log("handle click start",r.selectPath()),s(new CustomEvent("start-click",{detail:{path:r.selectPath()}}))},xp=Object.freeze(Object.defineProperty({__proto__:null,handleClickStart:_p},Symbol.toStringTag,{value:"Module"})),Sp=()=>Object.freeze({}),Ap=["id","class","style","slot","start"],kp=(e={})=>Object.entries(e).filter(([t])=>!Ap.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Ep=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}}}},$p=({props:e})=>{let t=Ep(e.start)||e.start;return{containerAttrString:kp(e),start:t||{label:"",image:{src:"",width:32,height:32,alt:""}}}},Cp=({props:e})=>e.start?.path,Ip=({state:e})=>{},Op=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Sp,selectPath:Cp,selectViewData:$p,setState:Ip},Symbol.toStringTag,{value:"Module"})),zr=e=>{let t=e.querySelectorAll("h1[id], h2[id], h3[id], h4[id], rtgl-text[id]");return Array.from(t)},Tp=e=>e.map(t=>{let s=1,r=t.tagName.toLowerCase();return r==="h1"?s=1:r==="h2"?s=2:r==="h3"?s=3:r==="h4"?s=4:r==="rtgl-text"&&(s=parseInt(t.getAttribute("data-level")||"1",10)),{id:t.id,href:`#${t.id}`,title:t.textContent,level:s}}),Wr=(e,t,s)=>{let{store:r,render:i}=s,n,o=-1/0;if(e.forEach(l=>{let p=l.getBoundingClientRect();p.top<=t&&p.top>o&&(o=p.top,n=l.id)}),!n){let l=1/0;e.forEach(p=>{let a=p.getBoundingClientRect();a.top>t&&a.top<l&&(l=a.top,n=p.id)})}n&&n!==r.selectCurrentId()&&(r.setCurrentId({id:n}),i())},Lp=(e,t,s,r)=>{let{store:i,render:n}=r,o=null,l=()=>{o=null;let d=zr(e);i.setItems({items:Tp(d)}),Wr(d,s,r),n()},p=()=>{o===null&&(o=requestAnimationFrame(l))},a=()=>{Wr(zr(e),s,r)};p(),t.addEventListener("scroll",a,{passive:!0});let c=new MutationObserver(()=>{p()});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)}},Vp=e=>{let{props:t}=e,s=()=>{};return requestAnimationFrame(()=>{let r=document.getElementById(t.targetId);if(!r)return;let i=window;t.scrollContainerId&&(i=document.getElementById(t.scrollContainerId)||window);let n=parseInt(t.offsetTop||"100",10);s=Lp(r,i,n,e)}),()=>{s()}},Np=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Vp},Symbol.toStringTag,{value:"Module"})),Rp=()=>Object.freeze({items:[],currentId:null,contentContainer:null}),jp=({state:e})=>{let t=((s,r)=>{let i=new Set,n=s.findIndex(l=>l.id===r);if(n===-1)return i;let o=s[n].level;for(let l=n-1;l>=0;l--)if(s[l].level<o){let p=s[l].level;i.add(s[l].id);for(let a=l-1;a>=0;a--)s[a].level<p&&(i.add(s[a].id),p=s[a].level);break}return i})(e.items,e.currentId);return{items:e.items.map(s=>{let r={1:"0",2:"12px",3:"24px",4:"32px"},i=s.id===e.currentId,n=t.has(s.id),o=i||n;return{...s,c:o?"fg":"mu-fg",ml:r[s.level]||"",bc:o?"fg":"mu-fg"}}),currentId:e.currentId}},Dp=({state:e})=>e,Pp=({state:e})=>e.currentId,Bp=({state:e},t={})=>{e.items=Array.isArray(t.items)?t.items:[]},zp=({state:e},t={})=>{e.currentId=t.id},Wp=({state:e},t={})=>{e.contentContainer=t.container},Mp=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Rp,selectCurrentId:Pp,selectState:Dp,selectViewData:jp,setContentContainer:Wp,setCurrentId:zp,setItems:Bp},Symbol.toStringTag,{value:"Module"})),ot=e=>e==null||e===!0?"":String(e),Di=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=ot(t);s.setValue({value:n}),s.closePopover({}),i(new CustomEvent("value-change",{detail:{value:n},bubbles:!0})),r()},Fp=e=>{let{store:t,props:s}=e;if(s.value!==void 0){let r=ot(s.value);t.setValue({value:r}),t.setTempValue({value:r})}},Kp=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n}=e;if(s?.value!==r?.value){let o=ot(r?.value);i.setValue({value:o}),i.getState().isOpen||i.setTempValue({value:o})}n()},Up=(e,t)=>{let{store:s,render:r,refs:i,props:n}=e;if(n.disabled)return;let o=t._event,l=ot(n.value);s.setValue({value:l}),s.setTempValue({value:l}),s.openPopover({position:{x:o.currentTarget.getBoundingClientRect().left,y:o.currentTarget.getBoundingClientRect().bottom}}),r(),setTimeout(()=>{let{input:p}=i;if(!p)return;p.value=l,p.focus();let a=p.shadowRoot?.querySelector("input, textarea");a&&typeof a.focus=="function"&&a.focus()},50)},Hp=(e,t)=>{let{store:s,render:r}=e;s.closePopover({}),r()},qp=(e,t)=>{let{store:s}=e,r=t._event,i=ot(r.detail.value);s.setTempValue({value:i})},Yp=e=>{let{store:t,refs:s}=e,{input:r}=s,i=r?r.value:t.getState().tempValue;Di(e,i)},Gp=(e,t)=>{let{store:s,refs:r}=e,i=t._event;if(i.key==="Enter"){i.preventDefault(),i.stopPropagation();let{input:n}=r,o=n?n.value:s.getState().tempValue;Di(e,o)}else i.key==="Escape"&&(i.preventDefault(),i.stopPropagation(),s.closePopover({}),e.render())},Jp=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Fp,handleInputChange:qp,handleInputKeydown:Gp,handleOnUpdate:Kp,handlePopoverClose:Hp,handleSubmitClick:Yp,handleTextClick:Up},Symbol.toStringTag,{value:"Module"})),Zp=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),Xp=({props:e,state:t})=>{let s=typeof t.value=="string"&&t.value.length>0,r=s?t.value:"-",i=typeof e.placeholder=="string"?e.placeholder:"",n=typeof e.label=="string"?e.label:"",o=!!e.disabled;return{isOpen:t.isOpen,position:t.position,value:r,valueColor:s?"fg":"mu-fg",tempValue:t.tempValue,placeholder:i,label:n,disabled:o}},Qp=({state:e},t={})=>{e.tempValue=t.value},ed=({state:e},t={})=>{let{position:s}=t;e.position=s,e.isOpen=!0,e.hasUnsavedChanges=!1},td=({state:e})=>{e.isOpen=!1,e.tempValue=""},sd=({state:e},t={})=>{e.value=t.value},rd=({state:e})=>e.value,id=Object.freeze(Object.defineProperty({__proto__:null,closePopover:td,createInitialState:Zp,openPopover:ed,selectValue:rd,selectViewData:Xp,setTempValue:Qp,setValue:sd},Symbol.toStringTag,{value:"Module"})),le=(e,t)=>{if(e===t)return!0;if(e==null||t==null||typeof e!="object"||typeof t!="object")return!1;let s=Object.keys(e),r=Object.keys(t);if(s.length!==r.length)return!1;for(let i of s)if(!r.includes(i)||!le(e[i],t[i]))return!1;return!0},Mr=({dispatchEvent:e,value:t,label:s,index:r,item:i})=>{e(new CustomEvent("value-change",{detail:{value:t,label:s,index:r,item:i},bubbles:!0}))},nd=e=>{let{store:t,props:s,render:r}=e;if(s.selectedValue!==null&&s.selectedValue!==void 0&&s.options){let i=s.options.find(n=>le(n.value,s.selectedValue));i&&(t.updateSelectedValue({value:i.value}),r())}},od=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n}=e,o=!1;s.selectedValue!==r.selectedValue&&(i.updateSelectedValue({value:r.selectedValue}),o=!0),o&&n()},Pi=(e,t)=>{let{render:s,dispatchEvent:r,props:i,store:n}=e;if(i.disabled)return;let o=t._event;o.stopPropagation();let l=o.currentTarget.id.slice(6),p=Number(l),a=i.options[p],c=Object.prototype.hasOwnProperty.call(i||{},"selectedValue"),d=n.selectSelectedValue(),h=c?!0:n.selectHasSelectedValue(),f=a?h&&le(a.value,d):!1;if(a){if(f&&!i.noClear){n.clearSelectedValue({}),i.onChange&&typeof i.onChange=="function"&&i.onChange(void 0),Mr({dispatchEvent:r,value:void 0,label:void 0,index:null,item:void 0}),s();return}n.updateSelectedValue({value:a.value}),i.onChange&&typeof i.onChange=="function"&&i.onChange(a.value),Mr({dispatchEvent:r,value:a.value,label:a.label,index:p,item:a}),s()}},ad=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Pi(e,t))},ld=(e,t)=>{let{store:s,render:r}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(6),10);s.setHoveredOption({optionId:n}),r()},pd=e=>{let{store:t,render:s}=e;t.clearHoveredOption({}),s()},Bi=(e,t)=>{if(e.props.disabled)return;let{render:s,dispatchEvent:r}=e,{_event:i}=t;i.stopPropagation(),r(new CustomEvent("add-option-click",{bubbles:!0})),s()},dd=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Bi(e,t))},cd=e=>{let{store:t,render:s}=e;t.setHoveredAddOption({isHovered:!0}),s()},ud=e=>{let{store:t,render:s}=e;t.setHoveredAddOption({isHovered:!1}),s()},hd=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:Bi,handleAddOptionKeyDown:dd,handleAddOptionMouseEnter:cd,handleAddOptionMouseLeave:ud,handleBeforeMount:nd,handleOnUpdate:od,handleOptionClick:Pi,handleOptionKeyDown:ad,handleOptionMouseEnter:ld,handleOptionMouseLeave:pd},Symbol.toStringTag,{value:"Module"})),fd=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],yd=(e={})=>Object.entries(e).filter(([t])=>!fd.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),md=()=>Object.freeze({selectedValue:null,hasSelectedValue:!1,hoveredOptionId:null,hoveredAddOption:!1}),gd=({state:e,props:t})=>{let s=yd(t),r=!!t.disabled,i=Object.prototype.hasOwnProperty.call(t||{},"selectedValue"),n=i?t.selectedValue:e.selectedValue,o=i?!0:!!e.hasSelectedValue,l=t.options||[],p=l.map((a,c)=>{let d=o&&le(a.value,n),h=e.hoveredOptionId===c;return{...a,isSelected:d,bgc:d?"ac":h&&!r?"mu":"",textColor:d?"ac-fg":"fg",borderLeftWidth:c===0?"none":"xs",cursor:r?"not-allowed":"pointer",tabIndex:r?-1:0}});return{containerAttrString:s,isDisabled:r,options:p,selectedValue:n,hasSelectedValue:o,ariaLabel:t.placeholder||"Segmented control",showAddOption:!r&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"mu":"",addOptionBorderLeftWidth:l.length===0?"none":"xs"}},bd=({state:e})=>e,vd=({state:e})=>e.selectedValue,wd=({state:e})=>!!e.hasSelectedValue,_d=({state:e},t={})=>{e.selectedValue=t.value,e.hasSelectedValue=!0},xd=({state:e})=>{e.selectedValue=void 0,e.hasSelectedValue=!1},Sd=({state:e},t={})=>{e.hoveredOptionId=t.optionId},Ad=({state:e})=>{e.hoveredOptionId=null},kd=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},Ed=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:Ad,clearSelectedValue:xd,createInitialState:md,selectHasSelectedValue:wd,selectSelectedValue:vd,selectState:bd,selectViewData:gd,setHoveredAddOption:kd,setHoveredOption:Sd,updateSelectedValue:_d},Symbol.toStringTag,{value:"Module"})),Ws=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",$d=e=>{let{store:t,props:s,render:r}=e;if(s.selectedValue!==null&&s.selectedValue!==void 0&&s.options){let i=s.options.find(n=>Ws(n)==="item"&&le(n.value,s.selectedValue));i&&(t.updateSelectedValue({value:i?.value}),r())}},Cd=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n,refs:o}=e,l=!1,p=!1;r?.disabled&&!s?.disabled&&(i.closeOptionsPopover({}),l=!0),s.selectedValue!==r.selectedValue&&(i.updateSelectedValue({value:r.selectedValue}),l=!0),s.options!==r.options&&(l=!0,p=!0),l&&(n(),p&&i.selectState?.().isOpen&&o?.popover?.refreshContent?.())},zi=(e,t)=>{let{store:s,render:r,refs:i,props:n}=e;if(n.disabled)return;t._event.stopPropagation();let o=i.selectButton.getBoundingClientRect(),l=s.selectSelectedValue(),p=l!==null?l:n.selectedValue,a=null;p!=null&&n.options&&(a=n.options.findIndex(c=>Ws(c)==="item"&&le(c.value,p)),a===-1&&(a=null)),s.openOptionsPopover({position:{y:o.bottom+12,x:o.left-24},selectedIndex:a}),r()},Id=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),zi(e,t))},Od=e=>{let{store:t,render:s}=e;t.closeOptionsPopover({}),s()},Td=(e,t)=>{let{render:s,dispatchEvent:r,props:i,store:n}=e;if(i.disabled)return;let o=t._event;o.stopPropagation();let l=o.currentTarget.id.slice(6),p=Number(l),a=i.options[l];Ws(a)==="item"&&(n.updateSelectedValue({value:a?.value}),i.onChange&&typeof i.onChange=="function"&&i.onChange(a.value),r(new CustomEvent("value-change",{detail:{value:a.value,label:a.label,index:p,item:a},bubbles:!0})),s())},Ld=(e,t)=>{let{store:s,render:r}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(6),10);s.setHoveredOption({optionId:n}),r()},Vd=(e,t)=>{let{store:s,render:r}=e;s.clearHoveredOption({}),r()},Nd=(e,t)=>{let{store:s,render:r,dispatchEvent:i,props:n}=e;n.disabled||(t._event.stopPropagation(),s.clearSelectedValue({}),n.onChange&&typeof n.onChange=="function"&&n.onChange(void 0),i(new CustomEvent("value-change",{detail:{value:void 0,label:void 0,index:null,item:void 0},bubbles:!0})),r())},Rd=(e,t)=>{if(e.props.disabled)return;let{store:s,render:r,dispatchEvent:i}=e,{_event:n}=t;n.stopPropagation(),s.closeOptionsPopover({}),i(new CustomEvent("add-option-click",{bubbles:!0})),r()},jd=(e,t)=>{let{store:s,render:r}=e;s.setHoveredAddOption({isHovered:!0}),r()},Dd=(e,t)=>{let{store:s,render:r}=e;s.setHoveredAddOption({isHovered:!1}),r()},Pd=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:Rd,handleAddOptionMouseEnter:jd,handleAddOptionMouseLeave:Dd,handleBeforeMount:$d,handleButtonClick:zi,handleButtonKeyDown:Id,handleClearClick:Nd,handleClickOptionsPopoverOverlay:Od,handleOnUpdate:Cd,handleOptionClick:Td,handleOptionMouseEnter:Ld,handleOptionMouseLeave:Vd},Symbol.toStringTag,{value:"Module"})),Bd=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],zd=(e={})=>Object.entries(e).filter(([t])=>!Bd.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Wd=(e,t)=>Object.prototype.hasOwnProperty.call(e||{},t),Wi=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Fr=(e={})=>Wi(e)==="item",Md=(e={})=>typeof e.icon=="string"&&e.icon.length>0?e.icon:"",Fd=(e={})=>typeof e.shortcut=="string"&&e.shortcut.length>0?e.shortcut:typeof e.suffixText=="string"&&e.suffixText.length>0?e.suffixText:"",Kd=(e={},t,s,r,i)=>{let n=Wi(e),o=n==="section",l=n==="separator",p=n==="item";if(o)return{...e,index:t,type:n,isSection:o,isSeparator:l,isItem:p};if(l)return{...e,index:t,type:n,isSection:o,isSeparator:l,isItem:p};let a=le(e.value,s),c=r===t,d=Md(e),h=Fd(e);return{...e,index:t,type:n,isSection:o,isSeparator:l,isItem:p,isSelected:a,bgc:c?"ac":a?"mu":"",hasIconSlot:i,icon:d,hasIcon:d.length>0,iconColor:"fg",c:"fg",suffixText:h,hasSuffixText:h.length>0,suffixTextColor:"mu-fg"}},Ud=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,hoveredOptionId:null,hoveredAddOption:!1}),Hd=({state:e,props:t})=>{let s=zd(t),r=!!t.disabled,i=Object.prototype.hasOwnProperty.call(t||{},"selectedValue")?t.selectedValue:e.selectedValue,n=t.placeholder||"Select an option",o=!0,l=t.options||[],p=l.find(h=>Fr(h)&&le(h.value,i));p&&(n=p.label,o=!1);let a=l.some(h=>Fr(h)&&Wd(h,"icon")),c=l.map((h,f)=>Kd(h,f,i,e.hoveredOptionId,a)),d=c.find(h=>h.isItem&&h.isSelected);return{containerAttrString:s,isDisabled:r,isOpen:e.isOpen,position:e.position,options:c,selectedValue:i,selectedLabel:n,selectedLabelColor:o?"mu-fg":"fg",selectedIcon:d?.icon||"",hasSelectedIcon:!!d?.hasIcon,selectedIconColor:o?"mu-fg":"fg",selectedSuffixText:d?.suffixText||"",hasSelectedSuffixText:!!d?.hasSuffixText,selectedSuffixTextColor:"mu-fg",selectButtonCursor:r?"not-allowed":"pointer",selectButtonHoverBorderColor:r?"bo":"ac",selectButtonTabIndex:r?-1:0,hasValue:i!=null,showClear:!r&&!t.noClear&&i!=null,showAddOption:!r&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"ac":""}},qd=({state:e})=>e,Yd=({state:e})=>e.selectedValue,Gd=({state:e},t={})=>{let{position:s,selectedIndex:r}=t;e.position=s,e.isOpen=!0,r!=null&&(e.hoveredOptionId=r)},Jd=({state:e})=>{e.isOpen=!1},Zd=({state:e},t={})=>{e.selectedValue=t.value,e.isOpen=!1},Xd=({state:e})=>{e.selectedValue=void 0},Qd=({state:e},t={})=>{e.hoveredOptionId=t.optionId},ec=({state:e})=>{e.hoveredOptionId=null},tc=({state:e})=>{e.selectedValue=void 0},sc=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},rc=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:ec,clearSelectedValue:tc,closeOptionsPopover:Jd,createInitialState:Ud,openOptionsPopover:Gd,resetSelection:Xd,selectSelectedValue:Yd,selectState:qd,selectViewData:Hd,setHoveredAddOption:sc,setHoveredOption:Qd,updateSelectedValue:Zd},Symbol.toStringTag,{value:"Module"})),Kr=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},ic=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?Kr(e.tooltip):Kr(e.showCompactTooltip),nc=(e,t)=>{let{store:s,dispatchEvent:r}=e,i=t._event,n,o=s.selectHeader();i.currentTarget.id==="headerLabel"?n=o.labelPath:i.currentTarget.id==="headerImage"?n=o.image.path:i.currentTarget.id==="header"&&(n=o.path),r(new CustomEvent("header-click",{detail:{path:n},bubbles:!0,composed:!0}))},oc=(e,t)=>{let{store:s,dispatchEvent:r,render:i}=e,n=t._event,o=n.currentTarget.dataset.itemId||n.currentTarget.id.slice(4),l=s.selectItem(o);s.hideTooltip({}),i(),r(new CustomEvent("item-click",{detail:{item:l},bubbles:!0,composed:!0}))},ac=(e,t)=>{let{props:s,store:r,render:i}=e;if(!ic(s)||(s.mode||"full")==="full")return;let n=t._event,o=n.currentTarget.dataset.itemId||n.currentTarget.id.slice(4),l=r.selectItem(o);if(!l||l.type==="groupLabel")return;let p=n.currentTarget.getBoundingClientRect(),a=l.tooltip||l.label||l.title;a&&(r.showTooltip({x:p.right,y:p.top+p.height/2,place:"r",content:a}),i())},lc=e=>{let{store:t,render:s}=e;t.hideTooltip({}),s()},pc=Object.freeze(Object.defineProperty({__proto__:null,handleHeaderClick:nc,handleItemClick:oc,handleItemMouseEnter:ac,handleItemMouseLeave:lc},Symbol.toStringTag,{value:"Module"})),dc=()=>Object.freeze({tooltipState:{open:!1,x:0,y:0,place:"r",content:""}}),cc=["id","class","style","slot","header","items","selectedItemId","mode","hideHeader","tooltip","showCompactTooltip","w","bwr"],uc=(e={})=>Object.entries(e).filter(([t])=>!cc.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Xe=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}}}},bs=e=>{if(e===!0)return!0;if(e===!1||e===void 0||e===null)return!1;if(typeof e=="string"){let t=e.trim().toLowerCase();return t===""||t==="true"}return!1},hc=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?bs(e.tooltip):bs(e.showCompactTooltip),fc=(e,t)=>e!=null&&e!==""?e:t==="full"?272:64,Ur=(e={})=>e.label!==void 0&&e.label!==null?e.label:e.title!==void 0&&e.title!==null?e.title:"";function Ms(e,t=null){let s=[];for(let r of e){let i=r.id||r.href||r.path,n=i!=null&&t===i,o=Ur(r);if(s.push({id:i,label:o,title:r.title??o,href:r.href,type:r.type||"item",icon:r.icon,testId:r.testId,tooltip:r.tooltip,path:r.path,hrefAttr:r.href?`href=${r.href}`:"",isSelected:n,itemBgc:n?"ac":"bg",itemHoverBgc:n?"ac":"mu"}),r.items&&Array.isArray(r.items))for(let l of r.items){let p=l.id||l.href||l.path,a=p!=null&&t===p,c=Ur(l);s.push({id:p,label:c,title:l.title??c,href:l.href,type:l.type||"item",icon:l.icon,testId:l.testId,tooltip:l.tooltip,path:l.path,hrefAttr:l.href?`href=${l.href}`:"",isSelected:a,itemBgc:a?"ac":"bg",itemHoverBgc:a?"ac":"mu"})}}return s}var yc=({state:e,props:t})=>{let s=Xe(t.header)||t.header,r=Xe(t.items)||t.items,i=t.selectedItemId,n=uc(t),o=t.mode||"full",l=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},p=r?Ms(r,i):[],a=!bs(t.hideHeader),c=hc(t),d=t.bwr||"xs",h=fc(t.w,o),f=o==="full"?"fs":"c",u=o==="full"?"fs":"c",y=o==="full"?"lg":"sm",m=o==="full"?"md":"sm",b=o==="shrunk-lg"?48:40,g=o==="shrunk-lg"?28:20,_=o==="shrunk-lg"?"md":"sm",S=o==="full",A=o==="full",k=c&&!S,C=o==="full"?"fs":"c",I=o==="full"?"":`ah=${u}`,V=o==="full"?"f":b;return{containerAttrString:n,mode:o,header:l,items:p,sidebarWidth:h,headerAlign:f,itemAlign:u,headerPadding:y,itemPadding:m,itemHeight:b,iconSize:g,firstLetterSize:_,showLabels:S,showGroupLabels:A,itemContentAlign:C,itemAlignAttr:I,itemWidth:V,headerWidth:V,selectedItemId:i,ah:o==="shrunk-lg"||o==="shrunk-md"?"c":"",listAttrString:o==="full"?"d=v sv":"d=v sv hsb",showHeader:a,enableCompactTooltip:k,rightBorderWidth:d,tooltipState:e.tooltipState||{open:!1,x:0,y:0,place:"r",content:""}}},mc=({props:e})=>Xe(e.header)||e.header,gc=({state:e,props:t})=>{let s=Xe(t.items)||t.items;return(s?Ms(s):[]).find(r=>r.active)},bc=({props:e},t)=>{let s=Xe(e.items)||e.items;return(s?Ms(s):[]).find(r=>r.id===t)},vc=({state:e})=>{},wc=({state:e},t={})=>{let{x:s,y:r,place:i="r",content:n=""}=t;e.tooltipState={open:!0,x:s,y:r,place:i,content:n}},_c=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},xc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:dc,hideTooltip:_c,selectActiveItem:gc,selectHeader:mc,selectItem:bc,selectViewData:yc,setState:vc,showTooltip:wc},Symbol.toStringTag,{value:"Module"})),Sc=e=>{let{store:t,props:s}=e;t.setValue({value:s.value??0})},Ac=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n}=e,o=s?.key!==r?.key,l=s?.value!==r?.value;if(o||l){let p=r?.value??0;i.setValue({value:p}),n()}},kc=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=t._event,o=Number(n.detail.value),l=(typeof n.composedPath=="function"?n.composedPath():[]).find(p=>p?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;s.setValue({value:o}),l&&typeof l.setAttribute=="function"&&l.setAttribute("value",String(o)),r(),i(new CustomEvent("value-change",{detail:{value:o},bubbles:!0}))},Ec=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=t._event,o=Number(n.detail.value),l=(typeof n.composedPath=="function"?n.composedPath():[]).find(p=>p?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;s.setValue({value:o}),l&&typeof l.setAttribute=="function"&&l.setAttribute("value",String(o)),r(),i(new CustomEvent("value-input",{detail:{value:o},bubbles:!0}))},$c=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Sc,handleOnUpdate:Ac,handleValueChange:kc,handleValueInput:Ec},Symbol.toStringTag,{value:"Module"})),Cc=()=>Object.freeze({value:0}),Ic=({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}),Oc=({state:e},t={})=>{e.value=t.value},Tc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Cc,selectViewData:Ic,setValue:Oc},Symbol.toStringTag,{value:"Module"})),Lc=e=>{},Vc=(e,t)=>{let{dispatchEvent:s,props:r}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(3),10),o=r.data?.rows?.[n];o&&s(new CustomEvent("row-click",{detail:{rowIndex:n,rowData:o}}))},Nc=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=t._event.currentTarget.dataset.columnKey,o=s.selectSortInfo(),l="asc";o.column===n&&(o.direction==="asc"?l="desc":o.direction==="desc"&&(l=null)),l?s.setSortColumn({column:n,direction:l}):s.clearSort(),r(),i(new CustomEvent("header-click",{detail:{column:n,direction:l,sortInfo:l?{column:n,direction:l}:null}}))},Rc=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Lc,handleHeaderClick:Nc,handleRowClick:Vc},Symbol.toStringTag,{value:"Module"})),jc=()=>Object.freeze({sortColumn:null,sortDirection:null}),Dc=["id","class","style","slot","data"],Pc=(e={})=>Object.entries(e).filter(([t])=>!Dc.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Bc=(e,t)=>{let s=t.split("."),r=e;for(let i of s){if(r==null)return null;r=r[i]}return r},zc=({state:e,props:t})=>{let s=Pc(t),r=t.data||{columns:[],rows:[]},i=r.rows.map((n,o)=>{let l=r.columns.map(p=>{let a=Bc(n,p.key);return{key:p.key,value:a!=null?String(a):""}});return{index:o,cells:l}});return{containerAttrString:s,columns:r.columns||[],rows:i||[]}},Wc=({state:e})=>e,Mc=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),Fc=({state:e},{column:t,direction:s}={})=>{e.sortColumn=t,e.sortDirection=s},Kc=({state:e})=>{e.sortColumn=null,e.sortDirection=null},Uc=Object.freeze(Object.defineProperty({__proto__:null,clearSort:Kc,createInitialState:jc,selectSortInfo:Mc,selectState:Wc,selectViewData:zc,setSortColumn:Fc},Symbol.toStringTag,{value:"Module"})),Hc=(e,t)=>{let{dispatchEvent:s}=e,r=t._event.currentTarget.dataset.id;s(new CustomEvent("item-click",{detail:{id:r}}))},qc=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:Hc},Symbol.toStringTag,{value:"Module"})),Yc=()=>Object.freeze({}),Gc=["id","class","style","slot","items","selectedTab"],Jc=(e={})=>Object.entries(e).filter(([t])=>!Gc.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Zc=({props:e})=>{let t=Jc(e),s=e.items||[],r=e.selectedTab,i=s.map(n=>({...n,isSelected:n.id===r,bgColor:n.id===r?"ac":"",borderColor:n.id===r?"":"tr",textColor:n.id===r?"":"mu-fg"}));return{containerAttrString:t,items:i,selectedTab:r}},Xc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Yc,selectViewData:Zc},Symbol.toStringTag,{value:"Module"})),Qc=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Mi=e=>Array.isArray(e)?[...e]:[],Fi=e=>{if(!e||typeof e.getBoundingClientRect!="function")return;let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.bottom+12),w:Math.max(Math.round(t.width),240)}},vs=({store:e,props:t})=>e.selectHasSelectedValues()?e.selectSelectedValues():Mi(t.selectedValues),Ki=({store:e,props:t})=>Array.isArray(t?.draftSelectedValues)?Mi(t.draftSelectedValues):e.getState().isOpen?e.selectDraftSelectedValues():vs({store:e,props:t}),eu=({dispatchEvent:e,value:t,operation:s,changedValue:r,label:i,index:n,item:o})=>{e(new CustomEvent("value-change",{detail:{value:t,operation:s,changedValue:r,label:i,index:n,item:o},bubbles:!0}))},tu=({dispatchEvent:e,value:t})=>{e(new CustomEvent("draft-value-change",{detail:{value:t},bubbles:!0}))},Pe=({dispatchEvent:e,open:t})=>{e(new CustomEvent("open-change",{detail:{open:t},bubbles:!0}))},Fs=({store:e,props:t,refs:s}={})=>{let r=Fi(s?.trigger);return r?(e.openOptionsPopover({position:r,values:Ki({store:e,props:t})}),!0):!1},su=e=>{let{store:t,props:s,render:r,refs:i}=e,n=!1;s.selectedValues!==void 0&&(t.updateSelectedValues({values:s.selectedValues,syncDraft:s.draftSelectedValues===void 0,preserveDraft:Array.isArray(s.draftSelectedValues)}),n=!0),Array.isArray(s.draftSelectedValues)&&(t.updateDraftSelectedValues({values:s.draftSelectedValues}),n=!0),s.open===!0&&!s.disabled&&Fs(e)&&(n=!0),n&&r()},ru=e=>{let{props:t,render:s,store:r,dispatchEvent:i}=e;if(t.disabled){t.open===!0&&Pe({dispatchEvent:i,open:!1});return}t.open===!0&&!r.getState().isOpen&&Fs(e)&&s()},iu=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n,refs:o}=e,l=!1;if(r?.disabled&&!s?.disabled){let p=i.getState().isOpen;i.closeOptionsPopover({}),p&&Pe({dispatchEvent:e.dispatchEvent,open:!1}),l=!0}if(s.selectedValues!==r.selectedValues&&(i.updateSelectedValues({values:r.selectedValues,syncDraft:r.draftSelectedValues===void 0,preserveDraft:Array.isArray(r.draftSelectedValues)}),l=!0),s.draftSelectedValues!==r.draftSelectedValues&&(i.updateDraftSelectedValues({values:Array.isArray(r?.draftSelectedValues)?r.draftSelectedValues:vs({store:i,props:r})}),l=!0),s.open!==r.open&&r.open!==void 0&&(r.open?r.disabled?Pe({dispatchEvent:e.dispatchEvent,open:!1}):Fs({store:i,props:r,refs:o})&&(l=!0):(i.closeOptionsPopover({}),l=!0)),s.options!==r.options){let p=vs({store:i,props:r}).length>0;(i.getState().isOpen||p)&&(l=!0)}l&&n()},Ui=(e,t)=>{let{store:s,render:r,refs:i,props:n,dispatchEvent:o}=e;if(n.disabled)return;t._event.stopPropagation();let l=Fi(i.trigger);l&&(s.openOptionsPopover({position:l,values:Ki({store:s,props:n})}),Pe({dispatchEvent:o,open:!0}),r())},nu=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Ui(e,t))},ou=e=>{let{store:t,render:s,dispatchEvent:r}=e;t.closeOptionsPopover({}),Pe({dispatchEvent:r,open:!1}),s()},Hi=(e,t)=>{let{render:s,props:r,store:i,dispatchEvent:n}=e;if(r.disabled)return;let o=t._event;o.stopPropagation();let l=o.currentTarget.id.slice(6),p=Number(l),a=r.options[p];!a||Qc(a)!=="item"||(i.toggleDraftSelectedValue({value:a.value}),tu({dispatchEvent:n,value:i.selectDraftSelectedValues()}),s())},au=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Hi(e,t))},lu=(e,t)=>{let{store:s,props:r,render:i,dispatchEvent:n}=e;if(r.disabled)return;t._event.stopPropagation();let o=s.selectDraftSelectedValues();s.commitDraftSelectedValues({}),r.onChange&&typeof r.onChange=="function"&&r.onChange(o),eu({dispatchEvent:n,value:o,operation:"set",changedValue:void 0,label:void 0,index:null,item:void 0}),Pe({dispatchEvent:n,open:!1}),i()},pu=(e,t)=>{let{props:s,dispatchEvent:r}=e;s.disabled||s.noAdd||(t._event.stopPropagation(),r(new CustomEvent("add-option-click",{bubbles:!0,composed:!0})))},du=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:pu,handleAfterMount:ru,handleBeforeMount:su,handleOnUpdate:iu,handleOptionClick:Hi,handleOptionKeyDown:au,handlePopoverClose:ou,handleSubmitClick:lu,handleTriggerClick:Ui,handleTriggerKeyDown:nu},Symbol.toStringTag,{value:"Module"})),qi=e=>{if(!e||typeof e.getBoundingClientRect!="function")return null;let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.bottom+12),w:Math.max(Math.round(t.width),240)}},Ct=e=>Array.isArray(e)?[...e]:[],vt=e=>{typeof e.render=="function"&&e.render()},Yi=e=>e.store?.selectHasSelectedValues?.()?e.store?.selectSelectedValues?.()||[]:Ct(e.props?.selectedValues),Ks=(e,t=[])=>{let s=qi(e.refs?.trigger);return!s||!e.store?.openOptionsPopover?!1:(e.store.openOptionsPopover({position:s,values:t}),!0)},Gi=(e,t=[],s=!1)=>e.store?.getState?.()?.isOpen&&e.store?.updateDraftSelectedValues?(e.store.updateDraftSelectedValues({values:t}),!0):s?Ks(e,t):!1,cu=function(e={}){let t=this.store?.getState?.(),s=Array.isArray(e.values)?Ct(e.values):this.store?.selectDraftSelectedValues?.()||[];if(t?.isOpen){let r=qi(this.refs?.trigger);r&&this.store.openOptionsPopover({position:r,values:s})}else e.keepOpen&&Ks(this,s.length>0?s:Yi(this));vt(this)},uu=function(e={}){let t=Ct(e.values);Gi(this,t,!!e.keepOpen)&&vt(this)},hu=function(e={}){if(!Object.prototype.hasOwnProperty.call(e||{},"value"))return;let t=this.store?.getState?.(),s=t?.isOpen?this.store?.selectDraftSelectedValues?.()||[]:Yi(this);if(s.some(i=>le(i,e.value))){e.keepOpen&&!t?.isOpen&&Ks(this,s)&&vt(this);return}let r=[...Ct(s),e.value];Gi(this,r,!!e.keepOpen)&&vt(this)},fu=Object.freeze(Object.defineProperty({__proto__:null,appendDraftSelectedValue:hu,refreshPopover:cu,setDraftSelectedValues:uu},Symbol.toStringTag,{value:"Module"})),yu=["id","class","style","slot","placeholder","options","open","selectedValues","draftSelectedValues","onChange","addOption","noAdd","disabled"],mu=(e={})=>Object.entries(e).filter(([t])=>!yu.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),gu=(e,t)=>Object.prototype.hasOwnProperty.call(e||{},t),Ji=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Zi=(e={})=>Ji(e)==="item",Xi=(e={})=>typeof e.icon=="string"&&e.icon.length>0?e.icon:"",bu=(e={})=>typeof e.shortcut=="string"&&e.shortcut.length>0?e.shortcut:typeof e.suffixText=="string"&&e.suffixText.length>0?e.suffixText:"",ye=e=>Array.isArray(e)?[...e]:[],vu=(e=[],t=[])=>e.length!==t.length?!1:e.every((s,r)=>le(s,t[r])),wu=(e=[],t)=>e.some(s=>le(s,t)),Qi=({state:e,props:t})=>e.hasSelectedValues?ye(e.selectedValues):ye(t.selectedValues),_u=({state:e,props:t})=>e.isOpen?ye(e.draftSelectedValues):Qi({state:e,props:t}),xu=e=>e==null?"":String(e),Su=(e=[],t)=>e.find(s=>Zi(s)&&le(s.value,t)),ws=({isSelected:e=!0,isAddChip:t=!1}={})=>{let s=["--tag-border-radius: var(--border-radius-md)","--muted-foreground: var(--foreground)"];return(t||!e)&&s.push("--muted: color-mix(in srgb, var(--muted) 82%, var(--background) 18%)"),`${s.join("; ")};`},Au=({option:e={},index:t,selectedValues:s=[],hasIconColumn:r=!1})=>{let i=Ji(e),n=i==="section",o=i==="separator",l=i==="item";if(n||o)return{...e,index:t,type:i,isSection:n,isSeparator:o,isItem:l};let p=wu(s,e.value),a=Xi(e),c=bu(e),d=p?c||"Added":c;return{...e,index:t,type:i,isSection:n,isSeparator:o,isItem:l,isSelected:p,hasIconSlot:r,icon:a,hasIcon:a.length>0,cursor:"pointer",tagStyle:ws({isSelected:p}),suffixText:d,hasSuffixText:d.length>0}},ku=()=>Object.freeze({isOpen:!1,position:{x:0,y:0,w:240},selectedValues:[],draftSelectedValues:[],hasSelectedValues:!1}),Eu=({state:e,props:t})=>{let s=mu(t),r=!!t.disabled,i=Qi({state:e,props:t}),n=_u({state:e,props:t}),o=(e.isOpen||i.length>0)&&Array.isArray(t.options)?t.options:[],l=o.some(f=>Zi(f)&&gu(f,"icon")),p=o.map((f,u)=>Au({option:f,index:u,selectedValues:n,hasIconColumn:l})),a=i.map((f,u)=>{let y=Su(o,f),m=y?Xi(y):"";return{value:f,selectionIndex:u,label:y?.label||xu(f),icon:m,hasIcon:m.length>0,testId:`tag-select-tag-${u}`}}),c=p.some(f=>f.isItem),d=!vu(i,n),h=a.length>0?a.map(f=>({...f,tagStyle:ws({isSelected:!0})})):[{value:void 0,selectionIndex:"",label:t.placeholder||"Add tag",icon:"",testId:"",tagStyle:ws({isAddChip:!0})}];return{containerAttrString:s,isDisabled:r,isOpen:e.isOpen,position:e.position,options:p,hasSelectableOptions:c,placeholder:t.placeholder||"Add tag",triggerTags:h,triggerCursor:r?"not-allowed":"pointer",triggerTabIndex:r?-1:0,showAddOption:!r&&!t.noAdd,addOptionLabel:t.addOption?.label||"Add tag",hasDraftChanges:d,submitDisabled:r,submitLabel:"Save"}},$u=({state:e})=>ye(e.selectedValues),Cu=({state:e})=>!!e.hasSelectedValues,Iu=({state:e})=>ye(e.draftSelectedValues),Ou=({state:e},t={})=>{let{position:s,values:r}=t;e.position={...e.position,...s||{}},e.draftSelectedValues=ye(r),e.isOpen=!0},Tu=({state:e})=>{e.isOpen=!1,e.draftSelectedValues=[]},Lu=({state:e},t={})=>{e.draftSelectedValues=ye(t.values)},Vu=({state:e},t={})=>{let s=ye(t.values);e.selectedValues=s,e.hasSelectedValues=!0,(t.syncDraft||!e.isOpen)&&!t.preserveDraft&&(e.draftSelectedValues=[...s])},Nu=({state:e},t={})=>{let s=ye(e.draftSelectedValues),r=t.value,i=s.findIndex(n=>le(n,r));if(i>=0){e.draftSelectedValues=s.filter((n,o)=>o!==i);return}e.draftSelectedValues=[...s,r]},Ru=({state:e})=>{e.selectedValues=ye(e.draftSelectedValues),e.hasSelectedValues=!0,e.isOpen=!1,e.draftSelectedValues=[]},ju=Object.freeze(Object.defineProperty({__proto__:null,closeOptionsPopover:Tu,commitDraftSelectedValues:Ru,createInitialState:ku,openOptionsPopover:Ou,selectDraftSelectedValues:Iu,selectHasSelectedValues:Cu,selectSelectedValues:$u,selectViewData:Eu,toggleDraftSelectedValue:Nu,updateDraftSelectedValues:Lu,updateSelectedValues:Vu},Symbol.toStringTag,{value:"Module"})),Du=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Pu=()=>Object.freeze({}),Hr={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))"}},Bu=({props:e})=>{let t=Hr[e.s]?e.s:"sm",s=Hr[t];return{open:!!e.open,x:e.x||0,y:e.y||0,place:e.place||"t",content:e.content||"",textSize:s.textSize,padding:s.padding,contentStyle:`padding: 0; min-width: 0; max-width: ${s.maxWidth};`}},zu=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Pu,selectViewData:Bu},Symbol.toStringTag,{value:"Module"})),Wu=async e=>{let{props:t,store:s,render:r,refs:i}=e,{waveformData:n}=t;s.setWaveformData({data:n}),r();let o=i.canvas;o&&en(n,o)},Mu=async(e,t)=>{let{store:s,render:r,refs:i,props:n}=e,{waveformData:o}=n;if(!o){console.log("waveform handleOnUpdate: no waveformData provided");return}s.setWaveformData({data:o}),r();let l=i.canvas;l&&en(o,l)};async function en(e,t){let s=t.getContext("2d"),r=t.getBoundingClientRect(),i=r.width,n=r.height;t.width=i,t.height=n;let o=t.width,l=t.height;if(s.clearRect(0,0,o,l),s.fillStyle="#1a1a1a",s.fillRect(0,0,o,l),!e||!e.amplitudes)return;let p=e.amplitudes,a=l/2,c=s.createLinearGradient(0,0,0,l);c.addColorStop(0,"#404040"),c.addColorStop(.5,"#A1A1A1"),c.addColorStop(1,"#404040");let d=Math.max(1,o/p.length),h=.2;for(let f=0;f<p.length;f++){let u=p[f]/255*(l*.85),y=f*d,m=a-u/2;s.fillStyle=c,s.fillRect(y,m,Math.max(1,d*(1-h)),u)}s.strokeStyle="rgba(255, 255, 255, 0.1)",s.lineWidth=1,s.beginPath(),s.moveTo(0,a),s.lineTo(o,a),s.stroke(),s.shadowBlur=10,s.shadowColor="#2196F3"}var Fu=Object.freeze(Object.defineProperty({__proto__:null,handleAfterMount:Wu,handleOnUpdate:Mu},Symbol.toStringTag,{value:"Module"})),Ku=()=>Object.freeze({waveformData:null}),Uu=({state:e},t={})=>{e.waveformData=t.data},Hu=({state:e,props:t})=>({isLoading:t.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:t.waveformData}),qu=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Ku,selectViewData:Hu,setWaveformData:Uu},Symbol.toStringTag,{value:"Module"})),tn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sn=e=>e.replace(/-([a-z0-9])/g,(t,s)=>s.toUpperCase()),_s=e=>{if(e!=null)return e===""?!0:e},wt=(e,t)=>{let s=e.getAttribute(t);if(s!==null)return _s(s);let r=tn(t);if(r!==t){let i=e.getAttribute(r);if(i!==null)return _s(i)}},ps=Symbol("rtglReactivePropValues"),ds=Symbol("rtglNativeHostStyle"),Yu=(e,t)=>{let s=Object.getPrototypeOf(e);for(;s;){let r=Object.getOwnPropertyDescriptor(s,t);if(r)return r;s=Object.getPrototypeOf(s)}},rn=e=>{if(!e||typeof e!="object")return;if(Object.prototype.hasOwnProperty.call(e,ds))return e[ds];let t=Yu(e,"style"),s;return typeof t?.get=="function"?s=t.get.call(e):e.style&&typeof e.style=="object"&&(s=e.style),s&&typeof s=="object"&&Object.defineProperty(e,ds,{value:s,enumerable:!1,configurable:!1,writable:!1}),s},Gu=e=>(Object.prototype.hasOwnProperty.call(e,ps)||Object.defineProperty(e,ps,{value:Object.create(null),enumerable:!1,configurable:!1,writable:!1}),e[ps]),Ju=({source:e,allowedKeys:t=[],onPropChange:s})=>{let r=Gu(e);t.includes("style")&&rn(e),t.forEach(i=>{if(typeof i!="string"||i.length===0)return;let n=Object.prototype.hasOwnProperty.call(e,i)?e[i]:void 0,o=Object.prototype.hasOwnProperty.call(e,i);o&&delete e[i],Object.defineProperty(e,i,{configurable:!0,enumerable:!0,get(){return Object.prototype.hasOwnProperty.call(r,i)?r[i]:wt(e,i)},set(l){let p=Object.prototype.hasOwnProperty.call(r,i)?r[i]:wt(e,i);l===void 0?delete r[i]:r[i]=l,p!==l&&s?.({propName:i,oldValue:p,newValue:l})}}),o&&(r[i]=n)})},Zu=(e,t)=>{let s=new Set(t);return new Proxy({},{get(r,i){if(typeof i=="string"&&s.has(i)){let n=e[i];return n!==void 0?n:wt(e,i)}},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(r,i){return typeof i=="string"&&s.has(i)},ownKeys(){return[...s]},getOwnPropertyDescriptor(r,i){if(typeof i=="string"&&s.has(i))return{configurable:!0,enumerable:!0,get:()=>{let n=e[i];return n!==void 0?n:wt(e,i)}}}})},Xu=({schema:e,methodExports:t=[]})=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("componentName is required.");if(typeof e.componentName!="string"||e.componentName.trim()==="")throw new Error("componentName is required.");if(Object.prototype.hasOwnProperty.call(e,"attrsSchema"))throw new Error("attrsSchema is not supported.");if(Object.prototype.hasOwnProperty.call(e,"methods")){let s=e.methods;if(!s||typeof s!="object"||Array.isArray(s))throw new Error("methods must be an object schema with a properties map.");if(Object.prototype.hasOwnProperty.call(s,"type")&&s.type!=="object")throw new Error("methods.type must be 'object'.");if(!s.properties||typeof s.properties!="object"||Array.isArray(s.properties))throw new Error("methods.properties must be an object keyed by method name.");for(let r of Object.keys(s.properties))if(!t.includes(r))throw new Error(`method '${r}' is declared in schema but missing in .methods.js exports.`)}return!0},v={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9,PARTIAL:10,PATH_REFERENCE:11},P={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},xs={NOT:0},E=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},re=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}},qr=e=>{if(!e||e.trim()==="")throw new E("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let s=e.includes("===")?"==":"!=";throw new E(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${s}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let s of t)if(e.trim().endsWith(s))throw new E(`Incomplete comparison expression - missing right operand (got: '${e}')`)},Qu=e=>{if(e.trim().endsWith(" in"))throw new E(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new E(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,s]=e.split(" in ");if(!s||s.trim()==="")throw new E(`Missing iterable expression after 'in' (got: '$for ${e}')`);let r=t.includes(",")?t.split(",").map(i=>i.trim()):[t.trim()];for(let i of r){if(!i)throw new E(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(i))throw new E(`Invalid loop syntax (got: '$for ${e}')`)}},eh=(e,t,s=!1)=>{if(t===null)return new re(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new re(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return s?new re(`Cannot iterate over non-array value in loop '${e}' - got ${r} instead`):new re(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},th=(e,t)=>{let s=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new re(`Unknown function '${e}' (${s})`)},nn=(e,t,s={})=>{let r={},i={};s&&typeof s=="object"&&(s.functions!==void 0||s.partials!==void 0?(r=s.functions||{},i=s.partials||{}):typeof s=="object"&&(r=s));let n=R(e,{functions:r,partials:i},t,{});return n===void 0?{}:n},R=(e,t,s,r)=>{if(t.functions,e.var&&!e.type)return U(e.var,s,r);if(e.type===v.LITERAL)return e.value;if(e.type===v.VARIABLE)return U(e.path,s,r);if(e.type===v.INTERPOLATION)return rh(e.parts,t,s,r);switch(e.type){case v.FUNCTION:return on(e,t,s,r);case v.BINARY:return an(e,t,s,r);case v.UNARY:return ln(e,t,s,r);case v.CONDITIONAL:return nh(e,t,s,r);case v.LOOP:return dh(e,t,s,r);case v.OBJECT:return uh(e,t,s,r);case v.ARRAY:return hh(e,t,s,r);case v.PARTIAL:return fh(e,t,s,r);case v.PATH_REFERENCE:return yh(e,t,s,r);default:throw new Error(`Unknown node type: ${e.type}`)}},Yr=new Map,sh=e=>{let t=[],s="",r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(n==="[")s&&(t.push({type:"property",value:s}),s=""),r=!0;else if(n==="]"){if(r&&s){let o=s.trim();if(/^\d+$/.test(o))t.push({type:"index",value:parseInt(o,10)});else if(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'")){let l=o.slice(1,-1);t.push({type:"property",value:l})}else t.push({type:"property",value:o});s=""}r=!1}else s+=n}return s&&t.push({type:"property",value:s}),t},U=(e,t,s)=>{if(!e)return;if(e in s)return s[e];let r=Yr.get(e);if(!r){let n=[],o="",l=0;for(let p=0;p<e.length;p++){let a=e[p];a==="["?(l++,o+=a):a==="]"?(l--,o+=a):a==="."&&l===0?o&&(n.push(o),o=""):o+=a}o&&n.push(o),r=[];for(let p of n){let a=sh(p.trim());r.push(...a)}Yr.set(e,r)}let i=t;for(let n=0;n<r.length;n++){let o=r[n];if(o.type==="property"&&o.value in s){i=s[o.value];continue}if(i==null)return;(o.type==="property"||o.type==="index")&&(i=i[o.value])}return i},rh=(e,t,s,r)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let o=R(n,t,s,r);i.push(o!=null?String(o):"")}return i.join("")},on=(e,t,s,r)=>{let i=t.functions||t,n=i[e.name];if(!n)throw th(e.name,i);let o=e.args.map(l=>R(l,t,s,r));return n(...o)},Be=(e,t,s,r)=>{if(e.var&&!e.type)return U(e.var,s,r);switch(e.type){case v.VARIABLE:return U(e.path,s,r);case v.LITERAL:return e.value;case v.BINARY:return an(e,t,s,r);case v.UNARY:return ln(e,t,s,r);case v.FUNCTION:return on(e,t,s,r);default:return R(e,t,s,r)}},an=(e,t,s,r)=>{if(e.op===P.AND||e.op===P.OR){let o=Be(e.left,t,s,r),l=Be(e.right,t,s,r);switch(e.op){case P.AND:return o&&l;case P.OR:return o||l}}let i=R(e.left,t,s,r),n=R(e.right,t,s,r);switch(e.op){case P.EQ:return i==n;case P.NEQ:return i!=n;case P.GT:return i>n;case P.LT:return i<n;case P.GTE:return i>=n;case P.LTE:return i<=n;case P.IN:return Array.isArray(n)?n.includes(i):!1;case P.ADD:if(typeof i!="number"||typeof n!="number")throw new re(`Arithmetic operations require numbers. Got ${typeof i} + ${typeof n}`);return i+n;case P.SUBTRACT:if(typeof i!="number"||typeof n!="number")throw new re(`Arithmetic operations require numbers. Got ${typeof i} - ${typeof n}`);return i-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},ln=(e,t,s,r)=>{let i=e.op===xs.NOT?Be(e.operand,t,s,r):R(e.operand,t,s,r);switch(e.op){case xs.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},ih=(e,t,s,r)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===v.VARIABLE)if(U(i.path,s,r)){let n=e.bodies[0];if(n.type===v.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?R(l.parsedKey,t,s,r):l.key,a=l.value;if(a.type===v.LITERAL)o[p]=a.value;else if(a.type===v.VARIABLE)o[p]=U(a.path,s,r);else if(a.type===v.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let h=U(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=R(d,t,s,r);c.push(h!=null?String(h):"")}o[p]=c.join("")}else o[p]=R(a,t,s,r)}return o}}else{let n=e.bodies[1];if(n.type===v.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?R(l.parsedKey,t,s,r):l.key,a=l.value;if(a.type===v.LITERAL)o[p]=a.value;else if(a.type===v.VARIABLE)o[p]=U(a.path,s,r);else if(a.type===v.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let h=U(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=R(d,t,s,r);c.push(h!=null?String(h):"")}o[p]=c.join("")}else o[p]=R(a,t,s,r)}return o}}}return null},nh=(e,t,s,r)=>{let i=ih(e,t,s,r);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||Be(o,t,s,r))return R(e.bodies[n],t,s,r)}return pn},oh=(e,t)=>{let s=e.body,r=e.itemVar;if(s.type===v.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===v.VARIABLE){let i=s.conditions[0].path,n=s.bodies[0];if(i.startsWith(r+".")){let o=i.substring(r.length+1);if(n.type===v.OBJECT&&n.properties.length<=5){for(let p of n.properties)if(p.parsedKey)return null;let l=[];for(let p=0;p<t.length;p++){let a=t[p];if(a[o]){let c={};for(let d of n.properties){let h=d.key,f=d.value;if(f.type===v.LITERAL)c[h]=f.value;else if(f.type===v.VARIABLE){let u=f.path;if(u===r)c[h]=a;else if(u.startsWith(r+".")){let y=u.substring(r.length+1);c[h]=a[y]}else return null}else if(f.type===v.INTERPOLATION){let u=[],y=!0;for(let m of f.parts)if(typeof m=="string")u.push(m);else if(m.type===v.VARIABLE){let b=m.path;if(b===r)u.push(a!=null?String(a):"");else if(b.startsWith(r+".")){let g=b.substring(r.length+1),_=a[g];u.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[h]=u.join("")}else return null}l.push(c)}}return l}}}return null},ah=(e,t)=>{let s=e.body,r=e.itemVar,i=oh(e,t);if(i!==null)return i;if(s.type===v.OBJECT&&s.properties.length<=5&&!s.whenCondition){for(let l of s.properties)if(l.parsedKey)return null;let n=[],o=!0;for(let l of s.properties){let p=l.key,a=l.value;if(a.type===v.LITERAL)n.push({key:p,type:"literal",value:a.value});else if(a.type===v.VARIABLE){let c=a.path;if(c===r)n.push({key:p,type:"item"});else if(c.startsWith(r+".")){let d=c.substring(r.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:p,type:"prop",prop:d});else{o=!1;break}}else{o=!1;break}}else if(a.type===v.INTERPOLATION&&a.parts.length===1){let c=a.parts[0];if(c.type===v.VARIABLE){let d=c.path;if(d===r)n.push({key:p,type:"item_string"});else if(d.startsWith(r+".")){let h=d.substring(r.length+1);if(!h.includes(".")&&!h.includes("["))n.push({key:p,type:"prop_string",prop:h});else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}if(o){let l=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 p=0;p<t.length;p++){let a=t[p];l[p]={id:a.id,title:a.title!=null?String(a.title):"",completed:a.completed}}else for(let p=0;p<t.length;p++){let a=t[p],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):""}l[p]=c}return l}}return null},lh=(e,t,s,r,i)=>{let n=[],o=e.body;if(o.type===v.OBJECT&&o.fast!==!1){let l=e.itemVar,p=e.indexVar;for(let a=0;a<i.length;a++){let c=i[a],d={},h={...r,[l]:c,...p&&{[p]:a}};h.__paths__||(h.__paths__=r.__paths__||{});let f=e.iterable.path||"";if(r&&r.__paths__&&f){let u=f.split("."),y=u[0];y in r.__paths__&&(f=r.__paths__[y],u.length>1&&(f+="."+u.slice(1).join(".")))}h.__paths__={...h.__paths__,[l]:`${f}[${a}]`,...p&&{[p]:a}};for(let u of o.properties){let y=u.parsedKey?R(u.parsedKey,t,s,h):u.key,m=u.value;if(m.type===v.LITERAL)d[y]=m.value;else if(m.type===v.VARIABLE){let b=m.path;if(b===l)d[y]=c;else if(b===p)d[y]=a;else if(b.startsWith(l+".")){let g=b.substring(l.length+1);!g.includes(".")&&!g.includes("[")?d[y]=c[g]:d[y]=U(b,s,{...r,[l]:c,...p&&{[p]:a}})}else d[y]=U(b,s,{...r,[l]:c,...p&&{[p]:a}})}else if(m.type===v.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=g.path,S;if(_===l)S=c;else if(_===p)S=a;else if(_.startsWith(l+".")){let A=_.substring(l.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=U(_,s,{...r,[l]:c,...p&&{[p]:a}})}else S=U(_,s,{...r,[l]:c,...p&&{[p]:a}});b.push(S!=null?String(S):"")}else{let _={...r,[l]:c,...p&&{[p]:a}},S=R(g,t,s,_);b.push(S!=null?String(S):"")}d[y]=b.join("")}else{let b={...r,[l]:c,...p&&{[p]:a}};d[y]=R(m,t,s,b)}}n.push(d)}return n}return null},ph=(e,t,s)=>{let r=e.body;if(r.type===v.OBJECT&&r.properties.length===1&&r.properties[0].key==="$if item.visible"){let i=r.properties[0].value;if(i.type===v.CONDITIONAL&&i.conditions.length===1&&i.conditions[0].type===v.VARIABLE&&i.conditions[0].path==="item.visible"){let n=i.bodies[0];if(n.type===v.OBJECT&&n.properties.length===2){let o=n.properties[0],l=n.properties[1];if(o.key==="id"&&o.value.type===v.VARIABLE&&o.value.path==="item.id"&&l.key==="$if item.highlighted"&&l.value.type===v.CONDITIONAL){let p=[];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),p.push(d)}}return p}}}}return null},dh=(e,t,s,r)=>{let i=R(e.iterable,t,s,r);if(!Array.isArray(i)){let a,c=!1;if(e.iterable.type===v.FUNCTION){c=!0;let h=e.iterable.args.map(f=>f.type===v.LITERAL?typeof f.value=="string"?`'${f.value}'`:String(f.value):f.type===v.VARIABLE?f.path:f.type===v.FUNCTION?`${f.name}(...)`:"?").join(", ");a=`${e.iterable.name}(${h})`}else a=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${a}`;throw eh(d,i,c)}if(!e.indexVar){let a=ph(e,i,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=ah(e,i);if(a!==null)return a}let n=lh(e,t,s,r,i);if(n!==null)return n;let o=[],l=e.iterable.path||"";if(r&&r.__paths__&&l){let a=l.split("."),c=a[0];c in r.__paths__&&(l=r.__paths__[c],a.length>1&&(l+="."+a.slice(1).join(".")))}let p=!1;e.body.type===v.ARRAY&&(e.body.items.length<=1?p=!1:p=e.body._shouldPreserveArray??=e.body.items.some(a=>a.type===v.OBJECT&&a.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let a=0;a<i.length;a++){let c=e.indexVar?{...r,[e.itemVar]:i[a],[e.indexVar]:a}:{...r,[e.itemVar]:i[a]};c.__paths__||(c.__paths__=r.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${l}[${a}]`},e.indexVar&&(c.__paths__[e.indexVar]=a);let d=R(e.body,t,s,c);if(Array.isArray(d)&&d.length===1&&!p){let h=d[0];o.push(h===void 0?{}:h)}else o.push(d===void 0?{}:d)}return o},ch=(e,t,s,r)=>{if(e.whenCondition)return null;if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?R(i.parsedKey,t,s,r):i.key,o=i.value;if(o.type===v.OBJECT&&o.properties.length<=10&&!o.whenCondition){let l={},p={},a=!0;for(let c of o.properties){let d=c.parsedKey?R(c.parsedKey,t,s,r):c.key,h=c.value;if(h.type===v.LITERAL)p[d]=h.value;else if(h.type===v.VARIABLE)p[d]=U(h.path,s,r);else if(h.type===v.INTERPOLATION){let f=[];for(let u of h.parts)if(typeof u=="string")f.push(u);else if(u.type===v.VARIABLE){let y=U(u.path,s,r);f.push(y!=null?String(y):"")}else{a=!1;break}if(!a)break;p[d]=f.join("")}else if(h.type===v.OBJECT&&h.properties.length<=5){let f={};for(let u of h.properties){let y=u.key,m=u.value;if(m.type===v.LITERAL)f[y]=m.value;else if(m.type===v.VARIABLE)f[y]=U(m.path,s,r);else if(m.type===v.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=U(g.path,s,r);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[y]=b.join("")}else{a=!1;break}}if(!a)break;p[d]=f}else{a=!1;break}}if(a)return l[n]=p,l}}return null},uh=(e,t,s,r)=>{let i=t.functions||t;if(e.whenCondition&&!Be(e.whenCondition,i,s,r))return;let n=ch(e,t,s,r);if(n!==null)return n;if(e.fast){let p={};for(let a of e.properties){let c=a.parsedKey?R(a.parsedKey,t,s,r):a.key,d=a.value;if(d.type===v.LITERAL)p[c]=d.value;else if(d.type===v.VARIABLE)p[c]=U(d.path,s,r);else if(d.type===v.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===v.VARIABLE){let u=U(f.path,s,r);h.push(u!=null?String(u):"")}else{let u=R(f,t,s,r);h.push(u!=null?String(u):"")}p[c]=h.join("")}else p[c]=R(d,t,s,r)}return p}let o={},l=!1;for(let p of e.properties)if(!p.key.startsWith("$if ")&&!p.key.match(/^\$if\s+\w+.*:?$/)&&!p.key.startsWith("$elif")&&!p.key.startsWith("$else")&&!p.key.startsWith("$for ")){l=!0;break}for(let p of e.properties)if(p.key.startsWith("$if ")||p.key.match(/^\$if\s+\w+.*:?$/)){let a=R(p.value,t,s,r);if(!l&&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(p.key.startsWith("$for ")){if(e.properties.length===1)return R(p.value,t,s,r)}else{let a=p.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,s,r);d!==void 0&&(o[p.key]=d)}else{let d=R(p.value,t,s,r);d!==void 0&&(o[p.key]=d)}}else{let c=p.parsedKey?R(p.parsedKey,t,s,r):p.key,d=R(p.value,t,s,r);d!==void 0&&(o[c]=d)}}return o},pn={},hh=(e,t,s,r)=>{let i=[];for(let n of e.items)if(n.type===v.LOOP){let o=R(n,t,s,r);Array.isArray(o)&&n.flatten!==!1?i.push(...o):i.push(o)}else{let o=R(n,t,s,r);o!==pn&&o!==void 0&&i.push(o)}return i},fh=(e,t,s,r)=>{let{name:i,data:n,whenCondition:o}=e,l=t.partials||{},p=t.functions||t;if(o&&!Be(o,p,s,r))return;if(!l[i])throw new re(`Partial '${i}' is not defined`);let a=r._partialStack||[];if(a.includes(i))throw new re(`Circular partial reference detected: ${i}`);let c=l[i],d=s,h={...r,_partialStack:[...a,i]};if(r){d={...s};for(let f of Object.keys(r))f.startsWith("_")||(d[f]=r[f])}if(n){let f=R(n,t,s,r);d={...d,...f}}return R(c,t,d,h)},yh=(e,t,s,r)=>{let{path:i}=e,n=i.split("."),o=n[0],l=n.slice(1);if(!r||!(o in r))throw new re(`Path reference '#{${i}}' refers to '${o}' which is not a loop variable in the current scope`);if(r.__paths__||(r.__paths__={}),!(o in r.__paths__))throw new re(`Path reference '#{${i}}' cannot be resolved - path tracking may not be initialized properly`);let p=r.__paths__[o];if(typeof p=="number"){if(l.length>0)throw new re(`Path reference '#{${i}}' - cannot access properties on index variable '${o}'`);return String(p)}return l.length>0&&(p+="."+l.join(".")),p},mh=/\$\{([^}]*)\}/g,gh=/#\{([^}]*)\}/g,dn=(e,t={})=>{let s=e.match(/^(\w+)\((.*)\)$/);if(!s)return{isFunction:!1};let[,r,i]=s,n=bh(i,t);return{isFunction:!0,type:v.FUNCTION,name:r,args:n}},bh=(e,t={})=>e.trim()?vh(e).map(s=>wh(s.trim(),t)):[],vh=e=>{let t=[],s="",r=0,i=!1,n="";for(let o=0;o<e.length;o++){let l=e[o],p=o>0?e[o-1]:"";!i&&(l==='"'||l==="'")?(i=!0,n=l,s+=l):i&&l===n&&p!=="\\"?(i=!1,n="",s+=l):!i&&l==="("?(r++,s+=l):!i&&l===")"?(r--,s+=l):!i&&l===","&&r===0?(t.push(s),s=""):s+=l}return s&&t.push(s),t},wh=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:v.LITERAL,value:parseFloat(e)};if(e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};let s=dn(e,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};let r=e.trim(),i=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:o,type:l}of i){let p=0;for(;p<r.length;){let a=Ve(r.substring(p),o);if(a===-1)break;let c=p+a;c>n&&(n=c),p=c+o.length}}if(n!==-1)try{return Q(r,t)}catch{return{type:v.VARIABLE,path:r}}return{type:v.VARIABLE,path:r}},cn=/^\w+\(.*\)$/,_h=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,xh=e=>{if(!(!e||e.trim()===""||cn.test(e))&&_h.test(e))throw e.includes("?")&&e.includes(":")?new E(`Complex expressions not supported in variable replacements - consider calculating the value in your data instead. Offending expression: "${e}"`):e.includes("||")||e.includes("&&")||e.includes("??")?new E(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new E(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},Gr=e=>{let t=e.trim();if(cn.test(t))throw new E(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new E(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new E(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new E(`Logical operators not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("?")&&t.includes(":"))throw new E(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:v.PATH_REFERENCE,path:t}},_t=(e,t={})=>{let s=e.trim();xh(s);let r=dn(s,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};if(s.includes("[")&&!/[\s+\-*/%|&?:]/.test(s)){let i=0;for(let n of s)n==="["?i++:n==="]"&&i--;if(i!==0)throw new Error("Invalid array index syntax")}return{type:v.VARIABLE,path:s}},un=(e,t={})=>{let s=e,r=[];(e.includes("\\${")||e.includes("\\#{"))&&(s=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),s=s.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),s=s.replace(/\\(\$\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\(#\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\DOUBLE_ESC_VAR/g,"\\"),s=s.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let i=[...s.matchAll(mh)],n=[...s.matchAll(gh)],o=[...i.map(a=>({match:a,type:"variable"})),...n.map(a=>({match:a,type:"pathref"}))].sort((a,c)=>a.match.index-c.match.index);if(o.length===0){let a=s;for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);return{type:v.LITERAL,value:a}}if(o.length===1&&o[0].match[0]===s&&r.length===0){let{match:a,type:c}=o[0];try{return c==="variable"?_t(a[1],t):Gr(a[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:v.LITERAL,value:s};throw d}}let l=[],p=0;for(let{match:a,type:c}of o){let[d,h]=a,f=a.index;if(f>p){let u=s.substring(p,f);for(let y=0;y<r.length;y++)u=u.replace(`__ESCAPED_${y}__`,r[y]);u&&l.push(u)}try{let u;c==="variable"?u=_t(h.trim(),t):u=Gr(h.trim()),l.push(u)}catch(u){if(u.message==="Invalid array index syntax")l.push(d);else throw u}p=f+d.length}if(p<s.length){let a=s.substring(p);for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);a&&l.push(a)}return{type:v.INTERPOLATION,parts:l}},Ee=(e,t)=>typeof e=="string"?un(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Ah(e,t):kh(e,t):{type:v.LITERAL,value:e},Sh=e=>{let{$each:t,...s}=e;if(typeof t!="string")throw new E("$each value must be a non-empty string");let r=t.trim();if(r==="")throw new E("$each value must be a non-empty string");if(Object.keys(s).length===0)throw new E("Empty $each body not allowed");if(s.$partial!==void 0)throw new E("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${r}`]:s}},Ah=(e,t)=>{let s=[],r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let p=Sh(n),a=Object.keys(p);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let c=Jr(a[0],p[a[0]],t,!0);s.push(c),r=!0;continue}}catch(p){throw p instanceof E?p:new E(p.message)}let l=Object.keys(n);if(l.length===1&&/^\$for(?::\w+)?\s/.test(l[0])){let p=Jr(l[0],n[l[0]],t);s.push(p),r=!0;continue}}let o=Ee(n,t);s.push(o),(o.type===v.FUNCTION||o.type===v.CONDITIONAL||o.type===v.LOOP||o.type===v.PARTIAL||o.type===v.OBJECT&&!o.fast||o.type===v.ARRAY&&!o.fast)&&(r=!0)}return{type:v.ARRAY,items:s,fast:!r}},kh=(e,t)=>{let s=[],r=!1,i=null,n=Object.entries(e),o=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new E("$partial value must be a string");if(e.$partial.trim()==="")throw new E("$partial value cannot be an empty string");let p=["$if","$elif","$else","$for"],a=[];for(let[b]of n)for(let g of p)if(b===g||b.startsWith(g+" ")||b.startsWith(g+"#")){a.push(g);break}if(a.length>0)throw new E(`Cannot use $partial with ${a.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...h}=e,f={},u=!1;for(let[b,g]of Object.entries(h)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=g,u=!0}let y=null;if(u&&(y=Ee(f,t),y.type===v.OBJECT)){let b=!1;for(let g of y.properties)if(g.value.type===v.VARIABLE||g.value.type===v.INTERPOLATION||g.value.type===v.FUNCTION||g.value.type===v.CONDITIONAL||g.value.type===v.OBJECT&&!g.value.fast||g.value.type===v.ARRAY&&!g.value.fast){b=!0;break}b&&(y.fast=!1)}let m={type:v.PARTIAL,name:c,data:y};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new E("Empty condition expression after '$when'");b=Q(d,t)}else b={type:v.LITERAL,value:d};m.whenCondition=b}return m}for(let[p,a]of n)if(p==="$when"){if(i!==null)throw new E("Multiple '$when' directives on the same object are not allowed");if(a==null)throw new E("Missing condition expression after '$when'");let c=typeof a=="string"?a:JSON.stringify(a);if(c.trim()==="")throw new E("Empty condition expression after '$when'");i=Q(c,t),r=!0}else if(p.startsWith("$when#")||p.startsWith("$when "))throw new E("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;o<n.length;){let[p,a]=n[o];if(p==="$when"){o++;continue}if(p==="$each")throw new E("$each can only be used inside arrays");if(p.startsWith("$if ")||p.match(/^\$if#\w+\s/)||p.match(/^\$if\s+\w+.*:$/)){let c=Eh(n,o,t);s.push({key:p,value:c.node}),r=!0,o=c.nextIndex}else if(/^\$for(?::\w+)?\s/.test(p)){let c=p.match(/^\$for(?::(\w+))?\s/)?.[1]||"",d=c?`:${c}`:"";throw new E(`$for loops must be inside arrays - use '- $for${d} item in items:' instead of '$for${d} item in items:'. For cleaner object generation syntax, consider using $each.`)}else{if(p.startsWith("$elif ")||p.startsWith("$else"))throw new E(`'${p.split(" ")[0]}' without matching '$if'`);if(p==="$if"||p==="$if:")throw new E("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)&&(r=!0);let d=un(p,t),h={key:p,value:c};(d.type!==v.LITERAL||d.value!==p)&&(h.parsedKey=d),s.push(h),o++}}}let l={type:v.OBJECT,properties:s,fast:!r};return i&&(l.whenCondition=i),l},Eh=(e,t,s={})=>{let r=[],i=[],n=t,[o,l]=e[n],p=null,a;if(o.startsWith("$if#")){let d=o.match(/^\$if#(\w+)\s+(.+)$/);if(d)p=d[1],a=d[2];else throw new E(`Invalid conditional syntax: ${o}`)}else a=o.substring(4),a.endsWith(":")&&(a=a.slice(0,-1).trim());qr(a);let c=Q(a,s);for(r.push(c),i.push(Ee(l,s)),n++;n<e.length;){let[d,h]=e[n],f=!1,u;if(p?d.startsWith(`$elif#${p} `)?(u=d.substring(`$elif#${p} `.length),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d===`$else#${p}`||d===`$else#${p}:`)&&(f=!0,u=null):d.startsWith("$elif ")?(u=d.substring(6),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,u=null),f){if(u===null)r.push(null);else{qr(u);let y=Q(u,s);r.push(y)}if(i.push(Ee(h,s)),n++,u===null)break}else break}return{node:{type:v.CONDITIONAL,conditions:r,bodies:i,id:p},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 s=Ve(e,"||");if(s!==-1)return{type:v.BINARY,op:P.OR,left:Q(e.substring(0,s).trim(),t),right:Q(e.substring(s+2).trim(),t)};let r=Ve(e,"&&");if(r!==-1)return{type:v.BINARY,op:P.AND,left:Q(e.substring(0,r).trim(),t),right:Q(e.substring(r+2).trim(),t)};let i=[{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 i){let d=Ve(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,l=[{op:" + ",type:P.ADD},{op:" - ",type:P.SUBTRACT}];for(let{op:a,type:c}of l){let d=0;for(;d<e.length;){let h=Ve(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 p=[" * "," / "," % "];for(let a of p)if(Ve(e,a)!==-1)throw new E(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:v.UNARY,op:xs.NOT,operand:Q(e.substring(1).trim(),t)}:hn(e,t)},Ve=(e,t)=>{let s=0,r=0;for(;r<=e.length-t.length;){if(e[r]==="(")s++;else if(e[r]===")")s--;else if(s===0&&e.substring(r,r+t.length)===t)return r;r++}return-1},$h=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}},hn=(e,t)=>{let s=e.trim();if(s.match(/^(\w+)\((.*)\)$/))return _t(s,t);let r=$h(s);if(r.type===v.LITERAL)return r;if(/^[a-zA-Z_$][\w.$]*$/.test(s))return{type:v.VARIABLE,path:s};try{return _t(s,t)}catch(i){if(i.message&&i.message.includes("not supported"))return r;throw i}},Ch=(e,t=!1)=>{try{Qu(e)}catch(s){if(s instanceof E&&t){let r=s.message.replace(/\$for/g,"$each");throw new E(r.replace("Parse Error: ",""))}throw s}},Jr=(e,t,s,r=!1)=>{let i=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(i);if(!n){let m=r?"$each":"$for";throw new E(`Invalid loop syntax (got: '${e.replace("$for",m)}')`)}let o=n[1],l=n[2].trim();Ch(l,r);let p=l.match(/^(.+?)\s+in\s+(.+)$/);if(!p){let m=r?"$each":"$for";throw new E(`Invalid loop syntax - missing 'in' keyword (got: '${m} ${l}')`)}let a=p[1].trim(),c=p[2].trim(),d,h=null;if(a.includes(",")){let m=a.split(",").map(b=>b.trim());if(m.length!==2)throw new E(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=m[0],h=m[1]}else d=a;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new E(`Reserved variable name: ${d}`);if(h&&f.includes(h))throw new E(`Reserved variable name: ${h}`);let u=hn(c,s),y=Ee(t,s);return{type:v.LOOP,itemVar:d,indexVar:h,iterable:u,body:y,flatten:o!=="nested"}},Ss=(e,t={})=>{let{functions:s={}}=t;return Ee(e,s)},Ih=()=>Date.now(),Oh=Object.freeze(Object.defineProperty({__proto__:null,now:Ih},Symbol.toStringTag,{value:"Module"})),fn=(e,t,s={})=>{let{functions:r={},partials:i={}}=s,n={...Oh,...r},o=Ss(e,{functions:n}),l={};for(let[p,a]of Object.entries(i))l[p]=Ss(a,{functions:n});return nn(o,t,{functions:n,partials:l})},Qe=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Th=(e,t)=>{!t||typeof t!="object"||Object.entries(t).forEach(([s,r])=>{if(s==="default")throw new Error("[Methods] Invalid method name 'default'. Use named exports in .methods.js; default export is not supported.");if(typeof r=="function"){if(s in e)throw new Error(`[Methods] Cannot define method '${s}' because it already exists on the component instance.`);Object.defineProperty(e,s,{configurable:!0,enumerable:!1,writable:!1,value:(i={})=>{let n=i===void 0?{}:i;if(!Qe(n))throw new Error(`[Methods] Method '${s}' expects payload to be an object.`);return r.call(e,n)}})}})},yn=Symbol.for("immer-nothing"),Zr=Symbol.for("immer-draftable"),oe=Symbol.for("immer-state");function ce(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ze=Object.getPrototypeOf;function We(e){return!!e&&!!e[oe]}function $e(e){return e?mn(e)||Array.isArray(e)||!!e[Zr]||!!e.constructor?.[Zr]||Ot(e)||Tt(e):!1}var Lh=Object.prototype.constructor.toString();function mn(e){if(!e||typeof e!="object")return!1;let t=ze(e);if(t===null)return!0;let s=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return s===Object?!0:typeof s=="function"&&Function.toString.call(s)===Lh}function xt(e,t){It(e)===0?Reflect.ownKeys(e).forEach(s=>{t(s,e[s],e)}):e.forEach((s,r)=>t(r,s,e))}function It(e){let t=e[oe];return t?t.type_:Array.isArray(e)?1:Ot(e)?2:Tt(e)?3:0}function As(e,t){return It(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function gn(e,t,s){let r=It(e);r===2?e.set(t,s):r===3?e.add(s):e[t]=s}function Vh(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ot(e){return e instanceof Map}function Tt(e){return e instanceof Set}function Se(e){return e.copy_||e.base_}function ks(e,t){if(Ot(e))return new Map(e);if(Tt(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let s=mn(e);if(t===!0||t==="class_only"&&!s){let r=Object.getOwnPropertyDescriptors(e);delete r[oe];let i=Reflect.ownKeys(r);for(let n=0;n<i.length;n++){let o=i[n],l=r[o];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(r[o]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[o]})}return Object.create(ze(e),r)}else{let r=ze(e);if(r!==null&&s)return{...e};let i=Object.create(r);return Object.assign(i,e)}}function Us(e,t=!1){return Lt(e)||We(e)||!$e(e)||(It(e)>1&&(e.set=e.add=e.clear=e.delete=Nh),Object.freeze(e),t&&Object.entries(e).forEach(([s,r])=>Us(r,!0))),e}function Nh(){ce(2)}function Lt(e){return Object.isFrozen(e)}var Rh={};function Ce(e){let t=Rh[e];return t||ce(0,e),t}var et;function bn(){return et}function jh(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Xr(e,t){t&&(Ce("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Es(e){$s(e),e.drafts_.forEach(Dh),e.drafts_=null}function $s(e){e===et&&(et=e.parent_)}function Qr(e){return et=jh(et,e)}function Dh(e){let t=e[oe];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ei(e,t){t.unfinalizedDrafts_=t.drafts_.length;let s=t.drafts_[0];return e!==void 0&&e!==s?(s[oe].modified_&&(Es(t),ce(4)),$e(e)&&(e=St(t,e),t.parent_||At(t,e)),t.patches_&&Ce("Patches").generateReplacementPatches_(s[oe].base_,e,t.patches_,t.inversePatches_)):e=St(t,s,[]),Es(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==yn?e:void 0}function St(e,t,s){if(Lt(t))return t;let r=t[oe];if(!r)return xt(t,(i,n)=>ti(e,r,t,i,n,s)),t;if(r.scope_!==e)return t;if(!r.modified_)return At(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;let i=r.copy_,n=i,o=!1;r.type_===3&&(n=new Set(i),i.clear(),o=!0),xt(n,(l,p)=>ti(e,r,i,l,p,s,o)),At(e,i,!1),s&&e.patches_&&Ce("Patches").generatePatches_(r,s,e.patches_,e.inversePatches_)}return r.copy_}function ti(e,t,s,r,i,n,o){if(We(i)){let l=n&&t&&t.type_!==3&&!As(t.assigned_,r)?n.concat(r):void 0,p=St(e,i,l);if(gn(s,r,p),We(p))e.canAutoFreeze_=!1;else return}else o&&s.add(i);if($e(i)&&!Lt(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;St(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(s,r)&&At(e,i)}}function At(e,t,s=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Us(t,s)}function Ph(e,t){let s=Array.isArray(e),r={type_:s?1:0,scope_:t?t.scope_:bn(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=r,n=Hs;s&&(i=[r],n=tt);let{revoke:o,proxy:l}=Proxy.revocable(i,n);return r.draft_=l,r.revoke_=o,l}var Hs={get(e,t){if(t===oe)return e;let s=Se(e);if(!As(s,t))return Bh(e,s,t);let r=s[t];return e.finalized_||!$e(r)?r:r===cs(e.base_,t)?(us(e),e.copy_[t]=Is(r,e)):r},has(e,t){return t in Se(e)},ownKeys(e){return Reflect.ownKeys(Se(e))},set(e,t,s){let r=vn(Se(e),t);if(r?.set)return r.set.call(e.draft_,s),!0;if(!e.modified_){let i=cs(Se(e),t),n=i?.[oe];if(n&&n.base_===s)return e.copy_[t]=s,e.assigned_[t]=!1,!0;if(Vh(s,i)&&(s!==void 0||As(e.base_,t)))return!0;us(e),Cs(e)}return e.copy_[t]===s&&(s!==void 0||t in e.copy_)||Number.isNaN(s)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=s,e.assigned_[t]=!0),!0},deleteProperty(e,t){return cs(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,us(e),Cs(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let s=Se(e),r=Reflect.getOwnPropertyDescriptor(s,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:s[t]}},defineProperty(){ce(11)},getPrototypeOf(e){return ze(e.base_)},setPrototypeOf(){ce(12)}},tt={};xt(Hs,(e,t)=>{tt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});tt.deleteProperty=function(e,t){return tt.set.call(this,e,t,void 0)};tt.set=function(e,t,s){return Hs.set.call(this,e[0],t,s,e[0])};function cs(e,t){let s=e[oe];return(s?Se(s):e)[t]}function Bh(e,t,s){let r=vn(t,s);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function vn(e,t){if(!(t in e))return;let s=ze(e);for(;s;){let r=Object.getOwnPropertyDescriptor(s,t);if(r)return r;s=ze(s)}}function Cs(e){e.modified_||(e.modified_=!0,e.parent_&&Cs(e.parent_))}function us(e){e.copy_||(e.copy_=ks(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var zh=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,s,r)=>{if(typeof t=="function"&&typeof s!="function"){let n=s;s=t;let o=this;return function(l=n,...p){return o.produce(l,a=>s.call(this,a,...p))}}typeof s!="function"&&ce(6),r!==void 0&&typeof r!="function"&&ce(7);let i;if($e(t)){let n=Qr(this),o=Is(t,void 0),l=!0;try{i=s(o),l=!1}finally{l?Es(n):$s(n)}return Xr(n,r),ei(i,n)}else if(!t||typeof t!="object"){if(i=s(t),i===void 0&&(i=t),i===yn&&(i=void 0),this.autoFreeze_&&Us(i,!0),r){let n=[],o=[];Ce("Patches").generateReplacementPatches_(t,i,n,o),r(n,o)}return i}else ce(1,t)},this.produceWithPatches=(t,s)=>{if(typeof t=="function")return(n,...o)=>this.produceWithPatches(n,l=>t(l,...o));let r,i;return[this.produce(t,s,(n,o)=>{r=n,i=o}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){$e(e)||ce(8),We(e)&&(e=Wh(e));let t=Qr(this),s=Is(e,void 0);return s[oe].isManual_=!0,$s(t),s}finishDraft(e,t){let s=e&&e[oe];(!s||!s.isManual_)&&ce(9);let{scope_:r}=s;return Xr(r,t),ei(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let s;for(s=t.length-1;s>=0;s--){let i=t[s];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}s>-1&&(t=t.slice(s+1));let r=Ce("Patches").applyPatches_;return We(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Is(e,t){let s=Ot(e)?Ce("MapSet").proxyMap_(e,t):Tt(e)?Ce("MapSet").proxySet_(e,t):Ph(e,t);return(t?t.scope_:bn()).drafts_.push(s),s}function Wh(e){return We(e)||ce(10,e),wn(e)}function wn(e){if(!$e(e)||Lt(e))return e;let t=e[oe],s;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,s=ks(e,t.scope_.immer_.useStrictShallowCopy_)}else s=ks(e,!0);return xt(s,(r,i)=>{gn(s,r,wn(i))}),t&&(t.finalized_=!1),s}var ae=new zh,Mh=ae.produce;ae.produceWithPatches.bind(ae);ae.setAutoFreeze.bind(ae);ae.setUseStrictShallowCopy.bind(ae);ae.applyPatches.bind(ae);ae.createDraft.bind(ae);ae.finishDraft.bind(ae);var Fh=(e,t,s)=>{let{createInitialState:r,...i}=e,n={},o={},l={};return r&&(l=r({props:t,constants:s})),Object.entries(i).forEach(([p,a])=>{if(p.startsWith("select")){n[p]=(...c)=>a({state:l,props:t,constants:s},...c);return}o[p]=(c={})=>{let d=c===void 0?{}:c;if(!Qe(d))throw new Error(`[Store] Action '${p}' expects payload to be an object.`);return l=Mh(l,h=>a({state:h,props:t,constants:s},d)),l}}),{getState:()=>l,...o,...n}},_n=e=>!Qe(e)||Object.isFrozen(e)?e:(Object.values(e).forEach(t=>{_n(t)}),Object.freeze(e)),Kh=({setupConstants:e,fileConstants:t})=>{let s=Qe(e)?e:{},r=Qe(t)?t:{};return _n({...s,...r})},Uh=(e,t)=>{if(!t||typeof t!="object")return"";let s="",r=n=>Object.entries(n).map(([o,l])=>` ${o}: ${l};`).join(`
|
|
1509
|
+
`),i=(n,o)=>{if(typeof o!="object"||o===null)return"";if(n.startsWith("@")){let p=Object.entries(o).map(([a,c])=>{let d=r(c);return` ${a} {
|
|
1510
1510
|
${d.split(`
|
|
1511
1511
|
`).map(h=>h?` ${h}`:"").join(`
|
|
1512
1512
|
`)}
|
|
1513
1513
|
}`}).join(`
|
|
1514
1514
|
`);return`${n} {
|
|
1515
|
-
${l}
|
|
1516
|
-
}`}let p=i(o);return`${n} {
|
|
1517
1515
|
${p}
|
|
1518
|
-
}`}
|
|
1516
|
+
}`}let l=r(o);return`${n} {
|
|
1517
|
+
${l}
|
|
1518
|
+
}`};return Object.entries(t).forEach(([n,o])=>{let l=i(n,o);l&&(s+=(s?`
|
|
1519
1519
|
|
|
1520
|
-
`:"")+p)}),r},Or=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...Or(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]:Or(n)})}}t.push(r)}return t},[]):e,hr=":",Uh=new Set(["__proto__","constructor","prototype"]),Hh=/^[A-Za-z_][A-Za-z0-9_.:-]*$/,ts=e=>Hh.test(e),rs=(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"&&Uh.has(p)))return n[p]},e)},qh=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase()),Yh=({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=qh(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(!ts(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(hr)){let S=g.substring(1),A=_;if(c[4]!==void 0&&c[4]!==""){let k=c[4],C=rs(t,k);C!==void 0&&(A=C)}p(S,A,"property-form");continue}if(g.startsWith("?")){let S=g.substring(1);l(S,"boolean toggle");let A=_;o(S);let k;A==="true"?k=!0:A==="false"||A===""?k=!1:k=rs(t,A),k&&(s[S]=""),i&&S!=="id"&&p(S,!!k,"boolean attribute-form");continue}l(g,"binding"),s[g]=_,i&&g!=="id"&&p(g,_,"attribute-form")}let h=e,f=[],u,y=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g;for(;(u=y.exec(e))!==null;)f.push(u[0]);f.forEach(g=>{h=h.replace(g," ")});let m=/(\S+?)(?=\s|$)/g,b;for(;(b=m.exec(h))!==null;){let g=b[1];if(!g.startsWith(".")&&!(d.has(g)||g.startsWith(hr)||g.includes("="))){if(g.startsWith("?")){let _=g.substring(1);l(_,"boolean toggle"),o(_),s[_]="",i&&_!=="id"&&p(_,!0,"boolean attribute-form");continue}if(!ts(g))throw new Error(`[Parser] Invalid attribute token '${g}' on '${r}'.`);!d.has(g)&&!g.startsWith(hr)&&!g.includes("=")&&(s[g]="",i&&g!=="id"&&p(g,!0,"boolean attribute-form"))}}return{attrs:s,props:n}},Tr=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,Gh=/^\$for\s+([A-Za-z_][A-Za-z0-9_]*)(?:\s*,\s*([A-Za-z_][A-Za-z0-9_]*))?\s+in\s+.+$/,_n=/^\$\{([^{}]+)\}$/,Jh=/^[A-Za-z_][A-Za-z0-9_]*(?:(?:\.[A-Za-z_][A-Za-z0-9_]*)|\[(?:\d+|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')\])*$/,is=new WeakSet,qr=(e,t,r)=>{let i=new Set(e);return t&&i.add(t),r&&i.add(r),i},Zh=(e,t)=>{if(typeof e!="string")return t;let r=e.match(Gh);return r?qr(t,r[1],r[2]):t},xn=e=>{if(typeof e!="string"||!e.includes(":")&&!e.includes("."))return null;Tr.lastIndex=0;let t;for(;(t=Tr.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||!_n.test(s))return{bindingName:r,rawValue:s,key:e}}return null},Lr=(e,t=new Set)=>{if(Array.isArray(e)){for(let r of e){let i=Lr(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=xn(r);if(s)return s;let n=Zh(r,t),o=Lr(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=qr(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=xn(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},Xh=e=>Sr([{[e]:""}])?.items?.[0]?.properties?.[0]?.parsedKey,Qh=e=>{let t=e.match(_n);return t?t[1].trim():null},ef=e=>{let t=e.match(/^([A-Za-z_][A-Za-z0-9_]*)/);return t?t[1]:null},tf=(e,t)=>{let r=!1,i=e.replace(Tr,(s,n,o,p,l)=>{if(!n.startsWith(":"))return s;let a=o??p??l??"",c=Qh(a);if(!c||!Jh.test(c))return s;let d=ef(c);if(!d)return s;let h=t.has(d)?`#{${c}}`:c;return h===a?s:(r=!0,`${n}=${h}`)});return r?i:e},je=(e,t=new Set)=>{if(!(!e||typeof e!="object")){if(Array.isArray(e)){e.forEach(r=>je(r,t));return}if(e.type===v.LOOP){let r=qr(t,e.itemVar,e.indexVar);je(e.body,r);return}if(e.type===v.ARRAY&&Array.isArray(e.items)){e.items.forEach(r=>je(r,t));return}if(e.type===v.OBJECT&&Array.isArray(e.properties)){e.properties.forEach(r=>{let i=tf(r.key,t);if(i!==r.key){r.key=i;let s=Xh(i);s?r.parsedKey=s:delete r.parsedKey}je(r.value,t)});return}Object.values(e).forEach(r=>{je(r,t)})}},rf=e=>e?e.type&&typeof e.type=="number"?Ne(e):Lr(e):null,sf=e=>{if(!e||typeof e!="object"||is.has(e))return;let t=rf(e);if(t)throw new Error(`Property-form bindings must use ':prop=\${value}' syntax. Found '${t.bindingName}=${t.rawValue}' in '${t.key}'.`);je(e),is.add(e)},nf=/^[a-z][a-zA-Z0-9]*\*?$/,of=/^[a-zA-Z][a-zA-Z0-9_-]*\*?$/,af=/^[a-z][a-zA-Z0-9]*$/,ss=new Set(["window","document"]),Sn=e=>Object.entries(e||{}).map(([t,r])=>{if(ss.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(ss.has(n))throw new Error(`[Parser] Invalid ref key '${t}'. Reserved global keys must be exactly 'window' or 'document'.`);if(i==="id"&&!nf.test(s))throw new Error(`[Parser] Invalid ref key '${t}'. Use camelCase IDs (optional '#', optional '*') or class refs with '.' prefix.`);if(i==="class"&&!of.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}}),lf=e=>{if(!af.test(e))throw new Error(`[Parser] Invalid element id '${e}' for refs. Use camelCase ids only. Kebab-case ids are not supported.`)},ns=({value:e,prefix:t,isWildcard:r})=>typeof e!="string"||e.length===0?!1:r?e.startsWith(t):e===t,An=({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"){ns({value:e,prefix:n.prefix,isWildcard:n.isWildcard})&&i.push({...n,matchedValue:e});return}let o=s.find(p=>ns({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])},Je=({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.`)},os=({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.`)},pf=({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(Je({optionName:"preventDefault",optionValue:t.preventDefault,eventType:e,refKey:r}),Je({optionName:"stopPropagation",optionValue:t.stopPropagation,eventType:e,refKey:r}),Je({optionName:"stopImmediatePropagation",optionValue:t.stopImmediatePropagation,eventType:e,refKey:r}),Je({optionName:"targetOnly",optionValue:t.targetOnly,eventType:e,refKey:r}),Je({optionName:"once",optionValue:t.once,eventType:e,refKey:r}),os({optionName:"debounce",optionValue:t.debounce,eventType:e,refKey:r}),os({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}},kn=e=>(e.__eventRateLimitState||Object.defineProperty(e,"__eventRateLimitState",{value:new Map,enumerable:!1,configurable:!0}),e.__eventRateLimitState),df=({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)},cf=({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)},En=({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}=pf({eventType:e,eventConfig:t,refKey:r}),u=df({eventConfig:t,handlers:i,onMissingHandler:l,parseAndRenderFn:p});return u?cf({eventConfig:t,callback:u,hasDebounce:h,hasThrottle:f,stateKey:n,eventRateLimitState:s,fallbackCurrentTarget:o,nowFn:a,setTimeoutFn:c,clearTimeoutFn:d}):null},uf=({h:e,template:t,viewData:r,refs:i,handlers:s,createComponentUpdateHook:n})=>{sf(t);let o=sn(t,r,{}),p=Or(o),l=hf({h:e,items:p,refs:i,handlers:s,viewData:r,createComponentUpdateHook:n});return e("div",{style:{display:"contents"}},l)},hf=({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=Sn(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[y,m]=u[0];if(!isNaN(Number(y)))return Array.isArray(m)?l(m,f):typeof m=="object"&&m!==null&&Object.entries(m).length>0?l([m],f):String(m);u.length>1&&console.warn("Item has multiple keys, processing only the first:",y);let b,g,_=y.indexOf(" ");_===-1?(b=y,g=""):(b=y.substring(0,_),g=y.substring(_+1).trim());let S=b.split(/[.#]/)[0],A=S.includes("-"),k,C;try{({attrs:k,props:C}=Yh({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(k,"id")&&(k.id=I[1]);let V=null;k.id&&(V=k.id);let z=(b.match(/\.([^.#]+)/g)||[]).map(H=>H.substring(1)),B=typeof k.class=="string"?k.class.split(/\s+/).filter(Boolean):[],J=[...new Set([...z,...B])],Z=Object.create(null),ge=null;if(!A){z.forEach(Oe=>{Z[Oe]=!0});let H=b.match(/#([^.#\s]+)/);H&&(ge=H[1])}let we;typeof m=="string"||typeof m=="number"?we=String(m):Array.isArray(m)?we=l(m,f):we=[],ge&&!A&&(k.id=ge);let Vt=Object.create(null);if(o.length>0){p&&V&&lf(V);let H=An({elementIdForRefs:V,classNames:J,refMatchers:o});if(H){let Oe=H.refKey,Jr=H.matchedValue||V||Oe;if(H.refConfig&&H.refConfig.eventListeners){let Tn=H.refConfig.eventListeners,Ln=kn(i);Object.entries(Tn).forEach(([Nt,Vn])=>{let Nn=`${Oe}:${Jr}:${Nt}`,Zr=En({eventType:Nt,eventConfig:Vn,refKey:Oe,handlers:i,eventRateLimitState:Ln,stateKey:Nn,parseAndRenderFn:hn,onMissingHandler:jn=>{console.warn(`[Parser] Handler '${jn}' for refKey '${Oe}' (matching '${Jr}') is referenced but not found in available handlers.`)}});Zr&&(Vt[Nt]=Zr)})}}}let be={};if(V?be.key=V:b&&(be.key=`${b}-${f}`),Object.keys(k).length>0&&(be.attrs=k),Object.keys(Z).length>0&&(be.class=Z),Object.keys(Vt).length>0&&(be.on=Vt),Object.keys(C).length>0&&(be.props=C),A&&typeof n=="function"){let H=n({selector:b,tagName:S});H&&(be.hook=H)}try{return e(S,be,we)}catch(H){throw new Error(`[Parser] Error creating virtual node for '${S}': ${H.message}`)}}).filter(Boolean)}return l(t)},ff=({baseDeps:e,refs:t,dispatchEvent:r,store:i,render:s})=>({...e,refs:t,dispatchEvent:r,store:i,render:s}),yf=({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()},mf=({handlers:e,deps:t,parseAndRenderFn:r})=>{let i={handleCallStoreAction:yf({store:t.store,render:t.render,parseAndRenderFn:r})};return Object.keys(e||{}).forEach(s=>{i[s]=n=>e[s](t,n)}),i},gf=e=>{if(e&&typeof e.then=="function")throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");return e},bf=({handlers:e,deps:t})=>{if(!e?.handleBeforeMount)return;let r=e.handleBeforeMount(t);return gf(r)},vf=({handlers:e,deps:t})=>{e?.handleAfterMount&&e.handleAfterMount(t)},wf=({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}},_f=({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}},xf=({refKey:e,targets:t})=>e==="window"?t.window:e==="document"?t.document:null,Sf=({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=kn(t);return Object.entries(e).forEach(([a,c])=>{if(a!=="window"&&a!=="document")return;let d=xf({refKey:a,targets:r});!d||!c?.eventListeners||Object.entries(c.eventListeners).forEach(([h,f])=>{let u=`${a}:${h}`;p.add(u);let y=En({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:m=>{n(`[Runtime] Handler '${m}' for global ref '${a}' is referenced but not found in available handlers.`)}});y&&(d.addEventListener(h,y),o.push(()=>{d.removeEventListener(h,y)}))})}),()=>{o.forEach(a=>a()),p.forEach(a=>{let c=l.get(a);c&&c.debounceTimer&&s.clearTimeoutFn(c.debounceTimer),l.delete(a)})}},Af=e=>Sn(e),kf=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)]},Ef=({rootVNode:e,refs:t})=>{let r={},i=Af(t),s=n=>{if(!n||typeof n!="object")return;let o=n?.data?.attrs?.id,p=kf(n),l=An({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},$f=({propsSchemaKeys:e=[],toKebabCase:t})=>{let r=new Set(["key"]);return e.forEach(i=>{r.add(i),r.add(t(i))}),[...r]},Cf=({baseDeps:e,refs:t,dispatchEvent:r,store:i,render:s})=>ff({baseDeps:e,refs:t,dispatchEvent:r,store:i,render:s}),If=({refIds:e,nextRefIds:t={}})=>(Object.keys(e).forEach(r=>{delete e[r]}),Object.assign(e,t),e),Of=({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},Yr=({instance:e})=>Cf({baseDeps:e.deps,refs:e.refIds,dispatchEvent:e.dispatchEvent.bind(e),store:e.store,render:e.render.bind(e)}),Tf=({instance:e,parseAndRenderFn:t,renderFn:r,createTransformedHandlersFn:i=mf,runBeforeMountFn:s=bf,attachGlobalRefListenersFn:n=Sf,runAfterMountFn:o=vf})=>{let p=Yr({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},Lf=({instance:e,clearTimerFn:t=clearTimeout})=>(e._unmountCallback&&e._unmountCallback(),e._globalListenersCleanup&&e._globalListenersCleanup(),Of({transformedHandlers:e.transformedHandlers,clearTimerFn:t})),Vf=({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=Yr({instance:e}),o=wf({attributeName:t,oldValue:r,newValue:i,deps:n,propsSchemaKeys:e._propsSchemaKeys,toCamelCase:tn,normalizeAttributeValue:_r});e.handlers.handleOnUpdate(n,o);return}s(()=>{e.render()})}},Nf=({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=Yr({instance:e}),o=_f({propName:t,oldValue:r,newValue:i,deps:n,propsSchemaKeys:e._propsSchemaKeys});e.handlers.handleOnUpdate(n,o);return}s(()=>{e.render()})}},jf=({instance:e,createComponentUpdateHookFn:t,parseViewFn:r=uf,collectRefElementsFn:i=Ef,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 If({refIds:e.refIds,nextRefIds:o}),e._oldVNode}catch(n){return s(n),e._oldVNode||null}},Df=`
|
|
1520
|
+
`:"")+l)}),s},Os=e=>Array.isArray(e)?e.reduce((t,s)=>{if(Array.isArray(s))t.push(...Os(s));else{if(s&&typeof s=="object"){let r=Object.entries(s);if(r.length>0){let[i,n]=r[0];Array.isArray(n)&&(s={[i]:Os(n)})}}t.push(s)}return t},[]):e,hs=":",Hh=new Set(["__proto__","constructor","prototype"]),qh=/^[A-Za-z_][A-Za-z0-9_.:-]*$/,si=e=>qh.test(e),ri=(e,t)=>{if(!t)return e;let s=[],r="",i=!1;for(let n=0;n<t.length;n++){let o=t[n];if(!i&&o===".")r&&(s.push(r),r="");else if(!i&&o==="[")r&&(s.push(r),r=""),i=!0;else if(i&&o==="]"){if(r){if(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))s.push(r.slice(1,-1));else{let l=Number(r);s.push(Number.isNaN(l)?r:l)}r=""}i=!1}else r+=o}return r&&s.push(r),s.reduce((n,o)=>{if(n==null)return;let l=typeof o=="number"?o:String(o);if(!(typeof l=="string"&&Hh.has(l)))return n[l]},e)},Yh=e=>e.replace(/-([a-z0-9])/g,(t,s)=>s.toUpperCase()),Gh=({attrsString:e="",viewData:t={},tagName:s,isWebComponent:r})=>{let i={},n={},o=g=>{if(g==="role"||g.startsWith("aria-")||g.startsWith("data-"))throw new Error(`[Parser] Invalid boolean attribute '?${g}'. Use normal binding for value-carrying attributes such as aria-*, data-*, and role.`)},l=(g,_,S)=>{let A=Yh(g);if(!A)throw new Error(`[Parser] Invalid ${S} prop name on '${s}'.`);if(Object.prototype.hasOwnProperty.call(n,A))throw new Error(`[Parser] Duplicate prop binding '${A}' on '${s}'. Use only one of 'name=value' or ':name=\${expr}'.`);n[A]=_},p=(g,_)=>{if(!si(g))throw new Error(`[Parser] Invalid ${_} attribute name '${g}' on '${s}'.`)};if(!e)return{attrs:i,props:n};let a=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,c,d=new Set;for(;(c=a.exec(e))!==null;){let g=c[1],_=c[2]??c[3]??c[4]??"";if(d.add(g),g.startsWith(".")){i[g]=_;continue}if(g.startsWith(hs)){let S=g.substring(1),A=_;if(c[4]!==void 0&&c[4]!==""){let k=c[4],C=ri(t,k);C!==void 0&&(A=C)}l(S,A,"property-form");continue}if(g.startsWith("?")){let S=g.substring(1);p(S,"boolean toggle");let A=_;o(S);let k;A==="true"?k=!0:A==="false"||A===""?k=!1:k=ri(t,A),k&&(i[S]=""),r&&S!=="id"&&l(S,!!k,"boolean attribute-form");continue}p(g,"binding"),i[g]=_,r&&g!=="id"&&l(g,_,"attribute-form")}let h=e,f=[],u,y=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g;for(;(u=y.exec(e))!==null;)f.push(u[0]);f.forEach(g=>{h=h.replace(g," ")});let m=/(\S+?)(?=\s|$)/g,b;for(;(b=m.exec(h))!==null;){let g=b[1];if(!g.startsWith(".")&&!(d.has(g)||g.startsWith(hs)||g.includes("="))){if(g.startsWith("?")){let _=g.substring(1);p(_,"boolean toggle"),o(_),i[_]="",r&&_!=="id"&&l(_,!0,"boolean attribute-form");continue}if(!si(g))throw new Error(`[Parser] Invalid attribute token '${g}' on '${s}'.`);!d.has(g)&&!g.startsWith(hs)&&!g.includes("=")&&(i[g]="",r&&g!=="id"&&l(g,!0,"boolean attribute-form"))}}return{attrs:i,props:n}},Ts=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,Jh=/^\$for\s+([A-Za-z_][A-Za-z0-9_]*)(?:\s*,\s*([A-Za-z_][A-Za-z0-9_]*))?\s+in\s+.+$/,xn=/^\$\{([^{}]+)\}$/,Zh=/^[A-Za-z_][A-Za-z0-9_]*(?:(?:\.[A-Za-z_][A-Za-z0-9_]*)|\[(?:\d+|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')\])*$/,ii=new WeakSet,qs=(e,t,s)=>{let r=new Set(e);return t&&r.add(t),s&&r.add(s),r},Xh=(e,t)=>{if(typeof e!="string")return t;let s=e.match(Jh);return s?qs(t,s[1],s[2]):t},Sn=e=>{if(typeof e!="string"||!e.includes(":")&&!e.includes("."))return null;Ts.lastIndex=0;let t;for(;(t=Ts.exec(e))!==null;){let s=t[1];if(s.startsWith("."))return{bindingName:s,rawValue:t[2]??t[3]??t[4]??"",key:e};if(!s.startsWith(":"))continue;let r=t[2]!==void 0||t[3]!==void 0,i=t[2]??t[3]??t[4]??"";if(r||!xn.test(i))return{bindingName:s,rawValue:i,key:e}}return null},Ls=(e,t=new Set)=>{if(Array.isArray(e)){for(let s of e){let r=Ls(s,t);if(r)return r}return null}if(!e||typeof e!="object")return null;for(let[s,r]of Object.entries(e)){let i=Sn(s);if(i)return i;let n=Xh(s,t),o=Ls(r,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 s of e){let r=Ne(s,t);if(r)return r}return null}if(e.type===v.LOOP){let s=qs(t,e.itemVar,e.indexVar);return Ne(e.body,s)}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 s of e.properties){let r=Sn(s.key);if(r)return r;let i=Ne(s.value,t);if(i)return i}return null}for(let s of Object.values(e)){let r=Ne(s,t);if(r)return r}return null},Qh=e=>Ss([{[e]:""}])?.items?.[0]?.properties?.[0]?.parsedKey,ef=e=>{let t=e.match(xn);return t?t[1].trim():null},tf=e=>{let t=e.match(/^([A-Za-z_][A-Za-z0-9_]*)/);return t?t[1]:null},sf=(e,t)=>{let s=!1,r=e.replace(Ts,(i,n,o,l,p)=>{if(!n.startsWith(":"))return i;let a=o??l??p??"",c=ef(a);if(!c||!Zh.test(c))return i;let d=tf(c);if(!d)return i;let h=t.has(d)?`#{${c}}`:c;return h===a?i:(s=!0,`${n}=${h}`)});return s?r:e},Re=(e,t=new Set)=>{if(!(!e||typeof e!="object")){if(Array.isArray(e)){e.forEach(s=>Re(s,t));return}if(e.type===v.LOOP){let s=qs(t,e.itemVar,e.indexVar);Re(e.body,s);return}if(e.type===v.ARRAY&&Array.isArray(e.items)){e.items.forEach(s=>Re(s,t));return}if(e.type===v.OBJECT&&Array.isArray(e.properties)){e.properties.forEach(s=>{let r=sf(s.key,t);if(r!==s.key){s.key=r;let i=Qh(r);i?s.parsedKey=i:delete s.parsedKey}Re(s.value,t)});return}Object.values(e).forEach(s=>{Re(s,t)})}},rf=e=>e?e.type&&typeof e.type=="number"?Ne(e):Ls(e):null,nf=e=>{if(!e||typeof e!="object"||ii.has(e))return;let t=rf(e);if(t)throw new Error(`Property-form bindings must use ':prop=\${value}' syntax. Found '${t.bindingName}=${t.rawValue}' in '${t.key}'.`);Re(e),ii.add(e)},of=/^[a-z][a-zA-Z0-9]*\*?$/,af=/^[a-zA-Z][a-zA-Z0-9_-]*\*?$/,lf=/^[a-z][a-zA-Z0-9]*$/,ni=new Set(["window","document"]),An=e=>Object.entries(e||{}).map(([t,s])=>{if(ni.has(t))return{refKey:t,refConfig:s,targetType:"global",isWildcard:!1,prefix:t};let r="id",i=t;t.startsWith(".")?(r="class",i=t.slice(1)):t.startsWith("#")&&(r="id",i=t.slice(1));let n=i.endsWith("*")?i.slice(0,-1):i;if(ni.has(n))throw new Error(`[Parser] Invalid ref key '${t}'. Reserved global keys must be exactly 'window' or 'document'.`);if(r==="id"&&!of.test(i))throw new Error(`[Parser] Invalid ref key '${t}'. Use camelCase IDs (optional '#', optional '*') or class refs with '.' prefix.`);if(r==="class"&&!af.test(i))throw new Error(`[Parser] Invalid ref key '${t}'. Class refs must start with '.' and use class-compatible names (optional '*').`);let o=i.endsWith("*"),l=o?i.slice(0,-1):i;return{refKey:t,refConfig:s,targetType:r,isWildcard:o,prefix:l}}),pf=e=>{if(!lf.test(e))throw new Error(`[Parser] Invalid element id '${e}' for refs. Use camelCase ids only. Kebab-case ids are not supported.`)},oi=({value:e,prefix:t,isWildcard:s})=>typeof e!="string"||e.length===0?!1:s?e.startsWith(t):e===t,kn=({elementIdForRefs:e,classNames:t=[],refMatchers:s})=>{let r=[],i=Array.isArray(t)?t:[];return s.forEach(n=>{if(n.targetType==="global")return;if(n.targetType==="id"){oi({value:e,prefix:n.prefix,isWildcard:n.isWildcard})&&r.push({...n,matchedValue:e});return}let o=i.find(l=>oi({value:l,prefix:n.prefix,isWildcard:n.isWildcard}));o&&r.push({...n,matchedValue:o})}),r.length===0?null:(r.sort((n,o)=>{let l=n.targetType==="id"?2:1,p=o.targetType==="id"?2:1;return l!==p?p-l:!n.isWildcard&&o.isWildcard?-1:n.isWildcard&&!o.isWildcard?1:o.prefix.length-n.prefix.length}),r[0])},Je=({optionName:e,optionValue:t,eventType:s,refKey:r})=>{if(t!==void 0&&typeof t!="boolean")throw new Error(`[Parser] Invalid '${e}' for event '${s}' on ref '${r}'. Expected boolean.`)},ai=({optionName:e,optionValue:t,eventType:s,refKey:r})=>{if(t!==void 0&&(typeof t!="number"||Number.isNaN(t)||!Number.isFinite(t)||t<0))throw new Error(`[Parser] Invalid '${e}' for event '${s}' on ref '${r}'. Expected non-negative number.`)},df=({eventType:e,eventConfig:t,refKey:s})=>{if(typeof t!="object"||t===null)throw new Error(`[Parser] Invalid event config for event '${e}' on ref '${s}'.`);let r=Object.prototype.hasOwnProperty.call(t,"debounce"),i=Object.prototype.hasOwnProperty.call(t,"throttle");if(Je({optionName:"preventDefault",optionValue:t.preventDefault,eventType:e,refKey:s}),Je({optionName:"stopPropagation",optionValue:t.stopPropagation,eventType:e,refKey:s}),Je({optionName:"stopImmediatePropagation",optionValue:t.stopImmediatePropagation,eventType:e,refKey:s}),Je({optionName:"targetOnly",optionValue:t.targetOnly,eventType:e,refKey:s}),Je({optionName:"once",optionValue:t.once,eventType:e,refKey:s}),ai({optionName:"debounce",optionValue:t.debounce,eventType:e,refKey:s}),ai({optionName:"throttle",optionValue:t.throttle,eventType:e,refKey:s}),r&&i)throw new Error(`[Parser] Event '${e}' on ref '${s}' cannot define both 'debounce' and 'throttle'.`);if(t.handler&&t.action)throw new Error("Each listener can have handler or action but not both");if(!t.handler&&!t.action)throw new Error("Each listener must define either handler or action");return{hasDebounce:r,hasThrottle:i}},En=e=>(e.__eventRateLimitState||Object.defineProperty(e,"__eventRateLimitState",{value:new Map,enumerable:!1,configurable:!0}),e.__eventRateLimitState),cf=({eventConfig:e,handlers:t,onMissingHandler:s,parseAndRenderFn:r})=>{let i=n=>{let o=e.payload&&typeof e.payload=="object"&&!Array.isArray(e.payload)?e.payload:{};return typeof r!="function"?o:r(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=i(n);t.handleCallStoreAction({...o,_event:n,_action:e.action})}}return e.handler&&t[e.handler]?n=>{let o=i(n);t[e.handler]({...o,_event:n})}:(e.handler&&s?.(e.handler),null)},uf=({eventConfig:e,callback:t,hasDebounce:s,hasThrottle:r,stateKey:i,eventRateLimitState:n,fallbackCurrentTarget:o=null,nowFn:l=Date.now,setTimeoutFn:p=setTimeout,clearTimeoutFn:a=clearTimeout})=>c=>{let d=n.get(i)||{},h=c.currentTarget||o;if(e.once)if(h){if(d.onceTargets||(d.onceTargets=new WeakSet),d.onceTargets.has(h)){n.set(i,d);return}d.onceTargets.add(h)}else if(d.onceTriggered){n.set(i,d);return}else d.onceTriggered=!0;if(e.targetOnly&&c.target!==c.currentTarget){n.set(i,d);return}if(e.preventDefault&&c.preventDefault(),e.stopImmediatePropagation?c.stopImmediatePropagation():e.stopPropagation&&c.stopPropagation(),s){d.debounceTimer&&a(d.debounceTimer),d.debounceTimer=p(()=>{let f=d.debounceTimer;try{t(c)}catch(u){throw a(f),d.debounceTimer=null,u}d.debounceTimer=null},e.debounce),n.set(i,d);return}if(r){Object.prototype.hasOwnProperty.call(d,"lastThrottleAt")||(d.lastThrottleAt=void 0);let f=l();if(d.lastThrottleAt===void 0||f-d.lastThrottleAt>=e.throttle){d.lastThrottleAt=f,n.set(i,d),t(c);return}n.set(i,d);return}n.set(i,d),t(c)},$n=({eventType:e,eventConfig:t,refKey:s,handlers:r,eventRateLimitState:i,stateKey:n,fallbackCurrentTarget:o=null,parseAndRenderFn:l,onMissingHandler:p,nowFn:a=Date.now,setTimeoutFn:c=setTimeout,clearTimeoutFn:d=clearTimeout})=>{let{hasDebounce:h,hasThrottle:f}=df({eventType:e,eventConfig:t,refKey:s}),u=cf({eventConfig:t,handlers:r,onMissingHandler:p,parseAndRenderFn:l});return u?uf({eventConfig:t,callback:u,hasDebounce:h,hasThrottle:f,stateKey:n,eventRateLimitState:i,fallbackCurrentTarget:o,nowFn:a,setTimeoutFn:c,clearTimeoutFn:d}):null},hf=({h:e,template:t,viewData:s,refs:r,handlers:i,createComponentUpdateHook:n})=>{nf(t);let o=nn(t,s,{}),l=Os(o),p=ff({h:e,items:l,refs:r,handlers:i,viewData:s,createComponentUpdateHook:n});return e("div",{style:{display:"contents"}},p)},ff=({h:e,items:t,refs:s={},handlers:r={},viewData:i={},createComponentUpdateHook:n})=>{if(!Array.isArray(t))throw new Error("[Parser] Input to createVirtualDom must be an array, got "+typeof t);let o=An(s),l=o.some(a=>a.targetType==="id");function p(a,c=""){return a.map((d,h)=>{let f=c?`${c}.${h}`:String(h);if(typeof d=="string"||typeof d=="number")return String(d);if(typeof d!="object"||d===null)return console.warn("Skipping invalid item in DOM structure:",d),null;let u=Object.entries(d);if(u.length===0)return null;let[y,m]=u[0];if(!isNaN(Number(y)))return Array.isArray(m)?p(m,f):typeof m=="object"&&m!==null&&Object.entries(m).length>0?p([m],f):String(m);u.length>1&&console.warn("Item has multiple keys, processing only the first:",y);let b,g,_=y.indexOf(" ");_===-1?(b=y,g=""):(b=y.substring(0,_),g=y.substring(_+1).trim());let S=b.split(/[.#]/)[0],A=S.includes("-"),k,C;try{({attrs:k,props:C}=Gh({attrsString:g,viewData:i,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(k,"id")&&(k.id=I[1]);let V=null;k.id&&(V=k.id);let z=(b.match(/\.([^.#]+)/g)||[]).map(H=>H.substring(1)),B=typeof k.class=="string"?k.class.split(/\s+/).filter(Boolean):[],J=[...new Set([...z,...B])],Z=Object.create(null),ge=null;if(!A){z.forEach(Oe=>{Z[Oe]=!0});let H=b.match(/#([^.#\s]+)/);H&&(ge=H[1])}let we;typeof m=="string"||typeof m=="number"?we=String(m):Array.isArray(m)?we=p(m,f):we=[],ge&&!A&&(k.id=ge);let Vt=Object.create(null);if(o.length>0){l&&V&&pf(V);let H=kn({elementIdForRefs:V,classNames:J,refMatchers:o});if(H){let Oe=H.refKey,Js=H.matchedValue||V||Oe;if(H.refConfig&&H.refConfig.eventListeners){let Ln=H.refConfig.eventListeners,Vn=En(r);Object.entries(Ln).forEach(([Nt,Nn])=>{let Rn=`${Oe}:${Js}:${Nt}`,Zs=$n({eventType:Nt,eventConfig:Nn,refKey:Oe,handlers:r,eventRateLimitState:Vn,stateKey:Rn,parseAndRenderFn:fn,onMissingHandler:jn=>{console.warn(`[Parser] Handler '${jn}' for refKey '${Oe}' (matching '${Js}') is referenced but not found in available handlers.`)}});Zs&&(Vt[Nt]=Zs)})}}}let be={};if(V?be.key=V:b&&(be.key=`${b}-${f}`),Object.keys(k).length>0&&(be.attrs=k),Object.keys(Z).length>0&&(be.class=Z),Object.keys(Vt).length>0&&(be.on=Vt),Object.keys(C).length>0&&(be.props=C),A&&typeof n=="function"){let H=n({selector:b,tagName:S});H&&(be.hook=H)}try{return e(S,be,we)}catch(H){throw new Error(`[Parser] Error creating virtual node for '${S}': ${H.message}`)}}).filter(Boolean)}return p(t)},yf=({baseDeps:e,refs:t,dispatchEvent:s,store:r,render:i})=>({...e,refs:t,dispatchEvent:s,store:r,render:i}),mf=({store:e,render:t,parseAndRenderFn:s})=>r=>{let{_event:i,_action:n}=r,o=s(r,{_event:i});if(!e[n])throw new Error(`[Store] Action 'store.${n}' is not defined.`);e[n](o),t()},gf=({handlers:e,deps:t,parseAndRenderFn:s})=>{let r={handleCallStoreAction:mf({store:t.store,render:t.render,parseAndRenderFn:s})};return Object.keys(e||{}).forEach(i=>{r[i]=n=>e[i](t,n)}),r},bf=e=>{if(e&&typeof e.then=="function")throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");return e},vf=({handlers:e,deps:t})=>{if(!e?.handleBeforeMount)return;let s=e.handleBeforeMount(t);return bf(s)},wf=({handlers:e,deps:t})=>{e?.handleAfterMount&&e.handleAfterMount(t)},_f=({attributeName:e,oldValue:t,newValue:s,deps:r,propsSchemaKeys:i,toCamelCase:n,normalizeAttributeValue:o})=>{let l=n(e),p={};i.forEach(h=>{let f=r.props[h];f!==void 0&&(p[h]=f)});let a={...p},c=o(t),d=o(s);return c===void 0?delete a[l]:a[l]=c,d===void 0?delete p[l]:p[l]=d,{changedProp:l,oldProps:a,newProps:p}},xf=({propName:e,oldValue:t,newValue:s,deps:r,propsSchemaKeys:i})=>{let n={};i.forEach(l=>{let p=r.props[l];p!==void 0&&(n[l]=p)});let o={...n};return t===void 0?delete o[e]:o[e]=t,s===void 0?delete n[e]:n[e]=s,{changedProp:e,oldProps:o,newProps:n}},Sf=({refKey:e,targets:t})=>e==="window"?t.window:e==="document"?t.document:null,Af=({refs:e={},handlers:t={},targets:s={window:globalThis.window,document:globalThis.document},parseAndRenderFn:r,timing:i={nowFn:Date.now,setTimeoutFn:setTimeout,clearTimeoutFn:clearTimeout},warnFn:n=console.warn})=>{let o=[],l=new Set,p=En(t);return Object.entries(e).forEach(([a,c])=>{if(a!=="window"&&a!=="document")return;let d=Sf({refKey:a,targets:s});!d||!c?.eventListeners||Object.entries(c.eventListeners).forEach(([h,f])=>{let u=`${a}:${h}`;l.add(u);let y=$n({eventType:h,eventConfig:f,refKey:a,handlers:t,eventRateLimitState:p,stateKey:u,fallbackCurrentTarget:d,parseAndRenderFn:r,nowFn:i.nowFn,setTimeoutFn:i.setTimeoutFn,clearTimeoutFn:i.clearTimeoutFn,onMissingHandler:m=>{n(`[Runtime] Handler '${m}' for global ref '${a}' is referenced but not found in available handlers.`)}});y&&(d.addEventListener(h,y),o.push(()=>{d.removeEventListener(h,y)}))})}),()=>{o.forEach(a=>a()),l.forEach(a=>{let c=p.get(a);c&&c.debounceTimer&&i.clearTimeoutFn(c.debounceTimer),p.delete(a)})}},kf=e=>An(e),Ef=e=>{let t=[],s=e?.data?.class;s&&typeof s=="object"&&Object.entries(s).forEach(([i,n])=>{n&&t.push(i)});let r=e?.data?.attrs?.class;return typeof r=="string"&&r.split(/\s+/).filter(Boolean).forEach(i=>t.push(i)),[...new Set(t)]},$f=({rootVNode:e,refs:t})=>{let s={},r=kf(t),i=n=>{if(!n||typeof n!="object")return;let o=n?.data?.attrs?.id,l=Ef(n),p=kn({elementIdForRefs:o,classNames:l,refMatchers:r});if(n.elm&&p){let a=o||p.refKey;s[a]=n.elm}Array.isArray(n.children)&&n.children.forEach(i)};return i(e),s},Cf=({propsSchemaKeys:e=[],toKebabCase:t})=>{let s=new Set(["key"]);return e.forEach(r=>{s.add(r),s.add(t(r))}),[...s]},If=({baseDeps:e,refs:t,dispatchEvent:s,store:r,render:i})=>yf({baseDeps:e,refs:t,dispatchEvent:s,store:r,render:i}),Of=({refIds:e,nextRefIds:t={}})=>(Object.keys(e).forEach(s=>{delete e[s]}),Object.assign(e,t),e),Tf=({transformedHandlers:e,clearTimerFn:t=clearTimeout})=>{let s=e?.__eventRateLimitState;if(!(s instanceof Map))return 0;let r=0;return s.forEach(i=>{i&&i.debounceTimer&&(t(i.debounceTimer),r+=1)}),s.clear(),r},Ys=({instance:e})=>If({baseDeps:e.deps,refs:e.refIds,dispatchEvent:e.dispatchEvent.bind(e),store:e.store,render:e.render.bind(e)}),Lf=({instance:e,parseAndRenderFn:t,renderFn:s,createTransformedHandlersFn:r=gf,runBeforeMountFn:i=vf,attachGlobalRefListenersFn:n=Af,runAfterMountFn:o=wf})=>{let l=Ys({instance:e});return e.transformedHandlers=r({handlers:e.handlers,deps:l,parseAndRenderFn:t}),e._unmountCallback=i({handlers:e.handlers,deps:l}),e._globalListenersCleanup=n({refs:e.refs,handlers:e.transformedHandlers,parseAndRenderFn:t}),s(),o({handlers:e.handlers,deps:l}),l},Vf=({instance:e,clearTimerFn:t=clearTimeout})=>(e._unmountCallback&&e._unmountCallback(),e._globalListenersCleanup&&e._globalListenersCleanup(),Tf({transformedHandlers:e.transformedHandlers,clearTimerFn:t})),Nf=({instance:e,attributeName:t,oldValue:s,newValue:r,scheduleFrameFn:i})=>{if(!(s===r||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=Ys({instance:e}),o=_f({attributeName:t,oldValue:s,newValue:r,deps:n,propsSchemaKeys:e._propsSchemaKeys,toCamelCase:sn,normalizeAttributeValue:_s});e.handlers.handleOnUpdate(n,o);return}i(()=>{e.render()})}},Rf=({instance:e,propName:t,oldValue:s,newValue:r,scheduleFrameFn:i})=>{if(!(s===r||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=Ys({instance:e}),o=xf({propName:t,oldValue:s,newValue:r,deps:n,propsSchemaKeys:e._propsSchemaKeys});e.handlers.handleOnUpdate(n,o);return}i(()=>{e.render()})}},jf=({instance:e,createComponentUpdateHookFn:t,parseViewFn:s=hf,collectRefElementsFn:r=$f,onError:i=n=>{console.error("Error during render:",n)}})=>{if(!e.patch)return console.error("Patch function is not defined!"),null;if(!e.template)return console.error("Template is not defined!"),null;try{let n=s({h:e._snabbdomH,template:e.template,viewData:e.viewData,refs:e.refs,handlers:e.transformedHandlers,createComponentUpdateHook:t});e._oldVNode?e._oldVNode=e.patch(e._oldVNode,n):e._oldVNode=e.patch(e.renderTarget,n);let o=r({rootVNode:e._oldVNode,refs:e.refs});return Of({refIds:e.refIds,nextRefIds:o}),e._oldVNode}catch(n){return i(n),e._oldVNode||null}},Df=`
|
|
1521
1521
|
a, a:link, a:visited, a:hover, a:active {
|
|
1522
1522
|
display: contents;
|
|
1523
1523
|
color: inherit;
|
|
@@ -1529,4 +1529,4 @@ ${p}
|
|
|
1529
1529
|
font: inherit;
|
|
1530
1530
|
cursor: pointer;
|
|
1531
1531
|
}
|
|
1532
|
-
`,Gr="data-rtgl-render-target",$n="__rtglRenderTarget",Vr=e=>!e||typeof e!="object"?!1:typeof e.getAttribute=="function"?e.getAttribute(Gr)!==null:e[$n]===!0,as=e=>{!e||typeof e!="object"||(typeof e.setAttribute=="function"?e.setAttribute(Gr,""):e[$n]=!0)},Rf=e=>{if(!(!e||typeof e!="object"))return typeof e.querySelector=="function"?e.querySelector(`[${Gr}]`)??e.firstElementChild:Array.isArray(e.childNodes)?e.childNodes.find(Vr)??e.childNodes[0]:Array.isArray(e.children)?e.children.find(Vr)??e.children[0]:e.firstElementChild},Pf=({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(Df);let o=[n];if(t){let a=r();a.replaceSync(t),o.push(a)}s.adoptedStyleSheets=o;let p=Rf(s);p?(p.style.cssText="display: contents;",Vr(p)||as(p)):(p=i("div"),p.style.cssText="display: contents;",as(p),s.appendChild(p)),p.parentNode!==s&&s.appendChild(p);let l=rn(e);return l&&typeof l=="object"&&(l.display="contents"),{shadow:s,renderTarget:p,adoptedStyleSheets:o}},Nr=(e,t=requestAnimationFrame)=>t(e),Bf=({scheduleFrameFn:e=Nr}={})=>({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})}}))}}),zf=({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 m={};return this.store.selectViewData&&(m=this.store.selectViewData()),m}connectedCallback(){let m=Pf({host:this,cssText:this.cssText});this.shadow=m.shadow,this.renderTarget=m.renderTarget,Tf({instance:this,parseAndRenderFn:hn,renderFn:this.render})}disconnectedCallback(){Lf({instance:this,clearTimerFn:clearTimeout})}attributeChangedCallback(m,b,g){Vf({instance:this,attributeName:m,oldValue:b,newValue:g,scheduleFrameFn:Nr})}render=()=>{jf({instance:this,createComponentUpdateHookFn:Bf})}}class u extends f{static get observedAttributes(){return $f({propsSchemaKeys:r,toKebabCase:en})}constructor(){super(),this.constants=Fh({setupConstants:h?.constants,fileConstants:l}),this.propsSchema=t,Gu({source:this,allowedKeys:r,onPropChange:({propName:m,oldValue:b,newValue:g})=>{Nf({instance:this,propName:m,oldValue:b,newValue:g,scheduleFrameFn:Nr})}}),this.props=t?Ju(this,r):{},this._propsSchemaKeys=r,this.elementName=e,this.styles=n,this.store=Mh(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},Oh(this,this.methods),this._snabbdomH=d,this.cssText=Kh(e,n)}}return u};function rt(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 kt=Array.isArray;function yt(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function Wf(e,t){return document.createElement(e,t)}function Mf(e,t,r){return document.createElementNS(e,t,r)}function Ff(){return Ae(document.createDocumentFragment())}function Kf(e){return document.createTextNode(e)}function Uf(e){return document.createComment(e)}function Hf(e,t,r){if(me(e)){let i=e;for(;i&&me(i);)i=Ae(i).parent;e=i??e}me(t)&&(t=Ae(t,e)),r&&me(r)&&(r=Ae(r).firstChildNode),e.insertBefore(t,r)}function qf(e,t){e.removeChild(t)}function Yf(e,t){me(t)&&(t=Ae(t,e)),e.appendChild(t)}function Cn(e){if(me(e)){for(;e&&me(e);)e=Ae(e).parent;return e??null}return e.parentNode}function Gf(e){var t;if(me(e)){let r=Ae(e),i=Cn(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 Jf(e){return e.tagName}function Zf(e,t){e.textContent=t}function Xf(e){return e.textContent}function Qf(e){return e.nodeType===1}function ey(e){return e.nodeType===3}function ty(e){return e.nodeType===8}function me(e){return e.nodeType===11}function Ae(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 ry={createElement:Wf,createElementNS:Mf,createTextNode:Kf,createDocumentFragment:Ff,createComment:Uf,insertBefore:Hf,removeChild:qf,appendChild:Yf,parentNode:Cn,nextSibling:Gf,tagName:Jf,setTextContent:Zf,getTextContent:Xf,isElement:Qf,isText:ey,isComment:ty,isDocumentFragment:me};function ft(e){return e===void 0}function re(e){return e!==void 0}var fr=rt("",{},[],void 0,void 0);function Ze(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 iy(){throw new Error("The document fragment is not supported on this platform.")}function sy(e,t){return e.isElement(t)}function ny(e,t){return e.isDocumentFragment(t)}function oy(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 ay=["create","update","remove","destroy","pre","post"];function ly(e,t,r){let i={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},s=ry;for(let u of ay)for(let y of e){let m=y[u];m!==void 0&&i[u].push(m)}function n(u){let y=u.id?"#"+u.id:"",m=u.getAttribute("class"),b=m?"."+m.split(" ").join("."):"";return rt(s.tagName(u).toLowerCase()+y+b,{},[],void 0,u)}function o(u){return rt(void 0,{},[],void 0,u)}function p(u,y){return function(){if(--y===0){let m=s.parentNode(u);m!==null&&s.removeChild(m,u)}}}function l(u,y){var m,b,g,_;let S,A=u.data;if(A!==void 0){let I=(m=A.hook)===null||m===void 0?void 0:m.init;re(I)&&(I(u),A=u.data)}let k=u.children,C=u.sel;if(C==="!")ft(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("#"),V=C.indexOf(".",I),z=I>0?I:C.length,B=V>0?V:C.length,J=I!==-1||V!==-1?C.slice(0,Math.min(z,B)):C,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)),V>0&&Z.setAttribute("class",C.slice(B+1).replace(/\./g," ")),S=0;S<i.create.length;++S)i.create[S](fr,u);if(yt(u.text)&&(!kt(k)||k.length===0)&&s.appendChild(Z,s.createTextNode(u.text)),kt(k))for(S=0;S<k.length;++S){let we=k[S];we!=null&&s.appendChild(Z,l(we,y))}let ge=u.data.hook;re(ge)&&((b=ge.create)===null||b===void 0||b.call(ge,fr,u),ge.insert&&y.push(u))}else if(!((g=void 0)===null||g===void 0)&&g.fragments&&u.children){for(u.elm=((_=s.createDocumentFragment)!==null&&_!==void 0?_:iy)(),S=0;S<i.create.length;++S)i.create[S](fr,u);for(S=0;S<u.children.length;++S){let I=u.children[S];I!=null&&s.appendChild(u.elm,l(I,y))}}else u.elm=s.createTextNode(u.text);return u.elm}function a(u,y,m,b,g,_){for(;b<=g;++b){let S=m[b];S!=null&&s.insertBefore(u,l(S,_),y)}}function c(u){var y,m;let b=u.data;if(b!==void 0){(m=(y=b?.hook)===null||y===void 0?void 0:y.destroy)===null||m===void 0||m.call(y,u);for(let g=0;g<i.destroy.length;++g)i.destroy[g](u);if(u.children!==void 0)for(let g=0;g<u.children.length;++g){let _=u.children[g];_!=null&&typeof _!="string"&&c(_)}}}function d(u,y,m,b){for(var g,_;m<=b;++m){let S,A,k=y[m];if(k!=null)if(re(k.sel)){c(k),S=i.remove.length+1,A=p(k.elm,S);for(let I=0;I<i.remove.length;++I)i.remove[I](k,A);let C=(_=(g=k?.data)===null||g===void 0?void 0:g.hook)===null||_===void 0?void 0:_.remove;re(C)?C(k,A):A()}else k.children?(c(k),d(u,k.children,0,k.children.length-1)):s.removeChild(u,k.elm)}}function h(u,y,m,b){let g=0,_=0,S=y.length-1,A=y[0],k=y[S],C=m.length-1,I=m[0],V=m[C],z,B,J,Z;for(;g<=S&&_<=C;)A==null?A=y[++g]:k==null?k=y[--S]:I==null?I=m[++_]:V==null?V=m[--C]:Ze(A,I)?(f(A,I,b),A=y[++g],I=m[++_]):Ze(k,V)?(f(k,V,b),k=y[--S],V=m[--C]):Ze(A,V)?(f(A,V,b),s.insertBefore(u,A.elm,s.nextSibling(k.elm)),A=y[++g],V=m[--C]):Ze(k,I)?(f(k,I,b),s.insertBefore(u,k.elm,A.elm),k=y[--S],I=m[++_]):(z===void 0&&(z=oy(y,g,S)),B=z[I.key],ft(B)?(s.insertBefore(u,l(I,b),A.elm),I=m[++_]):ft(z[V.key])?(s.insertBefore(u,l(V,b),s.nextSibling(k.elm)),V=m[--C]):(J=y[B],J.sel!==I.sel?s.insertBefore(u,l(I,b),A.elm):(f(J,I,b),y[B]=void 0,s.insertBefore(u,J.elm,A.elm)),I=m[++_]));_<=C&&(Z=m[C+1]==null?null:m[C+1].elm,a(u,Z,m,_,C,b)),g<=S&&d(u,y,g,S)}function f(u,y,m){var b,g,_,S,A,k,C,I;let V=(b=y.data)===null||b===void 0?void 0:b.hook;(g=V?.prepatch)===null||g===void 0||g.call(V,u,y);let z=y.elm=u.elm;if(u===y)return;if(y.data!==void 0||re(y.text)&&y.text!==u.text){(_=y.data)!==null&&_!==void 0||(y.data={}),(S=u.data)!==null&&S!==void 0||(u.data={});for(let Z=0;Z<i.update.length;++Z)i.update[Z](u,y);(C=(k=(A=y.data)===null||A===void 0?void 0:A.hook)===null||k===void 0?void 0:k.update)===null||C===void 0||C.call(k,u,y)}let B=u.children,J=y.children;ft(y.text)?re(B)&&re(J)?B!==J&&h(z,B,J,m):re(J)?(re(u.text)&&s.setTextContent(z,""),a(z,null,J,0,J.length-1,m)):re(B)?d(z,B,0,B.length-1):re(u.text)&&s.setTextContent(z,""):u.text!==y.text&&(re(B)&&d(z,B,0,B.length-1),s.setTextContent(z,y.text)),(I=V?.postpatch)===null||I===void 0||I.call(V,u,y)}return function(u,y){let m,b,g,_=[];for(m=0;m<i.pre.length;++m)i.pre[m]();for(sy(s,u)?u=n(u):ny(s,u)&&(u=o(u)),Ze(u,y)?f(u,y,_):(b=u.elm,g=s.parentNode(b),l(y,_),g!==null&&(s.insertBefore(g,y.elm,s.nextSibling(b)),d(g,[u],0,0))),m=0;m<_.length;++m)_[m].data.hook.insert(_[m]);for(m=0;m<i.post.length;++m)i.post[m]();return y}}function ls(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 py={create:ls,update:ls};function ps(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 dy={create:ps,update:ps},cy="http://www.w3.org/1999/xlink",uy="http://www.w3.org/2000/xmlns/",hy="http://www.w3.org/XML/1998/namespace",ds=58,fy=120,yy=109;function cs(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)!==fy?i.setAttribute(r,o):r.charCodeAt(3)===ds?i.setAttributeNS(hy,r,o):r.charCodeAt(5)===ds?r.charCodeAt(1)===yy?i.setAttributeNS(uy,r,o):i.setAttributeNS(cy,r,o):i.setAttribute(r,o))}for(r in s)r in n||i.removeAttribute(r)}}var my={create:cs,update:cs},us=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,gy=function(e){us(function(){us(e)})},jr=!1;function by(e,t,r){gy(function(){e[t]=r})}function hs(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])&&by(s.style,l,r);else i!=="remove"&&r!==n[i]&&(i[0]==="-"&&i[1]==="-"?s.style.setProperty(i,r):s.style[i]=r)}function vy(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 wy(e,t){let r=e.data.style;if(!r||!r.remove){t();return}jr||(e.elm.offsetLeft,jr=!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 _y(){jr=!1}var xy={pre:_y,create:hs,update:hs,destroy:vy,remove:wy};function In(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++)In(e[i],t,r)}function Sy(e,t){let r=e.type,i=t.data.on;i&&i[r]&&In(i[r],t,e)}function Ay(){return function e(t){Sy(t,e.vnode)}}function yr(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||Ay();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 ky={create:yr,update:yr,destroy:yr},Ey=()=>ly([py,dy,my,xy,ky]);function On(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&&On(n,s.children,s.sel)}}function $y(e,t,r){let i={},s,n,o;if(r!==void 0?(t!==null&&(i=t),kt(r)?s=r:yt(r)?n=r.toString():r&&r.sel&&(s=[r])):t!=null&&(kt(t)?s=t:yt(t)?n=t.toString():t&&t.sel?s=[t]:i=t),s!==void 0)for(o=0;o<s.length;++o)yt(s[o])&&(s[o]=rt(void 0,void 0,void 0,s[o],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&On(i,s,e),rt(e,i,s,n,void 0)}var Cy=Ey(),Iy=({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;Zu({schema:p,methodExports:Object.keys(t||{})});let d=p.componentName,h=p.propsSchema,f=h?.properties?[...new Set(Object.keys(h.properties).map(u=>tn(u)))]:[];return zf({elementName:d,propsSchema:h,propsSchemaKeys:f,template:l,refs:a,styles:c,handlers:e,methods:t,constants:r,store:n,patch:Cy,h:$y,deps:o})},Oy=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.")},showToast: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.")}}},Ty=Oy(),Ly={globalUI:Ty},Vy={components:Ly},Ny={componentName:"rtgl-accordion-item",propsSchema:{type:"object",properties:{label:{type:"string"},content:{type:"string"},w:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},jy={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}},Dy={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:{}}},Ry={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}},Py={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:{}}},By={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}},zy={componentName:"rtgl-dropdown-menu",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["section","item","separator","label"]},id:{type:"string"},icon:{type:"string"},path:{type:"string"},href:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},disabled:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"},testId:{type:"string"}}}},open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},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:{}}},Wy={refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},styles:{a:{display:"block",width:"100%","text-decoration":"none",color:"inherit"},".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} content-w=${w} content-h=${h} content-sv=true content-g=xs content-pv=sm",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isSection",value:{type:6,conditions:[{type:1,path:"item.isSection"},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.isDisabled"}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:4,op:6,left:{type:1,path:"item.hasHref"},right:{type:1,path:"item.linkExtraAttrs"}}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.hasHref"}},{type:1,path:"item.isItem"},{type:1,path:"item.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f p=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=sm",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," place=",{type:1,path:"place"}," 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}},My={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"}}}},Fy={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 == "tag-select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"tag-select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-tag-select#field${field._idx} data-field-name=${field.name} w=f :options=${field.options} :selectedValues=${field._selectedValues} :placeholder=${field.placeholder} :addOption=${field.addOption} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-tag-select#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=",{type:1,path:"field.options"}," :selectedValues=",{type:1,path:"field._selectedValues"}," :placeholder=",{type:1,path:"field.placeholder"}," :addOption=",{type:1,path:"field.addOption"}," ?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}},Ky={componentName:"rtgl-global-ui",propsSchema:{type:"object",properties:{}},events:[],methods:{type:"object",properties:{}}},Uy={refs:{dialog:{eventListeners:{close:{handler:"handleDialogClose"}}},confirmButton:{eventListeners:{click:{handler:"handleConfirm"}}},cancelButton:{eventListeners:{click:{handler:"handleCancel"}}},componentDialogBodyHost:{},"componentDialogAction*":{eventListeners:{click:{handler:"handleComponentDialogAction"}}},formDialog:{eventListeners:{"form-action":{handler:"handleFormAction"},"form-field-event":{handler:"handleFormFieldEvent"}}},dropdownMenu:{eventListeners:{close:{handler:"handleDropdownClose"},"item-click":{handler:"handleDropdownItemClick"}}}},styles:{".toast-layer":{"pointer-events":"none"},".toast-card":{"pointer-events":"auto","box-sizing":"border-box",width:"33vw","max-width":"calc(100vw - 2 * var(--spacing-lg))",opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 180ms cubic-bezier(0.16, 1, 0.3, 1), transform 180ms cubic-bezier(0.16, 1, 0.3, 1)","will-change":"opacity, transform"},".toast-card-top":{animation:"toast-in-top 220ms cubic-bezier(0.16, 1, 0.3, 1)"},".toast-card-bottom":{animation:"toast-in-bottom 220ms cubic-bezier(0.16, 1, 0.3, 1)"},".toast-card-md":{width:"50vw"},".toast-card-lg":{width:"80vw"},".toast-card-top.toast-card-exiting":{opacity:0,transform:"translateY(calc(var(--spacing-sm) * -0.5)) scale(0.98)"},".toast-card-bottom.toast-card-exiting":{opacity:0,transform:"translateY(calc(var(--spacing-sm) * 0.5)) scale(0.98)"},".toast-message":{"overflow-wrap":"anywhere"},"@keyframes toast-in-top":{from:{opacity:0,transform:"translateY(calc(var(--spacing-sm) * -1)) scale(0.96)"},to:{opacity:1,transform:"translateY(0) scale(1)"}},"@keyframes toast-in-bottom":{from:{opacity:0,transform:"translateY(var(--spacing-sm)) scale(0.96)"},to:{opacity:1,transform:"translateY(0) scale(1)"}},"@media (prefers-reduced-motion: reduce)":{".toast-card":{animation:"none",transition:"none"}}},template:{type:9,items:[{type:8,properties:[{key:"$if topToasts.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"topToasts.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-layer toast-layer-top" pos=fix edge=t z=2100 w=f ah=c g=sm ph=md pt=xl',value:{type:9,items:[{type:7,itemVar:"toast",indexVar:"i",iterable:{type:1,path:"topToasts"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-card toast-card-top toast-card-${toast.size} toast-card-${toast.phase}" key=toast-${toast.id} bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text class=toast-message ta=c w=f",value:{type:1,path:"toast.message"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view class="toast-card toast-card-top toast-card-',{type:1,path:"toast.size"}," toast-card-",{type:1,path:"toast.phase"},'" key=toast-',{type:1,path:"toast.id"}," bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if bottomToasts.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"bottomToasts.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-layer toast-layer-bottom" pos=fix edge=b z=2100 w=f ah=c g=sm ph=md pb=xl',value:{type:9,items:[{type:7,itemVar:"toast",indexVar:"i",iterable:{type:1,path:"bottomToasts"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-card toast-card-bottom toast-card-${toast.size} toast-card-${toast.phase}" key=toast-${toast.id} bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text class=toast-message ta=c w=f",value:{type:1,path:"toast.message"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view class="toast-card toast-card-bottom toast-card-',{type:1,path:"toast.size"}," toast-card-",{type:1,path:"toast.phase"},'" key=toast-',{type:1,path:"toast.id"}," bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-dialog#dialog ?open=${isDialogContainerOpen} s=${dialogSize}",value:{type:9,items:[{type:8,properties:[{key:"$if isFormDialogOpen",value:{type:6,conditions:[{type:1,path:"isFormDialogOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-form#formDialog slot=content :form=${formDialogConfig.form} :defaultValues=${formDialogConfig.defaultValues} :context=${formDialogConfig.context} ?disabled=${formDialogConfig.disabled} key=form-dialog-${formDialogConfig.key}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-form#formDialog slot=content :form=",{type:1,path:"formDialogConfig.form"}," :defaultValues=",{type:1,path:"formDialogConfig.defaultValues"}," :context=",{type:1,path:"formDialogConfig.context"}," ?disabled=",{type:1,path:"formDialogConfig.disabled"}," key=form-dialog-",{type:1,path:"formDialogConfig.key"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if isComponentDialogOpen",value:{type:6,conditions:[{type:1,path:"isComponentDialogOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"$if componentDialogConfig.title || componentDialogConfig.description",value:{type:6,conditions:[{type:4,op:7,left:{type:1,path:"componentDialogConfig.title"},right:{type:1,path:"componentDialogConfig.description"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if componentDialogConfig.title",value:{type:6,conditions:[{type:1,path:"componentDialogConfig.title"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"componentDialogConfig.title"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if componentDialogConfig.description",value:{type:6,conditions:[{type:1,path:"componentDialogConfig.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"componentDialogConfig.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view#componentDialogBodyHost w=f key=component-dialog-body-${componentDialogConfig.key}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view#componentDialogBodyHost w=f key=component-dialog-body-",{type:1,path:"componentDialogConfig.key"}]}}],fast:!0},{type:8,properties:[{key:"$if componentDialogConfig.actions.buttons.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"componentDialogConfig.actions.buttons.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h w=f g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"componentDialogConfig.actions._leftButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#componentDialogAction${button._globalIdx} data-action-id=${button.id} data-action-index=${button._globalIdx} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#componentDialogAction",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," data-action-index=",{type:1,path:"button._globalIdx"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=sm ah=e w=1fg",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"componentDialogConfig.actions._rightButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#componentDialogAction${button._globalIdx} data-action-id=${button.id} data-action-index=${button._globalIdx} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#componentDialogAction",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," data-action-index=",{type:1,path:"button._globalIdx"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if !isFormDialogOpen && !isComponentDialogOpen",value:{type:6,conditions:[{type:4,op:6,left:{type:5,op:0,operand:{type:1,path:"isFormDialogOpen"}},right:{type:5,op:0,operand:{type:1,path:"isComponentDialogOpen"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if config.title",value:{type:6,conditions:[{type:1,path:"config.title"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"config.title"}}],fast:!0},{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=md mt=lg w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"$if config.mode == 'confirm'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"config.mode"},right:{type:0,value:"confirm"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-button#cancelButton v=se",value:{type:1,path:"config.cancelText"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-button#confirmButton v=pr",value:{type:1,path:"config.confirmText"}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-dialog#dialog ?open=",{type:1,path:"isDialogContainerOpen"}," s=",{type:1,path:"dialogSize"}]}}],fast:!1},{type:8,properties:[{key:"rtgl-dropdown-menu#dropdownMenu ?open=${isDropdownOpen} x=${dropdownConfig.x} y=${dropdownConfig.y} place=${dropdownConfig.place} :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}},Hy={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:{}}},qy={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}},Yy={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:{}}},Gy={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}},Jy={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:{}}},Zy={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}},Xy={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:{}}},Qy={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}},em={componentName:"rtgl-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{type:{type:"string",enum:["section","item","separator"]},label:{type:"string"},value:{type:"any"},icon:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},testId:{type:"string"}}}},selectedValue:{type:"any"},onChange:{type:"function"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}},tm={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"}}}},styles:{".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view#selectButton style="display: inline-flex;" d=h av=c h=32 ph=md bw=xs bc=bo h-bc=${selectButtonHoverBorderColor} br=md bgc=su cur=${selectButtonCursor} ${containerAttrString} data-testid="select-button" role="button" tabindex=${selectButtonTabIndex} aria-disabled=${isDisabled}',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c ah=s w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if hasSelectedIcon",value:{type:6,conditions:[{type:1,path:"hasSelectedIcon"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg svg=${selectedIcon} wh=16 c=${selectedIconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg svg=",{type:1,path:"selectedIcon"}," wh=16 c=",{type:1,path:"selectedIconColor"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text w=1fg ta=s c=${selectedLabelColor} ellipsis",value:{type:1,path:"selectedLabel"},parsedKey:{type:2,parts:["rtgl-text w=1fg ta=s c=",{type:1,path:"selectedLabelColor"}," ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if hasSelectedSuffixText",value:{type:6,conditions:[{type:1,path:"hasSelectedSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${selectedSuffixTextColor} ta=e",value:{type:1,path:"selectedSuffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"selectedSuffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if showClear",value:{type:6,conditions:[{type:1,path:"showClear"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#clearButton svg=x wh=16 c=mu-fg cur=pointer data-testid="select-clear-button"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-svg svg=chevronDown wh=16 c=mu-fg",value:{type:0,value:null}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:['rtgl-view#selectButton style="display: inline-flex;" d=h av=c h=32 ph=md bw=xs bc=bo h-bc=',{type:1,path:"selectButtonHoverBorderColor"}," br=md bgc=su cur=",{type:1,path:"selectButtonCursor"}," ",{type:1,path:"containerAttrString"},' data-testid="select-button" role="button" tabindex=',{type:1,path:"selectButtonTabIndex"}," aria-disabled=",{type:1,path:"isDisabled"}]}}],fast:!1},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=rs content-wh=300 content-g=xs content-sv=true content-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:"$if option.isSection",value:{type:6,conditions:[{type:1,path:"option.isSection"},{type:1,path:"option.isItem"},{type:1,path:"option.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${option.index} w=f ph=lg pv=md cur=pointer bgc=${option.bgc} data-testid=${option.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if option.hasIconSlot",value:{type:6,conditions:[{type:1,path:"option.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if option.hasIcon",value:{type:6,conditions:[{type:1,path:"option.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${option.icon} c=${option.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"option.icon"}," c=",{type:1,path:"option.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${option.c} w=1fg ellipsis",value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"option.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if option.hasSuffixText",value:{type:6,conditions:[{type:1,path:"option.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${option.suffixTextColor} ta=e",value:{type:1,path:"option.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"option.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"option.index"}," w=f ph=lg pv=md cur=pointer bgc=",{type:1,path:"option.bgc"}," data-testid=",{type:1,path:"option.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=sm",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0},{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}},rm={componentName:"rtgl-sidebar",propsSchema:{type:"object",properties:{mode:{type:"string"},hideHeader:{type:"boolean",default:!1},tooltip:{type:"boolean",default:!1},showCompactTooltip:{type:"boolean",default:!1,description:"Deprecated alias for tooltip. Use tooltip instead."},w:{type:"string"},bwr:{type:"string"},selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},testId:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{label:{type:"string"},title:{type:"string",description:"Deprecated item text field. Use label instead."},slug:{type:"string"},type:{type:"string",description:"Item row type. Supports item, groupLabel, divider, and spacer."},tooltip:{type:"string"},items:{type:"array"},testId:{type:"string"}}}}}},events:{"header-click":{type:"object",properties:{path:{type:"string"}}},"item-click":{type:"object",properties:{item:{type:"object"}}}},methods:{type:"object",properties:{}}},im={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}},sm={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:{}}},nm={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}},om={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:{}}},am={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}},lm={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:{}}},pm={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}},dm={componentName:"rtgl-tag-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{type:{type:"string",enum:["section","item","separator"]},label:{type:"string"},value:{type:"any"},icon:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},testId:{type:"string"}}}},selectedValues:{type:"array",items:{type:"any"}},draftSelectedValues:{type:"array",items:{type:"any"}},open:{type:"boolean"},onChange:{type:"function"},addOption:{type:"object",properties:{label:{type:"string"}}},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"draft-value-change":{},"open-change":{},"add-option-click":{}},methods:{type:"object",properties:{refreshPopover:{description:"Recomputes the open popover position and rerenders the current options and draft values.",params:["values","keepOpen"],returns:"void"},setDraftSelectedValues:{description:"Replaces the draft-only selection without committing `selectedValues`; optionally reopens the popover around the trigger when `keepOpen` is true.",params:["values","keepOpen"],returns:"void"},appendDraftSelectedValue:{description:"Adds a value to the draft-only selection without committing `selectedValues`; optionally reopens the popover around the trigger when `keepOpen` is true.",params:["value","keepOpen"],returns:"void"}}}},cm={refs:{trigger:{eventListeners:{click:{handler:"handleTriggerClick"},keydown:{handler:"handleTriggerKeyDown"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},"option*":{eventListeners:{click:{handler:"handleOptionClick"},keydown:{handler:"handleOptionKeyDown"}}},submitButton:{eventListeners:{click:{handler:"handleSubmitClick"}}},addOptionButton:{eventListeners:{click:{handler:"handleAddOptionClick"}}}},styles:{".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view#trigger d=h av=c g=sm cur=${triggerCursor} ${containerAttrString} data-testid="tag-select-trigger" role="button" tabindex=${triggerTabIndex} aria-disabled=${isDisabled} style="min-height: 24px;"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c wrap g=sm w=1fg",value:{type:9,items:[{type:7,itemVar:"tag",indexVar:"i",iterable:{type:1,path:"triggerTags"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-tag data-selection-index=${tag.selectionIndex} pre=${tag.icon} data-testid=${tag.testId} v=mu style="${tag.tagStyle}"',value:{type:1,path:"tag.label"},parsedKey:{type:2,parts:["rtgl-tag data-selection-index=",{type:1,path:"tag.selectionIndex"}," pre=",{type:1,path:"tag.icon"}," data-testid=",{type:1,path:"tag.testId"},' v=mu style="',{type:1,path:"tag.tagStyle"},'"']}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#trigger d=h av=c g=sm cur=",{type:1,path:"triggerCursor"}," ",{type:1,path:"containerAttrString"},' data-testid="tag-select-trigger" role="button" tabindex=',{type:1,path:"triggerTabIndex"}," aria-disabled=",{type:1,path:"isDisabled"},' style="min-height: 24px;"']}}],fast:!1},{type:8,properties:[{key:"$if isOpen",value:{type:6,conditions:[{type:1,path:"isOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=bs content-w=${position.w} content-g=sm content-sv=true content-ph=md content-pv=md",value:{type:9,items:[{type:8,properties:[{key:"$if !hasSelectableOptions",value:{type:6,conditions:[{type:5,op:0,operand:{type:1,path:"hasSelectableOptions"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:0,value:"No tags available"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h wrap g=sm w=f",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"$if option.isSection",value:{type:6,conditions:[{type:1,path:"option.isSection"},{type:1,path:"option.isItem"},{type:1,path:"option.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f pt=xs",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-view#option${option.index} cur=${option.cursor} data-testid=${option.testId} role="button" tabindex=0 aria-pressed=${option.isSelected}',value:{type:9,items:[{type:8,properties:[{key:'rtgl-tag v=mu pre=${option.icon} style="${option.tagStyle}"',value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-tag v=mu pre=",{type:1,path:"option.icon"},' style="',{type:1,path:"option.tagStyle"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"option.index"}," cur=",{type:1,path:"option.cursor"}," data-testid=",{type:1,path:"option.testId"},' role="button" tabindex=0 aria-pressed=',{type:1,path:"option.isSelected"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=xs",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-button#addOptionButton v=gh s=sm pre=plus data-testid="tag-select-add-option"',value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h av=c g=sm w=f pt=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-button#submitButton v=pr s=sm data-testid="tag-select-submit" ?disabled=${submitDisabled}',value:{type:1,path:"submitLabel"},parsedKey:{type:2,parts:['rtgl-button#submitButton v=pr s=sm data-testid="tag-select-submit" ?disabled=',{type:1,path:"submitDisabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," place=bs content-w=",{type:1,path:"position.w"}," content-g=sm content-sv=true content-ph=md content-pv=md"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}},um={componentName:"rtgl-tooltip",propsSchema:{type:"object",properties:{open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},s:{type:"string",enum:["sm","md","lg"]},content:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},hm={template:{type:9,items:[{type:8,properties:[{key:'rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} no-overlay content-bgc=mu content-style="${contentStyle}"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view p=${padding} ah=s av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text ta=s s=${textSize} c=fg",value:{type:1,path:"content"},parsedKey:{type:2,parts:["rtgl-text ta=s s=",{type:1,path:"textSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view p=",{type:1,path:"padding"}," ah=s av=c"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," place=",{type:1,path:"place"},' no-overlay content-bgc=mu content-style="',{type:1,path:"contentStyle"},'"']}}],fast:!0}],fast:!0},refs:{}},fm={componentName:"rtgl-waveform",propsSchema:{type:"object",properties:{w:{type:"string",description:"Width of the waveform visualizer",default:"250"},h:{type:"string",description:"Height of the waveform visualizer",default:"150"},cur:{type:"string",description:"cursor"},waveformData:{type:"object",description:"File ID of the waveform data in object storage"},isLoading:{type:"boolean",description:"Whether the waveform data is currently being loaded"}}},events:[],methods:{type:"object",properties:{}}},ym={refs:{canvas:{selector:"canvas"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view pos=rel w=${w} h=${h} cur=${cur}",value:{type:9,items:[{type:8,properties:[{key:"$if isLoading",value:{type:6,conditions:[{type:1,path:"isLoading"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"..."}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'canvas#canvas style="width:100%; height:100%;"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view pos=rel w=",{type:1,path:"w"}," h=",{type:1,path:"h"}," cur=",{type:1,path:"cur"}]}}],fast:!1}],fast:!1}},x={};x.components={};x.components.accordionItem={};x.components.accordionItem.handlers=yo;x.components.accordionItem.schema=Ny;x.components.accordionItem.store=_o;x.components.accordionItem.view=jy;x.components.breadcrumb={};x.components.breadcrumb.handlers=So;x.components.breadcrumb.schema=Dy;x.components.breadcrumb.store=Lo;x.components.breadcrumb.view=Ry;x.components.card={};x.components.card.schema=Py;x.components.card.store=Ro;x.components.card.view=By;x.components.dropdownMenu={};x.components.dropdownMenu.handlers=Wo;x.components.dropdownMenu.schema=zy;x.components.dropdownMenu.store=qo;x.components.dropdownMenu.view=Wy;x.components.form={};x.components.form.handlers=hl;x.components.form.methods=Sl;x.components.form.schema=My;x.components.form.store=rl;x.components.form.view=Fy;x.components.globalUi={};x.components.globalUi.handlers=ql;x.components.globalUi.schema=Ky;x.components.globalUi.store=vp;x.components.globalUi.view=Uy;x.components.navbar={};x.components.navbar.handlers=_p;x.components.navbar.schema=Hy;x.components.navbar.store=Ip;x.components.navbar.view=qy;x.components.pageOutline={};x.components.pageOutline.handlers=Vp;x.components.pageOutline.schema=Yy;x.components.pageOutline.store=Wp;x.components.pageOutline.view=Gy;x.components.popoverInput={};x.components.popoverInput.handlers=Gp;x.components.popoverInput.schema=Jy;x.components.popoverInput.store=id;x.components.popoverInput.view=Zy;x.components.segmentedControl={};x.components.segmentedControl.handlers=ud;x.components.segmentedControl.schema=Xy;x.components.segmentedControl.store=kd;x.components.segmentedControl.view=Qy;x.components.select={};x.components.select.handlers=Rd;x.components.select.schema=em;x.components.select.store=rc;x.components.select.view=tm;x.components.sidebar={};x.components.sidebar.handlers=lc;x.components.sidebar.schema=rm;x.components.sidebar.store=_c;x.components.sidebar.view=im;x.components.sliderInput={};x.components.sliderInput.handlers=Ec;x.components.sliderInput.schema=sm;x.components.sliderInput.store=Oc;x.components.sliderInput.view=nm;x.components.table={};x.components.table.handlers=Nc;x.components.table.schema=om;x.components.table.store=Kc;x.components.table.view=am;x.components.tabs={};x.components.tabs.handlers=Hc;x.components.tabs.schema=lm;x.components.tabs.store=Zc;x.components.tabs.view=pm;x.components.tagSelect={};x.components.tagSelect.handlers=pu;x.components.tagSelect.methods=hu;x.components.tagSelect.schema=dm;x.components.tagSelect.store=ju;x.components.tagSelect.view=cm;x.components.tooltip={};x.components.tooltip.handlers=Du;x.components.tooltip.schema=um;x.components.tooltip.store=Bu;x.components.tooltip.view=hm;x.components.waveform={};x.components.waveform.handlers=Mu;x.components.waveform.schema=fm;x.components.waveform.store=Hu;x.components.waveform.view=ym;Object.keys(x).forEach(e=>{Object.keys(x[e]).forEach(t=>{let r=x[e][t],i=Iy({...r},Vy[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",ri({}));customElements.define("rtgl-carousel",ai({}));customElements.define("rtgl-grid",li({}));customElements.define("rtgl-view",di({}));customElements.define("rtgl-text",ui({}));customElements.define("rtgl-image",yi({}));customElements.define("rtgl-tag",gi({}));customElements.define("rtgl-svg",vi({}));customElements.define("rtgl-input",ve({}));customElements.define("rtgl-input-date",wi({}));customElements.define("rtgl-input-time",_i({}));customElements.define("rtgl-input-datetime",xi({}));customElements.define("rtgl-input-number",Si({}));customElements.define("rtgl-textarea",Ai({}));customElements.define("rtgl-color-picker",ki({}));customElements.define("rtgl-slider",Ei({}));customElements.define("rtgl-checkbox",$i({}));customElements.define("rtgl-dialog",Ci({}));customElements.define("rtgl-popover",Oi({}));})();
|
|
1532
|
+
`,Gs="data-rtgl-render-target",Cn="__rtglRenderTarget",Vs=e=>!e||typeof e!="object"?!1:typeof e.getAttribute=="function"?e.getAttribute(Gs)!==null:e[Cn]===!0,li=e=>{!e||typeof e!="object"||(typeof e.setAttribute=="function"?e.setAttribute(Gs,""):e[Cn]=!0)},Pf=e=>{if(!(!e||typeof e!="object"))return typeof e.querySelector=="function"?e.querySelector(`[${Gs}]`)??e.firstElementChild:Array.isArray(e.childNodes)?e.childNodes.find(Vs)??e.childNodes[0]:Array.isArray(e.children)?e.children.find(Vs)??e.children[0]:e.firstElementChild},Bf=({host:e,cssText:t,createStyleSheet:s=()=>new CSSStyleSheet,createElement:r=i=>document.createElement(i)})=>{let i=e.shadowRoot??e.attachShadow({mode:"open"}),n=s();n.replaceSync(Df);let o=[n];if(t){let a=s();a.replaceSync(t),o.push(a)}i.adoptedStyleSheets=o;let l=Pf(i);l?(l.style.cssText="display: contents;",Vs(l)||li(l)):(l=r("div"),l.style.cssText="display: contents;",li(l),i.appendChild(l)),l.parentNode!==i&&i.appendChild(l);let p=rn(e);return p&&typeof p=="object"&&(p.display="contents"),{shadow:i,renderTarget:l,adoptedStyleSheets:o}},Ns=(e,t=requestAnimationFrame)=>t(e),zf=({scheduleFrameFn:e=Ns}={})=>({update:(t,s)=>{let r=t.data?.props||{},i=s.data?.props||{};if(JSON.stringify(r)===JSON.stringify(i))return;let n=s.elm;!n||typeof n.render!="function"||(n.setAttribute("isDirty","true"),e(()=>{if(n.render(),n.removeAttribute("isDirty"),n.handlers&&n.handlers.handleOnUpdate){let o={...n.deps,store:n.store,render:n.render.bind(n),handlers:n.handlers,dispatchEvent:n.dispatchEvent.bind(n),refs:n.refIds||{}};n.handlers.handleOnUpdate(o,{oldProps:r,newProps:i})}}))}}),Wf=({elementName:e,propsSchema:t,propsSchemaKeys:s,template:r,refs:i,styles:n,handlers:o,methods:l,constants:p,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 m={};return this.store.selectViewData&&(m=this.store.selectViewData()),m}connectedCallback(){let m=Bf({host:this,cssText:this.cssText});this.shadow=m.shadow,this.renderTarget=m.renderTarget,Lf({instance:this,parseAndRenderFn:fn,renderFn:this.render})}disconnectedCallback(){Vf({instance:this,clearTimerFn:clearTimeout})}attributeChangedCallback(m,b,g){Nf({instance:this,attributeName:m,oldValue:b,newValue:g,scheduleFrameFn:Ns})}render=()=>{jf({instance:this,createComponentUpdateHookFn:zf})}}class u extends f{static get observedAttributes(){return Cf({propsSchemaKeys:s,toKebabCase:tn})}constructor(){super(),this.constants=Kh({setupConstants:h?.constants,fileConstants:p}),this.propsSchema=t,Ju({source:this,allowedKeys:s,onPropChange:({propName:m,oldValue:b,newValue:g})=>{Rf({instance:this,propName:m,oldValue:b,newValue:g,scheduleFrameFn:Ns})}}),this.props=t?Zu(this,s):{},this._propsSchemaKeys=s,this.elementName=e,this.styles=n,this.store=Fh(a,this.props,this.constants),this.template=r,this.handlers=o,this.methods=l,this.refs=i,this.patch=c,this.deps={...h,store:this.store,render:this.render,handlers:o,props:this.props,constants:this.constants},Th(this,this.methods),this._snabbdomH=d,this.cssText=Uh(e,n)}}return u};function st(e,t,s,r,i){let n=t===void 0?void 0:t.key;return{sel:e,data:t,children:s,text:r,elm:i,key:n}}var kt=Array.isArray;function yt(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function Mf(e,t){return document.createElement(e,t)}function Ff(e,t,s){return document.createElementNS(e,t,s)}function Kf(){return Ae(document.createDocumentFragment())}function Uf(e){return document.createTextNode(e)}function Hf(e){return document.createComment(e)}function qf(e,t,s){if(me(e)){let r=e;for(;r&&me(r);)r=Ae(r).parent;e=r??e}me(t)&&(t=Ae(t,e)),s&&me(s)&&(s=Ae(s).firstChildNode),e.insertBefore(t,s)}function Yf(e,t){e.removeChild(t)}function Gf(e,t){me(t)&&(t=Ae(t,e)),e.appendChild(t)}function In(e){if(me(e)){for(;e&&me(e);)e=Ae(e).parent;return e??null}return e.parentNode}function Jf(e){var t;if(me(e)){let s=Ae(e),r=In(s);if(r&&s.lastChildNode){let i=Array.from(r.childNodes),n=i.indexOf(s.lastChildNode);return(t=i[n+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function Zf(e){return e.tagName}function Xf(e,t){e.textContent=t}function Qf(e){return e.textContent}function ey(e){return e.nodeType===1}function ty(e){return e.nodeType===3}function sy(e){return e.nodeType===8}function me(e){return e.nodeType===11}function Ae(e,t){var s,r,i;let n=e;return(s=n.parent)!==null&&s!==void 0||(n.parent=t??null),(r=n.firstChildNode)!==null&&r!==void 0||(n.firstChildNode=e.firstChild),(i=n.lastChildNode)!==null&&i!==void 0||(n.lastChildNode=e.lastChild),n}var ry={createElement:Mf,createElementNS:Ff,createTextNode:Uf,createDocumentFragment:Kf,createComment:Hf,insertBefore:qf,removeChild:Yf,appendChild:Gf,parentNode:In,nextSibling:Jf,tagName:Zf,setTextContent:Xf,getTextContent:Qf,isElement:ey,isText:ty,isComment:sy,isDocumentFragment:me};function ft(e){return e===void 0}function se(e){return e!==void 0}var fs=st("",{},[],void 0,void 0);function Ze(e,t){var s,r;let i=e.key===t.key,n=((s=e.data)===null||s===void 0?void 0:s.is)===((r=t.data)===null||r===void 0?void 0:r.is),o=e.sel===t.sel,l=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return o&&i&&n&&l}function iy(){throw new Error("The document fragment is not supported on this platform.")}function ny(e,t){return e.isElement(t)}function oy(e,t){return e.isDocumentFragment(t)}function ay(e,t,s){var r;let i={};for(let n=t;n<=s;++n){let o=(r=e[n])===null||r===void 0?void 0:r.key;o!==void 0&&(i[o]=n)}return i}var ly=["create","update","remove","destroy","pre","post"];function py(e,t,s){let r={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=ry;for(let u of ly)for(let y of e){let m=y[u];m!==void 0&&r[u].push(m)}function n(u){let y=u.id?"#"+u.id:"",m=u.getAttribute("class"),b=m?"."+m.split(" ").join("."):"";return st(i.tagName(u).toLowerCase()+y+b,{},[],void 0,u)}function o(u){return st(void 0,{},[],void 0,u)}function l(u,y){return function(){if(--y===0){let m=i.parentNode(u);m!==null&&i.removeChild(m,u)}}}function p(u,y){var m,b,g,_;let S,A=u.data;if(A!==void 0){let I=(m=A.hook)===null||m===void 0?void 0:m.init;se(I)&&(I(u),A=u.data)}let k=u.children,C=u.sel;if(C==="!")ft(u.text)&&(u.text=""),u.elm=i.createComment(u.text);else if(C==="")u.elm=i.createTextNode(u.text);else if(C!==void 0){let I=C.indexOf("#"),V=C.indexOf(".",I),z=I>0?I:C.length,B=V>0?V:C.length,J=I!==-1||V!==-1?C.slice(0,Math.min(z,B)):C,Z=u.elm=se(A)&&se(S=A.ns)?i.createElementNS(S,J,A):i.createElement(J,A);for(z<B&&Z.setAttribute("id",C.slice(z+1,B)),V>0&&Z.setAttribute("class",C.slice(B+1).replace(/\./g," ")),S=0;S<r.create.length;++S)r.create[S](fs,u);if(yt(u.text)&&(!kt(k)||k.length===0)&&i.appendChild(Z,i.createTextNode(u.text)),kt(k))for(S=0;S<k.length;++S){let we=k[S];we!=null&&i.appendChild(Z,p(we,y))}let ge=u.data.hook;se(ge)&&((b=ge.create)===null||b===void 0||b.call(ge,fs,u),ge.insert&&y.push(u))}else if(!((g=void 0)===null||g===void 0)&&g.fragments&&u.children){for(u.elm=((_=i.createDocumentFragment)!==null&&_!==void 0?_:iy)(),S=0;S<r.create.length;++S)r.create[S](fs,u);for(S=0;S<u.children.length;++S){let I=u.children[S];I!=null&&i.appendChild(u.elm,p(I,y))}}else u.elm=i.createTextNode(u.text);return u.elm}function a(u,y,m,b,g,_){for(;b<=g;++b){let S=m[b];S!=null&&i.insertBefore(u,p(S,_),y)}}function c(u){var y,m;let b=u.data;if(b!==void 0){(m=(y=b?.hook)===null||y===void 0?void 0:y.destroy)===null||m===void 0||m.call(y,u);for(let g=0;g<r.destroy.length;++g)r.destroy[g](u);if(u.children!==void 0)for(let g=0;g<u.children.length;++g){let _=u.children[g];_!=null&&typeof _!="string"&&c(_)}}}function d(u,y,m,b){for(var g,_;m<=b;++m){let S,A,k=y[m];if(k!=null)if(se(k.sel)){c(k),S=r.remove.length+1,A=l(k.elm,S);for(let I=0;I<r.remove.length;++I)r.remove[I](k,A);let C=(_=(g=k?.data)===null||g===void 0?void 0:g.hook)===null||_===void 0?void 0:_.remove;se(C)?C(k,A):A()}else k.children?(c(k),d(u,k.children,0,k.children.length-1)):i.removeChild(u,k.elm)}}function h(u,y,m,b){let g=0,_=0,S=y.length-1,A=y[0],k=y[S],C=m.length-1,I=m[0],V=m[C],z,B,J,Z;for(;g<=S&&_<=C;)A==null?A=y[++g]:k==null?k=y[--S]:I==null?I=m[++_]:V==null?V=m[--C]:Ze(A,I)?(f(A,I,b),A=y[++g],I=m[++_]):Ze(k,V)?(f(k,V,b),k=y[--S],V=m[--C]):Ze(A,V)?(f(A,V,b),i.insertBefore(u,A.elm,i.nextSibling(k.elm)),A=y[++g],V=m[--C]):Ze(k,I)?(f(k,I,b),i.insertBefore(u,k.elm,A.elm),k=y[--S],I=m[++_]):(z===void 0&&(z=ay(y,g,S)),B=z[I.key],ft(B)?(i.insertBefore(u,p(I,b),A.elm),I=m[++_]):ft(z[V.key])?(i.insertBefore(u,p(V,b),i.nextSibling(k.elm)),V=m[--C]):(J=y[B],J.sel!==I.sel?i.insertBefore(u,p(I,b),A.elm):(f(J,I,b),y[B]=void 0,i.insertBefore(u,J.elm,A.elm)),I=m[++_]));_<=C&&(Z=m[C+1]==null?null:m[C+1].elm,a(u,Z,m,_,C,b)),g<=S&&d(u,y,g,S)}function f(u,y,m){var b,g,_,S,A,k,C,I;let V=(b=y.data)===null||b===void 0?void 0:b.hook;(g=V?.prepatch)===null||g===void 0||g.call(V,u,y);let z=y.elm=u.elm;if(u===y)return;if(y.data!==void 0||se(y.text)&&y.text!==u.text){(_=y.data)!==null&&_!==void 0||(y.data={}),(S=u.data)!==null&&S!==void 0||(u.data={});for(let Z=0;Z<r.update.length;++Z)r.update[Z](u,y);(C=(k=(A=y.data)===null||A===void 0?void 0:A.hook)===null||k===void 0?void 0:k.update)===null||C===void 0||C.call(k,u,y)}let B=u.children,J=y.children;ft(y.text)?se(B)&&se(J)?B!==J&&h(z,B,J,m):se(J)?(se(u.text)&&i.setTextContent(z,""),a(z,null,J,0,J.length-1,m)):se(B)?d(z,B,0,B.length-1):se(u.text)&&i.setTextContent(z,""):u.text!==y.text&&(se(B)&&d(z,B,0,B.length-1),i.setTextContent(z,y.text)),(I=V?.postpatch)===null||I===void 0||I.call(V,u,y)}return function(u,y){let m,b,g,_=[];for(m=0;m<r.pre.length;++m)r.pre[m]();for(ny(i,u)?u=n(u):oy(i,u)&&(u=o(u)),Ze(u,y)?f(u,y,_):(b=u.elm,g=i.parentNode(b),p(y,_),g!==null&&(i.insertBefore(g,y.elm,i.nextSibling(b)),d(g,[u],0,0))),m=0;m<_.length;++m)_[m].data.hook.insert(_[m]);for(m=0;m<r.post.length;++m)r.post[m]();return y}}function pi(e,t){let s,r,i=t.elm,n=e.data.class,o=t.data.class;if(!(!n&&!o)&&n!==o){n=n||{},o=o||{};for(r in n)n[r]&&!Object.prototype.hasOwnProperty.call(o,r)&&i.classList.remove(r);for(r in o)s=o[r],s!==n[r]&&i.classList[s?"add":"remove"](r)}}var dy={create:pi,update:pi};function di(e,t){let s,r,i,n=t.elm,o=e.data.props,l=t.data.props;if(!(!o&&!l)&&o!==l){o=o||{},l=l||{};for(s in l)r=l[s],i=o[s],i!==r&&(s!=="value"||n[s]!==r)&&(n[s]=r)}}var cy={create:di,update:di},uy="http://www.w3.org/1999/xlink",hy="http://www.w3.org/2000/xmlns/",fy="http://www.w3.org/XML/1998/namespace",ci=58,yy=120,my=109;function ui(e,t){let s,r=t.elm,i=e.data.attrs,n=t.data.attrs;if(!(!i&&!n)&&i!==n){i=i||{},n=n||{};for(s in n){let o=n[s];i[s]!==o&&(o===!0?r.setAttribute(s,""):o===!1?r.removeAttribute(s):s.charCodeAt(0)!==yy?r.setAttribute(s,o):s.charCodeAt(3)===ci?r.setAttributeNS(fy,s,o):s.charCodeAt(5)===ci?s.charCodeAt(1)===my?r.setAttributeNS(hy,s,o):r.setAttributeNS(uy,s,o):r.setAttribute(s,o))}for(s in i)s in n||r.removeAttribute(s)}}var gy={create:ui,update:ui},hi=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,by=function(e){hi(function(){hi(e)})},Rs=!1;function vy(e,t,s){by(function(){e[t]=s})}function fi(e,t){let s,r,i=t.elm,n=e.data.style,o=t.data.style;if(!n&&!o||n===o)return;n=n||{},o=o||{};let l="delayed"in n;for(r in n)r in o||(r[0]==="-"&&r[1]==="-"?i.style.removeProperty(r):i.style[r]="");for(r in o)if(s=o[r],r==="delayed"&&o.delayed)for(let p in o.delayed)s=o.delayed[p],(!l||s!==n.delayed[p])&&vy(i.style,p,s);else r!=="remove"&&s!==n[r]&&(r[0]==="-"&&r[1]==="-"?i.style.setProperty(r,s):i.style[r]=s)}function wy(e){let t,s,r=e.elm,i=e.data.style;if(!(!i||!(t=i.destroy)))for(s in t)r.style[s]=t[s]}function _y(e,t){let s=e.data.style;if(!s||!s.remove){t();return}Rs||(e.elm.offsetLeft,Rs=!0);let r,i=e.elm,n=0,o=s.remove,l=0,p=[];for(r in o)p.push(r),i.style[r]=o[r];let a=getComputedStyle(i)["transition-property"].split(", ");for(;n<a.length;++n)p.indexOf(a[n])!==-1&&l++;i.addEventListener("transitionend",function(c){c.target===i&&--l,l===0&&t()})}function xy(){Rs=!1}var Sy={pre:xy,create:fi,update:fi,destroy:wy,remove:_y};function On(e,t,s){if(typeof e=="function")e.call(t,s,t);else if(typeof e=="object")for(let r=0;r<e.length;r++)On(e[r],t,s)}function Ay(e,t){let s=e.type,r=t.data.on;r&&r[s]&&On(r[s],t,e)}function ky(){return function e(t){Ay(t,e.vnode)}}function ys(e,t){let s=e.data.on,r=e.listener,i=e.elm,n=t&&t.data.on,o=t&&t.elm,l;if(s!==n){if(s&&r)if(n)for(l in s)n[l]||i.removeEventListener(l,r,!1);else for(l in s)i.removeEventListener(l,r,!1);if(n){let p=t.listener=e.listener||ky();if(p.vnode=t,s)for(l in n)s[l]||o.addEventListener(l,p,!1);else for(l in n)o.addEventListener(l,p,!1)}}}var Ey={create:ys,update:ys,destroy:ys},$y=()=>py([dy,cy,gy,Sy,Ey]);function Tn(e,t,s){if(e.ns="http://www.w3.org/2000/svg",s!=="foreignObject"&&t!==void 0)for(let r=0;r<t.length;++r){let i=t[r];if(typeof i=="string")continue;let n=i.data;n!==void 0&&Tn(n,i.children,i.sel)}}function Cy(e,t,s){let r={},i,n,o;if(s!==void 0?(t!==null&&(r=t),kt(s)?i=s:yt(s)?n=s.toString():s&&s.sel&&(i=[s])):t!=null&&(kt(t)?i=t:yt(t)?n=t.toString():t&&t.sel?i=[t]:r=t),i!==void 0)for(o=0;o<i.length;++o)yt(i[o])&&(i[o]=st(void 0,void 0,void 0,i[o],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&Tn(r,i,e),st(e,r,i,n,void 0)}var Iy=$y(),Oy=({handlers:e,methods:t,constants:s,schema:r,view:i,store:n},o)=>{if(!i)throw new Error("view is not defined");if(!r||typeof r!="object"||Array.isArray(r))throw new Error("schema is required. Define component metadata in .schema.yaml.");let l=r,{template:p,refs:a,styles:c}=i;Xu({schema:l,methodExports:Object.keys(t||{})});let d=l.componentName,h=l.propsSchema,f=h?.properties?[...new Set(Object.keys(h.properties).map(u=>sn(u)))]:[];return Wf({elementName:d,propsSchema:h,propsSchemaKeys:f,template:p,refs:a,styles:c,handlers:e,methods:t,constants:s,store:n,patch:Iy,h:Cy,deps:o})},Ty=e=>{let t={};return{once:(s,r)=>{t[s]||(t[s]=[]);let i=(...n)=>{r(...n),t[s]=t[s].filter(o=>o!==i)};return t[s].push(i),()=>{t[s]=(t[s]??[]).filter(n=>n!==i)}},emit:(s,...r)=>{t[s]&&[...t[s]].forEach(i=>{i(...r)})},showAlert:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showConfirm:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showFormDialog:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showComponentDialog:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showDropdownMenu:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showToast:s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},closeAll:async()=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")}}},Ly=Ty(),Vy={globalUI:Ly},Ny={components:Vy},Ry={componentName:"rtgl-accordion-item",propsSchema:{type:"object",properties:{label:{type:"string"},content:{type:"string"},w:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},jy={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}},Dy={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:{}}},Py={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}},By={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:{}}},zy={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}},Wy={componentName:"rtgl-dropdown-menu",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["section","item","separator","label"]},id:{type:"string"},icon:{type:"string"},path:{type:"string"},href:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},disabled:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"},testId:{type:"string"}}}},open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},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:{}}},My={refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},styles:{a:{display:"block",width:"100%","text-decoration":"none",color:"inherit"},".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} content-w=${w} content-h=${h} content-sv=true content-g=xs content-pv=sm",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isSection",value:{type:6,conditions:[{type:1,path:"item.isSection"},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.isDisabled"}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:4,op:6,left:{type:1,path:"item.hasHref"},right:{type:1,path:"item.linkExtraAttrs"}}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.hasHref"}},{type:1,path:"item.isItem"},{type:1,path:"item.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f p=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=sm",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," place=",{type:1,path:"place"}," 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}},Fy={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"}}}},Ky={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 == "tag-select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"tag-select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-tag-select#field${field._idx} data-field-name=${field.name} w=f :options=${field.options} :selectedValues=${field._selectedValues} :placeholder=${field.placeholder} :addOption=${field.addOption} ?no-add=${field.noAdd} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-tag-select#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=",{type:1,path:"field.options"}," :selectedValues=",{type:1,path:"field._selectedValues"}," :placeholder=",{type:1,path:"field.placeholder"}," :addOption=",{type:1,path:"field.addOption"}," ?no-add=",{type:1,path:"field.noAdd"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "segmented-control"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"segmented-control"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-segmented-control#field${field._idx} data-field-name=${field.name} w=f :options=${field.options} ?no-clear=${field.noClear} :selectedValue=${field._selectedValue} :placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-segmented-control#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=",{type:1,path:"field.options"}," ?no-clear=",{type:1,path:"field.noClear"}," :selectedValue=",{type:1,path:"field._selectedValue"}," :placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "color-picker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"color-picker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#field${field._idx} data-field-name=${field.name} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slider"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slider-with-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slider-with-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider-input#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "popover-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"popover-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-popover-input#field${field._idx} data-field-name=${field.name} label="${field.label}" placeholder=${field.placeholder} ?disabled=${field._disabled}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-popover-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field.label"},'" placeholder=',{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "checkbox"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"checkbox"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-checkbox#field${field._idx} data-field-name=${field.name} label="${field._checkboxText}" ?disabled=${field._disabled}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-checkbox#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field._checkboxText"},'" ?disabled=',{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "image" && field._imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"image"}},right:{type:1,path:"field._imageSrc"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image#image${field._idx} data-field-name=${field.name} src=${field._imageSrc} w=${field.width} h=${field.height} cur=pointer",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image#image",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," src=",{type:1,path:"field._imageSrc"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=pointer"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "image" && !field._imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"image"}},right:{type:5,op:0,operand:{type:1,path:"field._imageSrc"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#image${field._idx} data-field-name=${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=pointer p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg ta=c",value:{type:1,path:"field.placeholderText"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#image",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," bc=ac bw=sm ah=c av=c cur=pointer p=md"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "read-only-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"read-only-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"field.content"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slot"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slot"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'slot#fieldSlot${field._idx} name=${field.slot} style="display: contents;"',value:{type:0,value:null},parsedKey:{type:2,parts:["slot#fieldSlot",{type:1,path:"field._idx"}," name=",{type:1,path:"field.slot"},' style="display: contents;"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field._error",value:{type:6,conditions:[{type:1,path:"field._error"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=de",value:{type:1,path:"field._error"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if actions.buttons.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"actions.buttons.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'$if actions._layout == "split"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"split"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h w=f g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._leftButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=sm ah=e w=1fg",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._rightButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if actions._layout == "vertical"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"vertical"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._allButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} w=f ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," w=f ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if actions._layout == "stretch"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"stretch"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._allButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} w=f ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," w=f ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'rtgl-tooltip ?open=${tooltipState.open} x=${tooltipState.x} y=${tooltipState.y} place="t" content="${tooltipState.content}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-tooltip ?open=",{type:1,path:"tooltipState.open"}," x=",{type:1,path:"tooltipState.x"}," y=",{type:1,path:"tooltipState.y"},' place="t" content="',{type:1,path:"tooltipState.content"},'"']}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#formContainer w=f p=md g=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Uy={componentName:"rtgl-global-ui",propsSchema:{type:"object",properties:{}},events:[],methods:{type:"object",properties:{}}},Hy={refs:{dialog:{eventListeners:{close:{handler:"handleDialogClose"}}},confirmButton:{eventListeners:{click:{handler:"handleConfirm"}}},cancelButton:{eventListeners:{click:{handler:"handleCancel"}}},componentDialogBodyHost:{},"componentDialogAction*":{eventListeners:{click:{handler:"handleComponentDialogAction"}}},formDialog:{eventListeners:{"form-action":{handler:"handleFormAction"},"form-field-event":{handler:"handleFormFieldEvent"}}},dropdownMenu:{eventListeners:{close:{handler:"handleDropdownClose"},"item-click":{handler:"handleDropdownItemClick"}}}},styles:{".toast-layer":{"pointer-events":"none"},".toast-card":{"pointer-events":"auto","box-sizing":"border-box",width:"33vw","max-width":"calc(100vw - 2 * var(--spacing-lg))",opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 180ms cubic-bezier(0.16, 1, 0.3, 1), transform 180ms cubic-bezier(0.16, 1, 0.3, 1)","will-change":"opacity, transform"},".toast-card-top":{animation:"toast-in-top 220ms cubic-bezier(0.16, 1, 0.3, 1)"},".toast-card-bottom":{animation:"toast-in-bottom 220ms cubic-bezier(0.16, 1, 0.3, 1)"},".toast-card-md":{width:"50vw"},".toast-card-lg":{width:"80vw"},".toast-card-top.toast-card-exiting":{opacity:0,transform:"translateY(calc(var(--spacing-sm) * -0.5)) scale(0.98)"},".toast-card-bottom.toast-card-exiting":{opacity:0,transform:"translateY(calc(var(--spacing-sm) * 0.5)) scale(0.98)"},".toast-message":{"overflow-wrap":"anywhere"},"@keyframes toast-in-top":{from:{opacity:0,transform:"translateY(calc(var(--spacing-sm) * -1)) scale(0.96)"},to:{opacity:1,transform:"translateY(0) scale(1)"}},"@keyframes toast-in-bottom":{from:{opacity:0,transform:"translateY(var(--spacing-sm)) scale(0.96)"},to:{opacity:1,transform:"translateY(0) scale(1)"}},"@media (prefers-reduced-motion: reduce)":{".toast-card":{animation:"none",transition:"none"}}},template:{type:9,items:[{type:8,properties:[{key:"$if topToasts.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"topToasts.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-layer toast-layer-top" pos=fix edge=t z=2100 w=f ah=c g=sm ph=md pt=xl',value:{type:9,items:[{type:7,itemVar:"toast",indexVar:"i",iterable:{type:1,path:"topToasts"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-card toast-card-top toast-card-${toast.size} toast-card-${toast.phase}" key=toast-${toast.id} bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text class=toast-message ta=c w=f",value:{type:1,path:"toast.message"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view class="toast-card toast-card-top toast-card-',{type:1,path:"toast.size"}," toast-card-",{type:1,path:"toast.phase"},'" key=toast-',{type:1,path:"toast.id"}," bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if bottomToasts.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"bottomToasts.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-layer toast-layer-bottom" pos=fix edge=b z=2100 w=f ah=c g=sm ph=md pb=xl',value:{type:9,items:[{type:7,itemVar:"toast",indexVar:"i",iterable:{type:1,path:"bottomToasts"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-card toast-card-bottom toast-card-${toast.size} toast-card-${toast.phase}" key=toast-${toast.id} bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text class=toast-message ta=c w=f",value:{type:1,path:"toast.message"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view class="toast-card toast-card-bottom toast-card-',{type:1,path:"toast.size"}," toast-card-",{type:1,path:"toast.phase"},'" key=toast-',{type:1,path:"toast.id"}," bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-dialog#dialog ?open=${isDialogContainerOpen} s=${dialogSize}",value:{type:9,items:[{type:8,properties:[{key:"$if isFormDialogOpen",value:{type:6,conditions:[{type:1,path:"isFormDialogOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-form#formDialog slot=content :form=${formDialogConfig.form} :defaultValues=${formDialogConfig.defaultValues} :context=${formDialogConfig.context} ?disabled=${formDialogConfig.disabled} key=form-dialog-${formDialogConfig.key}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-form#formDialog slot=content :form=",{type:1,path:"formDialogConfig.form"}," :defaultValues=",{type:1,path:"formDialogConfig.defaultValues"}," :context=",{type:1,path:"formDialogConfig.context"}," ?disabled=",{type:1,path:"formDialogConfig.disabled"}," key=form-dialog-",{type:1,path:"formDialogConfig.key"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if isComponentDialogOpen",value:{type:6,conditions:[{type:1,path:"isComponentDialogOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"$if componentDialogConfig.title || componentDialogConfig.description",value:{type:6,conditions:[{type:4,op:7,left:{type:1,path:"componentDialogConfig.title"},right:{type:1,path:"componentDialogConfig.description"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if componentDialogConfig.title",value:{type:6,conditions:[{type:1,path:"componentDialogConfig.title"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"componentDialogConfig.title"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if componentDialogConfig.description",value:{type:6,conditions:[{type:1,path:"componentDialogConfig.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"componentDialogConfig.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view#componentDialogBodyHost w=f key=component-dialog-body-${componentDialogConfig.key}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view#componentDialogBodyHost w=f key=component-dialog-body-",{type:1,path:"componentDialogConfig.key"}]}}],fast:!0},{type:8,properties:[{key:"$if componentDialogConfig.actions.buttons.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"componentDialogConfig.actions.buttons.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h w=f g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"componentDialogConfig.actions._leftButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#componentDialogAction${button._globalIdx} data-action-id=${button.id} data-action-index=${button._globalIdx} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#componentDialogAction",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," data-action-index=",{type:1,path:"button._globalIdx"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=sm ah=e w=1fg",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"componentDialogConfig.actions._rightButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#componentDialogAction${button._globalIdx} data-action-id=${button.id} data-action-index=${button._globalIdx} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#componentDialogAction",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," data-action-index=",{type:1,path:"button._globalIdx"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if !isFormDialogOpen && !isComponentDialogOpen",value:{type:6,conditions:[{type:4,op:6,left:{type:5,op:0,operand:{type:1,path:"isFormDialogOpen"}},right:{type:5,op:0,operand:{type:1,path:"isComponentDialogOpen"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if config.title",value:{type:6,conditions:[{type:1,path:"config.title"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"config.title"}}],fast:!0},{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=md mt=lg w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"$if config.mode == 'confirm'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"config.mode"},right:{type:0,value:"confirm"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-button#cancelButton v=se",value:{type:1,path:"config.cancelText"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-button#confirmButton v=pr",value:{type:1,path:"config.confirmText"}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-dialog#dialog ?open=",{type:1,path:"isDialogContainerOpen"}," s=",{type:1,path:"dialogSize"}]}}],fast:!1},{type:8,properties:[{key:"rtgl-dropdown-menu#dropdownMenu ?open=${isDropdownOpen} x=${dropdownConfig.x} y=${dropdownConfig.y} place=${dropdownConfig.place} :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}},qy={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:{}}},Yy={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}},Gy={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:{}}},Jy={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}},Zy={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:{}}},Xy={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}},Qy={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:{}}},em={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}},tm={componentName:"rtgl-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{type:{type:"string",enum:["section","item","separator"]},label:{type:"string"},value:{type:"any"},icon:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},testId:{type:"string"}}}},selectedValue:{type:"any"},onChange:{type:"function"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}},sm={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"}}}},styles:{".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view#selectButton style="display: inline-flex;" d=h av=c h=32 ph=md bw=xs bc=bo h-bc=${selectButtonHoverBorderColor} br=md bgc=su cur=${selectButtonCursor} ${containerAttrString} data-testid="select-button" role="button" tabindex=${selectButtonTabIndex} aria-disabled=${isDisabled}',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c ah=s w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if hasSelectedIcon",value:{type:6,conditions:[{type:1,path:"hasSelectedIcon"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg svg=${selectedIcon} wh=16 c=${selectedIconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg svg=",{type:1,path:"selectedIcon"}," wh=16 c=",{type:1,path:"selectedIconColor"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text w=1fg ta=s c=${selectedLabelColor} ellipsis",value:{type:1,path:"selectedLabel"},parsedKey:{type:2,parts:["rtgl-text w=1fg ta=s c=",{type:1,path:"selectedLabelColor"}," ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if hasSelectedSuffixText",value:{type:6,conditions:[{type:1,path:"hasSelectedSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${selectedSuffixTextColor} ta=e",value:{type:1,path:"selectedSuffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"selectedSuffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if showClear",value:{type:6,conditions:[{type:1,path:"showClear"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#clearButton svg=x wh=16 c=mu-fg cur=pointer data-testid="select-clear-button"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-svg svg=chevronDown wh=16 c=mu-fg",value:{type:0,value:null}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:['rtgl-view#selectButton style="display: inline-flex;" d=h av=c h=32 ph=md bw=xs bc=bo h-bc=',{type:1,path:"selectButtonHoverBorderColor"}," br=md bgc=su cur=",{type:1,path:"selectButtonCursor"}," ",{type:1,path:"containerAttrString"},' data-testid="select-button" role="button" tabindex=',{type:1,path:"selectButtonTabIndex"}," aria-disabled=",{type:1,path:"isDisabled"}]}}],fast:!1},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=rs content-wh=300 content-g=xs content-sv=true content-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:"$if option.isSection",value:{type:6,conditions:[{type:1,path:"option.isSection"},{type:1,path:"option.isItem"},{type:1,path:"option.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${option.index} w=f ph=lg pv=md cur=pointer bgc=${option.bgc} data-testid=${option.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if option.hasIconSlot",value:{type:6,conditions:[{type:1,path:"option.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if option.hasIcon",value:{type:6,conditions:[{type:1,path:"option.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${option.icon} c=${option.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"option.icon"}," c=",{type:1,path:"option.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${option.c} w=1fg ellipsis",value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"option.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if option.hasSuffixText",value:{type:6,conditions:[{type:1,path:"option.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${option.suffixTextColor} ta=e",value:{type:1,path:"option.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"option.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"option.index"}," w=f ph=lg pv=md cur=pointer bgc=",{type:1,path:"option.bgc"}," data-testid=",{type:1,path:"option.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=sm",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0},{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}},rm={componentName:"rtgl-sidebar",propsSchema:{type:"object",properties:{mode:{type:"string"},hideHeader:{type:"boolean",default:!1},tooltip:{type:"boolean",default:!1},showCompactTooltip:{type:"boolean",default:!1,description:"Deprecated alias for tooltip. Use tooltip instead."},w:{type:"string"},bwr:{type:"string"},selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},testId:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{label:{type:"string"},title:{type:"string",description:"Deprecated item text field. Use label instead."},slug:{type:"string"},type:{type:"string",description:"Item row type. Supports item, groupLabel, divider, and spacer."},tooltip:{type:"string"},items:{type:"array"},testId:{type:"string"}}}}}},events:{"header-click":{type:"object",properties:{path:{type:"string"}}},"item-click":{type:"object",properties:{item:{type:"object"}}}},methods:{type:"object",properties:{}}},im={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}},nm={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:{}}},om={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}},am={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:{}}},lm={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}},pm={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:{}}},dm={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}},cm={componentName:"rtgl-tag-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{type:{type:"string",enum:["section","item","separator"]},label:{type:"string"},value:{type:"any"},icon:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},testId:{type:"string"}}}},selectedValues:{type:"array",items:{type:"any"}},draftSelectedValues:{type:"array",items:{type:"any"}},open:{type:"boolean"},onChange:{type:"function"},addOption:{type:"object",properties:{label:{type:"string"}}},noAdd:{type:"boolean"},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"draft-value-change":{},"open-change":{},"add-option-click":{}},methods:{type:"object",properties:{refreshPopover:{description:"Recomputes the open popover position and rerenders the current options and draft values.",params:["values","keepOpen"],returns:"void"},setDraftSelectedValues:{description:"Replaces the draft-only selection without committing `selectedValues`; optionally reopens the popover around the trigger when `keepOpen` is true.",params:["values","keepOpen"],returns:"void"},appendDraftSelectedValue:{description:"Adds a value to the draft-only selection without committing `selectedValues`; optionally reopens the popover around the trigger when `keepOpen` is true.",params:["value","keepOpen"],returns:"void"}}}},um={refs:{trigger:{eventListeners:{click:{handler:"handleTriggerClick"},keydown:{handler:"handleTriggerKeyDown"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},"option*":{eventListeners:{click:{handler:"handleOptionClick"},keydown:{handler:"handleOptionKeyDown"}}},submitButton:{eventListeners:{click:{handler:"handleSubmitClick"}}},addOptionButton:{eventListeners:{click:{handler:"handleAddOptionClick"}}}},styles:{".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view#trigger d=h av=c g=sm cur=${triggerCursor} ${containerAttrString} data-testid="tag-select-trigger" role="button" tabindex=${triggerTabIndex} aria-disabled=${isDisabled} style="min-height: 24px;"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c wrap g=sm w=1fg",value:{type:9,items:[{type:7,itemVar:"tag",indexVar:"i",iterable:{type:1,path:"triggerTags"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-tag data-selection-index=${tag.selectionIndex} pre=${tag.icon} data-testid=${tag.testId} v=mu style="${tag.tagStyle}"',value:{type:1,path:"tag.label"},parsedKey:{type:2,parts:["rtgl-tag data-selection-index=",{type:1,path:"tag.selectionIndex"}," pre=",{type:1,path:"tag.icon"}," data-testid=",{type:1,path:"tag.testId"},' v=mu style="',{type:1,path:"tag.tagStyle"},'"']}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#trigger d=h av=c g=sm cur=",{type:1,path:"triggerCursor"}," ",{type:1,path:"containerAttrString"},' data-testid="tag-select-trigger" role="button" tabindex=',{type:1,path:"triggerTabIndex"}," aria-disabled=",{type:1,path:"isDisabled"},' style="min-height: 24px;"']}}],fast:!1},{type:8,properties:[{key:"$if isOpen",value:{type:6,conditions:[{type:1,path:"isOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=bs content-w=${position.w} content-g=sm content-sv=true content-ph=md content-pv=md",value:{type:9,items:[{type:8,properties:[{key:"$if !hasSelectableOptions",value:{type:6,conditions:[{type:5,op:0,operand:{type:1,path:"hasSelectableOptions"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:0,value:"No tags available"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h wrap g=sm w=f",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"$if option.isSection",value:{type:6,conditions:[{type:1,path:"option.isSection"},{type:1,path:"option.isItem"},{type:1,path:"option.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f pt=xs",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-view#option${option.index} cur=${option.cursor} data-testid=${option.testId} role="button" tabindex=0 aria-pressed=${option.isSelected}',value:{type:9,items:[{type:8,properties:[{key:'rtgl-tag v=mu pre=${option.icon} style="${option.tagStyle}"',value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-tag v=mu pre=",{type:1,path:"option.icon"},' style="',{type:1,path:"option.tagStyle"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"option.index"}," cur=",{type:1,path:"option.cursor"}," data-testid=",{type:1,path:"option.testId"},' role="button" tabindex=0 aria-pressed=',{type:1,path:"option.isSelected"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=xs",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-button#addOptionButton v=gh s=sm pre=plus data-testid="tag-select-add-option"',value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h av=c g=sm w=f pt=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-button#submitButton v=pr s=sm data-testid="tag-select-submit" ?disabled=${submitDisabled}',value:{type:1,path:"submitLabel"},parsedKey:{type:2,parts:['rtgl-button#submitButton v=pr s=sm data-testid="tag-select-submit" ?disabled=',{type:1,path:"submitDisabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," place=bs content-w=",{type:1,path:"position.w"}," content-g=sm content-sv=true content-ph=md content-pv=md"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}},hm={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:{}}},fm={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:{}},ym={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:{}}},mm={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=mo;x.components.accordionItem.schema=Ry;x.components.accordionItem.store=xo;x.components.accordionItem.view=jy;x.components.breadcrumb={};x.components.breadcrumb.handlers=Ao;x.components.breadcrumb.schema=Dy;x.components.breadcrumb.store=Vo;x.components.breadcrumb.view=Py;x.components.card={};x.components.card.schema=By;x.components.card.store=Po;x.components.card.view=zy;x.components.dropdownMenu={};x.components.dropdownMenu.handlers=Mo;x.components.dropdownMenu.schema=Wy;x.components.dropdownMenu.store=Yo;x.components.dropdownMenu.view=My;x.components.form={};x.components.form.handlers=fl;x.components.form.methods=Al;x.components.form.schema=Fy;x.components.form.store=rl;x.components.form.view=Ky;x.components.globalUi={};x.components.globalUi.handlers=Yl;x.components.globalUi.schema=Uy;x.components.globalUi.store=wp;x.components.globalUi.view=Hy;x.components.navbar={};x.components.navbar.handlers=xp;x.components.navbar.schema=qy;x.components.navbar.store=Op;x.components.navbar.view=Yy;x.components.pageOutline={};x.components.pageOutline.handlers=Np;x.components.pageOutline.schema=Gy;x.components.pageOutline.store=Mp;x.components.pageOutline.view=Jy;x.components.popoverInput={};x.components.popoverInput.handlers=Jp;x.components.popoverInput.schema=Zy;x.components.popoverInput.store=id;x.components.popoverInput.view=Xy;x.components.segmentedControl={};x.components.segmentedControl.handlers=hd;x.components.segmentedControl.schema=Qy;x.components.segmentedControl.store=Ed;x.components.segmentedControl.view=em;x.components.select={};x.components.select.handlers=Pd;x.components.select.schema=tm;x.components.select.store=rc;x.components.select.view=sm;x.components.sidebar={};x.components.sidebar.handlers=pc;x.components.sidebar.schema=rm;x.components.sidebar.store=xc;x.components.sidebar.view=im;x.components.sliderInput={};x.components.sliderInput.handlers=$c;x.components.sliderInput.schema=nm;x.components.sliderInput.store=Tc;x.components.sliderInput.view=om;x.components.table={};x.components.table.handlers=Rc;x.components.table.schema=am;x.components.table.store=Uc;x.components.table.view=lm;x.components.tabs={};x.components.tabs.handlers=qc;x.components.tabs.schema=pm;x.components.tabs.store=Xc;x.components.tabs.view=dm;x.components.tagSelect={};x.components.tagSelect.handlers=du;x.components.tagSelect.methods=fu;x.components.tagSelect.schema=cm;x.components.tagSelect.store=ju;x.components.tagSelect.view=um;x.components.tooltip={};x.components.tooltip.handlers=Du;x.components.tooltip.schema=hm;x.components.tooltip.store=zu;x.components.tooltip.view=fm;x.components.waveform={};x.components.waveform.handlers=Fu;x.components.waveform.schema=ym;x.components.waveform.store=qu;x.components.waveform.view=mm;Object.keys(x).forEach(e=>{Object.keys(x[e]).forEach(t=>{let s=x[e][t],r=Oy({...s},Ny[e]),i=s.schema?.componentName;if(!i)throw new Error(`[Build] Missing schema.componentName for ${e}/${t}. Define it in .schema.yaml.`);customElements.define(i,r)})});customElements.define("rtgl-button",sr({}));customElements.define("rtgl-carousel",ar({}));customElements.define("rtgl-grid",lr({}));customElements.define("rtgl-view",dr({}));customElements.define("rtgl-text",ur({}));customElements.define("rtgl-image",yr({}));customElements.define("rtgl-tag",gr({}));customElements.define("rtgl-svg",vr({}));customElements.define("rtgl-input",ve({}));customElements.define("rtgl-input-date",wr({}));customElements.define("rtgl-input-time",_r({}));customElements.define("rtgl-input-datetime",xr({}));customElements.define("rtgl-input-number",Sr({}));customElements.define("rtgl-textarea",Ar({}));customElements.define("rtgl-color-picker",kr({}));customElements.define("rtgl-slider",Er({}));customElements.define("rtgl-checkbox",$r({}));customElements.define("rtgl-dialog",Cr({}));customElements.define("rtgl-popover",Tr({}));})();
|