@builder.io/sdk-react 0.13.0 → 0.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/lib/browser/index.cjs +27 -27
  2. package/lib/browser/index.mjs +1424 -844
  3. package/lib/browser/{server-entry-f1003541.cjs → server-entry-af9b0dd3.cjs} +1 -1
  4. package/lib/browser/{server-entry-a7214151.js → server-entry-be000726.js} +1 -1
  5. package/lib/browser/server-entry.cjs +1 -1
  6. package/lib/browser/server-entry.mjs +1 -1
  7. package/lib/edge/index.cjs +37 -37
  8. package/lib/edge/index.mjs +2375 -1795
  9. package/lib/edge/{server-entry-f1003541.cjs → server-entry-af9b0dd3.cjs} +1 -1
  10. package/lib/edge/{server-entry-12a6f428.js → server-entry-b02b5197.js} +1 -1
  11. package/lib/edge/server-entry.cjs +1 -1
  12. package/lib/edge/server-entry.mjs +1 -1
  13. package/lib/node/index.cjs +15 -15
  14. package/lib/node/index.mjs +1253 -673
  15. package/lib/node/{server-entry-3743f8cd.cjs → server-entry-6e7475d7.cjs} +1 -1
  16. package/lib/node/{server-entry-3f9209d6.js → server-entry-9969d641.js} +1 -1
  17. package/lib/node/server-entry.cjs +1 -1
  18. package/lib/node/server-entry.mjs +1 -1
  19. package/package.json +1 -1
  20. package/types/blocks/form/form/component-info.d.ts +2 -0
  21. package/types/blocks/form/form/form.d.ts +33 -0
  22. package/types/blocks/form/input/component-info.d.ts +2 -0
  23. package/types/blocks/form/select/component-info.d.ts +2 -0
  24. package/types/blocks/form/submit-button/component-info.d.ts +2 -0
  25. package/types/blocks/slot/slot.d.ts +3 -6
  26. package/types/constants/extra-components.d.ts +7 -0
  27. package/types/constants/sdk-version.d.ts +1 -1
  28. package/types/functions/get-env.d.ts +2 -0
  29. package/types/functions/get.d.ts +1 -0
  30. package/types/helpers/preview-lru-cache/helpers.d.ts +1 -0
  31. package/types/helpers/preview-lru-cache/types.d.ts +1 -0
  32. package/types/blocks/form/component-info.d.ts +0 -2
  33. package/types/blocks/form/form.d.ts +0 -3
  34. package/types/blocks/input/component-info.d.ts +0 -2
  35. package/types/blocks/select/component-info.d.ts +0 -2
  36. package/types/blocks/submit-button/component-info.d.ts +0 -2
  37. /package/types/blocks/{input → form/input}/input.d.ts +0 -0
  38. /package/types/blocks/{select → form/select}/select.d.ts +0 -0
  39. /package/types/blocks/{submit-button → form/submit-button}/submit-button.d.ts +0 -0
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
3
3
  import { createContext, useState, useEffect, useContext, useRef, createElement } from "react";
4
- import { T as TARGET, i as isEditing, k as isBrowser, l as getUserAttributes, m as fastClone, n as checkIsDefined, o as logger, p as getDefaultCanTrack, q as _track, a as isPreviewing, u as createEditorListener, v as registerInsertMenu, w as setupBrowserForEditing, c as createRegisterComponentMessage, e as fetchOneEntry, x as fetch$1, y as components, z as serializeComponentInfo, A as handleABTestingSync } from "./server-entry-3f9209d6.js";
5
- import { _ as H, f as K, d as z, h as q, g as Y, j as G, r as J, s as Q, b as X, t as Z } from "./server-entry-3f9209d6.js";
4
+ import { T as TARGET, i as isEditing, k as isBrowser, l as getUserAttributes, m as fastClone, n as checkIsDefined, o as logger, p as getDefaultCanTrack, q as _track, a as isPreviewing, u as createEditorListener, v as registerInsertMenu, w as setupBrowserForEditing, c as createRegisterComponentMessage, e as fetchOneEntry, x as fetch$1, y as components, z as serializeComponentInfo, A as handleABTestingSync } from "./server-entry-9969d641.js";
5
+ import { _ as H, f as K, d as q, h as z, g as J, j as Y, r as G, s as Q, b as X, t as Z } from "./server-entry-9969d641.js";
6
6
  import { createRequire } from "node:module";
7
7
  const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), isEmptyElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.has(e.toLowerCase());
