@chaibuilder/sdk 0.1.21 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/{AddBlocks-b2d43d6c.js → AddBlocks-189ba69a.js} +1 -1
  2. package/dist/{AddBlocks-b510ac3a.cjs → AddBlocks-36adcc50.cjs} +1 -1
  3. package/dist/{BrandingOptions-7f66e02c.js → BrandingOptions-c01e08fc.js} +1 -1
  4. package/dist/{BrandingOptions-6fbe4b26.cjs → BrandingOptions-e659a7bf.cjs} +1 -1
  5. package/dist/{CanvasArea-68841a13.js → CanvasArea-9106ecb5.js} +2 -2
  6. package/dist/{CanvasArea-a8d28eb3.cjs → CanvasArea-933848fb.cjs} +2 -2
  7. package/dist/{CurrentPage-6655ce50.js → CurrentPage-37d2f495.js} +1 -1
  8. package/dist/{CurrentPage-c10e6c89.cjs → CurrentPage-92d8bfe0.cjs} +1 -1
  9. package/dist/{Layers-595cc98e.cjs → Layers-94aeb9f0.cjs} +1 -1
  10. package/dist/{Layers-99bdc689.js → Layers-c08aa961.js} +2 -2
  11. package/dist/{MarkAsGlobalBlock-ea769ea4.cjs → MarkAsGlobalBlock-07cb6760.cjs} +1 -1
  12. package/dist/{MarkAsGlobalBlock-522e170a.js → MarkAsGlobalBlock-10422d13.js} +1 -1
  13. package/dist/{PagesPanel-b0debeed.js → PagesPanel-be499af0.js} +2 -2
  14. package/dist/{PagesPanel-e176d7e8.cjs → PagesPanel-e4807890.cjs} +1 -1
  15. package/dist/{ProjectPanel-d0f33df2.cjs → ProjectPanel-0478c85b.cjs} +1 -1
  16. package/dist/{ProjectPanel-9cec967c.js → ProjectPanel-fd948934.js} +2 -2
  17. package/dist/Settings-6cb217af.cjs +1 -0
  18. package/dist/{Settings-fd1e3b5d.js → Settings-94b79852.js} +490 -486
  19. package/dist/SidePanels-4434d31b.cjs +1 -0
  20. package/dist/{SidePanels-ca294b35.js → SidePanels-78d8de19.js} +68 -64
  21. package/dist/{Topbar-1edef1b2.js → Topbar-0542b5f4.js} +1 -1
  22. package/dist/{Topbar-75c99c88.cjs → Topbar-d6382110.cjs} +1 -1
  23. package/dist/{add-page-modal-9985b5ce.js → add-page-modal-36a6b406.js} +1 -1
  24. package/dist/{add-page-modal-18f134c0.cjs → add-page-modal-6132fdff.cjs} +1 -1
  25. package/dist/core.cjs +1 -1
  26. package/dist/core.d.ts +4 -1
  27. package/dist/core.js +1 -1
  28. package/dist/{delete-page-modal-98272bf5.js → delete-page-modal-68a4d71e.js} +1 -1
  29. package/dist/{delete-page-modal-393697d7.cjs → delete-page-modal-87c48560.cjs} +1 -1
  30. package/dist/{index-c3a98a78.cjs → index-6f5cce76.cjs} +2 -2
  31. package/dist/{index-436bba3e.js → index-c49887fe.js} +4 -4
  32. package/dist/{page-viewer-32261f49.cjs → page-viewer-47098c44.cjs} +1 -1
  33. package/dist/{page-viewer-a3ac057a.js → page-viewer-d87e5621.js} +2 -2
  34. package/dist/{project-general-setting-75a8e94b.cjs → project-general-setting-869887d5.cjs} +1 -1
  35. package/dist/{project-general-setting-21e324a9.js → project-general-setting-91df16a9.js} +1 -1
  36. package/dist/{single-page-detail-649b1379.cjs → single-page-detail-1b276c4f.cjs} +1 -1
  37. package/dist/{single-page-detail-0e881b82.js → single-page-detail-4a424725.js} +2 -2
  38. package/package.json +1 -1
  39. package/dist/Settings-208ab051.cjs +0 -1
  40. package/dist/SidePanels-40966390.cjs +0 -1
@@ -2,28 +2,28 @@ import { j as e } from "./jsx-runtime-944c88e2.js";
2
2
  import * as se from "react";
3
3
  import $, { useState as k, useEffect as M, useMemo as T, useCallback as I, createContext as Le, useContext as ee } from "react";
4
4
  import { useThrottledCallback as xe } from "@react-hookz/web";
5
- import { map as C, isEmpty as b, last as he, forEach as fe, set as Pe, startCase as Q, filter as Oe, get as g, isArray as ye, omit as at, includes as O, toLower as ne, first as be, split as Ne, truncate as it, keys as dt, cloneDeep as ct, each as pt, capitalize as ut, reject as gt, nth as Se, startsWith as Z, isNumber as xt, parseInt as ht, isNaN as Me, findLast as yt, has as ue, flatten as z, intersection as _e, isNull as mt } from "lodash";
5
+ import { map as C, isEmpty as f, last as he, forEach as be, set as Pe, startCase as Q, filter as Oe, get as u, isArray as me, omit as at, includes as O, toLower as ne, first as fe, split as Ne, truncate as it, keys as dt, cloneDeep as ct, each as pt, capitalize as ut, reject as gt, nth as Se, startsWith as Z, isNumber as xt, parseInt as ht, isNaN as Me, findLast as mt, has as ue, flatten as z, intersection as _e, isNull as yt } from "lodash";
6
6
  import { useTranslation as Ee } from "react-i18next";
7
- import { PlusIcon as ve, Cross2Icon as Fe, EyeOpenIcon as ft, EyeClosedIcon as Te, BorderAllIcon as _, WidthIcon as V, HeightIcon as H, ArrowUpIcon as G, ArrowRightIcon as K, ArrowDownIcon as q, ArrowLeftIcon as J, ArrowTopLeftIcon as bt, ArrowTopRightIcon as vt, ArrowBottomRightIcon as wt, ArrowBottomLeftIcon as jt, AlignLeftIcon as Ct, AlignCenterHorizontallyIcon as kt, AlignRightIcon as Nt, StretchHorizontallyIcon as St, FontItalicIcon as Tt, UnderlineIcon as Rt, OverlineIcon as Vt, LetterCaseUppercaseIcon as Ht, Cross1Icon as Bt, InfoCircledIcon as we, MinusIcon as At, BoxIcon as Xe, TriangleDownIcon as Dt, RowSpacingIcon as $t, TrashIcon as Ye, MixerHorizontalIcon as We } from "@radix-ui/react-icons";
7
+ import { PlusIcon as ve, Cross2Icon as Fe, EyeOpenIcon as bt, EyeClosedIcon as Te, BorderAllIcon as _, WidthIcon as V, HeightIcon as H, ArrowUpIcon as G, ArrowRightIcon as K, ArrowDownIcon as q, ArrowLeftIcon as J, ArrowTopLeftIcon as ft, ArrowTopRightIcon as vt, ArrowBottomRightIcon as wt, ArrowBottomLeftIcon as jt, AlignLeftIcon as Ct, AlignCenterHorizontallyIcon as kt, AlignRightIcon as Nt, StretchHorizontallyIcon as St, FontItalicIcon as Tt, UnderlineIcon as Rt, OverlineIcon as Vt, LetterCaseUppercaseIcon as Ht, Cross1Icon as Bt, InfoCircledIcon as we, MinusIcon as At, BoxIcon as Ye, TriangleDownIcon as Dt, RowSpacingIcon as $t, TrashIcon as Xe, MixerHorizontalIcon as We } from "@radix-ui/react-icons";
8
8
  import { T as It, a as Lt, b as Re, c as Ve } from "./tabs-85caa1e8.js";
9
9
  import Pt from "@rjsf/core";
10
10
  import Ot from "@rjsf/validator-ajv8";
11
- import { D as te, d as Ze, G as ze, H as Mt, I as _t, J as Et, j as je, K as Ue, L as Ge, i as Ke, e as Ft, M as qe, f as He, N as ce, c as Xt, O as Yt, P as Wt } from "./index-436bba3e.js";
12
- import { getBlockComponent as Je, SingleLineText as Zt } from "@chaibuilder/blocks";
13
- import { TrashIcon as zt, ChevronRight as Ut } from "lucide-react";
11
+ import { D as te, d as Ze, G as ze, H as Mt, I as _t, J as Et, j as je, K as Ue, L as Ge, i as Ke, e as Ft, M as qe, f as He, N as ce, c as Yt, O as Xt, P as Wt } from "./index-c49887fe.js";
12
+ import { getChaiDataProviders as Zt, getBlockComponent as Je, SingleLineText as zt } from "@chaibuilder/blocks";
13
+ import { TrashIcon as Ut, ChevronRight as Gt } from "lucide-react";
14
14
  import Qe from "react-autosuggest";
15
- import { u as Gt } from "./useChaiExternalData-192c7896.js";
16
- import { d as X, e as Y, f as W, B as et, g as Kt } from "./useBuilderProp-81a14920.js";
15
+ import { u as Kt } from "./useChaiExternalData-192c7896.js";
16
+ import { d as Y, e as X, f as W, B as et, g as qt } from "./useBuilderProp-81a14920.js";
17
17
  import { A as tt, a as ae, b as ie, c as de } from "./accordion-c0176dc5.js";
18
- import { R as qt, I as Jt, a as Qt, L as er } from "./link-2af5de8b.js";
19
- import { useAtom as tr } from "jotai";
20
- import rr from "fuse.js";
21
- import { A as lr, C as pe, d as or } from "./html-to-json-45e0e3b5.js";
18
+ import { R as Jt, I as Qt, a as er, L as tr } from "./link-2af5de8b.js";
19
+ import { useAtom as rr } from "jotai";
20
+ import lr from "fuse.js";
21
+ import { A as or, C as pe, d as sr } from "./html-to-json-45e0e3b5.js";
22
22
  import { L as Ce } from "./label-e770a087.js";
23
- import { S as sr } from "./MODIFIERS-2f19c314.js";
24
- import { I as nr } from "./input-a0ea2bc7.js";
25
- import { S as ar } from "./scroll-area-83bd9e8f.js";
26
- import { S as ir, c as dr, b as cr, d as pr, f as A } from "./select-7fddd7c3.js";
23
+ import { S as nr } from "./MODIFIERS-2f19c314.js";
24
+ import { I as ar } from "./input-a0ea2bc7.js";
25
+ import { S as ir } from "./scroll-area-83bd9e8f.js";
26
+ import { S as dr, c as cr, b as pr, d as ur, f as A } from "./select-7fddd7c3.js";
27
27
  import "@radix-ui/react-tabs";
28
28
  import "./utils-ac68b2c8.js";
29
29
  import "clsx";
@@ -52,17 +52,17 @@ import "react-quill";
52
52
  import "himalaya";
53
53
  import "@radix-ui/react-label";
54
54
  import "@radix-ui/react-select";
