@builder.io/sdk-react-nextjs 0.16.20 → 0.16.24

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 (53) hide show
  1. package/lib/browser/blocks/columns/columns.cjs +2 -2
  2. package/lib/browser/blocks/columns/columns.mjs +24 -24
  3. package/lib/browser/components/blocks/blocks-wrapper.cjs +1 -1
  4. package/lib/browser/components/blocks/blocks-wrapper.mjs +26 -20
  5. package/lib/browser/components/content/components/enable-editor.cjs +1 -1
  6. package/lib/browser/components/content/components/enable-editor.mjs +58 -57
  7. package/lib/browser/constants/sdk-version.cjs +1 -1
  8. package/lib/browser/constants/sdk-version.mjs +1 -1
  9. package/lib/browser/functions/get-content/generate-content-url.cjs +1 -1
  10. package/lib/browser/functions/get-content/generate-content-url.mjs +43 -37
  11. package/lib/browser/functions/log-fetch.cjs +1 -0
  12. package/lib/browser/functions/log-fetch.mjs +8 -0
  13. package/lib/browser/functions/register-component.cjs +1 -1
  14. package/lib/browser/functions/register-component.mjs +6 -6
  15. package/lib/browser/functions/track/index.cjs +1 -1
  16. package/lib/browser/functions/track/index.mjs +18 -14
  17. package/lib/edge/blocks/columns/columns.cjs +2 -2
  18. package/lib/edge/blocks/columns/columns.mjs +24 -24
  19. package/lib/edge/components/blocks/blocks-wrapper.cjs +1 -1
  20. package/lib/edge/components/blocks/blocks-wrapper.mjs +26 -20
  21. package/lib/edge/components/content/components/enable-editor.cjs +1 -1
  22. package/lib/edge/components/content/components/enable-editor.mjs +58 -57
  23. package/lib/edge/constants/sdk-version.cjs +1 -1
  24. package/lib/edge/constants/sdk-version.mjs +1 -1
  25. package/lib/edge/functions/get-content/generate-content-url.cjs +1 -1
  26. package/lib/edge/functions/get-content/generate-content-url.mjs +43 -37
  27. package/lib/edge/functions/log-fetch.cjs +1 -0
  28. package/lib/edge/functions/log-fetch.mjs +8 -0
  29. package/lib/edge/functions/register-component.cjs +1 -1
  30. package/lib/edge/functions/register-component.mjs +6 -6
  31. package/lib/edge/functions/track/index.cjs +1 -1
  32. package/lib/edge/functions/track/index.mjs +18 -14
  33. package/lib/node/blocks/columns/columns.cjs +2 -2
  34. package/lib/node/blocks/columns/columns.mjs +24 -24
  35. package/lib/node/components/blocks/blocks-wrapper.cjs +1 -1
  36. package/lib/node/components/blocks/blocks-wrapper.mjs +26 -20
  37. package/lib/node/components/content/components/enable-editor.cjs +1 -1
  38. package/lib/node/components/content/components/enable-editor.mjs +58 -57
  39. package/lib/node/constants/sdk-version.cjs +1 -1
  40. package/lib/node/constants/sdk-version.mjs +1 -1
  41. package/lib/node/functions/get-content/generate-content-url.cjs +1 -1
  42. package/lib/node/functions/get-content/generate-content-url.mjs +43 -37
  43. package/lib/node/functions/log-fetch.cjs +1 -0
  44. package/lib/node/functions/log-fetch.mjs +8 -0
  45. package/lib/node/functions/register-component.cjs +1 -1
  46. package/lib/node/functions/register-component.mjs +6 -6
  47. package/lib/node/functions/track/index.cjs +1 -1
  48. package/lib/node/functions/track/index.mjs +18 -14
  49. package/package.json +1 -1
  50. package/types/cjs/constants/sdk-version.d.ts +1 -1
  51. package/types/cjs/functions/log-fetch.d.ts +1 -0
  52. package/types/esm/constants/sdk-version.d.ts +1 -1
  53. package/types/esm/functions/log-fetch.d.ts +1 -0
