@chaibuilder/sdk 1.2.25 → 1.2.27

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 (183) hide show
  1. package/dist/AddBlocks-S-4jzdWv.cjs +1 -0
  2. package/dist/AddBlocks-ksZjjn0k.js +205 -0
  3. package/dist/BrandingOptions-EMCT0Wa3.cjs +1 -0
  4. package/dist/{BrandingOptions-iTyWpwTs.js → BrandingOptions-T_kbQFQv.js} +53 -40
  5. package/dist/CanvasArea-SDzbubar.cjs +55 -0
  6. package/dist/{CanvasArea-dZjng782.js → CanvasArea-rhOeubmu.js} +323 -340
  7. package/dist/{Class-ahc3NIbq.js → Class-3k8xjeiM.js} +29 -26
  8. package/dist/Class-MmCxz2Ay.cjs +1 -0
  9. package/dist/{CurrentPage-Kmfp-kFk.js → CurrentPage-0eeU1V_c.js} +53 -40
  10. package/dist/CurrentPage-aTjWjc3o.cjs +1 -0
  11. package/dist/Functions-7jnEwJyw.js +15 -0
  12. package/dist/Functions-N3yhPYKY.cjs +1 -0
  13. package/dist/{ListTree-N3jeD790.js → ListTree-Muu4rAtp.js} +96 -87
  14. package/dist/ListTree-SWsqdfcG.cjs +1 -0
  15. package/dist/MODIFIERS-9EwxLM8V.cjs +1 -0
  16. package/dist/{MODIFIERS-CNqNUapY.js → MODIFIERS-WQdaNvb8.js} +8 -10
  17. package/dist/PagesPanel-n3x-0ozR.cjs +1 -0
  18. package/dist/{PagesPanel-u1IB-nRr.js → PagesPanel-rYN28QpN.js} +44 -29
  19. package/dist/ProjectPanel-ivFOhdcz.js +84 -0
  20. package/dist/ProjectPanel-pBePMOta.cjs +1 -0
  21. package/dist/Settings-JRyJayf5.cjs +1 -0
  22. package/dist/{Settings-jCcd-VE6.js → Settings-XWmKzRl9.js} +400 -407
  23. package/dist/SidePanels-BtUeo6M9.cjs +1 -0
  24. package/dist/{SidePanels-pHMYprpW.js → SidePanels-ODktnGbC.js} +117 -108
  25. package/dist/Topbar-QMeD3hvq.cjs +1 -0
  26. package/dist/Topbar-Yunooh00.js +131 -0
  27. package/dist/UnsplashImages-05JR8oIu.cjs +1 -0
  28. package/dist/{UnsplashImages-L7x_3RQf.js → UnsplashImages-QMl0bxix.js} +59 -47
  29. package/dist/UploadImages-OgSN1HVt.cjs +1 -0
  30. package/dist/{UploadImages-zdEJRLD8.js → UploadImages-Si-A26bc.js} +58 -36
  31. package/dist/_commonjsHelpers-UyOWmZb0.js +8 -0
  32. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +1 -0
  33. package/dist/add-page-modal-9pTKItY-.cjs +1 -0
  34. package/dist/add-page-modal-U7AUUrI1.js +103 -0
  35. package/dist/confirm-alert-DhRc-Zcd.cjs +1 -0
  36. package/dist/confirm-alert-kV5-c70T.js +59 -0
  37. package/dist/controls-KK2oLIa8.cjs +1 -0
  38. package/dist/{controls-IS5qnRce.js → controls-OfJWSEqC.js} +85 -20
  39. package/dist/core.cjs +1 -1
  40. package/dist/core.js +74 -150
  41. package/dist/defaultTheme-7Lk2zq60.cjs +1 -0
  42. package/dist/{defaultTheme-4kA60XdB.js → defaultTheme-gunU_Fe5.js} +8 -6
  43. package/dist/delete-page-modal-4s-6AIy4.cjs +1 -0
  44. package/dist/delete-page-modal-UCBpdjLe.js +82 -0
  45. package/dist/email-blocks.cjs +1 -1
  46. package/dist/email-blocks.js +292 -3
  47. package/dist/email.cjs +1 -1
  48. package/dist/email.js +36 -18
  49. package/dist/empty-slot-ZBlsQi6m.js +15 -0
  50. package/dist/empty-slot-nzYOgZuS.cjs +1 -0
  51. package/dist/form-Ap63cNec.cjs +1 -0
  52. package/dist/{form-0_RLz2TB.js → form-zmlTjM9j.js} +12 -12
  53. package/dist/html-to-json-C_Eobs_d.cjs +1 -0
  54. package/dist/{html-to-json-2xtb7520.js → html-to-json-p__Fgqdg.js} +65 -40
  55. package/dist/index-CFUoB97-.js +3079 -0
  56. package/dist/index-F4AQQ6qq.cjs +1 -0
  57. package/dist/index-Qk028f-N.cjs +1 -0
  58. package/dist/index-YpnaudSM.js +63 -0
  59. package/dist/index-e0c8PmRQ.js +205 -0
  60. package/dist/index-ecnGWzh9.cjs +1 -0
  61. package/dist/index-f0AbmoYY.js +2201 -0
  62. package/dist/index-gi1LIOCw.cjs +1 -0
  63. package/dist/index-l19JVVXI.cjs +206 -0
  64. package/dist/index-lOJfSheQ.js +39503 -0
  65. package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-WbnYoNE9.js} +109 -106
  66. package/dist/jsx-runtime-Z_BpKhVy.cjs +27 -0
  67. package/dist/lib.cjs +3 -3
  68. package/dist/lib.js +59 -56
  69. package/dist/page-viewer-YFrIG3L7.cjs +1 -0
  70. package/dist/{page-viewer-NnOwmAmu.js → page-viewer-jOwy--9A.js} +56 -43
  71. package/dist/{project-general-setting-9ju3TDju.js → project-general-setting-3N8HZ2fe.js} +42 -35
  72. package/dist/project-general-setting-hK7I7FuN.cjs +1 -0
  73. package/dist/{project-seo-setting-36CdUszM.js → project-seo-setting-bSiNgO_1.js} +39 -23
  74. package/dist/project-seo-setting-x-FK0pez.cjs +1 -0
  75. package/dist/render.cjs +1 -1
  76. package/dist/render.js +16 -16
  77. package/dist/{single-page-detail-hD1jKZ8k.js → single-page-detail--AZlZ-pC.js} +73 -66
  78. package/dist/single-page-detail-9abF2g2R.cjs +1 -0
  79. package/dist/studio.cjs +1 -1
  80. package/dist/studio.js +39 -24
  81. package/dist/ui.cjs +1 -1
  82. package/dist/ui.js +158 -364
  83. package/dist/web-blocks.cjs +1 -1
  84. package/dist/web-blocks.js +1052 -3
  85. package/package.json +1 -1
  86. package/dist/AddBlocks-Ol3iIVKa.js +0 -207
  87. package/dist/AddBlocks-a1c-7Ewz.cjs +0 -1
  88. package/dist/BrandingOptions-6rnt0UaA.cjs +0 -1
  89. package/dist/CanvasArea-R4ogF9AT.cjs +0 -55
  90. package/dist/ChaiBuilderEditor-m30yoOgJ.cjs +0 -163
  91. package/dist/ChaiBuilderEditor-vP4at00I.js +0 -27974
  92. package/dist/Class-eieto7e-.cjs +0 -1
  93. package/dist/Controls-3Cc1XYXg.js +0 -105
  94. package/dist/Controls-ky25Ebo3.cjs +0 -1
  95. package/dist/CurrentPage-3gQTH0Zt.cjs +0 -1
  96. package/dist/Functions-Hvon6AMZ.cjs +0 -1
  97. package/dist/Functions-NzT2Six_.js +0 -15
  98. package/dist/ImagesPanel-J1RlG7xG.cjs +0 -1
  99. package/dist/ImagesPanel-Wb0GF_NA.js +0 -29
  100. package/dist/ListTree-CZ-mtjZ9.cjs +0 -1
  101. package/dist/MODIFIERS-o1p3VnpS.cjs +0 -1
  102. package/dist/PagesPanel-Gi0z6gaf.cjs +0 -1
  103. package/dist/ProjectPanel-EydGZmMW.js +0 -71
  104. package/dist/ProjectPanel-kiiljG4H.cjs +0 -1
  105. package/dist/STRINGS-b432aBJJ.js +0 -7
  106. package/dist/STRINGS-gPz7CUOk.cjs +0 -1
  107. package/dist/Settings-8ilCSH8b.cjs +0 -1
  108. package/dist/SidePanels-T36C6Lhc.cjs +0 -1
  109. package/dist/Topbar-CvWQuspR.cjs +0 -1
  110. package/dist/Topbar-pbIDUE_B.js +0 -122
  111. package/dist/UnsplashImages-KBZPd9dv.cjs +0 -1
  112. package/dist/UploadImages-GkkJVAgG.cjs +0 -1
  113. package/dist/accordion-oPUeqPCZ.js +0 -42
  114. package/dist/accordion-ynvFtV_p.cjs +0 -1
  115. package/dist/add-page-modal-9SGv2hgc.cjs +0 -1
  116. package/dist/add-page-modal-JCDXZIPW.js +0 -95
  117. package/dist/alert-dialog-P9xMMB6C.cjs +0 -1
  118. package/dist/alert-dialog-rypfO5ly.js +0 -64
  119. package/dist/badge-E-S7CqUt.cjs +0 -1
  120. package/dist/badge-tEwO7C51.js +0 -23
  121. package/dist/block-helpers-OKHmRRol.cjs +0 -1
  122. package/dist/block-helpers-oSFpSsGz.js +0 -23
  123. package/dist/command-BxR6jaCI.cjs +0 -1
  124. package/dist/command-Pn3HKDuV.js +0 -97
  125. package/dist/confirm-alert-uNm0lZ0y.cjs +0 -1
  126. package/dist/confirm-alert-wR5_VJ1l.js +0 -36
  127. package/dist/context-menu-8dC9uGXj.js +0 -122
  128. package/dist/context-menu-IgLbIuth.cjs +0 -1
  129. package/dist/controls-L7DPvB0m.cjs +0 -1
  130. package/dist/defaultTheme-mrkeGFGI.cjs +0 -1
  131. package/dist/delete-page-modal-7KmP1elv.js +0 -67
  132. package/dist/delete-page-modal-SgfwvfNu.cjs +0 -1
  133. package/dist/dropdown-menu-El86_9Uo.js +0 -124
  134. package/dist/dropdown-menu-SiHzqWwZ.cjs +0 -1
  135. package/dist/form-W58AVUdf.cjs +0 -1
  136. package/dist/hover-card-KUwpDkW8.cjs +0 -1
  137. package/dist/hover-card-q138xxXR.js +0 -45
  138. package/dist/html-to-json-uSnxl72F.cjs +0 -1
  139. package/dist/iconBase-gbUAAO2L.cjs +0 -1
  140. package/dist/iconBase-h4DuR_XT.js +0 -63
  141. package/dist/index-9MmykVSc.cjs +0 -1
  142. package/dist/index-hElOGcFr.js +0 -2200
  143. package/dist/index-lDTsQp7h.js +0 -188
  144. package/dist/index-rq5Y9ZDy.cjs +0 -1
  145. package/dist/jsx-runtime-JYMCiFoE.cjs +0 -27
  146. package/dist/label-KaP7MRrs.js +0 -10
  147. package/dist/label-tFm8HZdb.cjs +0 -1
  148. package/dist/link-WbcKdQ9k.cjs +0 -1
  149. package/dist/link-xuhP-4dN.js +0 -196
  150. package/dist/page-viewer-Hx5hxHKm.cjs +0 -1
  151. package/dist/popover-a84pbVhQ.js +0 -23
  152. package/dist/popover-fKjgcRUx.cjs +0 -1
  153. package/dist/project-general-setting-FxkwjvJz.cjs +0 -1
  154. package/dist/project-seo-setting-RU7qiXxb.cjs +0 -1
  155. package/dist/scroll-area-FiHvy-TZ.cjs +0 -1
  156. package/dist/scroll-area-ewXbxc3n.js +0 -30
  157. package/dist/select-7bjg-rr9.cjs +0 -1
  158. package/dist/select-POGdEDHT.js +0 -75
  159. package/dist/separator-3Civ-6hb.cjs +0 -1
  160. package/dist/separator-SctTn0Qi.js +0 -18
  161. package/dist/single-page-detail-beY0MT1b.cjs +0 -1
  162. package/dist/skeleton-STeL9VrJ.cjs +0 -1
  163. package/dist/skeleton-lu8e7q2y.js +0 -239
  164. package/dist/tabs-_4WbA1cc.cjs +0 -1
  165. package/dist/tabs-yQ3oGziM.js +0 -106
  166. package/dist/textarea-1kZEh7ki.cjs +0 -1
  167. package/dist/textarea-b2QvVhrK.js +0 -73
  168. package/dist/useAddBlock-8pxOEYIl.cjs +0 -1
  169. package/dist/useAddBlock-FEKFJNwQ.js +0 -69
  170. package/dist/useChaiExternalData-fkFgoS80.js +0 -6
  171. package/dist/useChaiExternalData-rwoAZ6uU.cjs +0 -1
  172. package/dist/useDarkMode-7i57segK.cjs +0 -1
  173. package/dist/useDarkMode-8VHJlYyE.js +0 -23
  174. package/dist/useSelectedBreakpoints-6NK5qd7T.js +0 -10
  175. package/dist/useSelectedBreakpoints-7ONXb-vN.cjs +0 -1
  176. package/dist/useStylingState-Iuj84yvc.js +0 -186
  177. package/dist/useStylingState-OIvJMV6p.cjs +0 -1
  178. package/dist/useUiLibraries-nCdauJ4N.cjs +0 -1
  179. package/dist/useUiLibraries-psyWFbNc.js +0 -12
  180. package/dist/useUpdateBlocksProps-Unn8lUyj.cjs +0 -1
  181. package/dist/useUpdateBlocksProps-vWcDp-P9.js +0 -23
  182. package/dist/utils-dze1SGvB.js +0 -6
  183. package/dist/utils-qK_SjzzV.cjs +0 -1
