@builder.io/sdk-react 1.0.19-dev-0 → 1.0.20

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