@chaibuilder/sdk 1.2.9 → 1.2.11

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.
Files changed (102) hide show
  1. package/README.md +10 -12
  2. package/dist/AddBlocks-TSt8uJY4.js +218 -0
  3. package/dist/AddBlocks-k2p8Hy1n.cjs +1 -0
  4. package/dist/BrandingOptions-WyVWfFVz.cjs +1 -0
  5. package/dist/{BrandingOptions-QJJ1y5ez.js → BrandingOptions-uFTyYJZj.js} +18 -22
  6. package/dist/CanvasArea-5erOZYLy.cjs +60 -0
  7. package/dist/{CanvasArea-mlNKmCOh.js → CanvasArea-iRQqpOak.js} +465 -481
  8. package/dist/{utils-AvyFzbPC.js → Class-17XFhL48.js} +15 -16
  9. package/dist/Class-5ARpH_Tu.cjs +1 -0
  10. package/dist/CurrentPage-NzmJloN7.cjs +1 -0
  11. package/dist/{CurrentPage-lBy25sZn.js → CurrentPage-RCxTz9Mc.js} +24 -26
  12. package/dist/{Layers-3Xs4A5i8.js → Layers-tXB5Pwid.js} +124 -158
  13. package/dist/Layers-xDG7oltg.cjs +1 -0
  14. package/dist/PagesPanel-72nzYB1k.cjs +1 -0
  15. package/dist/{PagesPanel--BZhafnt.js → PagesPanel-Jaz9jvye.js} +14 -16
  16. package/dist/{ProjectPanel-YcLkM-DW.js → ProjectPanel--S014Xx3.js} +22 -24
  17. package/dist/ProjectPanel-RU0QvH6e.cjs +1 -0
  18. package/dist/Settings-5EuwaVb3.cjs +1 -0
  19. package/dist/{Settings-TAgX4hov.js → Settings-gjvl5V1k.js} +556 -579
  20. package/dist/{SidePanels-btVQQkVK.js → SidePanels-Fq3kRwR0.js} +54 -51
  21. package/dist/SidePanels-uNCxnGte.cjs +1 -0
  22. package/dist/Topbar-JqW89xI5.cjs +1 -0
  23. package/dist/{Topbar-j4t4AgCq.js → Topbar-m5dbbI1f.js} +15 -17
  24. package/dist/{UnsplashImages-41Y3q5_Q.js → UnsplashImages-GhBD6owT.js} +24 -26
  25. package/dist/UnsplashImages-vACw5hbK.cjs +1 -0
  26. package/dist/UploadImages-PzHdEKHT.cjs +1 -0
  27. package/dist/{UploadImages-xBg-kbKv.js → UploadImages-S1HgxeGb.js} +23 -25
  28. package/dist/{add-page-modal-cm8damU2.js → add-page-modal-2P5hGXOQ.js} +15 -17
  29. package/dist/add-page-modal-GAizM2Jw.cjs +1 -0
  30. package/dist/{confirm-alert-i4pM3mOt.js → confirm-alert-57Xq5foA.js} +12 -14
  31. package/dist/confirm-alert-Uf84DpdR.cjs +1 -0
  32. package/dist/core.cjs +1 -1
  33. package/dist/core.d.ts +13 -58
  34. package/dist/core.js +47 -58
  35. package/dist/defaultTheme-IH19g4fv.cjs +1 -0
  36. package/dist/defaultTheme-YY8mlQS3.js +1055 -0
  37. package/dist/delete-page-modal-MG42FdnU.cjs +1 -0
  38. package/dist/{delete-page-modal-YrIBvfFA.js → delete-page-modal-ix5IjaFW.js} +27 -29
  39. package/dist/email-blocks.cjs +1 -1
  40. package/dist/email-blocks.js +100 -81
  41. package/dist/email.cjs +1 -0
  42. package/dist/email.d.ts +116 -0
  43. package/dist/email.js +79 -0
  44. package/dist/{controls-XPXGHKht.js → empty-slot-MWycClTb.js} +61 -50
  45. package/dist/empty-slot-TF2kd-0X.cjs +1 -0
  46. package/dist/{form-VbouZlAW.cjs → form-KBb3kA8g.cjs} +1 -1
  47. package/dist/{form-OVmsLOrc.js → form-SYcFyACJ.js} +18 -18
  48. package/dist/{index-pZhGT8uT.js → index-Fj3ead-J.js} +4886 -4884
  49. package/dist/index-aiHDvS5v.cjs +1 -0
  50. package/dist/{index-N50dZnlC.cjs → index-cM3eKmlx.cjs} +25 -25
  51. package/dist/index-pNYv0oAF.js +2994 -0
  52. package/dist/lib.cjs +3 -3
  53. package/dist/lib.js +95 -1125
  54. package/dist/page-viewer-Sh99FGYk.cjs +1 -0
  55. package/dist/{page-viewer-feqJr1QI.js → page-viewer-VxqOevr4.js} +15 -17
  56. package/dist/project-general-setting-VTLHa-Ik.cjs +1 -0
  57. package/dist/{project-general-setting-SgagORzW.js → project-general-setting-nWOjPiin.js} +15 -17
  58. package/dist/{project-seo-setting-wxAGEkd_.js → project-seo-setting-70bWTwsB.js} +17 -19
  59. package/dist/project-seo-setting-ENAKc2Dl.cjs +1 -0
  60. package/dist/render.cjs +1 -1
  61. package/dist/render.d.ts +2 -0
  62. package/dist/render.js +111 -70
  63. package/dist/{single-page-detail-dnWMyg6P.js → single-page-detail-3z7TF-Yy.js} +44 -46
  64. package/dist/single-page-detail-6L38HJC4.cjs +1 -0
  65. package/dist/studio.cjs +1 -1
  66. package/dist/studio.js +13 -15
  67. package/dist/ui.cjs +1 -1
  68. package/dist/ui.d.ts +4 -4
  69. package/dist/ui.js +149 -151
  70. package/dist/{useAddBlockByDrop-inkD7Lck.cjs → useAddBlockByDrop-7mUMwNSG.cjs} +1 -1
  71. package/dist/{useAddBlockByDrop-_nwI4W3q.js → useAddBlockByDrop-tjQ5DgiO.js} +1 -1
  72. package/dist/web-blocks.cjs +1 -9
  73. package/dist/web-blocks.js +431 -442
  74. package/package.json +8 -2
  75. package/dist/AddBlocks-tMxKPoen.js +0 -225
  76. package/dist/AddBlocks-x2LkOHSj.cjs +0 -1
  77. package/dist/BrandingOptions-EzT9UYd6.cjs +0 -1
  78. package/dist/CanvasArea-xs4wM64L.cjs +0 -60
  79. package/dist/CurrentPage-aaU4F7wi.cjs +0 -1
  80. package/dist/Layers-eaHy5PK9.cjs +0 -1
  81. package/dist/MarkAsGlobalBlock-BjP-Rqlf.js +0 -88
  82. package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +0 -1
  83. package/dist/PagesPanel-gGKCV394.cjs +0 -1
  84. package/dist/ProjectPanel-yFJRy0_E.cjs +0 -1
  85. package/dist/Settings-7wlLcvoh.cjs +0 -1
  86. package/dist/SidePanels-5H4j0mIs.cjs +0 -1
  87. package/dist/Topbar-V8xCetWF.cjs +0 -1
  88. package/dist/UnsplashImages-DbHky6cj.cjs +0 -1
  89. package/dist/UploadImages-DnQ95_NW.cjs +0 -1
  90. package/dist/add-page-modal-MwS7iXn_.cjs +0 -1
  91. package/dist/confirm-alert-U7-NcG7G.cjs +0 -1
  92. package/dist/controls-Dy1qa8Dc.cjs +0 -1
  93. package/dist/delete-page-modal-5o4jXu-z.cjs +0 -1
  94. package/dist/functions-Ox_svtKm.cjs +0 -1
  95. package/dist/functions-xIebp8Aw.js +0 -23
  96. package/dist/index-H6vIwGfD.cjs +0 -1
  97. package/dist/index-niHREMmR.js +0 -2938
  98. package/dist/page-viewer-SLt8XgYv.cjs +0 -1
  99. package/dist/project-general-setting-ym0yCdOq.cjs +0 -1
  100. package/dist/project-seo-setting-Snn2nZgS.cjs +0 -1
  101. package/dist/single-page-detail-IPod1o5P.cjs +0 -1
  102. package/dist/utils-PTxFk6qT.cjs +0 -1
