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