@geajs/ui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,3597 @@
1
+ import { Component } from "@geajs/core";
2
+ import { VanillaMachine, normalizeProps, spreadProps } from "@zag-js/vanilla";
3
+ import { clsx } from "clsx";
4
+ import { twMerge } from "tailwind-merge";
5
+ import * as accordion from "@zag-js/accordion";
6
+ import * as avatar from "@zag-js/avatar";
7
+ import * as checkbox from "@zag-js/checkbox";
8
+ import * as clipboard from "@zag-js/clipboard";
9
+ import * as collapsible from "@zag-js/collapsible";
10
+ import * as combobox from "@zag-js/combobox";
11
+ import * as dialog from "@zag-js/dialog";
12
+ import * as fileUpload from "@zag-js/file-upload";
13
+ import * as hoverCard from "@zag-js/hover-card";
14
+ import * as menu from "@zag-js/menu";
15
+ import * as numberInput from "@zag-js/number-input";
16
+ import * as pagination from "@zag-js/pagination";
17
+ import * as pinInput from "@zag-js/pin-input";
18
+ import * as popover from "@zag-js/popover";
19
+ import * as progress from "@zag-js/progress";
20
+ import * as radioGroup from "@zag-js/radio-group";
21
+ import * as ratingGroup from "@zag-js/rating-group";
22
+ import * as select from "@zag-js/select";
23
+ import * as slider from "@zag-js/slider";
24
+ import * as switchMachine from "@zag-js/switch";
25
+ import * as tabs from "@zag-js/tabs";
26
+ import * as tagsInput from "@zag-js/tags-input";
27
+ import * as toast from "@zag-js/toast";
28
+ import * as toggleGroup from "@zag-js/toggle-group";
29
+ import * as tooltip from "@zag-js/tooltip";
30
+ import * as treeView from "@zag-js/tree-view";
31
+ //#region src/primitives/zag-component.ts
32
+ var ZagComponent = class extends Component {
33
+ createMachine(_props) {
34
+ return null;
35
+ }
36
+ getMachineProps(_props) {
37
+ return {};
38
+ }
39
+ connectApi(_service) {
40
+ return null;
41
+ }
42
+ getSpreadMap() {
43
+ return {};
44
+ }
45
+ syncState(_api) {}
46
+ created(props) {
47
+ if (!this._spreadCleanups) this._spreadCleanups = /* @__PURE__ */ new Map();
48
+ if (this._spreadScheduled === void 0) this._spreadScheduled = false;
49
+ const machineDef = this.createMachine(props);
50
+ if (!machineDef) return;
51
+ this._machine = new VanillaMachine(machineDef, this.getMachineProps(props));
52
+ this._machine.start();
53
+ this._api = this.connectApi(this._machine.service);
54
+ this.syncState(this._api);
55
+ this._machine.subscribe(() => {
56
+ if (!this._machine) return;
57
+ this._api = this.connectApi(this._machine.service);
58
+ this._scheduleSpreadApplication();
59
+ });
60
+ }
61
+ _syncMachineProps() {
62
+ const machine = this._machine;
63
+ if (!machine?.userPropsRef) return;
64
+ const next = this.getMachineProps(this.props);
65
+ machine.userPropsRef.current = next;
66
+ this._api = this.connectApi(this._machine.service);
67
+ this._scheduleSpreadApplication();
68
+ }
69
+ __geaUpdateProps(nextProps) {
70
+ super.__geaUpdateProps(nextProps);
71
+ this._syncMachineProps();
72
+ }
73
+ _scheduleSpreadApplication() {
74
+ if (this._spreadScheduled) return;
75
+ this._spreadScheduled = true;
76
+ queueMicrotask(() => {
77
+ this._spreadScheduled = false;
78
+ this._applyAllSpreads();
79
+ });
80
+ }
81
+ _resolveProps(getter, el) {
82
+ if (typeof getter === "function") return getter(this._api, el);
83
+ const method = this._api[getter];
84
+ if (typeof method !== "function") return null;
85
+ return method.call(this._api);
86
+ }
87
+ _queryAllIncludingSelf(selector) {
88
+ const results = this.$$(selector);
89
+ const root = this.el;
90
+ if (root && root.matches(selector) && !results.includes(root)) results.unshift(root);
91
+ return results;
92
+ }
93
+ _applyAllSpreads() {
94
+ if (!this.rendered_ || !this._api) return;
95
+ const map = this.getSpreadMap();
96
+ for (const selector in map) {
97
+ const getter = map[selector];
98
+ const elements = this._queryAllIncludingSelf(selector);
99
+ for (let i = 0; i < elements.length; i++) {
100
+ const el = elements[i];
101
+ const key = selector + ":" + i;
102
+ const nextProps = this._resolveProps(getter, el);
103
+ if (!nextProps) continue;
104
+ const cleanup = spreadProps(el, nextProps);
105
+ this._spreadCleanups.set(key, cleanup);
106
+ }
107
+ }
108
+ }
109
+ onAfterRender() {
110
+ this._cacheArrayContainers();
111
+ this._applyAllSpreads();
112
+ }
113
+ _cacheArrayContainers() {
114
+ const maps = this.__geaMaps;
115
+ if (!maps) return;
116
+ for (const idx in maps) {
117
+ const map = maps[idx];
118
+ map.container = map.getContainer();
119
+ if (map.container) this[map.containerProp] = map.container;
120
+ }
121
+ }
122
+ dispose() {
123
+ for (const cleanup of this._spreadCleanups.values()) cleanup();
124
+ this._spreadCleanups.clear();
125
+ if (this._machine) {
126
+ this._machine.stop();
127
+ this._machine = null;
128
+ }
129
+ this._api = null;
130
+ super.dispose();
131
+ }
132
+ static {
133
+ this.normalizeProps = normalizeProps;
134
+ }
135
+ };
136
+ //#endregion
137
+ //#region src/utils/cn.ts
138
+ function cn(...inputs) {
139
+ return twMerge(clsx(inputs));
140
+ }
141
+ //#endregion
142
+ //#region \0virtual:gea-hmr
143
+ var hot = void 0;
144
+ var componentInstances = hot && hot.data && hot.data.componentInstances || /* @__PURE__ */ new Map();
145
+ if (hot) hot.data.componentInstances = componentInstances;
146
+ var hmrGlobal = globalThis.__geaHMRGlobal || (globalThis.__geaHMRGlobal = {
147
+ componentModules: /* @__PURE__ */ new Map(),
148
+ componentProxies: /* @__PURE__ */ new Map()
149
+ });
150
+ hmrGlobal.componentModules;
151
+ hmrGlobal.componentProxies;
152
+ //#endregion
153
+ //#region src/components/accordion.tsx
154
+ var Accordion = class extends ZagComponent {
155
+ createMachine(_props) {
156
+ return accordion.machine;
157
+ }
158
+ getMachineProps(props) {
159
+ return {
160
+ id: this.id,
161
+ value: props.value,
162
+ defaultValue: props.defaultValue,
163
+ multiple: props.multiple ?? false,
164
+ collapsible: props.collapsible ?? false,
165
+ disabled: props.disabled,
166
+ orientation: props.orientation ?? "vertical",
167
+ onValueChange: (details) => {
168
+ this.value = details.value;
169
+ props.onValueChange?.(details);
170
+ }
171
+ };
172
+ }
173
+ connectApi(service) {
174
+ return accordion.connect(service, normalizeProps);
175
+ }
176
+ getSpreadMap() {
177
+ return {
178
+ "[data-part=\"root\"]": "getRootProps",
179
+ "[data-part=\"item\"]": (api, el) => api.getItemProps({ value: el.dataset.value }),
180
+ "[data-part=\"item-trigger\"]": (api, el) => api.getItemTriggerProps({ value: el.dataset.value }),
181
+ "[data-part=\"item-content\"]": (api, el) => api.getItemContentProps({ value: el.dataset.value }),
182
+ "[data-part=\"item-indicator\"]": (api, el) => api.getItemIndicatorProps({ value: el.dataset.value })
183
+ };
184
+ }
185
+ syncState(api) {
186
+ this.value = api.value;
187
+ }
188
+ template(props) {
189
+ const items = props.items || [];
190
+ return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}>${items.map((item) => `<div data-gea-item-id="${String(item)}" data-part="item"${item.value == null ? "" : ` data-value="${item.value}"`} class="accordion-item border-b"><h3><button data-part="item-trigger"${item.value == null ? "" : ` data-value="${item.value}"`} class="accordion-trigger flex w-full items-center justify-between py-4 text-sm font-medium transition-all">${item.label}<span data-part="item-indicator"${item.value == null ? "" : ` data-value="${item.value}"`} class="accordion-indicator h-4 w-4 shrink-0 transition-transform duration-200">▶</span></button></h3><div data-part="item-content"${item.value == null ? "" : ` data-value="${item.value}"`} class="accordion-content overflow-hidden text-sm"><div class="pb-4 pt-0">${item.content}</div></div></div>`).join("") + "<!---->"}</div>`;
191
+ }
192
+ render__unresolved_0Item(item) {
193
+ const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
194
+ return `<div data-gea-item-id="${String(item)}" data-part="item"${__v(item.value) == __v(null) ? "" : ` data-value="${item.value}"`} class="accordion-item border-b"><h3><button data-part="item-trigger"${__v(item.value) == __v(null) ? "" : ` data-value="${item.value}"`} class="accordion-trigger flex w-full items-center justify-between py-4 text-sm font-medium transition-all">${item.label}<span data-part="item-indicator"${__v(item.value) == __v(null) ? "" : ` data-value="${item.value}"`} class="accordion-indicator h-4 w-4 shrink-0 transition-transform duration-200">▶</span></button></h3><div data-part="item-content"${__v(item.value) == __v(null) ? "" : ` data-value="${item.value}"`} class="accordion-content overflow-hidden text-sm"><div class="pb-4 pt-0">${item.content}</div></div></div>`;
195
+ }
196
+ create__unresolved_0Item(item) {
197
+ var __c = this.____unresolved_0_container;
198
+ if (!__c.__geaTpl) try {
199
+ var __tw = __c.cloneNode(false);
200
+ __tw.innerHTML = this.render__unresolved_0Item("__dummy__");
201
+ __c.__geaTpl = __tw.firstElementChild;
202
+ } catch {}
203
+ if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
204
+ else {
205
+ var __fw = __c.cloneNode(false);
206
+ __fw.innerHTML = this.render__unresolved_0Item(item);
207
+ var el = __fw.firstElementChild;
208
+ }
209
+ var __av = item.value;
210
+ if (__av == null || __av === false) el.removeAttribute("data-value");
211
+ else el.setAttribute("data-value", String(__av));
212
+ var __av = item.value;
213
+ if (__av == null || __av === false) el.firstElementChild.firstElementChild.removeAttribute("data-value");
214
+ else el.firstElementChild.firstElementChild.setAttribute("data-value", String(__av));
215
+ var __av = item.value;
216
+ if (__av == null || __av === false) el.firstElementChild.firstElementChild.firstElementChild.removeAttribute("data-value");
217
+ else el.firstElementChild.firstElementChild.firstElementChild.setAttribute("data-value", String(__av));
218
+ var __av = item.value;
219
+ if (__av == null || __av === false) el.firstElementChild.nextElementSibling.removeAttribute("data-value");
220
+ else el.firstElementChild.nextElementSibling.setAttribute("data-value", String(__av));
221
+ el.firstElementChild.nextElementSibling.firstElementChild.textContent = `${item.content}`;
222
+ el.setAttribute("data-gea-item-id", String(item));
223
+ el.__geaItem = item;
224
+ return el;
225
+ }
226
+ __onPropChange(key, value) {
227
+ if (key === "class") try {
228
+ const __el = this.$(":scope");
229
+ this.props;
230
+ const __boundValue = this.props.class || "";
231
+ if (__el) {
232
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
233
+ if (__el.className !== __newClass) __el.className = __newClass;
234
+ }
235
+ } catch {}
236
+ if (key === "items") this.__geaSyncMap(0);
237
+ }
238
+ __observe_local_props(__v, __c) {
239
+ this.__geaSyncMap(0);
240
+ }
241
+ createdHooks() {
242
+ if (!this.__observer_removers__) this.__observer_removers__ = [];
243
+ if (!this.__stores) this.__stores = {};
244
+ this.__observer_removers__.forEach((fn) => fn());
245
+ this.__observer_removers__ = [];
246
+ if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
247
+ this.__geaRegisterMap(0, "____unresolved_0_container", () => this.$(":scope"), () => {
248
+ return this.props.items || [];
249
+ }, (__item) => this.create__unresolved_0Item(__item));
250
+ }
251
+ dispose() {
252
+ if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
253
+ super.dispose();
254
+ }
255
+ };
256
+ //#endregion
257
+ //#region src/components/avatar.tsx
258
+ var Avatar = class extends ZagComponent {
259
+ constructor(...args) {
260
+ super(...args);
261
+ this.loaded = false;
262
+ this.props;
263
+ this.__geaCond_0 = !!this.props.src;
264
+ this.__geaRegisterCond(0, "c0", () => {
265
+ this.props;
266
+ return this.props.src;
267
+ }, () => {
268
+ const props = this.props;
269
+ return `<img data-part="image"${this.props.src == null ? "" : ` src="${this.props.src}"`}${(this.props.name || "") == null || (props.name || "") === false ? "" : ` alt="${this.props.name || ""}"`} class="avatar-image absolute inset-0 h-full w-full object-cover" />`;
270
+ }, () => {
271
+ this.props;
272
+ return "";
273
+ });
274
+ }
275
+ createMachine(_props) {
276
+ return avatar.machine;
277
+ }
278
+ getMachineProps(props) {
279
+ return {
280
+ id: this.id,
281
+ onStatusChange: props.onStatusChange
282
+ };
283
+ }
284
+ connectApi(service) {
285
+ return avatar.connect(service, normalizeProps);
286
+ }
287
+ getSpreadMap() {
288
+ return {
289
+ "[data-part=\"root\"]": "getRootProps",
290
+ "[data-part=\"image\"]": "getImageProps",
291
+ "[data-part=\"fallback\"]": "getFallbackProps"
292
+ };
293
+ }
294
+ syncState(api) {
295
+ this.loaded = api.loaded;
296
+ }
297
+ template(props) {
298
+ const initials = props.fallback || (props.name ? props.name.split(" ").map((n) => n[0]).join("").toUpperCase() : "?");
299
+ return `<div id="${this.id}" data-part="root"${`avatar-root relative inline-flex h-10 w-10 shrink-0 overflow-hidden rounded-full ${props.class || ""}` == null ? "" : ` class="${`avatar-root relative inline-flex h-10 w-10 shrink-0 overflow-hidden rounded-full ${props.class || ""}`.trim()}"`}><!--${this.id + "-c0"}-->${(props.src ? `<img data-part="image"${props.src == null ? "" : ` src="${props.src}"`}${(props.name || "") == null || (props.name || "") === false ? "" : ` alt="${props.name || ""}"`} class="avatar-image absolute inset-0 h-full w-full object-cover" />` : "") || ""}<!--${this.id + "-c0-end"}--><div id="${this.id + "-b1"}" data-part="fallback"${`avatar-fallback flex h-full w-full items-center justify-center rounded-full bg-muted text-muted-foreground text-sm font-medium ${props.src ? "absolute inset-0" : ""}` == null ? "" : ` class="${`avatar-fallback flex h-full w-full items-center justify-center rounded-full bg-muted text-muted-foreground text-sm font-medium ${props.src ? "absolute inset-0" : ""}`.trim()}"`}>${initials}</div></div>`;
300
+ }
301
+ __onPropChange(key, value) {
302
+ if (key === "class") try {
303
+ const __el = this.$(":scope");
304
+ this.props;
305
+ const __boundValue = `avatar-root relative inline-flex h-10 w-10 shrink-0 overflow-hidden rounded-full ${this.props.class || ""}`;
306
+ if (__el) {
307
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
308
+ if (__el.className !== __newClass) __el.className = __newClass;
309
+ }
310
+ } catch {}
311
+ if (key === "src") {
312
+ try {
313
+ const __el = document.getElementById(this.id + "-b1");
314
+ this.props;
315
+ const __boundValue = `avatar-fallback flex h-full w-full items-center justify-center rounded-full bg-muted text-muted-foreground text-sm font-medium ${this.props.src ? "absolute inset-0" : ""}`;
316
+ if (__el) {
317
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
318
+ if (__el.className !== __newClass) __el.className = __newClass;
319
+ }
320
+ } catch {}
321
+ this.__geaPatchCond(0);
322
+ }
323
+ if (key === "fallback") try {
324
+ const __el = document.getElementById(this.id + "-b1");
325
+ this.props;
326
+ const __boundValue = this.props.fallback || (this.props.name ? this.props.name.split(" ").map((n) => n[0]).join("").toUpperCase() : "?");
327
+ if (__el) {
328
+ if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
329
+ }
330
+ } catch {}
331
+ if (key === "name") try {
332
+ const __el = document.getElementById(this.id + "-b1");
333
+ this.props;
334
+ const __boundValue = this.props.fallback || (this.props.name ? this.props.name.split(" ").map((n) => n[0]).join("").toUpperCase() : "?");
335
+ if (__el) {
336
+ if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
337
+ }
338
+ } catch {}
339
+ }
340
+ };
341
+ //#endregion
342
+ //#region src/components/checkbox.tsx
343
+ var Checkbox = class extends ZagComponent {
344
+ constructor(...args) {
345
+ super(...args);
346
+ this.checked = false;
347
+ this.props;
348
+ this.__geaCond_0 = !!this.props.label;
349
+ this.__geaRegisterCond(0, "c0", () => {
350
+ this.props;
351
+ return this.props.label;
352
+ }, () => {
353
+ this.props;
354
+ return `<span data-part="label" class="checkbox-label text-sm font-medium leading-none">${this.props.label}</span>`;
355
+ }, null);
356
+ }
357
+ createMachine(_props) {
358
+ return checkbox.machine;
359
+ }
360
+ getMachineProps(props) {
361
+ return {
362
+ id: this.id,
363
+ checked: props.checked,
364
+ defaultChecked: props.defaultChecked,
365
+ disabled: props.disabled,
366
+ invalid: props.invalid,
367
+ required: props.required,
368
+ readOnly: props.readOnly,
369
+ name: props.name,
370
+ form: props.form,
371
+ value: props.value ?? "on",
372
+ onCheckedChange: (details) => {
373
+ this.checked = details.checked;
374
+ props.onCheckedChange?.(details);
375
+ }
376
+ };
377
+ }
378
+ connectApi(service) {
379
+ return checkbox.connect(service, normalizeProps);
380
+ }
381
+ getSpreadMap() {
382
+ return {
383
+ "[data-part=\"root\"]": "getRootProps",
384
+ "[data-part=\"label\"]": "getLabelProps",
385
+ "[data-part=\"control\"]": "getControlProps",
386
+ "[data-part=\"indicator\"]": "getIndicatorProps",
387
+ "[data-part=\"hidden-input\"]": "getHiddenInputProps"
388
+ };
389
+ }
390
+ syncState(api) {
391
+ this.checked = api.checkedState;
392
+ }
393
+ template(props) {
394
+ return `<label id="${this.id}" data-part="root"${`checkbox-root inline-flex items-center gap-2 cursor-pointer ${props.class || ""}` == null ? "" : ` class="${`checkbox-root inline-flex items-center gap-2 cursor-pointer ${props.class || ""}`.trim()}"`}><input data-part="hidden-input" type="checkbox" class="sr-only" /><div data-part="control" class="checkbox-control h-4 w-4 shrink-0 rounded-sm border border-primary shadow transition-colors data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground"><span data-part="indicator" class="checkbox-indicator flex items-center justify-center text-current h-full w-full"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="h-3 w-3"><polyline points="20 6 9 17 4 12"></polyline></svg></span></div><!--${this.id + "-c0"}-->${props.label && `<span data-part="label" class="checkbox-label text-sm font-medium leading-none">${props.label}</span>` || ""}<!--${this.id + "-c0-end"}--></label>`;
395
+ }
396
+ __onPropChange(key, value) {
397
+ if (key === "class") try {
398
+ const __el = this.$(":scope");
399
+ this.props;
400
+ const __boundValue = `checkbox-root inline-flex items-center gap-2 cursor-pointer ${this.props.class || ""}`;
401
+ if (__el) {
402
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
403
+ if (__el.className !== __newClass) __el.className = __newClass;
404
+ }
405
+ } catch {}
406
+ if (key === "label") this.__geaPatchCond(0);
407
+ }
408
+ };
409
+ //#endregion
410
+ //#region src/components/clipboard.tsx
411
+ var Clipboard = class extends ZagComponent {
412
+ constructor(...args) {
413
+ super(...args);
414
+ this.copied = false;
415
+ this.props;
416
+ this.__geaCond_0 = !!this.props.label;
417
+ this.__geaCond_1 = !!this.copied;
418
+ this.__geaRegisterCond(0, "c0", () => {
419
+ this.props;
420
+ return this.props.label;
421
+ }, () => {
422
+ this.props;
423
+ return `<label data-part="label" class="clipboard-label text-sm font-medium mb-1 block">${this.props.label}</label>`;
424
+ }, null);
425
+ this.__geaRegisterCond(1, "c1", () => {
426
+ this.props;
427
+ return this.copied;
428
+ }, () => {
429
+ this.props;
430
+ return `<span data-part="indicator-copied">✓ Copied</span>`;
431
+ }, () => {
432
+ this.props;
433
+ return `<span data-part="indicator-not-copied">Copy</span>`;
434
+ });
435
+ }
436
+ createMachine(_props) {
437
+ return clipboard.machine;
438
+ }
439
+ getMachineProps(props) {
440
+ return {
441
+ id: this.id,
442
+ value: props.value,
443
+ defaultValue: props.defaultValue,
444
+ timeout: props.timeout ?? 2e3,
445
+ onStatusChange: (details) => {
446
+ this.copied = details.copied;
447
+ props.onStatusChange?.(details);
448
+ }
449
+ };
450
+ }
451
+ connectApi(service) {
452
+ return clipboard.connect(service, normalizeProps);
453
+ }
454
+ getSpreadMap() {
455
+ return {
456
+ "[data-part=\"root\"]": "getRootProps",
457
+ "[data-part=\"label\"]": "getLabelProps",
458
+ "[data-part=\"control\"]": "getControlProps",
459
+ "[data-part=\"trigger\"]": "getTriggerProps",
460
+ "[data-part=\"input\"]": "getInputProps",
461
+ "[data-part=\"indicator-copied\"]": (api) => api.getIndicatorProps({ copied: true }),
462
+ "[data-part=\"indicator-not-copied\"]": (api) => api.getIndicatorProps({ copied: false })
463
+ };
464
+ }
465
+ syncState(api) {
466
+ this.copied = api.copied;
467
+ }
468
+ template(props) {
469
+ return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<label data-part="label" class="clipboard-label text-sm font-medium mb-1 block">${props.label}</label>` || ""}<!--${this.id + "-c0-end"}--><div data-part="control" class="clipboard-control flex gap-2"><input data-part="input" class="clipboard-input flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm" /><button data-part="trigger" class="clipboard-trigger inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-3 text-sm shadow-sm hover:bg-accent"><!--${this.id + "-c1"}-->${(this.copied ? `<span data-part="indicator-copied">✓ Copied</span>` : `<span data-part="indicator-not-copied">Copy</span>`) || ""}<!--${this.id + "-c1-end"}--></button></div></div>`;
470
+ }
471
+ __onPropChange(key, value) {
472
+ if (key === "class") try {
473
+ const __el = this.$(":scope");
474
+ this.props;
475
+ const __boundValue = this.props.class || "";
476
+ if (__el) {
477
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
478
+ if (__el.className !== __newClass) __el.className = __newClass;
479
+ }
480
+ } catch {}
481
+ if (key === "label") this.__geaPatchCond(0);
482
+ this.__geaPatchCond(1);
483
+ }
484
+ __observe_local_copied(value, change) {
485
+ if (this.rendered_) {
486
+ this.__geaCondPatched_1 = this.__geaPatchCond(1);
487
+ if (this.__geaCondPatched_1) return;
488
+ }
489
+ }
490
+ __setupLocalStateObservers() {
491
+ if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
492
+ if (!this.__store) return;
493
+ this.__observer_removers__.push(this.__store.observe(["copied"], (__v, __c) => this.__observe_local_copied(__v, __c)));
494
+ }
495
+ dispose() {
496
+ if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
497
+ super.dispose();
498
+ }
499
+ };
500
+ //#endregion
501
+ //#region src/components/collapsible.tsx
502
+ var Collapsible = class extends ZagComponent {
503
+ createMachine(_props) {
504
+ return collapsible.machine;
505
+ }
506
+ getMachineProps(props) {
507
+ return {
508
+ id: this.id,
509
+ open: props.open,
510
+ defaultOpen: props.defaultOpen,
511
+ disabled: props.disabled,
512
+ onOpenChange: (details) => {
513
+ this.open = details.open;
514
+ props.onOpenChange?.(details);
515
+ }
516
+ };
517
+ }
518
+ connectApi(service) {
519
+ return collapsible.connect(service, normalizeProps);
520
+ }
521
+ getSpreadMap() {
522
+ return {
523
+ "[data-part=\"root\"]": "getRootProps",
524
+ "[data-part=\"trigger\"]": "getTriggerProps",
525
+ "[data-part=\"content\"]": "getContentProps"
526
+ };
527
+ }
528
+ syncState(api) {
529
+ this.open = api.open;
530
+ }
531
+ template(props) {
532
+ return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><button id="${this.id + "-b1"}" data-part="trigger" class="collapsible-trigger flex w-full items-center justify-between py-2 text-sm font-medium">${props.label || "Toggle"}</button><div data-part="content" class="collapsible-content overflow-hidden"><div id="${this.id + "-b2"}" class="pb-4">${props.children}</div></div></div>`;
533
+ }
534
+ __onPropChange(key, value) {
535
+ if (key === "class") try {
536
+ const __el = this.$(":scope");
537
+ this.props;
538
+ const __boundValue = this.props.class || "";
539
+ if (__el) {
540
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
541
+ if (__el.className !== __newClass) __el.className = __newClass;
542
+ }
543
+ } catch {}
544
+ if (key === "label") try {
545
+ const __el = document.getElementById(this.id + "-b1");
546
+ this.props;
547
+ const __boundValue = this.props.label || "Toggle";
548
+ if (__el) {
549
+ if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
550
+ }
551
+ } catch {}
552
+ if (key === "children") try {
553
+ const __el = document.getElementById(this.id + "-b2");
554
+ if (__el) {
555
+ if (__el.textContent !== value) __el.textContent = value;
556
+ }
557
+ } catch {}
558
+ }
559
+ };
560
+ //#endregion
561
+ //#region src/components/combobox.tsx
562
+ var Combobox = class extends ZagComponent {
563
+ constructor(...args) {
564
+ super(...args);
565
+ this.props;
566
+ this.__geaCond_0 = !!this.props.label;
567
+ this.__geaRegisterCond(0, "c0", () => {
568
+ this.props;
569
+ return this.props.label;
570
+ }, () => {
571
+ this.props;
572
+ return `<label data-part="label" class="combobox-label text-sm font-medium mb-1 block">${this.props.label}</label>`;
573
+ }, null);
574
+ }
575
+ created(props) {
576
+ this._allItems = props.items || [];
577
+ this.filteredItems = [...this._allItems];
578
+ super.created(props);
579
+ }
580
+ createMachine(_props) {
581
+ return combobox.machine;
582
+ }
583
+ _buildCollection(items) {
584
+ return combobox.collection({
585
+ items,
586
+ itemToValue: (item) => item.value,
587
+ itemToString: (item) => item.label || item.value
588
+ });
589
+ }
590
+ _filterItems(query) {
591
+ const q = query.toLowerCase();
592
+ const filtered = q ? this._allItems.filter((item) => (item.label || item.value).toLowerCase().includes(q)) : [...this._allItems];
593
+ this.filteredItems = filtered;
594
+ this._machine?.updateProps({ collection: this._buildCollection(filtered) });
595
+ }
596
+ getMachineProps(props) {
597
+ const col = props.collection || this._buildCollection(this._allItems);
598
+ return {
599
+ id: this.id,
600
+ collection: col,
601
+ value: props.value,
602
+ defaultValue: props.defaultValue,
603
+ inputValue: props.inputValue,
604
+ defaultInputValue: props.defaultInputValue,
605
+ open: props.open,
606
+ defaultOpen: props.defaultOpen,
607
+ multiple: props.multiple,
608
+ disabled: props.disabled,
609
+ readOnly: props.readOnly,
610
+ invalid: props.invalid,
611
+ required: props.required,
612
+ placeholder: props.placeholder,
613
+ inputBehavior: props.inputBehavior ?? "none",
614
+ selectionBehavior: props.selectionBehavior ?? "replace",
615
+ closeOnSelect: props.closeOnSelect ?? true,
616
+ allowCustomValue: props.allowCustomValue,
617
+ loopFocus: props.loopFocus ?? true,
618
+ openOnClick: props.openOnClick ?? false,
619
+ name: props.name,
620
+ form: props.form,
621
+ positioning: props.positioning,
622
+ onValueChange: (details) => {
623
+ this.value = details.value;
624
+ props.onValueChange?.(details);
625
+ },
626
+ onInputValueChange: (details) => {
627
+ this.inputValue = details.inputValue;
628
+ this._filterItems(details.inputValue);
629
+ props.onInputValueChange?.(details);
630
+ },
631
+ onOpenChange: (details) => {
632
+ this.open = details.open;
633
+ props.onOpenChange?.(details);
634
+ }
635
+ };
636
+ }
637
+ connectApi(service) {
638
+ return combobox.connect(service, normalizeProps);
639
+ }
640
+ getSpreadMap() {
641
+ return {
642
+ "[data-part=\"root\"]": "getRootProps",
643
+ "[data-part=\"label\"]": "getLabelProps",
644
+ "[data-part=\"control\"]": "getControlProps",
645
+ "[data-part=\"input\"]": "getInputProps",
646
+ "[data-part=\"trigger\"]": "getTriggerProps",
647
+ "[data-part=\"clear-trigger\"]": "getClearTriggerProps",
648
+ "[data-part=\"positioner\"]": "getPositionerProps",
649
+ "[data-part=\"content\"]": "getContentProps",
650
+ "[data-part=\"list\"]": "getListProps",
651
+ "[data-part=\"item\"]": (api, el) => {
652
+ const value = el.dataset.value;
653
+ const label = el.dataset.label || value;
654
+ return api.getItemProps({ item: {
655
+ value,
656
+ label
657
+ } });
658
+ },
659
+ "[data-part=\"item-text\"]": (api, el) => {
660
+ const value = el.dataset.value;
661
+ const label = el.dataset.label || value;
662
+ return api.getItemTextProps({ item: {
663
+ value,
664
+ label
665
+ } });
666
+ },
667
+ "[data-part=\"item-indicator\"]": (api, el) => {
668
+ const value = el.dataset.value;
669
+ const label = el.dataset.label || value;
670
+ return api.getItemIndicatorProps({ item: {
671
+ value,
672
+ label
673
+ } });
674
+ }
675
+ };
676
+ }
677
+ syncState(api) {
678
+ this.open = api.open;
679
+ this.value = api.value;
680
+ this.inputValue = api.inputValue;
681
+ }
682
+ template(props) {
683
+ return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<label data-part="label" class="combobox-label text-sm font-medium mb-1 block">${props.label}</label>` || ""}<!--${this.id + "-c0-end"}--><div data-part="control" class="combobox-control flex"><input data-part="input" class="combobox-input flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring" /><button data-part="trigger" class="combobox-trigger inline-flex h-9 items-center justify-center rounded-r-md border border-l-0 border-input px-2">▼</button></div><div data-part="positioner" class="combobox-positioner"><div data-part="content" class="combobox-content z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md"><div id="${this.id + "-b1"}" data-part="list">${this.filteredItems.map((item) => this.renderFilteredItemsItem(item)).join("")}</div></div></div></div>`;
684
+ }
685
+ __onPropChange(key, value) {
686
+ if (key === "class") try {
687
+ const __el = this.$(":scope");
688
+ this.props;
689
+ const __boundValue = this.props.class || "";
690
+ if (__el) {
691
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
692
+ if (__el.className !== __newClass) __el.className = __newClass;
693
+ }
694
+ } catch {}
695
+ if (key === "label") this.__geaPatchCond(0);
696
+ }
697
+ renderFilteredItemsItem(item) {
698
+ const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
699
+ return `<div id="${this.id + "-b1-" + String(item.id)}" data-gea-item-id="${item.id}" data-part="item"${__v(item.value) == __v(null) ? "" : ` data-value="${item.value}"`}${__v(item.label) == __v(null) ? "" : ` data-label="${item.label}"`} class="combobox-item relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground"><span data-part="item-text"${__v(item.value) == __v(null) ? "" : ` data-value="${item.value}"`}${__v(item.label) == __v(null) ? "" : ` data-label="${item.label}"`}>${item.label}</span><span data-part="item-indicator"${__v(item.value) == __v(null) ? "" : ` data-value="${item.value}"`}${__v(item.label) == __v(null) ? "" : ` data-label="${item.label}"`} class="combobox-item-indicator ml-auto">✓</span></div>`;
700
+ }
701
+ createFilteredItemsItem(item) {
702
+ var __c = this.__filteredItems_container;
703
+ if (!__c.__geaTpl) try {
704
+ var __tw = __c.cloneNode(false);
705
+ __tw.innerHTML = this.renderFilteredItemsItem({
706
+ id: 0,
707
+ value: "",
708
+ label: ""
709
+ });
710
+ __c.__geaTpl = __tw.firstElementChild;
711
+ } catch {}
712
+ if (!__c.__geaIdPfx) __c.__geaIdPfx = this.id_ + "-b1-";
713
+ if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
714
+ else {
715
+ var __fw = __c.cloneNode(false);
716
+ __fw.innerHTML = this.renderFilteredItemsItem(item);
717
+ var el = __fw.firstElementChild;
718
+ }
719
+ var __av = item.value;
720
+ if (__av == null || __av === false) el.removeAttribute("data-value");
721
+ else el.setAttribute("data-value", String(__av));
722
+ var __av = item.label;
723
+ if (__av == null || __av === false) el.removeAttribute("data-label");
724
+ else el.setAttribute("data-label", String(__av));
725
+ var __av = item.value;
726
+ if (__av == null || __av === false) el.firstElementChild.removeAttribute("data-value");
727
+ else el.firstElementChild.setAttribute("data-value", String(__av));
728
+ var __av = item.label;
729
+ if (__av == null || __av === false) el.firstElementChild.removeAttribute("data-label");
730
+ else el.firstElementChild.setAttribute("data-label", String(__av));
731
+ el.firstElementChild.textContent = `
732
+ ${item.label}
733
+ `;
734
+ var __av = item.value;
735
+ if (__av == null || __av === false) el.firstElementChild.nextElementSibling.removeAttribute("data-value");
736
+ else el.firstElementChild.nextElementSibling.setAttribute("data-value", String(__av));
737
+ var __av = item.label;
738
+ if (__av == null || __av === false) el.firstElementChild.nextElementSibling.removeAttribute("data-label");
739
+ else el.firstElementChild.nextElementSibling.setAttribute("data-label", String(__av));
740
+ el.setAttribute("data-gea-item-id", item.id);
741
+ el.id = __c.__geaIdPfx + item.id;
742
+ el.__geaItem = item;
743
+ return el;
744
+ }
745
+ __observe_local_filteredItems(filteredItems, change) {
746
+ if (!this.__filteredItems_container) this.__filteredItems_container = document.getElementById(this.id + "-b1");
747
+ if (!this.__filteredItems_container) return;
748
+ if (Array.isArray(filteredItems) && filteredItems.length === 0 && this.__filteredItems_container.children.length > 0) {
749
+ this.__filteredItems_container.textContent = "";
750
+ return;
751
+ }
752
+ if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
753
+ this.__applyListChanges(this.__filteredItems_container, filteredItems, change, this.__filteredItemsListConfig);
754
+ }
755
+ __ensureArrayConfigs() {
756
+ if (!this.__filteredItemsListConfig) this.__filteredItemsListConfig = {
757
+ arrayPathParts: ["filteredItems"],
758
+ render: (item) => this.renderFilteredItemsItem(item),
759
+ create: (item) => this.createFilteredItemsItem(item),
760
+ propPatchers: {
761
+ "value": [
762
+ (row, value, item) => {
763
+ const __target = row;
764
+ if (!__target) return;
765
+ const __attrValue = item.value;
766
+ if (__attrValue == null || __attrValue === false) __target.removeAttribute("data-value");
767
+ else __target.setAttribute("data-value", String(__attrValue));
768
+ },
769
+ (row, value, item) => {
770
+ const __target = row.firstElementChild;
771
+ if (!__target) return;
772
+ const __attrValue = item.value;
773
+ if (__attrValue == null || __attrValue === false) __target.removeAttribute("data-value");
774
+ else __target.setAttribute("data-value", String(__attrValue));
775
+ },
776
+ (row, value, item) => {
777
+ const __target = row.firstElementChild.nextElementSibling;
778
+ if (!__target) return;
779
+ const __attrValue = item.value;
780
+ if (__attrValue == null || __attrValue === false) __target.removeAttribute("data-value");
781
+ else __target.setAttribute("data-value", String(__attrValue));
782
+ },
783
+ (row, value) => row.classList.toggle("value", value),
784
+ (row, value) => row.classList.toggle("value", value),
785
+ (row, value) => row.classList.toggle("value", value)
786
+ ],
787
+ "label": [
788
+ (row, value, item) => {
789
+ const __target = row;
790
+ if (!__target) return;
791
+ const __attrValue = item.label;
792
+ if (__attrValue == null || __attrValue === false) __target.removeAttribute("data-label");
793
+ else __target.setAttribute("data-label", String(__attrValue));
794
+ },
795
+ (row, value, item) => {
796
+ const __target = row.firstElementChild;
797
+ if (!__target) return;
798
+ const __attrValue = item.label;
799
+ if (__attrValue == null || __attrValue === false) __target.removeAttribute("data-label");
800
+ else __target.setAttribute("data-label", String(__attrValue));
801
+ },
802
+ (row, value, item) => {
803
+ const __target = row.firstElementChild;
804
+ if (!__target) return;
805
+ __target.firstChild && (__target.firstChild.nodeValue = `
806
+ ${item.label}
807
+ `) || (__target.textContent = `
808
+ ${item.label}
809
+ `);
810
+ },
811
+ (row, value, item) => {
812
+ const __target = row.firstElementChild.nextElementSibling;
813
+ if (!__target) return;
814
+ const __attrValue = item.label;
815
+ if (__attrValue == null || __attrValue === false) __target.removeAttribute("data-label");
816
+ else __target.setAttribute("data-label", String(__attrValue));
817
+ },
818
+ (row, value) => row.classList.toggle("label", value),
819
+ (row, value) => row.classList.toggle("label", value),
820
+ (row, value) => row.classList.toggle("label", value)
821
+ ]
822
+ }
823
+ };
824
+ }
825
+ __setupLocalStateObservers() {
826
+ if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
827
+ if (!this.__store) return;
828
+ this.__observer_removers__.push(this.__store.observe(["filteredItems"], (__v, __c) => this.__observe_local_filteredItems(__v, __c)));
829
+ }
830
+ dispose() {
831
+ if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
832
+ super.dispose();
833
+ }
834
+ };
835
+ //#endregion
836
+ //#region src/components/dialog.tsx
837
+ var Dialog = class extends ZagComponent {
838
+ constructor(...args) {
839
+ super(...args);
840
+ this.props;
841
+ this.__geaCond_0 = !!this.props.title;
842
+ this.__geaCond_1 = !!this.props.description;
843
+ this.__geaRegisterCond(0, "c0", () => {
844
+ this.props;
845
+ return this.props.title;
846
+ }, () => {
847
+ this.props;
848
+ return `<h2 data-part="title" class="dialog-title text-lg font-semibold mb-2">${this.props.title}</h2>`;
849
+ }, null);
850
+ this.__geaRegisterCond(1, "c1", () => {
851
+ this.props;
852
+ return this.props.description;
853
+ }, () => {
854
+ this.props;
855
+ return `<p data-part="description" class="dialog-description text-sm text-gray-500 mb-4">${this.props.description}</p>`;
856
+ }, null);
857
+ }
858
+ createMachine(_props) {
859
+ return dialog.machine;
860
+ }
861
+ getMachineProps(props) {
862
+ return {
863
+ id: this.id,
864
+ open: props.open,
865
+ defaultOpen: props.defaultOpen,
866
+ modal: props.modal ?? true,
867
+ closeOnInteractOutside: props.closeOnInteractOutside ?? true,
868
+ closeOnEscape: props.closeOnEscape ?? true,
869
+ trapFocus: props.trapFocus ?? true,
870
+ preventScroll: props.preventScroll ?? true,
871
+ role: props.role ?? "dialog",
872
+ "aria-label": props["aria-label"],
873
+ onOpenChange: (details) => {
874
+ this.open = details.open;
875
+ props.onOpenChange?.(details);
876
+ }
877
+ };
878
+ }
879
+ connectApi(service) {
880
+ return dialog.connect(service, normalizeProps);
881
+ }
882
+ getSpreadMap() {
883
+ return {
884
+ "[data-part=\"backdrop\"]": "getBackdropProps",
885
+ "[data-part=\"positioner\"]": (api) => ({
886
+ ...api.getPositionerProps(),
887
+ hidden: !api.open
888
+ }),
889
+ "[data-part=\"content\"]": "getContentProps",
890
+ "[data-part=\"title\"]": "getTitleProps",
891
+ "[data-part=\"description\"]": "getDescriptionProps",
892
+ "[data-part=\"close-trigger\"]": (api) => {
893
+ const { id: _, ...props } = api.getCloseTriggerProps();
894
+ return {
895
+ ...props,
896
+ onclick: (e) => {
897
+ if (e.defaultPrevented) return;
898
+ api.setOpen(false);
899
+ }
900
+ };
901
+ },
902
+ "[data-part=\"trigger\"]": (api) => {
903
+ const props = api.getTriggerProps();
904
+ const origOnClick = props.onclick;
905
+ const preventTriggerFocus = (e) => {
906
+ if ("button" in e && e.button !== 0) return;
907
+ e.preventDefault();
908
+ };
909
+ return {
910
+ ...props,
911
+ onpointerdown: preventTriggerFocus,
912
+ onmousedown: preventTriggerFocus,
913
+ onclick: (e) => {
914
+ e.currentTarget?.blur();
915
+ origOnClick?.(e);
916
+ }
917
+ };
918
+ }
919
+ };
920
+ }
921
+ syncState(api) {
922
+ this.open = api.open;
923
+ }
924
+ template(props) {
925
+ return `<div id="${this.id}"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><button id="${this.id + "-b1"}" data-part="trigger" class="dialog-trigger">${props.triggerLabel || "Open"}</button><div data-part="backdrop" class="dialog-backdrop fixed inset-0 bg-black/50 z-50" hidden></div><div data-part="positioner" class="dialog-positioner fixed inset-0 flex items-center justify-center z-50" hidden><div data-part="content" class="dialog-content bg-white rounded-lg shadow-xl p-6 w-full max-w-md mx-4"><!--${this.id + "-c0"}-->${props.title && `<h2 data-part="title" class="dialog-title text-lg font-semibold mb-2">${props.title}</h2>` || ""}<!--${this.id + "-c0-end"}--><!--${this.id + "-c1"}-->${props.description && `<p data-part="description" class="dialog-description text-sm text-gray-500 mb-4">${props.description}</p>` || ""}<!--${this.id + "-c1-end"}--><div id="${this.id + "-b2"}" class="dialog-body">${props.children}</div><button data-part="close-trigger" class="dialog-close-trigger absolute top-3 right-3 text-gray-400 hover:text-gray-600">✕</button></div></div></div>`;
926
+ }
927
+ __onPropChange(key, value) {
928
+ if (key === "class") try {
929
+ const __el = this.$(":scope");
930
+ this.props;
931
+ const __boundValue = this.props.class || "";
932
+ if (__el) {
933
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
934
+ if (__el.className !== __newClass) __el.className = __newClass;
935
+ }
936
+ } catch {}
937
+ if (key === "triggerLabel") try {
938
+ const __el = document.getElementById(this.id + "-b1");
939
+ this.props;
940
+ const __boundValue = this.props.triggerLabel || "Open";
941
+ if (__el) {
942
+ if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
943
+ }
944
+ } catch {}
945
+ if (key === "children") try {
946
+ const __el = document.getElementById(this.id + "-b2");
947
+ if (__el) {
948
+ if (__el.textContent !== value) __el.textContent = value;
949
+ }
950
+ } catch {}
951
+ if (key === "title") this.__geaPatchCond(0);
952
+ if (key === "description") this.__geaPatchCond(1);
953
+ }
954
+ };
955
+ //#endregion
956
+ //#region src/components/file-upload.tsx
957
+ var FileUpload = class extends ZagComponent {
958
+ constructor(...args) {
959
+ super(...args);
960
+ this.props;
961
+ this.__geaCond_0 = !!this.props.label;
962
+ this.__geaCond_1 = !!(this.acceptedFiles.length > 0);
963
+ this.__geaRegisterCond(0, "c0", () => {
964
+ this.props;
965
+ return this.props.label;
966
+ }, () => {
967
+ this.props;
968
+ return `<label data-part="label" class="file-upload-label text-sm font-medium mb-2 block">${this.props.label}</label>`;
969
+ }, null);
970
+ this.__geaRegisterCond(1, "c1", () => {
971
+ this.props;
972
+ return this.acceptedFiles.length > 0;
973
+ }, () => {
974
+ this.props;
975
+ return `<div class="file-upload-file-list mt-3 space-y-1">${this.acceptedFiles.map((file) => this.renderAcceptedFilesItem(file)).join("")}<button data-part="clear-trigger" class="file-upload-clear text-xs text-muted-foreground hover:text-foreground mt-1">Clear all</button></div>`;
976
+ }, null);
977
+ }
978
+ createMachine(_props) {
979
+ return fileUpload.machine;
980
+ }
981
+ getMachineProps(props) {
982
+ return {
983
+ id: this.id,
984
+ accept: props.accept,
985
+ maxFiles: props.maxFiles,
986
+ maxFileSize: props.maxFileSize,
987
+ minFileSize: props.minFileSize,
988
+ multiple: props.multiple ?? false,
989
+ disabled: props.disabled,
990
+ allowDrop: props.allowDrop ?? true,
991
+ name: props.name,
992
+ onFileChange: (details) => {
993
+ this.acceptedFiles = details.acceptedFiles;
994
+ this.rejectedFiles = details.rejectedFiles;
995
+ props.onFileChange?.(details);
996
+ }
997
+ };
998
+ }
999
+ connectApi(service) {
1000
+ return fileUpload.connect(service, normalizeProps);
1001
+ }
1002
+ getSpreadMap() {
1003
+ return {
1004
+ "[data-part=\"root\"]": "getRootProps",
1005
+ "[data-part=\"label\"]": "getLabelProps",
1006
+ "[data-part=\"dropzone\"]": "getDropzoneProps",
1007
+ "[data-part=\"trigger\"]": "getTriggerProps",
1008
+ "[data-part=\"hidden-input\"]": "getHiddenInputProps",
1009
+ "[data-part=\"clear-trigger\"]": "getClearTriggerProps"
1010
+ };
1011
+ }
1012
+ syncState(api) {
1013
+ this.acceptedFiles = api.acceptedFiles;
1014
+ this.rejectedFiles = api.rejectedFiles;
1015
+ }
1016
+ template(props) {
1017
+ return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<label data-part="label" class="file-upload-label text-sm font-medium mb-2 block">${props.label}</label>` || ""}<!--${this.id + "-c0-end"}--><div data-part="dropzone" class="file-upload-dropzone flex flex-col items-center justify-center rounded-lg border-2 border-dashed border-muted-foreground/25 p-8 text-center hover:border-muted-foreground/50 transition-colors"><p class="text-sm text-muted-foreground mb-2">Drag and drop files here</p><button data-part="trigger" class="file-upload-trigger inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow hover:bg-primary/90">Choose Files</button></div><input data-part="hidden-input" type="file" class="sr-only" /><!--${this.id + "-c1"}-->${this.acceptedFiles.length > 0 && `<div class="file-upload-file-list mt-3 space-y-1">${this.acceptedFiles.map((file) => this.renderAcceptedFilesItem(file)).join("")}<button data-part="clear-trigger" class="file-upload-clear text-xs text-muted-foreground hover:text-foreground mt-1">Clear all</button></div>` || ""}<!--${this.id + "-c1-end"}--></div>`;
1018
+ }
1019
+ __onPropChange(key, value) {
1020
+ if (key === "class") try {
1021
+ const __el = this.$(":scope");
1022
+ this.props;
1023
+ const __boundValue = this.props.class || "";
1024
+ if (__el) {
1025
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
1026
+ if (__el.className !== __newClass) __el.className = __newClass;
1027
+ }
1028
+ } catch {}
1029
+ if (key === "label") this.__geaPatchCond(0);
1030
+ this.__geaPatchCond(1);
1031
+ }
1032
+ __observe_local_acceptedFiles(value, change) {
1033
+ if (this.rendered_) {
1034
+ this.__geaCondPatched_1 = this.__geaPatchCond(1);
1035
+ if (this.__geaCondPatched_1) return;
1036
+ }
1037
+ if (!this.__acceptedFiles_container) this.__acceptedFiles_container = this.$(":scope");
1038
+ if (!this.__acceptedFiles_container) return;
1039
+ if (Array.isArray(value) && value.length === 0 && this.__acceptedFiles_container.children.length > 0) {
1040
+ this.__acceptedFiles_container.textContent = "";
1041
+ return;
1042
+ }
1043
+ if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
1044
+ this.__applyListChanges(this.__acceptedFiles_container, value, change, this.__acceptedFilesListConfig);
1045
+ }
1046
+ renderAcceptedFilesItem(file) {
1047
+ return `<div data-gea-item-id="${file.id}" class="flex items-center justify-between rounded-md border px-3 py-2 text-sm"><span>${file.name}</span></div>`;
1048
+ }
1049
+ createAcceptedFilesItem(item) {
1050
+ var __c = this.__acceptedFiles_container;
1051
+ if (!__c.__geaTpl) try {
1052
+ var __tw = __c.cloneNode(false);
1053
+ __tw.innerHTML = this.renderAcceptedFilesItem({
1054
+ id: 0,
1055
+ name: ""
1056
+ });
1057
+ __c.__geaTpl = __tw.firstElementChild;
1058
+ } catch {}
1059
+ if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
1060
+ else {
1061
+ var __fw = __c.cloneNode(false);
1062
+ __fw.innerHTML = this.renderAcceptedFilesItem(item);
1063
+ var el = __fw.firstElementChild;
1064
+ }
1065
+ el.firstElementChild.textContent = `${item.name}`;
1066
+ el.setAttribute("data-gea-item-id", item.id);
1067
+ el.__geaItem = item;
1068
+ return el;
1069
+ }
1070
+ __ensureArrayConfigs() {
1071
+ if (!this.__acceptedFilesListConfig) this.__acceptedFilesListConfig = {
1072
+ arrayPathParts: ["acceptedFiles"],
1073
+ render: (item) => this.renderAcceptedFilesItem(item),
1074
+ create: (item) => this.createAcceptedFilesItem(item),
1075
+ propPatchers: { "name": [(row, value, item) => {
1076
+ const __target = row.firstElementChild;
1077
+ if (!__target) return;
1078
+ __target.firstChild && (__target.firstChild.nodeValue = `${item.name}`) || (__target.textContent = `${item.name}`);
1079
+ }] }
1080
+ };
1081
+ }
1082
+ __setupLocalStateObservers() {
1083
+ if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
1084
+ if (!this.__store) return;
1085
+ this.__observer_removers__.push(this.__store.observe(["acceptedFiles"], (__v, __c) => this.__observe_local_acceptedFiles(__v, __c)));
1086
+ }
1087
+ dispose() {
1088
+ if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
1089
+ super.dispose();
1090
+ }
1091
+ };
1092
+ //#endregion
1093
+ //#region src/components/hover-card.tsx
1094
+ var HoverCard = class extends ZagComponent {
1095
+ createMachine(_props) {
1096
+ return hoverCard.machine;
1097
+ }
1098
+ getMachineProps(props) {
1099
+ return {
1100
+ id: this.id,
1101
+ open: props.open,
1102
+ defaultOpen: props.defaultOpen,
1103
+ openDelay: props.openDelay,
1104
+ closeDelay: props.closeDelay,
1105
+ positioning: props.positioning,
1106
+ onOpenChange: (details) => {
1107
+ this.open = details.open;
1108
+ props.onOpenChange?.(details);
1109
+ }
1110
+ };
1111
+ }
1112
+ connectApi(service) {
1113
+ return hoverCard.connect(service, normalizeProps);
1114
+ }
1115
+ getSpreadMap() {
1116
+ return {
1117
+ "[data-part=\"trigger\"]": "getTriggerProps",
1118
+ "[data-part=\"positioner\"]": "getPositionerProps",
1119
+ "[data-part=\"content\"]": "getContentProps",
1120
+ "[data-part=\"arrow\"]": "getArrowProps",
1121
+ "[data-part=\"arrow-tip\"]": "getArrowTipProps"
1122
+ };
1123
+ }
1124
+ syncState(api) {
1125
+ this.open = api.open;
1126
+ }
1127
+ template(props) {
1128
+ return `<div id="${this.id}"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`} style="display: inline-block;"><a id="${this.id + "-b1"}" data-part="trigger"${(props.href || "#") == null || (props.href || "#") === false ? "" : ` href="${props.href || "#"}"`} class="hover-card-trigger inline-block">${props.triggerLabel || "Hover me"}</a><div data-part="positioner" class="hover-card-positioner"><div id="${this.id + "-b2"}" data-part="content" class="hover-card-content z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none">${props.children}</div></div></div>`;
1129
+ }
1130
+ __onPropChange(key, value) {
1131
+ if (key === "class") try {
1132
+ const __el = this.$(":scope");
1133
+ this.props;
1134
+ const __boundValue = this.props.class || "";
1135
+ if (__el) {
1136
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
1137
+ if (__el.className !== __newClass) __el.className = __newClass;
1138
+ }
1139
+ } catch {}
1140
+ if (key === "href") try {
1141
+ const __el = document.getElementById(this.id + "-b1");
1142
+ this.props;
1143
+ const __boundValue = this.props.href || "#";
1144
+ if (__el) if (__boundValue === null || __boundValue === void 0) __el.removeAttribute("href");
1145
+ else __el.setAttribute("href", String(__boundValue));
1146
+ } catch {}
1147
+ if (key === "triggerLabel") try {
1148
+ const __el = document.getElementById(this.id + "-b1");
1149
+ this.props;
1150
+ const __boundValue = this.props.triggerLabel || "Hover me";
1151
+ if (__el) {
1152
+ if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
1153
+ }
1154
+ } catch {}
1155
+ if (key === "children") try {
1156
+ const __el = document.getElementById(this.id + "-b2");
1157
+ if (__el) {
1158
+ if (__el.textContent !== value) __el.textContent = value;
1159
+ }
1160
+ } catch {}
1161
+ }
1162
+ };
1163
+ //#endregion
1164
+ //#region src/components/menu.tsx
1165
+ var Menu = class extends ZagComponent {
1166
+ createMachine(_props) {
1167
+ return menu.machine;
1168
+ }
1169
+ getMachineProps(props) {
1170
+ return {
1171
+ id: this.id,
1172
+ open: props.open,
1173
+ defaultOpen: props.defaultOpen,
1174
+ closeOnSelect: props.closeOnSelect ?? true,
1175
+ loopFocus: props.loopFocus ?? false,
1176
+ positioning: props.positioning,
1177
+ onOpenChange: (details) => {
1178
+ this.open = details.open;
1179
+ props.onOpenChange?.(details);
1180
+ },
1181
+ onSelect: props.onSelect
1182
+ };
1183
+ }
1184
+ connectApi(service) {
1185
+ return menu.connect(service, normalizeProps);
1186
+ }
1187
+ getSpreadMap() {
1188
+ return {
1189
+ "[data-part=\"trigger\"]": "getTriggerProps",
1190
+ "[data-part=\"positioner\"]": "getPositionerProps",
1191
+ "[data-part=\"content\"]": "getContentProps",
1192
+ "[data-part=\"separator\"]": "getSeparatorProps",
1193
+ "[data-part=\"item\"]": (api, el) => api.getItemProps({ value: el.dataset.value }),
1194
+ "[data-part=\"item-group\"]": (api, el) => api.getItemGroupProps({ id: el.dataset.groupId }),
1195
+ "[data-part=\"item-group-label\"]": (api, el) => api.getItemGroupLabelProps({ htmlFor: el.dataset.htmlFor })
1196
+ };
1197
+ }
1198
+ syncState(api) {
1199
+ this.open = api.open;
1200
+ }
1201
+ template(props) {
1202
+ const items = props.items || [];
1203
+ return `<div id="${this.id}"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><button id="${this.id + "-b1"}" data-part="trigger" class="menu-trigger inline-flex items-center justify-center gap-1 rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm hover:bg-accent hover:text-accent-foreground">${props.triggerLabel || "Menu"}</button><div data-part="positioner" class="menu-positioner"><div id="${this.id + "-b2"}" data-part="content" class="menu-content z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md">${items.map((item) => item.type === "separator" ? `<div id="${this.id + "-b2-" + String(String(item))}" data-gea-item-id="${String(item)}" data-part="separator" class="menu-separator -mx-1 my-1 h-px bg-muted"></div>` : `<div data-part="item"${item.value == null ? "" : ` data-value="${item.value}"`} class="menu-item relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50">${item.label}</div>`).join("") + "<!---->"}</div></div></div>`;
1204
+ }
1205
+ render__unresolved_0Item(item) {
1206
+ return `<div id="${this.id + "-b2-" + String(String(item))}" data-gea-item-id="${String(item)}" data-part="separator" class="menu-separator -mx-1 my-1 h-px bg-muted"></div>`;
1207
+ }
1208
+ __onPropChange(key, value) {
1209
+ if (key === "class") try {
1210
+ const __el = this.$(":scope");
1211
+ this.props;
1212
+ const __boundValue = this.props.class || "";
1213
+ if (__el) {
1214
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
1215
+ if (__el.className !== __newClass) __el.className = __newClass;
1216
+ }
1217
+ } catch {}
1218
+ if (key === "triggerLabel") try {
1219
+ const __el = document.getElementById(this.id + "-b1");
1220
+ this.props;
1221
+ const __boundValue = this.props.triggerLabel || "Menu";
1222
+ if (__el) {
1223
+ if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
1224
+ }
1225
+ } catch {}
1226
+ if (key === "items") this.__geaSyncMap(0);
1227
+ }
1228
+ __observe_local_props(__v, __c) {
1229
+ this.__geaSyncMap(0);
1230
+ }
1231
+ createdHooks() {
1232
+ if (!this.__observer_removers__) this.__observer_removers__ = [];
1233
+ if (!this.__stores) this.__stores = {};
1234
+ this.__observer_removers__.forEach((fn) => fn());
1235
+ this.__observer_removers__ = [];
1236
+ if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
1237
+ this.__geaRegisterMap(0, "____unresolved_0_container", () => document.getElementById(this.id + "-b2"), () => {
1238
+ return this.props.items || [];
1239
+ }, (__item) => this.create__unresolved_0Item(__item));
1240
+ }
1241
+ dispose() {
1242
+ if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
1243
+ super.dispose();
1244
+ }
1245
+ };
1246
+ //#endregion
1247
+ //#region src/components/number-input.tsx
1248
+ var NumberInput = class extends ZagComponent {
1249
+ constructor(...args) {
1250
+ super(...args);
1251
+ this.props;
1252
+ this.__geaCond_0 = !!this.props.label;
1253
+ this.__geaRegisterCond(0, "c0", () => {
1254
+ this.props;
1255
+ return this.props.label;
1256
+ }, () => {
1257
+ this.props;
1258
+ return `<label data-part="label" class="number-input-label text-sm font-medium mb-1 block">${this.props.label}</label>`;
1259
+ }, null);
1260
+ }
1261
+ createMachine(_props) {
1262
+ return numberInput.machine;
1263
+ }
1264
+ getMachineProps(props) {
1265
+ return {
1266
+ id: this.id,
1267
+ value: props.value,
1268
+ defaultValue: props.defaultValue,
1269
+ min: props.min,
1270
+ max: props.max,
1271
+ step: props.step ?? 1,
1272
+ disabled: props.disabled,
1273
+ readOnly: props.readOnly,
1274
+ invalid: props.invalid,
1275
+ required: props.required,
1276
+ name: props.name,
1277
+ form: props.form,
1278
+ allowMouseWheel: props.allowMouseWheel,
1279
+ clampValueOnBlur: props.clampValueOnBlur ?? true,
1280
+ formatOptions: props.formatOptions,
1281
+ locale: props.locale,
1282
+ onValueChange: (details) => {
1283
+ this.value = details.value;
1284
+ this.valueAsNumber = details.valueAsNumber;
1285
+ props.onValueChange?.(details);
1286
+ }
1287
+ };
1288
+ }
1289
+ connectApi(service) {
1290
+ return numberInput.connect(service, normalizeProps);
1291
+ }
1292
+ getSpreadMap() {
1293
+ return {
1294
+ "[data-part=\"root\"]": "getRootProps",
1295
+ "[data-part=\"label\"]": "getLabelProps",
1296
+ "[data-part=\"control\"]": "getControlProps",
1297
+ "[data-part=\"input\"]": "getInputProps",
1298
+ "[data-part=\"increment-trigger\"]": "getIncrementTriggerProps",
1299
+ "[data-part=\"decrement-trigger\"]": "getDecrementTriggerProps",
1300
+ "[data-part=\"scrubber\"]": "getScrubberProps"
1301
+ };
1302
+ }
1303
+ syncState(api) {
1304
+ this.value = api.value;
1305
+ this.valueAsNumber = api.valueAsNumber;
1306
+ }
1307
+ template(props) {
1308
+ return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<label data-part="label" class="number-input-label text-sm font-medium mb-1 block">${props.label}</label>` || ""}<!--${this.id + "-c0-end"}--><div data-part="control" class="number-input-control flex"><button data-part="decrement-trigger" class="number-input-decrement inline-flex h-9 items-center justify-center rounded-l-md border border-r-0 border-input px-2 hover:bg-accent">−</button><input data-part="input" class="number-input-input h-9 w-full border border-input bg-transparent px-3 text-center text-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring" /><button data-part="increment-trigger" class="number-input-increment inline-flex h-9 items-center justify-center rounded-r-md border border-l-0 border-input px-2 hover:bg-accent">+</button></div></div>`;
1309
+ }
1310
+ __onPropChange(key, value) {
1311
+ if (key === "class") try {
1312
+ const __el = this.$(":scope");
1313
+ this.props;
1314
+ const __boundValue = this.props.class || "";
1315
+ if (__el) {
1316
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
1317
+ if (__el.className !== __newClass) __el.className = __newClass;
1318
+ }
1319
+ } catch {}
1320
+ if (key === "label") this.__geaPatchCond(0);
1321
+ }
1322
+ };
1323
+ //#endregion
1324
+ //#region src/components/pagination.tsx
1325
+ var Pagination = class extends ZagComponent {
1326
+ constructor(..._args) {
1327
+ super(..._args);
1328
+ this.page = 1;
1329
+ this.totalPages = 1;
1330
+ }
1331
+ createMachine(_props) {
1332
+ return pagination.machine;
1333
+ }
1334
+ getMachineProps(props) {
1335
+ return {
1336
+ id: this.id,
1337
+ count: props.count ?? 0,
1338
+ page: props.page,
1339
+ defaultPage: props.defaultPage ?? 1,
1340
+ pageSize: props.pageSize,
1341
+ defaultPageSize: props.defaultPageSize ?? 10,
1342
+ siblingCount: props.siblingCount ?? 1,
1343
+ type: props.type ?? "button",
1344
+ onPageChange: (details) => {
1345
+ this.page = details.page;
1346
+ props.onPageChange?.(details);
1347
+ },
1348
+ onPageSizeChange: props.onPageSizeChange
1349
+ };
1350
+ }
1351
+ connectApi(service) {
1352
+ return pagination.connect(service, normalizeProps);
1353
+ }
1354
+ getSpreadMap() {
1355
+ return {
1356
+ "[data-part=\"root\"]": "getRootProps",
1357
+ "[data-part=\"prev-trigger\"]": "getPrevTriggerProps",
1358
+ "[data-part=\"next-trigger\"]": "getNextTriggerProps",
1359
+ "[data-part=\"item\"]": (api, el) => {
1360
+ const value = parseInt(el.dataset.value || "1", 10);
1361
+ return api.getItemProps({
1362
+ type: "page",
1363
+ value
1364
+ });
1365
+ },
1366
+ "[data-part=\"ellipsis\"]": (api, el) => {
1367
+ const index = parseInt(el.dataset.index || "0", 10);
1368
+ return api.getEllipsisProps({ index });
1369
+ }
1370
+ };
1371
+ }
1372
+ syncState(api) {
1373
+ this.page = api.page;
1374
+ this.totalPages = api.totalPages;
1375
+ }
1376
+ template(props) {
1377
+ return `<nav id="${this.id}" data-part="root"${`pagination-root ${props.class || ""}` == null ? "" : ` class="${`pagination-root ${props.class || ""}`.trim()}"`}><div class="flex items-center gap-1"><button data-part="prev-trigger" class="pagination-prev inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-3 text-sm shadow-sm hover:bg-accent disabled:opacity-50">‹ Prev</button><button data-part="next-trigger" class="pagination-next inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-3 text-sm shadow-sm hover:bg-accent disabled:opacity-50">Next ›</button></div></nav>`;
1378
+ }
1379
+ __onPropChange(key, value) {
1380
+ if (key === "class") try {
1381
+ const __el = this.$(":scope");
1382
+ this.props;
1383
+ const __boundValue = `pagination-root ${this.props.class || ""}`;
1384
+ if (__el) {
1385
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
1386
+ if (__el.className !== __newClass) __el.className = __newClass;
1387
+ }
1388
+ } catch {}
1389
+ }
1390
+ };
1391
+ //#endregion
1392
+ //#region src/components/pin-input.tsx
1393
+ var PinInput = class extends ZagComponent {
1394
+ constructor(...args) {
1395
+ super(...args);
1396
+ this.props;
1397
+ this.__geaCond_0 = !!this.props.label;
1398
+ this.__geaRegisterCond(0, "c0", () => {
1399
+ this.props;
1400
+ return this.props.label;
1401
+ }, () => {
1402
+ this.props;
1403
+ return `<label data-part="label" class="pin-input-label text-sm font-medium mb-2 block">${this.props.label}</label>`;
1404
+ }, null);
1405
+ }
1406
+ createMachine(_props) {
1407
+ return pinInput.machine;
1408
+ }
1409
+ getMachineProps(props) {
1410
+ return {
1411
+ id: this.id,
1412
+ value: props.value,
1413
+ defaultValue: props.defaultValue,
1414
+ count: props.count ?? 4,
1415
+ type: props.type ?? "numeric",
1416
+ otp: props.otp ?? false,
1417
+ mask: props.mask ?? false,
1418
+ placeholder: props.placeholder ?? "○",
1419
+ disabled: props.disabled,
1420
+ readOnly: props.readOnly,
1421
+ invalid: props.invalid,
1422
+ name: props.name,
1423
+ form: props.form,
1424
+ blurOnComplete: props.blurOnComplete ?? false,
1425
+ autoFocus: props.autoFocus,
1426
+ onValueChange: (details) => {
1427
+ this.value = details.value;
1428
+ this.valueAsString = details.valueAsString;
1429
+ props.onValueChange?.(details);
1430
+ },
1431
+ onValueComplete: props.onValueComplete,
1432
+ onValueInvalid: props.onValueInvalid
1433
+ };
1434
+ }
1435
+ connectApi(service) {
1436
+ return pinInput.connect(service, normalizeProps);
1437
+ }
1438
+ getSpreadMap() {
1439
+ return {
1440
+ "[data-part=\"root\"]": "getRootProps",
1441
+ "[data-part=\"label\"]": "getLabelProps",
1442
+ "[data-part=\"control\"]": "getControlProps",
1443
+ "[data-part=\"hidden-input\"]": "getHiddenInputProps",
1444
+ "[data-part=\"input\"]": (api, el) => {
1445
+ const index = parseInt(el.dataset.index || "0", 10);
1446
+ return api.getInputProps({ index });
1447
+ }
1448
+ };
1449
+ }
1450
+ syncState(api) {
1451
+ this.value = api.value;
1452
+ this.valueAsString = api.valueAsString;
1453
+ }
1454
+ template(props) {
1455
+ const count = props.count ?? 4;
1456
+ const inputs = Array.from({ length: count }, (_, i) => i);
1457
+ return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<label data-part="label" class="pin-input-label text-sm font-medium mb-2 block">${props.label}</label>` || ""}<!--${this.id + "-c0-end"}--><div id="${this.id + "-b1"}" data-part="control" class="pin-input-control flex gap-2">${inputs.map((i) => `<input id="${this.id + "-b1-" + String(String(i))}" data-gea-item-id="${String(i)}" data-part="input"${String(i) == null ? "" : ` data-index="${String(i)}"`} class="pin-input-field h-9 w-9 rounded-md border border-input bg-transparent text-center text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring" />`).join("") + "<!---->"}</div><input data-part="hidden-input" type="hidden" /></div>`;
1458
+ }
1459
+ render__unresolved_0Item(i) {
1460
+ const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
1461
+ return `<input id="${this.id + "-b1-" + String(String(i))}" data-gea-item-id="${String(i)}" data-part="input"${__v(String(i)) == __v(null) ? "" : ` data-index="${String(i)}"`} class="pin-input-field h-9 w-9 rounded-md border border-input bg-transparent text-center text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring" />`;
1462
+ }
1463
+ create__unresolved_0Item(item) {
1464
+ var __c = this.____unresolved_0_container;
1465
+ if (!__c.__geaTpl) try {
1466
+ var __tw = __c.cloneNode(false);
1467
+ __tw.innerHTML = this.render__unresolved_0Item("__dummy__");
1468
+ __c.__geaTpl = __tw.firstElementChild;
1469
+ } catch {}
1470
+ if (!__c.__geaIdPfx) __c.__geaIdPfx = this.id_ + "-b1-";
1471
+ if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
1472
+ else {
1473
+ var __fw = __c.cloneNode(false);
1474
+ __fw.innerHTML = this.render__unresolved_0Item(item);
1475
+ var el = __fw.firstElementChild;
1476
+ }
1477
+ var __av = String(item);
1478
+ if (__av == null || __av === false) el.removeAttribute("data-index");
1479
+ else el.setAttribute("data-index", String(__av));
1480
+ el.setAttribute("data-gea-item-id", String(item));
1481
+ el.id = __c.__geaIdPfx + String(item);
1482
+ el.__geaItem = item;
1483
+ return el;
1484
+ }
1485
+ __onPropChange(key, value) {
1486
+ if (key === "class") try {
1487
+ const __el = this.$(":scope");
1488
+ this.props;
1489
+ const __boundValue = this.props.class || "";
1490
+ if (__el) {
1491
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
1492
+ if (__el.className !== __newClass) __el.className = __newClass;
1493
+ }
1494
+ } catch {}
1495
+ if (key === "label") this.__geaPatchCond(0);
1496
+ if (key === "count") this.__geaSyncMap(0);
1497
+ }
1498
+ __observe_local_props(__v, __c) {
1499
+ this.__geaSyncMap(0);
1500
+ }
1501
+ createdHooks() {
1502
+ if (!this.__observer_removers__) this.__observer_removers__ = [];
1503
+ if (!this.__stores) this.__stores = {};
1504
+ this.__observer_removers__.forEach((fn) => fn());
1505
+ this.__observer_removers__ = [];
1506
+ if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
1507
+ this.__geaRegisterMap(0, "____unresolved_0_container", () => document.getElementById(this.id + "-b1"), () => {
1508
+ const count = this.props.count ?? 4;
1509
+ return Array.from({ length: count }, (_, i) => i);
1510
+ }, (__item) => this.create__unresolved_0Item(__item));
1511
+ }
1512
+ dispose() {
1513
+ if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
1514
+ super.dispose();
1515
+ }
1516
+ };
1517
+ //#endregion
1518
+ //#region src/components/popover.tsx
1519
+ var Popover = class extends ZagComponent {
1520
+ constructor(...args) {
1521
+ super(...args);
1522
+ this.props;
1523
+ this.__geaCond_0 = !!this.props.title;
1524
+ this.__geaCond_1 = !!this.props.description;
1525
+ this.__geaRegisterCond(0, "c0", () => {
1526
+ this.props;
1527
+ return this.props.title;
1528
+ }, () => {
1529
+ this.props;
1530
+ return `<div data-part="title" class="popover-title font-medium leading-none mb-2">${this.props.title}</div>`;
1531
+ }, null);
1532
+ this.__geaRegisterCond(1, "c1", () => {
1533
+ this.props;
1534
+ return this.props.description;
1535
+ }, () => {
1536
+ this.props;
1537
+ return `<p data-part="description" class="popover-description text-sm text-muted-foreground mb-3">${this.props.description}</p>`;
1538
+ }, null);
1539
+ }
1540
+ createMachine(_props) {
1541
+ return popover.machine;
1542
+ }
1543
+ getMachineProps(props) {
1544
+ return {
1545
+ id: this.id,
1546
+ open: props.open,
1547
+ defaultOpen: props.defaultOpen,
1548
+ modal: props.modal ?? false,
1549
+ portalled: props.portalled ?? true,
1550
+ autoFocus: props.autoFocus ?? true,
1551
+ closeOnInteractOutside: props.closeOnInteractOutside ?? true,
1552
+ closeOnEscape: props.closeOnEscape ?? true,
1553
+ positioning: props.positioning,
1554
+ onOpenChange: (details) => {
1555
+ this.open = details.open;
1556
+ props.onOpenChange?.(details);
1557
+ }
1558
+ };
1559
+ }
1560
+ connectApi(service) {
1561
+ return popover.connect(service, normalizeProps);
1562
+ }
1563
+ getSpreadMap() {
1564
+ return {
1565
+ "[data-part=\"trigger\"]": "getTriggerProps",
1566
+ "[data-part=\"positioner\"]": "getPositionerProps",
1567
+ "[data-part=\"content\"]": "getContentProps",
1568
+ "[data-part=\"title\"]": "getTitleProps",
1569
+ "[data-part=\"description\"]": "getDescriptionProps",
1570
+ "[data-part=\"close-trigger\"]": "getCloseTriggerProps",
1571
+ "[data-part=\"arrow\"]": "getArrowProps",
1572
+ "[data-part=\"arrow-tip\"]": "getArrowTipProps"
1573
+ };
1574
+ }
1575
+ syncState(api) {
1576
+ this.open = api.open;
1577
+ }
1578
+ template(props) {
1579
+ return `<div id="${this.id}"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><button id="${this.id + "-b1"}" data-part="trigger" class="popover-trigger">${props.triggerLabel || "Open"}</button><div data-part="positioner" class="popover-positioner"><div data-part="content" class="popover-content z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none"><!--${this.id + "-c0"}-->${props.title && `<div data-part="title" class="popover-title font-medium leading-none mb-2">${props.title}</div>` || ""}<!--${this.id + "-c0-end"}--><!--${this.id + "-c1"}-->${props.description && `<p data-part="description" class="popover-description text-sm text-muted-foreground mb-3">${props.description}</p>` || ""}<!--${this.id + "-c1-end"}--><div id="${this.id + "-b2"}" class="popover-body">${props.children}</div><button data-part="close-trigger" class="popover-close-trigger absolute top-2 right-2 text-gray-400 hover:text-gray-600 text-sm">✕</button></div></div></div>`;
1580
+ }
1581
+ __onPropChange(key, value) {
1582
+ if (key === "class") try {
1583
+ const __el = this.$(":scope");
1584
+ this.props;
1585
+ const __boundValue = this.props.class || "";
1586
+ if (__el) {
1587
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
1588
+ if (__el.className !== __newClass) __el.className = __newClass;
1589
+ }
1590
+ } catch {}
1591
+ if (key === "triggerLabel") try {
1592
+ const __el = document.getElementById(this.id + "-b1");
1593
+ this.props;
1594
+ const __boundValue = this.props.triggerLabel || "Open";
1595
+ if (__el) {
1596
+ if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
1597
+ }
1598
+ } catch {}
1599
+ if (key === "children") try {
1600
+ const __el = document.getElementById(this.id + "-b2");
1601
+ if (__el) {
1602
+ if (__el.textContent !== value) __el.textContent = value;
1603
+ }
1604
+ } catch {}
1605
+ if (key === "title") this.__geaPatchCond(0);
1606
+ if (key === "description") this.__geaPatchCond(1);
1607
+ }
1608
+ };
1609
+ //#endregion
1610
+ //#region src/components/progress.tsx
1611
+ var Progress = class extends ZagComponent {
1612
+ constructor(...args) {
1613
+ super(...args);
1614
+ this.percent = 0;
1615
+ this.props;
1616
+ this.__geaCond_0 = !!this.props.label;
1617
+ this.__geaRegisterCond(0, "c0", () => {
1618
+ this.props;
1619
+ return this.props.label;
1620
+ }, () => {
1621
+ this.props;
1622
+ return `<label data-part="label" class="progress-label text-sm font-medium">${this.props.label}</label>`;
1623
+ }, null);
1624
+ }
1625
+ createMachine(_props) {
1626
+ return progress.machine;
1627
+ }
1628
+ getMachineProps(props) {
1629
+ return {
1630
+ id: this.id,
1631
+ value: props.value,
1632
+ defaultValue: props.defaultValue ?? 0,
1633
+ min: props.min ?? 0,
1634
+ max: props.max ?? 100,
1635
+ orientation: props.orientation,
1636
+ onValueChange: props.onValueChange
1637
+ };
1638
+ }
1639
+ connectApi(service) {
1640
+ return progress.connect(service, normalizeProps);
1641
+ }
1642
+ getSpreadMap() {
1643
+ return {
1644
+ "[data-part=\"root\"]": "getRootProps",
1645
+ "[data-part=\"label\"]": "getLabelProps",
1646
+ "[data-part=\"track\"]": "getTrackProps",
1647
+ "[data-part=\"range\"]": "getRangeProps",
1648
+ "[data-part=\"value-text\"]": "getValueTextProps"
1649
+ };
1650
+ }
1651
+ syncState(api) {
1652
+ this.value = api.value;
1653
+ this.percent = api.percent;
1654
+ }
1655
+ template(props) {
1656
+ return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><div class="flex justify-between mb-1"><!--${this.id + "-c0"}-->${props.label && `<label data-part="label" class="progress-label text-sm font-medium">${props.label}</label>` || ""}<!--${this.id + "-c0-end"}--><span id="${this.id + "-b1"}" data-part="value-text" class="progress-value-text text-sm text-muted-foreground">${this.percent}%</span></div><div data-part="track" class="progress-track relative h-2 w-full overflow-hidden rounded-full bg-primary/20"><div id="${this.id + "-b2"}" data-part="range" class="progress-range h-full w-full flex-1 bg-primary transition-all"${`width: ${this.percent}%` == null ? "" : ` style="${`width: ${this.percent}%`}"`}></div></div></div>`;
1657
+ }
1658
+ __observe_local_percent(percent, change) {
1659
+ if (document.getElementById(this.id + "-b1")) document.getElementById(this.id + "-b1").textContent = `${this.percent}%`;
1660
+ }
1661
+ __onPropChange(key, value) {
1662
+ if (key === "class") try {
1663
+ const __el = this.$(":scope");
1664
+ this.props;
1665
+ const __boundValue = this.props.class || "";
1666
+ if (__el) {
1667
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
1668
+ if (__el.className !== __newClass) __el.className = __newClass;
1669
+ }
1670
+ } catch {}
1671
+ if (key === "label") this.__geaPatchCond(0);
1672
+ }
1673
+ __setupLocalStateObservers() {
1674
+ if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
1675
+ if (!this.__store) return;
1676
+ this.__observer_removers__.push(this.__store.observe(["percent"], (__v, __c) => this.__observe_local_percent(__v, __c)));
1677
+ }
1678
+ dispose() {
1679
+ if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
1680
+ super.dispose();
1681
+ }
1682
+ };
1683
+ //#endregion
1684
+ //#region src/components/radio-group.tsx
1685
+ var RadioGroup = class extends ZagComponent {
1686
+ constructor(...args) {
1687
+ super(...args);
1688
+ this.props;
1689
+ this.__geaCond_0 = !!this.props.label;
1690
+ this.__geaRegisterCond(0, "c0", () => {
1691
+ this.props;
1692
+ return this.props.label;
1693
+ }, () => {
1694
+ this.props;
1695
+ return `<span data-part="label" class="radio-group-label text-sm font-medium mb-2 block">${this.props.label}</span>`;
1696
+ }, null);
1697
+ }
1698
+ createMachine(_props) {
1699
+ return radioGroup.machine;
1700
+ }
1701
+ getMachineProps(props) {
1702
+ return {
1703
+ id: this.id,
1704
+ value: props.value,
1705
+ defaultValue: props.defaultValue,
1706
+ name: props.name,
1707
+ form: props.form,
1708
+ disabled: props.disabled,
1709
+ readOnly: props.readOnly,
1710
+ orientation: props.orientation ?? "vertical",
1711
+ onValueChange: (details) => {
1712
+ this.value = details.value;
1713
+ props.onValueChange?.(details);
1714
+ }
1715
+ };
1716
+ }
1717
+ connectApi(service) {
1718
+ return radioGroup.connect(service, normalizeProps);
1719
+ }
1720
+ getSpreadMap() {
1721
+ return {
1722
+ "[data-part=\"root\"]": "getRootProps",
1723
+ "[data-part=\"label\"]": "getLabelProps",
1724
+ "[data-part=\"indicator\"]": "getIndicatorProps",
1725
+ "[data-part=\"item\"]": (api, el) => api.getItemProps({ value: el.dataset.value }),
1726
+ "[data-part=\"item-text\"]": (api, el) => api.getItemTextProps({ value: el.dataset.value }),
1727
+ "[data-part=\"item-control\"]": (api, el) => api.getItemControlProps({ value: el.dataset.value }),
1728
+ "[data-part=\"item-hidden-input\"]": (api, el) => api.getItemHiddenInputProps({ value: el.dataset.value })
1729
+ };
1730
+ }
1731
+ syncState(api) {
1732
+ this.value = api.value;
1733
+ }
1734
+ template(props) {
1735
+ const items = props.items || [];
1736
+ return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<span data-part="label" class="radio-group-label text-sm font-medium mb-2 block">${props.label}</span>` || ""}<!--${this.id + "-c0-end"}--><div data-part="indicator" class="radio-group-indicator"></div>${items.map((item) => `<label data-gea-item-id="${String(item)}" data-part="item"${item.value == null ? "" : ` data-value="${item.value}"`} class="radio-group-item flex items-center gap-2 cursor-pointer py-1"><div data-part="item-control"${item.value == null ? "" : ` data-value="${item.value}"`} class="radio-group-item-control h-4 w-4 rounded-full border border-primary flex items-center justify-center"><span class="radio-dot"></span></div><input data-part="item-hidden-input"${item.value == null ? "" : ` data-value="${item.value}"`} type="radio" class="sr-only" /><span data-part="item-text"${item.value == null ? "" : ` data-value="${item.value}"`} class="radio-group-item-text text-sm">${item.label}</span></label>`).join("") + "<!---->"}</div>`;
1737
+ }
1738
+ render__unresolved_0Item(item) {
1739
+ const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
1740
+ return `<label data-gea-item-id="${String(item)}" data-part="item"${__v(item.value) == __v(null) ? "" : ` data-value="${item.value}"`} class="radio-group-item flex items-center gap-2 cursor-pointer py-1"><div data-part="item-control"${__v(item.value) == __v(null) ? "" : ` data-value="${item.value}"`} class="radio-group-item-control h-4 w-4 rounded-full border border-primary flex items-center justify-center"><span class="radio-dot"></span></div><input data-part="item-hidden-input"${__v(item.value) == __v(null) ? "" : ` data-value="${item.value}"`} type="radio" class="sr-only" /><span data-part="item-text"${__v(item.value) == __v(null) ? "" : ` data-value="${item.value}"`} class="radio-group-item-text text-sm">${item.label}</span></label>`;
1741
+ }
1742
+ create__unresolved_0Item(item) {
1743
+ var __c = this.____unresolved_0_container;
1744
+ if (!__c.__geaTpl) try {
1745
+ var __tw = __c.cloneNode(false);
1746
+ __tw.innerHTML = this.render__unresolved_0Item("__dummy__");
1747
+ __c.__geaTpl = __tw.firstElementChild;
1748
+ } catch {}
1749
+ if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
1750
+ else {
1751
+ var __fw = __c.cloneNode(false);
1752
+ __fw.innerHTML = this.render__unresolved_0Item(item);
1753
+ var el = __fw.firstElementChild;
1754
+ }
1755
+ var __av = item.value;
1756
+ if (__av == null || __av === false) el.removeAttribute("data-value");
1757
+ else el.setAttribute("data-value", String(__av));
1758
+ var __av = item.value;
1759
+ if (__av == null || __av === false) el.firstElementChild.removeAttribute("data-value");
1760
+ else el.firstElementChild.setAttribute("data-value", String(__av));
1761
+ var __av = item.value;
1762
+ if (__av == null || __av === false) el.firstElementChild.nextElementSibling.removeAttribute("data-value");
1763
+ else el.firstElementChild.nextElementSibling.setAttribute("data-value", String(__av));
1764
+ var __av = item.value;
1765
+ if (__av == null || __av === false) el.firstElementChild.nextElementSibling.nextElementSibling.removeAttribute("data-value");
1766
+ else el.firstElementChild.nextElementSibling.nextElementSibling.setAttribute("data-value", String(__av));
1767
+ el.firstElementChild.nextElementSibling.nextElementSibling.textContent = `${item.label}`;
1768
+ el.setAttribute("data-gea-item-id", String(item));
1769
+ el.__geaItem = item;
1770
+ return el;
1771
+ }
1772
+ __onPropChange(key, value) {
1773
+ if (key === "class") try {
1774
+ const __el = this.$(":scope");
1775
+ this.props;
1776
+ const __boundValue = this.props.class || "";
1777
+ if (__el) {
1778
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
1779
+ if (__el.className !== __newClass) __el.className = __newClass;
1780
+ }
1781
+ } catch {}
1782
+ if (key === "label") this.__geaPatchCond(0);
1783
+ if (key === "items") this.__geaSyncMap(0);
1784
+ }
1785
+ __observe_local_props(__v, __c) {
1786
+ this.__geaSyncMap(0);
1787
+ }
1788
+ createdHooks() {
1789
+ if (!this.__observer_removers__) this.__observer_removers__ = [];
1790
+ if (!this.__stores) this.__stores = {};
1791
+ this.__observer_removers__.forEach((fn) => fn());
1792
+ this.__observer_removers__ = [];
1793
+ if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
1794
+ this.__geaRegisterMap(0, "____unresolved_0_container", () => this.$(":scope"), () => {
1795
+ return this.props.items || [];
1796
+ }, (__item) => this.create__unresolved_0Item(__item));
1797
+ }
1798
+ dispose() {
1799
+ if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
1800
+ super.dispose();
1801
+ }
1802
+ };
1803
+ //#endregion
1804
+ //#region src/components/rating-group.tsx
1805
+ var RatingGroup = class extends ZagComponent {
1806
+ constructor(...args) {
1807
+ super(...args);
1808
+ this.props;
1809
+ this.__geaCond_0 = !!this.props.label;
1810
+ this.__geaRegisterCond(0, "c0", () => {
1811
+ this.props;
1812
+ return this.props.label;
1813
+ }, () => {
1814
+ this.props;
1815
+ return `<label data-part="label" class="rating-group-label text-sm font-medium mb-1 block">${this.props.label}</label>`;
1816
+ }, null);
1817
+ }
1818
+ createMachine(_props) {
1819
+ return ratingGroup.machine;
1820
+ }
1821
+ getMachineProps(props) {
1822
+ this._allowHalf = !!props.allowHalf;
1823
+ return {
1824
+ id: this.id,
1825
+ value: props.value,
1826
+ defaultValue: props.defaultValue,
1827
+ count: props.count ?? 5,
1828
+ allowHalf: !!props.allowHalf,
1829
+ readOnly: props.readOnly,
1830
+ disabled: props.disabled,
1831
+ name: props.name,
1832
+ form: props.form,
1833
+ onValueChange: (details) => {
1834
+ this.value = details.value;
1835
+ props.onValueChange?.(details);
1836
+ }
1837
+ };
1838
+ }
1839
+ connectApi(service) {
1840
+ return ratingGroup.connect(service, normalizeProps);
1841
+ }
1842
+ getSpreadMap() {
1843
+ return {
1844
+ "[data-part=\"root\"]": "getRootProps",
1845
+ "[data-part=\"label\"]": "getLabelProps",
1846
+ "[data-part=\"control\"]": "getControlProps",
1847
+ "[data-part=\"hidden-input\"]": "getHiddenInputProps",
1848
+ "[data-part=\"item\"]": (api, el) => {
1849
+ const htmlEl = el;
1850
+ const index = parseInt(htmlEl.dataset.index || "0", 10);
1851
+ const props = api.getItemProps({ index });
1852
+ if (this._allowHalf) props.onpointerdown = (e) => {
1853
+ const rect = htmlEl.getBoundingClientRect();
1854
+ const isLeftHalf = e.clientX - rect.left < rect.width / 2;
1855
+ api.setValue(isLeftHalf ? index - .5 : index);
1856
+ };
1857
+ return props;
1858
+ }
1859
+ };
1860
+ }
1861
+ syncState(api) {
1862
+ this.value = api.value;
1863
+ }
1864
+ _applyAllSpreads() {
1865
+ super._applyAllSpreads();
1866
+ if (!this._api || !this.el) return;
1867
+ const items = this.el.querySelectorAll("[data-part=\"item\"]");
1868
+ for (let i = 0; i < items.length; i++) {
1869
+ const el = items[i];
1870
+ const index = parseInt(el.dataset.index || "0", 10);
1871
+ if (this._api.getItemState({ index }).half) {
1872
+ el.style.background = "linear-gradient(90deg, #facc15 50%, hsl(var(--muted-foreground)) 50%)";
1873
+ el.style.backgroundClip = "text";
1874
+ el.style.setProperty("-webkit-background-clip", "text");
1875
+ el.style.setProperty("-webkit-text-fill-color", "transparent");
1876
+ } else {
1877
+ el.style.background = "";
1878
+ el.style.backgroundClip = "";
1879
+ el.style.setProperty("-webkit-background-clip", "");
1880
+ el.style.setProperty("-webkit-text-fill-color", "");
1881
+ }
1882
+ }
1883
+ }
1884
+ template(props) {
1885
+ const count = props.count ?? 5;
1886
+ const items = Array.from({ length: count }, (_, i) => i + 1);
1887
+ return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<label data-part="label" class="rating-group-label text-sm font-medium mb-1 block">${props.label}</label>` || ""}<!--${this.id + "-c0-end"}--><div id="${this.id + "-b1"}" data-part="control" class="rating-group-control flex gap-0.5">${items.map((i) => `<span id="${this.id + "-b1-" + String(String(i))}" data-gea-item-id="${String(i)}" data-part="item"${String(i) == null ? "" : ` data-index="${String(i)}"`} class="rating-group-item cursor-pointer text-2xl text-muted-foreground data-[highlighted]:text-yellow-400 data-[checked]:text-yellow-400" style="line-height: 1;">★</span>`).join("") + "<!---->"}</div><input data-part="hidden-input" type="hidden" /></div>`;
1888
+ }
1889
+ render__unresolved_0Item(i) {
1890
+ const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
1891
+ return `<span id="${this.id + "-b1-" + String(String(i))}" data-gea-item-id="${String(i)}" data-part="item"${__v(String(i)) == __v(null) ? "" : ` data-index="${String(i)}"`} class="rating-group-item cursor-pointer text-2xl text-muted-foreground data-[highlighted]:text-yellow-400 data-[checked]:text-yellow-400" style="line-height: 1;">★</span>`;
1892
+ }
1893
+ create__unresolved_0Item(item) {
1894
+ var __c = this.____unresolved_0_container;
1895
+ if (!__c.__geaTpl) try {
1896
+ var __tw = __c.cloneNode(false);
1897
+ __tw.innerHTML = this.render__unresolved_0Item("__dummy__");
1898
+ __c.__geaTpl = __tw.firstElementChild;
1899
+ } catch {}
1900
+ if (!__c.__geaIdPfx) __c.__geaIdPfx = this.id_ + "-b1-";
1901
+ if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
1902
+ else {
1903
+ var __fw = __c.cloneNode(false);
1904
+ __fw.innerHTML = this.render__unresolved_0Item(item);
1905
+ var el = __fw.firstElementChild;
1906
+ }
1907
+ var __av = String(item);
1908
+ if (__av == null || __av === false) el.removeAttribute("data-index");
1909
+ else el.setAttribute("data-index", String(__av));
1910
+ el.setAttribute("data-gea-item-id", String(item));
1911
+ el.id = __c.__geaIdPfx + String(item);
1912
+ el.__geaItem = item;
1913
+ return el;
1914
+ }
1915
+ __onPropChange(key, value) {
1916
+ if (key === "class") try {
1917
+ const __el = this.$(":scope");
1918
+ this.props;
1919
+ const __boundValue = this.props.class || "";
1920
+ if (__el) {
1921
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
1922
+ if (__el.className !== __newClass) __el.className = __newClass;
1923
+ }
1924
+ } catch {}
1925
+ if (key === "label") this.__geaPatchCond(0);
1926
+ if (key === "count") this.__geaSyncMap(0);
1927
+ }
1928
+ __observe_local_props(__v, __c) {
1929
+ this.__geaSyncMap(0);
1930
+ }
1931
+ createdHooks() {
1932
+ if (!this.__observer_removers__) this.__observer_removers__ = [];
1933
+ if (!this.__stores) this.__stores = {};
1934
+ this.__observer_removers__.forEach((fn) => fn());
1935
+ this.__observer_removers__ = [];
1936
+ if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
1937
+ this.__geaRegisterMap(0, "____unresolved_0_container", () => document.getElementById(this.id + "-b1"), () => {
1938
+ const count = this.props.count ?? 5;
1939
+ return Array.from({ length: count }, (_, i) => i + 1);
1940
+ }, (__item) => this.create__unresolved_0Item(__item));
1941
+ }
1942
+ dispose() {
1943
+ if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
1944
+ super.dispose();
1945
+ }
1946
+ };
1947
+ //#endregion
1948
+ //#region src/components/select.tsx
1949
+ var Select = class extends ZagComponent {
1950
+ constructor(...args) {
1951
+ super(...args);
1952
+ this.props;
1953
+ this.__geaCond_0 = !!this.props.label;
1954
+ this.__geaRegisterCond(0, "c0", () => {
1955
+ this.props;
1956
+ return this.props.label;
1957
+ }, () => {
1958
+ this.props;
1959
+ return `<label data-part="label" class="select-label text-sm font-medium mb-1 block">${this.props.label}</label>`;
1960
+ }, null);
1961
+ }
1962
+ createMachine(_props) {
1963
+ return select.machine;
1964
+ }
1965
+ getMachineProps(props) {
1966
+ const items = props.items || [];
1967
+ const col = props.collection || select.collection({
1968
+ items,
1969
+ itemToValue: (item) => item.value,
1970
+ itemToString: (item) => item.label || item.value
1971
+ });
1972
+ return {
1973
+ id: this.id,
1974
+ collection: col,
1975
+ value: props.value,
1976
+ defaultValue: props.defaultValue,
1977
+ open: props.open,
1978
+ defaultOpen: props.defaultOpen,
1979
+ multiple: props.multiple,
1980
+ disabled: props.disabled,
1981
+ invalid: props.invalid,
1982
+ readOnly: props.readOnly,
1983
+ required: props.required,
1984
+ name: props.name,
1985
+ form: props.form,
1986
+ closeOnSelect: props.closeOnSelect ?? true,
1987
+ positioning: props.positioning,
1988
+ loopFocus: props.loopFocus ?? false,
1989
+ onValueChange: (details) => {
1990
+ this.value = details.value;
1991
+ this.valueAsString = details.items.map((i) => i.label || i.value).join(", ");
1992
+ props.onValueChange?.(details);
1993
+ },
1994
+ onOpenChange: (details) => {
1995
+ this.open = details.open;
1996
+ props.onOpenChange?.(details);
1997
+ }
1998
+ };
1999
+ }
2000
+ connectApi(service) {
2001
+ return select.connect(service, normalizeProps);
2002
+ }
2003
+ getSpreadMap() {
2004
+ return {
2005
+ "[data-part=\"root\"]": "getRootProps",
2006
+ "[data-part=\"label\"]": "getLabelProps",
2007
+ "[data-part=\"control\"]": "getControlProps",
2008
+ "[data-part=\"trigger\"]": "getTriggerProps",
2009
+ "[data-part=\"indicator\"]": "getIndicatorProps",
2010
+ "[data-part=\"clear-trigger\"]": "getClearTriggerProps",
2011
+ "[data-part=\"value-text\"]": "getValueTextProps",
2012
+ "[data-part=\"positioner\"]": "getPositionerProps",
2013
+ "[data-part=\"content\"]": "getContentProps",
2014
+ "[data-part=\"list\"]": "getListProps",
2015
+ "[data-part=\"item\"]": (api, el) => {
2016
+ const value = el.dataset.value;
2017
+ const label = el.dataset.label || value;
2018
+ return api.getItemProps({ item: {
2019
+ value,
2020
+ label
2021
+ } });
2022
+ },
2023
+ "[data-part=\"item-text\"]": (api, el) => {
2024
+ const value = el.dataset.value;
2025
+ const label = el.dataset.label || value;
2026
+ return api.getItemTextProps({ item: {
2027
+ value,
2028
+ label
2029
+ } });
2030
+ },
2031
+ "[data-part=\"item-indicator\"]": (api, el) => {
2032
+ const value = el.dataset.value;
2033
+ const label = el.dataset.label || value;
2034
+ return api.getItemIndicatorProps({ item: {
2035
+ value,
2036
+ label
2037
+ } });
2038
+ }
2039
+ };
2040
+ }
2041
+ syncState(api) {
2042
+ this.open = api.open;
2043
+ this.value = api.value;
2044
+ this.valueAsString = api.valueAsString;
2045
+ }
2046
+ template(props) {
2047
+ const items = props.items || [];
2048
+ return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<label data-part="label" class="select-label text-sm font-medium mb-1 block">${props.label}</label>` || ""}<!--${this.id + "-c0-end"}--><div data-part="control" class="select-control"><button data-part="trigger" class="select-trigger flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50"><span id="${this.id + "-b1"}" data-part="value-text" class="select-value-text">${this.valueAsString || props.placeholder || "Select..."}</span><span data-part="indicator" class="select-indicator">▼</span></button></div><div data-part="positioner" class="select-positioner"><div data-part="content" class="select-content z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md"><div id="${this.id + "-b2"}" data-part="list">${items.map((item) => `<div id="${this.id + "-b2-" + String(String(item))}" data-gea-item-id="${String(item)}" data-part="item"${item.value == null ? "" : ` data-value="${item.value}"`}${item.label == null ? "" : ` data-label="${item.label}"`} class="select-item relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"><span data-part="item-text"${item.value == null ? "" : ` data-value="${item.value}"`}${item.label == null ? "" : ` data-label="${item.label}"`}>${item.label}</span><span data-part="item-indicator"${item.value == null ? "" : ` data-value="${item.value}"`}${item.label == null ? "" : ` data-label="${item.label}"`} class="select-item-indicator ml-auto">✓</span></div>`).join("") + "<!---->"}</div></div></div></div>`;
2049
+ }
2050
+ render__unresolved_0Item(item) {
2051
+ const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
2052
+ return `<div id="${this.id + "-b2-" + String(String(item))}" data-gea-item-id="${String(item)}" data-part="item"${__v(item.value) == __v(null) ? "" : ` data-value="${item.value}"`}${__v(item.label) == __v(null) ? "" : ` data-label="${item.label}"`} class="select-item relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"><span data-part="item-text"${__v(item.value) == __v(null) ? "" : ` data-value="${item.value}"`}${__v(item.label) == __v(null) ? "" : ` data-label="${item.label}"`}>${item.label}</span><span data-part="item-indicator"${__v(item.value) == __v(null) ? "" : ` data-value="${item.value}"`}${__v(item.label) == __v(null) ? "" : ` data-label="${item.label}"`} class="select-item-indicator ml-auto">✓</span></div>`;
2053
+ }
2054
+ create__unresolved_0Item(item) {
2055
+ var __c = this.____unresolved_0_container;
2056
+ if (!__c.__geaTpl) try {
2057
+ var __tw = __c.cloneNode(false);
2058
+ __tw.innerHTML = this.render__unresolved_0Item("__dummy__");
2059
+ __c.__geaTpl = __tw.firstElementChild;
2060
+ } catch {}
2061
+ if (!__c.__geaIdPfx) __c.__geaIdPfx = this.id_ + "-b2-";
2062
+ if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
2063
+ else {
2064
+ var __fw = __c.cloneNode(false);
2065
+ __fw.innerHTML = this.render__unresolved_0Item(item);
2066
+ var el = __fw.firstElementChild;
2067
+ }
2068
+ var __av = item.value;
2069
+ if (__av == null || __av === false) el.removeAttribute("data-value");
2070
+ else el.setAttribute("data-value", String(__av));
2071
+ var __av = item.label;
2072
+ if (__av == null || __av === false) el.removeAttribute("data-label");
2073
+ else el.setAttribute("data-label", String(__av));
2074
+ var __av = item.value;
2075
+ if (__av == null || __av === false) el.firstElementChild.removeAttribute("data-value");
2076
+ else el.firstElementChild.setAttribute("data-value", String(__av));
2077
+ var __av = item.label;
2078
+ if (__av == null || __av === false) el.firstElementChild.removeAttribute("data-label");
2079
+ else el.firstElementChild.setAttribute("data-label", String(__av));
2080
+ el.firstElementChild.textContent = `
2081
+ ${item.label}
2082
+ `;
2083
+ var __av = item.value;
2084
+ if (__av == null || __av === false) el.firstElementChild.nextElementSibling.removeAttribute("data-value");
2085
+ else el.firstElementChild.nextElementSibling.setAttribute("data-value", String(__av));
2086
+ var __av = item.label;
2087
+ if (__av == null || __av === false) el.firstElementChild.nextElementSibling.removeAttribute("data-label");
2088
+ else el.firstElementChild.nextElementSibling.setAttribute("data-label", String(__av));
2089
+ el.setAttribute("data-gea-item-id", String(item));
2090
+ el.id = __c.__geaIdPfx + String(item);
2091
+ el.__geaItem = item;
2092
+ return el;
2093
+ }
2094
+ __onPropChange(key, value) {
2095
+ if (key === "class") try {
2096
+ const __el = this.$(":scope");
2097
+ this.props;
2098
+ const __boundValue = this.props.class || "";
2099
+ if (__el) {
2100
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
2101
+ if (__el.className !== __newClass) __el.className = __newClass;
2102
+ }
2103
+ } catch {}
2104
+ if (key === "placeholder") try {
2105
+ const __el = document.getElementById(this.id + "-b1");
2106
+ this.props;
2107
+ const __boundValue = this.valueAsString || this.props.placeholder || "Select...";
2108
+ if (__el) {
2109
+ if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
2110
+ }
2111
+ } catch {}
2112
+ if (key === "label") this.__geaPatchCond(0);
2113
+ if (key === "items") this.__geaSyncMap(0);
2114
+ }
2115
+ __observe_local_valueAsString(value, change) {
2116
+ if (this.rendered_) {
2117
+ const __el = document.getElementById(this.id + "-b1");
2118
+ this.props;
2119
+ const __boundValue = this.valueAsString || this.props.placeholder || "Select...";
2120
+ if (__el) {
2121
+ if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
2122
+ }
2123
+ }
2124
+ }
2125
+ __observe_local_props(__v, __c) {
2126
+ this.__geaSyncMap(0);
2127
+ }
2128
+ createdHooks() {
2129
+ if (!this.__observer_removers__) this.__observer_removers__ = [];
2130
+ if (!this.__stores) this.__stores = {};
2131
+ this.__observer_removers__.forEach((fn) => fn());
2132
+ this.__observer_removers__ = [];
2133
+ if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
2134
+ this.__geaRegisterMap(0, "____unresolved_0_container", () => document.getElementById(this.id + "-b2"), () => {
2135
+ return this.props.items || [];
2136
+ }, (__item) => this.create__unresolved_0Item(__item));
2137
+ }
2138
+ __setupLocalStateObservers() {
2139
+ if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
2140
+ if (!this.__store) return;
2141
+ this.__observer_removers__.push(this.__store.observe(["valueAsString"], (__v, __c) => this.__observe_local_valueAsString(__v, __c)));
2142
+ }
2143
+ dispose() {
2144
+ if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
2145
+ super.dispose();
2146
+ }
2147
+ };
2148
+ //#endregion
2149
+ //#region src/components/slider.tsx
2150
+ const THUMB_CLASS = "slider-thumb block h-5 w-5 rounded-full border-2 border-primary bg-background shadow ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";
2151
+ var Slider = class extends ZagComponent {
2152
+ constructor(...args) {
2153
+ super(...args);
2154
+ this.props;
2155
+ this.__geaCond_0 = !!this.props.label;
2156
+ this.__geaRegisterCond(0, "c0", () => {
2157
+ this.props;
2158
+ return this.props.label;
2159
+ }, () => {
2160
+ this.props;
2161
+ return `<div class="flex justify-between mb-2"><label data-part="label" class="slider-label text-sm font-medium">${this.props.label}</label></div>`;
2162
+ }, null);
2163
+ }
2164
+ createMachine(_props) {
2165
+ return slider.machine;
2166
+ }
2167
+ getMachineProps(props) {
2168
+ return {
2169
+ id: this.id,
2170
+ value: props.value,
2171
+ defaultValue: props.defaultValue ?? [50],
2172
+ min: props.min ?? 0,
2173
+ max: props.max ?? 100,
2174
+ step: props.step ?? 1,
2175
+ orientation: props.orientation ?? "horizontal",
2176
+ thumbAlignment: props.thumbAlignment ?? "center",
2177
+ disabled: props.disabled,
2178
+ readOnly: props.readOnly,
2179
+ name: props.name,
2180
+ "aria-label": props["aria-label"],
2181
+ onValueChange: (details) => {
2182
+ this.value = details.value;
2183
+ props.onValueChange?.(details);
2184
+ },
2185
+ onValueChangeEnd: props.onValueChangeEnd
2186
+ };
2187
+ }
2188
+ connectApi(service) {
2189
+ return slider.connect(service, normalizeProps);
2190
+ }
2191
+ getSpreadMap() {
2192
+ return {
2193
+ "[data-part=\"root\"]": "getRootProps",
2194
+ "[data-part=\"label\"]": "getLabelProps",
2195
+ "[data-part=\"control\"]": "getControlProps",
2196
+ "[data-part=\"track\"]": "getTrackProps",
2197
+ "[data-part=\"range\"]": "getRangeProps",
2198
+ "[data-part=\"thumb\"]": (api, el) => {
2199
+ const index = parseInt(el.dataset.index || "0", 10);
2200
+ return api.getThumbProps({ index });
2201
+ },
2202
+ "[data-part=\"hidden-input\"]": (api, el) => {
2203
+ const index = parseInt(el.dataset.index || "0", 10);
2204
+ return api.getHiddenInputProps({ index });
2205
+ }
2206
+ };
2207
+ }
2208
+ _syncThumbs() {
2209
+ if (!this._api || !this.el) return;
2210
+ const control = this.el.querySelector("[data-part=\"control\"]");
2211
+ if (!control) return;
2212
+ const thumbCount = this._api.value.length;
2213
+ const existing = control.querySelectorAll(":scope > [data-part=\"thumb\"]");
2214
+ if (existing.length === thumbCount) return;
2215
+ if (existing.length < thumbCount) for (let i = existing.length; i < thumbCount; i++) {
2216
+ const thumb = document.createElement("div");
2217
+ thumb.setAttribute("data-part", "thumb");
2218
+ thumb.setAttribute("data-index", String(i));
2219
+ thumb.className = THUMB_CLASS;
2220
+ const input = document.createElement("input");
2221
+ input.setAttribute("data-part", "hidden-input");
2222
+ input.setAttribute("data-index", String(i));
2223
+ input.type = "hidden";
2224
+ thumb.appendChild(input);
2225
+ control.appendChild(thumb);
2226
+ }
2227
+ else for (let i = existing.length - 1; i >= thumbCount; i--) existing[i].remove();
2228
+ }
2229
+ syncState(api) {
2230
+ this.value = api.value;
2231
+ }
2232
+ _applyAllSpreads() {
2233
+ this._syncThumbs();
2234
+ super._applyAllSpreads();
2235
+ }
2236
+ template(props) {
2237
+ return `<div id="${this.id}" data-part="root"${"w-full " + (props.class || "") == null ? "" : ` class="${("w-full " + (props.class || "")).trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<div class="flex justify-between mb-2"><label data-part="label" class="slider-label text-sm font-medium">${props.label}</label></div>` || ""}<!--${this.id + "-c0-end"}--><div data-part="control" class="slider-control relative flex items-center"><div data-part="track" class="slider-track relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20"><div data-part="range" class="slider-range absolute h-full bg-primary"></div></div><div data-part="thumb" data-index="0"${THUMB_CLASS == null ? "" : ` class="${THUMB_CLASS.trim()}"`}><input data-part="hidden-input" data-index="0" type="hidden" /></div></div></div>`;
2238
+ }
2239
+ __onPropChange(key, value) {
2240
+ if (key === "class") try {
2241
+ const __el = this.$(":scope");
2242
+ this.props;
2243
+ const __boundValue = "w-full " + (this.props.class || "");
2244
+ if (__el) {
2245
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
2246
+ if (__el.className !== __newClass) __el.className = __newClass;
2247
+ }
2248
+ } catch {}
2249
+ if (key === "label") this.__geaPatchCond(0);
2250
+ }
2251
+ };
2252
+ //#endregion
2253
+ //#region src/components/switch.tsx
2254
+ var Switch = class extends ZagComponent {
2255
+ constructor(...args) {
2256
+ super(...args);
2257
+ this.checked = false;
2258
+ this.props;
2259
+ this.__geaCond_0 = !!this.props.label;
2260
+ this.__geaRegisterCond(0, "c0", () => {
2261
+ this.props;
2262
+ return this.props.label;
2263
+ }, () => {
2264
+ this.props;
2265
+ return `<span data-part="label" class="switch-label text-sm font-medium">${this.props.label}</span>`;
2266
+ }, null);
2267
+ }
2268
+ createMachine(_props) {
2269
+ return switchMachine.machine;
2270
+ }
2271
+ getMachineProps(props) {
2272
+ return {
2273
+ id: this.id,
2274
+ checked: props.checked,
2275
+ defaultChecked: props.defaultChecked,
2276
+ disabled: props.disabled,
2277
+ invalid: props.invalid,
2278
+ required: props.required,
2279
+ readOnly: props.readOnly,
2280
+ name: props.name,
2281
+ form: props.form,
2282
+ value: props.value ?? "on",
2283
+ onCheckedChange: (details) => {
2284
+ this.checked = details.checked;
2285
+ props.onCheckedChange?.(details);
2286
+ }
2287
+ };
2288
+ }
2289
+ connectApi(service) {
2290
+ return switchMachine.connect(service, normalizeProps);
2291
+ }
2292
+ getSpreadMap() {
2293
+ return {
2294
+ "[data-part=\"root\"]": "getRootProps",
2295
+ "[data-part=\"label\"]": "getLabelProps",
2296
+ "[data-part=\"control\"]": "getControlProps",
2297
+ "[data-part=\"thumb\"]": "getThumbProps",
2298
+ "[data-part=\"hidden-input\"]": "getHiddenInputProps"
2299
+ };
2300
+ }
2301
+ syncState(api) {
2302
+ this.checked = api.checked;
2303
+ }
2304
+ template(props) {
2305
+ return `<label id="${this.id}" data-part="root"${`switch-root inline-flex items-center gap-2 cursor-pointer ${props.class || ""}` == null ? "" : ` class="${`switch-root inline-flex items-center gap-2 cursor-pointer ${props.class || ""}`.trim()}"`}><input data-part="hidden-input" type="checkbox" /><span data-part="control" class="switch-control inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input"><span data-part="thumb" class="switch-thumb pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"></span></span><!--${this.id + "-c0"}-->${props.label && `<span data-part="label" class="switch-label text-sm font-medium">${props.label}</span>` || ""}<!--${this.id + "-c0-end"}--></label>`;
2306
+ }
2307
+ __onPropChange(key, value) {
2308
+ if (key === "class") try {
2309
+ const __el = this.$(":scope");
2310
+ this.props;
2311
+ const __boundValue = `switch-root inline-flex items-center gap-2 cursor-pointer ${this.props.class || ""}`;
2312
+ if (__el) {
2313
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
2314
+ if (__el.className !== __newClass) __el.className = __newClass;
2315
+ }
2316
+ } catch {}
2317
+ if (key === "label") this.__geaPatchCond(0);
2318
+ }
2319
+ };
2320
+ //#endregion
2321
+ //#region src/components/tabs.tsx
2322
+ var Tabs = class extends ZagComponent {
2323
+ createMachine(_props) {
2324
+ return tabs.machine;
2325
+ }
2326
+ getMachineProps(props) {
2327
+ return {
2328
+ id: this.id,
2329
+ value: props.value,
2330
+ defaultValue: props.defaultValue,
2331
+ orientation: props.orientation ?? "horizontal",
2332
+ activationMode: props.activationMode ?? "automatic",
2333
+ loopFocus: props.loopFocus ?? true,
2334
+ onValueChange: (details) => {
2335
+ this.value = details.value;
2336
+ props.onValueChange?.(details);
2337
+ },
2338
+ onFocusChange: props.onFocusChange
2339
+ };
2340
+ }
2341
+ connectApi(service) {
2342
+ return tabs.connect(service, normalizeProps);
2343
+ }
2344
+ _syncMachineProps() {
2345
+ super._syncMachineProps();
2346
+ if (this._machine && this.rendered_) this._machine.service.send({ type: "SET_INDICATOR_RECT" });
2347
+ }
2348
+ getSpreadMap() {
2349
+ return {
2350
+ "[data-part=\"root\"]": "getRootProps",
2351
+ "[data-part=\"list\"]": "getListProps",
2352
+ "[data-part=\"indicator\"]": (api) => {
2353
+ const props = api.getIndicatorProps();
2354
+ props.style = (props.style || "") + "bottom:0;width:var(--width);height:2px;";
2355
+ return props;
2356
+ },
2357
+ "[data-part=\"trigger\"]": (api, el) => api.getTriggerProps({ value: el.dataset.value }),
2358
+ "[data-part=\"content\"]": (api, el) => api.getContentProps({ value: el.dataset.value })
2359
+ };
2360
+ }
2361
+ syncState(api) {
2362
+ this.value = api.value;
2363
+ }
2364
+ onAfterRender() {
2365
+ super.onAfterRender();
2366
+ if (this._api?.value && this._machine) this._machine.service.send({ type: "SET_INDICATOR_RECT" });
2367
+ }
2368
+ template(props) {
2369
+ const items = props.items || [];
2370
+ return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><div id="${this.id + "-b1"}" data-part="list" class="tabs-list relative flex border-b border-gray-200 dark:border-gray-700">${items.map((item) => `<button id="${this.id + "-b1-" + String(String(item))}" data-gea-item-id="${String(item)}" data-part="trigger"${item.value == null ? "" : ` data-value="${item.value}"`} class="tabs-trigger px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-900 data-[selected]:text-blue-600 dark:text-gray-400 dark:hover:text-gray-100 dark:data-[selected]:text-blue-400">${item.label}</button>`).join("") + "<!---->"}<div data-part="indicator" class="tabs-indicator bg-blue-600 dark:bg-blue-400"></div></div>${items.map((item) => `<div id="${this.id + "-b1-" + String(String(item))}" data-gea-item-id="${String(item)}" data-part="content"${item.value == null ? "" : ` data-value="${item.value}"`} class="tabs-content p-4">${item.content}</div>`).join("") + "<!---->"}</div>`;
2371
+ }
2372
+ render__unresolved_0Item(item) {
2373
+ const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
2374
+ return `<div data-gea-item-id="${String(item)}" data-part="content"${__v(item.value) == __v(null) ? "" : ` data-value="${item.value}"`} class="tabs-content p-4">${item.content}</div>`;
2375
+ }
2376
+ create__unresolved_0Item(item) {
2377
+ var __c = this.____unresolved_0_container;
2378
+ if (!__c.__geaTpl) try {
2379
+ var __tw = __c.cloneNode(false);
2380
+ __tw.innerHTML = this.render__unresolved_0Item("__dummy__");
2381
+ __c.__geaTpl = __tw.firstElementChild;
2382
+ } catch {}
2383
+ if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
2384
+ else {
2385
+ var __fw = __c.cloneNode(false);
2386
+ __fw.innerHTML = this.render__unresolved_0Item(item);
2387
+ var el = __fw.firstElementChild;
2388
+ }
2389
+ var __av = item.value;
2390
+ if (__av == null || __av === false) el.removeAttribute("data-value");
2391
+ else el.setAttribute("data-value", String(__av));
2392
+ el.textContent = `
2393
+ ${item.content}
2394
+ `;
2395
+ el.setAttribute("data-gea-item-id", String(item));
2396
+ el.__geaItem = item;
2397
+ return el;
2398
+ }
2399
+ render__unresolved_1Item(item) {
2400
+ const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
2401
+ return `<button id="${this.id + "-b1-" + String(String(item))}" data-gea-item-id="${String(item)}" data-part="trigger"${__v(item.value) == __v(null) ? "" : ` data-value="${item.value}"`} class="tabs-trigger px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-900 data-[selected]:text-blue-600 dark:text-gray-400 dark:hover:text-gray-100 dark:data-[selected]:text-blue-400">${item.label}</button>`;
2402
+ }
2403
+ create__unresolved_1Item(item) {
2404
+ var __c = this.____unresolved_1_container;
2405
+ if (!__c.__geaTpl) try {
2406
+ var __tw = __c.cloneNode(false);
2407
+ __tw.innerHTML = this.render__unresolved_1Item("__dummy__");
2408
+ __c.__geaTpl = __tw.firstElementChild;
2409
+ } catch {}
2410
+ if (!__c.__geaIdPfx) __c.__geaIdPfx = this.id_ + "-b1-";
2411
+ if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
2412
+ else {
2413
+ var __fw = __c.cloneNode(false);
2414
+ __fw.innerHTML = this.render__unresolved_1Item(item);
2415
+ var el = __fw.firstElementChild;
2416
+ }
2417
+ var __av = item.value;
2418
+ if (__av == null || __av === false) el.removeAttribute("data-value");
2419
+ else el.setAttribute("data-value", String(__av));
2420
+ el.textContent = `
2421
+ ${item.label}
2422
+ `;
2423
+ el.setAttribute("data-gea-item-id", String(item));
2424
+ el.id = __c.__geaIdPfx + String(item);
2425
+ el.__geaItem = item;
2426
+ return el;
2427
+ }
2428
+ __onPropChange(key, value) {
2429
+ if (key === "class") try {
2430
+ const __el = this.$(":scope");
2431
+ this.props;
2432
+ const __boundValue = this.props.class || "";
2433
+ if (__el) {
2434
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
2435
+ if (__el.className !== __newClass) __el.className = __newClass;
2436
+ }
2437
+ } catch {}
2438
+ if (key === "items") {
2439
+ this.__geaSyncMap(0);
2440
+ this.__geaSyncMap(1);
2441
+ }
2442
+ }
2443
+ __observe_local_props(__v, __c) {
2444
+ this.__geaSyncMap(0);
2445
+ this.__geaSyncMap(1);
2446
+ }
2447
+ createdHooks() {
2448
+ if (!this.__observer_removers__) this.__observer_removers__ = [];
2449
+ if (!this.__stores) this.__stores = {};
2450
+ this.__observer_removers__.forEach((fn) => fn());
2451
+ this.__observer_removers__ = [];
2452
+ if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
2453
+ this.__geaRegisterMap(0, "____unresolved_0_container", () => this.$(":scope"), () => {
2454
+ return this.props.items || [];
2455
+ }, (__item) => this.create__unresolved_0Item(__item));
2456
+ this.__geaRegisterMap(1, "____unresolved_1_container", () => document.getElementById(this.id + "-b1"), () => {
2457
+ return this.props.items || [];
2458
+ }, (__item) => this.create__unresolved_1Item(__item));
2459
+ }
2460
+ dispose() {
2461
+ if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
2462
+ super.dispose();
2463
+ }
2464
+ };
2465
+ //#endregion
2466
+ //#region src/components/tags-input.tsx
2467
+ var TagsInput = class extends ZagComponent {
2468
+ constructor(...args) {
2469
+ super(...args);
2470
+ this.props;
2471
+ this.__geaCond_0 = !!this.props.label;
2472
+ this.__geaRegisterCond(0, "c0", () => {
2473
+ this.props;
2474
+ return this.props.label;
2475
+ }, () => {
2476
+ this.props;
2477
+ return `<label data-part="label" class="tags-input-label text-sm font-medium mb-1 block">${this.props.label}</label>`;
2478
+ }, null);
2479
+ }
2480
+ createMachine(_props) {
2481
+ return tagsInput.machine;
2482
+ }
2483
+ getMachineProps(props) {
2484
+ return {
2485
+ id: this.id,
2486
+ value: props.value,
2487
+ defaultValue: props.defaultValue,
2488
+ max: props.max,
2489
+ maxLength: props.maxLength,
2490
+ disabled: props.disabled,
2491
+ readOnly: props.readOnly,
2492
+ invalid: props.invalid,
2493
+ addOnPaste: props.addOnPaste ?? false,
2494
+ editable: props.editable ?? true,
2495
+ allowDuplicates: props.allowDuplicates ?? false,
2496
+ name: props.name,
2497
+ form: props.form,
2498
+ placeholder: props.placeholder,
2499
+ blurBehavior: props.blurBehavior,
2500
+ delimiter: props.delimiter,
2501
+ onValueChange: (details) => {
2502
+ this.value = details.value;
2503
+ props.onValueChange?.(details);
2504
+ }
2505
+ };
2506
+ }
2507
+ connectApi(service) {
2508
+ return tagsInput.connect(service, normalizeProps);
2509
+ }
2510
+ getSpreadMap() {
2511
+ return {
2512
+ "[data-part=\"root\"]": "getRootProps",
2513
+ "[data-part=\"label\"]": "getLabelProps",
2514
+ "[data-part=\"control\"]": "getControlProps",
2515
+ "[data-part=\"input\"]": "getInputProps",
2516
+ "[data-part=\"hidden-input\"]": "getHiddenInputProps",
2517
+ "[data-part=\"clear-trigger\"]": "getClearTriggerProps",
2518
+ "[data-part=\"item\"]": (api, el) => {
2519
+ const ds = el.dataset;
2520
+ return api.getItemProps({
2521
+ index: ds.index,
2522
+ value: ds.value
2523
+ });
2524
+ },
2525
+ "[data-part=\"item-preview\"]": (api, el) => {
2526
+ const ds = el.dataset;
2527
+ return api.getItemPreviewProps({
2528
+ index: ds.index,
2529
+ value: ds.value
2530
+ });
2531
+ },
2532
+ "[data-part=\"item-text\"]": (api, el) => {
2533
+ const ds = el.dataset;
2534
+ return api.getItemTextProps({
2535
+ index: ds.index,
2536
+ value: ds.value
2537
+ });
2538
+ },
2539
+ "[data-part=\"item-delete-trigger\"]": (api, el) => {
2540
+ const ds = el.dataset;
2541
+ return api.getItemDeleteTriggerProps({
2542
+ index: ds.index,
2543
+ value: ds.value
2544
+ });
2545
+ }
2546
+ };
2547
+ }
2548
+ syncState(api) {
2549
+ this.value = api.value;
2550
+ }
2551
+ template(props) {
2552
+ return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<label data-part="label" class="tags-input-label text-sm font-medium mb-1 block">${props.label}</label>` || ""}<!--${this.id + "-c0-end"}--><div id="${this.id + "-b1"}" data-part="control" class="tags-input-control flex flex-wrap gap-1.5 rounded-md border border-input bg-transparent px-3 py-2 shadow-sm focus-within:ring-1 focus-within:ring-ring">${(this.value || []).map((tag, i) => `<span id="${this.id + "-b1-" + String(String(tag))}" data-gea-item-id="${String(tag)}" data-part="item"${String(i) == null ? "" : ` data-index="${String(i)}"`}${tag == null ? "" : ` data-value="${tag}"`} class="tags-input-item inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs font-medium"><span data-part="item-preview"${String(i) == null ? "" : ` data-index="${String(i)}"`}${tag == null ? "" : ` data-value="${tag}"`} class="inline-flex items-center gap-1 data-[highlighted]:ring-2 data-[highlighted]:ring-ring data-[highlighted]:rounded-sm"><span data-part="item-text"${String(i) == null ? "" : ` data-index="${String(i)}"`}${tag == null ? "" : ` data-value="${tag}"`}>${tag}</span></span><button data-part="item-delete-trigger"${String(i) == null ? "" : ` data-index="${String(i)}"`}${tag == null ? "" : ` data-value="${tag}"`} class="tags-input-item-delete text-muted-foreground hover:text-foreground">✕</button></span>`).join("") + "<!---->"}<input data-part="input" class="tags-input-input flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground min-w-[60px]" /></div><input data-part="hidden-input" type="hidden" /></div>`;
2553
+ }
2554
+ render__unresolved_0Item(tag, i) {
2555
+ const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
2556
+ return `<span id="${this.id + "-b1-" + String(String(tag))}" data-gea-item-id="${String(tag)}" data-part="item"${__v(String(i)) == __v(null) ? "" : ` data-index="${String(i)}"`}${__v(tag) == __v(null) ? "" : ` data-value="${tag}"`} class="tags-input-item inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs font-medium"><span data-part="item-preview"${__v(String(i)) == __v(null) ? "" : ` data-index="${String(i)}"`}${__v(tag) == __v(null) ? "" : ` data-value="${tag}"`} class="inline-flex items-center gap-1 data-[highlighted]:ring-2 data-[highlighted]:ring-ring data-[highlighted]:rounded-sm"><span data-part="item-text"${__v(String(i)) == __v(null) ? "" : ` data-index="${String(i)}"`}${__v(tag) == __v(null) ? "" : ` data-value="${tag}"`}>${tag}</span></span><button data-part="item-delete-trigger"${__v(String(i)) == __v(null) ? "" : ` data-index="${String(i)}"`}${__v(tag) == __v(null) ? "" : ` data-value="${tag}"`} class="tags-input-item-delete text-muted-foreground hover:text-foreground">✕</button></span>`;
2557
+ }
2558
+ create__unresolved_0Item(item, __idx) {
2559
+ var __c = this.____unresolved_0_container;
2560
+ if (!__c.__geaTpl) try {
2561
+ var __tw = __c.cloneNode(false);
2562
+ __tw.innerHTML = this.render__unresolved_0Item("__dummy__", 0);
2563
+ __c.__geaTpl = __tw.firstElementChild;
2564
+ } catch {}
2565
+ if (!__c.__geaIdPfx) __c.__geaIdPfx = this.id_ + "-b1-";
2566
+ if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
2567
+ else {
2568
+ var __fw = __c.cloneNode(false);
2569
+ __fw.innerHTML = this.render__unresolved_0Item(item, __idx);
2570
+ var el = __fw.firstElementChild;
2571
+ }
2572
+ var __av = String(__idx);
2573
+ if (__av == null || __av === false) el.removeAttribute("data-index");
2574
+ else el.setAttribute("data-index", String(__av));
2575
+ var __av = item;
2576
+ if (__av == null || __av === false) el.removeAttribute("data-value");
2577
+ else el.setAttribute("data-value", String(__av));
2578
+ var __av = String(__idx);
2579
+ if (__av == null || __av === false) el.firstElementChild.removeAttribute("data-index");
2580
+ else el.firstElementChild.setAttribute("data-index", String(__av));
2581
+ var __av = item;
2582
+ if (__av == null || __av === false) el.firstElementChild.removeAttribute("data-value");
2583
+ else el.firstElementChild.setAttribute("data-value", String(__av));
2584
+ var __av = String(__idx);
2585
+ if (__av == null || __av === false) el.firstElementChild.firstElementChild.removeAttribute("data-index");
2586
+ else el.firstElementChild.firstElementChild.setAttribute("data-index", String(__av));
2587
+ var __av = item;
2588
+ if (__av == null || __av === false) el.firstElementChild.firstElementChild.removeAttribute("data-value");
2589
+ else el.firstElementChild.firstElementChild.setAttribute("data-value", String(__av));
2590
+ el.firstElementChild.firstElementChild.textContent = `
2591
+ ${item}
2592
+ `;
2593
+ var __av = String(__idx);
2594
+ if (__av == null || __av === false) el.firstElementChild.nextElementSibling.removeAttribute("data-index");
2595
+ else el.firstElementChild.nextElementSibling.setAttribute("data-index", String(__av));
2596
+ var __av = item;
2597
+ if (__av == null || __av === false) el.firstElementChild.nextElementSibling.removeAttribute("data-value");
2598
+ else el.firstElementChild.nextElementSibling.setAttribute("data-value", String(__av));
2599
+ el.setAttribute("data-gea-item-id", String(item));
2600
+ el.id = __c.__geaIdPfx + String(item);
2601
+ el.__geaItem = item;
2602
+ return el;
2603
+ }
2604
+ __onPropChange(key, value) {
2605
+ if (key === "class") try {
2606
+ const __el = this.$(":scope");
2607
+ this.props;
2608
+ const __boundValue = this.props.class || "";
2609
+ if (__el) {
2610
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
2611
+ if (__el.className !== __newClass) __el.className = __newClass;
2612
+ }
2613
+ } catch {}
2614
+ if (key === "label") this.__geaPatchCond(0);
2615
+ }
2616
+ __observe_local_value(__v, __c) {
2617
+ this.__geaSyncMap(0);
2618
+ }
2619
+ createdHooks() {
2620
+ if (!this.__observer_removers__) this.__observer_removers__ = [];
2621
+ if (!this.__stores) this.__stores = {};
2622
+ this.__observer_removers__.forEach((fn) => fn());
2623
+ this.__observer_removers__ = [];
2624
+ if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
2625
+ this.__geaRegisterMap(0, "____unresolved_0_container", () => document.getElementById(this.id + "-b1"), () => {
2626
+ return this.value || [];
2627
+ }, (__item, __idx) => this.create__unresolved_0Item(__item, __idx));
2628
+ }
2629
+ __setupLocalStateObservers() {
2630
+ if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
2631
+ if (!this.__store) return;
2632
+ this.__observer_removers__.push(this.__store.observe(["value"], (__v, __c) => this.__observe_local_value(__v, __c)));
2633
+ }
2634
+ dispose() {
2635
+ if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
2636
+ super.dispose();
2637
+ }
2638
+ };
2639
+ //#endregion
2640
+ //#region src/components/toast.tsx
2641
+ function stripStyle(props) {
2642
+ const { style: _style, ...rest } = props;
2643
+ return rest;
2644
+ }
2645
+ let _store = null;
2646
+ function getStore(props) {
2647
+ if (!_store) _store = toast.createStore({
2648
+ placement: "bottom-end",
2649
+ duration: 5e3,
2650
+ removeDelay: 200,
2651
+ max: 5,
2652
+ ...props
2653
+ });
2654
+ return _store;
2655
+ }
2656
+ var ToastStore = class {
2657
+ static {
2658
+ this.getStore = getStore;
2659
+ }
2660
+ static create(options) {
2661
+ return getStore().create(options);
2662
+ }
2663
+ static success(options) {
2664
+ return getStore().create({
2665
+ ...options,
2666
+ type: "success"
2667
+ });
2668
+ }
2669
+ static error(options) {
2670
+ return getStore().create({
2671
+ ...options,
2672
+ type: "error"
2673
+ });
2674
+ }
2675
+ static info(options) {
2676
+ return getStore().create({
2677
+ ...options,
2678
+ type: "info"
2679
+ });
2680
+ }
2681
+ static loading(options) {
2682
+ return getStore().create({
2683
+ ...options,
2684
+ type: "loading"
2685
+ });
2686
+ }
2687
+ static dismiss(id) {
2688
+ if (id) getStore().dismiss(id);
2689
+ else getStore().dismiss();
2690
+ }
2691
+ };
2692
+ var Toaster = class extends Component {
2693
+ created(props) {
2694
+ this._toastMachines = /* @__PURE__ */ new Map();
2695
+ this._spreadCleanups = /* @__PURE__ */ new Map();
2696
+ this._currentToasts = [];
2697
+ const store = getStore(props.storeProps);
2698
+ this._machine = new VanillaMachine(toast.group.machine, { store });
2699
+ this._machine.start();
2700
+ this._api = toast.group.connect(this._machine.service, normalizeProps);
2701
+ this._machine.subscribe(() => {
2702
+ if (!this._machine) return;
2703
+ this._api = toast.group.connect(this._machine.service, normalizeProps);
2704
+ const nextToasts = this._api.getToasts();
2705
+ this._syncToastDOM(nextToasts);
2706
+ this._currentToasts = nextToasts;
2707
+ this._syncToastMachines();
2708
+ queueMicrotask(() => this._applyGroupSpreads());
2709
+ });
2710
+ }
2711
+ _createToastElement(t) {
2712
+ const div = document.createElement("div");
2713
+ div.setAttribute("data-part", "toast-root");
2714
+ div.setAttribute("data-toast-id", t.id);
2715
+ div.className = "toast-root group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 shadow-lg transition-all bg-background text-foreground";
2716
+ let inner = "<div class=\"grid gap-1\">";
2717
+ if (t.title) inner += `<div data-part="title" class="toast-title text-sm font-semibold">${t.title}</div>`;
2718
+ if (t.description) inner += `<div data-part="description" class="toast-description text-sm opacity-90">${t.description}</div>`;
2719
+ inner += "</div>";
2720
+ inner += "<button data-part=\"close-trigger\" class=\"toast-close-trigger text-foreground/50 hover:text-foreground\">&#x2715;</button>";
2721
+ div.innerHTML = inner;
2722
+ return div;
2723
+ }
2724
+ _syncToastDOM(nextToasts) {
2725
+ const container = this.el;
2726
+ if (!container) return;
2727
+ const currentIds = new Set(this._currentToasts.map((t) => t.id));
2728
+ const nextIds = new Set(nextToasts.map((t) => t.id));
2729
+ for (const id of currentIds) if (!nextIds.has(id)) {
2730
+ const el = container.querySelector(`[data-toast-id="${id}"]`);
2731
+ if (el) {
2732
+ const cleanups = this._spreadCleanups.get(id);
2733
+ if (cleanups) cleanups.forEach((fn) => fn());
2734
+ this._spreadCleanups.delete(id);
2735
+ el.remove();
2736
+ }
2737
+ }
2738
+ for (const t of nextToasts) if (!currentIds.has(t.id)) {
2739
+ const el = this._createToastElement(t);
2740
+ container.appendChild(el);
2741
+ }
2742
+ }
2743
+ _syncToastMachines() {
2744
+ if (!this._machine) return;
2745
+ const currentIds = new Set(this._currentToasts.map((t) => t.id));
2746
+ for (const [id, machine] of this._toastMachines) if (!currentIds.has(id)) {
2747
+ machine.stop();
2748
+ this._toastMachines.delete(id);
2749
+ }
2750
+ for (let i = 0; i < this._currentToasts.length; i++) {
2751
+ const t = this._currentToasts[i];
2752
+ if (!this._toastMachines.has(t.id)) {
2753
+ const toastMachine = new VanillaMachine(toast.machine, {
2754
+ ...t,
2755
+ parent: this._machine.service,
2756
+ index: i,
2757
+ stacked: true,
2758
+ removeDelay: t.removeDelay ?? 200
2759
+ });
2760
+ toastMachine.start();
2761
+ this._toastMachines.set(t.id, toastMachine);
2762
+ toastMachine.subscribe(() => {
2763
+ queueMicrotask(() => this._applyGroupSpreads());
2764
+ });
2765
+ }
2766
+ }
2767
+ }
2768
+ _applyGroupSpreads() {
2769
+ if (!this.rendered_ || !this._api) return;
2770
+ const groupEl = this.el;
2771
+ if (groupEl) spreadProps(groupEl, stripStyle(this._api.getGroupProps()));
2772
+ const toastEls = this.$$("[data-toast-id]");
2773
+ for (const el of toastEls) {
2774
+ const toastId = el.dataset.toastId;
2775
+ if (!toastId) continue;
2776
+ const toastMachine = this._toastMachines.get(toastId);
2777
+ if (!toastMachine) continue;
2778
+ const api = toast.connect(toastMachine.service, normalizeProps);
2779
+ const prevCleanups = this._spreadCleanups.get(toastId);
2780
+ if (prevCleanups) prevCleanups.forEach((fn) => fn());
2781
+ const cleanups = [];
2782
+ const rootProps = stripStyle(api.getRootProps());
2783
+ delete rootProps["data-part"];
2784
+ cleanups.push(spreadProps(el, rootProps));
2785
+ const title = el.querySelector("[data-part=\"title\"]");
2786
+ if (title) cleanups.push(spreadProps(title, api.getTitleProps()));
2787
+ const desc = el.querySelector("[data-part=\"description\"]");
2788
+ if (desc) cleanups.push(spreadProps(desc, api.getDescriptionProps()));
2789
+ const close = el.querySelector("[data-part=\"close-trigger\"]");
2790
+ if (close) cleanups.push(spreadProps(close, api.getCloseTriggerProps()));
2791
+ const action = el.querySelector("[data-part=\"action-trigger\"]");
2792
+ if (action) cleanups.push(spreadProps(action, api.getActionTriggerProps()));
2793
+ this._spreadCleanups.set(toastId, cleanups);
2794
+ }
2795
+ }
2796
+ onAfterRender() {
2797
+ this._applyGroupSpreads();
2798
+ }
2799
+ dispose() {
2800
+ for (const cleanups of this._spreadCleanups.values()) cleanups.forEach((fn) => fn());
2801
+ this._spreadCleanups.clear();
2802
+ for (const machine of this._toastMachines.values()) machine.stop();
2803
+ this._toastMachines.clear();
2804
+ if (this._machine) {
2805
+ this._machine.stop();
2806
+ this._machine = null;
2807
+ }
2808
+ this._api = null;
2809
+ super.dispose();
2810
+ }
2811
+ template(props) {
2812
+ return `<div id="${this.id}" data-part="group"${`toaster fixed z-[100] flex max-h-screen flex-col-reverse gap-2 p-4 ${props.class || "bottom-0 right-0"}` == null ? "" : ` class="${`toaster fixed z-[100] flex max-h-screen flex-col-reverse gap-2 p-4 ${props.class || "bottom-0 right-0"}`.trim()}"`}></div>`;
2813
+ }
2814
+ __onPropChange(key, value) {
2815
+ if (key === "class") try {
2816
+ const __el = this.$(":scope");
2817
+ this.props;
2818
+ const __boundValue = `toaster fixed z-[100] flex max-h-screen flex-col-reverse gap-2 p-4 ${this.props.class || "bottom-0 right-0"}`;
2819
+ if (__el) {
2820
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
2821
+ if (__el.className !== __newClass) __el.className = __newClass;
2822
+ }
2823
+ } catch {}
2824
+ }
2825
+ };
2826
+ //#endregion
2827
+ //#region src/components/toggle-group.tsx
2828
+ var ToggleGroup = class extends ZagComponent {
2829
+ createMachine(_props) {
2830
+ return toggleGroup.machine;
2831
+ }
2832
+ getMachineProps(props) {
2833
+ return {
2834
+ id: this.id,
2835
+ value: props.value,
2836
+ defaultValue: props.defaultValue,
2837
+ multiple: props.multiple ?? false,
2838
+ disabled: props.disabled,
2839
+ orientation: props.orientation ?? "horizontal",
2840
+ loopFocus: props.loopFocus ?? true,
2841
+ rovingFocus: props.rovingFocus ?? true,
2842
+ onValueChange: (details) => {
2843
+ this.value = details.value;
2844
+ props.onValueChange?.(details);
2845
+ }
2846
+ };
2847
+ }
2848
+ connectApi(service) {
2849
+ return toggleGroup.connect(service, normalizeProps);
2850
+ }
2851
+ getSpreadMap() {
2852
+ return {
2853
+ "[data-part=\"root\"]": "getRootProps",
2854
+ "[data-part=\"item\"]": (api, el) => api.getItemProps({ value: el.dataset.value })
2855
+ };
2856
+ }
2857
+ syncState(api) {
2858
+ this.value = api.value;
2859
+ }
2860
+ template(props) {
2861
+ const items = props.items || [];
2862
+ return `<div id="${this.id}" data-part="root"${`toggle-group-root inline-flex rounded-md border ${props.class || ""}` == null ? "" : ` class="${`toggle-group-root inline-flex rounded-md border ${props.class || ""}`.trim()}"`}>${items.map((item) => `<button data-gea-item-id="${String(item)}" data-part="item"${item.value == null ? "" : ` data-value="${item.value}"`} class="toggle-group-item inline-flex items-center justify-center rounded-md px-3 py-2 text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground">${item.label}</button>`).join("") + "<!---->"}</div>`;
2863
+ }
2864
+ render__unresolved_0Item(item) {
2865
+ const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
2866
+ return `<button data-gea-item-id="${String(item)}" data-part="item"${__v(item.value) == __v(null) ? "" : ` data-value="${item.value}"`} class="toggle-group-item inline-flex items-center justify-center rounded-md px-3 py-2 text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground">${item.label}</button>`;
2867
+ }
2868
+ create__unresolved_0Item(item) {
2869
+ var __c = this.____unresolved_0_container;
2870
+ if (!__c.__geaTpl) try {
2871
+ var __tw = __c.cloneNode(false);
2872
+ __tw.innerHTML = this.render__unresolved_0Item("__dummy__");
2873
+ __c.__geaTpl = __tw.firstElementChild;
2874
+ } catch {}
2875
+ if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
2876
+ else {
2877
+ var __fw = __c.cloneNode(false);
2878
+ __fw.innerHTML = this.render__unresolved_0Item(item);
2879
+ var el = __fw.firstElementChild;
2880
+ }
2881
+ var __av = item.value;
2882
+ if (__av == null || __av === false) el.removeAttribute("data-value");
2883
+ else el.setAttribute("data-value", String(__av));
2884
+ el.textContent = `
2885
+ ${item.label}
2886
+ `;
2887
+ el.setAttribute("data-gea-item-id", String(item));
2888
+ el.__geaItem = item;
2889
+ return el;
2890
+ }
2891
+ __onPropChange(key, value) {
2892
+ if (key === "class") try {
2893
+ const __el = this.$(":scope");
2894
+ this.props;
2895
+ const __boundValue = `toggle-group-root inline-flex rounded-md border ${this.props.class || ""}`;
2896
+ if (__el) {
2897
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
2898
+ if (__el.className !== __newClass) __el.className = __newClass;
2899
+ }
2900
+ } catch {}
2901
+ if (key === "items") this.__geaSyncMap(0);
2902
+ }
2903
+ __observe_local_props(__v, __c) {
2904
+ this.__geaSyncMap(0);
2905
+ }
2906
+ createdHooks() {
2907
+ if (!this.__observer_removers__) this.__observer_removers__ = [];
2908
+ if (!this.__stores) this.__stores = {};
2909
+ this.__observer_removers__.forEach((fn) => fn());
2910
+ this.__observer_removers__ = [];
2911
+ if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
2912
+ this.__geaRegisterMap(0, "____unresolved_0_container", () => this.$(":scope"), () => {
2913
+ return this.props.items || [];
2914
+ }, (__item) => this.create__unresolved_0Item(__item));
2915
+ }
2916
+ dispose() {
2917
+ if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
2918
+ super.dispose();
2919
+ }
2920
+ };
2921
+ //#endregion
2922
+ //#region src/components/tooltip.tsx
2923
+ var Tooltip = class extends ZagComponent {
2924
+ createMachine(_props) {
2925
+ return tooltip.machine;
2926
+ }
2927
+ getMachineProps(props) {
2928
+ return {
2929
+ id: this.id,
2930
+ open: props.open,
2931
+ defaultOpen: props.defaultOpen,
2932
+ openDelay: props.openDelay ?? 400,
2933
+ closeDelay: props.closeDelay ?? 150,
2934
+ closeOnPointerDown: props.closeOnPointerDown ?? true,
2935
+ closeOnEscape: props.closeOnEscape ?? true,
2936
+ closeOnScroll: props.closeOnScroll ?? true,
2937
+ interactive: props.interactive ?? false,
2938
+ disabled: props.disabled,
2939
+ positioning: props.positioning,
2940
+ "aria-label": props["aria-label"],
2941
+ onOpenChange: (details) => {
2942
+ this.open = details.open;
2943
+ props.onOpenChange?.(details);
2944
+ }
2945
+ };
2946
+ }
2947
+ connectApi(service) {
2948
+ return tooltip.connect(service, normalizeProps);
2949
+ }
2950
+ getSpreadMap() {
2951
+ return {
2952
+ "[data-part=\"trigger\"]": "getTriggerProps",
2953
+ "[data-part=\"positioner\"]": "getPositionerProps",
2954
+ "[data-part=\"content\"]": "getContentProps",
2955
+ "[data-part=\"arrow\"]": "getArrowProps",
2956
+ "[data-part=\"arrow-tip\"]": "getArrowTipProps"
2957
+ };
2958
+ }
2959
+ syncState(api) {
2960
+ this.open = api.open;
2961
+ }
2962
+ template(props) {
2963
+ return `<div id="${this.id}"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`} style="display: inline-block;"><div id="${this.id + "-b1"}" data-part="trigger" class="tooltip-trigger" style="display: inline-block;">${props.children}</div><div data-part="positioner" class="tooltip-positioner"><div id="${this.id + "-b2"}" data-part="content" class="tooltip-content z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground shadow-md">${props.content}</div></div></div>`;
2964
+ }
2965
+ __onPropChange(key, value) {
2966
+ if (key === "class") try {
2967
+ const __el = this.$(":scope");
2968
+ this.props;
2969
+ const __boundValue = this.props.class || "";
2970
+ if (__el) {
2971
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
2972
+ if (__el.className !== __newClass) __el.className = __newClass;
2973
+ }
2974
+ } catch {}
2975
+ if (key === "children") try {
2976
+ const __el = document.getElementById(this.id + "-b1");
2977
+ if (__el) {
2978
+ if (__el.textContent !== value) __el.textContent = value;
2979
+ }
2980
+ } catch {}
2981
+ if (key === "content") try {
2982
+ const __el = document.getElementById(this.id + "-b2");
2983
+ if (__el) {
2984
+ if (__el.textContent !== value) __el.textContent = value;
2985
+ }
2986
+ } catch {}
2987
+ }
2988
+ };
2989
+ //#endregion
2990
+ //#region src/components/tree-view.tsx
2991
+ var TreeView = class extends ZagComponent {
2992
+ constructor(...args) {
2993
+ super(...args);
2994
+ this.selectedValue = [];
2995
+ this.expandedValue = [];
2996
+ this.props;
2997
+ this.__geaCond_0 = !!this.props.label;
2998
+ this.__geaRegisterCond(0, "c0", () => {
2999
+ this.props;
3000
+ return this.props.label;
3001
+ }, () => {
3002
+ this.props;
3003
+ return `<label data-part="label" class="tree-view-label text-sm font-medium mb-2 block">${this.props.label}</label>`;
3004
+ }, null);
3005
+ }
3006
+ createMachine(_props) {
3007
+ return treeView.machine;
3008
+ }
3009
+ getMachineProps(props) {
3010
+ return {
3011
+ id: this.id,
3012
+ collection: props.collection,
3013
+ selectedValue: props.selectedValue,
3014
+ defaultSelectedValue: props.defaultSelectedValue,
3015
+ expandedValue: props.expandedValue,
3016
+ defaultExpandedValue: props.defaultExpandedValue,
3017
+ selectionMode: props.selectionMode ?? "single",
3018
+ expandOnClick: props.expandOnClick ?? true,
3019
+ onSelectionChange: (details) => {
3020
+ this.selectedValue = details.selectedValue;
3021
+ props.onSelectionChange?.(details);
3022
+ },
3023
+ onExpandedChange: (details) => {
3024
+ this.expandedValue = details.expandedValue;
3025
+ props.onExpandedChange?.(details);
3026
+ }
3027
+ };
3028
+ }
3029
+ connectApi(service) {
3030
+ return treeView.connect(service, normalizeProps);
3031
+ }
3032
+ getSpreadMap() {
3033
+ return {
3034
+ "[data-part=\"root\"]": "getRootProps",
3035
+ "[data-part=\"label\"]": "getLabelProps",
3036
+ "[data-part=\"tree\"]": "getTreeProps"
3037
+ };
3038
+ }
3039
+ syncState(api) {
3040
+ this.selectedValue = api.selectedValue;
3041
+ this.expandedValue = api.expandedValue;
3042
+ }
3043
+ template(props) {
3044
+ return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<label data-part="label" class="tree-view-label text-sm font-medium mb-2 block">${props.label}</label>` || ""}<!--${this.id + "-c0-end"}--><div id="${this.id + "-b1"}" data-part="tree" class="tree-view-tree" role="tree">${props.children}</div></div>`;
3045
+ }
3046
+ __onPropChange(key, value) {
3047
+ if (key === "class") try {
3048
+ const __el = this.$(":scope");
3049
+ this.props;
3050
+ const __boundValue = this.props.class || "";
3051
+ if (__el) {
3052
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3053
+ if (__el.className !== __newClass) __el.className = __newClass;
3054
+ }
3055
+ } catch {}
3056
+ if (key === "children") try {
3057
+ const __el = document.getElementById(this.id + "-b1");
3058
+ if (__el) {
3059
+ if (__el.textContent !== value) __el.textContent = value;
3060
+ }
3061
+ } catch {}
3062
+ if (key === "label") this.__geaPatchCond(0);
3063
+ }
3064
+ };
3065
+ //#endregion
3066
+ //#region src/components/button.tsx
3067
+ const variants$2 = {
3068
+ default: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",
3069
+ destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
3070
+ outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
3071
+ secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
3072
+ ghost: "hover:bg-accent hover:text-accent-foreground",
3073
+ link: "text-primary underline-offset-4 hover:underline"
3074
+ };
3075
+ const sizes = {
3076
+ default: "h-9 px-4 py-2",
3077
+ sm: "h-8 rounded-md px-3 text-xs",
3078
+ lg: "h-10 rounded-md px-8",
3079
+ icon: "h-9 w-9"
3080
+ };
3081
+ var Button = class extends Component {
3082
+ template(props) {
3083
+ const variant = variants$2[props.variant || "default"] || variants$2.default;
3084
+ const size = sizes[props.size || "default"] || sizes.default;
3085
+ return `<button id="${this.id}"${cn("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", variant, size, props.class) == null ? "" : ` class="${cn("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", variant, size, props.class).trim()}"`}${(props.type || "button") == null || (props.type || "button") === false ? "" : ` type="${props.type || "button"}"`}${props.disabled == null ? "" : ` disabled="${props.disabled}"`}>${props.children}</button>`;
3086
+ }
3087
+ get events() {
3088
+ return { click: { [`#${this.id}`]: this.__event_click_0 } };
3089
+ }
3090
+ __event_click_0(e, targetComponent) {
3091
+ (this.props.click || this.props.onClick)?.(e);
3092
+ }
3093
+ __onPropChange(key, value) {
3094
+ if (key === "variant") try {
3095
+ const __el = this.$(":scope");
3096
+ const props = this.props;
3097
+ const __boundValue = cn("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", variants$2[props.variant || "default"] || variants$2.default, sizes[props.size || "default"] || sizes.default, this.props.class);
3098
+ if (__el) {
3099
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3100
+ if (__el.className !== __newClass) __el.className = __newClass;
3101
+ }
3102
+ } catch {}
3103
+ if (key === "size") try {
3104
+ const __el = this.$(":scope");
3105
+ const props = this.props;
3106
+ const __boundValue = cn("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", variants$2[props.variant || "default"] || variants$2.default, sizes[props.size || "default"] || sizes.default, this.props.class);
3107
+ if (__el) {
3108
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3109
+ if (__el.className !== __newClass) __el.className = __newClass;
3110
+ }
3111
+ } catch {}
3112
+ if (key === "class") try {
3113
+ const __el = this.$(":scope");
3114
+ const props = this.props;
3115
+ const __boundValue = cn("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", variants$2[props.variant || "default"] || variants$2.default, sizes[props.size || "default"] || sizes.default, this.props.class);
3116
+ if (__el) {
3117
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3118
+ if (__el.className !== __newClass) __el.className = __newClass;
3119
+ }
3120
+ } catch {}
3121
+ if (key === "type") try {
3122
+ const __el = this.$(":scope");
3123
+ this.props;
3124
+ const __boundValue = this.props.type || "button";
3125
+ if (__el) if (__boundValue === null || __boundValue === void 0) __el.removeAttribute("type");
3126
+ else __el.setAttribute("type", String(__boundValue));
3127
+ } catch {}
3128
+ if (key === "disabled") try {
3129
+ const __el = this.$(":scope");
3130
+ if (__el) if (!value) __el.removeAttribute("disabled");
3131
+ else __el.setAttribute("disabled", "");
3132
+ } catch {}
3133
+ if (key === "children") try {
3134
+ const __el = this.$(":scope");
3135
+ if (__el) {
3136
+ if (__el.textContent !== value) __el.textContent = value;
3137
+ }
3138
+ } catch {}
3139
+ }
3140
+ };
3141
+ //#endregion
3142
+ //#region src/components/card.tsx
3143
+ var Card = class extends Component {
3144
+ template(props) {
3145
+ return `<div id="${this.id}"${cn("rounded-xl border bg-card text-card-foreground shadow", props.class) == null ? "" : ` class="${cn("rounded-xl border bg-card text-card-foreground shadow", props.class).trim()}"`}>${props.children}</div>`;
3146
+ }
3147
+ __onPropChange(key, value) {
3148
+ if (key === "class") try {
3149
+ const __el = this.$(":scope");
3150
+ this.props;
3151
+ const __boundValue = cn("rounded-xl border bg-card text-card-foreground shadow", this.props.class);
3152
+ if (__el) {
3153
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3154
+ if (__el.className !== __newClass) __el.className = __newClass;
3155
+ }
3156
+ } catch {}
3157
+ if (key === "children") try {
3158
+ const __el = this.$(":scope");
3159
+ if (__el) {
3160
+ if (__el.textContent !== value) __el.textContent = value;
3161
+ }
3162
+ } catch {}
3163
+ }
3164
+ };
3165
+ var CardHeader = class extends Component {
3166
+ template(props) {
3167
+ return `<div id="${this.id}"${cn("flex flex-col space-y-1.5 p-6", props.class) == null ? "" : ` class="${cn("flex flex-col space-y-1.5 p-6", props.class).trim()}"`}>${props.children}</div>`;
3168
+ }
3169
+ __onPropChange(key, value) {
3170
+ if (key === "class") try {
3171
+ const __el = this.$(":scope");
3172
+ this.props;
3173
+ const __boundValue = cn("flex flex-col space-y-1.5 p-6", this.props.class);
3174
+ if (__el) {
3175
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3176
+ if (__el.className !== __newClass) __el.className = __newClass;
3177
+ }
3178
+ } catch {}
3179
+ if (key === "children") try {
3180
+ const __el = this.$(":scope");
3181
+ if (__el) {
3182
+ if (__el.textContent !== value) __el.textContent = value;
3183
+ }
3184
+ } catch {}
3185
+ }
3186
+ };
3187
+ var CardTitle = class extends Component {
3188
+ template(props) {
3189
+ return `<h3 id="${this.id}"${cn("font-semibold leading-none tracking-tight", props.class) == null ? "" : ` class="${cn("font-semibold leading-none tracking-tight", props.class).trim()}"`}>${props.children}</h3>`;
3190
+ }
3191
+ __onPropChange(key, value) {
3192
+ if (key === "class") try {
3193
+ const __el = this.$(":scope");
3194
+ this.props;
3195
+ const __boundValue = cn("font-semibold leading-none tracking-tight", this.props.class);
3196
+ if (__el) {
3197
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3198
+ if (__el.className !== __newClass) __el.className = __newClass;
3199
+ }
3200
+ } catch {}
3201
+ if (key === "children") try {
3202
+ const __el = this.$(":scope");
3203
+ if (__el) {
3204
+ if (__el.textContent !== value) __el.textContent = value;
3205
+ }
3206
+ } catch {}
3207
+ }
3208
+ };
3209
+ var CardDescription = class extends Component {
3210
+ template(props) {
3211
+ return `<p id="${this.id}"${cn("text-sm text-muted-foreground", props.class) == null ? "" : ` class="${cn("text-sm text-muted-foreground", props.class).trim()}"`}>${props.children}</p>`;
3212
+ }
3213
+ __onPropChange(key, value) {
3214
+ if (key === "class") try {
3215
+ const __el = this.$(":scope");
3216
+ this.props;
3217
+ const __boundValue = cn("text-sm text-muted-foreground", this.props.class);
3218
+ if (__el) {
3219
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3220
+ if (__el.className !== __newClass) __el.className = __newClass;
3221
+ }
3222
+ } catch {}
3223
+ if (key === "children") try {
3224
+ const __el = this.$(":scope");
3225
+ if (__el) {
3226
+ if (__el.textContent !== value) __el.textContent = value;
3227
+ }
3228
+ } catch {}
3229
+ }
3230
+ };
3231
+ var CardContent = class extends Component {
3232
+ template(props) {
3233
+ return `<div id="${this.id}"${cn("p-6 pt-0", props.class) == null ? "" : ` class="${cn("p-6 pt-0", props.class).trim()}"`}>${props.children}</div>`;
3234
+ }
3235
+ __onPropChange(key, value) {
3236
+ if (key === "class") try {
3237
+ const __el = this.$(":scope");
3238
+ this.props;
3239
+ const __boundValue = cn("p-6 pt-0", this.props.class);
3240
+ if (__el) {
3241
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3242
+ if (__el.className !== __newClass) __el.className = __newClass;
3243
+ }
3244
+ } catch {}
3245
+ if (key === "children") try {
3246
+ const __el = this.$(":scope");
3247
+ if (__el) {
3248
+ if (__el.textContent !== value) __el.textContent = value;
3249
+ }
3250
+ } catch {}
3251
+ }
3252
+ };
3253
+ var CardFooter = class extends Component {
3254
+ template(props) {
3255
+ return `<div id="${this.id}"${cn("flex items-center p-6 pt-0", props.class) == null ? "" : ` class="${cn("flex items-center p-6 pt-0", props.class).trim()}"`}>${props.children}</div>`;
3256
+ }
3257
+ __onPropChange(key, value) {
3258
+ if (key === "class") try {
3259
+ const __el = this.$(":scope");
3260
+ this.props;
3261
+ const __boundValue = cn("flex items-center p-6 pt-0", this.props.class);
3262
+ if (__el) {
3263
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3264
+ if (__el.className !== __newClass) __el.className = __newClass;
3265
+ }
3266
+ } catch {}
3267
+ if (key === "children") try {
3268
+ const __el = this.$(":scope");
3269
+ if (__el) {
3270
+ if (__el.textContent !== value) __el.textContent = value;
3271
+ }
3272
+ } catch {}
3273
+ }
3274
+ };
3275
+ //#endregion
3276
+ //#region src/components/input.tsx
3277
+ var Input = class extends Component {
3278
+ template(props) {
3279
+ return `<input id="${this.id}"${cn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", props.class) == null ? "" : ` class="${cn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", props.class).trim()}"`}${(props.type || "text") == null || (props.type || "text") === false ? "" : ` type="${props.type || "text"}"`}${props.placeholder == null ? "" : ` placeholder="${props.placeholder}"`}${props.value == null ? "" : ` value="${props.value}"`}${props.disabled == null ? "" : ` disabled="${props.disabled}"`}${props.name == null ? "" : ` name="${props.name}"`}${props.inputId == null ? "" : ` id="${props.inputId}"`} />`;
3280
+ }
3281
+ get events() {
3282
+ return { input: { [`#${this.id}`]: this.__event_input_0 } };
3283
+ }
3284
+ __event_input_0(e, targetComponent) {
3285
+ this.props.onInput(e);
3286
+ }
3287
+ __onPropChange(key, value) {
3288
+ if (key === "class") try {
3289
+ const __el = this.$(":scope");
3290
+ this.props;
3291
+ const __boundValue = cn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", this.props.class);
3292
+ if (__el) {
3293
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3294
+ if (__el.className !== __newClass) __el.className = __newClass;
3295
+ }
3296
+ } catch {}
3297
+ if (key === "type") try {
3298
+ const __el = this.$(":scope");
3299
+ this.props;
3300
+ const __boundValue = this.props.type || "text";
3301
+ if (__el) if (__boundValue === null || __boundValue === void 0) __el.removeAttribute("type");
3302
+ else __el.setAttribute("type", String(__boundValue));
3303
+ } catch {}
3304
+ if (key === "placeholder") try {
3305
+ const __el = this.$(":scope");
3306
+ if (__el) if (value === null || value === void 0) __el.removeAttribute("placeholder");
3307
+ else __el.setAttribute("placeholder", String(value));
3308
+ } catch {}
3309
+ if (key === "value") try {
3310
+ const __el = this.$(":scope");
3311
+ if (__el) __el.value = value === null || value === void 0 ? "" : String(value);
3312
+ } catch {}
3313
+ if (key === "disabled") try {
3314
+ const __el = this.$(":scope");
3315
+ if (__el) if (!value) __el.removeAttribute("disabled");
3316
+ else __el.setAttribute("disabled", "");
3317
+ } catch {}
3318
+ if (key === "name") try {
3319
+ const __el = this.$(":scope");
3320
+ if (__el) if (value === null || value === void 0) __el.removeAttribute("name");
3321
+ else __el.setAttribute("name", String(value));
3322
+ } catch {}
3323
+ if (key === "inputId") try {
3324
+ const __el = this.$(":scope");
3325
+ if (__el) if (value === null || value === void 0) __el.removeAttribute("id");
3326
+ else __el.setAttribute("id", String(value));
3327
+ } catch {}
3328
+ if (key === "onInput") try {
3329
+ const __el = this.$(":scope");
3330
+ if (__el) if (value === null || value === void 0) __el.removeAttribute("onInput");
3331
+ else __el.setAttribute("onInput", String(value));
3332
+ } catch {}
3333
+ }
3334
+ };
3335
+ //#endregion
3336
+ //#region src/components/textarea.tsx
3337
+ var Textarea = class extends Component {
3338
+ template(props) {
3339
+ return `<textarea id="${this.id}"${cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", props.class) == null ? "" : ` class="${cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", props.class).trim()}"`}${props.placeholder == null ? "" : ` placeholder="${props.placeholder}"`}${props.disabled == null ? "" : ` disabled="${props.disabled}"`}${props.name == null ? "" : ` name="${props.name}"`}${props.rows == null ? "" : ` rows="${props.rows}"`}>${props.value || ""}</textarea>`;
3340
+ }
3341
+ get events() {
3342
+ return { input: { [`#${this.id}`]: this.__event_input_0 } };
3343
+ }
3344
+ __event_input_0(e, targetComponent) {
3345
+ this.props.onInput(e);
3346
+ }
3347
+ __onPropChange(key, value) {
3348
+ if (key === "class") try {
3349
+ const __el = this.$(":scope");
3350
+ this.props;
3351
+ const __boundValue = cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", this.props.class);
3352
+ if (__el) {
3353
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3354
+ if (__el.className !== __newClass) __el.className = __newClass;
3355
+ }
3356
+ } catch {}
3357
+ if (key === "placeholder") try {
3358
+ const __el = this.$(":scope");
3359
+ if (__el) if (value === null || value === void 0) __el.removeAttribute("placeholder");
3360
+ else __el.setAttribute("placeholder", String(value));
3361
+ } catch {}
3362
+ if (key === "disabled") try {
3363
+ const __el = this.$(":scope");
3364
+ if (__el) if (!value) __el.removeAttribute("disabled");
3365
+ else __el.setAttribute("disabled", "");
3366
+ } catch {}
3367
+ if (key === "name") try {
3368
+ const __el = this.$(":scope");
3369
+ if (__el) if (value === null || value === void 0) __el.removeAttribute("name");
3370
+ else __el.setAttribute("name", String(value));
3371
+ } catch {}
3372
+ if (key === "rows") try {
3373
+ const __el = this.$(":scope");
3374
+ if (__el) if (value === null || value === void 0) __el.removeAttribute("rows");
3375
+ else __el.setAttribute("rows", String(value));
3376
+ } catch {}
3377
+ if (key === "onInput") try {
3378
+ const __el = this.$(":scope");
3379
+ if (__el) if (value === null || value === void 0) __el.removeAttribute("onInput");
3380
+ else __el.setAttribute("onInput", String(value));
3381
+ } catch {}
3382
+ if (key === "value") try {
3383
+ const __el = this.$(":scope");
3384
+ this.props;
3385
+ const __boundValue = this.props.value || "";
3386
+ if (__el) {
3387
+ if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
3388
+ }
3389
+ } catch {}
3390
+ }
3391
+ };
3392
+ //#endregion
3393
+ //#region src/components/label.tsx
3394
+ var Label = class extends Component {
3395
+ template(props) {
3396
+ return `<label id="${this.id}"${cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", props.class) == null ? "" : ` class="${cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", props.class).trim()}"`}${props.htmlFor == null ? "" : ` for="${props.htmlFor}"`}>${props.children}</label>`;
3397
+ }
3398
+ __onPropChange(key, value) {
3399
+ if (key === "class") try {
3400
+ const __el = this.$(":scope");
3401
+ this.props;
3402
+ const __boundValue = cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", this.props.class);
3403
+ if (__el) {
3404
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3405
+ if (__el.className !== __newClass) __el.className = __newClass;
3406
+ }
3407
+ } catch {}
3408
+ if (key === "htmlFor") try {
3409
+ const __el = this.$(":scope");
3410
+ if (__el) if (value === null || value === void 0) __el.removeAttribute("for");
3411
+ else __el.setAttribute("for", String(value));
3412
+ } catch {}
3413
+ if (key === "children") try {
3414
+ const __el = this.$(":scope");
3415
+ if (__el) {
3416
+ if (__el.textContent !== value) __el.textContent = value;
3417
+ }
3418
+ } catch {}
3419
+ }
3420
+ };
3421
+ //#endregion
3422
+ //#region src/components/badge.tsx
3423
+ const variants$1 = {
3424
+ default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
3425
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
3426
+ destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
3427
+ outline: "text-foreground"
3428
+ };
3429
+ var Badge = class extends Component {
3430
+ template(props) {
3431
+ const variant = variants$1[props.variant || "default"] || variants$1.default;
3432
+ return `<span id="${this.id}"${cn("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", variant, props.class) == null ? "" : ` class="${cn("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", variant, props.class).trim()}"`}>${props.children}</span>`;
3433
+ }
3434
+ __onPropChange(key, value) {
3435
+ if (key === "variant") try {
3436
+ const __el = this.$(":scope");
3437
+ const __boundValue = cn("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", variants$1[this.props.variant || "default"] || variants$1.default, this.props.class);
3438
+ if (__el) {
3439
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3440
+ if (__el.className !== __newClass) __el.className = __newClass;
3441
+ }
3442
+ } catch {}
3443
+ if (key === "class") try {
3444
+ const __el = this.$(":scope");
3445
+ const __boundValue = cn("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", variants$1[this.props.variant || "default"] || variants$1.default, this.props.class);
3446
+ if (__el) {
3447
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3448
+ if (__el.className !== __newClass) __el.className = __newClass;
3449
+ }
3450
+ } catch {}
3451
+ if (key === "children") try {
3452
+ const __el = this.$(":scope");
3453
+ if (__el) {
3454
+ if (__el.textContent !== value) __el.textContent = value;
3455
+ }
3456
+ } catch {}
3457
+ }
3458
+ };
3459
+ //#endregion
3460
+ //#region src/components/alert.tsx
3461
+ const variants = {
3462
+ default: "bg-background text-foreground",
3463
+ destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
3464
+ };
3465
+ var Alert = class extends Component {
3466
+ template(props) {
3467
+ const variant = variants[props.variant || "default"] || variants.default;
3468
+ return `<div id="${this.id}"${cn("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7", variant, props.class) == null ? "" : ` class="${cn("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7", variant, props.class).trim()}"`} role="alert">${props.children}</div>`;
3469
+ }
3470
+ __onPropChange(key, value) {
3471
+ if (key === "variant") try {
3472
+ const __el = this.$(":scope");
3473
+ const __boundValue = cn("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7", variants[this.props.variant || "default"] || variants.default, this.props.class);
3474
+ if (__el) {
3475
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3476
+ if (__el.className !== __newClass) __el.className = __newClass;
3477
+ }
3478
+ } catch {}
3479
+ if (key === "class") try {
3480
+ const __el = this.$(":scope");
3481
+ const __boundValue = cn("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7", variants[this.props.variant || "default"] || variants.default, this.props.class);
3482
+ if (__el) {
3483
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3484
+ if (__el.className !== __newClass) __el.className = __newClass;
3485
+ }
3486
+ } catch {}
3487
+ if (key === "children") try {
3488
+ const __el = this.$(":scope");
3489
+ if (__el) {
3490
+ if (__el.textContent !== value) __el.textContent = value;
3491
+ }
3492
+ } catch {}
3493
+ }
3494
+ };
3495
+ var AlertTitle = class extends Component {
3496
+ template(props) {
3497
+ return `<h5 id="${this.id}"${cn("mb-1 font-medium leading-none tracking-tight", props.class) == null ? "" : ` class="${cn("mb-1 font-medium leading-none tracking-tight", props.class).trim()}"`}>${props.children}</h5>`;
3498
+ }
3499
+ __onPropChange(key, value) {
3500
+ if (key === "class") try {
3501
+ const __el = this.$(":scope");
3502
+ this.props;
3503
+ const __boundValue = cn("mb-1 font-medium leading-none tracking-tight", this.props.class);
3504
+ if (__el) {
3505
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3506
+ if (__el.className !== __newClass) __el.className = __newClass;
3507
+ }
3508
+ } catch {}
3509
+ if (key === "children") try {
3510
+ const __el = this.$(":scope");
3511
+ if (__el) {
3512
+ if (__el.textContent !== value) __el.textContent = value;
3513
+ }
3514
+ } catch {}
3515
+ }
3516
+ };
3517
+ var AlertDescription = class extends Component {
3518
+ template(props) {
3519
+ return `<div id="${this.id}"${cn("text-sm [&_p]:leading-relaxed", props.class) == null ? "" : ` class="${cn("text-sm [&_p]:leading-relaxed", props.class).trim()}"`}>${props.children}</div>`;
3520
+ }
3521
+ __onPropChange(key, value) {
3522
+ if (key === "class") try {
3523
+ const __el = this.$(":scope");
3524
+ this.props;
3525
+ const __boundValue = cn("text-sm [&_p]:leading-relaxed", this.props.class);
3526
+ if (__el) {
3527
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3528
+ if (__el.className !== __newClass) __el.className = __newClass;
3529
+ }
3530
+ } catch {}
3531
+ if (key === "children") try {
3532
+ const __el = this.$(":scope");
3533
+ if (__el) {
3534
+ if (__el.textContent !== value) __el.textContent = value;
3535
+ }
3536
+ } catch {}
3537
+ }
3538
+ };
3539
+ //#endregion
3540
+ //#region src/components/separator.tsx
3541
+ var Separator = class extends Component {
3542
+ template(props) {
3543
+ const isVertical = props.orientation === "vertical";
3544
+ return `<div id="${this.id}"${cn("shrink-0 bg-border", isVertical ? "h-full w-[1px]" : "h-[1px] w-full", props.class) == null ? "" : ` class="${cn("shrink-0 bg-border", isVertical ? "h-full w-[1px]" : "h-[1px] w-full", props.class).trim()}"`} role="separator"${(props.orientation || "horizontal") == null || (props.orientation || "horizontal") === false ? "" : ` aria-orientation="${props.orientation || "horizontal"}"`}></div>`;
3545
+ }
3546
+ __onPropChange(key, value) {
3547
+ if (key === "orientation") try {
3548
+ {
3549
+ const __el = this.$(":scope");
3550
+ this.props;
3551
+ const __boundValue = cn("shrink-0 bg-border", this.props.orientation === "vertical" ? "h-full w-[1px]" : "h-[1px] w-full", this.props.class);
3552
+ if (__el) {
3553
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3554
+ if (__el.className !== __newClass) __el.className = __newClass;
3555
+ }
3556
+ }
3557
+ {
3558
+ const __el = this.$(":scope");
3559
+ this.props;
3560
+ const __boundValue = this.props.orientation || "horizontal";
3561
+ if (__el) if (__boundValue === null || __boundValue === void 0) __el.removeAttribute("aria-orientation");
3562
+ else __el.setAttribute("aria-orientation", String(__boundValue));
3563
+ }
3564
+ } catch {}
3565
+ if (key === "class") try {
3566
+ const __el = this.$(":scope");
3567
+ this.props;
3568
+ const __boundValue = cn("shrink-0 bg-border", this.props.orientation === "vertical" ? "h-full w-[1px]" : "h-[1px] w-full", this.props.class);
3569
+ if (__el) {
3570
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3571
+ if (__el.className !== __newClass) __el.className = __newClass;
3572
+ }
3573
+ } catch {}
3574
+ }
3575
+ };
3576
+ //#endregion
3577
+ //#region src/components/skeleton.tsx
3578
+ var Skeleton = class extends Component {
3579
+ template(props) {
3580
+ return `<div id="${this.id}"${cn("animate-pulse rounded-md bg-primary/10", props.class) == null ? "" : ` class="${cn("animate-pulse rounded-md bg-primary/10", props.class).trim()}"`}></div>`;
3581
+ }
3582
+ __onPropChange(key, value) {
3583
+ if (key === "class") try {
3584
+ const __el = this.$(":scope");
3585
+ this.props;
3586
+ const __boundValue = cn("animate-pulse rounded-md bg-primary/10", this.props.class);
3587
+ if (__el) {
3588
+ const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
3589
+ if (__el.className !== __newClass) __el.className = __newClass;
3590
+ }
3591
+ } catch {}
3592
+ }
3593
+ };
3594
+ //#endregion
3595
+ export { Accordion, Alert, AlertDescription, AlertTitle, Avatar, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Clipboard, Collapsible, Combobox, Dialog, FileUpload, HoverCard, Input, Label, Menu, NumberInput, Pagination, PinInput, Popover, Progress, RadioGroup, RatingGroup, Select, Separator, Skeleton, Slider, Switch, Tabs, TagsInput, Textarea, ToastStore, Toaster, ToggleGroup, Tooltip, TreeView, ZagComponent, cn };
3596
+
3597
+ //# sourceMappingURL=index.mjs.map