@chaibuilder/sdk 1.2.51 → 1.2.53

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 (84) hide show
  1. package/dist/{AddBlocks-hOFqmmXZ.cjs → AddBlocks-7OJEZC2D.cjs} +1 -1
  2. package/dist/{AddBlocks-LyEjf6h0.js → AddBlocks-kJNH96eQ.js} +17 -17
  3. package/dist/{CanvasArea-mhINqS0c.js → CanvasArea-ZxrQurg_.js} +57 -57
  4. package/dist/CanvasArea-nWHWl6zD.cjs +56 -0
  5. package/dist/{ChaiBuilderEditor-KEwDa8Bl.js → ChaiBuilderEditor-4xhn_QlL.js} +14537 -14536
  6. package/dist/{ChaiBuilderEditor-H173PF4T.cjs → ChaiBuilderEditor-Rqlg194T.cjs} +55 -55
  7. package/dist/CodeEditor-C6p5CZfl.cjs +1 -0
  8. package/dist/CodeEditor-vTWgHJei.js +115 -0
  9. package/dist/{CurrentPage-UzajS1xZ.js → CurrentPage-KPr8MnO0.js} +7 -7
  10. package/dist/{CurrentPage-RUx7wvBt.cjs → CurrentPage-bfY5xyr7.cjs} +1 -1
  11. package/dist/ListTree-4J0SUudU.cjs +1 -0
  12. package/dist/ListTree-5s7iNbKT.js +25724 -0
  13. package/dist/{PagesPanel-p-h6o26u.js → PagesPanel-aZBPSLS7.js} +4 -4
  14. package/dist/{PagesPanel-LBW-4mVM.cjs → PagesPanel-re4w2009.cjs} +1 -1
  15. package/dist/{ProjectPanel-o0OWWnYQ.js → ProjectPanel-bWZtA_mw.js} +4 -4
  16. package/dist/{ProjectPanel-PQv2uVj2.cjs → ProjectPanel-uo19SCtW.cjs} +1 -1
  17. package/dist/Settings-AcK9rEs3.cjs +1 -0
  18. package/dist/{Settings-zm-cF9rZ.js → Settings-SK2ONoi0.js} +859 -862
  19. package/dist/{SidePanels-0w036NaZ.cjs → SidePanels-YAKKqxIi.cjs} +1 -1
  20. package/dist/{SidePanels-TOHaLWC6.js → SidePanels-ezU-hGki.js} +38 -38
  21. package/dist/{ThemeConfiguration-wJA_aBly.js → ThemeConfiguration-q5rLYmXB.js} +9 -9
  22. package/dist/{ThemeConfiguration-MBuJmbDn.cjs → ThemeConfiguration-qUXsJBBZ.cjs} +1 -1
  23. package/dist/{Topbar-u5HAh7Mg.cjs → Topbar-9mJ6dJn-.cjs} +1 -1
  24. package/dist/{Topbar-Rh7dWuJD.js → Topbar-YhJ6xVs-.js} +4 -4
  25. package/dist/{UILibrariesPanel-3-cWabRt.js → UILibrariesPanel-N7acP7aA.js} +6 -6
  26. package/dist/{UILibrariesPanel-xOys8g8A.cjs → UILibrariesPanel-uNt8spPr.cjs} +1 -1
  27. package/dist/{UnsplashImages-Kymq8i6b.cjs → UnsplashImages-5IlwWgRv.cjs} +1 -1
  28. package/dist/{UnsplashImages-dhU2-pHY.js → UnsplashImages-iY__3dsJ.js} +4 -4
  29. package/dist/{UploadImages-dr_gpAea.js → UploadImages-KHk-jx9-.js} +2 -2
  30. package/dist/{UploadImages-WpaiIEbj.cjs → UploadImages-UjtFHUqM.cjs} +1 -1
  31. package/dist/{add-page-modal-vmUMNu7F.cjs → add-page-modal-8GuYgZa-.cjs} +1 -1
  32. package/dist/{add-page-modal-zwq1hL_o.js → add-page-modal-HmfsbbCH.js} +8 -8
  33. package/dist/{confirm-alert-73tjkqtD.js → confirm-alert-AoUx_ZEf.js} +2 -2
  34. package/dist/{confirm-alert-fK62IiTF.cjs → confirm-alert-qdryZAvd.cjs} +1 -1
  35. package/dist/core.cjs +1 -1
  36. package/dist/core.d.ts +9 -0
  37. package/dist/core.js +32 -31
  38. package/dist/{delete-page-modal-G_aMq7K4.cjs → delete-page-modal-8qEY88SK.cjs} +1 -1
  39. package/dist/{delete-page-modal-DPNxHWfi.js → delete-page-modal-KCPx8Ako.js} +3 -3
  40. package/dist/email.cjs +1 -1
  41. package/dist/email.js +2 -2
  42. package/dist/{form-_tKI6ugY.js → form-LHHE25z8.js} +5 -5
  43. package/dist/{form-YMuxx9Ju.cjs → form-zHGQEmOp.cjs} +1 -1
  44. package/dist/functions--tdNWQDW.js +30 -0
  45. package/dist/functions-EVUeSwX1.cjs +1 -0
  46. package/dist/index--mLLy7QQ.cjs +1 -0
  47. package/dist/index-VBXQixVm.js +117 -0
  48. package/dist/index-swYRuZtl.cjs +1 -0
  49. package/dist/index-tGVTszX2.js +2201 -0
  50. package/dist/lib.cjs +1 -1
  51. package/dist/lib.js +10 -10
  52. package/dist/{page-viewer-UZMtWQDj.js → page-viewer-P5yNaWy1.js} +9 -9
  53. package/dist/{page-viewer-WQgFhgp5.cjs → page-viewer-t9AFrRlP.cjs} +1 -1
  54. package/dist/{project-general-setting-Yh4fQsQH.cjs → project-general-setting-Ojhf6Nl6.cjs} +1 -1
  55. package/dist/{project-general-setting-Zz7qcIW7.js → project-general-setting-Qm8odisi.js} +6 -6
  56. package/dist/{project-seo-setting-_gNPOTsp.cjs → project-seo-setting-4E1mqV3j.cjs} +1 -1
  57. package/dist/{project-seo-setting-wFOVAoC2.js → project-seo-setting-j8EdSO40.js} +3 -3
  58. package/dist/render.cjs +1 -1
  59. package/dist/render.js +2 -2
  60. package/dist/{single-page-detail-EMxzuAe1.cjs → single-page-detail-bv-XFGOD.cjs} +1 -1
  61. package/dist/{single-page-detail-1Vveonuh.js → single-page-detail-mQfFVaou.js} +5 -5
  62. package/dist/studio.cjs +1 -1
  63. package/dist/studio.js +3 -3
  64. package/dist/ui.cjs +1 -1
  65. package/dist/ui.js +98 -98
  66. package/dist/useCanvasSettings-4WtrDzCu.cjs +1 -0
  67. package/dist/useCanvasSettings-Rvn5rRB8.js +6 -0
  68. package/dist/web-blocks.cjs +1 -1
  69. package/dist/web-blocks.js +483 -437
  70. package/package.json +3 -2
  71. package/dist/CanvasArea-luy5nUGR.cjs +0 -56
  72. package/dist/CodeEditor-XaHQMfpT.js +0 -97
  73. package/dist/CodeEditor-jh9xwRXT.cjs +0 -1
  74. package/dist/ListTree-BWBPjCzR.js +0 -409
  75. package/dist/ListTree-S6pMJlmj.cjs +0 -1
  76. package/dist/Settings-DclX-cDC.cjs +0 -1
  77. package/dist/functions-JO0EW8GX.js +0 -30
  78. package/dist/functions-ZZVUnIjD.cjs +0 -1
  79. package/dist/index-9gfJqJ6E.cjs +0 -1
  80. package/dist/index-YpnaudSM.js +0 -63
  81. package/dist/index-ecnGWzh9.cjs +0 -1
  82. package/dist/index-vpfLlP7N.js +0 -2201
  83. package/dist/useCodeEditor-2KOfsFsx.js +0 -7
  84. package/dist/useCodeEditor-gE1NWoNH.cjs +0 -1
@@ -1,21 +1,22 @@
1
1
  import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import * as ne from "react";
3
- import P, { useState as w, useMemo as T, useEffect as A, useCallback as H, memo as bt, useRef as mt, createContext as Fe, useContext as se } from "react";
4
- import { useThrottledCallback as de } from "@react-hookz/web";
5
- import { forEach as Ne, isArray as ce, omit as ft, truncate as vt, includes as X, get as y, first as oe, split as wt, startCase as F, toLower as re, isEmpty as m, map as _, find as Ze, last as jt, filter as ye, set as We, debounce as Ct, keys as he, cloneDeep as kt, each as Nt, capitalize as be, reject as _t, startsWith as W, nth as He, isNumber as St, parseInt as Tt, isNaN as Ue, findLast as Rt, flatten as De, intersection as Vt, has as ie, isNull as Ht } from "lodash-es";
6
- import { useTranslation as I } from "react-i18next";
7
- import { CopyIcon as Dt, PlusIcon as _e, Cross2Icon as Ke, EyeOpenIcon as Bt, EyeClosedIcon as Be, BorderAllIcon as Y, WidthIcon as R, HeightIcon as V, ArrowUpIcon as J, ArrowRightIcon as Q, ArrowDownIcon as ee, ArrowLeftIcon as te, ArrowTopLeftIcon as It, ArrowTopRightIcon as Pt, ArrowBottomRightIcon as At, ArrowBottomLeftIcon as $t, AlignLeftIcon as Et, AlignCenterHorizontallyIcon as Mt, AlignRightIcon as Lt, StretchHorizontallyIcon as Ot, FontItalicIcon as zt, UnderlineIcon as Yt, OverlineIcon as Xt, LetterCaseUppercaseIcon as Ft, Cross1Icon as Zt, InfoCircledIcon as Se, MinusIcon as Wt, BoxIcon as Ge, RowSpacingIcon as Ut, TriangleDownIcon as Kt, CrossCircledIcon as Gt, CaretDownIcon as qt, MixerHorizontalIcon as Jt } from "@radix-ui/react-icons";
8
- import { a1 as qe, aP as Je, aQ as Qe, B, aR as et, aS as Qt, aT as er, aU as tr, aV as rr, aW as sr, aX as or, L as U, aK as tt, _ as lr, $ as ar, a0 as nr, aY as ir, Y as dr, aa as cr, Z as pr, ab as $, ac as E, ad as M, aZ as ur, a_ as gr, a$ as xr, b0 as yr, b1 as hr, b2 as br, b3 as mr, Q as rt, P as st, h as ot, b4 as fr, b5 as lt, b6 as me, b7 as fe, b8 as ve, b9 as vr, ba as wr, ag as jr, bb as Cr, X as pe, n as Te, H as at, K as nt, bc as it, bd as we, j as kr, be as Nr, I as ue, v as _r, O as Sr, o as Ie, au as Tr, av as Rr, aw as Vr, bf as dt, ax as Pe, ay as Ae, bg as $e, bh as Ee, bi as Me, R as Hr } from "./ChaiBuilderEditor-KEwDa8Bl.js";
9
- import { Check as Dr, EditIcon as Br, TrashIcon as Ir, Loader as Pr, SparklesIcon as Ar, DeleteIcon as $r } from "lucide-react";
10
- import { getBlockComponent as Re, getChaiDataProviders as Er, useGlobalStylingPresets as Mr } from "@chaibuilder/runtime";
11
- import { J as Lr, a as Or, d as zr } from "./index-e0c8PmRQ.js";
12
- import Yr from "@rjsf/core";
13
- import Xr from "@rjsf/validator-ajv8";
14
- import { a as Fr, u as Zr } from "./useCodeEditor-2KOfsFsx.js";
15
- import Wr from "react-autosuggest";
16
- import Ur from "fuse.js";
17
- import { A as Kr, C as ge, g as Gr } from "./utils-VpVqnC9m.js";
18
- import { a as qr } from "./MODIFIERS-fd5XOmum.js";
2
+ import * as ie from "react";
3
+ import $, { useState as j, useMemo as R, useEffect as A, useCallback as B, memo as ft, useRef as ye, createContext as Ze, useContext as se } from "react";
4
+ import { useThrottledCallback as ce } from "@react-hookz/web";
5
+ import { forEach as ke, isArray as pe, omit as vt, truncate as wt, includes as z, get as g, first as oe, split as jt, startCase as Y, toLower as re, isEmpty as b, map as T, find as Ct, last as kt, filter as Re, set as We, debounce as Nt, keys as he, cloneDeep as _t, each as St, capitalize as me, reject as Tt, nth as Ve, startsWith as q, isNumber as Rt, parseInt as Vt, isNaN as Ue, findLast as Ht, flatten as He, intersection as Dt, has as de, isNull as Bt } from "lodash-es";
6
+ import { useTranslation as F } from "react-i18next";
7
+ import { CopyIcon as It, PlusIcon as Ke, Cross2Icon as Ge, EyeOpenIcon as At, EyeClosedIcon as De, BorderAllIcon as O, WidthIcon as H, HeightIcon as D, ArrowUpIcon as J, ArrowRightIcon as Q, ArrowDownIcon as ee, ArrowLeftIcon as te, ArrowTopLeftIcon as Pt, ArrowTopRightIcon as $t, ArrowBottomRightIcon as Et, ArrowBottomLeftIcon as Mt, AlignLeftIcon as Lt, AlignCenterHorizontallyIcon as Ot, AlignRightIcon as zt, StretchHorizontallyIcon as Yt, FontItalicIcon as Ft, UnderlineIcon as Xt, OverlineIcon as Zt, LetterCaseUppercaseIcon as Wt, Cross1Icon as Ut, InfoCircledIcon as Ne, MinusIcon as Kt, BoxIcon as qe, RowSpacingIcon as Gt, TriangleDownIcon as qt, CrossCircledIcon as Jt, CaretDownIcon as Qt, MixerHorizontalIcon as er } from "@radix-ui/react-icons";
8
+ import { a2 as Je, aQ as Qe, aR as et, B as P, aS as tt, aT as tr, aU as rr, aV as sr, aW as or, aX as lr, aY as ar, M as X, aL as rt, $ as nr, a0 as ir, a1 as dr, aZ as cr, Z as pr, ab as ur, _ as gr, ac as U, ad as K, ae as G, i as xr, a_ as yr, a$ as hr, b0 as mr, b1 as br, b2 as fr, b3 as vr, b4 as wr, R as st, Q as ot, h as lt, b5 as jr, b6 as at, b7 as be, b8 as fe, b9 as ve, ba as Cr, bb as nt, ah as kr, bc as Nr, Y as le, o as _e, I as it, L as dt, bd as _r, aD as Be, be as ct, k as Sr, bf as Tr, J as ue, w as Rr, P as Vr, p as Ie, av as Hr, aw as Dr, ax as Br, bg as pt, ay as Ae, az as Pe, bh as $e, bi as Ee, bj as Me, S as Ir } from "./ChaiBuilderEditor-4xhn_QlL.js";
9
+ import { Check as Ar, EditIcon as Pr, TrashIcon as $r, Loader as Er, SparklesIcon as Mr, Edit2 as Lr, X as Or } from "lucide-react";
10
+ import { getBlockComponent as Se, getChaiDataProviders as zr, useGlobalStylingPresets as Yr } from "@chaibuilder/runtime";
11
+ import { J as Fr, a as Xr, d as Zr } from "./index-e0c8PmRQ.js";
12
+ import Wr from "@rjsf/core";
13
+ import Ur from "@rjsf/validator-ajv8";
14
+ import { u as Kr } from "./useCanvasSettings-Rvn5rRB8.js";
15
+ import Gr from "react-autosuggest";
16
+ import qr from "fuse.js";
17
+ import { A as Jr, C as ge, g as Qr } from "./utils-VpVqnC9m.js";
18
+ import { a as es } from "./MODIFIERS-fd5XOmum.js";
19
+ import { get as Le, isEmpty as ts } from "lodash";
19
20
  import "./_commonjsHelpers-UyOWmZb0.js";
20
21
  import "clsx";
21
22
  import "react-dom";
@@ -49,30 +50,30 @@ import "@radix-ui/react-context-menu";
49
50
  import "react-icons-picker";
50
51
  import "react-quill";
51
52
  import "react-hotkeys-hook";