8
8
  function DynamicRenderer(e) {
@@ -71,9 +71,9 @@ const getFunctionArguments = ({
71
71
  builder: e,
72
72
  context: t,
73
73
  event: n,
74
- state: i
74
+ state: o
75
75
  }) => Object.entries({
76
- state: i,
76
+ state: o,
77
77
  Builder: e,
78
78
  // legacy
79
79
  builder: e,
@@ -90,18 +90,18 @@ const getFunctionArguments = ({
90
90
  code: e,
91
91
  builder: t,
92
92
  context: n,
93
- event: i,
94
- localState: o,
93
+ event: o,
94
+ localState: i,
95
95
  rootSetState: a,
96
96
  rootState: r
97
97
  }) => {
98
98
  const s = getFunctionArguments({
99
99
  builder: t,
100
100
  context: n,
101
- event: i,
101
+ event: o,
102
102
  state: flattenState({
103
103
  rootState: r,
104
- localState: o,
104
+ localState: i,
105
105
  rootSetState: a
106
106
  })
107
107
  });
@@ -113,30 +113,30 @@ function flattenState({
113
113
  rootSetState: n
114
114
  }) {
115
115
  return new Proxy(e, {
116
- get: (i, o) => {
117
- if (t && o in t)
118
- return t[o];
119
- const a = i[o];
116
+ get: (o, i) => {
117
+ if (t && i in t)
118
+ return t[i];
119
+ const a = o[i];
120
120
  return typeof a == "object" ? flattenState({
121
121
  rootState: a,
122
122
  localState: void 0,
123
123
  rootSetState: n ? (r) => {
124
- i[o] = r, n(i);
124
+ o[i] = r, n(o);
125
125
  } : void 0
126
126
  }) : a;
127
127
  },
128
- set: (i, o, a) => {
129
- if (t && o in t)
128
+ set: (o, i, a) => {
129
+ if (t && i in t)
130
130
  throw new Error("Writing to local state is not allowed as it is read-only.");
131
- return i[o] = a, n == null || n(i), !0;
131
+ return o[i] = a, n == null || n(o), !0;
132
132
  }
133
133
  });
134
134
  }
135
135
  const set = (e, t, n) => {
136
136
  if (Object(e) !== e)
137
137
  return e;
138
- const i = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
139
- return i.slice(0, -1).reduce((o, a, r) => Object(o[a]) === o[a] ? o[a] : o[a] = Math.abs(Number(i[r + 1])) >> 0 === +i[r + 1] ? [] : {}, e)[i[i.length - 1]] = n, e;
138
+ const o = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
139
+ return o.slice(0, -1).reduce((i, a, r) => Object(i[a]) === i[a] ? i[a] : i[a] = Math.abs(Number(o[r + 1])) >> 0 === +o[r + 1] ? [] : {}, e)[o[o.length - 1]] = n, e;
140
140
  }, noop = () => {
141
141
  };
142
142
  let safeDynamicRequire = noop;
@@ -178,7 +178,7 @@ var refToProxy = (obj) => {
178
178
  code: e,
179
179
  args: t
180
180
  }) => {
181
- const n = t.map(([i]) => `var ${i} = refToProxy(${getSyncValName(i)}); `).join("");
181
+ const n = t.map(([o]) => `var ${o} = refToProxy(${getSyncValName(o)}); `).join("");
182
182
  return `
183
183
  ${REF_TO_PROXY_FN}
184
184
  ${n}
@@ -200,42 +200,42 @@ output;
200
200
  code: e,
201
201
  builder: t,
202
202
  context: n,
203
- event: i,
204
- localState: o,
203
+ event: o,
204
+ localState: i,
205
205
  rootSetState: a,
206
206
  rootState: r
207
207
  }) => {
208
208
  const s = fastClone({
209
209
  ...r,
210
- ...o
210
+ ...i
211
211
  }), l = getFunctionArguments({
212
212
  builder: t,
213
213
  context: n,
214
- event: i,
214
+ event: o,
215
215
  state: s
216
- }), c = getIsolateContext(), d = c.global;
217
- d.setSync("global", d.derefInto()), d.setSync("log", function(...f) {
218
- console.log(...f);
219
- }), d.setSync(BUILDER_SET_STATE_NAME, function(f, g) {
220
- set(r, f, g), a == null || a(r);
221
- }), l.forEach(([f, g]) => {
222
- const y = typeof g == "object" ? new ivm.Reference(
216
+ }), c = getIsolateContext(), u = c.global;
217
+ u.setSync("global", u.derefInto()), u.setSync("log", function(...d) {
218
+ console.log(...d);
219
+ }), u.setSync(BUILDER_SET_STATE_NAME, function(d, m) {
220
+ set(r, d, m), a == null || a(r);
221
+ }), l.forEach(([d, m]) => {
222
+ const b = typeof m == "object" ? new ivm.Reference(
223
223
  // workaround: methods with default values for arguments is not being cloned over
224
- f === "builder" ? {
225
- ...g,
226
- getUserAttributes: () => g.getUserAttributes()
227
- } : g
224
+ d === "builder" ? {
225
+ ...m,
226
+ getUserAttributes: () => m.getUserAttributes()
227
+ } : m
228
228
  ) : null;
229
- d.setSync(getSyncValName(f), y);
230
- }), d.setSync(INJECTED_IVM_GLOBAL, ivm);
231
- const b = processCode({
229
+ u.setSync(getSyncValName(d), b);
230
+ }), u.setSync(INJECTED_IVM_GLOBAL, ivm);
231
+ const y = processCode({
232
232
  code: e,
233
233
  args: l
234
- }), S = c.evalSync(b);
234
+ }), x = c.evalSync(y);
235
235
  try {
236
- return JSON.parse(S);
236
+ return JSON.parse(x);
237
237
  } catch {
238
- return S;
238
+ return x;
239
239
  }
240
240
  };
241
241
  function isNodeRuntime() {
@@ -243,18 +243,18 @@ function isNodeRuntime() {
243
243
  return typeof process != "undefined" && checkIsDefined((e = process == null ? void 0 : process.versions) == null ? void 0 : e.node);
244
244
  }
245
245
  const shouldForceBrowserRuntimeInNode = () => {
246
- var i;
246
+ var o;
247
247
  if (!isNodeRuntime())
248
248
  return !1;
249
- const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (i = process.env.NODE_OPTIONS) == null ? void 0 : i.includes("--no-node-snapshot");
249
+ const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (o = process.env.NODE_OPTIONS) == null ? void 0 : o.includes("--no-node-snapshot");
250
250
  return e && t && !n ? (logger.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "), !0) : !1;
251
251
  }, chooseBrowserOrServerEval = (e) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(e) : runInNode(e);
252
252
  function evaluate({
253
253
  code: e,
254
254
  context: t,
255
255
  localState: n,
256
- rootState: i,
257
- rootSetState: o,
256
+ rootState: o,
257
+ rootSetState: i,
258
258
  event: a,
259
259
  isExpression: r = !0
260
260
  }) {
@@ -269,8 +269,8 @@ function evaluate({
269
269
  builder: getBuilderGlobals(),
270
270
  context: t,
271
271
  event: a,
272
- rootSetState: o,
273
- rootState: i,
272
+ rootSetState: i,
273
+ rootState: o,
274
274
  localState: n
275
275
  };
276
276
  try {
@@ -289,8 +289,8 @@ const evaluateBindings = ({
289
289
  block: e,
290
290
  context: t,
291
291
  localState: n,
292
- rootState: i,
293
- rootSetState: o
292
+ rootState: o,
293
+ rootSetState: i
294
294
  }) => {
295
295
  if (!e.bindings)
296
296
  return e;
@@ -307,8 +307,8 @@ const evaluateBindings = ({
307
307
  const l = e.bindings[s], c = evaluate({
308
308
  code: l,
309
309
  localState: n,
310
- rootState: i,
311
- rootSetState: o,
310
+ rootState: o,
311
+ rootSetState: i,
312
312
  context: t
313
313
  });
314
314
  set(r, s, c);
@@ -319,38 +319,38 @@ function getProcessedBlock({
319
319
  block: e,
320
320
  context: t,
321
321
  shouldEvaluateBindings: n,
322
- localState: i,
323
- rootState: o,
322
+ localState: o,
323
+ rootState: i,
324
324
  rootSetState: a
325
325
  }) {
326
326
  const r = e;
327
327
  return n ? evaluateBindings({
328
328
  block: r,
329
- localState: i,
330
- rootState: o,
329
+ localState: o,
330
+ rootState: i,
331
331
  rootSetState: a,
332
332
  context: t
333
333
  }) : r;
334
334
  }
335
335
  function throttle(e, t, n = {}) {
336
- let i, o, a, r = null, s = 0;
336
+ let o, i, a, r = null, s = 0;
337
337
  const l = function() {
338
- s = n.leading === !1 ? 0 : Date.now(), r = null, a = e.apply(i, o), r || (i = o = null);
338
+ s = n.leading === !1 ? 0 : Date.now(), r = null, a = e.apply(o, i), r || (o = i = null);
339
339
  };
340
340
  return function() {
341
341
  const c = Date.now();
342
342
  !s && n.leading === !1 && (s = c);
343
- const d = t - (c - s);
344
- return i = this, o = arguments, d <= 0 || d > t ? (r && (clearTimeout(r), r = null), s = c, a = e.apply(i, o), r || (i = o = null)) : !r && n.trailing !== !1 && (r = setTimeout(l, d)), a;
343
+ const u = t - (c - s);
344
+ return o = this, i = arguments, u <= 0 || u > t ? (r && (clearTimeout(r), r = null), s = c, a = e.apply(o, i), r || (o = i = null)) : !r && n.trailing !== !1 && (r = setTimeout(l, u)), a;
345
345
  };
346
346
  }
347
347
  function assign(e, ...t) {
348
348
  const n = Object(e);
349
- for (let i = 1; i < arguments.length; i++) {
350
- const o = arguments[i];
351
- if (o != null)
352
- for (const a in o)
353
- Object.prototype.hasOwnProperty.call(o, a) && (n[a] = o[a]);
349
+ for (let o = 1; o < arguments.length; o++) {
350
+ const i = arguments[o];
351
+ if (i != null)
352
+ for (const a in i)
353
+ Object.prototype.hasOwnProperty.call(i, a) && (n[a] = i[a]);
354
354
  }
355
355
  return n;
356
356
  }
@@ -373,16 +373,16 @@ function warnElementNotPresent(e) {
373
373
  console.warn(`Cannot animate element: element with ID ${e} not found!`);
374
374
  }
375
375
  function augmentAnimation(e, t) {
376
- const n = getAllStylesUsed(e), i = getComputedStyle(t), o = e.steps[0].styles, a = e.steps[e.steps.length - 1].styles, r = [o, a];
376
+ const n = getAllStylesUsed(e), o = getComputedStyle(t), i = e.steps[0].styles, a = e.steps[e.steps.length - 1].styles, r = [i, a];
377
377
  for (const s of r)
378
378
  for (const l of n)
379
- l in s || (s[l] = i[l]);
379
+ l in s || (s[l] = o[l]);
380
380
  }
381
381
  function getAllStylesUsed(e) {
382
382
  const t = [];
383
383
  for (const n of e.steps)
384
- for (const i in n.styles)
385
- t.indexOf(i) === -1 && t.push(i);
384
+ for (const o in n.styles)
385
+ t.indexOf(o) === -1 && t.push(o);
386
386
  return t;
387
387
  }
388
388
  function triggerAnimation(e) {
@@ -407,12 +407,12 @@ function bindHoverAnimation(e) {
407
407
  }
408
408
  Array.from(t).forEach((n) => {
409
409
  augmentAnimation(e, n);
410
- const i = e.steps[0].styles, o = e.steps[1].styles;
410
+ const o = e.steps[0].styles, i = e.steps[1].styles;
411
411
  function a() {
412
- assign(n.style, i);
412
+ assign(n.style, o);
413
413
  }
414
414
  function r() {
415
- assign(n.style, o);
415
+ assign(n.style, i);
416
416
  }
417
417
  a(), n.addEventListener("mouseenter", r), n.addEventListener("mouseleave", a), setTimeout(() => {
418
418
  n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s");
@@ -427,20 +427,20 @@ function bindScrollInViewAnimation(e) {
427
427
  }
428
428
  Array.from(t).forEach((n) => {
429
429
  augmentAnimation(e, n);
430
- let i = !1, o = !1;
430
+ let o = !1, i = !1;
431
431
  function a() {
432
- !i && s(n) ? (i = !0, o = !0, setTimeout(() => {
432
+ !o && s(n) ? (o = !0, i = !0, setTimeout(() => {
433
433
  assign(n.style, e.steps[1].styles), e.repeat || document.removeEventListener("scroll", r), setTimeout(() => {
434
- o = !1, e.repeat || (n.style.transition = "", n.style.transitionDelay = "");
434
+ i = !1, e.repeat || (n.style.transition = "", n.style.transitionDelay = "");
435
435
  }, (e.duration + (e.delay || 0)) * 1e3 + 100);
436
- })) : e.repeat && i && !o && !s(n) && (i = !1, assign(n.style, e.steps[0].styles));
436
+ })) : e.repeat && o && !i && !s(n) && (o = !1, assign(n.style, e.steps[0].styles));
437
437
  }
438
438
  const r = throttle(a, 200, {
439
439
  leading: !1
440
440
  });
441
- function s(d) {
442
- const b = d.getBoundingClientRect(), S = window.innerHeight, g = (e.thresholdPercent || 0) / 100 * S;
443
- return b.bottom > g && b.top < S - g;
441
+ function s(u) {
442
+ const y = u.getBoundingClientRect(), x = window.innerHeight, m = (e.thresholdPercent || 0) / 100 * x;
443
+ return y.bottom > m && y.top < x - m;
444
444
  }
445
445
  const l = e.steps[0].styles;
446
446
  function c() {
@@ -460,7 +460,7 @@ const getComponent = ({
460
460
  registeredComponents: n
461
461
  }) => {
462
462
  var a;
463
- const i = (a = getProcessedBlock({
463
+ const o = (a = getProcessedBlock({
464
464
  block: e,
465
465
  localState: t.localState,
466
466
  rootState: t.rootState,
@@ -468,13 +468,13 @@ const getComponent = ({
468
468
  context: t.context,
469
469
  shouldEvaluateBindings: !1
470
470
  }).component) == null ? void 0 : a.name;
471
- if (!i)
471
+ if (!o)
472
472
  return null;
473
- const o = n[i];
474
- if (o)
475
- return o;
473
+ const i = n[o];
474
+ if (i)
475
+ return i;
476
476
  console.warn(`
477
- Could not find a registered component named "${i}".
477
+ Could not find a registered component named "${o}".
478
478
  If you registered it, is the file that registered it imported by the file that needs to render it?`);
479
479
  }, getRepeatItemData = ({
480
480
  block: e,
@@ -482,21 +482,21 @@ const getComponent = ({
482
482
  }) => {
483
483
  const {
484
484
  repeat: n,
485
- ...i
485
+ ...o
486
486
  } = e;
487
487
  if (!(n != null && n.collection))
488
488
  return;
489
- const o = evaluate({
489
+ const i = evaluate({
490
490
  code: n.collection,
491
491
  localState: t.localState,
492
492
  rootState: t.rootState,
493
493
  rootSetState: t.rootSetState,
494
494
  context: t.context
495
495
  });
496
- if (!Array.isArray(o))
496
+ if (!Array.isArray(i))
497
497
  return;
498
498
  const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
499
- return o.map((l, c) => ({
499
+ return i.map((l, c) => ({
500
500
  context: {
501
501
  ...t,
502
502
  localState: {
@@ -507,7 +507,7 @@ const getComponent = ({
507
507
  [`$${r}Index`]: c
508
508
  }
509
509
  },
510
- block: i
510
+ block: o
511
511
  }));
512
512
  }, SIZES = {
513
513
  small: {
@@ -532,17 +532,17 @@ const getComponent = ({
532
532
  const n = fastClone(SIZES);
533
533
  if (!e || !t)
534
534
  return n;
535
- const i = Math.floor(e / 2);
535
+ const o = Math.floor(e / 2);
536
536
  n.small = {
537
537
  max: e,
538
- min: i,
539
- default: i + 1
538
+ min: o,
539
+ default: o + 1
540
540
  };
541
- const o = n.small.max + 1;
541
+ const i = n.small.max + 1;
542
542
  n.medium = {
543
543
  max: t,
544
- min: o,
545
- default: o + 1
544
+ min: i,
545
+ default: i + 1
546
546
  };
547
547
  const a = n.medium.max + 1;
548
548
  return n.large = {
@@ -551,28 +551,28 @@ const getComponent = ({
551
551
  min: a,
552
552
  default: a + 1
553
553
  }, n;
554
- }, camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, i]) => {
555
- if (typeof i == "string")
556
- return `${camelToKebabCase(n)}: ${i};`;
554
+ }, camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, o]) => {
555
+ if (typeof o == "string")
556
+ return `${camelToKebabCase(n)}: ${o};`;
557
557
  }).filter(checkIsDefined), convertStyleMapToCSS = (e) => convertStyleMapToCSSArray(e).join(`
558
558
  `), createCssClass = ({
559
559
  mediaQuery: e,
560
560
  className: t,
561
561
  styles: n
562
562
  }) => {
563
- const i = `.${t} {
563
+ const o = `.${t} {
564
564
  ${convertStyleMapToCSS(n)}
565
565
  }`;
566
566
  return e ? `${e} {
567
- ${i}
568
- }` : i;
567
+ ${o}
568
+ }` : o;
569
569
  };
570
570
  function InlinedStyles(e) {
571
571
  return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: e.styles }, id: e.id });
572
572
  }
573
573
  function BlockStyles(e) {
574
574
  function t() {
575
- const i = getProcessedBlock({
575
+ const o = getProcessedBlock({
576
576
  block: e.block,
577
577
  localState: e.context.localState,
578
578
  rootState: e.context.rootState,
@@ -580,41 +580,41 @@ function BlockStyles(e) {
580
580
  context: e.context.context,
581
581
  shouldEvaluateBindings: !0
582
582
  });
583
- return checkIsDefined(i.hide) ? !i.hide : checkIsDefined(i.show) ? i.show : !0;
583
+ return checkIsDefined(o.hide) ? !o.hide : checkIsDefined(o.show) ? o.show : !0;
584
584
  }
585
585
  function n() {
586
- var g;
587
- const i = getProcessedBlock({
586
+ var m;
587
+ const o = getProcessedBlock({
588
588
  block: e.block,
589
589
  localState: e.context.localState,
590
590
  rootState: e.context.rootState,
591
591
  rootSetState: e.context.rootSetState,
592
592
  context: e.context.context,
593
593
  shouldEvaluateBindings: !0
594
- }), o = i.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
595
- ((g = a == null ? void 0 : a.meta) == null ? void 0 : g.breakpoints) || {}
596
- ), s = o == null ? void 0 : o.large, l = o == null ? void 0 : o.medium, c = o == null ? void 0 : o.small, d = i.id;
597
- if (!d)
594
+ }), i = o.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
595
+ ((m = a == null ? void 0 : a.meta) == null ? void 0 : m.breakpoints) || {}
596
+ ), s = i == null ? void 0 : i.large, l = i == null ? void 0 : i.medium, c = i == null ? void 0 : i.small, u = o.id;
597
+ if (!u)
598
598
  return "";
599
- const b = s ? createCssClass({
600
- className: d,
599
+ const y = s ? createCssClass({
600
+ className: u,
601
601
  styles: s
602
- }) : "", S = l ? createCssClass({
603
- className: d,
602
+ }) : "", x = l ? createCssClass({
603
+ className: u,
604
604
  styles: l,
605
605
  mediaQuery: getMaxWidthQueryForSize(
606
606
  "medium",
607
607
  r
608
608
  )
609
- }) : "", f = c ? createCssClass({
610
- className: d,
609
+ }) : "", d = c ? createCssClass({
610
+ className: u,
611
611
  styles: c,
612
612
  mediaQuery: getMaxWidthQueryForSize(
613
613
  "small",
614
614
  r
615
615
  )
616
616
  }) : "";
617
- return [b, S, f].join(" ");
617
+ return [y, x, d].join(" ");
618
618
  }
619
619
  return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
620
620
  }
@@ -631,13 +631,13 @@ const getEventHandlerName = (e) => `on${capitalizeFirstLetter(e)}`, createEventH
631
631
  isExpression: !1
632
632
  });
633
633
  function getBlockActions(e) {
634
- var i;
635
- const t = {}, n = (i = e.block.actions) != null ? i : {};
636
- for (const o in n) {
637
- if (!n.hasOwnProperty(o))
634
+ var o;
635
+ const t = {}, n = (o = e.block.actions) != null ? o : {};
636
+ for (const i in n) {
637
+ if (!n.hasOwnProperty(i))
638
638
  continue;
639
- const a = n[o];
640
- let r = getEventHandlerName(o);
639
+ const a = n[i];
640
+ let r = getEventHandlerName(i);
641
641
  if (e.stripPrefix)
642
642
  switch (TARGET) {
643
643
  case "vue":
@@ -689,7 +689,7 @@ function getBlockProperties({
689
689
  block: e,
690
690
  context: t
691
691
  }) {
692
- var i;
692
+ var o;
693
693
  const n = {
694
694
  ...extractRelevantRootBlockProperties(e),
695
695
  ...e.properties,
@@ -698,7 +698,7 @@ function getBlockProperties({
698
698
  block: e,
699
699
  context: t
700
700
  }),
701
- [getClassPropName()]: [e.id, "builder-block", e.class, (i = e.properties) == null ? void 0 : i.class].filter(Boolean).join(" ")
701
+ [getClassPropName()]: [e.id, "builder-block", e.class, (o = e.properties) == null ? void 0 : o.class].filter(Boolean).join(" ")
702
702
  };
703
703
  return transformBlockProperties({
704
704
  properties: n,
@@ -753,8 +753,8 @@ const getWrapperProps = ({
753
753
  componentOptions: e,
754
754
  builderBlock: t,
755
755
  context: n,
756
- componentRef: i,
757
- includeBlockProps: o,
756
+ componentRef: o,
757
+ includeBlockProps: i,
758
758
  isInteractive: a,
759
759
  contextValue: r
760
760
  }) => {
@@ -764,7 +764,7 @@ const getWrapperProps = ({
764
764
  * If `noWrap` is set to `true`, then the block's props/attributes are provided to the
765
765
  * component itself directly. Otherwise, they are provided to the wrapper element.
766
766
  */
767
- ...o ? {
767
+ ...i ? {
768
768
  attributes: getBlockProperties({
769
769
  block: t,
770
770
  context: r
@@ -772,15 +772,15 @@ const getWrapperProps = ({
772
772
  } : {}
773
773
  };
774
774
  return a ? {
775
- Wrapper: i,
775
+ Wrapper: o,
776
776
  block: t,
777
777
  context: n,
778
778
  wrapperProps: e,
779
- includeBlockProps: o
779
+ includeBlockProps: i
780
780
  } : s;
781
781
  };
782
782
  function ComponentRef(e) {
783
- var i;
783
+ var o;
784
784
  const [t, n] = useState(
785
785
  () => e.isInteractive ? InteractiveElement : e.componentRef
786
786
  );
@@ -797,15 +797,15 @@ function ComponentRef(e) {
797
797
  isInteractive: e.isInteractive,
798
798
  contextValue: e.context
799
799
  }),
800
- children: (i = e.blockChildren) == null ? void 0 : i.map((o) => /* @__PURE__ */ jsx(
800
+ children: (o = e.blockChildren) == null ? void 0 : o.map((i) => /* @__PURE__ */ jsx(
801
801
  Block,
802
802
  {
803
- block: o,
803
+ block: i,
804
804
  context: e.context,
805
805
  registeredComponents: e.registeredComponents,
806
806
  linkComponent: e.linkComponent
807
807
  },
808
- o.id
808
+ i.id
809
809
  ))
810
810
  }
811
811
  ) }) : null });
@@ -823,7 +823,7 @@ function RepeatedBlock(e) {
823
823
  ) });
824
824
  }
825
825
  function Block(e) {
826
- var d, b, S;
826
+ var u, y, x;
827
827
  function t() {
828
828
  return getComponent({
829
829
  block: e.block,
@@ -837,9 +837,9 @@ function Block(e) {
837
837
  context: e.context
838
838
  });
839
839
  }
840
- function i() {
841
- var f;
842
- return (f = e.block.repeat) != null && f.collection ? e.block : getProcessedBlock({
840
+ function o() {
841
+ var d;
842
+ return (d = e.block.repeat) != null && d.collection ? e.block : getProcessedBlock({
843
843
  block: e.block,
844
844
  localState: e.context.localState,
845
845
  rootState: e.context.rootState,
@@ -848,56 +848,56 @@ function Block(e) {
848
848
  shouldEvaluateBindings: !0
849
849
  });
850
850
  }
851
- function o() {
852
- var g;
853
- return e.block.tagName === "a" || ((g = i().properties) == null ? void 0 : g.href) || i().href ? e.linkComponent || "a" : e.block.tagName || "div";
851
+ function i() {
852
+ var m;
853
+ return e.block.tagName === "a" || ((m = o().properties) == null ? void 0 : m.href) || o().href ? e.linkComponent || "a" : e.block.tagName || "div";
854
854
  }
855
855
  function a() {
856
- var y, k;
857
- if ((y = e.block.repeat) != null && y.collection)
858
- return !!((k = n == null ? void 0 : n()) != null && k.length);
859
- const f = "hide" in i() ? i().hide : !1;
860
- return ("show" in i() ? i().show : !0) && !f;
856
+ var b, I;
857
+ if ((b = e.block.repeat) != null && b.collection)
858
+ return !!((I = n == null ? void 0 : n()) != null && I.length);
859
+ const d = "hide" in o() ? o().hide : !1;
860
+ return ("show" in o() ? o().show : !0) && !d;
861
861
  }
862
862
  function r() {
863
- var g, y;
864
- return !((g = t == null ? void 0 : t()) != null && g.component) && !n() ? (y = i().children) != null ? y : [] : [];
863
+ var m, b;
864
+ return !((m = t == null ? void 0 : t()) != null && m.component) && !n() ? (b = o().children) != null ? b : [] : [];
865
865
  }
866
866
  function s() {
867
- var f, g, y, k, E, p, v, I, w;
867
+ var d, m, b, I, R, S, k, w, E, B, A;
868
868
  return {
869
- blockChildren: (f = i().children) != null ? f : [],
870
- componentRef: (g = t == null ? void 0 : t()) == null ? void 0 : g.component,
869
+ blockChildren: (d = o().children) != null ? d : [],
870
+ componentRef: (m = t == null ? void 0 : t()) == null ? void 0 : m.component,
871
871
  componentOptions: {
872
- ...getBlockComponentOptions(i()),
872
+ ...getBlockComponentOptions(o()),
873
873
  builderContext: e.context,
874
- ...((y = t == null ? void 0 : t()) == null ? void 0 : y.name) === "Core:Button" || ((k = t == null ? void 0 : t()) == null ? void 0 : k.name) === "Symbol" || ((E = t == null ? void 0 : t()) == null ? void 0 : E.name) === "Columns" ? {
874
+ ...((b = t == null ? void 0 : t()) == null ? void 0 : b.name) === "Core:Button" || ((I = t == null ? void 0 : t()) == null ? void 0 : I.name) === "Symbol" || ((R = t == null ? void 0 : t()) == null ? void 0 : R.name) === "Columns" || ((S = t == null ? void 0 : t()) == null ? void 0 : S.name) === "Form:Form" ? {
875
875
  builderLinkComponent: e.linkComponent
876
876
  } : {},
877
- ...((p = t == null ? void 0 : t()) == null ? void 0 : p.name) === "Symbol" || ((v = t == null ? void 0 : t()) == null ? void 0 : v.name) === "Columns" ? {
877
+ ...((k = t == null ? void 0 : t()) == null ? void 0 : k.name) === "Symbol" || ((w = t == null ? void 0 : t()) == null ? void 0 : w.name) === "Columns" || ((E = t == null ? void 0 : t()) == null ? void 0 : E.name) === "Form:Form" ? {
878
878
  builderComponents: e.registeredComponents
879
879
  } : {}
880
880
  },
881
881
  context: l,
882
882
  linkComponent: e.linkComponent,
883
883
  registeredComponents: e.registeredComponents,
884
- builderBlock: i(),
885
- includeBlockProps: ((I = t == null ? void 0 : t()) == null ? void 0 : I.noWrap) === !0,
886
- isInteractive: !((w = t == null ? void 0 : t()) != null && w.isRSC)
884
+ builderBlock: o(),
885
+ includeBlockProps: ((B = t == null ? void 0 : t()) == null ? void 0 : B.noWrap) === !0,
886
+ isInteractive: !((A = t == null ? void 0 : t()) != null && A.isRSC)
887
887
  };
888
888
  }
889
889
  const [l, c] = useState(() => e.context);
890
890
  return useEffect(() => {
891
- const f = i().id, g = i().animations;
892
- g && f && bindAnimations(
893
- g.filter((y) => y.trigger !== "hover").map((y) => ({
894
- ...y,
895
- elementId: f
891
+ const d = o().id, m = o().animations;
892
+ m && d && bindAnimations(
893
+ m.filter((b) => b.trigger !== "hover").map((b) => ({
894
+ ...b,
895
+ elementId: d
896
896
  }))
897
897
  );
898
898
  }, []), /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsxs(Fragment, { children: [
899
899
  /* @__PURE__ */ jsx(BlockStyles, { block: e.block, context: e.context }),
900
- (d = t == null ? void 0 : t()) != null && d.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
900
+ (u = t == null ? void 0 : t()) != null && u.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
901
901
  ComponentRef,
902
902
  {
903
903
  componentRef: s().componentRef,
@@ -910,20 +910,20 @@ function Block(e) {
910
910
  includeBlockProps: s().includeBlockProps,
911
911
  isInteractive: s().isInteractive
912
912
  }
913
- ) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (S = n()) == null ? void 0 : S.map((f, g) => /* @__PURE__ */ jsx(
913
+ ) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (x = n()) == null ? void 0 : x.map((d, m) => /* @__PURE__ */ jsx(
914
914
  RepeatedBlock,
915
915
  {
916
- repeatContext: f.context,
917
- block: f.block,
916
+ repeatContext: d.context,
917
+ block: d.block,
918
918
  registeredComponents: e.registeredComponents,
919
919
  linkComponent: e.linkComponent
920
920
  },
921
- g
921
+ m
922
922
  )) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
923
923
  BlockWrapper,
924
924
  {
925
- Wrapper: o(),
926
- block: i(),
925
+ Wrapper: i(),
926
+ block: o(),
927
927
  context: e.context,
928
928
  linkComponent: e.linkComponent,
929
929
  children: [
@@ -941,15 +941,15 @@ function Block(e) {
941
941
  isInteractive: s().isInteractive
942
942
  }
943
943
  ),
944
- (b = r()) == null ? void 0 : b.map((f) => /* @__PURE__ */ jsx(
944
+ (y = r()) == null ? void 0 : y.map((d) => /* @__PURE__ */ jsx(
945
945
  Block,
946
946
  {
947
- block: f,
947
+ block: d,
948
948
  context: l,
949
949
  registeredComponents: e.registeredComponents,
950
950
  linkComponent: e.linkComponent
951
951
  },
952
- f.id
952
+ d.id
953
953
  ))
954
954
  ]
955
955
  }
@@ -958,12 +958,12 @@ function Block(e) {
958
958
  }
959
959
  function BlocksWrapper(e) {
960
960
  function t() {
961
- var o;
962
- return "builder-blocks" + ((o = e.blocks) != null && o.length ? "" : " no-blocks");
961
+ var i;
962
+ return "builder-blocks" + ((i = e.blocks) != null && i.length ? "" : " no-blocks");
963
963
  }
964
964
  function n() {
965
- var o, a;
966
- isEditing() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
965
+ var i, a;
966
+ isEditing() && !((i = e.blocks) != null && i.length) && ((a = window.parent) == null || a.postMessage(
967
967
  {
968
968
  type: "builder.clickEmptyBlocks",
969
969
  data: {
@@ -974,9 +974,9 @@ function BlocksWrapper(e) {
974
974
  "*"
975
975
  ));
976
976
  }
977
- function i() {
978
- var o, a;
979
- isEditing() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
977
+ function o() {
978
+ var i, a;
979
+ isEditing() && !((i = e.blocks) != null && i.length) && ((a = window.parent) == null || a.postMessage(
980
980
  {
981
981
  type: "builder.hoverEmptyBlocks",
982
982
  data: {
@@ -995,9 +995,9 @@ function BlocksWrapper(e) {
995
995
  "builder-path": e.path,
996
996
  "builder-parent-id": e.parent,
997
997
  style: e.styleProp,
998
- onClick: (o) => n(),
999
- onMouseEnter: (o) => i(),
1000
- onKeyPress: (o) => n(),
998
+ onClick: (i) => n(),
999
+ onMouseEnter: (i) => o(),
1000
+ onKeyPress: (i) => n(),
1001
1001
  ...e.BlocksWrapperProps,
1002
1002
  children: e.children
1003
1003
  }
@@ -1010,7 +1010,7 @@ function BlocksWrapper(e) {
1010
1010
  ] });
1011
1011
  }
1012
1012
  function Blocks(e) {
1013
- var i, o, a;
1013
+ var o, i, a;
1014
1014
  const t = useContext(builderContext), n = useContext(ComponentsContext);
1015
1015
  return /* @__PURE__ */ jsx(
1016
1016
  BlocksWrapper,
@@ -1019,8 +1019,8 @@ function Blocks(e) {
1019
1019
  parent: e.parent,
1020
1020
  path: e.path,
1021
1021
  styleProp: e.styleProp,
1022
- BlocksWrapper: (i = e.context) == null ? void 0 : i.BlocksWrapper,
1023
- BlocksWrapperProps: (o = e.context) == null ? void 0 : o.BlocksWrapperProps,
1022
+ BlocksWrapper: (o = e.context) == null ? void 0 : o.BlocksWrapper,
1023
+ BlocksWrapperProps: (i = e.context) == null ? void 0 : i.BlocksWrapperProps,
1024
1024
  children: e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (a = e.blocks) == null ? void 0 : a.map((r) => /* @__PURE__ */ jsx(
1025
1025
  Block,
1026
1026
  {
@@ -1035,81 +1035,81 @@ function Blocks(e) {
1035
1035
  );
1036
1036
  }
1037
1037
  function Columns(e) {
1038
- var E;
1038
+ var R;
1039
1039
  const [t, n] = useState(
1040
1040
  () => typeof e.space == "number" ? e.space || 0 : 20
1041
- ), [i, o] = useState(() => e.columns || []), [a, r] = useState(
1041
+ ), [o, i] = useState(() => e.columns || []), [a, r] = useState(
1042
1042
  () => e.stackColumnsAt || "tablet"
1043
1043
  );
1044
- function s(p) {
1045
- var v;
1046
- return ((v = i[p]) == null ? void 0 : v.width) || 100 / i.length;
1044
+ function s(S) {
1045
+ var k;
1046
+ return ((k = o[S]) == null ? void 0 : k.width) || 100 / o.length;
1047
1047
  }
1048
- function l(p) {
1049
- const v = t * (i.length - 1) / i.length;
1050
- return `calc(${s(p)}% - ${v}px)`;
1048
+ function l(S) {
1049
+ const k = t * (o.length - 1) / o.length;
1050
+ return `calc(${s(S)}% - ${k}px)`;
1051
1051
  }
1052
1052
  function c({
1053
- stackedStyle: p,
1054
- desktopStyle: v
1053
+ stackedStyle: S,
1054
+ desktopStyle: k
1055
1055
  }) {
1056
- return a === "tablet" ? p : v;
1056
+ return a === "tablet" ? S : k;
1057
1057
  }
1058
- function d({
1059
- stackedStyle: p,
1060
- desktopStyle: v
1058
+ function u({
1059
+ stackedStyle: S,
1060
+ desktopStyle: k
1061
1061
  }) {
1062
- return a === "never" ? v : p;
1062
+ return a === "never" ? k : S;
1063
1063
  }
1064
- const [b, S] = useState(
1064
+ const [y, x] = useState(
1065
1065
  () => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
1066
1066
  );
1067
- function f() {
1067
+ function d() {
1068
1068
  return {
1069
- "--flex-dir": b,
1069
+ "--flex-dir": y,
1070
1070
  "--flex-dir-tablet": c({
1071
- stackedStyle: b,
1071
+ stackedStyle: y,
1072
1072
  desktopStyle: "row"
1073
1073
  })
1074
1074
  };
1075
1075
  }
1076
- function g(p) {
1077
- const v = p === 0 ? 0 : t, I = l(p), w = `${v}px`, R = "100%", j = 0;
1076
+ function m(S) {
1077
+ const k = S === 0 ? 0 : t, w = l(S), E = `${k}px`, B = "100%", A = 0;
1078
1078
  return {
1079
1079
  ...{
1080
1080
  display: "flex",
1081
1081
  flexDirection: "column",
1082
1082
  alignItems: "stretch"
1083
1083
  },
1084
- width: I,
1085
- ["marginLeft"]: w,
1086
- "--column-width-mobile": d({
1087
- stackedStyle: R,
1088
- desktopStyle: I
1089
- }),
1090
- "--column-margin-left-mobile": d({
1091
- stackedStyle: j,
1084
+ width: w,
1085
+ ["marginLeft"]: E,
1086
+ "--column-width-mobile": u({
1087
+ stackedStyle: B,
1092
1088
  desktopStyle: w
1093
1089
  }),
1090
+ "--column-margin-left-mobile": u({
1091
+ stackedStyle: A,
1092
+ desktopStyle: E
1093
+ }),
1094
1094
  "--column-width-tablet": c({
1095
- stackedStyle: R,
1096
- desktopStyle: I
1095
+ stackedStyle: B,
1096
+ desktopStyle: w
1097
1097
  }),
1098
1098
  "--column-margin-left-tablet": c({
1099
- stackedStyle: j,
1100
- desktopStyle: w
1099
+ stackedStyle: A,
1100
+ desktopStyle: E
1101
1101
  })
1102
1102
  };
1103
1103
  }
1104
- function y(p) {
1105
- var I, w;
1104
+ function b(S) {
1105
+ var w, E;
1106
1106
  return getSizesForBreakpoints(
1107
- ((w = (I = e.builderContext.content) == null ? void 0 : I.meta) == null ? void 0 : w.breakpoints) || {}
1108
- )[p].max;
1107
+ ((E = (w = e.builderContext.content) == null ? void 0 : w.meta) == null ? void 0 : E.breakpoints) || {}
1108
+ )[S].max;
1109
1109
  }
1110
- function k() {
1110
+ function I() {
1111
1111
  return `
1112
- @media (max-width: ${y("medium")}px) {
1112
+ @media (max-width: ${b("medium")}px) {
1113
1113
  .${e.builderBlock.id}-breakpoints {
1114
1114
  flex-direction: var(--flex-dir-tablet);
1115
1115
  align-items: stretch;
@@ -1121,7 +1121,7 @@ function Columns(e) {
1121
1121
  }
1122
1122
  }
1123
1123
 
1124
- @media (max-width: ${y("small")}px) {
1124
+ @media (max-width: ${b("small")}px) {
1125
1125
  .${e.builderBlock.id}-breakpoints {
1126
1126
  flex-direction: var(--flex-dir);
1127
1127
  align-items: stretch;
@@ -1138,26 +1138,26 @@ function Columns(e) {
1138
1138
  /* @__PURE__ */ jsxs(
1139
1139
  "div",
1140
1140
  {
1141
- className: `builder-columns ${e.builderBlock.id}-breakpoints div-6f826264`,
1142
- style: f(),
1141
+ className: `builder-columns ${e.builderBlock.id}-breakpoints div-002fb3ba`,
1142
+ style: d(),
1143
1143
  children: [
1144
- /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: k() }) }),
1145
- (E = e.columns) == null ? void 0 : E.map((p, v) => /* @__PURE__ */ jsx(
1144
+ /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: I() }) }),
1145
+ (R = e.columns) == null ? void 0 : R.map((S, k) => /* @__PURE__ */ jsx(
1146
1146
  DynamicRenderer,
1147
1147
  {
1148
- TagName: p.link ? e.builderLinkComponent || "a" : "div",
1148
+ TagName: S.link ? e.builderLinkComponent || "a" : "div",
1149
1149
  actionAttributes: {},
1150
1150
  attributes: {
1151
- ...p.link ? {
1152
- href: p.link
1151
+ ...S.link ? {
1152
+ href: S.link
1153
1153
  } : {},
1154
1154
  [getClassPropName()]: "builder-column",
1155
- style: mapStyleObjToStrIfNeeded(g(v))
1155
+ style: mapStyleObjToStrIfNeeded(m(k))
1156
1156
  },
1157
1157
  children: /* @__PURE__ */ jsx(
1158
1158
  Blocks,
1159
1159
  {
1160
- path: `component.options.columns.${v}.blocks`,
1160
+ path: `component.options.columns.${k}.blocks`,
1161
1161
  parent: e.builderBlock.id,
1162
1162
  styleProp: {
1163
1163
  flexGrow: "1"
@@ -1165,16 +1165,16 @@ function Columns(e) {
1165
1165
  context: e.builderContext,
1166
1166
  registeredComponents: e.builderComponents,
1167
1167
  linkComponent: e.builderLinkComponent,
1168
- blocks: p.blocks
1168
+ blocks: S.blocks
1169
1169
  }
1170
1170
  )
1171
1171
  },
1172
- v
1172
+ k
1173
1173
  ))
1174
1174
  ]
1175
1175
  }
1176
1176
  ),
1177
- /* @__PURE__ */ jsx("style", { children: `.div-6f826264 {
1177
+ /* @__PURE__ */ jsx("style", { children: `.div-002fb3ba {
1178
1178
  display: flex;
1179
1179
  line-height: normal;
1180
1180
  }` })
@@ -1187,8 +1187,8 @@ function removeProtocol(e) {
1187
1187
  return e.replace(/http(s)?:/, "");
1188
1188
  }
1189
1189
  function updateQueryParam(e = "", t, n) {
1190
- const i = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), o = e.indexOf("?") !== -1 ? "&" : "?";
1191
- return e.match(i) ? e.replace(i, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + o + t + "=" + encodeURIComponent(n);
1190
+ const o = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), i = e.indexOf("?") !== -1 ? "&" : "?";
1191
+ return e.match(o) ? e.replace(o, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + i + t + "=" + encodeURIComponent(n);
1192
1192
  }
1193
1193
  function getShopifyImageUrl(e, t) {
1194
1194
  if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
@@ -1197,8 +1197,8 @@ function getShopifyImageUrl(e, t) {
1197
1197
  return removeProtocol(e);
1198
1198
  const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
1199
1199
  if (n) {
1200
- const i = e.split(n[0]), o = n[3], a = t.match("x") ? t : `${t}x`;
1201
- return removeProtocol(`${i[0]}_${a}${o}`);
1200
+ const o = e.split(n[0]), i = n[3], a = t.match("x") ? t : `${t}x`;
1201
+ return removeProtocol(`${o[0]}_${a}${i}`);
1202
1202
  }
1203
1203
  return null;
1204
1204
  }
@@ -1208,21 +1208,21 @@ function getSrcSet(e) {
1208
1208
  const t = [100, 200, 400, 800, 1200, 1600, 2e3];
1209
1209
  if (e.match(/builder\.io/)) {
1210
1210
  let n = e;
1211
- const i = Number(e.split("?width=")[1]);
1212
- return isNaN(i) || (n = `${n} ${i}w`), t.filter((o) => o !== i).map((o) => `${updateQueryParam(e, "width", o)} ${o}w`).concat([n]).join(", ");
1211
+ const o = Number(e.split("?width=")[1]);
1212
+ return isNaN(o) || (n = `${n} ${o}w`), t.filter((i) => i !== o).map((i) => `${updateQueryParam(e, "width", i)} ${i}w`).concat([n]).join(", ");
1213
1213
  }
1214
- return e.match(/cdn\.shopify\.com/) ? t.map((n) => [getShopifyImageUrl(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, i]) => `${n} ${i}w`).concat([e]).join(", ") : e;
1214
+ return e.match(/cdn\.shopify\.com/) ? t.map((n) => [getShopifyImageUrl(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, o]) => `${n} ${o}w`).concat([e]).join(", ") : e;
1215
1215
  }
1216
1216
  function Image(e) {
1217
- var o, a, r, s;
1217
+ var i, a, r, s;
1218
1218
  function t() {
1219
- var d;
1219
+ var u;
1220
1220
  const c = e.image || e.src;
1221
1221
  if (!c || // We can auto add srcset for cdn.builder.io and shopify
1222
1222
  // images, otherwise you can supply this prop manually
1223
1223
  !(c.match(/builder\.io/) || c.match(/cdn\.shopify\.com/)))
1224
1224
  return e.srcset;
1225
- if (e.srcset && ((d = e.image) != null && d.includes("builder.io/api/v1/image"))) {
1225
+ if (e.srcset && ((u = e.image) != null && u.includes("builder.io/api/v1/image"))) {
1226
1226
  if (!e.srcset.includes(e.image.split("?")[0]))
1227
1227
  return console.debug("Removed given srcset"), getSrcSet(c);
1228
1228
  } else if (e.image && !e.srcset)
@@ -1233,7 +1233,7 @@ function Image(e) {
1233
1233
  var l;
1234
1234
  return (l = t == null ? void 0 : t()) != null && l.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
1235
1235
  }
1236
- function i() {
1236
+ function o() {
1237
1237
  const l = {
1238
1238
  position: "absolute",
1239
1239
  height: "100%",
@@ -1256,7 +1256,7 @@ function Image(e) {
1256
1256
  style: {
1257
1257
  objectPosition: e.backgroundPosition || "center",
1258
1258
  objectFit: e.backgroundSize || "cover",
1259
- ...i()
1259
+ ...o()
1260
1260
  },
1261
1261
  className: "builder-image" + (e.className ? " " + e.className : "") + " img-40c70c9b",
1262
1262
  src: e.image,
@@ -1265,7 +1265,7 @@ function Image(e) {
1265
1265
  }
1266
1266
  )
1267
1267
  ] }),
1268
- e.aspectRatio && !((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length && e.fitContent) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
1268
+ e.aspectRatio && !((a = (i = e.builderBlock) == null ? void 0 : i.children) != null && a.length && e.fitContent) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
1269
1269
  "div",
1270
1270
  {
1271
1271
  className: "builder-image-sizer div-40c70c9b",
@@ -1317,7 +1317,7 @@ function SectionComponent(e) {
1317
1317
  }
1318
1318
  );
1319
1319
  }
1320
- const componentInfo$b = {
1320
+ const componentInfo$f = {
1321
1321
  name: "Core:Button",
1322
1322
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
1323
1323
  defaultStyles: {
@@ -1350,7 +1350,7 @@ const componentInfo$b = {
1350
1350
  }],
1351
1351
  static: !0,
1352
1352
  noWrap: !0
1353
- }, componentInfo$a = {
1353
+ }, componentInfo$e = {
1354
1354
  // TODO: ways to statically preprocess JSON for references, functions, etc
1355
1355
  name: "Columns",
1356
1356
  isRSC: !0,
@@ -1524,12 +1524,12 @@ const componentInfo$b = {
1524
1524
  }],
1525
1525
  onChange: (e) => {
1526
1526
  function t() {
1527
- n.forEach((i) => {
1528
- i.delete("width");
1527
+ n.forEach((o) => {
1528
+ o.delete("width");
1529
1529
  });
1530
1530
  }
1531
1531
  const n = e.get("columns");
1532
- Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((s, l) => s + l.get("width"), 0) !== 100) && t();
1532
+ Array.isArray(n) && n.find((i) => i.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((s, l) => s + l.get("width"), 0) !== 100) && t();
1533
1533
  }
1534
1534
  }, {
1535
1535
  name: "space",
@@ -1551,131 +1551,13 @@ const componentInfo$b = {
1551
1551
  helperText: "When stacking columns for mobile devices, reverse the ordering",
1552
1552
  advanced: !0
1553
1553
  }]
1554
- }, componentInfo$9 = {
1555
- name: "Custom Code",
1556
- static: !0,
1557
- requiredPermissions: ["editCode"],
1558
- inputs: [{
1559
- name: "code",
1560
- type: "html",
1561
- required: !0,
1562
- defaultValue: "<p>Hello there, I am custom HTML code!</p>",
1563
- code: !0
1564
- }, {
1565
- name: "replaceNodes",
1566
- type: "boolean",
1567
- helperText: "Preserve server rendered dom nodes",
1568
- advanced: !0
1569
- }, {
1570
- name: "scriptsClientOnly",
1571
- type: "boolean",
1572
- defaultValue: !1,
1573
- helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
1574
- advanced: !0
1575
- }]
1576
- };
1577
- function CustomCode(e) {
1578
- const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []);
1579
- return useEffect(() => {
1580
- var s;
1581
- if (!((s = t.current) != null && s.getElementsByTagName) || typeof window == "undefined")
1582
- return;
1583
- const r = t.current.getElementsByTagName("script");
1584
- for (let l = 0; l < r.length; l++) {
1585
- const c = r[l];
1586
- if (c.src) {
1587
- if (n.includes(c.src))
1588
- continue;
1589
- n.push(c.src);
1590
- const d = document.createElement("script");
1591
- d.async = !0, d.src = c.src, document.head.appendChild(d);
1592
- } else if (!c.type || [
1593
- "text/javascript",
1594
- "application/javascript",
1595
- "application/ecmascript"
1596
- ].includes(c.type)) {
1597
- if (o.includes(c.innerText))
1598
- continue;
1599
- try {
1600
- o.push(c.innerText), new Function(c.innerText)();
1601
- } catch (d) {
1602
- console.warn("`CustomCode`: Error running script:", d);
1603
- }
1604
- }
1605
- }
1606
- }, []), /* @__PURE__ */ jsx(
1607
- "div",
1608
- {
1609
- ref: t,
1610
- className: "builder-custom-code" + (e.replaceNodes ? " replace-nodes" : ""),
1611
- dangerouslySetInnerHTML: { __html: e.code }
1612
- }
1613
- );
1614
- }
1615
- const componentInfo$8 = {
1616
- name: "Embed",
1617
- static: !0,
1618
- inputs: [{
1619
- name: "url",
1620
- type: "url",
1621
- required: !0,
1622
- defaultValue: "",
1623
- helperText: "e.g. enter a youtube url, google map, etc",
1624
- onChange: (e) => {
1625
- const t = e.get("url");
1626
- if (t)
1627
- return e.set("content", "Loading..."), fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then((i) => i.json()).then((i) => {
1628
- e.get("url") === t && (i.html ? e.set("content", i.html) : e.set("content", "Invalid url, please try another"));
1629
- }).catch((i) => {
1630
- e.set("content", "There was an error embedding this URL, please try again or another URL");
1631
- });
1632
- e.delete("content");
1633
- }
1634
- }, {
1635
- name: "content",
1636
- type: "html",
1637
- defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
1638
- hideFromUI: !0
1639
- }]
1640
- }, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
1641
- function Embed(e) {
1642
- const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r, s] = useState(() => !1);
1643
- function l() {
1644
- if (!t.current || !t.current.getElementsByTagName)
1645
- return;
1646
- const c = t.current.getElementsByTagName("script");
1647
- for (let d = 0; d < c.length; d++) {
1648
- const b = c[d];
1649
- if (b.src && !n.includes(b.src)) {
1650
- n.push(b.src);
1651
- const S = document.createElement("script");
1652
- S.async = !0, S.src = b.src, document.head.appendChild(S);
1653
- } else if (isJsScript(b) && !o.includes(b.innerText))
1654
- try {
1655
- o.push(b.innerText), new Function(b.innerText)();
1656
- } catch (S) {
1657
- console.warn("`Embed`: Error running script:", S);
1658
- }
1659
- }
1660
- }
1661
- return useEffect(() => {
1662
- t.current && !r && (s(!0), l());
1663
- }, [t.current, r]), /* @__PURE__ */ jsx(
1664
- "div",
1665
- {
1666
- className: "builder-embed",
1667
- ref: t,
1668
- dangerouslySetInnerHTML: { __html: e.content }
1669
- }
1670
- );
1671
- }
1672
- const componentInfo$7 = {
1554
+ }, componentInfo$d = {
1673
1555
  name: "Fragment",
1674
1556
  static: !0,
1675
1557
  hidden: !0,
1676
1558
  canHaveChildren: !0,
1677
1559
  noWrap: !0
1678
- }, componentInfo$6 = {
1560
+ }, componentInfo$c = {
1679
1561
  name: "Image",
1680
1562
  static: !0,
1681
1563
  image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
@@ -1697,27 +1579,27 @@ const componentInfo$7 = {
1697
1579
  e.delete("srcset"), e.delete("noWebp");
1698
1580
  function n(r, s = 6e4) {
1699
1581
  return new Promise((l, c) => {
1700
- const d = document.createElement("img");
1701
- let b = !1;
1702
- d.onload = () => {
1703
- b = !0, l(d);
1704
- }, d.addEventListener("error", (S) => {
1705
- console.warn("Image load failed", S.error), c(S.error);
1706
- }), d.src = r, setTimeout(() => {
1707
- b || c(new Error("Image load timed out"));
1582
+ const u = document.createElement("img");
1583
+ let y = !1;
1584
+ u.onload = () => {
1585
+ y = !0, l(u);
1586
+ }, u.addEventListener("error", (x) => {
1587
+ console.warn("Image load failed", x.error), c(x.error);
1588
+ }), u.src = r, setTimeout(() => {
1589
+ y || c(new Error("Image load timed out"));
1708
1590
  }, s);
1709
1591
  });
1710
1592
  }
1711
- function i(r) {
1593
+ function o(r) {
1712
1594
  return Math.round(r * 1e3) / 1e3;
1713
1595
  }
1714
- const o = e.get("image"), a = e.get("aspectRatio");
1715
- if (fetch(o).then((r) => r.blob()).then((r) => {
1596
+ const i = e.get("image"), a = e.get("aspectRatio");
1597
+ if (fetch(i).then((r) => r.blob()).then((r) => {
1716
1598
  r.type.includes("svg") && e.set("noWebp", !0);
1717
- }), o && (!a || a === 0.7041))
1718
- return n(o).then((r) => {
1599
+ }), i && (!a || a === 0.7041))
1600
+ return n(i).then((r) => {
1719
1601
  const s = e.get("aspectRatio");
1720
- e.get("image") === o && (!s || s === 0.7041) && r.width && r.height && (e.set("aspectRatio", i(r.height / r.width)), e.set("height", r.height), e.set("width", r.width));
1602
+ e.get("image") === i && (!s || s === 0.7041) && r.width && r.height && (e.set("aspectRatio", o(r.height / r.width)), e.set("height", r.height), e.set("width", r.width));
1721
1603
  });
1722
1604
  }
1723
1605
  }, {
@@ -1775,37 +1657,7 @@ const componentInfo$7 = {
1775
1657
  advanced: !0,
1776
1658
  defaultValue: 0.7041
1777
1659
  }]
1778
- }, componentInfo$5 = {
1779
- // friendlyName?
1780
- name: "Raw:Img",
1781
- hideFromInsertMenu: !0,
1782
- image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
1783
- inputs: [{
1784
- name: "image",
1785
- bubble: !0,
1786
- type: "file",
1787
- allowedFileTypes: ["jpeg", "jpg", "png", "svg", "gif", "webp"],
1788
- required: !0
1789
- }],
1790
- noWrap: !0,
1791
- static: !0
1792
- };
1793
- function ImgComponent(e) {
1794
- return /* @__PURE__ */ jsx(
1795
- "img",
1796
- {
1797
- style: {
1798
- objectFit: e.backgroundSize || "cover",
1799
- objectPosition: e.backgroundPosition || "center"
1800
- },
1801
- alt: e.altText,
1802
- src: e.imgSrc || e.image,
1803
- ...e.attributes
1804
- },
1805
- isEditing() && e.imgSrc || "default-key"
1806
- );
1807
- }
1808
- const componentInfo$4 = {
1660
+ }, componentInfo$b = {
1809
1661
  name: "Core:Section",
1810
1662
  static: !0,
1811
1663
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -1844,7 +1696,7 @@ const componentInfo$4 = {
1844
1696
  }
1845
1697
  }
1846
1698
  }]
1847
- }, componentInfo$3 = {
1699
+ }, componentInfo$a = {
1848
1700
  name: "Slot",
1849
1701
  isRSC: !0,
1850
1702
  description: "Allow child blocks to be inserted into this content when used as a Symbol",
@@ -1859,7 +1711,7 @@ const componentInfo$4 = {
1859
1711
  }]
1860
1712
  };
1861
1713
  function Slot(e) {
1862
- var t, n, i;
1714
+ var t, n, o;
1863
1715
  return /* @__PURE__ */ jsx(
1864
1716
  "div",
1865
1717
  {
@@ -1875,13 +1727,13 @@ function Slot(e) {
1875
1727
  parent: (n = e.builderContext.context) == null ? void 0 : n.symbolId,
1876
1728
  path: `symbol.data.${e.name}`,
1877
1729
  context: e.builderContext,
1878
- blocks: (i = e.builderContext.rootState) == null ? void 0 : i[e.name]
1730
+ blocks: (o = e.builderContext.rootState) == null ? void 0 : o[e.name]
1879
1731
  }
1880
1732
  )
1881
1733
  }
1882
1734
  );
1883
1735
  }
1884
- const componentInfo$2 = {
1736
+ const componentInfo$9 = {
1885
1737
  name: "Symbol",
1886
1738
  noWrap: !0,
1887
1739
  static: !0,
@@ -1914,7 +1766,7 @@ const componentInfo$2 = {
1914
1766
  hideFromUI: !0,
1915
1767
  type: "boolean"
1916
1768
  }]
1917
- }, componentInfo$1 = {
1769
+ }, componentInfo$8 = {
1918
1770
  name: "Text",
1919
1771
  static: !0,
1920
1772
  isRSC: !0,
@@ -1946,70 +1798,786 @@ function Text(e) {
1946
1798
  }
1947
1799
  );
1948
1800
  }
1949
- const componentInfo = {
1950
- name: "Video",
1951
- canHaveChildren: !0,
1952
- defaultStyles: {
1953
- minHeight: "20px",
1954
- minWidth: "20px"
1955
- },
1956
- image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",
1801
+ const componentInfo$7 = {
1802
+ name: "Custom Code",
1803
+ static: !0,
1804
+ requiredPermissions: ["editCode"],
1957
1805
  inputs: [{
1958
- name: "video",
1959
- type: "file",
1960
- allowedFileTypes: ["mp4"],
1961
- bubble: !0,
1962
- defaultValue: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",
1963
- required: !0
1964
- }, {
1965
- name: "posterImage",
1966
- type: "file",
1967
- allowedFileTypes: ["jpeg", "png"],
1968
- helperText: "Image to show before the video plays"
1969
- }, {
1970
- name: "autoPlay",
1971
- type: "boolean",
1972
- defaultValue: !0
1973
- }, {
1974
- name: "controls",
1975
- type: "boolean",
1976
- defaultValue: !1
1977
- }, {
1978
- name: "muted",
1979
- type: "boolean",
1980
- defaultValue: !0
1981
- }, {
1982
- name: "loop",
1983
- type: "boolean",
1984
- defaultValue: !0
1985
- }, {
1986
- name: "playsInline",
1987
- type: "boolean",
1988
- defaultValue: !0
1989
- }, {
1990
- name: "fit",
1991
- type: "text",
1992
- defaultValue: "cover",
1993
- enum: ["contain", "cover", "fill", "auto"]
1994
- }, {
1995
- name: "preload",
1996
- type: "text",
1997
- defaultValue: "metadata",
1998
- enum: ["auto", "metadata", "none"]
1806
+ name: "code",
1807
+ type: "html",
1808
+ required: !0,
1809
+ defaultValue: "<p>Hello there, I am custom HTML code!</p>",
1810
+ code: !0
1999
1811
  }, {
2000
- name: "fitContent",
1812
+ name: "replaceNodes",
2001
1813
  type: "boolean",
2002
- helperText: "When child blocks are provided, fit to them instead of using the aspect ratio",
2003
- defaultValue: !0,
1814
+ helperText: "Preserve server rendered dom nodes",
2004
1815
  advanced: !0
2005
1816
  }, {
2006
- name: "position",
2007
- type: "text",
2008
- defaultValue: "center",
2009
- enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
2010
- }, {
2011
- name: "height",
2012
- type: "number",
1817
+ name: "scriptsClientOnly",
1818
+ type: "boolean",
1819
+ defaultValue: !1,
1820
+ helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
1821
+ advanced: !0
1822
+ }]
1823
+ };
1824
+ function CustomCode(e) {
1825
+ const t = useRef(null), [n, o] = useState(() => []), [i, a] = useState(() => []);
1826
+ return useEffect(() => {
1827
+ var s;
1828
+ if (!((s = t.current) != null && s.getElementsByTagName) || typeof window == "undefined")
1829
+ return;
1830
+ const r = t.current.getElementsByTagName("script");
1831
+ for (let l = 0; l < r.length; l++) {
1832
+ const c = r[l];
1833
+ if (c.src) {
1834
+ if (n.includes(c.src))
1835
+ continue;
1836
+ n.push(c.src);
1837
+ const u = document.createElement("script");
1838
+ u.async = !0, u.src = c.src, document.head.appendChild(u);
1839
+ } else if (!c.type || [
1840
+ "text/javascript",
1841
+ "application/javascript",
1842
+ "application/ecmascript"
1843
+ ].includes(c.type)) {
1844
+ if (i.includes(c.innerText))
1845
+ continue;
1846
+ try {
1847
+ i.push(c.innerText), new Function(c.innerText)();
1848
+ } catch (u) {
1849
+ console.warn("`CustomCode`: Error running script:", u);
1850
+ }
1851
+ }
1852
+ }
1853
+ }, []), /* @__PURE__ */ jsx(
1854
+ "div",
1855
+ {
1856
+ ref: t,
1857
+ className: "builder-custom-code" + (e.replaceNodes ? " replace-nodes" : ""),
1858
+ dangerouslySetInnerHTML: { __html: e.code }
1859
+ }
1860
+ );
1861
+ }
1862
+ const componentInfo$6 = {
1863
+ name: "Embed",
1864
+ static: !0,
1865
+ inputs: [{
1866
+ name: "url",
1867
+ type: "url",
1868
+ required: !0,
1869
+ defaultValue: "",
1870
+ helperText: "e.g. enter a youtube url, google map, etc",
1871
+ onChange: (e) => {
1872
+ const t = e.get("url");
1873
+ if (t)
1874
+ return e.set("content", "Loading..."), fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then((o) => o.json()).then((o) => {
1875
+ e.get("url") === t && (o.html ? e.set("content", o.html) : e.set("content", "Invalid url, please try another"));
1876
+ }).catch((o) => {
1877
+ e.set("content", "There was an error embedding this URL, please try again or another URL");
1878
+ });
1879
+ e.delete("content");
1880
+ }
1881
+ }, {
1882
+ name: "content",
1883
+ type: "html",
1884
+ defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
1885
+ hideFromUI: !0
1886
+ }]
1887
+ }, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
1888
+ function Embed(e) {
1889
+ const t = useRef(null), [n, o] = useState(() => []), [i, a] = useState(() => []), [r, s] = useState(() => !1);
1890
+ function l() {
1891
+ if (!t.current || !t.current.getElementsByTagName)
1892
+ return;
1893
+ const c = t.current.getElementsByTagName("script");
1894
+ for (let u = 0; u < c.length; u++) {
1895
+ const y = c[u];
1896
+ if (y.src && !n.includes(y.src)) {
1897
+ n.push(y.src);
1898
+ const x = document.createElement("script");
1899
+ x.async = !0, x.src = y.src, document.head.appendChild(x);
1900
+ } else if (isJsScript(y) && !i.includes(y.innerText))
1901
+ try {
1902
+ i.push(y.innerText), new Function(y.innerText)();
1903
+ } catch (x) {
1904
+ console.warn("`Embed`: Error running script:", x);
1905
+ }
1906
+ }
1907
+ }
1908
+ return useEffect(() => {
1909
+ t.current && !r && (s(!0), l());
1910
+ }, [t.current, r]), /* @__PURE__ */ jsx(
1911
+ "div",
1912
+ {
1913
+ className: "builder-embed",
1914
+ ref: t,
1915
+ dangerouslySetInnerHTML: { __html: e.content }
1916
+ }
1917
+ );
1918
+ }
1919
+ const componentInfo$5 = {
1920
+ name: "Form:Form",
1921
+ // editableTags: ['builder-form-error']
1922
+ defaults: {
1923
+ responsiveStyles: {
1924
+ large: {
1925
+ marginTop: "15px",
1926
+ paddingBottom: "15px"
1927
+ }
1928
+ }
1929
+ },
1930
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",
1931
+ inputs: [{
1932
+ name: "sendSubmissionsTo",
1933
+ type: "string",
1934
+ // TODO: save to builder data and user can download as csv
1935
+ // TODO: easy for mode too or computed add/remove fields form mode
1936
+ // so you can edit details and high level mode at same time...
1937
+ // Later - more integrations like mailchimp
1938
+ // /api/v1/form-submit?to=mailchimp
1939
+ enum: [{
1940
+ label: "Send to email",
1941
+ value: "email",
1942
+ helperText: "Send form submissions to the email address of your choosing"
1943
+ }, {
1944
+ label: "Custom",
1945
+ value: "custom",
1946
+ helperText: "Handle where the form requests go manually with a little code, e.g. to your own custom backend"
1947
+ }],
1948
+ defaultValue: "email"
1949
+ }, {
1950
+ name: "sendSubmissionsToEmail",
1951
+ type: "string",
1952
+ required: !0,
1953
+ // TODO: required: () => options.get("sendSubmissionsTo") === "email"
1954
+ defaultValue: "your@email.com",
1955
+ showIf: 'options.get("sendSubmissionsTo") === "email"'
1956
+ }, {
1957
+ name: "sendWithJs",
1958
+ type: "boolean",
1959
+ helperText: "Set to false to use basic html form action",
1960
+ defaultValue: !0,
1961
+ showIf: 'options.get("sendSubmissionsTo") === "custom"'
1962
+ }, {
1963
+ name: "name",
1964
+ type: "string",
1965
+ defaultValue: "My form"
1966
+ // advanced: true
1967
+ }, {
1968
+ name: "action",
1969
+ type: "string",
1970
+ helperText: "URL to send the form data to",
1971
+ showIf: 'options.get("sendSubmissionsTo") === "custom"'
1972
+ }, {
1973
+ name: "contentType",
1974
+ type: "string",
1975
+ defaultValue: "application/json",
1976
+ advanced: !0,
1977
+ // TODO: do automatically if file input
1978
+ enum: ["application/json", "multipart/form-data", "application/x-www-form-urlencoded"],
1979
+ showIf: 'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'
1980
+ }, {
1981
+ name: "method",
1982
+ type: "string",
1983
+ showIf: 'options.get("sendSubmissionsTo") === "custom"',
1984
+ defaultValue: "POST",
1985
+ advanced: !0
1986
+ }, {
1987
+ name: "previewState",
1988
+ type: "string",
1989
+ // TODO: persist: false flag
1990
+ enum: ["unsubmitted", "sending", "success", "error"],
1991
+ defaultValue: "unsubmitted",
1992
+ helperText: 'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',
1993
+ showIf: 'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'
1994
+ }, {
1995
+ name: "successUrl",
1996
+ type: "url",
1997
+ helperText: "Optional URL to redirect the user to on form submission success",
1998
+ showIf: 'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'
1999
+ }, {
2000
+ name: "resetFormOnSubmit",
2001
+ type: "boolean",
2002
+ showIf: "options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",
2003
+ advanced: !0
2004
+ }, {
2005
+ name: "successMessage",
2006
+ type: "uiBlocks",
2007
+ hideFromUI: !0,
2008
+ defaultValue: [{
2009
+ "@type": "@builder.io/sdk:Element",
2010
+ responsiveStyles: {
2011
+ large: {
2012
+ marginTop: "10px"
2013
+ }
2014
+ },
2015
+ component: {
2016
+ name: "Text",
2017
+ options: {
2018
+ text: "<span>Thanks!</span>"
2019
+ }
2020
+ }
2021
+ }]
2022
+ }, {
2023
+ name: "validate",
2024
+ type: "boolean",
2025
+ defaultValue: !0,
2026
+ advanced: !0
2027
+ }, {
2028
+ name: "errorMessagePath",
2029
+ type: "text",
2030
+ advanced: !0,
2031
+ helperText: 'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'
2032
+ }, {
2033
+ name: "errorMessage",
2034
+ type: "uiBlocks",
2035
+ hideFromUI: !0,
2036
+ defaultValue: [{
2037
+ "@type": "@builder.io/sdk:Element",
2038
+ responsiveStyles: {
2039
+ large: {
2040
+ marginTop: "10px"
2041
+ }
2042
+ },
2043
+ bindings: {
2044
+ "component.options.text": "state.formErrorMessage || block.component.options.text"
2045
+ },
2046
+ component: {
2047
+ name: "Text",
2048
+ options: {
2049
+ text: "<span>Form submission error :( Please check your answers and try again</span>"
2050
+ }
2051
+ }
2052
+ }]
2053
+ }, {
2054
+ name: "sendingMessage",
2055
+ type: "uiBlocks",
2056
+ hideFromUI: !0,
2057
+ defaultValue: [{
2058
+ "@type": "@builder.io/sdk:Element",
2059
+ responsiveStyles: {
2060
+ large: {
2061
+ marginTop: "10px"
2062
+ }
2063
+ },
2064
+ component: {
2065
+ name: "Text",
2066
+ options: {
2067
+ text: "<span>Sending...</span>"
2068
+ }
2069
+ }
2070
+ }]
2071
+ }, {
2072
+ name: "customHeaders",
2073
+ type: "map",
2074
+ valueType: {
2075
+ type: "string"
2076
+ },
2077
+ advanced: !0,
2078
+ showIf: 'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'
2079
+ }],
2080
+ noWrap: !0,
2081
+ canHaveChildren: !0,
2082
+ defaultChildren: [{
2083
+ "@type": "@builder.io/sdk:Element",
2084
+ responsiveStyles: {
2085
+ large: {
2086
+ marginTop: "10px"
2087
+ }
2088
+ },
2089
+ component: {
2090
+ name: "Text",
2091
+ options: {
2092
+ text: "<span>Enter your name</span>"
2093
+ }
2094
+ }
2095
+ }, {
2096
+ "@type": "@builder.io/sdk:Element",
2097
+ responsiveStyles: {
2098
+ large: {
2099
+ marginTop: "10px"
2100
+ }
2101
+ },
2102
+ component: {
2103
+ name: "Form:Input",
2104
+ options: {
2105
+ name: "name",
2106
+ placeholder: "Jane Doe"
2107
+ }
2108
+ }
2109
+ }, {
2110
+ "@type": "@builder.io/sdk:Element",
2111
+ responsiveStyles: {
2112
+ large: {
2113
+ marginTop: "10px"
2114
+ }
2115
+ },
2116
+ component: {
2117
+ name: "Text",
2118
+ options: {
2119
+ text: "<span>Enter your email</span>"
2120
+ }
2121
+ }
2122
+ }, {
2123
+ "@type": "@builder.io/sdk:Element",
2124
+ responsiveStyles: {
2125
+ large: {
2126
+ marginTop: "10px"
2127
+ }
2128
+ },
2129
+ component: {
2130
+ name: "Form:Input",
2131
+ options: {
2132
+ name: "email",
2133
+ placeholder: "jane@doe.com"
2134
+ }
2135
+ }
2136
+ }, {
2137
+ "@type": "@builder.io/sdk:Element",
2138
+ responsiveStyles: {
2139
+ large: {
2140
+ marginTop: "10px"
2141
+ }
2142
+ },
2143
+ component: {
2144
+ name: "Form:SubmitButton",
2145
+ options: {
2146
+ text: "Submit"
2147
+ }
2148
+ }
2149
+ }]
2150
+ }, validEnvList = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"], getEnv = () => {
2151
+ const e = process.env.NODE_ENV || "production";
2152
+ return validEnvList.includes(e) ? e : "production";
2153
+ }, get = (e, t, n) => {
2154
+ const o = String.prototype.split.call(t, /[,[\].]+?/).filter(Boolean).reduce((i, a) => i != null ? i[a] : i, e);
2155
+ return o === void 0 || o === e ? n : o;
2156
+ };
2157
+ function FormComponent(e) {
2158
+ var y, x;
2159
+ const t = useRef(null), [n, o] = useState(() => "unsubmitted"), [i, a] = useState(() => null), [r, s] = useState(() => "");
2160
+ function l(d) {
2161
+ var b, I;
2162
+ const m = {
2163
+ ...e.builderContext.rootState,
2164
+ ...d
2165
+ };
2166
+ e.builderContext.rootSetState ? (I = (b = e.builderContext).rootSetState) == null || I.call(b, m) : e.builderContext.rootState = m;
2167
+ }
2168
+ function c() {
2169
+ return isEditing() && e.previewState || n;
2170
+ }
2171
+ function u(d) {
2172
+ var b;
2173
+ const m = e.sendWithJs || e.sendSubmissionsTo === "email";
2174
+ if (e.sendSubmissionsTo === "zapier")
2175
+ d.preventDefault();
2176
+ else if (m) {
2177
+ if (!(e.action || e.sendSubmissionsTo === "email")) {
2178
+ d.preventDefault();
2179
+ return;
2180
+ }
2181
+ d.preventDefault();
2182
+ const I = d.currentTarget, R = e.customHeaders || {};
2183
+ let S;
2184
+ const k = new FormData(I), w = Array.from(
2185
+ d.currentTarget.querySelectorAll("input,select,textarea")
2186
+ ).filter((f) => !!f.name).map((f) => {
2187
+ let C;
2188
+ const F = f.name;
2189
+ if (f instanceof HTMLInputElement)
2190
+ if (f.type === "radio") {
2191
+ if (f.checked)
2192
+ return C = f.name, {
2193
+ key: F,
2194
+ value: C
2195
+ };
2196
+ } else if (f.type === "checkbox")
2197
+ C = f.checked;
2198
+ else if (f.type === "number" || f.type === "range") {
2199
+ const j = f.valueAsNumber;
2200
+ isNaN(j) || (C = j);
2201
+ } else
2202
+ f.type === "file" ? C = f.files : C = f.value;
2203
+ else
2204
+ C = f.value;
2205
+ return {
2206
+ key: F,
2207
+ value: C
2208
+ };
2209
+ });
2210
+ let E = e.contentType;
2211
+ if (e.sendSubmissionsTo === "email" && (E = "multipart/form-data"), Array.from(w).forEach(({ value: f }) => {
2212
+ (f instanceof File || Array.isArray(f) && f[0] instanceof File || f instanceof FileList) && (E = "multipart/form-data");
2213
+ }), E !== "application/json")
2214
+ S = k;
2215
+ else {
2216
+ const f = {};
2217
+ Array.from(w).forEach(({ value: C, key: F }) => {
2218
+ set(f, F, C);
2219
+ }), S = JSON.stringify(f);
2220
+ }
2221
+ E && E !== "multipart/form-data" && (m && ((b = e.action) != null && b.includes("zapier.com")) || (R["content-type"] = E));
2222
+ const B = new CustomEvent("presubmit", { detail: { body: S } });
2223
+ if (t.current && (t.current.dispatchEvent(B), B.defaultPrevented))
2224
+ return;
2225
+ o("sending");
2226
+ const A = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(
2227
+ e.sendSubmissionsToEmail || ""
2228
+ )}&name=${encodeURIComponent(e.name || "")}`;
2229
+ fetch(
2230
+ e.sendSubmissionsTo === "email" ? A : e.action,
2231
+ { body: S, headers: R, method: e.method || "post" }
2232
+ ).then(
2233
+ async (f) => {
2234
+ let C;
2235
+ const F = f.headers.get("content-type");
2236
+ if (F && F.indexOf("application/json") !== -1 ? C = await f.json() : C = await f.text(), !f.ok && e.errorMessagePath) {
2237
+ let j = get(C, e.errorMessagePath);
2238
+ j && (typeof j != "string" && (j = JSON.stringify(j)), s(j), l({ formErrorMessage: j }));
2239
+ }
2240
+ if (a(C), o(f.ok ? "success" : "error"), f.ok) {
2241
+ const j = new CustomEvent("submit:success", {
2242
+ detail: { res: f, body: C }
2243
+ });
2244
+ if (t.current) {
2245
+ if (t.current.dispatchEvent(j), j.defaultPrevented)
2246
+ return;
2247
+ e.resetFormOnSubmit !== !1 && t.current.reset();
2248
+ }
2249
+ if (e.successUrl)
2250
+ if (t.current) {
2251
+ const V = new CustomEvent("route", {
2252
+ detail: { url: e.successUrl }
2253
+ });
2254
+ t.current.dispatchEvent(V), V.defaultPrevented || (location.href = e.successUrl);
2255
+ } else
2256
+ location.href = e.successUrl;
2257
+ }
2258
+ },
2259
+ (f) => {
2260
+ const C = new CustomEvent("submit:error", {
2261
+ detail: { error: f }
2262
+ });
2263
+ t.current && (t.current.dispatchEvent(C), C.defaultPrevented) || (a(f), o("error"));
2264
+ }
2265
+ );
2266
+ }
2267
+ }
2268
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
2269
+ " ",
2270
+ /* @__PURE__ */ jsxs(
2271
+ "form",
2272
+ {
2273
+ validate: e.validate,
2274
+ ref: t,
2275
+ action: !e.sendWithJs && e.action,
2276
+ method: e.method,
2277
+ name: e.name,
2278
+ onSubmit: (d) => u(d),
2279
+ ...e.attributes,
2280
+ children: [
2281
+ " ",
2282
+ e.builderBlock && e.builderBlock.children ? /* @__PURE__ */ jsx(Fragment, { children: (x = (y = e.builderBlock) == null ? void 0 : y.children) == null ? void 0 : x.map((d, m) => /* @__PURE__ */ jsx(
2283
+ Block,
2284
+ {
2285
+ block: d,
2286
+ context: e.builderContext,
2287
+ registeredComponents: e.builderComponents,
2288
+ linkComponent: e.builderLinkComponent
2289
+ },
2290
+ `form-block-${m}`
2291
+ )) }) : null,
2292
+ " ",
2293
+ c() === "error" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2294
+ Blocks,
2295
+ {
2296
+ path: "errorMessage",
2297
+ blocks: e.errorMessage,
2298
+ context: e.builderContext
2299
+ }
2300
+ ) }) : null,
2301
+ " ",
2302
+ c() === "sending" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2303
+ Blocks,
2304
+ {
2305
+ path: "sendingMessage",
2306
+ blocks: e.sendingMessage,
2307
+ context: e.builderContext
2308
+ }
2309
+ ) }) : null,
2310
+ " ",
2311
+ c() === "error" && i ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("pre", { className: "builder-form-error-text pre-8fbb5280", children: [
2312
+ " ",
2313
+ JSON.stringify(i, null, 2),
2314
+ " "
2315
+ ] }) }) : null,
2316
+ " ",
2317
+ c() === "success" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2318
+ Blocks,
2319
+ {
2320
+ path: "successMessage",
2321
+ blocks: e.successMessage,
2322
+ context: e.builderContext
2323
+ }
2324
+ ) }) : null,
2325
+ " "
2326
+ ]
2327
+ }
2328
+ ),
2329
+ " ",
2330
+ /* @__PURE__ */ jsx("style", { children: ".pre-8fbb5280 { padding: 10px; color: red; text-align: center; }" }),
2331
+ " "
2332
+ ] });
2333
+ }
2334
+ const componentInfo$4 = {
2335
+ name: "Form:Input",
2336
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
2337
+ inputs: [
2338
+ {
2339
+ name: "type",
2340
+ type: "text",
2341
+ enum: ["text", "number", "email", "url", "checkbox", "radio", "range", "date", "datetime-local", "search", "tel", "time", "file", "month", "week", "password", "color", "hidden"],
2342
+ defaultValue: "text"
2343
+ },
2344
+ {
2345
+ name: "name",
2346
+ type: "string",
2347
+ required: !0,
2348
+ helperText: 'Every input in a form needs a unique name describing what it takes, e.g. "email"'
2349
+ },
2350
+ {
2351
+ name: "placeholder",
2352
+ type: "string",
2353
+ defaultValue: "Hello there",
2354
+ helperText: "Text to display when there is no value"
2355
+ },
2356
+ // TODO: handle value vs default value automatically like ng-model
2357
+ {
2358
+ name: "defaultValue",
2359
+ type: "string"
2360
+ },
2361
+ {
2362
+ name: "value",
2363
+ type: "string",
2364
+ advanced: !0
2365
+ },
2366
+ {
2367
+ name: "required",
2368
+ type: "boolean",
2369
+ helperText: "Is this input required to be filled out to submit a form",
2370
+ defaultValue: !1
2371
+ }
2372
+ ],
2373
+ noWrap: !0,
2374
+ static: !0,
2375
+ defaultStyles: {
2376
+ paddingTop: "10px",
2377
+ paddingBottom: "10px",
2378
+ paddingLeft: "10px",
2379
+ paddingRight: "10px",
2380
+ borderRadius: "3px",
2381
+ borderWidth: "1px",
2382
+ borderStyle: "solid",
2383
+ borderColor: "#ccc"
2384
+ }
2385
+ };
2386
+ function FormInputComponent(e) {
2387
+ return /* @__PURE__ */ createElement(
2388
+ "input",
2389
+ {
2390
+ ...e.attributes,
2391
+ key: isEditing() && e.defaultValue ? e.defaultValue : "default-key",
2392
+ placeholder: e.placeholder,
2393
+ type: e.type,
2394
+ name: e.name,
2395
+ value: e.value,
2396
+ defaultValue: e.defaultValue,
2397
+ required: e.required
2398
+ }
2399
+ );
2400
+ }
2401
+ const componentInfo$3 = {
2402
+ name: "Form:Select",
2403
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
2404
+ defaultStyles: {
2405
+ alignSelf: "flex-start"
2406
+ },
2407
+ inputs: [{
2408
+ name: "options",
2409
+ type: "list",
2410
+ required: !0,
2411
+ subFields: [{
2412
+ name: "value",
2413
+ type: "text",
2414
+ required: !0
2415
+ }, {
2416
+ name: "name",
2417
+ type: "text"
2418
+ }],
2419
+ defaultValue: [{
2420
+ value: "option 1"
2421
+ }, {
2422
+ value: "option 2"
2423
+ }]
2424
+ }, {
2425
+ name: "name",
2426
+ type: "string",
2427
+ required: !0,
2428
+ helperText: 'Every select in a form needs a unique name describing what it gets, e.g. "email"'
2429
+ }, {
2430
+ name: "defaultValue",
2431
+ type: "string"
2432
+ }, {
2433
+ name: "value",
2434
+ type: "string",
2435
+ advanced: !0
2436
+ }, {
2437
+ name: "required",
2438
+ type: "boolean",
2439
+ defaultValue: !1
2440
+ }],
2441
+ static: !0,
2442
+ noWrap: !0
2443
+ };
2444
+ function SelectComponent(e) {
2445
+ var t;
2446
+ return /* @__PURE__ */ createElement(
2447
+ "select",
2448
+ {
2449
+ ...e.attributes,
2450
+ value: e.value,
2451
+ key: isEditing() && e.defaultValue ? e.defaultValue : "default-key",
2452
+ defaultValue: e.defaultValue,
2453
+ name: e.name
2454
+ },
2455
+ (t = e.options) == null ? void 0 : t.map((n) => /* @__PURE__ */ jsx("option", { value: n.value, children: n.name || n.value }))
2456
+ );
2457
+ }
2458
+ const componentInfo$2 = {
2459
+ name: "Form:SubmitButton",
2460
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
2461
+ defaultStyles: {
2462
+ appearance: "none",
2463
+ paddingTop: "15px",
2464
+ paddingBottom: "15px",
2465
+ paddingLeft: "25px",
2466
+ paddingRight: "25px",
2467
+ backgroundColor: "#3898EC",
2468
+ color: "white",
2469
+ borderRadius: "4px",
2470
+ cursor: "pointer"
2471
+ },
2472
+ inputs: [{
2473
+ name: "text",
2474
+ type: "text",
2475
+ defaultValue: "Click me"
2476
+ }],
2477
+ static: !0,
2478
+ noWrap: !0
2479
+ // TODO: optional children? maybe as optional form input
2480
+ // that only shows if advanced setting is flipped
2481
+ // TODO: defaultChildren
2482
+ // canHaveChildren: true,
2483
+ };
2484
+ function SubmitButton(e) {
2485
+ return /* @__PURE__ */ jsx("button", { type: "submit", ...e.attributes, children: e.text });
2486
+ }
2487
+ const componentInfo$1 = {
2488
+ // friendlyName?
2489
+ name: "Raw:Img",
2490
+ hideFromInsertMenu: !0,
2491
+ image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
2492
+ inputs: [{
2493
+ name: "image",
2494
+ bubble: !0,
2495
+ type: "file",
2496
+ allowedFileTypes: ["jpeg", "jpg", "png", "svg", "gif", "webp"],
2497
+ required: !0
2498
+ }],
2499
+ noWrap: !0,
2500
+ static: !0
2501
+ };
2502
+ function ImgComponent(e) {
2503
+ return /* @__PURE__ */ jsx(
2504
+ "img",
2505
+ {
2506
+ style: {
2507
+ objectFit: e.backgroundSize || "cover",
2508
+ objectPosition: e.backgroundPosition || "center"
2509
+ },
2510
+ alt: e.altText,
2511
+ src: e.imgSrc || e.image,
2512
+ ...e.attributes
2513
+ },
2514
+ isEditing() && e.imgSrc || "default-key"
2515
+ );
2516
+ }
2517
+ const componentInfo = {
2518
+ name: "Video",
2519
+ canHaveChildren: !0,
2520
+ defaultStyles: {
2521
+ minHeight: "20px",
2522
+ minWidth: "20px"
2523
+ },
2524
+ image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",
2525
+ inputs: [{
2526
+ name: "video",
2527
+ type: "file",
2528
+ allowedFileTypes: ["mp4"],
2529
+ bubble: !0,
2530
+ defaultValue: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",
2531
+ required: !0
2532
+ }, {
2533
+ name: "posterImage",
2534
+ type: "file",
2535
+ allowedFileTypes: ["jpeg", "png"],
2536
+ helperText: "Image to show before the video plays"
2537
+ }, {
2538
+ name: "autoPlay",
2539
+ type: "boolean",
2540
+ defaultValue: !0
2541
+ }, {
2542
+ name: "controls",
2543
+ type: "boolean",
2544
+ defaultValue: !1
2545
+ }, {
2546
+ name: "muted",
2547
+ type: "boolean",
2548
+ defaultValue: !0
2549
+ }, {
2550
+ name: "loop",
2551
+ type: "boolean",
2552
+ defaultValue: !0
2553
+ }, {
2554
+ name: "playsInline",
2555
+ type: "boolean",
2556
+ defaultValue: !0
2557
+ }, {
2558
+ name: "fit",
2559
+ type: "text",
2560
+ defaultValue: "cover",
2561
+ enum: ["contain", "cover", "fill", "auto"]
2562
+ }, {
2563
+ name: "preload",
2564
+ type: "text",
2565
+ defaultValue: "metadata",
2566
+ enum: ["auto", "metadata", "none"]
2567
+ }, {
2568
+ name: "fitContent",
2569
+ type: "boolean",
2570
+ helperText: "When child blocks are provided, fit to them instead of using the aspect ratio",
2571
+ defaultValue: !0,
2572
+ advanced: !0
2573
+ }, {
2574
+ name: "position",
2575
+ type: "text",
2576
+ defaultValue: "center",
2577
+ enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
2578
+ }, {
2579
+ name: "height",
2580
+ type: "number",
2013
2581
  advanced: !0
2014
2582
  }, {
2015
2583
  name: "width",
@@ -2029,7 +2597,7 @@ const componentInfo = {
2029
2597
  }]
2030
2598
  };
2031
2599
  function Video(e) {
2032
- var i, o, a, r, s, l, c;
2600
+ var o, i, a, r, s, l, c;
2033
2601
  function t() {
2034
2602
  return {
2035
2603
  ...e.autoPlay === !0 ? {
@@ -2070,7 +2638,7 @@ function Video(e) {
2070
2638
  style: {
2071
2639
  width: "100%",
2072
2640
  height: "100%",
2073
- ...(i = e.attributes) == null ? void 0 : i.style,
2641
+ ...(o = e.attributes) == null ? void 0 : o.style,
2074
2642
  objectFit: e.fit,
2075
2643
  objectPosition: e.position,
2076
2644
  // Hack to get object fit to work as expected and
@@ -2086,7 +2654,7 @@ function Video(e) {
2086
2654
  children: e.lazyLoad ? null : /* @__PURE__ */ jsx("source", { type: "video/mp4", src: e.video })
2087
2655
  }
2088
2656
  ),
2089
- e.aspectRatio && !(e.fitContent && ((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length)) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2657
+ e.aspectRatio && !(e.fitContent && ((a = (i = e.builderBlock) == null ? void 0 : i.children) != null && a.length)) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2090
2658
  "div",
2091
2659
  {
2092
2660
  style: {
@@ -2129,43 +2697,55 @@ function Video(e) {
2129
2697
  }
2130
2698
  );
2131
2699
  }
2132
- const getDefaultRegisteredComponents = () => [{
2133
- component: Button,
2134
- ...componentInfo$b
2135
- }, {
2136
- component: Columns,
2137
- ...componentInfo$a
2138
- }, {
2700
+ const getExtraComponents = () => [{
2139
2701
  component: CustomCode,
2140
- ...componentInfo$9
2141
- }, {
2142
- component: Embed,
2143
- ...componentInfo$8
2144
- }, {
2145
- component: FragmentComponent,
2146
2702
  ...componentInfo$7
2147
2703
  }, {
2148
- component: Image,
2704
+ component: Embed,
2149
2705
  ...componentInfo$6
2150
2706
  }, {
2151
- component: ImgComponent,
2707
+ component: FormComponent,
2152
2708
  ...componentInfo$5
2153
2709
  }, {
2154
- component: SectionComponent,
2710
+ component: FormInputComponent,
2155
2711
  ...componentInfo$4
2156
2712
  }, {
2157
- component: Symbol$1,
2713
+ component: SubmitButton,
2158
2714
  ...componentInfo$2
2159
2715
  }, {
2160
- component: Text,
2716
+ component: SelectComponent,
2717
+ ...componentInfo$3
2718
+ }, {
2719
+ component: ImgComponent,
2161
2720
  ...componentInfo$1
2162
2721
  }, {
2163
2722
  component: Video,
2164
2723
  ...componentInfo
2724
+ }], getDefaultRegisteredComponents = () => [{
2725
+ component: Button,
2726
+ ...componentInfo$f
2727
+ }, {
2728
+ component: Columns,
2729
+ ...componentInfo$e
2730
+ }, {
2731
+ component: FragmentComponent,
2732
+ ...componentInfo$d
2733
+ }, {
2734
+ component: Image,
2735
+ ...componentInfo$c
2736
+ }, {
2737
+ component: SectionComponent,
2738
+ ...componentInfo$b
2165
2739
  }, {
2166
2740
  component: Slot,
2167
- ...componentInfo$3
2168
- }], UPDATE_COOKIES_AND_STYLES_SCRIPT = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
2741
+ ...componentInfo$a
2742
+ }, {
2743
+ component: Symbol$1,
2744
+ ...componentInfo$9
2745
+ }, {
2746
+ component: Text,
2747
+ ...componentInfo$8
2748
+ }, ...getExtraComponents()], UPDATE_COOKIES_AND_STYLES_SCRIPT = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
2169
2749
  function getAndSetVariantId() {
2170
2750
  function setCookie(name, value, days) {
2171
2751
  let expires = '';
@@ -2289,13 +2869,13 @@ function round(e) {
2289
2869
  const findParentElement = (e, t, n = !0) => {
2290
2870
  if (!(e instanceof HTMLElement))
2291
2871
  return null;
2292
- let i = n ? e : e.parentElement;
2872
+ let o = n ? e : e.parentElement;
2293
2873
  do {
2294
- if (!i)
2874
+ if (!o)
2295
2875
  return null;
2296
- if (t(i))
2297
- return i;
2298
- } while (i = i.parentElement);
2876
+ if (t(o))
2877
+ return o;
2878
+ } while (o = o.parentElement);
2299
2879
  return null;
2300
2880
  }, findBuilderParent = (e) => findParentElement(e, (t) => {
2301
2881
  const n = t.getAttribute("builder-id") || t.id;
@@ -2304,15 +2884,15 @@ const findParentElement = (e, t, n = !0) => {
2304
2884
  event: e,
2305
2885
  target: t
2306
2886
  }) => {
2307
- const n = t.getBoundingClientRect(), i = e.clientX - n.left, o = e.clientY - n.top, a = round(i / n.width), r = round(o / n.height);
2887
+ const n = t.getBoundingClientRect(), o = e.clientX - n.left, i = e.clientY - n.top, a = round(o / n.width), r = round(i / n.height);
2308
2888
  return {
2309
2889
  x: a,
2310
2890
  y: r
2311
2891
  };
2312
2892
  }, getInteractionPropertiesForEvent = (e) => {
2313
- const t = e.target, n = t && findBuilderParent(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
2893
+ const t = e.target, n = t && findBuilderParent(t), o = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
2314
2894
  return {
2315
- targetBuilderElement: i || void 0,
2895
+ targetBuilderElement: o || void 0,
2316
2896
  metadata: {
2317
2897
  targetOffset: t ? computeOffset({
2318
2898
  event: e,
@@ -2322,43 +2902,43 @@ const findParentElement = (e, t, n = !0) => {
2322
2902
  event: e,
2323
2903
  target: n
2324
2904
  }) : void 0,
2325
- builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
2905
+ builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
2326
2906
  }
2327
2907
  };
2328
2908
  };
2329
2909
  function EnableEditor(e) {
2330
- var j, P, B, N, F, V, $;
2331
- const t = useRef(null), [n, i] = useState(() => 0);
2910
+ var A, f, C, F, j, V, $;
2911
+ const t = useRef(null), [n, o] = useState(() => 0);
2332
2912
  useState(() => !0);
2333
- function o(u) {
2334
- var h, x;
2335
- const m = {
2913
+ function i(g) {
2914
+ var p, v;
2915
+ const h = {
2336
2916
  ...e.builderContextSignal.rootState,
2337
- ...u
2917
+ ...g
2338
2918
  };
2339
- e.builderContextSignal.rootSetState ? (x = (h = e.builderContextSignal).rootSetState) == null || x.call(h, m) : e.setBuilderContextSignal((C) => ({
2340
- ...C,
2341
- rootState: m
2919
+ e.builderContextSignal.rootSetState ? (v = (p = e.builderContextSignal).rootSetState) == null || v.call(p, h) : e.setBuilderContextSignal((T) => ({
2920
+ ...T,
2921
+ rootState: h
2342
2922
  }));
2343
2923
  }
2344
- function a(u) {
2345
- var h, x, C, T, A;
2346
- const m = {
2924
+ function a(g) {
2925
+ var p, v, T, P, N;
2926
+ const h = {
2347
2927
  ...e.builderContextSignal.content,
2348
- ...u,
2928
+ ...g,
2349
2929
  data: {
2350
- ...(h = e.builderContextSignal.content) == null ? void 0 : h.data,
2351
- ...u == null ? void 0 : u.data
2930
+ ...(p = e.builderContextSignal.content) == null ? void 0 : p.data,
2931
+ ...g == null ? void 0 : g.data
2352
2932
  },
2353
2933
  meta: {
2354
- ...(x = e.builderContextSignal.content) == null ? void 0 : x.meta,
2355
- ...u == null ? void 0 : u.meta,
2356
- breakpoints: ((C = u == null ? void 0 : u.meta) == null ? void 0 : C.breakpoints) || ((A = (T = e.builderContextSignal.content) == null ? void 0 : T.meta) == null ? void 0 : A.breakpoints)
2934
+ ...(v = e.builderContextSignal.content) == null ? void 0 : v.meta,
2935
+ ...g == null ? void 0 : g.meta,
2936
+ breakpoints: ((T = g == null ? void 0 : g.meta) == null ? void 0 : T.breakpoints) || ((N = (P = e.builderContextSignal.content) == null ? void 0 : P.meta) == null ? void 0 : N.breakpoints)
2357
2937
  }
2358
2938
  };
2359
- e.setBuilderContextSignal((_) => ({
2360
- ..._,
2361
- content: m
2939
+ e.setBuilderContextSignal((W) => ({
2940
+ ...W,
2941
+ content: h
2362
2942
  }));
2363
2943
  }
2364
2944
  useState(() => 0);
@@ -2367,62 +2947,62 @@ function EnableEditor(e) {
2367
2947
  ), [l, c] = useState(
2368
2948
  () => e.contentWrapper || "div"
2369
2949
  );
2370
- function d(u) {
2950
+ function u(g) {
2371
2951
  return createEditorListener({
2372
2952
  model: e.model,
2373
2953
  trustedHosts: e.trustedHosts,
2374
2954
  callbacks: {
2375
- configureSdk: (m) => {
2376
- var C;
2377
- const { breakpoints: h, contentId: x } = m;
2378
- !x || x !== ((C = e.builderContextSignal.content) == null ? void 0 : C.id) || h && (a({
2955
+ configureSdk: (h) => {
2956
+ var T;
2957
+ const { breakpoints: p, contentId: v } = h;
2958
+ !v || v !== ((T = e.builderContextSignal.content) == null ? void 0 : T.id) || p && (a({
2379
2959
  meta: {
2380
- breakpoints: h
2960
+ breakpoints: p
2381
2961
  }
2382
- }), i(n + 1));
2962
+ }), o(n + 1));
2383
2963
  },
2384
- animation: (m) => {
2385
- triggerAnimation(m);
2964
+ animation: (h) => {
2965
+ triggerAnimation(h);
2386
2966
  },
2387
- contentUpdate: (m) => {
2388
- a(m), i(n + 1);
2967
+ contentUpdate: (h) => {
2968
+ a(h), o(n + 1);
2389
2969
  }
2390
2970
  }
2391
- })(u);
2971
+ })(g);
2392
2972
  }
2393
- function b() {
2394
- var m, h;
2395
- const u = (h = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : h.jsCode;
2396
- u && evaluate({
2397
- code: u,
2973
+ function y() {
2974
+ var h, p;
2975
+ const g = (p = (h = e.builderContextSignal.content) == null ? void 0 : h.data) == null ? void 0 : p.jsCode;
2976
+ g && evaluate({
2977
+ code: g,
2398
2978
  context: e.context || {},
2399
2979
  localState: void 0,
2400
2980
  rootState: e.builderContextSignal.rootState,
2401
2981
  rootSetState: e.builderContextSignal.rootSetState
2402
2982
  });
2403
2983
  }
2404
- const [S, f] = useState(() => ({})), [g, y] = useState(() => !1);
2405
- function k(u) {
2406
- var m, h;
2984
+ const [x, d] = useState(() => ({})), [m, b] = useState(() => !1);
2985
+ function I(g) {
2986
+ var h, p;
2407
2987
  if (e.builderContextSignal.content) {
2408
- const x = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, C = (h = e.builderContextSignal.content) == null ? void 0 : h.id;
2988
+ const v = (h = e.builderContextSignal.content) == null ? void 0 : h.testVariationId, T = (p = e.builderContextSignal.content) == null ? void 0 : p.id;
2409
2989
  _track({
2410
2990
  type: "click",
2411
2991
  canTrack: getDefaultCanTrack(e.canTrack),
2412
- contentId: C,
2992
+ contentId: T,
2413
2993
  apiKey: e.apiKey,
2414
- variationId: x !== C ? x : void 0,
2415
- ...getInteractionPropertiesForEvent(u),
2416
- unique: !g
2994
+ variationId: v !== T ? v : void 0,
2995
+ ...getInteractionPropertiesForEvent(g),
2996
+ unique: !m
2417
2997
  });
2418
2998
  }
2419
- g || y(!0);
2999
+ m || b(!0);
2420
3000
  }
2421
- function E(u) {
2422
- return u.replace(
3001
+ function R(g) {
3002
+ return g.replace(
2423
3003
  /{{([^}]+)}}/g,
2424
- (m, h) => evaluate({
2425
- code: h,
3004
+ (h, p) => evaluate({
3005
+ code: p,
2426
3006
  context: e.context || {},
2427
3007
  localState: void 0,
2428
3008
  rootState: e.builderContextSignal.rootState,
@@ -2430,32 +3010,32 @@ function EnableEditor(e) {
2430
3010
  })
2431
3011
  );
2432
3012
  }
2433
- function p({ url: u, key: m }) {
2434
- fetch$1(u).then((h) => h.json()).then((h) => {
2435
- var C, T;
2436
- const x = {
3013
+ function S({ url: g, key: h }) {
3014
+ fetch$1(g).then((p) => p.json()).then((p) => {
3015
+ var T, P;
3016
+ const v = {
2437
3017
  ...e.builderContextSignal.rootState,
2438
- [m]: h
3018
+ [h]: p
2439
3019
  };
2440
- (T = (C = e.builderContextSignal).rootSetState) == null || T.call(C, x), S[m] = !0;
2441
- }).catch((h) => {
2442
- console.error("error fetching dynamic data", u, h);
3020
+ (P = (T = e.builderContextSignal).rootSetState) == null || P.call(T, v), x[h] = !0;
3021
+ }).catch((p) => {
3022
+ console.error("error fetching dynamic data", g, p);
2443
3023
  });
2444
3024
  }
2445
- function v() {
2446
- var m, h, x;
2447
- const u = (x = (h = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : h.httpRequests) != null ? x : {};
2448
- Object.entries(u).forEach(([C, T]) => {
2449
- if (T && (!S[C] || isEditing())) {
2450
- const A = E(T);
2451
- p({
2452
- url: A,
2453
- key: C
3025
+ function k() {
3026
+ var h, p, v;
3027
+ const g = (v = (p = (h = e.builderContextSignal.content) == null ? void 0 : h.data) == null ? void 0 : p.httpRequests) != null ? v : {};
3028
+ Object.entries(g).forEach(([T, P]) => {
3029
+ if (P && (!x[T] || isEditing())) {
3030
+ const N = R(P);
3031
+ S({
3032
+ url: N,
3033
+ key: T
2454
3034
  });
2455
3035
  }
2456
3036
  });
2457
3037
  }
2458
- function I() {
3038
+ function w() {
2459
3039
  isEditing() && window.dispatchEvent(
2460
3040
  new CustomEvent(
2461
3041
  "builder:component:stateChange",
@@ -2470,8 +3050,8 @@ function EnableEditor(e) {
2470
3050
  )
2471
3051
  );
2472
3052
  }
2473
- function w(u) {
2474
- i(n + 1), window.addEventListener("message", d), registerInsertMenu(), setupBrowserForEditing({
3053
+ function E(g) {
3054
+ o(n + 1), window.addEventListener("message", u), registerInsertMenu(), setupBrowserForEditing({
2475
3055
  ...e.locale ? {
2476
3056
  locale: e.locale
2477
3057
  } : {},
@@ -2486,62 +3066,62 @@ function EnableEditor(e) {
2486
3066
  } : {}
2487
3067
  }), Object.values(
2488
3068
  e.builderContextSignal.componentInfos
2489
- ).forEach((m) => {
2490
- var x;
2491
- const h = createRegisterComponentMessage(m);
2492
- (x = window.parent) == null || x.postMessage(h, "*");
3069
+ ).forEach((h) => {
3070
+ var v;
3071
+ const p = createRegisterComponentMessage(h);
3072
+ (v = window.parent) == null || v.postMessage(p, "*");
2493
3073
  }), window.addEventListener(
2494
3074
  "builder:component:stateChangeListenerActivated",
2495
- I
3075
+ w
2496
3076
  );
2497
3077
  }
2498
- function R(u) {
2499
- const m = new URL(location.href).searchParams, h = m.get("builder.preview"), x = m.get(
2500
- `builder.preview.${h}`
2501
- ), C = m.get("apiKey") || m.get("builder.space");
2502
- h === e.model && C === e.apiKey && (!e.content || x === e.content.id) && fetchOneEntry({
3078
+ function B(g) {
3079
+ const h = new URL(location.href).searchParams, p = h.get("builder.preview"), v = h.get(
3080
+ `builder.preview.${p}`
3081
+ ), T = h.get("apiKey") || h.get("builder.space");
3082
+ p === e.model && T === e.apiKey && (!e.content || v === e.content.id) && fetchOneEntry({
2503
3083
  model: e.model,
2504
3084
  apiKey: e.apiKey,
2505
3085
  apiVersion: e.builderContextSignal.apiVersion
2506
- }).then((T) => {
2507
- T && a(T);
3086
+ }).then((P) => {
3087
+ P && a(P);
2508
3088
  });
2509
3089
  }
2510
3090
  return useEffect(() => {
2511
- var u;
2512
- return (u = t.current) == null || u.addEventListener(
3091
+ var g;
3092
+ return (g = t.current) == null || g.addEventListener(
2513
3093
  "initeditingbldr",
2514
- w
3094
+ E
2515
3095
  ), () => {
2516
- var m;
2517
- return (m = t.current) == null ? void 0 : m.removeEventListener(
3096
+ var h;
3097
+ return (h = t.current) == null ? void 0 : h.removeEventListener(
2518
3098
  "initeditingbldr",
2519
- w
3099
+ E
2520
3100
  );
2521
3101
  };
2522
3102
  }, []), useEffect(() => {
2523
- var u;
2524
- return (u = t.current) == null || u.addEventListener(
3103
+ var g;
3104
+ return (g = t.current) == null || g.addEventListener(
2525
3105
  "initpreviewingbldr",
2526
- R
3106
+ B
2527
3107
  ), () => {
2528
- var m;
2529
- return (m = t.current) == null ? void 0 : m.removeEventListener(
3108
+ var h;
3109
+ return (h = t.current) == null ? void 0 : h.removeEventListener(
2530
3110
  "initpreviewingbldr",
2531
- R
3111
+ B
2532
3112
  );
2533
3113
  };
2534
3114
  }, []), useEffect(() => {
2535
- var u, m;
3115
+ var g, h;
2536
3116
  if (isBrowser()) {
2537
3117
  if (isEditing() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
2538
- const x = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId, C = (m = e.builderContextSignal.content) == null ? void 0 : m.id, T = e.apiKey;
3118
+ const v = (g = e.builderContextSignal.content) == null ? void 0 : g.testVariationId, T = (h = e.builderContextSignal.content) == null ? void 0 : h.id, P = e.apiKey;
2539
3119
  _track({
2540
3120
  type: "impression",
2541
3121
  canTrack: !0,
2542
- contentId: C,
2543
- apiKey: T,
2544
- variationId: x !== C ? x : void 0
3122
+ contentId: T,
3123
+ apiKey: P,
3124
+ variationId: v !== T ? v : void 0
2545
3125
  });
2546
3126
  }
2547
3127
  isPreviewing() && t.current && t.current.dispatchEvent(new CustomEvent("initpreviewingbldr"));
@@ -2549,34 +3129,34 @@ function EnableEditor(e) {
2549
3129
  }, []), useEffect(() => {
2550
3130
  e.apiKey || logger.error(
2551
3131
  "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
2552
- ), b(), v(), I();
3132
+ ), y(), k(), w();
2553
3133
  }, []), useEffect(() => {
2554
3134
  e.content && a(e.content);
2555
3135
  }, [e.content]), useEffect(() => {
2556
3136
  }, [r]), useEffect(() => {
2557
- b();
2558
- }, [(P = (j = e.builderContextSignal.content) == null ? void 0 : j.data) == null ? void 0 : P.jsCode]), useEffect(() => {
2559
- v();
2560
- }, [(N = (B = e.builderContextSignal.content) == null ? void 0 : B.data) == null ? void 0 : N.httpRequests]), useEffect(() => {
2561
- I();
3137
+ y();
3138
+ }, [(f = (A = e.builderContextSignal.content) == null ? void 0 : A.data) == null ? void 0 : f.jsCode]), useEffect(() => {
3139
+ k();
3140
+ }, [(F = (C = e.builderContextSignal.content) == null ? void 0 : C.data) == null ? void 0 : F.httpRequests]), useEffect(() => {
3141
+ w();
2562
3142
  }, [e.builderContextSignal.rootState]), useEffect(() => {
2563
- e.data && o(e.data);
3143
+ e.data && i(e.data);
2564
3144
  }, [e.data]), useEffect(() => {
2565
- e.locale && o({
3145
+ e.locale && i({
2566
3146
  locale: e.locale
2567
3147
  });
2568
3148
  }, [e.locale]), useEffect(() => () => {
2569
- isBrowser() && (window.removeEventListener("message", d), window.removeEventListener(
3149
+ isBrowser() && (window.removeEventListener("message", u), window.removeEventListener(
2570
3150
  "builder:component:stateChangeListenerActivated",
2571
- I
3151
+ w
2572
3152
  ));
2573
3153
  }, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ createElement(
2574
3154
  l,
2575
3155
  {
2576
3156
  key: n,
2577
3157
  ref: t,
2578
- onClick: (u) => k(u),
2579
- "builder-content-id": (F = e.builderContextSignal.content) == null ? void 0 : F.id,
3158
+ onClick: (g) => I(g),
3159
+ "builder-content-id": (j = e.builderContextSignal.content) == null ? void 0 : j.id,
2580
3160
  "builder-model": e.model,
2581
3161
  ...e.showContent ? {} : {
2582
3162
  hidden: !0,
@@ -2590,12 +3170,12 @@ function EnableEditor(e) {
2590
3170
  }
2591
3171
  const getCssFromFont = (e) => {
2592
3172
  var a, r;
2593
- const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = (r = e.fileUrl) != null ? r : (a = e == null ? void 0 : e.files) == null ? void 0 : a.regular;
2594
- let o = "";
2595
- if (i && t && n && (o += `
3173
+ const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], o = (r = e.fileUrl) != null ? r : (a = e == null ? void 0 : e.files) == null ? void 0 : a.regular;
3174
+ let i = "";
3175
+ if (o && t && n && (i += `
2596
3176
  @font-face {
2597
3177
  font-family: "${t}";
2598
- src: local("${n}"), url('${i}') format('woff2');
3178
+ src: local("${n}"), url('${o}') format('woff2');
2599
3179
  font-display: fallback;
2600
3180
  font-weight: 400;
2601
3181
  }
@@ -2604,7 +3184,7 @@ font-weight: 400;
2604
3184
  if (!(String(Number(s)) === s))
2605
3185
  continue;
2606
3186
  const c = e.files[s];
2607
- c && c !== i && (o += `
3187
+ c && c !== o && (i += `
2608
3188
  @font-face {
2609
3189
  font-family: "${t}";
2610
3190
  src: url('${c}') format('woff2');
@@ -2613,7 +3193,7 @@ font-weight: ${s};
2613
3193
  }
2614
3194
  `.trim());
2615
3195
  }
2616
- return o;
3196
+ return i;
2617
3197
  }, getFontCss = ({
2618
3198
  customFonts: e
2619
3199
  }) => {
@@ -2660,12 +3240,12 @@ const getRootStateInitialValue = ({
2660
3240
  locale: n
2661
3241
  }) => {
2662
3242
  var a, r, s;
2663
- const i = {}, o = ((a = e == null ? void 0 : e.data) == null ? void 0 : a.state) || {};
3243
+ const o = {}, i = ((a = e == null ? void 0 : e.data) == null ? void 0 : a.state) || {};
2664
3244
  return (s = (r = e == null ? void 0 : e.data) == null ? void 0 : r.inputs) == null || s.forEach((l) => {
2665
- l.name && l.defaultValue !== void 0 && (i[l.name] = l.defaultValue);
3245
+ l.name && l.defaultValue !== void 0 && (o[l.name] = l.defaultValue);
2666
3246
  }), {
2667
- ...i,
2668
3247
  ...o,
3248
+ ...i,
2669
3249
  ...t,
2670
3250
  ...n ? {
2671
3251
  locale: n
@@ -2683,25 +3263,25 @@ const getRootStateInitialValue = ({
2683
3263
  meta: e == null ? void 0 : e.meta
2684
3264
  } : void 0;
2685
3265
  function ContentComponent(e) {
2686
- var l, c, d, b, S, f, g;
3266
+ var l, c, u, y, x, d, m;
2687
3267
  const [t, n] = useState(
2688
3268
  () => {
2689
- var y, k;
3269
+ var b, I;
2690
3270
  return getUpdateVariantVisibilityScript({
2691
3271
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2692
- variationId: (y = e.content) == null ? void 0 : y.testVariationId,
3272
+ variationId: (b = e.content) == null ? void 0 : b.testVariationId,
2693
3273
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2694
- contentId: (k = e.content) == null ? void 0 : k.id
3274
+ contentId: (I = e.content) == null ? void 0 : I.id
2695
3275
  });
2696
3276
  }
2697
3277
  );
2698
- function i(y) {
2699
- s((k) => ({
2700
- ...k,
2701
- rootState: y
3278
+ function o(b) {
3279
+ s((I) => ({
3280
+ ...I,
3281
+ rootState: b
2702
3282
  }));
2703
3283
  }
2704
- const [o, a] = useState(
3284
+ const [i, a] = useState(
2705
3285
  () => [
2706
3286
  ...getDefaultRegisteredComponents(),
2707
3287
  // While this `components` object is deprecated, we must maintain support for it.
@@ -2712,11 +3292,11 @@ function ContentComponent(e) {
2712
3292
  ...components,
2713
3293
  ...e.customComponents || []
2714
3294
  ].reduce(
2715
- (y, { component: k, ...E }) => ({
2716
- ...y,
2717
- [E.name]: {
2718
- component: k,
2719
- ...serializeComponentInfo(E)
3295
+ (b, { component: I, ...R }) => ({
3296
+ ...b,
3297
+ [R.name]: {
3298
+ component: I,
3299
+ ...serializeComponentInfo(R)
2720
3300
  }
2721
3301
  }),
2722
3302
  {}
@@ -2732,7 +3312,7 @@ function ContentComponent(e) {
2732
3312
  data: e.data,
2733
3313
  locale: e.locale
2734
3314
  }),
2735
- rootSetState: i,
3315
+ rootSetState: o,
2736
3316
  context: e.context || {},
2737
3317
  apiKey: e.apiKey,
2738
3318
  apiVersion: e.apiVersion,
@@ -2746,9 +3326,9 @@ function ContentComponent(e) {
2746
3326
  ...components,
2747
3327
  ...e.customComponents || []
2748
3328
  ].reduce(
2749
- (y, { component: k, ...E }) => ({
2750
- ...y,
2751
- [E.name]: serializeComponentInfo(E)
3329
+ (b, { component: I, ...R }) => ({
3330
+ ...b,
3331
+ [R.name]: serializeComponentInfo(R)
2752
3332
  }),
2753
3333
  {}
2754
3334
  ),
@@ -2760,7 +3340,7 @@ function ContentComponent(e) {
2760
3340
  ComponentsContext.Provider,
2761
3341
  {
2762
3342
  value: {
2763
- registeredComponents: o
3343
+ registeredComponents: i
2764
3344
  },
2765
3345
  children: /* @__PURE__ */ jsxs(
2766
3346
  EnableEditor,
@@ -2787,16 +3367,16 @@ function ContentComponent(e) {
2787
3367
  ContentStyles,
2788
3368
  {
2789
3369
  contentId: (l = r.content) == null ? void 0 : l.id,
2790
- cssCode: (d = (c = r.content) == null ? void 0 : c.data) == null ? void 0 : d.cssCode,
2791
- customFonts: (S = (b = r.content) == null ? void 0 : b.data) == null ? void 0 : S.customFonts
3370
+ cssCode: (u = (c = r.content) == null ? void 0 : c.data) == null ? void 0 : u.cssCode,
3371
+ customFonts: (x = (y = r.content) == null ? void 0 : y.data) == null ? void 0 : x.customFonts
2792
3372
  }
2793
3373
  ) }),
2794
3374
  /* @__PURE__ */ jsx(
2795
3375
  Blocks,
2796
3376
  {
2797
- blocks: (g = (f = r.content) == null ? void 0 : f.data) == null ? void 0 : g.blocks,
3377
+ blocks: (m = (d = r.content) == null ? void 0 : d.data) == null ? void 0 : m.blocks,
2798
3378
  context: r,
2799
- registeredComponents: o,
3379
+ registeredComponents: i,
2800
3380
  linkComponent: e.linkComponent
2801
3381
  }
2802
3382
  )
@@ -2814,7 +3394,7 @@ function ContentVariants(e) {
2814
3394
  content: e.content
2815
3395
  })
2816
3396
  );
2817
- function i() {
3397
+ function o() {
2818
3398
  var l;
2819
3399
  return getUpdateCookieAndStylesScript(
2820
3400
  getVariants(e.content).map((c) => ({
@@ -2824,7 +3404,7 @@ function ContentVariants(e) {
2824
3404
  ((l = e.content) == null ? void 0 : l.id) || ""
2825
3405
  );
2826
3406
  }
2827
- function o() {
3407
+ function i() {
2828
3408
  return getVariants(e.content).map((l) => `.variant-${l.testVariationId} { display: none; } `).join("");
2829
3409
  }
2830
3410
  function a() {
@@ -2845,10 +3425,10 @@ function ContentVariants(e) {
2845
3425
  InlinedStyles,
2846
3426
  {
2847
3427
  id: `variants-styles-${(r = e.content) == null ? void 0 : r.id}`,
2848
- styles: o()
3428
+ styles: i()
2849
3429
  }
2850
3430
  ),
2851
- /* @__PURE__ */ jsx(InlinedScript, { scriptStr: i() }),
3431
+ /* @__PURE__ */ jsx(InlinedScript, { scriptStr: o() }),
2852
3432
  (s = getVariants(e.content)) == null ? void 0 : s.map((l) => /* @__PURE__ */ jsx(
2853
3433
  ContentComponent,
2854
3434
  {
@@ -2923,29 +3503,29 @@ const fetchSymbolContent = async ({
2923
3503
  function Symbol$1(e) {
2924
3504
  var a, r, s, l;
2925
3505
  function t() {
2926
- var c, d;
3506
+ var c, u;
2927
3507
  return [
2928
3508
  e.attributes[getClassPropName()],
2929
3509
  "builder-symbol",
2930
3510
  (c = e.symbol) != null && c.inline ? "builder-inline-symbol" : void 0,
2931
- (d = e.symbol) != null && d.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
3511
+ (u = e.symbol) != null && u.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2932
3512
  ].filter(Boolean).join(" ");
2933
3513
  }
2934
- const [n, i] = useState(() => {
3514
+ const [n, o] = useState(() => {
2935
3515
  var c;
2936
3516
  return (c = e.symbol) == null ? void 0 : c.content;
2937
3517
  });
2938
- function o() {
3518
+ function i() {
2939
3519
  n || fetchSymbolContent({
2940
3520
  symbol: e.symbol,
2941
3521
  builderContextValue: e.builderContext
2942
3522
  }).then((c) => {
2943
- c && i(c);
3523
+ c && o(c);
2944
3524
  });
2945
3525
  }
2946
3526
  return useEffect(() => {
2947
3527
  }, []), useEffect(() => {
2948
- o();
3528
+ i();
2949
3529
  }, [e.symbol]), /* @__PURE__ */ jsx("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ jsx(
2950
3530
  ContentVariants,
2951
3531
  {
@@ -2985,14 +3565,14 @@ export {
2985
3565
  H as _processContentResult,
2986
3566
  createRegisterComponentMessage,
2987
3567
  K as fetchBuilderProps,
2988
- z as fetchEntries,
3568
+ q as fetchEntries,
2989
3569
  fetchOneEntry,
2990
- q as getAllContent,
2991
- Y as getBuilderSearchParams,
2992
- G as getContent,
3570
+ z as getAllContent,
3571
+ J as getBuilderSearchParams,
3572
+ Y as getContent,
2993
3573
  isEditing,
2994
3574
  isPreviewing,
2995
- J as register,
3575
+ G as register,
2996
3576
  Q as setEditorSettings,
2997
3577
  X as subscribeToEditor,
2998
3578
  Z as track