@tech_carthagos/page-builder 1.0.13 → 1.0.15

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.
@@ -0,0 +1,1930 @@
1
+ import { jsx as l, jsxs as F, Fragment as Ct } from "react/jsx-runtime";
2
+ import * as p from "react";
3
+ import m, { useState as Ee, forwardRef as Br, isValidElement as Ye, useEffect as Fr } from "react";
4
+ import { c as Y, N as Qe, a as Et, d as Hr, C as Nt, b as Vr, P as ye, B as Ie, L as Tt, F as $r, k as Ae, W as Je, e as Rt, H as Pt, T as kt, f as It, g as At, I as Dt, V as Mt, D as _t, S as Lt, u as oe, h as Le, i as te, j as ze, l as W, m as ie, n as jr, o as Ne, p as Gr, q as Wr, r as Yr, s as Ur, t as Oe, v as Xr, w as Kr, M as qr, x as Zr, y as Qr, z as Jr, A as eo, E as to, G as ro, J as oo, K as no, O as ao, Q as so, R as lo, U as io, X as co, Y as uo, Z as Ue, _ as Xe } from "./index-C_JmCif3.js";
5
+ import fo from "react-dom";
6
+ /**
7
+ * @license lucide-react v0.462.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */
12
+ const mo = Y("Columns2", [
13
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
14
+ ["path", { d: "M12 3v18", key: "108xh3" }]
15
+ ]);
16
+ /**
17
+ * @license lucide-react v0.462.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */
22
+ const po = Y("GripVertical", [
23
+ ["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
24
+ ["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
25
+ ["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
26
+ ["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
27
+ ["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
28
+ ["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
29
+ ]);
30
+ /**
31
+ * @license lucide-react v0.462.0 - ISC
32
+ *
33
+ * This source code is licensed under the ISC license.
34
+ * See the LICENSE file in the root directory of this source tree.
35
+ */
36
+ const zt = Y("Heading", [
37
+ ["path", { d: "M6 12h12", key: "8npq4p" }],
38
+ ["path", { d: "M6 20V4", key: "1w1bmo" }],
39
+ ["path", { d: "M18 20V4", key: "o2hl4u" }]
40
+ ]);
41
+ /**
42
+ * @license lucide-react v0.462.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */
47
+ const Ot = Y("Image", [
48
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
49
+ ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
50
+ ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
51
+ ]);
52
+ /**
53
+ * @license lucide-react v0.462.0 - ISC
54
+ *
55
+ * This source code is licensed under the ISC license.
56
+ * See the LICENSE file in the root directory of this source tree.
57
+ */
58
+ const Bt = Y("Minus", [["path", { d: "M5 12h14", key: "1ays0h" }]]);
59
+ /**
60
+ * @license lucide-react v0.462.0 - ISC
61
+ *
62
+ * This source code is licensed under the ISC license.
63
+ * See the LICENSE file in the root directory of this source tree.
64
+ */
65
+ const Ft = Y("MousePointer", [
66
+ ["path", { d: "M12.586 12.586 19 19", key: "ea5xo7" }],
67
+ [
68
+ "path",
69
+ {
70
+ d: "M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z",
71
+ key: "277e5u"
72
+ }
73
+ ]
74
+ ]);
75
+ /**
76
+ * @license lucide-react v0.462.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */
81
+ const Ht = Y("MoveVertical", [
82
+ ["path", { d: "M12 2v20", key: "t6zp3m" }],
83
+ ["path", { d: "m8 18 4 4 4-4", key: "bh5tu3" }],
84
+ ["path", { d: "m8 6 4-4 4 4", key: "ybng9g" }]
85
+ ]);
86
+ /**
87
+ * @license lucide-react v0.462.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */
92
+ const ho = Y("Redo2", [
93
+ ["path", { d: "m15 14 5-5-5-5", key: "12vg1m" }],
94
+ ["path", { d: "M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13", key: "6uklza" }]
95
+ ]);
96
+ /**
97
+ * @license lucide-react v0.462.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */
102
+ const go = Y("Save", [
103
+ [
104
+ "path",
105
+ {
106
+ d: "M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",
107
+ key: "1c8476"
108
+ }
109
+ ],
110
+ ["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
111
+ ["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
112
+ ]);
113
+ /**
114
+ * @license lucide-react v0.462.0 - ISC
115
+ *
116
+ * This source code is licensed under the ISC license.
117
+ * See the LICENSE file in the root directory of this source tree.
118
+ */
119
+ const Ce = Y("Square", [
120
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
121
+ ]);
122
+ /**
123
+ * @license lucide-react v0.462.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */
128
+ const vo = Y("Trash2", [
129
+ ["path", { d: "M3 6h18", key: "d0wm0j" }],
130
+ ["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
131
+ ["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
132
+ ["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
133
+ ["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
134
+ ]);
135
+ /**
136
+ * @license lucide-react v0.462.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */
141
+ const Vt = Y("Type", [
142
+ ["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
143
+ ["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
144
+ ["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
145
+ ]);
146
+ /**
147
+ * @license lucide-react v0.462.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */
152
+ const bo = Y("Undo2", [
153
+ ["path", { d: "M9 14 4 9l5-5", key: "102s5s" }],
154
+ ["path", { d: "M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11", key: "f3b9sd" }]
155
+ ]);
156
+ /**
157
+ * @license lucide-react v0.462.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */
162
+ const yo = Y("Video", [
163
+ [
164
+ "path",
165
+ {
166
+ d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",
167
+ key: "ftymec"
168
+ }
169
+ ],
170
+ ["rect", { x: "2", y: "6", width: "14", height: "12", rx: "2", key: "158x01" }]
171
+ ]), et = (e) => {
172
+ const {
173
+ connectors: { connect: t, drag: r },
174
+ selected: o
175
+ } = Qe((n) => ({
176
+ selected: n.events.selected
177
+ }));
178
+ return /* @__PURE__ */ l(
179
+ "div",
180
+ {
181
+ style: Hr(e),
182
+ className: Et(
183
+ e.className,
184
+ `${o ? "outline outline-blue-500" : ""}`
185
+ ),
186
+ ref: (n) => {
187
+ n && t(r(n));
188
+ },
189
+ children: e.children
190
+ }
191
+ );
192
+ };
193
+ et.craft = {
194
+ isCanvas: !0,
195
+ props: Vr,
196
+ related: { settings: Nt }
197
+ };
198
+ const wo = () => {
199
+ const { connectors: e } = ye(), t = [
200
+ {
201
+ name: "Wrapper",
202
+ icon: Ce,
203
+ element: /* @__PURE__ */ l(Ae, { is: Je, canvas: !0 })
204
+ },
205
+ {
206
+ name: "Container",
207
+ icon: Ce,
208
+ element: /* @__PURE__ */ l(Ae, { is: Rt, canvas: !0 })
209
+ },
210
+ {
211
+ name: "Div",
212
+ icon: Ce,
213
+ element: /* @__PURE__ */ l(Ae, { is: et, canvas: !0 })
214
+ }
215
+ ], r = [
216
+ {
217
+ name: "Heading",
218
+ icon: zt,
219
+ element: /* @__PURE__ */ l(Pt, {})
220
+ },
221
+ {
222
+ name: "Text",
223
+ icon: Vt,
224
+ element: /* @__PURE__ */ l(kt, {})
225
+ },
226
+ {
227
+ name: "Button",
228
+ icon: Ft,
229
+ element: /* @__PURE__ */ l(It, {})
230
+ },
231
+ {
232
+ name: "Link",
233
+ icon: Tt,
234
+ element: /* @__PURE__ */ l(At, {})
235
+ }
236
+ ], o = [
237
+ {
238
+ name: "Image",
239
+ icon: Ot,
240
+ element: /* @__PURE__ */ l(Dt, {})
241
+ },
242
+ {
243
+ name: "Video",
244
+ icon: $r,
245
+ element: /* @__PURE__ */ l(Mt, {})
246
+ }
247
+ ], n = [
248
+ {
249
+ name: "Divider",
250
+ icon: Bt,
251
+ element: /* @__PURE__ */ l(_t, {})
252
+ },
253
+ {
254
+ name: "Spacer",
255
+ icon: Ht,
256
+ element: /* @__PURE__ */ l(Lt, {})
257
+ }
258
+ ], s = (i, d) => /* @__PURE__ */ F("div", { className: "space-y-2", children: [
259
+ /* @__PURE__ */ l("span", { className: "text-xs text-muted-foreground/70", children: i }),
260
+ /* @__PURE__ */ l("div", { className: "grid grid-cols-2 gap-1.5", children: d.map((c) => /* @__PURE__ */ F(
261
+ Ie,
262
+ {
263
+ variant: "outline",
264
+ size: "sm",
265
+ className: "flex flex-col items-center justify-center h-14 cursor-grab active:cursor-grabbing text-muted-foreground hover:text-foreground",
266
+ ref: (u) => u && e.create(u, c.element),
267
+ children: [
268
+ /* @__PURE__ */ l(c.icon, { className: "h-4 w-4 mb-1" }),
269
+ /* @__PURE__ */ l("span", { className: "text-[10px]", children: c.name })
270
+ ]
271
+ },
272
+ c.name
273
+ )) })
274
+ ] });
275
+ return /* @__PURE__ */ F("div", { className: "space-y-4", children: [
276
+ /* @__PURE__ */ l("h3", { className: "text-sm font-medium text-muted-foreground", children: "Components" }),
277
+ s("Layout", t),
278
+ s("Basic", r),
279
+ s("Media", o),
280
+ s("Utility", n)
281
+ ] });
282
+ };
283
+ var xo = p.createContext(void 0);
284
+ function tt(e) {
285
+ const t = p.useContext(xo);
286
+ return e || t || "ltr";
287
+ }
288
+ function So(e, [t, r]) {
289
+ return Math.min(r, Math.max(t, e));
290
+ }
291
+ function Co(e, t) {
292
+ return p.useReducer((r, o) => t[r][o] ?? r, e);
293
+ }
294
+ var rt = "ScrollArea", [$t] = Le(rt), [Eo, K] = $t(rt), jt = p.forwardRef(
295
+ (e, t) => {
296
+ const {
297
+ __scopeScrollArea: r,
298
+ type: o = "hover",
299
+ dir: n,
300
+ scrollHideDelay: s = 600,
301
+ ...i
302
+ } = e, [d, c] = p.useState(null), [u, f] = p.useState(null), [h, g] = p.useState(null), [a, N] = p.useState(null), [v, b] = p.useState(null), [E, C] = p.useState(0), [x, T] = p.useState(0), [O, R] = p.useState(!1), [A, D] = p.useState(!1), k = oe(t, (H) => c(H)), B = tt(n);
303
+ return /* @__PURE__ */ l(
304
+ Eo,
305
+ {
306
+ scope: r,
307
+ type: o,
308
+ dir: B,
309
+ scrollHideDelay: s,
310
+ scrollArea: d,
311
+ viewport: u,
312
+ onViewportChange: f,
313
+ content: h,
314
+ onContentChange: g,
315
+ scrollbarX: a,
316
+ onScrollbarXChange: N,
317
+ scrollbarXEnabled: O,
318
+ onScrollbarXEnabledChange: R,
319
+ scrollbarY: v,
320
+ onScrollbarYChange: b,
321
+ scrollbarYEnabled: A,
322
+ onScrollbarYEnabledChange: D,
323
+ onCornerWidthChange: C,
324
+ onCornerHeightChange: T,
325
+ children: /* @__PURE__ */ l(
326
+ te.div,
327
+ {
328
+ dir: B,
329
+ ...i,
330
+ ref: k,
331
+ style: {
332
+ position: "relative",
333
+ // Pass corner sizes as CSS vars to reduce re-renders of context consumers
334
+ "--radix-scroll-area-corner-width": E + "px",
335
+ "--radix-scroll-area-corner-height": x + "px",
336
+ ...e.style
337
+ }
338
+ }
339
+ )
340
+ }
341
+ );
342
+ }
343
+ );
344
+ jt.displayName = rt;
345
+ var Gt = "ScrollAreaViewport", Wt = p.forwardRef(
346
+ (e, t) => {
347
+ const { __scopeScrollArea: r, children: o, nonce: n, ...s } = e, i = K(Gt, r), d = p.useRef(null), c = oe(t, d, i.onViewportChange);
348
+ return /* @__PURE__ */ F(Ct, { children: [
349
+ /* @__PURE__ */ l(
350
+ "style",
351
+ {
352
+ dangerouslySetInnerHTML: {
353
+ __html: "[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"
354
+ },
355
+ nonce: n
356
+ }
357
+ ),
358
+ /* @__PURE__ */ l(
359
+ te.div,
360
+ {
361
+ "data-radix-scroll-area-viewport": "",
362
+ ...s,
363
+ ref: c,
364
+ style: {
365
+ /**
366
+ * We don't support `visible` because the intention is to have at least one scrollbar
367
+ * if this component is used and `visible` will behave like `auto` in that case
368
+ * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#description
369
+ *
370
+ * We don't handle `auto` because the intention is for the native implementation
371
+ * to be hidden if using this component. We just want to ensure the node is scrollable
372
+ * so could have used either `scroll` or `auto` here. We picked `scroll` to prevent
373
+ * the browser from having to work out whether to render native scrollbars or not,
374
+ * we tell it to with the intention of hiding them in CSS.
375
+ */
376
+ overflowX: i.scrollbarXEnabled ? "scroll" : "hidden",
377
+ overflowY: i.scrollbarYEnabled ? "scroll" : "hidden",
378
+ ...e.style
379
+ },
380
+ children: /* @__PURE__ */ l("div", { ref: i.onContentChange, style: { minWidth: "100%", display: "table" }, children: o })
381
+ }
382
+ )
383
+ ] });
384
+ }
385
+ );
386
+ Wt.displayName = Gt;
387
+ var re = "ScrollAreaScrollbar", ot = p.forwardRef(
388
+ (e, t) => {
389
+ const { forceMount: r, ...o } = e, n = K(re, e.__scopeScrollArea), { onScrollbarXEnabledChange: s, onScrollbarYEnabledChange: i } = n, d = e.orientation === "horizontal";
390
+ return p.useEffect(() => (d ? s(!0) : i(!0), () => {
391
+ d ? s(!1) : i(!1);
392
+ }), [d, s, i]), n.type === "hover" ? /* @__PURE__ */ l(No, { ...o, ref: t, forceMount: r }) : n.type === "scroll" ? /* @__PURE__ */ l(To, { ...o, ref: t, forceMount: r }) : n.type === "auto" ? /* @__PURE__ */ l(Yt, { ...o, ref: t, forceMount: r }) : n.type === "always" ? /* @__PURE__ */ l(nt, { ...o, ref: t }) : null;
393
+ }
394
+ );
395
+ ot.displayName = re;
396
+ var No = p.forwardRef((e, t) => {
397
+ const { forceMount: r, ...o } = e, n = K(re, e.__scopeScrollArea), [s, i] = p.useState(!1);
398
+ return p.useEffect(() => {
399
+ const d = n.scrollArea;
400
+ let c = 0;
401
+ if (d) {
402
+ const u = () => {
403
+ window.clearTimeout(c), i(!0);
404
+ }, f = () => {
405
+ c = window.setTimeout(() => i(!1), n.scrollHideDelay);
406
+ };
407
+ return d.addEventListener("pointerenter", u), d.addEventListener("pointerleave", f), () => {
408
+ window.clearTimeout(c), d.removeEventListener("pointerenter", u), d.removeEventListener("pointerleave", f);
409
+ };
410
+ }
411
+ }, [n.scrollArea, n.scrollHideDelay]), /* @__PURE__ */ l(ze, { present: r || s, children: /* @__PURE__ */ l(
412
+ Yt,
413
+ {
414
+ "data-state": s ? "visible" : "hidden",
415
+ ...o,
416
+ ref: t
417
+ }
418
+ ) });
419
+ }), To = p.forwardRef((e, t) => {
420
+ const { forceMount: r, ...o } = e, n = K(re, e.__scopeScrollArea), s = e.orientation === "horizontal", i = Fe(() => c("SCROLL_END"), 100), [d, c] = Co("hidden", {
421
+ hidden: {
422
+ SCROLL: "scrolling"
423
+ },
424
+ scrolling: {
425
+ SCROLL_END: "idle",
426
+ POINTER_ENTER: "interacting"
427
+ },
428
+ interacting: {
429
+ SCROLL: "interacting",
430
+ POINTER_LEAVE: "idle"
431
+ },
432
+ idle: {
433
+ HIDE: "hidden",
434
+ SCROLL: "scrolling",
435
+ POINTER_ENTER: "interacting"
436
+ }
437
+ });
438
+ return p.useEffect(() => {
439
+ if (d === "idle") {
440
+ const u = window.setTimeout(() => c("HIDE"), n.scrollHideDelay);
441
+ return () => window.clearTimeout(u);
442
+ }
443
+ }, [d, n.scrollHideDelay, c]), p.useEffect(() => {
444
+ const u = n.viewport, f = s ? "scrollLeft" : "scrollTop";
445
+ if (u) {
446
+ let h = u[f];
447
+ const g = () => {
448
+ const a = u[f];
449
+ h !== a && (c("SCROLL"), i()), h = a;
450
+ };
451
+ return u.addEventListener("scroll", g), () => u.removeEventListener("scroll", g);
452
+ }
453
+ }, [n.viewport, s, c, i]), /* @__PURE__ */ l(ze, { present: r || d !== "hidden", children: /* @__PURE__ */ l(
454
+ nt,
455
+ {
456
+ "data-state": d === "hidden" ? "hidden" : "visible",
457
+ ...o,
458
+ ref: t,
459
+ onPointerEnter: W(e.onPointerEnter, () => c("POINTER_ENTER")),
460
+ onPointerLeave: W(e.onPointerLeave, () => c("POINTER_LEAVE"))
461
+ }
462
+ ) });
463
+ }), Yt = p.forwardRef((e, t) => {
464
+ const r = K(re, e.__scopeScrollArea), { forceMount: o, ...n } = e, [s, i] = p.useState(!1), d = e.orientation === "horizontal", c = Fe(() => {
465
+ if (r.viewport) {
466
+ const u = r.viewport.offsetWidth < r.viewport.scrollWidth, f = r.viewport.offsetHeight < r.viewport.scrollHeight;
467
+ i(d ? u : f);
468
+ }
469
+ }, 10);
470
+ return be(r.viewport, c), be(r.content, c), /* @__PURE__ */ l(ze, { present: o || s, children: /* @__PURE__ */ l(
471
+ nt,
472
+ {
473
+ "data-state": s ? "visible" : "hidden",
474
+ ...n,
475
+ ref: t
476
+ }
477
+ ) });
478
+ }), nt = p.forwardRef((e, t) => {
479
+ const { orientation: r = "vertical", ...o } = e, n = K(re, e.__scopeScrollArea), s = p.useRef(null), i = p.useRef(0), [d, c] = p.useState({
480
+ content: 0,
481
+ viewport: 0,
482
+ scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
483
+ }), u = Zt(d.viewport, d.content), f = {
484
+ ...o,
485
+ sizes: d,
486
+ onSizesChange: c,
487
+ hasThumb: u > 0 && u < 1,
488
+ onThumbChange: (g) => s.current = g,
489
+ onThumbPointerUp: () => i.current = 0,
490
+ onThumbPointerDown: (g) => i.current = g
491
+ };
492
+ function h(g, a) {
493
+ return Do(g, i.current, d, a);
494
+ }
495
+ return r === "horizontal" ? /* @__PURE__ */ l(
496
+ Ro,
497
+ {
498
+ ...f,
499
+ ref: t,
500
+ onThumbPositionChange: () => {
501
+ if (n.viewport && s.current) {
502
+ const g = n.viewport.scrollLeft, a = bt(g, d, n.dir);
503
+ s.current.style.transform = `translate3d(${a}px, 0, 0)`;
504
+ }
505
+ },
506
+ onWheelScroll: (g) => {
507
+ n.viewport && (n.viewport.scrollLeft = g);
508
+ },
509
+ onDragScroll: (g) => {
510
+ n.viewport && (n.viewport.scrollLeft = h(g, n.dir));
511
+ }
512
+ }
513
+ ) : r === "vertical" ? /* @__PURE__ */ l(
514
+ Po,
515
+ {
516
+ ...f,
517
+ ref: t,
518
+ onThumbPositionChange: () => {
519
+ if (n.viewport && s.current) {
520
+ const g = n.viewport.scrollTop, a = bt(g, d);
521
+ s.current.style.transform = `translate3d(0, ${a}px, 0)`;
522
+ }
523
+ },
524
+ onWheelScroll: (g) => {
525
+ n.viewport && (n.viewport.scrollTop = g);
526
+ },
527
+ onDragScroll: (g) => {
528
+ n.viewport && (n.viewport.scrollTop = h(g));
529
+ }
530
+ }
531
+ ) : null;
532
+ }), Ro = p.forwardRef((e, t) => {
533
+ const { sizes: r, onSizesChange: o, ...n } = e, s = K(re, e.__scopeScrollArea), [i, d] = p.useState(), c = p.useRef(null), u = oe(t, c, s.onScrollbarXChange);
534
+ return p.useEffect(() => {
535
+ c.current && d(getComputedStyle(c.current));
536
+ }, [c]), /* @__PURE__ */ l(
537
+ Xt,
538
+ {
539
+ "data-orientation": "horizontal",
540
+ ...n,
541
+ ref: u,
542
+ sizes: r,
543
+ style: {
544
+ bottom: 0,
545
+ left: s.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
546
+ right: s.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
547
+ "--radix-scroll-area-thumb-width": Be(r) + "px",
548
+ ...e.style
549
+ },
550
+ onThumbPointerDown: (f) => e.onThumbPointerDown(f.x),
551
+ onDragScroll: (f) => e.onDragScroll(f.x),
552
+ onWheelScroll: (f, h) => {
553
+ if (s.viewport) {
554
+ const g = s.viewport.scrollLeft + f.deltaX;
555
+ e.onWheelScroll(g), Jt(g, h) && f.preventDefault();
556
+ }
557
+ },
558
+ onResize: () => {
559
+ c.current && s.viewport && i && o({
560
+ content: s.viewport.scrollWidth,
561
+ viewport: s.viewport.offsetWidth,
562
+ scrollbar: {
563
+ size: c.current.clientWidth,
564
+ paddingStart: Me(i.paddingLeft),
565
+ paddingEnd: Me(i.paddingRight)
566
+ }
567
+ });
568
+ }
569
+ }
570
+ );
571
+ }), Po = p.forwardRef((e, t) => {
572
+ const { sizes: r, onSizesChange: o, ...n } = e, s = K(re, e.__scopeScrollArea), [i, d] = p.useState(), c = p.useRef(null), u = oe(t, c, s.onScrollbarYChange);
573
+ return p.useEffect(() => {
574
+ c.current && d(getComputedStyle(c.current));
575
+ }, [c]), /* @__PURE__ */ l(
576
+ Xt,
577
+ {
578
+ "data-orientation": "vertical",
579
+ ...n,
580
+ ref: u,
581
+ sizes: r,
582
+ style: {
583
+ top: 0,
584
+ right: s.dir === "ltr" ? 0 : void 0,
585
+ left: s.dir === "rtl" ? 0 : void 0,
586
+ bottom: "var(--radix-scroll-area-corner-height)",
587
+ "--radix-scroll-area-thumb-height": Be(r) + "px",
588
+ ...e.style
589
+ },
590
+ onThumbPointerDown: (f) => e.onThumbPointerDown(f.y),
591
+ onDragScroll: (f) => e.onDragScroll(f.y),
592
+ onWheelScroll: (f, h) => {
593
+ if (s.viewport) {
594
+ const g = s.viewport.scrollTop + f.deltaY;
595
+ e.onWheelScroll(g), Jt(g, h) && f.preventDefault();
596
+ }
597
+ },
598
+ onResize: () => {
599
+ c.current && s.viewport && i && o({
600
+ content: s.viewport.scrollHeight,
601
+ viewport: s.viewport.offsetHeight,
602
+ scrollbar: {
603
+ size: c.current.clientHeight,
604
+ paddingStart: Me(i.paddingTop),
605
+ paddingEnd: Me(i.paddingBottom)
606
+ }
607
+ });
608
+ }
609
+ }
610
+ );
611
+ }), [ko, Ut] = $t(re), Xt = p.forwardRef((e, t) => {
612
+ const {
613
+ __scopeScrollArea: r,
614
+ sizes: o,
615
+ hasThumb: n,
616
+ onThumbChange: s,
617
+ onThumbPointerUp: i,
618
+ onThumbPointerDown: d,
619
+ onThumbPositionChange: c,
620
+ onDragScroll: u,
621
+ onWheelScroll: f,
622
+ onResize: h,
623
+ ...g
624
+ } = e, a = K(re, r), [N, v] = p.useState(null), b = oe(t, (k) => v(k)), E = p.useRef(null), C = p.useRef(""), x = a.viewport, T = o.content - o.viewport, O = ie(f), R = ie(c), A = Fe(h, 10);
625
+ function D(k) {
626
+ if (E.current) {
627
+ const B = k.clientX - E.current.left, H = k.clientY - E.current.top;
628
+ u({ x: B, y: H });
629
+ }
630
+ }
631
+ return p.useEffect(() => {
632
+ const k = (B) => {
633
+ const H = B.target;
634
+ (N == null ? void 0 : N.contains(H)) && O(B, T);
635
+ };
636
+ return document.addEventListener("wheel", k, { passive: !1 }), () => document.removeEventListener("wheel", k, { passive: !1 });
637
+ }, [x, N, T, O]), p.useEffect(R, [o, R]), be(N, A), be(a.content, A), /* @__PURE__ */ l(
638
+ ko,
639
+ {
640
+ scope: r,
641
+ scrollbar: N,
642
+ hasThumb: n,
643
+ onThumbChange: ie(s),
644
+ onThumbPointerUp: ie(i),
645
+ onThumbPositionChange: R,
646
+ onThumbPointerDown: ie(d),
647
+ children: /* @__PURE__ */ l(
648
+ te.div,
649
+ {
650
+ ...g,
651
+ ref: b,
652
+ style: { position: "absolute", ...g.style },
653
+ onPointerDown: W(e.onPointerDown, (k) => {
654
+ k.button === 0 && (k.target.setPointerCapture(k.pointerId), E.current = N.getBoundingClientRect(), C.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", a.viewport && (a.viewport.style.scrollBehavior = "auto"), D(k));
655
+ }),
656
+ onPointerMove: W(e.onPointerMove, D),
657
+ onPointerUp: W(e.onPointerUp, (k) => {
658
+ const B = k.target;
659
+ B.hasPointerCapture(k.pointerId) && B.releasePointerCapture(k.pointerId), document.body.style.webkitUserSelect = C.current, a.viewport && (a.viewport.style.scrollBehavior = ""), E.current = null;
660
+ })
661
+ }
662
+ )
663
+ }
664
+ );
665
+ }), De = "ScrollAreaThumb", Kt = p.forwardRef(
666
+ (e, t) => {
667
+ const { forceMount: r, ...o } = e, n = Ut(De, e.__scopeScrollArea);
668
+ return /* @__PURE__ */ l(ze, { present: r || n.hasThumb, children: /* @__PURE__ */ l(Io, { ref: t, ...o }) });
669
+ }
670
+ ), Io = p.forwardRef(
671
+ (e, t) => {
672
+ const { __scopeScrollArea: r, style: o, ...n } = e, s = K(De, r), i = Ut(De, r), { onThumbPositionChange: d } = i, c = oe(
673
+ t,
674
+ (h) => i.onThumbChange(h)
675
+ ), u = p.useRef(void 0), f = Fe(() => {
676
+ u.current && (u.current(), u.current = void 0);
677
+ }, 100);
678
+ return p.useEffect(() => {
679
+ const h = s.viewport;
680
+ if (h) {
681
+ const g = () => {
682
+ if (f(), !u.current) {
683
+ const a = Mo(h, d);
684
+ u.current = a, d();
685
+ }
686
+ };
687
+ return d(), h.addEventListener("scroll", g), () => h.removeEventListener("scroll", g);
688
+ }
689
+ }, [s.viewport, f, d]), /* @__PURE__ */ l(
690
+ te.div,
691
+ {
692
+ "data-state": i.hasThumb ? "visible" : "hidden",
693
+ ...n,
694
+ ref: c,
695
+ style: {
696
+ width: "var(--radix-scroll-area-thumb-width)",
697
+ height: "var(--radix-scroll-area-thumb-height)",
698
+ ...o
699
+ },
700
+ onPointerDownCapture: W(e.onPointerDownCapture, (h) => {
701
+ const a = h.target.getBoundingClientRect(), N = h.clientX - a.left, v = h.clientY - a.top;
702
+ i.onThumbPointerDown({ x: N, y: v });
703
+ }),
704
+ onPointerUp: W(e.onPointerUp, i.onThumbPointerUp)
705
+ }
706
+ );
707
+ }
708
+ );
709
+ Kt.displayName = De;
710
+ var at = "ScrollAreaCorner", qt = p.forwardRef(
711
+ (e, t) => {
712
+ const r = K(at, e.__scopeScrollArea), o = !!(r.scrollbarX && r.scrollbarY);
713
+ return r.type !== "scroll" && o ? /* @__PURE__ */ l(Ao, { ...e, ref: t }) : null;
714
+ }
715
+ );
716
+ qt.displayName = at;
717
+ var Ao = p.forwardRef((e, t) => {
718
+ const { __scopeScrollArea: r, ...o } = e, n = K(at, r), [s, i] = p.useState(0), [d, c] = p.useState(0), u = !!(s && d);
719
+ return be(n.scrollbarX, () => {
720
+ var h;
721
+ const f = ((h = n.scrollbarX) == null ? void 0 : h.offsetHeight) || 0;
722
+ n.onCornerHeightChange(f), c(f);
723
+ }), be(n.scrollbarY, () => {
724
+ var h;
725
+ const f = ((h = n.scrollbarY) == null ? void 0 : h.offsetWidth) || 0;
726
+ n.onCornerWidthChange(f), i(f);
727
+ }), u ? /* @__PURE__ */ l(
728
+ te.div,
729
+ {
730
+ ...o,
731
+ ref: t,
732
+ style: {
733
+ width: s,
734
+ height: d,
735
+ position: "absolute",
736
+ right: n.dir === "ltr" ? 0 : void 0,
737
+ left: n.dir === "rtl" ? 0 : void 0,
738
+ bottom: 0,
739
+ ...e.style
740
+ }
741
+ }
742
+ ) : null;
743
+ });
744
+ function Me(e) {
745
+ return e ? parseInt(e, 10) : 0;
746
+ }
747
+ function Zt(e, t) {
748
+ const r = e / t;
749
+ return isNaN(r) ? 0 : r;
750
+ }
751
+ function Be(e) {
752
+ const t = Zt(e.viewport, e.content), r = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, o = (e.scrollbar.size - r) * t;
753
+ return Math.max(o, 18);
754
+ }
755
+ function Do(e, t, r, o = "ltr") {
756
+ const n = Be(r), s = n / 2, i = t || s, d = n - i, c = r.scrollbar.paddingStart + i, u = r.scrollbar.size - r.scrollbar.paddingEnd - d, f = r.content - r.viewport, h = o === "ltr" ? [0, f] : [f * -1, 0];
757
+ return Qt([c, u], h)(e);
758
+ }
759
+ function bt(e, t, r = "ltr") {
760
+ const o = Be(t), n = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, s = t.scrollbar.size - n, i = t.content - t.viewport, d = s - o, c = r === "ltr" ? [0, i] : [i * -1, 0], u = So(e, c);
761
+ return Qt([0, i], [0, d])(u);
762
+ }
763
+ function Qt(e, t) {
764
+ return (r) => {
765
+ if (e[0] === e[1] || t[0] === t[1]) return t[0];
766
+ const o = (t[1] - t[0]) / (e[1] - e[0]);
767
+ return t[0] + o * (r - e[0]);
768
+ };
769
+ }
770
+ function Jt(e, t) {
771
+ return e > 0 && e < t;
772
+ }
773
+ var Mo = (e, t = () => {
774
+ }) => {
775
+ let r = { left: e.scrollLeft, top: e.scrollTop }, o = 0;
776
+ return function n() {
777
+ const s = { left: e.scrollLeft, top: e.scrollTop }, i = r.left !== s.left, d = r.top !== s.top;
778
+ (i || d) && t(), r = s, o = window.requestAnimationFrame(n);
779
+ }(), () => window.cancelAnimationFrame(o);
780
+ };
781
+ function Fe(e, t) {
782
+ const r = ie(e), o = p.useRef(0);
783
+ return p.useEffect(() => () => window.clearTimeout(o.current), []), p.useCallback(() => {
784
+ window.clearTimeout(o.current), o.current = window.setTimeout(r, t);
785
+ }, [r, t]);
786
+ }
787
+ function be(e, t) {
788
+ const r = ie(t);
789
+ jr(() => {
790
+ let o = 0;
791
+ if (e) {
792
+ const n = new ResizeObserver(() => {
793
+ cancelAnimationFrame(o), o = window.requestAnimationFrame(r);
794
+ });
795
+ return n.observe(e), () => {
796
+ window.cancelAnimationFrame(o), n.unobserve(e);
797
+ };
798
+ }
799
+ }, [e, r]);
800
+ }
801
+ var er = jt, _o = Wt, Lo = qt;
802
+ const st = p.forwardRef(({ className: e, children: t, ...r }, o) => /* @__PURE__ */ F(er, { ref: o, className: Ne("relative overflow-hidden", e), ...r, children: [
803
+ /* @__PURE__ */ l(_o, { className: "h-full w-full rounded-[inherit]", children: t }),
804
+ /* @__PURE__ */ l(tr, {}),
805
+ /* @__PURE__ */ l(Lo, {})
806
+ ] }));
807
+ st.displayName = er.displayName;
808
+ const tr = p.forwardRef(({ className: e, orientation: t = "vertical", ...r }, o) => /* @__PURE__ */ l(
809
+ ot,
810
+ {
811
+ ref: o,
812
+ orientation: t,
813
+ className: Ne(
814
+ "flex touch-none select-none transition-colors",
815
+ t === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
816
+ t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
817
+ e
818
+ ),
819
+ ...r,
820
+ children: /* @__PURE__ */ l(Kt, { className: "relative flex-1 rounded-full bg-border" })
821
+ }
822
+ ));
823
+ tr.displayName = ot.displayName;
824
+ const zo = () => {
825
+ const { selected: e, actions: t } = ye((r) => {
826
+ var s, i, d, c, u, f, h;
827
+ const o = r.events.selected ? Array.from(r.events.selected)[0] : null;
828
+ let n;
829
+ return o && (n = {
830
+ id: o,
831
+ name: ((i = (s = r.nodes[o]) == null ? void 0 : s.data) == null ? void 0 : i.displayName) || ((c = (d = r.nodes[o]) == null ? void 0 : d.data) == null ? void 0 : c.name),
832
+ settings: (f = (u = r.nodes[o]) == null ? void 0 : u.related) == null ? void 0 : f.settings,
833
+ isDeletable: ((h = r.nodes[o]) == null ? void 0 : h.id) !== "ROOT"
834
+ }), { selected: n };
835
+ });
836
+ return /* @__PURE__ */ l("div", { className: "h-full flex flex-col", children: e ? /* @__PURE__ */ F(Ct, { children: [
837
+ /* @__PURE__ */ F("div", { className: "flex items-center justify-between pb-3 border-b border-border mb-3", children: [
838
+ /* @__PURE__ */ F("div", { children: [
839
+ /* @__PURE__ */ l("span", { className: "text-xs text-muted-foreground", children: "Selected" }),
840
+ /* @__PURE__ */ l("h3", { className: "text-sm font-semibold", children: e.name })
841
+ ] }),
842
+ e.isDeletable && /* @__PURE__ */ l(
843
+ "button",
844
+ {
845
+ onClick: () => t.delete(e.id),
846
+ className: "p-1.5 rounded hover:bg-destructive/10 text-destructive transition-colors",
847
+ title: "Delete element",
848
+ children: /* @__PURE__ */ l(vo, { className: "h-4 w-4" })
849
+ }
850
+ )
851
+ ] }),
852
+ /* @__PURE__ */ l(st, { className: "flex-1 -mr-4 pr-4", children: e.settings && m.createElement(e.settings) })
853
+ ] }) : /* @__PURE__ */ l("div", { className: "text-center py-8", children: /* @__PURE__ */ l("p", { className: "text-sm text-muted-foreground", children: "Select an element to edit its properties" }) }) });
854
+ }, Oo = (e) => {
855
+ switch (e) {
856
+ case "Container":
857
+ return Ce;
858
+ case "Text":
859
+ return Vt;
860
+ case "Heading":
861
+ return zt;
862
+ case "Button":
863
+ return Ft;
864
+ case "Image":
865
+ return Ot;
866
+ case "Divider":
867
+ return Bt;
868
+ case "Spacer":
869
+ return Ht;
870
+ case "Video":
871
+ return yo;
872
+ case "Columns":
873
+ return mo;
874
+ case "Link":
875
+ return Tt;
876
+ default:
877
+ return Ce;
878
+ }
879
+ }, rr = ({ nodeId: e, depth: t = 0, onDragStart: r, onDragOver: o, onDrop: n, draggedId: s }) => {
880
+ const { node: i, actions: d, selectedNodeId: c, childNodes: u, parentId: f } = ye((S, de) => {
881
+ var ue, w;
882
+ const $ = S.nodes[e], ne = ((ue = $ == null ? void 0 : $.data) == null ? void 0 : ue.nodes) || [], V = S.events.selected ? Array.from(S.events.selected)[0] : null, q = (w = $ == null ? void 0 : $.data) == null ? void 0 : w.parent;
883
+ return {
884
+ node: $,
885
+ childNodes: ne,
886
+ selectedNodeId: V,
887
+ parentId: q
888
+ };
889
+ }), [h, g] = Ee(!0), [a, N] = Ee(!1);
890
+ if (!i) return null;
891
+ const v = i.data.displayName || i.data.name || "Unknown", b = u.length > 0, E = c === e, C = e === "ROOT", x = Oo(v), T = s === e, O = i.data.isCanvas, R = (S) => {
892
+ S.stopPropagation(), C || d.selectNode(e);
893
+ }, A = (S) => {
894
+ S.stopPropagation(), g(!h);
895
+ }, D = (S) => {
896
+ if (C) {
897
+ S.preventDefault();
898
+ return;
899
+ }
900
+ S.stopPropagation(), r(e, f);
901
+ }, k = (S) => {
902
+ S.preventDefault(), S.stopPropagation(), s && s !== e && O && N(!0);
903
+ }, B = (S) => {
904
+ S.stopPropagation(), N(!1);
905
+ }, H = (S) => {
906
+ S.preventDefault(), S.stopPropagation(), N(!1), s && s !== e && n(e);
907
+ };
908
+ return /* @__PURE__ */ F("div", { className: "select-none", children: [
909
+ /* @__PURE__ */ F(
910
+ "div",
911
+ {
912
+ className: `flex items-center gap-1 py-1 px-1 rounded cursor-pointer text-sm transition-colors ${E ? "bg-primary/10 text-primary" : "hover:bg-secondary/50"} ${T ? "opacity-50" : ""} ${a ? "bg-primary/20 ring-1 ring-primary" : ""}`,
913
+ style: { paddingLeft: `${t * 12 + 4}px` },
914
+ onClick: R,
915
+ draggable: !C,
916
+ onDragStart: D,
917
+ onDragOver: k,
918
+ onDragLeave: B,
919
+ onDrop: H,
920
+ children: [
921
+ !C && /* @__PURE__ */ l(po, { className: "h-3 w-3 text-muted-foreground/50 cursor-grab active:cursor-grabbing" }),
922
+ b ? /* @__PURE__ */ l("button", { onClick: A, className: "p-0.5 hover:bg-secondary rounded", children: h ? /* @__PURE__ */ l(Gr, { className: "h-3 w-3" }) : /* @__PURE__ */ l(Wr, { className: "h-3 w-3" }) }) : /* @__PURE__ */ l("span", { className: "w-4" }),
923
+ /* @__PURE__ */ l(x, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }),
924
+ /* @__PURE__ */ l("span", { className: `truncate ${C ? "font-medium" : ""}`, children: C ? "Root" : v })
925
+ ]
926
+ }
927
+ ),
928
+ b && h && /* @__PURE__ */ l("div", { children: u.map((S) => /* @__PURE__ */ l(
929
+ rr,
930
+ {
931
+ nodeId: S,
932
+ depth: t + 1,
933
+ onDragStart: r,
934
+ onDragOver: o,
935
+ onDrop: n,
936
+ draggedId: s
937
+ },
938
+ S
939
+ )) })
940
+ ] });
941
+ }, Bo = () => {
942
+ const [e, t] = Ee(null), [r, o] = Ee(null), { nodeIds: n, actions: s } = ye((u) => ({
943
+ nodeIds: Object.keys(u.nodes)
944
+ })), i = (u, f) => {
945
+ t(u), o(f);
946
+ }, d = (u) => {
947
+ if (e && u && e !== u)
948
+ try {
949
+ s.move(e, u, 0);
950
+ } catch (f) {
951
+ console.log("Cannot move node:", f);
952
+ }
953
+ t(null), o(null);
954
+ };
955
+ return /* @__PURE__ */ F("div", { className: "space-y-2", onDragEnd: () => {
956
+ t(null), o(null);
957
+ }, children: [
958
+ /* @__PURE__ */ l("h3", { className: "text-sm font-medium text-muted-foreground", children: "Layers" }),
959
+ /* @__PURE__ */ l("div", { className: "border border-border rounded-lg p-2 max-h-[250px] overflow-y-auto bg-background", children: n.includes("ROOT") && /* @__PURE__ */ l(
960
+ rr,
961
+ {
962
+ nodeId: "ROOT",
963
+ onDragStart: i,
964
+ onDrop: d,
965
+ draggedId: e
966
+ }
967
+ ) }),
968
+ /* @__PURE__ */ l("p", { className: "text-xs text-muted-foreground", children: "Drag to containers to reorder" })
969
+ ] });
970
+ };
971
+ // @__NO_SIDE_EFFECTS__
972
+ function yt(e) {
973
+ const t = /* @__PURE__ */ Fo(e), r = p.forwardRef((o, n) => {
974
+ const { children: s, ...i } = o, d = p.Children.toArray(s), c = d.find(Vo);
975
+ if (c) {
976
+ const u = c.props.children, f = d.map((h) => h === c ? p.Children.count(u) > 1 ? p.Children.only(null) : p.isValidElement(u) ? u.props.children : null : h);
977
+ return /* @__PURE__ */ l(t, { ...i, ref: n, children: p.isValidElement(u) ? p.cloneElement(u, void 0, f) : null });
978
+ }
979
+ return /* @__PURE__ */ l(t, { ...i, ref: n, children: s });
980
+ });
981
+ return r.displayName = `${e}.Slot`, r;
982
+ }
983
+ // @__NO_SIDE_EFFECTS__
984
+ function Fo(e) {
985
+ const t = p.forwardRef((r, o) => {
986
+ const { children: n, ...s } = r;
987
+ if (p.isValidElement(n)) {
988
+ const i = jo(n), d = $o(s, n.props);
989
+ return n.type !== p.Fragment && (d.ref = o ? Yr(o, i) : i), p.cloneElement(n, d);
990
+ }
991
+ return p.Children.count(n) > 1 ? p.Children.only(null) : null;
992
+ });
993
+ return t.displayName = `${e}.SlotClone`, t;
994
+ }
995
+ var Ho = Symbol("radix.slottable");
996
+ function Vo(e) {
997
+ return p.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Ho;
998
+ }
999
+ function $o(e, t) {
1000
+ const r = { ...t };
1001
+ for (const o in t) {
1002
+ const n = e[o], s = t[o];
1003
+ /^on[A-Z]/.test(o) ? n && s ? r[o] = (...d) => {
1004
+ const c = s(...d);
1005
+ return n(...d), c;
1006
+ } : n && (r[o] = n) : o === "style" ? r[o] = { ...n, ...s } : o === "className" && (r[o] = [n, s].filter(Boolean).join(" "));
1007
+ }
1008
+ return { ...e, ...r };
1009
+ }
1010
+ function jo(e) {
1011
+ var o, n;
1012
+ let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, r = t && "isReactWarning" in t && t.isReactWarning;
1013
+ return r ? e.ref : (t = (n = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : n.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
1014
+ }
1015
+ function Go(e) {
1016
+ const t = e + "CollectionProvider", [r, o] = Le(t), [n, s] = r(
1017
+ t,
1018
+ { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
1019
+ ), i = (v) => {
1020
+ const { scope: b, children: E } = v, C = m.useRef(null), x = m.useRef(/* @__PURE__ */ new Map()).current;
1021
+ return /* @__PURE__ */ l(n, { scope: b, itemMap: x, collectionRef: C, children: E });
1022
+ };
1023
+ i.displayName = t;
1024
+ const d = e + "CollectionSlot", c = /* @__PURE__ */ yt(d), u = m.forwardRef(
1025
+ (v, b) => {
1026
+ const { scope: E, children: C } = v, x = s(d, E), T = oe(b, x.collectionRef);
1027
+ return /* @__PURE__ */ l(c, { ref: T, children: C });
1028
+ }
1029
+ );
1030
+ u.displayName = d;
1031
+ const f = e + "CollectionItemSlot", h = "data-radix-collection-item", g = /* @__PURE__ */ yt(f), a = m.forwardRef(
1032
+ (v, b) => {
1033
+ const { scope: E, children: C, ...x } = v, T = m.useRef(null), O = oe(b, T), R = s(f, E);
1034
+ return m.useEffect(() => (R.itemMap.set(T, { ref: T, ...x }), () => void R.itemMap.delete(T))), /* @__PURE__ */ l(g, { [h]: "", ref: O, children: C });
1035
+ }
1036
+ );
1037
+ a.displayName = f;
1038
+ function N(v) {
1039
+ const b = s(e + "CollectionConsumer", v);
1040
+ return m.useCallback(() => {
1041
+ const C = b.collectionRef.current;
1042
+ if (!C) return [];
1043
+ const x = Array.from(C.querySelectorAll(`[${h}]`));
1044
+ return Array.from(b.itemMap.values()).sort(
1045
+ (R, A) => x.indexOf(R.ref.current) - x.indexOf(A.ref.current)
1046
+ );
1047
+ }, [b.collectionRef, b.itemMap]);
1048
+ }
1049
+ return [
1050
+ { Provider: i, Slot: u, ItemSlot: a },
1051
+ N,
1052
+ o
1053
+ ];
1054
+ }
1055
+ var Ke = "rovingFocusGroup.onEntryFocus", Wo = { bubbles: !1, cancelable: !0 }, Te = "RovingFocusGroup", [qe, or, Yo] = Go(Te), [Uo, nr] = Le(
1056
+ Te,
1057
+ [Yo]
1058
+ ), [Xo, Ko] = Uo(Te), ar = p.forwardRef(
1059
+ (e, t) => /* @__PURE__ */ l(qe.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ l(qe.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ l(qo, { ...e, ref: t }) }) })
1060
+ );
1061
+ ar.displayName = Te;
1062
+ var qo = p.forwardRef((e, t) => {
1063
+ const {
1064
+ __scopeRovingFocusGroup: r,
1065
+ orientation: o,
1066
+ loop: n = !1,
1067
+ dir: s,
1068
+ currentTabStopId: i,
1069
+ defaultCurrentTabStopId: d,
1070
+ onCurrentTabStopIdChange: c,
1071
+ onEntryFocus: u,
1072
+ preventScrollOnEntryFocus: f = !1,
1073
+ ...h
1074
+ } = e, g = p.useRef(null), a = oe(t, g), N = tt(s), [v, b] = Oe({
1075
+ prop: i,
1076
+ defaultProp: d ?? null,
1077
+ onChange: c,
1078
+ caller: Te
1079
+ }), [E, C] = p.useState(!1), x = ie(u), T = or(r), O = p.useRef(!1), [R, A] = p.useState(0);
1080
+ return p.useEffect(() => {
1081
+ const D = g.current;
1082
+ if (D)
1083
+ return D.addEventListener(Ke, x), () => D.removeEventListener(Ke, x);
1084
+ }, [x]), /* @__PURE__ */ l(
1085
+ Xo,
1086
+ {
1087
+ scope: r,
1088
+ orientation: o,
1089
+ dir: N,
1090
+ loop: n,
1091
+ currentTabStopId: v,
1092
+ onItemFocus: p.useCallback(
1093
+ (D) => b(D),
1094
+ [b]
1095
+ ),
1096
+ onItemShiftTab: p.useCallback(() => C(!0), []),
1097
+ onFocusableItemAdd: p.useCallback(
1098
+ () => A((D) => D + 1),
1099
+ []
1100
+ ),
1101
+ onFocusableItemRemove: p.useCallback(
1102
+ () => A((D) => D - 1),
1103
+ []
1104
+ ),
1105
+ children: /* @__PURE__ */ l(
1106
+ te.div,
1107
+ {
1108
+ tabIndex: E || R === 0 ? -1 : 0,
1109
+ "data-orientation": o,
1110
+ ...h,
1111
+ ref: a,
1112
+ style: { outline: "none", ...e.style },
1113
+ onMouseDown: W(e.onMouseDown, () => {
1114
+ O.current = !0;
1115
+ }),
1116
+ onFocus: W(e.onFocus, (D) => {
1117
+ const k = !O.current;
1118
+ if (D.target === D.currentTarget && k && !E) {
1119
+ const B = new CustomEvent(Ke, Wo);
1120
+ if (D.currentTarget.dispatchEvent(B), !B.defaultPrevented) {
1121
+ const H = T().filter((V) => V.focusable), S = H.find((V) => V.active), de = H.find((V) => V.id === v), ne = [S, de, ...H].filter(
1122
+ Boolean
1123
+ ).map((V) => V.ref.current);
1124
+ ir(ne, f);
1125
+ }
1126
+ }
1127
+ O.current = !1;
1128
+ }),
1129
+ onBlur: W(e.onBlur, () => C(!1))
1130
+ }
1131
+ )
1132
+ }
1133
+ );
1134
+ }), sr = "RovingFocusGroupItem", lr = p.forwardRef(
1135
+ (e, t) => {
1136
+ const {
1137
+ __scopeRovingFocusGroup: r,
1138
+ focusable: o = !0,
1139
+ active: n = !1,
1140
+ tabStopId: s,
1141
+ children: i,
1142
+ ...d
1143
+ } = e, c = Ur(), u = s || c, f = Ko(sr, r), h = f.currentTabStopId === u, g = or(r), { onFocusableItemAdd: a, onFocusableItemRemove: N, currentTabStopId: v } = f;
1144
+ return p.useEffect(() => {
1145
+ if (o)
1146
+ return a(), () => N();
1147
+ }, [o, a, N]), /* @__PURE__ */ l(
1148
+ qe.ItemSlot,
1149
+ {
1150
+ scope: r,
1151
+ id: u,
1152
+ focusable: o,
1153
+ active: n,
1154
+ children: /* @__PURE__ */ l(
1155
+ te.span,
1156
+ {
1157
+ tabIndex: h ? 0 : -1,
1158
+ "data-orientation": f.orientation,
1159
+ ...d,
1160
+ ref: t,
1161
+ onMouseDown: W(e.onMouseDown, (b) => {
1162
+ o ? f.onItemFocus(u) : b.preventDefault();
1163
+ }),
1164
+ onFocus: W(e.onFocus, () => f.onItemFocus(u)),
1165
+ onKeyDown: W(e.onKeyDown, (b) => {
1166
+ if (b.key === "Tab" && b.shiftKey) {
1167
+ f.onItemShiftTab();
1168
+ return;
1169
+ }
1170
+ if (b.target !== b.currentTarget) return;
1171
+ const E = Jo(b, f.orientation, f.dir);
1172
+ if (E !== void 0) {
1173
+ if (b.metaKey || b.ctrlKey || b.altKey || b.shiftKey) return;
1174
+ b.preventDefault();
1175
+ let x = g().filter((T) => T.focusable).map((T) => T.ref.current);
1176
+ if (E === "last") x.reverse();
1177
+ else if (E === "prev" || E === "next") {
1178
+ E === "prev" && x.reverse();
1179
+ const T = x.indexOf(b.currentTarget);
1180
+ x = f.loop ? en(x, T + 1) : x.slice(T + 1);
1181
+ }
1182
+ setTimeout(() => ir(x));
1183
+ }
1184
+ }),
1185
+ children: typeof i == "function" ? i({ isCurrentTabStop: h, hasTabStop: v != null }) : i
1186
+ }
1187
+ )
1188
+ }
1189
+ );
1190
+ }
1191
+ );
1192
+ lr.displayName = sr;
1193
+ var Zo = {
1194
+ ArrowLeft: "prev",
1195
+ ArrowUp: "prev",
1196
+ ArrowRight: "next",
1197
+ ArrowDown: "next",
1198
+ PageUp: "first",
1199
+ Home: "first",
1200
+ PageDown: "last",
1201
+ End: "last"
1202
+ };
1203
+ function Qo(e, t) {
1204
+ return t !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
1205
+ }
1206
+ function Jo(e, t, r) {
1207
+ const o = Qo(e.key, r);
1208
+ if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
1209
+ return Zo[o];
1210
+ }
1211
+ function ir(e, t = !1) {
1212
+ const r = document.activeElement;
1213
+ for (const o of e)
1214
+ if (o === r || (o.focus({ preventScroll: t }), document.activeElement !== r)) return;
1215
+ }
1216
+ function en(e, t) {
1217
+ return e.map((r, o) => e[(t + o) % e.length]);
1218
+ }
1219
+ var tn = ar, rn = lr, cr = "Toggle", lt = p.forwardRef((e, t) => {
1220
+ const { pressed: r, defaultPressed: o, onPressedChange: n, ...s } = e, [i, d] = Oe({
1221
+ prop: r,
1222
+ onChange: n,
1223
+ defaultProp: o ?? !1,
1224
+ caller: cr
1225
+ });
1226
+ return /* @__PURE__ */ l(
1227
+ te.button,
1228
+ {
1229
+ type: "button",
1230
+ "aria-pressed": i,
1231
+ "data-state": i ? "on" : "off",
1232
+ "data-disabled": e.disabled ? "" : void 0,
1233
+ ...s,
1234
+ ref: t,
1235
+ onClick: W(e.onClick, () => {
1236
+ e.disabled || d(!i);
1237
+ })
1238
+ }
1239
+ );
1240
+ });
1241
+ lt.displayName = cr;
1242
+ var dr = lt, ce = "ToggleGroup", [ur] = Le(ce, [
1243
+ nr
1244
+ ]), fr = nr(), it = m.forwardRef((e, t) => {
1245
+ const { type: r, ...o } = e;
1246
+ if (r === "single")
1247
+ return /* @__PURE__ */ l(on, { ...o, ref: t });
1248
+ if (r === "multiple")
1249
+ return /* @__PURE__ */ l(nn, { ...o, ref: t });
1250
+ throw new Error(`Missing prop \`type\` expected on \`${ce}\``);
1251
+ });
1252
+ it.displayName = ce;
1253
+ var [mr, pr] = ur(ce), on = m.forwardRef((e, t) => {
1254
+ const {
1255
+ value: r,
1256
+ defaultValue: o,
1257
+ onValueChange: n = () => {
1258
+ },
1259
+ ...s
1260
+ } = e, [i, d] = Oe({
1261
+ prop: r,
1262
+ defaultProp: o ?? "",
1263
+ onChange: n,
1264
+ caller: ce
1265
+ });
1266
+ return /* @__PURE__ */ l(
1267
+ mr,
1268
+ {
1269
+ scope: e.__scopeToggleGroup,
1270
+ type: "single",
1271
+ value: m.useMemo(() => i ? [i] : [], [i]),
1272
+ onItemActivate: d,
1273
+ onItemDeactivate: m.useCallback(() => d(""), [d]),
1274
+ children: /* @__PURE__ */ l(hr, { ...s, ref: t })
1275
+ }
1276
+ );
1277
+ }), nn = m.forwardRef((e, t) => {
1278
+ const {
1279
+ value: r,
1280
+ defaultValue: o,
1281
+ onValueChange: n = () => {
1282
+ },
1283
+ ...s
1284
+ } = e, [i, d] = Oe({
1285
+ prop: r,
1286
+ defaultProp: o ?? [],
1287
+ onChange: n,
1288
+ caller: ce
1289
+ }), c = m.useCallback(
1290
+ (f) => d((h = []) => [...h, f]),
1291
+ [d]
1292
+ ), u = m.useCallback(
1293
+ (f) => d((h = []) => h.filter((g) => g !== f)),
1294
+ [d]
1295
+ );
1296
+ return /* @__PURE__ */ l(
1297
+ mr,
1298
+ {
1299
+ scope: e.__scopeToggleGroup,
1300
+ type: "multiple",
1301
+ value: i,
1302
+ onItemActivate: c,
1303
+ onItemDeactivate: u,
1304
+ children: /* @__PURE__ */ l(hr, { ...s, ref: t })
1305
+ }
1306
+ );
1307
+ });
1308
+ it.displayName = ce;
1309
+ var [an, sn] = ur(ce), hr = m.forwardRef(
1310
+ (e, t) => {
1311
+ const {
1312
+ __scopeToggleGroup: r,
1313
+ disabled: o = !1,
1314
+ rovingFocus: n = !0,
1315
+ orientation: s,
1316
+ dir: i,
1317
+ loop: d = !0,
1318
+ ...c
1319
+ } = e, u = fr(r), f = tt(i), h = { role: "group", dir: f, ...c };
1320
+ return /* @__PURE__ */ l(an, { scope: r, rovingFocus: n, disabled: o, children: n ? /* @__PURE__ */ l(
1321
+ tn,
1322
+ {
1323
+ asChild: !0,
1324
+ ...u,
1325
+ orientation: s,
1326
+ dir: f,
1327
+ loop: d,
1328
+ children: /* @__PURE__ */ l(te.div, { ...h, ref: t })
1329
+ }
1330
+ ) : /* @__PURE__ */ l(te.div, { ...h, ref: t }) });
1331
+ }
1332
+ ), _e = "ToggleGroupItem", gr = m.forwardRef(
1333
+ (e, t) => {
1334
+ const r = pr(_e, e.__scopeToggleGroup), o = sn(_e, e.__scopeToggleGroup), n = fr(e.__scopeToggleGroup), s = r.value.includes(e.value), i = o.disabled || e.disabled, d = { ...e, pressed: s, disabled: i }, c = m.useRef(null);
1335
+ return o.rovingFocus ? /* @__PURE__ */ l(
1336
+ rn,
1337
+ {
1338
+ asChild: !0,
1339
+ ...n,
1340
+ focusable: !i,
1341
+ active: s,
1342
+ ref: c,
1343
+ children: /* @__PURE__ */ l(wt, { ...d, ref: t })
1344
+ }
1345
+ ) : /* @__PURE__ */ l(wt, { ...d, ref: t });
1346
+ }
1347
+ );
1348
+ gr.displayName = _e;
1349
+ var wt = m.forwardRef(
1350
+ (e, t) => {
1351
+ const { __scopeToggleGroup: r, value: o, ...n } = e, s = pr(_e, r), i = { role: "radio", "aria-checked": e.pressed, "aria-pressed": void 0 }, d = s.type === "single" ? i : void 0;
1352
+ return /* @__PURE__ */ l(
1353
+ lt,
1354
+ {
1355
+ ...d,
1356
+ ...n,
1357
+ ref: t,
1358
+ onPressedChange: (c) => {
1359
+ c ? s.onItemActivate(o) : s.onItemDeactivate(o);
1360
+ }
1361
+ }
1362
+ );
1363
+ }
1364
+ ), vr = it, br = gr;
1365
+ const yr = Xr(
1366
+ "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
1367
+ {
1368
+ variants: {
1369
+ variant: {
1370
+ default: "bg-transparent",
1371
+ outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
1372
+ },
1373
+ size: {
1374
+ default: "h-10 px-3",
1375
+ sm: "h-9 px-2.5",
1376
+ lg: "h-11 px-5"
1377
+ }
1378
+ },
1379
+ defaultVariants: {
1380
+ variant: "default",
1381
+ size: "default"
1382
+ }
1383
+ }
1384
+ ), ln = p.forwardRef(({ className: e, variant: t, size: r, ...o }, n) => /* @__PURE__ */ l(dr, { ref: n, className: Ne(yr({ variant: t, size: r, className: e })), ...o }));
1385
+ ln.displayName = dr.displayName;
1386
+ const wr = p.createContext({
1387
+ size: "default",
1388
+ variant: "default"
1389
+ }), xr = p.forwardRef(({ className: e, variant: t, size: r, children: o, ...n }, s) => /* @__PURE__ */ l(vr, { ref: s, className: Ne("flex items-center justify-center gap-1", e), ...n, children: /* @__PURE__ */ l(wr.Provider, { value: { variant: t, size: r }, children: o }) }));
1390
+ xr.displayName = vr.displayName;
1391
+ const Sr = p.forwardRef(({ className: e, children: t, variant: r, size: o, ...n }, s) => {
1392
+ const i = p.useContext(wr);
1393
+ return /* @__PURE__ */ l(
1394
+ br,
1395
+ {
1396
+ ref: s,
1397
+ className: Ne(
1398
+ yr({
1399
+ variant: i.variant || r,
1400
+ size: i.size || o
1401
+ }),
1402
+ e
1403
+ ),
1404
+ ...n,
1405
+ children: t
1406
+ }
1407
+ );
1408
+ });
1409
+ Sr.displayName = br.displayName;
1410
+ var cn = (e) => {
1411
+ switch (e) {
1412
+ case "success":
1413
+ return fn;
1414
+ case "info":
1415
+ return pn;
1416
+ case "warning":
1417
+ return mn;
1418
+ case "error":
1419
+ return hn;
1420
+ default:
1421
+ return null;
1422
+ }
1423
+ }, dn = Array(12).fill(0), un = ({ visible: e, className: t }) => m.createElement("div", { className: ["sonner-loading-wrapper", t].filter(Boolean).join(" "), "data-visible": e }, m.createElement("div", { className: "sonner-spinner" }, dn.map((r, o) => m.createElement("div", { className: "sonner-loading-bar", key: `spinner-bar-${o}` })))), fn = m.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", height: "20", width: "20" }, m.createElement("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z", clipRule: "evenodd" })), mn = m.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", height: "20", width: "20" }, m.createElement("path", { fillRule: "evenodd", d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z", clipRule: "evenodd" })), pn = m.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", height: "20", width: "20" }, m.createElement("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z", clipRule: "evenodd" })), hn = m.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", height: "20", width: "20" }, m.createElement("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z", clipRule: "evenodd" })), gn = m.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }, m.createElement("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), m.createElement("line", { x1: "6", y1: "6", x2: "18", y2: "18" })), vn = () => {
1424
+ let [e, t] = m.useState(document.hidden);
1425
+ return m.useEffect(() => {
1426
+ let r = () => {
1427
+ t(document.hidden);
1428
+ };
1429
+ return document.addEventListener("visibilitychange", r), () => window.removeEventListener("visibilitychange", r);
1430
+ }, []), e;
1431
+ }, Ze = 1, bn = class {
1432
+ constructor() {
1433
+ this.subscribe = (e) => (this.subscribers.push(e), () => {
1434
+ let t = this.subscribers.indexOf(e);
1435
+ this.subscribers.splice(t, 1);
1436
+ }), this.publish = (e) => {
1437
+ this.subscribers.forEach((t) => t(e));
1438
+ }, this.addToast = (e) => {
1439
+ this.publish(e), this.toasts = [...this.toasts, e];
1440
+ }, this.create = (e) => {
1441
+ var t;
1442
+ let { message: r, ...o } = e, n = typeof (e == null ? void 0 : e.id) == "number" || ((t = e.id) == null ? void 0 : t.length) > 0 ? e.id : Ze++, s = this.toasts.find((d) => d.id === n), i = e.dismissible === void 0 ? !0 : e.dismissible;
1443
+ return this.dismissedToasts.has(n) && this.dismissedToasts.delete(n), s ? this.toasts = this.toasts.map((d) => d.id === n ? (this.publish({ ...d, ...e, id: n, title: r }), { ...d, ...e, id: n, dismissible: i, title: r }) : d) : this.addToast({ title: r, ...o, dismissible: i, id: n }), n;
1444
+ }, this.dismiss = (e) => (this.dismissedToasts.add(e), e || this.toasts.forEach((t) => {
1445
+ this.subscribers.forEach((r) => r({ id: t.id, dismiss: !0 }));
1446
+ }), this.subscribers.forEach((t) => t({ id: e, dismiss: !0 })), e), this.message = (e, t) => this.create({ ...t, message: e }), this.error = (e, t) => this.create({ ...t, message: e, type: "error" }), this.success = (e, t) => this.create({ ...t, type: "success", message: e }), this.info = (e, t) => this.create({ ...t, type: "info", message: e }), this.warning = (e, t) => this.create({ ...t, type: "warning", message: e }), this.loading = (e, t) => this.create({ ...t, type: "loading", message: e }), this.promise = (e, t) => {
1447
+ if (!t) return;
1448
+ let r;
1449
+ t.loading !== void 0 && (r = this.create({ ...t, promise: e, type: "loading", message: t.loading, description: typeof t.description != "function" ? t.description : void 0 }));
1450
+ let o = e instanceof Promise ? e : e(), n = r !== void 0, s, i = o.then(async (c) => {
1451
+ if (s = ["resolve", c], m.isValidElement(c)) n = !1, this.create({ id: r, type: "default", message: c });
1452
+ else if (wn(c) && !c.ok) {
1453
+ n = !1;
1454
+ let u = typeof t.error == "function" ? await t.error(`HTTP error! status: ${c.status}`) : t.error, f = typeof t.description == "function" ? await t.description(`HTTP error! status: ${c.status}`) : t.description;
1455
+ this.create({ id: r, type: "error", message: u, description: f });
1456
+ } else if (t.success !== void 0) {
1457
+ n = !1;
1458
+ let u = typeof t.success == "function" ? await t.success(c) : t.success, f = typeof t.description == "function" ? await t.description(c) : t.description;
1459
+ this.create({ id: r, type: "success", message: u, description: f });
1460
+ }
1461
+ }).catch(async (c) => {
1462
+ if (s = ["reject", c], t.error !== void 0) {
1463
+ n = !1;
1464
+ let u = typeof t.error == "function" ? await t.error(c) : t.error, f = typeof t.description == "function" ? await t.description(c) : t.description;
1465
+ this.create({ id: r, type: "error", message: u, description: f });
1466
+ }
1467
+ }).finally(() => {
1468
+ var c;
1469
+ n && (this.dismiss(r), r = void 0), (c = t.finally) == null || c.call(t);
1470
+ }), d = () => new Promise((c, u) => i.then(() => s[0] === "reject" ? u(s[1]) : c(s[1])).catch(u));
1471
+ return typeof r != "string" && typeof r != "number" ? { unwrap: d } : Object.assign(r, { unwrap: d });
1472
+ }, this.custom = (e, t) => {
1473
+ let r = (t == null ? void 0 : t.id) || Ze++;
1474
+ return this.create({ jsx: e(r), id: r, ...t }), r;
1475
+ }, this.getActiveToasts = () => this.toasts.filter((e) => !this.dismissedToasts.has(e.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set();
1476
+ }
1477
+ }, G = new bn(), yn = (e, t) => {
1478
+ let r = (t == null ? void 0 : t.id) || Ze++;
1479
+ return G.addToast({ title: e, ...t, id: r }), r;
1480
+ }, wn = (e) => e && typeof e == "object" && "ok" in e && typeof e.ok == "boolean" && "status" in e && typeof e.status == "number", xn = yn, Sn = () => G.toasts, Cn = () => G.getActiveToasts(), En = Object.assign(xn, { success: G.success, info: G.info, warning: G.warning, error: G.error, custom: G.custom, message: G.message, promise: G.promise, dismiss: G.dismiss, loading: G.loading }, { getHistory: Sn, getToasts: Cn });
1481
+ function Nn(e, { insertAt: t } = {}) {
1482
+ if (typeof document > "u") return;
1483
+ let r = document.head || document.getElementsByTagName("head")[0], o = document.createElement("style");
1484
+ o.type = "text/css", t === "top" && r.firstChild ? r.insertBefore(o, r.firstChild) : r.appendChild(o), o.styleSheet ? o.styleSheet.cssText = e : o.appendChild(document.createTextNode(e));
1485
+ }
1486
+ Nn(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
1487
+ `);
1488
+ function ke(e) {
1489
+ return e.label !== void 0;
1490
+ }
1491
+ var Tn = 3, Rn = "32px", Pn = "16px", xt = 4e3, kn = 356, In = 14, An = 20, Dn = 200;
1492
+ function ee(...e) {
1493
+ return e.filter(Boolean).join(" ");
1494
+ }
1495
+ function Mn(e) {
1496
+ let [t, r] = e.split("-"), o = [];
1497
+ return t && o.push(t), r && o.push(r), o;
1498
+ }
1499
+ var _n = (e) => {
1500
+ var t, r, o, n, s, i, d, c, u, f, h;
1501
+ let { invert: g, toast: a, unstyled: N, interacting: v, setHeights: b, visibleToasts: E, heights: C, index: x, toasts: T, expanded: O, removeToast: R, defaultRichColors: A, closeButton: D, style: k, cancelButtonStyle: B, actionButtonStyle: H, className: S = "", descriptionClassName: de = "", duration: $, position: ne, gap: V, loadingIcon: q, expandByDefault: ue, classNames: w, icons: U, closeButtonAriaLabel: He = "Close toast", pauseWhenPageIsHidden: I } = e, [M, L] = m.useState(null), [j, pe] = m.useState(null), [z, Ve] = m.useState(!1), [we, Re] = m.useState(!1), [xe, $e] = m.useState(!1), [dt, Nr] = m.useState(!1), [Tr, ut] = m.useState(!1), [Rr, je] = m.useState(0), [Pr, ft] = m.useState(0), Se = m.useRef(a.duration || $ || xt), mt = m.useRef(null), fe = m.useRef(null), kr = x === 0, Ir = x + 1 <= E, X = a.type, he = a.dismissible !== !1, Ar = a.className || "", Dr = a.descriptionClassName || "", Pe = m.useMemo(() => C.findIndex((y) => y.toastId === a.id) || 0, [C, a.id]), Mr = m.useMemo(() => {
1502
+ var y;
1503
+ return (y = a.closeButton) != null ? y : D;
1504
+ }, [a.closeButton, D]), pt = m.useMemo(() => a.duration || $ || xt, [a.duration, $]), Ge = m.useRef(0), ge = m.useRef(0), ht = m.useRef(0), ve = m.useRef(null), [_r, Lr] = ne.split("-"), gt = m.useMemo(() => C.reduce((y, P, _) => _ >= Pe ? y : y + P.height, 0), [C, Pe]), vt = vn(), zr = a.invert || g, We = X === "loading";
1505
+ ge.current = m.useMemo(() => Pe * V + gt, [Pe, gt]), m.useEffect(() => {
1506
+ Se.current = pt;
1507
+ }, [pt]), m.useEffect(() => {
1508
+ Ve(!0);
1509
+ }, []), m.useEffect(() => {
1510
+ let y = fe.current;
1511
+ if (y) {
1512
+ let P = y.getBoundingClientRect().height;
1513
+ return ft(P), b((_) => [{ toastId: a.id, height: P, position: a.position }, ..._]), () => b((_) => _.filter((Z) => Z.toastId !== a.id));
1514
+ }
1515
+ }, [b, a.id]), m.useLayoutEffect(() => {
1516
+ if (!z) return;
1517
+ let y = fe.current, P = y.style.height;
1518
+ y.style.height = "auto";
1519
+ let _ = y.getBoundingClientRect().height;
1520
+ y.style.height = P, ft(_), b((Z) => Z.find((Q) => Q.toastId === a.id) ? Z.map((Q) => Q.toastId === a.id ? { ...Q, height: _ } : Q) : [{ toastId: a.id, height: _, position: a.position }, ...Z]);
1521
+ }, [z, a.title, a.description, b, a.id]);
1522
+ let ae = m.useCallback(() => {
1523
+ Re(!0), je(ge.current), b((y) => y.filter((P) => P.toastId !== a.id)), setTimeout(() => {
1524
+ R(a);
1525
+ }, Dn);
1526
+ }, [a, R, b, ge]);
1527
+ m.useEffect(() => {
1528
+ if (a.promise && X === "loading" || a.duration === 1 / 0 || a.type === "loading") return;
1529
+ let y;
1530
+ return O || v || I && vt ? (() => {
1531
+ if (ht.current < Ge.current) {
1532
+ let P = (/* @__PURE__ */ new Date()).getTime() - Ge.current;
1533
+ Se.current = Se.current - P;
1534
+ }
1535
+ ht.current = (/* @__PURE__ */ new Date()).getTime();
1536
+ })() : Se.current !== 1 / 0 && (Ge.current = (/* @__PURE__ */ new Date()).getTime(), y = setTimeout(() => {
1537
+ var P;
1538
+ (P = a.onAutoClose) == null || P.call(a, a), ae();
1539
+ }, Se.current)), () => clearTimeout(y);
1540
+ }, [O, v, a, X, I, vt, ae]), m.useEffect(() => {
1541
+ a.delete && ae();
1542
+ }, [ae, a.delete]);
1543
+ function Or() {
1544
+ var y, P, _;
1545
+ return U != null && U.loading ? m.createElement("div", { className: ee(w == null ? void 0 : w.loader, (y = a == null ? void 0 : a.classNames) == null ? void 0 : y.loader, "sonner-loader"), "data-visible": X === "loading" }, U.loading) : q ? m.createElement("div", { className: ee(w == null ? void 0 : w.loader, (P = a == null ? void 0 : a.classNames) == null ? void 0 : P.loader, "sonner-loader"), "data-visible": X === "loading" }, q) : m.createElement(un, { className: ee(w == null ? void 0 : w.loader, (_ = a == null ? void 0 : a.classNames) == null ? void 0 : _.loader), visible: X === "loading" });
1546
+ }
1547
+ return m.createElement("li", { tabIndex: 0, ref: fe, className: ee(S, Ar, w == null ? void 0 : w.toast, (t = a == null ? void 0 : a.classNames) == null ? void 0 : t.toast, w == null ? void 0 : w.default, w == null ? void 0 : w[X], (r = a == null ? void 0 : a.classNames) == null ? void 0 : r[X]), "data-sonner-toast": "", "data-rich-colors": (o = a.richColors) != null ? o : A, "data-styled": !(a.jsx || a.unstyled || N), "data-mounted": z, "data-promise": !!a.promise, "data-swiped": Tr, "data-removed": we, "data-visible": Ir, "data-y-position": _r, "data-x-position": Lr, "data-index": x, "data-front": kr, "data-swiping": xe, "data-dismissible": he, "data-type": X, "data-invert": zr, "data-swipe-out": dt, "data-swipe-direction": j, "data-expanded": !!(O || ue && z), style: { "--index": x, "--toasts-before": x, "--z-index": T.length - x, "--offset": `${we ? Rr : ge.current}px`, "--initial-height": ue ? "auto" : `${Pr}px`, ...k, ...a.style }, onDragEnd: () => {
1548
+ $e(!1), L(null), ve.current = null;
1549
+ }, onPointerDown: (y) => {
1550
+ We || !he || (mt.current = /* @__PURE__ */ new Date(), je(ge.current), y.target.setPointerCapture(y.pointerId), y.target.tagName !== "BUTTON" && ($e(!0), ve.current = { x: y.clientX, y: y.clientY }));
1551
+ }, onPointerUp: () => {
1552
+ var y, P, _, Z;
1553
+ if (dt || !he) return;
1554
+ ve.current = null;
1555
+ let Q = Number(((y = fe.current) == null ? void 0 : y.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), se = Number(((P = fe.current) == null ? void 0 : P.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), me = (/* @__PURE__ */ new Date()).getTime() - ((_ = mt.current) == null ? void 0 : _.getTime()), J = M === "x" ? Q : se, le = Math.abs(J) / me;
1556
+ if (Math.abs(J) >= An || le > 0.11) {
1557
+ je(ge.current), (Z = a.onDismiss) == null || Z.call(a, a), pe(M === "x" ? Q > 0 ? "right" : "left" : se > 0 ? "down" : "up"), ae(), Nr(!0), ut(!1);
1558
+ return;
1559
+ }
1560
+ $e(!1), L(null);
1561
+ }, onPointerMove: (y) => {
1562
+ var P, _, Z, Q;
1563
+ if (!ve.current || !he || ((P = window.getSelection()) == null ? void 0 : P.toString().length) > 0) return;
1564
+ let se = y.clientY - ve.current.y, me = y.clientX - ve.current.x, J = (_ = e.swipeDirections) != null ? _ : Mn(ne);
1565
+ !M && (Math.abs(me) > 1 || Math.abs(se) > 1) && L(Math.abs(me) > Math.abs(se) ? "x" : "y");
1566
+ let le = { x: 0, y: 0 };
1567
+ M === "y" ? (J.includes("top") || J.includes("bottom")) && (J.includes("top") && se < 0 || J.includes("bottom") && se > 0) && (le.y = se) : M === "x" && (J.includes("left") || J.includes("right")) && (J.includes("left") && me < 0 || J.includes("right") && me > 0) && (le.x = me), (Math.abs(le.x) > 0 || Math.abs(le.y) > 0) && ut(!0), (Z = fe.current) == null || Z.style.setProperty("--swipe-amount-x", `${le.x}px`), (Q = fe.current) == null || Q.style.setProperty("--swipe-amount-y", `${le.y}px`);
1568
+ } }, Mr && !a.jsx ? m.createElement("button", { "aria-label": He, "data-disabled": We, "data-close-button": !0, onClick: We || !he ? () => {
1569
+ } : () => {
1570
+ var y;
1571
+ ae(), (y = a.onDismiss) == null || y.call(a, a);
1572
+ }, className: ee(w == null ? void 0 : w.closeButton, (n = a == null ? void 0 : a.classNames) == null ? void 0 : n.closeButton) }, (s = U == null ? void 0 : U.close) != null ? s : gn) : null, a.jsx || Ye(a.title) ? a.jsx ? a.jsx : typeof a.title == "function" ? a.title() : a.title : m.createElement(m.Fragment, null, X || a.icon || a.promise ? m.createElement("div", { "data-icon": "", className: ee(w == null ? void 0 : w.icon, (i = a == null ? void 0 : a.classNames) == null ? void 0 : i.icon) }, a.promise || a.type === "loading" && !a.icon ? a.icon || Or() : null, a.type !== "loading" ? a.icon || (U == null ? void 0 : U[X]) || cn(X) : null) : null, m.createElement("div", { "data-content": "", className: ee(w == null ? void 0 : w.content, (d = a == null ? void 0 : a.classNames) == null ? void 0 : d.content) }, m.createElement("div", { "data-title": "", className: ee(w == null ? void 0 : w.title, (c = a == null ? void 0 : a.classNames) == null ? void 0 : c.title) }, typeof a.title == "function" ? a.title() : a.title), a.description ? m.createElement("div", { "data-description": "", className: ee(de, Dr, w == null ? void 0 : w.description, (u = a == null ? void 0 : a.classNames) == null ? void 0 : u.description) }, typeof a.description == "function" ? a.description() : a.description) : null), Ye(a.cancel) ? a.cancel : a.cancel && ke(a.cancel) ? m.createElement("button", { "data-button": !0, "data-cancel": !0, style: a.cancelButtonStyle || B, onClick: (y) => {
1573
+ var P, _;
1574
+ ke(a.cancel) && he && ((_ = (P = a.cancel).onClick) == null || _.call(P, y), ae());
1575
+ }, className: ee(w == null ? void 0 : w.cancelButton, (f = a == null ? void 0 : a.classNames) == null ? void 0 : f.cancelButton) }, a.cancel.label) : null, Ye(a.action) ? a.action : a.action && ke(a.action) ? m.createElement("button", { "data-button": !0, "data-action": !0, style: a.actionButtonStyle || H, onClick: (y) => {
1576
+ var P, _;
1577
+ ke(a.action) && ((_ = (P = a.action).onClick) == null || _.call(P, y), !y.defaultPrevented && ae());
1578
+ }, className: ee(w == null ? void 0 : w.actionButton, (h = a == null ? void 0 : a.classNames) == null ? void 0 : h.actionButton) }, a.action.label) : null));
1579
+ };
1580
+ function St() {
1581
+ if (typeof window > "u" || typeof document > "u") return "ltr";
1582
+ let e = document.documentElement.getAttribute("dir");
1583
+ return e === "auto" || !e ? window.getComputedStyle(document.documentElement).direction : e;
1584
+ }
1585
+ function Ln(e, t) {
1586
+ let r = {};
1587
+ return [e, t].forEach((o, n) => {
1588
+ let s = n === 1, i = s ? "--mobile-offset" : "--offset", d = s ? Pn : Rn;
1589
+ function c(u) {
1590
+ ["top", "right", "bottom", "left"].forEach((f) => {
1591
+ r[`${i}-${f}`] = typeof u == "number" ? `${u}px` : u;
1592
+ });
1593
+ }
1594
+ typeof o == "number" || typeof o == "string" ? c(o) : typeof o == "object" ? ["top", "right", "bottom", "left"].forEach((u) => {
1595
+ o[u] === void 0 ? r[`${i}-${u}`] = d : r[`${i}-${u}`] = typeof o[u] == "number" ? `${o[u]}px` : o[u];
1596
+ }) : c(d);
1597
+ }), r;
1598
+ }
1599
+ Br(function(e, t) {
1600
+ let { invert: r, position: o = "bottom-right", hotkey: n = ["altKey", "KeyT"], expand: s, closeButton: i, className: d, offset: c, mobileOffset: u, theme: f = "light", richColors: h, duration: g, style: a, visibleToasts: N = Tn, toastOptions: v, dir: b = St(), gap: E = In, loadingIcon: C, icons: x, containerAriaLabel: T = "Notifications", pauseWhenPageIsHidden: O } = e, [R, A] = m.useState([]), D = m.useMemo(() => Array.from(new Set([o].concat(R.filter((I) => I.position).map((I) => I.position)))), [R, o]), [k, B] = m.useState([]), [H, S] = m.useState(!1), [de, $] = m.useState(!1), [ne, V] = m.useState(f !== "system" ? f : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), q = m.useRef(null), ue = n.join("+").replace(/Key/g, "").replace(/Digit/g, ""), w = m.useRef(null), U = m.useRef(!1), He = m.useCallback((I) => {
1601
+ A((M) => {
1602
+ var L;
1603
+ return (L = M.find((j) => j.id === I.id)) != null && L.delete || G.dismiss(I.id), M.filter(({ id: j }) => j !== I.id);
1604
+ });
1605
+ }, []);
1606
+ return m.useEffect(() => G.subscribe((I) => {
1607
+ if (I.dismiss) {
1608
+ A((M) => M.map((L) => L.id === I.id ? { ...L, delete: !0 } : L));
1609
+ return;
1610
+ }
1611
+ setTimeout(() => {
1612
+ fo.flushSync(() => {
1613
+ A((M) => {
1614
+ let L = M.findIndex((j) => j.id === I.id);
1615
+ return L !== -1 ? [...M.slice(0, L), { ...M[L], ...I }, ...M.slice(L + 1)] : [I, ...M];
1616
+ });
1617
+ });
1618
+ });
1619
+ }), []), m.useEffect(() => {
1620
+ if (f !== "system") {
1621
+ V(f);
1622
+ return;
1623
+ }
1624
+ if (f === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? V("dark") : V("light")), typeof window > "u") return;
1625
+ let I = window.matchMedia("(prefers-color-scheme: dark)");
1626
+ try {
1627
+ I.addEventListener("change", ({ matches: M }) => {
1628
+ V(M ? "dark" : "light");
1629
+ });
1630
+ } catch {
1631
+ I.addListener(({ matches: L }) => {
1632
+ try {
1633
+ V(L ? "dark" : "light");
1634
+ } catch (j) {
1635
+ console.error(j);
1636
+ }
1637
+ });
1638
+ }
1639
+ }, [f]), m.useEffect(() => {
1640
+ R.length <= 1 && S(!1);
1641
+ }, [R]), m.useEffect(() => {
1642
+ let I = (M) => {
1643
+ var L, j;
1644
+ n.every((pe) => M[pe] || M.code === pe) && (S(!0), (L = q.current) == null || L.focus()), M.code === "Escape" && (document.activeElement === q.current || (j = q.current) != null && j.contains(document.activeElement)) && S(!1);
1645
+ };
1646
+ return document.addEventListener("keydown", I), () => document.removeEventListener("keydown", I);
1647
+ }, [n]), m.useEffect(() => {
1648
+ if (q.current) return () => {
1649
+ w.current && (w.current.focus({ preventScroll: !0 }), w.current = null, U.current = !1);
1650
+ };
1651
+ }, [q.current]), m.createElement("section", { ref: t, "aria-label": `${T} ${ue}`, tabIndex: -1, "aria-live": "polite", "aria-relevant": "additions text", "aria-atomic": "false", suppressHydrationWarning: !0 }, D.map((I, M) => {
1652
+ var L;
1653
+ let [j, pe] = I.split("-");
1654
+ return R.length ? m.createElement("ol", { key: I, dir: b === "auto" ? St() : b, tabIndex: -1, ref: q, className: d, "data-sonner-toaster": !0, "data-theme": ne, "data-y-position": j, "data-lifted": H && R.length > 1 && !s, "data-x-position": pe, style: { "--front-toast-height": `${((L = k[0]) == null ? void 0 : L.height) || 0}px`, "--width": `${kn}px`, "--gap": `${E}px`, ...a, ...Ln(c, u) }, onBlur: (z) => {
1655
+ U.current && !z.currentTarget.contains(z.relatedTarget) && (U.current = !1, w.current && (w.current.focus({ preventScroll: !0 }), w.current = null));
1656
+ }, onFocus: (z) => {
1657
+ z.target instanceof HTMLElement && z.target.dataset.dismissible === "false" || U.current || (U.current = !0, w.current = z.relatedTarget);
1658
+ }, onMouseEnter: () => S(!0), onMouseMove: () => S(!0), onMouseLeave: () => {
1659
+ de || S(!1);
1660
+ }, onDragEnd: () => S(!1), onPointerDown: (z) => {
1661
+ z.target instanceof HTMLElement && z.target.dataset.dismissible === "false" || $(!0);
1662
+ }, onPointerUp: () => $(!1) }, R.filter((z) => !z.position && M === 0 || z.position === I).map((z, Ve) => {
1663
+ var we, Re;
1664
+ return m.createElement(_n, { key: z.id, icons: x, index: Ve, toast: z, defaultRichColors: h, duration: (we = v == null ? void 0 : v.duration) != null ? we : g, className: v == null ? void 0 : v.className, descriptionClassName: v == null ? void 0 : v.descriptionClassName, invert: r, visibleToasts: N, closeButton: (Re = v == null ? void 0 : v.closeButton) != null ? Re : i, interacting: de, position: I, style: v == null ? void 0 : v.style, unstyled: v == null ? void 0 : v.unstyled, classNames: v == null ? void 0 : v.classNames, cancelButtonStyle: v == null ? void 0 : v.cancelButtonStyle, actionButtonStyle: v == null ? void 0 : v.actionButtonStyle, removeToast: He, toasts: R.filter((xe) => xe.position == z.position), heights: k.filter((xe) => xe.position == z.position), setHeights: B, expandByDefault: s, gap: E, loadingIcon: C, expanded: H, pauseWhenPageIsHidden: O, swipeDirections: e.swipeDirections });
1665
+ })) : null;
1666
+ }));
1667
+ });
1668
+ const Cr = {
1669
+ mobile: { width: 375, icon: Qr, label: "Mobile (375px)" },
1670
+ tablet: { width: 768, icon: Zr, label: "Tablet (768px)" },
1671
+ small: { width: 1024, icon: qr, label: "Small Desktop (1024px)" },
1672
+ desktop: { width: "100%", icon: Kr, label: "Desktop (Full)" }
1673
+ }, zn = ({ onSave: e, deviceSize: t, onDeviceSizeChange: r }) => {
1674
+ const { actions: o, query: n, canUndo: s, canRedo: i } = ye((c, u) => ({
1675
+ canUndo: u.history.canUndo(),
1676
+ canRedo: u.history.canRedo()
1677
+ })), d = () => {
1678
+ const c = n.serialize();
1679
+ e == null || e(c), En.success("Page saved successfully");
1680
+ };
1681
+ return /* @__PURE__ */ F("div", { className: "flex items-center gap-4", children: [
1682
+ /* @__PURE__ */ l(Jr, { children: /* @__PURE__ */ l(
1683
+ xr,
1684
+ {
1685
+ type: "single",
1686
+ value: t,
1687
+ onValueChange: (c) => c && r(c),
1688
+ className: "bg-muted rounded-md p-1",
1689
+ children: Object.entries(Cr).map(([c, { icon: u, label: f }]) => /* @__PURE__ */ F(eo, { children: [
1690
+ /* @__PURE__ */ l(to, { asChild: !0, children: /* @__PURE__ */ l(
1691
+ Sr,
1692
+ {
1693
+ value: c,
1694
+ size: "sm",
1695
+ className: "data-[state=on]:bg-background data-[state=on]:shadow-sm",
1696
+ children: /* @__PURE__ */ l(u, { className: "h-4 w-4" })
1697
+ }
1698
+ ) }),
1699
+ /* @__PURE__ */ l(ro, { side: "bottom", children: /* @__PURE__ */ l("p", { children: f }) })
1700
+ ] }, c))
1701
+ }
1702
+ ) }),
1703
+ /* @__PURE__ */ l("div", { className: "h-6 w-px bg-border" }),
1704
+ /* @__PURE__ */ F("div", { className: "flex items-center gap-2", children: [
1705
+ /* @__PURE__ */ l(
1706
+ Ie,
1707
+ {
1708
+ variant: "outline",
1709
+ size: "sm",
1710
+ onClick: () => o.history.undo(),
1711
+ disabled: !s,
1712
+ children: /* @__PURE__ */ l(bo, { className: "h-4 w-4" })
1713
+ }
1714
+ ),
1715
+ /* @__PURE__ */ l(
1716
+ Ie,
1717
+ {
1718
+ variant: "outline",
1719
+ size: "sm",
1720
+ onClick: () => o.history.redo(),
1721
+ disabled: !i,
1722
+ children: /* @__PURE__ */ l(ho, { className: "h-4 w-4" })
1723
+ }
1724
+ ),
1725
+ /* @__PURE__ */ F(Ie, { size: "sm", onClick: d, children: [
1726
+ /* @__PURE__ */ l(go, { className: "h-4 w-4 mr-2" }),
1727
+ "Save"
1728
+ ] })
1729
+ ] })
1730
+ ] });
1731
+ }, ct = ({ children: e, className: t }) => {
1732
+ const {
1733
+ connectors: { connect: r, drag: o },
1734
+ selected: n
1735
+ } = Qe((s) => ({
1736
+ selected: s.events.selected
1737
+ }));
1738
+ return /* @__PURE__ */ l(
1739
+ "div",
1740
+ {
1741
+ ref: (s) => {
1742
+ s && r(o(s));
1743
+ },
1744
+ className: Et("relative min-h-[100vh] bg-white", t || ""),
1745
+ children: e
1746
+ }
1747
+ );
1748
+ };
1749
+ ct.craft = {
1750
+ props: {},
1751
+ displayName: "Body",
1752
+ isCanvas: !0,
1753
+ rules: {
1754
+ canMoveIn: (e) => e.every(
1755
+ (t) => t.data.displayName !== "Body"
1756
+ )
1757
+ }
1758
+ };
1759
+ const On = ({ htmlJson: e }) => {
1760
+ const { actions: t } = ye();
1761
+ return Fr(() => {
1762
+ e && t.deserialize(e);
1763
+ }, [e]), /* @__PURE__ */ l(oo, { children: /* @__PURE__ */ l(Ae, { id: "mainBody", is: ct, canvas: !0 }) });
1764
+ }, Er = ({
1765
+ background: e = "transparent",
1766
+ padding: t = { top: 16, right: 16, bottom: 16, left: 16 },
1767
+ margin: r = { top: 0, right: 0, bottom: 0, left: 0 },
1768
+ width: o = "auto",
1769
+ minHeight: n = 100,
1770
+ maxWidth: s = "none",
1771
+ display: i = "block",
1772
+ flexDirection: d = "column",
1773
+ justifyContent: c = "flex-start",
1774
+ alignItems: u = "stretch",
1775
+ gap: f = 0,
1776
+ borderRadius: h = 8,
1777
+ borderWidth: g = 1,
1778
+ borderColor: a = "transparent",
1779
+ borderStyle: N = "dashed",
1780
+ boxShadow: v = "none",
1781
+ children: b
1782
+ }) => {
1783
+ const {
1784
+ connectors: { connect: E, drag: C },
1785
+ isActive: x
1786
+ } = Qe((A) => ({
1787
+ isActive: A.events.selected
1788
+ })), T = typeof t == "object" ? `${t.top}px ${t.right}px ${t.bottom}px ${t.left}px` : `${t}px`, O = typeof r == "object" ? `${r.top}px ${r.right}px ${r.bottom}px ${r.left}px` : `${r}px`, R = [
1789
+ {
1790
+ url: "https://myracereel.com/privacy-data-privacy",
1791
+ name: "Privacy & Data Policy"
1792
+ },
1793
+ {
1794
+ url: "https://myracereel.com/terms-of-service",
1795
+ name: "Terms of Service"
1796
+ },
1797
+ { url: "https://myracereel.com/faq", name: "FAQ" },
1798
+ { url: "https://myracereel.com/contact", name: "Contact Us" }
1799
+ ];
1800
+ return /* @__PURE__ */ l(
1801
+ Je,
1802
+ {
1803
+ style: {
1804
+ backgroundColor: e,
1805
+ padding: T,
1806
+ margin: O,
1807
+ width: o === "auto" ? "100%" : o,
1808
+ minHeight: `${n}px`,
1809
+ maxWidth: s === "none" ? "none" : `${s}px`,
1810
+ display: i,
1811
+ flexDirection: i === "flex" ? d : void 0,
1812
+ justifyContent: i === "flex" ? c : void 0,
1813
+ alignItems: i === "flex" ? u : void 0,
1814
+ gap: i === "flex" ? `${f}px` : void 0,
1815
+ borderRadius: `${h}px`,
1816
+ borderWidth: `${g}px`,
1817
+ borderColor: a,
1818
+ borderStyle: N,
1819
+ boxShadow: v === "none" ? "none" : v
1820
+ },
1821
+ className: "bg-black",
1822
+ ref: (A) => A && E(C(A)),
1823
+ children: /* @__PURE__ */ l("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ F("div", { className: "w-full flex flex-col py-10 gap-y-3.5 ", children: [
1824
+ /* @__PURE__ */ l("div", { className: "flex w-full gap-x-1 justify-center items-center", children: /* @__PURE__ */ l("div", { className: "text-white text-sm", children: "Powered by MyRaceReel" }) }),
1825
+ /* @__PURE__ */ l("div", { className: "flex @md:flex-row @max-md:flex-col md:flex-row justify-center items-center gap-x-6 gap-y-2 w-full flex-col", children: R.map((A) => /* @__PURE__ */ l(
1826
+ "a",
1827
+ {
1828
+ className: "text-white",
1829
+ href: A.url,
1830
+ target: "_blank",
1831
+ children: A.name
1832
+ },
1833
+ A.name
1834
+ )) })
1835
+ ] }) })
1836
+ }
1837
+ );
1838
+ };
1839
+ Er.craft = {
1840
+ displayName: "Footer",
1841
+ props: {
1842
+ background: "transparent",
1843
+ padding: { top: 16, right: 16, bottom: 16, left: 16 },
1844
+ margin: { top: 0, right: 0, bottom: 0, left: 0 },
1845
+ width: "auto",
1846
+ minHeight: 100,
1847
+ maxWidth: "none",
1848
+ display: "block",
1849
+ flexDirection: "column",
1850
+ justifyContent: "flex-start",
1851
+ alignItems: "stretch",
1852
+ gap: 0,
1853
+ borderRadius: 8,
1854
+ borderWidth: 1,
1855
+ borderColor: "transparent",
1856
+ borderStyle: "dashed",
1857
+ boxShadow: "none"
1858
+ },
1859
+ related: { settings: Nt }
1860
+ };
1861
+ const $n = ({ initialData: e, onSave: t, onStateChange: r }) => {
1862
+ var c;
1863
+ const o = no(), [n, s] = Ee("desktop"), i = ((c = Cr[n]) == null ? void 0 : c.width) || "100%", d = (u) => {
1864
+ if (r)
1865
+ try {
1866
+ const f = u.serialize();
1867
+ r(f);
1868
+ } catch {
1869
+ }
1870
+ };
1871
+ return /* @__PURE__ */ l(
1872
+ ao,
1873
+ {
1874
+ resolver: {
1875
+ Body: ct,
1876
+ Div: et,
1877
+ Wrapper: Je,
1878
+ Section: io,
1879
+ Container: Rt,
1880
+ Text: kt,
1881
+ ButtonComponent: It,
1882
+ Heading: Pt,
1883
+ Image: Dt,
1884
+ Img: lo,
1885
+ Divider: _t,
1886
+ Spacer: Lt,
1887
+ Video: Mt,
1888
+ Columns: so,
1889
+ Link: At,
1890
+ Footer: Er
1891
+ },
1892
+ enabled: !0,
1893
+ onNodesChange: (u) => d(u),
1894
+ children: /* @__PURE__ */ l(co, { value: n, children: /* @__PURE__ */ l(uo, { value: o, children: /* @__PURE__ */ F("div", { className: "flex flex-col h-full", children: [
1895
+ /* @__PURE__ */ F("div", { className: "flex items-center justify-between pb-4 border-b border-border", children: [
1896
+ /* @__PURE__ */ l("h2", { className: "text-lg font-semibold", children: "Page Builder" }),
1897
+ /* @__PURE__ */ l(
1898
+ zn,
1899
+ {
1900
+ onSave: t,
1901
+ deviceSize: n,
1902
+ onDeviceSizeChange: s
1903
+ }
1904
+ )
1905
+ ] }),
1906
+ /* @__PURE__ */ F("div", { className: "flex gap-4 mt-4 flex-1 min-h-0", children: [
1907
+ /* @__PURE__ */ l(Ue, { className: "w-56 shrink-0", children: /* @__PURE__ */ F(Xe, { className: "p-4 space-y-6", children: [
1908
+ /* @__PURE__ */ l(wo, {}),
1909
+ /* @__PURE__ */ l(Bo, {})
1910
+ ] }) }),
1911
+ /* @__PURE__ */ l(Ue, { className: "flex-1 overflow-hidden bg-muted/30 flex flex-col", children: /* @__PURE__ */ l(Xe, { className: "p-4 flex-1 flex justify-center overflow-hidden", children: /* @__PURE__ */ l(st, { className: "h-full w-full", children: /* @__PURE__ */ l("div", { className: "flex justify-center min-h-full", children: /* @__PURE__ */ l(
1912
+ "div",
1913
+ {
1914
+ className: "bg-white rounded-lg min-h-full p-4 border border-dashed border-border transition-all duration-300 shadow-sm",
1915
+ style: {
1916
+ width: typeof i == "number" ? `${i}px` : i,
1917
+ maxWidth: "100%"
1918
+ },
1919
+ children: /* @__PURE__ */ l(On, { htmlJson: e })
1920
+ }
1921
+ ) }) }) }) }),
1922
+ /* @__PURE__ */ l(Ue, { className: "w-72 shrink-0 flex flex-col", children: /* @__PURE__ */ l(Xe, { className: "p-4 flex-1 overflow-hidden", children: /* @__PURE__ */ l(zo, {}) }) })
1923
+ ] })
1924
+ ] }) }) })
1925
+ }
1926
+ );
1927
+ };
1928
+ export {
1929
+ $n as default
1930
+ };