@@ -1,86 +1,69 @@
1
- var He = Object.defineProperty;
2
- var Oe = (e, t, n) => t in e ? He(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var E = (e, t, n) => (Oe(e, typeof t != "symbol" ? t + "" : t, n), n);
4
- import { j as o } from "./jsx-runtime-Sp0orL4X.js";
5
- import M, { useMemo as ge, useEffect as k, createElement as ie, useCallback as q, useState as I, Component as fe, Children as ze, Suspense as xe, useRef as re } from "react";
6
- import { each as G, find as ye, map as H, includes as ae, toUpper as J, round as Ue, noop as R, has as ve, throttle as be, isEmpty as A, first as W, omit as We, get as y, pick as Ke, memoize as qe, filter as ke, isNull as Ve, isString as te } from "lodash-es";
7
- import { ResetIcon as le, DotsVerticalIcon as Ye, MobileIcon as ce, LaptopIcon as Ze, DesktopIcon as Je, EraserIcon as Qe, ZoomInIcon as Ge, ArrowUpIcon as Xe, CopyIcon as et, TrashIcon as tt, DragHandleDots2Icon as nt } from "@radix-ui/react-icons";
8
- import { B as K, u as V, S as we } from "./skeleton-lu8e7q2y.js";
9
- import { o as ot, b as je, t as st, j as S, n as T, v as it, f as L, w as F, a as ne, u as Ce, g as Be, i as De, m as rt, x as at, y as Ie, h as lt, z as ct, k as dt, A as pt, E as ut } from "./ChaiBuilderEditor-vP4at00I.js";
10
- import { S as U } from "./separator-SctTn0Qi.js";
1
+ var Re = Object.defineProperty;
2
+ var $e = (e, t, n) => t in e ? Re(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var E = (e, t, n) => ($e(e, typeof t != "symbol" ? t + "" : t, n), n);
4
+ import { j as o } from "./jsx-runtime-WbnYoNE9.js";
5
+ import M, { createElement as se, useCallback as K, useState as I, useEffect as j, Component as me, Children as Fe, Suspense as ge, useRef as ie, useMemo as Pe } from "react";
6
+ import { map as O, includes as re, toUpper as Q, round as Oe, noop as $, has as fe, throttle as xe, isEmpty as N, first as W, omit as He, pick as ze, get as y, isString as ee, memoize as Ue, each as We, find as qe, filter as ye, isNull as Ke } from "lodash-es";
7
+ import { ResetIcon as ae, MobileIcon as le, LaptopIcon as Ve, DesktopIcon as Ye, DotsVerticalIcon as Je, EraserIcon as Qe, ZoomInIcon as Ze, DragHandleDots2Icon as Ge, ArrowUpIcon as Xe, CopyIcon as et, TrashIcon as tt } from "@radix-ui/react-icons";
8
+ import { v as ve, B as q, V as be, aB as nt, aC as ot, aD as st, aE as it, aF as rt, N as te, ab as at, h as V, aG as lt, aH as ct, aI as dt, aJ as pt, aK as ut, aL as ht, aM as mt, r as S, ac as T, A as gt, a as ft, b as xt, c as yt, d as vt, e as bt, f as kt, g as wt, ai as jt, O as ke, aA as U, L as Ct, aN as Bt, Y as L, a5 as Dt, aO as F, E as ne, t as we, q as je, s as Ce, z as It, aP as St, aQ as Be, aR as _t, aS as Nt, F as At, aT as Et, a1 as Mt, aU as Tt, S as De } from "./index-CFUoB97-.js";
11
9
  import { useTranslation as Y } from "react-i18next";
12
- import { a as Se, u as oe } from "./useDarkMode-8VHJlYyE.js";
13
- import { S as ht, H as mt, a as gt, b as ft } from "./hover-card-q138xxXR.js";
14
- import { L as xt } from "./label-KaP7MRrs.js";
15
- import { D as yt, a as vt, b as bt, f as kt, g as wt, d as jt } from "./dropdown-menu-El86_9Uo.js";
16
- import { a as Ct, u as _e } from "./useSelectedBreakpoints-6NK5qd7T.js";
17
- import { A as Bt, a as Dt, b as It, c as St, e as _t, f as At, d as Nt, h as Et, g as Mt } from "./alert-dialog-rypfO5ly.js";
18
10
  import { useAtom as C } from "jotai";
19
- import { u as Tt } from "./useUpdateBlocksProps-vWcDp-P9.js";
11
+ import ce from "react-dom";
12
+ import w from "prop-types";
20
13
  import { Quill as Lt } from "react-quill";
21
- import { u as $t } from "./useAddBlock-FEKFJNwQ.js";
22
- import { useFeature as Ae } from "flagged";
14
+ import { useFeature as Ie } from "flagged";
23
15
  import { flip as Rt } from "@floating-ui/dom";
24
- import { useFloating as Ft, shift as Pt } from "@floating-ui/react-dom";
25
- import { c as Ht, a as Ot } from "./block-helpers-oSFpSsGz.js";
26
- import { useResizeObserver as zt } from "@react-hookz/web";
27
- import { tailwindcssPaletteGenerator as Ut } from "@bobthered/tailwindcss-palette-generator";
28
- import Wt from "@tailwindcss/typography";
29
- import Kt from "@tailwindcss/forms";
30
- import qt from "@tailwindcss/aspect-ratio";
31
- import { Provider as Vt } from "react-wrap-balancer";
32
- import { twMerge as Yt } from "tailwind-merge";
33
- import { S as Ne, a as de } from "./STRINGS-b432aBJJ.js";
34
- import { getChaiDataProviders as Zt, getBlockComponent as Jt } from "@chaibuilder/runtime";
35
- import { u as Ee } from "./useChaiExternalData-fkFgoS80.js";
36
- import pe from "react-dom";
37
- import j from "prop-types";
38
- import "@radix-ui/react-slot";
39
- import "class-variance-authority";
40
- import "./utils-dze1SGvB.js";
16
+ import { useFloating as $t, shift as Ft } from "@floating-ui/react-dom";
17
+ import { useResizeObserver as Pt } from "@react-hookz/web";
18
+ import { tailwindcssPaletteGenerator as Ot } from "@bobthered/tailwindcss-palette-generator";
19
+ import Ht from "@tailwindcss/typography";
20
+ import zt from "@tailwindcss/forms";
21
+ import Ut from "@tailwindcss/aspect-ratio";
22
+ import { Provider as Wt } from "react-wrap-balancer";
23
+ import { twMerge as qt } from "tailwind-merge";
24
+ import { S as de, a as Se } from "./MODIFIERS-WQdaNvb8.js";
25
+ import { getBlockComponent as Kt } from "@chaibuilder/runtime";
26
+ import { u as Vt, B as Yt, E as Jt } from "./index-lOJfSheQ.js";
27
+ import "./_commonjsHelpers-UyOWmZb0.js";
28
+ import "./Functions-7jnEwJyw.js";
41
29
  import "clsx";
30
+ import "./Class-3k8xjeiM.js";
31
+ import "@radix-ui/react-toggle";
32
+ import "class-variance-authority";
33
+ import "@radix-ui/react-switch";
34
+ import "@radix-ui/react-slot";
35
+ import "@radix-ui/react-accordion";
36
+ import "@radix-ui/react-alert-dialog";
37
+ import "@radix-ui/react-dialog";
38
+ import "@radix-ui/react-label";
39
+ import "@radix-ui/react-scroll-area";
40
+ import "@radix-ui/react-tabs";
42
41
  import "@radix-ui/react-tooltip";
42
+ import "@radix-ui/react-popover";
43
+ import "@radix-ui/react-menubar";
44
+ import "@radix-ui/react-hover-card";
45
+ import "@radix-ui/react-select";
46
+ import "@radix-ui/react-dropdown-menu";
47
+ import "@radix-ui/react-separator";
43
48
  import "@radix-ui/react-toast";
44
- import "./MODIFIERS-CNqNUapY.js";
45
- import "@radix-ui/react-scroll-area";
49
+ import "cmdk";
50
+ import "@radix-ui/react-context-menu";
51
+ import "react-icons-picker";
46
52
  import "i18next";
47
- import "./Functions-NzT2Six_.js";
48
53
  import "react-hotkeys-hook";
49
- import "@radix-ui/react-separator";
50
- import "@radix-ui/react-switch";
51
- import "@radix-ui/react-hover-card";
52
- import "@radix-ui/react-label";
53
- import "@radix-ui/react-dropdown-menu";
54
- import "@radix-ui/react-alert-dialog";
55
- import "./Controls-3Cc1XYXg.js";
56
- const Qt = () => ge(() => Zt(), []), Gt = ({ children: e }) => {
57
- const [, t] = Ee(), [n] = ot(), a = Qt();
58
- return k(() => (t({}), G(n, (r) => {
59
- const i = ye(a, { providerKey: r.providerKey });
60
- if (i) {
61
- const c = (i == null ? void 0 : i.mockFn) || (i == null ? void 0 : i.dataFn);
62
- c && c(r.args).then(
63
- (s) => t((l) => ({ ...l, [r.providerKey]: s }))
64
- );
65
- }
66
- }), () => {
67
- G(n, (r) => {
68
- t((i) => (delete i[r.providerKey], i));
69
- });
70
- }), [a, n, t]), /* @__PURE__ */ o.jsx(o.Fragment, { children: e });
71
- }, Xt = () => {
72
- const { hasUndo: e, hasRedo: t, undo: n, redo: a } = je();
54
+ const Qt = () => {
55
+ const { hasUndo: e, hasRedo: t, undo: n, redo: r } = ve();
73
56
  return /* @__PURE__ */ o.jsxs("div", { className: "flex items-center", children: [
74
- /* @__PURE__ */ o.jsx(K, { disabled: !e(), size: "sm", onClick: n, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ o.jsx(le, {}) }),
75
- /* @__PURE__ */ o.jsx(K, { disabled: !t(), onClick: a, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ o.jsx(le, { className: "rotate-180 scale-y-[-1] transform" }) })
57
+ /* @__PURE__ */ o.jsx(q, { disabled: !e(), size: "sm", onClick: n, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ o.jsx(ae, {}) }),
58
+ /* @__PURE__ */ o.jsx(q, { disabled: !t(), onClick: r, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ o.jsx(ae, { className: "rotate-180 scale-y-[-1] transform" }) })
76
59
  ] });
77
60
  };
78
- function en() {
79
- const [e, t] = Se(), { t: n } = Y();
61
+ function Zt() {
62
+ const [e, t] = be(), { t: n } = Y();
80
63
  return /* @__PURE__ */ o.jsxs("div", { className: "flex items-center", children: [
81
- /* @__PURE__ */ o.jsx(xt, { htmlFor: "dark-mode-switch", children: n("dark_mode") }),
64
+ /* @__PURE__ */ o.jsx(nt, { htmlFor: "dark-mode-switch", children: n("dark_mode") }),
82
65
  /* @__PURE__ */ o.jsxs(
83
- ht,
66
+ ot,
84
67
  {
85
68
  id: "dark-mode-switch",
86
69
  checked: e,
@@ -104,7 +87,7 @@ function en() {
104
87
  )
105
88
  ] });
106
89
  }
107
- const ue = ({ landscape: e = !1 }) => /* @__PURE__ */ o.jsxs(
90
+ const pe = ({ landscape: e = !1 }) => /* @__PURE__ */ o.jsxs(
108
91
  "svg",
109
92
  {
110
93
  className: e ? "rotate-90" : "",
@@ -127,149 +110,149 @@ const ue = ({ landscape: e = !1 }) => /* @__PURE__ */ o.jsxs(
127
110
  )
128
111
  ]
129
112
  }
130
- ), tn = [
113
+ ), Gt = [
131
114
  {
132
115
  title: "mobile_xs_title",
133
116
  content: "mobile_xs_content",
134
117
  breakpoint: "xs",
135
- icon: /* @__PURE__ */ o.jsx(ce, {}),
118
+ icon: /* @__PURE__ */ o.jsx(le, {}),
136
119
  width: 400
137
120
  },
138
121
  {
139
122
  title: "mobile_sm_title",
140
123
  content: "mobile_sm_content",
141
124
  breakpoint: "sm",
142
- icon: /* @__PURE__ */ o.jsx(ce, { className: "rotate-90" }),
125
+ icon: /* @__PURE__ */ o.jsx(le, { className: "rotate-90" }),
143
126
  width: 640
144
127
  },
145
128
  {
146
129
  title: "tablet_md_title",
147
130
  content: "tablet_md_content",
148
131
  breakpoint: "md",
149
- icon: /* @__PURE__ */ o.jsx(ue, {}),
132
+ icon: /* @__PURE__ */ o.jsx(pe, {}),
150
133
  width: 800
151
134
  },
152
135
  {
153
136
  title: "tablet_lg_title",
154
137
  content: "tablet_lg_content",
155
138
  breakpoint: "lg",
156
- icon: /* @__PURE__ */ o.jsx(ue, { landscape: !0 }),
139
+ icon: /* @__PURE__ */ o.jsx(pe, { landscape: !0 }),
157
140
  width: 1024
158
141
  },
159
142
  {
160
143
  title: "desktop_xl_title",
161
144
  content: "desktop_xl_content",
162
145
  breakpoint: "xl",
163
- icon: /* @__PURE__ */ o.jsx(Ze, {}),
146
+ icon: /* @__PURE__ */ o.jsx(Ve, {}),
164
147
  width: 1420
165
148
  },
166
149
  {
167
150
  title: "large_desktop_2xl_title",
168
151
  content: "large_desktop_2xl_content",
169
152
  breakpoint: "2xl",
170
- icon: /* @__PURE__ */ o.jsx(Je, {}),
153
+ icon: /* @__PURE__ */ o.jsx(Ye, {}),
171
154
  width: 1920
172
155
  }
173
- ], he = ({
156
+ ], ue = ({
174
157
  title: e,
175
158
  content: t,
176
159
  currentBreakpoint: n,
177
- breakpoint: a,
178
- width: r,
160
+ breakpoint: r,
161
+ width: a,
179
162
  icon: i,
180
163
  onClick: c
181
164
  }) => {
182
165
  const { t: s } = Y();
183
- return /* @__PURE__ */ o.jsxs(mt, { children: [
184
- /* @__PURE__ */ o.jsx(gt, { asChild: !0, children: /* @__PURE__ */ o.jsx(
185
- K,
166
+ return /* @__PURE__ */ o.jsxs(st, { children: [
167
+ /* @__PURE__ */ o.jsx(it, { asChild: !0, children: /* @__PURE__ */ o.jsx(
168
+ q,
186
169
  {
187
- onClick: () => c(r),
170
+ onClick: () => c(a),
188
171
  size: "sm",
189
- variant: a === n ? "secondary" : "ghost",
172
+ variant: r === n ? "secondary" : "ghost",
190
173
  children: i
191
174
  }
192
175
  ) }),
193
- /* @__PURE__ */ o.jsx(ft, { className: "w-52 border-border", children: /* @__PURE__ */ o.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ o.jsxs("div", { className: "space-y-1", children: [
176
+ /* @__PURE__ */ o.jsx(rt, { className: "w-52 border-border", children: /* @__PURE__ */ o.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ o.jsxs("div", { className: "space-y-1", children: [
194
177
  /* @__PURE__ */ o.jsx("h4", { className: "text-sm font-semibold", children: s(e) }),
195
178
  /* @__PURE__ */ o.jsx("p", { className: "text-xs", children: s(t) })
196
179
  ] }) }) })
197
180
  ] });
198
- }, nn = () => {
199
- const [, e, t] = oe(), [n, a] = Ct(), { t: r } = Y(), i = V("breakpoints", tn), c = (s) => {
200
- n.includes(s) ? n.length > 2 && a(n.filter((l) => l !== s)) : a((l) => [...l, s]);
181
+ }, Xt = () => {
182
+ const [, e, t] = te(), [n, r] = at(), { t: a } = Y(), i = V("breakpoints", Gt), c = (s) => {
183
+ n.includes(s) ? n.length > 2 && r(n.filter((l) => l !== s)) : r((l) => [...l, s]);
201
184
  };
202
- return i.length < 4 ? /* @__PURE__ */ o.jsx("div", { className: "flex items-center rounded-md", children: H(i, (s) => /* @__PURE__ */ ie(he, { ...s, onClick: t, key: s.breakpoint, currentBreakpoint: e })) }) : /* @__PURE__ */ o.jsxs("div", { className: "flex items-center rounded-md", children: [
203
- H(
204
- i.filter((s) => ae(n, J(s.breakpoint))),
205
- (s) => /* @__PURE__ */ ie(he, { ...s, onClick: t, key: s.breakpoint, currentBreakpoint: e })
185
+ return i.length < 4 ? /* @__PURE__ */ o.jsx("div", { className: "flex items-center rounded-md", children: O(i, (s) => /* @__PURE__ */ se(ue, { ...s, onClick: t, key: s.breakpoint, currentBreakpoint: e })) }) : /* @__PURE__ */ o.jsxs("div", { className: "flex items-center rounded-md", children: [
186
+ O(
187
+ i.filter((s) => re(n, Q(s.breakpoint))),
188
+ (s) => /* @__PURE__ */ se(ue, { ...s, onClick: t, key: s.breakpoint, currentBreakpoint: e })
206
189
  ),
207
- /* @__PURE__ */ o.jsxs(yt, { children: [
208
- /* @__PURE__ */ o.jsx(vt, { asChild: !0, children: /* @__PURE__ */ o.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ o.jsx(Ye, { className: "scale-90 transform" }) }) }),
209
- /* @__PURE__ */ o.jsxs(bt, { className: "w-56 border-border text-xs", children: [
210
- /* @__PURE__ */ o.jsx(kt, { children: r("Breakpoints") }),
211
- /* @__PURE__ */ o.jsx(wt, {}),
212
- H(i, (s) => /* @__PURE__ */ o.jsx(
213
- jt,
190
+ /* @__PURE__ */ o.jsxs(lt, { children: [
191
+ /* @__PURE__ */ o.jsx(ct, { asChild: !0, children: /* @__PURE__ */ o.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ o.jsx(Je, { className: "scale-90 transform" }) }) }),
192
+ /* @__PURE__ */ o.jsxs(dt, { className: "w-56 border-border text-xs", children: [
193
+ /* @__PURE__ */ o.jsx(pt, { children: a("Breakpoints") }),
194
+ /* @__PURE__ */ o.jsx(ut, {}),
195
+ O(i, (s) => /* @__PURE__ */ o.jsx(
196
+ ht,
214
197
  {
215
198
  disabled: s.breakpoint === "xs",
216
- onCheckedChange: () => c(J(s.breakpoint)),
217
- checked: ae(n, J(s.breakpoint)),
218
- children: r(s.title)
199
+ onCheckedChange: () => c(Q(s.breakpoint)),
200
+ checked: re(n, Q(s.breakpoint)),
201
+ children: a(s.title)
219
202
  },
220
203
  s.breakpoint
221
204
  ))
222
205
  ] })
223
206
  ] })
224
207
  ] });
225
- }, on = () => {
226
- const { t: e } = Y(), { setNewBlocks: t } = st(), [, n] = S(), [, a] = T(), r = q(() => {
227
- t([]), n([]), a([]);
208
+ }, en = () => {
209
+ const { t: e } = Y(), { setNewBlocks: t } = mt(), [, n] = S(), [, r] = T(), a = K(() => {
210
+ t([]), n([]), r([]);
228
211
  }, [t]);
229
- return /* @__PURE__ */ o.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ o.jsxs(Bt, { children: [
230
- /* @__PURE__ */ o.jsx(Dt, { asChild: !0, children: /* @__PURE__ */ o.jsxs(K, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
212
+ return /* @__PURE__ */ o.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ o.jsxs(gt, { children: [
213
+ /* @__PURE__ */ o.jsx(ft, { asChild: !0, children: /* @__PURE__ */ o.jsxs(q, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
231
214
  /* @__PURE__ */ o.jsx(Qe, {}),
232
215
  " ",
233
216
  e("clear")
234
217
  ] }) }),
235
- /* @__PURE__ */ o.jsxs(It, { className: "border-border", children: [
236
- /* @__PURE__ */ o.jsxs(St, { children: [
237
- /* @__PURE__ */ o.jsx(_t, { children: e("clear_canvas_title") }),
238
- /* @__PURE__ */ o.jsx(At, { children: e("clear_canvas_description") })
218
+ /* @__PURE__ */ o.jsxs(xt, { className: "border-border", children: [
219
+ /* @__PURE__ */ o.jsxs(yt, { children: [
220
+ /* @__PURE__ */ o.jsx(vt, { children: e("clear_canvas_title") }),
221
+ /* @__PURE__ */ o.jsx(bt, { children: e("clear_canvas_description") })
239
222
  ] }),
240
- /* @__PURE__ */ o.jsxs(Nt, { children: [
241
- /* @__PURE__ */ o.jsx(Et, { children: e("cancel") }),
242
- /* @__PURE__ */ o.jsx(Mt, { onClick: r, children: e("yes") })
223
+ /* @__PURE__ */ o.jsxs(kt, { children: [
224
+ /* @__PURE__ */ o.jsx(wt, { children: e("cancel") }),
225
+ /* @__PURE__ */ o.jsx(jt, { onClick: a, children: e("yes") })
243
226
  ] })
244
227
  ] })
245
228
  ] }) });
246
- }, sn = () => {
247
- const e = V("darkMode", !1), [t] = _e();
229
+ }, tn = () => {
230
+ const e = V("darkMode", !1), [t] = ke();
248
231
  return /* @__PURE__ */ o.jsxs("div", { className: "flex h-10 items-center justify-between border-b bg-background/70 px-2", children: [
249
232
  /* @__PURE__ */ o.jsxs("div", { className: "flex h-full space-x-2", children: [
250
233
  e ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
251
- /* @__PURE__ */ o.jsx(en, {}),
234
+ /* @__PURE__ */ o.jsx(Zt, {}),
252
235
  /* @__PURE__ */ o.jsx(U, { orientation: "vertical" })
253
236
  ] }) : null,
254
- /* @__PURE__ */ o.jsx(nn, {}),
237
+ /* @__PURE__ */ o.jsx(Xt, {}),
255
238
  /* @__PURE__ */ o.jsx(U, { orientation: "vertical" }),
256
239
  /* @__PURE__ */ o.jsxs("div", { className: "flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium", children: [
257
- /* @__PURE__ */ o.jsx(Ge, { className: "h-3.5 w-3.5 flex-shrink-0" }),
240
+ /* @__PURE__ */ o.jsx(Ze, { className: "h-3.5 w-3.5 flex-shrink-0" }),
258
241
  " ",
259
242
  /* @__PURE__ */ o.jsxs("div", { className: "text-xs leading-3", children: [
260
- Ue(t, 0),
243
+ Oe(t, 0),
261
244
  "%"
262
245
  ] })
263
246
  ] }),
264
247
  /* @__PURE__ */ o.jsx(U, { orientation: "vertical" }),
265
- /* @__PURE__ */ o.jsx(Xt, {})
248
+ /* @__PURE__ */ o.jsx(Qt, {})
266
249
  ] }),
267
250
  /* @__PURE__ */ o.jsxs("div", { className: "flex h-full items-center space-x-2", children: [
268
251
  /* @__PURE__ */ o.jsx(U, { orientation: "vertical" }),
269
- /* @__PURE__ */ o.jsx(on, {})
252
+ /* @__PURE__ */ o.jsx(en, {})
270
253
  ] })
271
254
  ] });
272
- }, rn = `<!doctype html>
255
+ }, nn = `<!doctype html>
273
256
  <html class="scroll-smooth h-full overflow-y-auto">
274
257
  <head>
275
258
  <meta charset="UTF-8">
@@ -317,8 +300,8 @@ const ue = ({ landscape: e = !1 }) => /* @__PURE__ */ o.jsxs(
317
300
  <div class="frame-root h-full"></div>
318
301
  <script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
319
302
  </body>
320
- </html>`, an = (e) => {
321
- const [t] = oe(), [, n] = _e(), [a, r] = I({}), i = q(() => {
303
+ </html>`, on = (e) => {
304
+ const [t] = te(), [, n] = ke(), [r, a] = I({}), i = K(() => {
322
305
  const { width: c, height: s } = e;
323
306
  if (c < t) {
324
307
  const l = parseFloat((c / t).toFixed(2).toString());
@@ -327,7 +310,7 @@ const ue = ({ landscape: e = !1 }) => /* @__PURE__ */ o.jsxs(
327
310
  s && (d = {
328
311
  // Eureka! This is the formula to calculate the height of the scaled element. Thank you ChatGPT 4
329
312
  height: 100 + (s - p) / p * 100 + "%"
330
- }), r({
313
+ }), a({
331
314
  position: "relative",
332
315
  top: 0,
333
316
  transform: `scale(${l})`,
@@ -336,17 +319,17 @@ const ue = ({ landscape: e = !1 }) => /* @__PURE__ */ o.jsxs(
336
319
  maxWidth: "none"
337
320
  }), n(l * 100);
338
321
  } else
339
- r({}), n(100);
322
+ a({}), n(100);
340
323
  }, [t, e, n]);
341
- return k(() => {
324
+ return j(() => {
342
325
  i();
343
- }, [t, e, n, i]), a;
326
+ }, [t, e, n, i]), r;
344
327
  };
345
- let Me, Te;
346
- typeof document < "u" && (Me = document);
347
- typeof window < "u" && (Te = window);
348
- const Le = M.createContext({ document: Me, window: Te }), Z = () => M.useContext(Le), { Provider: ln, Consumer: To } = Le;
349
- class $e extends fe {
328
+ let _e, Ne;
329
+ typeof document < "u" && (_e = document);
330
+ typeof window < "u" && (Ne = window);
331
+ const Ae = M.createContext({ document: _e, window: Ne }), J = () => M.useContext(Ae), { Provider: sn, Consumer: _o } = Ae;
332
+ class Ee extends me {
350
333
  componentDidMount() {
351
334
  this.props.contentDidMount();
352
335
  }
@@ -354,21 +337,21 @@ class $e extends fe {
354
337
  this.props.contentDidUpdate();
355
338
  }
356
339
  render() {
357
- return ze.only(this.props.children);
340
+ return Fe.only(this.props.children);
358
341
  }
359
342
  }
360
- E($e, "propTypes", {
361
- children: j.element.isRequired,
362
- contentDidMount: j.func.isRequired,
363
- contentDidUpdate: j.func.isRequired
343
+ E(Ee, "propTypes", {
344
+ children: w.element.isRequired,
345
+ contentDidMount: w.func.isRequired,
346
+ contentDidUpdate: w.func.isRequired
364
347
  });
365
- class X extends fe {
366
- constructor(n, a) {
367
- super(n, a);
348
+ class G extends me {
349
+ constructor(n, r) {
350
+ super(n, r);
368
351
  E(this, "setRef", (n) => {
369
352
  this.nodeRef.current = n;
370
- const { forwardedRef: a } = this.props;
371
- typeof a == "function" ? a(n) : a && (a.current = n);
353
+ const { forwardedRef: r } = this.props;
354
+ typeof r == "function" ? r(n) : r && (r.current = n);
372
355
  });
373
356
  E(this, "handleLoad", () => {
374
357
  clearInterval(this.loadCheck), this.state.iframeLoaded || this.setState({ iframeLoaded: !0 });
@@ -399,8 +382,8 @@ class X extends fe {
399
382
  const n = this.getDoc();
400
383
  if (!n)
401
384
  return null;
402
- const a = this.props.contentDidMount, r = this.props.contentDidUpdate, i = n.defaultView || n.parentView, c = /* @__PURE__ */ o.jsx($e, { contentDidMount: a, contentDidUpdate: r, children: /* @__PURE__ */ o.jsx(ln, { value: { document: n, window: i }, children: /* @__PURE__ */ o.jsx("div", { className: "frame-content", children: this.props.children }) }) }), s = this.getMountTarget();
403
- return [pe.createPortal(this.props.head, this.getDoc().head), pe.createPortal(c, s)];
385
+ const r = this.props.contentDidMount, a = this.props.contentDidUpdate, i = n.defaultView || n.parentView, c = /* @__PURE__ */ o.jsx(Ee, { contentDidMount: r, contentDidUpdate: a, children: /* @__PURE__ */ o.jsx(sn, { value: { document: n, window: i }, children: /* @__PURE__ */ o.jsx("div", { className: "frame-content", children: this.props.children }) }) }), s = this.getMountTarget();
386
+ return [ce.createPortal(this.props.head, this.getDoc().head), ce.createPortal(c, s)];
404
387
  }
405
388
  render() {
406
389
  const n = {
@@ -416,16 +399,16 @@ class X extends fe {
416
399
  // also inject into the body and can mess up React. For this reason
417
400
  // initialContent is expected to have a div inside of the body
418
401
  // element that we render react into.
419
- E(X, "propTypes", {
420
- style: j.object,
402
+ E(G, "propTypes", {
403
+ style: w.object,
421
404
  // eslint-disable-line
422
- head: j.node,
423
- initialContent: j.string,
424
- mountTarget: j.string,
425
- contentDidMount: j.func,
426
- contentDidUpdate: j.func,
427
- children: j.oneOfType([j.element, j.arrayOf(j.element)])
428
- }), E(X, "defaultProps", {
405
+ head: w.node,
406
+ initialContent: w.string,
407
+ mountTarget: w.string,
408
+ contentDidMount: w.func,
409
+ contentDidUpdate: w.func,
410
+ children: w.oneOfType([w.element, w.arrayOf(w.element)])
411
+ }), E(G, "defaultProps", {
429
412
  style: {},
430
413
  head: null,
431
414
  children: void 0,
@@ -436,117 +419,117 @@ E(X, "propTypes", {
436
419
  },
437
420
  initialContent: '<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'
438
421
  });
439
- const cn = M.forwardRef((e, t) => /* @__PURE__ */ o.jsx(X, { ...e, forwardedRef: t })), dn = () => {
440
- const { addCoreBlock: e } = $t(), t = V("getExternalPredefinedBlock", R);
441
- return q(
422
+ const rn = M.forwardRef((e, t) => /* @__PURE__ */ o.jsx(G, { ...e, forwardedRef: t })), an = () => {
423
+ const { addCoreBlock: e } = Ct(), t = V("getExternalPredefinedBlock", $);
424
+ return K(
442
425
  async (n) => {
443
- const { block: a, dropTargetId: r, relativeIndex: i } = n;
444
- if (ve(a, "format")) {
445
- const c = await t(a);
446
- return e({ blocks: c }, r === 0 ? null : r, i);
426
+ const { block: r, dropTargetId: a, relativeIndex: i } = n;
427
+ if (fe(r, "format")) {
428
+ const c = await t(r);
429
+ return e({ blocks: c }, a === 0 ? null : a, i);
447
430
  }
448
- return e(a, r === 0 ? null : r, i);
431
+ return e(r, a === 0 ? null : a, i);
449
432
  },
450
433
  [e]
451
434
  );
452
435
  };
453
- let _ = null, O = [], P = null, Re = null;
454
- function pn(e) {
455
- const t = window.getComputedStyle(e), n = parseInt(t.paddingLeft, 10), a = parseInt(t.paddingTop, 10), r = parseInt(t.paddingRight, 10), i = parseInt(t.paddingBottom, 10);
456
- return { paddingLeft: n, paddingTop: a, paddingRight: r, paddingBottom: i };
436
+ let _ = null, H = [], P = null, Me = null;
437
+ function ln(e) {
438
+ const t = window.getComputedStyle(e), n = parseInt(t.paddingLeft, 10), r = parseInt(t.paddingTop, 10), a = parseInt(t.paddingRight, 10), i = parseInt(t.paddingBottom, 10);
439
+ return { paddingLeft: n, paddingTop: r, paddingRight: a, paddingBottom: i };
457
440
  }
458
- const me = (e, t, n) => {
441
+ const he = (e, t, n) => {
459
442
  if (!_)
460
443
  return;
461
- const a = e.getBoundingClientRect(), r = _ == null ? void 0 : _.getElementById("placeholder"), { paddingLeft: i, paddingTop: c, paddingRight: s, paddingBottom: l } = pn(e);
462
- r.style.width = t === "vertical" ? a.width - i - s + "px" : "2px", r.style.height = t === "vertical" ? "2px" : a.height - c - l + "px", r.style.display = "block";
463
- const d = O.reduce(
444
+ const r = e.getBoundingClientRect(), a = _ == null ? void 0 : _.getElementById("placeholder"), { paddingLeft: i, paddingTop: c, paddingRight: s, paddingBottom: l } = ln(e);
445
+ a.style.width = t === "vertical" ? r.width - i - s + "px" : "2px", a.style.height = t === "vertical" ? "2px" : r.height - c - l + "px", a.style.display = "block";
446
+ const d = H.reduce(
464
447
  (p, m) => Math.abs(m - n) < Math.abs(p - n) ? m : p
465
448
  );
466
- Re = O.indexOf(d), t === "vertical" ? (r.style.top = e.offsetTop + d + "px", r.style.left = e.offsetLeft + i + "px") : (r.style.top = e.offsetTop + c + "px", r.style.left = e.offsetLeft + d + "px");
467
- }, un = (e) => {
468
- const t = Fe(e), n = window.getComputedStyle(e), a = t === "horizontal", r = parseInt(n.paddingLeft), i = parseInt(n.paddingTop);
469
- let c = a ? r : i;
470
- O = [c], Array.from(e.children).forEach((s) => {
449
+ Me = H.indexOf(d), t === "vertical" ? (a.style.top = e.offsetTop + d + "px", a.style.left = e.offsetLeft + i + "px") : (a.style.top = e.offsetTop + c + "px", a.style.left = e.offsetLeft + d + "px");
450
+ }, cn = (e) => {
451
+ const t = Te(e), n = window.getComputedStyle(e), r = t === "horizontal", a = parseInt(n.paddingLeft), i = parseInt(n.paddingTop);
452
+ let c = r ? a : i;
453
+ H = [c], Array.from(e.children).forEach((s) => {
471
454
  const l = window.getComputedStyle(s), d = parseInt(
472
- a ? l.marginLeft + l.marginRight : l.marginTop + l.marginBottom
473
- ), p = a ? s.offsetWidth : s.offsetHeight;
474
- O.push(c + p + d), c += p + d;
455
+ r ? l.marginLeft + l.marginRight : l.marginTop + l.marginBottom
456
+ ), p = r ? s.offsetWidth : s.offsetHeight;
457
+ H.push(c + p + d), c += p + d;
475
458
  });
476
459
  };
477
- function Fe(e) {
460
+ function Te(e) {
478
461
  const t = window.getComputedStyle(e).display, n = window.getComputedStyle(e).flexDirection;
479
462
  if (t === "flex")
480
463
  return n === "column" || n === "column-reverse" ? "vertical" : "horizontal";
481
464
  if (t === "grid") {
482
- const a = window.getComputedStyle(e).gridTemplateRows, r = window.getComputedStyle(e).gridTemplateColumns;
483
- if (a.includes("auto"))
484
- return "vertical";
465
+ const r = window.getComputedStyle(e).gridTemplateRows, a = window.getComputedStyle(e).gridTemplateColumns;
485
466
  if (r.includes("auto"))
467
+ return "vertical";
468
+ if (a.includes("auto"))
486
469
  return "horizontal";
487
470
  }
488
471
  return t === "block" ? "vertical" : "horizontal";
489
472
  }
490
- const hn = be((e) => {
491
- const t = e.target, n = Fe(t);
473
+ const dn = xe((e) => {
474
+ const t = e.target, n = Te(t);
492
475
  if (n === "vertical") {
493
- const a = e.clientY - t.offsetTop;
494
- me(t, n, a);
476
+ const r = e.clientY - t.offsetTop;
477
+ he(t, n, r);
495
478
  } else {
496
- const a = e.clientX - t.offsetLeft;
497
- me(t, n, a);
479
+ const r = e.clientX - t.offsetLeft;
480
+ he(t, n, r);
498
481
  }
499
- }, 200), mn = (e) => {
500
- e.preventDefault(), e.stopPropagation(), hn(e);
482
+ }, 200), pn = (e) => {
483
+ e.preventDefault(), e.stopPropagation(), dn(e);
501
484
  };
502
- function Q() {
485
+ function Z() {
503
486
  const e = _ == null ? void 0 : _.getElementById("placeholder");
504
487
  e.style.display = "none";
505
488
  }
506
- const gn = () => {
507
- const { document: e } = Z(), [t, n] = C(it), a = dn(), r = Ae("dnd"), [, i] = L(), [, c] = S();
489
+ const un = () => {
490
+ const { document: e } = J(), [t, n] = C(Bt), r = an(), a = Ie("dnd"), [, i] = L(), [, c] = S();
508
491
  return _ = e, {
509
492
  isDragging: t,
510
493
  "data-dnd": "branch",
511
- onDragOver: r ? mn : R,
512
- onDrop: r ? (s) => {
494
+ onDragOver: a ? pn : $,
495
+ onDrop: a ? (s) => {
513
496
  P == null || P.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
514
497
  const l = JSON.parse(s.dataTransfer.getData("text/plain"));
515
498
  let d = s.target.getAttribute("data-block-id");
516
- d === null && (d = s.target.parentElement.getAttribute("data-block-id")), a({ block: l, dropTargetId: d || null, relativeIndex: Re }), n(!1), Q(), setTimeout(() => {
517
- Q();
499
+ d === null && (d = s.target.parentElement.getAttribute("data-block-id")), r({ block: l, dropTargetId: d || null, relativeIndex: Me }), n(!1), Z(), setTimeout(() => {
500
+ Z();
518
501
  }, 300);
519
- } : R,
520
- onDragEnter: r ? (s) => {
502
+ } : $,
503
+ onDragEnter: a ? (s) => {
521
504
  const l = s;
522
- P = l.target, l.stopPropagation(), l.preventDefault(), O = [];
505
+ P = l.target, l.stopPropagation(), l.preventDefault(), H = [];
523
506
  const d = l.target;
524
- un(d), d.classList.add("outline", "outline-green-300", "outline-2", "-outline-offset-2"), n(!0), i(""), c([]);
525
- } : R,
526
- onDragLeave: r ? (s) => {
507
+ cn(d), d.classList.add("outline", "outline-green-300", "outline-2", "-outline-offset-2"), n(!0), i(""), c([]);
508
+ } : $,
509
+ onDragLeave: a ? (s) => {
527
510
  const l = s;
528
511
  P = null, l.stopPropagation(), l.preventDefault(), l.target.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
529
- } : R,
530
- onMouseOut: r ? () => {
531
- n(!1), Q();
532
- } : R
512
+ } : $,
513
+ onMouseOut: a ? () => {
514
+ n(!1), Z();
515
+ } : $
533
516
  };
534
517
  };
535
- function se(e) {
518
+ function oe(e) {
536
519
  return e.getAttribute("data-block-id") ? e : e.closest("[data-block-id]");
537
520
  }
538
- function fn(e) {
521
+ function hn(e) {
539
522
  e.container.innerHTML = "", e.container.parentNode.removeChild(e.container);
540
523
  var t = document.querySelector(".ql-toolbar");
541
524
  t && t.parentNode.removeChild(t), e = null;
542
525
  }
543
- const xn = () => {
544
- const e = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], t = Tt(), [, n] = L(), [a, r] = C(F);
526
+ const mn = () => {
527
+ const e = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], t = Dt(), [, n] = L(), [r, a] = C(F);
545
528
  return (i) => {
546
529
  var m;
547
- if (a)
530
+ if (r)
548
531
  return;
549
- const c = se(i.target), s = c.getAttribute("data-block-type");
532
+ const c = oe(i.target), s = c.getAttribute("data-block-type");
550
533
  if (!s || !e.includes(s))
551
534
  return;
552
535
  const l = c.cloneNode(!0);
@@ -556,17 +539,17 @@ const xn = () => {
556
539
  const d = new Lt(l, { placeholder: "Type here..." });
557
540
  function p() {
558
541
  const g = d.getText(0, d.getLength());
559
- t([c.getAttribute("data-block-id")], { content: g }), c.removeAttribute("style"), l.removeEventListener("blur", p, !0), fn(d), r(""), n("");
542
+ t([c.getAttribute("data-block-id")], { content: g }), c.removeAttribute("style"), l.removeEventListener("blur", p, !0), hn(d), a(""), n("");
560
543
  }
561
- l.addEventListener("blur", p, !0), d.focus(), (m = l.querySelector(".ql-clipboard")) == null || m.remove(), r(c.getAttribute("data-block-id"));
544
+ l.addEventListener("blur", p, !0), d.focus(), (m = l.querySelector(".ql-clipboard")) == null || m.remove(), a(c.getAttribute("data-block-id"));
562
545
  };
563
- }, yn = () => {
564
- const [, e] = T(), [, t] = S(), [, n] = L(), [a] = C(F);
565
- return (r) => {
566
- if (a)
546
+ }, gn = () => {
547
+ const [, e] = T(), [, t] = S(), [, n] = L(), [r] = C(F);
548
+ return (a) => {
549
+ if (r)
567
550
  return;
568
- r.stopPropagation();
569
- const i = se(r.target);
551
+ a.stopPropagation();
552
+ const i = oe(a.target);
570
553
  if (i != null && i.getAttribute("data-block-id") && (i == null ? void 0 : i.getAttribute("data-block-id")) === "container") {
571
554
  t([]), e([]), n("");
572
555
  return;
@@ -578,31 +561,31 @@ const xn = () => {
578
561
  i != null && i.getAttribute("data-block-id") && t([i.getAttribute("data-block-id")]);
579
562
  n("");
580
563
  };
581
- }, vn = be((e, t) => {
582
- const n = se(e.target);
564
+ }, fn = xe((e, t) => {
565
+ const n = oe(e.target);
583
566
  n != null && n.getAttribute("data-style-id") && t(n.getAttribute("data-style-id"));
584
- }, 100), bn = () => {
567
+ }, 100), xn = () => {
585
568
  const [, e] = L(), [t] = C(F);
586
569
  return (n) => {
587
- t || vn(n, e);
570
+ t || fn(n, e);
588
571
  };
589
- }, kn = ({ children: e }) => {
590
- const { document: t } = Z(), [n] = S(), [a, r] = T();
591
- k(() => {
572
+ }, yn = ({ children: e }) => {
573
+ const { document: t } = J(), [n] = S(), [r, a] = T();
574
+ j(() => {
592
575
  setTimeout(() => {
593
- if (!A(a))
576
+ if (!N(r))
594
577
  return;
595
- const d = Pe(t, W(n));
578
+ const d = Le(t, W(n));
596
579
  if (d) {
597
580
  const p = d.getAttribute("data-style-prop");
598
581
  if (p) {
599
582
  const m = d.getAttribute("data-style-id"), g = d.getAttribute("data-block-parent");
600
- r([{ id: m, prop: p, blockId: g }]);
583
+ a([{ id: m, prop: p, blockId: g }]);
601
584
  }
602
585
  }
603
586
  }, 100);
604
- }, [t, n, r, a]);
605
- const i = xn(), c = yn(), s = bn(), l = gn();
587
+ }, [t, n, a, r]);
588
+ const i = mn(), c = gn(), s = xn(), l = un();
606
589
  return /* @__PURE__ */ o.jsx(
607
590
  "div",
608
591
  {
@@ -611,25 +594,25 @@ const xn = () => {
611
594
  onClick: c,
612
595
  onDoubleClick: i,
613
596
  onMouseMove: s,
614
- ...We(l, "isDragging"),
597
+ ...He(l, "isDragging"),
615
598
  className: "relative mb-5 h-full max-w-full " + (l.isDragging ? "dragging" : ""),
616
599
  children: e
617
600
  }
618
601
  );
619
- }, Pe = (e, t) => e.querySelector(`[data-block-id="${t}"]`), wn = () => {
620
- const { window: e } = Z(), [t, n] = S(), [a] = ne(), [, r] = T(), { undo: i, redo: c } = je(), s = Ce(), [, l] = Be(), d = De(), { savePage: p } = rt(), [m] = C(F), [, g] = C(at), w = (f) => {
602
+ }, Le = (e, t) => e.querySelector(`[data-block-id="${t}"]`), vn = () => {
603
+ const { window: e } = J(), [t, n] = S(), [r] = ne(), [, a] = T(), { undo: i, redo: c } = ve(), s = we(), [, l] = je(), d = Ce(), { savePage: p } = It(), [m] = C(F), [, g] = C(St), k = (f) => {
621
604
  f.key === "Enter" && (f.preventDefault(), t.length === 1 && g(W(t)));
622
605
  }, B = (f) => {
623
- const h = a.find((b) => b._id === f);
606
+ const h = r.find((b) => b._id === f);
624
607
  return h ? h._parent : null;
625
608
  };
626
- return k(() => {
609
+ return j(() => {
627
610
  const f = (h) => {
628
611
  if (h.key === "Escape") {
629
- n([]), r([]);
612
+ n([]), a([]);
630
613
  return;
631
614
  }
632
- if (w(h), !m && (h.key === "Delete" || h.key === "Backspace") && (h.preventDefault(), d(t)), h.ctrlKey || h.metaKey) {
615
+ if (k(h), !m && (h.key === "Delete" || h.key === "Backspace") && (h.preventDefault(), d(t)), h.ctrlKey || h.metaKey) {
633
616
  if (h.key === "ArrowUp") {
634
617
  h.preventDefault();
635
618
  const b = t.length > 0 ? B(t[0]) : null;
@@ -647,34 +630,34 @@ const xn = () => {
647
630
  e.removeEventListener("keydown", f);
648
631
  };
649
632
  }, [t, n, i, d, l, c, s, m, p, e]), null;
650
- }, jn = ({ block: e, label: t }) => {
651
- const [, n] = S(), [, a] = L(), [, r] = C(Ie), i = Ae("dnd");
633
+ }, bn = ({ block: e, label: t }) => {
634
+ const [, n] = S(), [, r] = L(), [, a] = C(Be), i = Ie("dnd");
652
635
  return /* @__PURE__ */ o.jsxs(
653
636
  "div",
654
637
  {
655
638
  className: "mr-10 flex cursor-grab items-center space-x-1 px-1",
656
639
  draggable: i ? "true" : "false",
657
640
  onDragStart: (c) => {
658
- c.dataTransfer.setData("text/plain", JSON.stringify(Ke(e, ["_id", "_type"]))), r(e._id), setTimeout(() => {
659
- n([]), a(null);
641
+ c.dataTransfer.setData("text/plain", JSON.stringify(ze(e, ["_id", "_type"]))), a(e._id), setTimeout(() => {
642
+ n([]), r(null);
660
643
  }, 200);
661
644
  },
662
645
  children: [
663
- /* @__PURE__ */ o.jsx(nt, {}),
646
+ /* @__PURE__ */ o.jsx(Ge, {}),
664
647
  t
665
648
  ]
666
649
  }
667
650
  );
668
- }, Cn = ({ selectedBlockElement: e, block: t }) => {
669
- const n = De(), a = Ce(), [, r] = S(), [, i] = T(), [c] = C(F), { floatingStyles: s, refs: l, update: d } = Ft({
651
+ }, kn = ({ selectedBlockElement: e, block: t }) => {
652
+ const n = Ce(), r = we(), [, a] = S(), [, i] = T(), [c] = C(F), { floatingStyles: s, refs: l, update: d } = $t({
670
653
  placement: "top-start",
671
- middleware: [Pt(), Rt()],
654
+ middleware: [Ft(), Rt()],
672
655
  elements: {
673
656
  reference: e
674
657
  }
675
658
  });
676
- zt(e, () => d(), e !== null);
677
- const p = y(t, "_parent", null), m = A(y(t, "_name", "")) ? y(t, "_type", "") : y(t, "_name", "");
659
+ Pt(e, () => d(), e !== null);
660
+ const p = y(t, "_parent", null), m = N(y(t, "_name", "")) ? y(t, "_type", "") : y(t, "_name", "");
678
661
  return !e || !t || c ? null : /* @__PURE__ */ o.jsxs(
679
662
  "div",
680
663
  {
@@ -688,58 +671,58 @@ const xn = () => {
688
671
  onKeyDown: (g) => g.stopPropagation(),
689
672
  className: "z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",
690
673
  children: [
691
- /* @__PURE__ */ o.jsx(jn, { label: m, block: t }),
674
+ /* @__PURE__ */ o.jsx(bn, { label: m, block: t }),
692
675
  /* @__PURE__ */ o.jsxs("div", { className: "flex gap-2 px-1", children: [
693
676
  p && /* @__PURE__ */ o.jsx(
694
677
  Xe,
695
678
  {
696
679
  className: "hover:scale-105",
697
680
  onClick: () => {
698
- i([]), r([p]);
681
+ i([]), a([p]);
699
682
  }
700
683
  }
701
684
  ),
702
- Ht(y(t, "_type", "")) ? /* @__PURE__ */ o.jsx(et, { className: "hover:scale-105", onClick: () => a([t == null ? void 0 : t._id]) }) : null,
703
- Ot(y(t, "_type", "")) ? /* @__PURE__ */ o.jsx(tt, { className: "hover:scale-105", onClick: () => n([t == null ? void 0 : t._id]) }) : null
685
+ _t(y(t, "_type", "")) ? /* @__PURE__ */ o.jsx(et, { className: "hover:scale-105", onClick: () => r([t == null ? void 0 : t._id]) }) : null,
686
+ Nt(y(t, "_type", "")) ? /* @__PURE__ */ o.jsx(tt, { className: "hover:scale-105", onClick: () => n([t == null ? void 0 : t._id]) }) : null
704
687
  ] })
705
688
  ]
706
689
  }
707
690
  );
708
- }, Bn = ({ model: e }) => {
709
- const [t] = lt(), [n] = S(), [a] = Se(), [r] = L(), [i] = T(), [c] = C(Ie), { document: s, window: l } = Z(), [d] = I(s == null ? void 0 : s.getElementById("highlighted-block")), [p] = I(
691
+ }, wn = ({ model: e }) => {
692
+ const [t] = At(), [n] = S(), [r] = be(), [a] = L(), [i] = T(), [c] = C(Be), { document: s, window: l } = J(), [d] = I(s == null ? void 0 : s.getElementById("highlighted-block")), [p] = I(
710
693
  s == null ? void 0 : s.getElementById("selected-block")
711
694
  ), [m] = I(
712
695
  s == null ? void 0 : s.getElementById("selected-styling-block")
713
696
  ), [g] = I(s == null ? void 0 : s.getElementById("dragged-block"));
714
- k(() => {
715
- a ? s == null || s.documentElement.classList.add("dark") : s == null || s.documentElement.classList.remove("dark");
716
- }, [a, s]);
717
- const w = y(t, "headingFont", "DM Sans"), B = y(t, "bodyFont", "DM Sans");
718
- return k(() => {
719
- const f = y(t, "primaryColor", "#000"), h = y(t, "secondaryColor", "#FFF"), b = Ut({
697
+ j(() => {
698
+ r ? s == null || s.documentElement.classList.add("dark") : s == null || s.documentElement.classList.remove("dark");
699
+ }, [r, s]);
700
+ const k = y(t, "headingFont", "DM Sans"), B = y(t, "bodyFont", "DM Sans");
701
+ return j(() => {
702
+ const f = y(t, "primaryColor", "#000"), h = y(t, "secondaryColor", "#FFF"), b = Ot({
720
703
  colors: [f, h],
721
704
  names: ["primary", "secondary"]
722
705
  });
723
706
  b.primary.DEFAULT = f, b.secondary.DEFAULT = h;
724
- const $ = y(t, "roundedCorners", "0");
707
+ const R = y(t, "roundedCorners", "0");
725
708
  !l || !l.tailwind || (l.tailwind.config = {
726
709
  darkMode: "class",
727
710
  theme: {
728
711
  fontFamily: {
729
- heading: [w],
712
+ heading: [k],
730
713
  body: [B]
731
714
  },
732
715
  extend: {
733
716
  borderRadius: {
734
- global: `${$ || "0"}px`
717
+ global: `${R || "0"}px`
735
718
  },
736
719
  colors: b
737
720
  }
738
721
  },
739
722
  plugins: [
740
- Wt,
741
- Kt,
742
- qt,
723
+ Ht,
724
+ zt,
725
+ Ut,
743
726
  l.tailwind.plugin.withOptions(() => ({ addVariant: z, e: D }) => {
744
727
  z("hs-accordion-active", [
745
728
  ({ modifySelectors: v, separator: u }) => {
@@ -774,40 +757,40 @@ const xn = () => {
774
757
  })
775
758
  ]
776
759
  });
777
- }, [t, l, w, B]), k(() => {
778
- p && (p.textContent = `${H(n, (f) => `[data-block-id="${f}"]`).join(",")}{
760
+ }, [t, l, k, B]), j(() => {
761
+ p && (p.textContent = `${O(n, (f) => `[data-block-id="${f}"]`).join(",")}{
779
762
  outline: 1px solid ${n.length === 1 ? "#42a1fc" : "orange"} !important; outline-offset: -1px;
780
763
  }`);
781
- }, [n, p]), k(() => {
764
+ }, [n, p]), j(() => {
782
765
  if (!c) {
783
766
  g.textContent = "";
784
767
  return;
785
768
  }
786
769
  g.textContent = `[data-block-id="${c}"]{ pointer-events: none !important; opacity: 0.2 !important}`;
787
- }, [c]), k(() => {
788
- d && (d.textContent = r ? `[data-style-id="${r}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
789
- }, [r, n, d]), k(() => {
790
- m && (m.textContent = `${H(i, ({ id: f }) => `[data-style-id="${f}"]`).join(",")}{
770
+ }, [c]), j(() => {
771
+ d && (d.textContent = a ? `[data-style-id="${a}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
772
+ }, [a, n, d]), j(() => {
773
+ m && (m.textContent = `${O(i, ({ id: f }) => `[data-style-id="${f}"]`).join(",")}{
791
774
  outline: 1px solid #42a1fc !important; outline-offset: -1px;
792
775
  }`);
793
- }, [i, m]), k(() => {
794
- const f = y(t, "bodyTextLightColor", "#64748b"), h = y(t, "bodyTextDarkColor", "#94a3b8"), b = y(t, "bodyBgLightColor", "#FFFFFF"), $ = y(t, "bodyBgDarkColor", "#0f172a");
795
- s.body.className = `font-body antialiased text-[${f}] bg-[${b}] dark:text-[${h}] dark:bg-[${$}]`;
776
+ }, [i, m]), j(() => {
777
+ const f = y(t, "bodyTextLightColor", "#64748b"), h = y(t, "bodyTextDarkColor", "#94a3b8"), b = y(t, "bodyBgLightColor", "#FFFFFF"), R = y(t, "bodyBgDarkColor", "#0f172a");
778
+ s.body.className = `font-body antialiased text-[${f}] bg-[${b}] dark:text-[${h}] dark:bg-[${R}]`;
796
779
  }, [t, s, e]), e === "page" ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
797
- w && /* @__PURE__ */ o.jsx(
780
+ k && /* @__PURE__ */ o.jsx(
798
781
  "link",
799
782
  {
800
783
  id: "heading-font",
801
784
  rel: "stylesheet",
802
785
  type: "text/css",
803
- href: `https://fonts.googleapis.com/css2?family=${w.replace(
786
+ href: `https://fonts.googleapis.com/css2?family=${k.replace(
804
787
  / /g,
805
788
  "+"
806
789
  )}:wght@300;400;500;600;700;800;900&display=swap`,
807
790
  media: "all"
808
791
  }
809
792
  ),
810
- B && w !== B && /* @__PURE__ */ o.jsx(
793
+ B && k !== B && /* @__PURE__ */ o.jsx(
811
794
  "link",
812
795
  {
813
796
  id: "body-font",
@@ -820,93 +803,93 @@ const xn = () => {
820
803
  media: "all"
821
804
  }
822
805
  ),
823
- w && /* @__PURE__ */ o.jsx("style", { children: `h1,h2,h3,h4,h5,h6{font-family: "${w}",ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";}` })
806
+ k && /* @__PURE__ */ o.jsx("style", { children: `h1,h2,h3,h4,h5,h6{font-family: "${k}",ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";}` })
824
807
  ] }) : null;
825
- }, Dn = (e) => {
808
+ }, jn = (e) => {
826
809
  const t = {};
827
810
  return Object.keys(e).forEach((n) => {
828
- te(e[n]) && e[n].startsWith(de) && (t[n] = e[n].replace(de, "").split(","));
811
+ ee(e[n]) && e[n].startsWith(de) && (t[n] = e[n].replace(de, "").split(","));
829
812
  }), t;
830
- }, In = qe((e) => {
831
- const t = e.replace(Ne, "").split(",");
832
- return Yt(t[0], t[1]);
813
+ }, Cn = Ue((e) => {
814
+ const t = e.replace(Se, "").split(",");
815
+ return qt(t[0], t[1]);
833
816
  });
834
- function Sn(e, t) {
817
+ function Bn(e, t) {
835
818
  return y(e, `${t}_attrs`, {});
836
819
  }
837
- function _n(e) {
820
+ function Dn(e) {
838
821
  const t = {};
839
822
  return Object.keys(e).forEach((n) => {
840
- if (te(e[n]) && e[n].startsWith(Ne)) {
841
- const a = In(e[n]);
823
+ if (ee(e[n]) && e[n].startsWith(Se)) {
824
+ const r = Cn(e[n]);
842
825
  t[n] = {
843
- className: a,
826
+ className: r,
844
827
  "data-style-prop": n,
845
828
  "data-block-parent": e._id,
846
829
  "data-style-id": `${n}-${e._id}`,
847
- ...Sn(e, n)
830
+ ...Bn(e, n)
848
831
  };
849
832
  }
850
833
  }), t;
851
834
  }
852
- function An(e, t) {
835
+ function In(e, t) {
853
836
  const n = y(e, "_bindings", {});
854
- return A(n) ? { ...e } : (G(n, (a, r) => {
855
- te(a) && y(t, a, null) && (e[r] = y(t, a, null));
837
+ return N(n) ? { ...e } : (We(n, (r, a) => {
838
+ ee(r) && y(t, r, null) && (e[a] = y(t, r, null));
856
839
  }), e);
857
840
  }
858
- function ee({ blocks: e }) {
859
- const [t] = ne(), n = q((i) => _n(i), []), [a] = Ee(), [r] = C(F);
841
+ function X({ blocks: e }) {
842
+ const [t] = ne(), n = K((i) => Dn(i), []), [r] = Vt(), [a] = C(F);
860
843
  return /* @__PURE__ */ o.jsx(o.Fragment, { children: M.Children.toArray(
861
844
  e.map((i, c) => {
862
- if (r === i._id)
845
+ if (a === i._id)
863
846
  return null;
864
- const s = Dn(i), l = {};
865
- A(s) || Object.keys(s).forEach((g) => {
847
+ const s = jn(i), l = {};
848
+ N(s) || Object.keys(s).forEach((g) => {
866
849
  l[g] = M.Children.toArray(
867
- s[g].map((w) => /* @__PURE__ */ o.jsx(ee, { blocks: [ye(t, { _id: w })] }))
850
+ s[g].map((k) => /* @__PURE__ */ o.jsx(X, { blocks: [qe(t, { _id: k })] }))
868
851
  );
869
852
  });
870
- const d = ke(t, { _parent: i._id });
871
- l.children = d.length ? /* @__PURE__ */ o.jsx(ee, { blocks: d }) : null;
872
- const p = Jt(i._type), m = y(p, "builderComponent", y(p, "component", null));
873
- return Ve(m) ? /* @__PURE__ */ o.jsx("noscript", { children: `<!-- ${i == null ? void 0 : i._type} not registered -->` }) : /* @__PURE__ */ o.jsx(xe, { children: M.createElement(m, {
853
+ const d = ye(t, { _parent: i._id });
854
+ l.children = d.length ? /* @__PURE__ */ o.jsx(X, { blocks: d }) : null;
855
+ const p = Kt(i._type), m = y(p, "builderComponent", y(p, "component", null));
856
+ return Ke(m) ? /* @__PURE__ */ o.jsx("noscript", { children: `<!-- ${i == null ? void 0 : i._type} not registered -->` }) : /* @__PURE__ */ o.jsx(ge, { children: M.createElement(m, {
874
857
  blockProps: {
875
858
  "data-block-id": i._id,
876
859
  "data-block-type": i._type,
877
- "data-dnd": ve(p, "canAcceptBlock") ? "branch" : "leaf"
860
+ "data-dnd": fe(p, "canAcceptBlock") ? "branch" : "leaf"
878
861
  },
879
862
  inBuilder: !0,
880
863
  index: c,
881
- ...An(i, a),
864
+ ...In(i, r),
882
865
  ...n(i),
883
866
  ...l
884
867
  }) });
885
868
  })
886
869
  ) });
887
870
  }
888
- const Nn = () => {
889
- const [e] = ne(), t = A(e) ? null : /* @__PURE__ */ o.jsx(Gt, { children: /* @__PURE__ */ o.jsx(ee, { blocks: ke(e, (n) => A(n._parent)) }) });
890
- return /* @__PURE__ */ o.jsx(Vt, { children: t });
891
- }, En = (e, t) => e.querySelector(`[data-style-id="${t}"]`), Mn = () => {
892
- const [e] = C(ct), [t] = Be(), [n] = oe(), [, a] = S(), r = dt(), [, i] = L(), c = re(null), s = re(null), [l, d] = I({ width: 0, height: 0 }), p = an(l), [m, g] = I(0), [w, B] = I([]), [, f] = I([]), [, h] = C(pt), [b, $] = T(), z = V("loading", !1);
893
- k(() => {
871
+ const Sn = () => {
872
+ const [e] = ne(), t = N(e) ? null : /* @__PURE__ */ o.jsx(Yt, { children: /* @__PURE__ */ o.jsx(X, { blocks: ye(e, (n) => N(n._parent)) }) });
873
+ return /* @__PURE__ */ o.jsx(Wt, { children: t });
874
+ }, _n = (e, t) => e.querySelector(`[data-style-id="${t}"]`), Nn = () => {
875
+ const [e] = C(Et), [t] = je(), [n] = te(), [, r] = S(), a = Mt(), [, i] = L(), c = ie(null), s = ie(null), [l, d] = I({ width: 0, height: 0 }), p = on(l), [m, g] = I(0), [k, B] = I([]), [, f] = I([]), [, h] = C(Tt), [b, R] = T(), z = V("loading", !1);
876
+ j(() => {
894
877
  const { clientWidth: u, clientHeight: x } = s.current;
895
878
  d({ width: u, height: x }), m === 0 && g(u);
896
879
  }, [s, n, m]);
897
880
  const D = (u, x = 0) => {
898
- const { top: N } = u.getBoundingClientRect();
899
- return N + x >= 0 && N - x <= window.innerHeight;
881
+ const { top: A } = u.getBoundingClientRect();
882
+ return A + x >= 0 && A - x <= window.innerHeight;
900
883
  };
901
- k(() => {
884
+ j(() => {
902
885
  var u, x;
903
- if (r && r.type !== "Multiple" && c.current) {
904
- const N = Pe(c.current.contentDocument, r._id);
905
- N && (D(N) || (x = (u = c.current) == null ? void 0 : u.contentWindow) == null || x.scrollTo({ top: N.offsetTop, behavior: "smooth" }), B([N]));
886
+ if (a && a.type !== "Multiple" && c.current) {
887
+ const A = Le(c.current.contentDocument, a._id);
888
+ A && (D(A) || (x = (u = c.current) == null ? void 0 : u.contentWindow) == null || x.scrollTo({ top: A.offsetTop, behavior: "smooth" }), B([A]));
906
889
  }
907
- }, [r]), k(() => {
908
- if (!A(b) && c.current) {
909
- const u = En(
890
+ }, [a]), j(() => {
891
+ if (!N(b) && c.current) {
892
+ const u = _n(
910
893
  c.current.contentDocument,
911
894
  W(b).id
912
895
  );
@@ -914,8 +897,8 @@ const Nn = () => {
914
897
  } else
915
898
  f([null]);
916
899
  }, [b]);
917
- const v = ge(() => {
918
- let u = rn;
900
+ const v = Pe(() => {
901
+ let u = nn;
919
902
  return e === "offline" && (u = u.replace(
920
903
  "https://old.chaibuilder.com/offline/tailwind.cdn.js",
921
904
  "/offline/tailwind.cdn.js"
@@ -925,14 +908,14 @@ const Nn = () => {
925
908
  "div",
926
909
  {
927
910
  onClick: () => {
928
- a([]), $([]);
911
+ r([]), R([]);
929
912
  },
930
913
  onMouseLeave: () => setTimeout(() => i(""), 300),
931
914
  className: "relative mx-auto h-full w-full overflow-hidden",
932
- style: m > 0 && !A(p) ? { width: t ? "100%" : m } : {},
915
+ style: m > 0 && !N(p) ? { width: t ? "100%" : m } : {},
933
916
  ref: s,
934
917
  children: /* @__PURE__ */ o.jsxs(
935
- cn,
918
+ rn,
936
919
  {
937
920
  contentDidMount: () => h(c.current),
938
921
  ref: c,
@@ -941,16 +924,16 @@ const Nn = () => {
941
924
  className: "relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",
942
925
  initialContent: v,
943
926
  children: [
944
- /* @__PURE__ */ o.jsx(wn, {}),
927
+ /* @__PURE__ */ o.jsx(vn, {}),
945
928
  /* @__PURE__ */ o.jsx(
946
- Cn,
929
+ kn,
947
930
  {
948
- block: r,
949
- selectedBlockElement: W(w)
931
+ block: a,
932
+ selectedBlockElement: W(k)
950
933
  }
951
934
  ),
952
- /* @__PURE__ */ o.jsx(Bn, { model: "page" }),
953
- /* @__PURE__ */ o.jsx(kn, { children: z ? /* @__PURE__ */ o.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ o.jsx(we, { className: "h-full" }) }) : /* @__PURE__ */ o.jsx(Nn, {}) }),
935
+ /* @__PURE__ */ o.jsx(wn, { model: "page" }),
936
+ /* @__PURE__ */ o.jsx(yn, { children: z ? /* @__PURE__ */ o.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ o.jsx(De, { className: "h-full" }) }) : /* @__PURE__ */ o.jsx(Sn, {}) }),
954
937
  /* @__PURE__ */ o.jsx("br", {}),
955
938
  /* @__PURE__ */ o.jsx("div", { id: "placeholder", className: "absolute z-[99999] max-w-full bg-green-500 transition-transform" })
956
939
  ]
@@ -958,10 +941,10 @@ const Nn = () => {
958
941
  )
959
942
  }
960
943
  );
961
- }, Lo = () => /* @__PURE__ */ o.jsxs("div", { className: "flex h-full w-full flex-col", children: [
962
- /* @__PURE__ */ o.jsx(sn, {}),
963
- /* @__PURE__ */ o.jsx("div", { className: "relative h-full overflow-hidden bg-slate-800/90 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px] px-2", children: /* @__PURE__ */ o.jsx(xe, { fallback: /* @__PURE__ */ o.jsx(we, { className: "h-full" }), children: /* @__PURE__ */ o.jsx(ut, { children: /* @__PURE__ */ o.jsx(Mn, {}) }) }) })
944
+ }, No = () => /* @__PURE__ */ o.jsxs("div", { className: "flex h-full w-full flex-col", children: [
945
+ /* @__PURE__ */ o.jsx(tn, {}),
946
+ /* @__PURE__ */ o.jsx("div", { className: "relative h-full overflow-hidden bg-slate-800/90 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px] px-2", children: /* @__PURE__ */ o.jsx(ge, { fallback: /* @__PURE__ */ o.jsx(De, { className: "h-full" }), children: /* @__PURE__ */ o.jsx(Jt, { children: /* @__PURE__ */ o.jsx(Nn, {}) }) }) })
964
947
  ] });
965
948
  export {
966
- Lo as default
949
+ No as default
967
950
  };