@@ -0,0 +1,2994 @@
1
+ import * as m from "react";
2
+ import et, { createContext as Ms, useContext as Ds, useRef as vr, createElement as yr, useReducer as Es, useEffect as Ce, useDebugValue as Os, useCallback as z, useMemo as Ls, useState as Ee, Suspense as ht } from "react";
3
+ import { has as pe, get as F, flatten as ne, filter as M, omit as Oe, isEmpty as ve, isString as Et, find as te, map as R, each as ue, set as Se, includes as q, isUndefined as Nr, without as Ot, forIn as Lt, isObject as zs, first as Q, noop as Vs, keys as $s, startsWith as zt, isNull as qe, pick as vt, sortBy as yt } from "lodash-es";
4
+ import { g as ce, a as Fs } from "./Functions-7jnEwJyw.js";
5
+ import { getBlockComponent as Le } from "@chaibuilder/runtime";
6
+ import { atom as w, useAtomValue as X, useAtom as D, useSetAtom as Be } from "jotai";
7
+ import Vt from "flat-to-nested";
8
+ import { a as me, I as $t, S as Ke, B as Je } from "./MODIFIERS-RiXS5Mn1.js";
9
+ import { g as Us } from "./_commonjsHelpers-UyOWmZb0.js";
10
+ import { useThrottledCallback as Ws } from "@react-hookz/web";
11
+ import { j as a } from "./jsx-runtime-WbnYoNE9.js";
12
+ import * as Ft from "@radix-ui/react-toggle";
13
+ import { cva as ge } from "class-variance-authority";
14
+ import { a as d, c as Pe } from "./Class-17XFhL48.js";
15
+ import * as Ye from "@radix-ui/react-switch";
16
+ import { Slot as Gs } from "@radix-ui/react-slot";
17
+ import * as fe from "@radix-ui/react-accordion";
18
+ import { ChevronDownIcon as Hs, Cross2Icon as tt, ChevronRightIcon as st, CheckIcon as ze, DotFilledIcon as ot, CaretSortIcon as qs, MagnifyingGlassIcon as Ks } from "@radix-ui/react-icons";
19
+ import * as U from "@radix-ui/react-alert-dialog";
20
+ import * as _ from "@radix-ui/react-dialog";
21
+ import * as Ut from "@radix-ui/react-label";
22
+ import * as de from "@radix-ui/react-scroll-area";
23
+ import * as be from "@radix-ui/react-tabs";
24
+ import * as ye from "@radix-ui/react-tooltip";
25
+ import * as Ae from "@radix-ui/react-popover";
26
+ import * as C from "@radix-ui/react-menubar";
27
+ import * as Ve from "@radix-ui/react-hover-card";
28
+ import * as L from "@radix-ui/react-select";
29
+ import * as T from "@radix-ui/react-dropdown-menu";
30
+ import * as Wt from "@radix-ui/react-separator";
31
+ import * as Y from "@radix-ui/react-toast";
32
+ import { Command as K } from "cmdk";
33
+ import * as P from "@radix-ui/react-context-menu";
34
+ import Js, { IconPickerItem as Ys } from "react-icons-picker";
35
+ import Qs from "react-dom";
36
+ import Xs from "react-quill";
37
+ import "react-i18next";
38
+ var V = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
39
+ let Zs = 0;
40
+ function oe(e, t) {
41
+ const s = `atom${++Zs}`, o = {
42
+ toString: () => s
43
+ };
44
+ return typeof e == "function" ? o.read = e : (o.init = e, o.read = (n) => n(o), o.write = (n, i, r) => i(
45
+ o,
46
+ typeof r == "function" ? r(n(o)) : r
47
+ )), t && (o.write = t), o;
48
+ }
49
+ const Fe = (e) => "init" in e, Ue = (e) => !!e.write, De = /* @__PURE__ */ new WeakMap(), eo = (e, t) => {
50
+ De.set(e, t), e.catch(() => {
51
+ }).finally(() => De.delete(e));
52
+ }, wt = (e, t) => {
53
+ const s = De.get(e);
54
+ s && (De.delete(e), s(t));
55
+ }, Nt = (e, t) => {
56
+ e.status = "fulfilled", e.value = t;
57
+ }, kt = (e, t) => {
58
+ e.status = "rejected", e.reason = t;
59
+ }, to = (e) => typeof (e == null ? void 0 : e.then) == "function", Ne = (e, t) => "v" in e && "v" in t && Object.is(e.v, t.v), jt = (e, t) => "e" in e && "e" in t && Object.is(e.e, t.e), he = (e) => "v" in e && e.v instanceof Promise, so = (e, t) => "v" in e && "v" in t && e.v.orig && e.v.orig === t.v.orig, Te = (e) => {
60
+ if ("e" in e)
61
+ throw e.e;
62
+ return e.v;
63
+ }, oo = () => {
64
+ const e = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap(), s = /* @__PURE__ */ new Map();
65
+ let o, n, i;
66
+ (V ? "production" : void 0) !== "production" && (o = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set());
67
+ const r = (u) => e.get(u), c = (u, g) => {
68
+ (V ? "production" : void 0) !== "production" && Object.freeze(g);
69
+ const v = e.get(u);
70
+ if (e.set(u, g), s.has(u) || s.set(u, v), v && he(v)) {
71
+ const b = "v" in g ? g.v instanceof Promise ? g.v : Promise.resolve(g.v) : Promise.reject(g.e);
72
+ wt(v.v, b);
73
+ }
74
+ }, p = (u, g, v) => {
75
+ const b = /* @__PURE__ */ new Map();
76
+ let y = !1;
77
+ v.forEach((h, k) => {
78
+ !h && k === u && (h = g), h ? (b.set(k, h), g.d.get(k) !== h && (y = !0)) : (V ? "production" : void 0) !== "production" && console.warn("[Bug] atom state not found");
79
+ }), (y || g.d.size !== b.size) && (g.d = b);
80
+ }, l = (u, g, v) => {
81
+ const b = r(u), y = {
82
+ d: (b == null ? void 0 : b.d) || /* @__PURE__ */ new Map(),
83
+ v: g
84
+ };
85
+ if (v && p(u, y, v), b && Ne(b, y) && b.d === y.d)
86
+ return b;
87
+ if (b && he(b) && he(y) && so(b, y)) {
88
+ if (b.d === y.d)
89
+ return b;
90
+ y.v = b.v;
91
+ }
92
+ return c(u, y), y;
93
+ }, f = (u, g, v, b) => {
94
+ if (to(g)) {
95
+ let y;
96
+ const h = new Promise((k, E) => {
97
+ let S = !1;
98
+ g.then(
99
+ (B) => {
100
+ if (!S) {
101
+ S = !0;
102
+ const A = r(u), ee = l(
103
+ u,
104
+ h,
105
+ v
106
+ );
107
+ Nt(h, B), k(B), (A == null ? void 0 : A.d) !== ee.d && J(u, ee, A == null ? void 0 : A.d);
108
+ }
109
+ },
110
+ (B) => {
111
+ if (!S) {
112
+ S = !0;
113
+ const A = r(u), ee = l(
114
+ u,
115
+ h,
116
+ v
117
+ );
118
+ kt(h, B), E(B), (A == null ? void 0 : A.d) !== ee.d && J(u, ee, A == null ? void 0 : A.d);
119
+ }
120
+ }
121
+ ), y = (B) => {
122
+ S || (S = !0, B.then(
123
+ (A) => Nt(h, A),
124
+ (A) => kt(h, A)
125
+ ), k(B));
126
+ };
127
+ });
128
+ return h.orig = g, h.status = "pending", eo(h, (k) => {
129
+ k && y(k), b == null || b();
130
+ }), l(u, h, v);
131
+ }
132
+ return l(u, g, v);
133
+ }, x = (u, g, v) => {
134
+ const b = r(u), y = {
135
+ d: (b == null ? void 0 : b.d) || /* @__PURE__ */ new Map(),
136
+ e: g
137
+ };
138
+ return v && p(u, y, v), b && jt(b, y) && b.d === y.d ? b : (c(u, y), y);
139
+ }, N = (u) => {
140
+ const g = r(u);
141
+ if (g && (g.d.forEach((S, B) => {
142
+ B !== u && !t.has(B) && N(B);
143
+ }), Array.from(g.d).every(([S, B]) => {
144
+ const A = r(S);
145
+ return S === u || A === B || // TODO This is a hack, we should find a better solution.
146
+ A && !he(A) && Ne(A, B);
147
+ })))
148
+ return g;
149
+ const v = /* @__PURE__ */ new Map();
150
+ let b = !0;
151
+ const y = (S) => {
152
+ if (S === u) {
153
+ const A = r(S);
154
+ if (A)
155
+ return v.set(S, A), Te(A);
156
+ if (Fe(S))
157
+ return v.set(S, void 0), S.init;
158
+ throw new Error("no atom init");
159
+ }
160
+ const B = N(S);
161
+ return v.set(S, B), Te(B);
162
+ };
163
+ let h, k;
164
+ const E = {
165
+ get signal() {
166
+ return h || (h = new AbortController()), h.signal;
167
+ },
168
+ get setSelf() {
169
+ return (V ? "production" : void 0) !== "production" && !Ue(u) && console.warn("setSelf function cannot be used with read-only atom"), !k && Ue(u) && (k = (...S) => {
170
+ if ((V ? "production" : void 0) !== "production" && b && console.warn("setSelf function cannot be called in sync"), !b)
171
+ return $(u, ...S);
172
+ }), k;
173
+ }
174
+ };
175
+ try {
176
+ const S = u.read(y, E);
177
+ return f(
178
+ u,
179
+ S,
180
+ v,
181
+ () => h == null ? void 0 : h.abort()
182
+ );
183
+ } catch (S) {
184
+ return x(u, S, v);
185
+ } finally {
186
+ b = !1;
187
+ }
188
+ }, j = (u) => Te(N(u)), I = (u) => {
189
+ let g = t.get(u);
190
+ return g || (g = Z(u)), g;
191
+ }, O = (u, g) => !g.l.size && (!g.t.size || g.t.size === 1 && g.t.has(u)), W = (u) => {
192
+ const g = t.get(u);
193
+ g && O(u, g) && le(u);
194
+ }, G = (u) => {
195
+ const g = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new WeakMap(), b = (h) => {
196
+ const k = t.get(h);
197
+ k == null || k.t.forEach((E) => {
198
+ E !== h && (g.set(
199
+ E,
200
+ (g.get(E) || /* @__PURE__ */ new Set()).add(h)
201
+ ), v.set(E, (v.get(E) || 0) + 1), b(E));
202
+ });
203
+ };
204
+ b(u);
205
+ const y = (h) => {
206
+ const k = t.get(h);
207
+ k == null || k.t.forEach((E) => {
208
+ var S;
209
+ if (E !== h) {
210
+ let B = v.get(E);
211
+ if (B && v.set(E, --B), !B) {
212
+ let A = !!((S = g.get(E)) != null && S.size);
213
+ if (A) {
214
+ const ee = r(E), Is = N(E);
215
+ A = !ee || !Ne(ee, Is);
216
+ }
217
+ A || g.forEach((ee) => ee.delete(E));
218
+ }
219
+ y(E);
220
+ }
221
+ });
222
+ };
223
+ y(u);
224
+ }, H = (u, ...g) => {
225
+ let v = !0;
226
+ const b = (k) => Te(N(k)), y = (k, ...E) => {
227
+ let S;
228
+ if (k === u) {
229
+ if (!Fe(k))
230
+ throw new Error("atom not writable");
231
+ const B = r(k), A = f(k, E[0]);
232
+ (!B || !Ne(B, A)) && G(k);
233
+ } else
234
+ S = H(k, ...E);
235
+ if (!v) {
236
+ const B = ae();
237
+ (V ? "production" : void 0) !== "production" && n.forEach(
238
+ (A) => A({ type: "async-write", flushed: B })
239
+ );
240
+ }
241
+ return S;
242
+ }, h = u.write(b, y, ...g);
243
+ return v = !1, h;
244
+ }, $ = (u, ...g) => {
245
+ const v = H(u, ...g), b = ae();
246
+ return (V ? "production" : void 0) !== "production" && n.forEach(
247
+ (y) => y({ type: "write", flushed: b })
248
+ ), v;
249
+ }, Z = (u, g) => {
250
+ const v = {
251
+ t: new Set(g && [g]),
252
+ l: /* @__PURE__ */ new Set()
253
+ };
254
+ if (t.set(u, v), (V ? "production" : void 0) !== "production" && i.add(u), N(u).d.forEach((b, y) => {
255
+ const h = t.get(y);
256
+ h ? h.t.add(u) : y !== u && Z(y, u);
257
+ }), N(u), Ue(u) && u.onMount) {
258
+ const b = u.onMount((...y) => $(u, ...y));
259
+ b && (v.u = b);
260
+ }
261
+ return v;
262
+ }, le = (u) => {
263
+ var g;
264
+ const v = (g = t.get(u)) == null ? void 0 : g.u;
265
+ v && v(), t.delete(u), (V ? "production" : void 0) !== "production" && i.delete(u);
266
+ const b = r(u);
267
+ b ? (he(b) && wt(b.v), b.d.forEach((y, h) => {
268
+ if (h !== u) {
269
+ const k = t.get(h);
270
+ k && (k.t.delete(u), O(h, k) && le(h));
271
+ }
272
+ })) : (V ? "production" : void 0) !== "production" && console.warn("[Bug] could not find atom state to unmount", u);
273
+ }, J = (u, g, v) => {
274
+ const b = new Set(g.d.keys());
275
+ v == null || v.forEach((y, h) => {
276
+ if (b.has(h)) {
277
+ b.delete(h);
278
+ return;
279
+ }
280
+ const k = t.get(h);
281
+ k && (k.t.delete(u), O(h, k) && le(h));
282
+ }), b.forEach((y) => {
283
+ const h = t.get(y);
284
+ h ? h.t.add(u) : t.has(u) && Z(y, u);
285
+ });
286
+ }, ae = () => {
287
+ let u;
288
+ for ((V ? "production" : void 0) !== "production" && (u = /* @__PURE__ */ new Set()); s.size; ) {
289
+ const g = Array.from(s);
290
+ s.clear(), g.forEach(([v, b]) => {
291
+ const y = r(v);
292
+ if (y) {
293
+ y.d !== (b == null ? void 0 : b.d) && J(v, y, b == null ? void 0 : b.d);
294
+ const h = t.get(v);
295
+ h && !// TODO This seems pretty hacky. Hope to fix it.
296
+ // Maybe we could `mountDependencies` in `setAtomState`?
297
+ (b && !he(b) && (Ne(b, y) || jt(b, y))) && (h.l.forEach((k) => k()), (V ? "production" : void 0) !== "production" && u.add(v));
298
+ } else
299
+ (V ? "production" : void 0) !== "production" && console.warn("[Bug] no atom state to flush");
300
+ });
301
+ }
302
+ if ((V ? "production" : void 0) !== "production")
303
+ return o.forEach((g) => g("state")), u;
304
+ }, re = (u, g) => {
305
+ const v = I(u), b = ae(), y = v.l;
306
+ return y.add(g), (V ? "production" : void 0) !== "production" && (o.forEach((h) => h("sub")), n.forEach(
307
+ (h) => h({ type: "sub", flushed: b })
308
+ )), () => {
309
+ y.delete(g), W(u), (V ? "production" : void 0) !== "production" && (o.forEach((h) => h("unsub")), n.forEach((h) => h({ type: "unsub" })));
310
+ };
311
+ };
312
+ return (V ? "production" : void 0) !== "production" ? {
313
+ get: j,
314
+ set: $,
315
+ sub: re,
316
+ // store dev methods (these are tentative and subject to change without notice)
317
+ dev_subscribe_store: (u, g) => g !== 2 ? (console.warn(
318
+ "The current StoreListener revision is 2. The older ones are deprecated."
319
+ ), o.add(u), () => {
320
+ o.delete(u);
321
+ }) : (n.add(u), () => {
322
+ n.delete(u);
323
+ }),
324
+ dev_get_mounted_atoms: () => i.values(),
325
+ dev_get_atom_state: (u) => e.get(u),
326
+ dev_get_mounted: (u) => t.get(u),
327
+ dev_restore_atoms: (u) => {
328
+ for (const [v, b] of u)
329
+ Fe(v) && (f(v, b), G(v));
330
+ const g = ae();
331
+ n.forEach(
332
+ (v) => v({ type: "restore", flushed: g })
333
+ );
334
+ }
335
+ } : {
336
+ get: j,
337
+ set: $,
338
+ sub: re
339
+ };
340
+ };
341
+ let We;
342
+ const no = () => (We || (We = oo()), We);
343
+ var ao = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
344
+ const ro = Ms(void 0), Gt = (e) => {
345
+ const t = Ds(ro);
346
+ return (e == null ? void 0 : e.store) || t || no();
347
+ };
348
+ const io = (e) => typeof (e == null ? void 0 : e.then) == "function", lo = et.use || ((e) => {
349
+ if (e.status === "pending")
350
+ throw e;
351
+ if (e.status === "fulfilled")
352
+ return e.value;
353
+ throw e.status === "rejected" ? e.reason : (e.status = "pending", e.then(
354
+ (t) => {
355
+ e.status = "fulfilled", e.value = t;
356
+ },
357
+ (t) => {
358
+ e.status = "rejected", e.reason = t;
359
+ }
360
+ ), e);
361
+ });
362
+ function co(e, t) {
363
+ const s = Gt(t), [[o, n, i], r] = Es(
364
+ (l) => {
365
+ const f = s.get(e);
366
+ return Object.is(l[0], f) && l[1] === s && l[2] === e ? l : [f, s, e];
367
+ },
368
+ void 0,
369
+ () => [s.get(e), s, e]
370
+ );
371
+ let c = o;
372
+ (n !== s || i !== e) && (r(), c = s.get(e));
373
+ const p = t == null ? void 0 : t.delay;
374
+ return Ce(() => {
375
+ const l = s.sub(e, () => {
376
+ if (typeof p == "number") {
377
+ setTimeout(r, p);
378
+ return;
379
+ }
380
+ r();
381
+ });
382
+ return r(), l;
383
+ }, [s, e, p]), Os(c), io(c) ? lo(c) : c;
384
+ }
385
+ function uo(e, t) {
386
+ const s = Gt(t);
387
+ return z(
388
+ (...n) => {
389
+ if ((ao ? "production" : void 0) !== "production" && !("write" in e))
390
+ throw new Error("not writable atom");
391
+ return s.set(e, ...n);
392
+ },
393
+ [s, e]
394
+ );
395
+ }
396
+ function Vr(e, t) {
397
+ return [
398
+ co(e, t),
399
+ // We do wrong type assertion here, which results in throwing an error.
400
+ uo(e, t)
401
+ ];
402
+ }
403
+ var nt = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
404
+ const Ht = Symbol();
405
+ const St = (e, t, s) => (t.has(s) ? t : t.set(s, e())).get(s), mo = /* @__PURE__ */ new WeakMap(), fo = (e, t, s) => {
406
+ const o = St(() => /* @__PURE__ */ new WeakMap(), mo, t);
407
+ return St(e, o, s);
408
+ }, po = {}, At = (e) => !!e.write, go = (e) => typeof e == "function";
409
+ function bo(e, t) {
410
+ return fo(
411
+ () => {
412
+ const s = /* @__PURE__ */ new WeakMap(), o = (r, c) => {
413
+ let p = s.get(r);
414
+ if (p)
415
+ return p;
416
+ const l = c && s.get(c), f = [], x = [];
417
+ return r.forEach((N, j) => {
418
+ const I = t ? t(N) : j;
419
+ x[j] = I;
420
+ const O = l && l.atomList[l.keyList.indexOf(I)];
421
+ if (O) {
422
+ f[j] = O;
423
+ return;
424
+ }
425
+ const W = (H) => {
426
+ const $ = H(n), Z = H(e), J = o(Z, $ == null ? void 0 : $.arr).keyList.indexOf(I);
427
+ if (J < 0 || J >= Z.length) {
428
+ const ae = r[o(r).keyList.indexOf(I)];
429
+ if (ae)
430
+ return ae;
431
+ throw new Error("splitAtom: index out of bounds for read");
432
+ }
433
+ return Z[J];
434
+ }, G = (H, $, Z) => {
435
+ const le = H(n), J = H(e), re = o(J, le == null ? void 0 : le.arr).keyList.indexOf(I);
436
+ if (re < 0 || re >= J.length)
437
+ throw new Error("splitAtom: index out of bounds for write");
438
+ const u = go(Z) ? Z(J[re]) : Z;
439
+ $(e, [
440
+ ...J.slice(0, re),
441
+ u,
442
+ ...J.slice(re + 1)
443
+ ]);
444
+ };
445
+ f[j] = At(e) ? oe(W, G) : oe(W);
446
+ }), l && l.keyList.length === x.length && l.keyList.every((N, j) => N === x[j]) ? p = l : p = { arr: r, atomList: f, keyList: x }, s.set(r, p), p;
447
+ }, n = oe((r) => {
448
+ const c = r(n), p = r(e);
449
+ return o(p, c == null ? void 0 : c.arr);
450
+ });
451
+ (nt ? "production" : void 0) !== "production" && (n.debugPrivate = !0), n.init = void 0;
452
+ const i = At(e) ? oe(
453
+ (r) => r(n).atomList,
454
+ (r, c, p) => {
455
+ switch (p.type) {
456
+ case "remove": {
457
+ const l = r(i).indexOf(p.atom);
458
+ if (l >= 0) {
459
+ const f = r(e);
460
+ c(e, [
461
+ ...f.slice(0, l),
462
+ ...f.slice(l + 1)
463
+ ]);
464
+ }
465
+ break;
466
+ }
467
+ case "insert": {
468
+ const l = p.before ? r(i).indexOf(p.before) : r(i).length;
469
+ if (l >= 0) {
470
+ const f = r(e);
471
+ c(e, [
472
+ ...f.slice(0, l),
473
+ p.value,
474
+ ...f.slice(l)
475
+ ]);
476
+ }
477
+ break;
478
+ }
479
+ case "move": {
480
+ const l = r(i).indexOf(p.atom), f = p.before ? r(i).indexOf(p.before) : r(i).length;
481
+ if (l >= 0 && f >= 0) {
482
+ const x = r(e);
483
+ l < f ? c(e, [
484
+ ...x.slice(0, l),
485
+ ...x.slice(l + 1, f),
486
+ x[l],
487
+ ...x.slice(f)
488
+ ]) : c(e, [
489
+ ...x.slice(0, f),
490
+ x[l],
491
+ ...x.slice(f, l),
492
+ ...x.slice(l + 1)
493
+ ]);
494
+ }
495
+ break;
496
+ }
497
+ }
498
+ }
499
+ ) : oe((r) => r(n).atomList);
500
+ return i;
501
+ },
502
+ e,
503
+ t || po
504
+ );
505
+ }
506
+ function $r(e) {
507
+ const t = Symbol(), s = oe(t);
508
+ (nt ? "production" : void 0) !== "production" && (s.debugPrivate = !0);
509
+ const o = oe(
510
+ (n, i) => {
511
+ const r = n(s);
512
+ return r !== t ? r : e(n, i);
513
+ },
514
+ (n, i, r) => {
515
+ if (r === Ht)
516
+ i(s, t);
517
+ else if (typeof r == "function") {
518
+ const c = n(o);
519
+ i(s, r(c));
520
+ } else
521
+ i(s, r);
522
+ }
523
+ );
524
+ return o;
525
+ }
526
+ const xo = (e) => typeof (e == null ? void 0 : e.then) == "function";
527
+ function ho(e) {
528
+ let t, s;
529
+ const o = {
530
+ getItem: (n, i) => {
531
+ var r, c;
532
+ const p = (f) => {
533
+ if (f = f || "", t !== f) {
534
+ try {
535
+ s = JSON.parse(f);
536
+ } catch {
537
+ return i;
538
+ }
539
+ t = f;
540
+ }
541
+ return s;
542
+ }, l = (c = (r = e()) == null ? void 0 : r.getItem(n)) != null ? c : null;
543
+ return xo(l) ? l.then(p) : p(l);
544
+ },
545
+ setItem: (n, i) => {
546
+ var r;
547
+ return (r = e()) == null ? void 0 : r.setItem(n, JSON.stringify(i));
548
+ },
549
+ removeItem: (n) => {
550
+ var i;
551
+ return (i = e()) == null ? void 0 : i.removeItem(n);
552
+ }
553
+ };
554
+ return typeof window < "u" && typeof window.addEventListener == "function" && (o.subscribe = (n, i, r) => {
555
+ if (!(e() instanceof window.Storage))
556
+ return () => {
557
+ };
558
+ const c = (p) => {
559
+ if (p.storageArea === e() && p.key === n) {
560
+ let l;
561
+ try {
562
+ l = JSON.parse(p.newValue || "");
563
+ } catch {
564
+ l = r;
565
+ }
566
+ i(l);
567
+ }
568
+ };
569
+ return window.addEventListener("storage", c), () => {
570
+ window.removeEventListener("storage", c);
571
+ };
572
+ }), o;
573
+ }
574
+ const vo = ho(
575
+ () => typeof window < "u" ? window.localStorage : void 0
576
+ );
577
+ function _e(e, t, s = vo, o) {
578
+ const n = o == null ? void 0 : o.unstable_getOnInit, i = oe(
579
+ n ? s.getItem(e, t) : t
580
+ );
581
+ return (nt ? "production" : void 0) !== "production" && (i.debugPrivate = !0), i.onMount = (c) => {
582
+ n || c(s.getItem(e, t));
583
+ let p;
584
+ return s.subscribe && (p = s.subscribe(e, c, t)), p;
585
+ }, oe(
586
+ (c) => c(i),
587
+ (c, p, l) => {
588
+ const f = typeof l == "function" ? l(c(i)) : l;
589
+ return f === Ht ? (p(i, t), s.removeItem(e)) : f instanceof Promise ? f.then((x) => (p(i, x), s.setItem(e, x))) : (p(i, f), s.setItem(e, f));
590
+ }
591
+ );
592
+ }
593
+ const qt = w(null);
594
+ qt.debugLabel = "chaiBuilderPropsAtom";
595
+ const yo = w({});
596
+ yo.debugLabel = "chaiExternalDataAtom";
597
+ const Fr = () => !1, wo = (e) => {
598
+ const t = e.replace(me, "").split(",");
599
+ return { baseClasses: t[0], classes: t[1] };
600
+ }, Ct = (e, t) => {
601
+ if (!e)
602
+ return !0;
603
+ const s = Le(e);
604
+ return s && pe(s, "canAcceptBlock") ? s.canAcceptBlock(t) : !1;
605
+ }, Kt = (e, t) => {
606
+ const s = Le(t);
607
+ return s && pe(s, "canBeNested") ? s.canBeNested(e) : !0;
608
+ }, Ur = (e) => {
609
+ const t = Le(e);
610
+ return t && pe(t, "canDuplicate") ? t.canDuplicate() : !0;
611
+ }, Wr = (e) => {
612
+ const t = Le(e);
613
+ return t && pe(t, "canDelete") ? t.canDelete() : !0;
614
+ }, Gr = (e, { dragSource: t, dropTarget: s }) => {
615
+ const o = F(t, "data._type", ""), n = F(s, "data._type", "");
616
+ return Kt(n, o);
617
+ };
618
+ const No = new Vt({ children: "blockNodes" });
619
+ function Jt(e, t, s) {
620
+ const o = M(e, (i) => i._parent === t), n = [];
621
+ for (let i = 0; i < o.length; i++) {
622
+ const r = Yt(o[i]);
623
+ if (Object.keys(r).length > 0 && Object.keys(r).forEach((c) => {
624
+ o[i][c] = `slot:${ce()}`;
625
+ }), M(e, { _parent: o[i]._id }).length > 0) {
626
+ const c = ce();
627
+ n.push({ ...o[i], oldId: o[i]._id, _id: c, _parent: s }), n.push(ne(Jt(e, o[i]._id, c)));
628
+ } else
629
+ n.push({
630
+ ...o[i],
631
+ oldId: o[i]._id,
632
+ _id: ce(),
633
+ _parent: s
634
+ });
635
+ }
636
+ return ne(n);
637
+ }
638
+ function ko(e) {
639
+ let t = No.convert(e.map((s) => Oe(s, ["settings"])));
640
+ return t = !t.type && t.blockNodes ? t.blockNodes : ve(t) ? [] : [t], t;
641
+ }
642
+ const Yt = (e) => {
643
+ const t = {};
644
+ return Object.keys(e).forEach((s) => {
645
+ Et(e[s]) && e[s].startsWith("slot") && (t[s] = e[s].replace("slot:", ""));
646
+ }), t;
647
+ }, jo = (e, t, s = null) => {
648
+ let o = te(e, { _id: t });
649
+ o = { ...o, oldId: o._id, _id: ce() }, s && (o = { ...o, _parent: s });
650
+ const n = [o];
651
+ M(e, { _parent: t }).length > 0 && n.push(ne(Jt(e, t, o._id)));
652
+ const i = ne(n);
653
+ return R(i, (r) => {
654
+ const c = r, p = Yt(c);
655
+ return Object.keys(p).length > 0 && Object.keys(p).forEach((l) => {
656
+ const f = te(i, { oldId: p[l].replace("slot:", "") });
657
+ c[l] = `slot:${f._id}`;
658
+ }), Oe(c, ["global", "oldId"]);
659
+ });
660
+ };
661
+ const ie = w([]);
662
+ ie.debugLabel = "presentBlocksAtom";
663
+ const at = bo(ie);
664
+ at.debugLabel = "pageBlocksAtomsAtom";
665
+ const So = w((e) => ko(e(ie)));
666
+ So.debugLabel = "pageBlocksTreeAtom";
667
+ const Ao = w("");
668
+ Ao.debugLabel = "builderActivePageAtom";
669
+ const Co = w(-1);
670
+ Co.debugLabel = "destinationDropIndexAtom";
671
+ const Qt = w([]);
672
+ Qt.debugLabel = "buildingBlocksAtom";
673
+ const Bo = w((e) => {
674
+ const t = e(Qt);
675
+ return M(t, (s) => pe(s, "blockId"));
676
+ });
677
+ Bo.debugLabel = "globalBlocksAtom";
678
+ const rt = w([]);
679
+ rt.debugLabel = "selectedBlockIdsAtom";
680
+ const it = w((e) => {
681
+ const t = e(ie), s = e(rt);
682
+ return R(
683
+ M(t, ({ _id: o }) => q(s, o)),
684
+ (o) => ({ ...o })
685
+ );
686
+ });
687
+ it.debugLabel = "selectedBlocksAtom";
688
+ const lt = w((e) => {
689
+ const t = e(it);
690
+ return t.length === 0 ? null : t.length === 1 ? t[0] : {
691
+ type: "Multiple",
692
+ id: R(t, "id")
693
+ };
694
+ });
695
+ lt.debugLabel = "selectedBlockAtom";
696
+ const _o = (e) => F(e, "parent", null), Ro = w((e) => {
697
+ const t = e(it), s = R(t, _o);
698
+ return M(e(ie), (o) => q(s, o._id));
699
+ });
700
+ Ro.debugLabel = "selectedBlocksParentsAtom";
701
+ const Xt = w(() => !1);
702
+ Xt.debugLabel = "selectedBlockFlexChildAtom";
703
+ const Zt = w(() => !1);
704
+ Zt.debugLabel = "selectedBlockGridChildAtom";
705
+ const ct = w("");
706
+ ct.debugLabel = "styleStateAtom";
707
+ const es = _e("styleBreakpoint", "xs");
708
+ es.debugLabel = "styleBreakpointAtom";
709
+ const Hr = () => ({
710
+ flexChild: X(Xt),
711
+ gridChild: X(Zt)
712
+ }), qr = () => X(lt);
713
+ const $e = () => {
714
+ const [e, t] = D(rt), s = z(
715
+ (o) => {
716
+ t((n) => q(n, o) ? Ot(n, o) : [...n, o]);
717
+ },
718
+ [t]
719
+ );
720
+ return [e, t, s];
721
+ }, Bt = (e) => {
722
+ switch (e.type) {
723
+ case "singular":
724
+ return e.uiSchema;
725
+ case "model":
726
+ const { properties: t } = e, s = {};
727
+ return Object.keys(t).forEach((i) => {
728
+ const r = t[i];
729
+ if (q(["slot", "styles"], r.type))
730
+ return;
731
+ const c = i;
732
+ s[c] = Bt(r);
733
+ }), s;
734
+ case "list":
735
+ const { itemProperties: o } = e, n = {
736
+ items: {}
737
+ };
738
+ return Object.keys(o).forEach((i) => {
739
+ const r = o[i];
740
+ if (q(["slot", "styles"], r.type))
741
+ return;
742
+ const c = i;
743
+ n.items[c] = Bt(r);
744
+ }), n;
745
+ default:
746
+ return {};
747
+ }
748
+ }, _t = (e) => {
749
+ switch (e.type) {
750
+ case "singular":
751
+ return e.schema;
752
+ case "model":
753
+ const { properties: t, title: s } = e, o = {
754
+ title: s,
755
+ type: "object",
756
+ properties: {}
757
+ };
758
+ return Object.keys(t).forEach((c) => {
759
+ const p = t[c];
760
+ if (q(["slot", "styles"], p.type))
761
+ return;
762
+ const l = c;
763
+ o.properties[l] = _t(p);
764
+ }), o;
765
+ case "list":
766
+ const { itemProperties: n, title: i } = e, r = {
767
+ title: i,
768
+ type: "array",
769
+ items: {
770
+ type: "object",
771
+ properties: {}
772
+ }
773
+ };
774
+ return Object.keys(n).forEach((c) => {
775
+ const p = n[c];
776
+ if (q(["slot", "styles"], p.type))
777
+ return;
778
+ const l = c;
779
+ r.items.properties[l] = _t(p), Se(r.items, "title", F(p, "itemTitle", `${i} item`));
780
+ }), r;
781
+ default:
782
+ return {};
783
+ }
784
+ }, ts = (e) => {
785
+ if (!e)
786
+ return {};
787
+ const t = {};
788
+ return Object.keys(e).forEach((s) => {
789
+ t[s] = Po(e[s]);
790
+ }), t;
791
+ }, To = (e) => {
792
+ if (ve(e.default))
793
+ return [];
794
+ const { itemProperties: t } = e;
795
+ return R(e.default, (s) => {
796
+ const o = { ...s };
797
+ return Lt(s, (n, i) => {
798
+ pe(t, i) && F(t[i], "i18n", !1) && (o[i] = $t);
799
+ }), o;
800
+ });
801
+ }, Po = (e) => {
802
+ switch (e.type) {
803
+ case "styles":
804
+ return e.default;
805
+ case "slot":
806
+ return `${Ke}${ce()}`;
807
+ case "singular":
808
+ const { i18n: t, schema: s } = e;
809
+ return t ? $t : F(s, "default", "");
810
+ case "model":
811
+ return ts(e.properties);
812
+ case "list":
813
+ return To(e);
814
+ default:
815
+ return "";
816
+ }
817
+ };
818
+ var dt = { exports: {} }, Kr = dt.exports;
819
+ (function(e) {
820
+ (function() {
821
+ "use strict";
822
+ function t(o, n, i) {
823
+ return o.splice(
824
+ n,
825
+ !i || 1 + i - n + (!(i < 0 ^ n >= 0) && (i < 0 || -1) * o.length)
826
+ ), o.length;
827
+ }
828
+ let s = function() {
829
+ let o = [], n = -1, i = 0, r = !1, c;
830
+ function p(l, f) {
831
+ return !l || typeof l[f] != "function" ? this : (r = !0, l[f](), r = !1, this);
832
+ }
833
+ return {
834
+ /**
835
+ * Adds a command to the queue.
836
+ * @property {object} command - Command
837
+ * @property {function} command.undo - Undo function
838
+ * @property {function} command.redo - Redo function
839
+ * @property {string} [command.groupId] - Optional group id
840
+ */
841
+ add: function(l) {
842
+ return r ? this : (o.splice(n + 1, o.length - n), o.push(l), i && o.length > i && t(o, 0, -(i + 1)), n = o.length - 1, c && c(), this);
843
+ },
844
+ /**
845
+ * Pass a function to be called on undo and redo actions.
846
+ * @property {function} callbackFunc - Callback function
847
+ */
848
+ setCallback: function(l) {
849
+ c = l;
850
+ },
851
+ /**
852
+ * Performs undo: call the undo function at the current index and decrease the index by 1.
853
+ */
854
+ undo: function() {
855
+ let l = o[n];
856
+ if (!l)
857
+ return this;
858
+ const f = l.groupId;
859
+ for (; l.groupId === f && (p(l, "undo"), n -= 1, l = o[n], !(!l || !l.groupId)); )
860
+ ;
861
+ return c && c(), this;
862
+ },
863
+ /**
864
+ * Performs redo: call the redo function at the next index and increase the index by 1.
865
+ */
866
+ redo: function() {
867
+ let l = o[n + 1];
868
+ if (!l)
869
+ return this;
870
+ const f = l.groupId;
871
+ for (; l.groupId === f && (p(l, "redo"), n += 1, l = o[n + 1], !(!l || !l.groupId)); )
872
+ ;
873
+ return c && c(), this;
874
+ },
875
+ /**
876
+ * Clears the memory, losing all stored states. Resets the index.
877
+ */
878
+ clear: function() {
879
+ let l = o.length;
880
+ o = [], n = -1, c && l > 0 && c();
881
+ },
882
+ /**
883
+ * Tests if any undo actions exist.
884
+ * @returns {boolean}
885
+ */
886
+ hasUndo: function() {
887
+ return n !== -1;
888
+ },
889
+ /**
890
+ * Tests if any redo actions exist.
891
+ * @returns {boolean}
892
+ */
893
+ hasRedo: function() {
894
+ return n < o.length - 1;
895
+ },
896
+ /**
897
+ * Returns the list of queued commands.
898
+ * @param {string} [groupId] - Optionally filter commands by group ID
899
+ * @returns {array}
900
+ */
901
+ getCommands: function(l) {
902
+ return l ? o.filter((f) => f.groupId === l) : o;
903
+ },
904
+ /**
905
+ * Returns the index of the actions list.
906
+ * @returns {number}
907
+ */
908
+ getIndex: function() {
909
+ return n;
910
+ },
911
+ /**
912
+ * Sets the maximum number of undo steps. Default: 0 (unlimited).
913
+ * @property {number} max - Maximum number of undo steps
914
+ */
915
+ setLimit: function(l) {
916
+ i = l;
917
+ }
918
+ };
919
+ };
920
+ e.exports ? e.exports = s : window.UndoManager = s;
921
+ })();
922
+ })(dt);
923
+ var Io = dt.exports;
924
+ const Mo = /* @__PURE__ */ Us(Io), Do = w(Je), Eo = w(null), Oo = () => {
925
+ const [e, t] = D(Do);
926
+ return [
927
+ zs(e) ? { ...Je, ...e } : Je,
928
+ t
929
+ ];
930
+ }, Jr = () => D(Eo), Lo = w(null), zo = () => ({ currentPage: X(Lo) }), ss = new Vt({});
931
+ function Vo(e) {
932
+ let t = ss.convert(e);
933
+ return t = !t.type && t.children && t.children.length ? t.children : ve(t) ? [] : [t], t;
934
+ }
935
+ const ut = (e, t) => ne(
936
+ e.map((s) => {
937
+ if (s = t ? { ...s, parent: t } : { ...s }, s.children) {
938
+ const o = [...s.children];
939
+ return delete s.children, ne([s, ...ut(o, s._id)]);
940
+ }
941
+ return s;
942
+ })
943
+ );
944
+ function mt(e, t = !1) {
945
+ for (let s = 0; s < e.length; s++) {
946
+ const o = e[s];
947
+ o.global && !t ? e[s] = {
948
+ type: "GlobalBlock",
949
+ blockId: o.blockId,
950
+ _parent: F(o, "parent", null),
951
+ _id: o._id
952
+ } : o.children && o.children.length && mt(o.children);
953
+ }
954
+ }
955
+ function os(e) {
956
+ let t = [], s = M(e, { type: "GlobalBlock" });
957
+ return s.length > 0 && (s = R(s, ns), ue(s, (o) => {
958
+ t = [...t, ...$o(o)];
959
+ })), t;
960
+ }
961
+ function $o(e) {
962
+ let t = [];
963
+ const s = F(Q(e), "parent", null);
964
+ Se(Q(e), "parent", null);
965
+ const o = [ss.convert(as(e))];
966
+ mt(o, !0);
967
+ let n = ut(o, e[0]._id);
968
+ return n = Se(n, "0.parent", s), t = [...t, n, ...os(n)], t;
969
+ }
970
+ function ns(e) {
971
+ const t = te(Qe, { _id: e._id });
972
+ if (!t)
973
+ return [];
974
+ const s = [t], o = M(Qe, { _parent: e._id });
975
+ return o.length ? ne([...s, ...ne(R(o, ns))]) : ne(s);
976
+ }
977
+ const as = (e) => JSON.parse(JSON.stringify(e));
978
+ let Qe = [];
979
+ function Fo(e) {
980
+ Qe = e;
981
+ const t = Vo(as(e));
982
+ mt(t);
983
+ const s = ut(t, null), o = os(s), n = {};
984
+ return ue(o, (i) => Se(n, Q(i).blockId, i)), [s, n];
985
+ }
986
+ const Uo = () => {
987
+ const [e] = Oo(), { currentPage: t } = zo(), [s] = we();
988
+ return z(() => {
989
+ const o = R(
990
+ s,
991
+ (r) => Oe(r, ["expanded", "order", "title", "siblings", "tempClasses"])
992
+ ), [n = [], i = []] = Fo(o);
993
+ return {
994
+ currentPage: t,
995
+ blocks: n,
996
+ globalBlocks: i
997
+ };
998
+ }, [e, t, s]);
999
+ }, ke = (e, t = void 0) => {
1000
+ const s = X(qt);
1001
+ return F(s, e, t);
1002
+ }, rs = w([]);
1003
+ rs.debugLabel = "dataProvidersAtom";
1004
+ const Wo = () => D(rs), ft = w("SAVED");
1005
+ ft.debugLabel = "pageSyncStateAtom";
1006
+ const Yr = () => {
1007
+ const [e, t] = D(ft), s = ke("onSaveBlocks", async () => {
1008
+ }), o = ke("onSavePage", async () => {
1009
+ }), n = ke("onSyncStatusChange", () => {
1010
+ }), i = Uo(), [r] = Wo();
1011
+ return { savePage: Ws(
1012
+ async () => {
1013
+ t("SAVING"), n("SAVING");
1014
+ const p = i();
1015
+ return await o({ blocks: p.blocks, providers: r }), setTimeout(() => {
1016
+ t("SAVED"), n("SAVED");
1017
+ }, 100), !0;
1018
+ },
1019
+ [i, t, n, s],
1020
+ 5e3
1021
+ // save only every 5 seconds
1022
+ ), syncState: e, setSyncState: t };
1023
+ }, se = new Mo();
1024
+ se.setLimit(50);
1025
+ const is = () => {
1026
+ const [, e] = D(ft);
1027
+ return Ce(() => (se.setCallback(() => e("UNSAVED")), () => {
1028
+ se.setCallback(Vs);
1029
+ }), []), {
1030
+ add: se.add,
1031
+ undo: se.undo,
1032
+ redo: se.redo,
1033
+ hasRedo: se.hasRedo,
1034
+ hasUndo: se.hasUndo,
1035
+ clear: se.clear
1036
+ };
1037
+ }, pt = (e, t) => {
1038
+ const s = [], o = M(e, (n) => q(t, n._id) || q(t, n._parent) ? (s.push(n._id), !1) : !0);
1039
+ return ve(s) ? o : pt(o, s);
1040
+ }, Qr = () => {
1041
+ const [e] = we(), [t, s] = $e(), { setNewBlocks: o } = xe();
1042
+ return z(
1043
+ (n) => {
1044
+ var r;
1045
+ const i = ((r = te(e, { _id: n[0] })) == null ? void 0 : r._parent) || null;
1046
+ o(pt(e, n)), setTimeout(() => s(i ? [i] : []), 200);
1047
+ },
1048
+ [e, s, t]
1049
+ );
1050
+ };
1051
+ function Go(e, t, s, o) {
1052
+ let n = e.filter((c) => !c._parent);
1053
+ s && (n = e.filter((c) => c._parent === s));
1054
+ const i = o !== void 0 ? o : n.length;
1055
+ let r = e.length;
1056
+ for (let c = 0, p = 0; c < e.length; c++)
1057
+ if (e[c]._parent === s) {
1058
+ if (p === i) {
1059
+ r = c;
1060
+ break;
1061
+ }
1062
+ p++;
1063
+ }
1064
+ return !s && o !== void 0 && o >= n.length && (r = e.length), [...e.slice(0, r), ...t, ...e.slice(r)];
1065
+ }
1066
+ const Ho = () => {
1067
+ const [, e] = we();
1068
+ return {
1069
+ setNewBlocks: (t) => {
1070
+ e(t);
1071
+ },
1072
+ addBlocks: (t, s, o) => {
1073
+ e((n) => Go(n, t, s, o));
1074
+ },
1075
+ removeBlocks: (t) => {
1076
+ e((s) => pt(s, t));
1077
+ },
1078
+ updateBlocksProps: (t) => {
1079
+ e((s) => {
1080
+ const o = t.map((n) => n._id);
1081
+ return s.map((n) => {
1082
+ if (o.includes(n._id)) {
1083
+ const i = te(t, { _id: n._id });
1084
+ return { ...n, ...Oe(i, "_id") };
1085
+ }
1086
+ return n;
1087
+ });
1088
+ });
1089
+ }
1090
+ };
1091
+ }, we = () => D(ie), xe = () => {
1092
+ const { add: e } = is(), [t] = we(), {
1093
+ setNewBlocks: s,
1094
+ addBlocks: o,
1095
+ removeBlocks: n,
1096
+ updateBlocksProps: i
1097
+ } = Ho();
1098
+ return {
1099
+ addBlocks: (x, N, j) => {
1100
+ o(x, N, j), e({
1101
+ undo: () => n(R(x, "_id")),
1102
+ redo: () => o(x, N, j)
1103
+ });
1104
+ },
1105
+ removeBlocks: (x) => {
1106
+ var O;
1107
+ const N = (O = Q(x)) == null ? void 0 : O._parent, I = t.filter((W) => N ? W._parent === N : !W._parent).indexOf(Q(x));
1108
+ n(R(x, "_id")), e({
1109
+ undo: () => o(x, N, I),
1110
+ redo: () => n(R(x, "_id"))
1111
+ });
1112
+ },
1113
+ updateBlocks: (x, N, j) => {
1114
+ let I = [];
1115
+ if (j)
1116
+ I = R(x, (O) => ({ _id: O, ...j }));
1117
+ else {
1118
+ const O = $s(N);
1119
+ I = R(x, (W) => {
1120
+ const G = t.find(($) => $._id === W), H = { _id: W };
1121
+ return ue(O, ($) => H[$] = G[$]), H;
1122
+ });
1123
+ }
1124
+ i(R(x, (O) => ({ _id: O, ...N }))), e({
1125
+ undo: () => i(I),
1126
+ redo: () => i(R(x, (O) => ({ _id: O, ...N })))
1127
+ });
1128
+ },
1129
+ updateBlocksRuntime: (x, N) => {
1130
+ i(R(x, (j) => ({ _id: j, ...N })));
1131
+ },
1132
+ setNewBlocks: (x) => {
1133
+ s(x), e({
1134
+ undo: () => s(t),
1135
+ redo: () => s(x)
1136
+ });
1137
+ }
1138
+ };
1139
+ }, qo = ge(
1140
+ "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",
1141
+ {
1142
+ variants: {
1143
+ variant: {
1144
+ default: "bg-transparent",
1145
+ outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
1146
+ },
1147
+ size: {
1148
+ default: "h-10 px-3",
1149
+ sm: "h-9 px-2.5",
1150
+ lg: "h-11 px-5"
1151
+ }
1152
+ },
1153
+ defaultVariants: {
1154
+ variant: "default",
1155
+ size: "default"
1156
+ }
1157
+ }
1158
+ ), Ko = m.forwardRef(({ className: e, variant: t, size: s, ...o }, n) => /* @__PURE__ */ a.jsx(Ft.Root, { ref: n, className: d(qo({ variant: t, size: s, className: e })), ...o }));
1159
+ Ko.displayName = Ft.Root.displayName;
1160
+ const Jo = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1161
+ Ye.Root,
1162
+ {
1163
+ className: d(
1164
+ "peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:focus-visible:ring-slate-800 dark:focus-visible:ring-offset-slate-950 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",
1165
+ e
1166
+ ),
1167
+ ...t,
1168
+ ref: s,
1169
+ children: /* @__PURE__ */ a.jsx(
1170
+ Ye.Thumb,
1171
+ {
1172
+ className: d(
1173
+ "pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-slate-950"
1174
+ )
1175
+ }
1176
+ )
1177
+ }
1178
+ ));
1179
+ Jo.displayName = Ye.Root.displayName;
1180
+ const gt = ge(
1181
+ "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
1182
+ {
1183
+ variants: {
1184
+ variant: {
1185
+ default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
1186
+ destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
1187
+ outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
1188
+ secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
1189
+ ghost: "hover:bg-accent hover:text-accent-foreground",
1190
+ link: "text-primary underline-offset-4 hover:underline"
1191
+ },
1192
+ size: {
1193
+ default: "h-9 px-4 py-2",
1194
+ sm: "h-8 rounded-md px-3 text-xs",
1195
+ lg: "h-10 rounded-md px-8",
1196
+ icon: "h-9 w-9"
1197
+ }
1198
+ },
1199
+ defaultVariants: {
1200
+ variant: "default",
1201
+ size: "default"
1202
+ }
1203
+ }
1204
+ ), Yo = m.forwardRef(
1205
+ ({ className: e, variant: t, size: s, asChild: o = !1, ...n }, i) => {
1206
+ const r = o ? Gs : "button";
1207
+ return /* @__PURE__ */ a.jsx(r, { className: d(gt({ variant: t, size: s, className: e })), ref: i, ...n });
1208
+ }
1209
+ );
1210
+ Yo.displayName = "Button";
1211
+ const Xr = fe.Root, Qo = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(fe.Item, { ref: s, className: d("border-b", e), ...t }));
1212
+ Qo.displayName = "AccordionItem";
1213
+ const Xo = m.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsx(fe.Header, { className: "flex", children: /* @__PURE__ */ a.jsxs(
1214
+ fe.Trigger,
1215
+ {
1216
+ ref: o,
1217
+ className: d(
1218
+ "flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
1219
+ e
1220
+ ),
1221
+ ...s,
1222
+ children: [
1223
+ t,
1224
+ /* @__PURE__ */ a.jsx(Hs, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" })
1225
+ ]
1226
+ }
1227
+ ) }));
1228
+ Xo.displayName = fe.Trigger.displayName;
1229
+ const Zo = m.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsx(
1230
+ fe.Content,
1231
+ {
1232
+ ref: o,
1233
+ className: d(
1234
+ "text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
1235
+ e
1236
+ ),
1237
+ ...s,
1238
+ children: /* @__PURE__ */ a.jsx("div", { className: "pb-4 pt-0", children: t })
1239
+ }
1240
+ ));
1241
+ Zo.displayName = fe.Content.displayName;
1242
+ const en = ge(
1243
+ "relative w-full rounded-lg border px-4 py-3 text-sm [&:has(svg)]:pl-11 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
1244
+ {
1245
+ variants: {
1246
+ variant: {
1247
+ default: "bg-background text-foreground",
1248
+ destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
1249
+ }
1250
+ },
1251
+ defaultVariants: {
1252
+ variant: "default"
1253
+ }
1254
+ }
1255
+ ), tn = m.forwardRef(({ className: e, variant: t, ...s }, o) => /* @__PURE__ */ a.jsx("div", { ref: o, role: "alert", className: d(en({ variant: t }), e), ...s }));
1256
+ tn.displayName = "Alert";
1257
+ const sn = m.forwardRef(
1258
+ ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("h5", { ref: s, className: d("mb-1 font-medium leading-none tracking-tight", e), ...t })
1259
+ );
1260
+ sn.displayName = "AlertTitle";
1261
+ const on = m.forwardRef(
1262
+ ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("div", { ref: s, className: d("text-sm [&_p]:leading-relaxed", e), ...t })
1263
+ );
1264
+ on.displayName = "AlertDescription";
1265
+ const nn = ge(
1266
+ "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
1267
+ {
1268
+ variants: {
1269
+ variant: {
1270
+ default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
1271
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
1272
+ destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
1273
+ outline: "text-foreground"
1274
+ }
1275
+ },
1276
+ defaultVariants: {
1277
+ variant: "default"
1278
+ }
1279
+ }
1280
+ ), Zr = ({ className: e, variant: t, ...s }) => /* @__PURE__ */ a.jsx("div", { className: d(nn({ variant: t }), e), ...s }), ei = U.Root, ti = U.Trigger, ls = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx(U.Portal, { className: d(e), ...t });
1281
+ ls.displayName = U.Portal.displayName;
1282
+ const cs = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1283
+ U.Overlay,
1284
+ {
1285
+ className: d(
1286
+ "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1287
+ e
1288
+ ),
1289
+ ...t,
1290
+ ref: s
1291
+ }
1292
+ ));
1293
+ cs.displayName = U.Overlay.displayName;
1294
+ const an = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsxs(ls, { children: [
1295
+ /* @__PURE__ */ a.jsx(cs, {}),
1296
+ /* @__PURE__ */ a.jsx(
1297
+ U.Content,
1298
+ {
1299
+ ref: s,
1300
+ className: d(
1301
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",
1302
+ e
1303
+ ),
1304
+ ...t
1305
+ }
1306
+ )
1307
+ ] }));
1308
+ an.displayName = U.Content.displayName;
1309
+ const rn = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("flex flex-col space-y-2 text-center sm:text-left", e), ...t });
1310
+ rn.displayName = "AlertDialogHeader";
1311
+ const ln = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...t });
1312
+ ln.displayName = "AlertDialogFooter";
1313
+ const cn = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(U.Title, { ref: s, className: d("text-lg font-semibold", e), ...t }));
1314
+ cn.displayName = U.Title.displayName;
1315
+ const dn = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(U.Description, { ref: s, className: d("text-sm text-muted-foreground", e), ...t }));
1316
+ dn.displayName = U.Description.displayName;
1317
+ const un = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(U.Action, { ref: s, className: d(gt(), e), ...t }));
1318
+ un.displayName = U.Action.displayName;
1319
+ const mn = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1320
+ U.Cancel,
1321
+ {
1322
+ ref: s,
1323
+ className: d(gt({ variant: "outline" }), "mt-2 sm:mt-0", e),
1324
+ ...t
1325
+ }
1326
+ ));
1327
+ mn.displayName = U.Cancel.displayName;
1328
+ const ds = _.Root, fn = _.Trigger, us = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx(_.Portal, { className: d(e), ...t });
1329
+ us.displayName = _.Portal.displayName;
1330
+ const ms = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1331
+ _.Overlay,
1332
+ {
1333
+ ref: s,
1334
+ className: d(
1335
+ "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1336
+ e
1337
+ ),
1338
+ ...t
1339
+ }
1340
+ ));
1341
+ ms.displayName = _.Overlay.displayName;
1342
+ const bt = m.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(us, { children: [
1343
+ /* @__PURE__ */ a.jsx(ms, {}),
1344
+ /* @__PURE__ */ a.jsxs(
1345
+ _.Content,
1346
+ {
1347
+ ref: o,
1348
+ className: d(
1349
+ "fixed left-[50%] top-[50%] z-[999] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",
1350
+ e
1351
+ ),
1352
+ ...s,
1353
+ children: [
1354
+ t,
1355
+ /* @__PURE__ */ a.jsxs(_.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
1356
+ /* @__PURE__ */ a.jsx(tt, { className: "h-4 w-4" }),
1357
+ /* @__PURE__ */ a.jsx("span", { className: "sr-only", children: "Close" })
1358
+ ] })
1359
+ ]
1360
+ }
1361
+ )
1362
+ ] }));
1363
+ bt.displayName = _.Content.displayName;
1364
+ const pn = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("flex flex-col space-y-1.5 text-center sm:text-left", e), ...t });
1365
+ pn.displayName = "DialogHeader";
1366
+ const gn = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...t });
1367
+ gn.displayName = "DialogFooter";
1368
+ const bn = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1369
+ _.Title,
1370
+ {
1371
+ ref: s,
1372
+ className: d("text-lg font-semibold leading-none tracking-tight", e),
1373
+ ...t
1374
+ }
1375
+ ));
1376
+ bn.displayName = _.Title.displayName;
1377
+ const xn = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(_.Description, { ref: s, className: d("text-sm text-muted-foreground", e), ...t }));
1378
+ xn.displayName = _.Description.displayName;
1379
+ const hn = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("div", { ref: s, className: d("rounded-xl border bg-card text-card-foreground shadow", e), ...t }));
1380
+ hn.displayName = "Card";
1381
+ const vn = m.forwardRef(
1382
+ ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("div", { ref: s, className: d("flex flex-col space-y-1.5 p-6", e), ...t })
1383
+ );
1384
+ vn.displayName = "CardHeader";
1385
+ const yn = m.forwardRef(
1386
+ ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("h3", { ref: s, className: d("font-semibold leading-none tracking-tight", e), ...t })
1387
+ );
1388
+ yn.displayName = "CardTitle";
1389
+ const wn = m.forwardRef(
1390
+ ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("p", { ref: s, className: d("text-sm text-muted-foreground", e), ...t })
1391
+ );
1392
+ wn.displayName = "CardDescription";
1393
+ const Nn = m.forwardRef(
1394
+ ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("div", { ref: s, className: d("p-6 pt-0", e), ...t })
1395
+ );
1396
+ Nn.displayName = "CardContent";
1397
+ const kn = m.forwardRef(
1398
+ ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("div", { ref: s, className: d(" flex items-center p-6 pt-0", e), ...t })
1399
+ );
1400
+ kn.displayName = "CardFooter";
1401
+ const jn = m.forwardRef(({ className: e, type: t, ...s }, o) => /* @__PURE__ */ a.jsx(
1402
+ "input",
1403
+ {
1404
+ type: t,
1405
+ className: d(
1406
+ "flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
1407
+ e
1408
+ ),
1409
+ ref: o,
1410
+ ...s
1411
+ }
1412
+ ));
1413
+ jn.displayName = "Input";
1414
+ const Sn = ge("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"), An = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(Ut.Root, { ref: s, className: d(Sn(), e), ...t }));
1415
+ An.displayName = Ut.Root.displayName;
1416
+ const Cn = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1417
+ "textarea",
1418
+ {
1419
+ className: d(
1420
+ "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
1421
+ e
1422
+ ),
1423
+ ref: s,
1424
+ ...t
1425
+ }
1426
+ ));
1427
+ Cn.displayName = "Textarea";
1428
+ const Bn = m.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(de.Root, { ref: o, className: d("relative overflow-hidden", e), ...s, children: [
1429
+ /* @__PURE__ */ a.jsx(de.Viewport, { className: "h-full w-full rounded-[inherit]", children: t }),
1430
+ /* @__PURE__ */ a.jsx(fs, {}),
1431
+ /* @__PURE__ */ a.jsx(de.Corner, {})
1432
+ ] }));
1433
+ Bn.displayName = de.Root.displayName;
1434
+ const fs = m.forwardRef(({ className: e, orientation: t = "vertical", ...s }, o) => /* @__PURE__ */ a.jsx(
1435
+ de.ScrollAreaScrollbar,
1436
+ {
1437
+ ref: o,
1438
+ orientation: t,
1439
+ className: d(
1440
+ "flex touch-none select-none transition-colors",
1441
+ t === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
1442
+ t === "horizontal" && "h-2.5 border-t border-t-transparent p-[1px]",
1443
+ e
1444
+ ),
1445
+ ...s,
1446
+ children: /* @__PURE__ */ a.jsx(de.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
1447
+ }
1448
+ ));
1449
+ fs.displayName = de.ScrollAreaScrollbar.displayName;
1450
+ const _n = be.Root, ps = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1451
+ be.List,
1452
+ {
1453
+ ref: s,
1454
+ className: d(
1455
+ "inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
1456
+ e
1457
+ ),
1458
+ ...t
1459
+ }
1460
+ ));
1461
+ ps.displayName = be.List.displayName;
1462
+ const Xe = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1463
+ be.Trigger,
1464
+ {
1465
+ ref: s,
1466
+ className: d(
1467
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all 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=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
1468
+ e
1469
+ ),
1470
+ ...t
1471
+ }
1472
+ ));
1473
+ Xe.displayName = be.Trigger.displayName;
1474
+ const Ze = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1475
+ be.Content,
1476
+ {
1477
+ ref: s,
1478
+ className: d(
1479
+ "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
1480
+ e
1481
+ ),
1482
+ ...t
1483
+ }
1484
+ ));
1485
+ Ze.displayName = be.Content.displayName;
1486
+ const si = ye.Portal, oi = ye.Provider, ni = ye.Root, ai = ye.Trigger, Rn = m.forwardRef(({ className: e, sideOffset: t = 4, ...s }, o) => /* @__PURE__ */ a.jsx(
1487
+ ye.Content,
1488
+ {
1489
+ ref: o,
1490
+ sideOffset: t,
1491
+ className: d(
1492
+ "z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1493
+ e
1494
+ ),
1495
+ ...s
1496
+ }
1497
+ ));
1498
+ Rn.displayName = ye.Content.displayName;
1499
+ const ri = Ae.Root, ii = Ae.Trigger, Tn = m.forwardRef(({ className: e, align: t = "center", sideOffset: s = 4, ...o }, n) => /* @__PURE__ */ a.jsx(Ae.Portal, { children: /* @__PURE__ */ a.jsx(
1500
+ Ae.Content,
1501
+ {
1502
+ ref: n,
1503
+ align: t,
1504
+ sideOffset: s,
1505
+ className: d(
1506
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1507
+ e
1508
+ ),
1509
+ ...o
1510
+ }
1511
+ ) }));
1512
+ Tn.displayName = Ae.Content.displayName;
1513
+ const li = C.Menu, ci = C.Group, di = C.Portal, ui = C.Sub, mi = C.RadioGroup, Pn = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1514
+ C.Root,
1515
+ {
1516
+ ref: s,
1517
+ className: d("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm", e),
1518
+ ...t
1519
+ }
1520
+ ));
1521
+ Pn.displayName = C.Root.displayName;
1522
+ const In = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1523
+ C.Trigger,
1524
+ {
1525
+ ref: s,
1526
+ className: d(
1527
+ "flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
1528
+ e
1529
+ ),
1530
+ ...t
1531
+ }
1532
+ ));
1533
+ In.displayName = C.Trigger.displayName;
1534
+ const Mn = m.forwardRef(({ className: e, inset: t, children: s, ...o }, n) => /* @__PURE__ */ a.jsxs(
1535
+ C.SubTrigger,
1536
+ {
1537
+ ref: n,
1538
+ className: d(
1539
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
1540
+ t && "pl-8",
1541
+ e
1542
+ ),
1543
+ ...o,
1544
+ children: [
1545
+ s,
1546
+ /* @__PURE__ */ a.jsx(st, { className: "ml-auto h-4 w-4" })
1547
+ ]
1548
+ }
1549
+ ));
1550
+ Mn.displayName = C.SubTrigger.displayName;
1551
+ const Dn = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1552
+ C.SubContent,
1553
+ {
1554
+ ref: s,
1555
+ className: d(
1556
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1557
+ e
1558
+ ),
1559
+ ...t
1560
+ }
1561
+ ));
1562
+ Dn.displayName = C.SubContent.displayName;
1563
+ const En = m.forwardRef(({ className: e, align: t = "start", alignOffset: s = -4, sideOffset: o = 8, ...n }, i) => /* @__PURE__ */ a.jsx(C.Portal, { children: /* @__PURE__ */ a.jsx(
1564
+ C.Content,
1565
+ {
1566
+ ref: i,
1567
+ align: t,
1568
+ alignOffset: s,
1569
+ sideOffset: o,
1570
+ className: d(
1571
+ "z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1572
+ e
1573
+ ),
1574
+ ...n
1575
+ }
1576
+ ) }));
1577
+ En.displayName = C.Content.displayName;
1578
+ const On = m.forwardRef(({ className: e, inset: t, ...s }, o) => /* @__PURE__ */ a.jsx(
1579
+ C.Item,
1580
+ {
1581
+ ref: o,
1582
+ className: d(
1583
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1584
+ t && "pl-8",
1585
+ e
1586
+ ),
1587
+ ...s
1588
+ }
1589
+ ));
1590
+ On.displayName = C.Item.displayName;
1591
+ const Ln = m.forwardRef(({ className: e, children: t, checked: s, ...o }, n) => /* @__PURE__ */ a.jsxs(
1592
+ C.CheckboxItem,
1593
+ {
1594
+ ref: n,
1595
+ className: d(
1596
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1597
+ e
1598
+ ),
1599
+ checked: s,
1600
+ ...o,
1601
+ children: [
1602
+ /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(C.ItemIndicator, { children: /* @__PURE__ */ a.jsx(ze, { className: "h-4 w-4" }) }) }),
1603
+ t
1604
+ ]
1605
+ }
1606
+ ));
1607
+ Ln.displayName = C.CheckboxItem.displayName;
1608
+ const zn = m.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(
1609
+ C.RadioItem,
1610
+ {
1611
+ ref: o,
1612
+ className: d(
1613
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1614
+ e
1615
+ ),
1616
+ ...s,
1617
+ children: [
1618
+ /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(C.ItemIndicator, { children: /* @__PURE__ */ a.jsx(ot, { className: "h-4 w-4 fill-current" }) }) }),
1619
+ t
1620
+ ]
1621
+ }
1622
+ ));
1623
+ zn.displayName = C.RadioItem.displayName;
1624
+ const Vn = m.forwardRef(({ className: e, inset: t, ...s }, o) => /* @__PURE__ */ a.jsx(
1625
+ C.Label,
1626
+ {
1627
+ ref: o,
1628
+ className: d("px-2 py-1.5 text-sm font-semibold", t && "pl-8", e),
1629
+ ...s
1630
+ }
1631
+ ));
1632
+ Vn.displayName = C.Label.displayName;
1633
+ const $n = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(C.Separator, { ref: s, className: d("-mx-1 my-1 h-px bg-muted", e), ...t }));
1634
+ $n.displayName = C.Separator.displayName;
1635
+ const Fn = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("span", { className: d("ml-auto text-xs tracking-widest text-muted-foreground", e), ...t });
1636
+ Fn.displayname = "MenubarShortcut";
1637
+ const fi = Ve.Root, pi = Ve.Trigger, Un = m.forwardRef(({ className: e, align: t = "center", sideOffset: s = 4, ...o }, n) => /* @__PURE__ */ a.jsx(
1638
+ Ve.Content,
1639
+ {
1640
+ ref: n,
1641
+ align: t,
1642
+ sideOffset: s,
1643
+ className: d(
1644
+ "z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1645
+ e
1646
+ ),
1647
+ ...o
1648
+ }
1649
+ ));
1650
+ Un.displayName = Ve.Content.displayName;
1651
+ const gi = L.Root, bi = L.Group, xi = L.Value, Wn = m.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(
1652
+ L.Trigger,
1653
+ {
1654
+ ref: o,
1655
+ className: d(
1656
+ "flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
1657
+ e
1658
+ ),
1659
+ ...s,
1660
+ children: [
1661
+ t,
1662
+ /* @__PURE__ */ a.jsx(L.Icon, { asChild: !0, children: /* @__PURE__ */ a.jsx(qs, { className: "h-4 w-4 opacity-50" }) })
1663
+ ]
1664
+ }
1665
+ ));
1666
+ Wn.displayName = L.Trigger.displayName;
1667
+ const Gn = m.forwardRef(({ className: e, children: t, position: s = "popper", ...o }, n) => /* @__PURE__ */ a.jsx(L.Portal, { children: /* @__PURE__ */ a.jsx(
1668
+ L.Content,
1669
+ {
1670
+ ref: n,
1671
+ className: d(
1672
+ "relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1673
+ s === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
1674
+ e
1675
+ ),
1676
+ position: s,
1677
+ ...o,
1678
+ children: /* @__PURE__ */ a.jsx(
1679
+ L.Viewport,
1680
+ {
1681
+ className: d(
1682
+ "p-1",
1683
+ s === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
1684
+ ),
1685
+ children: t
1686
+ }
1687
+ )
1688
+ }
1689
+ ) }));
1690
+ Gn.displayName = L.Content.displayName;
1691
+ const Hn = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(L.Label, { ref: s, className: d("px-2 py-1.5 text-sm font-semibold", e), ...t }));
1692
+ Hn.displayName = L.Label.displayName;
1693
+ const qn = m.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(
1694
+ L.Item,
1695
+ {
1696
+ ref: o,
1697
+ className: d(
1698
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1699
+ e
1700
+ ),
1701
+ ...s,
1702
+ children: [
1703
+ /* @__PURE__ */ a.jsx("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(L.ItemIndicator, { children: /* @__PURE__ */ a.jsx(ze, { className: "h-4 w-4" }) }) }),
1704
+ /* @__PURE__ */ a.jsx(L.ItemText, { children: t })
1705
+ ]
1706
+ }
1707
+ ));
1708
+ qn.displayName = L.Item.displayName;
1709
+ const Kn = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(L.Separator, { ref: s, className: d("-mx-1 my-1 h-px bg-muted", e), ...t }));
1710
+ Kn.displayName = L.Separator.displayName;
1711
+ const hi = _.Root, vi = _.Trigger, yi = _.Close, gs = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx(_.Portal, { className: d(e), ...t });
1712
+ gs.displayName = _.Portal.displayName;
1713
+ const bs = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1714
+ _.Overlay,
1715
+ {
1716
+ className: d(
1717
+ "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1718
+ e
1719
+ ),
1720
+ ...t,
1721
+ ref: s
1722
+ }
1723
+ ));
1724
+ bs.displayName = _.Overlay.displayName;
1725
+ const Jn = ge(
1726
+ "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
1727
+ {
1728
+ variants: {
1729
+ side: {
1730
+ top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
1731
+ bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
1732
+ left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
1733
+ right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
1734
+ }
1735
+ },
1736
+ defaultVariants: {
1737
+ side: "right"
1738
+ }
1739
+ }
1740
+ ), Yn = m.forwardRef(
1741
+ ({ side: e = "right", className: t, children: s, ...o }, n) => /* @__PURE__ */ a.jsxs(gs, { children: [
1742
+ /* @__PURE__ */ a.jsx(bs, {}),
1743
+ /* @__PURE__ */ a.jsxs(_.Content, { ref: n, className: d(Jn({ side: e }), t), ...o, children: [
1744
+ s,
1745
+ /* @__PURE__ */ a.jsxs(_.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
1746
+ /* @__PURE__ */ a.jsx(tt, { className: "h-4 w-4" }),
1747
+ /* @__PURE__ */ a.jsx("span", { className: "sr-only", children: "Close" })
1748
+ ] })
1749
+ ] })
1750
+ ] })
1751
+ );
1752
+ Yn.displayName = _.Content.displayName;
1753
+ const Qn = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("flex flex-col space-y-2 text-center sm:text-left", e), ...t });
1754
+ Qn.displayName = "SheetHeader";
1755
+ const Xn = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...t });
1756
+ Xn.displayName = "SheetFooter";
1757
+ const Zn = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(_.Title, { ref: s, className: d("text-lg font-semibold text-foreground", e), ...t }));
1758
+ Zn.displayName = _.Title.displayName;
1759
+ const ea = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(_.Description, { ref: s, className: d("text-sm text-muted-foreground", e), ...t }));
1760
+ ea.displayName = _.Description.displayName;
1761
+ const wi = T.Root, Ni = T.Trigger, ki = T.Group, ji = T.Portal, Si = T.Sub, Ai = T.RadioGroup, ta = m.forwardRef(({ className: e, inset: t, children: s, ...o }, n) => /* @__PURE__ */ a.jsxs(
1762
+ T.SubTrigger,
1763
+ {
1764
+ ref: n,
1765
+ className: d(
1766
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
1767
+ t && "pl-8",
1768
+ e
1769
+ ),
1770
+ ...o,
1771
+ children: [
1772
+ s,
1773
+ /* @__PURE__ */ a.jsx(st, { className: "ml-auto h-4 w-4" })
1774
+ ]
1775
+ }
1776
+ ));
1777
+ ta.displayName = T.SubTrigger.displayName;
1778
+ const sa = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1779
+ T.SubContent,
1780
+ {
1781
+ ref: s,
1782
+ className: d(
1783
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1784
+ e
1785
+ ),
1786
+ ...t
1787
+ }
1788
+ ));
1789
+ sa.displayName = T.SubContent.displayName;
1790
+ const oa = m.forwardRef(({ className: e, sideOffset: t = 4, ...s }, o) => /* @__PURE__ */ a.jsx(T.Portal, { children: /* @__PURE__ */ a.jsx(
1791
+ T.Content,
1792
+ {
1793
+ ref: o,
1794
+ sideOffset: t,
1795
+ className: d(
1796
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
1797
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1798
+ e
1799
+ ),
1800
+ ...s
1801
+ }
1802
+ ) }));
1803
+ oa.displayName = T.Content.displayName;
1804
+ const na = m.forwardRef(({ className: e, inset: t, ...s }, o) => /* @__PURE__ */ a.jsx(
1805
+ T.Item,
1806
+ {
1807
+ ref: o,
1808
+ className: d(
1809
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1810
+ t && "pl-8",
1811
+ e
1812
+ ),
1813
+ ...s
1814
+ }
1815
+ ));
1816
+ na.displayName = T.Item.displayName;
1817
+ const aa = m.forwardRef(({ className: e, children: t, checked: s, ...o }, n) => /* @__PURE__ */ a.jsxs(
1818
+ T.CheckboxItem,
1819
+ {
1820
+ ref: n,
1821
+ className: d(
1822
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1823
+ e
1824
+ ),
1825
+ checked: s,
1826
+ ...o,
1827
+ children: [
1828
+ /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(T.ItemIndicator, { children: /* @__PURE__ */ a.jsx(ze, { className: "h-4 w-4" }) }) }),
1829
+ t
1830
+ ]
1831
+ }
1832
+ ));
1833
+ aa.displayName = T.CheckboxItem.displayName;
1834
+ const ra = m.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(
1835
+ T.RadioItem,
1836
+ {
1837
+ ref: o,
1838
+ className: d(
1839
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1840
+ e
1841
+ ),
1842
+ ...s,
1843
+ children: [
1844
+ /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(T.ItemIndicator, { children: /* @__PURE__ */ a.jsx(ot, { className: "h-4 w-4 fill-current" }) }) }),
1845
+ t
1846
+ ]
1847
+ }
1848
+ ));
1849
+ ra.displayName = T.RadioItem.displayName;
1850
+ const ia = m.forwardRef(({ className: e, inset: t, ...s }, o) => /* @__PURE__ */ a.jsx(
1851
+ T.Label,
1852
+ {
1853
+ ref: o,
1854
+ className: d("px-2 py-1.5 text-sm font-semibold", t && "pl-8", e),
1855
+ ...s
1856
+ }
1857
+ ));
1858
+ ia.displayName = T.Label.displayName;
1859
+ const la = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(T.Separator, { ref: s, className: d("-mx-1 my-1 h-px bg-muted", e), ...t }));
1860
+ la.displayName = T.Separator.displayName;
1861
+ const ca = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("span", { className: d("ml-auto text-xs tracking-widest opacity-60", e), ...t });
1862
+ ca.displayName = "DropdownMenuShortcut";
1863
+ const da = m.forwardRef(({ className: e, orientation: t = "horizontal", decorative: s = !0, ...o }, n) => /* @__PURE__ */ a.jsx(
1864
+ Wt.Root,
1865
+ {
1866
+ ref: n,
1867
+ decorative: s,
1868
+ orientation: t,
1869
+ className: d("shrink-0 bg-border", t === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", e),
1870
+ ...o
1871
+ }
1872
+ ));
1873
+ da.displayName = Wt.Root.displayName;
1874
+ const ua = 1, ma = 1e6;
1875
+ let Ge = 0;
1876
+ function fa() {
1877
+ return Ge = (Ge + 1) % Number.MAX_VALUE, Ge.toString();
1878
+ }
1879
+ const He = /* @__PURE__ */ new Map(), Rt = (e) => {
1880
+ if (He.has(e))
1881
+ return;
1882
+ const t = setTimeout(() => {
1883
+ He.delete(e), je({
1884
+ type: "REMOVE_TOAST",
1885
+ toastId: e
1886
+ });
1887
+ }, ma);
1888
+ He.set(e, t);
1889
+ }, pa = (e, t) => {
1890
+ switch (t.type) {
1891
+ case "ADD_TOAST":
1892
+ return {
1893
+ ...e,
1894
+ toasts: [t.toast, ...e.toasts].slice(0, ua)
1895
+ };
1896
+ case "UPDATE_TOAST":
1897
+ return {
1898
+ ...e,
1899
+ toasts: e.toasts.map((s) => s.id === t.toast.id ? { ...s, ...t.toast } : s)
1900
+ };
1901
+ case "DISMISS_TOAST": {
1902
+ const { toastId: s } = t;
1903
+ return s ? Rt(s) : e.toasts.forEach((o) => {
1904
+ Rt(o.id);
1905
+ }), {
1906
+ ...e,
1907
+ toasts: e.toasts.map(
1908
+ (o) => o.id === s || s === void 0 ? {
1909
+ ...o,
1910
+ open: !1
1911
+ } : o
1912
+ )
1913
+ };
1914
+ }
1915
+ case "REMOVE_TOAST":
1916
+ return t.toastId === void 0 ? {
1917
+ ...e,
1918
+ toasts: []
1919
+ } : {
1920
+ ...e,
1921
+ toasts: e.toasts.filter((s) => s.id !== t.toastId)
1922
+ };
1923
+ }
1924
+ }, Ie = [];
1925
+ let Me = { toasts: [] };
1926
+ function je(e) {
1927
+ Me = pa(Me, e), Ie.forEach((t) => {
1928
+ t(Me);
1929
+ });
1930
+ }
1931
+ function ga({ ...e }) {
1932
+ const t = fa(), s = (n) => je({
1933
+ type: "UPDATE_TOAST",
1934
+ toast: { ...n, id: t }
1935
+ }), o = () => je({ type: "DISMISS_TOAST", toastId: t });
1936
+ return je({
1937
+ type: "ADD_TOAST",
1938
+ toast: {
1939
+ ...e,
1940
+ id: t,
1941
+ open: !0,
1942
+ onOpenChange: (n) => {
1943
+ n || o();
1944
+ }
1945
+ }
1946
+ }), {
1947
+ id: t,
1948
+ dismiss: o,
1949
+ update: s
1950
+ };
1951
+ }
1952
+ function xs() {
1953
+ const [e, t] = m.useState(Me);
1954
+ return m.useEffect(() => (Ie.push(t), () => {
1955
+ const s = Ie.indexOf(t);
1956
+ s > -1 && Ie.splice(s, 1);
1957
+ }), [e]), {
1958
+ ...e,
1959
+ toast: ga,
1960
+ dismiss: (s) => je({ type: "DISMISS_TOAST", toastId: s })
1961
+ };
1962
+ }
1963
+ const ba = Y.Provider, hs = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1964
+ Y.Viewport,
1965
+ {
1966
+ ref: s,
1967
+ className: d(
1968
+ "fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
1969
+ e
1970
+ ),
1971
+ ...t
1972
+ }
1973
+ ));
1974
+ hs.displayName = Y.Viewport.displayName;
1975
+ const xa = ge(
1976
+ "group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
1977
+ {
1978
+ variants: {
1979
+ variant: {
1980
+ default: "border bg-background",
1981
+ destructive: "destructive group border-destructive bg-destructive text-destructive-foreground"
1982
+ }
1983
+ },
1984
+ defaultVariants: {
1985
+ variant: "default"
1986
+ }
1987
+ }
1988
+ ), vs = m.forwardRef(({ className: e, variant: t, ...s }, o) => /* @__PURE__ */ a.jsx(Y.Root, { ref: o, className: d(xa({ variant: t }), e), ...s }));
1989
+ vs.displayName = Y.Root.displayName;
1990
+ const ha = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1991
+ Y.Action,
1992
+ {
1993
+ ref: s,
1994
+ className: d(
1995
+ "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
1996
+ e
1997
+ ),
1998
+ ...t
1999
+ }
2000
+ ));
2001
+ ha.displayName = Y.Action.displayName;
2002
+ const ys = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2003
+ Y.Close,
2004
+ {
2005
+ ref: s,
2006
+ className: d(
2007
+ "absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
2008
+ e
2009
+ ),
2010
+ "toast-close": "",
2011
+ ...t,
2012
+ children: /* @__PURE__ */ a.jsx(tt, { className: "h-4 w-4" })
2013
+ }
2014
+ ));
2015
+ ys.displayName = Y.Close.displayName;
2016
+ const ws = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(Y.Title, { ref: s, className: d("text-sm font-semibold [&+div]:text-xs", e), ...t }));
2017
+ ws.displayName = Y.Title.displayName;
2018
+ const Ns = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(Y.Description, { ref: s, className: d("text-sm opacity-90", e), ...t }));
2019
+ Ns.displayName = Y.Description.displayName;
2020
+ function Ci() {
2021
+ const { toasts: e } = xs();
2022
+ return /* @__PURE__ */ a.jsxs(ba, { children: [
2023
+ e.map(({ id: t, title: s, description: o, action: n, ...i }) => /* @__PURE__ */ a.jsxs(vs, { ...i, children: [
2024
+ /* @__PURE__ */ a.jsxs("div", { className: "grid gap-1", children: [
2025
+ s && /* @__PURE__ */ a.jsx(ws, { children: s }),
2026
+ o && /* @__PURE__ */ a.jsx(Ns, { children: o })
2027
+ ] }),
2028
+ n,
2029
+ /* @__PURE__ */ a.jsx(ys, {})
2030
+ ] }, t)),
2031
+ /* @__PURE__ */ a.jsx(hs, {})
2032
+ ] });
2033
+ }
2034
+ const Bi = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("animate-pulse rounded-md bg-primary/10", e), ...t }), ks = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2035
+ K,
2036
+ {
2037
+ ref: s,
2038
+ className: d(
2039
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
2040
+ e
2041
+ ),
2042
+ ...t
2043
+ }
2044
+ ));
2045
+ ks.displayName = K.displayName;
2046
+ const _i = ({ children: e, ...t }) => /* @__PURE__ */ a.jsx(ds, { ...t, children: /* @__PURE__ */ a.jsx(bt, { className: "overflow-hidden p-0", children: /* @__PURE__ */ a.jsx(ks, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: e }) }) }), va = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
2047
+ /* @__PURE__ */ a.jsx(Ks, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
2048
+ /* @__PURE__ */ a.jsx(
2049
+ K.Input,
2050
+ {
2051
+ ref: s,
2052
+ className: d(
2053
+ "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
2054
+ e
2055
+ ),
2056
+ ...t
2057
+ }
2058
+ )
2059
+ ] }));
2060
+ va.displayName = K.Input.displayName;
2061
+ const ya = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2062
+ K.List,
2063
+ {
2064
+ ref: s,
2065
+ className: d("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
2066
+ ...t
2067
+ }
2068
+ ));
2069
+ ya.displayName = K.List.displayName;
2070
+ const wa = m.forwardRef((e, t) => /* @__PURE__ */ a.jsx(K.Empty, { ref: t, className: "py-6 text-center text-sm", ...e }));
2071
+ wa.displayName = K.Empty.displayName;
2072
+ const Na = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2073
+ K.Group,
2074
+ {
2075
+ ref: s,
2076
+ className: d(
2077
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
2078
+ e
2079
+ ),
2080
+ ...t
2081
+ }
2082
+ ));
2083
+ Na.displayName = K.Group.displayName;
2084
+ const ka = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(K.Separator, { ref: s, className: d("-mx-1 h-px bg-border", e), ...t }));
2085
+ ka.displayName = K.Separator.displayName;
2086
+ const ja = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2087
+ K.Item,
2088
+ {
2089
+ ref: s,
2090
+ className: d(
2091
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2092
+ e
2093
+ ),
2094
+ ...t
2095
+ }
2096
+ ));
2097
+ ja.displayName = K.Item.displayName;
2098
+ const Sa = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("span", { className: d("ml-auto text-xs tracking-widest text-muted-foreground", e), ...t });
2099
+ Sa.displayName = "CommandShortcut";
2100
+ const Ri = P.Root, Ti = P.Trigger, Pi = P.Group, Ii = P.Portal, Mi = P.Sub, Di = P.RadioGroup, Aa = m.forwardRef(({ className: e, inset: t, children: s, ...o }, n) => /* @__PURE__ */ a.jsxs(
2101
+ P.SubTrigger,
2102
+ {
2103
+ ref: n,
2104
+ className: d(
2105
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
2106
+ t && "pl-8",
2107
+ e
2108
+ ),
2109
+ ...o,
2110
+ children: [
2111
+ s,
2112
+ /* @__PURE__ */ a.jsx(st, { className: "ml-auto h-4 w-4" })
2113
+ ]
2114
+ }
2115
+ ));
2116
+ Aa.displayName = P.SubTrigger.displayName;
2117
+ const Ca = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2118
+ P.SubContent,
2119
+ {
2120
+ ref: s,
2121
+ className: d(
2122
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
2123
+ e
2124
+ ),
2125
+ ...t
2126
+ }
2127
+ ));
2128
+ Ca.displayName = P.SubContent.displayName;
2129
+ const Ba = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(P.Portal, { children: /* @__PURE__ */ a.jsx(
2130
+ P.Content,
2131
+ {
2132
+ ref: s,
2133
+ className: d(
2134
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
2135
+ e
2136
+ ),
2137
+ ...t
2138
+ }
2139
+ ) }));
2140
+ Ba.displayName = P.Content.displayName;
2141
+ const _a = m.forwardRef(({ className: e, inset: t, ...s }, o) => /* @__PURE__ */ a.jsx(
2142
+ P.Item,
2143
+ {
2144
+ ref: o,
2145
+ className: d(
2146
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2147
+ t && "pl-8",
2148
+ e
2149
+ ),
2150
+ ...s
2151
+ }
2152
+ ));
2153
+ _a.displayName = P.Item.displayName;
2154
+ const Ra = m.forwardRef(({ className: e, children: t, checked: s, ...o }, n) => /* @__PURE__ */ a.jsxs(
2155
+ P.CheckboxItem,
2156
+ {
2157
+ ref: n,
2158
+ className: d(
2159
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2160
+ e
2161
+ ),
2162
+ checked: s,
2163
+ ...o,
2164
+ children: [
2165
+ /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(P.ItemIndicator, { children: /* @__PURE__ */ a.jsx(ze, { className: "h-4 w-4" }) }) }),
2166
+ t
2167
+ ]
2168
+ }
2169
+ ));
2170
+ Ra.displayName = P.CheckboxItem.displayName;
2171
+ const Ta = m.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(
2172
+ P.RadioItem,
2173
+ {
2174
+ ref: o,
2175
+ className: d(
2176
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2177
+ e
2178
+ ),
2179
+ ...s,
2180
+ children: [
2181
+ /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(P.ItemIndicator, { children: /* @__PURE__ */ a.jsx(ot, { className: "h-4 w-4 fill-current" }) }) }),
2182
+ t
2183
+ ]
2184
+ }
2185
+ ));
2186
+ Ta.displayName = P.RadioItem.displayName;
2187
+ const Pa = m.forwardRef(({ className: e, inset: t, ...s }, o) => /* @__PURE__ */ a.jsx(
2188
+ P.Label,
2189
+ {
2190
+ ref: o,
2191
+ className: d("px-2 py-1.5 text-sm font-semibold text-foreground", t && "pl-8", e),
2192
+ ...s
2193
+ }
2194
+ ));
2195
+ Pa.displayName = P.Label.displayName;
2196
+ const Ia = m.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(P.Separator, { ref: s, className: d("-mx-1 my-1 h-px bg-border", e), ...t }));
2197
+ Ia.displayName = P.Separator.displayName;
2198
+ const Ma = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("span", { className: d("ml-auto text-xs tracking-widest text-muted-foreground", e), ...t });
2199
+ Ma.displayName = "ContextMenuShortcut";
2200
+ const Da = (e) => {
2201
+ try {
2202
+ const t = document.getElementById("icon-picker-field"), s = document.createElement("div");
2203
+ Qs.render(/* @__PURE__ */ a.jsx(Ys, { value: e }), s), t.appendChild(s), s.hidden = !0;
2204
+ let o = s.innerHTML;
2205
+ setTimeout(() => t.removeChild(s), 100);
2206
+ const i = new DOMParser().parseFromString(o, "image/svg+xml"), r = i.querySelector("svg");
2207
+ return r && (r.removeAttribute("width"), r.removeAttribute("height")), new XMLSerializer().serializeToString(i);
2208
+ } catch (t) {
2209
+ return console.error(t), "";
2210
+ }
2211
+ }, Ei = ({ value: e, onChange: t }) => {
2212
+ const s = (o) => {
2213
+ t("<svg />");
2214
+ const n = Da(o);
2215
+ t(n);
2216
+ };
2217
+ return /* @__PURE__ */ a.jsxs("div", { className: "mt-1 flex h-20 items-center gap-x-2", id: "icon-picker-field", children: [
2218
+ /* @__PURE__ */ a.jsxs("div", { className: "group relative h-12 w-12", children: [
2219
+ /* @__PURE__ */ a.jsx(
2220
+ "div",
2221
+ {
2222
+ dangerouslySetInnerHTML: {
2223
+ __html: e ? e.replace("<svg", '<svg class="h-5 w-5"') : "<svg class='h-5 w-5' />"
2224
+ },
2225
+ className: "absolute left-1/2 top-1/2 z-0 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer bg-white"
2226
+ }
2227
+ ),
2228
+ /* @__PURE__ */ a.jsx(
2229
+ Js,
2230
+ {
2231
+ value: e ? "BiSolidGrid" : null,
2232
+ onChange: s,
2233
+ pickButtonStyle: {
2234
+ position: "relative",
2235
+ height: "48px",
2236
+ width: "48px",
2237
+ border: "1px solid #BBBBBB",
2238
+ display: "flex",
2239
+ alignItems: "center",
2240
+ justifyContent: "center",
2241
+ borderRadius: "6px",
2242
+ backgroundColor: "transparent",
2243
+ zIndex: 1
2244
+ },
2245
+ searchInputStyle: {
2246
+ backgroundColor: "transparent",
2247
+ width: "100%",
2248
+ border: "1px solid #BBBBBB",
2249
+ margin: "0px 10px",
2250
+ padding: "10px"
2251
+ }
2252
+ }
2253
+ )
2254
+ ] }),
2255
+ /* @__PURE__ */ a.jsx(
2256
+ "textarea",
2257
+ {
2258
+ value: e,
2259
+ onChange: (o) => t(o.target.value),
2260
+ className: "h-full w-full rounded-sm border border-foreground/20 px-2 py-1 text-xs shadow-sm focus:border-gray-500/80 focus:outline-none focus:ring-0",
2261
+ placeholder: "Choose icon or enter svg"
2262
+ }
2263
+ )
2264
+ ] });
2265
+ }, Ea = et.lazy(() => import("./UnsplashImages-GhBD6owT.js")), Oa = et.lazy(() => import("./UploadImages-S1HgxeGb.js")), js = ({
2266
+ isModalView: e = !1,
2267
+ onSelect: t = () => {
2268
+ }
2269
+ }) => {
2270
+ const [s, o] = Ee("upload");
2271
+ return /* @__PURE__ */ a.jsxs("div", { className: "flex h-full flex-col", children: [
2272
+ /* @__PURE__ */ a.jsx("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: /* @__PURE__ */ a.jsx("h1", { className: "px-1 font-semibold", children: e ? "Select or upload images" : "Images" }) }),
2273
+ /* @__PURE__ */ a.jsxs(_n, { value: s, onValueChange: (n) => o(n), className: "flex h-full w-full flex-col py-2", children: [
2274
+ /* @__PURE__ */ a.jsxs(ps, { className: "w-full", children: [
2275
+ /* @__PURE__ */ a.jsx(Xe, { value: "upload", className: "w-1/2", children: "Upload" }),
2276
+ /* @__PURE__ */ a.jsx(Xe, { value: "unsplash", className: "w-1/2", children: "Unsplash" })
2277
+ ] }),
2278
+ s === "unsplash" ? /* @__PURE__ */ a.jsx(Ze, { value: "unsplash", className: "flex h-full flex-col overflow-hidden", children: /* @__PURE__ */ a.jsx(ht, { fallback: /* @__PURE__ */ a.jsx("div", { className: "h-64 w-full animate-pulse bg-gray-100" }), children: /* @__PURE__ */ a.jsx(Ea, { isModalView: e, onSelect: t }) }) }) : /* @__PURE__ */ a.jsx(Ze, { value: "upload", className: "flex h-full flex-col overflow-hidden", children: /* @__PURE__ */ a.jsx(ht, { fallback: /* @__PURE__ */ a.jsx("div", { className: "h-64 w-full animate-pulse bg-gray-100" }), children: /* @__PURE__ */ a.jsx(Oa, { isModalView: e, onSelect: t }) }) })
2279
+ ] })
2280
+ ] });
2281
+ }, Oi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2282
+ __proto__: null,
2283
+ default: js
2284
+ }, Symbol.toStringTag, { value: "Module" })), Tt = ({ children: e, onSelect: t }) => {
2285
+ const [s, o] = Ee(!1), n = (...i) => {
2286
+ t.call(void 0, ...i), o(!1);
2287
+ };
2288
+ return /* @__PURE__ */ a.jsxs(ds, { open: s, onOpenChange: (i) => o(i), children: [
2289
+ /* @__PURE__ */ a.jsx(fn, { asChild: !0, children: e }),
2290
+ /* @__PURE__ */ a.jsx(bt, { className: "flex h-3/4 max-w-5xl", children: /* @__PURE__ */ a.jsx("div", { className: "h-full w-full", children: /* @__PURE__ */ a.jsx(js, { isModalView: !0, onSelect: n }) }) })
2291
+ ] });
2292
+ }, Li = ({ value: e, onChange: t, id: s, onBlur: o }) => /* @__PURE__ */ a.jsxs("div", { className: "mt-1.5 flex items-center gap-x-3", children: [
2293
+ e ? /* @__PURE__ */ a.jsx("img", { src: e, className: "h-20 w-20 overflow-hidden rounded-md border object-cover", alt: "" }) : /* @__PURE__ */ a.jsx(Tt, { onSelect: t, children: /* @__PURE__ */ a.jsx("div", { className: "h-20 w-20 cursor-pointer rounded-md border bg-[radial-gradient(#AAA,transparent_1px)] duration-300 [background-size:10px_10px] hover:border-gray-400" }) }),
2294
+ /* @__PURE__ */ a.jsxs("div", { className: "flex w-3/5 flex-col", children: [
2295
+ /* @__PURE__ */ a.jsx(Tt, { onSelect: t, children: /* @__PURE__ */ a.jsx("small", { className: "cursor-pointer rounded-full bg-gray-600 px-2 py-1 text-center text-xs text-white hover:bg-gray-500 dark:bg-gray-700", children: e || !ve(e) ? "Replace Image" : "Choose Image" }) }),
2296
+ /* @__PURE__ */ a.jsx("small", { className: "-pl-4 pt-2 text-center text-xs text-gray-600", children: "OR" }),
2297
+ /* @__PURE__ */ a.jsx(
2298
+ "input",
2299
+ {
2300
+ type: "url",
2301
+ className: "text-xs",
2302
+ placeholder: "Enter image URL",
2303
+ value: e,
2304
+ onBlur: ({ target: { value: n } }) => o(s, n),
2305
+ onChange: (n) => t(n.target.value)
2306
+ }
2307
+ )
2308
+ ] })
2309
+ ] }), zi = ({ id: e, placeholder: t, value: s, onChange: o, onBlur: n }) => {
2310
+ const i = {
2311
+ toolbar: [
2312
+ ["bold", "italic", "underline", "strike", "blockquote"],
2313
+ [{ list: "ordered" }, { list: "bullet" }],
2314
+ [{ color: [] }, { background: [] }, { align: [] }],
2315
+ ["link", "clean"]
2316
+ ]
2317
+ }, r = [
2318
+ "header",
2319
+ "font",
2320
+ "list",
2321
+ "bold",
2322
+ "italic",
2323
+ "underline",
2324
+ "strike",
2325
+ "blockquote",
2326
+ "color",
2327
+ "background",
2328
+ "align",
2329
+ "link",
2330
+ "image"
2331
+ ];
2332
+ return typeof window > "u" ? null : /* @__PURE__ */ a.jsx(
2333
+ Xs,
2334
+ {
2335
+ id: e,
2336
+ value: s,
2337
+ onBlur: (c) => n(e, c),
2338
+ onChange: (c) => o(c),
2339
+ modules: i,
2340
+ formats: r,
2341
+ placeholder: t,
2342
+ className: "mt-1 rounded-md"
2343
+ }
2344
+ );
2345
+ }, Vi = ({ schema: e, formData: t, onChange: s }) => {
2346
+ const [o, n] = Ee([]), i = ke("getPages", () => []), { type: r = "page", href: c = "", target: p = "self" } = t;
2347
+ return Ce(() => {
2348
+ (async () => {
2349
+ const l = await i();
2350
+ n(l || []);
2351
+ })();
2352
+ }, []), /* @__PURE__ */ a.jsxs("div", { children: [
2353
+ /* @__PURE__ */ a.jsx("span", { className: "text-xs font-medium", children: (e == null ? void 0 : e.title) ?? "Link" }),
2354
+ /* @__PURE__ */ a.jsxs("div", { className: "flex flex-col gap-y-1.5", children: [
2355
+ /* @__PURE__ */ a.jsx("select", { name: "type", value: r, onChange: (l) => s({ ...t, type: l.target.value }), children: [
2356
+ { const: "page", title: "Open Page" },
2357
+ { const: "url", title: "Open URL" },
2358
+ { const: "email", title: "Compose Email" },
2359
+ { const: "telephone", title: "Call Phone" },
2360
+ { const: "scroll", title: "Scroll to element" }
2361
+ ].map((l) => /* @__PURE__ */ a.jsx("option", { value: l.const, children: l.title }, l.const)) }),
2362
+ r === "page" ? /* @__PURE__ */ a.jsxs(
2363
+ "select",
2364
+ {
2365
+ name: "href",
2366
+ placeholder: "Choose Page",
2367
+ value: c,
2368
+ onChange: (l) => s({ ...t, href: l.target.value }),
2369
+ children: [
2370
+ /* @__PURE__ */ a.jsx("option", { value: "", children: "Choose page" }),
2371
+ R(o, (l) => /* @__PURE__ */ a.jsx("option", { value: l.slug, children: l.name }, l.uuid))
2372
+ ]
2373
+ }
2374
+ ) : /* @__PURE__ */ a.jsx(
2375
+ "input",
2376
+ {
2377
+ name: "href",
2378
+ type: "text",
2379
+ value: c,
2380
+ onChange: (l) => s({ ...t, href: l.target.value }),
2381
+ placeholder: r === "page" || r === "url" ? "Enter URL" : r === "scroll" ? "#ElementID" : "Enter detail"
2382
+ }
2383
+ ),
2384
+ (r === "page" || r === "url") && /* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-x-2", children: [
2385
+ /* @__PURE__ */ a.jsx(
2386
+ "input",
2387
+ {
2388
+ type: "checkbox",
2389
+ defaultChecked: p === "_blank",
2390
+ className: "cursor-pointer rounded-md border border-border",
2391
+ onChange: () => s({ ...t, target: p === "_blank" ? "_self" : "_blank" })
2392
+ }
2393
+ ),
2394
+ /* @__PURE__ */ a.jsx("span", { className: "pt-1 text-xs", children: "Open in new tab" })
2395
+ ] })
2396
+ ] })
2397
+ ] });
2398
+ }, $i = () => {
2399
+ const [e] = we(), [, t] = $e(), { addBlocks: s } = xe(), { toast: o } = xs(), n = z(
2400
+ (r, c, p) => {
2401
+ var j;
2402
+ for (let I = 0; I < r.length; I++) {
2403
+ const { _id: O } = r[I];
2404
+ r[I]._id = ce();
2405
+ const W = M(r, { _parent: O });
2406
+ for (let G = 0; G < W.length; G++)
2407
+ W[G]._parent = r[I]._id;
2408
+ }
2409
+ const l = Q(r);
2410
+ let f, x;
2411
+ return c && (f = te(e, { _id: c }), r[0]._parent = c, x = c), !(f ? Ct(f._type, l._type) : !0) && f && (r[0]._parent = f._parent, x = f._parent), s(r, x, p), t([(j = Q(r)) == null ? void 0 : j._id]), Q(r);
2412
+ },
2413
+ [e, t]
2414
+ );
2415
+ return { addCoreBlock: z(
2416
+ (r, c, p) => {
2417
+ if (pe(r, "blocks")) {
2418
+ const G = r.blocks;
2419
+ return n(G, c, p);
2420
+ }
2421
+ const l = ce(), f = ts(r.props), x = [];
2422
+ Lt(f, (G, H) => {
2423
+ if (zt(G, Ke)) {
2424
+ const $ = G.replace(Ke, "");
2425
+ x.push({
2426
+ _id: $,
2427
+ _type: "Slot",
2428
+ _parent: l,
2429
+ _name: r.props[H].name,
2430
+ _styles: r.props[H].styles,
2431
+ _emptyStyles: r.props[H].emptyStyles
2432
+ });
2433
+ }
2434
+ });
2435
+ const N = {
2436
+ _type: r.type,
2437
+ _id: l,
2438
+ ...f
2439
+ };
2440
+ let j, I;
2441
+ if (c && (j = te(e, { _id: c }), N._parent = c, I = c), !Kt(j == null ? void 0 : j._type, r.type)) {
2442
+ o({
2443
+ variant: "destructive",
2444
+ title: "Error",
2445
+ description: `"${r.type}" cannot be added under "${j._type}"`
2446
+ });
2447
+ return;
2448
+ }
2449
+ !(j ? Ct(j._type, r.type) : !0) && j && (N._parent = j._parent, I = j._parent);
2450
+ const W = [N, ...x];
2451
+ return s(W, I, p), t([N._id]), N;
2452
+ },
2453
+ [n, e, t]
2454
+ ), addPredefinedBlock: n };
2455
+ }, Pt = {
2456
+ xs: 420,
2457
+ sm: 620,
2458
+ md: 768,
2459
+ lg: 1024,
2460
+ xl: 1280,
2461
+ "2xl": 1536
2462
+ }, It = ["xs", "sm", "md", "lg", "xl", "2xl"];
2463
+ function La(e, t) {
2464
+ if (t === null)
2465
+ return "baseClasses";
2466
+ const s = t.mq;
2467
+ if (s === "xs" || t.dark || t.mod !== "")
2468
+ return "classes";
2469
+ let o = "baseClasses", n = It.indexOf(s);
2470
+ for (; n > 0; ) {
2471
+ const i = It[n - 1];
2472
+ if (te(e, {
2473
+ mq: i,
2474
+ property: t.property
2475
+ })) {
2476
+ o = "classes";
2477
+ break;
2478
+ }
2479
+ n--;
2480
+ }
2481
+ return o;
2482
+ }
2483
+ const Mt = [];
2484
+ function za(e = "", t = "", s = []) {
2485
+ e = e.trim().replace(/ +/g, "");
2486
+ let o = M(
2487
+ R(e.split(" "), Pe),
2488
+ (l) => !qe(l)
2489
+ ), n = M(R(t.split(" "), Pe), (l) => !qe(l));
2490
+ n = M(
2491
+ n,
2492
+ (l) => !q(Mt, l.property)
2493
+ );
2494
+ const i = [], r = [];
2495
+ ue(s, (l) => {
2496
+ const f = Pe(l), x = te(o, vt(f, ["dark", "mq", "mod", "property"]));
2497
+ if (x && (o = M(
2498
+ o,
2499
+ (N) => N.fullCls !== (x == null ? void 0 : x.fullCls)
2500
+ )), i.push(f), f.mq === "xs" && !f.dark && f.mod === "" && (n = M(n, (N) => N.property !== f.property)), La(o, f) === "baseClasses" && !q(Mt, f.property)) {
2501
+ const N = te(n, vt(f, ["property"]));
2502
+ x && (n = M(
2503
+ n,
2504
+ (j) => j.fullCls !== (N == null ? void 0 : N.fullCls)
2505
+ )), r.push({
2506
+ ...f,
2507
+ fullCls: f.cls,
2508
+ mq: "xs"
2509
+ });
2510
+ }
2511
+ });
2512
+ const c = R(
2513
+ yt([...o, ...i], (l) => Pt[l.mq]),
2514
+ "fullCls"
2515
+ ).join(" ");
2516
+ return `${R(
2517
+ yt([...n, ...r], (l) => Pt[l.mq]),
2518
+ "fullCls"
2519
+ ).join(" ").trim()},${c.trim()}`.trim().replace(/ +/g, "");
2520
+ }
2521
+ const Re = w([]);
2522
+ Re.debugLabel = "selectedStylingBlocksAtom";
2523
+ const Va = () => D(Re), $a = (e) => {
2524
+ const t = e.replace(me, "").split(",");
2525
+ return { baseClasses: t[0], classes: t[1] };
2526
+ }, Fa = w(null, (e, t, { blockIds: s, newClasses: o }) => {
2527
+ const n = M(
2528
+ e(at),
2529
+ (r) => (
2530
+ // @ts-ignore
2531
+ s.includes(e(r)._id)
2532
+ )
2533
+ ), i = Q(e(Re));
2534
+ return R(n, (r) => {
2535
+ const c = e(r), p = F(c, i.prop, `${me},`), { baseClasses: l, classes: f } = $a(p);
2536
+ return {
2537
+ ids: [c._id],
2538
+ props: { [i.prop]: `${me}${za(f, l, o)}` }
2539
+ };
2540
+ });
2541
+ }), Fi = () => {
2542
+ const e = Be(Fa), { updateBlocks: t, updateBlocksRuntime: s } = xe();
2543
+ return z(
2544
+ (o, n, i = !1) => {
2545
+ const r = e({ blockIds: o, newClasses: n });
2546
+ if (!i) {
2547
+ s(o, r[0].props);
2548
+ return;
2549
+ }
2550
+ t(o, r[0].props);
2551
+ },
2552
+ [e]
2553
+ );
2554
+ }, Ua = () => D(es), Ss = _e("canvasWidth", 800), As = w((e) => {
2555
+ const t = e(Ss);
2556
+ return Fs(t).toLowerCase();
2557
+ }), Ui = () => {
2558
+ const [e, t] = D(Ss), s = X(As), [o, n] = Ua();
2559
+ return Ce(() => {
2560
+ o !== "xs" && n(s);
2561
+ }, [s, o, n]), [e, s, t];
2562
+ }, Wa = _e("canvasZoom", 100), Wi = () => D(Wa), Cs = w([]), Ga = () => {
2563
+ const [e, t] = D(Cs), s = Be(xt), o = z(
2564
+ (n) => {
2565
+ t(n), s([]);
2566
+ },
2567
+ [t, s]
2568
+ );
2569
+ return [e, o];
2570
+ }, xt = w([]), Gi = () => {
2571
+ const [e, t] = D(xt), s = Be(Cs), o = z(
2572
+ (n) => {
2573
+ t(n), s([]);
2574
+ },
2575
+ [t, s]
2576
+ );
2577
+ return [e, o];
2578
+ }, Bs = _e("darkMode", !1), Hi = () => {
2579
+ const [e, t] = D(Bs);
2580
+ return [e, t];
2581
+ }, Ha = () => {
2582
+ const [e] = we(), [, t] = $e(), { addBlocks: s } = xe();
2583
+ return z(
2584
+ (o, n = null) => {
2585
+ const i = [];
2586
+ ue(o, (r) => {
2587
+ const c = e.find((N) => N._id === r);
2588
+ n || (n = c._parent);
2589
+ const f = M(
2590
+ e,
2591
+ (N) => Et(n) ? N._parent === n : !c._parent
2592
+ ).indexOf(c) + 1, x = jo(e, r, n);
2593
+ s(x, n, f), i.push(F(x, "0._id", ""));
2594
+ }), t(i);
2595
+ },
2596
+ [e, t]
2597
+ );
2598
+ }, qa = w([]), qi = () => {
2599
+ const [e, t] = D(qa), s = z(
2600
+ (o) => {
2601
+ t((n) => q(n, o) ? Ot(n, o) : [...n, o]);
2602
+ },
2603
+ [t]
2604
+ );
2605
+ return [e, t, s];
2606
+ }, Ka = w(""), Ja = () => D(Ka), Ya = () => {
2607
+ const e = X(ie);
2608
+ return z(
2609
+ (t, s) => {
2610
+ const o = R(e, (n) => (q(t, F(n, "_id")) && Se(n, "_parent", s), n));
2611
+ console.log("newBlocks", o);
2612
+ },
2613
+ [e]
2614
+ );
2615
+ }, Ki = () => {
2616
+ console.warn("usePasteBlocks is not implemented");
2617
+ const e = X(xt), [t, s] = Ga(), o = Ha(), n = Ya();
2618
+ return {
2619
+ canPaste: Ls(
2620
+ () => t.length > 0 || e.length > 0,
2621
+ [e, t]
2622
+ ),
2623
+ pasteBlocks: z(
2624
+ (r) => {
2625
+ ve(e) ? n(t, r) : o(e, r), s(() => []);
2626
+ },
2627
+ [t, e, o, n, s]
2628
+ )
2629
+ };
2630
+ }, Qa = w(!1), Ji = () => {
2631
+ const [e, t] = D(Qa);
2632
+ return [e, t];
2633
+ }, Xa = w(null, (e, t, { blockIds: s, fullClasses: o }) => {
2634
+ const n = Q(e(Re)), i = M(
2635
+ e(at),
2636
+ (r) => (
2637
+ // @ts-ignore
2638
+ s.includes(e(r)._id)
2639
+ )
2640
+ );
2641
+ return R(i, (r) => {
2642
+ const c = e(r), p = o;
2643
+ let { classes: l, baseClasses: f } = wo(F(c, n.prop, "styles:,"));
2644
+ return ue(p, (x) => {
2645
+ const N = new RegExp(`(^| )${x.replace("[", "\\[").replace("]", "\\]")}($| )`, "g");
2646
+ l = l.replace(N, " ").replace(/ +/g, " ").trim();
2647
+ const j = Q(x.split(":"));
2648
+ q(["2xl", "xl", "lg", "md", "sm"], j) && p.push(x.split(":").pop().trim());
2649
+ }), ue(p, (x) => {
2650
+ const N = new RegExp(`(^| )${x.replace("[", "\\[").replace("]", "\\]")}($| )`, "g");
2651
+ f = f.replace(N, " ").replace(/ +/g, " ").trim();
2652
+ }), {
2653
+ ids: [c._id],
2654
+ props: {
2655
+ [n.prop]: `${me}${f},${l}`
2656
+ }
2657
+ };
2658
+ });
2659
+ }), Yi = () => {
2660
+ const { updateBlocks: e } = xe(), t = Be(Xa);
2661
+ return z(
2662
+ (s, o) => {
2663
+ const n = t({ blockIds: s, fullClasses: o });
2664
+ e(s, n[0].props);
2665
+ },
2666
+ [t]
2667
+ );
2668
+ }, _s = w((e) => {
2669
+ const t = Q(e(Re)), s = e(lt);
2670
+ if (!t || t.blockId !== F(s, "_id", null))
2671
+ return [];
2672
+ const n = F(s, t.prop, `${me},`).replace(me, "").split(",").join(" ");
2673
+ return M(R(n.trim().split(" "), Pe), (i) => !qe(i));
2674
+ }), Qi = () => X(_s), Dt = { xs: 0, sm: 1, md: 2, lg: 3, xl: 4, "2xl": 5 }, Za = w((e) => {
2675
+ const t = e(As), s = e(ct), o = e(Bs), n = er(t);
2676
+ let i = M(e(_s), { mod: s });
2677
+ return zt(s, "_") || (i = M(i, (r) => n.includes(r.mq))), i = i.sort((r, c) => Dt[r.mq] - Dt[c.mq]), o || (i = M(i, { dark: !1 })), i;
2678
+ }), er = (e) => {
2679
+ let t = [];
2680
+ switch (e) {
2681
+ case "xs":
2682
+ t = ["xs"];
2683
+ break;
2684
+ case "sm":
2685
+ t = ["xs", "sm"];
2686
+ break;
2687
+ case "md":
2688
+ t = ["xs", "sm", "md"];
2689
+ break;
2690
+ case "lg":
2691
+ t = ["xs", "sm", "md", "lg"];
2692
+ break;
2693
+ case "xl":
2694
+ t = ["xs", "sm", "md", "lg", "xl"];
2695
+ break;
2696
+ case "2xl":
2697
+ t = ["xs", "sm", "md", "lg", "xl", "2xl"];
2698
+ break;
2699
+ default:
2700
+ t = ["xs"];
2701
+ break;
2702
+ }
2703
+ return t;
2704
+ }, Xi = () => X(Za), Zi = () => D(ct), el = () => {
2705
+ const { updateBlocks: e } = xe();
2706
+ return z(
2707
+ (t, s, o) => {
2708
+ e(t, s, o);
2709
+ },
2710
+ [e]
2711
+ );
2712
+ }, tl = () => {
2713
+ const { updateBlocksRuntime: e } = xe();
2714
+ return z(
2715
+ (t, s) => {
2716
+ e(t, s);
2717
+ },
2718
+ [e]
2719
+ );
2720
+ }, Rs = {
2721
+ name: "",
2722
+ props: {},
2723
+ modalProps: {},
2724
+ backdropClose: !0
2725
+ }, tr = w(Rs), sl = () => {
2726
+ const [e, t] = D(tr), s = z(
2727
+ (n, i = {}, r = {}) => {
2728
+ t({ name: n, props: i, modalProps: r });
2729
+ },
2730
+ [t]
2731
+ ), o = z(
2732
+ (...n) => {
2733
+ F(e, "props.onClose", () => {
2734
+ })(...n), t(Rs);
2735
+ },
2736
+ [t, e]
2737
+ );
2738
+ return {
2739
+ activeModal: e,
2740
+ openModal: s,
2741
+ closeModal: o
2742
+ };
2743
+ }, ol = () => (console.warn("useAllBlocks is deprecated, use useBlocksStore() instead"), X(ie)), Ts = w(!1);
2744
+ Ts.debugLabel = "readOnlyModeAtom";
2745
+ const sr = w(!1);
2746
+ sr.debugLabel = "advanceStylingOpenAtom";
2747
+ const or = w("online");
2748
+ or.debugLabel = "networkModeAtom";
2749
+ const nr = w(!1);
2750
+ nr.debugLabel = "codeEditorOpenAtom";
2751
+ const ar = w(!1);
2752
+ ar.debugLabel = "editLayerNameAtom";
2753
+ const rr = w("");
2754
+ rr.debugLabel = "activeLanguageAtom";
2755
+ const ir = w("");
2756
+ ir.debugLabel = "primaryLanguageAtom";
2757
+ const lr = w(null);
2758
+ lr.debugLabel = "canvasIframeAtom";
2759
+ const cr = w("layers");
2760
+ cr.debugLabel = "activePanelAtom";
2761
+ const dr = w("");
2762
+ dr.debugLabel = "showPredefinedBlockCategoryAtom";
2763
+ const Ps = w({ undoCount: 0, redoCount: 0 });
2764
+ Ps.debugLabel = "historyStatesAtom";
2765
+ const ur = w("");
2766
+ ur.debugLabel = "inlineEditingActiveAtom";
2767
+ const mr = w(!1);
2768
+ mr.debugLabel = "draggingFlagAtom";
2769
+ const fr = w("");
2770
+ fr.debugLabel = "draggedBlockIdAtom";
2771
+ const nl = () => X(Ts), pr = w(""), gr = w(null), al = () => D(pr), rl = () => D(gr), br = _e("selectedBreakpoints", ["XS", "MD", "XL"]), il = () => {
2772
+ const [e, t] = D(br);
2773
+ return [e, t];
2774
+ }, ll = () => {
2775
+ const e = Be(Ps), { clear: t } = is(), [, s] = $e(), [, o] = Ja(), [, n] = Va();
2776
+ return () => {
2777
+ s([]), n([]), o(""), t(), e({ undoCount: 0, redoCount: 0 });
2778
+ };
2779
+ }, xr = w([]), cl = () => {
2780
+ const [e, t] = Ee(!1), [s, o] = D(xr), n = ke("getUILibraryBlocks", () => []);
2781
+ return Ce(() => {
2782
+ (async () => s.length > 0 || (t(!0), o(await n()), t(!1)))();
2783
+ }, []), { data: s, isLoading: e };
2784
+ };
2785
+ export {
2786
+ qr as $,
2787
+ ei as A,
2788
+ Yo as B,
2789
+ an as C,
2790
+ rn as D,
2791
+ cn as E,
2792
+ dn as F,
2793
+ ln as G,
2794
+ mn as H,
2795
+ nl as I,
2796
+ sl as J,
2797
+ $i as K,
2798
+ Fi as L,
2799
+ Ui as M,
2800
+ Wi as N,
2801
+ Gi as O,
2802
+ zo as P,
2803
+ Ga as Q,
2804
+ Hi as R,
2805
+ Bi as S,
2806
+ oi as T,
2807
+ Uo as U,
2808
+ qi as V,
2809
+ Ja as W,
2810
+ Ki as X,
2811
+ Yi as Y,
2812
+ Xi as Z,
2813
+ Qi as _,
2814
+ Vr as a,
2815
+ gn as a$,
2816
+ Ua as a0,
2817
+ cl as a1,
2818
+ Zi as a2,
2819
+ el as a3,
2820
+ tl as a4,
2821
+ Hr as a5,
2822
+ ol as a6,
2823
+ al as a7,
2824
+ Yr as a8,
2825
+ rl as a9,
2826
+ fi as aA,
2827
+ pi as aB,
2828
+ Un as aC,
2829
+ wi as aD,
2830
+ Ni as aE,
2831
+ oa as aF,
2832
+ ia as aG,
2833
+ la as aH,
2834
+ aa as aI,
2835
+ xe as aJ,
2836
+ mr as aK,
2837
+ ur as aL,
2838
+ ar as aM,
2839
+ fr as aN,
2840
+ Ur as aO,
2841
+ Wr as aP,
2842
+ or as aQ,
2843
+ lr as aR,
2844
+ ri as aS,
2845
+ ii as aT,
2846
+ Tn as aU,
2847
+ ks as aV,
2848
+ va as aW,
2849
+ ya as aX,
2850
+ wa as aY,
2851
+ Na as aZ,
2852
+ ja as a_,
2853
+ il as aa,
2854
+ Va as ab,
2855
+ ds as ac,
2856
+ bt as ad,
2857
+ pn as ae,
2858
+ bn as af,
2859
+ xn as ag,
2860
+ un as ah,
2861
+ gi as ai,
2862
+ Wn as aj,
2863
+ xi as ak,
2864
+ Gn as al,
2865
+ qn as am,
2866
+ cr as an,
2867
+ _n as ao,
2868
+ ps as ap,
2869
+ Xe as aq,
2870
+ Ze as ar,
2871
+ bi as as,
2872
+ Hn as at,
2873
+ ni as au,
2874
+ ai as av,
2875
+ Rn as aw,
2876
+ da as ax,
2877
+ An as ay,
2878
+ Jo as az,
2879
+ oe as b,
2880
+ na as b$,
2881
+ fn as b0,
2882
+ _t as b1,
2883
+ Bt as b2,
2884
+ zi as b3,
2885
+ Ei as b4,
2886
+ Li as b5,
2887
+ Vi as b6,
2888
+ Xr as b7,
2889
+ Qo as b8,
2890
+ Xo as b9,
2891
+ yn as bA,
2892
+ fs as bB,
2893
+ Pn as bC,
2894
+ li as bD,
2895
+ In as bE,
2896
+ En as bF,
2897
+ On as bG,
2898
+ $n as bH,
2899
+ Vn as bI,
2900
+ Ln as bJ,
2901
+ mi as bK,
2902
+ zn as bL,
2903
+ di as bM,
2904
+ Dn as bN,
2905
+ Mn as bO,
2906
+ ci as bP,
2907
+ ui as bQ,
2908
+ Fn as bR,
2909
+ Kn as bS,
2910
+ hi as bT,
2911
+ vi as bU,
2912
+ yi as bV,
2913
+ Yn as bW,
2914
+ Qn as bX,
2915
+ Xn as bY,
2916
+ Zn as bZ,
2917
+ ea as b_,
2918
+ Zo as ba,
2919
+ jn as bb,
2920
+ si as bc,
2921
+ sr as bd,
2922
+ Bn as be,
2923
+ hn as bf,
2924
+ vn as bg,
2925
+ wn as bh,
2926
+ Nn as bi,
2927
+ Cn as bj,
2928
+ kn as bk,
2929
+ tn as bl,
2930
+ sn as bm,
2931
+ dr as bn,
2932
+ _a as bo,
2933
+ Ba as bp,
2934
+ Ri as bq,
2935
+ Ti as br,
2936
+ Jr as bs,
2937
+ Gr as bt,
2938
+ Ko as bu,
2939
+ qo as bv,
2940
+ gt as bw,
2941
+ on as bx,
2942
+ Zr as by,
2943
+ nn as bz,
2944
+ oo as c,
2945
+ ra as c0,
2946
+ ca as c1,
2947
+ ki as c2,
2948
+ ji as c3,
2949
+ Si as c4,
2950
+ sa as c5,
2951
+ ta as c6,
2952
+ Ai as c7,
2953
+ pa as c8,
2954
+ xs as c9,
2955
+ ga as ca,
2956
+ _i as cb,
2957
+ Sa as cc,
2958
+ ka as cd,
2959
+ Ra as ce,
2960
+ Ta as cf,
2961
+ Pa as cg,
2962
+ Ia as ch,
2963
+ Ma as ci,
2964
+ Pi as cj,
2965
+ Ii as ck,
2966
+ Mi as cl,
2967
+ Ca as cm,
2968
+ Aa as cn,
2969
+ Di as co,
2970
+ Oi as cp,
2971
+ uo as d,
2972
+ co as e,
2973
+ _e as f,
2974
+ $r as g,
2975
+ Ji as h,
2976
+ ke as i,
2977
+ $e as j,
2978
+ Qr as k,
2979
+ Ha as l,
2980
+ is as m,
2981
+ yo as n,
2982
+ Wo as o,
2983
+ ie as p,
2984
+ ft as q,
2985
+ Fr as r,
2986
+ we as s,
2987
+ Oo as t,
2988
+ Gt as u,
2989
+ ll as v,
2990
+ qt as w,
2991
+ rs as x,
2992
+ Ci as y,
2993
+ ti as z
2994
+ };