@chaibuilder/sdk 2.2.13 → 2.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.js CHANGED
@@ -15,7 +15,7 @@ import { ChevronRight, PlusIcon as PlusIcon$1, DatabaseIcon, ChevronLeft, Chevro
15
15
  import clsx$1, { clsx } from "clsx";
16
16
  import { twMerge } from "tailwind-merge";
17
17
  import TreeModel from "tree-model";
18
- import { S as STYLES_KEY, e as getSplitChaiClasses, a as applyBinding, b as applyLanguage, g as getBlockTagAttributes, c as getBlockRuntimeProps, d as applyLimit, R as ROOT_TEMP_KEY } from "./new-blocks-render-helpers-BGcG63he.js";
18
+ import { S as STYLES_KEY, f as getSplitChaiClasses, a as applyBinding, b as applyLanguage, g as getBlockTagAttributes, c as getBlockRuntimeProps, d as applyLimit, R as ROOT_TEMP_KEY } from "./new-blocks-render-helpers-DfAVXxr2.js";
19
19
  import { d as defaultThemeOptions, f as defaultThemeValues, a as getChaiThemeCssVariables, g as getChaiThemeOptions, p as plugin, e as getThemeFontsLinkMarkup, h as getThemeCustomFontFace } from "./plugin-fnBB3TCm.js";
20
20
  import Fuse from "fuse.js";
21
21
  import { useDebouncedCallback, useThrottledCallback, useResizeObserver, useIntervalEffect } from "@react-hookz/web";
@@ -759,13 +759,13 @@ const useUndoManager = () => {
759
759
  } = useBlocksStoreManager();
760
760
  return {
761
761
  moveBlocks: (x, y, b) => {
762
- const v = map(x, (A) => {
763
- const _ = r.find((T) => T._id === A)._parent || null, B = r.filter((T) => _ ? T._parent === _ : !T._parent).map((T) => T._id).indexOf(A);
764
- return { _id: A, oldParent: _, oldPosition: B };
765
- }), w = v.find(({ _id: A }) => A === x[0]);
766
- w && w.oldParent === y && w.oldPosition === b || (i(x, y, b), o({
767
- undo: () => each(v, ({ _id: A, oldParent: E, oldPosition: _ }) => {
768
- i([A], E, _);
762
+ const v = map(x, (w) => {
763
+ const _ = r.find((T) => T._id === w)._parent || null, B = r.filter((T) => _ ? T._parent === _ : !T._parent).map((T) => T._id).indexOf(w);
764
+ return { _id: w, oldParent: _, oldPosition: B };
765
+ }), A = v.find(({ _id: w }) => w === x[0]);
766
+ A && A.oldParent === y && A.oldPosition === b || (i(x, y, b), o({
767
+ undo: () => each(v, ({ _id: w, oldParent: E, oldPosition: _ }) => {
768
+ i([w], E, _);
769
769
  }),
770
770
  redo: () => i(x, y, b)
771
771
  }));
@@ -777,8 +777,8 @@ const useUndoManager = () => {
777
777
  });
778
778
  },
779
779
  removeBlocks: (x) => {
780
- var w;
781
- const y = (w = first(x)) == null ? void 0 : w._parent, v = r.filter((A) => y ? A._parent === y : !A._parent).indexOf(first(x));
780
+ var A;
781
+ const y = (A = first(x)) == null ? void 0 : A._parent, v = r.filter((w) => y ? w._parent === y : !w._parent).indexOf(first(x));
782
782
  l(map(x, "_id")), o({
783
783
  undo: () => a(x, y, v),
784
784
  redo: () => l(map(x, "_id"))
@@ -787,17 +787,17 @@ const useUndoManager = () => {
787
787
  updateBlocks: (x, y, b) => {
788
788
  let v = [];
789
789
  if (b)
790
- v = map(x, (w) => ({ _id: w, ...b }));
790
+ v = map(x, (A) => ({ _id: A, ...b }));
791
791
  else {
792
- const w = keys(y);
793
- v = map(x, (A) => {
794
- const E = r.find((S) => S._id === A), _ = { _id: A };
795
- return each(w, (S) => _[S] = E[S]), _;
792
+ const A = keys(y);
793
+ v = map(x, (w) => {
794
+ const E = r.find((S) => S._id === w), _ = { _id: w };
795
+ return each(A, (S) => _[S] = E[S]), _;
796
796
  });
797
797
  }
798
- d(map(x, (w) => ({ _id: w, ...y }))), o({
798
+ d(map(x, (A) => ({ _id: A, ...y }))), o({
799
799
  undo: () => d(v),
800
- redo: () => d(map(x, (w) => ({ _id: w, ...y })))
800
+ redo: () => d(map(x, (A) => ({ _id: A, ...y })))
801
801
  });
802
802
  },
803
803
  updateBlocksRuntime: (x, y) => {
@@ -812,8 +812,8 @@ const useUndoManager = () => {
812
812
  updateMultipleBlocksProps: (x) => {
813
813
  let y = [];
814
814
  y = map(x, (b) => {
815
- const v = keys(b), w = r.find((E) => E._id === b._id), A = {};
816
- return each(v, (E) => A[E] = w[E]), A;
815
+ const v = keys(b), A = r.find((E) => E._id === b._id), w = {};
816
+ return each(v, (E) => w[E] = A[E]), w;
817
817
  }), d(x), o({
818
818
  undo: () => d(y),
819
819
  redo: () => d(x)
@@ -2302,8 +2302,8 @@ const getBlockWithChildren = (o, r) => {
2302
2302
  for (const y in x) {
2303
2303
  const b = x[y];
2304
2304
  if (typeof b == "string" && startsWith(b, STYLES_KEY)) {
2305
- const { baseClasses: v, classes: w } = getSplitChaiClasses(b);
2306
- x[y] = compact(flattenDeep([v, w])).join(" ");
2305
+ const { baseClasses: v, classes: A } = getSplitChaiClasses(b);
2306
+ x[y] = compact(flattenDeep([v, A])).join(" ");
2307
2307
  } else
2308
2308
  y !== "_id" && delete x[y];
2309
2309
  }
@@ -2315,21 +2315,21 @@ const getBlockWithChildren = (o, r) => {
2315
2315
  if (l) {
2316
2316
  r(!0), a(null);
2317
2317
  try {
2318
- const b = p === u ? "" : p, v = m === "content" ? pickOnlyAIProps(cloneDeep(getBlockWithChildren(f, c)), p) : [h(f, c)], w = await l(m, addLangToPrompt(x, g, m), v, b), { blocks: A, error: E } = w;
2318
+ const b = p === u ? "" : p, v = m === "content" ? pickOnlyAIProps(cloneDeep(getBlockWithChildren(f, c)), p) : [h(f, c)], A = await l(m, addLangToPrompt(x, g, m), v, b), { blocks: w, error: E } = A;
2319
2319
  if (E) {
2320
2320
  a(E);
2321
2321
  return;
2322
2322
  }
2323
2323
  if (m === "styles") {
2324
- const _ = A.map((S) => {
2324
+ const _ = w.map((S) => {
2325
2325
  for (const B in S)
2326
2326
  B !== "_id" && (S[B] = `${STYLES_KEY},${S[B]}`);
2327
2327
  return S;
2328
2328
  });
2329
2329
  d(_);
2330
2330
  } else
2331
- i(A);
2332
- y && y(w);
2331
+ i(w);
2332
+ y && y(A);
2333
2333
  } catch (b) {
2334
2334
  a(b);
2335
2335
  } finally {
@@ -3050,8 +3050,8 @@ const useDnd = () => {
3050
3050
  var E;
3051
3051
  const f = dropTarget, y = getOrientation(f) === "vertical" ? m.clientY + ((E = iframeDocument == null ? void 0 : iframeDocument.defaultView) == null ? void 0 : E.scrollY) : m.clientX;
3052
3052
  dropIndex = calculateDropIndex(y, possiblePositions);
3053
- const b = c, v = f.getAttribute("data-block-id"), w = dropTarget.getAttribute("data-dnd-dragged") !== "yes";
3054
- if ((b == null ? void 0 : b._id) === v || !w) {
3053
+ const b = c, v = f.getAttribute("data-block-id"), A = dropTarget.getAttribute("data-dnd-dragged") !== "yes";
3054
+ if ((b == null ? void 0 : b._id) === v || !A) {
3055
3055
  h();
3056
3056
  return;
3057
3057
  }
@@ -3059,8 +3059,8 @@ const useDnd = () => {
3059
3059
  a(b, v === "canvas" ? null : v, dropIndex), setTimeout(h, 300);
3060
3060
  return;
3061
3061
  }
3062
- let A = f.getAttribute("data-block-id");
3063
- A === null && (A = m.target.parentElement.getAttribute("data-block-id")), d([b._id], A === "canvas" ? null : A, dropIndex), h(), setTimeout(removePlaceholder, 300);
3062
+ let w = f.getAttribute("data-block-id");
3063
+ w === null && (w = m.target.parentElement.getAttribute("data-block-id")), d([b._id], w === "canvas" ? null : w, dropIndex), h(), setTimeout(removePlaceholder, 300);
3064
3064
  },
3065
3065
  onDragEnter: (m) => {
3066
3066
  const f = m, x = f.target;
@@ -3202,15 +3202,15 @@ const useHandleCanvasDblClick = (o, r) => {
3202
3202
  tailwindForms,
3203
3203
  tailwindAspectRatio,
3204
3204
  twContainer,
3205
- plugin(function({ addBase: v, theme: w }) {
3205
+ plugin(function({ addBase: v, theme: A }) {
3206
3206
  v({
3207
3207
  "h1,h2,h3,h4,h5,h6": {
3208
- fontFamily: w("fontFamily.heading")
3208
+ fontFamily: A("fontFamily.heading")
3209
3209
  },
3210
3210
  body: {
3211
- fontFamily: w("fontFamily.body"),
3212
- color: w("colors.foreground"),
3213
- backgroundColor: w("colors.background")
3211
+ fontFamily: A("fontFamily.body"),
3212
+ color: A("colors.foreground"),
3213
+ backgroundColor: A("colors.background")
3214
3214
  }
3215
3215
  });
3216
3216
  })
@@ -3232,11 +3232,11 @@ const useHandleCanvasDblClick = (o, r) => {
3232
3232
  c.querySelector("#drop-target-block").innerHTML = d ? `[data-block-id="${d}"]{ outline: 1px dashed orange !important; outline-offset: -1px;}` : "";
3233
3233
  }, [d, c]);
3234
3234
  const x = useMemo(() => {
3235
- const { heading: v, body: w } = {
3235
+ const { heading: v, body: A } = {
3236
3236
  heading: get(o, "fontFamily.heading"),
3237
3237
  body: get(o, "fontFamily.body")
3238
3238
  };
3239
- return f.filter((A) => A.family === v || A.family === w);
3239
+ return f.filter((w) => w.family === v || w.family === A);
3240
3240
  }, [o == null ? void 0 : o.fontFamily, f]), y = useMemo(() => getThemeFontsLinkMarkup(filter(x, (v) => has(v, "url"))), [x]), b = useMemo(
3241
3241
  () => getThemeCustomFontFace(filter(x, (v) => has(v, "src"))),
3242
3242
  [x]
@@ -3261,7 +3261,7 @@ const useHandleCanvasDblClick = (o, r) => {
3261
3261
  }, []), /* @__PURE__ */ jsx("div", { id: "main-content", onClick: () => {
3262
3262
  a([]), l([]);
3263
3263
  }, className: "h-full w-full p-8 pb-0", ref: i, children: o });
3264
- }, useBlockRuntimeProps = () => {
3264
+ }, ErrorFallback = () => /* @__PURE__ */ jsx("div", { className: "flex min-h-[100px] items-center justify-center bg-red-50 p-2 text-center text-red-500", children: "Something went wrong." }), useBlockRuntimeProps = () => {
3265
3265
  const [o] = useBlocksStore();
3266
3266
  return useCallback(
3267
3267
  (r, n) => isEmpty(n) ? {} : Object.entries(n).reduce((a, [l, i]) => {
@@ -3277,7 +3277,27 @@ const useHandleCanvasDblClick = (o, r) => {
3277
3277
  }, RepeaterContext = createContext({
3278
3278
  index: -1,
3279
3279
  key: ""
3280
- }), BlockRenderer = ({
3280
+ }), CORE_BLOCKS = [
3281
+ "Box",
3282
+ "Repeater",
3283
+ "GlobalBlock",
3284
+ "PartialBlock",
3285
+ "Heading",
3286
+ "Text",
3287
+ "RichText",
3288
+ "Span",
3289
+ "Image",
3290
+ "Button",
3291
+ "Paragraph",
3292
+ "Link",
3293
+ "Video",
3294
+ "Audio",
3295
+ "Icon",
3296
+ "List",
3297
+ "ListItem",
3298
+ "CustomScript",
3299
+ "CustomHTML"
3300
+ ], BlockRenderer = ({
3281
3301
  blockAtom: o,
3282
3302
  children: r
3283
3303
  }) => {
@@ -3316,8 +3336,9 @@ const useHandleCanvasDblClick = (o, r) => {
3316
3336
  y,
3317
3337
  b
3318
3338
  ]
3319
- );
3320
- return isNull(g) || p.includes(n._id) ? null : /* @__PURE__ */ jsx(Suspense, { children: createElement(g, {
3339
+ ), A = useMemo(() => !CORE_BLOCKS.includes(n._type), [n._type]);
3340
+ if (isNull(g) || p.includes(n._id)) return null;
3341
+ const w = /* @__PURE__ */ jsx(Suspense, { children: createElement(g, {
3321
3342
  ...v,
3322
3343
  children: r({
3323
3344
  _id: n._id,
@@ -3330,6 +3351,7 @@ const useHandleCanvasDblClick = (o, r) => {
3330
3351
  ...n.globalBlock ? { partialBlockId: n.globalBlock } : ""
3331
3352
  })
3332
3353
  }) });
3354
+ return A ? /* @__PURE__ */ jsx(ErrorBoundary, { fallbackRender: ErrorFallback, children: w }) : w;
3333
3355
  }, PartialBlocksRenderer = ({ partialBlockId: o }) => {
3334
3356
  const { getPartailBlocks: r } = usePartialBlocksStore(), n = useMemo(() => r(o), [r, o]), a = useMemo(() => splitAtom(atom(n)), [n]);
3335
3357
  return isEmpty(n) ? null : /* @__PURE__ */ jsx(BlocksRenderer, { splitAtoms: a, blocks: n });
@@ -3382,7 +3404,7 @@ const useHandleCanvasDblClick = (o, r) => {
3382
3404
  d();
3383
3405
  }, [r, o, n, d]), l;
3384
3406
  }, getElementByStyleId = (o, r) => o.querySelector(`[data-style-id="${r}"]`), StaticCanvas = () => {
3385
- const [o] = useAtom$1(networkModeAtom), [r] = useCanvasDisplayWidth(), [, n] = useSelectedBlockIds(), a = useSelectedBlock(), [, l] = useHighlightBlockId(), i = useRef(null), d = useRef(null), [c, p] = useState({ width: 0, height: 0 }), u = useCanvasScale(c), [g, h] = useState([]), [, m] = useState([]), [, f] = useAtom$1(canvasIframeAtom), [x, y] = useSelectedStylingBlocks(), b = useBuilderProp("loading", !1), v = useBuilderProp("htmlDir", "ltr"), w = (_) => {
3407
+ const [o] = useAtom$1(networkModeAtom), [r] = useCanvasDisplayWidth(), [, n] = useSelectedBlockIds(), a = useSelectedBlock(), [, l] = useHighlightBlockId(), i = useRef(null), d = useRef(null), [c, p] = useState({ width: 0, height: 0 }), u = useCanvasScale(c), [g, h] = useState([]), [, m] = useState([]), [, f] = useAtom$1(canvasIframeAtom), [x, y] = useSelectedStylingBlocks(), b = useBuilderProp("loading", !1), v = useBuilderProp("htmlDir", "ltr"), A = (_) => {
3386
3408
  p((S) => ({ ...S, width: _ }));
3387
3409
  };
3388
3410
  useEffect(() => {
@@ -3390,7 +3412,7 @@ const useHandleCanvasDblClick = (o, r) => {
3390
3412
  const { clientWidth: _, clientHeight: S } = d.current;
3391
3413
  p({ width: _, height: S });
3392
3414
  }, [d, r]);
3393
- const A = (_, S = 0) => {
3415
+ const w = (_, S = 0) => {
3394
3416
  const { top: B } = _.getBoundingClientRect();
3395
3417
  return B + S >= 0 && B - S <= window.innerHeight;
3396
3418
  };
@@ -3398,7 +3420,7 @@ const useHandleCanvasDblClick = (o, r) => {
3398
3420
  var _, S;
3399
3421
  if (a != null && a._id && a.type !== "Multiple" && i.current) {
3400
3422
  const B = getElementByDataBlockId(i.current.contentDocument, a._id);
3401
- B && (A(B) || (S = (_ = i.current) == null ? void 0 : _.contentWindow) == null || S.scrollTo({ top: B.offsetTop, behavior: "smooth" }), h([B]));
3423
+ B && (w(B) || (S = (_ = i.current) == null ? void 0 : _.contentWindow) == null || S.scrollTo({ top: B.offsetTop, behavior: "smooth" }), h([B]));
3402
3424
  }
3403
3425
  }, [a == null ? void 0 : a._id, a == null ? void 0 : a.type]), useEffect(() => {
3404
3426
  if (!isEmpty(x) && i.current) {
@@ -3414,7 +3436,7 @@ const useHandleCanvasDblClick = (o, r) => {
3414
3436
  let _ = IframeInitialContent;
3415
3437
  return _ = _.replace("__HTML_DIR__", v), o === "offline" && (_ = _.replace("https://chaibuilder.com/offline/tailwind.cdn.js", "/offline/tailwind.cdn.js")), _;
3416
3438
  }, [o, v]);
3417
- return /* @__PURE__ */ jsx(ResizableCanvasWrapper, { onMount: w, onResize: w, children: /* @__PURE__ */ jsx(
3439
+ return /* @__PURE__ */ jsx(ResizableCanvasWrapper, { onMount: A, onResize: A, children: /* @__PURE__ */ jsx(
3418
3440
  "div",
3419
3441
  {
3420
3442
  onClick: () => {
@@ -3567,7 +3589,7 @@ const JSONFormFieldTemplate = ({
3567
3589
  formData: g,
3568
3590
  onChange: h
3569
3591
  }) => {
3570
- const { selectedLang: m, fallbackLang: f, languages: x } = useLanguages(), y = isEmpty(x) ? "" : isEmpty(m) ? f : m, b = get(LANGUAGES, y, y), v = usePageExternalData(), w = useSelectedBlock(), A = useRegisteredChaiBlocks(), E = get(A, [w == null ? void 0 : w._type, "i18nProps"], []) || [], [_, S] = useState(null), B = useSelectedBlockHierarchy(), T = useMemo(() => B.length === 1 ? "" : `#${get(
3592
+ const { selectedLang: m, fallbackLang: f, languages: x } = useLanguages(), y = isEmpty(x) ? "" : isEmpty(m) ? f : m, b = get(LANGUAGES, y, y), v = usePageExternalData(), A = useSelectedBlock(), w = useRegisteredChaiBlocks(), E = get(w, [A == null ? void 0 : A._type, "i18nProps"], []) || [], [_, S] = useState(null), B = useSelectedBlockHierarchy(), T = useMemo(() => B.length === 1 ? "" : `#${get(
3571
3593
  B.find((L) => L._type === "Repeater"),
3572
3594
  "repeaterItems",
3573
3595
  ""
@@ -3617,7 +3639,7 @@ const JSONFormFieldTemplate = ({
3617
3639
  h(K, {}, o);
3618
3640
  }
3619
3641
  },
3620
- [o, h, g, w == null ? void 0 : w._id, T]
3642
+ [o, h, g, A == null ? void 0 : A._id, T]
3621
3643
  );
3622
3644
  if (c)
3623
3645
  return null;
@@ -3857,7 +3879,7 @@ const ImagePickerField = ({ value: o, onChange: r, id: n, onBlur: a }) => {
3857
3879
  onChange: n
3858
3880
  }) => {
3859
3881
  var T;
3860
- const { t: a } = useTranslation(), l = useBuilderProp("searchPageTypeItems", (C, k) => []), [i, d] = useState(!1), [c, p] = useState(!1), [u, g] = useState("page"), [h, m] = useState(""), [f, x] = useState([]), [y, b] = useState(-1), v = useRef(null), w = (T = r == null ? void 0 : r.find((C) => C.key === u)) == null ? void 0 : T.name;
3882
+ const { t: a } = useTranslation(), l = useBuilderProp("searchPageTypeItems", (C, k) => []), [i, d] = useState(!1), [c, p] = useState(!1), [u, g] = useState("page"), [h, m] = useState(""), [f, x] = useState([]), [y, b] = useState(-1), v = useRef(null), A = (T = r == null ? void 0 : r.find((C) => C.key === u)) == null ? void 0 : T.name;
3861
3883
  useEffect(() => {
3862
3884
  if (m(""), x([]), b(-1), p(!1), !o || i || !startsWith(o, "pageType:")) return;
3863
3885
  const C = split(o, ":"), k = get(C, 1, "page") || "page";
@@ -3866,7 +3888,7 @@ const ImagePickerField = ({ value: o, onChange: r, id: n, onBlur: a }) => {
3866
3888
  j && Array.isArray(j) && m(get(j, [0, "name"], ""));
3867
3889
  })();
3868
3890
  }, [o]);
3869
- const A = useDebouncedCallback(
3891
+ const w = useDebouncedCallback(
3870
3892
  async (C) => {
3871
3893
  if (isEmpty(C))
3872
3894
  x([]);
@@ -3907,7 +3929,7 @@ const ImagePickerField = ({ value: o, onChange: r, id: n, onBlur: a }) => {
3907
3929
  const S = () => {
3908
3930
  m(""), x([]), b(-1), p(!1), n("");
3909
3931
  }, B = (C) => {
3910
- m(C), p(!isEmpty(C)), d(!0), A(C);
3932
+ m(C), p(!isEmpty(C)), d(!0), w(C);
3911
3933
  };
3912
3934
  return /* @__PURE__ */ jsxs("div", { children: [
3913
3935
  /* @__PURE__ */ jsx("select", { name: "pageType", value: u, onChange: (C) => g(C.target.value), children: map(r, (C) => /* @__PURE__ */ jsx("option", { value: C.key, children: C.name }, C.key)) }),
@@ -3919,7 +3941,7 @@ const ImagePickerField = ({ value: o, onChange: r, id: n, onBlur: a }) => {
3919
3941
  value: h,
3920
3942
  onChange: (C) => B(C.target.value),
3921
3943
  onKeyDown: _,
3922
- placeholder: a(`Search ${w ?? ""}`),
3944
+ placeholder: a(`Search ${A ?? ""}`),
3923
3945
  className: "w-full rounded-md border border-gray-300 p-2 pr-16"
3924
3946
  }
3925
3947
  ),
@@ -4231,11 +4253,11 @@ const MenuBar = ({ editor: o, onExpand: r }) => {
4231
4253
  if (f !== x)
4232
4254
  u.chain().deleteSelection().insertContent(m).run();
4233
4255
  else {
4234
- const { state: b } = u, v = b.selection.from, w = b.doc.textBetween(Math.max(0, v - 1), v), A = b.doc.textBetween(v, Math.min(v + 1, b.doc.content.size));
4256
+ const { state: b } = u, v = b.selection.from, A = b.doc.textBetween(Math.max(0, v - 1), v), w = b.doc.textBetween(v, Math.min(v + 1, b.doc.content.size));
4235
4257
  let E = "";
4236
- v > 0 && w !== " " && !/[.,!?;:]/.test(w) && (E = " ");
4258
+ v > 0 && A !== " " && !/[.,!?;:]/.test(A) && (E = " ");
4237
4259
  let _ = "";
4238
- A && A !== " " && !/[.,!?;:]/.test(A) && (_ = " "), u.chain().insertContent(E + m + _).run();
4260
+ w && w !== " " && !/[.,!?;:]/.test(w) && (_ = " "), u.chain().insertContent(E + m + _).run();
4239
4261
  }
4240
4262
  };
4241
4263
  return /* @__PURE__ */ jsx(Dialog, { open: o, onOpenChange: (h) => !h && r(), children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-h-[90vh] overflow-y-auto sm:max-w-[800px]", children: [
@@ -4582,7 +4604,7 @@ function BlockSettings() {
4582
4604
  S && (n([r._id], { [S]: get(_, S) }), x({ formData: _ }, S, { [S]: get(d, S) }));
4583
4605
  }, b = ({ formData: _ }, S) => {
4584
4606
  S && (n([g._id], { [S]: get(_, S) }), x({ formData: _ }, S, { [S]: get(d, S) }));
4585
- }, { schema: v, uiSchema: w } = useMemo(() => {
4607
+ }, { schema: v, uiSchema: A } = useMemo(() => {
4586
4608
  const _ = r == null ? void 0 : r._type;
4587
4609
  if (!_)
4588
4610
  return { schema: {}, uiSchema: {} };
@@ -4591,7 +4613,7 @@ function BlockSettings() {
4591
4613
  } catch {
4592
4614
  return { schema: {}, uiSchema: {} };
4593
4615
  }
4594
- }, [r]), { wrapperSchema: A, wrapperUiSchema: E } = useMemo(() => {
4616
+ }, [r]), { wrapperSchema: w, wrapperUiSchema: E } = useMemo(() => {
4595
4617
  if (!g || !(g != null && g._type))
4596
4618
  return { wrapperSchema: {}, wrapperUiSchema: {} };
4597
4619
  const _ = g == null ? void 0 : g._type, { schema: S = {}, uiSchema: B = {} } = getBlockFormSchemas(_);
@@ -4623,7 +4645,7 @@ function BlockSettings() {
4623
4645
  blockId: g == null ? void 0 : g._id,
4624
4646
  onChange: b,
4625
4647
  formData: m,
4626
- schema: A,
4648
+ schema: w,
4627
4649
  uiSchema: E
4628
4650
  }
4629
4651
  ) })
@@ -4635,7 +4657,7 @@ function BlockSettings() {
4635
4657
  onChange: y,
4636
4658
  formData: i,
4637
4659
  schema: v,
4638
- uiSchema: w
4660
+ uiSchema: A
4639
4661
  }
4640
4662
  )
4641
4663
  ] });
@@ -4812,7 +4834,7 @@ const BlockStylingProps = () => {
4812
4834
  },
4813
4835
  a
4814
4836
  )) }), THROTTLE_TIME = 50, AdvanceChoices = (o) => {
4815
- const [r, n] = useState(!1), [a, l] = useState(""), { currentClass: i, onChange: d, classPrefix: c, cssProperty: p, units: u, negative: g } = o, [h, m] = useState(p != null && p.toLowerCase().includes("width") ? "%" : u[0]), [f, x] = useState(!1), [y, b] = useState(""), [v, w] = useState(!1), [A, E] = useState(!1);
4837
+ const [r, n] = useState(!1), [a, l] = useState(""), { currentClass: i, onChange: d, classPrefix: c, cssProperty: p, units: u, negative: g } = o, [h, m] = useState(p != null && p.toLowerCase().includes("width") ? "%" : u[0]), [f, x] = useState(!1), [y, b] = useState(""), [v, A] = useState(!1), [w, E] = useState(!1);
4816
4838
  useEffect(() => {
4817
4839
  const { value: C, unit: k } = getClassValueAndUnit(i);
4818
4840
  if (k === "") {
@@ -4890,7 +4912,7 @@ const BlockStylingProps = () => {
4890
4912
  S(P);
4891
4913
  },
4892
4914
  onKeyUp: (C) => {
4893
- A && (C.preventDefault(), E(!1));
4915
+ w && (C.preventDefault(), E(!1));
4894
4916
  },
4895
4917
  onBlur: () => B(),
4896
4918
  onChange: (C) => {
@@ -4935,9 +4957,9 @@ const BlockStylingProps = () => {
4935
4957
  ["none", "auto"].indexOf(h) !== -1 || v ? null : /* @__PURE__ */ jsx(
4936
4958
  DragStyleButton,
4937
4959
  {
4938
- onDragStart: () => w(!0),
4960
+ onDragStart: () => A(!0),
4939
4961
  onDragEnd: (C) => {
4940
- if (b(() => ""), w(!1), isEmpty(C))
4962
+ if (b(() => ""), A(!1), isEmpty(C))
4941
4963
  return;
4942
4964
  const k = `${C}`, I = `${k.startsWith("-") ? "-" : ""}${c}[${k.replace("-", "")}${h === "-" ? "" : h}]`;
4943
4965
  _(I);
@@ -5420,13 +5442,13 @@ const COLOR_PROP = {
5420
5442
  [x, p, g, u, l, m]
5421
5443
  ), v = useCallback(() => {
5422
5444
  f(x, [y], !0);
5423
- }, [x, y, f]), w = useMemo(() => canChangeClass(h, g), [h, g]);
5445
+ }, [x, y, f]), A = useMemo(() => canChangeClass(h, g), [h, g]);
5424
5446
  useEffect(() => {
5425
- i(w, h);
5426
- }, [w, i, h]);
5427
- const [, , A] = useScreenSizeWidth(), E = useCallback(
5447
+ i(A, h);
5448
+ }, [A, i, h]);
5449
+ const [, , w] = useScreenSizeWidth(), E = useCallback(
5428
5450
  (S) => {
5429
- A({
5451
+ w({
5430
5452
  xs: 400,
5431
5453
  sm: 640,
5432
5454
  md: 800,
@@ -5435,9 +5457,9 @@ const COLOR_PROP = {
5435
5457
  "2xl": 1920
5436
5458
  }[S]);
5437
5459
  },
5438
- [A]
5460
+ [w]
5439
5461
  ), _ = get(h, "dark", null) === p && get(h, "mod", null) === u && get(h, "mq", null) === g;
5440
- return /* @__PURE__ */ jsx(BlockStyleProvider, { canChange: w, canReset: h && _, children: /* @__PURE__ */ jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
5462
+ return /* @__PURE__ */ jsx(BlockStyleProvider, { canChange: A, canReset: h && _, children: /* @__PURE__ */ jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
5441
5463
  /* @__PURE__ */ jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ jsx("span", { className: `text-[11px] ${h && !_ ? "text-foreground" : ""}`, children: r(a) }) }),
5442
5464
  /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center", children: [
5443
5465
  /* @__PURE__ */ jsxs("div", { className: "w-[150px]", children: [
@@ -5457,7 +5479,7 @@ const COLOR_PROP = {
5457
5479
  n === "color" && /* @__PURE__ */ jsx(ColorChoice, { property: l, onChange: b }),
5458
5480
  n === "dropdown" && /* @__PURE__ */ jsx(DropDownChoices, { label: a, property: l, onChange: b })
5459
5481
  ] }),
5460
- /* @__PURE__ */ jsx("div", { className: `w-[30px] cursor-pointer ${y ? "visible" : "invisible"}`, children: _ ? /* @__PURE__ */ jsx("button", { type: "button", onClick: () => v(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ jsx(CrossCircledIcon, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : w && h ? /* @__PURE__ */ jsxs(Tooltip, { delayDuration: 100, children: [
5482
+ /* @__PURE__ */ jsx("div", { className: `w-[30px] cursor-pointer ${y ? "visible" : "invisible"}`, children: _ ? /* @__PURE__ */ jsx("button", { type: "button", onClick: () => v(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ jsx(CrossCircledIcon, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : A && h ? /* @__PURE__ */ jsxs(Tooltip, { delayDuration: 100, children: [
5461
5483
  /* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsx(
5462
5484
  "button",
5463
5485
  {
@@ -5858,10 +5880,10 @@ const AskAIStyles = ({ blockId: o }) => {
5858
5880
  };
5859
5881
  function ManualClasses() {
5860
5882
  var I;
5861
- const o = useRef(null), [r, n] = useState(""), [a, l] = useState(-1), i = useFuseSearch(), { t: d } = useTranslation(), [c] = useSelectedStylingBlocks(), p = useSelectedBlock(), u = useAddClassesToBlocks(), g = useRemoveClassesFromBlocks(), [h] = useSelectedBlockIds(), m = useBuilderProp("askAiCallBack", null), [f, x] = useState(""), y = (I = first(c)) == null ? void 0 : I.prop, { classes: b } = getSplitChaiClasses(get(p, y, "")), v = b.split(" ").filter((N) => !isEmpty(N)), w = () => {
5883
+ const o = useRef(null), [r, n] = useState(""), [a, l] = useState(-1), i = useFuseSearch(), { t: d } = useTranslation(), [c] = useSelectedStylingBlocks(), p = useSelectedBlock(), u = useAddClassesToBlocks(), g = useRemoveClassesFromBlocks(), [h] = useSelectedBlockIds(), m = useBuilderProp("askAiCallBack", null), [f, x] = useState(""), y = (I = first(c)) == null ? void 0 : I.prop, { classes: b } = getSplitChaiClasses(get(p, y, "")), v = b.split(" ").filter((N) => !isEmpty(N)), A = () => {
5862
5884
  const N = f.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
5863
5885
  u(h, N, !0), x("");
5864
- }, [A, E] = useState([]), _ = ({ value: N }) => {
5886
+ }, [w, E] = useState([]), _ = ({ value: N }) => {
5865
5887
  const P = N.trim().toLowerCase(), L = P.match(/.+:/g);
5866
5888
  let O = [];
5867
5889
  if (L && L.length > 0) {
@@ -5890,7 +5912,7 @@ function ManualClasses() {
5890
5912
  }, 0);
5891
5913
  },
5892
5914
  onKeyDown: (N) => {
5893
- N.key === "Enter" && f.trim() !== "" && w();
5915
+ N.key === "Enter" && f.trim() !== "" && A();
5894
5916
  },
5895
5917
  onChange: (N, { newValue: P }) => x(P),
5896
5918
  className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
@@ -5928,7 +5950,7 @@ function ManualClasses() {
5928
5950
  /* @__PURE__ */ jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ jsx(
5929
5951
  Autosuggest,
5930
5952
  {
5931
- suggestions: A,
5953
+ suggestions: w,
5932
5954
  onSuggestionsFetchRequested: _,
5933
5955
  onSuggestionsClearRequested: S,
5934
5956
  getSuggestionValue: B,
@@ -5949,7 +5971,7 @@ function ManualClasses() {
5949
5971
  {
5950
5972
  variant: "outline",
5951
5973
  className: "h-6 border-border",
5952
- onClick: w,
5974
+ onClick: A,
5953
5975
  disabled: f.trim() === "",
5954
5976
  size: "sm",
5955
5977
  children: /* @__PURE__ */ jsx(PlusIcon, {})
@@ -6374,22 +6396,22 @@ const CoreBlock = ({
6374
6396
  }
6375
6397
  }
6376
6398
  }, traverseNodes = (o, r = null) => flatMapDeep(o, (n) => {
6377
- var h, m, f, x, y, b, v, w;
6399
+ var h, m, f, x, y, b, v, A;
6378
6400
  if (n.type === "comment") return [];
6379
6401
  console.log("node ===>", n);
6380
6402
  let a = { _id: generateUUID() };
6381
6403
  if (r && (a._parent = r.block._id), n.type === "text")
6382
6404
  return isEmpty(get(n, "content", "")) ? [] : r && shouldAddText(r.node, r.block) ? (set(r, "block.content", get(n, "content", "")), []) : { ...a, _type: "Text", content: get(n, "content", "") };
6383
6405
  const l = get(n, "attributes", []), i = l.find(
6384
- (A) => A.key === "data-chai-richtext" || A.key === "chai-richtext"
6406
+ (w) => w.key === "data-chai-richtext" || w.key === "chai-richtext"
6385
6407
  ), d = l.find(
6386
- (A) => A.key === "data-chai-lightbox" || A.key === "chai-lightbox"
6408
+ (w) => w.key === "data-chai-lightbox" || w.key === "chai-lightbox"
6387
6409
  ), c = l.find(
6388
- (A) => A.key === "data-chai-dropdown" || A.key === "chai-dropdown"
6410
+ (w) => w.key === "data-chai-dropdown" || w.key === "chai-dropdown"
6389
6411
  ), p = l.find(
6390
- (A) => A.key === "data-chai-dropdown-button" || A.key === "chai-dropdown-button"
6412
+ (w) => w.key === "data-chai-dropdown-button" || w.key === "chai-dropdown-button"
6391
6413
  ), u = l.find(
6392
- (A) => A.key === "data-chai-dropdown-content" || A.key === "chai-dropdown-content"
6414
+ (w) => w.key === "data-chai-dropdown-content" || w.key === "chai-dropdown-content"
6393
6415
  );
6394
6416
  if (a = {
6395
6417
  ...a,
@@ -6397,13 +6419,13 @@ const CoreBlock = ({
6397
6419
  ...getAttrs(n),
6398
6420
  ...getStyles(n)
6399
6421
  }, n.attributes) {
6400
- const A = n.attributes.find((E) => includes(NAME_ATTRIBUTES, E.key));
6401
- A && (a._name = A.value);
6422
+ const w = n.attributes.find((E) => includes(NAME_ATTRIBUTES, E.key));
6423
+ w && (a._name = w.value);
6402
6424
  }
6403
6425
  if (i)
6404
6426
  return a.content = stringify(n.children), has(a, "styles_attrs.data-chai-richtext") && delete a.styles_attrs["data-chai-richtext"], has(a, "styles_attrs.chai-richtext") && delete a.styles_attrs["chai-richtext"], [a];
6405
6427
  if (d) {
6406
- const A = [
6428
+ const w = [
6407
6429
  "data-chai-lightbox",
6408
6430
  "chai-lightbox",
6409
6431
  "data-vbtype",
@@ -6421,14 +6443,14 @@ const CoreBlock = ({
6421
6443
  maxWidth: ((y = (x = l.find((E) => E.key === "data-maxwidth")) == null ? void 0 : x.value) == null ? void 0 : y.replace("px", "")) || "",
6422
6444
  backdropColor: ((b = l.find((E) => E.key === "data-overlay")) == null ? void 0 : b.value) || "",
6423
6445
  galleryName: ((v = l.find((E) => E.key === "data-gall")) == null ? void 0 : v.value) || ""
6424
- }, forEach(A, (E) => {
6446
+ }, forEach(w, (E) => {
6425
6447
  has(a, `styles_attrs.${E}`) && delete a.styles_attrs[E];
6426
6448
  });
6427
6449
  }
6428
6450
  if (c && (delete a.styles_attrs, a.showDropdown = !1), u && delete a.styles_attrs, p) {
6429
6451
  delete a.styles_attrs;
6430
- const A = filter(n.children || [], (_) => (_ == null ? void 0 : _.tagName) !== "span");
6431
- a.content = getTextContent(A);
6452
+ const w = filter(n.children || [], (_) => (_ == null ? void 0 : _.tagName) !== "span");
6453
+ a.content = getTextContent(w);
6432
6454
  const E = find(
6433
6455
  n.children || [],
6434
6456
  (_) => (_ == null ? void 0 : _.tagName) === "span" && some(_.children || [], (S) => (S == null ? void 0 : S.tagName) === "svg")
@@ -6444,15 +6466,15 @@ const CoreBlock = ({
6444
6466
  return [a];
6445
6467
  }
6446
6468
  if (a._type === "Input") {
6447
- const A = a.inputType || "text";
6448
- A === "checkbox" ? set(a, "_type", "Checkbox") : A === "radio" && set(a, "_type", "Radio");
6469
+ const w = a.inputType || "text";
6470
+ w === "checkbox" ? set(a, "_type", "Checkbox") : w === "radio" && set(a, "_type", "Radio");
6449
6471
  } else if (n.tagName === "video" || n.tagName === "iframe") {
6450
- const A = stringify([n]);
6451
- return hasVideoEmbed(A) && (set(a, "_type", "Video"), set(a, "url", getVideoURLFromHTML(A)), set(a, "styles", `${STYLES_KEY},`), set(a, "controls", { autoPlay: !1, muted: !0, loop: !1, controls: !1 })), a.content = A, [a];
6472
+ const w = stringify([n]);
6473
+ return hasVideoEmbed(w) && (set(a, "_type", "Video"), set(a, "url", getVideoURLFromHTML(w)), set(a, "styles", `${STYLES_KEY},`), set(a, "controls", { autoPlay: !1, muted: !0, loop: !1, controls: !1 })), a.content = w, [a];
6452
6474
  } else if (n.tagName === "svg") {
6453
- const A = find(n.attributes, { key: "height" }), E = find(n.attributes, { key: "width" }), _ = get(A, "value") ? `[${get(A, "value")}px]` : "24px", S = get(E, "value") ? `[${get(E, "value")}px]` : "24px", B = get(find(n.attributes, { key: "class" }), "value", "w-full h-full");
6475
+ const w = find(n.attributes, { key: "height" }), E = find(n.attributes, { key: "width" }), _ = get(w, "value") ? `[${get(w, "value")}px]` : "24px", S = get(E, "value") ? `[${get(E, "value")}px]` : "24px", B = get(find(n.attributes, { key: "class" }), "value", "w-full h-full");
6454
6476
  return a.styles = `${STYLES_KEY}, ${cn$1(`w-${S} h-${_}`, B)}`.trim(), n.attributes = filter(n.attributes, (T) => !includes(["style", "width", "height", "class"], T.key)), a.icon = stringify([n]), [a];
6455
- } else if (n.tagName == "option" && r && ((w = r.block) == null ? void 0 : w._type) === "Select")
6477
+ } else if (n.tagName == "option" && r && ((A = r.block) == null ? void 0 : A._type) === "Select")
6456
6478
  return r.block.options.push({
6457
6479
  label: getTextContent(n.children),
6458
6480
  ...getAttrs(n)
@@ -6556,18 +6578,18 @@ const BlockCard = ({
6556
6578
  parentId: n = void 0,
6557
6579
  position: a = -1
6558
6580
  }) => {
6559
- const [l, i] = useState(!1), d = useBuilderProp("getUILibraryBlock", noop), { addCoreBlock: c, addPredefinedBlock: p } = useAddBlock(), [, u] = useSelectedBlockIds(), { clearHighlight: g } = useBlockHighlight(), h = get(o, "name", get(o, "label")), m = get(o, "description", ""), f = useFeature("dnd"), [, x] = useAtom$1(draggedBlockAtom), y = (w) => {
6560
- const A = has(w, "styles_attrs.data-page-section");
6561
- return w._type === "Box" && A;
6581
+ const [l, i] = useState(!1), d = useBuilderProp("getUILibraryBlock", noop), { addCoreBlock: c, addPredefinedBlock: p } = useAddBlock(), [, u] = useSelectedBlockIds(), { clearHighlight: g } = useBlockHighlight(), h = get(o, "name", get(o, "label")), m = get(o, "description", ""), f = useFeature("dnd"), [, x] = useAtom$1(draggedBlockAtom), y = (A) => {
6582
+ const w = has(A, "styles_attrs.data-page-section");
6583
+ return A._type === "Box" && w;
6562
6584
  }, b = useCallback(
6563
- async (w) => {
6564
- if (w.stopPropagation(), has(o, "component")) {
6585
+ async (A) => {
6586
+ if (A.stopPropagation(), has(o, "component")) {
6565
6587
  c(o, n, a), pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK);
6566
6588
  return;
6567
6589
  }
6568
6590
  i(!0);
6569
- const A = await d(r, o);
6570
- isEmpty(A) || p(syncBlocksWithDefaults(A), n, a), pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK);
6591
+ const w = await d(r, o);
6592
+ isEmpty(w) || p(syncBlocksWithDefaults(w), n, a), pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK);
6571
6593
  },
6572
6594
  [c, p, o, d, r, n, a]
6573
6595
  );
@@ -6578,18 +6600,18 @@ const BlockCard = ({
6578
6600
  onClick: l ? () => {
6579
6601
  } : b,
6580
6602
  draggable: f ? "true" : "false",
6581
- onDragStart: async (w) => {
6582
- const A = await d(r, o);
6603
+ onDragStart: async (A) => {
6604
+ const w = await d(r, o);
6583
6605
  let E = n;
6584
- if (y(first(A)) && (E = null), !isEmpty(A)) {
6585
- const _ = { blocks: A, uiLibrary: !0, parent: E };
6586
- if (w.dataTransfer.setData("text/plain", JSON.stringify(_)), o.preview) {
6606
+ if (y(first(w)) && (E = null), !isEmpty(w)) {
6607
+ const _ = { blocks: w, uiLibrary: !0, parent: E };
6608
+ if (A.dataTransfer.setData("text/plain", JSON.stringify(_)), o.preview) {
6587
6609
  const S = new Image();
6588
6610
  S.src = o.preview, S.onload = () => {
6589
- w.dataTransfer.setDragImage(S, 0, 0);
6611
+ A.dataTransfer.setDragImage(S, 0, 0);
6590
6612
  };
6591
6613
  } else
6592
- w.dataTransfer.setDragImage(new Image(), 0, 0);
6614
+ A.dataTransfer.setDragImage(new Image(), 0, 0);
6593
6615
  x(_), setTimeout(() => {
6594
6616
  u([]), g(), pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK);
6595
6617
  }, 200);
@@ -6642,9 +6664,9 @@ const BlockCard = ({
6642
6664
  return;
6643
6665
  }
6644
6666
  }, [y, b]);
6645
- const w = get(y, b, []), A = useRef(null), { t: E } = useTranslation(), _ = (k) => {
6646
- A.current && (clearTimeout(A.current), A.current = null), A.current = setTimeout(() => {
6647
- A.current && v(k);
6667
+ const A = get(y, b, []), w = useRef(null), { t: E } = useTranslation(), _ = (k) => {
6668
+ w.current && (clearTimeout(w.current), w.current = null), w.current = setTimeout(() => {
6669
+ w.current && v(k);
6648
6670
  }, 400);
6649
6671
  }, S = () => {
6650
6672
  i != null && i.id && p(i.id);
@@ -6656,7 +6678,7 @@ const BlockCard = ({
6656
6678
  /* @__PURE__ */ jsx(Skeleton, { className: "col-span-3 h-full" }),
6657
6679
  /* @__PURE__ */ jsx(Skeleton, { className: "col-span-9 h-full" })
6658
6680
  ] });
6659
- const T = filter(w, (k, j) => j % 2 === 0), C = filter(w, (k, j) => j % 2 === 1);
6681
+ const T = filter(A, (k, j) => j % 2 === 0), C = filter(A, (k, j) => j % 2 === 1);
6660
6682
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: "flex h-full max-h-full flex-col", children: [
6661
6683
  /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 border-border py-2", children: /* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
6662
6684
  /* @__PURE__ */ jsx(Search, { className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" }),
@@ -6694,7 +6716,7 @@ const BlockCard = ({
6694
6716
  "div",
6695
6717
  {
6696
6718
  onMouseEnter: () => _(j),
6697
- onMouseLeave: () => clearTimeout(A.current),
6719
+ onMouseLeave: () => clearTimeout(w.current),
6698
6720
  role: "button",
6699
6721
  onClick: () => v(j),
6700
6722
  className: cn$1(
@@ -6713,10 +6735,10 @@ const BlockCard = ({
6713
6735
  /* @__PURE__ */ jsx("div", { className: "flex h-full max-h-full w-full flex-col border-l border-border", children: /* @__PURE__ */ jsxs(
6714
6736
  ScrollArea,
6715
6737
  {
6716
- onMouseEnter: () => A.current ? clearTimeout(A.current) : null,
6738
+ onMouseEnter: () => w.current ? clearTimeout(w.current) : null,
6717
6739
  className: "z-10 flex h-full max-h-full w-full flex-col gap-2 transition-all ease-linear",
6718
6740
  children: [
6719
- isEmpty(w) && !isEmpty(y) ? /* @__PURE__ */ jsx("div", { className: "flex h-full flex-col items-center justify-center p-6 text-center", children: /* @__PURE__ */ jsx("p", { className: "text-sm", children: E("No blocks found in this group") }) }) : /* @__PURE__ */ jsxs("div", { className: "grid w-full grid-cols-2 gap-2 px-2", children: [
6741
+ isEmpty(A) && !isEmpty(y) ? /* @__PURE__ */ jsx("div", { className: "flex h-full flex-col items-center justify-center p-6 text-center", children: /* @__PURE__ */ jsx("p", { className: "text-sm", children: E("No blocks found in this group") }) }) : /* @__PURE__ */ jsxs("div", { className: "grid w-full grid-cols-2 gap-2 px-2", children: [
6720
6742
  /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-1", children: T.map((k, j) => /* @__PURE__ */ jsx(
6721
6743
  BlockCard,
6722
6744
  {
@@ -6772,14 +6794,14 @@ const BlockCard = ({
6772
6794
  }), g(!0);
6773
6795
  else if (!l && Object.keys(a || {}).length > 0) {
6774
6796
  const m = Object.entries(a).map(([x, y]) => {
6775
- const b = y, v = b.type || "partial", w = formatReadableName(v);
6797
+ const b = y, v = b.type || "partial", A = formatReadableName(v);
6776
6798
  return {
6777
6799
  type: "PartialBlock",
6778
6800
  // Set the type to PartialBlock
6779
6801
  label: formatReadableName(b.name || x),
6780
6802
  description: b.description || "",
6781
6803
  icon: Globe,
6782
- group: w,
6804
+ group: A,
6783
6805
  // Use formatted type as group
6784
6806
  category: "partial",
6785
6807
  partialBlockId: x,
@@ -6851,9 +6873,9 @@ const BlockCard = ({
6851
6873
  }), []);
6852
6874
  const v = useCallback((k) => {
6853
6875
  y(k), b.current && b.current(k);
6854
- }, []), w = useCallback(() => {
6876
+ }, []), A = useCallback(() => {
6855
6877
  y(null), b.current && b.current.cancel();
6856
- }, []), A = useCallback((k) => {
6878
+ }, []), w = useCallback((k) => {
6857
6879
  b.current && b.current.cancel(), f(k), y(null);
6858
6880
  }, []), E = useMemo(
6859
6881
  () => c ? values(r).filter(
@@ -6889,9 +6911,9 @@ const BlockCard = ({
6889
6911
  /* @__PURE__ */ jsx(
6890
6912
  "button",
6891
6913
  {
6892
- onClick: () => A("all"),
6914
+ onClick: () => w("all"),
6893
6915
  onMouseEnter: () => v("all"),
6894
- onMouseLeave: w,
6916
+ onMouseLeave: A,
6895
6917
  className: `w-full rounded-md px-2 py-1.5 text-left text-sm font-medium ${m === "all" || x === "all" ? "bg-primary text-primary-foreground" : "hover:bg-primary/50 hover:text-primary-foreground"}`,
6896
6918
  children: i("All")
6897
6919
  },
@@ -6900,9 +6922,9 @@ const BlockCard = ({
6900
6922
  S.map((k) => /* @__PURE__ */ jsx(
6901
6923
  "button",
6902
6924
  {
6903
- onClick: () => A(k),
6925
+ onClick: () => w(k),
6904
6926
  onMouseEnter: () => v(k),
6905
- onMouseLeave: w,
6927
+ onMouseLeave: A,
6906
6928
  className: `w-full rounded-md px-2 py-1.5 text-left text-sm ${m === k || x === k ? "bg-primary text-primary-foreground" : "hover:bg-primary/50 hover:text-primary-foreground"}`,
6907
6929
  children: capitalize(i(k.toLowerCase()))
6908
6930
  },
@@ -7279,7 +7301,7 @@ const Input = ({ node: o }) => {
7279
7301
  var P;
7280
7302
  const { t: a } = useTranslation(), [l, , i] = useHiddenBlockIds(), [d] = useAtom$1(canvasIframeAtom), { hasPermission: c } = usePermissions();
7281
7303
  let p = null;
7282
- const u = o.children.length > 0, { highlightBlock: g, clearHighlight: h } = useBlockHighlight(), { id: m, data: f, isSelected: x, willReceiveDrop: y, isDragging: b, isEditing: v, handleClick: w } = o, A = (L) => {
7304
+ const u = o.children.length > 0, { highlightBlock: g, clearHighlight: h } = useBlockHighlight(), { id: m, data: f, isSelected: x, willReceiveDrop: y, isDragging: b, isEditing: v, handleClick: A } = o, w = (L) => {
7283
7305
  L.stopPropagation(), !l.includes(m) && o.toggle();
7284
7306
  }, E = (L) => {
7285
7307
  L.isInternal && (p = L.isOpen, L.isOpen && L.close());
@@ -7291,7 +7313,7 @@ const Input = ({ node: o }) => {
7291
7313
  }, C = () => {
7292
7314
  B(null);
7293
7315
  }, k = (L) => {
7294
- C(), L.stopPropagation(), !o.isOpen && !l.includes(m) && o.toggle(), w(L);
7316
+ C(), L.stopPropagation(), !o.isOpen && !l.includes(m) && o.toggle(), A(L);
7295
7317
  };
7296
7318
  useEffect(() => {
7297
7319
  const L = setTimeout(() => {
@@ -7379,7 +7401,7 @@ const Input = ({ node: o }) => {
7379
7401
  "div",
7380
7402
  {
7381
7403
  className: `flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center transition-transform duration-100 ${o.isOpen ? "rotate-90" : ""}`,
7382
- children: u && /* @__PURE__ */ jsx("button", { onClick: A, type: "button", children: /* @__PURE__ */ jsx(ChevronRight, { className: `h-3 w-3 stroke-[3] ${x ? "text-white" : "text-slate-400"}` }) })
7404
+ children: u && /* @__PURE__ */ jsx("button", { onClick: w, type: "button", children: /* @__PURE__ */ jsx(ChevronRight, { className: `h-3 w-3 stroke-[3] ${x ? "text-white" : "text-slate-400"}` }) })
7383
7405
  }
7384
7406
  ),
7385
7407
  /* @__PURE__ */ jsxs(
@@ -7701,19 +7723,19 @@ const Input = ({ node: o }) => {
7701
7723
  const [r] = useDarkMode(), [n, a] = React.useState(""), l = useBuilderProp("themePresets", []), i = useBuilderProp("themePanelComponent", null), { hasPermission: d } = usePermissions(), [c, p] = useTheme(), u = useThemeOptions(), { t: g } = useTranslation(), h = (v) => {
7702
7724
  a(v);
7703
7725
  }, m = () => {
7704
- const v = l.find((w) => Object.keys(w)[0] === n);
7726
+ const v = l.find((A) => Object.keys(A)[0] === n);
7705
7727
  if (v) {
7706
- const w = Object.values(v)[0];
7707
- w && typeof w == "object" && "fontFamily" in w && "borderRadius" in w && "colors" in w ? p(w) : console.error("Invalid preset structure:", w);
7728
+ const A = Object.values(v)[0];
7729
+ A && typeof A == "object" && "fontFamily" in A && "borderRadius" in A && "colors" in A ? p(A) : console.error("Invalid preset structure:", A);
7708
7730
  } else
7709
7731
  console.error("Preset not found:", n);
7710
7732
  }, f = useDebouncedCallback(
7711
- (v, w) => {
7733
+ (v, A) => {
7712
7734
  p(() => ({
7713
7735
  ...c,
7714
7736
  fontFamily: {
7715
7737
  ...c.fontFamily,
7716
- [v.replace(/font-/g, "")]: w
7738
+ [v.replace(/font-/g, "")]: A
7717
7739
  }
7718
7740
  }));
7719
7741
  },
@@ -7729,32 +7751,32 @@ const Input = ({ node: o }) => {
7729
7751
  [c],
7730
7752
  200
7731
7753
  ), y = useDebouncedCallback(
7732
- (v, w) => {
7754
+ (v, A) => {
7733
7755
  p(() => {
7734
- const A = get(c, `colors.${v}`);
7735
- return r ? set(A, 1, w) : set(A, 0, w), {
7756
+ const w = get(c, `colors.${v}`);
7757
+ return r ? set(w, 1, A) : set(w, 0, A), {
7736
7758
  ...c,
7737
7759
  colors: {
7738
7760
  ...c.colors,
7739
- [v]: A
7761
+ [v]: w
7740
7762
  }
7741
7763
  };
7742
7764
  });
7743
7765
  },
7744
7766
  [c],
7745
7767
  200
7746
- ), b = (v) => /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1", children: Object.entries(v.items).map(([w]) => {
7747
- const A = get(c, `colors.${w}.${r ? 1 : 0}`);
7768
+ ), b = (v) => /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1", children: Object.entries(v.items).map(([A]) => {
7769
+ const w = get(c, `colors.${A}.${r ? 1 : 0}`);
7748
7770
  return /* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-center gap-x-2", children: [
7749
7771
  /* @__PURE__ */ jsx(
7750
7772
  ColorPickerInput,
7751
7773
  {
7752
- value: A,
7753
- onChange: (E) => y(w, E)
7774
+ value: w,
7775
+ onChange: (E) => y(A, E)
7754
7776
  }
7755
7777
  ),
7756
- /* @__PURE__ */ jsx(Label, { className: "text-xs font-normal leading-tight", children: w.split(/(?=[A-Z])/).join(" ").replace(/-/g, " ").split(" ").map((E) => E.charAt(0).toUpperCase() + E.slice(1)).join(" ") + (!w.toLowerCase().includes("foreground") && !w.toLowerCase().includes("border") && !w.toLowerCase().includes("input") && !w.toLowerCase().includes("ring") && !w.toLowerCase().includes("background") ? " Background" : "") })
7757
- ] }, w);
7778
+ /* @__PURE__ */ jsx(Label, { className: "text-xs font-normal leading-tight", children: A.split(/(?=[A-Z])/).join(" ").replace(/-/g, " ").split(" ").map((E) => E.charAt(0).toUpperCase() + E.slice(1)).join(" ") + (!A.toLowerCase().includes("foreground") && !A.toLowerCase().includes("border") && !A.toLowerCase().includes("input") && !A.toLowerCase().includes("ring") && !A.toLowerCase().includes("background") ? " Background" : "") })
7779
+ ] }, A);
7758
7780
  }) });
7759
7781
  return d("edit_theme") ? /* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
7760
7782
  /* @__PURE__ */ jsxs("div", { className: cn$1("no-scrollbar h-full w-full overflow-y-auto", o), children: [
@@ -7786,12 +7808,12 @@ const Input = ({ node: o }) => {
7786
7808
  ) })
7787
7809
  ] }),
7788
7810
  /* @__PURE__ */ jsxs("div", { className: cn$1("space-y-2", o), children: [
7789
- (u == null ? void 0 : u.fontFamily) && /* @__PURE__ */ jsx("div", { className: "grid gap-4", children: Object.entries(u.fontFamily).map(([v, w]) => /* @__PURE__ */ jsx(
7811
+ (u == null ? void 0 : u.fontFamily) && /* @__PURE__ */ jsx("div", { className: "grid gap-4", children: Object.entries(u.fontFamily).map(([v, A]) => /* @__PURE__ */ jsx(
7790
7812
  FontSelector,
7791
7813
  {
7792
7814
  label: v,
7793
- value: c.fontFamily[v.replace(/font-/g, "")] || w[Object.keys(w)[0]],
7794
- onChange: (A) => f(v, A)
7815
+ value: c.fontFamily[v.replace(/font-/g, "")] || A[Object.keys(A)[0]],
7816
+ onChange: (w) => f(v, w)
7795
7817
  },
7796
7818
  v
7797
7819
  )) }),
@@ -8510,19 +8532,19 @@ function AIChatPanel() {
8510
8532
  content: "This is a sample response from the AI assistant. In a real implementation, this would be replaced with an actual response from the AI model.",
8511
8533
  timestamp: /* @__PURE__ */ new Date()
8512
8534
  };
8513
- r((w) => [...w, v]), i(!1), c(null);
8535
+ r((A) => [...A, v]), i(!1), c(null);
8514
8536
  }, 1500);
8515
8537
  }, m = (b) => {
8516
8538
  b.key === "Enter" && !b.shiftKey && (b.preventDefault(), h());
8517
8539
  }, f = (b) => {
8518
- var w;
8519
- const v = (w = b.target.files) == null ? void 0 : w[0];
8540
+ var A;
8541
+ const v = (A = b.target.files) == null ? void 0 : A[0];
8520
8542
  if (v) {
8521
- const A = new FileReader();
8522
- A.onload = (E) => {
8543
+ const w = new FileReader();
8544
+ w.onload = (E) => {
8523
8545
  var _;
8524
8546
  c((_ = E.target) == null ? void 0 : _.result);
8525
- }, A.readAsDataURL(v);
8547
+ }, w.readAsDataURL(v);
8526
8548
  }
8527
8549
  }, x = () => {
8528
8550
  var b;
@@ -8739,9 +8761,9 @@ const AddBlocksDialog = () => {
8739
8761
  }, v = (S) => {
8740
8762
  const B = a.filter((T, C) => C !== S);
8741
8763
  n(B), l(B);
8742
- }, w = (S) => {
8764
+ }, A = (S) => {
8743
8765
  g(S), d(a[S].key), p(a[S].value);
8744
- }, A = () => {
8766
+ }, w = () => {
8745
8767
  if (i.startsWith("@")) {
8746
8768
  m("Attribute keys cannot start with '@'");
8747
8769
  return;
@@ -8751,7 +8773,7 @@ const AddBlocksDialog = () => {
8751
8773
  S[u] = { key: i, value: c }, n(S), l(S), g(null), d(""), p(""), m("");
8752
8774
  }
8753
8775
  }, E = (S) => {
8754
- S.key === "Enter" && !S.shiftKey && (S.preventDefault(), u !== null ? A() : b());
8776
+ S.key === "Enter" && !S.shiftKey && (S.preventDefault(), u !== null ? w() : b());
8755
8777
  }, _ = useCallback((S) => {
8756
8778
  const B = (k) => /[.,!?;:]/.test(k), T = (k, j, I) => {
8757
8779
  let N = "", P = "";
@@ -8778,7 +8800,7 @@ const AddBlocksDialog = () => {
8778
8800
  "form",
8779
8801
  {
8780
8802
  onSubmit: (S) => {
8781
- S.preventDefault(), u !== null ? A() : b();
8803
+ S.preventDefault(), u !== null ? w() : b();
8782
8804
  },
8783
8805
  className: "space-y-3",
8784
8806
  children: [
@@ -8834,7 +8856,7 @@ const AddBlocksDialog = () => {
8834
8856
  /* @__PURE__ */ jsx("span", { className: "max-w-[200px] text-wrap font-normal", children: S.value.toString() })
8835
8857
  ] }),
8836
8858
  /* @__PURE__ */ jsxs("div", { className: "flex-shrink-0 text-slate-400", children: [
8837
- /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => w(B), children: /* @__PURE__ */ jsx(Edit2, { className: "h-3 w-3" }) }),
8859
+ /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => A(B), children: /* @__PURE__ */ jsx(Edit2, { className: "h-3 w-3" }) }),
8838
8860
  /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => v(B), children: /* @__PURE__ */ jsx(X, { className: "h-3 w-3" }) })
8839
8861
  ] })
8840
8862
  ] }, B)) })
@@ -8966,11 +8988,11 @@ const RootLayout = () => {
8966
8988
  S && get(S, "view", "standard") === "standard" && (a.current = r, i(get(S, "width", DEFAULT_PANEL_WIDTH)));
8967
8989
  }
8968
8990
  }, [r, x]);
8969
- const w = useMemo(() => {
8991
+ const A = useMemo(() => {
8970
8992
  if (r === null) return 0;
8971
8993
  const S = find(x, { id: r });
8972
8994
  return get(S, "view", "standard") === "standard" ? v : l;
8973
- }, [r, v, l, x]), A = () => {
8995
+ }, [r, v, l, x]), w = () => {
8974
8996
  n(a.current);
8975
8997
  }, E = useCallback(() => {
8976
8998
  n("outline");
@@ -9019,8 +9041,8 @@ const RootLayout = () => {
9019
9041
  {
9020
9042
  id: "left-panel",
9021
9043
  className: "h-full max-h-full border-r border-border",
9022
- initial: { width: w },
9023
- animate: { width: w },
9044
+ initial: { width: A },
9045
+ animate: { width: A },
9024
9046
  transition: { duration: 0.3, ease: "easeInOut" },
9025
9047
  children: r !== null && get(b, "view", "standard") === "standard" && /* @__PURE__ */ jsxs("div", { className: "no-scrollbar flex h-full flex-col overflow-hidden px-3 py-2", children: [
9026
9048
  /* @__PURE__ */ jsx(
@@ -9071,7 +9093,7 @@ const RootLayout = () => {
9071
9093
  ] }) })
9072
9094
  }
9073
9095
  ),
9074
- r !== null && get(b, "view") === "drawer" && /* @__PURE__ */ jsx(Sheet, { open: !0, onOpenChange: () => A(), children: /* @__PURE__ */ jsxs(SheetContent, { side: "left", className: "p-0 sm:max-w-full", style: { width: `${v}px` }, children: [
9096
+ r !== null && get(b, "view") === "drawer" && /* @__PURE__ */ jsx(Sheet, { open: !0, onOpenChange: () => w(), children: /* @__PURE__ */ jsxs(SheetContent, { side: "left", className: "p-0 sm:max-w-full", style: { width: `${v}px` }, children: [
9075
9097
  /* @__PURE__ */ jsx(SheetHeader, { className: "border-b border-border p-4 pb-2", children: /* @__PURE__ */ jsxs(SheetTitle, { className: "flex items-center gap-2", children: [
9076
9098
  /* @__PURE__ */ jsx("span", { className: "rtl:ml-2 rtl:inline-block", children: get(b, "icon", null) }),
9077
9099
  /* @__PURE__ */ jsx("span", { children: f(get(b, "label", "")) })
@@ -9081,7 +9103,7 @@ const RootLayout = () => {
9081
9103
  }) }) })
9082
9104
  ] }) }),
9083
9105
  " ",
9084
- r !== null && get(b, "view") === "modal" && /* @__PURE__ */ jsx(Dialog, { open: !0, onOpenChange: () => A(), children: /* @__PURE__ */ jsxs(DialogContent, { className: "p-0", style: { maxWidth: `${v}px` }, children: [
9106
+ r !== null && get(b, "view") === "modal" && /* @__PURE__ */ jsx(Dialog, { open: !0, onOpenChange: () => w(), children: /* @__PURE__ */ jsxs(DialogContent, { className: "p-0", style: { maxWidth: `${v}px` }, children: [
9085
9107
  /* @__PURE__ */ jsx(DialogHeader, { className: "border-b border-border p-4 pb-2", children: /* @__PURE__ */ jsxs(DialogTitle, { className: "flex items-center gap-2", children: [
9086
9108
  /* @__PURE__ */ jsx("span", { className: "rtl:ml-2 rtl:inline-block", children: get(b, "icon", null) }),
9087
9109
  /* @__PURE__ */ jsx("span", { children: f(get(b, "label", "")) })
@@ -9112,7 +9134,7 @@ const RootLayout = () => {
9112
9134
  /* @__PURE__ */ jsx("span", { className: "rtl:ml-2 rtl:inline-block", children: get(b, "icon", null) }),
9113
9135
  /* @__PURE__ */ jsx("span", { children: f(get(b, "label", "")) })
9114
9136
  ] }),
9115
- /* @__PURE__ */ jsx(Button, { onClick: () => A(), variant: "ghost", size: "icon", className: "", children: /* @__PURE__ */ jsx(X, { className: "h-5 w-5" }) })
9137
+ /* @__PURE__ */ jsx(Button, { onClick: () => w(), variant: "ghost", size: "icon", className: "", children: /* @__PURE__ */ jsx(X, { className: "h-5 w-5" }) })
9116
9138
  ] }),
9117
9139
  /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto p-4", children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("div", { children: "Loading..." }), children: React__default.createElement(get(b, "panel", NoopComponent), {
9118
9140
  close: E
@@ -9270,7 +9292,7 @@ const FEATURE_TOGGLES = {
9270
9292
  P = !0;
9271
9293
  break;
9272
9294
  }
9273
- P && (y(I), w(I)), n.delete(I);
9295
+ P && (y(I), A(I)), n.delete(I);
9274
9296
  }
9275
9297
  }), y = h[3] || ((B) => {
9276
9298
  var T, C;
@@ -9286,7 +9308,7 @@ const FEATURE_TOGGLES = {
9286
9308
  k.d.clear();
9287
9309
  let j = !0;
9288
9310
  const I = () => {
9289
- r.has(B) && (w(B), x(), f());
9311
+ r.has(B) && (A(B), x(), f());
9290
9312
  }, N = (R) => {
9291
9313
  var D;
9292
9314
  if (isSelfAtom(B, R)) {
@@ -9351,7 +9373,7 @@ const FEATURE_TOGGLES = {
9351
9373
  if (!hasInitialValue(I))
9352
9374
  throw new Error("atom not writable");
9353
9375
  const O = L.n, $ = N[0];
9354
- setAtomStateValueOrPromise(I, $, m), w(I), O !== L.n && (a.add(I), (P = d.c) == null || P.call(d, I), b(I));
9376
+ setAtomStateValueOrPromise(I, $, m), A(I), O !== L.n && (a.add(I), (P = d.c) == null || P.call(d, I), b(I));
9355
9377
  return;
9356
9378
  } else
9357
9379
  return v(I, ...N);
@@ -9364,14 +9386,14 @@ const FEATURE_TOGGLES = {
9364
9386
  } finally {
9365
9387
  C = !1;
9366
9388
  }
9367
- }), w = h[6] || ((B) => {
9389
+ }), A = h[6] || ((B) => {
9368
9390
  var T;
9369
9391
  const C = m(B), k = r.get(B);
9370
9392
  if (k && !isPendingPromise(C.v)) {
9371
9393
  for (const [j, I] of C.d)
9372
9394
  if (!k.d.has(j)) {
9373
9395
  const N = m(j);
9374
- A(j).t.add(B), k.d.add(j), I !== N.n && (a.add(j), (T = d.c) == null || T.call(d, j), b(j));
9396
+ w(j).t.add(B), k.d.add(j), I !== N.n && (a.add(j), (T = d.c) == null || T.call(d, j), b(j));
9375
9397
  }
9376
9398
  for (const j of k.d || [])
9377
9399
  if (!C.d.has(j)) {
@@ -9380,14 +9402,14 @@ const FEATURE_TOGGLES = {
9380
9402
  I == null || I.t.delete(B);
9381
9403
  }
9382
9404
  }
9383
- }), A = h[7] || ((B) => {
9405
+ }), w = h[7] || ((B) => {
9384
9406
  var T;
9385
9407
  const C = m(B);
9386
9408
  let k = r.get(B);
9387
9409
  if (!k) {
9388
9410
  y(B);
9389
9411
  for (const j of C.d.keys())
9390
- A(j).t.add(B);
9412
+ w(j).t.add(B);
9391
9413
  if (k = {
9392
9414
  l: /* @__PURE__ */ new Set(),
9393
9415
  d: new Set(C.d.keys()),
@@ -9457,8 +9479,8 @@ const FEATURE_TOGGLES = {
9457
9479
  y,
9458
9480
  b,
9459
9481
  v,
9460
- w,
9461
9482
  A,
9483
+ w,
9462
9484
  E
9463
9485
  ], S = {
9464
9486
  get: (B) => returnAtomValue(y(B)),
@@ -9470,7 +9492,7 @@ const FEATURE_TOGGLES = {
9470
9492
  }
9471
9493
  },
9472
9494
  sub: (B, T) => {
9473
- const k = A(B).l;
9495
+ const k = w(B).l;
9474
9496
  return k.add(T), f(), () => {
9475
9497
  k.delete(T), E(B), f();
9476
9498
  };