@rettangoli/ui 1.7.5 → 1.7.6
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.
|
@@ -1505,7 +1505,7 @@ var rettangoli=(()=>{var _e=`
|
|
|
1505
1505
|
slot[name="content"] {
|
|
1506
1506
|
display: contents;
|
|
1507
1507
|
}
|
|
1508
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let s=t.composedPath();(s[0]===this._dialogElement||s[0].nodeName==="DIALOG"&&s[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let s=t.composedPath();(s[0]===this._dialogElement||s[0].nodeName==="DIALOG"&&s[0]===this._dialogElement)&&(t.preventDefault(),this._emitClose())}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._emitClose()}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._contentWrapper=null,this._isOpen=!1,this._positionFrameId=null,this._revealFrameId=null,this._positionVersion=0,this._isObservingResize=!1,this._observedContentWrapper=null,this._resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>{this._isOpen&&this._schedulePositionUpdate()}):null}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y","place","no-overlay","content-w","content-h","content-wh","content-g","content-sv","content-ph","content-pv","content-bgc","content-style"]}connectedCallback(){this._syncContentWrapper({reposition:!1}),this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._cancelScheduledPositionUpdate(),this._stopResizeObserver(),this._isOpen&&this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,s,r){t==="open"?r!==null&&!this._isOpen?this.isConnected&&this._show():r===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="place")&&this._isOpen?this._schedulePositionUpdate():t==="no-overlay"&&s!==r&&this._isOpen?(this._hide(),this._show()):t.startsWith("content-")&&this._syncContentWrapper()}_isIgnorableTextNode(t){return t?.nodeType===Node.TEXT_NODE&&t.textContent?.trim()===""}_ensureContentWrapper(){if(this._contentWrapper?.parentNode===this)return this._contentWrapper;let t=Array.from(this.children).find(s=>s.hasAttribute(Or));return t?this._contentWrapper=t:(this._contentWrapper=document.createElement("rtgl-view"),this._contentWrapper.setAttribute(Or,""),this._contentWrapper.setAttribute("part","content"),this._contentWrapper.setAttribute("bgc","su"),this._contentWrapper.setAttribute("bw","xs"),this._contentWrapper.setAttribute("bc","bo"),this._contentWrapper.setAttribute("br","md"),this._contentWrapper.setAttribute("ph","sm"),this._contentWrapper.setAttribute("pv","sm"),this._contentWrapper.setAttribute("style",os)),this._contentWrapper.parentNode!==this&&this.appendChild(this._contentWrapper),this._contentWrapper}_syncContentWrapperAttributes(){let t=this._ensureContentWrapper(),s=[["content-w","w"],["content-h","h"],["content-wh","wh"],["content-g","g"],["content-sv","sv"]];for(let[i,n]of s){let o=this.getAttribute(i);o===null?t.removeAttribute(n):t.setAttribute(n,o)}t.setAttribute("bgc",this.getAttribute("content-bgc")||"su"),t.setAttribute("ph",this.getAttribute("content-ph")||"sm"),t.setAttribute("pv",this.getAttribute("content-pv")||"sm");let r=this.getAttribute("content-style");t.setAttribute("style",r?`${os} ${r}`:os)}_syncContentWrapper({reposition:t=!0}={}){let s=this._ensureContentWrapper(),r=Array.from(this.childNodes).filter(n=>n!==s&&!this._isIgnorableTextNode(n));for(let n of r)n.nodeType===Node.ELEMENT_NODE&&n.getAttribute("slot")==="content"&&n.removeAttribute("slot"),s.appendChild(n);this._syncContentWrapperAttributes(),Array.from(s.childNodes).some(n=>!this._isIgnorableTextNode(n))||this.hasAttribute("open")?s.setAttribute("slot","content"):s.removeAttribute("slot"),t&&this._isOpen&&this._schedulePositionUpdate()}_show(){this._isOpen||(this._syncContentWrapper({reposition:!1}),this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._startResizeObserver(),this._dialogElement.open?this._schedulePositionUpdate():setTimeout(()=>{this._dialogElement&&!this._dialogElement.open&&(this.hasAttribute("no-overlay")?this._dialogElement.show():this._dialogElement.showModal()),this._schedulePositionUpdate()},0))}_hide(){this._isOpen&&(this._isOpen=!1,this._cancelScheduledPositionUpdate(),this._stopResizeObserver(),this._dialogElement.open&&this._dialogElement.close(),this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_startResizeObserver(){this._resizeObserver&&(this._isObservingResize||(this._resizeObserver.observe(this._popoverContainer),this._isObservingResize=!0),this._contentWrapper&&this._observedContentWrapper!==this._contentWrapper&&(this._observedContentWrapper&&this._resizeObserver.unobserve(this._observedContentWrapper),this._resizeObserver.observe(this._contentWrapper),this._observedContentWrapper=this._contentWrapper))}_stopResizeObserver(){this._resizeObserver?.disconnect(),this._isObservingResize=!1,this._observedContentWrapper=null}_cancelScheduledPositionUpdate(){this._positionFrameId!==null&&(cancelAnimationFrame(this._positionFrameId),this._positionFrameId=null),this._revealFrameId!==null&&(cancelAnimationFrame(this._revealFrameId),this._revealFrameId=null),this._positionVersion+=1,this.removeAttribute("positioned")}_readCoordinateAttr(t){let s=parseFloat(this.getAttribute(t)||"0");return Number.isFinite(s)?s:0}_schedulePositionUpdate(){this._isOpen&&(this.removeAttribute("positioned"),this._positionVersion+=1,this._positionFrameId===null&&(this._positionFrameId=requestAnimationFrame(()=>{if(this._positionFrameId=null,!this._isOpen)return;if(!this._dialogElement.open){this._schedulePositionUpdate();return}this._syncContentWrapper({reposition:!1}),this._startResizeObserver();let t=this._readCoordinateAttr("x"),s=this._readCoordinateAttr("y"),r=this.getAttribute("place")||"bs",i=this._popoverContainer.getBoundingClientRect(),{left:n,top:o}=this._calculatePosition(t,s,i.width,i.height,r);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${o}px`;let l=this._positionVersion;this._revealFrameId=requestAnimationFrame(()=>{this._revealFrameId=null,this._isOpen&&this._positionVersion===l&&this.setAttribute("positioned","")})})))}_calculatePosition(t,s,r,i,n){return Ir({x:t,y:s,width:r,height:i,place:n,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight})}get popover(){return this._popoverContainer}get content(){return this._contentWrapper}refreshContent(){this._syncContentWrapper()}},Tr=({render:e,html:t})=>as;var yo=(e,t)=>{let{store:s,render:r}=e;s.toggleOpen({}),r()},mo=Object.freeze(Object.defineProperty({__proto__:null,handleClickHeader:yo},Symbol.toStringTag,{value:"Module"})),go=()=>Object.freeze({open:!1}),bo=["id","class","style","slot","label","content"],vo=(e={})=>Object.entries(e).filter(([t])=>!bo.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),wo=({state:e,props:t})=>({label:t.label||"",content:t.content||"",openClass:e.open?"content-wrapper open":"content-wrapper",chevronIcon:e.open?"chevronUp":"chevronDown",containerAttrString:vo(t)}),_o=({state:e})=>{e.open=!e.open},xo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:go,selectViewData:wo,toggleOpen:_o},Symbol.toStringTag,{value:"Module"})),So=(e,t)=>{let{dispatchEvent:s,props:r}=e,i=t._event,n=Number(i.currentTarget.dataset.index),o=Array.isArray(r.items)?r.items[n]:void 0;if(o){if(o.disabled||o.current){i.preventDefault();return}typeof o.href=="string"&&o.href.length>0||i.preventDefault(),s(new CustomEvent("item-click",{detail:{id:o.id,path:o.path,href:o.href,item:o,index:n,trigger:i.type}}))}},Ao=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:So},Symbol.toStringTag,{value:"Module"})),ko=()=>Object.freeze({}),Eo=["id","class","style","slot","items","sep","max","separator"],$o=(e={})=>Object.entries(e).filter(([t])=>!Eo.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Co=e=>{if(e==null||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t},Io=e=>`${e}`.replace(/"/g,"""),Oo=(e,t)=>{if(!t||t<3||e.length<=t)return e;let s=t-2;return[e[0],{isEllipsis:!0,label:"..."},...e.slice(-s)]},To=e=>e.map((t,s)=>{let r=typeof t.href=="string"&&t.href.length>0,i=t.path!==void 0&&t.path!==null&&`${t.path}`!="",n=!!t.current,o=!!t.disabled,l=!n&&!o&&(r||i||!!t.click),p=t.rel||(t.newTab?"noopener noreferrer":""),a=[t.newTab?'target="_blank"':"",p?`rel="${Io(p)}"`:""].filter(Boolean).join(" ");return{...t,label:t.label||"",index:s,href:r?t.href:void 0,path:i?t.path:void 0,isCurrent:n,isDisabled:o,isInteractive:l,linkExtraAttrs:a,c:n?"fg":"mu-fg"}}),Lo=({props:e})=>{let t=$o(e),s=Array.isArray(e.items)?e.items:[],r=Co(e.max),i=e.sep||"breadcrumb-arrow",n=To(s),o=Oo(n,r),l=[];return o.forEach((p,a)=>{l.push(p),a<o.length-1&&l.push({isSeparator:!0})}),{containerAttrString:t,items:l,sep:i}},Vo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:ko,selectViewData:Lo},Symbol.toStringTag,{value:"Module"})),No=["id","class","style","slot","head","desc","size","d","ah","av","wrap","noWrap","g","gh","gv","p","pt","pr","pb","pl","pv","ph","bw","bwt","bwr","bwb","bwl","bc","br","shadow","bgc","href","newTab","rel","cur","sv","sh","overflow"],Lr={sm:{cardAttrString:"p=md sm-p=sm g=md sm-g=sm",headerAttrString:"g=xs",headingSize:"lg",subheadingSize:"sm"},md:{cardAttrString:"p=lg md-p=md sm-p=md g=lg md-g=md sm-g=md",headerAttrString:"g=sm",headingSize:"h4",subheadingSize:"sm"},lg:{cardAttrString:"p=xl lg-p=lg md-p=md sm-p=md g=lg md-g=md sm-g=md",headerAttrString:"g=sm",headingSize:"h3",subheadingSize:"md"}},Ro=(e={})=>Object.entries(e).filter(([t])=>!No.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),jo=()=>Object.freeze({}),Do=({props:e={}})=>{let t=Lr[e.size]?e.size:"md",s=Lr[t];return{containerAttrString:Ro(e),cardAttrString:s.cardAttrString,headerAttrString:s.headerAttrString,headingSize:s.headingSize,subheadingSize:s.subheadingSize,head:e.head||"",desc:e.desc||"",hasHeader:!!(e.head||e.desc),size:t}},Po=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:jo,selectViewData:Do},Symbol.toStringTag,{value:"Module"})),Bo=(e={})=>e.type==="section"||e.type==="label"?"section":e.type==="separator"?"separator":"item",zo=(e,t)=>{let{dispatchEvent:s}=e;s(new CustomEvent("close"))},Wo=(e,t)=>{let{dispatchEvent:s,props:r}=e,i=t._event,n=Number(i.currentTarget.dataset.index??i.currentTarget.id.slice(6)),o=r.items[n],l=Bo(o);if(!o||l!=="item"||o.disabled){i.preventDefault();return}o.href||i.preventDefault(),s(new CustomEvent("item-click",{detail:{index:n,item:o,id:o.id,path:o.path,href:o.href,trigger:i.type}}))},Mo=Object.freeze(Object.defineProperty({__proto__:null,handleClickMenuItem:Wo,handleClosePopover:zo},Symbol.toStringTag,{value:"Module"})),Fo=()=>Object.freeze({}),Ko=e=>`${e}`.replace(/"/g,"""),Uo=(e={})=>e.type==="section"||e.type==="label"?"section":e.type==="separator"?"separator":"item",Ho=e=>e.map((t,s)=>{let r=Uo(t),i=r==="separator",n=r==="section",o=r==="item",l=!!t.disabled,p=o&&!l,a=Object.prototype.hasOwnProperty.call(t,"icon"),c=typeof t.icon=="string"&&t.icon.length>0?t.icon:"",d=typeof t.shortcut=="string"&&t.shortcut.length>0?t.shortcut:typeof t.suffixText=="string"&&t.suffixText.length>0?t.suffixText:"",h=l?"mu-fg":"fg",f=l?"mu":"",u=l?"":"ac",y=h,m="mu-fg",b=typeof t.href=="string"&&t.href.length>0,g=t.rel||(t.newTab?"noopener noreferrer":""),_=[t.newTab?'target="_blank"':"",g?`rel="${Ko(g)}"`:""].filter(Boolean).join(" ");return{...t,index:s,type:r,isSeparator:i,isSection:n,isItem:o,isDisabled:l,isInteractive:p,hasIconSlot:a,icon:c,hasIcon:c.length>0,suffixText:d,hasSuffixText:d.length>0,hasHref:b,linkExtraAttrs:_,c:h,bgc:f,hoverBgc:u,iconColor:y,suffixTextColor:m}}),qo=({props:e})=>{let t=Array.isArray(e.items)?e.items:[];return{items:Ho(t),open:!!e.open,x:e.x||0,y:e.y||0,w:e.w||"300",h:e.h||"300",place:e.place||"bs"}},Yo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Fo,selectViewData:qo},Symbol.toStringTag,{value:"Module"})),w={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9,PARTIAL:10,PATH_REFERENCE:11},D={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},ms={NOT:0},$=class extends Error{constructor(e){super(`Parse Error: ${e}`),this.name="JemplParseError"}},de=class extends Error{constructor(e){super(`Render Error: ${e}`),this.name="JemplRenderError"}},Vr=e=>{if(!e||e.trim()==="")throw new $("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let s=e.includes("===")?"==":"!=";throw new $(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${s}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let s of t)if(e.trim().endsWith(s))throw new $(`Incomplete comparison expression - missing right operand (got: '${e}')`)},Go=e=>{if(e.trim().endsWith(" in"))throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new $(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,s]=e.split(" in ");if(!s||s.trim()==="")throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);let r=t.includes(",")?t.split(",").map(i=>i.trim()):[t.trim()];for(let i of r){if(!i)throw new $(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(i))throw new $(`Invalid loop syntax (got: '$for ${e}')`)}},Jo=(e,t,s=!1)=>{if(t===null)return new de(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new de(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return s?new de(`Cannot iterate over non-array value in loop '${e}' - got ${r} instead`):new de(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},Zo=(e,t)=>{let s=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new de(`Unknown function '${e}' (${s})`)},Xo=(e,t,s={})=>{let r={},i={};s&&typeof s=="object"&&(s.functions!==void 0||s.partials!==void 0?(r=s.functions||{},i=s.partials||{}):typeof s=="object"&&(r=s));let n=N(e,{functions:r,partials:i},t,{});return n===void 0?{}:n},N=(e,t,s,r)=>{if(t.functions,e.var&&!e.type)return K(e.var,s,r);if(e.type===w.LITERAL)return e.value;if(e.type===w.VARIABLE)return K(e.path,s,r);if(e.type===w.INTERPOLATION)return ea(e.parts,t,s,r);switch(e.type){case w.FUNCTION:return yi(e,t,s,r);case w.BINARY:return mi(e,t,s,r);case w.UNARY:return gi(e,t,s,r);case w.CONDITIONAL:return sa(e,t,s,r);case w.LOOP:return aa(e,t,s,r);case w.OBJECT:return pa(e,t,s,r);case w.ARRAY:return da(e,t,s,r);case w.PARTIAL:return ca(e,t,s,r);case w.PATH_REFERENCE:return ua(e,t,s,r);default:throw new Error(`Unknown node type: ${e.type}`)}},Nr=new Map,Qo=e=>{let t=[],s="",r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(n==="[")s&&(t.push({type:"property",value:s}),s=""),r=!0;else if(n==="]"){if(r&&s){let o=s.trim();if(/^\d+$/.test(o))t.push({type:"index",value:parseInt(o,10)});else if(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'")){let l=o.slice(1,-1);t.push({type:"property",value:l})}else t.push({type:"property",value:o});s=""}r=!1}else s+=n}return s&&t.push({type:"property",value:s}),t},K=(e,t,s)=>{if(!e)return;if(e in s)return s[e];let r=Nr.get(e);if(!r){let n=[],o="",l=0;for(let p=0;p<e.length;p++){let a=e[p];a==="["?(l++,o+=a):a==="]"?(l--,o+=a):a==="."&&l===0?o&&(n.push(o),o=""):o+=a}o&&n.push(o),r=[];for(let p of n){let a=Qo(p.trim());r.push(...a)}Nr.set(e,r)}let i=t;for(let n=0;n<r.length;n++){let o=r[n];if(o.type==="property"&&o.value in s){i=s[o.value];continue}if(i==null)return;(o.type==="property"||o.type==="index")&&(i=i[o.value])}return i},ea=(e,t,s,r)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let o=N(n,t,s,r);i.push(o!=null?String(o):"")}return i.join("")},yi=(e,t,s,r)=>{let i=t.functions||t,n=i[e.name];if(!n)throw Zo(e.name,i);let o=e.args.map(l=>N(l,t,s,r));return n(...o)},De=(e,t,s,r)=>{if(e.var&&!e.type)return K(e.var,s,r);switch(e.type){case w.VARIABLE:return K(e.path,s,r);case w.LITERAL:return e.value;case w.BINARY:return mi(e,t,s,r);case w.UNARY:return gi(e,t,s,r);case w.FUNCTION:return yi(e,t,s,r);default:return N(e,t,s,r)}},mi=(e,t,s,r)=>{if(e.op===D.AND||e.op===D.OR){let o=De(e.left,t,s,r),l=De(e.right,t,s,r);switch(e.op){case D.AND:return o&&l;case D.OR:return o||l}}let i=N(e.left,t,s,r),n=N(e.right,t,s,r);switch(e.op){case D.EQ:return i==n;case D.NEQ:return i!=n;case D.GT:return i>n;case D.LT:return i<n;case D.GTE:return i>=n;case D.LTE:return i<=n;case D.IN:return Array.isArray(n)?n.includes(i):!1;case D.ADD:if(typeof i!="number"||typeof n!="number")throw new de(`Arithmetic operations require numbers. Got ${typeof i} + ${typeof n}`);return i+n;case D.SUBTRACT:if(typeof i!="number"||typeof n!="number")throw new de(`Arithmetic operations require numbers. Got ${typeof i} - ${typeof n}`);return i-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},gi=(e,t,s,r)=>{let i=e.op===ms.NOT?De(e.operand,t,s,r):N(e.operand,t,s,r);switch(e.op){case ms.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},ta=(e,t,s,r)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===w.VARIABLE)if(K(i.path,s,r)){let n=e.bodies[0];if(n.type===w.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?N(l.parsedKey,t,s,r):l.key,a=l.value;if(a.type===w.LITERAL)o[p]=a.value;else if(a.type===w.VARIABLE)o[p]=K(a.path,s,r);else if(a.type===w.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let h=K(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=N(d,t,s,r);c.push(h!=null?String(h):"")}o[p]=c.join("")}else o[p]=N(a,t,s,r)}return o}}else{let n=e.bodies[1];if(n.type===w.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?N(l.parsedKey,t,s,r):l.key,a=l.value;if(a.type===w.LITERAL)o[p]=a.value;else if(a.type===w.VARIABLE)o[p]=K(a.path,s,r);else if(a.type===w.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let h=K(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=N(d,t,s,r);c.push(h!=null?String(h):"")}o[p]=c.join("")}else o[p]=N(a,t,s,r)}return o}}}return null},sa=(e,t,s,r)=>{let i=ta(e,t,s,r);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||De(o,t,s,r))return N(e.bodies[n],t,s,r)}return bi},ra=(e,t)=>{let s=e.body,r=e.itemVar;if(s.type===w.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===w.VARIABLE){let i=s.conditions[0].path,n=s.bodies[0];if(i.startsWith(r+".")){let o=i.substring(r.length+1);if(n.type===w.OBJECT&&n.properties.length<=5){for(let p of n.properties)if(p.parsedKey)return null;let l=[];for(let p=0;p<t.length;p++){let a=t[p];if(a[o]){let c={};for(let d of n.properties){let h=d.key,f=d.value;if(f.type===w.LITERAL)c[h]=f.value;else if(f.type===w.VARIABLE){let u=f.path;if(u===r)c[h]=a;else if(u.startsWith(r+".")){let y=u.substring(r.length+1);c[h]=a[y]}else return null}else if(f.type===w.INTERPOLATION){let u=[],y=!0;for(let m of f.parts)if(typeof m=="string")u.push(m);else if(m.type===w.VARIABLE){let b=m.path;if(b===r)u.push(a!=null?String(a):"");else if(b.startsWith(r+".")){let g=b.substring(r.length+1),_=a[g];u.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[h]=u.join("")}else return null}l.push(c)}}return l}}}return null},ia=(e,t)=>{let s=e.body,r=e.itemVar,i=ra(e,t);if(i!==null)return i;if(s.type===w.OBJECT&&s.properties.length<=5&&!s.whenCondition){for(let l of s.properties)if(l.parsedKey)return null;let n=[],o=!0;for(let l of s.properties){let p=l.key,a=l.value;if(a.type===w.LITERAL)n.push({key:p,type:"literal",value:a.value});else if(a.type===w.VARIABLE){let c=a.path;if(c===r)n.push({key:p,type:"item"});else if(c.startsWith(r+".")){let d=c.substring(r.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:p,type:"prop",prop:d});else{o=!1;break}}else{o=!1;break}}else if(a.type===w.INTERPOLATION&&a.parts.length===1){let c=a.parts[0];if(c.type===w.VARIABLE){let d=c.path;if(d===r)n.push({key:p,type:"item_string"});else if(d.startsWith(r+".")){let h=d.substring(r.length+1);if(!h.includes(".")&&!h.includes("["))n.push({key:p,type:"prop_string",prop:h});else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}if(o){let l=new Array(t.length);if(n.length===3&&n[0].type==="prop"&&n[0].key==="id"&&n[1].type==="prop_string"&&n[1].key==="title"&&n[2].type==="prop"&&n[2].key==="completed")for(let p=0;p<t.length;p++){let a=t[p];l[p]={id:a.id,title:a.title!=null?String(a.title):"",completed:a.completed}}else for(let p=0;p<t.length;p++){let a=t[p],c={};for(let d of n)if(d.type==="literal")c[d.key]=d.value;else if(d.type==="item")c[d.key]=a;else if(d.type==="prop")c[d.key]=a[d.prop];else if(d.type==="item_string")c[d.key]=a!=null?String(a):"";else if(d.type==="prop_string"){let h=a[d.prop];c[d.key]=h!=null?String(h):""}l[p]=c}return l}}return null},na=(e,t,s,r,i)=>{let n=[],o=e.body;if(o.type===w.OBJECT&&o.fast!==!1){let l=e.itemVar,p=e.indexVar;for(let a=0;a<i.length;a++){let c=i[a],d={},h={...r,[l]:c,...p&&{[p]:a}};h.__paths__||(h.__paths__=r.__paths__||{});let f=e.iterable.path||"";if(r&&r.__paths__&&f){let u=f.split("."),y=u[0];y in r.__paths__&&(f=r.__paths__[y],u.length>1&&(f+="."+u.slice(1).join(".")))}h.__paths__={...h.__paths__,[l]:`${f}[${a}]`,...p&&{[p]:a}};for(let u of o.properties){let y=u.parsedKey?N(u.parsedKey,t,s,h):u.key,m=u.value;if(m.type===w.LITERAL)d[y]=m.value;else if(m.type===w.VARIABLE){let b=m.path;if(b===l)d[y]=c;else if(b===p)d[y]=a;else if(b.startsWith(l+".")){let g=b.substring(l.length+1);!g.includes(".")&&!g.includes("[")?d[y]=c[g]:d[y]=K(b,s,{...r,[l]:c,...p&&{[p]:a}})}else d[y]=K(b,s,{...r,[l]:c,...p&&{[p]:a}})}else if(m.type===w.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=g.path,S;if(_===l)S=c;else if(_===p)S=a;else if(_.startsWith(l+".")){let A=_.substring(l.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=K(_,s,{...r,[l]:c,...p&&{[p]:a}})}else S=K(_,s,{...r,[l]:c,...p&&{[p]:a}});b.push(S!=null?String(S):"")}else{let _={...r,[l]:c,...p&&{[p]:a}},S=N(g,t,s,_);b.push(S!=null?String(S):"")}d[y]=b.join("")}else{let b={...r,[l]:c,...p&&{[p]:a}};d[y]=N(m,t,s,b)}}n.push(d)}return n}return null},oa=(e,t,s)=>{let r=e.body;if(r.type===w.OBJECT&&r.properties.length===1&&r.properties[0].key==="$if item.visible"){let i=r.properties[0].value;if(i.type===w.CONDITIONAL&&i.conditions.length===1&&i.conditions[0].type===w.VARIABLE&&i.conditions[0].path==="item.visible"){let n=i.bodies[0];if(n.type===w.OBJECT&&n.properties.length===2){let o=n.properties[0],l=n.properties[1];if(o.key==="id"&&o.value.type===w.VARIABLE&&o.value.path==="item.id"&&l.key==="$if item.highlighted"&&l.value.type===w.CONDITIONAL){let p=[];for(let a=0;a<t.length;a++){let c=t[a];if(c.visible){let d={id:c.id};c.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${c.name}`):(d.highlight=!1,d.message=c.name),p.push(d)}}return p}}}}return null},aa=(e,t,s,r)=>{let i=N(e.iterable,t,s,r);if(!Array.isArray(i)){let a,c=!1;if(e.iterable.type===w.FUNCTION){c=!0;let h=e.iterable.args.map(f=>f.type===w.LITERAL?typeof f.value=="string"?`'${f.value}'`:String(f.value):f.type===w.VARIABLE?f.path:f.type===w.FUNCTION?`${f.name}(...)`:"?").join(", ");a=`${e.iterable.name}(${h})`}else a=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${a}`;throw Jo(d,i,c)}if(!e.indexVar){let a=oa(e,i,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=ia(e,i);if(a!==null)return a}let n=na(e,t,s,r,i);if(n!==null)return n;let o=[],l=e.iterable.path||"";if(r&&r.__paths__&&l){let a=l.split("."),c=a[0];c in r.__paths__&&(l=r.__paths__[c],a.length>1&&(l+="."+a.slice(1).join(".")))}let p=!1;e.body.type===w.ARRAY&&(e.body.items.length<=1?p=!1:p=e.body._shouldPreserveArray??=e.body.items.some(a=>a.type===w.OBJECT&&a.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let a=0;a<i.length;a++){let c=e.indexVar?{...r,[e.itemVar]:i[a],[e.indexVar]:a}:{...r,[e.itemVar]:i[a]};c.__paths__||(c.__paths__=r.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${l}[${a}]`},e.indexVar&&(c.__paths__[e.indexVar]=a);let d=N(e.body,t,s,c);if(Array.isArray(d)&&d.length===1&&!p){let h=d[0];o.push(h===void 0?{}:h)}else o.push(d===void 0?{}:d)}return o},la=(e,t,s,r)=>{if(e.whenCondition)return null;if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?N(i.parsedKey,t,s,r):i.key,o=i.value;if(o.type===w.OBJECT&&o.properties.length<=10&&!o.whenCondition){let l={},p={},a=!0;for(let c of o.properties){let d=c.parsedKey?N(c.parsedKey,t,s,r):c.key,h=c.value;if(h.type===w.LITERAL)p[d]=h.value;else if(h.type===w.VARIABLE)p[d]=K(h.path,s,r);else if(h.type===w.INTERPOLATION){let f=[];for(let u of h.parts)if(typeof u=="string")f.push(u);else if(u.type===w.VARIABLE){let y=K(u.path,s,r);f.push(y!=null?String(y):"")}else{a=!1;break}if(!a)break;p[d]=f.join("")}else if(h.type===w.OBJECT&&h.properties.length<=5){let f={};for(let u of h.properties){let y=u.key,m=u.value;if(m.type===w.LITERAL)f[y]=m.value;else if(m.type===w.VARIABLE)f[y]=K(m.path,s,r);else if(m.type===w.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=K(g.path,s,r);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[y]=b.join("")}else{a=!1;break}}if(!a)break;p[d]=f}else{a=!1;break}}if(a)return l[n]=p,l}}return null},pa=(e,t,s,r)=>{let i=t.functions||t;if(e.whenCondition&&!De(e.whenCondition,i,s,r))return;let n=la(e,t,s,r);if(n!==null)return n;if(e.fast){let p={};for(let a of e.properties){let c=a.parsedKey?N(a.parsedKey,t,s,r):a.key,d=a.value;if(d.type===w.LITERAL)p[c]=d.value;else if(d.type===w.VARIABLE)p[c]=K(d.path,s,r);else if(d.type===w.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===w.VARIABLE){let u=K(f.path,s,r);h.push(u!=null?String(u):"")}else{let u=N(f,t,s,r);h.push(u!=null?String(u):"")}p[c]=h.join("")}else p[c]=N(d,t,s,r)}return p}let o={},l=!1;for(let p of e.properties)if(!p.key.startsWith("$if ")&&!p.key.match(/^\$if\s+\w+.*:?$/)&&!p.key.startsWith("$elif")&&!p.key.startsWith("$else")&&!p.key.startsWith("$for ")){l=!0;break}for(let p of e.properties)if(p.key.startsWith("$if ")||p.key.match(/^\$if\s+\w+.*:?$/)){let a=N(p.value,t,s,r);if(!l&&a!==null&&a!==void 0)return Array.isArray(a)&&a.length===1?a[0]:a;typeof a=="object"&&a!==null&&!Array.isArray(a)&&Object.assign(o,a)}else if(p.key.startsWith("$for ")){if(e.properties.length===1)return N(p.value,t,s,r)}else{let a=p.value;if(a&&a.type===w.OBJECT&&a.properties){let c=a.properties.find(d=>d.key.startsWith("$for "));if(c){let d=N(c.value,t,s,r);d!==void 0&&(o[p.key]=d)}else{let d=N(p.value,t,s,r);d!==void 0&&(o[p.key]=d)}}else{let c=p.parsedKey?N(p.parsedKey,t,s,r):p.key,d=N(p.value,t,s,r);d!==void 0&&(o[c]=d)}}return o},bi={},da=(e,t,s,r)=>{let i=[];for(let n of e.items)if(n.type===w.LOOP){let o=N(n,t,s,r);Array.isArray(o)&&n.flatten!==!1?i.push(...o):i.push(o)}else{let o=N(n,t,s,r);o!==bi&&o!==void 0&&i.push(o)}return i},ca=(e,t,s,r)=>{let{name:i,data:n,whenCondition:o}=e,l=t.partials||{},p=t.functions||t;if(o&&!De(o,p,s,r))return;if(!l[i])throw new de(`Partial '${i}' is not defined`);let a=r._partialStack||[];if(a.includes(i))throw new de(`Circular partial reference detected: ${i}`);let c=l[i],d=s,h={...r,_partialStack:[...a,i]};if(r){d={...s};for(let f of Object.keys(r))f.startsWith("_")||(d[f]=r[f])}if(n){let f=N(n,t,s,r);d={...d,...f}}return N(c,t,d,h)},ua=(e,t,s,r)=>{let{path:i}=e,n=i.split("."),o=n[0],l=n.slice(1);if(!r||!(o in r))throw new de(`Path reference '#{${i}}' refers to '${o}' which is not a loop variable in the current scope`);if(r.__paths__||(r.__paths__={}),!(o in r.__paths__))throw new de(`Path reference '#{${i}}' cannot be resolved - path tracking may not be initialized properly`);let p=r.__paths__[o];if(typeof p=="number"){if(l.length>0)throw new de(`Path reference '#{${i}}' - cannot access properties on index variable '${o}'`);return String(p)}return l.length>0&&(p+="."+l.join(".")),p},ha=/\$\{([^}]*)\}/g,fa=/#\{([^}]*)\}/g,vi=(e,t={})=>{let s=e.match(/^(\w+)\((.*)\)$/);if(!s)return{isFunction:!1};let[,r,i]=s,n=ya(i,t);return{isFunction:!0,type:w.FUNCTION,name:r,args:n}},ya=(e,t={})=>e.trim()?ma(e).map(s=>ga(s.trim(),t)):[],ma=e=>{let t=[],s="",r=0,i=!1,n="";for(let o=0;o<e.length;o++){let l=e[o],p=o>0?e[o-1]:"";!i&&(l==='"'||l==="'")?(i=!0,n=l,s+=l):i&&l===n&&p!=="\\"?(i=!1,n="",s+=l):!i&&l==="("?(r++,s+=l):!i&&l===")"?(r--,s+=l):!i&&l===","&&r===0?(t.push(s),s=""):s+=l}return s&&t.push(s),t},ga=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:w.LITERAL,value:parseFloat(e)};if(e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};let s=vi(e,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};let r=e.trim(),i=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:o,type:l}of i){let p=0;for(;p<r.length;){let a=Le(r.substring(p),o);if(a===-1)break;let c=p+a;c>n&&(n=c),p=c+o.length}}if(n!==-1)try{return X(r,t)}catch{return{type:w.VARIABLE,path:r}}return{type:w.VARIABLE,path:r}},wi=/^\w+\(.*\)$/,ba=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,va=e=>{if(!(!e||e.trim()===""||wi.test(e))&&ba.test(e))throw e.includes("?")&&e.includes(":")?new $(`Complex expressions not supported in variable replacements - consider calculating the value in your data instead. Offending expression: "${e}"`):e.includes("||")||e.includes("&&")||e.includes("??")?new $(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new $(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},Rr=e=>{let t=e.trim();if(wi.test(t))throw new $(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new $(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new $(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new $(`Logical operators not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("?")&&t.includes(":"))throw new $(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:w.PATH_REFERENCE,path:t}},mt=(e,t={})=>{let s=e.trim();va(s);let r=vi(s,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};if(s.includes("[")&&!/[\s+\-*/%|&?:]/.test(s)){let i=0;for(let n of s)n==="["?i++:n==="]"&&i--;if(i!==0)throw new Error("Invalid array index syntax")}return{type:w.VARIABLE,path:s}},_i=(e,t={})=>{let s=e,r=[];(e.includes("\\${")||e.includes("\\#{"))&&(s=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),s=s.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),s=s.replace(/\\(\$\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\(#\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\DOUBLE_ESC_VAR/g,"\\"),s=s.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let i=[...s.matchAll(ha)],n=[...s.matchAll(fa)],o=[...i.map(a=>({match:a,type:"variable"})),...n.map(a=>({match:a,type:"pathref"}))].sort((a,c)=>a.match.index-c.match.index);if(o.length===0){let a=s;for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);return{type:w.LITERAL,value:a}}if(o.length===1&&o[0].match[0]===s&&r.length===0){let{match:a,type:c}=o[0];try{return c==="variable"?mt(a[1],t):Rr(a[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:w.LITERAL,value:s};throw d}}let l=[],p=0;for(let{match:a,type:c}of o){let[d,h]=a,f=a.index;if(f>p){let u=s.substring(p,f);for(let y=0;y<r.length;y++)u=u.replace(`__ESCAPED_${y}__`,r[y]);u&&l.push(u)}try{let u;c==="variable"?u=mt(h.trim(),t):u=Rr(h.trim()),l.push(u)}catch(u){if(u.message==="Invalid array index syntax")l.push(d);else throw u}p=f+d.length}if(p<s.length){let a=s.substring(p);for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);a&&l.push(a)}return{type:w.INTERPOLATION,parts:l}},ke=(e,t)=>typeof e=="string"?_i(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?_a(e,t):xa(e,t):{type:w.LITERAL,value:e},wa=e=>{let{$each:t,...s}=e;if(typeof t!="string")throw new $("$each value must be a non-empty string");let r=t.trim();if(r==="")throw new $("$each value must be a non-empty string");if(Object.keys(s).length===0)throw new $("Empty $each body not allowed");if(s.$partial!==void 0)throw new $("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${r}`]:s}},_a=(e,t)=>{let s=[],r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let p=wa(n),a=Object.keys(p);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let c=jr(a[0],p[a[0]],t,!0);s.push(c),r=!0;continue}}catch(p){throw p instanceof $?p:new $(p.message)}let l=Object.keys(n);if(l.length===1&&/^\$for(?::\w+)?\s/.test(l[0])){let p=jr(l[0],n[l[0]],t);s.push(p),r=!0;continue}}let o=ke(n,t);s.push(o),(o.type===w.FUNCTION||o.type===w.CONDITIONAL||o.type===w.LOOP||o.type===w.PARTIAL||o.type===w.OBJECT&&!o.fast||o.type===w.ARRAY&&!o.fast)&&(r=!0)}return{type:w.ARRAY,items:s,fast:!r}},xa=(e,t)=>{let s=[],r=!1,i=null,n=Object.entries(e),o=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new $("$partial value must be a string");if(e.$partial.trim()==="")throw new $("$partial value cannot be an empty string");let p=["$if","$elif","$else","$for"],a=[];for(let[b]of n)for(let g of p)if(b===g||b.startsWith(g+" ")||b.startsWith(g+"#")){a.push(g);break}if(a.length>0)throw new $(`Cannot use $partial with ${a.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...h}=e,f={},u=!1;for(let[b,g]of Object.entries(h)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=g,u=!0}let y=null;if(u&&(y=ke(f,t),y.type===w.OBJECT)){let b=!1;for(let g of y.properties)if(g.value.type===w.VARIABLE||g.value.type===w.INTERPOLATION||g.value.type===w.FUNCTION||g.value.type===w.CONDITIONAL||g.value.type===w.OBJECT&&!g.value.fast||g.value.type===w.ARRAY&&!g.value.fast){b=!0;break}b&&(y.fast=!1)}let m={type:w.PARTIAL,name:c,data:y};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new $("Empty condition expression after '$when'");b=X(d,t)}else b={type:w.LITERAL,value:d};m.whenCondition=b}return m}for(let[p,a]of n)if(p==="$when"){if(i!==null)throw new $("Multiple '$when' directives on the same object are not allowed");if(a==null)throw new $("Missing condition expression after '$when'");let c=typeof a=="string"?a:JSON.stringify(a);if(c.trim()==="")throw new $("Empty condition expression after '$when'");i=X(c,t),r=!0}else if(p.startsWith("$when#")||p.startsWith("$when "))throw new $("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;o<n.length;){let[p,a]=n[o];if(p==="$when"){o++;continue}if(p==="$each")throw new $("$each can only be used inside arrays");if(p.startsWith("$if ")||p.match(/^\$if#\w+\s/)||p.match(/^\$if\s+\w+.*:$/)){let c=Sa(n,o,t);s.push({key:p,value:c.node}),r=!0,o=c.nextIndex}else if(/^\$for(?::\w+)?\s/.test(p)){let c=p.match(/^\$for(?::(\w+))?\s/)?.[1]||"",d=c?`:${c}`:"";throw new $(`$for loops must be inside arrays - use '- $for${d} item in items:' instead of '$for${d} item in items:'. For cleaner object generation syntax, consider using $each.`)}else{if(p.startsWith("$elif ")||p.startsWith("$else"))throw new $(`'${p.split(" ")[0]}' without matching '$if'`);if(p==="$if"||p==="$if:")throw new $("Missing condition expression after '$if'");{let c=ke(a,t);(c.type===w.FUNCTION||c.type===w.CONDITIONAL||c.type===w.PARTIAL||c.type===w.OBJECT&&!c.fast||c.type===w.ARRAY&&!c.fast)&&(r=!0);let d=_i(p,t),h={key:p,value:c};(d.type!==w.LITERAL||d.value!==p)&&(h.parsedKey=d),s.push(h),o++}}}let l={type:w.OBJECT,properties:s,fast:!r};return i&&(l.whenCondition=i),l},Sa=(e,t,s={})=>{let r=[],i=[],n=t,[o,l]=e[n],p=null,a;if(o.startsWith("$if#")){let d=o.match(/^\$if#(\w+)\s+(.+)$/);if(d)p=d[1],a=d[2];else throw new $(`Invalid conditional syntax: ${o}`)}else a=o.substring(4),a.endsWith(":")&&(a=a.slice(0,-1).trim());Vr(a);let c=X(a,s);for(r.push(c),i.push(ke(l,s)),n++;n<e.length;){let[d,h]=e[n],f=!1,u;if(p?d.startsWith(`$elif#${p} `)?(u=d.substring(`$elif#${p} `.length),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d===`$else#${p}`||d===`$else#${p}:`)&&(f=!0,u=null):d.startsWith("$elif ")?(u=d.substring(6),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,u=null),f){if(u===null)r.push(null);else{Vr(u);let y=X(u,s);r.push(y)}if(i.push(ke(h,s)),n++,u===null)break}else break}return{node:{type:w.CONDITIONAL,conditions:r,bodies:i,id:p},nextIndex:n}},X=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let a=e.slice(1,-1),c=0,d=!0;for(let h=0;h<a.length;h++)if(a[h]==="("?c++:a[h]===")"&&c--,c<0){d=!1;break}if(d&&c===0)return X(a,t)}let s=Le(e,"||");if(s!==-1)return{type:w.BINARY,op:D.OR,left:X(e.substring(0,s).trim(),t),right:X(e.substring(s+2).trim(),t)};let r=Le(e,"&&");if(r!==-1)return{type:w.BINARY,op:D.AND,left:X(e.substring(0,r).trim(),t),right:X(e.substring(r+2).trim(),t)};let i=[{op:">=",type:D.GTE},{op:"<=",type:D.LTE},{op:"==",type:D.EQ},{op:"!=",type:D.NEQ},{op:">",type:D.GT},{op:"<",type:D.LT},{op:" in ",type:D.IN}];for(let{op:a,type:c}of i){let d=Le(e,a);if(d!==-1)return{type:w.BINARY,op:c,left:X(e.substring(0,d).trim(),t),right:X(e.substring(d+a.length).trim(),t)}}let n=-1,o=null,l=[{op:" + ",type:D.ADD},{op:" - ",type:D.SUBTRACT}];for(let{op:a,type:c}of l){let d=0;for(;d<e.length;){let h=Le(e.substring(d),a);if(h===-1)break;let f=d+h;f>n&&(n=f,o={op:a,type:c}),d=f+a.length}}if(n!==-1&&o)return{type:w.BINARY,op:o.type,left:X(e.substring(0,n).trim(),t),right:X(e.substring(n+o.op.length).trim(),t)};let p=[" * "," / "," % "];for(let a of p)if(Le(e,a)!==-1)throw new $(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:w.UNARY,op:ms.NOT,operand:X(e.substring(1).trim(),t)}:xi(e,t)},Le=(e,t)=>{let s=0,r=0;for(;r<=e.length-t.length;){if(e[r]==="(")s++;else if(e[r]===")")s--;else if(s===0&&e.substring(r,r+t.length)===t)return r;r++}return-1},Aa=e=>{if(e=e.trim(),e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:w.LITERAL,value:""};if(e==="{}")return{type:w.LITERAL,value:{}};if(e==="[]")return{type:w.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:w.LITERAL,value:t}:{type:w.VARIABLE,path:e}},xi=(e,t)=>{let s=e.trim();if(s.match(/^(\w+)\((.*)\)$/))return mt(s,t);let r=Aa(s);if(r.type===w.LITERAL)return r;if(/^[a-zA-Z_$][\w.$]*$/.test(s))return{type:w.VARIABLE,path:s};try{return mt(s,t)}catch(i){if(i.message&&i.message.includes("not supported"))return r;throw i}},ka=(e,t=!1)=>{try{Go(e)}catch(s){if(s instanceof $&&t){let r=s.message.replace(/\$for/g,"$each");throw new $(r.replace("Parse Error: ",""))}throw s}},jr=(e,t,s,r=!1)=>{let i=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(i);if(!n){let m=r?"$each":"$for";throw new $(`Invalid loop syntax (got: '${e.replace("$for",m)}')`)}let o=n[1],l=n[2].trim();ka(l,r);let p=l.match(/^(.+?)\s+in\s+(.+)$/);if(!p){let m=r?"$each":"$for";throw new $(`Invalid loop syntax - missing 'in' keyword (got: '${m} ${l}')`)}let a=p[1].trim(),c=p[2].trim(),d,h=null;if(a.includes(",")){let m=a.split(",").map(b=>b.trim());if(m.length!==2)throw new $(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=m[0],h=m[1]}else d=a;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new $(`Reserved variable name: ${d}`);if(h&&f.includes(h))throw new $(`Reserved variable name: ${h}`);let u=xi(c,s),y=ke(t,s);return{type:w.LOOP,itemVar:d,indexVar:h,iterable:u,body:y,flatten:o!=="nested"}},Dr=(e,t={})=>{let{functions:s={}}=t;return ke(e,s)},Ea=()=>Date.now(),$a=Object.freeze(Object.defineProperty({__proto__:null,now:Ea},Symbol.toStringTag,{value:"Module"})),Ca=(e,t,s={})=>{let{functions:r={},partials:i={}}=s,n={...$a,...r},o=Dr(e,{functions:n}),l={};for(let[p,a]of Object.entries(i))l[p]=Dr(a,{functions:n});return Xo(o,t,{functions:n,partials:l})},js=e=>e!==null&&typeof e=="object",gt=e=>js(e)&&!Array.isArray(e),Ia=e=>typeof e=="string"&&e.includes("."),Si=e=>typeof e=="string"&&/[\[\]]/.test(e);function Ai(e,t){let s={};for(let r of t){if(typeof r!="string"||r.length===0)continue;let i=ne(e,r);i!==void 0&&he(s,r,i)}return s}function Oa(e){if(!gt(e)||!Array.isArray(e.fields))return e;let t=(s=[])=>s.map(r=>{if(!gt(r))return r;if(typeof r.$when=="string"&&r.$when.trim().length>0){let{$when:i,...n}=r,o=Array.isArray(n.fields)?{...n,fields:t(n.fields)}:n;return{[`$if ${i}`]:o}}return Array.isArray(r.fields)?{...r,fields:t(r.fields)}:r});return{...e,fields:t(e.fields)}}var ne=(e,t,s=void 0)=>{if(!t||!js(e)||Si(t))return s;let r=t.split(".").filter(n=>n!==""),i=e;for(let n of r){if(i==null||!(n in i))return Object.prototype.hasOwnProperty.call(e,t)?e[t]:s;i=i[n]}return i},he=(e,t,s)=>{if(!js(e)||typeof t!="string"||t.length===0||Si(t))return e;let r=t.split(".").filter(n=>n!=="");if(r.length===0)return e;Ia(t)&&Object.prototype.hasOwnProperty.call(e,t)&&delete e[t];let i=e;for(let n=0;n<r.length-1;n++){let o=r[n];(!(o in i)||typeof i[o]!="object"||i[o]===null)&&(i[o]={}),i=i[o]}return i[r[r.length-1]]=s,e},Ta=["id","class","style","slot","form","defaultValues","disabled","context"],La=(e={})=>Object.entries(e).filter(([t,s])=>!(Ta.includes(t)||s==null||typeof s=="object"||typeof s=="function")).map(([t,s])=>`${t}=${String(s)}`).join(" "),Va={email:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,url:/^https?:\/\/.+/},ue={required:"This field is required",minLength:e=>`Must be at least ${e} characters`,maxLength:e=>`Must be at most ${e} characters`,pattern:"Invalid format",invalidDate:"Invalid date format",invalidTime:"Invalid time format",invalidDateTime:"Invalid date and time format",minTemporal:e=>`Must be on or after ${e}`,maxTemporal:e=>`Must be on or before ${e}`},Na="input-date",Ra="input-time",ja="input-datetime",Da=/^(\d{4})-(\d{2})-(\d{2})$/,Pa=/^(\d{2}):(\d{2})(?::(\d{2}))?$/,Ba=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}(?::\d{2})?)$/,za=e=>{if(typeof e!="string")return null;let t=Da.exec(e);if(!t)return null;let s=Number(t[1]),r=Number(t[2]),i=Number(t[3]);if(!Number.isInteger(s)||!Number.isInteger(r)||!Number.isInteger(i)||r<1||r>12||i<1||i>31)return null;let n=new Date(Date.UTC(s,r-1,i));return n.getUTCFullYear()===s&&n.getUTCMonth()===r-1&&n.getUTCDate()===i?{year:s,month:r,day:i}:null},Wa=e=>{if(typeof e!="string")return null;let t=Pa.exec(e);if(!t)return null;let s=Number(t[1]),r=Number(t[2]),i=t[3]===void 0?0:Number(t[3]);return!Number.isInteger(s)||!Number.isInteger(r)||!Number.isInteger(i)||s<0||s>23||r<0||r>59||i<0||i>59?null:{hour:s,minute:r,second:i}},ki=e=>{let t=Wa(e);return t?`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}`:null},Ei=e=>za(e)?e:null,Ma=e=>{if(typeof e!="string")return null;let t=Ba.exec(e);if(!t)return null;let s=Ei(t[1]),r=ki(t[2]);return!s||!r?null:`${s}T${r}`},Fa=e=>e===Na?{normalize:Ei,invalidMessage:ue.invalidDate}:e===Ra?{normalize:ki,invalidMessage:ue.invalidTime}:e===ja?{normalize:Ma,invalidMessage:ue.invalidDateTime}:null,Ka=(e,t)=>{let s=Fa(e.type);if(!s||t==null||t==="")return null;let r=s.normalize(String(t));if(!r)return s.invalidMessage;if(e.min!==void 0&&e.min!==null&&String(e.min)!==""){let i=s.normalize(String(e.min));if(i&&r<i)return ue.minTemporal(String(e.min))}if(e.max!==void 0&&e.max!==null&&String(e.max)!==""){let i=s.normalize(String(e.max));if(i&&r>i)return ue.maxTemporal(String(e.max))}return null},Et=(e,t)=>{if(e.required){let r=t==null||t===""||Array.isArray(t)&&t.length===0||typeof t=="boolean"&&t===!1,i=e.type==="input-number"&&t===null;if(e.type==="input-number"?i:r)return typeof e.required=="object"&&e.required.message?e.required.message:ue.required}let s=Ka(e,t);if(s)return s;if(Array.isArray(e.rules))for(let r of e.rules){let i=Ua(r,t);if(i)return i}return null},Ua=(e,t)=>{if(t==null||t==="")return null;let s=String(t);switch(e.rule){case"minLength":return s.length<e.value?e.message||ue.minLength(e.value):null;case"maxLength":return s.length>e.value?e.message||ue.maxLength(e.value):null;case"pattern":{let r=Va[e.value];if(!r)try{r=new RegExp(e.value)}catch{return e.message||ue.pattern}return r.test(s)?null:e.message||ue.pattern}default:return null}},$t=(e,t)=>{let s={},r=ie(e);for(let i of r){let n=ne(t,i.name),o=Et(i,n);o&&(s[i.name]=o)}return{valid:Object.keys(s).length===0,errors:s}},Ha=["section","read-only-text","slot"],Ds=e=>!Ha.includes(e.type),ie=e=>{let t=[];for(let s of e)s.type==="section"&&Array.isArray(s.fields)?t.push(...ie(s.fields)):Ds(s)&&t.push(s);return t},Ps=e=>{switch(e.type){case"input-text":case"input-date":case"input-time":case"input-datetime":case"input-textarea":case"popover-input":return"";case"input-number":return null;case"select":case"segmented-control":return null;case"tag-select":return[];case"checkbox":return!1;case"color-picker":return"#000000";case"slider":case"slider-with-input":return e.min!==void 0?e.min:0;case"image":return null;default:return null}},Bs=(e,t=0)=>{let s=[],r=t;for(let i of e)if(i.type==="section"){if(s.push({...i,_isSection:!0,_idx:r}),r++,Array.isArray(i.fields)){let n=Bs(i.fields,r);s.push(...n),r+=n.length}}else s.push({...i,_isSection:!1,_idx:r}),r++;return s},qa=()=>Object.freeze({formValues:{},errors:{},reactiveMode:!1,tooltipState:{open:!1,x:0,y:0,content:""}}),ee=({state:e,props:t})=>{let{form:s={}}=t||{},r=Oa(s),i=gt(t?.context)?t.context:{},n=gt(e?.formValues)?e.formValues:{},o={...i,...n,formValues:n};return Object.keys(o).length>0?Ca(r,o):r},Ya=({state:e,props:t})=>{let s=La(t),r=ee({state:e,props:t}),i=r.fields||[],n=!!t?.disabled,o=Bs(i);o.forEach(d=>{if(d._isSection)return;let h=Ds(d);if(d._disabled=n||!!d.disabled,h&&d.name&&(d._error=e.errors[d.name]||null),d.type==="input-text"&&(d._inputType=d.inputType||"text"),d.type==="select"||d.type==="tag-select"||d.type==="segmented-control"){let f=ne(e.formValues,d.name);d._selectedValue=f!==void 0?f:null,d._selectedValues=Array.isArray(f)?f:[],d.placeholder=d.placeholder||"",d.noClear=d.clearable===!1}if(d.type==="image"){let f=ne(e.formValues,d.name);d._imageSrc=f&&String(f).trim()?f:null,d.placeholderText=d.placeholderText||"No Image"}if(d.type==="read-only-text"&&(d.content=d.content||""),d.type==="checkbox"){let f=typeof d.content=="string"?d.content:typeof d.checkboxLabel=="string"?d.checkboxLabel:"";d._checkboxText=f}});let l=r.actions||{buttons:[]},p=l.layout||"split",a=(l.buttons||[]).map((d,h)=>({...d,_globalIdx:h,variant:d.variant||"se",_disabled:n||!!d.disabled,pre:d.pre||"",suf:d.suf||""})),c;return p==="split"?c={_layout:"split",buttons:a,_leftButtons:a.filter(d=>d.align==="left"),_rightButtons:a.filter(d=>d.align!=="left")}:c={_layout:p,buttons:a,_allButtons:a},{containerAttrString:s,title:r?.title||"",description:r?.description||"",flatFields:o,actions:c,formValues:e.formValues,tooltipState:e.tooltipState}},Ie=({state:e,props:t})=>{let s=ee({state:e,props:t}),r=ie(s.fields||[]);return Ai(e.formValues,r.map(i=>i.name).filter(i=>typeof i=="string"&&i.length>0))},Ga=({state:e,props:t},s={})=>{let{name:r,value:i}=s;r&&(he(e.formValues,r,i),rt({state:e,props:t}))},rt=({state:e,props:t})=>{if(!t)return;let s=ee({state:e,props:t}),r=ie(s.fields||[]);e.formValues=Ai(e.formValues,r.map(i=>i.name).filter(i=>typeof i=="string"&&i.length>0))},Ja=({state:e},t={})=>{let{values:s}=t;!s||typeof s!="object"||Object.keys(s).forEach(r=>{he(e.formValues,r,s[r])})},Za=({state:e},t={})=>{let{defaultValues:s={}}=t;e.formValues=s?structuredClone(s):{},e.errors={},e.reactiveMode=!1},Xa=({state:e},t={})=>{e.errors=t.errors||{}},Qa=({state:e},t={})=>{let{name:s}=t;s&&e.errors[s]&&delete e.errors[s]},el=({state:e})=>{e.reactiveMode=!0},tl=({state:e},t={})=>{let{x:s,y:r,content:i}=t;e.tooltipState={open:!0,x:s,y:r,content:i}},sl=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},rl=Object.freeze(Object.defineProperty({__proto__:null,clearFieldError:Qa,collectAllDataFields:ie,createInitialState:qa,flattenFields:Bs,get:ne,getDefaultValue:Ps,hideTooltip:sl,isDataField:Ds,pruneHiddenValues:rt,resetFormValues:Za,selectForm:ee,selectFormValues:Ie,selectViewData:Ya,set:he,setErrors:Xa,setFormFieldValue:Ga,setFormValues:Ja,setReactiveMode:el,showTooltip:tl,validateField:Et,validateForm:$t},Symbol.toStringTag,{value:"Module"})),$i=({field:e,target:t,value:s})=>{!e||!t||["slider-with-input","popover-input"].includes(e.type)&&(s==null?t.removeAttribute("value"):t.setAttribute("value",String(s)))},Ci=({form:e,formValues:t={},refs:s,formDisabled:r=!1})=>{let i=e.fields||[],n=0,o=l=>{for(let p of l){if(p.type==="section"){n++,Array.isArray(p.fields)&&o(p.fields);continue}let a=s[`field${n}`];if(n++,!a)continue;let c=r||!!p.disabled;if(["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"].includes(p.type)){let d=ne(t,p.name);if(d==null?a.removeAttribute("value"):a.setAttribute("value",String(d)),p.type==="slider-with-input"&&a.store?.setValue){let h=Number(d??0);a.store.setValue({value:Number.isFinite(h)?h:0}),typeof a.render=="function"&&a.render()}p.type==="popover-input"&&a.store?.setValue&&(a.store.setValue({value:d==null?"":String(d)}),typeof a.render=="function"&&a.render())}if(p.type==="tag-select"&&a.store?.updateSelectedValues){let d=ne(t,p.name);a.store.updateSelectedValues({values:Array.isArray(d)?d:[]}),typeof a.render=="function"&&a.render()}p.type==="checkbox"&&(ne(t,p.name)?a.setAttribute("checked",""):a.removeAttribute("checked")),["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input"].includes(p.type)&&p.placeholder&&a.getAttribute("placeholder")!==p.placeholder&&(p.placeholder===void 0||p.placeholder===null?a.removeAttribute("placeholder"):a.setAttribute("placeholder",p.placeholder)),c?a.setAttribute("disabled",""):a.removeAttribute("disabled")}};o(i)},Ii=(e,t)=>{let s=t?.defaultValues||{},r={};Object.keys(s).forEach(l=>{he(r,l,s[l])});let i=ee({state:{formValues:r},props:t}),n=ie(i.fields||[]),o={};for(let l of n){let p=ne(s,l.name);p!==void 0?he(o,l.name,p):he(o,l.name,Ps(l))}e.resetFormValues({defaultValues:o})},il=e=>{let{store:t,props:s}=e;Ii(t,s)},nl=e=>{let{props:t,refs:s,render:r}=e,i=e.store.getState(),n=ee({state:i,props:t});Ci({form:n,formValues:i.formValues,refs:s,formDisabled:!!t?.disabled}),r()},ol=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n,refs:o}=e,l=!!r?.disabled;s?.key!==r?.key&&Ii(i,r);let p=i.getState();rt({state:p,props:r});let a=ee({state:p,props:r});Ci({form:a,formValues:p.formValues,refs:o,formDisabled:l}),n()},al=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event,l=o.currentTarget.dataset.fieldName;if(!l||!o.detail||!Object.prototype.hasOwnProperty.call(o.detail,"value"))return;let p=o.detail.value;s.setFormFieldValue({name:l,value:p});let a=s.getState();rt({state:a,props:n});let c=ee({state:a,props:n}),d=ie(c.fields||[]).find(h=>h.name===l);if($i({field:d,target:o.currentTarget,value:p}),a.reactiveMode&&d){let h=Et(d,p);h?s.setErrors({errors:{...a.errors,[l]:h}}):s.clearFieldError({name:l})}i(),r(new CustomEvent("form-input",{bubbles:!0,detail:{name:l,value:p,values:Ie({state:s.getState(),props:n})}}))},ll=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event,l=o.currentTarget.dataset.fieldName;if(!l||!o.detail||!Object.prototype.hasOwnProperty.call(o.detail,"value"))return;let p=o.detail.value;s.setFormFieldValue({name:l,value:p});let a=s.getState();rt({state:a,props:n});let c=ee({state:a,props:n}),d=ie(c.fields||[]).find(h=>h.name===l);if($i({field:d,target:o.currentTarget,value:p}),a.reactiveMode&&d){let h=Et(d,p);h?s.setErrors({errors:{...a.errors,[l]:h}}):s.clearFieldError({name:l})}i(),r(new CustomEvent("form-change",{bubbles:!0,detail:{name:l,value:p,values:Ie({state:s.getState(),props:n})}}))},pl=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event.currentTarget.dataset.actionId;if(!o)return;let l=s.getState(),p=ee({state:l,props:n}),a=((p.actions||{}).buttons||[]).find(d=>d.id===o),c=Ie({state:l,props:n});if(a&&a.validate){let d=ie(p.fields||[]),{valid:h,errors:f}=$t(d,l.formValues);s.setErrors({errors:f}),h||s.setReactiveMode(),i(),r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:o,values:c,valid:h,errors:f}}))}else r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:o,values:c}}))},dl=(e,t)=>{let s=t._event;s.type==="contextmenu"&&s.preventDefault();let{store:r,dispatchEvent:i,props:n}=e,o=s.currentTarget.dataset.fieldName;i(new CustomEvent("form-field-event",{bubbles:!0,detail:{name:o,event:s.type,values:Ie({state:r.getState(),props:n})}}))},cl=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event;if(o.key==="Enter"&&!o.shiftKey){let l=o.target;if(l.tagName==="TEXTAREA"||l.tagName==="RTGL-TEXTAREA")return;o.preventDefault();let p=s.getState(),a=ee({state:p,props:n}),c=(a.actions||{}).buttons||[],d=c.find(f=>f.validate)||c[0];if(!d)return;let h=Ie({state:p,props:n});if(d.validate){let f=ie(a.fields||[]),{valid:u,errors:y}=$t(f,p.formValues);s.setErrors({errors:y}),u||s.setReactiveMode(),i(),r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h,valid:u,errors:y}}))}else r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h}}))}},ul=(e,t)=>{let{store:s,render:r,props:i}=e,n=t._event,o=n.currentTarget.dataset.fieldName,l=ee({state:s.getState(),props:i}),p=ie(l.fields||[]).find(a=>a.name===o);if(p&&p.tooltip){let a=n.currentTarget.getBoundingClientRect();s.showTooltip({x:a.left+a.width/2,y:a.top-8,content:typeof p.tooltip=="string"?p.tooltip:p.tooltip.content||""}),r()}},hl=e=>{let{store:t,render:s}=e;t.hideTooltip({}),s()},fl=Object.freeze(Object.defineProperty({__proto__:null,handleActionClick:pl,handleAfterMount:nl,handleBeforeMount:il,handleImageClick:dl,handleKeyDown:cl,handleOnUpdate:ol,handleTooltipMouseEnter:ul,handleTooltipMouseLeave:hl,handleValueChange:ll,handleValueInput:al},Symbol.toStringTag,{value:"Module"})),yl=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"],ml=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input","slider-with-input"],gl=({ref:e,fieldType:t,value:s,forceRefresh:r=!1})=>{if(yl.includes(t)){if(r&&e.removeAttribute("value"),s==null){if(ml.includes(t)&&r){if(t==="popover-input"){e.removeAttribute("value");return}e.setAttribute("value","");return}e.removeAttribute("value");return}e.setAttribute("value",String(s))}},Oi=({ref:e,value:t})=>{if(e){if(e?.store?.updateSelectedValues)e.store.updateSelectedValues({values:Array.isArray(t)?t:[]});else if(e?.store?.updateSelectedValue)e.store.updateSelectedValue({value:t});else return;typeof e.render=="function"&&e.render()}},bl=e=>{let t=new Map;return!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("[data-field-name]").forEach(s=>{let r=s.getAttribute("data-field-name");r&&t.set(r,s)}),t},Pr=e=>e?.renderTarget?e.renderTarget:e?.shadowRoot?e.shadowRoot:e?.shadow,vl=({root:e,values:t={}})=>{!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("rtgl-select[data-field-name], rtgl-tag-select[data-field-name], rtgl-segmented-control[data-field-name]").forEach(s=>{let r=s.dataset?.fieldName;if(!r)return;let i=ne(t,r);Oi({ref:s,value:i})})},wl=function(){let e=this.store.getState();return Ie({state:e,props:this.props})},_l=function(e={}){let t=e&&typeof e=="object"&&e.values&&typeof e.values=="object"?e.values:e;if(!t||typeof t!="object"||Array.isArray(t))return;this.store.setFormValues({values:t}),this.store.pruneHiddenValues();let s=this.store.getState(),r=ee({state:s,props:this.props}),i=ie(r.fields||[]),n=bl(Pr(this));for(let l of i){if(!l.name)continue;let p=n.get(l.name);if(!p)continue;let a=Object.prototype.hasOwnProperty.call(t,l.name),c=ne(t,l.name);if(!a&&c===void 0)continue;let d=ne(s.formValues,l.name);gl({ref:p,fieldType:l.type,value:d,forceRefresh:!0}),["select","tag-select","segmented-control"].includes(l.type)&&Oi({ref:p,value:d}),l.type==="checkbox"&&(d?p.setAttribute("checked",""):p.removeAttribute("checked"))}this.render();let o=()=>{let l=this.store.getState();vl({root:Pr(this),values:l.formValues})};o(),setTimeout(()=>{o()},0)},xl=function(){let e=this.store.getState(),t=ee({state:e,props:this.props}),s=ie(t.fields||[]),{valid:r,errors:i}=$t(s,e.formValues);return this.store.setErrors({errors:i}),r||this.store.setReactiveMode(),this.render(),{valid:r,errors:i}},Sl=function(){let e=this.props?.defaultValues||{},t={};Object.keys(e).forEach(n=>{he(t,n,e[n])});let s=ee({state:{formValues:t},props:this.props}),r=ie(s.fields||[]),i={};for(let n of r){let o=ne(e,n.name);o!==void 0?he(i,n.name,o):he(i,n.name,Ps(n))}this.store.resetFormValues({defaultValues:i}),this.setValues(i)},Al=Object.freeze(Object.defineProperty({__proto__:null,getValues:wl,reset:Sl,setValues:_l,validate:xl},Symbol.toStringTag,{value:"Module"})),Br=3e3,kl=180,bt=new WeakMap,Ti=e=>{e&&(typeof e.componentDialogBodyHost?.replaceChildren=="function"&&e.componentDialogBodyHost.replaceChildren(),delete e.componentDialogBody)},El=e=>{let t=e.selectUiType();return t==="dropdown"||t==="formDialog"||t==="componentDialog"?null:e.selectConfig().mode==="confirm"?!1:null},fe=({store:e,render:t,globalUI:s,refs:r,emitResult:i=!1,result:n})=>{if(!e.selectIsOpen())return;let o=n!==void 0?n:El(e);Ti(r),e.closeAll(),t(),i&&s.emit("event",o)},Li=({store:e,render:t,globalUI:s,refs:r,error:i})=>{Ti(r),e.selectIsOpen()&&(e.closeAll(),t()),s.emit("error",i)},it=({store:e,render:t,globalUI:s,refs:r})=>{e.selectIsOpen()&&fe({store:e,render:t,globalUI:s,refs:r,emitResult:!0})},nt=(e,{rejectOnError:t=!1}={})=>new Promise((s,r)=>{let i=null,n=e.once("event",o=>{i?.(),s(o)});t&&(i=e.once("error",o=>{n?.(),r(o)}))}),$l=e=>{let t=bt.get(e);return t||(t=new Map,bt.set(e,t)),t},Cl=(e,t)=>{let s=bt.get(e),r=s?.get(t);r&&(clearTimeout(r.exitTimerId),clearTimeout(r.removeTimerId),s.delete(t))},Il=e=>{let t=bt.get(e);if(t){for(let s of t.values())clearTimeout(s.exitTimerId),clearTimeout(s.removeTimerId);t.clear()}},Ol=({store:e,render:t,globalUI:s},r)=>{Cl(s,r);let i=$l(s),n=setTimeout(()=>{e.setToastPhase?.({id:r,phase:"exiting"}),t()},Math.max(0,Br-kl)),o=setTimeout(()=>{i.delete(r),e.removeToast({id:r}),t()},Br);i.set(r,{exitTimerId:n,removeTimerId:o})},Tl=(e,t)=>{setTimeout(()=>{let{store:s,refs:r}=e;if(!s.selectIsOpen()||s.selectUiType()!=="formDialog")return;let i=s.selectFormDialogConfig?.();if(!i||i.key!==t||typeof i.mount!="function")return;let n=r.formDialog;n&&i.mount(n)},0)},Ll=(e,t)=>{setTimeout(()=>{let{store:s,refs:r,render:i,globalUI:n}=e;if(!s.selectIsOpen()||s.selectUiType()!=="componentDialog")return;let o=s.selectComponentDialogConfig?.();if(!o||o.key!==t)return;let l=r.componentDialogBodyHost;if(l)try{let p=document.createElement(o.component);Object.entries(o.props??{}).forEach(([a,c])=>{p[a]=c}),l.replaceChildren(p),r.componentDialogBody=p}catch(p){Li({store:s,render:i,globalUI:n,refs:r,error:p})}},0)},ls=(e,t)=>!e.selectIsOpen()||e.selectUiType()!=="componentDialog"?!1:e.selectComponentDialogConfig?.()?.key===t,Vl=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0})},Nl=e=>{let{store:t,render:s,globalUI:r,refs:i}=e,n=t.selectConfig().mode==="confirm"?!0:null;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0,result:n})},Rl=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0,result:!1})},jl=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0,result:null})},Dl=(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t._event,{index:l,item:p}=o.detail;fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:{index:l,item:p}})},Pl=(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;return it({store:s,render:r,globalUI:i,refs:n}),s.setAlertConfig(o),r(),nt(i)},Bl=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;return it({store:s,render:r,globalUI:i,refs:n}),s.setConfirmConfig(o),r(),nt(i)},zl=(e,t)=>{let{store:s,render:r,globalUI:i}=e;s.addToast(t),r();let n=s.selectToasts?.()??[],o=n[n.length-1]?.id;o&&Ol({store:s,render:r,globalUI:i},o)},Wl=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;return it({store:s,render:r,globalUI:i,refs:n}),s.setDropdownConfig(o),r(),nt(i)},Ml=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;it({store:s,render:r,globalUI:i,refs:n}),s.setFormDialogConfig(o),r();let l=s.selectFormDialogConfig?.().key;return Tl(e,l),nt(i)},Fl=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;it({store:s,render:r,globalUI:i,refs:n}),s.setComponentDialogConfig(o),r();let l=s.selectComponentDialogConfig?.().key;return Ll(e,l),nt(i,{rejectOnError:!0})},Kl=(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t._event?.detail??{};o.valid!==!1&&fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:o})},Ul=(e,t)=>{let{store:s,refs:r}=e,i=t._event?.detail??{},n=s.selectFormDialogConfig?.();typeof n?.onFieldEvent=="function"&&n.onFieldEvent({detail:i,formEl:r.formDialog??null})},Hl=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;Il(r);let n=(t.selectToasts?.().length??0)>0;if(n&&t.clearToasts(),t.selectIsOpen()){fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0});return}n&&s()},ql=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t._event,l=Number(o?.currentTarget?.dataset?.actionIndex),p=s.selectComponentDialogConfig?.(),a=p?.key,c=Number.isInteger(l)?p?.actions?.buttons?.[l]:null;if(c){if(c.role==="cancel"){fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:{actionId:c.id}});return}try{let d=n.componentDialogBody;if(!d||typeof d.validate!="function"||typeof d.getValues!="function")throw new Error(`component dialog body '${p?.component??"unknown"}' must implement validate() and getValues()`);if(c.validate){let f=await d.validate();if(!ls(s,a))return;if(!f||typeof f!="object"||typeof f.valid!="boolean")throw new Error("component dialog body validate() must return { valid, errors? }");if(f.valid===!1)return}let h=await d.getValues();if(!ls(s,a))return;fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:{actionId:c.id,values:h}})}catch(d){if(!ls(s,a))return;Li({store:s,render:r,globalUI:i,refs:n,error:d})}}},Yl=Object.freeze(Object.defineProperty({__proto__:null,handleCancel:Rl,handleCloseAll:Hl,handleComponentDialogAction:ql,handleConfirm:Nl,handleDialogClose:Vl,handleDropdownClose:jl,handleDropdownItemClick:Dl,handleFormAction:Kl,handleFormFieldEvent:Ul,handleShowAlert:Pl,handleShowComponentDialog:Fl,handleShowConfirm:Bl,handleShowDropdownMenu:Wl,handleShowFormDialog:Ml,handleShowToast:zl},Symbol.toStringTag,{value:"Module"})),Gl=new Set(["sm","md","lg","f"]),Jl=new Set(["sm","md","lg"]),Zl=new Set(["active","exiting"]),Xl=new Set(["top","bottom"]),Ql=new Set(["confirm","cancel"]),ep=Object.freeze([{id:"cancel",label:"Cancel",variant:"se",align:"left",role:"cancel"},{id:"confirm",label:"OK",variant:"pr",role:"confirm",validate:!0}]),gs=e=>!e||typeof e!="object"||Array.isArray(e)?{}:e,je=(e,t="md")=>Gl.has(e)?e:t,Vi=(e,t="sm")=>Jl.has(e)?e:t,Ni=(e,t="active")=>Zl.has(e)?e:t,Ri=(e,t="top")=>Xl.has(e)?e:t,zs=e=>{let t=(Array.isArray(e?.buttons)&&e.buttons.length>0?e.buttons:ep).map((s,r)=>{if(!s||typeof s!="object"||Array.isArray(s))throw new Error("component dialog buttons must be objects");if(typeof s.id!="string"||s.id.length===0)throw new Error("component dialog button id is required");if(typeof s.label!="string"||s.label.length===0)throw new Error("component dialog button label is required");if(!Ql.has(s.role))throw new Error("component dialog button role must be 'confirm' or 'cancel'");return{...s,_globalIdx:r,variant:s.variant??(s.role==="confirm"?"pr":"se"),align:s.align??(s.role==="cancel"?"left":"right"),validate:s.role==="confirm"?!!s.validate:!1,_disabled:!!s.disabled,pre:s.pre??"",suf:s.suf??""}});return{_layout:"split",buttons:t,_leftButtons:t.filter(s=>s.align==="left"),_rightButtons:t.filter(s=>s.align!=="left")}},ji=()=>({title:"",description:"",size:"md",component:"",props:{},actions:zs(),key:0}),tp=()=>Object.freeze({isOpen:!1,uiType:"dialog",nextToastId:0,toasts:[],config:{status:void 0,title:"",message:"",confirmText:"OK",cancelText:"Cancel",mode:"alert"},dropdownConfig:{items:[],x:0,y:0,place:"bs"},formDialogConfig:{form:null,defaultValues:{},context:{},disabled:!1,size:"md",key:0,onFieldEvent:null,mount:null},componentDialogConfig:ji()}),sp=({state:e},t={})=>{if(!t.message)throw new Error("message is required for showAlert");e.config={status:t.status??void 0,title:t.title??"",message:t.message,confirmText:t.confirmText??"OK",cancelText:"",mode:"alert"},e.uiType="dialog",e.isOpen=!0},rp=({state:e},t={})=>{if(!t.message)throw new Error("message is required for showConfirm");e.config={status:t.status??void 0,title:t.title??"",message:t.message,confirmText:t.confirmText??"Yes",cancelText:t.cancelText??"Cancel",mode:"confirm"},e.uiType="dialog",e.isOpen=!0},ip=({state:e},t={})=>{if(!t.items||!Array.isArray(t.items))throw new Error("items array is required for showDropdown");e.dropdownConfig={items:t.items,x:t.x??0,y:t.y??0,place:t.place??"bs"},e.uiType="dropdown",e.isOpen=!0},np=({state:e},t={})=>{if(!t.form||typeof t.form!="object"||Array.isArray(t.form))throw new Error("form object is required for showFormDialog");let s=e.formDialogConfig?.key??0;e.formDialogConfig={form:t.form,defaultValues:gs(t.defaultValues),context:gs(t.context),disabled:!!t.disabled,size:je(t.size,"md"),key:s+1,onFieldEvent:typeof t.onFieldEvent=="function"?t.onFieldEvent:null,mount:typeof t.mount=="function"?t.mount:null},e.uiType="formDialog",e.isOpen=!0},op=({state:e},t={})=>{if(typeof t.component!="string"||!t.component.includes("-"))throw new Error("component tag name is required for showComponentDialog");let s=e.componentDialogConfig?.key??0;e.componentDialogConfig={title:typeof t.title=="string"?t.title:"",description:typeof t.description=="string"?t.description:"",size:je(t.size,"md"),component:t.component,props:gs(t.props),actions:zs(t.actions),key:s+1},e.uiType="componentDialog",e.isOpen=!0},ap=({state:e},t={})=>{if(typeof t.message!="string"||t.message.length===0)throw new Error("message is required for showToast");let s=(e.nextToastId??0)+1,r={id:`toast-${s}`,message:t.message,size:Vi(t.size??t.s,"sm"),position:Ri(t.position,"top"),phase:"active"};e.nextToastId=s,e.toasts=[...e.toasts??[],r]},lp=({state:e},t={})=>{typeof t.id!="string"||t.id.length===0||(e.toasts=(e.toasts??[]).filter(s=>s.id!==t.id))},pp=({state:e},t={})=>{typeof t.id!="string"||t.id.length===0||(e.toasts=(e.toasts??[]).map(s=>s.id!==t.id?s:{...s,phase:Ni(t.phase,"active")}))},dp=({state:e})=>{e.toasts=[]},cp=({state:e})=>{e.isOpen=!1,e.uiType="dialog"},up=({state:e})=>e.config,hp=({state:e})=>e.dropdownConfig,fp=({state:e})=>e.formDialogConfig,yp=({state:e})=>e.componentDialogConfig,mp=({state:e})=>e.uiType,gp=({state:e})=>e.isOpen,bp=({state:e})=>e.toasts??[],vp=({state:e})=>{let t=e.isOpen&&e.uiType==="dialog",s=e.isOpen&&e.uiType==="formDialog",r=e.isOpen&&e.uiType==="componentDialog",i=e.componentDialogConfig??ji(),n=Array.isArray(e.toasts)?e.toasts.map(o=>({...o,size:Vi(o.size,"sm"),position:Ri(o.position,"top"),phase:Ni(o.phase,"active")})):[];return{isOpen:e.isOpen,uiType:e.uiType,config:e.config,dropdownConfig:{items:e.dropdownConfig?.items??[],x:e.dropdownConfig?.x??0,y:e.dropdownConfig?.y??0,place:e.dropdownConfig?.place??"bs"},formDialogConfig:{form:e.formDialogConfig?.form??{fields:[],actions:{buttons:[]}},defaultValues:e.formDialogConfig?.defaultValues??{},context:e.formDialogConfig?.context??{},disabled:!!e.formDialogConfig?.disabled,size:je(e.formDialogConfig?.size,"md"),key:e.formDialogConfig?.key??0},componentDialogConfig:{title:i.title??"",description:i.description??"",size:je(i.size,"md"),component:i.component??"",props:i.props??{},actions:i.actions??zs(),key:i.key??0},toasts:n,topToasts:n.filter(o=>o.position==="top"),bottomToasts:n.filter(o=>o.position==="bottom"),isDialogOpen:t,isFormDialogOpen:s,isComponentDialogOpen:r,isDialogContainerOpen:t||s||r,isDropdownOpen:e.isOpen&&e.uiType==="dropdown",dialogSize:r?je(i.size,"md"):s?je(e.formDialogConfig?.size,"md"):"sm"}},wp=Object.freeze(Object.defineProperty({__proto__:null,addToast:ap,clearToasts:dp,closeAll:cp,createInitialState:tp,removeToast:lp,selectComponentDialogConfig:yp,selectConfig:up,selectDropdownConfig:hp,selectFormDialogConfig:fp,selectIsOpen:gp,selectToasts:bp,selectUiType:mp,selectViewData:vp,setAlertConfig:sp,setComponentDialogConfig:op,setConfirmConfig:rp,setDropdownConfig:ip,setFormDialogConfig:np,setToastPhase:pp},Symbol.toStringTag,{value:"Module"})),_p=(e,t)=>{let{dispatchEvent:s,store:r}=e;t._event,console.log("handle click start",r.selectPath()),s(new CustomEvent("start-click",{detail:{path:r.selectPath()}}))},xp=Object.freeze(Object.defineProperty({__proto__:null,handleClickStart:_p},Symbol.toStringTag,{value:"Module"})),Sp=()=>Object.freeze({}),Ap=["id","class","style","slot","start"],kp=(e={})=>Object.entries(e).filter(([t])=>!Ap.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Ep=e=>{if(e!=null){if(typeof e=="object")return e;if(typeof e=="string")try{return JSON.parse(decodeURIComponent(e))}catch{try{return JSON.parse(e)}catch{return}}}},$p=({props:e})=>{let t=Ep(e.start)||e.start;return{containerAttrString:kp(e),start:t||{label:"",image:{src:"",width:32,height:32,alt:""}}}},Cp=({props:e})=>e.start?.path,Ip=({state:e})=>{},Op=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Sp,selectPath:Cp,selectViewData:$p,setState:Ip},Symbol.toStringTag,{value:"Module"})),zr=e=>{let t=e.querySelectorAll("h1[id], h2[id], h3[id], h4[id], rtgl-text[id]");return Array.from(t)},Tp=e=>e.map(t=>{let s=1,r=t.tagName.toLowerCase();return r==="h1"?s=1:r==="h2"?s=2:r==="h3"?s=3:r==="h4"?s=4:r==="rtgl-text"&&(s=parseInt(t.getAttribute("data-level")||"1",10)),{id:t.id,href:`#${t.id}`,title:t.textContent,level:s}}),Wr=(e,t,s)=>{let{store:r,render:i}=s,n,o=-1/0;if(e.forEach(l=>{let p=l.getBoundingClientRect();p.top<=t&&p.top>o&&(o=p.top,n=l.id)}),!n){let l=1/0;e.forEach(p=>{let a=p.getBoundingClientRect();a.top>t&&a.top<l&&(l=a.top,n=p.id)})}n&&n!==r.selectCurrentId()&&(r.setCurrentId({id:n}),i())},Lp=(e,t,s,r)=>{let{store:i,render:n}=r,o=null,l=()=>{o=null;let d=zr(e);i.setItems({items:Tp(d)}),Wr(d,s,r),n()},p=()=>{o===null&&(o=requestAnimationFrame(l))},a=()=>{Wr(zr(e),s,r)};p(),t.addEventListener("scroll",a,{passive:!0});let c=new MutationObserver(()=>{p()});return c.observe(e,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["id","data-level"]}),()=>{o!==null&&cancelAnimationFrame(o),c.disconnect(),t.removeEventListener("scroll",a)}},Vp=e=>{let{props:t}=e,s=()=>{};return requestAnimationFrame(()=>{let r=document.getElementById(t.targetId);if(!r)return;let i=window;t.scrollContainerId&&(i=document.getElementById(t.scrollContainerId)||window);let n=parseInt(t.offsetTop||"100",10);s=Lp(r,i,n,e)}),()=>{s()}},Np=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Vp},Symbol.toStringTag,{value:"Module"})),Rp=()=>Object.freeze({items:[],currentId:null,contentContainer:null}),jp=({state:e})=>{let t=((s,r)=>{let i=new Set,n=s.findIndex(l=>l.id===r);if(n===-1)return i;let o=s[n].level;for(let l=n-1;l>=0;l--)if(s[l].level<o){let p=s[l].level;i.add(s[l].id);for(let a=l-1;a>=0;a--)s[a].level<p&&(i.add(s[a].id),p=s[a].level);break}return i})(e.items,e.currentId);return{items:e.items.map(s=>{let r={1:"0",2:"12px",3:"24px",4:"32px"},i=s.id===e.currentId,n=t.has(s.id),o=i||n;return{...s,c:o?"fg":"mu-fg",ml:r[s.level]||"",bc:o?"fg":"mu-fg"}}),currentId:e.currentId}},Dp=({state:e})=>e,Pp=({state:e})=>e.currentId,Bp=({state:e},t={})=>{e.items=Array.isArray(t.items)?t.items:[]},zp=({state:e},t={})=>{e.currentId=t.id},Wp=({state:e},t={})=>{e.contentContainer=t.container},Mp=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Rp,selectCurrentId:Pp,selectState:Dp,selectViewData:jp,setContentContainer:Wp,setCurrentId:zp,setItems:Bp},Symbol.toStringTag,{value:"Module"})),ot=e=>e==null||e===!0?"":String(e),Di=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=ot(t);s.setValue({value:n}),s.closePopover({}),i(new CustomEvent("value-change",{detail:{value:n},bubbles:!0})),r()},Fp=e=>{let{store:t,props:s}=e;if(s.value!==void 0){let r=ot(s.value);t.setValue({value:r}),t.setTempValue({value:r})}},Kp=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n}=e;if(s?.value!==r?.value){let o=ot(r?.value);i.setValue({value:o}),i.getState().isOpen||i.setTempValue({value:o})}n()},Up=(e,t)=>{let{store:s,render:r,refs:i,props:n}=e;if(n.disabled)return;let o=t._event,l=ot(n.value);s.setValue({value:l}),s.setTempValue({value:l}),s.openPopover({position:{x:o.currentTarget.getBoundingClientRect().left,y:o.currentTarget.getBoundingClientRect().bottom}}),r(),setTimeout(()=>{let{input:p}=i;if(!p)return;p.value=l,p.focus();let a=p.shadowRoot?.querySelector("input, textarea");a&&typeof a.focus=="function"&&a.focus()},50)},Hp=(e,t)=>{let{store:s,render:r}=e;s.closePopover({}),r()},qp=(e,t)=>{let{store:s}=e,r=t._event,i=ot(r.detail.value);s.setTempValue({value:i})},Yp=e=>{let{store:t,refs:s}=e,{input:r}=s,i=r?r.value:t.getState().tempValue;Di(e,i)},Gp=(e,t)=>{let{store:s,refs:r}=e,i=t._event;if(i.key==="Enter"){i.preventDefault(),i.stopPropagation();let{input:n}=r,o=n?n.value:s.getState().tempValue;Di(e,o)}else i.key==="Escape"&&(i.preventDefault(),i.stopPropagation(),s.closePopover({}),e.render())},Jp=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Fp,handleInputChange:qp,handleInputKeydown:Gp,handleOnUpdate:Kp,handlePopoverClose:Hp,handleSubmitClick:Yp,handleTextClick:Up},Symbol.toStringTag,{value:"Module"})),Zp=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),Xp=({props:e,state:t})=>{let s=typeof t.value=="string"&&t.value.length>0,r=s?t.value:"-",i=typeof e.placeholder=="string"?e.placeholder:"",n=typeof e.label=="string"?e.label:"",o=!!e.disabled;return{isOpen:t.isOpen,position:t.position,value:r,valueColor:s?"fg":"mu-fg",tempValue:t.tempValue,placeholder:i,label:n,disabled:o}},Qp=({state:e},t={})=>{e.tempValue=t.value},ed=({state:e},t={})=>{let{position:s}=t;e.position=s,e.isOpen=!0,e.hasUnsavedChanges=!1},td=({state:e})=>{e.isOpen=!1,e.tempValue=""},sd=({state:e},t={})=>{e.value=t.value},rd=({state:e})=>e.value,id=Object.freeze(Object.defineProperty({__proto__:null,closePopover:td,createInitialState:Zp,openPopover:ed,selectValue:rd,selectViewData:Xp,setTempValue:Qp,setValue:sd},Symbol.toStringTag,{value:"Module"})),le=(e,t)=>{if(e===t)return!0;if(e==null||t==null||typeof e!="object"||typeof t!="object")return!1;let s=Object.keys(e),r=Object.keys(t);if(s.length!==r.length)return!1;for(let i of s)if(!r.includes(i)||!le(e[i],t[i]))return!1;return!0},Mr=({dispatchEvent:e,value:t,label:s,index:r,item:i})=>{e(new CustomEvent("value-change",{detail:{value:t,label:s,index:r,item:i},bubbles:!0}))},nd=e=>{let{store:t,props:s,render:r}=e;if(s.selectedValue!==null&&s.selectedValue!==void 0&&s.options){let i=s.options.find(n=>le(n.value,s.selectedValue));i&&(t.updateSelectedValue({value:i.value}),r())}},od=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n}=e,o=!1;s.selectedValue!==r.selectedValue&&(i.updateSelectedValue({value:r.selectedValue}),o=!0),o&&n()},Pi=(e,t)=>{let{render:s,dispatchEvent:r,props:i,store:n}=e;if(i.disabled)return;let o=t._event;o.stopPropagation();let l=o.currentTarget.id.slice(6),p=Number(l),a=i.options[p],c=Object.prototype.hasOwnProperty.call(i||{},"selectedValue"),d=n.selectSelectedValue(),h=c?!0:n.selectHasSelectedValue(),f=a?h&&le(a.value,d):!1;if(a){if(f&&!i.noClear){n.clearSelectedValue({}),i.onChange&&typeof i.onChange=="function"&&i.onChange(void 0),Mr({dispatchEvent:r,value:void 0,label:void 0,index:null,item:void 0}),s();return}n.updateSelectedValue({value:a.value}),i.onChange&&typeof i.onChange=="function"&&i.onChange(a.value),Mr({dispatchEvent:r,value:a.value,label:a.label,index:p,item:a}),s()}},ad=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Pi(e,t))},ld=(e,t)=>{let{store:s,render:r}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(6),10);s.setHoveredOption({optionId:n}),r()},pd=e=>{let{store:t,render:s}=e;t.clearHoveredOption({}),s()},Bi=(e,t)=>{if(e.props.disabled)return;let{render:s,dispatchEvent:r}=e,{_event:i}=t;i.stopPropagation(),r(new CustomEvent("add-option-click",{bubbles:!0})),s()},dd=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Bi(e,t))},cd=e=>{let{store:t,render:s}=e;t.setHoveredAddOption({isHovered:!0}),s()},ud=e=>{let{store:t,render:s}=e;t.setHoveredAddOption({isHovered:!1}),s()},hd=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:Bi,handleAddOptionKeyDown:dd,handleAddOptionMouseEnter:cd,handleAddOptionMouseLeave:ud,handleBeforeMount:nd,handleOnUpdate:od,handleOptionClick:Pi,handleOptionKeyDown:ad,handleOptionMouseEnter:ld,handleOptionMouseLeave:pd},Symbol.toStringTag,{value:"Module"})),fd=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],yd=(e={})=>Object.entries(e).filter(([t])=>!fd.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),md=()=>Object.freeze({selectedValue:null,hasSelectedValue:!1,hoveredOptionId:null,hoveredAddOption:!1}),gd=({state:e,props:t})=>{let s=yd(t),r=!!t.disabled,i=Object.prototype.hasOwnProperty.call(t||{},"selectedValue"),n=i?t.selectedValue:e.selectedValue,o=i?!0:!!e.hasSelectedValue,l=t.options||[],p=l.map((a,c)=>{let d=o&&le(a.value,n),h=e.hoveredOptionId===c;return{...a,isSelected:d,bgc:d?"ac":h&&!r?"mu":"",textColor:d?"ac-fg":"fg",borderLeftWidth:c===0?"none":"xs",cursor:r?"not-allowed":"pointer",tabIndex:r?-1:0}});return{containerAttrString:s,isDisabled:r,options:p,selectedValue:n,hasSelectedValue:o,ariaLabel:t.placeholder||"Segmented control",showAddOption:!r&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"mu":"",addOptionBorderLeftWidth:l.length===0?"none":"xs"}},bd=({state:e})=>e,vd=({state:e})=>e.selectedValue,wd=({state:e})=>!!e.hasSelectedValue,_d=({state:e},t={})=>{e.selectedValue=t.value,e.hasSelectedValue=!0},xd=({state:e})=>{e.selectedValue=void 0,e.hasSelectedValue=!1},Sd=({state:e},t={})=>{e.hoveredOptionId=t.optionId},Ad=({state:e})=>{e.hoveredOptionId=null},kd=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},Ed=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:Ad,clearSelectedValue:xd,createInitialState:md,selectHasSelectedValue:wd,selectSelectedValue:vd,selectState:bd,selectViewData:gd,setHoveredAddOption:kd,setHoveredOption:Sd,updateSelectedValue:_d},Symbol.toStringTag,{value:"Module"})),Ws=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",$d=e=>{let{store:t,props:s,render:r}=e;if(s.selectedValue!==null&&s.selectedValue!==void 0&&s.options){let i=s.options.find(n=>Ws(n)==="item"&&le(n.value,s.selectedValue));i&&(t.updateSelectedValue({value:i?.value}),r())}},Cd=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n,refs:o}=e,l=!1,p=!1;r?.disabled&&!s?.disabled&&(i.closeOptionsPopover({}),l=!0),s.selectedValue!==r.selectedValue&&(i.updateSelectedValue({value:r.selectedValue}),l=!0),s.options!==r.options&&(l=!0,p=!0),l&&(n(),p&&i.selectState?.().isOpen&&o?.popover?.refreshContent?.())},zi=(e,t)=>{let{store:s,render:r,refs:i,props:n}=e;if(n.disabled)return;t._event.stopPropagation();let o=i.selectButton.getBoundingClientRect(),l=s.selectSelectedValue(),p=l!==null?l:n.selectedValue,a=null;p!=null&&n.options&&(a=n.options.findIndex(c=>Ws(c)==="item"&&le(c.value,p)),a===-1&&(a=null)),s.openOptionsPopover({position:{y:o.bottom+12,x:o.left-24},selectedIndex:a}),r()},Id=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),zi(e,t))},Od=e=>{let{store:t,render:s}=e;t.closeOptionsPopover({}),s()},Td=(e,t)=>{let{render:s,dispatchEvent:r,props:i,store:n}=e;if(i.disabled)return;let o=t._event;o.stopPropagation();let l=o.currentTarget.id.slice(6),p=Number(l),a=i.options[l];Ws(a)==="item"&&(n.updateSelectedValue({value:a?.value}),i.onChange&&typeof i.onChange=="function"&&i.onChange(a.value),r(new CustomEvent("value-change",{detail:{value:a.value,label:a.label,index:p,item:a},bubbles:!0})),s())},Ld=(e,t)=>{let{store:s,render:r}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(6),10);s.setHoveredOption({optionId:n}),r()},Vd=(e,t)=>{let{store:s,render:r}=e;s.clearHoveredOption({}),r()},Nd=(e,t)=>{let{store:s,render:r,dispatchEvent:i,props:n}=e;n.disabled||(t._event.stopPropagation(),s.clearSelectedValue({}),n.onChange&&typeof n.onChange=="function"&&n.onChange(void 0),i(new CustomEvent("value-change",{detail:{value:void 0,label:void 0,index:null,item:void 0},bubbles:!0})),r())},Rd=(e,t)=>{if(e.props.disabled)return;let{store:s,render:r,dispatchEvent:i}=e,{_event:n}=t;n.stopPropagation(),s.closeOptionsPopover({}),i(new CustomEvent("add-option-click",{bubbles:!0})),r()},jd=(e,t)=>{let{store:s,render:r}=e;s.setHoveredAddOption({isHovered:!0}),r()},Dd=(e,t)=>{let{store:s,render:r}=e;s.setHoveredAddOption({isHovered:!1}),r()},Pd=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:Rd,handleAddOptionMouseEnter:jd,handleAddOptionMouseLeave:Dd,handleBeforeMount:$d,handleButtonClick:zi,handleButtonKeyDown:Id,handleClearClick:Nd,handleClickOptionsPopoverOverlay:Od,handleOnUpdate:Cd,handleOptionClick:Td,handleOptionMouseEnter:Ld,handleOptionMouseLeave:Vd},Symbol.toStringTag,{value:"Module"})),Bd=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],zd=(e={})=>Object.entries(e).filter(([t])=>!Bd.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Wd=(e,t)=>Object.prototype.hasOwnProperty.call(e||{},t),Wi=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Fr=(e={})=>Wi(e)==="item",Md=(e={})=>typeof e.icon=="string"&&e.icon.length>0?e.icon:"",Fd=(e={})=>typeof e.shortcut=="string"&&e.shortcut.length>0?e.shortcut:typeof e.suffixText=="string"&&e.suffixText.length>0?e.suffixText:"",Kd=(e={},t,s,r,i)=>{let n=Wi(e),o=n==="section",l=n==="separator",p=n==="item";if(o)return{...e,index:t,type:n,isSection:o,isSeparator:l,isItem:p};if(l)return{...e,index:t,type:n,isSection:o,isSeparator:l,isItem:p};let a=le(e.value,s),c=r===t,d=Md(e),h=Fd(e);return{...e,index:t,type:n,isSection:o,isSeparator:l,isItem:p,isSelected:a,bgc:c?"ac":a?"mu":"",hasIconSlot:i,icon:d,hasIcon:d.length>0,iconColor:"fg",c:"fg",suffixText:h,hasSuffixText:h.length>0,suffixTextColor:"mu-fg"}},Ud=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,hoveredOptionId:null,hoveredAddOption:!1}),Hd=({state:e,props:t})=>{let s=zd(t),r=!!t.disabled,i=Object.prototype.hasOwnProperty.call(t||{},"selectedValue")?t.selectedValue:e.selectedValue,n=t.placeholder||"Select an option",o=!0,l=t.options||[],p=l.find(h=>Fr(h)&&le(h.value,i));p&&(n=p.label,o=!1);let a=l.some(h=>Fr(h)&&Wd(h,"icon")),c=l.map((h,f)=>Kd(h,f,i,e.hoveredOptionId,a)),d=c.find(h=>h.isItem&&h.isSelected);return{containerAttrString:s,isDisabled:r,isOpen:e.isOpen,position:e.position,options:c,selectedValue:i,selectedLabel:n,selectedLabelColor:o?"mu-fg":"fg",selectedIcon:d?.icon||"",hasSelectedIcon:!!d?.hasIcon,selectedIconColor:o?"mu-fg":"fg",selectedSuffixText:d?.suffixText||"",hasSelectedSuffixText:!!d?.hasSuffixText,selectedSuffixTextColor:"mu-fg",selectButtonCursor:r?"not-allowed":"pointer",selectButtonHoverBorderColor:r?"bo":"ac",selectButtonTabIndex:r?-1:0,hasValue:i!=null,showClear:!r&&!t.noClear&&i!=null,showAddOption:!r&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"ac":""}},qd=({state:e})=>e,Yd=({state:e})=>e.selectedValue,Gd=({state:e},t={})=>{let{position:s,selectedIndex:r}=t;e.position=s,e.isOpen=!0,r!=null&&(e.hoveredOptionId=r)},Jd=({state:e})=>{e.isOpen=!1},Zd=({state:e},t={})=>{e.selectedValue=t.value,e.isOpen=!1},Xd=({state:e})=>{e.selectedValue=void 0},Qd=({state:e},t={})=>{e.hoveredOptionId=t.optionId},ec=({state:e})=>{e.hoveredOptionId=null},tc=({state:e})=>{e.selectedValue=void 0},sc=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},rc=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:ec,clearSelectedValue:tc,closeOptionsPopover:Jd,createInitialState:Ud,openOptionsPopover:Gd,resetSelection:Xd,selectSelectedValue:Yd,selectState:qd,selectViewData:Hd,setHoveredAddOption:sc,setHoveredOption:Qd,updateSelectedValue:Zd},Symbol.toStringTag,{value:"Module"})),Kr=e=>{if(e===!0)return!0;if(e===!1||e===void 0||e===null)return!1;if(typeof e=="string"){let t=e.trim().toLowerCase();return t===""||t==="true"}return!1},ic=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?Kr(e.tooltip):Kr(e.showCompactTooltip),nc=(e,t)=>{let{store:s,dispatchEvent:r}=e,i=t._event,n,o=s.selectHeader();i.currentTarget.id==="headerLabel"?n=o.labelPath:i.currentTarget.id==="headerImage"?n=o.image.path:i.currentTarget.id==="header"&&(n=o.path),r(new CustomEvent("header-click",{detail:{path:n},bubbles:!0,composed:!0}))},oc=(e,t)=>{let{store:s,dispatchEvent:r,render:i}=e,n=t._event,o=n.currentTarget.dataset.itemId||n.currentTarget.id.slice(4),l=s.selectItem(o);s.hideTooltip({}),i(),r(new CustomEvent("item-click",{detail:{item:l},bubbles:!0,composed:!0}))},ac=(e,t)=>{let{props:s,store:r,render:i}=e;if(!ic(s)||(s.mode||"full")==="full")return;let n=t._event,o=n.currentTarget.dataset.itemId||n.currentTarget.id.slice(4),l=r.selectItem(o);if(!l||l.type==="groupLabel")return;let p=n.currentTarget.getBoundingClientRect(),a=l.tooltip||l.label||l.title;a&&(r.showTooltip({x:p.right,y:p.top+p.height/2,place:"r",content:a}),i())},lc=e=>{let{store:t,render:s}=e;t.hideTooltip({}),s()},pc=Object.freeze(Object.defineProperty({__proto__:null,handleHeaderClick:nc,handleItemClick:oc,handleItemMouseEnter:ac,handleItemMouseLeave:lc},Symbol.toStringTag,{value:"Module"})),dc=()=>Object.freeze({tooltipState:{open:!1,x:0,y:0,place:"r",content:""}}),cc=["id","class","style","slot","header","items","selectedItemId","mode","hideHeader","tooltip","showCompactTooltip","w","bwr"],uc=(e={})=>Object.entries(e).filter(([t])=>!cc.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Xe=e=>{if(e!=null){if(typeof e=="object")return e;if(typeof e=="string")try{return JSON.parse(decodeURIComponent(e))}catch{try{return JSON.parse(e)}catch{return}}}},bs=e=>{if(e===!0)return!0;if(e===!1||e===void 0||e===null)return!1;if(typeof e=="string"){let t=e.trim().toLowerCase();return t===""||t==="true"}return!1},hc=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?bs(e.tooltip):bs(e.showCompactTooltip),fc=(e,t)=>e!=null&&e!==""?e:t==="full"?272:64,Ur=(e={})=>e.label!==void 0&&e.label!==null?e.label:e.title!==void 0&&e.title!==null?e.title:"";function Ms(e,t=null){let s=[];for(let r of e){let i=r.id||r.href||r.path,n=i!=null&&t===i,o=Ur(r);if(s.push({id:i,label:o,title:r.title??o,href:r.href,type:r.type||"item",icon:r.icon,testId:r.testId,tooltip:r.tooltip,path:r.path,hrefAttr:r.href?`href=${r.href}`:"",isSelected:n,itemBgc:n?"ac":"bg",itemHoverBgc:n?"ac":"mu"}),r.items&&Array.isArray(r.items))for(let l of r.items){let p=l.id||l.href||l.path,a=p!=null&&t===p,c=Ur(l);s.push({id:p,label:c,title:l.title??c,href:l.href,type:l.type||"item",icon:l.icon,testId:l.testId,tooltip:l.tooltip,path:l.path,hrefAttr:l.href?`href=${l.href}`:"",isSelected:a,itemBgc:a?"ac":"bg",itemHoverBgc:a?"ac":"mu"})}}return s}var yc=({state:e,props:t})=>{let s=Xe(t.header)||t.header,r=Xe(t.items)||t.items,i=t.selectedItemId,n=uc(t),o=t.mode||"full",l=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},p=r?Ms(r,i):[],a=!bs(t.hideHeader),c=hc(t),d=t.bwr||"xs",h=fc(t.w,o),f=o==="full"?"fs":"c",u=o==="full"?"fs":"c",y=o==="full"?"lg":"sm",m=o==="full"?"md":"sm",b=o==="shrunk-lg"?48:40,g=o==="shrunk-lg"?28:20,_=o==="shrunk-lg"?"md":"sm",S=o==="full",A=o==="full",k=c&&!S,C=o==="full"?"fs":"c",I=o==="full"?"":`ah=${u}`,V=o==="full"?"f":b;return{containerAttrString:n,mode:o,header:l,items:p,sidebarWidth:h,headerAlign:f,itemAlign:u,headerPadding:y,itemPadding:m,itemHeight:b,iconSize:g,firstLetterSize:_,showLabels:S,showGroupLabels:A,itemContentAlign:C,itemAlignAttr:I,itemWidth:V,headerWidth:V,selectedItemId:i,ah:o==="shrunk-lg"||o==="shrunk-md"?"c":"",listAttrString:o==="full"?"d=v sv":"d=v sv hsb",showHeader:a,enableCompactTooltip:k,rightBorderWidth:d,tooltipState:e.tooltipState||{open:!1,x:0,y:0,place:"r",content:""}}},mc=({props:e})=>Xe(e.header)||e.header,gc=({state:e,props:t})=>{let s=Xe(t.items)||t.items;return(s?Ms(s):[]).find(r=>r.active)},bc=({props:e},t)=>{let s=Xe(e.items)||e.items;return(s?Ms(s):[]).find(r=>r.id===t)},vc=({state:e})=>{},wc=({state:e},t={})=>{let{x:s,y:r,place:i="r",content:n=""}=t;e.tooltipState={open:!0,x:s,y:r,place:i,content:n}},_c=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},xc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:dc,hideTooltip:_c,selectActiveItem:gc,selectHeader:mc,selectItem:bc,selectViewData:yc,setState:vc,showTooltip:wc},Symbol.toStringTag,{value:"Module"})),Sc=e=>{let{store:t,props:s}=e;t.setValue({value:s.value??0})},Ac=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n}=e,o=s?.key!==r?.key,l=s?.value!==r?.value;if(o||l){let p=r?.value??0;i.setValue({value:p}),n()}},kc=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=t._event,o=Number(n.detail.value),l=(typeof n.composedPath=="function"?n.composedPath():[]).find(p=>p?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;s.setValue({value:o}),l&&typeof l.setAttribute=="function"&&l.setAttribute("value",String(o)),r(),i(new CustomEvent("value-change",{detail:{value:o},bubbles:!0}))},Ec=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=t._event,o=Number(n.detail.value),l=(typeof n.composedPath=="function"?n.composedPath():[]).find(p=>p?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;s.setValue({value:o}),l&&typeof l.setAttribute=="function"&&l.setAttribute("value",String(o)),r(),i(new CustomEvent("value-input",{detail:{value:o},bubbles:!0}))},$c=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Sc,handleOnUpdate:Ac,handleValueChange:kc,handleValueInput:Ec},Symbol.toStringTag,{value:"Module"})),Cc=()=>Object.freeze({value:0}),Ic=({state:e,props:t})=>({key:t.key,value:e.value,w:t.w||"",min:t.min||0,max:t.max||100,step:t.step||1,disabled:!!t.disabled}),Oc=({state:e},t={})=>{e.value=t.value},Tc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Cc,selectViewData:Ic,setValue:Oc},Symbol.toStringTag,{value:"Module"})),Lc=e=>{},Vc=(e,t)=>{let{dispatchEvent:s,props:r}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(3),10),o=r.data?.rows?.[n];o&&s(new CustomEvent("row-click",{detail:{rowIndex:n,rowData:o}}))},Nc=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=t._event.currentTarget.dataset.columnKey,o=s.selectSortInfo(),l="asc";o.column===n&&(o.direction==="asc"?l="desc":o.direction==="desc"&&(l=null)),l?s.setSortColumn({column:n,direction:l}):s.clearSort(),r(),i(new CustomEvent("header-click",{detail:{column:n,direction:l,sortInfo:l?{column:n,direction:l}:null}}))},Rc=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Lc,handleHeaderClick:Nc,handleRowClick:Vc},Symbol.toStringTag,{value:"Module"})),jc=()=>Object.freeze({sortColumn:null,sortDirection:null}),Dc=["id","class","style","slot","data"],Pc=(e={})=>Object.entries(e).filter(([t])=>!Dc.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Bc=(e,t)=>{let s=t.split("."),r=e;for(let i of s){if(r==null)return null;r=r[i]}return r},zc=({state:e,props:t})=>{let s=Pc(t),r=t.data||{columns:[],rows:[]},i=r.rows.map((n,o)=>{let l=r.columns.map(p=>{let a=Bc(n,p.key);return{key:p.key,value:a!=null?String(a):""}});return{index:o,cells:l}});return{containerAttrString:s,columns:r.columns||[],rows:i||[]}},Wc=({state:e})=>e,Mc=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),Fc=({state:e},{column:t,direction:s}={})=>{e.sortColumn=t,e.sortDirection=s},Kc=({state:e})=>{e.sortColumn=null,e.sortDirection=null},Uc=Object.freeze(Object.defineProperty({__proto__:null,clearSort:Kc,createInitialState:jc,selectSortInfo:Mc,selectState:Wc,selectViewData:zc,setSortColumn:Fc},Symbol.toStringTag,{value:"Module"})),Hc=(e,t)=>{let{dispatchEvent:s}=e,r=t._event.currentTarget.dataset.id;s(new CustomEvent("item-click",{detail:{id:r}}))},qc=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:Hc},Symbol.toStringTag,{value:"Module"})),Yc=()=>Object.freeze({}),Gc=["id","class","style","slot","items","selectedTab"],Jc=(e={})=>Object.entries(e).filter(([t])=>!Gc.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Zc=({props:e})=>{let t=Jc(e),s=e.items||[],r=e.selectedTab,i=s.map(n=>({...n,isSelected:n.id===r,bgColor:n.id===r?"ac":"",borderColor:n.id===r?"":"tr",textColor:n.id===r?"":"mu-fg"}));return{containerAttrString:t,items:i,selectedTab:r}},Xc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Yc,selectViewData:Zc},Symbol.toStringTag,{value:"Module"})),Qc=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Mi=e=>Array.isArray(e)?[...e]:[],Fi=e=>{if(!e||typeof e.getBoundingClientRect!="function")return;let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.bottom+12),w:Math.max(Math.round(t.width),240)}},vs=({store:e,props:t})=>e.selectHasSelectedValues()?e.selectSelectedValues():Mi(t.selectedValues),Ki=({store:e,props:t})=>Array.isArray(t?.draftSelectedValues)?Mi(t.draftSelectedValues):e.getState().isOpen?e.selectDraftSelectedValues():vs({store:e,props:t}),eu=({dispatchEvent:e,value:t,operation:s,changedValue:r,label:i,index:n,item:o})=>{e(new CustomEvent("value-change",{detail:{value:t,operation:s,changedValue:r,label:i,index:n,item:o},bubbles:!0}))},tu=({dispatchEvent:e,value:t})=>{e(new CustomEvent("draft-value-change",{detail:{value:t},bubbles:!0}))},Pe=({dispatchEvent:e,open:t})=>{e(new CustomEvent("open-change",{detail:{open:t},bubbles:!0}))},Fs=({store:e,props:t,refs:s}={})=>{let r=Fi(s?.trigger);return r?(e.openOptionsPopover({position:r,values:Ki({store:e,props:t})}),!0):!1},su=e=>{let{store:t,props:s,render:r,refs:i}=e,n=!1;s.selectedValues!==void 0&&(t.updateSelectedValues({values:s.selectedValues,syncDraft:s.draftSelectedValues===void 0,preserveDraft:Array.isArray(s.draftSelectedValues)}),n=!0),Array.isArray(s.draftSelectedValues)&&(t.updateDraftSelectedValues({values:s.draftSelectedValues}),n=!0),s.open===!0&&!s.disabled&&Fs(e)&&(n=!0),n&&r()},ru=e=>{let{props:t,render:s,store:r,dispatchEvent:i}=e;if(t.disabled){t.open===!0&&Pe({dispatchEvent:i,open:!1});return}t.open===!0&&!r.getState().isOpen&&Fs(e)&&s()},iu=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n,refs:o}=e,l=!1;if(r?.disabled&&!s?.disabled){let p=i.getState().isOpen;i.closeOptionsPopover({}),p&&Pe({dispatchEvent:e.dispatchEvent,open:!1}),l=!0}if(s.selectedValues!==r.selectedValues&&(i.updateSelectedValues({values:r.selectedValues,syncDraft:r.draftSelectedValues===void 0,preserveDraft:Array.isArray(r.draftSelectedValues)}),l=!0),s.draftSelectedValues!==r.draftSelectedValues&&(i.updateDraftSelectedValues({values:Array.isArray(r?.draftSelectedValues)?r.draftSelectedValues:vs({store:i,props:r})}),l=!0),s.open!==r.open&&r.open!==void 0&&(r.open?r.disabled?Pe({dispatchEvent:e.dispatchEvent,open:!1}):Fs({store:i,props:r,refs:o})&&(l=!0):(i.closeOptionsPopover({}),l=!0)),s.options!==r.options){let p=vs({store:i,props:r}).length>0;(i.getState().isOpen||p)&&(l=!0)}l&&n()},Ui=(e,t)=>{let{store:s,render:r,refs:i,props:n,dispatchEvent:o}=e;if(n.disabled)return;t._event.stopPropagation();let l=Fi(i.trigger);l&&(s.openOptionsPopover({position:l,values:Ki({store:s,props:n})}),Pe({dispatchEvent:o,open:!0}),r())},nu=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Ui(e,t))},ou=e=>{let{store:t,render:s,dispatchEvent:r}=e;t.closeOptionsPopover({}),Pe({dispatchEvent:r,open:!1}),s()},Hi=(e,t)=>{let{render:s,props:r,store:i,dispatchEvent:n}=e;if(r.disabled)return;let o=t._event;o.stopPropagation();let l=o.currentTarget.id.slice(6),p=Number(l),a=r.options[p];!a||Qc(a)!=="item"||(i.toggleDraftSelectedValue({value:a.value}),tu({dispatchEvent:n,value:i.selectDraftSelectedValues()}),s())},au=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Hi(e,t))},lu=(e,t)=>{let{store:s,props:r,render:i,dispatchEvent:n}=e;if(r.disabled)return;t._event.stopPropagation();let o=s.selectDraftSelectedValues();s.commitDraftSelectedValues({}),r.onChange&&typeof r.onChange=="function"&&r.onChange(o),eu({dispatchEvent:n,value:o,operation:"set",changedValue:void 0,label:void 0,index:null,item:void 0}),Pe({dispatchEvent:n,open:!1}),i()},pu=(e,t)=>{let{props:s,dispatchEvent:r}=e;s.disabled||s.noAdd||(t._event.stopPropagation(),r(new CustomEvent("add-option-click",{bubbles:!0,composed:!0})))},du=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:pu,handleAfterMount:ru,handleBeforeMount:su,handleOnUpdate:iu,handleOptionClick:Hi,handleOptionKeyDown:au,handlePopoverClose:ou,handleSubmitClick:lu,handleTriggerClick:Ui,handleTriggerKeyDown:nu},Symbol.toStringTag,{value:"Module"})),qi=e=>{if(!e||typeof e.getBoundingClientRect!="function")return null;let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.bottom+12),w:Math.max(Math.round(t.width),240)}},Ct=e=>Array.isArray(e)?[...e]:[],vt=e=>{typeof e.render=="function"&&e.render()},Yi=e=>e.store?.selectHasSelectedValues?.()?e.store?.selectSelectedValues?.()||[]:Ct(e.props?.selectedValues),Ks=(e,t=[])=>{let s=qi(e.refs?.trigger);return!s||!e.store?.openOptionsPopover?!1:(e.store.openOptionsPopover({position:s,values:t}),!0)},Gi=(e,t=[],s=!1)=>e.store?.getState?.()?.isOpen&&e.store?.updateDraftSelectedValues?(e.store.updateDraftSelectedValues({values:t}),!0):s?Ks(e,t):!1,cu=function(e={}){let t=this.store?.getState?.(),s=Array.isArray(e.values)?Ct(e.values):this.store?.selectDraftSelectedValues?.()||[];if(t?.isOpen){let r=qi(this.refs?.trigger);r&&this.store.openOptionsPopover({position:r,values:s})}else e.keepOpen&&Ks(this,s.length>0?s:Yi(this));vt(this)},uu=function(e={}){let t=Ct(e.values);Gi(this,t,!!e.keepOpen)&&vt(this)},hu=function(e={}){if(!Object.prototype.hasOwnProperty.call(e||{},"value"))return;let t=this.store?.getState?.(),s=t?.isOpen?this.store?.selectDraftSelectedValues?.()||[]:Yi(this);if(s.some(i=>le(i,e.value))){e.keepOpen&&!t?.isOpen&&Ks(this,s)&&vt(this);return}let r=[...Ct(s),e.value];Gi(this,r,!!e.keepOpen)&&vt(this)},fu=Object.freeze(Object.defineProperty({__proto__:null,appendDraftSelectedValue:hu,refreshPopover:cu,setDraftSelectedValues:uu},Symbol.toStringTag,{value:"Module"})),yu=["id","class","style","slot","placeholder","options","open","selectedValues","draftSelectedValues","onChange","addOption","noAdd","disabled"],mu=(e={})=>Object.entries(e).filter(([t])=>!yu.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),gu=(e,t)=>Object.prototype.hasOwnProperty.call(e||{},t),Ji=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Zi=(e={})=>Ji(e)==="item",Xi=(e={})=>typeof e.icon=="string"&&e.icon.length>0?e.icon:"",bu=(e={})=>typeof e.shortcut=="string"&&e.shortcut.length>0?e.shortcut:typeof e.suffixText=="string"&&e.suffixText.length>0?e.suffixText:"",ye=e=>Array.isArray(e)?[...e]:[],vu=(e=[],t=[])=>e.length!==t.length?!1:e.every((s,r)=>le(s,t[r])),wu=(e=[],t)=>e.some(s=>le(s,t)),Qi=({state:e,props:t})=>e.hasSelectedValues?ye(e.selectedValues):ye(t.selectedValues),_u=({state:e,props:t})=>e.isOpen?ye(e.draftSelectedValues):Qi({state:e,props:t}),xu=e=>e==null?"":String(e),Su=(e=[],t)=>e.find(s=>Zi(s)&&le(s.value,t)),ws=({isSelected:e=!0,isAddChip:t=!1}={})=>{let s=["--tag-border-radius: var(--border-radius-md)","--muted-foreground: var(--foreground)"];return(t||!e)&&s.push("--muted: color-mix(in srgb, var(--muted) 82%, var(--background) 18%)"),`${s.join("; ")};`},Au=({option:e={},index:t,selectedValues:s=[],hasIconColumn:r=!1})=>{let i=Ji(e),n=i==="section",o=i==="separator",l=i==="item";if(n||o)return{...e,index:t,type:i,isSection:n,isSeparator:o,isItem:l};let p=wu(s,e.value),a=Xi(e),c=bu(e),d=p?c||"Added":c;return{...e,index:t,type:i,isSection:n,isSeparator:o,isItem:l,isSelected:p,hasIconSlot:r,icon:a,hasIcon:a.length>0,cursor:"pointer",tagStyle:ws({isSelected:p}),suffixText:d,hasSuffixText:d.length>0}},ku=()=>Object.freeze({isOpen:!1,position:{x:0,y:0,w:240},selectedValues:[],draftSelectedValues:[],hasSelectedValues:!1}),Eu=({state:e,props:t})=>{let s=mu(t),r=!!t.disabled,i=Qi({state:e,props:t}),n=_u({state:e,props:t}),o=(e.isOpen||i.length>0)&&Array.isArray(t.options)?t.options:[],l=o.some(f=>Zi(f)&&gu(f,"icon")),p=o.map((f,u)=>Au({option:f,index:u,selectedValues:n,hasIconColumn:l})),a=i.map((f,u)=>{let y=Su(o,f),m=y?Xi(y):"";return{value:f,selectionIndex:u,label:y?.label||xu(f),icon:m,hasIcon:m.length>0,testId:`tag-select-tag-${u}`}}),c=p.some(f=>f.isItem),d=!vu(i,n),h=a.length>0?a.map(f=>({...f,tagStyle:ws({isSelected:!0})})):[{value:void 0,selectionIndex:"",label:t.placeholder||"Add tag",icon:"",testId:"",tagStyle:ws({isAddChip:!0})}];return{containerAttrString:s,isDisabled:r,isOpen:e.isOpen,position:e.position,options:p,hasSelectableOptions:c,placeholder:t.placeholder||"Add tag",triggerTags:h,triggerCursor:r?"not-allowed":"pointer",triggerTabIndex:r?-1:0,showAddOption:!r&&!t.noAdd,addOptionLabel:t.addOption?.label||"Add tag",hasDraftChanges:d,submitDisabled:r,submitLabel:"Save"}},$u=({state:e})=>ye(e.selectedValues),Cu=({state:e})=>!!e.hasSelectedValues,Iu=({state:e})=>ye(e.draftSelectedValues),Ou=({state:e},t={})=>{let{position:s,values:r}=t;e.position={...e.position,...s||{}},e.draftSelectedValues=ye(r),e.isOpen=!0},Tu=({state:e})=>{e.isOpen=!1,e.draftSelectedValues=[]},Lu=({state:e},t={})=>{e.draftSelectedValues=ye(t.values)},Vu=({state:e},t={})=>{let s=ye(t.values);e.selectedValues=s,e.hasSelectedValues=!0,(t.syncDraft||!e.isOpen)&&!t.preserveDraft&&(e.draftSelectedValues=[...s])},Nu=({state:e},t={})=>{let s=ye(e.draftSelectedValues),r=t.value,i=s.findIndex(n=>le(n,r));if(i>=0){e.draftSelectedValues=s.filter((n,o)=>o!==i);return}e.draftSelectedValues=[...s,r]},Ru=({state:e})=>{e.selectedValues=ye(e.draftSelectedValues),e.hasSelectedValues=!0,e.isOpen=!1,e.draftSelectedValues=[]},ju=Object.freeze(Object.defineProperty({__proto__:null,closeOptionsPopover:Tu,commitDraftSelectedValues:Ru,createInitialState:ku,openOptionsPopover:Ou,selectDraftSelectedValues:Iu,selectHasSelectedValues:Cu,selectSelectedValues:$u,selectViewData:Eu,toggleDraftSelectedValue:Nu,updateDraftSelectedValues:Lu,updateSelectedValues:Vu},Symbol.toStringTag,{value:"Module"})),Du=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Pu=()=>Object.freeze({}),Hr={sm:{textSize:"sm",padding:"md",maxWidth:"min(320px, calc(100vw - 16px))"},md:{textSize:"sm",padding:"md",maxWidth:"min(360px, calc(100vw - 16px))"},lg:{textSize:"md",padding:"lg",maxWidth:"min(420px, calc(100vw - 16px))"}},Bu=({props:e})=>{let t=Hr[e.s]?e.s:"sm",s=Hr[t];return{open:!!e.open,x:e.x||0,y:e.y||0,place:e.place||"t",content:e.content||"",textSize:s.textSize,padding:s.padding,contentStyle:`padding: 0; min-width: 0; max-width: ${s.maxWidth};`}},zu=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Pu,selectViewData:Bu},Symbol.toStringTag,{value:"Module"})),Wu=async e=>{let{props:t,store:s,render:r,refs:i}=e,{waveformData:n}=t;s.setWaveformData({data:n}),r();let o=i.canvas;o&&en(n,o)},Mu=async(e,t)=>{let{store:s,render:r,refs:i,props:n}=e,{waveformData:o}=n;if(!o){console.log("waveform handleOnUpdate: no waveformData provided");return}s.setWaveformData({data:o}),r();let l=i.canvas;l&&en(o,l)};async function en(e,t){let s=t.getContext("2d"),r=t.getBoundingClientRect(),i=r.width,n=r.height;t.width=i,t.height=n;let o=t.width,l=t.height;if(s.clearRect(0,0,o,l),s.fillStyle="#1a1a1a",s.fillRect(0,0,o,l),!e||!e.amplitudes)return;let p=e.amplitudes,a=l/2,c=s.createLinearGradient(0,0,0,l);c.addColorStop(0,"#404040"),c.addColorStop(.5,"#A1A1A1"),c.addColorStop(1,"#404040");let d=Math.max(1,o/p.length),h=.2;for(let f=0;f<p.length;f++){let u=p[f]/255*(l*.85),y=f*d,m=a-u/2;s.fillStyle=c,s.fillRect(y,m,Math.max(1,d*(1-h)),u)}s.strokeStyle="rgba(255, 255, 255, 0.1)",s.lineWidth=1,s.beginPath(),s.moveTo(0,a),s.lineTo(o,a),s.stroke(),s.shadowBlur=10,s.shadowColor="#2196F3"}var Fu=Object.freeze(Object.defineProperty({__proto__:null,handleAfterMount:Wu,handleOnUpdate:Mu},Symbol.toStringTag,{value:"Module"})),Ku=()=>Object.freeze({waveformData:null}),Uu=({state:e},t={})=>{e.waveformData=t.data},Hu=({state:e,props:t})=>({isLoading:t.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:t.waveformData}),qu=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Ku,selectViewData:Hu,setWaveformData:Uu},Symbol.toStringTag,{value:"Module"})),tn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sn=e=>e.replace(/-([a-z0-9])/g,(t,s)=>s.toUpperCase()),_s=e=>{if(e!=null)return e===""?!0:e},wt=(e,t)=>{let s=e.getAttribute(t);if(s!==null)return _s(s);let r=tn(t);if(r!==t){let i=e.getAttribute(r);if(i!==null)return _s(i)}},ps=Symbol("rtglReactivePropValues"),ds=Symbol("rtglNativeHostStyle"),Yu=(e,t)=>{let s=Object.getPrototypeOf(e);for(;s;){let r=Object.getOwnPropertyDescriptor(s,t);if(r)return r;s=Object.getPrototypeOf(s)}},rn=e=>{if(!e||typeof e!="object")return;if(Object.prototype.hasOwnProperty.call(e,ds))return e[ds];let t=Yu(e,"style"),s;return typeof t?.get=="function"?s=t.get.call(e):e.style&&typeof e.style=="object"&&(s=e.style),s&&typeof s=="object"&&Object.defineProperty(e,ds,{value:s,enumerable:!1,configurable:!1,writable:!1}),s},Gu=e=>(Object.prototype.hasOwnProperty.call(e,ps)||Object.defineProperty(e,ps,{value:Object.create(null),enumerable:!1,configurable:!1,writable:!1}),e[ps]),Ju=({source:e,allowedKeys:t=[],onPropChange:s})=>{let r=Gu(e);t.includes("style")&&rn(e),t.forEach(i=>{if(typeof i!="string"||i.length===0)return;let n=Object.prototype.hasOwnProperty.call(e,i)?e[i]:void 0,o=Object.prototype.hasOwnProperty.call(e,i);o&&delete e[i],Object.defineProperty(e,i,{configurable:!0,enumerable:!0,get(){return Object.prototype.hasOwnProperty.call(r,i)?r[i]:wt(e,i)},set(l){let p=Object.prototype.hasOwnProperty.call(r,i)?r[i]:wt(e,i);l===void 0?delete r[i]:r[i]=l,p!==l&&s?.({propName:i,oldValue:p,newValue:l})}}),o&&(r[i]=n)})},Zu=(e,t)=>{let s=new Set(t);return new Proxy({},{get(r,i){if(typeof i=="string"&&s.has(i)){let n=e[i];return n!==void 0?n:wt(e,i)}},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(r,i){return typeof i=="string"&&s.has(i)},ownKeys(){return[...s]},getOwnPropertyDescriptor(r,i){if(typeof i=="string"&&s.has(i))return{configurable:!0,enumerable:!0,get:()=>{let n=e[i];return n!==void 0?n:wt(e,i)}}}})},Xu=({schema:e,methodExports:t=[]})=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("componentName is required.");if(typeof e.componentName!="string"||e.componentName.trim()==="")throw new Error("componentName is required.");if(Object.prototype.hasOwnProperty.call(e,"attrsSchema"))throw new Error("attrsSchema is not supported.");if(Object.prototype.hasOwnProperty.call(e,"methods")){let s=e.methods;if(!s||typeof s!="object"||Array.isArray(s))throw new Error("methods must be an object schema with a properties map.");if(Object.prototype.hasOwnProperty.call(s,"type")&&s.type!=="object")throw new Error("methods.type must be 'object'.");if(!s.properties||typeof s.properties!="object"||Array.isArray(s.properties))throw new Error("methods.properties must be an object keyed by method name.");for(let r of Object.keys(s.properties))if(!t.includes(r))throw new Error(`method '${r}' is declared in schema but missing in .methods.js exports.`)}return!0},v={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9,PARTIAL:10,PATH_REFERENCE:11},P={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},xs={NOT:0},E=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},re=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}},qr=e=>{if(!e||e.trim()==="")throw new E("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let s=e.includes("===")?"==":"!=";throw new E(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${s}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let s of t)if(e.trim().endsWith(s))throw new E(`Incomplete comparison expression - missing right operand (got: '${e}')`)},Qu=e=>{if(e.trim().endsWith(" in"))throw new E(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new E(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,s]=e.split(" in ");if(!s||s.trim()==="")throw new E(`Missing iterable expression after 'in' (got: '$for ${e}')`);let r=t.includes(",")?t.split(",").map(i=>i.trim()):[t.trim()];for(let i of r){if(!i)throw new E(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(i))throw new E(`Invalid loop syntax (got: '$for ${e}')`)}},eh=(e,t,s=!1)=>{if(t===null)return new re(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new re(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return s?new re(`Cannot iterate over non-array value in loop '${e}' - got ${r} instead`):new re(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},th=(e,t)=>{let s=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new re(`Unknown function '${e}' (${s})`)},nn=(e,t,s={})=>{let r={},i={};s&&typeof s=="object"&&(s.functions!==void 0||s.partials!==void 0?(r=s.functions||{},i=s.partials||{}):typeof s=="object"&&(r=s));let n=R(e,{functions:r,partials:i},t,{});return n===void 0?{}:n},R=(e,t,s,r)=>{if(t.functions,e.var&&!e.type)return U(e.var,s,r);if(e.type===v.LITERAL)return e.value;if(e.type===v.VARIABLE)return U(e.path,s,r);if(e.type===v.INTERPOLATION)return rh(e.parts,t,s,r);switch(e.type){case v.FUNCTION:return on(e,t,s,r);case v.BINARY:return an(e,t,s,r);case v.UNARY:return ln(e,t,s,r);case v.CONDITIONAL:return nh(e,t,s,r);case v.LOOP:return dh(e,t,s,r);case v.OBJECT:return uh(e,t,s,r);case v.ARRAY:return hh(e,t,s,r);case v.PARTIAL:return fh(e,t,s,r);case v.PATH_REFERENCE:return yh(e,t,s,r);default:throw new Error(`Unknown node type: ${e.type}`)}},Yr=new Map,sh=e=>{let t=[],s="",r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(n==="[")s&&(t.push({type:"property",value:s}),s=""),r=!0;else if(n==="]"){if(r&&s){let o=s.trim();if(/^\d+$/.test(o))t.push({type:"index",value:parseInt(o,10)});else if(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'")){let l=o.slice(1,-1);t.push({type:"property",value:l})}else t.push({type:"property",value:o});s=""}r=!1}else s+=n}return s&&t.push({type:"property",value:s}),t},U=(e,t,s)=>{if(!e)return;if(e in s)return s[e];let r=Yr.get(e);if(!r){let n=[],o="",l=0;for(let p=0;p<e.length;p++){let a=e[p];a==="["?(l++,o+=a):a==="]"?(l--,o+=a):a==="."&&l===0?o&&(n.push(o),o=""):o+=a}o&&n.push(o),r=[];for(let p of n){let a=sh(p.trim());r.push(...a)}Yr.set(e,r)}let i=t;for(let n=0;n<r.length;n++){let o=r[n];if(o.type==="property"&&o.value in s){i=s[o.value];continue}if(i==null)return;(o.type==="property"||o.type==="index")&&(i=i[o.value])}return i},rh=(e,t,s,r)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let o=R(n,t,s,r);i.push(o!=null?String(o):"")}return i.join("")},on=(e,t,s,r)=>{let i=t.functions||t,n=i[e.name];if(!n)throw th(e.name,i);let o=e.args.map(l=>R(l,t,s,r));return n(...o)},Be=(e,t,s,r)=>{if(e.var&&!e.type)return U(e.var,s,r);switch(e.type){case v.VARIABLE:return U(e.path,s,r);case v.LITERAL:return e.value;case v.BINARY:return an(e,t,s,r);case v.UNARY:return ln(e,t,s,r);case v.FUNCTION:return on(e,t,s,r);default:return R(e,t,s,r)}},an=(e,t,s,r)=>{if(e.op===P.AND||e.op===P.OR){let o=Be(e.left,t,s,r),l=Be(e.right,t,s,r);switch(e.op){case P.AND:return o&&l;case P.OR:return o||l}}let i=R(e.left,t,s,r),n=R(e.right,t,s,r);switch(e.op){case P.EQ:return i==n;case P.NEQ:return i!=n;case P.GT:return i>n;case P.LT:return i<n;case P.GTE:return i>=n;case P.LTE:return i<=n;case P.IN:return Array.isArray(n)?n.includes(i):!1;case P.ADD:if(typeof i!="number"||typeof n!="number")throw new re(`Arithmetic operations require numbers. Got ${typeof i} + ${typeof n}`);return i+n;case P.SUBTRACT:if(typeof i!="number"||typeof n!="number")throw new re(`Arithmetic operations require numbers. Got ${typeof i} - ${typeof n}`);return i-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},ln=(e,t,s,r)=>{let i=e.op===xs.NOT?Be(e.operand,t,s,r):R(e.operand,t,s,r);switch(e.op){case xs.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},ih=(e,t,s,r)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===v.VARIABLE)if(U(i.path,s,r)){let n=e.bodies[0];if(n.type===v.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?R(l.parsedKey,t,s,r):l.key,a=l.value;if(a.type===v.LITERAL)o[p]=a.value;else if(a.type===v.VARIABLE)o[p]=U(a.path,s,r);else if(a.type===v.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let h=U(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=R(d,t,s,r);c.push(h!=null?String(h):"")}o[p]=c.join("")}else o[p]=R(a,t,s,r)}return o}}else{let n=e.bodies[1];if(n.type===v.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?R(l.parsedKey,t,s,r):l.key,a=l.value;if(a.type===v.LITERAL)o[p]=a.value;else if(a.type===v.VARIABLE)o[p]=U(a.path,s,r);else if(a.type===v.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let h=U(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=R(d,t,s,r);c.push(h!=null?String(h):"")}o[p]=c.join("")}else o[p]=R(a,t,s,r)}return o}}}return null},nh=(e,t,s,r)=>{let i=ih(e,t,s,r);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||Be(o,t,s,r))return R(e.bodies[n],t,s,r)}return pn},oh=(e,t)=>{let s=e.body,r=e.itemVar;if(s.type===v.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===v.VARIABLE){let i=s.conditions[0].path,n=s.bodies[0];if(i.startsWith(r+".")){let o=i.substring(r.length+1);if(n.type===v.OBJECT&&n.properties.length<=5){for(let p of n.properties)if(p.parsedKey)return null;let l=[];for(let p=0;p<t.length;p++){let a=t[p];if(a[o]){let c={};for(let d of n.properties){let h=d.key,f=d.value;if(f.type===v.LITERAL)c[h]=f.value;else if(f.type===v.VARIABLE){let u=f.path;if(u===r)c[h]=a;else if(u.startsWith(r+".")){let y=u.substring(r.length+1);c[h]=a[y]}else return null}else if(f.type===v.INTERPOLATION){let u=[],y=!0;for(let m of f.parts)if(typeof m=="string")u.push(m);else if(m.type===v.VARIABLE){let b=m.path;if(b===r)u.push(a!=null?String(a):"");else if(b.startsWith(r+".")){let g=b.substring(r.length+1),_=a[g];u.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[h]=u.join("")}else return null}l.push(c)}}return l}}}return null},ah=(e,t)=>{let s=e.body,r=e.itemVar,i=oh(e,t);if(i!==null)return i;if(s.type===v.OBJECT&&s.properties.length<=5&&!s.whenCondition){for(let l of s.properties)if(l.parsedKey)return null;let n=[],o=!0;for(let l of s.properties){let p=l.key,a=l.value;if(a.type===v.LITERAL)n.push({key:p,type:"literal",value:a.value});else if(a.type===v.VARIABLE){let c=a.path;if(c===r)n.push({key:p,type:"item"});else if(c.startsWith(r+".")){let d=c.substring(r.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:p,type:"prop",prop:d});else{o=!1;break}}else{o=!1;break}}else if(a.type===v.INTERPOLATION&&a.parts.length===1){let c=a.parts[0];if(c.type===v.VARIABLE){let d=c.path;if(d===r)n.push({key:p,type:"item_string"});else if(d.startsWith(r+".")){let h=d.substring(r.length+1);if(!h.includes(".")&&!h.includes("["))n.push({key:p,type:"prop_string",prop:h});else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}if(o){let l=new Array(t.length);if(n.length===3&&n[0].type==="prop"&&n[0].key==="id"&&n[1].type==="prop_string"&&n[1].key==="title"&&n[2].type==="prop"&&n[2].key==="completed")for(let p=0;p<t.length;p++){let a=t[p];l[p]={id:a.id,title:a.title!=null?String(a.title):"",completed:a.completed}}else for(let p=0;p<t.length;p++){let a=t[p],c={};for(let d of n)if(d.type==="literal")c[d.key]=d.value;else if(d.type==="item")c[d.key]=a;else if(d.type==="prop")c[d.key]=a[d.prop];else if(d.type==="item_string")c[d.key]=a!=null?String(a):"";else if(d.type==="prop_string"){let h=a[d.prop];c[d.key]=h!=null?String(h):""}l[p]=c}return l}}return null},lh=(e,t,s,r,i)=>{let n=[],o=e.body;if(o.type===v.OBJECT&&o.fast!==!1){let l=e.itemVar,p=e.indexVar;for(let a=0;a<i.length;a++){let c=i[a],d={},h={...r,[l]:c,...p&&{[p]:a}};h.__paths__||(h.__paths__=r.__paths__||{});let f=e.iterable.path||"";if(r&&r.__paths__&&f){let u=f.split("."),y=u[0];y in r.__paths__&&(f=r.__paths__[y],u.length>1&&(f+="."+u.slice(1).join(".")))}h.__paths__={...h.__paths__,[l]:`${f}[${a}]`,...p&&{[p]:a}};for(let u of o.properties){let y=u.parsedKey?R(u.parsedKey,t,s,h):u.key,m=u.value;if(m.type===v.LITERAL)d[y]=m.value;else if(m.type===v.VARIABLE){let b=m.path;if(b===l)d[y]=c;else if(b===p)d[y]=a;else if(b.startsWith(l+".")){let g=b.substring(l.length+1);!g.includes(".")&&!g.includes("[")?d[y]=c[g]:d[y]=U(b,s,{...r,[l]:c,...p&&{[p]:a}})}else d[y]=U(b,s,{...r,[l]:c,...p&&{[p]:a}})}else if(m.type===v.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=g.path,S;if(_===l)S=c;else if(_===p)S=a;else if(_.startsWith(l+".")){let A=_.substring(l.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=U(_,s,{...r,[l]:c,...p&&{[p]:a}})}else S=U(_,s,{...r,[l]:c,...p&&{[p]:a}});b.push(S!=null?String(S):"")}else{let _={...r,[l]:c,...p&&{[p]:a}},S=R(g,t,s,_);b.push(S!=null?String(S):"")}d[y]=b.join("")}else{let b={...r,[l]:c,...p&&{[p]:a}};d[y]=R(m,t,s,b)}}n.push(d)}return n}return null},ph=(e,t,s)=>{let r=e.body;if(r.type===v.OBJECT&&r.properties.length===1&&r.properties[0].key==="$if item.visible"){let i=r.properties[0].value;if(i.type===v.CONDITIONAL&&i.conditions.length===1&&i.conditions[0].type===v.VARIABLE&&i.conditions[0].path==="item.visible"){let n=i.bodies[0];if(n.type===v.OBJECT&&n.properties.length===2){let o=n.properties[0],l=n.properties[1];if(o.key==="id"&&o.value.type===v.VARIABLE&&o.value.path==="item.id"&&l.key==="$if item.highlighted"&&l.value.type===v.CONDITIONAL){let p=[];for(let a=0;a<t.length;a++){let c=t[a];if(c.visible){let d={id:c.id};c.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${c.name}`):(d.highlight=!1,d.message=c.name),p.push(d)}}return p}}}}return null},dh=(e,t,s,r)=>{let i=R(e.iterable,t,s,r);if(!Array.isArray(i)){let a,c=!1;if(e.iterable.type===v.FUNCTION){c=!0;let h=e.iterable.args.map(f=>f.type===v.LITERAL?typeof f.value=="string"?`'${f.value}'`:String(f.value):f.type===v.VARIABLE?f.path:f.type===v.FUNCTION?`${f.name}(...)`:"?").join(", ");a=`${e.iterable.name}(${h})`}else a=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${a}`;throw eh(d,i,c)}if(!e.indexVar){let a=ph(e,i,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=ah(e,i);if(a!==null)return a}let n=lh(e,t,s,r,i);if(n!==null)return n;let o=[],l=e.iterable.path||"";if(r&&r.__paths__&&l){let a=l.split("."),c=a[0];c in r.__paths__&&(l=r.__paths__[c],a.length>1&&(l+="."+a.slice(1).join(".")))}let p=!1;e.body.type===v.ARRAY&&(e.body.items.length<=1?p=!1:p=e.body._shouldPreserveArray??=e.body.items.some(a=>a.type===v.OBJECT&&a.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let a=0;a<i.length;a++){let c=e.indexVar?{...r,[e.itemVar]:i[a],[e.indexVar]:a}:{...r,[e.itemVar]:i[a]};c.__paths__||(c.__paths__=r.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${l}[${a}]`},e.indexVar&&(c.__paths__[e.indexVar]=a);let d=R(e.body,t,s,c);if(Array.isArray(d)&&d.length===1&&!p){let h=d[0];o.push(h===void 0?{}:h)}else o.push(d===void 0?{}:d)}return o},ch=(e,t,s,r)=>{if(e.whenCondition)return null;if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?R(i.parsedKey,t,s,r):i.key,o=i.value;if(o.type===v.OBJECT&&o.properties.length<=10&&!o.whenCondition){let l={},p={},a=!0;for(let c of o.properties){let d=c.parsedKey?R(c.parsedKey,t,s,r):c.key,h=c.value;if(h.type===v.LITERAL)p[d]=h.value;else if(h.type===v.VARIABLE)p[d]=U(h.path,s,r);else if(h.type===v.INTERPOLATION){let f=[];for(let u of h.parts)if(typeof u=="string")f.push(u);else if(u.type===v.VARIABLE){let y=U(u.path,s,r);f.push(y!=null?String(y):"")}else{a=!1;break}if(!a)break;p[d]=f.join("")}else if(h.type===v.OBJECT&&h.properties.length<=5){let f={};for(let u of h.properties){let y=u.key,m=u.value;if(m.type===v.LITERAL)f[y]=m.value;else if(m.type===v.VARIABLE)f[y]=U(m.path,s,r);else if(m.type===v.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=U(g.path,s,r);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[y]=b.join("")}else{a=!1;break}}if(!a)break;p[d]=f}else{a=!1;break}}if(a)return l[n]=p,l}}return null},uh=(e,t,s,r)=>{let i=t.functions||t;if(e.whenCondition&&!Be(e.whenCondition,i,s,r))return;let n=ch(e,t,s,r);if(n!==null)return n;if(e.fast){let p={};for(let a of e.properties){let c=a.parsedKey?R(a.parsedKey,t,s,r):a.key,d=a.value;if(d.type===v.LITERAL)p[c]=d.value;else if(d.type===v.VARIABLE)p[c]=U(d.path,s,r);else if(d.type===v.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===v.VARIABLE){let u=U(f.path,s,r);h.push(u!=null?String(u):"")}else{let u=R(f,t,s,r);h.push(u!=null?String(u):"")}p[c]=h.join("")}else p[c]=R(d,t,s,r)}return p}let o={},l=!1;for(let p of e.properties)if(!p.key.startsWith("$if ")&&!p.key.match(/^\$if\s+\w+.*:?$/)&&!p.key.startsWith("$elif")&&!p.key.startsWith("$else")&&!p.key.startsWith("$for ")){l=!0;break}for(let p of e.properties)if(p.key.startsWith("$if ")||p.key.match(/^\$if\s+\w+.*:?$/)){let a=R(p.value,t,s,r);if(!l&&a!==null&&a!==void 0)return Array.isArray(a)&&a.length===1?a[0]:a;typeof a=="object"&&a!==null&&!Array.isArray(a)&&Object.assign(o,a)}else if(p.key.startsWith("$for ")){if(e.properties.length===1)return R(p.value,t,s,r)}else{let a=p.value;if(a&&a.type===v.OBJECT&&a.properties){let c=a.properties.find(d=>d.key.startsWith("$for "));if(c){let d=R(c.value,t,s,r);d!==void 0&&(o[p.key]=d)}else{let d=R(p.value,t,s,r);d!==void 0&&(o[p.key]=d)}}else{let c=p.parsedKey?R(p.parsedKey,t,s,r):p.key,d=R(p.value,t,s,r);d!==void 0&&(o[c]=d)}}return o},pn={},hh=(e,t,s,r)=>{let i=[];for(let n of e.items)if(n.type===v.LOOP){let o=R(n,t,s,r);Array.isArray(o)&&n.flatten!==!1?i.push(...o):i.push(o)}else{let o=R(n,t,s,r);o!==pn&&o!==void 0&&i.push(o)}return i},fh=(e,t,s,r)=>{let{name:i,data:n,whenCondition:o}=e,l=t.partials||{},p=t.functions||t;if(o&&!Be(o,p,s,r))return;if(!l[i])throw new re(`Partial '${i}' is not defined`);let a=r._partialStack||[];if(a.includes(i))throw new re(`Circular partial reference detected: ${i}`);let c=l[i],d=s,h={...r,_partialStack:[...a,i]};if(r){d={...s};for(let f of Object.keys(r))f.startsWith("_")||(d[f]=r[f])}if(n){let f=R(n,t,s,r);d={...d,...f}}return R(c,t,d,h)},yh=(e,t,s,r)=>{let{path:i}=e,n=i.split("."),o=n[0],l=n.slice(1);if(!r||!(o in r))throw new re(`Path reference '#{${i}}' refers to '${o}' which is not a loop variable in the current scope`);if(r.__paths__||(r.__paths__={}),!(o in r.__paths__))throw new re(`Path reference '#{${i}}' cannot be resolved - path tracking may not be initialized properly`);let p=r.__paths__[o];if(typeof p=="number"){if(l.length>0)throw new re(`Path reference '#{${i}}' - cannot access properties on index variable '${o}'`);return String(p)}return l.length>0&&(p+="."+l.join(".")),p},mh=/\$\{([^}]*)\}/g,gh=/#\{([^}]*)\}/g,dn=(e,t={})=>{let s=e.match(/^(\w+)\((.*)\)$/);if(!s)return{isFunction:!1};let[,r,i]=s,n=bh(i,t);return{isFunction:!0,type:v.FUNCTION,name:r,args:n}},bh=(e,t={})=>e.trim()?vh(e).map(s=>wh(s.trim(),t)):[],vh=e=>{let t=[],s="",r=0,i=!1,n="";for(let o=0;o<e.length;o++){let l=e[o],p=o>0?e[o-1]:"";!i&&(l==='"'||l==="'")?(i=!0,n=l,s+=l):i&&l===n&&p!=="\\"?(i=!1,n="",s+=l):!i&&l==="("?(r++,s+=l):!i&&l===")"?(r--,s+=l):!i&&l===","&&r===0?(t.push(s),s=""):s+=l}return s&&t.push(s),t},wh=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:v.LITERAL,value:parseFloat(e)};if(e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};let s=dn(e,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};let r=e.trim(),i=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:o,type:l}of i){let p=0;for(;p<r.length;){let a=Ve(r.substring(p),o);if(a===-1)break;let c=p+a;c>n&&(n=c),p=c+o.length}}if(n!==-1)try{return Q(r,t)}catch{return{type:v.VARIABLE,path:r}}return{type:v.VARIABLE,path:r}},cn=/^\w+\(.*\)$/,_h=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,xh=e=>{if(!(!e||e.trim()===""||cn.test(e))&&_h.test(e))throw e.includes("?")&&e.includes(":")?new E(`Complex expressions not supported in variable replacements - consider calculating the value in your data instead. Offending expression: "${e}"`):e.includes("||")||e.includes("&&")||e.includes("??")?new E(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new E(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},Gr=e=>{let t=e.trim();if(cn.test(t))throw new E(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new E(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new E(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new E(`Logical operators not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("?")&&t.includes(":"))throw new E(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:v.PATH_REFERENCE,path:t}},_t=(e,t={})=>{let s=e.trim();xh(s);let r=dn(s,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};if(s.includes("[")&&!/[\s+\-*/%|&?:]/.test(s)){let i=0;for(let n of s)n==="["?i++:n==="]"&&i--;if(i!==0)throw new Error("Invalid array index syntax")}return{type:v.VARIABLE,path:s}},un=(e,t={})=>{let s=e,r=[];(e.includes("\\${")||e.includes("\\#{"))&&(s=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),s=s.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),s=s.replace(/\\(\$\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\(#\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\DOUBLE_ESC_VAR/g,"\\"),s=s.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let i=[...s.matchAll(mh)],n=[...s.matchAll(gh)],o=[...i.map(a=>({match:a,type:"variable"})),...n.map(a=>({match:a,type:"pathref"}))].sort((a,c)=>a.match.index-c.match.index);if(o.length===0){let a=s;for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);return{type:v.LITERAL,value:a}}if(o.length===1&&o[0].match[0]===s&&r.length===0){let{match:a,type:c}=o[0];try{return c==="variable"?_t(a[1],t):Gr(a[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:v.LITERAL,value:s};throw d}}let l=[],p=0;for(let{match:a,type:c}of o){let[d,h]=a,f=a.index;if(f>p){let u=s.substring(p,f);for(let y=0;y<r.length;y++)u=u.replace(`__ESCAPED_${y}__`,r[y]);u&&l.push(u)}try{let u;c==="variable"?u=_t(h.trim(),t):u=Gr(h.trim()),l.push(u)}catch(u){if(u.message==="Invalid array index syntax")l.push(d);else throw u}p=f+d.length}if(p<s.length){let a=s.substring(p);for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);a&&l.push(a)}return{type:v.INTERPOLATION,parts:l}},Ee=(e,t)=>typeof e=="string"?un(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Ah(e,t):kh(e,t):{type:v.LITERAL,value:e},Sh=e=>{let{$each:t,...s}=e;if(typeof t!="string")throw new E("$each value must be a non-empty string");let r=t.trim();if(r==="")throw new E("$each value must be a non-empty string");if(Object.keys(s).length===0)throw new E("Empty $each body not allowed");if(s.$partial!==void 0)throw new E("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${r}`]:s}},Ah=(e,t)=>{let s=[],r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let p=Sh(n),a=Object.keys(p);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let c=Jr(a[0],p[a[0]],t,!0);s.push(c),r=!0;continue}}catch(p){throw p instanceof E?p:new E(p.message)}let l=Object.keys(n);if(l.length===1&&/^\$for(?::\w+)?\s/.test(l[0])){let p=Jr(l[0],n[l[0]],t);s.push(p),r=!0;continue}}let o=Ee(n,t);s.push(o),(o.type===v.FUNCTION||o.type===v.CONDITIONAL||o.type===v.LOOP||o.type===v.PARTIAL||o.type===v.OBJECT&&!o.fast||o.type===v.ARRAY&&!o.fast)&&(r=!0)}return{type:v.ARRAY,items:s,fast:!r}},kh=(e,t)=>{let s=[],r=!1,i=null,n=Object.entries(e),o=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new E("$partial value must be a string");if(e.$partial.trim()==="")throw new E("$partial value cannot be an empty string");let p=["$if","$elif","$else","$for"],a=[];for(let[b]of n)for(let g of p)if(b===g||b.startsWith(g+" ")||b.startsWith(g+"#")){a.push(g);break}if(a.length>0)throw new E(`Cannot use $partial with ${a.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...h}=e,f={},u=!1;for(let[b,g]of Object.entries(h)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=g,u=!0}let y=null;if(u&&(y=Ee(f,t),y.type===v.OBJECT)){let b=!1;for(let g of y.properties)if(g.value.type===v.VARIABLE||g.value.type===v.INTERPOLATION||g.value.type===v.FUNCTION||g.value.type===v.CONDITIONAL||g.value.type===v.OBJECT&&!g.value.fast||g.value.type===v.ARRAY&&!g.value.fast){b=!0;break}b&&(y.fast=!1)}let m={type:v.PARTIAL,name:c,data:y};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new E("Empty condition expression after '$when'");b=Q(d,t)}else b={type:v.LITERAL,value:d};m.whenCondition=b}return m}for(let[p,a]of n)if(p==="$when"){if(i!==null)throw new E("Multiple '$when' directives on the same object are not allowed");if(a==null)throw new E("Missing condition expression after '$when'");let c=typeof a=="string"?a:JSON.stringify(a);if(c.trim()==="")throw new E("Empty condition expression after '$when'");i=Q(c,t),r=!0}else if(p.startsWith("$when#")||p.startsWith("$when "))throw new E("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;o<n.length;){let[p,a]=n[o];if(p==="$when"){o++;continue}if(p==="$each")throw new E("$each can only be used inside arrays");if(p.startsWith("$if ")||p.match(/^\$if#\w+\s/)||p.match(/^\$if\s+\w+.*:$/)){let c=Eh(n,o,t);s.push({key:p,value:c.node}),r=!0,o=c.nextIndex}else if(/^\$for(?::\w+)?\s/.test(p)){let c=p.match(/^\$for(?::(\w+))?\s/)?.[1]||"",d=c?`:${c}`:"";throw new E(`$for loops must be inside arrays - use '- $for${d} item in items:' instead of '$for${d} item in items:'. For cleaner object generation syntax, consider using $each.`)}else{if(p.startsWith("$elif ")||p.startsWith("$else"))throw new E(`'${p.split(" ")[0]}' without matching '$if'`);if(p==="$if"||p==="$if:")throw new E("Missing condition expression after '$if'");{let c=Ee(a,t);(c.type===v.FUNCTION||c.type===v.CONDITIONAL||c.type===v.PARTIAL||c.type===v.OBJECT&&!c.fast||c.type===v.ARRAY&&!c.fast)&&(r=!0);let d=un(p,t),h={key:p,value:c};(d.type!==v.LITERAL||d.value!==p)&&(h.parsedKey=d),s.push(h),o++}}}let l={type:v.OBJECT,properties:s,fast:!r};return i&&(l.whenCondition=i),l},Eh=(e,t,s={})=>{let r=[],i=[],n=t,[o,l]=e[n],p=null,a;if(o.startsWith("$if#")){let d=o.match(/^\$if#(\w+)\s+(.+)$/);if(d)p=d[1],a=d[2];else throw new E(`Invalid conditional syntax: ${o}`)}else a=o.substring(4),a.endsWith(":")&&(a=a.slice(0,-1).trim());qr(a);let c=Q(a,s);for(r.push(c),i.push(Ee(l,s)),n++;n<e.length;){let[d,h]=e[n],f=!1,u;if(p?d.startsWith(`$elif#${p} `)?(u=d.substring(`$elif#${p} `.length),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d===`$else#${p}`||d===`$else#${p}:`)&&(f=!0,u=null):d.startsWith("$elif ")?(u=d.substring(6),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,u=null),f){if(u===null)r.push(null);else{qr(u);let y=Q(u,s);r.push(y)}if(i.push(Ee(h,s)),n++,u===null)break}else break}return{node:{type:v.CONDITIONAL,conditions:r,bodies:i,id:p},nextIndex:n}},Q=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let a=e.slice(1,-1),c=0,d=!0;for(let h=0;h<a.length;h++)if(a[h]==="("?c++:a[h]===")"&&c--,c<0){d=!1;break}if(d&&c===0)return Q(a,t)}let s=Ve(e,"||");if(s!==-1)return{type:v.BINARY,op:P.OR,left:Q(e.substring(0,s).trim(),t),right:Q(e.substring(s+2).trim(),t)};let r=Ve(e,"&&");if(r!==-1)return{type:v.BINARY,op:P.AND,left:Q(e.substring(0,r).trim(),t),right:Q(e.substring(r+2).trim(),t)};let i=[{op:">=",type:P.GTE},{op:"<=",type:P.LTE},{op:"==",type:P.EQ},{op:"!=",type:P.NEQ},{op:">",type:P.GT},{op:"<",type:P.LT},{op:" in ",type:P.IN}];for(let{op:a,type:c}of i){let d=Ve(e,a);if(d!==-1)return{type:v.BINARY,op:c,left:Q(e.substring(0,d).trim(),t),right:Q(e.substring(d+a.length).trim(),t)}}let n=-1,o=null,l=[{op:" + ",type:P.ADD},{op:" - ",type:P.SUBTRACT}];for(let{op:a,type:c}of l){let d=0;for(;d<e.length;){let h=Ve(e.substring(d),a);if(h===-1)break;let f=d+h;f>n&&(n=f,o={op:a,type:c}),d=f+a.length}}if(n!==-1&&o)return{type:v.BINARY,op:o.type,left:Q(e.substring(0,n).trim(),t),right:Q(e.substring(n+o.op.length).trim(),t)};let p=[" * "," / "," % "];for(let a of p)if(Ve(e,a)!==-1)throw new E(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:v.UNARY,op:xs.NOT,operand:Q(e.substring(1).trim(),t)}:hn(e,t)},Ve=(e,t)=>{let s=0,r=0;for(;r<=e.length-t.length;){if(e[r]==="(")s++;else if(e[r]===")")s--;else if(s===0&&e.substring(r,r+t.length)===t)return r;r++}return-1},$h=e=>{if(e=e.trim(),e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:v.LITERAL,value:""};if(e==="{}")return{type:v.LITERAL,value:{}};if(e==="[]")return{type:v.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:v.LITERAL,value:t}:{type:v.VARIABLE,path:e}},hn=(e,t)=>{let s=e.trim();if(s.match(/^(\w+)\((.*)\)$/))return _t(s,t);let r=$h(s);if(r.type===v.LITERAL)return r;if(/^[a-zA-Z_$][\w.$]*$/.test(s))return{type:v.VARIABLE,path:s};try{return _t(s,t)}catch(i){if(i.message&&i.message.includes("not supported"))return r;throw i}},Ch=(e,t=!1)=>{try{Qu(e)}catch(s){if(s instanceof E&&t){let r=s.message.replace(/\$for/g,"$each");throw new E(r.replace("Parse Error: ",""))}throw s}},Jr=(e,t,s,r=!1)=>{let i=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(i);if(!n){let m=r?"$each":"$for";throw new E(`Invalid loop syntax (got: '${e.replace("$for",m)}')`)}let o=n[1],l=n[2].trim();Ch(l,r);let p=l.match(/^(.+?)\s+in\s+(.+)$/);if(!p){let m=r?"$each":"$for";throw new E(`Invalid loop syntax - missing 'in' keyword (got: '${m} ${l}')`)}let a=p[1].trim(),c=p[2].trim(),d,h=null;if(a.includes(",")){let m=a.split(",").map(b=>b.trim());if(m.length!==2)throw new E(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=m[0],h=m[1]}else d=a;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new E(`Reserved variable name: ${d}`);if(h&&f.includes(h))throw new E(`Reserved variable name: ${h}`);let u=hn(c,s),y=Ee(t,s);return{type:v.LOOP,itemVar:d,indexVar:h,iterable:u,body:y,flatten:o!=="nested"}},Ss=(e,t={})=>{let{functions:s={}}=t;return Ee(e,s)},Ih=()=>Date.now(),Oh=Object.freeze(Object.defineProperty({__proto__:null,now:Ih},Symbol.toStringTag,{value:"Module"})),fn=(e,t,s={})=>{let{functions:r={},partials:i={}}=s,n={...Oh,...r},o=Ss(e,{functions:n}),l={};for(let[p,a]of Object.entries(i))l[p]=Ss(a,{functions:n});return nn(o,t,{functions:n,partials:l})},Qe=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Th=(e,t)=>{!t||typeof t!="object"||Object.entries(t).forEach(([s,r])=>{if(s==="default")throw new Error("[Methods] Invalid method name 'default'. Use named exports in .methods.js; default export is not supported.");if(typeof r=="function"){if(s in e)throw new Error(`[Methods] Cannot define method '${s}' because it already exists on the component instance.`);Object.defineProperty(e,s,{configurable:!0,enumerable:!1,writable:!1,value:(i={})=>{let n=i===void 0?{}:i;if(!Qe(n))throw new Error(`[Methods] Method '${s}' expects payload to be an object.`);return r.call(e,n)}})}})},yn=Symbol.for("immer-nothing"),Zr=Symbol.for("immer-draftable"),oe=Symbol.for("immer-state");function ce(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ze=Object.getPrototypeOf;function We(e){return!!e&&!!e[oe]}function $e(e){return e?mn(e)||Array.isArray(e)||!!e[Zr]||!!e.constructor?.[Zr]||Ot(e)||Tt(e):!1}var Lh=Object.prototype.constructor.toString();function mn(e){if(!e||typeof e!="object")return!1;let t=ze(e);if(t===null)return!0;let s=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return s===Object?!0:typeof s=="function"&&Function.toString.call(s)===Lh}function xt(e,t){It(e)===0?Reflect.ownKeys(e).forEach(s=>{t(s,e[s],e)}):e.forEach((s,r)=>t(r,s,e))}function It(e){let t=e[oe];return t?t.type_:Array.isArray(e)?1:Ot(e)?2:Tt(e)?3:0}function As(e,t){return It(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function gn(e,t,s){let r=It(e);r===2?e.set(t,s):r===3?e.add(s):e[t]=s}function Vh(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ot(e){return e instanceof Map}function Tt(e){return e instanceof Set}function Se(e){return e.copy_||e.base_}function ks(e,t){if(Ot(e))return new Map(e);if(Tt(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let s=mn(e);if(t===!0||t==="class_only"&&!s){let r=Object.getOwnPropertyDescriptors(e);delete r[oe];let i=Reflect.ownKeys(r);for(let n=0;n<i.length;n++){let o=i[n],l=r[o];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(r[o]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[o]})}return Object.create(ze(e),r)}else{let r=ze(e);if(r!==null&&s)return{...e};let i=Object.create(r);return Object.assign(i,e)}}function Us(e,t=!1){return Lt(e)||We(e)||!$e(e)||(It(e)>1&&(e.set=e.add=e.clear=e.delete=Nh),Object.freeze(e),t&&Object.entries(e).forEach(([s,r])=>Us(r,!0))),e}function Nh(){ce(2)}function Lt(e){return Object.isFrozen(e)}var Rh={};function Ce(e){let t=Rh[e];return t||ce(0,e),t}var et;function bn(){return et}function jh(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Xr(e,t){t&&(Ce("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Es(e){$s(e),e.drafts_.forEach(Dh),e.drafts_=null}function $s(e){e===et&&(et=e.parent_)}function Qr(e){return et=jh(et,e)}function Dh(e){let t=e[oe];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ei(e,t){t.unfinalizedDrafts_=t.drafts_.length;let s=t.drafts_[0];return e!==void 0&&e!==s?(s[oe].modified_&&(Es(t),ce(4)),$e(e)&&(e=St(t,e),t.parent_||At(t,e)),t.patches_&&Ce("Patches").generateReplacementPatches_(s[oe].base_,e,t.patches_,t.inversePatches_)):e=St(t,s,[]),Es(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==yn?e:void 0}function St(e,t,s){if(Lt(t))return t;let r=t[oe];if(!r)return xt(t,(i,n)=>ti(e,r,t,i,n,s)),t;if(r.scope_!==e)return t;if(!r.modified_)return At(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;let i=r.copy_,n=i,o=!1;r.type_===3&&(n=new Set(i),i.clear(),o=!0),xt(n,(l,p)=>ti(e,r,i,l,p,s,o)),At(e,i,!1),s&&e.patches_&&Ce("Patches").generatePatches_(r,s,e.patches_,e.inversePatches_)}return r.copy_}function ti(e,t,s,r,i,n,o){if(We(i)){let l=n&&t&&t.type_!==3&&!As(t.assigned_,r)?n.concat(r):void 0,p=St(e,i,l);if(gn(s,r,p),We(p))e.canAutoFreeze_=!1;else return}else o&&s.add(i);if($e(i)&&!Lt(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;St(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(s,r)&&At(e,i)}}function At(e,t,s=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Us(t,s)}function Ph(e,t){let s=Array.isArray(e),r={type_:s?1:0,scope_:t?t.scope_:bn(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=r,n=Hs;s&&(i=[r],n=tt);let{revoke:o,proxy:l}=Proxy.revocable(i,n);return r.draft_=l,r.revoke_=o,l}var Hs={get(e,t){if(t===oe)return e;let s=Se(e);if(!As(s,t))return Bh(e,s,t);let r=s[t];return e.finalized_||!$e(r)?r:r===cs(e.base_,t)?(us(e),e.copy_[t]=Is(r,e)):r},has(e,t){return t in Se(e)},ownKeys(e){return Reflect.ownKeys(Se(e))},set(e,t,s){let r=vn(Se(e),t);if(r?.set)return r.set.call(e.draft_,s),!0;if(!e.modified_){let i=cs(Se(e),t),n=i?.[oe];if(n&&n.base_===s)return e.copy_[t]=s,e.assigned_[t]=!1,!0;if(Vh(s,i)&&(s!==void 0||As(e.base_,t)))return!0;us(e),Cs(e)}return e.copy_[t]===s&&(s!==void 0||t in e.copy_)||Number.isNaN(s)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=s,e.assigned_[t]=!0),!0},deleteProperty(e,t){return cs(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,us(e),Cs(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let s=Se(e),r=Reflect.getOwnPropertyDescriptor(s,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:s[t]}},defineProperty(){ce(11)},getPrototypeOf(e){return ze(e.base_)},setPrototypeOf(){ce(12)}},tt={};xt(Hs,(e,t)=>{tt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});tt.deleteProperty=function(e,t){return tt.set.call(this,e,t,void 0)};tt.set=function(e,t,s){return Hs.set.call(this,e[0],t,s,e[0])};function cs(e,t){let s=e[oe];return(s?Se(s):e)[t]}function Bh(e,t,s){let r=vn(t,s);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function vn(e,t){if(!(t in e))return;let s=ze(e);for(;s;){let r=Object.getOwnPropertyDescriptor(s,t);if(r)return r;s=ze(s)}}function Cs(e){e.modified_||(e.modified_=!0,e.parent_&&Cs(e.parent_))}function us(e){e.copy_||(e.copy_=ks(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var zh=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,s,r)=>{if(typeof t=="function"&&typeof s!="function"){let n=s;s=t;let o=this;return function(l=n,...p){return o.produce(l,a=>s.call(this,a,...p))}}typeof s!="function"&&ce(6),r!==void 0&&typeof r!="function"&&ce(7);let i;if($e(t)){let n=Qr(this),o=Is(t,void 0),l=!0;try{i=s(o),l=!1}finally{l?Es(n):$s(n)}return Xr(n,r),ei(i,n)}else if(!t||typeof t!="object"){if(i=s(t),i===void 0&&(i=t),i===yn&&(i=void 0),this.autoFreeze_&&Us(i,!0),r){let n=[],o=[];Ce("Patches").generateReplacementPatches_(t,i,n,o),r(n,o)}return i}else ce(1,t)},this.produceWithPatches=(t,s)=>{if(typeof t=="function")return(n,...o)=>this.produceWithPatches(n,l=>t(l,...o));let r,i;return[this.produce(t,s,(n,o)=>{r=n,i=o}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){$e(e)||ce(8),We(e)&&(e=Wh(e));let t=Qr(this),s=Is(e,void 0);return s[oe].isManual_=!0,$s(t),s}finishDraft(e,t){let s=e&&e[oe];(!s||!s.isManual_)&&ce(9);let{scope_:r}=s;return Xr(r,t),ei(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let s;for(s=t.length-1;s>=0;s--){let i=t[s];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}s>-1&&(t=t.slice(s+1));let r=Ce("Patches").applyPatches_;return We(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Is(e,t){let s=Ot(e)?Ce("MapSet").proxyMap_(e,t):Tt(e)?Ce("MapSet").proxySet_(e,t):Ph(e,t);return(t?t.scope_:bn()).drafts_.push(s),s}function Wh(e){return We(e)||ce(10,e),wn(e)}function wn(e){if(!$e(e)||Lt(e))return e;let t=e[oe],s;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,s=ks(e,t.scope_.immer_.useStrictShallowCopy_)}else s=ks(e,!0);return xt(s,(r,i)=>{gn(s,r,wn(i))}),t&&(t.finalized_=!1),s}var ae=new zh,Mh=ae.produce;ae.produceWithPatches.bind(ae);ae.setAutoFreeze.bind(ae);ae.setUseStrictShallowCopy.bind(ae);ae.applyPatches.bind(ae);ae.createDraft.bind(ae);ae.finishDraft.bind(ae);var Fh=(e,t,s)=>{let{createInitialState:r,...i}=e,n={},o={},l={};return r&&(l=r({props:t,constants:s})),Object.entries(i).forEach(([p,a])=>{if(p.startsWith("select")){n[p]=(...c)=>a({state:l,props:t,constants:s},...c);return}o[p]=(c={})=>{let d=c===void 0?{}:c;if(!Qe(d))throw new Error(`[Store] Action '${p}' expects payload to be an object.`);return l=Mh(l,h=>a({state:h,props:t,constants:s},d)),l}}),{getState:()=>l,...o,...n}},_n=e=>!Qe(e)||Object.isFrozen(e)?e:(Object.values(e).forEach(t=>{_n(t)}),Object.freeze(e)),Kh=({setupConstants:e,fileConstants:t})=>{let s=Qe(e)?e:{},r=Qe(t)?t:{};return _n({...s,...r})},Uh=(e,t)=>{if(!t||typeof t!="object")return"";let s="",r=n=>Object.entries(n).map(([o,l])=>` ${o}: ${l};`).join(`
|
|
1508
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let s=t.composedPath();(s[0]===this._dialogElement||s[0].nodeName==="DIALOG"&&s[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let s=t.composedPath();(s[0]===this._dialogElement||s[0].nodeName==="DIALOG"&&s[0]===this._dialogElement)&&(t.preventDefault(),this._emitClose())}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._emitClose()}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._contentWrapper=null,this._isOpen=!1,this._positionFrameId=null,this._revealFrameId=null,this._positionVersion=0,this._isObservingResize=!1,this._observedContentWrapper=null,this._resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>{this._isOpen&&this._schedulePositionUpdate()}):null}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y","place","no-overlay","content-w","content-h","content-wh","content-g","content-sv","content-ph","content-pv","content-bgc","content-style"]}connectedCallback(){this._syncContentWrapper({reposition:!1}),this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._cancelScheduledPositionUpdate(),this._stopResizeObserver(),this._isOpen&&this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,s,r){t==="open"?r!==null&&!this._isOpen?this.isConnected&&this._show():r===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="place")&&this._isOpen?this._schedulePositionUpdate():t==="no-overlay"&&s!==r&&this._isOpen?(this._hide(),this._show()):t.startsWith("content-")&&this._syncContentWrapper()}_isIgnorableTextNode(t){return t?.nodeType===Node.TEXT_NODE&&t.textContent?.trim()===""}_ensureContentWrapper(){if(this._contentWrapper?.parentNode===this)return this._contentWrapper;let t=Array.from(this.children).find(s=>s.hasAttribute(Or));return t?this._contentWrapper=t:(this._contentWrapper=document.createElement("rtgl-view"),this._contentWrapper.setAttribute(Or,""),this._contentWrapper.setAttribute("part","content"),this._contentWrapper.setAttribute("bgc","su"),this._contentWrapper.setAttribute("bw","xs"),this._contentWrapper.setAttribute("bc","bo"),this._contentWrapper.setAttribute("br","md"),this._contentWrapper.setAttribute("ph","sm"),this._contentWrapper.setAttribute("pv","sm"),this._contentWrapper.setAttribute("style",os)),this._contentWrapper.parentNode!==this&&this.appendChild(this._contentWrapper),this._contentWrapper}_syncContentWrapperAttributes(){let t=this._ensureContentWrapper(),s=[["content-w","w"],["content-h","h"],["content-wh","wh"],["content-g","g"],["content-sv","sv"]];for(let[i,n]of s){let o=this.getAttribute(i);o===null?t.removeAttribute(n):t.setAttribute(n,o)}t.setAttribute("bgc",this.getAttribute("content-bgc")||"su"),t.setAttribute("ph",this.getAttribute("content-ph")||"sm"),t.setAttribute("pv",this.getAttribute("content-pv")||"sm");let r=this.getAttribute("content-style");t.setAttribute("style",r?`${os} ${r}`:os)}_syncContentWrapper({reposition:t=!0}={}){let s=this._ensureContentWrapper(),r=Array.from(this.childNodes).filter(n=>n!==s&&!this._isIgnorableTextNode(n));for(let n of r)n.nodeType===Node.ELEMENT_NODE&&n.getAttribute("slot")==="content"&&n.removeAttribute("slot"),s.appendChild(n);this._syncContentWrapperAttributes(),Array.from(s.childNodes).some(n=>!this._isIgnorableTextNode(n))||this.hasAttribute("open")?s.setAttribute("slot","content"):s.removeAttribute("slot"),t&&this._isOpen&&this._schedulePositionUpdate()}_show(){this._isOpen||(this._syncContentWrapper({reposition:!1}),this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._startResizeObserver(),this._dialogElement.open?this._schedulePositionUpdate():setTimeout(()=>{this._dialogElement&&!this._dialogElement.open&&(this.hasAttribute("no-overlay")?this._dialogElement.show():this._dialogElement.showModal()),this._schedulePositionUpdate()},0))}_hide(){this._isOpen&&(this._isOpen=!1,this._cancelScheduledPositionUpdate(),this._stopResizeObserver(),this._dialogElement.open&&this._dialogElement.close(),this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_startResizeObserver(){this._resizeObserver&&(this._isObservingResize||(this._resizeObserver.observe(this._popoverContainer),this._isObservingResize=!0),this._contentWrapper&&this._observedContentWrapper!==this._contentWrapper&&(this._observedContentWrapper&&this._resizeObserver.unobserve(this._observedContentWrapper),this._resizeObserver.observe(this._contentWrapper),this._observedContentWrapper=this._contentWrapper))}_stopResizeObserver(){this._resizeObserver?.disconnect(),this._isObservingResize=!1,this._observedContentWrapper=null}_cancelScheduledPositionUpdate(){this._positionFrameId!==null&&(cancelAnimationFrame(this._positionFrameId),this._positionFrameId=null),this._revealFrameId!==null&&(cancelAnimationFrame(this._revealFrameId),this._revealFrameId=null),this._positionVersion+=1,this.removeAttribute("positioned")}_readCoordinateAttr(t){let s=parseFloat(this.getAttribute(t)||"0");return Number.isFinite(s)?s:0}_schedulePositionUpdate(){this._isOpen&&(this.removeAttribute("positioned"),this._positionVersion+=1,this._positionFrameId===null&&(this._positionFrameId=requestAnimationFrame(()=>{if(this._positionFrameId=null,!this._isOpen)return;if(!this._dialogElement.open){this._schedulePositionUpdate();return}this._syncContentWrapper({reposition:!1}),this._startResizeObserver();let t=this._readCoordinateAttr("x"),s=this._readCoordinateAttr("y"),r=this.getAttribute("place")||"bs",i=this._popoverContainer.getBoundingClientRect(),{left:n,top:o}=this._calculatePosition(t,s,i.width,i.height,r);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${o}px`;let l=this._positionVersion;this._revealFrameId=requestAnimationFrame(()=>{this._revealFrameId=null,this._isOpen&&this._positionVersion===l&&this.setAttribute("positioned","")})})))}_calculatePosition(t,s,r,i,n){return Ir({x:t,y:s,width:r,height:i,place:n,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight})}get popover(){return this._popoverContainer}get content(){return this._contentWrapper}refreshContent(){this._syncContentWrapper()}},Tr=({render:e,html:t})=>as;var yo=(e,t)=>{let{store:s,render:r}=e;s.toggleOpen({}),r()},mo=Object.freeze(Object.defineProperty({__proto__:null,handleClickHeader:yo},Symbol.toStringTag,{value:"Module"})),go=()=>Object.freeze({open:!1}),bo=["id","class","style","slot","label","content"],vo=(e={})=>Object.entries(e).filter(([t])=>!bo.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),wo=({state:e,props:t})=>({label:t.label||"",content:t.content||"",openClass:e.open?"content-wrapper open":"content-wrapper",chevronIcon:e.open?"chevronUp":"chevronDown",containerAttrString:vo(t)}),_o=({state:e})=>{e.open=!e.open},xo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:go,selectViewData:wo,toggleOpen:_o},Symbol.toStringTag,{value:"Module"})),So=(e,t)=>{let{dispatchEvent:s,props:r}=e,i=t._event,n=Number(i.currentTarget.dataset.index),o=Array.isArray(r.items)?r.items[n]:void 0;if(o){if(o.disabled||o.current){i.preventDefault();return}typeof o.href=="string"&&o.href.length>0||i.preventDefault(),s(new CustomEvent("item-click",{detail:{id:o.id,path:o.path,href:o.href,item:o,index:n,trigger:i.type}}))}},Ao=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:So},Symbol.toStringTag,{value:"Module"})),ko=()=>Object.freeze({}),Eo=["id","class","style","slot","items","sep","max","separator"],$o=(e={})=>Object.entries(e).filter(([t])=>!Eo.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Co=e=>{if(e==null||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t},Io=e=>`${e}`.replace(/"/g,"""),Oo=(e,t)=>{if(!t||t<3||e.length<=t)return e;let s=t-2;return[e[0],{isEllipsis:!0,label:"..."},...e.slice(-s)]},To=e=>e.map((t,s)=>{let r=typeof t.href=="string"&&t.href.length>0,i=t.path!==void 0&&t.path!==null&&`${t.path}`!="",n=!!t.current,o=!!t.disabled,l=!n&&!o&&(r||i||!!t.click),p=t.rel||(t.newTab?"noopener noreferrer":""),a=[t.newTab?'target="_blank"':"",p?`rel="${Io(p)}"`:""].filter(Boolean).join(" ");return{...t,label:t.label||"",index:s,href:r?t.href:void 0,path:i?t.path:void 0,isCurrent:n,isDisabled:o,isInteractive:l,linkExtraAttrs:a,c:n?"fg":"mu-fg"}}),Lo=({props:e})=>{let t=$o(e),s=Array.isArray(e.items)?e.items:[],r=Co(e.max),i=e.sep||"breadcrumb-arrow",n=To(s),o=Oo(n,r),l=[];return o.forEach((p,a)=>{l.push(p),a<o.length-1&&l.push({isSeparator:!0})}),{containerAttrString:t,items:l,sep:i}},Vo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:ko,selectViewData:Lo},Symbol.toStringTag,{value:"Module"})),No=["id","class","style","slot","head","desc","size","d","ah","av","wrap","noWrap","g","gh","gv","p","pt","pr","pb","pl","pv","ph","bw","bwt","bwr","bwb","bwl","bc","br","shadow","bgc","href","newTab","rel","cur","sv","sh","overflow"],Lr={sm:{cardAttrString:"p=md sm-p=sm g=md sm-g=sm",headerAttrString:"g=xs",headingSize:"lg",subheadingSize:"sm"},md:{cardAttrString:"p=lg md-p=md sm-p=md g=lg md-g=md sm-g=md",headerAttrString:"g=sm",headingSize:"h4",subheadingSize:"sm"},lg:{cardAttrString:"p=xl lg-p=lg md-p=md sm-p=md g=lg md-g=md sm-g=md",headerAttrString:"g=sm",headingSize:"h3",subheadingSize:"md"}},Ro=(e={})=>Object.entries(e).filter(([t])=>!No.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),jo=()=>Object.freeze({}),Do=({props:e={}})=>{let t=Lr[e.size]?e.size:"md",s=Lr[t];return{containerAttrString:Ro(e),cardAttrString:s.cardAttrString,headerAttrString:s.headerAttrString,headingSize:s.headingSize,subheadingSize:s.subheadingSize,head:e.head||"",desc:e.desc||"",hasHeader:!!(e.head||e.desc),size:t}},Po=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:jo,selectViewData:Do},Symbol.toStringTag,{value:"Module"})),Bo=(e={})=>e.type==="section"||e.type==="label"?"section":e.type==="separator"?"separator":"item",zo=(e,t)=>{let{render:s,refs:r}=e,{oldProps:i={},newProps:n={}}=t,o=i.items!==n.items&&!!n.open;s(),o&&r?.popover?.refreshContent?.()},Wo=(e,t)=>{let{dispatchEvent:s}=e;s(new CustomEvent("close"))},Mo=(e,t)=>{let{dispatchEvent:s,props:r}=e,i=t._event,n=Number(i.currentTarget.dataset.index??i.currentTarget.id.slice(6)),o=r.items[n],l=Bo(o);if(!o||l!=="item"||o.disabled){i.preventDefault();return}o.href||i.preventDefault(),s(new CustomEvent("item-click",{detail:{index:n,item:o,id:o.id,path:o.path,href:o.href,trigger:i.type}}))},Fo=Object.freeze(Object.defineProperty({__proto__:null,handleClickMenuItem:Mo,handleClosePopover:Wo,handleOnUpdate:zo},Symbol.toStringTag,{value:"Module"})),Ko=()=>Object.freeze({}),Uo=e=>`${e}`.replace(/"/g,"""),Ho=(e={})=>e.type==="section"||e.type==="label"?"section":e.type==="separator"?"separator":"item",qo=e=>e.map((t,s)=>{let r=Ho(t),i=r==="separator",n=r==="section",o=r==="item",l=!!t.disabled,p=o&&!l,a=Object.prototype.hasOwnProperty.call(t,"icon"),c=typeof t.icon=="string"&&t.icon.length>0?t.icon:"",d=typeof t.shortcut=="string"&&t.shortcut.length>0?t.shortcut:typeof t.suffixText=="string"&&t.suffixText.length>0?t.suffixText:"",h=l?"mu-fg":"fg",f=l?"mu":"",u=l?"":"ac",y=h,m="mu-fg",b=typeof t.href=="string"&&t.href.length>0,g=t.rel||(t.newTab?"noopener noreferrer":""),_=[t.newTab?'target="_blank"':"",g?`rel="${Uo(g)}"`:""].filter(Boolean).join(" ");return{...t,index:s,type:r,isSeparator:i,isSection:n,isItem:o,isDisabled:l,isInteractive:p,hasIconSlot:a,icon:c,hasIcon:c.length>0,suffixText:d,hasSuffixText:d.length>0,hasHref:b,linkExtraAttrs:_,c:h,bgc:f,hoverBgc:u,iconColor:y,suffixTextColor:m}}),Yo=({props:e})=>{let t=Array.isArray(e.items)?e.items:[];return{items:qo(t),open:!!e.open,x:e.x||0,y:e.y||0,w:e.w||"300",h:e.h||"300",place:e.place||"bs"}},Go=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Ko,selectViewData:Yo},Symbol.toStringTag,{value:"Module"})),w={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9,PARTIAL:10,PATH_REFERENCE:11},D={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},ms={NOT:0},$=class extends Error{constructor(e){super(`Parse Error: ${e}`),this.name="JemplParseError"}},de=class extends Error{constructor(e){super(`Render Error: ${e}`),this.name="JemplRenderError"}},Vr=e=>{if(!e||e.trim()==="")throw new $("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let s=e.includes("===")?"==":"!=";throw new $(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${s}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let s of t)if(e.trim().endsWith(s))throw new $(`Incomplete comparison expression - missing right operand (got: '${e}')`)},Jo=e=>{if(e.trim().endsWith(" in"))throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new $(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,s]=e.split(" in ");if(!s||s.trim()==="")throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);let r=t.includes(",")?t.split(",").map(i=>i.trim()):[t.trim()];for(let i of r){if(!i)throw new $(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(i))throw new $(`Invalid loop syntax (got: '$for ${e}')`)}},Zo=(e,t,s=!1)=>{if(t===null)return new de(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new de(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return s?new de(`Cannot iterate over non-array value in loop '${e}' - got ${r} instead`):new de(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},Xo=(e,t)=>{let s=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new de(`Unknown function '${e}' (${s})`)},Qo=(e,t,s={})=>{let r={},i={};s&&typeof s=="object"&&(s.functions!==void 0||s.partials!==void 0?(r=s.functions||{},i=s.partials||{}):typeof s=="object"&&(r=s));let n=N(e,{functions:r,partials:i},t,{});return n===void 0?{}:n},N=(e,t,s,r)=>{if(t.functions,e.var&&!e.type)return K(e.var,s,r);if(e.type===w.LITERAL)return e.value;if(e.type===w.VARIABLE)return K(e.path,s,r);if(e.type===w.INTERPOLATION)return ta(e.parts,t,s,r);switch(e.type){case w.FUNCTION:return yi(e,t,s,r);case w.BINARY:return mi(e,t,s,r);case w.UNARY:return gi(e,t,s,r);case w.CONDITIONAL:return ra(e,t,s,r);case w.LOOP:return la(e,t,s,r);case w.OBJECT:return da(e,t,s,r);case w.ARRAY:return ca(e,t,s,r);case w.PARTIAL:return ua(e,t,s,r);case w.PATH_REFERENCE:return ha(e,t,s,r);default:throw new Error(`Unknown node type: ${e.type}`)}},Nr=new Map,ea=e=>{let t=[],s="",r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(n==="[")s&&(t.push({type:"property",value:s}),s=""),r=!0;else if(n==="]"){if(r&&s){let o=s.trim();if(/^\d+$/.test(o))t.push({type:"index",value:parseInt(o,10)});else if(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'")){let l=o.slice(1,-1);t.push({type:"property",value:l})}else t.push({type:"property",value:o});s=""}r=!1}else s+=n}return s&&t.push({type:"property",value:s}),t},K=(e,t,s)=>{if(!e)return;if(e in s)return s[e];let r=Nr.get(e);if(!r){let n=[],o="",l=0;for(let p=0;p<e.length;p++){let a=e[p];a==="["?(l++,o+=a):a==="]"?(l--,o+=a):a==="."&&l===0?o&&(n.push(o),o=""):o+=a}o&&n.push(o),r=[];for(let p of n){let a=ea(p.trim());r.push(...a)}Nr.set(e,r)}let i=t;for(let n=0;n<r.length;n++){let o=r[n];if(o.type==="property"&&o.value in s){i=s[o.value];continue}if(i==null)return;(o.type==="property"||o.type==="index")&&(i=i[o.value])}return i},ta=(e,t,s,r)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let o=N(n,t,s,r);i.push(o!=null?String(o):"")}return i.join("")},yi=(e,t,s,r)=>{let i=t.functions||t,n=i[e.name];if(!n)throw Xo(e.name,i);let o=e.args.map(l=>N(l,t,s,r));return n(...o)},De=(e,t,s,r)=>{if(e.var&&!e.type)return K(e.var,s,r);switch(e.type){case w.VARIABLE:return K(e.path,s,r);case w.LITERAL:return e.value;case w.BINARY:return mi(e,t,s,r);case w.UNARY:return gi(e,t,s,r);case w.FUNCTION:return yi(e,t,s,r);default:return N(e,t,s,r)}},mi=(e,t,s,r)=>{if(e.op===D.AND||e.op===D.OR){let o=De(e.left,t,s,r),l=De(e.right,t,s,r);switch(e.op){case D.AND:return o&&l;case D.OR:return o||l}}let i=N(e.left,t,s,r),n=N(e.right,t,s,r);switch(e.op){case D.EQ:return i==n;case D.NEQ:return i!=n;case D.GT:return i>n;case D.LT:return i<n;case D.GTE:return i>=n;case D.LTE:return i<=n;case D.IN:return Array.isArray(n)?n.includes(i):!1;case D.ADD:if(typeof i!="number"||typeof n!="number")throw new de(`Arithmetic operations require numbers. Got ${typeof i} + ${typeof n}`);return i+n;case D.SUBTRACT:if(typeof i!="number"||typeof n!="number")throw new de(`Arithmetic operations require numbers. Got ${typeof i} - ${typeof n}`);return i-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},gi=(e,t,s,r)=>{let i=e.op===ms.NOT?De(e.operand,t,s,r):N(e.operand,t,s,r);switch(e.op){case ms.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},sa=(e,t,s,r)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===w.VARIABLE)if(K(i.path,s,r)){let n=e.bodies[0];if(n.type===w.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?N(l.parsedKey,t,s,r):l.key,a=l.value;if(a.type===w.LITERAL)o[p]=a.value;else if(a.type===w.VARIABLE)o[p]=K(a.path,s,r);else if(a.type===w.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let h=K(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=N(d,t,s,r);c.push(h!=null?String(h):"")}o[p]=c.join("")}else o[p]=N(a,t,s,r)}return o}}else{let n=e.bodies[1];if(n.type===w.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?N(l.parsedKey,t,s,r):l.key,a=l.value;if(a.type===w.LITERAL)o[p]=a.value;else if(a.type===w.VARIABLE)o[p]=K(a.path,s,r);else if(a.type===w.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let h=K(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=N(d,t,s,r);c.push(h!=null?String(h):"")}o[p]=c.join("")}else o[p]=N(a,t,s,r)}return o}}}return null},ra=(e,t,s,r)=>{let i=sa(e,t,s,r);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||De(o,t,s,r))return N(e.bodies[n],t,s,r)}return bi},ia=(e,t)=>{let s=e.body,r=e.itemVar;if(s.type===w.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===w.VARIABLE){let i=s.conditions[0].path,n=s.bodies[0];if(i.startsWith(r+".")){let o=i.substring(r.length+1);if(n.type===w.OBJECT&&n.properties.length<=5){for(let p of n.properties)if(p.parsedKey)return null;let l=[];for(let p=0;p<t.length;p++){let a=t[p];if(a[o]){let c={};for(let d of n.properties){let h=d.key,f=d.value;if(f.type===w.LITERAL)c[h]=f.value;else if(f.type===w.VARIABLE){let u=f.path;if(u===r)c[h]=a;else if(u.startsWith(r+".")){let y=u.substring(r.length+1);c[h]=a[y]}else return null}else if(f.type===w.INTERPOLATION){let u=[],y=!0;for(let m of f.parts)if(typeof m=="string")u.push(m);else if(m.type===w.VARIABLE){let b=m.path;if(b===r)u.push(a!=null?String(a):"");else if(b.startsWith(r+".")){let g=b.substring(r.length+1),_=a[g];u.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[h]=u.join("")}else return null}l.push(c)}}return l}}}return null},na=(e,t)=>{let s=e.body,r=e.itemVar,i=ia(e,t);if(i!==null)return i;if(s.type===w.OBJECT&&s.properties.length<=5&&!s.whenCondition){for(let l of s.properties)if(l.parsedKey)return null;let n=[],o=!0;for(let l of s.properties){let p=l.key,a=l.value;if(a.type===w.LITERAL)n.push({key:p,type:"literal",value:a.value});else if(a.type===w.VARIABLE){let c=a.path;if(c===r)n.push({key:p,type:"item"});else if(c.startsWith(r+".")){let d=c.substring(r.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:p,type:"prop",prop:d});else{o=!1;break}}else{o=!1;break}}else if(a.type===w.INTERPOLATION&&a.parts.length===1){let c=a.parts[0];if(c.type===w.VARIABLE){let d=c.path;if(d===r)n.push({key:p,type:"item_string"});else if(d.startsWith(r+".")){let h=d.substring(r.length+1);if(!h.includes(".")&&!h.includes("["))n.push({key:p,type:"prop_string",prop:h});else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}if(o){let l=new Array(t.length);if(n.length===3&&n[0].type==="prop"&&n[0].key==="id"&&n[1].type==="prop_string"&&n[1].key==="title"&&n[2].type==="prop"&&n[2].key==="completed")for(let p=0;p<t.length;p++){let a=t[p];l[p]={id:a.id,title:a.title!=null?String(a.title):"",completed:a.completed}}else for(let p=0;p<t.length;p++){let a=t[p],c={};for(let d of n)if(d.type==="literal")c[d.key]=d.value;else if(d.type==="item")c[d.key]=a;else if(d.type==="prop")c[d.key]=a[d.prop];else if(d.type==="item_string")c[d.key]=a!=null?String(a):"";else if(d.type==="prop_string"){let h=a[d.prop];c[d.key]=h!=null?String(h):""}l[p]=c}return l}}return null},oa=(e,t,s,r,i)=>{let n=[],o=e.body;if(o.type===w.OBJECT&&o.fast!==!1){let l=e.itemVar,p=e.indexVar;for(let a=0;a<i.length;a++){let c=i[a],d={},h={...r,[l]:c,...p&&{[p]:a}};h.__paths__||(h.__paths__=r.__paths__||{});let f=e.iterable.path||"";if(r&&r.__paths__&&f){let u=f.split("."),y=u[0];y in r.__paths__&&(f=r.__paths__[y],u.length>1&&(f+="."+u.slice(1).join(".")))}h.__paths__={...h.__paths__,[l]:`${f}[${a}]`,...p&&{[p]:a}};for(let u of o.properties){let y=u.parsedKey?N(u.parsedKey,t,s,h):u.key,m=u.value;if(m.type===w.LITERAL)d[y]=m.value;else if(m.type===w.VARIABLE){let b=m.path;if(b===l)d[y]=c;else if(b===p)d[y]=a;else if(b.startsWith(l+".")){let g=b.substring(l.length+1);!g.includes(".")&&!g.includes("[")?d[y]=c[g]:d[y]=K(b,s,{...r,[l]:c,...p&&{[p]:a}})}else d[y]=K(b,s,{...r,[l]:c,...p&&{[p]:a}})}else if(m.type===w.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=g.path,S;if(_===l)S=c;else if(_===p)S=a;else if(_.startsWith(l+".")){let A=_.substring(l.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=K(_,s,{...r,[l]:c,...p&&{[p]:a}})}else S=K(_,s,{...r,[l]:c,...p&&{[p]:a}});b.push(S!=null?String(S):"")}else{let _={...r,[l]:c,...p&&{[p]:a}},S=N(g,t,s,_);b.push(S!=null?String(S):"")}d[y]=b.join("")}else{let b={...r,[l]:c,...p&&{[p]:a}};d[y]=N(m,t,s,b)}}n.push(d)}return n}return null},aa=(e,t,s)=>{let r=e.body;if(r.type===w.OBJECT&&r.properties.length===1&&r.properties[0].key==="$if item.visible"){let i=r.properties[0].value;if(i.type===w.CONDITIONAL&&i.conditions.length===1&&i.conditions[0].type===w.VARIABLE&&i.conditions[0].path==="item.visible"){let n=i.bodies[0];if(n.type===w.OBJECT&&n.properties.length===2){let o=n.properties[0],l=n.properties[1];if(o.key==="id"&&o.value.type===w.VARIABLE&&o.value.path==="item.id"&&l.key==="$if item.highlighted"&&l.value.type===w.CONDITIONAL){let p=[];for(let a=0;a<t.length;a++){let c=t[a];if(c.visible){let d={id:c.id};c.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${c.name}`):(d.highlight=!1,d.message=c.name),p.push(d)}}return p}}}}return null},la=(e,t,s,r)=>{let i=N(e.iterable,t,s,r);if(!Array.isArray(i)){let a,c=!1;if(e.iterable.type===w.FUNCTION){c=!0;let h=e.iterable.args.map(f=>f.type===w.LITERAL?typeof f.value=="string"?`'${f.value}'`:String(f.value):f.type===w.VARIABLE?f.path:f.type===w.FUNCTION?`${f.name}(...)`:"?").join(", ");a=`${e.iterable.name}(${h})`}else a=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${a}`;throw Zo(d,i,c)}if(!e.indexVar){let a=aa(e,i,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=na(e,i);if(a!==null)return a}let n=oa(e,t,s,r,i);if(n!==null)return n;let o=[],l=e.iterable.path||"";if(r&&r.__paths__&&l){let a=l.split("."),c=a[0];c in r.__paths__&&(l=r.__paths__[c],a.length>1&&(l+="."+a.slice(1).join(".")))}let p=!1;e.body.type===w.ARRAY&&(e.body.items.length<=1?p=!1:p=e.body._shouldPreserveArray??=e.body.items.some(a=>a.type===w.OBJECT&&a.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let a=0;a<i.length;a++){let c=e.indexVar?{...r,[e.itemVar]:i[a],[e.indexVar]:a}:{...r,[e.itemVar]:i[a]};c.__paths__||(c.__paths__=r.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${l}[${a}]`},e.indexVar&&(c.__paths__[e.indexVar]=a);let d=N(e.body,t,s,c);if(Array.isArray(d)&&d.length===1&&!p){let h=d[0];o.push(h===void 0?{}:h)}else o.push(d===void 0?{}:d)}return o},pa=(e,t,s,r)=>{if(e.whenCondition)return null;if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?N(i.parsedKey,t,s,r):i.key,o=i.value;if(o.type===w.OBJECT&&o.properties.length<=10&&!o.whenCondition){let l={},p={},a=!0;for(let c of o.properties){let d=c.parsedKey?N(c.parsedKey,t,s,r):c.key,h=c.value;if(h.type===w.LITERAL)p[d]=h.value;else if(h.type===w.VARIABLE)p[d]=K(h.path,s,r);else if(h.type===w.INTERPOLATION){let f=[];for(let u of h.parts)if(typeof u=="string")f.push(u);else if(u.type===w.VARIABLE){let y=K(u.path,s,r);f.push(y!=null?String(y):"")}else{a=!1;break}if(!a)break;p[d]=f.join("")}else if(h.type===w.OBJECT&&h.properties.length<=5){let f={};for(let u of h.properties){let y=u.key,m=u.value;if(m.type===w.LITERAL)f[y]=m.value;else if(m.type===w.VARIABLE)f[y]=K(m.path,s,r);else if(m.type===w.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=K(g.path,s,r);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[y]=b.join("")}else{a=!1;break}}if(!a)break;p[d]=f}else{a=!1;break}}if(a)return l[n]=p,l}}return null},da=(e,t,s,r)=>{let i=t.functions||t;if(e.whenCondition&&!De(e.whenCondition,i,s,r))return;let n=pa(e,t,s,r);if(n!==null)return n;if(e.fast){let p={};for(let a of e.properties){let c=a.parsedKey?N(a.parsedKey,t,s,r):a.key,d=a.value;if(d.type===w.LITERAL)p[c]=d.value;else if(d.type===w.VARIABLE)p[c]=K(d.path,s,r);else if(d.type===w.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===w.VARIABLE){let u=K(f.path,s,r);h.push(u!=null?String(u):"")}else{let u=N(f,t,s,r);h.push(u!=null?String(u):"")}p[c]=h.join("")}else p[c]=N(d,t,s,r)}return p}let o={},l=!1;for(let p of e.properties)if(!p.key.startsWith("$if ")&&!p.key.match(/^\$if\s+\w+.*:?$/)&&!p.key.startsWith("$elif")&&!p.key.startsWith("$else")&&!p.key.startsWith("$for ")){l=!0;break}for(let p of e.properties)if(p.key.startsWith("$if ")||p.key.match(/^\$if\s+\w+.*:?$/)){let a=N(p.value,t,s,r);if(!l&&a!==null&&a!==void 0)return Array.isArray(a)&&a.length===1?a[0]:a;typeof a=="object"&&a!==null&&!Array.isArray(a)&&Object.assign(o,a)}else if(p.key.startsWith("$for ")){if(e.properties.length===1)return N(p.value,t,s,r)}else{let a=p.value;if(a&&a.type===w.OBJECT&&a.properties){let c=a.properties.find(d=>d.key.startsWith("$for "));if(c){let d=N(c.value,t,s,r);d!==void 0&&(o[p.key]=d)}else{let d=N(p.value,t,s,r);d!==void 0&&(o[p.key]=d)}}else{let c=p.parsedKey?N(p.parsedKey,t,s,r):p.key,d=N(p.value,t,s,r);d!==void 0&&(o[c]=d)}}return o},bi={},ca=(e,t,s,r)=>{let i=[];for(let n of e.items)if(n.type===w.LOOP){let o=N(n,t,s,r);Array.isArray(o)&&n.flatten!==!1?i.push(...o):i.push(o)}else{let o=N(n,t,s,r);o!==bi&&o!==void 0&&i.push(o)}return i},ua=(e,t,s,r)=>{let{name:i,data:n,whenCondition:o}=e,l=t.partials||{},p=t.functions||t;if(o&&!De(o,p,s,r))return;if(!l[i])throw new de(`Partial '${i}' is not defined`);let a=r._partialStack||[];if(a.includes(i))throw new de(`Circular partial reference detected: ${i}`);let c=l[i],d=s,h={...r,_partialStack:[...a,i]};if(r){d={...s};for(let f of Object.keys(r))f.startsWith("_")||(d[f]=r[f])}if(n){let f=N(n,t,s,r);d={...d,...f}}return N(c,t,d,h)},ha=(e,t,s,r)=>{let{path:i}=e,n=i.split("."),o=n[0],l=n.slice(1);if(!r||!(o in r))throw new de(`Path reference '#{${i}}' refers to '${o}' which is not a loop variable in the current scope`);if(r.__paths__||(r.__paths__={}),!(o in r.__paths__))throw new de(`Path reference '#{${i}}' cannot be resolved - path tracking may not be initialized properly`);let p=r.__paths__[o];if(typeof p=="number"){if(l.length>0)throw new de(`Path reference '#{${i}}' - cannot access properties on index variable '${o}'`);return String(p)}return l.length>0&&(p+="."+l.join(".")),p},fa=/\$\{([^}]*)\}/g,ya=/#\{([^}]*)\}/g,vi=(e,t={})=>{let s=e.match(/^(\w+)\((.*)\)$/);if(!s)return{isFunction:!1};let[,r,i]=s,n=ma(i,t);return{isFunction:!0,type:w.FUNCTION,name:r,args:n}},ma=(e,t={})=>e.trim()?ga(e).map(s=>ba(s.trim(),t)):[],ga=e=>{let t=[],s="",r=0,i=!1,n="";for(let o=0;o<e.length;o++){let l=e[o],p=o>0?e[o-1]:"";!i&&(l==='"'||l==="'")?(i=!0,n=l,s+=l):i&&l===n&&p!=="\\"?(i=!1,n="",s+=l):!i&&l==="("?(r++,s+=l):!i&&l===")"?(r--,s+=l):!i&&l===","&&r===0?(t.push(s),s=""):s+=l}return s&&t.push(s),t},ba=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:w.LITERAL,value:parseFloat(e)};if(e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};let s=vi(e,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};let r=e.trim(),i=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:o,type:l}of i){let p=0;for(;p<r.length;){let a=Le(r.substring(p),o);if(a===-1)break;let c=p+a;c>n&&(n=c),p=c+o.length}}if(n!==-1)try{return X(r,t)}catch{return{type:w.VARIABLE,path:r}}return{type:w.VARIABLE,path:r}},wi=/^\w+\(.*\)$/,va=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,wa=e=>{if(!(!e||e.trim()===""||wi.test(e))&&va.test(e))throw e.includes("?")&&e.includes(":")?new $(`Complex expressions not supported in variable replacements - consider calculating the value in your data instead. Offending expression: "${e}"`):e.includes("||")||e.includes("&&")||e.includes("??")?new $(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new $(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},Rr=e=>{let t=e.trim();if(wi.test(t))throw new $(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new $(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new $(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new $(`Logical operators not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("?")&&t.includes(":"))throw new $(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:w.PATH_REFERENCE,path:t}},mt=(e,t={})=>{let s=e.trim();wa(s);let r=vi(s,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};if(s.includes("[")&&!/[\s+\-*/%|&?:]/.test(s)){let i=0;for(let n of s)n==="["?i++:n==="]"&&i--;if(i!==0)throw new Error("Invalid array index syntax")}return{type:w.VARIABLE,path:s}},_i=(e,t={})=>{let s=e,r=[];(e.includes("\\${")||e.includes("\\#{"))&&(s=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),s=s.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),s=s.replace(/\\(\$\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\(#\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\DOUBLE_ESC_VAR/g,"\\"),s=s.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let i=[...s.matchAll(fa)],n=[...s.matchAll(ya)],o=[...i.map(a=>({match:a,type:"variable"})),...n.map(a=>({match:a,type:"pathref"}))].sort((a,c)=>a.match.index-c.match.index);if(o.length===0){let a=s;for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);return{type:w.LITERAL,value:a}}if(o.length===1&&o[0].match[0]===s&&r.length===0){let{match:a,type:c}=o[0];try{return c==="variable"?mt(a[1],t):Rr(a[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:w.LITERAL,value:s};throw d}}let l=[],p=0;for(let{match:a,type:c}of o){let[d,h]=a,f=a.index;if(f>p){let u=s.substring(p,f);for(let y=0;y<r.length;y++)u=u.replace(`__ESCAPED_${y}__`,r[y]);u&&l.push(u)}try{let u;c==="variable"?u=mt(h.trim(),t):u=Rr(h.trim()),l.push(u)}catch(u){if(u.message==="Invalid array index syntax")l.push(d);else throw u}p=f+d.length}if(p<s.length){let a=s.substring(p);for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);a&&l.push(a)}return{type:w.INTERPOLATION,parts:l}},ke=(e,t)=>typeof e=="string"?_i(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?xa(e,t):Sa(e,t):{type:w.LITERAL,value:e},_a=e=>{let{$each:t,...s}=e;if(typeof t!="string")throw new $("$each value must be a non-empty string");let r=t.trim();if(r==="")throw new $("$each value must be a non-empty string");if(Object.keys(s).length===0)throw new $("Empty $each body not allowed");if(s.$partial!==void 0)throw new $("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${r}`]:s}},xa=(e,t)=>{let s=[],r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let p=_a(n),a=Object.keys(p);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let c=jr(a[0],p[a[0]],t,!0);s.push(c),r=!0;continue}}catch(p){throw p instanceof $?p:new $(p.message)}let l=Object.keys(n);if(l.length===1&&/^\$for(?::\w+)?\s/.test(l[0])){let p=jr(l[0],n[l[0]],t);s.push(p),r=!0;continue}}let o=ke(n,t);s.push(o),(o.type===w.FUNCTION||o.type===w.CONDITIONAL||o.type===w.LOOP||o.type===w.PARTIAL||o.type===w.OBJECT&&!o.fast||o.type===w.ARRAY&&!o.fast)&&(r=!0)}return{type:w.ARRAY,items:s,fast:!r}},Sa=(e,t)=>{let s=[],r=!1,i=null,n=Object.entries(e),o=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new $("$partial value must be a string");if(e.$partial.trim()==="")throw new $("$partial value cannot be an empty string");let p=["$if","$elif","$else","$for"],a=[];for(let[b]of n)for(let g of p)if(b===g||b.startsWith(g+" ")||b.startsWith(g+"#")){a.push(g);break}if(a.length>0)throw new $(`Cannot use $partial with ${a.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...h}=e,f={},u=!1;for(let[b,g]of Object.entries(h)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=g,u=!0}let y=null;if(u&&(y=ke(f,t),y.type===w.OBJECT)){let b=!1;for(let g of y.properties)if(g.value.type===w.VARIABLE||g.value.type===w.INTERPOLATION||g.value.type===w.FUNCTION||g.value.type===w.CONDITIONAL||g.value.type===w.OBJECT&&!g.value.fast||g.value.type===w.ARRAY&&!g.value.fast){b=!0;break}b&&(y.fast=!1)}let m={type:w.PARTIAL,name:c,data:y};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new $("Empty condition expression after '$when'");b=X(d,t)}else b={type:w.LITERAL,value:d};m.whenCondition=b}return m}for(let[p,a]of n)if(p==="$when"){if(i!==null)throw new $("Multiple '$when' directives on the same object are not allowed");if(a==null)throw new $("Missing condition expression after '$when'");let c=typeof a=="string"?a:JSON.stringify(a);if(c.trim()==="")throw new $("Empty condition expression after '$when'");i=X(c,t),r=!0}else if(p.startsWith("$when#")||p.startsWith("$when "))throw new $("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;o<n.length;){let[p,a]=n[o];if(p==="$when"){o++;continue}if(p==="$each")throw new $("$each can only be used inside arrays");if(p.startsWith("$if ")||p.match(/^\$if#\w+\s/)||p.match(/^\$if\s+\w+.*:$/)){let c=Aa(n,o,t);s.push({key:p,value:c.node}),r=!0,o=c.nextIndex}else if(/^\$for(?::\w+)?\s/.test(p)){let c=p.match(/^\$for(?::(\w+))?\s/)?.[1]||"",d=c?`:${c}`:"";throw new $(`$for loops must be inside arrays - use '- $for${d} item in items:' instead of '$for${d} item in items:'. For cleaner object generation syntax, consider using $each.`)}else{if(p.startsWith("$elif ")||p.startsWith("$else"))throw new $(`'${p.split(" ")[0]}' without matching '$if'`);if(p==="$if"||p==="$if:")throw new $("Missing condition expression after '$if'");{let c=ke(a,t);(c.type===w.FUNCTION||c.type===w.CONDITIONAL||c.type===w.PARTIAL||c.type===w.OBJECT&&!c.fast||c.type===w.ARRAY&&!c.fast)&&(r=!0);let d=_i(p,t),h={key:p,value:c};(d.type!==w.LITERAL||d.value!==p)&&(h.parsedKey=d),s.push(h),o++}}}let l={type:w.OBJECT,properties:s,fast:!r};return i&&(l.whenCondition=i),l},Aa=(e,t,s={})=>{let r=[],i=[],n=t,[o,l]=e[n],p=null,a;if(o.startsWith("$if#")){let d=o.match(/^\$if#(\w+)\s+(.+)$/);if(d)p=d[1],a=d[2];else throw new $(`Invalid conditional syntax: ${o}`)}else a=o.substring(4),a.endsWith(":")&&(a=a.slice(0,-1).trim());Vr(a);let c=X(a,s);for(r.push(c),i.push(ke(l,s)),n++;n<e.length;){let[d,h]=e[n],f=!1,u;if(p?d.startsWith(`$elif#${p} `)?(u=d.substring(`$elif#${p} `.length),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d===`$else#${p}`||d===`$else#${p}:`)&&(f=!0,u=null):d.startsWith("$elif ")?(u=d.substring(6),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,u=null),f){if(u===null)r.push(null);else{Vr(u);let y=X(u,s);r.push(y)}if(i.push(ke(h,s)),n++,u===null)break}else break}return{node:{type:w.CONDITIONAL,conditions:r,bodies:i,id:p},nextIndex:n}},X=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let a=e.slice(1,-1),c=0,d=!0;for(let h=0;h<a.length;h++)if(a[h]==="("?c++:a[h]===")"&&c--,c<0){d=!1;break}if(d&&c===0)return X(a,t)}let s=Le(e,"||");if(s!==-1)return{type:w.BINARY,op:D.OR,left:X(e.substring(0,s).trim(),t),right:X(e.substring(s+2).trim(),t)};let r=Le(e,"&&");if(r!==-1)return{type:w.BINARY,op:D.AND,left:X(e.substring(0,r).trim(),t),right:X(e.substring(r+2).trim(),t)};let i=[{op:">=",type:D.GTE},{op:"<=",type:D.LTE},{op:"==",type:D.EQ},{op:"!=",type:D.NEQ},{op:">",type:D.GT},{op:"<",type:D.LT},{op:" in ",type:D.IN}];for(let{op:a,type:c}of i){let d=Le(e,a);if(d!==-1)return{type:w.BINARY,op:c,left:X(e.substring(0,d).trim(),t),right:X(e.substring(d+a.length).trim(),t)}}let n=-1,o=null,l=[{op:" + ",type:D.ADD},{op:" - ",type:D.SUBTRACT}];for(let{op:a,type:c}of l){let d=0;for(;d<e.length;){let h=Le(e.substring(d),a);if(h===-1)break;let f=d+h;f>n&&(n=f,o={op:a,type:c}),d=f+a.length}}if(n!==-1&&o)return{type:w.BINARY,op:o.type,left:X(e.substring(0,n).trim(),t),right:X(e.substring(n+o.op.length).trim(),t)};let p=[" * "," / "," % "];for(let a of p)if(Le(e,a)!==-1)throw new $(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:w.UNARY,op:ms.NOT,operand:X(e.substring(1).trim(),t)}:xi(e,t)},Le=(e,t)=>{let s=0,r=0;for(;r<=e.length-t.length;){if(e[r]==="(")s++;else if(e[r]===")")s--;else if(s===0&&e.substring(r,r+t.length)===t)return r;r++}return-1},ka=e=>{if(e=e.trim(),e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:w.LITERAL,value:""};if(e==="{}")return{type:w.LITERAL,value:{}};if(e==="[]")return{type:w.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:w.LITERAL,value:t}:{type:w.VARIABLE,path:e}},xi=(e,t)=>{let s=e.trim();if(s.match(/^(\w+)\((.*)\)$/))return mt(s,t);let r=ka(s);if(r.type===w.LITERAL)return r;if(/^[a-zA-Z_$][\w.$]*$/.test(s))return{type:w.VARIABLE,path:s};try{return mt(s,t)}catch(i){if(i.message&&i.message.includes("not supported"))return r;throw i}},Ea=(e,t=!1)=>{try{Jo(e)}catch(s){if(s instanceof $&&t){let r=s.message.replace(/\$for/g,"$each");throw new $(r.replace("Parse Error: ",""))}throw s}},jr=(e,t,s,r=!1)=>{let i=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(i);if(!n){let m=r?"$each":"$for";throw new $(`Invalid loop syntax (got: '${e.replace("$for",m)}')`)}let o=n[1],l=n[2].trim();Ea(l,r);let p=l.match(/^(.+?)\s+in\s+(.+)$/);if(!p){let m=r?"$each":"$for";throw new $(`Invalid loop syntax - missing 'in' keyword (got: '${m} ${l}')`)}let a=p[1].trim(),c=p[2].trim(),d,h=null;if(a.includes(",")){let m=a.split(",").map(b=>b.trim());if(m.length!==2)throw new $(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=m[0],h=m[1]}else d=a;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new $(`Reserved variable name: ${d}`);if(h&&f.includes(h))throw new $(`Reserved variable name: ${h}`);let u=xi(c,s),y=ke(t,s);return{type:w.LOOP,itemVar:d,indexVar:h,iterable:u,body:y,flatten:o!=="nested"}},Dr=(e,t={})=>{let{functions:s={}}=t;return ke(e,s)},$a=()=>Date.now(),Ca=Object.freeze(Object.defineProperty({__proto__:null,now:$a},Symbol.toStringTag,{value:"Module"})),Ia=(e,t,s={})=>{let{functions:r={},partials:i={}}=s,n={...Ca,...r},o=Dr(e,{functions:n}),l={};for(let[p,a]of Object.entries(i))l[p]=Dr(a,{functions:n});return Qo(o,t,{functions:n,partials:l})},js=e=>e!==null&&typeof e=="object",gt=e=>js(e)&&!Array.isArray(e),Oa=e=>typeof e=="string"&&e.includes("."),Si=e=>typeof e=="string"&&/[\[\]]/.test(e);function Ai(e,t){let s={};for(let r of t){if(typeof r!="string"||r.length===0)continue;let i=ne(e,r);i!==void 0&&he(s,r,i)}return s}function Ta(e){if(!gt(e)||!Array.isArray(e.fields))return e;let t=(s=[])=>s.map(r=>{if(!gt(r))return r;if(typeof r.$when=="string"&&r.$when.trim().length>0){let{$when:i,...n}=r,o=Array.isArray(n.fields)?{...n,fields:t(n.fields)}:n;return{[`$if ${i}`]:o}}return Array.isArray(r.fields)?{...r,fields:t(r.fields)}:r});return{...e,fields:t(e.fields)}}var ne=(e,t,s=void 0)=>{if(!t||!js(e)||Si(t))return s;let r=t.split(".").filter(n=>n!==""),i=e;for(let n of r){if(i==null||!(n in i))return Object.prototype.hasOwnProperty.call(e,t)?e[t]:s;i=i[n]}return i},he=(e,t,s)=>{if(!js(e)||typeof t!="string"||t.length===0||Si(t))return e;let r=t.split(".").filter(n=>n!=="");if(r.length===0)return e;Oa(t)&&Object.prototype.hasOwnProperty.call(e,t)&&delete e[t];let i=e;for(let n=0;n<r.length-1;n++){let o=r[n];(!(o in i)||typeof i[o]!="object"||i[o]===null)&&(i[o]={}),i=i[o]}return i[r[r.length-1]]=s,e},La=["id","class","style","slot","form","defaultValues","disabled","context"],Va=(e={})=>Object.entries(e).filter(([t,s])=>!(La.includes(t)||s==null||typeof s=="object"||typeof s=="function")).map(([t,s])=>`${t}=${String(s)}`).join(" "),Na={email:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,url:/^https?:\/\/.+/},ue={required:"This field is required",minLength:e=>`Must be at least ${e} characters`,maxLength:e=>`Must be at most ${e} characters`,pattern:"Invalid format",invalidDate:"Invalid date format",invalidTime:"Invalid time format",invalidDateTime:"Invalid date and time format",minTemporal:e=>`Must be on or after ${e}`,maxTemporal:e=>`Must be on or before ${e}`},Ra="input-date",ja="input-time",Da="input-datetime",Pa=/^(\d{4})-(\d{2})-(\d{2})$/,Ba=/^(\d{2}):(\d{2})(?::(\d{2}))?$/,za=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}(?::\d{2})?)$/,Wa=e=>{if(typeof e!="string")return null;let t=Pa.exec(e);if(!t)return null;let s=Number(t[1]),r=Number(t[2]),i=Number(t[3]);if(!Number.isInteger(s)||!Number.isInteger(r)||!Number.isInteger(i)||r<1||r>12||i<1||i>31)return null;let n=new Date(Date.UTC(s,r-1,i));return n.getUTCFullYear()===s&&n.getUTCMonth()===r-1&&n.getUTCDate()===i?{year:s,month:r,day:i}:null},Ma=e=>{if(typeof e!="string")return null;let t=Ba.exec(e);if(!t)return null;let s=Number(t[1]),r=Number(t[2]),i=t[3]===void 0?0:Number(t[3]);return!Number.isInteger(s)||!Number.isInteger(r)||!Number.isInteger(i)||s<0||s>23||r<0||r>59||i<0||i>59?null:{hour:s,minute:r,second:i}},ki=e=>{let t=Ma(e);return t?`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}`:null},Ei=e=>Wa(e)?e:null,Fa=e=>{if(typeof e!="string")return null;let t=za.exec(e);if(!t)return null;let s=Ei(t[1]),r=ki(t[2]);return!s||!r?null:`${s}T${r}`},Ka=e=>e===Ra?{normalize:Ei,invalidMessage:ue.invalidDate}:e===ja?{normalize:ki,invalidMessage:ue.invalidTime}:e===Da?{normalize:Fa,invalidMessage:ue.invalidDateTime}:null,Ua=(e,t)=>{let s=Ka(e.type);if(!s||t==null||t==="")return null;let r=s.normalize(String(t));if(!r)return s.invalidMessage;if(e.min!==void 0&&e.min!==null&&String(e.min)!==""){let i=s.normalize(String(e.min));if(i&&r<i)return ue.minTemporal(String(e.min))}if(e.max!==void 0&&e.max!==null&&String(e.max)!==""){let i=s.normalize(String(e.max));if(i&&r>i)return ue.maxTemporal(String(e.max))}return null},Et=(e,t)=>{if(e.required){let r=t==null||t===""||Array.isArray(t)&&t.length===0||typeof t=="boolean"&&t===!1,i=e.type==="input-number"&&t===null;if(e.type==="input-number"?i:r)return typeof e.required=="object"&&e.required.message?e.required.message:ue.required}let s=Ua(e,t);if(s)return s;if(Array.isArray(e.rules))for(let r of e.rules){let i=Ha(r,t);if(i)return i}return null},Ha=(e,t)=>{if(t==null||t==="")return null;let s=String(t);switch(e.rule){case"minLength":return s.length<e.value?e.message||ue.minLength(e.value):null;case"maxLength":return s.length>e.value?e.message||ue.maxLength(e.value):null;case"pattern":{let r=Na[e.value];if(!r)try{r=new RegExp(e.value)}catch{return e.message||ue.pattern}return r.test(s)?null:e.message||ue.pattern}default:return null}},$t=(e,t)=>{let s={},r=ie(e);for(let i of r){let n=ne(t,i.name),o=Et(i,n);o&&(s[i.name]=o)}return{valid:Object.keys(s).length===0,errors:s}},qa=["section","read-only-text","slot"],Ds=e=>!qa.includes(e.type),ie=e=>{let t=[];for(let s of e)s.type==="section"&&Array.isArray(s.fields)?t.push(...ie(s.fields)):Ds(s)&&t.push(s);return t},Ps=e=>{switch(e.type){case"input-text":case"input-date":case"input-time":case"input-datetime":case"input-textarea":case"popover-input":return"";case"input-number":return null;case"select":case"segmented-control":return null;case"tag-select":return[];case"checkbox":return!1;case"color-picker":return"#000000";case"slider":case"slider-with-input":return e.min!==void 0?e.min:0;case"image":return null;default:return null}},Bs=(e,t=0)=>{let s=[],r=t;for(let i of e)if(i.type==="section"){if(s.push({...i,_isSection:!0,_idx:r}),r++,Array.isArray(i.fields)){let n=Bs(i.fields,r);s.push(...n),r+=n.length}}else s.push({...i,_isSection:!1,_idx:r}),r++;return s},Ya=()=>Object.freeze({formValues:{},errors:{},reactiveMode:!1,tooltipState:{open:!1,x:0,y:0,content:""}}),ee=({state:e,props:t})=>{let{form:s={}}=t||{},r=Ta(s),i=gt(t?.context)?t.context:{},n=gt(e?.formValues)?e.formValues:{},o={...i,...n,formValues:n};return Object.keys(o).length>0?Ia(r,o):r},Ga=({state:e,props:t})=>{let s=Va(t),r=ee({state:e,props:t}),i=r.fields||[],n=!!t?.disabled,o=Bs(i);o.forEach(d=>{if(d._isSection)return;let h=Ds(d);if(d._disabled=n||!!d.disabled,h&&d.name&&(d._error=e.errors[d.name]||null),d.type==="input-text"&&(d._inputType=d.inputType||"text"),d.type==="select"||d.type==="tag-select"||d.type==="segmented-control"){let f=ne(e.formValues,d.name);d._selectedValue=f!==void 0?f:null,d._selectedValues=Array.isArray(f)?f:[],d.placeholder=d.placeholder||"",d.noClear=d.clearable===!1}if(d.type==="image"){let f=ne(e.formValues,d.name);d._imageSrc=f&&String(f).trim()?f:null,d.placeholderText=d.placeholderText||"No Image"}if(d.type==="read-only-text"&&(d.content=d.content||""),d.type==="checkbox"){let f=typeof d.content=="string"?d.content:typeof d.checkboxLabel=="string"?d.checkboxLabel:"";d._checkboxText=f}});let l=r.actions||{buttons:[]},p=l.layout||"split",a=(l.buttons||[]).map((d,h)=>({...d,_globalIdx:h,variant:d.variant||"se",_disabled:n||!!d.disabled,pre:d.pre||"",suf:d.suf||""})),c;return p==="split"?c={_layout:"split",buttons:a,_leftButtons:a.filter(d=>d.align==="left"),_rightButtons:a.filter(d=>d.align!=="left")}:c={_layout:p,buttons:a,_allButtons:a},{containerAttrString:s,title:r?.title||"",description:r?.description||"",flatFields:o,actions:c,formValues:e.formValues,tooltipState:e.tooltipState}},Ie=({state:e,props:t})=>{let s=ee({state:e,props:t}),r=ie(s.fields||[]);return Ai(e.formValues,r.map(i=>i.name).filter(i=>typeof i=="string"&&i.length>0))},Ja=({state:e,props:t},s={})=>{let{name:r,value:i}=s;r&&(he(e.formValues,r,i),rt({state:e,props:t}))},rt=({state:e,props:t})=>{if(!t)return;let s=ee({state:e,props:t}),r=ie(s.fields||[]);e.formValues=Ai(e.formValues,r.map(i=>i.name).filter(i=>typeof i=="string"&&i.length>0))},Za=({state:e},t={})=>{let{values:s}=t;!s||typeof s!="object"||Object.keys(s).forEach(r=>{he(e.formValues,r,s[r])})},Xa=({state:e},t={})=>{let{defaultValues:s={}}=t;e.formValues=s?structuredClone(s):{},e.errors={},e.reactiveMode=!1},Qa=({state:e},t={})=>{e.errors=t.errors||{}},el=({state:e},t={})=>{let{name:s}=t;s&&e.errors[s]&&delete e.errors[s]},tl=({state:e})=>{e.reactiveMode=!0},sl=({state:e},t={})=>{let{x:s,y:r,content:i}=t;e.tooltipState={open:!0,x:s,y:r,content:i}},rl=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},il=Object.freeze(Object.defineProperty({__proto__:null,clearFieldError:el,collectAllDataFields:ie,createInitialState:Ya,flattenFields:Bs,get:ne,getDefaultValue:Ps,hideTooltip:rl,isDataField:Ds,pruneHiddenValues:rt,resetFormValues:Xa,selectForm:ee,selectFormValues:Ie,selectViewData:Ga,set:he,setErrors:Qa,setFormFieldValue:Ja,setFormValues:Za,setReactiveMode:tl,showTooltip:sl,validateField:Et,validateForm:$t},Symbol.toStringTag,{value:"Module"})),$i=({field:e,target:t,value:s})=>{!e||!t||["slider-with-input","popover-input"].includes(e.type)&&(s==null?t.removeAttribute("value"):t.setAttribute("value",String(s)))},Ci=({form:e,formValues:t={},refs:s,formDisabled:r=!1})=>{let i=e.fields||[],n=0,o=l=>{for(let p of l){if(p.type==="section"){n++,Array.isArray(p.fields)&&o(p.fields);continue}let a=s[`field${n}`];if(n++,!a)continue;let c=r||!!p.disabled;if(["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"].includes(p.type)){let d=ne(t,p.name);if(d==null?a.removeAttribute("value"):a.setAttribute("value",String(d)),p.type==="slider-with-input"&&a.store?.setValue){let h=Number(d??0);a.store.setValue({value:Number.isFinite(h)?h:0}),typeof a.render=="function"&&a.render()}p.type==="popover-input"&&a.store?.setValue&&(a.store.setValue({value:d==null?"":String(d)}),typeof a.render=="function"&&a.render())}if(p.type==="tag-select"&&a.store?.updateSelectedValues){let d=ne(t,p.name);a.store.updateSelectedValues({values:Array.isArray(d)?d:[]}),typeof a.render=="function"&&a.render()}p.type==="checkbox"&&(ne(t,p.name)?a.setAttribute("checked",""):a.removeAttribute("checked")),["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input"].includes(p.type)&&p.placeholder&&a.getAttribute("placeholder")!==p.placeholder&&(p.placeholder===void 0||p.placeholder===null?a.removeAttribute("placeholder"):a.setAttribute("placeholder",p.placeholder)),c?a.setAttribute("disabled",""):a.removeAttribute("disabled")}};o(i)},Ii=(e,t)=>{let s=t?.defaultValues||{},r={};Object.keys(s).forEach(l=>{he(r,l,s[l])});let i=ee({state:{formValues:r},props:t}),n=ie(i.fields||[]),o={};for(let l of n){let p=ne(s,l.name);p!==void 0?he(o,l.name,p):he(o,l.name,Ps(l))}e.resetFormValues({defaultValues:o})},nl=e=>{let{store:t,props:s}=e;Ii(t,s)},ol=e=>{let{props:t,refs:s,render:r}=e,i=e.store.getState(),n=ee({state:i,props:t});Ci({form:n,formValues:i.formValues,refs:s,formDisabled:!!t?.disabled}),r()},al=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n,refs:o}=e,l=!!r?.disabled;s?.key!==r?.key&&Ii(i,r);let p=i.getState();rt({state:p,props:r});let a=ee({state:p,props:r});Ci({form:a,formValues:p.formValues,refs:o,formDisabled:l}),n()},ll=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event,l=o.currentTarget.dataset.fieldName;if(!l||!o.detail||!Object.prototype.hasOwnProperty.call(o.detail,"value"))return;let p=o.detail.value;s.setFormFieldValue({name:l,value:p});let a=s.getState();rt({state:a,props:n});let c=ee({state:a,props:n}),d=ie(c.fields||[]).find(h=>h.name===l);if($i({field:d,target:o.currentTarget,value:p}),a.reactiveMode&&d){let h=Et(d,p);h?s.setErrors({errors:{...a.errors,[l]:h}}):s.clearFieldError({name:l})}i(),r(new CustomEvent("form-input",{bubbles:!0,detail:{name:l,value:p,values:Ie({state:s.getState(),props:n})}}))},pl=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event,l=o.currentTarget.dataset.fieldName;if(!l||!o.detail||!Object.prototype.hasOwnProperty.call(o.detail,"value"))return;let p=o.detail.value;s.setFormFieldValue({name:l,value:p});let a=s.getState();rt({state:a,props:n});let c=ee({state:a,props:n}),d=ie(c.fields||[]).find(h=>h.name===l);if($i({field:d,target:o.currentTarget,value:p}),a.reactiveMode&&d){let h=Et(d,p);h?s.setErrors({errors:{...a.errors,[l]:h}}):s.clearFieldError({name:l})}i(),r(new CustomEvent("form-change",{bubbles:!0,detail:{name:l,value:p,values:Ie({state:s.getState(),props:n})}}))},dl=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event.currentTarget.dataset.actionId;if(!o)return;let l=s.getState(),p=ee({state:l,props:n}),a=((p.actions||{}).buttons||[]).find(d=>d.id===o),c=Ie({state:l,props:n});if(a&&a.validate){let d=ie(p.fields||[]),{valid:h,errors:f}=$t(d,l.formValues);s.setErrors({errors:f}),h||s.setReactiveMode(),i(),r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:o,values:c,valid:h,errors:f}}))}else r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:o,values:c}}))},cl=(e,t)=>{let s=t._event;s.type==="contextmenu"&&s.preventDefault();let{store:r,dispatchEvent:i,props:n}=e,o=s.currentTarget.dataset.fieldName;i(new CustomEvent("form-field-event",{bubbles:!0,detail:{name:o,event:s.type,values:Ie({state:r.getState(),props:n})}}))},ul=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event;if(o.key==="Enter"&&!o.shiftKey){let l=o.target;if(l.tagName==="TEXTAREA"||l.tagName==="RTGL-TEXTAREA")return;o.preventDefault();let p=s.getState(),a=ee({state:p,props:n}),c=(a.actions||{}).buttons||[],d=c.find(f=>f.validate)||c[0];if(!d)return;let h=Ie({state:p,props:n});if(d.validate){let f=ie(a.fields||[]),{valid:u,errors:y}=$t(f,p.formValues);s.setErrors({errors:y}),u||s.setReactiveMode(),i(),r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h,valid:u,errors:y}}))}else r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h}}))}},hl=(e,t)=>{let{store:s,render:r,props:i}=e,n=t._event,o=n.currentTarget.dataset.fieldName,l=ee({state:s.getState(),props:i}),p=ie(l.fields||[]).find(a=>a.name===o);if(p&&p.tooltip){let a=n.currentTarget.getBoundingClientRect();s.showTooltip({x:a.left+a.width/2,y:a.top-8,content:typeof p.tooltip=="string"?p.tooltip:p.tooltip.content||""}),r()}},fl=e=>{let{store:t,render:s}=e;t.hideTooltip({}),s()},yl=Object.freeze(Object.defineProperty({__proto__:null,handleActionClick:dl,handleAfterMount:ol,handleBeforeMount:nl,handleImageClick:cl,handleKeyDown:ul,handleOnUpdate:al,handleTooltipMouseEnter:hl,handleTooltipMouseLeave:fl,handleValueChange:pl,handleValueInput:ll},Symbol.toStringTag,{value:"Module"})),ml=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"],gl=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input","slider-with-input"],bl=({ref:e,fieldType:t,value:s,forceRefresh:r=!1})=>{if(ml.includes(t)){if(r&&e.removeAttribute("value"),s==null){if(gl.includes(t)&&r){if(t==="popover-input"){e.removeAttribute("value");return}e.setAttribute("value","");return}e.removeAttribute("value");return}e.setAttribute("value",String(s))}},Oi=({ref:e,value:t})=>{if(e){if(e?.store?.updateSelectedValues)e.store.updateSelectedValues({values:Array.isArray(t)?t:[]});else if(e?.store?.updateSelectedValue)e.store.updateSelectedValue({value:t});else return;typeof e.render=="function"&&e.render()}},vl=e=>{let t=new Map;return!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("[data-field-name]").forEach(s=>{let r=s.getAttribute("data-field-name");r&&t.set(r,s)}),t},Pr=e=>e?.renderTarget?e.renderTarget:e?.shadowRoot?e.shadowRoot:e?.shadow,wl=({root:e,values:t={}})=>{!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("rtgl-select[data-field-name], rtgl-tag-select[data-field-name], rtgl-segmented-control[data-field-name]").forEach(s=>{let r=s.dataset?.fieldName;if(!r)return;let i=ne(t,r);Oi({ref:s,value:i})})},_l=function(){let e=this.store.getState();return Ie({state:e,props:this.props})},xl=function(e={}){let t=e&&typeof e=="object"&&e.values&&typeof e.values=="object"?e.values:e;if(!t||typeof t!="object"||Array.isArray(t))return;this.store.setFormValues({values:t}),this.store.pruneHiddenValues();let s=this.store.getState(),r=ee({state:s,props:this.props}),i=ie(r.fields||[]),n=vl(Pr(this));for(let l of i){if(!l.name)continue;let p=n.get(l.name);if(!p)continue;let a=Object.prototype.hasOwnProperty.call(t,l.name),c=ne(t,l.name);if(!a&&c===void 0)continue;let d=ne(s.formValues,l.name);bl({ref:p,fieldType:l.type,value:d,forceRefresh:!0}),["select","tag-select","segmented-control"].includes(l.type)&&Oi({ref:p,value:d}),l.type==="checkbox"&&(d?p.setAttribute("checked",""):p.removeAttribute("checked"))}this.render();let o=()=>{let l=this.store.getState();wl({root:Pr(this),values:l.formValues})};o(),setTimeout(()=>{o()},0)},Sl=function(){let e=this.store.getState(),t=ee({state:e,props:this.props}),s=ie(t.fields||[]),{valid:r,errors:i}=$t(s,e.formValues);return this.store.setErrors({errors:i}),r||this.store.setReactiveMode(),this.render(),{valid:r,errors:i}},Al=function(){let e=this.props?.defaultValues||{},t={};Object.keys(e).forEach(n=>{he(t,n,e[n])});let s=ee({state:{formValues:t},props:this.props}),r=ie(s.fields||[]),i={};for(let n of r){let o=ne(e,n.name);o!==void 0?he(i,n.name,o):he(i,n.name,Ps(n))}this.store.resetFormValues({defaultValues:i}),this.setValues(i)},kl=Object.freeze(Object.defineProperty({__proto__:null,getValues:_l,reset:Al,setValues:xl,validate:Sl},Symbol.toStringTag,{value:"Module"})),Br=3e3,El=180,bt=new WeakMap,Ti=e=>{e&&(typeof e.componentDialogBodyHost?.replaceChildren=="function"&&e.componentDialogBodyHost.replaceChildren(),delete e.componentDialogBody)},$l=e=>{let t=e.selectUiType();return t==="dropdown"||t==="formDialog"||t==="componentDialog"?null:e.selectConfig().mode==="confirm"?!1:null},fe=({store:e,render:t,globalUI:s,refs:r,emitResult:i=!1,result:n})=>{if(!e.selectIsOpen())return;let o=n!==void 0?n:$l(e);Ti(r),e.closeAll(),t(),i&&s.emit("event",o)},Li=({store:e,render:t,globalUI:s,refs:r,error:i})=>{Ti(r),e.selectIsOpen()&&(e.closeAll(),t()),s.emit("error",i)},it=({store:e,render:t,globalUI:s,refs:r})=>{e.selectIsOpen()&&fe({store:e,render:t,globalUI:s,refs:r,emitResult:!0})},nt=(e,{rejectOnError:t=!1}={})=>new Promise((s,r)=>{let i=null,n=e.once("event",o=>{i?.(),s(o)});t&&(i=e.once("error",o=>{n?.(),r(o)}))}),Cl=e=>{let t=bt.get(e);return t||(t=new Map,bt.set(e,t)),t},Il=(e,t)=>{let s=bt.get(e),r=s?.get(t);r&&(clearTimeout(r.exitTimerId),clearTimeout(r.removeTimerId),s.delete(t))},Ol=e=>{let t=bt.get(e);if(t){for(let s of t.values())clearTimeout(s.exitTimerId),clearTimeout(s.removeTimerId);t.clear()}},Tl=({store:e,render:t,globalUI:s},r)=>{Il(s,r);let i=Cl(s),n=setTimeout(()=>{e.setToastPhase?.({id:r,phase:"exiting"}),t()},Math.max(0,Br-El)),o=setTimeout(()=>{i.delete(r),e.removeToast({id:r}),t()},Br);i.set(r,{exitTimerId:n,removeTimerId:o})},Ll=(e,t)=>{setTimeout(()=>{let{store:s,refs:r}=e;if(!s.selectIsOpen()||s.selectUiType()!=="formDialog")return;let i=s.selectFormDialogConfig?.();if(!i||i.key!==t||typeof i.mount!="function")return;let n=r.formDialog;n&&i.mount(n)},0)},Vl=(e,t)=>{setTimeout(()=>{let{store:s,refs:r,render:i,globalUI:n}=e;if(!s.selectIsOpen()||s.selectUiType()!=="componentDialog")return;let o=s.selectComponentDialogConfig?.();if(!o||o.key!==t)return;let l=r.componentDialogBodyHost;if(l)try{let p=document.createElement(o.component);Object.entries(o.props??{}).forEach(([a,c])=>{p[a]=c}),l.replaceChildren(p),r.componentDialogBody=p}catch(p){Li({store:s,render:i,globalUI:n,refs:r,error:p})}},0)},ls=(e,t)=>!e.selectIsOpen()||e.selectUiType()!=="componentDialog"?!1:e.selectComponentDialogConfig?.()?.key===t,Nl=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0})},Rl=e=>{let{store:t,render:s,globalUI:r,refs:i}=e,n=t.selectConfig().mode==="confirm"?!0:null;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0,result:n})},jl=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0,result:!1})},Dl=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0,result:null})},Pl=(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t._event,{index:l,item:p}=o.detail;fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:{index:l,item:p}})},Bl=(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;return it({store:s,render:r,globalUI:i,refs:n}),s.setAlertConfig(o),r(),nt(i)},zl=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;return it({store:s,render:r,globalUI:i,refs:n}),s.setConfirmConfig(o),r(),nt(i)},Wl=(e,t)=>{let{store:s,render:r,globalUI:i}=e;s.addToast(t),r();let n=s.selectToasts?.()??[],o=n[n.length-1]?.id;o&&Tl({store:s,render:r,globalUI:i},o)},Ml=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;return it({store:s,render:r,globalUI:i,refs:n}),s.setDropdownConfig(o),r(),nt(i)},Fl=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;it({store:s,render:r,globalUI:i,refs:n}),s.setFormDialogConfig(o),r();let l=s.selectFormDialogConfig?.().key;return Ll(e,l),nt(i)},Kl=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;it({store:s,render:r,globalUI:i,refs:n}),s.setComponentDialogConfig(o),r();let l=s.selectComponentDialogConfig?.().key;return Vl(e,l),nt(i,{rejectOnError:!0})},Ul=(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t._event?.detail??{};o.valid!==!1&&fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:o})},Hl=(e,t)=>{let{store:s,refs:r}=e,i=t._event?.detail??{},n=s.selectFormDialogConfig?.();typeof n?.onFieldEvent=="function"&&n.onFieldEvent({detail:i,formEl:r.formDialog??null})},ql=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;Ol(r);let n=(t.selectToasts?.().length??0)>0;if(n&&t.clearToasts(),t.selectIsOpen()){fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0});return}n&&s()},Yl=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t._event,l=Number(o?.currentTarget?.dataset?.actionIndex),p=s.selectComponentDialogConfig?.(),a=p?.key,c=Number.isInteger(l)?p?.actions?.buttons?.[l]:null;if(c){if(c.role==="cancel"){fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:{actionId:c.id}});return}try{let d=n.componentDialogBody;if(!d||typeof d.validate!="function"||typeof d.getValues!="function")throw new Error(`component dialog body '${p?.component??"unknown"}' must implement validate() and getValues()`);if(c.validate){let f=await d.validate();if(!ls(s,a))return;if(!f||typeof f!="object"||typeof f.valid!="boolean")throw new Error("component dialog body validate() must return { valid, errors? }");if(f.valid===!1)return}let h=await d.getValues();if(!ls(s,a))return;fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:{actionId:c.id,values:h}})}catch(d){if(!ls(s,a))return;Li({store:s,render:r,globalUI:i,refs:n,error:d})}}},Gl=Object.freeze(Object.defineProperty({__proto__:null,handleCancel:jl,handleCloseAll:ql,handleComponentDialogAction:Yl,handleConfirm:Rl,handleDialogClose:Nl,handleDropdownClose:Dl,handleDropdownItemClick:Pl,handleFormAction:Ul,handleFormFieldEvent:Hl,handleShowAlert:Bl,handleShowComponentDialog:Kl,handleShowConfirm:zl,handleShowDropdownMenu:Ml,handleShowFormDialog:Fl,handleShowToast:Wl},Symbol.toStringTag,{value:"Module"})),Jl=new Set(["sm","md","lg","f"]),Zl=new Set(["sm","md","lg"]),Xl=new Set(["active","exiting"]),Ql=new Set(["top","bottom"]),ep=new Set(["confirm","cancel"]),tp=Object.freeze([{id:"cancel",label:"Cancel",variant:"se",align:"left",role:"cancel"},{id:"confirm",label:"OK",variant:"pr",role:"confirm",validate:!0}]),gs=e=>!e||typeof e!="object"||Array.isArray(e)?{}:e,je=(e,t="md")=>Jl.has(e)?e:t,Vi=(e,t="sm")=>Zl.has(e)?e:t,Ni=(e,t="active")=>Xl.has(e)?e:t,Ri=(e,t="top")=>Ql.has(e)?e:t,zs=e=>{let t=(Array.isArray(e?.buttons)&&e.buttons.length>0?e.buttons:tp).map((s,r)=>{if(!s||typeof s!="object"||Array.isArray(s))throw new Error("component dialog buttons must be objects");if(typeof s.id!="string"||s.id.length===0)throw new Error("component dialog button id is required");if(typeof s.label!="string"||s.label.length===0)throw new Error("component dialog button label is required");if(!ep.has(s.role))throw new Error("component dialog button role must be 'confirm' or 'cancel'");return{...s,_globalIdx:r,variant:s.variant??(s.role==="confirm"?"pr":"se"),align:s.align??(s.role==="cancel"?"left":"right"),validate:s.role==="confirm"?!!s.validate:!1,_disabled:!!s.disabled,pre:s.pre??"",suf:s.suf??""}});return{_layout:"split",buttons:t,_leftButtons:t.filter(s=>s.align==="left"),_rightButtons:t.filter(s=>s.align!=="left")}},ji=()=>({title:"",description:"",size:"md",component:"",props:{},actions:zs(),key:0}),sp=()=>Object.freeze({isOpen:!1,uiType:"dialog",nextToastId:0,toasts:[],config:{status:void 0,title:"",message:"",confirmText:"OK",cancelText:"Cancel",mode:"alert"},dropdownConfig:{items:[],x:0,y:0,place:"bs"},formDialogConfig:{form:null,defaultValues:{},context:{},disabled:!1,size:"md",key:0,onFieldEvent:null,mount:null},componentDialogConfig:ji()}),rp=({state:e},t={})=>{if(!t.message)throw new Error("message is required for showAlert");e.config={status:t.status??void 0,title:t.title??"",message:t.message,confirmText:t.confirmText??"OK",cancelText:"",mode:"alert"},e.uiType="dialog",e.isOpen=!0},ip=({state:e},t={})=>{if(!t.message)throw new Error("message is required for showConfirm");e.config={status:t.status??void 0,title:t.title??"",message:t.message,confirmText:t.confirmText??"Yes",cancelText:t.cancelText??"Cancel",mode:"confirm"},e.uiType="dialog",e.isOpen=!0},np=({state:e},t={})=>{if(!t.items||!Array.isArray(t.items))throw new Error("items array is required for showDropdown");e.dropdownConfig={items:t.items,x:t.x??0,y:t.y??0,place:t.place??"bs"},e.uiType="dropdown",e.isOpen=!0},op=({state:e},t={})=>{if(!t.form||typeof t.form!="object"||Array.isArray(t.form))throw new Error("form object is required for showFormDialog");let s=e.formDialogConfig?.key??0;e.formDialogConfig={form:t.form,defaultValues:gs(t.defaultValues),context:gs(t.context),disabled:!!t.disabled,size:je(t.size,"md"),key:s+1,onFieldEvent:typeof t.onFieldEvent=="function"?t.onFieldEvent:null,mount:typeof t.mount=="function"?t.mount:null},e.uiType="formDialog",e.isOpen=!0},ap=({state:e},t={})=>{if(typeof t.component!="string"||!t.component.includes("-"))throw new Error("component tag name is required for showComponentDialog");let s=e.componentDialogConfig?.key??0;e.componentDialogConfig={title:typeof t.title=="string"?t.title:"",description:typeof t.description=="string"?t.description:"",size:je(t.size,"md"),component:t.component,props:gs(t.props),actions:zs(t.actions),key:s+1},e.uiType="componentDialog",e.isOpen=!0},lp=({state:e},t={})=>{if(typeof t.message!="string"||t.message.length===0)throw new Error("message is required for showToast");let s=(e.nextToastId??0)+1,r={id:`toast-${s}`,message:t.message,size:Vi(t.size??t.s,"sm"),position:Ri(t.position,"top"),phase:"active"};e.nextToastId=s,e.toasts=[...e.toasts??[],r]},pp=({state:e},t={})=>{typeof t.id!="string"||t.id.length===0||(e.toasts=(e.toasts??[]).filter(s=>s.id!==t.id))},dp=({state:e},t={})=>{typeof t.id!="string"||t.id.length===0||(e.toasts=(e.toasts??[]).map(s=>s.id!==t.id?s:{...s,phase:Ni(t.phase,"active")}))},cp=({state:e})=>{e.toasts=[]},up=({state:e})=>{e.isOpen=!1,e.uiType="dialog"},hp=({state:e})=>e.config,fp=({state:e})=>e.dropdownConfig,yp=({state:e})=>e.formDialogConfig,mp=({state:e})=>e.componentDialogConfig,gp=({state:e})=>e.uiType,bp=({state:e})=>e.isOpen,vp=({state:e})=>e.toasts??[],wp=({state:e})=>{let t=e.isOpen&&e.uiType==="dialog",s=e.isOpen&&e.uiType==="formDialog",r=e.isOpen&&e.uiType==="componentDialog",i=e.componentDialogConfig??ji(),n=Array.isArray(e.toasts)?e.toasts.map(o=>({...o,size:Vi(o.size,"sm"),position:Ri(o.position,"top"),phase:Ni(o.phase,"active")})):[];return{isOpen:e.isOpen,uiType:e.uiType,config:e.config,dropdownConfig:{items:e.dropdownConfig?.items??[],x:e.dropdownConfig?.x??0,y:e.dropdownConfig?.y??0,place:e.dropdownConfig?.place??"bs"},formDialogConfig:{form:e.formDialogConfig?.form??{fields:[],actions:{buttons:[]}},defaultValues:e.formDialogConfig?.defaultValues??{},context:e.formDialogConfig?.context??{},disabled:!!e.formDialogConfig?.disabled,size:je(e.formDialogConfig?.size,"md"),key:e.formDialogConfig?.key??0},componentDialogConfig:{title:i.title??"",description:i.description??"",size:je(i.size,"md"),component:i.component??"",props:i.props??{},actions:i.actions??zs(),key:i.key??0},toasts:n,topToasts:n.filter(o=>o.position==="top"),bottomToasts:n.filter(o=>o.position==="bottom"),isDialogOpen:t,isFormDialogOpen:s,isComponentDialogOpen:r,isDialogContainerOpen:t||s||r,isDropdownOpen:e.isOpen&&e.uiType==="dropdown",dialogSize:r?je(i.size,"md"):s?je(e.formDialogConfig?.size,"md"):"sm"}},_p=Object.freeze(Object.defineProperty({__proto__:null,addToast:lp,clearToasts:cp,closeAll:up,createInitialState:sp,removeToast:pp,selectComponentDialogConfig:mp,selectConfig:hp,selectDropdownConfig:fp,selectFormDialogConfig:yp,selectIsOpen:bp,selectToasts:vp,selectUiType:gp,selectViewData:wp,setAlertConfig:rp,setComponentDialogConfig:ap,setConfirmConfig:ip,setDropdownConfig:np,setFormDialogConfig:op,setToastPhase:dp},Symbol.toStringTag,{value:"Module"})),xp=(e,t)=>{let{dispatchEvent:s,store:r}=e;t._event,console.log("handle click start",r.selectPath()),s(new CustomEvent("start-click",{detail:{path:r.selectPath()}}))},Sp=Object.freeze(Object.defineProperty({__proto__:null,handleClickStart:xp},Symbol.toStringTag,{value:"Module"})),Ap=()=>Object.freeze({}),kp=["id","class","style","slot","start"],Ep=(e={})=>Object.entries(e).filter(([t])=>!kp.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),$p=e=>{if(e!=null){if(typeof e=="object")return e;if(typeof e=="string")try{return JSON.parse(decodeURIComponent(e))}catch{try{return JSON.parse(e)}catch{return}}}},Cp=({props:e})=>{let t=$p(e.start)||e.start;return{containerAttrString:Ep(e),start:t||{label:"",image:{src:"",width:32,height:32,alt:""}}}},Ip=({props:e})=>e.start?.path,Op=({state:e})=>{},Tp=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Ap,selectPath:Ip,selectViewData:Cp,setState:Op},Symbol.toStringTag,{value:"Module"})),zr=e=>{let t=e.querySelectorAll("h1[id], h2[id], h3[id], h4[id], rtgl-text[id]");return Array.from(t)},Lp=e=>e.map(t=>{let s=1,r=t.tagName.toLowerCase();return r==="h1"?s=1:r==="h2"?s=2:r==="h3"?s=3:r==="h4"?s=4:r==="rtgl-text"&&(s=parseInt(t.getAttribute("data-level")||"1",10)),{id:t.id,href:`#${t.id}`,title:t.textContent,level:s}}),Wr=(e,t,s)=>{let{store:r,render:i}=s,n,o=-1/0;if(e.forEach(l=>{let p=l.getBoundingClientRect();p.top<=t&&p.top>o&&(o=p.top,n=l.id)}),!n){let l=1/0;e.forEach(p=>{let a=p.getBoundingClientRect();a.top>t&&a.top<l&&(l=a.top,n=p.id)})}n&&n!==r.selectCurrentId()&&(r.setCurrentId({id:n}),i())},Vp=(e,t,s,r)=>{let{store:i,render:n}=r,o=null,l=()=>{o=null;let d=zr(e);i.setItems({items:Lp(d)}),Wr(d,s,r),n()},p=()=>{o===null&&(o=requestAnimationFrame(l))},a=()=>{Wr(zr(e),s,r)};p(),t.addEventListener("scroll",a,{passive:!0});let c=new MutationObserver(()=>{p()});return c.observe(e,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["id","data-level"]}),()=>{o!==null&&cancelAnimationFrame(o),c.disconnect(),t.removeEventListener("scroll",a)}},Np=e=>{let{props:t}=e,s=()=>{};return requestAnimationFrame(()=>{let r=document.getElementById(t.targetId);if(!r)return;let i=window;t.scrollContainerId&&(i=document.getElementById(t.scrollContainerId)||window);let n=parseInt(t.offsetTop||"100",10);s=Vp(r,i,n,e)}),()=>{s()}},Rp=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Np},Symbol.toStringTag,{value:"Module"})),jp=()=>Object.freeze({items:[],currentId:null,contentContainer:null}),Dp=({state:e})=>{let t=((s,r)=>{let i=new Set,n=s.findIndex(l=>l.id===r);if(n===-1)return i;let o=s[n].level;for(let l=n-1;l>=0;l--)if(s[l].level<o){let p=s[l].level;i.add(s[l].id);for(let a=l-1;a>=0;a--)s[a].level<p&&(i.add(s[a].id),p=s[a].level);break}return i})(e.items,e.currentId);return{items:e.items.map(s=>{let r={1:"0",2:"12px",3:"24px",4:"32px"},i=s.id===e.currentId,n=t.has(s.id),o=i||n;return{...s,c:o?"fg":"mu-fg",ml:r[s.level]||"",bc:o?"fg":"mu-fg"}}),currentId:e.currentId}},Pp=({state:e})=>e,Bp=({state:e})=>e.currentId,zp=({state:e},t={})=>{e.items=Array.isArray(t.items)?t.items:[]},Wp=({state:e},t={})=>{e.currentId=t.id},Mp=({state:e},t={})=>{e.contentContainer=t.container},Fp=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:jp,selectCurrentId:Bp,selectState:Pp,selectViewData:Dp,setContentContainer:Mp,setCurrentId:Wp,setItems:zp},Symbol.toStringTag,{value:"Module"})),ot=e=>e==null||e===!0?"":String(e),Di=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=ot(t);s.setValue({value:n}),s.closePopover({}),i(new CustomEvent("value-change",{detail:{value:n},bubbles:!0})),r()},Kp=e=>{let{store:t,props:s}=e;if(s.value!==void 0){let r=ot(s.value);t.setValue({value:r}),t.setTempValue({value:r})}},Up=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n}=e;if(s?.value!==r?.value){let o=ot(r?.value);i.setValue({value:o}),i.getState().isOpen||i.setTempValue({value:o})}n()},Hp=(e,t)=>{let{store:s,render:r,refs:i,props:n}=e;if(n.disabled)return;let o=t._event,l=ot(n.value);s.setValue({value:l}),s.setTempValue({value:l}),s.openPopover({position:{x:o.currentTarget.getBoundingClientRect().left,y:o.currentTarget.getBoundingClientRect().bottom}}),r(),setTimeout(()=>{let{input:p}=i;if(!p)return;p.value=l,p.focus();let a=p.shadowRoot?.querySelector("input, textarea");a&&typeof a.focus=="function"&&a.focus()},50)},qp=(e,t)=>{let{store:s,render:r}=e;s.closePopover({}),r()},Yp=(e,t)=>{let{store:s}=e,r=t._event,i=ot(r.detail.value);s.setTempValue({value:i})},Gp=e=>{let{store:t,refs:s}=e,{input:r}=s,i=r?r.value:t.getState().tempValue;Di(e,i)},Jp=(e,t)=>{let{store:s,refs:r}=e,i=t._event;if(i.key==="Enter"){i.preventDefault(),i.stopPropagation();let{input:n}=r,o=n?n.value:s.getState().tempValue;Di(e,o)}else i.key==="Escape"&&(i.preventDefault(),i.stopPropagation(),s.closePopover({}),e.render())},Zp=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Kp,handleInputChange:Yp,handleInputKeydown:Jp,handleOnUpdate:Up,handlePopoverClose:qp,handleSubmitClick:Gp,handleTextClick:Hp},Symbol.toStringTag,{value:"Module"})),Xp=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),Qp=({props:e,state:t})=>{let s=typeof t.value=="string"&&t.value.length>0,r=s?t.value:"-",i=typeof e.placeholder=="string"?e.placeholder:"",n=typeof e.label=="string"?e.label:"",o=!!e.disabled;return{isOpen:t.isOpen,position:t.position,value:r,valueColor:s?"fg":"mu-fg",tempValue:t.tempValue,placeholder:i,label:n,disabled:o}},ed=({state:e},t={})=>{e.tempValue=t.value},td=({state:e},t={})=>{let{position:s}=t;e.position=s,e.isOpen=!0,e.hasUnsavedChanges=!1},sd=({state:e})=>{e.isOpen=!1,e.tempValue=""},rd=({state:e},t={})=>{e.value=t.value},id=({state:e})=>e.value,nd=Object.freeze(Object.defineProperty({__proto__:null,closePopover:sd,createInitialState:Xp,openPopover:td,selectValue:id,selectViewData:Qp,setTempValue:ed,setValue:rd},Symbol.toStringTag,{value:"Module"})),le=(e,t)=>{if(e===t)return!0;if(e==null||t==null||typeof e!="object"||typeof t!="object")return!1;let s=Object.keys(e),r=Object.keys(t);if(s.length!==r.length)return!1;for(let i of s)if(!r.includes(i)||!le(e[i],t[i]))return!1;return!0},Mr=({dispatchEvent:e,value:t,label:s,index:r,item:i})=>{e(new CustomEvent("value-change",{detail:{value:t,label:s,index:r,item:i},bubbles:!0}))},od=e=>{let{store:t,props:s,render:r}=e;if(s.selectedValue!==null&&s.selectedValue!==void 0&&s.options){let i=s.options.find(n=>le(n.value,s.selectedValue));i&&(t.updateSelectedValue({value:i.value}),r())}},ad=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n}=e,o=!1;s.selectedValue!==r.selectedValue&&(i.updateSelectedValue({value:r.selectedValue}),o=!0),o&&n()},Pi=(e,t)=>{let{render:s,dispatchEvent:r,props:i,store:n}=e;if(i.disabled)return;let o=t._event;o.stopPropagation();let l=o.currentTarget.id.slice(6),p=Number(l),a=i.options[p],c=Object.prototype.hasOwnProperty.call(i||{},"selectedValue"),d=n.selectSelectedValue(),h=c?!0:n.selectHasSelectedValue(),f=a?h&&le(a.value,d):!1;if(a){if(f&&!i.noClear){n.clearSelectedValue({}),i.onChange&&typeof i.onChange=="function"&&i.onChange(void 0),Mr({dispatchEvent:r,value:void 0,label:void 0,index:null,item:void 0}),s();return}n.updateSelectedValue({value:a.value}),i.onChange&&typeof i.onChange=="function"&&i.onChange(a.value),Mr({dispatchEvent:r,value:a.value,label:a.label,index:p,item:a}),s()}},ld=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Pi(e,t))},pd=(e,t)=>{let{store:s,render:r}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(6),10);s.setHoveredOption({optionId:n}),r()},dd=e=>{let{store:t,render:s}=e;t.clearHoveredOption({}),s()},Bi=(e,t)=>{if(e.props.disabled)return;let{render:s,dispatchEvent:r}=e,{_event:i}=t;i.stopPropagation(),r(new CustomEvent("add-option-click",{bubbles:!0})),s()},cd=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Bi(e,t))},ud=e=>{let{store:t,render:s}=e;t.setHoveredAddOption({isHovered:!0}),s()},hd=e=>{let{store:t,render:s}=e;t.setHoveredAddOption({isHovered:!1}),s()},fd=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:Bi,handleAddOptionKeyDown:cd,handleAddOptionMouseEnter:ud,handleAddOptionMouseLeave:hd,handleBeforeMount:od,handleOnUpdate:ad,handleOptionClick:Pi,handleOptionKeyDown:ld,handleOptionMouseEnter:pd,handleOptionMouseLeave:dd},Symbol.toStringTag,{value:"Module"})),yd=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],md=(e={})=>Object.entries(e).filter(([t])=>!yd.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),gd=()=>Object.freeze({selectedValue:null,hasSelectedValue:!1,hoveredOptionId:null,hoveredAddOption:!1}),bd=({state:e,props:t})=>{let s=md(t),r=!!t.disabled,i=Object.prototype.hasOwnProperty.call(t||{},"selectedValue"),n=i?t.selectedValue:e.selectedValue,o=i?!0:!!e.hasSelectedValue,l=t.options||[],p=l.map((a,c)=>{let d=o&&le(a.value,n),h=e.hoveredOptionId===c;return{...a,isSelected:d,bgc:d?"ac":h&&!r?"mu":"",textColor:d?"ac-fg":"fg",borderLeftWidth:c===0?"none":"xs",cursor:r?"not-allowed":"pointer",tabIndex:r?-1:0}});return{containerAttrString:s,isDisabled:r,options:p,selectedValue:n,hasSelectedValue:o,ariaLabel:t.placeholder||"Segmented control",showAddOption:!r&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"mu":"",addOptionBorderLeftWidth:l.length===0?"none":"xs"}},vd=({state:e})=>e,wd=({state:e})=>e.selectedValue,_d=({state:e})=>!!e.hasSelectedValue,xd=({state:e},t={})=>{e.selectedValue=t.value,e.hasSelectedValue=!0},Sd=({state:e})=>{e.selectedValue=void 0,e.hasSelectedValue=!1},Ad=({state:e},t={})=>{e.hoveredOptionId=t.optionId},kd=({state:e})=>{e.hoveredOptionId=null},Ed=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},$d=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:kd,clearSelectedValue:Sd,createInitialState:gd,selectHasSelectedValue:_d,selectSelectedValue:wd,selectState:vd,selectViewData:bd,setHoveredAddOption:Ed,setHoveredOption:Ad,updateSelectedValue:xd},Symbol.toStringTag,{value:"Module"})),Ws=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Cd=e=>{let{store:t,props:s,render:r}=e;if(s.selectedValue!==null&&s.selectedValue!==void 0&&s.options){let i=s.options.find(n=>Ws(n)==="item"&&le(n.value,s.selectedValue));i&&(t.updateSelectedValue({value:i?.value}),r())}},Id=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n,refs:o}=e,l=!1,p=!1;r?.disabled&&!s?.disabled&&(i.closeOptionsPopover({}),l=!0),s.selectedValue!==r.selectedValue&&(i.updateSelectedValue({value:r.selectedValue}),l=!0),s.options!==r.options&&(l=!0,p=!0),l&&(n(),p&&i.selectState?.().isOpen&&o?.popover?.refreshContent?.())},zi=(e,t)=>{let{store:s,render:r,refs:i,props:n}=e;if(n.disabled)return;t._event.stopPropagation();let o=i.selectButton.getBoundingClientRect(),l=s.selectSelectedValue(),p=l!==null?l:n.selectedValue,a=null;p!=null&&n.options&&(a=n.options.findIndex(c=>Ws(c)==="item"&&le(c.value,p)),a===-1&&(a=null)),s.openOptionsPopover({position:{y:o.bottom+12,x:o.left-24},selectedIndex:a}),r()},Od=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),zi(e,t))},Td=e=>{let{store:t,render:s}=e;t.closeOptionsPopover({}),s()},Ld=(e,t)=>{let{render:s,dispatchEvent:r,props:i,store:n}=e;if(i.disabled)return;let o=t._event;o.stopPropagation();let l=o.currentTarget.id.slice(6),p=Number(l),a=i.options[l];Ws(a)==="item"&&(n.updateSelectedValue({value:a?.value}),i.onChange&&typeof i.onChange=="function"&&i.onChange(a.value),r(new CustomEvent("value-change",{detail:{value:a.value,label:a.label,index:p,item:a},bubbles:!0})),s())},Vd=(e,t)=>{let{store:s,render:r}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(6),10);s.setHoveredOption({optionId:n}),r()},Nd=(e,t)=>{let{store:s,render:r}=e;s.clearHoveredOption({}),r()},Rd=(e,t)=>{let{store:s,render:r,dispatchEvent:i,props:n}=e;n.disabled||(t._event.stopPropagation(),s.clearSelectedValue({}),n.onChange&&typeof n.onChange=="function"&&n.onChange(void 0),i(new CustomEvent("value-change",{detail:{value:void 0,label:void 0,index:null,item:void 0},bubbles:!0})),r())},jd=(e,t)=>{if(e.props.disabled)return;let{store:s,render:r,dispatchEvent:i}=e,{_event:n}=t;n.stopPropagation(),s.closeOptionsPopover({}),i(new CustomEvent("add-option-click",{bubbles:!0})),r()},Dd=(e,t)=>{let{store:s,render:r}=e;s.setHoveredAddOption({isHovered:!0}),r()},Pd=(e,t)=>{let{store:s,render:r}=e;s.setHoveredAddOption({isHovered:!1}),r()},Bd=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:jd,handleAddOptionMouseEnter:Dd,handleAddOptionMouseLeave:Pd,handleBeforeMount:Cd,handleButtonClick:zi,handleButtonKeyDown:Od,handleClearClick:Rd,handleClickOptionsPopoverOverlay:Td,handleOnUpdate:Id,handleOptionClick:Ld,handleOptionMouseEnter:Vd,handleOptionMouseLeave:Nd},Symbol.toStringTag,{value:"Module"})),zd=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],Wd=(e={})=>Object.entries(e).filter(([t])=>!zd.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Md=(e,t)=>Object.prototype.hasOwnProperty.call(e||{},t),Wi=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Fr=(e={})=>Wi(e)==="item",Fd=(e={})=>typeof e.icon=="string"&&e.icon.length>0?e.icon:"",Kd=(e={})=>typeof e.shortcut=="string"&&e.shortcut.length>0?e.shortcut:typeof e.suffixText=="string"&&e.suffixText.length>0?e.suffixText:"",Ud=(e={},t,s,r,i)=>{let n=Wi(e),o=n==="section",l=n==="separator",p=n==="item";if(o)return{...e,index:t,type:n,isSection:o,isSeparator:l,isItem:p};if(l)return{...e,index:t,type:n,isSection:o,isSeparator:l,isItem:p};let a=le(e.value,s),c=r===t,d=Fd(e),h=Kd(e);return{...e,index:t,type:n,isSection:o,isSeparator:l,isItem:p,isSelected:a,bgc:c?"ac":a?"mu":"",hasIconSlot:i,icon:d,hasIcon:d.length>0,iconColor:"fg",c:"fg",suffixText:h,hasSuffixText:h.length>0,suffixTextColor:"mu-fg"}},Hd=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,hoveredOptionId:null,hoveredAddOption:!1}),qd=({state:e,props:t})=>{let s=Wd(t),r=!!t.disabled,i=Object.prototype.hasOwnProperty.call(t||{},"selectedValue")?t.selectedValue:e.selectedValue,n=t.placeholder||"Select an option",o=!0,l=t.options||[],p=l.find(h=>Fr(h)&&le(h.value,i));p&&(n=p.label,o=!1);let a=l.some(h=>Fr(h)&&Md(h,"icon")),c=l.map((h,f)=>Ud(h,f,i,e.hoveredOptionId,a)),d=c.find(h=>h.isItem&&h.isSelected);return{containerAttrString:s,isDisabled:r,isOpen:e.isOpen,position:e.position,options:c,selectedValue:i,selectedLabel:n,selectedLabelColor:o?"mu-fg":"fg",selectedIcon:d?.icon||"",hasSelectedIcon:!!d?.hasIcon,selectedIconColor:o?"mu-fg":"fg",selectedSuffixText:d?.suffixText||"",hasSelectedSuffixText:!!d?.hasSuffixText,selectedSuffixTextColor:"mu-fg",selectButtonCursor:r?"not-allowed":"pointer",selectButtonHoverBorderColor:r?"bo":"ac",selectButtonTabIndex:r?-1:0,hasValue:i!=null,showClear:!r&&!t.noClear&&i!=null,showAddOption:!r&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"ac":""}},Yd=({state:e})=>e,Gd=({state:e})=>e.selectedValue,Jd=({state:e},t={})=>{let{position:s,selectedIndex:r}=t;e.position=s,e.isOpen=!0,r!=null&&(e.hoveredOptionId=r)},Zd=({state:e})=>{e.isOpen=!1},Xd=({state:e},t={})=>{e.selectedValue=t.value,e.isOpen=!1},Qd=({state:e})=>{e.selectedValue=void 0},ec=({state:e},t={})=>{e.hoveredOptionId=t.optionId},tc=({state:e})=>{e.hoveredOptionId=null},sc=({state:e})=>{e.selectedValue=void 0},rc=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},ic=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:tc,clearSelectedValue:sc,closeOptionsPopover:Zd,createInitialState:Hd,openOptionsPopover:Jd,resetSelection:Qd,selectSelectedValue:Gd,selectState:Yd,selectViewData:qd,setHoveredAddOption:rc,setHoveredOption:ec,updateSelectedValue:Xd},Symbol.toStringTag,{value:"Module"})),Kr=e=>{if(e===!0)return!0;if(e===!1||e===void 0||e===null)return!1;if(typeof e=="string"){let t=e.trim().toLowerCase();return t===""||t==="true"}return!1},nc=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?Kr(e.tooltip):Kr(e.showCompactTooltip),oc=(e,t)=>{let{store:s,dispatchEvent:r}=e,i=t._event,n,o=s.selectHeader();i.currentTarget.id==="headerLabel"?n=o.labelPath:i.currentTarget.id==="headerImage"?n=o.image.path:i.currentTarget.id==="header"&&(n=o.path),r(new CustomEvent("header-click",{detail:{path:n},bubbles:!0,composed:!0}))},ac=(e,t)=>{let{store:s,dispatchEvent:r,render:i}=e,n=t._event,o=n.currentTarget.dataset.itemId||n.currentTarget.id.slice(4),l=s.selectItem(o);s.hideTooltip({}),i(),r(new CustomEvent("item-click",{detail:{item:l},bubbles:!0,composed:!0}))},lc=(e,t)=>{let{props:s,store:r,render:i}=e;if(!nc(s)||(s.mode||"full")==="full")return;let n=t._event,o=n.currentTarget.dataset.itemId||n.currentTarget.id.slice(4),l=r.selectItem(o);if(!l||l.type==="groupLabel")return;let p=n.currentTarget.getBoundingClientRect(),a=l.tooltip||l.label||l.title;a&&(r.showTooltip({x:p.right,y:p.top+p.height/2,place:"r",content:a}),i())},pc=e=>{let{store:t,render:s}=e;t.hideTooltip({}),s()},dc=Object.freeze(Object.defineProperty({__proto__:null,handleHeaderClick:oc,handleItemClick:ac,handleItemMouseEnter:lc,handleItemMouseLeave:pc},Symbol.toStringTag,{value:"Module"})),cc=()=>Object.freeze({tooltipState:{open:!1,x:0,y:0,place:"r",content:""}}),uc=["id","class","style","slot","header","items","selectedItemId","mode","hideHeader","tooltip","showCompactTooltip","w","bwr"],hc=(e={})=>Object.entries(e).filter(([t])=>!uc.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Xe=e=>{if(e!=null){if(typeof e=="object")return e;if(typeof e=="string")try{return JSON.parse(decodeURIComponent(e))}catch{try{return JSON.parse(e)}catch{return}}}},bs=e=>{if(e===!0)return!0;if(e===!1||e===void 0||e===null)return!1;if(typeof e=="string"){let t=e.trim().toLowerCase();return t===""||t==="true"}return!1},fc=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?bs(e.tooltip):bs(e.showCompactTooltip),yc=(e,t)=>e!=null&&e!==""?e:t==="full"?272:64,Ur=(e={})=>e.label!==void 0&&e.label!==null?e.label:e.title!==void 0&&e.title!==null?e.title:"";function Ms(e,t=null){let s=[];for(let r of e){let i=r.id||r.href||r.path,n=i!=null&&t===i,o=Ur(r);if(s.push({id:i,label:o,title:r.title??o,href:r.href,type:r.type||"item",icon:r.icon,testId:r.testId,tooltip:r.tooltip,path:r.path,hrefAttr:r.href?`href=${r.href}`:"",isSelected:n,itemBgc:n?"ac":"bg",itemHoverBgc:n?"ac":"mu"}),r.items&&Array.isArray(r.items))for(let l of r.items){let p=l.id||l.href||l.path,a=p!=null&&t===p,c=Ur(l);s.push({id:p,label:c,title:l.title??c,href:l.href,type:l.type||"item",icon:l.icon,testId:l.testId,tooltip:l.tooltip,path:l.path,hrefAttr:l.href?`href=${l.href}`:"",isSelected:a,itemBgc:a?"ac":"bg",itemHoverBgc:a?"ac":"mu"})}}return s}var mc=({state:e,props:t})=>{let s=Xe(t.header)||t.header,r=Xe(t.items)||t.items,i=t.selectedItemId,n=hc(t),o=t.mode||"full",l=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},p=r?Ms(r,i):[],a=!bs(t.hideHeader),c=fc(t),d=t.bwr||"xs",h=yc(t.w,o),f=o==="full"?"fs":"c",u=o==="full"?"fs":"c",y=o==="full"?"lg":"sm",m=o==="full"?"md":"sm",b=o==="shrunk-lg"?48:40,g=o==="shrunk-lg"?28:20,_=o==="shrunk-lg"?"md":"sm",S=o==="full",A=o==="full",k=c&&!S,C=o==="full"?"fs":"c",I=o==="full"?"":`ah=${u}`,V=o==="full"?"f":b;return{containerAttrString:n,mode:o,header:l,items:p,sidebarWidth:h,headerAlign:f,itemAlign:u,headerPadding:y,itemPadding:m,itemHeight:b,iconSize:g,firstLetterSize:_,showLabels:S,showGroupLabels:A,itemContentAlign:C,itemAlignAttr:I,itemWidth:V,headerWidth:V,selectedItemId:i,ah:o==="shrunk-lg"||o==="shrunk-md"?"c":"",listAttrString:o==="full"?"d=v sv":"d=v sv hsb",showHeader:a,enableCompactTooltip:k,rightBorderWidth:d,tooltipState:e.tooltipState||{open:!1,x:0,y:0,place:"r",content:""}}},gc=({props:e})=>Xe(e.header)||e.header,bc=({state:e,props:t})=>{let s=Xe(t.items)||t.items;return(s?Ms(s):[]).find(r=>r.active)},vc=({props:e},t)=>{let s=Xe(e.items)||e.items;return(s?Ms(s):[]).find(r=>r.id===t)},wc=({state:e})=>{},_c=({state:e},t={})=>{let{x:s,y:r,place:i="r",content:n=""}=t;e.tooltipState={open:!0,x:s,y:r,place:i,content:n}},xc=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},Sc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:cc,hideTooltip:xc,selectActiveItem:bc,selectHeader:gc,selectItem:vc,selectViewData:mc,setState:wc,showTooltip:_c},Symbol.toStringTag,{value:"Module"})),Ac=e=>{let{store:t,props:s}=e;t.setValue({value:s.value??0})},kc=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n}=e,o=s?.key!==r?.key,l=s?.value!==r?.value;if(o||l){let p=r?.value??0;i.setValue({value:p}),n()}},Ec=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=t._event,o=Number(n.detail.value),l=(typeof n.composedPath=="function"?n.composedPath():[]).find(p=>p?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;s.setValue({value:o}),l&&typeof l.setAttribute=="function"&&l.setAttribute("value",String(o)),r(),i(new CustomEvent("value-change",{detail:{value:o},bubbles:!0}))},$c=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=t._event,o=Number(n.detail.value),l=(typeof n.composedPath=="function"?n.composedPath():[]).find(p=>p?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;s.setValue({value:o}),l&&typeof l.setAttribute=="function"&&l.setAttribute("value",String(o)),r(),i(new CustomEvent("value-input",{detail:{value:o},bubbles:!0}))},Cc=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Ac,handleOnUpdate:kc,handleValueChange:Ec,handleValueInput:$c},Symbol.toStringTag,{value:"Module"})),Ic=()=>Object.freeze({value:0}),Oc=({state:e,props:t})=>({key:t.key,value:e.value,w:t.w||"",min:t.min||0,max:t.max||100,step:t.step||1,disabled:!!t.disabled}),Tc=({state:e},t={})=>{e.value=t.value},Lc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Ic,selectViewData:Oc,setValue:Tc},Symbol.toStringTag,{value:"Module"})),Vc=e=>{},Nc=(e,t)=>{let{dispatchEvent:s,props:r}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(3),10),o=r.data?.rows?.[n];o&&s(new CustomEvent("row-click",{detail:{rowIndex:n,rowData:o}}))},Rc=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=t._event.currentTarget.dataset.columnKey,o=s.selectSortInfo(),l="asc";o.column===n&&(o.direction==="asc"?l="desc":o.direction==="desc"&&(l=null)),l?s.setSortColumn({column:n,direction:l}):s.clearSort(),r(),i(new CustomEvent("header-click",{detail:{column:n,direction:l,sortInfo:l?{column:n,direction:l}:null}}))},jc=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Vc,handleHeaderClick:Rc,handleRowClick:Nc},Symbol.toStringTag,{value:"Module"})),Dc=()=>Object.freeze({sortColumn:null,sortDirection:null}),Pc=["id","class","style","slot","data"],Bc=(e={})=>Object.entries(e).filter(([t])=>!Pc.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),zc=(e,t)=>{let s=t.split("."),r=e;for(let i of s){if(r==null)return null;r=r[i]}return r},Wc=({state:e,props:t})=>{let s=Bc(t),r=t.data||{columns:[],rows:[]},i=r.rows.map((n,o)=>{let l=r.columns.map(p=>{let a=zc(n,p.key);return{key:p.key,value:a!=null?String(a):""}});return{index:o,cells:l}});return{containerAttrString:s,columns:r.columns||[],rows:i||[]}},Mc=({state:e})=>e,Fc=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),Kc=({state:e},{column:t,direction:s}={})=>{e.sortColumn=t,e.sortDirection=s},Uc=({state:e})=>{e.sortColumn=null,e.sortDirection=null},Hc=Object.freeze(Object.defineProperty({__proto__:null,clearSort:Uc,createInitialState:Dc,selectSortInfo:Fc,selectState:Mc,selectViewData:Wc,setSortColumn:Kc},Symbol.toStringTag,{value:"Module"})),qc=(e,t)=>{let{dispatchEvent:s}=e,r=t._event.currentTarget.dataset.id;s(new CustomEvent("item-click",{detail:{id:r}}))},Yc=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:qc},Symbol.toStringTag,{value:"Module"})),Gc=()=>Object.freeze({}),Jc=["id","class","style","slot","items","selectedTab"],Zc=(e={})=>Object.entries(e).filter(([t])=>!Jc.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Xc=({props:e})=>{let t=Zc(e),s=e.items||[],r=e.selectedTab,i=s.map(n=>({...n,isSelected:n.id===r,bgColor:n.id===r?"ac":"",borderColor:n.id===r?"":"tr",textColor:n.id===r?"":"mu-fg"}));return{containerAttrString:t,items:i,selectedTab:r}},Qc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Gc,selectViewData:Xc},Symbol.toStringTag,{value:"Module"})),eu=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Mi=e=>Array.isArray(e)?[...e]:[],Fi=e=>{if(!e||typeof e.getBoundingClientRect!="function")return;let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.bottom+12),w:Math.max(Math.round(t.width),240)}},vs=({store:e,props:t})=>e.selectHasSelectedValues()?e.selectSelectedValues():Mi(t.selectedValues),Ki=({store:e,props:t})=>Array.isArray(t?.draftSelectedValues)?Mi(t.draftSelectedValues):e.getState().isOpen?e.selectDraftSelectedValues():vs({store:e,props:t}),tu=({dispatchEvent:e,value:t,operation:s,changedValue:r,label:i,index:n,item:o})=>{e(new CustomEvent("value-change",{detail:{value:t,operation:s,changedValue:r,label:i,index:n,item:o},bubbles:!0}))},su=({dispatchEvent:e,value:t})=>{e(new CustomEvent("draft-value-change",{detail:{value:t},bubbles:!0}))},Pe=({dispatchEvent:e,open:t})=>{e(new CustomEvent("open-change",{detail:{open:t},bubbles:!0}))},Fs=({store:e,props:t,refs:s}={})=>{let r=Fi(s?.trigger);return r?(e.openOptionsPopover({position:r,values:Ki({store:e,props:t})}),!0):!1},ru=e=>{let{store:t,props:s,render:r,refs:i}=e,n=!1;s.selectedValues!==void 0&&(t.updateSelectedValues({values:s.selectedValues,syncDraft:s.draftSelectedValues===void 0,preserveDraft:Array.isArray(s.draftSelectedValues)}),n=!0),Array.isArray(s.draftSelectedValues)&&(t.updateDraftSelectedValues({values:s.draftSelectedValues}),n=!0),s.open===!0&&!s.disabled&&Fs(e)&&(n=!0),n&&r()},iu=e=>{let{props:t,render:s,store:r,dispatchEvent:i}=e;if(t.disabled){t.open===!0&&Pe({dispatchEvent:i,open:!1});return}t.open===!0&&!r.getState().isOpen&&Fs(e)&&s()},nu=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n,refs:o}=e,l=!1;if(r?.disabled&&!s?.disabled){let p=i.getState().isOpen;i.closeOptionsPopover({}),p&&Pe({dispatchEvent:e.dispatchEvent,open:!1}),l=!0}if(s.selectedValues!==r.selectedValues&&(i.updateSelectedValues({values:r.selectedValues,syncDraft:r.draftSelectedValues===void 0,preserveDraft:Array.isArray(r.draftSelectedValues)}),l=!0),s.draftSelectedValues!==r.draftSelectedValues&&(i.updateDraftSelectedValues({values:Array.isArray(r?.draftSelectedValues)?r.draftSelectedValues:vs({store:i,props:r})}),l=!0),s.open!==r.open&&r.open!==void 0&&(r.open?r.disabled?Pe({dispatchEvent:e.dispatchEvent,open:!1}):Fs({store:i,props:r,refs:o})&&(l=!0):(i.closeOptionsPopover({}),l=!0)),s.options!==r.options){let p=vs({store:i,props:r}).length>0;(i.getState().isOpen||p)&&(l=!0)}l&&n()},Ui=(e,t)=>{let{store:s,render:r,refs:i,props:n,dispatchEvent:o}=e;if(n.disabled)return;t._event.stopPropagation();let l=Fi(i.trigger);l&&(s.openOptionsPopover({position:l,values:Ki({store:s,props:n})}),Pe({dispatchEvent:o,open:!0}),r())},ou=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Ui(e,t))},au=e=>{let{store:t,render:s,dispatchEvent:r}=e;t.closeOptionsPopover({}),Pe({dispatchEvent:r,open:!1}),s()},Hi=(e,t)=>{let{render:s,props:r,store:i,dispatchEvent:n}=e;if(r.disabled)return;let o=t._event;o.stopPropagation();let l=o.currentTarget.id.slice(6),p=Number(l),a=r.options[p];!a||eu(a)!=="item"||(i.toggleDraftSelectedValue({value:a.value}),su({dispatchEvent:n,value:i.selectDraftSelectedValues()}),s())},lu=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Hi(e,t))},pu=(e,t)=>{let{store:s,props:r,render:i,dispatchEvent:n}=e;if(r.disabled)return;t._event.stopPropagation();let o=s.selectDraftSelectedValues();s.commitDraftSelectedValues({}),r.onChange&&typeof r.onChange=="function"&&r.onChange(o),tu({dispatchEvent:n,value:o,operation:"set",changedValue:void 0,label:void 0,index:null,item:void 0}),Pe({dispatchEvent:n,open:!1}),i()},du=(e,t)=>{let{props:s,dispatchEvent:r}=e;s.disabled||s.noAdd||(t._event.stopPropagation(),r(new CustomEvent("add-option-click",{bubbles:!0,composed:!0})))},cu=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:du,handleAfterMount:iu,handleBeforeMount:ru,handleOnUpdate:nu,handleOptionClick:Hi,handleOptionKeyDown:lu,handlePopoverClose:au,handleSubmitClick:pu,handleTriggerClick:Ui,handleTriggerKeyDown:ou},Symbol.toStringTag,{value:"Module"})),qi=e=>{if(!e||typeof e.getBoundingClientRect!="function")return null;let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.bottom+12),w:Math.max(Math.round(t.width),240)}},Ct=e=>Array.isArray(e)?[...e]:[],vt=e=>{typeof e.render=="function"&&e.render()},Yi=e=>e.store?.selectHasSelectedValues?.()?e.store?.selectSelectedValues?.()||[]:Ct(e.props?.selectedValues),Ks=(e,t=[])=>{let s=qi(e.refs?.trigger);return!s||!e.store?.openOptionsPopover?!1:(e.store.openOptionsPopover({position:s,values:t}),!0)},Gi=(e,t=[],s=!1)=>e.store?.getState?.()?.isOpen&&e.store?.updateDraftSelectedValues?(e.store.updateDraftSelectedValues({values:t}),!0):s?Ks(e,t):!1,uu=function(e={}){let t=this.store?.getState?.(),s=Array.isArray(e.values)?Ct(e.values):this.store?.selectDraftSelectedValues?.()||[];if(t?.isOpen){let r=qi(this.refs?.trigger);r&&this.store.openOptionsPopover({position:r,values:s})}else e.keepOpen&&Ks(this,s.length>0?s:Yi(this));vt(this)},hu=function(e={}){let t=Ct(e.values);Gi(this,t,!!e.keepOpen)&&vt(this)},fu=function(e={}){if(!Object.prototype.hasOwnProperty.call(e||{},"value"))return;let t=this.store?.getState?.(),s=t?.isOpen?this.store?.selectDraftSelectedValues?.()||[]:Yi(this);if(s.some(i=>le(i,e.value))){e.keepOpen&&!t?.isOpen&&Ks(this,s)&&vt(this);return}let r=[...Ct(s),e.value];Gi(this,r,!!e.keepOpen)&&vt(this)},yu=Object.freeze(Object.defineProperty({__proto__:null,appendDraftSelectedValue:fu,refreshPopover:uu,setDraftSelectedValues:hu},Symbol.toStringTag,{value:"Module"})),mu=["id","class","style","slot","placeholder","options","open","selectedValues","draftSelectedValues","onChange","addOption","noAdd","disabled"],gu=(e={})=>Object.entries(e).filter(([t])=>!mu.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),bu=(e,t)=>Object.prototype.hasOwnProperty.call(e||{},t),Ji=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Zi=(e={})=>Ji(e)==="item",Xi=(e={})=>typeof e.icon=="string"&&e.icon.length>0?e.icon:"",vu=(e={})=>typeof e.shortcut=="string"&&e.shortcut.length>0?e.shortcut:typeof e.suffixText=="string"&&e.suffixText.length>0?e.suffixText:"",ye=e=>Array.isArray(e)?[...e]:[],wu=(e=[],t=[])=>e.length!==t.length?!1:e.every((s,r)=>le(s,t[r])),_u=(e=[],t)=>e.some(s=>le(s,t)),Qi=({state:e,props:t})=>e.hasSelectedValues?ye(e.selectedValues):ye(t.selectedValues),xu=({state:e,props:t})=>e.isOpen?ye(e.draftSelectedValues):Qi({state:e,props:t}),Su=e=>e==null?"":String(e),Au=(e=[],t)=>e.find(s=>Zi(s)&&le(s.value,t)),ws=({isSelected:e=!0,isAddChip:t=!1}={})=>{let s=["--tag-border-radius: var(--border-radius-md)","--muted-foreground: var(--foreground)"];return(t||!e)&&s.push("--muted: color-mix(in srgb, var(--muted) 82%, var(--background) 18%)"),`${s.join("; ")};`},ku=({option:e={},index:t,selectedValues:s=[],hasIconColumn:r=!1})=>{let i=Ji(e),n=i==="section",o=i==="separator",l=i==="item";if(n||o)return{...e,index:t,type:i,isSection:n,isSeparator:o,isItem:l};let p=_u(s,e.value),a=Xi(e),c=vu(e),d=p?c||"Added":c;return{...e,index:t,type:i,isSection:n,isSeparator:o,isItem:l,isSelected:p,hasIconSlot:r,icon:a,hasIcon:a.length>0,cursor:"pointer",tagStyle:ws({isSelected:p}),suffixText:d,hasSuffixText:d.length>0}},Eu=()=>Object.freeze({isOpen:!1,position:{x:0,y:0,w:240},selectedValues:[],draftSelectedValues:[],hasSelectedValues:!1}),$u=({state:e,props:t})=>{let s=gu(t),r=!!t.disabled,i=Qi({state:e,props:t}),n=xu({state:e,props:t}),o=(e.isOpen||i.length>0)&&Array.isArray(t.options)?t.options:[],l=o.some(f=>Zi(f)&&bu(f,"icon")),p=o.map((f,u)=>ku({option:f,index:u,selectedValues:n,hasIconColumn:l})),a=i.map((f,u)=>{let y=Au(o,f),m=y?Xi(y):"";return{value:f,selectionIndex:u,label:y?.label||Su(f),icon:m,hasIcon:m.length>0,testId:`tag-select-tag-${u}`}}),c=p.some(f=>f.isItem),d=!wu(i,n),h=a.length>0?a.map(f=>({...f,tagStyle:ws({isSelected:!0})})):[{value:void 0,selectionIndex:"",label:t.placeholder||"Add tag",icon:"",testId:"",tagStyle:ws({isAddChip:!0})}];return{containerAttrString:s,isDisabled:r,isOpen:e.isOpen,position:e.position,options:p,hasSelectableOptions:c,placeholder:t.placeholder||"Add tag",triggerTags:h,triggerCursor:r?"not-allowed":"pointer",triggerTabIndex:r?-1:0,showAddOption:!r&&!t.noAdd,addOptionLabel:t.addOption?.label||"Add tag",hasDraftChanges:d,submitDisabled:r,submitLabel:"Save"}},Cu=({state:e})=>ye(e.selectedValues),Iu=({state:e})=>!!e.hasSelectedValues,Ou=({state:e})=>ye(e.draftSelectedValues),Tu=({state:e},t={})=>{let{position:s,values:r}=t;e.position={...e.position,...s||{}},e.draftSelectedValues=ye(r),e.isOpen=!0},Lu=({state:e})=>{e.isOpen=!1,e.draftSelectedValues=[]},Vu=({state:e},t={})=>{e.draftSelectedValues=ye(t.values)},Nu=({state:e},t={})=>{let s=ye(t.values);e.selectedValues=s,e.hasSelectedValues=!0,(t.syncDraft||!e.isOpen)&&!t.preserveDraft&&(e.draftSelectedValues=[...s])},Ru=({state:e},t={})=>{let s=ye(e.draftSelectedValues),r=t.value,i=s.findIndex(n=>le(n,r));if(i>=0){e.draftSelectedValues=s.filter((n,o)=>o!==i);return}e.draftSelectedValues=[...s,r]},ju=({state:e})=>{e.selectedValues=ye(e.draftSelectedValues),e.hasSelectedValues=!0,e.isOpen=!1,e.draftSelectedValues=[]},Du=Object.freeze(Object.defineProperty({__proto__:null,closeOptionsPopover:Lu,commitDraftSelectedValues:ju,createInitialState:Eu,openOptionsPopover:Tu,selectDraftSelectedValues:Ou,selectHasSelectedValues:Iu,selectSelectedValues:Cu,selectViewData:$u,toggleDraftSelectedValue:Ru,updateDraftSelectedValues:Vu,updateSelectedValues:Nu},Symbol.toStringTag,{value:"Module"})),Pu=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Bu=()=>Object.freeze({}),Hr={sm:{textSize:"sm",padding:"md",maxWidth:"min(320px, calc(100vw - 16px))"},md:{textSize:"sm",padding:"md",maxWidth:"min(360px, calc(100vw - 16px))"},lg:{textSize:"md",padding:"lg",maxWidth:"min(420px, calc(100vw - 16px))"}},zu=({props:e})=>{let t=Hr[e.s]?e.s:"sm",s=Hr[t];return{open:!!e.open,x:e.x||0,y:e.y||0,place:e.place||"t",content:e.content||"",textSize:s.textSize,padding:s.padding,contentStyle:`padding: 0; min-width: 0; max-width: ${s.maxWidth};`}},Wu=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Bu,selectViewData:zu},Symbol.toStringTag,{value:"Module"})),Mu=async e=>{let{props:t,store:s,render:r,refs:i}=e,{waveformData:n}=t;s.setWaveformData({data:n}),r();let o=i.canvas;o&&en(n,o)},Fu=async(e,t)=>{let{store:s,render:r,refs:i,props:n}=e,{waveformData:o}=n;if(!o){console.log("waveform handleOnUpdate: no waveformData provided");return}s.setWaveformData({data:o}),r();let l=i.canvas;l&&en(o,l)};async function en(e,t){let s=t.getContext("2d"),r=t.getBoundingClientRect(),i=r.width,n=r.height;t.width=i,t.height=n;let o=t.width,l=t.height;if(s.clearRect(0,0,o,l),s.fillStyle="#1a1a1a",s.fillRect(0,0,o,l),!e||!e.amplitudes)return;let p=e.amplitudes,a=l/2,c=s.createLinearGradient(0,0,0,l);c.addColorStop(0,"#404040"),c.addColorStop(.5,"#A1A1A1"),c.addColorStop(1,"#404040");let d=Math.max(1,o/p.length),h=.2;for(let f=0;f<p.length;f++){let u=p[f]/255*(l*.85),y=f*d,m=a-u/2;s.fillStyle=c,s.fillRect(y,m,Math.max(1,d*(1-h)),u)}s.strokeStyle="rgba(255, 255, 255, 0.1)",s.lineWidth=1,s.beginPath(),s.moveTo(0,a),s.lineTo(o,a),s.stroke(),s.shadowBlur=10,s.shadowColor="#2196F3"}var Ku=Object.freeze(Object.defineProperty({__proto__:null,handleAfterMount:Mu,handleOnUpdate:Fu},Symbol.toStringTag,{value:"Module"})),Uu=()=>Object.freeze({waveformData:null}),Hu=({state:e},t={})=>{e.waveformData=t.data},qu=({state:e,props:t})=>({isLoading:t.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:t.waveformData}),Yu=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Uu,selectViewData:qu,setWaveformData:Hu},Symbol.toStringTag,{value:"Module"})),tn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sn=e=>e.replace(/-([a-z0-9])/g,(t,s)=>s.toUpperCase()),_s=e=>{if(e!=null)return e===""?!0:e},wt=(e,t)=>{let s=e.getAttribute(t);if(s!==null)return _s(s);let r=tn(t);if(r!==t){let i=e.getAttribute(r);if(i!==null)return _s(i)}},ps=Symbol("rtglReactivePropValues"),ds=Symbol("rtglNativeHostStyle"),Gu=(e,t)=>{let s=Object.getPrototypeOf(e);for(;s;){let r=Object.getOwnPropertyDescriptor(s,t);if(r)return r;s=Object.getPrototypeOf(s)}},rn=e=>{if(!e||typeof e!="object")return;if(Object.prototype.hasOwnProperty.call(e,ds))return e[ds];let t=Gu(e,"style"),s;return typeof t?.get=="function"?s=t.get.call(e):e.style&&typeof e.style=="object"&&(s=e.style),s&&typeof s=="object"&&Object.defineProperty(e,ds,{value:s,enumerable:!1,configurable:!1,writable:!1}),s},Ju=e=>(Object.prototype.hasOwnProperty.call(e,ps)||Object.defineProperty(e,ps,{value:Object.create(null),enumerable:!1,configurable:!1,writable:!1}),e[ps]),Zu=({source:e,allowedKeys:t=[],onPropChange:s})=>{let r=Ju(e);t.includes("style")&&rn(e),t.forEach(i=>{if(typeof i!="string"||i.length===0)return;let n=Object.prototype.hasOwnProperty.call(e,i)?e[i]:void 0,o=Object.prototype.hasOwnProperty.call(e,i);o&&delete e[i],Object.defineProperty(e,i,{configurable:!0,enumerable:!0,get(){return Object.prototype.hasOwnProperty.call(r,i)?r[i]:wt(e,i)},set(l){let p=Object.prototype.hasOwnProperty.call(r,i)?r[i]:wt(e,i);l===void 0?delete r[i]:r[i]=l,p!==l&&s?.({propName:i,oldValue:p,newValue:l})}}),o&&(r[i]=n)})},Xu=(e,t)=>{let s=new Set(t);return new Proxy({},{get(r,i){if(typeof i=="string"&&s.has(i)){let n=e[i];return n!==void 0?n:wt(e,i)}},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(r,i){return typeof i=="string"&&s.has(i)},ownKeys(){return[...s]},getOwnPropertyDescriptor(r,i){if(typeof i=="string"&&s.has(i))return{configurable:!0,enumerable:!0,get:()=>{let n=e[i];return n!==void 0?n:wt(e,i)}}}})},Qu=({schema:e,methodExports:t=[]})=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("componentName is required.");if(typeof e.componentName!="string"||e.componentName.trim()==="")throw new Error("componentName is required.");if(Object.prototype.hasOwnProperty.call(e,"attrsSchema"))throw new Error("attrsSchema is not supported.");if(Object.prototype.hasOwnProperty.call(e,"methods")){let s=e.methods;if(!s||typeof s!="object"||Array.isArray(s))throw new Error("methods must be an object schema with a properties map.");if(Object.prototype.hasOwnProperty.call(s,"type")&&s.type!=="object")throw new Error("methods.type must be 'object'.");if(!s.properties||typeof s.properties!="object"||Array.isArray(s.properties))throw new Error("methods.properties must be an object keyed by method name.");for(let r of Object.keys(s.properties))if(!t.includes(r))throw new Error(`method '${r}' is declared in schema but missing in .methods.js exports.`)}return!0},v={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9,PARTIAL:10,PATH_REFERENCE:11},P={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},xs={NOT:0},E=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},re=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}},qr=e=>{if(!e||e.trim()==="")throw new E("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let s=e.includes("===")?"==":"!=";throw new E(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${s}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let s of t)if(e.trim().endsWith(s))throw new E(`Incomplete comparison expression - missing right operand (got: '${e}')`)},eh=e=>{if(e.trim().endsWith(" in"))throw new E(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new E(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,s]=e.split(" in ");if(!s||s.trim()==="")throw new E(`Missing iterable expression after 'in' (got: '$for ${e}')`);let r=t.includes(",")?t.split(",").map(i=>i.trim()):[t.trim()];for(let i of r){if(!i)throw new E(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(i))throw new E(`Invalid loop syntax (got: '$for ${e}')`)}},th=(e,t,s=!1)=>{if(t===null)return new re(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new re(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return s?new re(`Cannot iterate over non-array value in loop '${e}' - got ${r} instead`):new re(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},sh=(e,t)=>{let s=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new re(`Unknown function '${e}' (${s})`)},nn=(e,t,s={})=>{let r={},i={};s&&typeof s=="object"&&(s.functions!==void 0||s.partials!==void 0?(r=s.functions||{},i=s.partials||{}):typeof s=="object"&&(r=s));let n=R(e,{functions:r,partials:i},t,{});return n===void 0?{}:n},R=(e,t,s,r)=>{if(t.functions,e.var&&!e.type)return U(e.var,s,r);if(e.type===v.LITERAL)return e.value;if(e.type===v.VARIABLE)return U(e.path,s,r);if(e.type===v.INTERPOLATION)return ih(e.parts,t,s,r);switch(e.type){case v.FUNCTION:return on(e,t,s,r);case v.BINARY:return an(e,t,s,r);case v.UNARY:return ln(e,t,s,r);case v.CONDITIONAL:return oh(e,t,s,r);case v.LOOP:return ch(e,t,s,r);case v.OBJECT:return hh(e,t,s,r);case v.ARRAY:return fh(e,t,s,r);case v.PARTIAL:return yh(e,t,s,r);case v.PATH_REFERENCE:return mh(e,t,s,r);default:throw new Error(`Unknown node type: ${e.type}`)}},Yr=new Map,rh=e=>{let t=[],s="",r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(n==="[")s&&(t.push({type:"property",value:s}),s=""),r=!0;else if(n==="]"){if(r&&s){let o=s.trim();if(/^\d+$/.test(o))t.push({type:"index",value:parseInt(o,10)});else if(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'")){let l=o.slice(1,-1);t.push({type:"property",value:l})}else t.push({type:"property",value:o});s=""}r=!1}else s+=n}return s&&t.push({type:"property",value:s}),t},U=(e,t,s)=>{if(!e)return;if(e in s)return s[e];let r=Yr.get(e);if(!r){let n=[],o="",l=0;for(let p=0;p<e.length;p++){let a=e[p];a==="["?(l++,o+=a):a==="]"?(l--,o+=a):a==="."&&l===0?o&&(n.push(o),o=""):o+=a}o&&n.push(o),r=[];for(let p of n){let a=rh(p.trim());r.push(...a)}Yr.set(e,r)}let i=t;for(let n=0;n<r.length;n++){let o=r[n];if(o.type==="property"&&o.value in s){i=s[o.value];continue}if(i==null)return;(o.type==="property"||o.type==="index")&&(i=i[o.value])}return i},ih=(e,t,s,r)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let o=R(n,t,s,r);i.push(o!=null?String(o):"")}return i.join("")},on=(e,t,s,r)=>{let i=t.functions||t,n=i[e.name];if(!n)throw sh(e.name,i);let o=e.args.map(l=>R(l,t,s,r));return n(...o)},Be=(e,t,s,r)=>{if(e.var&&!e.type)return U(e.var,s,r);switch(e.type){case v.VARIABLE:return U(e.path,s,r);case v.LITERAL:return e.value;case v.BINARY:return an(e,t,s,r);case v.UNARY:return ln(e,t,s,r);case v.FUNCTION:return on(e,t,s,r);default:return R(e,t,s,r)}},an=(e,t,s,r)=>{if(e.op===P.AND||e.op===P.OR){let o=Be(e.left,t,s,r),l=Be(e.right,t,s,r);switch(e.op){case P.AND:return o&&l;case P.OR:return o||l}}let i=R(e.left,t,s,r),n=R(e.right,t,s,r);switch(e.op){case P.EQ:return i==n;case P.NEQ:return i!=n;case P.GT:return i>n;case P.LT:return i<n;case P.GTE:return i>=n;case P.LTE:return i<=n;case P.IN:return Array.isArray(n)?n.includes(i):!1;case P.ADD:if(typeof i!="number"||typeof n!="number")throw new re(`Arithmetic operations require numbers. Got ${typeof i} + ${typeof n}`);return i+n;case P.SUBTRACT:if(typeof i!="number"||typeof n!="number")throw new re(`Arithmetic operations require numbers. Got ${typeof i} - ${typeof n}`);return i-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},ln=(e,t,s,r)=>{let i=e.op===xs.NOT?Be(e.operand,t,s,r):R(e.operand,t,s,r);switch(e.op){case xs.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},nh=(e,t,s,r)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===v.VARIABLE)if(U(i.path,s,r)){let n=e.bodies[0];if(n.type===v.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?R(l.parsedKey,t,s,r):l.key,a=l.value;if(a.type===v.LITERAL)o[p]=a.value;else if(a.type===v.VARIABLE)o[p]=U(a.path,s,r);else if(a.type===v.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let h=U(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=R(d,t,s,r);c.push(h!=null?String(h):"")}o[p]=c.join("")}else o[p]=R(a,t,s,r)}return o}}else{let n=e.bodies[1];if(n.type===v.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?R(l.parsedKey,t,s,r):l.key,a=l.value;if(a.type===v.LITERAL)o[p]=a.value;else if(a.type===v.VARIABLE)o[p]=U(a.path,s,r);else if(a.type===v.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let h=U(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=R(d,t,s,r);c.push(h!=null?String(h):"")}o[p]=c.join("")}else o[p]=R(a,t,s,r)}return o}}}return null},oh=(e,t,s,r)=>{let i=nh(e,t,s,r);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||Be(o,t,s,r))return R(e.bodies[n],t,s,r)}return pn},ah=(e,t)=>{let s=e.body,r=e.itemVar;if(s.type===v.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===v.VARIABLE){let i=s.conditions[0].path,n=s.bodies[0];if(i.startsWith(r+".")){let o=i.substring(r.length+1);if(n.type===v.OBJECT&&n.properties.length<=5){for(let p of n.properties)if(p.parsedKey)return null;let l=[];for(let p=0;p<t.length;p++){let a=t[p];if(a[o]){let c={};for(let d of n.properties){let h=d.key,f=d.value;if(f.type===v.LITERAL)c[h]=f.value;else if(f.type===v.VARIABLE){let u=f.path;if(u===r)c[h]=a;else if(u.startsWith(r+".")){let y=u.substring(r.length+1);c[h]=a[y]}else return null}else if(f.type===v.INTERPOLATION){let u=[],y=!0;for(let m of f.parts)if(typeof m=="string")u.push(m);else if(m.type===v.VARIABLE){let b=m.path;if(b===r)u.push(a!=null?String(a):"");else if(b.startsWith(r+".")){let g=b.substring(r.length+1),_=a[g];u.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[h]=u.join("")}else return null}l.push(c)}}return l}}}return null},lh=(e,t)=>{let s=e.body,r=e.itemVar,i=ah(e,t);if(i!==null)return i;if(s.type===v.OBJECT&&s.properties.length<=5&&!s.whenCondition){for(let l of s.properties)if(l.parsedKey)return null;let n=[],o=!0;for(let l of s.properties){let p=l.key,a=l.value;if(a.type===v.LITERAL)n.push({key:p,type:"literal",value:a.value});else if(a.type===v.VARIABLE){let c=a.path;if(c===r)n.push({key:p,type:"item"});else if(c.startsWith(r+".")){let d=c.substring(r.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:p,type:"prop",prop:d});else{o=!1;break}}else{o=!1;break}}else if(a.type===v.INTERPOLATION&&a.parts.length===1){let c=a.parts[0];if(c.type===v.VARIABLE){let d=c.path;if(d===r)n.push({key:p,type:"item_string"});else if(d.startsWith(r+".")){let h=d.substring(r.length+1);if(!h.includes(".")&&!h.includes("["))n.push({key:p,type:"prop_string",prop:h});else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}if(o){let l=new Array(t.length);if(n.length===3&&n[0].type==="prop"&&n[0].key==="id"&&n[1].type==="prop_string"&&n[1].key==="title"&&n[2].type==="prop"&&n[2].key==="completed")for(let p=0;p<t.length;p++){let a=t[p];l[p]={id:a.id,title:a.title!=null?String(a.title):"",completed:a.completed}}else for(let p=0;p<t.length;p++){let a=t[p],c={};for(let d of n)if(d.type==="literal")c[d.key]=d.value;else if(d.type==="item")c[d.key]=a;else if(d.type==="prop")c[d.key]=a[d.prop];else if(d.type==="item_string")c[d.key]=a!=null?String(a):"";else if(d.type==="prop_string"){let h=a[d.prop];c[d.key]=h!=null?String(h):""}l[p]=c}return l}}return null},ph=(e,t,s,r,i)=>{let n=[],o=e.body;if(o.type===v.OBJECT&&o.fast!==!1){let l=e.itemVar,p=e.indexVar;for(let a=0;a<i.length;a++){let c=i[a],d={},h={...r,[l]:c,...p&&{[p]:a}};h.__paths__||(h.__paths__=r.__paths__||{});let f=e.iterable.path||"";if(r&&r.__paths__&&f){let u=f.split("."),y=u[0];y in r.__paths__&&(f=r.__paths__[y],u.length>1&&(f+="."+u.slice(1).join(".")))}h.__paths__={...h.__paths__,[l]:`${f}[${a}]`,...p&&{[p]:a}};for(let u of o.properties){let y=u.parsedKey?R(u.parsedKey,t,s,h):u.key,m=u.value;if(m.type===v.LITERAL)d[y]=m.value;else if(m.type===v.VARIABLE){let b=m.path;if(b===l)d[y]=c;else if(b===p)d[y]=a;else if(b.startsWith(l+".")){let g=b.substring(l.length+1);!g.includes(".")&&!g.includes("[")?d[y]=c[g]:d[y]=U(b,s,{...r,[l]:c,...p&&{[p]:a}})}else d[y]=U(b,s,{...r,[l]:c,...p&&{[p]:a}})}else if(m.type===v.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=g.path,S;if(_===l)S=c;else if(_===p)S=a;else if(_.startsWith(l+".")){let A=_.substring(l.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=U(_,s,{...r,[l]:c,...p&&{[p]:a}})}else S=U(_,s,{...r,[l]:c,...p&&{[p]:a}});b.push(S!=null?String(S):"")}else{let _={...r,[l]:c,...p&&{[p]:a}},S=R(g,t,s,_);b.push(S!=null?String(S):"")}d[y]=b.join("")}else{let b={...r,[l]:c,...p&&{[p]:a}};d[y]=R(m,t,s,b)}}n.push(d)}return n}return null},dh=(e,t,s)=>{let r=e.body;if(r.type===v.OBJECT&&r.properties.length===1&&r.properties[0].key==="$if item.visible"){let i=r.properties[0].value;if(i.type===v.CONDITIONAL&&i.conditions.length===1&&i.conditions[0].type===v.VARIABLE&&i.conditions[0].path==="item.visible"){let n=i.bodies[0];if(n.type===v.OBJECT&&n.properties.length===2){let o=n.properties[0],l=n.properties[1];if(o.key==="id"&&o.value.type===v.VARIABLE&&o.value.path==="item.id"&&l.key==="$if item.highlighted"&&l.value.type===v.CONDITIONAL){let p=[];for(let a=0;a<t.length;a++){let c=t[a];if(c.visible){let d={id:c.id};c.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${c.name}`):(d.highlight=!1,d.message=c.name),p.push(d)}}return p}}}}return null},ch=(e,t,s,r)=>{let i=R(e.iterable,t,s,r);if(!Array.isArray(i)){let a,c=!1;if(e.iterable.type===v.FUNCTION){c=!0;let h=e.iterable.args.map(f=>f.type===v.LITERAL?typeof f.value=="string"?`'${f.value}'`:String(f.value):f.type===v.VARIABLE?f.path:f.type===v.FUNCTION?`${f.name}(...)`:"?").join(", ");a=`${e.iterable.name}(${h})`}else a=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${a}`;throw th(d,i,c)}if(!e.indexVar){let a=dh(e,i,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=lh(e,i);if(a!==null)return a}let n=ph(e,t,s,r,i);if(n!==null)return n;let o=[],l=e.iterable.path||"";if(r&&r.__paths__&&l){let a=l.split("."),c=a[0];c in r.__paths__&&(l=r.__paths__[c],a.length>1&&(l+="."+a.slice(1).join(".")))}let p=!1;e.body.type===v.ARRAY&&(e.body.items.length<=1?p=!1:p=e.body._shouldPreserveArray??=e.body.items.some(a=>a.type===v.OBJECT&&a.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let a=0;a<i.length;a++){let c=e.indexVar?{...r,[e.itemVar]:i[a],[e.indexVar]:a}:{...r,[e.itemVar]:i[a]};c.__paths__||(c.__paths__=r.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${l}[${a}]`},e.indexVar&&(c.__paths__[e.indexVar]=a);let d=R(e.body,t,s,c);if(Array.isArray(d)&&d.length===1&&!p){let h=d[0];o.push(h===void 0?{}:h)}else o.push(d===void 0?{}:d)}return o},uh=(e,t,s,r)=>{if(e.whenCondition)return null;if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?R(i.parsedKey,t,s,r):i.key,o=i.value;if(o.type===v.OBJECT&&o.properties.length<=10&&!o.whenCondition){let l={},p={},a=!0;for(let c of o.properties){let d=c.parsedKey?R(c.parsedKey,t,s,r):c.key,h=c.value;if(h.type===v.LITERAL)p[d]=h.value;else if(h.type===v.VARIABLE)p[d]=U(h.path,s,r);else if(h.type===v.INTERPOLATION){let f=[];for(let u of h.parts)if(typeof u=="string")f.push(u);else if(u.type===v.VARIABLE){let y=U(u.path,s,r);f.push(y!=null?String(y):"")}else{a=!1;break}if(!a)break;p[d]=f.join("")}else if(h.type===v.OBJECT&&h.properties.length<=5){let f={};for(let u of h.properties){let y=u.key,m=u.value;if(m.type===v.LITERAL)f[y]=m.value;else if(m.type===v.VARIABLE)f[y]=U(m.path,s,r);else if(m.type===v.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=U(g.path,s,r);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[y]=b.join("")}else{a=!1;break}}if(!a)break;p[d]=f}else{a=!1;break}}if(a)return l[n]=p,l}}return null},hh=(e,t,s,r)=>{let i=t.functions||t;if(e.whenCondition&&!Be(e.whenCondition,i,s,r))return;let n=uh(e,t,s,r);if(n!==null)return n;if(e.fast){let p={};for(let a of e.properties){let c=a.parsedKey?R(a.parsedKey,t,s,r):a.key,d=a.value;if(d.type===v.LITERAL)p[c]=d.value;else if(d.type===v.VARIABLE)p[c]=U(d.path,s,r);else if(d.type===v.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===v.VARIABLE){let u=U(f.path,s,r);h.push(u!=null?String(u):"")}else{let u=R(f,t,s,r);h.push(u!=null?String(u):"")}p[c]=h.join("")}else p[c]=R(d,t,s,r)}return p}let o={},l=!1;for(let p of e.properties)if(!p.key.startsWith("$if ")&&!p.key.match(/^\$if\s+\w+.*:?$/)&&!p.key.startsWith("$elif")&&!p.key.startsWith("$else")&&!p.key.startsWith("$for ")){l=!0;break}for(let p of e.properties)if(p.key.startsWith("$if ")||p.key.match(/^\$if\s+\w+.*:?$/)){let a=R(p.value,t,s,r);if(!l&&a!==null&&a!==void 0)return Array.isArray(a)&&a.length===1?a[0]:a;typeof a=="object"&&a!==null&&!Array.isArray(a)&&Object.assign(o,a)}else if(p.key.startsWith("$for ")){if(e.properties.length===1)return R(p.value,t,s,r)}else{let a=p.value;if(a&&a.type===v.OBJECT&&a.properties){let c=a.properties.find(d=>d.key.startsWith("$for "));if(c){let d=R(c.value,t,s,r);d!==void 0&&(o[p.key]=d)}else{let d=R(p.value,t,s,r);d!==void 0&&(o[p.key]=d)}}else{let c=p.parsedKey?R(p.parsedKey,t,s,r):p.key,d=R(p.value,t,s,r);d!==void 0&&(o[c]=d)}}return o},pn={},fh=(e,t,s,r)=>{let i=[];for(let n of e.items)if(n.type===v.LOOP){let o=R(n,t,s,r);Array.isArray(o)&&n.flatten!==!1?i.push(...o):i.push(o)}else{let o=R(n,t,s,r);o!==pn&&o!==void 0&&i.push(o)}return i},yh=(e,t,s,r)=>{let{name:i,data:n,whenCondition:o}=e,l=t.partials||{},p=t.functions||t;if(o&&!Be(o,p,s,r))return;if(!l[i])throw new re(`Partial '${i}' is not defined`);let a=r._partialStack||[];if(a.includes(i))throw new re(`Circular partial reference detected: ${i}`);let c=l[i],d=s,h={...r,_partialStack:[...a,i]};if(r){d={...s};for(let f of Object.keys(r))f.startsWith("_")||(d[f]=r[f])}if(n){let f=R(n,t,s,r);d={...d,...f}}return R(c,t,d,h)},mh=(e,t,s,r)=>{let{path:i}=e,n=i.split("."),o=n[0],l=n.slice(1);if(!r||!(o in r))throw new re(`Path reference '#{${i}}' refers to '${o}' which is not a loop variable in the current scope`);if(r.__paths__||(r.__paths__={}),!(o in r.__paths__))throw new re(`Path reference '#{${i}}' cannot be resolved - path tracking may not be initialized properly`);let p=r.__paths__[o];if(typeof p=="number"){if(l.length>0)throw new re(`Path reference '#{${i}}' - cannot access properties on index variable '${o}'`);return String(p)}return l.length>0&&(p+="."+l.join(".")),p},gh=/\$\{([^}]*)\}/g,bh=/#\{([^}]*)\}/g,dn=(e,t={})=>{let s=e.match(/^(\w+)\((.*)\)$/);if(!s)return{isFunction:!1};let[,r,i]=s,n=vh(i,t);return{isFunction:!0,type:v.FUNCTION,name:r,args:n}},vh=(e,t={})=>e.trim()?wh(e).map(s=>_h(s.trim(),t)):[],wh=e=>{let t=[],s="",r=0,i=!1,n="";for(let o=0;o<e.length;o++){let l=e[o],p=o>0?e[o-1]:"";!i&&(l==='"'||l==="'")?(i=!0,n=l,s+=l):i&&l===n&&p!=="\\"?(i=!1,n="",s+=l):!i&&l==="("?(r++,s+=l):!i&&l===")"?(r--,s+=l):!i&&l===","&&r===0?(t.push(s),s=""):s+=l}return s&&t.push(s),t},_h=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:v.LITERAL,value:parseFloat(e)};if(e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};let s=dn(e,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};let r=e.trim(),i=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:o,type:l}of i){let p=0;for(;p<r.length;){let a=Ve(r.substring(p),o);if(a===-1)break;let c=p+a;c>n&&(n=c),p=c+o.length}}if(n!==-1)try{return Q(r,t)}catch{return{type:v.VARIABLE,path:r}}return{type:v.VARIABLE,path:r}},cn=/^\w+\(.*\)$/,xh=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,Sh=e=>{if(!(!e||e.trim()===""||cn.test(e))&&xh.test(e))throw e.includes("?")&&e.includes(":")?new E(`Complex expressions not supported in variable replacements - consider calculating the value in your data instead. Offending expression: "${e}"`):e.includes("||")||e.includes("&&")||e.includes("??")?new E(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new E(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},Gr=e=>{let t=e.trim();if(cn.test(t))throw new E(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new E(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new E(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new E(`Logical operators not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("?")&&t.includes(":"))throw new E(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:v.PATH_REFERENCE,path:t}},_t=(e,t={})=>{let s=e.trim();Sh(s);let r=dn(s,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};if(s.includes("[")&&!/[\s+\-*/%|&?:]/.test(s)){let i=0;for(let n of s)n==="["?i++:n==="]"&&i--;if(i!==0)throw new Error("Invalid array index syntax")}return{type:v.VARIABLE,path:s}},un=(e,t={})=>{let s=e,r=[];(e.includes("\\${")||e.includes("\\#{"))&&(s=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),s=s.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),s=s.replace(/\\(\$\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\(#\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\DOUBLE_ESC_VAR/g,"\\"),s=s.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let i=[...s.matchAll(gh)],n=[...s.matchAll(bh)],o=[...i.map(a=>({match:a,type:"variable"})),...n.map(a=>({match:a,type:"pathref"}))].sort((a,c)=>a.match.index-c.match.index);if(o.length===0){let a=s;for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);return{type:v.LITERAL,value:a}}if(o.length===1&&o[0].match[0]===s&&r.length===0){let{match:a,type:c}=o[0];try{return c==="variable"?_t(a[1],t):Gr(a[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:v.LITERAL,value:s};throw d}}let l=[],p=0;for(let{match:a,type:c}of o){let[d,h]=a,f=a.index;if(f>p){let u=s.substring(p,f);for(let y=0;y<r.length;y++)u=u.replace(`__ESCAPED_${y}__`,r[y]);u&&l.push(u)}try{let u;c==="variable"?u=_t(h.trim(),t):u=Gr(h.trim()),l.push(u)}catch(u){if(u.message==="Invalid array index syntax")l.push(d);else throw u}p=f+d.length}if(p<s.length){let a=s.substring(p);for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);a&&l.push(a)}return{type:v.INTERPOLATION,parts:l}},Ee=(e,t)=>typeof e=="string"?un(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?kh(e,t):Eh(e,t):{type:v.LITERAL,value:e},Ah=e=>{let{$each:t,...s}=e;if(typeof t!="string")throw new E("$each value must be a non-empty string");let r=t.trim();if(r==="")throw new E("$each value must be a non-empty string");if(Object.keys(s).length===0)throw new E("Empty $each body not allowed");if(s.$partial!==void 0)throw new E("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${r}`]:s}},kh=(e,t)=>{let s=[],r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let p=Ah(n),a=Object.keys(p);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let c=Jr(a[0],p[a[0]],t,!0);s.push(c),r=!0;continue}}catch(p){throw p instanceof E?p:new E(p.message)}let l=Object.keys(n);if(l.length===1&&/^\$for(?::\w+)?\s/.test(l[0])){let p=Jr(l[0],n[l[0]],t);s.push(p),r=!0;continue}}let o=Ee(n,t);s.push(o),(o.type===v.FUNCTION||o.type===v.CONDITIONAL||o.type===v.LOOP||o.type===v.PARTIAL||o.type===v.OBJECT&&!o.fast||o.type===v.ARRAY&&!o.fast)&&(r=!0)}return{type:v.ARRAY,items:s,fast:!r}},Eh=(e,t)=>{let s=[],r=!1,i=null,n=Object.entries(e),o=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new E("$partial value must be a string");if(e.$partial.trim()==="")throw new E("$partial value cannot be an empty string");let p=["$if","$elif","$else","$for"],a=[];for(let[b]of n)for(let g of p)if(b===g||b.startsWith(g+" ")||b.startsWith(g+"#")){a.push(g);break}if(a.length>0)throw new E(`Cannot use $partial with ${a.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...h}=e,f={},u=!1;for(let[b,g]of Object.entries(h)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=g,u=!0}let y=null;if(u&&(y=Ee(f,t),y.type===v.OBJECT)){let b=!1;for(let g of y.properties)if(g.value.type===v.VARIABLE||g.value.type===v.INTERPOLATION||g.value.type===v.FUNCTION||g.value.type===v.CONDITIONAL||g.value.type===v.OBJECT&&!g.value.fast||g.value.type===v.ARRAY&&!g.value.fast){b=!0;break}b&&(y.fast=!1)}let m={type:v.PARTIAL,name:c,data:y};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new E("Empty condition expression after '$when'");b=Q(d,t)}else b={type:v.LITERAL,value:d};m.whenCondition=b}return m}for(let[p,a]of n)if(p==="$when"){if(i!==null)throw new E("Multiple '$when' directives on the same object are not allowed");if(a==null)throw new E("Missing condition expression after '$when'");let c=typeof a=="string"?a:JSON.stringify(a);if(c.trim()==="")throw new E("Empty condition expression after '$when'");i=Q(c,t),r=!0}else if(p.startsWith("$when#")||p.startsWith("$when "))throw new E("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;o<n.length;){let[p,a]=n[o];if(p==="$when"){o++;continue}if(p==="$each")throw new E("$each can only be used inside arrays");if(p.startsWith("$if ")||p.match(/^\$if#\w+\s/)||p.match(/^\$if\s+\w+.*:$/)){let c=$h(n,o,t);s.push({key:p,value:c.node}),r=!0,o=c.nextIndex}else if(/^\$for(?::\w+)?\s/.test(p)){let c=p.match(/^\$for(?::(\w+))?\s/)?.[1]||"",d=c?`:${c}`:"";throw new E(`$for loops must be inside arrays - use '- $for${d} item in items:' instead of '$for${d} item in items:'. For cleaner object generation syntax, consider using $each.`)}else{if(p.startsWith("$elif ")||p.startsWith("$else"))throw new E(`'${p.split(" ")[0]}' without matching '$if'`);if(p==="$if"||p==="$if:")throw new E("Missing condition expression after '$if'");{let c=Ee(a,t);(c.type===v.FUNCTION||c.type===v.CONDITIONAL||c.type===v.PARTIAL||c.type===v.OBJECT&&!c.fast||c.type===v.ARRAY&&!c.fast)&&(r=!0);let d=un(p,t),h={key:p,value:c};(d.type!==v.LITERAL||d.value!==p)&&(h.parsedKey=d),s.push(h),o++}}}let l={type:v.OBJECT,properties:s,fast:!r};return i&&(l.whenCondition=i),l},$h=(e,t,s={})=>{let r=[],i=[],n=t,[o,l]=e[n],p=null,a;if(o.startsWith("$if#")){let d=o.match(/^\$if#(\w+)\s+(.+)$/);if(d)p=d[1],a=d[2];else throw new E(`Invalid conditional syntax: ${o}`)}else a=o.substring(4),a.endsWith(":")&&(a=a.slice(0,-1).trim());qr(a);let c=Q(a,s);for(r.push(c),i.push(Ee(l,s)),n++;n<e.length;){let[d,h]=e[n],f=!1,u;if(p?d.startsWith(`$elif#${p} `)?(u=d.substring(`$elif#${p} `.length),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d===`$else#${p}`||d===`$else#${p}:`)&&(f=!0,u=null):d.startsWith("$elif ")?(u=d.substring(6),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,u=null),f){if(u===null)r.push(null);else{qr(u);let y=Q(u,s);r.push(y)}if(i.push(Ee(h,s)),n++,u===null)break}else break}return{node:{type:v.CONDITIONAL,conditions:r,bodies:i,id:p},nextIndex:n}},Q=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let a=e.slice(1,-1),c=0,d=!0;for(let h=0;h<a.length;h++)if(a[h]==="("?c++:a[h]===")"&&c--,c<0){d=!1;break}if(d&&c===0)return Q(a,t)}let s=Ve(e,"||");if(s!==-1)return{type:v.BINARY,op:P.OR,left:Q(e.substring(0,s).trim(),t),right:Q(e.substring(s+2).trim(),t)};let r=Ve(e,"&&");if(r!==-1)return{type:v.BINARY,op:P.AND,left:Q(e.substring(0,r).trim(),t),right:Q(e.substring(r+2).trim(),t)};let i=[{op:">=",type:P.GTE},{op:"<=",type:P.LTE},{op:"==",type:P.EQ},{op:"!=",type:P.NEQ},{op:">",type:P.GT},{op:"<",type:P.LT},{op:" in ",type:P.IN}];for(let{op:a,type:c}of i){let d=Ve(e,a);if(d!==-1)return{type:v.BINARY,op:c,left:Q(e.substring(0,d).trim(),t),right:Q(e.substring(d+a.length).trim(),t)}}let n=-1,o=null,l=[{op:" + ",type:P.ADD},{op:" - ",type:P.SUBTRACT}];for(let{op:a,type:c}of l){let d=0;for(;d<e.length;){let h=Ve(e.substring(d),a);if(h===-1)break;let f=d+h;f>n&&(n=f,o={op:a,type:c}),d=f+a.length}}if(n!==-1&&o)return{type:v.BINARY,op:o.type,left:Q(e.substring(0,n).trim(),t),right:Q(e.substring(n+o.op.length).trim(),t)};let p=[" * "," / "," % "];for(let a of p)if(Ve(e,a)!==-1)throw new E(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:v.UNARY,op:xs.NOT,operand:Q(e.substring(1).trim(),t)}:hn(e,t)},Ve=(e,t)=>{let s=0,r=0;for(;r<=e.length-t.length;){if(e[r]==="(")s++;else if(e[r]===")")s--;else if(s===0&&e.substring(r,r+t.length)===t)return r;r++}return-1},Ch=e=>{if(e=e.trim(),e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:v.LITERAL,value:""};if(e==="{}")return{type:v.LITERAL,value:{}};if(e==="[]")return{type:v.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:v.LITERAL,value:t}:{type:v.VARIABLE,path:e}},hn=(e,t)=>{let s=e.trim();if(s.match(/^(\w+)\((.*)\)$/))return _t(s,t);let r=Ch(s);if(r.type===v.LITERAL)return r;if(/^[a-zA-Z_$][\w.$]*$/.test(s))return{type:v.VARIABLE,path:s};try{return _t(s,t)}catch(i){if(i.message&&i.message.includes("not supported"))return r;throw i}},Ih=(e,t=!1)=>{try{eh(e)}catch(s){if(s instanceof E&&t){let r=s.message.replace(/\$for/g,"$each");throw new E(r.replace("Parse Error: ",""))}throw s}},Jr=(e,t,s,r=!1)=>{let i=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(i);if(!n){let m=r?"$each":"$for";throw new E(`Invalid loop syntax (got: '${e.replace("$for",m)}')`)}let o=n[1],l=n[2].trim();Ih(l,r);let p=l.match(/^(.+?)\s+in\s+(.+)$/);if(!p){let m=r?"$each":"$for";throw new E(`Invalid loop syntax - missing 'in' keyword (got: '${m} ${l}')`)}let a=p[1].trim(),c=p[2].trim(),d,h=null;if(a.includes(",")){let m=a.split(",").map(b=>b.trim());if(m.length!==2)throw new E(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=m[0],h=m[1]}else d=a;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new E(`Reserved variable name: ${d}`);if(h&&f.includes(h))throw new E(`Reserved variable name: ${h}`);let u=hn(c,s),y=Ee(t,s);return{type:v.LOOP,itemVar:d,indexVar:h,iterable:u,body:y,flatten:o!=="nested"}},Ss=(e,t={})=>{let{functions:s={}}=t;return Ee(e,s)},Oh=()=>Date.now(),Th=Object.freeze(Object.defineProperty({__proto__:null,now:Oh},Symbol.toStringTag,{value:"Module"})),fn=(e,t,s={})=>{let{functions:r={},partials:i={}}=s,n={...Th,...r},o=Ss(e,{functions:n}),l={};for(let[p,a]of Object.entries(i))l[p]=Ss(a,{functions:n});return nn(o,t,{functions:n,partials:l})},Qe=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Lh=(e,t)=>{!t||typeof t!="object"||Object.entries(t).forEach(([s,r])=>{if(s==="default")throw new Error("[Methods] Invalid method name 'default'. Use named exports in .methods.js; default export is not supported.");if(typeof r=="function"){if(s in e)throw new Error(`[Methods] Cannot define method '${s}' because it already exists on the component instance.`);Object.defineProperty(e,s,{configurable:!0,enumerable:!1,writable:!1,value:(i={})=>{let n=i===void 0?{}:i;if(!Qe(n))throw new Error(`[Methods] Method '${s}' expects payload to be an object.`);return r.call(e,n)}})}})},yn=Symbol.for("immer-nothing"),Zr=Symbol.for("immer-draftable"),oe=Symbol.for("immer-state");function ce(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ze=Object.getPrototypeOf;function We(e){return!!e&&!!e[oe]}function $e(e){return e?mn(e)||Array.isArray(e)||!!e[Zr]||!!e.constructor?.[Zr]||Ot(e)||Tt(e):!1}var Vh=Object.prototype.constructor.toString();function mn(e){if(!e||typeof e!="object")return!1;let t=ze(e);if(t===null)return!0;let s=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return s===Object?!0:typeof s=="function"&&Function.toString.call(s)===Vh}function xt(e,t){It(e)===0?Reflect.ownKeys(e).forEach(s=>{t(s,e[s],e)}):e.forEach((s,r)=>t(r,s,e))}function It(e){let t=e[oe];return t?t.type_:Array.isArray(e)?1:Ot(e)?2:Tt(e)?3:0}function As(e,t){return It(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function gn(e,t,s){let r=It(e);r===2?e.set(t,s):r===3?e.add(s):e[t]=s}function Nh(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ot(e){return e instanceof Map}function Tt(e){return e instanceof Set}function Se(e){return e.copy_||e.base_}function ks(e,t){if(Ot(e))return new Map(e);if(Tt(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let s=mn(e);if(t===!0||t==="class_only"&&!s){let r=Object.getOwnPropertyDescriptors(e);delete r[oe];let i=Reflect.ownKeys(r);for(let n=0;n<i.length;n++){let o=i[n],l=r[o];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(r[o]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[o]})}return Object.create(ze(e),r)}else{let r=ze(e);if(r!==null&&s)return{...e};let i=Object.create(r);return Object.assign(i,e)}}function Us(e,t=!1){return Lt(e)||We(e)||!$e(e)||(It(e)>1&&(e.set=e.add=e.clear=e.delete=Rh),Object.freeze(e),t&&Object.entries(e).forEach(([s,r])=>Us(r,!0))),e}function Rh(){ce(2)}function Lt(e){return Object.isFrozen(e)}var jh={};function Ce(e){let t=jh[e];return t||ce(0,e),t}var et;function bn(){return et}function Dh(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Xr(e,t){t&&(Ce("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Es(e){$s(e),e.drafts_.forEach(Ph),e.drafts_=null}function $s(e){e===et&&(et=e.parent_)}function Qr(e){return et=Dh(et,e)}function Ph(e){let t=e[oe];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ei(e,t){t.unfinalizedDrafts_=t.drafts_.length;let s=t.drafts_[0];return e!==void 0&&e!==s?(s[oe].modified_&&(Es(t),ce(4)),$e(e)&&(e=St(t,e),t.parent_||At(t,e)),t.patches_&&Ce("Patches").generateReplacementPatches_(s[oe].base_,e,t.patches_,t.inversePatches_)):e=St(t,s,[]),Es(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==yn?e:void 0}function St(e,t,s){if(Lt(t))return t;let r=t[oe];if(!r)return xt(t,(i,n)=>ti(e,r,t,i,n,s)),t;if(r.scope_!==e)return t;if(!r.modified_)return At(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;let i=r.copy_,n=i,o=!1;r.type_===3&&(n=new Set(i),i.clear(),o=!0),xt(n,(l,p)=>ti(e,r,i,l,p,s,o)),At(e,i,!1),s&&e.patches_&&Ce("Patches").generatePatches_(r,s,e.patches_,e.inversePatches_)}return r.copy_}function ti(e,t,s,r,i,n,o){if(We(i)){let l=n&&t&&t.type_!==3&&!As(t.assigned_,r)?n.concat(r):void 0,p=St(e,i,l);if(gn(s,r,p),We(p))e.canAutoFreeze_=!1;else return}else o&&s.add(i);if($e(i)&&!Lt(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;St(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(s,r)&&At(e,i)}}function At(e,t,s=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Us(t,s)}function Bh(e,t){let s=Array.isArray(e),r={type_:s?1:0,scope_:t?t.scope_:bn(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=r,n=Hs;s&&(i=[r],n=tt);let{revoke:o,proxy:l}=Proxy.revocable(i,n);return r.draft_=l,r.revoke_=o,l}var Hs={get(e,t){if(t===oe)return e;let s=Se(e);if(!As(s,t))return zh(e,s,t);let r=s[t];return e.finalized_||!$e(r)?r:r===cs(e.base_,t)?(us(e),e.copy_[t]=Is(r,e)):r},has(e,t){return t in Se(e)},ownKeys(e){return Reflect.ownKeys(Se(e))},set(e,t,s){let r=vn(Se(e),t);if(r?.set)return r.set.call(e.draft_,s),!0;if(!e.modified_){let i=cs(Se(e),t),n=i?.[oe];if(n&&n.base_===s)return e.copy_[t]=s,e.assigned_[t]=!1,!0;if(Nh(s,i)&&(s!==void 0||As(e.base_,t)))return!0;us(e),Cs(e)}return e.copy_[t]===s&&(s!==void 0||t in e.copy_)||Number.isNaN(s)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=s,e.assigned_[t]=!0),!0},deleteProperty(e,t){return cs(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,us(e),Cs(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let s=Se(e),r=Reflect.getOwnPropertyDescriptor(s,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:s[t]}},defineProperty(){ce(11)},getPrototypeOf(e){return ze(e.base_)},setPrototypeOf(){ce(12)}},tt={};xt(Hs,(e,t)=>{tt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});tt.deleteProperty=function(e,t){return tt.set.call(this,e,t,void 0)};tt.set=function(e,t,s){return Hs.set.call(this,e[0],t,s,e[0])};function cs(e,t){let s=e[oe];return(s?Se(s):e)[t]}function zh(e,t,s){let r=vn(t,s);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function vn(e,t){if(!(t in e))return;let s=ze(e);for(;s;){let r=Object.getOwnPropertyDescriptor(s,t);if(r)return r;s=ze(s)}}function Cs(e){e.modified_||(e.modified_=!0,e.parent_&&Cs(e.parent_))}function us(e){e.copy_||(e.copy_=ks(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Wh=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,s,r)=>{if(typeof t=="function"&&typeof s!="function"){let n=s;s=t;let o=this;return function(l=n,...p){return o.produce(l,a=>s.call(this,a,...p))}}typeof s!="function"&&ce(6),r!==void 0&&typeof r!="function"&&ce(7);let i;if($e(t)){let n=Qr(this),o=Is(t,void 0),l=!0;try{i=s(o),l=!1}finally{l?Es(n):$s(n)}return Xr(n,r),ei(i,n)}else if(!t||typeof t!="object"){if(i=s(t),i===void 0&&(i=t),i===yn&&(i=void 0),this.autoFreeze_&&Us(i,!0),r){let n=[],o=[];Ce("Patches").generateReplacementPatches_(t,i,n,o),r(n,o)}return i}else ce(1,t)},this.produceWithPatches=(t,s)=>{if(typeof t=="function")return(n,...o)=>this.produceWithPatches(n,l=>t(l,...o));let r,i;return[this.produce(t,s,(n,o)=>{r=n,i=o}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){$e(e)||ce(8),We(e)&&(e=Mh(e));let t=Qr(this),s=Is(e,void 0);return s[oe].isManual_=!0,$s(t),s}finishDraft(e,t){let s=e&&e[oe];(!s||!s.isManual_)&&ce(9);let{scope_:r}=s;return Xr(r,t),ei(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let s;for(s=t.length-1;s>=0;s--){let i=t[s];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}s>-1&&(t=t.slice(s+1));let r=Ce("Patches").applyPatches_;return We(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Is(e,t){let s=Ot(e)?Ce("MapSet").proxyMap_(e,t):Tt(e)?Ce("MapSet").proxySet_(e,t):Bh(e,t);return(t?t.scope_:bn()).drafts_.push(s),s}function Mh(e){return We(e)||ce(10,e),wn(e)}function wn(e){if(!$e(e)||Lt(e))return e;let t=e[oe],s;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,s=ks(e,t.scope_.immer_.useStrictShallowCopy_)}else s=ks(e,!0);return xt(s,(r,i)=>{gn(s,r,wn(i))}),t&&(t.finalized_=!1),s}var ae=new Wh,Fh=ae.produce;ae.produceWithPatches.bind(ae);ae.setAutoFreeze.bind(ae);ae.setUseStrictShallowCopy.bind(ae);ae.applyPatches.bind(ae);ae.createDraft.bind(ae);ae.finishDraft.bind(ae);var Kh=(e,t,s)=>{let{createInitialState:r,...i}=e,n={},o={},l={};return r&&(l=r({props:t,constants:s})),Object.entries(i).forEach(([p,a])=>{if(p.startsWith("select")){n[p]=(...c)=>a({state:l,props:t,constants:s},...c);return}o[p]=(c={})=>{let d=c===void 0?{}:c;if(!Qe(d))throw new Error(`[Store] Action '${p}' expects payload to be an object.`);return l=Fh(l,h=>a({state:h,props:t,constants:s},d)),l}}),{getState:()=>l,...o,...n}},_n=e=>!Qe(e)||Object.isFrozen(e)?e:(Object.values(e).forEach(t=>{_n(t)}),Object.freeze(e)),Uh=({setupConstants:e,fileConstants:t})=>{let s=Qe(e)?e:{},r=Qe(t)?t:{};return _n({...s,...r})},Hh=(e,t)=>{if(!t||typeof t!="object")return"";let s="",r=n=>Object.entries(n).map(([o,l])=>` ${o}: ${l};`).join(`
|
|
1509
1509
|
`),i=(n,o)=>{if(typeof o!="object"||o===null)return"";if(n.startsWith("@")){let p=Object.entries(o).map(([a,c])=>{let d=r(c);return` ${a} {
|
|
1510
1510
|
${d.split(`
|
|
1511
1511
|
`).map(h=>h?` ${h}`:"").join(`
|
|
@@ -1517,7 +1517,7 @@ ${p}
|
|
|
1517
1517
|
${l}
|
|
1518
1518
|
}`};return Object.entries(t).forEach(([n,o])=>{let l=i(n,o);l&&(s+=(s?`
|
|
1519
1519
|
|
|
1520
|
-
`:"")+l)}),s},Os=e=>Array.isArray(e)?e.reduce((t,s)=>{if(Array.isArray(s))t.push(...Os(s));else{if(s&&typeof s=="object"){let r=Object.entries(s);if(r.length>0){let[i,n]=r[0];Array.isArray(n)&&(s={[i]:Os(n)})}}t.push(s)}return t},[]):e,hs=":",Hh=new Set(["__proto__","constructor","prototype"]),qh=/^[A-Za-z_][A-Za-z0-9_.:-]*$/,si=e=>qh.test(e),ri=(e,t)=>{if(!t)return e;let s=[],r="",i=!1;for(let n=0;n<t.length;n++){let o=t[n];if(!i&&o===".")r&&(s.push(r),r="");else if(!i&&o==="[")r&&(s.push(r),r=""),i=!0;else if(i&&o==="]"){if(r){if(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))s.push(r.slice(1,-1));else{let l=Number(r);s.push(Number.isNaN(l)?r:l)}r=""}i=!1}else r+=o}return r&&s.push(r),s.reduce((n,o)=>{if(n==null)return;let l=typeof o=="number"?o:String(o);if(!(typeof l=="string"&&Hh.has(l)))return n[l]},e)},Yh=e=>e.replace(/-([a-z0-9])/g,(t,s)=>s.toUpperCase()),Gh=({attrsString:e="",viewData:t={},tagName:s,isWebComponent:r})=>{let i={},n={},o=g=>{if(g==="role"||g.startsWith("aria-")||g.startsWith("data-"))throw new Error(`[Parser] Invalid boolean attribute '?${g}'. Use normal binding for value-carrying attributes such as aria-*, data-*, and role.`)},l=(g,_,S)=>{let A=Yh(g);if(!A)throw new Error(`[Parser] Invalid ${S} prop name on '${s}'.`);if(Object.prototype.hasOwnProperty.call(n,A))throw new Error(`[Parser] Duplicate prop binding '${A}' on '${s}'. Use only one of 'name=value' or ':name=\${expr}'.`);n[A]=_},p=(g,_)=>{if(!si(g))throw new Error(`[Parser] Invalid ${_} attribute name '${g}' on '${s}'.`)};if(!e)return{attrs:i,props:n};let a=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,c,d=new Set;for(;(c=a.exec(e))!==null;){let g=c[1],_=c[2]??c[3]??c[4]??"";if(d.add(g),g.startsWith(".")){i[g]=_;continue}if(g.startsWith(hs)){let S=g.substring(1),A=_;if(c[4]!==void 0&&c[4]!==""){let k=c[4],C=ri(t,k);C!==void 0&&(A=C)}l(S,A,"property-form");continue}if(g.startsWith("?")){let S=g.substring(1);p(S,"boolean toggle");let A=_;o(S);let k;A==="true"?k=!0:A==="false"||A===""?k=!1:k=ri(t,A),k&&(i[S]=""),r&&S!=="id"&&l(S,!!k,"boolean attribute-form");continue}p(g,"binding"),i[g]=_,r&&g!=="id"&&l(g,_,"attribute-form")}let h=e,f=[],u,y=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g;for(;(u=y.exec(e))!==null;)f.push(u[0]);f.forEach(g=>{h=h.replace(g," ")});let m=/(\S+?)(?=\s|$)/g,b;for(;(b=m.exec(h))!==null;){let g=b[1];if(!g.startsWith(".")&&!(d.has(g)||g.startsWith(hs)||g.includes("="))){if(g.startsWith("?")){let _=g.substring(1);p(_,"boolean toggle"),o(_),i[_]="",r&&_!=="id"&&l(_,!0,"boolean attribute-form");continue}if(!si(g))throw new Error(`[Parser] Invalid attribute token '${g}' on '${s}'.`);!d.has(g)&&!g.startsWith(hs)&&!g.includes("=")&&(i[g]="",r&&g!=="id"&&l(g,!0,"boolean attribute-form"))}}return{attrs:i,props:n}},Ts=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,Jh=/^\$for\s+([A-Za-z_][A-Za-z0-9_]*)(?:\s*,\s*([A-Za-z_][A-Za-z0-9_]*))?\s+in\s+.+$/,xn=/^\$\{([^{}]+)\}$/,Zh=/^[A-Za-z_][A-Za-z0-9_]*(?:(?:\.[A-Za-z_][A-Za-z0-9_]*)|\[(?:\d+|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')\])*$/,ii=new WeakSet,qs=(e,t,s)=>{let r=new Set(e);return t&&r.add(t),s&&r.add(s),r},Xh=(e,t)=>{if(typeof e!="string")return t;let s=e.match(Jh);return s?qs(t,s[1],s[2]):t},Sn=e=>{if(typeof e!="string"||!e.includes(":")&&!e.includes("."))return null;Ts.lastIndex=0;let t;for(;(t=Ts.exec(e))!==null;){let s=t[1];if(s.startsWith("."))return{bindingName:s,rawValue:t[2]??t[3]??t[4]??"",key:e};if(!s.startsWith(":"))continue;let r=t[2]!==void 0||t[3]!==void 0,i=t[2]??t[3]??t[4]??"";if(r||!xn.test(i))return{bindingName:s,rawValue:i,key:e}}return null},Ls=(e,t=new Set)=>{if(Array.isArray(e)){for(let s of e){let r=Ls(s,t);if(r)return r}return null}if(!e||typeof e!="object")return null;for(let[s,r]of Object.entries(e)){let i=Sn(s);if(i)return i;let n=Xh(s,t),o=Ls(r,n);if(o)return o}return null},Ne=(e,t=new Set)=>{if(!e||typeof e!="object")return null;if(Array.isArray(e)){for(let s of e){let r=Ne(s,t);if(r)return r}return null}if(e.type===v.LOOP){let s=qs(t,e.itemVar,e.indexVar);return Ne(e.body,s)}if(e.type===v.ARRAY&&Array.isArray(e.items))return Ne(e.items,t);if(e.type===v.OBJECT&&Array.isArray(e.properties)){for(let s of e.properties){let r=Sn(s.key);if(r)return r;let i=Ne(s.value,t);if(i)return i}return null}for(let s of Object.values(e)){let r=Ne(s,t);if(r)return r}return null},Qh=e=>Ss([{[e]:""}])?.items?.[0]?.properties?.[0]?.parsedKey,ef=e=>{let t=e.match(xn);return t?t[1].trim():null},tf=e=>{let t=e.match(/^([A-Za-z_][A-Za-z0-9_]*)/);return t?t[1]:null},sf=(e,t)=>{let s=!1,r=e.replace(Ts,(i,n,o,l,p)=>{if(!n.startsWith(":"))return i;let a=o??l??p??"",c=ef(a);if(!c||!Zh.test(c))return i;let d=tf(c);if(!d)return i;let h=t.has(d)?`#{${c}}`:c;return h===a?i:(s=!0,`${n}=${h}`)});return s?r:e},Re=(e,t=new Set)=>{if(!(!e||typeof e!="object")){if(Array.isArray(e)){e.forEach(s=>Re(s,t));return}if(e.type===v.LOOP){let s=qs(t,e.itemVar,e.indexVar);Re(e.body,s);return}if(e.type===v.ARRAY&&Array.isArray(e.items)){e.items.forEach(s=>Re(s,t));return}if(e.type===v.OBJECT&&Array.isArray(e.properties)){e.properties.forEach(s=>{let r=sf(s.key,t);if(r!==s.key){s.key=r;let i=Qh(r);i?s.parsedKey=i:delete s.parsedKey}Re(s.value,t)});return}Object.values(e).forEach(s=>{Re(s,t)})}},rf=e=>e?e.type&&typeof e.type=="number"?Ne(e):Ls(e):null,nf=e=>{if(!e||typeof e!="object"||ii.has(e))return;let t=rf(e);if(t)throw new Error(`Property-form bindings must use ':prop=\${value}' syntax. Found '${t.bindingName}=${t.rawValue}' in '${t.key}'.`);Re(e),ii.add(e)},of=/^[a-z][a-zA-Z0-9]*\*?$/,af=/^[a-zA-Z][a-zA-Z0-9_-]*\*?$/,lf=/^[a-z][a-zA-Z0-9]*$/,ni=new Set(["window","document"]),An=e=>Object.entries(e||{}).map(([t,s])=>{if(ni.has(t))return{refKey:t,refConfig:s,targetType:"global",isWildcard:!1,prefix:t};let r="id",i=t;t.startsWith(".")?(r="class",i=t.slice(1)):t.startsWith("#")&&(r="id",i=t.slice(1));let n=i.endsWith("*")?i.slice(0,-1):i;if(ni.has(n))throw new Error(`[Parser] Invalid ref key '${t}'. Reserved global keys must be exactly 'window' or 'document'.`);if(r==="id"&&!of.test(i))throw new Error(`[Parser] Invalid ref key '${t}'. Use camelCase IDs (optional '#', optional '*') or class refs with '.' prefix.`);if(r==="class"&&!af.test(i))throw new Error(`[Parser] Invalid ref key '${t}'. Class refs must start with '.' and use class-compatible names (optional '*').`);let o=i.endsWith("*"),l=o?i.slice(0,-1):i;return{refKey:t,refConfig:s,targetType:r,isWildcard:o,prefix:l}}),pf=e=>{if(!lf.test(e))throw new Error(`[Parser] Invalid element id '${e}' for refs. Use camelCase ids only. Kebab-case ids are not supported.`)},oi=({value:e,prefix:t,isWildcard:s})=>typeof e!="string"||e.length===0?!1:s?e.startsWith(t):e===t,kn=({elementIdForRefs:e,classNames:t=[],refMatchers:s})=>{let r=[],i=Array.isArray(t)?t:[];return s.forEach(n=>{if(n.targetType==="global")return;if(n.targetType==="id"){oi({value:e,prefix:n.prefix,isWildcard:n.isWildcard})&&r.push({...n,matchedValue:e});return}let o=i.find(l=>oi({value:l,prefix:n.prefix,isWildcard:n.isWildcard}));o&&r.push({...n,matchedValue:o})}),r.length===0?null:(r.sort((n,o)=>{let l=n.targetType==="id"?2:1,p=o.targetType==="id"?2:1;return l!==p?p-l:!n.isWildcard&&o.isWildcard?-1:n.isWildcard&&!o.isWildcard?1:o.prefix.length-n.prefix.length}),r[0])},Je=({optionName:e,optionValue:t,eventType:s,refKey:r})=>{if(t!==void 0&&typeof t!="boolean")throw new Error(`[Parser] Invalid '${e}' for event '${s}' on ref '${r}'. Expected boolean.`)},ai=({optionName:e,optionValue:t,eventType:s,refKey:r})=>{if(t!==void 0&&(typeof t!="number"||Number.isNaN(t)||!Number.isFinite(t)||t<0))throw new Error(`[Parser] Invalid '${e}' for event '${s}' on ref '${r}'. Expected non-negative number.`)},df=({eventType:e,eventConfig:t,refKey:s})=>{if(typeof t!="object"||t===null)throw new Error(`[Parser] Invalid event config for event '${e}' on ref '${s}'.`);let r=Object.prototype.hasOwnProperty.call(t,"debounce"),i=Object.prototype.hasOwnProperty.call(t,"throttle");if(Je({optionName:"preventDefault",optionValue:t.preventDefault,eventType:e,refKey:s}),Je({optionName:"stopPropagation",optionValue:t.stopPropagation,eventType:e,refKey:s}),Je({optionName:"stopImmediatePropagation",optionValue:t.stopImmediatePropagation,eventType:e,refKey:s}),Je({optionName:"targetOnly",optionValue:t.targetOnly,eventType:e,refKey:s}),Je({optionName:"once",optionValue:t.once,eventType:e,refKey:s}),ai({optionName:"debounce",optionValue:t.debounce,eventType:e,refKey:s}),ai({optionName:"throttle",optionValue:t.throttle,eventType:e,refKey:s}),r&&i)throw new Error(`[Parser] Event '${e}' on ref '${s}' cannot define both 'debounce' and 'throttle'.`);if(t.handler&&t.action)throw new Error("Each listener can have handler or action but not both");if(!t.handler&&!t.action)throw new Error("Each listener must define either handler or action");return{hasDebounce:r,hasThrottle:i}},En=e=>(e.__eventRateLimitState||Object.defineProperty(e,"__eventRateLimitState",{value:new Map,enumerable:!1,configurable:!0}),e.__eventRateLimitState),cf=({eventConfig:e,handlers:t,onMissingHandler:s,parseAndRenderFn:r})=>{let i=n=>{let o=e.payload&&typeof e.payload=="object"&&!Array.isArray(e.payload)?e.payload:{};return typeof r!="function"?o:r(o,{_event:n})};if(e.action){if(typeof t.handleCallStoreAction!="function")throw new Error(`[Runtime] Action listener '${e.action}' requires handlers.handleCallStoreAction.`);return n=>{let o=i(n);t.handleCallStoreAction({...o,_event:n,_action:e.action})}}return e.handler&&t[e.handler]?n=>{let o=i(n);t[e.handler]({...o,_event:n})}:(e.handler&&s?.(e.handler),null)},uf=({eventConfig:e,callback:t,hasDebounce:s,hasThrottle:r,stateKey:i,eventRateLimitState:n,fallbackCurrentTarget:o=null,nowFn:l=Date.now,setTimeoutFn:p=setTimeout,clearTimeoutFn:a=clearTimeout})=>c=>{let d=n.get(i)||{},h=c.currentTarget||o;if(e.once)if(h){if(d.onceTargets||(d.onceTargets=new WeakSet),d.onceTargets.has(h)){n.set(i,d);return}d.onceTargets.add(h)}else if(d.onceTriggered){n.set(i,d);return}else d.onceTriggered=!0;if(e.targetOnly&&c.target!==c.currentTarget){n.set(i,d);return}if(e.preventDefault&&c.preventDefault(),e.stopImmediatePropagation?c.stopImmediatePropagation():e.stopPropagation&&c.stopPropagation(),s){d.debounceTimer&&a(d.debounceTimer),d.debounceTimer=p(()=>{let f=d.debounceTimer;try{t(c)}catch(u){throw a(f),d.debounceTimer=null,u}d.debounceTimer=null},e.debounce),n.set(i,d);return}if(r){Object.prototype.hasOwnProperty.call(d,"lastThrottleAt")||(d.lastThrottleAt=void 0);let f=l();if(d.lastThrottleAt===void 0||f-d.lastThrottleAt>=e.throttle){d.lastThrottleAt=f,n.set(i,d),t(c);return}n.set(i,d);return}n.set(i,d),t(c)},$n=({eventType:e,eventConfig:t,refKey:s,handlers:r,eventRateLimitState:i,stateKey:n,fallbackCurrentTarget:o=null,parseAndRenderFn:l,onMissingHandler:p,nowFn:a=Date.now,setTimeoutFn:c=setTimeout,clearTimeoutFn:d=clearTimeout})=>{let{hasDebounce:h,hasThrottle:f}=df({eventType:e,eventConfig:t,refKey:s}),u=cf({eventConfig:t,handlers:r,onMissingHandler:p,parseAndRenderFn:l});return u?uf({eventConfig:t,callback:u,hasDebounce:h,hasThrottle:f,stateKey:n,eventRateLimitState:i,fallbackCurrentTarget:o,nowFn:a,setTimeoutFn:c,clearTimeoutFn:d}):null},hf=({h:e,template:t,viewData:s,refs:r,handlers:i,createComponentUpdateHook:n})=>{nf(t);let o=nn(t,s,{}),l=Os(o),p=ff({h:e,items:l,refs:r,handlers:i,viewData:s,createComponentUpdateHook:n});return e("div",{style:{display:"contents"}},p)},ff=({h:e,items:t,refs:s={},handlers:r={},viewData:i={},createComponentUpdateHook:n})=>{if(!Array.isArray(t))throw new Error("[Parser] Input to createVirtualDom must be an array, got "+typeof t);let o=An(s),l=o.some(a=>a.targetType==="id");function p(a,c=""){return a.map((d,h)=>{let f=c?`${c}.${h}`:String(h);if(typeof d=="string"||typeof d=="number")return String(d);if(typeof d!="object"||d===null)return console.warn("Skipping invalid item in DOM structure:",d),null;let u=Object.entries(d);if(u.length===0)return null;let[y,m]=u[0];if(!isNaN(Number(y)))return Array.isArray(m)?p(m,f):typeof m=="object"&&m!==null&&Object.entries(m).length>0?p([m],f):String(m);u.length>1&&console.warn("Item has multiple keys, processing only the first:",y);let b,g,_=y.indexOf(" ");_===-1?(b=y,g=""):(b=y.substring(0,_),g=y.substring(_+1).trim());let S=b.split(/[.#]/)[0],A=S.includes("-"),k,C;try{({attrs:k,props:C}=Gh({attrsString:g,viewData:i,tagName:S,isWebComponent:A}))}catch(H){throw new Error(`[Parser] Failed to parse bindings for selector '${b}' with attrs '${g}': ${H.message}`)}let I=b.match(/#([^.#\s]+)/);I&&!Object.prototype.hasOwnProperty.call(k,"id")&&(k.id=I[1]);let V=null;k.id&&(V=k.id);let z=(b.match(/\.([^.#]+)/g)||[]).map(H=>H.substring(1)),B=typeof k.class=="string"?k.class.split(/\s+/).filter(Boolean):[],J=[...new Set([...z,...B])],Z=Object.create(null),ge=null;if(!A){z.forEach(Oe=>{Z[Oe]=!0});let H=b.match(/#([^.#\s]+)/);H&&(ge=H[1])}let we;typeof m=="string"||typeof m=="number"?we=String(m):Array.isArray(m)?we=p(m,f):we=[],ge&&!A&&(k.id=ge);let Vt=Object.create(null);if(o.length>0){l&&V&&pf(V);let H=kn({elementIdForRefs:V,classNames:J,refMatchers:o});if(H){let Oe=H.refKey,Js=H.matchedValue||V||Oe;if(H.refConfig&&H.refConfig.eventListeners){let Ln=H.refConfig.eventListeners,Vn=En(r);Object.entries(Ln).forEach(([Nt,Nn])=>{let Rn=`${Oe}:${Js}:${Nt}`,Zs=$n({eventType:Nt,eventConfig:Nn,refKey:Oe,handlers:r,eventRateLimitState:Vn,stateKey:Rn,parseAndRenderFn:fn,onMissingHandler:jn=>{console.warn(`[Parser] Handler '${jn}' for refKey '${Oe}' (matching '${Js}') is referenced but not found in available handlers.`)}});Zs&&(Vt[Nt]=Zs)})}}}let be={};if(V?be.key=V:b&&(be.key=`${b}-${f}`),Object.keys(k).length>0&&(be.attrs=k),Object.keys(Z).length>0&&(be.class=Z),Object.keys(Vt).length>0&&(be.on=Vt),Object.keys(C).length>0&&(be.props=C),A&&typeof n=="function"){let H=n({selector:b,tagName:S});H&&(be.hook=H)}try{return e(S,be,we)}catch(H){throw new Error(`[Parser] Error creating virtual node for '${S}': ${H.message}`)}}).filter(Boolean)}return p(t)},yf=({baseDeps:e,refs:t,dispatchEvent:s,store:r,render:i})=>({...e,refs:t,dispatchEvent:s,store:r,render:i}),mf=({store:e,render:t,parseAndRenderFn:s})=>r=>{let{_event:i,_action:n}=r,o=s(r,{_event:i});if(!e[n])throw new Error(`[Store] Action 'store.${n}' is not defined.`);e[n](o),t()},gf=({handlers:e,deps:t,parseAndRenderFn:s})=>{let r={handleCallStoreAction:mf({store:t.store,render:t.render,parseAndRenderFn:s})};return Object.keys(e||{}).forEach(i=>{r[i]=n=>e[i](t,n)}),r},bf=e=>{if(e&&typeof e.then=="function")throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");return e},vf=({handlers:e,deps:t})=>{if(!e?.handleBeforeMount)return;let s=e.handleBeforeMount(t);return bf(s)},wf=({handlers:e,deps:t})=>{e?.handleAfterMount&&e.handleAfterMount(t)},_f=({attributeName:e,oldValue:t,newValue:s,deps:r,propsSchemaKeys:i,toCamelCase:n,normalizeAttributeValue:o})=>{let l=n(e),p={};i.forEach(h=>{let f=r.props[h];f!==void 0&&(p[h]=f)});let a={...p},c=o(t),d=o(s);return c===void 0?delete a[l]:a[l]=c,d===void 0?delete p[l]:p[l]=d,{changedProp:l,oldProps:a,newProps:p}},xf=({propName:e,oldValue:t,newValue:s,deps:r,propsSchemaKeys:i})=>{let n={};i.forEach(l=>{let p=r.props[l];p!==void 0&&(n[l]=p)});let o={...n};return t===void 0?delete o[e]:o[e]=t,s===void 0?delete n[e]:n[e]=s,{changedProp:e,oldProps:o,newProps:n}},Sf=({refKey:e,targets:t})=>e==="window"?t.window:e==="document"?t.document:null,Af=({refs:e={},handlers:t={},targets:s={window:globalThis.window,document:globalThis.document},parseAndRenderFn:r,timing:i={nowFn:Date.now,setTimeoutFn:setTimeout,clearTimeoutFn:clearTimeout},warnFn:n=console.warn})=>{let o=[],l=new Set,p=En(t);return Object.entries(e).forEach(([a,c])=>{if(a!=="window"&&a!=="document")return;let d=Sf({refKey:a,targets:s});!d||!c?.eventListeners||Object.entries(c.eventListeners).forEach(([h,f])=>{let u=`${a}:${h}`;l.add(u);let y=$n({eventType:h,eventConfig:f,refKey:a,handlers:t,eventRateLimitState:p,stateKey:u,fallbackCurrentTarget:d,parseAndRenderFn:r,nowFn:i.nowFn,setTimeoutFn:i.setTimeoutFn,clearTimeoutFn:i.clearTimeoutFn,onMissingHandler:m=>{n(`[Runtime] Handler '${m}' for global ref '${a}' is referenced but not found in available handlers.`)}});y&&(d.addEventListener(h,y),o.push(()=>{d.removeEventListener(h,y)}))})}),()=>{o.forEach(a=>a()),l.forEach(a=>{let c=p.get(a);c&&c.debounceTimer&&i.clearTimeoutFn(c.debounceTimer),p.delete(a)})}},kf=e=>An(e),Ef=e=>{let t=[],s=e?.data?.class;s&&typeof s=="object"&&Object.entries(s).forEach(([i,n])=>{n&&t.push(i)});let r=e?.data?.attrs?.class;return typeof r=="string"&&r.split(/\s+/).filter(Boolean).forEach(i=>t.push(i)),[...new Set(t)]},$f=({rootVNode:e,refs:t})=>{let s={},r=kf(t),i=n=>{if(!n||typeof n!="object")return;let o=n?.data?.attrs?.id,l=Ef(n),p=kn({elementIdForRefs:o,classNames:l,refMatchers:r});if(n.elm&&p){let a=o||p.refKey;s[a]=n.elm}Array.isArray(n.children)&&n.children.forEach(i)};return i(e),s},Cf=({propsSchemaKeys:e=[],toKebabCase:t})=>{let s=new Set(["key"]);return e.forEach(r=>{s.add(r),s.add(t(r))}),[...s]},If=({baseDeps:e,refs:t,dispatchEvent:s,store:r,render:i})=>yf({baseDeps:e,refs:t,dispatchEvent:s,store:r,render:i}),Of=({refIds:e,nextRefIds:t={}})=>(Object.keys(e).forEach(s=>{delete e[s]}),Object.assign(e,t),e),Tf=({transformedHandlers:e,clearTimerFn:t=clearTimeout})=>{let s=e?.__eventRateLimitState;if(!(s instanceof Map))return 0;let r=0;return s.forEach(i=>{i&&i.debounceTimer&&(t(i.debounceTimer),r+=1)}),s.clear(),r},Ys=({instance:e})=>If({baseDeps:e.deps,refs:e.refIds,dispatchEvent:e.dispatchEvent.bind(e),store:e.store,render:e.render.bind(e)}),Lf=({instance:e,parseAndRenderFn:t,renderFn:s,createTransformedHandlersFn:r=gf,runBeforeMountFn:i=vf,attachGlobalRefListenersFn:n=Af,runAfterMountFn:o=wf})=>{let l=Ys({instance:e});return e.transformedHandlers=r({handlers:e.handlers,deps:l,parseAndRenderFn:t}),e._unmountCallback=i({handlers:e.handlers,deps:l}),e._globalListenersCleanup=n({refs:e.refs,handlers:e.transformedHandlers,parseAndRenderFn:t}),s(),o({handlers:e.handlers,deps:l}),l},Vf=({instance:e,clearTimerFn:t=clearTimeout})=>(e._unmountCallback&&e._unmountCallback(),e._globalListenersCleanup&&e._globalListenersCleanup(),Tf({transformedHandlers:e.transformedHandlers,clearTimerFn:t})),Nf=({instance:e,attributeName:t,oldValue:s,newValue:r,scheduleFrameFn:i})=>{if(!(s===r||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=Ys({instance:e}),o=_f({attributeName:t,oldValue:s,newValue:r,deps:n,propsSchemaKeys:e._propsSchemaKeys,toCamelCase:sn,normalizeAttributeValue:_s});e.handlers.handleOnUpdate(n,o);return}i(()=>{e.render()})}},Rf=({instance:e,propName:t,oldValue:s,newValue:r,scheduleFrameFn:i})=>{if(!(s===r||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=Ys({instance:e}),o=xf({propName:t,oldValue:s,newValue:r,deps:n,propsSchemaKeys:e._propsSchemaKeys});e.handlers.handleOnUpdate(n,o);return}i(()=>{e.render()})}},jf=({instance:e,createComponentUpdateHookFn:t,parseViewFn:s=hf,collectRefElementsFn:r=$f,onError:i=n=>{console.error("Error during render:",n)}})=>{if(!e.patch)return console.error("Patch function is not defined!"),null;if(!e.template)return console.error("Template is not defined!"),null;try{let n=s({h:e._snabbdomH,template:e.template,viewData:e.viewData,refs:e.refs,handlers:e.transformedHandlers,createComponentUpdateHook:t});e._oldVNode?e._oldVNode=e.patch(e._oldVNode,n):e._oldVNode=e.patch(e.renderTarget,n);let o=r({rootVNode:e._oldVNode,refs:e.refs});return Of({refIds:e.refIds,nextRefIds:o}),e._oldVNode}catch(n){return i(n),e._oldVNode||null}},Df=`
|
|
1520
|
+
`:"")+l)}),s},Os=e=>Array.isArray(e)?e.reduce((t,s)=>{if(Array.isArray(s))t.push(...Os(s));else{if(s&&typeof s=="object"){let r=Object.entries(s);if(r.length>0){let[i,n]=r[0];Array.isArray(n)&&(s={[i]:Os(n)})}}t.push(s)}return t},[]):e,hs=":",qh=new Set(["__proto__","constructor","prototype"]),Yh=/^[A-Za-z_][A-Za-z0-9_.:-]*$/,si=e=>Yh.test(e),ri=(e,t)=>{if(!t)return e;let s=[],r="",i=!1;for(let n=0;n<t.length;n++){let o=t[n];if(!i&&o===".")r&&(s.push(r),r="");else if(!i&&o==="[")r&&(s.push(r),r=""),i=!0;else if(i&&o==="]"){if(r){if(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))s.push(r.slice(1,-1));else{let l=Number(r);s.push(Number.isNaN(l)?r:l)}r=""}i=!1}else r+=o}return r&&s.push(r),s.reduce((n,o)=>{if(n==null)return;let l=typeof o=="number"?o:String(o);if(!(typeof l=="string"&&qh.has(l)))return n[l]},e)},Gh=e=>e.replace(/-([a-z0-9])/g,(t,s)=>s.toUpperCase()),Jh=({attrsString:e="",viewData:t={},tagName:s,isWebComponent:r})=>{let i={},n={},o=g=>{if(g==="role"||g.startsWith("aria-")||g.startsWith("data-"))throw new Error(`[Parser] Invalid boolean attribute '?${g}'. Use normal binding for value-carrying attributes such as aria-*, data-*, and role.`)},l=(g,_,S)=>{let A=Gh(g);if(!A)throw new Error(`[Parser] Invalid ${S} prop name on '${s}'.`);if(Object.prototype.hasOwnProperty.call(n,A))throw new Error(`[Parser] Duplicate prop binding '${A}' on '${s}'. Use only one of 'name=value' or ':name=\${expr}'.`);n[A]=_},p=(g,_)=>{if(!si(g))throw new Error(`[Parser] Invalid ${_} attribute name '${g}' on '${s}'.`)};if(!e)return{attrs:i,props:n};let a=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,c,d=new Set;for(;(c=a.exec(e))!==null;){let g=c[1],_=c[2]??c[3]??c[4]??"";if(d.add(g),g.startsWith(".")){i[g]=_;continue}if(g.startsWith(hs)){let S=g.substring(1),A=_;if(c[4]!==void 0&&c[4]!==""){let k=c[4],C=ri(t,k);C!==void 0&&(A=C)}l(S,A,"property-form");continue}if(g.startsWith("?")){let S=g.substring(1);p(S,"boolean toggle");let A=_;o(S);let k;A==="true"?k=!0:A==="false"||A===""?k=!1:k=ri(t,A),k&&(i[S]=""),r&&S!=="id"&&l(S,!!k,"boolean attribute-form");continue}p(g,"binding"),i[g]=_,r&&g!=="id"&&l(g,_,"attribute-form")}let h=e,f=[],u,y=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g;for(;(u=y.exec(e))!==null;)f.push(u[0]);f.forEach(g=>{h=h.replace(g," ")});let m=/(\S+?)(?=\s|$)/g,b;for(;(b=m.exec(h))!==null;){let g=b[1];if(!g.startsWith(".")&&!(d.has(g)||g.startsWith(hs)||g.includes("="))){if(g.startsWith("?")){let _=g.substring(1);p(_,"boolean toggle"),o(_),i[_]="",r&&_!=="id"&&l(_,!0,"boolean attribute-form");continue}if(!si(g))throw new Error(`[Parser] Invalid attribute token '${g}' on '${s}'.`);!d.has(g)&&!g.startsWith(hs)&&!g.includes("=")&&(i[g]="",r&&g!=="id"&&l(g,!0,"boolean attribute-form"))}}return{attrs:i,props:n}},Ts=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,Zh=/^\$for\s+([A-Za-z_][A-Za-z0-9_]*)(?:\s*,\s*([A-Za-z_][A-Za-z0-9_]*))?\s+in\s+.+$/,xn=/^\$\{([^{}]+)\}$/,Xh=/^[A-Za-z_][A-Za-z0-9_]*(?:(?:\.[A-Za-z_][A-Za-z0-9_]*)|\[(?:\d+|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')\])*$/,ii=new WeakSet,qs=(e,t,s)=>{let r=new Set(e);return t&&r.add(t),s&&r.add(s),r},Qh=(e,t)=>{if(typeof e!="string")return t;let s=e.match(Zh);return s?qs(t,s[1],s[2]):t},Sn=e=>{if(typeof e!="string"||!e.includes(":")&&!e.includes("."))return null;Ts.lastIndex=0;let t;for(;(t=Ts.exec(e))!==null;){let s=t[1];if(s.startsWith("."))return{bindingName:s,rawValue:t[2]??t[3]??t[4]??"",key:e};if(!s.startsWith(":"))continue;let r=t[2]!==void 0||t[3]!==void 0,i=t[2]??t[3]??t[4]??"";if(r||!xn.test(i))return{bindingName:s,rawValue:i,key:e}}return null},Ls=(e,t=new Set)=>{if(Array.isArray(e)){for(let s of e){let r=Ls(s,t);if(r)return r}return null}if(!e||typeof e!="object")return null;for(let[s,r]of Object.entries(e)){let i=Sn(s);if(i)return i;let n=Qh(s,t),o=Ls(r,n);if(o)return o}return null},Ne=(e,t=new Set)=>{if(!e||typeof e!="object")return null;if(Array.isArray(e)){for(let s of e){let r=Ne(s,t);if(r)return r}return null}if(e.type===v.LOOP){let s=qs(t,e.itemVar,e.indexVar);return Ne(e.body,s)}if(e.type===v.ARRAY&&Array.isArray(e.items))return Ne(e.items,t);if(e.type===v.OBJECT&&Array.isArray(e.properties)){for(let s of e.properties){let r=Sn(s.key);if(r)return r;let i=Ne(s.value,t);if(i)return i}return null}for(let s of Object.values(e)){let r=Ne(s,t);if(r)return r}return null},ef=e=>Ss([{[e]:""}])?.items?.[0]?.properties?.[0]?.parsedKey,tf=e=>{let t=e.match(xn);return t?t[1].trim():null},sf=e=>{let t=e.match(/^([A-Za-z_][A-Za-z0-9_]*)/);return t?t[1]:null},rf=(e,t)=>{let s=!1,r=e.replace(Ts,(i,n,o,l,p)=>{if(!n.startsWith(":"))return i;let a=o??l??p??"",c=tf(a);if(!c||!Xh.test(c))return i;let d=sf(c);if(!d)return i;let h=t.has(d)?`#{${c}}`:c;return h===a?i:(s=!0,`${n}=${h}`)});return s?r:e},Re=(e,t=new Set)=>{if(!(!e||typeof e!="object")){if(Array.isArray(e)){e.forEach(s=>Re(s,t));return}if(e.type===v.LOOP){let s=qs(t,e.itemVar,e.indexVar);Re(e.body,s);return}if(e.type===v.ARRAY&&Array.isArray(e.items)){e.items.forEach(s=>Re(s,t));return}if(e.type===v.OBJECT&&Array.isArray(e.properties)){e.properties.forEach(s=>{let r=rf(s.key,t);if(r!==s.key){s.key=r;let i=ef(r);i?s.parsedKey=i:delete s.parsedKey}Re(s.value,t)});return}Object.values(e).forEach(s=>{Re(s,t)})}},nf=e=>e?e.type&&typeof e.type=="number"?Ne(e):Ls(e):null,of=e=>{if(!e||typeof e!="object"||ii.has(e))return;let t=nf(e);if(t)throw new Error(`Property-form bindings must use ':prop=\${value}' syntax. Found '${t.bindingName}=${t.rawValue}' in '${t.key}'.`);Re(e),ii.add(e)},af=/^[a-z][a-zA-Z0-9]*\*?$/,lf=/^[a-zA-Z][a-zA-Z0-9_-]*\*?$/,pf=/^[a-z][a-zA-Z0-9]*$/,ni=new Set(["window","document"]),An=e=>Object.entries(e||{}).map(([t,s])=>{if(ni.has(t))return{refKey:t,refConfig:s,targetType:"global",isWildcard:!1,prefix:t};let r="id",i=t;t.startsWith(".")?(r="class",i=t.slice(1)):t.startsWith("#")&&(r="id",i=t.slice(1));let n=i.endsWith("*")?i.slice(0,-1):i;if(ni.has(n))throw new Error(`[Parser] Invalid ref key '${t}'. Reserved global keys must be exactly 'window' or 'document'.`);if(r==="id"&&!af.test(i))throw new Error(`[Parser] Invalid ref key '${t}'. Use camelCase IDs (optional '#', optional '*') or class refs with '.' prefix.`);if(r==="class"&&!lf.test(i))throw new Error(`[Parser] Invalid ref key '${t}'. Class refs must start with '.' and use class-compatible names (optional '*').`);let o=i.endsWith("*"),l=o?i.slice(0,-1):i;return{refKey:t,refConfig:s,targetType:r,isWildcard:o,prefix:l}}),df=e=>{if(!pf.test(e))throw new Error(`[Parser] Invalid element id '${e}' for refs. Use camelCase ids only. Kebab-case ids are not supported.`)},oi=({value:e,prefix:t,isWildcard:s})=>typeof e!="string"||e.length===0?!1:s?e.startsWith(t):e===t,kn=({elementIdForRefs:e,classNames:t=[],refMatchers:s})=>{let r=[],i=Array.isArray(t)?t:[];return s.forEach(n=>{if(n.targetType==="global")return;if(n.targetType==="id"){oi({value:e,prefix:n.prefix,isWildcard:n.isWildcard})&&r.push({...n,matchedValue:e});return}let o=i.find(l=>oi({value:l,prefix:n.prefix,isWildcard:n.isWildcard}));o&&r.push({...n,matchedValue:o})}),r.length===0?null:(r.sort((n,o)=>{let l=n.targetType==="id"?2:1,p=o.targetType==="id"?2:1;return l!==p?p-l:!n.isWildcard&&o.isWildcard?-1:n.isWildcard&&!o.isWildcard?1:o.prefix.length-n.prefix.length}),r[0])},Je=({optionName:e,optionValue:t,eventType:s,refKey:r})=>{if(t!==void 0&&typeof t!="boolean")throw new Error(`[Parser] Invalid '${e}' for event '${s}' on ref '${r}'. Expected boolean.`)},ai=({optionName:e,optionValue:t,eventType:s,refKey:r})=>{if(t!==void 0&&(typeof t!="number"||Number.isNaN(t)||!Number.isFinite(t)||t<0))throw new Error(`[Parser] Invalid '${e}' for event '${s}' on ref '${r}'. Expected non-negative number.`)},cf=({eventType:e,eventConfig:t,refKey:s})=>{if(typeof t!="object"||t===null)throw new Error(`[Parser] Invalid event config for event '${e}' on ref '${s}'.`);let r=Object.prototype.hasOwnProperty.call(t,"debounce"),i=Object.prototype.hasOwnProperty.call(t,"throttle");if(Je({optionName:"preventDefault",optionValue:t.preventDefault,eventType:e,refKey:s}),Je({optionName:"stopPropagation",optionValue:t.stopPropagation,eventType:e,refKey:s}),Je({optionName:"stopImmediatePropagation",optionValue:t.stopImmediatePropagation,eventType:e,refKey:s}),Je({optionName:"targetOnly",optionValue:t.targetOnly,eventType:e,refKey:s}),Je({optionName:"once",optionValue:t.once,eventType:e,refKey:s}),ai({optionName:"debounce",optionValue:t.debounce,eventType:e,refKey:s}),ai({optionName:"throttle",optionValue:t.throttle,eventType:e,refKey:s}),r&&i)throw new Error(`[Parser] Event '${e}' on ref '${s}' cannot define both 'debounce' and 'throttle'.`);if(t.handler&&t.action)throw new Error("Each listener can have handler or action but not both");if(!t.handler&&!t.action)throw new Error("Each listener must define either handler or action");return{hasDebounce:r,hasThrottle:i}},En=e=>(e.__eventRateLimitState||Object.defineProperty(e,"__eventRateLimitState",{value:new Map,enumerable:!1,configurable:!0}),e.__eventRateLimitState),uf=({eventConfig:e,handlers:t,onMissingHandler:s,parseAndRenderFn:r})=>{let i=n=>{let o=e.payload&&typeof e.payload=="object"&&!Array.isArray(e.payload)?e.payload:{};return typeof r!="function"?o:r(o,{_event:n})};if(e.action){if(typeof t.handleCallStoreAction!="function")throw new Error(`[Runtime] Action listener '${e.action}' requires handlers.handleCallStoreAction.`);return n=>{let o=i(n);t.handleCallStoreAction({...o,_event:n,_action:e.action})}}return e.handler&&t[e.handler]?n=>{let o=i(n);t[e.handler]({...o,_event:n})}:(e.handler&&s?.(e.handler),null)},hf=({eventConfig:e,callback:t,hasDebounce:s,hasThrottle:r,stateKey:i,eventRateLimitState:n,fallbackCurrentTarget:o=null,nowFn:l=Date.now,setTimeoutFn:p=setTimeout,clearTimeoutFn:a=clearTimeout})=>c=>{let d=n.get(i)||{},h=c.currentTarget||o;if(e.once)if(h){if(d.onceTargets||(d.onceTargets=new WeakSet),d.onceTargets.has(h)){n.set(i,d);return}d.onceTargets.add(h)}else if(d.onceTriggered){n.set(i,d);return}else d.onceTriggered=!0;if(e.targetOnly&&c.target!==c.currentTarget){n.set(i,d);return}if(e.preventDefault&&c.preventDefault(),e.stopImmediatePropagation?c.stopImmediatePropagation():e.stopPropagation&&c.stopPropagation(),s){d.debounceTimer&&a(d.debounceTimer),d.debounceTimer=p(()=>{let f=d.debounceTimer;try{t(c)}catch(u){throw a(f),d.debounceTimer=null,u}d.debounceTimer=null},e.debounce),n.set(i,d);return}if(r){Object.prototype.hasOwnProperty.call(d,"lastThrottleAt")||(d.lastThrottleAt=void 0);let f=l();if(d.lastThrottleAt===void 0||f-d.lastThrottleAt>=e.throttle){d.lastThrottleAt=f,n.set(i,d),t(c);return}n.set(i,d);return}n.set(i,d),t(c)},$n=({eventType:e,eventConfig:t,refKey:s,handlers:r,eventRateLimitState:i,stateKey:n,fallbackCurrentTarget:o=null,parseAndRenderFn:l,onMissingHandler:p,nowFn:a=Date.now,setTimeoutFn:c=setTimeout,clearTimeoutFn:d=clearTimeout})=>{let{hasDebounce:h,hasThrottle:f}=cf({eventType:e,eventConfig:t,refKey:s}),u=uf({eventConfig:t,handlers:r,onMissingHandler:p,parseAndRenderFn:l});return u?hf({eventConfig:t,callback:u,hasDebounce:h,hasThrottle:f,stateKey:n,eventRateLimitState:i,fallbackCurrentTarget:o,nowFn:a,setTimeoutFn:c,clearTimeoutFn:d}):null},ff=({h:e,template:t,viewData:s,refs:r,handlers:i,createComponentUpdateHook:n})=>{of(t);let o=nn(t,s,{}),l=Os(o),p=yf({h:e,items:l,refs:r,handlers:i,viewData:s,createComponentUpdateHook:n});return e("div",{style:{display:"contents"}},p)},yf=({h:e,items:t,refs:s={},handlers:r={},viewData:i={},createComponentUpdateHook:n})=>{if(!Array.isArray(t))throw new Error("[Parser] Input to createVirtualDom must be an array, got "+typeof t);let o=An(s),l=o.some(a=>a.targetType==="id");function p(a,c=""){return a.map((d,h)=>{let f=c?`${c}.${h}`:String(h);if(typeof d=="string"||typeof d=="number")return String(d);if(typeof d!="object"||d===null)return console.warn("Skipping invalid item in DOM structure:",d),null;let u=Object.entries(d);if(u.length===0)return null;let[y,m]=u[0];if(!isNaN(Number(y)))return Array.isArray(m)?p(m,f):typeof m=="object"&&m!==null&&Object.entries(m).length>0?p([m],f):String(m);u.length>1&&console.warn("Item has multiple keys, processing only the first:",y);let b,g,_=y.indexOf(" ");_===-1?(b=y,g=""):(b=y.substring(0,_),g=y.substring(_+1).trim());let S=b.split(/[.#]/)[0],A=S.includes("-"),k,C;try{({attrs:k,props:C}=Jh({attrsString:g,viewData:i,tagName:S,isWebComponent:A}))}catch(H){throw new Error(`[Parser] Failed to parse bindings for selector '${b}' with attrs '${g}': ${H.message}`)}let I=b.match(/#([^.#\s]+)/);I&&!Object.prototype.hasOwnProperty.call(k,"id")&&(k.id=I[1]);let V=null;k.id&&(V=k.id);let z=(b.match(/\.([^.#]+)/g)||[]).map(H=>H.substring(1)),B=typeof k.class=="string"?k.class.split(/\s+/).filter(Boolean):[],J=[...new Set([...z,...B])],Z=Object.create(null),ge=null;if(!A){z.forEach(Oe=>{Z[Oe]=!0});let H=b.match(/#([^.#\s]+)/);H&&(ge=H[1])}let we;typeof m=="string"||typeof m=="number"?we=String(m):Array.isArray(m)?we=p(m,f):we=[],ge&&!A&&(k.id=ge);let Vt=Object.create(null);if(o.length>0){l&&V&&df(V);let H=kn({elementIdForRefs:V,classNames:J,refMatchers:o});if(H){let Oe=H.refKey,Js=H.matchedValue||V||Oe;if(H.refConfig&&H.refConfig.eventListeners){let Ln=H.refConfig.eventListeners,Vn=En(r);Object.entries(Ln).forEach(([Nt,Nn])=>{let Rn=`${Oe}:${Js}:${Nt}`,Zs=$n({eventType:Nt,eventConfig:Nn,refKey:Oe,handlers:r,eventRateLimitState:Vn,stateKey:Rn,parseAndRenderFn:fn,onMissingHandler:jn=>{console.warn(`[Parser] Handler '${jn}' for refKey '${Oe}' (matching '${Js}') is referenced but not found in available handlers.`)}});Zs&&(Vt[Nt]=Zs)})}}}let be={};if(V?be.key=V:b&&(be.key=`${b}-${f}`),Object.keys(k).length>0&&(be.attrs=k),Object.keys(Z).length>0&&(be.class=Z),Object.keys(Vt).length>0&&(be.on=Vt),Object.keys(C).length>0&&(be.props=C),A&&typeof n=="function"){let H=n({selector:b,tagName:S});H&&(be.hook=H)}try{return e(S,be,we)}catch(H){throw new Error(`[Parser] Error creating virtual node for '${S}': ${H.message}`)}}).filter(Boolean)}return p(t)},mf=({baseDeps:e,refs:t,dispatchEvent:s,store:r,render:i})=>({...e,refs:t,dispatchEvent:s,store:r,render:i}),gf=({store:e,render:t,parseAndRenderFn:s})=>r=>{let{_event:i,_action:n}=r,o=s(r,{_event:i});if(!e[n])throw new Error(`[Store] Action 'store.${n}' is not defined.`);e[n](o),t()},bf=({handlers:e,deps:t,parseAndRenderFn:s})=>{let r={handleCallStoreAction:gf({store:t.store,render:t.render,parseAndRenderFn:s})};return Object.keys(e||{}).forEach(i=>{r[i]=n=>e[i](t,n)}),r},vf=e=>{if(e&&typeof e.then=="function")throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");return e},wf=({handlers:e,deps:t})=>{if(!e?.handleBeforeMount)return;let s=e.handleBeforeMount(t);return vf(s)},_f=({handlers:e,deps:t})=>{e?.handleAfterMount&&e.handleAfterMount(t)},xf=({attributeName:e,oldValue:t,newValue:s,deps:r,propsSchemaKeys:i,toCamelCase:n,normalizeAttributeValue:o})=>{let l=n(e),p={};i.forEach(h=>{let f=r.props[h];f!==void 0&&(p[h]=f)});let a={...p},c=o(t),d=o(s);return c===void 0?delete a[l]:a[l]=c,d===void 0?delete p[l]:p[l]=d,{changedProp:l,oldProps:a,newProps:p}},Sf=({propName:e,oldValue:t,newValue:s,deps:r,propsSchemaKeys:i})=>{let n={};i.forEach(l=>{let p=r.props[l];p!==void 0&&(n[l]=p)});let o={...n};return t===void 0?delete o[e]:o[e]=t,s===void 0?delete n[e]:n[e]=s,{changedProp:e,oldProps:o,newProps:n}},Af=({refKey:e,targets:t})=>e==="window"?t.window:e==="document"?t.document:null,kf=({refs:e={},handlers:t={},targets:s={window:globalThis.window,document:globalThis.document},parseAndRenderFn:r,timing:i={nowFn:Date.now,setTimeoutFn:setTimeout,clearTimeoutFn:clearTimeout},warnFn:n=console.warn})=>{let o=[],l=new Set,p=En(t);return Object.entries(e).forEach(([a,c])=>{if(a!=="window"&&a!=="document")return;let d=Af({refKey:a,targets:s});!d||!c?.eventListeners||Object.entries(c.eventListeners).forEach(([h,f])=>{let u=`${a}:${h}`;l.add(u);let y=$n({eventType:h,eventConfig:f,refKey:a,handlers:t,eventRateLimitState:p,stateKey:u,fallbackCurrentTarget:d,parseAndRenderFn:r,nowFn:i.nowFn,setTimeoutFn:i.setTimeoutFn,clearTimeoutFn:i.clearTimeoutFn,onMissingHandler:m=>{n(`[Runtime] Handler '${m}' for global ref '${a}' is referenced but not found in available handlers.`)}});y&&(d.addEventListener(h,y),o.push(()=>{d.removeEventListener(h,y)}))})}),()=>{o.forEach(a=>a()),l.forEach(a=>{let c=p.get(a);c&&c.debounceTimer&&i.clearTimeoutFn(c.debounceTimer),p.delete(a)})}},Ef=e=>An(e),$f=e=>{let t=[],s=e?.data?.class;s&&typeof s=="object"&&Object.entries(s).forEach(([i,n])=>{n&&t.push(i)});let r=e?.data?.attrs?.class;return typeof r=="string"&&r.split(/\s+/).filter(Boolean).forEach(i=>t.push(i)),[...new Set(t)]},Cf=({rootVNode:e,refs:t})=>{let s={},r=Ef(t),i=n=>{if(!n||typeof n!="object")return;let o=n?.data?.attrs?.id,l=$f(n),p=kn({elementIdForRefs:o,classNames:l,refMatchers:r});if(n.elm&&p){let a=o||p.refKey;s[a]=n.elm}Array.isArray(n.children)&&n.children.forEach(i)};return i(e),s},If=({propsSchemaKeys:e=[],toKebabCase:t})=>{let s=new Set(["key"]);return e.forEach(r=>{s.add(r),s.add(t(r))}),[...s]},Of=({baseDeps:e,refs:t,dispatchEvent:s,store:r,render:i})=>mf({baseDeps:e,refs:t,dispatchEvent:s,store:r,render:i}),Tf=({refIds:e,nextRefIds:t={}})=>(Object.keys(e).forEach(s=>{delete e[s]}),Object.assign(e,t),e),Lf=({transformedHandlers:e,clearTimerFn:t=clearTimeout})=>{let s=e?.__eventRateLimitState;if(!(s instanceof Map))return 0;let r=0;return s.forEach(i=>{i&&i.debounceTimer&&(t(i.debounceTimer),r+=1)}),s.clear(),r},Ys=({instance:e})=>Of({baseDeps:e.deps,refs:e.refIds,dispatchEvent:e.dispatchEvent.bind(e),store:e.store,render:e.render.bind(e)}),Vf=({instance:e,parseAndRenderFn:t,renderFn:s,createTransformedHandlersFn:r=bf,runBeforeMountFn:i=wf,attachGlobalRefListenersFn:n=kf,runAfterMountFn:o=_f})=>{let l=Ys({instance:e});return e.transformedHandlers=r({handlers:e.handlers,deps:l,parseAndRenderFn:t}),e._unmountCallback=i({handlers:e.handlers,deps:l}),e._globalListenersCleanup=n({refs:e.refs,handlers:e.transformedHandlers,parseAndRenderFn:t}),s(),o({handlers:e.handlers,deps:l}),l},Nf=({instance:e,clearTimerFn:t=clearTimeout})=>(e._unmountCallback&&e._unmountCallback(),e._globalListenersCleanup&&e._globalListenersCleanup(),Lf({transformedHandlers:e.transformedHandlers,clearTimerFn:t})),Rf=({instance:e,attributeName:t,oldValue:s,newValue:r,scheduleFrameFn:i})=>{if(!(s===r||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=Ys({instance:e}),o=xf({attributeName:t,oldValue:s,newValue:r,deps:n,propsSchemaKeys:e._propsSchemaKeys,toCamelCase:sn,normalizeAttributeValue:_s});e.handlers.handleOnUpdate(n,o);return}i(()=>{e.render()})}},jf=({instance:e,propName:t,oldValue:s,newValue:r,scheduleFrameFn:i})=>{if(!(s===r||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=Ys({instance:e}),o=Sf({propName:t,oldValue:s,newValue:r,deps:n,propsSchemaKeys:e._propsSchemaKeys});e.handlers.handleOnUpdate(n,o);return}i(()=>{e.render()})}},Df=({instance:e,createComponentUpdateHookFn:t,parseViewFn:s=ff,collectRefElementsFn:r=Cf,onError:i=n=>{console.error("Error during render:",n)}})=>{if(!e.patch)return console.error("Patch function is not defined!"),null;if(!e.template)return console.error("Template is not defined!"),null;try{let n=s({h:e._snabbdomH,template:e.template,viewData:e.viewData,refs:e.refs,handlers:e.transformedHandlers,createComponentUpdateHook:t});e._oldVNode?e._oldVNode=e.patch(e._oldVNode,n):e._oldVNode=e.patch(e.renderTarget,n);let o=r({rootVNode:e._oldVNode,refs:e.refs});return Tf({refIds:e.refIds,nextRefIds:o}),e._oldVNode}catch(n){return i(n),e._oldVNode||null}},Pf=`
|
|
1521
1521
|
a, a:link, a:visited, a:hover, a:active {
|
|
1522
1522
|
display: contents;
|
|
1523
1523
|
color: inherit;
|
|
@@ -1529,4 +1529,4 @@ ${l}
|
|
|
1529
1529
|
font: inherit;
|
|
1530
1530
|
cursor: pointer;
|
|
1531
1531
|
}
|
|
1532
|
-
`,Gs="data-rtgl-render-target",Cn="__rtglRenderTarget",Vs=e=>!e||typeof e!="object"?!1:typeof e.getAttribute=="function"?e.getAttribute(Gs)!==null:e[Cn]===!0,li=e=>{!e||typeof e!="object"||(typeof e.setAttribute=="function"?e.setAttribute(Gs,""):e[Cn]=!0)},Pf=e=>{if(!(!e||typeof e!="object"))return typeof e.querySelector=="function"?e.querySelector(`[${Gs}]`)??e.firstElementChild:Array.isArray(e.childNodes)?e.childNodes.find(Vs)??e.childNodes[0]:Array.isArray(e.children)?e.children.find(Vs)??e.children[0]:e.firstElementChild},Bf=({host:e,cssText:t,createStyleSheet:s=()=>new CSSStyleSheet,createElement:r=i=>document.createElement(i)})=>{let i=e.shadowRoot??e.attachShadow({mode:"open"}),n=s();n.replaceSync(Df);let o=[n];if(t){let a=s();a.replaceSync(t),o.push(a)}i.adoptedStyleSheets=o;let l=Pf(i);l?(l.style.cssText="display: contents;",Vs(l)||li(l)):(l=r("div"),l.style.cssText="display: contents;",li(l),i.appendChild(l)),l.parentNode!==i&&i.appendChild(l);let p=rn(e);return p&&typeof p=="object"&&(p.display="contents"),{shadow:i,renderTarget:l,adoptedStyleSheets:o}},Ns=(e,t=requestAnimationFrame)=>t(e),zf=({scheduleFrameFn:e=Ns}={})=>({update:(t,s)=>{let r=t.data?.props||{},i=s.data?.props||{};if(JSON.stringify(r)===JSON.stringify(i))return;let n=s.elm;!n||typeof n.render!="function"||(n.setAttribute("isDirty","true"),e(()=>{if(n.render(),n.removeAttribute("isDirty"),n.handlers&&n.handlers.handleOnUpdate){let o={...n.deps,store:n.store,render:n.render.bind(n),handlers:n.handlers,dispatchEvent:n.dispatchEvent.bind(n),refs:n.refIds||{}};n.handlers.handleOnUpdate(o,{oldProps:r,newProps:i})}}))}}),Wf=({elementName:e,propsSchema:t,propsSchemaKeys:s,template:r,refs:i,styles:n,handlers:o,methods:l,constants:p,store:a,patch:c,h:d,deps:h})=>{class f extends HTMLElement{elementName;styles;_snabbdomH;store;props;propsSchema;template;handlers;methods;constants;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_globalListenersCleanup;_oldVNode;deps;_propsSchemaKeys=[];cssText;static get observedAttributes(){return["key"]}get viewData(){let m={};return this.store.selectViewData&&(m=this.store.selectViewData()),m}connectedCallback(){let m=Bf({host:this,cssText:this.cssText});this.shadow=m.shadow,this.renderTarget=m.renderTarget,Lf({instance:this,parseAndRenderFn:fn,renderFn:this.render})}disconnectedCallback(){Vf({instance:this,clearTimerFn:clearTimeout})}attributeChangedCallback(m,b,g){Nf({instance:this,attributeName:m,oldValue:b,newValue:g,scheduleFrameFn:Ns})}render=()=>{jf({instance:this,createComponentUpdateHookFn:zf})}}class u extends f{static get observedAttributes(){return Cf({propsSchemaKeys:s,toKebabCase:tn})}constructor(){super(),this.constants=Kh({setupConstants:h?.constants,fileConstants:p}),this.propsSchema=t,Ju({source:this,allowedKeys:s,onPropChange:({propName:m,oldValue:b,newValue:g})=>{Rf({instance:this,propName:m,oldValue:b,newValue:g,scheduleFrameFn:Ns})}}),this.props=t?Zu(this,s):{},this._propsSchemaKeys=s,this.elementName=e,this.styles=n,this.store=Fh(a,this.props,this.constants),this.template=r,this.handlers=o,this.methods=l,this.refs=i,this.patch=c,this.deps={...h,store:this.store,render:this.render,handlers:o,props:this.props,constants:this.constants},Th(this,this.methods),this._snabbdomH=d,this.cssText=Uh(e,n)}}return u};function st(e,t,s,r,i){let n=t===void 0?void 0:t.key;return{sel:e,data:t,children:s,text:r,elm:i,key:n}}var kt=Array.isArray;function yt(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function Mf(e,t){return document.createElement(e,t)}function Ff(e,t,s){return document.createElementNS(e,t,s)}function Kf(){return Ae(document.createDocumentFragment())}function Uf(e){return document.createTextNode(e)}function Hf(e){return document.createComment(e)}function qf(e,t,s){if(me(e)){let r=e;for(;r&&me(r);)r=Ae(r).parent;e=r??e}me(t)&&(t=Ae(t,e)),s&&me(s)&&(s=Ae(s).firstChildNode),e.insertBefore(t,s)}function Yf(e,t){e.removeChild(t)}function Gf(e,t){me(t)&&(t=Ae(t,e)),e.appendChild(t)}function In(e){if(me(e)){for(;e&&me(e);)e=Ae(e).parent;return e??null}return e.parentNode}function Jf(e){var t;if(me(e)){let s=Ae(e),r=In(s);if(r&&s.lastChildNode){let i=Array.from(r.childNodes),n=i.indexOf(s.lastChildNode);return(t=i[n+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function Zf(e){return e.tagName}function Xf(e,t){e.textContent=t}function Qf(e){return e.textContent}function ey(e){return e.nodeType===1}function ty(e){return e.nodeType===3}function sy(e){return e.nodeType===8}function me(e){return e.nodeType===11}function Ae(e,t){var s,r,i;let n=e;return(s=n.parent)!==null&&s!==void 0||(n.parent=t??null),(r=n.firstChildNode)!==null&&r!==void 0||(n.firstChildNode=e.firstChild),(i=n.lastChildNode)!==null&&i!==void 0||(n.lastChildNode=e.lastChild),n}var ry={createElement:Mf,createElementNS:Ff,createTextNode:Uf,createDocumentFragment:Kf,createComment:Hf,insertBefore:qf,removeChild:Yf,appendChild:Gf,parentNode:In,nextSibling:Jf,tagName:Zf,setTextContent:Xf,getTextContent:Qf,isElement:ey,isText:ty,isComment:sy,isDocumentFragment:me};function ft(e){return e===void 0}function se(e){return e!==void 0}var fs=st("",{},[],void 0,void 0);function Ze(e,t){var s,r;let i=e.key===t.key,n=((s=e.data)===null||s===void 0?void 0:s.is)===((r=t.data)===null||r===void 0?void 0:r.is),o=e.sel===t.sel,l=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return o&&i&&n&&l}function iy(){throw new Error("The document fragment is not supported on this platform.")}function ny(e,t){return e.isElement(t)}function oy(e,t){return e.isDocumentFragment(t)}function ay(e,t,s){var r;let i={};for(let n=t;n<=s;++n){let o=(r=e[n])===null||r===void 0?void 0:r.key;o!==void 0&&(i[o]=n)}return i}var ly=["create","update","remove","destroy","pre","post"];function py(e,t,s){let r={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=ry;for(let u of ly)for(let y of e){let m=y[u];m!==void 0&&r[u].push(m)}function n(u){let y=u.id?"#"+u.id:"",m=u.getAttribute("class"),b=m?"."+m.split(" ").join("."):"";return st(i.tagName(u).toLowerCase()+y+b,{},[],void 0,u)}function o(u){return st(void 0,{},[],void 0,u)}function l(u,y){return function(){if(--y===0){let m=i.parentNode(u);m!==null&&i.removeChild(m,u)}}}function p(u,y){var m,b,g,_;let S,A=u.data;if(A!==void 0){let I=(m=A.hook)===null||m===void 0?void 0:m.init;se(I)&&(I(u),A=u.data)}let k=u.children,C=u.sel;if(C==="!")ft(u.text)&&(u.text=""),u.elm=i.createComment(u.text);else if(C==="")u.elm=i.createTextNode(u.text);else if(C!==void 0){let I=C.indexOf("#"),V=C.indexOf(".",I),z=I>0?I:C.length,B=V>0?V:C.length,J=I!==-1||V!==-1?C.slice(0,Math.min(z,B)):C,Z=u.elm=se(A)&&se(S=A.ns)?i.createElementNS(S,J,A):i.createElement(J,A);for(z<B&&Z.setAttribute("id",C.slice(z+1,B)),V>0&&Z.setAttribute("class",C.slice(B+1).replace(/\./g," ")),S=0;S<r.create.length;++S)r.create[S](fs,u);if(yt(u.text)&&(!kt(k)||k.length===0)&&i.appendChild(Z,i.createTextNode(u.text)),kt(k))for(S=0;S<k.length;++S){let we=k[S];we!=null&&i.appendChild(Z,p(we,y))}let ge=u.data.hook;se(ge)&&((b=ge.create)===null||b===void 0||b.call(ge,fs,u),ge.insert&&y.push(u))}else if(!((g=void 0)===null||g===void 0)&&g.fragments&&u.children){for(u.elm=((_=i.createDocumentFragment)!==null&&_!==void 0?_:iy)(),S=0;S<r.create.length;++S)r.create[S](fs,u);for(S=0;S<u.children.length;++S){let I=u.children[S];I!=null&&i.appendChild(u.elm,p(I,y))}}else u.elm=i.createTextNode(u.text);return u.elm}function a(u,y,m,b,g,_){for(;b<=g;++b){let S=m[b];S!=null&&i.insertBefore(u,p(S,_),y)}}function c(u){var y,m;let b=u.data;if(b!==void 0){(m=(y=b?.hook)===null||y===void 0?void 0:y.destroy)===null||m===void 0||m.call(y,u);for(let g=0;g<r.destroy.length;++g)r.destroy[g](u);if(u.children!==void 0)for(let g=0;g<u.children.length;++g){let _=u.children[g];_!=null&&typeof _!="string"&&c(_)}}}function d(u,y,m,b){for(var g,_;m<=b;++m){let S,A,k=y[m];if(k!=null)if(se(k.sel)){c(k),S=r.remove.length+1,A=l(k.elm,S);for(let I=0;I<r.remove.length;++I)r.remove[I](k,A);let C=(_=(g=k?.data)===null||g===void 0?void 0:g.hook)===null||_===void 0?void 0:_.remove;se(C)?C(k,A):A()}else k.children?(c(k),d(u,k.children,0,k.children.length-1)):i.removeChild(u,k.elm)}}function h(u,y,m,b){let g=0,_=0,S=y.length-1,A=y[0],k=y[S],C=m.length-1,I=m[0],V=m[C],z,B,J,Z;for(;g<=S&&_<=C;)A==null?A=y[++g]:k==null?k=y[--S]:I==null?I=m[++_]:V==null?V=m[--C]:Ze(A,I)?(f(A,I,b),A=y[++g],I=m[++_]):Ze(k,V)?(f(k,V,b),k=y[--S],V=m[--C]):Ze(A,V)?(f(A,V,b),i.insertBefore(u,A.elm,i.nextSibling(k.elm)),A=y[++g],V=m[--C]):Ze(k,I)?(f(k,I,b),i.insertBefore(u,k.elm,A.elm),k=y[--S],I=m[++_]):(z===void 0&&(z=ay(y,g,S)),B=z[I.key],ft(B)?(i.insertBefore(u,p(I,b),A.elm),I=m[++_]):ft(z[V.key])?(i.insertBefore(u,p(V,b),i.nextSibling(k.elm)),V=m[--C]):(J=y[B],J.sel!==I.sel?i.insertBefore(u,p(I,b),A.elm):(f(J,I,b),y[B]=void 0,i.insertBefore(u,J.elm,A.elm)),I=m[++_]));_<=C&&(Z=m[C+1]==null?null:m[C+1].elm,a(u,Z,m,_,C,b)),g<=S&&d(u,y,g,S)}function f(u,y,m){var b,g,_,S,A,k,C,I;let V=(b=y.data)===null||b===void 0?void 0:b.hook;(g=V?.prepatch)===null||g===void 0||g.call(V,u,y);let z=y.elm=u.elm;if(u===y)return;if(y.data!==void 0||se(y.text)&&y.text!==u.text){(_=y.data)!==null&&_!==void 0||(y.data={}),(S=u.data)!==null&&S!==void 0||(u.data={});for(let Z=0;Z<r.update.length;++Z)r.update[Z](u,y);(C=(k=(A=y.data)===null||A===void 0?void 0:A.hook)===null||k===void 0?void 0:k.update)===null||C===void 0||C.call(k,u,y)}let B=u.children,J=y.children;ft(y.text)?se(B)&&se(J)?B!==J&&h(z,B,J,m):se(J)?(se(u.text)&&i.setTextContent(z,""),a(z,null,J,0,J.length-1,m)):se(B)?d(z,B,0,B.length-1):se(u.text)&&i.setTextContent(z,""):u.text!==y.text&&(se(B)&&d(z,B,0,B.length-1),i.setTextContent(z,y.text)),(I=V?.postpatch)===null||I===void 0||I.call(V,u,y)}return function(u,y){let m,b,g,_=[];for(m=0;m<r.pre.length;++m)r.pre[m]();for(ny(i,u)?u=n(u):oy(i,u)&&(u=o(u)),Ze(u,y)?f(u,y,_):(b=u.elm,g=i.parentNode(b),p(y,_),g!==null&&(i.insertBefore(g,y.elm,i.nextSibling(b)),d(g,[u],0,0))),m=0;m<_.length;++m)_[m].data.hook.insert(_[m]);for(m=0;m<r.post.length;++m)r.post[m]();return y}}function pi(e,t){let s,r,i=t.elm,n=e.data.class,o=t.data.class;if(!(!n&&!o)&&n!==o){n=n||{},o=o||{};for(r in n)n[r]&&!Object.prototype.hasOwnProperty.call(o,r)&&i.classList.remove(r);for(r in o)s=o[r],s!==n[r]&&i.classList[s?"add":"remove"](r)}}var dy={create:pi,update:pi};function di(e,t){let s,r,i,n=t.elm,o=e.data.props,l=t.data.props;if(!(!o&&!l)&&o!==l){o=o||{},l=l||{};for(s in l)r=l[s],i=o[s],i!==r&&(s!=="value"||n[s]!==r)&&(n[s]=r)}}var cy={create:di,update:di},uy="http://www.w3.org/1999/xlink",hy="http://www.w3.org/2000/xmlns/",fy="http://www.w3.org/XML/1998/namespace",ci=58,yy=120,my=109;function ui(e,t){let s,r=t.elm,i=e.data.attrs,n=t.data.attrs;if(!(!i&&!n)&&i!==n){i=i||{},n=n||{};for(s in n){let o=n[s];i[s]!==o&&(o===!0?r.setAttribute(s,""):o===!1?r.removeAttribute(s):s.charCodeAt(0)!==yy?r.setAttribute(s,o):s.charCodeAt(3)===ci?r.setAttributeNS(fy,s,o):s.charCodeAt(5)===ci?s.charCodeAt(1)===my?r.setAttributeNS(hy,s,o):r.setAttributeNS(uy,s,o):r.setAttribute(s,o))}for(s in i)s in n||r.removeAttribute(s)}}var gy={create:ui,update:ui},hi=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,by=function(e){hi(function(){hi(e)})},Rs=!1;function vy(e,t,s){by(function(){e[t]=s})}function fi(e,t){let s,r,i=t.elm,n=e.data.style,o=t.data.style;if(!n&&!o||n===o)return;n=n||{},o=o||{};let l="delayed"in n;for(r in n)r in o||(r[0]==="-"&&r[1]==="-"?i.style.removeProperty(r):i.style[r]="");for(r in o)if(s=o[r],r==="delayed"&&o.delayed)for(let p in o.delayed)s=o.delayed[p],(!l||s!==n.delayed[p])&&vy(i.style,p,s);else r!=="remove"&&s!==n[r]&&(r[0]==="-"&&r[1]==="-"?i.style.setProperty(r,s):i.style[r]=s)}function wy(e){let t,s,r=e.elm,i=e.data.style;if(!(!i||!(t=i.destroy)))for(s in t)r.style[s]=t[s]}function _y(e,t){let s=e.data.style;if(!s||!s.remove){t();return}Rs||(e.elm.offsetLeft,Rs=!0);let r,i=e.elm,n=0,o=s.remove,l=0,p=[];for(r in o)p.push(r),i.style[r]=o[r];let a=getComputedStyle(i)["transition-property"].split(", ");for(;n<a.length;++n)p.indexOf(a[n])!==-1&&l++;i.addEventListener("transitionend",function(c){c.target===i&&--l,l===0&&t()})}function xy(){Rs=!1}var Sy={pre:xy,create:fi,update:fi,destroy:wy,remove:_y};function On(e,t,s){if(typeof e=="function")e.call(t,s,t);else if(typeof e=="object")for(let r=0;r<e.length;r++)On(e[r],t,s)}function Ay(e,t){let s=e.type,r=t.data.on;r&&r[s]&&On(r[s],t,e)}function ky(){return function e(t){Ay(t,e.vnode)}}function ys(e,t){let s=e.data.on,r=e.listener,i=e.elm,n=t&&t.data.on,o=t&&t.elm,l;if(s!==n){if(s&&r)if(n)for(l in s)n[l]||i.removeEventListener(l,r,!1);else for(l in s)i.removeEventListener(l,r,!1);if(n){let p=t.listener=e.listener||ky();if(p.vnode=t,s)for(l in n)s[l]||o.addEventListener(l,p,!1);else for(l in n)o.addEventListener(l,p,!1)}}}var Ey={create:ys,update:ys,destroy:ys},$y=()=>py([dy,cy,gy,Sy,Ey]);function Tn(e,t,s){if(e.ns="http://www.w3.org/2000/svg",s!=="foreignObject"&&t!==void 0)for(let r=0;r<t.length;++r){let i=t[r];if(typeof i=="string")continue;let n=i.data;n!==void 0&&Tn(n,i.children,i.sel)}}function Cy(e,t,s){let r={},i,n,o;if(s!==void 0?(t!==null&&(r=t),kt(s)?i=s:yt(s)?n=s.toString():s&&s.sel&&(i=[s])):t!=null&&(kt(t)?i=t:yt(t)?n=t.toString():t&&t.sel?i=[t]:r=t),i!==void 0)for(o=0;o<i.length;++o)yt(i[o])&&(i[o]=st(void 0,void 0,void 0,i[o],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&Tn(r,i,e),st(e,r,i,n,void 0)}var Iy=$y(),Oy=({handlers:e,methods:t,constants:s,schema:r,view:i,store:n},o)=>{if(!i)throw new Error("view is not defined");if(!r||typeof r!="object"||Array.isArray(r))throw new Error("schema is required. Define component metadata in .schema.yaml.");let l=r,{template:p,refs:a,styles:c}=i;Xu({schema:l,methodExports:Object.keys(t||{})});let d=l.componentName,h=l.propsSchema,f=h?.properties?[...new Set(Object.keys(h.properties).map(u=>sn(u)))]:[];return Wf({elementName:d,propsSchema:h,propsSchemaKeys:f,template:p,refs:a,styles:c,handlers:e,methods:t,constants:s,store:n,patch:Iy,h:Cy,deps:o})},Ty=e=>{let t={};return{once:(s,r)=>{t[s]||(t[s]=[]);let i=(...n)=>{r(...n),t[s]=t[s].filter(o=>o!==i)};return t[s].push(i),()=>{t[s]=(t[s]??[]).filter(n=>n!==i)}},emit:(s,...r)=>{t[s]&&[...t[s]].forEach(i=>{i(...r)})},showAlert:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showConfirm:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showFormDialog:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showComponentDialog:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showDropdownMenu:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showToast:s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},closeAll:async()=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")}}},Ly=Ty(),Vy={globalUI:Ly},Ny={components:Vy},Ry={componentName:"rtgl-accordion-item",propsSchema:{type:"object",properties:{label:{type:"string"},content:{type:"string"},w:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},jy={refs:{header:{eventListeners:{click:{handler:"handleClickHeader"}}}},styles:{".content-wrapper":{display:"grid","grid-template-rows":"0fr",transition:"grid-template-rows 0.2s ease-out"},".content-wrapper.open":{"grid-template-rows":"1fr"},".content-inner":{overflow:"hidden"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=v ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c w=f pv=md cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-svg svg=${chevronIcon} wh=16 c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg svg=",{type:1,path:"chevronIcon"}," wh=16 c=mu-fg"]}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:'div class="${openClass}"',value:{type:9,items:[{type:8,properties:[{key:"div class=content-inner",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view pb=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"content"}}],fast:!0},{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['div class="',{type:1,path:"openClass"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=v ",{type:1,path:"containerAttrString"}]}}],fast:!0}],fast:!0}},Dy={componentName:"rtgl-breadcrumb",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},href:{type:"string"},path:{type:"string"},current:{type:"boolean"},disabled:{type:"boolean"},click:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"}}}},sep:{type:"string",default:"breadcrumb-arrow"},max:{type:"number"}}},events:{"item-click":{type:"object",properties:{id:{type:"string"},path:{type:"string"},href:{type:"string"},item:{type:"object"},index:{type:"number"},trigger:{type:"string"}}}},methods:{type:"object",properties:{}}},Py={refs:{"item*":{eventListeners:{click:{handler:"handleClickItem"}}}},styles:{a:{"text-decoration":"none",color:"inherit"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md p=sm ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isSeparator",value:{type:6,conditions:[{type:1,path:"item.isSeparator"},{type:1,path:"item.isEllipsis"},{type:4,op:6,left:{type:1,path:"item.isInteractive"},right:{type:1,path:"item.href"}},{type:1,path:"item.isInteractive"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${sep} c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"sep"}," c=mu-fg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#item${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#item",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#item${i} data-index=${item.index} cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#item",{type:1,path:"i"}," data-index=",{type:1,path:"item.index"}," cur=pointer"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md p=sm ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},By={componentName:"rtgl-card",propsSchema:{type:"object",properties:{head:{type:"string"},desc:{type:"string"},size:{type:"string",enum:["sm","md","lg"]}}},events:[],methods:{type:"object",properties:{}}},zy={styles:{":host":{display:"block"},slot:{display:"block","min-width":0},".rtgl-card-body":{"min-width":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="rtgl-card" d=v w=f bgc=bg bw=xs bc=bo br=xl shadow=sm ${cardAttrString} ${containerAttrString}',value:{type:9,items:[{type:8,properties:[{key:"$if hasHeader",value:{type:6,conditions:[{type:1,path:"hasHeader"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="rtgl-card-header" d=v w=f ${headerAttrString}',value:{type:9,items:[{type:8,properties:[{key:"$if head",value:{type:6,conditions:[{type:1,path:"head"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-text class="rtgl-card-heading" s=${headingSize} w=f',value:{type:1,path:"head"},parsedKey:{type:2,parts:['rtgl-text class="rtgl-card-heading" s=',{type:1,path:"headingSize"}," w=f"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if desc",value:{type:6,conditions:[{type:1,path:"desc"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-text class="rtgl-card-desc" s=${subheadingSize} c=mu-fg w=f',value:{type:1,path:"desc"},parsedKey:{type:2,parts:['rtgl-text class="rtgl-card-desc" s=',{type:1,path:"subheadingSize"}," c=mu-fg w=f"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:['rtgl-view class="rtgl-card-header" d=v w=f ',{type:1,path:"headerAttrString"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"div class=rtgl-card-body",value:{type:9,items:[{type:8,properties:[{key:"slot",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:['rtgl-view class="rtgl-card" d=v w=f bgc=bg bw=xs bc=bo br=xl shadow=sm ',{type:1,path:"cardAttrString"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Wy={componentName:"rtgl-dropdown-menu",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["section","item","separator","label"]},id:{type:"string"},icon:{type:"string"},path:{type:"string"},href:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},disabled:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"},testId:{type:"string"}}}},open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},w:{type:"string"},h:{type:"string"}}},events:{close:{type:"object"},"item-click":{type:"object",properties:{index:{type:"number"},item:{type:"object"},id:{type:"string"},path:{type:"string"},href:{type:"string"},trigger:{type:"string"}}}},methods:{type:"object",properties:{}}},My={refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},styles:{a:{display:"block",width:"100%","text-decoration":"none",color:"inherit"},".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} content-w=${w} content-h=${h} content-sv=true content-g=xs content-pv=sm",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isSection",value:{type:6,conditions:[{type:1,path:"item.isSection"},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.isDisabled"}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:4,op:6,left:{type:1,path:"item.hasHref"},right:{type:1,path:"item.linkExtraAttrs"}}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.hasHref"}},{type:1,path:"item.isItem"},{type:1,path:"item.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f p=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=sm",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," place=",{type:1,path:"place"}," content-w=",{type:1,path:"w"}," content-h=",{type:1,path:"h"}," content-sv=true content-g=xs content-pv=sm"]}}],fast:!1}],fast:!1}},Fy={componentName:"rtgl-form",propsSchema:{type:"object",properties:{form:{type:"object"},defaultValues:{type:"object"},context:{type:"object"},disabled:{type:"boolean"}}},events:{"form-input":{},"form-change":{},"form-field-event":{},"form-action":{}},methods:{type:"object",properties:{getValues:{type:"function"},setValues:{type:"function"},validate:{type:"function"},reset:{type:"function"}}}},Ky={refs:{formContainer:{eventListeners:{keydown:{handler:"handleKeyDown"}}},"action*":{eventListeners:{click:{handler:"handleActionClick"}}},"tooltipIcon*":{eventListeners:{mouseenter:{handler:"handleTooltipMouseEnter"},mouseleave:{handler:"handleTooltipMouseLeave"}}},"field*":{eventListeners:{"value-input":{handler:"handleValueInput"},"value-change":{handler:"handleValueChange"}}},"image*":{eventListeners:{click:{handler:"handleImageClick"},contextmenu:{handler:"handleImageClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#formContainer w=f p=md g=lg ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if title",value:{type:6,conditions:[{type:1,path:"title"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"title"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if description",value:{type:6,conditions:[{type:1,path:"description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view g=lg w=f",value:{type:9,items:[{type:7,itemVar:"field",indexVar:"i",iterable:{type:1,path:"flatFields"},body:{type:9,items:[{type:8,properties:[{key:"$if field._isSection",value:{type:6,conditions:[{type:1,path:"field._isSection"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"$if field.label",value:{type:6,conditions:[{type:1,path:"field.label"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=md",value:{type:1,path:"field.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.description",value:{type:6,conditions:[{type:1,path:"field.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if !field._isSection",value:{type:6,conditions:[{type:5,op:0,operand:{type:1,path:"field._isSection"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=f",value:{type:9,items:[{type:8,properties:[{key:"$if field.label || field.description",value:{type:6,conditions:[{type:4,op:7,left:{type:1,path:"field.label"},right:{type:1,path:"field.description"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=md av=c",value:{type:9,items:[{type:8,properties:[{key:"$if field.label",value:{type:6,conditions:[{type:1,path:"field.label"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"field.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.required",value:{type:6,conditions:[{type:1,path:"field.required"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=fg s=sm",value:{type:0,value:"*"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.tooltip",value:{type:6,conditions:[{type:1,path:"field.tooltip"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#tooltipIcon${field._idx} data-field-name=${field.name} svg="info" wh=16 c=mu-fg cur=help ml=xs',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg#tooltipIcon",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' svg="info" wh=16 c=mu-fg cur=help ml=xs']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if field.description",value:{type:6,conditions:[{type:1,path:"field.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#field${field._idx} data-field-name=${field.name} w=f type=${field._inputType} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f type=",{type:1,path:"field._inputType"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-date"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-date"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-date#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-date#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-time"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-time"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-time#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-time#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-datetime"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-datetime"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-datetime#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-datetime#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-number"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-number"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-textarea"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-textarea"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-textarea#field${field._idx} data-field-name=${field.name} w=f rows=${field.rows} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-textarea#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f rows=",{type:1,path:"field.rows"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-select#field${field._idx} data-field-name=${field.name} w=f :options=${field.options} ?no-clear=${field.noClear} :selectedValue=${field._selectedValue} :placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=",{type:1,path:"field.options"}," ?no-clear=",{type:1,path:"field.noClear"}," :selectedValue=",{type:1,path:"field._selectedValue"}," :placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "tag-select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"tag-select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-tag-select#field${field._idx} data-field-name=${field.name} w=f :options=${field.options} :selectedValues=${field._selectedValues} :placeholder=${field.placeholder} :addOption=${field.addOption} ?no-add=${field.noAdd} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-tag-select#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=",{type:1,path:"field.options"}," :selectedValues=",{type:1,path:"field._selectedValues"}," :placeholder=",{type:1,path:"field.placeholder"}," :addOption=",{type:1,path:"field.addOption"}," ?no-add=",{type:1,path:"field.noAdd"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "segmented-control"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"segmented-control"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-segmented-control#field${field._idx} data-field-name=${field.name} w=f :options=${field.options} ?no-clear=${field.noClear} :selectedValue=${field._selectedValue} :placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-segmented-control#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=",{type:1,path:"field.options"}," ?no-clear=",{type:1,path:"field.noClear"}," :selectedValue=",{type:1,path:"field._selectedValue"}," :placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "color-picker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"color-picker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#field${field._idx} data-field-name=${field.name} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slider"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slider-with-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slider-with-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider-input#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "popover-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"popover-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-popover-input#field${field._idx} data-field-name=${field.name} label="${field.label}" placeholder=${field.placeholder} ?disabled=${field._disabled}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-popover-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field.label"},'" placeholder=',{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "checkbox"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"checkbox"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-checkbox#field${field._idx} data-field-name=${field.name} label="${field._checkboxText}" ?disabled=${field._disabled}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-checkbox#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field._checkboxText"},'" ?disabled=',{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "image" && field._imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"image"}},right:{type:1,path:"field._imageSrc"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image#image${field._idx} data-field-name=${field.name} src=${field._imageSrc} w=${field.width} h=${field.height} cur=pointer",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image#image",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," src=",{type:1,path:"field._imageSrc"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=pointer"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "image" && !field._imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"image"}},right:{type:5,op:0,operand:{type:1,path:"field._imageSrc"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#image${field._idx} data-field-name=${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=pointer p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg ta=c",value:{type:1,path:"field.placeholderText"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#image",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," bc=ac bw=sm ah=c av=c cur=pointer p=md"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "read-only-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"read-only-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"field.content"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slot"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slot"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'slot#fieldSlot${field._idx} name=${field.slot} style="display: contents;"',value:{type:0,value:null},parsedKey:{type:2,parts:["slot#fieldSlot",{type:1,path:"field._idx"}," name=",{type:1,path:"field.slot"},' style="display: contents;"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field._error",value:{type:6,conditions:[{type:1,path:"field._error"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=de",value:{type:1,path:"field._error"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if actions.buttons.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"actions.buttons.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'$if actions._layout == "split"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"split"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h w=f g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._leftButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=sm ah=e w=1fg",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._rightButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if actions._layout == "vertical"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"vertical"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._allButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} w=f ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," w=f ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if actions._layout == "stretch"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"stretch"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._allButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} w=f ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," w=f ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'rtgl-tooltip ?open=${tooltipState.open} x=${tooltipState.x} y=${tooltipState.y} place="t" content="${tooltipState.content}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-tooltip ?open=",{type:1,path:"tooltipState.open"}," x=",{type:1,path:"tooltipState.x"}," y=",{type:1,path:"tooltipState.y"},' place="t" content="',{type:1,path:"tooltipState.content"},'"']}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#formContainer w=f p=md g=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Uy={componentName:"rtgl-global-ui",propsSchema:{type:"object",properties:{}},events:[],methods:{type:"object",properties:{}}},Hy={refs:{dialog:{eventListeners:{close:{handler:"handleDialogClose"}}},confirmButton:{eventListeners:{click:{handler:"handleConfirm"}}},cancelButton:{eventListeners:{click:{handler:"handleCancel"}}},componentDialogBodyHost:{},"componentDialogAction*":{eventListeners:{click:{handler:"handleComponentDialogAction"}}},formDialog:{eventListeners:{"form-action":{handler:"handleFormAction"},"form-field-event":{handler:"handleFormFieldEvent"}}},dropdownMenu:{eventListeners:{close:{handler:"handleDropdownClose"},"item-click":{handler:"handleDropdownItemClick"}}}},styles:{".toast-layer":{"pointer-events":"none"},".toast-card":{"pointer-events":"auto","box-sizing":"border-box",width:"33vw","max-width":"calc(100vw - 2 * var(--spacing-lg))",opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 180ms cubic-bezier(0.16, 1, 0.3, 1), transform 180ms cubic-bezier(0.16, 1, 0.3, 1)","will-change":"opacity, transform"},".toast-card-top":{animation:"toast-in-top 220ms cubic-bezier(0.16, 1, 0.3, 1)"},".toast-card-bottom":{animation:"toast-in-bottom 220ms cubic-bezier(0.16, 1, 0.3, 1)"},".toast-card-md":{width:"50vw"},".toast-card-lg":{width:"80vw"},".toast-card-top.toast-card-exiting":{opacity:0,transform:"translateY(calc(var(--spacing-sm) * -0.5)) scale(0.98)"},".toast-card-bottom.toast-card-exiting":{opacity:0,transform:"translateY(calc(var(--spacing-sm) * 0.5)) scale(0.98)"},".toast-message":{"overflow-wrap":"anywhere"},"@keyframes toast-in-top":{from:{opacity:0,transform:"translateY(calc(var(--spacing-sm) * -1)) scale(0.96)"},to:{opacity:1,transform:"translateY(0) scale(1)"}},"@keyframes toast-in-bottom":{from:{opacity:0,transform:"translateY(var(--spacing-sm)) scale(0.96)"},to:{opacity:1,transform:"translateY(0) scale(1)"}},"@media (prefers-reduced-motion: reduce)":{".toast-card":{animation:"none",transition:"none"}}},template:{type:9,items:[{type:8,properties:[{key:"$if topToasts.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"topToasts.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-layer toast-layer-top" pos=fix edge=t z=2100 w=f ah=c g=sm ph=md pt=xl',value:{type:9,items:[{type:7,itemVar:"toast",indexVar:"i",iterable:{type:1,path:"topToasts"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-card toast-card-top toast-card-${toast.size} toast-card-${toast.phase}" key=toast-${toast.id} bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text class=toast-message ta=c w=f",value:{type:1,path:"toast.message"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view class="toast-card toast-card-top toast-card-',{type:1,path:"toast.size"}," toast-card-",{type:1,path:"toast.phase"},'" key=toast-',{type:1,path:"toast.id"}," bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if bottomToasts.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"bottomToasts.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-layer toast-layer-bottom" pos=fix edge=b z=2100 w=f ah=c g=sm ph=md pb=xl',value:{type:9,items:[{type:7,itemVar:"toast",indexVar:"i",iterable:{type:1,path:"bottomToasts"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-card toast-card-bottom toast-card-${toast.size} toast-card-${toast.phase}" key=toast-${toast.id} bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text class=toast-message ta=c w=f",value:{type:1,path:"toast.message"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view class="toast-card toast-card-bottom toast-card-',{type:1,path:"toast.size"}," toast-card-",{type:1,path:"toast.phase"},'" key=toast-',{type:1,path:"toast.id"}," bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-dialog#dialog ?open=${isDialogContainerOpen} s=${dialogSize}",value:{type:9,items:[{type:8,properties:[{key:"$if isFormDialogOpen",value:{type:6,conditions:[{type:1,path:"isFormDialogOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-form#formDialog slot=content :form=${formDialogConfig.form} :defaultValues=${formDialogConfig.defaultValues} :context=${formDialogConfig.context} ?disabled=${formDialogConfig.disabled} key=form-dialog-${formDialogConfig.key}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-form#formDialog slot=content :form=",{type:1,path:"formDialogConfig.form"}," :defaultValues=",{type:1,path:"formDialogConfig.defaultValues"}," :context=",{type:1,path:"formDialogConfig.context"}," ?disabled=",{type:1,path:"formDialogConfig.disabled"}," key=form-dialog-",{type:1,path:"formDialogConfig.key"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if isComponentDialogOpen",value:{type:6,conditions:[{type:1,path:"isComponentDialogOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"$if componentDialogConfig.title || componentDialogConfig.description",value:{type:6,conditions:[{type:4,op:7,left:{type:1,path:"componentDialogConfig.title"},right:{type:1,path:"componentDialogConfig.description"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if componentDialogConfig.title",value:{type:6,conditions:[{type:1,path:"componentDialogConfig.title"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"componentDialogConfig.title"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if componentDialogConfig.description",value:{type:6,conditions:[{type:1,path:"componentDialogConfig.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"componentDialogConfig.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view#componentDialogBodyHost w=f key=component-dialog-body-${componentDialogConfig.key}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view#componentDialogBodyHost w=f key=component-dialog-body-",{type:1,path:"componentDialogConfig.key"}]}}],fast:!0},{type:8,properties:[{key:"$if componentDialogConfig.actions.buttons.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"componentDialogConfig.actions.buttons.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h w=f g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"componentDialogConfig.actions._leftButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#componentDialogAction${button._globalIdx} data-action-id=${button.id} data-action-index=${button._globalIdx} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#componentDialogAction",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," data-action-index=",{type:1,path:"button._globalIdx"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=sm ah=e w=1fg",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"componentDialogConfig.actions._rightButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#componentDialogAction${button._globalIdx} data-action-id=${button.id} data-action-index=${button._globalIdx} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#componentDialogAction",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," data-action-index=",{type:1,path:"button._globalIdx"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if !isFormDialogOpen && !isComponentDialogOpen",value:{type:6,conditions:[{type:4,op:6,left:{type:5,op:0,operand:{type:1,path:"isFormDialogOpen"}},right:{type:5,op:0,operand:{type:1,path:"isComponentDialogOpen"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if config.title",value:{type:6,conditions:[{type:1,path:"config.title"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"config.title"}}],fast:!0},{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=md mt=lg w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"$if config.mode == 'confirm'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"config.mode"},right:{type:0,value:"confirm"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-button#cancelButton v=se",value:{type:1,path:"config.cancelText"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-button#confirmButton v=pr",value:{type:1,path:"config.confirmText"}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-dialog#dialog ?open=",{type:1,path:"isDialogContainerOpen"}," s=",{type:1,path:"dialogSize"}]}}],fast:!1},{type:8,properties:[{key:"rtgl-dropdown-menu#dropdownMenu ?open=${isDropdownOpen} x=${dropdownConfig.x} y=${dropdownConfig.y} place=${dropdownConfig.place} :items=${dropdownConfig.items} key=dropdown-${isDropdownOpen}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-dropdown-menu#dropdownMenu ?open=",{type:1,path:"isDropdownOpen"}," x=",{type:1,path:"dropdownConfig.x"}," y=",{type:1,path:"dropdownConfig.y"}," place=",{type:1,path:"dropdownConfig.place"}," :items=",{type:1,path:"dropdownConfig.items"}," key=dropdown-",{type:1,path:"isDropdownOpen"}]}}],fast:!0}],fast:!1}},qy={componentName:"rtgl-navbar",propsSchema:{type:"object",properties:{start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}}}}}},events:{"start-click":{type:"object",properties:{path:{type:"string"}}}},methods:{type:"object",properties:{}}},Yy={refs:{start:{eventListeners:{click:{handler:"handleClickStart"}}}},anchors:[[{"rtgl-text s=lg":"${start.label}"},{"$if start.image && start.image.src":[{"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}":null}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view bgc=bg d=h h=48 av=c w=f ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if start.href",value:{type:6,conditions:[{type:1,path:"start.href"},{type:1,path:"start.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${start.href}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a href=",{type:1,path:"start.href"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#start d=h av=c g=md cur=pointer",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view d=h av=c g=lg",value:{type:9,items:[{type:8,properties:[{key:"slot name=right",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view bgc=bg d=h h=48 av=c w=f ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Gy={componentName:"rtgl-page-outline",propsSchema:{type:"object",properties:{targetId:{type:"string"},scrollContainerId:{type:"string"},offsetTop:{type:"string"}}},events:{onItemClick:{type:"object"}},methods:{type:"object",properties:{}}},Jy={refs:{},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=272 d=v pr=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1fg sv mt=xl",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view d=h bwl=xs bc="${item.bc}" pv=sm av=c href=${item.href} pl=md',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=${item.ml}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view w=",{type:1,path:"item.ml"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} h-c=fg",value:{type:1,path:"item.title"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," h-c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view d=h bwl=xs bc="',{type:1,path:"item.bc"},'" pv=sm av=c href=',{type:1,path:"item.href"}," pl=md"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}},Zy={componentName:"rtgl-popover-input",propsSchema:{type:"object",properties:{value:{type:"string"},placeholder:{type:"string"},label:{type:"string"},autoFocus:{type:"boolean"},disabled:{type:"boolean",default:!1}}},events:{"value-change":{}},methods:{type:"object",properties:{}}},Xy={refs:{textDisplay:{eventListeners:{click:{handler:"handleTextClick"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},input:{eventListeners:{"value-input":{handler:"handleInputChange"},keydown:{handler:"handleInputKeydown"}}},submit:{eventListeners:{click:{handler:"handleSubmitClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#textDisplay w=f cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${valueColor}",value:{type:1,path:"value"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"valueColor"}]}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} content-g=md content-w=240 content-pv=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-input#input w=f placeholder=${placeholder} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=f placeholder=",{type:1,path:"placeholder"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#submit ?disabled=${disabled}",value:{type:0,value:"Submit"},parsedKey:{type:2,parts:["rtgl-button#submit ?disabled=",{type:1,path:"disabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," content-g=md content-w=240 content-pv=sm"]}}],fast:!0}],fast:!0}},Qy={componentName:"rtgl-segmented-control",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"any"},testId:{type:"string"}}}},selectedValue:{type:"any"},onChange:{type:"function"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}},em={refs:{"option*":{eventListeners:{click:{handler:"handleOptionClick"},keydown:{handler:"handleOptionKeyDown"},mouseenter:{handler:"handleOptionMouseEnter"},mouseleave:{handler:"handleOptionMouseLeave"}}},optionAdd:{eventListeners:{click:{handler:"handleAddOptionClick"},keydown:{handler:"handleAddOptionKeyDown"},mouseenter:{handler:"handleAddOptionMouseEnter"},mouseleave:{handler:"handleAddOptionMouseLeave"}}}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view d=h bw=xs bc=bo br=md bgc=bg overflow=hidden ${containerAttrString} role="group" aria-label=${ariaLabel}',value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view#option${i} d=h av=c ah=c w=1fg ph=lg pv=md cur=${option.cursor} bgc=${option.bgc} bwl=${option.borderLeftWidth} bc=bo data-testid=${option.testId} role="button" tabindex=${option.tabIndex} aria-pressed=${option.isSelected} aria-disabled=${isDisabled}',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${option.textColor} ta=c",value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"option.textColor"}," ta=c"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," d=h av=c ah=c w=1fg ph=lg pv=md cur=",{type:1,path:"option.cursor"}," bgc=",{type:1,path:"option.bgc"}," bwl=",{type:1,path:"option.borderLeftWidth"}," bc=bo data-testid=",{type:1,path:"option.testId"},' role="button" tabindex=',{type:1,path:"option.tabIndex"}," aria-pressed=",{type:1,path:"option.isSelected"}," aria-disabled=",{type:1,path:"isDisabled"}]}}],fast:!0}],fast:!0},flatten:!0},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view#optionAdd d=h av=c ah=c w=1fg ph=lg pv=md cur=pointer bgc=${addOptionBgc} bwl=${addOptionBorderLeftWidth} bc=bo data-testid="segmented-control-add-option" role="button" tabindex=0',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=ac ta=c",value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#optionAdd d=h av=c ah=c w=1fg ph=lg pv=md cur=pointer bgc=",{type:1,path:"addOptionBgc"}," bwl=",{type:1,path:"addOptionBorderLeftWidth"},' bc=bo data-testid="segmented-control-add-option" role="button" tabindex=0']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h bw=xs bc=bo br=md bgc=bg overflow=hidden ",{type:1,path:"containerAttrString"},' role="group" aria-label=',{type:1,path:"ariaLabel"}]}}],fast:!1}],fast:!1}},tm={componentName:"rtgl-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{type:{type:"string",enum:["section","item","separator"]},label:{type:"string"},value:{type:"any"},icon:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},testId:{type:"string"}}}},selectedValue:{type:"any"},onChange:{type:"function"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}},sm={refs:{selectButton:{eventListeners:{click:{handler:"handleButtonClick"},keydown:{handler:"handleButtonKeyDown"}}},clearButton:{eventListeners:{click:{handler:"handleClearClick"}}},popover:{eventListeners:{close:{handler:"handleClickOptionsPopoverOverlay"}}},"option*":{eventListeners:{click:{handler:"handleOptionClick"},mouseenter:{handler:"handleOptionMouseEnter"},mouseleave:{handler:"handleOptionMouseLeave"}}},optionAdd:{eventListeners:{click:{handler:"handleAddOptionClick"},mouseenter:{handler:"handleAddOptionMouseEnter"},mouseleave:{handler:"handleAddOptionMouseLeave"}}}},styles:{".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view#selectButton style="display: inline-flex;" d=h av=c h=32 ph=md bw=xs bc=bo h-bc=${selectButtonHoverBorderColor} br=md bgc=su cur=${selectButtonCursor} ${containerAttrString} data-testid="select-button" role="button" tabindex=${selectButtonTabIndex} aria-disabled=${isDisabled}',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c ah=s w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if hasSelectedIcon",value:{type:6,conditions:[{type:1,path:"hasSelectedIcon"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg svg=${selectedIcon} wh=16 c=${selectedIconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg svg=",{type:1,path:"selectedIcon"}," wh=16 c=",{type:1,path:"selectedIconColor"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text w=1fg ta=s c=${selectedLabelColor} ellipsis",value:{type:1,path:"selectedLabel"},parsedKey:{type:2,parts:["rtgl-text w=1fg ta=s c=",{type:1,path:"selectedLabelColor"}," ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if hasSelectedSuffixText",value:{type:6,conditions:[{type:1,path:"hasSelectedSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${selectedSuffixTextColor} ta=e",value:{type:1,path:"selectedSuffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"selectedSuffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if showClear",value:{type:6,conditions:[{type:1,path:"showClear"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#clearButton svg=x wh=16 c=mu-fg cur=pointer data-testid="select-clear-button"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-svg svg=chevronDown wh=16 c=mu-fg",value:{type:0,value:null}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:['rtgl-view#selectButton style="display: inline-flex;" d=h av=c h=32 ph=md bw=xs bc=bo h-bc=',{type:1,path:"selectButtonHoverBorderColor"}," br=md bgc=su cur=",{type:1,path:"selectButtonCursor"}," ",{type:1,path:"containerAttrString"},' data-testid="select-button" role="button" tabindex=',{type:1,path:"selectButtonTabIndex"}," aria-disabled=",{type:1,path:"isDisabled"}]}}],fast:!1},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=rs content-wh=300 content-g=xs content-sv=true content-pv=sm",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"$if option.isSection",value:{type:6,conditions:[{type:1,path:"option.isSection"},{type:1,path:"option.isItem"},{type:1,path:"option.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${option.index} w=f ph=lg pv=md cur=pointer bgc=${option.bgc} data-testid=${option.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if option.hasIconSlot",value:{type:6,conditions:[{type:1,path:"option.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if option.hasIcon",value:{type:6,conditions:[{type:1,path:"option.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${option.icon} c=${option.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"option.icon"}," c=",{type:1,path:"option.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${option.c} w=1fg ellipsis",value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"option.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if option.hasSuffixText",value:{type:6,conditions:[{type:1,path:"option.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${option.suffixTextColor} ta=e",value:{type:1,path:"option.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"option.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"option.index"}," w=f ph=lg pv=md cur=pointer bgc=",{type:1,path:"option.bgc"}," data-testid=",{type:1,path:"option.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=sm",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f bw=xs bc=mu bwt=sm",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-view#optionAdd w=f ph=lg pv=md cur=pointer bgc=${addOptionBgc} data-testid="select-add-option"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=ac",value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#optionAdd w=f ph=lg pv=md cur=pointer bgc=",{type:1,path:"addOptionBgc"},' data-testid="select-add-option"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," place=rs content-wh=300 content-g=xs content-sv=true content-pv=sm"]}}],fast:!1}],fast:!1}},rm={componentName:"rtgl-sidebar",propsSchema:{type:"object",properties:{mode:{type:"string"},hideHeader:{type:"boolean",default:!1},tooltip:{type:"boolean",default:!1},showCompactTooltip:{type:"boolean",default:!1,description:"Deprecated alias for tooltip. Use tooltip instead."},w:{type:"string"},bwr:{type:"string"},selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},testId:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{label:{type:"string"},title:{type:"string",description:"Deprecated item text field. Use label instead."},slug:{type:"string"},type:{type:"string",description:"Item row type. Supports item, groupLabel, divider, and spacer."},tooltip:{type:"string"},items:{type:"array"},testId:{type:"string"}}}}}},events:{"header-click":{type:"object",properties:{path:{type:"string"}}},"item-click":{type:"object",properties:{item:{type:"object"}}}},methods:{type:"object",properties:{}}},im={refs:{headerImage:{eventListeners:{click:{handler:"handleHeaderClick"}}},headerLabel:{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item*":{eventListeners:{click:{handler:"handleItemClick"},mouseenter:{handler:"handleItemMouseEnter"},mouseleave:{handler:"handleItemMouseLeave"}}}},anchors:[[{"$if header.image && header.image.src":[{"$if header.image.href":[{"a href=${header.image.href}":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],"$elif header.image.path":[{"rtgl-view#headerImage cur=pointer":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],$else:[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}]},{"$if header.label && showLabels":[{"$if header.labelHref":[{"rtgl-text href=${header.labelHref} s=lg":"${header.label}"}],"$elif header.labelPath":[{"rtgl-view#headerLabel cur=pointer":[{"rtgl-text s=lg":"${header.label}"}]}],$else:[{"rtgl-text s=lg":"${header.label}"}]}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=${sidebarWidth} d=v bwr=${rightBorderWidth} ah=${ah} ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if showHeader",value:{type:6,conditions:[{type:1,path:"showHeader"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view ph=${headerPadding} pv=lg",value:{type:9,items:[{type:8,properties:[{key:"$if header.href",value:{type:6,conditions:[{type:1,path:"header.href"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view href=${header.href} d=h av=c ah=${headerAlign} g=lg w=${headerWidth}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerImage cur=pointer",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerLabel cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view href=",{type:1,path:"header.href"}," d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c ah=${headerAlign} g=lg w=${headerWidth} cur=pointer data-testid=${header.testId}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerImage cur=pointer",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerLabel cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#header d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}," cur=pointer data-testid=",{type:1,path:"header.testId"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view ph=",{type:1,path:"headerPadding"}," pv=lg"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=f h=1fg ph=${headerPadding} pb=lg g=xs ah=${ah} ${listAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'$if item.type == "divider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"divider"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"spacer"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"groupLabel"}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f pv=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=1 w=f bgc=mu",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view h=1fg w=f",value:{type:0,value:null}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"$if showGroupLabels",value:{type:6,conditions:[{type:1,path:"showGroupLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=32 av=c ph=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=1 bgc=mu",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:'rtgl-view#item${i} data-item-id=${item.id} ${item.hrefAttr} h=${itemHeight} av=c ${itemAlignAttr} ph=${itemPadding} w=${itemWidth} h-bgc=${item.itemHoverBgc} br=lg bgc=${item.itemBgc} cur=pointer data-testid=${item.testId} aria-label="${item.label}"',value:{type:9,items:[{type:8,properties:[{key:"$if item.icon",value:{type:6,conditions:[{type:1,path:"item.icon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=${itemContentAlign} g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h ah=",{type:1,path:"itemContentAlign"}," g=sm"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=${iconSize} svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=",{type:1,path:"iconSize"}," svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=${iconSize} br=f bgc=mu av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=${firstLetterSize} c=fg",value:{type:1,path:"item.label.charAt(0).toUpperCase()"},parsedKey:{type:2,parts:["rtgl-text s=",{type:1,path:"firstLetterSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view wh=",{type:1,path:"iconSize"}," br=f bgc=mu av=c ah=c"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#item",{type:1,path:"i"}," data-item-id=",{type:1,path:"item.id"}," ",{type:1,path:"item.hrefAttr"}," h=",{type:1,path:"itemHeight"}," av=c ",{type:1,path:"itemAlignAttr"}," ph=",{type:1,path:"itemPadding"}," w=",{type:1,path:"itemWidth"}," h-bgc=",{type:1,path:"item.itemHoverBgc"}," br=lg bgc=",{type:1,path:"item.itemBgc"}," cur=pointer data-testid=",{type:1,path:"item.testId"},' aria-label="',{type:1,path:"item.label"},'"']}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=1fg ph=",{type:1,path:"headerPadding"}," pb=lg g=xs ah=",{type:1,path:"ah"}," ",{type:1,path:"listAttrString"}]}}],fast:!1},{type:8,properties:[{key:"$if enableCompactTooltip",value:{type:6,conditions:[{type:1,path:"enableCompactTooltip"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-tooltip#tooltip s="md" ?open=${tooltipState.open} x=${tooltipState.x} y=${tooltipState.y} place=${tooltipState.place} content="${tooltipState.content}"',value:{type:0,value:null},parsedKey:{type:2,parts:['rtgl-tooltip#tooltip s="md" ?open=',{type:1,path:"tooltipState.open"}," x=",{type:1,path:"tooltipState.x"}," y=",{type:1,path:"tooltipState.y"}," place=",{type:1,path:"tooltipState.place"},' content="',{type:1,path:"tooltipState.content"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{type:1,path:"sidebarWidth"}," d=v bwr=",{type:1,path:"rightBorderWidth"}," ah=",{type:1,path:"ah"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},nm={componentName:"rtgl-slider-input",propsSchema:{type:"object",properties:{key:{type:"string"},value:{type:"string",default:"0"},w:{type:"string",default:""},min:{type:"string",default:"0"},max:{type:"string",default:"100"},step:{type:"string",default:"1"},disabled:{type:"boolean",default:!1}}},events:{"value-input":{},"value-change":{}},methods:{type:"object",properties:{}}},om={refs:{input:{eventListeners:{"value-input":{handler:"handleValueInput"},"value-change":{handler:"handleValueChange"}}},slider:{eventListeners:{"value-change":{handler:"handleValueChange"},"value-input":{handler:"handleValueInput"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=${w}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-slider#slider key=${key} w=f type=range min=${min} max=${max} step=${step} value=${value} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider key=",{type:1,path:"key"}," w=f type=range min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=84",value:{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#input key=${key} w=f min=${min} max=${max} step=${step} value=${value} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#input key=",{type:1,path:"key"}," w=f min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md w=",{type:1,path:"w"}]}}],fast:!0}],fast:!0}},am={componentName:"rtgl-table",propsSchema:{type:"object",properties:{data:{type:"object",properties:{columns:{type:"array",items:{type:"object",properties:{key:{type:"string"},label:{type:"string"}}}},rows:{type:"array",items:{type:"object"}}}},responsive:{type:"boolean",default:!0}}},events:{},methods:{type:"object",properties:{}}},lm={refs:{"row*":{eventListeners:{click:{handler:"handleRowClick"}}},"header*":{eventListeners:{click:{handler:"handleHeaderClick"}}}},styles:{table:{width:"100%","border-collapse":"collapse","border-spacing":0},thead:{"border-bottom":"2px solid var(--border)"},th:{padding:"12px","text-align":"left","font-weight":500,color:"var(--foreground)","background-color":"var(--muted)",cursor:"pointer",position:"sticky",top:0,"z-index":1},"tbody tr":{"border-bottom":"1px solid var(--border)"},"tbody tr:last-child":{"border-bottom":"none"},td:{padding:"12px",color:"var(--foreground)"},".table-container":{width:"100%",height:"100%",overflow:"auto"},".empty-state":{"text-align":"center",padding:"24px",color:"var(--muted-foreground)"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view.table-container ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if rows.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"rows.length"},right:{type:0,value:0}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"table",value:{type:9,items:[{type:8,properties:[{key:"thead",value:{type:9,items:[{type:8,properties:[{key:"tr",value:{type:9,items:[{type:7,itemVar:"column",indexVar:"i",iterable:{type:1,path:"columns"},body:{type:9,items:[{type:8,properties:[{key:"th#header${i} data-column-key=${column.key}",value:{type:1,path:"column.label"},parsedKey:{type:2,parts:["th#header",{type:1,path:"i"}," data-column-key=",{type:1,path:"column.key"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"tbody",value:{type:9,items:[{type:7,itemVar:"row",indexVar:"rowIndex",iterable:{type:1,path:"rows"},body:{type:9,items:[{type:8,properties:[{key:"tr#row${rowIndex}",value:{type:9,items:[{type:7,itemVar:"cell",indexVar:"cellIndex",iterable:{type:1,path:"row.cells"},body:{type:9,items:[{type:8,properties:[{key:"td",value:{type:1,path:"cell.value"}}],fast:!0}],fast:!0},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["tr#row",{type:1,path:"rowIndex"}]}}],fast:!1}],fast:!1},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view.empty-state w=f p=xl",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"No data available"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view.table-container ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},pm={componentName:"rtgl-tabs",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},testId:{type:"string"}}}},selectedTab:{type:"string"}}},events:{"item-click":{type:"object",properties:{id:{type:"string"}}}},methods:{type:"object",properties:{}}},dm={refs:{"tab*":{eventListeners:{click:{handler:"handleClickItem"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm bgc=mu p=sm br=lg ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#tab${i} data-id=${item.id} cur=pointer bgc=${item.bgColor} bw=xs bc=${item.borderColor} pv=md ph=lg br=lg data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.textColor}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.textColor"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#tab",{type:1,path:"i"}," data-id=",{type:1,path:"item.id"}," cur=pointer bgc=",{type:1,path:"item.bgColor"}," bw=xs bc=",{type:1,path:"item.borderColor"}," pv=md ph=lg br=lg data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h g=sm bgc=mu p=sm br=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},cm={componentName:"rtgl-tag-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{type:{type:"string",enum:["section","item","separator"]},label:{type:"string"},value:{type:"any"},icon:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},testId:{type:"string"}}}},selectedValues:{type:"array",items:{type:"any"}},draftSelectedValues:{type:"array",items:{type:"any"}},open:{type:"boolean"},onChange:{type:"function"},addOption:{type:"object",properties:{label:{type:"string"}}},noAdd:{type:"boolean"},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"draft-value-change":{},"open-change":{},"add-option-click":{}},methods:{type:"object",properties:{refreshPopover:{description:"Recomputes the open popover position and rerenders the current options and draft values.",params:["values","keepOpen"],returns:"void"},setDraftSelectedValues:{description:"Replaces the draft-only selection without committing `selectedValues`; optionally reopens the popover around the trigger when `keepOpen` is true.",params:["values","keepOpen"],returns:"void"},appendDraftSelectedValue:{description:"Adds a value to the draft-only selection without committing `selectedValues`; optionally reopens the popover around the trigger when `keepOpen` is true.",params:["value","keepOpen"],returns:"void"}}}},um={refs:{trigger:{eventListeners:{click:{handler:"handleTriggerClick"},keydown:{handler:"handleTriggerKeyDown"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},"option*":{eventListeners:{click:{handler:"handleOptionClick"},keydown:{handler:"handleOptionKeyDown"}}},submitButton:{eventListeners:{click:{handler:"handleSubmitClick"}}},addOptionButton:{eventListeners:{click:{handler:"handleAddOptionClick"}}}},styles:{".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view#trigger d=h av=c g=sm cur=${triggerCursor} ${containerAttrString} data-testid="tag-select-trigger" role="button" tabindex=${triggerTabIndex} aria-disabled=${isDisabled} style="min-height: 24px;"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c wrap g=sm w=1fg",value:{type:9,items:[{type:7,itemVar:"tag",indexVar:"i",iterable:{type:1,path:"triggerTags"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-tag data-selection-index=${tag.selectionIndex} pre=${tag.icon} data-testid=${tag.testId} v=mu style="${tag.tagStyle}"',value:{type:1,path:"tag.label"},parsedKey:{type:2,parts:["rtgl-tag data-selection-index=",{type:1,path:"tag.selectionIndex"}," pre=",{type:1,path:"tag.icon"}," data-testid=",{type:1,path:"tag.testId"},' v=mu style="',{type:1,path:"tag.tagStyle"},'"']}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#trigger d=h av=c g=sm cur=",{type:1,path:"triggerCursor"}," ",{type:1,path:"containerAttrString"},' data-testid="tag-select-trigger" role="button" tabindex=',{type:1,path:"triggerTabIndex"}," aria-disabled=",{type:1,path:"isDisabled"},' style="min-height: 24px;"']}}],fast:!1},{type:8,properties:[{key:"$if isOpen",value:{type:6,conditions:[{type:1,path:"isOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=bs content-w=${position.w} content-g=sm content-sv=true content-ph=md content-pv=md",value:{type:9,items:[{type:8,properties:[{key:"$if !hasSelectableOptions",value:{type:6,conditions:[{type:5,op:0,operand:{type:1,path:"hasSelectableOptions"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:0,value:"No tags available"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h wrap g=sm w=f",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"$if option.isSection",value:{type:6,conditions:[{type:1,path:"option.isSection"},{type:1,path:"option.isItem"},{type:1,path:"option.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f pt=xs",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-view#option${option.index} cur=${option.cursor} data-testid=${option.testId} role="button" tabindex=0 aria-pressed=${option.isSelected}',value:{type:9,items:[{type:8,properties:[{key:'rtgl-tag v=mu pre=${option.icon} style="${option.tagStyle}"',value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-tag v=mu pre=",{type:1,path:"option.icon"},' style="',{type:1,path:"option.tagStyle"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"option.index"}," cur=",{type:1,path:"option.cursor"}," data-testid=",{type:1,path:"option.testId"},' role="button" tabindex=0 aria-pressed=',{type:1,path:"option.isSelected"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=xs",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-button#addOptionButton v=gh s=sm pre=plus data-testid="tag-select-add-option"',value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h av=c g=sm w=f pt=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-button#submitButton v=pr s=sm data-testid="tag-select-submit" ?disabled=${submitDisabled}',value:{type:1,path:"submitLabel"},parsedKey:{type:2,parts:['rtgl-button#submitButton v=pr s=sm data-testid="tag-select-submit" ?disabled=',{type:1,path:"submitDisabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," place=bs content-w=",{type:1,path:"position.w"}," content-g=sm content-sv=true content-ph=md content-pv=md"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}},hm={componentName:"rtgl-tooltip",propsSchema:{type:"object",properties:{open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},s:{type:"string",enum:["sm","md","lg"]},content:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},fm={template:{type:9,items:[{type:8,properties:[{key:'rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} no-overlay content-bgc=mu content-style="${contentStyle}"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view p=${padding} ah=s av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text ta=s s=${textSize} c=fg",value:{type:1,path:"content"},parsedKey:{type:2,parts:["rtgl-text ta=s s=",{type:1,path:"textSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view p=",{type:1,path:"padding"}," ah=s av=c"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," place=",{type:1,path:"place"},' no-overlay content-bgc=mu content-style="',{type:1,path:"contentStyle"},'"']}}],fast:!0}],fast:!0},refs:{}},ym={componentName:"rtgl-waveform",propsSchema:{type:"object",properties:{w:{type:"string",description:"Width of the waveform visualizer",default:"250"},h:{type:"string",description:"Height of the waveform visualizer",default:"150"},cur:{type:"string",description:"cursor"},waveformData:{type:"object",description:"File ID of the waveform data in object storage"},isLoading:{type:"boolean",description:"Whether the waveform data is currently being loaded"}}},events:[],methods:{type:"object",properties:{}}},mm={refs:{canvas:{selector:"canvas"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view pos=rel w=${w} h=${h} cur=${cur}",value:{type:9,items:[{type:8,properties:[{key:"$if isLoading",value:{type:6,conditions:[{type:1,path:"isLoading"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"..."}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'canvas#canvas style="width:100%; height:100%;"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view pos=rel w=",{type:1,path:"w"}," h=",{type:1,path:"h"}," cur=",{type:1,path:"cur"}]}}],fast:!1}],fast:!1}},x={};x.components={};x.components.accordionItem={};x.components.accordionItem.handlers=mo;x.components.accordionItem.schema=Ry;x.components.accordionItem.store=xo;x.components.accordionItem.view=jy;x.components.breadcrumb={};x.components.breadcrumb.handlers=Ao;x.components.breadcrumb.schema=Dy;x.components.breadcrumb.store=Vo;x.components.breadcrumb.view=Py;x.components.card={};x.components.card.schema=By;x.components.card.store=Po;x.components.card.view=zy;x.components.dropdownMenu={};x.components.dropdownMenu.handlers=Mo;x.components.dropdownMenu.schema=Wy;x.components.dropdownMenu.store=Yo;x.components.dropdownMenu.view=My;x.components.form={};x.components.form.handlers=fl;x.components.form.methods=Al;x.components.form.schema=Fy;x.components.form.store=rl;x.components.form.view=Ky;x.components.globalUi={};x.components.globalUi.handlers=Yl;x.components.globalUi.schema=Uy;x.components.globalUi.store=wp;x.components.globalUi.view=Hy;x.components.navbar={};x.components.navbar.handlers=xp;x.components.navbar.schema=qy;x.components.navbar.store=Op;x.components.navbar.view=Yy;x.components.pageOutline={};x.components.pageOutline.handlers=Np;x.components.pageOutline.schema=Gy;x.components.pageOutline.store=Mp;x.components.pageOutline.view=Jy;x.components.popoverInput={};x.components.popoverInput.handlers=Jp;x.components.popoverInput.schema=Zy;x.components.popoverInput.store=id;x.components.popoverInput.view=Xy;x.components.segmentedControl={};x.components.segmentedControl.handlers=hd;x.components.segmentedControl.schema=Qy;x.components.segmentedControl.store=Ed;x.components.segmentedControl.view=em;x.components.select={};x.components.select.handlers=Pd;x.components.select.schema=tm;x.components.select.store=rc;x.components.select.view=sm;x.components.sidebar={};x.components.sidebar.handlers=pc;x.components.sidebar.schema=rm;x.components.sidebar.store=xc;x.components.sidebar.view=im;x.components.sliderInput={};x.components.sliderInput.handlers=$c;x.components.sliderInput.schema=nm;x.components.sliderInput.store=Tc;x.components.sliderInput.view=om;x.components.table={};x.components.table.handlers=Rc;x.components.table.schema=am;x.components.table.store=Uc;x.components.table.view=lm;x.components.tabs={};x.components.tabs.handlers=qc;x.components.tabs.schema=pm;x.components.tabs.store=Xc;x.components.tabs.view=dm;x.components.tagSelect={};x.components.tagSelect.handlers=du;x.components.tagSelect.methods=fu;x.components.tagSelect.schema=cm;x.components.tagSelect.store=ju;x.components.tagSelect.view=um;x.components.tooltip={};x.components.tooltip.handlers=Du;x.components.tooltip.schema=hm;x.components.tooltip.store=zu;x.components.tooltip.view=fm;x.components.waveform={};x.components.waveform.handlers=Fu;x.components.waveform.schema=ym;x.components.waveform.store=qu;x.components.waveform.view=mm;Object.keys(x).forEach(e=>{Object.keys(x[e]).forEach(t=>{let s=x[e][t],r=Oy({...s},Ny[e]),i=s.schema?.componentName;if(!i)throw new Error(`[Build] Missing schema.componentName for ${e}/${t}. Define it in .schema.yaml.`);customElements.define(i,r)})});customElements.define("rtgl-button",sr({}));customElements.define("rtgl-carousel",ar({}));customElements.define("rtgl-grid",lr({}));customElements.define("rtgl-view",dr({}));customElements.define("rtgl-text",ur({}));customElements.define("rtgl-image",yr({}));customElements.define("rtgl-tag",gr({}));customElements.define("rtgl-svg",vr({}));customElements.define("rtgl-input",ve({}));customElements.define("rtgl-input-date",wr({}));customElements.define("rtgl-input-time",_r({}));customElements.define("rtgl-input-datetime",xr({}));customElements.define("rtgl-input-number",Sr({}));customElements.define("rtgl-textarea",Ar({}));customElements.define("rtgl-color-picker",kr({}));customElements.define("rtgl-slider",Er({}));customElements.define("rtgl-checkbox",$r({}));customElements.define("rtgl-dialog",Cr({}));customElements.define("rtgl-popover",Tr({}));})();
|
|
1532
|
+
`,Gs="data-rtgl-render-target",Cn="__rtglRenderTarget",Vs=e=>!e||typeof e!="object"?!1:typeof e.getAttribute=="function"?e.getAttribute(Gs)!==null:e[Cn]===!0,li=e=>{!e||typeof e!="object"||(typeof e.setAttribute=="function"?e.setAttribute(Gs,""):e[Cn]=!0)},Bf=e=>{if(!(!e||typeof e!="object"))return typeof e.querySelector=="function"?e.querySelector(`[${Gs}]`)??e.firstElementChild:Array.isArray(e.childNodes)?e.childNodes.find(Vs)??e.childNodes[0]:Array.isArray(e.children)?e.children.find(Vs)??e.children[0]:e.firstElementChild},zf=({host:e,cssText:t,createStyleSheet:s=()=>new CSSStyleSheet,createElement:r=i=>document.createElement(i)})=>{let i=e.shadowRoot??e.attachShadow({mode:"open"}),n=s();n.replaceSync(Pf);let o=[n];if(t){let a=s();a.replaceSync(t),o.push(a)}i.adoptedStyleSheets=o;let l=Bf(i);l?(l.style.cssText="display: contents;",Vs(l)||li(l)):(l=r("div"),l.style.cssText="display: contents;",li(l),i.appendChild(l)),l.parentNode!==i&&i.appendChild(l);let p=rn(e);return p&&typeof p=="object"&&(p.display="contents"),{shadow:i,renderTarget:l,adoptedStyleSheets:o}},Ns=(e,t=requestAnimationFrame)=>t(e),Wf=({scheduleFrameFn:e=Ns}={})=>({update:(t,s)=>{let r=t.data?.props||{},i=s.data?.props||{};if(JSON.stringify(r)===JSON.stringify(i))return;let n=s.elm;!n||typeof n.render!="function"||(n.setAttribute("isDirty","true"),e(()=>{if(n.render(),n.removeAttribute("isDirty"),n.handlers&&n.handlers.handleOnUpdate){let o={...n.deps,store:n.store,render:n.render.bind(n),handlers:n.handlers,dispatchEvent:n.dispatchEvent.bind(n),refs:n.refIds||{}};n.handlers.handleOnUpdate(o,{oldProps:r,newProps:i})}}))}}),Mf=({elementName:e,propsSchema:t,propsSchemaKeys:s,template:r,refs:i,styles:n,handlers:o,methods:l,constants:p,store:a,patch:c,h:d,deps:h})=>{class f extends HTMLElement{elementName;styles;_snabbdomH;store;props;propsSchema;template;handlers;methods;constants;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_globalListenersCleanup;_oldVNode;deps;_propsSchemaKeys=[];cssText;static get observedAttributes(){return["key"]}get viewData(){let m={};return this.store.selectViewData&&(m=this.store.selectViewData()),m}connectedCallback(){let m=zf({host:this,cssText:this.cssText});this.shadow=m.shadow,this.renderTarget=m.renderTarget,Vf({instance:this,parseAndRenderFn:fn,renderFn:this.render})}disconnectedCallback(){Nf({instance:this,clearTimerFn:clearTimeout})}attributeChangedCallback(m,b,g){Rf({instance:this,attributeName:m,oldValue:b,newValue:g,scheduleFrameFn:Ns})}render=()=>{Df({instance:this,createComponentUpdateHookFn:Wf})}}class u extends f{static get observedAttributes(){return If({propsSchemaKeys:s,toKebabCase:tn})}constructor(){super(),this.constants=Uh({setupConstants:h?.constants,fileConstants:p}),this.propsSchema=t,Zu({source:this,allowedKeys:s,onPropChange:({propName:m,oldValue:b,newValue:g})=>{jf({instance:this,propName:m,oldValue:b,newValue:g,scheduleFrameFn:Ns})}}),this.props=t?Xu(this,s):{},this._propsSchemaKeys=s,this.elementName=e,this.styles=n,this.store=Kh(a,this.props,this.constants),this.template=r,this.handlers=o,this.methods=l,this.refs=i,this.patch=c,this.deps={...h,store:this.store,render:this.render,handlers:o,props:this.props,constants:this.constants},Lh(this,this.methods),this._snabbdomH=d,this.cssText=Hh(e,n)}}return u};function st(e,t,s,r,i){let n=t===void 0?void 0:t.key;return{sel:e,data:t,children:s,text:r,elm:i,key:n}}var kt=Array.isArray;function yt(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function Ff(e,t){return document.createElement(e,t)}function Kf(e,t,s){return document.createElementNS(e,t,s)}function Uf(){return Ae(document.createDocumentFragment())}function Hf(e){return document.createTextNode(e)}function qf(e){return document.createComment(e)}function Yf(e,t,s){if(me(e)){let r=e;for(;r&&me(r);)r=Ae(r).parent;e=r??e}me(t)&&(t=Ae(t,e)),s&&me(s)&&(s=Ae(s).firstChildNode),e.insertBefore(t,s)}function Gf(e,t){e.removeChild(t)}function Jf(e,t){me(t)&&(t=Ae(t,e)),e.appendChild(t)}function In(e){if(me(e)){for(;e&&me(e);)e=Ae(e).parent;return e??null}return e.parentNode}function Zf(e){var t;if(me(e)){let s=Ae(e),r=In(s);if(r&&s.lastChildNode){let i=Array.from(r.childNodes),n=i.indexOf(s.lastChildNode);return(t=i[n+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function Xf(e){return e.tagName}function Qf(e,t){e.textContent=t}function ey(e){return e.textContent}function ty(e){return e.nodeType===1}function sy(e){return e.nodeType===3}function ry(e){return e.nodeType===8}function me(e){return e.nodeType===11}function Ae(e,t){var s,r,i;let n=e;return(s=n.parent)!==null&&s!==void 0||(n.parent=t??null),(r=n.firstChildNode)!==null&&r!==void 0||(n.firstChildNode=e.firstChild),(i=n.lastChildNode)!==null&&i!==void 0||(n.lastChildNode=e.lastChild),n}var iy={createElement:Ff,createElementNS:Kf,createTextNode:Hf,createDocumentFragment:Uf,createComment:qf,insertBefore:Yf,removeChild:Gf,appendChild:Jf,parentNode:In,nextSibling:Zf,tagName:Xf,setTextContent:Qf,getTextContent:ey,isElement:ty,isText:sy,isComment:ry,isDocumentFragment:me};function ft(e){return e===void 0}function se(e){return e!==void 0}var fs=st("",{},[],void 0,void 0);function Ze(e,t){var s,r;let i=e.key===t.key,n=((s=e.data)===null||s===void 0?void 0:s.is)===((r=t.data)===null||r===void 0?void 0:r.is),o=e.sel===t.sel,l=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return o&&i&&n&&l}function ny(){throw new Error("The document fragment is not supported on this platform.")}function oy(e,t){return e.isElement(t)}function ay(e,t){return e.isDocumentFragment(t)}function ly(e,t,s){var r;let i={};for(let n=t;n<=s;++n){let o=(r=e[n])===null||r===void 0?void 0:r.key;o!==void 0&&(i[o]=n)}return i}var py=["create","update","remove","destroy","pre","post"];function dy(e,t,s){let r={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=iy;for(let u of py)for(let y of e){let m=y[u];m!==void 0&&r[u].push(m)}function n(u){let y=u.id?"#"+u.id:"",m=u.getAttribute("class"),b=m?"."+m.split(" ").join("."):"";return st(i.tagName(u).toLowerCase()+y+b,{},[],void 0,u)}function o(u){return st(void 0,{},[],void 0,u)}function l(u,y){return function(){if(--y===0){let m=i.parentNode(u);m!==null&&i.removeChild(m,u)}}}function p(u,y){var m,b,g,_;let S,A=u.data;if(A!==void 0){let I=(m=A.hook)===null||m===void 0?void 0:m.init;se(I)&&(I(u),A=u.data)}let k=u.children,C=u.sel;if(C==="!")ft(u.text)&&(u.text=""),u.elm=i.createComment(u.text);else if(C==="")u.elm=i.createTextNode(u.text);else if(C!==void 0){let I=C.indexOf("#"),V=C.indexOf(".",I),z=I>0?I:C.length,B=V>0?V:C.length,J=I!==-1||V!==-1?C.slice(0,Math.min(z,B)):C,Z=u.elm=se(A)&&se(S=A.ns)?i.createElementNS(S,J,A):i.createElement(J,A);for(z<B&&Z.setAttribute("id",C.slice(z+1,B)),V>0&&Z.setAttribute("class",C.slice(B+1).replace(/\./g," ")),S=0;S<r.create.length;++S)r.create[S](fs,u);if(yt(u.text)&&(!kt(k)||k.length===0)&&i.appendChild(Z,i.createTextNode(u.text)),kt(k))for(S=0;S<k.length;++S){let we=k[S];we!=null&&i.appendChild(Z,p(we,y))}let ge=u.data.hook;se(ge)&&((b=ge.create)===null||b===void 0||b.call(ge,fs,u),ge.insert&&y.push(u))}else if(!((g=void 0)===null||g===void 0)&&g.fragments&&u.children){for(u.elm=((_=i.createDocumentFragment)!==null&&_!==void 0?_:ny)(),S=0;S<r.create.length;++S)r.create[S](fs,u);for(S=0;S<u.children.length;++S){let I=u.children[S];I!=null&&i.appendChild(u.elm,p(I,y))}}else u.elm=i.createTextNode(u.text);return u.elm}function a(u,y,m,b,g,_){for(;b<=g;++b){let S=m[b];S!=null&&i.insertBefore(u,p(S,_),y)}}function c(u){var y,m;let b=u.data;if(b!==void 0){(m=(y=b?.hook)===null||y===void 0?void 0:y.destroy)===null||m===void 0||m.call(y,u);for(let g=0;g<r.destroy.length;++g)r.destroy[g](u);if(u.children!==void 0)for(let g=0;g<u.children.length;++g){let _=u.children[g];_!=null&&typeof _!="string"&&c(_)}}}function d(u,y,m,b){for(var g,_;m<=b;++m){let S,A,k=y[m];if(k!=null)if(se(k.sel)){c(k),S=r.remove.length+1,A=l(k.elm,S);for(let I=0;I<r.remove.length;++I)r.remove[I](k,A);let C=(_=(g=k?.data)===null||g===void 0?void 0:g.hook)===null||_===void 0?void 0:_.remove;se(C)?C(k,A):A()}else k.children?(c(k),d(u,k.children,0,k.children.length-1)):i.removeChild(u,k.elm)}}function h(u,y,m,b){let g=0,_=0,S=y.length-1,A=y[0],k=y[S],C=m.length-1,I=m[0],V=m[C],z,B,J,Z;for(;g<=S&&_<=C;)A==null?A=y[++g]:k==null?k=y[--S]:I==null?I=m[++_]:V==null?V=m[--C]:Ze(A,I)?(f(A,I,b),A=y[++g],I=m[++_]):Ze(k,V)?(f(k,V,b),k=y[--S],V=m[--C]):Ze(A,V)?(f(A,V,b),i.insertBefore(u,A.elm,i.nextSibling(k.elm)),A=y[++g],V=m[--C]):Ze(k,I)?(f(k,I,b),i.insertBefore(u,k.elm,A.elm),k=y[--S],I=m[++_]):(z===void 0&&(z=ly(y,g,S)),B=z[I.key],ft(B)?(i.insertBefore(u,p(I,b),A.elm),I=m[++_]):ft(z[V.key])?(i.insertBefore(u,p(V,b),i.nextSibling(k.elm)),V=m[--C]):(J=y[B],J.sel!==I.sel?i.insertBefore(u,p(I,b),A.elm):(f(J,I,b),y[B]=void 0,i.insertBefore(u,J.elm,A.elm)),I=m[++_]));_<=C&&(Z=m[C+1]==null?null:m[C+1].elm,a(u,Z,m,_,C,b)),g<=S&&d(u,y,g,S)}function f(u,y,m){var b,g,_,S,A,k,C,I;let V=(b=y.data)===null||b===void 0?void 0:b.hook;(g=V?.prepatch)===null||g===void 0||g.call(V,u,y);let z=y.elm=u.elm;if(u===y)return;if(y.data!==void 0||se(y.text)&&y.text!==u.text){(_=y.data)!==null&&_!==void 0||(y.data={}),(S=u.data)!==null&&S!==void 0||(u.data={});for(let Z=0;Z<r.update.length;++Z)r.update[Z](u,y);(C=(k=(A=y.data)===null||A===void 0?void 0:A.hook)===null||k===void 0?void 0:k.update)===null||C===void 0||C.call(k,u,y)}let B=u.children,J=y.children;ft(y.text)?se(B)&&se(J)?B!==J&&h(z,B,J,m):se(J)?(se(u.text)&&i.setTextContent(z,""),a(z,null,J,0,J.length-1,m)):se(B)?d(z,B,0,B.length-1):se(u.text)&&i.setTextContent(z,""):u.text!==y.text&&(se(B)&&d(z,B,0,B.length-1),i.setTextContent(z,y.text)),(I=V?.postpatch)===null||I===void 0||I.call(V,u,y)}return function(u,y){let m,b,g,_=[];for(m=0;m<r.pre.length;++m)r.pre[m]();for(oy(i,u)?u=n(u):ay(i,u)&&(u=o(u)),Ze(u,y)?f(u,y,_):(b=u.elm,g=i.parentNode(b),p(y,_),g!==null&&(i.insertBefore(g,y.elm,i.nextSibling(b)),d(g,[u],0,0))),m=0;m<_.length;++m)_[m].data.hook.insert(_[m]);for(m=0;m<r.post.length;++m)r.post[m]();return y}}function pi(e,t){let s,r,i=t.elm,n=e.data.class,o=t.data.class;if(!(!n&&!o)&&n!==o){n=n||{},o=o||{};for(r in n)n[r]&&!Object.prototype.hasOwnProperty.call(o,r)&&i.classList.remove(r);for(r in o)s=o[r],s!==n[r]&&i.classList[s?"add":"remove"](r)}}var cy={create:pi,update:pi};function di(e,t){let s,r,i,n=t.elm,o=e.data.props,l=t.data.props;if(!(!o&&!l)&&o!==l){o=o||{},l=l||{};for(s in l)r=l[s],i=o[s],i!==r&&(s!=="value"||n[s]!==r)&&(n[s]=r)}}var uy={create:di,update:di},hy="http://www.w3.org/1999/xlink",fy="http://www.w3.org/2000/xmlns/",yy="http://www.w3.org/XML/1998/namespace",ci=58,my=120,gy=109;function ui(e,t){let s,r=t.elm,i=e.data.attrs,n=t.data.attrs;if(!(!i&&!n)&&i!==n){i=i||{},n=n||{};for(s in n){let o=n[s];i[s]!==o&&(o===!0?r.setAttribute(s,""):o===!1?r.removeAttribute(s):s.charCodeAt(0)!==my?r.setAttribute(s,o):s.charCodeAt(3)===ci?r.setAttributeNS(yy,s,o):s.charCodeAt(5)===ci?s.charCodeAt(1)===gy?r.setAttributeNS(fy,s,o):r.setAttributeNS(hy,s,o):r.setAttribute(s,o))}for(s in i)s in n||r.removeAttribute(s)}}var by={create:ui,update:ui},hi=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,vy=function(e){hi(function(){hi(e)})},Rs=!1;function wy(e,t,s){vy(function(){e[t]=s})}function fi(e,t){let s,r,i=t.elm,n=e.data.style,o=t.data.style;if(!n&&!o||n===o)return;n=n||{},o=o||{};let l="delayed"in n;for(r in n)r in o||(r[0]==="-"&&r[1]==="-"?i.style.removeProperty(r):i.style[r]="");for(r in o)if(s=o[r],r==="delayed"&&o.delayed)for(let p in o.delayed)s=o.delayed[p],(!l||s!==n.delayed[p])&&wy(i.style,p,s);else r!=="remove"&&s!==n[r]&&(r[0]==="-"&&r[1]==="-"?i.style.setProperty(r,s):i.style[r]=s)}function _y(e){let t,s,r=e.elm,i=e.data.style;if(!(!i||!(t=i.destroy)))for(s in t)r.style[s]=t[s]}function xy(e,t){let s=e.data.style;if(!s||!s.remove){t();return}Rs||(e.elm.offsetLeft,Rs=!0);let r,i=e.elm,n=0,o=s.remove,l=0,p=[];for(r in o)p.push(r),i.style[r]=o[r];let a=getComputedStyle(i)["transition-property"].split(", ");for(;n<a.length;++n)p.indexOf(a[n])!==-1&&l++;i.addEventListener("transitionend",function(c){c.target===i&&--l,l===0&&t()})}function Sy(){Rs=!1}var Ay={pre:Sy,create:fi,update:fi,destroy:_y,remove:xy};function On(e,t,s){if(typeof e=="function")e.call(t,s,t);else if(typeof e=="object")for(let r=0;r<e.length;r++)On(e[r],t,s)}function ky(e,t){let s=e.type,r=t.data.on;r&&r[s]&&On(r[s],t,e)}function Ey(){return function e(t){ky(t,e.vnode)}}function ys(e,t){let s=e.data.on,r=e.listener,i=e.elm,n=t&&t.data.on,o=t&&t.elm,l;if(s!==n){if(s&&r)if(n)for(l in s)n[l]||i.removeEventListener(l,r,!1);else for(l in s)i.removeEventListener(l,r,!1);if(n){let p=t.listener=e.listener||Ey();if(p.vnode=t,s)for(l in n)s[l]||o.addEventListener(l,p,!1);else for(l in n)o.addEventListener(l,p,!1)}}}var $y={create:ys,update:ys,destroy:ys},Cy=()=>dy([cy,uy,by,Ay,$y]);function Tn(e,t,s){if(e.ns="http://www.w3.org/2000/svg",s!=="foreignObject"&&t!==void 0)for(let r=0;r<t.length;++r){let i=t[r];if(typeof i=="string")continue;let n=i.data;n!==void 0&&Tn(n,i.children,i.sel)}}function Iy(e,t,s){let r={},i,n,o;if(s!==void 0?(t!==null&&(r=t),kt(s)?i=s:yt(s)?n=s.toString():s&&s.sel&&(i=[s])):t!=null&&(kt(t)?i=t:yt(t)?n=t.toString():t&&t.sel?i=[t]:r=t),i!==void 0)for(o=0;o<i.length;++o)yt(i[o])&&(i[o]=st(void 0,void 0,void 0,i[o],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&Tn(r,i,e),st(e,r,i,n,void 0)}var Oy=Cy(),Ty=({handlers:e,methods:t,constants:s,schema:r,view:i,store:n},o)=>{if(!i)throw new Error("view is not defined");if(!r||typeof r!="object"||Array.isArray(r))throw new Error("schema is required. Define component metadata in .schema.yaml.");let l=r,{template:p,refs:a,styles:c}=i;Qu({schema:l,methodExports:Object.keys(t||{})});let d=l.componentName,h=l.propsSchema,f=h?.properties?[...new Set(Object.keys(h.properties).map(u=>sn(u)))]:[];return Mf({elementName:d,propsSchema:h,propsSchemaKeys:f,template:p,refs:a,styles:c,handlers:e,methods:t,constants:s,store:n,patch:Oy,h:Iy,deps:o})},Ly=e=>{let t={};return{once:(s,r)=>{t[s]||(t[s]=[]);let i=(...n)=>{r(...n),t[s]=t[s].filter(o=>o!==i)};return t[s].push(i),()=>{t[s]=(t[s]??[]).filter(n=>n!==i)}},emit:(s,...r)=>{t[s]&&[...t[s]].forEach(i=>{i(...r)})},showAlert:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showConfirm:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showFormDialog:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showComponentDialog:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showDropdownMenu:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showToast:s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},closeAll:async()=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")}}},Vy=Ly(),Ny={globalUI:Vy},Ry={components:Ny},jy={componentName:"rtgl-accordion-item",propsSchema:{type:"object",properties:{label:{type:"string"},content:{type:"string"},w:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},Dy={refs:{header:{eventListeners:{click:{handler:"handleClickHeader"}}}},styles:{".content-wrapper":{display:"grid","grid-template-rows":"0fr",transition:"grid-template-rows 0.2s ease-out"},".content-wrapper.open":{"grid-template-rows":"1fr"},".content-inner":{overflow:"hidden"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=v ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c w=f pv=md cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-svg svg=${chevronIcon} wh=16 c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg svg=",{type:1,path:"chevronIcon"}," wh=16 c=mu-fg"]}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:'div class="${openClass}"',value:{type:9,items:[{type:8,properties:[{key:"div class=content-inner",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view pb=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"content"}}],fast:!0},{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['div class="',{type:1,path:"openClass"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=v ",{type:1,path:"containerAttrString"}]}}],fast:!0}],fast:!0}},Py={componentName:"rtgl-breadcrumb",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},href:{type:"string"},path:{type:"string"},current:{type:"boolean"},disabled:{type:"boolean"},click:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"}}}},sep:{type:"string",default:"breadcrumb-arrow"},max:{type:"number"}}},events:{"item-click":{type:"object",properties:{id:{type:"string"},path:{type:"string"},href:{type:"string"},item:{type:"object"},index:{type:"number"},trigger:{type:"string"}}}},methods:{type:"object",properties:{}}},By={refs:{"item*":{eventListeners:{click:{handler:"handleClickItem"}}}},styles:{a:{"text-decoration":"none",color:"inherit"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md p=sm ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isSeparator",value:{type:6,conditions:[{type:1,path:"item.isSeparator"},{type:1,path:"item.isEllipsis"},{type:4,op:6,left:{type:1,path:"item.isInteractive"},right:{type:1,path:"item.href"}},{type:1,path:"item.isInteractive"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${sep} c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"sep"}," c=mu-fg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#item${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#item",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#item${i} data-index=${item.index} cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#item",{type:1,path:"i"}," data-index=",{type:1,path:"item.index"}," cur=pointer"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md p=sm ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},zy={componentName:"rtgl-card",propsSchema:{type:"object",properties:{head:{type:"string"},desc:{type:"string"},size:{type:"string",enum:["sm","md","lg"]}}},events:[],methods:{type:"object",properties:{}}},Wy={styles:{":host":{display:"block"},slot:{display:"block","min-width":0},".rtgl-card-body":{"min-width":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="rtgl-card" d=v w=f bgc=bg bw=xs bc=bo br=xl shadow=sm ${cardAttrString} ${containerAttrString}',value:{type:9,items:[{type:8,properties:[{key:"$if hasHeader",value:{type:6,conditions:[{type:1,path:"hasHeader"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="rtgl-card-header" d=v w=f ${headerAttrString}',value:{type:9,items:[{type:8,properties:[{key:"$if head",value:{type:6,conditions:[{type:1,path:"head"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-text class="rtgl-card-heading" s=${headingSize} w=f',value:{type:1,path:"head"},parsedKey:{type:2,parts:['rtgl-text class="rtgl-card-heading" s=',{type:1,path:"headingSize"}," w=f"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if desc",value:{type:6,conditions:[{type:1,path:"desc"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-text class="rtgl-card-desc" s=${subheadingSize} c=mu-fg w=f',value:{type:1,path:"desc"},parsedKey:{type:2,parts:['rtgl-text class="rtgl-card-desc" s=',{type:1,path:"subheadingSize"}," c=mu-fg w=f"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:['rtgl-view class="rtgl-card-header" d=v w=f ',{type:1,path:"headerAttrString"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"div class=rtgl-card-body",value:{type:9,items:[{type:8,properties:[{key:"slot",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:['rtgl-view class="rtgl-card" d=v w=f bgc=bg bw=xs bc=bo br=xl shadow=sm ',{type:1,path:"cardAttrString"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},My={componentName:"rtgl-dropdown-menu",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["section","item","separator","label"]},id:{type:"string"},icon:{type:"string"},path:{type:"string"},href:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},disabled:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"},testId:{type:"string"}}}},open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},w:{type:"string"},h:{type:"string"}}},events:{close:{type:"object"},"item-click":{type:"object",properties:{index:{type:"number"},item:{type:"object"},id:{type:"string"},path:{type:"string"},href:{type:"string"},trigger:{type:"string"}}}},methods:{type:"object",properties:{}}},Fy={refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},styles:{a:{display:"block",width:"100%","text-decoration":"none",color:"inherit"},".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} content-w=${w} content-h=${h} content-sv=true content-g=xs content-pv=sm",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isSection",value:{type:6,conditions:[{type:1,path:"item.isSection"},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.isDisabled"}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:4,op:6,left:{type:1,path:"item.hasHref"},right:{type:1,path:"item.linkExtraAttrs"}}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.hasHref"}},{type:1,path:"item.isItem"},{type:1,path:"item.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f p=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=sm",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," place=",{type:1,path:"place"}," content-w=",{type:1,path:"w"}," content-h=",{type:1,path:"h"}," content-sv=true content-g=xs content-pv=sm"]}}],fast:!1}],fast:!1}},Ky={componentName:"rtgl-form",propsSchema:{type:"object",properties:{form:{type:"object"},defaultValues:{type:"object"},context:{type:"object"},disabled:{type:"boolean"}}},events:{"form-input":{},"form-change":{},"form-field-event":{},"form-action":{}},methods:{type:"object",properties:{getValues:{type:"function"},setValues:{type:"function"},validate:{type:"function"},reset:{type:"function"}}}},Uy={refs:{formContainer:{eventListeners:{keydown:{handler:"handleKeyDown"}}},"action*":{eventListeners:{click:{handler:"handleActionClick"}}},"tooltipIcon*":{eventListeners:{mouseenter:{handler:"handleTooltipMouseEnter"},mouseleave:{handler:"handleTooltipMouseLeave"}}},"field*":{eventListeners:{"value-input":{handler:"handleValueInput"},"value-change":{handler:"handleValueChange"}}},"image*":{eventListeners:{click:{handler:"handleImageClick"},contextmenu:{handler:"handleImageClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#formContainer w=f p=md g=lg ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if title",value:{type:6,conditions:[{type:1,path:"title"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"title"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if description",value:{type:6,conditions:[{type:1,path:"description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view g=lg w=f",value:{type:9,items:[{type:7,itemVar:"field",indexVar:"i",iterable:{type:1,path:"flatFields"},body:{type:9,items:[{type:8,properties:[{key:"$if field._isSection",value:{type:6,conditions:[{type:1,path:"field._isSection"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"$if field.label",value:{type:6,conditions:[{type:1,path:"field.label"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=md",value:{type:1,path:"field.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.description",value:{type:6,conditions:[{type:1,path:"field.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if !field._isSection",value:{type:6,conditions:[{type:5,op:0,operand:{type:1,path:"field._isSection"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=f",value:{type:9,items:[{type:8,properties:[{key:"$if field.label || field.description",value:{type:6,conditions:[{type:4,op:7,left:{type:1,path:"field.label"},right:{type:1,path:"field.description"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=md av=c",value:{type:9,items:[{type:8,properties:[{key:"$if field.label",value:{type:6,conditions:[{type:1,path:"field.label"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"field.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.required",value:{type:6,conditions:[{type:1,path:"field.required"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=fg s=sm",value:{type:0,value:"*"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.tooltip",value:{type:6,conditions:[{type:1,path:"field.tooltip"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#tooltipIcon${field._idx} data-field-name=${field.name} svg="info" wh=16 c=mu-fg cur=help ml=xs',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg#tooltipIcon",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' svg="info" wh=16 c=mu-fg cur=help ml=xs']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if field.description",value:{type:6,conditions:[{type:1,path:"field.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#field${field._idx} data-field-name=${field.name} w=f type=${field._inputType} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f type=",{type:1,path:"field._inputType"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-date"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-date"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-date#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-date#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-time"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-time"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-time#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-time#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-datetime"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-datetime"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-datetime#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-datetime#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-number"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-number"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-textarea"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-textarea"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-textarea#field${field._idx} data-field-name=${field.name} w=f rows=${field.rows} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-textarea#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f rows=",{type:1,path:"field.rows"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-select#field${field._idx} data-field-name=${field.name} w=f :options=${field.options} ?no-clear=${field.noClear} :selectedValue=${field._selectedValue} :placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=",{type:1,path:"field.options"}," ?no-clear=",{type:1,path:"field.noClear"}," :selectedValue=",{type:1,path:"field._selectedValue"}," :placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "tag-select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"tag-select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-tag-select#field${field._idx} data-field-name=${field.name} w=f :options=${field.options} :selectedValues=${field._selectedValues} :placeholder=${field.placeholder} :addOption=${field.addOption} ?no-add=${field.noAdd} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-tag-select#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=",{type:1,path:"field.options"}," :selectedValues=",{type:1,path:"field._selectedValues"}," :placeholder=",{type:1,path:"field.placeholder"}," :addOption=",{type:1,path:"field.addOption"}," ?no-add=",{type:1,path:"field.noAdd"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "segmented-control"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"segmented-control"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-segmented-control#field${field._idx} data-field-name=${field.name} w=f :options=${field.options} ?no-clear=${field.noClear} :selectedValue=${field._selectedValue} :placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-segmented-control#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=",{type:1,path:"field.options"}," ?no-clear=",{type:1,path:"field.noClear"}," :selectedValue=",{type:1,path:"field._selectedValue"}," :placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "color-picker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"color-picker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#field${field._idx} data-field-name=${field.name} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slider"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slider-with-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slider-with-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider-input#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "popover-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"popover-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-popover-input#field${field._idx} data-field-name=${field.name} label="${field.label}" placeholder=${field.placeholder} ?disabled=${field._disabled}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-popover-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field.label"},'" placeholder=',{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "checkbox"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"checkbox"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-checkbox#field${field._idx} data-field-name=${field.name} label="${field._checkboxText}" ?disabled=${field._disabled}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-checkbox#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field._checkboxText"},'" ?disabled=',{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "image" && field._imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"image"}},right:{type:1,path:"field._imageSrc"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image#image${field._idx} data-field-name=${field.name} src=${field._imageSrc} w=${field.width} h=${field.height} cur=pointer",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image#image",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," src=",{type:1,path:"field._imageSrc"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=pointer"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "image" && !field._imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"image"}},right:{type:5,op:0,operand:{type:1,path:"field._imageSrc"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#image${field._idx} data-field-name=${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=pointer p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg ta=c",value:{type:1,path:"field.placeholderText"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#image",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," bc=ac bw=sm ah=c av=c cur=pointer p=md"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "read-only-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"read-only-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"field.content"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slot"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slot"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'slot#fieldSlot${field._idx} name=${field.slot} style="display: contents;"',value:{type:0,value:null},parsedKey:{type:2,parts:["slot#fieldSlot",{type:1,path:"field._idx"}," name=",{type:1,path:"field.slot"},' style="display: contents;"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field._error",value:{type:6,conditions:[{type:1,path:"field._error"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=de",value:{type:1,path:"field._error"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if actions.buttons.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"actions.buttons.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'$if actions._layout == "split"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"split"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h w=f g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._leftButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=sm ah=e w=1fg",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._rightButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if actions._layout == "vertical"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"vertical"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._allButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} w=f ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," w=f ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if actions._layout == "stretch"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"stretch"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._allButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} w=f ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," w=f ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'rtgl-tooltip ?open=${tooltipState.open} x=${tooltipState.x} y=${tooltipState.y} place="t" content="${tooltipState.content}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-tooltip ?open=",{type:1,path:"tooltipState.open"}," x=",{type:1,path:"tooltipState.x"}," y=",{type:1,path:"tooltipState.y"},' place="t" content="',{type:1,path:"tooltipState.content"},'"']}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#formContainer w=f p=md g=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Hy={componentName:"rtgl-global-ui",propsSchema:{type:"object",properties:{}},events:[],methods:{type:"object",properties:{}}},qy={refs:{dialog:{eventListeners:{close:{handler:"handleDialogClose"}}},confirmButton:{eventListeners:{click:{handler:"handleConfirm"}}},cancelButton:{eventListeners:{click:{handler:"handleCancel"}}},componentDialogBodyHost:{},"componentDialogAction*":{eventListeners:{click:{handler:"handleComponentDialogAction"}}},formDialog:{eventListeners:{"form-action":{handler:"handleFormAction"},"form-field-event":{handler:"handleFormFieldEvent"}}},dropdownMenu:{eventListeners:{close:{handler:"handleDropdownClose"},"item-click":{handler:"handleDropdownItemClick"}}}},styles:{".toast-layer":{"pointer-events":"none"},".toast-card":{"pointer-events":"auto","box-sizing":"border-box",width:"33vw","max-width":"calc(100vw - 2 * var(--spacing-lg))",opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 180ms cubic-bezier(0.16, 1, 0.3, 1), transform 180ms cubic-bezier(0.16, 1, 0.3, 1)","will-change":"opacity, transform"},".toast-card-top":{animation:"toast-in-top 220ms cubic-bezier(0.16, 1, 0.3, 1)"},".toast-card-bottom":{animation:"toast-in-bottom 220ms cubic-bezier(0.16, 1, 0.3, 1)"},".toast-card-md":{width:"50vw"},".toast-card-lg":{width:"80vw"},".toast-card-top.toast-card-exiting":{opacity:0,transform:"translateY(calc(var(--spacing-sm) * -0.5)) scale(0.98)"},".toast-card-bottom.toast-card-exiting":{opacity:0,transform:"translateY(calc(var(--spacing-sm) * 0.5)) scale(0.98)"},".toast-message":{"overflow-wrap":"anywhere"},"@keyframes toast-in-top":{from:{opacity:0,transform:"translateY(calc(var(--spacing-sm) * -1)) scale(0.96)"},to:{opacity:1,transform:"translateY(0) scale(1)"}},"@keyframes toast-in-bottom":{from:{opacity:0,transform:"translateY(var(--spacing-sm)) scale(0.96)"},to:{opacity:1,transform:"translateY(0) scale(1)"}},"@media (prefers-reduced-motion: reduce)":{".toast-card":{animation:"none",transition:"none"}}},template:{type:9,items:[{type:8,properties:[{key:"$if topToasts.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"topToasts.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-layer toast-layer-top" pos=fix edge=t z=2100 w=f ah=c g=sm ph=md pt=xl',value:{type:9,items:[{type:7,itemVar:"toast",indexVar:"i",iterable:{type:1,path:"topToasts"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-card toast-card-top toast-card-${toast.size} toast-card-${toast.phase}" key=toast-${toast.id} bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text class=toast-message ta=c w=f",value:{type:1,path:"toast.message"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view class="toast-card toast-card-top toast-card-',{type:1,path:"toast.size"}," toast-card-",{type:1,path:"toast.phase"},'" key=toast-',{type:1,path:"toast.id"}," bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if bottomToasts.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"bottomToasts.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-layer toast-layer-bottom" pos=fix edge=b z=2100 w=f ah=c g=sm ph=md pb=xl',value:{type:9,items:[{type:7,itemVar:"toast",indexVar:"i",iterable:{type:1,path:"bottomToasts"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-card toast-card-bottom toast-card-${toast.size} toast-card-${toast.phase}" key=toast-${toast.id} bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text class=toast-message ta=c w=f",value:{type:1,path:"toast.message"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view class="toast-card toast-card-bottom toast-card-',{type:1,path:"toast.size"}," toast-card-",{type:1,path:"toast.phase"},'" key=toast-',{type:1,path:"toast.id"}," bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-dialog#dialog ?open=${isDialogContainerOpen} s=${dialogSize}",value:{type:9,items:[{type:8,properties:[{key:"$if isFormDialogOpen",value:{type:6,conditions:[{type:1,path:"isFormDialogOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-form#formDialog slot=content :form=${formDialogConfig.form} :defaultValues=${formDialogConfig.defaultValues} :context=${formDialogConfig.context} ?disabled=${formDialogConfig.disabled} key=form-dialog-${formDialogConfig.key}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-form#formDialog slot=content :form=",{type:1,path:"formDialogConfig.form"}," :defaultValues=",{type:1,path:"formDialogConfig.defaultValues"}," :context=",{type:1,path:"formDialogConfig.context"}," ?disabled=",{type:1,path:"formDialogConfig.disabled"}," key=form-dialog-",{type:1,path:"formDialogConfig.key"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if isComponentDialogOpen",value:{type:6,conditions:[{type:1,path:"isComponentDialogOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"$if componentDialogConfig.title || componentDialogConfig.description",value:{type:6,conditions:[{type:4,op:7,left:{type:1,path:"componentDialogConfig.title"},right:{type:1,path:"componentDialogConfig.description"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if componentDialogConfig.title",value:{type:6,conditions:[{type:1,path:"componentDialogConfig.title"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"componentDialogConfig.title"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if componentDialogConfig.description",value:{type:6,conditions:[{type:1,path:"componentDialogConfig.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"componentDialogConfig.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view#componentDialogBodyHost w=f key=component-dialog-body-${componentDialogConfig.key}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view#componentDialogBodyHost w=f key=component-dialog-body-",{type:1,path:"componentDialogConfig.key"}]}}],fast:!0},{type:8,properties:[{key:"$if componentDialogConfig.actions.buttons.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"componentDialogConfig.actions.buttons.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h w=f g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"componentDialogConfig.actions._leftButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#componentDialogAction${button._globalIdx} data-action-id=${button.id} data-action-index=${button._globalIdx} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#componentDialogAction",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," data-action-index=",{type:1,path:"button._globalIdx"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=sm ah=e w=1fg",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"componentDialogConfig.actions._rightButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#componentDialogAction${button._globalIdx} data-action-id=${button.id} data-action-index=${button._globalIdx} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#componentDialogAction",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," data-action-index=",{type:1,path:"button._globalIdx"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if !isFormDialogOpen && !isComponentDialogOpen",value:{type:6,conditions:[{type:4,op:6,left:{type:5,op:0,operand:{type:1,path:"isFormDialogOpen"}},right:{type:5,op:0,operand:{type:1,path:"isComponentDialogOpen"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if config.title",value:{type:6,conditions:[{type:1,path:"config.title"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"config.title"}}],fast:!0},{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=md mt=lg w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"$if config.mode == 'confirm'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"config.mode"},right:{type:0,value:"confirm"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-button#cancelButton v=se",value:{type:1,path:"config.cancelText"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-button#confirmButton v=pr",value:{type:1,path:"config.confirmText"}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-dialog#dialog ?open=",{type:1,path:"isDialogContainerOpen"}," s=",{type:1,path:"dialogSize"}]}}],fast:!1},{type:8,properties:[{key:"rtgl-dropdown-menu#dropdownMenu ?open=${isDropdownOpen} x=${dropdownConfig.x} y=${dropdownConfig.y} place=${dropdownConfig.place} :items=${dropdownConfig.items} key=dropdown-${isDropdownOpen}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-dropdown-menu#dropdownMenu ?open=",{type:1,path:"isDropdownOpen"}," x=",{type:1,path:"dropdownConfig.x"}," y=",{type:1,path:"dropdownConfig.y"}," place=",{type:1,path:"dropdownConfig.place"}," :items=",{type:1,path:"dropdownConfig.items"}," key=dropdown-",{type:1,path:"isDropdownOpen"}]}}],fast:!0}],fast:!1}},Yy={componentName:"rtgl-navbar",propsSchema:{type:"object",properties:{start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}}}}}},events:{"start-click":{type:"object",properties:{path:{type:"string"}}}},methods:{type:"object",properties:{}}},Gy={refs:{start:{eventListeners:{click:{handler:"handleClickStart"}}}},anchors:[[{"rtgl-text s=lg":"${start.label}"},{"$if start.image && start.image.src":[{"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}":null}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view bgc=bg d=h h=48 av=c w=f ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if start.href",value:{type:6,conditions:[{type:1,path:"start.href"},{type:1,path:"start.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${start.href}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a href=",{type:1,path:"start.href"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#start d=h av=c g=md cur=pointer",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view d=h av=c g=lg",value:{type:9,items:[{type:8,properties:[{key:"slot name=right",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view bgc=bg d=h h=48 av=c w=f ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Jy={componentName:"rtgl-page-outline",propsSchema:{type:"object",properties:{targetId:{type:"string"},scrollContainerId:{type:"string"},offsetTop:{type:"string"}}},events:{onItemClick:{type:"object"}},methods:{type:"object",properties:{}}},Zy={refs:{},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=272 d=v pr=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1fg sv mt=xl",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view d=h bwl=xs bc="${item.bc}" pv=sm av=c href=${item.href} pl=md',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=${item.ml}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view w=",{type:1,path:"item.ml"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} h-c=fg",value:{type:1,path:"item.title"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," h-c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view d=h bwl=xs bc="',{type:1,path:"item.bc"},'" pv=sm av=c href=',{type:1,path:"item.href"}," pl=md"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}},Xy={componentName:"rtgl-popover-input",propsSchema:{type:"object",properties:{value:{type:"string"},placeholder:{type:"string"},label:{type:"string"},autoFocus:{type:"boolean"},disabled:{type:"boolean",default:!1}}},events:{"value-change":{}},methods:{type:"object",properties:{}}},Qy={refs:{textDisplay:{eventListeners:{click:{handler:"handleTextClick"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},input:{eventListeners:{"value-input":{handler:"handleInputChange"},keydown:{handler:"handleInputKeydown"}}},submit:{eventListeners:{click:{handler:"handleSubmitClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#textDisplay w=f cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${valueColor}",value:{type:1,path:"value"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"valueColor"}]}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} content-g=md content-w=240 content-pv=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-input#input w=f placeholder=${placeholder} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=f placeholder=",{type:1,path:"placeholder"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#submit ?disabled=${disabled}",value:{type:0,value:"Submit"},parsedKey:{type:2,parts:["rtgl-button#submit ?disabled=",{type:1,path:"disabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," content-g=md content-w=240 content-pv=sm"]}}],fast:!0}],fast:!0}},em={componentName:"rtgl-segmented-control",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"any"},testId:{type:"string"}}}},selectedValue:{type:"any"},onChange:{type:"function"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}},tm={refs:{"option*":{eventListeners:{click:{handler:"handleOptionClick"},keydown:{handler:"handleOptionKeyDown"},mouseenter:{handler:"handleOptionMouseEnter"},mouseleave:{handler:"handleOptionMouseLeave"}}},optionAdd:{eventListeners:{click:{handler:"handleAddOptionClick"},keydown:{handler:"handleAddOptionKeyDown"},mouseenter:{handler:"handleAddOptionMouseEnter"},mouseleave:{handler:"handleAddOptionMouseLeave"}}}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view d=h bw=xs bc=bo br=md bgc=bg overflow=hidden ${containerAttrString} role="group" aria-label=${ariaLabel}',value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view#option${i} d=h av=c ah=c w=1fg ph=lg pv=md cur=${option.cursor} bgc=${option.bgc} bwl=${option.borderLeftWidth} bc=bo data-testid=${option.testId} role="button" tabindex=${option.tabIndex} aria-pressed=${option.isSelected} aria-disabled=${isDisabled}',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${option.textColor} ta=c",value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"option.textColor"}," ta=c"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," d=h av=c ah=c w=1fg ph=lg pv=md cur=",{type:1,path:"option.cursor"}," bgc=",{type:1,path:"option.bgc"}," bwl=",{type:1,path:"option.borderLeftWidth"}," bc=bo data-testid=",{type:1,path:"option.testId"},' role="button" tabindex=',{type:1,path:"option.tabIndex"}," aria-pressed=",{type:1,path:"option.isSelected"}," aria-disabled=",{type:1,path:"isDisabled"}]}}],fast:!0}],fast:!0},flatten:!0},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view#optionAdd d=h av=c ah=c w=1fg ph=lg pv=md cur=pointer bgc=${addOptionBgc} bwl=${addOptionBorderLeftWidth} bc=bo data-testid="segmented-control-add-option" role="button" tabindex=0',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=ac ta=c",value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#optionAdd d=h av=c ah=c w=1fg ph=lg pv=md cur=pointer bgc=",{type:1,path:"addOptionBgc"}," bwl=",{type:1,path:"addOptionBorderLeftWidth"},' bc=bo data-testid="segmented-control-add-option" role="button" tabindex=0']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h bw=xs bc=bo br=md bgc=bg overflow=hidden ",{type:1,path:"containerAttrString"},' role="group" aria-label=',{type:1,path:"ariaLabel"}]}}],fast:!1}],fast:!1}},sm={componentName:"rtgl-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{type:{type:"string",enum:["section","item","separator"]},label:{type:"string"},value:{type:"any"},icon:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},testId:{type:"string"}}}},selectedValue:{type:"any"},onChange:{type:"function"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}},rm={refs:{selectButton:{eventListeners:{click:{handler:"handleButtonClick"},keydown:{handler:"handleButtonKeyDown"}}},clearButton:{eventListeners:{click:{handler:"handleClearClick"}}},popover:{eventListeners:{close:{handler:"handleClickOptionsPopoverOverlay"}}},"option*":{eventListeners:{click:{handler:"handleOptionClick"},mouseenter:{handler:"handleOptionMouseEnter"},mouseleave:{handler:"handleOptionMouseLeave"}}},optionAdd:{eventListeners:{click:{handler:"handleAddOptionClick"},mouseenter:{handler:"handleAddOptionMouseEnter"},mouseleave:{handler:"handleAddOptionMouseLeave"}}}},styles:{".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view#selectButton style="display: inline-flex;" d=h av=c h=32 ph=md bw=xs bc=bo h-bc=${selectButtonHoverBorderColor} br=md bgc=su cur=${selectButtonCursor} ${containerAttrString} data-testid="select-button" role="button" tabindex=${selectButtonTabIndex} aria-disabled=${isDisabled}',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c ah=s w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if hasSelectedIcon",value:{type:6,conditions:[{type:1,path:"hasSelectedIcon"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg svg=${selectedIcon} wh=16 c=${selectedIconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg svg=",{type:1,path:"selectedIcon"}," wh=16 c=",{type:1,path:"selectedIconColor"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text w=1fg ta=s c=${selectedLabelColor} ellipsis",value:{type:1,path:"selectedLabel"},parsedKey:{type:2,parts:["rtgl-text w=1fg ta=s c=",{type:1,path:"selectedLabelColor"}," ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if hasSelectedSuffixText",value:{type:6,conditions:[{type:1,path:"hasSelectedSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${selectedSuffixTextColor} ta=e",value:{type:1,path:"selectedSuffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"selectedSuffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if showClear",value:{type:6,conditions:[{type:1,path:"showClear"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#clearButton svg=x wh=16 c=mu-fg cur=pointer data-testid="select-clear-button"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-svg svg=chevronDown wh=16 c=mu-fg",value:{type:0,value:null}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:['rtgl-view#selectButton style="display: inline-flex;" d=h av=c h=32 ph=md bw=xs bc=bo h-bc=',{type:1,path:"selectButtonHoverBorderColor"}," br=md bgc=su cur=",{type:1,path:"selectButtonCursor"}," ",{type:1,path:"containerAttrString"},' data-testid="select-button" role="button" tabindex=',{type:1,path:"selectButtonTabIndex"}," aria-disabled=",{type:1,path:"isDisabled"}]}}],fast:!1},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=rs content-wh=300 content-g=xs content-sv=true content-pv=sm",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"$if option.isSection",value:{type:6,conditions:[{type:1,path:"option.isSection"},{type:1,path:"option.isItem"},{type:1,path:"option.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${option.index} w=f ph=lg pv=md cur=pointer bgc=${option.bgc} data-testid=${option.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if option.hasIconSlot",value:{type:6,conditions:[{type:1,path:"option.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if option.hasIcon",value:{type:6,conditions:[{type:1,path:"option.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${option.icon} c=${option.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"option.icon"}," c=",{type:1,path:"option.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${option.c} w=1fg ellipsis",value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"option.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if option.hasSuffixText",value:{type:6,conditions:[{type:1,path:"option.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${option.suffixTextColor} ta=e",value:{type:1,path:"option.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"option.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"option.index"}," w=f ph=lg pv=md cur=pointer bgc=",{type:1,path:"option.bgc"}," data-testid=",{type:1,path:"option.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=sm",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f bw=xs bc=mu bwt=sm",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-view#optionAdd w=f ph=lg pv=md cur=pointer bgc=${addOptionBgc} data-testid="select-add-option"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=ac",value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#optionAdd w=f ph=lg pv=md cur=pointer bgc=",{type:1,path:"addOptionBgc"},' data-testid="select-add-option"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," place=rs content-wh=300 content-g=xs content-sv=true content-pv=sm"]}}],fast:!1}],fast:!1}},im={componentName:"rtgl-sidebar",propsSchema:{type:"object",properties:{mode:{type:"string"},hideHeader:{type:"boolean",default:!1},tooltip:{type:"boolean",default:!1},showCompactTooltip:{type:"boolean",default:!1,description:"Deprecated alias for tooltip. Use tooltip instead."},w:{type:"string"},bwr:{type:"string"},selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},testId:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{label:{type:"string"},title:{type:"string",description:"Deprecated item text field. Use label instead."},slug:{type:"string"},type:{type:"string",description:"Item row type. Supports item, groupLabel, divider, and spacer."},tooltip:{type:"string"},items:{type:"array"},testId:{type:"string"}}}}}},events:{"header-click":{type:"object",properties:{path:{type:"string"}}},"item-click":{type:"object",properties:{item:{type:"object"}}}},methods:{type:"object",properties:{}}},nm={refs:{headerImage:{eventListeners:{click:{handler:"handleHeaderClick"}}},headerLabel:{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item*":{eventListeners:{click:{handler:"handleItemClick"},mouseenter:{handler:"handleItemMouseEnter"},mouseleave:{handler:"handleItemMouseLeave"}}}},anchors:[[{"$if header.image && header.image.src":[{"$if header.image.href":[{"a href=${header.image.href}":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],"$elif header.image.path":[{"rtgl-view#headerImage cur=pointer":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],$else:[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}]},{"$if header.label && showLabels":[{"$if header.labelHref":[{"rtgl-text href=${header.labelHref} s=lg":"${header.label}"}],"$elif header.labelPath":[{"rtgl-view#headerLabel cur=pointer":[{"rtgl-text s=lg":"${header.label}"}]}],$else:[{"rtgl-text s=lg":"${header.label}"}]}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=${sidebarWidth} d=v bwr=${rightBorderWidth} ah=${ah} ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if showHeader",value:{type:6,conditions:[{type:1,path:"showHeader"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view ph=${headerPadding} pv=lg",value:{type:9,items:[{type:8,properties:[{key:"$if header.href",value:{type:6,conditions:[{type:1,path:"header.href"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view href=${header.href} d=h av=c ah=${headerAlign} g=lg w=${headerWidth}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerImage cur=pointer",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerLabel cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view href=",{type:1,path:"header.href"}," d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c ah=${headerAlign} g=lg w=${headerWidth} cur=pointer data-testid=${header.testId}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerImage cur=pointer",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerLabel cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#header d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}," cur=pointer data-testid=",{type:1,path:"header.testId"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view ph=",{type:1,path:"headerPadding"}," pv=lg"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=f h=1fg ph=${headerPadding} pb=lg g=xs ah=${ah} ${listAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'$if item.type == "divider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"divider"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"spacer"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"groupLabel"}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f pv=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=1 w=f bgc=mu",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view h=1fg w=f",value:{type:0,value:null}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"$if showGroupLabels",value:{type:6,conditions:[{type:1,path:"showGroupLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=32 av=c ph=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=1 bgc=mu",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:'rtgl-view#item${i} data-item-id=${item.id} ${item.hrefAttr} h=${itemHeight} av=c ${itemAlignAttr} ph=${itemPadding} w=${itemWidth} h-bgc=${item.itemHoverBgc} br=lg bgc=${item.itemBgc} cur=pointer data-testid=${item.testId} aria-label="${item.label}"',value:{type:9,items:[{type:8,properties:[{key:"$if item.icon",value:{type:6,conditions:[{type:1,path:"item.icon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=${itemContentAlign} g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h ah=",{type:1,path:"itemContentAlign"}," g=sm"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=${iconSize} svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=",{type:1,path:"iconSize"}," svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=${iconSize} br=f bgc=mu av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=${firstLetterSize} c=fg",value:{type:1,path:"item.label.charAt(0).toUpperCase()"},parsedKey:{type:2,parts:["rtgl-text s=",{type:1,path:"firstLetterSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view wh=",{type:1,path:"iconSize"}," br=f bgc=mu av=c ah=c"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#item",{type:1,path:"i"}," data-item-id=",{type:1,path:"item.id"}," ",{type:1,path:"item.hrefAttr"}," h=",{type:1,path:"itemHeight"}," av=c ",{type:1,path:"itemAlignAttr"}," ph=",{type:1,path:"itemPadding"}," w=",{type:1,path:"itemWidth"}," h-bgc=",{type:1,path:"item.itemHoverBgc"}," br=lg bgc=",{type:1,path:"item.itemBgc"}," cur=pointer data-testid=",{type:1,path:"item.testId"},' aria-label="',{type:1,path:"item.label"},'"']}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=1fg ph=",{type:1,path:"headerPadding"}," pb=lg g=xs ah=",{type:1,path:"ah"}," ",{type:1,path:"listAttrString"}]}}],fast:!1},{type:8,properties:[{key:"$if enableCompactTooltip",value:{type:6,conditions:[{type:1,path:"enableCompactTooltip"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-tooltip#tooltip s="md" ?open=${tooltipState.open} x=${tooltipState.x} y=${tooltipState.y} place=${tooltipState.place} content="${tooltipState.content}"',value:{type:0,value:null},parsedKey:{type:2,parts:['rtgl-tooltip#tooltip s="md" ?open=',{type:1,path:"tooltipState.open"}," x=",{type:1,path:"tooltipState.x"}," y=",{type:1,path:"tooltipState.y"}," place=",{type:1,path:"tooltipState.place"},' content="',{type:1,path:"tooltipState.content"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{type:1,path:"sidebarWidth"}," d=v bwr=",{type:1,path:"rightBorderWidth"}," ah=",{type:1,path:"ah"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},om={componentName:"rtgl-slider-input",propsSchema:{type:"object",properties:{key:{type:"string"},value:{type:"string",default:"0"},w:{type:"string",default:""},min:{type:"string",default:"0"},max:{type:"string",default:"100"},step:{type:"string",default:"1"},disabled:{type:"boolean",default:!1}}},events:{"value-input":{},"value-change":{}},methods:{type:"object",properties:{}}},am={refs:{input:{eventListeners:{"value-input":{handler:"handleValueInput"},"value-change":{handler:"handleValueChange"}}},slider:{eventListeners:{"value-change":{handler:"handleValueChange"},"value-input":{handler:"handleValueInput"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=${w}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-slider#slider key=${key} w=f type=range min=${min} max=${max} step=${step} value=${value} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider key=",{type:1,path:"key"}," w=f type=range min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=84",value:{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#input key=${key} w=f min=${min} max=${max} step=${step} value=${value} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#input key=",{type:1,path:"key"}," w=f min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md w=",{type:1,path:"w"}]}}],fast:!0}],fast:!0}},lm={componentName:"rtgl-table",propsSchema:{type:"object",properties:{data:{type:"object",properties:{columns:{type:"array",items:{type:"object",properties:{key:{type:"string"},label:{type:"string"}}}},rows:{type:"array",items:{type:"object"}}}},responsive:{type:"boolean",default:!0}}},events:{},methods:{type:"object",properties:{}}},pm={refs:{"row*":{eventListeners:{click:{handler:"handleRowClick"}}},"header*":{eventListeners:{click:{handler:"handleHeaderClick"}}}},styles:{table:{width:"100%","border-collapse":"collapse","border-spacing":0},thead:{"border-bottom":"2px solid var(--border)"},th:{padding:"12px","text-align":"left","font-weight":500,color:"var(--foreground)","background-color":"var(--muted)",cursor:"pointer",position:"sticky",top:0,"z-index":1},"tbody tr":{"border-bottom":"1px solid var(--border)"},"tbody tr:last-child":{"border-bottom":"none"},td:{padding:"12px",color:"var(--foreground)"},".table-container":{width:"100%",height:"100%",overflow:"auto"},".empty-state":{"text-align":"center",padding:"24px",color:"var(--muted-foreground)"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view.table-container ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if rows.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"rows.length"},right:{type:0,value:0}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"table",value:{type:9,items:[{type:8,properties:[{key:"thead",value:{type:9,items:[{type:8,properties:[{key:"tr",value:{type:9,items:[{type:7,itemVar:"column",indexVar:"i",iterable:{type:1,path:"columns"},body:{type:9,items:[{type:8,properties:[{key:"th#header${i} data-column-key=${column.key}",value:{type:1,path:"column.label"},parsedKey:{type:2,parts:["th#header",{type:1,path:"i"}," data-column-key=",{type:1,path:"column.key"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"tbody",value:{type:9,items:[{type:7,itemVar:"row",indexVar:"rowIndex",iterable:{type:1,path:"rows"},body:{type:9,items:[{type:8,properties:[{key:"tr#row${rowIndex}",value:{type:9,items:[{type:7,itemVar:"cell",indexVar:"cellIndex",iterable:{type:1,path:"row.cells"},body:{type:9,items:[{type:8,properties:[{key:"td",value:{type:1,path:"cell.value"}}],fast:!0}],fast:!0},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["tr#row",{type:1,path:"rowIndex"}]}}],fast:!1}],fast:!1},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view.empty-state w=f p=xl",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"No data available"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view.table-container ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},dm={componentName:"rtgl-tabs",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},testId:{type:"string"}}}},selectedTab:{type:"string"}}},events:{"item-click":{type:"object",properties:{id:{type:"string"}}}},methods:{type:"object",properties:{}}},cm={refs:{"tab*":{eventListeners:{click:{handler:"handleClickItem"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm bgc=mu p=sm br=lg ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#tab${i} data-id=${item.id} cur=pointer bgc=${item.bgColor} bw=xs bc=${item.borderColor} pv=md ph=lg br=lg data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.textColor}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.textColor"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#tab",{type:1,path:"i"}," data-id=",{type:1,path:"item.id"}," cur=pointer bgc=",{type:1,path:"item.bgColor"}," bw=xs bc=",{type:1,path:"item.borderColor"}," pv=md ph=lg br=lg data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h g=sm bgc=mu p=sm br=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},um={componentName:"rtgl-tag-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{type:{type:"string",enum:["section","item","separator"]},label:{type:"string"},value:{type:"any"},icon:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},testId:{type:"string"}}}},selectedValues:{type:"array",items:{type:"any"}},draftSelectedValues:{type:"array",items:{type:"any"}},open:{type:"boolean"},onChange:{type:"function"},addOption:{type:"object",properties:{label:{type:"string"}}},noAdd:{type:"boolean"},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"draft-value-change":{},"open-change":{},"add-option-click":{}},methods:{type:"object",properties:{refreshPopover:{description:"Recomputes the open popover position and rerenders the current options and draft values.",params:["values","keepOpen"],returns:"void"},setDraftSelectedValues:{description:"Replaces the draft-only selection without committing `selectedValues`; optionally reopens the popover around the trigger when `keepOpen` is true.",params:["values","keepOpen"],returns:"void"},appendDraftSelectedValue:{description:"Adds a value to the draft-only selection without committing `selectedValues`; optionally reopens the popover around the trigger when `keepOpen` is true.",params:["value","keepOpen"],returns:"void"}}}},hm={refs:{trigger:{eventListeners:{click:{handler:"handleTriggerClick"},keydown:{handler:"handleTriggerKeyDown"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},"option*":{eventListeners:{click:{handler:"handleOptionClick"},keydown:{handler:"handleOptionKeyDown"}}},submitButton:{eventListeners:{click:{handler:"handleSubmitClick"}}},addOptionButton:{eventListeners:{click:{handler:"handleAddOptionClick"}}}},styles:{".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view#trigger d=h av=c g=sm cur=${triggerCursor} ${containerAttrString} data-testid="tag-select-trigger" role="button" tabindex=${triggerTabIndex} aria-disabled=${isDisabled} style="min-height: 24px;"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c wrap g=sm w=1fg",value:{type:9,items:[{type:7,itemVar:"tag",indexVar:"i",iterable:{type:1,path:"triggerTags"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-tag data-selection-index=${tag.selectionIndex} pre=${tag.icon} data-testid=${tag.testId} v=mu style="${tag.tagStyle}"',value:{type:1,path:"tag.label"},parsedKey:{type:2,parts:["rtgl-tag data-selection-index=",{type:1,path:"tag.selectionIndex"}," pre=",{type:1,path:"tag.icon"}," data-testid=",{type:1,path:"tag.testId"},' v=mu style="',{type:1,path:"tag.tagStyle"},'"']}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#trigger d=h av=c g=sm cur=",{type:1,path:"triggerCursor"}," ",{type:1,path:"containerAttrString"},' data-testid="tag-select-trigger" role="button" tabindex=',{type:1,path:"triggerTabIndex"}," aria-disabled=",{type:1,path:"isDisabled"},' style="min-height: 24px;"']}}],fast:!1},{type:8,properties:[{key:"$if isOpen",value:{type:6,conditions:[{type:1,path:"isOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=bs content-w=${position.w} content-g=sm content-sv=true content-ph=md content-pv=md",value:{type:9,items:[{type:8,properties:[{key:"$if !hasSelectableOptions",value:{type:6,conditions:[{type:5,op:0,operand:{type:1,path:"hasSelectableOptions"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:0,value:"No tags available"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h wrap g=sm w=f",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"$if option.isSection",value:{type:6,conditions:[{type:1,path:"option.isSection"},{type:1,path:"option.isItem"},{type:1,path:"option.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f pt=xs",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-view#option${option.index} cur=${option.cursor} data-testid=${option.testId} role="button" tabindex=0 aria-pressed=${option.isSelected}',value:{type:9,items:[{type:8,properties:[{key:'rtgl-tag v=mu pre=${option.icon} style="${option.tagStyle}"',value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-tag v=mu pre=",{type:1,path:"option.icon"},' style="',{type:1,path:"option.tagStyle"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"option.index"}," cur=",{type:1,path:"option.cursor"}," data-testid=",{type:1,path:"option.testId"},' role="button" tabindex=0 aria-pressed=',{type:1,path:"option.isSelected"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=xs",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-button#addOptionButton v=gh s=sm pre=plus data-testid="tag-select-add-option"',value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h av=c g=sm w=f pt=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-button#submitButton v=pr s=sm data-testid="tag-select-submit" ?disabled=${submitDisabled}',value:{type:1,path:"submitLabel"},parsedKey:{type:2,parts:['rtgl-button#submitButton v=pr s=sm data-testid="tag-select-submit" ?disabled=',{type:1,path:"submitDisabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," place=bs content-w=",{type:1,path:"position.w"}," content-g=sm content-sv=true content-ph=md content-pv=md"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}},fm={componentName:"rtgl-tooltip",propsSchema:{type:"object",properties:{open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},s:{type:"string",enum:["sm","md","lg"]},content:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},ym={template:{type:9,items:[{type:8,properties:[{key:'rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} no-overlay content-bgc=mu content-style="${contentStyle}"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view p=${padding} ah=s av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text ta=s s=${textSize} c=fg",value:{type:1,path:"content"},parsedKey:{type:2,parts:["rtgl-text ta=s s=",{type:1,path:"textSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view p=",{type:1,path:"padding"}," ah=s av=c"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," place=",{type:1,path:"place"},' no-overlay content-bgc=mu content-style="',{type:1,path:"contentStyle"},'"']}}],fast:!0}],fast:!0},refs:{}},mm={componentName:"rtgl-waveform",propsSchema:{type:"object",properties:{w:{type:"string",description:"Width of the waveform visualizer",default:"250"},h:{type:"string",description:"Height of the waveform visualizer",default:"150"},cur:{type:"string",description:"cursor"},waveformData:{type:"object",description:"File ID of the waveform data in object storage"},isLoading:{type:"boolean",description:"Whether the waveform data is currently being loaded"}}},events:[],methods:{type:"object",properties:{}}},gm={refs:{canvas:{selector:"canvas"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view pos=rel w=${w} h=${h} cur=${cur}",value:{type:9,items:[{type:8,properties:[{key:"$if isLoading",value:{type:6,conditions:[{type:1,path:"isLoading"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"..."}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'canvas#canvas style="width:100%; height:100%;"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view pos=rel w=",{type:1,path:"w"}," h=",{type:1,path:"h"}," cur=",{type:1,path:"cur"}]}}],fast:!1}],fast:!1}},x={};x.components={};x.components.accordionItem={};x.components.accordionItem.handlers=mo;x.components.accordionItem.schema=jy;x.components.accordionItem.store=xo;x.components.accordionItem.view=Dy;x.components.breadcrumb={};x.components.breadcrumb.handlers=Ao;x.components.breadcrumb.schema=Py;x.components.breadcrumb.store=Vo;x.components.breadcrumb.view=By;x.components.card={};x.components.card.schema=zy;x.components.card.store=Po;x.components.card.view=Wy;x.components.dropdownMenu={};x.components.dropdownMenu.handlers=Fo;x.components.dropdownMenu.schema=My;x.components.dropdownMenu.store=Go;x.components.dropdownMenu.view=Fy;x.components.form={};x.components.form.handlers=yl;x.components.form.methods=kl;x.components.form.schema=Ky;x.components.form.store=il;x.components.form.view=Uy;x.components.globalUi={};x.components.globalUi.handlers=Gl;x.components.globalUi.schema=Hy;x.components.globalUi.store=_p;x.components.globalUi.view=qy;x.components.navbar={};x.components.navbar.handlers=Sp;x.components.navbar.schema=Yy;x.components.navbar.store=Tp;x.components.navbar.view=Gy;x.components.pageOutline={};x.components.pageOutline.handlers=Rp;x.components.pageOutline.schema=Jy;x.components.pageOutline.store=Fp;x.components.pageOutline.view=Zy;x.components.popoverInput={};x.components.popoverInput.handlers=Zp;x.components.popoverInput.schema=Xy;x.components.popoverInput.store=nd;x.components.popoverInput.view=Qy;x.components.segmentedControl={};x.components.segmentedControl.handlers=fd;x.components.segmentedControl.schema=em;x.components.segmentedControl.store=$d;x.components.segmentedControl.view=tm;x.components.select={};x.components.select.handlers=Bd;x.components.select.schema=sm;x.components.select.store=ic;x.components.select.view=rm;x.components.sidebar={};x.components.sidebar.handlers=dc;x.components.sidebar.schema=im;x.components.sidebar.store=Sc;x.components.sidebar.view=nm;x.components.sliderInput={};x.components.sliderInput.handlers=Cc;x.components.sliderInput.schema=om;x.components.sliderInput.store=Lc;x.components.sliderInput.view=am;x.components.table={};x.components.table.handlers=jc;x.components.table.schema=lm;x.components.table.store=Hc;x.components.table.view=pm;x.components.tabs={};x.components.tabs.handlers=Yc;x.components.tabs.schema=dm;x.components.tabs.store=Qc;x.components.tabs.view=cm;x.components.tagSelect={};x.components.tagSelect.handlers=cu;x.components.tagSelect.methods=yu;x.components.tagSelect.schema=um;x.components.tagSelect.store=Du;x.components.tagSelect.view=hm;x.components.tooltip={};x.components.tooltip.handlers=Pu;x.components.tooltip.schema=fm;x.components.tooltip.store=Wu;x.components.tooltip.view=ym;x.components.waveform={};x.components.waveform.handlers=Ku;x.components.waveform.schema=mm;x.components.waveform.store=Yu;x.components.waveform.view=gm;Object.keys(x).forEach(e=>{Object.keys(x[e]).forEach(t=>{let s=x[e][t],r=Ty({...s},Ry[e]),i=s.schema?.componentName;if(!i)throw new Error(`[Build] Missing schema.componentName for ${e}/${t}. Define it in .schema.yaml.`);customElements.define(i,r)})});customElements.define("rtgl-button",sr({}));customElements.define("rtgl-carousel",ar({}));customElements.define("rtgl-grid",lr({}));customElements.define("rtgl-view",dr({}));customElements.define("rtgl-text",ur({}));customElements.define("rtgl-image",yr({}));customElements.define("rtgl-tag",gr({}));customElements.define("rtgl-svg",vr({}));customElements.define("rtgl-input",ve({}));customElements.define("rtgl-input-date",wr({}));customElements.define("rtgl-input-time",_r({}));customElements.define("rtgl-input-datetime",xr({}));customElements.define("rtgl-input-number",Sr({}));customElements.define("rtgl-textarea",Ar({}));customElements.define("rtgl-color-picker",kr({}));customElements.define("rtgl-slider",Er({}));customElements.define("rtgl-checkbox",$r({}));customElements.define("rtgl-dialog",Cr({}));customElements.define("rtgl-popover",Tr({}));})();
|