@chaibuilder/sdk 1.0.10 → 1.0.12

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 (86) hide show
  1. package/dist/AddBlocks-7ACJv8LW.cjs +3 -0
  2. package/dist/{AddBlocks-xR2s2BVa.js → AddBlocks-H7BZYHUC.js} +30 -30
  3. package/dist/BrandingOptions-5j-XszLM.cjs +1 -0
  4. package/dist/{BrandingOptions-cHK2bVZy.js → BrandingOptions-PAgY-kvj.js} +13 -12
  5. package/dist/{CanvasArea-Br8bBSeT.cjs → CanvasArea-Dnm-yeus.cjs} +2 -2
  6. package/dist/{CanvasArea-2zqT1lSE.js → CanvasArea-zn2ox-5h.js} +6 -6
  7. package/dist/{ChaiBuilderEditor-SacH75l4.cjs → ChaiBuilderEditor-BoE-sArB.cjs} +2 -2
  8. package/dist/{ChaiBuilderEditor-h9bXC4l-.js → ChaiBuilderEditor-hEuUONQ3.js} +2 -2
  9. package/dist/{CurrentPage-4lTETR2f.js → CurrentPage-6Jp4xAWK.js} +3 -3
  10. package/dist/CurrentPage-YMpqOqx7.cjs +1 -0
  11. package/dist/Layers-EzOZdWvd.cjs +1 -0
  12. package/dist/{Layers-wOfijZnb.js → Layers-WkZ48AUm.js} +5 -5
  13. package/dist/{MarkAsGlobalBlock-xRyn29gC.js → MarkAsGlobalBlock-0HubcRkY.js} +3 -3
  14. package/dist/MarkAsGlobalBlock-HmeIyLCP.cjs +1 -0
  15. package/dist/{PagesPanel-82gCVzHS.js → PagesPanel-6JuwBLFQ.js} +4 -4
  16. package/dist/PagesPanel-zJq8p1ja.cjs +1 -0
  17. package/dist/ProjectPanel-Zml2F8b9.cjs +1 -0
  18. package/dist/{ProjectPanel-vz5WOyqZ.js → ProjectPanel-cu2QSDW9.js} +4 -4
  19. package/dist/{Settings-IuAF359L.js → Settings-fH8fZKpm.js} +70 -69
  20. package/dist/Settings-lc9PfnmG.cjs +1 -0
  21. package/dist/SidePanels-VH72zFE2.cjs +1 -0
  22. package/dist/{SidePanels-xssTWt4M.js → SidePanels-w8ZHKJaR.js} +3 -3
  23. package/dist/{Topbar-H0f0EL6-.js → Topbar-hm1D_5sb.js} +2 -2
  24. package/dist/Topbar-vQPo9xSY.cjs +1 -0
  25. package/dist/add-page-modal--qZSwJuB.cjs +1 -0
  26. package/dist/{add-page-modal-J1E7rh1U.js → add-page-modal-bj7qbZuK.js} +6 -5
  27. package/dist/controls-W97-POR_.cjs +1 -0
  28. package/dist/controls-enQY7NI8.js +118 -0
  29. package/dist/core.cjs +1 -1
  30. package/dist/core.js +9 -9
  31. package/dist/delete-page-modal-2LuDLEiP.cjs +1 -0
  32. package/dist/{delete-page-modal-ysj4O0bM.js → delete-page-modal-cnrR8tWH.js} +3 -3
  33. package/dist/index-HAue58ea.cjs +1 -0
  34. package/dist/{index-cZ4uo6aT.js → index-T4_wfKl5.js} +2 -2
  35. package/dist/{index-8L3zCc6V.cjs → index-X9ZgD09V.cjs} +1 -1
  36. package/dist/index-ehKdBRUK.js +18 -0
  37. package/dist/lib.cjs +1 -1
  38. package/dist/lib.d.ts +65 -0
  39. package/dist/lib.js +117 -57
  40. package/dist/page-viewer-IARz6OSp.cjs +1 -0
  41. package/dist/{page-viewer-84Giu0Rs.js → page-viewer-Y4YiaZ_m.js} +4 -4
  42. package/dist/{project-general-setting-8OEVVxzn.js → project-general-setting-U4S_KlhU.js} +13 -12
  43. package/dist/project-general-setting-eSl3t-VH.cjs +1 -0
  44. package/dist/{project-seo-setting-9kD_stdI.js → project-seo-setting-Ga9v_ECU.js} +7 -7
  45. package/dist/project-seo-setting-rankm1z3.cjs +1 -0
  46. package/dist/render.cjs +1 -1
  47. package/dist/render.js +34 -34
  48. package/dist/server.cjs +1 -1
  49. package/dist/server.js +1 -1
  50. package/dist/{single-page-detail-iXpavDy8.js → single-page-detail-pAxCy_Pe.js} +43 -42
  51. package/dist/single-page-detail-yPgnu2AI.cjs +1 -0
  52. package/dist/studio.cjs +1 -1
  53. package/dist/studio.js +3 -3
  54. package/dist/ui.cjs +1 -1
  55. package/dist/ui.d.ts +4 -69
  56. package/dist/ui.js +208 -267
  57. package/dist/{useAddBlock-BOjrGBEO.js → useAddBlock-WJc3OgG8.js} +2 -2
  58. package/dist/{useAddBlock-1cMXaOVk.cjs → useAddBlock-dCKRFPRU.cjs} +1 -1
  59. package/dist/{useAllBlocks-RU_Xw8j9.cjs → useAllBlocks-6hvuNuyw.cjs} +1 -1
  60. package/dist/{useAllBlocks-lX6uVO39.js → useAllBlocks-PQKYvs-e.js} +1 -1
  61. package/dist/{useDarkMode-JWkrNFpH.js → useDarkMode-ZKCO_gkt.js} +1 -1
  62. package/dist/{useDarkMode-zeTW_UUR.cjs → useDarkMode-dV6FM6l-.cjs} +1 -1
  63. package/dist/{useFeatureSupport-jWSuY7wk.js → useFeatureSupport-OLwNgEZb.js} +1 -1
  64. package/dist/{useFeatureSupport-tZ0QfBxp.cjs → useFeatureSupport-c9IgPW2t.cjs} +1 -1
  65. package/dist/{useLanguage-Y3qgAbgG.cjs → useLanguage-NKKKaxVM.cjs} +1 -1
  66. package/dist/{useLanguage-O1uu2Bzu.js → useLanguage-gVC5rxO5.js} +2 -2
  67. package/dist/{useMarkAsGlobalBlock-DB5B1UP6.js → useMarkAsGlobalBlock-X73Vny8u.js} +2 -2
  68. package/dist/useMarkAsGlobalBlock-ebBVGHg4.cjs +1 -0
  69. package/package.json +2 -2
  70. package/dist/AddBlocks-tdvDe7xL.cjs +0 -3
  71. package/dist/BrandingOptions-DpJ-oNnf.cjs +0 -1
  72. package/dist/CurrentPage-nlUWJiUA.cjs +0 -1
  73. package/dist/Layers-Vw4XE6YB.cjs +0 -1
  74. package/dist/MarkAsGlobalBlock-1J_YyL1L.cjs +0 -1
  75. package/dist/PagesPanel-ZKRdK-mI.cjs +0 -1
  76. package/dist/ProjectPanel-kYg4KkJu.cjs +0 -1
  77. package/dist/Settings-1E3Y_5r6.cjs +0 -1
  78. package/dist/SidePanels-WL1UioF2.cjs +0 -1
  79. package/dist/Topbar-3ozdWfSy.cjs +0 -1
  80. package/dist/add-page-modal-eiiUZCJX.cjs +0 -1
  81. package/dist/delete-page-modal-TGTmRjyn.cjs +0 -1
  82. package/dist/page-viewer-OdVEG83P.cjs +0 -1
  83. package/dist/project-general-setting-laHNQPW5.cjs +0 -1
  84. package/dist/project-seo-setting-F3Opt9Uj.cjs +0 -1
  85. package/dist/single-page-detail-X0TGlsT4.cjs +0 -1
  86. package/dist/useMarkAsGlobalBlock-toxRSLc_.cjs +0 -1
@@ -4,19 +4,20 @@ import $, { useState as w, useEffect as E, useMemo as k, useCallback as A, creat
4
4
  import { useThrottledCallback as me } from "@react-hookz/web";
5
5
  import { map as C, isEmpty as b, last as ye, forEach as je, set as Me, get as p, startCase as Y, filter as be, truncate as it, isArray as ae, includes as M, first as we, split as dt, toLower as te, find as ct, omit as pt, keys as ut, cloneDeep as xt, each as gt, capitalize as ht, reject as mt, nth as Re, startsWith as z, isNumber as yt, parseInt as bt, isNaN as _e, findLast as ft, has as ge, flatten as U, intersection as Ee, isNull as vt } from "lodash";
6
6
  import { useTranslation as Fe } from "react-i18next";
7
- import { PlusIcon as Ce, Cross2Icon as Ye, EyeOpenIcon as jt, EyeClosedIcon as Ve, BorderAllIcon as O, WidthIcon as R, HeightIcon as V, ArrowUpIcon as q, ArrowRightIcon as J, ArrowDownIcon as Q, ArrowLeftIcon as ee, ArrowTopLeftIcon as wt, ArrowTopRightIcon as Ct, ArrowBottomRightIcon as Nt, ArrowBottomLeftIcon as kt, AlignLeftIcon as Tt, AlignCenterHorizontallyIcon as St, AlignRightIcon as Rt, StretchHorizontallyIcon as Vt, FontItalicIcon as Bt, UnderlineIcon as Ht, OverlineIcon as At, LetterCaseUppercaseIcon as Dt, Cross1Icon as $t, InfoCircledIcon as Ne, MinusIcon as Pt, BoxIcon as Xe, TriangleDownIcon as It, RowSpacingIcon as Lt, TrashIcon as We, MixerHorizontalIcon as Ze } from "@radix-ui/react-icons";
8
- import { T as Ot, a as Mt, b as Be, c as He } from "./tabs-Gb9v5dVb.js";
7
+ import { PlusIcon as Ce, Cross2Icon as Ye, EyeOpenIcon as jt, EyeClosedIcon as Ve, BorderAllIcon as O, WidthIcon as R, HeightIcon as V, ArrowUpIcon as q, ArrowRightIcon as J, ArrowDownIcon as Q, ArrowLeftIcon as ee, ArrowTopLeftIcon as wt, ArrowTopRightIcon as Ct, ArrowBottomRightIcon as Nt, ArrowBottomLeftIcon as kt, AlignLeftIcon as Tt, AlignCenterHorizontallyIcon as St, AlignRightIcon as Rt, StretchHorizontallyIcon as Vt, FontItalicIcon as Ht, UnderlineIcon as Bt, OverlineIcon as At, LetterCaseUppercaseIcon as Dt, Cross1Icon as $t, InfoCircledIcon as Ne, MinusIcon as Pt, BoxIcon as Xe, TriangleDownIcon as It, RowSpacingIcon as Lt, TrashIcon as We, MixerHorizontalIcon as Ze } from "@radix-ui/react-icons";
8
+ import { T as Ot, a as Mt, b as He, c as Be } from "./tabs-Gb9v5dVb.js";
9
9
  import _t from "@rjsf/core";
10
10
  import Et from "@rjsf/validator-ajv8";
11
- import { m as G, E as Ft, a as ze, q as ke, l as Ue, p as Yt, o as Xt, G as Wt } from "./ChaiBuilderEditor-h9bXC4l-.js";
12
- import { f as Ge, g as Zt, u as Ke, a as qe, d as Je, b as pe } from "./useLanguage-O1uu2Bzu.js";
11
+ import { m as G, E as Ft, a as ze, q as ke, l as Ue, p as Yt, o as Xt, G as Wt } from "./ChaiBuilderEditor-hEuUONQ3.js";
12
+ import { f as Ge, g as Zt, u as Ke, a as qe, d as Je, b as pe } from "./useLanguage-gVC5rxO5.js";
13
13
  import { g as zt, a as Ut } from "./controls-Ni5kEzLz.js";
14
- import { getChaiDataProviders as Gt, getBlockComponent as Qe, SingleLineText as Kt } from "@chaibuilder/blocks";
15
- import { EditIcon as qt, TrashIcon as Jt, Check as Qt } from "lucide-react";
16
- import { T as X, a as W, c as Z, B as ue, e as er } from "./skeleton-CU_FIbg3.js";
17
- import { D as tr, a as rr, b as sr, c as or, e as lr, f as nr, d as ar } from "./dialog-jrw9DF1f.js";
18
- import { P as ir, a as dr, b as cr } from "./popover-a84pbVhQ.js";
19
- import { C as pr, b as ur, c as xr, d as gr, e as hr, f as mr, I as yr } from "./command-VHca6CcN.js";
14
+ import { u as Gt } from "./controls-enQY7NI8.js";
15
+ import { EditIcon as Kt, TrashIcon as qt, Check as Jt } from "lucide-react";
16
+ import { T as X, a as W, c as Z, B as ue, e as Qt } from "./skeleton-CU_FIbg3.js";
17
+ import { D as er, a as tr, b as rr, c as sr, e as or, f as lr, d as nr } from "./dialog-jrw9DF1f.js";
18
+ import { P as ar, a as ir, b as dr } from "./popover-a84pbVhQ.js";
19
+ import { C as cr, b as pr, c as ur, d as xr, e as gr, f as hr, I as mr } from "./command-VHca6CcN.js";
20
+ import { A as yr, h as Qe } from "./index-ehKdBRUK.js";
20
21
  import { u as et } from "./useChaiExternalData-4K9WxANa.js";
21
22
  import { A as tt, a as ie, b as de, c as ce } from "./accordion-oPUeqPCZ.js";
22
23
  import { R as br, I as fr, a as vr, L as jr } from "./link-6o6n2Tnd.js";
@@ -26,9 +27,9 @@ import Nr from "fuse.js";
26
27
  import { A as kr, C as xe, g as Tr } from "./Class-l7qYbuoN.js";
27
28
  import { L as Te } from "./label-KaP7MRrs.js";
28
29
  import { S as Sr } from "./MODIFIERS-DsEzQ3aH.js";
29
- import { a as Rr, u as Ae } from "./useDarkMode-JWkrNFpH.js";
30
+ import { a as Rr, u as Ae } from "./useDarkMode-ZKCO_gkt.js";
30
31
  import { S as Vr } from "./scroll-area-ewXbxc3n.js";
31
- import { S as Br, c as Hr, b as Ar, d as Dr, f as B } from "./select-POGdEDHT.js";
32
+ import { S as Hr, c as Br, b as Ar, d as Dr, f as H } from "./select-POGdEDHT.js";
32
33
  import "@radix-ui/react-tabs";
33
34
  import "./utils-dze1SGvB.js";
34
35
  import "clsx";
@@ -107,8 +108,8 @@ const fe = ({ data: t, fullView: s }) => {
107
108
  }, [s, t]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
108
109
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
109
110
  /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: Y(te(t)) }),