55
- function ur(r) {
55
+ function gr(r) {
56
56
  const s = [], t = {};
57
- function n(l, a) {
58
- fe(a, (d, i) => {
59
- const o = l ? `${l}.${i}` : i, p = ye(d) ? "list" : typeof d;
60
- s.push(o), t[o] = p === "string" ? "text" : p === "object" ? "model" : p, p === "object" && !ye(d) && n(o, d);
57
+ function a(o, n) {
58
+ be(n, (d, i) => {
59
+ const l = o ? `${o}.${i}` : i, c = me(d) ? "list" : typeof d;
60
+ s.push(l), t[l] = c === "string" ? "text" : c === "object" ? "model" : c, c === "object" && !me(d) && a(l, d);
61
61
  });
62
62
  }
63
- return n("", at(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: s, pathsType: t };
63
+ return a("", at(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: s, pathsType: t };
64
64
  }
65
- const gr = ({ data: r }) => {
65
+ const xr = ({ data: r }) => {
66
66
  if (!r)
67
67
  return null;
68
68
  const s = typeof r;
@@ -71,68 +71,68 @@ const gr = ({ data: r }) => {
71
71
  type: r,
72
72
  isDisabled: s = !1,
73
73
  placeholder: t,
74
- defaultValue: n = "",
75
- data: l,
76
- onChange: a,
74
+ defaultValue: a = "",
75
+ data: o,
76
+ onChange: n,
77
77
  dataType: d,
78
78
  appliedBindings: i
79
79
  }) => {
80
- const [o, p] = k(n), { paths: u, pathsType: c } = ur(l), y = r === "PROP" ? Je(l == null ? void 0 : l._type) : {};
80
+ const [l, c] = k(a), { paths: p, pathsType: h } = gr(o), g = r === "PROP" ? Je(o == null ? void 0 : o._type) : {};
81
81
  M(() => {
82
- b(o) && a("");
83
- }, [o]), M(() => p(n), [n]);
84
- const x = () => u.filter((f) => {
85
- const j = b(o) || O(ne(f), ne(o));
86
- return r === "PATH" ? j && d === g(c, f, "") : j && !O(i, f) && g(y, `props.${be(Ne(f, "."))}.binding`);
87
- }), [m, v] = k(() => x());
88
- M(() => v(() => x()), [d]);
82
+ f(l) && n("");
83
+ }, [l]), M(() => c(a), [a]);
84
+ const y = () => p.filter((b) => {
85
+ const j = f(l) || O(ne(b), ne(l));
86
+ return r === "PATH" ? j && d === u(h, b, "") : j && !O(i, b) && u(g, `props.${fe(Ne(b, "."))}.binding`);
87
+ }), [x, v] = k(() => y());
88
+ M(() => v(() => y()), [d]);
89
89
  const L = {
90
90
  autoComplete: "off",
91
91
  autoCorrect: "on",
92
92
  autoCapitalize: "off",
93
93
  spellCheck: !1,
94
94
  placeholder: t,
95
- value: o,
95
+ value: l,
96
96
  disabled: s,
97
97
  onBlur: () => {
98
- u.includes(o) ? a(o) : (p(""), a(""));
98
+ p.includes(l) ? n(l) : (c(""), n(""));
99
99
  },
100
- onChange: (f, { newValue: j }) => p(j),
100
+ onChange: (b, { newValue: j }) => c(j),
101
101
  className: `chai-input w-full ${s ? "cursor-not-allowed" : ""}`
102
- }, R = (f) => /* @__PURE__ */ e.jsxs(
102
+ }, R = (b) => /* @__PURE__ */ e.jsxs(
103
103
  "div",
104
104
  {
105
105
  className: "rounded-md px-1 py-1.5 flex items-center justify-between space-x-2 font-light relative",
106
- "data-suggest": f,
106
+ "data-suggest": b,
107
107
  children: [
108
- /* @__PURE__ */ e.jsx("div", { className: "-mt-1 w-full h-full absolute opacity-0 z-20", children: f }),
108
+ /* @__PURE__ */ e.jsx("div", { className: "-mt-1 w-full h-full absolute opacity-0 z-20", children: b }),
109
109
  /* @__PURE__ */ e.jsxs("div", { className: "w-full", children: [
110
110
  /* @__PURE__ */ e.jsx("div", { className: "leading-4 text-xs flex items-center text-gray-800", children: $.Children.toArray(
111
- C(Ne(f, "."), (j, B) => /* @__PURE__ */ e.jsxs("span", { className: "flex items-end", children: [
112
- B > 0 && /* @__PURE__ */ e.jsx(Ut, { size: 14, className: "h-full text-gray-400" }),
111
+ C(Ne(b, "."), (j, B) => /* @__PURE__ */ e.jsxs("span", { className: "flex items-end", children: [
112
+ B > 0 && /* @__PURE__ */ e.jsx(Gt, { size: 14, className: "h-full text-gray-400" }),
113
113
  Q(j)
114
114
  ] }))
115
115
  ) }),
116
- r === "PATH" && /* @__PURE__ */ e.jsx(gr, { data: g(l, f) })
116
+ r === "PATH" && /* @__PURE__ */ e.jsx(xr, { data: u(o, b) })
117
117
  ] }),
118
- r === "PROP" && /* @__PURE__ */ e.jsx("div", { className: "bg-purple-100 text-purple-400 text-[9px] flex items-center font-medium h-4 px-2 rounded-full", children: Q(g(c, f, "")) })
118
+ r === "PROP" && /* @__PURE__ */ e.jsx("div", { className: "bg-purple-100 text-purple-400 text-[9px] flex items-center font-medium h-4 px-2 rounded-full", children: Q(u(h, b, "")) })
119
119
  ]
120
120
  }
121
121
  );
122
122
  return /* @__PURE__ */ e.jsx(
123
123
  Qe,
124
124
  {
125
- suggestions: m,
126
- onSuggestionsFetchRequested: () => v(() => x()),
125
+ suggestions: x,
126
+ onSuggestionsFetchRequested: () => v(() => y()),
127
127
  onSuggestionsClearRequested: () => v([]),
128
- onSuggestionSelected: (f) => {
129
- if (f.type === "click") {
130
- const j = g(f.target, "childNodes[0].data", "");
131
- u.includes(j) && a(j);
128
+ onSuggestionSelected: (b) => {
129
+ if (b.type === "click") {
130
+ const j = u(b.target, "childNodes[0].data", "");
131
+ p.includes(j) && n(j);
132
132
  } else
133
- a(f.target.value);
133
+ n(b.target.value);
134
134
  },
135
- getSuggestionValue: (f) => f,
135
+ getSuggestionValue: (b) => b,
136
136
  renderSuggestion: R,
137
137
  shouldRenderSuggestions: () => !0,
138
138
  inputProps: L,
@@ -144,27 +144,27 @@ const gr = ({ data: r }) => {
144
144
  }
145
145
  }
146
146
  );
147
- }, xr = ({
147
+ }, hr = ({
148
148
  item: r,
149
149
  onChange: s,
150
150
  onRemove: t,
151
- selectedBlock: n,
152
- dataProvider: l,
153
- appliedBindings: a
151
+ selectedBlock: a,
152
+ dataProvider: o,
153
+ appliedBindings: n
154
154
  }) => {
155
- const [d, i] = k("string"), o = (p, u) => {
156
- if (b(p))
155
+ const [d, i] = k("string"), l = (c, p) => {
156
+ if (f(c))
157
157
  return "";
158
158
  {
159
- const c = g(u === "PROP" ? n : l, p, "");
160
- if (ye(c))
159
+ const h = u(p === "PROP" ? a : o, c, "");
160
+ if (me(h))
161
161
  return "list";
162
- const y = typeof c;
163
- return y === "string" ? "text" : y === "object" ? "model" : y;
162
+ const g = typeof h;
163
+ return g === "string" ? "text" : g === "object" ? "model" : g;
164
164
  }
165
165
  };
166
- return M(() => i(() => o(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 border border-gray-200 relative rounded-md p-2", children: [
167
- !b(d) && !b(r.key) && /* @__PURE__ */ e.jsx("div", { className: "mt-px absolute right-2 top-4 text-purple-600 text-[10px] flex items-center font-medium h-4 px-2 rounded-full", children: Q(d) }),
166
+ return M(() => i(() => l(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 border border-gray-200 relative rounded-md p-2", children: [
167
+ !f(d) && !f(r.key) && /* @__PURE__ */ e.jsx("div", { className: "mt-px absolute right-2 top-4 text-purple-600 text-[10px] flex items-center font-medium h-4 px-2 rounded-full", children: Q(d) }),
168
168
  /* @__PURE__ */ e.jsx(
169
169
  Be,
170
170
  {
@@ -172,13 +172,13 @@ const gr = ({ data: r }) => {
172
172
  isDisabled: !1,
173
173
  placeholder: "Enter prop key",
174
174
  defaultValue: r.key,
175
- onChange: (p) => {
176
- const u = o(p, "PROP");
177
- s({ target: { name: "key", value: p } }), d !== u && s({ target: { name: "value", value: "" } }), i(u);
175
+ onChange: (c) => {
176
+ const p = l(c, "PROP");
177
+ s({ target: { name: "key", value: c } }), d !== p && s({ target: { name: "value", value: "" } }), i(p);
178
178
  },
179
- data: n,
179
+ data: a,
180
180
  dataType: d,
181
- appliedBindings: a
181
+ appliedBindings: n
182
182
  }
183
183
  ),
184
184
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-start justify-between gap-x-1.5 w-full relative", children: [
@@ -186,20 +186,20 @@ const gr = ({ data: r }) => {
186
186
  Be,
187
187
  {
188
188
  type: "PATH",
189
- isDisabled: b(r.key),
189
+ isDisabled: f(r.key),
190
190
  placeholder: "Enter data path",
191
191
  defaultValue: r.value,
192
- onChange: (p) => {
193
- const u = o(p, "PATH");
194
- s(d !== u ? { target: { name: "value", value: "" } } : { target: { name: "value", value: p } });
192
+ onChange: (c) => {
193
+ const p = l(c, "PATH");
194
+ s(d !== p ? { target: { name: "value", value: "" } } : { target: { name: "value", value: c } });
195
195
  },
196
- data: l,
196
+ data: o,
197
197
  dataType: d,
198
- appliedBindings: a
198
+ appliedBindings: n
199
199
  }
200
200
  ),
201
201
  /* @__PURE__ */ e.jsx(
202
- zt,
202
+ Ut,
203
203
  {
204
204
  onClick: t,
205
205
  className: "h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-red-400 hover:text-white border-red-400 p-1 text-red-400 hover:scale-105 duration-200"
@@ -207,87 +207,91 @@ const gr = ({ data: r }) => {
207
207
  )
208
208
  ] })
209
209
  ] });
210
- }, hr = ({ bindingData: r, onChange: s }) => {
211
- const t = te(), [n] = Gt(), [l, a] = k(C(r, (c, y) => ({ key: y, value: c })));
210
+ }, mr = ({ bindingData: r, onChange: s }) => {
211
+ const t = te(), [a] = Kt(), o = Zt(), [n, d] = k(C(r, (g, y) => ({ key: y, value: g })));
212
212
  M(() => {
213
- a(C(r, (c, y) => ({ key: y, value: c })));
213
+ d(C(r, (g, y) => ({ key: y, value: g })));
214
214
  }, [t == null ? void 0 : t._id]);
215
- const d = T(() => {
216
- if (b(l))
215
+ const i = T(() => {
216
+ if (f(n))
217
217
  return !1;
218
- const c = he(l);
219
- return b(c == null ? void 0 : c.key) || b(c == null ? void 0 : c.value);
220
- }, [l]), i = () => {
221
- a([...l, { key: "", value: "" }]);
222
- }, o = (c) => {
223
- const y = Oe(l, (x, m) => c !== m);
224
- u([...y]);
225
- }, p = (c, y) => {
226
- const x = [...l];
227
- x[y][c.target.name] = c.target.value, u(x);
228
- }, u = I(
229
- (c = []) => {
230
- if (a(c), b(c)) {
218
+ const g = he(n);
219
+ return f(g == null ? void 0 : g.key) || f(g == null ? void 0 : g.value);
220
+ }, [n]), l = () => {
221
+ d([...n, { key: "", value: "" }]);
222
+ }, c = (g) => {
223
+ const y = Oe(n, (x, v) => g !== v);
224
+ h([...y]);
225
+ }, p = (g, y) => {
226
+ const x = [...n];
227
+ x[y][g.target.name] = g.target.value, h(x);
228
+ }, h = I(
229
+ (g = []) => {
230
+ if (d(g), f(g)) {
231
231
  s({});
232
232
  return;
233
233
  }
234
234
  const y = {};
235
- fe(c, (x) => {
236
- !b(x == null ? void 0 : x.key) && !b(x == null ? void 0 : x.value) && Pe(y, x.key, x.value);
235
+ be(g, (x) => {
236
+ !f(x == null ? void 0 : x.key) && !f(x == null ? void 0 : x.value) && Pe(y, x.key, x.value);
237
237
  }), s(y);
238
238
  },
239
239
  [t]
240
240
  );
241
- return b(n) ? /* @__PURE__ */ e.jsx("div", { className: "w-full flex items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-400", children: "No data provider selected." }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
242
- C(l, (c, y) => /* @__PURE__ */ e.jsx(
243
- xr,
241
+ return f(o) ? /* @__PURE__ */ e.jsx("div", { className: "w-full flex items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "text-gray-500 mb-1.5 text-xs", children: [
242
+ "You have no data providers registered. Please add a data provider to your project. ",
243
+ /* @__PURE__ */ e.jsx("br", {}),
244
+ /* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
245
+ ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
246
+ C(n, (g, y) => /* @__PURE__ */ e.jsx(
247
+ hr,
244
248
  {
245
- item: c,
249
+ item: g,
246
250
  onChange: (x) => p(x, y),
247
- onRemove: () => o(y),
251
+ onRemove: () => c(y),
248
252
  selectedBlock: t,
249
- dataProvider: n,
250
- appliedBindings: C(l, "key")
253
+ dataProvider: a,
254
+ appliedBindings: C(n, "key")
251
255
  },
252
- c.key
256
+ g.key
253
257
  )),
254
- /* @__PURE__ */ e.jsxs(X, { delayDuration: 200, children: [
255
- /* @__PURE__ */ e.jsx(Y, { className: "w-full", children: /* @__PURE__ */ e.jsx(
258
+ /* @__PURE__ */ e.jsxs(Y, { delayDuration: 200, children: [
259
+ /* @__PURE__ */ e.jsx(X, { className: "w-full", children: /* @__PURE__ */ e.jsx(
256
260
  "button",
257
261
  {
258
- onClick: i,
259
- disabled: d,
260
- className: `w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${b(l) ? "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30 " : ""} ${d ? "cursor-not-allowed bg-gray-200 text-gray-400" : b(l) ? "" : "bg-gray-700/20 text-gray-800 hover:bg-blue-700/30"}`,
262
+ onClick: l,
263
+ disabled: i,
264
+ className: `w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${f(n) ? "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30 " : ""} ${i ? "cursor-not-allowed bg-gray-200 text-gray-400" : f(n) ? "" : "bg-gray-700/20 text-gray-800 hover:bg-blue-700/30"}`,
261
265
  children: "+ Add Data Binding"
262
266
  }
263
267
  ) }),
264
- d && /* @__PURE__ */ e.jsx(W, { sideOffset: 10, className: "text-[11px]", children: "Complete last added data binding to add more" })
268
+ i && /* @__PURE__ */ e.jsx(W, { sideOffset: 10, className: "text-[11px]", children: "Complete last added data binding to add more" })
265
269
  ] })
266
270
  ] });
267
- }, yr = hr, mr = () => /* @__PURE__ */ e.jsx("div", { className: "text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100", children: "Data binding is set for this field" }), Ae = ({
271
+ }, yr = mr, br = () => /* @__PURE__ */ e.jsx("div", { className: "text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100", children: "Data binding is set for this field" }), Ae = ({
268
272
  createHistorySnapshot: r,
269
273
  properties: s,
270
274
  formData: t,
271
- onChange: n
275
+ onChange: a
272
276
  }) => {
273
- const [l] = Mt(), a = { type: "object", properties: {} }, d = {};
277
+ const [o] = Mt(), n = { type: "object", properties: {} }, d = {};
274
278
  return Object.keys(s).forEach((i) => {
275
- const o = s[i];
276
- if (O(["slot", "styles"], o.type))
279
+ const l = s[i];
280
+ if (O(["slot", "styles"], l.type))
277
281
  return;
278
- const p = g(o, "i18n", !1) ? `${i}-${l}` : i;
279
- a.properties[p] = _t(o, l), d[p] = Et(o, l);
282
+ const c = u(l, "i18n", !1) ? `${i}-${o}` : i;
283
+ n.properties[c] = _t(l, o), d[c] = Et(l, o);
280
284
  }), /* @__PURE__ */ e.jsx(
281
285
  Pt,
282
286
  {
283
287
  widgets: {
284
- binding: mr,
285
- richtext: qt,
286
- icon: Jt,
287
- image: Qt
288
+ binding: br,
289
+ richtext: Jt,
290
+ icon: Qt,
291
+ image: er
288
292
  },
289
293
  fields: {
290
- link: er
294
+ link: tr
291
295
  },
292
296
  idSeparator: ".",
293
297
  autoComplete: "off",
@@ -297,36 +301,36 @@ const gr = ({ data: r }) => {
297
301
  validator: Ot,
298
302
  uiSchema: d,
299
303
  onBlur: r,
300
- schema: a,
304
+ schema: n,
301
305
  formData: t,
302
- onChange: n
306
+ onChange: a
303
307
  }
304
308
  );
305
309
  };
306
310
  function fr() {
307
- const r = te(), { createSnapshot: s } = Ze(), t = ze(), n = Je(r._type), l = { ...r }, a = () => s(), d = ({ formData: u }, c) => {
308
- if (c) {
309
- const y = c.replace("root.", "");
310
- t([r._id], { [y]: g(u, y) });
311
+ const r = te(), { createSnapshot: s } = Ze(), t = ze(), a = Je(r._type), o = { ...r }, n = () => s(), d = ({ formData: p }, h) => {
312
+ if (h) {
313
+ const g = h.replace("root.", "");
314
+ t([r._id], { [g]: u(p, g) });
311
315
  }
312
316
  }, i = {
313
- _name: Zt({
317
+ _name: zt({
314
318
  title: "Name",
315
- default: g(r, "_name", r._type)
319
+ default: u(r, "_name", r._type)
316
320
  })
317
- }, o = dt(g(l, "_bindings", {})), p = T(() => {
318
- const u = ct(g(n, "props", {}));
319
- return pt(o, (c) => {
320
- delete u[c];
321
- }), u;
322
- }, [n, o]);
321
+ }, l = dt(u(o, "_bindings", {})), c = T(() => {
322
+ const p = ct(u(a, "props", {}));
323
+ return pt(l, (h) => {
324
+ delete p[h];
325
+ }), p;
326
+ }, [a, l]);
323
327
  return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
324
328
  /* @__PURE__ */ e.jsx(
325
329
  Ae,
326
330
  {
327
331
  onChange: d,
328
- createHistorySnapshot: a,
329
- formData: l,
332
+ createHistorySnapshot: n,
333
+ formData: o,
330
334
  properties: i
331
335
  }
332
336
  ),
@@ -337,7 +341,7 @@ function fr() {
337
341
  /* @__PURE__ */ e.jsx(
338
342
  "div",
339
343
  {
340
- className: `h-[8px] w-[8px] rounded-full ${b(g(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
344
+ className: `h-[8px] w-[8px] rounded-full ${f(u(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
341
345
  }
342
346
  ),
343
347
  "Data Binding"
@@ -345,9 +349,9 @@ function fr() {
345
349
  /* @__PURE__ */ e.jsx(de, { className: "pt-4 px-4", children: /* @__PURE__ */ e.jsx(
346
350
  yr,
347
351
  {
348
- bindingData: g(l, "_bindings", {}),
349
- onChange: (u) => {
350
- d({ formData: { ...l, _bindings: u } }, "root._bindings");
352
+ bindingData: u(o, "_bindings", {}),
353
+ onChange: (p) => {
354
+ d({ formData: { ...o, _bindings: p } }, "root._bindings");
351
355
  }
352
356
  }
353
357
  ) })
@@ -358,20 +362,20 @@ function fr() {
358
362
  "Static Content"
359
363
  ] }) }),
360
364
  /* @__PURE__ */ e.jsxs(de, { className: "pt-4", children: [
361
- b(o) ? "" : /* @__PURE__ */ e.jsxs("div", { className: "text-xs mx-4 border rounded-sm p-1 mb-1 mt-0 border-orange-500 text-orange-500 bg-orange-100", children: [
365
+ f(l) ? "" : /* @__PURE__ */ e.jsxs("div", { className: "text-xs mx-4 border rounded-sm p-1 mb-1 mt-0 border-orange-500 text-orange-500 bg-orange-100", children: [
362
366
  "Data binding is set for ",
363
- /* @__PURE__ */ e.jsx("b", { children: C(o, ut).join(", ") }),
367
+ /* @__PURE__ */ e.jsx("b", { children: C(l, ut).join(", ") }),
364
368
  " ",
365
- o.length === 1 ? "property" : "properties",
369
+ l.length === 1 ? "property" : "properties",
366
370
  ". Remove data binding to edit static content."
367
371
  ] }),
368
372
  /* @__PURE__ */ e.jsx(
369
373
  Ae,
370
374
  {
371
375
  onChange: d,
372
- createHistorySnapshot: a,
373
- formData: l,
374
- properties: p
376
+ createHistorySnapshot: n,
377
+ formData: o,
378
+ properties: c
375
379
  }
376
380
  )
377
381
  ] })
@@ -380,58 +384,58 @@ function fr() {
380
384
  /* @__PURE__ */ e.jsx("div", { className: "pb-60" })
381
385
  ] });
382
386
  }
383
- const De = new rr(lr, {
387
+ const De = new lr(or, {
384
388
  isCaseSensitive: !1,
385
389
  threshold: 0.2,
386
390
  minMatchCharLength: 2,
387
391
  keys: ["name"]
388
392
  });
389
- function br() {
393
+ function vr() {
390
394
  var R;
391
- const [r] = je(), s = te(), t = Ue(), n = Ge(), [l] = Ke(), [a, d] = k(""), i = (R = be(r)) == null ? void 0 : R.prop, o = gt((g(s, i, "").replace(sr, "").split(",").pop() || "").split(" "), b), p = () => {
392
- const f = a.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
393
- t(l, f, !0), d("");
394
- }, [u, c] = k([]), y = ({ value: f }) => {
395
- const j = f.trim().toLowerCase(), B = j.match(/.+:/g);
395
+ const [r] = je(), s = te(), t = Ue(), a = Ge(), [o] = Ke(), [n, d] = k(""), i = (R = fe(r)) == null ? void 0 : R.prop, l = gt((u(s, i, "").replace(nr, "").split(",").pop() || "").split(" "), f), c = () => {
396
+ const b = n.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
397
+ t(o, b, !0), d("");
398
+ }, [p, h] = k([]), g = ({ value: b }) => {
399
+ const j = b.trim().toLowerCase(), B = j.match(/.+:/g);
396
400
  let N = [];
397
401
  if (B && B.length > 0) {
398
402
  const [P] = B, F = j.replace(P, "");
399
- N = De.search(F).map((h) => ({
400
- ...h,
401
- item: { ...h.item, name: P + h.item.name }
403
+ N = De.search(F).map((m) => ({
404
+ ...m,
405
+ item: { ...m.item, name: P + m.item.name }
402
406
  }));
403
407
  } else
404
408
  N = De.search(j);
405
- c(C(N, "item"));
406
- }, x = () => {
407
- c([]);
408
- }, m = (f) => f.name, v = (f) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: f.name }), L = {
409
+ h(C(N, "item"));
410
+ }, y = () => {
411
+ h([]);
412
+ }, x = (b) => b.name, v = (b) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: b.name }), L = {
409
413
  autoComplete: "off",
410
414
  autoCorrect: "off",
411
415
  autoCapitalize: "off",
412
416
  spellCheck: !1,
413
417
  placeholder: "Enter class name",
414
- value: a,
415
- onKeyDown: (f) => {
416
- f.key === "Enter" && a.trim() !== "" && p();
418
+ value: n,
419
+ onKeyDown: (b) => {
420
+ b.key === "Enter" && n.trim() !== "" && c();
417
421
  },
418
- onChange: (f, { newValue: j }) => d(j),
422
+ onChange: (b, { newValue: j }) => d(j),
419
423
  className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
420
424
  };
421
425
  return /* @__PURE__ */ e.jsxs(
422
426
  "div",
423
427
  {
424
- className: `no-scrollbar flex ${u.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,
428
+ className: `no-scrollbar flex ${p.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,
425
429
  children: [
426
430
  /* @__PURE__ */ e.jsx(Ce, { className: "mt-2", children: "Add Tailwind classes" }),
427
431
  /* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
428
432
  /* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
429
433
  Qe,
430
434
  {
431
- suggestions: u,
432
- onSuggestionsFetchRequested: y,
433
- onSuggestionsClearRequested: x,
434
- getSuggestionValue: m,
435
+ suggestions: p,
436
+ onSuggestionsFetchRequested: g,
437
+ onSuggestionsClearRequested: y,
438
+ getSuggestionValue: x,
435
439
  renderSuggestion: v,
436
440
  inputProps: L,
437
441
  containerProps: {
@@ -449,32 +453,32 @@ function br() {
449
453
  {
450
454
  variant: "outline",
451
455
  className: "h-6 border-gray-700",
452
- onClick: p,
453
- disabled: a.trim() === "",
456
+ onClick: c,
457
+ disabled: n.trim() === "",
454
458
  size: "sm",
455
459
  children: /* @__PURE__ */ e.jsx(ve, {})
456
460
  }
457
461
  )
458
462
  ] }),
459
463
  /* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-wrap gap-2", children: [
460
- b(o) && /* @__PURE__ */ e.jsx("div", { className: "flex h-10 w-full items-center justify-center text-center text-sm text-gray-400", children: "No class added" }),
464
+ f(l) && /* @__PURE__ */ e.jsx("div", { className: "flex h-10 w-full items-center justify-center text-center text-sm text-gray-400", children: "No class added" }),
461
465
  se.Children.toArray(
462
- o.map((f) => /* @__PURE__ */ e.jsxs(
466
+ l.map((b) => /* @__PURE__ */ e.jsxs(
463
467
  "div",
464
468
  {
465
469
  className: "group relative flex cursor-default items-center gap-x-1 rounded-full border border-blue-600 bg-blue-500 p-px px-1.5 text-[11px] text-white hover:border-blue-900",
466
470
  children: [
467
- f,
471
+ b,
468
472
  /* @__PURE__ */ e.jsx(
469
473
  Fe,
470
474
  {
471
- onClick: () => n(l, [f]),
475
+ onClick: () => a(o, [b]),
472
476
  className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"
473
477
  }
474
478
  )
475
479
  ]
476
480
  },
477
- f
481
+ b
478
482
  ))
479
483
  )
480
484
  ] })
@@ -482,7 +486,7 @@ function br() {
482
486
  }
483
487
  );
484
488
  }
485
- const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], vr = {
489
+ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
486
490
  heading: "Flex Child",
487
491
  items: [
488
492
  { type: "arbitrary", label: "Basis", units: D, property: "flexBasis" },
@@ -491,7 +495,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], vr = {
491
495
  { type: "dropdown", label: "Grow", property: "flexGrow" },
492
496
  { type: "dropdown", label: "Shrink", property: "flexShrink" }
493
497
  ]
494
- }, wr = {
498
+ }, jr = {
495
499
  heading: "Grid Child",
496
500
  items: [
497
501
  { type: "range", label: "Col Span", property: "gridColSpan" },
@@ -502,7 +506,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], vr = {
502
506
  { type: "range", label: "Row End", property: "gridRowEnd" },
503
507
  { type: "range", label: "Order", property: "order" }
504
508
  ]
505
- }, jr = [
509
+ }, Cr = [
506
510
  {
507
511
  heading: "Display",
508
512
  items: [
@@ -904,12 +908,12 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], vr = {
904
908
  },
905
909
  {
906
910
  heading: "Classes",
907
- items: [{ component: br }]
911
+ items: [{ component: vr }]
908
912
  }
909
913
  ], rt = {
910
914
  "not-italic": () => /* @__PURE__ */ e.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z", fill: "white" }) }),
911
915
  // visibility
912
- visible: ft,
916
+ visible: bt,
913
917
  invisible: Te,
914
918
  // display
915
919
  hidden: Te,
@@ -945,7 +949,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], vr = {
945
949
  borderRadiusRight: K,
946
950
  borderRadiusBottom: q,
947
951
  borderRadiusLeft: J,
948
- borderRadiusTopLeft: bt,
952
+ borderRadiusTopLeft: ft,
949
953
  borderRadiusTopRight: vt,
950
954
  borderRadiusBottomRight: wt,
951
955
  borderRadiusBottomLeft: jt,
@@ -1100,60 +1104,60 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], vr = {
1100
1104
  )
1101
1105
  ] }),
1102
1106
  static: Bt
1103
- }, re = Le({ canReset: !1, canChange: !0 }), Cr = ({ children: r, canReset: s = !1, canChange: t = !0 }) => (
1107
+ }, re = Le({ canReset: !1, canChange: !0 }), kr = ({ children: r, canReset: s = !1, canChange: t = !0 }) => (
1104
1108
  // eslint-disable-next-line react/jsx-no-constructed-context-values
1105
1109
  /* @__PURE__ */ e.jsx(re.Provider, { value: { canReset: s, canChange: t }, children: r })
1106
1110
  ), lt = ({ label: r, property: s, onChange: t }) => {
1107
- const n = T(() => g(pe, `${s}.classes`, [""]), [s]), l = le(s), a = T(() => g(l, "cls", ""), [l]), { canChange: d } = ee(re), i = /\[.*\]/g.test(a);
1111
+ const a = T(() => u(pe, `${s}.classes`, [""]), [s]), o = le(s), n = T(() => u(o, "cls", ""), [o]), { canChange: d } = ee(re), i = /\[.*\]/g.test(n);
1108
1112
  return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded " : "grow", children: i ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
1109
- /* @__PURE__ */ e.jsx(nr, { className: "w-[70%] rounded py-1", readOnly: !0, value: a }),
1110
- /* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
1111
- /* @__PURE__ */ e.jsx(Y, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(we, {}) }) }),
1113
+ /* @__PURE__ */ e.jsx(ar, { className: "w-[70%] rounded py-1", readOnly: !0, value: n }),
1114
+ /* @__PURE__ */ e.jsxs(Y, { delayDuration: 100, children: [
1115
+ /* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(we, {}) }) }),
1112
1116
  /* @__PURE__ */ e.jsx(W, { children: "Current value is using a Tailwind arbitrary value." })
1113
1117
  ] })
1114
1118
  ] }) : /* @__PURE__ */ e.jsx(
1115
- me,
1119
+ ye,
1116
1120
  {
1117
1121
  rounded: r,
1118
- onChange: (o) => t(o, s),
1119
- selected: a,
1120
- options: n,
1122
+ onChange: (l) => t(l, s),
1123
+ selected: n,
1124
+ options: a,
1121
1125
  disabled: !d
1122
1126
  }
1123
1127
  ) });
1124
1128
  };
1125
- function me({ selected: r, onChange: s, rounded: t = !1, options: n, disabled: l = !1 }) {
1126
- const a = r.replace(/.*:/g, "").trim(), { undo: d, redo: i } = Ze();
1129
+ function ye({ selected: r, onChange: s, rounded: t = !1, options: a, disabled: o = !1 }) {
1130
+ const n = r.replace(/.*:/g, "").trim(), { undo: d, redo: i } = Ze();
1127
1131
  return /* @__PURE__ */ e.jsxs(
1128
1132
  "select",
1129
1133
  {
1130
- disabled: !n.length || l,
1134
+ disabled: !a.length || o,
1131
1135
  className: `${t ? "rounded-md border border-border" : "border-0"} w-full disable:bg-gray-500 h-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,
1132
- onChange: (o) => s(o.target.value),
1133
- onKeyDown: (o) => {
1134
- o.ctrlKey && (o.key === "z" && d(), o.key === "y" && i());
1136
+ onChange: (l) => s(l.target.value),
1137
+ onKeyDown: (l) => {
1138
+ l.ctrlKey && (l.key === "z" && d(), l.key === "y" && i());
1135
1139
  },
1136
- value: a,
1140
+ value: n,
1137
1141
  children: [
1138
1142
  /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
1139
1143
  $.Children.toArray(
1140
- n.map((o) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: o, children: o }))
1144
+ a.map((l) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: l, children: l }))
1141
1145
  )
1142
1146
  ]
1143
1147
  }
1144
1148
  );
1145
1149
  }
1146
- const kr = ({ property: r, onChange: s }) => {
1147
- const { canReset: t, canChange: n } = ee(re), l = le(r), a = T(() => g(l, "cls", ""), [l]), d = T(() => g(pe, `${r}.classes`, [""]), [r]), i = d.indexOf(a) > -1 ? d.indexOf(a) : 0, o = /\[.*\]/g.test(a);
1148
- return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: o ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: a }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1150
+ const Nr = ({ property: r, onChange: s }) => {
1151
+ const { canReset: t, canChange: a } = ee(re), o = le(r), n = T(() => u(o, "cls", ""), [o]), d = T(() => u(pe, `${r}.classes`, [""]), [r]), i = d.indexOf(n) > -1 ? d.indexOf(n) : 0, l = /\[.*\]/g.test(n);
1152
+ return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: l ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: n }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1149
1153
  /* @__PURE__ */ e.jsx(
1150
1154
  "button",
1151
1155
  {
1152
1156
  type: "button",
1153
1157
  className: "box-border w-2/12 rounded-tl rounded-bl bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",
1154
- disabled: !n && (!t || i - 1 < 0),
1158
+ disabled: !a && (!t || i - 1 < 0),
1155
1159
  onClick: () => s(Se(d, i - 1), r),
1156
- children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(At, { className: !n && (!t || i - 1 < 0) ? "text-gray-500" : "text-white/60" }) })
1160
+ children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(At, { className: !a && (!t || i - 1 < 0) ? "text-gray-500" : "text-white/60" }) })
1157
1161
  }
1158
1162
  ),
1159
1163
  /* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(lt, { label: !1, property: r, onChange: s }) }),
@@ -1162,33 +1166,33 @@ const kr = ({ property: r, onChange: s }) => {
1162
1166
  {
1163
1167
  type: "button",
1164
1168
  className: "w-2/12 rounded-tr rounded-br bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",
1165
- disabled: !n && (!t || i + 1 >= d.length),
1169
+ disabled: !a && (!t || i + 1 >= d.length),
1166
1170
  onClick: () => s(Se(d, i + 1), r),
1167
1171
  children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
1168
1172
  ve,
1169
1173
  {
1170
- className: !n && (!t || i + 1 >= d.length) ? "text-gray-500" : "text-white/60"
1174
+ className: !a && (!t || i + 1 >= d.length) ? "text-gray-500" : "text-white/60"
1171
1175
  }
1172
1176
  ) })
1173
1177
  }
1174
1178
  )
1175
1179
  ] }) });
1176
- }, Nr = ({ property: r, onChange: s }) => {
1177
- const t = T(() => g(pe, `${r}.classes`, [""]), [r]), { canChange: n } = ee(re), l = le(r), a = T(() => g(l, "cls", ""), [l]);
1178
- return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: C(t, (d) => /* @__PURE__ */ e.jsxs(X, { children: [
1179
- /* @__PURE__ */ e.jsx(Y, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1180
+ }, Sr = ({ property: r, onChange: s }) => {
1181
+ const t = T(() => u(pe, `${r}.classes`, [""]), [r]), { canChange: a } = ee(re), o = le(r), n = T(() => u(o, "cls", ""), [o]);
1182
+ return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: C(t, (d) => /* @__PURE__ */ e.jsxs(Y, { children: [
1183
+ /* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1180
1184
  "button",
1181
1185
  {
1182
1186
  type: "button",
1183
- disabled: !n,
1187
+ disabled: !a,
1184
1188
  onClick: () => s(d, r),
1185
- className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${a === d ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
1186
- children: $.createElement(g(rt, d, Xe))
1189
+ className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${n === d ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
1190
+ children: $.createElement(u(rt, d, Ye))
1187
1191
  }
1188
1192
  ) }),
1189
1193
  /* @__PURE__ */ e.jsx(W, { children: Q(ne(d)) })
1190
1194
  ] })) });
1191
- }, Sr = {
1195
+ }, Tr = {
1192
1196
  backgroundColor: "bg",
1193
1197
  textColor: "text",
1194
1198
  borderColor: "border",
@@ -1200,39 +1204,39 @@ const kr = ({ property: r, onChange: s }) => {
1200
1204
  toColor: "to",
1201
1205
  ringColor: "ring",
1202
1206
  ringOffsetColor: "ring-offset"
1203
- }, Tr = ({ property: r, onChange: s }) => {
1204
- const t = le(r), n = T(() => g(t, "cls", ""), [t]), { canChange: l } = ee(re), [a, d] = k([]), [i, o] = k({ color: "", shade: "" }), p = n.split("-"), u = g(p, "1", ""), c = g(p, "2", ""), y = I(
1207
+ }, Rr = ({ property: r, onChange: s }) => {
1208
+ const t = le(r), a = T(() => u(t, "cls", ""), [t]), { canChange: o } = ee(re), [n, d] = k([]), [i, l] = k({ color: "", shade: "" }), c = a.split("-"), p = u(c, "1", ""), h = u(c, "2", ""), g = I(
1205
1209
  // eslint-disable-next-line no-shadow
1206
- (m) => {
1207
- ["current", "inherit", "transparent", "black", "white"].includes(m) ? (d([]), o({ color: m })) : (d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), o((v) => ({ ...v, color: m, shade: v.shade ? v.shade : "500" })));
1210
+ (x) => {
1211
+ ["current", "inherit", "transparent", "black", "white"].includes(x) ? (d([]), l({ color: x })) : (d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), l((v) => ({ ...v, color: x, shade: v.shade ? v.shade : "500" })));
1208
1212
  },
1209
- [d, o]
1213
+ [d, l]
1210
1214
  );
1211
1215
  M(() => {
1212
- if (["current", "inherit", "transparent", "black", "white"].includes(u))
1216
+ if (["current", "inherit", "transparent", "black", "white"].includes(p))
1213
1217
  return d([]);
1214
1218
  d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
1215
- }, [u]);
1216
- const x = I(
1219
+ }, [p]);
1220
+ const y = I(
1217
1221
  // eslint-disable-next-line no-shadow
1218
- (m) => {
1219
- o({ color: u, shade: m });
1222
+ (x) => {
1223
+ l({ color: p, shade: x });
1220
1224
  },
1221
- [u]
1225
+ [p]
1222
1226
  );
1223
1227
  return M(() => {
1224
- o({ color: "", shade: "" });
1228
+ l({ color: "", shade: "" });
1225
1229
  }, [t]), M(() => {
1226
- const v = `${g(Sr, r, "")}-${i.color}${i.shade ? `-${i.shade}` : ""}`;
1227
- v.match(new RegExp(g(pe, `${r}.regExp`, ""))) && s(v, r);
1230
+ const v = `${u(Tr, r, "")}-${i.color}${i.shade ? `-${i.shade}` : ""}`;
1231
+ v.match(new RegExp(u(pe, `${r}.regExp`, ""))) && s(v, r);
1228
1232
  }, [i, s, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
1229
1233
  /* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
1230
- me,
1234
+ ye,
1231
1235
  {
1232
- disabled: !l,
1236
+ disabled: !o,
1233
1237
  rounded: !0,
1234
- selected: u,
1235
- onChange: y,
1238
+ selected: p,
1239
+ onChange: g,
1236
1240
  options: [
1237
1241
  "current",
1238
1242
  "transparent",
@@ -1265,18 +1269,18 @@ const kr = ({ property: r, onChange: s }) => {
1265
1269
  ]
1266
1270
  }
1267
1271
  ) }),
1268
- /* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(me, { rounded: !0, selected: c, disabled: !u || !l, onChange: x, options: a }) })
1272
+ /* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(ye, { rounded: !0, selected: h, disabled: !p || !o, onChange: y, options: n }) })
1269
1273
  ] });
1270
1274
  }, $e = (r, s) => {
1271
1275
  r = r.toLowerCase();
1272
1276
  let t = r.trim().replace(/ |\+/g, "");
1273
1277
  if ((t === "auto" || t === "none") && s.includes(t))
1274
1278
  return { value: "", unit: t };
1275
- const n = s.length ? new RegExp(s.join("|"), "g") : /XXXXXX/g;
1276
- t = t.replace(n, "");
1277
- const l = r.match(n), a = l && l.length > 1, d = !b(t) && Number.isNaN(Number(t));
1278
- return a || d ? { error: "Invalid value" } : l && (l[0] === "auto" || l[0] === "none") ? { value: l[0], unit: "" } : { value: t, unit: l ? l[0] : "" };
1279
- }, Rr = (r) => {
1279
+ const a = s.length ? new RegExp(s.join("|"), "g") : /XXXXXX/g;
1280
+ t = t.replace(a, "");
1281
+ const o = r.match(a), n = o && o.length > 1, d = !f(t) && Number.isNaN(Number(t));
1282
+ return n || d ? { error: "Invalid value" } : o && (o[0] === "auto" || o[0] === "none") ? { value: o[0], unit: "" } : { value: t, unit: o ? o[0] : "" };
1283
+ }, Vr = (r) => {
1280
1284
  const s = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
1281
1285
  if (["auto", "none"].includes(t))
1282
1286
  return { value: "", unit: t };
@@ -1299,9 +1303,9 @@ const kr = ({ property: r, onChange: s }) => {
1299
1303
  if (O(r, "scale-"))
1300
1304
  return { value: `${s}${`${t / 100}`}`, unit: "-" };
1301
1305
  if (Z(r, "border")) {
1302
- const n = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
1303
- if (n)
1304
- return { value: n[0].split("-").pop(), unit: "px" };
1306
+ const a = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
1307
+ if (a)
1308
+ return { value: a[0].split("-").pop(), unit: "px" };
1305
1309
  if (r.match(/border-?(x|y|t|r|b|l)?/g))
1306
1310
  return { value: "1", unit: "px" };
1307
1311
  }
@@ -1400,28 +1404,28 @@ const kr = ({ property: r, onChange: s }) => {
1400
1404
  if (["max", "min", "fit"].includes(t))
1401
1405
  return { value: r, unit: "class" };
1402
1406
  if (t.includes("/")) {
1403
- const [n, l] = C(t.split("/"), (a) => parseInt(a, 10));
1404
- return { value: s + (n / l * 100).toFixed(2).replace(".00", ""), unit: "%" };
1407
+ const [a, o] = C(t.split("/"), (n) => parseInt(n, 10));
1408
+ return { value: s + (a / o * 100).toFixed(2).replace(".00", ""), unit: "%" };
1405
1409
  }
1406
1410
  return xt(parseFloat(t)) ? { value: `${s + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
1407
- }, Vr = (r) => {
1408
- if (b(r))
1411
+ }, Hr = (r) => {
1412
+ if (f(r))
1409
1413
  return { value: "", unit: "" };
1410
1414
  const s = r.match(/\[.*\]/g);
1411
1415
  if (s === null)
1412
- return Hr(r);
1413
- const t = g(s, "0", "").replace(/\[|\]/g, ""), n = r.startsWith("-") ? "-" : "", l = be(t.match(/\d+.\d+|\d+/g));
1414
- return { value: `${n}${l}`, unit: t.replace(l, "") };
1415
- }, Hr = (r) => b(r) ? { value: "", unit: "" } : Rr(r), ot = $.createContext({
1416
+ return Br(r);
1417
+ const t = u(s, "0", "").replace(/\[|\]/g, ""), a = r.startsWith("-") ? "-" : "", o = fe(t.match(/\d+.\d+|\d+/g));
1418
+ return { value: `${a}${o}`, unit: t.replace(o, "") };
1419
+ }, Br = (r) => f(r) ? { value: "", unit: "" } : Vr(r), ot = $.createContext({
1416
1420
  setDragData: () => {
1417
1421
  }
1418
- }), Br = ({
1422
+ }), Ar = ({
1419
1423
  unit: r,
1420
1424
  currentValue: s,
1421
1425
  onDrag: t,
1422
- onDragEnd: n,
1423
- onDragStart: l,
1424
- negative: a,
1426
+ onDragEnd: a,
1427
+ onDragStart: o,
1428
+ negative: n,
1425
1429
  cssProperty: d
1426
1430
  }) => {
1427
1431
  const { setDragData: i } = ee(ot);
@@ -1429,190 +1433,190 @@ const kr = ({ property: r, onChange: s }) => {
1429
1433
  "button",
1430
1434
  {
1431
1435
  type: "button",
1432
- onMouseDown: (o) => {
1433
- const p = {
1436
+ onMouseDown: (l) => {
1437
+ const c = {
1434
1438
  onDrag: t,
1435
- onDragEnd: n,
1439
+ onDragEnd: a,
1436
1440
  dragging: !0,
1437
- dragStartY: o.pageY,
1441
+ dragStartY: l.pageY,
1438
1442
  dragStartValue: `${s}`,
1439
1443
  dragUnit: r,
1440
- negative: a,
1444
+ negative: n,
1441
1445
  cssProperty: d
1442
1446
  };
1443
- l(p), i(p);
1447
+ o(c), i(c);
1444
1448
  },
1445
1449
  color: void 0,
1446
1450
  className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
1447
1451
  children: /* @__PURE__ */ e.jsx($t, {})
1448
1452
  }
1449
1453
  );
1450
- }, Ar = ({ onSelect: r, current: s, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((n) => /* @__PURE__ */ e.jsx(
1454
+ }, Dr = ({ onSelect: r, current: s, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((a) => /* @__PURE__ */ e.jsx(
1451
1455
  et,
1452
1456
  {
1453
1457
  className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
1454
- color: s === n ? "primary" : void 0,
1458
+ color: s === a ? "primary" : void 0,
1455
1459
  size: "sm",
1456
- onClick: (l) => {
1457
- l.stopPropagation(), r(n);
1460
+ onClick: (o) => {
1461
+ o.stopPropagation(), r(a);
1458
1462
  },
1459
- children: n
1463
+ children: a
1460
1464
  },
1461
- n
1462
- )) }), Dr = (r) => {
1463
- const [s, t] = k(!1), [n, l] = k(""), { currentClass: a, onChange: d, classPrefix: i, cssProperty: o, units: p, negative: u } = r, [c, y] = k(o != null && o.toLowerCase().includes("width") ? "%" : p[0]), [x, m] = k(!1), [v, L] = k(""), [R, f] = k(!1), [j, B] = k(!1);
1465
+ a
1466
+ )) }), $r = (r) => {
1467
+ const [s, t] = k(!1), [a, o] = k(""), { currentClass: n, onChange: d, classPrefix: i, cssProperty: l, units: c, negative: p } = r, [h, g] = k(l != null && l.toLowerCase().includes("width") ? "%" : c[0]), [y, x] = k(!1), [v, L] = k(""), [R, b] = k(!1), [j, B] = k(!1);
1464
1468
  M(() => {
1465
- const { value: h, unit: w } = Vr(a);
1469
+ const { value: m, unit: w } = Hr(n);
1466
1470
  if (w === "") {
1467
- l(h), y(o != null && o.toLowerCase().includes("width") ? "%" : p[0]);
1471
+ o(m), g(l != null && l.toLowerCase().includes("width") ? "%" : c[0]);
1468
1472
  return;
1469
1473
  }
1470
- y(w), l(w === "class" || b(h) ? "" : h);
1471
- }, [a, o, p]);
1474
+ g(w), o(w === "class" || f(m) ? "" : m);
1475
+ }, [n, l, c]);
1472
1476
  const N = xe(
1473
- (h) => {
1474
- d(h);
1477
+ (m) => {
1478
+ d(m);
1475
1479
  },
1476
1480
  [d],
1477
1481
  200
1478
1482
  ), P = xe(
1479
- (h) => {
1480
- d(h, !1);
1483
+ (m) => {
1484
+ d(m, !1);
1481
1485
  },
1482
1486
  [d],
1483
1487
  200
1484
1488
  ), F = I(
1485
- (h = !1) => {
1486
- const w = $e(`${n}`, p);
1487
- if (g(w, "error", !1)) {
1488
- m(!0);
1489
+ (m = !1) => {
1490
+ const w = $e(`${a}`, c);
1491
+ if (u(w, "error", !1)) {
1492
+ x(!0);
1489
1493
  return;
1490
1494
  }
1491
- const S = g(w, "unit") !== "" ? g(w, "unit") : c;
1495
+ const S = u(w, "unit") !== "" ? u(w, "unit") : h;
1492
1496
  if (S === "auto" || S === "none") {
1493
1497
  N(`${i}${S}`);
1494
1498
  return;
1495
1499
  }
1496
- if (g(w, "value") === "")
1500
+ if (u(w, "value") === "")
1497
1501
  return;
1498
- const U = `${g(w, "value", "").startsWith("-") ? "-" : ""}${i}[${g(w, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
1499
- h ? P(U) : N(U);
1502
+ const U = `${u(w, "value", "").startsWith("-") ? "-" : ""}${i}[${u(w, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
1503
+ m ? P(U) : N(U);
1500
1504
  },
1501
- [N, P, n, c, i, p]
1505
+ [N, P, a, h, i, c]
1502
1506
  ), oe = I(
1503
- (h) => {
1504
- const w = $e(`${n}`, p);
1505
- if (g(w, "error", !1)) {
1506
- m(!0);
1507
+ (m) => {
1508
+ const w = $e(`${a}`, c);
1509
+ if (u(w, "error", !1)) {
1510
+ x(!0);
1507
1511
  return;
1508
1512
  }
1509
- if (h === "auto" || h === "none") {
1510
- N(`${i}${h}`);
1513
+ if (m === "auto" || m === "none") {
1514
+ N(`${i}${m}`);
1511
1515
  return;
1512
1516
  }
1513
- if (g(w, "value") === "")
1517
+ if (u(w, "value") === "")
1514
1518
  return;
1515
- const S = g(w, "unit") !== "" ? g(w, "unit") : h, U = `${g(w, "value", "").startsWith("-") ? "-" : ""}${i}[${g(w, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
1519
+ const S = u(w, "unit") !== "" ? u(w, "unit") : m, U = `${u(w, "value", "").startsWith("-") ? "-" : ""}${i}[${u(w, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
1516
1520
  N(U);
1517
1521
  },
1518
- [N, n, i, p]
1522
+ [N, a, i, c]
1519
1523
  );
1520
- return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: c === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1521
- /* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: a }),
1522
- /* @__PURE__ */ e.jsxs(X, { children: [
1523
- /* @__PURE__ */ e.jsx(Y, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(we, {}) }) }),
1524
+ return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: h === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1525
+ /* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: n }),
1526
+ /* @__PURE__ */ e.jsxs(Y, { children: [
1527
+ /* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(we, {}) }) }),
1524
1528
  /* @__PURE__ */ e.jsx(W, { children: "Current value is using a Tailwind preset class." })
1525
1529
  ] })
1526
1530
  ] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${R ? "z-auto" : ""}`, children: [
1527
1531
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
1528
- ["none", "auto"].indexOf(c) !== -1 ? null : /* @__PURE__ */ e.jsx(
1532
+ ["none", "auto"].indexOf(h) !== -1 ? null : /* @__PURE__ */ e.jsx(
1529
1533
  "input",
1530
1534
  {
1531
- readOnly: c === "class",
1532
- onKeyPress: (h) => {
1533
- h.key === "Enter" && F();
1535
+ readOnly: h === "class",
1536
+ onKeyPress: (m) => {
1537
+ m.key === "Enter" && F();
1534
1538
  },
1535
- onKeyDown: (h) => {
1536
- if (h.keyCode !== 38 && h.keyCode !== 40)
1539
+ onKeyDown: (m) => {
1540
+ if (m.keyCode !== 38 && m.keyCode !== 40)
1537
1541
  return;
1538
- h.preventDefault(), B(!0);
1539
- const w = ht(h.target.value);
1542
+ m.preventDefault(), B(!0);
1543
+ const w = ht(m.target.value);
1540
1544
  let S = Me(w) ? 0 : w;
1541
- h.keyCode === 38 && (S += 1), h.keyCode === 40 && (S -= 1);
1542
- const E = `${S}`, nt = `${E.startsWith("-") ? "-" : ""}${i}[${E.replace("-", "")}${c === "-" ? "" : c}]`;
1545
+ m.keyCode === 38 && (S += 1), m.keyCode === 40 && (S -= 1);
1546
+ const E = `${S}`, nt = `${E.startsWith("-") ? "-" : ""}${i}[${E.replace("-", "")}${h === "-" ? "" : h}]`;
1543
1547
  P(nt);
1544
1548
  },
1545
- onKeyUp: (h) => {
1546
- j && (h.preventDefault(), B(!1));
1549
+ onKeyUp: (m) => {
1550
+ j && (m.preventDefault(), B(!1));
1547
1551
  },
1548
1552
  onBlur: () => F(),
1549
- onChange: (h) => {
1550
- m(!1), l(h.target.value);
1553
+ onChange: (m) => {
1554
+ x(!1), o(m.target.value);
1551
1555
  },
1552
- onClick: (h) => {
1556
+ onClick: (m) => {
1553
1557
  var w;
1554
- (w = h == null ? void 0 : h.target) == null || w.select(), t(!1);
1558
+ (w = m == null ? void 0 : m.target) == null || w.select(), t(!1);
1555
1559
  },
1556
- value: R ? v : n,
1560
+ value: R ? v : a,
1557
1561
  className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
1558
1562
  " ",
1559
- x ? "border-red-500 text-red-500" : "border-foreground/20"
1563
+ y ? "border-red-500 text-red-500" : "border-foreground/20"
1560
1564
  )
1561
1565
  }
1562
1566
  ),
1563
- /* @__PURE__ */ e.jsxs(X, { open: s, delayDuration: 100, children: [
1564
- /* @__PURE__ */ e.jsx(Y, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1567
+ /* @__PURE__ */ e.jsxs(Y, { open: s, delayDuration: 100, children: [
1568
+ /* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1565
1569
  "button",
1566
1570
  {
1567
1571
  type: "button",
1568
1572
  onClick: () => t(!s),
1569
1573
  className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
1570
1574
  children: [
1571
- /* @__PURE__ */ e.jsx("span", { className: `inline-block ${p.length === 1 ? "px-2 font-semibold" : ""}`, children: c }),
1572
- p.length > 1 ? /* @__PURE__ */ e.jsx(Dt, {}) : null
1575
+ /* @__PURE__ */ e.jsx("span", { className: `inline-block ${c.length === 1 ? "px-2 font-semibold" : ""}`, children: h }),
1576
+ c.length > 1 ? /* @__PURE__ */ e.jsx(Dt, {}) : null
1573
1577
  ]
1574
1578
  }
1575
1579
  ) }),
1576
- /* @__PURE__ */ e.jsx(Kt, { children: /* @__PURE__ */ e.jsx(W, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
1577
- Ar,
1580
+ /* @__PURE__ */ e.jsx(qt, { children: /* @__PURE__ */ e.jsx(W, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
1581
+ Dr,
1578
1582
  {
1579
- units: p,
1580
- current: c,
1581
- onSelect: (h) => {
1582
- t(!1), y(h), oe(h);
1583
+ units: c,
1584
+ current: h,
1585
+ onSelect: (m) => {
1586
+ t(!1), g(m), oe(m);
1583
1587
  }
1584
1588
  }
1585
1589
  ) }) })
1586
1590
  ] })
1587
1591
  ] }),
1588
- ["none", "auto"].indexOf(c) !== -1 || R ? null : /* @__PURE__ */ e.jsx(
1589
- Br,
1592
+ ["none", "auto"].indexOf(h) !== -1 || R ? null : /* @__PURE__ */ e.jsx(
1593
+ Ar,
1590
1594
  {
1591
- onDragStart: () => f(!0),
1592
- onDragEnd: (h) => {
1593
- if (L(() => ""), f(!1), b(h))
1595
+ onDragStart: () => b(!0),
1596
+ onDragEnd: (m) => {
1597
+ if (L(() => ""), b(!1), f(m))
1594
1598
  return;
1595
- const w = `${h}`, E = `${w.startsWith("-") ? "-" : ""}${i}[${w.replace("-", "")}${c === "-" ? "" : c}]`;
1599
+ const w = `${m}`, E = `${w.startsWith("-") ? "-" : ""}${i}[${w.replace("-", "")}${h === "-" ? "" : h}]`;
1596
1600
  N(E);
1597
1601
  },
1598
- onDrag: (h) => {
1599
- if (b(h))
1602
+ onDrag: (m) => {
1603
+ if (f(m))
1600
1604
  return;
1601
- L(h);
1602
- const w = `${h}`, E = `${w.startsWith("-") ? "-" : ""}${i}[${w.replace("-", "")}${c === "-" ? "" : c}]`;
1605
+ L(m);
1606
+ const w = `${m}`, E = `${w.startsWith("-") ? "-" : ""}${i}[${w.replace("-", "")}${h === "-" ? "" : h}]`;
1603
1607
  P(E);
1604
1608
  },
1605
- currentValue: n,
1606
- unit: c,
1607
- negative: u,
1608
- cssProperty: o
1609
+ currentValue: a,
1610
+ unit: h,
1611
+ negative: p,
1612
+ cssProperty: l
1609
1613
  }
1610
1614
  )
1611
1615
  ] }) }) });
1612
1616
  }, le = (r) => {
1613
1617
  const s = ce();
1614
- return yt(s, { property: r });
1615
- }, $r = (r, s) => {
1618
+ return mt(s, { property: r });
1619
+ }, Ir = (r, s) => {
1616
1620
  const t = {
1617
1621
  xs: 0,
1618
1622
  sm: 1,
@@ -1621,8 +1625,8 @@ const kr = ({ property: r, onChange: s }) => {
1621
1625
  xl: 4,
1622
1626
  "2xl": 5
1623
1627
  };
1624
- return t[g(r, "mq", "xs")] <= t[s];
1625
- }, Ir = {
1628
+ return t[u(r, "mq", "xs")] <= t[s];
1629
+ }, Lr = {
1626
1630
  width: "w-",
1627
1631
  height: "h-",
1628
1632
  minWidth: "min-w-",
@@ -1695,25 +1699,25 @@ const kr = ({ property: r, onChange: s }) => {
1695
1699
  lg: "1024px",
1696
1700
  xl: "1280px",
1697
1701
  "2xl": "1536px"
1698
- }, Lr = (r) => `${r.toUpperCase()} ${Ie[r] ? `(${Ie[r]} & up)` : ""}`, ke = (r) => {
1699
- const { type: s = "icons", label: t, property: n, onEmitChange: l = () => {
1700
- }, units: a, negative: d = !1 } = r, [i] = Ft(), [o] = qe(), [, p] = He(), u = le(n), c = Ue(), y = Ge(), [x] = Ke(), m = T(() => g(u, "fullCls", ""), [u]), v = I(
1702
+ }, Pr = (r) => `${r.toUpperCase()} ${Ie[r] ? `(${Ie[r]} & up)` : ""}`, ke = (r) => {
1703
+ const { type: s = "icons", label: t, property: a, onEmitChange: o = () => {
1704
+ }, units: n, negative: d = !1 } = r, [i] = Ft(), [l] = qe(), [, c] = He(), p = le(a), h = Ue(), g = Ge(), [y] = Ke(), x = T(() => u(p, "fullCls", ""), [p]), v = I(
1701
1705
  (N, P = !0) => {
1702
- const F = { dark: i, mq: p, mod: o, cls: N, property: n, fullCls: "" };
1703
- (i || o !== "") && (F.mq = "xs");
1704
- const oe = or(F);
1705
- c(x, [oe], P);
1706
+ const F = { dark: i, mq: c, mod: l, cls: N, property: a, fullCls: "" };
1707
+ (i || l !== "") && (F.mq = "xs");
1708
+ const oe = sr(F);
1709
+ h(y, [oe], P);
1706
1710
  },
1707
- [x, i, p, o, n, c]
1711
+ [y, i, c, l, a, h]
1708
1712
  ), L = I(() => {
1709
- y(x, [m]);
1710
- }, [x, m, y]), R = T(() => $r(u, p), [u, p]);
1713
+ g(y, [x]);
1714
+ }, [y, x, g]), R = T(() => Ir(p, c), [p, c]);
1711
1715
  M(() => {
1712
- l(R, u);
1713
- }, [R, l, u]);
1714
- const [, , f] = He(), j = I(
1716
+ o(R, p);
1717
+ }, [R, o, p]);
1718
+ const [, , b] = He(), j = I(
1715
1719
  (N) => {
1716
- f({
1720
+ b({
1717
1721
  xs: 400,
1718
1722
  sm: 640,
1719
1723
  md: 800,
@@ -1722,30 +1726,30 @@ const kr = ({ property: r, onChange: s }) => {
1722
1726
  "2xl": 1920
1723
1727
  }[N]);
1724
1728
  },
1725
- [f]
1726
- ), B = g(u, "dark", null) === i && g(u, "mod", null) === o && g(u, "mq", null) === p;
1727
- return /* @__PURE__ */ e.jsx(Cr, { canChange: R, canReset: u && B, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
1728
- /* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${u && !B ? "text-foreground" : ""}`, children: t }) }),
1729
+ [b]
1730
+ ), B = u(p, "dark", null) === i && u(p, "mod", null) === l && u(p, "mq", null) === c;
1731
+ return /* @__PURE__ */ e.jsx(kr, { canChange: R, canReset: p && B, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
1732
+ /* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${p && !B ? "text-foreground" : ""}`, children: t }) }),
1729
1733
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
1730
1734
  /* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
1731
1735
  s === "arbitrary" ? /* @__PURE__ */ e.jsx(
1732
- Dr,
1736
+ $r,
1733
1737
  {
1734
- currentClass: g(u, "cls", ""),
1735
- classPrefix: g(Ir, n, ""),
1736
- units: a || [],
1738
+ currentClass: u(p, "cls", ""),
1739
+ classPrefix: u(Lr, a, ""),
1740
+ units: n || [],
1737
1741
  onChange: v,
1738
1742
  negative: d,
1739
- cssProperty: n
1743
+ cssProperty: a
1740
1744
  }
1741
1745
  ) : null,
1742
- s === "icons" && /* @__PURE__ */ e.jsx(Nr, { property: n, onChange: v }),
1743
- s === "range" && /* @__PURE__ */ e.jsx(kr, { property: n, onChange: v }),
1744
- s === "color" && /* @__PURE__ */ e.jsx(Tr, { property: n, onChange: v }),
1745
- s === "dropdown" && /* @__PURE__ */ e.jsx(lt, { label: t, property: n, onChange: v })
1746
+ s === "icons" && /* @__PURE__ */ e.jsx(Sr, { property: a, onChange: v }),
1747
+ s === "range" && /* @__PURE__ */ e.jsx(Nr, { property: a, onChange: v }),
1748
+ s === "color" && /* @__PURE__ */ e.jsx(Rr, { property: a, onChange: v }),
1749
+ s === "dropdown" && /* @__PURE__ */ e.jsx(lt, { label: t, property: a, onChange: v })
1746
1750
  ] }),
1747
- /* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${m ? "visible" : "invisible"}`, children: B ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => L(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Ye, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : R && u ? /* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
1748
- /* @__PURE__ */ e.jsx(Y, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1751
+ /* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${x ? "visible" : "invisible"}`, children: B ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => L(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Xe, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : R && p ? /* @__PURE__ */ e.jsxs(Y, { delayDuration: 100, children: [
1752
+ /* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1749
1753
  "button",
1750
1754
  {
1751
1755
  type: "button",
@@ -1756,19 +1760,19 @@ const kr = ({ property: r, onChange: s }) => {
1756
1760
  /* @__PURE__ */ e.jsx(W, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
1757
1761
  "Current style is set at  ",
1758
1762
  /* @__PURE__ */ e.jsxs("span", { className: "font-bold ", children: [
1759
- Lr(g(u, "mq")),
1760
- i && !u.dark ? "(Light mode)" : ""
1763
+ Pr(u(p, "mq")),
1764
+ i && !p.dark ? "(Light mode)" : ""
1761
1765
  ] }),
1762
1766
  /* @__PURE__ */ e.jsx("br", {}),
1763
1767
  /* @__PURE__ */ e.jsxs(
1764
1768
  "button",
1765
1769
  {
1766
1770
  type: "button",
1767
- onClick: () => j(g(u, "mq")),
1771
+ onClick: () => j(u(p, "mq")),
1768
1772
  className: "block w-full cursor-default text-right font-semibold text-blue-500",
1769
1773
  children: [
1770
1774
  "Switch to ",
1771
- g(u, "mq").toUpperCase()
1775
+ u(p, "mq").toUpperCase()
1772
1776
  ]
1773
1777
  }
1774
1778
  )
@@ -1776,48 +1780,48 @@ const kr = ({ property: r, onChange: s }) => {
1776
1780
  ] }) : null })
1777
1781
  ] })
1778
1782
  ] }) });
1779
- }, Pr = ["px", "%", "em", "rem", "ch", "vh", "vw"], st = ({
1783
+ }, Or = ["px", "%", "em", "rem", "ch", "vh", "vw"], st = ({
1780
1784
  label: r,
1781
1785
  options: s,
1782
1786
  borderB: t = !1,
1783
- borderT: n = !1,
1784
- type: l = "arbitrary",
1785
- units: a = Pr,
1787
+ borderT: a = !1,
1788
+ type: o = "arbitrary",
1789
+ units: n = Or,
1786
1790
  negative: d = !1
1787
1791
  }) => {
1788
- const [i, o] = k(s[0].key), p = ce(), u = I((c) => C(p, "property").includes(c), [p]);
1792
+ const [i, l] = k(s[0].key), c = ce(), p = I((h) => C(c, "property").includes(h), [c]);
1789
1793
  return /* @__PURE__ */ e.jsxs(
1790
1794
  "div",
1791
1795
  {
1792
- className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${n ? "border-t" : ""}`,
1796
+ className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${a ? "border-t" : ""}`,
1793
1797
  children: [
1794
1798
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
1795
1799
  r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: r }),
1796
1800
  /* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: $.Children.toArray(
1797
- s.map(({ label: c, key: y }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(X, { children: [
1798
- /* @__PURE__ */ e.jsx(Y, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1801
+ s.map(({ label: h, key: g }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(Y, { children: [
1802
+ /* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1799
1803
  "button",
1800
1804
  {
1801
1805
  type: "button",
1802
- onClick: () => o(y),
1803
- className: `relative cursor-pointer rounded-full p-1 text-[8px] ${y === i ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
1806
+ onClick: () => l(g),
1807
+ className: `relative cursor-pointer rounded-full p-1 text-[8px] ${g === i ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
1804
1808
  children: [
1805
1809
  $.createElement("div", {
1806
- className: u(y) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
1810
+ className: p(g) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
1807
1811
  }),
1808
- $.createElement(g(rt, y, Xe), { className: "text-inherit w-3 h-3" })
1812
+ $.createElement(u(rt, g, Ye), { className: "text-inherit w-3 h-3" })
1809
1813
  ]
1810
1814
  }
1811
1815
  ) }),
1812
- /* @__PURE__ */ e.jsx(W, { children: Q(ne(c)) })
1816
+ /* @__PURE__ */ e.jsx(W, { children: Q(ne(h)) })
1813
1817
  ] }) }))
1814
1818
  ) })
1815
1819
  ] }),
1816
1820
  /* @__PURE__ */ e.jsx("div", { className: "mt-0 flex items-center", children: /* @__PURE__ */ e.jsx(
1817
1821
  ke,
1818
1822
  {
1819
- type: l,
1820
- units: [...a],
1823
+ type: o,
1824
+ units: [...n],
1821
1825
  label: "",
1822
1826
  property: i,
1823
1827
  negative: d
@@ -1826,73 +1830,73 @@ const kr = ({ property: r, onChange: s }) => {
1826
1830
  ]
1827
1831
  }
1828
1832
  );
1829
- }, Or = ({ heading: r, items: s }) => {
1830
- const t = ce(), n = T(() => {
1831
- const l = (i) => z(
1832
- i.map((o) => o.styleType === "multiple" ? C(o.options, "key") : o.property)
1833
- ), a = z(
1834
- s.map((i) => i.styleType === "accordion" ? l(i.items) : i.styleType === "multiple" ? C(i.options, "key") : i.property)
1833
+ }, Mr = ({ heading: r, items: s }) => {
1834
+ const t = ce(), a = T(() => {
1835
+ const o = (i) => z(
1836
+ i.map((l) => l.styleType === "multiple" ? C(l.options, "key") : l.property)
1837
+ ), n = z(
1838
+ s.map((i) => i.styleType === "accordion" ? o(i.items) : i.styleType === "multiple" ? C(i.options, "key") : i.property)
1835
1839
  ), d = C(t, "property");
1836
- return _e(a, d).length > 0;
1840
+ return _e(n, d).length > 0;
1837
1841
  }, [t, s]);
1838
1842
  return /* @__PURE__ */ e.jsxs("details", { children: [
1839
1843
  /* @__PURE__ */ e.jsx("summary", { className: "my-px cursor-default rounded-md bg-background p-px px-2 text-[11px] text-foreground", children: /* @__PURE__ */ e.jsxs("div", { className: "inline", children: [
1840
1844
  r,
1841
- n ? /* @__PURE__ */ e.jsx(
1845
+ a ? /* @__PURE__ */ e.jsx(
1842
1846
  "span",
1843
1847
  {
1844
- className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${n ? "bg-blue-500" : "bg-gray-300"}`
1848
+ className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${a ? "bg-blue-500" : "bg-gray-300"}`
1845
1849
  }
1846
1850
  ) : null
1847
1851
  ] }) }),
1848
- /* @__PURE__ */ e.jsx("div", { className: "p-2", children: s.map((l) => l.styleType === "multiple" ? /* @__PURE__ */ e.jsx(st, { ...l }, l.label) : /* @__PURE__ */ e.jsx(ke, { ...l }, l.label)) })
1852
+ /* @__PURE__ */ e.jsx("div", { className: "p-2", children: s.map((o) => o.styleType === "multiple" ? /* @__PURE__ */ e.jsx(st, { ...o }, o.label) : /* @__PURE__ */ e.jsx(ke, { ...o }, o.label)) })
1849
1853
  ] });
1850
- }, Mr = Le({}), ge = ({ section: r }) => {
1854
+ }, _r = Le({}), ge = ({ section: r }) => {
1851
1855
  const s = ce(), t = I(
1852
- (a = []) => {
1856
+ (n = []) => {
1853
1857
  const d = {};
1854
- for (let o = 0; o < s.length; o++)
1855
- d[s[o].property] = s[o].cls;
1858
+ for (let l = 0; l < s.length; l++)
1859
+ d[s[l].property] = s[l].cls;
1856
1860
  let i = !0;
1857
- for (const o in a)
1858
- if (!ue(d, o) || d[o] !== a[o]) {
1861
+ for (const l in n)
1862
+ if (!ue(d, l) || d[l] !== n[l]) {
1859
1863
  i = !1;
1860
1864
  break;
1861
1865
  }
1862
1866
  return i;
1863
1867
  },
1864
1868
  [s]
1865
- ), n = T(() => {
1869
+ ), a = T(() => {
1866
1870
  if (s.length > 0 && r.heading === "Classes")
1867
1871
  return !0;
1868
- const a = (o) => z(
1869
- o.map((p) => p.styleType === "multiple" ? z(C(p.options, "key")) : p.property)
1872
+ const n = (l) => z(
1873
+ l.map((c) => c.styleType === "multiple" ? z(C(c.options, "key")) : c.property)
1870
1874
  ), d = z(
1871
- r.items.map((o) => o.styleType === "accordion" ? a(o.items) : o.styleType === "multiple" ? z(C(o.options, "key")) : o.property)
1875
+ r.items.map((l) => l.styleType === "accordion" ? n(l.items) : l.styleType === "multiple" ? z(C(l.options, "key")) : l.property)
1872
1876
  ), i = C(s, "property");
1873
1877
  return _e(d, i).length > 0;
1874
- }, [s, r.heading, r.items]), l = T(() => ({}), []);
1875
- return /* @__PURE__ */ e.jsx(Mr.Provider, { value: l, children: /* @__PURE__ */ e.jsxs(ae, { value: r.heading, children: [
1878
+ }, [s, r.heading, r.items]), o = T(() => ({}), []);
1879
+ return /* @__PURE__ */ e.jsx(_r.Provider, { value: o, children: /* @__PURE__ */ e.jsxs(ae, { value: r.heading, children: [
1876
1880
  /* @__PURE__ */ e.jsx(ie, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
1877
- /* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${n ? "bg-blue-500" : "bg-gray-300"}` }),
1881
+ /* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${a ? "bg-blue-500" : "bg-gray-300"}` }),
1878
1882
  r.heading
1879
1883
  ] }) }),
1880
1884
  /* @__PURE__ */ e.jsx(de, { className: "bg-gray-100 px-3.5 py-2", children: $.Children.toArray(
1881
- r.items.map((a) => ue(a, "component") ? $.createElement(a.component, { key: a.label }) : ue(a, "styleType") ? a.styleType === "multiple" ? /* @__PURE__ */ e.jsx(st, { ...a }, a.label) : a.styleType === "accordion" && t(a == null ? void 0 : a.conditions) ? /* @__PURE__ */ e.jsx(Or, { ...a }, a.label) : null : /* @__PURE__ */ e.jsx(ke, { ...a }, a.label))
1885
+ r.items.map((n) => ue(n, "component") ? $.createElement(n.component, { key: n.label }) : ue(n, "styleType") ? n.styleType === "multiple" ? /* @__PURE__ */ e.jsx(st, { ...n }, n.label) : n.styleType === "accordion" && t(n == null ? void 0 : n.conditions) ? /* @__PURE__ */ e.jsx(Mr, { ...n }, n.label) : null : /* @__PURE__ */ e.jsx(ke, { ...n }, n.label))
1882
1886
  ) })
1883
1887
  ] }) });
1884
- }, _r = ({
1888
+ }, Er = ({
1885
1889
  item: r,
1886
1890
  index: s,
1887
1891
  canDelete: t,
1888
- onChange: n,
1889
- onRemove: l
1892
+ onChange: a,
1893
+ onRemove: o
1890
1894
  }) => /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col gap-1 border-gray-400 py-2 ${t ? "border-b" : ""}`, children: [
1891
1895
  /* @__PURE__ */ e.jsx(
1892
1896
  "input",
1893
1897
  {
1894
1898
  name: "key",
1895
- onChange: (a) => n(a, s),
1899
+ onChange: (n) => a(n, s),
1896
1900
  value: r.key,
1897
1901
  placeholder: "Key",
1898
1902
  className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
@@ -1905,7 +1909,7 @@ const kr = ({ property: r, onChange: s }) => {
1905
1909
  "input",
1906
1910
  {
1907
1911
  name: "value",
1908
- onChange: (a) => b(r.key) ? {} : n(a, s),
1912
+ onChange: (n) => f(r.key) ? {} : a(n, s),
1909
1913
  value: r.value,
1910
1914
  placeholder: "Value",
1911
1915
  className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
@@ -1914,32 +1918,32 @@ const kr = ({ property: r, onChange: s }) => {
1914
1918
  }
1915
1919
  ),
1916
1920
  /* @__PURE__ */ e.jsx(
1917
- Ye,
1921
+ Xe,
1918
1922
  {
1919
- onClick: l,
1923
+ onClick: o,
1920
1924
  className: "h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"
1921
1925
  }
1922
1926
  )
1923
1927
  ] })
1924
- ] }), Er = ({ section: r }) => {
1925
- var y;
1926
- const { setSyncState: s } = Xt(), t = te(), [n, l] = k([]), [a] = je(), d = ze(), i = `${g(a, "0.prop")}_attrs`;
1928
+ ] }), Fr = ({ section: r }) => {
1929
+ var g;
1930
+ const { setSyncState: s } = Yt(), t = te(), [a, o] = k([]), [n] = je(), d = ze(), i = `${u(n, "0.prop")}_attrs`;
1927
1931
  se.useEffect(() => {
1928
- const x = C(g(t, i), (m, v) => ({ key: v, value: m }));
1929
- b(x) ? l([]) : l(x);
1930
- }, [g(t, i)]);
1931
- const o = () => l([...n, { key: "", value: "" }]), p = (x) => {
1932
- const m = Oe(n, (v, L) => x !== L);
1933
- c(m);
1934
- }, u = (x, m) => {
1935
- const v = [...n];
1936
- v[m][x.target.name] = x.target.value, c(v);
1937
- }, c = se.useCallback(
1938
- (x = []) => {
1939
- const m = {};
1940
- fe(x, (v) => {
1941
- b(v.key) || Pe(m, v.key, v.value);
1942
- }), d([g(t, "_id")], { [i]: m }), s("UNSAVED");
1932
+ const y = C(u(t, i), (x, v) => ({ key: v, value: x }));
1933
+ f(y) ? o([]) : o(y);
1934
+ }, [u(t, i)]);
1935
+ const l = () => o([...a, { key: "", value: "" }]), c = (y) => {
1936
+ const x = Oe(a, (v, L) => y !== L);
1937
+ h(x);
1938
+ }, p = (y, x) => {
1939
+ const v = [...a];
1940
+ v[x][y.target.name] = y.target.value, h(v);
1941
+ }, h = se.useCallback(
1942
+ (y = []) => {
1943
+ const x = {};
1944
+ be(y, (v) => {
1945
+ f(v.key) || Pe(x, v.key, v.value);
1946
+ }), d([u(t, "_id")], { [i]: x }), s("UNSAVED");
1943
1947
  },
1944
1948
  [t, s, d, i]
1945
1949
  );
@@ -1948,7 +1952,7 @@ const kr = ({ property: r, onChange: s }) => {
1948
1952
  /* @__PURE__ */ e.jsx(
1949
1953
  "div",
1950
1954
  {
1951
- className: `h-[8px] w-[8px] rounded-full ${b(g(t, i)) ? "bg-gray-300" : "bg-blue-500"}`
1955
+ className: `h-[8px] w-[8px] rounded-full ${f(u(t, i)) ? "bg-gray-300" : "bg-blue-500"}`
1952
1956
  }
1953
1957
  ),
1954
1958
  "Attributes"
@@ -1959,10 +1963,10 @@ const kr = ({ property: r, onChange: s }) => {
1959
1963
  /* @__PURE__ */ e.jsxs(
1960
1964
  "div",
1961
1965
  {
1962
- className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!b(n) && b((y = he(n)) == null ? void 0 : y.key) ? "cursor-not-allowed border-gray-400 text-gray-400" : "cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,
1966
+ className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!f(a) && f((g = he(a)) == null ? void 0 : g.key) ? "cursor-not-allowed border-gray-400 text-gray-400" : "cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,
1963
1967
  onClick: () => {
1964
- var x;
1965
- !b(n) && b((x = he(n)) == null ? void 0 : x.key) || o();
1968
+ var y;
1969
+ !f(a) && f((y = he(a)) == null ? void 0 : y.key) || l();
1966
1970
  },
1967
1971
  children: [
1968
1972
  /* @__PURE__ */ e.jsx(ve, { width: 12, height: 12 }),
@@ -1972,18 +1976,18 @@ const kr = ({ property: r, onChange: s }) => {
1972
1976
  )
1973
1977
  ] }),
1974
1978
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
1975
- b(n) && /* @__PURE__ */ e.jsx("div", { className: "flex h-12 items-center justify-center text-sm text-gray-400", children: "Click + Add to add attributes" }),
1979
+ f(a) && /* @__PURE__ */ e.jsx("div", { className: "flex h-12 items-center justify-center text-sm text-gray-400", children: "Click + Add to add attributes" }),
1976
1980
  se.Children.toArray(
1977
- C(n, (x, m) => {
1978
- const v = n.length > 0 && m < n.length - 1;
1981
+ C(a, (y, x) => {
1982
+ const v = a.length > 0 && x < a.length - 1;
1979
1983
  return /* @__PURE__ */ e.jsx(
1980
- _r,
1984
+ Er,
1981
1985
  {
1982
- item: x,
1983
- index: m,
1986
+ item: y,
1987
+ index: x,
1984
1988
  canDelete: v,
1985
- onChange: u,
1986
- onRemove: () => p(m)
1989
+ onChange: p,
1990
+ onRemove: () => c(x)
1987
1991
  }
1988
1992
  );
1989
1993
  })
@@ -1992,11 +1996,11 @@ const kr = ({ property: r, onChange: s }) => {
1992
1996
  ] }) })
1993
1997
  ] });
1994
1998
  };
1995
- function Fr() {
1996
- const [r, s] = qe(), { flexChild: t, gridChild: n } = Yt(), [, l] = tr(Wt), { t: a } = Ee(), [d] = je();
1997
- return b(d) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
1999
+ function Yr() {
2000
+ const [r, s] = qe(), { flexChild: t, gridChild: a } = Xt(), [, o] = rr(Wt), { t: n } = Ee(), [d] = je();
2001
+ return f(d) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
1998
2002
  /* @__PURE__ */ e.jsx(We, { className: "mx-auto text-3xl" }),
1999
- /* @__PURE__ */ e.jsx("h1", { children: a("no_styling_block_selected") }),
2003
+ /* @__PURE__ */ e.jsx("h1", { children: n("no_styling_block_selected") }),
2000
2004
  /* @__PURE__ */ e.jsxs("p", { className: "text-xs ", children: [
2001
2005
  "Hint: Styling allowed blocks are highlighted with",
2002
2006
  " ",
@@ -2005,12 +2009,12 @@ function Fr() {
2005
2009
  ] })
2006
2010
  ] }) }) : (
2007
2011
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
2008
- /* @__PURE__ */ e.jsxs("div", { onClick: () => l(!1), className: "flex h-full flex-col", children: [
2012
+ /* @__PURE__ */ e.jsxs("div", { onClick: () => o(!1), className: "flex h-full flex-col", children: [
2009
2013
  /* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-x-4 space-y-3 border-b border-border px-4 py-2", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-1.5", children: [
2010
2014
  /* @__PURE__ */ e.jsx(Ce, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
2011
- /* @__PURE__ */ e.jsxs(ir, { defaultValue: r, onValueChange: (i) => s(i), children: [
2012
- /* @__PURE__ */ e.jsx(dr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(cr, { placeholder: "State" }) }),
2013
- /* @__PURE__ */ e.jsxs(pr, { children: [
2015
+ /* @__PURE__ */ e.jsxs(dr, { defaultValue: r, onValueChange: (i) => s(i), children: [
2016
+ /* @__PURE__ */ e.jsx(cr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(pr, { placeholder: "State" }) }),
2017
+ /* @__PURE__ */ e.jsxs(ur, { children: [
2014
2018
  /* @__PURE__ */ e.jsx(A, { value: "", children: "Normal" }),
2015
2019
  /* @__PURE__ */ e.jsx(A, { value: "hover", children: "Hover" }),
2016
2020
  /* @__PURE__ */ e.jsx(A, { value: "active", children: "Active" }),
@@ -2026,12 +2030,12 @@ function Fr() {
2026
2030
  ] })
2027
2031
  ] })
2028
2032
  ] }) }),
2029
- /* @__PURE__ */ e.jsxs(ar, { className: "no-scrollbar -mx-1 h-full overflow-x-hidden", children: [
2033
+ /* @__PURE__ */ e.jsxs(ir, { className: "no-scrollbar -mx-1 h-full overflow-x-hidden", children: [
2030
2034
  /* @__PURE__ */ e.jsxs(tt, { type: "multiple", className: "h-full w-full", children: [
2031
- t && /* @__PURE__ */ e.jsx(ge, { section: vr }),
2032
- n ? /* @__PURE__ */ e.jsx(ge, { section: wr }) : null,
2033
- jr.map((i) => /* @__PURE__ */ e.jsx(ge, { section: i }, i.heading)),
2034
- /* @__PURE__ */ e.jsx(Er, { section: { heading: "Attributes" } })
2035
+ t && /* @__PURE__ */ e.jsx(ge, { section: wr }),
2036
+ a ? /* @__PURE__ */ e.jsx(ge, { section: jr }) : null,
2037
+ Cr.map((i) => /* @__PURE__ */ e.jsx(ge, { section: i }, i.heading)),
2038
+ /* @__PURE__ */ e.jsx(Fr, { section: { heading: "Attributes" } })
2035
2039
  ] }),
2036
2040
  /* @__PURE__ */ e.jsx("div", { className: "h-60" })
2037
2041
  ] })
@@ -2050,9 +2054,9 @@ const Xr = {
2050
2054
  deg: 1,
2051
2055
  ms: 0.1
2052
2056
  }, Xl = () => {
2053
- const r = te(), { t: s } = Ee(), [t, n] = $.useState(""), [l, a] = $.useState({
2054
- onDrag: (o) => o,
2055
- onDragEnd: (o) => o,
2057
+ const r = te(), { t: s } = Ee(), [t, a] = $.useState(""), [o, n] = $.useState({
2058
+ onDrag: (l) => l,
2059
+ onDragEnd: (l) => l,
2056
2060
  dragStartY: 0,
2057
2061
  dragging: !1,
2058
2062
  dragStartValue: 0,
@@ -2060,21 +2064,21 @@ const Xr = {
2060
2064
  negative: !1,
2061
2065
  cssProperty: ""
2062
2066
  }), d = xe(
2063
- (o) => {
2064
- const p = !g(l, "negative", !1), u = g(l, "cssProperty", "");
2065
- let c = parseFloat(l.dragStartValue);
2066
- c = Me(c) ? 0 : c;
2067
- let y = Xr[l.dragUnit];
2068
- (Z(u, "scale") || u === "opacity") && (y = 10);
2069
- let m = (l.dragStartY - o.pageY) / y + c;
2070
- p && m < 0 && (m = 0), u === "opacity" && m > 1 && (m = 1), l.onDrag(`${m}`), n(`${m}`);
2067
+ (l) => {
2068
+ const c = !u(o, "negative", !1), p = u(o, "cssProperty", "");
2069
+ let h = parseFloat(o.dragStartValue);
2070
+ h = Me(h) ? 0 : h;
2071
+ let g = Xr[o.dragUnit];
2072
+ (Z(p, "scale") || p === "opacity") && (g = 10);
2073
+ let x = (o.dragStartY - l.pageY) / g + h;
2074
+ c && x < 0 && (x = 0), p === "opacity" && x > 1 && (x = 1), o.onDrag(`${x}`), a(`${x}`);
2071
2075
  },
2072
- [l],
2076
+ [o],
2073
2077
  50
2074
2078
  ), i = I(() => {
2075
- setTimeout(() => l.onDragEnd(`${t}`), 100), a({
2076
- onDrag: (o) => o,
2077
- onDragEnd: (o) => o,
2079
+ setTimeout(() => o.onDragEnd(`${t}`), 100), n({
2080
+ onDrag: (l) => l,
2081
+ onDragEnd: (l) => l,
2078
2082
  dragStartY: 0,
2079
2083
  dragging: !1,
2080
2084
  dragStartValue: 0,
@@ -2082,12 +2086,12 @@ const Xr = {
2082
2086
  negative: !1,
2083
2087
  cssProperty: ""
2084
2088
  });
2085
- }, [l, t, a]);
2086
- return mt(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
2089
+ }, [o, t, n]);
2090
+ return yt(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
2087
2091
  /* @__PURE__ */ e.jsx(We, { className: "mx-auto text-3xl" }),
2088
2092
  /* @__PURE__ */ e.jsx("h1", { children: s("no_block_selected_for_styling") })
2089
- ] }) }) : /* @__PURE__ */ e.jsxs(ot.Provider, { value: { setDragData: a }, children: [
2090
- l.dragging ? /* @__PURE__ */ e.jsx(
2093
+ ] }) }) : /* @__PURE__ */ e.jsxs(ot.Provider, { value: { setDragData: n }, children: [
2094
+ o.dragging ? /* @__PURE__ */ e.jsx(
2091
2095
  "div",
2092
2096
  {
2093
2097
  onMouseMove: d,
@@ -2108,7 +2112,7 @@ const Xr = {
2108
2112
  children: /* @__PURE__ */ e.jsx(fr, {})
2109
2113
  }
2110
2114
  ),
2111
- /* @__PURE__ */ e.jsx(Ve, { value: "styling", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Fr, {}) })
2115
+ /* @__PURE__ */ e.jsx(Ve, { value: "styling", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Yr, {}) })
2112
2116
  ] })
2113
2117
  ] });
2114
2118
  };