@chaibuilder/sdk 1.2.103 → 1.2.104

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.
@@ -10,7 +10,7 @@ import { atom as atom$1, useAtomValue as useAtomValue$1, useAtom as useAtom$1, u
10
10
  import { g as generateUUID, a as getBreakpointValue, c as cn, G as GenIcon } from "./iconBase-Ief2hJUZ.js";
11
11
  import { getBlockComponent, useChaiBlocks, getChaiDataProviders, useGlobalStylingPresets, syncBlocksWithDefaults } from "@chaibuilder/runtime";
12
12
  import { useTranslation, initReactI18next } from "react-i18next";
13
- import { g as getDefaultExportFromCjs, p as plugin } from "./plugin-ooqqxWRQ.js";
13
+ import { g as getDefaultExportFromCjs, s, p as plugin } from "./plugin-f6SDZ_Or.js";
14
14
  import { useThrottledCallback, useResizeObserver, useDebouncedCallback, useIntervalEffect } from "@react-hookz/web";
15
15
  import TreeModel from "tree-model";
16
16
  import ReactQuill, { Quill } from "react-quill";
@@ -24,7 +24,6 @@ import { createEvent } from "react-event-hook";
24
24
  import typography$1 from "@tailwindcss/typography";
25
25
  import forms from "@tailwindcss/forms";
26
26
  import aspectRatio from "@tailwindcss/aspect-ratio";
27
- import getPalette from "tailwindcss-palette-generator";
28
27
  import { twMerge } from "tailwind-merge";
29
28
  import { Provider } from "react-wrap-balancer";
30
29
  import ReactDOM from "react-dom";
@@ -34,7 +33,7 @@ import { Resizable } from "re-resizable";
34
33
  import { DatabaseIcon, GlobeIcon, ChevronRight, PlusIcon as PlusIcon$1, EyeOff, EditIcon, TrashIcon as TrashIcon$1, Check, Loader, SparklesIcon, SmileIcon, ShuffleIcon, ChevronDown, Edit2, X, LayoutTemplate, Layers, PaintBucketIcon } from "lucide-react";
35
34
  import validator from "@rjsf/validator-ajv8";
36
35
  import Form from "@rjsf/core";
37
- import { y, s, h } from "./controls-lEwMTdPQ.js";
36
+ import { y, s as s$1, h } from "./controls-lEwMTdPQ.js";
38
37
  import { Tree } from "react-arborist";
39
38
  import { parse, stringify } from "himalaya";
40
39
  import IconPicker, { IconPickerItem } from "react-icons-picker";
@@ -90,58 +89,58 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
90
89
  const o = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), r = /* @__PURE__ */ new Map();
91
90
  let a, l, i;
92
91
  (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set());
