@rettangoli/ui 0.1.30 → 0.1.32-rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -85
- package/dist/rettangoli-iife-layout.min.js +113 -173
- package/dist/rettangoli-iife-ui.min.js +123 -183
- package/package.json +5 -4
- package/src/common/dimensions.js +72 -0
- package/src/common/link.js +111 -0
- package/src/common/responsive.js +8 -0
- package/src/common.js +43 -8
- package/src/components/accordionItem/accordionItem.handlers.js +1 -1
- package/src/components/accordionItem/accordionItem.schema.yaml +14 -0
- package/src/components/accordionItem/accordionItem.store.js +8 -8
- package/src/components/accordionItem/accordionItem.view.yaml +9 -38
- package/src/components/breadcrumb/breadcrumb.handlers.js +24 -3
- package/src/components/breadcrumb/breadcrumb.schema.yaml +51 -0
- package/src/components/breadcrumb/breadcrumb.store.js +66 -10
- package/src/components/breadcrumb/breadcrumb.view.yaml +18 -58
- package/src/components/dropdownMenu/dropdownMenu.handlers.js +17 -3
- package/src/components/dropdownMenu/dropdownMenu.schema.yaml +64 -0
- package/src/components/dropdownMenu/dropdownMenu.store.js +48 -6
- package/src/components/dropdownMenu/dropdownMenu.view.yaml +24 -46
- package/src/components/form/form.handlers.js +25 -108
- package/src/components/form/form.schema.yaml +283 -0
- package/src/components/form/form.store.js +19 -14
- package/src/components/form/form.view.yaml +28 -319
- package/src/components/globalUi/globalUi.handlers.js +2 -2
- package/src/components/globalUi/globalUi.schema.yaml +8 -0
- package/src/components/globalUi/globalUi.store.js +8 -8
- package/src/components/globalUi/globalUi.view.yaml +9 -46
- package/src/components/navbar/navbar.handlers.js +1 -1
- package/src/components/navbar/navbar.schema.yaml +25 -0
- package/src/components/navbar/navbar.store.js +28 -14
- package/src/components/navbar/navbar.view.yaml +21 -65
- package/src/components/pageOutline/pageOutline.handlers.js +17 -11
- package/src/components/pageOutline/pageOutline.schema.yaml +16 -0
- package/src/components/pageOutline/pageOutline.store.js +6 -7
- package/src/components/pageOutline/pageOutline.view.yaml +1 -29
- package/src/components/popoverInput/popoverInput.handlers.js +31 -31
- package/src/components/popoverInput/popoverInput.schema.yaml +18 -0
- package/src/components/popoverInput/popoverInput.store.js +9 -9
- package/src/components/popoverInput/popoverInput.view.yaml +5 -22
- package/src/components/select/select.handlers.js +31 -35
- package/src/components/select/select.schema.yaml +36 -0
- package/src/components/select/select.store.js +34 -35
- package/src/components/select/select.view.yaml +13 -56
- package/src/components/sidebar/sidebar.handlers.js +5 -5
- package/src/components/sidebar/sidebar.schema.yaml +57 -0
- package/src/components/sidebar/sidebar.store.js +45 -23
- package/src/components/sidebar/sidebar.view.yaml +79 -174
- package/src/components/sliderInput/sliderInput.handlers.js +28 -8
- package/src/components/sliderInput/sliderInput.schema.yaml +27 -0
- package/src/components/sliderInput/sliderInput.store.js +9 -9
- package/src/components/sliderInput/sliderInput.view.yaml +8 -33
- package/src/components/table/table.handlers.js +3 -3
- package/src/components/table/table.schema.yaml +27 -0
- package/src/components/table/table.store.js +8 -8
- package/src/components/table/table.view.yaml +16 -62
- package/src/components/tabs/tabs.schema.yaml +26 -0
- package/src/components/tabs/tabs.store.js +12 -9
- package/src/components/tabs/tabs.view.yaml +4 -60
- package/src/components/tooltip/tooltip.schema.yaml +18 -0
- package/src/components/tooltip/tooltip.store.js +7 -7
- package/src/components/tooltip/tooltip.view.yaml +4 -22
- package/src/components/waveform/waveform.handlers.js +6 -6
- package/src/components/waveform/waveform.schema.yaml +25 -0
- package/src/components/waveform/waveform.store.js +6 -6
- package/src/components/waveform/waveform.view.yaml +6 -34
- package/src/deps/createGlobalUI.js +2 -2
- package/src/primitives/button.js +200 -114
- package/src/primitives/colorPicker.js +56 -50
- package/src/primitives/dialog.js +2 -1
- package/src/primitives/image.js +73 -103
- package/src/primitives/input-number.js +139 -93
- package/src/primitives/input.js +87 -64
- package/src/primitives/popover.js +36 -28
- package/src/primitives/slider.js +6 -4
- package/src/primitives/svg.js +9 -10
- package/src/primitives/text.js +26 -47
- package/src/primitives/textarea.js +25 -9
- package/src/primitives/view.js +49 -90
- package/src/setup.js +1 -7
- package/src/styles/buttonMarginStyles.js +1 -13
- package/src/styles/cursorStyles.js +1 -5
- package/src/styles/flexDirectionStyles.js +4 -4
- package/src/styles/marginStylesForTarget.js +13 -0
- package/src/styles/textColorStyles.js +14 -6
- package/src/styles/textStyles.js +4 -4
- package/src/styles/viewStyles.js +6 -6
- package/src/styles/viewStylesForTarget.js +58 -0
- package/src/styles/flexChildStyles.js +0 -43
|
@@ -1,64 +1,38 @@
|
|
|
1
|
-
var rettangoli=(()=>{var
|
|
2
|
-
|
|
1
|
+
var rettangoli=(()=>{var In=Object.defineProperty;var R=(e,t)=>{for(var r in t)In(e,r,{get:t[r],enumerable:!0})};var Te=`
|
|
2
|
+
:host([href]) {
|
|
3
|
+
cursor: pointer;
|
|
4
|
+
position: relative;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:host([href]) a {
|
|
8
|
+
position: absolute;
|
|
9
|
+
top: 0;
|
|
10
|
+
left: 0;
|
|
11
|
+
right: 0;
|
|
12
|
+
bottom: 0;
|
|
13
|
+
z-index: 1;
|
|
14
|
+
}
|
|
15
|
+
`,Le=({linkElement:e,href:t,target:r,rel:s})=>{e.href=t,r!=null?e.target=r:e.removeAttribute("target"),s!=null?e.rel=s:r==="_blank"?e.rel="noopener noreferrer":e.removeAttribute("rel")},Re=({shadowRoot:e,slotElement:t,linkElement:r,href:s,target:i,rel:n})=>{if(t.parentNode!==e&&e.appendChild(t),!s)return r&&r.parentNode===e&&e.removeChild(r),null;let a=r||document.createElement("a");return Le({linkElement:a,href:s,target:i,rel:n}),a.parentNode!==e&&e.appendChild(a),a},mt=({shadowRoot:e,childElement:t,linkElement:r,href:s,target:i,rel:n})=>{if(!s)return r?(t.parentNode===r&&e.appendChild(t),r.parentNode===e&&e.removeChild(r),null):(t.parentNode!==e&&e.appendChild(t),null);let a=r||document.createElement("a");return Le({linkElement:a,href:s,target:i,rel:n}),t.parentNode!==a&&a.appendChild(t),a.parentNode!==e&&e.appendChild(a),a};var ne=["default","sm","md","lg","xl"],K=()=>ne.reduce((e,t)=>(e[t]={},e),{});var On=/^([1-9]|1[0-2])fg$/,yt=e=>typeof e=="string"&&On.test(e),H=({styleBucket:e,axis:t,dimension:r,fillValue:s,allowFlexGrow:i=!1,lockBounds:n=!0})=>{if(r!==void 0){if(r==="f"){e[t]=s;return}if(i&&yt(r)){e["flex-grow"]=r.slice(0,-2),e["flex-basis"]="0%";return}e[t]=r,n&&(e[`min-${t}`]=r,e[`max-${t}`]=r)}},gt=({style:e,width:t,fillValue:r="var(--width-stretch)",allowFlexGrow:s=!0,flexMinWidth:i="0"})=>{if(t==="f"){e.width=r,e.flexGrow="",e.flexBasis="",e.minWidth="";return}if(s&&yt(t)){e.width="",e.flexGrow=t.slice(0,-2),e.flexBasis="0%",e.minWidth=i;return}if(t!=null){e.width=t,e.flexGrow="",e.flexBasis="",e.minWidth="";return}e.width="",e.flexGrow="",e.flexBasis="",e.minWidth=""};function L(e,...t){let r="";return e.forEach((s,i)=>{r+=s+(t[i]||"")}),r}var Tn=["sm","md","lg","xl"],Nr={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom",pt:"padding-top",pr:"padding-right",pb:"padding-bottom",pl:"padding-left",p:"padding",ph:"padding-left padding-right",pv:"padding-top padding-bottom",g:"gap",gv:"row-gap",gh:"column-gap",bw:"border-width",bwt:"border-top-width",bwr:"border-right-width",bwb:"border-bottom-width",bwl:"border-left-width",bc:"border-color",br:"border-radius",pos:"position",shadow:"box-shadow",cur:"cursor"},de=Object.keys(Nr),ee=e=>e.concat(Tn.flatMap(t=>e.map(r=>`${t}-${r}`))),Pr={default:void 0,xl:"@media only screen and (max-width: 1280px)",lg:"@media only screen and (max-width: 1024px)",md:"@media only screen and (max-width: 768px)",sm:"@media only screen and (max-width: 640px)"},G=(e,t={},r=null)=>{let s="";for(let[i,n]of Object.entries(Pr)){i!=="default"&&(s+=`${n} {`);for(let[a,l]of Object.entries(e)){let p=t[a]?` ${t[a]} `:" ";for(let[o,c]of Object.entries(l)){let u=Nr[a],d=c.startsWith("--")?`var(${c})`:c,h=i==="default"?a:`${i}-${a}`,f=i==="default"?`h-${a}`:`${i}-h-${a}`,m=g=>{let y=`:host([${g}="${o}"])`;return r?r.split(",").map(w=>`${y} ${w.trim()}`).join(", "):y+p};if(u){let y=u.split(" ").map(w=>`${w}: ${d};`).join(" ");s+=`
|
|
16
|
+
${m(h)}{
|
|
3
17
|
${y}
|
|
4
18
|
}
|
|
5
|
-
|
|
19
|
+
${m(f)}:hover{
|
|
6
20
|
${y}
|
|
7
21
|
}
|
|
8
|
-
`}else
|
|
9
|
-
|
|
10
|
-
${
|
|
22
|
+
`}else s+=`
|
|
23
|
+
${m(h)}{
|
|
24
|
+
${c}
|
|
11
25
|
}
|
|
12
|
-
|
|
13
|
-
${
|
|
26
|
+
${m(f)}:hover{
|
|
27
|
+
${c}
|
|
14
28
|
}
|
|
15
|
-
`}}
|
|
16
|
-
`);let a="";for(let[l,p]of Object.entries(e[
|
|
29
|
+
`}}i!=="default"&&(s+="}")}return s};function Ln(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var Rn=e=>/%$/.test(e),Nn=e=>/^([1-9]|1[0-2])fg$/.test(e),N=e=>{if(e!==void 0)return Nn(e)||Rn(e)?e:Ln(e)?`${e}px`:Object.keys(S).includes(e)?`var(${S[e]})`:e},S={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function te(e,t=":host"){let r="",s=["default","xl","lg","md","sm"];for(let i of s){let n=Pr[i];if(!e[i]||Object.keys(e[i]).length===0)continue;i!=="default"&&(r+=`${n} {
|
|
30
|
+
`);let a="";for(let[l,p]of Object.entries(e[i]))p!=null&&(a+=`${l}: ${p} !important;
|
|
17
31
|
`);r+=`${t} {
|
|
18
32
|
${a.trim()}
|
|
19
33
|
}
|
|
20
|
-
`,
|
|
21
|
-
`)}return r}var
|
|
22
|
-
:host([flex="0"]) {
|
|
23
|
-
flex: 0;
|
|
24
|
-
}
|
|
25
|
-
:host([flex="1"]) {
|
|
26
|
-
flex: 1;
|
|
27
|
-
}
|
|
28
|
-
:host([flex="2"]) {
|
|
29
|
-
flex: 2;
|
|
30
|
-
}
|
|
31
|
-
:host([flex="3"]) {
|
|
32
|
-
flex: 3;
|
|
33
|
-
}
|
|
34
|
-
:host([flex="4"]) {
|
|
35
|
-
flex: 4;
|
|
36
|
-
}
|
|
37
|
-
:host([flex="5"]) {
|
|
38
|
-
flex: 5;
|
|
39
|
-
}
|
|
40
|
-
:host([flex="6"]) {
|
|
41
|
-
flex: 6;
|
|
42
|
-
}
|
|
43
|
-
:host([flex="7"]) {
|
|
44
|
-
flex: 7;
|
|
45
|
-
}
|
|
46
|
-
:host([flex="8"]) {
|
|
47
|
-
flex: 8;
|
|
48
|
-
}
|
|
49
|
-
:host([flex="9"]) {
|
|
50
|
-
flex: 9;
|
|
51
|
-
}
|
|
52
|
-
:host([flex="10"]) {
|
|
53
|
-
flex: 10;
|
|
54
|
-
}
|
|
55
|
-
:host([flex="11"]) {
|
|
56
|
-
flex: 11;
|
|
57
|
-
}
|
|
58
|
-
:host([flex="12"]) {
|
|
59
|
-
flex: 12;
|
|
60
|
-
}
|
|
61
|
-
`;var di={mt:P,mr:P,mb:P,ml:P,m:P,mh:P,mv:P,s:{sm:`
|
|
34
|
+
`,i!=="default"&&(r+=`}
|
|
35
|
+
`)}return r}var fe=(e,t)=>{if(e===t)return!0;if(e==null||t==null||typeof e!="object"||typeof t!="object")return!1;let r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(let i of r)if(!s.includes(i)||!fe(e[i],t[i]))return!1;return!0};var Pn={mt:S,mr:S,mb:S,ml:S,m:S,mh:S,mv:S,s:{sm:`
|
|
62
36
|
height: 28px;
|
|
63
37
|
padding-left: 12px;
|
|
64
38
|
padding-right: 12px;
|
|
@@ -107,7 +81,7 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
107
81
|
`,lk:`
|
|
108
82
|
background-color: transparent;
|
|
109
83
|
color: var(--foreground);
|
|
110
|
-
`}},
|
|
84
|
+
`}},Vr=G(Pn,{},".surface");var Ee=L`
|
|
111
85
|
a, a:link, a:visited, a:hover, a:active {
|
|
112
86
|
color: inherit;
|
|
113
87
|
text-decoration: none;
|
|
@@ -117,7 +91,7 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
117
91
|
margin: 0;
|
|
118
92
|
font: inherit;
|
|
119
93
|
}
|
|
120
|
-
`;var
|
|
94
|
+
`;var vt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
121
95
|
:host {
|
|
122
96
|
display: contents;
|
|
123
97
|
}
|
|
@@ -125,7 +99,7 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
125
99
|
display: contents;
|
|
126
100
|
}
|
|
127
101
|
|
|
128
|
-
|
|
102
|
+
.surface {
|
|
129
103
|
display: flex;
|
|
130
104
|
flex-direction: row;
|
|
131
105
|
align-items: center;
|
|
@@ -149,7 +123,7 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
149
123
|
color: var(--primary-foreground);
|
|
150
124
|
}
|
|
151
125
|
|
|
152
|
-
|
|
126
|
+
.surface:hover {
|
|
153
127
|
cursor: pointer;
|
|
154
128
|
background-color: color-mix(
|
|
155
129
|
in srgb,
|
|
@@ -158,11 +132,11 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
158
132
|
);
|
|
159
133
|
}
|
|
160
134
|
|
|
161
|
-
|
|
135
|
+
:host([disabled]) .surface {
|
|
162
136
|
cursor: not-allowed;
|
|
163
137
|
}
|
|
164
138
|
|
|
165
|
-
|
|
139
|
+
.surface:active {
|
|
166
140
|
cursor: pointer;
|
|
167
141
|
background-color: color-mix(
|
|
168
142
|
in srgb,
|
|
@@ -171,7 +145,7 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
171
145
|
);
|
|
172
146
|
}
|
|
173
147
|
|
|
174
|
-
:host([v="pr"])
|
|
148
|
+
:host([v="pr"]) .surface:hover {
|
|
175
149
|
background-color: color-mix(
|
|
176
150
|
in srgb,
|
|
177
151
|
var(--primary) 85%,
|
|
@@ -179,7 +153,7 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
179
153
|
);
|
|
180
154
|
}
|
|
181
155
|
|
|
182
|
-
:host([v="pr"])
|
|
156
|
+
:host([v="pr"]) .surface:active {
|
|
183
157
|
background-color: color-mix(
|
|
184
158
|
in srgb,
|
|
185
159
|
var(--primary) 80%,
|
|
@@ -187,7 +161,7 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
187
161
|
);
|
|
188
162
|
}
|
|
189
163
|
|
|
190
|
-
:host([v="se"])
|
|
164
|
+
:host([v="se"]) .surface:hover {
|
|
191
165
|
background-color: color-mix(
|
|
192
166
|
in srgb,
|
|
193
167
|
var(--secondary) 85%,
|
|
@@ -195,7 +169,7 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
195
169
|
);
|
|
196
170
|
}
|
|
197
171
|
|
|
198
|
-
:host([v="se"])
|
|
172
|
+
:host([v="se"]) .surface:active {
|
|
199
173
|
background-color: color-mix(
|
|
200
174
|
in srgb,
|
|
201
175
|
var(--secondary) 80%,
|
|
@@ -203,7 +177,7 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
203
177
|
);
|
|
204
178
|
}
|
|
205
179
|
|
|
206
|
-
:host([v="de"])
|
|
180
|
+
:host([v="de"]) .surface:hover {
|
|
207
181
|
background-color: color-mix(
|
|
208
182
|
in srgb,
|
|
209
183
|
var(--destructive) 85%,
|
|
@@ -211,7 +185,7 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
211
185
|
);
|
|
212
186
|
}
|
|
213
187
|
|
|
214
|
-
:host([v="de"])
|
|
188
|
+
:host([v="de"]) .surface:active {
|
|
215
189
|
background-color: color-mix(
|
|
216
190
|
in srgb,
|
|
217
191
|
var(--destructive) 80%,
|
|
@@ -219,49 +193,48 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
219
193
|
);
|
|
220
194
|
}
|
|
221
195
|
|
|
222
|
-
:host([v="ol"])
|
|
196
|
+
:host([v="ol"]) .surface:hover {
|
|
223
197
|
background-color: var(--accent);
|
|
224
198
|
}
|
|
225
199
|
|
|
226
|
-
:host([v="gh"])
|
|
200
|
+
:host([v="gh"]) .surface:hover {
|
|
227
201
|
background-color: var(--accent);
|
|
228
202
|
}
|
|
229
203
|
|
|
230
|
-
:host([v="lk"])
|
|
204
|
+
:host([v="lk"]) .surface:hover {
|
|
231
205
|
text-decoration: underline;
|
|
232
206
|
}
|
|
233
207
|
|
|
234
208
|
/* Square button styles */
|
|
235
|
-
:host([sq])
|
|
209
|
+
:host([sq]) .surface {
|
|
236
210
|
width: 32px;
|
|
237
211
|
height: 32px;
|
|
238
212
|
padding: 0;
|
|
239
213
|
gap: 0;
|
|
240
214
|
}
|
|
241
215
|
|
|
242
|
-
:host([sq][s="sm"])
|
|
216
|
+
:host([sq][s="sm"]) .surface {
|
|
243
217
|
width: 24px;
|
|
244
218
|
height: 24px;
|
|
245
219
|
padding: 0;
|
|
246
220
|
gap: 0;
|
|
247
221
|
}
|
|
248
222
|
|
|
249
|
-
:host([sq][s="lg"])
|
|
223
|
+
:host([sq][s="lg"]) .surface {
|
|
250
224
|
width: 40px;
|
|
251
225
|
height: 40px;
|
|
252
226
|
padding: 0;
|
|
253
227
|
gap: 0;
|
|
254
228
|
}
|
|
255
229
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
a {
|
|
259
|
-
display: contents;
|
|
230
|
+
.surface rtgl-svg {
|
|
231
|
+
color: inherit;
|
|
260
232
|
}
|
|
261
233
|
|
|
262
|
-
${
|
|
263
|
-
|
|
264
|
-
|
|
234
|
+
${Ee}
|
|
235
|
+
|
|
236
|
+
${Vr}
|
|
237
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._containerElement=null,this._surfaceElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._prefixIcon=null,this._suffixIcon=null,this._surfaceElement.className="surface",this._surfaceElement.appendChild(this._slotElement)}static get observedAttributes(){return["key","href","target","rel","w","pre","suf","disabled","v","s","sq"]}connectedCallback(){this._updateButton()}attributeChangedCallback(t,r,s){this._updateButton()}_updateButton(){this.shadow.innerHTML="";let t=this.hasAttribute("disabled"),r=this.getAttribute("href"),s=this.getAttribute("target"),i=this.getAttribute("rel"),n=r&&!t,a=n?"a":"button";if(this._surfaceElement.tagName.toLowerCase()!==a){let l=document.createElement(a);l.className="surface",l.appendChild(this._slotElement),this._surfaceElement=l}this._updateIcon(),this.hasAttribute("sq")?(this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):this._updateWidth(),n?(Le({linkElement:this._surfaceElement,href:r,target:s,rel:i}),this._surfaceElement.removeAttribute("disabled")):(this._surfaceElement.removeAttribute("href"),this._surfaceElement.removeAttribute("target"),this._surfaceElement.removeAttribute("rel"),t?this._surfaceElement.setAttribute("disabled",""):this._surfaceElement.removeAttribute("disabled")),this.shadow.appendChild(this._surfaceElement),this._containerElement=this._surfaceElement}_updateIcon(){this._prefixIcon&&(this._prefixIcon.remove(),this._prefixIcon=null),this._suffixIcon&&(this._suffixIcon.remove(),this._suffixIcon=null);let t={sm:14,md:18,lg:22},r=18;if(this.hasAttribute("sq")){let n={sm:14,lg:22},a=this.getAttribute("s");r=n[a]||18}else r=t[this.getAttribute("s")]||18;let s=this.getAttribute("pre");s&&(this._prefixIcon=document.createElement("rtgl-svg"),this._prefixIcon.setAttribute("svg",s),this._prefixIcon.setAttribute("wh",r.toString()),this._prefixIcon.style.color="inherit",this._surfaceElement.insertBefore(this._prefixIcon,this._slotElement));let i=this.getAttribute("suf");i&&(this._suffixIcon=document.createElement("rtgl-svg"),this._suffixIcon.setAttribute("svg",i),this._suffixIcon.setAttribute("wh",r.toString()),this._suffixIcon.style.color="inherit",this._surfaceElement.appendChild(this._suffixIcon))}_updateWidth(){let t=N(this.getAttribute("w"));t==="f"?(this._surfaceElement.style.width="var(--width-stretch)",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):t!=null?(this._surfaceElement.style.width=t,this._surfaceElement.style.minWidth=t,this._surfaceElement.style.maxWidth=t):(this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth="")}getBoundingClientRect(){return this._surfaceElement?this._surfaceElement.getBoundingClientRect():super.getBoundingClientRect()}},Dr=({render:e,html:t})=>vt;var Br=L`
|
|
265
238
|
|
|
266
239
|
:host([d="h"]) {
|
|
267
240
|
flex-direction: row;
|
|
@@ -318,21 +291,21 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
318
291
|
}
|
|
319
292
|
|
|
320
293
|
@media screen and (max-width: 640px) {
|
|
321
|
-
:host([
|
|
294
|
+
:host([sm-d="v"]) {
|
|
322
295
|
flex-direction: column;
|
|
323
296
|
}
|
|
324
|
-
:host([
|
|
297
|
+
:host([sm-d="h"]) {
|
|
325
298
|
flex-direction: row;
|
|
326
299
|
}
|
|
327
|
-
:host([
|
|
300
|
+
:host([sm-d="h"][sm-av="c"]) {
|
|
328
301
|
align-items: center;
|
|
329
302
|
align-content: center;
|
|
330
303
|
}
|
|
331
|
-
:host([
|
|
304
|
+
:host([sm-d="v"][sm-av="c"]) {
|
|
332
305
|
justify-content: center;
|
|
333
306
|
}
|
|
334
307
|
}
|
|
335
|
-
`;var
|
|
308
|
+
`;var Vn={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out",p:"pointer",m:"move"}},z=G(Vn);var jr=L`
|
|
336
309
|
:host([sh]:not([sv])) {
|
|
337
310
|
overflow-x: scroll;
|
|
338
311
|
flex-wrap: nowrap;
|
|
@@ -354,7 +327,7 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
354
327
|
flex-wrap: nowrap;
|
|
355
328
|
}
|
|
356
329
|
|
|
357
|
-
`;var
|
|
330
|
+
`;var Ne={xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},Dn={bgc:{pr:`
|
|
358
331
|
background-color: var(--primary);
|
|
359
332
|
`,se:`
|
|
360
333
|
background-color: var(--secondary);
|
|
@@ -370,31 +343,31 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
370
343
|
background-color: var(--accent);
|
|
371
344
|
`,bo:`
|
|
372
345
|
background-color: var(--border);
|
|
373
|
-
`},pos:{rel:"relative",abs:"absolute",fix:"fixed"},
|
|
346
|
+
`},pos:{rel:"relative",abs:"absolute",fix:"fixed"},edge:{f:`
|
|
374
347
|
top: 0;
|
|
375
348
|
right: 0;
|
|
376
349
|
bottom: 0;
|
|
377
350
|
left: 0;
|
|
378
351
|
height: 100%;
|
|
379
|
-
`,
|
|
352
|
+
`,t:`
|
|
380
353
|
top: 0;
|
|
381
354
|
right: 0;
|
|
382
355
|
left: 0;
|
|
383
|
-
`,
|
|
356
|
+
`,r:`
|
|
384
357
|
top: 0;
|
|
385
358
|
right: 0;
|
|
386
359
|
bottom: 0;
|
|
387
360
|
height: 100%;
|
|
388
|
-
`,
|
|
361
|
+
`,b:`
|
|
389
362
|
right: 0;
|
|
390
363
|
bottom: 0;
|
|
391
364
|
left: 0;
|
|
392
|
-
`,
|
|
365
|
+
`,l:`
|
|
393
366
|
bottom: 0;
|
|
394
367
|
left: 0;
|
|
395
368
|
top: 0;
|
|
396
369
|
height: 100%;
|
|
397
|
-
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:
|
|
370
|
+
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:S,pr:S,pb:S,pl:S,p:S,ph:S,pv:S,g:S,gv:S,gh:S,bw:Ne,bwt:Ne,bwr:Ne,bwb:Ne,bwl:Ne,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},Wr=G(Dn);var Bn={mt:S,mr:S,mb:S,ml:S,m:S,mh:S,mv:S},J=G(Bn);var bt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
398
371
|
slot {
|
|
399
372
|
display: contents;
|
|
400
373
|
}
|
|
@@ -409,32 +382,19 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
409
382
|
border-color: var(--border);
|
|
410
383
|
}
|
|
411
384
|
|
|
412
|
-
:host([fw="
|
|
385
|
+
:host([fw="wrap"]) {
|
|
413
386
|
flex-wrap: wrap;
|
|
414
387
|
}
|
|
415
388
|
|
|
416
|
-
${we}
|
|
417
|
-
${xr}
|
|
418
|
-
${_r}
|
|
419
|
-
${q}
|
|
420
|
-
${J}
|
|
421
|
-
${We}
|
|
422
|
-
${_e}
|
|
423
|
-
|
|
424
|
-
:host([href]) {
|
|
425
|
-
cursor: pointer;
|
|
426
|
-
position: relative;
|
|
427
|
-
}
|
|
428
389
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","target","op",...ee([...Z,"wh","w","h","hide","show","sh","sv","z","d","ah","av","flex","fw","overflow"])]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");this._slotElement.parentNode!==this.shadow&&this.shadow.appendChild(this._slotElement),t?(this._linkElement||(this._linkElement=document.createElement("a"),this.shadow.appendChild(this._linkElement)),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}connectedCallback(){this.updateStyles()}updateStyles(){this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(r=>{let s=_=>`${r==="default"?"":`${r}-`}${_}`,n=this.getAttribute(s("wh")),i=j(n===null?this.getAttribute(s("w")):n),a=j(n===null?this.getAttribute(s("h")):n),l=this.getAttribute(s("op")),p=this.getAttribute(s("z"));p!==null&&(this._styles[r]["z-index"]=p),l!==null&&(this._styles[r].opacity=l),i==="f"?this._styles[r].width="var(--width-stretch)":i!==void 0&&(this._styles[r].width=i,this._styles[r]["min-width"]=i,this._styles[r]["max-width"]=i),a==="f"?this._styles[r].height="100%":a!==void 0&&(this._styles[r].height=a,this._styles[r]["min-height"]=a,this._styles[r]["max-height"]=a),this.hasAttribute(s("hide"))&&(this._styles[r].display="none"),this.hasAttribute(s("show"))&&(this._styles[r].display="flex");let o=this.getAttribute(s("d")),c=this.getAttribute(s("ah")),u=this.getAttribute(s("av"));o==="h"?this._styles[r]["flex-direction"]="row":o==="v"?this._styles[r]["flex-direction"]="column":r==="default"&&!o&&["sm","md","lg","xl"].some(x=>this.hasAttribute(`${x}-d`))&&(this._styles[r]["flex-direction"]="column");let d=o==="h",f=o==="v"||!o;d&&(c==="c"?this._styles[r]["justify-content"]="center":c==="e"?this._styles[r]["justify-content"]="flex-end":c==="s"&&(this._styles[r]["justify-content"]="flex-start"),u==="c"?(this._styles[r]["align-items"]="center",this._styles[r]["align-content"]="center"):u==="e"?(this._styles[r]["align-items"]="flex-end",this._styles[r]["align-content"]="flex-end"):u==="s"&&(this._styles[r]["align-items"]="flex-start")),f&&(c!==null||u!==null)&&(c==="c"?this._styles[r]["align-items"]="center":c==="e"?this._styles[r]["align-items"]="flex-end":c==="s"&&(this._styles[r]["align-items"]="flex-start"),u==="c"?this._styles[r]["justify-content"]="center":u==="e"?this._styles[r]["justify-content"]="flex-end":u==="s"&&(this._styles[r]["justify-content"]="flex-start"));let h=this.getAttribute(s("flex"));h!==null&&(this._styles[r].flex=h),this.getAttribute(s("fw"))==="w"&&(this._styles[r]["flex-wrap"]="wrap");let b=this.hasAttribute(s("sh")),m=this.hasAttribute(s("sv")),w=this.getAttribute(s("overflow"));b&&m?(this._styles[r].overflow="scroll",this._styles[r]["flex-wrap"]="nowrap"):b?(this._styles[r]["overflow-x"]="scroll",this._styles[r]["flex-wrap"]="nowrap"):m&&(this._styles[r]["overflow-y"]="scroll",this._styles[r]["flex-wrap"]="nowrap"),w==="hidden"&&(this._styles[r].overflow="hidden",this._styles[r]["flex-wrap"]="nowrap")});let t=te(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,r,s){if(t==="href"||t==="target"){this._updateDOM();return}r!==s&&this.updateStyles()}},Ar=({render:e,html:t})=>it;var gi={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
|
|
390
|
+
${jr}
|
|
391
|
+
${Br}
|
|
392
|
+
${J}
|
|
393
|
+
${z}
|
|
394
|
+
${Wr}
|
|
395
|
+
${Ee}
|
|
396
|
+
${Te}
|
|
397
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","target","rel",...ee([...de,"op","wh","w","h","hide","show","sh","sv","z","d","ah","av","fw","overflow"])]}_styles=K();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target"),s=this.getAttribute("rel");this._linkElement=Re({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,target:r,rel:s})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=K(),ne.forEach(r=>{let s=w=>`${r==="default"?"":`${r}-`}${w}`,i=this.getAttribute(s("wh")),n=N(i===null?this.getAttribute(s("w")):i),a=N(i===null?this.getAttribute(s("h")):i),l=this.getAttribute(s("op")),p=this.getAttribute(s("z"));p!==null&&(this._styles[r]["z-index"]=p),l!==null&&(this._styles[r].opacity=l),H({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),H({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(s("hide"))&&(this._styles[r].display="none"),this.hasAttribute(s("show"))&&(this._styles[r].display="flex");let o=this.getAttribute(s("d")),c=this.getAttribute(s("ah")),u=this.getAttribute(s("av"));o==="h"?this._styles[r]["flex-direction"]="row":o==="v"?this._styles[r]["flex-direction"]="column":r==="default"&&!o&&["sm","md","lg","xl"].some(x=>this.hasAttribute(`${x}-d`))&&(this._styles[r]["flex-direction"]="column");let d=o==="h",h=o==="v"||!o;d&&(c==="c"?this._styles[r]["justify-content"]="center":c==="e"?this._styles[r]["justify-content"]="flex-end":c==="s"&&(this._styles[r]["justify-content"]="flex-start"),u==="c"?(this._styles[r]["align-items"]="center",this._styles[r]["align-content"]="center"):u==="e"?(this._styles[r]["align-items"]="flex-end",this._styles[r]["align-content"]="flex-end"):u==="s"&&(this._styles[r]["align-items"]="flex-start")),h&&(c!==null||u!==null)&&(c==="c"?this._styles[r]["align-items"]="center":c==="e"?this._styles[r]["align-items"]="flex-end":c==="s"&&(this._styles[r]["align-items"]="flex-start"),u==="c"?this._styles[r]["justify-content"]="center":u==="e"?this._styles[r]["justify-content"]="flex-end":u==="s"&&(this._styles[r]["justify-content"]="flex-start")),this.getAttribute(s("fw"))==="wrap"&&(this._styles[r]["flex-wrap"]="wrap");let m=this.hasAttribute(s("sh")),g=this.hasAttribute(s("sv")),y=this.getAttribute(s("overflow"));m&&g?(this._styles[r].overflow="scroll",this._styles[r]["flex-wrap"]="nowrap"):m?(this._styles[r]["overflow-x"]="scroll",this._styles[r]["flex-wrap"]="nowrap"):g&&(this._styles[r]["overflow-y"]="scroll",this._styles[r]["flex-wrap"]="nowrap"),y==="hidden"&&(this._styles[r].overflow="hidden",this._styles[r]["flex-wrap"]="nowrap")});let t=te(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,r,s){if(t==="href"||t==="target"||t==="rel"){this._updateDOM();return}r!==s&&this.updateStyles()}},Mr=({render:e,html:t})=>bt;var jn={ta:{s:"text-align: start;",c:"text-align: center;",e:"text-align: end;",j:"text-align: justify;"},s:{h1:`
|
|
438
398
|
font-size: var(--h1-font-size);
|
|
439
399
|
font-weight: var(--h1-font-weight);
|
|
440
400
|
line-height: var(--h1-line-height);
|
|
@@ -474,7 +434,7 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
474
434
|
font-weight: var(--xs-font-weight);
|
|
475
435
|
line-height: var(--xs-line-height);
|
|
476
436
|
letter-spacing: var(--xs-letter-spacing);
|
|
477
|
-
`}},
|
|
437
|
+
`}},Fr=G(jn);var Wn={c:{pr:"color: var(--primary);",se:"color: var(--secondary);",de:"color: var(--destructive);",fg:"color: var(--foreground);",bg:"color: var(--background);",mu:"color: var(--muted-foreground);",ac:"color: var(--accent);",bo:"color: var(--border);",tr:"color: transparent;","pr-fg":"color: var(--primary-foreground);","se-fg":"color: var(--secondary-foreground);","de-fg":"color: var(--destructive-foreground);","mu-fg":"color: var(--muted-foreground);","ac-fg":"color: var(--accent-foreground);"}},Ge=G(Wn);var wt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
478
438
|
:host {
|
|
479
439
|
display: block;
|
|
480
440
|
font-size: var(--md-font-size);
|
|
@@ -493,32 +453,21 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
493
453
|
text-decoration: var(--anchor-text-decoration-hover);
|
|
494
454
|
color: var(--anchor-color-hover);
|
|
495
455
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
}
|
|
500
|
-
:host([href]) a {
|
|
501
|
-
position: absolute;
|
|
502
|
-
top: 0;
|
|
503
|
-
left: 0;
|
|
504
|
-
right: 0;
|
|
505
|
-
bottom: 0;
|
|
506
|
-
z-index: 1;
|
|
507
|
-
}
|
|
508
|
-
${Er}
|
|
509
|
-
${Me}
|
|
510
|
-
${q}
|
|
456
|
+
${Te}
|
|
457
|
+
${Fr}
|
|
458
|
+
${Ge}
|
|
511
459
|
${J}
|
|
512
|
-
|
|
460
|
+
${z}
|
|
461
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","target","rel"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,r,s){t==="href"||t==="target"||t==="rel"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=N(this.getAttribute("w"));this.hasAttribute("ellipsis")?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace=""),gt({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target"),s=this.getAttribute("rel");this._linkElement=Re({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,target:r,rel:s})}},zr=({render:e,html:t})=>wt;var Pe={xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},Mn={bgc:{pr:"background-color: var(--primary);",se:"background-color: var(--secondary);",de:"background-color: var(--destructive);",fg:"background-color: var(--foreground);",bg:"background-color: var(--background);",mu:"background-color: var(--muted);",ac:"background-color: var(--accent);",bo:"background-color: var(--border);"},pos:{rel:"relative",abs:"absolute",fix:"fixed"},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},bw:Pe,bwt:Pe,bwr:Pe,bwb:Pe,bwl:Pe,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},Ur=e=>G(Mn,{},e);var Fn={mt:S,mr:S,mb:S,ml:S,m:S,mh:S,mv:S},Kr=e=>G(Fn,{},e);var xt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
513
462
|
:host {
|
|
463
|
+
display: contents;
|
|
464
|
+
}
|
|
465
|
+
img, a {
|
|
514
466
|
border-style: solid;
|
|
515
467
|
box-sizing: border-box;
|
|
516
468
|
overflow: hidden;
|
|
517
469
|
border-width: 0;
|
|
518
470
|
}
|
|
519
|
-
slot {
|
|
520
|
-
display: contents;
|
|
521
|
-
}
|
|
522
471
|
:host([of="con"]) img {
|
|
523
472
|
object-fit: contain;
|
|
524
473
|
}
|
|
@@ -528,10 +477,6 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
528
477
|
:host([of="none"]) img {
|
|
529
478
|
object-fit: none;
|
|
530
479
|
}
|
|
531
|
-
img {
|
|
532
|
-
height: 100%;
|
|
533
|
-
width: 100%;
|
|
534
|
-
}
|
|
535
480
|
:host([w]:not([h]):not([wh])) img,
|
|
536
481
|
:host([sm-w]:not([sm-h]):not([sm-wh])) img,
|
|
537
482
|
:host([md-w]:not([md-h]):not([md-wh])) img,
|
|
@@ -540,7 +485,7 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
540
485
|
height: auto;
|
|
541
486
|
}
|
|
542
487
|
|
|
543
|
-
${
|
|
488
|
+
${Ee}
|
|
544
489
|
|
|
545
490
|
a {
|
|
546
491
|
display: block;
|
|
@@ -548,14 +493,10 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
548
493
|
width: 100%;
|
|
549
494
|
}
|
|
550
495
|
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
${We}
|
|
556
|
-
${q}
|
|
557
|
-
${J}
|
|
558
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return ee([...Z,"key","src","href","target","wh","w","h","hide","show","height","width","z"])}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");t?(this._linkElement||(this._linkElement=document.createElement("a")),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target"),this._linkElement.appendChild(this._imgElement),this._linkElement.parentNode!==this.shadow&&this.shadow.appendChild(this._linkElement)):this._linkElement?(this._imgElement.parentNode===this._linkElement&&this.shadow.appendChild(this._imgElement),this._linkElement.parentNode===this.shadow&&this.shadow.removeChild(this._linkElement),this._linkElement=null):this._imgElement.parentNode!==this.shadow&&this.shadow.appendChild(this._imgElement)}attributeChangedCallback(t,r,s){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(i=>{let a=d=>`${i==="default"?"":`${i}-`}${d}`,l=this.getAttribute(a("wh")),p=j(l===null?this.getAttribute(a("w")):l),o=j(l===null?this.getAttribute(a("h")):l),c=this.getAttribute(a("o")),u=this.getAttribute(a("z"));u!==null&&(this._styles[i]["z-index"]=u),c!==null&&(this._styles[i].opacity=c),p==="f"?this._styles[i].width="var(--width-stretch)":p!==void 0&&(this._styles[i].width=p,this._styles[i]["min-width"]=p,this._styles[i]["max-width"]=p),o==="f"?this._styles[i].height="100%":o!==void 0&&(this._styles[i].height=o,this._styles[i]["min-height"]=o,this._styles[i]["max-height"]=o),this.hasAttribute(a("hide"))&&(this._styles[i].display="none !important"),this.hasAttribute(a("show"))&&(this._styles[i].display="block !important")});let n=te(this._styles);n!==this._lastStyleString&&(this._styleElement.textContent=n,this._lastStyleString=n),this._updateImageAttributes()}_updateImageAttributes(){let t=this.getAttribute("src"),r=this.getAttribute("width"),s=this.getAttribute("height");t!==null&&this._imgElement.setAttribute("src",t),r!==null&&this._imgElement.setAttribute("width",r),s!==null&&this._imgElement.setAttribute("height",s)}connectedCallback(){this._updateImageAttributes()}},$r=({render:e,html:t})=>at;var Sr=L`
|
|
496
|
+
${Ur("img, a")}
|
|
497
|
+
${Kr("img, a")}
|
|
498
|
+
${z}
|
|
499
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return ee([...de,"key","src","alt","href","target","rel","wh","w","h","hide","show","op","z","of"])}_styles=K();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target"),s=this.getAttribute("rel");this._linkElement=mt({shadowRoot:this.shadow,childElement:this._imgElement,linkElement:this._linkElement,href:t,target:r,rel:s})}connectedCallback(){this._updateImageAttributes(),this.updateStyles()}attributeChangedCallback(t,r,s){if(t==="href"||t==="target"||t==="rel"){this._updateDOM();return}if(t==="src"||t==="alt"){this._updateImageAttributes();return}r!==s&&this.updateStyles()}updateStyles(){this._styles=K(),ne.forEach(r=>{let s=o=>`${r==="default"?"":`${r}-`}${o}`,i=this.getAttribute(s("wh")),n=N(i===null?this.getAttribute(s("w")):i),a=N(i===null?this.getAttribute(s("h")):i),l=this.getAttribute(s("op")),p=this.getAttribute(s("z"));p!==null&&(this._styles[r]["z-index"]=p),l!==null&&(this._styles[r].opacity=l),H({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),H({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[r].display="none !important"),this.hasAttribute(s("show"))&&(this._styles[r].display="block !important")});let t=te(this._styles,"img, a");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_updateImageAttributes(){let t=this.getAttribute("src"),r=this.getAttribute("alt");t!==null?this._imgElement.setAttribute("src",t):this._imgElement.removeAttribute("src"),r!==null?this._imgElement.setAttribute("alt",r):this._imgElement.removeAttribute("alt")}},Hr=({render:e,html:t})=>xt;var Gr=L`
|
|
559
500
|
:host([pt="xs"]) svg {
|
|
560
501
|
padding-top: var(--spacing-xs);
|
|
561
502
|
}
|
|
@@ -671,17 +612,16 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
671
612
|
padding-top: var(--spacing-xl);
|
|
672
613
|
padding-bottom: var(--spacing-xl);
|
|
673
614
|
}
|
|
674
|
-
`;var
|
|
615
|
+
`;var _t=class e extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
675
616
|
:host {
|
|
676
617
|
color: var(--foreground);
|
|
677
618
|
flex-shrink: 0;
|
|
678
619
|
}
|
|
679
|
-
${
|
|
680
|
-
${
|
|
681
|
-
${q}
|
|
682
|
-
${we}
|
|
620
|
+
${Ge}
|
|
621
|
+
${Gr}
|
|
683
622
|
${J}
|
|
684
|
-
|
|
623
|
+
${z}
|
|
624
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return e._icons}static addIcon(t,r){e._icons[t]=r}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,r,s){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),r=N(t===null?this.getAttribute("w"):t),s=N(t===null?this.getAttribute("h"):t);r!=null?this.style.width=r:this.style.width="",s!=null?this.style.height=s:this.style.height=""}_render(){try{let t=this.getAttribute("svg"),r=e._icons[t]||(window.rtglIcons||{})[t];if(r){this.shadow.innerHTML=r;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},Jr=({render:e,html:t})=>_t;var zn=["mt","mr","mb","ml","m","mh","mv","cur"],At=class e extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["type","disabled","s"];static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
685
625
|
:host {
|
|
686
626
|
display: contents;
|
|
687
627
|
}
|
|
@@ -714,9 +654,9 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
714
654
|
input:disabled {
|
|
715
655
|
cursor: not-allowed;
|
|
716
656
|
}
|
|
717
|
-
${q}
|
|
718
657
|
${J}
|
|
719
|
-
|
|
658
|
+
${z}
|
|
659
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=K(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","s",...ee([...zn,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,r,s){if(r!==s){if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(e.inputSpecificAttributes.includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=K(),ne.forEach(r=>{let s=o=>`${r==="default"?"":`${r}-`}${o}`,i=this.getAttribute(s("wh")),n=N(i===null?this.getAttribute(s("w")):i),a=N(i===null?this.getAttribute(s("h")):i),l=this.getAttribute(s("op")),p=this.getAttribute(s("z"));p!==null&&(this._styles[r]["z-index"]=p),l!==null&&(this._styles[r].opacity=l),H({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),H({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[r].display="none"),this.hasAttribute(s("show"))&&(this._styles[r].display="block")});let t=te(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,r){if(r==null||r==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,r)}_syncValueAttribute(){this._inputElement.value=this.getAttribute("value")??""}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let r=this.getAttribute("type")==="password"?"password":"text",s=this.hasAttribute("disabled");this._setOrRemoveInputAttribute("type",r),s?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},qr=({render:e,html:t})=>At;var Un=["mt","mr","mb","ml","m","mh","mv","cur"],Et=class e extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["disabled","step","min","max","s"];static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
720
660
|
:host {
|
|
721
661
|
display: contents;
|
|
722
662
|
}
|
|
@@ -749,9 +689,9 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
749
689
|
input:disabled {
|
|
750
690
|
cursor: not-allowed;
|
|
751
691
|
}
|
|
752
|
-
${q}
|
|
753
692
|
${J}
|
|
754
|
-
|
|
693
|
+
${z}
|
|
694
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=K(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","placeholder","disabled","value","step","min","max","s",...ee([...Un,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_emitValueEvent=t=>{let r=this._inputElement.value;if(r.trim()===""){this.dispatchEvent(new CustomEvent(t,{detail:{value:null},bubbles:!0}));return}let s=parseFloat(r);isNaN(s)||(s=this._clampValueToBounds(s),this._inputElement.value=s.toString(),this.dispatchEvent(new CustomEvent(t,{detail:{value:s},bubbles:!0})))};_onInput=()=>{this._emitValueEvent("value-input")};_onChange=()=>{this._emitValueEvent("value-change")};attributeChangedCallback(t,r,s){if(r!==s){if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(e.inputSpecificAttributes.includes(t)){this._updateInputAttributes(),(t==="min"||t==="max")&&this._syncValueAttribute();return}this.updateStyles()}}updateStyles(){this._styles=K(),ne.forEach(r=>{let s=o=>`${r==="default"?"":`${r}-`}${o}`,i=this.getAttribute(s("wh")),n=N(i===null?this.getAttribute(s("w")):i),a=N(i===null?this.getAttribute(s("h")):i),l=this.getAttribute(s("op")),p=this.getAttribute(s("z"));p!==null&&(this._styles[r]["z-index"]=p),l!==null&&(this._styles[r].opacity=l),H({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),H({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[r].display="none"),this.hasAttribute(s("show"))&&(this._styles[r].display="block")});let t=te(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,r){if(r==null||r==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,r)}_clampValueToBounds(t){let r=t,s=this.getAttribute("min");if(s!==null){let n=parseFloat(s);isNaN(n)||(r=Math.max(r,n))}let i=this.getAttribute("max");if(i!==null){let n=parseFloat(i);isNaN(n)||(r=Math.min(r,n))}return r}_syncValueAttribute(){let t=this.getAttribute("value");if(t==null||t===""){this._inputElement.value="";return}let r=parseFloat(t);if(isNaN(r)){this._inputElement.value="";return}let s=this._clampValueToBounds(r);this._inputElement.value=s.toString()}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("step"),r=this.getAttribute("min"),s=this.getAttribute("max"),i=this.hasAttribute("disabled");this._inputElement.setAttribute("type","number"),this._setOrRemoveInputAttribute("step",t),this._setOrRemoveInputAttribute("min",r),this._setOrRemoveInputAttribute("max",s),i?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},Yr=({render:e,html:t})=>Et;var $t=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
755
695
|
:host {
|
|
756
696
|
display: contents;
|
|
757
697
|
}
|
|
@@ -774,9 +714,9 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
774
714
|
textarea:focus {
|
|
775
715
|
border-color: var(--foreground);
|
|
776
716
|
}
|
|
777
|
-
${q}
|
|
778
717
|
${J}
|
|
779
|
-
|
|
718
|
+
${z}
|
|
719
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._textareaElement=document.createElement("textarea"),this._textareaElement.setAttribute("type","text"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onInput),this._textareaElement.addEventListener("change",this._onChange)}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._textareaElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._textareaElement.value},bubbles:!0}))};static get observedAttributes(){return["key","type","placeholder","disabled","value","cols","rows","ellipsis",...ee([...de,"wh","w","h","hide","show","op","z"])]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}focus(){this._textareaElement&&this._textareaElement.focus()}select(){this._textareaElement&&this._textareaElement.select()}attributeChangedCallback(t,r,s){if(t==="value"&&requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""}),t==="placeholder"&&requestAnimationFrame(()=>{let n=this.getAttribute("placeholder");n===void 0||n==="null"?this._textareaElement.removeAttribute("placeholder"):this._textareaElement.setAttribute("placeholder",n??"")}),["cols","rows","disabled"].includes(t)){this._updateTextareaAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=d=>`${n==="default"?"":`${n}-`}${d}`,l=this.getAttribute(a("wh")),p=N(l===null?this.getAttribute(a("w")):l),o=N(l===null?this.getAttribute(a("h")):l),c=this.getAttribute(a("op")),u=this.getAttribute(a("z"));u!==null&&(this._styles[n]["z-index"]=u),c!==null&&(this._styles[n].opacity=c),p==="f"?this._styles[n].width="var(--width-stretch)":p!==void 0&&(this._styles[n].width=p,this._styles[n]["min-width"]=p,this._styles[n]["max-width"]=p),o==="f"?this._styles[n].height="100%":o!==void 0&&(this._styles[n].height=o,this._styles[n]["min-height"]=o,this._styles[n]["max-height"]=o),this.hasAttribute(a("hide"))&&(this._styles[n].display="none"),this.hasAttribute(a("show"))&&(this._styles[n].display="block")});let i=te(this._styles,"textarea");i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateTextareaAttributes(){let t=this.getAttribute("cols"),r=this.getAttribute("rows"),s=this.hasAttribute("disabled");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),r!==null?this._textareaElement.setAttribute("rows",r):this._textareaElement.removeAttribute("rows"),s?this._textareaElement.setAttribute("disabled",""):this._textareaElement.removeAttribute("disabled")}},Xr=({render:e,html:t})=>$t;var Kn=["mt","mr","mb","ml","m","mh","mv","cur"],Hn=/^#[0-9a-fA-F]{6}$/,kt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
780
720
|
:host {
|
|
781
721
|
display: contents;
|
|
782
722
|
}
|
|
@@ -797,9 +737,9 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
797
737
|
cursor: not-allowed;
|
|
798
738
|
opacity: 0.5;
|
|
799
739
|
}
|
|
800
|
-
${q}
|
|
801
740
|
${J}
|
|
802
|
-
|
|
741
|
+
${z}
|
|
742
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=K(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="color",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("change",this._onChange),this._inputElement.addEventListener("input",this._onInput)}static get observedAttributes(){return["key","value","disabled",...ee([...Kn,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,r,s){if(r!==s){if(t==="key"){this._syncValueAttribute();return}if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=K(),ne.forEach(r=>{let s=o=>`${r==="default"?"":`${r}-`}${o}`,i=this.getAttribute(s("wh")),n=N(i===null?this.getAttribute(s("w")):i),a=N(i===null?this.getAttribute(s("h")):i),l=this.getAttribute(s("op")),p=this.getAttribute(s("z"));p!==null&&(this._styles[r]["z-index"]=p),l!==null&&(this._styles[r].opacity=l),H({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),H({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[r].display="none"),this.hasAttribute(s("show"))&&(this._styles[r].display="block")});let t=te(this._styles,'input[type="color"]');t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_syncValueAttribute(){let t=this.getAttribute("value");if(t===null){this._inputElement.value="#000000";return}this._inputElement.value=Hn.test(t)?t:"#000000"}_updateInputAttributes(){let t=this.hasAttribute("disabled");this._syncValueAttribute(),t?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this.updateStyles()}},Zr=({render:e,html:t})=>kt;var St=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
803
743
|
:host {
|
|
804
744
|
display: contents;
|
|
805
745
|
}
|
|
@@ -851,9 +791,9 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
851
791
|
input[type="range"]:disabled::-moz-range-thumb {
|
|
852
792
|
cursor: not-allowed;
|
|
853
793
|
}
|
|
854
|
-
${q}
|
|
855
794
|
${J}
|
|
856
|
-
|
|
795
|
+
${z}
|
|
796
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",...ee([...de,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};attributeChangedCallback(t,r,s){if(t==="key"&&r!==s){requestAnimationFrame(()=>{let n=this.getAttribute("value"),a=this.getAttribute("min")||"0";this._inputElement.value=n??a});return}if(["value","min","max","step","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=d=>`${n==="default"?"":`${n}-`}${d}`,l=this.getAttribute(a("wh")),p=N(l===null?this.getAttribute(a("w")):l),o=N(l===null?this.getAttribute(a("h")):l),c=this.getAttribute(a("op")),u=this.getAttribute(a("z"));u!==null&&(this._styles[n]["z-index"]=u),c!==null&&(this._styles[n].opacity=c),p==="f"?this._styles[n].width="var(--width-stretch)":p!==void 0&&(this._styles[n].width=p,this._styles[n]["min-width"]=p,this._styles[n]["max-width"]=p),o==="f"?this._styles[n].height="100%":o!==void 0&&(this._styles[n].height=o,this._styles[n]["min-height"]=o,this._styles[n]["max-height"]=o),this.hasAttribute(a("hide"))&&(this._styles[n].display="none"),this.hasAttribute(a("show"))&&(this._styles[n].display="block")});let i=te(this._styles,'input[type="range"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.getAttribute("min"),s=this.getAttribute("max"),i=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null?this._inputElement.value=t:this._inputElement.value=r??0,r!==null?this._inputElement.min=r:this._inputElement.min="0",s!==null?this._inputElement.max=s:this._inputElement.max="100",i!==null?this._inputElement.step=i:this._inputElement.step="1",n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Qr=({render:e,html:t})=>St;var Ct=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
857
797
|
:host {
|
|
858
798
|
display: contents;
|
|
859
799
|
}
|
|
@@ -924,7 +864,7 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
924
864
|
dialog[open] slot[name="content"] {
|
|
925
865
|
animation: dialog-in 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
926
866
|
}
|
|
927
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._mouseDownInContent=!1,this._dialogElement.addEventListener("mousedown",t=>{this._mouseDownInContent=t.target!==this._dialogElement}),this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&this._attemptClose(),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&(t.preventDefault(),this._attemptClose()),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._attemptClose()})}_attemptClose(){this.dispatchEvent(new CustomEvent("close",{detail:{}}))}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}attributeChangedCallback(t,r,s){t==="open"?s!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():s===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0,this._applyAdaptiveCentering())}_hideModal(){this._dialogElement.open&&(this._dialogElement.close(),this._slotElement&&(this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.removeChild(this._slotElement),this._slotElement=null),this._dialogElement.style.height="")}_applyAdaptiveCentering(){this._slotElement&&requestAnimationFrame(()=>{if(!this._slotElement)return;let t=this._slotElement.offsetHeight,r=window.innerHeight,s=40;if(t>=r-2*s)this._slotElement.style.marginTop=`${s}px`,this._slotElement.style.marginBottom=`${s}px`,this._dialogElement.style.height="100vh";else{let
|
|
867
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._mouseDownInContent=!1,this._dialogElement.addEventListener("mousedown",t=>{this._mouseDownInContent=t.target!==this._dialogElement}),this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&this._attemptClose(),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&(t.preventDefault(),this._attemptClose()),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._attemptClose()})}_attemptClose(){this.dispatchEvent(new CustomEvent("close",{detail:{}}))}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}attributeChangedCallback(t,r,s){t==="open"?s!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():s===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0,this._applyAdaptiveCentering())}_hideModal(){this._dialogElement.open&&(this._dialogElement.close(),this._slotElement&&(this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.removeChild(this._slotElement),this._slotElement=null),this._dialogElement.style.height="")}_applyAdaptiveCentering(){this._slotElement&&requestAnimationFrame(()=>{if(!this._slotElement)return;let t=this._slotElement.offsetHeight,r=window.innerHeight,s=40;if(t>=r-2*s)this._slotElement.style.marginTop=`${s}px`,this._slotElement.style.marginBottom=`${s}px`,this._dialogElement.style.height="100vh";else{let i=r-t,n=Math.floor(i/2);this._slotElement.style.marginTop=`${n}px`,this._slotElement.style.marginBottom=`${n}px`,this._dialogElement.style.height="auto"}})}get dialog(){return this._dialogElement}},es=({render:e,html:t})=>Ct;var It=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
928
868
|
:host {
|
|
929
869
|
display: contents;
|
|
930
870
|
}
|
|
@@ -978,28 +918,28 @@ var rettangoli=(()=>{var li=Object.defineProperty;var N=(e,t)=>{for(var r in t)l
|
|
|
978
918
|
min-width: 200px;
|
|
979
919
|
max-width: 400px;
|
|
980
920
|
}
|
|
981
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let r=t.composedPath();(r[0]===this._dialogElement||r[0].nodeName==="DIALOG"&&r[0]===this._dialogElement)&&this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._dialogElement.addEventListener("contextmenu",t=>{let r=t.composedPath();(r[0]===this._dialogElement||r[0].nodeName==="DIALOG"&&r[0]===this._dialogElement)&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}})))}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._isOpen=!1}static get observedAttributes(){return["open","x","y","placement"]}connectedCallback(){this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._isOpen&&this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,r,s){t==="open"?s!==null&&!this._isOpen?this.isConnected&&this._show():s===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="placement")&&this._isOpen&&this._updatePosition()}_show(){this._isOpen||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._dialogElement.open||setTimeout(()=>{this._dialogElement&&!this._dialogElement.open&&(this.hasAttribute("no-overlay")?this._dialogElement.show():this._dialogElement.showModal())},0),requestAnimationFrame(()=>{this._updatePosition()}))}_hide(){this._isOpen&&(this._isOpen=!1,this._dialogElement.open&&this._dialogElement.close(),this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_updatePosition(){let t=parseFloat(this.getAttribute("x")||"0"),r=parseFloat(this.getAttribute("y")||"0"),s=this.getAttribute("placement")||"bottom-start";this.removeAttribute("positioned"),requestAnimationFrame(()=>{let n=this._popoverContainer.getBoundingClientRect(),{left:i,top:a}=this._calculatePosition(t,r,n.width,n.height,s);this._popoverContainer.style.left=`${i}px`,this._popoverContainer.style.top=`${a}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,r,s,n,i){let l=t,p=r;switch(i){case"top":l=t-s/2,p=r-n-8;break;case"top-start":l=t,p=r-n-8;break;case"top-end":l=t-s,p=r-n-8;break;case"right":l=t+8,p=r-n/2;break;case"right-start":l=t+8,p=r;break;case"right-end":l=t+8,p=r-n;break;case"bottom":l=t-s/2,p=r+8;break;case"bottom-start":l=t,p=r+8;break;case"bottom-end":l=t-s,p=r+8;break;case"left":l=t-s-8,p=r-n/2;break;case"left-start":l=t-s-8,p=r;break;case"left-end":l=t-s-8,p=r-n;break}let o=8;return l=Math.max(o,Math.min(l,window.innerWidth-s-o)),p=Math.max(o,Math.min(p,window.innerHeight-n-o)),{left:l,top:p}}get popover(){return this._popoverContainer}},Vr=({render:e,html:t})=>ft;var yt={};N(yt,{handleClickHeader:()=>bi});var bi=(e,t)=>{let{store:r,render:s}=e;r.toggleOpen(),s()};var mt={};N(mt,{createInitialState:()=>wi,selectViewData:()=>Ai,toggleOpen:()=>Ei});var wi=()=>Object.freeze({open:!1}),_i=["id","class","style","slot","title","content"],xi=e=>Object.entries(e).filter(([t])=>!_i.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Ai=({state:e,props:t,attrs:r})=>({title:r.title||"",content:r.content||"",openClass:e.open?"content-wrapper open":"content-wrapper",chevronIcon:e.open?"chevronUp":"chevronDown",containerAttrString:xi(r)}),Ei=e=>{e.open=!e.open};var Pr={elementName:"rtgl-accordion-item",viewDataSchema:{type:"object",properties:{title:{type:"string"},content:{type:"string"},openClass:{type:"string"},chevronIcon:{type:"string"},containerAttrString:{type:"string"}}},attrsSchema:{type:"object",properties:{title:{type:"string"},content:{type:"string"},w:{type:"string"}}},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=p",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"title"}}],fast:!0},{type:8,properties:[{key:"rtgl-view flex=1",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",value:{type:1,path:"content"}}],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}};var gt={};N(gt,{handleClickItem:()=>ki});var ki=(e,t)=>{let{dispatchEvent:r}=e,n=t._event.currentTarget.dataset.id;r(new CustomEvent("item-click",{detail:{id:n}}))};var vt={};N(vt,{createInitialState:()=>$i,selectViewData:()=>Ii});var $i=()=>Object.freeze({}),Si=["id","class","style","slot"],Ci=e=>Object.entries(e).filter(([t])=>!Si.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Ii=({props:e,attrs:t})=>{let r=Ci(t),s=e.items||[],n=e.separator||"breadcrumb-arrow",i=[];return s.forEach((a,l)=>{i.push(a),l<s.length-1&&i.push({isSeparator:!0})}),{containerAttrString:r,items:i,separator:n}};var Dr={elementName:"rtgl-breadcrumb",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"}}}},separator:{type:"string"}}},propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"}}}},separator:{type:"string",default:"breadcrumb-arrow"}}},refs:{"item-*":{eventListeners:{click:{handler:"handleClickItem"}}}},events:{"item-click":{type:"object",properties:{item:{type:"object",properties:{label:{type:"string"},id:{type:"string"}}},index:{type:"number"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md p=sm ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:null,iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isSeparator",value:{type:6,conditions:[{type:1,path:"item.isSeparator"},{type:1,path:"item.id"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${separator} c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"separator"}," c=mu-fg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#item-${item.id} data-id=${item.id} cur=p",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#item-",{type:1,path:"item.id"}," data-id=",{type:1,path:"item.id"}," cur=p"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md p=sm ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var bt={};N(bt,{handleClickMenuItem:()=>Ti,handleClosePopover:()=>Oi});var Oi=(e,t)=>{let{dispatchEvent:r}=e;r(new CustomEvent("close"))},Ti=(e,t)=>{let{dispatchEvent:r,props:s}=e,n=t._event,i=parseInt(n.currentTarget.id.replace("option-","")),a=s.items[i];r(new CustomEvent("click-item",{detail:{index:i,item:a}}))};var wt={};N(wt,{createInitialState:()=>Li,selectViewData:()=>Ri});var Li=()=>Object.freeze({}),Ri=({props:e,attrs:t})=>({items:e.items||[],open:!!t.open,x:t.x,y:t.y,placement:t.placement});var jr={elementName:"rtgl-dropdown-menu",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["label","item","separator"]},testId:{type:"string"}}}}}},attrsSchema:{type:"object",properties:{open:{type:"string"},x:{type:"string"},y:{type:"string"},placement:{type:"string"}}},refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option-*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} placement=${placement}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 sv g=xs slot=content bgc=background br=md",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.type == 'label'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"label"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"item"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"separator"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f ph=lg pv=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option-${i} w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=mu data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option-",{type:1,path:"i"}," w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=mu data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 ph=lg mv=md bgc=bo",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," placement=",{type:1,path:"placement"}]}}],fast:!1}],fast:!1}};var _t={};N(_t,{handleActionClick:()=>ji,handleAfterMount:()=>Pi,handleBeforeMount:()=>Vi,handleColorPickerChange:()=>Mi,handleImageClick:()=>Ui,handleInputChange:()=>Bi,handleKeyDown:()=>Gi,handleOnUpdate:()=>Di,handleSelectAddOption:()=>Hi,handleSelectChange:()=>Wi,handleSliderChange:()=>Fi,handleSliderInputChange:()=>Ki,handleTooltipMouseEnter:()=>Ji,handleTooltipMouseLeave:()=>qi,handleWaveformClick:()=>zi});var Br=({form:e,defaultValues:t={},refs:r})=>{let{fields:s=[]}=e;s.forEach(n=>{let i=r[`field-${n.name}`]?.elm;if(i){if(["input-textarea","inputText","input-text","input-number","colorPicker","slider","slider-input","popover-input"].includes(n.inputType)){let a=t[n.name];a==null?i.removeAttribute("value"):i.setAttribute("value",a)}["inputText","input-text","input-textarea"].includes(n.inputType)&&n.placeholder&&i.getAttribute("placeholder")!==n.placeholder&&(n.placeholder===void 0||n.placeholder===null?i.removeAttribute("placeholder"):i.setAttribute("placeholder",n.placeholder))}})},Ni=e=>{for(let t in e)if(t.startsWith("field-")){let r=e[t];if(r&&r.elm){let s=r.elm;if(s.focus){s.focus();return}}}},Vi=e=>{let{store:t,props:r}=e;t.setFormValues(r.defaultValues)},Pi=e=>{let{props:t,getRefIds:r,render:s,attrs:n}=e,{form:i={},defaultValues:a}=t,l=r();Br({form:i,defaultValues:a,refs:l}),s(),n?.autofocus&&setTimeout(()=>{Ni(l)},50)},Di=(e,t)=>{let{oldAttrs:r,newAttrs:s,newProps:n}=t,{store:i,render:a,getRefIds:l}=e,{form:p={},defaultValues:o}=n;if(r?.key!==s?.key){let c=l();Br({form:p,defaultValues:o,refs:c}),i.setFormValues(o),a();return}a()},Oe=(e,t,r,s)=>{s(new CustomEvent("form-change",{detail:{name:e,fieldValue:t,formValues:r}}))},ji=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t._event.currentTarget.id.replace("action-","");s(new CustomEvent("action-click",{detail:{actionId:i,formValues:r.selectFormValues()}}))},Bi=(e,t)=>{let{store:r,dispatchEvent:s,props:n}=e,i=t._event,a=i.currentTarget.id.replace("field-","");if(a&&i.detail.value!==void 0){let l=i.detail.value;r.setFormFieldValue({name:a,value:l,props:n}),Oe(a,l,r.selectFormValues(),s)}},Wi=(e,t)=>{let{store:r,dispatchEvent:s,render:n,props:i}=e,a=t._event,l=a.currentTarget.id.replace("field-","");l&&(r.setFormFieldValue({name:l,value:a.detail.selectedValue,props:i}),Oe(l,a.detail.selectedValue,r.selectFormValues(),s),n())},Mi=(e,t)=>{let{store:r,dispatchEvent:s,props:n}=e,i=t._event,a=i.currentTarget.id.replace("field-","");a&&i.detail.value!==void 0&&(r.setFormFieldValue({name:a,value:i.detail.value,props:n}),Oe(a,i.detail.value,r.selectFormValues(),s))},Fi=(e,t)=>{let{store:r,dispatchEvent:s,props:n}=e,i=t._event,a=i.currentTarget.id.replace("field-","");a&&i.detail.value!==void 0&&(r.setFormFieldValue({name:a,value:i.detail.value,props:n}),Oe(a,i.detail.value,r.selectFormValues(),s))},Ki=(e,t)=>{let{store:r,dispatchEvent:s,props:n}=e,i=t._event,a=i.currentTarget.id.replace("field-","");a&&i.detail.value!==void 0&&(r.setFormFieldValue({name:a,value:i.detail.value,props:n}),Oe(a,i.detail.value,r.selectFormValues(),s))},Ui=(e,t)=>{let r=t._event;r.type==="contextmenu"&&r.preventDefault();let{dispatchEvent:s}=e,n=r.currentTarget.id.replace("image-","");s(new CustomEvent("extra-event",{detail:{name:n,x:r.clientX,y:r.clientY,trigger:r.type}}))},zi=(e,t)=>{let r=t._event;r.type==="contextmenu"&&r.preventDefault();let{dispatchEvent:s}=e,n=r.currentTarget.id.replace("waveform-","");s(new CustomEvent("extra-event",{detail:{name:n,x:r.clientX,y:r.clientY,trigger:r.type}}))},Hi=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t._event.currentTarget.id.replace("field-","");s(new CustomEvent("action-click",{detail:{actionId:"select-options-add",name:i,formValues:r.selectFormValues()}}))},Ji=(e,t)=>{let{store:r,render:s,props:n}=e,i=t._event,a=i.currentTarget.id.replace("tooltip-icon-",""),p=n.form.fields.find(o=>o.name===a);if(p&&p.tooltip){let o=i.currentTarget.getBoundingClientRect();r.showTooltip({x:o.left+o.width/2,y:o.top-8,content:p.tooltip.content}),s()}},qi=e=>{let{store:t,render:r}=e;t.hideTooltip(),r()},Gi=(e,t)=>{let{store:r,dispatchEvent:s,props:n}=e,i=t._event;if(i.key==="Enter"&&!i.shiftKey){let a=i.target;if(a.tagName==="TEXTAREA"||a.tagName==="RTGL-TEXTAREA")return;i.preventDefault();let o=((n.form||{}).actions||{}).buttons||[];if(o.length>0){let c=o[0].id,u=r.selectFormValues();s(new CustomEvent("action-click",{detail:{actionId:c,formValues:u}}))}}};var St={};N(St,{createInitialState:()=>Cn,getFormFieldValue:()=>Vn,hideTooltip:()=>Bn,selectForm:()=>Ke,selectFormValues:()=>Nn,selectState:()=>Rn,selectViewData:()=>Ln,setFormFieldValue:()=>Dn,setFormValues:()=>Pn,showTooltip:()=>jn});var 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},W={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},Te={NOT:0};var k=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},X=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var xt=e=>{if(!e||e.trim()==="")throw new k("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new k(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${r}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let r of t)if(e.trim().endsWith(r))throw new k(`Incomplete comparison expression - missing right operand (got: '${e}')`)},Wr=e=>{if(e.trim().endsWith(" in"))throw new k(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new k(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new k(`Missing iterable expression after 'in' (got: '$for ${e}')`);let s=t.includes(",")?t.split(",").map(n=>n.trim()):[t.trim()];for(let n of s){if(!n)throw new k(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(n))throw new k(`Invalid loop syntax (got: '$for ${e}')`)}};var Mr=(e,t,r=!1)=>{if(t===null)return new X(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new X(`Cannot iterate over undefined value at '$for ${e}'`);let s=typeof t;return r?new X(`Cannot iterate over non-array value in loop '${e}' - got ${s} instead`):new X(`Cannot iterate over non-array value (got: ${s}) at '$for ${e}'`)},Fr=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new X(`Unknown function '${e}' (${r})`)};var Yi=(e,t,r={})=>{let s={},n={};r&&typeof r=="object"&&(r.functions!==void 0||r.partials!==void 0?(s=r.functions||{},n=r.partials||{}):typeof r=="object"&&(s=r));let a=O(e,{functions:s,partials:n},t,{});return a===void 0?{}:a},O=(e,t,r,s)=>{let n=t.functions||t;if(e.var&&!e.type)return z(e.var,r,s);if(e.type===v.LITERAL)return e.value;if(e.type===v.VARIABLE)return z(e.path,r,s);if(e.type===v.INTERPOLATION)return Qi(e.parts,t,r,s);switch(e.type){case v.FUNCTION:return Ur(e,t,r,s);case v.BINARY:return zr(e,t,r,s);case v.UNARY:return Hr(e,t,r,s);case v.CONDITIONAL:return en(e,t,r,s);case v.LOOP:return an(e,t,r,s);case v.OBJECT:return ln(e,t,r,s);case v.ARRAY:return pn(e,t,r,s);case v.PARTIAL:return cn(e,t,r,s);case v.PATH_REFERENCE:return un(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},Kr=new Map,Xi=e=>{let t=[],r="",s=!1;for(let n=0;n<e.length;n++){let i=e[n];if(i==="[")r&&(t.push({type:"property",value:r}),r=""),s=!0;else if(i==="]"){if(s&&r){let a=r.trim();if(/^\d+$/.test(a))t.push({type:"index",value:parseInt(a,10)});else if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")){let l=a.slice(1,-1);t.push({type:"property",value:l})}else t.push({type:"property",value:a});r=""}s=!1}else r+=i}return r&&t.push({type:"property",value:r}),t},z=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let s=Kr.get(e);if(!s){let i=[],a="",l=0;for(let p=0;p<e.length;p++){let o=e[p];o==="["?(l++,a+=o):o==="]"?(l--,a+=o):o==="."&&l===0?a&&(i.push(a),a=""):a+=o}a&&i.push(a),s=[];for(let p of i){let o=Xi(p.trim());s.push(...o)}Kr.set(e,s)}let n=t;for(let i=0;i<s.length;i++){let a=s[i];if(a.type==="property"&&a.value in r){n=r[a.value];continue}if(n==null)return;(a.type==="property"||a.type==="index")&&(n=n[a.value])}return n},Qi=(e,t,r,s)=>{let n=[];for(let i of e)if(typeof i=="string")n.push(i);else{let a=O(i,t,r,s);n.push(a!=null?String(a):"")}return n.join("")},Ur=(e,t,r,s)=>{let n=t.functions||t,i=n[e.name];if(!i)throw Fr(e.name,n);let a=e.args.map(l=>O(l,t,r,s));return i(...a)},xe=(e,t,r,s)=>{if(e.var&&!e.type)return z(e.var,r,s);switch(e.type){case v.VARIABLE:return z(e.path,r,s);case v.LITERAL:return e.value;case v.BINARY:return zr(e,t,r,s);case v.UNARY:return Hr(e,t,r,s);case v.FUNCTION:return Ur(e,t,r,s);default:return O(e,t,r,s)}},zr=(e,t,r,s)=>{if(e.op===W.AND||e.op===W.OR){let a=xe(e.left,t,r,s),l=xe(e.right,t,r,s);switch(e.op){case W.AND:return a&&l;case W.OR:return a||l}}let n=O(e.left,t,r,s),i=O(e.right,t,r,s);switch(e.op){case W.EQ:return n==i;case W.NEQ:return n!=i;case W.GT:return n>i;case W.LT:return n<i;case W.GTE:return n>=i;case W.LTE:return n<=i;case W.IN:return Array.isArray(i)?i.includes(n):!1;case W.ADD:if(typeof n!="number"||typeof i!="number")throw new X(`Arithmetic operations require numbers. Got ${typeof n} + ${typeof i}`);return n+i;case W.SUBTRACT:if(typeof n!="number"||typeof i!="number")throw new X(`Arithmetic operations require numbers. Got ${typeof n} - ${typeof i}`);return n-i;default:throw new Error(`Unknown binary operator: ${e.op}`)}},Hr=(e,t,r,s)=>{let n=e.op===Te.NOT?xe(e.operand,t,r,s):O(e.operand,t,r,s);switch(e.op){case Te.NOT:return!n;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Zi=(e,t,r,s)=>{if(e.conditions.length===2&&e.conditions[1]===null){let n=e.conditions[0];if(n.type===v.VARIABLE)if(z(n.path,r,s)){let a=e.bodies[0];if(a.type===v.OBJECT&&a.properties.length<=5){let l={};for(let p of a.properties){let o=p.parsedKey?O(p.parsedKey,t,r,s):p.key,c=p.value;if(c.type===v.LITERAL)l[o]=c.value;else if(c.type===v.VARIABLE)l[o]=z(c.path,r,s);else if(c.type===v.INTERPOLATION){let u=[];for(let d of c.parts)if(typeof d=="string")u.push(d);else if(d.type===v.VARIABLE){let f=z(d.path,r,s);u.push(f!=null?String(f):"")}else{let f=O(d,t,r,s);u.push(f!=null?String(f):"")}l[o]=u.join("")}else l[o]=O(c,t,r,s)}return l}}else{let a=e.bodies[1];if(a.type===v.OBJECT&&a.properties.length<=5){let l={};for(let p of a.properties){let o=p.parsedKey?O(p.parsedKey,t,r,s):p.key,c=p.value;if(c.type===v.LITERAL)l[o]=c.value;else if(c.type===v.VARIABLE)l[o]=z(c.path,r,s);else if(c.type===v.INTERPOLATION){let u=[];for(let d of c.parts)if(typeof d=="string")u.push(d);else if(d.type===v.VARIABLE){let f=z(d.path,r,s);u.push(f!=null?String(f):"")}else{let f=O(d,t,r,s);u.push(f!=null?String(f):"")}l[o]=u.join("")}else l[o]=O(c,t,r,s)}return l}}}return null},en=(e,t,r,s)=>{let n=Zi(e,t,r,s);if(n!==null)return n;for(let i=0;i<e.conditions.length;i++){let a=e.conditions[i];if(a===null||xe(a,t,r,s))return O(e.bodies[i],t,r,s)}return Jr},tn=(e,t)=>{let r=e.body,s=e.itemVar;if(r.type===v.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===v.VARIABLE){let n=r.conditions[0].path,i=r.bodies[0];if(n.startsWith(s+".")){let a=n.substring(s.length+1);if(i.type===v.OBJECT&&i.properties.length<=5){for(let p of i.properties)if(p.parsedKey)return null;let l=[];for(let p=0;p<t.length;p++){let o=t[p];if(o[a]){let c={};for(let u of i.properties){let d=u.key,f=u.value;if(f.type===v.LITERAL)c[d]=f.value;else if(f.type===v.VARIABLE){let h=f.path;if(h===s)c[d]=o;else if(h.startsWith(s+".")){let y=h.substring(s.length+1);c[d]=o[y]}else return null}else if(f.type===v.INTERPOLATION){let h=[],y=!0;for(let b of f.parts)if(typeof b=="string")h.push(b);else if(b.type===v.VARIABLE){let m=b.path;if(m===s)h.push(o!=null?String(o):"");else if(m.startsWith(s+".")){let w=m.substring(s.length+1),_=o[w];h.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[d]=h.join("")}else return null}l.push(c)}}return l}}}return null},rn=(e,t)=>{let r=e.body,s=e.itemVar,n=tn(e,t);if(n!==null)return n;if(r.type===v.OBJECT&&r.properties.length<=5&&!r.whenCondition){for(let l of r.properties)if(l.parsedKey)return null;let i=[],a=!0;for(let l of r.properties){let p=l.key,o=l.value;if(o.type===v.LITERAL)i.push({key:p,type:"literal",value:o.value});else if(o.type===v.VARIABLE){let c=o.path;if(c===s)i.push({key:p,type:"item"});else if(c.startsWith(s+".")){let u=c.substring(s.length+1);if(!u.includes(".")&&!u.includes("["))i.push({key:p,type:"prop",prop:u});else{a=!1;break}}else{a=!1;break}}else if(o.type===v.INTERPOLATION&&o.parts.length===1){let c=o.parts[0];if(c.type===v.VARIABLE){let u=c.path;if(u===s)i.push({key:p,type:"item_string"});else if(u.startsWith(s+".")){let d=u.substring(s.length+1);if(!d.includes(".")&&!d.includes("["))i.push({key:p,type:"prop_string",prop:d});else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}if(a){let l=new Array(t.length);if(i.length===3&&i[0].type==="prop"&&i[0].key==="id"&&i[1].type==="prop_string"&&i[1].key==="title"&&i[2].type==="prop"&&i[2].key==="completed")for(let p=0;p<t.length;p++){let o=t[p];l[p]={id:o.id,title:o.title!=null?String(o.title):"",completed:o.completed}}else for(let p=0;p<t.length;p++){let o=t[p],c={};for(let u of i)if(u.type==="literal")c[u.key]=u.value;else if(u.type==="item")c[u.key]=o;else if(u.type==="prop")c[u.key]=o[u.prop];else if(u.type==="item_string")c[u.key]=o!=null?String(o):"";else if(u.type==="prop_string"){let d=o[u.prop];c[u.key]=d!=null?String(d):""}l[p]=c}return l}}return null},sn=(e,t,r,s,n)=>{let i=[],a=e.body;if(a.type===v.OBJECT&&a.fast!==!1){let l=e.itemVar,p=e.indexVar;for(let o=0;o<n.length;o++){let c=n[o],u={},d={...s,[l]:c,...p&&{[p]:o}};d.__paths__||(d.__paths__=s.__paths__||{});let f=e.iterable.path||"";if(s&&s.__paths__&&f){let h=f.split("."),y=h[0];y in s.__paths__&&(f=s.__paths__[y],h.length>1&&(f+="."+h.slice(1).join(".")))}d.__paths__={...d.__paths__,[l]:`${f}[${o}]`,...p&&{[p]:o}};for(let h of a.properties){let y=h.parsedKey?O(h.parsedKey,t,r,d):h.key,b=h.value;if(b.type===v.LITERAL)u[y]=b.value;else if(b.type===v.VARIABLE){let m=b.path;if(m===l)u[y]=c;else if(m===p)u[y]=o;else if(m.startsWith(l+".")){let w=m.substring(l.length+1);!w.includes(".")&&!w.includes("[")?u[y]=c[w]:u[y]=z(m,r,{...s,[l]:c,...p&&{[p]:o}})}else u[y]=z(m,r,{...s,[l]:c,...p&&{[p]:o}})}else if(b.type===v.INTERPOLATION){let m=[];for(let w of b.parts)if(typeof w=="string")m.push(w);else if(w.type===v.VARIABLE){let _=w.path,x;if(_===l)x=c;else if(_===p)x=o;else if(_.startsWith(l+".")){let E=_.substring(l.length+1);!E.includes(".")&&!E.includes("[")?x=c[E]:x=z(_,r,{...s,[l]:c,...p&&{[p]:o}})}else x=z(_,r,{...s,[l]:c,...p&&{[p]:o}});m.push(x!=null?String(x):"")}else{let _={...s,[l]:c,...p&&{[p]:o}},x=O(w,t,r,_);m.push(x!=null?String(x):"")}u[y]=m.join("")}else{let m={...s,[l]:c,...p&&{[p]:o}};u[y]=O(b,t,r,m)}}i.push(u)}return i}return null},nn=(e,t,r)=>{let s=e.body;if(s.type===v.OBJECT&&s.properties.length===1&&s.properties[0].key==="$if item.visible"){let i=s.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 a=i.bodies[0];if(a.type===v.OBJECT&&a.properties.length===2){let l=a.properties[0],p=a.properties[1];if(l.key==="id"&&l.value.type===v.VARIABLE&&l.value.path==="item.id"&&p.key==="$if item.highlighted"&&p.value.type===v.CONDITIONAL){let o=[];for(let c=0;c<t.length;c++){let u=t[c];if(u.visible){let d={id:u.id};u.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${u.name}`):(d.highlight=!1,d.message=u.name),o.push(d)}}return o}}}}return null},an=(e,t,r,s)=>{let n=O(e.iterable,t,r,s);if(!Array.isArray(n)){let o,c=!1;if(e.iterable.type===v.FUNCTION){c=!0;let d=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(", ");o=`${e.iterable.name}(${d})`}else o=e.iterable.path||"undefined";let u=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${o}`;throw Mr(u,n,c)}if(!e.indexVar){let o=nn(e,n,e.itemVar);if(o!==null)return o}if(!e.indexVar){let o=rn(e,n);if(o!==null)return o}let i=sn(e,t,r,s,n);if(i!==null)return i;let a=[],l=e.iterable.path||"";if(s&&s.__paths__&&l){let o=l.split("."),c=o[0];c in s.__paths__&&(l=s.__paths__[c],o.length>1&&(l+="."+o.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(o=>o.type===v.OBJECT&&o.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let o=0;o<n.length;o++){let c=e.indexVar?{...s,[e.itemVar]:n[o],[e.indexVar]:o}:{...s,[e.itemVar]:n[o]};c.__paths__||(c.__paths__=s.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${l}[${o}]`},e.indexVar&&(c.__paths__[e.indexVar]=o);let u=O(e.body,t,r,c);if(Array.isArray(u)&&u.length===1&&!p){let d=u[0];a.push(d===void 0?{}:d)}else a.push(u===void 0?{}:u)}return a},on=(e,t,r,s)=>{if(e.whenCondition)return null;if(e.properties.length===1){let n=e.properties[0],i=n.parsedKey?O(n.parsedKey,t,r,s):n.key,a=n.value;if(a.type===v.OBJECT&&a.properties.length<=10&&!a.whenCondition){let l={},p={},o=!0;for(let c of a.properties){let u=c.parsedKey?O(c.parsedKey,t,r,s):c.key,d=c.value;if(d.type===v.LITERAL)p[u]=d.value;else if(d.type===v.VARIABLE)p[u]=z(d.path,r,s);else if(d.type===v.INTERPOLATION){let f=[];for(let h of d.parts)if(typeof h=="string")f.push(h);else if(h.type===v.VARIABLE){let y=z(h.path,r,s);f.push(y!=null?String(y):"")}else{o=!1;break}if(!o)break;p[u]=f.join("")}else if(d.type===v.OBJECT&&d.properties.length<=5){let f={};for(let h of d.properties){let y=h.key,b=h.value;if(b.type===v.LITERAL)f[y]=b.value;else if(b.type===v.VARIABLE)f[y]=z(b.path,r,s);else if(b.type===v.INTERPOLATION){let m=[];for(let w of b.parts)if(typeof w=="string")m.push(w);else if(w.type===v.VARIABLE){let _=z(w.path,r,s);m.push(_!=null?String(_):"")}else{o=!1;break}if(!o)break;f[y]=m.join("")}else{o=!1;break}}if(!o)break;p[u]=f}else{o=!1;break}}if(o)return l[i]=p,l}}return null},ln=(e,t,r,s)=>{let n=t.functions||t;if(e.whenCondition&&!xe(e.whenCondition,n,r,s))return;let i=on(e,t,r,s);if(i!==null)return i;if(e.fast){let o={};for(let c of e.properties){let u=c.parsedKey?O(c.parsedKey,t,r,s):c.key,d=c.value;if(d.type===v.LITERAL)o[u]=d.value;else if(d.type===v.VARIABLE)o[u]=z(d.path,r,s);else if(d.type===v.INTERPOLATION){let f=[];for(let h of d.parts)if(typeof h=="string")f.push(h);else if(h.type===v.VARIABLE){let y=z(h.path,r,s);f.push(y!=null?String(y):"")}else{let y=O(h,t,r,s);f.push(y!=null?String(y):"")}o[u]=f.join("")}else o[u]=O(d,t,r,s)}return o}let a={},l=null,p=!1;for(let o of e.properties)if(!o.key.startsWith("$if ")&&!o.key.match(/^\$if\s+\w+.*:?$/)&&!o.key.startsWith("$elif")&&!o.key.startsWith("$else")&&!o.key.startsWith("$for ")){p=!0;break}for(let o of e.properties)if(o.key.startsWith("$if ")||o.key.match(/^\$if\s+\w+.*:?$/)){let c=O(o.value,t,r,s);if(!p&&c!==null&&c!==void 0)return Array.isArray(c)&&c.length===1?c[0]:c;typeof c=="object"&&c!==null&&!Array.isArray(c)&&Object.assign(a,c)}else if(o.key.startsWith("$for ")){if(e.properties.length===1)return O(o.value,t,r,s)}else{let c=o.value;if(c&&c.type===v.OBJECT&&c.properties){let u=c.properties.find(d=>d.key.startsWith("$for "));if(u){let d=O(u.value,t,r,s);d!==void 0&&(a[o.key]=d)}else{let d=O(o.value,t,r,s);d!==void 0&&(a[o.key]=d)}}else{let u=o.parsedKey?O(o.parsedKey,t,r,s):o.key,d=O(o.value,t,r,s);d!==void 0&&(a[u]=d)}}return a},Jr={},pn=(e,t,r,s)=>{let n=[];for(let i of e.items)if(i.type===v.LOOP){let a=O(i,t,r,s);Array.isArray(a)&&i.flatten!==!1?n.push(...a):n.push(a)}else{let a=O(i,t,r,s);a!==Jr&&a!==void 0&&n.push(a)}return n},cn=(e,t,r,s)=>{let{name:n,data:i,whenCondition:a}=e,l=t.partials||{},p=t.functions||t;if(a&&!xe(a,p,r,s))return;if(!l[n])throw new X(`Partial '${n}' is not defined`);let o=s._partialStack||[];if(o.includes(n))throw new X(`Circular partial reference detected: ${n}`);let c=l[n],u=r,d={...s,_partialStack:[...o,n]};if(s){u={...r};for(let f of Object.keys(s))f.startsWith("_")||(u[f]=s[f])}if(i){let f=O(i,t,r,s);u={...u,...f}}return O(c,t,u,d)},un=(e,t,r,s)=>{let{path:n}=e,i=n.split("."),a=i[0],l=i.slice(1);if(!s||!(a in s))throw new X(`Path reference '#{${n}}' refers to '${a}' which is not a loop variable in the current scope`);if(s.__paths__||(s.__paths__={}),!(a in s.__paths__))throw new X(`Path reference '#{${n}}' cannot be resolved - path tracking may not be initialized properly`);let p=s.__paths__[a];if(typeof p=="number"){if(l.length>0)throw new X(`Path reference '#{${n}}' - cannot access properties on index variable '${a}'`);return String(p)}return l.length>0&&(p+="."+l.join(".")),p},At=Yi;var dn=/\$\{([^}]*)\}/g,hn=/#\{([^}]*)\}/g,Gr=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,s,n]=r,i=fn(n,t);return{isFunction:!0,type:v.FUNCTION,name:s,args:i}},fn=(e,t={})=>e.trim()?yn(e).map(s=>mn(s.trim(),t)):[],yn=e=>{let t=[],r="",s=0,n=!1,i="";for(let a=0;a<e.length;a++){let l=e[a],p=a>0?e[a-1]:"";!n&&(l==='"'||l==="'")?(n=!0,i=l,r+=l):n&&l===i&&p!=="\\"?(n=!1,i="",r+=l):!n&&l==="("?(s++,r+=l):!n&&l===")"?(s--,r+=l):!n&&l===","&&s===0?(t.push(r),r=""):r+=l}return r&&t.push(r),t},mn=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:v.LITERAL,value:parseFloat(e)};if(e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};let r=Gr(e,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};let s=e.trim(),n=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],i=-1,a=null;for(let{op:l,type:p}of n){let o=0;for(;o<s.length;){let c=he(s.substring(o),l);if(c===-1)break;let u=o+c;u>i&&(i=u,a={op:l,type:p}),o=u+l.length}}if(i!==-1)try{return G(s,t)}catch{return{type:v.VARIABLE,path:s}}return{type:v.VARIABLE,path:s}},Yr=/^\w+\(.*\)$/,gn=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,vn=e=>{if(!(!e||e.trim()===""||Yr.test(e))&&gn.test(e))throw e.includes("?")&&e.includes(":")?new k(`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 k(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new k(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},qr=e=>{let t=e.trim();if(Yr.test(t))throw new k(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new k(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new k(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new k(`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 k(`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}},Le=(e,t={})=>{let r=e.trim();vn(r);let s=Gr(r,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};if(r.includes("[")&&!/[\s+\-*/%|&?:]/.test(r)){let n=0;for(let i of r)i==="["?n++:i==="]"&&n--;if(n!==0)throw new Error("Invalid array index syntax")}return{type:v.VARIABLE,path:r}},Et=(e,t={})=>{let r=e,s=[];(e.includes("\\${")||e.includes("\\#{"))&&(r=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),r=r.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),r=r.replace(/\\(\$\{[^}]*\})/g,(o,c)=>{let u=`__ESCAPED_${s.length}__`;return s.push(c),u}),r=r.replace(/\\(#\{[^}]*\})/g,(o,c)=>{let u=`__ESCAPED_${s.length}__`;return s.push(c),u}),r=r.replace(/\\DOUBLE_ESC_VAR/g,"\\"),r=r.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let n=[...r.matchAll(dn)],i=[...r.matchAll(hn)],a=[...n.map(o=>({match:o,type:"variable"})),...i.map(o=>({match:o,type:"pathref"}))].sort((o,c)=>o.match.index-c.match.index);if(a.length===0){let o=r;for(let c=0;c<s.length;c++)o=o.replace(`__ESCAPED_${c}__`,s[c]);return{type:v.LITERAL,value:o}}if(a.length===1&&a[0].match[0]===r&&s.length===0){let{match:o,type:c}=a[0];try{return c==="variable"?Le(o[1],t):qr(o[1])}catch(u){if(u.message==="Invalid array index syntax")return{type:v.LITERAL,value:r};throw u}}let l=[],p=0;for(let{match:o,type:c}of a){let[u,d]=o,f=o.index;if(f>p){let h=r.substring(p,f);for(let y=0;y<s.length;y++)h=h.replace(`__ESCAPED_${y}__`,s[y]);h&&l.push(h)}try{let h;c==="variable"?h=Le(d.trim(),t):h=qr(d.trim()),l.push(h)}catch(h){if(h.message==="Invalid array index syntax")l.push(u);else throw h}p=f+u.length}if(p<r.length){let o=r.substring(p);for(let c=0;c<s.length;c++)o=o.replace(`__ESCAPED_${c}__`,s[c]);o&&l.push(o)}return{type:v.INTERPOLATION,parts:l}};var ue=(e,t)=>typeof e=="string"?Et(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?wn(e,t):_n(e,t):{type:v.LITERAL,value:e},bn=e=>{let{$each:t,...r}=e;if(typeof t!="string")throw new k("$each value must be a non-empty string");let s=t.trim();if(s==="")throw new k("$each value must be a non-empty string");if(Object.keys(r).length===0)throw new k("Empty $each body not allowed");if(r.$partial!==void 0)throw new k("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${s}`]:r}},wn=(e,t)=>{let r=[],s=!1;for(let n=0;n<e.length;n++){let i=e[n];if(typeof i=="object"&&i!==null&&!Array.isArray(i)){if(i.$each!==void 0)try{let p=bn(i),o=Object.keys(p);if(o.length===1&&/^\$for(?::\w+)?\s/.test(o[0])){let c=Xr(o[0],p[o[0]],t,!0);r.push(c),s=!0;continue}}catch(p){throw p instanceof k?p:new k(p.message)}let l=Object.keys(i);if(l.length===1&&/^\$for(?::\w+)?\s/.test(l[0])){let p=Xr(l[0],i[l[0]],t);r.push(p),s=!0;continue}}let a=ue(i,t);r.push(a),(a.type===v.FUNCTION||a.type===v.CONDITIONAL||a.type===v.LOOP||a.type===v.PARTIAL||a.type===v.OBJECT&&!a.fast||a.type===v.ARRAY&&!a.fast)&&(s=!0)}return{type:v.ARRAY,items:r,fast:!s}},_n=(e,t)=>{let r=[],s=!1,n=null,i=Object.entries(e),a=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new k("$partial value must be a string");if(e.$partial.trim()==="")throw new k("$partial value cannot be an empty string");let p=["$if","$elif","$else","$for"],o=[];for(let[m]of i)for(let w of p)if(m===w||m.startsWith(w+" ")||m.startsWith(w+"#")){o.push(w);break}if(o.length>0)throw new k(`Cannot use $partial with ${o.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:u,...d}=e,f={},h=!1;for(let[m,w]of Object.entries(d)){let _=m;(m.startsWith("\\$")||m.startsWith("$$"))&&(_=m.slice(1)),f[_]=w,h=!0}let y=null;if(h&&(y=ue(f,t),y.type===v.OBJECT)){let m=!1;for(let w of y.properties)if(w.value.type===v.VARIABLE||w.value.type===v.INTERPOLATION||w.value.type===v.FUNCTION||w.value.type===v.CONDITIONAL||w.value.type===v.OBJECT&&!w.value.fast||w.value.type===v.ARRAY&&!w.value.fast){m=!0;break}m&&(y.fast=!1)}let b={type:v.PARTIAL,name:c,data:y};if(u!==void 0){let m;if(typeof u=="string"){if(u.trim()==="")throw new k("Empty condition expression after '$when'");m=G(u,t)}else m={type:v.LITERAL,value:u};b.whenCondition=m}return b}for(let[p,o]of i)if(p==="$when"){if(n!==null)throw new k("Multiple '$when' directives on the same object are not allowed");if(o==null)throw new k("Missing condition expression after '$when'");let c=typeof o=="string"?o:JSON.stringify(o);if(c.trim()==="")throw new k("Empty condition expression after '$when'");n=G(c,t),s=!0}else if(p.startsWith("$when#")||p.startsWith("$when "))throw new k("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;a<i.length;){let[p,o]=i[a];if(p==="$when"){a++;continue}if(p==="$each")throw new k("$each can only be used inside arrays");if(p.startsWith("$if ")||p.match(/^\$if#\w+\s/)||p.match(/^\$if\s+\w+.*:$/)){let c=xn(i,a,t);r.push({key:p,value:c.node}),s=!0,a=c.nextIndex}else if(/^\$for(?::\w+)?\s/.test(p)){let c=p.match(/^\$for(?::(\w+))?\s/)?.[1]||"",u=c?`:${c}`:"";throw new k(`$for loops must be inside arrays - use '- $for${u} item in items:' instead of '$for${u} item in items:'. For cleaner object generation syntax, consider using $each.`)}else{if(p.startsWith("$elif ")||p.startsWith("$else"))throw new k(`'${p.split(" ")[0]}' without matching '$if'`);if(p==="$if"||p==="$if:")throw new k("Missing condition expression after '$if'");{let c=ue(o,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)&&(s=!0);let u=Et(p,t),d={key:p,value:c};(u.type!==v.LITERAL||u.value!==p)&&(d.parsedKey=u),r.push(d),a++}}}let l={type:v.OBJECT,properties:r,fast:!s};return n&&(l.whenCondition=n),l},xn=(e,t,r={})=>{let s=[],n=[],i=t,[a,l]=e[i],p=null,o;if(a.startsWith("$if#")){let u=a.match(/^\$if#(\w+)\s+(.+)$/);if(u)p=u[1],o=u[2];else throw new k(`Invalid conditional syntax: ${a}`)}else o=a.substring(4),o.endsWith(":")&&(o=o.slice(0,-1).trim());xt(o);let c=G(o,r);for(s.push(c),n.push(ue(l,r)),i++;i<e.length;){let[u,d]=e[i],f=!1,h;if(p?u.startsWith(`$elif#${p} `)?(h=u.substring(`$elif#${p} `.length),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(u===`$else#${p}`||u===`$else#${p}:`)&&(f=!0,h=null):u.startsWith("$elif ")?(h=u.substring(6),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(u==="$else"||u==="$else:")&&(f=!0,h=null),f){if(h===null)s.push(null);else{xt(h);let y=G(h,r);s.push(y)}if(n.push(ue(d,r)),i++,h===null)break}else break}return{node:{type:v.CONDITIONAL,conditions:s,bodies:n,id:p},nextIndex:i}},G=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let o=e.slice(1,-1),c=0,u=!0;for(let d=0;d<o.length;d++)if(o[d]==="("?c++:o[d]===")"&&c--,c<0){u=!1;break}if(u&&c===0)return G(o,t)}let r=he(e,"||");if(r!==-1)return{type:v.BINARY,op:W.OR,left:G(e.substring(0,r).trim(),t),right:G(e.substring(r+2).trim(),t)};let s=he(e,"&&");if(s!==-1)return{type:v.BINARY,op:W.AND,left:G(e.substring(0,s).trim(),t),right:G(e.substring(s+2).trim(),t)};let n=[{op:">=",type:W.GTE},{op:"<=",type:W.LTE},{op:"==",type:W.EQ},{op:"!=",type:W.NEQ},{op:">",type:W.GT},{op:"<",type:W.LT},{op:" in ",type:W.IN}];for(let{op:o,type:c}of n){let u=he(e,o);if(u!==-1)return{type:v.BINARY,op:c,left:G(e.substring(0,u).trim(),t),right:G(e.substring(u+o.length).trim(),t)}}let i=-1,a=null,l=[{op:" + ",type:W.ADD},{op:" - ",type:W.SUBTRACT}];for(let{op:o,type:c}of l){let u=0;for(;u<e.length;){let d=he(e.substring(u),o);if(d===-1)break;let f=u+d;f>i&&(i=f,a={op:o,type:c}),u=f+o.length}}if(i!==-1&&a)return{type:v.BINARY,op:a.type,left:G(e.substring(0,i).trim(),t),right:G(e.substring(i+a.op.length).trim(),t)};let p=[" * "," / "," % "];for(let o of p)if(he(e,o)!==-1)throw new k(`Arithmetic operations are not allowed in conditionals: "${o}"`);return e.startsWith("!")?{type:v.UNARY,op:Te.NOT,operand:G(e.substring(1).trim(),t)}:Qr(e,t)},he=(e,t)=>{let r=0,s=0;for(;s<=e.length-t.length;){if(e[s]==="(")r++;else if(e[s]===")")r--;else if(r===0&&e.substring(s,s+t.length)===t)return s;s++}return-1},An=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}},Qr=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return Le(r,t);let n=An(r);if(n.type===v.LITERAL)return n;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:v.VARIABLE,path:r};try{return Le(r,t)}catch(i){if(i.message&&i.message.includes("not supported"))return n;throw i}},En=(e,t=!1)=>{let r=t?"$each":"$for";try{Wr(e)}catch(s){if(s instanceof k&&t){let n=s.message.replace(/\$for/g,"$each");throw new k(n.replace("Parse Error: ",""))}throw s}},Xr=(e,t,r,s=!1)=>{let n=/^\$for(?::(\w+))?\s+(.+)$/,i=e.match(n);if(!i){let b=s?"$each":"$for";throw new k(`Invalid loop syntax (got: '${e.replace("$for",b)}')`)}let a=i[1],l=i[2].trim();En(l,s);let p=l.match(/^(.+?)\s+in\s+(.+)$/);if(!p){let b=s?"$each":"$for";throw new k(`Invalid loop syntax - missing 'in' keyword (got: '${b} ${l}')`)}let o=p[1].trim(),c=p[2].trim(),u,d=null;if(o.includes(",")){let b=o.split(",").map(m=>m.trim());if(b.length!==2)throw new k(`Invalid loop variables: ${o}. Expected format: "item" or "item, index"`);u=b[0],d=b[1]}else u=o;let f=["this","undefined","null","true","false"];if(f.includes(u))throw new k(`Reserved variable name: ${u}`);if(d&&f.includes(d))throw new k(`Reserved variable name: ${d}`);let h=Qr(c,r),y=ue(t,r);return{type:v.LOOP,itemVar:u,indexVar:d,iterable:h,body:y,flatten:a!=="nested"}};var kn=(e,t={})=>{let{functions:r={}}=t;return ue(e,r)},Fe=kn;var kt={};N(kt,{now:()=>$n});var $n=()=>Date.now();var Sn=(e,t,r={})=>{let{functions:s={},partials:n={}}=r,i={...kt,...s},a=Fe(e,{functions:i}),l={};for(let[p,o]of Object.entries(n))l[p]=Fe(o,{functions:i});return At(a,t,{functions:i,partials:l})},$t=Sn;function Zr(e,t){return t.reduce((r,s)=>(s in e&&(r[s]=e[s]),r),{})}var Cn=()=>Object.freeze({formValues:{},tooltipState:{open:!1,x:0,y:0,content:""}}),es=(e,t,r=void 0)=>{if(!t)return;let s=t.split(/[\[\].]/).filter(i=>i!==""),n=e;for(let i of s){if(n==null||!(i in n))return r;n=n[i]}return n},In=(e,t,r)=>{let s=t.split(/[\[\].]/).filter(i=>i!=="");t.includes("[")&&t in e&&delete e[t];let n=e;for(let i=0;i<s.length-1;i++){let a=s[i];if(!(a in n)||typeof n[a]!="object"||n[a]===null){let l=s[i+1],p=/^\d+$/.test(l);n[a]=p?[]:{}}n=n[a]}return n[s[s.length-1]]=r,e},On=["id","class","style","slot"],Tn=e=>Object.entries(e).filter(([t])=>!On.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Ke=({props:e})=>{let{form:t={}}=e,{context:r}=e;return r?$t(t,r):t},Ln=({state:e,props:t,attrs:r})=>{let s=Tn(r),n=Ke({state:e,props:t}),i=structuredClone(n.fields||[]);return i.forEach(a=>{let l=es(e.formValues,a.name);if(["read-only-text"].includes(a.inputType)&&(a.defaultValue=l),["select"].includes(a.inputType)){let p=t?.defaultValues;p&&p[a.name]!==void 0&&(a.selectedValue=p[a.name])}if(a.inputType==="image"){let p=a.src;a.imageSrc=p&&p.trim()?p:null,a.placeholderText=a.placeholder||"No Image"}if(a.inputType==="waveform"){let p=a.waveformData;a.waveformData=p||null,a.placeholderText=a.placeholder||"No Waveform"}}),{key:r?.key,containerAttrString:s,title:n?.title||"",description:n?.description||"",fields:i,actions:t?.form?.actions||{buttons:[]},formValues:e.formValues,tooltipState:e.tooltipState}},Rn=({state:e})=>e,Nn=({state:e,props:t})=>{let r=Ke({state:e,props:t});return Zr(e.formValues,r.fields.map(s=>s.name))},Vn=({state:e},t)=>es(e.formValues,t),Pn=(e,t)=>{e.formValues=t||{}},Dn=(e,{name:t,value:r,props:s})=>{In(e.formValues,t,r);let n=Ke({state:e,props:s}),i=Zr(e.formValues,n.fields.map(a=>a.name));e.formValues=i},jn=(e,{x:t,y:r,content:s})=>{e.tooltipState={open:!0,x:t,y:r,content:s}},Bn=e=>{e.tooltipState={...e.tooltipState,open:!1}};var ts={elementName:"rtgl-form",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{defaultValues:{type:"object"},context:{type:"object"},form:{type:"object",properties:{title:{type:"string"},description:{type:"string"},fields:{type:"array",items:{anyOf:[{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"inputText"},placeholder:{type:"string"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"select"},placeholder:{type:"string"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},options:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"any"}},required:["label","value"]}},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType","options"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"colorPicker"},value:{type:"string"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"slider"},min:{type:"number"},max:{type:"number"},step:{type:"number"},value:{type:"number"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"slider-input"},min:{type:"number"},max:{type:"number"},step:{type:"number"},value:{type:"number"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"image"},width:{type:"number"},height:{type:"number"},placeholder:{type:"string"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"waveform"},width:{type:"number"},height:{type:"number"},placeholder:{type:"string"},defaultValue:{type:"object"},waveformData:{type:"object"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"popover-input"},placeholder:{type:"string"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1}]}},actions:{type:"object",properties:{buttons:{type:"array",items:{type:"object",properties:{id:{type:"string"},content:{type:"string"},testId:{type:"string"}},required:["id","content"]}}}}}}}},refs:{"form-container":{eventListeners:{keydown:{handler:"handleKeyDown"}}},"action-*":{eventListeners:{click:{handler:"handleActionClick"}}},"tooltip-icon-*":{eventListeners:{mouseenter:{handler:"handleTooltipMouseEnter"},mouseleave:{handler:"handleTooltipMouseLeave"}}},"field-*":{eventListeners:{"input-change":{handler:"handleInputChange"},"textarea-change":{handler:"handleInputChange"},"select-change":{handler:"handleSelectChange"},"add-option-selected":{handler:"handleSelectAddOption"},"colorpicker-change":{handler:"handleColorPickerChange"},"slider-change":{handler:"handleSliderChange"},"slider-input-value-change":{handler:"handleSliderInputChange"}}},"image-*":{eventListeners:{click:{handler:"handleImageClick"},contextmenu:{handler:"handleImageClick"}}},"waveform-*":{eventListeners:{click:{handler:"handleWaveformClick"},contextmenu:{handler:"handleWaveformClick"}}}},events:{"form-change":{},"extra-event":{},"action-click":{}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#form-container 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:"fields"},body:{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.label && field.tooltip",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"field.label"},right:{type:1,path:"field.tooltip"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#tooltip-icon-${field.name} svg="info" wh=16 c=mu-fg cur=help ml=xs',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg#tooltip-icon-",{type:1,path:"field.name"},' svg="info" wh=16 c=mu-fg cur=help ml=xs']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$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.inputType == "read-only-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"read-only-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"field.defaultValue"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:`$if field.inputType == "inputText" || field.inputType == 'input-text'`,value:{type:6,conditions:[{type:4,op:7,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"inputText"}},right:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"input-text"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#field-${field.name} w=f min=${field.min} max=${field.max} step=${field.step} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#field-",{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"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "input-number"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"input-number"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#field-${field.name} w=f data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#field-",{type:1,path:"field.name"}," w=f data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "input-textarea"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"input-textarea"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-textarea#field-${field.name} w=f rows=${field.rows} w=f data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-textarea#field-",{type:1,path:"field.name"}," w=f rows=",{type:1,path:"field.rows"}," w=f data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "popover-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"popover-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-popover-input#field-${field.name} label="${field.label}" data-testid=${field.testId}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-popover-input#field-",{type:1,path:"field.name"},' label="',{type:1,path:"field.label"},'" data-testid=',{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-select#field-${field.name} key=${key} w=f .options=fields[${i}].options ?no-clear=fields[${i}].noClear .addOption=fields[${i}].addOption .selectedValue=#{field.selectedValue} .placeholder=#{field.placeholder} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#field-",{type:1,path:"field.name"}," key=",{type:1,path:"key"}," w=f .options=fields[",{type:1,path:"i"},"].options ?no-clear=fields[",{type:1,path:"i"},"].noClear .addOption=fields[",{type:1,path:"i"},"].addOption .selectedValue=",{type:11,path:"field.selectedValue"}," .placeholder=",{type:11,path:"field.placeholder"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "colorPicker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"colorPicker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#field-${field.name} key=${key} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#field-",{type:1,path:"field.name"}," key=",{type:1,path:"key"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slider"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider#field-${field.name} key=${key} w=f min=${field.min} max=${field.max} step=${field.step} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#field-",{type:1,path:"field.name"}," key=",{type:1,path:"key"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slider-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slider-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider-input#field-${field.name} w=f min=${field.min} max=${field.max} step=${field.step} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider-input#field-",{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"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "image" && field.imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"image"}},right:{type:1,path:"field.imageSrc"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image#image-${field.name} src=${field.imageSrc} w=${field.width} h=${field.height} cur=p data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image#image-",{type:1,path:"field.name"}," src=",{type:1,path:"field.imageSrc"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=p data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "image" && !field.imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"image"}},right:{type:5,op:0,operand:{type:1,path:"field.imageSrc"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#field-${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=p p=md data-testid=${field.testId}",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#field-",{type:1,path:"field.name"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," bc=ac bw=sm ah=c av=c cur=p p=md data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "waveform" && field.waveformData',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"waveform"}},right:{type:1,path:"field.waveformData"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-waveform#field-${field.name} .waveformData=fields[${i}].waveformData w=${field.width} h=${field.height} cur=p data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-waveform#field-",{type:1,path:"field.name"}," .waveformData=fields[",{type:1,path:"i"},"].waveformData w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=p data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "waveform" && !field.waveformData',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"waveform"}},right:{type:5,op:0,operand:{type:1,path:"field.waveformData"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#field-${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=p p=md data-testid=${field.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg ta=c",value:{type:1,path:"field.placeholder"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#field-",{type:1,path:"field.name"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," bc=ac bw=sm ah=c av=c cur=p p=md data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slot"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slot"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'slot#field-${field.slotName} name=${field.slot} style="display: contents;"',value:{type:0,value:null},parsedKey:{type:2,parts:["slot#field-",{type:1,path:"field.slotName"}," name=",{type:1,path:"field.slot"},' style="display: contents;"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=e g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions.buttons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action-${button.id} data-testid=${button.testId}",value:{type:1,path:"button.content"},parsedKey:{type:2,parts:["rtgl-button#action-",{type:1,path:"button.id"}," data-testid=",{type:1,path:"button.testId"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:'rtgl-tooltip ?open=${tooltipState.open} x=${tooltipState.x} y=${tooltipState.y} placement="top" content="${tooltipState.content}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-tooltip ?open=",{type:1,path:"tooltipState.open"}," x=",{type:1,path:"tooltipState.x"}," y=",{type:1,path:"tooltipState.y"},' placement="top" content="',{type:1,path:"tooltipState.content"},'"']}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#form-container w=f p=md g=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Ct={};N(Ct,{closeAll:()=>qn,handleCancel:()=>Fn,handleConfirm:()=>Mn,handleDialogClose:()=>Wn,handleDropdownClose:()=>Kn,handleDropdownItemClick:()=>Un,showAlert:()=>zn,showConfirm:()=>Hn,showDropdownMenu:()=>Jn});var Wn=(e,t)=>{let{store:r,render:s}=e;r.closeAll(),s()},Mn=(e,t)=>{let{store:r,render:s,globalUI:n}=e;r.closeAll(),s(),n.emit("event",!0)},Fn=(e,t)=>{let{store:r,render:s,globalUI:n}=e;r.closeAll(),s(),n.emit("event",!1)},Kn=(e,t)=>{let{store:r,render:s,globalUI:n}=e;r.closeAll(),s(),n.emit("event",null)},Un=(e,t)=>{let{store:r,render:s,globalUI:n}=e,i=t._event,{index:a,item:l}=i.detail;r.closeAll(),s(),n.emit("event",{index:a,item:l})},zn=(e,t)=>{let{store:r,render:s}=e,n=t;r.selectIsOpen()&&(r.closeAll(),s()),r.setAlertConfig(n),s()},Hn=async(e,t)=>{let{store:r,render:s,globalUI:n}=e,i=t;return r.selectIsOpen()&&(r.closeAll(),s()),r.setConfirmConfig(i),s(),new Promise(a=>{n.once("event",l=>{a(l)})})},Jn=async(e,t)=>{let{store:r,render:s,globalUI:n}=e,i=t;return r.selectIsOpen()&&(r.closeAll(),s()),r.setDropdownConfig(i),s(),new Promise(a=>{n.once("event",l=>{a(l)})})},qn=e=>{let{store:t,render:r}=e;t.selectIsOpen()&&(t.closeAll(),r())};var It={};N(It,{closeAll:()=>Zn,createInitialState:()=>Gn,selectConfig:()=>ea,selectDropdownConfig:()=>ta,selectIsOpen:()=>sa,selectUiType:()=>ra,selectViewData:()=>ia,setAlertConfig:()=>Yn,setConfirmConfig:()=>Xn,setDropdownConfig:()=>Qn});var Gn=()=>Object.freeze({isOpen:!1,uiType:"dialog",config:{status:void 0,title:"",message:"",confirmText:"OK",cancelText:"Cancel",mode:"alert"},dropdownConfig:{items:[],x:0,y:0,placement:"bottom-start"}}),Yn=(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},Xn=(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},Qn=(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,placement:t.placement||"bottom-start"},e.uiType="dropdown",e.isOpen=!0},Zn=e=>{e.isOpen=!1,e.uiType="dialog"},ea=({state:e})=>e.config,ta=({state:e})=>e.dropdownConfig,ra=({state:e})=>e.uiType,sa=({state:e})=>e.isOpen,ia=({state:e})=>({isOpen:e.isOpen,uiType:e.uiType,config:e.config,dropdownConfig:{items:e.dropdownConfig?.items||[],x:e.dropdownConfig?.x||0,y:e.dropdownConfig?.y||0,placement:e.dropdownConfig?.placement||"bottom-start"},isDialogOpen:e.isOpen&&e.uiType==="dialog",isDropdownOpen:e.isOpen&&e.uiType==="dropdown"});var rs={elementName:"rtgl-global-ui",viewDataSchema:{type:"object",properties:{isOpen:{type:"boolean"},uiType:{type:"string"},config:{type:"object",properties:{status:{type:"string"},title:{type:"string"},message:{type:"string"},confirmText:{type:"string"},cancelText:{type:"string"},mode:{type:"string"}}},dropdownConfig:{type:"object",properties:{items:{type:"array"},x:{type:"number"},y:{type:"number"},placement:{type:"string"}}}}},refs:{dialog:{eventListeners:{close:{handler:"handleDialogClose"}}},"confirm-button":{eventListeners:{click:{handler:"handleConfirm"}}},"cancel-button":{eventListeners:{click:{handler:"handleCancel"}}},"dropdown-menu":{eventListeners:{close:{handler:"handleDropdownClose"},"click-item":{handler:"handleDropdownItemClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-dialog#dialog ?open=${isDialogOpen} s=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=c av=c g=md",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=24 av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text fw=600",value:{type:1,path:"config.title"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-view d=h g=md mt=lg w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"$if config.mode == 'confirm'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"config.mode"},right:{type:0,value:"confirm"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-button#cancel-button v=se",value:{type:1,path:"config.cancelText"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-button#confirm-button v=pr",value:{type:1,path:"config.confirmText"}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-dialog#dialog ?open=",{type:1,path:"isDialogOpen"}," s=sm"]}}],fast:!1},{type:8,properties:[{key:"rtgl-dropdown-menu#dropdown-menu ?open=${isDropdownOpen} x=${dropdownConfig.x} y=${dropdownConfig.y} placement=${dropdownConfig.placement} .items=dropdownConfig.items key=dropdown-${isDropdownOpen}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-dropdown-menu#dropdown-menu ?open=",{type:1,path:"isDropdownOpen"}," x=",{type:1,path:"dropdownConfig.x"}," y=",{type:1,path:"dropdownConfig.y"}," placement=",{type:1,path:"dropdownConfig.placement"}," .items=dropdownConfig.items key=dropdown-",{type:1,path:"isDropdownOpen"}]}}],fast:!0}],fast:!1}};var Ot={};N(Ot,{handleClickStart:()=>na});var na=(e,t)=>{let{dispatchEvent:r,store:s}=e,n=t._event;console.log("handle click start",s.selectPath()),r(new CustomEvent("clickStart",{detail:{path:s.selectPath()}}))};var Tt={};N(Tt,{createInitialState:()=>aa,selectPath:()=>ca,selectViewData:()=>pa,setState:()=>ua});var aa=()=>Object.freeze({}),oa=["id","class","style","slot"],la=e=>Object.entries(e).filter(([t])=>!oa.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),pa=({state:e,props:t,attrs:r})=>{console.log("attrs",{attrs:r,entries:Object.entries(r)});let s=r.start?JSON.parse(decodeURIComponent(r.start)):t.start;return{containerAttrString:la(r),start:s||{label:"",image:{src:"",width:32,height:32,alt:""}}}},ca=({props:e})=>e.start.path,ua=e=>{};var ss={elementName:"rtgl-navbar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}},hasImage:{type:"boolean"},hasHref:{type:"boolean"}}}}},propsSchema:{type:"object",properties:{start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}}}}}},refs:{start:{eventListeners:{click:{handler:"handleClickStart"}}}},events:{clickStart:{type:"object",properties:{path:{type:"string"}}}},anchors:[[{"rtgl-text s=lg":"${start.label}"},{"$if start.image && start.image.src":[{"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}":null}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view bgc=bg d=h h=48 av=c w=f ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if start.href",value:{type:6,conditions:[{type:1,path:"start.href"},{type:1,path:"start.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${start.href}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=lg g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a href=",{type:1,path:"start.href"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#start d=h av=c g=lg g=md cur=p",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=lg g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view flex=1",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view d=h av=c g=lg",value:{type:9,items:[{type:8,properties:[{key:"slot name=right",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view bgc=bg d=h h=48 av=c w=f ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Lt={};N(Lt,{handleBeforeMount:()=>ha});var is=(e,t,r)=>{let{store:s,render:n}=r,i,a=-1/0;if(e.forEach(l=>{let p=l.getBoundingClientRect();p.top<=t&&p.top>a&&(a=p.top,i=l.id)}),!i){let l=1/0;e.forEach(p=>{let o=p.getBoundingClientRect();o.top>t&&o.top<l&&(l=o.top,i=p.id)})}i&&i!==s.selectCurrentId()&&(s.setCurrentId(i),n())},da=(e,t,r,s)=>{let{store:n,render:i}=s,a=e.querySelectorAll("h1[id], h2[id], h3[id], h4[id], rtgl-text[id]"),l=Array.from(a),p=l.map(c=>{let u=1,d=c.tagName.toLowerCase();return d==="h1"?u=1:d==="h2"?u=2:d==="h3"?u=3:d==="h4"?u=4:d==="rtgl-text"&&(u=parseInt(c.getAttribute("data-level")||"1",10)),{id:c.id,href:`#${c.id}`,title:c.textContent,level:u}});n.setItems(p),is(l,r,s),i();let o=is.bind(void 0,l,r,s);return t.addEventListener("scroll",o,{passive:!0}),()=>{t.removeEventListener("scroll",o)}},ha=e=>{let{attrs:t}=e;requestAnimationFrame(()=>{let r=document.getElementById(t["target-id"]),s=window;t["scroll-container-id"]&&(s=document.getElementById(t["scroll-container-id"])||window);let n=parseInt(t["offset-top"]||"100",10),i=da(r,s,n,e);return()=>{i()}})};var Rt={};N(Rt,{createInitialState:()=>fa,selectCurrentId:()=>ga,selectState:()=>ma,selectViewData:()=>ya,setContentContainer:()=>wa,setCurrentId:()=>ba,setItems:()=>va});var fa=()=>Object.freeze({items:[],currentId:null,contentContainer:null}),ya=({state:e})=>{let r=((s,n)=>{let i=new Set,a=s.findIndex(p=>p.id===n);if(a===-1)return i;let l=s[a].level;for(let p=a-1;p>=0;p--)if(s[p].level<l){let o=s[p].level;i.add(s[p].id);for(let c=p-1;c>=0;c--)s[c].level<o&&(i.add(s[c].id),o=s[c].level);break}return i})(e.items,e.currentId);return{items:e.items.map(s=>{let n={1:"0",2:"12px",3:"24px",4:"32px"},i=s.id===e.currentId,a=r.has(s.id),l=i||a;return{...s,c:l?"fg":"mu-fg",ml:n[s.level]||"",bc:l?"fg":"mu-fg"}}),currentId:e.currentId}},ma=({state:e})=>e,ga=({state:e})=>e.currentId,va=(e,t)=>{e.items=t},ba=(e,t)=>{e.currentId=t},wa=(e,t)=>{e.contentContainer=t};var ns={elementName:"rtgl-page-outline",viewDataSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{slug:{type:"string"},title:{type:"string"}}}},selectedSlug:{type:"string",nullable:!0}}},propsSchema:{type:"object",properties:{}},refs:{},events:{onItemClick:{type:"object"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=272 pr=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f mt=xl",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view d=h bwl=xs bc="${item.bc}" pv=sm av=c href=${item.href} pl=md',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=${item.ml}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view w=",{type:1,path:"item.ml"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} h-c=fg",value:{type:1,path:"item.title"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," h-c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view d=h bwl=xs bc="',{type:1,path:"item.bc"},'" pv=sm av=c href=',{type:1,path:"item.href"}," pl=md"]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var Nt={};N(Nt,{handleBeforeMount:()=>_a,handleInputChange:()=>ka,handleInputKeydown:()=>Sa,handleOnUpdate:()=>xa,handlePopoverClose:()=>Ea,handleSubmitClick:()=>$a,handleTextClick:()=>Aa});var _a=e=>{let{store:t,attrs:r}=e;r.value!==void 0&&t.setValue(r.value||"")},xa=(e,t)=>{let{oldAttrs:r,newAttrs:s}=t,{store:n,render:i}=e;if(r?.value!==s?.value){let a=s?.value??"";n.setValue(a)}i()},Aa=(e,t)=>{let{store:r,render:s,getRefIds:n,attrs:i}=e,a=t._event,l=r.selectValue();r.setTempValue(l),r.openPopover({position:{x:a.currentTarget.getBoundingClientRect().left,y:a.currentTarget.getBoundingClientRect().bottom}});let{input:p}=n();p.elm.value=l,s(),i["auto-focus"]&&setTimeout(()=>{p.elm.focus()},50)},Ea=(e,t)=>{let{store:r,render:s}=e;r.closePopover(),s()},ka=(e,t)=>{let{store:r,render:s,dispatchEvent:n}=e,a=t._event.detail.value;r.setTempValue(a),n(new CustomEvent("temp-input-change",{detail:{value:a},bubbles:!0})),s()},$a=e=>{let{store:t,render:r,dispatchEvent:s,getRefIds:n}=e,{input:i}=n(),a=i.elm.value;t.setValue(a),t.closePopover(),s(new CustomEvent("input-change",{detail:{value:a},bubbles:!0})),r()},Sa=(e,t)=>{let{store:r,render:s,dispatchEvent:n,getRefIds:i}=e,a=t._event;if(a.key==="Enter"){let{input:l}=i(),p=l.elm.value;r.closePopover(),n(new CustomEvent("input-change",{detail:{value:p},bubbles:!0})),s()}else a.key==="Escape"&&(r.closePopover(),s())};var Vt={};N(Vt,{closePopover:()=>La,createInitialState:()=>Ca,openPopover:()=>Ta,selectValue:()=>Na,selectViewData:()=>Ia,setTempValue:()=>Oa,setValue:()=>Ra});var Ca=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),Ia=({attrs:e,state:t})=>{let r=t.value||"-";return{isOpen:t.isOpen,position:t.position,value:r,tempValue:t.tempValue,placeholder:e.placeholder??"",label:e.label}},Oa=(e,t)=>{e.tempValue=t},Ta=(e,t)=>{let{position:r}=t;e.position=r,e.isOpen=!0,e.hasUnsavedChanges=!1},La=e=>{e.isOpen=!1,e.tempValue=""},Ra=(e,t)=>{e.value=t},Na=({state:e})=>e.value;var as={elementName:"rtgl-popover-input",viewDataSchema:{type:"object"},attrsSchema:{type:"object",properties:{value:{type:"string"},placeholder:{type:"string"}}},refs:{"text-display":{eventListeners:{click:{handler:"handleTextClick"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},input:{eventListeners:{"input-change":{handler:"handleInputChange"},keydown:{handler:"handleInputKeydown"}}},submit:{eventListeners:{click:{handler:"handleSubmitClick"}}}},events:{"input-change":{}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#text-display w=f cur=p",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"value"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=240 slot=content bgc=background br=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-input#input w=f placeholder=${placeholder}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=f placeholder=",{type:1,path:"placeholder"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#submit",value:{type:0,value:"Submit"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}]}}],fast:!0}],fast:!0}};var Pt={};N(Pt,{handleAddOptionClick:()=>Ka,handleAddOptionMouseEnter:()=>Ua,handleAddOptionMouseLeave:()=>za,handleBeforeMount:()=>Va,handleButtonClick:()=>Da,handleClearClick:()=>Fa,handleClickOptionsPopoverOverlay:()=>ja,handleOnUpdate:()=>Pa,handleOptionClick:()=>Ba,handleOptionMouseEnter:()=>Wa,handleOptionMouseLeave:()=>Ma});var Va=e=>{let{store:t,props:r,render:s}=e;if(r.selectedValue!==null&&r.selectedValue!==void 0&&r.options){let n=r.options.find(i=>ce(i.value,r.selectedValue));n&&(t.updateSelectedValue({value:n?.value}),s())}},Pa=(e,t)=>{let{oldAttrs:r,newAttrs:s,oldProps:n,newProps:i}=t,{store:a,render:l}=e;if(r?.key!==s?.key&&s?.key){a.resetSelection();let p=i?.selectedValue,o=i?.options||[];if(p!=null&&o){let c=o.find(u=>ce(u.value,p));c&&a.updateSelectedValue({value:c.value})}l()}else n.selectedValue!==i.selectedValue&&(a.updateSelectedValue({value:i.selectedValue}),l())},Da=(e,t)=>{let{store:r,render:s,getRefIds:n,props:i}=e;t._event.stopPropagation();let l=n()["select-button"].elm,p=l.firstElementChild,o=p?p.getBoundingClientRect():l.getBoundingClientRect(),c=r.selectSelectedValue(),u=c!==null?c:i.selectedValue,d=null;u!=null&&i.options&&(d=i.options.findIndex(f=>ce(f.value,u)),d===-1&&(d=null)),r.openOptionsPopover({position:{y:o.bottom+12,x:o.left-24},selectedIndex:d}),s()},ja=e=>{let{store:t,render:r}=e;t.closeOptionsPopover(),r()},Ba=(e,t)=>{let{render:r,dispatchEvent:s,props:n,store:i}=e,a=t._event;a.stopPropagation();let l=a.currentTarget.id.replace("option-",""),p=n.options[l];i.updateSelectedValue({value:p?.value}),n.onChange&&typeof n.onChange=="function"&&n.onChange(p.value),s(new CustomEvent("option-selected",{detail:{value:p.value,label:p.label},bubbles:!0})),s(new CustomEvent("select-change",{detail:{selectedValue:p.value},bubbles:!0})),r()},Wa=(e,t)=>{let{store:r,render:s}=e,n=t._event,i=parseInt(n.currentTarget.id.replace("option-",""));r.setHoveredOption(i),s()},Ma=(e,t)=>{let{store:r,render:s}=e;r.clearHoveredOption(),s()},Fa=(e,t)=>{let{store:r,render:s,dispatchEvent:n,props:i}=e;t._event.stopPropagation(),r.clearSelectedValue(),i.onChange&&typeof i.onChange=="function"&&i.onChange(void 0),n(new CustomEvent("option-selected",{detail:{value:void 0,label:void 0},bubbles:!0})),n(new CustomEvent("select-change",{detail:{selectedValue:void 0},bubbles:!0})),s()},Ka=(e,t)=>{let{store:r,render:s,dispatchEvent:n}=e,{_event:i}=t;i.stopPropagation(),r.closeOptionsPopover(),n(new CustomEvent("add-option-selected",{bubbles:!0})),s()},Ua=(e,t)=>{let{store:r,render:s}=e;r.setHoveredAddOption(!0),s()},za=(e,t)=>{let{store:r,render:s}=e;r.setHoveredAddOption(!1),s()};var Dt={};N(Dt,{clearHoveredOption:()=>so,clearSelectedValue:()=>io,closeOptionsPopover:()=>Za,createInitialState:()=>qa,openOptionsPopover:()=>Qa,resetSelection:()=>to,selectSelectedValue:()=>Xa,selectState:()=>Ya,selectViewData:()=>Ga,setHoveredAddOption:()=>no,setHoveredOption:()=>ro,updateSelectedValue:()=>eo});var Ha=["id","class","style","slot","placeholder","selectedValue","selected-value","onChange","on-change","options"],Ja=e=>Object.entries(e||{}).filter(([t])=>!Ha.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),qa=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,hoveredOptionId:null,hoveredAddOption:!1}),Ga=({state:e,props:t,attrs:r})=>{let s=Ja(r),n=e.selectedValue!==null?e.selectedValue:t.selectedValue,i=t.placeholder||r.placeholder||"Select an option",a=!0,l=t.options||[],p=l.find(c=>ce(c.value,n));p&&(i=p.label,a=!1);let o=l.map((c,u)=>{let d=ce(c.value,n),f=e.hoveredOptionId===u;return{...c,isSelected:d,bgc:f?"ac":d?"mu":""}});return{containerAttrString:s,isOpen:e.isOpen,position:e.position,options:o,selectedValue:n,selectedLabel:i,selectedLabelColor:a?"mu-fg":"fg",hasValue:n!=null,showClear:!r["no-clear"]&&!t["no-clear"]&&n!=null,showAddOption:!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"ac":""}},Ya=({state:e})=>e,Xa=({state:e})=>e.selectedValue,Qa=(e,t)=>{let{position:r,selectedIndex:s}=t;e.position=r,e.isOpen=!0,s!=null&&(e.hoveredOptionId=s)},Za=e=>{e.isOpen=!1},eo=(e,t)=>{e.selectedValue=t.value,e.isOpen=!1},to=e=>{e.selectedValue=void 0},ro=(e,t)=>{e.hoveredOptionId=t},so=e=>{e.hoveredOptionId=null},io=e=>{e.selectedValue=void 0},no=(e,t)=>{e.hoveredAddOption=t};var os={elementName:"rtgl-select",viewDataSchema:{type:"object"},attrsSchema:{type:"object",properties:{placeholder:{type:"string"}}},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"},"no-clear":{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}}}},refs:{"select-button":{eventListeners:{click:{handler:"handleButtonClick"}}},"clear-button":{eventListeners:{click:{handler:"handleClearClick"}}},popover:{eventListeners:{close:{handler:"handleClickOptionsPopoverOverlay"}}},"option-*":{eventListeners:{click:{handler:"handleOptionClick"},mouseenter:{handler:"handleOptionMouseEnter"},mouseleave:{handler:"handleOptionMouseLeave"}}},"option-add":{eventListeners:{click:{handler:"handleAddOptionClick"},mouseenter:{handler:"handleAddOptionMouseEnter"},mouseleave:{handler:"handleAddOptionMouseLeave"}}}},events:{},template:{type:9,items:[{type:8,properties:[{key:'rtgl-button#select-button v=ol ${containerAttrString} data-testid="select-button"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${selectedLabelColor} ellipsis",value:{type:1,path:"selectedLabel"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"selectedLabelColor"}," ellipsis"]}}],fast:!0},{type:8,properties:[{key:"rtgl-view mh=md flex=1",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"$if showClear",value:{type:6,conditions:[{type:1,path:"showClear"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#clear-button mr=md svg=x wh=16 c=mu-fg cur=p 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-button#select-button v=ol ",{type:1,path:"containerAttrString"},' data-testid="select-button"']}}],fast:!1},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} placement=right-start",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=background br=md sv=true",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#option-${i} w=f ph=lg pv=md cur=p br=md bgc=${option.bgc} data-testid=${option.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option-",{type:1,path:"i"}," w=f ph=lg pv=md cur=p br=md bgc=",{type:1,path:"option.bgc"}," data-testid=",{type:1,path:"option.testId"}]}}],fast:!0}],fast:!0}},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f bw=xs bc=mu-bg bt=sm",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-view#option-add w=f ph=lg pv=md cur=p br=md bgc=${addOptionBgc} data-testid="select-add-option"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=ac",value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option-add w=f ph=lg pv=md cur=p br=md bgc=",{type:1,path:"addOptionBgc"},' data-testid="select-add-option"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," placement=right-start"]}}],fast:!1}],fast:!1}};var jt={};N(jt,{handleHeaderClick:()=>ao,handleItemClick:()=>oo});var ao=(e,t)=>{let{store:r,dispatchEvent:s}=e,n=t._event,i,a=r.selectHeader();n.currentTarget.id==="header-label"?i=a.labelPath:n.currentTarget.id==="header-image"?i=a.image.path:n.currentTarget.id==="header"&&(i=a.path),s(new CustomEvent("headerClick",{detail:{path:i},bubbles:!0,composed:!0}))},oo=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t._event.currentTarget.id.replace("item-",""),a=r.selectItem(i);s(new CustomEvent("itemClick",{detail:{item:a},bubbles:!0,composed:!0}))};var Wt={};N(Wt,{createInitialState:()=>lo,selectActiveItem:()=>fo,selectHeader:()=>ho,selectItem:()=>yo,selectViewData:()=>uo,setState:()=>mo});var lo=()=>Object.freeze({}),po=["id","class","style","slot"],co=e=>Object.entries(e).filter(([t])=>!po.includes(t)).map(([t,r])=>`${t}=${r}`).join(" ");function Bt(e,t=null){let r=[];for(let s of e){let n=s.id||s.href||s.path,i=t===n;if(r.push({id:n,title:s.title,href:s.href,type:s.type||"item",icon:s.icon,hrefAttr:s.href?`href=${s.href}`:"",isSelected:i,itemBgc:i?"ac":"bg",itemHoverBgc:i?"ac":"mu"}),s.items&&Array.isArray(s.items))for(let a of s.items){let l=a.id||a.href||a.path,p=t===l;r.push({id:l,title:a.title,href:a.href,type:a.type||"item",icon:a.icon,hrefAttr:a.href?`href=${a.href}`:"",isSelected:p,itemBgc:p?"ac":"bg",itemHoverBgc:p?"ac":"mu"})}}return r}var uo=({state:e,props:t,attrs:r})=>{let s=r.header?JSON.parse(decodeURIComponent(r.header)):t.header,n=r.items?JSON.parse(decodeURIComponent(r.items)):t.items,i=r.selectedItemId||t.selectedItemId,a=co(r),l=r.mode||"full",p=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},o=n?Bt(n,i):[],c=l==="full"?272:64,u=l==="full"?"fs":"c",d=l==="full"?"fs":"c",f=l==="full"?"lg":"sm",h=l==="full"?"md":"sm",y=l==="shrunk-lg"?48:40,b=l==="shrunk-lg"?28:20,m=l==="shrunk-lg"?"md":"sm",w=l==="full",_=l==="full",x=l==="full"?"fs":"c",E=l==="full"?"":`ah=${d}`,$=l==="full"?"f":y;return{containerAttrString:a,mode:l,header:p,items:o,sidebarWidth:c,headerAlign:u,itemAlign:d,headerPadding:f,itemPadding:h,itemHeight:y,iconSize:b,firstLetterSize:m,showLabels:w,showGroupLabels:_,itemContentAlign:x,itemAlignAttr:E,itemWidth:$,headerWidth:$,selectedItemId:i,ah:l==="shrunk-lg"||l==="shrunk-md"?"c":""}},ho=({state:e,props:t,attrs:r})=>r.header?JSON.parse(decodeURIComponent(r.header)):t.header,fo=({state:e,props:t})=>(t.items?Bt(t.items):[]).find(s=>s.active),yo=({state:e,props:t,attrs:r},s)=>{let n=r.items?JSON.parse(decodeURIComponent(r.items)):t.items;return(n?Bt(n):[]).find(a=>a.id===s)},mo=e=>{};var ls={elementName:"rtgl-sidebar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},mode:{type:"string",enum:["full","shrunk","shrunk-lg"],default:"full"},sidebarWidth:{type:"number"},headerAlign:{type:"string"},itemAlign:{type:"string"},headerPadding:{type:"string"},itemPadding:{type:"string"},itemHeight:{type:"number"},iconSize:{type:"number"},firstLetterSize:{type:"string"},showLabels:{type:"boolean"},showGroupLabels:{type:"boolean"},itemContentAlign:{type:"string"},itemAlignAttr:{type:"string"},itemWidth:{type:"string"},headerWidth:{type:"string"},selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},active:{type:"boolean"},icon:{type:"string"}}}}}},propsSchema:{type:"object",properties:{selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},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:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},items:{type:"array"},testId:{type:"string"}}}}}},refs:{"header-image":{eventListeners:{click:{handler:"handleHeaderClick"}}},"header-label":{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item-*":{eventListeners:{click:{handler:"handleItemClick"}}}},events:{headerClick:{type:"object",properties:{path:{type:"string"}}}},anchors:[[{"$if header.image && header.image.src":[{"$if header.image.href":[{"a href=${header.image.href}":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],"$elif header.image.path":[{"rtgl-view#header-image cur=p":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],$else:[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}]},{"$if header.label && showLabels":[{"$if header.labelHref":[{"rtgl-text href=${header.labelHref} s=lg":"${header.label}"}],"$elif header.labelPath":[{"rtgl-view#header-label cur=p":[{"rtgl-text s=lg":"${header.label}"}]}],$else:[{"rtgl-text s=lg":"${header.label}"}]}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=${sidebarWidth} bwr=xs ah=${ah} ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view ph=${headerPadding} pv=lg",value:{type:9,items:[{type:8,properties:[{key:"$if header.href",value:{type:6,conditions:[{type:1,path:"header.href"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view href=${header.href} d=h av=c ah=${headerAlign} g=lg w=${headerWidth}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header-image cur=p",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header-label cur=p",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view href=",{type:1,path:"header.href"}," d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c ah=${headerAlign} g=lg w=${headerWidth} cur=p 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#header-image cur=p",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header-label cur=p",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#header d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}," cur=p 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},{type:8,properties:[{key:"rtgl-view w=f ph=${headerPadding} pb=lg g=xs ah=${ah}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'$if item.type == "groupLabel"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"groupLabel"}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showGroupLabels",value:{type:6,conditions:[{type:1,path:"showGroupLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=32 av=c ph=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=1 bgc=mu-bg",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#item-${item.id} ${item.hrefAttr} h=${itemHeight} av=c ${itemAlignAttr} ph=${itemPadding} w=${itemWidth} h-bgc=${item.itemHoverBgc} br=lg bgc=${item.itemBgc} cur=p data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"$if item.icon",value:{type:6,conditions:[{type:1,path:"item.icon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=${itemContentAlign} g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h ah=",{type:1,path:"itemContentAlign"}," g=sm"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=${iconSize} svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=",{type:1,path:"iconSize"}," svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=${iconSize} br=f bgc=mu av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=${firstLetterSize} c=fg",value:{type:1,path:"item.title.charAt(0).toUpperCase()"},parsedKey:{type:2,parts:["rtgl-text s=",{type:1,path:"firstLetterSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view wh=",{type:1,path:"iconSize"}," br=f bgc=mu av=c ah=c"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#item-",{type:1,path:"item.id"}," ",{type:1,path:"item.hrefAttr"}," h=",{type:1,path:"itemHeight"}," av=c ",{type:1,path:"itemAlignAttr"}," ph=",{type:1,path:"itemPadding"}," w=",{type:1,path:"itemWidth"}," h-bgc=",{type:1,path:"item.itemHoverBgc"}," br=lg bgc=",{type:1,path:"item.itemBgc"}," cur=p data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f ph=",{type:1,path:"headerPadding"}," pb=lg g=xs ah=",{type:1,path:"ah"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{type:1,path:"sidebarWidth"}," bwr=xs ah=",{type:1,path:"ah"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Mt={};N(Mt,{handleBeforeMount:()=>go,handleOnUpdate:()=>vo,handleValueChange:()=>bo});var go=e=>{let{store:t,attrs:r}=e;t.setValue(r.value??0)},vo=(e,t)=>{let{oldAttrs:r,newAttrs:s}=t,{store:n,render:i}=e;if(r?.value!==s?.value){let a=s?.value??0;n.setValue(a),i()}},bo=(e,t)=>{let{store:r,render:s,dispatchEvent:n}=e,i=t._event,a=Number(i.detail.value);r.setValue(a),s(),n(new CustomEvent("slider-input-value-change",{detail:{value:a},bubbles:!0}))};var Ft={};N(Ft,{createInitialState:()=>wo,selectViewData:()=>_o,setValue:()=>xo});var wo=()=>Object.freeze({value:0}),_o=({state:e,attrs:t})=>({key:t.key,value:e.value,w:t.w||"",min:t.min||0,max:t.max||100,step:t.step||1}),xo=(e,t)=>{e.value=t};var ps={elementName:"rtgl-slider-input",viewDataSchema:{type:"object"},attrsSchema:{type:"object",properties:{value:{type:"string",default:"0"},w:{type:"string",default:""},min:{type:"string",default:"0"},max:{type:"string",default:"100"},step:{type:"string",default:"1"}}},refs:{input:{eventListeners:{"input-change":{handler:"handleValueChange"}}},slider:{eventListeners:{"slider-change":{handler:"handleValueChange"}}}},events:{"form-change":{}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=${w}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-slider#slider key=${key} w=f type=range min=${min} max=${max} step=${step} value=${value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider key=",{type:1,path:"key"}," w=f type=range min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=84",value:{type:9,items:[{type:8,properties:[{key:"rtgl-input#input key=${key} w=f type=number min=${min} max=${max} step=${step} value=${value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input key=",{type:1,path:"key"}," w=f type=number min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md w=",{type:1,path:"w"}]}}],fast:!0}],fast:!0}};var Kt={};N(Kt,{handleBeforeMount:()=>Ao,handleHeaderClick:()=>ko,handleRowClick:()=>Eo});var Ao=e=>{},Eo=(e,t)=>{let{dispatchEvent:r,props:s}=e,n=t._event,i=parseInt(n.currentTarget.id.replace("row-","")),a=s.data?.rows?.[i];a&&r(new CustomEvent("row-click",{detail:{rowIndex:i,rowData:a}}))},ko=(e,t)=>{let{store:r,render:s,dispatchEvent:n}=e,a=t._event.currentTarget.id.replace("header-",""),l=r.selectSortInfo(),p="asc";l.column===a&&(l.direction==="asc"?p="desc":l.direction==="desc"&&(p=null)),p?r.setSortColumn({column:a,direction:p}):r.clearSort(),s(),n(new CustomEvent("header-click",{detail:{column:a,direction:p,sortInfo:p?{column:a,direction:p}:null}}))};var Ut={};N(Ut,{clearSort:()=>No,createInitialState:()=>$o,selectSortInfo:()=>Lo,selectState:()=>To,selectViewData:()=>Oo,setSortColumn:()=>Ro});var $o=()=>Object.freeze({sortColumn:null,sortDirection:null}),So=["id","class","style","slot"],Co=e=>Object.entries(e).filter(([t])=>!So.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Io=(e,t)=>{let r=t.split("."),s=e;for(let n of r){if(s==null)return null;s=s[n]}return s},Oo=({state:e,props:t,attrs:r})=>{let s=Co(r),n=t.data||{columns:[],rows:[]},i=n.rows.map((a,l)=>{let p=n.columns.map(o=>{let c=Io(a,o.key);return{key:o.key,value:c!=null?String(c):""}});return{index:l,cells:p}});return{containerAttrString:s,columns:n.columns||[],rows:i||[]}},To=({state:e})=>e,Lo=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),Ro=(e,{column:t,direction:r})=>{e.sortColumn=t,e.sortDirection=r},No=e=>{e.sortColumn=null,e.sortDirection=null};var cs={elementName:"rtgl-table",viewDataSchema:{type:"object",properties:{columns:{type:"array"},rows:{type:"array"},containerAttrString:{type:"string"}}},propsSchema:{type:"object",properties:{data:{type:"object",properties:{columns:{type:"array",items:{type:"object",properties:{key:{type:"string"},label:{type:"string"}}}},rows:{type:"array",items:{type:"object"}}}},responsive:{type:"boolean",default:!0}}},refs:{"row-*":{eventListeners:{click:{handler:"handleRowClick"}}},"header-*":{eventListeners:{click:{handler:"handleHeaderClick"}}}},events:{},styles:{table:{width:"100%","border-collapse":"collapse","border-spacing":0},thead:{"border-bottom":"2px solid var(--border)"},th:{padding:"12px","text-align":"left","font-weight":500,color:"var(--foreground)","background-color":"var(--muted)",cursor:"pointer",position:"sticky",top:0,"z-index":1},"tbody tr":{"border-bottom":"1px solid var(--border)"},"tbody tr:last-child":{"border-bottom":"none"},td:{padding:"12px",color:"var(--foreground)"},".table-container":{width:"100%",height:"100%",overflow:"auto"},".empty-state":{"text-align":"center",padding:"24px",color:"var(--muted-foreground)"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view.table-container ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if rows.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"rows.length"},right:{type:0,value:0}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"table",value:{type:9,items:[{type:8,properties:[{key:"thead",value:{type:9,items:[{type:8,properties:[{key:"tr",value:{type:9,items:[{type:7,itemVar:"column",indexVar:"i",iterable:{type:1,path:"columns"},body:{type:9,items:[{type:8,properties:[{key:"th#header-${column.key}",value:{type:1,path:"column.label"},parsedKey:{type:2,parts:["th#header-",{type:1,path:"column.key"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"tbody",value:{type:9,items:[{type:7,itemVar:"row",indexVar:"rowIndex",iterable:{type:1,path:"rows"},body:{type:9,items:[{type:8,properties:[{key:"tr#row-${row.index}",value:{type:9,items:[{type:7,itemVar:"cell",indexVar:"cellIndex",iterable:{type:1,path:"row.cells"},body:{type:9,items:[{type:8,properties:[{key:"td",value:{type:1,path:"cell.value"}}],fast:!0}],fast:!0}}],fast:!1},parsedKey:{type:2,parts:["tr#row-",{type:1,path:"row.index"}]}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view.empty-state w=f p=xl",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"No data available"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view.table-container ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var zt={};N(zt,{handleClickItem:()=>Vo});var Vo=(e,t)=>{let{dispatchEvent:r}=e,n=t._event.currentTarget.dataset.id;r(new CustomEvent("item-click",{detail:{id:n}}))};var Ht={};N(Ht,{createInitialState:()=>Po,selectViewData:()=>Bo});var Po=()=>Object.freeze({}),Do=["id","class","style","slot"],jo=e=>Object.entries(e).filter(([t])=>!Do.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Bo=({state:e,props:t,attrs:r})=>{let s=jo(r),n=t.items||[],i=r["selected-tab"],a=n.map(l=>({...l,isSelected:l.id===i,bgColor:l.id===i?"ac":"",borderColor:l.id===i?"":"tr",textColor:l.id===i?"":"mu-fg"}));return{containerAttrString:s,items:a,selectedTab:i}};var us={elementName:"rtgl-tabs",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},isSelected:{type:"boolean"},bgColor:{type:"string"},textColor:{type:"string"},borderColor:{type:"string"}}}},selectedTab:{type:"string"}}},propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},testId:{type:"string"}}}}}},attrsSchema:{type:"object",properties:{"selected-tab":{type:"string"}}},refs:{"tab-*":{eventListeners:{click:{handler:"handleClickItem"}}}},events:{"item-click":{type:"object",properties:{id:{type:"string"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm bgc=mu p=sm br=lg ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:null,iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#tab-${item.id} data-id=${item.id} cur=p bgc=${item.bgColor} bw=xs bc=${item.borderColor} pv=md ph=lg br=lg 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:"item.id"}," data-id=",{type:1,path:"item.id"}," cur=p bgc=",{type:1,path:"item.bgColor"}," bw=xs bc=",{type:1,path:"item.borderColor"}," pv=md ph=lg br=lg data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h g=sm bgc=mu p=sm br=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var ds={};var Jt={};N(Jt,{createInitialState:()=>Wo,selectViewData:()=>Mo});var Wo=()=>Object.freeze({}),Mo=({attrs:e})=>({open:!!e.open,x:e.x||0,y:e.y||0,placement:e.placement||"top",content:e.content||""});var hs={elementName:"rtgl-tooltip",viewDataSchema:{type:"object"},attrsSchema:{type:"object",properties:{open:{type:"string"},x:{type:"string"},y:{type:"string"},placement:{type:"string"},content:{type:"string"}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} placement=${placement} no-overlay",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content bgc=background bc=border br=md p=sm ah=c av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text ta=c s=sm c=foreground",value:{type:1,path:"content"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," placement=",{type:1,path:"placement"}," no-overlay"]}}],fast:!0}],fast:!0}};var qt={};N(qt,{handleAfterMount:()=>Fo,handleOnUpdate:()=>Ko});var Fo=async e=>{let{props:t,store:r,render:s,getRefIds:n}=e,{waveformData:i}=t;r.setWaveformData(i),s();let a=n().canvas?.elm;a&&fs(i,a)},Ko=async(e,t)=>{let{store:r,render:s,getRefIds:n,props:i}=e,{waveformData:a}=i;if(!a){console.log("waveform handleOnUpdate: no waveformData provided");return}r.setWaveformData(a),s();let l=n().canvas?.elm;l&&fs(a,l)};async function fs(e,t){let r=t.getContext("2d"),s=t.getBoundingClientRect(),n=s.width,i=s.height;t.width=n,t.height=i;let a=t.width,l=t.height;if(r.clearRect(0,0,a,l),r.fillStyle="#1a1a1a",r.fillRect(0,0,a,l),!e||!e.amplitudes)return;let p=e.amplitudes,o=l/2,c=r.createLinearGradient(0,0,0,l);c.addColorStop(0,"#404040"),c.addColorStop(.5,"#A1A1A1"),c.addColorStop(1,"#404040");let u=Math.max(1,a/p.length),d=.2;for(let f=0;f<p.length;f++){let y=p[f]/255*(l*.85),b=f*u,m=o-y/2;r.fillStyle=c,r.fillRect(b,m,Math.max(1,u*(1-d)),y)}r.strokeStyle="rgba(255, 255, 255, 0.1)",r.lineWidth=1,r.beginPath(),r.moveTo(0,o),r.lineTo(a,o),r.stroke(),r.shadowBlur=10,r.shadowColor="#2196F3"}var Gt={};N(Gt,{createInitialState:()=>Uo,selectViewData:()=>Ho,setWaveformData:()=>zo});var Uo=()=>Object.freeze({waveformData:null}),zo=(e,t)=>{e.waveformData=t},Ho=({state:e,attrs:t,props:r})=>({isLoading:r.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:r.waveformData});var ys={elementName:"rtgl-waveform",attrsSchema:{type:"object",properties:{w:{type:"string",description:"Width of the waveform visualizer",default:"250"},h:{type:"string",description:"Height of the waveform visualizer",default:"150"},cur:{type:"string",description:"cursor"}}},propsSchema:{type:"object",properties:{waveformData:{type:"object",description:"File ID of the waveform data in object storage"},isLoading:{type:"boolean",description:"Whether the waveform data is currently being loaded"}}},refs:{canvas:{selector:"canvas"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f pos=rel w=${w} h=${h} cur=${cur}",value:{type:9,items:[{type:8,properties:[{key:"$if isLoading",value:{type:6,conditions:[{type:1,path:"isLoading"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"..."}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'canvas#canvas style="width:100%; height:100%;"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=f pos=rel w=",{type:1,path:"w"}," h=",{type:1,path:"h"}," cur=",{type:1,path:"cur"}]}}],fast:!1}],fast:!1}};var _s=Symbol.for("immer-nothing"),ms=Symbol.for("immer-draftable"),se=Symbol.for("immer-state");function le(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ae=Object.getPrototypeOf;function Ee(e){return!!e&&!!e[se]}function ye(e){return e?xs(e)||Array.isArray(e)||!!e[ms]||!!e.constructor?.[ms]||qe(e)||Ge(e):!1}var Jo=Object.prototype.constructor.toString();function xs(e){if(!e||typeof e!="object")return!1;let t=Ae(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===Jo}function Ue(e,t){Je(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function Je(e){let t=e[se];return t?t.type_:Array.isArray(e)?1:qe(e)?2:Ge(e)?3:0}function Qt(e,t){return Je(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function As(e,t,r){let s=Je(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function qo(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function qe(e){return e instanceof Map}function Ge(e){return e instanceof Set}function fe(e){return e.copy_||e.base_}function Zt(e,t){if(qe(e))return new Map(e);if(Ge(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=xs(e);if(t===!0||t==="class_only"&&!r){let s=Object.getOwnPropertyDescriptors(e);delete s[se];let n=Reflect.ownKeys(s);for(let i=0;i<n.length;i++){let a=n[i],l=s[a];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(s[a]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[a]})}return Object.create(Ae(e),s)}else{let s=Ae(e);if(s!==null&&r)return{...e};let n=Object.create(s);return Object.assign(n,e)}}function ir(e,t=!1){return Ye(e)||Ee(e)||!ye(e)||(Je(e)>1&&(e.set=e.add=e.clear=e.delete=Go),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>ir(s,!0))),e}function Go(){le(2)}function Ye(e){return Object.isFrozen(e)}var Yo={};function me(e){let t=Yo[e];return t||le(0,e),t}var Re;function Es(){return Re}function Xo(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function gs(e,t){t&&(me("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function er(e){tr(e),e.drafts_.forEach(Qo),e.drafts_=null}function tr(e){e===Re&&(Re=e.parent_)}function vs(e){return Re=Xo(Re,e)}function Qo(e){let t=e[se];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function bs(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[se].modified_&&(er(t),le(4)),ye(e)&&(e=ze(t,e),t.parent_||He(t,e)),t.patches_&&me("Patches").generateReplacementPatches_(r[se].base_,e,t.patches_,t.inversePatches_)):e=ze(t,r,[]),er(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==_s?e:void 0}function ze(e,t,r){if(Ye(t))return t;let s=t[se];if(!s)return Ue(t,(n,i)=>ws(e,s,t,n,i,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return He(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;let n=s.copy_,i=n,a=!1;s.type_===3&&(i=new Set(n),n.clear(),a=!0),Ue(i,(l,p)=>ws(e,s,n,l,p,r,a)),He(e,n,!1),r&&e.patches_&&me("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function ws(e,t,r,s,n,i,a){if(Ee(n)){let l=i&&t&&t.type_!==3&&!Qt(t.assigned_,s)?i.concat(s):void 0,p=ze(e,n,l);if(As(r,s,p),Ee(p))e.canAutoFreeze_=!1;else return}else a&&r.add(n);if(ye(n)&&!Ye(n)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ze(e,n),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&He(e,n)}}function He(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ir(t,r)}function Zo(e,t){let r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:Es(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},n=s,i=nr;r&&(n=[s],i=Ne);let{revoke:a,proxy:l}=Proxy.revocable(n,i);return s.draft_=l,s.revoke_=a,l}var nr={get(e,t){if(t===se)return e;let r=fe(e);if(!Qt(r,t))return el(e,r,t);let s=r[t];return e.finalized_||!ye(s)?s:s===Yt(e.base_,t)?(Xt(e),e.copy_[t]=sr(s,e)):s},has(e,t){return t in fe(e)},ownKeys(e){return Reflect.ownKeys(fe(e))},set(e,t,r){let s=ks(fe(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let n=Yt(fe(e),t),i=n?.[se];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(qo(r,n)&&(r!==void 0||Qt(e.base_,t)))return!0;Xt(e),rr(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Yt(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Xt(e),rr(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=fe(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){le(11)},getPrototypeOf(e){return Ae(e.base_)},setPrototypeOf(){le(12)}},Ne={};Ue(nr,(e,t)=>{Ne[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ne.deleteProperty=function(e,t){return Ne.set.call(this,e,t,void 0)};Ne.set=function(e,t,r){return nr.set.call(this,e[0],t,r,e[0])};function Yt(e,t){let r=e[se];return(r?fe(r):e)[t]}function el(e,t,r){let s=ks(t,r);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function ks(e,t){if(!(t in e))return;let r=Ae(e);for(;r;){let s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=Ae(r)}}function rr(e){e.modified_||(e.modified_=!0,e.parent_&&rr(e.parent_))}function Xt(e){e.copy_||(e.copy_=Zt(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var tl=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,s)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let a=this;return function(p=i,...o){return a.produce(p,c=>r.call(this,c,...o))}}typeof r!="function"&&le(6),s!==void 0&&typeof s!="function"&&le(7);let n;if(ye(t)){let i=vs(this),a=sr(t,void 0),l=!0;try{n=r(a),l=!1}finally{l?er(i):tr(i)}return gs(i,s),bs(n,i)}else if(!t||typeof t!="object"){if(n=r(t),n===void 0&&(n=t),n===_s&&(n=void 0),this.autoFreeze_&&ir(n,!0),s){let i=[],a=[];me("Patches").generateReplacementPatches_(t,n,i,a),s(i,a)}return n}else le(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...l)=>this.produceWithPatches(a,p=>t(p,...l));let s,n;return[this.produce(t,r,(a,l)=>{s=a,n=l}),s,n]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ye(e)||le(8),Ee(e)&&(e=rl(e));let t=vs(this),r=sr(e,void 0);return r[se].isManual_=!0,tr(t),r}finishDraft(e,t){let r=e&&e[se];(!r||!r.isManual_)&&le(9);let{scope_:s}=r;return gs(s,t),bs(void 0,s)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let n=t[r];if(n.path.length===0&&n.op==="replace"){e=n.value;break}}r>-1&&(t=t.slice(r+1));let s=me("Patches").applyPatches_;return Ee(e)?s(e,t):this.produce(e,n=>s(n,t))}};function sr(e,t){let r=qe(e)?me("MapSet").proxyMap_(e,t):Ge(e)?me("MapSet").proxySet_(e,t):Zo(e,t);return(t?t.scope_:Es()).drafts_.push(r),r}function rl(e){return Ee(e)||le(10,e),$s(e)}function $s(e){if(!ye(e)||Ye(e))return e;let t=e[se],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Zt(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Zt(e,!0);return Ue(r,(s,n)=>{As(r,s,$s(n))}),t&&(t.finalized_=!1),r}var ie=new tl,Ss=ie.produce,Lu=ie.produceWithPatches.bind(ie),Ru=ie.setAutoFreeze.bind(ie),Nu=ie.setUseStrictShallowCopy.bind(ie),Vu=ie.applyPatches.bind(ie),Pu=ie.createDraft.bind(ie),Du=ie.finishDraft.bind(ie);var g={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},M={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},Ve={NOT:0};var R=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},Q=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var ar=e=>{if(!e||e.trim()==="")throw new R("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new R(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${r}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let r of t)if(e.trim().endsWith(r))throw new R(`Incomplete comparison expression - missing right operand (got: '${e}')`)},Cs=e=>{if(e.trim().endsWith(" in"))throw new R(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new R(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new R(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(t.includes(",")){let s=t.split(",").map(n=>n.trim());for(let n of s)if(!n)throw new R(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`)}else if(!t.trim())throw new R(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`)};var Is=(e,t,r=!1)=>{if(t===null)return new Q(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new Q(`Cannot iterate over undefined value at '$for ${e}'`);let s=typeof t;return r?new Q(`Cannot iterate over non-array value in loop '${e}' - got ${s} instead`):new Q(`Cannot iterate over non-array value (got: ${s}) at '$for ${e}'`)},Os=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new Q(`Unknown function '${e}' (${r})`)};var sl=(e,t,r={})=>{let s={},n={};r&&typeof r=="object"&&(r.functions!==void 0||r.partials!==void 0?(s=r.functions||{},n=r.partials||{}):typeof r=="object"&&(s=r));let a=T(e,{functions:s,partials:n},t,{});return a===void 0?{}:a},T=(e,t,r,s)=>{let n=t.functions||t;if(e.var&&!e.type)return H(e.var,r,s);if(e.type===g.LITERAL)return e.value;if(e.type===g.VARIABLE)return H(e.path,r,s);if(e.type===g.INTERPOLATION)return nl(e.parts,t,r,s);switch(e.type){case g.FUNCTION:return Ls(e,t,r,s);case g.BINARY:return Rs(e,t,r,s);case g.UNARY:return Ns(e,t,r,s);case g.CONDITIONAL:return ol(e,t,r,s);case g.LOOP:return dl(e,t,r,s);case g.OBJECT:return fl(e,t,r,s);case g.ARRAY:return yl(e,t,r,s);case g.PARTIAL:return ml(e,t,r,s);case g.PATH_REFERENCE:return gl(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},Ts=new Map,il=e=>{let t=[],r="",s=!1;for(let n=0;n<e.length;n++){let i=e[n];if(i==="[")r&&(t.push({type:"property",value:r}),r=""),s=!0;else if(i==="]"){if(s&&r){let a=r.trim();if(/^\d+$/.test(a))t.push({type:"index",value:parseInt(a,10)});else if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")){let l=a.slice(1,-1);t.push({type:"property",value:l})}else t.push({type:"property",value:a});r=""}s=!1}else r+=i}return r&&t.push({type:"property",value:r}),t},H=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let s=Ts.get(e);if(!s){let i=[],a="",l=0;for(let p=0;p<e.length;p++){let o=e[p];o==="["?(l++,a+=o):o==="]"?(l--,a+=o):o==="."&&l===0?a&&(i.push(a),a=""):a+=o}a&&i.push(a),s=[];for(let p of i){let o=il(p.trim());s.push(...o)}Ts.set(e,s)}let n=t;for(let i=0;i<s.length;i++){let a=s[i];if(a.type==="property"&&a.value in r){n=r[a.value];continue}if(n==null)return;(a.type==="property"||a.type==="index")&&(n=n[a.value])}return n},nl=(e,t,r,s)=>{let n=[];for(let i of e)if(typeof i=="string")n.push(i);else{let a=T(i,t,r,s);n.push(a!=null?String(a):"")}return n.join("")},Ls=(e,t,r,s)=>{let n=t.functions||t,i=n[e.name];if(!i)throw Os(e.name,n);let a=e.args.map(l=>T(l,t,r,s));return i(...a)},ke=(e,t,r,s)=>{if(e.var&&!e.type)return H(e.var,r,s);switch(e.type){case g.VARIABLE:return H(e.path,r,s);case g.LITERAL:return e.value;case g.BINARY:return Rs(e,t,r,s);case g.UNARY:return Ns(e,t,r,s);case g.FUNCTION:return Ls(e,t,r,s);default:return T(e,t,r,s)}},Rs=(e,t,r,s)=>{if(e.op===M.AND||e.op===M.OR){let a=ke(e.left,t,r,s),l=ke(e.right,t,r,s);switch(e.op){case M.AND:return a&&l;case M.OR:return a||l}}let n=T(e.left,t,r,s),i=T(e.right,t,r,s);switch(e.op){case M.EQ:return n==i;case M.NEQ:return n!=i;case M.GT:return n>i;case M.LT:return n<i;case M.GTE:return n>=i;case M.LTE:return n<=i;case M.IN:return Array.isArray(i)?i.includes(n):!1;case M.ADD:if(typeof n!="number"||typeof i!="number")throw new Q(`Arithmetic operations require numbers. Got ${typeof n} + ${typeof i}`);return n+i;case M.SUBTRACT:if(typeof n!="number"||typeof i!="number")throw new Q(`Arithmetic operations require numbers. Got ${typeof n} - ${typeof i}`);return n-i;default:throw new Error(`Unknown binary operator: ${e.op}`)}},Ns=(e,t,r,s)=>{let n=e.op===Ve.NOT?ke(e.operand,t,r,s):T(e.operand,t,r,s);switch(e.op){case Ve.NOT:return!n;default:throw new Error(`Unknown unary operator: ${e.op}`)}},al=(e,t,r,s)=>{if(e.conditions.length===2&&e.conditions[1]===null){let n=e.conditions[0];if(n.type===g.VARIABLE)if(H(n.path,r,s)){let a=e.bodies[0];if(a.type===g.OBJECT&&a.properties.length<=5){let l={};for(let p of a.properties){let o=p.parsedKey?T(p.parsedKey,t,r,s):p.key,c=p.value;if(c.type===g.LITERAL)l[o]=c.value;else if(c.type===g.VARIABLE)l[o]=H(c.path,r,s);else if(c.type===g.INTERPOLATION){let u=[];for(let d of c.parts)if(typeof d=="string")u.push(d);else if(d.type===g.VARIABLE){let f=H(d.path,r,s);u.push(f!=null?String(f):"")}else{let f=T(d,t,r,s);u.push(f!=null?String(f):"")}l[o]=u.join("")}else l[o]=T(c,t,r,s)}return l}}else{let a=e.bodies[1];if(a.type===g.OBJECT&&a.properties.length<=5){let l={};for(let p of a.properties){let o=p.parsedKey?T(p.parsedKey,t,r,s):p.key,c=p.value;if(c.type===g.LITERAL)l[o]=c.value;else if(c.type===g.VARIABLE)l[o]=H(c.path,r,s);else if(c.type===g.INTERPOLATION){let u=[];for(let d of c.parts)if(typeof d=="string")u.push(d);else if(d.type===g.VARIABLE){let f=H(d.path,r,s);u.push(f!=null?String(f):"")}else{let f=T(d,t,r,s);u.push(f!=null?String(f):"")}l[o]=u.join("")}else l[o]=T(c,t,r,s)}return l}}}return null},ol=(e,t,r,s)=>{let n=al(e,t,r,s);if(n!==null)return n;for(let i=0;i<e.conditions.length;i++){let a=e.conditions[i];if(a===null||ke(a,t,r,s))return T(e.bodies[i],t,r,s)}return Vs},ll=(e,t)=>{let r=e.body,s=e.itemVar;if(r.type===g.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===g.VARIABLE){let n=r.conditions[0].path,i=r.bodies[0];if(n.startsWith(s+".")){let a=n.substring(s.length+1);if(i.type===g.OBJECT&&i.properties.length<=5){for(let p of i.properties)if(p.parsedKey)return null;let l=[];for(let p=0;p<t.length;p++){let o=t[p];if(o[a]){let c={};for(let u of i.properties){let d=u.key,f=u.value;if(f.type===g.LITERAL)c[d]=f.value;else if(f.type===g.VARIABLE){let h=f.path;if(h===s)c[d]=o;else if(h.startsWith(s+".")){let y=h.substring(s.length+1);c[d]=o[y]}else return null}else if(f.type===g.INTERPOLATION){let h=[],y=!0;for(let b of f.parts)if(typeof b=="string")h.push(b);else if(b.type===g.VARIABLE){let m=b.path;if(m===s)h.push(o!=null?String(o):"");else if(m.startsWith(s+".")){let w=m.substring(s.length+1),_=o[w];h.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[d]=h.join("")}else return null}l.push(c)}}return l}}}return null},pl=(e,t)=>{let r=e.body,s=e.itemVar,n=ll(e,t);if(n!==null)return n;if(r.type===g.OBJECT&&r.properties.length<=5){for(let l of r.properties)if(l.parsedKey)return null;let i=[],a=!0;for(let l of r.properties){let p=l.key,o=l.value;if(o.type===g.LITERAL)i.push({key:p,type:"literal",value:o.value});else if(o.type===g.VARIABLE){let c=o.path;if(c===s)i.push({key:p,type:"item"});else if(c.startsWith(s+".")){let u=c.substring(s.length+1);if(!u.includes(".")&&!u.includes("["))i.push({key:p,type:"prop",prop:u});else{a=!1;break}}else{a=!1;break}}else if(o.type===g.INTERPOLATION&&o.parts.length===1){let c=o.parts[0];if(c.type===g.VARIABLE){let u=c.path;if(u===s)i.push({key:p,type:"item_string"});else if(u.startsWith(s+".")){let d=u.substring(s.length+1);if(!d.includes(".")&&!d.includes("["))i.push({key:p,type:"prop_string",prop:d});else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}if(a){let l=new Array(t.length);if(i.length===3&&i[0].type==="prop"&&i[0].key==="id"&&i[1].type==="prop_string"&&i[1].key==="title"&&i[2].type==="prop"&&i[2].key==="completed")for(let p=0;p<t.length;p++){let o=t[p];l[p]={id:o.id,title:o.title!=null?String(o.title):"",completed:o.completed}}else for(let p=0;p<t.length;p++){let o=t[p],c={};for(let u of i)if(u.type==="literal")c[u.key]=u.value;else if(u.type==="item")c[u.key]=o;else if(u.type==="prop")c[u.key]=o[u.prop];else if(u.type==="item_string")c[u.key]=o!=null?String(o):"";else if(u.type==="prop_string"){let d=o[u.prop];c[u.key]=d!=null?String(d):""}l[p]=c}return l}}return null},cl=(e,t,r,s,n)=>{let i=[],a=e.body;if(a.type===g.OBJECT&&a.fast!==!1){let l=e.itemVar,p=e.indexVar;for(let o=0;o<n.length;o++){let c=n[o],u={},d={...s,[l]:c,...p&&{[p]:o}};d.__paths__||(d.__paths__=s.__paths__||{});let f=e.iterable.path||"";if(s&&s.__paths__&&f){let h=f.split("."),y=h[0];y in s.__paths__&&(f=s.__paths__[y],h.length>1&&(f+="."+h.slice(1).join(".")))}d.__paths__={...d.__paths__,[l]:`${f}[${o}]`,...p&&{[p]:o}};for(let h of a.properties){let y=h.parsedKey?T(h.parsedKey,t,r,d):h.key,b=h.value;if(b.type===g.LITERAL)u[y]=b.value;else if(b.type===g.VARIABLE){let m=b.path;if(m===l)u[y]=c;else if(m===p)u[y]=o;else if(m.startsWith(l+".")){let w=m.substring(l.length+1);!w.includes(".")&&!w.includes("[")?u[y]=c[w]:u[y]=H(m,r,{...s,[l]:c,...p&&{[p]:o}})}else u[y]=H(m,r,{...s,[l]:c,...p&&{[p]:o}})}else if(b.type===g.INTERPOLATION){let m=[];for(let w of b.parts)if(typeof w=="string")m.push(w);else if(w.type===g.VARIABLE){let _=w.path,x;if(_===l)x=c;else if(_===p)x=o;else if(_.startsWith(l+".")){let E=_.substring(l.length+1);!E.includes(".")&&!E.includes("[")?x=c[E]:x=H(_,r,{...s,[l]:c,...p&&{[p]:o}})}else x=H(_,r,{...s,[l]:c,...p&&{[p]:o}});m.push(x!=null?String(x):"")}else{let _={...s,[l]:c,...p&&{[p]:o}},x=T(w,t,r,_);m.push(x!=null?String(x):"")}u[y]=m.join("")}else{let m={...s,[l]:c,...p&&{[p]:o}};u[y]=T(b,t,r,m)}}i.push(u)}return i}return null},ul=(e,t,r)=>{let s=e.body;if(s.type===g.OBJECT&&s.properties.length===1&&s.properties[0].key==="$if item.visible"){let i=s.properties[0].value;if(i.type===g.CONDITIONAL&&i.conditions.length===1&&i.conditions[0].type===g.VARIABLE&&i.conditions[0].path==="item.visible"){let a=i.bodies[0];if(a.type===g.OBJECT&&a.properties.length===2){let l=a.properties[0],p=a.properties[1];if(l.key==="id"&&l.value.type===g.VARIABLE&&l.value.path==="item.id"&&p.key==="$if item.highlighted"&&p.value.type===g.CONDITIONAL){let o=[];for(let c=0;c<t.length;c++){let u=t[c];if(u.visible){let d={id:u.id};u.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${u.name}`):(d.highlight=!1,d.message=u.name),o.push(d)}}return o}}}}return null},dl=(e,t,r,s)=>{let n=T(e.iterable,t,r,s);if(!Array.isArray(n)){let o,c=!1;if(e.iterable.type===g.FUNCTION){c=!0;let d=e.iterable.args.map(f=>f.type===g.LITERAL?typeof f.value=="string"?`'${f.value}'`:String(f.value):f.type===g.VARIABLE?f.path:f.type===g.FUNCTION?`${f.name}(...)`:"?").join(", ");o=`${e.iterable.name}(${d})`}else o=e.iterable.path||"undefined";let u=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${o}`;throw Is(u,n,c)}if(!e.indexVar){let o=ul(e,n,e.itemVar);if(o!==null)return o}if(!e.indexVar){let o=pl(e,n);if(o!==null)return o}let i=cl(e,t,r,s,n);if(i!==null)return i;let a=[],l=e.iterable.path||"";if(s&&s.__paths__&&l){let o=l.split("."),c=o[0];c in s.__paths__&&(l=s.__paths__[c],o.length>1&&(l+="."+o.slice(1).join(".")))}let p=!1;e.body.type===g.ARRAY&&(e.body.items.length<=1?p=!1:p=e.body._shouldPreserveArray??=e.body.items.some(o=>o.type===g.OBJECT&&o.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let o=0;o<n.length;o++){let c=e.indexVar?{...s,[e.itemVar]:n[o],[e.indexVar]:o}:{...s,[e.itemVar]:n[o]};c.__paths__||(c.__paths__=s.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${l}[${o}]`},e.indexVar&&(c.__paths__[e.indexVar]=o);let u=T(e.body,t,r,c);Array.isArray(u)&&u.length===1&&!p?a.push(u[0]):a.push(u)}return a},hl=(e,t,r,s)=>{if(e.whenCondition)return null;if(e.properties.length===1){let n=e.properties[0],i=n.parsedKey?T(n.parsedKey,t,r,s):n.key,a=n.value;if(a.type===g.OBJECT&&a.properties.length<=10&&!a.whenCondition){let l={},p={},o=!0;for(let c of a.properties){let u=c.parsedKey?T(c.parsedKey,t,r,s):c.key,d=c.value;if(d.type===g.LITERAL)p[u]=d.value;else if(d.type===g.VARIABLE)p[u]=H(d.path,r,s);else if(d.type===g.INTERPOLATION){let f=[];for(let h of d.parts)if(typeof h=="string")f.push(h);else if(h.type===g.VARIABLE){let y=H(h.path,r,s);f.push(y!=null?String(y):"")}else{o=!1;break}if(!o)break;p[u]=f.join("")}else if(d.type===g.OBJECT&&d.properties.length<=5){let f={};for(let h of d.properties){let y=h.key,b=h.value;if(b.type===g.LITERAL)f[y]=b.value;else if(b.type===g.VARIABLE)f[y]=H(b.path,r,s);else if(b.type===g.INTERPOLATION){let m=[];for(let w of b.parts)if(typeof w=="string")m.push(w);else if(w.type===g.VARIABLE){let _=H(w.path,r,s);m.push(_!=null?String(_):"")}else{o=!1;break}if(!o)break;f[y]=m.join("")}else{o=!1;break}}if(!o)break;p[u]=f}else{o=!1;break}}if(o)return l[i]=p,l}}return null},fl=(e,t,r,s)=>{let n=t.functions||t;if(e.whenCondition&&!ke(e.whenCondition,n,r,s))return;let i=hl(e,t,r,s);if(i!==null)return i;if(e.fast){let o={};for(let c of e.properties){let u=c.parsedKey?T(c.parsedKey,t,r,s):c.key,d=c.value;if(d.type===g.LITERAL)o[u]=d.value;else if(d.type===g.VARIABLE)o[u]=H(d.path,r,s);else if(d.type===g.INTERPOLATION){let f=[];for(let h of d.parts)if(typeof h=="string")f.push(h);else if(h.type===g.VARIABLE){let y=H(h.path,r,s);f.push(y!=null?String(y):"")}else{let y=T(h,t,r,s);f.push(y!=null?String(y):"")}o[u]=f.join("")}else o[u]=T(d,t,r,s)}return o}let a={},l=null,p=!1;for(let o of e.properties)if(!o.key.startsWith("$if ")&&!o.key.match(/^\$if\s+\w+.*:?$/)&&!o.key.startsWith("$elif")&&!o.key.startsWith("$else")&&!o.key.startsWith("$for ")){p=!0;break}for(let o of e.properties)if(o.key.startsWith("$if ")||o.key.match(/^\$if\s+\w+.*:?$/)){let c=T(o.value,t,r,s);if(!p&&c!==null&&c!==void 0)return Array.isArray(c)&&c.length===1?c[0]:c;typeof c=="object"&&c!==null&&!Array.isArray(c)&&Object.assign(a,c)}else if(o.key.startsWith("$for ")){if(e.properties.length===1)return T(o.value,t,r,s)}else{let c=o.value;if(c&&c.type===g.OBJECT&&c.properties){let u=c.properties.find(d=>d.key.startsWith("$for "));if(u){let d=T(u.value,t,r,s);d!==void 0&&(a[o.key]=d)}else{let d=T(o.value,t,r,s);d!==void 0&&(a[o.key]=d)}}else{let u=o.parsedKey?T(o.parsedKey,t,r,s):o.key,d=T(o.value,t,r,s);d!==void 0&&(a[u]=d)}}return a},Vs={},yl=(e,t,r,s)=>{let n=[];for(let i of e.items)if(i.type===g.LOOP){let a=T(i,t,r,s);n.push(a)}else{let a=T(i,t,r,s);a!==Vs&&a!==void 0&&n.push(a)}return n},ml=(e,t,r,s)=>{let{name:n,data:i,whenCondition:a}=e,l=t.partials||{},p=t.functions||t;if(a&&!ke(a,p,r,s))return;if(!l[n])throw new Q(`Partial '${n}' is not defined`);let o=s._partialStack||[];if(o.includes(n))throw new Q(`Circular partial reference detected: ${n}`);let c=l[n],u=r,d={...s,_partialStack:[...o,n]};if(s){u={...r};for(let f of Object.keys(s))f.startsWith("_")||(u[f]=s[f])}if(i){let f=T(i,t,r,s);u={...u,...f}}return T(c,t,u,d)},gl=(e,t,r,s)=>{let{path:n}=e,i=n.split("."),a=i[0],l=i.slice(1);if(!s||!(a in s))throw new Q(`Path reference '#{${n}}' refers to '${a}' which is not a loop variable in the current scope`);if(s.__paths__||(s.__paths__={}),!(a in s.__paths__))throw new Q(`Path reference '#{${n}}' cannot be resolved - path tracking may not be initialized properly`);let p=s.__paths__[a];if(typeof p=="number"){if(l.length>0)throw new Q(`Path reference '#{${n}}' - cannot access properties on index variable '${a}'`);return String(p)}return l.length>0&&(p+="."+l.join(".")),p},Pe=sl;var vl=/\$\{([^}]*)\}/g,bl=/#\{([^}]*)\}/g,Ds=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,s,n]=r,i=wl(n,t);return{isFunction:!0,type:g.FUNCTION,name:s,args:i}},wl=(e,t={})=>e.trim()?_l(e).map(s=>xl(s.trim(),t)):[],_l=e=>{let t=[],r="",s=0,n=!1,i="";for(let a=0;a<e.length;a++){let l=e[a],p=a>0?e[a-1]:"";!n&&(l==='"'||l==="'")?(n=!0,i=l,r+=l):n&&l===i&&p!=="\\"?(n=!1,i="",r+=l):!n&&l==="("?(s++,r+=l):!n&&l===")"?(s--,r+=l):!n&&l===","&&s===0?(t.push(r),r=""):r+=l}return r&&t.push(r),t},xl=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:g.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:g.LITERAL,value:parseFloat(e)};if(e==="true")return{type:g.LITERAL,value:!0};if(e==="false")return{type:g.LITERAL,value:!1};if(e==="null")return{type:g.LITERAL,value:null};let r=Ds(e,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};let s=e.trim(),n=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],i=-1,a=null;for(let{op:l,type:p}of n){let o=0;for(;o<s.length;){let c=ge(s.substring(o),l);if(c===-1)break;let u=o+c;u>i&&(i=u,a={op:l,type:p}),o=u+l.length}}if(i!==-1)try{return Y(s,t)}catch{return{type:g.VARIABLE,path:s}}return{type:g.VARIABLE,path:s}},js=/^\w+\(.*\)$/,Al=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,El=e=>{if(!(!e||e.trim()===""||js.test(e))&&Al.test(e))throw e.includes("?")&&e.includes(":")?new R(`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 R(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new R(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},Ps=e=>{let t=e.trim();if(js.test(t))throw new R(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new R(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new R(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new R(`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 R(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:g.PATH_REFERENCE,path:t}},De=(e,t={})=>{let r=e.trim();El(r);let s=Ds(r,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};if(r.includes("[")&&!/[\s+\-*/%|&?:]/.test(r)){let n=0;for(let i of r)i==="["?n++:i==="]"&&n--;if(n!==0)throw new Error("Invalid array index syntax")}return{type:g.VARIABLE,path:r}},or=(e,t={})=>{let r=e,s=[];(e.includes("\\${")||e.includes("\\#{"))&&(r=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),r=r.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),r=r.replace(/\\(\$\{[^}]*\})/g,(o,c)=>{let u=`__ESCAPED_${s.length}__`;return s.push(c),u}),r=r.replace(/\\(#\{[^}]*\})/g,(o,c)=>{let u=`__ESCAPED_${s.length}__`;return s.push(c),u}),r=r.replace(/\\DOUBLE_ESC_VAR/g,"\\"),r=r.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let n=[...r.matchAll(vl)],i=[...r.matchAll(bl)],a=[...n.map(o=>({match:o,type:"variable"})),...i.map(o=>({match:o,type:"pathref"}))].sort((o,c)=>o.match.index-c.match.index);if(a.length===0){let o=r;for(let c=0;c<s.length;c++)o=o.replace(`__ESCAPED_${c}__`,s[c]);return{type:g.LITERAL,value:o}}if(a.length===1&&a[0].match[0]===r&&s.length===0){let{match:o,type:c}=a[0];try{return c==="variable"?De(o[1],t):Ps(o[1])}catch(u){if(u.message==="Invalid array index syntax")return{type:g.LITERAL,value:r};throw u}}let l=[],p=0;for(let{match:o,type:c}of a){let[u,d]=o,f=o.index;if(f>p){let h=r.substring(p,f);for(let y=0;y<s.length;y++)h=h.replace(`__ESCAPED_${y}__`,s[y]);h&&l.push(h)}try{let h;c==="variable"?h=De(d.trim(),t):h=Ps(d.trim()),l.push(h)}catch(h){if(h.message==="Invalid array index syntax")l.push(u);else throw h}p=f+u.length}if(p<r.length){let o=r.substring(p);for(let c=0;c<s.length;c++)o=o.replace(`__ESCAPED_${c}__`,s[c]);o&&l.push(o)}return{type:g.INTERPOLATION,parts:l}};var de=(e,t)=>typeof e=="string"?or(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?kl(e,t):$l(e,t):{type:g.LITERAL,value:e},kl=(e,t)=>{let r=[],s=!1;for(let n=0;n<e.length;n++){let i=e[n];if(typeof i=="object"&&i!==null&&!Array.isArray(i)){let l=Object.keys(i);if(l.length===1&&l[0].startsWith("$for ")){let p=Ws(l[0],i[l[0]],t);r.push(p),s=!0;continue}}let a=de(i,t);r.push(a),(a.type===g.FUNCTION||a.type===g.CONDITIONAL||a.type===g.LOOP||a.type===g.PARTIAL||a.type===g.OBJECT&&!a.fast||a.type===g.ARRAY&&!a.fast)&&(s=!0)}return{type:g.ARRAY,items:r,fast:!s}},$l=(e,t)=>{let r=[],s=!1,n=null,i=Object.entries(e),a=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new R("$partial value must be a string");if(e.$partial.trim()==="")throw new R("$partial value cannot be an empty string");let p=["$if","$elif","$else","$for"],o=[];for(let[m]of i)for(let w of p)if(m===w||m.startsWith(w+" ")||m.startsWith(w+"#")){o.push(w);break}if(o.length>0)throw new R(`Cannot use $partial with ${o.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:u,...d}=e,f={},h=!1;for(let[m,w]of Object.entries(d)){let _=m;(m.startsWith("\\$")||m.startsWith("$$"))&&(_=m.slice(1)),f[_]=w,h=!0}let y=null;if(h&&(y=de(f,t),y.type===g.OBJECT)){let m=!1;for(let w of y.properties)if(w.value.type===g.VARIABLE||w.value.type===g.INTERPOLATION||w.value.type===g.FUNCTION||w.value.type===g.CONDITIONAL||w.value.type===g.LOOP||w.value.type===g.OBJECT&&!w.value.fast||w.value.type===g.ARRAY&&!w.value.fast){m=!0;break}m&&(y.fast=!1)}let b={type:g.PARTIAL,name:c,data:y};if(u!==void 0){let m;if(typeof u=="string"){if(u.trim()==="")throw new R("Empty condition expression after '$when'");m=Y(u,t)}else m={type:g.LITERAL,value:u};b.whenCondition=m}return b}for(let[p,o]of i)if(p==="$when"){if(n!==null)throw new R("Multiple '$when' directives on the same object are not allowed");if(o==null)throw new R("Missing condition expression after '$when'");let c=typeof o=="string"?o:JSON.stringify(o);if(c.trim()==="")throw new R("Empty condition expression after '$when'");n=Y(c,t),s=!0}else if(p.startsWith("$when#")||p.startsWith("$when "))throw new R("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;a<i.length;){let[p,o]=i[a];if(p==="$when"){a++;continue}if(p.startsWith("$if ")||p.match(/^\$if#\w+\s/)||p.match(/^\$if\s+\w+.*:$/)){let c=Sl(i,a,t);r.push({key:p,value:c.node}),s=!0,a=c.nextIndex}else if(p.startsWith("$for ")){let c=Ws(p,o,t);r.push({key:p,value:c}),s=!0,a++}else{if(p.startsWith("$elif ")||p.startsWith("$else"))throw new R(`'${p.split(" ")[0]}' without matching '$if'`);if(p==="$if"||p==="$if:")throw new R("Missing condition expression after '$if'");{let c=de(o,t);(c.type===g.FUNCTION||c.type===g.CONDITIONAL||c.type===g.LOOP||c.type===g.PARTIAL||c.type===g.OBJECT&&!c.fast||c.type===g.ARRAY&&!c.fast)&&(s=!0);let u=or(p,t),d={key:p,value:c};(u.type!==g.LITERAL||u.value!==p)&&(d.parsedKey=u),r.push(d),a++}}}let l={type:g.OBJECT,properties:r,fast:!s};return n&&(l.whenCondition=n),l},Sl=(e,t,r={})=>{let s=[],n=[],i=t,[a,l]=e[i],p=null,o;if(a.startsWith("$if#")){let u=a.match(/^\$if#(\w+)\s+(.+)$/);if(u)p=u[1],o=u[2];else throw new R(`Invalid conditional syntax: ${a}`)}else o=a.substring(4),o.endsWith(":")&&(o=o.slice(0,-1).trim());ar(o);let c=Y(o,r);for(s.push(c),n.push(de(l,r)),i++;i<e.length;){let[u,d]=e[i],f=!1,h;if(p?u.startsWith(`$elif#${p} `)?(h=u.substring(`$elif#${p} `.length),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(u===`$else#${p}`||u===`$else#${p}:`)&&(f=!0,h=null):u.startsWith("$elif ")?(h=u.substring(6),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(u==="$else"||u==="$else:")&&(f=!0,h=null),f){if(h===null)s.push(null);else{ar(h);let y=Y(h,r);s.push(y)}if(n.push(de(d,r)),i++,h===null)break}else break}return{node:{type:g.CONDITIONAL,conditions:s,bodies:n,id:p},nextIndex:i}},Y=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let o=e.slice(1,-1),c=0,u=!0;for(let d=0;d<o.length;d++)if(o[d]==="("?c++:o[d]===")"&&c--,c<0){u=!1;break}if(u&&c===0)return Y(o,t)}let r=ge(e,"||");if(r!==-1)return{type:g.BINARY,op:M.OR,left:Y(e.substring(0,r).trim(),t),right:Y(e.substring(r+2).trim(),t)};let s=ge(e,"&&");if(s!==-1)return{type:g.BINARY,op:M.AND,left:Y(e.substring(0,s).trim(),t),right:Y(e.substring(s+2).trim(),t)};let n=[{op:">=",type:M.GTE},{op:"<=",type:M.LTE},{op:"==",type:M.EQ},{op:"!=",type:M.NEQ},{op:">",type:M.GT},{op:"<",type:M.LT},{op:" in ",type:M.IN}];for(let{op:o,type:c}of n){let u=ge(e,o);if(u!==-1)return{type:g.BINARY,op:c,left:Y(e.substring(0,u).trim(),t),right:Y(e.substring(u+o.length).trim(),t)}}let i=-1,a=null,l=[{op:" + ",type:M.ADD},{op:" - ",type:M.SUBTRACT}];for(let{op:o,type:c}of l){let u=0;for(;u<e.length;){let d=ge(e.substring(u),o);if(d===-1)break;let f=u+d;f>i&&(i=f,a={op:o,type:c}),u=f+o.length}}if(i!==-1&&a)return{type:g.BINARY,op:a.type,left:Y(e.substring(0,i).trim(),t),right:Y(e.substring(i+a.op.length).trim(),t)};let p=[" * "," / "," % "];for(let o of p)if(ge(e,o)!==-1)throw new R(`Arithmetic operations are not allowed in conditionals: "${o}"`);return e.startsWith("!")?{type:g.UNARY,op:Ve.NOT,operand:Y(e.substring(1).trim(),t)}:Bs(e,t)},ge=(e,t)=>{let r=0,s=0;for(;s<=e.length-t.length;){if(e[s]==="(")r++;else if(e[s]===")")r--;else if(r===0&&e.substring(s,s+t.length)===t)return s;s++}return-1},Cl=e=>{if(e=e.trim(),e==="true")return{type:g.LITERAL,value:!0};if(e==="false")return{type:g.LITERAL,value:!1};if(e==="null")return{type:g.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:g.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:g.LITERAL,value:""};if(e==="{}")return{type:g.LITERAL,value:{}};if(e==="[]")return{type:g.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:g.LITERAL,value:t}:{type:g.VARIABLE,path:e}},Bs=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return De(r,t);let n=Cl(r);if(n.type===g.LITERAL)return n;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:g.VARIABLE,path:r};try{return De(r,t)}catch(i){if(i.message&&i.message.includes("not supported"))return n;throw i}},Ws=(e,t,r)=>{let s=e.substring(5).trim();Cs(s);let n=s.match(/^(.+?)\s+in\s+(.+)$/);if(!n)throw new R(`Invalid loop syntax - missing 'in' keyword (got: '$for ${s}')`);let i=n[1].trim(),a=n[2].trim(),l,p=null;if(i.includes(",")){let u=i.split(",").map(d=>d.trim());if(u.length!==2)throw new R(`Invalid loop variables: ${i}. Expected format: "item" or "item, index"`);l=u[0],p=u[1]}else l=i;let o=Bs(a,r),c=de(t,r);return{type:g.LOOP,itemVar:l,indexVar:p,iterable:o,body:c}};var Il=(e,t={})=>{let{functions:r={}}=t;return de(e,r)},Xe=Il;var lr={};N(lr,{now:()=>Ol});var Ol=()=>Date.now();var Tl=(e,t,r={})=>{let{functions:s={},partials:n={}}=r,i={...lr,...s},a=Xe(e,{functions:i}),l={};for(let[p,o]of Object.entries(n))l[p]=Xe(o,{functions:i});return Pe(a,t,{functions:i,partials:l})},pr=Tl;var Qe=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...Qe(r));else{if(r&&typeof r=="object"){let s=Object.entries(r);if(s.length>0){let[n,i]=s[0];Array.isArray(i)&&(r={[n]:Qe(i)})}}t.push(r)}return t},[]):e;var Ms=(e,t)=>{if(!t)return e;let r=[],s="",n=!1,i=null;for(let a=0;a<t.length;a++){let l=t[a];if(!n&&l===".")s&&(r.push(s),s="");else if(!n&&l==="[")s&&(r.push(s),s=""),n=!0;else if(n&&l==="]"){if(s){if(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))r.push(s.slice(1,-1));else{let p=Number(s);r.push(isNaN(p)?s:p)}s=""}n=!1,i=null}else n&&(l==='"'||l==="'")&&(i?l===i&&(i=null):i=l),s+=l}return s&&r.push(s),r.reduce((a,l)=>a&&a[l],e)},Fs=({h:e,template:t,viewData:r,refs:s,handlers:n})=>{let i=Pe(t,r,{}),a=Qe(i),l=Ll({h:e,items:a,refs:s,handlers:n,viewData:r});return e("div",{style:{display:"contents"}},l)},Ll=({h:e,items:t,refs:r={},handlers:s={},viewData:n={}})=>{if(!Array.isArray(t))return console.error("Input to createVirtualDom must be an array."),[e("div",{},[])];function i(a,l=""){return a.map((p,o)=>{if(typeof p=="string"||typeof p=="number")return String(p);if(typeof p!="object"||p===null)return console.warn("Skipping invalid item in DOM structure:",p),null;let c=Object.entries(p);if(c.length===0)return null;let[u,d]=c[0];if(!isNaN(Number(u)))return Array.isArray(d)?i(d,`${l}.${u}`):typeof d=="object"&&d!==null&&Object.entries(d).length>0?i([d],`${l}.${u}`):String(d);c.length>1&&console.warn("Item has multiple keys, processing only the first:",u);let f,h,y=u.indexOf(" ");y===-1?(f=u,h=""):(f=u.substring(0,y),h=u.substring(y+1).trim());let b=f.split(/[.#]/)[0],m=b.includes("-"),w={},_={};if(h){let C=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]+))/g,A,B=new Set;for(;(A=C.exec(h))!==null;)if(B.add(A[1]),A[1].startsWith(".")){let ae=A[1].substring(1),Ce=A[4];_[ae]=Ms(n,Ce)}else if(A[1].startsWith("?")){let ae=A[1].substring(1),Ce=A[2]||A[3]||A[4],Be;Ce==="true"?Be=!0:Ce==="false"?Be=!1:Be=Ms(n,Ce),Be&&(w[ae]="")}else w[A[1]]=A[2]||A[3]||A[4];let K=h,F=[],ne,tt=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]+))/g;for(;(ne=tt.exec(h))!==null;)F.push(ne[0]);F.forEach(ae=>{K=K.replace(ae," ")});let rt=/\b(\S+?)(?=\s|$)/g,U;for(;(U=rt.exec(K))!==null;){let ae=U[1];!B.has(ae)&&!ae.startsWith(".")&&!ae.includes("=")&&(w[ae]="")}}let x=f.match(/#([^.#\s]+)/);x&&!Object.prototype.hasOwnProperty.call(w,"id")&&(w.id=x[1]);let E=null;w.id?E=w.id:m&&(E=b);let $=Object.create(null),I=null;if(m)I=b;else{let C=f.match(/\.([^.#]+)/g);C&&C.forEach(B=>{let K=B.substring(1);$[K]=!0});let A=f.match(/#([^.#\s]+)/);A&&(I=A[1])}let S;typeof d=="string"||typeof d=="number"?S=String(d):Array.isArray(d)?S=i(d,`${l}.${u}`):S=[],I&&!m&&(w.id=I);let V=Object.create(null);if(E&&r){let C=[];if(Object.keys(r).forEach(A=>{if(A.includes("*")){let B="^"+A.replace(/[.*+?^${}()|[\\\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"$";try{new RegExp(B).test(E)&&C.push(A)}catch(K){console.warn(`[Parser] Invalid regex pattern created from refKey '${A}': ${B}`,K)}}else E===A&&C.push(A)}),C.length>0){C.sort((B,K)=>{let F=!B.includes("*"),ne=!K.includes("*");return F&&!ne?-1:!F&&ne?1:K.length-B.length});let A=C[0];if(r[A]&&r[A].eventListeners){let B=r[A].eventListeners;Object.entries(B).forEach(([K,F])=>{if(F.handler&&F.action)throw new Error("Each listener can have hanlder or action but not both");if(F.action){V[K]=ne=>{s.handleCallStoreAction({...F.payload,_event:ne,_action:F.action})};return}F.handler&&s[F.handler]?V[K]=ne=>{s[F.handler]({...F.payload,_event:ne})}:F.handler&&console.warn(`[Parser] Handler '${F.handler}' for refKey '${A}' (matching elementId '${E}') is referenced but not found in available handlers.`)})}}}let D={};if(E)D.key=E;else if(f){let C=l?`${l}.${o}`:String(o);if(D.key=`${f}-${C}`,Object.keys(_).length>0){let A=JSON.stringify(_).substring(0,50);D.key+=`-${A}`}}Object.keys(w).length>0&&(D.attrs=w),Object.keys($).length>0&&(D.class=$),Object.keys(V).length>0&&(D.on=V),Object.keys(_).length>0&&(D.props=_),m&&(D.hook={update:(C,A)=>{let B=C.data?.props||{},K=A.data?.props||{},F=C.data?.attrs||{},ne=A.data?.attrs||{},tt=JSON.stringify(B)!==JSON.stringify(K),rt=JSON.stringify(F)!==JSON.stringify(ne);if(tt||rt){let U=A.elm;U&&U.render&&typeof U.render=="function"&&(U.setAttribute("isDirty","true"),requestAnimationFrame(()=>{if(U.render(),U.removeAttribute("isDirty"),U.handlers&&U.handlers.handleOnUpdate){let ae={...U.deps,store:U.store,render:U.render.bind(U),handlers:U.handlers,dispatchEvent:U.dispatchEvent.bind(U),refIds:U.refIds||{},getRefIds:()=>U.refIds||{}};U.handlers.handleOnUpdate(ae,{oldProps:B,newProps:K,oldAttrs:F,newAttrs:ne})}}))}}});try{return e(b,D,S)}catch(C){return console.error("Error creating virtual node:",C,{tagName:b,snabbdomData:D,childrenOrText:S}),e("div",{},["Error creating element"])}}).filter(Boolean)}return i(t)};var Rl=(e,t)=>{if(!t||typeof t!="object")return"";let r="",s=i=>Object.entries(i).map(([a,l])=>` ${a}: ${l};`).join(`
|
|
982
|
-
`),
|
|
983
|
-
${
|
|
984
|
-
`).map(
|
|
921
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let r=t.composedPath();(r[0]===this._dialogElement||r[0].nodeName==="DIALOG"&&r[0]===this._dialogElement)&&this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._dialogElement.addEventListener("contextmenu",t=>{let r=t.composedPath();(r[0]===this._dialogElement||r[0].nodeName==="DIALOG"&&r[0]===this._dialogElement)&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}})))}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._isOpen=!1}static get observedAttributes(){return["open","x","y","placement"]}connectedCallback(){this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._isOpen&&this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,r,s){t==="open"?s!==null&&!this._isOpen?this.isConnected&&this._show():s===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="placement")&&this._isOpen&&this._updatePosition()}_show(){this._isOpen||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._dialogElement.open||setTimeout(()=>{this._dialogElement&&!this._dialogElement.open&&(this.hasAttribute("no-overlay")?this._dialogElement.show():this._dialogElement.showModal())},0),requestAnimationFrame(()=>{this._updatePosition()}))}_hide(){this._isOpen&&(this._isOpen=!1,this._dialogElement.open&&this._dialogElement.close(),this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_updatePosition(){let t=parseFloat(this.getAttribute("x")||"0"),r=parseFloat(this.getAttribute("y")||"0"),s=this.getAttribute("placement")||"bottom-start";this.removeAttribute("positioned"),requestAnimationFrame(()=>{let i=this._popoverContainer.getBoundingClientRect(),{left:n,top:a}=this._calculatePosition(t,r,i.width,i.height,s);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${a}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,r,s,i,n){let l=t,p=r;switch(n){case"top":l=t-s/2,p=r-i-8;break;case"top-start":l=t,p=r-i-8;break;case"top-end":l=t-s,p=r-i-8;break;case"right":l=t+8,p=r-i/2;break;case"right-start":l=t+8,p=r;break;case"right-end":l=t+8,p=r-i;break;case"bottom":l=t-s/2,p=r+8;break;case"bottom-start":l=t,p=r+8;break;case"bottom-end":l=t-s,p=r+8;break;case"left":l=t-s-8,p=r-i/2;break;case"left-start":l=t-s-8,p=r;break;case"left-end":l=t-s-8,p=r-i;break}let o=8;return l=Math.max(o,Math.min(l,window.innerWidth-s-o)),p=Math.max(o,Math.min(p,window.innerHeight-i-o)),{left:l,top:p}}get popover(){return this._popoverContainer}},ts=({render:e,html:t})=>It;var Ot={};R(Ot,{handleClickHeader:()=>Gn});var Gn=(e,t)=>{let{store:r,render:s}=e;r.toggleOpen({}),s()};var rs={componentName:"rtgl-accordion-item",propsSchema:{type:"object",properties:{label:{type:"string"},content:{type:"string"},w:{type:"string"}}},events:[],methods:[]};var Tt={};R(Tt,{createInitialState:()=>Jn,selectViewData:()=>Xn,toggleOpen:()=>Zn});var Jn=()=>Object.freeze({open:!1}),qn=["id","class","style","slot","label","content"],Yn=(e={})=>Object.entries(e).filter(([t])=>!qn.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Xn=({state:e,props:t})=>({label:t.label||"",content:t.content||"",openClass:e.open?"content-wrapper open":"content-wrapper",chevronIcon:e.open?"chevronUp":"chevronDown",containerAttrString:Yn(t)}),Zn=({state:e})=>{e.open=!e.open};var ss={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=p",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}};var Lt={};R(Lt,{handleClickItem:()=>Qn});var Qn=(e,t)=>{let{dispatchEvent:r,props:s}=e,i=t._event,n=Number(i.currentTarget.dataset.index),a=Array.isArray(s.items)?s.items[n]:void 0;if(!a)return;if(a.disabled||a.current){i.preventDefault();return}typeof a.href=="string"&&a.href.length>0||i.preventDefault(),r(new CustomEvent("item-click",{detail:{id:a.id,path:a.path,href:a.href,item:a,index:n,trigger:i.type}}))};var is={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"},target:{type:"string"},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:[]};var Rt={};R(Rt,{createInitialState:()=>ea,selectViewData:()=>aa});var ea=()=>Object.freeze({}),ta=["id","class","style","slot","items","sep","max","separator"],ra=(e={})=>Object.entries(e).filter(([t])=>!ta.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),sa=e=>{if(e==null||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t},ia=(e,t)=>{if(!t||t<3||e.length<=t)return e;let r=t-2;return[e[0],{isEllipsis:!0,label:"..."},...e.slice(-r)]},na=e=>e.map((t,r)=>{let s=typeof t.href=="string"&&t.href.length>0,i=t.path!==void 0&&t.path!==null&&`${t.path}`!="",n=!!t.current,a=!!t.disabled,l=!n&&!a&&(s||i||!!t.click),p=[t.target?`target=${t.target}`:"",t.rel?`rel=${t.rel}`:""].filter(Boolean).join(" ");return{...t,label:t.label||"",index:r,href:s?t.href:void 0,path:i?t.path:void 0,isCurrent:n,isDisabled:a,isInteractive:l,linkExtraAttrs:p,c:n?"fg":"mu-fg"}}),aa=({props:e})=>{let t=ra(e),r=Array.isArray(e.items)?e.items:[],s=sa(e.max),i=e.sep||"breadcrumb-arrow",n=na(r),a=ia(n,s),l=[];return a.forEach((p,o)=>{l.push(p),o<a.length-1&&l.push({isSeparator:!0})}),{containerAttrString:t,items:l,sep:i}};var ns={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=p",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=p"]}}],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}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md p=sm ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Nt={};R(Nt,{handleClickMenuItem:()=>la,handleClosePopover:()=>oa});var oa=(e,t)=>{let{dispatchEvent:r}=e;r(new CustomEvent("close"))},la=(e,t)=>{let{dispatchEvent:r,props:s}=e,i=t._event,n=Number(i.currentTarget.dataset.index??i.currentTarget.id.slice(6)),a=s.items[n],l=a?.type||"item";if(!a||l!=="item"||a.disabled){i.preventDefault();return}a.href||i.preventDefault(),r(new CustomEvent("item-click",{detail:{index:n,item:a,id:a.id,path:a.path,href:a.href,trigger:i.type}}))};var as={componentName:"rtgl-dropdown-menu",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["label","item","separator"]},id:{type:"string"},path:{type:"string"},href:{type:"string"},disabled:{type:"boolean"},target:{type:"string"},rel:{type:"string"},testId:{type:"string"}}}},open:{type:"string"},x:{type:"string"},y:{type:"string"},placement:{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:[]};var Pt={};R(Pt,{createInitialState:()=>pa,selectViewData:()=>ua});var pa=()=>Object.freeze({}),ca=e=>e.map((t,r)=>{let s=t.type||"item",i=s==="separator",n=s==="label",a=s==="item",l=!!t.disabled,p=a&&!l,o=l?"mu-fg":"fg",c="mu",u=l?"":"ac",d=typeof t.href=="string"&&t.href.length>0,h=[t.target?`target=${t.target}`:"",t.rel?`rel=${t.rel}`:""].filter(Boolean).join(" ");return{...t,index:r,type:s,isSeparator:i,isLabel:n,isItem:a,isDisabled:l,isInteractive:p,hasHref:d,linkExtraAttrs:h,c:o,bgc:c,hoverBgc:u}}),ua=({props:e})=>{let t=Array.isArray(e.items)?e.items:[];return{items:ca(t),open:!!e.open,x:e.x||0,y:e.y||0,w:e.w||"300",h:e.h||"300",placement:e.placement||"bottom-start"}};var os={refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},styles:{a:{"text-decoration":"none",color:"inherit"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} placement=${placement}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=${w} h=${h} sv g=xs slot=content bgc=bg br=md",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isLabel",value:{type:6,conditions:[{type:1,path:"item.isLabel"},{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 ph=lg pv=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f ph=lg pv=md br=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view w=f ph=lg pv=md br=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},{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} ph=lg pv=md cur=p br=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," ph=lg pv=md cur=p br=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},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:!0}],fast:!0},{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} ph=lg pv=md cur=p br=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," ph=lg pv=md cur=p br=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},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:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f h-bgc=${item.hoverBgc} ph=lg pv=md cur=p br=md bgc=${item.bgc} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f h-bgc=",{type:1,path:"item.hoverBgc"}," ph=lg pv=md cur=p br=md bgc=",{type:1,path:"item.bgc"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 ph=lg mv=md bgc=bo",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=",{type:1,path:"w"}," h=",{type:1,path:"h"}," sv g=xs slot=content bgc=bg br=md"]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," placement=",{type:1,path:"placement"}]}}],fast:!1}],fast:!1}};var Vt={};R(Vt,{handleActionClick:()=>ga,handleAfterMount:()=>ha,handleBeforeMount:()=>fa,handleImageClick:()=>ba,handleInputChange:()=>va,handleKeyDown:()=>Ea,handleOnUpdate:()=>ma,handleSelectAddOption:()=>xa,handleTooltipMouseEnter:()=>_a,handleTooltipMouseLeave:()=>Aa,handleWaveformClick:()=>wa});var ls=({form:e,defaultValues:t={},refs:r})=>{let{fields:s=[]}=e;s.forEach((i,n)=>{let a=r[`field${n}`];if(a){if(["input-textarea","input-text","input-number","color-picker","slider","slider-input","popover-input"].includes(i.inputType)){let l=t[i.name];l==null?a.removeAttribute("value"):a.setAttribute("value",l)}["input-text","input-textarea"].includes(i.inputType)&&i.placeholder&&a.getAttribute("placeholder")!==i.placeholder&&(i.placeholder===void 0||i.placeholder===null?a.removeAttribute("placeholder"):a.setAttribute("placeholder",i.placeholder))}})},da=e=>{for(let t in e)if(t.startsWith("field")){let r=e[t];if(r&&r.focus){r.focus();return}}},fa=e=>{let{store:t,props:r}=e;t.setFormValues({formValues:r.defaultValues})},ha=e=>{let{props:t,refs:r,render:s}=e,{form:i={},defaultValues:n}=t;ls({form:i,defaultValues:n,refs:r}),s(),t?.autofocus&&setTimeout(()=>{da(r)},50)},ma=(e,t)=>{let{oldProps:r,newProps:s}=t,{store:i,render:n,refs:a}=e,{form:l={},defaultValues:p}=s;if(r?.key!==s?.key){ls({form:l,defaultValues:p,refs:a}),i.setFormValues({formValues:p}),n();return}n()},ya=(e,t,r,s)=>{s(new CustomEvent("form-change",{detail:{name:e,fieldValue:t,formValues:r}}))},ga=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t._event,n=i.currentTarget.dataset.actionId||i.currentTarget.id.slice(6);s(new CustomEvent("action-click",{detail:{actionId:n,formValues:r.selectFormValues()}}))},va=(e,t)=>{let{store:r,dispatchEvent:s,props:i}=e,n=t._event,a=n.currentTarget.dataset.fieldName||n.currentTarget.id.slice(5);if(a&&n.detail&&Object.prototype.hasOwnProperty.call(n.detail,"value")){let l=n.detail.value;r.setFormFieldValue({name:a,value:l}),ya(a,l,r.selectFormValues(),s)}},ba=(e,t)=>{let r=t._event;r.type==="contextmenu"&&r.preventDefault();let{dispatchEvent:s}=e,i=r.currentTarget.dataset.fieldName||r.currentTarget.id.slice(5);s(new CustomEvent("extra-event",{detail:{name:i,x:r.clientX,y:r.clientY,trigger:r.type}}))},wa=(e,t)=>{let r=t._event;r.type==="contextmenu"&&r.preventDefault();let{dispatchEvent:s}=e,i=r.currentTarget.dataset.fieldName||r.currentTarget.id.slice(8);s(new CustomEvent("extra-event",{detail:{name:i,x:r.clientX,y:r.clientY,trigger:r.type}}))},xa=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t._event,n=i.currentTarget.dataset.fieldName||i.currentTarget.id.slice(5);s(new CustomEvent("action-click",{detail:{actionId:"select-options-add",name:n,formValues:r.selectFormValues()}}))},_a=(e,t)=>{let{store:r,render:s,props:i}=e,n=t._event,a=n.currentTarget.dataset.fieldName||n.currentTarget.id.slice(11),p=i.form.fields.find(o=>o.name===a);if(p&&p.tooltip){let o=n.currentTarget.getBoundingClientRect();r.showTooltip({x:o.left+o.width/2,y:o.top-8,content:p.tooltip.content}),s()}},Aa=e=>{let{store:t,render:r}=e;t.hideTooltip({}),r()},Ea=(e,t)=>{let{store:r,dispatchEvent:s,props:i}=e,n=t._event;if(n.key==="Enter"&&!n.shiftKey){let a=n.target;if(a.tagName==="TEXTAREA"||a.tagName==="RTGL-TEXTAREA")return;n.preventDefault();let o=((i.form||{}).actions||{}).buttons||[];if(o.length>0){let c=o[0].id,u=r.selectFormValues();s(new CustomEvent("action-click",{detail:{actionId:c,formValues:u}}))}}};var ps={componentName:"rtgl-form",propsSchema:{type:"object",properties:{key:{type:"string"},autofocus:{type:"boolean"},defaultValues:{type:"object"},context:{type:"object"},form:{type:"object",properties:{title:{type:"string"},description:{type:"string"},fields:{type:"array",items:{anyOf:[{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"input-text"},placeholder:{type:"string"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"select"},placeholder:{type:"string"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},options:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"any"}},required:["label","value"]}},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType","options"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"color-picker"},value:{type:"string"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"slider"},min:{type:"number"},max:{type:"number"},step:{type:"number"},value:{type:"number"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"slider-input"},min:{type:"number"},max:{type:"number"},step:{type:"number"},value:{type:"number"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"image"},width:{type:"number"},height:{type:"number"},placeholder:{type:"string"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"waveform"},width:{type:"number"},height:{type:"number"},placeholder:{type:"string"},defaultValue:{type:"object"},waveformData:{type:"object"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"popover-input"},placeholder:{type:"string"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1}]}},actions:{type:"object",properties:{buttons:{type:"array",items:{type:"object",properties:{id:{type:"string"},content:{type:"string"},testId:{type:"string"}},required:["id","content"]}}}}}}}},events:{"form-change":{},"extra-event":{},"action-click":{}},methods:[]};var Ft={};R(Ft,{createInitialState:()=>ro,getFormFieldValue:()=>po,hideTooltip:()=>ho,selectForm:()=>qe,selectFormValues:()=>lo,selectState:()=>oo,selectViewData:()=>ao,setFormFieldValue:()=>uo,setFormValues:()=>co,showTooltip:()=>fo});var b={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},V={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},Ve={NOT:0};var E=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},Z=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var Dt=e=>{if(!e||e.trim()==="")throw new E("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new E(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${r}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let r of t)if(e.trim().endsWith(r))throw new E(`Incomplete comparison expression - missing right operand (got: '${e}')`)},cs=e=>{if(e.trim().endsWith(" in"))throw new E(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new E(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new E(`Missing iterable expression after 'in' (got: '$for ${e}')`);let s=t.includes(",")?t.split(",").map(i=>i.trim()):[t.trim()];for(let i of s){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}')`)}};var us=(e,t,r=!1)=>{if(t===null)return new Z(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new Z(`Cannot iterate over undefined value at '$for ${e}'`);let s=typeof t;return r?new Z(`Cannot iterate over non-array value in loop '${e}' - got ${s} instead`):new Z(`Cannot iterate over non-array value (got: ${s}) at '$for ${e}'`)},ds=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new Z(`Unknown function '${e}' (${r})`)};var $a=(e,t,r={})=>{let s={},i={};r&&typeof r=="object"&&(r.functions!==void 0||r.partials!==void 0?(s=r.functions||{},i=r.partials||{}):typeof r=="object"&&(s=r));let a=C(e,{functions:s,partials:i},t,{});return a===void 0?{}:a},C=(e,t,r,s)=>{let i=t.functions||t;if(e.var&&!e.type)return M(e.var,r,s);if(e.type===b.LITERAL)return e.value;if(e.type===b.VARIABLE)return M(e.path,r,s);if(e.type===b.INTERPOLATION)return Sa(e.parts,t,r,s);switch(e.type){case b.FUNCTION:return hs(e,t,r,s);case b.BINARY:return ms(e,t,r,s);case b.UNARY:return ys(e,t,r,s);case b.CONDITIONAL:return Ia(e,t,r,s);case b.LOOP:return Na(e,t,r,s);case b.OBJECT:return Va(e,t,r,s);case b.ARRAY:return Da(e,t,r,s);case b.PARTIAL:return Ba(e,t,r,s);case b.PATH_REFERENCE:return ja(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},fs=new Map,ka=e=>{let t=[],r="",s=!1;for(let i=0;i<e.length;i++){let n=e[i];if(n==="[")r&&(t.push({type:"property",value:r}),r=""),s=!0;else if(n==="]"){if(s&&r){let a=r.trim();if(/^\d+$/.test(a))t.push({type:"index",value:parseInt(a,10)});else if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")){let l=a.slice(1,-1);t.push({type:"property",value:l})}else t.push({type:"property",value:a});r=""}s=!1}else r+=n}return r&&t.push({type:"property",value:r}),t},M=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let s=fs.get(e);if(!s){let n=[],a="",l=0;for(let p=0;p<e.length;p++){let o=e[p];o==="["?(l++,a+=o):o==="]"?(l--,a+=o):o==="."&&l===0?a&&(n.push(a),a=""):a+=o}a&&n.push(a),s=[];for(let p of n){let o=ka(p.trim());s.push(...o)}fs.set(e,s)}let i=t;for(let n=0;n<s.length;n++){let a=s[n];if(a.type==="property"&&a.value in r){i=r[a.value];continue}if(i==null)return;(a.type==="property"||a.type==="index")&&(i=i[a.value])}return i},Sa=(e,t,r,s)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let a=C(n,t,r,s);i.push(a!=null?String(a):"")}return i.join("")},hs=(e,t,r,s)=>{let i=t.functions||t,n=i[e.name];if(!n)throw ds(e.name,i);let a=e.args.map(l=>C(l,t,r,s));return n(...a)},$e=(e,t,r,s)=>{if(e.var&&!e.type)return M(e.var,r,s);switch(e.type){case b.VARIABLE:return M(e.path,r,s);case b.LITERAL:return e.value;case b.BINARY:return ms(e,t,r,s);case b.UNARY:return ys(e,t,r,s);case b.FUNCTION:return hs(e,t,r,s);default:return C(e,t,r,s)}},ms=(e,t,r,s)=>{if(e.op===V.AND||e.op===V.OR){let a=$e(e.left,t,r,s),l=$e(e.right,t,r,s);switch(e.op){case V.AND:return a&&l;case V.OR:return a||l}}let i=C(e.left,t,r,s),n=C(e.right,t,r,s);switch(e.op){case V.EQ:return i==n;case V.NEQ:return i!=n;case V.GT:return i>n;case V.LT:return i<n;case V.GTE:return i>=n;case V.LTE:return i<=n;case V.IN:return Array.isArray(n)?n.includes(i):!1;case V.ADD:if(typeof i!="number"||typeof n!="number")throw new Z(`Arithmetic operations require numbers. Got ${typeof i} + ${typeof n}`);return i+n;case V.SUBTRACT:if(typeof i!="number"||typeof n!="number")throw new Z(`Arithmetic operations require numbers. Got ${typeof i} - ${typeof n}`);return i-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},ys=(e,t,r,s)=>{let i=e.op===Ve.NOT?$e(e.operand,t,r,s):C(e.operand,t,r,s);switch(e.op){case Ve.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Ca=(e,t,r,s)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===b.VARIABLE)if(M(i.path,r,s)){let a=e.bodies[0];if(a.type===b.OBJECT&&a.properties.length<=5){let l={};for(let p of a.properties){let o=p.parsedKey?C(p.parsedKey,t,r,s):p.key,c=p.value;if(c.type===b.LITERAL)l[o]=c.value;else if(c.type===b.VARIABLE)l[o]=M(c.path,r,s);else if(c.type===b.INTERPOLATION){let u=[];for(let d of c.parts)if(typeof d=="string")u.push(d);else if(d.type===b.VARIABLE){let h=M(d.path,r,s);u.push(h!=null?String(h):"")}else{let h=C(d,t,r,s);u.push(h!=null?String(h):"")}l[o]=u.join("")}else l[o]=C(c,t,r,s)}return l}}else{let a=e.bodies[1];if(a.type===b.OBJECT&&a.properties.length<=5){let l={};for(let p of a.properties){let o=p.parsedKey?C(p.parsedKey,t,r,s):p.key,c=p.value;if(c.type===b.LITERAL)l[o]=c.value;else if(c.type===b.VARIABLE)l[o]=M(c.path,r,s);else if(c.type===b.INTERPOLATION){let u=[];for(let d of c.parts)if(typeof d=="string")u.push(d);else if(d.type===b.VARIABLE){let h=M(d.path,r,s);u.push(h!=null?String(h):"")}else{let h=C(d,t,r,s);u.push(h!=null?String(h):"")}l[o]=u.join("")}else l[o]=C(c,t,r,s)}return l}}}return null},Ia=(e,t,r,s)=>{let i=Ca(e,t,r,s);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let a=e.conditions[n];if(a===null||$e(a,t,r,s))return C(e.bodies[n],t,r,s)}return gs},Oa=(e,t)=>{let r=e.body,s=e.itemVar;if(r.type===b.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===b.VARIABLE){let i=r.conditions[0].path,n=r.bodies[0];if(i.startsWith(s+".")){let a=i.substring(s.length+1);if(n.type===b.OBJECT&&n.properties.length<=5){for(let p of n.properties)if(p.parsedKey)return null;let l=[];for(let p=0;p<t.length;p++){let o=t[p];if(o[a]){let c={};for(let u of n.properties){let d=u.key,h=u.value;if(h.type===b.LITERAL)c[d]=h.value;else if(h.type===b.VARIABLE){let f=h.path;if(f===s)c[d]=o;else if(f.startsWith(s+".")){let m=f.substring(s.length+1);c[d]=o[m]}else return null}else if(h.type===b.INTERPOLATION){let f=[],m=!0;for(let g of h.parts)if(typeof g=="string")f.push(g);else if(g.type===b.VARIABLE){let y=g.path;if(y===s)f.push(o!=null?String(o):"");else if(y.startsWith(s+".")){let w=y.substring(s.length+1),x=o[w];f.push(x!=null?String(x):"")}else{m=!1;break}}else{m=!1;break}if(!m)return null;c[d]=f.join("")}else return null}l.push(c)}}return l}}}return null},Ta=(e,t)=>{let r=e.body,s=e.itemVar,i=Oa(e,t);if(i!==null)return i;if(r.type===b.OBJECT&&r.properties.length<=5&&!r.whenCondition){for(let l of r.properties)if(l.parsedKey)return null;let n=[],a=!0;for(let l of r.properties){let p=l.key,o=l.value;if(o.type===b.LITERAL)n.push({key:p,type:"literal",value:o.value});else if(o.type===b.VARIABLE){let c=o.path;if(c===s)n.push({key:p,type:"item"});else if(c.startsWith(s+".")){let u=c.substring(s.length+1);if(!u.includes(".")&&!u.includes("["))n.push({key:p,type:"prop",prop:u});else{a=!1;break}}else{a=!1;break}}else if(o.type===b.INTERPOLATION&&o.parts.length===1){let c=o.parts[0];if(c.type===b.VARIABLE){let u=c.path;if(u===s)n.push({key:p,type:"item_string"});else if(u.startsWith(s+".")){let d=u.substring(s.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:p,type:"prop_string",prop:d});else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}if(a){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 o=t[p];l[p]={id:o.id,title:o.title!=null?String(o.title):"",completed:o.completed}}else for(let p=0;p<t.length;p++){let o=t[p],c={};for(let u of n)if(u.type==="literal")c[u.key]=u.value;else if(u.type==="item")c[u.key]=o;else if(u.type==="prop")c[u.key]=o[u.prop];else if(u.type==="item_string")c[u.key]=o!=null?String(o):"";else if(u.type==="prop_string"){let d=o[u.prop];c[u.key]=d!=null?String(d):""}l[p]=c}return l}}return null},La=(e,t,r,s,i)=>{let n=[],a=e.body;if(a.type===b.OBJECT&&a.fast!==!1){let l=e.itemVar,p=e.indexVar;for(let o=0;o<i.length;o++){let c=i[o],u={},d={...s,[l]:c,...p&&{[p]:o}};d.__paths__||(d.__paths__=s.__paths__||{});let h=e.iterable.path||"";if(s&&s.__paths__&&h){let f=h.split("."),m=f[0];m in s.__paths__&&(h=s.__paths__[m],f.length>1&&(h+="."+f.slice(1).join(".")))}d.__paths__={...d.__paths__,[l]:`${h}[${o}]`,...p&&{[p]:o}};for(let f of a.properties){let m=f.parsedKey?C(f.parsedKey,t,r,d):f.key,g=f.value;if(g.type===b.LITERAL)u[m]=g.value;else if(g.type===b.VARIABLE){let y=g.path;if(y===l)u[m]=c;else if(y===p)u[m]=o;else if(y.startsWith(l+".")){let w=y.substring(l.length+1);!w.includes(".")&&!w.includes("[")?u[m]=c[w]:u[m]=M(y,r,{...s,[l]:c,...p&&{[p]:o}})}else u[m]=M(y,r,{...s,[l]:c,...p&&{[p]:o}})}else if(g.type===b.INTERPOLATION){let y=[];for(let w of g.parts)if(typeof w=="string")y.push(w);else if(w.type===b.VARIABLE){let x=w.path,_;if(x===l)_=c;else if(x===p)_=o;else if(x.startsWith(l+".")){let A=x.substring(l.length+1);!A.includes(".")&&!A.includes("[")?_=c[A]:_=M(x,r,{...s,[l]:c,...p&&{[p]:o}})}else _=M(x,r,{...s,[l]:c,...p&&{[p]:o}});y.push(_!=null?String(_):"")}else{let x={...s,[l]:c,...p&&{[p]:o}},_=C(w,t,r,x);y.push(_!=null?String(_):"")}u[m]=y.join("")}else{let y={...s,[l]:c,...p&&{[p]:o}};u[m]=C(g,t,r,y)}}n.push(u)}return n}return null},Ra=(e,t,r)=>{let s=e.body;if(s.type===b.OBJECT&&s.properties.length===1&&s.properties[0].key==="$if item.visible"){let n=s.properties[0].value;if(n.type===b.CONDITIONAL&&n.conditions.length===1&&n.conditions[0].type===b.VARIABLE&&n.conditions[0].path==="item.visible"){let a=n.bodies[0];if(a.type===b.OBJECT&&a.properties.length===2){let l=a.properties[0],p=a.properties[1];if(l.key==="id"&&l.value.type===b.VARIABLE&&l.value.path==="item.id"&&p.key==="$if item.highlighted"&&p.value.type===b.CONDITIONAL){let o=[];for(let c=0;c<t.length;c++){let u=t[c];if(u.visible){let d={id:u.id};u.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${u.name}`):(d.highlight=!1,d.message=u.name),o.push(d)}}return o}}}}return null},Na=(e,t,r,s)=>{let i=C(e.iterable,t,r,s);if(!Array.isArray(i)){let o,c=!1;if(e.iterable.type===b.FUNCTION){c=!0;let d=e.iterable.args.map(h=>h.type===b.LITERAL?typeof h.value=="string"?`'${h.value}'`:String(h.value):h.type===b.VARIABLE?h.path:h.type===b.FUNCTION?`${h.name}(...)`:"?").join(", ");o=`${e.iterable.name}(${d})`}else o=e.iterable.path||"undefined";let u=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${o}`;throw us(u,i,c)}if(!e.indexVar){let o=Ra(e,i,e.itemVar);if(o!==null)return o}if(!e.indexVar){let o=Ta(e,i);if(o!==null)return o}let n=La(e,t,r,s,i);if(n!==null)return n;let a=[],l=e.iterable.path||"";if(s&&s.__paths__&&l){let o=l.split("."),c=o[0];c in s.__paths__&&(l=s.__paths__[c],o.length>1&&(l+="."+o.slice(1).join(".")))}let p=!1;e.body.type===b.ARRAY&&(e.body.items.length<=1?p=!1:p=e.body._shouldPreserveArray??=e.body.items.some(o=>o.type===b.OBJECT&&o.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let o=0;o<i.length;o++){let c=e.indexVar?{...s,[e.itemVar]:i[o],[e.indexVar]:o}:{...s,[e.itemVar]:i[o]};c.__paths__||(c.__paths__=s.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${l}[${o}]`},e.indexVar&&(c.__paths__[e.indexVar]=o);let u=C(e.body,t,r,c);if(Array.isArray(u)&&u.length===1&&!p){let d=u[0];a.push(d===void 0?{}:d)}else a.push(u===void 0?{}:u)}return a},Pa=(e,t,r,s)=>{if(e.whenCondition)return null;if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?C(i.parsedKey,t,r,s):i.key,a=i.value;if(a.type===b.OBJECT&&a.properties.length<=10&&!a.whenCondition){let l={},p={},o=!0;for(let c of a.properties){let u=c.parsedKey?C(c.parsedKey,t,r,s):c.key,d=c.value;if(d.type===b.LITERAL)p[u]=d.value;else if(d.type===b.VARIABLE)p[u]=M(d.path,r,s);else if(d.type===b.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===b.VARIABLE){let m=M(f.path,r,s);h.push(m!=null?String(m):"")}else{o=!1;break}if(!o)break;p[u]=h.join("")}else if(d.type===b.OBJECT&&d.properties.length<=5){let h={};for(let f of d.properties){let m=f.key,g=f.value;if(g.type===b.LITERAL)h[m]=g.value;else if(g.type===b.VARIABLE)h[m]=M(g.path,r,s);else if(g.type===b.INTERPOLATION){let y=[];for(let w of g.parts)if(typeof w=="string")y.push(w);else if(w.type===b.VARIABLE){let x=M(w.path,r,s);y.push(x!=null?String(x):"")}else{o=!1;break}if(!o)break;h[m]=y.join("")}else{o=!1;break}}if(!o)break;p[u]=h}else{o=!1;break}}if(o)return l[n]=p,l}}return null},Va=(e,t,r,s)=>{let i=t.functions||t;if(e.whenCondition&&!$e(e.whenCondition,i,r,s))return;let n=Pa(e,t,r,s);if(n!==null)return n;if(e.fast){let o={};for(let c of e.properties){let u=c.parsedKey?C(c.parsedKey,t,r,s):c.key,d=c.value;if(d.type===b.LITERAL)o[u]=d.value;else if(d.type===b.VARIABLE)o[u]=M(d.path,r,s);else if(d.type===b.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===b.VARIABLE){let m=M(f.path,r,s);h.push(m!=null?String(m):"")}else{let m=C(f,t,r,s);h.push(m!=null?String(m):"")}o[u]=h.join("")}else o[u]=C(d,t,r,s)}return o}let a={},l=null,p=!1;for(let o of e.properties)if(!o.key.startsWith("$if ")&&!o.key.match(/^\$if\s+\w+.*:?$/)&&!o.key.startsWith("$elif")&&!o.key.startsWith("$else")&&!o.key.startsWith("$for ")){p=!0;break}for(let o of e.properties)if(o.key.startsWith("$if ")||o.key.match(/^\$if\s+\w+.*:?$/)){let c=C(o.value,t,r,s);if(!p&&c!==null&&c!==void 0)return Array.isArray(c)&&c.length===1?c[0]:c;typeof c=="object"&&c!==null&&!Array.isArray(c)&&Object.assign(a,c)}else if(o.key.startsWith("$for ")){if(e.properties.length===1)return C(o.value,t,r,s)}else{let c=o.value;if(c&&c.type===b.OBJECT&&c.properties){let u=c.properties.find(d=>d.key.startsWith("$for "));if(u){let d=C(u.value,t,r,s);d!==void 0&&(a[o.key]=d)}else{let d=C(o.value,t,r,s);d!==void 0&&(a[o.key]=d)}}else{let u=o.parsedKey?C(o.parsedKey,t,r,s):o.key,d=C(o.value,t,r,s);d!==void 0&&(a[u]=d)}}return a},gs={},Da=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===b.LOOP){let a=C(n,t,r,s);Array.isArray(a)&&n.flatten!==!1?i.push(...a):i.push(a)}else{let a=C(n,t,r,s);a!==gs&&a!==void 0&&i.push(a)}return i},Ba=(e,t,r,s)=>{let{name:i,data:n,whenCondition:a}=e,l=t.partials||{},p=t.functions||t;if(a&&!$e(a,p,r,s))return;if(!l[i])throw new Z(`Partial '${i}' is not defined`);let o=s._partialStack||[];if(o.includes(i))throw new Z(`Circular partial reference detected: ${i}`);let c=l[i],u=r,d={...s,_partialStack:[...o,i]};if(s){u={...r};for(let h of Object.keys(s))h.startsWith("_")||(u[h]=s[h])}if(n){let h=C(n,t,r,s);u={...u,...h}}return C(c,t,u,d)},ja=(e,t,r,s)=>{let{path:i}=e,n=i.split("."),a=n[0],l=n.slice(1);if(!s||!(a in s))throw new Z(`Path reference '#{${i}}' refers to '${a}' which is not a loop variable in the current scope`);if(s.__paths__||(s.__paths__={}),!(a in s.__paths__))throw new Z(`Path reference '#{${i}}' cannot be resolved - path tracking may not be initialized properly`);let p=s.__paths__[a];if(typeof p=="number"){if(l.length>0)throw new Z(`Path reference '#{${i}}' - cannot access properties on index variable '${a}'`);return String(p)}return l.length>0&&(p+="."+l.join(".")),p},Bt=$a;var Wa=/\$\{([^}]*)\}/g,Ma=/#\{([^}]*)\}/g,bs=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,s,i]=r,n=Fa(i,t);return{isFunction:!0,type:b.FUNCTION,name:s,args:n}},Fa=(e,t={})=>e.trim()?za(e).map(s=>Ua(s.trim(),t)):[],za=e=>{let t=[],r="",s=0,i=!1,n="";for(let a=0;a<e.length;a++){let l=e[a],p=a>0?e[a-1]:"";!i&&(l==='"'||l==="'")?(i=!0,n=l,r+=l):i&&l===n&&p!=="\\"?(i=!1,n="",r+=l):!i&&l==="("?(s++,r+=l):!i&&l===")"?(s--,r+=l):!i&&l===","&&s===0?(t.push(r),r=""):r+=l}return r&&t.push(r),t},Ua=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:b.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:b.LITERAL,value:parseFloat(e)};if(e==="true")return{type:b.LITERAL,value:!0};if(e==="false")return{type:b.LITERAL,value:!1};if(e==="null")return{type:b.LITERAL,value:null};let r=bs(e,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};let s=e.trim(),i=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1,a=null;for(let{op:l,type:p}of i){let o=0;for(;o<s.length;){let c=ge(s.substring(o),l);if(c===-1)break;let u=o+c;u>n&&(n=u,a={op:l,type:p}),o=u+l.length}}if(n!==-1)try{return q(s,t)}catch{return{type:b.VARIABLE,path:s}}return{type:b.VARIABLE,path:s}},ws=/^\w+\(.*\)$/,Ka=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,Ha=e=>{if(!(!e||e.trim()===""||ws.test(e))&&Ka.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}"`)},vs=e=>{let t=e.trim();if(ws.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:b.PATH_REFERENCE,path:t}},De=(e,t={})=>{let r=e.trim();Ha(r);let s=bs(r,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};if(r.includes("[")&&!/[\s+\-*/%|&?:]/.test(r)){let i=0;for(let n of r)n==="["?i++:n==="]"&&i--;if(i!==0)throw new Error("Invalid array index syntax")}return{type:b.VARIABLE,path:r}},jt=(e,t={})=>{let r=e,s=[];(e.includes("\\${")||e.includes("\\#{"))&&(r=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),r=r.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),r=r.replace(/\\(\$\{[^}]*\})/g,(o,c)=>{let u=`__ESCAPED_${s.length}__`;return s.push(c),u}),r=r.replace(/\\(#\{[^}]*\})/g,(o,c)=>{let u=`__ESCAPED_${s.length}__`;return s.push(c),u}),r=r.replace(/\\DOUBLE_ESC_VAR/g,"\\"),r=r.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let i=[...r.matchAll(Wa)],n=[...r.matchAll(Ma)],a=[...i.map(o=>({match:o,type:"variable"})),...n.map(o=>({match:o,type:"pathref"}))].sort((o,c)=>o.match.index-c.match.index);if(a.length===0){let o=r;for(let c=0;c<s.length;c++)o=o.replace(`__ESCAPED_${c}__`,s[c]);return{type:b.LITERAL,value:o}}if(a.length===1&&a[0].match[0]===r&&s.length===0){let{match:o,type:c}=a[0];try{return c==="variable"?De(o[1],t):vs(o[1])}catch(u){if(u.message==="Invalid array index syntax")return{type:b.LITERAL,value:r};throw u}}let l=[],p=0;for(let{match:o,type:c}of a){let[u,d]=o,h=o.index;if(h>p){let f=r.substring(p,h);for(let m=0;m<s.length;m++)f=f.replace(`__ESCAPED_${m}__`,s[m]);f&&l.push(f)}try{let f;c==="variable"?f=De(d.trim(),t):f=vs(d.trim()),l.push(f)}catch(f){if(f.message==="Invalid array index syntax")l.push(u);else throw f}p=h+u.length}if(p<r.length){let o=r.substring(p);for(let c=0;c<s.length;c++)o=o.replace(`__ESCAPED_${c}__`,s[c]);o&&l.push(o)}return{type:b.INTERPOLATION,parts:l}};var he=(e,t)=>typeof e=="string"?jt(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Ja(e,t):qa(e,t):{type:b.LITERAL,value:e},Ga=e=>{let{$each:t,...r}=e;if(typeof t!="string")throw new E("$each value must be a non-empty string");let s=t.trim();if(s==="")throw new E("$each value must be a non-empty string");if(Object.keys(r).length===0)throw new E("Empty $each body not allowed");if(r.$partial!==void 0)throw new E("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${s}`]:r}},Ja=(e,t)=>{let r=[],s=!1;for(let i=0;i<e.length;i++){let n=e[i];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let p=Ga(n),o=Object.keys(p);if(o.length===1&&/^\$for(?::\w+)?\s/.test(o[0])){let c=xs(o[0],p[o[0]],t,!0);r.push(c),s=!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=xs(l[0],n[l[0]],t);r.push(p),s=!0;continue}}let a=he(n,t);r.push(a),(a.type===b.FUNCTION||a.type===b.CONDITIONAL||a.type===b.LOOP||a.type===b.PARTIAL||a.type===b.OBJECT&&!a.fast||a.type===b.ARRAY&&!a.fast)&&(s=!0)}return{type:b.ARRAY,items:r,fast:!s}},qa=(e,t)=>{let r=[],s=!1,i=null,n=Object.entries(e),a=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new 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"],o=[];for(let[y]of n)for(let w of p)if(y===w||y.startsWith(w+" ")||y.startsWith(w+"#")){o.push(w);break}if(o.length>0)throw new E(`Cannot use $partial with ${o.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:u,...d}=e,h={},f=!1;for(let[y,w]of Object.entries(d)){let x=y;(y.startsWith("\\$")||y.startsWith("$$"))&&(x=y.slice(1)),h[x]=w,f=!0}let m=null;if(f&&(m=he(h,t),m.type===b.OBJECT)){let y=!1;for(let w of m.properties)if(w.value.type===b.VARIABLE||w.value.type===b.INTERPOLATION||w.value.type===b.FUNCTION||w.value.type===b.CONDITIONAL||w.value.type===b.OBJECT&&!w.value.fast||w.value.type===b.ARRAY&&!w.value.fast){y=!0;break}y&&(m.fast=!1)}let g={type:b.PARTIAL,name:c,data:m};if(u!==void 0){let y;if(typeof u=="string"){if(u.trim()==="")throw new E("Empty condition expression after '$when'");y=q(u,t)}else y={type:b.LITERAL,value:u};g.whenCondition=y}return g}for(let[p,o]of n)if(p==="$when"){if(i!==null)throw new E("Multiple '$when' directives on the same object are not allowed");if(o==null)throw new E("Missing condition expression after '$when'");let c=typeof o=="string"?o:JSON.stringify(o);if(c.trim()==="")throw new E("Empty condition expression after '$when'");i=q(c,t),s=!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(;a<n.length;){let[p,o]=n[a];if(p==="$when"){a++;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=Ya(n,a,t);r.push({key:p,value:c.node}),s=!0,a=c.nextIndex}else if(/^\$for(?::\w+)?\s/.test(p)){let c=p.match(/^\$for(?::(\w+))?\s/)?.[1]||"",u=c?`:${c}`:"";throw new E(`$for loops must be inside arrays - use '- $for${u} item in items:' instead of '$for${u} 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=he(o,t);(c.type===b.FUNCTION||c.type===b.CONDITIONAL||c.type===b.PARTIAL||c.type===b.OBJECT&&!c.fast||c.type===b.ARRAY&&!c.fast)&&(s=!0);let u=jt(p,t),d={key:p,value:c};(u.type!==b.LITERAL||u.value!==p)&&(d.parsedKey=u),r.push(d),a++}}}let l={type:b.OBJECT,properties:r,fast:!s};return i&&(l.whenCondition=i),l},Ya=(e,t,r={})=>{let s=[],i=[],n=t,[a,l]=e[n],p=null,o;if(a.startsWith("$if#")){let u=a.match(/^\$if#(\w+)\s+(.+)$/);if(u)p=u[1],o=u[2];else throw new E(`Invalid conditional syntax: ${a}`)}else o=a.substring(4),o.endsWith(":")&&(o=o.slice(0,-1).trim());Dt(o);let c=q(o,r);for(s.push(c),i.push(he(l,r)),n++;n<e.length;){let[u,d]=e[n],h=!1,f;if(p?u.startsWith(`$elif#${p} `)?(f=u.substring(`$elif#${p} `.length),f.endsWith(":")&&(f=f.slice(0,-1).trim()),h=!0):(u===`$else#${p}`||u===`$else#${p}:`)&&(h=!0,f=null):u.startsWith("$elif ")?(f=u.substring(6),f.endsWith(":")&&(f=f.slice(0,-1).trim()),h=!0):(u==="$else"||u==="$else:")&&(h=!0,f=null),h){if(f===null)s.push(null);else{Dt(f);let m=q(f,r);s.push(m)}if(i.push(he(d,r)),n++,f===null)break}else break}return{node:{type:b.CONDITIONAL,conditions:s,bodies:i,id:p},nextIndex:n}},q=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let o=e.slice(1,-1),c=0,u=!0;for(let d=0;d<o.length;d++)if(o[d]==="("?c++:o[d]===")"&&c--,c<0){u=!1;break}if(u&&c===0)return q(o,t)}let r=ge(e,"||");if(r!==-1)return{type:b.BINARY,op:V.OR,left:q(e.substring(0,r).trim(),t),right:q(e.substring(r+2).trim(),t)};let s=ge(e,"&&");if(s!==-1)return{type:b.BINARY,op:V.AND,left:q(e.substring(0,s).trim(),t),right:q(e.substring(s+2).trim(),t)};let i=[{op:">=",type:V.GTE},{op:"<=",type:V.LTE},{op:"==",type:V.EQ},{op:"!=",type:V.NEQ},{op:">",type:V.GT},{op:"<",type:V.LT},{op:" in ",type:V.IN}];for(let{op:o,type:c}of i){let u=ge(e,o);if(u!==-1)return{type:b.BINARY,op:c,left:q(e.substring(0,u).trim(),t),right:q(e.substring(u+o.length).trim(),t)}}let n=-1,a=null,l=[{op:" + ",type:V.ADD},{op:" - ",type:V.SUBTRACT}];for(let{op:o,type:c}of l){let u=0;for(;u<e.length;){let d=ge(e.substring(u),o);if(d===-1)break;let h=u+d;h>n&&(n=h,a={op:o,type:c}),u=h+o.length}}if(n!==-1&&a)return{type:b.BINARY,op:a.type,left:q(e.substring(0,n).trim(),t),right:q(e.substring(n+a.op.length).trim(),t)};let p=[" * "," / "," % "];for(let o of p)if(ge(e,o)!==-1)throw new E(`Arithmetic operations are not allowed in conditionals: "${o}"`);return e.startsWith("!")?{type:b.UNARY,op:Ve.NOT,operand:q(e.substring(1).trim(),t)}:_s(e,t)},ge=(e,t)=>{let r=0,s=0;for(;s<=e.length-t.length;){if(e[s]==="(")r++;else if(e[s]===")")r--;else if(r===0&&e.substring(s,s+t.length)===t)return s;s++}return-1},Xa=e=>{if(e=e.trim(),e==="true")return{type:b.LITERAL,value:!0};if(e==="false")return{type:b.LITERAL,value:!1};if(e==="null")return{type:b.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:b.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:b.LITERAL,value:""};if(e==="{}")return{type:b.LITERAL,value:{}};if(e==="[]")return{type:b.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:b.LITERAL,value:t}:{type:b.VARIABLE,path:e}},_s=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return De(r,t);let i=Xa(r);if(i.type===b.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:b.VARIABLE,path:r};try{return De(r,t)}catch(n){if(n.message&&n.message.includes("not supported"))return i;throw n}},Za=(e,t=!1)=>{let r=t?"$each":"$for";try{cs(e)}catch(s){if(s instanceof E&&t){let i=s.message.replace(/\$for/g,"$each");throw new E(i.replace("Parse Error: ",""))}throw s}},xs=(e,t,r,s=!1)=>{let i=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(i);if(!n){let g=s?"$each":"$for";throw new E(`Invalid loop syntax (got: '${e.replace("$for",g)}')`)}let a=n[1],l=n[2].trim();Za(l,s);let p=l.match(/^(.+?)\s+in\s+(.+)$/);if(!p){let g=s?"$each":"$for";throw new E(`Invalid loop syntax - missing 'in' keyword (got: '${g} ${l}')`)}let o=p[1].trim(),c=p[2].trim(),u,d=null;if(o.includes(",")){let g=o.split(",").map(y=>y.trim());if(g.length!==2)throw new E(`Invalid loop variables: ${o}. Expected format: "item" or "item, index"`);u=g[0],d=g[1]}else u=o;let h=["this","undefined","null","true","false"];if(h.includes(u))throw new E(`Reserved variable name: ${u}`);if(d&&h.includes(d))throw new E(`Reserved variable name: ${d}`);let f=_s(c,r),m=he(t,r);return{type:b.LOOP,itemVar:u,indexVar:d,iterable:f,body:m,flatten:a!=="nested"}};var Qa=(e,t={})=>{let{functions:r={}}=t;return he(e,r)},Je=Qa;var Wt={};R(Wt,{now:()=>eo});var eo=()=>Date.now();var to=(e,t,r={})=>{let{functions:s={},partials:i={}}=r,n={...Wt,...s},a=Je(e,{functions:n}),l={};for(let[p,o]of Object.entries(i))l[p]=Je(o,{functions:n});return Bt(a,t,{functions:n,partials:l})},Mt=to;function As(e,t){return t.reduce((r,s)=>(s in e&&(r[s]=e[s]),r),{})}var ro=()=>Object.freeze({formValues:{},tooltipState:{open:!1,x:0,y:0,content:""}}),Es=(e,t,r=void 0)=>{if(!t)return;let s=t.split(/[\[\].]/).filter(n=>n!==""),i=e;for(let n of s){if(i==null||!(n in i))return r;i=i[n]}return i},so=(e,t,r)=>{let s=t.split(/[\[\].]/).filter(n=>n!=="");t.includes("[")&&t in e&&delete e[t];let i=e;for(let n=0;n<s.length-1;n++){let a=s[n];if(!(a in i)||typeof i[a]!="object"||i[a]===null){let l=s[n+1],p=/^\d+$/.test(l);i[a]=p?[]:{}}i=i[a]}return i[s[s.length-1]]=r,e},io=["id","class","style","slot","form","defaultValues","context","autofocus","key"],no=(e={})=>Object.entries(e).filter(([t])=>!io.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),qe=({props:e})=>{let{form:t={}}=e,{context:r}=e;return r?Mt(t,r):t},ao=({state:e,props:t})=>{let r=no(t),s=qe({state:e,props:t}),i=structuredClone(s.fields||[]);return i.forEach(n=>{let a=Es(e.formValues,n.name);if(["read-only-text"].includes(n.inputType)&&(n.defaultValue=a),["select"].includes(n.inputType)){let l=t?.defaultValues;l&&l[n.name]!==void 0&&(n.selectedValue=l[n.name])}if(n.inputType==="image"){let l=n.src;n.imageSrc=l&&l.trim()?l:null,n.placeholderText=n.placeholder||"No Image"}if(n.inputType==="waveform"){let l=n.waveformData;n.waveformData=l||null,n.placeholderText=n.placeholder||"No Waveform"}}),{key:t?.key,containerAttrString:r,title:s?.title||"",description:s?.description||"",fields:i,actions:t?.form?.actions||{buttons:[]},formValues:e.formValues,tooltipState:e.tooltipState}},oo=({state:e})=>e,lo=({state:e,props:t})=>{let r=qe({state:e,props:t});return As(e.formValues,r.fields.map(s=>s.name))},po=({state:e},t)=>Es(e.formValues,t),co=({state:e},t={})=>{e.formValues=t.formValues||{}},uo=({state:e,props:t},r={})=>{let{name:s,value:i}=r;if(!s)return;so(e.formValues,s,i);let n=qe({state:e,props:t}),a=As(e.formValues,n.fields.map(l=>l.name));e.formValues=a},fo=({state:e},t={})=>{let{x:r,y:s,content:i}=t;e.tooltipState={open:!0,x:r,y:s,content:i}},ho=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}};var $s={refs:{formContainer:{eventListeners:{keydown:{handler:"handleKeyDown"}}},"action*":{eventListeners:{click:{handler:"handleActionClick"}}},"tooltipIcon*":{eventListeners:{mouseenter:{handler:"handleTooltipMouseEnter"},mouseleave:{handler:"handleTooltipMouseLeave"}}},"field*":{eventListeners:{"value-input":{handler:"handleInputChange"},"value-change":{handler:"handleInputChange"},"add-option-click":{handler:"handleSelectAddOption"}}},"image*":{eventListeners:{click:{handler:"handleImageClick"},contextmenu:{handler:"handleImageClick"}}},"waveform*":{eventListeners:{click:{handler:"handleWaveformClick"},contextmenu:{handler:"handleWaveformClick"}}}},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:"fields"},body:{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.label && field.tooltip",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"field.label"},right:{type:1,path:"field.tooltip"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#tooltipIcon${i} 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:"i"}," 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.inputType == "read-only-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"read-only-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"field.defaultValue"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "input-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"input-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#field${i} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#field",{type:1,path:"i"}," 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"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "input-number"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"input-number"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#field${i} data-field-name=${field.name} w=f data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#field",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," w=f data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "input-textarea"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"input-textarea"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-textarea#field${i} data-field-name=${field.name} w=f rows=${field.rows} w=f data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-textarea#field",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," w=f rows=",{type:1,path:"field.rows"}," w=f data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "popover-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"popover-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-popover-input#field${i} data-field-name=${field.name} label="${field.label}" data-testid=${field.testId}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-popover-input#field",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field.label"},'" data-testid=',{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-select#field${i} data-field-name=${field.name} key=${key} w=f :options=fields[${i}].options ?no-clear=fields[${i}].noClear :addOption=fields[${i}].addOption :selectedValue=#{field.selectedValue} :placeholder=#{field.placeholder} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#field",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," key=",{type:1,path:"key"}," w=f :options=fields[",{type:1,path:"i"},"].options ?no-clear=fields[",{type:1,path:"i"},"].noClear :addOption=fields[",{type:1,path:"i"},"].addOption :selectedValue=",{type:11,path:"field.selectedValue"}," :placeholder=",{type:11,path:"field.placeholder"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "color-picker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"color-picker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#field${i} data-field-name=${field.name} key=${key} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#field",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," key=",{type:1,path:"key"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slider"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider#field${i} data-field-name=${field.name} key=${key} w=f min=${field.min} max=${field.max} step=${field.step} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#field",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," key=",{type:1,path:"key"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slider-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slider-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider-input#field${i} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider-input#field",{type:1,path:"i"}," 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"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "image" && field.imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"image"}},right:{type:1,path:"field.imageSrc"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image#image${i} data-field-name=${field.name} src=${field.imageSrc} w=${field.width} h=${field.height} cur=p data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image#image",{type:1,path:"i"}," 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=p data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "image" && !field.imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"image"}},right:{type:5,op:0,operand:{type:1,path:"field.imageSrc"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#image${i} data-field-name=${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=p p=md data-testid=${field.testId}",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:"i"}," 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=p p=md data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "waveform" && field.waveformData',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"waveform"}},right:{type:1,path:"field.waveformData"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-waveform#waveform${i} data-field-name=${field.name} :waveformData=fields[${i}].waveformData w=${field.width} h=${field.height} cur=p data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-waveform#waveform",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," :waveformData=fields[",{type:1,path:"i"},"].waveformData w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=p data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "waveform" && !field.waveformData',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"waveform"}},right:{type:5,op:0,operand:{type:1,path:"field.waveformData"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#waveform${i} data-field-name=${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=p p=md data-testid=${field.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg ta=c",value:{type:1,path:"field.placeholder"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#waveform",{type:1,path:"i"}," 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=p p=md data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slot"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slot"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'slot#fieldSlot${i} data-field-name=${field.name} name=${field.slot} style="display: contents;"',value:{type:0,value:null},parsedKey:{type:2,parts:["slot#fieldSlot",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," name=",{type:1,path:"field.slot"},' style="display: contents;"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=e g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions.buttons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${i} data-action-id=${button.id} data-testid=${button.testId}",value:{type:1,path:"button.content"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"i"}," data-action-id=",{type:1,path:"button.id"}," data-testid=",{type:1,path:"button.testId"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:'rtgl-tooltip ?open=${tooltipState.open} x=${tooltipState.x} y=${tooltipState.y} placement="top" content="${tooltipState.content}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-tooltip ?open=",{type:1,path:"tooltipState.open"}," x=",{type:1,path:"tooltipState.x"}," y=",{type:1,path:"tooltipState.y"},' placement="top" content="',{type:1,path:"tooltipState.content"},'"']}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#formContainer w=f p=md g=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var zt={};R(zt,{closeAll:()=>Ao,handleCancel:()=>go,handleConfirm:()=>yo,handleDialogClose:()=>mo,handleDropdownClose:()=>vo,handleDropdownItemClick:()=>bo,showAlert:()=>wo,showConfirm:()=>xo,showDropdownMenu:()=>_o});var mo=(e,t)=>{let{store:r,render:s}=e;r.closeAll(),s()},yo=(e,t)=>{let{store:r,render:s,globalUI:i}=e;r.closeAll(),s(),i.emit("event",!0)},go=(e,t)=>{let{store:r,render:s,globalUI:i}=e;r.closeAll(),s(),i.emit("event",!1)},vo=(e,t)=>{let{store:r,render:s,globalUI:i}=e;r.closeAll(),s(),i.emit("event",null)},bo=(e,t)=>{let{store:r,render:s,globalUI:i}=e,n=t._event,{index:a,item:l}=n.detail;r.closeAll(),s(),i.emit("event",{index:a,item:l})},wo=(e,t)=>{let{store:r,render:s}=e,i=t;r.selectIsOpen()&&(r.closeAll(),s()),r.setAlertConfig(i),s()},xo=async(e,t)=>{let{store:r,render:s,globalUI:i}=e,n=t;return r.selectIsOpen()&&(r.closeAll(),s()),r.setConfirmConfig(n),s(),new Promise(a=>{i.once("event",l=>{a(l)})})},_o=async(e,t)=>{let{store:r,render:s,globalUI:i}=e,n=t;return r.selectIsOpen()&&(r.closeAll(),s()),r.setDropdownConfig(n),s(),new Promise(a=>{i.once("event",l=>{a(l)})})},Ao=e=>{let{store:t,render:r}=e;t.selectIsOpen()&&(t.closeAll(),r())};var ks={componentName:"rtgl-global-ui",propsSchema:{type:"object",properties:{}},events:[],methods:[]};var Ut={};R(Ut,{closeAll:()=>Co,createInitialState:()=>Eo,selectConfig:()=>Io,selectDropdownConfig:()=>Oo,selectIsOpen:()=>Lo,selectUiType:()=>To,selectViewData:()=>Ro,setAlertConfig:()=>$o,setConfirmConfig:()=>ko,setDropdownConfig:()=>So});var Eo=()=>Object.freeze({isOpen:!1,uiType:"dialog",config:{status:void 0,title:"",message:"",confirmText:"OK",cancelText:"Cancel",mode:"alert"},dropdownConfig:{items:[],x:0,y:0,placement:"bottom-start"}}),$o=({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},ko=({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},So=({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,placement:t.placement||"bottom-start"},e.uiType="dropdown",e.isOpen=!0},Co=({state:e})=>{e.isOpen=!1,e.uiType="dialog"},Io=({state:e})=>e.config,Oo=({state:e})=>e.dropdownConfig,To=({state:e})=>e.uiType,Lo=({state:e})=>e.isOpen,Ro=({state:e})=>({isOpen:e.isOpen,uiType:e.uiType,config:e.config,dropdownConfig:{items:e.dropdownConfig?.items||[],x:e.dropdownConfig?.x||0,y:e.dropdownConfig?.y||0,placement:e.dropdownConfig?.placement||"bottom-start"},isDialogOpen:e.isOpen&&e.uiType==="dialog",isDropdownOpen:e.isOpen&&e.uiType==="dropdown"});var Ss={refs:{dialog:{eventListeners:{close:{handler:"handleDialogClose"}}},confirmButton:{eventListeners:{click:{handler:"handleConfirm"}}},cancelButton:{eventListeners:{click:{handler:"handleCancel"}}},dropdownMenu:{eventListeners:{close:{handler:"handleDropdownClose"},"item-click":{handler:"handleDropdownItemClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-dialog#dialog ?open=${isDialogOpen} s=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=c av=c g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view h=24 av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"config.title"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-view d=h g=md mt=lg w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"$if config.mode == 'confirm'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"config.mode"},right:{type:0,value:"confirm"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-button#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},parsedKey:{type:2,parts:["rtgl-dialog#dialog ?open=",{type:1,path:"isDialogOpen"}," s=sm"]}}],fast:!1},{type:8,properties:[{key:"rtgl-dropdown-menu#dropdownMenu ?open=${isDropdownOpen} x=${dropdownConfig.x} y=${dropdownConfig.y} placement=${dropdownConfig.placement} :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"}," placement=",{type:1,path:"dropdownConfig.placement"}," :items=dropdownConfig.items key=dropdown-",{type:1,path:"isDropdownOpen"}]}}],fast:!0}],fast:!1}};var Kt={};R(Kt,{handleClickStart:()=>No});var No=(e,t)=>{let{dispatchEvent:r,store:s}=e,i=t._event;console.log("handle click start",s.selectPath()),r(new CustomEvent("start-click",{detail:{path:s.selectPath()}}))};var Cs={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:[]};var Ht={};R(Ht,{createInitialState:()=>Po,selectPath:()=>Wo,selectViewData:()=>jo,setState:()=>Mo});var Po=()=>Object.freeze({}),Vo=["id","class","style","slot"],Do=(e={})=>Object.entries(e).filter(([t])=>!Vo.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Bo=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}}}},jo=({props:e})=>{let t=Bo(e.start)||e.start;return{containerAttrString:Do(e),start:t||{label:"",image:{src:"",width:32,height:32,alt:""}}}},Wo=({props:e})=>e.start?.path,Mo=({state:e})=>{};var Is={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=lg g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a href=",{type:1,path:"start.href"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#start d=h av=c g=lg g=md cur=p",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=lg g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view 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}};var Gt={};R(Gt,{handleBeforeMount:()=>zo});var Os=(e,t,r)=>{let{store:s,render:i}=r,n,a=-1/0;if(e.forEach(l=>{let p=l.getBoundingClientRect();p.top<=t&&p.top>a&&(a=p.top,n=l.id)}),!n){let l=1/0;e.forEach(p=>{let o=p.getBoundingClientRect();o.top>t&&o.top<l&&(l=o.top,n=p.id)})}n&&n!==s.selectCurrentId()&&(s.setCurrentId({id:n}),i())},Fo=(e,t,r,s)=>{let{store:i,render:n}=s,a=e.querySelectorAll("h1[id], h2[id], h3[id], h4[id], rtgl-text[id]"),l=Array.from(a),p=l.map(c=>{let u=1,d=c.tagName.toLowerCase();return d==="h1"?u=1:d==="h2"?u=2:d==="h3"?u=3:d==="h4"?u=4:d==="rtgl-text"&&(u=parseInt(c.getAttribute("data-level")||"1",10)),{id:c.id,href:`#${c.id}`,title:c.textContent,level:u}});i.setItems({items:p}),Os(l,r,s),n();let o=Os.bind(void 0,l,r,s);return t.addEventListener("scroll",o,{passive:!0}),()=>{t.removeEventListener("scroll",o)}},zo=e=>{let{props:t}=e,r=()=>{};return requestAnimationFrame(()=>{let s=document.getElementById(t.targetId);if(!s)return;let i=window;t.scrollContainerId&&(i=document.getElementById(t.scrollContainerId)||window);let n=parseInt(t.offsetTop||"100",10);r=Fo(s,i,n,e)}),()=>{r()}};var Ts={componentName:"rtgl-page-outline",propsSchema:{type:"object",properties:{targetId:{type:"string"},scrollContainerId:{type:"string"},offsetTop:{type:"string"}}},events:{onItemClick:{type:"object"}},methods:[]};var Jt={};R(Jt,{createInitialState:()=>Uo,selectCurrentId:()=>Go,selectState:()=>Ho,selectViewData:()=>Ko,setContentContainer:()=>Yo,setCurrentId:()=>qo,setItems:()=>Jo});var Uo=()=>Object.freeze({items:[],currentId:null,contentContainer:null}),Ko=({state:e})=>{let r=((s,i)=>{let n=new Set,a=s.findIndex(p=>p.id===i);if(a===-1)return n;let l=s[a].level;for(let p=a-1;p>=0;p--)if(s[p].level<l){let o=s[p].level;n.add(s[p].id);for(let c=p-1;c>=0;c--)s[c].level<o&&(n.add(s[c].id),o=s[c].level);break}return n})(e.items,e.currentId);return{items:e.items.map(s=>{let i={1:"0",2:"12px",3:"24px",4:"32px"},n=s.id===e.currentId,a=r.has(s.id),l=n||a;return{...s,c:l?"fg":"mu-fg",ml:i[s.level]||"",bc:l?"fg":"mu-fg"}}),currentId:e.currentId}},Ho=({state:e})=>e,Go=({state:e})=>e.currentId,Jo=({state:e},t={})=>{e.items=Array.isArray(t.items)?t.items:[]},qo=({state:e},t={})=>{e.currentId=t.id},Yo=({state:e},t={})=>{e.contentContainer=t.container};var Ls={refs:{},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=272 pr=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f mt=xl",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view d=h bwl=xs bc="${item.bc}" pv=sm av=c href=${item.href} pl=md',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=${item.ml}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view w=",{type:1,path:"item.ml"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} h-c=fg",value:{type:1,path:"item.title"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," h-c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view d=h bwl=xs bc="',{type:1,path:"item.bc"},'" pv=sm av=c href=',{type:1,path:"item.href"}," pl=md"]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var qt={};R(qt,{handleBeforeMount:()=>Xo,handleInputChange:()=>tl,handleInputKeydown:()=>sl,handleOnUpdate:()=>Zo,handlePopoverClose:()=>el,handleSubmitClick:()=>rl,handleTextClick:()=>Qo});var Xo=e=>{let{store:t,props:r}=e;r.value!==void 0&&t.setValue({value:r.value||""})},Zo=(e,t)=>{let{oldProps:r,newProps:s}=t,{store:i,render:n}=e;if(r?.value!==s?.value){let a=s?.value??"";i.setValue({value:a})}n()},Qo=(e,t)=>{let{store:r,render:s,refs:i,props:n}=e,a=t._event,l=r.selectValue();r.setTempValue({value:l}),r.openPopover({position:{x:a.currentTarget.getBoundingClientRect().left,y:a.currentTarget.getBoundingClientRect().bottom}});let{input:p}=i;p.value=l,s(),n.autoFocus&&setTimeout(()=>{p.focus()},50)},el=(e,t)=>{let{store:r,render:s}=e;r.closePopover({}),s()},tl=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,a=t._event.detail.value;r.setTempValue({value:a}),i(new CustomEvent("value-input",{detail:{value:a},bubbles:!0})),s()},rl=e=>{let{store:t,render:r,dispatchEvent:s,refs:i}=e,{input:n}=i,a=n.value;t.setValue({value:a}),t.closePopover({}),s(new CustomEvent("value-change",{detail:{value:a},bubbles:!0})),r()},sl=(e,t)=>{let{store:r,render:s,dispatchEvent:i,refs:n}=e,a=t._event;if(a.key==="Enter"){let{input:l}=n,p=l.value;r.closePopover({}),i(new CustomEvent("value-change",{detail:{value:p},bubbles:!0})),s()}else a.key==="Escape"&&(r.closePopover({}),s())};var Rs={componentName:"rtgl-popover-input",propsSchema:{type:"object",properties:{value:{type:"string"},placeholder:{type:"string"},label:{type:"string"},autoFocus:{type:"boolean"}}},events:{"value-input":{},"value-change":{}},methods:[]};var Yt={};R(Yt,{closePopover:()=>ll,createInitialState:()=>il,openPopover:()=>ol,selectValue:()=>cl,selectViewData:()=>nl,setTempValue:()=>al,setValue:()=>pl});var il=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),nl=({props:e,state:t})=>{let r=t.value||"-";return{isOpen:t.isOpen,position:t.position,value:r,tempValue:t.tempValue,placeholder:e.placeholder??"",label:e.label}},al=({state:e},t={})=>{e.tempValue=t.value},ol=({state:e},t={})=>{let{position:r}=t;e.position=r,e.isOpen=!0,e.hasUnsavedChanges=!1},ll=({state:e})=>{e.isOpen=!1,e.tempValue=""},pl=({state:e},t={})=>{e.value=t.value},cl=({state:e})=>e.value;var Ns={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=p",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"value"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=240 slot=content bgc=bg br=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-input#input w=f placeholder=${placeholder}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=f placeholder=",{type:1,path:"placeholder"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#submit",value:{type:0,value:"Submit"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}]}}],fast:!0}],fast:!0}};var Xt={};R(Xt,{handleAddOptionClick:()=>bl,handleAddOptionMouseEnter:()=>wl,handleAddOptionMouseLeave:()=>xl,handleBeforeMount:()=>ul,handleButtonClick:()=>fl,handleClearClick:()=>vl,handleClickOptionsPopoverOverlay:()=>hl,handleOnUpdate:()=>dl,handleOptionClick:()=>ml,handleOptionMouseEnter:()=>yl,handleOptionMouseLeave:()=>gl});var ul=e=>{let{store:t,props:r,render:s}=e;if(r.selectedValue!==null&&r.selectedValue!==void 0&&r.options){let i=r.options.find(n=>fe(n.value,r.selectedValue));i&&(t.updateSelectedValue({value:i?.value}),s())}},dl=(e,t)=>{let{oldProps:r,newProps:s}=t,{store:i,render:n}=e;if(r?.key!==s?.key&&s?.key){i.resetSelection({});let a=s?.selectedValue,l=s?.options||[];if(a!=null&&l){let p=l.find(o=>fe(o.value,a));p&&i.updateSelectedValue({value:p.value})}n()}else r.selectedValue!==s.selectedValue&&(i.updateSelectedValue({value:s.selectedValue}),n())},fl=(e,t)=>{let{store:r,render:s,refs:i,props:n}=e;t._event.stopPropagation();let l=i.selectButton,p=l.firstElementChild,o=p?p.getBoundingClientRect():l.getBoundingClientRect(),c=r.selectSelectedValue(),u=c!==null?c:n.selectedValue,d=null;u!=null&&n.options&&(d=n.options.findIndex(h=>fe(h.value,u)),d===-1&&(d=null)),r.openOptionsPopover({position:{y:o.bottom+12,x:o.left-24},selectedIndex:d}),s()},hl=e=>{let{store:t,render:r}=e;t.closeOptionsPopover({}),r()},ml=(e,t)=>{let{render:r,dispatchEvent:s,props:i,store:n}=e,a=t._event;a.stopPropagation();let l=a.currentTarget.id.slice(6),p=Number(l),o=i.options[l];n.updateSelectedValue({value:o?.value}),i.onChange&&typeof i.onChange=="function"&&i.onChange(o.value),s(new CustomEvent("value-change",{detail:{value:o.value,label:o.label,index:p,item:o},bubbles:!0})),r()},yl=(e,t)=>{let{store:r,render:s}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(6),10);r.setHoveredOption({optionId:n}),s()},gl=(e,t)=>{let{store:r,render:s}=e;r.clearHoveredOption({}),s()},vl=(e,t)=>{let{store:r,render:s,dispatchEvent:i,props:n}=e;t._event.stopPropagation(),r.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})),s()},bl=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,{_event:n}=t;n.stopPropagation(),r.closeOptionsPopover({}),i(new CustomEvent("add-option-click",{bubbles:!0})),s()},wl=(e,t)=>{let{store:r,render:s}=e;r.setHoveredAddOption({isHovered:!0}),s()},xl=(e,t)=>{let{store:r,render:s}=e;r.setHoveredAddOption({isHovered:!1}),s()};var Ps={componentName:"rtgl-select",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"}}}}},events:{"value-change":{},"add-option-click":{}},methods:[]};var Zt={};R(Zt,{clearHoveredOption:()=>Rl,clearSelectedValue:()=>Nl,closeOptionsPopover:()=>Il,createInitialState:()=>El,openOptionsPopover:()=>Cl,resetSelection:()=>Tl,selectSelectedValue:()=>Sl,selectState:()=>kl,selectViewData:()=>$l,setHoveredAddOption:()=>Pl,setHoveredOption:()=>Ll,updateSelectedValue:()=>Ol});var _l=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption"],Al=(e={})=>Object.entries(e).filter(([t])=>!_l.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),El=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,hoveredOptionId:null,hoveredAddOption:!1}),$l=({state:e,props:t})=>{let r=Al(t),s=e.selectedValue!==null?e.selectedValue:t.selectedValue,i=t.placeholder||"Select an option",n=!0,a=t.options||[],l=a.find(o=>fe(o.value,s));l&&(i=l.label,n=!1);let p=a.map((o,c)=>{let u=fe(o.value,s),d=e.hoveredOptionId===c;return{...o,isSelected:u,bgc:d?"ac":u?"mu":""}});return{containerAttrString:r,isOpen:e.isOpen,position:e.position,options:p,selectedValue:s,selectedLabel:i,selectedLabelColor:n?"mu-fg":"fg",hasValue:s!=null,showClear:!t.noClear&&s!=null,showAddOption:!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"ac":""}},kl=({state:e})=>e,Sl=({state:e})=>e.selectedValue,Cl=({state:e},t={})=>{let{position:r,selectedIndex:s}=t;e.position=r,e.isOpen=!0,s!=null&&(e.hoveredOptionId=s)},Il=({state:e})=>{e.isOpen=!1},Ol=({state:e},t={})=>{e.selectedValue=t.value,e.isOpen=!1},Tl=({state:e})=>{e.selectedValue=void 0},Ll=({state:e},t={})=>{e.hoveredOptionId=t.optionId},Rl=({state:e})=>{e.hoveredOptionId=null},Nl=({state:e})=>{e.selectedValue=void 0},Pl=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered};var Vs={refs:{selectButton:{eventListeners:{click:{handler:"handleButtonClick"}}},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"}}}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-button#selectButton v=ol ${containerAttrString} data-testid="select-button"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${selectedLabelColor} ellipsis",value:{type:1,path:"selectedLabel"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"selectedLabelColor"}," ellipsis"]}}],fast:!0},{type:8,properties:[{key:"rtgl-view mh=md w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"$if showClear",value:{type:6,conditions:[{type:1,path:"showClear"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#clearButton mr=md svg=x wh=16 c=mu-fg cur=p 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-button#selectButton v=ol ",{type:1,path:"containerAttrString"},' data-testid="select-button"']}}],fast:!1},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} placement=right-start",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=bg br=md sv=true",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f ph=lg pv=md cur=p br=md bgc=${option.bgc} data-testid=${option.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f ph=lg pv=md cur=p br=md bgc=",{type:1,path:"option.bgc"}," data-testid=",{type:1,path:"option.testId"}]}}],fast:!0}],fast:!0}},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f bw=xs bc=mu bwt=sm",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-view#optionAdd w=f ph=lg pv=md cur=p br=md bgc=${addOptionBgc} data-testid="select-add-option"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=ac",value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#optionAdd w=f ph=lg pv=md cur=p br=md bgc=",{type:1,path:"addOptionBgc"},' data-testid="select-add-option"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," placement=right-start"]}}],fast:!1}],fast:!1}};var Qt={};R(Qt,{handleHeaderClick:()=>Vl,handleItemClick:()=>Dl});var Vl=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t._event,n,a=r.selectHeader();i.currentTarget.id==="headerLabel"?n=a.labelPath:i.currentTarget.id==="headerImage"?n=a.image.path:i.currentTarget.id==="header"&&(n=a.path),s(new CustomEvent("header-click",{detail:{path:n},bubbles:!0,composed:!0}))},Dl=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t._event,n=i.currentTarget.dataset.itemId||i.currentTarget.id.slice(4),a=r.selectItem(n);s(new CustomEvent("item-click",{detail:{item:a},bubbles:!0,composed:!0}))};var Ds={componentName:"rtgl-sidebar",propsSchema:{type:"object",properties:{mode:{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:{title:{type:"string"},slug:{type:"string"},type:{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:[]};var tr={};R(tr,{createInitialState:()=>Bl,selectActiveItem:()=>zl,selectHeader:()=>Fl,selectItem:()=>Ul,selectViewData:()=>Ml,setState:()=>Kl});var Bl=()=>Object.freeze({}),jl=["id","class","style","slot","header","items","selectedItemId","mode"],Wl=(e={})=>Object.entries(e).filter(([t])=>!jl.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Be=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}}}};function er(e,t=null){let r=[];for(let s of e){let i=s.id||s.href||s.path,n=t===i;if(r.push({id:i,title:s.title,href:s.href,type:s.type||"item",icon:s.icon,hrefAttr:s.href?`href=${s.href}`:"",isSelected:n,itemBgc:n?"ac":"bg",itemHoverBgc:n?"ac":"mu"}),s.items&&Array.isArray(s.items))for(let a of s.items){let l=a.id||a.href||a.path,p=t===l;r.push({id:l,title:a.title,href:a.href,type:a.type||"item",icon:a.icon,hrefAttr:a.href?`href=${a.href}`:"",isSelected:p,itemBgc:p?"ac":"bg",itemHoverBgc:p?"ac":"mu"})}}return r}var Ml=({props:e})=>{let t=Be(e.header)||e.header,r=Be(e.items)||e.items,s=e.selectedItemId,i=Wl(e),n=e.mode||"full",a=t||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},l=r?er(r,s):[],p=n==="full"?272:64,o=n==="full"?"fs":"c",c=n==="full"?"fs":"c",u=n==="full"?"lg":"sm",d=n==="full"?"md":"sm",h=n==="shrunk-lg"?48:40,f=n==="shrunk-lg"?28:20,m=n==="shrunk-lg"?"md":"sm",g=n==="full",y=n==="full",w=n==="full"?"fs":"c",x=n==="full"?"":`ah=${c}`,_=n==="full"?"f":h;return{containerAttrString:i,mode:n,header:a,items:l,sidebarWidth:p,headerAlign:o,itemAlign:c,headerPadding:u,itemPadding:d,itemHeight:h,iconSize:f,firstLetterSize:m,showLabels:g,showGroupLabels:y,itemContentAlign:w,itemAlignAttr:x,itemWidth:_,headerWidth:_,selectedItemId:s,ah:n==="shrunk-lg"||n==="shrunk-md"?"c":""}},Fl=({props:e})=>Be(e.header)||e.header,zl=({state:e,props:t})=>{let r=Be(t.items)||t.items;return(r?er(r):[]).find(i=>i.active)},Ul=({props:e},t)=>{let r=Be(e.items)||e.items;return(r?er(r):[]).find(i=>i.id===t)},Kl=({state:e})=>{};var Bs={refs:{headerImage:{eventListeners:{click:{handler:"handleHeaderClick"}}},headerLabel:{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item*":{eventListeners:{click:{handler:"handleItemClick"}}}},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=p":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],$else:[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}]},{"$if header.label && showLabels":[{"$if header.labelHref":[{"rtgl-text href=${header.labelHref} s=lg":"${header.label}"}],"$elif header.labelPath":[{"rtgl-view#headerLabel cur=p":[{"rtgl-text s=lg":"${header.label}"}]}],$else:[{"rtgl-text s=lg":"${header.label}"}]}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=${sidebarWidth} bwr=xs ah=${ah} ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view ph=${headerPadding} pv=lg",value:{type:9,items:[{type:8,properties:[{key:"$if header.href",value:{type:6,conditions:[{type:1,path:"header.href"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view href=${header.href} d=h av=c ah=${headerAlign} g=lg w=${headerWidth}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerImage cur=p",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerLabel cur=p",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view href=",{type:1,path:"header.href"}," d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c ah=${headerAlign} g=lg w=${headerWidth} cur=p 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=p",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerLabel cur=p",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#header d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}," cur=p 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},{type:8,properties:[{key:"rtgl-view w=f ph=${headerPadding} pb=lg g=xs ah=${ah}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'$if item.type == "groupLabel"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"groupLabel"}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showGroupLabels",value:{type:6,conditions:[{type:1,path:"showGroupLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=32 av=c ph=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=1 bgc=mu",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=p data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"$if item.icon",value:{type:6,conditions:[{type:1,path:"item.icon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=${itemContentAlign} g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h ah=",{type:1,path:"itemContentAlign"}," g=sm"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=${iconSize} svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=",{type:1,path:"iconSize"}," svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=${iconSize} br=f bgc=mu av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=${firstLetterSize} c=fg",value:{type:1,path:"item.title.charAt(0).toUpperCase()"},parsedKey:{type:2,parts:["rtgl-text s=",{type:1,path:"firstLetterSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view wh=",{type:1,path:"iconSize"}," br=f bgc=mu av=c ah=c"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#item",{type:1,path:"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=p data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f ph=",{type:1,path:"headerPadding"}," pb=lg g=xs ah=",{type:1,path:"ah"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{type:1,path:"sidebarWidth"}," bwr=xs ah=",{type:1,path:"ah"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var rr={};R(rr,{handleBeforeMount:()=>Hl,handleOnUpdate:()=>Gl,handleValueChange:()=>Jl,handleValueInput:()=>ql});var Hl=e=>{let{store:t,props:r}=e;t.setValue({value:r.value??0})},Gl=(e,t)=>{let{oldProps:r,newProps:s}=t,{store:i,render:n}=e;if(r?.value!==s?.value){let a=s?.value??0;i.setValue({value:a}),n()}},Jl=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,n=t._event,a=Number(n.detail.value);r.setValue({value:a}),s(),i(new CustomEvent("value-change",{detail:{value:a},bubbles:!0}))},ql=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,n=t._event,a=Number(n.detail.value);r.setValue({value:a}),s(),i(new CustomEvent("value-input",{detail:{value:a},bubbles:!0}))};var js={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"}}},events:{"value-input":{},"value-change":{}},methods:[]};var sr={};R(sr,{createInitialState:()=>Yl,selectViewData:()=>Xl,setValue:()=>Zl});var Yl=()=>Object.freeze({value:0}),Xl=({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}),Zl=({state:e},t={})=>{e.value=t.value};var Ws={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}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider key=",{type:1,path:"key"}," w=f type=range min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=84",value:{type:9,items:[{type:8,properties:[{key:"rtgl-input#input key=${key} w=f type=number min=${min} max=${max} step=${step} value=${value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input key=",{type:1,path:"key"}," w=f type=number min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md w=",{type:1,path:"w"}]}}],fast:!0}],fast:!0}};var ir={};R(ir,{handleBeforeMount:()=>Ql,handleHeaderClick:()=>tp,handleRowClick:()=>ep});var Ql=e=>{},ep=(e,t)=>{let{dispatchEvent:r,props:s}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(3),10),a=s.data?.rows?.[n];a&&r(new CustomEvent("row-click",{detail:{rowIndex:n,rowData:a}}))},tp=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,a=t._event.currentTarget.dataset.columnKey,l=r.selectSortInfo(),p="asc";l.column===a&&(l.direction==="asc"?p="desc":l.direction==="desc"&&(p=null)),p?r.setSortColumn({column:a,direction:p}):r.clearSort(),s(),i(new CustomEvent("header-click",{detail:{column:a,direction:p,sortInfo:p?{column:a,direction:p}:null}}))};var Ms={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:[]};var nr={};R(nr,{clearSort:()=>cp,createInitialState:()=>rp,selectSortInfo:()=>lp,selectState:()=>op,selectViewData:()=>ap,setSortColumn:()=>pp});var rp=()=>Object.freeze({sortColumn:null,sortDirection:null}),sp=["id","class","style","slot","data"],ip=(e={})=>Object.entries(e).filter(([t])=>!sp.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),np=(e,t)=>{let r=t.split("."),s=e;for(let i of r){if(s==null)return null;s=s[i]}return s},ap=({state:e,props:t})=>{let r=ip(t),s=t.data||{columns:[],rows:[]},i=s.rows.map((n,a)=>{let l=s.columns.map(p=>{let o=np(n,p.key);return{key:p.key,value:o!=null?String(o):""}});return{index:a,cells:l}});return{containerAttrString:r,columns:s.columns||[],rows:i||[]}},op=({state:e})=>e,lp=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),pp=({state:e},{column:t,direction:r}={})=>{e.sortColumn=t,e.sortDirection=r},cp=({state:e})=>{e.sortColumn=null,e.sortDirection=null};var Fs={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}}],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}}],fast:!1},parsedKey:{type:2,parts:["tr#row",{type:1,path:"rowIndex"}]}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view.empty-state w=f p=xl",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"No data available"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view.table-container ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var ar={};R(ar,{handleClickItem:()=>up});var up=(e,t)=>{let{dispatchEvent:r}=e,i=t._event.currentTarget.dataset.id;r(new CustomEvent("item-click",{detail:{id:i}}))};var zs={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:[]};var or={};R(or,{createInitialState:()=>dp,selectViewData:()=>mp});var dp=()=>Object.freeze({}),fp=["id","class","style","slot","items","selectedTab"],hp=(e={})=>Object.entries(e).filter(([t])=>!fp.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),mp=({props:e})=>{let t=hp(e),r=e.items||[],s=e.selectedTab,i=r.map(n=>({...n,isSelected:n.id===s,bgColor:n.id===s?"ac":"",borderColor:n.id===s?"":"tr",textColor:n.id===s?"":"mu-fg"}));return{containerAttrString:t,items:i,selectedTab:s}};var Us={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=p 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=p 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}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h g=sm bgc=mu p=sm br=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Ks={};var Hs={componentName:"rtgl-tooltip",propsSchema:{type:"object",properties:{open:{type:"string"},x:{type:"string"},y:{type:"string"},placement:{type:"string"},content:{type:"string"}}},events:[],methods:[]};var lr={};R(lr,{createInitialState:()=>yp,selectViewData:()=>gp});var yp=()=>Object.freeze({}),gp=({props:e})=>({open:!!e.open,x:e.x||0,y:e.y||0,placement:e.placement||"top",content:e.content||""});var Gs={template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} placement=${placement} no-overlay",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content bgc=bg bc=bo br=md p=sm ah=c av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text ta=c s=sm c=fg",value:{type:1,path:"content"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," placement=",{type:1,path:"placement"}," no-overlay"]}}],fast:!0}],fast:!0},refs:{}};var pr={};R(pr,{handleAfterMount:()=>vp,handleOnUpdate:()=>bp});var vp=async e=>{let{props:t,store:r,render:s,refs:i}=e,{waveformData:n}=t;r.setWaveformData({data:n}),s();let a=i.canvas;a&&Js(n,a)},bp=async(e,t)=>{let{store:r,render:s,refs:i,props:n}=e,{waveformData:a}=n;if(!a){console.log("waveform handleOnUpdate: no waveformData provided");return}r.setWaveformData({data:a}),s();let l=i.canvas;l&&Js(a,l)};async function Js(e,t){let r=t.getContext("2d"),s=t.getBoundingClientRect(),i=s.width,n=s.height;t.width=i,t.height=n;let a=t.width,l=t.height;if(r.clearRect(0,0,a,l),r.fillStyle="#1a1a1a",r.fillRect(0,0,a,l),!e||!e.amplitudes)return;let p=e.amplitudes,o=l/2,c=r.createLinearGradient(0,0,0,l);c.addColorStop(0,"#404040"),c.addColorStop(.5,"#A1A1A1"),c.addColorStop(1,"#404040");let u=Math.max(1,a/p.length),d=.2;for(let h=0;h<p.length;h++){let m=p[h]/255*(l*.85),g=h*u,y=o-m/2;r.fillStyle=c,r.fillRect(g,y,Math.max(1,u*(1-d)),m)}r.strokeStyle="rgba(255, 255, 255, 0.1)",r.lineWidth=1,r.beginPath(),r.moveTo(0,o),r.lineTo(a,o),r.stroke(),r.shadowBlur=10,r.shadowColor="#2196F3"}var qs={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:[]};var cr={};R(cr,{createInitialState:()=>wp,selectViewData:()=>_p,setWaveformData:()=>xp});var wp=()=>Object.freeze({waveformData:null}),xp=({state:e},t={})=>{e.waveformData=t.data},_p=({state:e,props:t})=>({isLoading:t.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:t.waveformData});var Ys={refs:{canvas:{selector:"canvas"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f pos=rel w=${w} h=${h} cur=${cur}",value:{type:9,items:[{type:8,properties:[{key:"$if isLoading",value:{type:6,conditions:[{type:1,path:"isLoading"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"..."}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'canvas#canvas style="width:100%; height:100%;"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=f pos=rel w=",{type:1,path:"w"}," h=",{type:1,path:"h"}," cur=",{type:1,path:"cur"}]}}],fast:!1}],fast:!1}};var ur=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Xe=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase()),Ye=e=>{if(e!=null)return e===""?!0:e},Xs=(e,t)=>{let r=e.getAttribute(t);if(r!==null)return Ye(r);let s=ur(t);if(s!==t){let i=e.getAttribute(s);if(i!==null)return Ye(i)}},Zs=(e,t)=>{let r=new Set(t);return new Proxy({},{get(s,i){if(typeof i=="string"&&r.has(i)){let n=e[i];return n!==void 0?n:Xs(e,i)}},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(s,i){return typeof i=="string"&&r.has(i)},ownKeys(){return[...r]},getOwnPropertyDescriptor(s,i){if(typeof i=="string"&&r.has(i))return{configurable:!0,enumerable:!0,get:()=>{let n=e[i];return n!==void 0?n:Xs(e,i)}}}})};var Qs=({schema:e,methodExports:t=[]})=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("RTGL-SCHEMA-001: componentName is required.");if(typeof e.componentName!="string"||e.componentName.trim()==="")throw new Error("RTGL-SCHEMA-001: componentName is required.");if(Object.prototype.hasOwnProperty.call(e,"attrsSchema"))throw new Error("RTGL-SCHEMA-002: attrsSchema is not supported.");if(Array.isArray(e.methods)){for(let r of e.methods)if(!(!r||typeof r.name!="string"||r.name.trim()==="")&&!t.includes(r.name))throw new Error(`RTGL-SCHEMA-003: method '${r.name}' missing in .methods.js exports.`)}return!0};var 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},D={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},je={NOT:0};var O=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},Q=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var dr=e=>{if(!e||e.trim()==="")throw new O("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new O(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${r}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let r of t)if(e.trim().endsWith(r))throw new O(`Incomplete comparison expression - missing right operand (got: '${e}')`)},ei=e=>{if(e.trim().endsWith(" in"))throw new O(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new O(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new O(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(t.includes(",")){let s=t.split(",").map(i=>i.trim());for(let i of s)if(!i)throw new O(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`)}else if(!t.trim())throw new O(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`)};var ti=(e,t,r=!1)=>{if(t===null)return new Q(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new Q(`Cannot iterate over undefined value at '$for ${e}'`);let s=typeof t;return r?new Q(`Cannot iterate over non-array value in loop '${e}' - got ${s} instead`):new Q(`Cannot iterate over non-array value (got: ${s}) at '$for ${e}'`)},ri=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new Q(`Unknown function '${e}' (${r})`)};var Ap=(e,t,r={})=>{let s={},i={};r&&typeof r=="object"&&(r.functions!==void 0||r.partials!==void 0?(s=r.functions||{},i=r.partials||{}):typeof r=="object"&&(s=r));let a=I(e,{functions:s,partials:i},t,{});return a===void 0?{}:a},I=(e,t,r,s)=>{let i=t.functions||t;if(e.var&&!e.type)return F(e.var,r,s);if(e.type===v.LITERAL)return e.value;if(e.type===v.VARIABLE)return F(e.path,r,s);if(e.type===v.INTERPOLATION)return $p(e.parts,t,r,s);switch(e.type){case v.FUNCTION:return ii(e,t,r,s);case v.BINARY:return ni(e,t,r,s);case v.UNARY:return ai(e,t,r,s);case v.CONDITIONAL:return Sp(e,t,r,s);case v.LOOP:return Lp(e,t,r,s);case v.OBJECT:return Np(e,t,r,s);case v.ARRAY:return Pp(e,t,r,s);case v.PARTIAL:return Vp(e,t,r,s);case v.PATH_REFERENCE:return Dp(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},si=new Map,Ep=e=>{let t=[],r="",s=!1;for(let i=0;i<e.length;i++){let n=e[i];if(n==="[")r&&(t.push({type:"property",value:r}),r=""),s=!0;else if(n==="]"){if(s&&r){let a=r.trim();if(/^\d+$/.test(a))t.push({type:"index",value:parseInt(a,10)});else if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")){let l=a.slice(1,-1);t.push({type:"property",value:l})}else t.push({type:"property",value:a});r=""}s=!1}else r+=n}return r&&t.push({type:"property",value:r}),t},F=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let s=si.get(e);if(!s){let n=[],a="",l=0;for(let p=0;p<e.length;p++){let o=e[p];o==="["?(l++,a+=o):o==="]"?(l--,a+=o):o==="."&&l===0?a&&(n.push(a),a=""):a+=o}a&&n.push(a),s=[];for(let p of n){let o=Ep(p.trim());s.push(...o)}si.set(e,s)}let i=t;for(let n=0;n<s.length;n++){let a=s[n];if(a.type==="property"&&a.value in r){i=r[a.value];continue}if(i==null)return;(a.type==="property"||a.type==="index")&&(i=i[a.value])}return i},$p=(e,t,r,s)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let a=I(n,t,r,s);i.push(a!=null?String(a):"")}return i.join("")},ii=(e,t,r,s)=>{let i=t.functions||t,n=i[e.name];if(!n)throw ri(e.name,i);let a=e.args.map(l=>I(l,t,r,s));return n(...a)},ke=(e,t,r,s)=>{if(e.var&&!e.type)return F(e.var,r,s);switch(e.type){case v.VARIABLE:return F(e.path,r,s);case v.LITERAL:return e.value;case v.BINARY:return ni(e,t,r,s);case v.UNARY:return ai(e,t,r,s);case v.FUNCTION:return ii(e,t,r,s);default:return I(e,t,r,s)}},ni=(e,t,r,s)=>{if(e.op===D.AND||e.op===D.OR){let a=ke(e.left,t,r,s),l=ke(e.right,t,r,s);switch(e.op){case D.AND:return a&&l;case D.OR:return a||l}}let i=I(e.left,t,r,s),n=I(e.right,t,r,s);switch(e.op){case D.EQ:return i==n;case D.NEQ:return i!=n;case D.GT:return i>n;case D.LT:return i<n;case D.GTE:return i>=n;case D.LTE:return i<=n;case D.IN:return Array.isArray(n)?n.includes(i):!1;case D.ADD:if(typeof i!="number"||typeof n!="number")throw new Q(`Arithmetic operations require numbers. Got ${typeof i} + ${typeof n}`);return i+n;case D.SUBTRACT:if(typeof i!="number"||typeof n!="number")throw new Q(`Arithmetic operations require numbers. Got ${typeof i} - ${typeof n}`);return i-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},ai=(e,t,r,s)=>{let i=e.op===je.NOT?ke(e.operand,t,r,s):I(e.operand,t,r,s);switch(e.op){case je.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},kp=(e,t,r,s)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===v.VARIABLE)if(F(i.path,r,s)){let a=e.bodies[0];if(a.type===v.OBJECT&&a.properties.length<=5){let l={};for(let p of a.properties){let o=p.parsedKey?I(p.parsedKey,t,r,s):p.key,c=p.value;if(c.type===v.LITERAL)l[o]=c.value;else if(c.type===v.VARIABLE)l[o]=F(c.path,r,s);else if(c.type===v.INTERPOLATION){let u=[];for(let d of c.parts)if(typeof d=="string")u.push(d);else if(d.type===v.VARIABLE){let h=F(d.path,r,s);u.push(h!=null?String(h):"")}else{let h=I(d,t,r,s);u.push(h!=null?String(h):"")}l[o]=u.join("")}else l[o]=I(c,t,r,s)}return l}}else{let a=e.bodies[1];if(a.type===v.OBJECT&&a.properties.length<=5){let l={};for(let p of a.properties){let o=p.parsedKey?I(p.parsedKey,t,r,s):p.key,c=p.value;if(c.type===v.LITERAL)l[o]=c.value;else if(c.type===v.VARIABLE)l[o]=F(c.path,r,s);else if(c.type===v.INTERPOLATION){let u=[];for(let d of c.parts)if(typeof d=="string")u.push(d);else if(d.type===v.VARIABLE){let h=F(d.path,r,s);u.push(h!=null?String(h):"")}else{let h=I(d,t,r,s);u.push(h!=null?String(h):"")}l[o]=u.join("")}else l[o]=I(c,t,r,s)}return l}}}return null},Sp=(e,t,r,s)=>{let i=kp(e,t,r,s);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let a=e.conditions[n];if(a===null||ke(a,t,r,s))return I(e.bodies[n],t,r,s)}return oi},Cp=(e,t)=>{let r=e.body,s=e.itemVar;if(r.type===v.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===v.VARIABLE){let i=r.conditions[0].path,n=r.bodies[0];if(i.startsWith(s+".")){let a=i.substring(s.length+1);if(n.type===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 o=t[p];if(o[a]){let c={};for(let u of n.properties){let d=u.key,h=u.value;if(h.type===v.LITERAL)c[d]=h.value;else if(h.type===v.VARIABLE){let f=h.path;if(f===s)c[d]=o;else if(f.startsWith(s+".")){let m=f.substring(s.length+1);c[d]=o[m]}else return null}else if(h.type===v.INTERPOLATION){let f=[],m=!0;for(let g of h.parts)if(typeof g=="string")f.push(g);else if(g.type===v.VARIABLE){let y=g.path;if(y===s)f.push(o!=null?String(o):"");else if(y.startsWith(s+".")){let w=y.substring(s.length+1),x=o[w];f.push(x!=null?String(x):"")}else{m=!1;break}}else{m=!1;break}if(!m)return null;c[d]=f.join("")}else return null}l.push(c)}}return l}}}return null},Ip=(e,t)=>{let r=e.body,s=e.itemVar,i=Cp(e,t);if(i!==null)return i;if(r.type===v.OBJECT&&r.properties.length<=5){for(let l of r.properties)if(l.parsedKey)return null;let n=[],a=!0;for(let l of r.properties){let p=l.key,o=l.value;if(o.type===v.LITERAL)n.push({key:p,type:"literal",value:o.value});else if(o.type===v.VARIABLE){let c=o.path;if(c===s)n.push({key:p,type:"item"});else if(c.startsWith(s+".")){let u=c.substring(s.length+1);if(!u.includes(".")&&!u.includes("["))n.push({key:p,type:"prop",prop:u});else{a=!1;break}}else{a=!1;break}}else if(o.type===v.INTERPOLATION&&o.parts.length===1){let c=o.parts[0];if(c.type===v.VARIABLE){let u=c.path;if(u===s)n.push({key:p,type:"item_string"});else if(u.startsWith(s+".")){let d=u.substring(s.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:p,type:"prop_string",prop:d});else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}if(a){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 o=t[p];l[p]={id:o.id,title:o.title!=null?String(o.title):"",completed:o.completed}}else for(let p=0;p<t.length;p++){let o=t[p],c={};for(let u of n)if(u.type==="literal")c[u.key]=u.value;else if(u.type==="item")c[u.key]=o;else if(u.type==="prop")c[u.key]=o[u.prop];else if(u.type==="item_string")c[u.key]=o!=null?String(o):"";else if(u.type==="prop_string"){let d=o[u.prop];c[u.key]=d!=null?String(d):""}l[p]=c}return l}}return null},Op=(e,t,r,s,i)=>{let n=[],a=e.body;if(a.type===v.OBJECT&&a.fast!==!1){let l=e.itemVar,p=e.indexVar;for(let o=0;o<i.length;o++){let c=i[o],u={},d={...s,[l]:c,...p&&{[p]:o}};d.__paths__||(d.__paths__=s.__paths__||{});let h=e.iterable.path||"";if(s&&s.__paths__&&h){let f=h.split("."),m=f[0];m in s.__paths__&&(h=s.__paths__[m],f.length>1&&(h+="."+f.slice(1).join(".")))}d.__paths__={...d.__paths__,[l]:`${h}[${o}]`,...p&&{[p]:o}};for(let f of a.properties){let m=f.parsedKey?I(f.parsedKey,t,r,d):f.key,g=f.value;if(g.type===v.LITERAL)u[m]=g.value;else if(g.type===v.VARIABLE){let y=g.path;if(y===l)u[m]=c;else if(y===p)u[m]=o;else if(y.startsWith(l+".")){let w=y.substring(l.length+1);!w.includes(".")&&!w.includes("[")?u[m]=c[w]:u[m]=F(y,r,{...s,[l]:c,...p&&{[p]:o}})}else u[m]=F(y,r,{...s,[l]:c,...p&&{[p]:o}})}else if(g.type===v.INTERPOLATION){let y=[];for(let w of g.parts)if(typeof w=="string")y.push(w);else if(w.type===v.VARIABLE){let x=w.path,_;if(x===l)_=c;else if(x===p)_=o;else if(x.startsWith(l+".")){let A=x.substring(l.length+1);!A.includes(".")&&!A.includes("[")?_=c[A]:_=F(x,r,{...s,[l]:c,...p&&{[p]:o}})}else _=F(x,r,{...s,[l]:c,...p&&{[p]:o}});y.push(_!=null?String(_):"")}else{let x={...s,[l]:c,...p&&{[p]:o}},_=I(w,t,r,x);y.push(_!=null?String(_):"")}u[m]=y.join("")}else{let y={...s,[l]:c,...p&&{[p]:o}};u[m]=I(g,t,r,y)}}n.push(u)}return n}return null},Tp=(e,t,r)=>{let s=e.body;if(s.type===v.OBJECT&&s.properties.length===1&&s.properties[0].key==="$if item.visible"){let n=s.properties[0].value;if(n.type===v.CONDITIONAL&&n.conditions.length===1&&n.conditions[0].type===v.VARIABLE&&n.conditions[0].path==="item.visible"){let a=n.bodies[0];if(a.type===v.OBJECT&&a.properties.length===2){let l=a.properties[0],p=a.properties[1];if(l.key==="id"&&l.value.type===v.VARIABLE&&l.value.path==="item.id"&&p.key==="$if item.highlighted"&&p.value.type===v.CONDITIONAL){let o=[];for(let c=0;c<t.length;c++){let u=t[c];if(u.visible){let d={id:u.id};u.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${u.name}`):(d.highlight=!1,d.message=u.name),o.push(d)}}return o}}}}return null},Lp=(e,t,r,s)=>{let i=I(e.iterable,t,r,s);if(!Array.isArray(i)){let o,c=!1;if(e.iterable.type===v.FUNCTION){c=!0;let d=e.iterable.args.map(h=>h.type===v.LITERAL?typeof h.value=="string"?`'${h.value}'`:String(h.value):h.type===v.VARIABLE?h.path:h.type===v.FUNCTION?`${h.name}(...)`:"?").join(", ");o=`${e.iterable.name}(${d})`}else o=e.iterable.path||"undefined";let u=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${o}`;throw ti(u,i,c)}if(!e.indexVar){let o=Tp(e,i,e.itemVar);if(o!==null)return o}if(!e.indexVar){let o=Ip(e,i);if(o!==null)return o}let n=Op(e,t,r,s,i);if(n!==null)return n;let a=[],l=e.iterable.path||"";if(s&&s.__paths__&&l){let o=l.split("."),c=o[0];c in s.__paths__&&(l=s.__paths__[c],o.length>1&&(l+="."+o.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(o=>o.type===v.OBJECT&&o.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let o=0;o<i.length;o++){let c=e.indexVar?{...s,[e.itemVar]:i[o],[e.indexVar]:o}:{...s,[e.itemVar]:i[o]};c.__paths__||(c.__paths__=s.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${l}[${o}]`},e.indexVar&&(c.__paths__[e.indexVar]=o);let u=I(e.body,t,r,c);Array.isArray(u)&&u.length===1&&!p?a.push(u[0]):a.push(u)}return a},Rp=(e,t,r,s)=>{if(e.whenCondition)return null;if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?I(i.parsedKey,t,r,s):i.key,a=i.value;if(a.type===v.OBJECT&&a.properties.length<=10&&!a.whenCondition){let l={},p={},o=!0;for(let c of a.properties){let u=c.parsedKey?I(c.parsedKey,t,r,s):c.key,d=c.value;if(d.type===v.LITERAL)p[u]=d.value;else if(d.type===v.VARIABLE)p[u]=F(d.path,r,s);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 m=F(f.path,r,s);h.push(m!=null?String(m):"")}else{o=!1;break}if(!o)break;p[u]=h.join("")}else if(d.type===v.OBJECT&&d.properties.length<=5){let h={};for(let f of d.properties){let m=f.key,g=f.value;if(g.type===v.LITERAL)h[m]=g.value;else if(g.type===v.VARIABLE)h[m]=F(g.path,r,s);else if(g.type===v.INTERPOLATION){let y=[];for(let w of g.parts)if(typeof w=="string")y.push(w);else if(w.type===v.VARIABLE){let x=F(w.path,r,s);y.push(x!=null?String(x):"")}else{o=!1;break}if(!o)break;h[m]=y.join("")}else{o=!1;break}}if(!o)break;p[u]=h}else{o=!1;break}}if(o)return l[n]=p,l}}return null},Np=(e,t,r,s)=>{let i=t.functions||t;if(e.whenCondition&&!ke(e.whenCondition,i,r,s))return;let n=Rp(e,t,r,s);if(n!==null)return n;if(e.fast){let o={};for(let c of e.properties){let u=c.parsedKey?I(c.parsedKey,t,r,s):c.key,d=c.value;if(d.type===v.LITERAL)o[u]=d.value;else if(d.type===v.VARIABLE)o[u]=F(d.path,r,s);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 m=F(f.path,r,s);h.push(m!=null?String(m):"")}else{let m=I(f,t,r,s);h.push(m!=null?String(m):"")}o[u]=h.join("")}else o[u]=I(d,t,r,s)}return o}let a={},l=null,p=!1;for(let o of e.properties)if(!o.key.startsWith("$if ")&&!o.key.match(/^\$if\s+\w+.*:?$/)&&!o.key.startsWith("$elif")&&!o.key.startsWith("$else")&&!o.key.startsWith("$for ")){p=!0;break}for(let o of e.properties)if(o.key.startsWith("$if ")||o.key.match(/^\$if\s+\w+.*:?$/)){let c=I(o.value,t,r,s);if(!p&&c!==null&&c!==void 0)return Array.isArray(c)&&c.length===1?c[0]:c;typeof c=="object"&&c!==null&&!Array.isArray(c)&&Object.assign(a,c)}else if(o.key.startsWith("$for ")){if(e.properties.length===1)return I(o.value,t,r,s)}else{let c=o.value;if(c&&c.type===v.OBJECT&&c.properties){let u=c.properties.find(d=>d.key.startsWith("$for "));if(u){let d=I(u.value,t,r,s);d!==void 0&&(a[o.key]=d)}else{let d=I(o.value,t,r,s);d!==void 0&&(a[o.key]=d)}}else{let u=o.parsedKey?I(o.parsedKey,t,r,s):o.key,d=I(o.value,t,r,s);d!==void 0&&(a[u]=d)}}return a},oi={},Pp=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===v.LOOP){let a=I(n,t,r,s);i.push(a)}else{let a=I(n,t,r,s);a!==oi&&a!==void 0&&i.push(a)}return i},Vp=(e,t,r,s)=>{let{name:i,data:n,whenCondition:a}=e,l=t.partials||{},p=t.functions||t;if(a&&!ke(a,p,r,s))return;if(!l[i])throw new Q(`Partial '${i}' is not defined`);let o=s._partialStack||[];if(o.includes(i))throw new Q(`Circular partial reference detected: ${i}`);let c=l[i],u=r,d={...s,_partialStack:[...o,i]};if(s){u={...r};for(let h of Object.keys(s))h.startsWith("_")||(u[h]=s[h])}if(n){let h=I(n,t,r,s);u={...u,...h}}return I(c,t,u,d)},Dp=(e,t,r,s)=>{let{path:i}=e,n=i.split("."),a=n[0],l=n.slice(1);if(!s||!(a in s))throw new Q(`Path reference '#{${i}}' refers to '${a}' which is not a loop variable in the current scope`);if(s.__paths__||(s.__paths__={}),!(a in s.__paths__))throw new Q(`Path reference '#{${i}}' cannot be resolved - path tracking may not be initialized properly`);let p=s.__paths__[a];if(typeof p=="number"){if(l.length>0)throw new Q(`Path reference '#{${i}}' - cannot access properties on index variable '${a}'`);return String(p)}return l.length>0&&(p+="."+l.join(".")),p},We=Ap;var Bp=/\$\{([^}]*)\}/g,jp=/#\{([^}]*)\}/g,pi=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,s,i]=r,n=Wp(i,t);return{isFunction:!0,type:v.FUNCTION,name:s,args:n}},Wp=(e,t={})=>e.trim()?Mp(e).map(s=>Fp(s.trim(),t)):[],Mp=e=>{let t=[],r="",s=0,i=!1,n="";for(let a=0;a<e.length;a++){let l=e[a],p=a>0?e[a-1]:"";!i&&(l==='"'||l==="'")?(i=!0,n=l,r+=l):i&&l===n&&p!=="\\"?(i=!1,n="",r+=l):!i&&l==="("?(s++,r+=l):!i&&l===")"?(s--,r+=l):!i&&l===","&&s===0?(t.push(r),r=""):r+=l}return r&&t.push(r),t},Fp=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:v.LITERAL,value:parseFloat(e)};if(e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};let r=pi(e,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};let s=e.trim(),i=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1,a=null;for(let{op:l,type:p}of i){let o=0;for(;o<s.length;){let c=ve(s.substring(o),l);if(c===-1)break;let u=o+c;u>n&&(n=u,a={op:l,type:p}),o=u+l.length}}if(n!==-1)try{return Y(s,t)}catch{return{type:v.VARIABLE,path:s}}return{type:v.VARIABLE,path:s}},ci=/^\w+\(.*\)$/,zp=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,Up=e=>{if(!(!e||e.trim()===""||ci.test(e))&&zp.test(e))throw e.includes("?")&&e.includes(":")?new O(`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 O(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new O(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},li=e=>{let t=e.trim();if(ci.test(t))throw new O(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new O(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new O(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new O(`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 O(`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}},Me=(e,t={})=>{let r=e.trim();Up(r);let s=pi(r,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};if(r.includes("[")&&!/[\s+\-*/%|&?:]/.test(r)){let i=0;for(let n of r)n==="["?i++:n==="]"&&i--;if(i!==0)throw new Error("Invalid array index syntax")}return{type:v.VARIABLE,path:r}},fr=(e,t={})=>{let r=e,s=[];(e.includes("\\${")||e.includes("\\#{"))&&(r=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),r=r.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),r=r.replace(/\\(\$\{[^}]*\})/g,(o,c)=>{let u=`__ESCAPED_${s.length}__`;return s.push(c),u}),r=r.replace(/\\(#\{[^}]*\})/g,(o,c)=>{let u=`__ESCAPED_${s.length}__`;return s.push(c),u}),r=r.replace(/\\DOUBLE_ESC_VAR/g,"\\"),r=r.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let i=[...r.matchAll(Bp)],n=[...r.matchAll(jp)],a=[...i.map(o=>({match:o,type:"variable"})),...n.map(o=>({match:o,type:"pathref"}))].sort((o,c)=>o.match.index-c.match.index);if(a.length===0){let o=r;for(let c=0;c<s.length;c++)o=o.replace(`__ESCAPED_${c}__`,s[c]);return{type:v.LITERAL,value:o}}if(a.length===1&&a[0].match[0]===r&&s.length===0){let{match:o,type:c}=a[0];try{return c==="variable"?Me(o[1],t):li(o[1])}catch(u){if(u.message==="Invalid array index syntax")return{type:v.LITERAL,value:r};throw u}}let l=[],p=0;for(let{match:o,type:c}of a){let[u,d]=o,h=o.index;if(h>p){let f=r.substring(p,h);for(let m=0;m<s.length;m++)f=f.replace(`__ESCAPED_${m}__`,s[m]);f&&l.push(f)}try{let f;c==="variable"?f=Me(d.trim(),t):f=li(d.trim()),l.push(f)}catch(f){if(f.message==="Invalid array index syntax")l.push(u);else throw f}p=h+u.length}if(p<r.length){let o=r.substring(p);for(let c=0;c<s.length;c++)o=o.replace(`__ESCAPED_${c}__`,s[c]);o&&l.push(o)}return{type:v.INTERPOLATION,parts:l}};var me=(e,t)=>typeof e=="string"?fr(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Kp(e,t):Hp(e,t):{type:v.LITERAL,value:e},Kp=(e,t)=>{let r=[],s=!1;for(let i=0;i<e.length;i++){let n=e[i];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){let l=Object.keys(n);if(l.length===1&&l[0].startsWith("$for ")){let p=di(l[0],n[l[0]],t);r.push(p),s=!0;continue}}let a=me(n,t);r.push(a),(a.type===v.FUNCTION||a.type===v.CONDITIONAL||a.type===v.LOOP||a.type===v.PARTIAL||a.type===v.OBJECT&&!a.fast||a.type===v.ARRAY&&!a.fast)&&(s=!0)}return{type:v.ARRAY,items:r,fast:!s}},Hp=(e,t)=>{let r=[],s=!1,i=null,n=Object.entries(e),a=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new O("$partial value must be a string");if(e.$partial.trim()==="")throw new O("$partial value cannot be an empty string");let p=["$if","$elif","$else","$for"],o=[];for(let[y]of n)for(let w of p)if(y===w||y.startsWith(w+" ")||y.startsWith(w+"#")){o.push(w);break}if(o.length>0)throw new O(`Cannot use $partial with ${o.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:u,...d}=e,h={},f=!1;for(let[y,w]of Object.entries(d)){let x=y;(y.startsWith("\\$")||y.startsWith("$$"))&&(x=y.slice(1)),h[x]=w,f=!0}let m=null;if(f&&(m=me(h,t),m.type===v.OBJECT)){let y=!1;for(let w of m.properties)if(w.value.type===v.VARIABLE||w.value.type===v.INTERPOLATION||w.value.type===v.FUNCTION||w.value.type===v.CONDITIONAL||w.value.type===v.LOOP||w.value.type===v.OBJECT&&!w.value.fast||w.value.type===v.ARRAY&&!w.value.fast){y=!0;break}y&&(m.fast=!1)}let g={type:v.PARTIAL,name:c,data:m};if(u!==void 0){let y;if(typeof u=="string"){if(u.trim()==="")throw new O("Empty condition expression after '$when'");y=Y(u,t)}else y={type:v.LITERAL,value:u};g.whenCondition=y}return g}for(let[p,o]of n)if(p==="$when"){if(i!==null)throw new O("Multiple '$when' directives on the same object are not allowed");if(o==null)throw new O("Missing condition expression after '$when'");let c=typeof o=="string"?o:JSON.stringify(o);if(c.trim()==="")throw new O("Empty condition expression after '$when'");i=Y(c,t),s=!0}else if(p.startsWith("$when#")||p.startsWith("$when "))throw new O("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;a<n.length;){let[p,o]=n[a];if(p==="$when"){a++;continue}if(p.startsWith("$if ")||p.match(/^\$if#\w+\s/)||p.match(/^\$if\s+\w+.*:$/)){let c=Gp(n,a,t);r.push({key:p,value:c.node}),s=!0,a=c.nextIndex}else if(p.startsWith("$for ")){let c=di(p,o,t);r.push({key:p,value:c}),s=!0,a++}else{if(p.startsWith("$elif ")||p.startsWith("$else"))throw new O(`'${p.split(" ")[0]}' without matching '$if'`);if(p==="$if"||p==="$if:")throw new O("Missing condition expression after '$if'");{let c=me(o,t);(c.type===v.FUNCTION||c.type===v.CONDITIONAL||c.type===v.LOOP||c.type===v.PARTIAL||c.type===v.OBJECT&&!c.fast||c.type===v.ARRAY&&!c.fast)&&(s=!0);let u=fr(p,t),d={key:p,value:c};(u.type!==v.LITERAL||u.value!==p)&&(d.parsedKey=u),r.push(d),a++}}}let l={type:v.OBJECT,properties:r,fast:!s};return i&&(l.whenCondition=i),l},Gp=(e,t,r={})=>{let s=[],i=[],n=t,[a,l]=e[n],p=null,o;if(a.startsWith("$if#")){let u=a.match(/^\$if#(\w+)\s+(.+)$/);if(u)p=u[1],o=u[2];else throw new O(`Invalid conditional syntax: ${a}`)}else o=a.substring(4),o.endsWith(":")&&(o=o.slice(0,-1).trim());dr(o);let c=Y(o,r);for(s.push(c),i.push(me(l,r)),n++;n<e.length;){let[u,d]=e[n],h=!1,f;if(p?u.startsWith(`$elif#${p} `)?(f=u.substring(`$elif#${p} `.length),f.endsWith(":")&&(f=f.slice(0,-1).trim()),h=!0):(u===`$else#${p}`||u===`$else#${p}:`)&&(h=!0,f=null):u.startsWith("$elif ")?(f=u.substring(6),f.endsWith(":")&&(f=f.slice(0,-1).trim()),h=!0):(u==="$else"||u==="$else:")&&(h=!0,f=null),h){if(f===null)s.push(null);else{dr(f);let m=Y(f,r);s.push(m)}if(i.push(me(d,r)),n++,f===null)break}else break}return{node:{type:v.CONDITIONAL,conditions:s,bodies:i,id:p},nextIndex:n}},Y=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let o=e.slice(1,-1),c=0,u=!0;for(let d=0;d<o.length;d++)if(o[d]==="("?c++:o[d]===")"&&c--,c<0){u=!1;break}if(u&&c===0)return Y(o,t)}let r=ve(e,"||");if(r!==-1)return{type:v.BINARY,op:D.OR,left:Y(e.substring(0,r).trim(),t),right:Y(e.substring(r+2).trim(),t)};let s=ve(e,"&&");if(s!==-1)return{type:v.BINARY,op:D.AND,left:Y(e.substring(0,s).trim(),t),right:Y(e.substring(s+2).trim(),t)};let i=[{op:">=",type:D.GTE},{op:"<=",type:D.LTE},{op:"==",type:D.EQ},{op:"!=",type:D.NEQ},{op:">",type:D.GT},{op:"<",type:D.LT},{op:" in ",type:D.IN}];for(let{op:o,type:c}of i){let u=ve(e,o);if(u!==-1)return{type:v.BINARY,op:c,left:Y(e.substring(0,u).trim(),t),right:Y(e.substring(u+o.length).trim(),t)}}let n=-1,a=null,l=[{op:" + ",type:D.ADD},{op:" - ",type:D.SUBTRACT}];for(let{op:o,type:c}of l){let u=0;for(;u<e.length;){let d=ve(e.substring(u),o);if(d===-1)break;let h=u+d;h>n&&(n=h,a={op:o,type:c}),u=h+o.length}}if(n!==-1&&a)return{type:v.BINARY,op:a.type,left:Y(e.substring(0,n).trim(),t),right:Y(e.substring(n+a.op.length).trim(),t)};let p=[" * "," / "," % "];for(let o of p)if(ve(e,o)!==-1)throw new O(`Arithmetic operations are not allowed in conditionals: "${o}"`);return e.startsWith("!")?{type:v.UNARY,op:je.NOT,operand:Y(e.substring(1).trim(),t)}:ui(e,t)},ve=(e,t)=>{let r=0,s=0;for(;s<=e.length-t.length;){if(e[s]==="(")r++;else if(e[s]===")")r--;else if(r===0&&e.substring(s,s+t.length)===t)return s;s++}return-1},Jp=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}},ui=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return Me(r,t);let i=Jp(r);if(i.type===v.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:v.VARIABLE,path:r};try{return Me(r,t)}catch(n){if(n.message&&n.message.includes("not supported"))return i;throw n}},di=(e,t,r)=>{let s=e.substring(5).trim();ei(s);let i=s.match(/^(.+?)\s+in\s+(.+)$/);if(!i)throw new O(`Invalid loop syntax - missing 'in' keyword (got: '$for ${s}')`);let n=i[1].trim(),a=i[2].trim(),l,p=null;if(n.includes(",")){let u=n.split(",").map(d=>d.trim());if(u.length!==2)throw new O(`Invalid loop variables: ${n}. Expected format: "item" or "item, index"`);l=u[0],p=u[1]}else l=n;let o=ui(a,r),c=me(t,r);return{type:v.LOOP,itemVar:l,indexVar:p,iterable:o,body:c}};var qp=(e,t={})=>{let{functions:r={}}=t;return me(e,r)},Ze=qp;var hr={};R(hr,{now:()=>Yp});var Yp=()=>Date.now();var Xp=(e,t,r={})=>{let{functions:s={},partials:i={}}=r,n={...hr,...s},a=Ze(e,{functions:n}),l={};for(let[p,o]of Object.entries(i))l[p]=Ze(o,{functions:n});return We(a,t,{functions:n,partials:l})},Fe=Xp;var ye=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);var fi=(e,t)=>{!t||typeof t!="object"||Object.entries(t).forEach(([r,s])=>{if(r==="default")throw new Error("[Methods] Invalid method name 'default'. Use named exports in .methods.js; default export is not supported.");if(typeof s=="function"){if(r in e)throw new Error(`[Methods] Cannot define method '${r}' because it already exists on the component instance.`);Object.defineProperty(e,r,{configurable:!0,enumerable:!1,writable:!1,value:(i={})=>{let n=i===void 0?{}:i;if(!ye(n))throw new Error(`[Methods] Method '${r}' expects payload to be an object.`);return s.call(e,n)}})}})};var bi=Symbol.for("immer-nothing"),hi=Symbol.for("immer-draftable"),se=Symbol.for("immer-state");function oe(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Se=Object.getPrototypeOf;function Ce(e){return!!e&&!!e[se]}function we(e){return e?wi(e)||Array.isArray(e)||!!e[hi]||!!e.constructor?.[hi]||st(e)||it(e):!1}var Zp=Object.prototype.constructor.toString();function wi(e){if(!e||typeof e!="object")return!1;let t=Se(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===Zp}function Qe(e,t){rt(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function rt(e){let t=e[se];return t?t.type_:Array.isArray(e)?1:st(e)?2:it(e)?3:0}function gr(e,t){return rt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function xi(e,t,r){let s=rt(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function Qp(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function st(e){return e instanceof Map}function it(e){return e instanceof Set}function be(e){return e.copy_||e.base_}function vr(e,t){if(st(e))return new Map(e);if(it(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=wi(e);if(t===!0||t==="class_only"&&!r){let s=Object.getOwnPropertyDescriptors(e);delete s[se];let i=Reflect.ownKeys(s);for(let n=0;n<i.length;n++){let a=i[n],l=s[a];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(s[a]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[a]})}return Object.create(Se(e),s)}else{let s=Se(e);if(s!==null&&r)return{...e};let i=Object.create(s);return Object.assign(i,e)}}function Ar(e,t=!1){return nt(e)||Ce(e)||!we(e)||(rt(e)>1&&(e.set=e.add=e.clear=e.delete=ec),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>Ar(s,!0))),e}function ec(){oe(2)}function nt(e){return Object.isFrozen(e)}var tc={};function xe(e){let t=tc[e];return t||oe(0,e),t}var ze;function _i(){return ze}function rc(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function mi(e,t){t&&(xe("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function br(e){wr(e),e.drafts_.forEach(sc),e.drafts_=null}function wr(e){e===ze&&(ze=e.parent_)}function yi(e){return ze=rc(ze,e)}function sc(e){let t=e[se];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function gi(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[se].modified_&&(br(t),oe(4)),we(e)&&(e=et(t,e),t.parent_||tt(t,e)),t.patches_&&xe("Patches").generateReplacementPatches_(r[se].base_,e,t.patches_,t.inversePatches_)):e=et(t,r,[]),br(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==bi?e:void 0}function et(e,t,r){if(nt(t))return t;let s=t[se];if(!s)return Qe(t,(i,n)=>vi(e,s,t,i,n,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return tt(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;let i=s.copy_,n=i,a=!1;s.type_===3&&(n=new Set(i),i.clear(),a=!0),Qe(n,(l,p)=>vi(e,s,i,l,p,r,a)),tt(e,i,!1),r&&e.patches_&&xe("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function vi(e,t,r,s,i,n,a){if(Ce(i)){let l=n&&t&&t.type_!==3&&!gr(t.assigned_,s)?n.concat(s):void 0,p=et(e,i,l);if(xi(r,s,p),Ce(p))e.canAutoFreeze_=!1;else return}else a&&r.add(i);if(we(i)&&!nt(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;et(e,i),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&tt(e,i)}}function tt(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ar(t,r)}function ic(e,t){let r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:_i(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=s,n=Er;r&&(i=[s],n=Ue);let{revoke:a,proxy:l}=Proxy.revocable(i,n);return s.draft_=l,s.revoke_=a,l}var Er={get(e,t){if(t===se)return e;let r=be(e);if(!gr(r,t))return nc(e,r,t);let s=r[t];return e.finalized_||!we(s)?s:s===mr(e.base_,t)?(yr(e),e.copy_[t]=_r(s,e)):s},has(e,t){return t in be(e)},ownKeys(e){return Reflect.ownKeys(be(e))},set(e,t,r){let s=Ai(be(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let i=mr(be(e),t),n=i?.[se];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Qp(r,i)&&(r!==void 0||gr(e.base_,t)))return!0;yr(e),xr(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return mr(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,yr(e),xr(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=be(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){oe(11)},getPrototypeOf(e){return Se(e.base_)},setPrototypeOf(){oe(12)}},Ue={};Qe(Er,(e,t)=>{Ue[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ue.deleteProperty=function(e,t){return Ue.set.call(this,e,t,void 0)};Ue.set=function(e,t,r){return Er.set.call(this,e[0],t,r,e[0])};function mr(e,t){let r=e[se];return(r?be(r):e)[t]}function nc(e,t,r){let s=Ai(t,r);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function Ai(e,t){if(!(t in e))return;let r=Se(e);for(;r;){let s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=Se(r)}}function xr(e){e.modified_||(e.modified_=!0,e.parent_&&xr(e.parent_))}function yr(e){e.copy_||(e.copy_=vr(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var ac=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,s)=>{if(typeof t=="function"&&typeof r!="function"){let n=r;r=t;let a=this;return function(p=n,...o){return a.produce(p,c=>r.call(this,c,...o))}}typeof r!="function"&&oe(6),s!==void 0&&typeof s!="function"&&oe(7);let i;if(we(t)){let n=yi(this),a=_r(t,void 0),l=!0;try{i=r(a),l=!1}finally{l?br(n):wr(n)}return mi(n,s),gi(i,n)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===bi&&(i=void 0),this.autoFreeze_&&Ar(i,!0),s){let n=[],a=[];xe("Patches").generateReplacementPatches_(t,i,n,a),s(n,a)}return i}else oe(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...l)=>this.produceWithPatches(a,p=>t(p,...l));let s,i;return[this.produce(t,r,(a,l)=>{s=a,i=l}),s,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){we(e)||oe(8),Ce(e)&&(e=oc(e));let t=yi(this),r=_r(e,void 0);return r[se].isManual_=!0,wr(t),r}finishDraft(e,t){let r=e&&e[se];(!r||!r.isManual_)&&oe(9);let{scope_:s}=r;return mi(s,t),gi(void 0,s)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));let s=xe("Patches").applyPatches_;return Ce(e)?s(e,t):this.produce(e,i=>s(i,t))}};function _r(e,t){let r=st(e)?xe("MapSet").proxyMap_(e,t):it(e)?xe("MapSet").proxySet_(e,t):ic(e,t);return(t?t.scope_:_i()).drafts_.push(r),r}function oc(e){return Ce(e)||oe(10,e),Ei(e)}function Ei(e){if(!we(e)||nt(e))return e;let t=e[se],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=vr(e,t.scope_.immer_.useStrictShallowCopy_)}else r=vr(e,!0);return Qe(r,(s,i)=>{xi(r,s,Ei(i))}),t&&(t.finalized_=!1),r}var ie=new ac,$i=ie.produce,ch=ie.produceWithPatches.bind(ie),uh=ie.setAutoFreeze.bind(ie),dh=ie.setUseStrictShallowCopy.bind(ie),fh=ie.applyPatches.bind(ie),hh=ie.createDraft.bind(ie),mh=ie.finishDraft.bind(ie);var ki=(e,t,r)=>{let{createInitialState:s,...i}=e,n={},a={},l={};return s&&(l=s({props:t,constants:r})),Object.entries(i).forEach(([p,o])=>{if(p.startsWith("select")){n[p]=(...c)=>o({state:l,props:t,constants:r},...c);return}a[p]=(c={})=>{let u=c===void 0?{}:c;if(!ye(u))throw new Error(`[Store] Action '${p}' expects payload to be an object.`);return l=$i(l,d=>o({state:d,props:t,constants:r},u)),l}}),{getState:()=>l,...a,...n}};var Si=e=>!ye(e)||Object.isFrozen(e)?e:(Object.values(e).forEach(t=>{Si(t)}),Object.freeze(e)),Ci=({setupConstants:e,fileConstants:t})=>{let r=ye(e)?e:{},s=ye(t)?t:{};return Si({...r,...s})};var Ii=(e,t)=>{if(!t||typeof t!="object")return"";let r="",s=n=>Object.entries(n).map(([a,l])=>` ${a}: ${l};`).join(`
|
|
922
|
+
`),i=(n,a)=>{if(typeof a!="object"||a===null)return"";if(n.startsWith("@")){let p=Object.entries(a).map(([o,c])=>{let u=s(c);return` ${o} {
|
|
923
|
+
${u.split(`
|
|
924
|
+
`).map(d=>d?` ${d}`:"").join(`
|
|
985
925
|
`)}
|
|
986
926
|
}`}).join(`
|
|
987
|
-
`);return`${
|
|
988
|
-
${
|
|
989
|
-
}`}
|
|
927
|
+
`);return`${n} {
|
|
928
|
+
${p}
|
|
929
|
+
}`}let l=s(a);return`${n} {
|
|
990
930
|
${l}
|
|
991
|
-
}`}
|
|
992
|
-
|
|
993
|
-
`:"")+l)}),r},Nl=e=>{let t=e.map(r=>r.subscribe());return()=>{for(let r of t)r&&typeof r.unsubscribe=="function"&&r.unsubscribe()}};function Vl(e){return new Proxy({},{get(t,r){if(typeof r=="string"){let s=e.getAttribute(r);return s===""?!0:s}},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(t,r){return typeof r=="string"&&e.hasAttribute(r)},ownKeys(){return e.getAttributeNames()},getOwnPropertyDescriptor(t,r){if(typeof r=="string"&&e.hasAttribute(r))return{configurable:!0,enumerable:!0,get:()=>e.getAttribute(r)}}})}function Pl(e,t){let r=new Set(t);return new Proxy({},{get(s,n){if(typeof n=="string"&&r.has(n))return e[n]},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(s,n){return typeof n=="string"&&r.has(n)},ownKeys(){return[...r]},getOwnPropertyDescriptor(s,n){if(typeof n=="string"&&r.has(n))return{configurable:!0,enumerable:!0,get:()=>e[n]}}})}var cr=class extends HTMLElement{elementName;styles;h;store;props;propsSchema;template;handlers;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_oldVNode;deps;cssText;static get observedAttributes(){return["key"]}get viewData(){let t={};return this.store.selectViewData&&(t=this.store.selectViewData()),t}connectedCallback(){this.shadow=this.attachShadow({mode:"open"});let t=new CSSStyleSheet;t.replaceSync(`
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
`);let r=[t];if(this.cssText){let n=new CSSStyleSheet;n.replaceSync(this.cssText),r.push(n)}this.shadow.adoptedStyleSheets=r,this.renderTarget=document.createElement("div"),this.renderTarget.style.cssText="display: contents;",this.shadow.appendChild(this.renderTarget),this.renderTarget.parentNode||this.appendChild(this.renderTarget),this.style.display="contents";let s={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this)};if(this.transformedHandlers={handleCallStoreAction:n=>{let{render:i,store:a}=s,{_event:l,_action:p}=n,o=pr(n,{event:l});if(console.log("context",o),!a[p])throw new Error(`store action store.${a._action} is not defined`);a[p](o),i()}},Object.keys(this.handlers||{}).forEach(n=>{this.transformedHandlers[n]=(i,a)=>this.handlers[n](s,i,a)}),this.handlers?.handleBeforeMount&&(this._unmountCallback=this.handlers?.handleBeforeMount(s),this._unmountCallback&&typeof this._unmountCallback.then=="function"))throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");this.render(),this.handlers?.handleAfterMount&&this.handlers?.handleAfterMount(s),this.handlers?.subscriptions&&(this.unsubscribeAll=Nl(this.handlers.subscriptions(s)))}disconnectedCallback(){this._unmountCallback&&this._unmountCallback(),this.unsubscribeAll&&this.unsubscribeAll()}attributeChangedCallback(t,r,s){if(r!==s&&this.render)if(this.handlers?.handleOnUpdate){let n={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this),store:this.store,render:this.render.bind(this)},i={oldAttrs:{[t]:r},newAttrs:{[t]:s},oldProps:n.props,newProps:n.props};this.handlers.handleOnUpdate(n,i)}else requestAnimationFrame(()=>{this.render()})}render=()=>{if(!this.patch){console.error("Patch function is not defined!");return}if(!this.template){console.error("Template is not defined!");return}try{let t={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this),store:this.store,render:this.render.bind(this)},r=Fs({h:this.h,template:this.template,viewData:this.viewData,refs:this.refs,handlers:this.transformedHandlers}),s={},n=i=>{i.data?.attrs&&i.data.attrs.id&&(s[i.data.attrs.id]=i),i.children&&i.children.forEach(n)};n(r),this.refIds=s,this._oldVNode?this._oldVNode=this.patch(this._oldVNode,r):this._oldVNode=this.patch(this.renderTarget,r)}catch(t){console.error("Error during patching:",t)}}},Dl=(e,t,r)=>{let{createInitialState:s,...n}=e,i={},a={},l={};return s&&(l=s()),Object.entries(n).forEach(([p,o])=>{p.startsWith("select")?i[p]=(...c)=>o({state:l,props:t,attrs:r},...c):a[p]=c=>(l=Ss(l,u=>o(u,c)),l)}),{getState:()=>l,...a,...i}},jl=({handlers:e,view:t,store:r,patch:s,h:n},i)=>{let{elementName:a,propsSchema:l,attrsSchema:p,template:o,refs:c,styles:u}=t;if(!s)throw new Error("Patch is not defined");if(!n)throw new Error("h is not defined");if(!t)throw new Error("view is not defined");class d extends cr{static get observedAttributes(){let h=["key"],y=p?.properties?Object.keys(p.properties):[];return[...h,...y]}constructor(){super();let h=Vl(this);this.propsSchema=l,this.props=l?Pl(this,Object.keys(l.properties)):{},this.elementName=a,this.styles=u,this.store=Dl(r,this.props,h),this.template=o,this.handlers=e,this.refs=c,this.patch=s,this.deps={...i,store:this.store,render:this.render,handlers:e,attrs:h,props:this.props},this.h=n,this.cssText=Rl(a,u)}}return d},ur=jl;function ve(e,t,r,s,n){let i=t===void 0?void 0:t.key;return{sel:e,data:t,children:r,text:s,elm:n,key:i}}var $e=Array.isArray;function Se(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function Bl(e,t){return document.createElement(e,t)}function Wl(e,t,r){return document.createElementNS(e,t,r)}function Ml(){return be(document.createDocumentFragment())}function Fl(e){return document.createTextNode(e)}function Kl(e){return document.createComment(e)}function Ul(e,t,r){if(pe(e)){let s=e;for(;s&&pe(s);)s=be(s).parent;e=s??e}pe(t)&&(t=be(t,e)),r&&pe(r)&&(r=be(r).firstChildNode),e.insertBefore(t,r)}function zl(e,t){e.removeChild(t)}function Hl(e,t){pe(t)&&(t=be(t,e)),e.appendChild(t)}function Us(e){if(pe(e)){for(;e&&pe(e);)e=be(e).parent;return e??null}return e.parentNode}function Jl(e){var t;if(pe(e)){let r=be(e),s=Us(r);if(s&&r.lastChildNode){let n=Array.from(s.childNodes),i=n.indexOf(r.lastChildNode);return(t=n[i+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function ql(e){return e.tagName}function Gl(e,t){e.textContent=t}function Yl(e){return e.textContent}function Xl(e){return e.nodeType===1}function Ql(e){return e.nodeType===3}function Zl(e){return e.nodeType===8}function pe(e){return e.nodeType===11}function be(e,t){var r,s,n;let i=e;return(r=i.parent)!==null&&r!==void 0||(i.parent=t??null),(s=i.firstChildNode)!==null&&s!==void 0||(i.firstChildNode=e.firstChild),(n=i.lastChildNode)!==null&&n!==void 0||(i.lastChildNode=e.lastChild),i}var zs={createElement:Bl,createElementNS:Wl,createTextNode:Fl,createDocumentFragment:Ml,createComment:Kl,insertBefore:Ul,removeChild:zl,appendChild:Hl,parentNode:Us,nextSibling:Jl,tagName:ql,setTextContent:Gl,getTextContent:Yl,isElement:Xl,isText:Ql,isComment:Zl,isDocumentFragment:pe};function Ze(e){return e===void 0}function re(e){return e!==void 0}var dr=ve("",{},[],void 0,void 0);function je(e,t){var r,s;let n=e.key===t.key,i=((r=e.data)===null||r===void 0?void 0:r.is)===((s=t.data)===null||s===void 0?void 0:s.is),a=e.sel===t.sel,l=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return a&&n&&i&&l}function ep(){throw new Error("The document fragment is not supported on this platform.")}function tp(e,t){return e.isElement(t)}function rp(e,t){return e.isDocumentFragment(t)}function sp(e,t,r){var s;let n={};for(let i=t;i<=r;++i){let a=(s=e[i])===null||s===void 0?void 0:s.key;a!==void 0&&(n[a]=i)}return n}var ip=["create","update","remove","destroy","pre","post"];function Hs(e,t,r){let s={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},n=t!==void 0?t:zs;for(let h of ip)for(let y of e){let b=y[h];b!==void 0&&s[h].push(b)}function i(h){let y=h.id?"#"+h.id:"",b=h.getAttribute("class"),m=b?"."+b.split(" ").join("."):"";return ve(n.tagName(h).toLowerCase()+y+m,{},[],void 0,h)}function a(h){return ve(void 0,{},[],void 0,h)}function l(h,y){return function(){if(--y===0){let m=n.parentNode(h);m!==null&&n.removeChild(m,h)}}}function p(h,y){var b,m,w,_;let x,E=h.data;if(E!==void 0){let S=(b=E.hook)===null||b===void 0?void 0:b.init;re(S)&&(S(h),E=h.data)}let $=h.children,I=h.sel;if(I==="!")Ze(h.text)&&(h.text=""),h.elm=n.createComment(h.text);else if(I==="")h.elm=n.createTextNode(h.text);else if(I!==void 0){let S=I.indexOf("#"),V=I.indexOf(".",S),D=S>0?S:I.length,C=V>0?V:I.length,A=S!==-1||V!==-1?I.slice(0,Math.min(D,C)):I,B=h.elm=re(E)&&re(x=E.ns)?n.createElementNS(x,A,E):n.createElement(A,E);for(D<C&&B.setAttribute("id",I.slice(D+1,C)),V>0&&B.setAttribute("class",I.slice(C+1).replace(/\./g," ")),x=0;x<s.create.length;++x)s.create[x](dr,h);if(Se(h.text)&&(!$e($)||$.length===0)&&n.appendChild(B,n.createTextNode(h.text)),$e($))for(x=0;x<$.length;++x){let F=$[x];F!=null&&n.appendChild(B,p(F,y))}let K=h.data.hook;re(K)&&((m=K.create)===null||m===void 0||m.call(K,dr,h),K.insert&&y.push(h))}else if(!((w=r?.experimental)===null||w===void 0)&&w.fragments&&h.children){for(h.elm=((_=n.createDocumentFragment)!==null&&_!==void 0?_:ep)(),x=0;x<s.create.length;++x)s.create[x](dr,h);for(x=0;x<h.children.length;++x){let S=h.children[x];S!=null&&n.appendChild(h.elm,p(S,y))}}else h.elm=n.createTextNode(h.text);return h.elm}function o(h,y,b,m,w,_){for(;m<=w;++m){let x=b[m];x!=null&&n.insertBefore(h,p(x,_),y)}}function c(h){var y,b;let m=h.data;if(m!==void 0){(b=(y=m?.hook)===null||y===void 0?void 0:y.destroy)===null||b===void 0||b.call(y,h);for(let w=0;w<s.destroy.length;++w)s.destroy[w](h);if(h.children!==void 0)for(let w=0;w<h.children.length;++w){let _=h.children[w];_!=null&&typeof _!="string"&&c(_)}}}function u(h,y,b,m){for(var w,_;b<=m;++b){let x,E,$=y[b];if($!=null)if(re($.sel)){c($),x=s.remove.length+1,E=l($.elm,x);for(let S=0;S<s.remove.length;++S)s.remove[S]($,E);let I=(_=(w=$?.data)===null||w===void 0?void 0:w.hook)===null||_===void 0?void 0:_.remove;re(I)?I($,E):E()}else $.children?(c($),u(h,$.children,0,$.children.length-1)):n.removeChild(h,$.elm)}}function d(h,y,b,m){let w=0,_=0,x=y.length-1,E=y[0],$=y[x],I=b.length-1,S=b[0],V=b[I],D,C,A,B;for(;w<=x&&_<=I;)E==null?E=y[++w]:$==null?$=y[--x]:S==null?S=b[++_]:V==null?V=b[--I]:je(E,S)?(f(E,S,m),E=y[++w],S=b[++_]):je($,V)?(f($,V,m),$=y[--x],V=b[--I]):je(E,V)?(f(E,V,m),n.insertBefore(h,E.elm,n.nextSibling($.elm)),E=y[++w],V=b[--I]):je($,S)?(f($,S,m),n.insertBefore(h,$.elm,E.elm),$=y[--x],S=b[++_]):(D===void 0&&(D=sp(y,w,x)),C=D[S.key],Ze(C)?(n.insertBefore(h,p(S,m),E.elm),S=b[++_]):Ze(D[V.key])?(n.insertBefore(h,p(V,m),n.nextSibling($.elm)),V=b[--I]):(A=y[C],A.sel!==S.sel?n.insertBefore(h,p(S,m),E.elm):(f(A,S,m),y[C]=void 0,n.insertBefore(h,A.elm,E.elm)),S=b[++_]));_<=I&&(B=b[I+1]==null?null:b[I+1].elm,o(h,B,b,_,I,m)),w<=x&&u(h,y,w,x)}function f(h,y,b){var m,w,_,x,E,$,I,S;let V=(m=y.data)===null||m===void 0?void 0:m.hook;(w=V?.prepatch)===null||w===void 0||w.call(V,h,y);let D=y.elm=h.elm;if(h===y)return;if(y.data!==void 0||re(y.text)&&y.text!==h.text){(_=y.data)!==null&&_!==void 0||(y.data={}),(x=h.data)!==null&&x!==void 0||(h.data={});for(let B=0;B<s.update.length;++B)s.update[B](h,y);(I=($=(E=y.data)===null||E===void 0?void 0:E.hook)===null||$===void 0?void 0:$.update)===null||I===void 0||I.call($,h,y)}let C=h.children,A=y.children;Ze(y.text)?re(C)&&re(A)?C!==A&&d(D,C,A,b):re(A)?(re(h.text)&&n.setTextContent(D,""),o(D,null,A,0,A.length-1,b)):re(C)?u(D,C,0,C.length-1):re(h.text)&&n.setTextContent(D,""):h.text!==y.text&&(re(C)&&u(D,C,0,C.length-1),n.setTextContent(D,y.text)),(S=V?.postpatch)===null||S===void 0||S.call(V,h,y)}return function(y,b){let m,w,_,x=[];for(m=0;m<s.pre.length;++m)s.pre[m]();for(tp(n,y)?y=i(y):rp(n,y)&&(y=a(y)),je(y,b)?f(y,b,x):(w=y.elm,_=n.parentNode(w),p(b,x),_!==null&&(n.insertBefore(_,b.elm,n.nextSibling(w)),u(_,[y],0,0))),m=0;m<x.length;++m)x[m].data.hook.insert(x[m]);for(m=0;m<s.post.length;++m)s.post[m]();return b}}function Js(e,t){let r,s,n=t.elm,i=e.data.class,a=t.data.class;if(!(!i&&!a)&&i!==a){i=i||{},a=a||{};for(s in i)i[s]&&!Object.prototype.hasOwnProperty.call(a,s)&&n.classList.remove(s);for(s in a)r=a[s],r!==i[s]&&n.classList[r?"add":"remove"](s)}}var qs={create:Js,update:Js};function Gs(e,t){let r,s,n,i=t.elm,a=e.data.props,l=t.data.props;if(!(!a&&!l)&&a!==l){a=a||{},l=l||{};for(r in l)s=l[r],n=a[r],n!==s&&(r!=="value"||i[r]!==s)&&(i[r]=s)}}var Ys={create:Gs,update:Gs};var np="http://www.w3.org/1999/xlink",ap="http://www.w3.org/2000/xmlns/",op="http://www.w3.org/XML/1998/namespace";function Xs(e,t){let r,s=t.elm,n=e.data.attrs,i=t.data.attrs;if(!(!n&&!i)&&n!==i){n=n||{},i=i||{};for(r in i){let a=i[r];n[r]!==a&&(a===!0?s.setAttribute(r,""):a===!1?s.removeAttribute(r):r.charCodeAt(0)!==120?s.setAttribute(r,a):r.charCodeAt(3)===58?s.setAttributeNS(op,r,a):r.charCodeAt(5)===58?r.charCodeAt(1)===109?s.setAttributeNS(ap,r,a):s.setAttributeNS(np,r,a):s.setAttribute(r,a))}for(r in n)r in i||s.removeAttribute(r)}}var Qs={create:Xs,update:Xs};var Zs=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,lp=function(e){Zs(function(){Zs(e)})},hr=!1;function pp(e,t,r){lp(function(){e[t]=r})}function ei(e,t){let r,s,n=t.elm,i=e.data.style,a=t.data.style;if(!i&&!a||i===a)return;i=i||{},a=a||{};let l="delayed"in i;for(s in i)s in a||(s[0]==="-"&&s[1]==="-"?n.style.removeProperty(s):n.style[s]="");for(s in a)if(r=a[s],s==="delayed"&&a.delayed)for(let p in a.delayed)r=a.delayed[p],(!l||r!==i.delayed[p])&&pp(n.style,p,r);else s!=="remove"&&r!==i[s]&&(s[0]==="-"&&s[1]==="-"?n.style.setProperty(s,r):n.style[s]=r)}function cp(e){let t,r,s=e.elm,n=e.data.style;if(!(!n||!(t=n.destroy)))for(r in t)s.style[r]=t[r]}function up(e,t){let r=e.data.style;if(!r||!r.remove){t();return}hr||(e.elm.offsetLeft,hr=!0);let s,n=e.elm,i=0,a=r.remove,l=0,p=[];for(s in a)p.push(s),n.style[s]=a[s];let c=getComputedStyle(n)["transition-property"].split(", ");for(;i<c.length;++i)p.indexOf(c[i])!==-1&&l++;n.addEventListener("transitionend",function(u){u.target===n&&--l,l===0&&t()})}function dp(){hr=!1}var ti={pre:dp,create:ei,update:ei,destroy:cp,remove:up};function ri(e,t,r){if(typeof e=="function")e.call(t,r,t);else if(typeof e=="object")for(let s=0;s<e.length;s++)ri(e[s],t,r)}function hp(e,t){let r=e.type,s=t.data.on;s&&s[r]&&ri(s[r],t,e)}function fp(){return function e(t){hp(t,e.vnode)}}function fr(e,t){let r=e.data.on,s=e.listener,n=e.elm,i=t&&t.data.on,a=t&&t.elm,l;if(r!==i){if(r&&s)if(i)for(l in r)i[l]||n.removeEventListener(l,s,!1);else for(l in r)n.removeEventListener(l,s,!1);if(i){let p=t.listener=e.listener||fp();if(p.vnode=t,r)for(l in i)r[l]||a.addEventListener(l,p,!1);else for(l in i)a.addEventListener(l,p,!1)}}}var si={create:fr,update:fr,destroy:fr};var yp=()=>Hs([qs,Ys,Qs,ti,si]),yr=yp;var mp=e=>{let t={};return{once:(r,s)=>{t[r]||(t[r]=[]);let n=(...i)=>{s(...i),t[r]=t[r].filter(a=>a!==n)};t[r].push(n)},emit:(r,...s)=>{t[r]&&t[r].forEach(n=>{n(...s)})},showAlert:async r=>{if(!e)throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.");e.transformedHandlers.showAlert(r)},showConfirm:async r=>{if(!e)throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.");return e.transformedHandlers.showConfirm(r)},showDropdownMenu:async r=>{if(!e)throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.");return e.transformedHandlers.showDropdownMenu(r)},closeAll:async()=>{if(!e)throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.");return e.transformedHandlers.closeAll()}}},ii=mp;function ni(e,t,r){if(e.ns="http://www.w3.org/2000/svg",r!=="foreignObject"&&t!==void 0)for(let s=0;s<t.length;++s){let n=t[s];if(typeof n=="string")continue;let i=n.data;i!==void 0&&ni(i,n.children,n.sel)}}function mr(e,t,r){let s={},n,i,a;if(r!==void 0?(t!==null&&(s=t),$e(r)?n=r:Se(r)?i=r.toString():r&&r.sel&&(n=[r])):t!=null&&($e(t)?n=t:Se(t)?i=t.toString():t&&t.sel?n=[t]:s=t),n!==void 0)for(a=0;a<n.length;++a)Se(n[a])&&(n[a]=ve(void 0,void 0,void 0,n[a],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&ni(s,n,e),ve(e,s,n,i,void 0)}var gp=ii(),vp={globalUI:gp},ai={components:vp},oi=yr();var et={components:{accordionItem:{handlers:yt,store:mt,view:Pr},breadcrumb:{handlers:gt,store:vt,view:Dr},dropdownMenu:{handlers:bt,store:wt,view:jr},form:{handlers:_t,store:St,view:ts},globalUi:{handlers:Ct,store:It,view:rs},navbar:{handlers:Ot,store:Tt,view:ss},pageOutline:{handlers:Lt,store:Rt,view:ns},popoverInput:{handlers:Nt,store:Vt,view:as},select:{handlers:Pt,store:Dt,view:os},sidebar:{handlers:jt,store:Wt,view:ls},sliderInput:{handlers:Mt,store:Ft,view:ps},table:{handlers:Kt,store:Ut,view:cs},tabs:{handlers:zt,store:Ht,view:us},tooltip:{handlers:ds,store:Jt,view:hs},waveform:{handlers:qt,store:Gt,view:ys}}};Object.keys(et).forEach(e=>{Object.keys(et[e]).forEach(t=>{let r=ur({...et[e][t],patch:oi,h:mr},ai[e]);customElements.define(et[e][t].view.elementName,r)})});customElements.define("rtgl-button",wr({}));customElements.define("rtgl-view",Ar({}));customElements.define("rtgl-text",kr({}));customElements.define("rtgl-image",$r({}));customElements.define("rtgl-svg",Cr({}));customElements.define("rtgl-input",Ir({}));customElements.define("rtgl-input-number",Or({}));customElements.define("rtgl-textarea",Tr({}));customElements.define("rtgl-color-picker",Lr({}));customElements.define("rtgl-slider",Rr({}));customElements.define("rtgl-dialog",Nr({}));customElements.define("rtgl-popover",Vr({}));})();
|
|
931
|
+
}`};return Object.entries(t).forEach(([n,a])=>{let l=i(n,a);l&&(r+=(r?`
|
|
932
|
+
|
|
933
|
+
`:"")+l)}),r};var at=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...at(r));else{if(r&&typeof r=="object"){let s=Object.entries(r);if(s.length>0){let[i,n]=s[0];Array.isArray(n)&&(r={[i]:at(n)})}}t.push(r)}return t},[]):e;var Oi=":",Ti=(e,t)=>{if(!t)return e;let r=[],s="",i=!1,n=null;for(let a=0;a<t.length;a++){let l=t[a];if(!i&&l===".")s&&(r.push(s),s="");else if(!i&&l==="[")s&&(r.push(s),s=""),i=!0;else if(i&&l==="]"){if(s){if(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))r.push(s.slice(1,-1));else{let p=Number(s);r.push(Number.isNaN(p)?s:p)}s=""}i=!1,n=null}else i&&(l==='"'||l==="'")&&(n?l===n&&(n=null):n=l),s+=l}return s&&r.push(s),r.reduce((a,l)=>a&&a[l],e)},lc=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase()),Li=({attrsString:e="",viewData:t={},tagName:r,isWebComponent:s})=>{let i={},n={},a=y=>{if(y==="role"||y.startsWith("aria-")||y.startsWith("data-"))throw new Error(`[Parser] Invalid boolean attribute '?${y}'. Use normal binding for value-carrying attributes such as aria-*, data-*, and role.`)},l=(y,w,x)=>{let _=lc(y);if(!_)throw new Error(`[Parser] Invalid ${x} prop name on '${r}'.`);if(Object.prototype.hasOwnProperty.call(n,_))throw new Error(`[Parser] Duplicate prop binding '${_}' on '${r}'. Use only one of 'name=value' or ':name=value'.`);n[_]=w};if(!e)return{attrs:i,props:n};let p=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]+))/g,o,c=new Set;for(;(o=p.exec(e))!==null;){let y=o[1],w=o[2]||o[3]||o[4];if(c.add(y),y.startsWith(".")){i[y]=w;continue}if(y.startsWith(Oi)){let x=y.substring(1),_=w;if(o[4]!==void 0){let A=o[4],$=Ti(t,A);$!==void 0&&(_=$)}l(x,_,"property-form");continue}if(y.startsWith("?")){let x=y.substring(1),_=w;a(x);let A;_==="true"?A=!0:_==="false"?A=!1:A=Ti(t,_),A&&(i[x]=""),s&&x!=="id"&&l(x,!!A,"boolean attribute-form");continue}i[y]=w,s&&y!=="id"&&l(y,w,"attribute-form")}let u=e,d=[],h,f=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]+))/g;for(;(h=f.exec(e))!==null;)d.push(h[0]);d.forEach(y=>{u=u.replace(y," ")});let m=/\b(\S+?)(?=\s|$)/g,g;for(;(g=m.exec(u))!==null;){let y=g[1];y.startsWith(".")||!c.has(y)&&!y.startsWith(Oi)&&!y.includes("=")&&(i[y]="",s&&y!=="id"&&l(y,!0,"boolean attribute-form"))}return{attrs:i,props:n}};var pc=/^[a-z][a-zA-Z0-9]*\*?$/,cc=/^[a-zA-Z][a-zA-Z0-9_-]*\*?$/,uc=/^[a-z][a-zA-Z0-9]*$/,Ri=new Set(["window","document"]),ot=e=>Object.entries(e||{}).map(([t,r])=>{if(Ri.has(t))return{refKey:t,refConfig:r,targetType:"global",isWildcard:!1,prefix:t};let s="id",i=t;t.startsWith(".")?(s="class",i=t.slice(1)):t.startsWith("#")&&(s="id",i=t.slice(1));let n=i.endsWith("*")?i.slice(0,-1):i;if(Ri.has(n))throw new Error(`[Parser] Invalid ref key '${t}'. Reserved global keys must be exactly 'window' or 'document'.`);if(s==="id"&&!pc.test(i))throw new Error(`[Parser] Invalid ref key '${t}'. Use camelCase IDs (optional '#', optional '*') or class refs with '.' prefix.`);if(s==="class"&&!cc.test(i))throw new Error(`[Parser] Invalid ref key '${t}'. Class refs must start with '.' and use class-compatible names (optional '*').`);let a=i.endsWith("*"),l=a?i.slice(0,-1):i;return{refKey:t,refConfig:r,targetType:s,isWildcard:a,prefix:l}}),Vi=e=>{if(!uc.test(e))throw new Error(`[Parser] Invalid element id '${e}' for refs. Use camelCase ids only. Kebab-case ids are not supported.`)},Ni=({value:e,prefix:t,isWildcard:r})=>typeof e!="string"||e.length===0?!1:r?e.startsWith(t):e===t,lt=({elementIdForRefs:e,classNames:t=[],refMatchers:r})=>{let s=[],i=Array.isArray(t)?t:[];return r.forEach(n=>{if(n.targetType==="global")return;if(n.targetType==="id"){Ni({value:e,prefix:n.prefix,isWildcard:n.isWildcard})&&s.push({...n,matchedValue:e});return}let a=i.find(l=>Ni({value:l,prefix:n.prefix,isWildcard:n.isWildcard}));a&&s.push({...n,matchedValue:a})}),s.length===0?null:(s.sort((n,a)=>{let l=n.targetType==="id"?2:1,p=a.targetType==="id"?2:1;return l!==p?p-l:!n.isWildcard&&a.isWildcard?-1:n.isWildcard&&!a.isWildcard?1:a.prefix.length-n.prefix.length}),s[0])},Ke=({optionName:e,optionValue:t,eventType:r,refKey:s})=>{if(t!==void 0&&typeof t!="boolean")throw new Error(`[Parser] Invalid '${e}' for event '${r}' on ref '${s}'. Expected boolean.`)},Pi=({optionName:e,optionValue:t,eventType:r,refKey:s})=>{if(t!==void 0&&(typeof t!="number"||Number.isNaN(t)||!Number.isFinite(t)||t<0))throw new Error(`[Parser] Invalid '${e}' for event '${r}' on ref '${s}'. Expected non-negative number.`)},Di=({eventType:e,eventConfig:t,refKey:r})=>{if(typeof t!="object"||t===null)throw new Error(`[Parser] Invalid event config for event '${e}' on ref '${r}'.`);let s=Object.prototype.hasOwnProperty.call(t,"debounce"),i=Object.prototype.hasOwnProperty.call(t,"throttle");if(Ke({optionName:"preventDefault",optionValue:t.preventDefault,eventType:e,refKey:r}),Ke({optionName:"stopPropagation",optionValue:t.stopPropagation,eventType:e,refKey:r}),Ke({optionName:"stopImmediatePropagation",optionValue:t.stopImmediatePropagation,eventType:e,refKey:r}),Ke({optionName:"targetOnly",optionValue:t.targetOnly,eventType:e,refKey:r}),Ke({optionName:"once",optionValue:t.once,eventType:e,refKey:r}),Pi({optionName:"debounce",optionValue:t.debounce,eventType:e,refKey:r}),Pi({optionName:"throttle",optionValue:t.throttle,eventType:e,refKey:r}),s&&i)throw new Error(`[Parser] Event '${e}' on ref '${r}' cannot define both 'debounce' and 'throttle'.`);if(t.handler&&t.action)throw new Error("Each listener can have handler or action but not both");if(!t.handler&&!t.action)throw new Error("Each listener must define either handler or action");return{hasDebounce:s,hasThrottle:i}};var pt=e=>(e.__eventRateLimitState||Object.defineProperty(e,"__eventRateLimitState",{value:new Map,enumerable:!1,configurable:!0}),e.__eventRateLimitState),dc=({eventConfig:e,handlers:t,onMissingHandler:r,parseAndRenderFn:s})=>{let i=n=>{let a=e.payload&&typeof e.payload=="object"&&!Array.isArray(e.payload)?e.payload:{};return typeof s!="function"?a:s(a,{_event:n})};if(e.action){if(typeof t.handleCallStoreAction!="function")throw new Error(`[Runtime] Action listener '${e.action}' requires handlers.handleCallStoreAction.`);return n=>{let a=i(n);t.handleCallStoreAction({...a,_event:n,_action:e.action})}}return e.handler&&t[e.handler]?n=>{let a=i(n);t[e.handler]({...a,_event:n})}:(e.handler&&r?.(e.handler),null)},fc=({eventConfig:e,callback:t,hasDebounce:r,hasThrottle:s,stateKey:i,eventRateLimitState:n,fallbackCurrentTarget:a=null,nowFn:l=Date.now,setTimeoutFn:p=setTimeout,clearTimeoutFn:o=clearTimeout})=>c=>{let u=n.get(i)||{},d=c.currentTarget||a;if(e.once)if(d){if(u.onceTargets||(u.onceTargets=new WeakSet),u.onceTargets.has(d)){n.set(i,u);return}u.onceTargets.add(d)}else if(u.onceTriggered){n.set(i,u);return}else u.onceTriggered=!0;if(e.targetOnly&&c.target!==c.currentTarget){n.set(i,u);return}if(e.preventDefault&&c.preventDefault(),e.stopImmediatePropagation?c.stopImmediatePropagation():e.stopPropagation&&c.stopPropagation(),r){u.debounceTimer&&o(u.debounceTimer),u.debounceTimer=p(()=>{t(c),u.debounceTimer=null},e.debounce),n.set(i,u);return}if(s){Object.prototype.hasOwnProperty.call(u,"lastThrottleAt")||(u.lastThrottleAt=void 0);let h=l();if(u.lastThrottleAt===void 0||h-u.lastThrottleAt>=e.throttle){u.lastThrottleAt=h,n.set(i,u),t(c);return}n.set(i,u);return}n.set(i,u),t(c)},ct=({eventType:e,eventConfig:t,refKey:r,handlers:s,eventRateLimitState:i,stateKey:n,fallbackCurrentTarget:a=null,parseAndRenderFn:l,onMissingHandler:p,nowFn:o=Date.now,setTimeoutFn:c=setTimeout,clearTimeoutFn:u=clearTimeout})=>{let{hasDebounce:d,hasThrottle:h}=Di({eventType:e,eventConfig:t,refKey:r}),f=dc({eventConfig:t,handlers:s,onMissingHandler:p,parseAndRenderFn:l});return f?fc({eventConfig:t,callback:f,hasDebounce:d,hasThrottle:h,stateKey:n,eventRateLimitState:i,fallbackCurrentTarget:a,nowFn:o,setTimeoutFn:c,clearTimeoutFn:u}):null};var Bi=({h:e,template:t,viewData:r,refs:s,handlers:i,createComponentUpdateHook:n})=>{let a=We(t,r,{}),l=at(a),p=hc({h:e,items:l,refs:s,handlers:i,viewData:r,createComponentUpdateHook:n});return e("div",{style:{display:"contents"}},p)},hc=({h:e,items:t,refs:r={},handlers:s={},viewData:i={},createComponentUpdateHook:n})=>{if(!Array.isArray(t))return console.error("Input to createVirtualDom must be an array."),[e("div",{},[])];let a=ot(r),l=a.some(o=>o.targetType==="id");function p(o,c=""){return o.map((u,d)=>{if(typeof u=="string"||typeof u=="number")return String(u);if(typeof u!="object"||u===null)return console.warn("Skipping invalid item in DOM structure:",u),null;let h=Object.entries(u);if(h.length===0)return null;let[f,m]=h[0];if(!isNaN(Number(f)))return Array.isArray(m)?p(m,`${c}.${f}`):typeof m=="object"&&m!==null&&Object.entries(m).length>0?p([m],`${c}.${f}`):String(m);h.length>1&&console.warn("Item has multiple keys, processing only the first:",f);let g,y,w=f.indexOf(" ");w===-1?(g=f,y=""):(g=f.substring(0,w),y=f.substring(w+1).trim());let x=g.split(/[.#]/)[0],_=x.includes("-"),{attrs:A,props:$}=Li({attrsString:y,viewData:i,tagName:x,isWebComponent:_}),T=g.match(/#([^.#\s]+)/);T&&!Object.prototype.hasOwnProperty.call(A,"id")&&(A.id=T[1]);let k=null;A.id?k=A.id:_&&(k=x);let j=(g.match(/\.([^.#]+)/g)||[]).map(W=>W.substring(1)),B=typeof A.class=="string"?A.class.split(/\s+/).filter(Boolean):[],U=[...new Set([...j,...B])],X=Object.create(null),le=null;if(_)le=x;else{j.forEach(ue=>{X[ue]=!0});let W=g.match(/#([^.#\s]+)/);W&&(le=W[1])}let pe;typeof m=="string"||typeof m=="number"?pe=String(m):Array.isArray(m)?pe=p(m,`${c}.${f}`):pe=[],le&&!_&&(A.id=le);let ft=Object.create(null);if(a.length>0){l&&k&&Vi(k);let W=lt({elementIdForRefs:k,classNames:U,refMatchers:a});if(W){let ue=W.refKey,Lr=W.matchedValue||k||ue;if(W.refConfig&&W.refConfig.eventListeners){let En=W.refConfig.eventListeners,$n=pt(s);Object.entries(En).forEach(([ht,kn])=>{let Sn=`${ue}:${Lr}:${ht}`,Rr=ct({eventType:ht,eventConfig:kn,refKey:ue,handlers:s,eventRateLimitState:$n,stateKey:Sn,parseAndRenderFn:Fe,onMissingHandler:Cn=>{console.warn(`[Parser] Handler '${Cn}' for refKey '${ue}' (matching '${Lr}') is referenced but not found in available handlers.`)}});Rr&&(ft[ht]=Rr)})}}}let ae={};if(k)ae.key=k;else if(g){let W=c?`${c}.${d}`:String(d);if(ae.key=`${g}-${W}`,Object.keys($).length>0){let ue=JSON.stringify($).substring(0,50);ae.key+=`-${ue}`}}if(Object.keys(A).length>0&&(ae.attrs=A),Object.keys(X).length>0&&(ae.class=X),Object.keys(ft).length>0&&(ae.on=ft),Object.keys($).length>0&&(ae.props=$),_&&typeof n=="function"){let W=n({selector:g,tagName:x});W&&(ae.hook=W)}try{return e(x,ae,pe)}catch(W){return console.error("Error creating virtual node:",W,{tagName:x,snabbdomData:ae,childrenOrText:pe}),e("div",{},["Error creating element"])}}).filter(Boolean)}return p(t)};var ji=({baseDeps:e,refs:t,dispatchEvent:r,store:s,render:i})=>({...e,refs:t,dispatchEvent:r,store:s,render:i}),mc=({store:e,render:t,parseAndRenderFn:r})=>s=>{let{_event:i,_action:n}=s,a=r(s,{_event:i});if(!e[n])throw new Error(`[Store] Action 'store.${n}' is not defined.`);e[n](a),t()},Wi=({handlers:e,deps:t,parseAndRenderFn:r})=>{let s={handleCallStoreAction:mc({store:t.store,render:t.render,parseAndRenderFn:r})};return Object.keys(e||{}).forEach(i=>{s[i]=n=>e[i](t,n)}),s},yc=e=>{if(e&&typeof e.then=="function")throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");return e},Mi=({handlers:e,deps:t})=>{if(!e?.handleBeforeMount)return;let r=e.handleBeforeMount(t);return yc(r)},Fi=({handlers:e,deps:t})=>{e?.handleAfterMount&&e.handleAfterMount(t)},zi=({attributeName:e,oldValue:t,newValue:r,deps:s,propsSchemaKeys:i,toCamelCase:n,normalizeAttributeValue:a})=>{let l=n(e),p={};i.forEach(d=>{let h=s.props[d];h!==void 0&&(p[d]=h)});let o={...p},c=a(t),u=a(r);return c===void 0?delete o[l]:o[l]=c,u===void 0?delete p[l]:p[l]=u,{changedProp:l,oldProps:o,newProps:p}};var gc=({refKey:e,targets:t})=>e==="window"?t.window:e==="document"?t.document:null,Ui=({refs:e={},handlers:t={},targets:r={window:globalThis.window,document:globalThis.document},parseAndRenderFn:s,timing:i={nowFn:Date.now,setTimeoutFn:setTimeout,clearTimeoutFn:clearTimeout},warnFn:n=console.warn})=>{let a=[],l=new Set,p=pt(t);return Object.entries(e).forEach(([o,c])=>{if(o!=="window"&&o!=="document")return;let u=gc({refKey:o,targets:r});!u||!c?.eventListeners||Object.entries(c.eventListeners).forEach(([d,h])=>{let f=`${o}:${d}`;l.add(f);let m=ct({eventType:d,eventConfig:h,refKey:o,handlers:t,eventRateLimitState:p,stateKey:f,fallbackCurrentTarget:u,parseAndRenderFn:s,nowFn:i.nowFn,setTimeoutFn:i.setTimeoutFn,clearTimeoutFn:i.clearTimeoutFn,onMissingHandler:g=>{n(`[Runtime] Handler '${g}' for global ref '${o}' is referenced but not found in available handlers.`)}});m&&(u.addEventListener(d,m),a.push(()=>{u.removeEventListener(d,m)}))})}),()=>{a.forEach(o=>o()),l.forEach(o=>{let c=p.get(o);c&&c.debounceTimer&&i.clearTimeoutFn(c.debounceTimer),p.delete(o)})}};var vc=e=>ot(e),bc=e=>{let t=[],r=e?.data?.class;r&&typeof r=="object"&&Object.entries(r).forEach(([i,n])=>{n&&t.push(i)});let s=e?.data?.attrs?.class;return typeof s=="string"&&s.split(/\s+/).filter(Boolean).forEach(i=>t.push(i)),[...new Set(t)]};var Ki=({rootVNode:e,refs:t})=>{let r={},s=vc(t),i=n=>{if(!n||typeof n!="object")return;let a=n?.data?.attrs?.id,l=bc(n),p=lt({elementIdForRefs:a,classNames:l,refMatchers:s});if(n.elm&&p){let o=a||p.refKey;r[o]=n.elm}Array.isArray(n.children)&&n.children.forEach(i)};return i(e),r};var Hi=({propsSchemaKeys:e=[],toKebabCase:t})=>{let r=new Set(["key"]);return e.forEach(s=>{r.add(s),r.add(t(s))}),[...r]},Gi=({baseDeps:e,refs:t,dispatchEvent:r,store:s,render:i})=>ji({baseDeps:e,refs:t,dispatchEvent:r,store:s,render:i}),Ji=({refIds:e,nextRefIds:t={}})=>(Object.keys(e).forEach(r=>{delete e[r]}),Object.assign(e,t),e),qi=({transformedHandlers:e,clearTimerFn:t=clearTimeout})=>{let r=e?.__eventRateLimitState;if(!(r instanceof Map))return 0;let s=0;return r.forEach(i=>{i&&i.debounceTimer&&(t(i.debounceTimer),s+=1)}),r.clear(),s};var Yi=({instance:e})=>Gi({baseDeps:e.deps,refs:e.refIds,dispatchEvent:e.dispatchEvent.bind(e),store:e.store,render:e.render.bind(e)}),Xi=({instance:e,parseAndRenderFn:t,renderFn:r,createTransformedHandlersFn:s=Wi,runBeforeMountFn:i=Mi,attachGlobalRefListenersFn:n=Ui,runAfterMountFn:a=Fi})=>{let l=Yi({instance:e});return e.transformedHandlers=s({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}),r(),a({handlers:e.handlers,deps:l}),l},Zi=({instance:e,clearTimerFn:t=clearTimeout})=>(e._unmountCallback&&e._unmountCallback(),e._globalListenersCleanup&&e._globalListenersCleanup(),qi({transformedHandlers:e.transformedHandlers,clearTimerFn:t})),Qi=({instance:e,attributeName:t,oldValue:r,newValue:s,scheduleFrameFn:i})=>{if(!(r===s||!e.render)){if(e.handlers?.handleOnUpdate){let n=Yi({instance:e}),a=zi({attributeName:t,oldValue:r,newValue:s,deps:n,propsSchemaKeys:e._propsSchemaKeys,toCamelCase:Xe,normalizeAttributeValue:Ye});e.handlers.handleOnUpdate(n,a);return}i(()=>{e.render()})}},en=({instance:e,createComponentUpdateHookFn:t,parseViewFn:r=Bi,collectRefElementsFn:s=Ki,onError:i=n=>{console.error("Error during patching:",n)}})=>{if(!e.patch)return console.error("Patch function is not defined!"),null;if(!e.template)return console.error("Template is not defined!"),null;try{let n=r({h:e.h,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 a=s({rootVNode:e._oldVNode,refs:e.refs});return Ji({refIds:e.refIds,nextRefIds:a}),e._oldVNode}catch(n){return i(n),null}};var wc=`
|
|
934
|
+
a, a:link, a:visited, a:hover, a:active {
|
|
935
|
+
display: contents;
|
|
936
|
+
color: inherit;
|
|
937
|
+
text-decoration: none;
|
|
938
|
+
background: none;
|
|
939
|
+
border: none;
|
|
940
|
+
padding: 0;
|
|
941
|
+
margin: 0;
|
|
942
|
+
font: inherit;
|
|
943
|
+
cursor: pointer;
|
|
944
|
+
}
|
|
945
|
+
`,tn=({host:e,cssText:t,createStyleSheet:r=()=>new CSSStyleSheet,createElement:s=i=>document.createElement(i)})=>{let i=e.attachShadow({mode:"open"}),n=r();n.replaceSync(wc);let a=[n];if(t){let p=r();p.replaceSync(t),a.push(p)}i.adoptedStyleSheets=a;let l=s("div");return l.style.cssText="display: contents;",i.appendChild(l),l.parentNode||e.appendChild(l),e.style.display="contents",{shadow:i,renderTarget:l,adoptedStyleSheets:a}};var ut=(e,t=requestAnimationFrame)=>t(e);var rn=({scheduleFrameFn:e=ut}={})=>({update:(t,r)=>{let s=t.data?.props||{},i=r.data?.props||{};if(!(JSON.stringify(s)!==JSON.stringify(i)))return;let a=r.elm;!a||typeof a.render!="function"||(a.setAttribute("isDirty","true"),e(()=>{if(a.render(),a.removeAttribute("isDirty"),a.handlers&&a.handlers.handleOnUpdate){let l={...a.deps,store:a.store,render:a.render.bind(a),handlers:a.handlers,dispatchEvent:a.dispatchEvent.bind(a),refs:a.refIds||{}};a.handlers.handleOnUpdate(l,{oldProps:s,newProps:i})}}))}});var sn=({elementName:e,propsSchema:t,propsSchemaKeys:r,template:s,refs:i,styles:n,handlers:a,methods:l,constants:p,store:o,patch:c,h:u,deps:d})=>{class h extends HTMLElement{elementName;styles;h;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 g={};return this.store.selectViewData&&(g=this.store.selectViewData()),g}connectedCallback(){let g=tn({host:this,cssText:this.cssText});this.shadow=g.shadow,this.renderTarget=g.renderTarget,Xi({instance:this,parseAndRenderFn:Fe,renderFn:this.render})}disconnectedCallback(){Zi({instance:this,clearTimerFn:clearTimeout})}attributeChangedCallback(g,y,w){Qi({instance:this,attributeName:g,oldValue:y,newValue:w,scheduleFrameFn:ut})}render=()=>{en({instance:this,createComponentUpdateHookFn:rn})}}class f extends h{static get observedAttributes(){return Hi({propsSchemaKeys:r,toKebabCase:ur})}constructor(){super(),this.constants=Ci({setupConstants:d?.constants,fileConstants:p}),this.propsSchema=t,this.props=t?Zs(this,r):{},this._propsSchemaKeys=r,this.elementName=e,this.styles=n,this.store=ki(o,this.props,this.constants),this.template=s,this.handlers=a,this.methods=l,this.refs=i,this.patch=c,this.deps={...d,store:this.store,render:this.render,handlers:a,props:this.props,constants:this.constants},fi(this,this.methods),this.h=u,this.cssText=Ii(e,n)}}return f};var xc=({handlers:e,methods:t,constants:r,schema:s,view:i,store:n,patch:a,h:l},p)=>{if(!i)throw new Error("view is not defined");if(!s||typeof s!="object"||Array.isArray(s))throw new Error("schema is required. Define component metadata in .schema.yaml.");let o=s,{template:c,refs:u,styles:d}=i;Qs({schema:o,methodExports:Object.keys(t||{})});let h=o.componentName,f=o.propsSchema,m=f?.properties?[...new Set(Object.keys(f.properties).map(g=>Xe(g)))]:[];if(!a)throw new Error("Patch is not defined");if(!l)throw new Error("h is not defined");return sn({elementName:h,propsSchema:f,propsSchemaKeys:m,template:c,refs:u,styles:d,handlers:e,methods:t,constants:r,store:n,patch:a,h:l,deps:p})},$r=xc;function _e(e,t,r,s,i){let n=t===void 0?void 0:t.key;return{sel:e,data:t,children:r,text:s,elm:i,key:n}}var Ie=Array.isArray;function Oe(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function _c(e,t){return document.createElement(e,t)}function Ac(e,t,r){return document.createElementNS(e,t,r)}function Ec(){return Ae(document.createDocumentFragment())}function $c(e){return document.createTextNode(e)}function kc(e){return document.createComment(e)}function Sc(e,t,r){if(ce(e)){let s=e;for(;s&&ce(s);)s=Ae(s).parent;e=s??e}ce(t)&&(t=Ae(t,e)),r&&ce(r)&&(r=Ae(r).firstChildNode),e.insertBefore(t,r)}function Cc(e,t){e.removeChild(t)}function Ic(e,t){ce(t)&&(t=Ae(t,e)),e.appendChild(t)}function an(e){if(ce(e)){for(;e&&ce(e);)e=Ae(e).parent;return e??null}return e.parentNode}function Oc(e){var t;if(ce(e)){let r=Ae(e),s=an(r);if(s&&r.lastChildNode){let i=Array.from(s.childNodes),n=i.indexOf(r.lastChildNode);return(t=i[n+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function Tc(e){return e.tagName}function Lc(e,t){e.textContent=t}function Rc(e){return e.textContent}function Nc(e){return e.nodeType===1}function Pc(e){return e.nodeType===3}function Vc(e){return e.nodeType===8}function ce(e){return e.nodeType===11}function Ae(e,t){var r,s,i;let n=e;return(r=n.parent)!==null&&r!==void 0||(n.parent=t??null),(s=n.firstChildNode)!==null&&s!==void 0||(n.firstChildNode=e.firstChild),(i=n.lastChildNode)!==null&&i!==void 0||(n.lastChildNode=e.lastChild),n}var on={createElement:_c,createElementNS:Ac,createTextNode:$c,createDocumentFragment:Ec,createComment:kc,insertBefore:Sc,removeChild:Cc,appendChild:Ic,parentNode:an,nextSibling:Oc,tagName:Tc,setTextContent:Lc,getTextContent:Rc,isElement:Nc,isText:Pc,isComment:Vc,isDocumentFragment:ce};function dt(e){return e===void 0}function re(e){return e!==void 0}var kr=_e("",{},[],void 0,void 0);function He(e,t){var r,s;let i=e.key===t.key,n=((r=e.data)===null||r===void 0?void 0:r.is)===((s=t.data)===null||s===void 0?void 0:s.is),a=e.sel===t.sel,l=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return a&&i&&n&&l}function Dc(){throw new Error("The document fragment is not supported on this platform.")}function Bc(e,t){return e.isElement(t)}function jc(e,t){return e.isDocumentFragment(t)}function Wc(e,t,r){var s;let i={};for(let n=t;n<=r;++n){let a=(s=e[n])===null||s===void 0?void 0:s.key;a!==void 0&&(i[a]=n)}return i}var Mc=["create","update","remove","destroy","pre","post"];function ln(e,t,r){let s={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=t!==void 0?t:on;for(let f of Mc)for(let m of e){let g=m[f];g!==void 0&&s[f].push(g)}function n(f){let m=f.id?"#"+f.id:"",g=f.getAttribute("class"),y=g?"."+g.split(" ").join("."):"";return _e(i.tagName(f).toLowerCase()+m+y,{},[],void 0,f)}function a(f){return _e(void 0,{},[],void 0,f)}function l(f,m){return function(){if(--m===0){let y=i.parentNode(f);y!==null&&i.removeChild(y,f)}}}function p(f,m){var g,y,w,x;let _,A=f.data;if(A!==void 0){let k=(g=A.hook)===null||g===void 0?void 0:g.init;re(k)&&(k(f),A=f.data)}let $=f.children,T=f.sel;if(T==="!")dt(f.text)&&(f.text=""),f.elm=i.createComment(f.text);else if(T==="")f.elm=i.createTextNode(f.text);else if(T!==void 0){let k=T.indexOf("#"),P=T.indexOf(".",k),j=k>0?k:T.length,B=P>0?P:T.length,U=k!==-1||P!==-1?T.slice(0,Math.min(j,B)):T,X=f.elm=re(A)&&re(_=A.ns)?i.createElementNS(_,U,A):i.createElement(U,A);for(j<B&&X.setAttribute("id",T.slice(j+1,B)),P>0&&X.setAttribute("class",T.slice(B+1).replace(/\./g," ")),_=0;_<s.create.length;++_)s.create[_](kr,f);if(Oe(f.text)&&(!Ie($)||$.length===0)&&i.appendChild(X,i.createTextNode(f.text)),Ie($))for(_=0;_<$.length;++_){let pe=$[_];pe!=null&&i.appendChild(X,p(pe,m))}let le=f.data.hook;re(le)&&((y=le.create)===null||y===void 0||y.call(le,kr,f),le.insert&&m.push(f))}else if(!((w=r?.experimental)===null||w===void 0)&&w.fragments&&f.children){for(f.elm=((x=i.createDocumentFragment)!==null&&x!==void 0?x:Dc)(),_=0;_<s.create.length;++_)s.create[_](kr,f);for(_=0;_<f.children.length;++_){let k=f.children[_];k!=null&&i.appendChild(f.elm,p(k,m))}}else f.elm=i.createTextNode(f.text);return f.elm}function o(f,m,g,y,w,x){for(;y<=w;++y){let _=g[y];_!=null&&i.insertBefore(f,p(_,x),m)}}function c(f){var m,g;let y=f.data;if(y!==void 0){(g=(m=y?.hook)===null||m===void 0?void 0:m.destroy)===null||g===void 0||g.call(m,f);for(let w=0;w<s.destroy.length;++w)s.destroy[w](f);if(f.children!==void 0)for(let w=0;w<f.children.length;++w){let x=f.children[w];x!=null&&typeof x!="string"&&c(x)}}}function u(f,m,g,y){for(var w,x;g<=y;++g){let _,A,$=m[g];if($!=null)if(re($.sel)){c($),_=s.remove.length+1,A=l($.elm,_);for(let k=0;k<s.remove.length;++k)s.remove[k]($,A);let T=(x=(w=$?.data)===null||w===void 0?void 0:w.hook)===null||x===void 0?void 0:x.remove;re(T)?T($,A):A()}else $.children?(c($),u(f,$.children,0,$.children.length-1)):i.removeChild(f,$.elm)}}function d(f,m,g,y){let w=0,x=0,_=m.length-1,A=m[0],$=m[_],T=g.length-1,k=g[0],P=g[T],j,B,U,X;for(;w<=_&&x<=T;)A==null?A=m[++w]:$==null?$=m[--_]:k==null?k=g[++x]:P==null?P=g[--T]:He(A,k)?(h(A,k,y),A=m[++w],k=g[++x]):He($,P)?(h($,P,y),$=m[--_],P=g[--T]):He(A,P)?(h(A,P,y),i.insertBefore(f,A.elm,i.nextSibling($.elm)),A=m[++w],P=g[--T]):He($,k)?(h($,k,y),i.insertBefore(f,$.elm,A.elm),$=m[--_],k=g[++x]):(j===void 0&&(j=Wc(m,w,_)),B=j[k.key],dt(B)?(i.insertBefore(f,p(k,y),A.elm),k=g[++x]):dt(j[P.key])?(i.insertBefore(f,p(P,y),i.nextSibling($.elm)),P=g[--T]):(U=m[B],U.sel!==k.sel?i.insertBefore(f,p(k,y),A.elm):(h(U,k,y),m[B]=void 0,i.insertBefore(f,U.elm,A.elm)),k=g[++x]));x<=T&&(X=g[T+1]==null?null:g[T+1].elm,o(f,X,g,x,T,y)),w<=_&&u(f,m,w,_)}function h(f,m,g){var y,w,x,_,A,$,T,k;let P=(y=m.data)===null||y===void 0?void 0:y.hook;(w=P?.prepatch)===null||w===void 0||w.call(P,f,m);let j=m.elm=f.elm;if(f===m)return;if(m.data!==void 0||re(m.text)&&m.text!==f.text){(x=m.data)!==null&&x!==void 0||(m.data={}),(_=f.data)!==null&&_!==void 0||(f.data={});for(let X=0;X<s.update.length;++X)s.update[X](f,m);(T=($=(A=m.data)===null||A===void 0?void 0:A.hook)===null||$===void 0?void 0:$.update)===null||T===void 0||T.call($,f,m)}let B=f.children,U=m.children;dt(m.text)?re(B)&&re(U)?B!==U&&d(j,B,U,g):re(U)?(re(f.text)&&i.setTextContent(j,""),o(j,null,U,0,U.length-1,g)):re(B)?u(j,B,0,B.length-1):re(f.text)&&i.setTextContent(j,""):f.text!==m.text&&(re(B)&&u(j,B,0,B.length-1),i.setTextContent(j,m.text)),(k=P?.postpatch)===null||k===void 0||k.call(P,f,m)}return function(m,g){let y,w,x,_=[];for(y=0;y<s.pre.length;++y)s.pre[y]();for(Bc(i,m)?m=n(m):jc(i,m)&&(m=a(m)),He(m,g)?h(m,g,_):(w=m.elm,x=i.parentNode(w),p(g,_),x!==null&&(i.insertBefore(x,g.elm,i.nextSibling(w)),u(x,[m],0,0))),y=0;y<_.length;++y)_[y].data.hook.insert(_[y]);for(y=0;y<s.post.length;++y)s.post[y]();return g}}function pn(e,t){let r,s,i=t.elm,n=e.data.class,a=t.data.class;if(!(!n&&!a)&&n!==a){n=n||{},a=a||{};for(s in n)n[s]&&!Object.prototype.hasOwnProperty.call(a,s)&&i.classList.remove(s);for(s in a)r=a[s],r!==n[s]&&i.classList[r?"add":"remove"](s)}}var cn={create:pn,update:pn};function un(e,t){let r,s,i,n=t.elm,a=e.data.props,l=t.data.props;if(!(!a&&!l)&&a!==l){a=a||{},l=l||{};for(r in l)s=l[r],i=a[r],i!==s&&(r!=="value"||n[r]!==s)&&(n[r]=s)}}var dn={create:un,update:un};var Fc="http://www.w3.org/1999/xlink",zc="http://www.w3.org/2000/xmlns/",Uc="http://www.w3.org/XML/1998/namespace";function fn(e,t){let r,s=t.elm,i=e.data.attrs,n=t.data.attrs;if(!(!i&&!n)&&i!==n){i=i||{},n=n||{};for(r in n){let a=n[r];i[r]!==a&&(a===!0?s.setAttribute(r,""):a===!1?s.removeAttribute(r):r.charCodeAt(0)!==120?s.setAttribute(r,a):r.charCodeAt(3)===58?s.setAttributeNS(Uc,r,a):r.charCodeAt(5)===58?r.charCodeAt(1)===109?s.setAttributeNS(zc,r,a):s.setAttributeNS(Fc,r,a):s.setAttribute(r,a))}for(r in i)r in n||s.removeAttribute(r)}}var hn={create:fn,update:fn};var mn=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,Kc=function(e){mn(function(){mn(e)})},Sr=!1;function Hc(e,t,r){Kc(function(){e[t]=r})}function yn(e,t){let r,s,i=t.elm,n=e.data.style,a=t.data.style;if(!n&&!a||n===a)return;n=n||{},a=a||{};let l="delayed"in n;for(s in n)s in a||(s[0]==="-"&&s[1]==="-"?i.style.removeProperty(s):i.style[s]="");for(s in a)if(r=a[s],s==="delayed"&&a.delayed)for(let p in a.delayed)r=a.delayed[p],(!l||r!==n.delayed[p])&&Hc(i.style,p,r);else s!=="remove"&&r!==n[s]&&(s[0]==="-"&&s[1]==="-"?i.style.setProperty(s,r):i.style[s]=r)}function Gc(e){let t,r,s=e.elm,i=e.data.style;if(!(!i||!(t=i.destroy)))for(r in t)s.style[r]=t[r]}function Jc(e,t){let r=e.data.style;if(!r||!r.remove){t();return}Sr||(e.elm.offsetLeft,Sr=!0);let s,i=e.elm,n=0,a=r.remove,l=0,p=[];for(s in a)p.push(s),i.style[s]=a[s];let c=getComputedStyle(i)["transition-property"].split(", ");for(;n<c.length;++n)p.indexOf(c[n])!==-1&&l++;i.addEventListener("transitionend",function(u){u.target===i&&--l,l===0&&t()})}function qc(){Sr=!1}var gn={pre:qc,create:yn,update:yn,destroy:Gc,remove:Jc};function vn(e,t,r){if(typeof e=="function")e.call(t,r,t);else if(typeof e=="object")for(let s=0;s<e.length;s++)vn(e[s],t,r)}function Yc(e,t){let r=e.type,s=t.data.on;s&&s[r]&&vn(s[r],t,e)}function Xc(){return function e(t){Yc(t,e.vnode)}}function Cr(e,t){let r=e.data.on,s=e.listener,i=e.elm,n=t&&t.data.on,a=t&&t.elm,l;if(r!==n){if(r&&s)if(n)for(l in r)n[l]||i.removeEventListener(l,s,!1);else for(l in r)i.removeEventListener(l,s,!1);if(n){let p=t.listener=e.listener||Xc();if(p.vnode=t,r)for(l in n)r[l]||a.addEventListener(l,p,!1);else for(l in n)a.addEventListener(l,p,!1)}}}var bn={create:Cr,update:Cr,destroy:Cr};var Zc=()=>ln([cn,dn,hn,gn,bn]),Ir=Zc;var Qc=e=>{let t={};return{once:(r,s)=>{t[r]||(t[r]=[]);let i=(...n)=>{s(...n),t[r]=t[r].filter(a=>a!==i)};t[r].push(i)},emit:(r,...s)=>{t[r]&&t[r].forEach(i=>{i(...s)})},showAlert:async r=>{if(!e)throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.");e.transformedHandlers.showAlert(r)},showConfirm:async r=>{if(!e)throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.");return e.transformedHandlers.showConfirm(r)},showDropdownMenu:async r=>{if(!e)throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.");return e.transformedHandlers.showDropdownMenu(r)},closeAll:async()=>{if(!e)throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.");return e.transformedHandlers.closeAll()}}},wn=Qc;function xn(e,t,r){if(e.ns="http://www.w3.org/2000/svg",r!=="foreignObject"&&t!==void 0)for(let s=0;s<t.length;++s){let i=t[s];if(typeof i=="string")continue;let n=i.data;n!==void 0&&xn(n,i.children,i.sel)}}function Or(e,t,r){let s={},i,n,a;if(r!==void 0?(t!==null&&(s=t),Ie(r)?i=r:Oe(r)?n=r.toString():r&&r.sel&&(i=[r])):t!=null&&(Ie(t)?i=t:Oe(t)?n=t.toString():t&&t.sel?i=[t]:s=t),i!==void 0)for(a=0;a<i.length;++a)Oe(i[a])&&(i[a]=_e(void 0,void 0,void 0,i[a],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&xn(s,i,e),_e(e,s,i,n,void 0)}var eu=wn(),tu={globalUI:eu},_n={components:tu},An=Ir();var Tr={components:{accordionItem:{handlers:Ot,schema:rs,store:Tt,view:ss},breadcrumb:{handlers:Lt,schema:is,store:Rt,view:ns},dropdownMenu:{handlers:Nt,schema:as,store:Pt,view:os},form:{handlers:Vt,schema:ps,store:Ft,view:$s},globalUi:{handlers:zt,schema:ks,store:Ut,view:Ss},navbar:{handlers:Kt,schema:Cs,store:Ht,view:Is},pageOutline:{handlers:Gt,schema:Ts,store:Jt,view:Ls},popoverInput:{handlers:qt,schema:Rs,store:Yt,view:Ns},select:{handlers:Xt,schema:Ps,store:Zt,view:Vs},sidebar:{handlers:Qt,schema:Ds,store:tr,view:Bs},sliderInput:{handlers:rr,schema:js,store:sr,view:Ws},table:{handlers:ir,schema:Ms,store:nr,view:Fs},tabs:{handlers:ar,schema:zs,store:or,view:Us},tooltip:{handlers:Ks,schema:Hs,store:lr,view:Gs},waveform:{handlers:pr,schema:qs,store:cr,view:Ys}}};Object.keys(Tr).forEach(e=>{Object.keys(Tr[e]).forEach(t=>{let r=Tr[e][t],s=$r({...r,patch:An,h:Or},_n[e]),i=r.schema?.componentName;if(!i)throw new Error(`[Build] Missing schema.componentName for ${e}/${t}. Define it in .schema.yaml.`);customElements.define(i,s)})});customElements.define("rtgl-button",Dr({}));customElements.define("rtgl-view",Mr({}));customElements.define("rtgl-text",zr({}));customElements.define("rtgl-image",Hr({}));customElements.define("rtgl-svg",Jr({}));customElements.define("rtgl-input",qr({}));customElements.define("rtgl-input-number",Yr({}));customElements.define("rtgl-textarea",Xr({}));customElements.define("rtgl-color-picker",Zr({}));customElements.define("rtgl-slider",Qr({}));customElements.define("rtgl-dialog",es({}));customElements.define("rtgl-popover",ts({}));})();
|