@builder.io/sdk-react-nextjs 0.11.3 → 0.11.4
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.
- package/lib/{node/USE_CLIENT_BUNDLE-d5a78124.js → browser/USE_CLIENT_BUNDLE-7df7e7c0.js} +189 -174
- package/lib/browser/USE_CLIENT_BUNDLE-d5da4b24.cjs +23 -0
- package/lib/{edge/USE_SERVER_BUNDLE-29a862aa.cjs → browser/USE_SERVER_BUNDLE-8af2f5dc.cjs} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-207cbf86.js → browser/USE_SERVER_BUNDLE-f1f7aed0.js} +1 -1
- package/lib/browser/{bundle-b781019e.cjs → bundle-0dffcadd.cjs} +3 -3
- package/lib/browser/{bundle-062859d6.js → bundle-a7aa61af.js} +41 -40
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/edge/USE_CLIENT_BUNDLE-00c9108d.cjs +23 -0
- package/lib/{browser/USE_CLIENT_BUNDLE-812d744e.js → edge/USE_CLIENT_BUNDLE-0a7d6596.js} +189 -174
- package/lib/{node/USE_SERVER_BUNDLE-f94a06b5.cjs → edge/USE_SERVER_BUNDLE-426439b2.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-5a34a612.js → edge/USE_SERVER_BUNDLE-b5008704.js} +1 -1
- package/lib/edge/{bundle-24c6dba3.cjs → bundle-274cf781.cjs} +3 -3
- package/lib/edge/{bundle-52f65e64.js → bundle-b11ace6b.js} +3 -2
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-dc52931c.js → node/USE_CLIENT_BUNDLE-66fa8f31.js} +189 -174
- package/lib/node/USE_CLIENT_BUNDLE-760546ac.cjs +23 -0
- package/lib/{browser/USE_SERVER_BUNDLE-7d93f151.js → node/USE_SERVER_BUNDLE-b09b2378.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-3646ae12.cjs → node/USE_SERVER_BUNDLE-d148827b.cjs} +1 -1
- package/lib/node/{bundle-829842dd.js → bundle-5539b1a0.js} +5 -4
- package/lib/node/{bundle-b0598b3a.cjs → bundle-701c93a1.cjs} +3 -3
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +1 -1
- package/types/cjs/components/content/components/enable-editor.d.ts +1 -1
- package/types/cjs/components/content/content.helpers.d.ts +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/esm/components/content/components/enable-editor.d.ts +1 -1
- package/types/esm/components/content/content.helpers.d.ts +1 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/lib/browser/USE_CLIENT_BUNDLE-2986f66f.cjs +0 -23
- package/lib/edge/USE_CLIENT_BUNDLE-7f127af4.cjs +0 -23
- package/lib/node/USE_CLIENT_BUNDLE-c9e8796d.cjs +0 -23
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),c=require("./bundle-0dffcadd.cjs"),r=require("react"),V=require("./USE_SERVER_BUNDLE-8af2f5dc.cjs"),A=require("next/navigation");function D(e){return t.jsxs(t.Fragment,{children:[e.link?t.jsx(t.Fragment,{children:t.jsx("a",{...e.attributes,href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"button",children:e.text})}):t.jsx(t.Fragment,{children:t.jsx("button",{...e.attributes,style:e.attributes.style,className:e.attributes.className+" button-fdf49de0",children:e.text})}),t.jsx("style",{children:`.button-fdf49de0 {
|
|
2
|
+
all: unset;
|
|
3
|
+
}`})]})}function U(e){return t.jsxs(t.Fragment,{children:[" ",e.hasChildren?t.jsx(t.Fragment,{children:t.jsxs(e.Wrapper,{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:[" ",e.children," "]})}):t.jsx(t.Fragment,{children:t.jsx(e.Wrapper,{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0})})})," "]})}function H(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{},children:e.children})}function O(e){function o(){var s;return"builder-blocks"+((s=e.blocks)!=null&&s.length?"":" no-blocks")}function g(){var s,m;c.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((m=window.parent)==null||m.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var s,m;c.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((m=window.parent)==null||m.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:o()+" props-blocks-wrapper-4f2c12d8","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:s=>g(),onMouseEnter:s=>S(),onKeyPress:s=>g(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-4f2c12d8 {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
align-items: stretch;
|
|
7
|
+
}`})]})}function J(e){return t.jsx("span",{children:e.children})}function $(e){var s,m,x,v;function o(){var f;const d=e.image||e.src;if(!d||!(d.match(/builder\.io/)||d.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((f=e.image)!=null&&f.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),c.getSrcSet(d)}else if(e.image&&!e.srcset)return c.getSrcSet(d);return c.getSrcSet(d)}function g(){var b;return(b=o==null?void 0:o())!=null&&b.match(/builder\.io/)&&!e.noWebp?o().replace(/\?/g,"?format=webp&"):""}function S(){const b={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?b:void 0}return t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[g()?t.jsx(t.Fragment,{children:t.jsx("source",{type:"image/webp",srcSet:g()})}):null,t.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?"presentation":void 0,style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...S()},className:"builder-image"+(e.className?" "+e.className:"")+" img-40c70c9b",src:e.image,srcSet:o(),sizes:e.sizes})]}),e.aspectRatio&&!((m=(s=e.builderBlock)==null?void 0:s.children)!=null&&m.length&&e.fitContent)?t.jsx(t.Fragment,{children:t.jsx("div",{className:"builder-image-sizer div-40c70c9b",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(v=(x=e.builderBlock)==null?void 0:x.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&e.children?t.jsx(t.Fragment,{children:t.jsx("div",{className:"div-40c70c9b-2",children:e.children})}):null]}),t.jsx("style",{children:`.img-40c70c9b {
|
|
8
|
+
opacity: 1;
|
|
9
|
+
transition: opacity 0.2s ease-in-out;
|
|
10
|
+
}.div-40c70c9b {
|
|
11
|
+
width: 100%;
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
font-size: 0;
|
|
14
|
+
}.div-40c70c9b-2 {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
align-items: stretch;
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: 0;
|
|
20
|
+
left: 0;
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
}`})]})}function G(e){return t.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}function Q(e){const o=r.useRef(null),[g,S]=r.useState(()=>[]),[s,m]=r.useState(()=>[]);return r.useEffect(()=>{var v;if(!((v=o.current)!=null&&v.getElementsByTagName)||typeof window>"u")return;const x=o.current.getElementsByTagName("script");for(let b=0;b<x.length;b++){const d=x[b];if(d.src){if(g.includes(d.src))continue;g.push(d.src);const f=document.createElement("script");f.async=!0,f.src=d.src,document.head.appendChild(f)}else if(!d.type||["text/javascript","application/javascript","application/ecmascript"].includes(d.type)){if(s.includes(d.innerText))continue;try{s.push(d.innerText),new Function(d.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),t.jsx("div",{ref:o,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function X(e){const o=r.useRef(null),[g,S]=r.useState(()=>[]),[s,m]=r.useState(()=>[]),[x,v]=r.useState(()=>!1);function b(){if(!o.current||!o.current.getElementsByTagName)return;const d=o.current.getElementsByTagName("script");for(let f=0;f<d.length;f++){const k=d[f];if(k.src&&!g.includes(k.src)){g.push(k.src);const y=document.createElement("script");y.async=!0,y.src=k.src,document.head.appendChild(y)}else if(c.isJsScript(k)&&!s.includes(k.innerText))try{s.push(k.innerText),new Function(k.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return r.useEffect(()=>{o.current&&!x&&(v(!0),b())},[o.current,x]),t.jsx("div",{className:"builder-embed",ref:o,dangerouslySetInnerHTML:{__html:e.content}})}function Y(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},c.isEditing()&&e.imgSrc||"default-key")}function Z(e){var S,s,m,x,v,b,d;function o(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function g(){return{...o()}}return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("video",{className:"builder-video",...g(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(S=e.attributes)==null?void 0:S.style,objectFit:e.fit,objectPosition:e.position,zIndex:2,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},src:e.video||"no-src",poster:e.posterImage,children:e.lazyLoad?null:t.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((m=(s=e.builderBlock)==null?void 0:s.children)!=null&&m.length))?t.jsx(t.Fragment,{children:t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}})}):null,(v=(x=e.builderBlock)==null?void 0:x.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children:t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children})}):null,(d=(b=e.builderBlock)==null?void 0:b.children)!=null&&d.length&&!e.fitContent?t.jsx(t.Fragment,{children:t.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children})}):null]})}const p=r.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function ee(e){var I,P,B,F,T,N,L;const o=r.useRef(null),[g,S]=r.useState(()=>0);r.useState(()=>!0);function s(n){var a,l;const i={...e.builderContextSignal.rootState,...n};e.builderContextSignal.rootSetState?(l=(a=e.builderContextSignal).rootSetState)==null||l.call(a,i):e.builderContextSignal.rootState=i}function m(n){var a,l,u,h,W;const i={...e.builderContextSignal.content,...n,data:{...(a=e.builderContextSignal.content)==null?void 0:a.data,...n==null?void 0:n.data},meta:{...(l=e.builderContextSignal.content)==null?void 0:l.meta,...n==null?void 0:n.meta,breakpoints:((u=n==null?void 0:n.meta)==null?void 0:u.breakpoints)||((W=(h=e.builderContextSignal.content)==null?void 0:h.meta)==null?void 0:W.breakpoints)}};V.postPreviewContent({value:i,key:i.id}).then(()=>{M.refresh()})}r.useState(()=>0);const[x,v]=r.useState(()=>!1),[b,d]=r.useState(()=>e.contentWrapper||"div");function f(n){var a;const{data:i}=n;if(i)switch(i.type){case"builder.configureSdk":{const l=i.data,{breakpoints:u,contentId:h}=l;if(!h||h!==((a=e.builderContextSignal.content)==null?void 0:a.id))return;u&&m({meta:{breakpoints:u}}),S(g+1);break}case"builder.contentUpdate":{const l=i.data,u=l.key||l.alias||l.entry||l.modelName,h=l.data;u===e.model&&(m(h),S(g+1));break}}}function k(){var i,a;const n=(a=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:a.jsCode;n&&c.evaluate({code:n,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[y,te]=r.useState(()=>({})),[E,K]=r.useState(()=>!1);function q(n){var i,a;if(e.builderContextSignal.content){const l=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(a=e.builderContextSignal.content)==null?void 0:a.id;c._track({type:"click",canTrack:c.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:l!==u?l:void 0,...c.getInteractionPropertiesForEvent(n),unique:!E})}E||K(!0)}function _(n){return n.replace(/{{([^}]+)}}/g,(i,a)=>c.evaluate({code:a,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function z({url:n,key:i}){c.fetch(n).then(a=>a.json()).then(a=>{var u,h;const l={...e.builderContextSignal.rootState,[i]:a};(h=(u=e.builderContextSignal).rootSetState)==null||h.call(u,l),y[i]=!0}).catch(a=>{console.error("error fetching dynamic data",n,a)})}function j(){var i,a;const n=((a=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:a.httpRequests)??{};Object.entries(n).forEach(([l,u])=>{if(u&&(!y[l]||c.isEditing())){const h=_(u);z({url:h,key:l})}})}function C(){c.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:c.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function w(n){S(g+1),window.addEventListener("message",f),c.registerInsertMenu(),c.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.includeRefs?{includeRefs:e.includeRefs}:{},...e.enrich?{enrich:e.enrich}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(i=>{var l;const a=c.createRegisterComponentMessage(i);(l=window.parent)==null||l.postMessage(a,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",C)}function R(n){const i=new URL(location.href).searchParams,a=i.get("builder.preview"),l=i.get(`builder.preview.${a}`),u=i.get("apiKey")||i.get("builder.space");a===e.model&&u===e.apiKey&&(!e.content||l===e.content.id)&&c.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(h=>{h&&m(h)})}const M=A.useRouter();return r.useEffect(()=>{var n;return(n=o.current)==null||n.addEventListener("initeditingbldr",w),()=>{var i;return(i=o.current)==null?void 0:i.removeEventListener("initeditingbldr",w)}},[]),r.useEffect(()=>{var n;return(n=o.current)==null||n.addEventListener("initpreviewingbldr",R),()=>{var i;return(i=o.current)==null?void 0:i.removeEventListener("initpreviewingbldr",R)}},[]),r.useEffect(()=>{var n,i;if(c.isBrowser()){if(c.isEditing()&&o.current&&o.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&c.getDefaultCanTrack(e.canTrack)){const l=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,u=(i=e.builderContextSignal.content)==null?void 0:i.id,h=e.apiKey;c._track({type:"impression",canTrack:!0,contentId:u,apiKey:h,variationId:l!==u?l:void 0})}c.isPreviewing()&&o.current}},[]),r.useEffect(()=>{e.apiKey||c.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),k(),j(),C()},[]),r.useEffect(()=>{},[e.content]),r.useEffect(()=>{c.isBrowser()&&(window.removeEventListener("message",f),window.addEventListener("message",f))},[x]),r.useEffect(()=>{k()},[(P=(I=e.builderContextSignal.content)==null?void 0:I.data)==null?void 0:P.jsCode,e.builderContextSignal.rootState]),r.useEffect(()=>{j()},[(F=(B=e.builderContextSignal.content)==null?void 0:B.data)==null?void 0:F.httpRequests]),r.useEffect(()=>{C()},[e.builderContextSignal.rootState]),r.useEffect(()=>{e.data&&s(e.data)},[e.data]),r.useEffect(()=>{e.locale&&s({locale:e.locale})},[e.locale]),r.useEffect(()=>()=>{c.isBrowser()&&(window.removeEventListener("message",f),window.removeEventListener("builder:component:stateChangeListenerActivated",C))},[]),t.jsx(p.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(t.Fragment,{children:r.createElement(b,{key:g,ref:o,onClick:n=>q(n),"builder-content-id":(T=e.builderContextSignal.content)==null?void 0:T.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((N=e.content)==null?void 0:N.testVariationId)||((L=e.content)==null?void 0:L.id)}`},e.children)}):null})}exports.BlockWrapper=U;exports.BlocksWrapper=O;exports.Button=D;exports.CustomCode=Q;exports.Embed=X;exports.EnableEditor=ee;exports.FragmentComponent=J;exports.Image=$;exports.ImgComponent=Y;exports.InteractiveElement=H;exports.SectionComponent=G;exports.Video=Z;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use server";"use strict";const n=require("./bundle-
|
|
1
|
+
"use server";"use strict";const n=require("./bundle-0dffcadd.cjs");async function s({key:e,value:t}){return n.init(),globalThis._BUILDER_PREVIEW_LRU_CACHE.set(e,t),{[e]:t}}exports.postPreviewContent=s;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const Oe=require("lru-cache"),s=require("react/jsx-runtime"),Ne=require("react"),v=require("./USE_CLIENT_BUNDLE-
|
|
1
|
+
"use strict";const Oe=require("lru-cache"),s=require("react/jsx-runtime"),Ne=require("react"),v=require("./USE_CLIENT_BUNDLE-d5da4b24.cjs");require("next/navigation");function _e(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const A="[Builder.io]: ",k={log:(...e)=>console.log(A,...e),error:(...e)=>console.error(A,...e),warn:(...e)=>console.warn(A,...e),debug:(...e)=>console.debug(A,...e)};function x(){return typeof window<"u"&&typeof document<"u"}const I="rsc";function Le(){return x()&&window.self!==window.top}function $(){return Le()&&window.location.search.indexOf("builder.frameEditing=")!==-1}const Ue=()=>{if(x()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},Me=()=>typeof navigator=="object"&&navigator.userAgent||"",de=()=>{const e=Me(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||I==="reactNative"}},n=e.match(/Tablet|iPad/i),o=Ue();return{urlPath:o==null?void 0:o.pathname,host:(o==null?void 0:o.host)||(o==null?void 0:o.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},De=({builder:e,context:t,event:n,state:o})=>Object.entries({state:o,Builder:e,builder:e,context:t,event:n}),Ke=()=>({isEditing:$(),isBrowser:x(),isServer:!x(),getUserAttributes:()=>de()}),He=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,Y=({code:e,builder:t,context:n,event:o,localState:i,rootSetState:r,rootState:a})=>{const c=De({builder:t,context:n,event:o,state:ze(a,i,r)});return new Function(...c.map(([l])=>l),e)(...c.map(([,l])=>l))};function ze(e,t,n){if(e===t)throw new Error("rootState === localState");return new Proxy(e,{get:(o,i)=>t&&i in t?t[i]:e[i],set:(o,i,r)=>{if(t&&i in t)throw new Error("Writing to local state is not allowed as it is read-only.");return e[i]=r,n==null||n(e),!0}})}const qe=e=>(x(),Y(e));function F({code:e,context:t,localState:n,rootState:o,rootSetState:i,event:r,isExpression:a=!0}){if(e===""){k.warn("Skipping evaluation of empty code block.");return}const c={code:He(e,{isExpression:a}),builder:Ke(),context:t,event:r,rootSetState:i,rootState:o,localState:n};try{return qe(c)}catch(l){k.error("Failed code evaluation: "+l.message,{code:e});return}}const R=e=>JSON.parse(JSON.stringify(e)),Ge=(e,t,n)=>{if(Object(e)!==e)return e;const o=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return o.slice(0,-1).reduce((i,r,a)=>Object(i[r])===i[r]?i[r]:i[r]=Math.abs(Number(o[a+1]))>>0===+o[a+1]?[]:{},e)[o[o.length-1]]=n,e};const Je=({block:e,context:t,localState:n,rootState:o,rootSetState:i})=>{if(!e.bindings)return e;const r=R(e),a={...r,properties:{...r.properties},actions:{...r.actions}};for(const c in e.bindings){const l=e.bindings[c],u=F({code:l,localState:n,rootState:o,rootSetState:i,context:t});Ge(a,c,u)}return a};function j({block:e,context:t,shouldEvaluateBindings:n,localState:o,rootState:i,rootSetState:r}){const a=e;return n?Je({block:a,localState:o,rootState:i,rootSetState:r,context:t}):a}const Ye=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],U=e=>typeof e=="string"&&Ye.includes(e.toLowerCase()),Qe=({block:e,context:t,registeredComponents:n})=>{var r;const o=(r=j({block:e,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,shouldEvaluateBindings:!1}).component)==null?void 0:r.name;if(!o)return null;const i=n[o];if(i)return i;console.warn(`
|
|
2
2
|
Could not find a registered component named "${o}".
|
|
3
3
|
If you registered it, is the file that registered it imported by the file that needs to render it?`)},Xe=({block:e,context:t})=>{const{repeat:n,...o}=e;if(!(n!=null&&n.collection))return;const i=F({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context});if(!Array.isArray(i))return;const r=n.collection.split(".").pop(),a=n.itemName||(r?r+"Item":"item");return i.map((l,u)=>({context:{...t,localState:{...t.localState,$index:u,$item:l,[a]:l,[`$${a}Index`]:u}},block:o}))},ue={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},Q=(e,t=ue)=>`@media (max-width: ${t[e].max}px)`,me=({small:e,medium:t})=>{const n=R(ue);if(!e||!t)return n;const o=Math.floor(e/2);n.small={max:e,min:o,default:o+1};const i=n.small.max+1;n.medium={max:t,min:i,default:i+1};const r=n.medium.max+1;return n.large={max:2e3,min:r,default:r+1},n},Ze=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),w=e=>e!=null,fe=e=>Object.entries(e).map(([n,o])=>{if(typeof o=="string")return`${Ze(n)}: ${o};`}).filter(w),et=e=>fe(e).join(`
|
|
4
4
|
`),M=({mediaQuery:e,className:t,styles:n})=>{const o=`.${t} {
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
)`,qt=({contentId:e,variationId:t})=>`window.${we}(
|
|
136
136
|
"${t}", "${e}", ${Ie}
|
|
137
137
|
)`;function K(e){return s.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},id:e.id||""})}const Gt=e=>{const t=e.get("preview"),n=e.get("overrides."+t);return n||k.warn("No previewed ID found in search params."),n};function Ee(){globalThis._BUILDER_PREVIEW_LRU_CACHE||(globalThis._BUILDER_PREVIEW_LRU_CACHE=new Oe.LRUCache({max:500,ttl:1e3*60*5}))}function Jt(e){Ee();const t=Gt(e);return typeof t=="string"?globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t):void 0}function Yt(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:globalThis}function Qt(){const e=Yt().fetch;if(typeof e>"u")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
138
|
-
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const Te=Qt();function V(e,t=null,n="."){return Object.keys(e).reduce((o,i)=>{const r=e[i],a=[t,i].filter(Boolean).join(n);return[typeof r=="object",r!==null,!(Array.isArray(r)&&r.length===0)].every(Boolean)?{...o,...V(r,a,n)}:{...o,[a]:r}},{})}const Xt="v3",ne="builder.",Zt="options.",en=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},z=e=>{if(!e)return{};const t=Re(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(ne)){const i=o.replace(ne,"").replace(Zt,"");n[i]=t[o]}}),n},tn=()=>{if(!x())return{};const e=new URLSearchParams(window.location.search);return z(e)},Re=e=>e instanceof URLSearchParams?en(e):e,oe=e=>typeof e=="number"&&!isNaN(e)&&e>=0,q=e=>{let{noTraverse:t=!1}=e;const{limit:n=30,userAttributes:o,query:i,model:r,apiKey:a,includeRefs:c=!0,enrich:l,locale:u,apiVersion:h=Xt,fields:g,omit:m,offset:f,cacheSeconds:p,staleCacheSeconds:d,sort:b,includeUnpublished:S}=e;if(!a)throw new Error("Missing API key");if(!["v2","v3"].includes(h))throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${h}'`);(e.limit===void 0||e.limit>1)&&!("noTraverse"in e)&&(t=!0);const y=new URL(`https://cdn.builder.io/api/${h}/content/${r}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${c}${u?`&locale=${u}`:""}${l?`&enrich=${l}`:""}`);if(y.searchParams.set("omit",m||"meta.componentsUsed"),g&&y.searchParams.set("fields",g),Number.isFinite(f)&&f>-1&&y.searchParams.set("offset",String(Math.floor(f))),typeof S=="boolean"&&y.searchParams.set("includeUnpublished",String(S)),p&&oe(p)&&y.searchParams.set("cacheSeconds",String(p)),d&&oe(d)&&y.searchParams.set("staleCacheSeconds",String(d)),b){const C=V({sort:b});for(const T in C)y.searchParams.set(T,JSON.stringify(C[T]))}const P={...tn(),...Re(e.options||{})},E=V(P);for(const C in E)y.searchParams.set(C,String(E[C]));if(o&&y.searchParams.set("userAttributes",JSON.stringify(o)),i){const C=V({query:i});for(const T in C)y.searchParams.set(T,JSON.stringify(C[T]))}return y},nn=e=>"results"in e;async function L(e){const t=await G({...e,limit:1});return t&&t[0]||null}const on=L,rn=async e=>{const t=q(e);return await(await Te(t.href)).json()},Pe=async(e,t,n=q(e))=>{const o=W(e.canTrack);if(n.search.includes("preview=")){const r=[];for(const a of t.results){const c=Jt(n.searchParams);r.push(c||a)}t.results=r}if(!o||!(x()||I==="reactNative"))return t.results;try{const r=[];for(const a of t.results)r.push(await wt({item:a,canTrack:o}));t.results=r}catch(r){k.error("Could not process A/B tests. ",r)}return t.results};async function G(e){try{const t=q(e),n=await rn(e);return nn(n)?Pe(e,n):(k.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return k.error("Error fetching data. ",t),null}}const an=G;function sn(){return!x()||$()?!1:location.search.indexOf("builder.preview=")!==-1}function cn(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function Ae(){return cn().replace(/-/g,"")}const Be="builderSessionId",ln=async({canTrack:e})=>{if(!e)return;const t=await be({name:Be,canTrack:e});if(w(t))return t;{const n=dn();return un({id:n,canTrack:e}),n}},dn=()=>Ae(),un=({id:e,canTrack:t})=>ye({name:Be,value:e,canTrack:t}),Ve=()=>x()&&typeof localStorage<"u"?localStorage:void 0,mn=({key:e,canTrack:t})=>{var n;try{return t?(n=Ve())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},fn=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=Ve())==null||o.setItem(e,n))}catch(i){console.debug("[LocalStorage] SET error: ",i)}},je="builderVisitorId",hn=({canTrack:e})=>{if(!e)return;const t=mn({key:je,canTrack:e});if(w(t))return t;{const n=pn();return gn({id:n,canTrack:e}),n}},pn=()=>Ae(),gn=({id:e,canTrack:t})=>fn({key:je,value:e,canTrack:t}),bn=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await ln({canTrack:e}),n=hn({canTrack:e});return{sessionId:t,visitorId:n}},yn=async({type:e,canTrack:t,apiKey:n,metadata:o,...i})=>({type:e,data:{...i,metadata:{url:location.href,...o},...await bn({canTrack:t}),userAttributes:de(),ownerId:n}});async function We(e){if(!e.apiKey){k.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!$()&&(x()||I==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await yn(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const xn=e=>We({...e,canTrack:!0});function ie(e){return Math.round(e*1e3)/1e3}const vn=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let o=n?e:e.parentElement;do{if(!o)return null;if(t(o))return o}while(o=o.parentElement);return null},Sn=e=>vn(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),re=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,i=e.clientY-n.top,r=ie(o/n.width),a=ie(i/n.height);return{x:r,y:a}},kn=e=>{const t=e.target,n=t&&Sn(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?re({event:e,target:t}):void 0,builderTargetOffset:n?re({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},Cn="0.11.
|
|
138
|
+
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const Te=Qt();function V(e,t=null,n="."){return Object.keys(e).reduce((o,i)=>{const r=e[i],a=[t,i].filter(Boolean).join(n);return[typeof r=="object",r!==null,!(Array.isArray(r)&&r.length===0)].every(Boolean)?{...o,...V(r,a,n)}:{...o,[a]:r}},{})}const Xt="v3",ne="builder.",Zt="options.",en=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},z=e=>{if(!e)return{};const t=Re(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(ne)){const i=o.replace(ne,"").replace(Zt,"");n[i]=t[o]}}),n},tn=()=>{if(!x())return{};const e=new URLSearchParams(window.location.search);return z(e)},Re=e=>e instanceof URLSearchParams?en(e):e,oe=e=>typeof e=="number"&&!isNaN(e)&&e>=0,q=e=>{let{noTraverse:t=!1}=e;const{limit:n=30,userAttributes:o,query:i,model:r,apiKey:a,includeRefs:c=!0,enrich:l,locale:u,apiVersion:h=Xt,fields:g,omit:m,offset:f,cacheSeconds:p,staleCacheSeconds:d,sort:b,includeUnpublished:S}=e;if(!a)throw new Error("Missing API key");if(!["v2","v3"].includes(h))throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${h}'`);(e.limit===void 0||e.limit>1)&&!("noTraverse"in e)&&(t=!0);const y=new URL(`https://cdn.builder.io/api/${h}/content/${r}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${c}${u?`&locale=${u}`:""}${l?`&enrich=${l}`:""}`);if(y.searchParams.set("omit",m||"meta.componentsUsed"),g&&y.searchParams.set("fields",g),Number.isFinite(f)&&f>-1&&y.searchParams.set("offset",String(Math.floor(f))),typeof S=="boolean"&&y.searchParams.set("includeUnpublished",String(S)),p&&oe(p)&&y.searchParams.set("cacheSeconds",String(p)),d&&oe(d)&&y.searchParams.set("staleCacheSeconds",String(d)),b){const C=V({sort:b});for(const T in C)y.searchParams.set(T,JSON.stringify(C[T]))}const P={...tn(),...Re(e.options||{})},E=V(P);for(const C in E)y.searchParams.set(C,String(E[C]));if(o&&y.searchParams.set("userAttributes",JSON.stringify(o)),i){const C=V({query:i});for(const T in C)y.searchParams.set(T,JSON.stringify(C[T]))}return y},nn=e=>"results"in e;async function L(e){const t=await G({...e,limit:1});return t&&t[0]||null}const on=L,rn=async e=>{const t=q(e);return await(await Te(t.href)).json()},Pe=async(e,t,n=q(e))=>{const o=W(e.canTrack);if(n.search.includes("preview=")){const r=[];for(const a of t.results){const c=Jt(n.searchParams);r.push(c||a)}t.results=r}if(!o||!(x()||I==="reactNative"))return t.results;try{const r=[];for(const a of t.results)r.push(await wt({item:a,canTrack:o}));t.results=r}catch(r){k.error("Could not process A/B tests. ",r)}return t.results};async function G(e){try{const t=q(e),n=await rn(e);return nn(n)?Pe(e,n):(k.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return k.error("Error fetching data. ",t),null}}const an=G;function sn(){return!x()||$()?!1:location.search.indexOf("builder.preview=")!==-1}function cn(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function Ae(){return cn().replace(/-/g,"")}const Be="builderSessionId",ln=async({canTrack:e})=>{if(!e)return;const t=await be({name:Be,canTrack:e});if(w(t))return t;{const n=dn();return un({id:n,canTrack:e}),n}},dn=()=>Ae(),un=({id:e,canTrack:t})=>ye({name:Be,value:e,canTrack:t}),Ve=()=>x()&&typeof localStorage<"u"?localStorage:void 0,mn=({key:e,canTrack:t})=>{var n;try{return t?(n=Ve())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},fn=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=Ve())==null||o.setItem(e,n))}catch(i){console.debug("[LocalStorage] SET error: ",i)}},je="builderVisitorId",hn=({canTrack:e})=>{if(!e)return;const t=mn({key:je,canTrack:e});if(w(t))return t;{const n=pn();return gn({id:n,canTrack:e}),n}},pn=()=>Ae(),gn=({id:e,canTrack:t})=>fn({key:je,value:e,canTrack:t}),bn=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await ln({canTrack:e}),n=hn({canTrack:e});return{sessionId:t,visitorId:n}},yn=async({type:e,canTrack:t,apiKey:n,metadata:o,...i})=>({type:e,data:{...i,metadata:{url:location.href,...o},...await bn({canTrack:t}),userAttributes:de(),ownerId:n}});async function We(e){if(!e.apiKey){k.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!$()&&(x()||I==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await yn(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const xn=e=>We({...e,canTrack:!0});function ie(e){return Math.round(e*1e3)/1e3}const vn=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let o=n?e:e.parentElement;do{if(!o)return null;if(t(o))return o}while(o=o.parentElement);return null},Sn=e=>vn(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),re=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,i=e.clientY-n.top,r=ie(o/n.width),a=ie(i/n.height);return{x:r,y:a}},kn=e=>{const t=e.target,n=t&&Sn(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?re({event:e,target:t}):void 0,builderTargetOffset:n?re({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},Cn="0.11.4",ae={};function $e(e,t){let n=ae[e];if(n||(n=ae[e]=[]),n.push(t),x()){const o={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(o,"*"),parent!==window&&window.postMessage(o,"*")}catch(i){console.debug("Could not postmessage",i)}}}const wn=()=>{$e("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let se=!1;const In=(e={})=>{var t,n;se||(se=!0,x()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:I,version:Cn,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",({data:o})=>{var i,r;if(o!=null&&o.type)switch(o.type){case"builder.evaluate":{const a=o.data.text,c=o.data.arguments||[],l=o.data.id,u=new Function(a);let h,g=null;try{h=u.apply(null,c)}catch(m){g=m}g?(i=window.parent)==null||i.postMessage({type:"builder.evaluateError",data:{id:l,error:g.message}},"*"):h&&typeof h.then=="function"?h.then(m=>{var f;(f=window.parent)==null||f.postMessage({type:"builder.evaluateResult",data:{id:l,result:m}},"*")}).catch(console.error):(r=window.parent)==null||r.postMessage({type:"builder.evaluateResult",data:{result:h,id:l}},"*");break}}})))},En=e=>{var r;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],o=e.fileUrl??((r=e==null?void 0:e.files)==null?void 0:r.regular);let i="";if(o&&t&&n&&(i+=`
|
|
139
139
|
@font-face {
|
|
140
140
|
font-family: "${t}";
|
|
141
141
|
src: local("${n}"), url('${o}') format('woff2');
|
|
@@ -165,4 +165,4 @@ ${Tn({customFonts:e.customFonts})}
|
|
|
165
165
|
text-align: inherit;
|
|
166
166
|
font-family: inherit;
|
|
167
167
|
}
|
|
168
|
-
`.trim();return s.jsx(O,{styles:t})}const An=({content:e,data:t,locale:n})=>{var r,a,c;const o={},i=((r=e==null?void 0:e.data)==null?void 0:r.state)||{};return(c=(a=e==null?void 0:e.data)==null?void 0:a.inputs)==null||c.forEach(l=>{l.name&&l.defaultValue!==void 0&&(o[l.name]=l.defaultValue)}),{...o,...i,...t,...n?{locale:n}:{}}},Bn=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function ce(e){var i,r,a,c,l,u,h,g,m;const t=qt({variationId:(i=e.content)==null?void 0:i.testVariationId,contentId:(r=e.content)==null?void 0:r.id}),n=[...ee(),...te,...e.customComponents||[]].reduce((f,{component:p,...d})=>({...f,[d.name]:{component:p,...D(d)}}),{}),o={content:Bn({content:e.content,data:e.data}),localState:void 0,rootState:An({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...ee(),...te,...e.customComponents||[]].reduce((f,{component:p,...d})=>({...f,[d.name]:D(d)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}};return s.jsxs(v.EnableEditor,{content:e.content,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,showContent:e.showContent,builderContextSignal:o,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,children:[e.isSsrAbTest?s.jsx(s.Fragment,{children:s.jsx(K,{scriptStr:t})}):null,s.jsx(s.Fragment,{children:s.jsx(Pn,{contentId:(a=o.content)==null?void 0:a.id,cssCode:(l=(c=o.content)==null?void 0:c.data)==null?void 0:l.cssCode,customFonts:(h=(u=o.content)==null?void 0:u.data)==null?void 0:h.customFonts})}),s.jsx(_,{blocks:(m=(g=o.content)==null?void 0:g.data)==null?void 0:m.blocks,context:o,registeredComponents:n})]})}function J(e){var r,a;const t=Dt({canTrack:W(e.canTrack),content:e.content}),n=function(){var l;return zt(B(e.content).map(u=>({id:u.testVariationId,testRatio:u.testRatio})),((l=e.content)==null?void 0:l.id)||"")},o=function(){return B(e.content).map(l=>`.variant-${l.testVariationId} { display: none; } `).join("")},i=function(){var l;return t?{...e.content,testVariationId:(l=e.content)==null?void 0:l.id}:Ct({item:e.content,canTrack:W(e.canTrack)})};return s.jsxs(s.Fragment,{children:[!e.__isNestedRender&&I!=="reactNative"?s.jsx(s.Fragment,{children:s.jsx(K,{scriptStr:Ht()})}):null,t?s.jsxs(s.Fragment,{children:[s.jsx(O,{id:`variants-styles-${(r=e.content)==null?void 0:r.id}`,styles:o()}),s.jsx(K,{scriptStr:n()}),(a=B(e.content))==null?void 0:a.map(c=>s.jsx(ce,{content:c,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps},c.testVariationId))]}):null,s.jsx(ce,{content:i(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps})]})}const Vn=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return L({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{k.error("Could not fetch symbol content: ",n)})};async function Fe(e){var o,i,r,a;const t=function(){var l,u;return[e.attributes.className,"builder-symbol",(l=e.symbol)!=null&&l.inline?"builder-inline-symbol":void 0,(u=e.symbol)!=null&&u.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},n=((o=e.symbol)==null?void 0:o.content)||await Vn({symbol:e.symbol,builderContextValue:e.builderContext});return s.jsx("div",{...e.attributes,className:t(),children:s.jsx(J,{__isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:e.builderContext.context,customComponents:Object.values(e.builderComponents),data:{...(i=e.symbol)==null?void 0:i.data,...e.builderContext.localState,...(r=n==null?void 0:n.data)==null?void 0:r.state},model:(a=e.symbol)==null?void 0:a.model,content:n})})}const jn=_,Wn=J,le={};function $n(e){if(x()){Object.assign(le,e);const t={type:"builder.settingsChange",data:le};parent.postMessage(t,"*")}}const Fn=async e=>{var o,i,r;const t=e.path||((o=e.url)==null?void 0:o.pathname)||((i=e.userAttributes)==null?void 0:i.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:z(e.searchParams||((r=e.url)==null?void 0:r.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await L(n)}};exports.Blocks=_;exports.Columns=pe;exports.ContentVariants=J;exports.RenderBlocks=jn;exports.RenderContent=Wn;exports.Symbol=Fe;exports.Text=ke;exports._processContentResult=Pe;exports._track=We;exports.createRegisterComponentMessage=Nt;exports.evaluate=F;exports.fastClone=R;exports.fetch=Te;exports.fetchBuilderProps=Fn;exports.fetchEntries=G;exports.fetchOneEntry=L;exports.getAllContent=an;exports.getBlockActions=rt;exports.getBlockProperties=he;exports.getBuilderSearchParams=z;exports.getContent=on;exports.getDefaultCanTrack=W;exports.getInteractionPropertiesForEvent=kn;exports.getSrcSet=ft;exports.init=Ee;exports.isBrowser=x;exports.isEditing=$;exports.isJsScript=At;exports.isPreviewing=sn;exports.logger=k;exports.register=$e;exports.registerInsertMenu=wn;exports.setEditorSettings=$n;exports.setupBrowserForEditing=In;exports.track=xn;
|
|
168
|
+
`.trim();return s.jsx(O,{styles:t})}const An=({content:e,data:t,locale:n})=>{var r,a,c;const o={},i=((r=e==null?void 0:e.data)==null?void 0:r.state)||{};return(c=(a=e==null?void 0:e.data)==null?void 0:a.inputs)==null||c.forEach(l=>{l.name&&l.defaultValue!==void 0&&(o[l.name]=l.defaultValue)}),{...o,...i,...t,...n?{locale:n}:{}}},Bn=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function ce(e){var i,r,a,c,l,u,h,g,m;const t=qt({variationId:(i=e.content)==null?void 0:i.testVariationId,contentId:(r=e.content)==null?void 0:r.id}),n=[...ee(),...te,...e.customComponents||[]].reduce((f,{component:p,...d})=>({...f,[d.name]:{component:p,...D(d)}}),{}),o={content:Bn({content:e.content,data:e.data}),localState:void 0,rootState:An({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...ee(),...te,...e.customComponents||[]].reduce((f,{component:p,...d})=>({...f,[d.name]:D(d)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}};return s.jsxs(v.EnableEditor,{content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,showContent:e.showContent,builderContextSignal:o,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,children:[e.isSsrAbTest?s.jsx(s.Fragment,{children:s.jsx(K,{scriptStr:t})}):null,s.jsx(s.Fragment,{children:s.jsx(Pn,{contentId:(a=o.content)==null?void 0:a.id,cssCode:(l=(c=o.content)==null?void 0:c.data)==null?void 0:l.cssCode,customFonts:(h=(u=o.content)==null?void 0:u.data)==null?void 0:h.customFonts})}),s.jsx(_,{blocks:(m=(g=o.content)==null?void 0:g.data)==null?void 0:m.blocks,context:o,registeredComponents:n})]})}function J(e){var r,a;const t=Dt({canTrack:W(e.canTrack),content:e.content}),n=function(){var l;return zt(B(e.content).map(u=>({id:u.testVariationId,testRatio:u.testRatio})),((l=e.content)==null?void 0:l.id)||"")},o=function(){return B(e.content).map(l=>`.variant-${l.testVariationId} { display: none; } `).join("")},i=function(){var l;return t?{...e.content,testVariationId:(l=e.content)==null?void 0:l.id}:Ct({item:e.content,canTrack:W(e.canTrack)})};return s.jsxs(s.Fragment,{children:[!e.__isNestedRender&&I!=="reactNative"?s.jsx(s.Fragment,{children:s.jsx(K,{scriptStr:Ht()})}):null,t?s.jsxs(s.Fragment,{children:[s.jsx(O,{id:`variants-styles-${(r=e.content)==null?void 0:r.id}`,styles:o()}),s.jsx(K,{scriptStr:n()}),(a=B(e.content))==null?void 0:a.map(c=>s.jsx(ce,{content:c,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps},c.testVariationId))]}):null,s.jsx(ce,{content:i(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps})]})}const Vn=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return L({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{k.error("Could not fetch symbol content: ",n)})};async function Fe(e){var o,i,r,a;const t=function(){var l,u;return[e.attributes.className,"builder-symbol",(l=e.symbol)!=null&&l.inline?"builder-inline-symbol":void 0,(u=e.symbol)!=null&&u.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},n=((o=e.symbol)==null?void 0:o.content)||await Vn({symbol:e.symbol,builderContextValue:e.builderContext});return s.jsx("div",{...e.attributes,className:t(),children:s.jsx(J,{__isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:e.builderContext.context,customComponents:Object.values(e.builderComponents),data:{...(i=e.symbol)==null?void 0:i.data,...e.builderContext.localState,...(r=n==null?void 0:n.data)==null?void 0:r.state},model:(a=e.symbol)==null?void 0:a.model,content:n})})}const jn=_,Wn=J,le={};function $n(e){if(x()){Object.assign(le,e);const t={type:"builder.settingsChange",data:le};parent.postMessage(t,"*")}}const Fn=async e=>{var o,i,r;const t=e.path||((o=e.url)==null?void 0:o.pathname)||((i=e.userAttributes)==null?void 0:i.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:z(e.searchParams||((r=e.url)==null?void 0:r.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await L(n)}};exports.Blocks=_;exports.Columns=pe;exports.ContentVariants=J;exports.RenderBlocks=jn;exports.RenderContent=Wn;exports.Symbol=Fe;exports.Text=ke;exports._processContentResult=Pe;exports._track=We;exports.createRegisterComponentMessage=Nt;exports.evaluate=F;exports.fastClone=R;exports.fetch=Te;exports.fetchBuilderProps=Fn;exports.fetchEntries=G;exports.fetchOneEntry=L;exports.getAllContent=an;exports.getBlockActions=rt;exports.getBlockProperties=he;exports.getBuilderSearchParams=z;exports.getContent=on;exports.getDefaultCanTrack=W;exports.getInteractionPropertiesForEvent=kn;exports.getSrcSet=ft;exports.init=Ee;exports.isBrowser=x;exports.isEditing=$;exports.isJsScript=At;exports.isPreviewing=sn;exports.logger=k;exports.register=$e;exports.registerInsertMenu=wn;exports.setEditorSettings=$n;exports.setupBrowserForEditing=In;exports.track=xn;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LRUCache as Ae } from "lru-cache";
|
|
2
2
|
import { jsx as l, Fragment as y, jsxs as I } from "react/jsx-runtime";
|
|
3
3
|
import { createElement as Ve } from "react";
|
|
4
|
-
import { I as Be, B as G, a as We, b as $e, C as Oe, E as Fe, F as Ne, c as _e, d as Le, S as Ue, V as Me, e as De } from "./USE_CLIENT_BUNDLE-
|
|
4
|
+
import { I as Be, B as G, a as We, b as $e, C as Oe, E as Fe, F as Ne, c as _e, d as Le, S as Ue, V as Me, e as De } from "./USE_CLIENT_BUNDLE-7df7e7c0.js";
|
|
5
5
|
import "next/navigation";
|
|
6
6
|
function je(e) {
|
|
7
7
|
var t;
|
|
@@ -20,18 +20,18 @@ const A = "[Builder.io]: ", k = {
|
|
|
20
20
|
warn: (...e) => console.warn(A, ...e),
|
|
21
21
|
debug: (...e) => console.debug(A, ...e)
|
|
22
22
|
};
|
|
23
|
-
function
|
|
23
|
+
function S() {
|
|
24
24
|
return typeof window < "u" && typeof document < "u";
|
|
25
25
|
}
|
|
26
26
|
const T = "rsc";
|
|
27
27
|
function Ke() {
|
|
28
|
-
return
|
|
28
|
+
return S() && window.self !== window.top;
|
|
29
29
|
}
|
|
30
30
|
function D() {
|
|
31
31
|
return Ke() && window.location.search.indexOf("builder.frameEditing=") !== -1;
|
|
32
32
|
}
|
|
33
33
|
const He = () => {
|
|
34
|
-
if (
|
|
34
|
+
if (S()) {
|
|
35
35
|
const e = new URL(location.href);
|
|
36
36
|
return e.pathname === "" && (e.pathname = "/"), e;
|
|
37
37
|
} else
|
|
@@ -76,8 +76,8 @@ const He = () => {
|
|
|
76
76
|
event: n
|
|
77
77
|
}), Ge = () => ({
|
|
78
78
|
isEditing: D(),
|
|
79
|
-
isBrowser:
|
|
80
|
-
isServer: !
|
|
79
|
+
isBrowser: S(),
|
|
80
|
+
isServer: !S(),
|
|
81
81
|
getUserAttributes: () => le()
|
|
82
82
|
}), Ye = (e, {
|
|
83
83
|
isExpression: t = !0
|
|
@@ -110,7 +110,7 @@ function Je(e, t, n) {
|
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
-
const Qe = (e) => (
|
|
113
|
+
const Qe = (e) => (S(), Y(e));
|
|
114
114
|
function j({
|
|
115
115
|
code: e,
|
|
116
116
|
context: t,
|
|
@@ -534,7 +534,7 @@ function F(e) {
|
|
|
534
534
|
var p;
|
|
535
535
|
return !((p = t()) != null && p.component) && !n() ? o().children ?? [] : [];
|
|
536
536
|
}, s = function() {
|
|
537
|
-
var f, p, d, b,
|
|
537
|
+
var f, p, d, b, x;
|
|
538
538
|
return {
|
|
539
539
|
blockChildren: o().children ?? [],
|
|
540
540
|
componentRef: (f = t()) == null ? void 0 : f.component,
|
|
@@ -549,7 +549,7 @@ function F(e) {
|
|
|
549
549
|
registeredComponents: e.registeredComponents,
|
|
550
550
|
builderBlock: o(),
|
|
551
551
|
includeBlockProps: ((b = t()) == null ? void 0 : b.noWrap) === !0,
|
|
552
|
-
isInteractive: !((
|
|
552
|
+
isInteractive: !((x = t()) != null && x.isRSC)
|
|
553
553
|
};
|
|
554
554
|
}, c = e.context;
|
|
555
555
|
return /* @__PURE__ */ l(y, { children: r() ? /* @__PURE__ */ I(y, { children: [
|
|
@@ -671,13 +671,13 @@ function pt(e) {
|
|
|
671
671
|
})
|
|
672
672
|
};
|
|
673
673
|
}, h = function(d) {
|
|
674
|
-
const b = d === 0 ? 0 : t,
|
|
674
|
+
const b = d === 0 ? 0 : t, x = r(d), v = `${b}px`, P = "100%", E = 0;
|
|
675
675
|
return {
|
|
676
|
-
width:
|
|
676
|
+
width: x,
|
|
677
677
|
["marginLeft"]: v,
|
|
678
678
|
"--column-width-mobile": s({
|
|
679
679
|
stackedStyle: P,
|
|
680
|
-
desktopStyle:
|
|
680
|
+
desktopStyle: x
|
|
681
681
|
}),
|
|
682
682
|
"--column-margin-left-mobile": s({
|
|
683
683
|
stackedStyle: E,
|
|
@@ -685,7 +685,7 @@ function pt(e) {
|
|
|
685
685
|
}),
|
|
686
686
|
"--column-width-tablet": a({
|
|
687
687
|
stackedStyle: P,
|
|
688
|
-
desktopStyle:
|
|
688
|
+
desktopStyle: x
|
|
689
689
|
}),
|
|
690
690
|
"--column-margin-left-tablet": a({
|
|
691
691
|
stackedStyle: E,
|
|
@@ -693,9 +693,9 @@ function pt(e) {
|
|
|
693
693
|
})
|
|
694
694
|
};
|
|
695
695
|
}, g = function(d) {
|
|
696
|
-
var
|
|
696
|
+
var x, v;
|
|
697
697
|
return ue(
|
|
698
|
-
((v = (
|
|
698
|
+
((v = (x = e.builderContext.content) == null ? void 0 : x.meta) == null ? void 0 : v.breakpoints) || {}
|
|
699
699
|
)[d].max;
|
|
700
700
|
}, m = function() {
|
|
701
701
|
return `
|
|
@@ -812,12 +812,12 @@ const yt = (e) => {
|
|
|
812
812
|
k.warn("[COOKIE] GET error: ", (o == null ? void 0 : o.message) || o);
|
|
813
813
|
return;
|
|
814
814
|
}
|
|
815
|
-
}, he = async (e) => fe(e), vt = (e) => e.map(([t, n]) => n ? `${t}=${n}` : t).filter(w).join("; "),
|
|
815
|
+
}, he = async (e) => fe(e), vt = (e) => e.map(([t, n]) => n ? `${t}=${n}` : t).filter(w).join("; "), St = [["secure", ""], ["SameSite", "None"]], xt = ({
|
|
816
816
|
name: e,
|
|
817
817
|
value: t,
|
|
818
818
|
expires: n
|
|
819
819
|
}) => {
|
|
820
|
-
const i = (
|
|
820
|
+
const i = (S() ? location.protocol === "https:" : !0) ? St : [[]], r = n ? [["expires", n.toUTCString()]] : [[]], a = [[e, t], ...r, ["path", "/"], ["domain", yt(window.location.hostname)], ...i];
|
|
821
821
|
return vt(a);
|
|
822
822
|
}, pe = async ({
|
|
823
823
|
name: e,
|
|
@@ -828,7 +828,7 @@ const yt = (e) => {
|
|
|
828
828
|
try {
|
|
829
829
|
if (!o)
|
|
830
830
|
return;
|
|
831
|
-
const i =
|
|
831
|
+
const i = xt({
|
|
832
832
|
name: e,
|
|
833
833
|
value: t,
|
|
834
834
|
expires: n
|
|
@@ -1655,24 +1655,24 @@ const Mt = {
|
|
|
1655
1655
|
thisScriptEl?.remove();
|
|
1656
1656
|
}
|
|
1657
1657
|
return;
|
|
1658
|
-
}`, ve = "builderIoAbTest",
|
|
1658
|
+
}`, ve = "builderIoAbTest", Se = "builderIoRenderContent", V = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
|
|
1659
1659
|
...t,
|
|
1660
1660
|
testVariationId: t.id,
|
|
1661
1661
|
id: e == null ? void 0 : e.id
|
|
1662
1662
|
})), zt = ({
|
|
1663
1663
|
canTrack: e,
|
|
1664
1664
|
content: t
|
|
1665
|
-
}) => !(!(V(t).length > 0) || !e ||
|
|
1665
|
+
}) => !(!(V(t).length > 0) || !e || S()), qt = (e) => e === "react" || e === "reactNative", xe = qt(T), Gt = () => `
|
|
1666
1666
|
window.${ve} = ${Kt}
|
|
1667
|
-
window.${
|
|
1667
|
+
window.${Se} = ${Ht}
|
|
1668
1668
|
`, Yt = (e, t) => `
|
|
1669
1669
|
window.${ve}(
|
|
1670
|
-
"${t}",${JSON.stringify(e)}, ${
|
|
1670
|
+
"${t}",${JSON.stringify(e)}, ${xe}
|
|
1671
1671
|
)`, Jt = ({
|
|
1672
1672
|
contentId: e,
|
|
1673
1673
|
variationId: t
|
|
1674
|
-
}) => `window.${
|
|
1675
|
-
"${t}", "${e}", ${
|
|
1674
|
+
}) => `window.${Se}(
|
|
1675
|
+
"${t}", "${e}", ${xe}
|
|
1676
1676
|
)`;
|
|
1677
1677
|
function M(e) {
|
|
1678
1678
|
return /* @__PURE__ */ l(
|
|
@@ -1738,7 +1738,7 @@ const on = "v3", te = "builder.", rn = "options.", an = (e) => {
|
|
|
1738
1738
|
}
|
|
1739
1739
|
}), n;
|
|
1740
1740
|
}, sn = () => {
|
|
1741
|
-
if (!
|
|
1741
|
+
if (!S())
|
|
1742
1742
|
return {};
|
|
1743
1743
|
const e = new URLSearchParams(window.location.search);
|
|
1744
1744
|
return ke(e);
|
|
@@ -1762,7 +1762,7 @@ const on = "v3", te = "builder.", rn = "options.", an = (e) => {
|
|
|
1762
1762
|
cacheSeconds: p,
|
|
1763
1763
|
staleCacheSeconds: d,
|
|
1764
1764
|
sort: b,
|
|
1765
|
-
includeUnpublished:
|
|
1765
|
+
includeUnpublished: x
|
|
1766
1766
|
} = e;
|
|
1767
1767
|
if (!a)
|
|
1768
1768
|
throw new Error("Missing API key");
|
|
@@ -1770,7 +1770,7 @@ const on = "v3", te = "builder.", rn = "options.", an = (e) => {
|
|
|
1770
1770
|
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${h}'`);
|
|
1771
1771
|
(e.limit === void 0 || e.limit > 1) && !("noTraverse" in e) && (t = !0);
|
|
1772
1772
|
const v = new URL(`https://cdn.builder.io/api/${h}/content/${r}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${s}${u ? `&locale=${u}` : ""}${c ? `&enrich=${c}` : ""}`);
|
|
1773
|
-
if (v.searchParams.set("omit", m || "meta.componentsUsed"), g && v.searchParams.set("fields", g), Number.isFinite(f) && f > -1 && v.searchParams.set("offset", String(Math.floor(f))), typeof
|
|
1773
|
+
if (v.searchParams.set("omit", m || "meta.componentsUsed"), g && v.searchParams.set("fields", g), Number.isFinite(f) && f > -1 && v.searchParams.set("offset", String(Math.floor(f))), typeof x == "boolean" && v.searchParams.set("includeUnpublished", String(x)), p && ne(p) && v.searchParams.set("cacheSeconds", String(p)), d && ne(d) && v.searchParams.set("staleCacheSeconds", String(d)), b) {
|
|
1774
1774
|
const C = B({
|
|
1775
1775
|
sort: b
|
|
1776
1776
|
});
|
|
@@ -1812,7 +1812,7 @@ const Kn = q, ln = async (e) => {
|
|
|
1812
1812
|
}
|
|
1813
1813
|
t.results = r;
|
|
1814
1814
|
}
|
|
1815
|
-
if (!o || !(
|
|
1815
|
+
if (!o || !(S() || T === "reactNative"))
|
|
1816
1816
|
return t.results;
|
|
1817
1817
|
try {
|
|
1818
1818
|
const r = [];
|
|
@@ -1841,7 +1841,7 @@ async function we(e) {
|
|
|
1841
1841
|
}
|
|
1842
1842
|
const Hn = we;
|
|
1843
1843
|
function zn() {
|
|
1844
|
-
return !
|
|
1844
|
+
return !S() || D() ? !1 : location.search.indexOf("builder.preview=") !== -1;
|
|
1845
1845
|
}
|
|
1846
1846
|
function un() {
|
|
1847
1847
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
@@ -1877,7 +1877,7 @@ const Te = "builderSessionId", mn = async ({
|
|
|
1877
1877
|
name: Te,
|
|
1878
1878
|
value: e,
|
|
1879
1879
|
canTrack: t
|
|
1880
|
-
}), Ee = () =>
|
|
1880
|
+
}), Ee = () => S() && typeof localStorage < "u" ? localStorage : void 0, pn = ({
|
|
1881
1881
|
key: e,
|
|
1882
1882
|
canTrack: t
|
|
1883
1883
|
}) => {
|
|
@@ -1924,7 +1924,7 @@ const Te = "builderSessionId", mn = async ({
|
|
|
1924
1924
|
key: Re,
|
|
1925
1925
|
value: e,
|
|
1926
1926
|
canTrack: t
|
|
1927
|
-
}),
|
|
1927
|
+
}), Sn = async ({
|
|
1928
1928
|
canTrack: e
|
|
1929
1929
|
}) => {
|
|
1930
1930
|
if (!e)
|
|
@@ -1941,7 +1941,7 @@ const Te = "builderSessionId", mn = async ({
|
|
|
1941
1941
|
sessionId: t,
|
|
1942
1942
|
visitorId: n
|
|
1943
1943
|
};
|
|
1944
|
-
},
|
|
1944
|
+
}, xn = async ({
|
|
1945
1945
|
type: e,
|
|
1946
1946
|
canTrack: t,
|
|
1947
1947
|
apiKey: n,
|
|
@@ -1955,7 +1955,7 @@ const Te = "builderSessionId", mn = async ({
|
|
|
1955
1955
|
url: location.href,
|
|
1956
1956
|
...o
|
|
1957
1957
|
},
|
|
1958
|
-
...await
|
|
1958
|
+
...await Sn({
|
|
1959
1959
|
canTrack: t
|
|
1960
1960
|
}),
|
|
1961
1961
|
userAttributes: le(),
|
|
@@ -1967,11 +1967,11 @@ async function kn(e) {
|
|
|
1967
1967
|
k.error("Missing API key for track call. Please provide your API key.");
|
|
1968
1968
|
return;
|
|
1969
1969
|
}
|
|
1970
|
-
if (e.canTrack && !D() && (
|
|
1970
|
+
if (e.canTrack && !D() && (S() || T === "reactNative"))
|
|
1971
1971
|
return fetch("https://cdn.builder.io/api/v1/track", {
|
|
1972
1972
|
method: "POST",
|
|
1973
1973
|
body: JSON.stringify({
|
|
1974
|
-
events: [await
|
|
1974
|
+
events: [await xn(e)]
|
|
1975
1975
|
}),
|
|
1976
1976
|
headers: {
|
|
1977
1977
|
"content-type": "application/json"
|
|
@@ -2027,10 +2027,10 @@ const Cn = (e, t, n = !0) => {
|
|
|
2027
2027
|
builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
|
|
2028
2028
|
}
|
|
2029
2029
|
};
|
|
2030
|
-
}, In = "0.11.
|
|
2030
|
+
}, In = "0.11.4", re = {};
|
|
2031
2031
|
function Tn(e, t) {
|
|
2032
2032
|
let n = re[e];
|
|
2033
|
-
if (n || (n = re[e] = []), n.push(t),
|
|
2033
|
+
if (n || (n = re[e] = []), n.push(t), S()) {
|
|
2034
2034
|
const o = {
|
|
2035
2035
|
type: "builder.register",
|
|
2036
2036
|
data: {
|
|
@@ -2071,7 +2071,7 @@ const Yn = () => {
|
|
|
2071
2071
|
let ae = !1;
|
|
2072
2072
|
const Jn = (e = {}) => {
|
|
2073
2073
|
var t, n;
|
|
2074
|
-
ae || (ae = !0,
|
|
2074
|
+
ae || (ae = !0, S() && ((t = window.parent) == null || t.postMessage({
|
|
2075
2075
|
type: "builder.sdkInfo",
|
|
2076
2076
|
data: {
|
|
2077
2077
|
target: T,
|
|
@@ -2279,6 +2279,7 @@ function se(e) {
|
|
|
2279
2279
|
De,
|
|
2280
2280
|
{
|
|
2281
2281
|
content: e.content,
|
|
2282
|
+
data: e.data,
|
|
2282
2283
|
model: e.model,
|
|
2283
2284
|
context: e.context,
|
|
2284
2285
|
apiKey: e.apiKey,
|
|
@@ -2450,7 +2451,7 @@ async function $n(e) {
|
|
|
2450
2451
|
}
|
|
2451
2452
|
const Qn = K, Xn = Pe, ce = {};
|
|
2452
2453
|
function Zn(e) {
|
|
2453
|
-
if (
|
|
2454
|
+
if (S()) {
|
|
2454
2455
|
Object.assign(ce, e);
|
|
2455
2456
|
const t = {
|
|
2456
2457
|
type: "builder.settingsChange",
|
|
@@ -2492,7 +2493,7 @@ export {
|
|
|
2492
2493
|
Un as a,
|
|
2493
2494
|
Mn as b,
|
|
2494
2495
|
Dn as c,
|
|
2495
|
-
|
|
2496
|
+
S as d,
|
|
2496
2497
|
L as e,
|
|
2497
2498
|
zn as f,
|
|
2498
2499
|
ut as g,
|
package/lib/browser/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bundle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bundle-0dffcadd.cjs"),t=require("./USE_CLIENT_BUNDLE-d5da4b24.cjs");require("lru-cache");require("react/jsx-runtime");require("react");require("next/navigation");require("./USE_SERVER_BUNDLE-8af2f5dc.cjs");exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.RenderBlocks=e.RenderBlocks;exports.RenderContent=e.RenderContent;exports.Symbol=e.Symbol;exports.Text=e.Text;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getAllContent=e.getAllContent;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.getContent=e.getContent;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.track=e.track;exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;
|
package/lib/browser/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { B as i, t as m, C as c, R as g, q as p, S as l, T as C, w as d, m as f, E as u, x as B, n as S, y as E, A as R, z as h, i as x, f as k, u as y, v as P, D as b } from "./bundle-
|
|
2
|
-
import { b as w, F as A, c as F, S as T, V } from "./USE_CLIENT_BUNDLE-
|
|
1
|
+
import { B as i, t as m, C as c, R as g, q as p, S as l, T as C, w as d, m as f, E as u, x as B, n as S, y as E, A as R, z as h, i as x, f as k, u as y, v as P, D as b } from "./bundle-a7aa61af.js";
|
|
2
|
+
import { b as w, F as A, c as F, S as T, V } from "./USE_CLIENT_BUNDLE-7df7e7c0.js";
|
|
3
3
|
import "lru-cache";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
6
|
import "next/navigation";
|
|
7
|
-
import "./USE_SERVER_BUNDLE-
|
|
7
|
+
import "./USE_SERVER_BUNDLE-f1f7aed0.js";
|
|
8
8
|
export {
|
|
9
9
|
i as Blocks,
|
|
10
10
|
w as Button,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),c=require("./bundle-274cf781.cjs"),r=require("react"),V=require("./USE_SERVER_BUNDLE-426439b2.cjs"),A=require("next/navigation");function D(e){return t.jsxs(t.Fragment,{children:[e.link?t.jsx(t.Fragment,{children:t.jsx("a",{...e.attributes,href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"button",children:e.text})}):t.jsx(t.Fragment,{children:t.jsx("button",{...e.attributes,style:e.attributes.style,className:e.attributes.className+" button-fdf49de0",children:e.text})}),t.jsx("style",{children:`.button-fdf49de0 {
|
|
2
|
+
all: unset;
|
|
3
|
+
}`})]})}function U(e){return t.jsxs(t.Fragment,{children:[" ",e.hasChildren?t.jsx(t.Fragment,{children:t.jsxs(e.Wrapper,{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:[" ",e.children," "]})}):t.jsx(t.Fragment,{children:t.jsx(e.Wrapper,{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0})})})," "]})}function H(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{},children:e.children})}function O(e){function o(){var s;return"builder-blocks"+((s=e.blocks)!=null&&s.length?"":" no-blocks")}function g(){var s,m;c.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((m=window.parent)==null||m.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var s,m;c.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((m=window.parent)==null||m.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:o()+" props-blocks-wrapper-4f2c12d8","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:s=>g(),onMouseEnter:s=>S(),onKeyPress:s=>g(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-4f2c12d8 {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
align-items: stretch;
|
|
7
|
+
}`})]})}function J(e){return t.jsx("span",{children:e.children})}function $(e){var s,m,x,v;function o(){var f;const d=e.image||e.src;if(!d||!(d.match(/builder\.io/)||d.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((f=e.image)!=null&&f.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),c.getSrcSet(d)}else if(e.image&&!e.srcset)return c.getSrcSet(d);return c.getSrcSet(d)}function g(){var b;return(b=o==null?void 0:o())!=null&&b.match(/builder\.io/)&&!e.noWebp?o().replace(/\?/g,"?format=webp&"):""}function S(){const b={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?b:void 0}return t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[g()?t.jsx(t.Fragment,{children:t.jsx("source",{type:"image/webp",srcSet:g()})}):null,t.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?"presentation":void 0,style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...S()},className:"builder-image"+(e.className?" "+e.className:"")+" img-40c70c9b",src:e.image,srcSet:o(),sizes:e.sizes})]}),e.aspectRatio&&!((m=(s=e.builderBlock)==null?void 0:s.children)!=null&&m.length&&e.fitContent)?t.jsx(t.Fragment,{children:t.jsx("div",{className:"builder-image-sizer div-40c70c9b",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(v=(x=e.builderBlock)==null?void 0:x.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&e.children?t.jsx(t.Fragment,{children:t.jsx("div",{className:"div-40c70c9b-2",children:e.children})}):null]}),t.jsx("style",{children:`.img-40c70c9b {
|
|
8
|
+
opacity: 1;
|
|
9
|
+
transition: opacity 0.2s ease-in-out;
|
|
10
|
+
}.div-40c70c9b {
|
|
11
|
+
width: 100%;
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
font-size: 0;
|
|
14
|
+
}.div-40c70c9b-2 {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
align-items: stretch;
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: 0;
|
|
20
|
+
left: 0;
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
}`})]})}function G(e){return t.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}function Q(e){const o=r.useRef(null),[g,S]=r.useState(()=>[]),[s,m]=r.useState(()=>[]);return r.useEffect(()=>{var v;if(!((v=o.current)!=null&&v.getElementsByTagName)||typeof window>"u")return;const x=o.current.getElementsByTagName("script");for(let b=0;b<x.length;b++){const d=x[b];if(d.src){if(g.includes(d.src))continue;g.push(d.src);const f=document.createElement("script");f.async=!0,f.src=d.src,document.head.appendChild(f)}else if(!d.type||["text/javascript","application/javascript","application/ecmascript"].includes(d.type)){if(s.includes(d.innerText))continue;try{s.push(d.innerText),new Function(d.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),t.jsx("div",{ref:o,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function X(e){const o=r.useRef(null),[g,S]=r.useState(()=>[]),[s,m]=r.useState(()=>[]),[x,v]=r.useState(()=>!1);function b(){if(!o.current||!o.current.getElementsByTagName)return;const d=o.current.getElementsByTagName("script");for(let f=0;f<d.length;f++){const k=d[f];if(k.src&&!g.includes(k.src)){g.push(k.src);const y=document.createElement("script");y.async=!0,y.src=k.src,document.head.appendChild(y)}else if(c.isJsScript(k)&&!s.includes(k.innerText))try{s.push(k.innerText),new Function(k.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return r.useEffect(()=>{o.current&&!x&&(v(!0),b())},[o.current,x]),t.jsx("div",{className:"builder-embed",ref:o,dangerouslySetInnerHTML:{__html:e.content}})}function Y(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},c.isEditing()&&e.imgSrc||"default-key")}function Z(e){var S,s,m,x,v,b,d;function o(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function g(){return{...o()}}return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("video",{className:"builder-video",...g(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(S=e.attributes)==null?void 0:S.style,objectFit:e.fit,objectPosition:e.position,zIndex:2,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},src:e.video||"no-src",poster:e.posterImage,children:e.lazyLoad?null:t.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((m=(s=e.builderBlock)==null?void 0:s.children)!=null&&m.length))?t.jsx(t.Fragment,{children:t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}})}):null,(v=(x=e.builderBlock)==null?void 0:x.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children:t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children})}):null,(d=(b=e.builderBlock)==null?void 0:b.children)!=null&&d.length&&!e.fitContent?t.jsx(t.Fragment,{children:t.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children})}):null]})}const p=r.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function ee(e){var I,P,B,F,T,N,L;const o=r.useRef(null),[g,S]=r.useState(()=>0);r.useState(()=>!0);function s(n){var a,l;const i={...e.builderContextSignal.rootState,...n};e.builderContextSignal.rootSetState?(l=(a=e.builderContextSignal).rootSetState)==null||l.call(a,i):e.builderContextSignal.rootState=i}function m(n){var a,l,u,h,W;const i={...e.builderContextSignal.content,...n,data:{...(a=e.builderContextSignal.content)==null?void 0:a.data,...n==null?void 0:n.data},meta:{...(l=e.builderContextSignal.content)==null?void 0:l.meta,...n==null?void 0:n.meta,breakpoints:((u=n==null?void 0:n.meta)==null?void 0:u.breakpoints)||((W=(h=e.builderContextSignal.content)==null?void 0:h.meta)==null?void 0:W.breakpoints)}};V.postPreviewContent({value:i,key:i.id}).then(()=>{M.refresh()})}r.useState(()=>0);const[x,v]=r.useState(()=>!1),[b,d]=r.useState(()=>e.contentWrapper||"div");function f(n){var a;const{data:i}=n;if(i)switch(i.type){case"builder.configureSdk":{const l=i.data,{breakpoints:u,contentId:h}=l;if(!h||h!==((a=e.builderContextSignal.content)==null?void 0:a.id))return;u&&m({meta:{breakpoints:u}}),S(g+1);break}case"builder.contentUpdate":{const l=i.data,u=l.key||l.alias||l.entry||l.modelName,h=l.data;u===e.model&&(m(h),S(g+1));break}}}function k(){var i,a;const n=(a=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:a.jsCode;n&&c.evaluate({code:n,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[y,te]=r.useState(()=>({})),[E,K]=r.useState(()=>!1);function q(n){var i,a;if(e.builderContextSignal.content){const l=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(a=e.builderContextSignal.content)==null?void 0:a.id;c._track({type:"click",canTrack:c.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:l!==u?l:void 0,...c.getInteractionPropertiesForEvent(n),unique:!E})}E||K(!0)}function _(n){return n.replace(/{{([^}]+)}}/g,(i,a)=>c.evaluate({code:a,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function z({url:n,key:i}){c.fetch(n).then(a=>a.json()).then(a=>{var u,h;const l={...e.builderContextSignal.rootState,[i]:a};(h=(u=e.builderContextSignal).rootSetState)==null||h.call(u,l),y[i]=!0}).catch(a=>{console.error("error fetching dynamic data",n,a)})}function j(){var i,a;const n=((a=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:a.httpRequests)??{};Object.entries(n).forEach(([l,u])=>{if(u&&(!y[l]||c.isEditing())){const h=_(u);z({url:h,key:l})}})}function C(){c.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:c.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function w(n){S(g+1),window.addEventListener("message",f),c.registerInsertMenu(),c.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.includeRefs?{includeRefs:e.includeRefs}:{},...e.enrich?{enrich:e.enrich}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(i=>{var l;const a=c.createRegisterComponentMessage(i);(l=window.parent)==null||l.postMessage(a,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",C)}function R(n){const i=new URL(location.href).searchParams,a=i.get("builder.preview"),l=i.get(`builder.preview.${a}`),u=i.get("apiKey")||i.get("builder.space");a===e.model&&u===e.apiKey&&(!e.content||l===e.content.id)&&c.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(h=>{h&&m(h)})}const M=A.useRouter();return r.useEffect(()=>{var n;return(n=o.current)==null||n.addEventListener("initeditingbldr",w),()=>{var i;return(i=o.current)==null?void 0:i.removeEventListener("initeditingbldr",w)}},[]),r.useEffect(()=>{var n;return(n=o.current)==null||n.addEventListener("initpreviewingbldr",R),()=>{var i;return(i=o.current)==null?void 0:i.removeEventListener("initpreviewingbldr",R)}},[]),r.useEffect(()=>{var n,i;if(c.isBrowser()){if(c.isEditing()&&o.current&&o.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&c.getDefaultCanTrack(e.canTrack)){const l=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,u=(i=e.builderContextSignal.content)==null?void 0:i.id,h=e.apiKey;c._track({type:"impression",canTrack:!0,contentId:u,apiKey:h,variationId:l!==u?l:void 0})}c.isPreviewing()&&o.current}},[]),r.useEffect(()=>{e.apiKey||c.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),k(),j(),C()},[]),r.useEffect(()=>{},[e.content]),r.useEffect(()=>{c.isBrowser()&&(window.removeEventListener("message",f),window.addEventListener("message",f))},[x]),r.useEffect(()=>{k()},[(P=(I=e.builderContextSignal.content)==null?void 0:I.data)==null?void 0:P.jsCode,e.builderContextSignal.rootState]),r.useEffect(()=>{j()},[(F=(B=e.builderContextSignal.content)==null?void 0:B.data)==null?void 0:F.httpRequests]),r.useEffect(()=>{C()},[e.builderContextSignal.rootState]),r.useEffect(()=>{e.data&&s(e.data)},[e.data]),r.useEffect(()=>{e.locale&&s({locale:e.locale})},[e.locale]),r.useEffect(()=>()=>{c.isBrowser()&&(window.removeEventListener("message",f),window.removeEventListener("builder:component:stateChangeListenerActivated",C))},[]),t.jsx(p.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(t.Fragment,{children:r.createElement(b,{key:g,ref:o,onClick:n=>q(n),"builder-content-id":(T=e.builderContextSignal.content)==null?void 0:T.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((N=e.content)==null?void 0:N.testVariationId)||((L=e.content)==null?void 0:L.id)}`},e.children)}):null})}exports.BlockWrapper=U;exports.BlocksWrapper=O;exports.Button=D;exports.CustomCode=Q;exports.Embed=X;exports.EnableEditor=ee;exports.FragmentComponent=J;exports.Image=$;exports.ImgComponent=Y;exports.InteractiveElement=H;exports.SectionComponent=G;exports.Video=Z;
|