@builder.io/sdk-react 1.0.20 → 1.0.21

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 (60) hide show
  1. package/lib/browser/blocks-exports.cjs +1 -1
  2. package/lib/browser/blocks-exports.mjs +1 -1
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +1 -1
  5. package/lib/browser/init.cjs +1 -0
  6. package/lib/browser/init.mjs +13 -0
  7. package/lib/browser/{server-entry-a562cf23.js → server-entry-166d8ec9.js} +1 -1
  8. package/lib/browser/{server-entry-a77461d4.cjs → server-entry-c6e9a10a.cjs} +1 -1
  9. package/lib/browser/server-entry.cjs +1 -1
  10. package/lib/browser/server-entry.mjs +1 -1
  11. package/lib/edge/{blocks-683aad9f.js → blocks-793a81d9.js} +36 -37
  12. package/lib/edge/{blocks-523eb4f1.cjs → blocks-c26b2ffc.cjs} +5 -5
  13. package/lib/edge/blocks-exports.cjs +1 -1
  14. package/lib/edge/blocks-exports.mjs +2 -2
  15. package/lib/edge/{button-9f6acf3e.js → button-659db379.js} +2 -2
  16. package/lib/edge/{button-0d418bcf.cjs → button-f62c1e15.cjs} +1 -1
  17. package/lib/edge/{columns-b0785992.js → columns-07ef2925.js} +3 -3
  18. package/lib/edge/{columns-1613d62d.cjs → columns-5fe66f05.cjs} +1 -1
  19. package/lib/edge/{content-variants-281298f6.cjs → content-variants-9aedb66d.cjs} +1 -1
  20. package/lib/edge/{content-variants-13f821c6.js → content-variants-fcba4b5b.js} +8 -8
  21. package/lib/edge/{form-0483aa64.cjs → form-5c293cd8.cjs} +1 -1
  22. package/lib/edge/{form-db27fc26.js → form-82e6d435.js} +3 -3
  23. package/lib/edge/{get-class-prop-name-6bfc4756.js → get-class-prop-name-6242df6a.js} +1 -1
  24. package/lib/edge/{get-class-prop-name-e3ba0522.cjs → get-class-prop-name-c54d7ada.cjs} +1 -1
  25. package/lib/edge/{img-43a8ffe0.js → img-11c91db6.js} +1 -1
  26. package/lib/edge/{img-f01d904d.cjs → img-73cc7d69.cjs} +1 -1
  27. package/lib/edge/index.cjs +1 -1
  28. package/lib/edge/index.mjs +1 -1
  29. package/lib/edge/init.cjs +1 -0
  30. package/lib/edge/init.mjs +13 -0
  31. package/lib/edge/{input-805a9ac6.js → input-6b8ac645.js} +1 -1
  32. package/lib/edge/{input-e6483bd7.cjs → input-9c7d1291.cjs} +1 -1
  33. package/lib/edge/{select-e5d1e627.cjs → select-42de6b22.cjs} +1 -1
  34. package/lib/edge/{select-4966723f.js → select-f324140d.js} +1 -1
  35. package/lib/edge/{server-entry-c13e82bd.js → server-entry-396b1a7b.js} +1 -1
  36. package/lib/edge/{server-entry-83648311.cjs → server-entry-bc7f82dd.cjs} +1 -1
  37. package/lib/edge/server-entry.cjs +1 -1
  38. package/lib/edge/server-entry.mjs +1 -1
  39. package/lib/edge/{slot-1b0351de.js → slot-4e55a3d1.js} +3 -3
  40. package/lib/edge/{slot-3ef77ae1.cjs → slot-746347ff.cjs} +1 -1
  41. package/lib/edge/{symbol-883d624f.cjs → symbol-4b8cffaa.cjs} +1 -1
  42. package/lib/edge/{symbol-f1632f93.js → symbol-e3905b86.js} +2 -2
  43. package/lib/node/blocks-exports.cjs +30 -70
  44. package/lib/node/blocks-exports.mjs +891 -1017
  45. package/lib/node/index.cjs +1 -1
  46. package/lib/node/index.mjs +23 -22
  47. package/lib/node/init.cjs +1 -0
  48. package/lib/node/init.mjs +9 -0
  49. package/lib/node/node-runtime-2a838da2.cjs +48 -0
  50. package/lib/node/node-runtime-eb3ca94b.js +155 -0
  51. package/lib/node/{server-entry-8c712c9b.js → server-entry-54c1491b.js} +2 -1
  52. package/lib/node/{server-entry-bedf45f8.cjs → server-entry-cb0df432.cjs} +2 -2
  53. package/lib/node/server-entry.cjs +1 -1
  54. package/lib/node/server-entry.mjs +1 -1
  55. package/package.json +6 -1
  56. package/types/constants/sdk-version.d.ts +1 -1
  57. package/types/functions/evaluate/node-runtime/init.d.ts +10 -0
  58. package/types/functions/evaluate/node-runtime/node-runtime.d.ts +6 -0
  59. package/types/functions/get-content/types.d.ts +3 -3
  60. package/types/helpers/logger.d.ts +1 -0
@@ -1,16 +1,17 @@
1
1
  "use client";
