@rettangoli/ui 0.1.2-rc8 → 0.1.3
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 +128 -56
- package/dist/rettangoli-iife-ui.min.js +187 -66
- package/package.json +5 -3
- package/src/cli/buildSvg.js +86 -0
- package/src/cli/index.js +1 -0
- package/src/common.js +30 -2
- package/src/components/breadcrumb/breadcrumb.handlers.js +9 -0
- package/src/components/breadcrumb/breadcrumb.store.js +29 -0
- package/src/components/breadcrumb/breadcrumb.view.yaml +64 -0
- package/src/components/dropdownMenu/dropdownMenu.handlers.js +6 -6
- package/src/components/dropdownMenu/dropdownMenu.store.js +6 -18
- package/src/components/dropdownMenu/dropdownMenu.view.yaml +15 -13
- package/src/components/form/form.handlers.js +170 -33
- package/src/components/form/form.store.js +175 -21
- package/src/components/form/form.view.yaml +182 -27
- package/src/components/globalUi/globalUi.handlers.js +51 -0
- package/src/components/globalUi/globalUi.store.js +57 -0
- package/src/components/globalUi/globalUi.view.yaml +50 -0
- package/src/components/navbar/navbar.handlers.js +1 -1
- package/src/components/navbar/navbar.store.js +2 -2
- package/src/components/pageOutline/pageOutline.handlers.js +57 -17
- package/src/components/pageOutline/pageOutline.store.js +48 -3
- package/src/components/pageOutline/pageOutline.view.yaml +7 -5
- package/src/components/popoverInput/popoverInput.handlers.js +99 -0
- package/src/components/popoverInput/popoverInput.store.js +48 -0
- package/src/components/popoverInput/popoverInput.view.yaml +55 -0
- package/src/components/select/select.handlers.js +120 -12
- package/src/components/select/select.store.js +86 -20
- package/src/components/select/select.view.yaml +40 -10
- package/src/components/sidebar/sidebar.handlers.js +6 -6
- package/src/components/sidebar/sidebar.store.js +6 -6
- package/src/components/sidebar/sidebar.view.yaml +1 -1
- package/src/components/sliderInput/sliderInput.handlers.js +23 -6
- package/src/components/sliderInput/sliderInput.store.js +3 -2
- package/src/components/sliderInput/sliderInput.view.yaml +3 -2
- package/src/components/table/table.handlers.js +10 -10
- package/src/components/table/table.store.js +4 -4
- package/src/components/tabs/tabs.handlers.js +10 -0
- package/src/components/tabs/tabs.store.js +29 -0
- package/src/components/tabs/tabs.view.yaml +64 -0
- package/src/components/tooltip/tooltip.handlers.js +0 -0
- package/src/components/tooltip/tooltip.store.js +12 -0
- package/src/components/tooltip/tooltip.view.yaml +27 -0
- package/src/components/waveform/waveform.handlers.js +92 -0
- package/src/components/waveform/waveform.store.js +17 -0
- package/src/components/waveform/waveform.view.yaml +38 -0
- package/src/deps/createGlobalUI.js +39 -0
- package/src/entry-iife-layout.js +3 -0
- package/src/entry-iife-ui.js +4 -0
- package/src/index.js +7 -1
- package/src/primitives/button.js +10 -0
- package/src/primitives/colorPicker.js +13 -4
- package/src/primitives/dialog.js +254 -0
- package/src/primitives/image.js +4 -3
- package/src/primitives/input.js +17 -4
- package/src/primitives/popover.js +280 -0
- package/src/primitives/slider.js +14 -4
- package/src/primitives/svg.js +2 -0
- package/src/primitives/textarea.js +25 -1
- package/src/primitives/view.js +132 -13
- package/src/setup.js +7 -2
- package/src/styles/cursorStyles.js +38 -2
- package/src/components/dialog/dialog.handlers.js +0 -5
- package/src/components/dialog/dialog.store.js +0 -25
- package/src/components/dialog/dialog.view.yaml +0 -48
- package/src/components/popover/popover.handlers.js +0 -5
- package/src/components/popover/popover.store.js +0 -12
- package/src/components/popover/popover.view.yaml +0 -57
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
var rettangoli=(()=>{var
|
|
2
|
-
:host([${
|
|
3
|
-
${
|
|
1
|
+
var rettangoli=(()=>{var ei=Object.defineProperty;var V=(e,t)=>{for(var r in t)ei(e,r,{get:t[r],enumerable:!0})};function T(e,...t){let r="";return e.forEach((s,i)=>{r+=s+(t[i]||"")}),r}var ti=["xs","sm","md","lg","xl"],fr={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom",pt:"padding-top",pr:"padding-right",pb:"padding-bottom",pl:"padding-left",p:"padding",ph:"padding-left padding-right",pv:"padding-top padding-bottom",g:"gap",gv:"row-gap",gh:"column-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",ta:"text-align",c:"color",cur:"cursor"},ne=Object.keys(fr),ae=e=>e.concat(ti.flatMap(t=>e.map(r=>`${t}-${r}`))),yr={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)"},te=(e,t={})=>{let r="";for(let[s,i]of Object.entries(yr)){s!=="default"&&(r+=`${i} {`);for(let[n,a]of Object.entries(e)){let o=t[n]?` ${t[n]} `:" ";for(let[l,p]of Object.entries(a)){let c=fr[n],u=p.startsWith("--")?`var(${p})`:p,d=s==="default"?n:`${s}-${n}`,f=s==="default"?`h-${n}`:`${s}-h-${n}`;if(c){let y=c.split(" ").map(v=>`${v}: ${u};`).join(" ");r+=`
|
|
2
|
+
:host([${d}="${l}"])${o}{
|
|
3
|
+
${y}
|
|
4
4
|
}
|
|
5
|
-
:host([${
|
|
6
|
-
${
|
|
5
|
+
:host([${f}="${l}"]:hover)${o}{
|
|
6
|
+
${y}
|
|
7
7
|
}
|
|
8
8
|
`}else r+=`
|
|
9
|
-
:host([${
|
|
10
|
-
${
|
|
9
|
+
:host([${d}="${l}"])${o}{
|
|
10
|
+
${p}
|
|
11
11
|
}
|
|
12
|
-
:host([${
|
|
13
|
-
${
|
|
12
|
+
:host([${f}="${l}"]:hover)${o}{
|
|
13
|
+
${p}
|
|
14
14
|
}
|
|
15
|
-
`}}s!=="default"&&(r+="}")}return r};function
|
|
16
|
-
`);let
|
|
15
|
+
`}}s!=="default"&&(r+="}")}return r};function ri(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var si=e=>/%$/.test(e),M=e=>{if(e!==void 0)return si(e)?e:ri(e)?`${e}px`:Object.keys(N).includes(e)?`var(${N[e]})`:e},N={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function oe(e,t=":host"){let r="",s=["default","xl","lg","md","sm"];for(let i of s){let n=yr[i];if(!e[i]||Object.keys(e[i]).length===0)continue;i!=="default"&&(r+=`${n} {
|
|
16
|
+
`);let a="";for(let[o,l]of Object.entries(e[i]))l!=null&&(a+=`${o}: ${l} !important;
|
|
17
17
|
`);r+=`${t} {
|
|
18
|
-
${
|
|
18
|
+
${a.trim()}
|
|
19
19
|
}
|
|
20
|
-
`,
|
|
21
|
-
`)}return r}var
|
|
20
|
+
`,i!=="default"&&(r+=`}
|
|
21
|
+
`)}return r}var pe=(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),s=Object.keys(t);if(r.length!==s.length)return!1;for(let i of r)if(!s.includes(i)||!pe(e[i],t[i]))return!1;return!0};var ve=T`
|
|
22
22
|
:host([flex="0"]) {
|
|
23
23
|
flex: 0;
|
|
24
24
|
}
|
|
@@ -58,7 +58,7 @@ var rettangoli=(()=>{var Vr=Object.defineProperty;var N=(e,t)=>{for(var r in t)V
|
|
|
58
58
|
:host([flex="12"]) {
|
|
59
59
|
flex: 12;
|
|
60
60
|
}
|
|
61
|
-
`;var
|
|
61
|
+
`;var ii={mt:N,mr:N,mb:N,ml:N,m:N,mh:N,mv:N,s:{sm:`
|
|
62
62
|
height: 28px;
|
|
63
63
|
padding-left: 12px;
|
|
64
64
|
padding-right: 12px;
|
|
@@ -104,7 +104,7 @@ var rettangoli=(()=>{var Vr=Object.defineProperty;var N=(e,t)=>{for(var r in t)V
|
|
|
104
104
|
`,lk:`
|
|
105
105
|
background-color: transparent;
|
|
106
106
|
color: var(--foreground);
|
|
107
|
-
`}},
|
|
107
|
+
`}},ni={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},mr=te(ii,ni);var be=T`
|
|
108
108
|
a, a:link, a:visited, a:hover, a:active {
|
|
109
109
|
color: inherit;
|
|
110
110
|
text-decoration: none;
|
|
@@ -114,7 +114,7 @@ var rettangoli=(()=>{var Vr=Object.defineProperty;var N=(e,t)=>{for(var r in t)V
|
|
|
114
114
|
margin: 0;
|
|
115
115
|
font: inherit;
|
|
116
116
|
}
|
|
117
|
-
`;var
|
|
117
|
+
`;var tt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
118
118
|
:host {
|
|
119
119
|
display: contents;
|
|
120
120
|
}
|
|
@@ -250,15 +250,15 @@ var rettangoli=(()=>{var Vr=Object.defineProperty;var N=(e,t)=>{for(var r in t)V
|
|
|
250
250
|
gap: 0;
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
${
|
|
253
|
+
${be}
|
|
254
254
|
|
|
255
255
|
a {
|
|
256
256
|
display: contents;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
${
|
|
260
|
-
${
|
|
261
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._containerElement=null,this._buttonElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._iconElement=null,this._buttonElement.appendChild(this._slotElement)}static get observedAttributes(){return["key","href","target","w","t","icon","disabled","v","s","sq","ip"]}connectedCallback(){this._updateButton()}attributeChangedCallback(t,r,s){this._updateButton()}_updateButton(){this.shadow.innerHTML="",this._updateIcon(),this.hasAttribute("sq")||this._updateWidth(),this.hasAttribute("disabled")?this._buttonElement.setAttribute("disabled",""):this._buttonElement.removeAttribute("disabled");let r=this.getAttribute("href");if(r){let s=document.createElement("a");s.setAttribute("href",r);let i=this.getAttribute("target");i&&s.setAttribute("target",i),s.appendChild(this._buttonElement),this.shadow.appendChild(s),this._containerElement=s}else this.shadow.appendChild(this._buttonElement),this._containerElement=this._buttonElement}_updateIcon(){this._iconElement&&(this._iconElement.remove(),this._iconElement=null);let t=this.getAttribute("icon");if(t){let r={pr:"pr-fg",se:"ac-fg",de:"pr-fg",ol:"ac-fg",gh:"ac-fg",lk:"ac-fg"},s={sm:14,md:18,lg:22},i=r[this.getAttribute("v")]||"pr-fg",n=18;if(this.hasAttribute("sq")){let o={sm:14,lg:22},l=this.getAttribute("s");n=o[l]||18}else n=s[this.getAttribute("t")]||18;this._iconElement=document.createElement("rtgl-svg"),this._iconElement.setAttribute("svg",t),this._iconElement.setAttribute("c",i),this._iconElement.setAttribute("wh",n.toString()),this.getAttribute("ip")==="s"?this._buttonElement.insertBefore(this._iconElement,this._slotElement):this._buttonElement.appendChild(this._iconElement)}}_updateWidth(){let t=
|
|
259
|
+
${mr}
|
|
260
|
+
${ve}
|
|
261
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._containerElement=null,this._buttonElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._iconElement=null,this._buttonElement.appendChild(this._slotElement)}static get observedAttributes(){return["key","href","target","w","t","icon","disabled","v","s","sq","ip"]}connectedCallback(){this._updateButton()}attributeChangedCallback(t,r,s){this._updateButton()}_updateButton(){this.shadow.innerHTML="",this._updateIcon(),this.hasAttribute("sq")||this._updateWidth(),this.hasAttribute("disabled")?this._buttonElement.setAttribute("disabled",""):this._buttonElement.removeAttribute("disabled");let r=this.getAttribute("href");if(r){let s=document.createElement("a");s.setAttribute("href",r);let i=this.getAttribute("target");i&&s.setAttribute("target",i),s.appendChild(this._buttonElement),this.shadow.appendChild(s),this._containerElement=s}else this.shadow.appendChild(this._buttonElement),this._containerElement=this._buttonElement}_updateIcon(){this._iconElement&&(this._iconElement.remove(),this._iconElement=null);let t=this.getAttribute("icon");if(t){let r={pr:"pr-fg",se:"ac-fg",de:"pr-fg",ol:"ac-fg",gh:"ac-fg",lk:"ac-fg"},s={sm:14,md:18,lg:22},i=r[this.getAttribute("v")]||"pr-fg",n=18;if(this.hasAttribute("sq")){let o={sm:14,lg:22},l=this.getAttribute("s");n=o[l]||18}else n=s[this.getAttribute("t")]||18;this._iconElement=document.createElement("rtgl-svg"),this._iconElement.setAttribute("svg",t),this._iconElement.setAttribute("c",i),this._iconElement.setAttribute("wh",n.toString()),this.getAttribute("ip")==="s"?this._buttonElement.insertBefore(this._iconElement,this._slotElement):this._buttonElement.appendChild(this._iconElement)}}_updateWidth(){let t=M(this.getAttribute("w"));t==="f"?this._buttonElement.style.width="var(--width-stretch)":t!=null?(this._buttonElement.style.width=t,this._buttonElement.style.minWidth=t,this._buttonElement.style.maxWidth=t):(this._buttonElement.style.width="",this._buttonElement.style.minWidth="",this._buttonElement.style.maxWidth="")}getBoundingClientRect(){return this._buttonElement?this._buttonElement.getBoundingClientRect():super.getBoundingClientRect()}},gr=({render:e,html:t})=>tt;var vr=T`
|
|
262
262
|
|
|
263
263
|
:host([d="h"]) {
|
|
264
264
|
flex-direction: row;
|
|
@@ -329,7 +329,7 @@ var rettangoli=(()=>{var Vr=Object.defineProperty;var N=(e,t)=>{for(var r in t)V
|
|
|
329
329
|
justify-content: center;
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
-
`;var
|
|
332
|
+
`;var ai={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out",p:"pointer",m:"move"}},J=te(ai);var br=T`
|
|
333
333
|
:host([sh]:not([sv])) {
|
|
334
334
|
overflow-x: scroll;
|
|
335
335
|
flex-wrap: nowrap;
|
|
@@ -347,7 +347,7 @@ var rettangoli=(()=>{var Vr=Object.defineProperty;var N=(e,t)=>{for(var r in t)V
|
|
|
347
347
|
flex-wrap: nowrap;
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
`;var
|
|
350
|
+
`;var Ce={xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},oi={bgc:{pr:`
|
|
351
351
|
background-color: var(--primary);
|
|
352
352
|
`,se:`
|
|
353
353
|
background-color: var(--secondary);
|
|
@@ -387,7 +387,7 @@ var rettangoli=(()=>{var Vr=Object.defineProperty;var N=(e,t)=>{for(var r in t)V
|
|
|
387
387
|
left: 0;
|
|
388
388
|
top: 0;
|
|
389
389
|
height: 100%;
|
|
390
|
-
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt
|
|
390
|
+
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:N,pr:N,pb:N,pl:N,p:N,ph:N,pv:N,g:N,gv:N,gh:N,bw:Ce,bwt:Ce,bwr:Ce,bwb:Ce,bwl:Ce,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},De=te(oi);var li={mt:N,mr:N,mb:N,ml:N,m:N,mh:N,mv:N},q=te(li);var rt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
391
391
|
slot {
|
|
392
392
|
display: contents;
|
|
393
393
|
}
|
|
@@ -406,13 +406,13 @@ var rettangoli=(()=>{var Vr=Object.defineProperty;var N=(e,t)=>{for(var r in t)V
|
|
|
406
406
|
flex-wrap: wrap;
|
|
407
407
|
}
|
|
408
408
|
|
|
409
|
-
${
|
|
410
|
-
${
|
|
411
|
-
${
|
|
412
|
-
${
|
|
413
|
-
${
|
|
414
|
-
${
|
|
415
|
-
${
|
|
409
|
+
${ve}
|
|
410
|
+
${br}
|
|
411
|
+
${vr}
|
|
412
|
+
${q}
|
|
413
|
+
${J}
|
|
414
|
+
${De}
|
|
415
|
+
${be}
|
|
416
416
|
|
|
417
417
|
:host([href]) {
|
|
418
418
|
cursor: pointer;
|
|
@@ -427,7 +427,7 @@ var rettangoli=(()=>{var Vr=Object.defineProperty;var N=(e,t)=>{for(var r in t)V
|
|
|
427
427
|
bottom: 0;
|
|
428
428
|
z-index: 1;
|
|
429
429
|
}
|
|
430
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),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","target","op",...
|
|
430
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),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","target","op",...ae([...ne,"wh","w","h","hide","show","sh","sv","z","d","ah","av","flex","fw","overflow"])]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");this._slotElement.parentNode!==this.shadow&&this.shadow.appendChild(this._slotElement),t?(this._linkElement||(this._linkElement=document.createElement("a"),this.shadow.appendChild(this._linkElement)),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}connectedCallback(){this.updateStyles()}updateStyles(){this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(r=>{let s=x=>`${r==="default"?"":`${r}-`}${x}`,i=this.getAttribute(s("wh")),n=M(i===null?this.getAttribute(s("w")):i),a=M(i===null?this.getAttribute(s("h")):i),o=this.getAttribute(s("op")),l=this.getAttribute(s("z"));l!==null&&(this._styles[r]["z-index"]=l),o!==null&&(this._styles[r].opacity=o),n==="f"?this._styles[r].width="var(--width-stretch)":n!==void 0&&(this._styles[r].width=n,this._styles[r]["min-width"]=n,this._styles[r]["max-width"]=n),a==="f"?this._styles[r].height="100%":a!==void 0&&(this._styles[r].height=a,this._styles[r]["min-height"]=a,this._styles[r]["max-height"]=a),this.hasAttribute(s("hide"))&&(this._styles[r].display="none"),this.hasAttribute(s("show"))&&(this._styles[r].display="flex");let p=this.getAttribute(s("d")),c=this.getAttribute(s("ah")),u=this.getAttribute(s("av"));p==="h"?this._styles[r]["flex-direction"]="row":p==="v"?this._styles[r]["flex-direction"]="column":r==="default"&&!p&&["sm","md","lg","xl"].some(_=>this.hasAttribute(`${_}-d`))&&(this._styles[r]["flex-direction"]="column");let d=p==="h",f=p==="v"||!p;d&&(c==="c"?this._styles[r]["justify-content"]="center":c==="e"?this._styles[r]["justify-content"]="flex-end":c==="s"&&(this._styles[r]["justify-content"]="flex-start"),u==="c"?(this._styles[r]["align-items"]="center",this._styles[r]["align-content"]="center"):u==="e"?(this._styles[r]["align-items"]="flex-end",this._styles[r]["align-content"]="flex-end"):u==="s"&&(this._styles[r]["align-items"]="flex-start")),f&&(c!==null||u!==null)&&(c==="c"?this._styles[r]["align-items"]="center":c==="e"?this._styles[r]["align-items"]="flex-end":c==="s"&&(this._styles[r]["align-items"]="flex-start"),u==="c"?this._styles[r]["justify-content"]="center":u==="e"?this._styles[r]["justify-content"]="flex-end":u==="s"&&(this._styles[r]["justify-content"]="flex-start"));let h=this.getAttribute(s("flex"));h!==null&&(this._styles[r].flex=h),this.getAttribute(s("fw"))==="w"&&(this._styles[r]["flex-wrap"]="wrap");let v=this.hasAttribute(s("sh")),g=this.hasAttribute(s("sv")),w=this.getAttribute(s("overflow"));v&&g?(this._styles[r].overflow="scroll",this._styles[r]["flex-wrap"]="nowrap"):v?(this._styles[r]["overflow-x"]="scroll",this._styles[r]["flex-wrap"]="nowrap"):g&&(this._styles[r]["overflow-y"]="scroll",this._styles[r]["flex-wrap"]="nowrap"),w==="hidden"&&(this._styles[r].overflow="hidden",this._styles[r]["flex-wrap"]="nowrap")});let t=oe(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,r,s){if(t==="href"||t==="target"){this._updateDOM();return}r!==s&&this.updateStyles()}},wr=({render:e,html:t})=>rt;var pi={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
|
|
431
431
|
font-size: var(--h1-font-size);
|
|
432
432
|
font-weight: var(--h1-font-weight);
|
|
433
433
|
line-height: var(--h1-line-height);
|
|
@@ -467,7 +467,7 @@ var rettangoli=(()=>{var Vr=Object.defineProperty;var N=(e,t)=>{for(var r in t)V
|
|
|
467
467
|
font-weight: var(--xs-font-weight);
|
|
468
468
|
line-height: var(--xs-line-height);
|
|
469
469
|
letter-spacing: var(--xs-letter-spacing);
|
|
470
|
-
`}},
|
|
470
|
+
`}},xr=te(pi);var ci={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},Be=te(ci);var st=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
471
471
|
:host {
|
|
472
472
|
display: block;
|
|
473
473
|
font-size: var(--md-font-size);
|
|
@@ -498,11 +498,11 @@ var rettangoli=(()=>{var Vr=Object.defineProperty;var N=(e,t)=>{for(var r in t)V
|
|
|
498
498
|
bottom: 0;
|
|
499
499
|
z-index: 1;
|
|
500
500
|
}
|
|
501
|
-
${
|
|
502
|
-
${
|
|
503
|
-
${
|
|
504
|
-
${
|
|
505
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","target"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,r,s){t==="href"||t==="target"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=
|
|
501
|
+
${xr}
|
|
502
|
+
${Be}
|
|
503
|
+
${q}
|
|
504
|
+
${J}
|
|
505
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","target"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,r,s){t==="href"||t==="target"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=M(this.getAttribute("w"));this.hasAttribute("ellipsis")?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace=""),t==="f"?this.style.width="var(--width-stretch)":t!==void 0?this.style.width=t:this.style.width=""}_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");this._slotElement.parentNode!==this.shadow&&this.shadow.appendChild(this._slotElement),t?(this._linkElement||(this._linkElement=document.createElement("a"),this.shadow.appendChild(this._linkElement)),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}},_r=({render:e,html:t})=>st;var it=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
506
506
|
:host {
|
|
507
507
|
border-style: solid;
|
|
508
508
|
box-sizing: border-box;
|
|
@@ -526,7 +526,7 @@ var rettangoli=(()=>{var Vr=Object.defineProperty;var N=(e,t)=>{for(var r in t)V
|
|
|
526
526
|
width: 100%;
|
|
527
527
|
}
|
|
528
528
|
|
|
529
|
-
${
|
|
529
|
+
${be}
|
|
530
530
|
|
|
531
531
|
a {
|
|
532
532
|
display: block;
|
|
@@ -538,10 +538,10 @@ var rettangoli=(()=>{var Vr=Object.defineProperty;var N=(e,t)=>{for(var r in t)V
|
|
|
538
538
|
cursor: pointer;
|
|
539
539
|
}
|
|
540
540
|
|
|
541
|
-
${
|
|
542
|
-
${
|
|
543
|
-
${
|
|
544
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),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
|
|
541
|
+
${De}
|
|
542
|
+
${q}
|
|
543
|
+
${J}
|
|
544
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),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 ae([...ne,"key","src","href","target","wh","w","h","hide","show","height","width","z"])}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");t?(this._linkElement||(this._linkElement=document.createElement("a")),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target"),this._linkElement.appendChild(this._imgElement),this._linkElement.parentNode!==this.shadow&&this.shadow.appendChild(this._linkElement)):this._linkElement?(this._imgElement.parentNode===this._linkElement&&this.shadow.appendChild(this._imgElement),this._linkElement.parentNode===this.shadow&&this.shadow.removeChild(this._linkElement),this._linkElement=null):this._imgElement.parentNode!==this.shadow&&this.shadow.appendChild(this._imgElement)}attributeChangedCallback(t,r,s){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=d=>`${n==="default"?"":`${n}-`}${d}`,o=this.getAttribute(a("wh")),l=M(o===null?this.getAttribute(a("w")):o),p=M(o===null?this.getAttribute(a("h")):o),c=this.getAttribute(a("o")),u=this.getAttribute(a("z"));u!==null&&(this._styles[n]["z-index"]=u),c!==null&&(this._styles[n].opacity=c),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),p==="f"?this._styles[n].height="100%":p!==void 0&&(this._styles[n].height=p,this._styles[n]["min-height"]=p,this._styles[n]["max-height"]=p),this.hasAttribute(a("hide"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("show"))&&(this._styles[n].display="block !important")});let i=oe(this._styles);i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i),this._updateImageAttributes()}_updateImageAttributes(){let t=this.getAttribute("src"),r=this.getAttribute("width"),s=this.getAttribute("height");t!==null&&this._imgElement.setAttribute("src",t),r!==null&&this._imgElement.setAttribute("width",r),s!==null&&this._imgElement.setAttribute("height",s)}connectedCallback(){this._updateImageAttributes()}},Er=({render:e,html:t})=>it;var kr=T`
|
|
545
545
|
:host([pt="xs"]) svg {
|
|
546
546
|
padding-top: var(--spacing-xs);
|
|
547
547
|
}
|
|
@@ -657,15 +657,16 @@ var rettangoli=(()=>{var Vr=Object.defineProperty;var N=(e,t)=>{for(var r in t)V
|
|
|
657
657
|
padding-top: var(--spacing-xl);
|
|
658
658
|
padding-bottom: var(--spacing-xl);
|
|
659
659
|
}
|
|
660
|
-
`;var
|
|
660
|
+
`;var nt=class e extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
661
661
|
:host {
|
|
662
662
|
color: var(--foreground);
|
|
663
663
|
}
|
|
664
|
-
${
|
|
665
|
-
${
|
|
666
|
-
${
|
|
667
|
-
${
|
|
668
|
-
|
|
664
|
+
${Be}
|
|
665
|
+
${kr}
|
|
666
|
+
${q}
|
|
667
|
+
${ve}
|
|
668
|
+
${J}
|
|
669
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return e._icons}static addIcon(t,r){e._icons[t]=r}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,r,s){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),r=M(t===null?this.getAttribute("w"):t),s=M(t===null?this.getAttribute("h"):t);r&&(this.style.width=r),s&&(this.style.height=s)}_render(){try{let t=this.getAttribute("svg"),r=e._icons[t]||(window.rtglIcons||{})[t];if(r){this.shadow.innerHTML=r;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},Ar=({render:e,html:t})=>nt;var at=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
669
670
|
:host {
|
|
670
671
|
display: contents;
|
|
671
672
|
}
|
|
@@ -698,9 +699,9 @@ var rettangoli=(()=>{var Vr=Object.defineProperty;var N=(e,t)=>{for(var r in t)V
|
|
|
698
699
|
input:disabled {
|
|
699
700
|
cursor: not-allowed;
|
|
700
701
|
}
|
|
701
|
-
${
|
|
702
|
-
${
|
|
703
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},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._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","s",...
|
|
702
|
+
${q}
|
|
703
|
+
${J}
|
|
704
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},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._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","s",...ae([...ne,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onChange=t=>{this.dispatchEvent(new CustomEvent("input-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(t==="key"&&r!==s){requestAnimationFrame(()=>{let n=this.getAttribute("value");this._inputElement.value=n??""});return}if(["type","placeholder","disabled","value","step","s"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=d=>`${n==="default"?"":`${n}-`}${d}`,o=this.getAttribute(a("wh")),l=M(o===null?this.getAttribute(a("w")):o),p=M(o===null?this.getAttribute(a("h")):o),c=this.getAttribute(a("op")),u=this.getAttribute(a("z"));u!==null&&(this._styles[n]["z-index"]=u),c!==null&&(this._styles[n].opacity=c),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),p==="f"?this._styles[n].height="100%":p!==void 0&&(this._styles[n].height=p,this._styles[n]["min-height"]=p,this._styles[n]["max-height"]=p),this.hasAttribute(a("hide"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("show"))&&(this._styles[n].display="block !important")});let i=oe(this._styles,"input");i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("type")||"text",r=this.getAttribute("placeholder"),s=this.getAttribute("value"),i=this.getAttribute("step"),n=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),r!==null?this._inputElement.setAttribute("placeholder",r):this._inputElement.removeAttribute("placeholder"),s!==null&&(this._inputElement.value=s),i!==null?this._inputElement.setAttribute("step",i):this._inputElement.removeAttribute("step"),n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Sr=({render:e,html:t})=>at;var ot=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
704
705
|
:host {
|
|
705
706
|
display: contents;
|
|
706
707
|
}
|
|
@@ -723,9 +724,9 @@ var rettangoli=(()=>{var Vr=Object.defineProperty;var N=(e,t)=>{for(var r in t)V
|
|
|
723
724
|
textarea:focus {
|
|
724
725
|
border-color: var(--foreground);
|
|
725
726
|
}
|
|
726
|
-
${
|
|
727
|
-
${
|
|
728
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._textareaElement=document.createElement("textarea"),this._textareaElement.setAttribute("type","text"),this.shadow.appendChild(this._textareaElement)}static get observedAttributes(){return["key","w","ellipsis","cols","rows","placeholder"]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}attributeChangedCallback(t,r,s){this._updateTextareaAttributes()}_updateTextareaAttributes(){let t=this.getAttribute("cols"),r=this.getAttribute("rows"),s=this.getAttribute("placeholder");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),r!==null?this._textareaElement.setAttribute("rows",r):this._textareaElement.removeAttribute("rows"),s!==null?this._textareaElement.setAttribute("placeholder",s):this._textareaElement.removeAttribute("placeholder")}}
|
|
727
|
+
${q}
|
|
728
|
+
${J}
|
|
729
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._textareaElement=document.createElement("textarea"),this._textareaElement.setAttribute("type","text"),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onChange)}_onChange=t=>{this.dispatchEvent(new CustomEvent("textarea-change",{detail:{value:this._textareaElement.value}}))};static get observedAttributes(){return["key","w","ellipsis","cols","rows","placeholder","value"]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}attributeChangedCallback(t,r,s){if(t==="key"&&r!==s){requestAnimationFrame(()=>{let i=this.getAttribute("value");this._textareaElement.value=i??""});return}this._updateTextareaAttributes()}_updateTextareaAttributes(){let t=this.getAttribute("cols"),r=this.getAttribute("rows"),s=this.getAttribute("placeholder"),i=this.getAttribute("value");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),r!==null?this._textareaElement.setAttribute("rows",r):this._textareaElement.removeAttribute("rows"),s!==null?this._textareaElement.setAttribute("placeholder",s):this._textareaElement.removeAttribute("placeholder"),i!==null&&(this._textareaElement.value=i)}},$r=({render:e,html:t})=>ot;var lt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
729
730
|
:host {
|
|
730
731
|
display: contents;
|
|
731
732
|
}
|
|
@@ -746,9 +747,9 @@ var rettangoli=(()=>{var Vr=Object.defineProperty;var N=(e,t)=>{for(var r in t)V
|
|
|
746
747
|
cursor: not-allowed;
|
|
747
748
|
opacity: 0.5;
|
|
748
749
|
}
|
|
749
|
-
${
|
|
750
|
-
${
|
|
751
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},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",...
|
|
750
|
+
${q}
|
|
751
|
+
${J}
|
|
752
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},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",...ae([...ne,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=t=>{this.dispatchEvent(new CustomEvent("colorpicker-change",{detail:{value:this._inputElement.value}}))};_onInput=t=>{this.dispatchEvent(new CustomEvent("colorpicker-input",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(t==="key"&&r!==s){requestAnimationFrame(()=>{let n=this.getAttribute("value");this._inputElement.value=n??"#000000"});return}if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=d=>`${n==="default"?"":`${n}-`}${d}`,o=this.getAttribute(a("wh")),l=M(o===null?this.getAttribute(a("w")):o),p=M(o===null?this.getAttribute(a("h")):o),c=this.getAttribute(a("op")),u=this.getAttribute(a("z"));u!==null&&(this._styles[n]["z-index"]=u),c!==null&&(this._styles[n].opacity=c),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),p==="f"?this._styles[n].height="100%":p!==void 0&&(this._styles[n].height=p,this._styles[n]["min-height"]=p,this._styles[n]["max-height"]=p),this.hasAttribute(a("hide"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("show"))&&(this._styles[n].display="block !important")});let i=oe(this._styles,'input[type="color"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.hasAttribute("disabled");t!==null&&(this._inputElement.value=t),r?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Cr=({render:e,html:t})=>lt;var pt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
752
753
|
:host {
|
|
753
754
|
display: contents;
|
|
754
755
|
}
|
|
@@ -800,12 +801,132 @@ var rettangoli=(()=>{var Vr=Object.defineProperty;var N=(e,t)=>{for(var r in t)V
|
|
|
800
801
|
input[type="range"]:disabled::-moz-range-thumb {
|
|
801
802
|
cursor: not-allowed;
|
|
802
803
|
}
|
|
803
|
-
${
|
|
804
|
-
${
|
|
805
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),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",...J([...q,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=t=>{this.dispatchEvent(new CustomEvent("slider-input",{detail:{value:this._inputElement.value}}))};_onChange=t=>{this.dispatchEvent(new CustomEvent("slider-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(["value","min","max","step","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=E=>`${n==="default"?"":`${n}-`}${E}`,o=this.getAttribute(a("wh")),l=L(o===null?this.getAttribute(a("w")):o),h=L(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("op")),y=this.getAttribute(a("z"));y!==null&&(this._styles[n]["z-index"]=y),u!==null&&(this._styles[n].opacity=u),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),h==="f"?this._styles[n].height="100%":h!==void 0&&(this._styles[n].height=h,this._styles[n]["min-height"]=h,this._styles[n]["max-height"]=h),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=Y(this._styles,'input[type="range"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.getAttribute("min"),s=this.getAttribute("max"),i=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null&&(this._inputElement.value=t),r!==null?this._inputElement.min=r:this._inputElement.min="0",s!==null?this._inputElement.max=s: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()}},Mt=({render:e,html:t})=>Me;var Re={};N(Re,{handleClickDialogueOverlay:()=>qr});var qr=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("close-dialogue"))};var ze={};N(ze,{INITIAL_STATE:()=>Jr,selectState:()=>Gr,setState:()=>Xr,toViewData:()=>Yr});var Jr=Object.freeze({}),Yr=({props:e,attrs:t})=>({isOpen:e.isOpen,w:t.w||600,position:{x:0,y:0}}),Gr=({state:e})=>e,Xr=e=>{};var Rt={elementName:"rtgl-dialog",viewDataSchema:{type:"object"},attrsSchema:{type:"object",properties:{w:{type:"string"}}},propsSchema:{type:"object",properties:{isOpen:{type:"boolean"}}},refs:{"dialog-overlay":{eventListeners:{click:{handler:"handleClickDialogueOverlay"}}}},events:{"close-dialogue":{type:"object",properties:{}}},styles:null,template:{type:9,items:[{type:8,properties:[{key:"$if isOpen",value:{type:6,conditions:[{type:1,path:"isOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view z=9999 pos=fix cor=full ah=c sv=true style="scrollbar-width: none;"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view#dialog-overlay pos=fix cor=full ah=c av=c bgc=bg op=0.5",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view h=10vh",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view#dialog-container z=100 bw=xs p=lg bgc=bg w=${w} br=sm",value:{type:9,items:[{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#dialog-container z=100 bw=xs p=lg bgc=bg w=",{type:1,path:"w"}," br=sm"]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var We={};N(We,{handleClickMenuItem:()=>Zr,handleClickPopoverOverlay:()=>Qr});var Qr=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("click-overlay"))},Zr=(e,t)=>{let{dispatchEvent:r}=t,s=parseInt(e.currentTarget.id.replace("option-","")),i=t.props.items[s];r(new CustomEvent("click-item",{detail:{index:s,item:i}}))};var Fe={};N(Fe,{INITIAL_STATE:()=>es,selectState:()=>rs,setState:()=>ss,toViewData:()=>ts});var es=Object.freeze({}),ts=({state:e,props:t})=>({items:t.items||[],isOpen:t.isOpen||!1,position:t.position||{x:0,y:0}}),rs=({state:e})=>e,ss=e=>{};var zt={elementName:"rtgl-dropdown-menu",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["label","item","separator"]}}}},isOpen:{type:"boolean"},position:{type:"object",properties:{x:{type:"number"},y:{type:"number"}}}}},refs:{popover:{eventListeners:{"click-overlay":{handler:"handleClickPopoverOverlay"}}},"option-*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover .isOpen=isOpen .position=position",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=background br=md",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.type == 'label'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"label"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"item"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"separator"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f ph=lg pv=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option-${i} w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=mu",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option-",{type:1,path:"i"}," w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=mu"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 ph=lg mv=md bgc=bo",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var He={};N(He,{handleActionClick:()=>ns,handleColorPickerChange:()=>ls,handleInputChange:()=>as,handleOnMount:()=>is,handleSelectChange:()=>os,handleSliderChange:()=>ps,handleSliderInputChange:()=>cs});var is=e=>{let{store:t,props:r}=e;t.setFormValues(r.defaultValues)},he=(e,t,r,s)=>{s(new CustomEvent("form-change",{detail:{name:e,fieldValue:t,formValues:r}}))},ns=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("action-","");s(new CustomEvent("action-click",{detail:{actionId:i,formValues:r.selectFormValues()}}))},as=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("input-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),he(i,e.detail.value,r.selectFormValues(),s))},os=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("select-","");i&&e.detail.selectedValue!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.selectedValue}),he(i,e.detail.selectedValue,r.selectFormValues(),s))},ls=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("colorpicker-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),he(i,e.detail.value,r.selectFormValues(),s))},ps=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("slider-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),he(i,e.detail.value,r.selectFormValues(),s))},cs=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("slider-input-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),he(i,e.detail.value,r.selectFormValues(),s))};var Be={};N(Be,{INITIAL_STATE:()=>hs,selectFormValues:()=>ys,selectState:()=>ms,setFormFieldValue:()=>bs,setFormValues:()=>gs,toViewData:()=>fs});var hs=Object.freeze({formValues:{}}),ds=["id","class","style","slot"],us=e=>Object.entries(e).filter(([t])=>!ds.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),fs=({state:e,props:t,attrs:r})=>{let s=us(r),i=structuredClone(t.form.fields||[]),n=t.defaultValues||{};return i.forEach(a=>{a.defaultValue=n[a.name]}),{containerAttrString:s,title:t.form?.title||"",description:t?.form?.description||"",fields:i,actions:t?.form?.actions||{buttons:[]},formValues:e.formValues}},ms=({state:e})=>e,ys=({state:e})=>e.formValues,gs=(e,t)=>{e.formValues=t||{}},bs=(e,{name:t,value:r})=>{e.formValues[t]=r};var Wt={elementName:"rtgl-form",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{defaultValues:{type:"object"},form:{type:"object",properties:{title:{type:"string"},description:{type:"string"},fields:{type:"array",items:{anyOf:[{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"inputText"},placeholder:{type:"string"}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"select"},placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{id:{type:"string"},label:{type:"string"},value:{type:"any"}},required:["id","label","value"]}}},required:["name","label","inputType","options"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"colorPicker"},value:{type:"string"}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"slider"},min:{type:"number"},max:{type:"number"},step:{type:"number"},value:{type:"number"}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"slider-input"},min:{type:"number"},max:{type:"number"},step:{type:"number"},value:{type:"number"}},required:["name","label","inputType"],additionalProperties:!1}]}},actions:{type:"object",properties:{buttons:{type:"array",items:{type:"object",properties:{id:{type:"string"},content:{type:"string"}},required:["id","content"]}}}}}}}},refs:{"action-*":{eventListeners:{click:{handler:"handleActionClick"}}},"input-*":{eventListeners:{"input-change":{handler:"handleInputChange"}}},"select-*":{eventListeners:{"select-change":{handler:"handleSelectChange"}}},"colorpicker-*":{eventListeners:{"colorpicker-change":{handler:"handleColorPickerChange"}}},"slider-*":{eventListeners:{"slider-change":{handler:"handleSliderChange"}}},"slider-input-*":{eventListeners:{"slider-input-value-change":{handler:"handleSliderInputChange"}}}},events:{"form-change":{}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=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:"rtgl-text s=lg",value:{type:1,path:"title"}}],fast:!0},{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"description"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-view g=lg w=f",value:{type:9,items:[{type:7,itemVar:"field",indexVar:"i",iterable:{type:1,path:"fields"},body:{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:"rtgl-text",value:{type:1,path:"field.label"}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:'$if field.inputType == "inputText"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"inputText"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#input-${field.name} w=f placeholder=${field.placeholder} value=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input-",{type:1,path:"field.name"}," w=f placeholder=",{type:1,path:"field.placeholder"}," value=",{type:1,path:"field.defaultValue"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-select#select-${field.name} w=f .options=fields[${i}].options .placeholder=fields[${i}].placeholder .selectedValue=fields[${i}].defaultValue",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#select-",{type:1,path:"field.name"}," w=f .options=fields[",{type:1,path:"i"},"].options .placeholder=fields[",{type:1,path:"i"},"].placeholder .selectedValue=fields[",{type:1,path:"i"},"].defaultValue"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "colorPicker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"colorPicker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#colorpicker-${field.name} value=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#colorpicker-",{type:1,path:"field.name"}," value=",{type:1,path:"field.defaultValue"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slider"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider#slider-${field.name} w=f min=${field.min} max=${field.max} step=${field.step} value=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider-",{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"}," value=",{type:1,path:"field.defaultValue"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slider-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slider-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider-input#slider-input-${field.name} w=f min=${field.min} max=${field.max} step=${field.step} defaultValue=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider-input#slider-input-",{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"}," defaultValue=",{type:1,path:"field.defaultValue"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=e g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions.buttons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action-${button.id}",value:{type:1,path:"button.content"},parsedKey:{type:2,parts:["rtgl-button#action-",{type:1,path:"button.id"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=f p=md g=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Ke={};N(Ke,{handleClickStart:()=>vs});var vs=(e,t)=>{let{dispatchEvent:r,store:s}=t;console.log("handle click start",s.selectPath()),r(new CustomEvent("clickStart",{detail:{path:s.selectPath()}}))};var Ue={};N(Ue,{INITIAL_STATE:()=>ws,selectPath:()=>ks,setState:()=>Es,toViewData:()=>Ss});var ws=Object.freeze({}),xs=["id","class","style","slot"],_s=e=>Object.entries(e).filter(([t])=>!xs.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Ss=({state:e,props:t,attrs:r})=>{console.log("attrs",{attrs:r,entries:Object.entries(r)});let s=r.start?JSON.parse(decodeURIComponent(r.start)):t.start;return{containerAttrString:_s(r),start:s||{label:"",image:{src:"",width:32,height:32,alt:""}}}},ks=({props:e})=>e.start.path,Es=e=>{};var Ft={elementName:"rtgl-navbar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}},hasImage:{type:"boolean"},hasHref:{type:"boolean"}}}}},propsSchema:{type:"object",properties:{start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}}}}}},refs:{start:{eventListeners:{click:{handler:"handleClickStart"}}}},events:{clickStart:{type:"object",properties:{path:{type:"string"}}}},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=lg 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=lg g=md cur=p",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=lg 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 flex=1",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}};var qe={};N(qe,{handleOnMount:()=>$s});var Ht=(e,t)=>{let{store:r,render:s}=t,i,n=-1/0;e.forEach(a=>{let o=a.getBoundingClientRect();o.top<=20&&o.top>n&&(n=o.top,i=a.id)}),i&&i!==r.selectCurrentId()&&(r.setCurrentId(i),s())},As=(e,t)=>{let{store:r,render:s}=t,i=e.querySelectorAll("rtgl-text[id]"),n=Array.from(i),a=n.map(l=>({id:l.id,href:`#${l.id}`,title:l.textContent}));r.setItems(a),Ht(n,t),s();let o=Ht.bind(void 0,n,t);return e.addEventListener("scroll",o,{passive:!0}),()=>{e.removeEventListener("scroll",o)}},$s=e=>{let{attrs:t}=e;requestAnimationFrame(()=>{let r=document.getElementById(t["target-id"]),s=As(r,e);return()=>{s()}})};var Je={};N(Je,{INITIAL_STATE:()=>Cs,selectCurrentId:()=>Ts,selectState:()=>Is,setContentContainer:()=>js,setCurrentId:()=>Ns,setItems:()=>Ls,toViewData:()=>Os});var Cs=Object.freeze({items:[],currentId:null,contentContainer:null}),Os=({state:e})=>({items:e.items.map(t=>({...t,c:t.id===e.currentId?"fg":"mu-fg"})),currentId:e.currentId}),Is=({state:e})=>e,Ts=({state:e})=>e.currentId,Ls=(e,t)=>{e.items=t},Ns=(e,t)=>{e.currentId=t},js=(e,t)=>{e.contentContainer=t};var Bt={elementName:"rtgl-page-outline",viewDataSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{slug:{type:"string"},title:{type:"string"}}}},selectedSlug:{type:"string",nullable:!0}}},propsSchema:{type:"object",properties:{}},refs:{},events:{onItemClick:{type:"object"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=272",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f g=sm 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 pv=xs av=c href=${item.href}",value:{type:9,items:[{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 pv=xs av=c href=",{type:1,path:"item.href"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var Ye={};N(Ye,{handleClickOverlay:()=>Ps});var Ps=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("click-overlay"))};var Ge={};N(Ge,{INITIAL_STATE:()=>Vs,selectState:()=>Ms,toViewData:()=>Ds});var Vs=Object.freeze({}),Ds=({state:e,props:t})=>({isOpen:t.isOpen,position:t.position}),Ms=({state:e})=>e;var Kt={elementName:"rtgl-popover",viewDataSchema:{type:"object",properties:{isOpen:{type:"boolean"},position:{type:"object",properties:{x:{type:"number"},y:{type:"number"}}},placement:{type:"string"}}},propsSchema:{type:"object",properties:{placement:{type:"string",default:"bottom"},isOpen:{type:"boolean"},position:{type:"object",properties:{x:{type:"number"},y:{type:"number"}}}}},refs:{popoverOverlay:{eventListeners:{click:{handler:"handleClickOverlay"}}}},styles:{"@keyframes popover-in":{from:{opacity:0,transform:"scale(0.95)"},to:{opacity:1,transform:"scale(1)"}},"#popoverContainer":{animation:"popover-in 150ms cubic-bezier(0.16, 1, 0.3, 1)","transform-origin":"top"}},template:{type:9,items:[{type:8,properties:[{key:"$if isOpen",value:{type:6,conditions:[{type:1,path:"isOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#popoverOverlay pos=fix cor=full",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-view#popoverContainer pos=fix style="left: ${position.x}px; top: ${position.y}px;" id=floatingElement bw=xs p=md bgc=mu',value:{type:9,items:[{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view#popoverContainer pos=fix style="left: ',{type:1,path:"position.x"},"px; top: ",{type:1,path:"position.y"},'px;" id=floatingElement bw=xs p=md bgc=mu']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var Xe={};N(Xe,{handleButtonClick:()=>zs,handleClickOptionsPopoverOverlay:()=>Ws,handleOnMount:()=>Rs,handleOptionClick:()=>Fs});var Rs=e=>{let{store:t,props:r,render:s}=e;if(r.selectedValue!==null&&r.selectedValue!==void 0&&r.options){let i=r.options.find(n=>n.value===r.selectedValue);i&&(t.updateSelectOption(i),s())}},zs=(e,t)=>{let{store:r,render:s,getRefIds:i}=t;r.openOptionsPopover({position:{y:e.clientY,x:e.clientX}}),s()},Ws=(e,t)=>{let{store:r,render:s}=t;r.closeOptionsPopover(),s()},Fs=(e,t)=>{let{render:r,dispatchEvent:s,props:i,store:n}=t,a=e.currentTarget.id.replace("option-",""),o=i.options[a];n.updateSelectOption(o),i.onChange&&typeof i.onChange=="function"&&i.onChange(o.value),s(new CustomEvent("option-selected",{detail:{value:o.value,label:o.label},bubbles:!0})),s(new CustomEvent("select-change",{detail:{selectedValue:o.value},bubbles:!0})),r()};var Qe={};N(Qe,{INITIAL_STATE:()=>Hs,closeOptionsPopover:()=>qs,openOptionsPopover:()=>Us,selectState:()=>Ks,toViewData:()=>Bs,updateSelectOption:()=>Js});var Hs=Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,selectedLabel:null}),Bs=({state:e,props:t})=>{let r=t.placeholder||"Select an option",s=e.selectedValue!==null?e.selectedValue:t.selectedValue;if(s!=null&&t.options){let n=t.options.find(a=>a.value===s);n&&(r=n.label)}else e.selectedLabel&&(r=e.selectedLabel);let i=(t.options||[]).map(n=>({...n,isSelected:n.value===s,bgc:n.value===s?"mu":""}));return{isOpen:e.isOpen,position:e.position,options:i,selectedValue:s,selectedLabel:r,placeholder:t.placeholder||"Select an option"}},Ks=({state:e})=>e,Us=(e,t)=>{let{position:r}=t;e.position=r,e.isOpen=!0},qs=e=>{e.isOpen=!1},Js=(e,t)=>{e.selectedValue=t.value,e.selectedLabel=t.label,e.isOpen=!1};var Ut={elementName:"rtgl-select",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{options:{type:"array",items:{type:"object",properties:{id:{type:"string"},label:{type:"string"},value:{type:"any"}}}},selectedValue:{type:"any"},placeholder:{type:"string"},onChange:{type:"function"}}},refs:{"select-button":{eventListeners:{click:{handler:"handleButtonClick"}}},popover:{eventListeners:{"click-overlay":{handler:"handleClickOptionsPopoverOverlay"}}},"option-*":{eventListeners:{click:{handler:"handleOptionClick"}}}},events:{},template:{type:9,items:[{type:8,properties:[{key:"rtgl-button#select-button v=ol",value:{type:9,items:[{type:1,path:"selectedLabel"}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover .isOpen=isOpen .position=position",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=background br=md sv=true",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#option-${i} w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=${option.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option-",{type:1,path:"i"}," w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=",{type:1,path:"option.bgc"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var Ze={};N(Ze,{handleHeaderClick:()=>Ys,handleItemClick:()=>Gs});var Ys=(e,t)=>{let{store:r,dispatchEvent:s}=t,i,n=r.selectHeader();e.currentTarget.id==="header-label"?i=n.labelPath:e.currentTarget.id==="header-image"?i=n.image.path:e.currentTarget.id==="header"&&(i=n.path),s(new CustomEvent("headerClick",{detail:{path:i},bubbles:!0,composed:!0}))},Gs=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("item-",""),n=r.selectItem(i);s(new CustomEvent("itemClick",{detail:{item:n},bubbles:!0,composed:!0}))};var tt={};N(tt,{INITIAL_STATE:()=>Xs,selectActiveItem:()=>ri,selectHeader:()=>ti,selectItem:()=>si,setState:()=>ii,toViewData:()=>ei});var Xs=Object.freeze({}),Qs=["id","class","style","slot"],Zs=e=>Object.entries(e).filter(([t])=>!Qs.includes(t)).map(([t,r])=>`${t}=${r}`).join(" ");function et(e,t=null){let r=[];for(let s of e){let i=s.id||s.href||s.path,n=t===i;if(r.push({id:i,title:s.title,href:s.href,type:s.type||"item",icon:s.icon,hrefAttr:s.href?`href=${s.href}`:"",isSelected:n,itemBgc:n?"ac":"bg",itemHoverBgc:n?"ac":"mu"}),s.items&&Array.isArray(s.items))for(let a of s.items){let o=a.id||a.href||a.path,l=t===o;r.push({id:o,title:a.title,href:a.href,type:a.type||"item",icon:a.icon,hrefAttr:a.href?`href=${a.href}`:"",isSelected:l,itemBgc:l?"ac":"bg",itemHoverBgc:l?"ac":"mu"})}}return r}var ei=({state:e,props:t,attrs:r})=>{let s=r.header?JSON.parse(decodeURIComponent(r.header)):t.header,i=r.items?JSON.parse(decodeURIComponent(r.items)):t.items,n=r.selectedItemId||t.selectedItemId,a=Zs(r),o=r.mode||"full",l=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},h=i?et(i,n):[],u=o==="full"?272:64,y=o==="full"?"fs":"c",E=o==="full"?"fs":"c",T=o==="full"?"lg":"sm",p=o==="full"?"md":"sm",c=o==="shrunk-lg"?48:40,d=o==="shrunk-lg"?28:20,f=o==="shrunk-lg"?"md":"sm",g=o==="full",_=o==="full",m=o==="full"?"fs":"c",x=o==="full"?"":`ah=${E}`,b=o==="full"?"f":c;return{containerAttrString:a,mode:o,header:l,items:h,sidebarWidth:u,headerAlign:y,itemAlign:E,headerPadding:T,itemPadding:p,itemHeight:c,iconSize:d,firstLetterSize:f,showLabels:g,showGroupLabels:_,itemContentAlign:m,itemAlignAttr:x,itemWidth:b,headerWidth:b,selectedItemId:n,ah:o==="shrunk-lg"||o==="shrunk-md"?"c":""}},ti=({state:e,props:t,attrs:r})=>r.header?JSON.parse(decodeURIComponent(r.header)):t.header,ri=({state:e,props:t})=>(t.items?et(t.items):[]).find(s=>s.active),si=({state:e,props:t,attrs:r},s)=>{let i=r.items?JSON.parse(decodeURIComponent(r.items)):t.items;return(i?et(i):[]).find(a=>a.id===s)},ii=e=>{};var qt={elementName:"rtgl-sidebar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},mode:{type:"string",enum:["full","shrunk","shrunk-lg"],default:"full"},sidebarWidth:{type:"number"},headerAlign:{type:"string"},itemAlign:{type:"string"},headerPadding:{type:"string"},itemPadding:{type:"string"},itemHeight:{type:"number"},iconSize:{type:"number"},firstLetterSize:{type:"string"},showLabels:{type:"boolean"},showGroupLabels:{type:"boolean"},itemContentAlign:{type:"string"},itemAlignAttr:{type:"string"},itemWidth:{type:"string"},headerWidth:{type:"string"},selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},active:{type:"boolean"},icon:{type:"string"}}}}}},propsSchema:{type:"object",properties:{selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},items:{type:"array"}}}}}},refs:{"header-image":{eventListeners:{click:{handler:"handleHeaderClick"}}},"header-label":{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item-*":{eventListeners:{click:{handler:"handleItemClick"}}}},events:{headerClick:{type:"object",properties:{path:{type:"string"}}}},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#header-image cur=p":[{'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#header-label cur=p":[{"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} bwr=xs ah=${ah} ${containerAttrString}",value:{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#header-image cur=p",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#header-label cur=p",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=p",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#header-image cur=p",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#header-label cur=p",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=p"]}}],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},{type:8,properties:[{key:"rtgl-view w=f ph=${headerPadding} pb=lg g=xs ah=${ah}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'$if item.type == "groupLabel"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"groupLabel"}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showGroupLabels",value:{type:6,conditions:[{type:1,path:"showGroupLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=32 av=c ph=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=1 bgc=mu-bg",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-${item.id} ${item.hrefAttr} h=${itemHeight} av=c ${itemAlignAttr} ph=${itemPadding} w=${itemWidth} h-bgc=${item.itemHoverBgc} br=lg bgc=${item.itemBgc} cur=p title="${item.title}"',value:{type:9,items:[{type:8,properties:[{key:"$if item.icon",value:{type:6,conditions:[{type:1,path:"item.icon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=${itemContentAlign} g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h ah=",{type:1,path:"itemContentAlign"}," g=sm"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=${iconSize} svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=",{type:1,path:"iconSize"}," svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=${iconSize} br=f bgc=mu av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=${firstLetterSize} c=fg",value:{type:1,path:"item.title.charAt(0).toUpperCase()"},parsedKey:{type:2,parts:["rtgl-text s=",{type:1,path:"firstLetterSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view wh=",{type:1,path:"iconSize"}," br=f bgc=mu av=c ah=c"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#item-",{type:1,path:"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=p title="',{type:1,path:"item.title"},'"']}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f ph=",{type:1,path:"headerPadding"}," pb=lg g=xs ah=",{type:1,path:"ah"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{type:1,path:"sidebarWidth"}," bwr=xs ah=",{type:1,path:"ah"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var rt={};N(rt,{handleOnMount:()=>ni,handleValueChange:()=>ai});var ni=e=>{let{store:t,attrs:r}=e;t.setValue(r.defaultValue||0)},ai=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=t,n=Number(e.detail.value);r.setValue(n),s(),i(new CustomEvent("slider-input-value-change",{detail:{value:n},bubbles:!0}))};var st={};N(st,{INITIAL_STATE:()=>oi,setValue:()=>pi,toViewData:()=>li});var oi=Object.freeze({value:0}),li=({state:e,attrs:t})=>({value:e.value,w:t.w||"",min:t.min||0,max:t.max||100,step:t.step||1}),pi=(e,t)=>{e.value=t};var Jt={elementName:"rtgl-slider-input",viewDataSchema:{type:"object"},attrsSchema:{type:"object",properties:{defaultValue:{type:"string",default:"0"},w:{type:"string",default:""},min:{type:"string",default:"0"},max:{type:"string",default:"100"},step:{type:"string",default:"1"}}},refs:{input:{eventListeners:{"input-change":{handler:"handleValueChange"}}},slider:{eventListeners:{"slider-change":{handler:"handleValueChange"}}}},events:{"form-change":{}},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 w=80% type=range min=${min} max=${max} step=${step} value=${value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider w=80% type=range min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-input#input w=20% type=number min=${min} max=${max} step=${step} value=${value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=20% type=number min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}]}}],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}};var it={};N(it,{handleHeaderClick:()=>di,handleOnMount:()=>ci,handleRowClick:()=>hi});var ci=e=>{},hi=(e,t)=>{let{dispatchEvent:r,props:s}=t,i=parseInt(e.currentTarget.id.replace("row-","")),n=s.data?.rows?.[i];n&&r(new CustomEvent("row-click",{detail:{rowIndex:i,rowData:n}}))},di=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=t,n=e.currentTarget.id.replace("header-",""),a=r.selectSortInfo(),o="asc";a.column===n&&(a.direction==="asc"?o="desc":a.direction==="desc"&&(o=null)),o?r.setSortColumn({column:n,direction:o}):r.clearSort(),s(),i(new CustomEvent("header-click",{detail:{column:n,direction:o,sortInfo:o?{column:n,direction:o}:null}}))};var nt={};N(nt,{INITIAL_STATE:()=>ui,clearSort:()=>xi,selectSortInfo:()=>vi,selectState:()=>bi,setSortColumn:()=>wi,toViewData:()=>gi});var ui=Object.freeze({sortColumn:null,sortDirection:null}),fi=["id","class","style","slot"],mi=e=>Object.entries(e).filter(([t])=>!fi.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),yi=(e,t)=>{let r=t.split("."),s=e;for(let i of r){if(s==null)return null;s=s[i]}return s},gi=({state:e,props:t,attrs:r})=>{let s=mi(r),i=t.data||{columns:[],rows:[]},n=i.rows.map((a,o)=>{let l=i.columns.map(h=>{let u=yi(a,h.key);return{key:h.key,value:u!=null?String(u):""}});return{index:o,cells:l}});return{containerAttrString:s,columns:i.columns||[],rows:n||[]}},bi=({state:e})=>e,vi=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),wi=(e,{column:t,direction:r})=>{e.sortColumn=t,e.sortDirection=r},xi=e=>{e.sortColumn=null,e.sortDirection=null};var Yt={elementName:"rtgl-table",viewDataSchema:{type:"object",properties:{columns:{type:"array"},rows:{type:"array"},containerAttrString:{type:"string"}}},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}}},refs:{"row-*":{eventListeners:{click:{handler:"handleRowClick"}}},"header-*":{eventListeners:{click:{handler:"handleHeaderClick"}}}},events:{},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-${column.key}",value:{type:1,path:"column.label"},parsedKey:{type:2,parts:["th#header-",{type:1,path:"column.key"}]}}],fast:!0}],fast:!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-${row.index}",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}}],fast:!1},parsedKey:{type:2,parts:["tr#row-",{type:1,path:"row.index"}]}}],fast:!1}],fast:!1}}],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}};var tr=Symbol.for("immer-nothing"),Gt=Symbol.for("immer-draftable"),F=Symbol.for("immer-state");function U(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ne=Object.getPrototypeOf;function ae(e){return!!e&&!!e[F]}function Z(e){return e?rr(e)||Array.isArray(e)||!!e[Gt]||!!e.constructor?.[Gt]||xe(e)||_e(e):!1}var _i=Object.prototype.constructor.toString();function rr(e){if(!e||typeof e!="object")return!1;let t=ne(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)===_i}function ge(e,t){we(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function we(e){let t=e[F];return t?t.type_:Array.isArray(e)?1:xe(e)?2:_e(e)?3:0}function lt(e,t){return we(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function sr(e,t,r){let s=we(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function Si(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function xe(e){return e instanceof Map}function _e(e){return e instanceof Set}function Q(e){return e.copy_||e.base_}function pt(e,t){if(xe(e))return new Map(e);if(_e(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=rr(e);if(t===!0||t==="class_only"&&!r){let s=Object.getOwnPropertyDescriptors(e);delete s[F];let i=Reflect.ownKeys(s);for(let n=0;n<i.length;n++){let a=i[n],o=s[a];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(s[a]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[a]})}return Object.create(ne(e),s)}else{let s=ne(e);if(s!==null&&r)return{...e};let i=Object.create(s);return Object.assign(i,e)}}function ft(e,t=!1){return Se(e)||ae(e)||!Z(e)||(we(e)>1&&(e.set=e.add=e.clear=e.delete=ki),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>ft(s,!0))),e}function ki(){U(2)}function Se(e){return Object.isFrozen(e)}var Ei={};function ee(e){let t=Ei[e];return t||U(0,e),t}var de;function ir(){return de}function Ai(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Xt(e,t){t&&(ee("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ct(e){ht(e),e.drafts_.forEach($i),e.drafts_=null}function ht(e){e===de&&(de=e.parent_)}function Qt(e){return de=Ai(de,e)}function $i(e){let t=e[F];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Zt(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[F].modified_&&(ct(t),U(4)),Z(e)&&(e=be(t,e),t.parent_||ve(t,e)),t.patches_&&ee("Patches").generateReplacementPatches_(r[F].base_,e,t.patches_,t.inversePatches_)):e=be(t,r,[]),ct(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==tr?e:void 0}function be(e,t,r){if(Se(t))return t;let s=t[F];if(!s)return ge(t,(i,n)=>er(e,s,t,i,n,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return ve(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;let i=s.copy_,n=i,a=!1;s.type_===3&&(n=new Set(i),i.clear(),a=!0),ge(n,(o,l)=>er(e,s,i,o,l,r,a)),ve(e,i,!1),r&&e.patches_&&ee("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function er(e,t,r,s,i,n,a){if(ae(i)){let o=n&&t&&t.type_!==3&&!lt(t.assigned_,s)?n.concat(s):void 0,l=be(e,i,o);if(sr(r,s,l),ae(l))e.canAutoFreeze_=!1;else return}else a&&r.add(i);if(Z(i)&&!Se(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;be(e,i),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&ve(e,i)}}function ve(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ft(t,r)}function Ci(e,t){let r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:ir(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=s,n=mt;r&&(i=[s],n=ue);let{revoke:a,proxy:o}=Proxy.revocable(i,n);return s.draft_=o,s.revoke_=a,o}var mt={get(e,t){if(t===F)return e;let r=Q(e);if(!lt(r,t))return Oi(e,r,t);let s=r[t];return e.finalized_||!Z(s)?s:s===at(e.base_,t)?(ot(e),e.copy_[t]=ut(s,e)):s},has(e,t){return t in Q(e)},ownKeys(e){return Reflect.ownKeys(Q(e))},set(e,t,r){let s=nr(Q(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let i=at(Q(e),t),n=i?.[F];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Si(r,i)&&(r!==void 0||lt(e.base_,t)))return!0;ot(e),dt(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 at(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ot(e),dt(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Q(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){U(11)},getPrototypeOf(e){return ne(e.base_)},setPrototypeOf(){U(12)}},ue={};ge(mt,(e,t)=>{ue[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ue.deleteProperty=function(e,t){return ue.set.call(this,e,t,void 0)};ue.set=function(e,t,r){return mt.set.call(this,e[0],t,r,e[0])};function at(e,t){let r=e[F];return(r?Q(r):e)[t]}function Oi(e,t,r){let s=nr(t,r);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function nr(e,t){if(!(t in e))return;let r=ne(e);for(;r;){let s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=ne(r)}}function dt(e){e.modified_||(e.modified_=!0,e.parent_&&dt(e.parent_))}function ot(e){e.copy_||(e.copy_=pt(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ii=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,s)=>{if(typeof t=="function"&&typeof r!="function"){let n=r;r=t;let a=this;return function(l=n,...h){return a.produce(l,u=>r.call(this,u,...h))}}typeof r!="function"&&U(6),s!==void 0&&typeof s!="function"&&U(7);let i;if(Z(t)){let n=Qt(this),a=ut(t,void 0),o=!0;try{i=r(a),o=!1}finally{o?ct(n):ht(n)}return Xt(n,s),Zt(i,n)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===tr&&(i=void 0),this.autoFreeze_&&ft(i,!0),s){let n=[],a=[];ee("Patches").generateReplacementPatches_(t,i,n,a),s(n,a)}return i}else U(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...o)=>this.produceWithPatches(a,l=>t(l,...o));let s,i;return[this.produce(t,r,(a,o)=>{s=a,i=o}),s,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Z(e)||U(8),ae(e)&&(e=Ti(e));let t=Qt(this),r=ut(e,void 0);return r[F].isManual_=!0,ht(t),r}finishDraft(e,t){let r=e&&e[F];(!r||!r.isManual_)&&U(9);let{scope_:s}=r;return Xt(s,t),Zt(void 0,s)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));let s=ee("Patches").applyPatches_;return ae(e)?s(e,t):this.produce(e,i=>s(i,t))}};function ut(e,t){let r=xe(e)?ee("MapSet").proxyMap_(e,t):_e(e)?ee("MapSet").proxySet_(e,t):Ci(e,t);return(t?t.scope_:ir()).drafts_.push(r),r}function Ti(e){return ae(e)||U(10,e),ar(e)}function ar(e){if(!Z(e)||Se(e))return e;let t=e[F],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=pt(e,t.scope_.immer_.useStrictShallowCopy_)}else r=pt(e,!0);return ge(r,(s,i)=>{sr(r,s,ar(i))}),t&&(t.finalized_=!1),r}var H=new Ii,or=H.produce,ro=H.produceWithPatches.bind(H),so=H.setAutoFreeze.bind(H),io=H.setUseStrictShallowCopy.bind(H),no=H.applyPatches.bind(H),ao=H.createDraft.bind(H),oo=H.finishDraft.bind(H);var j={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9},B={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8},ke={NOT:0};var oe=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var lr=(e,t)=>{if(t===null)return new oe(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new oe(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return new oe(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},pr=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new oe(`Unknown function '${e}' (${r})`)};var Li=(e,t,r={})=>D(e,r,t,{}),D=(e,t,r,s)=>{switch(e.type){case j.LITERAL:return e.value;case j.VARIABLE:return cr(e.path,r,s);case j.INTERPOLATION:return Ni(e.parts,t,r,s);case j.FUNCTION:return hr(e,t,r,s);case j.BINARY:return dr(e,t,r,s);case j.UNARY:return ur(e,t,r,s);case j.CONDITIONAL:return ji(e,t,r,s);case j.LOOP:return Pi(e,t,r,s);case j.OBJECT:return Vi(e,t,r,s);case j.ARRAY:return Di(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},cr=(e,t,r)=>{if(!e)return;if(r.hasOwnProperty(e))return r[e];let s=e.split("."),i=t;for(let n=0;n<s.length;n++){let a=s[n];if(r.hasOwnProperty(a)){i=r[a];continue}if(i==null)return;i=i[a]}return i},Ni=(e,t,r,s)=>{let i="";for(let n of e)if(typeof n=="string")i+=n;else{let a=D(n,t,r,s);i+=a!=null?String(a):""}return i},hr=(e,t,r,s)=>{let i=t[e.name];if(!i)throw pr(e.name,t);let n=e.args.map(a=>D(a,t,r,s));return i(...n)},Ee=(e,t,r,s)=>{switch(e.type){case j.VARIABLE:return cr(e.path,r,s);case j.LITERAL:return e.value;case j.BINARY:return dr(e,t,r,s);case j.UNARY:return ur(e,t,r,s);case j.FUNCTION:return hr(e,t,r,s);default:return D(e,t,r,s)}},dr=(e,t,r,s)=>{if(e.op===B.AND||e.op===B.OR){let a=Ee(e.left,t,r,s),o=Ee(e.right,t,r,s);switch(e.op){case B.AND:return a&&o;case B.OR:return a||o}}let i=D(e.left,t,r,s),n=D(e.right,t,r,s);switch(e.op){case B.EQ:return i==n;case B.NEQ:return i!=n;case B.GT:return i>n;case B.LT:return i<n;case B.GTE:return i>=n;case B.LTE:return i<=n;case B.IN:return Array.isArray(n)?n.includes(i):!1;default:throw new Error(`Unknown binary operator: ${e.op}`)}},ur=(e,t,r,s)=>{let i=e.op===ke.NOT?Ee(e.operand,t,r,s):D(e.operand,t,r,s);switch(e.op){case ke.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},ji=(e,t,r,s)=>{for(let i=0;i<e.conditions.length;i++){let n=e.conditions[i];if(n===null||Ee(n,t,r,s))return D(e.bodies[i],t,r,s)}return{}},Pi=(e,t,r,s)=>{let i=D(e.iterable,t,r,s);if(!Array.isArray(i)){let a=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${e.iterable.path}`;throw lr(a,i)}let n=[];for(let a=0;a<i.length;a++){let o=Object.create(s);o[e.itemVar]=i[a],e.indexVar&&(o[e.indexVar]=a);let l=D(e.body,t,r,o);Array.isArray(l)&&l.length===1?n.push(l[0]):n.push(l)}return n},Vi=(e,t,r,s)=>{let i={},n=null,a=!1;for(let o of e.properties)if(!o.key.startsWith("$if ")&&!o.key.match(/^\$if\s+\w+.*:?$/)&&!o.key.startsWith("$elif")&&!o.key.startsWith("$else")&&!o.key.startsWith("$for ")){a=!0;break}for(let o of e.properties)if(o.key.startsWith("$if ")||o.key.match(/^\$if\s+\w+.*:?$/)){let l=D(o.value,t,r,s);if(!a&&l!==null&&l!==void 0)return Array.isArray(l)&&l.length===1?l[0]:l;typeof l=="object"&&l!==null&&!Array.isArray(l)&&Object.assign(i,l)}else if(!o.key.startsWith("$for ")){let l=o.value;if(l&&l.type===j.OBJECT&&l.properties){let h=l.properties.find(u=>u.key.startsWith("$for "));if(h){let u=D(h.value,t,r,s);u!==void 0&&(i[o.key]=u)}else{let u=D(o.value,t,r,s);u!==void 0&&(i[o.key]=u)}}else{let h=o.parsedKey?D(o.parsedKey,t,r,s):o.key,u=D(o.value,t,r,s);u!==void 0&&(i[h]=u)}}return i},Di=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===j.LOOP){let a=D(n,t,r,s);i.push(a)}else i.push(D(n,t,r,s));return i},Ae=Li;var $e=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...$e(r));else{if(r&&typeof r=="object"){let s=Object.entries(r);if(s.length>0){let[i,n]=s[0];Array.isArray(n)&&(r={[i]:$e(n)})}}t.push(r)}return t},[]):e;var zi=(e,t)=>{if(!t)return e;let r=[],s="",i=!1,n=null;for(let a=0;a<t.length;a++){let o=t[a];if(!i&&o===".")s&&(r.push(s),s="");else if(!i&&o==="[")s&&(r.push(s),s=""),i=!0;else if(i&&o==="]"){if(s){if(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))r.push(s.slice(1,-1));else{let l=Number(s);r.push(isNaN(l)?s:l)}s=""}i=!1,n=null}else i&&(o==='"'||o==="'")&&(n?o===n&&(n=null):n=o),s+=o}return s&&r.push(s),r.reduce((a,o)=>a&&a[o],e)},fr=({h:e,template:t,viewData:r,refs:s,handlers:i})=>{let n=Ae(t,r,{}),a=$e(n),o=Wi({h:e,items:a,refs:s,handlers:i,viewData:r});return e("div",{style:{display:"contents"}},o)},Wi=({h:e,items:t,refs:r={},handlers:s={},viewData:i={}})=>{if(!Array.isArray(t))return console.error("Input to createVirtualDom must be an array."),[e("div",{},[])];function n(a,o=""){return a.map((l,h)=>{if(typeof l=="string"||typeof l=="number")return String(l);if(typeof l!="object"||l===null)return console.warn("Skipping invalid item in DOM structure:",l),null;let u=Object.entries(l);if(u.length===0)return console.warn("Skipping empty object item:",l),null;let[y,E]=u[0];if(!isNaN(Number(y)))return Array.isArray(E)?n(E,`${o}.${y}`):typeof E=="object"&&E!==null&&Object.entries(E).length>0?n([E],`${o}.${y}`):String(E);u.length>1&&console.warn("Item has multiple keys, processing only the first:",y);let T,p,c=y.indexOf(" ");c===-1?(T=y,p=""):(T=y.substring(0,c),p=y.substring(c+1).trim());let d=T.split(/[.#]/)[0],f=d.includes("-"),g={},_={};if(p){let S=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|(\S+))/g,v;for(;(v=S.exec(p))!==null;)if(v[1].startsWith(".")){let I=v[1].substring(1),P=v[4];_[I]=zi(i,P)}else g[v[1]]=v[2]||v[3]||v[4]}let m=T.match(/#([^.#\s]+)/);m&&!Object.prototype.hasOwnProperty.call(g,"id")&&(g.id=m[1]);let x=null;g.id?x=g.id:f&&(x=d);let b=Object.create(null),k=null;if(f)k=d;else{let S=T.match(/\.([^.#]+)/g);S&&S.forEach(I=>{let P=I.substring(1);b[P]=!0});let v=T.match(/#([^.#\s]+)/);v&&(k=v[1])}let w;typeof E=="string"||typeof E=="number"?w=String(E):Array.isArray(E)?w=n(E,`${o}.${y}`):w=[],k&&!f&&(g.id=k);let A=Object.create(null);if(x&&r){let S=[];if(Object.keys(r).forEach(v=>{if(v.includes("*")){let I="^"+v.replace(/[.*+?^${}()|[\\\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"$";try{new RegExp(I).test(x)&&S.push(v)}catch(P){console.warn(`[Parser] Invalid regex pattern created from refKey '${v}': ${I}`,P)}}else x===v&&S.push(v)}),S.length>0){S.sort((I,P)=>{let R=!I.includes("*"),X=!P.includes("*");return R&&!X?-1:!R&&X?1:P.length-I.length});let v=S[0];if(r[v]&&r[v].eventListeners){let I=r[v].eventListeners;Object.entries(I).forEach(([P,R])=>{R.handler&&s[R.handler]?A[P]=X=>{s[R.handler](X)}:R.handler&&console.warn(`[Parser] Handler '${R.handler}' for refKey '${v}' (matching elementId '${x}') is referenced but not found in available handlers.`)})}}}let C={};if(x)C.key=x;else if(T){let S=o?`${o}.${h}`:String(h);if(C.key=`${T}-${S}`,Object.keys(_).length>0){let v=JSON.stringify(_).substring(0,50);C.key+=`-${v}`}}Object.keys(g).length>0&&(C.attrs=g),Object.keys(b).length>0&&(C.class=b),Object.keys(A).length>0&&(C.on=A),Object.keys(_).length>0&&(C.props=_),f&&(C.hook={update:(S,v)=>{let I=S.data?.props||{},P=v.data?.props||{},R=S.data?.attrs||{},X=v.data?.attrs||{},Nr=JSON.stringify(I)!==JSON.stringify(P),jr=JSON.stringify(R)!==JSON.stringify(X);if(Nr||jr){let V=v.elm;V&&V.render&&typeof V.render=="function"&&(V.setAttribute("isDirty","true"),requestAnimationFrame(()=>{if(V.render(),V.removeAttribute("isDirty"),V.handlers&&V.handlers.handleOnUpdate){let Pr={...V.deps||{},store:V.store,render:V.render.bind(V),handlers:V.handlers,dispatchEvent:V.dispatchEvent.bind(V),refIds:V.refIds||{},getRefIds:()=>V.refIds||{}};V.handlers.handleOnUpdate({oldProps:I,newProps:P,oldAttrs:R,newAttrs:X},Pr)}}))}}});try{return e(d,C,w)}catch(S){return console.error("Error creating virtual node:",S,{tagName:d,snabbdomData:C,childrenOrText:w}),e("div",{},["Error creating element"])}}).filter(Boolean)}return n(t)};var Fi=(e,t)=>{if(!t||typeof t!="object")return"";let r="",s=n=>Object.entries(n).map(([a,o])=>` ${a}: ${o};`).join(`
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
804
|
+
${q}
|
|
805
|
+
${J}
|
|
806
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),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",...ae([...ne,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=t=>{this.dispatchEvent(new CustomEvent("slider-input",{detail:{value:this._inputElement.value}}))};_onChange=t=>{this.dispatchEvent(new CustomEvent("slider-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(t==="key"&&r!==s){requestAnimationFrame(()=>{let n=this.getAttribute("value"),a=this.getAttribute("min")||"0";this._inputElement.value=n??a});return}if(["value","min","max","step","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=d=>`${n==="default"?"":`${n}-`}${d}`,o=this.getAttribute(a("wh")),l=M(o===null?this.getAttribute(a("w")):o),p=M(o===null?this.getAttribute(a("h")):o),c=this.getAttribute(a("op")),u=this.getAttribute(a("z"));u!==null&&(this._styles[n]["z-index"]=u),c!==null&&(this._styles[n].opacity=c),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),p==="f"?this._styles[n].height="100%":p!==void 0&&(this._styles[n].height=p,this._styles[n]["min-height"]=p,this._styles[n]["max-height"]=p),this.hasAttribute(a("hide"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("show"))&&(this._styles[n].display="block !important")});let i=oe(this._styles,'input[type="range"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.getAttribute("min"),s=this.getAttribute("max"),i=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null&&(this._inputElement.value=t),r!==null?this._inputElement.min=r:this._inputElement.min="0",s!==null?this._inputElement.max=s: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()}},Or=({render:e,html:t})=>pt;var ct=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
807
|
+
:host {
|
|
808
|
+
display: contents;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
dialog {
|
|
812
|
+
padding: 0;
|
|
813
|
+
border: none;
|
|
814
|
+
background: transparent;
|
|
815
|
+
margin: auto;
|
|
816
|
+
overflow-y: scroll;
|
|
817
|
+
color: inherit;
|
|
818
|
+
max-height: 100vh;
|
|
819
|
+
height: 100vh;
|
|
820
|
+
max-width: 100vw;
|
|
821
|
+
scrollbar-width: none;
|
|
822
|
+
outline: none;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
dialog::backdrop {
|
|
826
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
slot[name="content"] {
|
|
830
|
+
background-color: var(--background) !important;
|
|
831
|
+
display: block;
|
|
832
|
+
padding: var(--spacing-lg);
|
|
833
|
+
border: 1px solid var(--border);
|
|
834
|
+
border-radius: var(--border-radius-md);
|
|
835
|
+
margin-left: var(--spacing-lg);
|
|
836
|
+
margin-right: var(--spacing-lg);
|
|
837
|
+
width: fit-content;
|
|
838
|
+
max-width: calc(100vw - 2 * var(--spacing-lg));
|
|
839
|
+
/* Default margins will be set dynamically via JavaScript for adaptive centering */
|
|
840
|
+
margin-top: 40px;
|
|
841
|
+
margin-bottom: 40px;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
/* Size attribute styles */
|
|
845
|
+
:host([s="sm"]) slot[name="content"] {
|
|
846
|
+
width: 33vw;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
:host([s="md"]) slot[name="content"] {
|
|
850
|
+
width: 50vw;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
:host([s="lg"]) slot[name="content"] {
|
|
854
|
+
width: 80vw;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
:host([s="f"]) slot[name="content"] {
|
|
858
|
+
width: 100vw;
|
|
859
|
+
margin-left: 0;
|
|
860
|
+
margin-right: 0;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
@keyframes dialog-in {
|
|
864
|
+
from {
|
|
865
|
+
opacity: 0;
|
|
866
|
+
transform: scale(0.95);
|
|
867
|
+
}
|
|
868
|
+
to {
|
|
869
|
+
opacity: 1;
|
|
870
|
+
transform: scale(1);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
dialog[open] slot[name="content"] {
|
|
875
|
+
animation: dialog-in 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
876
|
+
}
|
|
877
|
+
`))}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._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}})))}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}}))})}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}attributeChangedCallback(t,r,s){t==="open"?s!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():s===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0,this._applyAdaptiveCentering())}_hideModal(){this._dialogElement.open&&(this._dialogElement.close(),this._slotElement&&(this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.removeChild(this._slotElement),this._slotElement=null),this._dialogElement.style.height="")}_applyAdaptiveCentering(){this._slotElement&&requestAnimationFrame(()=>{if(!this._slotElement)return;let t=this._slotElement.offsetHeight,r=window.innerHeight,s=40;if(t>=r-2*s)this._slotElement.style.marginTop=`${s}px`,this._slotElement.style.marginBottom=`${s}px`,this._dialogElement.style.height="100vh";else{let i=r-t,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}},Ir=({render:e,html:t})=>ct;var ut=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
|
|
878
|
+
:host {
|
|
879
|
+
display: contents;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
.popover-overlay {
|
|
883
|
+
position: fixed;
|
|
884
|
+
top: 0;
|
|
885
|
+
left: 0;
|
|
886
|
+
width: 100vw;
|
|
887
|
+
height: 100vh;
|
|
888
|
+
z-index: 999;
|
|
889
|
+
display: none;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
.popover-container {
|
|
893
|
+
position: fixed;
|
|
894
|
+
z-index: 1000;
|
|
895
|
+
display: none;
|
|
896
|
+
outline: none;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
:host([open]:not([no-overlay])) .popover-overlay {
|
|
900
|
+
display: block;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
:host([open]) .popover-container {
|
|
904
|
+
display: block;
|
|
905
|
+
visibility: hidden;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
/* For no-overlay mode, make the container non-interactive */
|
|
909
|
+
:host([no-overlay]) .popover-container {
|
|
910
|
+
pointer-events: none;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
:host([open][positioned]) .popover-container {
|
|
914
|
+
visibility: visible;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
slot[name="content"] {
|
|
918
|
+
display: block;
|
|
919
|
+
background-color: var(--muted);
|
|
920
|
+
border: 1px solid var(--border);
|
|
921
|
+
border-radius: var(--border-radius-md);
|
|
922
|
+
padding: var(--spacing-md);
|
|
923
|
+
min-width: 200px;
|
|
924
|
+
max-width: 400px;
|
|
925
|
+
}
|
|
926
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._popoverOverlay=document.createElement("div"),this._popoverOverlay.className="popover-overlay",this.shadow.appendChild(this._popoverOverlay),this._popoverOverlay.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._popoverOverlay.addEventListener("contextmenu",t=>{t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this.shadow.appendChild(this._popoverContainer),this._slotElement=null,this._isOpen=!1,this._handleEscKey=this._handleEscKey.bind(this)}static get observedAttributes(){return["open","x","y","placement","no-overlay"]}connectedCallback(){this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._removeGlobalListeners()}attributeChangedCallback(t,r,s){t==="open"?s!==null&&!this._isOpen?this._show():s===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="placement")&&this._isOpen&&this._updatePosition()}_show(){this._isOpen||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._updatePosition(),this._addGlobalListeners())}_hide(){this._isOpen&&(this._isOpen=!1,this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null),this._removeGlobalListeners())}_updatePosition(){let t=parseFloat(this.getAttribute("x")||"0"),r=parseFloat(this.getAttribute("y")||"0"),s=this.getAttribute("placement")||"bottom-start";this.removeAttribute("positioned"),requestAnimationFrame(()=>{let i=this._popoverContainer.getBoundingClientRect(),{left:n,top:a}=this._calculatePosition(t,r,i.width,i.height,s);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${a}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,r,s,i,n){let o=t,l=r;switch(n){case"top":o=t-s/2,l=r-i-8;break;case"top-start":o=t,l=r-i-8;break;case"top-end":o=t-s,l=r-i-8;break;case"right":o=t+8,l=r-i/2;break;case"right-start":o=t+8,l=r;break;case"right-end":o=t+8,l=r-i;break;case"bottom":o=t-s/2,l=r+8;break;case"bottom-start":o=t,l=r+8;break;case"bottom-end":o=t-s,l=r+8;break;case"left":o=t-s-8,l=r-i/2;break;case"left-start":o=t-s-8,l=r;break;case"left-end":o=t-s-8,l=r-i;break}let p=8;return o=Math.max(p,Math.min(o,window.innerWidth-s-p)),l=Math.max(p,Math.min(l,window.innerHeight-i-p)),{left:o,top:l}}_addGlobalListeners(){setTimeout(()=>{document.addEventListener("keydown",this._handleEscKey)},0)}_removeGlobalListeners(){document.removeEventListener("keydown",this._handleEscKey)}_handleEscKey(t){t.key==="Escape"&&this.dispatchEvent(new CustomEvent("close",{detail:{}}))}get popover(){return this._popoverContainer}},Tr=({render:e,html:t})=>ut;var ht={};V(ht,{handleClickItem:()=>ui});var ui=(e,t)=>{let{dispatchEvent:r}=e,s=t.currentTarget.dataset.id;r(new CustomEvent("item-click",{detail:{id:s}}))};var dt={};V(dt,{createInitialState:()=>hi,selectViewData:()=>yi});var hi=()=>Object.freeze({}),di=["id","class","style","slot"],fi=e=>Object.entries(e).filter(([t])=>!di.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),yi=({props:e,attrs:t})=>{let r=fi(t),s=e.items||[],i=e.separator||"breadcrumb-arrow",n=[];return s.forEach((a,o)=>{n.push(a),o<s.length-1&&n.push({isSeparator:!0})}),{containerAttrString:r,items:n,separator:i}};var Lr={elementName:"rtgl-breadcrumb",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"}}}},separator:{type:"string"}}},propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"}}}},separator:{type:"string",default:"breadcrumb-arrow"}}},refs:{"item-*":{eventListeners:{click:{handler:"handleClickItem"}}}},events:{"item-click":{type:"object",properties:{item:{type:"object",properties:{label:{type:"string"},id:{type:"string"}}},index:{type:"number"}}}},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:null,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.id"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${separator} c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"separator"}," c=mu-fg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#item-${item.id} data-id=${item.id} cur=p",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#item-",{type:1,path:"item.id"}," data-id=",{type:1,path:"item.id"}," cur=p"]}}],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}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md p=sm ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var ft={};V(ft,{handleClickMenuItem:()=>gi,handleClosePopover:()=>mi});var mi=(e,t)=>{let{dispatchEvent:r}=e;r(new CustomEvent("close"))},gi=(e,t)=>{let{dispatchEvent:r}=e,s=parseInt(t.currentTarget.id.replace("option-","")),i=e.props.items[s];r(new CustomEvent("click-item",{detail:{index:s,item:i}}))};var yt={};V(yt,{createInitialState:()=>vi,selectViewData:()=>bi});var vi=()=>Object.freeze({}),bi=({props:e,attrs:t})=>({items:e.items||[],open:!!t.open,x:t.x,y:t.y,placement:t.placement});var Rr={elementName:"rtgl-dropdown-menu",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["label","item","separator"]}}}}}},attrsSchema:{type:"object",properties:{open:{type:"string"},x:{type:"string"},y:{type:"string"},placement:{type:"string"}}},refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option-*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} placement=${placement}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=background br=md",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.type == 'label'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"label"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"item"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"separator"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f ph=lg pv=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option-${i} w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=mu",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option-",{type:1,path:"i"}," w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=mu"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 ph=lg mv=md bgc=bo",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," placement=",{type:1,path:"placement"}]}}],fast:!1}],fast:!1}};var mt={};V(mt,{handleActionClick:()=>_i,handleBeforeMount:()=>wi,handleColorPickerChange:()=>Si,handleImageClick:()=>Oi,handleInputChange:()=>Ei,handleOnUpdate:()=>xi,handlePopoverInputChange:()=>ki,handleSelectAddOption:()=>Ti,handleSelectChange:()=>Ai,handleSliderChange:()=>$i,handleSliderInputChange:()=>Ci,handleTooltipMouseEnter:()=>Li,handleTooltipMouseLeave:()=>Ri,handleWaveformClick:()=>Ii});var wi=e=>{let{store:t,props:r}=e;t.setFormValues(r.defaultValues)},xi=(e,t)=>{let{oldAttrs:r,newAttrs:s}=e,{store:i,props:n,render:a}=t;r?.key!==s?.key&&(i.setFormValues(n.defaultValues),a())},we=(e,t,r,s)=>{s(new CustomEvent("form-change",{detail:{name:e,fieldValue:t,formValues:r}}))},_i=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t.currentTarget.id.replace("action-","");s(new CustomEvent("action-click",{detail:{actionId:i,formValues:r.selectFormValues()}}))},Ei=(e,t)=>{let{store:r,dispatchEvent:s,props:i}=e,n=t.currentTarget.id.replace("input-","");n&&t.detail.value!==void 0&&(r.setFormFieldValue({name:n,value:t.detail.value,props:i}),we(n,t.detail.value,r.selectFormValues(),s))},ki=(e,t)=>{let{store:r,dispatchEvent:s,props:i}=e,n=t.currentTarget.id.replace("popover-input-","");n&&t.detail.value!==void 0&&(r.setFormFieldValue({name:n,value:t.detail.value,props:i}),we(n,t.detail.value,r.selectFormValues(),s))},Ai=(e,t)=>{let{store:r,dispatchEvent:s,render:i,props:n}=e,a=t.currentTarget.id.replace("select-","");a&&t.detail.selectedValue!==void 0&&(r.setFormFieldValue({name:a,value:t.detail.selectedValue,props:n}),we(a,t.detail.selectedValue,r.selectFormValues(),s),i())},Si=(e,t)=>{let{store:r,dispatchEvent:s,props:i}=e,n=t.currentTarget.id.replace("colorpicker-","");n&&t.detail.value!==void 0&&(r.setFormFieldValue({name:n,value:t.detail.value,props:i}),we(n,t.detail.value,r.selectFormValues(),s))},$i=(e,t)=>{let{store:r,dispatchEvent:s,props:i}=e,n=t.currentTarget.id.replace("slider-","");n&&t.detail.value!==void 0&&(r.setFormFieldValue({name:n,value:t.detail.value,props:i}),we(n,t.detail.value,r.selectFormValues(),s))},Ci=(e,t)=>{let{store:r,dispatchEvent:s,props:i}=e,n=t.currentTarget.id.replace("slider-input-","");n&&t.detail.value!==void 0&&(r.setFormFieldValue({name:n,value:t.detail.value,props:i}),we(n,t.detail.value,r.selectFormValues(),s))},Oi=(e,t)=>{t.type==="contextmenu"&&t.preventDefault();let{dispatchEvent:r}=e,s=t.currentTarget.id.replace("image-","");r(new CustomEvent("extra-event",{detail:{name:s,x:t.clientX,y:t.clientY,trigger:t.type}}))},Ii=(e,t)=>{t.type==="contextmenu"&&t.preventDefault();let{dispatchEvent:r}=e,s=t.currentTarget.id.replace("waveform-","");r(new CustomEvent("extra-event",{detail:{name:s,x:t.clientX,y:t.clientY,trigger:t.type}}))},Ti=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t.currentTarget.id.replace("select-","");s(new CustomEvent("action-click",{detail:{actionId:"select-options-add",name:i,formValues:r.selectFormValues()}}))},Li=(e,t)=>{let{store:r,render:s,props:i}=e,n=t.currentTarget.id.replace("tooltip-icon-",""),o=i.form.fields.find(l=>l.name===n);if(o&&o.tooltip){let l=t.currentTarget.getBoundingClientRect();r.showTooltip({x:l.left+l.width/2,y:l.top-8,content:o.tooltip.content}),s()}},Ri=(e,t)=>{let{store:r,render:s}=e;r.hideTooltip(),s()};var kt={};V(kt,{createInitialState:()=>ln,getFormFieldValue:()=>yn,hideTooltip:()=>bn,selectForm:()=>Me,selectFormValues:()=>fn,selectState:()=>dn,selectViewData:()=>hn,setFormFieldValue:()=>gn,setFormValues:()=>mn,showTooltip:()=>vn});var b={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9},F={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8},Oe={NOT:0};var B=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},xe=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var gt=e=>{if(!e||e.trim()==="")throw new B("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new B(`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 B(`Incomplete comparison expression - missing right operand (got: '${e}')`)},Vr=e=>{if(e.trim().endsWith(" in"))throw new B(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new B(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new B(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(t.includes(",")){let s=t.split(",").map(i=>i.trim());for(let i of s)if(!i)throw new B(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`)}else if(!t.trim())throw new B(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`)};var Nr=(e,t)=>{if(t===null)return new xe(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new xe(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return new xe(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},Pr=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new xe(`Unknown function '${e}' (${r})`)};var Vi=(e,t,r={})=>{let s=L(e,r,t,{});return s===void 0?{}:s},L=(e,t,r,s)=>{if(e.var&&!e.type)return z(e.var,r,s);if(e.type===b.LITERAL)return e.value;if(e.type===b.VARIABLE)return z(e.path,r,s);if(e.type===b.INTERPOLATION)return Pi(e.parts,t,r,s);switch(e.type){case b.FUNCTION:return Dr(e,t,r,s);case b.BINARY:return Br(e,t,r,s);case b.UNARY:return Wr(e,t,r,s);case b.CONDITIONAL:return Di(e,t,r,s);case b.LOOP:return Ki(e,t,r,s);case b.OBJECT:return zi(e,t,r,s);case b.ARRAY:return Hi(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},jr=new Map,Ni=e=>{let t=[],r="",s=!1;for(let i=0;i<e.length;i++){let n=e[i];if(n==="[")r&&(t.push({type:"property",value:r}),r=""),s=!0;else if(n==="]"){if(s&&r){let a=r.trim();/^\d+$/.test(a)?t.push({type:"index",value:parseInt(a,10)}):t.push({type:"property",value:`[${r}]`}),r=""}s=!1}else r+=n}return r&&t.push({type:"property",value:r}),t},z=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let s=jr.get(e);if(!s){let n=[],a="",o=0;for(let l=0;l<e.length;l++){let p=e[l];p==="["?(o++,a+=p):p==="]"?(o--,a+=p):p==="."&&o===0?a&&(n.push(a),a=""):a+=p}a&&n.push(a),s=[];for(let l of n){let p=Ni(l.trim());s.push(...p)}jr.set(e,s)}let i=t;for(let n=0;n<s.length;n++){let a=s[n];if(a.type==="property"&&a.value in r){i=r[a.value];continue}if(i==null)return;(a.type==="property"||a.type==="index")&&(i=i[a.value])}return i},Pi=(e,t,r,s)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let a=L(n,t,r,s);i.push(a!=null?String(a):"")}return i.join("")},Dr=(e,t,r,s)=>{let i=t[e.name];if(!i)throw Pr(e.name,t);let n=e.args.map(a=>L(a,t,r,s));return i(...n)},Ie=(e,t,r,s)=>{if(e.var&&!e.type)return z(e.var,r,s);switch(e.type){case b.VARIABLE:return z(e.path,r,s);case b.LITERAL:return e.value;case b.BINARY:return Br(e,t,r,s);case b.UNARY:return Wr(e,t,r,s);case b.FUNCTION:return Dr(e,t,r,s);default:return L(e,t,r,s)}},Br=(e,t,r,s)=>{if(e.op===F.AND||e.op===F.OR){let a=Ie(e.left,t,r,s),o=Ie(e.right,t,r,s);switch(e.op){case F.AND:return a&&o;case F.OR:return a||o}}let i=L(e.left,t,r,s),n=L(e.right,t,r,s);switch(e.op){case F.EQ:return i==n;case F.NEQ:return i!=n;case F.GT:return i>n;case F.LT:return i<n;case F.GTE:return i>=n;case F.LTE:return i<=n;case F.IN:return Array.isArray(n)?n.includes(i):!1;default:throw new Error(`Unknown binary operator: ${e.op}`)}},Wr=(e,t,r,s)=>{let i=e.op===Oe.NOT?Ie(e.operand,t,r,s):L(e.operand,t,r,s);switch(e.op){case Oe.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},ji=(e,t,r,s)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===b.VARIABLE)if(z(i.path,r,s)){let a=e.bodies[0];if(a.type===b.OBJECT&&a.properties.length<=5){let o={};for(let l of a.properties){let p=l.parsedKey?L(l.parsedKey,t,r,s):l.key,c=l.value;if(c.type===b.LITERAL)o[p]=c.value;else if(c.type===b.VARIABLE)o[p]=z(c.path,r,s);else if(c.type===b.INTERPOLATION){let u=[];for(let d of c.parts)if(typeof d=="string")u.push(d);else if(d.type===b.VARIABLE){let f=z(d.path,r,s);u.push(f!=null?String(f):"")}else{let f=L(d,t,r,s);u.push(f!=null?String(f):"")}o[p]=u.join("")}else o[p]=L(c,t,r,s)}return o}}else{let a=e.bodies[1];if(a.type===b.OBJECT&&a.properties.length<=5){let o={};for(let l of a.properties){let p=l.parsedKey?L(l.parsedKey,t,r,s):l.key,c=l.value;if(c.type===b.LITERAL)o[p]=c.value;else if(c.type===b.VARIABLE)o[p]=z(c.path,r,s);else if(c.type===b.INTERPOLATION){let u=[];for(let d of c.parts)if(typeof d=="string")u.push(d);else if(d.type===b.VARIABLE){let f=z(d.path,r,s);u.push(f!=null?String(f):"")}else{let f=L(d,t,r,s);u.push(f!=null?String(f):"")}o[p]=u.join("")}else o[p]=L(c,t,r,s)}return o}}}return null},Di=(e,t,r,s)=>{let i=ji(e,t,r,s);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let a=e.conditions[n];if(a===null||Ie(a,t,r,s))return L(e.bodies[n],t,r,s)}return Mr},Bi=(e,t)=>{let r=e.body,s=e.itemVar;if(r.type===b.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===b.VARIABLE){let i=r.conditions[0].path,n=r.bodies[0];if(i.startsWith(s+".")){let a=i.substring(s.length+1);if(n.type===b.OBJECT&&n.properties.length<=5){for(let l of n.properties)if(l.parsedKey)return null;let o=[];for(let l=0;l<t.length;l++){let p=t[l];if(p[a]){let c={};for(let u of n.properties){let d=u.key,f=u.value;if(f.type===b.LITERAL)c[d]=f.value;else if(f.type===b.VARIABLE){let h=f.path;if(h===s)c[d]=p;else if(h.startsWith(s+".")){let y=h.substring(s.length+1);c[d]=p[y]}else return null}else if(f.type===b.INTERPOLATION){let h=[],y=!0;for(let v of f.parts)if(typeof v=="string")h.push(v);else if(v.type===b.VARIABLE){let g=v.path;if(g===s)h.push(p!=null?String(p):"");else if(g.startsWith(s+".")){let w=g.substring(s.length+1),x=p[w];h.push(x!=null?String(x):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[d]=h.join("")}else return null}o.push(c)}}return o}}}return null},Wi=(e,t)=>{let r=e.body,s=e.itemVar,i=Bi(e,t);if(i!==null)return i;if(r.type===b.OBJECT&&r.properties.length<=5){for(let o of r.properties)if(o.parsedKey)return null;let n=[],a=!0;for(let o of r.properties){let l=o.key,p=o.value;if(p.type===b.LITERAL)n.push({key:l,type:"literal",value:p.value});else if(p.type===b.VARIABLE){let c=p.path;if(c===s)n.push({key:l,type:"item"});else if(c.startsWith(s+".")){let u=c.substring(s.length+1);if(!u.includes(".")&&!u.includes("["))n.push({key:l,type:"prop",prop:u});else{a=!1;break}}else{a=!1;break}}else if(p.type===b.INTERPOLATION&&p.parts.length===1){let c=p.parts[0];if(c.type===b.VARIABLE){let u=c.path;if(u===s)n.push({key:l,type:"item_string"});else if(u.startsWith(s+".")){let d=u.substring(s.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:l,type:"prop_string",prop:d});else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}if(a){let o=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 p=t[l];o[l]={id:p.id,title:p.title!=null?String(p.title):"",completed:p.completed}}else for(let l=0;l<t.length;l++){let p=t[l],c={};for(let u of n)if(u.type==="literal")c[u.key]=u.value;else if(u.type==="item")c[u.key]=p;else if(u.type==="prop")c[u.key]=p[u.prop];else if(u.type==="item_string")c[u.key]=p!=null?String(p):"";else if(u.type==="prop_string"){let d=p[u.prop];c[u.key]=d!=null?String(d):""}o[l]=c}return o}}return null},Mi=(e,t,r,s,i)=>{let n=[],a=e.body;if(a.type===b.OBJECT&&a.fast!==!1){let o=e.itemVar,l=e.indexVar;for(let p=0;p<i.length;p++){let c=i[p],u={},d={...s,[o]:c,...l&&{[l]:p}};for(let f of a.properties){let h=f.parsedKey?L(f.parsedKey,t,r,d):f.key,y=f.value;if(y.type===b.LITERAL)u[h]=y.value;else if(y.type===b.VARIABLE){let v=y.path;if(v===o)u[h]=c;else if(v===l)u[h]=p;else if(v.startsWith(o+".")){let g=v.substring(o.length+1);!g.includes(".")&&!g.includes("[")?u[h]=c[g]:u[h]=z(v,r,{...s,[o]:c,...l&&{[l]:p}})}else u[h]=z(v,r,{...s,[o]:c,...l&&{[l]:p}})}else if(y.type===b.INTERPOLATION){let v=[];for(let g of y.parts)if(typeof g=="string")v.push(g);else if(g.type===b.VARIABLE){let w=g.path,x;if(w===o)x=c;else if(w===l)x=p;else if(w.startsWith(o+".")){let _=w.substring(o.length+1);!_.includes(".")&&!_.includes("[")?x=c[_]:x=z(w,r,{...s,[o]:c,...l&&{[l]:p}})}else x=z(w,r,{...s,[o]:c,...l&&{[l]:p}});v.push(x!=null?String(x):"")}else{let w={...s,[o]:c,...l&&{[l]:p}},x=L(g,t,r,w);v.push(x!=null?String(x):"")}u[h]=v.join("")}else{let v={...s,[o]:c,...l&&{[l]:p}};u[h]=L(y,t,r,v)}}n.push(u)}return n}return null},Fi=(e,t,r)=>{let s=e.body;if(s.type===b.OBJECT&&s.properties.length===1&&s.properties[0].key==="$if item.visible"){let n=s.properties[0].value;if(n.type===b.CONDITIONAL&&n.conditions.length===1&&n.conditions[0].type===b.VARIABLE&&n.conditions[0].path==="item.visible"){let a=n.bodies[0];if(a.type===b.OBJECT&&a.properties.length===2){let o=a.properties[0],l=a.properties[1];if(o.key==="id"&&o.value.type===b.VARIABLE&&o.value.path==="item.id"&&l.key==="$if item.highlighted"&&l.value.type===b.CONDITIONAL){let p=[];for(let c=0;c<t.length;c++){let u=t[c];if(u.visible){let d={id:u.id};u.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${u.name}`):(d.highlight=!1,d.message=u.name),p.push(d)}}return p}}}}return null},Ki=(e,t,r,s)=>{let i=L(e.iterable,t,r,s);if(!Array.isArray(i)){let o=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${e.iterable.path}`;throw Nr(o,i)}if(!e.indexVar){let o=Fi(e,i,e.itemVar);if(o!==null)return o}if(!e.indexVar){let o=Wi(e,i);if(o!==null)return o}let n=Mi(e,t,r,s,i);if(n!==null)return n;let a=[];for(let o=0;o<i.length;o++){let l=e.indexVar?{...s,[e.itemVar]:i[o],[e.indexVar]:o}:{...s,[e.itemVar]:i[o]},p=L(e.body,t,r,l);Array.isArray(p)&&p.length===1?a.push(p[0]):a.push(p)}return a},Ui=(e,t,r,s)=>{if(e.whenCondition)return null;if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?L(i.parsedKey,t,r,s):i.key,a=i.value;if(a.type===b.OBJECT&&a.properties.length<=10&&!a.whenCondition){let o={},l={},p=!0;for(let c of a.properties){let u=c.parsedKey?L(c.parsedKey,t,r,s):c.key,d=c.value;if(d.type===b.LITERAL)l[u]=d.value;else if(d.type===b.VARIABLE)l[u]=z(d.path,r,s);else if(d.type===b.INTERPOLATION){let f=[];for(let h of d.parts)if(typeof h=="string")f.push(h);else if(h.type===b.VARIABLE){let y=z(h.path,r,s);f.push(y!=null?String(y):"")}else{p=!1;break}if(!p)break;l[u]=f.join("")}else if(d.type===b.OBJECT&&d.properties.length<=5){let f={};for(let h of d.properties){let y=h.key,v=h.value;if(v.type===b.LITERAL)f[y]=v.value;else if(v.type===b.VARIABLE)f[y]=z(v.path,r,s);else if(v.type===b.INTERPOLATION){let g=[];for(let w of v.parts)if(typeof w=="string")g.push(w);else if(w.type===b.VARIABLE){let x=z(w.path,r,s);g.push(x!=null?String(x):"")}else{p=!1;break}if(!p)break;f[y]=g.join("")}else{p=!1;break}}if(!p)break;l[u]=f}else{p=!1;break}}if(p)return o[n]=l,o}}return null},zi=(e,t,r,s)=>{if(e.whenCondition&&!Ie(e.whenCondition,t,r,s))return;let i=Ui(e,t,r,s);if(i!==null)return i;if(e.fast){let l={};for(let p of e.properties){let c=p.parsedKey?L(p.parsedKey,t,r,s):p.key,u=p.value;if(u.type===b.LITERAL)l[c]=u.value;else if(u.type===b.VARIABLE)l[c]=z(u.path,r,s);else if(u.type===b.INTERPOLATION){let d=[];for(let f of u.parts)if(typeof f=="string")d.push(f);else if(f.type===b.VARIABLE){let h=z(f.path,r,s);d.push(h!=null?String(h):"")}else{let h=L(f,t,r,s);d.push(h!=null?String(h):"")}l[c]=d.join("")}else l[c]=L(u,t,r,s)}return l}let n={},a=null,o=!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 ")){o=!0;break}for(let l of e.properties)if(l.key.startsWith("$if ")||l.key.match(/^\$if\s+\w+.*:?$/)){let p=L(l.value,t,r,s);if(!o&&p!==null&&p!==void 0)return Array.isArray(p)&&p.length===1?p[0]:p;typeof p=="object"&&p!==null&&!Array.isArray(p)&&Object.assign(n,p)}else if(!l.key.startsWith("$for ")){let p=l.value;if(p&&p.type===b.OBJECT&&p.properties){let c=p.properties.find(u=>u.key.startsWith("$for "));if(c){let u=L(c.value,t,r,s);u!==void 0&&(n[l.key]=u)}else{let u=L(l.value,t,r,s);u!==void 0&&(n[l.key]=u)}}else{let c=l.parsedKey?L(l.parsedKey,t,r,s):l.key,u=L(l.value,t,r,s);u!==void 0&&(n[c]=u)}}return n},Mr={},Hi=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===b.LOOP){let a=L(n,t,r,s);i.push(a)}else{let a=L(n,t,r,s);a!==Mr&&a!==void 0&&i.push(a)}return i},vt=Vi;var Ji=/\$\{([^}]*)\}/g,Kr=e=>{let t=e.match(/^(\w+)\((.*)\)$/);if(!t)return{isFunction:!1};let[,r,s]=t,i=qi(s);return{isFunction:!0,type:b.FUNCTION,name:r,args:i}},qi=e=>e.trim()?Gi(e).map(r=>Yi(r.trim())):[],Gi=e=>{let t=[],r="",s=0,i=!1,n="";for(let a=0;a<e.length;a++){let o=e[a],l=a>0?e[a-1]:"";!i&&(o==='"'||o==="'")?(i=!0,n=o,r+=o):i&&o===n&&l!=="\\"?(i=!1,n="",r+=o):!i&&o==="("?(s++,r+=o):!i&&o===")"?(s--,r+=o):!i&&o===","&&s===0?(t.push(r),r=""):r+=o}return r&&t.push(r),t},Yi=e=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:b.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:b.LITERAL,value:parseFloat(e)};if(e==="true")return{type:b.LITERAL,value:!0};if(e==="false")return{type:b.LITERAL,value:!1};if(e==="null")return{type:b.LITERAL,value:null};let t=Kr(e);return t.isFunction?{type:t.type,name:t.name,args:t.args}:{type:b.VARIABLE,path:e}},Xi=/^\w+\(.*\)$/,Qi=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,Zi=e=>{if(!(!e||e.trim()===""||Xi.test(e))&&Qi.test(e))throw e.includes("?")&&e.includes(":")?new B(`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 B(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new B(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},Fr=(e,t={})=>{let r=e.trim();Zi(r);let s=Kr(r);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};if(r.includes("[")&&!/[\s+\-*/%|&?:]/.test(r)){let i=0;for(let n of r)n==="["?i++:n==="]"&&i--;if(i!==0)throw new Error("Invalid array index syntax")}return{type:b.VARIABLE,path:r}},bt=(e,t={})=>{let r=e,s=[];e.includes("\\${")&&(r=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC$1"),r=r.replace(/\\(\$\{[^}]*\})/g,(o,l)=>{let p=`__ESCAPED_${s.length}__`;return s.push(l),p}),r=r.replace(/\\DOUBLE_ESC/g,"\\"));let i=[...r.matchAll(Ji)];if(i.length===0){let o=r;for(let l=0;l<s.length;l++)o=o.replace(`__ESCAPED_${l}__`,s[l]);return{type:b.LITERAL,value:o}}if(i.length===1&&i[0][0]===r&&s.length===0)try{return Fr(i[0][1],t)}catch(o){if(o.message==="Invalid array index syntax")return{type:b.LITERAL,value:r};throw o}let n=[],a=0;for(let o of i){let[l,p]=o,c=o.index;if(c>a){let u=r.substring(a,c);for(let d=0;d<s.length;d++)u=u.replace(`__ESCAPED_${d}__`,s[d]);u&&n.push(u)}try{let u=Fr(p.trim(),t);n.push(u)}catch(u){if(u.message==="Invalid array index syntax")n.push(l);else throw u}a=c+l.length}if(a<r.length){let o=r.substring(a);for(let l=0;l<s.length;l++)o=o.replace(`__ESCAPED_${l}__`,s[l]);o&&n.push(o)}return{type:b.INTERPOLATION,parts:n}};var ue=(e,t)=>typeof e=="string"?bt(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?en(e,t):tn(e,t):{type:b.LITERAL,value:e},en=(e,t)=>{let r=[],s=!1;for(let i=0;i<e.length;i++){let n=e[i];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){let o=Object.keys(n);if(o.length===1&&o[0].startsWith("$for ")){let l=Ur(o[0],n[o[0]],t);r.push(l),s=!0;continue}}let a=ue(n,t);r.push(a),(a.type===b.FUNCTION||a.type===b.CONDITIONAL||a.type===b.LOOP||a.type===b.OBJECT&&!a.fast||a.type===b.ARRAY&&!a.fast)&&(s=!0)}return{type:b.ARRAY,items:r,fast:!s}},tn=(e,t)=>{let r=[],s=!1,i=null,n=Object.entries(e),a=0;for(let[l,p]of n)if(l==="$when"){if(i!==null)throw new B("Multiple '$when' directives on the same object are not allowed");if(p==null)throw new B("Missing condition expression after '$when'");let c=typeof p=="string"?p:JSON.stringify(p);if(c.trim()==="")throw new B("Empty condition expression after '$when'");i=re(c),s=!0}else if(l.startsWith("$when#")||l.startsWith("$when "))throw new B("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;a<n.length;){let[l,p]=n[a];if(l==="$when"){a++;continue}if(l.startsWith("$if ")||l.match(/^\$if#\w+\s/)||l.match(/^\$if\s+\w+.*:$/)){let c=rn(n,a,t);r.push({key:l,value:c.node}),s=!0,a=c.nextIndex}else if(l.startsWith("$for ")){let c=Ur(l,p,t);r.push({key:l,value:c}),s=!0,a++}else{if(l.startsWith("$elif ")||l.startsWith("$else"))throw new B(`'${l.split(" ")[0]}' without matching '$if'`);if(l==="$if"||l==="$if:")throw new B("Missing condition expression after '$if'");{let c=ue(p,t);(c.type===b.FUNCTION||c.type===b.CONDITIONAL||c.type===b.LOOP||c.type===b.OBJECT&&!c.fast||c.type===b.ARRAY&&!c.fast)&&(s=!0);let u=bt(l,t),d={key:l,value:c};(u.type!==b.LITERAL||u.value!==l)&&(d.parsedKey=u),r.push(d),a++}}}let o={type:b.OBJECT,properties:r,fast:!s};return i&&(o.whenCondition=i),o},rn=(e,t,r={})=>{let s=[],i=[],n=t,[a,o]=e[n],l=null,p;if(a.startsWith("$if#")){let u=a.match(/^\$if#(\w+)\s+(.+)$/);if(u)l=u[1],p=u[2];else throw new B(`Invalid conditional syntax: ${a}`)}else p=a.substring(4),p.endsWith(":")&&(p=p.slice(0,-1).trim());gt(p);let c=re(p);for(s.push(c),i.push(ue(o,r)),n++;n<e.length;){let[u,d]=e[n],f=!1,h;if(l?u.startsWith(`$elif#${l} `)?(h=u.substring(`$elif#${l} `.length),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(u===`$else#${l}`||u===`$else#${l}:`)&&(f=!0,h=null):u.startsWith("$elif ")?(h=u.substring(6),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(u==="$else"||u==="$else:")&&(f=!0,h=null),f){if(h===null)s.push(null);else{gt(h);let y=re(h);s.push(y)}if(i.push(ue(d,r)),n++,h===null)break}else break}return{node:{type:b.CONDITIONAL,conditions:s,bodies:i,id:l},nextIndex:n}},re=e=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")"))return re(e.slice(1,-1));let t=We(e,"||");if(t!==-1)return{type:b.BINARY,op:F.OR,left:re(e.substring(0,t).trim()),right:re(e.substring(t+2).trim())};let r=We(e,"&&");if(r!==-1)return{type:b.BINARY,op:F.AND,left:re(e.substring(0,r).trim()),right:re(e.substring(r+2).trim())};let s=[{op:">=",type:F.GTE},{op:"<=",type:F.LTE},{op:"==",type:F.EQ},{op:"!=",type:F.NEQ},{op:">",type:F.GT},{op:"<",type:F.LT},{op:" in ",type:F.IN}];for(let{op:n,type:a}of s){let o=We(e,n);if(o!==-1)return{type:b.BINARY,op:a,left:re(e.substring(0,o).trim()),right:re(e.substring(o+n.length).trim())}}let i=[" + "," - "," * "," / "," % "];for(let n of i)if(We(e,n)!==-1)throw new B(`Arithmetic expressions not supported in conditionals - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`);return e.startsWith("!")?{type:b.UNARY,op:Oe.NOT,operand:re(e.substring(1).trim())}:sn(e)},We=(e,t)=>{let r=0,s=0;for(;s<=e.length-t.length;){if(e[s]==="(")r++;else if(e[s]===")")r--;else if(r===0&&e.substring(s,s+t.length)===t)return s;s++}return-1},sn=e=>{if(e=e.trim(),e==="true")return{type:b.LITERAL,value:!0};if(e==="false")return{type:b.LITERAL,value:!1};if(e==="null")return{type:b.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:b.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:b.LITERAL,value:""};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:b.LITERAL,value:t}:{type:b.VARIABLE,path:e}},Ur=(e,t,r)=>{let s=e.substring(5).trim();Vr(s);let i=s.match(/^(.+?)\s+in\s+(.+)$/);if(!i)throw new B(`Invalid loop syntax - missing 'in' keyword (got: '$for ${s}')`);let n=i[1].trim(),a=i[2].trim(),o,l=null;if(n.includes(",")){let u=n.split(",").map(d=>d.trim());if(u.length!==2)throw new B(`Invalid loop variables: ${n}. Expected format: "item" or "item, index"`);o=u[0],l=u[1]}else o=n;let p={type:b.VARIABLE,path:a},c=ue(t,r);return{type:b.LOOP,itemVar:o,indexVar:l,iterable:p,body:c}};var nn=(e,t={})=>{let{functions:r={}}=t;return ue(e,r)},wt=nn;var xt={};V(xt,{now:()=>an});var an=()=>Date.now();var on=(e,t,r={})=>{let{functions:s={}}=r,i={...xt,...s},n=wt(e,{functions:i});return vt(n,t,i)},_t=on;var zr=e=>{function t(r){let s={"&":"&","<":"<",">":">",'"':""","'":"'"};return r.replace(/[&<>"']/g,i=>s[i])}return e==null?"":`"${t(String(e))}"`};function Hr(e,t){return t.reduce((r,s)=>(s in e&&(r[s]=e[s]),r),{})}var ln=()=>Object.freeze({formValues:{},tooltipState:{open:!1,x:0,y:0,content:""}}),Et=(e,t,r=void 0)=>{if(!t)return;let s=t.split(/[\[\].]/).filter(n=>n!==""),i=e;for(let n of s){if(i==null||!(n in i))return r;i=i[n]}return i},pn=(e,t,r)=>{let s=t.split(/[\[\].]/).filter(n=>n!=="");t.includes("[")&&t in e&&delete e[t];let i=e;for(let n=0;n<s.length-1;n++){let a=s[n];if(!(a in i)||typeof i[a]!="object"||i[a]===null){let o=s[n+1],l=/^\d+$/.test(o);i[a]=l?[]:{}}i=i[a]}return i[s[s.length-1]]=r,e},cn=["id","class","style","slot"],un=e=>Object.entries(e).filter(([t])=>!cn.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Me=({state:e,props:t})=>{let{form:r}=t,{context:s}=t;return s?_t(r,s):r},hn=({state:e,props:t,attrs:r})=>{let s=un(r),i=t.defaultValues||{},n=Me({state:e,props:t}),a=structuredClone(n.fields||[]);return a.forEach(o=>{let l=Et(e.formValues,o.name)??Et(i,o.name);if(["popover-input","select","read-only-text"].includes(o.inputType)?o.defaultValue=l:o.defaultValue=zr(l),["inputText"].includes(o.inputType)&&(o.placeholder=zr(o.placeholder)),o.inputType==="image"){let p=o.src;o.imageSrc=p&&p.trim()?p:null,o.placeholderText=o.placeholder||"No Image"}if(o.inputType==="waveform"){let p=o.waveformData;o.waveformData=p||null,o.placeholderText=o.placeholder||"No Waveform"}}),{key:r?.key,containerAttrString:s,title:n?.title||"",description:n?.description||"",fields:a,actions:t?.form?.actions||{buttons:[]},formValues:e.formValues,tooltipState:e.tooltipState}},dn=({state:e})=>e,fn=({state:e,props:t})=>{let r=Me({state:e,props:t});return Hr(e.formValues,r.fields.map(s=>s.name))},yn=({state:e},t)=>Et(e.formValues,t),mn=(e,t)=>{e.formValues=t||{}},gn=(e,{name:t,value:r,props:s})=>{pn(e.formValues,t,r);let i=Me({state:e,props:s}),n=Hr(e.formValues,i.fields.map(a=>a.name));e.formValues=n},vn=(e,{x:t,y:r,content:s})=>{e.tooltipState={open:!0,x:t,y:r,content:s}},bn=e=>{e.tooltipState={...e.tooltipState,open:!1}};var Jr={elementName:"rtgl-form",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{defaultValues:{type:"object"},context:{type:"object"},form:{type:"object",properties:{title:{type:"string"},description:{type:"string"},fields:{type:"array",items:{anyOf:[{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"inputText"},placeholder:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"select"},placeholder:{type:"string"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},options:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"any"}},required:["label","value"]}},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType","options"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"colorPicker"},value:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"slider"},min:{type:"number"},max:{type:"number"},step:{type:"number"},value:{type:"number"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"slider-input"},min:{type:"number"},max:{type:"number"},step:{type:"number"},value:{type:"number"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"image"},width:{type:"number"},height:{type:"number"},placeholder:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"waveform"},width:{type:"number"},height:{type:"number"},placeholder:{type:"string"},defaultValue:{type:"object"},waveformData:{type:"object"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"popover-input"},placeholder:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1}]}},actions:{type:"object",properties:{buttons:{type:"array",items:{type:"object",properties:{id:{type:"string"},content:{type:"string"}},required:["id","content"]}}}}}}}},refs:{"action-*":{eventListeners:{click:{handler:"handleActionClick"}}},"tooltip-icon-*":{eventListeners:{mouseenter:{handler:"handleTooltipMouseEnter"},mouseleave:{handler:"handleTooltipMouseLeave"}}},"input-*":{eventListeners:{"input-change":{handler:"handleInputChange"}}},"select-*":{eventListeners:{"select-change":{handler:"handleSelectChange"},"add-option-selected":{handler:"handleSelectAddOption"}}},"colorpicker-*":{eventListeners:{"colorpicker-change":{handler:"handleColorPickerChange"}}},"slider-*":{eventListeners:{"slider-change":{handler:"handleSliderChange"}}},"slider-input-*":{eventListeners:{"slider-input-value-change":{handler:"handleSliderInputChange"}}},"image-*":{eventListeners:{click:{handler:"handleImageClick"},contextmenu:{handler:"handleImageClick"}}},"waveform-*":{eventListeners:{click:{handler:"handleWaveformClick"},contextmenu:{handler:"handleWaveformClick"}}},"popover-input-*":{eventListeners:{"input-change":{handler:"handlePopoverInputChange"}}}},events:{"form-change":{},"extra-event":{},"action-click":{}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view 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:"rtgl-text s=lg",value:{type:1,path:"title"}}],fast:!0},{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"description"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-view g=lg w=f",value:{type:9,items:[{type:7,itemVar:"field",indexVar:"i",iterable:{type:1,path:"fields"},body:{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:"rtgl-view d=h g=md av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"field.label"}}],fast:!0},{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#tooltip-icon-${field.name} svg="info" wh=16 c=mu-fg cur=help ml=xs',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg#tooltip-icon-",{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:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "read-only-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"read-only-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"field.defaultValue"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "inputText"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"inputText"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#input-${field.name} key=${key} w=f placeholder=${field.placeholder} value=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input-",{type:1,path:"field.name"}," key=",{type:1,path:"key"}," w=f placeholder=",{type:1,path:"field.placeholder"}," value=",{type:1,path:"field.defaultValue"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "popover-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"popover-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-popover-input#popover-input-${field.name} label="${field.label}" .defaultValue=fields[${i}].defaultValue',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-popover-input#popover-input-",{type:1,path:"field.name"},' label="',{type:1,path:"field.label"},'" .defaultValue=fields[',{type:1,path:"i"},"].defaultValue"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-select#select-${field.name} key=${key} w=f .options=fields[${i}].options .placeholder=fields[${i}].placeholder .selectedValue=fields[${i}].defaultValue ?no-clear=fields[${i}].noClear .addOption=fields[${i}].addOption",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#select-",{type:1,path:"field.name"}," key=",{type:1,path:"key"}," w=f .options=fields[",{type:1,path:"i"},"].options .placeholder=fields[",{type:1,path:"i"},"].placeholder .selectedValue=fields[",{type:1,path:"i"},"].defaultValue ?no-clear=fields[",{type:1,path:"i"},"].noClear .addOption=fields[",{type:1,path:"i"},"].addOption"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "colorPicker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"colorPicker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#colorpicker-${field.name} key=${key} value=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#colorpicker-",{type:1,path:"field.name"}," key=",{type:1,path:"key"}," value=",{type:1,path:"field.defaultValue"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slider"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider#slider-${field.name} key=${key} w=f min=${field.min} max=${field.max} step=${field.step} value=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider-",{type:1,path:"field.name"}," key=",{type:1,path:"key"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," value=",{type:1,path:"field.defaultValue"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slider-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slider-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider-input#slider-input-${field.name} key=${key} w=f min=${field.min} max=${field.max} step=${field.step} defaultValue=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider-input#slider-input-",{type:1,path:"field.name"}," key=",{type:1,path:"key"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," defaultValue=",{type:1,path:"field.defaultValue"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "image" && field.imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"image"}},right:{type:1,path:"field.imageSrc"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image#image-${field.name} src=${field.imageSrc} w=${field.width} h=${field.height} cur=p",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image#image-",{type:1,path:"field.name"}," src=",{type:1,path:"field.imageSrc"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=p"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "image" && !field.imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},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.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=p 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.name"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," bc=ac bw=sm ah=c av=c cur=p p=md"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "waveform" && field.waveformData',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"waveform"}},right:{type:1,path:"field.waveformData"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-waveform#waveform-${field.name} .waveformData=fields[${i}].waveformData w=${field.width} h=${field.height} cur=p",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-waveform#waveform-",{type:1,path:"field.name"}," .waveformData=fields[",{type:1,path:"i"},"].waveformData w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=p"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "waveform" && !field.waveformData',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"waveform"}},right:{type:5,op:0,operand:{type:1,path:"field.waveformData"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#waveform-${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=p p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg ta=c",value:{type:1,path:"field.placeholder"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#waveform-",{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=p p=md"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slot"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slot"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'slot#slot-${field.slotName} name=${field.slot} style="display: contents;"',value:{type:0,value:null},parsedKey:{type:2,parts:["slot#slot-",{type:1,path:"field.slotName"}," name=",{type:1,path:"field.slot"},' style="display: contents;"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=e g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions.buttons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action-${button.id}",value:{type:1,path:"button.content"},parsedKey:{type:2,parts:["rtgl-button#action-",{type:1,path:"button.id"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:'rtgl-tooltip ?open=${tooltipState.open} x=${tooltipState.x} y=${tooltipState.y} placement="top" 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"},' placement="top" content="',{type:1,path:"tooltipState.content"},'"']}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f p=md g=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var At={};V(At,{handleCancel:()=>_n,handleConfirm:()=>xn,handleDialogClose:()=>wn,showAlert:()=>En,showConfirm:()=>kn});var wn=(e,t)=>{let{store:r,render:s}=t;r.closeDialog(),s()},xn=(e,t)=>{let{store:r,render:s,globalUI:i}=t;r.closeDialog(),s(),i.emit("event",!0)},_n=(e,t)=>{let{store:r,render:s,globalUI:i}=t;r.closeDialog(),s(),i.emit("event",!1)},En=(e,t)=>{let{store:r,render:s}=t;if(r.selectIsOpen())throw new Error("A dialog is already open");r.setAlertConfig(e),s()},kn=async(e,t)=>{let{store:r,render:s,globalUI:i}=t;if(r.selectIsOpen())throw new Error("A dialog is already open");return r.setConfirmConfig(e),s(),new Promise(n=>{i.once("event",a=>{n(a)})})};var St={};V(St,{closeDialog:()=>Cn,createInitialState:()=>An,selectConfig:()=>On,selectIsOpen:()=>In,selectViewData:()=>Tn,setAlertConfig:()=>Sn,setConfirmConfig:()=>$n});var An=()=>Object.freeze({isOpen:!1,config:{status:void 0,title:"",message:"",confirmText:"OK",cancelText:"Cancel",mode:"alert"}}),Sn=(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.isOpen=!0},$n=(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.isOpen=!0},Cn=e=>{e.isOpen=!1},On=({state:e})=>e.config,In=({state:e})=>e.isOpen,Tn=({state:e})=>({isOpen:e.isOpen,config:e.config});var qr={elementName:"rtgl-global-ui",viewDataSchema:{type:"object",properties:{isOpen:{type:"boolean"},config:{type:"object",properties:{status:{type:"string"},title:{type:"string"},message:{type:"string"},confirmText:{type:"string"},cancelText:{type:"string"},mode:{type:"string"}}}}},refs:{dialog:{eventListeners:{close:{handler:"handleDialogClose"}}},"confirm-button":{eventListeners:{click:{handler:"handleConfirm"}}},"cancel-button":{eventListeners:{click:{handler:"handleCancel"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-dialog#dialog ?open=${isOpen} s=sm",value:{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 d=h g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=c av=c g=md",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=24 av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text fw=600",value:{type:1,path:"config.title"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0},{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#cancel-button v=se",value:{type:1,path:"config.cancelText"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-button#confirm-button v=pr",value:{type:1,path:"config.confirmText"}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-dialog#dialog ?open=",{type:1,path:"isOpen"}," s=sm"]}}],fast:!1}],fast:!1}};var $t={};V($t,{handleClickStart:()=>Ln});var Ln=(e,t)=>{let{dispatchEvent:r,store:s}=e;console.log("handle click start",s.selectPath()),r(new CustomEvent("clickStart",{detail:{path:s.selectPath()}}))};var Ct={};V(Ct,{createInitialState:()=>Rn,selectPath:()=>jn,selectViewData:()=>Pn,setState:()=>Dn});var Rn=()=>Object.freeze({}),Vn=["id","class","style","slot"],Nn=e=>Object.entries(e).filter(([t])=>!Vn.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Pn=({state:e,props:t,attrs:r})=>{console.log("attrs",{attrs:r,entries:Object.entries(r)});let s=r.start?JSON.parse(decodeURIComponent(r.start)):t.start;return{containerAttrString:Nn(r),start:s||{label:"",image:{src:"",width:32,height:32,alt:""}}}},jn=({props:e})=>e.start.path,Dn=e=>{};var Gr={elementName:"rtgl-navbar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}},hasImage:{type:"boolean"},hasHref:{type:"boolean"}}}}},propsSchema:{type:"object",properties:{start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}}}}}},refs:{start:{eventListeners:{click:{handler:"handleClickStart"}}}},events:{clickStart:{type:"object",properties:{path:{type:"string"}}}},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=lg 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=lg g=md cur=p",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=lg 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 flex=1",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}};var Ot={};V(Ot,{handleBeforeMount:()=>Wn});var Yr=(e,t,r)=>{let{store:s,render:i}=r,n,a=-1/0;if(e.forEach(o=>{let l=o.getBoundingClientRect();l.top<=t&&l.top>a&&(a=l.top,n=o.id)}),!n){let o=1/0;e.forEach(l=>{let p=l.getBoundingClientRect();p.top>t&&p.top<o&&(o=p.top,n=l.id)})}n&&n!==s.selectCurrentId()&&(s.setCurrentId(n),i())},Bn=(e,t,r,s)=>{let{store:i,render:n}=s,a=e.querySelectorAll("h1[id], h2[id], h3[id], h4[id], rtgl-text[id]"),o=Array.from(a),l=o.map(c=>{let u=1,d=c.tagName.toLowerCase();return d==="h1"?u=1:d==="h2"?u=2:d==="h3"?u=3:d==="h4"?u=4:d==="rtgl-text"&&(u=parseInt(c.getAttribute("data-level")||"1",10)),{id:c.id,href:`#${c.id}`,title:c.textContent,level:u}});i.setItems(l),Yr(o,r,s),n();let p=Yr.bind(void 0,o,r,s);return t.addEventListener("scroll",p,{passive:!0}),()=>{t.removeEventListener("scroll",p)}},Wn=e=>{let{attrs:t}=e;requestAnimationFrame(()=>{let r=document.getElementById(t["target-id"]),s=window;t["scroll-container-id"]&&(s=document.getElementById(t["scroll-container-id"])||window);let i=parseInt(t["offset-top"]||"100",10),n=Bn(r,s,i,e);return()=>{n()}})};var It={};V(It,{createInitialState:()=>Mn,selectCurrentId:()=>Un,selectState:()=>Kn,selectViewData:()=>Fn,setContentContainer:()=>Jn,setCurrentId:()=>Hn,setItems:()=>zn});var Mn=()=>Object.freeze({items:[],currentId:null,contentContainer:null}),Fn=({state:e})=>{let r=((s,i)=>{let n=new Set,a=s.findIndex(l=>l.id===i);if(a===-1)return n;let o=s[a].level;for(let l=a-1;l>=0;l--)if(s[l].level<o){let p=s[l].level;n.add(s[l].id);for(let c=l-1;c>=0;c--)s[c].level<p&&(n.add(s[c].id),p=s[c].level);break}return n})(e.items,e.currentId);return{items:e.items.map(s=>{let i={1:"0",2:"12px",3:"24px",4:"32px"},n=s.id===e.currentId,a=r.has(s.id),o=n||a;return{...s,c:o?"fg":"mu-fg",ml:i[s.level]||"",bc:o?"fg":"mu-fg"}}),currentId:e.currentId}},Kn=({state:e})=>e,Un=({state:e})=>e.currentId,zn=(e,t)=>{e.items=t},Hn=(e,t)=>{e.currentId=t},Jn=(e,t)=>{e.contentContainer=t};var Xr={elementName:"rtgl-page-outline",viewDataSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{slug:{type:"string"},title:{type:"string"}}}},selectedSlug:{type:"string",nullable:!0}}},propsSchema:{type:"object",properties:{}},refs:{},events:{onItemClick:{type:"object"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=272 pr=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f 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}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var Tt={};V(Tt,{handleBeforeMount:()=>qn,handleInputChange:()=>Qn,handleInputKeydown:()=>ea,handleOnUpdate:()=>Gn,handlePopoverClose:()=>Xn,handleSubmitClick:()=>Zn,handleTextClick:()=>Yn});var qn=e=>{let{store:t,props:r}=e;(r.value!==void 0||r.defaultValue!==void 0)&&t.setValue(r.value||r.defaultValue||"")},Gn=(e,t)=>{let{oldProps:r,newProps:s}=e,{store:i,props:n,render:a}=t;r.defaultValue!==s.defaultValue&&i.setValue(n.defaultValue||""),a()},Yn=(e,t)=>{let{store:r,render:s,getRefIds:i,attrs:n}=e,a=r.selectValue();r.setTempValue(a),r.openPopover({position:{x:t.currentTarget.getBoundingClientRect().left,y:t.currentTarget.getBoundingClientRect().bottom}});let{input:o}=i();o.elm.value=a,s(),n["auto-focus"]&&setTimeout(()=>{o.elm.focus()},50)},Xn=(e,t)=>{let{store:r,render:s}=e;r.closePopover(),s()},Qn=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,n=t.detail.value;r.setTempValue(n),i(new CustomEvent("temp-input-change",{detail:{value:n},bubbles:!0})),s()},Zn=(e,t)=>{let{store:r,render:s,dispatchEvent:i,getRefIds:n}=e,{input:a}=n(),o=a.elm.value;r.setValue(o),r.closePopover(),i(new CustomEvent("input-change",{detail:{value:o},bubbles:!0})),s()},ea=(e,t)=>{let{store:r,render:s,dispatchEvent:i,getRefIds:n}=e;if(t.key==="Enter"){let{input:a}=n(),o=a.elm.value;r.closePopover(),i(new CustomEvent("input-change",{detail:{value:o},bubbles:!0})),s()}else t.key==="Escape"&&(r.closePopover(),s())};var Lt={};V(Lt,{closePopover:()=>na,createInitialState:()=>ta,openPopover:()=>ia,selectValue:()=>oa,selectViewData:()=>ra,setTempValue:()=>sa,setValue:()=>aa});var ta=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),ra=({attrs:e,state:t,props:r})=>{let s=t.value||"-";return{isOpen:t.isOpen,position:t.position,value:s??"-",tempValue:t.tempValue,placeholder:r.placeholder??"",label:e.label}},sa=(e,t)=>{e.tempValue=t},ia=(e,t)=>{let{position:r}=t;e.position=r,e.isOpen=!0,e.hasUnsavedChanges=!1},na=e=>{e.isOpen=!1,e.tempValue=""},aa=(e,t)=>{e.value=t},oa=({state:e})=>e.value;var Qr={elementName:"rtgl-popover-input",viewDataSchema:{type:"object"},attrsSchema:{type:"object",properties:{"auto-focus":{type:"boolean"}}},propsSchema:{type:"object",properties:{value:{type:"string"},defaultValue:{type:"string"},placeholder:{type:"string"},onChange:{type:"function"}}},refs:{"text-display":{eventListeners:{click:{handler:"handleTextClick"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},input:{eventListeners:{"input-change":{handler:"handleInputChange"},keydown:{handler:"handleInputKeydown"}}},submit:{eventListeners:{click:{handler:"handleSubmitClick"}}}},events:{"input-change":{}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#text-display w=f cur=p",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"value"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=240 slot=content bgc=background br=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-input#input w=f placeholder=${placeholder}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=f placeholder=",{type:1,path:"placeholder"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#submit",value:{type:0,value:"Submit"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}]}}],fast:!0}],fast:!0}};var Rt={};V(Rt,{handleAddOptionClick:()=>ma,handleAddOptionMouseEnter:()=>ga,handleAddOptionMouseLeave:()=>va,handleBeforeMount:()=>la,handleButtonClick:()=>ca,handleClearClick:()=>ya,handleClickOptionsPopoverOverlay:()=>ua,handleOnUpdate:()=>pa,handleOptionClick:()=>ha,handleOptionMouseEnter:()=>da,handleOptionMouseLeave:()=>fa});var la=e=>{let{store:t,props:r,render:s}=e;if(r.selectedValue!==null&&r.selectedValue!==void 0&&r.options){let i=r.options.find(n=>pe(n.value,r.selectedValue));i&&(t.updateSelectOption(i),s())}},pa=(e,t)=>{let{oldAttrs:r,newAttrs:s,oldProps:i,newProps:n}=e,{store:a,props:o,render:l}=t;if(r?.key!==s?.key&&s?.key){a.resetSelection();let p=n?.selectedValue||o?.selectedValue,c=n?.options||o?.options;if(p!=null&&c){let u=c.find(d=>pe(d.value,p));u&&a.updateSelectOption(u)}l()}},ca=(e,t)=>{let{store:r,render:s,getRefIds:i,props:n}=e,a=i()["select-button"].elm,o=a.firstElementChild,l=o?o.getBoundingClientRect():a.getBoundingClientRect(),p=r.selectSelectedValue(),c=p!==null?p:n.selectedValue,u=null;c!=null&&n.options&&(u=n.options.findIndex(d=>pe(d.value,c)),u===-1&&(u=null)),r.openOptionsPopover({position:{y:l.bottom+12,x:l.left-24},selectedIndex:u}),s()},ua=(e,t)=>{let{store:r,render:s}=e;r.closeOptionsPopover(),s()},ha=(e,t)=>{let{render:r,dispatchEvent:s,props:i,store:n}=e,a=t.currentTarget.id.replace("option-",""),o=i.options[a];n.updateSelectOption(o),i.onChange&&typeof i.onChange=="function"&&i.onChange(o.value),s(new CustomEvent("option-selected",{detail:{value:o.value,label:o.label},bubbles:!0})),s(new CustomEvent("select-change",{detail:{selectedValue:o.value},bubbles:!0})),r()},da=(e,t)=>{let{store:r,render:s}=e,i=parseInt(t.currentTarget.id.replace("option-",""));r.setHoveredOption(i),s()},fa=(e,t)=>{let{store:r,render:s}=e;r.clearHoveredOption(),s()},ya=(e,t)=>{let{store:r,render:s,dispatchEvent:i,props:n}=e;t.stopPropagation(),r.clearSelectedValue(),n.onChange&&typeof n.onChange=="function"&&n.onChange(void 0),i(new CustomEvent("option-selected",{detail:{value:void 0,label:void 0},bubbles:!0})),i(new CustomEvent("select-change",{detail:{selectedValue:void 0},bubbles:!0})),s()},ma=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e;r.closeOptionsPopover(),i(new CustomEvent("add-option-selected",{bubbles:!0})),s()},ga=(e,t)=>{let{store:r,render:s}=e;r.setHoveredAddOption(!0),s()},va=(e,t)=>{let{store:r,render:s}=e;r.setHoveredAddOption(!1),s()};var Vt={};V(Vt,{clearHoveredOption:()=>Ia,clearSelectedValue:()=>Ta,closeOptionsPopover:()=>Sa,createInitialState:()=>xa,openOptionsPopover:()=>Aa,resetSelection:()=>Ca,selectSelectedValue:()=>ka,selectState:()=>Ea,selectViewData:()=>_a,setHoveredAddOption:()=>La,setHoveredOption:()=>Oa,updateSelectOption:()=>$a});var ba=["id","class","style","slot","placeholder","selectedValue","selected-value","onChange","on-change","options"],wa=e=>Object.entries(e||{}).filter(([t])=>!ba.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),xa=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,hoveredOptionId:null,hoveredAddOption:!1}),_a=({state:e,props:t,attrs:r})=>{let s=wa(r),i=e.selectedValue!==null?e.selectedValue:t.selectedValue,n=t.placeholder||"Select an option",a=!0;if(i!=null&&t.options){let l=t.options.find(p=>pe(p.value,i));l&&(n=l.label,a=!1)}let o=(t.options||[]).map((l,p)=>{let c=pe(l.value,i),u=e.hoveredOptionId===p;return{...l,isSelected:c,bgc:u?"ac":c?"mu":""}});return{containerAttrString:s,isOpen:e.isOpen,position:e.position,options:o,selectedValue:i,selectedLabel:n,selectedLabelColor:a?"mu-fg":"fg",placeholder:t.placeholder||"Select an option",hasValue:i!=null,showClear:!r["no-clear"]&&!t["no-clear"]&&i!=null,showAddOption:!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"ac":""}},Ea=({state:e})=>e,ka=({state:e})=>e.selectedValue,Aa=(e,t)=>{let{position:r,selectedIndex:s}=t;e.position=r,e.isOpen=!0,s!=null&&(e.hoveredOptionId=s)},Sa=e=>{e.isOpen=!1},$a=(e,t)=>{e.selectedValue=t.value,e.isOpen=!1},Ca=e=>{e.selectedValue=void 0},Oa=(e,t)=>{e.hoveredOptionId=t},Ia=e=>{e.hoveredOptionId=null},Ta=e=>{e.selectedValue=void 0},La=(e,t)=>{e.hoveredAddOption=t};var Zr={elementName:"rtgl-select",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{options:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"any"}}}},selectedValue:{type:"any"},placeholder:{type:"string"},onChange:{type:"function"},"no-clear":{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}}}},refs:{"select-button":{eventListeners:{click:{handler:"handleButtonClick"}}},"clear-button":{eventListeners:{click:{handler:"handleClearClick"}}},popover:{eventListeners:{close:{handler:"handleClickOptionsPopoverOverlay"}}},"option-*":{eventListeners:{click:{handler:"handleOptionClick"},mouseenter:{handler:"handleOptionMouseEnter"},mouseleave:{handler:"handleOptionMouseLeave"}}},"option-add":{eventListeners:{click:{handler:"handleAddOptionClick"},mouseenter:{handler:"handleAddOptionMouseEnter"},mouseleave:{handler:"handleAddOptionMouseLeave"}}}},events:{},template:{type:9,items:[{type:8,properties:[{key:"rtgl-button#select-button v=ol ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${selectedLabelColor}",value:{type:1,path:"selectedLabel"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"selectedLabelColor"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view mh=md flex=1",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"$if showClear",value:{type:6,conditions:[{type:1,path:"showClear"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg#clear-button mr=md svg=x wh=16 c=mu-fg cur=p",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-button#select-button v=ol ",{type:1,path:"containerAttrString"}]}}],fast:!1},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} placement=right-start",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=background br=md sv=true",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#option-${i} w=f ph=lg pv=md cur=p br=md bgc=${option.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option-",{type:1,path:"i"}," w=f ph=lg pv=md cur=p br=md bgc=",{type:1,path:"option.bgc"}]}}],fast:!0}],fast:!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-bg bt=sm",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view#option-add w=f ph=lg pv=md cur=p br=md bgc=${addOptionBgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=ac",value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option-add w=f ph=lg pv=md cur=p br=md bgc=",{type:1,path:"addOptionBgc"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," placement=right-start"]}}],fast:!1}],fast:!1}};var Nt={};V(Nt,{handleHeaderClick:()=>Ra,handleItemClick:()=>Va});var Ra=(e,t)=>{let{store:r,dispatchEvent:s}=e,i,n=r.selectHeader();t.currentTarget.id==="header-label"?i=n.labelPath:t.currentTarget.id==="header-image"?i=n.image.path:t.currentTarget.id==="header"&&(i=n.path),s(new CustomEvent("headerClick",{detail:{path:i},bubbles:!0,composed:!0}))},Va=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t.currentTarget.id.replace("item-",""),n=r.selectItem(i);s(new CustomEvent("itemClick",{detail:{item:n},bubbles:!0,composed:!0}))};var jt={};V(jt,{createInitialState:()=>Na,selectActiveItem:()=>Wa,selectHeader:()=>Ba,selectItem:()=>Ma,selectViewData:()=>Da,setState:()=>Fa});var Na=()=>Object.freeze({}),Pa=["id","class","style","slot"],ja=e=>Object.entries(e).filter(([t])=>!Pa.includes(t)).map(([t,r])=>`${t}=${r}`).join(" ");function Pt(e,t=null){let r=[];for(let s of e){let i=s.id||s.href||s.path,n=t===i;if(r.push({id:i,title:s.title,href:s.href,type:s.type||"item",icon:s.icon,hrefAttr:s.href?`href=${s.href}`:"",isSelected:n,itemBgc:n?"ac":"bg",itemHoverBgc:n?"ac":"mu"}),s.items&&Array.isArray(s.items))for(let a of s.items){let o=a.id||a.href||a.path,l=t===o;r.push({id:o,title:a.title,href:a.href,type:a.type||"item",icon:a.icon,hrefAttr:a.href?`href=${a.href}`:"",isSelected:l,itemBgc:l?"ac":"bg",itemHoverBgc:l?"ac":"mu"})}}return r}var Da=({state:e,props:t,attrs:r})=>{let s=r.header?JSON.parse(decodeURIComponent(r.header)):t.header,i=r.items?JSON.parse(decodeURIComponent(r.items)):t.items,n=r.selectedItemId||t.selectedItemId,a=ja(r),o=r.mode||"full",l=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},p=i?Pt(i,n):[],c=o==="full"?272:64,u=o==="full"?"fs":"c",d=o==="full"?"fs":"c",f=o==="full"?"lg":"sm",h=o==="full"?"md":"sm",y=o==="shrunk-lg"?48:40,v=o==="shrunk-lg"?28:20,g=o==="shrunk-lg"?"md":"sm",w=o==="full",x=o==="full",_=o==="full"?"fs":"c",k=o==="full"?"":`ah=${d}`,A=o==="full"?"f":y;return{containerAttrString:a,mode:o,header:l,items:p,sidebarWidth:c,headerAlign:u,itemAlign:d,headerPadding:f,itemPadding:h,itemHeight:y,iconSize:v,firstLetterSize:g,showLabels:w,showGroupLabels:x,itemContentAlign:_,itemAlignAttr:k,itemWidth:A,headerWidth:A,selectedItemId:n,ah:o==="shrunk-lg"||o==="shrunk-md"?"c":""}},Ba=({state:e,props:t,attrs:r})=>r.header?JSON.parse(decodeURIComponent(r.header)):t.header,Wa=({state:e,props:t})=>(t.items?Pt(t.items):[]).find(s=>s.active),Ma=({state:e,props:t,attrs:r},s)=>{let i=r.items?JSON.parse(decodeURIComponent(r.items)):t.items;return(i?Pt(i):[]).find(a=>a.id===s)},Fa=e=>{};var es={elementName:"rtgl-sidebar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},mode:{type:"string",enum:["full","shrunk","shrunk-lg"],default:"full"},sidebarWidth:{type:"number"},headerAlign:{type:"string"},itemAlign:{type:"string"},headerPadding:{type:"string"},itemPadding:{type:"string"},itemHeight:{type:"number"},iconSize:{type:"number"},firstLetterSize:{type:"string"},showLabels:{type:"boolean"},showGroupLabels:{type:"boolean"},itemContentAlign:{type:"string"},itemAlignAttr:{type:"string"},itemWidth:{type:"string"},headerWidth:{type:"string"},selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},active:{type:"boolean"},icon:{type:"string"}}}}}},propsSchema:{type:"object",properties:{selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},items:{type:"array"}}}}}},refs:{"header-image":{eventListeners:{click:{handler:"handleHeaderClick"}}},"header-label":{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item-*":{eventListeners:{click:{handler:"handleItemClick"}}}},events:{headerClick:{type:"object",properties:{path:{type:"string"}}}},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#header-image cur=p":[{'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#header-label cur=p":[{"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} bwr=xs ah=${ah} ${containerAttrString}",value:{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#header-image cur=p",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#header-label cur=p",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=p",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#header-image cur=p",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#header-label cur=p",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=p"]}}],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},{type:8,properties:[{key:"rtgl-view w=f ph=${headerPadding} pb=lg g=xs ah=${ah}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'$if item.type == "groupLabel"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"groupLabel"}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showGroupLabels",value:{type:6,conditions:[{type:1,path:"showGroupLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=32 av=c ph=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=1 bgc=mu-bg",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-${item.id} ${item.hrefAttr} h=${itemHeight} av=c ${itemAlignAttr} ph=${itemPadding} w=${itemWidth} h-bgc=${item.itemHoverBgc} br=lg bgc=${item.itemBgc} cur=p",value:{type:9,items:[{type:8,properties:[{key:"$if item.icon",value:{type:6,conditions:[{type:1,path:"item.icon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=${itemContentAlign} g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h ah=",{type:1,path:"itemContentAlign"}," g=sm"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=${iconSize} svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=",{type:1,path:"iconSize"}," svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=${iconSize} br=f bgc=mu av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=${firstLetterSize} c=fg",value:{type:1,path:"item.title.charAt(0).toUpperCase()"},parsedKey:{type:2,parts:["rtgl-text s=",{type:1,path:"firstLetterSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view wh=",{type:1,path:"iconSize"}," br=f bgc=mu av=c ah=c"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#item-",{type:1,path:"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=p"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f ph=",{type:1,path:"headerPadding"}," pb=lg g=xs ah=",{type:1,path:"ah"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{type:1,path:"sidebarWidth"}," bwr=xs ah=",{type:1,path:"ah"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Dt={};V(Dt,{handleBeforeMount:()=>Ka,handleOnUpdate:()=>Ua,handleValueChange:()=>za});var Ka=e=>{let{store:t,attrs:r}=e;t.setValue(r.defaultValue||0)},Ua=(e,t)=>{let{oldAttrs:r,newAttrs:s}=e,{store:i,render:n,attrs:a}=t;if(r?.key!==s?.key&&s?.key){let o=s?.defaultValue||a?.defaultValue||0;i.setValue(o),n()}else if(r?.defaultValue!==s?.defaultValue){let o=s?.defaultValue||0;i.setValue(o),n()}},za=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,n=Number(t.detail.value);r.setValue(n),s(),i(new CustomEvent("slider-input-value-change",{detail:{value:n},bubbles:!0}))};var Bt={};V(Bt,{createInitialState:()=>Ha,selectViewData:()=>Ja,setValue:()=>qa});var Ha=()=>Object.freeze({value:0}),Ja=({state:e,attrs:t})=>({key:t.key,value:e.value,w:t.w||"",min:t.min||0,max:t.max||100,step:t.step||1}),qa=(e,t)=>{e.value=t};var ts={elementName:"rtgl-slider-input",viewDataSchema:{type:"object"},attrsSchema:{type:"object",properties:{defaultValue:{type:"string",default:"0"},w:{type:"string",default:""},min:{type:"string",default:"0"},max:{type:"string",default:"100"},step:{type:"string",default:"1"}}},refs:{input:{eventListeners:{"input-change":{handler:"handleValueChange"}}},slider:{eventListeners:{"slider-change":{handler:"handleValueChange"}}}},events:{"form-change":{}},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}",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"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=84",value:{type:9,items:[{type:8,properties:[{key:"rtgl-input#input key=${key} w=f type=number min=${min} max=${max} step=${step} value=${value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input key=",{type:1,path:"key"}," w=f type=number min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}]}}],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}};var Wt={};V(Wt,{handleBeforeMount:()=>Ga,handleHeaderClick:()=>Xa,handleRowClick:()=>Ya});var Ga=e=>{},Ya=(e,t)=>{let{dispatchEvent:r,props:s}=e,i=parseInt(t.currentTarget.id.replace("row-","")),n=s.data?.rows?.[i];n&&r(new CustomEvent("row-click",{detail:{rowIndex:i,rowData:n}}))},Xa=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,n=t.currentTarget.id.replace("header-",""),a=r.selectSortInfo(),o="asc";a.column===n&&(a.direction==="asc"?o="desc":a.direction==="desc"&&(o=null)),o?r.setSortColumn({column:n,direction:o}):r.clearSort(),s(),i(new CustomEvent("header-click",{detail:{column:n,direction:o,sortInfo:o?{column:n,direction:o}:null}}))};var Mt={};V(Mt,{clearSort:()=>ao,createInitialState:()=>Qa,selectSortInfo:()=>io,selectState:()=>so,selectViewData:()=>ro,setSortColumn:()=>no});var Qa=()=>Object.freeze({sortColumn:null,sortDirection:null}),Za=["id","class","style","slot"],eo=e=>Object.entries(e).filter(([t])=>!Za.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),to=(e,t)=>{let r=t.split("."),s=e;for(let i of r){if(s==null)return null;s=s[i]}return s},ro=({state:e,props:t,attrs:r})=>{let s=eo(r),i=t.data||{columns:[],rows:[]},n=i.rows.map((a,o)=>{let l=i.columns.map(p=>{let c=to(a,p.key);return{key:p.key,value:c!=null?String(c):""}});return{index:o,cells:l}});return{containerAttrString:s,columns:i.columns||[],rows:n||[]}},so=({state:e})=>e,io=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),no=(e,{column:t,direction:r})=>{e.sortColumn=t,e.sortDirection=r},ao=e=>{e.sortColumn=null,e.sortDirection=null};var rs={elementName:"rtgl-table",viewDataSchema:{type:"object",properties:{columns:{type:"array"},rows:{type:"array"},containerAttrString:{type:"string"}}},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}}},refs:{"row-*":{eventListeners:{click:{handler:"handleRowClick"}}},"header-*":{eventListeners:{click:{handler:"handleHeaderClick"}}}},events:{},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-${column.key}",value:{type:1,path:"column.label"},parsedKey:{type:2,parts:["th#header-",{type:1,path:"column.key"}]}}],fast:!0}],fast:!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-${row.index}",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}}],fast:!1},parsedKey:{type:2,parts:["tr#row-",{type:1,path:"row.index"}]}}],fast:!1}],fast:!1}}],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}};var Ft={};V(Ft,{handleClickItem:()=>oo});var oo=(e,t)=>{let{dispatchEvent:r}=e,s=t.currentTarget.dataset.id;r(new CustomEvent("item-click",{detail:{id:s}}))};var Kt={};V(Kt,{createInitialState:()=>lo,selectViewData:()=>uo});var lo=()=>Object.freeze({}),po=["id","class","style","slot"],co=e=>Object.entries(e).filter(([t])=>!po.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),uo=({state:e,props:t,attrs:r})=>{let s=co(r),i=t.items||[],n=r["selected-tab"],a=i.map(o=>({...o,isSelected:o.id===n,bgColor:o.id===n?"ac":"",borderColor:o.id===n?"":"tr",textColor:o.id===n?"":"mu-fg"}));return{containerAttrString:s,items:a,selectedTab:n}};var ss={elementName:"rtgl-tabs",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},isSelected:{type:"boolean"},bgColor:{type:"string"},textColor:{type:"string"},borderColor:{type:"string"}}}},selectedTab:{type:"string"}}},propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"}}}}}},attrsSchema:{type:"object",properties:{"selected-tab":{type:"string"}}},refs:{"tab-*":{eventListeners:{click:{handler:"handleClickItem"}}}},events:{"item-click":{type:"object",properties:{id:{type:"string"}}}},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:null,iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#tab-${item.id} data-id=${item.id} cur=p bgc=${item.bgColor} bw=xs bc=${item.borderColor} pv=md ph=lg br=lg",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:"item.id"}," data-id=",{type:1,path:"item.id"}," cur=p bgc=",{type:1,path:"item.bgColor"}," bw=xs bc=",{type:1,path:"item.borderColor"}," pv=md ph=lg br=lg"]}}],fast:!0}],fast:!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}};var is={};var Ut={};V(Ut,{createInitialState:()=>ho,selectViewData:()=>fo});var ho=()=>Object.freeze({}),fo=({attrs:e})=>({open:!!e.open,x:e.x||0,y:e.y||0,placement:e.placement||"top",content:e.content||""});var ns={elementName:"rtgl-tooltip",viewDataSchema:{type:"object"},attrsSchema:{type:"object",properties:{open:{type:"string"},x:{type:"string"},y:{type:"string"},placement:{type:"string"},content:{type:"string"}}},refs:{popover:null},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} placement=${placement} no-overlay",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content bgc=background bc=border br=md p=sm ah=c av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text ta=c s=sm c=foreground",value:{type:1,path:"content"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," placement=",{type:1,path:"placement"}," no-overlay"]}}],fast:!0}],fast:!0}};var zt={};V(zt,{handleAfterMount:()=>yo,handleOnUpdate:()=>mo});var yo=async e=>{let{props:t,store:r,render:s,getRefIds:i}=e,{waveformData:n}=t;r.setWaveformData(n),s();let a=i().canvas?.elm;a&&as(n,a)},mo=async(e,t)=>{let{store:r,render:s,getRefIds:i,props:n}=t,{waveformData:a}=n;if(!a){console.log("waveform handleOnUpdate: no waveformData provided");return}r.setWaveformData(a),s();let o=i().canvas?.elm;o&&as(a,o)};async function as(e,t){let r=t.getContext("2d"),s=t.getBoundingClientRect(),i=s.width,n=s.height;t.width=i,t.height=n;let a=t.width,o=t.height;if(r.clearRect(0,0,a,o),r.fillStyle="#1a1a1a",r.fillRect(0,0,a,o),!e||!e.amplitudes)return;let l=e.amplitudes,p=o/2,c=r.createLinearGradient(0,0,0,o);c.addColorStop(0,"#404040"),c.addColorStop(.5,"#A1A1A1"),c.addColorStop(1,"#404040");let u=Math.max(1,a/l.length),d=.2;for(let f=0;f<l.length;f++){let y=l[f]*(o*.85),v=f*u,g=p-y/2;r.fillStyle=c,r.fillRect(v,g,Math.max(1,u*(1-d)),y)}r.strokeStyle="rgba(255, 255, 255, 0.1)",r.lineWidth=1,r.beginPath(),r.moveTo(0,p),r.lineTo(a,p),r.stroke(),r.shadowBlur=10,r.shadowColor="#2196F3"}var Ht={};V(Ht,{createInitialState:()=>go,selectViewData:()=>bo,setWaveformData:()=>vo});var go=()=>Object.freeze({waveformData:null}),vo=(e,t)=>{e.waveformData=t},bo=({state:e,attrs:t,props:r})=>({isLoading:r.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:r.waveformData});var os={elementName:"rtgl-waveform",attrsSchema:{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"}}},propsSchema:{type:"object",properties:{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"}}},refs:{canvas:{selector:"canvas"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f 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 w=f h=f pos=rel w=",{type:1,path:"w"}," h=",{type:1,path:"h"}," cur=",{type:1,path:"cur"}]}}],fast:!1}],fast:!1}};var ds=Symbol.for("immer-nothing"),ls=Symbol.for("immer-draftable"),Q=Symbol.for("immer-state");function se(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var _e=Object.getPrototypeOf;function Ee(e){return!!e&&!!e[Q]}function de(e){return e?fs(e)||Array.isArray(e)||!!e[ls]||!!e.constructor?.[ls]||He(e)||Je(e):!1}var wo=Object.prototype.constructor.toString();function fs(e){if(!e||typeof e!="object")return!1;let t=_e(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)===wo}function Fe(e,t){ze(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function ze(e){let t=e[Q];return t?t.type_:Array.isArray(e)?1:He(e)?2:Je(e)?3:0}function Gt(e,t){return ze(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ys(e,t,r){let s=ze(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function xo(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function He(e){return e instanceof Map}function Je(e){return e instanceof Set}function he(e){return e.copy_||e.base_}function Yt(e,t){if(He(e))return new Map(e);if(Je(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=fs(e);if(t===!0||t==="class_only"&&!r){let s=Object.getOwnPropertyDescriptors(e);delete s[Q];let i=Reflect.ownKeys(s);for(let n=0;n<i.length;n++){let a=i[n],o=s[a];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(s[a]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[a]})}return Object.create(_e(e),s)}else{let s=_e(e);if(s!==null&&r)return{...e};let i=Object.create(s);return Object.assign(i,e)}}function tr(e,t=!1){return qe(e)||Ee(e)||!de(e)||(ze(e)>1&&(e.set=e.add=e.clear=e.delete=_o),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>tr(s,!0))),e}function _o(){se(2)}function qe(e){return Object.isFrozen(e)}var Eo={};function fe(e){let t=Eo[e];return t||se(0,e),t}var Te;function ms(){return Te}function ko(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ps(e,t){t&&(fe("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Xt(e){Qt(e),e.drafts_.forEach(Ao),e.drafts_=null}function Qt(e){e===Te&&(Te=e.parent_)}function cs(e){return Te=ko(Te,e)}function Ao(e){let t=e[Q];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function us(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Q].modified_&&(Xt(t),se(4)),de(e)&&(e=Ke(t,e),t.parent_||Ue(t,e)),t.patches_&&fe("Patches").generateReplacementPatches_(r[Q].base_,e,t.patches_,t.inversePatches_)):e=Ke(t,r,[]),Xt(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ds?e:void 0}function Ke(e,t,r){if(qe(t))return t;let s=t[Q];if(!s)return Fe(t,(i,n)=>hs(e,s,t,i,n,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return Ue(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;let i=s.copy_,n=i,a=!1;s.type_===3&&(n=new Set(i),i.clear(),a=!0),Fe(n,(o,l)=>hs(e,s,i,o,l,r,a)),Ue(e,i,!1),r&&e.patches_&&fe("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function hs(e,t,r,s,i,n,a){if(Ee(i)){let o=n&&t&&t.type_!==3&&!Gt(t.assigned_,s)?n.concat(s):void 0,l=Ke(e,i,o);if(ys(r,s,l),Ee(l))e.canAutoFreeze_=!1;else return}else a&&r.add(i);if(de(i)&&!qe(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Ke(e,i),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&Ue(e,i)}}function Ue(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&tr(t,r)}function So(e,t){let r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:ms(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=s,n=rr;r&&(i=[s],n=Le);let{revoke:a,proxy:o}=Proxy.revocable(i,n);return s.draft_=o,s.revoke_=a,o}var rr={get(e,t){if(t===Q)return e;let r=he(e);if(!Gt(r,t))return $o(e,r,t);let s=r[t];return e.finalized_||!de(s)?s:s===Jt(e.base_,t)?(qt(e),e.copy_[t]=er(s,e)):s},has(e,t){return t in he(e)},ownKeys(e){return Reflect.ownKeys(he(e))},set(e,t,r){let s=gs(he(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let i=Jt(he(e),t),n=i?.[Q];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(xo(r,i)&&(r!==void 0||Gt(e.base_,t)))return!0;qt(e),Zt(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 Jt(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,qt(e),Zt(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=he(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){se(11)},getPrototypeOf(e){return _e(e.base_)},setPrototypeOf(){se(12)}},Le={};Fe(rr,(e,t)=>{Le[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Le.deleteProperty=function(e,t){return Le.set.call(this,e,t,void 0)};Le.set=function(e,t,r){return rr.set.call(this,e[0],t,r,e[0])};function Jt(e,t){let r=e[Q];return(r?he(r):e)[t]}function $o(e,t,r){let s=gs(t,r);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function gs(e,t){if(!(t in e))return;let r=_e(e);for(;r;){let s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=_e(r)}}function Zt(e){e.modified_||(e.modified_=!0,e.parent_&&Zt(e.parent_))}function qt(e){e.copy_||(e.copy_=Yt(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Co=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,s)=>{if(typeof t=="function"&&typeof r!="function"){let n=r;r=t;let a=this;return function(l=n,...p){return a.produce(l,c=>r.call(this,c,...p))}}typeof r!="function"&&se(6),s!==void 0&&typeof s!="function"&&se(7);let i;if(de(t)){let n=cs(this),a=er(t,void 0),o=!0;try{i=r(a),o=!1}finally{o?Xt(n):Qt(n)}return ps(n,s),us(i,n)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===ds&&(i=void 0),this.autoFreeze_&&tr(i,!0),s){let n=[],a=[];fe("Patches").generateReplacementPatches_(t,i,n,a),s(n,a)}return i}else se(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...o)=>this.produceWithPatches(a,l=>t(l,...o));let s,i;return[this.produce(t,r,(a,o)=>{s=a,i=o}),s,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){de(e)||se(8),Ee(e)&&(e=Oo(e));let t=cs(this),r=er(e,void 0);return r[Q].isManual_=!0,Qt(t),r}finishDraft(e,t){let r=e&&e[Q];(!r||!r.isManual_)&&se(9);let{scope_:s}=r;return ps(s,t),us(void 0,s)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));let s=fe("Patches").applyPatches_;return Ee(e)?s(e,t):this.produce(e,i=>s(i,t))}};function er(e,t){let r=He(e)?fe("MapSet").proxyMap_(e,t):Je(e)?fe("MapSet").proxySet_(e,t):So(e,t);return(t?t.scope_:ms()).drafts_.push(r),r}function Oo(e){return Ee(e)||se(10,e),vs(e)}function vs(e){if(!de(e)||qe(e))return e;let t=e[Q],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Yt(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Yt(e,!0);return Fe(r,(s,i)=>{ys(r,s,vs(i))}),t&&(t.finalized_=!1),r}var Z=new Co,bs=Z.produce,eu=Z.produceWithPatches.bind(Z),tu=Z.setAutoFreeze.bind(Z),ru=Z.setUseStrictShallowCopy.bind(Z),su=Z.applyPatches.bind(Z),iu=Z.createDraft.bind(Z),nu=Z.finishDraft.bind(Z);var m={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},Re={NOT:0};var I=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},Y=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var sr=e=>{if(!e||e.trim()==="")throw new I("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new I(`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 I(`Incomplete comparison expression - missing right operand (got: '${e}')`)},ws=e=>{if(e.trim().endsWith(" in"))throw new I(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new I(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new I(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(t.includes(",")){let s=t.split(",").map(i=>i.trim());for(let i of s)if(!i)throw new I(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`)}else if(!t.trim())throw new I(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`)};var xs=(e,t,r=!1)=>{if(t===null)return new Y(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new Y(`Cannot iterate over undefined value at '$for ${e}'`);let s=typeof t;return r?new Y(`Cannot iterate over non-array value in loop '${e}' - got ${s} instead`):new Y(`Cannot iterate over non-array value (got: ${s}) at '$for ${e}'`)},_s=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new Y(`Unknown function '${e}' (${r})`)};var Io=(e,t,r={})=>{let s={},i={};r&&typeof r=="object"&&(r.functions!==void 0||r.partials!==void 0?(s=r.functions||{},i=r.partials||{}):typeof r=="object"&&(s=r));let a=O(e,{functions:s,partials:i},t,{});return a===void 0?{}:a},O=(e,t,r,s)=>{let i=t.functions||t;if(e.var&&!e.type)return H(e.var,r,s);if(e.type===m.LITERAL)return e.value;if(e.type===m.VARIABLE)return H(e.path,r,s);if(e.type===m.INTERPOLATION)return Lo(e.parts,t,r,s);switch(e.type){case m.FUNCTION:return ks(e,t,r,s);case m.BINARY:return As(e,t,r,s);case m.UNARY:return Ss(e,t,r,s);case m.CONDITIONAL:return Vo(e,t,r,s);case m.LOOP:return Bo(e,t,r,s);case m.OBJECT:return Mo(e,t,r,s);case m.ARRAY:return Fo(e,t,r,s);case m.PARTIAL:return Ko(e,t,r,s);case m.PATH_REFERENCE:return Uo(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},Es=new Map,To=e=>{let t=[],r="",s=!1;for(let i=0;i<e.length;i++){let n=e[i];if(n==="[")r&&(t.push({type:"property",value:r}),r=""),s=!0;else if(n==="]"){if(s&&r){let a=r.trim();if(/^\d+$/.test(a))t.push({type:"index",value:parseInt(a,10)});else if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")){let o=a.slice(1,-1);t.push({type:"property",value:o})}else t.push({type:"property",value:a});r=""}s=!1}else r+=n}return r&&t.push({type:"property",value:r}),t},H=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let s=Es.get(e);if(!s){let n=[],a="",o=0;for(let l=0;l<e.length;l++){let p=e[l];p==="["?(o++,a+=p):p==="]"?(o--,a+=p):p==="."&&o===0?a&&(n.push(a),a=""):a+=p}a&&n.push(a),s=[];for(let l of n){let p=To(l.trim());s.push(...p)}Es.set(e,s)}let i=t;for(let n=0;n<s.length;n++){let a=s[n];if(a.type==="property"&&a.value in r){i=r[a.value];continue}if(i==null)return;(a.type==="property"||a.type==="index")&&(i=i[a.value])}return i},Lo=(e,t,r,s)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let a=O(n,t,r,s);i.push(a!=null?String(a):"")}return i.join("")},ks=(e,t,r,s)=>{let i=t.functions||t,n=i[e.name];if(!n)throw _s(e.name,i);let a=e.args.map(o=>O(o,t,r,s));return n(...a)},ke=(e,t,r,s)=>{if(e.var&&!e.type)return H(e.var,r,s);switch(e.type){case m.VARIABLE:return H(e.path,r,s);case m.LITERAL:return e.value;case m.BINARY:return As(e,t,r,s);case m.UNARY:return Ss(e,t,r,s);case m.FUNCTION:return ks(e,t,r,s);default:return O(e,t,r,s)}},As=(e,t,r,s)=>{if(e.op===D.AND||e.op===D.OR){let a=ke(e.left,t,r,s),o=ke(e.right,t,r,s);switch(e.op){case D.AND:return a&&o;case D.OR:return a||o}}let i=O(e.left,t,r,s),n=O(e.right,t,r,s);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 Y(`Arithmetic operations require numbers. Got ${typeof i} + ${typeof n}`);return i+n;case D.SUBTRACT:if(typeof i!="number"||typeof n!="number")throw new Y(`Arithmetic operations require numbers. Got ${typeof i} - ${typeof n}`);return i-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},Ss=(e,t,r,s)=>{let i=e.op===Re.NOT?ke(e.operand,t,r,s):O(e.operand,t,r,s);switch(e.op){case Re.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Ro=(e,t,r,s)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===m.VARIABLE)if(H(i.path,r,s)){let a=e.bodies[0];if(a.type===m.OBJECT&&a.properties.length<=5){let o={};for(let l of a.properties){let p=l.parsedKey?O(l.parsedKey,t,r,s):l.key,c=l.value;if(c.type===m.LITERAL)o[p]=c.value;else if(c.type===m.VARIABLE)o[p]=H(c.path,r,s);else if(c.type===m.INTERPOLATION){let u=[];for(let d of c.parts)if(typeof d=="string")u.push(d);else if(d.type===m.VARIABLE){let f=H(d.path,r,s);u.push(f!=null?String(f):"")}else{let f=O(d,t,r,s);u.push(f!=null?String(f):"")}o[p]=u.join("")}else o[p]=O(c,t,r,s)}return o}}else{let a=e.bodies[1];if(a.type===m.OBJECT&&a.properties.length<=5){let o={};for(let l of a.properties){let p=l.parsedKey?O(l.parsedKey,t,r,s):l.key,c=l.value;if(c.type===m.LITERAL)o[p]=c.value;else if(c.type===m.VARIABLE)o[p]=H(c.path,r,s);else if(c.type===m.INTERPOLATION){let u=[];for(let d of c.parts)if(typeof d=="string")u.push(d);else if(d.type===m.VARIABLE){let f=H(d.path,r,s);u.push(f!=null?String(f):"")}else{let f=O(d,t,r,s);u.push(f!=null?String(f):"")}o[p]=u.join("")}else o[p]=O(c,t,r,s)}return o}}}return null},Vo=(e,t,r,s)=>{let i=Ro(e,t,r,s);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let a=e.conditions[n];if(a===null||ke(a,t,r,s))return O(e.bodies[n],t,r,s)}return $s},No=(e,t)=>{let r=e.body,s=e.itemVar;if(r.type===m.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===m.VARIABLE){let i=r.conditions[0].path,n=r.bodies[0];if(i.startsWith(s+".")){let a=i.substring(s.length+1);if(n.type===m.OBJECT&&n.properties.length<=5){for(let l of n.properties)if(l.parsedKey)return null;let o=[];for(let l=0;l<t.length;l++){let p=t[l];if(p[a]){let c={};for(let u of n.properties){let d=u.key,f=u.value;if(f.type===m.LITERAL)c[d]=f.value;else if(f.type===m.VARIABLE){let h=f.path;if(h===s)c[d]=p;else if(h.startsWith(s+".")){let y=h.substring(s.length+1);c[d]=p[y]}else return null}else if(f.type===m.INTERPOLATION){let h=[],y=!0;for(let v of f.parts)if(typeof v=="string")h.push(v);else if(v.type===m.VARIABLE){let g=v.path;if(g===s)h.push(p!=null?String(p):"");else if(g.startsWith(s+".")){let w=g.substring(s.length+1),x=p[w];h.push(x!=null?String(x):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[d]=h.join("")}else return null}o.push(c)}}return o}}}return null},Po=(e,t)=>{let r=e.body,s=e.itemVar,i=No(e,t);if(i!==null)return i;if(r.type===m.OBJECT&&r.properties.length<=5){for(let o of r.properties)if(o.parsedKey)return null;let n=[],a=!0;for(let o of r.properties){let l=o.key,p=o.value;if(p.type===m.LITERAL)n.push({key:l,type:"literal",value:p.value});else if(p.type===m.VARIABLE){let c=p.path;if(c===s)n.push({key:l,type:"item"});else if(c.startsWith(s+".")){let u=c.substring(s.length+1);if(!u.includes(".")&&!u.includes("["))n.push({key:l,type:"prop",prop:u});else{a=!1;break}}else{a=!1;break}}else if(p.type===m.INTERPOLATION&&p.parts.length===1){let c=p.parts[0];if(c.type===m.VARIABLE){let u=c.path;if(u===s)n.push({key:l,type:"item_string"});else if(u.startsWith(s+".")){let d=u.substring(s.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:l,type:"prop_string",prop:d});else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}if(a){let o=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 p=t[l];o[l]={id:p.id,title:p.title!=null?String(p.title):"",completed:p.completed}}else for(let l=0;l<t.length;l++){let p=t[l],c={};for(let u of n)if(u.type==="literal")c[u.key]=u.value;else if(u.type==="item")c[u.key]=p;else if(u.type==="prop")c[u.key]=p[u.prop];else if(u.type==="item_string")c[u.key]=p!=null?String(p):"";else if(u.type==="prop_string"){let d=p[u.prop];c[u.key]=d!=null?String(d):""}o[l]=c}return o}}return null},jo=(e,t,r,s,i)=>{let n=[],a=e.body;if(a.type===m.OBJECT&&a.fast!==!1){let o=e.itemVar,l=e.indexVar;for(let p=0;p<i.length;p++){let c=i[p],u={},d={...s,[o]:c,...l&&{[l]:p}};d.__paths__||(d.__paths__=s.__paths__||{});let f=e.iterable.path||"";if(s&&s.__paths__&&f){let h=f.split("."),y=h[0];y in s.__paths__&&(f=s.__paths__[y],h.length>1&&(f+="."+h.slice(1).join(".")))}d.__paths__={...d.__paths__,[o]:`${f}[${p}]`,...l&&{[l]:p}};for(let h of a.properties){let y=h.parsedKey?O(h.parsedKey,t,r,d):h.key,v=h.value;if(v.type===m.LITERAL)u[y]=v.value;else if(v.type===m.VARIABLE){let g=v.path;if(g===o)u[y]=c;else if(g===l)u[y]=p;else if(g.startsWith(o+".")){let w=g.substring(o.length+1);!w.includes(".")&&!w.includes("[")?u[y]=c[w]:u[y]=H(g,r,{...s,[o]:c,...l&&{[l]:p}})}else u[y]=H(g,r,{...s,[o]:c,...l&&{[l]:p}})}else if(v.type===m.INTERPOLATION){let g=[];for(let w of v.parts)if(typeof w=="string")g.push(w);else if(w.type===m.VARIABLE){let x=w.path,_;if(x===o)_=c;else if(x===l)_=p;else if(x.startsWith(o+".")){let k=x.substring(o.length+1);!k.includes(".")&&!k.includes("[")?_=c[k]:_=H(x,r,{...s,[o]:c,...l&&{[l]:p}})}else _=H(x,r,{...s,[o]:c,...l&&{[l]:p}});g.push(_!=null?String(_):"")}else{let x={...s,[o]:c,...l&&{[l]:p}},_=O(w,t,r,x);g.push(_!=null?String(_):"")}u[y]=g.join("")}else{let g={...s,[o]:c,...l&&{[l]:p}};u[y]=O(v,t,r,g)}}n.push(u)}return n}return null},Do=(e,t,r)=>{let s=e.body;if(s.type===m.OBJECT&&s.properties.length===1&&s.properties[0].key==="$if item.visible"){let n=s.properties[0].value;if(n.type===m.CONDITIONAL&&n.conditions.length===1&&n.conditions[0].type===m.VARIABLE&&n.conditions[0].path==="item.visible"){let a=n.bodies[0];if(a.type===m.OBJECT&&a.properties.length===2){let o=a.properties[0],l=a.properties[1];if(o.key==="id"&&o.value.type===m.VARIABLE&&o.value.path==="item.id"&&l.key==="$if item.highlighted"&&l.value.type===m.CONDITIONAL){let p=[];for(let c=0;c<t.length;c++){let u=t[c];if(u.visible){let d={id:u.id};u.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${u.name}`):(d.highlight=!1,d.message=u.name),p.push(d)}}return p}}}}return null},Bo=(e,t,r,s)=>{let i=O(e.iterable,t,r,s);if(!Array.isArray(i)){let p,c=!1;if(e.iterable.type===m.FUNCTION){c=!0;let d=e.iterable.args.map(f=>f.type===m.LITERAL?typeof f.value=="string"?`'${f.value}'`:String(f.value):f.type===m.VARIABLE?f.path:f.type===m.FUNCTION?`${f.name}(...)`:"?").join(", ");p=`${e.iterable.name}(${d})`}else p=e.iterable.path||"undefined";let u=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${p}`;throw xs(u,i,c)}if(!e.indexVar){let p=Do(e,i,e.itemVar);if(p!==null)return p}if(!e.indexVar){let p=Po(e,i);if(p!==null)return p}let n=jo(e,t,r,s,i);if(n!==null)return n;let a=[],o=e.iterable.path||"";if(s&&s.__paths__&&o){let p=o.split("."),c=p[0];c in s.__paths__&&(o=s.__paths__[c],p.length>1&&(o+="."+p.slice(1).join(".")))}let l=!1;e.body.type===m.ARRAY&&(e.body.items.length<=1?l=!1:l=e.body._shouldPreserveArray??=e.body.items.some(p=>p.type===m.OBJECT&&p.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let p=0;p<i.length;p++){let c=e.indexVar?{...s,[e.itemVar]:i[p],[e.indexVar]:p}:{...s,[e.itemVar]:i[p]};c.__paths__||(c.__paths__=s.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${o}[${p}]`},e.indexVar&&(c.__paths__[e.indexVar]=p);let u=O(e.body,t,r,c);Array.isArray(u)&&u.length===1&&!l?a.push(u[0]):a.push(u)}return a},Wo=(e,t,r,s)=>{if(e.whenCondition)return null;if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?O(i.parsedKey,t,r,s):i.key,a=i.value;if(a.type===m.OBJECT&&a.properties.length<=10&&!a.whenCondition){let o={},l={},p=!0;for(let c of a.properties){let u=c.parsedKey?O(c.parsedKey,t,r,s):c.key,d=c.value;if(d.type===m.LITERAL)l[u]=d.value;else if(d.type===m.VARIABLE)l[u]=H(d.path,r,s);else if(d.type===m.INTERPOLATION){let f=[];for(let h of d.parts)if(typeof h=="string")f.push(h);else if(h.type===m.VARIABLE){let y=H(h.path,r,s);f.push(y!=null?String(y):"")}else{p=!1;break}if(!p)break;l[u]=f.join("")}else if(d.type===m.OBJECT&&d.properties.length<=5){let f={};for(let h of d.properties){let y=h.key,v=h.value;if(v.type===m.LITERAL)f[y]=v.value;else if(v.type===m.VARIABLE)f[y]=H(v.path,r,s);else if(v.type===m.INTERPOLATION){let g=[];for(let w of v.parts)if(typeof w=="string")g.push(w);else if(w.type===m.VARIABLE){let x=H(w.path,r,s);g.push(x!=null?String(x):"")}else{p=!1;break}if(!p)break;f[y]=g.join("")}else{p=!1;break}}if(!p)break;l[u]=f}else{p=!1;break}}if(p)return o[n]=l,o}}return null},Mo=(e,t,r,s)=>{let i=t.functions||t;if(e.whenCondition&&!ke(e.whenCondition,i,r,s))return;let n=Wo(e,t,r,s);if(n!==null)return n;if(e.fast){let p={};for(let c of e.properties){let u=c.parsedKey?O(c.parsedKey,t,r,s):c.key,d=c.value;if(d.type===m.LITERAL)p[u]=d.value;else if(d.type===m.VARIABLE)p[u]=H(d.path,r,s);else if(d.type===m.INTERPOLATION){let f=[];for(let h of d.parts)if(typeof h=="string")f.push(h);else if(h.type===m.VARIABLE){let y=H(h.path,r,s);f.push(y!=null?String(y):"")}else{let y=O(h,t,r,s);f.push(y!=null?String(y):"")}p[u]=f.join("")}else p[u]=O(d,t,r,s)}return p}let a={},o=null,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 c=O(p.value,t,r,s);if(!l&&c!==null&&c!==void 0)return Array.isArray(c)&&c.length===1?c[0]:c;typeof c=="object"&&c!==null&&!Array.isArray(c)&&Object.assign(a,c)}else if(p.key.startsWith("$for ")){if(e.properties.length===1)return O(p.value,t,r,s)}else{let c=p.value;if(c&&c.type===m.OBJECT&&c.properties){let u=c.properties.find(d=>d.key.startsWith("$for "));if(u){let d=O(u.value,t,r,s);d!==void 0&&(a[p.key]=d)}else{let d=O(p.value,t,r,s);d!==void 0&&(a[p.key]=d)}}else{let u=p.parsedKey?O(p.parsedKey,t,r,s):p.key,d=O(p.value,t,r,s);d!==void 0&&(a[u]=d)}}return a},$s={},Fo=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===m.LOOP){let a=O(n,t,r,s);i.push(a)}else{let a=O(n,t,r,s);a!==$s&&a!==void 0&&i.push(a)}return i},Ko=(e,t,r,s)=>{let{name:i,data:n,whenCondition:a}=e,o=t.partials||{},l=t.functions||t;if(a&&!ke(a,l,r,s))return;if(!o[i])throw new Y(`Partial '${i}' is not defined`);let p=s._partialStack||[];if(p.includes(i))throw new Y(`Circular partial reference detected: ${i}`);let c=o[i],u=r,d={...s,_partialStack:[...p,i]};if(s){u={...r};for(let f of Object.keys(s))f.startsWith("_")||(u[f]=s[f])}if(n){let f=O(n,t,r,s);u={...u,...f}}return O(c,t,u,d)},Uo=(e,t,r,s)=>{let{path:i}=e,n=i.split("."),a=n[0],o=n.slice(1);if(!s||!(a in s))throw new Y(`Path reference '#{${i}}' refers to '${a}' which is not a loop variable in the current scope`);if(s.__paths__||(s.__paths__={}),!(a in s.__paths__))throw new Y(`Path reference '#{${i}}' cannot be resolved - path tracking may not be initialized properly`);let l=s.__paths__[a];if(typeof l=="number"){if(o.length>0)throw new Y(`Path reference '#{${i}}' - cannot access properties on index variable '${a}'`);return String(l)}return o.length>0&&(l+="."+o.join(".")),l},Ve=Io;var zo=/\$\{([^}]*)\}/g,Ho=/#\{([^}]*)\}/g,Os=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,s,i]=r,n=Jo(i,t);return{isFunction:!0,type:m.FUNCTION,name:s,args:n}},Jo=(e,t={})=>e.trim()?qo(e).map(s=>Go(s.trim(),t)):[],qo=e=>{let t=[],r="",s=0,i=!1,n="";for(let a=0;a<e.length;a++){let o=e[a],l=a>0?e[a-1]:"";!i&&(o==='"'||o==="'")?(i=!0,n=o,r+=o):i&&o===n&&l!=="\\"?(i=!1,n="",r+=o):!i&&o==="("?(s++,r+=o):!i&&o===")"?(s--,r+=o):!i&&o===","&&s===0?(t.push(r),r=""):r+=o}return r&&t.push(r),t},Go=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:m.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:m.LITERAL,value:parseFloat(e)};if(e==="true")return{type:m.LITERAL,value:!0};if(e==="false")return{type:m.LITERAL,value:!1};if(e==="null")return{type:m.LITERAL,value:null};let r=Os(e,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};let s=e.trim(),i=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1,a=null;for(let{op:o,type:l}of i){let p=0;for(;p<s.length;){let c=ye(s.substring(p),o);if(c===-1)break;let u=p+c;u>n&&(n=u,a={op:o,type:l}),p=u+o.length}}if(n!==-1)try{return G(s,t)}catch{return{type:m.VARIABLE,path:s}}return{type:m.VARIABLE,path:s}},Is=/^\w+\(.*\)$/,Yo=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,Xo=e=>{if(!(!e||e.trim()===""||Is.test(e))&&Yo.test(e))throw e.includes("?")&&e.includes(":")?new I(`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 I(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new I(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},Cs=e=>{let t=e.trim();if(Is.test(t))throw new I(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new I(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new I(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new I(`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 I(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:m.PATH_REFERENCE,path:t}},Ne=(e,t={})=>{let r=e.trim();Xo(r);let s=Os(r,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};if(r.includes("[")&&!/[\s+\-*/%|&?:]/.test(r)){let i=0;for(let n of r)n==="["?i++:n==="]"&&i--;if(i!==0)throw new Error("Invalid array index syntax")}return{type:m.VARIABLE,path:r}},ir=(e,t={})=>{let r=e,s=[];(e.includes("\\${")||e.includes("\\#{"))&&(r=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),r=r.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),r=r.replace(/\\(\$\{[^}]*\})/g,(p,c)=>{let u=`__ESCAPED_${s.length}__`;return s.push(c),u}),r=r.replace(/\\(#\{[^}]*\})/g,(p,c)=>{let u=`__ESCAPED_${s.length}__`;return s.push(c),u}),r=r.replace(/\\DOUBLE_ESC_VAR/g,"\\"),r=r.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let i=[...r.matchAll(zo)],n=[...r.matchAll(Ho)],a=[...i.map(p=>({match:p,type:"variable"})),...n.map(p=>({match:p,type:"pathref"}))].sort((p,c)=>p.match.index-c.match.index);if(a.length===0){let p=r;for(let c=0;c<s.length;c++)p=p.replace(`__ESCAPED_${c}__`,s[c]);return{type:m.LITERAL,value:p}}if(a.length===1&&a[0].match[0]===r&&s.length===0){let{match:p,type:c}=a[0];try{return c==="variable"?Ne(p[1],t):Cs(p[1])}catch(u){if(u.message==="Invalid array index syntax")return{type:m.LITERAL,value:r};throw u}}let o=[],l=0;for(let{match:p,type:c}of a){let[u,d]=p,f=p.index;if(f>l){let h=r.substring(l,f);for(let y=0;y<s.length;y++)h=h.replace(`__ESCAPED_${y}__`,s[y]);h&&o.push(h)}try{let h;c==="variable"?h=Ne(d.trim(),t):h=Cs(d.trim()),o.push(h)}catch(h){if(h.message==="Invalid array index syntax")o.push(u);else throw h}l=f+u.length}if(l<r.length){let p=r.substring(l);for(let c=0;c<s.length;c++)p=p.replace(`__ESCAPED_${c}__`,s[c]);p&&o.push(p)}return{type:m.INTERPOLATION,parts:o}};var ce=(e,t)=>typeof e=="string"?ir(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Qo(e,t):Zo(e,t):{type:m.LITERAL,value:e},Qo=(e,t)=>{let r=[],s=!1;for(let i=0;i<e.length;i++){let n=e[i];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){let o=Object.keys(n);if(o.length===1&&o[0].startsWith("$for ")){let l=Ls(o[0],n[o[0]],t);r.push(l),s=!0;continue}}let a=ce(n,t);r.push(a),(a.type===m.FUNCTION||a.type===m.CONDITIONAL||a.type===m.LOOP||a.type===m.PARTIAL||a.type===m.OBJECT&&!a.fast||a.type===m.ARRAY&&!a.fast)&&(s=!0)}return{type:m.ARRAY,items:r,fast:!s}},Zo=(e,t)=>{let r=[],s=!1,i=null,n=Object.entries(e),a=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new I("$partial value must be a string");if(e.$partial.trim()==="")throw new I("$partial value cannot be an empty string");let l=["$if","$elif","$else","$for"],p=[];for(let[g]of n)for(let w of l)if(g===w||g.startsWith(w+" ")||g.startsWith(w+"#")){p.push(w);break}if(p.length>0)throw new I(`Cannot use $partial with ${p.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:u,...d}=e,f={},h=!1;for(let[g,w]of Object.entries(d)){let x=g;(g.startsWith("\\$")||g.startsWith("$$"))&&(x=g.slice(1)),f[x]=w,h=!0}let y=null;if(h&&(y=ce(f,t),y.type===m.OBJECT)){let g=!1;for(let w of y.properties)if(w.value.type===m.VARIABLE||w.value.type===m.INTERPOLATION||w.value.type===m.FUNCTION||w.value.type===m.CONDITIONAL||w.value.type===m.LOOP||w.value.type===m.OBJECT&&!w.value.fast||w.value.type===m.ARRAY&&!w.value.fast){g=!0;break}g&&(y.fast=!1)}let v={type:m.PARTIAL,name:c,data:y};if(u!==void 0){let g;if(typeof u=="string"){if(u.trim()==="")throw new I("Empty condition expression after '$when'");g=G(u,t)}else g={type:m.LITERAL,value:u};v.whenCondition=g}return v}for(let[l,p]of n)if(l==="$when"){if(i!==null)throw new I("Multiple '$when' directives on the same object are not allowed");if(p==null)throw new I("Missing condition expression after '$when'");let c=typeof p=="string"?p:JSON.stringify(p);if(c.trim()==="")throw new I("Empty condition expression after '$when'");i=G(c,t),s=!0}else if(l.startsWith("$when#")||l.startsWith("$when "))throw new I("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;a<n.length;){let[l,p]=n[a];if(l==="$when"){a++;continue}if(l.startsWith("$if ")||l.match(/^\$if#\w+\s/)||l.match(/^\$if\s+\w+.*:$/)){let c=el(n,a,t);r.push({key:l,value:c.node}),s=!0,a=c.nextIndex}else if(l.startsWith("$for ")){let c=Ls(l,p,t);r.push({key:l,value:c}),s=!0,a++}else{if(l.startsWith("$elif ")||l.startsWith("$else"))throw new I(`'${l.split(" ")[0]}' without matching '$if'`);if(l==="$if"||l==="$if:")throw new I("Missing condition expression after '$if'");{let c=ce(p,t);(c.type===m.FUNCTION||c.type===m.CONDITIONAL||c.type===m.LOOP||c.type===m.PARTIAL||c.type===m.OBJECT&&!c.fast||c.type===m.ARRAY&&!c.fast)&&(s=!0);let u=ir(l,t),d={key:l,value:c};(u.type!==m.LITERAL||u.value!==l)&&(d.parsedKey=u),r.push(d),a++}}}let o={type:m.OBJECT,properties:r,fast:!s};return i&&(o.whenCondition=i),o},el=(e,t,r={})=>{let s=[],i=[],n=t,[a,o]=e[n],l=null,p;if(a.startsWith("$if#")){let u=a.match(/^\$if#(\w+)\s+(.+)$/);if(u)l=u[1],p=u[2];else throw new I(`Invalid conditional syntax: ${a}`)}else p=a.substring(4),p.endsWith(":")&&(p=p.slice(0,-1).trim());sr(p);let c=G(p,r);for(s.push(c),i.push(ce(o,r)),n++;n<e.length;){let[u,d]=e[n],f=!1,h;if(l?u.startsWith(`$elif#${l} `)?(h=u.substring(`$elif#${l} `.length),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(u===`$else#${l}`||u===`$else#${l}:`)&&(f=!0,h=null):u.startsWith("$elif ")?(h=u.substring(6),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(u==="$else"||u==="$else:")&&(f=!0,h=null),f){if(h===null)s.push(null);else{sr(h);let y=G(h,r);s.push(y)}if(i.push(ce(d,r)),n++,h===null)break}else break}return{node:{type:m.CONDITIONAL,conditions:s,bodies:i,id:l},nextIndex:n}},G=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let p=e.slice(1,-1),c=0,u=!0;for(let d=0;d<p.length;d++)if(p[d]==="("?c++:p[d]===")"&&c--,c<0){u=!1;break}if(u&&c===0)return G(p,t)}let r=ye(e,"||");if(r!==-1)return{type:m.BINARY,op:D.OR,left:G(e.substring(0,r).trim(),t),right:G(e.substring(r+2).trim(),t)};let s=ye(e,"&&");if(s!==-1)return{type:m.BINARY,op:D.AND,left:G(e.substring(0,s).trim(),t),right:G(e.substring(s+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:p,type:c}of i){let u=ye(e,p);if(u!==-1)return{type:m.BINARY,op:c,left:G(e.substring(0,u).trim(),t),right:G(e.substring(u+p.length).trim(),t)}}let n=-1,a=null,o=[{op:" + ",type:D.ADD},{op:" - ",type:D.SUBTRACT}];for(let{op:p,type:c}of o){let u=0;for(;u<e.length;){let d=ye(e.substring(u),p);if(d===-1)break;let f=u+d;f>n&&(n=f,a={op:p,type:c}),u=f+p.length}}if(n!==-1&&a)return{type:m.BINARY,op:a.type,left:G(e.substring(0,n).trim(),t),right:G(e.substring(n+a.op.length).trim(),t)};let l=[" * "," / "," % "];for(let p of l)if(ye(e,p)!==-1)throw new I(`Arithmetic operations are not allowed in conditionals: "${p}"`);return e.startsWith("!")?{type:m.UNARY,op:Re.NOT,operand:G(e.substring(1).trim(),t)}:Ts(e,t)},ye=(e,t)=>{let r=0,s=0;for(;s<=e.length-t.length;){if(e[s]==="(")r++;else if(e[s]===")")r--;else if(r===0&&e.substring(s,s+t.length)===t)return s;s++}return-1},tl=e=>{if(e=e.trim(),e==="true")return{type:m.LITERAL,value:!0};if(e==="false")return{type:m.LITERAL,value:!1};if(e==="null")return{type:m.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:m.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:m.LITERAL,value:""};if(e==="{}")return{type:m.LITERAL,value:{}};if(e==="[]")return{type:m.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:m.LITERAL,value:t}:{type:m.VARIABLE,path:e}},Ts=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return Ne(r,t);let i=tl(r);if(i.type===m.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:m.VARIABLE,path:r};try{return Ne(r,t)}catch(n){if(n.message&&n.message.includes("not supported"))return i;throw n}},Ls=(e,t,r)=>{let s=e.substring(5).trim();ws(s);let i=s.match(/^(.+?)\s+in\s+(.+)$/);if(!i)throw new I(`Invalid loop syntax - missing 'in' keyword (got: '$for ${s}')`);let n=i[1].trim(),a=i[2].trim(),o,l=null;if(n.includes(",")){let u=n.split(",").map(d=>d.trim());if(u.length!==2)throw new I(`Invalid loop variables: ${n}. Expected format: "item" or "item, index"`);o=u[0],l=u[1]}else o=n;let p=Ts(a,r),c=ce(t,r);return{type:m.LOOP,itemVar:o,indexVar:l,iterable:p,body:c}};var rl=(e,t={})=>{let{functions:r={}}=t;return ce(e,r)},Ge=rl;var nr={};V(nr,{now:()=>sl});var sl=()=>Date.now();var il=(e,t,r={})=>{let{functions:s={},partials:i={}}=r,n={...nr,...s},a=Ge(e,{functions:n}),o={};for(let[l,p]of Object.entries(i))o[l]=Ge(p,{functions:n});return Ve(a,t,{functions:n,partials:o})},ar=il;var Ye=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...Ye(r));else{if(r&&typeof r=="object"){let s=Object.entries(r);if(s.length>0){let[i,n]=s[0];Array.isArray(n)&&(r={[i]:Ye(n)})}}t.push(r)}return t},[]):e;var Rs=(e,t)=>{if(!t)return e;let r=[],s="",i=!1,n=null;for(let a=0;a<t.length;a++){let o=t[a];if(!i&&o===".")s&&(r.push(s),s="");else if(!i&&o==="[")s&&(r.push(s),s=""),i=!0;else if(i&&o==="]"){if(s){if(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))r.push(s.slice(1,-1));else{let l=Number(s);r.push(isNaN(l)?s:l)}s=""}i=!1,n=null}else i&&(o==='"'||o==="'")&&(n?o===n&&(n=null):n=o),s+=o}return s&&r.push(s),r.reduce((a,o)=>a&&a[o],e)},Vs=({h:e,template:t,viewData:r,refs:s,handlers:i})=>{let n=Ve(t,r,{}),a=Ye(n),o=nl({h:e,items:a,refs:s,handlers:i,viewData:r});return e("div",{style:{display:"contents"}},o)},nl=({h:e,items:t,refs:r={},handlers:s={},viewData:i={}})=>{if(!Array.isArray(t))return console.error("Input to createVirtualDom must be an array."),[e("div",{},[])];function n(a,o=""){return a.map((l,p)=>{if(typeof l=="string"||typeof l=="number")return String(l);if(typeof l!="object"||l===null)return console.warn("Skipping invalid item in DOM structure:",l),null;let c=Object.entries(l);if(c.length===0)return null;let[u,d]=c[0];if(!isNaN(Number(u)))return Array.isArray(d)?n(d,`${o}.${u}`):typeof d=="object"&&d!==null&&Object.entries(d).length>0?n([d],`${o}.${u}`):String(d);c.length>1&&console.warn("Item has multiple keys, processing only the first:",u);let f,h,y=u.indexOf(" ");y===-1?(f=u,h=""):(f=u.substring(0,y),h=u.substring(y+1).trim());let v=f.split(/[.#]/)[0],g=v.includes("-"),w={},x={};if(h){let $=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]+))/g,E,j=new Set;for(;(E=$.exec(h))!==null;)if(j.add(E[1]),E[1].startsWith(".")){let ee=E[1].substring(1),$e=E[4];x[ee]=Rs(i,$e)}else if(E[1].startsWith("?")){let ee=E[1].substring(1),$e=E[2]||E[3]||E[4],je;$e==="true"?je=!0:$e==="false"?je=!1:je=Rs(i,$e),je&&(w[ee]="")}else w[E[1]]=E[2]||E[3]||E[4];let K=h,W=[],ie,Ze=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]+))/g;for(;(ie=Ze.exec(h))!==null;)W.push(ie[0]);W.forEach(ee=>{K=K.replace(ee," ")});let et=/\b(\S+?)(?=\s|$)/g,U;for(;(U=et.exec(K))!==null;){let ee=U[1];!j.has(ee)&&!ee.startsWith(".")&&!ee.includes("=")&&(w[ee]="")}}let _=f.match(/#([^.#\s]+)/);_&&!Object.prototype.hasOwnProperty.call(w,"id")&&(w.id=_[1]);let k=null;w.id?k=w.id:g&&(k=v);let A=Object.create(null),C=null;if(g)C=v;else{let $=f.match(/\.([^.#]+)/g);$&&$.forEach(j=>{let K=j.substring(1);A[K]=!0});let E=f.match(/#([^.#\s]+)/);E&&(C=E[1])}let S;typeof d=="string"||typeof d=="number"?S=String(d):Array.isArray(d)?S=n(d,`${o}.${u}`):S=[],C&&!g&&(w.id=C);let R=Object.create(null);if(k&&r){let $=[];if(Object.keys(r).forEach(E=>{if(E.includes("*")){let j="^"+E.replace(/[.*+?^${}()|[\\\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"$";try{new RegExp(j).test(k)&&$.push(E)}catch(K){console.warn(`[Parser] Invalid regex pattern created from refKey '${E}': ${j}`,K)}}else k===E&&$.push(E)}),$.length>0){$.sort((j,K)=>{let W=!j.includes("*"),ie=!K.includes("*");return W&&!ie?-1:!W&&ie?1:K.length-j.length});let E=$[0];if(r[E]&&r[E].eventListeners){let j=r[E].eventListeners;Object.entries(j).forEach(([K,W])=>{if(W.handler&&W.action)throw new Error("Each listener can have hanlder or action but not both");if(W.action){s.handleCallStoreAction(event,W.payload);return}W.handler&&s[W.handler]?R[K]=ie=>{s[W.handler](ie,W.payload)}:W.handler&&console.warn(`[Parser] Handler '${W.handler}' for refKey '${E}' (matching elementId '${k}') is referenced but not found in available handlers.`)})}}}let P={};if(k)P.key=k;else if(f){let $=o?`${o}.${p}`:String(p);if(P.key=`${f}-${$}`,Object.keys(x).length>0){let E=JSON.stringify(x).substring(0,50);P.key+=`-${E}`}}Object.keys(w).length>0&&(P.attrs=w),Object.keys(A).length>0&&(P.class=A),Object.keys(R).length>0&&(P.on=R),Object.keys(x).length>0&&(P.props=x),g&&(P.hook={update:($,E)=>{let j=$.data?.props||{},K=E.data?.props||{},W=$.data?.attrs||{},ie=E.data?.attrs||{},Ze=JSON.stringify(j)!==JSON.stringify(K),et=JSON.stringify(W)!==JSON.stringify(ie);if(Ze||et){let U=E.elm;U&&U.render&&typeof U.render=="function"&&(U.setAttribute("isDirty","true"),requestAnimationFrame(()=>{if(U.render(),U.removeAttribute("isDirty"),U.handlers&&U.handlers.handleOnUpdate){let ee={...U.deps||{},store:U.store,render:U.render.bind(U),handlers:U.handlers,dispatchEvent:U.dispatchEvent.bind(U),refIds:U.refIds||{},getRefIds:()=>U.refIds||{}};U.handlers.handleOnUpdate({oldProps:j,newProps:K,oldAttrs:W,newAttrs:ie},ee)}}))}}});try{return e(v,P,S)}catch($){return console.error("Error creating virtual node:",$,{tagName:v,snabbdomData:P,childrenOrText:S}),e("div",{},["Error creating element"])}}).filter(Boolean)}return n(t)};var al=(e,t)=>{if(!t||typeof t!="object")return"";let r="",s=n=>Object.entries(n).map(([a,o])=>` ${a}: ${o};`).join(`
|
|
927
|
+
`),i=(n,a)=>{if(typeof a!="object"||a===null)return"";if(n.startsWith("@")){let o=Object.entries(a).map(([l,p])=>{let c=s(p);return` ${l} {
|
|
928
|
+
${c.split(`
|
|
929
|
+
`).map(u=>u?` ${u}`:"").join(`
|
|
809
930
|
`)}
|
|
810
931
|
}`}).join(`
|
|
811
932
|
`);return`${n} {
|
|
@@ -814,7 +935,7 @@ ${o}
|
|
|
814
935
|
${o}
|
|
815
936
|
}`}};return Object.entries(t).forEach(([n,a])=>{let o=i(n,a);o&&(r+=(r?`
|
|
816
937
|
|
|
817
|
-
`:"")+o)}),r},
|
|
938
|
+
`:"")+o)}),r},ol=e=>{let t=e.map(r=>r.subscribe());return()=>{for(let r of t)r&&typeof r.unsubscribe=="function"&&r.unsubscribe()}};function ll(e){return new Proxy({},{get(t,r){if(typeof r=="string"){let s=e.getAttribute(r);return s===""?!0: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(t,r){return typeof r=="string"&&e.hasAttribute(r)},ownKeys(){return e.getAttributeNames()},getOwnPropertyDescriptor(t,r){if(typeof r=="string"&&e.hasAttribute(r))return{configurable:!0,enumerable:!0,get:()=>e.getAttribute(r)}}})}function pl(e,t){let r=new Set(t);return new Proxy({},{get(s,i){if(typeof i=="string"&&r.has(i))return 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(s,i){return typeof i=="string"&&r.has(i)},ownKeys(){return[...r]},getOwnPropertyDescriptor(s,i){if(typeof i=="string"&&r.has(i))return{configurable:!0,enumerable:!0,get:()=>e[i]}}})}var or=class extends HTMLElement{elementName;styles;h;store;props;propsSchema;template;handlers;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_oldVNode;deps;cssText;static get observedAttributes(){return["key"]}get viewData(){let t={};return this.store.selectViewData&&(t=this.store.selectViewData()),t}connectedCallback(){this.shadow=this.attachShadow({mode:"open"});let t=new CSSStyleSheet;t.replaceSync(`
|
|
818
939
|
a, a:link, a:visited, a:hover, a:active {
|
|
819
940
|
display: contents;
|
|
820
941
|
color: inherit;
|
|
@@ -826,4 +947,4 @@ ${o}
|
|
|
826
947
|
font: inherit;
|
|
827
948
|
cursor: pointer;
|
|
828
949
|
}
|
|
829
|
-
`);let r=[t];if(this.cssText){let i=new CSSStyleSheet;i.replaceSync(this.cssText),r.push(i)}this.shadow.adoptedStyleSheets=r,this.renderTarget=document.createElement("div"),this.renderTarget.style.cssText="display: contents;",this.shadow.appendChild(this.renderTarget),this.transformedHandlers={},this.renderTarget.parentNode||this.appendChild(this.renderTarget),this.style.display="contents";let s={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this)};Object.keys(this.handlers||{}).forEach(i=>{this.transformedHandlers[i]=n=>this.handlers[i](n,s)}),this.handlers?.subscriptions&&(this.unsubscribeAll=Hi(this.handlers.subscriptions(s))),this.handlers?.handleOnMount&&(this._unmountCallback=this.handlers?.handleOnMount(s)),this.render()}disconnectedCallback(){this._unmountCallback&&this._unmountCallback(),this.unsubscribeAll&&this.unsubscribeAll()}attributeChangedCallback(t,r,s){r!==s&&this.render&&requestAnimationFrame(()=>{this.render()})}render=()=>{if(!this.patch){console.error("Patch function is not defined!");return}if(!this.template){console.error("Template is not defined!");return}try{let t={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this),store:this.store,render:this.render.bind(this)},r=fr({h:this.h,template:this.template,viewData:this.viewData,refs:this.refs,handlers:this.transformedHandlers}),s={},i=n=>{n.data?.attrs&&n.data.attrs.id&&(s[n.data.attrs.id]=n),n.children&&n.children.forEach(i)};i(r),this.refIds=s,this._oldVNode?this._oldVNode=this.patch(this._oldVNode,r):this._oldVNode=this.patch(this.renderTarget,r)}catch(t){console.error("Error during patching:",t)}}},Ui=(e,t,r)=>{let{INITIAL_STATE:s,toViewData:i,...n}=e,a={},o={},l=structuredClone(s);return Object.entries(n).forEach(([h,u])=>{h.startsWith("select")?a[h]=(...y)=>u({state:l,props:t,attrs:r},...y):o[h]=y=>(l=or(l,E=>u(E,y)),l)}),{toViewData:()=>i({state:l,props:t,attrs:r}),getState:()=>l,...o,...a}},qi=({handlers:e,view:t,store:r,patch:s,h:i},n)=>{let{elementName:a,propsSchema:o,template:l,refs:h,styles:u}=t;if(!s)throw new Error("Patch is not defined");if(!i)throw new Error("h is not defined");if(!t)throw new Error("view is not defined");class y extends yt{static get observedAttributes(){return["key"]}constructor(){super();let T=Bi(this);this.propsSchema=o,this.props=o?Ki(this,Object.keys(o.properties)):{},this.elementName=a,this.styles=u,this.store=Ui(r,this.props,T),this.template=l,this.handlers=e,this.refs=h,this.patch=s,this.deps={...n,store:this.store,render:this.render,handlers:e,attrs:T,props:this.props},this.h=i,this.cssText=Fi(a,u)}}return y},gt=qi;function te(e,t,r,s,i){let n=t===void 0?void 0:t.key;return{sel:e,data:t,children:r,text:s,elm:i,key:n}}var le=Array.isArray;function pe(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function Ji(e,t){return document.createElement(e,t)}function Yi(e,t,r){return document.createElementNS(e,t,r)}function Gi(){return re(document.createDocumentFragment())}function Xi(e){return document.createTextNode(e)}function Qi(e){return document.createComment(e)}function Zi(e,t,r){if(G(e)){let s=e;for(;s&&G(s);)s=re(s).parent;e=s??e}G(t)&&(t=re(t,e)),r&&G(r)&&(r=re(r).firstChildNode),e.insertBefore(t,r)}function en(e,t){e.removeChild(t)}function tn(e,t){G(t)&&(t=re(t,e)),e.appendChild(t)}function yr(e){if(G(e)){for(;e&&G(e);)e=re(e).parent;return e??null}return e.parentNode}function rn(e){var t;if(G(e)){let r=re(e),s=yr(r);if(s&&r.lastChildNode){let i=Array.from(s.childNodes),n=i.indexOf(r.lastChildNode);return(t=i[n+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function sn(e){return e.tagName}function nn(e,t){e.textContent=t}function an(e){return e.textContent}function on(e){return e.nodeType===1}function ln(e){return e.nodeType===3}function pn(e){return e.nodeType===8}function G(e){return e.nodeType===11}function re(e,t){var r,s,i;let n=e;return(r=n.parent)!==null&&r!==void 0||(n.parent=t??null),(s=n.firstChildNode)!==null&&s!==void 0||(n.firstChildNode=e.firstChild),(i=n.lastChildNode)!==null&&i!==void 0||(n.lastChildNode=e.lastChild),n}var gr={createElement:Ji,createElementNS:Yi,createTextNode:Xi,createDocumentFragment:Gi,createComment:Qi,insertBefore:Zi,removeChild:en,appendChild:tn,parentNode:yr,nextSibling:rn,tagName:sn,setTextContent:nn,getTextContent:an,isElement:on,isText:ln,isComment:pn,isDocumentFragment:G};function Ce(e){return e===void 0}function W(e){return e!==void 0}var bt=te("",{},[],void 0,void 0);function fe(e,t){var r,s;let i=e.key===t.key,n=((r=e.data)===null||r===void 0?void 0:r.is)===((s=t.data)===null||s===void 0?void 0:s.is),a=e.sel===t.sel,o=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return a&&i&&n&&o}function cn(){throw new Error("The document fragment is not supported on this platform.")}function hn(e,t){return e.isElement(t)}function dn(e,t){return e.isDocumentFragment(t)}function un(e,t,r){var s;let i={};for(let n=t;n<=r;++n){let a=(s=e[n])===null||s===void 0?void 0:s.key;a!==void 0&&(i[a]=n)}return i}var fn=["create","update","remove","destroy","pre","post"];function br(e,t,r){let s={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=t!==void 0?t:gr;for(let p of fn)for(let c of e){let d=c[p];d!==void 0&&s[p].push(d)}function n(p){let c=p.id?"#"+p.id:"",d=p.getAttribute("class"),f=d?"."+d.split(" ").join("."):"";return te(i.tagName(p).toLowerCase()+c+f,{},[],void 0,p)}function a(p){return te(void 0,{},[],void 0,p)}function o(p,c){return function(){if(--c===0){let f=i.parentNode(p);f!==null&&i.removeChild(f,p)}}}function l(p,c){var d,f,g,_;let m,x=p.data;if(x!==void 0){let w=(d=x.hook)===null||d===void 0?void 0:d.init;W(w)&&(w(p),x=p.data)}let b=p.children,k=p.sel;if(k==="!")Ce(p.text)&&(p.text=""),p.elm=i.createComment(p.text);else if(k==="")p.elm=i.createTextNode(p.text);else if(k!==void 0){let w=k.indexOf("#"),A=k.indexOf(".",w),C=w>0?w:k.length,S=A>0?A:k.length,v=w!==-1||A!==-1?k.slice(0,Math.min(C,S)):k,I=p.elm=W(x)&&W(m=x.ns)?i.createElementNS(m,v,x):i.createElement(v,x);for(C<S&&I.setAttribute("id",k.slice(C+1,S)),A>0&&I.setAttribute("class",k.slice(S+1).replace(/\./g," ")),m=0;m<s.create.length;++m)s.create[m](bt,p);if(pe(p.text)&&(!le(b)||b.length===0)&&i.appendChild(I,i.createTextNode(p.text)),le(b))for(m=0;m<b.length;++m){let R=b[m];R!=null&&i.appendChild(I,l(R,c))}let P=p.data.hook;W(P)&&((f=P.create)===null||f===void 0||f.call(P,bt,p),P.insert&&c.push(p))}else if(!((g=r?.experimental)===null||g===void 0)&&g.fragments&&p.children){for(p.elm=((_=i.createDocumentFragment)!==null&&_!==void 0?_:cn)(),m=0;m<s.create.length;++m)s.create[m](bt,p);for(m=0;m<p.children.length;++m){let w=p.children[m];w!=null&&i.appendChild(p.elm,l(w,c))}}else p.elm=i.createTextNode(p.text);return p.elm}function h(p,c,d,f,g,_){for(;f<=g;++f){let m=d[f];m!=null&&i.insertBefore(p,l(m,_),c)}}function u(p){var c,d;let f=p.data;if(f!==void 0){(d=(c=f?.hook)===null||c===void 0?void 0:c.destroy)===null||d===void 0||d.call(c,p);for(let g=0;g<s.destroy.length;++g)s.destroy[g](p);if(p.children!==void 0)for(let g=0;g<p.children.length;++g){let _=p.children[g];_!=null&&typeof _!="string"&&u(_)}}}function y(p,c,d,f){for(var g,_;d<=f;++d){let m,x,b=c[d];if(b!=null)if(W(b.sel)){u(b),m=s.remove.length+1,x=o(b.elm,m);for(let w=0;w<s.remove.length;++w)s.remove[w](b,x);let k=(_=(g=b?.data)===null||g===void 0?void 0:g.hook)===null||_===void 0?void 0:_.remove;W(k)?k(b,x):x()}else b.children?(u(b),y(p,b.children,0,b.children.length-1)):i.removeChild(p,b.elm)}}function E(p,c,d,f){let g=0,_=0,m=c.length-1,x=c[0],b=c[m],k=d.length-1,w=d[0],A=d[k],C,S,v,I;for(;g<=m&&_<=k;)x==null?x=c[++g]:b==null?b=c[--m]:w==null?w=d[++_]:A==null?A=d[--k]:fe(x,w)?(T(x,w,f),x=c[++g],w=d[++_]):fe(b,A)?(T(b,A,f),b=c[--m],A=d[--k]):fe(x,A)?(T(x,A,f),i.insertBefore(p,x.elm,i.nextSibling(b.elm)),x=c[++g],A=d[--k]):fe(b,w)?(T(b,w,f),i.insertBefore(p,b.elm,x.elm),b=c[--m],w=d[++_]):(C===void 0&&(C=un(c,g,m)),S=C[w.key],Ce(S)?(i.insertBefore(p,l(w,f),x.elm),w=d[++_]):Ce(C[A.key])?(i.insertBefore(p,l(A,f),i.nextSibling(b.elm)),A=d[--k]):(v=c[S],v.sel!==w.sel?i.insertBefore(p,l(w,f),x.elm):(T(v,w,f),c[S]=void 0,i.insertBefore(p,v.elm,x.elm)),w=d[++_]));_<=k&&(I=d[k+1]==null?null:d[k+1].elm,h(p,I,d,_,k,f)),g<=m&&y(p,c,g,m)}function T(p,c,d){var f,g,_,m,x,b,k,w;let A=(f=c.data)===null||f===void 0?void 0:f.hook;(g=A?.prepatch)===null||g===void 0||g.call(A,p,c);let C=c.elm=p.elm;if(p===c)return;if(c.data!==void 0||W(c.text)&&c.text!==p.text){(_=c.data)!==null&&_!==void 0||(c.data={}),(m=p.data)!==null&&m!==void 0||(p.data={});for(let I=0;I<s.update.length;++I)s.update[I](p,c);(k=(b=(x=c.data)===null||x===void 0?void 0:x.hook)===null||b===void 0?void 0:b.update)===null||k===void 0||k.call(b,p,c)}let S=p.children,v=c.children;Ce(c.text)?W(S)&&W(v)?S!==v&&E(C,S,v,d):W(v)?(W(p.text)&&i.setTextContent(C,""),h(C,null,v,0,v.length-1,d)):W(S)?y(C,S,0,S.length-1):W(p.text)&&i.setTextContent(C,""):p.text!==c.text&&(W(S)&&y(C,S,0,S.length-1),i.setTextContent(C,c.text)),(w=A?.postpatch)===null||w===void 0||w.call(A,p,c)}return function(c,d){let f,g,_,m=[];for(f=0;f<s.pre.length;++f)s.pre[f]();for(hn(i,c)?c=n(c):dn(i,c)&&(c=a(c)),fe(c,d)?T(c,d,m):(g=c.elm,_=i.parentNode(g),l(d,m),_!==null&&(i.insertBefore(_,d.elm,i.nextSibling(g)),y(_,[c],0,0))),f=0;f<m.length;++f)m[f].data.hook.insert(m[f]);for(f=0;f<s.post.length;++f)s.post[f]();return d}}function vr(e,t){let r,s,i=t.elm,n=e.data.class,a=t.data.class;if(!(!n&&!a)&&n!==a){n=n||{},a=a||{};for(s in n)n[s]&&!Object.prototype.hasOwnProperty.call(a,s)&&i.classList.remove(s);for(s in a)r=a[s],r!==n[s]&&i.classList[r?"add":"remove"](s)}}var wr={create:vr,update:vr};function xr(e,t){let r,s,i,n=t.elm,a=e.data.props,o=t.data.props;if(!(!a&&!o)&&a!==o){a=a||{},o=o||{};for(r in o)s=o[r],i=a[r],i!==s&&(r!=="value"||n[r]!==s)&&(n[r]=s)}}var _r={create:xr,update:xr};var mn="http://www.w3.org/1999/xlink",yn="http://www.w3.org/2000/xmlns/",gn="http://www.w3.org/XML/1998/namespace";function Sr(e,t){let r,s=t.elm,i=e.data.attrs,n=t.data.attrs;if(!(!i&&!n)&&i!==n){i=i||{},n=n||{};for(r in n){let a=n[r];i[r]!==a&&(a===!0?s.setAttribute(r,""):a===!1?s.removeAttribute(r):r.charCodeAt(0)!==120?s.setAttribute(r,a):r.charCodeAt(3)===58?s.setAttributeNS(gn,r,a):r.charCodeAt(5)===58?r.charCodeAt(1)===109?s.setAttributeNS(yn,r,a):s.setAttributeNS(mn,r,a):s.setAttribute(r,a))}for(r in i)r in n||s.removeAttribute(r)}}var kr={create:Sr,update:Sr};var Er=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,bn=function(e){Er(function(){Er(e)})},vt=!1;function vn(e,t,r){bn(function(){e[t]=r})}function Ar(e,t){let r,s,i=t.elm,n=e.data.style,a=t.data.style;if(!n&&!a||n===a)return;n=n||{},a=a||{};let o="delayed"in n;for(s in n)s in a||(s[0]==="-"&&s[1]==="-"?i.style.removeProperty(s):i.style[s]="");for(s in a)if(r=a[s],s==="delayed"&&a.delayed)for(let l in a.delayed)r=a.delayed[l],(!o||r!==n.delayed[l])&&vn(i.style,l,r);else s!=="remove"&&r!==n[s]&&(s[0]==="-"&&s[1]==="-"?i.style.setProperty(s,r):i.style[s]=r)}function wn(e){let t,r,s=e.elm,i=e.data.style;if(!(!i||!(t=i.destroy)))for(r in t)s.style[r]=t[r]}function xn(e,t){let r=e.data.style;if(!r||!r.remove){t();return}vt||(e.elm.offsetLeft,vt=!0);let s,i=e.elm,n=0,a=r.remove,o=0,l=[];for(s in a)l.push(s),i.style[s]=a[s];let u=getComputedStyle(i)["transition-property"].split(", ");for(;n<u.length;++n)l.indexOf(u[n])!==-1&&o++;i.addEventListener("transitionend",function(y){y.target===i&&--o,o===0&&t()})}function _n(){vt=!1}var $r={pre:_n,create:Ar,update:Ar,destroy:wn,remove:xn};function Cr(e,t,r){if(typeof e=="function")e.call(t,r,t);else if(typeof e=="object")for(let s=0;s<e.length;s++)Cr(e[s],t,r)}function Sn(e,t){let r=e.type,s=t.data.on;s&&s[r]&&Cr(s[r],t,e)}function kn(){return function e(t){Sn(t,e.vnode)}}function wt(e,t){let r=e.data.on,s=e.listener,i=e.elm,n=t&&t.data.on,a=t&&t.elm,o;if(r!==n){if(r&&s)if(n)for(o in r)n[o]||i.removeEventListener(o,s,!1);else for(o in r)i.removeEventListener(o,s,!1);if(n){let l=t.listener=e.listener||kn();if(l.vnode=t,r)for(o in n)r[o]||a.addEventListener(o,l,!1);else for(o in n)a.addEventListener(o,l,!1)}}}var Or={create:wt,update:wt,destroy:wt};var En=()=>br([wr,_r,kr,$r,Or]),xt=En;function Ir(e,t,r){if(e.ns="http://www.w3.org/2000/svg",r!=="foreignObject"&&t!==void 0)for(let s=0;s<t.length;++s){let i=t[s];if(typeof i=="string")continue;let n=i.data;n!==void 0&&Ir(n,i.children,i.sel)}}function _t(e,t,r){let s={},i,n,a;if(r!==void 0?(t!==null&&(s=t),le(r)?i=r:pe(r)?n=r.toString():r&&r.sel&&(i=[r])):t!=null&&(le(t)?i=t:pe(t)?n=t.toString():t&&t.sel?i=[t]:s=t),i!==void 0)for(a=0;a<i.length;++a)pe(i[a])&&(i[a]=te(void 0,void 0,void 0,i[a],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&Ir(s,i,e),te(e,s,i,n,void 0)}var An={},Tr={components:An},Lr=xt();var Oe={components:{dialog:{handlers:Re,store:ze,view:Rt},dropdownMenu:{handlers:We,store:Fe,view:zt},form:{handlers:He,store:Be,view:Wt},navbar:{handlers:Ke,store:Ue,view:Ft},pageOutline:{handlers:qe,store:Je,view:Bt},popover:{handlers:Ye,store:Ge,view:Kt},select:{handlers:Xe,store:Qe,view:Ut},sidebar:{handlers:Ze,store:tt,view:qt},sliderInput:{handlers:rt,store:st,view:Jt},table:{handlers:it,store:nt,view:Yt}}};Object.keys(Oe).forEach(e=>{Object.keys(Oe[e]).forEach(t=>{let r=gt({...Oe[e][t],patch:Lr,h:_t},Tr[e]);customElements.define(Oe[e][t].view.elementName,r)})});customElements.define("rtgl-button",At({}));customElements.define("rtgl-view",Ot({}));customElements.define("rtgl-text",Tt({}));customElements.define("rtgl-image",Lt({}));customElements.define("rtgl-svg",jt({}));customElements.define("rtgl-input",Pt({}));customElements.define("rtgl-textarea",Vt({}));customElements.define("rtgl-color-picker",Dt({}));customElements.define("rtgl-slider",Mt({}));})();
|
|
950
|
+
`);let r=[t];if(this.cssText){let i=new CSSStyleSheet;i.replaceSync(this.cssText),r.push(i)}this.shadow.adoptedStyleSheets=r,this.renderTarget=document.createElement("div"),this.renderTarget.style.cssText="display: contents;",this.shadow.appendChild(this.renderTarget),this.renderTarget.parentNode||this.appendChild(this.renderTarget),this.style.display="contents";let s={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this)};if(this.transformedHandlers={handleCallStoreAction:(i,n)=>{let{render:a,store:o}=s,l=ar(n,{event:{target:i.target,detail:i.detail}});o[n.action](l),a()}},Object.keys(this.handlers||{}).forEach(i=>{this.transformedHandlers[i]=(n,a)=>this.handlers[i](s,n,a)}),this.handlers?.handleBeforeMount&&(this._unmountCallback=this.handlers?.handleBeforeMount(s),this._unmountCallback&&typeof this._unmountCallback.then=="function"))throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");this.render(),this.handlers?.handleAfterMount&&this.handlers?.handleAfterMount(s),this.handlers?.subscriptions&&(this.unsubscribeAll=ol(this.handlers.subscriptions(s)))}disconnectedCallback(){this._unmountCallback&&this._unmountCallback(),this.unsubscribeAll&&this.unsubscribeAll()}attributeChangedCallback(t,r,s){if(r!==s&&this.render)if(this.handlers?.handleOnUpdate){let i={oldAttrs:{[t]:r},newAttrs:{[t]:s}},n={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this),store:this.store,render:this.render.bind(this)};this.handlers.handleOnUpdate(i,n)}else requestAnimationFrame(()=>{this.render()})}render=()=>{if(!this.patch){console.error("Patch function is not defined!");return}if(!this.template){console.error("Template is not defined!");return}try{let t={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this),store:this.store,render:this.render.bind(this)},r=Vs({h:this.h,template:this.template,viewData:this.viewData,refs:this.refs,handlers:this.transformedHandlers}),s={},i=n=>{n.data?.attrs&&n.data.attrs.id&&(s[n.data.attrs.id]=n),n.children&&n.children.forEach(i)};i(r),this.refIds=s,this._oldVNode?this._oldVNode=this.patch(this._oldVNode,r):this._oldVNode=this.patch(this.renderTarget,r)}catch(t){console.error("Error during patching:",t)}}},cl=(e,t,r)=>{let{createInitialState:s,...i}=e,n={},a={},o={};return s&&(o=s()),Object.entries(i).forEach(([l,p])=>{l.startsWith("select")?n[l]=(...c)=>p({state:o,props:t,attrs:r},...c):a[l]=c=>(o=bs(o,u=>p(u,c)),o)}),{getState:()=>o,...a,...n}},ul=({handlers:e,view:t,store:r,patch:s,h:i},n)=>{let{elementName:a,propsSchema:o,attrsSchema:l,template:p,refs:c,styles:u}=t;if(!s)throw new Error("Patch is not defined");if(!i)throw new Error("h is not defined");if(!t)throw new Error("view is not defined");class d extends or{static get observedAttributes(){let h=["key"],y=l?.properties?Object.keys(l.properties):[];return[...h,...y]}constructor(){super();let h=ll(this);this.propsSchema=o,this.props=o?pl(this,Object.keys(o.properties)):{},this.elementName=a,this.styles=u,this.store=cl(r,this.props,h),this.template=p,this.handlers=e,this.refs=c,this.patch=s,this.deps={...n,store:this.store,render:this.render,handlers:e,attrs:h,props:this.props},this.h=i,this.cssText=al(a,u)}}return d},lr=ul;function me(e,t,r,s,i){let n=t===void 0?void 0:t.key;return{sel:e,data:t,children:r,text:s,elm:i,key:n}}var Ae=Array.isArray;function Se(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function hl(e,t){return document.createElement(e,t)}function dl(e,t,r){return document.createElementNS(e,t,r)}function fl(){return ge(document.createDocumentFragment())}function yl(e){return document.createTextNode(e)}function ml(e){return document.createComment(e)}function gl(e,t,r){if(le(e)){let s=e;for(;s&&le(s);)s=ge(s).parent;e=s??e}le(t)&&(t=ge(t,e)),r&&le(r)&&(r=ge(r).firstChildNode),e.insertBefore(t,r)}function vl(e,t){e.removeChild(t)}function bl(e,t){le(t)&&(t=ge(t,e)),e.appendChild(t)}function Ps(e){if(le(e)){for(;e&&le(e);)e=ge(e).parent;return e??null}return e.parentNode}function wl(e){var t;if(le(e)){let r=ge(e),s=Ps(r);if(s&&r.lastChildNode){let i=Array.from(s.childNodes),n=i.indexOf(r.lastChildNode);return(t=i[n+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function xl(e){return e.tagName}function _l(e,t){e.textContent=t}function El(e){return e.textContent}function kl(e){return e.nodeType===1}function Al(e){return e.nodeType===3}function Sl(e){return e.nodeType===8}function le(e){return e.nodeType===11}function ge(e,t){var r,s,i;let n=e;return(r=n.parent)!==null&&r!==void 0||(n.parent=t??null),(s=n.firstChildNode)!==null&&s!==void 0||(n.firstChildNode=e.firstChild),(i=n.lastChildNode)!==null&&i!==void 0||(n.lastChildNode=e.lastChild),n}var js={createElement:hl,createElementNS:dl,createTextNode:yl,createDocumentFragment:fl,createComment:ml,insertBefore:gl,removeChild:vl,appendChild:bl,parentNode:Ps,nextSibling:wl,tagName:xl,setTextContent:_l,getTextContent:El,isElement:kl,isText:Al,isComment:Sl,isDocumentFragment:le};function Xe(e){return e===void 0}function X(e){return e!==void 0}var pr=me("",{},[],void 0,void 0);function Pe(e,t){var r,s;let i=e.key===t.key,n=((r=e.data)===null||r===void 0?void 0:r.is)===((s=t.data)===null||s===void 0?void 0:s.is),a=e.sel===t.sel,o=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return a&&i&&n&&o}function $l(){throw new Error("The document fragment is not supported on this platform.")}function Cl(e,t){return e.isElement(t)}function Ol(e,t){return e.isDocumentFragment(t)}function Il(e,t,r){var s;let i={};for(let n=t;n<=r;++n){let a=(s=e[n])===null||s===void 0?void 0:s.key;a!==void 0&&(i[a]=n)}return i}var Tl=["create","update","remove","destroy","pre","post"];function Ds(e,t,r){let s={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=t!==void 0?t:js;for(let h of Tl)for(let y of e){let v=y[h];v!==void 0&&s[h].push(v)}function n(h){let y=h.id?"#"+h.id:"",v=h.getAttribute("class"),g=v?"."+v.split(" ").join("."):"";return me(i.tagName(h).toLowerCase()+y+g,{},[],void 0,h)}function a(h){return me(void 0,{},[],void 0,h)}function o(h,y){return function(){if(--y===0){let g=i.parentNode(h);g!==null&&i.removeChild(g,h)}}}function l(h,y){var v,g,w,x;let _,k=h.data;if(k!==void 0){let S=(v=k.hook)===null||v===void 0?void 0:v.init;X(S)&&(S(h),k=h.data)}let A=h.children,C=h.sel;if(C==="!")Xe(h.text)&&(h.text=""),h.elm=i.createComment(h.text);else if(C==="")h.elm=i.createTextNode(h.text);else if(C!==void 0){let S=C.indexOf("#"),R=C.indexOf(".",S),P=S>0?S:C.length,$=R>0?R:C.length,E=S!==-1||R!==-1?C.slice(0,Math.min(P,$)):C,j=h.elm=X(k)&&X(_=k.ns)?i.createElementNS(_,E,k):i.createElement(E,k);for(P<$&&j.setAttribute("id",C.slice(P+1,$)),R>0&&j.setAttribute("class",C.slice($+1).replace(/\./g," ")),_=0;_<s.create.length;++_)s.create[_](pr,h);if(Se(h.text)&&(!Ae(A)||A.length===0)&&i.appendChild(j,i.createTextNode(h.text)),Ae(A))for(_=0;_<A.length;++_){let W=A[_];W!=null&&i.appendChild(j,l(W,y))}let K=h.data.hook;X(K)&&((g=K.create)===null||g===void 0||g.call(K,pr,h),K.insert&&y.push(h))}else if(!((w=r?.experimental)===null||w===void 0)&&w.fragments&&h.children){for(h.elm=((x=i.createDocumentFragment)!==null&&x!==void 0?x:$l)(),_=0;_<s.create.length;++_)s.create[_](pr,h);for(_=0;_<h.children.length;++_){let S=h.children[_];S!=null&&i.appendChild(h.elm,l(S,y))}}else h.elm=i.createTextNode(h.text);return h.elm}function p(h,y,v,g,w,x){for(;g<=w;++g){let _=v[g];_!=null&&i.insertBefore(h,l(_,x),y)}}function c(h){var y,v;let g=h.data;if(g!==void 0){(v=(y=g?.hook)===null||y===void 0?void 0:y.destroy)===null||v===void 0||v.call(y,h);for(let w=0;w<s.destroy.length;++w)s.destroy[w](h);if(h.children!==void 0)for(let w=0;w<h.children.length;++w){let x=h.children[w];x!=null&&typeof x!="string"&&c(x)}}}function u(h,y,v,g){for(var w,x;v<=g;++v){let _,k,A=y[v];if(A!=null)if(X(A.sel)){c(A),_=s.remove.length+1,k=o(A.elm,_);for(let S=0;S<s.remove.length;++S)s.remove[S](A,k);let C=(x=(w=A?.data)===null||w===void 0?void 0:w.hook)===null||x===void 0?void 0:x.remove;X(C)?C(A,k):k()}else A.children?(c(A),u(h,A.children,0,A.children.length-1)):i.removeChild(h,A.elm)}}function d(h,y,v,g){let w=0,x=0,_=y.length-1,k=y[0],A=y[_],C=v.length-1,S=v[0],R=v[C],P,$,E,j;for(;w<=_&&x<=C;)k==null?k=y[++w]:A==null?A=y[--_]:S==null?S=v[++x]:R==null?R=v[--C]:Pe(k,S)?(f(k,S,g),k=y[++w],S=v[++x]):Pe(A,R)?(f(A,R,g),A=y[--_],R=v[--C]):Pe(k,R)?(f(k,R,g),i.insertBefore(h,k.elm,i.nextSibling(A.elm)),k=y[++w],R=v[--C]):Pe(A,S)?(f(A,S,g),i.insertBefore(h,A.elm,k.elm),A=y[--_],S=v[++x]):(P===void 0&&(P=Il(y,w,_)),$=P[S.key],Xe($)?(i.insertBefore(h,l(S,g),k.elm),S=v[++x]):Xe(P[R.key])?(i.insertBefore(h,l(R,g),i.nextSibling(A.elm)),R=v[--C]):(E=y[$],E.sel!==S.sel?i.insertBefore(h,l(S,g),k.elm):(f(E,S,g),y[$]=void 0,i.insertBefore(h,E.elm,k.elm)),S=v[++x]));x<=C&&(j=v[C+1]==null?null:v[C+1].elm,p(h,j,v,x,C,g)),w<=_&&u(h,y,w,_)}function f(h,y,v){var g,w,x,_,k,A,C,S;let R=(g=y.data)===null||g===void 0?void 0:g.hook;(w=R?.prepatch)===null||w===void 0||w.call(R,h,y);let P=y.elm=h.elm;if(h===y)return;if(y.data!==void 0||X(y.text)&&y.text!==h.text){(x=y.data)!==null&&x!==void 0||(y.data={}),(_=h.data)!==null&&_!==void 0||(h.data={});for(let j=0;j<s.update.length;++j)s.update[j](h,y);(C=(A=(k=y.data)===null||k===void 0?void 0:k.hook)===null||A===void 0?void 0:A.update)===null||C===void 0||C.call(A,h,y)}let $=h.children,E=y.children;Xe(y.text)?X($)&&X(E)?$!==E&&d(P,$,E,v):X(E)?(X(h.text)&&i.setTextContent(P,""),p(P,null,E,0,E.length-1,v)):X($)?u(P,$,0,$.length-1):X(h.text)&&i.setTextContent(P,""):h.text!==y.text&&(X($)&&u(P,$,0,$.length-1),i.setTextContent(P,y.text)),(S=R?.postpatch)===null||S===void 0||S.call(R,h,y)}return function(y,v){let g,w,x,_=[];for(g=0;g<s.pre.length;++g)s.pre[g]();for(Cl(i,y)?y=n(y):Ol(i,y)&&(y=a(y)),Pe(y,v)?f(y,v,_):(w=y.elm,x=i.parentNode(w),l(v,_),x!==null&&(i.insertBefore(x,v.elm,i.nextSibling(w)),u(x,[y],0,0))),g=0;g<_.length;++g)_[g].data.hook.insert(_[g]);for(g=0;g<s.post.length;++g)s.post[g]();return v}}function Bs(e,t){let r,s,i=t.elm,n=e.data.class,a=t.data.class;if(!(!n&&!a)&&n!==a){n=n||{},a=a||{};for(s in n)n[s]&&!Object.prototype.hasOwnProperty.call(a,s)&&i.classList.remove(s);for(s in a)r=a[s],r!==n[s]&&i.classList[r?"add":"remove"](s)}}var Ws={create:Bs,update:Bs};function Ms(e,t){let r,s,i,n=t.elm,a=e.data.props,o=t.data.props;if(!(!a&&!o)&&a!==o){a=a||{},o=o||{};for(r in o)s=o[r],i=a[r],i!==s&&(r!=="value"||n[r]!==s)&&(n[r]=s)}}var Fs={create:Ms,update:Ms};var Ll="http://www.w3.org/1999/xlink",Rl="http://www.w3.org/2000/xmlns/",Vl="http://www.w3.org/XML/1998/namespace";function Ks(e,t){let r,s=t.elm,i=e.data.attrs,n=t.data.attrs;if(!(!i&&!n)&&i!==n){i=i||{},n=n||{};for(r in n){let a=n[r];i[r]!==a&&(a===!0?s.setAttribute(r,""):a===!1?s.removeAttribute(r):r.charCodeAt(0)!==120?s.setAttribute(r,a):r.charCodeAt(3)===58?s.setAttributeNS(Vl,r,a):r.charCodeAt(5)===58?r.charCodeAt(1)===109?s.setAttributeNS(Rl,r,a):s.setAttributeNS(Ll,r,a):s.setAttribute(r,a))}for(r in i)r in n||s.removeAttribute(r)}}var Us={create:Ks,update:Ks};var zs=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,Nl=function(e){zs(function(){zs(e)})},cr=!1;function Pl(e,t,r){Nl(function(){e[t]=r})}function Hs(e,t){let r,s,i=t.elm,n=e.data.style,a=t.data.style;if(!n&&!a||n===a)return;n=n||{},a=a||{};let o="delayed"in n;for(s in n)s in a||(s[0]==="-"&&s[1]==="-"?i.style.removeProperty(s):i.style[s]="");for(s in a)if(r=a[s],s==="delayed"&&a.delayed)for(let l in a.delayed)r=a.delayed[l],(!o||r!==n.delayed[l])&&Pl(i.style,l,r);else s!=="remove"&&r!==n[s]&&(s[0]==="-"&&s[1]==="-"?i.style.setProperty(s,r):i.style[s]=r)}function jl(e){let t,r,s=e.elm,i=e.data.style;if(!(!i||!(t=i.destroy)))for(r in t)s.style[r]=t[r]}function Dl(e,t){let r=e.data.style;if(!r||!r.remove){t();return}cr||(e.elm.offsetLeft,cr=!0);let s,i=e.elm,n=0,a=r.remove,o=0,l=[];for(s in a)l.push(s),i.style[s]=a[s];let c=getComputedStyle(i)["transition-property"].split(", ");for(;n<c.length;++n)l.indexOf(c[n])!==-1&&o++;i.addEventListener("transitionend",function(u){u.target===i&&--o,o===0&&t()})}function Bl(){cr=!1}var Js={pre:Bl,create:Hs,update:Hs,destroy:jl,remove:Dl};function qs(e,t,r){if(typeof e=="function")e.call(t,r,t);else if(typeof e=="object")for(let s=0;s<e.length;s++)qs(e[s],t,r)}function Wl(e,t){let r=e.type,s=t.data.on;s&&s[r]&&qs(s[r],t,e)}function Ml(){return function e(t){Wl(t,e.vnode)}}function ur(e,t){let r=e.data.on,s=e.listener,i=e.elm,n=t&&t.data.on,a=t&&t.elm,o;if(r!==n){if(r&&s)if(n)for(o in r)n[o]||i.removeEventListener(o,s,!1);else for(o in r)i.removeEventListener(o,s,!1);if(n){let l=t.listener=e.listener||Ml();if(l.vnode=t,r)for(o in n)r[o]||a.addEventListener(o,l,!1);else for(o in n)a.addEventListener(o,l,!1)}}}var Gs={create:ur,update:ur,destroy:ur};var Fl=()=>Ds([Ws,Fs,Us,Js,Gs]),hr=Fl;var Kl=e=>{let t={};return{once:(r,s)=>{t[r]||(t[r]=[]);let i=(...n)=>{s(...n),t[r]=t[r].filter(a=>a!==i)};t[r].push(i)},emit:(r,...s)=>{t[r]&&t[r].forEach(i=>{i(...s)})},showAlert:async r=>{if(!e)throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.");e.transformedHandlers.showAlert(r)},showConfirm:async r=>{if(!e)throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.");return e.transformedHandlers.showConfirm(r)}}},Ys=Kl;function Xs(e,t,r){if(e.ns="http://www.w3.org/2000/svg",r!=="foreignObject"&&t!==void 0)for(let s=0;s<t.length;++s){let i=t[s];if(typeof i=="string")continue;let n=i.data;n!==void 0&&Xs(n,i.children,i.sel)}}function dr(e,t,r){let s={},i,n,a;if(r!==void 0?(t!==null&&(s=t),Ae(r)?i=r:Se(r)?n=r.toString():r&&r.sel&&(i=[r])):t!=null&&(Ae(t)?i=t:Se(t)?n=t.toString():t&&t.sel?i=[t]:s=t),i!==void 0)for(a=0;a<i.length;++a)Se(i[a])&&(i[a]=me(void 0,void 0,void 0,i[a],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&Xs(s,i,e),me(e,s,i,n,void 0)}var Ul=Ys(),zl={globalUI:Ul},Qs={components:zl},Zs=hr();var Qe={components:{breadcrumb:{handlers:ht,store:dt,view:Lr},dropdownMenu:{handlers:ft,store:yt,view:Rr},form:{handlers:mt,store:kt,view:Jr},globalUi:{handlers:At,store:St,view:qr},navbar:{handlers:$t,store:Ct,view:Gr},pageOutline:{handlers:Ot,store:It,view:Xr},popoverInput:{handlers:Tt,store:Lt,view:Qr},select:{handlers:Rt,store:Vt,view:Zr},sidebar:{handlers:Nt,store:jt,view:es},sliderInput:{handlers:Dt,store:Bt,view:ts},table:{handlers:Wt,store:Mt,view:rs},tabs:{handlers:Ft,store:Kt,view:ss},tooltip:{handlers:is,store:Ut,view:ns},waveform:{handlers:zt,store:Ht,view:os}}};Object.keys(Qe).forEach(e=>{Object.keys(Qe[e]).forEach(t=>{let r=lr({...Qe[e][t],patch:Zs,h:dr},Qs[e]);customElements.define(Qe[e][t].view.elementName,r)})});customElements.define("rtgl-button",gr({}));customElements.define("rtgl-view",wr({}));customElements.define("rtgl-text",_r({}));customElements.define("rtgl-image",Er({}));customElements.define("rtgl-svg",Ar({}));customElements.define("rtgl-input",Sr({}));customElements.define("rtgl-textarea",$r({}));customElements.define("rtgl-color-picker",Cr({}));customElements.define("rtgl-slider",Or({}));customElements.define("rtgl-dialog",Ir({}));customElements.define("rtgl-popover",Tr({}));})();
|