rettangoli-ui 0.1.0-rc3 → 0.1.0-rc5

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.
@@ -1,18 +1,18 @@
1
- var rettangoli=(()=>{var mr=Object.defineProperty;var D=(e,t)=>{for(var r in t)mr(e,r,{get:t[r],enumerable:!0})};function I(e,...t){let r="";return e.forEach((s,i)=>{r+=s+(t[i]||"")}),r}var gr=["xs","sm","md","lg","xl"],ft={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"},Z=Object.keys(ft),ee=e=>e.concat(gr.flatMap(t=>e.map(r=>`${t}-${r}`))),ut={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)"},F=(e,t={})=>{let r="";for(let[s,i]of Object.entries(ut)){s!=="default"&&(r+=`${i} {`);for(let[n,a]of Object.entries(e)){let o=t[n]?` ${t[n]} `:" ";for(let[l,u]of Object.entries(a)){let m=ft[n],x=u.startsWith("--")?`var(${u})`:u,$=s==="default"?n:`${s}-${n}`,T=s==="default"?`h-${n}`:`${s}-h-${n}`;if(m){let c=m.split(" ").map(h=>`${h}: ${x};`).join(" ");r+=`
2
- :host([${$}="${l}"])${o}{
1
+ var rettangoli=(()=>{var vr=Object.defineProperty;var j=(e,t)=>{for(var r in t)vr(e,r,{get:t[r],enumerable:!0})};function I(e,...t){let r="";return e.forEach((s,i)=>{r+=s+(t[i]||"")}),r}var br=["xs","sm","md","lg","xl"],mt={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"},Z=Object.keys(mt),ee=e=>e.concat(br.flatMap(t=>e.map(r=>`${t}-${r}`))),gt={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)"},H=(e,t={})=>{let r="";for(let[s,i]of Object.entries(gt)){s!=="default"&&(r+=`${i} {`);for(let[n,a]of Object.entries(e)){let o=t[n]?` ${t[n]} `:" ";for(let[l,f]of Object.entries(a)){let m=mt[n],x=f.startsWith("--")?`var(${f})`:f,A=s==="default"?n:`${s}-${n}`,T=s==="default"?`h-${n}`:`${s}-h-${n}`;if(m){let c=m.split(" ").map(h=>`${h}: ${x};`).join(" ");r+=`
2
+ :host([${A}="${l}"])${o}{
3
3
  ${c}
4
4
  }
5
5
  :host([${T}="${l}"]:hover)${o}{
6
6
  ${c}
7
7
  }
8
8
  `}else r+=`
9
- :host([${$}="${l}"])${o}{
10
- ${u}
9
+ :host([${A}="${l}"])${o}{
10
+ ${f}
11
11
  }
12
12
  :host([${T}="${l}"]:hover)${o}{
13
- ${u}
13
+ ${f}
14
14
  }
15
- `}}s!=="default"&&(r+="}")}return r};function yr(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var vr=e=>/%$/.test(e),j=e=>{if(e!==void 0)return vr(e)?e:yr(e)?`${e}px`:Object.keys(E).includes(e)?`var(${E[e]})`:e},E={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function te(e,t=":host"){let r="";for(let[s,i]of Object.entries(ut)){s!=="default"&&(r+=`${i} {
15
+ `}}s!=="default"&&(r+="}")}return r};function wr(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var xr=e=>/%$/.test(e),D=e=>{if(e!==void 0)return xr(e)?e:wr(e)?`${e}px`:Object.keys($).includes(e)?`var(${$[e]})`:e},$={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function te(e,t=":host"){let r="";for(let[s,i]of Object.entries(gt)){s!=="default"&&(r+=`${i} {
16
16
  `);let n="";for(let[a,o]of Object.entries(e[s]))o!=null&&(n+=`${a}: ${o};
17
17
  `);r+=`${t} {
18
18
  ${n.trim()}
@@ -58,7 +58,7 @@ var rettangoli=(()=>{var mr=Object.defineProperty;var D=(e,t)=>{for(var r in t)m
58
58
  :host([flex="12"]) {
59
59
  flex: 12;
60
60
  }
61
- `;var br={mt:E,mr:E,mb:E,ml:E,m:E,mh:E,mv:E,s:{sm:`
61
+ `;var _r={mt:$,mr:$,mb:$,ml:$,m:$,mh:$,mv:$,s:{sm:`
62
62
  height: 28px;
63
63
  padding-left: 12px;
64
64
  padding-right: 12px;
@@ -104,7 +104,7 @@ var rettangoli=(()=>{var mr=Object.defineProperty;var D=(e,t)=>{for(var r in t)m
104
104
  `,lk:`
105
105
  background-color: transparent;
106
106
  color: var(--foreground);
107
- `}},wr={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},mt=F(br,wr);var se=I`
107
+ `}},Sr={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},yt=H(_r,Sr);var se=I`
108
108
  a, a:link, a:visited, a:hover, a:active {
109
109
  color: inherit;
110
110
  text-decoration: none;
@@ -127,7 +127,7 @@ var rettangoli=(()=>{var mr=Object.defineProperty;var D=(e,t)=>{for(var r in t)m
127
127
  flex-direction: row;
128
128
  align-items: center;
129
129
  justify-content: center;
130
- gap: var(--spacing-sm);
130
+ gap: var(--spacing-lg);
131
131
  border-width: 0px;
132
132
  border-style: solid;
133
133
  border-color: var(--border);
@@ -228,15 +228,37 @@ var rettangoli=(()=>{var mr=Object.defineProperty;var D=(e,t)=>{for(var r in t)m
228
228
  text-decoration: underline;
229
229
  }
230
230
 
231
+ /* Square button styles */
232
+ :host([sq]) button {
233
+ width: 32px;
234
+ height: 32px;
235
+ padding: 0;
236
+ gap: 0;
237
+ }
238
+
239
+ :host([sq][s="sm"]) button {
240
+ width: 24px;
241
+ height: 24px;
242
+ padding: 0;
243
+ gap: 0;
244
+ }
245
+
246
+ :host([sq][s="lg"]) button {
247
+ width: 40px;
248
+ height: 40px;
249
+ padding: 0;
250
+ gap: 0;
251
+ }
252
+
231
253
  ${se}
232
254
 
233
255
  a {
234
256
  display: contents;
235
257
  }
236
258
 
237
- ${mt}
259
+ ${yt}
238
260
  ${re}
239
- `))}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"]}connectedCallback(){this._updateButton()}attributeChangedCallback(t,r,s){this._updateButton()}_updateButton(){this.shadow.innerHTML="",this._updateIcon(),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=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._buttonElement.insertBefore(this._iconElement,this._slotElement)}}_updateWidth(){let t=j(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="")}},gt=({render:e,html:t})=>$e;var yt=I`
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=D(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="")}},vt=({render:e,html:t})=>$e;var bt=I`
240
262
 
241
263
  :host([d="h"]) {
242
264
  flex-direction: row;
@@ -307,7 +329,7 @@ var rettangoli=(()=>{var mr=Object.defineProperty;var D=(e,t)=>{for(var r in t)m
307
329
  justify-content: center;
308
330
  }
309
331
  }
310
- `;var xr={cur:{p:"pointer",m:"move",grab:"grab",grabbing:"grabbing"}},H=F(xr);var vt=I`
332
+ `;var kr={cur:{p:"pointer",m:"move",grab:"grab",grabbing:"grabbing"}},F=H(kr);var wt=I`
311
333
  :host([sh]:not([sv])) {
312
334
  overflow-x: scroll;
313
335
  flex-wrap: nowrap;
@@ -325,7 +347,7 @@ var rettangoli=(()=>{var mr=Object.defineProperty;var D=(e,t)=>{for(var r in t)m
325
347
  flex-wrap: nowrap;
326
348
  }
327
349
 
328
- `;var le={xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},_r={bgc:{pr:`
350
+ `;var le={xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},Ar={bgc:{pr:`
329
351
  background-color: var(--primary);
330
352
  `,se:`
331
353
  background-color: var(--secondary);
@@ -365,7 +387,7 @@ var rettangoli=(()=>{var mr=Object.defineProperty;var D=(e,t)=>{for(var r in t)m
365
387
  left: 0;
366
388
  top: 0;
367
389
  height: 100%;
368
- `},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:E,pr:E,pb:E,pl:E,p:E,ph:E,pv:E,g:E,gv:E,gh:E,bw:le,bwt:le,bwr:le,bwb:le,bwl:le,bc:{p:"--color-primary",pc:"--color-primary-container",s:"--color-secondary",sc:"--color-secondary-container",e:"--color-error",ec:"--color-error-container",su:"--color-surface",sucl:"--color-surface-container-low",suc:"--color-surface-container",such:"--color-surface-container-high",isu:"--color-inverse-surface",o:"--color-outline",ov:"--color-outline-variant"},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=F(_r);var Sr={mt:E,mr:E,mb:E,ml:E,m:E,mh:E,mv:E},U=F(Sr);var Oe=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
390
+ `},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:$,pr:$,pb:$,pl:$,p:$,ph:$,pv:$,g:$,gv:$,gh:$,bw:le,bwt:le,bwr:le,bwb:le,bwl:le,bc:{p:"--color-primary",pc:"--color-primary-container",s:"--color-secondary",sc:"--color-secondary-container",e:"--color-error",ec:"--color-error-container",su:"--color-surface",sucl:"--color-surface-container-low",suc:"--color-surface-container",such:"--color-surface-container-high",isu:"--color-inverse-surface",o:"--color-outline",ov:"--color-outline-variant"},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=H(Ar);var Er={mt:$,mr:$,mb:$,ml:$,m:$,mh:$,mv:$},U=H(Er);var Oe=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
369
391
  slot {
370
392
  display: contents;
371
393
  }
@@ -385,10 +407,10 @@ var rettangoli=(()=>{var mr=Object.defineProperty;var D=(e,t)=>{for(var r in t)m
385
407
  }
386
408
 
387
409
  ${re}
388
- ${vt}
389
- ${yt}
410
+ ${wt}
411
+ ${bt}
390
412
  ${U}
391
- ${H}
413
+ ${F}
392
414
  ${de}
393
415
  ${se}
394
416
 
@@ -405,7 +427,7 @@ var rettangoli=(()=>{var mr=Object.defineProperty;var D=(e,t)=>{for(var r in t)m
405
427
  bottom: 0;
406
428
  z-index: 1;
407
429
  }
408
- `))}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",...ee([...Z,"wh","w","h","hidden","sh","sv"])]}_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)}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=$=>`${n==="default"?"":`${n}-`}${$}`,o=this.getAttribute(a("wh")),l=j(o===null?this.getAttribute(a("w")):o),u=j(o===null?this.getAttribute(a("h")):o),m=this.getAttribute(a("op")),x=this.getAttribute(a("z"));x!==null&&(this._styles[n]["z-index"]=x),m!==null&&(this._styles[n].opacity=m),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),u==="f"?this._styles[n].height="100%":u!==void 0&&(this._styles[n].height=u,this._styles[n]["min-height"]=u,this._styles[n]["max-height"]=u),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="flex !important")});let i=te(this._styles);i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}},bt=({render:e,html:t})=>Oe;var kr={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
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",...ee([...Z,"wh","w","h","hidden","sh","sv"])]}_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)}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=A=>`${n==="default"?"":`${n}-`}${A}`,o=this.getAttribute(a("wh")),l=D(o===null?this.getAttribute(a("w")):o),f=D(o===null?this.getAttribute(a("h")):o),m=this.getAttribute(a("op")),x=this.getAttribute(a("z"));x!==null&&(this._styles[n]["z-index"]=x),m!==null&&(this._styles[n].opacity=m),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),f==="f"?this._styles[n].height="100%":f!==void 0&&(this._styles[n].height=f,this._styles[n]["min-height"]=f,this._styles[n]["max-height"]=f),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="flex !important")});let i=te(this._styles);i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}},xt=({render:e,html:t})=>Oe;var $r={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
409
431
  font-size: var(--h1-font-size);
410
432
  font-weight: var(--h1-font-weight);
411
433
  line-height: var(--h1-line-height);
@@ -445,7 +467,7 @@ var rettangoli=(()=>{var mr=Object.defineProperty;var D=(e,t)=>{for(var r in t)m
445
467
  font-weight: var(--xs-font-weight);
446
468
  line-height: var(--xs-line-height);
447
469
  letter-spacing: var(--xs-letter-spacing);
448
- `}},wt=F(kr);var Ar={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},fe=F(Ar);var Ce=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
470
+ `}},_t=H($r);var Or={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},ue=H(Or);var Ce=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
449
471
  :host {
450
472
  display: block;
451
473
  font-size: var(--md-font-size);
@@ -476,11 +498,11 @@ var rettangoli=(()=>{var mr=Object.defineProperty;var D=(e,t)=>{for(var r in t)m
476
498
  bottom: 0;
477
499
  z-index: 1;
478
500
  }
479
- ${wt}
480
- ${fe}
501
+ ${_t}
502
+ ${ue}
481
503
  ${U}
482
- ${H}
483
- `))}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=j(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)}},xt=({render:e,html:t})=>Ce;var Ie=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
504
+ ${F}
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=D(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)}},St=({render:e,html:t})=>Ce;var Ie=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
484
506
  :host {
485
507
  border-style: solid;
486
508
  box-sizing: border-box;
@@ -518,8 +540,8 @@ var rettangoli=(()=>{var mr=Object.defineProperty;var D=(e,t)=>{for(var r in t)m
518
540
 
519
541
  ${de}
520
542
  ${U}
521
- ${H}
522
- `))}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 ee([...Z,"key","src","href","target","wh","w","h","hidden","height","width"])}_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=$=>`${n==="default"?"":`${n}-`}${$}`,o=this.getAttribute(a("wh")),l=j(o===null?this.getAttribute(a("w")):o),u=j(o===null?this.getAttribute(a("h")):o),m=this.getAttribute(a("o")),x=this.getAttribute(a("z"));x!==null&&(this._styles[n]["z-index"]=x),m!==null&&(this._styles[n].opacity=m),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),u==="f"?this._styles[n].height="100%":u!==void 0&&(this._styles[n].height=u,this._styles[n]["min-height"]=u,this._styles[n]["max-height"]=u),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=te(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()}},_t=({render:e,html:t})=>Ie;var St=I`
543
+ ${F}
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 ee([...Z,"key","src","href","target","wh","w","h","hidden","height","width"])}_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=A=>`${n==="default"?"":`${n}-`}${A}`,o=this.getAttribute(a("wh")),l=D(o===null?this.getAttribute(a("w")):o),f=D(o===null?this.getAttribute(a("h")):o),m=this.getAttribute(a("o")),x=this.getAttribute(a("z"));x!==null&&(this._styles[n]["z-index"]=x),m!==null&&(this._styles[n].opacity=m),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),f==="f"?this._styles[n].height="100%":f!==void 0&&(this._styles[n].height=f,this._styles[n]["min-height"]=f,this._styles[n]["max-height"]=f),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=te(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()}},kt=({render:e,html:t})=>Ie;var At=I`
523
545
  :host([pt="xs"]) svg {
524
546
  padding-top: var(--spacing-xs);
525
547
  }
@@ -639,11 +661,11 @@ var rettangoli=(()=>{var mr=Object.defineProperty;var D=(e,t)=>{for(var r in t)m
639
661
  :host {
640
662
  color: var(--foreground);
641
663
  }
642
- ${fe}
643
- ${St}
664
+ ${ue}
665
+ ${At}
644
666
  ${re}
645
- ${H}
646
- `))}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=j(t===null?this.getAttribute("w"):t),s=j(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=""}},kt=({render:e,html:t})=>Te;var Ne=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
667
+ ${F}
668
+ `))}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=D(t===null?this.getAttribute("w"):t),s=D(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=""}},Et=({render:e,html:t})=>Te;var Ne=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
647
669
  :host {
648
670
  display: contents;
649
671
  }
@@ -668,8 +690,8 @@ var rettangoli=(()=>{var mr=Object.defineProperty;var D=(e,t)=>{for(var r in t)m
668
690
  cursor: not-allowed;
669
691
  }
670
692
  ${U}
671
- ${H}
672
- `))}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("keydown",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled",...ee([...Z,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}_onChange=t=>{this.dispatchEvent(new CustomEvent("input-keydown",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(["type","placeholder","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=$=>`${n==="default"?"":`${n}-`}${$}`,o=this.getAttribute(a("wh")),l=j(o===null?this.getAttribute(a("w")):o),u=j(o===null?this.getAttribute(a("h")):o),m=this.getAttribute(a("op")),x=this.getAttribute(a("z"));x!==null&&(this._styles[n]["z-index"]=x),m!==null&&(this._styles[n].opacity=m),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),u==="f"?this._styles[n].height="100%":u!==void 0&&(this._styles[n].height=u,this._styles[n]["min-height"]=u,this._styles[n]["max-height"]=u),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=te(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.hasAttribute("disabled");this._inputElement.setAttribute("type",t),r!==null?this._inputElement.setAttribute("placeholder",r):this._inputElement.removeAttribute("placeholder"),s?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},At=({render:e,html:t})=>Ne;var Le=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
693
+ ${F}
694
+ `))}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("keydown",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled",...ee([...Z,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}_onChange=t=>{this.dispatchEvent(new CustomEvent("input-keydown",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(["type","placeholder","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=A=>`${n==="default"?"":`${n}-`}${A}`,o=this.getAttribute(a("wh")),l=D(o===null?this.getAttribute(a("w")):o),f=D(o===null?this.getAttribute(a("h")):o),m=this.getAttribute(a("op")),x=this.getAttribute(a("z"));x!==null&&(this._styles[n]["z-index"]=x),m!==null&&(this._styles[n].opacity=m),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),f==="f"?this._styles[n].height="100%":f!==void 0&&(this._styles[n].height=f,this._styles[n]["min-height"]=f,this._styles[n]["max-height"]=f),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=te(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.hasAttribute("disabled");this._inputElement.setAttribute("type",t),r!==null?this._inputElement.setAttribute("placeholder",r):this._inputElement.removeAttribute("placeholder"),s?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},$t=({render:e,html:t})=>Ne;var Le=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
673
695
  :host {
674
696
  display: contents;
675
697
  }
@@ -693,9 +715,9 @@ var rettangoli=(()=>{var mr=Object.defineProperty;var D=(e,t)=>{for(var r in t)m
693
715
  border-color: var(--foreground);
694
716
  }
695
717
  ${U}
696
- ${H}
697
- `))}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")}},Et=({render:e,html:t})=>Le;var $t={elementName:"rtgl-dialog",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{isOpen:{type:"boolean"}}},refs:{"dialog-overlay":{eventListeners:{click:{handler:"handleClickDialogueOverlay"}}}},events:{"close-dialogue":{type:"object",properties:{}}},styles:{"@keyframes dialog-in":{from:{opacity:0,transform:"scale(0.95)"},to:{opacity:1,transform:"scale(1)"}},"#dialog-container":{animation:"dialog-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#dialog-overlay pos=fix cor=full ah=c av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view#dialog-container pos=fix bw=xs p=lg bgc=bg w=600 br=sm",value:{type:9,items:[{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var Pe={};D(Pe,{INITIAL_STATE:()=>Er,selectState:()=>Or,setState:()=>Cr,toViewData:()=>$r});var Er=Object.freeze({}),$r=({state:e,props:t})=>({isOpen:t.isOpen,position:{x:0,y:0}}),Or=({state:e})=>e,Cr=e=>{};var je={};D(je,{handleClickDialogueOverlay:()=>Ir});var Ir=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("close-dialogue"))};var De={};D(De,{INITIAL_STATE:()=>Tr,selectState:()=>Lr,setOpen:()=>Pr,setState:()=>jr,toViewData:()=>Nr});var Tr=Object.freeze({isOpen:!1}),Nr=({state:e,props:t})=>({isOpen:e.isOpen,options:t.options||[]}),Lr=({state:e})=>e,Pr=e=>{e.open=!0},jr=e=>{};var Ot={elementName:"rtgl-select",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{options:null,items:{type:"array",items:{type:"object",properties:{id:{type:"string"},lalbel:{type:"string"},value:{type:"any"}}}}}},refs:{"select-button":{eventListeners:{click:{handler:"handleButtonClick"}}},popover:{}},events:{},template:{type:9,items:[{type:8,properties:[{key:"rtgl-button#select-button v=ol",value:{type:0,value:"Placeholder"}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content",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 w=f h-bgc=mu ph=lg pv=md cur=p br=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var ze={};D(ze,{handleButtonClick:()=>zr,handleOnMount:()=>Dr});var Dr=e=>{},zr=(e,t)=>{let{store:r,render:s,getRefIds:i}=t;i().popover.elm.transformedHandlers.open({position:{x:e.clientX,y:e.clientY}})};var Ct={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=",{var:"start.image.width"}," h=",{var:"start.image.height"}," src=",{var:"start.image.src"}," alt=",{var:"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=",{var:"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=",{var:"start.image.width"}," h=",{var:"start.image.height"}," src=",{var:"start.image.src"}," alt=",{var:"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=",{var:"start.image.width"}," h=",{var:"start.image.height"}," src=",{var:"start.image.src"}," alt=",{var:"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 ",{var:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Re={};D(Re,{handleClickStart:()=>Rr});var Rr=(e,t)=>{let{dispatchEvent:r,store:s}=t;console.log("handle click start",s.selectPath()),r(new CustomEvent("clickStart",{detail:{path:s.selectPath()}}))};var Me={};D(Me,{INITIAL_STATE:()=>Mr,selectPath:()=>Hr,setState:()=>Br,toViewData:()=>Fr});var Mr=Object.freeze({}),Wr=["id","class","style","slot"],Vr=e=>Object.entries(e).filter(([t])=>!Wr.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Fr=({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:Vr(r),start:s||{label:"",image:{src:"",width:32,height:32,alt:""}}}},Hr=({props:e})=>e.start.path,Br=e=>{};var We={};D(We,{INITIAL_STATE:()=>Kr,selectState:()=>Jr,setClose:()=>Gr,setOpen:()=>Yr,toViewData:()=>Ur});var Kr=Object.freeze({isOpen:!1,position:{x:0,y:0}}),Ur=({state:e,props:t})=>t.isOpen!==void 0?{isOpen:t.isOpen,position:{x:0,y:0}}:{isOpen:e.isOpen,position:e.position},Jr=({state:e})=>e,Yr=(e,t)=>{e.isOpen=!0,e.position=t},Gr=e=>{e.isOpen=!1,e.position={x:0,y:0}};var Ve={};D(Ve,{handleClickOverlay:()=>qr,open:()=>Xr});var qr=(e,t)=>{let{props:r,dispatchEvent:s,store:i,render:n}=t;if(r.isOpen!==void 0){s(new CustomEvent("closePopover"));return}i.setClose(),n()},Xr=(e,t)=>{let{position:r}=e,{store:s,render:i}=t;s.setOpen(r),i()};var It={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"}}},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=bg',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: ',{var:"position.x"},"px; top: ",{var:"position.y"},'px;" id=floatingElement bw=xs p=md bgc=bg']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var Fe={};D(Fe,{INITIAL_STATE:()=>Qr,selectFormValues:()=>ss,selectState:()=>rs,setDefaultValues:()=>ns,setFormFieldValue:()=>as,setState:()=>is,toViewData:()=>ts});var Qr=Object.freeze({formValues:{}}),Zr=["id","class","style","slot"],es=e=>Object.entries(e).filter(([t])=>!Zr.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),ts=({state:e,props:t,attrs:r})=>({containerAttrString:es(r),title:t.form?.title||"",description:t?.form?.description||"",fields:t?.form?.fields||[],actions:t?.form?.actions||{buttons:[]},formValues:e.formValues}),rs=({state:e})=>e,ss=({state:e})=>e.formValues,is=e=>{},ns=(e,t)=>{e.formValues=t||{}},as=(e,{fieldName:t,value:r})=>{e.formValues[t]=r};var He={};D(He,{handleActionClick:()=>ls,handleInputChange:()=>ps,handleOnMount:()=>os});var os=e=>{let{store:t,props:r}=e;t.setDefaultValues(r.defaultValues)},ls=(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()}}))},ps=(e,t)=>{let{store:r}=t,s=e.currentTarget.id.replace("input-","");s&&e.detail.value!==void 0&&r.setFormFieldValue({fieldName:s,value:e.detail.value})};var Tt={elementName:"rtgl-form",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{defaultValues:{type:"object",properties:{}},form:{type:"object",properties:{title:{type:"string"},description:{type:"string"}}}}},refs:{"action-*":{eventListeners:{click:{handler:"handleActionClick"}}},"input-*":{eventListeners:{"input-keydown":{handler:"handleInputChange"}}}},events:{},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=sm 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=sm w=f",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},{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.id} w=f",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input-",{var:"field.id"}," w=f"]}}],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:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions.buttons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=e g=sm w=f",value:{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-",{var:"button.id"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=f p=md g=lg ",{var:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Ke={};D(Ke,{INITIAL_STATE:()=>cs,selectActiveItem:()=>ms,selectHeader:()=>us,selectItem:()=>gs,setState:()=>ys,toViewData:()=>fs});var cs=Object.freeze({}),hs=["id","class","style","slot"],ds=e=>Object.entries(e).filter(([t])=>!hs.includes(t)).map(([t,r])=>`${t}=${r}`).join(" ");function Be(e){let t=[];for(let r of e)if(t.push({id:r.id||r.href||r.path,title:r.title,href:r.href,type:r.type||"item",icon:r.icon,hrefAttr:r.href?`href=${r.href}`:""}),r.items&&Array.isArray(r.items))for(let s of r.items)t.push({id:s.id||s.href||s.path,title:s.title,href:s.href,type:s.type||"item",icon:s.icon,hrefAttr:s.href?`href=${s.href}`:""});return t}var fs=({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=ds(r),a=r.mode||"full",o=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},l=i?Be(i):[],u=a==="full"?272:64,m=a==="full"?"fs":"c",x=a==="full"?"fs":"c",$=a==="full"?"lg":"sm",T=a==="full"?"md":"sm",p=a==="shrunk-lg"?48:40,c=a==="shrunk-lg"?28:20,h=a==="shrunk-lg"?"md":"sm",d=a==="full",g=a==="full",_=a==="full"?"fs":"c",f=a==="full"?"":`ah=${x}`,v=a==="full"?"f":p;return{containerAttrString:n,mode:a,header:o,items:l,sidebarWidth:u,headerAlign:m,itemAlign:x,headerPadding:$,itemPadding:T,itemHeight:p,iconSize:c,firstLetterSize:h,showLabels:d,showGroupLabels:g,itemContentAlign:_,itemAlignAttr:f,itemWidth:v,headerWidth:v}},us=({state:e,props:t,attrs:r})=>r.header?JSON.parse(decodeURIComponent(r.header)):t.header,ms=({state:e,props:t})=>(t.items?Be(t.items):[]).find(s=>s.active),gs=({state:e,props:t,attrs:r},s)=>{let i=r.items?JSON.parse(decodeURIComponent(r.items)):t.items;return(i?Be(i):[]).find(a=>a.id===s)},ys=e=>{};var Nt={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"},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:{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 ${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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"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=",{var:"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=",{var:"header.href"}," d=h av=c ah=",{var:"headerAlign"}," g=lg w=",{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"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=",{var:"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=",{var:"headerAlign"}," g=lg w=",{var:"headerWidth"}," cur=p"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view ph=",{var:"headerPadding"}," pv=lg"]}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=f ph=${headerPadding} pb=lg g=xs",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=mu br=lg bgc=bg 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=",{var:"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=",{var:"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=",{var:"iconSize"}," svg=",{var:"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=",{var:"firstLetterSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view wh=",{var:"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-",{var:"item.id"}," ",{var:"item.hrefAttr"}," h=",{var:"itemHeight"}," av=c ",{var:"itemAlignAttr"}," ph=",{var:"itemPadding"}," w=",{var:"itemWidth"},' h-bgc=mu br=lg bgc=bg cur=p title="',{var:"item.title"},'"']}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f ph=",{var:"headerPadding"}," pb=lg g=xs"]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{var:"sidebarWidth"}," bwr=xs ",{var:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Ue={};D(Ue,{handleHeaderClick:()=>vs,handleItemClick:()=>bs});var vs=(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}))},bs=(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 Je={};D(Je,{INITIAL_STATE:()=>ws,selectCurrentId:()=>Ss,selectState:()=>_s,setContentContainer:()=>Es,setCurrentId:()=>As,setItems:()=>ks,toViewData:()=>xs});var ws=Object.freeze({items:[],currentId:null,contentContainer:null}),xs=({state:e})=>({items:e.items.map(t=>({...t,c:t.id===e.currentId?"fg":"mu-fg"})),currentId:e.currentId}),_s=({state:e})=>e,Ss=({state:e})=>e.currentId,ks=(e,t)=>{e.items=t},As=(e,t)=>{e.currentId=t},Es=(e,t)=>{e.contentContainer=t};var Lt={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=",{var:"item.c"}," h-c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view pv=xs av=c href=",{var:"item.href"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var Ye={};D(Ye,{handleOnMount:()=>Os});var Pt=(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())},$s=(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),Pt(n,t),s();let o=Pt.bind(void 0,n,t);return e.addEventListener("scroll",o,{passive:!0}),()=>{e.removeEventListener("scroll",o)}},Os=e=>{let{attrs:t}=e;requestAnimationFrame(()=>{let r=document.getElementById(t["target-id"]),s=$s(r,e);return()=>{s()}})};var Wt=Symbol.for("immer-nothing"),jt=Symbol.for("immer-draftable"),R=Symbol.for("immer-state");function K(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ie=Object.getPrototypeOf;function ne(e){return!!e&&!!e[R]}function G(e){return e?Vt(e)||Array.isArray(e)||!!e[jt]||!!e.constructor?.[jt]||ve(e)||be(e):!1}var Cs=Object.prototype.constructor.toString();function Vt(e){if(!e||typeof e!="object")return!1;let t=ie(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)===Cs}function ue(e,t){ye(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function ye(e){let t=e[R];return t?t.type_:Array.isArray(e)?1:ve(e)?2:be(e)?3:0}function Xe(e,t){return ye(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ft(e,t,r){let s=ye(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function Is(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ve(e){return e instanceof Map}function be(e){return e instanceof Set}function Y(e){return e.copy_||e.base_}function Qe(e,t){if(ve(e))return new Map(e);if(be(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Vt(e);if(t===!0||t==="class_only"&&!r){let s=Object.getOwnPropertyDescriptors(e);delete s[R];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(ie(e),s)}else{let s=ie(e);if(s!==null&&r)return{...e};let i=Object.create(s);return Object.assign(i,e)}}function st(e,t=!1){return we(e)||ne(e)||!G(e)||(ye(e)>1&&(e.set=e.add=e.clear=e.delete=Ts),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>st(s,!0))),e}function Ts(){K(2)}function we(e){return Object.isFrozen(e)}var Ns={};function q(e){let t=Ns[e];return t||K(0,e),t}var pe;function Ht(){return pe}function Ls(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Dt(e,t){t&&(q("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ze(e){et(e),e.drafts_.forEach(Ps),e.drafts_=null}function et(e){e===pe&&(pe=e.parent_)}function zt(e){return pe=Ls(pe,e)}function Ps(e){let t=e[R];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Rt(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[R].modified_&&(Ze(t),K(4)),G(e)&&(e=me(t,e),t.parent_||ge(t,e)),t.patches_&&q("Patches").generateReplacementPatches_(r[R].base_,e,t.patches_,t.inversePatches_)):e=me(t,r,[]),Ze(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Wt?e:void 0}function me(e,t,r){if(we(t))return t;let s=t[R];if(!s)return ue(t,(i,n)=>Mt(e,s,t,i,n,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return ge(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),ue(n,(o,l)=>Mt(e,s,i,o,l,r,a)),ge(e,i,!1),r&&e.patches_&&q("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function Mt(e,t,r,s,i,n,a){if(ne(i)){let o=n&&t&&t.type_!==3&&!Xe(t.assigned_,s)?n.concat(s):void 0,l=me(e,i,o);if(Ft(r,s,l),ne(l))e.canAutoFreeze_=!1;else return}else a&&r.add(i);if(G(i)&&!we(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;me(e,i),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&ge(e,i)}}function ge(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&st(t,r)}function js(e,t){let r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:Ht(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=s,n=it;r&&(i=[s],n=ce);let{revoke:a,proxy:o}=Proxy.revocable(i,n);return s.draft_=o,s.revoke_=a,o}var it={get(e,t){if(t===R)return e;let r=Y(e);if(!Xe(r,t))return Ds(e,r,t);let s=r[t];return e.finalized_||!G(s)?s:s===Ge(e.base_,t)?(qe(e),e.copy_[t]=rt(s,e)):s},has(e,t){return t in Y(e)},ownKeys(e){return Reflect.ownKeys(Y(e))},set(e,t,r){let s=Bt(Y(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let i=Ge(Y(e),t),n=i?.[R];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Is(r,i)&&(r!==void 0||Xe(e.base_,t)))return!0;qe(e),tt(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 Ge(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,qe(e),tt(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Y(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){K(11)},getPrototypeOf(e){return ie(e.base_)},setPrototypeOf(){K(12)}},ce={};ue(it,(e,t)=>{ce[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ce.deleteProperty=function(e,t){return ce.set.call(this,e,t,void 0)};ce.set=function(e,t,r){return it.set.call(this,e[0],t,r,e[0])};function Ge(e,t){let r=e[R];return(r?Y(r):e)[t]}function Ds(e,t,r){let s=Bt(t,r);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function Bt(e,t){if(!(t in e))return;let r=ie(e);for(;r;){let s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=ie(r)}}function tt(e){e.modified_||(e.modified_=!0,e.parent_&&tt(e.parent_))}function qe(e){e.copy_||(e.copy_=Qe(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var zs=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,...u){return a.produce(l,m=>r.call(this,m,...u))}}typeof r!="function"&&K(6),s!==void 0&&typeof s!="function"&&K(7);let i;if(G(t)){let n=zt(this),a=rt(t,void 0),o=!0;try{i=r(a),o=!1}finally{o?Ze(n):et(n)}return Dt(n,s),Rt(i,n)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===Wt&&(i=void 0),this.autoFreeze_&&st(i,!0),s){let n=[],a=[];q("Patches").generateReplacementPatches_(t,i,n,a),s(n,a)}return i}else K(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){G(e)||K(8),ne(e)&&(e=Rs(e));let t=zt(this),r=rt(e,void 0);return r[R].isManual_=!0,et(t),r}finishDraft(e,t){let r=e&&e[R];(!r||!r.isManual_)&&K(9);let{scope_:s}=r;return Dt(s,t),Rt(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=q("Patches").applyPatches_;return ne(e)?s(e,t):this.produce(e,i=>s(i,t))}};function rt(e,t){let r=ve(e)?q("MapSet").proxyMap_(e,t):be(e)?q("MapSet").proxySet_(e,t):js(e,t);return(t?t.scope_:Ht()).drafts_.push(r),r}function Rs(e){return ne(e)||K(10,e),Kt(e)}function Kt(e){if(!G(e)||we(e))return e;let t=e[R],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Qe(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Qe(e,!0);return ue(r,(s,i)=>{Ft(r,s,Kt(i))}),t&&(t.finalized_=!1),r}var M=new zs,Ut=M.produce,Qn=M.produceWithPatches.bind(M),Zn=M.setAutoFreeze.bind(M),ea=M.setUseStrictShallowCopy.bind(M),ta=M.applyPatches.bind(M),ra=M.createDraft.bind(M),sa=M.finishDraft.bind(M);var N={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9},W={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8},xe={NOT:0};var Ms=e=>{let{ast:t,functions:r,data:s}=e;return P(t,r,s,{})},P=(e,t,r,s)=>{switch(e.type){case N.LITERAL:return e.value;case N.VARIABLE:return nt(e.path,r,s);case N.INTERPOLATION:return Ws(e.parts,t,r,s);case N.FUNCTION:return Jt(e,t,r,s);case N.BINARY:return Yt(e,t,r,s);case N.UNARY:return Gt(e,t,r,s);case N.CONDITIONAL:return Vs(e,t,r,s);case N.LOOP:return Fs(e,t,r,s);case N.OBJECT:return Hs(e,t,r,s);case N.ARRAY:return Bs(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},nt=(e,t,r)=>{if(!e)return;if(r.hasOwnProperty(e))return r[e];let s=e.split("."),i=t;for(let n of s){if(i==null)return;r.hasOwnProperty(n)?i=r[n]:i=i[n]}return i},Ws=(e,t,r,s)=>{let i="";for(let n of e)if(typeof n=="string")i+=n;else if(n.var){let a=nt(n.var,r,s);i+=a!=null?String(a):""}else if(n.func){let a=t[n.func]?.(...n.args||[]);i+=a!=null?String(a):""}return i},Jt=(e,t,r,s)=>{let i=t[e.name];if(!i)throw new Error(`Function '${e.name}' is not defined`);let n=e.args.map(a=>P(a,t,r,s));return i(...n)},_e=(e,t,r,s)=>{switch(e.type){case N.VARIABLE:return nt(e.path,r,s);case N.LITERAL:return e.value;case N.BINARY:return Yt(e,t,r,s);case N.UNARY:return Gt(e,t,r,s);case N.FUNCTION:return Jt(e,t,r,s);default:return P(e,t,r,s)}},Yt=(e,t,r,s)=>{if(e.op===W.AND||e.op===W.OR){let a=_e(e.left,t,r,s),o=_e(e.right,t,r,s);switch(e.op){case W.AND:return a&&o;case W.OR:return a||o}}let i=P(e.left,t,r,s),n=P(e.right,t,r,s);switch(e.op){case W.EQ:return i==n;case W.NEQ:return i!=n;case W.GT:return i>n;case W.LT:return i<n;case W.GTE:return i>=n;case W.LTE:return i<=n;case W.IN:return Array.isArray(n)?n.includes(i):!1;default:throw new Error(`Unknown binary operator: ${e.op}`)}},Gt=(e,t,r,s)=>{let i=e.op===xe.NOT?_e(e.operand,t,r,s):P(e.operand,t,r,s);switch(e.op){case xe.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Vs=(e,t,r,s)=>{for(let i=0;i<e.conditions.length;i++){let n=e.conditions[i];if(n===null||_e(n,t,r,s))return P(e.bodies[i],t,r,s)}return{}},Fs=(e,t,r,s)=>{let i=P(e.iterable,t,r,s);if(!Array.isArray(i))return[];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=P(e.body,t,r,o);Array.isArray(l)&&l.length===1?n.push(l[0]):n.push(l)}return n},Hs=(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=P(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===N.OBJECT&&l.properties){let u=l.properties.find(m=>m.key.startsWith("$for "));if(u){let m=P(u.value,t,r,s);m!==void 0&&(i[o.key]=m)}else{let m=P(o.value,t,r,s);m!==void 0&&(i[o.key]=m)}}else{let u=o.parsedKey?P(o.parsedKey,t,r,s):o.key,m=P(o.value,t,r,s);m!==void 0&&(i[u]=m)}}return i},Bs=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===N.LOOP){let a=P(n,t,r,s);i.push(a)}else i.push(P(n,t,r,s));return i},Se=Ms;var ke=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...ke(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]:ke(n)})}}t.push(r)}return t},[]):e;var Js=(e,t)=>t.split(".").reduce((r,s)=>r&&r[s],e),qt=({h:e,template:t,viewData:r,refs:s,handlers:i})=>{let n=Se({ast:t,data:r}),a=ke(n),o=Ys({h:e,items:a,refs:s,handlers:i,viewData:r});return e("div",{style:{display:"contents"}},o)},Ys=({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,u)=>{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 m=Object.entries(l);if(m.length===0)return console.warn("Skipping empty object item:",l),null;let[x,$]=m[0];if(!isNaN(Number(x)))return Array.isArray($)?n($,`${o}.${x}`):typeof $=="object"&&$!==null&&Object.entries($).length>0?n([$],`${o}.${x}`):String($);m.length>1&&console.warn("Item has multiple keys, processing only the first:",x);let T,p,c=x.indexOf(" ");c===-1?(T=x,p=""):(T=x.substring(0,c),p=x.substring(c+1).trim());let h=T.split(/[.#]/)[0],d=h.includes("-"),g={},_={};if(p){let S=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|(\S+))/g,y;for(;(y=S.exec(p))!==null;)if(y[1].startsWith(".")){let C=y[1].substring(1),L=y[4];_[C]=Js(i,L)}else g[y[1]]=y[2]||y[3]||y[4]}let f=T.match(/#([^.#\s]+)/);f&&!Object.prototype.hasOwnProperty.call(g,"id")&&(g.id=f[1]);let v=null;g.id?v=g.id:d&&(v=h);let b=Object.create(null),k=null;if(d)k=h;else{let S=T.match(/\.([^.#]+)/g);S&&S.forEach(C=>{let L=C.substring(1);b[L]=!0});let y=T.match(/#([^.#\s]+)/);y&&(k=y[1])}let w;typeof $=="string"||typeof $=="number"?w=String($):Array.isArray($)?w=n($,`${o}.${x}`):w=[],k&&!d&&(g.id=k);let A=Object.create(null);if(v&&r){let S=[];if(Object.keys(r).forEach(y=>{if(y.includes("*")){let C="^"+y.replace(/[.*+?^${}()|[\\\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"$";try{new RegExp(C).test(v)&&S.push(y)}catch(L){console.warn(`[Parser] Invalid regex pattern created from refKey '${y}': ${C}`,L)}}else v===y&&S.push(y)}),S.length>0){S.sort((C,L)=>{let V=!C.includes("*"),B=!L.includes("*");return V&&!B?-1:!V&&B?1:L.length-C.length});let y=S[0];if(r[y]&&r[y].eventListeners){let C=r[y].eventListeners;Object.entries(C).forEach(([L,V])=>{V.handler&&s[V.handler]?A[L]=B=>{s[V.handler](B)}:V.handler&&console.warn(`[Parser] Handler '${V.handler}' for refKey '${y}' (matching elementId '${v}') is referenced but not found in available handlers.`)})}}}let O={};if(v)O.key=v;else if(T){let S=o?`${o}.${u}`:String(u);if(O.key=`${T}-${S}`,Object.keys(_).length>0){let y=JSON.stringify(_).substring(0,50);O.key+=`-${y}`}}Object.keys(g).length>0&&(O.attrs=g),Object.keys(b).length>0&&(O.class=b),Object.keys(A).length>0&&(O.on=A),Object.keys(_).length>0&&(O.props=_,d&&(O.hook={update:(S,y)=>{let C=S.data?.props||{},L=y.data?.props||{};if(JSON.stringify(C)!==JSON.stringify(L)){let B=y.elm;B&&B.render&&typeof B.render=="function"&&(B.setAttribute("isDirty","true"),requestAnimationFrame(()=>{B.render(),B.removeAttribute("isDirty")}))}}}));try{return e(h,O,w)}catch(S){return console.error("Error creating virtual node:",S,{tagName:h,snabbdomData:O,childrenOrText:w}),e("div",{},["Error creating element"])}}).filter(Boolean)}return n(t)};var Gs=(e,t)=>{if(!t||typeof t!="object")return"";let r="",s=n=>Object.entries(n).map(([a,o])=>` ${a}: ${o};`).join(`
698
- `),i=(n,a)=>{if(typeof a!="object"||a===null)return"";if(n.startsWith("@")){let o=Object.entries(a).map(([l,u])=>{let m=s(u);return` ${l} {
718
+ ${F}
719
+ `))}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")}},Ot=({render:e,html:t})=>Le;var Pe={};j(Pe,{INITIAL_STATE:()=>Cr,selectState:()=>Tr,toViewData:()=>Ir});var Cr=Object.freeze({}),Ir=({state:e,props:t})=>({isOpen:t.isOpen,position:t.position}),Tr=({state:e})=>e;var Ct={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: ',{var:"position.x"},"px; top: ",{var:"position.y"},'px;" id=floatingElement bw=xs p=md bgc=mu']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var je={};j(je,{handleClickOverlay:()=>Nr});var Nr=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("click-overlay"))};var De={};j(De,{INITIAL_STATE:()=>Lr,selectFormValues:()=>Mr,selectState:()=>zr,setDefaultValues:()=>Vr,setFormFieldValue:()=>Wr,setState:()=>Rr,toViewData:()=>Dr});var Lr=Object.freeze({formValues:{}}),Pr=["id","class","style","slot"],jr=e=>Object.entries(e).filter(([t])=>!Pr.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Dr=({state:e,props:t,attrs:r})=>({containerAttrString:jr(r),title:t.form?.title||"",description:t?.form?.description||"",fields:t?.form?.fields||[],actions:t?.form?.actions||{buttons:[]},formValues:e.formValues}),zr=({state:e})=>e,Mr=({state:e})=>e.formValues,Rr=e=>{},Vr=(e,t)=>{e.formValues=t||{}},Wr=(e,{fieldName:t,value:r})=>{e.formValues[t]=r};var ze={};j(ze,{handleActionClick:()=>Fr,handleInputChange:()=>Br,handleOnMount:()=>Hr});var Hr=e=>{let{store:t,props:r}=e;t.setDefaultValues(r.defaultValues)},Fr=(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()}}))},Br=(e,t)=>{let{store:r}=t,s=e.currentTarget.id.replace("input-","");s&&e.detail.value!==void 0&&r.setFormFieldValue({fieldName:s,value:e.detail.value})};var It={elementName:"rtgl-form",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{defaultValues:{type:"object",properties:{}},form:{type:"object",properties:{title:{type:"string"},description:{type:"string"}}}}},refs:{"action-*":{eventListeners:{click:{handler:"handleActionClick"}}},"input-*":{eventListeners:{"input-keydown":{handler:"handleInputChange"}}}},events:{},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=sm 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=sm w=f",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},{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.id} w=f",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input-",{var:"field.id"}," w=f"]}}],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:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions.buttons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=e g=sm w=f",value:{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-",{var:"button.id"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=f p=md g=lg ",{var:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Me={};j(Me,{handleButtonClick:()=>Ur,handleClickOptionsPopoverOverlay:()=>qr,handleOnMount:()=>Kr,handleOptionClick:()=>Jr});var Kr=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.update(n=>{n.selectedValue=i.value,n.selectedLabel=i.label}),s())}},Ur=(e,t)=>{let{store:r,render:s,getRefIds:i}=t;r.openOptionsPopover({position:{y:e.clientY,x:e.clientX}}),s()},qr=(e,t)=>{let{store:r,render:s}=t;r.closeOptionsPopover(),s()},Jr=(e,t)=>{let{render:r,dispatchEvent:s,props:i}=t,n=e.currentTarget.id.replace("option-",""),a=i.options[n];s(new CustomEvent("option-selected",{detail:{value:a.value,label:a.label},bubbles:!0})),r()};var Re={};j(Re,{INITIAL_STATE:()=>Yr,closeOptionsPopover:()=>Zr,openOptionsPopover:()=>Qr,selectOption:()=>es,selectState:()=>Xr,toViewData:()=>Gr});var Yr=Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,selectedLabel:null}),Gr=({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"}},Xr=({state:e})=>e,Qr=(e,t)=>{let{position:r}=t;e.position=r,e.isOpen=!0},Zr=e=>{e.isOpen=!1},es=(e,t)=>{e.selectedValue=t.value,e.selectedLabel=t.label,e.isOpen=!1};var Tt={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",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-",{var:"i"}," w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=",{var:"option.bgc"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var Nt={elementName:"rtgl-dialog",viewDataSchema:{type:"object"},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 pos=fix cor=full ah=c av=c",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#dialog-container pos=fix bw=xs p=lg bgc=bg w=600 br=sm",value:{type:9,items:[{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var Ve={};j(Ve,{handleClickDialogueOverlay:()=>ts});var ts=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("close-dialogue"))};var We={};j(We,{INITIAL_STATE:()=>rs,selectState:()=>is,setState:()=>ns,toViewData:()=>ss});var rs=Object.freeze({}),ss=({state:e,props:t})=>({isOpen:t.isOpen,position:{x:0,y:0}}),is=({state:e})=>e,ns=e=>{};var He={};j(He,{INITIAL_STATE:()=>as,selectPath:()=>cs,setState:()=>hs,toViewData:()=>ps});var as=Object.freeze({}),os=["id","class","style","slot"],ls=e=>Object.entries(e).filter(([t])=>!os.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),ps=({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:ls(r),start:s||{label:"",image:{src:"",width:32,height:32,alt:""}}}},cs=({props:e})=>e.start.path,hs=e=>{};var Fe={};j(Fe,{handleClickStart:()=>ds});var ds=(e,t)=>{let{dispatchEvent:r,store:s}=t;console.log("handle click start",s.selectPath()),r(new CustomEvent("clickStart",{detail:{path:s.selectPath()}}))};var Lt={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=",{var:"start.image.width"}," h=",{var:"start.image.height"}," src=",{var:"start.image.src"}," alt=",{var:"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=",{var:"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=",{var:"start.image.width"}," h=",{var:"start.image.height"}," src=",{var:"start.image.src"}," alt=",{var:"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=",{var:"start.image.width"}," h=",{var:"start.image.height"}," src=",{var:"start.image.src"}," alt=",{var:"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 ",{var:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Be={};j(Be,{INITIAL_STATE:()=>us,selectState:()=>ms,setState:()=>gs,toViewData:()=>fs});var us=Object.freeze({}),fs=({state:e,props:t})=>({items:t.items||[],isOpen:t.isOpen||!1,position:t.position||{x:0,y:0}}),ms=({state:e})=>e,gs=e=>{};var Pt={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-",{var:"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 Ke={};j(Ke,{handleClickMenuItem:()=>vs,handleClickPopoverOverlay:()=>ys});var ys=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("click-overlay"))},vs=(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 Ue={};j(Ue,{INITIAL_STATE:()=>bs,selectCurrentId:()=>_s,selectState:()=>xs,setContentContainer:()=>As,setCurrentId:()=>ks,setItems:()=>Ss,toViewData:()=>ws});var bs=Object.freeze({items:[],currentId:null,contentContainer:null}),ws=({state:e})=>({items:e.items.map(t=>({...t,c:t.id===e.currentId?"fg":"mu-fg"})),currentId:e.currentId}),xs=({state:e})=>e,_s=({state:e})=>e.currentId,Ss=(e,t)=>{e.items=t},ks=(e,t)=>{e.currentId=t},As=(e,t)=>{e.contentContainer=t};var jt={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=",{var:"item.c"}," h-c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view pv=xs av=c href=",{var:"item.href"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var qe={};j(qe,{handleOnMount:()=>$s});var Dt=(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())},Es=(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),Dt(n,t),s();let o=Dt.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=Es(r,e);return()=>{s()}})};var Je={};j(Je,{handleHeaderClick:()=>Os,handleItemClick:()=>Cs});var Os=(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}))},Cs=(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 Ge={};j(Ge,{INITIAL_STATE:()=>Is,selectActiveItem:()=>js,selectHeader:()=>Ps,selectItem:()=>Ds,setState:()=>zs,toViewData:()=>Ls});var Is=Object.freeze({}),Ts=["id","class","style","slot"],Ns=e=>Object.entries(e).filter(([t])=>!Ts.includes(t)).map(([t,r])=>`${t}=${r}`).join(" ");function Ye(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 Ls=({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=Ns(r),o=r.mode||"full",l=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},f=i?Ye(i,n):[],m=o==="full"?272:64,x=o==="full"?"fs":"c",A=o==="full"?"fs":"c",T=o==="full"?"lg":"sm",p=o==="full"?"md":"sm",c=o==="shrunk-lg"?48:40,h=o==="shrunk-lg"?28:20,d=o==="shrunk-lg"?"md":"sm",g=o==="full",_=o==="full",u=o==="full"?"fs":"c",b=o==="full"?"":`ah=${A}`,y=o==="full"?"f":c;return{containerAttrString:a,mode:o,header:l,items:f,sidebarWidth:m,headerAlign:x,itemAlign:A,headerPadding:T,itemPadding:p,itemHeight:c,iconSize:h,firstLetterSize:d,showLabels:g,showGroupLabels:_,itemContentAlign:u,itemAlignAttr:b,itemWidth:y,headerWidth:y,selectedItemId:n}},Ps=({state:e,props:t,attrs:r})=>r.header?JSON.parse(decodeURIComponent(r.header)):t.header,js=({state:e,props:t})=>(t.items?Ye(t.items):[]).find(s=>s.active),Ds=({state:e,props:t,attrs:r},s)=>{let i=r.items?JSON.parse(decodeURIComponent(r.items)):t.items;return(i?Ye(i):[]).find(a=>a.id===s)},zs=e=>{};var zt={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 ${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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"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=",{var:"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=",{var:"header.href"}," d=h av=c ah=",{var:"headerAlign"}," g=lg w=",{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"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=",{var:"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=",{var:"headerAlign"}," g=lg w=",{var:"headerWidth"}," cur=p"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view ph=",{var:"headerPadding"}," pv=lg"]}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=f ph=${headerPadding} pb=lg g=xs",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=",{var:"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=",{var:"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=",{var:"iconSize"}," svg=",{var:"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=",{var:"firstLetterSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view wh=",{var:"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-",{var:"item.id"}," ",{var:"item.hrefAttr"}," h=",{var:"itemHeight"}," av=c ",{var:"itemAlignAttr"}," ph=",{var:"itemPadding"}," w=",{var:"itemWidth"}," h-bgc=",{var:"item.itemHoverBgc"}," br=lg bgc=",{var:"item.itemBgc"},' cur=p title="',{var:"item.title"},'"']}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f ph=",{var:"headerPadding"}," pb=lg g=xs"]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{var:"sidebarWidth"}," bwr=xs ",{var:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Ft=Symbol.for("immer-nothing"),Mt=Symbol.for("immer-draftable"),M=Symbol.for("immer-state");function K(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ie=Object.getPrototypeOf;function ne(e){return!!e&&!!e[M]}function Y(e){return e?Bt(e)||Array.isArray(e)||!!e[Mt]||!!e.constructor?.[Mt]||ve(e)||be(e):!1}var Ms=Object.prototype.constructor.toString();function Bt(e){if(!e||typeof e!="object")return!1;let t=ie(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)===Ms}function fe(e,t){ye(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function ye(e){let t=e[M];return t?t.type_:Array.isArray(e)?1:ve(e)?2:be(e)?3:0}function Ze(e,t){return ye(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Kt(e,t,r){let s=ye(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function Rs(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ve(e){return e instanceof Map}function be(e){return e instanceof Set}function J(e){return e.copy_||e.base_}function et(e,t){if(ve(e))return new Map(e);if(be(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Bt(e);if(t===!0||t==="class_only"&&!r){let s=Object.getOwnPropertyDescriptors(e);delete s[M];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(ie(e),s)}else{let s=ie(e);if(s!==null&&r)return{...e};let i=Object.create(s);return Object.assign(i,e)}}function nt(e,t=!1){return we(e)||ne(e)||!Y(e)||(ye(e)>1&&(e.set=e.add=e.clear=e.delete=Vs),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>nt(s,!0))),e}function Vs(){K(2)}function we(e){return Object.isFrozen(e)}var Ws={};function G(e){let t=Ws[e];return t||K(0,e),t}var pe;function Ut(){return pe}function Hs(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Rt(e,t){t&&(G("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function tt(e){rt(e),e.drafts_.forEach(Fs),e.drafts_=null}function rt(e){e===pe&&(pe=e.parent_)}function Vt(e){return pe=Hs(pe,e)}function Fs(e){let t=e[M];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Wt(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[M].modified_&&(tt(t),K(4)),Y(e)&&(e=me(t,e),t.parent_||ge(t,e)),t.patches_&&G("Patches").generateReplacementPatches_(r[M].base_,e,t.patches_,t.inversePatches_)):e=me(t,r,[]),tt(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ft?e:void 0}function me(e,t,r){if(we(t))return t;let s=t[M];if(!s)return fe(t,(i,n)=>Ht(e,s,t,i,n,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return ge(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)=>Ht(e,s,i,o,l,r,a)),ge(e,i,!1),r&&e.patches_&&G("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function Ht(e,t,r,s,i,n,a){if(ne(i)){let o=n&&t&&t.type_!==3&&!Ze(t.assigned_,s)?n.concat(s):void 0,l=me(e,i,o);if(Kt(r,s,l),ne(l))e.canAutoFreeze_=!1;else return}else a&&r.add(i);if(Y(i)&&!we(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;me(e,i),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&ge(e,i)}}function ge(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&nt(t,r)}function Bs(e,t){let r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:Ut(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=s,n=at;r&&(i=[s],n=ce);let{revoke:a,proxy:o}=Proxy.revocable(i,n);return s.draft_=o,s.revoke_=a,o}var at={get(e,t){if(t===M)return e;let r=J(e);if(!Ze(r,t))return Ks(e,r,t);let s=r[t];return e.finalized_||!Y(s)?s:s===Xe(e.base_,t)?(Qe(e),e.copy_[t]=it(s,e)):s},has(e,t){return t in J(e)},ownKeys(e){return Reflect.ownKeys(J(e))},set(e,t,r){let s=qt(J(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let i=Xe(J(e),t),n=i?.[M];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Rs(r,i)&&(r!==void 0||Ze(e.base_,t)))return!0;Qe(e),st(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 Xe(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Qe(e),st(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=J(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){K(11)},getPrototypeOf(e){return ie(e.base_)},setPrototypeOf(){K(12)}},ce={};fe(at,(e,t)=>{ce[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ce.deleteProperty=function(e,t){return ce.set.call(this,e,t,void 0)};ce.set=function(e,t,r){return at.set.call(this,e[0],t,r,e[0])};function Xe(e,t){let r=e[M];return(r?J(r):e)[t]}function Ks(e,t,r){let s=qt(t,r);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function qt(e,t){if(!(t in e))return;let r=ie(e);for(;r;){let s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=ie(r)}}function st(e){e.modified_||(e.modified_=!0,e.parent_&&st(e.parent_))}function Qe(e){e.copy_||(e.copy_=et(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Us=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,...f){return a.produce(l,m=>r.call(this,m,...f))}}typeof r!="function"&&K(6),s!==void 0&&typeof s!="function"&&K(7);let i;if(Y(t)){let n=Vt(this),a=it(t,void 0),o=!0;try{i=r(a),o=!1}finally{o?tt(n):rt(n)}return Rt(n,s),Wt(i,n)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===Ft&&(i=void 0),this.autoFreeze_&&nt(i,!0),s){let n=[],a=[];G("Patches").generateReplacementPatches_(t,i,n,a),s(n,a)}return i}else K(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){Y(e)||K(8),ne(e)&&(e=qs(e));let t=Vt(this),r=it(e,void 0);return r[M].isManual_=!0,rt(t),r}finishDraft(e,t){let r=e&&e[M];(!r||!r.isManual_)&&K(9);let{scope_:s}=r;return Rt(s,t),Wt(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=G("Patches").applyPatches_;return ne(e)?s(e,t):this.produce(e,i=>s(i,t))}};function it(e,t){let r=ve(e)?G("MapSet").proxyMap_(e,t):be(e)?G("MapSet").proxySet_(e,t):Bs(e,t);return(t?t.scope_:Ut()).drafts_.push(r),r}function qs(e){return ne(e)||K(10,e),Jt(e)}function Jt(e){if(!Y(e)||we(e))return e;let t=e[M],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=et(e,t.scope_.immer_.useStrictShallowCopy_)}else r=et(e,!0);return fe(r,(s,i)=>{Kt(r,s,Jt(i))}),t&&(t.finalized_=!1),r}var R=new Us,Yt=R.produce,la=R.produceWithPatches.bind(R),pa=R.setAutoFreeze.bind(R),ca=R.setUseStrictShallowCopy.bind(R),ha=R.applyPatches.bind(R),da=R.createDraft.bind(R),ua=R.finishDraft.bind(R);var N={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9},V={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8},xe={NOT:0};var Js=e=>{let{ast:t,functions:r,data:s}=e;return P(t,r,s,{})},P=(e,t,r,s)=>{switch(e.type){case N.LITERAL:return e.value;case N.VARIABLE:return ot(e.path,r,s);case N.INTERPOLATION:return Ys(e.parts,t,r,s);case N.FUNCTION:return Gt(e,t,r,s);case N.BINARY:return Xt(e,t,r,s);case N.UNARY:return Qt(e,t,r,s);case N.CONDITIONAL:return Gs(e,t,r,s);case N.LOOP:return Xs(e,t,r,s);case N.OBJECT:return Qs(e,t,r,s);case N.ARRAY:return Zs(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},ot=(e,t,r)=>{if(!e)return;if(r.hasOwnProperty(e))return r[e];let s=e.split("."),i=t;for(let n of s){if(i==null)return;r.hasOwnProperty(n)?i=r[n]:i=i[n]}return i},Ys=(e,t,r,s)=>{let i="";for(let n of e)if(typeof n=="string")i+=n;else if(n.var){let a=ot(n.var,r,s);i+=a!=null?String(a):""}else if(n.func){let a=t[n.func]?.(...n.args||[]);i+=a!=null?String(a):""}return i},Gt=(e,t,r,s)=>{let i=t[e.name];if(!i)throw new Error(`Function '${e.name}' is not defined`);let n=e.args.map(a=>P(a,t,r,s));return i(...n)},_e=(e,t,r,s)=>{switch(e.type){case N.VARIABLE:return ot(e.path,r,s);case N.LITERAL:return e.value;case N.BINARY:return Xt(e,t,r,s);case N.UNARY:return Qt(e,t,r,s);case N.FUNCTION:return Gt(e,t,r,s);default:return P(e,t,r,s)}},Xt=(e,t,r,s)=>{if(e.op===V.AND||e.op===V.OR){let a=_e(e.left,t,r,s),o=_e(e.right,t,r,s);switch(e.op){case V.AND:return a&&o;case V.OR:return a||o}}let i=P(e.left,t,r,s),n=P(e.right,t,r,s);switch(e.op){case V.EQ:return i==n;case V.NEQ:return i!=n;case V.GT:return i>n;case V.LT:return i<n;case V.GTE:return i>=n;case V.LTE:return i<=n;case V.IN:return Array.isArray(n)?n.includes(i):!1;default:throw new Error(`Unknown binary operator: ${e.op}`)}},Qt=(e,t,r,s)=>{let i=e.op===xe.NOT?_e(e.operand,t,r,s):P(e.operand,t,r,s);switch(e.op){case xe.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Gs=(e,t,r,s)=>{for(let i=0;i<e.conditions.length;i++){let n=e.conditions[i];if(n===null||_e(n,t,r,s))return P(e.bodies[i],t,r,s)}return{}},Xs=(e,t,r,s)=>{let i=P(e.iterable,t,r,s);if(!Array.isArray(i))return[];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=P(e.body,t,r,o);Array.isArray(l)&&l.length===1?n.push(l[0]):n.push(l)}return n},Qs=(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=P(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===N.OBJECT&&l.properties){let f=l.properties.find(m=>m.key.startsWith("$for "));if(f){let m=P(f.value,t,r,s);m!==void 0&&(i[o.key]=m)}else{let m=P(o.value,t,r,s);m!==void 0&&(i[o.key]=m)}}else{let f=o.parsedKey?P(o.parsedKey,t,r,s):o.key,m=P(o.value,t,r,s);m!==void 0&&(i[f]=m)}}return i},Zs=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===N.LOOP){let a=P(n,t,r,s);i.push(a)}else i.push(P(n,t,r,s));return i},Se=Js;var ke=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...ke(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]:ke(n)})}}t.push(r)}return t},[]):e;var ri=(e,t)=>t.split(".").reduce((r,s)=>r&&r[s],e),Zt=({h:e,template:t,viewData:r,refs:s,handlers:i})=>{let n=Se({ast:t,data:r}),a=ke(n),o=si({h:e,items:a,refs:s,handlers:i,viewData:r});return e("div",{style:{display:"contents"}},o)},si=({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,f)=>{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 m=Object.entries(l);if(m.length===0)return console.warn("Skipping empty object item:",l),null;let[x,A]=m[0];if(!isNaN(Number(x)))return Array.isArray(A)?n(A,`${o}.${x}`):typeof A=="object"&&A!==null&&Object.entries(A).length>0?n([A],`${o}.${x}`):String(A);m.length>1&&console.warn("Item has multiple keys, processing only the first:",x);let T,p,c=x.indexOf(" ");c===-1?(T=x,p=""):(T=x.substring(0,c),p=x.substring(c+1).trim());let h=T.split(/[.#]/)[0],d=h.includes("-"),g={},_={};if(p){let S=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|(\S+))/g,v;for(;(v=S.exec(p))!==null;)if(v[1].startsWith(".")){let C=v[1].substring(1),L=v[4];_[C]=ri(i,L)}else g[v[1]]=v[2]||v[3]||v[4]}let u=T.match(/#([^.#\s]+)/);u&&!Object.prototype.hasOwnProperty.call(g,"id")&&(g.id=u[1]);let b=null;g.id?b=g.id:d&&(b=h);let y=Object.create(null),k=null;if(d)k=h;else{let S=T.match(/\.([^.#]+)/g);S&&S.forEach(C=>{let L=C.substring(1);y[L]=!0});let v=T.match(/#([^.#\s]+)/);v&&(k=v[1])}let w;typeof A=="string"||typeof A=="number"?w=String(A):Array.isArray(A)?w=n(A,`${o}.${x}`):w=[],k&&!d&&(g.id=k);let E=Object.create(null);if(b&&r){let S=[];if(Object.keys(r).forEach(v=>{if(v.includes("*")){let C="^"+v.replace(/[.*+?^${}()|[\\\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"$";try{new RegExp(C).test(b)&&S.push(v)}catch(L){console.warn(`[Parser] Invalid regex pattern created from refKey '${v}': ${C}`,L)}}else b===v&&S.push(v)}),S.length>0){S.sort((C,L)=>{let W=!C.includes("*"),B=!L.includes("*");return W&&!B?-1:!W&&B?1:L.length-C.length});let v=S[0];if(r[v]&&r[v].eventListeners){let C=r[v].eventListeners;Object.entries(C).forEach(([L,W])=>{W.handler&&s[W.handler]?E[L]=B=>{s[W.handler](B)}:W.handler&&console.warn(`[Parser] Handler '${W.handler}' for refKey '${v}' (matching elementId '${b}') is referenced but not found in available handlers.`)})}}}let O={};if(b)O.key=b;else if(T){let S=o?`${o}.${f}`:String(f);if(O.key=`${T}-${S}`,Object.keys(_).length>0){let v=JSON.stringify(_).substring(0,50);O.key+=`-${v}`}}Object.keys(g).length>0&&(O.attrs=g),Object.keys(y).length>0&&(O.class=y),Object.keys(E).length>0&&(O.on=E),Object.keys(_).length>0&&(O.props=_,d&&(O.hook={update:(S,v)=>{let C=S.data?.props||{},L=v.data?.props||{};if(JSON.stringify(C)!==JSON.stringify(L)){let B=v.elm;B&&B.render&&typeof B.render=="function"&&(B.setAttribute("isDirty","true"),requestAnimationFrame(()=>{B.render(),B.removeAttribute("isDirty")}))}}}));try{return e(h,O,w)}catch(S){return console.error("Error creating virtual node:",S,{tagName:h,snabbdomData:O,childrenOrText:w}),e("div",{},["Error creating element"])}}).filter(Boolean)}return n(t)};var ii=(e,t)=>{if(!t||typeof t!="object")return"";let r="",s=n=>Object.entries(n).map(([a,o])=>` ${a}: ${o};`).join(`
720
+ `),i=(n,a)=>{if(typeof a!="object"||a===null)return"";if(n.startsWith("@")){let o=Object.entries(a).map(([l,f])=>{let m=s(f);return` ${l} {
699
721
  ${m.split(`
700
722
  `).map(x=>x?` ${x}`:"").join(`
701
723
  `)}
@@ -706,7 +728,7 @@ ${o}
706
728
  ${o}
707
729
  }`}};return Object.entries(t).forEach(([n,a])=>{let o=i(n,a);o&&(r+=(r?`
708
730
 
709
- `:"")+o)}),r},qs=e=>{let t=e.map(r=>r.subscribe());return()=>{for(let r of t)r&&typeof r.unsubscribe=="function"&&r.unsubscribe()}};function Xs(e){return new Proxy({},{get(t,r){if(typeof r=="string")return e.getAttribute(r)},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(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 Qs(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 at=class extends HTMLElement{elementName;styles;h;store;props;propsSchema;template;handlers;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_oldVNode;deps;cssText;get viewData(){return this.store.toViewData()}connectedCallback(){this.shadow=this.attachShadow({mode:"open"});let t=new CSSStyleSheet;t.replaceSync(`
731
+ `:"")+o)}),r},ni=e=>{let t=e.map(r=>r.subscribe());return()=>{for(let r of t)r&&typeof r.unsubscribe=="function"&&r.unsubscribe()}};function ai(e){return new Proxy({},{get(t,r){if(typeof r=="string")return e.getAttribute(r)},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(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 oi(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 lt=class extends HTMLElement{elementName;styles;h;store;props;propsSchema;template;handlers;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_oldVNode;deps;cssText;get viewData(){return this.store.toViewData()}connectedCallback(){this.shadow=this.attachShadow({mode:"open"});let t=new CSSStyleSheet;t.replaceSync(`
710
732
  a, a:link, a:visited, a:hover, a:active {
711
733
  display: contents;
712
734
  color: inherit;
@@ -718,4 +740,4 @@ ${o}
718
740
  font: inherit;
719
741
  cursor: pointer;
720
742
  }
721
- `);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=qs(this.handlers.subscriptions(s))),this.handlers?.handleOnMount&&(this._unmountCallback=this.handlers?.handleOnMount(s)),this.render()}disconnectedCallback(){this._unmountCallback&&this._unmountCallback(),this.unsubscribeAll&&this.unsubscribeAll()}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=qt({h:this.h,template:this.template,viewData:this.viewData,refs:this.refs,handlers:this.transformedHandlers}),r={},s=i=>{i.data?.attrs&&i.data.attrs.id&&(r[i.data.attrs.id]=i),i.children&&i.children.forEach(s)};s(t),this.refIds=r,this._oldVNode?this._oldVNode=this.patch(this._oldVNode,t):this._oldVNode=this.patch(this.renderTarget,t)}catch(t){console.error("Error during patching:",t)}}},Zs=(e,t,r)=>{let{INITIAL_STATE:s,toViewData:i,...n}=e,a={},o={},l=structuredClone(s);return Object.entries(n).forEach(([u,m])=>{u.startsWith("select")?a[u]=(...x)=>m({state:l,props:t,attrs:r},...x):o[u]=x=>(l=Ut(l,$=>m($,x)),l)}),{toViewData:()=>i({state:l,props:t,attrs:r}),getState:()=>l,...o,...a}},ei=({handlers:e,view:t,store:r,patch:s,h:i},n)=>{let{elementName:a,propsSchema:o,template:l,refs:u,styles:m}=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 x extends at{constructor(){super();let T=Xs(this);this.propsSchema=o,this.props=o?Qs(this,Object.keys(o.properties)):{},this.elementName=a,this.styles=m,this.store=Zs(r,this.props,T),this.template=l,this.handlers=e,this.refs=u,this.patch=s,this.deps={...n,store:this.store,render:this.render,handlers:e,attrs:T,props:this.props},this.h=i,this.cssText=Gs(a,m)}}return x},ot=ei;function X(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 oe(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function ti(e,t){return document.createElement(e,t)}function ri(e,t,r){return document.createElementNS(e,t,r)}function si(){return Q(document.createDocumentFragment())}function ii(e){return document.createTextNode(e)}function ni(e){return document.createComment(e)}function ai(e,t,r){if(J(e)){let s=e;for(;s&&J(s);)s=Q(s).parent;e=s??e}J(t)&&(t=Q(t,e)),r&&J(r)&&(r=Q(r).firstChildNode),e.insertBefore(t,r)}function oi(e,t){e.removeChild(t)}function li(e,t){J(t)&&(t=Q(t,e)),e.appendChild(t)}function Qt(e){if(J(e)){for(;e&&J(e);)e=Q(e).parent;return e??null}return e.parentNode}function pi(e){var t;if(J(e)){let r=Q(e),s=Qt(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 ci(e){return e.tagName}function hi(e,t){e.textContent=t}function di(e){return e.textContent}function fi(e){return e.nodeType===1}function ui(e){return e.nodeType===3}function mi(e){return e.nodeType===8}function J(e){return e.nodeType===11}function Q(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 Zt={createElement:ti,createElementNS:ri,createTextNode:ii,createDocumentFragment:si,createComment:ni,insertBefore:ai,removeChild:oi,appendChild:li,parentNode:Qt,nextSibling:pi,tagName:ci,setTextContent:hi,getTextContent:di,isElement:fi,isText:ui,isComment:mi,isDocumentFragment:J};function Ae(e){return e===void 0}function z(e){return e!==void 0}var lt=X("",{},[],void 0,void 0);function he(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 gi(){throw new Error("The document fragment is not supported on this platform.")}function yi(e,t){return e.isElement(t)}function vi(e,t){return e.isDocumentFragment(t)}function bi(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 wi=["create","update","remove","destroy","pre","post"];function er(e,t,r){let s={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=t!==void 0?t:Zt;for(let p of wi)for(let c of e){let h=c[p];h!==void 0&&s[p].push(h)}function n(p){let c=p.id?"#"+p.id:"",h=p.getAttribute("class"),d=h?"."+h.split(" ").join("."):"";return X(i.tagName(p).toLowerCase()+c+d,{},[],void 0,p)}function a(p){return X(void 0,{},[],void 0,p)}function o(p,c){return function(){if(--c===0){let d=i.parentNode(p);d!==null&&i.removeChild(d,p)}}}function l(p,c){var h,d,g,_;let f,v=p.data;if(v!==void 0){let w=(h=v.hook)===null||h===void 0?void 0:h.init;z(w)&&(w(p),v=p.data)}let b=p.children,k=p.sel;if(k==="!")Ae(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),O=w>0?w:k.length,S=A>0?A:k.length,y=w!==-1||A!==-1?k.slice(0,Math.min(O,S)):k,C=p.elm=z(v)&&z(f=v.ns)?i.createElementNS(f,y,v):i.createElement(y,v);for(O<S&&C.setAttribute("id",k.slice(O+1,S)),A>0&&C.setAttribute("class",k.slice(S+1).replace(/\./g," ")),f=0;f<s.create.length;++f)s.create[f](lt,p);if(oe(p.text)&&(!ae(b)||b.length===0)&&i.appendChild(C,i.createTextNode(p.text)),ae(b))for(f=0;f<b.length;++f){let V=b[f];V!=null&&i.appendChild(C,l(V,c))}let L=p.data.hook;z(L)&&((d=L.create)===null||d===void 0||d.call(L,lt,p),L.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?_:gi)(),f=0;f<s.create.length;++f)s.create[f](lt,p);for(f=0;f<p.children.length;++f){let w=p.children[f];w!=null&&i.appendChild(p.elm,l(w,c))}}else p.elm=i.createTextNode(p.text);return p.elm}function u(p,c,h,d,g,_){for(;d<=g;++d){let f=h[d];f!=null&&i.insertBefore(p,l(f,_),c)}}function m(p){var c,h;let d=p.data;if(d!==void 0){(h=(c=d?.hook)===null||c===void 0?void 0:c.destroy)===null||h===void 0||h.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"&&m(_)}}}function x(p,c,h,d){for(var g,_;h<=d;++h){let f,v,b=c[h];if(b!=null)if(z(b.sel)){m(b),f=s.remove.length+1,v=o(b.elm,f);for(let w=0;w<s.remove.length;++w)s.remove[w](b,v);let k=(_=(g=b?.data)===null||g===void 0?void 0:g.hook)===null||_===void 0?void 0:_.remove;z(k)?k(b,v):v()}else b.children?(m(b),x(p,b.children,0,b.children.length-1)):i.removeChild(p,b.elm)}}function $(p,c,h,d){let g=0,_=0,f=c.length-1,v=c[0],b=c[f],k=h.length-1,w=h[0],A=h[k],O,S,y,C;for(;g<=f&&_<=k;)v==null?v=c[++g]:b==null?b=c[--f]:w==null?w=h[++_]:A==null?A=h[--k]:he(v,w)?(T(v,w,d),v=c[++g],w=h[++_]):he(b,A)?(T(b,A,d),b=c[--f],A=h[--k]):he(v,A)?(T(v,A,d),i.insertBefore(p,v.elm,i.nextSibling(b.elm)),v=c[++g],A=h[--k]):he(b,w)?(T(b,w,d),i.insertBefore(p,b.elm,v.elm),b=c[--f],w=h[++_]):(O===void 0&&(O=bi(c,g,f)),S=O[w.key],Ae(S)?(i.insertBefore(p,l(w,d),v.elm),w=h[++_]):Ae(O[A.key])?(i.insertBefore(p,l(A,d),i.nextSibling(b.elm)),A=h[--k]):(y=c[S],y.sel!==w.sel?i.insertBefore(p,l(w,d),v.elm):(T(y,w,d),c[S]=void 0,i.insertBefore(p,y.elm,v.elm)),w=h[++_]));_<=k&&(C=h[k+1]==null?null:h[k+1].elm,u(p,C,h,_,k,d)),g<=f&&x(p,c,g,f)}function T(p,c,h){var d,g,_,f,v,b,k,w;let A=(d=c.data)===null||d===void 0?void 0:d.hook;(g=A?.prepatch)===null||g===void 0||g.call(A,p,c);let O=c.elm=p.elm;if(p===c)return;if(c.data!==void 0||z(c.text)&&c.text!==p.text){(_=c.data)!==null&&_!==void 0||(c.data={}),(f=p.data)!==null&&f!==void 0||(p.data={});for(let C=0;C<s.update.length;++C)s.update[C](p,c);(k=(b=(v=c.data)===null||v===void 0?void 0:v.hook)===null||b===void 0?void 0:b.update)===null||k===void 0||k.call(b,p,c)}let S=p.children,y=c.children;Ae(c.text)?z(S)&&z(y)?S!==y&&$(O,S,y,h):z(y)?(z(p.text)&&i.setTextContent(O,""),u(O,null,y,0,y.length-1,h)):z(S)?x(O,S,0,S.length-1):z(p.text)&&i.setTextContent(O,""):p.text!==c.text&&(z(S)&&x(O,S,0,S.length-1),i.setTextContent(O,c.text)),(w=A?.postpatch)===null||w===void 0||w.call(A,p,c)}return function(c,h){let d,g,_,f=[];for(d=0;d<s.pre.length;++d)s.pre[d]();for(yi(i,c)?c=n(c):vi(i,c)&&(c=a(c)),he(c,h)?T(c,h,f):(g=c.elm,_=i.parentNode(g),l(h,f),_!==null&&(i.insertBefore(_,h.elm,i.nextSibling(g)),x(_,[c],0,0))),d=0;d<f.length;++d)f[d].data.hook.insert(f[d]);for(d=0;d<s.post.length;++d)s.post[d]();return h}}function tr(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 rr={create:tr,update:tr};function sr(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 ir={create:sr,update:sr};var xi="http://www.w3.org/1999/xlink",_i="http://www.w3.org/2000/xmlns/",Si="http://www.w3.org/XML/1998/namespace";function nr(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(Si,r,a):r.charCodeAt(5)===58?r.charCodeAt(1)===109?s.setAttributeNS(_i,r,a):s.setAttributeNS(xi,r,a):s.setAttribute(r,a))}for(r in i)r in n||s.removeAttribute(r)}}var ar={create:nr,update:nr};var or=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,ki=function(e){or(function(){or(e)})},pt=!1;function Ai(e,t,r){ki(function(){e[t]=r})}function lr(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])&&Ai(i.style,l,r);else s!=="remove"&&r!==n[s]&&(s[0]==="-"&&s[1]==="-"?i.style.setProperty(s,r):i.style[s]=r)}function Ei(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 $i(e,t){let r=e.data.style;if(!r||!r.remove){t();return}pt||(e.elm.offsetLeft,pt=!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 m=getComputedStyle(i)["transition-property"].split(", ");for(;n<m.length;++n)l.indexOf(m[n])!==-1&&o++;i.addEventListener("transitionend",function(x){x.target===i&&--o,o===0&&t()})}function Oi(){pt=!1}var pr={pre:Oi,create:lr,update:lr,destroy:Ei,remove:$i};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 Ci(e,t){let r=e.type,s=t.data.on;s&&s[r]&&cr(s[r],t,e)}function Ii(){return function e(t){Ci(t,e.vnode)}}function ct(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||Ii();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 hr={create:ct,update:ct,destroy:ct};var Ti=()=>er([rr,ir,ar,pr,hr]),ht=Ti;function dr(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&&dr(n,i.children,i.sel)}}function dt(e,t,r){let s={},i,n,a;if(r!==void 0?(t!==null&&(s=t),ae(r)?i=r:oe(r)?n=r.toString():r&&r.sel&&(i=[r])):t!=null&&(ae(t)?i=t:oe(t)?n=t.toString():t&&t.sel?i=[t]:s=t),i!==void 0)for(a=0;a<i.length;++a)oe(i[a])&&(i[a]=X(void 0,void 0,void 0,i[a],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&dr(s,i,e),X(e,s,i,n,void 0)}var Ni={},fr={components:Ni},ur=ht();var Ee={components:{dialog:{view:$t,store:Pe,handlers:je},select:{store:De,view:Ot,handlers:ze},navbar:{view:Ct,handlers:Re,store:Me},popover:{store:We,handlers:Ve,view:It},form:{store:Fe,handlers:He,view:Tt},sidebar:{store:Ke,view:Nt,handlers:Ue},pageOutline:{store:Je,view:Lt,handlers:Ye}}};Object.keys(Ee).forEach(e=>{Object.keys(Ee[e]).forEach(t=>{let r=ot({...Ee[e][t],patch:ur,h:dt},fr[e]);customElements.define(Ee[e][t].view.elementName,r)})});customElements.define("rtgl-button",gt({}));customElements.define("rtgl-view",bt({}));customElements.define("rtgl-text",xt({}));customElements.define("rtgl-image",_t({}));customElements.define("rtgl-svg",kt({}));customElements.define("rtgl-input",At({}));customElements.define("rtgl-textarea",Et({}));})();
743
+ `);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=ni(this.handlers.subscriptions(s))),this.handlers?.handleOnMount&&(this._unmountCallback=this.handlers?.handleOnMount(s)),this.render()}disconnectedCallback(){this._unmountCallback&&this._unmountCallback(),this.unsubscribeAll&&this.unsubscribeAll()}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=Zt({h:this.h,template:this.template,viewData:this.viewData,refs:this.refs,handlers:this.transformedHandlers}),r={},s=i=>{i.data?.attrs&&i.data.attrs.id&&(r[i.data.attrs.id]=i),i.children&&i.children.forEach(s)};s(t),this.refIds=r,this._oldVNode?this._oldVNode=this.patch(this._oldVNode,t):this._oldVNode=this.patch(this.renderTarget,t)}catch(t){console.error("Error during patching:",t)}}},li=(e,t,r)=>{let{INITIAL_STATE:s,toViewData:i,...n}=e,a={},o={},l=structuredClone(s);return Object.entries(n).forEach(([f,m])=>{f.startsWith("select")?a[f]=(...x)=>m({state:l,props:t,attrs:r},...x):o[f]=x=>(l=Yt(l,A=>m(A,x)),l)}),{toViewData:()=>i({state:l,props:t,attrs:r}),getState:()=>l,...o,...a}},pi=({handlers:e,view:t,store:r,patch:s,h:i},n)=>{let{elementName:a,propsSchema:o,template:l,refs:f,styles:m}=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 x extends lt{constructor(){super();let T=ai(this);this.propsSchema=o,this.props=o?oi(this,Object.keys(o.properties)):{},this.elementName=a,this.styles=m,this.store=li(r,this.props,T),this.template=l,this.handlers=e,this.refs=f,this.patch=s,this.deps={...n,store:this.store,render:this.render,handlers:e,attrs:T,props:this.props},this.h=i,this.cssText=ii(a,m)}}return x},pt=pi;function X(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 oe(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function ci(e,t){return document.createElement(e,t)}function hi(e,t,r){return document.createElementNS(e,t,r)}function di(){return Q(document.createDocumentFragment())}function ui(e){return document.createTextNode(e)}function fi(e){return document.createComment(e)}function mi(e,t,r){if(q(e)){let s=e;for(;s&&q(s);)s=Q(s).parent;e=s??e}q(t)&&(t=Q(t,e)),r&&q(r)&&(r=Q(r).firstChildNode),e.insertBefore(t,r)}function gi(e,t){e.removeChild(t)}function yi(e,t){q(t)&&(t=Q(t,e)),e.appendChild(t)}function tr(e){if(q(e)){for(;e&&q(e);)e=Q(e).parent;return e??null}return e.parentNode}function vi(e){var t;if(q(e)){let r=Q(e),s=tr(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 bi(e){return e.tagName}function wi(e,t){e.textContent=t}function xi(e){return e.textContent}function _i(e){return e.nodeType===1}function Si(e){return e.nodeType===3}function ki(e){return e.nodeType===8}function q(e){return e.nodeType===11}function Q(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 rr={createElement:ci,createElementNS:hi,createTextNode:ui,createDocumentFragment:di,createComment:fi,insertBefore:mi,removeChild:gi,appendChild:yi,parentNode:tr,nextSibling:vi,tagName:bi,setTextContent:wi,getTextContent:xi,isElement:_i,isText:Si,isComment:ki,isDocumentFragment:q};function Ae(e){return e===void 0}function z(e){return e!==void 0}var ct=X("",{},[],void 0,void 0);function he(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 Ai(){throw new Error("The document fragment is not supported on this platform.")}function Ei(e,t){return e.isElement(t)}function $i(e,t){return e.isDocumentFragment(t)}function Oi(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 Ci=["create","update","remove","destroy","pre","post"];function sr(e,t,r){let s={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=t!==void 0?t:rr;for(let p of Ci)for(let c of e){let h=c[p];h!==void 0&&s[p].push(h)}function n(p){let c=p.id?"#"+p.id:"",h=p.getAttribute("class"),d=h?"."+h.split(" ").join("."):"";return X(i.tagName(p).toLowerCase()+c+d,{},[],void 0,p)}function a(p){return X(void 0,{},[],void 0,p)}function o(p,c){return function(){if(--c===0){let d=i.parentNode(p);d!==null&&i.removeChild(d,p)}}}function l(p,c){var h,d,g,_;let u,b=p.data;if(b!==void 0){let w=(h=b.hook)===null||h===void 0?void 0:h.init;z(w)&&(w(p),b=p.data)}let y=p.children,k=p.sel;if(k==="!")Ae(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("#"),E=k.indexOf(".",w),O=w>0?w:k.length,S=E>0?E:k.length,v=w!==-1||E!==-1?k.slice(0,Math.min(O,S)):k,C=p.elm=z(b)&&z(u=b.ns)?i.createElementNS(u,v,b):i.createElement(v,b);for(O<S&&C.setAttribute("id",k.slice(O+1,S)),E>0&&C.setAttribute("class",k.slice(S+1).replace(/\./g," ")),u=0;u<s.create.length;++u)s.create[u](ct,p);if(oe(p.text)&&(!ae(y)||y.length===0)&&i.appendChild(C,i.createTextNode(p.text)),ae(y))for(u=0;u<y.length;++u){let W=y[u];W!=null&&i.appendChild(C,l(W,c))}let L=p.data.hook;z(L)&&((d=L.create)===null||d===void 0||d.call(L,ct,p),L.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?_:Ai)(),u=0;u<s.create.length;++u)s.create[u](ct,p);for(u=0;u<p.children.length;++u){let w=p.children[u];w!=null&&i.appendChild(p.elm,l(w,c))}}else p.elm=i.createTextNode(p.text);return p.elm}function f(p,c,h,d,g,_){for(;d<=g;++d){let u=h[d];u!=null&&i.insertBefore(p,l(u,_),c)}}function m(p){var c,h;let d=p.data;if(d!==void 0){(h=(c=d?.hook)===null||c===void 0?void 0:c.destroy)===null||h===void 0||h.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"&&m(_)}}}function x(p,c,h,d){for(var g,_;h<=d;++h){let u,b,y=c[h];if(y!=null)if(z(y.sel)){m(y),u=s.remove.length+1,b=o(y.elm,u);for(let w=0;w<s.remove.length;++w)s.remove[w](y,b);let k=(_=(g=y?.data)===null||g===void 0?void 0:g.hook)===null||_===void 0?void 0:_.remove;z(k)?k(y,b):b()}else y.children?(m(y),x(p,y.children,0,y.children.length-1)):i.removeChild(p,y.elm)}}function A(p,c,h,d){let g=0,_=0,u=c.length-1,b=c[0],y=c[u],k=h.length-1,w=h[0],E=h[k],O,S,v,C;for(;g<=u&&_<=k;)b==null?b=c[++g]:y==null?y=c[--u]:w==null?w=h[++_]:E==null?E=h[--k]:he(b,w)?(T(b,w,d),b=c[++g],w=h[++_]):he(y,E)?(T(y,E,d),y=c[--u],E=h[--k]):he(b,E)?(T(b,E,d),i.insertBefore(p,b.elm,i.nextSibling(y.elm)),b=c[++g],E=h[--k]):he(y,w)?(T(y,w,d),i.insertBefore(p,y.elm,b.elm),y=c[--u],w=h[++_]):(O===void 0&&(O=Oi(c,g,u)),S=O[w.key],Ae(S)?(i.insertBefore(p,l(w,d),b.elm),w=h[++_]):Ae(O[E.key])?(i.insertBefore(p,l(E,d),i.nextSibling(y.elm)),E=h[--k]):(v=c[S],v.sel!==w.sel?i.insertBefore(p,l(w,d),b.elm):(T(v,w,d),c[S]=void 0,i.insertBefore(p,v.elm,b.elm)),w=h[++_]));_<=k&&(C=h[k+1]==null?null:h[k+1].elm,f(p,C,h,_,k,d)),g<=u&&x(p,c,g,u)}function T(p,c,h){var d,g,_,u,b,y,k,w;let E=(d=c.data)===null||d===void 0?void 0:d.hook;(g=E?.prepatch)===null||g===void 0||g.call(E,p,c);let O=c.elm=p.elm;if(p===c)return;if(c.data!==void 0||z(c.text)&&c.text!==p.text){(_=c.data)!==null&&_!==void 0||(c.data={}),(u=p.data)!==null&&u!==void 0||(p.data={});for(let C=0;C<s.update.length;++C)s.update[C](p,c);(k=(y=(b=c.data)===null||b===void 0?void 0:b.hook)===null||y===void 0?void 0:y.update)===null||k===void 0||k.call(y,p,c)}let S=p.children,v=c.children;Ae(c.text)?z(S)&&z(v)?S!==v&&A(O,S,v,h):z(v)?(z(p.text)&&i.setTextContent(O,""),f(O,null,v,0,v.length-1,h)):z(S)?x(O,S,0,S.length-1):z(p.text)&&i.setTextContent(O,""):p.text!==c.text&&(z(S)&&x(O,S,0,S.length-1),i.setTextContent(O,c.text)),(w=E?.postpatch)===null||w===void 0||w.call(E,p,c)}return function(c,h){let d,g,_,u=[];for(d=0;d<s.pre.length;++d)s.pre[d]();for(Ei(i,c)?c=n(c):$i(i,c)&&(c=a(c)),he(c,h)?T(c,h,u):(g=c.elm,_=i.parentNode(g),l(h,u),_!==null&&(i.insertBefore(_,h.elm,i.nextSibling(g)),x(_,[c],0,0))),d=0;d<u.length;++d)u[d].data.hook.insert(u[d]);for(d=0;d<s.post.length;++d)s.post[d]();return h}}function ir(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 nr={create:ir,update:ir};function ar(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 or={create:ar,update:ar};var Ii="http://www.w3.org/1999/xlink",Ti="http://www.w3.org/2000/xmlns/",Ni="http://www.w3.org/XML/1998/namespace";function lr(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(Ni,r,a):r.charCodeAt(5)===58?r.charCodeAt(1)===109?s.setAttributeNS(Ti,r,a):s.setAttributeNS(Ii,r,a):s.setAttribute(r,a))}for(r in i)r in n||s.removeAttribute(r)}}var pr={create:lr,update:lr};var cr=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,Li=function(e){cr(function(){cr(e)})},ht=!1;function Pi(e,t,r){Li(function(){e[t]=r})}function hr(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])&&Pi(i.style,l,r);else s!=="remove"&&r!==n[s]&&(s[0]==="-"&&s[1]==="-"?i.style.setProperty(s,r):i.style[s]=r)}function ji(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 Di(e,t){let r=e.data.style;if(!r||!r.remove){t();return}ht||(e.elm.offsetLeft,ht=!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 m=getComputedStyle(i)["transition-property"].split(", ");for(;n<m.length;++n)l.indexOf(m[n])!==-1&&o++;i.addEventListener("transitionend",function(x){x.target===i&&--o,o===0&&t()})}function zi(){ht=!1}var dr={pre:zi,create:hr,update:hr,destroy:ji,remove:Di};function ur(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++)ur(e[s],t,r)}function Mi(e,t){let r=e.type,s=t.data.on;s&&s[r]&&ur(s[r],t,e)}function Ri(){return function e(t){Mi(t,e.vnode)}}function dt(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||Ri();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 fr={create:dt,update:dt,destroy:dt};var Vi=()=>sr([nr,or,pr,dr,fr]),ut=Vi;function mr(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&&mr(n,i.children,i.sel)}}function ft(e,t,r){let s={},i,n,a;if(r!==void 0?(t!==null&&(s=t),ae(r)?i=r:oe(r)?n=r.toString():r&&r.sel&&(i=[r])):t!=null&&(ae(t)?i=t:oe(t)?n=t.toString():t&&t.sel?i=[t]:s=t),i!==void 0)for(a=0;a<i.length;++a)oe(i[a])&&(i[a]=X(void 0,void 0,void 0,i[a],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&mr(s,i,e),X(e,s,i,n,void 0)}var Wi={},gr={components:Wi},yr=ut();var Ee={components:{popover:{store:Pe,view:Ct,handlers:je},form:{store:De,handlers:ze,view:It},select:{handlers:Me,store:Re,view:Tt},dialog:{view:Nt,handlers:Ve,store:We},navbar:{store:He,handlers:Fe,view:Lt},dropdownMenu:{store:Be,view:Pt,handlers:Ke},pageOutline:{store:Ue,view:jt,handlers:qe},sidebar:{handlers:Je,store:Ge,view:zt}}};Object.keys(Ee).forEach(e=>{Object.keys(Ee[e]).forEach(t=>{let r=pt({...Ee[e][t],patch:yr,h:ft},gr[e]);customElements.define(Ee[e][t].view.elementName,r)})});customElements.define("rtgl-button",vt({}));customElements.define("rtgl-view",xt({}));customElements.define("rtgl-text",St({}));customElements.define("rtgl-image",kt({}));customElements.define("rtgl-svg",Et({}));customElements.define("rtgl-input",$t({}));customElements.define("rtgl-textarea",Ot({}));})();