2
- var N = Object.defineProperty;
3
- var $ = (e, t, n) => t in e ? N(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
- var F = (e, t, n) => ($(e, typeof t != "symbol" ? t + "" : t, n), n);
5
- import { jsx, Fragment, jsxs } from "react/jsx-runtime";
6
- import { TARGET, isEditing, isBrowser, getUserAttributes, fastClone, checkIsDefined, logger, registerInsertMenu, setupBrowserForEditing, createRegisterComponentMessage, getDefaultCanTrack, _track, isPreviewing, fetchOneEntry, createEditorListener, fetch as fetch$1, serializeComponentInfo, handleABTestingSync } from "./server-entry-8c712c9b.js";
7
- import { createContext, useState, useEffect, useContext, useRef, createElement } from "react";
8
- 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());
9
- function DynamicRenderer(e) {
10
- return /* @__PURE__ */ jsx(Fragment, { children: isEmptyElement(e.TagName) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ jsx(Fragment, { children: typeof e.TagName == "string" ? /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
11
- }
12
- const getClassPropName = () => {
13
- switch (TARGET) {
2
+ var Le = Object.defineProperty;
3
+ var De = (e, t, n) => t in e ? Le(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
+ var ee = (e, t, n) => (De(e, typeof t != "symbol" ? t + "" : t, n), n);
5
+ import { jsx as s, Fragment as T, jsxs as B } from "react/jsx-runtime";
6
+ import { TARGET as q, checkIsDefined as J, logger as U, isBrowser as Y, fastClone as oe, isEditing as F, registerInsertMenu as Me, setupBrowserForEditing as je, createRegisterComponentMessage as Oe, getDefaultCanTrack as G, _track as ue, isPreviewing as Ue, fetchOneEntry as ve, createEditorListener as He, fetch as Ke, serializeComponentInfo as me, handleABTestingSync as qe } from "./server-entry-54c1491b.js";
7
+ import { createContext as ke, useState as k, useEffect as V, useContext as fe, useRef as X, createElement as Ce } from "react";
8
+ import { getFunctionArguments as _e, runInNode as ze, parseCode as Je, getBuilderGlobals as Ye, set as we } from "./node-runtime-eb3ca94b.js";
9
+ const Ge = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), Qe = (e) => typeof e == "string" && Ge.has(e.toLowerCase());
10
+ function ae(e) {
11
+ return /* @__PURE__ */ s(T, { children: Qe(e.TagName) ? /* @__PURE__ */ s(T, { children: /* @__PURE__ */ s(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ s(T, { children: typeof e.TagName == "string" ? /* @__PURE__ */ s(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ s(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
12
+ }
13
+ const H = () => {
14
+ switch (q) {
14
15
  case "react":
15
16
  case "reactNative":
16
17
  case "rsc":
@@ -22,13 +23,13 @@ const getClassPropName = () => {
22
23
  return "class";
23
24
  }
24
25
  };
25
- function Button(e) {
26
- return /* @__PURE__ */ jsx(
27
- DynamicRenderer,
26
+ function Xe(e) {
27
+ return /* @__PURE__ */ s(
28
+ ae,
28
29
  {
29
30
  attributes: {
30
31
  ...e.attributes,
31
- [getClassPropName()]: `${e.link ? "" : "builder-button"} ${e.attributes[getClassPropName()] || ""}`,
32
+ [H()]: `${e.link ? "" : "builder-button"} ${e.attributes[H()] || ""}`,
32
33
  ...e.link ? {
33
34
  href: e.link,
34
35
  target: e.openLinkInNewTab ? "_blank" : void 0,
@@ -43,7 +44,7 @@ function Button(e) {
43
44
  }
44
45
  );
45
46
  }
46
- const builderContext = createContext({
47
+ const re = ke({
47
48
  content: null,
48
49
  context: {},
49
50
  localState: void 0,
@@ -56,8 +57,8 @@ const builderContext = createContext({
56
57
  inheritedStyles: {},
57
58
  BlocksWrapper: "div",
58
59
  BlocksWrapperProps: {}
59
- }), ComponentsContext = createContext({ registeredComponents: {} });
60
- function getBlockComponentOptions(e) {
60
+ }), Ie = ke({ registeredComponents: {} });
61
+ function Ze(e) {
61
62
  var t;
62
63
  return {
63
64
  ...(t = e.component) == null ? void 0 : t.options,
@@ -68,47 +69,28 @@ function getBlockComponentOptions(e) {
68
69
  builderBlock: e
69
70
  };
70
71
  }
71
- const getFunctionArguments = ({
72
- builder: e,
73
- context: t,
74
- event: n,
75
- state: i
76
- }) => Object.entries({
77
- state: i,
78
- Builder: e,
79
- // legacy
80
- builder: e,
81
- context: t,
82
- event: n
83
- }), getBuilderGlobals = () => ({
84
- isEditing: isEditing(),
85
- isBrowser: isBrowser(),
86
- isServer: !isBrowser(),
87
- getUserAttributes: () => getUserAttributes()
88
- }), parseCode = (e, {
89
- isExpression: t = !0
90
- }) => /* we disable this for cases where we definitely don't want a return */ t && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e, runInBrowser = ({
72
+ const et = ({
91
73
  code: e,
92
74
  builder: t,
93
75
  context: n,
94
76
  event: i,
95
77
  localState: o,
96
- rootSetState: a,
97
- rootState: r
78
+ rootSetState: r,
79
+ rootState: a
98
80
  }) => {
99
- const s = getFunctionArguments({
81
+ const l = _e({
100
82
  builder: t,
101
83
  context: n,
102
84
  event: i,
103
- state: flattenState({
104
- rootState: r,
85
+ state: Te({
86
+ rootState: a,
105
87
  localState: o,
106
- rootSetState: a
88
+ rootSetState: r
107
89
  })
108
90
  });
109
- return new Function(...s.map(([c]) => c), e)(...s.map(([, c]) => c));
91
+ return new Function(...l.map(([d]) => d), e)(...l.map(([, d]) => d));
110
92
  };
111
- function flattenState({
93
+ function Te({
112
94
  rootState: e,
113
95
  localState: t,
114
96
  rootSetState: n
@@ -117,138 +99,33 @@ function flattenState({
117
99
  get: (i, o) => {
118
100
  if (t && o in t)
119
101
  return t[o];
120
- const a = i[o];
121
- return typeof a == "object" && a !== null ? flattenState({
122
- rootState: a,
102
+ const r = i[o];
103
+ return typeof r == "object" && r !== null ? Te({
104
+ rootState: r,
123
105
  localState: void 0,
124
- rootSetState: n ? (r) => {
125
- i[o] = r, n(i);
106
+ rootSetState: n ? (a) => {
107
+ i[o] = a, n(i);
126
108
  } : void 0
127
- }) : a;
109
+ }) : r;
128
110
  },
129
- set: (i, o, a) => {
111
+ set: (i, o, r) => {
130
112
  if (t && o in t)
131
113
  throw new Error("Writing to local state is not allowed as it is read-only.");
132
- return i[o] = a, n == null || n(i), !0;
114
+ return i[o] = r, n == null || n(i), !0;
133
115
  }
134
116
  });
135
117
  }
136
- const set = (e, t, n) => {
137
- if (Object(e) !== e)
138
- return e;
139
- const i = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
140
- 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;
141
- }, noop = () => {
142
- };
143
- let safeDynamicRequire = noop;
144
- try {
145
- safeDynamicRequire = eval("require");
146
- } catch (e) {
147
- }
148
- const getSyncValName = (e) => `bldr_${e}_sync`, BUILDER_SET_STATE_NAME = "BUILDER_SET_STATE", INJECTED_IVM_GLOBAL = "BUILDER_IVM", REF_TO_PROXY_FN = `
149
- var refToProxy = (obj) => {
150
- if (typeof obj !== 'object' || obj === null) {
151
- return obj;
152
- }
153
- return new Proxy({}, {
154
- get(target, key) {
155
- if (key === 'copySync') {
156
- return () => obj.copySync();
157
- }
158
- const val = obj.getSync(key);
159
- if (typeof val?.getSync === 'function') {
160
- return refToProxy(val);
161
- }
162
- return val;
163
- },
164
- set(target, key, value) {
165
- const v = typeof value === 'object' ? new ${INJECTED_IVM_GLOBAL}.Reference(value) : value;
166
- obj.setSync(key, v);
167
- ${BUILDER_SET_STATE_NAME}(key, value)
168
- },
169
- deleteProperty(target, key) {
170
- obj.deleteSync(key);
171
- }
172
- })
173
- }
174
- `, processCode = ({
175
- code: e,
176
- args: t
177
- }) => {
178
- const n = t.map(([i]) => `var ${i} = refToProxy(${getSyncValName(i)}); `).join("");
179
- return `
180
- ${REF_TO_PROXY_FN}
181
- ${n}
182
- function theFunction() {
183
- ${e}
184
- }
185
-
186
- let output = theFunction()
187
-
188
- if (typeof output === 'object' && output !== null) {
189
- output = JSON.stringify(output.copySync ? output.copySync() : output);
190
- }
191
-
192
- output;
193
- `;
194
- }, getIsolateContext = () => {
195
- const e = safeDynamicRequire("isolated-vm");
196
- return new e.Isolate({
197
- memoryLimit: 128
198
- }).createContextSync();
199
- }, runInNode = ({
200
- code: e,
201
- builder: t,
202
- context: n,
203
- event: i,
204
- localState: o,
205
- rootSetState: a,
206
- rootState: r
207
- }) => {
208
- const s = safeDynamicRequire("isolated-vm"), c = fastClone({
209
- ...r,
210
- ...o
211
- }), l = getFunctionArguments({
212
- builder: t,
213
- context: n,
214
- event: i,
215
- state: c
216
- }), u = getIsolateContext(), m = u.global;
217
- m.setSync("global", m.derefInto()), m.setSync("log", function(...y) {
218
- console.log(...y);
219
- }), m.setSync(BUILDER_SET_STATE_NAME, function(y, p) {
220
- set(r, y, p), a == null || a(r);
221
- }), l.forEach(([y, p]) => {
222
- const k = typeof p == "object" ? new s.Reference(
223
- // workaround: methods with default values for arguments is not being cloned over
224
- y === "builder" ? {
225
- ...p,
226
- getUserAttributes: () => p.getUserAttributes()
227
- } : p
228
- ) : null;
229
- m.setSync(getSyncValName(y), k);
230
- }), m.setSync(INJECTED_IVM_GLOBAL, s);
231
- const g = processCode({
232
- code: e,
233
- args: l
234
- }), h = u.evalSync(g);
235
- try {
236
- return JSON.parse(h);
237
- } catch {
238
- return h;
239
- }
240
- };
241
- function isNodeRuntime() {
118
+ function tt() {
242
119
  var e;
243
- return typeof process != "undefined" && checkIsDefined((e = process == null ? void 0 : process.versions) == null ? void 0 : e.node);
120
+ return typeof process != "undefined" && J((e = process == null ? void 0 : process.versions) == null ? void 0 : e.node);
244
121
  }
245
- const shouldForceBrowserRuntimeInNode = () => {
122
+ const nt = () => {
246
123
  var i;
247
- if (!isNodeRuntime())
124
+ if (!tt())
248
125
  return !1;
249
126
  const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (i = process.env.NODE_OPTIONS) == null ? void 0 : i.includes("--no-node-snapshot");
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
- }, chooseBrowserOrServerEval = (e) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(e) : runInNode(e), P = class P {
127
+ return e && t && !n ? (U.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;
128
+ }, it = (e) => Y() || nt() ? et(e) : ze(e), A = class A {
252
129
  static getCacheKey(t) {
253
130
  return JSON.stringify({
254
131
  ...t,
@@ -258,64 +135,61 @@ const shouldForceBrowserRuntimeInNode = () => {
258
135
  });
259
136
  }
260
137
  static getCachedValue(t) {
261
- return P.cache.get(t);
138
+ return A.cache.get(t);
262
139
  }
263
140
  static setCachedValue(t, n) {
264
- P.cache.size > 20 && P.cache.delete(P.cache.keys().next().value), P.cache.set(t, {
141
+ A.cache.size > 20 && A.cache.delete(A.cache.keys().next().value), A.cache.set(t, {
265
142
  value: n
266
143
  });
267
144
  }
268
145
  };
269
- F(P, "cacheLimit", 20), F(P, "cache", /* @__PURE__ */ new Map());
270
- let EvalCache = P;
271
- function evaluate({
146
+ ee(A, "cacheLimit", 20), ee(A, "cache", /* @__PURE__ */ new Map());
147
+ let j = A;
148
+ function K({
272
149
  code: e,
273
150
  context: t,
274
151
  localState: n,
275
152
  rootState: i,
276
153
  rootSetState: o,
277
- event: a,
278
- isExpression: r = !0,
279
- enableCache: s
154
+ event: r,
155
+ isExpression: a = !0,
156
+ enableCache: l
280
157
  }) {
281
158
  if (e === "") {
282
- logger.warn("Skipping evaluation of empty code block.");
159
+ U.warn("Skipping evaluation of empty code block.");
283
160
  return;
284
161
  }
285
- const c = {
286
- code: parseCode(e, {
287
- isExpression: r
162
+ const d = {
163
+ code: Je(e, {
164
+ isExpression: a
288
165
  }),
289
- builder: getBuilderGlobals(),
166
+ builder: Ye(),
290
167
  context: t,
291
- event: a,
168
+ event: r,
292
169
  rootSetState: o,
293
170
  rootState: i,
294
171
  localState: n
295
172
  };
296
- if (s) {
297
- const l = EvalCache.getCacheKey(c), u = EvalCache.getCachedValue(l);
298
- if (u)
299
- return u.value;
173
+ if (l) {
174
+ const c = j.getCacheKey(d), m = j.getCachedValue(c);
175
+ if (m)
176
+ return m.value;
300
177
  }
301
178
  try {
302
- const l = chooseBrowserOrServerEval(c);
303
- if (s) {
304
- const u = EvalCache.getCacheKey(c);
305
- EvalCache.setCachedValue(u, l);
179
+ const c = it(d);
180
+ if (l) {
181
+ const m = j.getCacheKey(d);
182
+ j.setCachedValue(m, c);
306
183
  }
307
- return l;
308
- } catch (l) {
309
- logger.error("Failed code evaluation: " + l.message, {
184
+ return c;
185
+ } catch (c) {
186
+ U.error("Failed code evaluation: " + c.message, {
310
187
  code: e
311
188
  });
312
189
  return;
313
190
  }
314
191
  }
315
- function transformBlock(e) {
316
- return e;
317
- }
318
- const evaluateBindings = ({
192
+ const ot = ({
319
193
  block: e,
320
194
  context: t,
321
195
  localState: n,
@@ -324,202 +198,202 @@ const evaluateBindings = ({
324
198
  }) => {
325
199
  if (!e.bindings)
326
200
  return e;
327
- const a = fastClone(e), r = {
328
- ...a,
201
+ const r = oe(e), a = {
202
+ ...r,
329
203
  properties: {
330
- ...a.properties
204
+ ...r.properties
331
205
  },
332
206
  actions: {
333
- ...a.actions
207
+ ...r.actions
334
208
  }
335
209
  };
336
- for (const s in e.bindings) {
337
- const c = e.bindings[s], l = evaluate({
338
- code: c,
210
+ for (const l in e.bindings) {
211
+ const d = e.bindings[l], c = K({
212
+ code: d,
339
213
  localState: n,
340
214
  rootState: i,
341
215
  rootSetState: o,
342
216
  context: t,
343
217
  enableCache: !0
344
218
  });
345
- set(r, s, l);
219
+ we(a, l, c);
346
220
  }
347
- return r;
221
+ return a;
348
222
  };
349
- function getProcessedBlock({
223
+ function Q({
350
224
  block: e,
351
225
  context: t,
352
226
  shouldEvaluateBindings: n,
353
227
  localState: i,
354
228
  rootState: o,
355
- rootSetState: a
229
+ rootSetState: r
356
230
  }) {
357
- const r = e;
358
- return n ? evaluateBindings({
359
- block: r,
231
+ const a = e;
232
+ return n ? ot({
233
+ block: a,
360
234
  localState: i,
361
235
  rootState: o,
362
- rootSetState: a,
236
+ rootSetState: r,
363
237
  context: t
364
- }) : r;
238
+ }) : a;
365
239
  }
366
- function throttle(e, t, n = {}) {
367
- let i, o, a, r = null, s = 0;
368
- const c = function() {
369
- s = n.leading === !1 ? 0 : Date.now(), r = null, a = e.apply(i, o), r || (i = o = null);
240
+ function at(e, t, n = {}) {
241
+ let i, o, r, a = null, l = 0;
242
+ const d = function() {
243
+ l = n.leading === !1 ? 0 : Date.now(), a = null, r = e.apply(i, o), a || (i = o = null);
370
244
  };
371
245
  return function() {
372
- const l = Date.now();
373
- !s && n.leading === !1 && (s = l);
374
- const u = t - (l - s);
375
- return i = this, o = arguments, u <= 0 || u > t ? (r && (clearTimeout(r), r = null), s = l, a = e.apply(i, o), r || (i = o = null)) : !r && n.trailing !== !1 && (r = setTimeout(c, u)), a;
246
+ const c = Date.now();
247
+ !l && n.leading === !1 && (l = c);
248
+ const m = t - (c - l);
249
+ return i = this, o = arguments, m <= 0 || m > t ? (a && (clearTimeout(a), a = null), l = c, r = e.apply(i, o), a || (i = o = null)) : !a && n.trailing !== !1 && (a = setTimeout(d, m)), r;
376
250
  };
377
251
  }
378
- function assign(e, ...t) {
252
+ function D(e, ...t) {
379
253
  const n = Object(e);
380
254
  for (let i = 1; i < arguments.length; i++) {
381
255
  const o = arguments[i];
382
256
  if (o != null)
383
- for (const a in o)
384
- Object.prototype.hasOwnProperty.call(o, a) && (n[a] = o[a]);
257
+ for (const r in o)
258
+ Object.prototype.hasOwnProperty.call(o, r) && (n[r] = o[r]);
385
259
  }
386
260
  return n;
387
261
  }
388
- const camelCaseToKebabCase = (e) => e ? e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`) : "";
389
- function bindAnimations(e) {
262
+ const le = (e) => e ? e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`) : "";
263
+ function rt(e) {
390
264
  for (const t of e)
391
265
  switch (t.trigger) {
392
266
  case "pageLoad":
393
- triggerAnimation(t);
267
+ Ee(t);
394
268
  break;
395
269
  case "hover":
396
- bindHoverAnimation(t);
270
+ st(t);
397
271
  break;
398
272
  case "scrollInView":
399
- bindScrollInViewAnimation(t);
273
+ ct(t);
400
274
  break;
401
275
  }
402
276
  }
403
- function warnElementNotPresent(e) {
277
+ function se(e) {
404
278
  console.warn(`Cannot animate element: element with ID ${e} not found!`);
405
279
  }
406
- function augmentAnimation(e, t) {
407
- const n = getAllStylesUsed(e), i = getComputedStyle(t), o = e.steps[0].styles, a = e.steps[e.steps.length - 1].styles, r = [o, a];
408
- for (const s of r)
409
- for (const c of n)
410
- c in s || (s[c] = i[c]);
280
+ function ce(e, t) {
281
+ const n = lt(e), i = getComputedStyle(t), o = e.steps[0].styles, r = e.steps[e.steps.length - 1].styles, a = [o, r];
282
+ for (const l of a)
283
+ for (const d of n)
284
+ d in l || (l[d] = i[d]);
411
285
  }
412
- function getAllStylesUsed(e) {
286
+ function lt(e) {
413
287
  const t = [];
414
288
  for (const n of e.steps)
415
289
  for (const i in n.styles)
416
290
  t.indexOf(i) === -1 && t.push(i);
417
291
  return t;
418
292
  }
419
- function triggerAnimation(e) {
293
+ function Ee(e) {
420
294
  const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
421
295
  if (!t.length) {
422
- warnElementNotPresent(e.elementId || e.id || "");
296
+ se(e.elementId || e.id || "");
423
297
  return;
424
298
  }
425
299
  Array.from(t).forEach((n) => {
426
- augmentAnimation(e, n), n.style.transition = "none", n.style.transitionDelay = "0", assign(n.style, e.steps[0].styles), setTimeout(() => {
427
- n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), assign(n.style, e.steps[1].styles), setTimeout(() => {
300
+ ce(e, n), n.style.transition = "none", n.style.transitionDelay = "0", D(n.style, e.steps[0].styles), setTimeout(() => {
301
+ n.style.transition = `all ${e.duration}s ${le(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), D(n.style, e.steps[1].styles), setTimeout(() => {
428
302
  n.style.transition = "", n.style.transitionDelay = "";
429
303
  }, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
430
304
  });
431
305
  });
432
306
  }
433
- function bindHoverAnimation(e) {
307
+ function st(e) {
434
308
  const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
435
309
  if (!t.length) {
436
- warnElementNotPresent(e.elementId || e.id || "");
310
+ se(e.elementId || e.id || "");
437
311
  return;
438
312
  }
439
313
  Array.from(t).forEach((n) => {
440
- augmentAnimation(e, n);
314
+ ce(e, n);
441
315
  const i = e.steps[0].styles, o = e.steps[1].styles;
442
- function a() {
443
- assign(n.style, i);
444
- }
445
316
  function r() {
446
- assign(n.style, o);
317
+ D(n.style, i);
447
318
  }
448
- a(), n.addEventListener("mouseenter", r), n.addEventListener("mouseleave", a), setTimeout(() => {
449
- n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s");
319
+ function a() {
320
+ D(n.style, o);
321
+ }
322
+ r(), n.addEventListener("mouseenter", a), n.addEventListener("mouseleave", r), setTimeout(() => {
323
+ n.style.transition = `all ${e.duration}s ${le(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s");
450
324
  });
451
325
  });
452
326
  }
453
- function bindScrollInViewAnimation(e) {
327
+ function ct(e) {
454
328
  const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
455
329
  if (!t.length) {
456
- warnElementNotPresent(e.elementId || e.id || "");
330
+ se(e.elementId || e.id || "");
457
331
  return;
458
332
  }
459
333
  Array.from(t).forEach((n) => {
460
- augmentAnimation(e, n);
334
+ ce(e, n);
461
335
  let i = !1, o = !1;
462
- function a() {
463
- !i && s(n) ? (i = !0, o = !0, setTimeout(() => {
464
- assign(n.style, e.steps[1].styles), e.repeat || document.removeEventListener("scroll", r), setTimeout(() => {
336
+ function r() {
337
+ !i && l(n) ? (i = !0, o = !0, setTimeout(() => {
338
+ D(n.style, e.steps[1].styles), e.repeat || document.removeEventListener("scroll", a), setTimeout(() => {
465
339
  o = !1, e.repeat || (n.style.transition = "", n.style.transitionDelay = "");
466
340
  }, (e.duration + (e.delay || 0)) * 1e3 + 100);
467
- })) : e.repeat && i && !o && !s(n) && (i = !1, assign(n.style, e.steps[0].styles));
341
+ })) : e.repeat && i && !o && !l(n) && (i = !1, D(n.style, e.steps[0].styles));
468
342
  }
469
- const r = throttle(a, 200, {
343
+ const a = at(r, 200, {
470
344
  leading: !1
471
345
  });
472
- function s(u) {
473
- const m = u.getBoundingClientRect(), g = window.innerHeight, y = (e.thresholdPercent || 0) / 100 * g;
474
- return m.bottom > y && m.top < g - y;
346
+ function l(m) {
347
+ const f = m.getBoundingClientRect(), g = window.innerHeight, S = (e.thresholdPercent || 0) / 100 * g;
348
+ return f.bottom > S && f.top < g - S;
475
349
  }
476
- const c = e.steps[0].styles;
477
- function l() {
478
- assign(n.style, c);
350
+ const d = e.steps[0].styles;
351
+ function c() {
352
+ D(n.style, d);
479
353
  }
480
- l(), setTimeout(() => {
481
- n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s");
482
- }), document.addEventListener("scroll", r, {
354
+ c(), setTimeout(() => {
355
+ n.style.transition = `all ${e.duration}s ${le(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s");
356
+ }), document.addEventListener("scroll", a, {
483
357
  capture: !0,
484
358
  passive: !0
485
- }), a();
359
+ }), r();
486
360
  });
487
361
  }
488
- const camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, i]) => {
362
+ const dt = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), Re = (e) => Object.entries(e).map(([n, i]) => {
489
363
  if (typeof i == "string")
490
- return `${camelToKebabCase(n)}: ${i};`;
491
- }).filter(checkIsDefined), convertStyleMapToCSS = (e) => convertStyleMapToCSSArray(e).join(`
492
- `), createCssClass = ({
364
+ return `${dt(n)}: ${i};`;
365
+ }).filter(J), ut = (e) => Re(e).join(`
366
+ `), te = ({
493
367
  mediaQuery: e,
494
368
  className: t,
495
369
  styles: n
496
370
  }) => {
497
371
  const i = `.${t} {
498
- ${convertStyleMapToCSS(n)}
372
+ ${ut(n)}
499
373
  }`;
500
374
  return e ? `${e} {
501
375
  ${i}
502
376
  }` : i;
503
377
  };
504
- function transformStyleProperty({
378
+ function mt({
505
379
  style: e
506
380
  }) {
507
381
  return e;
508
382
  }
509
- const getStyle = ({
383
+ const ft = ({
510
384
  block: e,
511
385
  context: t
512
- }) => mapStyleObjToStrIfNeeded(transformStyleProperty({
386
+ }) => Pe(mt({
513
387
  style: e.style || {},
514
388
  context: t,
515
389
  block: e
516
390
  }));
517
- function mapStyleObjToStrIfNeeded(e) {
518
- switch (TARGET) {
391
+ function Pe(e) {
392
+ switch (q) {
519
393
  case "svelte":
520
394
  case "vue":
521
395
  case "solid":
522
- return convertStyleMapToCSSArray(e).join(" ");
396
+ return Re(e).join(" ");
523
397
  case "qwik":
524
398
  case "reactNative":
525
399
  case "react":
@@ -527,20 +401,20 @@ function mapStyleObjToStrIfNeeded(e) {
527
401
  return e;
528
402
  }
529
403
  }
530
- const getComponent = ({
404
+ const ht = ({
531
405
  block: e,
532
406
  context: t,
533
407
  registeredComponents: n
534
408
  }) => {
535
- var a;
536
- const i = (a = getProcessedBlock({
409
+ var r;
410
+ const i = (r = Q({
537
411
  block: e,
538
412
  localState: t.localState,
539
413
  rootState: t.rootState,
540
414
  rootSetState: t.rootSetState,
541
415
  context: t.context,
542
416
  shouldEvaluateBindings: !1
543
- }).component) == null ? void 0 : a.name;
417
+ }).component) == null ? void 0 : r.name;
544
418
  if (!i)
545
419
  return null;
546
420
  const o = n[i];
@@ -549,7 +423,7 @@ const getComponent = ({
549
423
  console.warn(`
550
424
  Could not find a registered component named "${i}".
551
425
  If you registered it, is the file that registered it imported by the file that needs to render it?`);
552
- }, getRepeatItemData = ({
426
+ }, gt = ({
553
427
  block: e,
554
428
  context: t
555
429
  }) => {
@@ -559,7 +433,7 @@ const getComponent = ({
559
433
  } = e;
560
434
  if (!(n != null && n.collection))
561
435
  return;
562
- const o = evaluate({
436
+ const o = K({
563
437
  code: n.collection,
564
438
  localState: t.localState,
565
439
  rootState: t.rootState,
@@ -569,21 +443,21 @@ const getComponent = ({
569
443
  });
570
444
  if (!Array.isArray(o))
571
445
  return;
572
- const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
573
- return o.map((c, l) => ({
446
+ const r = n.collection.split(".").pop(), a = n.itemName || (r ? r + "Item" : "item");
447
+ return o.map((d, c) => ({
574
448
  context: {
575
449
  ...t,
576
450
  localState: {
577
451
  ...t.localState,
578
- $index: l,
579
- $item: c,
580
- [r]: c,
581
- [`$${r}Index`]: l
452
+ $index: c,
453
+ $item: d,
454
+ [a]: d,
455
+ [`$${a}Index`]: c
582
456
  }
583
457
  },
584
458
  block: i
585
459
  }));
586
- }, SIZES = {
460
+ }, Ve = {
587
461
  small: {
588
462
  min: 320,
589
463
  default: 321,
@@ -599,11 +473,11 @@ const getComponent = ({
599
473
  default: 991,
600
474
  max: 1200
601
475
  }
602
- }, getMaxWidthQueryForSize = (e, t = SIZES) => `@media (max-width: ${t[e].max}px)`, getSizesForBreakpoints = ({
476
+ }, he = (e, t = Ve) => `@media (max-width: ${t[e].max}px)`, Be = ({
603
477
  small: e,
604
478
  medium: t
605
479
  }) => {
606
- const n = fastClone(SIZES);
480
+ const n = oe(Ve);
607
481
  if (!e || !t)
608
482
  return n;
609
483
  const i = Math.floor(e / 2);
@@ -618,16 +492,16 @@ const getComponent = ({
618
492
  min: o,
619
493
  default: o + 1
620
494
  };
621
- const a = n.medium.max + 1;
495
+ const r = n.medium.max + 1;
622
496
  return n.large = {
623
497
  max: 2e3,
624
498
  // TODO: decide upper limit
625
- min: a,
626
- default: a + 1
499
+ min: r,
500
+ default: r + 1
627
501
  }, n;
628
502
  };
629
- function InlinedStyles(e) {
630
- return /* @__PURE__ */ jsx(
503
+ function Z(e) {
504
+ return /* @__PURE__ */ s(
631
505
  "style",
632
506
  {
633
507
  dangerouslySetInnerHTML: { __html: e.styles },
@@ -635,9 +509,9 @@ function InlinedStyles(e) {
635
509
  }
636
510
  );
637
511
  }
638
- function BlockStyles(e) {
512
+ function bt(e) {
639
513
  function t() {
640
- const i = getProcessedBlock({
514
+ const i = Q({
641
515
  block: e.block,
642
516
  localState: e.context.localState,
643
517
  rootState: e.context.rootState,
@@ -645,48 +519,48 @@ function BlockStyles(e) {
645
519
  context: e.context.context,
646
520
  shouldEvaluateBindings: !0
647
521
  });
648
- return checkIsDefined(i.hide) ? !i.hide : checkIsDefined(i.show) ? i.show : !0;
522
+ return J(i.hide) ? !i.hide : J(i.show) ? i.show : !0;
649
523
  }
650
524
  function n() {
651
- var y;
652
- const i = getProcessedBlock({
525
+ var S;
526
+ const i = Q({
653
527
  block: e.block,
654
528
  localState: e.context.localState,
655
529
  rootState: e.context.rootState,
656
530
  rootSetState: e.context.rootSetState,
657
531
  context: e.context.context,
658
532
  shouldEvaluateBindings: !0
659
- }), o = i.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
660
- ((y = a == null ? void 0 : a.meta) == null ? void 0 : y.breakpoints) || {}
661
- ), s = o == null ? void 0 : o.large, c = o == null ? void 0 : o.medium, l = o == null ? void 0 : o.small, u = i.id;
662
- if (!u)
533
+ }), o = i.responsiveStyles, r = e.context.content, a = Be(
534
+ ((S = r == null ? void 0 : r.meta) == null ? void 0 : S.breakpoints) || {}
535
+ ), l = o == null ? void 0 : o.large, d = o == null ? void 0 : o.medium, c = o == null ? void 0 : o.small, m = i.id;
536
+ if (!m)
663
537
  return "";
664
- const m = s ? createCssClass({
665
- className: u,
666
- styles: s
667
- }) : "", g = c ? createCssClass({
668
- className: u,
669
- styles: c,
670
- mediaQuery: getMaxWidthQueryForSize(
538
+ const f = l ? te({
539
+ className: m,
540
+ styles: l
541
+ }) : "", g = d ? te({
542
+ className: m,
543
+ styles: d,
544
+ mediaQuery: he(
671
545
  "medium",
672
- r
546
+ a
673
547
  )
674
- }) : "", h = l ? createCssClass({
675
- className: u,
676
- styles: l,
677
- mediaQuery: getMaxWidthQueryForSize(
548
+ }) : "", y = c ? te({
549
+ className: m,
550
+ styles: c,
551
+ mediaQuery: he(
678
552
  "small",
679
- r
553
+ a
680
554
  )
681
555
  }) : "";
682
- return [m, g, h].join(" ");
556
+ return [f, g, y].join(" ");
683
557
  }
684
- return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-block", styles: n() }) }) : null });
558
+ return /* @__PURE__ */ s(T, { children: n() && t() ? /* @__PURE__ */ s(T, { children: /* @__PURE__ */ s(Z, { id: "builderio-block", styles: n() }) }) : null });
685
559
  }
686
- function capitalizeFirstLetter(e) {
560
+ function yt(e) {
687
561
  return e.charAt(0).toUpperCase() + e.slice(1);
688
562
  }
689
- const getEventHandlerName = (e) => `on${capitalizeFirstLetter(e)}`, createEventHandler = (e, t) => (n) => evaluate({
563
+ const pt = (e) => `on${yt(e)}`, xt = (e, t) => (n) => K({
690
564
  code: e,
691
565
  context: t.context,
692
566
  localState: t.localState,
@@ -696,66 +570,66 @@ const getEventHandlerName = (e) => `on${capitalizeFirstLetter(e)}`, createEventH
696
570
  isExpression: !1,
697
571
  enableCache: !0
698
572
  });
699
- function getBlockActions(e) {
573
+ function We(e) {
700
574
  var i;
701
575
  const t = {}, n = (i = e.block.actions) != null ? i : {};
702
576
  for (const o in n) {
703
577
  if (!n.hasOwnProperty(o))
704
578
  continue;
705
- const a = n[o];
706
- let r = getEventHandlerName(o);
579
+ const r = n[o];
580
+ let a = pt(o);
707
581
  if (e.stripPrefix)
708
- switch (TARGET) {
582
+ switch (q) {
709
583
  case "vue":
710
- r = r.replace("v-on:", "");
584
+ a = a.replace("v-on:", "");
711
585
  break;
712
586
  case "svelte":
713
- r = r.replace("on:", "");
587
+ a = a.replace("on:", "");
714
588
  break;
715
589
  }
716
- t[r] = createEventHandler(a, e);
590
+ t[a] = xt(r, e);
717
591
  }
718
592
  return t;
719
593
  }
720
- function transformBlockProperties({
594
+ function St({
721
595
  properties: e
722
596
  }) {
723
597
  return e;
724
598
  }
725
- const extractRelevantRootBlockProperties = (e) => ({
599
+ const vt = (e) => ({
726
600
  href: e.href
727
601
  });
728
- function getBlockProperties({
602
+ function de({
729
603
  block: e,
730
604
  context: t
731
605
  }) {
732
606
  var i;
733
607
  const n = {
734
- ...extractRelevantRootBlockProperties(e),
608
+ ...vt(e),
735
609
  ...e.properties,
736
610
  "builder-id": e.id,
737
- style: getStyle({
611
+ style: ft({
738
612
  block: e,
739
613
  context: t
740
614
  }),
741
- [getClassPropName()]: [e.id, "builder-block", e.class, (i = e.properties) == null ? void 0 : i.class].filter(Boolean).join(" ")
615
+ [H()]: [e.id, "builder-block", e.class, (i = e.properties) == null ? void 0 : i.class].filter(Boolean).join(" ")
742
616
  };
743
- return transformBlockProperties({
617
+ return St({
744
618
  properties: n,
745
619
  context: t,
746
620
  block: e
747
621
  });
748
622
  }
749
- function BlockWrapper(e) {
750
- return /* @__PURE__ */ jsx(
751
- DynamicRenderer,
623
+ function kt(e) {
624
+ return /* @__PURE__ */ s(
625
+ ae,
752
626
  {
753
627
  TagName: e.Wrapper,
754
- attributes: getBlockProperties({
628
+ attributes: de({
755
629
  block: e.block,
756
630
  context: e.context
757
631
  }),
758
- actionAttributes: getBlockActions({
632
+ actionAttributes: We({
759
633
  block: e.block,
760
634
  rootState: e.context.rootState,
761
635
  rootSetState: e.context.rootSetState,
@@ -767,17 +641,17 @@ function BlockWrapper(e) {
767
641
  }
768
642
  );
769
643
  }
770
- function InteractiveElement(e) {
771
- return /* @__PURE__ */ jsx(
644
+ function Ct(e) {
645
+ return /* @__PURE__ */ s(
772
646
  e.Wrapper,
773
647
  {
774
648
  ...e.wrapperProps,
775
649
  attributes: e.includeBlockProps ? {
776
- ...getBlockProperties({
650
+ ...de({
777
651
  block: e.block,
778
652
  context: e.context
779
653
  }),
780
- ...getBlockActions({
654
+ ...We({
781
655
  block: e.block,
782
656
  rootState: e.context.rootState,
783
657
  rootSetState: e.context.rootSetState,
@@ -789,45 +663,45 @@ function InteractiveElement(e) {
789
663
  }
790
664
  );
791
665
  }
792
- const getWrapperProps = ({
666
+ const wt = ({
793
667
  componentOptions: e,
794
668
  builderBlock: t,
795
669
  context: n,
796
670
  componentRef: i,
797
671
  includeBlockProps: o,
798
- isInteractive: a,
799
- contextValue: r
672
+ isInteractive: r,
673
+ contextValue: a
800
674
  }) => {
801
- const s = {
675
+ const l = {
802
676
  ...e,
803
677
  /**
804
678
  * If `noWrap` is set to `true`, then the block's props/attributes are provided to the
805
679
  * component itself directly. Otherwise, they are provided to the wrapper element.
806
680
  */
807
681
  ...o ? {
808
- attributes: getBlockProperties({
682
+ attributes: de({
809
683
  block: t,
810
- context: r
684
+ context: a
811
685
  })
812
686
  } : {}
813
687
  };
814
- return a ? {
688
+ return r ? {
815
689
  Wrapper: i,
816
690
  block: t,
817
691
  context: n,
818
692
  wrapperProps: e,
819
693
  includeBlockProps: o
820
- } : s;
694
+ } : l;
821
695
  };
822
- function ComponentRef(e) {
696
+ function ge(e) {
823
697
  var i;
824
- const [t, n] = useState(
825
- () => e.isInteractive ? InteractiveElement : e.componentRef
698
+ const [t, n] = k(
699
+ () => e.isInteractive ? Ct : e.componentRef
826
700
  );
827
- return /* @__PURE__ */ jsx(Fragment, { children: e.componentRef ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
701
+ return /* @__PURE__ */ s(T, { children: e.componentRef ? /* @__PURE__ */ s(T, { children: /* @__PURE__ */ s(
828
702
  t,
829
703
  {
830
- ...getWrapperProps({
704
+ ...wt({
831
705
  componentOptions: e.componentOptions,
832
706
  builderBlock: e.builderBlock,
833
707
  context: e.context,
@@ -837,8 +711,8 @@ function ComponentRef(e) {
837
711
  isInteractive: e.isInteractive,
838
712
  contextValue: e.context
839
713
  }),
840
- children: (i = e.blockChildren) == null ? void 0 : i.map((o) => /* @__PURE__ */ jsx(
841
- Block,
714
+ children: (i = e.blockChildren) == null ? void 0 : i.map((o) => /* @__PURE__ */ s(
715
+ _,
842
716
  {
843
717
  block: o,
844
718
  context: e.context,
@@ -850,10 +724,10 @@ function ComponentRef(e) {
850
724
  }
851
725
  ) }) : null });
852
726
  }
853
- function RepeatedBlock(e) {
854
- const [t, n] = useState(() => e.repeatContext);
855
- return /* @__PURE__ */ jsx(builderContext.Provider, { value: t, children: /* @__PURE__ */ jsx(
856
- Block,
727
+ function It(e) {
728
+ const [t, n] = k(() => e.repeatContext);
729
+ return /* @__PURE__ */ s(re.Provider, { value: t, children: /* @__PURE__ */ s(
730
+ _,
857
731
  {
858
732
  block: e.block,
859
733
  context: t,
@@ -862,24 +736,24 @@ function RepeatedBlock(e) {
862
736
  }
863
737
  ) });
864
738
  }
865
- function Block(e) {
866
- var c, l, u;
739
+ function _(e) {
740
+ var d, c, m;
867
741
  function t() {
868
- return getComponent({
742
+ return ht({
869
743
  block: e.block,
870
744
  context: e.context,
871
745
  registeredComponents: e.registeredComponents
872
746
  });
873
747
  }
874
748
  function n() {
875
- return getRepeatItemData({
749
+ return gt({
876
750
  block: e.block,
877
751
  context: e.context
878
752
  });
879
753
  }
880
754
  function i() {
881
- var m;
882
- return (m = e.block.repeat) != null && m.collection ? e.block : getProcessedBlock({
755
+ var f;
756
+ return (f = e.block.repeat) != null && f.collection ? e.block : Q({
883
757
  block: e.block,
884
758
  localState: e.context.localState,
885
759
  rootState: e.context.rootState,
@@ -892,29 +766,29 @@ function Block(e) {
892
766
  var g;
893
767
  return e.block.tagName === "a" || ((g = i().properties) == null ? void 0 : g.href) || i().href ? e.linkComponent || "a" : e.block.tagName || "div";
894
768
  }
895
- function a() {
896
- var h, y;
897
- if ((h = e.block.repeat) != null && h.collection)
898
- return !!((y = n == null ? void 0 : n()) != null && y.length);
899
- const m = "hide" in i() ? i().hide : !1;
900
- return ("show" in i() ? i().show : !0) && !m;
901
- }
902
769
  function r() {
903
- var g, h;
904
- return !((g = t == null ? void 0 : t()) != null && g.component) && !n() ? (h = i().children) != null ? h : [] : [];
770
+ var y, S;
771
+ if ((y = e.block.repeat) != null && y.collection)
772
+ return !!((S = n == null ? void 0 : n()) != null && S.length);
773
+ const f = "hide" in i() ? i().hide : !1;
774
+ return ("show" in i() ? i().show : !0) && !f;
905
775
  }
906
- function s() {
907
- var m, g, h, y, p, k, T, S, C, E, I;
776
+ function a() {
777
+ var g, y;
778
+ return !((g = t == null ? void 0 : t()) != null && g.component) && !n() ? (y = i().children) != null ? y : [] : [];
779
+ }
780
+ function l() {
781
+ var f, g, y, S, C, I, R, p, w, P, E;
908
782
  return {
909
- blockChildren: (m = i().children) != null ? m : [],
783
+ blockChildren: (f = i().children) != null ? f : [],
910
784
  componentRef: (g = t == null ? void 0 : t()) == null ? void 0 : g.component,
911
785
  componentOptions: {
912
- ...getBlockComponentOptions(i()),
786
+ ...Ze(i()),
913
787
  builderContext: e.context,
914
- ...((h = t == null ? void 0 : t()) == null ? void 0 : h.name) === "Core:Button" || ((y = t == null ? void 0 : t()) == null ? void 0 : y.name) === "Symbol" || ((p = t == null ? void 0 : t()) == null ? void 0 : p.name) === "Columns" || ((k = t == null ? void 0 : t()) == null ? void 0 : k.name) === "Form:Form" ? {
788
+ ...((y = t == null ? void 0 : t()) == null ? void 0 : y.name) === "Core:Button" || ((S = t == null ? void 0 : t()) == null ? void 0 : S.name) === "Symbol" || ((C = t == null ? void 0 : t()) == null ? void 0 : C.name) === "Columns" || ((I = t == null ? void 0 : t()) == null ? void 0 : I.name) === "Form:Form" ? {
915
789
  builderLinkComponent: e.linkComponent
916
790
  } : {},
917
- ...((T = t == null ? void 0 : t()) == null ? void 0 : T.name) === "Symbol" || ((S = t == null ? void 0 : t()) == null ? void 0 : S.name) === "Columns" || ((C = t == null ? void 0 : t()) == null ? void 0 : C.name) === "Form:Form" ? {
791
+ ...((R = t == null ? void 0 : t()) == null ? void 0 : R.name) === "Symbol" || ((p = t == null ? void 0 : t()) == null ? void 0 : p.name) === "Columns" || ((w = t == null ? void 0 : t()) == null ? void 0 : w.name) === "Form:Form" ? {
918
792
  builderComponents: e.registeredComponents
919
793
  } : {}
920
794
  },
@@ -922,87 +796,87 @@ function Block(e) {
922
796
  linkComponent: e.linkComponent,
923
797
  registeredComponents: e.registeredComponents,
924
798
  builderBlock: i(),
925
- includeBlockProps: ((E = t == null ? void 0 : t()) == null ? void 0 : E.noWrap) === !0,
926
- isInteractive: !((I = t == null ? void 0 : t()) != null && I.isRSC)
799
+ includeBlockProps: ((P = t == null ? void 0 : t()) == null ? void 0 : P.noWrap) === !0,
800
+ isInteractive: !((E = t == null ? void 0 : t()) != null && E.isRSC)
927
801
  };
928
802
  }
929
- return useEffect(() => {
930
- const m = i().id, g = i().animations;
931
- g && m && bindAnimations(
932
- g.filter((h) => h.trigger !== "hover").map((h) => ({
933
- ...h,
934
- elementId: m
803
+ return V(() => {
804
+ const f = i().id, g = i().animations;
805
+ g && f && rt(
806
+ g.filter((y) => y.trigger !== "hover").map((y) => ({
807
+ ...y,
808
+ elementId: f
935
809
  }))
936
810
  );
937
- }, []), /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsxs(Fragment, { children: [
938
- /* @__PURE__ */ jsx(BlockStyles, { block: e.block, context: e.context }),
939
- (c = t == null ? void 0 : t()) != null && c.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
940
- ComponentRef,
811
+ }, []), /* @__PURE__ */ s(T, { children: r() ? /* @__PURE__ */ B(T, { children: [
812
+ /* @__PURE__ */ s(bt, { block: e.block, context: e.context }),
813
+ (d = t == null ? void 0 : t()) != null && d.noWrap ? /* @__PURE__ */ s(T, { children: /* @__PURE__ */ s(
814
+ ge,
941
815
  {
942
- componentRef: s().componentRef,
943
- componentOptions: s().componentOptions,
944
- blockChildren: s().blockChildren,
945
- context: s().context,
946
- registeredComponents: s().registeredComponents,
947
- linkComponent: s().linkComponent,
948
- builderBlock: s().builderBlock,
949
- includeBlockProps: s().includeBlockProps,
950
- isInteractive: s().isInteractive
816
+ componentRef: l().componentRef,
817
+ componentOptions: l().componentOptions,
818
+ blockChildren: l().blockChildren,
819
+ context: l().context,
820
+ registeredComponents: l().registeredComponents,
821
+ linkComponent: l().linkComponent,
822
+ builderBlock: l().builderBlock,
823
+ includeBlockProps: l().includeBlockProps,
824
+ isInteractive: l().isInteractive
951
825
  }
952
- ) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (u = n()) == null ? void 0 : u.map((m, g) => /* @__PURE__ */ jsx(
953
- RepeatedBlock,
826
+ ) }) : /* @__PURE__ */ s(T, { children: n() ? /* @__PURE__ */ s(T, { children: (m = n()) == null ? void 0 : m.map((f, g) => /* @__PURE__ */ s(
827
+ It,
954
828
  {
955
- repeatContext: m.context,
956
- block: m.block,
829
+ repeatContext: f.context,
830
+ block: f.block,
957
831
  registeredComponents: e.registeredComponents,
958
832
  linkComponent: e.linkComponent
959
833
  },
960
834
  g
961
- )) }) : /* @__PURE__ */ jsxs(
962
- BlockWrapper,
835
+ )) }) : /* @__PURE__ */ B(
836
+ kt,
963
837
  {
964
838
  Wrapper: o(),
965
839
  block: i(),
966
840
  context: e.context,
967
841
  linkComponent: e.linkComponent,
968
842
  children: [
969
- /* @__PURE__ */ jsx(
970
- ComponentRef,
843
+ /* @__PURE__ */ s(
844
+ ge,
971
845
  {
972
- componentRef: s().componentRef,
973
- componentOptions: s().componentOptions,
974
- blockChildren: s().blockChildren,
975
- context: s().context,
976
- registeredComponents: s().registeredComponents,
977
- linkComponent: s().linkComponent,
978
- builderBlock: s().builderBlock,
979
- includeBlockProps: s().includeBlockProps,
980
- isInteractive: s().isInteractive
846
+ componentRef: l().componentRef,
847
+ componentOptions: l().componentOptions,
848
+ blockChildren: l().blockChildren,
849
+ context: l().context,
850
+ registeredComponents: l().registeredComponents,
851
+ linkComponent: l().linkComponent,
852
+ builderBlock: l().builderBlock,
853
+ includeBlockProps: l().includeBlockProps,
854
+ isInteractive: l().isInteractive
981
855
  }
982
856
  ),
983
- (l = r()) == null ? void 0 : l.map((m) => /* @__PURE__ */ jsx(
984
- Block,
857
+ (c = a()) == null ? void 0 : c.map((f) => /* @__PURE__ */ s(
858
+ _,
985
859
  {
986
- block: m,
860
+ block: f,
987
861
  registeredComponents: e.registeredComponents,
988
862
  linkComponent: e.linkComponent,
989
863
  context: e.context
990
864
  },
991
- m.id
865
+ f.id
992
866
  ))
993
867
  ]
994
868
  }
995
869
  ) })
996
870
  ] }) : null });
997
871
  }
998
- function BlocksWrapper(e) {
872
+ function Tt(e) {
999
873
  function t() {
1000
874
  var o;
1001
875
  return "builder-blocks" + ((o = e.blocks) != null && o.length ? "" : " no-blocks");
1002
876
  }
1003
877
  function n() {
1004
- var o, a;
1005
- isEditing() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
878
+ var o, r;
879
+ F() && !((o = e.blocks) != null && o.length) && ((r = window.parent) == null || r.postMessage(
1006
880
  {
1007
881
  type: "builder.clickEmptyBlocks",
1008
882
  data: {
@@ -1014,8 +888,8 @@ function BlocksWrapper(e) {
1014
888
  ));
1015
889
  }
1016
890
  function i() {
1017
- var o, a;
1018
- isEditing() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
891
+ var o, r;
892
+ F() && !((o = e.blocks) != null && o.length) && ((r = window.parent) == null || r.postMessage(
1019
893
  {
1020
894
  type: "builder.hoverEmptyBlocks",
1021
895
  data: {
@@ -1026,8 +900,8 @@ function BlocksWrapper(e) {
1026
900
  "*"
1027
901
  ));
1028
902
  }
1029
- return /* @__PURE__ */ jsxs(Fragment, { children: [
1030
- /* @__PURE__ */ jsx(
903
+ return /* @__PURE__ */ B(T, { children: [
904
+ /* @__PURE__ */ s(
1031
905
  e.BlocksWrapper,
1032
906
  {
1033
907
  className: t() + " props-blocks-wrapper-7cd1560e",
@@ -1041,18 +915,18 @@ function BlocksWrapper(e) {
1041
915
  children: e.children
1042
916
  }
1043
917
  ),
1044
- /* @__PURE__ */ jsx("style", { children: `.props-blocks-wrapper-7cd1560e {
918
+ /* @__PURE__ */ s("style", { children: `.props-blocks-wrapper-7cd1560e {
1045
919
  display: flex;
1046
920
  flex-direction: column;
1047
921
  align-items: stretch;
1048
922
  }` })
1049
923
  ] });
1050
924
  }
1051
- function Blocks(e) {
1052
- var i, o, a;
1053
- const t = useContext(builderContext), n = useContext(ComponentsContext);
1054
- return /* @__PURE__ */ jsx(
1055
- BlocksWrapper,
925
+ function O(e) {
926
+ var i, o, r;
927
+ const t = fe(re), n = fe(Ie);
928
+ return /* @__PURE__ */ s(
929
+ Tt,
1056
930
  {
1057
931
  blocks: e.blocks,
1058
932
  parent: e.parent,
@@ -1060,95 +934,95 @@ function Blocks(e) {
1060
934
  styleProp: e.styleProp,
1061
935
  BlocksWrapper: ((i = e.context) == null ? void 0 : i.BlocksWrapper) || t.BlocksWrapper,
1062
936
  BlocksWrapperProps: ((o = e.context) == null ? void 0 : o.BlocksWrapperProps) || t.BlocksWrapperProps,
1063
- children: e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (a = e.blocks) == null ? void 0 : a.map((r) => /* @__PURE__ */ jsx(
1064
- Block,
937
+ children: e.blocks ? /* @__PURE__ */ s(T, { children: (r = e.blocks) == null ? void 0 : r.map((a) => /* @__PURE__ */ s(
938
+ _,
1065
939
  {
1066
- block: r,
940
+ block: a,
1067
941
  linkComponent: e.linkComponent,
1068
942
  context: e.context || t,
1069
943
  registeredComponents: e.registeredComponents || n.registeredComponents
1070
944
  },
1071
- r.id
945
+ a.id
1072
946
  )) }) : null
1073
947
  }
1074
948
  );
1075
949
  }
1076
- function Columns(e) {
1077
- var T;
1078
- const [t, n] = useState(
950
+ function Et(e) {
951
+ var R;
952
+ const [t, n] = k(
1079
953
  () => typeof e.space == "number" ? e.space || 0 : 20
1080
- ), [i, o] = useState(() => e.columns || []), [a, r] = useState(
954
+ ), [i, o] = k(() => e.columns || []), [r, a] = k(
1081
955
  () => e.stackColumnsAt || "tablet"
1082
956
  );
1083
- function s(S) {
1084
- var C;
1085
- return ((C = i[S]) == null ? void 0 : C.width) || 100 / i.length;
957
+ function l(p) {
958
+ var w;
959
+ return ((w = i[p]) == null ? void 0 : w.width) || 100 / i.length;
1086
960
  }
1087
- function c(S) {
1088
- const C = t * (i.length - 1) / i.length;
1089
- return `calc(${s(S)}% - ${C}px)`;
961
+ function d(p) {
962
+ const w = t * (i.length - 1) / i.length;
963
+ return `calc(${l(p)}% - ${w}px)`;
1090
964
  }
1091
- function l({
1092
- stackedStyle: S,
1093
- desktopStyle: C
965
+ function c({
966
+ stackedStyle: p,
967
+ desktopStyle: w
1094
968
  }) {
1095
- return a === "tablet" ? S : C;
969
+ return r === "tablet" ? p : w;
1096
970
  }
1097
- function u({
1098
- stackedStyle: S,
1099
- desktopStyle: C
971
+ function m({
972
+ stackedStyle: p,
973
+ desktopStyle: w
1100
974
  }) {
1101
- return a === "never" ? C : S;
975
+ return r === "never" ? w : p;
1102
976
  }
1103
- const [m, g] = useState(
977
+ const [f, g] = k(
1104
978
  () => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
1105
979
  );
1106
- function h() {
980
+ function y() {
1107
981
  return {
1108
- "--flex-dir": m,
1109
- "--flex-dir-tablet": l({
1110
- stackedStyle: m,
982
+ "--flex-dir": f,
983
+ "--flex-dir-tablet": c({
984
+ stackedStyle: f,
1111
985
  desktopStyle: "row"
1112
986
  })
1113
987
  };
1114
988
  }
1115
- function y(S) {
1116
- const C = S === 0 ? 0 : t, E = c(S), I = `${C}px`, B = "100%", j = 0;
989
+ function S(p) {
990
+ const w = p === 0 ? 0 : t, P = d(p), E = `${w}px`, $ = "100%", L = 0;
1117
991
  return {
1118
992
  ...{
1119
993
  display: "flex",
1120
994
  flexDirection: "column",
1121
995
  alignItems: "stretch"
1122
996
  },
1123
- width: E,
1124
- ["marginLeft"]: I,
1125
- "--column-width-mobile": u({
1126
- stackedStyle: B,
997
+ width: P,
998
+ ["marginLeft"]: E,
999
+ "--column-width-mobile": m({
1000
+ stackedStyle: $,
1001
+ desktopStyle: P
1002
+ }),
1003
+ "--column-margin-left-mobile": m({
1004
+ stackedStyle: L,
1127
1005
  desktopStyle: E
1128
1006
  }),
1129
- "--column-margin-left-mobile": u({
1130
- stackedStyle: j,
1131
- desktopStyle: I
1007
+ "--column-width-tablet": c({
1008
+ stackedStyle: $,
1009
+ desktopStyle: P
1132
1010
  }),
1133
- "--column-width-tablet": l({
1134
- stackedStyle: B,
1011
+ "--column-margin-left-tablet": c({
1012
+ stackedStyle: L,
1135
1013
  desktopStyle: E
1136
- }),
1137
- "--column-margin-left-tablet": l({
1138
- stackedStyle: j,
1139
- desktopStyle: I
1140
1014
  })
1141
1015
  };
1142
1016
  }
1143
- function p(S) {
1144
- var E, I;
1145
- return getSizesForBreakpoints(
1146
- ((I = (E = e.builderContext.content) == null ? void 0 : E.meta) == null ? void 0 : I.breakpoints) || {}
1147
- )[S].max;
1017
+ function C(p) {
1018
+ var P, E;
1019
+ return Be(
1020
+ ((E = (P = e.builderContext.content) == null ? void 0 : P.meta) == null ? void 0 : E.breakpoints) || {}
1021
+ )[p].max;
1148
1022
  }
1149
- function k() {
1023
+ function I() {
1150
1024
  return `
1151
- @media (max-width: ${p("medium")}px) {
1025
+ @media (max-width: ${C("medium")}px) {
1152
1026
  .${e.builderBlock.id}-breakpoints {
1153
1027
  flex-direction: var(--flex-dir-tablet);
1154
1028
  align-items: stretch;
@@ -1160,7 +1034,7 @@ function Columns(e) {
1160
1034
  }
1161
1035
  }
1162
1036
 
1163
- @media (max-width: ${p("small")}px) {
1037
+ @media (max-width: ${C("small")}px) {
1164
1038
  .${e.builderBlock.id}-breakpoints {
1165
1039
  flex-direction: var(--flex-dir);
1166
1040
  align-items: stretch;
@@ -1173,30 +1047,30 @@ function Columns(e) {
1173
1047
  },
1174
1048
  `;
1175
1049
  }
1176
- return /* @__PURE__ */ jsxs(Fragment, { children: [
1177
- /* @__PURE__ */ jsxs(
1050
+ return /* @__PURE__ */ B(T, { children: [
1051
+ /* @__PURE__ */ B(
1178
1052
  "div",
1179
1053
  {
1180
1054
  className: `builder-columns ${e.builderBlock.id}-breakpoints div-003f4b1c`,
1181
- style: h(),
1055
+ style: y(),
1182
1056
  children: [
1183
- /* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-columns", styles: k() }),
1184
- (T = e.columns) == null ? void 0 : T.map((S, C) => /* @__PURE__ */ jsx(
1185
- DynamicRenderer,
1057
+ /* @__PURE__ */ s(Z, { id: "builderio-columns", styles: I() }),
1058
+ (R = e.columns) == null ? void 0 : R.map((p, w) => /* @__PURE__ */ s(
1059
+ ae,
1186
1060
  {
1187
- TagName: S.link ? e.builderLinkComponent || "a" : "div",
1061
+ TagName: p.link ? e.builderLinkComponent || "a" : "div",
1188
1062
  actionAttributes: {},
1189
1063
  attributes: {
1190
- ...S.link ? {
1191
- href: S.link
1064
+ ...p.link ? {
1065
+ href: p.link
1192
1066
  } : {},
1193
- [getClassPropName()]: "builder-column",
1194
- style: mapStyleObjToStrIfNeeded(y(C))
1067
+ [H()]: "builder-column",
1068
+ style: Pe(S(w))
1195
1069
  },
1196
- children: /* @__PURE__ */ jsx(
1197
- Blocks,
1070
+ children: /* @__PURE__ */ s(
1071
+ O,
1198
1072
  {
1199
- path: `component.options.columns.${C}.blocks`,
1073
+ path: `component.options.columns.${w}.blocks`,
1200
1074
  parent: e.builderBlock.id,
1201
1075
  styleProp: {
1202
1076
  flexGrow: "1"
@@ -1204,89 +1078,89 @@ function Columns(e) {
1204
1078
  context: e.builderContext,
1205
1079
  registeredComponents: e.builderComponents,
1206
1080
  linkComponent: e.builderLinkComponent,
1207
- blocks: S.blocks
1081
+ blocks: p.blocks
1208
1082
  }
1209
1083
  )
1210
1084
  },
1211
- C
1085
+ w
1212
1086
  ))
1213
1087
  ]
1214
1088
  }
1215
1089
  ),
1216
- /* @__PURE__ */ jsx("style", { children: `.div-003f4b1c {
1090
+ /* @__PURE__ */ s("style", { children: `.div-003f4b1c {
1217
1091
  display: flex;
1218
1092
  line-height: normal;
1219
1093
  }` })
1220
1094
  ] });
1221
1095
  }
1222
- function FragmentComponent(e) {
1223
- return /* @__PURE__ */ jsx("span", { children: e.children });
1096
+ function Rt(e) {
1097
+ return /* @__PURE__ */ s("span", { children: e.children });
1224
1098
  }
1225
- function removeProtocol(e) {
1099
+ function be(e) {
1226
1100
  return e.replace(/http(s)?:/, "");
1227
1101
  }
1228
- function updateQueryParam(e = "", t, n) {
1102
+ function Pt(e = "", t, n) {
1229
1103
  const i = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), o = e.indexOf("?") !== -1 ? "&" : "?";
1230
1104
  return e.match(i) ? e.replace(i, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + o + t + "=" + encodeURIComponent(n);
1231
1105
  }
1232
- function getShopifyImageUrl(e, t) {
1106
+ function Vt(e, t) {
1233
1107
  if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
1234
1108
  return e;
1235
1109
  if (t === "master")
1236
- return removeProtocol(e);
1110
+ return be(e);
1237
1111
  const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
1238
1112
  if (n) {
1239
- const i = e.split(n[0]), o = n[3], a = t.match("x") ? t : `${t}x`;
1240
- return removeProtocol(`${i[0]}_${a}${o}`);
1113
+ const i = e.split(n[0]), o = n[3], r = t.match("x") ? t : `${t}x`;
1114
+ return be(`${i[0]}_${r}${o}`);
1241
1115
  }
1242
1116
  return null;
1243
1117
  }
1244
- function getSrcSet(e) {
1118
+ function ne(e) {
1245
1119
  if (!e)
1246
1120
  return e;
1247
1121
  const t = [100, 200, 400, 800, 1200, 1600, 2e3];
1248
1122
  if (e.match(/builder\.io/)) {
1249
1123
  let n = e;
1250
1124
  const i = Number(e.split("?width=")[1]);
1251
- return isNaN(i) || (n = `${n} ${i}w`), t.filter((o) => o !== i).map((o) => `${updateQueryParam(e, "width", o)} ${o}w`).concat([n]).join(", ");
1125
+ return isNaN(i) || (n = `${n} ${i}w`), t.filter((o) => o !== i).map((o) => `${Pt(e, "width", o)} ${o}w`).concat([n]).join(", ");
1252
1126
  }
1253
- 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;
1127
+ return e.match(/cdn\.shopify\.com/) ? t.map((n) => [Vt(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, i]) => `${n} ${i}w`).concat([e]).join(", ") : e;
1254
1128
  }
1255
- function Image(e) {
1256
- var o, a, r, s;
1129
+ function Bt(e) {
1130
+ var o, r, a, l;
1257
1131
  function t() {
1258
- var u;
1259
- const l = e.image || e.src;
1260
- if (!l || // We can auto add srcset for cdn.builder.io and shopify
1132
+ var m;
1133
+ const c = e.image || e.src;
1134
+ if (!c || // We can auto add srcset for cdn.builder.io and shopify
1261
1135
  // images, otherwise you can supply this prop manually
1262
- !(l.match(/builder\.io/) || l.match(/cdn\.shopify\.com/)))
1136
+ !(c.match(/builder\.io/) || c.match(/cdn\.shopify\.com/)))
1263
1137
  return e.srcset;
1264
- if (e.srcset && ((u = e.image) != null && u.includes("builder.io/api/v1/image"))) {
1138
+ if (e.srcset && ((m = e.image) != null && m.includes("builder.io/api/v1/image"))) {
1265
1139
  if (!e.srcset.includes(e.image.split("?")[0]))
1266
- return console.debug("Removed given srcset"), getSrcSet(l);
1140
+ return console.debug("Removed given srcset"), ne(c);
1267
1141
  } else if (e.image && !e.srcset)
1268
- return getSrcSet(l);
1269
- return getSrcSet(l);
1142
+ return ne(c);
1143
+ return ne(c);
1270
1144
  }
1271
1145
  function n() {
1272
- var c;
1273
- return (c = t == null ? void 0 : t()) != null && c.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
1146
+ var d;
1147
+ return (d = t == null ? void 0 : t()) != null && d.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
1274
1148
  }
1275
1149
  function i() {
1276
- const c = {
1150
+ const d = {
1277
1151
  position: "absolute",
1278
1152
  height: "100%",
1279
1153
  width: "100%",
1280
1154
  left: "0px",
1281
1155
  top: "0px"
1282
1156
  };
1283
- return e.aspectRatio ? c : void 0;
1157
+ return e.aspectRatio ? d : void 0;
1284
1158
  }
1285
- return /* @__PURE__ */ jsxs(Fragment, { children: [
1286
- /* @__PURE__ */ jsxs(Fragment, { children: [
1287
- /* @__PURE__ */ jsxs("picture", { children: [
1288
- n() ? /* @__PURE__ */ jsx("source", { type: "image/webp", srcSet: n() }) : null,
1289
- /* @__PURE__ */ jsx(
1159
+ return /* @__PURE__ */ B(T, { children: [
1160
+ /* @__PURE__ */ B(T, { children: [
1161
+ /* @__PURE__ */ B("picture", { children: [
1162
+ n() ? /* @__PURE__ */ s("source", { type: "image/webp", srcSet: n() }) : null,
1163
+ /* @__PURE__ */ s(
1290
1164
  "img",
1291
1165
  {
1292
1166
  loading: "lazy",
@@ -1304,7 +1178,7 @@ function Image(e) {
1304
1178
  }
1305
1179
  )
1306
1180
  ] }),
1307
- e.aspectRatio && !((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length && e.fitContent) ? /* @__PURE__ */ jsx(
1181
+ e.aspectRatio && !((r = (o = e.builderBlock) == null ? void 0 : o.children) != null && r.length && e.fitContent) ? /* @__PURE__ */ s(
1308
1182
  "div",
1309
1183
  {
1310
1184
  className: "builder-image-sizer div-a0c95e8c",
@@ -1313,10 +1187,10 @@ function Image(e) {
1313
1187
  }
1314
1188
  }
1315
1189
  ) : null,
1316
- (s = (r = e.builderBlock) == null ? void 0 : r.children) != null && s.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null,
1317
- !e.fitContent && e.children ? /* @__PURE__ */ jsx("div", { className: "div-a0c95e8c-2", children: e.children }) : null
1190
+ (l = (a = e.builderBlock) == null ? void 0 : a.children) != null && l.length && e.fitContent ? /* @__PURE__ */ s(T, { children: e.children }) : null,
1191
+ !e.fitContent && e.children ? /* @__PURE__ */ s("div", { className: "div-a0c95e8c-2", children: e.children }) : null
1318
1192
  ] }),
1319
- /* @__PURE__ */ jsx("style", { children: `.img-a0c95e8c {
1193
+ /* @__PURE__ */ s("style", { children: `.img-a0c95e8c {
1320
1194
  opacity: 1;
1321
1195
  transition: opacity 0.2s ease-in-out;
1322
1196
  }.div-a0c95e8c {
@@ -1335,8 +1209,8 @@ function Image(e) {
1335
1209
  }` })
1336
1210
  ] });
1337
1211
  }
1338
- function SectionComponent(e) {
1339
- return /* @__PURE__ */ jsx(
1212
+ function Wt(e) {
1213
+ return /* @__PURE__ */ s(
1340
1214
  "section",
1341
1215
  {
1342
1216
  ...e.attributes,
@@ -1356,7 +1230,7 @@ function SectionComponent(e) {
1356
1230
  }
1357
1231
  );
1358
1232
  }
1359
- const componentInfo$f = {
1233
+ const Nt = {
1360
1234
  name: "Core:Button",
1361
1235
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
1362
1236
  defaultStyles: {
@@ -1389,7 +1263,7 @@ const componentInfo$f = {
1389
1263
  }],
1390
1264
  static: !0,
1391
1265
  noWrap: !0
1392
- }, componentInfo$e = {
1266
+ }, At = {
1393
1267
  // TODO: ways to statically preprocess JSON for references, functions, etc
1394
1268
  name: "Columns",
1395
1269
  isRSC: !0,
@@ -1568,7 +1442,7 @@ const componentInfo$f = {
1568
1442
  });
1569
1443
  }
1570
1444
  const n = e.get("columns");
1571
- Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((s, c) => s + c.get("width"), 0) !== 100) && t();
1445
+ Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((r) => !r.get("width")) || n.reduce((l, d) => l + d.get("width"), 0) !== 100) && t();
1572
1446
  }
1573
1447
  }, {
1574
1448
  name: "space",
@@ -1590,13 +1464,13 @@ const componentInfo$f = {
1590
1464
  helperText: "When stacking columns for mobile devices, reverse the ordering",
1591
1465
  advanced: !0
1592
1466
  }]
1593
- }, componentInfo$d = {
1467
+ }, Ft = {
1594
1468
  name: "Fragment",
1595
1469
  static: !0,
1596
1470
  hidden: !0,
1597
1471
  canHaveChildren: !0,
1598
1472
  noWrap: !0
1599
- }, componentInfo$c = {
1473
+ }, $t = {
1600
1474
  name: "Image",
1601
1475
  static: !0,
1602
1476
  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",
@@ -1616,29 +1490,29 @@ const componentInfo$f = {
1616
1490
  defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
1617
1491
  onChange: (e) => {
1618
1492
  e.delete("srcset"), e.delete("noWebp");
1619
- function n(r, s = 6e4) {
1620
- return new Promise((c, l) => {
1621
- const u = document.createElement("img");
1622
- let m = !1;
1623
- u.onload = () => {
1624
- m = !0, c(u);
1625
- }, u.addEventListener("error", (g) => {
1626
- console.warn("Image load failed", g.error), l(g.error);
1627
- }), u.src = r, setTimeout(() => {
1628
- m || l(new Error("Image load timed out"));
1629
- }, s);
1493
+ function n(a, l = 6e4) {
1494
+ return new Promise((d, c) => {
1495
+ const m = document.createElement("img");
1496
+ let f = !1;
1497
+ m.onload = () => {
1498
+ f = !0, d(m);
1499
+ }, m.addEventListener("error", (g) => {
1500
+ console.warn("Image load failed", g.error), c(g.error);
1501
+ }), m.src = a, setTimeout(() => {
1502
+ f || c(new Error("Image load timed out"));
1503
+ }, l);
1630
1504
  });
1631
1505
  }
1632
- function i(r) {
1633
- return Math.round(r * 1e3) / 1e3;
1506
+ function i(a) {
1507
+ return Math.round(a * 1e3) / 1e3;
1634
1508
  }
1635
- const o = e.get("image"), a = e.get("aspectRatio");
1636
- if (fetch(o).then((r) => r.blob()).then((r) => {
1637
- r.type.includes("svg") && e.set("noWebp", !0);
1638
- }), o && (!a || a === 0.7041))
1639
- return n(o).then((r) => {
1640
- const s = e.get("aspectRatio");
1641
- 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));
1509
+ const o = e.get("image"), r = e.get("aspectRatio");
1510
+ if (fetch(o).then((a) => a.blob()).then((a) => {
1511
+ a.type.includes("svg") && e.set("noWebp", !0);
1512
+ }), o && (!r || r === 0.7041))
1513
+ return n(o).then((a) => {
1514
+ const l = e.get("aspectRatio");
1515
+ e.get("image") === o && (!l || l === 0.7041) && a.width && a.height && (e.set("aspectRatio", i(a.height / a.width)), e.set("height", a.height), e.set("width", a.width));
1642
1516
  });
1643
1517
  }
1644
1518
  }, {
@@ -1696,7 +1570,7 @@ const componentInfo$f = {
1696
1570
  advanced: !0,
1697
1571
  defaultValue: 0.7041
1698
1572
  }]
1699
- }, componentInfo$b = {
1573
+ }, Lt = {
1700
1574
  name: "Core:Section",
1701
1575
  static: !0,
1702
1576
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -1735,7 +1609,7 @@ const componentInfo$f = {
1735
1609
  }
1736
1610
  }
1737
1611
  }]
1738
- }, componentInfo$a = {
1612
+ }, Dt = {
1739
1613
  name: "Slot",
1740
1614
  isRSC: !0,
1741
1615
  description: "Allow child blocks to be inserted into this content when used as a Symbol",
@@ -1749,9 +1623,9 @@ const componentInfo$f = {
1749
1623
  defaultValue: "children"
1750
1624
  }]
1751
1625
  };
1752
- function Slot(e) {
1626
+ function Mt(e) {
1753
1627
  var t, n, i;
1754
- return /* @__PURE__ */ jsx(
1628
+ return /* @__PURE__ */ s(
1755
1629
  "div",
1756
1630
  {
1757
1631
  style: {
@@ -1760,8 +1634,8 @@ function Slot(e) {
1760
1634
  ...!((t = e.builderContext.context) != null && t.symbolId) && {
1761
1635
  "builder-slot": e.name
1762
1636
  },
1763
- children: /* @__PURE__ */ jsx(
1764
- Blocks,
1637
+ children: /* @__PURE__ */ s(
1638
+ O,
1765
1639
  {
1766
1640
  parent: (n = e.builderContext.context) == null ? void 0 : n.symbolId,
1767
1641
  path: `symbol.data.${e.name}`,
@@ -1772,7 +1646,7 @@ function Slot(e) {
1772
1646
  }
1773
1647
  );
1774
1648
  }
1775
- const componentInfo$9 = {
1649
+ const jt = {
1776
1650
  name: "Symbol",
1777
1651
  noWrap: !0,
1778
1652
  static: !0,
@@ -1805,7 +1679,7 @@ const componentInfo$9 = {
1805
1679
  hideFromUI: !0,
1806
1680
  type: "boolean"
1807
1681
  }]
1808
- }, componentInfo$8 = {
1682
+ }, Ot = {
1809
1683
  name: "Text",
1810
1684
  static: !0,
1811
1685
  isRSC: !0,
@@ -1824,9 +1698,9 @@ const componentInfo$9 = {
1824
1698
  textAlign: "center"
1825
1699
  }
1826
1700
  };
1827
- function Text(e) {
1701
+ function Ut(e) {
1828
1702
  var t;
1829
- return /* @__PURE__ */ jsx(
1703
+ return /* @__PURE__ */ s(
1830
1704
  "div",
1831
1705
  {
1832
1706
  className: "builder-text",
@@ -1837,7 +1711,7 @@ function Text(e) {
1837
1711
  }
1838
1712
  );
1839
1713
  }
1840
- const componentInfo$7 = {
1714
+ const Ht = {
1841
1715
  name: "Custom Code",
1842
1716
  static: !0,
1843
1717
  requiredPermissions: ["editCode"],
@@ -1860,36 +1734,36 @@ const componentInfo$7 = {
1860
1734
  advanced: !0
1861
1735
  }]
1862
1736
  };
1863
- function CustomCode(e) {
1864
- const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []);
1865
- return useEffect(() => {
1866
- var s;
1867
- if (!((s = t.current) != null && s.getElementsByTagName) || typeof window == "undefined")
1737
+ function Kt(e) {
1738
+ const t = X(null), [n, i] = k(() => []), [o, r] = k(() => []);
1739
+ return V(() => {
1740
+ var l;
1741
+ if (!((l = t.current) != null && l.getElementsByTagName) || typeof window == "undefined")
1868
1742
  return;
1869
- const r = t.current.getElementsByTagName("script");
1870
- for (let c = 0; c < r.length; c++) {
1871
- const l = r[c];
1872
- if (l.src) {
1873
- if (n.includes(l.src))
1743
+ const a = t.current.getElementsByTagName("script");
1744
+ for (let d = 0; d < a.length; d++) {
1745
+ const c = a[d];
1746
+ if (c.src) {
1747
+ if (n.includes(c.src))
1874
1748
  continue;
1875
- n.push(l.src);
1876
- const u = document.createElement("script");
1877
- u.async = !0, u.src = l.src, document.head.appendChild(u);
1878
- } else if (!l.type || [
1749
+ n.push(c.src);
1750
+ const m = document.createElement("script");
1751
+ m.async = !0, m.src = c.src, document.head.appendChild(m);
1752
+ } else if (!c.type || [
1879
1753
  "text/javascript",
1880
1754
  "application/javascript",
1881
1755
  "application/ecmascript"
1882
- ].includes(l.type)) {
1883
- if (o.includes(l.innerText))
1756
+ ].includes(c.type)) {
1757
+ if (o.includes(c.innerText))
1884
1758
  continue;
1885
1759
  try {
1886
- o.push(l.innerText), new Function(l.innerText)();
1887
- } catch (u) {
1888
- console.warn("`CustomCode`: Error running script:", u);
1760
+ o.push(c.innerText), new Function(c.innerText)();
1761
+ } catch (m) {
1762
+ console.warn("`CustomCode`: Error running script:", m);
1889
1763
  }
1890
1764
  }
1891
1765
  }
1892
- }, []), /* @__PURE__ */ jsx(
1766
+ }, []), /* @__PURE__ */ s(
1893
1767
  "div",
1894
1768
  {
1895
1769
  ref: t,
@@ -1898,7 +1772,7 @@ function CustomCode(e) {
1898
1772
  }
1899
1773
  );
1900
1774
  }
1901
- const componentInfo$6 = {
1775
+ const qt = {
1902
1776
  name: "Embed",
1903
1777
  static: !0,
1904
1778
  inputs: [{
@@ -1923,30 +1797,30 @@ const componentInfo$6 = {
1923
1797
  defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
1924
1798
  hideFromUI: !0
1925
1799
  }]
1926
- }, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
1927
- function Embed(e) {
1928
- const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r, s] = useState(() => !1);
1929
- function c() {
1800
+ }, _t = ["text/javascript", "application/javascript", "application/ecmascript"], zt = (e) => _t.includes(e.type);
1801
+ function Jt(e) {
1802
+ const t = X(null), [n, i] = k(() => []), [o, r] = k(() => []), [a, l] = k(() => !1);
1803
+ function d() {
1930
1804
  if (!t.current || !t.current.getElementsByTagName)
1931
1805
  return;
1932
- const l = t.current.getElementsByTagName("script");
1933
- for (let u = 0; u < l.length; u++) {
1934
- const m = l[u];
1935
- if (m.src && !n.includes(m.src)) {
1936
- n.push(m.src);
1806
+ const c = t.current.getElementsByTagName("script");
1807
+ for (let m = 0; m < c.length; m++) {
1808
+ const f = c[m];
1809
+ if (f.src && !n.includes(f.src)) {
1810
+ n.push(f.src);
1937
1811
  const g = document.createElement("script");
1938
- g.async = !0, g.src = m.src, document.head.appendChild(g);
1939
- } else if (isJsScript(m) && !o.includes(m.innerText))
1812
+ g.async = !0, g.src = f.src, document.head.appendChild(g);
1813
+ } else if (zt(f) && !o.includes(f.innerText))
1940
1814
  try {
1941
- o.push(m.innerText), new Function(m.innerText)();
1815
+ o.push(f.innerText), new Function(f.innerText)();
1942
1816
  } catch (g) {
1943
1817
  console.warn("`Embed`: Error running script:", g);
1944
1818
  }
1945
1819
  }
1946
1820
  }
1947
- return useEffect(() => {
1948
- t.current && !r && (s(!0), c());
1949
- }, [t.current, r]), /* @__PURE__ */ jsx(
1821
+ return V(() => {
1822
+ t.current && !a && (l(!0), d());
1823
+ }, [t.current, a]), /* @__PURE__ */ s(
1950
1824
  "div",
1951
1825
  {
1952
1826
  className: "builder-embed",
@@ -1955,7 +1829,7 @@ function Embed(e) {
1955
1829
  }
1956
1830
  );
1957
1831
  }
1958
- const componentInfo$5 = {
1832
+ const Yt = {
1959
1833
  name: "Form:Form",
1960
1834
  // editableTags: ['builder-form-error']
1961
1835
  defaults: {
@@ -2186,99 +2060,99 @@ const componentInfo$5 = {
2186
2060
  }
2187
2061
  }
2188
2062
  }]
2189
- }, validEnvList = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"], getEnv = () => {
2063
+ }, Gt = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"], Qt = () => {
2190
2064
  const e = process.env.NODE_ENV || "production";
2191
- return validEnvList.includes(e) ? e : "production";
2192
- }, get = (e, t, n) => {
2193
- const i = String.prototype.split.call(t, /[,[\].]+?/).filter(Boolean).reduce((o, a) => o != null ? o[a] : o, e);
2065
+ return Gt.includes(e) ? e : "production";
2066
+ }, Xt = (e, t, n) => {
2067
+ const i = String.prototype.split.call(t, /[,[\].]+?/).filter(Boolean).reduce((o, r) => o != null ? o[r] : o, e);
2194
2068
  return i === void 0 || i === e ? n : i;
2195
2069
  };
2196
- function FormComponent(e) {
2197
- var m, g;
2198
- const t = useRef(null), [n, i] = useState(() => "unsubmitted"), [o, a] = useState(() => null), [r, s] = useState(() => "");
2199
- function c(h) {
2200
- var p, k;
2201
- const y = {
2070
+ function Zt(e) {
2071
+ var f, g;
2072
+ const t = X(null), [n, i] = k(() => "unsubmitted"), [o, r] = k(() => null), [a, l] = k(() => "");
2073
+ function d(y) {
2074
+ var C, I;
2075
+ const S = {
2202
2076
  ...e.builderContext.rootState,
2203
- ...h
2077
+ ...y
2204
2078
  };
2205
- e.builderContext.rootSetState ? (k = (p = e.builderContext).rootSetState) == null || k.call(p, y) : e.builderContext.rootState = y;
2079
+ e.builderContext.rootSetState ? (I = (C = e.builderContext).rootSetState) == null || I.call(C, S) : e.builderContext.rootState = S;
2206
2080
  }
2207
- function l() {
2208
- return isEditing() && e.previewState || n;
2081
+ function c() {
2082
+ return F() && e.previewState || n;
2209
2083
  }
2210
- function u(h) {
2211
- var p;
2212
- const y = e.sendWithJs || e.sendSubmissionsTo === "email";
2084
+ function m(y) {
2085
+ var C;
2086
+ const S = e.sendWithJs || e.sendSubmissionsTo === "email";
2213
2087
  if (e.sendSubmissionsTo === "zapier")
2214
- h.preventDefault();
2215
- else if (y) {
2088
+ y.preventDefault();
2089
+ else if (S) {
2216
2090
  if (!(e.action || e.sendSubmissionsTo === "email")) {
2217
- h.preventDefault();
2091
+ y.preventDefault();
2218
2092
  return;
2219
2093
  }
2220
- h.preventDefault();
2221
- const k = h.currentTarget, T = e.customHeaders || {};
2222
- let S;
2223
- const C = new FormData(k), E = Array.from(
2224
- h.currentTarget.querySelectorAll("input,select,textarea")
2225
- ).filter((d) => !!d.name).map((d) => {
2226
- let f;
2227
- const v = d.name;
2228
- if (d instanceof HTMLInputElement)
2229
- if (d.type === "radio") {
2230
- if (d.checked)
2231
- return f = d.name, {
2094
+ y.preventDefault();
2095
+ const I = y.currentTarget, R = e.customHeaders || {};
2096
+ let p;
2097
+ const w = new FormData(I), P = Array.from(
2098
+ y.currentTarget.querySelectorAll("input,select,textarea")
2099
+ ).filter((u) => !!u.name).map((u) => {
2100
+ let h;
2101
+ const v = u.name;
2102
+ if (u instanceof HTMLInputElement)
2103
+ if (u.type === "radio") {
2104
+ if (u.checked)
2105
+ return h = u.name, {
2232
2106
  key: v,
2233
- value: f
2107
+ value: h
2234
2108
  };
2235
- } else if (d.type === "checkbox")
2236
- f = d.checked;
2237
- else if (d.type === "number" || d.type === "range") {
2238
- const b = d.valueAsNumber;
2239
- isNaN(b) || (f = b);
2109
+ } else if (u.type === "checkbox")
2110
+ h = u.checked;
2111
+ else if (u.type === "number" || u.type === "range") {
2112
+ const b = u.valueAsNumber;
2113
+ isNaN(b) || (h = b);
2240
2114
  } else
2241
- d.type === "file" ? f = d.files : f = d.value;
2115
+ u.type === "file" ? h = u.files : h = u.value;
2242
2116
  else
2243
- f = d.value;
2117
+ h = u.value;
2244
2118
  return {
2245
2119
  key: v,
2246
- value: f
2120
+ value: h
2247
2121
  };
2248
2122
  });
2249
- let I = e.contentType;
2250
- if (e.sendSubmissionsTo === "email" && (I = "multipart/form-data"), Array.from(E).forEach(({ value: d }) => {
2251
- (d instanceof File || Array.isArray(d) && d[0] instanceof File || d instanceof FileList) && (I = "multipart/form-data");
2252
- }), I !== "application/json")
2253
- S = C;
2123
+ let E = e.contentType;
2124
+ if (e.sendSubmissionsTo === "email" && (E = "multipart/form-data"), Array.from(P).forEach(({ value: u }) => {
2125
+ (u instanceof File || Array.isArray(u) && u[0] instanceof File || u instanceof FileList) && (E = "multipart/form-data");
2126
+ }), E !== "application/json")
2127
+ p = w;
2254
2128
  else {
2255
- const d = {};
2256
- Array.from(E).forEach(({ value: f, key: v }) => {
2257
- set(d, v, f);
2258
- }), S = JSON.stringify(d);
2129
+ const u = {};
2130
+ Array.from(P).forEach(({ value: h, key: v }) => {
2131
+ we(u, v, h);
2132
+ }), p = JSON.stringify(u);
2259
2133
  }
2260
- I && I !== "multipart/form-data" && (y && ((p = e.action) != null && p.includes("zapier.com")) || (T["content-type"] = I));
2261
- const B = new CustomEvent("presubmit", { detail: { body: S } });
2262
- if (t.current && (t.current.dispatchEvent(B), B.defaultPrevented))
2134
+ E && E !== "multipart/form-data" && (S && ((C = e.action) != null && C.includes("zapier.com")) || (R["content-type"] = E));
2135
+ const $ = new CustomEvent("presubmit", { detail: { body: p } });
2136
+ if (t.current && (t.current.dispatchEvent($), $.defaultPrevented))
2263
2137
  return;
2264
2138
  i("sending");
2265
- const j = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(
2139
+ const L = `${Qt() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(
2266
2140
  e.sendSubmissionsToEmail || ""
2267
2141
  )}&name=${encodeURIComponent(e.name || "")}`;
2268
2142
  fetch(
2269
- e.sendSubmissionsTo === "email" ? j : e.action,
2270
- { body: S, headers: T, method: e.method || "post" }
2143
+ e.sendSubmissionsTo === "email" ? L : e.action,
2144
+ { body: p, headers: R, method: e.method || "post" }
2271
2145
  ).then(
2272
- async (d) => {
2273
- let f;
2274
- const v = d.headers.get("content-type");
2275
- if (v && v.indexOf("application/json") !== -1 ? f = await d.json() : f = await d.text(), !d.ok && e.errorMessagePath) {
2276
- let b = get(f, e.errorMessagePath);
2277
- b && (typeof b != "string" && (b = JSON.stringify(b)), s(b), c({ formErrorMessage: b }));
2146
+ async (u) => {
2147
+ let h;
2148
+ const v = u.headers.get("content-type");
2149
+ if (v && v.indexOf("application/json") !== -1 ? h = await u.json() : h = await u.text(), !u.ok && e.errorMessagePath) {
2150
+ let b = Xt(h, e.errorMessagePath);
2151
+ b && (typeof b != "string" && (b = JSON.stringify(b)), l(b), d({ formErrorMessage: b }));
2278
2152
  }
2279
- if (a(f), i(d.ok ? "success" : "error"), d.ok) {
2153
+ if (r(h), i(u.ok ? "success" : "error"), u.ok) {
2280
2154
  const b = new CustomEvent("submit:success", {
2281
- detail: { res: d, body: f }
2155
+ detail: { res: u, body: h }
2282
2156
  });
2283
2157
  if (t.current) {
2284
2158
  if (t.current.dispatchEvent(b), b.defaultPrevented)
@@ -2295,18 +2169,18 @@ function FormComponent(e) {
2295
2169
  location.href = e.successUrl;
2296
2170
  }
2297
2171
  },
2298
- (d) => {
2299
- const f = new CustomEvent("submit:error", {
2300
- detail: { error: d }
2172
+ (u) => {
2173
+ const h = new CustomEvent("submit:error", {
2174
+ detail: { error: u }
2301
2175
  });
2302
- t.current && (t.current.dispatchEvent(f), f.defaultPrevented) || (a(d), i("error"));
2176
+ t.current && (t.current.dispatchEvent(h), h.defaultPrevented) || (r(u), i("error"));
2303
2177
  }
2304
2178
  );
2305
2179
  }
2306
2180
  }
2307
- return /* @__PURE__ */ jsxs(Fragment, { children: [
2181
+ return /* @__PURE__ */ B(T, { children: [
2308
2182
  " ",
2309
- /* @__PURE__ */ jsxs(
2183
+ /* @__PURE__ */ B(
2310
2184
  "form",
2311
2185
  {
2312
2186
  validate: e.validate,
@@ -2314,38 +2188,38 @@ function FormComponent(e) {
2314
2188
  action: !e.sendWithJs && e.action,
2315
2189
  method: e.method,
2316
2190
  name: e.name,
2317
- onSubmit: (h) => u(h),
2191
+ onSubmit: (y) => m(y),
2318
2192
  ...e.attributes,
2319
2193
  children: [
2320
- e.builderBlock && e.builderBlock.children ? /* @__PURE__ */ jsx(Fragment, { children: (g = (m = e.builderBlock) == null ? void 0 : m.children) == null ? void 0 : g.map((h, y) => /* @__PURE__ */ jsx(
2321
- Block,
2194
+ e.builderBlock && e.builderBlock.children ? /* @__PURE__ */ s(T, { children: (g = (f = e.builderBlock) == null ? void 0 : f.children) == null ? void 0 : g.map((y, S) => /* @__PURE__ */ s(
2195
+ _,
2322
2196
  {
2323
- block: h,
2197
+ block: y,
2324
2198
  context: e.builderContext,
2325
2199
  registeredComponents: e.builderComponents,
2326
2200
  linkComponent: e.builderLinkComponent
2327
2201
  },
2328
- `form-block-${y}`
2202
+ `form-block-${S}`
2329
2203
  )) }) : null,
2330
- l() === "error" ? /* @__PURE__ */ jsx(
2331
- Blocks,
2204
+ c() === "error" ? /* @__PURE__ */ s(
2205
+ O,
2332
2206
  {
2333
2207
  path: "errorMessage",
2334
2208
  blocks: e.errorMessage,
2335
2209
  context: e.builderContext
2336
2210
  }
2337
2211
  ) : null,
2338
- l() === "sending" ? /* @__PURE__ */ jsx(
2339
- Blocks,
2212
+ c() === "sending" ? /* @__PURE__ */ s(
2213
+ O,
2340
2214
  {
2341
2215
  path: "sendingMessage",
2342
2216
  blocks: e.sendingMessage,
2343
2217
  context: e.builderContext
2344
2218
  }
2345
2219
  ) : null,
2346
- l() === "error" && o ? /* @__PURE__ */ jsx("pre", { className: "builder-form-error-text pre-31bf8a14", children: JSON.stringify(o, null, 2) }) : null,
2347
- l() === "success" ? /* @__PURE__ */ jsx(
2348
- Blocks,
2220
+ c() === "error" && o ? /* @__PURE__ */ s("pre", { className: "builder-form-error-text pre-31bf8a14", children: JSON.stringify(o, null, 2) }) : null,
2221
+ c() === "success" ? /* @__PURE__ */ s(
2222
+ O,
2349
2223
  {
2350
2224
  path: "successMessage",
2351
2225
  blocks: e.successMessage,
@@ -2356,11 +2230,11 @@ function FormComponent(e) {
2356
2230
  }
2357
2231
  ),
2358
2232
  " ",
2359
- /* @__PURE__ */ jsx("style", { children: ".pre-31bf8a14 { padding: 10px; color: red; text-align: center; }" }),
2233
+ /* @__PURE__ */ s("style", { children: ".pre-31bf8a14 { padding: 10px; color: red; text-align: center; }" }),
2360
2234
  " "
2361
2235
  ] });
2362
2236
  }
2363
- const componentInfo$4 = {
2237
+ const en = {
2364
2238
  name: "Form:Input",
2365
2239
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
2366
2240
  inputs: [
@@ -2412,12 +2286,12 @@ const componentInfo$4 = {
2412
2286
  borderColor: "#ccc"
2413
2287
  }
2414
2288
  };
2415
- function FormInputComponent(e) {
2416
- return /* @__PURE__ */ createElement(
2289
+ function tn(e) {
2290
+ return /* @__PURE__ */ Ce(
2417
2291
  "input",
2418
2292
  {
2419
2293
  ...e.attributes,
2420
- key: isEditing() && e.defaultValue ? e.defaultValue : "default-key",
2294
+ key: F() && e.defaultValue ? e.defaultValue : "default-key",
2421
2295
  placeholder: e.placeholder,
2422
2296
  type: e.type,
2423
2297
  name: e.name,
@@ -2427,7 +2301,7 @@ function FormInputComponent(e) {
2427
2301
  }
2428
2302
  );
2429
2303
  }
2430
- const componentInfo$3 = {
2304
+ const nn = {
2431
2305
  name: "Form:Select",
2432
2306
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
2433
2307
  defaultStyles: {
@@ -2470,21 +2344,21 @@ const componentInfo$3 = {
2470
2344
  static: !0,
2471
2345
  noWrap: !0
2472
2346
  };
2473
- function SelectComponent(e) {
2347
+ function on(e) {
2474
2348
  var t;
2475
- return /* @__PURE__ */ createElement(
2349
+ return /* @__PURE__ */ Ce(
2476
2350
  "select",
2477
2351
  {
2478
2352
  ...e.attributes,
2479
2353
  value: e.value,
2480
- key: isEditing() && e.defaultValue ? e.defaultValue : "default-key",
2354
+ key: F() && e.defaultValue ? e.defaultValue : "default-key",
2481
2355
  defaultValue: e.defaultValue,
2482
2356
  name: e.name
2483
2357
  },
2484
- (t = e.options) == null ? void 0 : t.map((n, i) => /* @__PURE__ */ jsx("option", { value: n.value, children: n.name || n.value }, `${n.name}-${i}`))
2358
+ (t = e.options) == null ? void 0 : t.map((n, i) => /* @__PURE__ */ s("option", { value: n.value, children: n.name || n.value }, `${n.name}-${i}`))
2485
2359
  );
2486
2360
  }
2487
- const componentInfo$2 = {
2361
+ const an = {
2488
2362
  name: "Form:SubmitButton",
2489
2363
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
2490
2364
  defaultStyles: {
@@ -2510,10 +2384,10 @@ const componentInfo$2 = {
2510
2384
  // TODO: defaultChildren
2511
2385
  // canHaveChildren: true,
2512
2386
  };
2513
- function SubmitButton(e) {
2514
- return /* @__PURE__ */ jsx("button", { type: "submit", ...e.attributes, children: e.text });
2387
+ function rn(e) {
2388
+ return /* @__PURE__ */ s("button", { type: "submit", ...e.attributes, children: e.text });
2515
2389
  }
2516
- const componentInfo$1 = {
2390
+ const ln = {
2517
2391
  // friendlyName?
2518
2392
  name: "Raw:Img",
2519
2393
  hideFromInsertMenu: !0,
@@ -2528,8 +2402,8 @@ const componentInfo$1 = {
2528
2402
  noWrap: !0,
2529
2403
  static: !0
2530
2404
  };
2531
- function ImgComponent(e) {
2532
- return /* @__PURE__ */ jsx(
2405
+ function sn(e) {
2406
+ return /* @__PURE__ */ s(
2533
2407
  "img",
2534
2408
  {
2535
2409
  style: {
@@ -2540,10 +2414,10 @@ function ImgComponent(e) {
2540
2414
  src: e.imgSrc || e.image,
2541
2415
  ...e.attributes
2542
2416
  },
2543
- isEditing() && e.imgSrc || "default-key"
2417
+ F() && e.imgSrc || "default-key"
2544
2418
  );
2545
2419
  }
2546
- const componentInfo = {
2420
+ const cn = {
2547
2421
  name: "Video",
2548
2422
  canHaveChildren: !0,
2549
2423
  defaultStyles: {
@@ -2625,8 +2499,8 @@ const componentInfo = {
2625
2499
  advanced: !0
2626
2500
  }]
2627
2501
  };
2628
- function Video(e) {
2629
- var i, o, a, r, s, c, l;
2502
+ function dn(e) {
2503
+ var i, o, r, a, l, d, c;
2630
2504
  function t() {
2631
2505
  return {
2632
2506
  ...e.autoPlay === !0 ? {
@@ -2651,14 +2525,14 @@ function Video(e) {
2651
2525
  ...t()
2652
2526
  };
2653
2527
  }
2654
- return /* @__PURE__ */ jsxs(
2528
+ return /* @__PURE__ */ B(
2655
2529
  "div",
2656
2530
  {
2657
2531
  style: {
2658
2532
  position: "relative"
2659
2533
  },
2660
2534
  children: [
2661
- /* @__PURE__ */ jsx(
2535
+ /* @__PURE__ */ s(
2662
2536
  "video",
2663
2537
  {
2664
2538
  className: "builder-video",
@@ -2680,10 +2554,10 @@ function Video(e) {
2680
2554
  },
2681
2555
  src: e.video || "no-src",
2682
2556
  poster: e.posterImage,
2683
- children: e.lazyLoad ? null : /* @__PURE__ */ jsx("source", { type: "video/mp4", src: e.video })
2557
+ children: e.lazyLoad ? null : /* @__PURE__ */ s("source", { type: "video/mp4", src: e.video })
2684
2558
  }
2685
2559
  ),
2686
- e.aspectRatio && !(e.fitContent && ((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length)) ? /* @__PURE__ */ jsx(
2560
+ e.aspectRatio && !(e.fitContent && ((r = (o = e.builderBlock) == null ? void 0 : o.children) != null && r.length)) ? /* @__PURE__ */ s(
2687
2561
  "div",
2688
2562
  {
2689
2563
  style: {
@@ -2694,7 +2568,7 @@ function Video(e) {
2694
2568
  }
2695
2569
  }
2696
2570
  ) : null,
2697
- (s = (r = e.builderBlock) == null ? void 0 : r.children) != null && s.length && e.fitContent ? /* @__PURE__ */ jsx(
2571
+ (l = (a = e.builderBlock) == null ? void 0 : a.children) != null && l.length && e.fitContent ? /* @__PURE__ */ s(
2698
2572
  "div",
2699
2573
  {
2700
2574
  style: {
@@ -2705,7 +2579,7 @@ function Video(e) {
2705
2579
  children: e.children
2706
2580
  }
2707
2581
  ) : null,
2708
- (l = (c = e.builderBlock) == null ? void 0 : c.children) != null && l.length && !e.fitContent ? /* @__PURE__ */ jsx(
2582
+ (c = (d = e.builderBlock) == null ? void 0 : d.children) != null && c.length && !e.fitContent ? /* @__PURE__ */ s(
2709
2583
  "div",
2710
2584
  {
2711
2585
  style: {
@@ -2726,55 +2600,55 @@ function Video(e) {
2726
2600
  }
2727
2601
  );
2728
2602
  }
2729
- const getExtraComponents = () => [{
2730
- component: CustomCode,
2731
- ...componentInfo$7
2603
+ const un = () => [{
2604
+ component: Kt,
2605
+ ...Ht
2732
2606
  }, {
2733
- component: Embed,
2734
- ...componentInfo$6
2607
+ component: Jt,
2608
+ ...qt
2735
2609
  }, {
2736
- component: FormComponent,
2737
- ...componentInfo$5
2610
+ component: Zt,
2611
+ ...Yt
2738
2612
  }, {
2739
- component: FormInputComponent,
2740
- ...componentInfo$4
2613
+ component: tn,
2614
+ ...en
2741
2615
  }, {
2742
- component: SubmitButton,
2743
- ...componentInfo$2
2616
+ component: rn,
2617
+ ...an
2744
2618
  }, {
2745
- component: SelectComponent,
2746
- ...componentInfo$3
2619
+ component: on,
2620
+ ...nn
2747
2621
  }, {
2748
- component: ImgComponent,
2749
- ...componentInfo$1
2622
+ component: sn,
2623
+ ...ln
2750
2624
  }, {
2751
- component: Video,
2752
- ...componentInfo
2753
- }], getDefaultRegisteredComponents = () => [{
2754
- component: Button,
2755
- ...componentInfo$f
2625
+ component: dn,
2626
+ ...cn
2627
+ }], ye = () => [{
2628
+ component: Xe,
2629
+ ...Nt
2756
2630
  }, {
2757
- component: Columns,
2758
- ...componentInfo$e
2631
+ component: Et,
2632
+ ...At
2759
2633
  }, {
2760
- component: FragmentComponent,
2761
- ...componentInfo$d
2634
+ component: Rt,
2635
+ ...Ft
2762
2636
  }, {
2763
- component: Image,
2764
- ...componentInfo$c
2637
+ component: Bt,
2638
+ ...$t
2765
2639
  }, {
2766
- component: SectionComponent,
2767
- ...componentInfo$b
2640
+ component: Wt,
2641
+ ...Lt
2768
2642
  }, {
2769
- component: Slot,
2770
- ...componentInfo$a
2643
+ component: Mt,
2644
+ ...Dt
2771
2645
  }, {
2772
- component: Symbol$1,
2773
- ...componentInfo$9
2646
+ component: Nn,
2647
+ ...jt
2774
2648
  }, {
2775
- component: Text,
2776
- ...componentInfo$8
2777
- }, ...getExtraComponents()], UPDATE_COOKIES_AND_STYLES_SCRIPT = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
2649
+ component: Ut,
2650
+ ...Ot
2651
+ }, ...un()], mn = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
2778
2652
  function getAndSetVariantId() {
2779
2653
  function setCookie(name, value, days) {
2780
2654
  let expires = '';
@@ -2830,7 +2704,7 @@ const getExtraComponents = () => [{
2830
2704
  }).join('');
2831
2705
  styleEl.innerHTML = newStyleStr;
2832
2706
  }
2833
- }`, UPDATE_VARIANT_VISIBILITY_SCRIPT = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
2707
+ }`, fn = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
2834
2708
  if (!navigator.cookieEnabled) {
2835
2709
  return;
2836
2710
  }
@@ -2864,27 +2738,27 @@ const getExtraComponents = () => [{
2864
2738
  thisScriptEl?.remove();
2865
2739
  }
2866
2740
  return;
2867
- }`, UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest", UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "builderIoRenderContent", getVariants = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
2741
+ }`, Ne = "builderIoAbTest", Ae = "builderIoRenderContent", z = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
2868
2742
  ...t,
2869
2743
  testVariationId: t.id,
2870
2744
  id: e == null ? void 0 : e.id
2871
- })), checkShouldRenderVariants = ({
2745
+ })), hn = ({
2872
2746
  canTrack: e,
2873
2747
  content: t
2874
- }) => !(!(getVariants(t).length > 0) || !e || isBrowser()), getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydrationTarget = getIsHydrationTarget(TARGET), getInitVariantsFnsScriptString = () => `
2875
- window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
2876
- window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
2877
- `, getUpdateCookieAndStylesScript = (e, t) => `
2878
- window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}(
2879
- "${t}",${JSON.stringify(e)}, ${isHydrationTarget}
2880
- )`, getUpdateVariantVisibilityScript = ({
2748
+ }) => !(!(z(t).length > 0) || !e || Y()), gn = (e) => e === "react" || e === "reactNative", Fe = gn(q), bn = () => `
2749
+ window.${Ne} = ${mn}
2750
+ window.${Ae} = ${fn}
2751
+ `, yn = (e, t) => `
2752
+ window.${Ne}(
2753
+ "${t}",${JSON.stringify(e)}, ${Fe}
2754
+ )`, pn = ({
2881
2755
  contentId: e,
2882
2756
  variationId: t
2883
- }) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
2884
- "${t}", "${e}", ${isHydrationTarget}
2757
+ }) => `window.${Ae}(
2758
+ "${t}", "${e}", ${Fe}
2885
2759
  )`;
2886
- function InlinedScript(e) {
2887
- return /* @__PURE__ */ jsx(
2760
+ function ie(e) {
2761
+ return /* @__PURE__ */ s(
2888
2762
  "script",
2889
2763
  {
2890
2764
  dangerouslySetInnerHTML: { __html: e.scriptStr },
@@ -2892,10 +2766,10 @@ function InlinedScript(e) {
2892
2766
  }
2893
2767
  );
2894
2768
  }
2895
- function round(e) {
2769
+ function pe(e) {
2896
2770
  return Math.round(e * 1e3) / 1e3;
2897
2771
  }
2898
- const findParentElement = (e, t, n = !0) => {
2772
+ const xn = (e, t, n = !0) => {
2899
2773
  if (!(e instanceof HTMLElement))
2900
2774
  return null;
2901
2775
  let i = n ? e : e.parentElement;
@@ -2906,28 +2780,28 @@ const findParentElement = (e, t, n = !0) => {
2906
2780
  return i;
2907
2781
  } while (i = i.parentElement);
2908
2782
  return null;
2909
- }, findBuilderParent = (e) => findParentElement(e, (t) => {
2783
+ }, Sn = (e) => xn(e, (t) => {
2910
2784
  const n = t.getAttribute("builder-id") || t.id;
2911
2785
  return (n == null ? void 0 : n.indexOf("builder-")) === 0;
2912
- }), computeOffset = ({
2786
+ }), xe = ({
2913
2787
  event: e,
2914
2788
  target: t
2915
2789
  }) => {
2916
- const n = t.getBoundingClientRect(), i = e.clientX - n.left, o = e.clientY - n.top, a = round(i / n.width), r = round(o / n.height);
2790
+ const n = t.getBoundingClientRect(), i = e.clientX - n.left, o = e.clientY - n.top, r = pe(i / n.width), a = pe(o / n.height);
2917
2791
  return {
2918
- x: a,
2919
- y: r
2792
+ x: r,
2793
+ y: a
2920
2794
  };
2921
- }, getInteractionPropertiesForEvent = (e) => {
2922
- const t = e.target, n = t && findBuilderParent(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
2795
+ }, vn = (e) => {
2796
+ const t = e.target, n = t && Sn(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
2923
2797
  return {
2924
2798
  targetBuilderElement: i || void 0,
2925
2799
  metadata: {
2926
- targetOffset: t ? computeOffset({
2800
+ targetOffset: t ? xe({
2927
2801
  event: e,
2928
2802
  target: t
2929
2803
  }) : void 0,
2930
- builderTargetOffset: n ? computeOffset({
2804
+ builderTargetOffset: n ? xe({
2931
2805
  event: e,
2932
2806
  target: n
2933
2807
  }) : void 0,
@@ -2935,71 +2809,71 @@ const findParentElement = (e, t, n = !0) => {
2935
2809
  }
2936
2810
  };
2937
2811
  };
2938
- function EnableEditor(e) {
2939
- var T, S, C, E, I, B, j;
2940
- const t = useRef(null);
2941
- function n(d) {
2812
+ function kn(e) {
2813
+ var R, p, w, P, E, $, L;
2814
+ const t = X(null);
2815
+ function n(u) {
2942
2816
  var v, b;
2943
- const f = {
2817
+ const h = {
2944
2818
  ...e.builderContextSignal.rootState,
2945
- ...d
2819
+ ...u
2946
2820
  };
2947
- e.builderContextSignal.rootSetState ? (b = (v = e.builderContextSignal).rootSetState) == null || b.call(v, f) : e.setBuilderContextSignal((x) => ({
2821
+ e.builderContextSignal.rootSetState ? (b = (v = e.builderContextSignal).rootSetState) == null || b.call(v, h) : e.setBuilderContextSignal((x) => ({
2948
2822
  ...x,
2949
- rootState: f
2823
+ rootState: h
2950
2824
  }));
2951
2825
  }
2952
- function i(d) {
2953
- var v, b, x, w, A;
2954
- const f = {
2826
+ function i(u) {
2827
+ var v, b, x, W, M;
2828
+ const h = {
2955
2829
  ...e.builderContextSignal.content,
2956
- ...d,
2830
+ ...u,
2957
2831
  data: {
2958
2832
  ...(v = e.builderContextSignal.content) == null ? void 0 : v.data,
2959
- ...d == null ? void 0 : d.data
2833
+ ...u == null ? void 0 : u.data
2960
2834
  },
2961
2835
  meta: {
2962
2836
  ...(b = e.builderContextSignal.content) == null ? void 0 : b.meta,
2963
- ...d == null ? void 0 : d.meta,
2964
- breakpoints: ((x = d == null ? void 0 : d.meta) == null ? void 0 : x.breakpoints) || ((A = (w = e.builderContextSignal.content) == null ? void 0 : w.meta) == null ? void 0 : A.breakpoints)
2837
+ ...u == null ? void 0 : u.meta,
2838
+ breakpoints: ((x = u == null ? void 0 : u.meta) == null ? void 0 : x.breakpoints) || ((M = (W = e.builderContextSignal.content) == null ? void 0 : W.meta) == null ? void 0 : M.breakpoints)
2965
2839
  }
2966
2840
  };
2967
- e.setBuilderContextSignal((R) => ({
2968
- ...R,
2969
- content: f
2841
+ e.setBuilderContextSignal((N) => ({
2842
+ ...N,
2843
+ content: h
2970
2844
  }));
2971
2845
  }
2972
- const [o, a] = useState(
2846
+ const [o, r] = k(
2973
2847
  () => e.contentWrapper || "div"
2974
2848
  );
2975
- function r(d) {
2976
- return createEditorListener({
2849
+ function a(u) {
2850
+ return He({
2977
2851
  model: e.model,
2978
2852
  trustedHosts: e.trustedHosts,
2979
2853
  callbacks: {
2980
- configureSdk: (f) => {
2854
+ configureSdk: (h) => {
2981
2855
  var x;
2982
- const { breakpoints: v, contentId: b } = f;
2856
+ const { breakpoints: v, contentId: b } = h;
2983
2857
  !b || b !== ((x = e.builderContextSignal.content) == null ? void 0 : x.id) || v && i({
2984
2858
  meta: {
2985
2859
  breakpoints: v
2986
2860
  }
2987
2861
  });
2988
2862
  },
2989
- animation: (f) => {
2990
- triggerAnimation(f);
2863
+ animation: (h) => {
2864
+ Ee(h);
2991
2865
  },
2992
- contentUpdate: (f) => {
2993
- i(f);
2866
+ contentUpdate: (h) => {
2867
+ i(h);
2994
2868
  }
2995
2869
  }
2996
- })(d);
2870
+ })(u);
2997
2871
  }
2998
- function s() {
2999
- var f, v;
3000
- const d = (v = (f = e.builderContextSignal.content) == null ? void 0 : f.data) == null ? void 0 : v.jsCode;
3001
- d && evaluate({
3002
- code: d,
2872
+ function l() {
2873
+ var h, v;
2874
+ const u = (v = (h = e.builderContextSignal.content) == null ? void 0 : h.data) == null ? void 0 : v.jsCode;
2875
+ u && K({
2876
+ code: u,
3003
2877
  context: e.context || {},
3004
2878
  localState: void 0,
3005
2879
  rootState: e.builderContextSignal.rootState,
@@ -3010,35 +2884,35 @@ function EnableEditor(e) {
3010
2884
  enableCache: !1
3011
2885
  });
3012
2886
  }
3013
- const [c, l] = useState(() => ({})), [u, m] = useState(() => ({})), [g, h] = useState(() => !1);
3014
- function y(d) {
3015
- var f, v;
2887
+ const [d, c] = k(() => ({})), [m, f] = k(() => ({})), [g, y] = k(() => !1);
2888
+ function S(u) {
2889
+ var h, v;
3016
2890
  if (e.builderContextSignal.content) {
3017
- const b = (f = e.builderContextSignal.content) == null ? void 0 : f.testVariationId, x = (v = e.builderContextSignal.content) == null ? void 0 : v.id;
3018
- _track({
2891
+ const b = (h = e.builderContextSignal.content) == null ? void 0 : h.testVariationId, x = (v = e.builderContextSignal.content) == null ? void 0 : v.id;
2892
+ ue({
3019
2893
  type: "click",
3020
- canTrack: getDefaultCanTrack(e.canTrack),
2894
+ canTrack: G(e.canTrack),
3021
2895
  contentId: x,
3022
2896
  apiKey: e.apiKey,
3023
2897
  variationId: b !== x ? b : void 0,
3024
- ...getInteractionPropertiesForEvent(d),
2898
+ ...vn(u),
3025
2899
  unique: !g
3026
2900
  });
3027
2901
  }
3028
- g || h(!0);
2902
+ g || y(!0);
3029
2903
  }
3030
- function p() {
3031
- var f, v, b;
3032
- const d = (b = (v = (f = e.builderContextSignal.content) == null ? void 0 : f.data) == null ? void 0 : v.httpRequests) != null ? b : {};
3033
- Object.entries(d).forEach(([x, w]) => {
3034
- if (!w || u[x] || c[x] && !isEditing())
2904
+ function C() {
2905
+ var h, v, b;
2906
+ const u = (b = (v = (h = e.builderContextSignal.content) == null ? void 0 : h.data) == null ? void 0 : v.httpRequests) != null ? b : {};
2907
+ Object.entries(u).forEach(([x, W]) => {
2908
+ if (!W || m[x] || d[x] && !F())
3035
2909
  return;
3036
- u[x] = !0;
3037
- const A = w.replace(
2910
+ m[x] = !0;
2911
+ const M = W.replace(
3038
2912
  /{{([^}]+)}}/g,
3039
- (R, V) => String(
3040
- evaluate({
3041
- code: V,
2913
+ (N, $e) => String(
2914
+ K({
2915
+ code: $e,
3042
2916
  context: e.context || {},
3043
2917
  localState: void 0,
3044
2918
  rootState: e.builderContextSignal.rootState,
@@ -3047,24 +2921,24 @@ function EnableEditor(e) {
3047
2921
  })
3048
2922
  )
3049
2923
  );
3050
- fetch$1(A).then((R) => R.json()).then((R) => {
2924
+ Ke(M).then((N) => N.json()).then((N) => {
3051
2925
  n({
3052
- [x]: R
3053
- }), c[x] = !0;
3054
- }).catch((R) => {
3055
- console.error("error fetching dynamic data", w, R);
2926
+ [x]: N
2927
+ }), d[x] = !0;
2928
+ }).catch((N) => {
2929
+ console.error("error fetching dynamic data", W, N);
3056
2930
  }).finally(() => {
3057
- u[x] = !1;
2931
+ m[x] = !1;
3058
2932
  });
3059
2933
  });
3060
2934
  }
3061
- function k() {
3062
- isEditing() && window.dispatchEvent(
2935
+ function I() {
2936
+ F() && window.dispatchEvent(
3063
2937
  new CustomEvent(
3064
2938
  "builder:component:stateChange",
3065
2939
  {
3066
2940
  detail: {
3067
- state: fastClone(e.builderContextSignal.rootState),
2941
+ state: oe(e.builderContextSignal.rootState),
3068
2942
  ref: {
3069
2943
  name: e.model
3070
2944
  }
@@ -3073,10 +2947,10 @@ function EnableEditor(e) {
3073
2947
  )
3074
2948
  );
3075
2949
  }
3076
- return useEffect(() => {
3077
- var d, f;
3078
- if (isBrowser()) {
3079
- if (isEditing() && (window.addEventListener("message", r), registerInsertMenu(), setupBrowserForEditing({
2950
+ return V(() => {
2951
+ var u, h;
2952
+ if (Y()) {
2953
+ if (F() && (window.addEventListener("message", a), Me(), je({
3080
2954
  ...e.locale ? {
3081
2955
  locale: e.locale
3082
2956
  } : {},
@@ -3089,78 +2963,78 @@ function EnableEditor(e) {
3089
2963
  }), Object.values(
3090
2964
  e.builderContextSignal.componentInfos
3091
2965
  ).forEach((b) => {
3092
- var w;
3093
- const x = createRegisterComponentMessage(b);
3094
- (w = window.parent) == null || w.postMessage(x, "*");
2966
+ var W;
2967
+ const x = Oe(b);
2968
+ (W = window.parent) == null || W.postMessage(x, "*");
3095
2969
  }), window.addEventListener(
3096
2970
  "builder:component:stateChangeListenerActivated",
3097
- k
3098
- )), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
3099
- const b = (d = e.builderContextSignal.content) == null ? void 0 : d.testVariationId, x = (f = e.builderContextSignal.content) == null ? void 0 : f.id, w = e.apiKey;
3100
- _track({
2971
+ I
2972
+ )), e.builderContextSignal.content && G(e.canTrack)) {
2973
+ const b = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId, x = (h = e.builderContextSignal.content) == null ? void 0 : h.id, W = e.apiKey;
2974
+ ue({
3101
2975
  type: "impression",
3102
2976
  canTrack: !0,
3103
2977
  contentId: x,
3104
- apiKey: w,
2978
+ apiKey: W,
3105
2979
  variationId: b !== x ? b : void 0
3106
2980
  });
3107
2981
  }
3108
- if (isPreviewing()) {
3109
- const b = new URL(location.href).searchParams, x = b.get("builder.preview"), w = b.get(
2982
+ if (Ue()) {
2983
+ const b = new URL(location.href).searchParams, x = b.get("builder.preview"), W = b.get(
3110
2984
  `builder.preview.${x}`
3111
- ), A = b.get("apiKey") || b.get("builder.space");
3112
- x === e.model && A === e.apiKey && (!e.content || w === e.content.id) && fetchOneEntry({
2985
+ ), M = b.get("apiKey") || b.get("builder.space");
2986
+ x === e.model && M === e.apiKey && (!e.content || W === e.content.id) && ve({
3113
2987
  model: e.model,
3114
2988
  apiKey: e.apiKey,
3115
2989
  apiVersion: e.builderContextSignal.apiVersion
3116
- }).then((R) => {
3117
- R && i(R);
2990
+ }).then((N) => {
2991
+ N && i(N);
3118
2992
  });
3119
2993
  }
3120
2994
  }
3121
- }, []), useEffect(() => {
3122
- e.apiKey || logger.error(
2995
+ }, []), V(() => {
2996
+ e.apiKey || U.error(
3123
2997
  "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
3124
- ), s(), p(), k();
3125
- }, []), useEffect(() => {
2998
+ ), l(), C(), I();
2999
+ }, []), V(() => {
3126
3000
  e.content && i(e.content);
3127
- }, [e.content]), useEffect(() => {
3128
- s();
3129
- }, [(S = (T = e.builderContextSignal.content) == null ? void 0 : T.data) == null ? void 0 : S.jsCode]), useEffect(() => {
3130
- p();
3131
- }, [(E = (C = e.builderContextSignal.content) == null ? void 0 : C.data) == null ? void 0 : E.httpRequests]), useEffect(() => {
3132
- k();
3133
- }, [e.builderContextSignal.rootState]), useEffect(() => {
3001
+ }, [e.content]), V(() => {
3002
+ l();
3003
+ }, [(p = (R = e.builderContextSignal.content) == null ? void 0 : R.data) == null ? void 0 : p.jsCode]), V(() => {
3004
+ C();
3005
+ }, [(P = (w = e.builderContextSignal.content) == null ? void 0 : w.data) == null ? void 0 : P.httpRequests]), V(() => {
3006
+ I();
3007
+ }, [e.builderContextSignal.rootState]), V(() => {
3134
3008
  e.data && n(e.data);
3135
- }, [e.data]), useEffect(() => {
3009
+ }, [e.data]), V(() => {
3136
3010
  e.locale && n({
3137
3011
  locale: e.locale
3138
3012
  });
3139
- }, [e.locale]), useEffect(() => () => {
3140
- isBrowser() && (window.removeEventListener("message", r), window.removeEventListener(
3013
+ }, [e.locale]), V(() => () => {
3014
+ Y() && (window.removeEventListener("message", a), window.removeEventListener(
3141
3015
  "builder:component:stateChangeListenerActivated",
3142
- k
3016
+ I
3143
3017
  ));
3144
- }, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(
3018
+ }, []), /* @__PURE__ */ s(re.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ s(
3145
3019
  o,
3146
3020
  {
3147
3021
  ref: t,
3148
- onClick: (d) => y(d),
3149
- "builder-content-id": (I = e.builderContextSignal.content) == null ? void 0 : I.id,
3022
+ onClick: (u) => S(u),
3023
+ "builder-content-id": (E = e.builderContextSignal.content) == null ? void 0 : E.id,
3150
3024
  "builder-model": e.model,
3151
3025
  ...e.showContent ? {} : {
3152
3026
  hidden: !0,
3153
3027
  "aria-hidden": !0
3154
3028
  },
3155
3029
  ...e.contentWrapperProps,
3156
- className: `variant-${((B = e.content) == null ? void 0 : B.testVariationId) || ((j = e.content) == null ? void 0 : j.id)}`,
3030
+ className: `variant-${(($ = e.content) == null ? void 0 : $.testVariationId) || ((L = e.content) == null ? void 0 : L.id)}`,
3157
3031
  children: e.children
3158
3032
  }
3159
3033
  ) : null });
3160
3034
  }
3161
- const getCssFromFont = (e) => {
3162
- var a, r;
3163
- 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;
3035
+ const Cn = (e) => {
3036
+ var r, a;
3037
+ const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = (a = e.fileUrl) != null ? a : (r = e == null ? void 0 : e.files) == null ? void 0 : r.regular;
3164
3038
  let o = "";
3165
3039
  if (i && t && n && (o += `
3166
3040
  @font-face {
@@ -3170,29 +3044,29 @@ font-display: fallback;
3170
3044
  font-weight: 400;
3171
3045
  }
3172
3046
  `.trim()), e.files)
3173
- for (const s in e.files) {
3174
- if (!(String(Number(s)) === s))
3047
+ for (const l in e.files) {
3048
+ if (!(String(Number(l)) === l))
3175
3049
  continue;
3176
- const l = e.files[s];
3177
- l && l !== i && (o += `
3050
+ const c = e.files[l];
3051
+ c && c !== i && (o += `
3178
3052
  @font-face {
3179
3053
  font-family: "${t}";
3180
- src: url('${l}') format('woff2');
3054
+ src: url('${c}') format('woff2');
3181
3055
  font-display: fallback;
3182
- font-weight: ${s};
3056
+ font-weight: ${l};
3183
3057
  }
3184
3058
  `.trim());
3185
3059
  }
3186
3060
  return o;
3187
- }, getFontCss = ({
3061
+ }, wn = ({
3188
3062
  customFonts: e
3189
3063
  }) => {
3190
3064
  var t;
3191
- return ((t = e == null ? void 0 : e.map((n) => getCssFromFont(n))) == null ? void 0 : t.join(" ")) || "";
3192
- }, getCss = ({
3065
+ return ((t = e == null ? void 0 : e.map((n) => Cn(n))) == null ? void 0 : t.join(" ")) || "";
3066
+ }, In = ({
3193
3067
  cssCode: e,
3194
3068
  contentId: t
3195
- }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", DEFAULT_STYLES = `
3069
+ }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", Tn = `
3196
3070
  .builder-button {
3197
3071
  all: unset;
3198
3072
  }
@@ -3209,31 +3083,31 @@ font-weight: ${s};
3209
3083
  text-align: inherit;
3210
3084
  font-family: inherit;
3211
3085
  }
3212
- `, getDefaultStyles = (e) => e ? "" : DEFAULT_STYLES;
3213
- function ContentStyles(e) {
3214
- const [t, n] = useState(
3086
+ `, En = (e) => e ? "" : Tn;
3087
+ function Rn(e) {
3088
+ const [t, n] = k(
3215
3089
  () => `
3216
- ${getCss({
3090
+ ${In({
3217
3091
  cssCode: e.cssCode,
3218
3092
  contentId: e.contentId
3219
3093
  })}
3220
- ${getFontCss({
3094
+ ${wn({
3221
3095
  customFonts: e.customFonts
3222
3096
  })}
3223
- ${getDefaultStyles(e.isNestedRender)}
3097
+ ${En(e.isNestedRender)}
3224
3098
  `.trim()
3225
3099
  );
3226
- return /* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-content", styles: t });
3100
+ return /* @__PURE__ */ s(Z, { id: "builderio-content", styles: t });
3227
3101
  }
3228
- const getRootStateInitialValue = ({
3102
+ const Pn = ({
3229
3103
  content: e,
3230
3104
  data: t,
3231
3105
  locale: n
3232
3106
  }) => {
3233
- var a, r, s;
3234
- const i = {}, o = ((a = e == null ? void 0 : e.data) == null ? void 0 : a.state) || {};
3235
- return (s = (r = e == null ? void 0 : e.data) == null ? void 0 : r.inputs) == null || s.forEach((c) => {
3236
- c.name && c.defaultValue !== void 0 && (i[c.name] = c.defaultValue);
3107
+ var r, a, l;
3108
+ const i = {}, o = ((r = e == null ? void 0 : e.data) == null ? void 0 : r.state) || {};
3109
+ return (l = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || l.forEach((d) => {
3110
+ d.name && d.defaultValue !== void 0 && (i[d.name] = d.defaultValue);
3237
3111
  }), {
3238
3112
  ...i,
3239
3113
  ...o,
@@ -3242,7 +3116,7 @@ const getRootStateInitialValue = ({
3242
3116
  locale: n
3243
3117
  } : {}
3244
3118
  };
3245
- }, getContentInitialValue = ({
3119
+ }, Vn = ({
3246
3120
  content: e,
3247
3121
  data: t
3248
3122
  }) => e ? {
@@ -3253,46 +3127,46 @@ const getRootStateInitialValue = ({
3253
3127
  },
3254
3128
  meta: e == null ? void 0 : e.meta
3255
3129
  } : void 0;
3256
- function ContentComponent(e) {
3257
- var c, l, u, m, g, h, y;
3258
- const [t, n] = useState(
3130
+ function Se(e) {
3131
+ var d, c, m, f, g, y, S;
3132
+ const [t, n] = k(
3259
3133
  () => {
3260
- var p, k;
3261
- return getUpdateVariantVisibilityScript({
3134
+ var C, I;
3135
+ return pn({
3262
3136
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
3263
- variationId: (p = e.content) == null ? void 0 : p.testVariationId,
3137
+ variationId: (C = e.content) == null ? void 0 : C.testVariationId,
3264
3138
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
3265
- contentId: (k = e.content) == null ? void 0 : k.id
3139
+ contentId: (I = e.content) == null ? void 0 : I.id
3266
3140
  });
3267
3141
  }
3268
3142
  );
3269
- function i(p) {
3270
- s((k) => ({
3271
- ...k,
3272
- rootState: p
3143
+ function i(C) {
3144
+ l((I) => ({
3145
+ ...I,
3146
+ rootState: C
3273
3147
  }));
3274
3148
  }
3275
- const [o, a] = useState(
3149
+ const [o, r] = k(
3276
3150
  () => [
3277
- ...getDefaultRegisteredComponents(),
3151
+ ...ye(),
3278
3152
  ...e.customComponents || []
3279
3153
  ].reduce(
3280
- (p, { component: k, ...T }) => ({
3281
- ...p,
3282
- [T.name]: {
3283
- component: k,
3284
- ...serializeComponentInfo(T)
3154
+ (C, { component: I, ...R }) => ({
3155
+ ...C,
3156
+ [R.name]: {
3157
+ component: I,
3158
+ ...me(R)
3285
3159
  }
3286
3160
  }),
3287
3161
  {}
3288
3162
  )
3289
- ), [r, s] = useState(() => ({
3290
- content: getContentInitialValue({
3163
+ ), [a, l] = k(() => ({
3164
+ content: Vn({
3291
3165
  content: e.content,
3292
3166
  data: e.data
3293
3167
  }),
3294
3168
  localState: void 0,
3295
- rootState: getRootStateInitialValue({
3169
+ rootState: Pn({
3296
3170
  content: e.content,
3297
3171
  data: e.data,
3298
3172
  locale: e.locale
@@ -3302,12 +3176,12 @@ function ContentComponent(e) {
3302
3176
  apiKey: e.apiKey,
3303
3177
  apiVersion: e.apiVersion,
3304
3178
  componentInfos: [
3305
- ...getDefaultRegisteredComponents(),
3179
+ ...ye(),
3306
3180
  ...e.customComponents || []
3307
3181
  ].reduce(
3308
- (p, { component: k, ...T }) => ({
3309
- ...p,
3310
- [T.name]: serializeComponentInfo(T)
3182
+ (C, { component: I, ...R }) => ({
3183
+ ...C,
3184
+ [R.name]: me(R)
3311
3185
  }),
3312
3186
  {}
3313
3187
  ),
@@ -3315,14 +3189,14 @@ function ContentComponent(e) {
3315
3189
  BlocksWrapper: e.blocksWrapper || "div",
3316
3190
  BlocksWrapperProps: e.blocksWrapperProps || {}
3317
3191
  }));
3318
- return /* @__PURE__ */ jsx(
3319
- ComponentsContext.Provider,
3192
+ return /* @__PURE__ */ s(
3193
+ Ie.Provider,
3320
3194
  {
3321
3195
  value: {
3322
3196
  registeredComponents: o
3323
3197
  },
3324
- children: /* @__PURE__ */ jsxs(
3325
- EnableEditor,
3198
+ children: /* @__PURE__ */ B(
3199
+ kn,
3326
3200
  {
3327
3201
  content: e.content,
3328
3202
  data: e.data,
@@ -3333,34 +3207,34 @@ function ContentComponent(e) {
3333
3207
  locale: e.locale,
3334
3208
  enrich: e.enrich,
3335
3209
  showContent: e.showContent,
3336
- builderContextSignal: r,
3210
+ builderContextSignal: a,
3337
3211
  contentWrapper: e.contentWrapper,
3338
3212
  contentWrapperProps: e.contentWrapperProps,
3339
3213
  linkComponent: e.linkComponent,
3340
3214
  trustedHosts: e.trustedHosts,
3341
- setBuilderContextSignal: s,
3215
+ setBuilderContextSignal: l,
3342
3216
  children: [
3343
- e.isSsrAbTest ? /* @__PURE__ */ jsx(
3344
- InlinedScript,
3217
+ e.isSsrAbTest ? /* @__PURE__ */ s(
3218
+ ie,
3345
3219
  {
3346
3220
  id: "builderio-variant-visibility",
3347
3221
  scriptStr: t
3348
3222
  }
3349
3223
  ) : null,
3350
- /* @__PURE__ */ jsx(
3351
- ContentStyles,
3224
+ /* @__PURE__ */ s(
3225
+ Rn,
3352
3226
  {
3353
3227
  isNestedRender: e.isNestedRender,
3354
- contentId: (c = r.content) == null ? void 0 : c.id,
3355
- cssCode: (u = (l = r.content) == null ? void 0 : l.data) == null ? void 0 : u.cssCode,
3356
- customFonts: (g = (m = r.content) == null ? void 0 : m.data) == null ? void 0 : g.customFonts
3228
+ contentId: (d = a.content) == null ? void 0 : d.id,
3229
+ cssCode: (m = (c = a.content) == null ? void 0 : c.data) == null ? void 0 : m.cssCode,
3230
+ customFonts: (g = (f = a.content) == null ? void 0 : f.data) == null ? void 0 : g.customFonts
3357
3231
  }
3358
3232
  ),
3359
- /* @__PURE__ */ jsx(
3360
- Blocks,
3233
+ /* @__PURE__ */ s(
3234
+ O,
3361
3235
  {
3362
- blocks: (y = (h = r.content) == null ? void 0 : h.data) == null ? void 0 : y.blocks,
3363
- context: r,
3236
+ blocks: (S = (y = a.content) == null ? void 0 : y.data) == null ? void 0 : S.blocks,
3237
+ context: a,
3364
3238
  registeredComponents: o,
3365
3239
  linkComponent: e.linkComponent
3366
3240
  }
@@ -3371,66 +3245,66 @@ function ContentComponent(e) {
3371
3245
  }
3372
3246
  );
3373
3247
  }
3374
- function ContentVariants(e) {
3375
- var r;
3376
- const [t, n] = useState(
3377
- () => checkShouldRenderVariants({
3378
- canTrack: getDefaultCanTrack(e.canTrack),
3248
+ function Bn(e) {
3249
+ var a;
3250
+ const [t, n] = k(
3251
+ () => hn({
3252
+ canTrack: G(e.canTrack),
3379
3253
  content: e.content
3380
3254
  })
3381
3255
  );
3382
3256
  function i() {
3383
- var s;
3384
- return getUpdateCookieAndStylesScript(
3385
- getVariants(e.content).map((c) => ({
3386
- id: c.testVariationId,
3387
- testRatio: c.testRatio
3257
+ var l;
3258
+ return yn(
3259
+ z(e.content).map((d) => ({
3260
+ id: d.testVariationId,
3261
+ testRatio: d.testRatio
3388
3262
  })),
3389
- ((s = e.content) == null ? void 0 : s.id) || ""
3263
+ ((l = e.content) == null ? void 0 : l.id) || ""
3390
3264
  );
3391
3265
  }
3392
3266
  function o() {
3393
- return getVariants(e.content).map((s) => `.variant-${s.testVariationId} { display: none; } `).join("");
3267
+ return z(e.content).map((l) => `.variant-${l.testVariationId} { display: none; } `).join("");
3394
3268
  }
3395
- function a() {
3396
- var s;
3269
+ function r() {
3270
+ var l;
3397
3271
  return t ? {
3398
3272
  ...e.content,
3399
- testVariationId: (s = e.content) == null ? void 0 : s.id
3400
- } : handleABTestingSync({
3273
+ testVariationId: (l = e.content) == null ? void 0 : l.id
3274
+ } : qe({
3401
3275
  item: e.content,
3402
- canTrack: getDefaultCanTrack(e.canTrack)
3276
+ canTrack: G(e.canTrack)
3403
3277
  });
3404
3278
  }
3405
- return useEffect(() => {
3406
- }, []), /* @__PURE__ */ jsxs(Fragment, { children: [
3407
- !e.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ jsx(
3408
- InlinedScript,
3279
+ return V(() => {
3280
+ }, []), /* @__PURE__ */ B(T, { children: [
3281
+ !e.isNestedRender && q !== "reactNative" ? /* @__PURE__ */ s(
3282
+ ie,
3409
3283
  {
3410
3284
  id: "builderio-init-variants-fns",
3411
- scriptStr: getInitVariantsFnsScriptString()
3285
+ scriptStr: bn()
3412
3286
  }
3413
3287
  ) : null,
3414
- t ? /* @__PURE__ */ jsxs(Fragment, { children: [
3415
- /* @__PURE__ */ jsx(
3416
- InlinedStyles,
3288
+ t ? /* @__PURE__ */ B(T, { children: [
3289
+ /* @__PURE__ */ s(
3290
+ Z,
3417
3291
  {
3418
3292
  id: "builderio-variants",
3419
3293
  styles: o()
3420
3294
  }
3421
3295
  ),
3422
- /* @__PURE__ */ jsx(
3423
- InlinedScript,
3296
+ /* @__PURE__ */ s(
3297
+ ie,
3424
3298
  {
3425
3299
  id: "builderio-variants-visibility",
3426
3300
  scriptStr: i()
3427
3301
  }
3428
3302
  ),
3429
- (r = getVariants(e.content)) == null ? void 0 : r.map((s) => /* @__PURE__ */ jsx(
3430
- ContentComponent,
3303
+ (a = z(e.content)) == null ? void 0 : a.map((l) => /* @__PURE__ */ s(
3304
+ Se,
3431
3305
  {
3432
3306
  isNestedRender: e.isNestedRender,
3433
- content: s,
3307
+ content: l,
3434
3308
  showContent: !1,
3435
3309
  model: e.model,
3436
3310
  data: e.data,
@@ -3449,14 +3323,14 @@ function ContentVariants(e) {
3449
3323
  contentWrapperProps: e.contentWrapperProps,
3450
3324
  trustedHosts: e.trustedHosts
3451
3325
  },
3452
- s.testVariationId
3326
+ l.testVariationId
3453
3327
  ))
3454
3328
  ] }) : null,
3455
- /* @__PURE__ */ jsx(
3456
- ContentComponent,
3329
+ /* @__PURE__ */ s(
3330
+ Se,
3457
3331
  {
3458
3332
  isNestedRender: e.isNestedRender,
3459
- content: a(),
3333
+ content: r(),
3460
3334
  showContent: !0,
3461
3335
  model: e.model,
3462
3336
  data: e.data,
@@ -3478,13 +3352,13 @@ function ContentVariants(e) {
3478
3352
  )
3479
3353
  ] });
3480
3354
  }
3481
- const fetchSymbolContent = async ({
3355
+ const Wn = async ({
3482
3356
  builderContextValue: e,
3483
3357
  symbol: t
3484
3358
  }) => {
3485
3359
  if (t != null && t.model && // This is a hack, we should not need to check for this, but it is needed for Svelte.
3486
3360
  (e != null && e.apiKey))
3487
- return fetchOneEntry({
3361
+ return ve({
3488
3362
  model: t.model,
3489
3363
  apiKey: e.apiKey,
3490
3364
  apiVersion: e.apiVersion,
@@ -3494,52 +3368,52 @@ const fetchSymbolContent = async ({
3494
3368
  }
3495
3369
  }
3496
3370
  }).catch((n) => {
3497
- logger.error("Could not fetch symbol content: ", n);
3371
+ U.error("Could not fetch symbol content: ", n);
3498
3372
  });
3499
3373
  };
3500
- function Symbol$1(e) {
3501
- var a, r, s, c;
3374
+ function Nn(e) {
3375
+ var r, a, l, d;
3502
3376
  function t() {
3503
- var l, u;
3377
+ var c, m;
3504
3378
  return [
3505
- e.attributes[getClassPropName()],
3379
+ e.attributes[H()],
3506
3380
  "builder-symbol",
3507
- (l = e.symbol) != null && l.inline ? "builder-inline-symbol" : void 0,
3508
- (u = e.symbol) != null && u.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
3381
+ (c = e.symbol) != null && c.inline ? "builder-inline-symbol" : void 0,
3382
+ (m = e.symbol) != null && m.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
3509
3383
  ].filter(Boolean).join(" ");
3510
3384
  }
3511
- const [n, i] = useState(() => {
3512
- var l;
3513
- return (l = e.symbol) == null ? void 0 : l.content;
3385
+ const [n, i] = k(() => {
3386
+ var c;
3387
+ return (c = e.symbol) == null ? void 0 : c.content;
3514
3388
  });
3515
3389
  function o() {
3516
- n || fetchSymbolContent({
3390
+ n || Wn({
3517
3391
  symbol: e.symbol,
3518
3392
  builderContextValue: e.builderContext
3519
- }).then((l) => {
3520
- l && i(l);
3393
+ }).then((c) => {
3394
+ c && i(c);
3521
3395
  });
3522
3396
  }
3523
- return useEffect(() => {
3524
- }, []), useEffect(() => {
3397
+ return V(() => {
3398
+ }, []), V(() => {
3525
3399
  o();
3526
- }, [e.symbol]), /* @__PURE__ */ jsx("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ jsx(
3527
- ContentVariants,
3400
+ }, [e.symbol]), /* @__PURE__ */ s("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ s(
3401
+ Bn,
3528
3402
  {
3529
3403
  isNestedRender: !0,
3530
3404
  apiVersion: e.builderContext.apiVersion,
3531
3405
  apiKey: e.builderContext.apiKey,
3532
3406
  context: {
3533
3407
  ...e.builderContext.context,
3534
- symbolId: (a = e.builderBlock) == null ? void 0 : a.id
3408
+ symbolId: (r = e.builderBlock) == null ? void 0 : r.id
3535
3409
  },
3536
3410
  customComponents: Object.values(e.builderComponents),
3537
3411
  data: {
3538
- ...(r = e.symbol) == null ? void 0 : r.data,
3412
+ ...(a = e.symbol) == null ? void 0 : a.data,
3539
3413
  ...e.builderContext.localState,
3540
- ...(s = n == null ? void 0 : n.data) == null ? void 0 : s.state
3414
+ ...(l = n == null ? void 0 : n.data) == null ? void 0 : l.state
3541
3415
  },
3542
- model: (c = e.symbol) == null ? void 0 : c.model,
3416
+ model: (d = e.symbol) == null ? void 0 : d.model,
3543
3417
  content: n,
3544
3418
  linkComponent: e.builderLinkComponent,
3545
3419
  blocksWrapper: "div",
@@ -3548,15 +3422,15 @@ function Symbol$1(e) {
3548
3422
  ) });
3549
3423
  }
3550
3424
  export {
3551
- Blocks,
3552
- builderContext as BuilderContext,
3553
- Button,
3554
- Columns,
3555
- ContentVariants as Content,
3556
- FragmentComponent as Fragment,
3557
- Image,
3558
- SectionComponent as Section,
3559
- Symbol$1 as Symbol,
3560
- Text,
3561
- Video
3425
+ O as Blocks,
3426
+ re as BuilderContext,
3427
+ Xe as Button,
3428
+ Et as Columns,
3429
+ Bn as Content,
3430
+ Rt as Fragment,
3431
+ Bt as Image,
3432
+ Wt as Section,
3433
+ Nn as Symbol,
3434
+ Ut as Text,
3435
+ dn as Video
3562
3436
  };