93
- const c = (j) => o.get(j), d = (j, k) => {
94
- (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && Object.freeze(k);
95
- const C = o.get(j);
96
- if (o.set(j, k), r.has(j) || r.set(j, C), C && hasPromiseAtomValue(C)) {
97
- const R = "v" in k ? k.v instanceof Promise ? k.v : Promise.resolve(k.v) : Promise.reject(k.e);
92
+ const c = (b) => o.get(b), d = (b, _) => {
93
+ (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && Object.freeze(_);
94
+ const C = o.get(b);
95
+ if (o.set(b, _), r.has(b) || r.set(b, C), C && hasPromiseAtomValue(C)) {
96
+ const R = "v" in _ ? _.v instanceof Promise ? _.v : Promise.resolve(_.v) : Promise.reject(_.e);
98
97
  cancelPromise(C.v, R);
99
98
  }
100
- }, u = (j, k, C) => {
99
+ }, u = (b, _, C) => {
101
100
  const R = /* @__PURE__ */ new Map();
102
101
  let I = !1;
103
102
  C.forEach((L, P) => {
104
- !L && P === j && (L = k), L ? (R.set(P, L), k.d.get(P) !== L && (I = !0)) : (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && console.warn("[Bug] atom state not found");
105
- }), (I || k.d.size !== R.size) && (k.d = R);
106
- }, p = (j, k, C) => {
107
- const R = c(j), I = {
103
+ !L && P === b && (L = _), L ? (R.set(P, L), _.d.get(P) !== L && (I = !0)) : (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && console.warn("[Bug] atom state not found");
104
+ }), (I || _.d.size !== R.size) && (_.d = R);
105
+ }, p = (b, _, C) => {
106
+ const R = c(b), I = {
108
107
  d: (R == null ? void 0 : R.d) || /* @__PURE__ */ new Map(),
109
- v: k
108
+ v: _
110
109
  };
111
- if (C && u(j, I, C), R && isEqualAtomValue(R, I) && R.d === I.d)
110
+ if (C && u(b, I, C), R && isEqualAtomValue(R, I) && R.d === I.d)
112
111
  return R;
113
112
  if (R && hasPromiseAtomValue(R) && hasPromiseAtomValue(I) && isEqualPromiseAtomValue(R, I)) {
114
113
  if (R.d === I.d)
115
114
  return R;
116
115
  I.v = R.v;
117
116
  }
118
- return d(j, I), I;
119
- }, m = (j, k, C, R) => {
120
- if (isPromiseLike$2(k)) {
117
+ return d(b, I), I;
118
+ }, m = (b, _, C, R) => {
119
+ if (isPromiseLike$2(_)) {
121
120
  let I;
122
121
  const L = new Promise((P, V) => {
123
122
  let $ = !1;
124
- k.then(
123
+ _.then(
125
124
  (O) => {
126
125
  if (!$) {
127
126
  $ = !0;
128
- const M = c(j), H = p(
129
- j,
127
+ const M = c(b), H = p(
128
+ b,
130
129
  L,
131
130
  C
132
131
  );
133
- resolvePromise(L, O), P(O), (M == null ? void 0 : M.d) !== H.d && N(j, H, M == null ? void 0 : M.d);
132
+ resolvePromise(L, O), P(O), (M == null ? void 0 : M.d) !== H.d && N(b, H, M == null ? void 0 : M.d);
134
133
  }
135
134
  },
136
135
  (O) => {
137
136
  if (!$) {
138
137
  $ = !0;
139
- const M = c(j), H = p(
140
- j,
138
+ const M = c(b), H = p(
139
+ b,
141
140
  L,
142
141
  C
143
142
  );
144
- rejectPromise(L, O), V(O), (M == null ? void 0 : M.d) !== H.d && N(j, H, M == null ? void 0 : M.d);
143
+ rejectPromise(L, O), V(O), (M == null ? void 0 : M.d) !== H.d && N(b, H, M == null ? void 0 : M.d);
145
144
  }
146
145
  }
147
146
  ), I = (O) => {
@@ -151,31 +150,31 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
151
150
  ), P(O));
152
151
  };
153
152
  });
154
- return L.orig = k, L.status = "pending", registerCancelPromise(L, (P) => {
153
+ return L.orig = _, L.status = "pending", registerCancelPromise(L, (P) => {
155
154
  P && I(P), R == null || R();
156
- }), p(j, L, C);
155
+ }), p(b, L, C);
157
156
  }
158
- return p(j, k, C);
159
- }, x = (j, k, C) => {
160
- const R = c(j), I = {
157
+ return p(b, _, C);
158
+ }, x = (b, _, C) => {
159
+ const R = c(b), I = {
161
160
  d: (R == null ? void 0 : R.d) || /* @__PURE__ */ new Map(),
162
- e: k
161
+ e: _
163
162
  };
164
- return C && u(j, I, C), R && isEqualAtomError(R, I) && R.d === I.d ? R : (d(j, I), I);
165
- }, g = (j) => {
166
- const k = c(j);
167
- if (k && (k.d.forEach(($, O) => {
168
- O !== j && !n.has(O) && g(O);
169
- }), Array.from(k.d).every(([$, O]) => {
163
+ return C && u(b, I, C), R && isEqualAtomError(R, I) && R.d === I.d ? R : (d(b, I), I);
164
+ }, g = (b) => {
165
+ const _ = c(b);
166
+ if (_ && (_.d.forEach(($, O) => {
167
+ O !== b && !n.has(O) && g(O);
168
+ }), Array.from(_.d).every(([$, O]) => {
170
169
  const M = c($);
171
- return $ === j || M === O || // TODO This is a hack, we should find a better solution.
170
+ return $ === b || M === O || // TODO This is a hack, we should find a better solution.
172
171
  M && !hasPromiseAtomValue(M) && isEqualAtomValue(M, O);
173
172
  })))
174
- return k;
173
+ return _;
175
174
  const C = /* @__PURE__ */ new Map();
176
175
  let R = !0;
177
176
  const I = ($) => {
178
- if ($ === j) {
177
+ if ($ === b) {
179
178
  const M = c($);
180
179
  if (M)
181
180
  return C.set($, M), returnAtomValue(M);
@@ -192,42 +191,42 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
192
191
  return L || (L = new AbortController()), L.signal;
193
192
  },
194
193
  get setSelf() {
195
- return (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && !isActuallyWritableAtom(j) && console.warn("setSelf function cannot be used with read-only atom"), !P && isActuallyWritableAtom(j) && (P = (...$) => {
194
+ return (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && !isActuallyWritableAtom(b) && console.warn("setSelf function cannot be used with read-only atom"), !P && isActuallyWritableAtom(b) && (P = (...$) => {
196
195
  if ((define_import_meta_env_default$2 ? "production" : void 0) !== "production" && R && console.warn("setSelf function cannot be called in sync"), !R)
197
- return B(j, ...$);
196
+ return B(b, ...$);
198
197
  }), P;
199
198
  }
200
199
  };
201
200
  try {
202
- const $ = j.read(I, V);
201
+ const $ = b.read(I, V);
203
202
  return m(
204
- j,
203
+ b,
205
204
  $,
206
205
  C,
207
206
  () => L == null ? void 0 : L.abort()
208
207
  );
209
208
  } catch ($) {
210
- return x(j, $, C);
209
+ return x(b, $, C);
211
210
  } finally {
212
211
  R = !1;
213
212
  }
214
- }, E = (j) => returnAtomValue(g(j)), b = (j) => {
215
- let k = n.get(j);
216
- return k || (k = w(j)), k;
217
- }, f = (j, k) => !k.l.size && (!k.t.size || k.t.size === 1 && k.t.has(j)), _ = (j) => {
218
- const k = n.get(j);
219
- k && f(j, k) && A(j);
220
- }, v = (j) => {
221
- const k = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new WeakMap(), R = (L) => {
213
+ }, E = (b) => returnAtomValue(g(b)), j = (b) => {
214
+ let _ = n.get(b);
215
+ return _ || (_ = A(b)), _;
216
+ }, f = (b, _) => !_.l.size && (!_.t.size || _.t.size === 1 && _.t.has(b)), k = (b) => {
217
+ const _ = n.get(b);
218
+ _ && f(b, _) && w(b);
219
+ }, v = (b) => {
220
+ const _ = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new WeakMap(), R = (L) => {
222
221
  const P = n.get(L);
223
222
  P == null || P.t.forEach((V) => {
224
- V !== L && (k.set(
223
+ V !== L && (_.set(
225
224
  V,
226
- (k.get(V) || /* @__PURE__ */ new Set()).add(L)
225
+ (_.get(V) || /* @__PURE__ */ new Set()).add(L)
227
226
  ), C.set(V, (C.get(V) || 0) + 1), R(V));
228
227
  });
229
228
  };
230
- R(j);
229
+ R(b);
231
230
  const I = (L) => {
232
231
  const P = n.get(L);
233
232
  P == null || P.t.forEach((V) => {
@@ -235,23 +234,23 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
235
234
  if (V !== L) {
236
235
  let O = C.get(V);
237
236
  if (O && C.set(V, --O), !O) {
238
- let M = !!(($ = k.get(V)) != null && $.size);
237
+ let M = !!(($ = _.get(V)) != null && $.size);
239
238
  if (M) {
240
239
  const H = c(V), F = g(V);
241
240
  M = !H || !isEqualAtomValue(H, F);
242
241
  }
243
- M || k.forEach((H) => H.delete(V));
242
+ M || _.forEach((H) => H.delete(V));
244
243
  }
245
244
  I(V);
246
245
  }
247
246
  });
248
247
  };
249
- I(j);
250
- }, S = (j, ...k) => {
248
+ I(b);
249
+ }, S = (b, ..._) => {
251
250
  let C = !0;
252
251
  const R = (P) => returnAtomValue(g(P)), I = (P, ...V) => {
253
252
  let $;
254
- if (P === j) {
253
+ if (P === b) {
255
254
  if (!hasInitialValue(P))
256
255
  throw new Error("atom not writable");
257
256
  const O = c(P), M = m(P, V[0]);
@@ -265,74 +264,74 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
265
264
  );
266
265
  }
267
266
  return $;
268
- }, L = j.write(R, I, ...k);
267
+ }, L = b.write(R, I, ..._);
269
268
  return C = !1, L;
270
- }, B = (j, ...k) => {
271
- const C = S(j, ...k), R = D();
269
+ }, B = (b, ..._) => {
270
+ const C = S(b, ..._), R = D();
272
271
  return (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && l.forEach(
273
272
  (I) => I({ type: "write", flushed: R })
274
273
  ), C;
275
- }, w = (j, k) => {
274
+ }, A = (b, _) => {
276
275
  const C = {
277
- t: new Set(k && [k]),
276
+ t: new Set(_ && [_]),
278
277
  l: /* @__PURE__ */ new Set()
279
278
  };
280
- if (n.set(j, C), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && i.add(j), g(j).d.forEach((R, I) => {
279
+ if (n.set(b, C), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && i.add(b), g(b).d.forEach((R, I) => {
281
280
  const L = n.get(I);
282
- L ? L.t.add(j) : I !== j && w(I, j);
283
- }), g(j), isActuallyWritableAtom(j) && j.onMount) {
284
- const R = j.onMount((...I) => B(j, ...I));
281
+ L ? L.t.add(b) : I !== b && A(I, b);
282
+ }), g(b), isActuallyWritableAtom(b) && b.onMount) {
283
+ const R = b.onMount((...I) => B(b, ...I));
285
284
  R && (C.u = R);
286
285
  }
287
286
  return C;
288
- }, A = (j) => {
289
- var k;
290
- const C = (k = n.get(j)) == null ? void 0 : k.u;
291
- C && C(), n.delete(j), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && i.delete(j);
292
- const R = c(j);
287
+ }, w = (b) => {
288
+ var _;
289
+ const C = (_ = n.get(b)) == null ? void 0 : _.u;
290
+ C && C(), n.delete(b), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && i.delete(b);
291
+ const R = c(b);
293
292
  R ? (hasPromiseAtomValue(R) && cancelPromise(R.v), R.d.forEach((I, L) => {
294
- if (L !== j) {
293
+ if (L !== b) {
295
294
  const P = n.get(L);
296
- P && (P.t.delete(j), f(L, P) && A(L));
295
+ P && (P.t.delete(b), f(L, P) && w(L));
297
296
  }
298
- })) : (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && console.warn("[Bug] could not find atom state to unmount", j);
299
- }, N = (j, k, C) => {
300
- const R = new Set(k.d.keys());
297
+ })) : (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && console.warn("[Bug] could not find atom state to unmount", b);
298
+ }, N = (b, _, C) => {
299
+ const R = new Set(_.d.keys());
301
300
  C == null || C.forEach((I, L) => {
302
301
  if (R.has(L)) {
303
302
  R.delete(L);
304
303
  return;
305
304
  }
306
305
  const P = n.get(L);
307
- P && (P.t.delete(j), f(L, P) && A(L));
306
+ P && (P.t.delete(b), f(L, P) && w(L));
308
307
  }), R.forEach((I) => {
309
308
  const L = n.get(I);
310
- L ? L.t.add(j) : n.has(j) && w(I, j);
309
+ L ? L.t.add(b) : n.has(b) && A(I, b);
311
310
  });
312
311
  }, D = () => {
313
- let j;
314
- for ((define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (j = /* @__PURE__ */ new Set()); r.size; ) {
315
- const k = Array.from(r);
316
- r.clear(), k.forEach(([C, R]) => {
312
+ let b;
313
+ for ((define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (b = /* @__PURE__ */ new Set()); r.size; ) {
314
+ const _ = Array.from(r);
315
+ r.clear(), _.forEach(([C, R]) => {
317
316
  const I = c(C);
318
317
  if (I) {
319
318
  I.d !== (R == null ? void 0 : R.d) && N(C, I, R == null ? void 0 : R.d);
320
319
  const L = n.get(C);
321
320
  L && !// TODO This seems pretty hacky. Hope to fix it.
322
321
  // Maybe we could `mountDependencies` in `setAtomState`?
323
- (R && !hasPromiseAtomValue(R) && (isEqualAtomValue(R, I) || isEqualAtomError(R, I))) && (L.l.forEach((P) => P()), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && j.add(C));
322
+ (R && !hasPromiseAtomValue(R) && (isEqualAtomValue(R, I) || isEqualAtomError(R, I))) && (L.l.forEach((P) => P()), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && b.add(C));
324
323
  } else
325
324
  (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && console.warn("[Bug] no atom state to flush");
326
325
  });
327
326
  }
328
327
  if ((define_import_meta_env_default$2 ? "production" : void 0) !== "production")
329
- return a.forEach((k) => k("state")), j;
330
- }, T = (j, k) => {
331
- const C = b(j), R = D(), I = C.l;
332
- return I.add(k), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((L) => L("sub")), l.forEach(
328
+ return a.forEach((_) => _("state")), b;
329
+ }, T = (b, _) => {
330
+ const C = j(b), R = D(), I = C.l;
331
+ return I.add(_), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((L) => L("sub")), l.forEach(
333
332
  (L) => L({ type: "sub", flushed: R })
334
333
  )), () => {
335
- I.delete(k), _(j), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((L) => L("unsub")), l.forEach((L) => L({ type: "unsub" })));
334
+ I.delete(_), k(b), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((L) => L("unsub")), l.forEach((L) => L({ type: "unsub" })));
336
335
  };
337
336
  };
338
337
  return (define_import_meta_env_default$2 ? "production" : void 0) !== "production" ? {
@@ -340,22 +339,22 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
340
339
  set: B,
341
340
  sub: T,
342
341
  // store dev methods (these are tentative and subject to change without notice)
343
- dev_subscribe_store: (j, k) => k !== 2 ? (console.warn(
342
+ dev_subscribe_store: (b, _) => _ !== 2 ? (console.warn(
344
343
  "The current StoreListener revision is 2. The older ones are deprecated."
345
- ), a.add(j), () => {
346
- a.delete(j);
347
- }) : (l.add(j), () => {
348
- l.delete(j);
344
+ ), a.add(b), () => {
345
+ a.delete(b);
346
+ }) : (l.add(b), () => {
347
+ l.delete(b);
349
348
  }),
350
349
  dev_get_mounted_atoms: () => i.values(),
351
- dev_get_atom_state: (j) => o.get(j),
352
- dev_get_mounted: (j) => n.get(j),
353
- dev_restore_atoms: (j) => {
354
- for (const [C, R] of j)
350
+ dev_get_atom_state: (b) => o.get(b),
351
+ dev_get_mounted: (b) => n.get(b),
352
+ dev_restore_atoms: (b) => {
353
+ for (const [C, R] of b)
355
354
  hasInitialValue(C) && (m(C, R), v(C));
356
- const k = D();
355
+ const _ = D();
357
356
  l.forEach(
358
- (C) => C({ type: "restore", flushed: k })
357
+ (C) => C({ type: "restore", flushed: _ })
359
358
  );
360
359
  }
361
360
  } : {
@@ -380,34 +379,34 @@ function splitAtom(o, n) {
380
379
  return u;
381
380
  const p = d && r.get(d), m = [], x = [];
382
381
  return c.forEach((g, E) => {
383
- const b = n ? n(g) : E;
384
- x[E] = b;
385
- const f = p && p.atomList[p.keyList.indexOf(b)];
382
+ const j = n ? n(g) : E;
383
+ x[E] = j;
384
+ const f = p && p.atomList[p.keyList.indexOf(j)];
386
385
  if (f) {
387
386
  m[E] = f;
388
387
  return;
389
388
  }
390
- const _ = (S) => {
391
- const B = S(l), w = S(o), N = a(w, B == null ? void 0 : B.arr).keyList.indexOf(b);
392
- if (N < 0 || N >= w.length) {
393
- const D = c[a(c).keyList.indexOf(b)];
389
+ const k = (S) => {
390
+ const B = S(l), A = S(o), N = a(A, B == null ? void 0 : B.arr).keyList.indexOf(j);
391
+ if (N < 0 || N >= A.length) {
392
+ const D = c[a(c).keyList.indexOf(j)];
394
393
  if (D)
395
394
  return D;
396
395
  throw new Error("splitAtom: index out of bounds for read");
397
396
  }
398
- return w[N];
399
- }, v = (S, B, w) => {
400
- const A = S(l), N = S(o), T = a(N, A == null ? void 0 : A.arr).keyList.indexOf(b);
397
+ return A[N];
398
+ }, v = (S, B, A) => {
399
+ const w = S(l), N = S(o), T = a(N, w == null ? void 0 : w.arr).keyList.indexOf(j);
401
400
  if (T < 0 || T >= N.length)
402
401
  throw new Error("splitAtom: index out of bounds for write");
403
- const j = isFunction(w) ? w(N[T]) : w;
402
+ const b = isFunction(A) ? A(N[T]) : A;
404
403
  B(o, [
405
404
  ...N.slice(0, T),
406
- j,
405
+ b,
407
406
  ...N.slice(T + 1)
408
407
  ]);
409
408
  };
410
- m[E] = isWritable(o) ? atom(_, v) : atom(_);
409
+ m[E] = isWritable(o) ? atom(k, v) : atom(k);
411
410
  }), p && p.keyList.length === x.length && p.keyList.every((g, E) => g === x[E]) ? u = p : u = { arr: c, atomList: m, keyList: x }, r.set(c, u), u;
412
411
  }, l = atom((c) => {
413
412
  const d = c(l), u = c(o);
@@ -1196,65 +1195,65 @@ const useBlocksStoreManager = () => {
1196
1195
  updateBlocksProps: c
1197
1196
  } = useBlocksStoreManager();
1198
1197
  return {
1199
- moveBlocks: (b, f, _) => {
1200
- const v = map(b, (B) => {
1201
- const A = n.find((T) => T._id === B)._parent || null, D = n.filter((T) => A ? T._parent === A : !T._parent).map((T) => T._id).indexOf(B);
1202
- return { _id: B, oldParent: A, oldPosition: D };
1203
- }), S = v.find(({ _id: B }) => B === b[0]);
1204
- S && S.oldParent === f && S.oldPosition === _ || (i(b, f, _), o({
1205
- undo: () => each(v, ({ _id: B, oldParent: w, oldPosition: A }) => {
1206
- i([B], w, A);
1198
+ moveBlocks: (j, f, k) => {
1199
+ const v = map(j, (B) => {
1200
+ const w = n.find((T) => T._id === B)._parent || null, D = n.filter((T) => w ? T._parent === w : !T._parent).map((T) => T._id).indexOf(B);
1201
+ return { _id: B, oldParent: w, oldPosition: D };
1202
+ }), S = v.find(({ _id: B }) => B === j[0]);
1203
+ S && S.oldParent === f && S.oldPosition === k || (i(j, f, k), o({
1204
+ undo: () => each(v, ({ _id: B, oldParent: A, oldPosition: w }) => {
1205
+ i([B], A, w);
1207
1206
  }),
1208
- redo: () => i(b, f, _)
1207
+ redo: () => i(j, f, k)
1209
1208
  }));
1210
1209
  },
1211
- addBlocks: (b, f, _) => {
1212
- a(b, f, _), o({
1213
- undo: () => l(map(b, "_id")),
1214
- redo: () => a(b, f, _)
1210
+ addBlocks: (j, f, k) => {
1211
+ a(j, f, k), o({
1212
+ undo: () => l(map(j, "_id")),
1213
+ redo: () => a(j, f, k)
1215
1214
  });
1216
1215
  },
1217
- removeBlocks: (b) => {
1216
+ removeBlocks: (j) => {
1218
1217
  var S;
1219
- const f = (S = first(b)) == null ? void 0 : S._parent, v = n.filter((B) => f ? B._parent === f : !B._parent).indexOf(first(b));
1220
- l(map(b, "_id")), o({
1221
- undo: () => a(b, f, v),
1222
- redo: () => l(map(b, "_id"))
1218
+ const f = (S = first(j)) == null ? void 0 : S._parent, v = n.filter((B) => f ? B._parent === f : !B._parent).indexOf(first(j));
1219
+ l(map(j, "_id")), o({
1220
+ undo: () => a(j, f, v),
1221
+ redo: () => l(map(j, "_id"))
1223
1222
  });
1224
1223
  },
1225
- updateBlocks: (b, f, _) => {
1224
+ updateBlocks: (j, f, k) => {
1226
1225
  let v = [];
1227
- if (_)
1228
- v = map(b, (S) => ({ _id: S, ..._ }));
1226
+ if (k)
1227
+ v = map(j, (S) => ({ _id: S, ...k }));
1229
1228
  else {
1230
1229
  const S = keys(f);
1231
- v = map(b, (B) => {
1232
- const w = n.find((N) => N._id === B), A = { _id: B };
1233
- return each(S, (N) => A[N] = w[N]), A;
1230
+ v = map(j, (B) => {
1231
+ const A = n.find((N) => N._id === B), w = { _id: B };
1232
+ return each(S, (N) => w[N] = A[N]), w;
1234
1233
  });
1235
1234
  }
1236
- c(map(b, (S) => ({ _id: S, ...f }))), o({
1235
+ c(map(j, (S) => ({ _id: S, ...f }))), o({
1237
1236
  undo: () => c(v),
1238
- redo: () => c(map(b, (S) => ({ _id: S, ...f })))
1237
+ redo: () => c(map(j, (S) => ({ _id: S, ...f })))
1239
1238
  });
1240
1239
  },
1241
- updateBlocksRuntime: (b, f) => {
1242
- c(map(b, (_) => ({ _id: _, ...f })));
1240
+ updateBlocksRuntime: (j, f) => {
1241
+ c(map(j, (k) => ({ _id: k, ...f })));
1243
1242
  },
1244
- setNewBlocks: (b) => {
1245
- r(b), o({
1243
+ setNewBlocks: (j) => {
1244
+ r(j), o({
1246
1245
  undo: () => r(n),
1247
- redo: () => r(b)
1246
+ redo: () => r(j)
1248
1247
  });
1249
1248
  },
1250
- updateMultipleBlocksProps: (b) => {
1249
+ updateMultipleBlocksProps: (j) => {
1251
1250
  let f = [];
1252
- f = map(b, (_) => {
1253
- const v = keys(_), S = n.find((w) => w._id === _._id), B = {};
1254
- return each(v, (w) => B[w] = S[w]), B;
1255
- }), c(b), o({
1251
+ f = map(j, (k) => {
1252
+ const v = keys(k), S = n.find((A) => A._id === k._id), B = {};
1253
+ return each(v, (A) => B[A] = S[A]), B;
1254
+ }), c(j), o({
1256
1255
  undo: () => c(f),
1257
- redo: () => c(b)
1256
+ redo: () => c(j)
1258
1257
  });
1259
1258
  }
1260
1259
  };
@@ -1263,11 +1262,11 @@ const useBlocksStoreManager = () => {
1263
1262
  (i, c, d) => {
1264
1263
  var g;
1265
1264
  for (let E = 0; E < i.length; E++) {
1266
- const { _id: b } = i[E];
1265
+ const { _id: j } = i[E];
1267
1266
  i[E]._id = generateUUID();
1268
- const f = filter(i, { _parent: b });
1269
- for (let _ = 0; _ < f.length; _++)
1270
- f[_]._parent = i[E]._id;
1267
+ const f = filter(i, { _parent: j });
1268
+ for (let k = 0; k < f.length; k++)
1269
+ f[k]._parent = i[E]._id;
1271
1270
  }
1272
1271
  const u = first(i);
1273
1272
  let p, m;
@@ -1278,13 +1277,13 @@ const useBlocksStoreManager = () => {
1278
1277
  return { addCoreBlock: useCallback(
1279
1278
  (i, c, d) => {
1280
1279
  if (has(i, "blocks")) {
1281
- const _ = i.blocks;
1282
- return a(_, c, d);
1280
+ const k = i.blocks;
1281
+ return a(k, c, d);
1283
1282
  }
1284
1283
  const u = generateUUID(), p = getBlockDefaultProps(i.props), m = [];
1285
- forIn(p, (_, v) => {
1286
- if (startsWith(_, SLOT_KEY)) {
1287
- const S = _.replace(SLOT_KEY, "");
1284
+ forIn(p, (k, v) => {
1285
+ if (startsWith(k, SLOT_KEY)) {
1286
+ const S = k.replace(SLOT_KEY, "");
1288
1287
  m.push({
1289
1288
  _id: S,
1290
1289
  _type: "Slot",
@@ -2575,8 +2574,8 @@ const useSelectedStylingBlocks = () => useAtom$1(selectedStylingBlocksAtom), get
2575
2574
  return each(u, (x) => {
2576
2575
  const g = x.replace(/[\[\]\/\\{}()*+?.^$|]/g, "\\$&"), E = new RegExp(`(^| )${g}($| )`, "g");
2577
2576
  p = p.replace(E, " ").replace(/ +/g, " ").trim();
2578
- const b = first(x.split(":"));
2579
- includes(["2xl", "xl", "lg", "md", "sm"], b) && u.push(x.split(":").pop().trim());
2577
+ const j = first(x.split(":"));
2578
+ includes(["2xl", "xl", "lg", "md", "sm"], j) && u.push(x.split(":").pop().trim());
2580
2579
  }), each(u, (x) => {
2581
2580
  const g = new RegExp(`(^| )${x.replace("[", "\\[").replace("]", "\\]")}($| )`, "g");
2582
2581
  m = m.replace(g, " ").replace(/ +/g, " ").trim();
@@ -3063,26 +3062,26 @@ const useDnd = () => {
3063
3062
  g.preventDefault(), g.stopPropagation(), throttledDragOver(g);
3064
3063
  },
3065
3064
  onDrop: (g) => {
3066
- var w;
3067
- const E = dropTarget, f = getOrientation(E) === "vertical" ? g.clientY + ((w = iframeDocument == null ? void 0 : iframeDocument.defaultView) == null ? void 0 : w.scrollY) : g.clientX;
3065
+ var A;
3066
+ const E = dropTarget, f = getOrientation(E) === "vertical" ? g.clientY + ((A = iframeDocument == null ? void 0 : iframeDocument.defaultView) == null ? void 0 : A.scrollY) : g.clientX;
3068
3067
  dropIndex = calculateDropIndex(f, possiblePositions);
3069
- const _ = d, v = E.getAttribute("data-block-id"), S = dropTarget.getAttribute("data-dnd-dragged") !== "yes";
3070
- if ((_ == null ? void 0 : _._id) === v || !S) {
3068
+ const k = d, v = E.getAttribute("data-block-id"), S = dropTarget.getAttribute("data-dnd-dragged") !== "yes";
3069
+ if ((k == null ? void 0 : k._id) === v || !S) {
3071
3070
  x();
3072
3071
  return;
3073
3072
  }
3074
- if (!has(_, "_id")) {
3075
- a(_, v === "canvas" ? null : v, dropIndex), setTimeout(x, 300);
3073
+ if (!has(k, "_id")) {
3074
+ a(k, v === "canvas" ? null : v, dropIndex), setTimeout(x, 300);
3076
3075
  return;
3077
3076
  }
3078
3077
  let B = E.getAttribute("data-block-id");
3079
- B === null && (B = g.target.parentElement.getAttribute("data-block-id")), c([_._id], B === "canvas" ? null : B, dropIndex), x(), setTimeout(removePlaceholder, 300);
3078
+ B === null && (B = g.target.parentElement.getAttribute("data-block-id")), c([k._id], B === "canvas" ? null : B, dropIndex), x(), setTimeout(removePlaceholder, 300);
3080
3079
  },
3081
3080
  onDragEnter: (g) => {
3082
- const E = g, b = E.target;
3083
- dropTarget = b;
3084
- const f = b.getAttribute("data-block-id"), _ = b.getAttribute("data-dnd-dragged") !== "yes";
3085
- p(f), E.stopPropagation(), E.preventDefault(), possiblePositions = [], _ && calculatePossiblePositions(b), r(!0), l(""), i([]);
3081
+ const E = g, j = E.target;
3082
+ dropTarget = j;
3083
+ const f = j.getAttribute("data-block-id"), k = j.getAttribute("data-dnd-dragged") !== "yes";
3084
+ p(f), E.stopPropagation(), E.preventDefault(), possiblePositions = [], k && calculatePossiblePositions(j), r(!0), l(""), i([]);
3086
3085
  },
3087
3086
  onDragLeave: (g) => {
3088
3087
  g.target.getAttribute("data-block-id") === "canvas" && (p(null), r(!1), removePlaceholder(), possiblePositions = []);
@@ -3281,29 +3280,31 @@ const useHandleCanvasDblClick = () => {
3281
3280
  ]
3282
3281
  }
3283
3282
  ) });
3284
- }, HeadTags = ({ model: o }) => {
3285
- const [n] = useBrandingOptions(), [r] = useSelectedBlockIds(), [a] = useDarkMode(), [l] = useHighlightBlockId(), [i] = useSelectedStylingBlocks(), [c] = useAtom$1(draggedBlockAtom), [d] = useAtom$1(dropTargetBlockIdAtom), { document: u, window: p } = useFrame(), [m] = useState(u == null ? void 0 : u.getElementById("highlighted-block")), [x] = useState(
3286
- u == null ? void 0 : u.getElementById("selected-block")
3283
+ }, HeadTags = () => {
3284
+ const [o] = useBrandingOptions(), [n] = useSelectedBlockIds(), [r] = useDarkMode(), [a] = useHighlightBlockId(), [l] = useSelectedStylingBlocks(), [i] = useAtom$1(draggedBlockAtom), [c] = useAtom$1(dropTargetBlockIdAtom), { document: d, window: u } = useFrame(), [p] = useState(d == null ? void 0 : d.getElementById("highlighted-block")), [m] = useState(
3285
+ d == null ? void 0 : d.getElementById("selected-block")
3286
+ ), [x] = useState(
3287
+ d == null ? void 0 : d.getElementById("selected-styling-block")
3287
3288
  ), [g] = useState(
3288
- u == null ? void 0 : u.getElementById("selected-styling-block")
3289
- ), [E] = useState(
3290
- u == null ? void 0 : u.getElementById("dragged-block")
3289
+ d == null ? void 0 : d.getElementById("dragged-block")
3291
3290
  );
3292
3291
  useEffect(() => {
3293
- a ? u == null || u.documentElement.classList.add("dark") : u == null || u.documentElement.classList.remove("dark");
3294
- }, [a, u]);
3295
- const b = get(n, "headingFont", "DM Sans"), f = get(n, "bodyFont", "DM Sans");
3292
+ r ? d == null || d.documentElement.classList.add("dark") : d == null || d.documentElement.classList.remove("dark");
3293
+ }, [r, d]);
3294
+ const E = get(o, "headingFont", "DM Sans"), j = get(o, "bodyFont", "DM Sans");
3296
3295
  return useEffect(() => {
3297
- const _ = get(n, "primaryColor", "#000"), v = get(n, "secondaryColor", "#FFF"), S = get(n, "bodyBgLightColor", "#fff"), B = get(n, "bodyBgDarkColor", "#000"), w = get(n, "bodyTextDarkColor", "#000"), A = get(n, "bodyTextLightColor", "#fff"), N = getPalette([
3298
- { color: _, name: "primary" },
3299
- { color: v, name: "secondary" }
3300
- ]), D = {
3301
- "bg-light": S,
3302
- "bg-dark": B,
3303
- "text-dark": w,
3296
+ const f = get(o, "primaryColor", "#000"), k = get(o, "secondaryColor", "#FFF"), v = get(o, "bodyBgLightColor", "#fff"), S = get(o, "bodyBgDarkColor", "#000"), B = get(o, "bodyTextDarkColor", "#000"), A = get(o, "bodyTextLightColor", "#fff"), w = s({
3297
+ colors: [f, k],
3298
+ names: ["primary", "secondary"]
3299
+ });
3300
+ set(w, "primary.DEFAULT", f), set(w, "secondary.DEFAULT", k);
3301
+ const N = {
3302
+ "bg-light": v,
3303
+ "bg-dark": S,
3304
+ "text-dark": B,
3304
3305
  "text-light": A
3305
- }, T = get(n, "roundedCorners", "0");
3306
- !p || !p.tailwind || (p.tailwind.config = {
3306
+ }, D = get(o, "roundedCorners", "0");
3307
+ !u || !u.tailwind || (u.tailwind.config = {
3307
3308
  darkMode: "class",
3308
3309
  theme: {
3309
3310
  extend: {
@@ -3315,56 +3316,56 @@ const useHandleCanvasDblClick = () => {
3315
3316
  }
3316
3317
  },
3317
3318
  fontFamily: {
3318
- heading: [b],
3319
- body: [f]
3319
+ heading: [E],
3320
+ body: [j]
3320
3321
  },
3321
3322
  borderRadius: {
3322
- DEFAULT: `${T || "0"}px`
3323
+ DEFAULT: `${D || "0"}px`
3323
3324
  },
3324
- colors: { ...D, ...N }
3325
+ colors: { ...N, ...w }
3325
3326
  }
3326
3327
  },
3327
3328
  plugins: [
3328
3329
  typography$1,
3329
3330
  forms,
3330
3331
  aspectRatio,
3331
- plugin(function({ addBase: j, theme: k }) {
3332
- j({
3332
+ plugin(function({ addBase: T, theme: b }) {
3333
+ T({
3333
3334
  "h1,h2,h3,h4,h5,h6": {
3334
- fontFamily: k("fontFamily.heading")
3335
+ fontFamily: b("fontFamily.heading")
3335
3336
  },
3336
3337
  body: {
3337
- fontFamily: k("fontFamily.body"),
3338
- color: k("colors.text-light"),
3339
- backgroundColor: k("colors.bg-light")
3338
+ fontFamily: b("fontFamily.body"),
3339
+ color: b("colors.text-light"),
3340
+ backgroundColor: b("colors.bg-light")
3340
3341
  },
3341
3342
  ".dark body": {
3342
- color: k("colors.text-dark"),
3343
- backgroundColor: k("colors.bg-dark")
3343
+ color: b("colors.text-dark"),
3344
+ backgroundColor: b("colors.bg-dark")
3344
3345
  }
3345
3346
  });
3346
3347
  })
3347
3348
  ]
3348
3349
  });
3349
- }, [n, p, b, f]), useEffect(() => {
3350
- x && (x.textContent = `${map(r, (_) => `[data-block-id="${_}"]`).join(",")}{
3351
- outline: 1px solid ${r.length === 1 ? "#42a1fc" : "orange"} !important; outline-offset: -1px;
3350
+ }, [o, u, E, j]), useEffect(() => {
3351
+ m && (m.textContent = `${map(n, (f) => `[data-block-id="${f}"]`).join(",")}{
3352
+ outline: 1px solid ${n.length === 1 ? "#42a1fc" : "orange"} !important; outline-offset: -1px;
3352
3353
  }`);
3353
- }, [r, x]), useEffect(() => {
3354
- E.textContent = c ? `[data-block-id="${c._id}"], [data-block-id="${c._id}"] > * { pointer-events: none !important; opacity: 0.6 !important}` : "";
3355
- }, [c, E]), useEffect(() => {
3356
- m && (m.textContent = l ? `[data-style-id="${l}"], [data-block-id="${l}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
3357
- }, [l, r, m]), useEffect(() => {
3358
- g && (g.textContent = `${map(i, ({ id: _ }) => `[data-style-id="${_}"]`).join(",")}{
3354
+ }, [n, m]), useEffect(() => {
3355
+ g.textContent = i ? `[data-block-id="${i._id}"], [data-block-id="${i._id}"] > * { pointer-events: none !important; opacity: 0.6 !important}` : "";
3356
+ }, [i, g]), useEffect(() => {
3357
+ p && (p.textContent = a ? `[data-style-id="${a}"], [data-block-id="${a}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
3358
+ }, [a, n, p]), useEffect(() => {
3359
+ x && (x.textContent = `${map(l, ({ id: f }) => `[data-style-id="${f}"]`).join(",")}{
3359
3360
  outline: 1px solid #42a1fc !important; outline-offset: -1px;
3360
3361
  }`);
3361
- }, [i, g]), useEffect(() => {
3362
- u.querySelector("#drop-target-block").innerHTML = d ? `[data-block-id="${d}"]{ outline: 1px dashed orange !important; outline-offset: -1px;}` : "";
3363
- }, [d]), /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: (b || f) && /* @__PURE__ */ jsxRuntimeExports.jsx(
3362
+ }, [l, x]), useEffect(() => {
3363
+ d.querySelector("#drop-target-block").innerHTML = c ? `[data-block-id="${c}"]{ outline: 1px dashed orange !important; outline-offset: -1px;}` : "";
3364
+ }, [c]), /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: (E || j) && /* @__PURE__ */ jsxRuntimeExports.jsx(
3364
3365
  "link",
3365
3366
  {
3366
3367
  rel: "stylesheet",
3367
- href: `https://fonts.googleapis.com/css2?family=${b ? `${b.replace(/ /g, "+")}:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900` : ""}${b && f && b !== f ? "&" : ""}${f && f !== b ? `family=${f.replace(/ /g, "+")}:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900` : ""}&display=swap`
3368
+ href: `https://fonts.googleapis.com/css2?family=${E ? `${E.replace(/ /g, "+")}:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900` : ""}${E && j && E !== j ? "&" : ""}${j && j !== E ? `family=${j.replace(/ /g, "+")}:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900` : ""}&display=swap`
3368
3369
  }
3369
3370
  ) });
3370
3371
  }, useChaiExternalData = () => useAtom$1(chaiExternalDataAtom), useCanvasSettings = () => useAtom$1(canvasSettingsAtom), isVisibleAtBreakpoint = (o, n) => {
@@ -3482,15 +3483,15 @@ function applyLanguage(o, n, r) {
3482
3483
  }), a;
3483
3484
  }
3484
3485
  function BlocksRendererStatic({ blocks: o, allBlocks: n }) {
3485
- const { selectedLang: r } = useLanguages(), [a] = useAtom$1(xShowBlocksAtom), [l] = useCutBlockIds(), [i] = useAtom$1(draggedBlockAtom), [c] = useAtom$1(dropTargetBlockIdAtom), [, d] = useCanvasWidth(), [u] = useCanvasSettings(), [p] = useHiddenBlockIds(), { getGlobalBlocks: m } = useGlobalBlocksStore(), x = useCallback((f) => getStyleAttrs(f, d), [d]), [g] = useChaiExternalData(), [E] = useAtom$1(inlineEditingActiveAtom), b = useCallback(
3486
- (f) => f.reduce((_, v) => {
3486
+ const { selectedLang: r } = useLanguages(), [a] = useAtom$1(xShowBlocksAtom), [l] = useCutBlockIds(), [i] = useAtom$1(draggedBlockAtom), [c] = useAtom$1(dropTargetBlockIdAtom), [, d] = useCanvasWidth(), [u] = useCanvasSettings(), [p] = useHiddenBlockIds(), { getGlobalBlocks: m } = useGlobalBlocksStore(), x = useCallback((f) => getStyleAttrs(f, d), [d]), [g] = useChaiExternalData(), [E] = useAtom$1(inlineEditingActiveAtom), j = useCallback(
3487
+ (f) => f.reduce((k, v) => {
3487
3488
  const S = get(u, v, {});
3488
- return { ..._, ...S };
3489
+ return { ...k, ...S };
3489
3490
  }, {}),
3490
3491
  [u]
3491
3492
  );
3492
3493
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: React__default.Children.toArray(
3493
- o.map((f, _) => {
3494
+ o.map((f, k) => {
3494
3495
  if (E === f._id || p.includes(f._id))
3495
3496
  return null;
3496
3497
  const v = {}, S = filter(n, { _parent: f._id });
@@ -3498,13 +3499,13 @@ function BlocksRendererStatic({ blocks: o, allBlocks: n }) {
3498
3499
  const C = m(f);
3499
3500
  v.children = /* @__PURE__ */ jsxRuntimeExports.jsx(RenderGlobalBlock, { blocks: filter(C, (R) => !R._parent), allBlocks: C });
3500
3501
  }
3501
- const B = getBlockComponent(f._type), w = get(B, "server", !1), A = w ? RSCBlock : get(B, "builderComponent", get(B, "component", null));
3502
- if (isNull(A))
3502
+ const B = getBlockComponent(f._type), A = get(B, "server", !1), w = A ? RSCBlock : get(B, "builderComponent", get(B, "component", null));
3503
+ if (isNull(w))
3503
3504
  return /* @__PURE__ */ jsxRuntimeExports.jsx("noscript", { children: `<!-- ${f == null ? void 0 : f._type} not registered -->` });
3504
- const N = has(B, "getBlockStateFrom") ? B == null ? void 0 : B.getBlockStateFrom(f, n) : [], D = b(N), T = x(f);
3505
+ const N = has(B, "getBlockStateFrom") ? B == null ? void 0 : B.getBlockStateFrom(f, n) : [], D = j(N), T = x(f);
3505
3506
  if (get(T, "__isHidden", !1) && !includes(a, f._id))
3506
3507
  return null;
3507
- const j = i && isDescendant(i._id, f._id, n), k = {
3508
+ const b = i && isDescendant(i._id, f._id, n), _ = {
3508
3509
  ...includes(a, f._id) ? { "force-show": "" } : {},
3509
3510
  "data-block-id": f._id,
3510
3511
  "data-block-type": f._type,
@@ -3512,15 +3513,15 @@ function BlocksRendererStatic({ blocks: o, allBlocks: n }) {
3512
3513
  // @ts-ignore
3513
3514
  {
3514
3515
  "data-dnd": canAcceptChildBlock(f._type, i == null ? void 0 : i._type) ? "yes" : "no",
3515
- "data-dnd-dragged": i._id === f._id || j ? "yes" : "no"
3516
+ "data-dnd-dragged": i._id === f._id || b ? "yes" : "no"
3516
3517
  }
3517
3518
  ) : {},
3518
- ...c === f._id && !j ? { "data-drop": "yes" } : {},
3519
+ ...c === f._id && !b ? { "data-drop": "yes" } : {},
3519
3520
  ...includes(l, f._id) ? { "data-cut-block": "yes" } : {}
3520
3521
  };
3521
- return w ? /* @__PURE__ */ jsxRuntimeExports.jsx(RSCBlock, { block: f, blockProps: k }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { children: React__default.createElement(A, {
3522
- blockProps: k,
3523
- index: _,
3522
+ return A ? /* @__PURE__ */ jsxRuntimeExports.jsx(RSCBlock, { block: f, blockProps: _ }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { children: React__default.createElement(w, {
3523
+ blockProps: _,
3524
+ index: k,
3524
3525
  ...applyBindings(applyLanguage(f, r, B), g),
3525
3526
  ...omit(T, ["__isHidden"]),
3526
3527
  ...v,
@@ -3575,41 +3576,41 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
3575
3576
  n(i);
3576
3577
  }, []), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "main-content", className: "h-full w-full p-8 pb-0", ref: a, children: o });
3577
3578
  }, getElementByStyleId = (o, n) => o.querySelector(`[data-style-id="${n}"]`), StaticCanvas = () => {
3578
- const [o] = useAtom$1(networkModeAtom), [n] = useCanvasWidth(), [, r] = useSelectedBlockIds(), a = useSelectedBlock(), [, l] = useHighlightBlockId(), i = useRef(null), c = useRef(null), [d, u] = useState({ width: 0, height: 0 }), p = useCanvasScale(d), [m, x] = useState([]), [, g] = useState([]), [, E] = useAtom$1(canvasIframeAtom), [b, f] = useSelectedStylingBlocks(), _ = useBuilderProp("loading", !1), v = useBuilderProp("htmlDir", "ltr"), S = (A) => {
3579
- u((N) => ({ ...N, width: A }));
3579
+ const [o] = useAtom$1(networkModeAtom), [n] = useCanvasWidth(), [, r] = useSelectedBlockIds(), a = useSelectedBlock(), [, l] = useHighlightBlockId(), i = useRef(null), c = useRef(null), [d, u] = useState({ width: 0, height: 0 }), p = useCanvasScale(d), [m, x] = useState([]), [, g] = useState([]), [, E] = useAtom$1(canvasIframeAtom), [j, f] = useSelectedStylingBlocks(), k = useBuilderProp("loading", !1), v = useBuilderProp("htmlDir", "ltr"), S = (w) => {
3580
+ u((N) => ({ ...N, width: w }));
3580
3581
  };
3581
3582
  useEffect(() => {
3582
3583
  if (!c.current)
3583
3584
  return;
3584
- const { clientWidth: A, clientHeight: N } = c.current;
3585
- u({ width: A, height: N });
3585
+ const { clientWidth: w, clientHeight: N } = c.current;
3586
+ u({ width: w, height: N });
3586
3587
  }, [c, n]);
3587
- const B = (A, N = 0) => {
3588
- const { top: D } = A.getBoundingClientRect();
3588
+ const B = (w, N = 0) => {
3589
+ const { top: D } = w.getBoundingClientRect();
3589
3590
  return D + N >= 0 && D - N <= window.innerHeight;
3590
3591
  };
3591
3592
  useEffect(() => {
3592
- var A, N;
3593
+ var w, N;
3593
3594
  if (a && a.type !== "Multiple" && i.current) {
3594
3595
  const D = getElementByDataBlockId(i.current.contentDocument, a._id);
3595
- D && (B(D) || (N = (A = i.current) == null ? void 0 : A.contentWindow) == null || N.scrollTo({ top: D.offsetTop, behavior: "smooth" }), x([D]));
3596
+ D && (B(D) || (N = (w = i.current) == null ? void 0 : w.contentWindow) == null || N.scrollTo({ top: D.offsetTop, behavior: "smooth" }), x([D]));
3596
3597
  }
3597
3598
  }, [a]), useEffect(() => {
3598
- if (!isEmpty(b) && i.current) {
3599
- const A = getElementByStyleId(
3599
+ if (!isEmpty(j) && i.current) {
3600
+ const w = getElementByStyleId(
3600
3601
  i.current.contentDocument,
3601
- first(b).id
3602
+ first(j).id
3602
3603
  );
3603
- g(A ? [A] : [null]);
3604
+ g(w ? [w] : [null]);
3604
3605
  } else
3605
3606
  g([null]);
3606
- }, [b]);
3607
- const w = useMemo(() => {
3608
- let A = IframeInitialContent;
3609
- return A = A.replace("__HTML_DIR__", v), o === "offline" && (A = A.replace(
3607
+ }, [j]);
3608
+ const A = useMemo(() => {
3609
+ let w = IframeInitialContent;
3610
+ return w = w.replace("__HTML_DIR__", v), o === "offline" && (w = w.replace(
3610
3611
  "https://old.chaibuilder.com/offline/tailwind.cdn.js",
3611
3612
  "/offline/tailwind.cdn.js"
3612
- ), A = A.replace("https://unpkg.com/aos@next/dist/aos.css", "/offline/aos.css"), A = A.replace("https://unpkg.com/aos@next/dist/aos.js", "/offline/aos.js")), A;
3613
+ ), w = w.replace("https://unpkg.com/aos@next/dist/aos.css", "/offline/aos.css"), w = w.replace("https://unpkg.com/aos@next/dist/aos.js", "/offline/aos.js")), w;
3613
3614
  }, [o, v]);
3614
3615
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ResizableCanvasWrapper, { onMount: S, onResize: S, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3615
3616
  "div",
@@ -3628,7 +3629,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
3628
3629
  id: "canvas-iframe",
3629
3630
  style: { ...p, ...isEmpty(p) ? { width: `${n}px` } : {} },
3630
3631
  className: "relative mx-auto box-content h-full w-full max-w-full shadow-lg transition-all duration-300 ease-linear",
3631
- initialContent: w,
3632
+ initialContent: A,
3632
3633
  children: [
3633
3634
  /* @__PURE__ */ jsxRuntimeExports.jsx(KeyboardHandler, {}),
3634
3635
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -3638,9 +3639,9 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
3638
3639
  selectedBlockElement: first(m)
3639
3640
  }
3640
3641
  ),
3641
- /* @__PURE__ */ jsxRuntimeExports.jsx(HeadTags, { model: "page" }),
3642
+ /* @__PURE__ */ jsxRuntimeExports.jsx(HeadTags, {}),
3642
3643
  /* @__PURE__ */ jsxRuntimeExports.jsx(Provider, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Canvas, { children: [
3643
- _ ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "h-full" }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(StaticBlocksRenderer, {}),
3644
+ k ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "h-full" }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(StaticBlocksRenderer, {}),
3644
3645
  /* @__PURE__ */ jsxRuntimeExports.jsx(AddBlockAtBottom, {}),
3645
3646
  /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
3646
3647
  /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
@@ -3751,7 +3752,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
3751
3752
  l !== o.length - 1 && /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "rtl:rotate-180", size: 16 })
3752
3753
  ] }, l))
3753
3754
  ] }) });
3754
- }, CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-NKqXoCPq.js")), CanvasArea = () => {
3755
+ }, CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-xKHFmP7r.js")), CanvasArea = () => {
3755
3756
  const [o] = useCodeEditor(), n = useBuilderProp("onError", noop);
3756
3757
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-full max-h-full w-full flex-1 flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex h-full max-h-full flex-col overflow-hidden bg-gray-100/40 px-2", children: [
3757
3758
  /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "h-full" }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(FallbackError, {}), onError: n, children: /* @__PURE__ */ jsxRuntimeExports.jsx(StaticCanvas$1, {}) }) }),
@@ -3826,8 +3827,8 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
3826
3827
  showHeading: o = !0,
3827
3828
  className: n = ""
3828
3829
  }) => {
3829
- const [r, a] = useBrandingOptions(), [l] = useBlocksContainer(), i = React.useRef(r), { t: c } = useTranslation(), d = ({ formData: w }, A) => {
3830
- A && (a(w), i.current = w);
3830
+ const [r, a] = useBrandingOptions(), [l] = useBlocksContainer(), i = React.useRef(r), { t: c } = useTranslation(), d = ({ formData: A }, w) => {
3831
+ w && (a(A), i.current = A);
3831
3832
  }, {
3832
3833
  bodyFont: u,
3833
3834
  headingFont: p,
@@ -3835,9 +3836,9 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
3835
3836
  bodyTextDarkColor: x,
3836
3837
  bodyTextLightColor: g,
3837
3838
  bodyBgDarkColor: E,
3838
- secondaryColor: b,
3839
+ secondaryColor: j,
3839
3840
  bodyBgLightColor: f,
3840
- roundedCorners: _
3841
+ roundedCorners: k
3841
3842
  } = r;
3842
3843
  let v = {
3843
3844
  headingFont: y({
@@ -3850,12 +3851,12 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
3850
3851
  default: u,
3851
3852
  options: FONTS
3852
3853
  }),
3853
- roundedCorners: s({
3854
+ roundedCorners: s$1({
3854
3855
  title: c("theme_config.rounded_corner"),
3855
- default: parseInt(_ || 5, 10)
3856
+ default: parseInt(k || 5, 10)
3856
3857
  }),
3857
3858
  primaryColor: h({ title: c("theme_config.primary"), default: m }),
3858
- secondaryColor: h({ title: c("theme_config.secondary"), default: b })
3859
+ secondaryColor: h({ title: c("theme_config.secondary"), default: j })
3859
3860
  };
3860
3861
  l || (v = {
3861
3862
  ...v,
@@ -3880,9 +3881,9 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
3880
3881
  type: "object",
3881
3882
  properties: {}
3882
3883
  }, B = {};
3883
- return Object.keys(v).forEach((w) => {
3884
- const A = v[w];
3885
- return S.properties || (S.properties = {}), S.properties[w] = A.schema, B[w] = A.uiSchema, !0;
3884
+ return Object.keys(v).forEach((A) => {
3885
+ const w = v[A];
3886
+ return S.properties || (S.properties = {}), S.properties[A] = w.schema, B[A] = w.uiSchema, !0;
3886
3887
  }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("flex h-full w-full select-none flex-col", n), children: [
3887
3888
  o ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-md bg-background/30 p-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "px-1 font-semibold", children: c("Theme Configuration") }) }) : null,
3888
3889
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -4078,34 +4079,34 @@ function BiExpandVertical(o) {
4078
4079
  const Node = memo(({ node: o, style: n, dragHandle: r }) => {
4079
4080
  const a = useBuilderProp("outlineMenuItems", []), { t: l } = useTranslation(), [i, , c] = useHiddenBlockIds(), [, d] = useHighlightBlockId(), [u] = useAtom$1(canvasIframeAtom);
4080
4081
  let p = null;
4081
- const m = o.children.length > 0, { id: x, data: g, isSelected: E, willReceiveDrop: b, isDragging: f, isEditing: _, handleClick: v } = o, S = (T) => {
4082
+ const m = o.children.length > 0, { id: x, data: g, isSelected: E, willReceiveDrop: j, isDragging: f, isEditing: k, handleClick: v } = o, S = (T) => {
4082
4083
  T.stopPropagation(), !i.includes(x) && o.toggle();
4083
4084
  }, B = (T) => {
4084
4085
  T.isInternal && (p = T.isOpen, T.isOpen && T.close());
4085
- }, w = (T) => {
4086
- T.isInternal && p !== null && (p ? T.open() : T.close(), p = null);
4087
4086
  }, A = (T) => {
4087
+ T.isInternal && p !== null && (p ? T.open() : T.close(), p = null);
4088
+ }, w = (T) => {
4088
4089
  T.stopPropagation(), !o.isOpen && !i.includes(x) && o.toggle(), v(T);
4089
4090
  };
4090
4091
  useEffect(() => {
4091
4092
  const T = setTimeout(() => {
4092
- b && !o.isOpen && !f && !i.includes(x) && o.toggle();
4093
+ j && !o.isOpen && !f && !i.includes(x) && o.toggle();
4093
4094
  }, 500);
4094
4095
  return () => clearTimeout(T);
4095
- }, [b, o, f]);
4096
+ }, [j, o, f]);
4096
4097
  const N = useMemo(() => {
4097
- const T = Object.keys(g), j = [];
4098
- for (let k = 0; k < T.length; k++)
4099
- if (T[k].endsWith("_attrs")) {
4100
- const C = g[T[k]], R = Object.keys(C).join("|");
4101
- R.match(/x-data/) && j.push("data"), R.match(/x-on/) && j.push("event"), R.match(/x-show|x-if/) && j.push("show");
4098
+ const T = Object.keys(g), b = [];
4099
+ for (let _ = 0; _ < T.length; _++)
4100
+ if (T[_].endsWith("_attrs")) {
4101
+ const C = g[T[_]], R = Object.keys(C).join("|");
4102
+ R.match(/x-data/) && b.push("data"), R.match(/x-on/) && b.push("event"), R.match(/x-show|x-if/) && b.push("show");
4102
4103
  }
4103
- return j;
4104
- }, [g]), D = (T, j) => {
4105
- const k = u.contentDocument || u.contentWindow.document, C = k.querySelector(`[data-block-id=${T}]`);
4106
- C && C.setAttribute("data-drop", j);
4104
+ return b;
4105
+ }, [g]), D = (T, b) => {
4106
+ const _ = u.contentDocument || u.contentWindow.document, C = _.querySelector(`[data-block-id=${T}]`);
4107
+ C && C.setAttribute("data-drop", b);
4107
4108
  const R = C.getBoundingClientRect(), I = u.getBoundingClientRect();
4108
- R.top >= I.top && R.left >= I.left && R.bottom <= I.bottom && R.right <= I.right || (k.documentElement.scrollTop = C.offsetTop - I.top);
4109
+ R.top >= I.top && R.left >= I.left && R.bottom <= I.bottom && R.right <= I.right || (_.documentElement.scrollTop = C.offsetTop - I.top);
4109
4110
  };
4110
4111
  return x === ROOT_TEMP_KEY ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
4111
4112
  "button",
@@ -4121,12 +4122,12 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
4121
4122
  "div",
4122
4123
  {
4123
4124
  onMouseEnter: () => d(x),
4124
- onClick: A,
4125
+ onClick: w,
4125
4126
  style: n,
4126
4127
  "data-node-id": x,
4127
4128
  ref: i.includes(x) ? null : r,
4128
4129
  onDragStart: () => B(o),
4129
- onDragEnd: () => w(o),
4130
+ onDragEnd: () => A(o),
4130
4131
  onDragOver: (T) => {
4131
4132
  T.preventDefault(), D(x, "yes");
4132
4133
  },
@@ -4139,7 +4140,7 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
4139
4140
  className: cn(
4140
4141
  "group flex !h-full w-full items-center justify-between space-x-px !rounded py-px text-foreground/80 outline-none",
4141
4142
  E ? "bg-blue-500 text-white" : "hover:bg-gray-200 dark:hover:bg-gray-800",
4142
- b && canAcceptChildBlock(g._type, "Icon") ? "bg-green-200" : "",
4143
+ j && canAcceptChildBlock(g._type, "Icon") ? "bg-green-200" : "",
4143
4144
  f && "opacity-20",
4144
4145
  i.includes(x) ? "opacity-50" : ""
4145
4146
  ),
@@ -4154,7 +4155,7 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
4154
4155
  ),
4155
4156
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
4156
4157
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "-mt-0.5 h-3 w-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TypeIcon, { type: g == null ? void 0 : g._type }) }),
4157
- _ ? /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { node: o }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
4158
+ k ? /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { node: o }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
4158
4159
  "div",
4159
4160
  {
4160
4161
  className: "ml-2 flex items-center gap-x-1 truncate text-[11px]",
@@ -4619,12 +4620,12 @@ function ExpandableObject(o) {
4619
4620
  shouldExpandNode: p,
4620
4621
  clickToExpandNode: m
4621
4622
  } = o;
4622
- const x = useRef(!1), [g, E, b] = useBool(() => p(d, r, n));
4623
+ const x = useRef(!1), [g, E, j] = useBool(() => p(d, r, n));
4623
4624
  useEffect(() => {
4624
- x.current ? b(p(d, r, n)) : x.current = !0;
4625
+ x.current ? j(p(d, r, n)) : x.current = !0;
4625
4626
  }, [p]);
4626
- const f = g ? u.collapseIcon : u.expandIcon, _ = g ? "collapse JSON" : "expand JSON", v = useComponentId(), S = d + 1, B = a.length - 1, w = (A) => {
4627
- A.key === " " && (A.preventDefault(), E());
4627
+ const f = g ? u.collapseIcon : u.expandIcon, k = g ? "collapse JSON" : "expand JSON", v = useComponentId(), S = d + 1, B = a.length - 1, A = (w) => {
4628
+ w.key === " " && (w.preventDefault(), E());
4628
4629
  };
4629
4630
  return /* @__PURE__ */ createElement("div", {
4630
4631
  className: u.basicChildStyle,
@@ -4632,16 +4633,16 @@ function ExpandableObject(o) {
4632
4633
  }, /* @__PURE__ */ createElement("span", {
4633
4634
  className: f,
4634
4635
  onClick: E,
4635
- onKeyDown: w,
4636
+ onKeyDown: A,
4636
4637
  role: "button",
4637
4638
  tabIndex: 0,
4638
- "aria-label": _,
4639
+ "aria-label": k,
4639
4640
  "aria-expanded": g,
4640
4641
  "aria-controls": g ? v : void 0
4641
4642
  }), n && (m ? /* @__PURE__ */ createElement("span", {
4642
4643
  className: u.clickableLabel,
4643
4644
  onClick: E,
4644
- onKeyDown: w,
4645
+ onKeyDown: A,
4645
4646
  role: "button",
4646
4647
  tabIndex: -1
4647
4648
  }, n, ":") : /* @__PURE__ */ createElement("span", {
@@ -4650,10 +4651,10 @@ function ExpandableObject(o) {
4650
4651
  className: u.punctuation
4651
4652
  }, i), g ? /* @__PURE__ */ createElement("div", {
4652
4653
  id: v
4653
- }, a.map((A, N) => /* @__PURE__ */ createElement(DataRender, {
4654
- key: A[0] || N,
4655
- field: A[0],
4656
- value: A[1],
4654
+ }, a.map((w, N) => /* @__PURE__ */ createElement(DataRender, {
4655
+ key: w[0] || N,
4656
+ field: w[0],
4657
+ value: w[1],
4657
4658
  style: u,
4658
4659
  lastElement: N === B,
4659
4660
  level: S,
@@ -4662,11 +4663,11 @@ function ExpandableObject(o) {
4662
4663
  }))) : /* @__PURE__ */ createElement("span", {
4663
4664
  className: u.collapsedContent,
4664
4665
  onClick: E,
4665
- onKeyDown: w,
4666
+ onKeyDown: A,
4666
4667
  role: "button",
4667
4668
  tabIndex: -1,
4668
4669
  "aria-hidden": !0,
4669
- "aria-label": _,
4670
+ "aria-label": k,
4670
4671
  "aria-expanded": g
4671
4672
  }), /* @__PURE__ */ createElement("span", {
4672
4673
  className: u.punctuation
@@ -4821,8 +4822,8 @@ const ViewData = ({ data: o, fullView: n }) => {
4821
4822
  appliedBindings: c
4822
4823
  }) => {
4823
4824
  const { paths: d, pathsType: u } = getPathAndTypes(a), p = o === "PROP" ? getBlockComponent(a == null ? void 0 : a._type) : {}, m = o === "PROP", [x, g] = useState(!1), E = useMemo(() => o === "PROP" ? d.filter(
4824
- (b) => !includes(c, b) && get(p, `props.${first(split(b, "."))}.binding`)
4825
- ) : d.filter((b) => i === get(u, b, "")), [o, d, c, i, p]);
4825
+ (j) => !includes(c, j) && get(p, `props.${first(split(j, "."))}.binding`)
4826
+ ) : d.filter((j) => i === get(u, j, "")), [o, d, c, i, p]);
4826
4827
  return useEffect(() => {
4827
4828
  n && l(n);
4828
4829
  }, [n, o]), /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
@@ -4851,23 +4852,23 @@ const ViewData = ({ data: o, fullView: n }) => {
4851
4852
  /* @__PURE__ */ jsxRuntimeExports.jsx(CommandInput, { placeholder: `Choose ${toLower(o)}...` }),
4852
4853
  /* @__PURE__ */ jsxRuntimeExports.jsxs(CommandList, { children: [
4853
4854
  /* @__PURE__ */ jsxRuntimeExports.jsx(CommandEmpty, { children: "No results found." }),
4854
- /* @__PURE__ */ jsxRuntimeExports.jsx(CommandGroup, { children: map(E, (b) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
4855
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CommandGroup, { children: map(E, (j) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
4855
4856
  CommandItem,
4856
4857
  {
4857
- value: b,
4858
+ value: j,
4858
4859
  className: `cursor-pointer ${m ? "flex items-center justify-between" : "flex flex-col items-start justify-start"}`,
4859
4860
  onSelect: (f) => {
4860
- r(find(E, (_) => _ === f) || null), g(!1);
4861
+ r(find(E, (k) => k === f) || null), g(!1);
4861
4862
  },
4862
4863
  children: [
4863
4864
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-x-2", children: [
4864
- /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: `h-4 w-4 text-green-500 ${n === b ? "" : "opacity-0"}` }),
4865
- b
4865
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: `h-4 w-4 text-green-500 ${n === j ? "" : "opacity-0"}` }),
4866
+ j
4866
4867
  ] }),
4867
- m ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: startCase(get(u, b, "")) }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pl-6", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ViewData, { data: get(a, b) }) })
4868
+ m ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: startCase(get(u, j, "")) }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pl-6", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ViewData, { data: get(a, j) }) })
4868
4869
  ]
4869
4870
  },
4870
- b
4871
+ j
4871
4872
  )) })
4872
4873
  ] })
4873
4874
  ] }) })
@@ -4882,15 +4883,15 @@ const ViewData = ({ data: o, fullView: n }) => {
4882
4883
  item: a
4883
4884
  }) => {
4884
4885
  const [l, i] = useState(r ? a.key : ""), [c, d] = useState(r ? a.value : ""), u = useSelectedBlock(), [p] = useChaiExternalData(), m = useCallback(
4885
- (E, b) => {
4886
+ (E, j) => {
4886
4887
  if (isEmpty(E))
4887
4888
  return "";
4888
4889
  {
4889
- const f = get(b === "PROP" ? u : p, E, "");
4890
+ const f = get(j === "PROP" ? u : p, E, "");
4890
4891
  if (isArray$1(f))
4891
4892
  return "list";
4892
- const _ = typeof f;
4893
- return _ === "string" ? "text" : _ === "object" ? "model" : _;
4893
+ const k = typeof f;
4894
+ return k === "string" ? "text" : k === "object" ? "model" : k;
4894
4895
  }
4895
4896
  },
4896
4897
  [u, p]
@@ -4910,8 +4911,8 @@ const ViewData = ({ data: o, fullView: n }) => {
4910
4911
  value: l,
4911
4912
  setValue: i,
4912
4913
  onChange: (E) => {
4913
- const b = m(E, "PROP");
4914
- i(E), x !== b && d(""), g(b);
4914
+ const j = m(E, "PROP");
4915
+ i(E), x !== j && d(""), g(j);
4915
4916
  },
4916
4917
  data: u,
4917
4918
  dataType: x,
@@ -4928,8 +4929,8 @@ const ViewData = ({ data: o, fullView: n }) => {
4928
4929
  value: c,
4929
4930
  setValue: d,
4930
4931
  onChange: (E) => {
4931
- const b = m(E, "PATH");
4932
- d(x === b ? E : "");
4932
+ const j = m(E, "PATH");
4933
+ d(x === j ? E : "");
4933
4934
  },
4934
4935
  data: p,
4935
4936
  dataType: x,
@@ -5017,7 +5018,7 @@ const ViewData = ({ data: o, fullView: n }) => {
5017
5018
  const g = filter(i, (E) => E.key !== x.key);
5018
5019
  c([...g, x]), m([...g, x]);
5019
5020
  }, p = (x) => {
5020
- const g = filter(i, (E, b) => x !== b);
5021
+ const g = filter(i, (E, j) => x !== j);
5021
5022
  m([...g]);
5022
5023
  }, m = useCallback(
5023
5024
  (x = []) => {
@@ -5136,7 +5137,7 @@ const ViewData = ({ data: o, fullView: n }) => {
5136
5137
  }
5137
5138
  )
5138
5139
  ] });
5139
- }, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-Z3xcNddA.js")), UploadImages = React__default.lazy(() => import("./UploadImages-v50EQZLT.js")), ImagesPanel = ({
5140
+ }, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-C9snpLoA.js")), UploadImages = React__default.lazy(() => import("./UploadImages-yrFhyBgy.js")), ImagesPanel = ({
5140
5141
  isModalView: o = !1,
5141
5142
  onSelect: n = () => {
5142
5143
  }
@@ -5296,18 +5297,18 @@ const ImagePickerModal$1 = ImagePickerModal, ImagePickerField = ({ value: o, onC
5296
5297
  ] });
5297
5298
  }, JSONForm = memo(({ id: o, properties: n, formData: r, onChange: a }) => {
5298
5299
  const [l, i] = useState(r), c = { type: "object", properties: {} }, d = {}, { t: u } = useTranslation(), { selectedLang: p, fallbackLang: m, languages: x } = useLanguages(), g = x.length === 0 ? "" : p.length ? p : m;
5299
- Object.keys(n).forEach((b) => {
5300
- const f = n[b];
5300
+ Object.keys(n).forEach((j) => {
5301
+ const f = n[j];
5301
5302
  if (includes(["slot", "styles"], f.type))
5302
5303
  return;
5303
- const _ = b;
5304
- c.properties[_] = getBlockJSONFromSchemas(f, u, g), d[_] = getBlockJSONFromUISchemas(f);
5304
+ const k = j;
5305
+ c.properties[k] = getBlockJSONFromSchemas(f, u, g), d[k] = getBlockJSONFromUISchemas(f);
5305
5306
  }), useEffect(() => {
5306
5307
  i(r);
5307
5308
  }, [o, p]);
5308
5309
  const E = useThrottledCallback(
5309
- async ({ formData: b }, f) => {
5310
- a({ formData: b }, f);
5310
+ async ({ formData: j }, f) => {
5311
+ a({ formData: j }, f);
5311
5312
  },
5312
5313
  [a],
5313
5314
  1e3
@@ -5333,8 +5334,8 @@ const ImagePickerModal$1 = ImagePickerModal, ImagePickerField = ({ value: o, onC
5333
5334
  uiSchema: d,
5334
5335
  schema: c,
5335
5336
  formData: l,
5336
- onChange: ({ formData: b }, f) => {
5337
- f && (i(b), E({ formData: b }, f));
5337
+ onChange: ({ formData: j }, f) => {
5338
+ f && (i(j), E({ formData: j }, f));
5338
5339
  }
5339
5340
  }
5340
5341
  );
@@ -5403,30 +5404,30 @@ const ImagePickerModal$1 = ImagePickerModal, ImagePickerField = ({ value: o, onC
5403
5404
  }), a;
5404
5405
  };
5405
5406
  function BlockSettings() {
5406
- const { selectedLang: o } = useLanguages(), n = useSelectedBlock(), r = useUpdateBlocksPropsRealtime(), a = useUpdateBlocksProps(), l = getBlockComponent(n == null ? void 0 : n._type), i = formDataWithSelectedLang(n, o, l), [c, d] = useState(i), u = useBuilderProp("dataBindingSupport", !1), p = ({ formData: f }, _, v) => {
5407
- if (_ && (c == null ? void 0 : c._id) === n._id) {
5408
- const S = _.replace("root.", "");
5407
+ const { selectedLang: o } = useLanguages(), n = useSelectedBlock(), r = useUpdateBlocksPropsRealtime(), a = useUpdateBlocksProps(), l = getBlockComponent(n == null ? void 0 : n._type), i = formDataWithSelectedLang(n, o, l), [c, d] = useState(i), u = useBuilderProp("dataBindingSupport", !1), p = ({ formData: f }, k, v) => {
5408
+ if (k && (c == null ? void 0 : c._id) === n._id) {
5409
+ const S = k.replace("root.", "");
5409
5410
  a([n._id], { [S]: get(f, S) }, v);
5410
5411
  }
5411
5412
  }, m = useCallback(
5412
- debounce(({ formData: f }, _, v) => {
5413
- p({ formData: f }, _, v), d(f);
5413
+ debounce(({ formData: f }, k, v) => {
5414
+ p({ formData: f }, k, v), d(f);
5414
5415
  }, 1500),
5415
5416
  [n == null ? void 0 : n._id, o]
5416
- ), x = ({ formData: f }, _) => {
5417
- if (_) {
5418
- const v = _.replace("root.", "");
5417
+ ), x = ({ formData: f }, k) => {
5418
+ if (k) {
5419
+ const v = k.replace("root.", "");
5419
5420
  r(
5420
5421
  [n._id],
5421
5422
  convertDotNotationToObject(v, get(f, v.split(".")))
5422
- ), m({ formData: f }, _, { [v]: get(c, v) });
5423
+ ), m({ formData: f }, k, { [v]: get(c, v) });
5423
5424
  }
5424
5425
  }, g = keys(get(i, "_bindings", {})), E = useMemo(() => {
5425
5426
  const f = cloneDeep(get(l, "props", {}));
5426
- return each(f, (_, v) => {
5427
- get(_, "hidden", !1) && delete f[v];
5428
- }), u && each(g, (_) => delete f[_]), f;
5429
- }, [l, g, u]), b = get(l, "server", !1);
5427
+ return each(f, (k, v) => {
5428
+ get(k, "hidden", !1) && delete f[v];
5429
+ }), u && each(g, (k) => delete f[k]), f;
5430
+ }, [l, g, u]), j = get(l, "server", !1);
5430
5431
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "overflow-x-hidden px-px", children: [
5431
5432
  u ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Accordion, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "mt-4 h-full w-full", children: [
5432
5433
  /* @__PURE__ */ jsxRuntimeExports.jsxs(AccordionItem, { value: "BINDING", children: [
@@ -5483,7 +5484,7 @@ function BlockSettings() {
5483
5484
  }
5484
5485
  ),
5485
5486
  (n == null ? void 0 : n._type) === "GlobalBlock" ? /* @__PURE__ */ jsxRuntimeExports.jsx(GlobalBlockSettings, {}) : null,
5486
- b ? /* @__PURE__ */ jsxRuntimeExports.jsx(ResetRSCBlockButton, { blockId: n == null ? void 0 : n._id }) : null,
5487
+ j ? /* @__PURE__ */ jsxRuntimeExports.jsx(ResetRSCBlockButton, { blockId: n == null ? void 0 : n._id }) : null,
5487
5488
  /* @__PURE__ */ jsxRuntimeExports.jsx(CanvasSettings, {})
5488
5489
  ] });
5489
5490
  }
@@ -5510,22 +5511,22 @@ const askAiProcessingAtom = atom$1(!1), useAskAi = () => {
5510
5511
  const [o, n] = useAtom$1(askAiProcessingAtom), [r, a] = useState(null), l = useBuilderProp("askAiCallBack", null), i = useStreamMultipleBlocksProps(), c = useUpdateMultipleBlocksProps(), [d] = useBlocksStore(), { selectedLang: u, fallbackLang: p } = useLanguages(), m = u.length ? u : p;
5511
5512
  return {
5512
5513
  askAi: useCallback(
5513
- async (x, g, E, b) => {
5514
+ async (x, g, E, j) => {
5514
5515
  if (l) {
5515
5516
  n(!0), a(null);
5516
5517
  try {
5517
5518
  const f = x === "content" ? cloneDeep(getBlockWithChildren(g, d)) : [cloneDeep(d.find((B) => B._id === g))];
5518
5519
  set(f, "0._parent", null);
5519
- const _ = await l(x, promptWithLanguage(E, m, x), f), { blocks: v, error: S } = _;
5520
+ const k = await l(x, promptWithLanguage(E, m, x), f), { blocks: v, error: S } = k;
5520
5521
  if (S) {
5521
5522
  a(S);
5522
5523
  return;
5523
5524
  }
5524
- x === "styles" ? c(v) : i(v), b && b(_);
5525
+ x === "styles" ? c(v) : i(v), j && j(k);
5525
5526
  } catch (f) {
5526
5527
  a(f);
5527
5528
  } finally {
5528
- n(!1), b && b();
5529
+ n(!1), j && j();
5529
5530
  }
5530
5531
  }
5531
5532
  },
@@ -5664,24 +5665,24 @@ const AskAIStyles = ({ blockId: o }) => {
5664
5665
  keys: ["name"]
5665
5666
  });
5666
5667
  function ManualClasses() {
5667
- var A;
5668
- const { t: o } = useTranslation(), [n] = useSelectedStylingBlocks(), r = useSelectedBlock(), a = useAddClassesToBlocks(), l = useRemoveClassesFromBlocks(), [i] = useSelectedBlockIds(), c = useBuilderProp("askAiCallBack", null), [d, u] = useState(""), { toast: p } = useToast(), m = (A = first(n)) == null ? void 0 : A.prop, x = reject((get(r, m, "").replace(STYLES_KEY, "").split(",").pop() || "").split(" "), isEmpty), g = () => {
5668
+ var w;
5669
+ const { t: o } = useTranslation(), [n] = useSelectedStylingBlocks(), r = useSelectedBlock(), a = useAddClassesToBlocks(), l = useRemoveClassesFromBlocks(), [i] = useSelectedBlockIds(), c = useBuilderProp("askAiCallBack", null), [d, u] = useState(""), { toast: p } = useToast(), m = (w = first(n)) == null ? void 0 : w.prop, x = reject((get(r, m, "").replace(STYLES_KEY, "").split(",").pop() || "").split(" "), isEmpty), g = () => {
5669
5670
  const N = d.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
5670
5671
  a(i, N, !0), u("");
5671
- }, [E, b] = useState([]), f = ({ value: N }) => {
5672
+ }, [E, j] = useState([]), f = ({ value: N }) => {
5672
5673
  const D = N.trim().toLowerCase(), T = D.match(/.+:/g);
5673
- let j = [];
5674
+ let b = [];
5674
5675
  if (T && T.length > 0) {
5675
- const [k] = T, C = D.replace(k, "");
5676
- j = fuse.search(C).map((I) => ({
5676
+ const [_] = T, C = D.replace(_, "");
5677
+ b = fuse.search(C).map((I) => ({
5677
5678
  ...I,
5678
- item: { ...I.item, name: k + I.item.name }
5679
+ item: { ...I.item, name: _ + I.item.name }
5679
5680
  }));
5680
5681
  } else
5681
- j = fuse.search(D);
5682
- return b(map(j, "item"));
5683
- }, _ = () => {
5684
- b([]);
5682
+ b = fuse.search(D);
5683
+ return j(map(b, "item"));
5684
+ }, k = () => {
5685
+ j([]);
5685
5686
  }, v = (N) => N.name, S = (N) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-md p-1", children: N.name }), B = {
5686
5687
  autoComplete: "off",
5687
5688
  autoCorrect: "off",
@@ -5694,7 +5695,7 @@ function ManualClasses() {
5694
5695
  },
5695
5696
  onChange: (N, { newValue: D }) => u(D),
5696
5697
  className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
5697
- }, w = () => {
5698
+ }, A = () => {
5698
5699
  if (navigator.clipboard === void 0) {
5699
5700
  p({
5700
5701
  title: o("clipboard_not_supported"),
@@ -5717,7 +5718,7 @@ function ManualClasses() {
5717
5718
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-x-2 text-muted-foreground", children: [
5718
5719
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: o("classes") }),
5719
5720
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
5720
- /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyIcon, { onClick: w, className: "cursor-pointer" }) }),
5721
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyIcon, { onClick: A, className: "cursor-pointer" }) }),
5721
5722
  /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: o("copy_classes_to_clipboard") }) })
5722
5723
  ] })
5723
5724
  ] }),
@@ -5735,7 +5736,7 @@ function ManualClasses() {
5735
5736
  {
5736
5737
  suggestions: E,
5737
5738
  onSuggestionsFetchRequested: f,
5738
- onSuggestionsClearRequested: _,
5739
+ onSuggestionsClearRequested: k,
5739
5740
  getSuggestionValue: v,
5740
5741
  renderSuggestion: S,
5741
5742
  inputProps: B,
@@ -6170,8 +6171,8 @@ const RangeChoices = ({ property: o, onChange: n }) => {
6170
6171
  }, ColorChoice = ({ property: o, onChange: n }) => {
6171
6172
  const r = useCurrentClassByProperty(o), a = useMemo(() => get(r, "cls", ""), [r]), { canChange: l } = useContext(StyleContext), [i, c] = useState([]), [d, u] = useState({ color: "", shade: "" }), p = a.split("-"), m = get(p, "1", ""), x = get(p, "2", ""), g = useCallback(
6172
6173
  // eslint-disable-next-line no-shadow
6173
- (b) => {
6174
- ["current", "inherit", "transparent", "black", "white"].includes(b) ? (c([]), u({ color: b })) : (c(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), u((f) => ({ ...f, color: b, shade: f.shade ? f.shade : "500" })));
6174
+ (j) => {
6175
+ ["current", "inherit", "transparent", "black", "white"].includes(j) ? (c([]), u({ color: j })) : (c(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), u((f) => ({ ...f, color: j, shade: f.shade ? f.shade : "500" })));
6175
6176
  },
6176
6177
  [c, u]
6177
6178
  );
@@ -6182,8 +6183,8 @@ const RangeChoices = ({ property: o, onChange: n }) => {
6182
6183
  }, [m]);
6183
6184
  const E = useCallback(
6184
6185
  // eslint-disable-next-line no-shadow
6185
- (b) => {
6186
- u({ color: m, shade: b });
6186
+ (j) => {
6187
+ u({ color: m, shade: j });
6187
6188
  },
6188
6189
  [m]
6189
6190
  );
@@ -6427,50 +6428,50 @@ const RangeChoices = ({ property: o, onChange: n }) => {
6427
6428
  },
6428
6429
  a
6429
6430
  )) }), THROTTLE_TIME = 50, AdvanceChoices = (o) => {
6430
- const [n, r] = useState(!1), [a, l] = useState(""), { currentClass: i, onChange: c, classPrefix: d, cssProperty: u, units: p, negative: m } = o, [x, g] = useState(u != null && u.toLowerCase().includes("width") ? "%" : p[0]), [E, b] = useState(!1), [f, _] = useState(""), [v, S] = useState(!1), [B, w] = useState(!1);
6431
+ const [n, r] = useState(!1), [a, l] = useState(""), { currentClass: i, onChange: c, classPrefix: d, cssProperty: u, units: p, negative: m } = o, [x, g] = useState(u != null && u.toLowerCase().includes("width") ? "%" : p[0]), [E, j] = useState(!1), [f, k] = useState(""), [v, S] = useState(!1), [B, A] = useState(!1);
6431
6432
  useEffect(() => {
6432
- const { value: j, unit: k } = getClassValueAndUnit(i);
6433
- if (k === "") {
6434
- l(j), g(u != null && u.toLowerCase().includes("width") ? "%" : first(p));
6433
+ const { value: b, unit: _ } = getClassValueAndUnit(i);
6434
+ if (_ === "") {
6435
+ l(b), g(u != null && u.toLowerCase().includes("width") ? "%" : first(p));
6435
6436
  return;
6436
6437
  }
6437
- g(k), l(k === "class" || isEmpty(j) ? "" : j);
6438
+ g(_), l(_ === "class" || isEmpty(b) ? "" : b);
6438
6439
  }, [i, u, p]);
6439
- const A = useThrottledCallback((j) => c(j), [c], THROTTLE_TIME), N = useThrottledCallback((j) => c(j, !1), [c], THROTTLE_TIME), D = useCallback(
6440
- (j = !1) => {
6441
- const k = getUserInputValues(`${a}`, p);
6442
- if (get(k, "error", !1)) {
6443
- b(!0);
6440
+ const w = useThrottledCallback((b) => c(b), [c], THROTTLE_TIME), N = useThrottledCallback((b) => c(b, !1), [c], THROTTLE_TIME), D = useCallback(
6441
+ (b = !1) => {
6442
+ const _ = getUserInputValues(`${a}`, p);
6443
+ if (get(_, "error", !1)) {
6444
+ j(!0);
6444
6445
  return;
6445
6446
  }
6446
- const C = get(k, "unit") !== "" ? get(k, "unit") : x;
6447
+ const C = get(_, "unit") !== "" ? get(_, "unit") : x;
6447
6448
  if (C === "auto" || C === "none") {
6448
- A(`${d}${C}`);
6449
+ w(`${d}${C}`);
6449
6450
  return;
6450
6451
  }
6451
- if (get(k, "value") === "")
6452
+ if (get(_, "value") === "")
6452
6453
  return;
6453
- const I = `${get(k, "value", "").startsWith("-") ? "-" : ""}${d}[${get(k, "value", "").replace("-", "")}${C === "-" ? "" : C}]`;
6454
- j ? N(I) : A(I);
6454
+ const I = `${get(_, "value", "").startsWith("-") ? "-" : ""}${d}[${get(_, "value", "").replace("-", "")}${C === "-" ? "" : C}]`;
6455
+ b ? N(I) : w(I);
6455
6456
  },
6456
- [A, N, a, x, d, p]
6457
+ [w, N, a, x, d, p]
6457
6458
  ), T = useCallback(
6458
- (j) => {
6459
- const k = getUserInputValues(`${a}`, p);
6460
- if (get(k, "error", !1)) {
6461
- b(!0);
6459
+ (b) => {
6460
+ const _ = getUserInputValues(`${a}`, p);
6461
+ if (get(_, "error", !1)) {
6462
+ j(!0);
6462
6463
  return;
6463
6464
  }
6464
- if (j === "auto" || j === "none") {
6465
- A(`${d}${j}`);
6465
+ if (b === "auto" || b === "none") {
6466
+ w(`${d}${b}`);
6466
6467
  return;
6467
6468
  }
6468
- if (get(k, "value") === "")
6469
+ if (get(_, "value") === "")
6469
6470
  return;
6470
- const C = get(k, "unit") !== "" ? get(k, "unit") : j, I = `${get(k, "value", "").startsWith("-") ? "-" : ""}${d}[${get(k, "value", "").replace("-", "")}${C === "-" ? "" : C}]`;
6471
- A(I);
6471
+ const C = get(_, "unit") !== "" ? get(_, "unit") : b, I = `${get(_, "value", "").startsWith("-") ? "-" : ""}${d}[${get(_, "value", "").replace("-", "")}${C === "-" ? "" : C}]`;
6472
+ w(I);
6472
6473
  },
6473
- [A, a, d, p]
6474
+ [w, a, d, p]
6474
6475
  );
6475
6476
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-start", children: x === "class" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
6476
6477
  /* @__PURE__ */ jsxRuntimeExports.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: i }),
@@ -6484,29 +6485,29 @@ const RangeChoices = ({ property: o, onChange: n }) => {
6484
6485
  "input",
6485
6486
  {
6486
6487
  readOnly: x === "class",
6487
- onKeyPress: (j) => {
6488
- j.key === "Enter" && D();
6488
+ onKeyPress: (b) => {
6489
+ b.key === "Enter" && D();
6489
6490
  },
6490
- onKeyDown: (j) => {
6491
- if (j.keyCode !== 38 && j.keyCode !== 40)
6491
+ onKeyDown: (b) => {
6492
+ if (b.keyCode !== 38 && b.keyCode !== 40)
6492
6493
  return;
6493
- j.preventDefault(), w(!0);
6494
- const k = parseInt$1(j.target.value);
6495
- let C = isNaN$1(k) ? 0 : k;
6496
- j.keyCode === 38 && (C += 1), j.keyCode === 40 && (C -= 1);
6494
+ b.preventDefault(), A(!0);
6495
+ const _ = parseInt$1(b.target.value);
6496
+ let C = isNaN$1(_) ? 0 : _;
6497
+ b.keyCode === 38 && (C += 1), b.keyCode === 40 && (C -= 1);
6497
6498
  const R = `${C}`, L = `${R.startsWith("-") ? "-" : ""}${d}[${R.replace("-", "")}${x === "-" ? "" : x}]`;
6498
6499
  N(L);
6499
6500
  },
6500
- onKeyUp: (j) => {
6501
- B && (j.preventDefault(), w(!1));
6501
+ onKeyUp: (b) => {
6502
+ B && (b.preventDefault(), A(!1));
6502
6503
  },
6503
6504
  onBlur: () => D(),
6504
- onChange: (j) => {
6505
- b(!1), l(j.target.value);
6505
+ onChange: (b) => {
6506
+ j(!1), l(b.target.value);
6506
6507
  },
6507
- onClick: (j) => {
6508
- var k;
6509
- (k = j == null ? void 0 : j.target) == null || k.select(), r(!1);
6508
+ onClick: (b) => {
6509
+ var _;
6510
+ (_ = b == null ? void 0 : b.target) == null || _.select(), r(!1);
6510
6511
  },
6511
6512
  value: v ? f : a,
6512
6513
  className: "h-6 w-14 rounded rounded-r-none border border-transparent bg-background pl-2 text-sm focus-visible:outline-0".concat(
@@ -6533,8 +6534,8 @@ const RangeChoices = ({ property: o, onChange: n }) => {
6533
6534
  {
6534
6535
  units: p,
6535
6536
  current: x,
6536
- onSelect: (j) => {
6537
- r(!1), g(j), T(j);
6537
+ onSelect: (b) => {
6538
+ r(!1), g(b), T(b);
6538
6539
  }
6539
6540
  }
6540
6541
  ) }) })
@@ -6544,17 +6545,17 @@ const RangeChoices = ({ property: o, onChange: n }) => {
6544
6545
  DragStyleButton,
6545
6546
  {
6546
6547
  onDragStart: () => S(!0),
6547
- onDragEnd: (j) => {
6548
- if (_(() => ""), S(!1), isEmpty(j))
6548
+ onDragEnd: (b) => {
6549
+ if (k(() => ""), S(!1), isEmpty(b))
6549
6550
  return;
6550
- const k = `${j}`, R = `${k.startsWith("-") ? "-" : ""}${d}[${k.replace("-", "")}${x === "-" ? "" : x}]`;
6551
- A(R);
6551
+ const _ = `${b}`, R = `${_.startsWith("-") ? "-" : ""}${d}[${_.replace("-", "")}${x === "-" ? "" : x}]`;
6552
+ w(R);
6552
6553
  },
6553
- onDrag: (j) => {
6554
- if (isEmpty(j))
6554
+ onDrag: (b) => {
6555
+ if (isEmpty(b))
6555
6556
  return;
6556
- _(j);
6557
- const k = `${j}`, R = `${k.startsWith("-") ? "-" : ""}${d}[${k.replace("-", "")}${x === "-" ? "" : x}]`;
6557
+ k(b);
6558
+ const _ = `${b}`, R = `${_.startsWith("-") ? "-" : ""}${d}[${_.replace("-", "")}${x === "-" ? "" : x}]`;
6558
6559
  N(R);
6559
6560
  },
6560
6561
  currentValue: a,
@@ -6652,21 +6653,21 @@ const RangeChoices = ({ property: o, onChange: n }) => {
6652
6653
  "2xl": "1536px"
6653
6654
  }, getBreakpoint = (o) => `${o.toUpperCase()} ${BREAKPOINTS[o] ? `(${BREAKPOINTS[o]} & up)` : ""}`, BlockStyle = (o) => {
6654
6655
  const { t: n } = useTranslation(), { type: r = "icons", label: a, property: l, onEmitChange: i = () => {
6655
- }, units: c, negative: d = !1 } = o, [u] = useDarkMode(), [p] = useStylingState(), [, m] = useCanvasWidth(), x = useCurrentClassByProperty(l), g = useAddClassesToBlocks(), E = useRemoveClassesFromBlocks(), [b] = useSelectedBlockIds(), f = useMemo(() => get(x, "fullCls", ""), [x]), _ = useCallback(
6656
+ }, units: c, negative: d = !1 } = o, [u] = useDarkMode(), [p] = useStylingState(), [, m] = useCanvasWidth(), x = useCurrentClassByProperty(l), g = useAddClassesToBlocks(), E = useRemoveClassesFromBlocks(), [j] = useSelectedBlockIds(), f = useMemo(() => get(x, "fullCls", ""), [x]), k = useCallback(
6656
6657
  (N, D = !0) => {
6657
6658
  const T = { dark: u, mq: m, mod: p, cls: N, property: l, fullCls: "" };
6658
6659
  (u || p !== "") && (T.mq = "xs");
6659
- const j = generateFullClsName(T);
6660
- g(b, [j], D);
6660
+ const b = generateFullClsName(T);
6661
+ g(j, [b], D);
6661
6662
  },
6662
- [b, u, m, p, l, g]
6663
+ [j, u, m, p, l, g]
6663
6664
  ), v = useCallback(() => {
6664
- E(b, [f]);
6665
- }, [b, f, E]), S = useMemo(() => canChangeClass(x, m), [x, m]);
6665
+ E(j, [f]);
6666
+ }, [j, f, E]), S = useMemo(() => canChangeClass(x, m), [x, m]);
6666
6667
  useEffect(() => {
6667
6668
  i(S, x);
6668
6669
  }, [S, i, x]);
6669
- const [, , B] = useCanvasWidth(), w = useCallback(
6670
+ const [, , B] = useCanvasWidth(), A = useCallback(
6670
6671
  (N) => {
6671
6672
  B({
6672
6673
  xs: 400,
@@ -6678,9 +6679,9 @@ const RangeChoices = ({ property: o, onChange: n }) => {
6678
6679
  }[N]);
6679
6680
  },
6680
6681
  [B]
6681
- ), A = get(x, "dark", null) === u && get(x, "mod", null) === p && get(x, "mq", null) === m;
6682
- return /* @__PURE__ */ jsxRuntimeExports.jsx(BlockStyleProvider, { canChange: S, canReset: x && A, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
6683
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `text-[11px] ${x && !A ? "text-foreground" : ""}`, children: n(a) }) }),
6682
+ ), w = get(x, "dark", null) === u && get(x, "mod", null) === p && get(x, "mq", null) === m;
6683
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(BlockStyleProvider, { canChange: S, canReset: x && w, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
6684
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `text-[11px] ${x && !w ? "text-foreground" : ""}`, children: n(a) }) }),
6684
6685
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row items-center", children: [
6685
6686
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-[150px]", children: [
6686
6687
  r === "arbitrary" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -6689,17 +6690,17 @@ const RangeChoices = ({ property: o, onChange: n }) => {
6689
6690
  currentClass: get(x, "cls", ""),
6690
6691
  classPrefix: get(CLASS_PREFIXES, l, ""),
6691
6692
  units: c || [],
6692
- onChange: _,
6693
+ onChange: k,
6693
6694
  negative: d,
6694
6695
  cssProperty: l
6695
6696
  }
6696
6697
  ) : null,
6697
- r === "icons" && /* @__PURE__ */ jsxRuntimeExports.jsx(IconChoices, { property: l, onChange: _ }),
6698
- r === "range" && /* @__PURE__ */ jsxRuntimeExports.jsx(RangeChoices, { property: l, onChange: _ }),
6699
- r === "color" && /* @__PURE__ */ jsxRuntimeExports.jsx(ColorChoice, { property: l, onChange: _ }),
6700
- r === "dropdown" && /* @__PURE__ */ jsxRuntimeExports.jsx(DropDownChoices, { label: a, property: l, onChange: _ })
6698
+ r === "icons" && /* @__PURE__ */ jsxRuntimeExports.jsx(IconChoices, { property: l, onChange: k }),
6699
+ r === "range" && /* @__PURE__ */ jsxRuntimeExports.jsx(RangeChoices, { property: l, onChange: k }),
6700
+ r === "color" && /* @__PURE__ */ jsxRuntimeExports.jsx(ColorChoice, { property: l, onChange: k }),
6701
+ r === "dropdown" && /* @__PURE__ */ jsxRuntimeExports.jsx(DropDownChoices, { label: a, property: l, onChange: k })
6701
6702
  ] }),
6702
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-[30px] cursor-pointer ${f ? "visible" : "invisible"}`, children: A ? /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", onClick: () => v(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CrossCircledIcon, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : S && x ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { delayDuration: 100, children: [
6703
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-[30px] cursor-pointer ${f ? "visible" : "invisible"}`, children: w ? /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", onClick: () => v(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CrossCircledIcon, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : S && x ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { delayDuration: 100, children: [
6703
6704
  /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
6704
6705
  "button",
6705
6706
  {
@@ -6719,7 +6720,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
6719
6720
  "button",
6720
6721
  {
6721
6722
  type: "button",
6722
- onClick: () => w(get(x, "mq")),
6723
+ onClick: () => A(get(x, "mq")),
6723
6724
  className: "block w-full cursor-default text-right font-semibold text-blue-500",
6724
6725
  children: [
6725
6726
  "Switch to ",
@@ -6976,12 +6977,12 @@ const BlockCard = ({
6976
6977
  library: n,
6977
6978
  parentId: r = void 0
6978
6979
  }) => {
6979
- const [a, l] = useState(!1), i = useBuilderProp("getUILibraryBlock", noop), { addCoreBlock: c, addPredefinedBlock: d } = useAddBlock(), [, u] = useSelectedBlockIds(), [, p] = useHighlightBlockId(), m = get(o, "name", get(o, "label")), x = useFeature("dnd"), [, g] = useAtom$1(draggedBlockAtom), E = (_) => {
6980
- const v = has(_, "styles_attrs.data-page-section");
6981
- return _._type === "Box" && v;
6982
- }, b = useCallback(
6983
- async (_) => {
6984
- if (_.stopPropagation(), has(o, "component")) {
6980
+ const [a, l] = useState(!1), i = useBuilderProp("getUILibraryBlock", noop), { addCoreBlock: c, addPredefinedBlock: d } = useAddBlock(), [, u] = useSelectedBlockIds(), [, p] = useHighlightBlockId(), m = get(o, "name", get(o, "label")), x = useFeature("dnd"), [, g] = useAtom$1(draggedBlockAtom), E = (k) => {
6981
+ const v = has(k, "styles_attrs.data-page-section");
6982
+ return k._type === "Box" && v;
6983
+ }, j = useCallback(
6984
+ async (k) => {
6985
+ if (k.stopPropagation(), has(o, "component")) {
6985
6986
  c(o, r), emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK });
6986
6987
  return;
6987
6988
  }
@@ -6990,18 +6991,18 @@ const BlockCard = ({
6990
6991
  isEmpty(v) || d(syncBlocksWithDefaults(v), r), emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK });
6991
6992
  },
6992
6993
  [o]
6993
- ), f = async (_) => {
6994
+ ), f = async (k) => {
6994
6995
  const v = await i(n, o);
6995
6996
  let S = r;
6996
6997
  if (E(first(v)) && (S = null), !isEmpty(v)) {
6997
6998
  const B = { blocks: v, uiLibrary: !0, parent: S };
6998
- if (_.dataTransfer.setData("text/plain", JSON.stringify(B)), o.preview) {
6999
- const w = new Image();
7000
- w.src = o.preview, w.onload = () => {
7001
- _.dataTransfer.setDragImage(w, 0, 0);
6999
+ if (k.dataTransfer.setData("text/plain", JSON.stringify(B)), o.preview) {
7000
+ const A = new Image();
7001
+ A.src = o.preview, A.onload = () => {
7002
+ k.dataTransfer.setDragImage(A, 0, 0);
7002
7003
  };
7003
7004
  } else
7004
- _.dataTransfer.setDragImage(new Image(), 0, 0);
7005
+ k.dataTransfer.setDragImage(new Image(), 0, 0);
7005
7006
  g(B), setTimeout(() => {
7006
7007
  u([]), p(null), emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK });
7007
7008
  }, 200);
@@ -7012,7 +7013,7 @@ const BlockCard = ({
7012
7013
  "div",
7013
7014
  {
7014
7015
  onClick: a ? () => {
7015
- } : b,
7016
+ } : j,
7016
7017
  draggable: x ? "true" : "false",
7017
7018
  onDragStart: f,
7018
7019
  className: clsx(
@@ -7043,7 +7044,7 @@ const BlockCard = ({
7043
7044
  })();
7044
7045
  }, [o, l, i, c]), { data: l || [], isLoading: i === "loading" };
7045
7046
  }, UILibrarySection = ({ parentId: o }) => {
7046
- const [n, r] = useAtom$1(selectedLibraryAtom), a = useBuilderProp("uiLibraries", []), l = useChaiBlocks(), i = values(l).filter((S) => S.category === "custom"), c = a.find((S) => S.uuid === n) || first(a), { data: d, isLoading: u } = useLibraryBlocks(c), p = groupBy([...d, ...i], "group"), [m, x] = useState("Hero"), g = get(p, m, []), E = useRef(null), { t: b } = useTranslation(), f = (S) => {
7047
+ const [n, r] = useAtom$1(selectedLibraryAtom), a = useBuilderProp("uiLibraries", []), l = useChaiBlocks(), i = values(l).filter((S) => S.category === "custom"), c = a.find((S) => S.uuid === n) || first(a), { data: d, isLoading: u } = useLibraryBlocks(c), p = groupBy([...d, ...i], "group"), [m, x] = useState("Hero"), g = get(p, m, []), E = useRef(null), { t: j } = useTranslation(), f = (S) => {
7047
7048
  E.current && (clearTimeout(E.current), E.current = null), E.current = setTimeout(() => {
7048
7049
  E.current && x(S);
7049
7050
  }, 300);
@@ -7053,12 +7054,12 @@ const BlockCard = ({
7053
7054
  /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "col-span-3 h-full" }),
7054
7055
  /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "col-span-9 h-full" })
7055
7056
  ] });
7056
- const _ = filter(g, (S, B) => B % 2 === 0), v = filter(g, (S, B) => B % 2 === 1);
7057
+ const k = filter(g, (S, B) => B % 2 === 0), v = filter(g, (S, B) => B % 2 === 1);
7057
7058
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative mt-2 flex h-full max-h-full overflow-hidden bg-background", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full pt-2", children: [
7058
7059
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full max-h-full w-60 flex-col gap-1 px-1 pr-2", children: [
7059
7060
  /* @__PURE__ */ jsxRuntimeExports.jsx(UILibrariesSelect, { library: c == null ? void 0 : c.uuid, setLibrary: r, uiLibraries: a }),
7060
7061
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 flex h-full max-h-full w-full flex-1 flex-col", children: [
7061
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-bold text-gray-500", children: b("groups") }),
7062
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-bold text-gray-500", children: j("groups") }),
7062
7063
  /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "mt-1 border-border" }),
7063
7064
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "no-scrollbar mt-2 h-full max-h-full flex-1 overflow-y-auto pb-20", children: React__default.Children.toArray(
7064
7065
  map(p, (S, B) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -7072,7 +7073,7 @@ const BlockCard = ({
7072
7073
  B === m ? "bg-blue-500 text-white hover:bg-blue-600" : ""
7073
7074
  ),
7074
7075
  children: [
7075
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: capitalize(b(B.toLowerCase())) }),
7076
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: capitalize(j(B.toLowerCase())) }),
7076
7077
  /* @__PURE__ */ jsxRuntimeExports.jsx(CaretRightIcon, { className: "ml-2 h-5 w-5" })
7077
7078
  ]
7078
7079
  },
@@ -7089,7 +7090,7 @@ const BlockCard = ({
7089
7090
  children: [
7090
7091
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-2 px-2", children: [
7091
7092
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1", children: React__default.Children.toArray(
7092
- _.map((S) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlockCard, { parentId: o, block: S, library: c }))
7093
+ k.map((S) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlockCard, { parentId: o, block: S, library: c }))
7093
7094
  ) }),
7094
7095
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1", children: React__default.Children.toArray(
7095
7096
  v.map((S) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlockCard, { parentId: o, block: S, library: c }))
@@ -7539,8 +7540,8 @@ i18n.use(initReactI18next).init({
7539
7540
  const CoreBlock = ({ block: o, disabled: n, parentId: r }) => {
7540
7541
  const [, a] = useAtom$1(draggedBlockAtom), { type: l, icon: i, label: c } = o, { addCoreBlock: d, addPredefinedBlock: u } = useAddBlock(), [, p] = useSelectedBlockIds(), [, m] = useHighlightBlockId(), x = () => {
7541
7542
  if (has(o, "blocks")) {
7542
- const b = isFunction$1(o.blocks) ? o.blocks() : o.blocks;
7543
- u(syncBlocksWithDefaults(b), r || null);
7543
+ const j = isFunction$1(o.blocks) ? o.blocks() : o.blocks;
7544
+ u(syncBlocksWithDefaults(j), r || null);
7544
7545
  } else
7545
7546
  d(o, r || null);
7546
7547
  emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK });
@@ -7552,8 +7553,8 @@ const CoreBlock = ({ block: o, disabled: n, parentId: r }) => {
7552
7553
  disabled: n,
7553
7554
  onClick: x,
7554
7555
  type: "button",
7555
- onDragStart: (b) => {
7556
- b.dataTransfer.setData("text/plain", JSON.stringify(omit(o, ["component", "icon"]))), b.dataTransfer.setDragImage(new Image(), 0, 0), a(omit(o, ["component", "icon"])), setTimeout(() => {
7556
+ onDragStart: (j) => {
7557
+ j.dataTransfer.setData("text/plain", JSON.stringify(omit(o, ["component", "icon"]))), j.dataTransfer.setDragImage(new Image(), 0, 0), a(omit(o, ["component", "icon"])), setTimeout(() => {
7557
7558
  p([]), m(null);
7558
7559
  }, 200);
7559
7560
  },
@@ -7728,11 +7729,11 @@ function QuickPrompts({ onClick: o }) {
7728
7729
  const AIUserPrompt = ({ blockId: o }) => {
7729
7730
  const { t: n } = useTranslation(), { askAi: r, loading: a, error: l } = useAskAi(), [i, c] = useState(""), [d, u] = useState(!0), [p, m] = useState(), x = useRef(null), g = useRef(null);
7730
7731
  useEffect(() => {
7731
- var b;
7732
- (b = x.current) == null || b.focus();
7732
+ var j;
7733
+ (j = x.current) == null || j.focus();
7733
7734
  }, []);
7734
- const E = (b) => {
7735
- const { usage: f } = b || {};
7735
+ const E = (j) => {
7736
+ const { usage: f } = j || {};
7736
7737
  !l && f && m(f), g.current = setTimeout(() => m(void 0), 1e4), l || c("");
7737
7738
  };
7738
7739
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "", children: [
@@ -7753,12 +7754,12 @@ const AIUserPrompt = ({ blockId: o }) => {
7753
7754
  {
7754
7755
  ref: x,
7755
7756
  value: i,
7756
- onChange: (b) => c(b.target.value),
7757
+ onChange: (j) => c(j.target.value),
7757
7758
  placeholder: n("Ask AI to edit content"),
7758
7759
  className: "w-full",
7759
7760
  rows: 3,
7760
- onKeyDown: (b) => {
7761
- b.key === "Enter" && (b.preventDefault(), g.current && clearTimeout(g.current), m(void 0), r("content", o, i, E));
7761
+ onKeyDown: (j) => {
7762
+ j.key === "Enter" && (j.preventDefault(), g.current && clearTimeout(g.current), m(void 0), r("content", o, i, E));
7762
7763
  }
7763
7764
  }
7764
7765
  ),
@@ -7800,8 +7801,8 @@ const AIUserPrompt = ({ blockId: o }) => {
7800
7801
  /* @__PURE__ */ jsxRuntimeExports.jsx(
7801
7802
  QuickPrompts,
7802
7803
  {
7803
- onClick: (b) => {
7804
- g.current && clearTimeout(g.current), m(void 0), r("content", o, b, E);
7804
+ onClick: (j) => {
7805
+ g.current && clearTimeout(g.current), m(void 0), r("content", o, j, E);
7805
7806
  }
7806
7807
  }
7807
7808
  )
@@ -7822,8 +7823,8 @@ const AIUserPrompt = ({ blockId: o }) => {
7822
7823
  description: o("You can now Ask AI to edit your content"),
7823
7824
  variant: "default"
7824
7825
  }), g.current.click();
7825
- } catch (b) {
7826
- p(b);
7826
+ } catch (j) {
7827
+ p(j);
7827
7828
  } finally {
7828
7829
  d(!1);
7829
7830
  }
@@ -7831,8 +7832,8 @@ const AIUserPrompt = ({ blockId: o }) => {
7831
7832
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
7832
7833
  Accordion,
7833
7834
  {
7834
- onValueChange: (b) => {
7835
- m(b !== "");
7835
+ onValueChange: (j) => {
7836
+ m(j !== "");
7836
7837
  },
7837
7838
  type: "single",
7838
7839
  collapsible: !0,
@@ -7844,12 +7845,12 @@ const AIUserPrompt = ({ blockId: o }) => {
7844
7845
  {
7845
7846
  ref: l,
7846
7847
  value: r,
7847
- onChange: (b) => a(b.target.value),
7848
+ onChange: (j) => a(j.target.value),
7848
7849
  placeholder: o("Tell about this page eg this page is about"),
7849
7850
  className: "mt-1 w-full",
7850
7851
  rows: 10,
7851
- onKeyDown: (b) => {
7852
- b.key === "Enter" && (b.preventDefault(), E());
7852
+ onKeyDown: (j) => {
7853
+ j.key === "Enter" && (j.preventDefault(), E());
7853
7854
  }
7854
7855
  }
7855
7856
  ),
@@ -7911,7 +7912,7 @@ const AIUserPrompt = ({ blockId: o }) => {
7911
7912
  /* @__PURE__ */ jsxRuntimeExports.jsx(AIUserPrompt, { blockId: first(o) })
7912
7913
  ] });
7913
7914
  }, AttrsEditor = React__default.memo(function o({ preloadedAttributes: n = [], onAttributesChange: r }) {
7914
- const [a, l] = useState([]), [i, c] = useState(""), [d, u] = useState(""), [p, m] = useState(null), [x, g] = useState(""), E = useRef(null), b = useRef(null);
7915
+ const [a, l] = useState([]), [i, c] = useState(""), [d, u] = useState(""), [p, m] = useState(null), [x, g] = useState(""), E = useRef(null), j = useRef(null);
7915
7916
  useEffect(() => {
7916
7917
  l(n);
7917
7918
  }, [n]);
@@ -7921,32 +7922,32 @@ const AIUserPrompt = ({ blockId: o }) => {
7921
7922
  return;
7922
7923
  }
7923
7924
  if (i) {
7924
- const w = [...a, { key: i, value: d }];
7925
- r(w), l(a), c(""), u(""), g("");
7925
+ const A = [...a, { key: i, value: d }];
7926
+ r(A), l(a), c(""), u(""), g("");
7926
7927
  }
7927
- }, _ = (w) => {
7928
- const A = a.filter((N, D) => D !== w);
7929
- r(A), l(A);
7930
- }, v = (w) => {
7931
- m(w), c(a[w].key), u(a[w].value);
7928
+ }, k = (A) => {
7929
+ const w = a.filter((N, D) => D !== A);
7930
+ r(w), l(w);
7931
+ }, v = (A) => {
7932
+ m(A), c(a[A].key), u(a[A].value);
7932
7933
  }, S = () => {
7933
7934
  if (i.startsWith("@")) {
7934
7935
  g("Attribute keys cannot start with '@'");
7935
7936
  return;
7936
7937
  }
7937
7938
  if (p !== null && i) {
7938
- const w = [...a];
7939
- w[p] = { key: i, value: d }, r(w), l(w), m(null), c(""), u(""), g("");
7939
+ const A = [...a];
7940
+ A[p] = { key: i, value: d }, r(A), l(A), m(null), c(""), u(""), g("");
7940
7941
  }
7941
- }, B = (w) => {
7942
- w.key === "Enter" && !w.shiftKey && (w.preventDefault(), p !== null ? S() : f());
7942
+ }, B = (A) => {
7943
+ A.key === "Enter" && !A.shiftKey && (A.preventDefault(), p !== null ? S() : f());
7943
7944
  };
7944
7945
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-full", children: [
7945
7946
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
7946
7947
  "form",
7947
7948
  {
7948
- onSubmit: (w) => {
7949
- w.preventDefault(), p !== null ? S() : f();
7949
+ onSubmit: (A) => {
7950
+ A.preventDefault(), p !== null ? S() : f();
7950
7951
  },
7951
7952
  className: "space-y-3",
7952
7953
  children: [
@@ -7962,7 +7963,7 @@ const AIUserPrompt = ({ blockId: o }) => {
7962
7963
  id: "attrKey",
7963
7964
  ref: E,
7964
7965
  value: i,
7965
- onChange: (w) => c(w.target.value),
7966
+ onChange: (A) => c(A.target.value),
7966
7967
  placeholder: "Key",
7967
7968
  className: "h-8 text-sm"
7968
7969
  }
@@ -7978,9 +7979,9 @@ const AIUserPrompt = ({ blockId: o }) => {
7978
7979
  spellCheck: "false",
7979
7980
  id: "attrValue",
7980
7981
  rows: 2,
7981
- ref: b,
7982
+ ref: j,
7982
7983
  value: d,
7983
- onChange: (w) => u(w.target.value),
7984
+ onChange: (A) => u(A.target.value),
7984
7985
  onKeyDown: B,
7985
7986
  placeholder: "Value",
7986
7987
  className: "bg-background text-sm"
@@ -7993,22 +7994,22 @@ const AIUserPrompt = ({ blockId: o }) => {
7993
7994
  ]
7994
7995
  }
7995
7996
  ),
7996
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4 space-y-1 overflow-y-auto", children: a.map((w, A) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between rounded bg-muted p-1.5 text-sm", children: [
7997
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4 space-y-1 overflow-y-auto", children: a.map((A, w) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between rounded bg-muted p-1.5 text-sm", children: [
7997
7998
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mr-2 flex flex-col", children: [
7998
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate font-semibold", children: w.key }),
7999
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-wrap max-w-[200px] text-muted-foreground", children: w.value.toString() })
7999
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate font-semibold", children: A.key }),
8000
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-wrap max-w-[200px] text-muted-foreground", children: A.value.toString() })
8000
8001
  ] }),
8001
8002
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-shrink-0", children: [
8002
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => v(A), children: [
8003
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => v(w), children: [
8003
8004
  /* @__PURE__ */ jsxRuntimeExports.jsx(Edit2, { className: "h-3 w-3" }),
8004
8005
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sr-only", children: "Edit attribute" })
8005
8006
  ] }),
8006
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => _(A), children: [
8007
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => k(w), children: [
8007
8008
  /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "h-3 w-3" }),
8008
8009
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sr-only", children: "Remove attribute" })
8009
8010
  ] })
8010
8011
  ] })
8011
- ] }, A)) })
8012
+ ] }, w)) })
8012
8013
  ] });
8013
8014
  }), BlockAttributesEditor = React.memo(() => {
8014
8015
  const o = useSelectedBlock(), [n, r] = useState([]), [a] = useSelectedStylingBlocks(), l = useUpdateBlocksProps(), i = `${get(a, "0.prop")}_attrs`;
@@ -8649,11 +8650,11 @@ const PageDataProviders = () => {
8649
8650
  n.map((f) => map(i, "providerKey").includes(f.providerKey) ? null : { value: f.providerKey, label: f.name }),
8650
8651
  (f) => !isNull(f)
8651
8652
  ), g = (f) => {
8652
- const _ = find(n, { providerKey: f });
8653
- c((v) => [...v, _]), a((v) => [...v, { providerKey: _.providerKey, args: {} }]), u(""), l("UNSAVED");
8653
+ const k = find(n, { providerKey: f });
8654
+ c((v) => [...v, k]), a((v) => [...v, { providerKey: k.providerKey, args: {} }]), u(""), l("UNSAVED");
8654
8655
  }, E = (f) => {
8655
- c((_) => filter(_, (v) => v.providerKey !== f.providerKey)), a((_) => filter(_, (v) => v.providerKey !== f.providerKey)), l("UNSAVED");
8656
- }, b = (f) => m(f);
8656
+ c((k) => filter(k, (v) => v.providerKey !== f.providerKey)), a((k) => filter(k, (v) => v.providerKey !== f.providerKey)), l("UNSAVED");
8657
+ }, j = (f) => m(f);
8657
8658
  return isEmpty(n) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
8658
8659
  o("no_data_providers"),
8659
8660
  /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
@@ -8688,7 +8689,7 @@ const PageDataProviders = () => {
8688
8689
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
8689
8690
  "button",
8690
8691
  {
8691
- onClick: () => b(f),
8692
+ onClick: () => j(f),
8692
8693
  className: "inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-blue-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
8693
8694
  children: [
8694
8695
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -8749,7 +8750,7 @@ const PageDataProviders = () => {
8749
8750
  function AiFillDatabase(o) {
8750
8751
  return GenIcon({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M832 64H192c-17.7 0-32 14.3-32 32v224h704V96c0-17.7-14.3-32-32-32zM288 232c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40zM160 928c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V704H160v224zm128-136c22.1 0 40 17.9 40 40s-17.9 40-40 40-40-17.9-40-40 17.9-40 40-40zM160 640h704V384H160v256zm128-168c22.1 0 40 17.9 40 40s-17.9 40-40 40-40-17.9-40-40 17.9-40 40-40z" }, child: [] }] })(o);
8751
8752
  }
8752
- const TopBar = lazy(() => import("./Topbar-yEANMgiO.js"));
8753
+ const TopBar = lazy(() => import("./Topbar-Z4cQD_EP.js"));
8753
8754
  function useSidebarMenuItems(o) {
8754
8755
  const n = o === "SINGLE_SIDE_PANEL", { t: r } = useTranslation(), a = useBuilderProp("dataBindingSupport", !1), l = useBuilderProp("askAiCallBack", null);
8755
8756
  return useMemo(() => {