@@ -1,47 +1,53 @@
1
- import { flatten as g, flattenMongoQuery as O } from "../../helpers/flatten.mjs";
2
- import { normalizeSearchParams as k } from "../../helpers/search/search.mjs";
3
- import { DEFAULT_API_VERSION as E } from "../../types/api-version.mjs";
4
- import { getBuilderSearchParamsFromWindow as I } from "../get-builder-search-params/index.mjs";
5
- const y = (r) => typeof r == "number" && !isNaN(r) && r >= 0, M = (r) => {
1
+ import { flatten as y, flattenMongoQuery as E } from "../../helpers/flatten.mjs";
2
+ import { normalizeSearchParams as I } from "../../helpers/search/search.mjs";
3
+ import { DEFAULT_API_VERSION as $ } from "../../types/api-version.mjs";
4
+ import { getBuilderSearchParamsFromWindow as C } from "../get-builder-search-params/index.mjs";
5
+ const b = (r) => typeof r == "number" && !isNaN(r) && r >= 0, R = (r) => {
6
6
  const {
7
- limit: c = 30,
8
- userAttributes: m,
9
- query: f,
10
- model: b,
11
- apiKey: l,
12
- enrich: h,
13
- locale: d,
14
- apiVersion: a = E,
15
- fields: u,
16
- omit: N,
17
- offset: i,
18
- cacheSeconds: n,
19
- staleCacheSeconds: o,
20
- sort: P,
21
- includeUnpublished: p,
22
- apiHost: v
7
+ limit: m = 30,
8
+ userAttributes: a,
9
+ query: h,
10
+ model: N,
11
+ apiKey: d,
12
+ enrich: P,
13
+ locale: U,
14
+ apiVersion: n = $,
15
+ fields: p,
16
+ omit: v,
17
+ offset: o,
18
+ cacheSeconds: c,
19
+ staleCacheSeconds: f,
20
+ sort: S,
21
+ includeUnpublished: u,
22
+ apiHost: w
23
23
  } = r;
24
- if (!l)
24
+ if (!d)
25
25
  throw new Error("Missing API key");
26
- if (!["v3"].includes(a))
27
- throw new Error(`Invalid apiVersion: expected 'v3', received '${a}'`);
28
- const U = c !== 1, w = v || "https://cdn.builder.io", e = new URL(`${w}/api/${a}/content/${b}`);
29
- if (e.searchParams.set("apiKey", l), e.searchParams.set("limit", String(c)), e.searchParams.set("noTraverse", String(U)), e.searchParams.set("includeRefs", String(!0)), d && e.searchParams.set("locale", d), h && e.searchParams.set("enrich", String(h)), e.searchParams.set("omit", N || "meta.componentsUsed"), u && e.searchParams.set("fields", u), Number.isFinite(i) && i > -1 && e.searchParams.set("offset", String(Math.floor(i))), typeof p == "boolean" && e.searchParams.set("includeUnpublished", String(p)), n && y(n) && e.searchParams.set("cacheSeconds", String(n)), o && y(o) && e.searchParams.set("staleCacheSeconds", String(o)), P) {
30
- const s = g({
31
- sort: P
26
+ if (!["v3"].includes(n))
27
+ throw new Error(`Invalid apiVersion: expected 'v3', received '${n}'`);
28
+ const O = m !== 1, k = w || "https://cdn.builder.io", e = new URL(`${k}/api/${n}/content/${N}`);
29
+ e.searchParams.set("apiKey", d), e.searchParams.set("limit", String(m)), e.searchParams.set("noTraverse", String(O)), e.searchParams.set("includeRefs", String(!0));
30
+ const l = U || (a == null ? void 0 : a.locale);
31
+ let i = a;
32
+ if (l && (e.searchParams.set("locale", l), i = {
33
+ locale: l,
34
+ ...i
35
+ }), P && e.searchParams.set("enrich", String(P)), e.searchParams.set("omit", v || "meta.componentsUsed"), p && e.searchParams.set("fields", p), Number.isFinite(o) && o > -1 && e.searchParams.set("offset", String(Math.floor(o))), typeof u == "boolean" && e.searchParams.set("includeUnpublished", String(u)), c && b(c) && e.searchParams.set("cacheSeconds", String(c)), f && b(f) && e.searchParams.set("staleCacheSeconds", String(f)), S) {
36
+ const s = y({
37
+ sort: S
32
38
  });
33
39
  for (const t in s)
34
40
  e.searchParams.set(t, JSON.stringify(s[t]));
35
41
  }
36
42
  const A = {
37
- ...I(),
38
- ...k(r.options || {})
39
- }, S = g(A);
40
- for (const s in S)
41
- e.searchParams.set(s, String(S[s]));
42
- if (m && e.searchParams.set("userAttributes", JSON.stringify(m)), f) {
43
- const s = O({
44
- query: f
43
+ ...C(),
44
+ ...I(r.options || {})
45
+ }, g = y(A);
46
+ for (const s in g)
47
+ e.searchParams.set(s, String(g[s]));
48
+ if (i && e.searchParams.set("userAttributes", JSON.stringify(i)), h) {
49
+ const s = E({
50
+ query: h
45
51
  });
46
52
  for (const t in s)
47
53
  e.searchParams.set(t, JSON.stringify(s[t]));
@@ -49,5 +55,5 @@ const y = (r) => typeof r == "number" && !isNaN(r) && r >= 0, M = (r) => {
49
55
  return e;
50
56
  };
51
57
  export {
52
- M as generateContentUrl
58
+ R as generateContentUrl
53
59
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../helpers/logger.cjs");function t(o){var e;typeof process!="undefined"&&((e=process.env)!=null&&e.DEBUG)&&String(process.env.DEBUG)=="true"&&r.logger.log(o)}exports.logFetch=t;
@@ -0,0 +1,8 @@
1
+ import { logger as r } from "../helpers/logger.mjs";
2
+ function t(o) {
3
+ var e;
4
+ typeof process != "undefined" && ((e = process.env) != null && e.DEBUG) && String(process.env.DEBUG) == "true" && r.log(o);
5
+ }
6
+ export {
7
+ t as logFetch
8
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=t=>({type:"builder.registerComponent",data:r(t)}),s=t=>{const n=t.toString().trim();return`return (${!n.startsWith("function")&&!n.startsWith("(")?"function ":""}${n}).apply(this, arguments)`};function r(t){return JSON.parse(JSON.stringify(t,(n,e)=>typeof e=="function"?s(e):e))}exports.createRegisterComponentMessage=i;exports.serializeIncludingFunctions=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=t=>({type:"builder.registerComponent",data:r(t)}),s=t=>{const n=t.toString().trim(),e=/^[a-zA-Z0-9_]+\s*=>/i.test(n);return`return (${!n.startsWith("function")&&!n.startsWith("(")&&!e?"function ":""}${n}).apply(this, arguments)`};function r(t){return JSON.parse(JSON.stringify(t,(n,e)=>typeof e=="function"?s(e):e))}exports.createRegisterComponentMessage=i;exports.serializeIncludingFunctions=r;
@@ -1,14 +1,14 @@
1
- const s = (t) => ({
1
+ const o = (t) => ({
2
2
  type: "builder.registerComponent",
3
3
  data: i(t)
4
- }), r = (t) => {
5
- const n = t.toString().trim();
6
- return `return (${!n.startsWith("function") && !n.startsWith("(") ? "function " : ""}${n}).apply(this, arguments)`;
4
+ }), e = (t) => {
5
+ const n = t.toString().trim(), r = /^[a-zA-Z0-9_]+\s*=>/i.test(n);
6
+ return `return (${!n.startsWith("function") && !n.startsWith("(") && !r ? "function " : ""}${n}).apply(this, arguments)`;
7
7
  };
8
8
  function i(t) {
9
- return JSON.parse(JSON.stringify(t, (n, e) => typeof e == "function" ? r(e) : e));
9
+ return JSON.parse(JSON.stringify(t, (n, r) => typeof r == "function" ? e(r) : r));
10
10
  }
11
11
  export {
12
- s as createRegisterComponentMessage,
12
+ o as createRegisterComponentMessage,
13
13
  i as serializeIncludingFunctions
14
14
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../constants/target.cjs"),a=require("../../helpers/logger.cjs"),c=require("../../helpers/sdk-headers.cjs"),d=require("../../helpers/sessionId.cjs"),u=require("../../helpers/visitorId.cjs"),g=require("../is-browser.cjs"),l=require("../is-editing.cjs"),y=require("./helpers.cjs"),I=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await d.getSessionId({canTrack:e}),r=u.getVisitorId({canTrack:e});return{sessionId:t,visitorId:r}},k=async({type:e,canTrack:t,apiKey:r,metadata:i,...o})=>({type:e,data:{...o,metadata:{url:location.href,...i},...await I({canTrack:t}),userAttributes:y.getUserAttributes(),ownerId:r}});async function s({apiHost:e,...t}){if(!t.apiKey){a.logger.error("Missing API key for track call. Please provide your API key.");return}return!t.canTrack||l.isEditing()||!(g.isBrowser()||n.TARGET==="reactNative")?void 0:fetch(`${e||"https://cdn.builder.io"}/api/v1/track`,{method:"POST",body:JSON.stringify({events:[await k(t)]}),headers:{"content-type":"application/json",...c.getSdkHeaders()},mode:"cors"}).catch(i=>{console.error("Failed to track: ",i)})}const f=e=>s({...e,canTrack:!0});exports._track=s;exports.track=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../constants/target.cjs"),a=require("../../helpers/logger.cjs"),c=require("../../helpers/sdk-headers.cjs"),d=require("../../helpers/sessionId.cjs"),u=require("../../helpers/visitorId.cjs"),l=require("../is-browser.cjs"),g=require("../is-editing.cjs"),y=require("../log-fetch.cjs"),I=require("./helpers.cjs"),k=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await d.getSessionId({canTrack:e}),r=u.getVisitorId({canTrack:e});return{sessionId:t,visitorId:r}},f=async({type:e,canTrack:t,apiKey:r,metadata:s,...i})=>({type:e,data:{...i,metadata:{url:location.href,...s},...await k({canTrack:t}),userAttributes:I.getUserAttributes(),ownerId:r}});async function o({apiHost:e,...t}){if(!t.apiKey){a.logger.error("Missing API key for track call. Please provide your API key.");return}if(!t.canTrack||g.isEditing()||!(l.isBrowser()||n.TARGET==="reactNative"))return;const s=`${e||"https://cdn.builder.io"}/api/v1/track`;return y.logFetch(s),fetch(s,{method:"POST",body:JSON.stringify({events:[await f(t)]}),headers:{"content-type":"application/json",...c.getSdkHeaders()},mode:"cors"}).catch(i=>{console.error("Failed to track: ",i)})}const v=e=>o({...e,canTrack:!0});exports._track=o;exports.track=v;
@@ -1,12 +1,13 @@
1
- import { TARGET as a } from "../../constants/target.mjs";
2
- import { logger as s } from "../../helpers/logger.mjs";
1
+ import { TARGET as s } from "../../constants/target.mjs";
2
+ import { logger as a } from "../../helpers/logger.mjs";
3
3
  import { getSdkHeaders as n } from "../../helpers/sdk-headers.mjs";
4
4
  import { getSessionId as c } from "../../helpers/sessionId.mjs";
5
5
  import { getVisitorId as d } from "../../helpers/visitorId.mjs";
6
6
  import { isBrowser as m } from "../is-browser.mjs";
7
7
  import { isEditing as f } from "../is-editing.mjs";
8
- import { getUserAttributes as p } from "./helpers.mjs";
9
- const u = async ({
8
+ import { logFetch as p } from "../log-fetch.mjs";
9
+ import { getUserAttributes as u } from "./helpers.mjs";
10
+ const l = async ({
10
11
  canTrack: t
11
12
  }) => {
12
13
  if (!t)
@@ -23,7 +24,7 @@ const u = async ({
23
24
  sessionId: r,
24
25
  visitorId: e
25
26
  };
26
- }, l = async ({
27
+ }, g = async ({
27
28
  type: t,
28
29
  canTrack: r,
29
30
  apiKey: e,
@@ -37,10 +38,10 @@ const u = async ({
37
38
  url: location.href,
38
39
  ...o
39
40
  },
40
- ...await u({
41
+ ...await l({
41
42
  canTrack: r
42
43
  }),
43
- userAttributes: p(),
44
+ userAttributes: u(),
44
45
  ownerId: e
45
46
  }
46
47
  });
@@ -49,28 +50,31 @@ async function y({
49
50
  ...r
50
51
  }) {
51
52
  if (!r.apiKey) {
52
- s.error("Missing API key for track call. Please provide your API key.");
53
+ a.error("Missing API key for track call. Please provide your API key.");
53
54
  return;
54
55
  }
55
- return !r.canTrack || f() || !(m() || a === "reactNative") ? void 0 : fetch(`${t || "https://cdn.builder.io"}/api/v1/track`, {
56
+ if (!r.canTrack || f() || !(m() || s === "reactNative"))
57
+ return;
58
+ const o = `${t || "https://cdn.builder.io"}/api/v1/track`;
59
+ return p(o), fetch(o, {
56
60
  method: "POST",
57
61
  body: JSON.stringify({
58
- events: [await l(r)]
62
+ events: [await g(r)]
59
63
  }),
60
64
  headers: {
61
65
  "content-type": "application/json",
62
66
  ...n()
63
67
  },
64
68
  mode: "cors"
65
- }).catch((o) => {
66
- console.error("Failed to track: ", o);
69
+ }).catch((i) => {
70
+ console.error("Failed to track: ", i);
67
71
  });
68
72
  }
69
- const E = (t) => y({
73
+ const T = (t) => y({
70
74
  ...t,
71
75
  canTrack: !0
72
76
  });
73
77
  export {
74
78
  y as _track,
75
- E as track
79
+ T as track
76
80
  };
@@ -1,4 +1,4 @@
1
- "use strict";const o=require("react/jsx-runtime"),p=require("../../components/blocks/blocks.cjs"),W=require("../../components/dynamic-renderer/dynamic-renderer.cjs"),j=require("../../components/inlined-styles.cjs"),q=require("../../constants/device-sizes.cjs"),z=require("../../functions/get-class-prop-name.cjs"),B=require("../../functions/get-style.cjs"),A=require("./helpers.cjs");function N(e){var g,f;const a=function(){return typeof e.space=="number"?e.space||0:20},s=function(){return e.columns||[]},u=function(){return e.stackColumnsAt||"tablet"},y=function(t){return t.link?e.builderLinkComponent||"a":"div"},S=function(t){var i;return((i=s()[t])==null?void 0:i.width)||100/s().length},x=function(t){const i=S(t),l=a()*(s().length-1)*(i/100);return`calc(${i}% - ${l}px)`},c=function({stackedStyle:t,desktopStyle:i}){return u()==="tablet"?t:i},m=function({stackedStyle:t,desktopStyle:i}){return u()==="never"?i:t},d=function(){return e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column"},C=function(){return{"--flex-dir":d(),"--flex-dir-tablet":c({stackedStyle:d(),desktopStyle:"row"})}},v=function(t){const i=t===0?0:a(),l=x(t),r=`${i}px`,k="100%",h=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:l,["marginLeft"]:r,"--column-width-mobile":m({stackedStyle:k,desktopStyle:l}),"--column-margin-left-mobile":m({stackedStyle:h,desktopStyle:r}),"--column-width-tablet":c({stackedStyle:k,desktopStyle:l}),"--column-margin-left-tablet":c({stackedStyle:h,desktopStyle:r})}},b=function(t){var l,r;return q.getSizesForBreakpoints(((r=(l=e.builderContext.content)==null?void 0:l.meta)==null?void 0:r.breakpoints)||{})[t].max},w=function(){const t=`.${e.builderBlock.id}-breakpoints > .builder-column`;return`
1
+ "use strict";const o=require("react/jsx-runtime"),W=require("../../components/blocks/blocks.cjs"),j=require("../../components/dynamic-renderer/dynamic-renderer.cjs"),q=require("../../components/inlined-styles.cjs"),z=require("../../constants/device-sizes.cjs"),B=require("../../functions/get-class-prop-name.cjs"),p=require("../../functions/get-style.cjs"),A=require("./helpers.cjs");function N(e){var g,f;const a=function(){return typeof e.space=="number"?e.space||0:20},s=function(){return e.columns||[]},u=function(){return e.stackColumnsAt||"tablet"},y=function(t){return t.link?e.builderLinkComponent||"a":"div"},S=function(t){var i;return((i=s()[t])==null?void 0:i.width)||100/s().length},x=function(t){const i=S(t),l=a()*(s().length-1)*(i/100);return`calc(${i}% - ${l}px)`},c=function({stackedStyle:t,desktopStyle:i}){return u()==="tablet"?t:i},m=function({stackedStyle:t,desktopStyle:i}){return u()==="never"?i:t},d=function(){return e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column"},C=function(){return{"--flex-dir":d(),"--flex-dir-tablet":c({stackedStyle:d(),desktopStyle:"row"})}},v=function(t){const i=t===0?0:a(),l=x(t),r=`${i}px`,k="100%",h=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:l,["marginLeft"]:r,"--column-width-mobile":m({stackedStyle:k,desktopStyle:l}),"--column-margin-left-mobile":m({stackedStyle:h,desktopStyle:r}),"--column-width-tablet":c({stackedStyle:k,desktopStyle:l}),"--column-margin-left-tablet":c({stackedStyle:h,desktopStyle:r})}},b=function(t){var l,r;return z.getSizesForBreakpoints(((r=(l=e.builderContext.content)==null?void 0:l.meta)==null?void 0:r.breakpoints)||{})[t].max},w=function(){const t=`.${e.builderBlock.id}-breakpoints > .builder-column`;return`
2
2
  @media (max-width: ${b("medium")}px) {
3
3
  .${e.builderBlock.id}-breakpoints {
4
4
  flex-direction: var(--flex-dir-tablet);
@@ -22,7 +22,7 @@
22
22
  margin-left: var(--column-margin-left-mobile) !important;
23
23
  }
24
24
  },
25
- `},$=function(t,i){return{...t.link?{href:t.link}:{},[z.getClassPropName()]:"builder-column",style:B.mapStyleObjToStrIfNeeded(v(i))}};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:A.getColumnsClass((g=e.builderBlock)==null?void 0:g.id)+" div-0e218b6c",style:C(),children:[o.jsx(j,{id:"builderio-columns",styles:w(),nonce:e.builderContext.nonce}),(f=e.columns)==null?void 0:f.map((n,t)=>o.jsx(W,{TagName:y(n),actionAttributes:{},attributes:$(n,t),children:o.jsx(p,{path:`component.options.columns.${t}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:n.blocks})},t))]}),o.jsx("style",{children:`.div-0e218b6c {
25
+ `},$=function(t,i){return{...t.link?{href:t.link}:{},[B.getClassPropName()]:"builder-column",style:p.mapStyleObjToStrIfNeeded(v(i))}};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:A.getColumnsClass((g=e.builderBlock)==null?void 0:g.id)+" div-6e395700",style:C(),children:[o.jsx(q,{id:"builderio-columns",styles:w(),nonce:e.builderContext.nonce}),(f=e.columns)==null?void 0:f.map((n,t)=>o.jsx(j,{TagName:y(n),actionAttributes:{},attributes:$(n,t),children:o.jsx(W,{path:`columns.${t}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:n.blocks})},t))]}),o.jsx("style",{children:`.div-6e395700 {
26
26
  display: flex;
27
27
  line-height: normal;
28
28
  }`})]})}module.exports=N;
@@ -7,7 +7,7 @@ import { getClassPropName as N } from "../../functions/get-class-prop-name.mjs";
7
7
  import { mapStyleObjToStrIfNeeded as T } from "../../functions/get-style.mjs";
8
8
  import { getColumnsClass as D } from "./helpers.mjs";
9
9
  function q(e) {
10
- var f, g;
10
+ var b, g;
11
11
  const a = function() {
12
12
  return typeof e.space == "number" ? e.space || 0 : 20;
13
13
  }, s = function() {
@@ -20,8 +20,8 @@ function q(e) {
20
20
  var i;
21
21
  return ((i = s()[t]) == null ? void 0 : i.width) || 100 / s().length;
22
22
  }, C = function(t) {
23
- const i = x(t), o = a() * (s().length - 1) * (i / 100);
24
- return `calc(${i}% - ${o}px)`;
23
+ const i = x(t), l = a() * (s().length - 1) * (i / 100);
24
+ return `calc(${i}% - ${l}px)`;
25
25
  }, c = function({
26
26
  stackedStyle: t,
27
27
  desktopStyle: i
@@ -34,7 +34,7 @@ function q(e) {
34
34
  return m() === "never" ? i : t;
35
35
  }, d = function() {
36
36
  return e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column";
37
- }, p = function() {
37
+ }, v = function() {
38
38
  return {
39
39
  "--flex-dir": d(),
40
40
  "--flex-dir-tablet": c({
@@ -42,42 +42,42 @@ function q(e) {
42
42
  desktopStyle: "row"
43
43
  })
44
44
  };
45
- }, v = function(t) {
46
- const i = t === 0 ? 0 : a(), o = C(t), l = `${i}px`, k = "100%", h = 0;
45
+ }, w = function(t) {
46
+ const i = t === 0 ? 0 : a(), l = C(t), o = `${i}px`, k = "100%", h = 0;
47
47
  return {
48
48
  ...{
49
49
  display: "flex",
50
50
  flexDirection: "column",
51
51
  alignItems: "stretch"
52
52
  },
53
- width: o,
54
- ["marginLeft"]: l,
53
+ width: l,
54
+ ["marginLeft"]: o,
55
55
  "--column-width-mobile": u({
56
56
  stackedStyle: k,
57
- desktopStyle: o
57
+ desktopStyle: l
58
58
  }),
59
59
  "--column-margin-left-mobile": u({
60
60
  stackedStyle: h,
61
- desktopStyle: l
61
+ desktopStyle: o
62
62
  }),
63
63
  "--column-width-tablet": c({
64
64
  stackedStyle: k,
65
- desktopStyle: o
65
+ desktopStyle: l
66
66
  }),
67
67
  "--column-margin-left-tablet": c({
68
68
  stackedStyle: h,
69
- desktopStyle: l
69
+ desktopStyle: o
70
70
  })
71
71
  };
72
- }, b = function(t) {
73
- var o, l;
72
+ }, f = function(t) {
73
+ var l, o;
74
74
  return L(
75
- ((l = (o = e.builderContext.content) == null ? void 0 : o.meta) == null ? void 0 : l.breakpoints) || {}
75
+ ((o = (l = e.builderContext.content) == null ? void 0 : l.meta) == null ? void 0 : o.breakpoints) || {}
76
76
  )[t].max;
77
- }, w = function() {
77
+ }, p = function() {
78
78
  const t = `.${e.builderBlock.id}-breakpoints > .builder-column`;
79
79
  return `
80
- @media (max-width: ${b("medium")}px) {
80
+ @media (max-width: ${f("medium")}px) {
81
81
  .${e.builderBlock.id}-breakpoints {
82
82
  flex-direction: var(--flex-dir-tablet);
83
83
  align-items: stretch;
@@ -89,7 +89,7 @@ function q(e) {
89
89
  }
90
90
  }
91
91
 
92
- @media (max-width: ${b("small")}px) {
92
+ @media (max-width: ${f("small")}px) {
93
93
  .${e.builderBlock.id}-breakpoints {
94
94
  flex-direction: var(--flex-dir);
95
95
  align-items: stretch;
@@ -107,21 +107,21 @@ function q(e) {
107
107
  href: t.link
108
108
  } : {},
109
109
  [N()]: "builder-column",
110
- style: T(v(i))
110
+ style: T(w(i))
111
111
  };
112
112
  };
113
113
  return /* @__PURE__ */ y(B, { children: [
114
114
  /* @__PURE__ */ y(
115
115
  "div",
116
116
  {
117
- className: D((f = e.builderBlock) == null ? void 0 : f.id) + " div-0e218b6c",
118
- style: p(),
117
+ className: D((b = e.builderBlock) == null ? void 0 : b.id) + " div-6e395700",
118
+ style: v(),
119
119
  children: [
120
120
  /* @__PURE__ */ r(
121
121
  A,
122
122
  {
123
123
  id: "builderio-columns",
124
- styles: w(),
124
+ styles: p(),
125
125
  nonce: e.builderContext.nonce
126
126
  }
127
127
  ),
@@ -134,7 +134,7 @@ function q(e) {
134
134
  children: /* @__PURE__ */ r(
135
135
  W,
136
136
  {
137
- path: `component.options.columns.${t}.blocks`,
137
+ path: `columns.${t}.blocks`,
138
138
  parent: e.builderBlock.id,
139
139
  styleProp: {
140
140
  flexGrow: "1"
@@ -151,7 +151,7 @@ function q(e) {
151
151
  ]
152
152
  }
153
153
  ),
154
- /* @__PURE__ */ r("style", { children: `.div-0e218b6c {
154
+ /* @__PURE__ */ r("style", { children: `.div-6e395700 {
155
155
  display: flex;
156
156
  line-height: normal;
157
157
  }` })
@@ -1,4 +1,4 @@
1
- "use client";"use strict";const l=require("react/jsx-runtime"),c=require("react"),i=require("../../functions/is-editing.cjs");function d(e){const r=c.useRef(null);function s(){var t;return["builder-blocks",(t=e.blocks)!=null&&t.length?"":"no-blocks",e.classNameProp].filter(Boolean).join(" ")}function a(){var t,n;i.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function o(){var t,n;i.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return c.useEffect(()=>{},[]),l.jsxs(l.Fragment,{children:[l.jsx(e.BlocksWrapper,{ref:r,className:s()+" props-blocks-wrapper-43ec7ac8","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:t=>a(),onMouseEnter:t=>o(),onKeyPress:t=>a(),...e.BlocksWrapperProps,children:e.children}),l.jsx("style",{children:`.props-blocks-wrapper-43ec7ac8 {
1
+ "use client";"use strict";const a=require("react/jsx-runtime"),l=require("react"),s=require("../../functions/is-editing.cjs");function d(e){const c=l.useRef(null);function o(){var t;return["builder-blocks",(t=e.blocks)!=null&&t.length?"":"no-blocks",e.classNameProp].filter(Boolean).join(" ")}function i(){if(!e.path)return;const t="component.options.";return e.path.startsWith(t)?e.path:`${t}${e.path||""}`}function r(){var t,n;s.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:i()}},"*"))}function u(){var t,n;s.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:i()}},"*"))}return l.useEffect(()=>{},[]),a.jsxs(a.Fragment,{children:[a.jsx(e.BlocksWrapper,{ref:c,className:o()+" props-blocks-wrapper-215a41e0","builder-path":i(),"builder-parent-id":e.parent,style:e.styleProp,onClick:t=>r(),onMouseEnter:t=>u(),onKeyPress:t=>r(),...e.BlocksWrapperProps,children:e.children}),a.jsx("style",{children:`.props-blocks-wrapper-215a41e0 {
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: stretch;
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import { jsxs as s, Fragment as d, jsx as a } from "react/jsx-runtime";
3
- import { useRef as u, useEffect as f } from "react";
4
- import { isEditing as r } from "../../functions/is-editing.mjs";
5
- function h(e) {
6
- const c = u(null);
7
- function i() {
2
+ import { jsxs as d, Fragment as u, jsx as r } from "react/jsx-runtime";
3
+ import { useRef as f, useEffect as h } from "react";
4
+ import { isEditing as i } from "../../functions/is-editing.mjs";
5
+ function b(e) {
6
+ const o = f(null);
7
+ function c() {
8
8
  var t;
9
9
  return [
10
10
  "builder-blocks",
@@ -12,50 +12,56 @@ function h(e) {
12
12
  e.classNameProp
13
13
  ].filter(Boolean).join(" ");
14
14
  }
15
+ function a() {
16
+ if (!e.path)
17
+ return;
18
+ const t = "component.options.";
19
+ return e.path.startsWith(t) ? e.path : `${t}${e.path || ""}`;
20
+ }
15
21
  function l() {
16
22
  var t, n;
17
- r() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
23
+ i() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
18
24
  {
19
25
  type: "builder.clickEmptyBlocks",
20
26
  data: {
21
27
  parentElementId: e.parent,
22
- dataPath: e.path
28
+ dataPath: a()
23
29
  }
24
30
  },
25
31
  "*"
26
32
  ));
27
33
  }
28
- function o() {
34
+ function s() {
29
35
  var t, n;
30
- r() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
36
+ i() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
31
37
  {
32
38
  type: "builder.hoverEmptyBlocks",
33
39
  data: {
34
40
  parentElementId: e.parent,
35
- dataPath: e.path
41
+ dataPath: a()
36
42
  }
37
43
  },
38
44
  "*"
39
45
  ));
40
46
  }
41
- return f(() => {
42
- }, []), /* @__PURE__ */ s(d, { children: [
43
- /* @__PURE__ */ a(
47
+ return h(() => {
48
+ }, []), /* @__PURE__ */ d(u, { children: [
49
+ /* @__PURE__ */ r(
44
50
  e.BlocksWrapper,
45
51
  {
46
- ref: c,
47
- className: i() + " props-blocks-wrapper-43ec7ac8",
48
- "builder-path": e.path,
52
+ ref: o,
53
+ className: c() + " props-blocks-wrapper-215a41e0",
54
+ "builder-path": a(),
49
55
  "builder-parent-id": e.parent,
50
56
  style: e.styleProp,
51
57
  onClick: (t) => l(),
52
- onMouseEnter: (t) => o(),
58
+ onMouseEnter: (t) => s(),
53
59
  onKeyPress: (t) => l(),
54
60
  ...e.BlocksWrapperProps,
55
61
  children: e.children
56
62
  }
57
63
  ),
58
- /* @__PURE__ */ a("style", { children: `.props-blocks-wrapper-43ec7ac8 {
64
+ /* @__PURE__ */ r("style", { children: `.props-blocks-wrapper-215a41e0 {
59
65
  display: flex;
60
66
  flex-direction: column;
61
67
  align-items: stretch;
@@ -63,5 +69,5 @@ function h(e) {
63
69
  ] });
64
70
  }
65
71
  export {
66
- h as default
72
+ b as default
67
73
  };
@@ -1 +1 @@
1
- "use client";"use strict";const k=require("react/jsx-runtime"),o=require("react"),N=require("../../../context/builder.context.cjs"),W=require("../../../functions/evaluate/evaluate.cjs"),A=require("../../../functions/fast-clone.cjs"),B=require("../../../functions/get-content/index.cjs"),R=require("../../../functions/is-browser.cjs"),g=require("../../../functions/is-editing.cjs"),D=require("../../../functions/is-previewing.cjs"),U=require("../../../functions/register-component.cjs"),P=require("../../../functions/track/index.cjs"),O=require("../../../functions/track/interaction.cjs"),y=require("../../../helpers/canTrack.cjs"),F=require("../../../helpers/preview-lru-cache/set.cjs"),$=require("../../../helpers/subscribe-to-editor.cjs"),H=require("../../../scripts/init-editing.cjs"),z=require("../../block/animator.cjs"),G=require("./styles.helpers.cjs"),J=require("next/navigation");function Q(e){var q,w,I;const d=o.useRef(null);function f(n){var a,i;const t={...e.builderContextSignal.rootState,...n};e.builderContextSignal.rootSetState?(i=(a=e.builderContextSignal).rootSetState)==null||i.call(a,t):e.builderContextSignal.rootState=t}function b(n){var a,i,r,c,u;const t={...e.builderContextSignal.content,...n,data:{...(a=e.builderContextSignal.content)==null?void 0:a.data,...n==null?void 0:n.data},meta:{...(i=e.builderContextSignal.content)==null?void 0:i.meta,...n==null?void 0:n.meta,breakpoints:((r=n==null?void 0:n.meta)==null?void 0:r.breakpoints)||((u=(c=e.builderContextSignal.content)==null?void 0:c.meta)==null?void 0:u.breakpoints)}};F.postPreviewContent({value:t,key:t.id}).then(()=>{V.refresh()})}function L(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[K,X]=o.useState(()=>e.contentWrapper||"div");function S(n){return $.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:t=>{var r;const{breakpoints:a,contentId:i}=t;!i||i!==((r=e.builderContextSignal.content)==null?void 0:r.id)||a&&b({meta:{breakpoints:a}})},animation:t=>{z.triggerAnimation(t)},contentUpdate:t=>{b(t)}}})(n)}const[v,Y]=o.useState(()=>({})),[m,Z]=o.useState(()=>({})),[h,T]=o.useState(()=>!1);function _(n){var t,a;if(e.builderContextSignal.content){const i=(t=e.builderContextSignal.content)==null?void 0:t.testVariationId,r=(a=e.builderContextSignal.content)==null?void 0:a.id;P._track({apiHost:e.apiHost,type:"click",canTrack:y.getDefaultCanTrack(e.canTrack),contentId:r,apiKey:e.apiKey,variationId:i!==r?i:void 0,...O.getInteractionPropertiesForEvent(n),unique:!h})}h||T(!0)}function j(){var t,a,i;const n=(i=(a=(t=e.builderContextSignal.content)==null?void 0:t.data)==null?void 0:a.httpRequests)!=null?i:{};Object.entries(n).forEach(([r,c])=>{if(!c||m[r]||v[r]&&!g.isEditing())return;m[r]=!0;const u=c.replace(/{{([^}]+)}}/g,(s,M)=>String(W.evaluate({code:M,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})));fetch(u).then(s=>s.json()).then(s=>{f({[r]:s}),v[r]=!0}).catch(s=>{console.error("error fetching dynamic data",c,s)}).finally(()=>{m[r]=!1})})}function l(){g.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:A.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function E(n){window.addEventListener("message",S),H.registerInsertMenu(),H.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(t=>{var i;const a=U.createRegisterComponentMessage(t);(i=window.parent)==null||i.postMessage(a,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",l)}function x(n){const t=new URL(location.href).searchParams,a=t.get("builder.preview"),i=t.get(`builder.overrides.${a}`),r=t.get("apiKey")||t.get("builder.space");a===e.model&&r===e.apiKey&&(!e.content||i===e.content.id)&&B.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(c=>{c&&b(c)})}const V=J.useRouter(),C=o.useRef(!1);return C.current||(j(),l(),C.current=!0),o.useEffect(()=>{var n;return(n=d.current)==null||n.addEventListener("initeditingbldr",E),()=>{var t;return(t=d.current)==null?void 0:t.removeEventListener("initeditingbldr",E)}},[]),o.useEffect(()=>{var n;return(n=d.current)==null||n.addEventListener("initpreviewingbldr",x),()=>{var t;return(t=d.current)==null?void 0:t.removeEventListener("initpreviewingbldr",x)}},[]),o.useEffect(()=>{var n,t;if(R.isBrowser()){if(g.isEditing()&&!e.isNestedRender&&d.current&&d.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&y.getDefaultCanTrack(e.canTrack)){const i=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,r=(t=e.builderContextSignal.content)==null?void 0:t.id,c=e.apiKey;P._track({apiHost:e.apiHost,type:"impression",canTrack:!0,contentId:r,apiKey:c,variationId:i!==r?i:void 0})}D.isPreviewing()&&g.isEditing()}},[]),o.useEffect(()=>{},[e.content]),o.useEffect(()=>{l()},[e.builderContextSignal.rootState]),o.useEffect(()=>{e.data&&f(e.data)},[e.data]),o.useEffect(()=>{e.locale&&f({locale:e.locale})},[e.locale]),o.useEffect(()=>()=>{R.isBrowser()&&(window.removeEventListener("message",S),window.removeEventListener("builder:component:stateChangeListenerActivated",l))},[]),k.jsx(N.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?k.jsx(K,{ref:d,onClick:n=>_(n),"builder-content-id":(q=e.builderContextSignal.content)==null?void 0:q.id,"builder-model":e.model,className:G.getWrapperClassName(((w=e.content)==null?void 0:w.testVariationId)||((I=e.content)==null?void 0:I.id)),...L(),...e.contentWrapperProps,children:e.children}):null})}module.exports=Q;
1
+ "use client";"use strict";const k=require("react/jsx-runtime"),o=require("react"),N=require("../../../context/builder.context.cjs"),W=require("../../../functions/evaluate/evaluate.cjs"),A=require("../../../functions/fast-clone.cjs"),B=require("../../../functions/get-content/index.cjs"),R=require("../../../functions/is-browser.cjs"),g=require("../../../functions/is-editing.cjs"),D=require("../../../functions/is-previewing.cjs"),F=require("../../../functions/log-fetch.cjs"),U=require("../../../functions/register-component.cjs"),P=require("../../../functions/track/index.cjs"),O=require("../../../functions/track/interaction.cjs"),y=require("../../../helpers/canTrack.cjs"),$=require("../../../helpers/preview-lru-cache/set.cjs"),z=require("../../../helpers/subscribe-to-editor.cjs"),H=require("../../../scripts/init-editing.cjs"),G=require("../../block/animator.cjs"),J=require("./styles.helpers.cjs"),Q=require("next/navigation");function X(e){var q,w,I;const s=o.useRef(null);function f(n){var r,i;const t={...e.builderContextSignal.rootState,...n};e.builderContextSignal.rootSetState?(i=(r=e.builderContextSignal).rootSetState)==null||i.call(r,t):e.builderContextSignal.rootState=t}function b(n){var r,i,a,c,l;const t={...e.builderContextSignal.content,...n,data:{...(r=e.builderContextSignal.content)==null?void 0:r.data,...n==null?void 0:n.data},meta:{...(i=e.builderContextSignal.content)==null?void 0:i.meta,...n==null?void 0:n.meta,breakpoints:((a=n==null?void 0:n.meta)==null?void 0:a.breakpoints)||((l=(c=e.builderContextSignal.content)==null?void 0:c.meta)==null?void 0:l.breakpoints)}};$.postPreviewContent({value:t,key:t.id}).then(()=>{V.refresh()})}function L(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[K,Y]=o.useState(()=>e.contentWrapper||"div");function S(n){return z.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:t=>{var a;const{breakpoints:r,contentId:i}=t;!i||i!==((a=e.builderContextSignal.content)==null?void 0:a.id)||r&&b({meta:{breakpoints:r}})},animation:t=>{G.triggerAnimation(t)},contentUpdate:t=>{b(t)}}})(n)}const[v,Z]=o.useState(()=>({})),[m,p]=o.useState(()=>({})),[h,T]=o.useState(()=>!1);function _(n){var t,r;if(e.builderContextSignal.content){const i=(t=e.builderContextSignal.content)==null?void 0:t.testVariationId,a=(r=e.builderContextSignal.content)==null?void 0:r.id;P._track({apiHost:e.apiHost,type:"click",canTrack:y.getDefaultCanTrack(e.canTrack),contentId:a,apiKey:e.apiKey,variationId:i!==a?i:void 0,...O.getInteractionPropertiesForEvent(n),unique:!h})}h||T(!0)}function j(){var t,r,i;const n=(i=(r=(t=e.builderContextSignal.content)==null?void 0:t.data)==null?void 0:r.httpRequests)!=null?i:{};Object.entries(n).forEach(([a,c])=>{if(!c||m[a]||v[a]&&!g.isEditing())return;m[a]=!0;const l=c.replace(/{{([^}]+)}}/g,(d,M)=>String(W.evaluate({code:M,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})));F.logFetch(l),fetch(l).then(d=>d.json()).then(d=>{f({[a]:d}),v[a]=!0}).catch(d=>{console.error("error fetching dynamic data",c,d)}).finally(()=>{m[a]=!1})})}function u(){g.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:A.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function E(n){window.addEventListener("message",S),H.registerInsertMenu(),H.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(t=>{var i;const r=U.createRegisterComponentMessage(t);(i=window.parent)==null||i.postMessage(r,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",u)}function x(n){const t=new URL(location.href).searchParams,r=t.get("builder.preview"),i=t.get(`builder.overrides.${r}`),a=t.get("apiKey")||t.get("builder.space");r===e.model&&a===e.apiKey&&(!e.content||i===e.content.id)&&B.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(c=>{c&&b(c)})}const V=Q.useRouter(),C=o.useRef(!1);return C.current||(j(),u(),C.current=!0),o.useEffect(()=>{var n;return(n=s.current)==null||n.addEventListener("initeditingbldr",E),()=>{var t;return(t=s.current)==null?void 0:t.removeEventListener("initeditingbldr",E)}},[]),o.useEffect(()=>{var n;return(n=s.current)==null||n.addEventListener("initpreviewingbldr",x),()=>{var t;return(t=s.current)==null?void 0:t.removeEventListener("initpreviewingbldr",x)}},[]),o.useEffect(()=>{var n,t;if(R.isBrowser()){if(g.isEditing()&&!e.isNestedRender&&s.current&&s.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&y.getDefaultCanTrack(e.canTrack)){const i=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,a=(t=e.builderContextSignal.content)==null?void 0:t.id,c=e.apiKey;P._track({apiHost:e.apiHost,type:"impression",canTrack:!0,contentId:a,apiKey:c,variationId:i!==a?i:void 0})}D.isPreviewing()&&g.isEditing()}},[]),o.useEffect(()=>{},[e.content]),o.useEffect(()=>{u()},[e.builderContextSignal.rootState]),o.useEffect(()=>{e.data&&f(e.data)},[e.data]),o.useEffect(()=>{e.locale&&f({locale:e.locale})},[e.locale]),o.useEffect(()=>()=>{R.isBrowser()&&(window.removeEventListener("message",S),window.removeEventListener("builder:component:stateChangeListenerActivated",u))},[]),k.jsx(N.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?k.jsx(K,{ref:s,onClick:n=>_(n),"builder-content-id":(q=e.builderContextSignal.content)==null?void 0:q.id,"builder-model":e.model,className:J.getWrapperClassName(((w=e.content)==null?void 0:w.testVariationId)||((I=e.content)==null?void 0:I.id)),...L(),...e.contentWrapperProps,children:e.children}):null})}module.exports=X;