110
- /* @__PURE__ */ e.jsxs(ir, { open: c, onOpenChange: m, children: [
111
- /* @__PURE__ */ e.jsx(dr, { asChild: !0, children: /* @__PURE__ */ e.jsx(
111
+ /* @__PURE__ */ e.jsxs(ar, { open: c, onOpenChange: m, children: [
112
+ /* @__PURE__ */ e.jsx(ir, { asChild: !0, children: /* @__PURE__ */ e.jsx(
112
113
  ue,
113
114
  {
114
115
  variant: "outline",
@@ -126,12 +127,12 @@ const fe = ({ data: t, fullView: s }) => {
126
127
  ] })
127
128
  }
128
129
  ) }),
129
- /* @__PURE__ */ e.jsx(cr, { className: "p-0 z-[999] min-w-[300px]", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(pr, { children: [
130
- /* @__PURE__ */ e.jsx(ur, { placeholder: `Choose ${te(t)}...` }),
131
- /* @__PURE__ */ e.jsxs(xr, { children: [
132
- /* @__PURE__ */ e.jsx(gr, { children: "No results found." }),
133
- /* @__PURE__ */ e.jsx(hr, { children: C(h, (g) => /* @__PURE__ */ e.jsxs(
134
- mr,
130
+ /* @__PURE__ */ e.jsx(dr, { className: "p-0 z-[999] min-w-[300px]", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(cr, { children: [
131
+ /* @__PURE__ */ e.jsx(pr, { placeholder: `Choose ${te(t)}...` }),
132
+ /* @__PURE__ */ e.jsxs(ur, { children: [
133
+ /* @__PURE__ */ e.jsx(xr, { children: "No results found." }),
134
+ /* @__PURE__ */ e.jsx(gr, { children: C(h, (g) => /* @__PURE__ */ e.jsxs(
135
+ hr,
135
136
  {
136
137
  value: g,
137
138
  className: `cursor-pointer ${x ? "flex justify-between items-center" : "flex flex-col items-start justify-start"}`,
@@ -140,7 +141,7 @@ const fe = ({ data: t, fullView: s }) => {
140
141
  },
141
142
  children: [
142
143
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
143
- /* @__PURE__ */ e.jsx(Qt, { className: `w-4 h-4 text-green-500 ${s === g ? "" : "opacity-0"}` }),
144
+ /* @__PURE__ */ e.jsx(Jt, { className: `w-4 h-4 text-green-500 ${s === g ? "" : "opacity-0"}` }),
144
145
  g
145
146
  ] }),
146
147
  x ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 rounded-full", children: Y(p(n, g, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(fe, { data: p(o, g) }) })
@@ -175,9 +176,9 @@ const fe = ({ data: t, fullView: s }) => {
175
176
  [n, u]
176
177
  ), [c, m] = w(r ? x(o.key, "PROP") : "");
177
178
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
178
- /* @__PURE__ */ e.jsxs(or, { children: [
179
- /* @__PURE__ */ e.jsx(lr, { children: "Add Data Binding" }),
180
- /* @__PURE__ */ e.jsx(nr, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
179
+ /* @__PURE__ */ e.jsxs(sr, { children: [
180
+ /* @__PURE__ */ e.jsx(or, { children: "Add Data Binding" }),
181
+ /* @__PURE__ */ e.jsx(lr, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
181
182
  ] }),
182
183
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 relative", children: [
183
184
  /* @__PURE__ */ e.jsx(
@@ -216,7 +217,7 @@ const fe = ({ data: t, fullView: s }) => {
216
217
  }
217
218
  )
218
219
  ] }),
219
- /* @__PURE__ */ e.jsx(ar, { children: /* @__PURE__ */ e.jsx(
220
+ /* @__PURE__ */ e.jsx(nr, { children: /* @__PURE__ */ e.jsx(
220
221
  ue,
221
222
  {
222
223
  type: "submit",
@@ -229,9 +230,9 @@ const fe = ({ data: t, fullView: s }) => {
229
230
  ] });
230
231
  }, rt = ({ children: t, onAddBinding: s, appliedBindings: r, editMode: o = !0, item: l = {} }) => {
231
232
  const [a, d] = w(!1);
232
- return /* @__PURE__ */ e.jsxs(tr, { children: [
233
- /* @__PURE__ */ e.jsx(rr, { asChild: !0, onClick: () => d(!0), children: t }),
234
- a && /* @__PURE__ */ e.jsx(sr, { children: /* @__PURE__ */ e.jsx(
233
+ return /* @__PURE__ */ e.jsxs(er, { children: [
234
+ /* @__PURE__ */ e.jsx(tr, { asChild: !0, onClick: () => d(!0), children: t }),
235
+ a && /* @__PURE__ */ e.jsx(rr, { children: /* @__PURE__ */ e.jsx(
235
236
  Ir,
236
237
  {
237
238
  item: l,
@@ -267,9 +268,9 @@ const fe = ({ data: t, fullView: s }) => {
267
268
  /* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: t.value }),
268
269
  /* @__PURE__ */ e.jsx(fe, { data: p(l, t.value, "") }),
269
270
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
270
- /* @__PURE__ */ e.jsx(rt, { editMode: !0, onAddBinding: s, appliedBindings: a, item: t, children: /* @__PURE__ */ e.jsx(qt, { className: "h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-blue-400 hover:text-white border-blue-400 p-1 text-blue-400 hover:scale-105 duration-200" }) }),
271
+ /* @__PURE__ */ e.jsx(rt, { editMode: !0, onAddBinding: s, appliedBindings: a, item: t, children: /* @__PURE__ */ e.jsx(Kt, { className: "h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-blue-400 hover:text-white border-blue-400 p-1 text-blue-400 hover:scale-105 duration-200" }) }),
271
272
  /* @__PURE__ */ e.jsx(
272
- Jt,
273
+ qt,
273
274
  {
274
275
  onClick: () => r(),
275
276
  className: "h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-red-400 hover:text-white border-red-400 p-1 text-red-400 hover:scale-105 duration-200"
@@ -279,7 +280,7 @@ const fe = ({ data: t, fullView: s }) => {
279
280
  !b(d) && !b(t.key) && /* @__PURE__ */ e.jsx("div", { className: "mt-px absolute right-0 top-1 text-purple-600 text-[10px] flex items-center font-medium h-4 px-2 rounded-full", children: Y(d) })
280
281
  ] });
281
282
  }, Or = ({ bindingData: t, onChange: s }) => {
282
- const r = G(), [o] = et(), l = Gt(), [a, d] = w(
283
+ const r = G(), [o] = et(), l = yr(), [a, d] = w(
283
284
  C(t, (c, m) => ({ key: m, value: c }))
284
285
  );
285
286
  E(() => {
@@ -386,7 +387,7 @@ function Er() {
386
387
  r([t._id], { [m]: p(x, m) });
387
388
  }
388
389
  }, i = {
389
- _name: Kt({
390
+ _name: Gt({
390
391
  title: "Name",
391
392
  default: p(t, "_name", t._type)
392
393
  })
@@ -558,10 +559,10 @@ function Fr() {
558
559
  }
559
560
  );
560
561
  }
561
- const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Yr = {
562
+ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Yr = {
562
563
  heading: "Flex Child",
563
564
  items: [
564
- { type: "arbitrary", label: "Basis", units: H, property: "flexBasis" },
565
+ { type: "arbitrary", label: "Basis", units: B, property: "flexBasis" },
565
566
  { type: "range", label: "Order", property: "order" },
566
567
  { type: "dropdown", label: "Flex", property: "flexGrowShrink" },
567
568
  { type: "dropdown", label: "Grow", property: "flexGrow" },
@@ -582,7 +583,7 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Yr = {
582
583
  {
583
584
  heading: "Display",
584
585
  items: [
585
- { type: "dropdown", label: "Display", property: "display", units: H },
586
+ { type: "dropdown", label: "Display", property: "display", units: B },
586
587
  {
587
588
  styleType: "accordion",
588
589
  heading: "Flex options",
@@ -633,7 +634,7 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Yr = {
633
634
  styleType: "accordion",
634
635
  heading: "Visibility & Opacity",
635
636
  items: [
636
- { type: "dropdown", label: "Visibility", property: "visibility", units: H },
637
+ { type: "dropdown", label: "Visibility", property: "visibility", units: B },
637
638
  { type: "arbitrary", label: "Opacity", property: "opacity", units: ["-"] }
638
639
  ]
639
640
  }
@@ -646,7 +647,7 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Yr = {
646
647
  styleType: "multiple",
647
648
  label: "Margin",
648
649
  negative: !0,
649
- units: [...H, "auto"],
650
+ units: [...B, "auto"],
650
651
  options: [
651
652
  { key: "margin", label: "All" },
652
653
  { key: "marginX", label: "Left-Right" },
@@ -683,22 +684,22 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Yr = {
683
684
  {
684
685
  heading: "Size",
685
686
  items: [
686
- { type: "arbitrary", label: "Width", units: H.concat("auto"), property: "width" },
687
- { type: "arbitrary", label: "Height", units: H.concat("auto"), property: "height" },
687
+ { type: "arbitrary", label: "Width", units: B.concat("auto"), property: "width" },
688
+ { type: "arbitrary", label: "Height", units: B.concat("auto"), property: "height" },
688
689
  {
689
690
  styleType: "accordion",
690
691
  heading: "Min width & height",
691
692
  items: [
692
- { type: "arbitrary", label: "Min Width", units: H.concat("auto"), property: "minWidth" },
693
- { type: "arbitrary", label: "Min Height", units: H.concat("auto"), property: "minHeight" }
693
+ { type: "arbitrary", label: "Min Width", units: B.concat("auto"), property: "minWidth" },
694
+ { type: "arbitrary", label: "Min Height", units: B.concat("auto"), property: "minHeight" }
694
695
  ]
695
696
  },
696
697
  {
697
698
  styleType: "accordion",
698
699
  heading: "Max width & height",
699
700
  items: [
700
- { type: "arbitrary", label: "Max Width", units: H.concat("auto"), property: "maxWidth" },
701
- { type: "arbitrary", label: "Max Height", units: H.concat("auto"), property: "maxHeight" }
701
+ { type: "arbitrary", label: "Max Width", units: B.concat("auto"), property: "maxWidth" },
702
+ { type: "arbitrary", label: "Max Height", units: B.concat("auto"), property: "maxHeight" }
702
703
  ]
703
704
  },
704
705
  {
@@ -782,8 +783,8 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Yr = {
782
783
  heading: "Typography",
783
784
  items: [
784
785
  { type: "dropdown", property: "fontFamily", label: "Font" },
785
- { type: "arbitrary", property: "fontSize", label: "Size", units: H },
786
- { type: "arbitrary", property: "lineHeight", label: "Height", units: H.concat("-") },
786
+ { type: "arbitrary", property: "fontSize", label: "Size", units: B },
787
+ { type: "arbitrary", property: "lineHeight", label: "Height", units: B.concat("-") },
787
788
  { type: "range", property: "fontWeight", label: "Weight" },
788
789
  { type: "color", property: "textColor", label: "Color" },
789
790
  {
@@ -1056,10 +1057,10 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Yr = {
1056
1057
  textRight: Rt,
1057
1058
  textJustify: Vt,
1058
1059
  // font style
1059
- italic: Bt,
1060
+ italic: Ht,
1060
1061
  // "not-italic": "",
1061
1062
  // decoration
1062
- underline: Ht,
1063
+ underline: Bt,
1063
1064
  overline: At,
1064
1065
  // transform
1065
1066
  uppercase: Dt,
@@ -1182,7 +1183,7 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Yr = {
1182
1183
  ), ot = ({ label: t, property: s, onChange: r }) => {
1183
1184
  const o = k(() => p(xe, `${s}.classes`, [""]), [s]), l = oe(s), a = k(() => p(l, "cls", ""), [l]), { canChange: d } = re(se), i = /\[.*\]/g.test(a);
1184
1185
  return /* @__PURE__ */ e.jsx("div", { className: t ? "w-full rounded " : "grow", children: i ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
1185
- /* @__PURE__ */ e.jsx(yr, { className: "w-[70%] rounded py-1", readOnly: !0, value: a }),
1186
+ /* @__PURE__ */ e.jsx(mr, { className: "w-[70%] rounded py-1", readOnly: !0, value: a }),
1186
1187
  /* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
1187
1188
  /* @__PURE__ */ e.jsx(W, { 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, {}) }) }),
1188
1189
  /* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind arbitrary value." })
@@ -1649,7 +1650,7 @@ const zr = ({ property: t, onChange: s }) => {
1649
1650
  ]
1650
1651
  }
1651
1652
  ) }),
1652
- /* @__PURE__ */ e.jsx(er, { children: /* @__PURE__ */ e.jsx(Z, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
1653
+ /* @__PURE__ */ e.jsx(Qt, { children: /* @__PURE__ */ e.jsx(Z, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
1653
1654
  ts,
1654
1655
  {
1655
1656
  units: u,
@@ -2084,21 +2085,21 @@ function ps() {
2084
2085
  /* @__PURE__ */ e.jsxs("div", { onClick: () => l(!1), className: "flex h-full flex-col", children: [
2085
2086
  /* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-x-4 space-y-3 border-b border-border px-4 py-2", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-1.5", children: [
2086
2087
  /* @__PURE__ */ e.jsx(Te, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
2087
- /* @__PURE__ */ e.jsxs(Br, { defaultValue: t, onValueChange: (i) => s(i), children: [
2088
- /* @__PURE__ */ e.jsx(Hr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(Ar, { placeholder: "State" }) }),
2088
+ /* @__PURE__ */ e.jsxs(Hr, { defaultValue: t, onValueChange: (i) => s(i), children: [
2089
+ /* @__PURE__ */ e.jsx(Br, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(Ar, { placeholder: "State" }) }),
2089
2090
  /* @__PURE__ */ e.jsxs(Dr, { children: [
2090
- /* @__PURE__ */ e.jsx(B, { value: "", children: "Normal" }),
2091
- /* @__PURE__ */ e.jsx(B, { value: "hover", children: "Hover" }),
2092
- /* @__PURE__ */ e.jsx(B, { value: "active", children: "Active" }),
2093
- /* @__PURE__ */ e.jsx(B, { value: "focus", children: "Focus" }),
2094
- /* @__PURE__ */ e.jsx(B, { value: "before", children: "Before" }),
2095
- /* @__PURE__ */ e.jsx(B, { value: "after", children: "After" }),
2096
- /* @__PURE__ */ e.jsx(B, { value: "only", children: "Only" }),
2097
- /* @__PURE__ */ e.jsx(B, { value: "first", children: "First" }),
2098
- /* @__PURE__ */ e.jsx(B, { value: "last", children: "Last" }),
2099
- /* @__PURE__ */ e.jsx(B, { value: "first-letter", children: "First Letter" }),
2100
- /* @__PURE__ */ e.jsx(B, { value: "first-line", children: "First Line" }),
2101
- /* @__PURE__ */ e.jsx(B, { value: "disabled", children: "Disabled" })
2091
+ /* @__PURE__ */ e.jsx(H, { value: "", children: "Normal" }),
2092
+ /* @__PURE__ */ e.jsx(H, { value: "hover", children: "Hover" }),
2093
+ /* @__PURE__ */ e.jsx(H, { value: "active", children: "Active" }),
2094
+ /* @__PURE__ */ e.jsx(H, { value: "focus", children: "Focus" }),
2095
+ /* @__PURE__ */ e.jsx(H, { value: "before", children: "Before" }),
2096
+ /* @__PURE__ */ e.jsx(H, { value: "after", children: "After" }),
2097
+ /* @__PURE__ */ e.jsx(H, { value: "only", children: "Only" }),
2098
+ /* @__PURE__ */ e.jsx(H, { value: "first", children: "First" }),
2099
+ /* @__PURE__ */ e.jsx(H, { value: "last", children: "Last" }),
2100
+ /* @__PURE__ */ e.jsx(H, { value: "first-letter", children: "First Letter" }),
2101
+ /* @__PURE__ */ e.jsx(H, { value: "first-line", children: "First Line" }),
2102
+ /* @__PURE__ */ e.jsx(H, { value: "disabled", children: "Disabled" })
2102
2103
  ] })
2103
2104
  ] })
2104
2105
  ] }) }),
@@ -2125,7 +2126,7 @@ const us = {
2125
2126
  "-": 1,
2126
2127
  deg: 1,
2127
2128
  ms: 0.1
2128
- }, bo = () => {
2129
+ }, fo = () => {
2129
2130
  const t = G(), { t: s } = Fe(), [r, o] = $.useState(""), [l, a] = $.useState({
2130
2131
  onDrag: (n) => n,
2131
2132
  onDragEnd: (n) => n,
@@ -2173,21 +2174,21 @@ const us = {
2173
2174
  ) : null,
2174
2175
  /* @__PURE__ */ e.jsxs(Ot, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1", children: [
2175
2176
  /* @__PURE__ */ e.jsxs(Mt, { className: "mx-1 grid grid-cols-2", children: [
2176
- /* @__PURE__ */ e.jsx(Be, { value: "settings", children: "Settings" }),
2177
- /* @__PURE__ */ e.jsx(Be, { value: "styling", children: "Styling" })
2177
+ /* @__PURE__ */ e.jsx(He, { value: "settings", children: "Settings" }),
2178
+ /* @__PURE__ */ e.jsx(He, { value: "styling", children: "Styling" })
2178
2179
  ] }),
2179
2180
  /* @__PURE__ */ e.jsx(
2180
- He,
2181
+ Be,
2181
2182
  {
2182
2183
  value: "settings",
2183
2184
  className: "no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",
2184
2185
  children: /* @__PURE__ */ e.jsx(Er, {})
2185
2186
  }
2186
2187
  ),
2187
- /* @__PURE__ */ e.jsx(He, { value: "styling", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(ps, {}) })
2188
+ /* @__PURE__ */ e.jsx(Be, { value: "styling", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(ps, {}) })
2188
2189
  ] })
2189
2190
  ] });
2190
2191
  };
2191
2192
  export {
2192
- bo as default
2193
+ fo as default
2193
2194
  };
@@ -0,0 +1 @@
1
+ "use strict";var je=Object.create;var oe=Object.defineProperty;var fe=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var ve=Object.getPrototypeOf,Ee=Object.prototype.hasOwnProperty;var we=(s,o,r,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of Re(o))!Ee.call(s,i)&&i!==r&&oe(s,i,{get:()=>o[i],enumerable:!(n=fe(o,i))||n.enumerable});return s};var Ce=(s,o,r)=>(r=s!=null?je(ve(s)):{},we(o||!s||!s.__esModule?oe(r,"default",{value:s,enumerable:!0}):r,s));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),x=require("react"),K=require("@react-hookz/web"),t=require("lodash"),de=require("react-i18next"),p=require("@radix-ui/react-icons"),O=require("./tabs-iWeaaVrg.cjs"),ke=require("@rjsf/core"),Ne=require("@rjsf/validator-ajv8"),w=require("./ChaiBuilderEditor-BoE-sArB.cjs"),I=require("./useLanguage-NKKKaxVM.cjs"),ne=require("./controls-xUKa23ic.cjs"),Se=require("./controls-W97-POR_.cjs"),J=require("lucide-react"),v=require("./skeleton-JHP9zwL2.cjs"),M=require("./dialog-S_QbL1iq.cjs"),Z=require("./popover-fKjgcRUx.cjs"),$=require("./command-ThdTuUxt.cjs"),te=require("./index-HAue58ea.cjs"),ce=require("./useChaiExternalData-DkyBJ81C.cjs"),T=require("./accordion-ynvFtV_p.cjs"),X=require("./link-ece8dZGH.cjs"),Te=require("jotai"),Ie=require("react-autosuggest"),Be=require("fuse.js"),q=require("./Class-_uCzl5v1.cjs"),se=require("./label-tFm8HZdb.cjs"),Ae=require("./MODIFIERS-Fx6WAZcw.cjs"),U=require("./useDarkMode-dV6FM6l-.cjs"),He=require("./scroll-area-FiHvy-TZ.cjs"),C=require("./select-7bjg-rr9.cjs");require("@radix-ui/react-tabs");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./functions-uw7QP2kT.cjs");require("redux-undo");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("@radix-ui/react-dialog");require("@radix-ui/react-popover");require("cmdk");require("@radix-ui/react-accordion");require("react-icons-picker");require("./ImagesPanel-6us7hiLN.cjs");require("react-quill");require("@radix-ui/react-label");require("@radix-ui/react-select");function Ve(s){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(o,r,n.get?n:{enumerable:!0,get:()=>s[r]})}}return o.default=s,Object.freeze(o)}const z=Ve(x),De=x.lazy(()=>import("react-json-view"));function Le(s){const o=[],r={};function n(i,a){t.forEach(a,(d,u)=>{const l=i?`${i}.${u}`:u,m=t.isArray(d)?"list":typeof d;o.push(l),r[l]=m==="string"?"text":m==="object"?"model":m,m==="object"&&!t.isArray(d)&&n(l,d)})}return n("",t.omit(s,["styles","_type","_id","_name","_bindings"])),{paths:o,pathsType:r}}const Q=({data:s,fullView:o})=>{if(!s)return null;const r=typeof s;return o?typeof s=="object"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"h-3"}),e.jsxRuntimeExports.jsx(w.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(De,{style:{maxHeight:"40vh",overflowY:"auto"},name:"Content",enableClipboard:!1,displayObjectSize:!1,displayDataTypes:!1,src:s,collapsed:!0})})]}):e.jsxRuntimeExports.jsxs("div",{className:"text-gray-800/50 text-[12px] leading-4 w-full max-h-36 overflow-x-hidden overflow-y-auto",children:[e.jsxRuntimeExports.jsx("span",{className:"font-medium text-gray-800/80",children:"Content: "}),s]}):e.jsxRuntimeExports.jsx("div",{className:"text-[10px] text-gray-800/50 leading-3 whitespace-nowrap overflow-hidden w-full",children:t.truncate(r==="object"?JSON.stringify(s):s,{length:40})})},ie=({type:s,value:o="",setValue:r,data:n,onChange:i,dataType:a,appliedBindings:d})=>{const{paths:u,pathsType:l}=Le(n),m=s==="PROP"?te.h(n==null?void 0:n._type):{},g=s==="PROP",[c,b]=x.useState(!1),y=x.useMemo(()=>s==="PROP"?u.filter(h=>!t.includes(d,h)&&t.get(m,`props.${t.first(t.split(h,"."))}.binding`)):u.filter(h=>a===t.get(l,h,"")),[s,u,d,a,m]);return x.useEffect(()=>{o&&i(o)},[o,s]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:t.startCase(t.toLower(s))}),e.jsxRuntimeExports.jsxs(Z.Popover,{open:c,onOpenChange:b,children:[e.jsxRuntimeExports.jsx(Z.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(v.Button,{variant:"outline",size:"sm",className:` ${t.isEmpty(o)?"bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white w-44 justify-center":"min-w-[350px] justify-between items-center"}`,children:o?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("span",{className:"text-sm pr-8",children:[g&&e.jsxRuntimeExports.jsx("span",{className:"text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 mr-2 rounded-full",children:t.startCase(a)}),o]}),e.jsxRuntimeExports.jsx("span",{className:"text-[9px] text-blue-400 underline cursor-pointer hover:text-blue-700",children:"Change"})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["+ Set ",t.startCase(t.toLower(s))]})})}),e.jsxRuntimeExports.jsx(Z.PopoverContent,{className:"p-0 z-[999] min-w-[300px]",side:"right",align:"start",children:e.jsxRuntimeExports.jsxs($.Command,{children:[e.jsxRuntimeExports.jsx($.CommandInput,{placeholder:`Choose ${t.toLower(s)}...`}),e.jsxRuntimeExports.jsxs($.CommandList,{children:[e.jsxRuntimeExports.jsx($.CommandEmpty,{children:"No results found."}),e.jsxRuntimeExports.jsx($.CommandGroup,{children:t.map(y,h=>e.jsxRuntimeExports.jsxs($.CommandItem,{value:h,className:`cursor-pointer ${g?"flex justify-between items-center":"flex flex-col items-start justify-start"}`,onSelect:f=>{r(t.find(y,N=>N===f)||null),b(!1)},children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx(J.Check,{className:`w-4 h-4 text-green-500 ${o===h?"":"opacity-0"}`}),h]}),g?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("span",{className:"text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 rounded-full",children:t.startCase(t.get(l,h,""))})}):e.jsxRuntimeExports.jsx("div",{className:"pl-6",children:e.jsxRuntimeExports.jsx(Q,{data:t.get(n,h)})})]},h))})]})]})})]})]}),!g&&!t.isEmpty(o)&&e.jsxRuntimeExports.jsx("div",{className:"pt-2",children:e.jsxRuntimeExports.jsx(Q,{data:t.get(n,o,""),fullView:!0})})]})},Pe=({appliedBindings:s=[],onAddBinding:o,editMode:r,item:n})=>{const[i,a]=x.useState(r?n.key:""),[d,u]=x.useState(r?n.value:""),l=w.useSelectedBlock(),[m]=ce.useChaiExternalData(),g=x.useCallback((y,h)=>{if(t.isEmpty(y))return"";{const f=t.get(h==="PROP"?l:m,y,"");if(t.isArray(f))return"list";const N=typeof f;return N==="string"?"text":N==="object"?"model":N}},[l,m]),[c,b]=x.useState(r?g(n.key,"PROP"):"");return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(M.DialogHeader,{children:[e.jsxRuntimeExports.jsx(M.DialogTitle,{children:"Add Data Binding"}),e.jsxRuntimeExports.jsx(M.DialogDescription,{className:"text-xs",children:"Add prop and path of binding. Click save when you're done."})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1 relative",children:[e.jsxRuntimeExports.jsx(ie,{type:"PROP",isDisabled:!1,placeholder:"Enter prop key",value:i,setValue:a,onChange:y=>{const h=g(y,"PROP");a(y),c!==h&&u(""),b(h)},data:l,dataType:c,appliedBindings:s}),e.jsxRuntimeExports.jsx("div",{className:"h-2"}),e.jsxRuntimeExports.jsx(ie,{type:"PATH",isDisabled:t.isEmpty(i),placeholder:"Enter data path",value:d,setValue:u,onChange:y=>{const h=g(y,"PATH");u(c===h?y:"")},data:m,dataType:c,appliedBindings:s})]}),e.jsxRuntimeExports.jsx(M.DialogFooter,{children:e.jsxRuntimeExports.jsx(v.Button,{type:"submit",className:"mt-4",disabled:t.isEmpty(i)&&t.isEmpty(d),onClick:()=>o({key:i,value:d}),children:"Save"})})]})},xe=({children:s,onAddBinding:o,appliedBindings:r,editMode:n=!0,item:i={}})=>{const[a,d]=x.useState(!1);return e.jsxRuntimeExports.jsxs(M.Dialog,{children:[e.jsxRuntimeExports.jsx(M.DialogTrigger,{asChild:!0,onClick:()=>d(!0),children:s}),a&&e.jsxRuntimeExports.jsx(M.DialogContent,{children:e.jsxRuntimeExports.jsx(Pe,{item:i,editMode:n,appliedBindings:r,onAddBinding:u=>{o(u),d(!1)}})})]})},$e=({item:s,onAddBinding:o,onRemove:r,selectedBlock:n,dataProvider:i,appliedBindings:a})=>{const[d,u]=x.useState("string"),l=(m,g)=>{if(t.isEmpty(m))return"";{const c=t.get(g==="PROP"?n:i,m,"");if(t.isArray(c))return"list";const b=typeof c;return b==="string"?"text":b==="object"?"model":b}};return x.useEffect(()=>u(()=>l(s.key,"PROP")),[s.key]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col border border-gray-200 relative rounded-md p-2",children:[e.jsxRuntimeExports.jsx("div",{className:"text-gray-500 font-normal text-sm",children:s.key}),e.jsxRuntimeExports.jsx("div",{className:"font-medium leading-5",children:s.value}),e.jsxRuntimeExports.jsx(Q,{data:t.get(i,s.value,"")}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-2",children:[e.jsxRuntimeExports.jsx(xe,{editMode:!0,onAddBinding:o,appliedBindings:a,item:s,children:e.jsxRuntimeExports.jsx(J.EditIcon,{className:"h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-blue-400 hover:text-white border-blue-400 p-1 text-blue-400 hover:scale-105 duration-200"})}),e.jsxRuntimeExports.jsx(J.TrashIcon,{onClick:()=>r(),className:"h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-red-400 hover:text-white border-red-400 p-1 text-red-400 hover:scale-105 duration-200"})]}),!t.isEmpty(d)&&!t.isEmpty(s.key)&&e.jsxRuntimeExports.jsx("div",{className:"mt-px absolute right-0 top-1 text-purple-600 text-[10px] flex items-center font-medium h-4 px-2 rounded-full",children:t.startCase(d)})]})},Me=({bindingData:s,onChange:o})=>{const r=w.useSelectedBlock(),[n]=ce.useChaiExternalData(),i=te.A(),[a,d]=x.useState(t.map(s,(c,b)=>({key:b,value:c})));x.useEffect(()=>{d(t.map(s,(c,b)=>({key:b,value:c})))},[r==null?void 0:r._id]);const u=x.useMemo(()=>{if(t.isEmpty(n))return!0;if(t.isEmpty(a))return!1;const c=t.last(a);return t.isEmpty(c==null?void 0:c.key)||t.isEmpty(c==null?void 0:c.value)},[n,a]),l=c=>{const b=t.filter(a,y=>y.key!==c.key);d([...b,c]),g([...b,c])},m=c=>{const b=t.filter(a,(y,h)=>c!==h);g([...b])},g=x.useCallback((c=[])=>{if(d(c),t.isEmpty(c)){o({});return}const b={};t.forEach(c,y=>{!t.isEmpty(y==null?void 0:y.key)&&!t.isEmpty(y==null?void 0:y.value)&&t.set(b,y.key,y.value)}),o(b)},[o]);return t.isEmpty(i)?e.jsxRuntimeExports.jsx("div",{className:"w-full flex items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"text-gray-500 mb-1.5 text-xs",children:["You have no data providers registered. Please add a data provider to your project. ",e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:"Learn more"})]})}):e.jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[t.map(a,(c,b)=>e.jsxRuntimeExports.jsx($e,{item:c,onAddBinding:l,onRemove:()=>m(b),selectedBlock:r,dataProvider:n,appliedBindings:t.map(a,"key")},c.key)),e.jsxRuntimeExports.jsxs(v.Tooltip,{delayDuration:200,children:[e.jsxRuntimeExports.jsx(v.TooltipTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(xe,{appliedBindings:t.map(a,"key"),onAddBinding:l,children:e.jsxRuntimeExports.jsx("button",{disabled:u,className:`w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${u?"cursor-not-allowed bg-gray-200 text-gray-400":"bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,children:t.isEmpty(n)?e.jsxRuntimeExports.jsx("small",{className:"text-gray-500 text-[9.5px]",children:"No data provider has been set up for this page"}):"+ Add Data Binding"})})}),u&&e.jsxRuntimeExports.jsx(v.TooltipContent,{sideOffset:-55,className:"text-[11px]",children:t.isEmpty(n)?"No data provider has been set up for this page.":"Complete last added data binding to add more"})]})]})},Oe=Me,qe=()=>e.jsxRuntimeExports.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"}),le=({createHistorySnapshot:s,properties:o,formData:r,onChange:n})=>{const[i]=I.useActiveLanguage(),a={type:"object",properties:{}},d={};return Object.keys(o).forEach(u=>{const l=o[u];if(t.includes(["slot","styles"],l.type))return;const m=t.get(l,"i18n",!1)?`${u}-${i}`:u;a.properties[m]=ne.getBlockJSONFromSchemas(l,i),d[m]=ne.getBlockJSONFromUISchemas(l,i)}),e.jsxRuntimeExports.jsx(ke,{widgets:{binding:qe,richtext:X.RichTextEditorField,icon:X.IconPickerField,image:X.ImagePickerField},fields:{link:X.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!1,liveOmit:!1,liveValidate:!0,validator:Ne,uiSchema:d,onBlur:s,schema:a,formData:r,onChange:n})};function _e(){const s=w.useSelectedBlock(),{createSnapshot:o}=w.useCanvasHistory(),r=I.useUpdateBlocksPropsRealtime(),n=te.h(s._type),i={...s},a=()=>o(),d=({formData:g},c)=>{if(c){const b=c.replace("root.","");r([s._id],{[b]:t.get(g,b)})}},u={_name:Se.u({title:"Name",default:t.get(s,"_name",s._type)})},l=t.keys(t.get(i,"_bindings",{})),m=x.useMemo(()=>{const g=t.cloneDeep(t.get(n,"props",{}));return t.each(l,c=>{delete g[c]}),g},[n,l]);return e.jsxRuntimeExports.jsxs("div",{className:"overflow-x-hidden",children:[e.jsxRuntimeExports.jsx(le,{onChange:d,createHistorySnapshot:a,formData:i,properties:u}),e.jsxRuntimeExports.jsx("hr",{className:"mt-4"}),e.jsxRuntimeExports.jsxs(T.Accordion,{type:"multiple",defaultValue:["STATIC","BINDING"],className:"h-full w-full",children:[e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:"BINDING",children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(s,"_bindings",{}))?"bg-gray-300":"bg-blue-500"}`}),"Data Binding"]})}),e.jsxRuntimeExports.jsx(T.AccordionContent,{className:"pt-4 px-4",children:e.jsxRuntimeExports.jsx(Oe,{bindingData:t.get(i,"_bindings",{}),onChange:g=>{d({formData:{...i,_bindings:g}},"root._bindings")}})})]}),e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:"STATIC",children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-[8px] w-[8px] rounded-full bg-blue-500"}),"Static Content"]})}),e.jsxRuntimeExports.jsxs(T.AccordionContent,{className:"pt-4",children:[t.isEmpty(l)?"":e.jsxRuntimeExports.jsxs("div",{className:"text-xs mx-4 border rounded-sm p-1 mb-1 mt-0 border-orange-500 text-orange-500 bg-orange-100",children:["Data binding is set for ",e.jsxRuntimeExports.jsx("b",{children:t.map(l,t.capitalize).join(", ")})," ",l.length===1?"property":"properties",". Remove data binding to edit static content."]}),e.jsxRuntimeExports.jsx(le,{onChange:d,createHistorySnapshot:a,formData:i,properties:m})]})]})]}),e.jsxRuntimeExports.jsx("div",{className:"pb-60"})]})}const ae=new Be(q.ALL_TW_CLASSES,{isCaseSensitive:!1,threshold:.2,minMatchCharLength:2,keys:["name"]});function We(){var A;const[s]=w.useSelectedStylingBlocks(),o=w.useSelectedBlock(),r=I.useAddClassesToBlocks(),n=I.useRemoveClassesFromBlocks(),[i]=w.useSelectedBlockIds(),[a,d]=x.useState(""),u=(A=t.first(s))==null?void 0:A.prop,l=t.reject((t.get(o,u,"").replace(Ae.STYLES_KEY,"").split(",").pop()||"").split(" "),t.isEmpty),m=()=>{const E=a.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");r(i,E,!0),d("")},[g,c]=x.useState([]),b=({value:E})=>{const D=E.trim().toLowerCase(),H=D.match(/.+:/g);let k=[];if(H&&H.length>0){const[V]=H,P=D.replace(V,"");k=ae.search(P).map(j=>({...j,item:{...j.item,name:V+j.item.name}}))}else k=ae.search(D);c(t.map(k,"item"))},y=()=>{c([])},h=E=>E.name,f=E=>e.jsxRuntimeExports.jsx("div",{className:"rounded-md p-1",children:E.name}),N={autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"Enter class name",value:a,onKeyDown:E=>{E.key==="Enter"&&a.trim()!==""&&m()},onChange:(E,{newValue:D})=>d(D),className:"w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"};return e.jsxRuntimeExports.jsxs("div",{className:`no-scrollbar flex ${g.length>0?"min-h-[300px]":"min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,children:[e.jsxRuntimeExports.jsx(se.Label,{className:"mt-2",children:"Add Tailwind classes"}),e.jsxRuntimeExports.jsxs("div",{className:"relative -mt-4 flex items-center gap-x-3",children:[e.jsxRuntimeExports.jsx("div",{className:"relative flex w-full items-center gap-x-3",children:e.jsxRuntimeExports.jsx(Ie,{suggestions:g,onSuggestionsFetchRequested:b,onSuggestionsClearRequested:y,getSuggestionValue:h,renderSuggestion:f,inputProps:N,containerProps:{className:"relative h-8 w-full gap-y-1 py-1 border-gray-600"},theme:{suggestion:"bg-transparent",suggestionHighlighted:"bg-gray-700 ",suggestionsContainerOpen:"absolute bg-gray-100 z-50 max-h-[230px] overflow-y-auto w-full border border-gray-600 rounded-md"}})}),e.jsxRuntimeExports.jsx(v.Button,{variant:"outline",className:"h-6 border-gray-700",onClick:m,disabled:a.trim()==="",size:"sm",children:e.jsxRuntimeExports.jsx(p.PlusIcon,{})})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full flex-wrap gap-2",children:[t.isEmpty(l)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-10 w-full items-center justify-center text-center text-sm text-gray-400",children:"No class added"}),z.Children.toArray(l.map(E=>e.jsxRuntimeExports.jsxs("div",{className:"group relative flex cursor-default items-center gap-x-1 rounded-full border border-blue-600 bg-blue-500 p-px px-1.5 text-[11px] text-white hover:border-blue-900",children:[E,e.jsxRuntimeExports.jsx(p.Cross2Icon,{onClick:()=>n(i,[E]),className:"invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"})]},E)))]})]})}const B=["px","%","em","rem","ch","vh","vw"],Fe={heading:"Flex Child",items:[{type:"arbitrary",label:"Basis",units:B,property:"flexBasis"},{type:"range",label:"Order",property:"order"},{type:"dropdown",label:"Flex",property:"flexGrowShrink"},{type:"dropdown",label:"Grow",property:"flexGrow"},{type:"dropdown",label:"Shrink",property:"flexShrink"}]},Ye={heading:"Grid Child",items:[{type:"range",label:"Col Span",property:"gridColSpan"},{type:"range",label:"Col Start",property:"gridColStart"},{type:"range",label:"Col End",property:"gridColEnd"},{type:"range",label:"Row Span",property:"gridRowSpan"},{type:"range",label:"Row Start",property:"gridRowStart"},{type:"range",label:"Row End",property:"gridRowEnd"},{type:"range",label:"Order",property:"order"}]},Xe=[{heading:"Display",items:[{type:"dropdown",label:"Display",property:"display",units:B},{styleType:"accordion",heading:"Flex options",items:[{type:"dropdown",label:"Direction",property:"flexDirection"},{type:"dropdown",label:"Wrap",property:"flexWrap"},{type:"dropdown",label:"Justify",property:"justifyContent"},{type:"dropdown",label:"Content",property:"alignContent"},{type:"dropdown",label:"Items",property:"alignItems"},{styleType:"multiple",label:"Gap",options:[{key:"gap",label:"All"},{key:"gapX",label:"Left-Right"},{key:"gapY",label:"Top-Bottom"}]}],conditions:{display:"flex"}},{styleType:"accordion",heading:"Grid options",items:[{type:"range",label:"Columns",property:"gridColumns"},{type:"range",label:"Rows",property:"gridRows"},{type:"dropdown",label:"Auto Flow",property:"gridAutoFlow"},{type:"dropdown",label:"Auto Cols",property:"gridAutoColumns"},{type:"dropdown",label:"Auto Rows",property:"gridAutoRows"},{type:"dropdown",label:"Justify",property:"justifyContent"},{type:"dropdown",label:"Content",property:"alignContent"},{type:"dropdown",label:"Items",property:"alignItems"},{styleType:"multiple",label:"Gap",units:["px","rem"],options:[{key:"gap",label:"All"},{key:"gapX",label:"Left-Right"},{key:"gapY",label:"Top-Bottom"}]}],conditions:{display:"grid"}},{styleType:"accordion",heading:"Visibility & Opacity",items:[{type:"dropdown",label:"Visibility",property:"visibility",units:B},{type:"arbitrary",label:"Opacity",property:"opacity",units:["-"]}]}]},{heading:"Spacing",items:[{styleType:"multiple",label:"Margin",negative:!0,units:[...B,"auto"],options:[{key:"margin",label:"All"},{key:"marginX",label:"Left-Right"},{key:"marginY",label:"Top-Bottom"},{key:"marginTop",label:"Top"},{key:"marginRight",label:"Right"},{key:"marginBottom",label:"Bottom"},{key:"marginLeft",label:"Left"}]},{styleType:"multiple",label:"Padding",options:[{key:"padding",label:"All"},{key:"paddingX",label:"Left-Right"},{key:"paddingY",label:"Top-Bottom"},{key:"paddingTop",label:"Top"},{key:"paddingRight",label:"Right"},{key:"paddingBottom",label:"Bottom"},{key:"paddingLeft",label:"Left"}]},{styleType:"multiple",label:"Space Between",options:[{key:"spaceX",label:"Left-Right"},{key:"spaceY",label:"Top-Bottom"}]}]},{heading:"Size",items:[{type:"arbitrary",label:"Width",units:B.concat("auto"),property:"width"},{type:"arbitrary",label:"Height",units:B.concat("auto"),property:"height"},{styleType:"accordion",heading:"Min width & height",items:[{type:"arbitrary",label:"Min Width",units:B.concat("auto"),property:"minWidth"},{type:"arbitrary",label:"Min Height",units:B.concat("auto"),property:"minHeight"}]},{styleType:"accordion",heading:"Max width & height",items:[{type:"arbitrary",label:"Max Width",units:B.concat("auto"),property:"maxWidth"},{type:"arbitrary",label:"Max Height",units:B.concat("auto"),property:"maxHeight"}]},{styleType:"accordion",heading:"Object options & aspect ratio",items:[{type:"dropdown",label:"Aspect",property:"aspectRatio"},{type:"dropdown",label:"Fit",property:"objectFit"},{type:"dropdown",label:"Position",property:"objectPosition"}]}]},{heading:"Position",items:[{type:"icons",label:"Position",property:"position"},{styleType:"accordion",heading:"Position options",items:[{styleType:"multiple",label:"Direction",options:[{key:"top",label:"Top"},{key:"right",label:"Right"},{key:"bottom",label:"Bottom"},{key:"left",label:"Left"}]},{styleType:"multiple",label:"Inset",options:[{key:"inset",label:"All"},{key:"insetX",label:"Left Right"},{key:"insetY",label:"Top Bottom"}]},{type:"arbitrary",label:"Z-Chai",units:["-","auto"],property:"zIndex"}]},{styleType:"accordion",heading:"Float & Clear",items:[{type:"icons",label:"Float",property:"float"},{type:"dropdown",label:"Clear",property:"clear"}]},{styleType:"accordion",heading:"Overflow & Overscroll",items:[{styleType:"multiple",type:"dropdown",label:"Overflow",options:[{key:"overflow",label:"All"},{key:"overflowX",label:"Left-Right"},{key:"overflowY",label:"Top-Bottom"}]},{styleType:"multiple",type:"dropdown",label:"Overscroll",options:[{key:"overscroll",label:"All"},{key:"overscrollX",label:"Left-Right"},{key:"overscrollY",label:"Top-Bottom"}]}]}]},{heading:"Typography",items:[{type:"dropdown",property:"fontFamily",label:"Font"},{type:"arbitrary",property:"fontSize",label:"Size",units:B},{type:"arbitrary",property:"lineHeight",label:"Height",units:B.concat("-")},{type:"range",property:"fontWeight",label:"Weight"},{type:"color",property:"textColor",label:"Color"},{styleType:"accordion",heading:"Alignments",items:[{type:"dropdown",property:"textAlign",label:"Align"},{type:"dropdown",property:"verticalAlign",label:"V. Align"}]},{styleType:"accordion",heading:"Spacing, decoration & more",items:[{type:"dropdown",property:"letterSpacing",label:"Spacing"},{type:"dropdown",property:"textDecoration",label:"Decoration"},{type:"range",property:"textDecorationThickness",label:"Thickness"},{type:"dropdown",property:"textTransform",label:"Transform"}]},{styleType:"accordion",heading:"White space & breaks",items:[{type:"dropdown",property:"whitespace",label:"Whitespace"},{type:"dropdown",property:"wordBreak",label:"Wordbreak"}]}]},{heading:"Background",items:[{type:"color",label:"Bg. Color",property:"backgroundColor"},{styleType:"accordion",heading:"Position, Size & more",items:[{type:"dropdown",label:"Attachment",property:"backgroundAttachment"},{type:"dropdown",label:"Clipping",property:"backgroundClip"},{type:"dropdown",label:"Origin",property:"backgroundOrigin"},{type:"dropdown",label:"Position",property:"backgroundPosition"},{type:"dropdown",label:"Repeat",property:"backgroundRepeat"},{type:"dropdown",label:"Size",property:"backgroundSize"}]},{type:"dropdown",label:"Gradient",property:"backgroundGradient"},{styleType:"accordion",heading:"Gradient colors",items:[{type:"color",label:"From",property:"fromColor"},{type:"color",label:"Via",property:"viaColor"},{type:"color",label:"To",property:"toColor"}]}]},{heading:"Border & Outline",items:[{styleType:"multiple",type:"dropdown",label:"Width",options:[{key:"border",label:"All"},{key:"borderX",label:"Left Right"},{key:"borderY",label:"Top bottom"},{key:"borderTop",label:"Top"},{key:"borderRight",label:"Right"},{key:"borderBottom",label:"Bottom"},{key:"borderLeft",label:"Left"}]},{styleType:"multiple",type:"dropdown",label:"Corners",options:[{key:"borderRadius",label:"All"},{key:"borderRadiusTop",label:"Top"},{key:"borderRadiusRight",label:"Right"},{key:"borderRadiusBottom",label:"Bottom"},{key:"borderRadiusLeft",label:"Left"},{key:"borderRadiusTopLeft",label:"Top Left"},{key:"borderRadiusTopRight",label:"Top right"},{key:"borderRadiusBottomRight",label:"Bottom right"},{key:"borderRadiusBottomLeft",label:"Bottom left"}]},{type:"color",label:"Color",property:"borderColor"},{type:"dropdown",label:"Style",property:"borderStyle"},{styleType:"accordion",heading:"Divide options",items:[{styleType:"multiple",type:"range",label:"Width",options:[{key:"divideXWidth",label:"Left Right"},{key:"divideYWidth",label:"Top Bottom"}]},{type:"color",label:"Color",property:"divideColor"},{type:"dropdown",label:"Style",property:"divideStyle"}]},{styleType:"accordion",heading:"Outline styling",items:[{type:"range",label:"Width",property:"outlineWidth"},{type:"range",label:"Offset",property:"outlineOffset"},{type:"dropdown",label:"Style",property:"outlineStyle"}]},{styleType:"accordion",heading:"Ring options",items:[{type:"range",label:"Width",property:"ringWidth"},{type:"color",label:"Color",property:"ringColor"},{type:"range",label:"Offset",property:"ringOffsetWidth"},{type:"color",label:"Off. color",property:"ringOffsetColor"}]}]},{heading:"Effect & Animation",items:[{type:"range",label:"Shadow",property:"boxShadow"},{type:"color",label:"Color",property:"boxShadowColor"},{type:"dropdown",label:"Cursor",property:"cursor"},{styleType:"accordion",heading:"Blend & Cursor",items:[{type:"dropdown",label:"Mix Blend",property:"mixBlendMode"},{type:"dropdown",label:"Bg. Blend",property:"bgBlendMode"}]},{styleType:"accordion",heading:"Transform",items:[{type:"dropdown",label:"Origin",property:"transformOrigin"},{styleType:"multiple",label:"Scale",units:["-"],options:[{key:"scale",label:"All"},{key:"scaleX",label:"Left-Right"},{key:"scaleY",label:"Top-Bottom"}]},{styleType:"multiple",label:"Skew",units:["deg"],options:[{key:"skewX",label:"Left-Right"},{key:"skewY",label:"Top-Bottom"}]},{styleType:"multiple",label:"Translate",negative:!0,options:[{key:"translateX",label:"Left-Right"},{key:"translateY",label:"Top-Bottom"}]},{type:"arbitrary",units:["deg"],negative:!0,label:"Rotate",property:"rotate"}]},{styleType:"accordion",heading:"Animation",items:[{type:"dropdown",label:"Animation",property:"animation"},{type:"dropdown",label:"Transition",property:"transition"},{type:"dropdown",label:"Easing",property:"transitionEase"},{type:"arbitrary",units:["ms"],label:"Duration",property:"duration"},{type:"arbitrary",units:["ms"],label:"Delay",property:"delay"}]}]},{heading:"Classes",items:[{component:We}]}],me={"not-italic":()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z",fill:"white"})}),visible:p.EyeOpenIcon,invisible:p.EyeClosedIcon,hidden:p.EyeClosedIcon,gap:p.BorderAllIcon,gapX:p.WidthIcon,gapY:p.HeightIcon,spaceX:p.WidthIcon,spaceY:p.HeightIcon,overscroll:p.BorderAllIcon,overscrollX:p.WidthIcon,overscrollY:p.HeightIcon,overflow:p.BorderAllIcon,overflowX:p.WidthIcon,overflowY:p.HeightIcon,top:p.ArrowUpIcon,right:p.ArrowRightIcon,bottom:p.ArrowDownIcon,left:p.ArrowLeftIcon,inset:p.BorderAllIcon,insetX:p.WidthIcon,insetY:p.HeightIcon,border:p.BorderAllIcon,borderX:p.WidthIcon,borderY:p.HeightIcon,borderTop:p.ArrowUpIcon,borderRight:p.ArrowRightIcon,borderBottom:p.ArrowDownIcon,borderLeft:p.ArrowLeftIcon,borderRadius:p.BorderAllIcon,borderRadiusX:p.WidthIcon,borderRadiusY:p.HeightIcon,borderRadiusTop:p.ArrowUpIcon,borderRadiusRight:p.ArrowRightIcon,borderRadiusBottom:p.ArrowDownIcon,borderRadiusLeft:p.ArrowLeftIcon,borderRadiusTopLeft:p.ArrowTopLeftIcon,borderRadiusTopRight:p.ArrowTopRightIcon,borderRadiusBottomRight:p.ArrowBottomRightIcon,borderRadiusBottomLeft:p.ArrowBottomLeftIcon,divideXWidth:p.WidthIcon,divideYWidth:p.HeightIcon,scale:p.BorderAllIcon,scaleX:p.WidthIcon,scaleY:p.HeightIcon,skewX:p.WidthIcon,skewY:p.HeightIcon,translateX:p.WidthIcon,translateY:p.HeightIcon,padding:p.BorderAllIcon,paddingX:p.WidthIcon,paddingY:p.HeightIcon,paddingTop:p.ArrowUpIcon,paddingRight:p.ArrowRightIcon,paddingBottom:p.ArrowDownIcon,paddingLeft:p.ArrowLeftIcon,margin:p.BorderAllIcon,marginX:p.WidthIcon,marginY:p.HeightIcon,marginTop:p.ArrowUpIcon,marginRight:p.ArrowRightIcon,marginBottom:p.ArrowDownIcon,marginLeft:p.ArrowLeftIcon,textLeft:p.AlignLeftIcon,textCenter:p.AlignCenterHorizontallyIcon,textRight:p.AlignRightIcon,textJustify:p.StretchHorizontallyIcon,italic:p.FontItalicIcon,underline:p.UnderlineIcon,overline:p.OverlineIcon,uppercase:p.LetterCaseUppercaseIcon,block:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M2 2H14V14H2V2ZM1 1H15V15H1V1Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4H4V12H7V4ZM9 4H12V12H9V4Z",fill:"currentColor"})]}),"float-right":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M8 4H16V12H8V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M0 4H6V6H0V4ZM0 7H6V9H0V7ZM4 10H0V12H4V10Z",fill:"currentColor"})]}),"float-left":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M0 4H8V12H0V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M10 4H16V6H10V4ZM10 7H16V9H10V7ZM14 10H10V12H14V10Z",fill:"currentColor"})]}),"float-none":p.Cross2Icon,fixed:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M15 2H14V4H13V5H14V6H15V2ZM10 5V4H9V2H1V8H2V5H10ZM7 4V3H5V4H7ZM4 4V3H2V4H4ZM1 13H7V14H1V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),absolute:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M14 2H15V6H14V2ZM9 3V2H1V8H2V3H9ZM7 13H1V14H7V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),relative:()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H9V3H11V6H12V3H14V2H11ZM2 8H1V13H2V11H7V10H2V8ZM15 7H8V14H15V7Z",fill:"currentColor"})}),sticky:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M12.9998 7C13.6558 7 14.2937 6.78498 14.8158 6.38787C15.338 5.99076 15.7156 5.43345 15.8908 4.80128C16.066 4.16912 16.0292 3.49694 15.7859 2.8877C15.5427 2.27846 15.1065 1.76573 14.5441 1.42804C13.9817 1.09034 13.3241 0.946293 12.672 1.01795C12.02 1.08961 11.4094 1.37303 10.9337 1.8248C10.4581 2.27658 10.1436 2.8718 10.0385 3.51932C9.93341 4.16685 10.0434 4.83097 10.3518 5.41L6.88176 8.88C6.80034 8.96122 6.73572 9.05769 6.69158 9.16388C6.64744 9.27008 6.62465 9.38393 6.62451 9.49894C6.62437 9.61395 6.64689 9.72785 6.69077 9.83416C6.73465 9.94046 6.79904 10.0371 6.88026 10.1185C6.96149 10.1999 7.05795 10.2645 7.16415 10.3087C7.27035 10.3528 7.3842 10.3756 7.4992 10.3758C7.61421 10.3759 7.72812 10.3534 7.83442 10.3095C7.94072 10.2656 8.03734 10.2012 8.11876 10.12L11.5888 6.648C12.0088 6.873 12.4888 7 12.9988 7H12.9998Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M9.535 2H1V14H15V7.465C14.69 7.645 14.355 7.783 14 7.875V13H2V5H9.126C8.86504 3.98486 9.01223 2.90789 9.536 2H9.535ZM7 3V4H5V3H7ZM4 3V4H2V3H4Z",fill:"currentColor"})]}),static:p.Cross1Icon},W=x.createContext({canReset:!1,canChange:!0}),ze=({children:s,canReset:o=!1,canChange:r=!0})=>e.jsxRuntimeExports.jsx(W.Provider,{value:{canReset:o,canChange:r},children:s}),ge=({label:s,property:o,onChange:r})=>{const n=x.useMemo(()=>t.get(q.CLASSES_LIST,`${o}.classes`,[""]),[o]),i=F(o),a=x.useMemo(()=>t.get(i,"cls",""),[i]),{canChange:d}=x.useContext(W),u=/\[.*\]/g.test(a);return e.jsxRuntimeExports.jsx("div",{className:s?"w-full rounded ":"grow",children:u?e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx($.Input,{className:"w-[70%] rounded py-1",readOnly:!0,value:a}),e.jsxRuntimeExports.jsxs(v.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(v.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(p.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(v.TooltipContent,{children:"Current value is using a Tailwind arbitrary value."})]})]}):e.jsxRuntimeExports.jsx(ee,{rounded:s,onChange:l=>r(l,o),selected:a,options:n,disabled:!d})})};function ee({selected:s,onChange:o,rounded:r=!1,options:n,disabled:i=!1}){const a=s.replace(/.*:/g,"").trim(),{undo:d,redo:u}=w.useCanvasHistory();return e.jsxRuntimeExports.jsxs("select",{disabled:!n.length||i,className:`${r?"rounded-md border border-border":"border-0"} w-full disable:bg-gray-500 h-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,onChange:l=>o(l.target.value),onKeyDown:l=>{l.ctrlKey&&(l.key==="z"&&d(),l.key==="y"&&u())},value:a,children:[e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:""}),x.Children.toArray(n.map(l=>e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:l,children:l})))]})}const Ze=({property:s,onChange:o})=>{const{canReset:r,canChange:n}=x.useContext(W),i=F(s),a=x.useMemo(()=>t.get(i,"cls",""),[i]),d=x.useMemo(()=>t.get(q.CLASSES_LIST,`${s}.classes`,[""]),[s]),u=d.indexOf(a)>-1?d.indexOf(a):0,l=/\[.*\]/g.test(a);return e.jsxRuntimeExports.jsx("div",{className:"flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs",children:l?e.jsxRuntimeExports.jsx("div",{className:"py-[5px] px-2",children:a}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("button",{type:"button",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",disabled:!n&&(!r||u-1<0),onClick:()=>o(t.nth(d,u-1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(p.MinusIcon,{className:!n&&(!r||u-1<0)?"text-gray-500":"text-white/60"})})}),e.jsxRuntimeExports.jsx("div",{className:"w-8/12 text-center",children:e.jsxRuntimeExports.jsx(ge,{label:!1,property:s,onChange:o})}),e.jsxRuntimeExports.jsx("button",{type:"button",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",disabled:!n&&(!r||u+1>=d.length),onClick:()=>o(t.nth(d,u+1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(p.PlusIcon,{className:!n&&(!r||u+1>=d.length)?"text-gray-500":"text-white/60"})})})]})})},Ue=({property:s,onChange:o})=>{const r=x.useMemo(()=>t.get(q.CLASSES_LIST,`${s}.classes`,[""]),[s]),{canChange:n}=x.useContext(W),i=F(s),a=x.useMemo(()=>t.get(i,"cls",""),[i]);return e.jsxRuntimeExports.jsx("div",{className:"flex grow flex-wrap gap-1",children:t.map(r,d=>e.jsxRuntimeExports.jsxs(v.Tooltip,{children:[e.jsxRuntimeExports.jsx(v.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",disabled:!n,onClick:()=>o(d,s),className:`cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${a===d?" bg-blue-500 text-white":"disabled:bg-gray-600 disabled:text-gray-400"}`,children:x.createElement(t.get(me,d,p.BoxIcon))})}),e.jsxRuntimeExports.jsx(v.TooltipContent,{children:t.startCase(t.toLower(d))})]}))})},Ge={backgroundColor:"bg",textColor:"text",borderColor:"border",boxShadowColor:"shadow",outlineColor:"outline",divideColor:"divide",fromColor:"from",viaColor:"via",toColor:"to",ringColor:"ring",ringOffsetColor:"ring-offset"},Ke=({property:s,onChange:o})=>{const r=F(s),n=x.useMemo(()=>t.get(r,"cls",""),[r]),{canChange:i}=x.useContext(W),[a,d]=x.useState([]),[u,l]=x.useState({color:"",shade:""}),m=n.split("-"),g=t.get(m,"1",""),c=t.get(m,"2",""),b=x.useCallback(h=>{["current","inherit","transparent","black","white"].includes(h)?(d([]),l({color:h})):(d(["50","100","200","300","400","500","600","700","800","900"]),l(f=>({...f,color:h,shade:f.shade?f.shade:"500"})))},[d,l]);x.useEffect(()=>{if(["current","inherit","transparent","black","white"].includes(g))return d([]);d(["50","100","200","300","400","500","600","700","800","900"])},[g]);const y=x.useCallback(h=>{l({color:g,shade:h})},[g]);return x.useEffect(()=>{l({color:"",shade:""})},[r]),x.useEffect(()=>{const f=`${t.get(Ge,s,"")}-${u.color}${u.shade?`-${u.shade}`:""}`;f.match(new RegExp(t.get(q.CLASSES_LIST,`${s}.regExp`,"")))&&o(f,s)},[u,o,s]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs",children:[e.jsxRuntimeExports.jsx("div",{className:"grow text-center",children:e.jsxRuntimeExports.jsx(ee,{disabled:!i,rounded:!0,selected:g,onChange:b,options:["current","transparent","primary","secondary","black","white","slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"grow text-center",children:e.jsxRuntimeExports.jsx(ee,{rounded:!0,selected:c,disabled:!g||!i,onChange:y,options:a})})]})},ue=(s,o)=>{s=s.toLowerCase();let r=s.trim().replace(/ |\+/g,"");if((r==="auto"||r==="none")&&o.includes(r))return{value:"",unit:r};const n=o.length?new RegExp(o.join("|"),"g"):/XXXXXX/g;r=r.replace(n,"");const i=s.match(n),a=i&&i.length>1,d=!t.isEmpty(r)&&Number.isNaN(Number(r));return a||d?{error:"Invalid value"}:i&&(i[0]==="auto"||i[0]==="none")?{value:i[0],unit:""}:{value:r,unit:i?i[0]:""}},Je=s=>{const o=s.startsWith("-")?"-":"",r=s.split("-").pop();if(["auto","none"].includes(r))return{value:"",unit:r};if(r==="px")return{value:"1",unit:"px"};if(r==="screen")return{value:"100",unit:s.indexOf("w-")!==-1?"vw":"vh"};if(r==="full")return{value:"100",unit:"%"};if(t.includes(s,"skew-"))return{value:`${o}${r}`,unit:"deg"};if(t.includes(s,"rotate-"))return{value:`${o}${r}`,unit:"deg"};if(t.includes(s,"opacity-"))return{value:`${r/100}`,unit:"-"};if(t.includes(s,"duration-")||t.includes(s,"delay-"))return{value:`${r}`,unit:"ms"};if(t.includes(s,"translate-")&&!r.includes("/"))return{value:`${o}${`${r/4}`}`,unit:"rem"};if(t.includes(s,"scale-"))return{value:`${o}${`${r/100}`}`,unit:"-"};if(t.startsWith(s,"border")){const n=s.match(/border-?(x|y|t|r|b|l)?\d+/g);if(n)return{value:n[0].split("-").pop(),unit:"px"};if(s.match(/border-?(x|y|t|r|b|l)?/g))return{value:"1",unit:"px"}}if(t.startsWith(s,"max-w-")){if(s==="max-w-screen-sm")return{value:"640",unit:"px"};if(s==="max-w-screen-md")return{value:"768",unit:"px"};if(s==="max-w-screen-lg")return{value:"1024",unit:"px"};if(s==="max-w-screen-xl")return{value:"1280",unit:"px"};if(s==="max-w-screen-2xl")return{value:"1536",unit:"px"};if(r==="xs")return{value:"320",unit:"px"};if(r==="sm")return{value:"384",unit:"px"};if(r==="md")return{value:"448",unit:"px"};if(r==="lg")return{value:"512",unit:"px"};if(r==="xl")return{value:"576",unit:"px"};if(r==="2xl")return{value:"672",unit:"px"};if(r==="3xl")return{value:"768",unit:"px"};if(r==="4xl")return{value:"896",unit:"px"};if(r==="5xl")return{value:"1024",unit:"px"};if(r==="6xl")return{value:"1152",unit:"px"};if(r==="7xl")return{value:"1280",unit:"px"};if(r==="prose")return{value:"65",unit:"ch"}}if(t.startsWith(s,"text-")){if(r==="xs")return{value:"12",unit:"px"};if(r==="sm")return{value:"14",unit:"px"};if(r==="base")return{value:"16",unit:"px"};if(r==="lg")return{value:"18",unit:"px"};if(r==="xl")return{value:"20",unit:"px"};if(r==="2xl")return{value:"24",unit:"px"};if(r==="3xl")return{value:"30",unit:"px"};if(r==="4xl")return{value:"36",unit:"px"};if(r==="5xl")return{value:"48",unit:"px"};if(r==="6xl")return{value:"60",unit:"px"};if(r==="7xl")return{value:"72",unit:"px"};if(r==="8xl")return{value:"96",unit:"px"};if(r==="9xl")return{value:"128",unit:"px"}}if(t.startsWith(s,"leading-")){if(r==="none")return{value:"1",unit:"-"};if(r==="tight")return{value:"1.25",unit:"-"};if(r==="snug")return{value:"1.375",unit:"-"};if(r==="normal")return{value:"1.5",unit:"-"};if(r==="relaxed")return{value:"1.625",unit:"-"};if(r==="loose")return{value:"2",unit:"-"}}if(t.startsWith(s,"tracking-")){if(r==="tighter")return{value:"-0.05",unit:"em"};if(r==="tight")return{value:"-0.025",unit:"em"};if(r==="normal")return{value:"0",unit:"em"};if(r==="wide")return{value:"0.025",unit:"em"};if(r==="wider")return{value:"0.05",unit:"em"};if(r==="widest")return{value:"0.1",unit:"em"}}if(["max","min","fit"].includes(r))return{value:s,unit:"class"};if(r.includes("/")){const[n,i]=t.map(r.split("/"),a=>parseInt(a,10));return{value:o+(n/i*100).toFixed(2).replace(".00",""),unit:"%"}}return t.isNumber(parseFloat(r))?{value:`${o+parseFloat(r)*4}`,unit:"px"}:{value:r,unit:"class"}},Qe=s=>{if(t.isEmpty(s))return{value:"",unit:""};const o=s.match(/\[.*\]/g);if(o===null)return et(s);const r=t.get(o,"0","").replace(/\[|\]/g,""),n=s.startsWith("-")?"-":"",i=t.first(r.match(/\d+.\d+|\d+/g));return{value:`${n}${i}`,unit:r.replace(i,"")}},et=s=>t.isEmpty(s)?{value:"",unit:""}:Je(s),he=x.createContext({setDragData:()=>{}}),tt=({unit:s,currentValue:o,onDrag:r,onDragEnd:n,onDragStart:i,negative:a,cssProperty:d})=>{const{setDragData:u}=x.useContext(he);return e.jsxRuntimeExports.jsx("button",{type:"button",onMouseDown:l=>{const m={onDrag:r,onDragEnd:n,dragging:!0,dragStartY:l.pageY,dragStartValue:`${o}`,dragUnit:s,negative:a,cssProperty:d};i(m),u(m)},color:void 0,className:"relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",children:e.jsxRuntimeExports.jsx(p.RowSpacingIcon,{})})},st=({onSelect:s,current:o,units:r})=>e.jsxRuntimeExports.jsx("div",{"data-theme":"light",className:"-m-[7px] -mx-[13px] flex w-9 flex-col",children:r.map(n=>e.jsxRuntimeExports.jsx(v.Button,{className:"h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",color:o===n?"primary":void 0,size:"sm",onClick:i=>{i.stopPropagation(),s(n)},children:n},n))}),rt=s=>{const[o,r]=x.useState(!1),[n,i]=x.useState(""),{currentClass:a,onChange:d,classPrefix:u,cssProperty:l,units:m,negative:g}=s,[c,b]=x.useState(l!=null&&l.toLowerCase().includes("width")?"%":m[0]),[y,h]=x.useState(!1),[f,N]=x.useState(""),[A,E]=x.useState(!1),[D,H]=x.useState(!1);x.useEffect(()=>{const{value:j,unit:R}=Qe(a);if(R===""){i(j),b(l!=null&&l.toLowerCase().includes("width")?"%":m[0]);return}b(R),i(R==="class"||t.isEmpty(j)?"":j)},[a,l,m]);const k=K.useThrottledCallback(j=>{d(j)},[d],200),V=K.useThrottledCallback(j=>{d(j,!1)},[d],200),P=x.useCallback((j=!1)=>{const R=ue(`${n}`,m);if(t.get(R,"error",!1)){h(!0);return}const S=t.get(R,"unit")!==""?t.get(R,"unit"):c;if(S==="auto"||S==="none"){k(`${u}${S}`);return}if(t.get(R,"value")==="")return;const _=`${t.get(R,"value","").startsWith("-")?"-":""}${u}[${t.get(R,"value","").replace("-","")}${S==="-"?"":S}]`;j?V(_):k(_)},[k,V,n,c,u,m]),Y=x.useCallback(j=>{const R=ue(`${n}`,m);if(t.get(R,"error",!1)){h(!0);return}if(j==="auto"||j==="none"){k(`${u}${j}`);return}if(t.get(R,"value")==="")return;const S=t.get(R,"unit")!==""?t.get(R,"unit"):j,_=`${t.get(R,"value","").startsWith("-")?"-":""}${u}[${t.get(R,"value","").replace("-","")}${S==="-"?"":S}]`;k(_)},[k,n,u,m]);return e.jsxRuntimeExports.jsx("div",{className:"flex w-full flex-col",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-start",children:c==="class"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("input",{className:"w-20 rounded py-1",readOnly:!0,value:a}),e.jsxRuntimeExports.jsxs(v.Tooltip,{children:[e.jsxRuntimeExports.jsx(v.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(p.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(v.TooltipContent,{children:"Current value is using a Tailwind preset class."})]})]}):e.jsxRuntimeExports.jsxs("div",{className:`group relative flex items-center ${A?"z-auto":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md border border-border",children:[["none","auto"].indexOf(c)!==-1?null:e.jsxRuntimeExports.jsx("input",{readOnly:c==="class",onKeyPress:j=>{j.key==="Enter"&&P()},onKeyDown:j=>{if(j.keyCode!==38&&j.keyCode!==40)return;j.preventDefault(),H(!0);const R=t.parseInt(j.target.value);let S=t.isNaN(R)?0:R;j.keyCode===38&&(S+=1),j.keyCode===40&&(S-=1);const L=`${S}`,be=`${L.startsWith("-")?"-":""}${u}[${L.replace("-","")}${c==="-"?"":c}]`;V(be)},onKeyUp:j=>{D&&(j.preventDefault(),H(!1))},onBlur:()=>P(),onChange:j=>{h(!1),i(j.target.value)},onClick:j=>{var R;(R=j==null?void 0:j.target)==null||R.select(),r(!1)},value:A?f:n,className:"h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(" ",y?"border-red-500 text-red-500":"border-foreground/20")}),e.jsxRuntimeExports.jsxs(v.Tooltip,{open:o,delayDuration:100,children:[e.jsxRuntimeExports.jsx(v.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>r(!o),className:"flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",children:[e.jsxRuntimeExports.jsx("span",{className:`inline-block ${m.length===1?"px-2 font-semibold":""}`,children:c}),m.length>1?e.jsxRuntimeExports.jsx(p.TriangleDownIcon,{}):null]})}),e.jsxRuntimeExports.jsx(v.TooltipPortal,{children:e.jsxRuntimeExports.jsx(v.TooltipContent,{className:"bg-background",children:e.jsxRuntimeExports.jsx(st,{units:m,current:c,onSelect:j=>{r(!1),b(j),Y(j)}})})})]})]}),["none","auto"].indexOf(c)!==-1||A?null:e.jsxRuntimeExports.jsx(tt,{onDragStart:()=>E(!0),onDragEnd:j=>{if(N(()=>""),E(!1),t.isEmpty(j))return;const R=`${j}`,L=`${R.startsWith("-")?"-":""}${u}[${R.replace("-","")}${c==="-"?"":c}]`;k(L)},onDrag:j=>{if(t.isEmpty(j))return;N(j);const R=`${j}`,L=`${R.startsWith("-")?"-":""}${u}[${R.replace("-","")}${c==="-"?"":c}]`;V(L)},currentValue:n,unit:c,negative:g,cssProperty:l})]})})})},F=s=>{const o=I.useSelectedBlockCurrentClasses();return t.findLast(o,{property:s})},ot=(s,o)=>{const r={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5};return r[t.get(s,"mq","xs")]<=r[o]},nt={width:"w-",height:"h-",minWidth:"min-w-",minHeight:"min-h-",maxWidth:"max-w-",maxHeight:"max-h-",zIndex:"z-",gap:"gap-",gapX:"gap-x-",gapY:"gap-y-",margin:"m-",marginX:"mx-",marginY:"my-",marginTop:"mt-",marginBottom:"mb-",marginLeft:"ml-",marginRight:"mr-",padding:"p-",paddingX:"px-",paddingY:"py-",paddingTop:"pt-",paddingBottom:"pb-",paddingLeft:"pl-",paddingRight:"pr-",spaceX:"space-x-",spaceY:"space-y-",border:"border-",borderTop:"border-t-",borderBottom:"border-b-",borderLeft:"border-l-",borderRight:"border-r-",borderX:"border-x-",borderY:"border-y-",borderRadius:"rounded-",borderRadiusTop:"rounded-t-",borderRadiusRight:"rounded-r-",borderRadiusBottom:"rounded-b-",borderRadiusLeft:"rounded-l-",borderRadiusTopLeft:"rounded-tl-",borderRadiusTopRight:"rounded-tr-",borderRadiusBottomRight:"rounded-br-",borderRadiusBottomLeft:"rounded-bl-",fontSize:"text-",lineHeight:"leading-",letterSpacing:"tracking-",textIndent:"indent-",rotate:"rotate-",duration:"duration-",transitionDelay:"delay-",scale:"scale-",scaleX:"scale-x-",scaleY:"scale-y-",translateX:"translate-x-",translateY:"translate-y-",skewX:"skew-x-",skewY:"skew-y-",top:"top-",bottom:"bottom-",left:"left-",right:"right-",inset:"inset-",insetX:"inset-x-",insetY:"inset-y-",opacity:"opacity-",flexBasis:"basis-"},pe={xs:"",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},it=s=>`${s.toUpperCase()} ${pe[s]?`(${pe[s]} & up)`:""}`,re=s=>{const{type:o="icons",label:r,property:n,onEmitChange:i=()=>{},units:a,negative:d=!1}=s,[u]=U.useDarkMode(),[l]=I.useStylingState(),[,m]=U.useCanvasWidth(),g=F(n),c=I.useAddClassesToBlocks(),b=I.useRemoveClassesFromBlocks(),[y]=w.useSelectedBlockIds(),h=x.useMemo(()=>t.get(g,"fullCls",""),[g]),f=x.useCallback((k,V=!0)=>{const P={dark:u,mq:m,mod:l,cls:k,property:n,fullCls:""};(u||l!=="")&&(P.mq="xs");const Y=q.generateFullClsName(P);c(y,[Y],V)},[y,u,m,l,n,c]),N=x.useCallback(()=>{b(y,[h])},[y,h,b]),A=x.useMemo(()=>ot(g,m),[g,m]);x.useEffect(()=>{i(A,g)},[A,i,g]);const[,,E]=U.useCanvasWidth(),D=x.useCallback(k=>{E({xs:400,sm:640,md:800,lg:1024,xl:1420,"2xl":1920}[k])},[E]),H=t.get(g,"dark",null)===u&&t.get(g,"mod",null)===l&&t.get(g,"mq",null)===m;return e.jsxRuntimeExports.jsx(ze,{canChange:A,canReset:g&&H,children:e.jsxRuntimeExports.jsxs("div",{className:"group flex flex-row items-center py-2 first:pt-0 last:pb-0",children:[e.jsxRuntimeExports.jsx("div",{className:"relative w-[70px] truncate text-xs text-foreground",children:e.jsxRuntimeExports.jsx("span",{className:`text-[11px] ${g&&!H?"text-foreground":""}`,children:r})}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row items-center",children:[e.jsxRuntimeExports.jsxs("div",{className:"w-[150px]",children:[o==="arbitrary"?e.jsxRuntimeExports.jsx(rt,{currentClass:t.get(g,"cls",""),classPrefix:t.get(nt,n,""),units:a||[],onChange:f,negative:d,cssProperty:n}):null,o==="icons"&&e.jsxRuntimeExports.jsx(Ue,{property:n,onChange:f}),o==="range"&&e.jsxRuntimeExports.jsx(Ze,{property:n,onChange:f}),o==="color"&&e.jsxRuntimeExports.jsx(Ke,{property:n,onChange:f}),o==="dropdown"&&e.jsxRuntimeExports.jsx(ge,{label:r,property:n,onChange:f})]}),e.jsxRuntimeExports.jsx("div",{className:`w-[30px] cursor-pointer ${h?"visible":"invisible"}`,children:H?e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>N(),title:"Reset",className:"flex px-1.5 text-xs",children:e.jsxRuntimeExports.jsx(p.TrashIcon,{className:"h-5 w-5 text-blue-500 hover:opacity-80"})}):A&&g?e.jsxRuntimeExports.jsxs(v.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(v.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",children:e.jsxRuntimeExports.jsx(p.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(v.TooltipContent,{children:e.jsxRuntimeExports.jsx("div",{className:"text-right",children:e.jsxRuntimeExports.jsxs("div",{children:["Current style is set at  ",e.jsxRuntimeExports.jsxs("span",{className:"font-bold ",children:[it(t.get(g,"mq")),u&&!g.dark?"(Light mode)":""]}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>D(t.get(g,"mq")),className:"block w-full cursor-default text-right font-semibold text-blue-500",children:["Switch to ",t.get(g,"mq").toUpperCase()]})]})})})]}):null})]})]})})},lt=["px","%","em","rem","ch","vh","vw"],ye=({label:s,options:o,borderB:r=!1,borderT:n=!1,type:i="arbitrary",units:a=lt,negative:d=!1})=>{const[u,l]=x.useState(o[0].key),m=I.useSelectedBlockCurrentClasses(),g=x.useCallback(c=>t.map(m,"property").includes(c),[m]);return e.jsxRuntimeExports.jsxs("div",{className:`mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${r?"border-b":""} ${n?"border-t":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row text-xs",children:[s&&e.jsxRuntimeExports.jsx("span",{className:"relative w-[70px] flex-none text-xs text-foreground",children:s}),e.jsxRuntimeExports.jsx("div",{className:"mb-3 flex grow flex-row flex-wrap gap-x-px",children:x.Children.toArray(o.map(({label:c,key:b})=>e.jsxRuntimeExports.jsx("div",{className:"first:rounded-l last:rounded-r",children:e.jsxRuntimeExports.jsxs(v.Tooltip,{children:[e.jsxRuntimeExports.jsx(v.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>l(b),className:`relative cursor-pointer rounded-full p-1 text-[8px] ${b===u?" bg-[#3E57F0] text-white":"text-gray-600 dark:text-gray-300"}`,children:[x.createElement("div",{className:g(b)?"-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full":""}),x.createElement(t.get(me,b,p.BoxIcon),{className:"text-inherit w-3 h-3"})]})}),e.jsxRuntimeExports.jsx(v.TooltipContent,{children:t.startCase(t.toLower(c))})]})})))})]}),e.jsxRuntimeExports.jsx("div",{className:"mt-0 flex items-center",children:e.jsxRuntimeExports.jsx(re,{type:i,units:[...a],label:"",property:u,negative:d})})]})},at=({heading:s,items:o})=>{const r=I.useSelectedBlockCurrentClasses(),n=x.useMemo(()=>{const i=u=>t.flatten(u.map(l=>l.styleType==="multiple"?t.map(l.options,"key"):l.property)),a=t.flatten(o.map(u=>u.styleType==="accordion"?i(u.items):u.styleType==="multiple"?t.map(u.options,"key"):u.property)),d=t.map(r,"property");return t.intersection(a,d).length>0},[r,o]);return e.jsxRuntimeExports.jsxs("details",{children:[e.jsxRuntimeExports.jsx("summary",{className:"my-px cursor-default rounded-md bg-background p-px px-2 text-[11px] text-foreground",children:e.jsxRuntimeExports.jsxs("div",{className:"inline",children:[s,n?e.jsxRuntimeExports.jsx("span",{className:`ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${n?"bg-blue-500":"bg-gray-300"}`}):null]})}),e.jsxRuntimeExports.jsx("div",{className:"p-2",children:o.map(i=>i.styleType==="multiple"?e.jsxRuntimeExports.jsx(ye,{...i},i.label):e.jsxRuntimeExports.jsx(re,{...i},i.label))})]})},ut=x.createContext({}),G=({section:s})=>{const o=I.useSelectedBlockCurrentClasses(),r=x.useCallback((a=[])=>{const d={};for(let l=0;l<o.length;l++)d[o[l].property]=o[l].cls;let u=!0;for(const l in a)if(!t.has(d,l)||d[l]!==a[l]){u=!1;break}return u},[o]),n=x.useMemo(()=>{if(o.length>0&&s.heading==="Classes")return!0;const a=l=>t.flatten(l.map(m=>m.styleType==="multiple"?t.flatten(t.map(m.options,"key")):m.property)),d=t.flatten(s.items.map(l=>l.styleType==="accordion"?a(l.items):l.styleType==="multiple"?t.flatten(t.map(l.options,"key")):l.property)),u=t.map(o,"property");return t.intersection(d,u).length>0},[o,s.heading,s.items]),i=x.useMemo(()=>({}),[]);return e.jsxRuntimeExports.jsx(ut.Provider,{value:i,children:e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:s.heading,children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${n?"bg-blue-500":"bg-gray-300"}`}),s.heading]})}),e.jsxRuntimeExports.jsx(T.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:x.Children.toArray(s.items.map(a=>t.has(a,"component")?x.createElement(a.component,{key:a.label}):t.has(a,"styleType")?a.styleType==="multiple"?e.jsxRuntimeExports.jsx(ye,{...a},a.label):a.styleType==="accordion"&&r(a==null?void 0:a.conditions)?e.jsxRuntimeExports.jsx(at,{...a},a.label):null:e.jsxRuntimeExports.jsx(re,{...a},a.label)))})]})})},pt=({item:s,index:o,canDelete:r,onChange:n,onRemove:i})=>e.jsxRuntimeExports.jsxs("div",{className:`flex flex-col gap-1 border-gray-400 py-2 ${r?"border-b":""}`,children:[e.jsxRuntimeExports.jsx("input",{name:"key",onChange:a=>n(a,o),value:s.key,placeholder:"Key",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1.5",children:[e.jsxRuntimeExports.jsx("input",{name:"value",onChange:a=>t.isEmpty(s.key)?{}:n(a,o),value:s.value,placeholder:"Value",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsx(p.TrashIcon,{onClick:i,className:"h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"})]})]}),dt=({section:s})=>{var b;const{setSyncState:o}=w.useSavePage(),r=w.useSelectedBlock(),[n,i]=x.useState([]),[a]=w.useSelectedStylingBlocks(),d=I.useUpdateBlocksPropsRealtime(),u=`${t.get(a,"0.prop")}_attrs`;z.useEffect(()=>{const y=t.map(t.get(r,u),(h,f)=>({key:f,value:h}));t.isEmpty(y)?i([]):i(y)},[t.get(r,u)]);const l=()=>i([...n,{key:"",value:""}]),m=y=>{const h=t.filter(n,(f,N)=>y!==N);c(h)},g=(y,h)=>{const f=[...n];f[h][y.target.name]=y.target.value,c(f)},c=z.useCallback((y=[])=>{const h={};t.forEach(y,f=>{t.isEmpty(f.key)||t.set(h,f.key,f.value)}),d([t.get(r,"_id")],{[u]:h}),o("UNSAVED")},[r,o,d,u]);return e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:s.heading,children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(r,u))?"bg-gray-300":"bg-blue-500"}`}),"Attributes"]})}),e.jsxRuntimeExports.jsx(T.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:e.jsxRuntimeExports.jsxs("div",{className:"no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsxs(se.Label,{className:"mt-2 flex w-full items-center justify-between",children:["Add Custom attributes",e.jsxRuntimeExports.jsxs("div",{className:`flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!t.isEmpty(n)&&t.isEmpty((b=t.last(n))==null?void 0:b.key)?"cursor-not-allowed border-gray-400 text-gray-400":"cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,onClick:()=>{var y;!t.isEmpty(n)&&t.isEmpty((y=t.last(n))==null?void 0:y.key)||l()},children:[e.jsxRuntimeExports.jsx(p.PlusIcon,{width:12,height:12})," Add"]})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[t.isEmpty(n)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-12 items-center justify-center text-sm text-gray-400",children:"Click + Add to add attributes"}),z.Children.toArray(t.map(n,(y,h)=>{const f=n.length>0&&h<n.length-1;return e.jsxRuntimeExports.jsx(pt,{item:y,index:h,canDelete:f,onChange:g,onRemove:()=>m(h)})}))]})]})})]})};function ct(){const[s,o]=I.useStylingState(),{flexChild:r,gridChild:n}=w.useSelectedBlocksDisplayChild(),[,i]=Te.useAtom(w.advanceStylingOpenAtom),{t:a}=de.useTranslation(),[d]=w.useSelectedStylingBlocks();return t.isEmpty(d)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(p.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:a("no_styling_block_selected")}),e.jsxRuntimeExports.jsxs("p",{className:"text-xs ",children:["Hint: Styling allowed blocks are highlighted with"," ",e.jsxRuntimeExports.jsx("span",{className:"border border-orange-500 p-px",children:"orange"})," border"]})]})}):e.jsxRuntimeExports.jsxs("div",{onClick:()=>i(!1),className:"flex h-full flex-col",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-x-4 space-y-3 border-b border-border px-4 py-2",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-1.5",children:[e.jsxRuntimeExports.jsx(se.Label,{htmlFor:"",className:"flex gap-x-1.5 text-xs italic",children:"State"}),e.jsxRuntimeExports.jsxs(C.Select,{defaultValue:s,onValueChange:u=>o(u),children:[e.jsxRuntimeExports.jsx(C.SelectTrigger,{className:"h-auto w-fit p-1 px-3",children:e.jsxRuntimeExports.jsx(C.SelectValue,{placeholder:"State"})}),e.jsxRuntimeExports.jsxs(C.SelectContent,{children:[e.jsxRuntimeExports.jsx(C.SelectItem,{value:"",children:"Normal"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"hover",children:"Hover"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"active",children:"Active"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"focus",children:"Focus"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"before",children:"Before"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"after",children:"After"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"only",children:"Only"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"first",children:"First"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"last",children:"Last"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"first-letter",children:"First Letter"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"first-line",children:"First Line"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"disabled",children:"Disabled"})]})]})]})}),e.jsxRuntimeExports.jsxs(He.ScrollArea,{className:"no-scrollbar -mx-1 h-full overflow-x-hidden",children:[e.jsxRuntimeExports.jsxs(T.Accordion,{type:"multiple",className:"h-full w-full",children:[r&&e.jsxRuntimeExports.jsx(G,{section:Fe}),n?e.jsxRuntimeExports.jsx(G,{section:Ye}):null,Xe.map(u=>e.jsxRuntimeExports.jsx(G,{section:u},u.heading)),e.jsxRuntimeExports.jsx(dt,{section:{heading:"Attributes"}})]}),e.jsxRuntimeExports.jsx("div",{className:"h-60"})]})]})}const xt={px:1,"%":1,em:100,rem:100,ch:1,vw:1,vh:1,"-":1,deg:1,ms:.1},mt=()=>{const s=w.useSelectedBlock(),{t:o}=de.useTranslation(),[r,n]=x.useState(""),[i,a]=x.useState({onDrag:l=>l,onDragEnd:l=>l,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""}),d=K.useThrottledCallback(l=>{const m=!t.get(i,"negative",!1),g=t.get(i,"cssProperty","");let c=parseFloat(i.dragStartValue);c=t.isNaN(c)?0:c;let b=xt[i.dragUnit];(t.startsWith(g,"scale")||g==="opacity")&&(b=10);let h=(i.dragStartY-l.pageY)/b+c;m&&h<0&&(h=0),g==="opacity"&&h>1&&(h=1),i.onDrag(`${h}`),n(`${h}`)},[i],50),u=x.useCallback(()=>{setTimeout(()=>i.onDragEnd(`${r}`),100),a({onDrag:l=>l,onDragEnd:l=>l,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""})},[i,r,a]);return t.isNull(s)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(p.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:o("no_block_selected_for_styling")})]})}):e.jsxRuntimeExports.jsxs(he.Provider,{value:{setDragData:a},children:[i.dragging?e.jsxRuntimeExports.jsx("div",{onMouseMove:d,onMouseUp:()=>u(),className:"absolute inset-0 z-30 cursor-row-resize bg-gray-300/10 "}):null,e.jsxRuntimeExports.jsxs(O.Tabs,{defaultValue:"settings",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(O.TabsList,{className:"mx-1 grid grid-cols-2",children:[e.jsxRuntimeExports.jsx(O.TabsTrigger,{value:"settings",children:"Settings"}),e.jsxRuntimeExports.jsx(O.TabsTrigger,{value:"styling",children:"Styling"})]}),e.jsxRuntimeExports.jsx(O.TabsContent,{value:"settings",className:"no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(_e,{})}),e.jsxRuntimeExports.jsx(O.TabsContent,{value:"styling",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(ct,{})})]})]})};exports.default=mt;
@@ -0,0 +1 @@
1
+ "use strict";var P=Object.create;var k=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var V=(s,n,r,x)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of z(n))!K.call(s,o)&&o!==r&&k(s,o,{get:()=>n[o],enumerable:!(x=T(n,o))||x.enumerable});return s};var I=(s,n,r)=>(r=s!=null?P(B(s)):{},V(n||!s||!s.__esModule?k(r,"default",{value:s,enumerable:!0}):r,s));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),C=require("@radix-ui/react-icons"),i=require("react"),q=require("jotai"),a=require("lodash"),d=require("./skeleton-JHP9zwL2.cjs"),v=require("./tabs-iWeaaVrg.cjs"),R=require("./ChaiBuilderEditor-BoE-sArB.cjs");require("react-i18next");const L=require("./utils-qK_SjzzV.cjs"),N=require("lucide-react"),M=require("./index-HAue58ea.cjs"),u=require("./alert-dialog-Mv0-wAvS.cjs"),E=require("./dialog-S_QbL1iq.cjs"),f=require("./select-7bjg-rr9.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("@radix-ui/react-tabs");require("./MODIFIERS-Fx6WAZcw.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./functions-uw7QP2kT.cjs");require("redux-undo");require("@react-hookz/web");require("tailwind-merge");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-select");const H=i.lazy(()=>import("react-json-view")),O=({provider:s,onClose:n})=>{const[r,x]=i.useState(null);return i.useEffect(()=>{s&&(s.mockFn?s.mockFn:s.dataFn)().then(m=>x(m))},[s]),s?e.jsxRuntimeExports.jsx(E.Dialog,{onOpenChange:o=>o?"":n(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(E.DialogContent,{children:[e.jsxRuntimeExports.jsxs(E.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(E.DialogTitle,{children:["Data Provider: ",s.name]}),e.jsxRuntimeExports.jsx(E.DialogDescription,{children:s.description})]}),e.jsxRuntimeExports.jsx(R.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(H,{style:{maxHeight:"80vh",overflowY:"auto"},name:s.providerKey,enableClipboard:!1,displayObjectSize:!1,displayDataTypes:!1,src:r})})]})}):null};function F({children:s,name:n,onRemove:r}){return e.jsxRuntimeExports.jsxs(u.AlertDialog,{children:[e.jsxRuntimeExports.jsx(u.AlertDialogTrigger,{asChild:!0,children:s}),e.jsxRuntimeExports.jsxs(u.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(u.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsxs(u.AlertDialogTitle,{children:["Are you sure, you want to remove ",e.jsxRuntimeExports.jsx("span",{className:"text-blue-500",children:n})," provider?"]}),e.jsxRuntimeExports.jsx(u.AlertDialogDescription,{children:"Your data provider will be removed from this page and all added data binding will be not visible on blocks."})]}),e.jsxRuntimeExports.jsxs(u.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(u.AlertDialogCancel,{children:"Cancel"}),e.jsxRuntimeExports.jsx(u.AlertDialogAction,{onClick:r,className:"bg-red-600 hover:bg-red-700",children:"Remove"})]})]})]})}const Y=()=>{const s=i.useMemo(()=>M.A(),[]),[n,r]=R.usePageDataProviders(),[,x]=q.useAtom(R.pageSyncStateAtom),[o,m]=i.useState(a.filter(s,t=>a.map(n,"providerKey").includes(t.providerKey))),[p,w]=i.useState(""),[b,c]=i.useState(null),y=a.filter(s.map(t=>a.map(o,"providerKey").includes(t.providerKey)?null:{value:t.providerKey,label:t.name}),t=>!a.isNull(t)),l=t=>{const h=a.find(s,{providerKey:t});m(j=>[...j,h]),r(j=>[...j,{providerKey:h.providerKey,args:{}}]),w(""),x("UNSAVED")},g=t=>{m(h=>a.filter(h,j=>j.providerKey!==t.providerKey)),r(h=>a.filter(h,j=>j.providerKey!==t.providerKey)),x("UNSAVED")},A=t=>c(t);return a.isEmpty(s)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"text-gray-500 mb-1.5 text-xs p-4",children:["You have no data providers registered. Please add a data provider to your project. ",e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:"Learn more"})]})}):e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"text-gray-500 mb-1.5 text-xs",children:"Add data providers:"})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:e.jsxRuntimeExports.jsxs(f.Select,{value:p,onValueChange:t=>l(t),children:[e.jsxRuntimeExports.jsx(f.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(f.SelectValue,{placeholder:"Select a provider"})}),e.jsxRuntimeExports.jsxs(f.SelectContent,{children:[e.jsxRuntimeExports.jsx(f.SelectItem,{value:"",children:"Choose"}),y.map(t=>e.jsxRuntimeExports.jsx(f.SelectItem,{value:t.value,children:t.label},t.value))]})]})}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("div",{className:`border-t ${o.length?"block":"hidden"}`,children:[e.jsxRuntimeExports.jsx("p",{className:"text-gray-500 pt-4 pb-1.5 text-xs flex-1 font-medium",children:"Page data providers:"}),e.jsxRuntimeExports.jsx("div",{className:"space-y-2",children:o.map(t=>e.jsxRuntimeExports.jsxs("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm w-full","data-v0-t":"card",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-1.5 px-4 pt-4",children:e.jsxRuntimeExports.jsx("div",{className:"flex justify-between items-center",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("h3",{className:"font-medium leading-4",children:t.name}),e.jsxRuntimeExports.jsx("p",{className:"text-xs text-gray-400 pt-1",children:t.description})]})})}),e.jsxRuntimeExports.jsxs("div",{className:"items-center p-2 py-2 flex justify-between",children:[e.jsxRuntimeExports.jsxs("button",{onClick:()=>A(t),className:"inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-blue-500",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"w-4 h-4 mr-2",children:[e.jsxRuntimeExports.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),"View Data"]}),e.jsxRuntimeExports.jsx(F,{onRemove:()=>g(t),name:t.name,children:e.jsxRuntimeExports.jsxs("button",{className:"inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-red-500",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"w-4 h-4 mr-2",children:[e.jsxRuntimeExports.jsx("path",{d:"M3 6h18"}),e.jsxRuntimeExports.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e.jsxRuntimeExports.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]}),"Remove"]})})]})]},t.providerKey))}),e.jsxRuntimeExports.jsx(O,{onClose:()=>c(null),provider:b})]})]})},S=i.lazy(()=>Promise.resolve().then(()=>require("./Layers-EzOZdWvd.cjs"))),_=i.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-5j-XszLM.cjs"))),U=i.lazy(()=>Promise.resolve().then(()=>require("./ImagesPanel-6us7hiLN.cjs")));let D=null;const $=()=>{const s=d.useBuilderProp("sideBarComponents.top",[]),n=d.useBuilderProp("sideBarComponents.bottom",[]),[r,x]=q.useAtom(R.activePanelAtom),[o,m]=i.useState(r),[p,w]=i.useState(null),b={layers:S,"branding-options":_,images:U};a.each(s,({name:l,panel:g})=>{b[l]=g});const c=l=>{clearTimeout(D),y(!1),r!=="layers"&&l==="layers"?D=setTimeout(()=>m("layers"),500):m(l),x(l)},[,y]=q.useAtom(R.addBlocksModalAtom);return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[e.jsxRuntimeExports.jsx(d.Button,{onClick:()=>{y(!0),x("layers")},size:"sm",variant:r==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(C.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(d.Button,{onClick:()=>c("layers"),size:"sm",variant:r==="layers"?"default":"outline",children:e.jsxRuntimeExports.jsx(N.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(d.Button,{onClick:()=>c("branding-options"),size:"sm",variant:r==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(C.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(s.map(({name:l,icon:g})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(d.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(d.Button,{onClick:()=>c(l),size:"sm",className:"w-10",variant:r===l?"default":"outline",children:e.jsxRuntimeExports.jsx(g,{})})})))]}),e.jsxRuntimeExports.jsx("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:i.Children.toArray(n.map(l=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(d.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(l,{})})))})]}),e.jsxRuntimeExports.jsx("div",{onClick:()=>{c("layers")},className:"absolute inset-0 right-0 z-50 w-screen bg-black/20"+(r==="layers"?" hidden":"")}),e.jsxRuntimeExports.jsx("div",{className:`fixed left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${r!=="layers"?"translate-x-0":"-translate-x-full"}`,children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 bg-white p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsx("div",{className:L.cn("relative h-full max-h-[93%] bg-background p-1",r==="layers"?"":"z-[100]"),onMouseEnter:()=>{p&&clearTimeout(p)},onMouseLeave:()=>{const l=setTimeout(()=>{p&&(c("layers"),clearTimeout(p))},1e3);w(l)},children:i.createElement(a.get(b,o,()=>e.jsxRuntimeExports.jsx("div",{})))})})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-60 border-r p-1",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsxs(v.Tabs,{defaultValue:"layers",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(v.TabsList,{className:"mx-1 h-10 grid grid-cols-2",children:[e.jsxRuntimeExports.jsxs(v.TabsTrigger,{value:"layers",children:[e.jsxRuntimeExports.jsx(N.ListTreeIcon,{className:"h-3 mr-2"})," Layers"]}),e.jsxRuntimeExports.jsxs(v.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(N.DatabaseIcon,{className:"w-3 mr-2"}),"Data"]})]}),e.jsxRuntimeExports.jsx(v.TabsContent,{value:"layers",className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(S)}),e.jsxRuntimeExports.jsx(v.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(Y,{})})]})})})]})};exports.default=$;
@@ -5,11 +5,11 @@ import { useAtom as w } from "jotai";
5
5
  import { filter as g, map as k, isNull as H, isEmpty as I, find as R, each as _, get as F } from "lodash";
6
6
  import { u as C, B as b, S as D } from "./skeleton-CU_FIbg3.js";
7
7
  import { T as O, a as Y, b as A, c as P } from "./tabs-Gb9v5dVb.js";
8
- import { t as U, v as $, E as J, w as Z, x as q } from "./ChaiBuilderEditor-h9bXC4l-.js";
8
+ import { t as U, v as $, E as J, w as Z, x as q } from "./ChaiBuilderEditor-hEuUONQ3.js";
9
9
  import "react-i18next";
10
10
  import { c as G } from "./utils-dze1SGvB.js";
11
11
  import { ListTreeIcon as S, DatabaseIcon as Q } from "lucide-react";
12
- import { getChaiDataProviders as W } from "@chaibuilder/blocks";
12
+ import { A as W } from "./index-ehKdBRUK.js";
13
13
  import { A as X, a as ee, b as se, c as re, e as ae, f as le, d as ie, h as te, g as oe } from "./alert-dialog-GNfnpqFB.js";
14
14
  import { D as ne, b as ce, c as de, e as me, f as xe } from "./dialog-jrw9DF1f.js";
15
15
  import { S as ue, c as pe, b as he, d as fe, f as T } from "./select-POGdEDHT.js";
@@ -184,7 +184,7 @@ const be = () => {
184
184
  /* @__PURE__ */ e.jsx(je, { onClose: () => t(null), provider: f })
185
185
  ] })
186
186
  ] });
187
- }, z = N(() => import("./Layers-wOfijZnb.js")), ye = N(() => import("./BrandingOptions-cHK2bVZy.js")), we = N(() => import("./ImagesPanel-oaHOD-Ex.js"));
187
+ }, z = N(() => import("./Layers-WkZ48AUm.js")), ye = N(() => import("./BrandingOptions-PAgY-kvj.js")), we = N(() => import("./ImagesPanel-oaHOD-Ex.js"));
188
188
  let K = null;
189
189
  const os = () => {
190
190
  const r = C("sideBarComponents.top", []), o = C("sideBarComponents.bottom", []), [a, n] = w(Z), [i, c] = u(a), [m, y] = u(null), f = {
@@ -5,7 +5,7 @@ import { S as d, c as h, b as u, d as g, a as j, e as f, f as r } from "./select
5
5
  import { u as a, T as v, a as S, c as b, S as p } from "./skeleton-CU_FIbg3.js";
6
6
  import { S as N } from "./separator-SctTn0Qi.js";
7
7
  import { T as C } from "./toggle-ASJRAaGP.js";
8
- import { p as w } from "./ChaiBuilderEditor-h9bXC4l-.js";
8
+ import { p as w } from "./ChaiBuilderEditor-hEuUONQ3.js";
9
9
  import { useTranslation as y } from "react-i18next";
10
10
  import "@radix-ui/react-select";
11
11
  import "./utils-dze1SGvB.js";
@@ -32,7 +32,7 @@ import "flat-to-nested";
32
32
  import "./functions-pcUZhFJM.js";
33
33
  import "redux-undo";
34
34
  import "@react-hookz/web";
35
- import "@chaibuilder/blocks";
35
+ import "./index-ehKdBRUK.js";
36
36
  const A = () => a("languages", ["en"]), T = () => A().length === 1 ? null : /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(d, { children: [
37
37
  /* @__PURE__ */ e.jsx(h, { className: "w-[150px] border-0", children: /* @__PURE__ */ e.jsx(
38
38
  u,