@rettangoli/ui 0.1.2-rc18 → 0.1.2-rc19

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,19 +1,19 @@
1
- var rettangoli=(()=>{var Qr=Object.defineProperty;var V=(e,t)=>{for(var r in t)Qr(e,r,{get:t[r],enumerable:!0})};function C(e,...t){let r="";return e.forEach((s,i)=>{r+=s+(t[i]||"")}),r}var Zr=["xs","sm","md","lg","xl"],jt={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"},Y=Object.keys(jt),X=e=>e.concat(Zr.flatMap(t=>e.map(r=>`${t}-${r}`))),Rt={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)"},q=(e,t={})=>{let r="";for(let[s,i]of Object.entries(Rt)){s!=="default"&&(r+=`${i} {`);for(let[n,o]of Object.entries(e)){let a=t[n]?` ${t[n]} `:" ";for(let[l,p]of Object.entries(o)){let h=jt[n],d=p.startsWith("--")?`var(${p})`:p,m=s==="default"?n:`${s}-${n}`,v=s==="default"?`h-${n}`:`${s}-h-${n}`;if(h){let u=h.split(" ").map(f=>`${f}: ${d};`).join(" ");r+=`
2
- :host([${m}="${l}"])${a}{
1
+ var rettangoli=(()=>{var Zr=Object.defineProperty;var N=(e,t)=>{for(var r in t)Zr(e,r,{get:t[r],enumerable:!0})};function C(e,...t){let r="";return e.forEach((s,i)=>{r+=s+(t[i]||"")}),r}var es=["xs","sm","md","lg","xl"],jt={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"},Y=Object.keys(jt),X=e=>e.concat(es.flatMap(t=>e.map(r=>`${t}-${r}`))),Rt={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)"},q=(e,t={})=>{let r="";for(let[s,i]of Object.entries(Rt)){s!=="default"&&(r+=`${i} {`);for(let[n,a]of Object.entries(e)){let o=t[n]?` ${t[n]} `:" ";for(let[l,p]of Object.entries(a)){let h=jt[n],d=p.startsWith("--")?`var(${p})`:p,m=s==="default"?n:`${s}-${n}`,v=s==="default"?`h-${n}`:`${s}-h-${n}`;if(h){let u=h.split(" ").map(f=>`${f}: ${d};`).join(" ");r+=`
2
+ :host([${m}="${l}"])${o}{
3
3
  ${u}
4
4
  }
5
- :host([${v}="${l}"]:hover)${a}{
5
+ :host([${v}="${l}"]:hover)${o}{
6
6
  ${u}
7
7
  }
8
8
  `}else r+=`
9
- :host([${m}="${l}"])${a}{
9
+ :host([${m}="${l}"])${o}{
10
10
  ${p}
11
11
  }
12
- :host([${v}="${l}"]:hover)${a}{
12
+ :host([${v}="${l}"]:hover)${o}{
13
13
  ${p}
14
14
  }
15
- `}}s!=="default"&&(r+="}")}return r};function es(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var ts=e=>/%$/.test(e),P=e=>{if(e!==void 0)return ts(e)?e:es(e)?`${e}px`:Object.keys(O).includes(e)?`var(${O[e]})`:e},O={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function Q(e,t=":host"){let r="";for(let[s,i]of Object.entries(Rt)){s!=="default"&&(r+=`${i} {
16
- `);let n="";for(let[o,a]of Object.entries(e[s]))a!=null&&(n+=`${o}: ${a};
15
+ `}}s!=="default"&&(r+="}")}return r};function ts(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var rs=e=>/%$/.test(e),P=e=>{if(e!==void 0)return rs(e)?e:ts(e)?`${e}px`:Object.keys(O).includes(e)?`var(${O[e]})`:e},O={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function Q(e,t=":host"){let r="";for(let[s,i]of Object.entries(Rt)){s!=="default"&&(r+=`${i} {
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()}
19
19
  }
@@ -58,7 +58,7 @@ var rettangoli=(()=>{var Qr=Object.defineProperty;var V=(e,t)=>{for(var r in t)Q
58
58
  :host([flex="12"]) {
59
59
  flex: 12;
60
60
  }
61
- `;var rs={mt:O,mr:O,mb:O,ml:O,m:O,mh:O,mv:O,s:{sm:`
61
+ `;var ss={mt:O,mr:O,mb:O,ml:O,m:O,mh:O,mv:O,s:{sm:`
62
62
  height: 28px;
63
63
  padding-left: 12px;
64
64
  padding-right: 12px;
@@ -104,7 +104,7 @@ var rettangoli=(()=>{var Qr=Object.defineProperty;var V=(e,t)=>{for(var r in t)Q
104
104
  `,lk:`
105
105
  background-color: transparent;
106
106
  color: var(--foreground);
107
- `}},ss={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},Dt=q(rs,ss);var oe=C`
107
+ `}},is={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},Dt=q(ss,is);var oe=C`
108
108
  a, a:link, a:visited, a:hover, a:active {
109
109
  color: inherit;
110
110
  text-decoration: none;
@@ -258,7 +258,7 @@ var rettangoli=(()=>{var Qr=Object.defineProperty;var V=(e,t)=>{for(var r in t)Q
258
258
 
259
259
  ${Dt}
260
260
  ${ae}
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 a={sm:14,lg:22},l=this.getAttribute("s");n=a[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=P(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="")}},Mt=({render:e,html:t})=>Re;var Wt=C`
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=P(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="")}},Mt=({render:e,html:t})=>Re;var Wt=C`
262
262
 
263
263
  :host([d="h"]) {
264
264
  flex-direction: row;
@@ -329,7 +329,7 @@ var rettangoli=(()=>{var Qr=Object.defineProperty;var V=(e,t)=>{for(var r in t)Q
329
329
  justify-content: center;
330
330
  }
331
331
  }
332
- `;var is={cur:{p:"pointer",m:"move",grab:"grab",grabbing:"grabbing"}},W=q(is);var Bt=C`
332
+ `;var ns={cur:{p:"pointer",m:"move",grab:"grab",grabbing:"grabbing"}},W=q(ns);var Bt=C`
333
333
  :host([sh]:not([sv])) {
334
334
  overflow-x: scroll;
335
335
  flex-wrap: nowrap;
@@ -347,7 +347,7 @@ var rettangoli=(()=>{var Qr=Object.defineProperty;var V=(e,t)=>{for(var r in t)Q
347
347
  flex-wrap: nowrap;
348
348
  }
349
349
 
350
- `;var me={xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},ns={bgc:{pr:`
350
+ `;var me={xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},as={bgc:{pr:`
351
351
  background-color: var(--primary);
352
352
  `,se:`
353
353
  background-color: var(--secondary);
@@ -387,7 +387,7 @@ var rettangoli=(()=>{var Qr=Object.defineProperty;var V=(e,t)=>{for(var r in t)Q
387
387
  left: 0;
388
388
  top: 0;
389
389
  height: 100%;
390
- `},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:O,pr:O,pb:O,pl:O,p:O,ph:O,pv:O,g:O,gv:O,gh:O,bw:me,bwt:me,bwr:me,bwb:me,bwl:me,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},we=q(ns);var as={mt:O,mr:O,mb:O,ml:O,m:O,mh:O,mv:O},B=q(as);var De=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(C`
390
+ `},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:O,pr:O,pb:O,pl:O,p:O,ph:O,pv:O,g:O,gv:O,gh:O,bw:me,bwt:me,bwr:me,bwb:me,bwl:me,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},we=q(as);var os={mt:O,mr:O,mb:O,ml:O,m:O,mh:O,mv:O},B=q(os);var De=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(C`
391
391
  slot {
392
392
  display: contents;
393
393
  }
@@ -427,7 +427,7 @@ var rettangoli=(()=>{var Qr=Object.defineProperty;var V=(e,t)=>{for(var r in t)Q
427
427
  bottom: 0;
428
428
  z-index: 1;
429
429
  }
430
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","target","op",...X([...Y,"wh","w","h","hidden","sh","sv","z"])]}_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 o=m=>`${n==="default"?"":`${n}-`}${m}`,a=this.getAttribute(o("wh")),l=P(a===null?this.getAttribute(o("w")):a),p=P(a===null?this.getAttribute(o("h")):a),h=this.getAttribute(o("op")),d=this.getAttribute(o("z"));d!==null&&(this._styles[n]["z-index"]=d),h!==null&&(this._styles[n].opacity=h),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),p==="f"?this._styles[n].height="100%":p!==void 0&&(this._styles[n].height=p,this._styles[n]["min-height"]=p,this._styles[n]["max-height"]=p),this.hasAttribute(o("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[n].display="flex !important")});let i=Q(this._styles);i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}},zt=({render:e,html:t})=>De;var os={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",...X([...Y,"wh","w","h","hidden","sh","sv","z"])]}_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=m=>`${n==="default"?"":`${n}-`}${m}`,o=this.getAttribute(a("wh")),l=P(o===null?this.getAttribute(a("w")):o),p=P(o===null?this.getAttribute(a("h")):o),h=this.getAttribute(a("op")),d=this.getAttribute(a("z"));d!==null&&(this._styles[n]["z-index"]=d),h!==null&&(this._styles[n].opacity=h),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),p==="f"?this._styles[n].height="100%":p!==void 0&&(this._styles[n].height=p,this._styles[n]["min-height"]=p,this._styles[n]["max-height"]=p),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="flex !important")});let i=Q(this._styles);i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}},zt=({render:e,html:t})=>De;var ls={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
431
431
  font-size: var(--h1-font-size);
432
432
  font-weight: var(--h1-font-weight);
433
433
  line-height: var(--h1-line-height);
@@ -467,7 +467,7 @@ var rettangoli=(()=>{var Qr=Object.defineProperty;var V=(e,t)=>{for(var r in t)Q
467
467
  font-weight: var(--xs-font-weight);
468
468
  line-height: var(--xs-line-height);
469
469
  letter-spacing: var(--xs-letter-spacing);
470
- `}},Kt=q(os);var ls={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},xe=q(ls);var Me=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(C`
470
+ `}},Kt=q(ls);var ps={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},xe=q(ps);var Me=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(C`
471
471
  :host {
472
472
  display: block;
473
473
  font-size: var(--md-font-size);
@@ -541,7 +541,7 @@ var rettangoli=(()=>{var Qr=Object.defineProperty;var V=(e,t)=>{for(var r in t)Q
541
541
  ${we}
542
542
  ${B}
543
543
  ${W}
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 X([...Y,"key","src","href","target","wh","w","h","hidden","height","width","z"])}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");t?(this._linkElement||(this._linkElement=document.createElement("a")),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target"),this._linkElement.appendChild(this._imgElement),this._linkElement.parentNode!==this.shadow&&this.shadow.appendChild(this._linkElement)):this._linkElement?(this._imgElement.parentNode===this._linkElement&&this.shadow.appendChild(this._imgElement),this._linkElement.parentNode===this.shadow&&this.shadow.removeChild(this._linkElement),this._linkElement=null):this._imgElement.parentNode!==this.shadow&&this.shadow.appendChild(this._imgElement)}attributeChangedCallback(t,r,s){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let o=m=>`${n==="default"?"":`${n}-`}${m}`,a=this.getAttribute(o("wh")),l=P(a===null?this.getAttribute(o("w")):a),p=P(a===null?this.getAttribute(o("h")):a),h=this.getAttribute(o("o")),d=this.getAttribute(o("z"));d!==null&&(this._styles[n]["z-index"]=d),h!==null&&(this._styles[n].opacity=h),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),p==="f"?this._styles[n].height="100%":p!==void 0&&(this._styles[n].height=p,this._styles[n]["min-height"]=p,this._styles[n]["max-height"]=p),this.hasAttribute(o("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[n].display="block !important")});let i=Q(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()}},Ht=({render:e,html:t})=>We;var Ut=C`
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 X([...Y,"key","src","href","target","wh","w","h","hidden","height","width","z"])}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");t?(this._linkElement||(this._linkElement=document.createElement("a")),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target"),this._linkElement.appendChild(this._imgElement),this._linkElement.parentNode!==this.shadow&&this.shadow.appendChild(this._linkElement)):this._linkElement?(this._imgElement.parentNode===this._linkElement&&this.shadow.appendChild(this._imgElement),this._linkElement.parentNode===this.shadow&&this.shadow.removeChild(this._linkElement),this._linkElement=null):this._imgElement.parentNode!==this.shadow&&this.shadow.appendChild(this._imgElement)}attributeChangedCallback(t,r,s){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=m=>`${n==="default"?"":`${n}-`}${m}`,o=this.getAttribute(a("wh")),l=P(o===null?this.getAttribute(a("w")):o),p=P(o===null?this.getAttribute(a("h")):o),h=this.getAttribute(a("o")),d=this.getAttribute(a("z"));d!==null&&(this._styles[n]["z-index"]=d),h!==null&&(this._styles[n].opacity=h),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),p==="f"?this._styles[n].height="100%":p!==void 0&&(this._styles[n].height=p,this._styles[n]["min-height"]=p,this._styles[n]["max-height"]=p),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=Q(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()}},Ht=({render:e,html:t})=>We;var Ut=C`
545
545
  :host([pt="xs"]) svg {
546
546
  padding-top: var(--spacing-xs);
547
547
  }
@@ -700,7 +700,7 @@ var rettangoli=(()=>{var Qr=Object.defineProperty;var V=(e,t)=>{for(var r in t)Q
700
700
  }
701
701
  ${B}
702
702
  ${W}
703
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","s",...X([...Y,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onChange=t=>{this.dispatchEvent(new CustomEvent("input-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(["type","placeholder","disabled","value","step","s"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let o=m=>`${n==="default"?"":`${n}-`}${m}`,a=this.getAttribute(o("wh")),l=P(a===null?this.getAttribute(o("w")):a),p=P(a===null?this.getAttribute(o("h")):a),h=this.getAttribute(o("op")),d=this.getAttribute(o("z"));d!==null&&(this._styles[n]["z-index"]=d),h!==null&&(this._styles[n].opacity=h),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),p==="f"?this._styles[n].height="100%":p!==void 0&&(this._styles[n].height=p,this._styles[n]["min-height"]=p,this._styles[n]["max-height"]=p),this.hasAttribute(o("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[n].display="block !important")});let i=Q(this._styles,"input");i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("type")||"text",r=this.getAttribute("placeholder"),s=this.getAttribute("value"),i=this.getAttribute("step"),n=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),r!==null?this._inputElement.setAttribute("placeholder",r):this._inputElement.removeAttribute("placeholder"),s!==null&&(this._inputElement.value=s),i!==null?this._inputElement.setAttribute("step",i):this._inputElement.removeAttribute("step"),n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Jt=({render:e,html:t})=>ze;var Ke=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(C`
703
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","s",...X([...Y,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onChange=t=>{this.dispatchEvent(new CustomEvent("input-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(["type","placeholder","disabled","value","step","s"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=m=>`${n==="default"?"":`${n}-`}${m}`,o=this.getAttribute(a("wh")),l=P(o===null?this.getAttribute(a("w")):o),p=P(o===null?this.getAttribute(a("h")):o),h=this.getAttribute(a("op")),d=this.getAttribute(a("z"));d!==null&&(this._styles[n]["z-index"]=d),h!==null&&(this._styles[n].opacity=h),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),p==="f"?this._styles[n].height="100%":p!==void 0&&(this._styles[n].height=p,this._styles[n]["min-height"]=p,this._styles[n]["max-height"]=p),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=Q(this._styles,"input");i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("type")||"text",r=this.getAttribute("placeholder"),s=this.getAttribute("value"),i=this.getAttribute("step"),n=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),r!==null?this._inputElement.setAttribute("placeholder",r):this._inputElement.removeAttribute("placeholder"),s!==null&&(this._inputElement.value=s),i!==null?this._inputElement.setAttribute("step",i):this._inputElement.removeAttribute("step"),n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Jt=({render:e,html:t})=>ze;var Ke=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(C`
704
704
  :host {
705
705
  display: contents;
706
706
  }
@@ -748,7 +748,7 @@ var rettangoli=(()=>{var Qr=Object.defineProperty;var V=(e,t)=>{for(var r in t)Q
748
748
  }
749
749
  ${B}
750
750
  ${W}
751
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="color",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("change",this._onChange),this._inputElement.addEventListener("input",this._onInput)}static get observedAttributes(){return["key","value","disabled",...X([...Y,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=t=>{this.dispatchEvent(new CustomEvent("colorpicker-change",{detail:{value:this._inputElement.value}}))};_onInput=t=>{this.dispatchEvent(new CustomEvent("colorpicker-input",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let o=m=>`${n==="default"?"":`${n}-`}${m}`,a=this.getAttribute(o("wh")),l=P(a===null?this.getAttribute(o("w")):a),p=P(a===null?this.getAttribute(o("h")):a),h=this.getAttribute(o("op")),d=this.getAttribute(o("z"));d!==null&&(this._styles[n]["z-index"]=d),h!==null&&(this._styles[n].opacity=h),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),p==="f"?this._styles[n].height="100%":p!==void 0&&(this._styles[n].height=p,this._styles[n]["min-height"]=p,this._styles[n]["max-height"]=p),this.hasAttribute(o("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[n].display="block !important")});let i=Q(this._styles,'input[type="color"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.hasAttribute("disabled");t!==null&&(this._inputElement.value=t),r?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Yt=({render:e,html:t})=>Fe;var He=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(C`
751
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="color",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("change",this._onChange),this._inputElement.addEventListener("input",this._onInput)}static get observedAttributes(){return["key","value","disabled",...X([...Y,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=t=>{this.dispatchEvent(new CustomEvent("colorpicker-change",{detail:{value:this._inputElement.value}}))};_onInput=t=>{this.dispatchEvent(new CustomEvent("colorpicker-input",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=m=>`${n==="default"?"":`${n}-`}${m}`,o=this.getAttribute(a("wh")),l=P(o===null?this.getAttribute(a("w")):o),p=P(o===null?this.getAttribute(a("h")):o),h=this.getAttribute(a("op")),d=this.getAttribute(a("z"));d!==null&&(this._styles[n]["z-index"]=d),h!==null&&(this._styles[n].opacity=h),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),p==="f"?this._styles[n].height="100%":p!==void 0&&(this._styles[n].height=p,this._styles[n]["min-height"]=p,this._styles[n]["max-height"]=p),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=Q(this._styles,'input[type="color"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.hasAttribute("disabled");t!==null&&(this._inputElement.value=t),r?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Yt=({render:e,html:t})=>Fe;var He=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(C`
752
752
  :host {
753
753
  display: contents;
754
754
  }
@@ -802,7 +802,7 @@ var rettangoli=(()=>{var Qr=Object.defineProperty;var V=(e,t)=>{for(var r in t)Q
802
802
  }
803
803
  ${B}
804
804
  ${W}
805
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",...X([...Y,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=t=>{this.dispatchEvent(new CustomEvent("slider-input",{detail:{value:this._inputElement.value}}))};_onChange=t=>{this.dispatchEvent(new CustomEvent("slider-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(["value","min","max","step","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let o=m=>`${n==="default"?"":`${n}-`}${m}`,a=this.getAttribute(o("wh")),l=P(a===null?this.getAttribute(o("w")):a),p=P(a===null?this.getAttribute(o("h")):a),h=this.getAttribute(o("op")),d=this.getAttribute(o("z"));d!==null&&(this._styles[n]["z-index"]=d),h!==null&&(this._styles[n].opacity=h),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),p==="f"?this._styles[n].height="100%":p!==void 0&&(this._styles[n].height=p,this._styles[n]["min-height"]=p,this._styles[n]["max-height"]=p),this.hasAttribute(o("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[n].display="block !important")});let i=Q(this._styles,'input[type="range"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.getAttribute("min"),s=this.getAttribute("max"),i=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null&&(this._inputElement.value=t),r!==null?this._inputElement.min=r:this._inputElement.min="0",s!==null?this._inputElement.max=s:this._inputElement.max="100",i!==null?this._inputElement.step=i:this._inputElement.step="1",n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Xt=({render:e,html:t})=>He;var Ue=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(C`
805
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",...X([...Y,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=t=>{this.dispatchEvent(new CustomEvent("slider-input",{detail:{value:this._inputElement.value}}))};_onChange=t=>{this.dispatchEvent(new CustomEvent("slider-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(["value","min","max","step","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=m=>`${n==="default"?"":`${n}-`}${m}`,o=this.getAttribute(a("wh")),l=P(o===null?this.getAttribute(a("w")):o),p=P(o===null?this.getAttribute(a("h")):o),h=this.getAttribute(a("op")),d=this.getAttribute(a("z"));d!==null&&(this._styles[n]["z-index"]=d),h!==null&&(this._styles[n].opacity=h),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),p==="f"?this._styles[n].height="100%":p!==void 0&&(this._styles[n].height=p,this._styles[n]["min-height"]=p,this._styles[n]["max-height"]=p),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=Q(this._styles,'input[type="range"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.getAttribute("min"),s=this.getAttribute("max"),i=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null&&(this._inputElement.value=t),r!==null?this._inputElement.min=r:this._inputElement.min="0",s!==null?this._inputElement.max=s:this._inputElement.max="100",i!==null?this._inputElement.step=i:this._inputElement.step="1",n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Xt=({render:e,html:t})=>He;var Ue=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(C`
806
806
  :host {
807
807
  display: contents;
808
808
  }
@@ -916,19 +916,19 @@ var rettangoli=(()=>{var Qr=Object.defineProperty;var V=(e,t)=>{for(var r in t)Q
916
916
  min-width: 200px;
917
917
  max-width: 400px;
918
918
  }
919
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._popoverOverlay=document.createElement("div"),this._popoverOverlay.className="popover-overlay",this.shadow.appendChild(this._popoverOverlay),this._popoverOverlay.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._popoverOverlay.addEventListener("contextmenu",t=>{t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this.shadow.appendChild(this._popoverContainer),this._slotElement=null,this._isOpen=!1,this._handleEscKey=this._handleEscKey.bind(this)}static get observedAttributes(){return["open","x","y","placement"]}connectedCallback(){this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._removeGlobalListeners()}attributeChangedCallback(t,r,s){t==="open"?s!==null&&!this._isOpen?this._show():s===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="placement")&&this._isOpen&&this._updatePosition()}_show(){this._isOpen||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._updatePosition(),this._addGlobalListeners())}_hide(){this._isOpen&&(this._isOpen=!1,this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null),this._removeGlobalListeners())}_updatePosition(){let t=parseFloat(this.getAttribute("x")||"0"),r=parseFloat(this.getAttribute("y")||"0"),s=this.getAttribute("placement")||"bottom-start";this.removeAttribute("positioned"),requestAnimationFrame(()=>{let i=this._popoverContainer.getBoundingClientRect(),{left:n,top:o}=this._calculatePosition(t,r,i.width,i.height,s);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${o}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,r,s,i,n){let a=t,l=r;switch(n){case"top":a=t-s/2,l=r-i-8;break;case"top-start":a=t,l=r-i-8;break;case"top-end":a=t-s,l=r-i-8;break;case"right":a=t+8,l=r-i/2;break;case"right-start":a=t+8,l=r;break;case"right-end":a=t+8,l=r-i;break;case"bottom":a=t-s/2,l=r+8;break;case"bottom-start":a=t,l=r+8;break;case"bottom-end":a=t-s,l=r+8;break;case"left":a=t-s-8,l=r-i/2;break;case"left-start":a=t-s-8,l=r;break;case"left-end":a=t-s-8,l=r-i;break}let p=8;return a=Math.max(p,Math.min(a,window.innerWidth-s-p)),l=Math.max(p,Math.min(l,window.innerHeight-i-p)),{left:a,top:l}}_addGlobalListeners(){setTimeout(()=>{document.addEventListener("keydown",this._handleEscKey)},0)}_removeGlobalListeners(){document.removeEventListener("keydown",this._handleEscKey)}_handleEscKey(t){t.key==="Escape"&&this.dispatchEvent(new CustomEvent("close",{detail:{}}))}get popover(){return this._popoverContainer}},Zt=({render:e,html:t})=>qe;var Je={};V(Je,{handleClickItem:()=>ps});var ps=(e,t)=>{let{dispatchEvent:r}=t,s=e.currentTarget.dataset.id;r(new CustomEvent("item-click",{detail:{id:s}}))};var Ge={};V(Ge,{INITIAL_STATE:()=>cs,toViewData:()=>us});var cs=Object.freeze({}),ds=["id","class","style","slot"],hs=e=>Object.entries(e).filter(([t])=>!ds.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),us=({props:e,attrs:t})=>{let r=hs(t),s=e.items||[],i=e.separator||"breadcrumb-arrow",n=[];return s.forEach((o,a)=>{n.push(o),a<s.length-1&&n.push({isSeparator:!0})}),{containerAttrString:r,items:n,separator:i}};var er={elementName:"rtgl-breadcrumb",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"}}}},separator:{type:"string"}}},propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"}}}},separator:{type:"string",default:"breadcrumb-arrow"}}},refs:{"item-*":{eventListeners:{click:{handler:"handleClickItem"}}}},events:{"item-click":{type:"object",properties:{item:{type:"object",properties:{label:{type:"string"},id:{type:"string"}}},index:{type:"number"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md p=sm ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:null,iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isSeparator",value:{type:6,conditions:[{type:1,path:"item.isSeparator"},{type:1,path:"item.id"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${separator} c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"separator"}," c=mu-fg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#item-${item.id} data-id=${item.id} cur=p",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#item-",{type:1,path:"item.id"}," data-id=",{type:1,path:"item.id"}," cur=p"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md p=sm ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Ye={};V(Ye,{handleClickMenuItem:()=>ms,handleClosePopover:()=>fs});var fs=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("close"))},ms=(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 Xe={};V(Xe,{INITIAL_STATE:()=>ys,toViewData:()=>gs});var ys=Object.freeze({}),gs=({props:e,attrs:t})=>({items:e.items||[],open:!!t.open,x:t.x,y:t.y,placement:t.placement});var tr={elementName:"rtgl-dropdown-menu",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["label","item","separator"]}}}}}},attrsSchema:{type:"object",properties:{open:{type:"string"},x:{type:"string"},y:{type:"string"},placement:{type:"string"}}},refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option-*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} placement=${placement}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=background br=md",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.type == 'label'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"label"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"item"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"separator"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f ph=lg pv=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option-${i} w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=mu",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option-",{type:1,path:"i"}," w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=mu"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 ph=lg mv=md bgc=bo",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," placement=",{type:1,path:"placement"}]}}],fast:!1}],fast:!1}};var Qe={};V(Qe,{handleActionClick:()=>ws,handleBeforeMount:()=>vs,handleColorPickerChange:()=>ks,handleImageClick:()=>$s,handleInputChange:()=>xs,handleOnUpdate:()=>bs,handlePopoverInputChange:()=>_s,handleSelectChange:()=>Ss,handleSliderChange:()=>Es,handleSliderInputChange:()=>As,handleWaveformClick:()=>Cs});var vs=e=>{let{store:t,props:r}=e;t.setFormValues(r.defaultValues)},bs=(e,t)=>{let{oldAttrs:r,newAttrs:s}=e,{store:i,props:n,render:o}=t;r?.key!==s?.key&&(i.setFormValues(n.defaultValues),o())},le=(e,t,r,s)=>{s(new CustomEvent("form-change",{detail:{name:e,fieldValue:t,formValues:r}}))},ws=(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()}}))},xs=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("input-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),le(i,e.detail.value,r.selectFormValues(),s))},_s=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("popover-input-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),le(i,e.detail.value,r.selectFormValues(),s))},Ss=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("select-","");i&&e.detail.selectedValue!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.selectedValue}),le(i,e.detail.selectedValue,r.selectFormValues(),s))},ks=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("colorpicker-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),le(i,e.detail.value,r.selectFormValues(),s))},Es=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("slider-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),le(i,e.detail.value,r.selectFormValues(),s))},As=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("slider-input-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),le(i,e.detail.value,r.selectFormValues(),s))},$s=(e,t)=>{e.type==="contextmenu"&&e.preventDefault();let{dispatchEvent:r}=t,s=e.currentTarget.id.replace("image-","");r(new CustomEvent("extra-event",{detail:{name:s,x:e.clientX,y:e.clientY,trigger:e.type}}))},Cs=(e,t)=>{e.type==="contextmenu"&&e.preventDefault();let{dispatchEvent:r}=t,s=e.currentTarget.id.replace("waveform-","");r(new CustomEvent("extra-event",{detail:{name:s,x:e.clientX,y:e.clientY,trigger:e.type}}))};var Ze={};V(Ze,{INITIAL_STATE:()=>Is,selectFormValues:()=>Vs,selectState:()=>Ns,setFormFieldValue:()=>js,setFormValues:()=>Ps,toViewData:()=>Ls});var Is=Object.freeze({formValues:{}}),Ts=["id","class","style","slot"],Os=e=>Object.entries(e).filter(([t])=>!Ts.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Ls=({state:e,props:t,attrs:r})=>{let s=Os(r),i=structuredClone(t.form.fields||[]),n=t.defaultValues||{},o=t.fieldResources||{};return i.forEach(a=>{if(a.defaultValue=n[a.name],a.inputType==="image"){let l=o[a.name]?.src;a.imageSrc=l&&l.trim()?l:null,a.placeholderText=a.placeholder||"No Image"}if(a.inputType==="waveform"){let l=o[a.name]?.waveformData;a.waveformData=l||null,a.placeholderText=a.placeholder||"No Waveform"}}),{containerAttrString:s,title:t.form?.title||"",description:t?.form?.description||"",fields:i,actions:t?.form?.actions||{buttons:[]},formValues:e.formValues,fieldResources:o}},Ns=({state:e})=>e,Vs=({state:e})=>e.formValues,Ps=(e,t)=>{e.formValues=t||{}},js=(e,{name:t,value:r})=>{e.formValues[t]=r};var rr={elementName:"rtgl-form",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{defaultValues:{type:"object"},form:{type:"object",properties:{title:{type:"string"},description:{type:"string"},fields:{type:"array",items:{anyOf:[{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"inputText"},placeholder:{type:"string"}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"select"},placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{id:{type:"string"},label:{type:"string"},value:{type:"any"}},required:["id","label","value"]}}},required:["name","label","inputType","options"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"colorPicker"},value:{type:"string"}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"slider"},min:{type:"number"},max:{type:"number"},step:{type:"number"},value:{type:"number"}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"slider-input"},min:{type:"number"},max:{type:"number"},step:{type:"number"},value:{type:"number"}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"image"},width:{type:"number"},height:{type:"number"},placeholder:{type:"string"}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"waveform"},width:{type:"number"},height:{type:"number"},placeholder:{type:"string"}},required:["name","label","inputType"],additionalProperties:!1}]}},actions:{type:"object",properties:{buttons:{type:"array",items:{type:"object",properties:{id:{type:"string"},content:{type:"string"}},required:["id","content"]}}}}}},fieldResources:{type:"object"}}},refs:{"action-*":{eventListeners:{click:{handler:"handleActionClick"}}},"input-*":{eventListeners:{"input-change":{handler:"handleInputChange"}}},"select-*":{eventListeners:{"select-change":{handler:"handleSelectChange"}}},"colorpicker-*":{eventListeners:{"colorpicker-change":{handler:"handleColorPickerChange"}}},"slider-*":{eventListeners:{"slider-change":{handler:"handleSliderChange"}}},"slider-input-*":{eventListeners:{"slider-input-value-change":{handler:"handleSliderInputChange"}}},"image-*":{eventListeners:{click:{handler:"handleImageClick"},contextmenu:{handler:"handleImageClick"}}},"waveform-*":{eventListeners:{click:{handler:"handleWaveformClick"},contextmenu:{handler:"handleWaveformClick"}}},"popover-input-*":{eventListeners:{"input-change":{handler:"handlePopoverInputChange"}}}},events:{"form-change":{},"extra-event":{}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f p=md g=lg ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"title"}}],fast:!0},{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"description"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-view g=lg w=f",value:{type:9,items:[{type:7,itemVar:"field",indexVar:"i",iterable:{type:1,path:"fields"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"field.label"}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:'$if field.inputType == "read-only-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"read-only-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"field.defaultValue"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "inputText"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"inputText"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#input-${field.name} w=f placeholder=${field.placeholder} value=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input-",{type:1,path:"field.name"}," w=f placeholder=",{type:1,path:"field.placeholder"}," value=",{type:1,path:"field.defaultValue"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "popover-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"popover-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-popover-input#popover-input-${field.name} label="${field.label}" .defaultValue=fields[${i}].defaultValue',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-popover-input#popover-input-",{type:1,path:"field.name"},' label="',{type:1,path:"field.label"},'" .defaultValue=fields[',{type:1,path:"i"},"].defaultValue"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-select#select-${field.name} w=f .options=fields[${i}].options .placeholder=fields[${i}].placeholder .selectedValue=fields[${i}].defaultValue",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#select-",{type:1,path:"field.name"}," w=f .options=fields[",{type:1,path:"i"},"].options .placeholder=fields[",{type:1,path:"i"},"].placeholder .selectedValue=fields[",{type:1,path:"i"},"].defaultValue"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "colorPicker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"colorPicker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#colorpicker-${field.name} value=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#colorpicker-",{type:1,path:"field.name"}," value=",{type:1,path:"field.defaultValue"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slider"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider#slider-${field.name} w=f min=${field.min} max=${field.max} step=${field.step} value=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider-",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," value=",{type:1,path:"field.defaultValue"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slider-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slider-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider-input#slider-input-${field.name} w=f min=${field.min} max=${field.max} step=${field.step} defaultValue=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider-input#slider-input-",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," defaultValue=",{type:1,path:"field.defaultValue"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "image" && field.imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"image"}},right:{type:1,path:"field.imageSrc"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image#image-${field.name} src=${field.imageSrc} w=${field.width} h=${field.height} cur=p",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image#image-",{type:1,path:"field.name"}," src=",{type:1,path:"field.imageSrc"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=p"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "image" && !field.imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"image"}},right:{type:5,op:0,operand:{type:1,path:"field.imageSrc"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#image-${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=p p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg ta=c",value:{type:1,path:"field.placeholderText"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#image-",{type:1,path:"field.name"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," bc=ac bw=sm ah=c av=c cur=p p=md"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "waveform" && field.waveformData',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"waveform"}},right:{type:1,path:"field.waveformData"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-waveform#waveform-${field.name} .waveformData=fields[${i}].waveformData w=${field.width} h=${field.height} cur=p",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-waveform#waveform-",{type:1,path:"field.name"}," .waveformData=fields[",{type:1,path:"i"},"].waveformData w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=p"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "waveform" && !field.waveformData',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"waveform"}},right:{type:5,op:0,operand:{type:1,path:"field.waveformData"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#waveform-${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=p p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg ta=c",value:{type:1,path:"field.placeholderText"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#waveform-",{type:1,path:"field.name"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," bc=ac bw=sm ah=c av=c cur=p p=md"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=e g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions.buttons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action-${button.id}",value:{type:1,path:"button.content"},parsedKey:{type:2,parts:["rtgl-button#action-",{type:1,path:"button.id"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=f p=md g=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var et={};V(et,{handleClickStart:()=>Rs});var Rs=(e,t)=>{let{dispatchEvent:r,store:s}=t;console.log("handle click start",s.selectPath()),r(new CustomEvent("clickStart",{detail:{path:s.selectPath()}}))};var tt={};V(tt,{INITIAL_STATE:()=>Ds,selectPath:()=>zs,setState:()=>Ks,toViewData:()=>Bs});var Ds=Object.freeze({}),Ms=["id","class","style","slot"],Ws=e=>Object.entries(e).filter(([t])=>!Ms.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Bs=({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:Ws(r),start:s||{label:"",image:{src:"",width:32,height:32,alt:""}}}},zs=({props:e})=>e.start.path,Ks=e=>{};var sr={elementName:"rtgl-navbar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}},hasImage:{type:"boolean"},hasHref:{type:"boolean"}}}}},propsSchema:{type:"object",properties:{start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}}}}}},refs:{start:{eventListeners:{click:{handler:"handleClickStart"}}}},events:{clickStart:{type:"object",properties:{path:{type:"string"}}}},anchors:[[{"rtgl-text s=lg":"${start.label}"},{"$if start.image && start.image.src":[{"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}":null}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view bgc=bg d=h h=48 av=c w=f ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if start.href",value:{type:6,conditions:[{type:1,path:"start.href"},{type:1,path:"start.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${start.href}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=lg g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a href=",{type:1,path:"start.href"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#start d=h av=c g=lg g=md cur=p",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=lg g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view flex=1",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view d=h av=c g=lg",value:{type:9,items:[{type:8,properties:[{key:"slot name=right",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view bgc=bg d=h h=48 av=c w=f ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var rt={};V(rt,{handleBeforeMount:()=>Hs});var ir=(e,t)=>{let{store:r,render:s}=t,i,n=-1/0;e.forEach(o=>{let a=o.getBoundingClientRect();a.top<=20&&a.top>n&&(n=a.top,i=o.id)}),i&&i!==r.selectCurrentId()&&(r.setCurrentId(i),s())},Fs=(e,t)=>{let{store:r,render:s}=t,i=e.querySelectorAll("rtgl-text[id]"),n=Array.from(i),o=n.map(l=>({id:l.id,href:`#${l.id}`,title:l.textContent}));r.setItems(o),ir(n,t),s();let a=ir.bind(void 0,n,t);return e.addEventListener("scroll",a,{passive:!0}),()=>{e.removeEventListener("scroll",a)}},Hs=e=>{let{attrs:t}=e;requestAnimationFrame(()=>{let r=document.getElementById(t["target-id"]),s=Fs(r,e);return()=>{s()}})};var st={};V(st,{INITIAL_STATE:()=>Us,selectCurrentId:()=>Gs,selectState:()=>Js,setContentContainer:()=>Qs,setCurrentId:()=>Xs,setItems:()=>Ys,toViewData:()=>qs});var Us=Object.freeze({items:[],currentId:null,contentContainer:null}),qs=({state:e})=>({items:e.items.map(t=>({...t,c:t.id===e.currentId?"fg":"mu-fg"})),currentId:e.currentId}),Js=({state:e})=>e,Gs=({state:e})=>e.currentId,Ys=(e,t)=>{e.items=t},Xs=(e,t)=>{e.currentId=t},Qs=(e,t)=>{e.contentContainer=t};var nr={elementName:"rtgl-page-outline",viewDataSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{slug:{type:"string"},title:{type:"string"}}}},selectedSlug:{type:"string",nullable:!0}}},propsSchema:{type:"object",properties:{}},refs:{},events:{onItemClick:{type:"object"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=272",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f g=sm mt=xl",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view pv=xs av=c href=${item.href}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} h-c=fg",value:{type:1,path:"item.title"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," h-c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view pv=xs av=c href=",{type:1,path:"item.href"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var it={};V(it,{handleBeforeMount:()=>Zs,handleInputChange:()=>si,handleInputKeydown:()=>ni,handleOnUpdate:()=>ei,handlePopoverClose:()=>ri,handleSubmitClick:()=>ii,handleTextClick:()=>ti});var Zs=e=>{let{store:t,props:r}=e;(r.value!==void 0||r.defaultValue!==void 0)&&t.setValue(r.value||r.defaultValue||"")},ei=(e,t)=>{let{oldProps:r,newProps:s}=e,{store:i,props:n,render:o}=t;r.defaultValue!==s.defaultValue&&i.setValue(n.defaultValue||""),o()},ti=(e,t)=>{let{store:r,render:s,getRefIds:i,attrs:n}=t,o=r.selectValue();r.setTempValue(o),r.openPopover({position:{x:e.currentTarget.getBoundingClientRect().left,y:e.currentTarget.getBoundingClientRect().bottom}});let{input:a}=i();a.elm.value=o,s(),n["auto-focus"]&&setTimeout(()=>{a.elm.focus()},50)},ri=(e,t)=>{let{store:r,render:s}=t;r.closePopover(),s()},si=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=t,n=e.detail.value;r.setTempValue(n),i(new CustomEvent("temp-input-change",{detail:{value:n},bubbles:!0})),s()},ii=(e,t)=>{let{store:r,render:s,dispatchEvent:i,getRefIds:n}=t,{input:o}=n(),a=o.elm.value;r.setValue(a),r.closePopover(),i(new CustomEvent("input-change",{detail:{value:a},bubbles:!0})),s()},ni=(e,t)=>{let{store:r,render:s,dispatchEvent:i,getRefIds:n}=t;if(e.key==="Enter"){let{input:o}=n(),a=o.elm.value;r.closePopover(),i(new CustomEvent("input-change",{detail:{value:a},bubbles:!0})),s()}else e.key==="Escape"&&(r.closePopover(),s())};var nt={};V(nt,{INITIAL_STATE:()=>ai,closePopover:()=>ci,openPopover:()=>pi,selectValue:()=>hi,setTempValue:()=>li,setValue:()=>di,toViewData:()=>oi});var ai=Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),oi=({attrs:e,state:t,props:r})=>{let s=t.value||"-";return{isOpen:t.isOpen,position:t.position,value:s??"-",tempValue:t.tempValue,placeholder:r.placeholder??"",label:e.label}},li=(e,t)=>{e.tempValue=t},pi=(e,t)=>{let{position:r}=t;e.position=r,e.isOpen=!0,e.hasUnsavedChanges=!1},ci=e=>{e.isOpen=!1,e.tempValue=""},di=(e,t)=>{e.value=t},hi=({state:e})=>e.value;var ar={elementName:"rtgl-popover-input",viewDataSchema:{type:"object"},attrsSchema:{type:"object",properties:{"auto-focus":{type:"boolean"}}},propsSchema:{type:"object",properties:{value:{type:"string"},defaultValue:{type:"string"},placeholder:{type:"string"},onChange:{type:"function"}}},refs:{"text-display":{eventListeners:{click:{handler:"handleTextClick"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},input:{eventListeners:{"input-change":{handler:"handleInputChange"},keydown:{handler:"handleInputKeydown"}}},submit:{eventListeners:{click:{handler:"handleSubmitClick"}}}},events:{"input-change":{}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#text-display w=f cur=p",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"value"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=240 slot=content bgc=background br=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-input#input w=f placeholder=${placeholder}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=f placeholder=",{type:1,path:"placeholder"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#submit",value:{type:0,value:"Submit"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}]}}],fast:!0}],fast:!0}};var at={};V(at,{handleBeforeMount:()=>ui,handleButtonClick:()=>fi,handleClickOptionsPopoverOverlay:()=>mi,handleOptionClick:()=>yi});var ui=e=>{let{store:t,props:r,render:s}=e;if(r.selectedValue!==null&&r.selectedValue!==void 0&&r.options){let i=r.options.find(n=>n.value===r.selectedValue);i&&(t.updateSelectOption(i),s())}},fi=(e,t)=>{let{store:r,render:s,getRefIds:i}=t;r.openOptionsPopover({position:{y:e.clientY,x:e.clientX}}),s()},mi=(e,t)=>{let{store:r,render:s}=t;r.closeOptionsPopover(),s()},yi=(e,t)=>{let{render:r,dispatchEvent:s,props:i,store:n}=t,o=e.currentTarget.id.replace("option-",""),a=i.options[o];n.updateSelectOption(a),i.onChange&&typeof i.onChange=="function"&&i.onChange(a.value),s(new CustomEvent("option-selected",{detail:{value:a.value,label:a.label},bubbles:!0})),s(new CustomEvent("select-change",{detail:{selectedValue:a.value},bubbles:!0})),r()};var ot={};V(ot,{INITIAL_STATE:()=>gi,closeOptionsPopover:()=>xi,openOptionsPopover:()=>wi,selectState:()=>bi,toViewData:()=>vi,updateSelectOption:()=>_i});var gi=Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,selectedLabel:null}),vi=({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(o=>o.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"}},bi=({state:e})=>e,wi=(e,t)=>{let{position:r}=t;e.position=r,e.isOpen=!0},xi=e=>{e.isOpen=!1},_i=(e,t)=>{e.selectedValue=t.value,e.selectedLabel=t.label,e.isOpen=!1};var or={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:{close:{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 ?open=${isOpen} x=${position.x} y=${position.y}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=background br=md sv=true",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#option-${i} w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=${option.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option-",{type:1,path:"i"}," w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=",{type:1,path:"option.bgc"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}]}}],fast:!1}],fast:!1}};var lt={};V(lt,{handleHeaderClick:()=>Si,handleItemClick:()=>ki});var Si=(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}))},ki=(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 ct={};V(ct,{INITIAL_STATE:()=>Ei,selectActiveItem:()=>Ti,selectHeader:()=>Ii,selectItem:()=>Oi,setState:()=>Li,toViewData:()=>Ci});var Ei=Object.freeze({}),Ai=["id","class","style","slot"],$i=e=>Object.entries(e).filter(([t])=>!Ai.includes(t)).map(([t,r])=>`${t}=${r}`).join(" ");function pt(e,t=null){let r=[];for(let s of e){let i=s.id||s.href||s.path,n=t===i;if(r.push({id:i,title:s.title,href:s.href,type:s.type||"item",icon:s.icon,hrefAttr:s.href?`href=${s.href}`:"",isSelected:n,itemBgc:n?"ac":"bg",itemHoverBgc:n?"ac":"mu"}),s.items&&Array.isArray(s.items))for(let o of s.items){let a=o.id||o.href||o.path,l=t===a;r.push({id:a,title:o.title,href:o.href,type:o.type||"item",icon:o.icon,hrefAttr:o.href?`href=${o.href}`:"",isSelected:l,itemBgc:l?"ac":"bg",itemHoverBgc:l?"ac":"mu"})}}return r}var Ci=({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,o=$i(r),a=r.mode||"full",l=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},p=i?pt(i,n):[],h=a==="full"?272:64,d=a==="full"?"fs":"c",m=a==="full"?"fs":"c",v=a==="full"?"lg":"sm",c=a==="full"?"md":"sm",u=a==="shrunk-lg"?48:40,f=a==="shrunk-lg"?28:20,y=a==="shrunk-lg"?"md":"sm",b=a==="full",w=a==="full",x=a==="full"?"fs":"c",k=a==="full"?"":`ah=${m}`,_=a==="full"?"f":u;return{containerAttrString:o,mode:a,header:l,items:p,sidebarWidth:h,headerAlign:d,itemAlign:m,headerPadding:v,itemPadding:c,itemHeight:u,iconSize:f,firstLetterSize:y,showLabels:b,showGroupLabels:w,itemContentAlign:x,itemAlignAttr:k,itemWidth:_,headerWidth:_,selectedItemId:n,ah:a==="shrunk-lg"||a==="shrunk-md"?"c":""}},Ii=({state:e,props:t,attrs:r})=>r.header?JSON.parse(decodeURIComponent(r.header)):t.header,Ti=({state:e,props:t})=>(t.items?pt(t.items):[]).find(s=>s.active),Oi=({state:e,props:t,attrs:r},s)=>{let i=r.items?JSON.parse(decodeURIComponent(r.items)):t.items;return(i?pt(i):[]).find(o=>o.id===s)},Li=e=>{};var lr={elementName:"rtgl-sidebar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},mode:{type:"string",enum:["full","shrunk","shrunk-lg"],default:"full"},sidebarWidth:{type:"number"},headerAlign:{type:"string"},itemAlign:{type:"string"},headerPadding:{type:"string"},itemPadding:{type:"string"},itemHeight:{type:"number"},iconSize:{type:"number"},firstLetterSize:{type:"string"},showLabels:{type:"boolean"},showGroupLabels:{type:"boolean"},itemContentAlign:{type:"string"},itemAlignAttr:{type:"string"},itemWidth:{type:"string"},headerWidth:{type:"string"},selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},active:{type:"boolean"},icon:{type:"string"}}}}}},propsSchema:{type:"object",properties:{selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},items:{type:"array"}}}}}},refs:{"header-image":{eventListeners:{click:{handler:"handleHeaderClick"}}},"header-label":{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item-*":{eventListeners:{click:{handler:"handleItemClick"}}}},events:{headerClick:{type:"object",properties:{path:{type:"string"}}}},anchors:[[{"$if header.image && header.image.src":[{"$if header.image.href":[{"a href=${header.image.href}":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],"$elif header.image.path":[{"rtgl-view#header-image cur=p":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],$else:[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}]},{"$if header.label && showLabels":[{"$if header.labelHref":[{"rtgl-text href=${header.labelHref} s=lg":"${header.label}"}],"$elif header.labelPath":[{"rtgl-view#header-label cur=p":[{"rtgl-text s=lg":"${header.label}"}]}],$else:[{"rtgl-text s=lg":"${header.label}"}]}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=${sidebarWidth} bwr=xs ah=${ah} ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view ph=${headerPadding} pv=lg",value:{type:9,items:[{type:8,properties:[{key:"$if header.href",value:{type:6,conditions:[{type:1,path:"header.href"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view href=${header.href} d=h av=c ah=${headerAlign} g=lg w=${headerWidth}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header-image cur=p",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header-label cur=p",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view href=",{type:1,path:"header.href"}," d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c ah=${headerAlign} g=lg w=${headerWidth} cur=p",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header-image cur=p",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header-label cur=p",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#header d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}," cur=p"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view ph=",{type:1,path:"headerPadding"}," pv=lg"]}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=f ph=${headerPadding} pb=lg g=xs ah=${ah}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'$if item.type == "groupLabel"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"groupLabel"}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showGroupLabels",value:{type:6,conditions:[{type:1,path:"showGroupLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=32 av=c ph=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=1 bgc=mu-bg",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#item-${item.id} ${item.hrefAttr} h=${itemHeight} av=c ${itemAlignAttr} ph=${itemPadding} w=${itemWidth} h-bgc=${item.itemHoverBgc} br=lg bgc=${item.itemBgc} cur=p",value:{type:9,items:[{type:8,properties:[{key:"$if item.icon",value:{type:6,conditions:[{type:1,path:"item.icon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=${itemContentAlign} g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h ah=",{type:1,path:"itemContentAlign"}," g=sm"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=${iconSize} svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=",{type:1,path:"iconSize"}," svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=${iconSize} br=f bgc=mu av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=${firstLetterSize} c=fg",value:{type:1,path:"item.title.charAt(0).toUpperCase()"},parsedKey:{type:2,parts:["rtgl-text s=",{type:1,path:"firstLetterSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view wh=",{type:1,path:"iconSize"}," br=f bgc=mu av=c ah=c"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#item-",{type:1,path:"item.id"}," ",{type:1,path:"item.hrefAttr"}," h=",{type:1,path:"itemHeight"}," av=c ",{type:1,path:"itemAlignAttr"}," ph=",{type:1,path:"itemPadding"}," w=",{type:1,path:"itemWidth"}," h-bgc=",{type:1,path:"item.itemHoverBgc"}," br=lg bgc=",{type:1,path:"item.itemBgc"}," cur=p"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f ph=",{type:1,path:"headerPadding"}," pb=lg g=xs ah=",{type:1,path:"ah"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{type:1,path:"sidebarWidth"}," bwr=xs ah=",{type:1,path:"ah"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var dt={};V(dt,{handleBeforeMount:()=>Ni,handleValueChange:()=>Vi});var Ni=e=>{let{store:t,attrs:r}=e;t.setValue(r.defaultValue||0)},Vi=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=t,n=Number(e.detail.value);r.setValue(n),s(),i(new CustomEvent("slider-input-value-change",{detail:{value:n},bubbles:!0}))};var ht={};V(ht,{INITIAL_STATE:()=>Pi,setValue:()=>Ri,toViewData:()=>ji});var Pi=Object.freeze({value:0}),ji=({state:e,attrs:t})=>({value:e.value,w:t.w||"",min:t.min||0,max:t.max||100,step:t.step||1}),Ri=(e,t)=>{e.value=t};var pr={elementName:"rtgl-slider-input",viewDataSchema:{type:"object"},attrsSchema:{type:"object",properties:{defaultValue:{type:"string",default:"0"},w:{type:"string",default:""},min:{type:"string",default:"0"},max:{type:"string",default:"100"},step:{type:"string",default:"1"}}},refs:{input:{eventListeners:{"input-change":{handler:"handleValueChange"}}},slider:{eventListeners:{"slider-change":{handler:"handleValueChange"}}}},events:{"form-change":{}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=${w}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-slider#slider w=f type=range min=${min} max=${max} step=${step} value=${value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider w=f type=range min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=84",value:{type:9,items:[{type:8,properties:[{key:"rtgl-input#input w=f type=number min=${min} max=${max} step=${step} value=${value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=f type=number min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md w=",{type:1,path:"w"}]}}],fast:!0}],fast:!0}};var ut={};V(ut,{handleBeforeMount:()=>Di,handleHeaderClick:()=>Wi,handleRowClick:()=>Mi});var Di=e=>{},Mi=(e,t)=>{let{dispatchEvent:r,props:s}=t,i=parseInt(e.currentTarget.id.replace("row-","")),n=s.data?.rows?.[i];n&&r(new CustomEvent("row-click",{detail:{rowIndex:i,rowData:n}}))},Wi=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=t,n=e.currentTarget.id.replace("header-",""),o=r.selectSortInfo(),a="asc";o.column===n&&(o.direction==="asc"?a="desc":o.direction==="desc"&&(a=null)),a?r.setSortColumn({column:n,direction:a}):r.clearSort(),s(),i(new CustomEvent("header-click",{detail:{column:n,direction:a,sortInfo:a?{column:n,direction:a}:null}}))};var ft={};V(ft,{INITIAL_STATE:()=>Bi,clearSort:()=>Gi,selectSortInfo:()=>qi,selectState:()=>Ui,setSortColumn:()=>Ji,toViewData:()=>Hi});var Bi=Object.freeze({sortColumn:null,sortDirection:null}),zi=["id","class","style","slot"],Ki=e=>Object.entries(e).filter(([t])=>!zi.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Fi=(e,t)=>{let r=t.split("."),s=e;for(let i of r){if(s==null)return null;s=s[i]}return s},Hi=({state:e,props:t,attrs:r})=>{let s=Ki(r),i=t.data||{columns:[],rows:[]},n=i.rows.map((o,a)=>{let l=i.columns.map(p=>{let h=Fi(o,p.key);return{key:p.key,value:h!=null?String(h):""}});return{index:a,cells:l}});return{containerAttrString:s,columns:i.columns||[],rows:n||[]}},Ui=({state:e})=>e,qi=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),Ji=(e,{column:t,direction:r})=>{e.sortColumn=t,e.sortDirection=r},Gi=e=>{e.sortColumn=null,e.sortDirection=null};var cr={elementName:"rtgl-table",viewDataSchema:{type:"object",properties:{columns:{type:"array"},rows:{type:"array"},containerAttrString:{type:"string"}}},propsSchema:{type:"object",properties:{data:{type:"object",properties:{columns:{type:"array",items:{type:"object",properties:{key:{type:"string"},label:{type:"string"}}}},rows:{type:"array",items:{type:"object"}}}},responsive:{type:"boolean",default:!0}}},refs:{"row-*":{eventListeners:{click:{handler:"handleRowClick"}}},"header-*":{eventListeners:{click:{handler:"handleHeaderClick"}}}},events:{},styles:{table:{width:"100%","border-collapse":"collapse","border-spacing":0},thead:{"border-bottom":"2px solid var(--border)"},th:{padding:"12px","text-align":"left","font-weight":500,color:"var(--foreground)","background-color":"var(--muted)",cursor:"pointer",position:"sticky",top:0,"z-index":1},"tbody tr":{"border-bottom":"1px solid var(--border)"},"tbody tr:last-child":{"border-bottom":"none"},td:{padding:"12px",color:"var(--foreground)"},".table-container":{width:"100%",height:"100%",overflow:"auto"},".empty-state":{"text-align":"center",padding:"24px",color:"var(--muted-foreground)"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view.table-container ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if rows.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"rows.length"},right:{type:0,value:0}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"table",value:{type:9,items:[{type:8,properties:[{key:"thead",value:{type:9,items:[{type:8,properties:[{key:"tr",value:{type:9,items:[{type:7,itemVar:"column",indexVar:"i",iterable:{type:1,path:"columns"},body:{type:9,items:[{type:8,properties:[{key:"th#header-${column.key}",value:{type:1,path:"column.label"},parsedKey:{type:2,parts:["th#header-",{type:1,path:"column.key"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"tbody",value:{type:9,items:[{type:7,itemVar:"row",indexVar:"rowIndex",iterable:{type:1,path:"rows"},body:{type:9,items:[{type:8,properties:[{key:"tr#row-${row.index}",value:{type:9,items:[{type:7,itemVar:"cell",indexVar:"cellIndex",iterable:{type:1,path:"row.cells"},body:{type:9,items:[{type:8,properties:[{key:"td",value:{type:1,path:"cell.value"}}],fast:!0}],fast:!0}}],fast:!1},parsedKey:{type:2,parts:["tr#row-",{type:1,path:"row.index"}]}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view.empty-state w=f p=xl",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"No data available"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view.table-container ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var mt={};V(mt,{handleClickItem:()=>Yi});var Yi=(e,t)=>{let{dispatchEvent:r}=t,s=e.currentTarget.dataset.id;r(new CustomEvent("item-click",{detail:{id:s}}))};var yt={};V(yt,{INITIAL_STATE:()=>Xi,toViewData:()=>en});var Xi=Object.freeze({}),Qi=["id","class","style","slot"],Zi=e=>Object.entries(e).filter(([t])=>!Qi.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),en=({state:e,props:t,attrs:r})=>{let s=Zi(r),i=t.items||[],n=r["selected-tab"],o=i.map(a=>({...a,isSelected:a.id===n,bgColor:a.id===n?"ac":"",borderColor:a.id===n?"":"tr",textColor:a.id===n?"":"mu-fg"}));return{containerAttrString:s,items:o,selectedTab:n}};var dr={elementName:"rtgl-tabs",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},isSelected:{type:"boolean"},bgColor:{type:"string"},textColor:{type:"string"},borderColor:{type:"string"}}}},selectedTab:{type:"string"}}},propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"}}}}}},attrsSchema:{type:"object",properties:{"selected-tab":{type:"string"}}},refs:{"tab-*":{eventListeners:{click:{handler:"handleClickItem"}}}},events:{"item-click":{type:"object",properties:{id:{type:"string"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm bgc=mu p=sm br=lg ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:null,iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#tab-${item.id} data-id=${item.id} cur=p bgc=${item.bgColor} bw=xs bc=${item.borderColor} pv=md ph=lg br=lg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.textColor}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.textColor"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#tab-",{type:1,path:"item.id"}," data-id=",{type:1,path:"item.id"}," cur=p bgc=",{type:1,path:"item.bgColor"}," bw=xs bc=",{type:1,path:"item.borderColor"}," pv=md ph=lg br=lg"]}}],fast:!0}],fast:!0}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h g=sm bgc=mu p=sm br=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var gt={};V(gt,{handleAfterMount:()=>tn,handleOnUpdate:()=>rn});var tn=async e=>{let{props:t,store:r,render:s,getRefIds:i}=e,{waveformData:n}=t;r.setWaveformData(n),s();let o=i().canvas?.elm;o&&hr(n,o)},rn=async(e,t)=>{let{store:r,render:s,getRefIds:i,props:n}=t,{waveformData:o}=n;r.setWaveformData(o),s();let a=i().canvas?.elm;a&&hr(o,a)};async function hr(e,t){let r=t.getContext("2d"),s=t.getBoundingClientRect(),i=s.width,n=s.height;t.width=i,t.height=n;let o=t.width,a=t.height;if(r.clearRect(0,0,o,a),r.fillStyle="#1a1a1a",r.fillRect(0,0,o,a),!e||!e.data)return;let l=e.data,p=a/2,h=r.createLinearGradient(0,0,0,a);h.addColorStop(0,"#404040"),h.addColorStop(.5,"#A1A1A1"),h.addColorStop(1,"#404040");let d=Math.max(1,o/l.length),m=.2;for(let v=0;v<l.length;v++){let u=l[v]*(a*.85),f=v*d,y=p-u/2;r.fillStyle=h,r.fillRect(f,y,Math.max(1,d*(1-m)),u)}r.strokeStyle="rgba(255, 255, 255, 0.1)",r.lineWidth=1,r.beginPath(),r.moveTo(0,p),r.lineTo(o,p),r.stroke(),r.shadowBlur=10,r.shadowColor="#2196F3"}var vt={};V(vt,{INITIAL_STATE:()=>sn,setWaveformData:()=>nn,toViewData:()=>an});var sn=Object.freeze({waveformData:null}),nn=(e,t)=>{e.waveformData=t},an=({state:e,attrs:t,props:r})=>({isLoading:r.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:r.waveformData});var ur={elementName:"rtgl-waveform",attrsSchema:{type:"object",properties:{w:{type:"string",description:"Width of the waveform visualizer",default:"250"},h:{type:"string",description:"Height of the waveform visualizer",default:"150"},cur:{type:"string",description:"cursor"}}},propsSchema:{type:"object",properties:{waveformData:{type:"object",description:"File ID of the waveform data in object storage"},isLoading:{type:"boolean",description:"Whether the waveform data is currently being loaded"}}},refs:{canvas:{selector:"canvas"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f pos=rel w=${w} h=${h} cur=${cur}",value:{type:9,items:[{type:8,properties:[{key:"$if isLoading",value:{type:6,conditions:[{type:1,path:"isLoading"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"..."}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'canvas#canvas style="width:100%; height:100%;"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=f pos=rel w=",{type:1,path:"w"}," h=",{type:1,path:"h"}," cur=",{type:1,path:"cur"}]}}],fast:!1}],fast:!1}};var br=Symbol.for("immer-nothing"),fr=Symbol.for("immer-draftable"),K=Symbol.for("immer-state");function J(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var pe=Object.getPrototypeOf;function ce(e){return!!e&&!!e[K]}function re(e){return e?wr(e)||Array.isArray(e)||!!e[fr]||!!e.constructor?.[fr]||Ae(e)||$e(e):!1}var on=Object.prototype.constructor.toString();function wr(e){if(!e||typeof e!="object")return!1;let t=pe(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===on}function _e(e,t){Ee(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function Ee(e){let t=e[K];return t?t.type_:Array.isArray(e)?1:Ae(e)?2:$e(e)?3:0}function xt(e,t){return Ee(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function xr(e,t,r){let s=Ee(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function ln(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ae(e){return e instanceof Map}function $e(e){return e instanceof Set}function te(e){return e.copy_||e.base_}function _t(e,t){if(Ae(e))return new Map(e);if($e(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=wr(e);if(t===!0||t==="class_only"&&!r){let s=Object.getOwnPropertyDescriptors(e);delete s[K];let i=Reflect.ownKeys(s);for(let n=0;n<i.length;n++){let o=i[n],a=s[o];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(s[o]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[o]})}return Object.create(pe(e),s)}else{let s=pe(e);if(s!==null&&r)return{...e};let i=Object.create(s);return Object.assign(i,e)}}function $t(e,t=!1){return Ce(e)||ce(e)||!re(e)||(Ee(e)>1&&(e.set=e.add=e.clear=e.delete=pn),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>$t(s,!0))),e}function pn(){J(2)}function Ce(e){return Object.isFrozen(e)}var cn={};function se(e){let t=cn[e];return t||J(0,e),t}var ye;function _r(){return ye}function dn(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function mr(e,t){t&&(se("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function St(e){kt(e),e.drafts_.forEach(hn),e.drafts_=null}function kt(e){e===ye&&(ye=e.parent_)}function yr(e){return ye=dn(ye,e)}function hn(e){let t=e[K];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function gr(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[K].modified_&&(St(t),J(4)),re(e)&&(e=Se(t,e),t.parent_||ke(t,e)),t.patches_&&se("Patches").generateReplacementPatches_(r[K].base_,e,t.patches_,t.inversePatches_)):e=Se(t,r,[]),St(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==br?e:void 0}function Se(e,t,r){if(Ce(t))return t;let s=t[K];if(!s)return _e(t,(i,n)=>vr(e,s,t,i,n,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return ke(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;let i=s.copy_,n=i,o=!1;s.type_===3&&(n=new Set(i),i.clear(),o=!0),_e(n,(a,l)=>vr(e,s,i,a,l,r,o)),ke(e,i,!1),r&&e.patches_&&se("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function vr(e,t,r,s,i,n,o){if(ce(i)){let a=n&&t&&t.type_!==3&&!xt(t.assigned_,s)?n.concat(s):void 0,l=Se(e,i,a);if(xr(r,s,l),ce(l))e.canAutoFreeze_=!1;else return}else o&&r.add(i);if(re(i)&&!Ce(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Se(e,i),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&ke(e,i)}}function ke(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&$t(t,r)}function un(e,t){let r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:_r(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=s,n=Ct;r&&(i=[s],n=ge);let{revoke:o,proxy:a}=Proxy.revocable(i,n);return s.draft_=a,s.revoke_=o,a}var Ct={get(e,t){if(t===K)return e;let r=te(e);if(!xt(r,t))return fn(e,r,t);let s=r[t];return e.finalized_||!re(s)?s:s===bt(e.base_,t)?(wt(e),e.copy_[t]=At(s,e)):s},has(e,t){return t in te(e)},ownKeys(e){return Reflect.ownKeys(te(e))},set(e,t,r){let s=Sr(te(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let i=bt(te(e),t),n=i?.[K];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(ln(r,i)&&(r!==void 0||xt(e.base_,t)))return!0;wt(e),Et(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 bt(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,wt(e),Et(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=te(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){J(11)},getPrototypeOf(e){return pe(e.base_)},setPrototypeOf(){J(12)}},ge={};_e(Ct,(e,t)=>{ge[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ge.deleteProperty=function(e,t){return ge.set.call(this,e,t,void 0)};ge.set=function(e,t,r){return Ct.set.call(this,e[0],t,r,e[0])};function bt(e,t){let r=e[K];return(r?te(r):e)[t]}function fn(e,t,r){let s=Sr(t,r);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function Sr(e,t){if(!(t in e))return;let r=pe(e);for(;r;){let s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=pe(r)}}function Et(e){e.modified_||(e.modified_=!0,e.parent_&&Et(e.parent_))}function wt(e){e.copy_||(e.copy_=_t(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var mn=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 o=this;return function(l=n,...p){return o.produce(l,h=>r.call(this,h,...p))}}typeof r!="function"&&J(6),s!==void 0&&typeof s!="function"&&J(7);let i;if(re(t)){let n=yr(this),o=At(t,void 0),a=!0;try{i=r(o),a=!1}finally{a?St(n):kt(n)}return mr(n,s),gr(i,n)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===br&&(i=void 0),this.autoFreeze_&&$t(i,!0),s){let n=[],o=[];se("Patches").generateReplacementPatches_(t,i,n,o),s(n,o)}return i}else J(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(o,...a)=>this.produceWithPatches(o,l=>t(l,...a));let s,i;return[this.produce(t,r,(o,a)=>{s=o,i=a}),s,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){re(e)||J(8),ce(e)&&(e=yn(e));let t=yr(this),r=At(e,void 0);return r[K].isManual_=!0,kt(t),r}finishDraft(e,t){let r=e&&e[K];(!r||!r.isManual_)&&J(9);let{scope_:s}=r;return mr(s,t),gr(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=se("Patches").applyPatches_;return ce(e)?s(e,t):this.produce(e,i=>s(i,t))}};function At(e,t){let r=Ae(e)?se("MapSet").proxyMap_(e,t):$e(e)?se("MapSet").proxySet_(e,t):un(e,t);return(t?t.scope_:_r()).drafts_.push(r),r}function yn(e){return ce(e)||J(10,e),kr(e)}function kr(e){if(!re(e)||Ce(e))return e;let t=e[K],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=_t(e,t.scope_.immer_.useStrictShallowCopy_)}else r=_t(e,!0);return _e(r,(s,i)=>{xr(r,s,kr(i))}),t&&(t.finalized_=!1),r}var F=new mn,Er=F.produce,Zo=F.produceWithPatches.bind(F),el=F.setAutoFreeze.bind(F),tl=F.setUseStrictShallowCopy.bind(F),rl=F.applyPatches.bind(F),sl=F.createDraft.bind(F),il=F.finishDraft.bind(F);var g={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9},H={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8},Ie={NOT:0};var de=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var Ar=(e,t)=>{if(t===null)return new de(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new de(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return new de(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},$r=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new de(`Unknown function '${e}' (${r})`)};var gn=(e,t,r={})=>I(e,r,t,{}),I=(e,t,r,s)=>{if(e.var&&!e.type)return M(e.var,r,s);if(e.type===g.LITERAL)return e.value;if(e.type===g.VARIABLE)return M(e.path,r,s);if(e.type===g.INTERPOLATION)return vn(e.parts,t,r,s);switch(e.type){case g.FUNCTION:return Cr(e,t,r,s);case g.BINARY:return Ir(e,t,r,s);case g.UNARY:return Tr(e,t,r,s);case g.CONDITIONAL:return wn(e,t,r,s);case g.LOOP:return En(e,t,r,s);case g.OBJECT:return $n(e,t,r,s);case g.ARRAY:return Cn(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},ee=new Map,M=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let s=ee.get(e);s||(s=e.split("."),ee.set(e,s));let i=t;for(let n=0;n<s.length;n++){let o=s[n];if(o in r){i=r[o];continue}if(i==null)return;i=i[o]}return i},vn=(e,t,r,s)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let o=I(n,t,r,s);i.push(o!=null?String(o):"")}return i.join("")},Cr=(e,t,r,s)=>{let i=t[e.name];if(!i)throw $r(e.name,t);let n=e.args.map(o=>I(o,t,r,s));return i(...n)},Te=(e,t,r,s)=>{if(e.var&&!e.type)return M(e.var,r,s);switch(e.type){case g.VARIABLE:return M(e.path,r,s);case g.LITERAL:return e.value;case g.BINARY:return Ir(e,t,r,s);case g.UNARY:return Tr(e,t,r,s);case g.FUNCTION:return Cr(e,t,r,s);default:return I(e,t,r,s)}},Ir=(e,t,r,s)=>{if(e.op===H.AND||e.op===H.OR){let o=Te(e.left,t,r,s),a=Te(e.right,t,r,s);switch(e.op){case H.AND:return o&&a;case H.OR:return o||a}}let i=I(e.left,t,r,s),n=I(e.right,t,r,s);switch(e.op){case H.EQ:return i==n;case H.NEQ:return i!=n;case H.GT:return i>n;case H.LT:return i<n;case H.GTE:return i>=n;case H.LTE:return i<=n;case H.IN:return Array.isArray(n)?n.includes(i):!1;default:throw new Error(`Unknown binary operator: ${e.op}`)}},Tr=(e,t,r,s)=>{let i=e.op===Ie.NOT?Te(e.operand,t,r,s):I(e.operand,t,r,s);switch(e.op){case Ie.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},bn=(e,t,r,s)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===g.VARIABLE)if(M(i.path,r,s)){let o=e.bodies[0];if(o.type===g.OBJECT&&o.properties.length<=5){let a={};for(let l of o.properties){let p=l.parsedKey?I(l.parsedKey,t,r,s):l.key,h=l.value;if(h.type===g.LITERAL)a[p]=h.value;else if(h.type===g.VARIABLE)a[p]=M(h.path,r,s);else if(h.type===g.INTERPOLATION){let d=[];for(let m of h.parts)if(typeof m=="string")d.push(m);else if(m.type===g.VARIABLE){let v=M(m.path,r,s);d.push(v!=null?String(v):"")}else{let v=I(m,t,r,s);d.push(v!=null?String(v):"")}a[p]=d.join("")}else a[p]=I(h,t,r,s)}return a}}else{let o=e.bodies[1];if(o.type===g.OBJECT&&o.properties.length<=5){let a={};for(let l of o.properties){let p=l.parsedKey?I(l.parsedKey,t,r,s):l.key,h=l.value;if(h.type===g.LITERAL)a[p]=h.value;else if(h.type===g.VARIABLE)a[p]=M(h.path,r,s);else if(h.type===g.INTERPOLATION){let d=[];for(let m of h.parts)if(typeof m=="string")d.push(m);else if(m.type===g.VARIABLE){let v=M(m.path,r,s);d.push(v!=null?String(v):"")}else{let v=I(m,t,r,s);d.push(v!=null?String(v):"")}a[p]=d.join("")}else a[p]=I(h,t,r,s)}return a}}}return null},wn=(e,t,r,s)=>{let i=bn(e,t,r,s);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||Te(o,t,r,s))return I(e.bodies[n],t,r,s)}return Or},xn=(e,t)=>{let r=e.body,s=e.itemVar;if(r.type===g.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===g.VARIABLE){let i=r.conditions[0].path,n=r.bodies[0];if(i.startsWith(s+".")){let o=i.substring(s.length+1);if(n.type===g.OBJECT&&n.properties.length<=5){for(let l of n.properties)if(l.parsedKey)return null;let a=[];for(let l=0;l<t.length;l++){let p=t[l];if(p[o]){let h={};for(let d of n.properties){let m=d.key,v=d.value;if(v.type===g.LITERAL)h[m]=v.value;else if(v.type===g.VARIABLE){let c=v.path;if(c===s)h[m]=p;else if(c.startsWith(s+".")){let u=c.substring(s.length+1);h[m]=p[u]}else return null}else if(v.type===g.INTERPOLATION){let c=[],u=!0;for(let f of v.parts)if(typeof f=="string")c.push(f);else if(f.type===g.VARIABLE){let y=f.path;if(y===s)c.push(p!=null?String(p):"");else if(y.startsWith(s+".")){let b=y.substring(s.length+1),w=p[b];c.push(w!=null?String(w):"")}else{u=!1;break}}else{u=!1;break}if(!u)return null;h[m]=c.join("")}else return null}a.push(h)}}return a}}}return null},_n=(e,t)=>{let r=e.body,s=e.itemVar,i=xn(e,t);if(i!==null)return i;if(r.type===g.OBJECT&&r.properties.length<=5){for(let a of r.properties)if(a.parsedKey)return null;let n=[],o=!0;for(let a of r.properties){let l=a.key,p=a.value;if(p.type===g.LITERAL)n.push({key:l,type:"literal",value:p.value});else if(p.type===g.VARIABLE){let h=p.path;if(h===s)n.push({key:l,type:"item"});else if(h.startsWith(s+".")){let d=h.substring(s.length+1);if(!d.includes("."))n.push({key:l,type:"prop",prop:d});else{o=!1;break}}else{o=!1;break}}else if(p.type===g.INTERPOLATION&&p.parts.length===1){let h=p.parts[0];if(h.type===g.VARIABLE){let d=h.path;if(d===s)n.push({key:l,type:"item_string"});else if(d.startsWith(s+".")){let m=d.substring(s.length+1);if(!m.includes("."))n.push({key:l,type:"prop_string",prop:m});else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}if(o){let a=new Array(t.length);if(n.length===3&&n[0].type==="prop"&&n[0].key==="id"&&n[1].type==="prop_string"&&n[1].key==="title"&&n[2].type==="prop"&&n[2].key==="completed")for(let l=0;l<t.length;l++){let p=t[l];a[l]={id:p.id,title:p.title!=null?String(p.title):"",completed:p.completed}}else for(let l=0;l<t.length;l++){let p=t[l],h={};for(let d of n)if(d.type==="literal")h[d.key]=d.value;else if(d.type==="item")h[d.key]=p;else if(d.type==="prop")h[d.key]=p[d.prop];else if(d.type==="item_string")h[d.key]=p!=null?String(p):"";else if(d.type==="prop_string"){let m=p[d.prop];h[d.key]=m!=null?String(m):""}a[l]=h}return a}}return null},Sn=(e,t,r,s,i)=>{let n=[],o=e.body;if(o.type===g.OBJECT&&o.fast!==!1){let a=e.itemVar,l=e.indexVar;for(let p=0;p<i.length;p++){let h=i[p],d={},m={...s,[a]:h,...l&&{[l]:p}};for(let v of o.properties){let c=v.parsedKey?I(v.parsedKey,t,r,m):v.key,u=v.value;if(u.type===g.LITERAL)d[c]=u.value;else if(u.type===g.VARIABLE){let f=u.path;if(f===a)d[c]=h;else if(f===l)d[c]=p;else if(f.startsWith(a+".")){let y=f.substring(a.length+1);if(!y.includes("."))d[c]=h[y];else{let b=ee.get(y)||(ee.set(y,y.split(".")),ee.get(y)),w=h;for(let x of b){if(w==null){w=void 0;break}w=w[x]}d[c]=w}}else d[c]=M(f,r,{...s,[a]:h,...l&&{[l]:p}})}else if(u.type===g.INTERPOLATION){let f=[];for(let y of u.parts)if(typeof y=="string")f.push(y);else if(y.type===g.VARIABLE){let b=y.path,w;if(b===a)w=h;else if(b===l)w=p;else if(b.startsWith(a+".")){let x=b.substring(a.length+1);if(!x.includes("."))w=h[x];else{let k=ee.get(x)||(ee.set(x,x.split(".")),ee.get(x)),_=h;for(let $ of k){if(_==null){_=void 0;break}_=_[$]}w=_}}else w=M(b,r,{...s,[a]:h,...l&&{[l]:p}});f.push(w!=null?String(w):"")}else{let b={...s,[a]:h,...l&&{[l]:p}},w=I(y,t,r,b);f.push(w!=null?String(w):"")}d[c]=f.join("")}else{let f={...s,[a]:h,...l&&{[l]:p}};d[c]=I(u,t,r,f)}}n.push(d)}return n}return null},kn=(e,t,r)=>{let s=e.body;if(s.type===g.OBJECT&&s.properties.length===1&&s.properties[0].key==="$if item.visible"){let n=s.properties[0].value;if(n.type===g.CONDITIONAL&&n.conditions.length===1&&n.conditions[0].type===g.VARIABLE&&n.conditions[0].path==="item.visible"){let o=n.bodies[0];if(o.type===g.OBJECT&&o.properties.length===2){let a=o.properties[0],l=o.properties[1];if(a.key==="id"&&a.value.type===g.VARIABLE&&a.value.path==="item.id"&&l.key==="$if item.highlighted"&&l.value.type===g.CONDITIONAL){let p=[];for(let h=0;h<t.length;h++){let d=t[h];if(d.visible){let m={id:d.id};d.highlighted?(m.highlight=!0,m.message=`This item is highlighted: ${d.name}`):(m.highlight=!1,m.message=d.name),p.push(m)}}return p}}}}return null},En=(e,t,r,s)=>{let i=I(e.iterable,t,r,s);if(!Array.isArray(i)){let a=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${e.iterable.path}`;throw Ar(a,i)}if(!e.indexVar){let a=kn(e,i,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=_n(e,i);if(a!==null)return a}let n=Sn(e,t,r,s,i);if(n!==null)return n;let o=[];for(let a=0;a<i.length;a++){let l=e.indexVar?{...s,[e.itemVar]:i[a],[e.indexVar]:a}:{...s,[e.itemVar]:i[a]},p=I(e.body,t,r,l);Array.isArray(p)&&p.length===1?o.push(p[0]):o.push(p)}return o},An=(e,t,r,s)=>{if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?I(i.parsedKey,t,r,s):i.key,o=i.value;if(o.type===g.OBJECT&&o.properties.length<=10){let a={},l={},p=!0;for(let h of o.properties){let d=h.parsedKey?I(h.parsedKey,t,r,s):h.key,m=h.value;if(m.type===g.LITERAL)l[d]=m.value;else if(m.type===g.VARIABLE)l[d]=M(m.path,r,s);else if(m.type===g.INTERPOLATION){let v=[];for(let c of m.parts)if(typeof c=="string")v.push(c);else if(c.type===g.VARIABLE){let u=M(c.path,r,s);v.push(u!=null?String(u):"")}else{p=!1;break}if(!p)break;l[d]=v.join("")}else if(m.type===g.OBJECT&&m.properties.length<=5){let v={};for(let c of m.properties){let u=c.key,f=c.value;if(f.type===g.LITERAL)v[u]=f.value;else if(f.type===g.VARIABLE)v[u]=M(f.path,r,s);else if(f.type===g.INTERPOLATION){let y=[];for(let b of f.parts)if(typeof b=="string")y.push(b);else if(b.type===g.VARIABLE){let w=M(b.path,r,s);y.push(w!=null?String(w):"")}else{p=!1;break}if(!p)break;v[u]=y.join("")}else{p=!1;break}}if(!p)break;l[d]=v}else{p=!1;break}}if(p)return a[n]=l,a}}return null},$n=(e,t,r,s)=>{let i=An(e,t,r,s);if(i!==null)return i;if(e.fast){let l={};for(let p of e.properties){let h=p.parsedKey?I(p.parsedKey,t,r,s):p.key,d=p.value;if(d.type===g.LITERAL)l[h]=d.value;else if(d.type===g.VARIABLE)l[h]=M(d.path,r,s);else if(d.type===g.INTERPOLATION){let m=[];for(let v of d.parts)if(typeof v=="string")m.push(v);else if(v.type===g.VARIABLE){let c=M(v.path,r,s);m.push(c!=null?String(c):"")}else{let c=I(v,t,r,s);m.push(c!=null?String(c):"")}l[h]=m.join("")}else l[h]=I(d,t,r,s)}return l}let n={},o=null,a=!1;for(let l of e.properties)if(!l.key.startsWith("$if ")&&!l.key.match(/^\$if\s+\w+.*:?$/)&&!l.key.startsWith("$elif")&&!l.key.startsWith("$else")&&!l.key.startsWith("$for ")){a=!0;break}for(let l of e.properties)if(l.key.startsWith("$if ")||l.key.match(/^\$if\s+\w+.*:?$/)){let p=I(l.value,t,r,s);if(!a&&p!==null&&p!==void 0)return Array.isArray(p)&&p.length===1?p[0]:p;typeof p=="object"&&p!==null&&!Array.isArray(p)&&Object.assign(n,p)}else if(!l.key.startsWith("$for ")){let p=l.value;if(p&&p.type===g.OBJECT&&p.properties){let h=p.properties.find(d=>d.key.startsWith("$for "));if(h){let d=I(h.value,t,r,s);d!==void 0&&(n[l.key]=d)}else{let d=I(l.value,t,r,s);d!==void 0&&(n[l.key]=d)}}else{let h=l.parsedKey?I(l.parsedKey,t,r,s):l.key,d=I(l.value,t,r,s);d!==void 0&&(n[h]=d)}}return n},Or={},Cn=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===g.LOOP){let o=I(n,t,r,s);i.push(o)}else{let o=I(n,t,r,s);o!==Or&&i.push(o)}return i},Oe=gn;var Le=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...Le(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]:Le(n)})}}t.push(r)}return t},[]):e;var Lr=(e,t)=>{if(!t)return e;let r=[],s="",i=!1,n=null;for(let o=0;o<t.length;o++){let a=t[o];if(!i&&a===".")s&&(r.push(s),s="");else if(!i&&a==="[")s&&(r.push(s),s=""),i=!0;else if(i&&a==="]"){if(s){if(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))r.push(s.slice(1,-1));else{let l=Number(s);r.push(isNaN(l)?s:l)}s=""}i=!1,n=null}else i&&(a==='"'||a==="'")&&(n?a===n&&(n=null):n=a),s+=a}return s&&r.push(s),r.reduce((o,a)=>o&&o[a],e)},Nr=({h:e,template:t,viewData:r,refs:s,handlers:i})=>{let n=Oe(t,r,{}),o=Le(n),a=Ln({h:e,items:o,refs:s,handlers:i,viewData:r});return e("div",{style:{display:"contents"}},a)},Ln=({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(o,a=""){return o.map((l,p)=>{if(typeof l=="string"||typeof l=="number")return String(l);if(typeof l!="object"||l===null)return console.warn("Skipping invalid item in DOM structure:",l),null;let h=Object.entries(l);if(h.length===0)return null;let[d,m]=h[0];if(!isNaN(Number(d)))return Array.isArray(m)?n(m,`${a}.${d}`):typeof m=="object"&&m!==null&&Object.entries(m).length>0?n([m],`${a}.${d}`):String(m);h.length>1&&console.warn("Item has multiple keys, processing only the first:",d);let v,c,u=d.indexOf(" ");u===-1?(v=d,c=""):(v=d.substring(0,u),c=d.substring(u+1).trim());let f=v.split(/[.#]/)[0],y=f.includes("-"),b={},w={};if(c){let A=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]+))/g,S,N=new Set;for(;(S=A.exec(c))!==null;)if(N.add(S[1]),S[1].startsWith(".")){let U=S[1].substring(1),fe=S[4];w[U]=Lr(i,fe)}else if(S[1].startsWith("?")){let U=S[1].substring(1),fe=S[2]||S[3]||S[4],be;fe==="true"?be=!0:fe==="false"?be=!1:be=Lr(i,fe),be&&(b[U]="")}else b[S[1]]=S[2]||S[3]||S[4];let j=c,D=[],G,Pe=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]+))/g;for(;(G=Pe.exec(c))!==null;)D.push(G[0]);D.forEach(U=>{j=j.replace(U," ")});let je=/\b(\S+?)(?=\s|$)/g,R;for(;(R=je.exec(j))!==null;){let U=R[1];!N.has(U)&&!U.startsWith(".")&&!U.includes("=")&&(b[U]="")}}let x=v.match(/#([^.#\s]+)/);x&&!Object.prototype.hasOwnProperty.call(b,"id")&&(b.id=x[1]);let k=null;b.id?k=b.id:y&&(k=f);let _=Object.create(null),$=null;if(y)$=f;else{let A=v.match(/\.([^.#]+)/g);A&&A.forEach(N=>{let j=N.substring(1);_[j]=!0});let S=v.match(/#([^.#\s]+)/);S&&($=S[1])}let E;typeof m=="string"||typeof m=="number"?E=String(m):Array.isArray(m)?E=n(m,`${a}.${d}`):E=[],$&&!y&&(b.id=$);let T=Object.create(null);if(k&&r){let A=[];if(Object.keys(r).forEach(S=>{if(S.includes("*")){let N="^"+S.replace(/[.*+?^${}()|[\\\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"$";try{new RegExp(N).test(k)&&A.push(S)}catch(j){console.warn(`[Parser] Invalid regex pattern created from refKey '${S}': ${N}`,j)}}else k===S&&A.push(S)}),A.length>0){A.sort((N,j)=>{let D=!N.includes("*"),G=!j.includes("*");return D&&!G?-1:!D&&G?1:j.length-N.length});let S=A[0];if(r[S]&&r[S].eventListeners){let N=r[S].eventListeners;Object.entries(N).forEach(([j,D])=>{D.handler&&s[D.handler]?T[j]=G=>{s[D.handler](G)}:D.handler&&console.warn(`[Parser] Handler '${D.handler}' for refKey '${S}' (matching elementId '${k}') is referenced but not found in available handlers.`)})}}}let L={};if(k)L.key=k;else if(v){let A=a?`${a}.${p}`:String(p);if(L.key=`${v}-${A}`,Object.keys(w).length>0){let S=JSON.stringify(w).substring(0,50);L.key+=`-${S}`}}Object.keys(b).length>0&&(L.attrs=b),Object.keys(_).length>0&&(L.class=_),Object.keys(T).length>0&&(L.on=T),Object.keys(w).length>0&&(L.props=w),y&&(L.hook={update:(A,S)=>{let N=A.data?.props||{},j=S.data?.props||{},D=A.data?.attrs||{},G=S.data?.attrs||{},Pe=JSON.stringify(N)!==JSON.stringify(j),je=JSON.stringify(D)!==JSON.stringify(G);if(Pe||je){let R=S.elm;R&&R.render&&typeof R.render=="function"&&(R.setAttribute("isDirty","true"),requestAnimationFrame(()=>{if(R.render(),R.removeAttribute("isDirty"),R.handlers&&R.handlers.handleOnUpdate){let U={...R.deps||{},store:R.store,render:R.render.bind(R),handlers:R.handlers,dispatchEvent:R.dispatchEvent.bind(R),refIds:R.refIds||{},getRefIds:()=>R.refIds||{}};R.handlers.handleOnUpdate({oldProps:N,newProps:j,oldAttrs:D,newAttrs:G},U)}}))}}});try{return e(f,L,E)}catch(A){return console.error("Error creating virtual node:",A,{tagName:f,snabbdomData:L,childrenOrText:E}),e("div",{},["Error creating element"])}}).filter(Boolean)}return n(t)};var Nn=(e,t)=>{if(!t||typeof t!="object")return"";let r="",s=n=>Object.entries(n).map(([o,a])=>` ${o}: ${a};`).join(`
920
- `),i=(n,o)=>{if(typeof o!="object"||o===null)return"";if(n.startsWith("@")){let a=Object.entries(o).map(([l,p])=>{let h=s(p);return` ${l} {
919
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._popoverOverlay=document.createElement("div"),this._popoverOverlay.className="popover-overlay",this.shadow.appendChild(this._popoverOverlay),this._popoverOverlay.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._popoverOverlay.addEventListener("contextmenu",t=>{t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this.shadow.appendChild(this._popoverContainer),this._slotElement=null,this._isOpen=!1,this._handleEscKey=this._handleEscKey.bind(this)}static get observedAttributes(){return["open","x","y","placement"]}connectedCallback(){this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._removeGlobalListeners()}attributeChangedCallback(t,r,s){t==="open"?s!==null&&!this._isOpen?this._show():s===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="placement")&&this._isOpen&&this._updatePosition()}_show(){this._isOpen||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._updatePosition(),this._addGlobalListeners())}_hide(){this._isOpen&&(this._isOpen=!1,this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null),this._removeGlobalListeners())}_updatePosition(){let t=parseFloat(this.getAttribute("x")||"0"),r=parseFloat(this.getAttribute("y")||"0"),s=this.getAttribute("placement")||"bottom-start";this.removeAttribute("positioned"),requestAnimationFrame(()=>{let i=this._popoverContainer.getBoundingClientRect(),{left:n,top:a}=this._calculatePosition(t,r,i.width,i.height,s);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${a}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,r,s,i,n){let o=t,l=r;switch(n){case"top":o=t-s/2,l=r-i-8;break;case"top-start":o=t,l=r-i-8;break;case"top-end":o=t-s,l=r-i-8;break;case"right":o=t+8,l=r-i/2;break;case"right-start":o=t+8,l=r;break;case"right-end":o=t+8,l=r-i;break;case"bottom":o=t-s/2,l=r+8;break;case"bottom-start":o=t,l=r+8;break;case"bottom-end":o=t-s,l=r+8;break;case"left":o=t-s-8,l=r-i/2;break;case"left-start":o=t-s-8,l=r;break;case"left-end":o=t-s-8,l=r-i;break}let p=8;return o=Math.max(p,Math.min(o,window.innerWidth-s-p)),l=Math.max(p,Math.min(l,window.innerHeight-i-p)),{left:o,top:l}}_addGlobalListeners(){setTimeout(()=>{document.addEventListener("keydown",this._handleEscKey)},0)}_removeGlobalListeners(){document.removeEventListener("keydown",this._handleEscKey)}_handleEscKey(t){t.key==="Escape"&&this.dispatchEvent(new CustomEvent("close",{detail:{}}))}get popover(){return this._popoverContainer}},Zt=({render:e,html:t})=>qe;var Je={};N(Je,{handleClickItem:()=>cs});var cs=(e,t)=>{let{dispatchEvent:r}=t,s=e.currentTarget.dataset.id;r(new CustomEvent("item-click",{detail:{id:s}}))};var Ge={};N(Ge,{INITIAL_STATE:()=>ds,toViewData:()=>fs});var ds=Object.freeze({}),hs=["id","class","style","slot"],us=e=>Object.entries(e).filter(([t])=>!hs.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),fs=({props:e,attrs:t})=>{let r=us(t),s=e.items||[],i=e.separator||"breadcrumb-arrow",n=[];return s.forEach((a,o)=>{n.push(a),o<s.length-1&&n.push({isSeparator:!0})}),{containerAttrString:r,items:n,separator:i}};var er={elementName:"rtgl-breadcrumb",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"}}}},separator:{type:"string"}}},propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"}}}},separator:{type:"string",default:"breadcrumb-arrow"}}},refs:{"item-*":{eventListeners:{click:{handler:"handleClickItem"}}}},events:{"item-click":{type:"object",properties:{item:{type:"object",properties:{label:{type:"string"},id:{type:"string"}}},index:{type:"number"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md p=sm ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:null,iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isSeparator",value:{type:6,conditions:[{type:1,path:"item.isSeparator"},{type:1,path:"item.id"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${separator} c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"separator"}," c=mu-fg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#item-${item.id} data-id=${item.id} cur=p",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#item-",{type:1,path:"item.id"}," data-id=",{type:1,path:"item.id"}," cur=p"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md p=sm ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Ye={};N(Ye,{handleClickMenuItem:()=>ys,handleClosePopover:()=>ms});var ms=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("close"))},ys=(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 Xe={};N(Xe,{INITIAL_STATE:()=>gs,toViewData:()=>vs});var gs=Object.freeze({}),vs=({props:e,attrs:t})=>({items:e.items||[],open:!!t.open,x:t.x,y:t.y,placement:t.placement});var tr={elementName:"rtgl-dropdown-menu",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["label","item","separator"]}}}}}},attrsSchema:{type:"object",properties:{open:{type:"string"},x:{type:"string"},y:{type:"string"},placement:{type:"string"}}},refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option-*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} placement=${placement}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=background br=md",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.type == 'label'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"label"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"item"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"separator"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f ph=lg pv=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option-${i} w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=mu",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option-",{type:1,path:"i"}," w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=mu"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 ph=lg mv=md bgc=bo",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," placement=",{type:1,path:"placement"}]}}],fast:!1}],fast:!1}};var Qe={};N(Qe,{handleActionClick:()=>xs,handleBeforeMount:()=>bs,handleColorPickerChange:()=>Es,handleImageClick:()=>Cs,handleInputChange:()=>_s,handleOnUpdate:()=>ws,handlePopoverInputChange:()=>Ss,handleSelectChange:()=>ks,handleSliderChange:()=>As,handleSliderInputChange:()=>$s,handleWaveformClick:()=>Is});var bs=e=>{let{store:t,props:r}=e;t.setFormValues(r.defaultValues)},ws=(e,t)=>{let{oldAttrs:r,newAttrs:s}=e,{store:i,props:n,render:a}=t;r?.key!==s?.key&&(i.setFormValues(n.defaultValues),a())},le=(e,t,r,s)=>{s(new CustomEvent("form-change",{detail:{name:e,fieldValue:t,formValues:r}}))},xs=(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()}}))},_s=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("input-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),le(i,e.detail.value,r.selectFormValues(),s))},Ss=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("popover-input-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),le(i,e.detail.value,r.selectFormValues(),s))},ks=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("select-","");i&&e.detail.selectedValue!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.selectedValue}),le(i,e.detail.selectedValue,r.selectFormValues(),s))},Es=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("colorpicker-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),le(i,e.detail.value,r.selectFormValues(),s))},As=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("slider-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),le(i,e.detail.value,r.selectFormValues(),s))},$s=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("slider-input-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),le(i,e.detail.value,r.selectFormValues(),s))},Cs=(e,t)=>{e.type==="contextmenu"&&e.preventDefault();let{dispatchEvent:r}=t,s=e.currentTarget.id.replace("image-","");r(new CustomEvent("extra-event",{detail:{name:s,x:e.clientX,y:e.clientY,trigger:e.type}}))},Is=(e,t)=>{e.type==="contextmenu"&&e.preventDefault();let{dispatchEvent:r}=t,s=e.currentTarget.id.replace("waveform-","");r(new CustomEvent("extra-event",{detail:{name:s,x:e.clientX,y:e.clientY,trigger:e.type}}))};var Ze={};N(Ze,{INITIAL_STATE:()=>Ts,getFormFieldValue:()=>Rs,selectFormValues:()=>js,selectState:()=>Ps,setFormFieldValue:()=>Ms,setFormValues:()=>Ds,toViewData:()=>Ns});var Ts=Object.freeze({formValues:{}}),rr=(e,t,r=void 0)=>{let s=t.split(/[\[\].]/).filter(n=>n!==""),i=e;for(let n of s){if(i==null||!(n in i))return r;i=i[n]}return i},Os=(e,t,r)=>{let s=t.split(/[\[\].]/).filter(n=>n!=="");t.includes("[")&&t in e&&delete e[t];let i=e;for(let n=0;n<s.length-1;n++){let a=s[n];if(!(a in i)||typeof i[a]!="object"||i[a]===null){let o=s[n+1],l=/^\d+$/.test(o);i[a]=l?[]:{}}i=i[a]}return i[s[s.length-1]]=r,e},Ls=["id","class","style","slot"],Vs=e=>Object.entries(e).filter(([t])=>!Ls.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Ns=({state:e,props:t,attrs:r})=>{let s=Vs(r),i=structuredClone(t.form.fields||[]),n=t.defaultValues||{};return i.forEach(a=>{if(a.defaultValue=rr(n,a.name),a.inputType==="image"){let o=a.src;a.imageSrc=o&&o.trim()?o:null,a.placeholderText=a.placeholder||"No Image"}if(a.inputType==="waveform"){let o=a.waveformData;a.waveformData=o||null,a.placeholderText=a.placeholder||"No Waveform"}}),{containerAttrString:s,title:t.form?.title||"",description:t?.form?.description||"",fields:i,actions:t?.form?.actions||{buttons:[]},formValues:e.formValues}},Ps=({state:e})=>e,js=({state:e})=>e.formValues,Rs=({state:e},t)=>rr(e.formValues,t),Ds=(e,t)=>{e.formValues=t||{}},Ms=(e,{name:t,value:r})=>{Os(e.formValues,t,r)};var sr={elementName:"rtgl-form",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{defaultValues:{type:"object"},form:{type:"object",properties:{title:{type:"string"},description:{type:"string"},fields:{type:"array",items:{anyOf:[{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"inputText"},placeholder:{type:"string"}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"select"},placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{id:{type:"string"},label:{type:"string"},value:{type:"any"}},required:["id","label","value"]}}},required:["name","label","inputType","options"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"colorPicker"},value:{type:"string"}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"slider"},min:{type:"number"},max:{type:"number"},step:{type:"number"},value:{type:"number"}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"slider-input"},min:{type:"number"},max:{type:"number"},step:{type:"number"},value:{type:"number"}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"image"},width:{type:"number"},height:{type:"number"},placeholder:{type:"string"}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"waveform"},width:{type:"number"},height:{type:"number"},placeholder:{type:"string"},defaultValue:{type:"object"},waveformData:{type:"object"}},required:["name","label","inputType"],additionalProperties:!1}]}},actions:{type:"object",properties:{buttons:{type:"array",items:{type:"object",properties:{id:{type:"string"},content:{type:"string"}},required:["id","content"]}}}}}}}},refs:{"action-*":{eventListeners:{click:{handler:"handleActionClick"}}},"input-*":{eventListeners:{"input-change":{handler:"handleInputChange"}}},"select-*":{eventListeners:{"select-change":{handler:"handleSelectChange"}}},"colorpicker-*":{eventListeners:{"colorpicker-change":{handler:"handleColorPickerChange"}}},"slider-*":{eventListeners:{"slider-change":{handler:"handleSliderChange"}}},"slider-input-*":{eventListeners:{"slider-input-value-change":{handler:"handleSliderInputChange"}}},"image-*":{eventListeners:{click:{handler:"handleImageClick"},contextmenu:{handler:"handleImageClick"}}},"waveform-*":{eventListeners:{click:{handler:"handleWaveformClick"},contextmenu:{handler:"handleWaveformClick"}}},"popover-input-*":{eventListeners:{"input-change":{handler:"handlePopoverInputChange"}}}},events:{"form-change":{},"extra-event":{}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f p=md g=lg ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"title"}}],fast:!0},{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"description"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-view g=lg w=f",value:{type:9,items:[{type:7,itemVar:"field",indexVar:"i",iterable:{type:1,path:"fields"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"field.label"}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:'$if field.inputType == "read-only-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"read-only-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"field.defaultValue"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "inputText"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"inputText"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#input-${field.name} w=f placeholder=${field.placeholder} value=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input-",{type:1,path:"field.name"}," w=f placeholder=",{type:1,path:"field.placeholder"}," value=",{type:1,path:"field.defaultValue"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "popover-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"popover-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-popover-input#popover-input-${field.name} label="${field.label}" .defaultValue=fields[${i}].defaultValue',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-popover-input#popover-input-",{type:1,path:"field.name"},' label="',{type:1,path:"field.label"},'" .defaultValue=fields[',{type:1,path:"i"},"].defaultValue"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-select#select-${field.name} w=f .options=fields[${i}].options .placeholder=fields[${i}].placeholder .selectedValue=fields[${i}].defaultValue",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#select-",{type:1,path:"field.name"}," w=f .options=fields[",{type:1,path:"i"},"].options .placeholder=fields[",{type:1,path:"i"},"].placeholder .selectedValue=fields[",{type:1,path:"i"},"].defaultValue"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "colorPicker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"colorPicker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#colorpicker-${field.name} value=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#colorpicker-",{type:1,path:"field.name"}," value=",{type:1,path:"field.defaultValue"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slider"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider#slider-${field.name} w=f min=${field.min} max=${field.max} step=${field.step} value=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider-",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," value=",{type:1,path:"field.defaultValue"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slider-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slider-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider-input#slider-input-${field.name} w=f min=${field.min} max=${field.max} step=${field.step} defaultValue=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider-input#slider-input-",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," defaultValue=",{type:1,path:"field.defaultValue"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "image" && field.imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"image"}},right:{type:1,path:"field.imageSrc"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image#image-${field.name} src=${field.imageSrc} w=${field.width} h=${field.height} cur=p",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image#image-",{type:1,path:"field.name"}," src=",{type:1,path:"field.imageSrc"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=p"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "image" && !field.imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"image"}},right:{type:5,op:0,operand:{type:1,path:"field.imageSrc"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#image-${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=p p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg ta=c",value:{type:1,path:"field.placeholderText"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#image-",{type:1,path:"field.name"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," bc=ac bw=sm ah=c av=c cur=p p=md"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "waveform" && field.waveformData',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"waveform"}},right:{type:1,path:"field.waveformData"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-waveform#waveform-${field.name} .waveformData=fields[${i}].waveformData w=${field.width} h=${field.height} cur=p",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-waveform#waveform-",{type:1,path:"field.name"}," .waveformData=fields[",{type:1,path:"i"},"].waveformData w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=p"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "waveform" && !field.waveformData',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"waveform"}},right:{type:5,op:0,operand:{type:1,path:"field.waveformData"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#waveform-${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=p p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg ta=c",value:{type:1,path:"field.placeholder"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#waveform-",{type:1,path:"field.name"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," bc=ac bw=sm ah=c av=c cur=p p=md"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=e g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions.buttons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action-${button.id}",value:{type:1,path:"button.content"},parsedKey:{type:2,parts:["rtgl-button#action-",{type:1,path:"button.id"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=f p=md g=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var et={};N(et,{handleClickStart:()=>Ws});var Ws=(e,t)=>{let{dispatchEvent:r,store:s}=t;console.log("handle click start",s.selectPath()),r(new CustomEvent("clickStart",{detail:{path:s.selectPath()}}))};var tt={};N(tt,{INITIAL_STATE:()=>Bs,selectPath:()=>Hs,setState:()=>Us,toViewData:()=>Fs});var Bs=Object.freeze({}),zs=["id","class","style","slot"],Ks=e=>Object.entries(e).filter(([t])=>!zs.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Fs=({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:Ks(r),start:s||{label:"",image:{src:"",width:32,height:32,alt:""}}}},Hs=({props:e})=>e.start.path,Us=e=>{};var ir={elementName:"rtgl-navbar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}},hasImage:{type:"boolean"},hasHref:{type:"boolean"}}}}},propsSchema:{type:"object",properties:{start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}}}}}},refs:{start:{eventListeners:{click:{handler:"handleClickStart"}}}},events:{clickStart:{type:"object",properties:{path:{type:"string"}}}},anchors:[[{"rtgl-text s=lg":"${start.label}"},{"$if start.image && start.image.src":[{"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}":null}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view bgc=bg d=h h=48 av=c w=f ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if start.href",value:{type:6,conditions:[{type:1,path:"start.href"},{type:1,path:"start.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${start.href}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=lg g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a href=",{type:1,path:"start.href"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#start d=h av=c g=lg g=md cur=p",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=lg g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view flex=1",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view d=h av=c g=lg",value:{type:9,items:[{type:8,properties:[{key:"slot name=right",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view bgc=bg d=h h=48 av=c w=f ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var rt={};N(rt,{handleBeforeMount:()=>Js});var nr=(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())},qs=(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),nr(n,t),s();let o=nr.bind(void 0,n,t);return e.addEventListener("scroll",o,{passive:!0}),()=>{e.removeEventListener("scroll",o)}},Js=e=>{let{attrs:t}=e;requestAnimationFrame(()=>{let r=document.getElementById(t["target-id"]),s=qs(r,e);return()=>{s()}})};var st={};N(st,{INITIAL_STATE:()=>Gs,selectCurrentId:()=>Qs,selectState:()=>Xs,setContentContainer:()=>ti,setCurrentId:()=>ei,setItems:()=>Zs,toViewData:()=>Ys});var Gs=Object.freeze({items:[],currentId:null,contentContainer:null}),Ys=({state:e})=>({items:e.items.map(t=>({...t,c:t.id===e.currentId?"fg":"mu-fg"})),currentId:e.currentId}),Xs=({state:e})=>e,Qs=({state:e})=>e.currentId,Zs=(e,t)=>{e.items=t},ei=(e,t)=>{e.currentId=t},ti=(e,t)=>{e.contentContainer=t};var ar={elementName:"rtgl-page-outline",viewDataSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{slug:{type:"string"},title:{type:"string"}}}},selectedSlug:{type:"string",nullable:!0}}},propsSchema:{type:"object",properties:{}},refs:{},events:{onItemClick:{type:"object"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=272",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f g=sm mt=xl",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view pv=xs av=c href=${item.href}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} h-c=fg",value:{type:1,path:"item.title"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," h-c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view pv=xs av=c href=",{type:1,path:"item.href"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var it={};N(it,{handleBeforeMount:()=>ri,handleInputChange:()=>ai,handleInputKeydown:()=>li,handleOnUpdate:()=>si,handlePopoverClose:()=>ni,handleSubmitClick:()=>oi,handleTextClick:()=>ii});var ri=e=>{let{store:t,props:r}=e;(r.value!==void 0||r.defaultValue!==void 0)&&t.setValue(r.value||r.defaultValue||"")},si=(e,t)=>{let{oldProps:r,newProps:s}=e,{store:i,props:n,render:a}=t;r.defaultValue!==s.defaultValue&&i.setValue(n.defaultValue||""),a()},ii=(e,t)=>{let{store:r,render:s,getRefIds:i,attrs:n}=t,a=r.selectValue();r.setTempValue(a),r.openPopover({position:{x:e.currentTarget.getBoundingClientRect().left,y:e.currentTarget.getBoundingClientRect().bottom}});let{input:o}=i();o.elm.value=a,s(),n["auto-focus"]&&setTimeout(()=>{o.elm.focus()},50)},ni=(e,t)=>{let{store:r,render:s}=t;r.closePopover(),s()},ai=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=t,n=e.detail.value;r.setTempValue(n),i(new CustomEvent("temp-input-change",{detail:{value:n},bubbles:!0})),s()},oi=(e,t)=>{let{store:r,render:s,dispatchEvent:i,getRefIds:n}=t,{input:a}=n(),o=a.elm.value;r.setValue(o),r.closePopover(),i(new CustomEvent("input-change",{detail:{value:o},bubbles:!0})),s()},li=(e,t)=>{let{store:r,render:s,dispatchEvent:i,getRefIds:n}=t;if(e.key==="Enter"){let{input:a}=n(),o=a.elm.value;r.closePopover(),i(new CustomEvent("input-change",{detail:{value:o},bubbles:!0})),s()}else e.key==="Escape"&&(r.closePopover(),s())};var nt={};N(nt,{INITIAL_STATE:()=>pi,closePopover:()=>ui,openPopover:()=>hi,selectValue:()=>mi,setTempValue:()=>di,setValue:()=>fi,toViewData:()=>ci});var pi=Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),ci=({attrs:e,state:t,props:r})=>{let s=t.value||"-";return{isOpen:t.isOpen,position:t.position,value:s??"-",tempValue:t.tempValue,placeholder:r.placeholder??"",label:e.label}},di=(e,t)=>{e.tempValue=t},hi=(e,t)=>{let{position:r}=t;e.position=r,e.isOpen=!0,e.hasUnsavedChanges=!1},ui=e=>{e.isOpen=!1,e.tempValue=""},fi=(e,t)=>{e.value=t},mi=({state:e})=>e.value;var or={elementName:"rtgl-popover-input",viewDataSchema:{type:"object"},attrsSchema:{type:"object",properties:{"auto-focus":{type:"boolean"}}},propsSchema:{type:"object",properties:{value:{type:"string"},defaultValue:{type:"string"},placeholder:{type:"string"},onChange:{type:"function"}}},refs:{"text-display":{eventListeners:{click:{handler:"handleTextClick"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},input:{eventListeners:{"input-change":{handler:"handleInputChange"},keydown:{handler:"handleInputKeydown"}}},submit:{eventListeners:{click:{handler:"handleSubmitClick"}}}},events:{"input-change":{}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#text-display w=f cur=p",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"value"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=240 slot=content bgc=background br=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-input#input w=f placeholder=${placeholder}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=f placeholder=",{type:1,path:"placeholder"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#submit",value:{type:0,value:"Submit"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}]}}],fast:!0}],fast:!0}};var at={};N(at,{handleBeforeMount:()=>yi,handleButtonClick:()=>gi,handleClickOptionsPopoverOverlay:()=>vi,handleOptionClick:()=>bi});var yi=e=>{let{store:t,props:r,render:s}=e;if(r.selectedValue!==null&&r.selectedValue!==void 0&&r.options){let i=r.options.find(n=>n.value===r.selectedValue);i&&(t.updateSelectOption(i),s())}},gi=(e,t)=>{let{store:r,render:s,getRefIds:i}=t;r.openOptionsPopover({position:{y:e.clientY,x:e.clientX}}),s()},vi=(e,t)=>{let{store:r,render:s}=t;r.closeOptionsPopover(),s()},bi=(e,t)=>{let{render:r,dispatchEvent:s,props:i,store:n}=t,a=e.currentTarget.id.replace("option-",""),o=i.options[a];n.updateSelectOption(o),i.onChange&&typeof i.onChange=="function"&&i.onChange(o.value),s(new CustomEvent("option-selected",{detail:{value:o.value,label:o.label},bubbles:!0})),s(new CustomEvent("select-change",{detail:{selectedValue:o.value},bubbles:!0})),r()};var ot={};N(ot,{INITIAL_STATE:()=>wi,closeOptionsPopover:()=>ki,openOptionsPopover:()=>Si,selectState:()=>_i,toViewData:()=>xi,updateSelectOption:()=>Ei});var wi=Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,selectedLabel:null}),xi=({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"}},_i=({state:e})=>e,Si=(e,t)=>{let{position:r}=t;e.position=r,e.isOpen=!0},ki=e=>{e.isOpen=!1},Ei=(e,t)=>{e.selectedValue=t.value,e.selectedLabel=t.label,e.isOpen=!1};var lr={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:{close:{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 ?open=${isOpen} x=${position.x} y=${position.y}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=background br=md sv=true",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#option-${i} w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=${option.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option-",{type:1,path:"i"}," w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=",{type:1,path:"option.bgc"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}]}}],fast:!1}],fast:!1}};var lt={};N(lt,{handleHeaderClick:()=>Ai,handleItemClick:()=>$i});var Ai=(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}))},$i=(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 ct={};N(ct,{INITIAL_STATE:()=>Ci,selectActiveItem:()=>Vi,selectHeader:()=>Li,selectItem:()=>Ni,setState:()=>Pi,toViewData:()=>Oi});var Ci=Object.freeze({}),Ii=["id","class","style","slot"],Ti=e=>Object.entries(e).filter(([t])=>!Ii.includes(t)).map(([t,r])=>`${t}=${r}`).join(" ");function pt(e,t=null){let r=[];for(let s of e){let i=s.id||s.href||s.path,n=t===i;if(r.push({id:i,title:s.title,href:s.href,type:s.type||"item",icon:s.icon,hrefAttr:s.href?`href=${s.href}`:"",isSelected:n,itemBgc:n?"ac":"bg",itemHoverBgc:n?"ac":"mu"}),s.items&&Array.isArray(s.items))for(let a of s.items){let o=a.id||a.href||a.path,l=t===o;r.push({id:o,title:a.title,href:a.href,type:a.type||"item",icon:a.icon,hrefAttr:a.href?`href=${a.href}`:"",isSelected:l,itemBgc:l?"ac":"bg",itemHoverBgc:l?"ac":"mu"})}}return r}var Oi=({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=Ti(r),o=r.mode||"full",l=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},p=i?pt(i,n):[],h=o==="full"?272:64,d=o==="full"?"fs":"c",m=o==="full"?"fs":"c",v=o==="full"?"lg":"sm",c=o==="full"?"md":"sm",u=o==="shrunk-lg"?48:40,f=o==="shrunk-lg"?28:20,y=o==="shrunk-lg"?"md":"sm",b=o==="full",w=o==="full",x=o==="full"?"fs":"c",k=o==="full"?"":`ah=${m}`,_=o==="full"?"f":u;return{containerAttrString:a,mode:o,header:l,items:p,sidebarWidth:h,headerAlign:d,itemAlign:m,headerPadding:v,itemPadding:c,itemHeight:u,iconSize:f,firstLetterSize:y,showLabels:b,showGroupLabels:w,itemContentAlign:x,itemAlignAttr:k,itemWidth:_,headerWidth:_,selectedItemId:n,ah:o==="shrunk-lg"||o==="shrunk-md"?"c":""}},Li=({state:e,props:t,attrs:r})=>r.header?JSON.parse(decodeURIComponent(r.header)):t.header,Vi=({state:e,props:t})=>(t.items?pt(t.items):[]).find(s=>s.active),Ni=({state:e,props:t,attrs:r},s)=>{let i=r.items?JSON.parse(decodeURIComponent(r.items)):t.items;return(i?pt(i):[]).find(a=>a.id===s)},Pi=e=>{};var pr={elementName:"rtgl-sidebar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},mode:{type:"string",enum:["full","shrunk","shrunk-lg"],default:"full"},sidebarWidth:{type:"number"},headerAlign:{type:"string"},itemAlign:{type:"string"},headerPadding:{type:"string"},itemPadding:{type:"string"},itemHeight:{type:"number"},iconSize:{type:"number"},firstLetterSize:{type:"string"},showLabels:{type:"boolean"},showGroupLabels:{type:"boolean"},itemContentAlign:{type:"string"},itemAlignAttr:{type:"string"},itemWidth:{type:"string"},headerWidth:{type:"string"},selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},active:{type:"boolean"},icon:{type:"string"}}}}}},propsSchema:{type:"object",properties:{selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},items:{type:"array"}}}}}},refs:{"header-image":{eventListeners:{click:{handler:"handleHeaderClick"}}},"header-label":{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item-*":{eventListeners:{click:{handler:"handleItemClick"}}}},events:{headerClick:{type:"object",properties:{path:{type:"string"}}}},anchors:[[{"$if header.image && header.image.src":[{"$if header.image.href":[{"a href=${header.image.href}":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],"$elif header.image.path":[{"rtgl-view#header-image cur=p":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],$else:[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}]},{"$if header.label && showLabels":[{"$if header.labelHref":[{"rtgl-text href=${header.labelHref} s=lg":"${header.label}"}],"$elif header.labelPath":[{"rtgl-view#header-label cur=p":[{"rtgl-text s=lg":"${header.label}"}]}],$else:[{"rtgl-text s=lg":"${header.label}"}]}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=${sidebarWidth} bwr=xs ah=${ah} ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view ph=${headerPadding} pv=lg",value:{type:9,items:[{type:8,properties:[{key:"$if header.href",value:{type:6,conditions:[{type:1,path:"header.href"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view href=${header.href} d=h av=c ah=${headerAlign} g=lg w=${headerWidth}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header-image cur=p",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header-label cur=p",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view href=",{type:1,path:"header.href"}," d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c ah=${headerAlign} g=lg w=${headerWidth} cur=p",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header-image cur=p",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header-label cur=p",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#header d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}," cur=p"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view ph=",{type:1,path:"headerPadding"}," pv=lg"]}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=f ph=${headerPadding} pb=lg g=xs ah=${ah}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'$if item.type == "groupLabel"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"groupLabel"}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showGroupLabels",value:{type:6,conditions:[{type:1,path:"showGroupLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=32 av=c ph=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=1 bgc=mu-bg",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#item-${item.id} ${item.hrefAttr} h=${itemHeight} av=c ${itemAlignAttr} ph=${itemPadding} w=${itemWidth} h-bgc=${item.itemHoverBgc} br=lg bgc=${item.itemBgc} cur=p",value:{type:9,items:[{type:8,properties:[{key:"$if item.icon",value:{type:6,conditions:[{type:1,path:"item.icon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=${itemContentAlign} g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h ah=",{type:1,path:"itemContentAlign"}," g=sm"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=${iconSize} svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=",{type:1,path:"iconSize"}," svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=${iconSize} br=f bgc=mu av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=${firstLetterSize} c=fg",value:{type:1,path:"item.title.charAt(0).toUpperCase()"},parsedKey:{type:2,parts:["rtgl-text s=",{type:1,path:"firstLetterSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view wh=",{type:1,path:"iconSize"}," br=f bgc=mu av=c ah=c"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#item-",{type:1,path:"item.id"}," ",{type:1,path:"item.hrefAttr"}," h=",{type:1,path:"itemHeight"}," av=c ",{type:1,path:"itemAlignAttr"}," ph=",{type:1,path:"itemPadding"}," w=",{type:1,path:"itemWidth"}," h-bgc=",{type:1,path:"item.itemHoverBgc"}," br=lg bgc=",{type:1,path:"item.itemBgc"}," cur=p"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f ph=",{type:1,path:"headerPadding"}," pb=lg g=xs ah=",{type:1,path:"ah"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{type:1,path:"sidebarWidth"}," bwr=xs ah=",{type:1,path:"ah"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var dt={};N(dt,{handleBeforeMount:()=>ji,handleValueChange:()=>Ri});var ji=e=>{let{store:t,attrs:r}=e;t.setValue(r.defaultValue||0)},Ri=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=t,n=Number(e.detail.value);r.setValue(n),s(),i(new CustomEvent("slider-input-value-change",{detail:{value:n},bubbles:!0}))};var ht={};N(ht,{INITIAL_STATE:()=>Di,setValue:()=>Wi,toViewData:()=>Mi});var Di=Object.freeze({value:0}),Mi=({state:e,attrs:t})=>({value:e.value,w:t.w||"",min:t.min||0,max:t.max||100,step:t.step||1}),Wi=(e,t)=>{e.value=t};var cr={elementName:"rtgl-slider-input",viewDataSchema:{type:"object"},attrsSchema:{type:"object",properties:{defaultValue:{type:"string",default:"0"},w:{type:"string",default:""},min:{type:"string",default:"0"},max:{type:"string",default:"100"},step:{type:"string",default:"1"}}},refs:{input:{eventListeners:{"input-change":{handler:"handleValueChange"}}},slider:{eventListeners:{"slider-change":{handler:"handleValueChange"}}}},events:{"form-change":{}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=${w}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-slider#slider w=f type=range min=${min} max=${max} step=${step} value=${value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider w=f type=range min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=84",value:{type:9,items:[{type:8,properties:[{key:"rtgl-input#input w=f type=number min=${min} max=${max} step=${step} value=${value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=f type=number min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md w=",{type:1,path:"w"}]}}],fast:!0}],fast:!0}};var ut={};N(ut,{handleBeforeMount:()=>Bi,handleHeaderClick:()=>Ki,handleRowClick:()=>zi});var Bi=e=>{},zi=(e,t)=>{let{dispatchEvent:r,props:s}=t,i=parseInt(e.currentTarget.id.replace("row-","")),n=s.data?.rows?.[i];n&&r(new CustomEvent("row-click",{detail:{rowIndex:i,rowData:n}}))},Ki=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=t,n=e.currentTarget.id.replace("header-",""),a=r.selectSortInfo(),o="asc";a.column===n&&(a.direction==="asc"?o="desc":a.direction==="desc"&&(o=null)),o?r.setSortColumn({column:n,direction:o}):r.clearSort(),s(),i(new CustomEvent("header-click",{detail:{column:n,direction:o,sortInfo:o?{column:n,direction:o}:null}}))};var ft={};N(ft,{INITIAL_STATE:()=>Fi,clearSort:()=>Qi,selectSortInfo:()=>Yi,selectState:()=>Gi,setSortColumn:()=>Xi,toViewData:()=>Ji});var Fi=Object.freeze({sortColumn:null,sortDirection:null}),Hi=["id","class","style","slot"],Ui=e=>Object.entries(e).filter(([t])=>!Hi.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),qi=(e,t)=>{let r=t.split("."),s=e;for(let i of r){if(s==null)return null;s=s[i]}return s},Ji=({state:e,props:t,attrs:r})=>{let s=Ui(r),i=t.data||{columns:[],rows:[]},n=i.rows.map((a,o)=>{let l=i.columns.map(p=>{let h=qi(a,p.key);return{key:p.key,value:h!=null?String(h):""}});return{index:o,cells:l}});return{containerAttrString:s,columns:i.columns||[],rows:n||[]}},Gi=({state:e})=>e,Yi=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),Xi=(e,{column:t,direction:r})=>{e.sortColumn=t,e.sortDirection=r},Qi=e=>{e.sortColumn=null,e.sortDirection=null};var dr={elementName:"rtgl-table",viewDataSchema:{type:"object",properties:{columns:{type:"array"},rows:{type:"array"},containerAttrString:{type:"string"}}},propsSchema:{type:"object",properties:{data:{type:"object",properties:{columns:{type:"array",items:{type:"object",properties:{key:{type:"string"},label:{type:"string"}}}},rows:{type:"array",items:{type:"object"}}}},responsive:{type:"boolean",default:!0}}},refs:{"row-*":{eventListeners:{click:{handler:"handleRowClick"}}},"header-*":{eventListeners:{click:{handler:"handleHeaderClick"}}}},events:{},styles:{table:{width:"100%","border-collapse":"collapse","border-spacing":0},thead:{"border-bottom":"2px solid var(--border)"},th:{padding:"12px","text-align":"left","font-weight":500,color:"var(--foreground)","background-color":"var(--muted)",cursor:"pointer",position:"sticky",top:0,"z-index":1},"tbody tr":{"border-bottom":"1px solid var(--border)"},"tbody tr:last-child":{"border-bottom":"none"},td:{padding:"12px",color:"var(--foreground)"},".table-container":{width:"100%",height:"100%",overflow:"auto"},".empty-state":{"text-align":"center",padding:"24px",color:"var(--muted-foreground)"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view.table-container ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if rows.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"rows.length"},right:{type:0,value:0}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"table",value:{type:9,items:[{type:8,properties:[{key:"thead",value:{type:9,items:[{type:8,properties:[{key:"tr",value:{type:9,items:[{type:7,itemVar:"column",indexVar:"i",iterable:{type:1,path:"columns"},body:{type:9,items:[{type:8,properties:[{key:"th#header-${column.key}",value:{type:1,path:"column.label"},parsedKey:{type:2,parts:["th#header-",{type:1,path:"column.key"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"tbody",value:{type:9,items:[{type:7,itemVar:"row",indexVar:"rowIndex",iterable:{type:1,path:"rows"},body:{type:9,items:[{type:8,properties:[{key:"tr#row-${row.index}",value:{type:9,items:[{type:7,itemVar:"cell",indexVar:"cellIndex",iterable:{type:1,path:"row.cells"},body:{type:9,items:[{type:8,properties:[{key:"td",value:{type:1,path:"cell.value"}}],fast:!0}],fast:!0}}],fast:!1},parsedKey:{type:2,parts:["tr#row-",{type:1,path:"row.index"}]}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view.empty-state w=f p=xl",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"No data available"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view.table-container ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var mt={};N(mt,{handleClickItem:()=>Zi});var Zi=(e,t)=>{let{dispatchEvent:r}=t,s=e.currentTarget.dataset.id;r(new CustomEvent("item-click",{detail:{id:s}}))};var yt={};N(yt,{INITIAL_STATE:()=>en,toViewData:()=>sn});var en=Object.freeze({}),tn=["id","class","style","slot"],rn=e=>Object.entries(e).filter(([t])=>!tn.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),sn=({state:e,props:t,attrs:r})=>{let s=rn(r),i=t.items||[],n=r["selected-tab"],a=i.map(o=>({...o,isSelected:o.id===n,bgColor:o.id===n?"ac":"",borderColor:o.id===n?"":"tr",textColor:o.id===n?"":"mu-fg"}));return{containerAttrString:s,items:a,selectedTab:n}};var hr={elementName:"rtgl-tabs",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},isSelected:{type:"boolean"},bgColor:{type:"string"},textColor:{type:"string"},borderColor:{type:"string"}}}},selectedTab:{type:"string"}}},propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"}}}}}},attrsSchema:{type:"object",properties:{"selected-tab":{type:"string"}}},refs:{"tab-*":{eventListeners:{click:{handler:"handleClickItem"}}}},events:{"item-click":{type:"object",properties:{id:{type:"string"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm bgc=mu p=sm br=lg ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:null,iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#tab-${item.id} data-id=${item.id} cur=p bgc=${item.bgColor} bw=xs bc=${item.borderColor} pv=md ph=lg br=lg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.textColor}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.textColor"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#tab-",{type:1,path:"item.id"}," data-id=",{type:1,path:"item.id"}," cur=p bgc=",{type:1,path:"item.bgColor"}," bw=xs bc=",{type:1,path:"item.borderColor"}," pv=md ph=lg br=lg"]}}],fast:!0}],fast:!0}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h g=sm bgc=mu p=sm br=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var gt={};N(gt,{handleAfterMount:()=>nn,handleOnUpdate:()=>an});var nn=async e=>{let{props:t,store:r,render:s,getRefIds:i}=e,{waveformData:n}=t;r.setWaveformData(n),s();let a=i().canvas?.elm;a&&ur(n,a)},an=async(e,t)=>{let{store:r,render:s,getRefIds:i,props:n}=t,{waveformData:a}=n;if(!a){console.log("waveform handleOnUpdate: no waveformData provided");return}r.setWaveformData(a),s();let o=i().canvas?.elm;o&&ur(a,o)};async function ur(e,t){let r=t.getContext("2d"),s=t.getBoundingClientRect(),i=s.width,n=s.height;t.width=i,t.height=n;let a=t.width,o=t.height;if(r.clearRect(0,0,a,o),r.fillStyle="#1a1a1a",r.fillRect(0,0,a,o),!e||!e.data)return;let l=e.data,p=o/2,h=r.createLinearGradient(0,0,0,o);h.addColorStop(0,"#404040"),h.addColorStop(.5,"#A1A1A1"),h.addColorStop(1,"#404040");let d=Math.max(1,a/l.length),m=.2;for(let v=0;v<l.length;v++){let u=l[v]*(o*.85),f=v*d,y=p-u/2;r.fillStyle=h,r.fillRect(f,y,Math.max(1,d*(1-m)),u)}r.strokeStyle="rgba(255, 255, 255, 0.1)",r.lineWidth=1,r.beginPath(),r.moveTo(0,p),r.lineTo(a,p),r.stroke(),r.shadowBlur=10,r.shadowColor="#2196F3"}var vt={};N(vt,{INITIAL_STATE:()=>on,setWaveformData:()=>ln,toViewData:()=>pn});var on=Object.freeze({waveformData:null}),ln=(e,t)=>{e.waveformData=t},pn=({state:e,attrs:t,props:r})=>({isLoading:r.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:r.waveformData});var fr={elementName:"rtgl-waveform",attrsSchema:{type:"object",properties:{w:{type:"string",description:"Width of the waveform visualizer",default:"250"},h:{type:"string",description:"Height of the waveform visualizer",default:"150"},cur:{type:"string",description:"cursor"}}},propsSchema:{type:"object",properties:{waveformData:{type:"object",description:"File ID of the waveform data in object storage"},isLoading:{type:"boolean",description:"Whether the waveform data is currently being loaded"}}},refs:{canvas:{selector:"canvas"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f pos=rel w=${w} h=${h} cur=${cur}",value:{type:9,items:[{type:8,properties:[{key:"$if isLoading",value:{type:6,conditions:[{type:1,path:"isLoading"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"..."}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'canvas#canvas style="width:100%; height:100%;"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=f pos=rel w=",{type:1,path:"w"}," h=",{type:1,path:"h"}," cur=",{type:1,path:"cur"}]}}],fast:!1}],fast:!1}};var wr=Symbol.for("immer-nothing"),mr=Symbol.for("immer-draftable"),K=Symbol.for("immer-state");function J(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var pe=Object.getPrototypeOf;function ce(e){return!!e&&!!e[K]}function re(e){return e?xr(e)||Array.isArray(e)||!!e[mr]||!!e.constructor?.[mr]||Ae(e)||$e(e):!1}var cn=Object.prototype.constructor.toString();function xr(e){if(!e||typeof e!="object")return!1;let t=pe(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===cn}function _e(e,t){Ee(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function Ee(e){let t=e[K];return t?t.type_:Array.isArray(e)?1:Ae(e)?2:$e(e)?3:0}function xt(e,t){return Ee(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function _r(e,t,r){let s=Ee(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function dn(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ae(e){return e instanceof Map}function $e(e){return e instanceof Set}function te(e){return e.copy_||e.base_}function _t(e,t){if(Ae(e))return new Map(e);if($e(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=xr(e);if(t===!0||t==="class_only"&&!r){let s=Object.getOwnPropertyDescriptors(e);delete s[K];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(pe(e),s)}else{let s=pe(e);if(s!==null&&r)return{...e};let i=Object.create(s);return Object.assign(i,e)}}function $t(e,t=!1){return Ce(e)||ce(e)||!re(e)||(Ee(e)>1&&(e.set=e.add=e.clear=e.delete=hn),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>$t(s,!0))),e}function hn(){J(2)}function Ce(e){return Object.isFrozen(e)}var un={};function se(e){let t=un[e];return t||J(0,e),t}var ye;function Sr(){return ye}function fn(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function yr(e,t){t&&(se("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function St(e){kt(e),e.drafts_.forEach(mn),e.drafts_=null}function kt(e){e===ye&&(ye=e.parent_)}function gr(e){return ye=fn(ye,e)}function mn(e){let t=e[K];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function vr(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[K].modified_&&(St(t),J(4)),re(e)&&(e=Se(t,e),t.parent_||ke(t,e)),t.patches_&&se("Patches").generateReplacementPatches_(r[K].base_,e,t.patches_,t.inversePatches_)):e=Se(t,r,[]),St(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==wr?e:void 0}function Se(e,t,r){if(Ce(t))return t;let s=t[K];if(!s)return _e(t,(i,n)=>br(e,s,t,i,n,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return ke(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),_e(n,(o,l)=>br(e,s,i,o,l,r,a)),ke(e,i,!1),r&&e.patches_&&se("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function br(e,t,r,s,i,n,a){if(ce(i)){let o=n&&t&&t.type_!==3&&!xt(t.assigned_,s)?n.concat(s):void 0,l=Se(e,i,o);if(_r(r,s,l),ce(l))e.canAutoFreeze_=!1;else return}else a&&r.add(i);if(re(i)&&!Ce(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Se(e,i),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&ke(e,i)}}function ke(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&$t(t,r)}function yn(e,t){let r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:Sr(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=s,n=Ct;r&&(i=[s],n=ge);let{revoke:a,proxy:o}=Proxy.revocable(i,n);return s.draft_=o,s.revoke_=a,o}var Ct={get(e,t){if(t===K)return e;let r=te(e);if(!xt(r,t))return gn(e,r,t);let s=r[t];return e.finalized_||!re(s)?s:s===bt(e.base_,t)?(wt(e),e.copy_[t]=At(s,e)):s},has(e,t){return t in te(e)},ownKeys(e){return Reflect.ownKeys(te(e))},set(e,t,r){let s=kr(te(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let i=bt(te(e),t),n=i?.[K];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(dn(r,i)&&(r!==void 0||xt(e.base_,t)))return!0;wt(e),Et(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 bt(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,wt(e),Et(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=te(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){J(11)},getPrototypeOf(e){return pe(e.base_)},setPrototypeOf(){J(12)}},ge={};_e(Ct,(e,t)=>{ge[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ge.deleteProperty=function(e,t){return ge.set.call(this,e,t,void 0)};ge.set=function(e,t,r){return Ct.set.call(this,e[0],t,r,e[0])};function bt(e,t){let r=e[K];return(r?te(r):e)[t]}function gn(e,t,r){let s=kr(t,r);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function kr(e,t){if(!(t in e))return;let r=pe(e);for(;r;){let s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=pe(r)}}function Et(e){e.modified_||(e.modified_=!0,e.parent_&&Et(e.parent_))}function wt(e){e.copy_||(e.copy_=_t(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var vn=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,s)=>{if(typeof t=="function"&&typeof r!="function"){let n=r;r=t;let a=this;return function(l=n,...p){return a.produce(l,h=>r.call(this,h,...p))}}typeof r!="function"&&J(6),s!==void 0&&typeof s!="function"&&J(7);let i;if(re(t)){let n=gr(this),a=At(t,void 0),o=!0;try{i=r(a),o=!1}finally{o?St(n):kt(n)}return yr(n,s),vr(i,n)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===wr&&(i=void 0),this.autoFreeze_&&$t(i,!0),s){let n=[],a=[];se("Patches").generateReplacementPatches_(t,i,n,a),s(n,a)}return i}else J(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){re(e)||J(8),ce(e)&&(e=bn(e));let t=gr(this),r=At(e,void 0);return r[K].isManual_=!0,kt(t),r}finishDraft(e,t){let r=e&&e[K];(!r||!r.isManual_)&&J(9);let{scope_:s}=r;return yr(s,t),vr(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=se("Patches").applyPatches_;return ce(e)?s(e,t):this.produce(e,i=>s(i,t))}};function At(e,t){let r=Ae(e)?se("MapSet").proxyMap_(e,t):$e(e)?se("MapSet").proxySet_(e,t):yn(e,t);return(t?t.scope_:Sr()).drafts_.push(r),r}function bn(e){return ce(e)||J(10,e),Er(e)}function Er(e){if(!re(e)||Ce(e))return e;let t=e[K],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=_t(e,t.scope_.immer_.useStrictShallowCopy_)}else r=_t(e,!0);return _e(r,(s,i)=>{_r(r,s,Er(i))}),t&&(t.finalized_=!1),r}var F=new vn,Ar=F.produce,rl=F.produceWithPatches.bind(F),sl=F.setAutoFreeze.bind(F),il=F.setUseStrictShallowCopy.bind(F),nl=F.applyPatches.bind(F),al=F.createDraft.bind(F),ol=F.finishDraft.bind(F);var g={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9},H={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8},Ie={NOT:0};var de=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var $r=(e,t)=>{if(t===null)return new de(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new de(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return new de(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},Cr=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new de(`Unknown function '${e}' (${r})`)};var wn=(e,t,r={})=>I(e,r,t,{}),I=(e,t,r,s)=>{if(e.var&&!e.type)return M(e.var,r,s);if(e.type===g.LITERAL)return e.value;if(e.type===g.VARIABLE)return M(e.path,r,s);if(e.type===g.INTERPOLATION)return xn(e.parts,t,r,s);switch(e.type){case g.FUNCTION:return Ir(e,t,r,s);case g.BINARY:return Tr(e,t,r,s);case g.UNARY:return Or(e,t,r,s);case g.CONDITIONAL:return Sn(e,t,r,s);case g.LOOP:return Cn(e,t,r,s);case g.OBJECT:return Tn(e,t,r,s);case g.ARRAY:return On(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},ee=new Map,M=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let s=ee.get(e);s||(s=e.split("."),ee.set(e,s));let i=t;for(let n=0;n<s.length;n++){let a=s[n];if(a in r){i=r[a];continue}if(i==null)return;i=i[a]}return i},xn=(e,t,r,s)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let a=I(n,t,r,s);i.push(a!=null?String(a):"")}return i.join("")},Ir=(e,t,r,s)=>{let i=t[e.name];if(!i)throw Cr(e.name,t);let n=e.args.map(a=>I(a,t,r,s));return i(...n)},Te=(e,t,r,s)=>{if(e.var&&!e.type)return M(e.var,r,s);switch(e.type){case g.VARIABLE:return M(e.path,r,s);case g.LITERAL:return e.value;case g.BINARY:return Tr(e,t,r,s);case g.UNARY:return Or(e,t,r,s);case g.FUNCTION:return Ir(e,t,r,s);default:return I(e,t,r,s)}},Tr=(e,t,r,s)=>{if(e.op===H.AND||e.op===H.OR){let a=Te(e.left,t,r,s),o=Te(e.right,t,r,s);switch(e.op){case H.AND:return a&&o;case H.OR:return a||o}}let i=I(e.left,t,r,s),n=I(e.right,t,r,s);switch(e.op){case H.EQ:return i==n;case H.NEQ:return i!=n;case H.GT:return i>n;case H.LT:return i<n;case H.GTE:return i>=n;case H.LTE:return i<=n;case H.IN:return Array.isArray(n)?n.includes(i):!1;default:throw new Error(`Unknown binary operator: ${e.op}`)}},Or=(e,t,r,s)=>{let i=e.op===Ie.NOT?Te(e.operand,t,r,s):I(e.operand,t,r,s);switch(e.op){case Ie.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},_n=(e,t,r,s)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===g.VARIABLE)if(M(i.path,r,s)){let a=e.bodies[0];if(a.type===g.OBJECT&&a.properties.length<=5){let o={};for(let l of a.properties){let p=l.parsedKey?I(l.parsedKey,t,r,s):l.key,h=l.value;if(h.type===g.LITERAL)o[p]=h.value;else if(h.type===g.VARIABLE)o[p]=M(h.path,r,s);else if(h.type===g.INTERPOLATION){let d=[];for(let m of h.parts)if(typeof m=="string")d.push(m);else if(m.type===g.VARIABLE){let v=M(m.path,r,s);d.push(v!=null?String(v):"")}else{let v=I(m,t,r,s);d.push(v!=null?String(v):"")}o[p]=d.join("")}else o[p]=I(h,t,r,s)}return o}}else{let a=e.bodies[1];if(a.type===g.OBJECT&&a.properties.length<=5){let o={};for(let l of a.properties){let p=l.parsedKey?I(l.parsedKey,t,r,s):l.key,h=l.value;if(h.type===g.LITERAL)o[p]=h.value;else if(h.type===g.VARIABLE)o[p]=M(h.path,r,s);else if(h.type===g.INTERPOLATION){let d=[];for(let m of h.parts)if(typeof m=="string")d.push(m);else if(m.type===g.VARIABLE){let v=M(m.path,r,s);d.push(v!=null?String(v):"")}else{let v=I(m,t,r,s);d.push(v!=null?String(v):"")}o[p]=d.join("")}else o[p]=I(h,t,r,s)}return o}}}return null},Sn=(e,t,r,s)=>{let i=_n(e,t,r,s);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let a=e.conditions[n];if(a===null||Te(a,t,r,s))return I(e.bodies[n],t,r,s)}return Lr},kn=(e,t)=>{let r=e.body,s=e.itemVar;if(r.type===g.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===g.VARIABLE){let i=r.conditions[0].path,n=r.bodies[0];if(i.startsWith(s+".")){let a=i.substring(s.length+1);if(n.type===g.OBJECT&&n.properties.length<=5){for(let l of n.properties)if(l.parsedKey)return null;let o=[];for(let l=0;l<t.length;l++){let p=t[l];if(p[a]){let h={};for(let d of n.properties){let m=d.key,v=d.value;if(v.type===g.LITERAL)h[m]=v.value;else if(v.type===g.VARIABLE){let c=v.path;if(c===s)h[m]=p;else if(c.startsWith(s+".")){let u=c.substring(s.length+1);h[m]=p[u]}else return null}else if(v.type===g.INTERPOLATION){let c=[],u=!0;for(let f of v.parts)if(typeof f=="string")c.push(f);else if(f.type===g.VARIABLE){let y=f.path;if(y===s)c.push(p!=null?String(p):"");else if(y.startsWith(s+".")){let b=y.substring(s.length+1),w=p[b];c.push(w!=null?String(w):"")}else{u=!1;break}}else{u=!1;break}if(!u)return null;h[m]=c.join("")}else return null}o.push(h)}}return o}}}return null},En=(e,t)=>{let r=e.body,s=e.itemVar,i=kn(e,t);if(i!==null)return i;if(r.type===g.OBJECT&&r.properties.length<=5){for(let o of r.properties)if(o.parsedKey)return null;let n=[],a=!0;for(let o of r.properties){let l=o.key,p=o.value;if(p.type===g.LITERAL)n.push({key:l,type:"literal",value:p.value});else if(p.type===g.VARIABLE){let h=p.path;if(h===s)n.push({key:l,type:"item"});else if(h.startsWith(s+".")){let d=h.substring(s.length+1);if(!d.includes("."))n.push({key:l,type:"prop",prop:d});else{a=!1;break}}else{a=!1;break}}else if(p.type===g.INTERPOLATION&&p.parts.length===1){let h=p.parts[0];if(h.type===g.VARIABLE){let d=h.path;if(d===s)n.push({key:l,type:"item_string"});else if(d.startsWith(s+".")){let m=d.substring(s.length+1);if(!m.includes("."))n.push({key:l,type:"prop_string",prop:m});else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}if(a){let o=new Array(t.length);if(n.length===3&&n[0].type==="prop"&&n[0].key==="id"&&n[1].type==="prop_string"&&n[1].key==="title"&&n[2].type==="prop"&&n[2].key==="completed")for(let l=0;l<t.length;l++){let p=t[l];o[l]={id:p.id,title:p.title!=null?String(p.title):"",completed:p.completed}}else for(let l=0;l<t.length;l++){let p=t[l],h={};for(let d of n)if(d.type==="literal")h[d.key]=d.value;else if(d.type==="item")h[d.key]=p;else if(d.type==="prop")h[d.key]=p[d.prop];else if(d.type==="item_string")h[d.key]=p!=null?String(p):"";else if(d.type==="prop_string"){let m=p[d.prop];h[d.key]=m!=null?String(m):""}o[l]=h}return o}}return null},An=(e,t,r,s,i)=>{let n=[],a=e.body;if(a.type===g.OBJECT&&a.fast!==!1){let o=e.itemVar,l=e.indexVar;for(let p=0;p<i.length;p++){let h=i[p],d={},m={...s,[o]:h,...l&&{[l]:p}};for(let v of a.properties){let c=v.parsedKey?I(v.parsedKey,t,r,m):v.key,u=v.value;if(u.type===g.LITERAL)d[c]=u.value;else if(u.type===g.VARIABLE){let f=u.path;if(f===o)d[c]=h;else if(f===l)d[c]=p;else if(f.startsWith(o+".")){let y=f.substring(o.length+1);if(!y.includes("."))d[c]=h[y];else{let b=ee.get(y)||(ee.set(y,y.split(".")),ee.get(y)),w=h;for(let x of b){if(w==null){w=void 0;break}w=w[x]}d[c]=w}}else d[c]=M(f,r,{...s,[o]:h,...l&&{[l]:p}})}else if(u.type===g.INTERPOLATION){let f=[];for(let y of u.parts)if(typeof y=="string")f.push(y);else if(y.type===g.VARIABLE){let b=y.path,w;if(b===o)w=h;else if(b===l)w=p;else if(b.startsWith(o+".")){let x=b.substring(o.length+1);if(!x.includes("."))w=h[x];else{let k=ee.get(x)||(ee.set(x,x.split(".")),ee.get(x)),_=h;for(let $ of k){if(_==null){_=void 0;break}_=_[$]}w=_}}else w=M(b,r,{...s,[o]:h,...l&&{[l]:p}});f.push(w!=null?String(w):"")}else{let b={...s,[o]:h,...l&&{[l]:p}},w=I(y,t,r,b);f.push(w!=null?String(w):"")}d[c]=f.join("")}else{let f={...s,[o]:h,...l&&{[l]:p}};d[c]=I(u,t,r,f)}}n.push(d)}return n}return null},$n=(e,t,r)=>{let s=e.body;if(s.type===g.OBJECT&&s.properties.length===1&&s.properties[0].key==="$if item.visible"){let n=s.properties[0].value;if(n.type===g.CONDITIONAL&&n.conditions.length===1&&n.conditions[0].type===g.VARIABLE&&n.conditions[0].path==="item.visible"){let a=n.bodies[0];if(a.type===g.OBJECT&&a.properties.length===2){let o=a.properties[0],l=a.properties[1];if(o.key==="id"&&o.value.type===g.VARIABLE&&o.value.path==="item.id"&&l.key==="$if item.highlighted"&&l.value.type===g.CONDITIONAL){let p=[];for(let h=0;h<t.length;h++){let d=t[h];if(d.visible){let m={id:d.id};d.highlighted?(m.highlight=!0,m.message=`This item is highlighted: ${d.name}`):(m.highlight=!1,m.message=d.name),p.push(m)}}return p}}}}return null},Cn=(e,t,r,s)=>{let i=I(e.iterable,t,r,s);if(!Array.isArray(i)){let o=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${e.iterable.path}`;throw $r(o,i)}if(!e.indexVar){let o=$n(e,i,e.itemVar);if(o!==null)return o}if(!e.indexVar){let o=En(e,i);if(o!==null)return o}let n=An(e,t,r,s,i);if(n!==null)return n;let a=[];for(let o=0;o<i.length;o++){let l=e.indexVar?{...s,[e.itemVar]:i[o],[e.indexVar]:o}:{...s,[e.itemVar]:i[o]},p=I(e.body,t,r,l);Array.isArray(p)&&p.length===1?a.push(p[0]):a.push(p)}return a},In=(e,t,r,s)=>{if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?I(i.parsedKey,t,r,s):i.key,a=i.value;if(a.type===g.OBJECT&&a.properties.length<=10){let o={},l={},p=!0;for(let h of a.properties){let d=h.parsedKey?I(h.parsedKey,t,r,s):h.key,m=h.value;if(m.type===g.LITERAL)l[d]=m.value;else if(m.type===g.VARIABLE)l[d]=M(m.path,r,s);else if(m.type===g.INTERPOLATION){let v=[];for(let c of m.parts)if(typeof c=="string")v.push(c);else if(c.type===g.VARIABLE){let u=M(c.path,r,s);v.push(u!=null?String(u):"")}else{p=!1;break}if(!p)break;l[d]=v.join("")}else if(m.type===g.OBJECT&&m.properties.length<=5){let v={};for(let c of m.properties){let u=c.key,f=c.value;if(f.type===g.LITERAL)v[u]=f.value;else if(f.type===g.VARIABLE)v[u]=M(f.path,r,s);else if(f.type===g.INTERPOLATION){let y=[];for(let b of f.parts)if(typeof b=="string")y.push(b);else if(b.type===g.VARIABLE){let w=M(b.path,r,s);y.push(w!=null?String(w):"")}else{p=!1;break}if(!p)break;v[u]=y.join("")}else{p=!1;break}}if(!p)break;l[d]=v}else{p=!1;break}}if(p)return o[n]=l,o}}return null},Tn=(e,t,r,s)=>{let i=In(e,t,r,s);if(i!==null)return i;if(e.fast){let l={};for(let p of e.properties){let h=p.parsedKey?I(p.parsedKey,t,r,s):p.key,d=p.value;if(d.type===g.LITERAL)l[h]=d.value;else if(d.type===g.VARIABLE)l[h]=M(d.path,r,s);else if(d.type===g.INTERPOLATION){let m=[];for(let v of d.parts)if(typeof v=="string")m.push(v);else if(v.type===g.VARIABLE){let c=M(v.path,r,s);m.push(c!=null?String(c):"")}else{let c=I(v,t,r,s);m.push(c!=null?String(c):"")}l[h]=m.join("")}else l[h]=I(d,t,r,s)}return l}let n={},a=null,o=!1;for(let l of e.properties)if(!l.key.startsWith("$if ")&&!l.key.match(/^\$if\s+\w+.*:?$/)&&!l.key.startsWith("$elif")&&!l.key.startsWith("$else")&&!l.key.startsWith("$for ")){o=!0;break}for(let l of e.properties)if(l.key.startsWith("$if ")||l.key.match(/^\$if\s+\w+.*:?$/)){let p=I(l.value,t,r,s);if(!o&&p!==null&&p!==void 0)return Array.isArray(p)&&p.length===1?p[0]:p;typeof p=="object"&&p!==null&&!Array.isArray(p)&&Object.assign(n,p)}else if(!l.key.startsWith("$for ")){let p=l.value;if(p&&p.type===g.OBJECT&&p.properties){let h=p.properties.find(d=>d.key.startsWith("$for "));if(h){let d=I(h.value,t,r,s);d!==void 0&&(n[l.key]=d)}else{let d=I(l.value,t,r,s);d!==void 0&&(n[l.key]=d)}}else{let h=l.parsedKey?I(l.parsedKey,t,r,s):l.key,d=I(l.value,t,r,s);d!==void 0&&(n[h]=d)}}return n},Lr={},On=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===g.LOOP){let a=I(n,t,r,s);i.push(a)}else{let a=I(n,t,r,s);a!==Lr&&i.push(a)}return i},Oe=wn;var Le=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...Le(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]:Le(n)})}}t.push(r)}return t},[]):e;var Vr=(e,t)=>{if(!t)return e;let r=[],s="",i=!1,n=null;for(let a=0;a<t.length;a++){let o=t[a];if(!i&&o===".")s&&(r.push(s),s="");else if(!i&&o==="[")s&&(r.push(s),s=""),i=!0;else if(i&&o==="]"){if(s){if(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))r.push(s.slice(1,-1));else{let l=Number(s);r.push(isNaN(l)?s:l)}s=""}i=!1,n=null}else i&&(o==='"'||o==="'")&&(n?o===n&&(n=null):n=o),s+=o}return s&&r.push(s),r.reduce((a,o)=>a&&a[o],e)},Nr=({h:e,template:t,viewData:r,refs:s,handlers:i})=>{let n=Oe(t,r,{}),a=Le(n),o=Pn({h:e,items:a,refs:s,handlers:i,viewData:r});return e("div",{style:{display:"contents"}},o)},Pn=({h:e,items:t,refs:r={},handlers:s={},viewData:i={}})=>{if(!Array.isArray(t))return console.error("Input to createVirtualDom must be an array."),[e("div",{},[])];function n(a,o=""){return a.map((l,p)=>{if(typeof l=="string"||typeof l=="number")return String(l);if(typeof l!="object"||l===null)return console.warn("Skipping invalid item in DOM structure:",l),null;let h=Object.entries(l);if(h.length===0)return null;let[d,m]=h[0];if(!isNaN(Number(d)))return Array.isArray(m)?n(m,`${o}.${d}`):typeof m=="object"&&m!==null&&Object.entries(m).length>0?n([m],`${o}.${d}`):String(m);h.length>1&&console.warn("Item has multiple keys, processing only the first:",d);let v,c,u=d.indexOf(" ");u===-1?(v=d,c=""):(v=d.substring(0,u),c=d.substring(u+1).trim());let f=v.split(/[.#]/)[0],y=f.includes("-"),b={},w={};if(c){let A=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]+))/g,S,V=new Set;for(;(S=A.exec(c))!==null;)if(V.add(S[1]),S[1].startsWith(".")){let U=S[1].substring(1),fe=S[4];w[U]=Vr(i,fe)}else if(S[1].startsWith("?")){let U=S[1].substring(1),fe=S[2]||S[3]||S[4],be;fe==="true"?be=!0:fe==="false"?be=!1:be=Vr(i,fe),be&&(b[U]="")}else b[S[1]]=S[2]||S[3]||S[4];let j=c,D=[],G,Pe=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]+))/g;for(;(G=Pe.exec(c))!==null;)D.push(G[0]);D.forEach(U=>{j=j.replace(U," ")});let je=/\b(\S+?)(?=\s|$)/g,R;for(;(R=je.exec(j))!==null;){let U=R[1];!V.has(U)&&!U.startsWith(".")&&!U.includes("=")&&(b[U]="")}}let x=v.match(/#([^.#\s]+)/);x&&!Object.prototype.hasOwnProperty.call(b,"id")&&(b.id=x[1]);let k=null;b.id?k=b.id:y&&(k=f);let _=Object.create(null),$=null;if(y)$=f;else{let A=v.match(/\.([^.#]+)/g);A&&A.forEach(V=>{let j=V.substring(1);_[j]=!0});let S=v.match(/#([^.#\s]+)/);S&&($=S[1])}let E;typeof m=="string"||typeof m=="number"?E=String(m):Array.isArray(m)?E=n(m,`${o}.${d}`):E=[],$&&!y&&(b.id=$);let T=Object.create(null);if(k&&r){let A=[];if(Object.keys(r).forEach(S=>{if(S.includes("*")){let V="^"+S.replace(/[.*+?^${}()|[\\\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"$";try{new RegExp(V).test(k)&&A.push(S)}catch(j){console.warn(`[Parser] Invalid regex pattern created from refKey '${S}': ${V}`,j)}}else k===S&&A.push(S)}),A.length>0){A.sort((V,j)=>{let D=!V.includes("*"),G=!j.includes("*");return D&&!G?-1:!D&&G?1:j.length-V.length});let S=A[0];if(r[S]&&r[S].eventListeners){let V=r[S].eventListeners;Object.entries(V).forEach(([j,D])=>{D.handler&&s[D.handler]?T[j]=G=>{s[D.handler](G)}:D.handler&&console.warn(`[Parser] Handler '${D.handler}' for refKey '${S}' (matching elementId '${k}') is referenced but not found in available handlers.`)})}}}let L={};if(k)L.key=k;else if(v){let A=o?`${o}.${p}`:String(p);if(L.key=`${v}-${A}`,Object.keys(w).length>0){let S=JSON.stringify(w).substring(0,50);L.key+=`-${S}`}}Object.keys(b).length>0&&(L.attrs=b),Object.keys(_).length>0&&(L.class=_),Object.keys(T).length>0&&(L.on=T),Object.keys(w).length>0&&(L.props=w),y&&(L.hook={update:(A,S)=>{let V=A.data?.props||{},j=S.data?.props||{},D=A.data?.attrs||{},G=S.data?.attrs||{},Pe=JSON.stringify(V)!==JSON.stringify(j),je=JSON.stringify(D)!==JSON.stringify(G);if(Pe||je){let R=S.elm;R&&R.render&&typeof R.render=="function"&&(R.setAttribute("isDirty","true"),requestAnimationFrame(()=>{if(R.render(),R.removeAttribute("isDirty"),R.handlers&&R.handlers.handleOnUpdate){let U={...R.deps||{},store:R.store,render:R.render.bind(R),handlers:R.handlers,dispatchEvent:R.dispatchEvent.bind(R),refIds:R.refIds||{},getRefIds:()=>R.refIds||{}};R.handlers.handleOnUpdate({oldProps:V,newProps:j,oldAttrs:D,newAttrs:G},U)}}))}}});try{return e(f,L,E)}catch(A){return console.error("Error creating virtual node:",A,{tagName:f,snabbdomData:L,childrenOrText:E}),e("div",{},["Error creating element"])}}).filter(Boolean)}return n(t)};var jn=(e,t)=>{if(!t||typeof t!="object")return"";let r="",s=n=>Object.entries(n).map(([a,o])=>` ${a}: ${o};`).join(`
920
+ `),i=(n,a)=>{if(typeof a!="object"||a===null)return"";if(n.startsWith("@")){let o=Object.entries(a).map(([l,p])=>{let h=s(p);return` ${l} {
921
921
  ${h.split(`
922
922
  `).map(d=>d?` ${d}`:"").join(`
923
923
  `)}
924
924
  }`}).join(`
925
925
  `);return`${n} {
926
- ${a}
927
- }`}else{let a=s(o);return`${n} {
928
- ${a}
929
- }`}};return Object.entries(t).forEach(([n,o])=>{let a=i(n,o);a&&(r+=(r?`
926
+ ${o}
927
+ }`}else{let o=s(a);return`${n} {
928
+ ${o}
929
+ }`}};return Object.entries(t).forEach(([n,a])=>{let o=i(n,a);o&&(r+=(r?`
930
930
 
931
- `:"")+a)}),r},Vn=e=>{let t=e.map(r=>r.subscribe());return()=>{for(let r of t)r&&typeof r.unsubscribe=="function"&&r.unsubscribe()}};function Pn(e){return new Proxy({},{get(t,r){if(typeof r=="string"){let s=e.getAttribute(r);return s===""?!0:s}},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(t,r){return typeof r=="string"&&e.hasAttribute(r)},ownKeys(){return e.getAttributeNames()},getOwnPropertyDescriptor(t,r){if(typeof r=="string"&&e.hasAttribute(r))return{configurable:!0,enumerable:!0,get:()=>e.getAttribute(r)}}})}function jn(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 It=class extends HTMLElement{elementName;styles;h;store;props;propsSchema;template;handlers;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_oldVNode;deps;cssText;static get observedAttributes(){return["key"]}get viewData(){return this.store.toViewData()}connectedCallback(){this.shadow=this.attachShadow({mode:"open"});let t=new CSSStyleSheet;t.replaceSync(`
931
+ `:"")+o)}),r},Rn=e=>{let t=e.map(r=>r.subscribe());return()=>{for(let r of t)r&&typeof r.unsubscribe=="function"&&r.unsubscribe()}};function Dn(e){return new Proxy({},{get(t,r){if(typeof r=="string"){let s=e.getAttribute(r);return s===""?!0:s}},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(t,r){return typeof r=="string"&&e.hasAttribute(r)},ownKeys(){return e.getAttributeNames()},getOwnPropertyDescriptor(t,r){if(typeof r=="string"&&e.hasAttribute(r))return{configurable:!0,enumerable:!0,get:()=>e.getAttribute(r)}}})}function Mn(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 It=class extends HTMLElement{elementName;styles;h;store;props;propsSchema;template;handlers;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_oldVNode;deps;cssText;static get observedAttributes(){return["key"]}get viewData(){return this.store.toViewData()}connectedCallback(){this.shadow=this.attachShadow({mode:"open"});let t=new CSSStyleSheet;t.replaceSync(`
932
932
  a, a:link, a:visited, a:hover, a:active {
933
933
  display: contents;
934
934
  color: inherit;
@@ -940,4 +940,4 @@ ${a}
940
940
  font: inherit;
941
941
  cursor: pointer;
942
942
  }
943
- `);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)};if(Object.keys(this.handlers||{}).forEach(i=>{this.transformedHandlers[i]=n=>this.handlers[i](n,s)}),this.handlers?.handleBeforeMount&&(this._unmountCallback=this.handlers?.handleBeforeMount(s),this._unmountCallback&&typeof this._unmountCallback.then=="function"))throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");this.render(),this.handlers?.handleAfterMount&&this.handlers?.handleAfterMount(s),this.handlers?.subscriptions&&(this.unsubscribeAll=Vn(this.handlers.subscriptions(s)))}disconnectedCallback(){this._unmountCallback&&this._unmountCallback(),this.unsubscribeAll&&this.unsubscribeAll()}attributeChangedCallback(t,r,s){if(r!==s&&this.render)if(this.handlers?.handleOnUpdate){let i={[t]:{oldValue:r,newValue:s}},n={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this),store:this.store,render:this.render.bind(this)};this.handlers.handleOnUpdate(i,n)}else requestAnimationFrame(()=>{this.render()})}render=()=>{if(!this.patch){console.error("Patch function is not defined!");return}if(!this.template){console.error("Template is not defined!");return}try{let t={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this),store:this.store,render:this.render.bind(this)},r=Nr({h:this.h,template:this.template,viewData:this.viewData,refs:this.refs,handlers:this.transformedHandlers}),s={},i=n=>{n.data?.attrs&&n.data.attrs.id&&(s[n.data.attrs.id]=n),n.children&&n.children.forEach(i)};i(r),this.refIds=s,this._oldVNode?this._oldVNode=this.patch(this._oldVNode,r):this._oldVNode=this.patch(this.renderTarget,r)}catch(t){console.error("Error during patching:",t)}}},Rn=(e,t,r)=>{let{INITIAL_STATE:s,toViewData:i,...n}=e,o={},a={},l=structuredClone(s);return Object.entries(n).forEach(([p,h])=>{p.startsWith("select")?o[p]=(...d)=>h({state:l,props:t,attrs:r},...d):a[p]=d=>(l=Er(l,m=>h(m,d)),l)}),{toViewData:()=>i({state:l,props:t,attrs:r}),getState:()=>l,...a,...o}},Dn=({handlers:e,view:t,store:r,patch:s,h:i},n)=>{let{elementName:o,propsSchema:a,attrsSchema:l,template:p,refs:h,styles:d}=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 m extends It{static get observedAttributes(){let c=["key"],u=l?.properties?Object.keys(l.properties):[];return[...c,...u]}constructor(){super();let c=Pn(this);this.propsSchema=a,this.props=a?jn(this,Object.keys(a.properties)):{},this.elementName=o,this.styles=d,this.store=Rn(r,this.props,c),this.template=p,this.handlers=e,this.refs=h,this.patch=s,this.deps={...n,store:this.store,render:this.render,handlers:e,attrs:c,props:this.props},this.h=i,this.cssText=Nn(o,d)}}return m},Tt=Dn;function ie(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 he=Array.isArray;function ue(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function Mn(e,t){return document.createElement(e,t)}function Wn(e,t,r){return document.createElementNS(e,t,r)}function Bn(){return ne(document.createDocumentFragment())}function zn(e){return document.createTextNode(e)}function Kn(e){return document.createComment(e)}function Fn(e,t,r){if(Z(e)){let s=e;for(;s&&Z(s);)s=ne(s).parent;e=s??e}Z(t)&&(t=ne(t,e)),r&&Z(r)&&(r=ne(r).firstChildNode),e.insertBefore(t,r)}function Hn(e,t){e.removeChild(t)}function Un(e,t){Z(t)&&(t=ne(t,e)),e.appendChild(t)}function Pr(e){if(Z(e)){for(;e&&Z(e);)e=ne(e).parent;return e??null}return e.parentNode}function qn(e){var t;if(Z(e)){let r=ne(e),s=Pr(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 Jn(e){return e.tagName}function Gn(e,t){e.textContent=t}function Yn(e){return e.textContent}function Xn(e){return e.nodeType===1}function Qn(e){return e.nodeType===3}function Zn(e){return e.nodeType===8}function Z(e){return e.nodeType===11}function ne(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 jr={createElement:Mn,createElementNS:Wn,createTextNode:zn,createDocumentFragment:Bn,createComment:Kn,insertBefore:Fn,removeChild:Hn,appendChild:Un,parentNode:Pr,nextSibling:qn,tagName:Jn,setTextContent:Gn,getTextContent:Yn,isElement:Xn,isText:Qn,isComment:Zn,isDocumentFragment:Z};function Ne(e){return e===void 0}function z(e){return e!==void 0}var Ot=ie("",{},[],void 0,void 0);function ve(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),o=e.sel===t.sel,a=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return o&&i&&n&&a}function ea(){throw new Error("The document fragment is not supported on this platform.")}function ta(e,t){return e.isElement(t)}function ra(e,t){return e.isDocumentFragment(t)}function sa(e,t,r){var s;let i={};for(let n=t;n<=r;++n){let o=(s=e[n])===null||s===void 0?void 0:s.key;o!==void 0&&(i[o]=n)}return i}var ia=["create","update","remove","destroy","pre","post"];function Rr(e,t,r){let s={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=t!==void 0?t:jr;for(let c of ia)for(let u of e){let f=u[c];f!==void 0&&s[c].push(f)}function n(c){let u=c.id?"#"+c.id:"",f=c.getAttribute("class"),y=f?"."+f.split(" ").join("."):"";return ie(i.tagName(c).toLowerCase()+u+y,{},[],void 0,c)}function o(c){return ie(void 0,{},[],void 0,c)}function a(c,u){return function(){if(--u===0){let y=i.parentNode(c);y!==null&&i.removeChild(y,c)}}}function l(c,u){var f,y,b,w;let x,k=c.data;if(k!==void 0){let E=(f=k.hook)===null||f===void 0?void 0:f.init;z(E)&&(E(c),k=c.data)}let _=c.children,$=c.sel;if($==="!")Ne(c.text)&&(c.text=""),c.elm=i.createComment(c.text);else if($==="")c.elm=i.createTextNode(c.text);else if($!==void 0){let E=$.indexOf("#"),T=$.indexOf(".",E),L=E>0?E:$.length,A=T>0?T:$.length,S=E!==-1||T!==-1?$.slice(0,Math.min(L,A)):$,N=c.elm=z(k)&&z(x=k.ns)?i.createElementNS(x,S,k):i.createElement(S,k);for(L<A&&N.setAttribute("id",$.slice(L+1,A)),T>0&&N.setAttribute("class",$.slice(A+1).replace(/\./g," ")),x=0;x<s.create.length;++x)s.create[x](Ot,c);if(ue(c.text)&&(!he(_)||_.length===0)&&i.appendChild(N,i.createTextNode(c.text)),he(_))for(x=0;x<_.length;++x){let D=_[x];D!=null&&i.appendChild(N,l(D,u))}let j=c.data.hook;z(j)&&((y=j.create)===null||y===void 0||y.call(j,Ot,c),j.insert&&u.push(c))}else if(!((b=r?.experimental)===null||b===void 0)&&b.fragments&&c.children){for(c.elm=((w=i.createDocumentFragment)!==null&&w!==void 0?w:ea)(),x=0;x<s.create.length;++x)s.create[x](Ot,c);for(x=0;x<c.children.length;++x){let E=c.children[x];E!=null&&i.appendChild(c.elm,l(E,u))}}else c.elm=i.createTextNode(c.text);return c.elm}function p(c,u,f,y,b,w){for(;y<=b;++y){let x=f[y];x!=null&&i.insertBefore(c,l(x,w),u)}}function h(c){var u,f;let y=c.data;if(y!==void 0){(f=(u=y?.hook)===null||u===void 0?void 0:u.destroy)===null||f===void 0||f.call(u,c);for(let b=0;b<s.destroy.length;++b)s.destroy[b](c);if(c.children!==void 0)for(let b=0;b<c.children.length;++b){let w=c.children[b];w!=null&&typeof w!="string"&&h(w)}}}function d(c,u,f,y){for(var b,w;f<=y;++f){let x,k,_=u[f];if(_!=null)if(z(_.sel)){h(_),x=s.remove.length+1,k=a(_.elm,x);for(let E=0;E<s.remove.length;++E)s.remove[E](_,k);let $=(w=(b=_?.data)===null||b===void 0?void 0:b.hook)===null||w===void 0?void 0:w.remove;z($)?$(_,k):k()}else _.children?(h(_),d(c,_.children,0,_.children.length-1)):i.removeChild(c,_.elm)}}function m(c,u,f,y){let b=0,w=0,x=u.length-1,k=u[0],_=u[x],$=f.length-1,E=f[0],T=f[$],L,A,S,N;for(;b<=x&&w<=$;)k==null?k=u[++b]:_==null?_=u[--x]:E==null?E=f[++w]:T==null?T=f[--$]:ve(k,E)?(v(k,E,y),k=u[++b],E=f[++w]):ve(_,T)?(v(_,T,y),_=u[--x],T=f[--$]):ve(k,T)?(v(k,T,y),i.insertBefore(c,k.elm,i.nextSibling(_.elm)),k=u[++b],T=f[--$]):ve(_,E)?(v(_,E,y),i.insertBefore(c,_.elm,k.elm),_=u[--x],E=f[++w]):(L===void 0&&(L=sa(u,b,x)),A=L[E.key],Ne(A)?(i.insertBefore(c,l(E,y),k.elm),E=f[++w]):Ne(L[T.key])?(i.insertBefore(c,l(T,y),i.nextSibling(_.elm)),T=f[--$]):(S=u[A],S.sel!==E.sel?i.insertBefore(c,l(E,y),k.elm):(v(S,E,y),u[A]=void 0,i.insertBefore(c,S.elm,k.elm)),E=f[++w]));w<=$&&(N=f[$+1]==null?null:f[$+1].elm,p(c,N,f,w,$,y)),b<=x&&d(c,u,b,x)}function v(c,u,f){var y,b,w,x,k,_,$,E;let T=(y=u.data)===null||y===void 0?void 0:y.hook;(b=T?.prepatch)===null||b===void 0||b.call(T,c,u);let L=u.elm=c.elm;if(c===u)return;if(u.data!==void 0||z(u.text)&&u.text!==c.text){(w=u.data)!==null&&w!==void 0||(u.data={}),(x=c.data)!==null&&x!==void 0||(c.data={});for(let N=0;N<s.update.length;++N)s.update[N](c,u);($=(_=(k=u.data)===null||k===void 0?void 0:k.hook)===null||_===void 0?void 0:_.update)===null||$===void 0||$.call(_,c,u)}let A=c.children,S=u.children;Ne(u.text)?z(A)&&z(S)?A!==S&&m(L,A,S,f):z(S)?(z(c.text)&&i.setTextContent(L,""),p(L,null,S,0,S.length-1,f)):z(A)?d(L,A,0,A.length-1):z(c.text)&&i.setTextContent(L,""):c.text!==u.text&&(z(A)&&d(L,A,0,A.length-1),i.setTextContent(L,u.text)),(E=T?.postpatch)===null||E===void 0||E.call(T,c,u)}return function(u,f){let y,b,w,x=[];for(y=0;y<s.pre.length;++y)s.pre[y]();for(ta(i,u)?u=n(u):ra(i,u)&&(u=o(u)),ve(u,f)?v(u,f,x):(b=u.elm,w=i.parentNode(b),l(f,x),w!==null&&(i.insertBefore(w,f.elm,i.nextSibling(b)),d(w,[u],0,0))),y=0;y<x.length;++y)x[y].data.hook.insert(x[y]);for(y=0;y<s.post.length;++y)s.post[y]();return f}}function Dr(e,t){let r,s,i=t.elm,n=e.data.class,o=t.data.class;if(!(!n&&!o)&&n!==o){n=n||{},o=o||{};for(s in n)n[s]&&!Object.prototype.hasOwnProperty.call(o,s)&&i.classList.remove(s);for(s in o)r=o[s],r!==n[s]&&i.classList[r?"add":"remove"](s)}}var Mr={create:Dr,update:Dr};function Wr(e,t){let r,s,i,n=t.elm,o=e.data.props,a=t.data.props;if(!(!o&&!a)&&o!==a){o=o||{},a=a||{};for(r in a)s=a[r],i=o[r],i!==s&&(r!=="value"||n[r]!==s)&&(n[r]=s)}}var Br={create:Wr,update:Wr};var na="http://www.w3.org/1999/xlink",aa="http://www.w3.org/2000/xmlns/",oa="http://www.w3.org/XML/1998/namespace";function zr(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 o=n[r];i[r]!==o&&(o===!0?s.setAttribute(r,""):o===!1?s.removeAttribute(r):r.charCodeAt(0)!==120?s.setAttribute(r,o):r.charCodeAt(3)===58?s.setAttributeNS(oa,r,o):r.charCodeAt(5)===58?r.charCodeAt(1)===109?s.setAttributeNS(aa,r,o):s.setAttributeNS(na,r,o):s.setAttribute(r,o))}for(r in i)r in n||s.removeAttribute(r)}}var Kr={create:zr,update:zr};var Fr=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,la=function(e){Fr(function(){Fr(e)})},Lt=!1;function pa(e,t,r){la(function(){e[t]=r})}function Hr(e,t){let r,s,i=t.elm,n=e.data.style,o=t.data.style;if(!n&&!o||n===o)return;n=n||{},o=o||{};let a="delayed"in n;for(s in n)s in o||(s[0]==="-"&&s[1]==="-"?i.style.removeProperty(s):i.style[s]="");for(s in o)if(r=o[s],s==="delayed"&&o.delayed)for(let l in o.delayed)r=o.delayed[l],(!a||r!==n.delayed[l])&&pa(i.style,l,r);else s!=="remove"&&r!==n[s]&&(s[0]==="-"&&s[1]==="-"?i.style.setProperty(s,r):i.style[s]=r)}function ca(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 da(e,t){let r=e.data.style;if(!r||!r.remove){t();return}Lt||(e.elm.offsetLeft,Lt=!0);let s,i=e.elm,n=0,o=r.remove,a=0,l=[];for(s in o)l.push(s),i.style[s]=o[s];let h=getComputedStyle(i)["transition-property"].split(", ");for(;n<h.length;++n)l.indexOf(h[n])!==-1&&a++;i.addEventListener("transitionend",function(d){d.target===i&&--a,a===0&&t()})}function ha(){Lt=!1}var Ur={pre:ha,create:Hr,update:Hr,destroy:ca,remove:da};function qr(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++)qr(e[s],t,r)}function ua(e,t){let r=e.type,s=t.data.on;s&&s[r]&&qr(s[r],t,e)}function fa(){return function e(t){ua(t,e.vnode)}}function Nt(e,t){let r=e.data.on,s=e.listener,i=e.elm,n=t&&t.data.on,o=t&&t.elm,a;if(r!==n){if(r&&s)if(n)for(a in r)n[a]||i.removeEventListener(a,s,!1);else for(a in r)i.removeEventListener(a,s,!1);if(n){let l=t.listener=e.listener||fa();if(l.vnode=t,r)for(a in n)r[a]||o.addEventListener(a,l,!1);else for(a in n)o.addEventListener(a,l,!1)}}}var Jr={create:Nt,update:Nt,destroy:Nt};var ma=()=>Rr([Mr,Br,Kr,Ur,Jr]),Vt=ma;function Gr(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&&Gr(n,i.children,i.sel)}}function Pt(e,t,r){let s={},i,n,o;if(r!==void 0?(t!==null&&(s=t),he(r)?i=r:ue(r)?n=r.toString():r&&r.sel&&(i=[r])):t!=null&&(he(t)?i=t:ue(t)?n=t.toString():t&&t.sel?i=[t]:s=t),i!==void 0)for(o=0;o<i.length;++o)ue(i[o])&&(i[o]=ie(void 0,void 0,void 0,i[o],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&Gr(s,i,e),ie(e,s,i,n,void 0)}var ya={},Yr={components:ya},Xr=Vt();var Ve={components:{breadcrumb:{handlers:Je,store:Ge,view:er},dropdownMenu:{handlers:Ye,store:Xe,view:tr},form:{handlers:Qe,store:Ze,view:rr},navbar:{handlers:et,store:tt,view:sr},pageOutline:{handlers:rt,store:st,view:nr},popoverInput:{handlers:it,store:nt,view:ar},select:{handlers:at,store:ot,view:or},sidebar:{handlers:lt,store:ct,view:lr},sliderInput:{handlers:dt,store:ht,view:pr},table:{handlers:ut,store:ft,view:cr},tabs:{handlers:mt,store:yt,view:dr},waveform:{handlers:gt,store:vt,view:ur}}};Object.keys(Ve).forEach(e=>{Object.keys(Ve[e]).forEach(t=>{let r=Tt({...Ve[e][t],patch:Xr,h:Pt},Yr[e]);customElements.define(Ve[e][t].view.elementName,r)})});customElements.define("rtgl-button",Mt({}));customElements.define("rtgl-view",zt({}));customElements.define("rtgl-text",Ft({}));customElements.define("rtgl-image",Ht({}));customElements.define("rtgl-svg",qt({}));customElements.define("rtgl-input",Jt({}));customElements.define("rtgl-textarea",Gt({}));customElements.define("rtgl-color-picker",Yt({}));customElements.define("rtgl-slider",Xt({}));customElements.define("rtgl-dialog",Qt({}));customElements.define("rtgl-popover",Zt({}));})();
943
+ `);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)};if(Object.keys(this.handlers||{}).forEach(i=>{this.transformedHandlers[i]=n=>this.handlers[i](n,s)}),this.handlers?.handleBeforeMount&&(this._unmountCallback=this.handlers?.handleBeforeMount(s),this._unmountCallback&&typeof this._unmountCallback.then=="function"))throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");this.render(),this.handlers?.handleAfterMount&&this.handlers?.handleAfterMount(s),this.handlers?.subscriptions&&(this.unsubscribeAll=Rn(this.handlers.subscriptions(s)))}disconnectedCallback(){this._unmountCallback&&this._unmountCallback(),this.unsubscribeAll&&this.unsubscribeAll()}attributeChangedCallback(t,r,s){if(r!==s&&this.render)if(this.handlers?.handleOnUpdate){let i={[t]:{oldValue:r,newValue:s}},n={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this),store:this.store,render:this.render.bind(this)};this.handlers.handleOnUpdate(i,n)}else requestAnimationFrame(()=>{this.render()})}render=()=>{if(!this.patch){console.error("Patch function is not defined!");return}if(!this.template){console.error("Template is not defined!");return}try{let t={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this),store:this.store,render:this.render.bind(this)},r=Nr({h:this.h,template:this.template,viewData:this.viewData,refs:this.refs,handlers:this.transformedHandlers}),s={},i=n=>{n.data?.attrs&&n.data.attrs.id&&(s[n.data.attrs.id]=n),n.children&&n.children.forEach(i)};i(r),this.refIds=s,this._oldVNode?this._oldVNode=this.patch(this._oldVNode,r):this._oldVNode=this.patch(this.renderTarget,r)}catch(t){console.error("Error during patching:",t)}}},Wn=(e,t,r)=>{let{INITIAL_STATE:s,toViewData:i,...n}=e,a={},o={},l=structuredClone(s);return Object.entries(n).forEach(([p,h])=>{p.startsWith("select")?a[p]=(...d)=>h({state:l,props:t,attrs:r},...d):o[p]=d=>(l=Ar(l,m=>h(m,d)),l)}),{toViewData:()=>i({state:l,props:t,attrs:r}),getState:()=>l,...o,...a}},Bn=({handlers:e,view:t,store:r,patch:s,h:i},n)=>{let{elementName:a,propsSchema:o,attrsSchema:l,template:p,refs:h,styles:d}=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 m extends It{static get observedAttributes(){let c=["key"],u=l?.properties?Object.keys(l.properties):[];return[...c,...u]}constructor(){super();let c=Dn(this);this.propsSchema=o,this.props=o?Mn(this,Object.keys(o.properties)):{},this.elementName=a,this.styles=d,this.store=Wn(r,this.props,c),this.template=p,this.handlers=e,this.refs=h,this.patch=s,this.deps={...n,store:this.store,render:this.render,handlers:e,attrs:c,props:this.props},this.h=i,this.cssText=jn(a,d)}}return m},Tt=Bn;function ie(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 he=Array.isArray;function ue(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function zn(e,t){return document.createElement(e,t)}function Kn(e,t,r){return document.createElementNS(e,t,r)}function Fn(){return ne(document.createDocumentFragment())}function Hn(e){return document.createTextNode(e)}function Un(e){return document.createComment(e)}function qn(e,t,r){if(Z(e)){let s=e;for(;s&&Z(s);)s=ne(s).parent;e=s??e}Z(t)&&(t=ne(t,e)),r&&Z(r)&&(r=ne(r).firstChildNode),e.insertBefore(t,r)}function Jn(e,t){e.removeChild(t)}function Gn(e,t){Z(t)&&(t=ne(t,e)),e.appendChild(t)}function jr(e){if(Z(e)){for(;e&&Z(e);)e=ne(e).parent;return e??null}return e.parentNode}function Yn(e){var t;if(Z(e)){let r=ne(e),s=jr(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 Xn(e){return e.tagName}function Qn(e,t){e.textContent=t}function Zn(e){return e.textContent}function ea(e){return e.nodeType===1}function ta(e){return e.nodeType===3}function ra(e){return e.nodeType===8}function Z(e){return e.nodeType===11}function ne(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:zn,createElementNS:Kn,createTextNode:Hn,createDocumentFragment:Fn,createComment:Un,insertBefore:qn,removeChild:Jn,appendChild:Gn,parentNode:jr,nextSibling:Yn,tagName:Xn,setTextContent:Qn,getTextContent:Zn,isElement:ea,isText:ta,isComment:ra,isDocumentFragment:Z};function Ve(e){return e===void 0}function z(e){return e!==void 0}var Ot=ie("",{},[],void 0,void 0);function ve(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 sa(){throw new Error("The document fragment is not supported on this platform.")}function ia(e,t){return e.isElement(t)}function na(e,t){return e.isDocumentFragment(t)}function aa(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 oa=["create","update","remove","destroy","pre","post"];function Dr(e,t,r){let s={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=t!==void 0?t:Rr;for(let c of oa)for(let u of e){let f=u[c];f!==void 0&&s[c].push(f)}function n(c){let u=c.id?"#"+c.id:"",f=c.getAttribute("class"),y=f?"."+f.split(" ").join("."):"";return ie(i.tagName(c).toLowerCase()+u+y,{},[],void 0,c)}function a(c){return ie(void 0,{},[],void 0,c)}function o(c,u){return function(){if(--u===0){let y=i.parentNode(c);y!==null&&i.removeChild(y,c)}}}function l(c,u){var f,y,b,w;let x,k=c.data;if(k!==void 0){let E=(f=k.hook)===null||f===void 0?void 0:f.init;z(E)&&(E(c),k=c.data)}let _=c.children,$=c.sel;if($==="!")Ve(c.text)&&(c.text=""),c.elm=i.createComment(c.text);else if($==="")c.elm=i.createTextNode(c.text);else if($!==void 0){let E=$.indexOf("#"),T=$.indexOf(".",E),L=E>0?E:$.length,A=T>0?T:$.length,S=E!==-1||T!==-1?$.slice(0,Math.min(L,A)):$,V=c.elm=z(k)&&z(x=k.ns)?i.createElementNS(x,S,k):i.createElement(S,k);for(L<A&&V.setAttribute("id",$.slice(L+1,A)),T>0&&V.setAttribute("class",$.slice(A+1).replace(/\./g," ")),x=0;x<s.create.length;++x)s.create[x](Ot,c);if(ue(c.text)&&(!he(_)||_.length===0)&&i.appendChild(V,i.createTextNode(c.text)),he(_))for(x=0;x<_.length;++x){let D=_[x];D!=null&&i.appendChild(V,l(D,u))}let j=c.data.hook;z(j)&&((y=j.create)===null||y===void 0||y.call(j,Ot,c),j.insert&&u.push(c))}else if(!((b=r?.experimental)===null||b===void 0)&&b.fragments&&c.children){for(c.elm=((w=i.createDocumentFragment)!==null&&w!==void 0?w:sa)(),x=0;x<s.create.length;++x)s.create[x](Ot,c);for(x=0;x<c.children.length;++x){let E=c.children[x];E!=null&&i.appendChild(c.elm,l(E,u))}}else c.elm=i.createTextNode(c.text);return c.elm}function p(c,u,f,y,b,w){for(;y<=b;++y){let x=f[y];x!=null&&i.insertBefore(c,l(x,w),u)}}function h(c){var u,f;let y=c.data;if(y!==void 0){(f=(u=y?.hook)===null||u===void 0?void 0:u.destroy)===null||f===void 0||f.call(u,c);for(let b=0;b<s.destroy.length;++b)s.destroy[b](c);if(c.children!==void 0)for(let b=0;b<c.children.length;++b){let w=c.children[b];w!=null&&typeof w!="string"&&h(w)}}}function d(c,u,f,y){for(var b,w;f<=y;++f){let x,k,_=u[f];if(_!=null)if(z(_.sel)){h(_),x=s.remove.length+1,k=o(_.elm,x);for(let E=0;E<s.remove.length;++E)s.remove[E](_,k);let $=(w=(b=_?.data)===null||b===void 0?void 0:b.hook)===null||w===void 0?void 0:w.remove;z($)?$(_,k):k()}else _.children?(h(_),d(c,_.children,0,_.children.length-1)):i.removeChild(c,_.elm)}}function m(c,u,f,y){let b=0,w=0,x=u.length-1,k=u[0],_=u[x],$=f.length-1,E=f[0],T=f[$],L,A,S,V;for(;b<=x&&w<=$;)k==null?k=u[++b]:_==null?_=u[--x]:E==null?E=f[++w]:T==null?T=f[--$]:ve(k,E)?(v(k,E,y),k=u[++b],E=f[++w]):ve(_,T)?(v(_,T,y),_=u[--x],T=f[--$]):ve(k,T)?(v(k,T,y),i.insertBefore(c,k.elm,i.nextSibling(_.elm)),k=u[++b],T=f[--$]):ve(_,E)?(v(_,E,y),i.insertBefore(c,_.elm,k.elm),_=u[--x],E=f[++w]):(L===void 0&&(L=aa(u,b,x)),A=L[E.key],Ve(A)?(i.insertBefore(c,l(E,y),k.elm),E=f[++w]):Ve(L[T.key])?(i.insertBefore(c,l(T,y),i.nextSibling(_.elm)),T=f[--$]):(S=u[A],S.sel!==E.sel?i.insertBefore(c,l(E,y),k.elm):(v(S,E,y),u[A]=void 0,i.insertBefore(c,S.elm,k.elm)),E=f[++w]));w<=$&&(V=f[$+1]==null?null:f[$+1].elm,p(c,V,f,w,$,y)),b<=x&&d(c,u,b,x)}function v(c,u,f){var y,b,w,x,k,_,$,E;let T=(y=u.data)===null||y===void 0?void 0:y.hook;(b=T?.prepatch)===null||b===void 0||b.call(T,c,u);let L=u.elm=c.elm;if(c===u)return;if(u.data!==void 0||z(u.text)&&u.text!==c.text){(w=u.data)!==null&&w!==void 0||(u.data={}),(x=c.data)!==null&&x!==void 0||(c.data={});for(let V=0;V<s.update.length;++V)s.update[V](c,u);($=(_=(k=u.data)===null||k===void 0?void 0:k.hook)===null||_===void 0?void 0:_.update)===null||$===void 0||$.call(_,c,u)}let A=c.children,S=u.children;Ve(u.text)?z(A)&&z(S)?A!==S&&m(L,A,S,f):z(S)?(z(c.text)&&i.setTextContent(L,""),p(L,null,S,0,S.length-1,f)):z(A)?d(L,A,0,A.length-1):z(c.text)&&i.setTextContent(L,""):c.text!==u.text&&(z(A)&&d(L,A,0,A.length-1),i.setTextContent(L,u.text)),(E=T?.postpatch)===null||E===void 0||E.call(T,c,u)}return function(u,f){let y,b,w,x=[];for(y=0;y<s.pre.length;++y)s.pre[y]();for(ia(i,u)?u=n(u):na(i,u)&&(u=a(u)),ve(u,f)?v(u,f,x):(b=u.elm,w=i.parentNode(b),l(f,x),w!==null&&(i.insertBefore(w,f.elm,i.nextSibling(b)),d(w,[u],0,0))),y=0;y<x.length;++y)x[y].data.hook.insert(x[y]);for(y=0;y<s.post.length;++y)s.post[y]();return f}}function Mr(e,t){let r,s,i=t.elm,n=e.data.class,a=t.data.class;if(!(!n&&!a)&&n!==a){n=n||{},a=a||{};for(s in n)n[s]&&!Object.prototype.hasOwnProperty.call(a,s)&&i.classList.remove(s);for(s in a)r=a[s],r!==n[s]&&i.classList[r?"add":"remove"](s)}}var Wr={create:Mr,update:Mr};function Br(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 zr={create:Br,update:Br};var la="http://www.w3.org/1999/xlink",pa="http://www.w3.org/2000/xmlns/",ca="http://www.w3.org/XML/1998/namespace";function Kr(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(ca,r,a):r.charCodeAt(5)===58?r.charCodeAt(1)===109?s.setAttributeNS(pa,r,a):s.setAttributeNS(la,r,a):s.setAttribute(r,a))}for(r in i)r in n||s.removeAttribute(r)}}var Fr={create:Kr,update:Kr};var Hr=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,da=function(e){Hr(function(){Hr(e)})},Lt=!1;function ha(e,t,r){da(function(){e[t]=r})}function Ur(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])&&ha(i.style,l,r);else s!=="remove"&&r!==n[s]&&(s[0]==="-"&&s[1]==="-"?i.style.setProperty(s,r):i.style[s]=r)}function ua(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 fa(e,t){let r=e.data.style;if(!r||!r.remove){t();return}Lt||(e.elm.offsetLeft,Lt=!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 h=getComputedStyle(i)["transition-property"].split(", ");for(;n<h.length;++n)l.indexOf(h[n])!==-1&&o++;i.addEventListener("transitionend",function(d){d.target===i&&--o,o===0&&t()})}function ma(){Lt=!1}var qr={pre:ma,create:Ur,update:Ur,destroy:ua,remove:fa};function Jr(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++)Jr(e[s],t,r)}function ya(e,t){let r=e.type,s=t.data.on;s&&s[r]&&Jr(s[r],t,e)}function ga(){return function e(t){ya(t,e.vnode)}}function Vt(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||ga();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 Gr={create:Vt,update:Vt,destroy:Vt};var va=()=>Dr([Wr,zr,Fr,qr,Gr]),Nt=va;function Yr(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&&Yr(n,i.children,i.sel)}}function Pt(e,t,r){let s={},i,n,a;if(r!==void 0?(t!==null&&(s=t),he(r)?i=r:ue(r)?n=r.toString():r&&r.sel&&(i=[r])):t!=null&&(he(t)?i=t:ue(t)?n=t.toString():t&&t.sel?i=[t]:s=t),i!==void 0)for(a=0;a<i.length;++a)ue(i[a])&&(i[a]=ie(void 0,void 0,void 0,i[a],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&Yr(s,i,e),ie(e,s,i,n,void 0)}var ba={},Xr={components:ba},Qr=Nt();var Ne={components:{breadcrumb:{handlers:Je,store:Ge,view:er},dropdownMenu:{handlers:Ye,store:Xe,view:tr},form:{handlers:Qe,store:Ze,view:sr},navbar:{handlers:et,store:tt,view:ir},pageOutline:{handlers:rt,store:st,view:ar},popoverInput:{handlers:it,store:nt,view:or},select:{handlers:at,store:ot,view:lr},sidebar:{handlers:lt,store:ct,view:pr},sliderInput:{handlers:dt,store:ht,view:cr},table:{handlers:ut,store:ft,view:dr},tabs:{handlers:mt,store:yt,view:hr},waveform:{handlers:gt,store:vt,view:fr}}};Object.keys(Ne).forEach(e=>{Object.keys(Ne[e]).forEach(t=>{let r=Tt({...Ne[e][t],patch:Qr,h:Pt},Xr[e]);customElements.define(Ne[e][t].view.elementName,r)})});customElements.define("rtgl-button",Mt({}));customElements.define("rtgl-view",zt({}));customElements.define("rtgl-text",Ft({}));customElements.define("rtgl-image",Ht({}));customElements.define("rtgl-svg",qt({}));customElements.define("rtgl-input",Jt({}));customElements.define("rtgl-textarea",Gt({}));customElements.define("rtgl-color-picker",Yt({}));customElements.define("rtgl-slider",Xt({}));customElements.define("rtgl-dialog",Qt({}));customElements.define("rtgl-popover",Zt({}));})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rettangoli/ui",
3
- "version": "0.1.2-rc18",
3
+ "version": "0.1.2-rc19",
4
4
  "description": "A UI component library for building web interfaces.",
5
5
  "main": "dist/rettangoli-esm.min.js",
6
6
  "type": "module",
@@ -2,29 +2,70 @@ export const INITIAL_STATE = Object.freeze({
2
2
  formValues: {}
3
3
  });
4
4
 
5
+ // Lodash-like utility functions for nested property access
6
+ const get = (obj, path, defaultValue = undefined) => {
7
+ const keys = path.split(/[\[\].]/).filter(key => key !== '');
8
+ let current = obj;
9
+
10
+ for (const key of keys) {
11
+ if (current === null || current === undefined || !(key in current)) {
12
+ return defaultValue;
13
+ }
14
+ current = current[key];
15
+ }
16
+
17
+ return current;
18
+ }
19
+
20
+ const set = (obj, path, value) => {
21
+ const keys = path.split(/[\[\].]/).filter(key => key !== '');
22
+
23
+ // If path contains array notation, delete the original flat key
24
+ if (path.includes('[') && path in obj) {
25
+ delete obj[path];
26
+ }
27
+
28
+ let current = obj;
29
+
30
+ for (let i = 0; i < keys.length - 1; i++) {
31
+ const key = keys[i];
32
+ if (!(key in current) || typeof current[key] !== 'object' || current[key] === null) {
33
+ // Check if next key is a number to create array
34
+ const nextKey = keys[i + 1];
35
+ const isArrayIndex = /^\d+$/.test(nextKey);
36
+ current[key] = isArrayIndex ? [] : {};
37
+ }
38
+ current = current[key];
39
+ }
40
+
41
+ current[keys[keys.length - 1]] = value;
42
+ return obj;
43
+ }
44
+
5
45
  const blacklistedAttrs = ['id', 'class', 'style', 'slot'];
6
46
 
7
47
  const stringifyAttrs = (attrs) => {
8
48
  return Object.entries(attrs).filter(([key]) => !blacklistedAttrs.includes(key)).map(([key, value]) => `${key}=${value}`).join(' ');
9
49
  }
10
50
 
51
+
11
52
  export const toViewData = ({ state, props, attrs }) => {
12
53
  const containerAttrString = stringifyAttrs(attrs);
13
54
  const fields = structuredClone(props.form.fields || []);
14
55
  const defaultValues = props.defaultValues || {};
15
- const fieldResources = props.fieldResources || {};
16
56
 
17
57
  fields.forEach((field) => {
18
- field.defaultValue = defaultValues[field.name];
58
+ field.defaultValue = get(defaultValues, field.name);
59
+
19
60
  if (field.inputType === 'image') {
20
- const src = fieldResources[field.name]?.src;
61
+ const src = field.src;
21
62
  // Only set imageSrc if src exists and is not empty
22
63
  field.imageSrc = src && src.trim() ? src : null;
23
64
  // Set placeholder text
24
65
  field.placeholderText = field.placeholder || 'No Image';
25
66
  }
26
67
  if (field.inputType === 'waveform') {
27
- const waveformData = fieldResources[field.name]?.waveformData;
68
+ const waveformData = field.waveformData;
28
69
  // Only set waveformData if it exists
29
70
  field.waveformData = waveformData || null;
30
71
  // Set placeholder text
@@ -41,7 +82,6 @@ export const toViewData = ({ state, props, attrs }) => {
41
82
  buttons: []
42
83
  },
43
84
  formValues: state.formValues,
44
- fieldResources: fieldResources,
45
85
  };
46
86
  }
47
87
 
@@ -53,10 +93,15 @@ export const selectFormValues = ({ state }) => {
53
93
  return state.formValues;
54
94
  }
55
95
 
96
+ export const getFormFieldValue = ({ state }, name) => {
97
+ return get(state.formValues, name);
98
+ }
99
+
56
100
  export const setFormValues = (state, defaultValues) => {
57
101
  state.formValues = defaultValues || {};
58
102
  }
59
103
 
60
104
  export const setFormFieldValue = (state, { name, value }) => {
61
- state.formValues[name] = value;
105
+ set(state.formValues, name, value);
62
106
  }
107
+
@@ -169,6 +169,10 @@ propsSchema:
169
169
  type: number
170
170
  placeholder:
171
171
  type: string
172
+ defaultValue:
173
+ type: object
174
+ waveformData:
175
+ type: object
172
176
  required:
173
177
  - name
174
178
  - label
@@ -189,8 +193,6 @@ propsSchema:
189
193
  required:
190
194
  - id
191
195
  - content
192
- fieldResources:
193
- type: object
194
196
 
195
197
  refs:
196
198
  action-*:
@@ -272,7 +274,7 @@ template:
272
274
  - rtgl-waveform#waveform-${field.name} .waveformData=fields[${i}].waveformData w=${field.width} h=${field.height} cur=p:
273
275
  - $if field.inputType == "waveform" && !field.waveformData:
274
276
  - rtgl-view#waveform-${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=p p=md:
275
- - rtgl-text c=mu-fg ta=c: ${field.placeholderText}
277
+ - rtgl-text c=mu-fg ta=c: ${field.placeholder}
276
278
  - rtgl-view g=sm w=f:
277
279
  - rtgl-view d=h ah=e g=sm w=f:
278
280
  - $for button, i in actions.buttons:
@@ -14,6 +14,12 @@ export const handleAfterMount = async (deps) => {
14
14
  export const handleOnUpdate = async (changes, deps) => {
15
15
  const { store, render, getRefIds, props } = deps;
16
16
  const { waveformData } = props;
17
+
18
+ if (!waveformData) {
19
+ console.log('waveform handleOnUpdate: no waveformData provided');
20
+ return;
21
+ }
22
+
17
23
  store.setWaveformData(waveformData);
18
24
  render();
19
25