52
- import "./index-YpnaudSM.js";
53
- function Jr(r) {
54
- const o = [], t = {};
55
- function a(l, s) {
56
- Ne(s, (d, c) => {
57
- const n = l ? `${l}.${c}` : c, p = ce(d) ? "list" : typeof d;
58
- o.push(n), t[n] = p === "string" ? "text" : p === "object" ? "model" : p, p === "object" && !ce(d) && a(n, d);
53
+ import "./index-VBXQixVm.js";
54
+ function rs(r) {
55
+ const a = [], t = {};
56
+ function l(o, n) {
57
+ ke(n, (d, p) => {
58
+ const s = o ? `${o}.${p}` : p, c = pe(d) ? "list" : typeof d;
59
+ a.push(s), t[s] = c === "string" ? "text" : c === "object" ? "model" : c, c === "object" && !pe(d) && l(s, d);
59
60
  });
60
61
  }
61
- return a("", ft(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: o, pathsType: t };
62
+ return l("", vt(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: a, pathsType: t };
62
63
  }
63
- const je = ({ data: r, fullView: o }) => {
64
+ const we = ({ data: r, fullView: a }) => {
64
65
  if (!r)
65
66
  return null;
66
67
  const t = typeof r;
67
- return o ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
68
+ return a ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
68
69
  /* @__PURE__ */ e.jsx("div", { className: "h-3" }),
69
- /* @__PURE__ */ e.jsx(qe, { children: /* @__PURE__ */ e.jsx(
70
- Lr,
70
+ /* @__PURE__ */ e.jsx(Je, { children: /* @__PURE__ */ e.jsx(
71
+ Fr,
71
72
  {
72
73
  data: r,
73
- shouldExpandNode: Or,
74
+ shouldExpandNode: Xr,
74
75
  style: {
75
- ...zr,
76
+ ...Zr,
76
77
  container: "max-h-[40vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
77
78
  stringValue: "text-orange-600",
78
79
  label: "text-green-900 font-semibold pr-1 tracking-wider"
@@ -82,271 +83,271 @@ const je = ({ data: r, fullView: o }) => {
82
83
  ] }) : /* @__PURE__ */ e.jsxs("div", { className: "max-h-36 w-full overflow-y-auto overflow-x-hidden text-[12px] leading-4 text-gray-800/50", children: [
83
84
  /* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800/80", children: "Content: " }),
84
85
  r
85
- ] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: vt(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
86
- }, Le = ({
86
+ ] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: wt(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
87
+ }, Oe = ({
87
88
  type: r,
88
- value: o = "",
89
+ value: a = "",
89
90
  setValue: t,
90
- data: a,
91
- onChange: l,
92
- dataType: s,
91
+ data: l,
92
+ onChange: o,
93
+ dataType: n,
93
94
  appliedBindings: d
94
95
  }) => {
95
- const { paths: c, pathsType: n } = Jr(a), p = r === "PROP" ? Re(a == null ? void 0 : a._type) : {}, h = r === "PROP", [i, u] = w(!1), x = T(() => r === "PROP" ? c.filter(
96
- (g) => !X(d, g) && y(p, `props.${oe(wt(g, "."))}.binding`)
97
- ) : c.filter((g) => s === y(n, g, "")), [r, c, d, s, p]);
96
+ const { paths: p, pathsType: s } = rs(l), c = r === "PROP" ? Se(l == null ? void 0 : l._type) : {}, u = r === "PROP", [i, h] = j(!1), y = R(() => r === "PROP" ? p.filter(
97
+ (x) => !z(d, x) && g(c, `props.${oe(jt(x, "."))}.binding`)
98
+ ) : p.filter((x) => n === g(s, x, "")), [r, p, d, n, c]);
98
99
  return A(() => {
99
- o && l(o);
100
- }, [o, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
100
+ a && o(a);
101
+ }, [a, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
101
102
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
102
- /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: F(re(r)) }),
103
- /* @__PURE__ */ e.jsxs(Je, { open: i, onOpenChange: u, children: [
104
- /* @__PURE__ */ e.jsx(Qe, { asChild: !0, children: /* @__PURE__ */ e.jsx(
105
- B,
103
+ /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: Y(re(r)) }),
104
+ /* @__PURE__ */ e.jsxs(Qe, { open: i, onOpenChange: h, children: [
105
+ /* @__PURE__ */ e.jsx(et, { asChild: !0, children: /* @__PURE__ */ e.jsx(
106
+ P,
106
107
  {
107
108
  variant: "outline",
108
109
  size: "sm",
109
- className: ` ${m(o) ? "w-44 justify-center bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white" : "min-w-[350px] items-center justify-between"}`,
110
- children: o ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
110
+ className: ` ${b(a) ? "w-44 justify-center bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white" : "min-w-[350px] items-center justify-between"}`,
111
+ children: a ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
111
112
  /* @__PURE__ */ e.jsxs("span", { className: "pr-8 text-sm", children: [
112
- h && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: F(s) }),
113
- o
113
+ u && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: Y(n) }),
114
+ a
114
115
  ] }),
115
116
  /* @__PURE__ */ e.jsx("span", { className: "cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700", children: "Change" })
116
117
  ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
117
118
  "+ Set ",
118
- F(re(r))
119
+ Y(re(r))
119
120
  ] })
120
121
  }
121
122
  ) }),
122
- /* @__PURE__ */ e.jsx(et, { className: "z-[999] min-w-[300px] p-0", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(Qt, { children: [
123
- /* @__PURE__ */ e.jsx(er, { placeholder: `Choose ${re(r)}...` }),
124
- /* @__PURE__ */ e.jsxs(tr, { children: [
125
- /* @__PURE__ */ e.jsx(rr, { children: "No results found." }),
126
- /* @__PURE__ */ e.jsx(sr, { children: _(x, (g) => /* @__PURE__ */ e.jsxs(
127
- or,
123
+ /* @__PURE__ */ e.jsx(tt, { className: "z-[999] min-w-[300px] p-0", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(tr, { children: [
124
+ /* @__PURE__ */ e.jsx(rr, { placeholder: `Choose ${re(r)}...` }),
125
+ /* @__PURE__ */ e.jsxs(sr, { children: [
126
+ /* @__PURE__ */ e.jsx(or, { children: "No results found." }),
127
+ /* @__PURE__ */ e.jsx(lr, { children: T(y, (x) => /* @__PURE__ */ e.jsxs(
128
+ ar,
128
129
  {
129
- value: g,
130
- className: `cursor-pointer ${h ? "flex items-center justify-between" : "flex flex-col items-start justify-start"}`,
130
+ value: x,
131
+ className: `cursor-pointer ${u ? "flex items-center justify-between" : "flex flex-col items-start justify-start"}`,
131
132
  onSelect: (v) => {
132
- t(Ze(x, (C) => C === v) || null), u(!1);
133
+ t(Ct(y, (k) => k === v) || null), h(!1);
133
134
  },
134
135
  children: [
135
136
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
136
- /* @__PURE__ */ e.jsx(Dr, { className: `h-4 w-4 text-green-500 ${o === g ? "" : "opacity-0"}` }),
137
- g
137
+ /* @__PURE__ */ e.jsx(Ar, { className: `h-4 w-4 text-green-500 ${a === x ? "" : "opacity-0"}` }),
138
+ x
138
139
  ] }),
139
- h ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: F(y(n, g, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(je, { data: y(a, g) }) })
140
+ u ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: Y(g(s, x, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(we, { data: g(l, x) }) })
140
141
  ]
141
142
  },
142
- g
143
+ x
143
144
  )) })
144
145
  ] })
145
146
  ] }) })
146
147
  ] })
147
148
  ] }),
148
- !h && !m(o) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(je, { data: y(a, o, ""), fullView: !0 }) })
149
+ !u && !b(a) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(we, { data: g(l, a, ""), fullView: !0 }) })
149
150
  ] });
150
- }, Qr = ({
151
+ }, ss = ({
151
152
  appliedBindings: r = [],
152
- onAddBinding: o,
153
+ onAddBinding: a,
153
154
  editMode: t,
154
- item: a
155
+ item: l
155
156
  }) => {
156
- const [l, s] = w(t ? a.key : ""), [d, c] = w(t ? a.value : ""), n = U(), [p] = tt(), h = H(
157
- (x, g) => {
158
- if (m(x))
157
+ const [o, n] = j(t ? l.key : ""), [d, p] = j(t ? l.value : ""), s = X(), [c] = rt(), u = B(
158
+ (y, x) => {
159
+ if (b(y))
159
160
  return "";
160
161
  {
161
- const v = y(g === "PROP" ? n : p, x, "");
162
- if (ce(v))
162
+ const v = g(x === "PROP" ? s : c, y, "");
163
+ if (pe(v))
163
164
  return "list";
164
- const C = typeof v;
165
- return C === "string" ? "text" : C === "object" ? "model" : C;
165
+ const k = typeof v;
166
+ return k === "string" ? "text" : k === "object" ? "model" : k;
166
167
  }
167
168
  },
168
- [n, p]
169
- ), [i, u] = w(t ? h(a.key, "PROP") : "");
169
+ [s, c]
170
+ ), [i, h] = j(t ? u(l.key, "PROP") : "");
170
171
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
171
- /* @__PURE__ */ e.jsxs(lr, { children: [
172
- /* @__PURE__ */ e.jsx(ar, { children: "Add Data Binding" }),
173
- /* @__PURE__ */ e.jsx(nr, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
172
+ /* @__PURE__ */ e.jsxs(nr, { children: [
173
+ /* @__PURE__ */ e.jsx(ir, { children: "Add Data Binding" }),
174
+ /* @__PURE__ */ e.jsx(dr, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
174
175
  ] }),
175
176
  /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col gap-1", children: [
176
177
  /* @__PURE__ */ e.jsx(
177
- Le,
178
+ Oe,
178
179
  {
179
180
  type: "PROP",
180
181
  isDisabled: !1,
181
182
  placeholder: "Enter prop key",
182
- value: l,
183
- setValue: s,
184
- onChange: (x) => {
185
- const g = h(x, "PROP");
186
- s(x), i !== g && c(""), u(g);
183
+ value: o,
184
+ setValue: n,
185
+ onChange: (y) => {
186
+ const x = u(y, "PROP");
187
+ n(y), i !== x && p(""), h(x);
187
188
  },
188
- data: n,
189
+ data: s,
189
190
  dataType: i,
190
191
  appliedBindings: r
191
192
  }
192
193
  ),
193
194
  /* @__PURE__ */ e.jsx("div", { className: "h-2" }),
194
195
  /* @__PURE__ */ e.jsx(
195
- Le,
196
+ Oe,
196
197
  {
197
198
  type: "PATH",
198
- isDisabled: m(l),
199
+ isDisabled: b(o),
199
200
  placeholder: "Enter data path",
200
201
  value: d,
201
- setValue: c,
202
- onChange: (x) => {
203
- const g = h(x, "PATH");
204
- c(i === g ? x : "");
202
+ setValue: p,
203
+ onChange: (y) => {
204
+ const x = u(y, "PATH");
205
+ p(i === x ? y : "");
205
206
  },
206
- data: p,
207
+ data: c,
207
208
  dataType: i,
208
209
  appliedBindings: r
209
210
  }
210
211
  )
211
212
  ] }),
212
- /* @__PURE__ */ e.jsx(ir, { children: /* @__PURE__ */ e.jsx(
213
- B,
213
+ /* @__PURE__ */ e.jsx(cr, { children: /* @__PURE__ */ e.jsx(
214
+ P,
214
215
  {
215
216
  type: "submit",
216
217
  className: "mt-4",
217
- disabled: m(l) && m(d),
218
- onClick: () => o({ key: l, value: d }),
218
+ disabled: b(o) && b(d),
219
+ onClick: () => a({ key: o, value: d }),
219
220
  children: "Save"
220
221
  }
221
222
  ) })
222
223
  ] });
223
- }, ct = ({ disabled: r, children: o, onAddBinding: t, appliedBindings: a, editMode: l = !0, item: s = {} }) => {
224
- const [d, c] = w(!1);
225
- return /* @__PURE__ */ e.jsxs(dr, { children: [
226
- /* @__PURE__ */ e.jsx(cr, { disabled: r, asChild: !0, onClick: () => c(!0), children: o }),
227
- d && /* @__PURE__ */ e.jsx(pr, { children: /* @__PURE__ */ e.jsx(
228
- Qr,
224
+ }, ut = ({ disabled: r, children: a, onAddBinding: t, appliedBindings: l, editMode: o = !0, item: n = {} }) => {
225
+ const [d, p] = j(!1);
226
+ return /* @__PURE__ */ e.jsxs(pr, { children: [
227
+ /* @__PURE__ */ e.jsx(ur, { disabled: r, asChild: !0, onClick: () => p(!0), children: a }),
228
+ d && /* @__PURE__ */ e.jsx(gr, { children: /* @__PURE__ */ e.jsx(
229
+ ss,
229
230
  {
230
- item: s,
231
- editMode: l,
232
- appliedBindings: a,
233
- onAddBinding: (n) => {
234
- t(n), c(!1);
231
+ item: n,
232
+ editMode: o,
233
+ appliedBindings: l,
234
+ onAddBinding: (s) => {
235
+ t(s), p(!1);
235
236
  }
236
237
  }
237
238
  ) })
238
239
  ] });
239
- }, es = ({
240
+ }, os = ({
240
241
  item: r,
241
- onAddBinding: o,
242
+ onAddBinding: a,
242
243
  onRemove: t,
243
- selectedBlock: a,
244
- dataProvider: l,
245
- appliedBindings: s
244
+ selectedBlock: l,
245
+ dataProvider: o,
246
+ appliedBindings: n
246
247
  }) => {
247
- const [d, c] = w("string"), n = (p, h) => {
248
- if (m(p))
248
+ const [d, p] = j("string"), s = (c, u) => {
249
+ if (b(c))
249
250
  return "";
250
251
  {
251
- const i = y(h === "PROP" ? a : l, p, "");
252
- if (ce(i))
252
+ const i = g(u === "PROP" ? l : o, c, "");
253
+ if (pe(i))
253
254
  return "list";
254
- const u = typeof i;
255
- return u === "string" ? "text" : u === "object" ? "model" : u;
255
+ const h = typeof i;
256
+ return h === "string" ? "text" : h === "object" ? "model" : h;
256
257
  }
257
258
  };
258
- return A(() => c(() => n(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col rounded-md border border-gray-200 p-2", children: [
259
+ return A(() => p(() => s(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col rounded-md border border-gray-200 p-2", children: [
259
260
  /* @__PURE__ */ e.jsx("div", { className: "text-sm font-normal text-gray-500", children: r.key }),
260
261
  /* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: r.value }),
261
- /* @__PURE__ */ e.jsx(je, { data: y(l, r.value, "") }),
262
+ /* @__PURE__ */ e.jsx(we, { data: g(o, r.value, "") }),
262
263
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
263
- /* @__PURE__ */ e.jsx(ct, { editMode: !0, onAddBinding: o, appliedBindings: s, item: r, children: /* @__PURE__ */ e.jsx(Br, { className: "mt-1 h-6 w-6 cursor-pointer rounded border border-blue-400 p-1 text-blue-400 duration-200 hover:scale-105 hover:bg-blue-400 hover:text-white" }) }),
264
+ /* @__PURE__ */ e.jsx(ut, { editMode: !0, onAddBinding: a, appliedBindings: n, item: r, children: /* @__PURE__ */ e.jsx(Pr, { className: "mt-1 h-6 w-6 cursor-pointer rounded border border-blue-400 p-1 text-blue-400 duration-200 hover:scale-105 hover:bg-blue-400 hover:text-white" }) }),
264
265
  /* @__PURE__ */ e.jsx(
265
- Ir,
266
+ $r,
266
267
  {
267
268
  onClick: () => t(),
268
269
  className: "mt-1 h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 duration-200 hover:scale-105 hover:bg-red-400 hover:text-white"
269
270
  }
270
271
  )
271
272
  ] }),
272
- !m(d) && !m(r.key) && /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-1 mt-px flex h-4 items-center rounded-full px-2 text-[10px] font-medium text-purple-600", children: F(d) })
273
+ !b(d) && !b(r.key) && /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-1 mt-px flex h-4 items-center rounded-full px-2 text-[10px] font-medium text-purple-600", children: Y(d) })
273
274
  ] });
274
- }, ts = ({ bindingData: r, onChange: o }) => {
275
- const t = U(), [a] = tt(), l = Er(), [s, d] = w(
276
- _(r, (i, u) => ({ key: u, value: i }))
275
+ }, ls = ({ bindingData: r, onChange: a }) => {
276
+ const t = X(), [l] = rt(), o = zr(), [n, d] = j(
277
+ T(r, (i, h) => ({ key: h, value: i }))
277
278
  );
278
279
  A(() => {
279
- d(_(r, (i, u) => ({ key: u, value: i })));
280
+ d(T(r, (i, h) => ({ key: h, value: i })));
280
281
  }, [t == null ? void 0 : t._id, r]);
281
- const c = T(() => {
282
- if (m(a))
282
+ const p = R(() => {
283
+ if (b(l))
283
284
  return !0;
284
- if (m(s))
285
+ if (b(n))
285
286
  return !1;
286
- const i = jt(s);
287
- return m(i == null ? void 0 : i.key) || m(i == null ? void 0 : i.value);
288
- }, [a, s]), n = (i) => {
289
- const u = ye(s, (x) => x.key !== i.key);
290
- d([...u, i]), h([...u, i]);
291
- }, p = (i) => {
292
- const u = ye(s, (x, g) => i !== g);
293
- h([...u]);
294
- }, h = H(
287
+ const i = kt(n);
288
+ return b(i == null ? void 0 : i.key) || b(i == null ? void 0 : i.value);
289
+ }, [l, n]), s = (i) => {
290
+ const h = Re(n, (y) => y.key !== i.key);
291
+ d([...h, i]), u([...h, i]);
292
+ }, c = (i) => {
293
+ const h = Re(n, (y, x) => i !== x);
294
+ u([...h]);
295
+ }, u = B(
295
296
  (i = []) => {
296
- if (d(i), m(i)) {
297
- o({});
297
+ if (d(i), b(i)) {
298
+ a({});
298
299
  return;
299
300
  }
300
- const u = {};
301
- Ne(i, (x) => {
302
- !m(x == null ? void 0 : x.key) && !m(x == null ? void 0 : x.value) && We(u, x.key, x.value);
303
- }), o(u);
301
+ const h = {};
302
+ ke(i, (y) => {
303
+ !b(y == null ? void 0 : y.key) && !b(y == null ? void 0 : y.value) && We(h, y.key, y.value);
304
+ }), a(h);
304
305
  },
305
- [o]
306
+ [a]
306
307
  );
307
- return m(l) ? /* @__PURE__ */ e.jsx("div", { className: "flex w-full items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 text-xs text-gray-500", children: [
308
+ return b(o) ? /* @__PURE__ */ e.jsx("div", { className: "flex w-full items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 text-xs text-gray-500", children: [
308
309
  "You have no data providers registered. Please add a data provider to your project. ",
309
310
  /* @__PURE__ */ e.jsx("br", {}),
310
311
  /* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
311
312
  ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
312
- _(s, (i, u) => /* @__PURE__ */ e.jsx(
313
- es,
313
+ T(n, (i, h) => /* @__PURE__ */ e.jsx(
314
+ os,
314
315
  {
315
316
  item: i,
316
- onAddBinding: n,
317
- onRemove: () => p(u),
317
+ onAddBinding: s,
318
+ onRemove: () => c(h),
318
319
  selectedBlock: t,
319
- dataProvider: a,
320
- appliedBindings: _(s, "key")
320
+ dataProvider: l,
321
+ appliedBindings: T(n, "key")
321
322
  },
322
323
  i.key
323
324
  )),
324
- /* @__PURE__ */ e.jsxs($, { delayDuration: 200, children: [
325
- /* @__PURE__ */ e.jsx(E, { disabled: m(a), className: "w-full", children: /* @__PURE__ */ e.jsx(
326
- ct,
325
+ /* @__PURE__ */ e.jsxs(U, { delayDuration: 200, children: [
326
+ /* @__PURE__ */ e.jsx(K, { disabled: b(l), className: "w-full", children: /* @__PURE__ */ e.jsx(
327
+ ut,
327
328
  {
328
- disabled: c,
329
- appliedBindings: _(s, "key"),
330
- onAddBinding: n,
329
+ disabled: p,
330
+ appliedBindings: T(n, "key"),
331
+ onAddBinding: s,
331
332
  children: /* @__PURE__ */ e.jsx(
332
333
  "span",
333
334
  {
334
- className: `w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${c ? "cursor-not-allowed bg-gray-200 text-gray-400" : "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,
335
- children: m(a) ? /* @__PURE__ */ e.jsx("small", { className: "text-[9.5px] text-gray-500", children: "No data provider has been set up for this page" }) : "+ Add Data Binding"
335
+ className: `w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${p ? "cursor-not-allowed bg-gray-200 text-gray-400" : "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,
336
+ children: b(l) ? /* @__PURE__ */ e.jsx("small", { className: "text-[9.5px] text-gray-500", children: "No data provider has been set up for this page" }) : "+ Add Data Binding"
336
337
  }
337
338
  )
338
339
  }
339
340
  ) }),
340
- c && /* @__PURE__ */ e.jsx(M, { sideOffset: -55, className: "text-[11px]", children: m(a) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
341
+ p && /* @__PURE__ */ e.jsx(G, { sideOffset: -55, className: "text-[11px]", children: b(l) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
341
342
  ] })
342
343
  ] });
343
- }, rs = () => /* @__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" }), ss = ({ id: r, placeholder: o, value: t }) => {
344
- const { t: a } = I(), [, l] = Fr(), s = U();
344
+ }, as = () => /* @__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" }), ns = ({ id: r, placeholder: a, value: t }) => {
345
+ const { t: l } = F(), [, o] = xr(), n = X();
345
346
  if (typeof window > "u")
346
347
  return null;
347
348
  const d = () => {
348
- const c = s == null ? void 0 : s._id, n = r.replace("root.", "");
349
- l({ blockId: c, blockProp: n, placeholder: o, initialCode: t });
349
+ const p = n == null ? void 0 : n._id, s = r.replace("root.", "");
350
+ o({ blockId: p, blockProp: s, placeholder: a, initialCode: t });
350
351
  };
351
352
  return /* @__PURE__ */ e.jsxs("div", { className: "mt-2 flex flex-col gap-y-1", children: [
352
353
  /* @__PURE__ */ e.jsx(
@@ -354,256 +355,256 @@ const je = ({ data: r, fullView: o }) => {
354
355
  {
355
356
  onClick: d,
356
357
  className: "text-pretty w-[90%] max-w-full cursor-default truncate rounded border bg-white p-2 text-left text-[10px]",
357
- children: t.trim().length > 0 ? t.substring(0, 46) : o || "Eg: <script>console.log('Hello, world!');<\/script>"
358
+ children: t.trim().length > 0 ? t.substring(0, 46) : a || "Eg: <script>console.log('Hello, world!');<\/script>"
358
359
  }
359
360
  ),
360
- /* @__PURE__ */ e.jsx(B, { onClick: d, size: "sm", variant: "outline", className: "w-fit", children: a("Open code editor") })
361
+ /* @__PURE__ */ e.jsx(P, { onClick: d, size: "sm", variant: "outline", className: "w-fit", children: l("Open code editor") })
361
362
  ] });
362
- }, Ce = bt(({ id: r, properties: o, formData: t, onChange: a }) => {
363
- const [l, s] = w(t), d = { type: "object", properties: {} }, c = {};
364
- Object.keys(o).forEach((p) => {
365
- const h = o[p];
366
- if (X(["slot", "styles"], h.type))
363
+ }, je = ft(({ id: r, properties: a, formData: t, onChange: l }) => {
364
+ const [o, n] = j(t), d = { type: "object", properties: {} }, p = {};
365
+ Object.keys(a).forEach((c) => {
366
+ const u = a[c];
367
+ if (z(["slot", "styles"], u.type))
367
368
  return;
368
- const i = p;
369
- d.properties[i] = ur(h), c[i] = gr(h);
369
+ const i = c;
370
+ d.properties[i] = yr(u), p[i] = hr(u);
370
371
  }), A(() => {
371
- s(t);
372
+ n(t);
372
373
  }, [r]);
373
- const n = de(
374
- async ({ formData: p }, h) => {
375
- a({ formData: p }, h);
374
+ const s = ce(
375
+ async ({ formData: c }, u) => {
376
+ l({ formData: c }, u);
376
377
  },
377
- [a],
378
+ [l],
378
379
  1e3
379
380
  // save only every 5 seconds
380
381
  );
381
382
  return /* @__PURE__ */ e.jsx(
382
- Yr,
383
+ Wr,
383
384
  {
384
385
  widgets: {
385
- binding: rs,
386
- richtext: xr,
387
- icon: yr,
388
- image: hr,
389
- code: ss
386
+ binding: as,
387
+ richtext: mr,
388
+ icon: br,
389
+ image: fr,
390
+ code: ns
390
391
  },
391
- fields: { link: br },
392
+ fields: { link: vr },
392
393
  idSeparator: ".",
393
394
  autoComplete: "off",
394
395
  omitExtraData: !1,
395
396
  liveOmit: !1,
396
397
  liveValidate: !1,
397
- validator: Xr,
398
- uiSchema: c,
398
+ validator: Ur,
399
+ uiSchema: p,
399
400
  schema: d,
400
- formData: l,
401
- onChange: ({ formData: p }, h) => {
402
- h && (s(p), n({ formData: p }, h));
401
+ formData: o,
402
+ onChange: ({ formData: c }, u) => {
403
+ u && (n(c), s({ formData: c }, u));
403
404
  }
404
405
  }
405
406
  );
406
- }), os = () => {
407
- const [r, o] = Zr(), t = mr(), a = (d, c) => {
408
- o((n) => ({ ...n, [d]: c }));
407
+ }), is = () => {
408
+ const [r, a] = Kr(), t = wr(), l = (d, p) => {
409
+ a((s) => ({ ...s, [d]: p }));
409
410
  };
410
- if (m(t))
411
+ if (b(t))
411
412
  return null;
412
- const { block: l, settings: s } = t;
413
+ const { block: o, settings: n } = t;
413
414
  return /* @__PURE__ */ e.jsxs("div", { className: "text-xs hover:no-underline", children: [
414
415
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2 bg-gray-100 px-4 py-2", children: [
415
416
  t.block._type,
416
417
  " settings"
417
418
  ] }),
418
419
  /* @__PURE__ */ e.jsx("div", { className: "bg-white pb-2", children: /* @__PURE__ */ e.jsx(
419
- Ce,
420
+ je,
420
421
  {
421
- id: l == null ? void 0 : l._id,
422
- onChange: ({ formData: d }) => a(l._id, d),
423
- formData: y(r, l._id, {}),
424
- properties: s
422
+ id: o == null ? void 0 : o._id,
423
+ onChange: ({ formData: d }) => l(o._id, d),
424
+ formData: g(r, o._id, {}),
425
+ properties: n
425
426
  }
426
427
  ) })
427
428
  ] });
428
429
  };
429
- function ls() {
430
- const r = U(), o = rt(), t = st(), a = Re(r._type), l = { ...r }, [s, d] = w(l), c = ot("dataBindingSupport", !1), n = ({ formData: x }, g, v) => {
431
- if (g && (s == null ? void 0 : s._id) === r._id) {
432
- const C = g.replace("root.", "");
433
- t([r._id], { [C]: y(x, C) }, v);
430
+ function ds() {
431
+ const r = X(), a = st(), t = ot(), l = Se(r._type), o = { ...r }, [n, d] = j(o), p = lt("dataBindingSupport", !1), s = ({ formData: y }, x, v) => {
432
+ if (x && (n == null ? void 0 : n._id) === r._id) {
433
+ const k = x.replace("root.", "");
434
+ t([r._id], { [k]: g(y, k) }, v);
434
435
  }
435
- }, p = H(
436
- Ct(({ formData: x }, g, v) => {
437
- n({ formData: x }, g, v), d(x);
436
+ }, c = B(
437
+ Nt(({ formData: y }, x, v) => {
438
+ s({ formData: y }, x, v), d(y);
438
439
  }, 1500),
439
440
  [r == null ? void 0 : r._id]
440
- ), h = ({ formData: x }, g) => {
441
- if (g) {
442
- const v = g.replace("root.", "");
443
- o(
441
+ ), u = ({ formData: y }, x) => {
442
+ if (x) {
443
+ const v = x.replace("root.", "");
444
+ a(
444
445
  [r._id],
445
- fr(v, y(x, v.split(".")))
446
- ), p({ formData: x }, g, { [v]: y(s, v) });
446
+ jr(v, g(y, v.split(".")))
447
+ ), c({ formData: y }, x, { [v]: g(n, v) });
447
448
  }
448
- }, i = he(y(l, "_bindings", {})), u = T(() => {
449
- const x = kt(y(a, "props", {}));
450
- return c && Nt(i, (g) => delete x[g]), x;
451
- }, [a, i, c]);
449
+ }, i = he(g(o, "_bindings", {})), h = R(() => {
450
+ const y = _t(g(l, "props", {}));
451
+ return p && St(i, (x) => delete y[x]), y;
452
+ }, [l, i, p]);
452
453
  return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
453
- /* @__PURE__ */ e.jsx(os, {}),
454
- c ? /* @__PURE__ */ e.jsxs(lt, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
455
- /* @__PURE__ */ e.jsxs(me, { value: "BINDING", children: [
454
+ /* @__PURE__ */ e.jsx(is, {}),
455
+ p ? /* @__PURE__ */ e.jsxs(at, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
456
+ /* @__PURE__ */ e.jsxs(be, { value: "BINDING", children: [
456
457
  /* @__PURE__ */ e.jsx(fe, { className: "bg-gray-100 px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
457
458
  /* @__PURE__ */ e.jsx(
458
459
  "div",
459
460
  {
460
- className: `h-[8px] w-[8px] rounded-full ${m(y(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
461
+ className: `h-[8px] w-[8px] rounded-full ${b(g(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
461
462
  }
462
463
  ),
463
464
  "Data Binding"
464
465
  ] }) }),
465
466
  /* @__PURE__ */ e.jsx(ve, { className: "px-4 pt-4", children: /* @__PURE__ */ e.jsx(
466
- ts,
467
+ ls,
467
468
  {
468
- bindingData: y(r, "_bindings", {}),
469
- onChange: (x) => {
470
- n({ formData: { _bindings: x } }, "root._bindings");
469
+ bindingData: g(r, "_bindings", {}),
470
+ onChange: (y) => {
471
+ s({ formData: { _bindings: y } }, "root._bindings");
471
472
  }
472
473
  }
473
474
  ) })
474
475
  ] }),
475
- /* @__PURE__ */ e.jsxs(me, { value: "STATIC", children: [
476
+ /* @__PURE__ */ e.jsxs(be, { value: "STATIC", children: [
476
477
  /* @__PURE__ */ e.jsx(fe, { className: "bg-gray-100 px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
477
478
  /* @__PURE__ */ e.jsx("div", { className: "h-[8px] w-[8px] rounded-full bg-blue-500" }),
478
479
  "Static Content"
479
480
  ] }) }),
480
481
  /* @__PURE__ */ e.jsxs(ve, { className: "pt-4", children: [
481
- m(i) ? null : /* @__PURE__ */ e.jsxs("div", { className: "mx-4 mb-1 mt-0 rounded-sm border border-orange-500 bg-orange-100 p-1 text-xs text-orange-500", children: [
482
+ b(i) ? null : /* @__PURE__ */ e.jsxs("div", { className: "mx-4 mb-1 mt-0 rounded-sm border border-orange-500 bg-orange-100 p-1 text-xs text-orange-500", children: [
482
483
  "Data binding is set for ",
483
- /* @__PURE__ */ e.jsx("b", { children: _(i, be).join(", ") }),
484
+ /* @__PURE__ */ e.jsx("b", { children: T(i, me).join(", ") }),
484
485
  " ",
485
486
  i.length === 1 ? "property" : "properties",
486
487
  ". Remove data binding to edit static content."
487
488
  ] }),
488
489
  /* @__PURE__ */ e.jsx(
489
- Ce,
490
+ je,
490
491
  {
491
492
  id: r == null ? void 0 : r._id,
492
- onChange: h,
493
- formData: l,
494
- properties: u
493
+ onChange: u,
494
+ formData: o,
495
+ properties: h
495
496
  }
496
497
  )
497
498
  ] })
498
499
  ] })
499
500
  ] }) : /* @__PURE__ */ e.jsx(
500
- Ce,
501
+ je,
501
502
  {
502
503
  id: r == null ? void 0 : r._id,
503
- onChange: h,
504
- formData: l,
505
- properties: u
504
+ onChange: u,
505
+ formData: o,
506
+ properties: h
506
507
  }
507
508
  )
508
509
  ] });
509
510
  }
510
- const as = ({ blockId: r }) => {
511
- const { t: o } = I(), { askAi: t, loading: a, error: l } = vr(), [s, d] = w(""), c = mt(null);
511
+ const cs = ({ blockId: r }) => {
512
+ const { t: a } = F(), { askAi: t, loading: l, error: o } = Cr(), [n, d] = j(""), p = ye(null);
512
513
  A(() => {
513
- var p;
514
- (p = c.current) == null || p.focus();
514
+ var c;
515
+ (c = p.current) == null || c.focus();
515
516
  }, []);
516
- const n = () => {
517
- l || d("");
517
+ const s = () => {
518
+ o || d("");
518
519
  };
519
520
  return /* @__PURE__ */ e.jsxs("div", { className: "", children: [
520
- /* @__PURE__ */ e.jsx("h2", { className: "mb-1 text-sm font-semibold leading-none tracking-tight", children: o("Ask AI") }),
521
+ /* @__PURE__ */ e.jsx("h2", { className: "mb-1 text-sm font-semibold leading-none tracking-tight", children: a("Ask AI") }),
521
522
  /* @__PURE__ */ e.jsx(
522
- wr,
523
+ nt,
523
524
  {
524
- ref: c,
525
- value: s,
526
- onChange: (p) => d(p.target.value),
527
- placeholder: o("Ask AI to edit styles"),
525
+ ref: p,
526
+ value: n,
527
+ onChange: (c) => d(c.target.value),
528
+ placeholder: a("Ask AI to edit styles"),
528
529
  className: "w-full border border-gray-400 focus:border-0",
529
530
  rows: 3,
530
- onKeyDown: (p) => {
531
- p.key === "Enter" && (p.preventDefault(), t("styles", r, s, n));
531
+ onKeyDown: (c) => {
532
+ c.key === "Enter" && (c.preventDefault(), t("styles", r, n, s));
532
533
  }
533
534
  }
534
535
  ),
535
536
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 my-2", children: [
536
- a ? null : /* @__PURE__ */ e.jsx(
537
- B,
537
+ l ? null : /* @__PURE__ */ e.jsx(
538
+ P,
538
539
  {
539
- disabled: s.trim().length < 5 || a,
540
- onClick: () => t("styles", r, s, n),
540
+ disabled: n.trim().length < 5 || l,
541
+ onClick: () => t("styles", r, n, s),
541
542
  variant: "default",
542
543
  className: "w-fit",
543
544
  size: "sm",
544
- children: a ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
545
- /* @__PURE__ */ e.jsx(Pr, { className: "w-5 h-5 animate-spin" }),
546
- o("Generating... Please wait")
547
- ] }) : o("Edit with AI")
545
+ children: l ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
546
+ /* @__PURE__ */ e.jsx(Er, { className: "w-5 h-5 animate-spin" }),
547
+ a("Generating... Please wait")
548
+ ] }) : a("Edit with AI")
548
549
  }
549
550
  ),
550
- a ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
551
- /* @__PURE__ */ e.jsxs(jr, { className: "flex items-center w-full px-4 py-1 pl-2 space-x-1", children: [
552
- /* @__PURE__ */ e.jsx(Cr, { className: "w-4 h-4 text-gray-500 animate-spin" }),
553
- /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: o("Generating... Please wait") })
551
+ l ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
552
+ /* @__PURE__ */ e.jsxs(kr, { className: "flex items-center w-full px-4 py-1 pl-2 space-x-1", children: [
553
+ /* @__PURE__ */ e.jsx(Nr, { className: "w-4 h-4 text-gray-500 animate-spin" }),
554
+ /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: a("Generating... Please wait") })
554
555
  ] }),
555
- /* @__PURE__ */ e.jsx(B, { variant: "destructive", onClick: () => stop(), className: "hidden w-fit", size: "sm", children: o("Stop") })
556
+ /* @__PURE__ */ e.jsx(P, { variant: "destructive", onClick: () => stop(), className: "hidden w-fit", size: "sm", children: a("Stop") })
556
557
  ] }) : null
557
558
  ] }),
558
- /* @__PURE__ */ e.jsx("div", { className: "max-w-full", children: l && /* @__PURE__ */ e.jsx("p", { className: "p-1 text-xs text-red-500 break-words bg-red-100 border border-red-500 rounded", children: l.message }) })
559
+ /* @__PURE__ */ e.jsx("div", { className: "max-w-full", children: o && /* @__PURE__ */ e.jsx("p", { className: "p-1 text-xs text-red-500 break-words bg-red-100 border border-red-500 rounded", children: o.message }) })
559
560
  ] });
560
- }, Oe = new Ur(Kr, {
561
+ }, ze = new qr(Jr, {
561
562
  isCaseSensitive: !1,
562
563
  threshold: 0.2,
563
564
  minMatchCharLength: 2,
564
565
  keys: ["name"]
565
566
  });
566
- function pt() {
567
- var S;
568
- const { t: r } = I(), [o] = pe(), t = U(), a = Te(), l = at(), [s] = nt(), d = ot("askAiCallBack", null), [c, n] = w(""), { toast: p } = it(), h = (S = oe(o)) == null ? void 0 : S.prop, i = _t((y(t, h, "").replace(qr, "").split(",").pop() || "").split(" "), m), u = () => {
569
- const j = c.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
570
- a(s, j, !0), n("");
571
- }, [x, g] = w([]), v = ({ value: j }) => {
572
- const D = j.trim().toLowerCase(), Z = D.match(/.+:/g);
573
- let b = [];
574
- if (Z && Z.length > 0) {
575
- const [f] = Z, N = D.replace(f, "");
576
- b = Oe.search(N).map((z) => ({
577
- ...z,
578
- item: { ...z.item, name: f + z.item.name }
567
+ function gt() {
568
+ var N;
569
+ const { t: r } = F(), [a] = le(), t = X(), l = _e(), o = it(), [n] = dt(), d = lt("askAiCallBack", null), [p, s] = j(""), { toast: c } = _r(), u = (N = oe(a)) == null ? void 0 : N.prop, i = Tt((g(t, u, "").replace(es, "").split(",").pop() || "").split(" "), b), h = () => {
570
+ const C = p.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
571
+ l(n, C, !0), s("");
572
+ }, [y, x] = j([]), v = ({ value: C }) => {
573
+ const V = C.trim().toLowerCase(), W = V.match(/.+:/g);
574
+ let m = [];
575
+ if (W && W.length > 0) {
576
+ const [f] = W, S = V.replace(f, "");
577
+ m = ze.search(S).map((L) => ({
578
+ ...L,
579
+ item: { ...L.item, name: f + L.item.name }
579
580
  }));
580
581
  } else
581
- b = Oe.search(D);
582
- return g(_(b, "item"));
583
- }, C = () => {
584
- g([]);
585
- }, K = (j) => j.name, L = (j) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: j.name }), G = {
582
+ m = ze.search(V);
583
+ return x(T(m, "item"));
584
+ }, k = () => {
585
+ x([]);
586
+ }, E = (C) => C.name, I = (C) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: C.name }), Z = {
586
587
  autoComplete: "off",
587
588
  autoCorrect: "off",
588
589
  autoCapitalize: "off",
589
590
  spellCheck: !1,
590
591
  placeholder: r("Enter classes separated by space"),
591
- value: c,
592
- onKeyDown: (j) => {
593
- j.key === "Enter" && c.trim() !== "" && u();
592
+ value: p,
593
+ onKeyDown: (C) => {
594
+ C.key === "Enter" && p.trim() !== "" && h();
594
595
  },
595
- onChange: (j, { newValue: D }) => n(D),
596
+ onChange: (C, { newValue: V }) => s(V),
596
597
  className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
597
- }, q = () => {
598
+ }, w = () => {
598
599
  if (navigator.clipboard === void 0) {
599
- p({
600
+ c({
600
601
  title: "Clipboard not supported",
601
602
  description: "Please use Chrome, Firefox or Safari",
602
603
  variant: "destructive"
603
604
  });
604
605
  return;
605
606
  }
606
- navigator.clipboard.writeText(i.join(" ")), p({
607
+ navigator.clipboard.writeText(i.join(" ")), c({
607
608
  title: "Copied",
608
609
  description: "Classes copied to clipboard"
609
610
  });
@@ -611,34 +612,34 @@ function pt() {
611
612
  return /* @__PURE__ */ e.jsxs(
612
613
  "div",
613
614
  {
614
- className: `flex ${x.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-1.5 overflow-y-auto border-b-2 bg-gray-100 pb-4`,
615
+ className: `flex ${y.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-1.5 overflow-y-auto border-b-2 bg-gray-100 pb-4`,
615
616
  children: [
616
617
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-x-2", children: [
617
618
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
618
619
  /* @__PURE__ */ e.jsx("span", { children: r("Classes") }),
619
- /* @__PURE__ */ e.jsxs($, { children: [
620
- /* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsx(Dt, { onClick: q, className: "cursor-pointer" }) }),
621
- /* @__PURE__ */ e.jsx(M, { children: /* @__PURE__ */ e.jsx("p", { children: r("Copy classes to clipboard") }) })
620
+ /* @__PURE__ */ e.jsxs(U, { children: [
621
+ /* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(It, { onClick: w, className: "cursor-pointer" }) }),
622
+ /* @__PURE__ */ e.jsx(G, { children: /* @__PURE__ */ e.jsx("p", { children: r("Copy classes to clipboard") }) })
622
623
  ] })
623
624
  ] }),
624
- d ? /* @__PURE__ */ e.jsxs(Je, { children: [
625
- /* @__PURE__ */ e.jsx(Qe, { children: /* @__PURE__ */ e.jsxs(B, { variant: "default", className: "h-6 w-fit", size: "sm", children: [
626
- /* @__PURE__ */ e.jsx(Ar, { className: "h-4 w-4" }),
625
+ d ? /* @__PURE__ */ e.jsxs(Qe, { children: [
626
+ /* @__PURE__ */ e.jsx(et, { children: /* @__PURE__ */ e.jsxs(P, { variant: "default", className: "h-6 w-fit", size: "sm", children: [
627
+ /* @__PURE__ */ e.jsx(Mr, { className: "h-4 w-4" }),
627
628
  /* @__PURE__ */ e.jsx("span", { className: "ml-2", children: r("Ask AI") })
628
629
  ] }) }),
629
- /* @__PURE__ */ e.jsx(et, { side: "left", className: "p-2", children: /* @__PURE__ */ e.jsx(as, { blockId: t == null ? void 0 : t._id }) })
630
+ /* @__PURE__ */ e.jsx(tt, { side: "left", className: "p-2", children: /* @__PURE__ */ e.jsx(cs, { blockId: t == null ? void 0 : t._id }) })
630
631
  ] }) : null
631
632
  ] }),
632
633
  /* @__PURE__ */ e.jsxs("div", { className: "relative flex items-center gap-x-3", children: [
633
634
  /* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
634
- Wr,
635
+ Gr,
635
636
  {
636
- suggestions: x,
637
+ suggestions: y,
637
638
  onSuggestionsFetchRequested: v,
638
- onSuggestionsClearRequested: C,
639
- getSuggestionValue: K,
640
- renderSuggestion: L,
641
- inputProps: G,
639
+ onSuggestionsClearRequested: k,
640
+ getSuggestionValue: E,
641
+ renderSuggestion: I,
642
+ inputProps: Z,
642
643
  containerProps: {
643
644
  className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
644
645
  },
@@ -650,172 +651,162 @@ function pt() {
650
651
  }
651
652
  ) }),
652
653
  /* @__PURE__ */ e.jsx(
653
- B,
654
+ P,
654
655
  {
655
656
  variant: "outline",
656
657
  className: "h-6 border-gray-700",
657
- onClick: u,
658
- disabled: c.trim() === "",
658
+ onClick: h,
659
+ disabled: p.trim() === "",
659
660
  size: "sm",
660
- children: /* @__PURE__ */ e.jsx(_e, {})
661
+ children: /* @__PURE__ */ e.jsx(Ke, {})
661
662
  }
662
663
  )
663
664
  ] }),
664
- /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-wrap gap-2 overflow-x-hidden", children: ne.Children.toArray(
665
- i.map((j) => /* @__PURE__ */ e.jsxs(
665
+ /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-wrap gap-2 overflow-x-hidden", children: ie.Children.toArray(
666
+ i.map((C) => /* @__PURE__ */ e.jsxs(
666
667
  "div",
667
668
  {
668
669
  className: "group relative flex max-w-[260px] cursor-default items-center gap-x-1 truncate rounded border border-gray-300 bg-gray-200 p-px px-1.5 text-[11px] text-gray-600 hover:border-gray-300",
669
670
  children: [
670
- j,
671
+ C,
671
672
  /* @__PURE__ */ e.jsx(
672
- Ke,
673
+ Ge,
673
674
  {
674
- onClick: () => l(s, [j]),
675
+ onClick: () => o(n, [C]),
675
676
  className: "invisible absolute right-1 rounded-full bg-red-400 hover:text-white group-hover:visible group-hover:cursor-pointer"
676
677
  }
677
678
  )
678
679
  ]
679
680
  },
680
- j
681
+ C
681
682
  ))
682
683
  ) })
683
684
  ]
684
685
  }
685
686
  );
686
687
  }
687
- const ns = ({ onAdd: r }) => {
688
- const { t: o } = I(), [t, a] = w({ key: "", value: "" }), l = () => {
689
- m(t.key) || (r({ ...t, key: t.key }), a({ key: "", value: "" }));
688
+ const ps = $.memo(function({ preloadedAttributes: a = [], onAttributesChange: t }) {
689
+ const [l, o] = j([]), [n, d] = j(""), [p, s] = j(""), [c, u] = j(null), [i, h] = j(""), y = ye(null), x = ye(null);
690
+ A(() => {
691
+ y.current && y.current.focus();
692
+ }, [l]), A(() => {
693
+ o(a);
694
+ }, [a]);
695
+ const v = () => {
696
+ if (n.startsWith("@")) {
697
+ h("Attribute keys cannot start with '@'");
698
+ return;
699
+ }
700
+ if (n && p) {
701
+ const w = [...l, { key: n, value: p }];
702
+ t(w), o(l), d(""), s(""), h("");
703
+ }
704
+ }, k = (w) => {
705
+ const N = l.filter((C, V) => V !== w);
706
+ t(N), o(N);
707
+ }, E = (w) => {
708
+ u(w), d(l[w].key), s(l[w].value);
709
+ }, I = () => {
710
+ if (n.startsWith("@")) {
711
+ h("Attribute keys cannot start with '@'");
712
+ return;
713
+ }
714
+ if (c !== null && n && p) {
715
+ const w = [...l];
716
+ w[c] = { key: n, value: p }, t(w), o(w), u(null), d(""), s(""), h("");
717
+ }
718
+ }, Z = (w) => {
719
+ w.key === "Enter" && !w.shiftKey && (w.preventDefault(), c !== null ? I() : v());
690
720
  };
691
- return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 border-gray-200", children: [
692
- /* @__PURE__ */ e.jsx(
693
- we,
721
+ return /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
722
+ /* @__PURE__ */ e.jsxs(
723
+ "form",
694
724
  {
695
- name: "key",
696
- className: "h-6",
697
- onChange: (s) => a({ ...t, key: s.target.value }),
698
- value: t.key,
699
- placeholder: o("Name"),
700
- autoComplete: "off",
701
- autoCapitalize: "off",
702
- onKeyDown: (s) => {
703
- s.key === "Enter" && (s.preventDefault(), m(t.key) || l());
704
- }
725
+ onSubmit: (w) => {
726
+ w.preventDefault(), c !== null ? I() : v();
727
+ },
728
+ className: "space-y-3",
729
+ children: [
730
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
731
+ /* @__PURE__ */ e.jsxs("div", { className: "w-full", children: [
732
+ /* @__PURE__ */ e.jsx(Be, { htmlFor: "attrKey", className: "text-xs", children: "Key" }),
733
+ /* @__PURE__ */ e.jsx(
734
+ ct,
735
+ {
736
+ id: "attrKey",
737
+ ref: y,
738
+ value: n,
739
+ onChange: (w) => d(w.target.value),
740
+ placeholder: "Key",
741
+ className: "h-8 text-sm"
742
+ }
743
+ )
744
+ ] }),
745
+ /* @__PURE__ */ e.jsxs("div", { className: "w-full", children: [
746
+ /* @__PURE__ */ e.jsx(Be, { htmlFor: "attrValue", className: "text-xs", children: "Value" }),
747
+ /* @__PURE__ */ e.jsx(
748
+ nt,
749
+ {
750
+ id: "attrValue",
751
+ rows: 2,
752
+ ref: x,
753
+ value: p,
754
+ onChange: (w) => s(w.target.value),
755
+ onKeyDown: Z,
756
+ placeholder: "Value",
757
+ className: "bg-background text-sm"
758
+ }
759
+ )
760
+ ] })
761
+ ] }),
762
+ /* @__PURE__ */ e.jsx(P, { type: "submit", className: "h-8 w-full text-sm", children: c !== null ? "Save" : "Add" }),
763
+ i && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-red-500", children: i })
764
+ ]
705
765
  }
706
766
  ),
707
- /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-1.5", children: /* @__PURE__ */ e.jsx(
708
- we,
709
- {
710
- className: "h-6",
711
- name: "value",
712
- onChange: (s) => a({ ...t, value: s.target.value }),
713
- value: t.value,
714
- placeholder: o("Value"),
715
- autoComplete: "off",
716
- autoCapitalize: "off",
717
- onKeyDown: (s) => {
718
- s.key === "Enter" && (s.preventDefault(), m(t.key) || l());
719
- }
720
- }
721
- ) }),
722
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
723
- /* @__PURE__ */ e.jsxs(B, { disabled: m(t.key), onClick: l, size: "sm", className: "flex items-center", children: [
724
- /* @__PURE__ */ e.jsxs("span", { children: [
725
- o("Add"),
726
- " "
727
- ] }),
728
- /* @__PURE__ */ e.jsx(_e, {})
767
+ /* @__PURE__ */ e.jsx("div", { className: "mt-4 max-h-60 space-y-1 overflow-y-auto", children: l.map((w, N) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between rounded bg-muted p-1.5 text-sm", children: [
768
+ /* @__PURE__ */ e.jsxs("div", { className: "mr-2 flex flex-col", children: [
769
+ /* @__PURE__ */ e.jsx("span", { className: "truncate font-semibold", children: w.key }),
770
+ /* @__PURE__ */ e.jsx("span", { className: "text-wrap max-w-[200px] text-muted-foreground", children: w.value })
729
771
  ] }),
730
- m(t.key) ? null : /* @__PURE__ */ e.jsx(B, { variant: "ghost", onClick: () => a({ key: "", value: "" }), children: o("Cancel") })
731
- ] })
772
+ /* @__PURE__ */ e.jsxs("div", { className: "flex-shrink-0", children: [
773
+ /* @__PURE__ */ e.jsxs(P, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => E(N), children: [
774
+ /* @__PURE__ */ e.jsx(Lr, { className: "h-3 w-3" }),
775
+ /* @__PURE__ */ e.jsx("span", { className: "sr-only", children: "Edit attribute" })
776
+ ] }),
777
+ /* @__PURE__ */ e.jsxs(P, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => k(N), children: [
778
+ /* @__PURE__ */ e.jsx(Or, { className: "h-3 w-3" }),
779
+ /* @__PURE__ */ e.jsx("span", { className: "sr-only", children: "Remove attribute" })
780
+ ] })
781
+ ] })
782
+ ] }, N)) })
732
783
  ] });
733
- }, is = () => {
734
- const r = U(), [o, t] = w([]), [a] = pe(), l = rt(), s = st(), { t: d } = I(), { toast: c } = it(), n = `${y(a, "0.prop")}_attrs`;
735
- ne.useEffect(() => {
736
- const u = _(y(r, n), (x, g) => ({ key: g, value: x }));
737
- m(u) ? t([]) : t(u);
738
- }, [y(r, n)]);
739
- const p = (u) => {
740
- const x = ye(o, (g, v) => u !== v);
741
- i(x);
742
- }, h = (u) => {
743
- const x = Ze(o, { key: u.key });
744
- if (x && (x.value.startsWith("dnd-") || x.value.startsWith("#dnd-"))) {
745
- c({
746
- title: d("Cannot add predefined attribute"),
747
- variant: "destructive",
748
- description: d(`"(${u.key})" cannot be added as it is a predefined attribute for this block`)
749
- });
750
- return;
751
- }
752
- const g = [...o, u];
753
- i(g);
754
- }, i = ne.useCallback(
755
- (u = []) => {
756
- const x = {};
757
- Ne(u, (g) => {
758
- m(g.key) || We(x, g.key, g.value);
759
- }), s([y(r, "_id")], { [n]: x });
784
+ }), us = ie.memo(() => {
785
+ const r = X(), [a, t] = j([]), [l] = le(), o = st(), n = ot(), d = `${g(l, "0.prop")}_attrs`;
786
+ ie.useEffect(() => {
787
+ const s = T(g(r, d), (c, u) => ({ key: u, value: c }));
788
+ b(s) ? t([]) : t(s);
789
+ }, [g(r, d)]);
790
+ const p = ie.useCallback(
791
+ (s = []) => {
792
+ const c = {};
793
+ ke(s, (u) => {
794
+ b(u.key) || We(c, u.key, u.value);
795
+ }), n([g(r, "_id")], { [d]: c });
760
796
  },
761
- [r, l, n]
797
+ [r, o, d]
762
798
  );
763
- return /* @__PURE__ */ e.jsx("div", { className: "mb-20 flex min-h-max flex-col gap-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
764
- /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("ul", { className: "overflow-hidden rounded-md bg-gray-100 text-xs text-gray-700", children: [
765
- m(o) ? /* @__PURE__ */ e.jsx("li", { className: "flex h-4 items-center justify-center", children: /* @__PURE__ */ e.jsx("p", { children: d("No attributes added") }) }) : null,
766
- ne.Children.toArray(
767
- _(o, (u) => /* @__PURE__ */ e.jsxs("li", { className: "group flex w-full max-w-full items-center justify-between", children: [
768
- /* @__PURE__ */ e.jsxs($, { delayDuration: 1e3, children: [
769
- /* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "max-w-[230px] cursor-default truncate px-1 hover:bg-gray-200", children: [
770
- u.key,
771
- u.value.toString().trim() ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
772
- " ",
773
- /* @__PURE__ */ e.jsx("span", { className: "font-bold text-orange-500", children: "=" }),
774
- " ",
775
- u.value.toString().trim()
776
- ] }) : null
777
- ] }) }),
778
- /* @__PURE__ */ e.jsxs(M, { className: "max-w-[200px]", children: [
779
- /* @__PURE__ */ e.jsxs("div", { children: [
780
- d("Name"),
781
- ": ",
782
- u.key
783
- ] }),
784
- /* @__PURE__ */ e.jsxs("div", { children: [
785
- d("Value"),
786
- ": ",
787
- u.value.toString()
788
- ] })
789
- ] })
790
- ] }),
791
- /* @__PURE__ */ e.jsxs($, { children: [
792
- /* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsx(
793
- "button",
794
- {
795
- disabled: W(u.value, "dnd-"),
796
- className: "invisible group-hover:visible",
797
- onClick: () => p(o.indexOf(u)),
798
- children: /* @__PURE__ */ e.jsx($r, { className: "w-4 text-gray-500" })
799
- }
800
- ) }),
801
- /* @__PURE__ */ e.jsx(M, { className: "max-w-[200px]", children: W(u.value.toString(), "dnd-") ? d("Predefined attribute. Cannot be deleted") : d("Remove attribute") })
802
- ] })
803
- ] }))
804
- )
805
- ] }) }),
806
- /* @__PURE__ */ e.jsx("div", { className: "py-2" }),
807
- /* @__PURE__ */ e.jsx(ns, { onAdd: (u) => h(u) })
808
- ] }) });
809
- }, k = ["px", "%", "em", "rem", "ch", "vh", "vw"], ds = {
799
+ return /* @__PURE__ */ e.jsx("div", { className: "mb-20 flex min-h-max flex-col gap-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsx("div", { className: "flex flex-col", children: /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(ps, { preloadedAttributes: a, onAttributesChange: p }) }) }) });
800
+ }), _ = ["px", "%", "em", "rem", "ch", "vh", "vw"], gs = {
810
801
  heading: "flex.heading",
811
802
  items: [
812
- { type: "arbitrary", label: "flex.basis", units: k, property: "flexBasis" },
803
+ { type: "arbitrary", label: "flex.basis", units: _, property: "flexBasis" },
813
804
  { type: "range", label: "flex.order", property: "order" },
814
805
  { type: "dropdown", label: "flex.flex", property: "flexGrowShrink" },
815
806
  { type: "dropdown", label: "flex.grow", property: "flexGrow" },
816
807
  { type: "dropdown", label: "flex.shrink", property: "flexShrink" }
817
808
  ]
818
- }, cs = {
809
+ }, xs = {
819
810
  heading: "grid.heading",
820
811
  items: [
821
812
  { type: "range", label: "grid.col_span", property: "gridColSpan" },
@@ -826,18 +817,18 @@ const ns = ({ onAdd: r }) => {
826
817
  { type: "range", label: "grid.row_end", property: "gridRowEnd" },
827
818
  { type: "range", label: "grid.order", property: "order" }
828
819
  ]
829
- }, ps = [
820
+ }, ys = [
830
821
  {
831
822
  heading: "Styles",
832
823
  items: [
833
- { component: pt },
834
- { type: "arbitrary", label: "layout.width", units: k.concat("auto"), property: "width" },
835
- { type: "arbitrary", label: "layout.height", units: k.concat("auto"), property: "height" },
824
+ { component: gt },
825
+ { type: "arbitrary", label: "layout.width", units: _.concat("auto"), property: "width" },
826
+ { type: "arbitrary", label: "layout.height", units: _.concat("auto"), property: "height" },
836
827
  {
837
828
  styleType: "multiple",
838
829
  label: "layout.margin",
839
830
  negative: !0,
840
- units: [...k, "auto"],
831
+ units: [..._, "auto"],
841
832
  options: [
842
833
  { key: "margin", label: "layout.margin_all" },
843
834
  { key: "marginX", label: "layout.margin_lr" },
@@ -867,8 +858,8 @@ const ns = ({ onAdd: r }) => {
867
858
  items: [
868
859
  { type: "dropdown", property: "textAlign", label: "typography.align" },
869
860
  { type: "dropdown", property: "fontFamily", label: "typography.font" },
870
- { type: "arbitrary", property: "fontSize", label: "typography.size", units: k },
871
- { type: "arbitrary", property: "lineHeight", label: "typography.height", units: k.concat("-") },
861
+ { type: "arbitrary", property: "fontSize", label: "typography.size", units: _ },
862
+ { type: "arbitrary", property: "lineHeight", label: "typography.height", units: _.concat("-") },
872
863
  { type: "range", property: "fontWeight", label: "typography.weight" },
873
864
  { type: "color", property: "textColor", label: "typography.color" }
874
865
  ]
@@ -890,19 +881,19 @@ const ns = ({ onAdd: r }) => {
890
881
  },
891
882
  {
892
883
  heading: "Attributes",
893
- items: [{ component: is }]
884
+ items: [{ component: us }]
894
885
  }
895
- ], Vo = [
886
+ ], Ao = [
896
887
  {
897
888
  heading: "layout.heading",
898
889
  items: [
899
- { type: "arbitrary", label: "layout.width", units: k.concat("auto"), property: "width" },
900
- { type: "arbitrary", label: "layout.height", units: k.concat("auto"), property: "height" },
890
+ { type: "arbitrary", label: "layout.width", units: _.concat("auto"), property: "width" },
891
+ { type: "arbitrary", label: "layout.height", units: _.concat("auto"), property: "height" },
901
892
  {
902
893
  styleType: "multiple",
903
894
  label: "layout.margin",
904
895
  negative: !0,
905
- units: [...k, "auto"],
896
+ units: [..._, "auto"],
906
897
  options: [
907
898
  { key: "margin", label: "layout.margin_all" },
908
899
  { key: "marginX", label: "layout.margin_lr" },
@@ -943,16 +934,16 @@ const ns = ({ onAdd: r }) => {
943
934
  styleType: "accordion",
944
935
  heading: "size.min_width_height",
945
936
  items: [
946
- { type: "arbitrary", label: "size.min_width", units: k.concat("auto"), property: "minWidth" },
947
- { type: "arbitrary", label: "size.min_height", units: k.concat("auto"), property: "minHeight" }
937
+ { type: "arbitrary", label: "size.min_width", units: _.concat("auto"), property: "minWidth" },
938
+ { type: "arbitrary", label: "size.min_height", units: _.concat("auto"), property: "minHeight" }
948
939
  ]
949
940
  },
950
941
  {
951
942
  styleType: "accordion",
952
943
  heading: "size.max_width_height",
953
944
  items: [
954
- { type: "arbitrary", label: "size.max_width", units: k.concat("auto"), property: "maxWidth" },
955
- { type: "arbitrary", label: "size.max_height", units: k.concat("auto"), property: "maxHeight" }
945
+ { type: "arbitrary", label: "size.max_width", units: _.concat("auto"), property: "maxWidth" },
946
+ { type: "arbitrary", label: "size.max_height", units: _.concat("auto"), property: "maxHeight" }
956
947
  ]
957
948
  },
958
949
  {
@@ -969,7 +960,7 @@ const ns = ({ onAdd: r }) => {
969
960
  {
970
961
  heading: "display.heading",
971
962
  items: [
972
- { type: "dropdown", label: "display.display", property: "display", units: k },
963
+ { type: "dropdown", label: "display.display", property: "display", units: _ },
973
964
  {
974
965
  styleType: "accordion",
975
966
  heading: "display.flex_options",
@@ -1020,7 +1011,7 @@ const ns = ({ onAdd: r }) => {
1020
1011
  styleType: "accordion",
1021
1012
  heading: "display.visibility_opacity",
1022
1013
  items: [
1023
- { type: "dropdown", label: "display.visibility", property: "visibility", units: k },
1014
+ { type: "dropdown", label: "display.visibility", property: "visibility", units: _ },
1024
1015
  { type: "arbitrary", label: "display.opacity", property: "opacity", units: ["-"] }
1025
1016
  ]
1026
1017
  }
@@ -1096,8 +1087,8 @@ const ns = ({ onAdd: r }) => {
1096
1087
  heading: "typography.heading",
1097
1088
  items: [
1098
1089
  { type: "dropdown", property: "fontFamily", label: "typography.font" },
1099
- { type: "arbitrary", property: "fontSize", label: "typography.size", units: k },
1100
- { type: "arbitrary", property: "lineHeight", label: "typography.height", units: k.concat("-") },
1090
+ { type: "arbitrary", property: "fontSize", label: "typography.size", units: _ },
1091
+ { type: "arbitrary", property: "lineHeight", label: "typography.height", units: _.concat("-") },
1101
1092
  { type: "range", property: "fontWeight", label: "typography.weight" },
1102
1093
  { type: "color", property: "textColor", label: "typography.color" },
1103
1094
  {
@@ -1294,89 +1285,89 @@ const ns = ({ onAdd: r }) => {
1294
1285
  },
1295
1286
  {
1296
1287
  heading: "classes.heading",
1297
- items: [{ component: pt }]
1288
+ items: [{ component: gt }]
1298
1289
  }
1299
- ], ut = {
1290
+ ], xt = {
1300
1291
  "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" }) }),
1301
1292
  // visibility
1302
- visible: Bt,
1303
- invisible: Be,
1293
+ visible: At,
1294
+ invisible: De,
1304
1295
  // display
1305
- hidden: Be,
1306
- gap: Y,
1307
- gapX: R,
1308
- gapY: V,
1309
- spaceX: R,
1310
- spaceY: V,
1311
- overscroll: Y,
1312
- overscrollX: R,
1313
- overscrollY: V,
1314
- overflow: Y,
1315
- overflowX: R,
1316
- overflowY: V,
1296
+ hidden: De,
1297
+ gap: O,
1298
+ gapX: H,
1299
+ gapY: D,
1300
+ spaceX: H,
1301
+ spaceY: D,
1302
+ overscroll: O,
1303
+ overscrollX: H,
1304
+ overscrollY: D,
1305
+ overflow: O,
1306
+ overflowX: H,
1307
+ overflowY: D,
1317
1308
  top: J,
1318
1309
  right: Q,
1319
1310
  bottom: ee,
1320
1311
  left: te,
1321
- inset: Y,
1322
- insetX: R,
1323
- insetY: V,
1324
- border: Y,
1325
- borderX: R,
1326
- borderY: V,
1312
+ inset: O,
1313
+ insetX: H,
1314
+ insetY: D,
1315
+ border: O,
1316
+ borderX: H,
1317
+ borderY: D,
1327
1318
  borderTop: J,
1328
1319
  borderRight: Q,
1329
1320
  borderBottom: ee,
1330
1321
  borderLeft: te,
1331
- borderRadius: Y,
1332
- borderRadiusX: R,
1333
- borderRadiusY: V,
1322
+ borderRadius: O,
1323
+ borderRadiusX: H,
1324
+ borderRadiusY: D,
1334
1325
  borderRadiusTop: J,
1335
1326
  borderRadiusRight: Q,
1336
1327
  borderRadiusBottom: ee,
1337
1328
  borderRadiusLeft: te,
1338
- borderRadiusTopLeft: It,
1339
- borderRadiusTopRight: Pt,
1340
- borderRadiusBottomRight: At,
1341
- borderRadiusBottomLeft: $t,
1342
- divideXWidth: R,
1343
- divideYWidth: V,
1344
- scale: Y,
1345
- scaleX: R,
1346
- scaleY: V,
1347
- skewX: R,
1348
- skewY: V,
1349
- translateX: R,
1350
- translateY: V,
1329
+ borderRadiusTopLeft: Pt,
1330
+ borderRadiusTopRight: $t,
1331
+ borderRadiusBottomRight: Et,
1332
+ borderRadiusBottomLeft: Mt,
1333
+ divideXWidth: H,
1334
+ divideYWidth: D,
1335
+ scale: O,
1336
+ scaleX: H,
1337
+ scaleY: D,
1338
+ skewX: H,
1339
+ skewY: D,
1340
+ translateX: H,
1341
+ translateY: D,
1351
1342
  // padding
1352
- padding: Y,
1353
- paddingX: R,
1354
- paddingY: V,
1343
+ padding: O,
1344
+ paddingX: H,
1345
+ paddingY: D,
1355
1346
  paddingTop: J,
1356
1347
  paddingRight: Q,
1357
1348
  paddingBottom: ee,
1358
1349
  paddingLeft: te,
1359
1350
  // margin
1360
- margin: Y,
1361
- marginX: R,
1362
- marginY: V,
1351
+ margin: O,
1352
+ marginX: H,
1353
+ marginY: D,
1363
1354
  marginTop: J,
1364
1355
  marginRight: Q,
1365
1356
  marginBottom: ee,
1366
1357
  marginLeft: te,
1367
1358
  // text-align
1368
- textLeft: Et,
1369
- textCenter: Mt,
1370
- textRight: Lt,
1371
- textJustify: Ot,
1359
+ textLeft: Lt,
1360
+ textCenter: Ot,
1361
+ textRight: zt,
1362
+ textJustify: Yt,
1372
1363
  // font style
1373
- italic: zt,
1364
+ italic: Ft,
1374
1365
  // "not-italic": "",
1375
1366
  // decoration
1376
- underline: Yt,
1377
- overline: Xt,
1367
+ underline: Xt,
1368
+ overline: Zt,
1378
1369
  // transform
1379
- uppercase: Ft,
1370
+ uppercase: Wt,
1380
1371
  block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1381
1372
  /* @__PURE__ */ e.jsx(
1382
1373
  "path",
@@ -1417,7 +1408,7 @@ const ns = ({ onAdd: r }) => {
1417
1408
  }
1418
1409
  )
1419
1410
  ] }),
1420
- "float-none": Ke,
1411
+ "float-none": Ge,
1421
1412
  // position
1422
1413
  fixed: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1423
1414
  /* @__PURE__ */ e.jsx(
@@ -1489,101 +1480,101 @@ const ns = ({ onAdd: r }) => {
1489
1480
  }
1490
1481
  )
1491
1482
  ] }),
1492
- static: Zt
1493
- }, le = Fe({ canReset: !1, canChange: !0 }), us = ({ children: r, canReset: o = !1, canChange: t = !0 }) => (
1483
+ static: Ut
1484
+ }, ae = Ze({ canReset: !1, canChange: !0 }), hs = ({ children: r, canReset: a = !1, canChange: t = !0 }) => (
1494
1485
  // eslint-disable-next-line react/jsx-no-constructed-context-values
1495
- /* @__PURE__ */ e.jsx(le.Provider, { value: { canReset: o, canChange: t }, children: r })
1496
- ), gt = ({ label: r, property: o, onChange: t }) => {
1497
- const a = T(() => y(ge, `${o}.classes`, [""]), [o]), l = ae(o), s = T(() => y(l, "cls", ""), [l]), { canChange: d } = se(le), c = /\[.*\]/g.test(s);
1498
- return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded" : "grow", children: c ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
1499
- /* @__PURE__ */ e.jsx(we, { className: "w-[70%] rounded py-1", readOnly: !0, value: s }),
1500
- /* @__PURE__ */ e.jsxs($, { delayDuration: 100, children: [
1501
- /* @__PURE__ */ e.jsx(E, { 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(Se, {}) }) }),
1502
- /* @__PURE__ */ e.jsx(M, { children: "Current value is using a Tailwind arbitrary value." })
1486
+ /* @__PURE__ */ e.jsx(ae.Provider, { value: { canReset: a, canChange: t }, children: r })
1487
+ ), yt = ({ label: r, property: a, onChange: t }) => {
1488
+ const l = R(() => g(ge, `${a}.classes`, [""]), [a]), o = ne(a), n = R(() => g(o, "cls", ""), [o]), { canChange: d } = se(ae), p = /\[.*\]/g.test(n);
1489
+ return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded" : "grow", children: p ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
1490
+ /* @__PURE__ */ e.jsx(ct, { className: "w-[70%] rounded py-1", readOnly: !0, value: n }),
1491
+ /* @__PURE__ */ e.jsxs(U, { delayDuration: 100, children: [
1492
+ /* @__PURE__ */ e.jsx(K, { 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(Ne, {}) }) }),
1493
+ /* @__PURE__ */ e.jsx(G, { children: "Current value is using a Tailwind arbitrary value." })
1503
1494
  ] })
1504
1495
  ] }) : /* @__PURE__ */ e.jsx(
1505
- ke,
1496
+ Ce,
1506
1497
  {
1507
1498
  rounded: r,
1508
- onChange: (n) => t(n, o),
1509
- selected: s,
1510
- options: a,
1499
+ onChange: (s) => t(s, a),
1500
+ selected: n,
1501
+ options: l,
1511
1502
  disabled: !d
1512
1503
  }
1513
1504
  ) });
1514
1505
  };
1515
- function ke({ selected: r, onChange: o, rounded: t = !1, options: a, disabled: l = !1 }) {
1516
- const s = r.replace(/.*:/g, "").trim(), { undo: d, redo: c } = kr();
1506
+ function Ce({ selected: r, onChange: a, rounded: t = !1, options: l, disabled: o = !1 }) {
1507
+ const n = r.replace(/.*:/g, "").trim(), { undo: d, redo: p } = Sr();
1517
1508
  return /* @__PURE__ */ e.jsxs(
1518
1509
  "select",
1519
1510
  {
1520
- disabled: !a.length || l,
1511
+ disabled: !l.length || o,
1521
1512
  className: `${t ? "rounded-md border border-border" : "border-0"} disable:bg-gray-500 h-full w-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,
1522
- onChange: (n) => o(n.target.value),
1523
- onKeyDown: (n) => {
1524
- n.ctrlKey && (n.key === "z" && d(), n.key === "y" && c());
1513
+ onChange: (s) => a(s.target.value),
1514
+ onKeyDown: (s) => {
1515
+ s.ctrlKey && (s.key === "z" && d(), s.key === "y" && p());
1525
1516
  },
1526
- value: s,
1517
+ value: n,
1527
1518
  children: [
1528
1519
  /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
1529
- P.Children.toArray(
1530
- a.map((n) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: n, children: n }))
1520
+ $.Children.toArray(
1521
+ l.map((s) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: s, children: s }))
1531
1522
  )
1532
1523
  ]
1533
1524
  }
1534
1525
  );
1535
1526
  }
1536
- const gs = ({ property: r, onChange: o }) => {
1537
- const { canReset: t, canChange: a } = se(le), l = ae(r), s = T(() => y(l, "cls", ""), [l]), d = T(() => y(ge, `${r}.classes`, [""]), [r]), c = d.indexOf(s) > -1 ? d.indexOf(s) : 0, n = /\[.*\]/g.test(s);
1538
- return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: n ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: s }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1527
+ const ms = ({ property: r, onChange: a }) => {
1528
+ const { canReset: t, canChange: l } = se(ae), o = ne(r), n = R(() => g(o, "cls", ""), [o]), d = R(() => g(ge, `${r}.classes`, [""]), [r]), p = d.indexOf(n) > -1 ? d.indexOf(n) : 0, s = /\[.*\]/g.test(n);
1529
+ return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: s ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: n }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1539
1530
  /* @__PURE__ */ e.jsx(
1540
1531
  "button",
1541
1532
  {
1542
1533
  type: "button",
1543
1534
  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",
1544
- disabled: !a && (!t || c - 1 < 0),
1545
- onClick: () => o(He(d, c - 1), r),
1535
+ disabled: !l && (!t || p - 1 < 0),
1536
+ onClick: () => a(Ve(d, p - 1), r),
1546
1537
  children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
1547
- Wt,
1538
+ Kt,
1548
1539
  {
1549
- className: !a && (!t || c - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1540
+ className: !l && (!t || p - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1550
1541
  }
1551
1542
  ) })
1552
1543
  }
1553
1544
  ),
1554
- /* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(gt, { label: !1, property: r, onChange: o }) }),
1545
+ /* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(yt, { label: !1, property: r, onChange: a }) }),
1555
1546
  /* @__PURE__ */ e.jsx(
1556
1547
  "button",
1557
1548
  {
1558
1549
  type: "button",
1559
1550
  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",
1560
- disabled: !a && (!t || c + 1 >= d.length),
1561
- onClick: () => o(He(d, c + 1), r),
1551
+ disabled: !l && (!t || p + 1 >= d.length),
1552
+ onClick: () => a(Ve(d, p + 1), r),
1562
1553
  children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
1563
- _e,
1554
+ Ke,
1564
1555
  {
1565
- className: !a && (!t || c + 1 >= d.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1556
+ className: !l && (!t || p + 1 >= d.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1566
1557
  }
1567
1558
  ) })
1568
1559
  }
1569
1560
  )
1570
1561
  ] }) });
1571
- }, xs = ({ property: r, onChange: o }) => {
1572
- const t = T(() => y(ge, `${r}.classes`, [""]), [r]), { canChange: a } = se(le), l = ae(r), s = T(() => y(l, "cls", ""), [l]);
1573
- return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: _(t, (d) => /* @__PURE__ */ e.jsxs($, { children: [
1574
- /* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1562
+ }, bs = ({ property: r, onChange: a }) => {
1563
+ const t = R(() => g(ge, `${r}.classes`, [""]), [r]), { canChange: l } = se(ae), o = ne(r), n = R(() => g(o, "cls", ""), [o]);
1564
+ return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: T(t, (d) => /* @__PURE__ */ e.jsxs(U, { children: [
1565
+ /* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1575
1566
  "button",
1576
1567
  {
1577
1568
  type: "button",
1578
- disabled: !a,
1579
- onClick: () => o(d, r),
1580
- className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${s === d ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
1581
- children: P.createElement(y(ut, d, Ge))
1569
+ disabled: !l,
1570
+ onClick: () => a(d, r),
1571
+ 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"}`,
1572
+ children: $.createElement(g(xt, d, qe))
1582
1573
  }
1583
1574
  ) }),
1584
- /* @__PURE__ */ e.jsx(M, { children: F(re(d)) })
1575
+ /* @__PURE__ */ e.jsx(G, { children: Y(re(d)) })
1585
1576
  ] })) });
1586
- }, ys = {
1577
+ }, fs = {
1587
1578
  backgroundColor: "bg",
1588
1579
  textColor: "text",
1589
1580
  borderColor: "border",
@@ -1595,39 +1586,39 @@ const gs = ({ property: r, onChange: o }) => {
1595
1586
  toColor: "to",
1596
1587
  ringColor: "ring",
1597
1588
  ringOffsetColor: "ring-offset"
1598
- }, hs = ({ property: r, onChange: o }) => {
1599
- const t = ae(r), a = T(() => y(t, "cls", ""), [t]), { canChange: l } = se(le), [s, d] = w([]), [c, n] = w({ color: "", shade: "" }), p = a.split("-"), h = y(p, "1", ""), i = y(p, "2", ""), u = H(
1589
+ }, vs = ({ property: r, onChange: a }) => {
1590
+ const t = ne(r), l = R(() => g(t, "cls", ""), [t]), { canChange: o } = se(ae), [n, d] = j([]), [p, s] = j({ color: "", shade: "" }), c = l.split("-"), u = g(c, "1", ""), i = g(c, "2", ""), h = B(
1600
1591
  // eslint-disable-next-line no-shadow
1601
- (g) => {
1602
- ["current", "inherit", "transparent", "black", "white"].includes(g) ? (d([]), n({ color: g })) : (d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), n((v) => ({ ...v, color: g, shade: v.shade ? v.shade : "500" })));
1592
+ (x) => {
1593
+ ["current", "inherit", "transparent", "black", "white"].includes(x) ? (d([]), s({ color: x })) : (d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), s((v) => ({ ...v, color: x, shade: v.shade ? v.shade : "500" })));
1603
1594
  },
1604
- [d, n]
1595
+ [d, s]
1605
1596
  );
1606
1597
  A(() => {
1607
- if (["current", "inherit", "transparent", "black", "white"].includes(h))
1598
+ if (["current", "inherit", "transparent", "black", "white"].includes(u))
1608
1599
  return d([]);
1609
1600
  d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
1610
- }, [h]);
1611
- const x = H(
1601
+ }, [u]);
1602
+ const y = B(
1612
1603
  // eslint-disable-next-line no-shadow
1613
- (g) => {
1614
- n({ color: h, shade: g });
1604
+ (x) => {
1605
+ s({ color: u, shade: x });
1615
1606
  },
1616
- [h]
1607
+ [u]
1617
1608
  );
1618
1609
  return A(() => {
1619
- n({ color: "", shade: "" });
1610
+ s({ color: "", shade: "" });
1620
1611
  }, [t]), A(() => {
1621
- const v = `${y(ys, r, "")}-${c.color}${c.shade ? `-${c.shade}` : ""}`;
1622
- v.match(new RegExp(y(ge, `${r}.regExp`, ""))) && o(v, r);
1623
- }, [c, o, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
1612
+ const v = `${g(fs, r, "")}-${p.color}${p.shade ? `-${p.shade}` : ""}`;
1613
+ v.match(new RegExp(g(ge, `${r}.regExp`, ""))) && a(v, r);
1614
+ }, [p, a, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
1624
1615
  /* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
1625
- ke,
1616
+ Ce,
1626
1617
  {
1627
- disabled: !l,
1618
+ disabled: !o,
1628
1619
  rounded: !0,
1629
- selected: h,
1630
- onChange: u,
1620
+ selected: u,
1621
+ onChange: h,
1631
1622
  options: [
1632
1623
  "current",
1633
1624
  "transparent",
@@ -1660,20 +1651,20 @@ const gs = ({ property: r, onChange: o }) => {
1660
1651
  ]
1661
1652
  }
1662
1653
  ) }),
1663
- /* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(ke, { rounded: !0, selected: i, disabled: !h || !l, onChange: x, options: s }) })
1654
+ /* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(Ce, { rounded: !0, selected: i, disabled: !u || !o, onChange: y, options: n }) })
1664
1655
  ] });
1665
- }, ze = (r, o) => {
1656
+ }, Ye = (r, a) => {
1666
1657
  r = r.toLowerCase();
1667
1658
  let t = r.trim().replace(/ |\+/g, "");
1668
- if ((t === "auto" || t === "none") && o.includes(t))
1659
+ if ((t === "auto" || t === "none") && a.includes(t))
1669
1660
  return { value: "", unit: t };
1670
- const a = o.length ? new RegExp(o.join("|"), "g") : /XXXXXX/g;
1671
- t = t.replace(a, "");
1672
- const l = r.match(a), s = l && l.length > 1, d = !m(t) && Number.isNaN(Number(t));
1673
- return s || d ? { error: "Invalid value" } : l && (l[0] === "auto" || l[0] === "none") ? { value: l[0], unit: "" } : { value: t, unit: l ? l[0] : "" };
1661
+ const l = a.length ? new RegExp(a.join("|"), "g") : /XXXXXX/g;
1662
+ t = t.replace(l, "");
1663
+ const o = r.match(l), n = o && o.length > 1, d = !b(t) && Number.isNaN(Number(t));
1664
+ return n || d ? { error: "Invalid value" } : o && (o[0] === "auto" || o[0] === "none") ? { value: o[0], unit: "" } : { value: t, unit: o ? o[0] : "" };
1674
1665
  };
1675
- const bs = (r) => {
1676
- const o = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
1666
+ const ws = (r) => {
1667
+ const a = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
1677
1668
  if (["auto", "none"].includes(t))
1678
1669
  return { value: "", unit: t };
1679
1670
  if (t === "px")
@@ -1682,26 +1673,26 @@ const bs = (r) => {
1682
1673
  return { value: "100", unit: r.indexOf("w-") !== -1 ? "vw" : "vh" };
1683
1674
  if (t === "full")
1684
1675
  return { value: "100", unit: "%" };
1685
- if (X(r, "skew-"))
1686
- return { value: `${o}${t}`, unit: "deg" };
1687
- if (X(r, "rotate-"))
1688
- return { value: `${o}${t}`, unit: "deg" };
1689
- if (X(r, "opacity-"))
1676
+ if (z(r, "skew-"))
1677
+ return { value: `${a}${t}`, unit: "deg" };
1678
+ if (z(r, "rotate-"))
1679
+ return { value: `${a}${t}`, unit: "deg" };
1680
+ if (z(r, "opacity-"))
1690
1681
  return { value: `${t / 100}`, unit: "-" };
1691
- if (X(r, "duration-") || X(r, "delay-"))
1682
+ if (z(r, "duration-") || z(r, "delay-"))
1692
1683
  return { value: `${t}`, unit: "ms" };
1693
- if (X(r, "translate-") && !t.includes("/"))
1694
- return { value: `${o}${`${t / 4}`}`, unit: "rem" };
1695
- if (X(r, "scale-"))
1696
- return { value: `${o}${`${t / 100}`}`, unit: "-" };
1697
- if (W(r, "border")) {
1698
- const a = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
1699
- if (a)
1700
- return { value: a[0].split("-").pop(), unit: "px" };
1684
+ if (z(r, "translate-") && !t.includes("/"))
1685
+ return { value: `${a}${`${t / 4}`}`, unit: "rem" };
1686
+ if (z(r, "scale-"))
1687
+ return { value: `${a}${`${t / 100}`}`, unit: "-" };
1688
+ if (q(r, "border")) {
1689
+ const l = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
1690
+ if (l)
1691
+ return { value: l[0].split("-").pop(), unit: "px" };
1701
1692
  if (r.match(/border-?(x|y|t|r|b|l)?/g))
1702
1693
  return { value: "1", unit: "px" };
1703
1694
  }
1704
- if (W(r, "max-w-")) {
1695
+ if (q(r, "max-w-")) {
1705
1696
  if (r === "max-w-screen-sm")
1706
1697
  return { value: "640", unit: "px" };
1707
1698
  if (r === "max-w-screen-md")
@@ -1737,7 +1728,7 @@ const bs = (r) => {
1737
1728
  if (t === "prose")
1738
1729
  return { value: "65", unit: "ch" };
1739
1730
  }
1740
- if (W(r, "text-")) {
1731
+ if (q(r, "text-")) {
1741
1732
  if (t === "xs")
1742
1733
  return { value: "12", unit: "px" };
1743
1734
  if (t === "sm")
@@ -1765,7 +1756,7 @@ const bs = (r) => {
1765
1756
  if (t === "9xl")
1766
1757
  return { value: "128", unit: "px" };
1767
1758
  }
1768
- if (W(r, "leading-")) {
1759
+ if (q(r, "leading-")) {
1769
1760
  if (t === "none")
1770
1761
  return { value: "1", unit: "-" };
1771
1762
  if (t === "tight")
@@ -1779,7 +1770,7 @@ const bs = (r) => {
1779
1770
  if (t === "loose")
1780
1771
  return { value: "2", unit: "-" };
1781
1772
  }
1782
- if (W(r, "tracking-")) {
1773
+ if (q(r, "tracking-")) {
1783
1774
  if (t === "tighter")
1784
1775
  return { value: "-0.05", unit: "em" };
1785
1776
  if (t === "tight")
@@ -1796,208 +1787,208 @@ const bs = (r) => {
1796
1787
  if (["max", "min", "fit"].includes(t))
1797
1788
  return { value: r, unit: "class" };
1798
1789
  if (t.includes("/")) {
1799
- const [a, l] = _(t.split("/"), (s) => parseInt(s, 10));
1800
- return { value: o + (a / l * 100).toFixed(2).replace(".00", ""), unit: "%" };
1790
+ const [l, o] = T(t.split("/"), (n) => parseInt(n, 10));
1791
+ return { value: a + (l / o * 100).toFixed(2).replace(".00", ""), unit: "%" };
1801
1792
  }
1802
- return St(parseFloat(t)) ? { value: `${o + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
1793
+ return Rt(parseFloat(t)) ? { value: `${a + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
1803
1794
  };
1804
- const ms = (r) => {
1805
- if (m(r))
1795
+ const js = (r) => {
1796
+ if (b(r))
1806
1797
  return { value: "", unit: "" };
1807
- const o = r.match(/\[.*\]/g);
1808
- if (o === null)
1809
- return fs(r);
1810
- const t = y(o, "0", "").replace(/\[|\]/g, ""), a = r.startsWith("-") ? "-" : "", l = oe(t.match(/\d+.\d+|\d+/g));
1811
- return { value: `${a}${l}`, unit: t.replace(l, "") };
1812
- }, fs = (r) => m(r) ? { value: "", unit: "" } : bs(r), xt = P.createContext({
1798
+ const a = r.match(/\[.*\]/g);
1799
+ if (a === null)
1800
+ return Cs(r);
1801
+ const t = g(a, "0", "").replace(/\[|\]/g, ""), l = r.startsWith("-") ? "-" : "", o = oe(t.match(/\d+.\d+|\d+/g));
1802
+ return { value: `${l}${o}`, unit: t.replace(o, "") };
1803
+ }, Cs = (r) => b(r) ? { value: "", unit: "" } : ws(r), ht = $.createContext({
1813
1804
  setDragData: () => {
1814
1805
  }
1815
- }), vs = ({
1806
+ }), ks = ({
1816
1807
  unit: r,
1817
- currentValue: o,
1808
+ currentValue: a,
1818
1809
  onDrag: t,
1819
- onDragEnd: a,
1820
- onDragStart: l,
1821
- negative: s,
1810
+ onDragEnd: l,
1811
+ onDragStart: o,
1812
+ negative: n,
1822
1813
  cssProperty: d
1823
1814
  }) => {
1824
- const { setDragData: c } = se(xt);
1815
+ const { setDragData: p } = se(ht);
1825
1816
  return /* @__PURE__ */ e.jsx(
1826
1817
  "button",
1827
1818
  {
1828
1819
  type: "button",
1829
- onMouseDown: (n) => {
1830
- const p = {
1820
+ onMouseDown: (s) => {
1821
+ const c = {
1831
1822
  onDrag: t,
1832
- onDragEnd: a,
1823
+ onDragEnd: l,
1833
1824
  dragging: !0,
1834
- dragStartY: n.pageY,
1835
- dragStartValue: `${o}`,
1825
+ dragStartY: s.pageY,
1826
+ dragStartValue: `${a}`,
1836
1827
  dragUnit: r,
1837
- negative: s,
1828
+ negative: n,
1838
1829
  cssProperty: d
1839
1830
  };
1840
- l(p), c(p);
1831
+ o(c), p(c);
1841
1832
  },
1842
1833
  color: void 0,
1843
1834
  className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
1844
- children: /* @__PURE__ */ e.jsx(Ut, {})
1835
+ children: /* @__PURE__ */ e.jsx(Gt, {})
1845
1836
  }
1846
1837
  );
1847
- }, ws = ({ onSelect: r, current: o, 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(
1848
- B,
1838
+ }, Ns = ({ onSelect: r, current: a, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((l) => /* @__PURE__ */ e.jsx(
1839
+ P,
1849
1840
  {
1850
1841
  className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
1851
- color: o === a ? "primary" : void 0,
1842
+ color: a === l ? "primary" : void 0,
1852
1843
  size: "sm",
1853
- onClick: (l) => {
1854
- l.stopPropagation(), r(a);
1844
+ onClick: (o) => {
1845
+ o.stopPropagation(), r(l);
1855
1846
  },
1856
- children: a
1847
+ children: l
1857
1848
  },
1858
- a
1859
- )) }), Ye = 50, js = (r) => {
1860
- const [o, t] = w(!1), [a, l] = w(""), { currentClass: s, onChange: d, classPrefix: c, cssProperty: n, units: p, negative: h } = r, [i, u] = w(n != null && n.toLowerCase().includes("width") ? "%" : p[0]), [x, g] = w(!1), [v, C] = w(""), [K, L] = w(!1), [G, q] = w(!1);
1849
+ l
1850
+ )) }), Fe = 50, _s = (r) => {
1851
+ const [a, t] = j(!1), [l, o] = j(""), { currentClass: n, onChange: d, classPrefix: p, cssProperty: s, units: c, negative: u } = r, [i, h] = j(s != null && s.toLowerCase().includes("width") ? "%" : c[0]), [y, x] = j(!1), [v, k] = j(""), [E, I] = j(!1), [Z, w] = j(!1);
1861
1852
  A(() => {
1862
- const { value: b, unit: f } = ms(s);
1853
+ const { value: m, unit: f } = js(n);
1863
1854
  if (f === "") {
1864
- l(b), u(n != null && n.toLowerCase().includes("width") ? "%" : oe(p));
1855
+ o(m), h(s != null && s.toLowerCase().includes("width") ? "%" : oe(c));
1865
1856
  return;
1866
1857
  }
1867
- u(f), l(f === "class" || m(b) ? "" : b);
1868
- }, [s, n, p]);
1869
- const S = de((b) => d(b), [d], Ye), j = de((b) => d(b, !1), [d], Ye), D = H(
1870
- (b = !1) => {
1871
- const f = ze(`${a}`, p);
1872
- if (y(f, "error", !1)) {
1873
- g(!0);
1858
+ h(f), o(f === "class" || b(m) ? "" : m);
1859
+ }, [n, s, c]);
1860
+ const N = ce((m) => d(m), [d], Fe), C = ce((m) => d(m, !1), [d], Fe), V = B(
1861
+ (m = !1) => {
1862
+ const f = Ye(`${l}`, c);
1863
+ if (g(f, "error", !1)) {
1864
+ x(!0);
1874
1865
  return;
1875
1866
  }
1876
- const N = y(f, "unit") !== "" ? y(f, "unit") : i;
1877
- if (N === "auto" || N === "none") {
1878
- S(`${c}${N}`);
1867
+ const S = g(f, "unit") !== "" ? g(f, "unit") : i;
1868
+ if (S === "auto" || S === "none") {
1869
+ N(`${p}${S}`);
1879
1870
  return;
1880
1871
  }
1881
- if (y(f, "value") === "")
1872
+ if (g(f, "value") === "")
1882
1873
  return;
1883
- const z = `${y(f, "value", "").startsWith("-") ? "-" : ""}${c}[${y(f, "value", "").replace("-", "")}${N === "-" ? "" : N}]`;
1884
- b ? j(z) : S(z);
1874
+ const L = `${g(f, "value", "").startsWith("-") ? "-" : ""}${p}[${g(f, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
1875
+ m ? C(L) : N(L);
1885
1876
  },
1886
- [S, j, a, i, c, p]
1887
- ), Z = H(
1888
- (b) => {
1889
- const f = ze(`${a}`, p);
1890
- if (y(f, "error", !1)) {
1891
- g(!0);
1877
+ [N, C, l, i, p, c]
1878
+ ), W = B(
1879
+ (m) => {
1880
+ const f = Ye(`${l}`, c);
1881
+ if (g(f, "error", !1)) {
1882
+ x(!0);
1892
1883
  return;
1893
1884
  }
1894
- if (b === "auto" || b === "none") {
1895
- S(`${c}${b}`);
1885
+ if (m === "auto" || m === "none") {
1886
+ N(`${p}${m}`);
1896
1887
  return;
1897
1888
  }
1898
- if (y(f, "value") === "")
1889
+ if (g(f, "value") === "")
1899
1890
  return;
1900
- const N = y(f, "unit") !== "" ? y(f, "unit") : b, z = `${y(f, "value", "").startsWith("-") ? "-" : ""}${c}[${y(f, "value", "").replace("-", "")}${N === "-" ? "" : N}]`;
1901
- S(z);
1891
+ const S = g(f, "unit") !== "" ? g(f, "unit") : m, L = `${g(f, "value", "").startsWith("-") ? "-" : ""}${p}[${g(f, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
1892
+ N(L);
1902
1893
  },
1903
- [S, a, c, p]
1894
+ [N, l, p, c]
1904
1895
  );
1905
1896
  return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: i === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1906
- /* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: s }),
1907
- /* @__PURE__ */ e.jsxs($, { children: [
1908
- /* @__PURE__ */ e.jsx(E, { 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(Se, {}) }) }),
1909
- /* @__PURE__ */ e.jsx(M, { children: "Current value is using a Tailwind preset class." })
1897
+ /* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: n }),
1898
+ /* @__PURE__ */ e.jsxs(U, { children: [
1899
+ /* @__PURE__ */ e.jsx(K, { 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(Ne, {}) }) }),
1900
+ /* @__PURE__ */ e.jsx(G, { children: "Current value is using a Tailwind preset class." })
1910
1901
  ] })
1911
- ] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${K ? "z-auto" : ""}`, children: [
1902
+ ] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${E ? "z-auto" : ""}`, children: [
1912
1903
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
1913
1904
  ["none", "auto"].indexOf(i) !== -1 ? null : /* @__PURE__ */ e.jsx(
1914
1905
  "input",
1915
1906
  {
1916
1907
  readOnly: i === "class",
1917
- onKeyPress: (b) => {
1918
- b.key === "Enter" && D();
1908
+ onKeyPress: (m) => {
1909
+ m.key === "Enter" && V();
1919
1910
  },
1920
- onKeyDown: (b) => {
1921
- if (b.keyCode !== 38 && b.keyCode !== 40)
1911
+ onKeyDown: (m) => {
1912
+ if (m.keyCode !== 38 && m.keyCode !== 40)
1922
1913
  return;
1923
- b.preventDefault(), q(!0);
1924
- const f = Tt(b.target.value);
1925
- let N = Ue(f) ? 0 : f;
1926
- b.keyCode === 38 && (N += 1), b.keyCode === 40 && (N -= 1);
1927
- const O = `${N}`, ht = `${O.startsWith("-") ? "-" : ""}${c}[${O.replace("-", "")}${i === "-" ? "" : i}]`;
1928
- j(ht);
1914
+ m.preventDefault(), w(!0);
1915
+ const f = Vt(m.target.value);
1916
+ let S = Ue(f) ? 0 : f;
1917
+ m.keyCode === 38 && (S += 1), m.keyCode === 40 && (S -= 1);
1918
+ const M = `${S}`, bt = `${M.startsWith("-") ? "-" : ""}${p}[${M.replace("-", "")}${i === "-" ? "" : i}]`;
1919
+ C(bt);
1929
1920
  },
1930
- onKeyUp: (b) => {
1931
- G && (b.preventDefault(), q(!1));
1921
+ onKeyUp: (m) => {
1922
+ Z && (m.preventDefault(), w(!1));
1932
1923
  },
1933
- onBlur: () => D(),
1934
- onChange: (b) => {
1935
- g(!1), l(b.target.value);
1924
+ onBlur: () => V(),
1925
+ onChange: (m) => {
1926
+ x(!1), o(m.target.value);
1936
1927
  },
1937
- onClick: (b) => {
1928
+ onClick: (m) => {
1938
1929
  var f;
1939
- (f = b == null ? void 0 : b.target) == null || f.select(), t(!1);
1930
+ (f = m == null ? void 0 : m.target) == null || f.select(), t(!1);
1940
1931
  },
1941
- value: K ? v : a,
1932
+ value: E ? v : l,
1942
1933
  className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
1943
1934
  " ",
1944
- x ? "border-red-500 text-red-500" : "border-foreground/20"
1935
+ y ? "border-red-500 text-red-500" : "border-foreground/20"
1945
1936
  )
1946
1937
  }
1947
1938
  ),
1948
- /* @__PURE__ */ e.jsxs($, { open: o, delayDuration: 100, children: [
1949
- /* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1939
+ /* @__PURE__ */ e.jsxs(U, { open: a, delayDuration: 100, children: [
1940
+ /* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1950
1941
  "button",
1951
1942
  {
1952
1943
  type: "button",
1953
- onClick: () => t(!o),
1944
+ onClick: () => t(!a),
1954
1945
  className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
1955
1946
  children: [
1956
- /* @__PURE__ */ e.jsx("span", { className: `inline-block ${p.length === 1 ? "px-2 font-semibold" : ""}`, children: i }),
1957
- p.length > 1 ? /* @__PURE__ */ e.jsx(Kt, {}) : null
1947
+ /* @__PURE__ */ e.jsx("span", { className: `inline-block ${c.length === 1 ? "px-2 font-semibold" : ""}`, children: i }),
1948
+ c.length > 1 ? /* @__PURE__ */ e.jsx(qt, {}) : null
1958
1949
  ]
1959
1950
  }
1960
1951
  ) }),
1961
- /* @__PURE__ */ e.jsx(Nr, { children: /* @__PURE__ */ e.jsx(M, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
1962
- ws,
1952
+ /* @__PURE__ */ e.jsx(Tr, { children: /* @__PURE__ */ e.jsx(G, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
1953
+ Ns,
1963
1954
  {
1964
- units: p,
1955
+ units: c,
1965
1956
  current: i,
1966
- onSelect: (b) => {
1967
- t(!1), u(b), Z(b);
1957
+ onSelect: (m) => {
1958
+ t(!1), h(m), W(m);
1968
1959
  }
1969
1960
  }
1970
1961
  ) }) })
1971
1962
  ] })
1972
1963
  ] }),
1973
- ["none", "auto"].indexOf(i) !== -1 || K ? null : /* @__PURE__ */ e.jsx(
1974
- vs,
1964
+ ["none", "auto"].indexOf(i) !== -1 || E ? null : /* @__PURE__ */ e.jsx(
1965
+ ks,
1975
1966
  {
1976
- onDragStart: () => L(!0),
1977
- onDragEnd: (b) => {
1978
- if (C(() => ""), L(!1), m(b))
1967
+ onDragStart: () => I(!0),
1968
+ onDragEnd: (m) => {
1969
+ if (k(() => ""), I(!1), b(m))
1979
1970
  return;
1980
- const f = `${b}`, O = `${f.startsWith("-") ? "-" : ""}${c}[${f.replace("-", "")}${i === "-" ? "" : i}]`;
1981
- S(O);
1971
+ const f = `${m}`, M = `${f.startsWith("-") ? "-" : ""}${p}[${f.replace("-", "")}${i === "-" ? "" : i}]`;
1972
+ N(M);
1982
1973
  },
1983
- onDrag: (b) => {
1984
- if (m(b))
1974
+ onDrag: (m) => {
1975
+ if (b(m))
1985
1976
  return;
1986
- C(b);
1987
- const f = `${b}`, O = `${f.startsWith("-") ? "-" : ""}${c}[${f.replace("-", "")}${i === "-" ? "" : i}]`;
1988
- j(O);
1977
+ k(m);
1978
+ const f = `${m}`, M = `${f.startsWith("-") ? "-" : ""}${p}[${f.replace("-", "")}${i === "-" ? "" : i}]`;
1979
+ C(M);
1989
1980
  },
1990
- currentValue: a,
1981
+ currentValue: l,
1991
1982
  unit: i,
1992
- negative: h,
1993
- cssProperty: n
1983
+ negative: u,
1984
+ cssProperty: s
1994
1985
  }
1995
1986
  )
1996
1987
  ] }) }) });
1997
- }, ae = (r) => {
1998
- const o = ue();
1999
- return Rt(o, { property: r });
2000
- }, Cs = (r, o) => {
1988
+ }, ne = (r) => {
1989
+ const a = ue();
1990
+ return Ht(a, { property: r });
1991
+ }, Ss = (r, a) => {
2001
1992
  const t = {
2002
1993
  xs: 0,
2003
1994
  sm: 1,
@@ -2006,8 +1997,8 @@ const ms = (r) => {
2006
1997
  xl: 4,
2007
1998
  "2xl": 5
2008
1999
  };
2009
- return t[y(r, "mq", "xs")] <= t[o];
2010
- }, ks = {
2000
+ return t[g(r, "mq", "xs")] <= t[a];
2001
+ }, Ts = {
2011
2002
  width: "w-",
2012
2003
  height: "h-",
2013
2004
  minWidth: "min-w-",
@@ -2080,80 +2071,80 @@ const ms = (r) => {
2080
2071
  lg: "1024px",
2081
2072
  xl: "1280px",
2082
2073
  "2xl": "1536px"
2083
- }, Ns = (r) => `${r.toUpperCase()} ${Xe[r] ? `(${Xe[r]} & up)` : ""}`, Ve = (r) => {
2084
- const { t: o } = I(), { type: t = "icons", label: a, property: l, onEmitChange: s = () => {
2085
- }, units: d, negative: c = !1 } = r, [n] = _r(), [p] = Sr(), [, h] = Ie(), i = ae(l), u = Te(), x = at(), [g] = nt(), v = T(() => y(i, "fullCls", ""), [i]), C = H(
2086
- (j, D = !0) => {
2087
- const Z = { dark: n, mq: h, mod: p, cls: j, property: l, fullCls: "" };
2088
- (n || p !== "") && (Z.mq = "xs");
2089
- const b = Gr(Z);
2090
- u(g, [b], D);
2074
+ }, Rs = (r) => `${r.toUpperCase()} ${Xe[r] ? `(${Xe[r]} & up)` : ""}`, Te = (r) => {
2075
+ const { t: a } = F(), { type: t = "icons", label: l, property: o, onEmitChange: n = () => {
2076
+ }, units: d, negative: p = !1 } = r, [s] = Rr(), [c] = Vr(), [, u] = Ie(), i = ne(o), h = _e(), y = it(), [x] = dt(), v = R(() => g(i, "fullCls", ""), [i]), k = B(
2077
+ (C, V = !0) => {
2078
+ const W = { dark: s, mq: u, mod: c, cls: C, property: o, fullCls: "" };
2079
+ (s || c !== "") && (W.mq = "xs");
2080
+ const m = Qr(W);
2081
+ h(x, [m], V);
2091
2082
  },
2092
- [g, n, h, p, l, u]
2093
- ), K = H(() => {
2094
- x(g, [v]);
2095
- }, [g, v, x]), L = T(() => Cs(i, h), [i, h]);
2083
+ [x, s, u, c, o, h]
2084
+ ), E = B(() => {
2085
+ y(x, [v]);
2086
+ }, [x, v, y]), I = R(() => Ss(i, u), [i, u]);
2096
2087
  A(() => {
2097
- s(L, i);
2098
- }, [L, s, i]);
2099
- const [, , G] = Ie(), q = H(
2100
- (j) => {
2101
- G({
2088
+ n(I, i);
2089
+ }, [I, n, i]);
2090
+ const [, , Z] = Ie(), w = B(
2091
+ (C) => {
2092
+ Z({
2102
2093
  xs: 400,
2103
2094
  sm: 640,
2104
2095
  md: 800,
2105
2096
  lg: 1024,
2106
2097
  xl: 1420,
2107
2098
  "2xl": 1920
2108
- }[j]);
2099
+ }[C]);
2109
2100
  },
2110
- [G]
2111
- ), S = y(i, "dark", null) === n && y(i, "mod", null) === p && y(i, "mq", null) === h;
2112
- return /* @__PURE__ */ e.jsx(us, { canChange: L, canReset: i && S, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
2113
- /* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${i && !S ? "text-foreground" : ""}`, children: o(a) }) }),
2101
+ [Z]
2102
+ ), N = g(i, "dark", null) === s && g(i, "mod", null) === c && g(i, "mq", null) === u;
2103
+ return /* @__PURE__ */ e.jsx(hs, { canChange: I, canReset: i && N, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
2104
+ /* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${i && !N ? "text-foreground" : ""}`, children: a(l) }) }),
2114
2105
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
2115
2106
  /* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
2116
2107
  t === "arbitrary" ? /* @__PURE__ */ e.jsx(
2117
- js,
2108
+ _s,
2118
2109
  {
2119
- currentClass: y(i, "cls", ""),
2120
- classPrefix: y(ks, l, ""),
2110
+ currentClass: g(i, "cls", ""),
2111
+ classPrefix: g(Ts, o, ""),
2121
2112
  units: d || [],
2122
- onChange: C,
2123
- negative: c,
2124
- cssProperty: l
2113
+ onChange: k,
2114
+ negative: p,
2115
+ cssProperty: o
2125
2116
  }
2126
2117
  ) : null,
2127
- t === "icons" && /* @__PURE__ */ e.jsx(xs, { property: l, onChange: C }),
2128
- t === "range" && /* @__PURE__ */ e.jsx(gs, { property: l, onChange: C }),
2129
- t === "color" && /* @__PURE__ */ e.jsx(hs, { property: l, onChange: C }),
2130
- t === "dropdown" && /* @__PURE__ */ e.jsx(gt, { label: a, property: l, onChange: C })
2118
+ t === "icons" && /* @__PURE__ */ e.jsx(bs, { property: o, onChange: k }),
2119
+ t === "range" && /* @__PURE__ */ e.jsx(ms, { property: o, onChange: k }),
2120
+ t === "color" && /* @__PURE__ */ e.jsx(vs, { property: o, onChange: k }),
2121
+ t === "dropdown" && /* @__PURE__ */ e.jsx(yt, { label: l, property: o, onChange: k })
2131
2122
  ] }),
2132
- /* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${v ? "visible" : "invisible"}`, children: S ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => K(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Gt, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : L && i ? /* @__PURE__ */ e.jsxs($, { delayDuration: 100, children: [
2133
- /* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2123
+ /* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${v ? "visible" : "invisible"}`, children: N ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => E(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Jt, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : I && i ? /* @__PURE__ */ e.jsxs(U, { delayDuration: 100, children: [
2124
+ /* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2134
2125
  "button",
2135
2126
  {
2136
2127
  type: "button",
2137
2128
  className: "invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",
2138
- children: /* @__PURE__ */ e.jsx(Se, {})
2129
+ children: /* @__PURE__ */ e.jsx(Ne, {})
2139
2130
  }
2140
2131
  ) }),
2141
- /* @__PURE__ */ e.jsx(M, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
2132
+ /* @__PURE__ */ e.jsx(G, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
2142
2133
  "Current style is set at  ",
2143
2134
  /* @__PURE__ */ e.jsxs("span", { className: "font-bold", children: [
2144
- Ns(y(i, "mq")),
2145
- n && !i.dark ? "(Light mode)" : ""
2135
+ Rs(g(i, "mq")),
2136
+ s && !i.dark ? "(Light mode)" : ""
2146
2137
  ] }),
2147
2138
  /* @__PURE__ */ e.jsx("br", {}),
2148
2139
  /* @__PURE__ */ e.jsxs(
2149
2140
  "button",
2150
2141
  {
2151
2142
  type: "button",
2152
- onClick: () => q(y(i, "mq")),
2143
+ onClick: () => w(g(i, "mq")),
2153
2144
  className: "block w-full cursor-default text-right font-semibold text-blue-500",
2154
2145
  children: [
2155
2146
  "Switch to ",
2156
- y(i, "mq").toUpperCase()
2147
+ g(i, "mq").toUpperCase()
2157
2148
  ]
2158
2149
  }
2159
2150
  )
@@ -2161,148 +2152,154 @@ const ms = (r) => {
2161
2152
  ] }) : null })
2162
2153
  ] })
2163
2154
  ] }) });
2164
- }, _s = ["px", "%", "em", "rem", "ch", "vh", "vw"], yt = ({
2155
+ }, Vs = ["px", "%", "em", "rem", "ch", "vh", "vw"], mt = ({
2165
2156
  label: r,
2166
- options: o,
2157
+ options: a,
2167
2158
  borderB: t = !1,
2168
- borderT: a = !1,
2169
- type: l = "arbitrary",
2170
- units: s = _s,
2159
+ borderT: l = !1,
2160
+ type: o = "arbitrary",
2161
+ units: n = Vs,
2171
2162
  negative: d = !1
2172
2163
  }) => {
2173
- const { t: c } = I(), [n, p] = w(o[0].key), h = ue(), i = H((u) => _(h, "property").includes(u), [h]);
2164
+ const { t: p } = F(), [s, c] = j(a[0].key), u = ue(), i = B((h) => T(u, "property").includes(h), [u]);
2174
2165
  return /* @__PURE__ */ e.jsxs(
2175
2166
  "div",
2176
2167
  {
2177
- className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${a ? "border-t" : ""}`,
2168
+ className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${l ? "border-t" : ""}`,
2178
2169
  children: [
2179
2170
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
2180
- r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: c(r) }),
2181
- /* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: P.Children.toArray(
2182
- o.map(({ label: u, key: x }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs($, { children: [
2183
- /* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
2171
+ r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: p(r) }),
2172
+ /* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: $.Children.toArray(
2173
+ a.map(({ label: h, key: y }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(U, { children: [
2174
+ /* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
2184
2175
  "button",
2185
2176
  {
2186
2177
  type: "button",
2187
- onClick: () => p(x),
2188
- className: `relative cursor-pointer rounded-full p-1 text-[8px] ${x === n ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
2178
+ onClick: () => c(y),
2179
+ className: `relative cursor-pointer rounded-full p-1 text-[8px] ${y === s ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
2189
2180
  children: [
2190
- P.createElement("div", {
2191
- className: i(x) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
2181
+ $.createElement("div", {
2182
+ className: i(y) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
2192
2183
  }),
2193
- P.createElement(y(ut, x, Ge), { className: "text-inherit w-3 h-3" })
2184
+ $.createElement(g(xt, y, qe), { className: "text-inherit w-3 h-3" })
2194
2185
  ]
2195
2186
  }
2196
2187
  ) }),
2197
- /* @__PURE__ */ e.jsx(M, { children: F(re(u)) })
2188
+ /* @__PURE__ */ e.jsx(G, { children: Y(re(h)) })
2198
2189
  ] }) }))
2199
2190
  ) })
2200
2191
  ] }),
2201
2192
  /* @__PURE__ */ e.jsx("div", { className: "mt-0 flex items-center", children: /* @__PURE__ */ e.jsx(
2202
- Ve,
2193
+ Te,
2203
2194
  {
2204
- type: l,
2205
- units: [...s],
2195
+ type: o,
2196
+ units: [...n],
2206
2197
  label: "",
2207
- property: n,
2198
+ property: s,
2208
2199
  negative: d
2209
2200
  }
2210
2201
  ) })
2211
2202
  ]
2212
2203
  }
2213
2204
  );
2214
- }, Ss = ({ heading: r, items: o }) => {
2215
- const { t } = I(), a = ue(), l = T(() => {
2216
- const s = (n) => De(
2217
- n.map((p) => p.styleType === "multiple" ? _(p.options, "key") : p.property)
2218
- ), d = De(
2219
- o.map((n) => n.styleType === "accordion" ? s(n.items) : n.styleType === "multiple" ? _(n.options, "key") : n.property)
2220
- ), c = _(a, "property");
2221
- return Vt(d, c).length > 0;
2222
- }, [a, o]);
2205
+ }, Hs = ({ heading: r, items: a }) => {
2206
+ const { t } = F(), l = ue(), o = R(() => {
2207
+ const n = (s) => He(
2208
+ s.map((c) => c.styleType === "multiple" ? T(c.options, "key") : c.property)
2209
+ ), d = He(
2210
+ a.map((s) => s.styleType === "accordion" ? n(s.items) : s.styleType === "multiple" ? T(s.options, "key") : s.property)
2211
+ ), p = T(l, "property");
2212
+ return Dt(d, p).length > 0;
2213
+ }, [l, a]);
2223
2214
  return /* @__PURE__ */ e.jsxs("details", { children: [
2224
2215
  /* @__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: [
2225
2216
  t(r),
2226
- l ? /* @__PURE__ */ e.jsx(
2217
+ o ? /* @__PURE__ */ e.jsx(
2227
2218
  "span",
2228
2219
  {
2229
- className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}`
2220
+ className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${o ? "bg-blue-500" : "bg-gray-300"}`
2230
2221
  }
2231
2222
  ) : null
2232
2223
  ] }) }),
2233
- /* @__PURE__ */ e.jsx("div", { className: "p-2", children: o.map((s) => s.styleType === "multiple" ? /* @__PURE__ */ e.jsx(yt, { ...s }, s.label) : /* @__PURE__ */ e.jsx(Ve, { ...s }, s.label)) })
2224
+ /* @__PURE__ */ e.jsx("div", { className: "p-2", children: a.map((n) => n.styleType === "multiple" ? /* @__PURE__ */ e.jsx(mt, { ...n }, n.label) : /* @__PURE__ */ e.jsx(Te, { ...n }, n.label)) })
2234
2225
  ] });
2235
- }, Ts = Fe({}), xe = ({ section: r }) => {
2236
- const { t: o } = I(), t = ue(), a = H(
2226
+ }, Ds = Ze({}), xe = ({ section: r }) => {
2227
+ const { t: a } = F(), t = ue(), l = X(), o = B(
2237
2228
  (s = []) => {
2238
- const d = {};
2239
- for (let n = 0; n < t.length; n++)
2240
- d[t[n].property] = t[n].cls;
2241
- let c = !0;
2242
- for (const n in s)
2243
- if (!ie(d, n) || d[n] !== s[n]) {
2244
- c = !1;
2229
+ const c = {};
2230
+ for (let i = 0; i < t.length; i++)
2231
+ c[t[i].property] = t[i].cls;
2232
+ let u = !0;
2233
+ for (const i in s)
2234
+ if (!de(c, i) || c[i] !== s[i]) {
2235
+ u = !1;
2245
2236
  break;
2246
2237
  }
2247
- return c;
2238
+ return u;
2248
2239
  },
2249
2240
  [t]
2250
- ), l = T(() => ({}), []);
2251
- return /* @__PURE__ */ e.jsx(Ts.Provider, { value: l, children: /* @__PURE__ */ e.jsxs(me, { value: r.heading, children: [
2252
- /* @__PURE__ */ e.jsx(fe, { className: "bg-gray-200 px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-2", children: o(r.heading) }) }),
2253
- /* @__PURE__ */ e.jsx(ve, { className: "bg-gray-100 px-3.5 py-2", children: P.Children.toArray(
2254
- r.items.map((s) => ie(s, "component") ? P.createElement(s.component, { key: s.label }) : ie(s, "styleType") ? s.styleType === "multiple" ? /* @__PURE__ */ e.jsx(yt, { ...s }, s.label) : s.styleType === "accordion" && a(s == null ? void 0 : s.conditions) ? /* @__PURE__ */ e.jsx(Ss, { ...s }, s.label) : null : /* @__PURE__ */ e.jsx(Ve, { ...s }, s.label))
2241
+ ), n = R(() => ({}), []), [d] = le(), p = R(() => {
2242
+ const s = `${Le(d, "0.prop")}_attrs`;
2243
+ return !ts(Le(l, s, {}));
2244
+ }, [d]);
2245
+ return /* @__PURE__ */ e.jsx(Ds.Provider, { value: n, children: /* @__PURE__ */ e.jsxs(be, { value: r.heading, children: [
2246
+ /* @__PURE__ */ e.jsx(fe, { className: "border-b border-gray-300 bg-gray-200 px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
2247
+ r.heading === "Attributes" && p ? /* @__PURE__ */ e.jsx("span", { className: "mr-2 inline-block h-[8px] w-[8px] rounded-full bg-blue-600" }) : null,
2248
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-2", children: a(r.heading) })
2249
+ ] }) }),
2250
+ /* @__PURE__ */ e.jsx(ve, { className: "bg-gray-100 px-3.5 py-2", children: $.Children.toArray(
2251
+ r.items.map((s) => de(s, "component") ? $.createElement(s.component, { key: s.label }) : de(s, "styleType") ? s.styleType === "multiple" ? /* @__PURE__ */ e.jsx(mt, { ...s }, s.label) : s.styleType === "accordion" && o(s == null ? void 0 : s.conditions) ? /* @__PURE__ */ e.jsx(Hs, { ...s }, s.label) : null : /* @__PURE__ */ e.jsx(Te, { ...s }, s.label))
2255
2252
  ) })
2256
2253
  ] }) });
2257
- }, Rs = () => {
2258
- const r = U(), [o] = pe(), { t } = I(), a = Mr(), l = Te(), s = Re(r._type), d = y(oe(o), "prop"), c = y(s.props, `${d}.presets`, {});
2259
- if (m(a) && (!ie(s, "props") || m(c)))
2254
+ }, Bs = () => {
2255
+ const r = X(), [a] = le(), { t } = F(), l = Yr(), o = _e(), n = Se(r._type), d = g(oe(a), "prop"), p = g(n.props, `${d}.presets`, {});
2256
+ if (b(l) && (!de(n, "props") || b(p)))
2260
2257
  return null;
2261
- const n = (p) => {
2262
- const h = p.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
2263
- l([r._id], h, !0);
2258
+ const s = (c) => {
2259
+ const u = c.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
2260
+ o([r._id], u, !0);
2264
2261
  };
2265
- return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(Tr, { children: [
2266
- /* @__PURE__ */ e.jsx(Rr, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: /* @__PURE__ */ e.jsxs(B, { variant: "default", className: "w-full", size: "sm", children: [
2262
+ return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(Hr, { children: [
2263
+ /* @__PURE__ */ e.jsx(Dr, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: /* @__PURE__ */ e.jsxs(P, { variant: "default", className: "w-full", size: "sm", children: [
2267
2264
  t("Apply Presets"),
2268
- /* @__PURE__ */ e.jsx(qt, {})
2265
+ /* @__PURE__ */ e.jsx(Qt, {})
2269
2266
  ] }) }) }),
2270
- /* @__PURE__ */ e.jsx(Vr, { className: "max-h-80 w-56", children: /* @__PURE__ */ e.jsxs(dt, { className: "no-scrollbar h-full", children: [
2271
- m(c) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2272
- /* @__PURE__ */ e.jsxs(Pe, { children: [
2273
- s.type,
2267
+ /* @__PURE__ */ e.jsx(Br, { className: "max-h-80 w-56", children: /* @__PURE__ */ e.jsxs(pt, { className: "no-scrollbar h-full", children: [
2268
+ b(p) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2269
+ /* @__PURE__ */ e.jsxs(Ae, { children: [
2270
+ n.type,
2274
2271
  " ",
2275
2272
  t("presets")
2276
2273
  ] }),
2277
- /* @__PURE__ */ e.jsx(Ae, {}),
2278
- /* @__PURE__ */ e.jsx($e, { children: he(c).map((p) => /* @__PURE__ */ e.jsxs(Ee, { className: "group text-xs", onClick: () => n(c[p]), children: [
2279
- be(F(t(p))),
2274
+ /* @__PURE__ */ e.jsx(Pe, {}),
2275
+ /* @__PURE__ */ e.jsx($e, { children: he(p).map((c) => /* @__PURE__ */ e.jsxs(Ee, { className: "group text-xs", onClick: () => s(p[c]), children: [
2276
+ me(Y(t(c))),
2280
2277
  /* @__PURE__ */ e.jsx(Me, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
2281
2278
  ] })) })
2282
2279
  ] }),
2283
- m(a) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2284
- /* @__PURE__ */ e.jsx(Pe, { children: t("Global presets") }),
2285
- /* @__PURE__ */ e.jsx(Ae, {}),
2286
- /* @__PURE__ */ e.jsx($e, { children: he(a).map((p) => /* @__PURE__ */ e.jsxs(Ee, { className: "group text-xs", onClick: () => n(a[p]), children: [
2287
- be(F(t(p))),
2280
+ b(l) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2281
+ /* @__PURE__ */ e.jsx(Ae, { children: t("Global presets") }),
2282
+ /* @__PURE__ */ e.jsx(Pe, {}),
2283
+ /* @__PURE__ */ e.jsx($e, { children: he(l).map((c) => /* @__PURE__ */ e.jsxs(Ee, { className: "group text-xs", onClick: () => s(l[c]), children: [
2284
+ me(Y(t(c))),
2288
2285
  /* @__PURE__ */ e.jsx(Me, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
2289
2286
  ] })) })
2290
2287
  ] })
2291
2288
  ] }) })
2292
2289
  ] }) });
2293
2290
  };
2294
- function Vs() {
2295
- const { flexChild: r, gridChild: o } = Hr(), [t] = pe();
2296
- return m(t) ? null : /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col", children: [
2297
- /* @__PURE__ */ e.jsx(Rs, {}),
2298
- /* @__PURE__ */ e.jsxs(lt, { defaultValue: ["Styles"], type: "multiple", className: "w-full", children: [
2299
- r && /* @__PURE__ */ e.jsx(xe, { section: ds }),
2300
- o ? /* @__PURE__ */ e.jsx(xe, { section: cs }) : null,
2301
- ps.map((a) => /* @__PURE__ */ e.jsx(xe, { section: a }, a.heading))
2291
+ function Is() {
2292
+ const { flexChild: r, gridChild: a } = Ir(), [t] = le();
2293
+ return b(t) ? null : /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col", children: [
2294
+ /* @__PURE__ */ e.jsx(Bs, {}),
2295
+ /* @__PURE__ */ e.jsxs(at, { defaultValue: ["Styles"], type: "multiple", className: "w-full", children: [
2296
+ r && /* @__PURE__ */ e.jsx(xe, { section: gs }),
2297
+ a ? /* @__PURE__ */ e.jsx(xe, { section: xs }) : null,
2298
+ ys.map((l) => /* @__PURE__ */ e.jsx(xe, { section: l }, l.heading))
2302
2299
  ] })
2303
2300
  ] });
2304
2301
  }
2305
- const Hs = {
2302
+ const As = {
2306
2303
  px: 1,
2307
2304
  "%": 1,
2308
2305
  em: 100,
@@ -2313,32 +2310,32 @@ const Hs = {
2313
2310
  "-": 1,
2314
2311
  deg: 1,
2315
2312
  ms: 0.1
2316
- }, Ho = () => {
2317
- const r = U(), { t: o } = I(), [t, a] = P.useState(""), [l, s] = P.useState({
2318
- onDrag: (n) => n,
2319
- onDragEnd: (n) => n,
2313
+ }, Po = () => {
2314
+ const r = X(), { t: a } = F(), [t, l] = $.useState(""), [o, n] = $.useState({
2315
+ onDrag: (s) => s,
2316
+ onDragEnd: (s) => s,
2320
2317
  dragStartY: 0,
2321
2318
  dragging: !1,
2322
2319
  dragStartValue: 0,
2323
2320
  dragUnit: "",
2324
2321
  negative: !1,
2325
2322
  cssProperty: ""
2326
- }), d = de(
2327
- (n) => {
2328
- const p = !y(l, "negative", !1), h = y(l, "cssProperty", "");
2329
- let i = parseFloat(l.dragStartValue);
2323
+ }), d = ce(
2324
+ (s) => {
2325
+ const c = !g(o, "negative", !1), u = g(o, "cssProperty", "");
2326
+ let i = parseFloat(o.dragStartValue);
2330
2327
  i = Ue(i) ? 0 : i;
2331
- let u = Hs[l.dragUnit];
2332
- (W(h, "scale") || h === "opacity") && (u = 10);
2333
- let g = (l.dragStartY - n.pageY) / u + i;
2334
- p && g < 0 && (g = 0), h === "opacity" && g > 1 && (g = 1), l.onDrag(`${g}`), a(`${g}`);
2328
+ let h = As[o.dragUnit];
2329
+ (q(u, "scale") || u === "opacity") && (h = 10);
2330
+ let x = (o.dragStartY - s.pageY) / h + i;
2331
+ c && x < 0 && (x = 0), u === "opacity" && x > 1 && (x = 1), o.onDrag(`${x}`), l(`${x}`);
2335
2332
  },
2336
- [l],
2333
+ [o],
2337
2334
  50
2338
- ), c = H(() => {
2339
- setTimeout(() => l.onDragEnd(`${t}`), 100), s({
2340
- onDrag: (n) => n,
2341
- onDragEnd: (n) => n,
2335
+ ), p = B(() => {
2336
+ setTimeout(() => o.onDragEnd(`${t}`), 100), n({
2337
+ onDrag: (s) => s,
2338
+ onDragEnd: (s) => s,
2342
2339
  dragStartY: 0,
2343
2340
  dragging: !1,
2344
2341
  dragStartValue: 0,
@@ -2346,22 +2343,22 @@ const Hs = {
2346
2343
  negative: !1,
2347
2344
  cssProperty: ""
2348
2345
  });
2349
- }, [l, t, s]);
2350
- return Ht(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
2351
- /* @__PURE__ */ e.jsx(Jt, { className: "mx-auto text-3xl" }),
2352
- /* @__PURE__ */ e.jsx("h1", { children: o("no_block_selected_for_styling") })
2353
- ] }) }) : /* @__PURE__ */ e.jsx(qe, { children: /* @__PURE__ */ e.jsxs(xt.Provider, { value: { setDragData: s }, children: [
2354
- l.dragging ? /* @__PURE__ */ e.jsx(
2346
+ }, [o, t, n]);
2347
+ return Bt(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
2348
+ /* @__PURE__ */ e.jsx(er, { className: "mx-auto text-3xl" }),
2349
+ /* @__PURE__ */ e.jsx("h1", { children: a("no_block_selected_for_styling") })
2350
+ ] }) }) : /* @__PURE__ */ e.jsx(Je, { children: /* @__PURE__ */ e.jsxs(ht.Provider, { value: { setDragData: n }, children: [
2351
+ o.dragging ? /* @__PURE__ */ e.jsx(
2355
2352
  "div",
2356
2353
  {
2357
2354
  onMouseMove: d,
2358
- onMouseUp: () => c(),
2355
+ onMouseUp: () => p(),
2359
2356
  className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"
2360
2357
  }
2361
2358
  ) : null,
2362
- /* @__PURE__ */ e.jsxs(dt, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden bg-gray-100 pb-5", children: [
2363
- /* @__PURE__ */ e.jsx(ls, {}),
2364
- /* @__PURE__ */ e.jsx(Vs, {}),
2359
+ /* @__PURE__ */ e.jsxs(pt, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden bg-gray-100 pb-5", children: [
2360
+ /* @__PURE__ */ e.jsx(ds, {}),
2361
+ /* @__PURE__ */ e.jsx(Is, {}),
2365
2362
  /* @__PURE__ */ e.jsx("br", {}),
2366
2363
  /* @__PURE__ */ e.jsx("br", {}),
2367
2364
  /* @__PURE__ */ e.jsx("br", {})
@@ -2369,5 +2366,5 @@ const Hs = {
2369
2366
  ] }) });
2370
2367
  };
2371
2368
  export {
2372
- Ho as default
2369
+ Po as default
2373
2370
  };