@builder.io/sdk-react-nextjs 0.8.1 → 0.10.0

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 (50) hide show
  1. package/lib/browser/{USE_CLIENT_BUNDLE-0479ddc8.js → USE_CLIENT_BUNDLE-8a469a88.js} +195 -189
  2. package/lib/browser/USE_CLIENT_BUNDLE-bd42f34e.cjs +23 -0
  3. package/lib/{edge/USE_SERVER_BUNDLE-70f5e4b2.cjs → browser/USE_SERVER_BUNDLE-608eb1c6.cjs} +1 -1
  4. package/lib/{edge/USE_SERVER_BUNDLE-de23a873.js → browser/USE_SERVER_BUNDLE-b0fcc116.js} +1 -1
  5. package/lib/browser/{bundle-e4200429.cjs → bundle-6593f46a.cjs} +10 -10
  6. package/lib/browser/{bundle-179c65a2.js → bundle-f23172a5.js} +288 -268
  7. package/lib/browser/index.cjs +1 -1
  8. package/lib/browser/index.mjs +3 -3
  9. package/lib/edge/USE_CLIENT_BUNDLE-2ee2538b.cjs +23 -0
  10. package/lib/{node/USE_CLIENT_BUNDLE-ac10325c.js → edge/USE_CLIENT_BUNDLE-474e3242.js} +195 -189
  11. package/lib/{node/USE_SERVER_BUNDLE-de4b4ff0.cjs → edge/USE_SERVER_BUNDLE-b5ccb43b.cjs} +1 -1
  12. package/lib/{node/USE_SERVER_BUNDLE-2b7a9305.js → edge/USE_SERVER_BUNDLE-da7c49b1.js} +1 -1
  13. package/lib/edge/{bundle-a1501121.cjs → bundle-7c571d18.cjs} +30 -30
  14. package/lib/edge/{bundle-a958c31b.js → bundle-bd18331d.js} +1037 -1017
  15. package/lib/edge/index.cjs +1 -1
  16. package/lib/edge/index.mjs +3 -3
  17. package/lib/{edge/USE_CLIENT_BUNDLE-8c3da5c9.js → node/USE_CLIENT_BUNDLE-39759ac3.js} +195 -189
  18. package/lib/node/USE_CLIENT_BUNDLE-fcb61de5.cjs +23 -0
  19. package/lib/{browser/USE_SERVER_BUNDLE-71c86494.cjs → node/USE_SERVER_BUNDLE-9a538e9b.cjs} +1 -1
  20. package/lib/{browser/USE_SERVER_BUNDLE-88940a10.js → node/USE_SERVER_BUNDLE-9cade0d5.js} +1 -1
  21. package/lib/node/{bundle-59bd1206.js → bundle-49222e30.js} +188 -168
  22. package/lib/node/{bundle-ef482315.cjs → bundle-ad89090d.cjs} +9 -9
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +3 -3
  25. package/package.json +1 -1
  26. package/types/cjs/components/blocks/blocks-wrapper.d.ts +8 -0
  27. package/types/cjs/components/blocks/blocks.d.ts +1 -1
  28. package/types/cjs/components/content/components/enable-editor.d.ts +1 -1
  29. package/types/cjs/components/content-variants/content-variants.types.d.ts +16 -0
  30. package/types/cjs/constants/sdk-version.d.ts +1 -1
  31. package/types/cjs/context/types.d.ts +2 -1
  32. package/types/cjs/functions/get-content/index.d.ts +2 -2
  33. package/types/cjs/functions/transform-block-properties.d.ts +5 -1
  34. package/types/cjs/types/enforced-partials.d.ts +7 -2
  35. package/types/esm/components/blocks/blocks-wrapper.d.ts +8 -0
  36. package/types/esm/components/blocks/blocks.d.ts +1 -1
  37. package/types/esm/components/content/components/enable-editor.d.ts +1 -1
  38. package/types/esm/components/content-variants/content-variants.types.d.ts +16 -0
  39. package/types/esm/constants/sdk-version.d.ts +1 -1
  40. package/types/esm/context/types.d.ts +2 -1
  41. package/types/esm/functions/get-content/index.d.ts +2 -2
  42. package/types/esm/functions/transform-block-properties.d.ts +5 -1
  43. package/types/esm/types/enforced-partials.d.ts +7 -2
  44. package/lib/browser/USE_CLIENT_BUNDLE-38635250.cjs +0 -23
  45. package/lib/edge/USE_CLIENT_BUNDLE-7d1db7a7.cjs +0 -23
  46. package/lib/node/USE_CLIENT_BUNDLE-1fd9261f.cjs +0 -23
  47. package/types/cjs/functions/get-react-native-block-styles.d.ts +0 -7
  48. package/types/cjs/functions/sanitize-react-native-block-styles.d.ts +0 -3
  49. package/types/esm/functions/get-react-native-block-styles.d.ts +0 -7
  50. package/types/esm/functions/sanitize-react-native-block-styles.d.ts +0 -3
@@ -1,23 +0,0 @@
1
- "use client";"use strict";const t=require("react/jsx-runtime"),c=require("./bundle-e4200429.cjs"),l=require("react"),M=require("./USE_SERVER_BUNDLE-71c86494.cjs"),V=require("next/navigation");function W(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-5294b10c",children:e.text})}),t.jsx("style",{children:`.button-5294b10c {
2
- all: unset;
3
- }`})]})}function A(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 D(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:{...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 U(e){function a(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function g(){var o,h;c.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((h=window.parent)==null||h.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var o,h;c.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((h=window.parent)==null||h.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:a()+" div-02c7a115","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>g(),onMouseEnter:o=>S(),onKeyPress:o=>g(),children:e.children}),t.jsx("style",{children:`.div-02c7a115 {
4
- display: flex;
5
- flex-direction: column;
6
- align-items: stretch;
7
- }`})]})}function H(e){return t.jsx("span",{children:e.children})}function O(e){var o,h,v,b;function a(){var x;const s=e.image||e.src;if(!s||!(s.match(/builder\.io/)||s.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((x=e.image)!=null&&x.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),c.getSrcSet(s)}else if(e.image&&!e.srcset)return c.getSrcSet(s);return c.getSrcSet(s)}function g(){var m;return(m=a==null?void 0:a())!=null&&m.match(/builder\.io/)&&!e.noWebp?a().replace(/\?/g,"?format=webp&"):""}function S(){const m={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?m: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-dbab4030",src:e.image,srcSet:a(),sizes:e.sizes})]}),e.aspectRatio&&!((h=(o=e.builderBlock)==null?void 0:o.children)!=null&&h.length&&e.fitContent)?t.jsx(t.Fragment,{children:t.jsx("div",{className:"builder-image-sizer div-dbab4030",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(b=(v=e.builderBlock)==null?void 0:v.children)!=null&&b.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-dbab4030-2",children:e.children})}):null]}),t.jsx("style",{children:`.img-dbab4030 {
8
- opacity: 1;
9
- transition: opacity 0.2s ease-in-out;
10
- }.div-dbab4030 {
11
- width: 100%;
12
- pointer-events: none;
13
- font-size: 0;
14
- }.div-dbab4030-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 J(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 $(e){const a=l.useRef(null),[g,S]=l.useState(()=>[]),[o,h]=l.useState(()=>[]);return l.useEffect(()=>{var b;if(!((b=a.current)!=null&&b.getElementsByTagName)||typeof window>"u")return;const v=a.current.getElementsByTagName("script");for(let m=0;m<v.length;m++){const s=v[m];if(s.src){if(g.includes(s.src))continue;g.push(s.src);const x=document.createElement("script");x.async=!0,x.src=s.src,document.head.appendChild(x)}else if(!s.type||["text/javascript","application/javascript","application/ecmascript"].includes(s.type)){if(o.includes(s.innerText))continue;try{o.push(s.innerText),new Function(s.innerText)()}catch(x){console.warn("`CustomCode`: Error running script:",x)}}}},[]),t.jsx("div",{ref:a,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function G(e){const a=l.useRef(null),[g,S]=l.useState(()=>[]),[o,h]=l.useState(()=>[]),[v,b]=l.useState(()=>!1);function m(){if(!a.current||!a.current.getElementsByTagName)return;const s=a.current.getElementsByTagName("script");for(let x=0;x<s.length;x++){const y=s[x];if(y.src&&!g.includes(y.src)){g.push(y.src);const k=document.createElement("script");k.async=!0,k.src=y.src,document.head.appendChild(k)}else if(c.isJsScript(y)&&!o.includes(y.innerText))try{o.push(y.innerText),new Function(y.innerText)()}catch(k){console.warn("`Embed`: Error running script:",k)}}}return l.useEffect(()=>{a.current&&!v&&(b(!0),m())},[a.current,v]),t.jsx("div",{className:"builder-embed",ref:a,dangerouslySetInnerHTML:{__html:e.content}})}function Q(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 X(e){var S,o,h,v,b,m,s;function a(){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{...a()}}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&&((h=(o=e.builderBlock)==null?void 0:o.children)!=null&&h.length))?t.jsx(t.Fragment,{children:t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}})}):null,(b=(v=e.builderBlock)==null?void 0:v.children)!=null&&b.length&&e.fitContent?t.jsx(t.Fragment,{children:t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children})}):null,(s=(m=e.builderBlock)==null?void 0:m.children)!=null&&s.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 Y=l.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{}});function Z(e){var R,I,P,F,B,T,N;const a=l.useRef(null),[g,S]=l.useState(()=>0);function o(n){var r,d,u,f,L;const i={...e.builderContextSignal.content,...n,data:{...(r=e.builderContextSignal.content)==null?void 0:r.data,...n==null?void 0:n.data},meta:{...(d=e.builderContextSignal.content)==null?void 0:d.meta,...n==null?void 0:n.meta,breakpoints:((u=n==null?void 0:n.meta)==null?void 0:u.breakpoints)||((L=(f=e.builderContextSignal.content)==null?void 0:f.meta)==null?void 0:L.breakpoints)}};M.postPreviewContent({value:i,key:i.id}).then(()=>{z.refresh()})}l.useState(()=>0);const[h,v]=l.useState(()=>!1);function b(n){var r;const{data:i}=n;if(i)switch(i.type){case"builder.configureSdk":{const d=i.data,{breakpoints:u,contentId:f}=d;if(!f||f!==((r=e.builderContextSignal.content)==null?void 0:r.id))return;u&&o({meta:{breakpoints:u}}),S(g+1);break}case"builder.contentUpdate":{const d=i.data,u=d.key||d.alias||d.entry||d.modelName,f=d.data;u===e.model&&(o(f),S(g+1));break}}}function m(){var i,r;const n=(r=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:r.jsCode;n&&c.evaluate({code:n,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[s,x]=l.useState(()=>({})),[y,k]=l.useState(()=>!1);function K(n){var i,r;if(e.builderContextSignal.content){const d=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(r=e.builderContextSignal.content)==null?void 0:r.id;c._track({type:"click",canTrack:c.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:d!==u?d:void 0,...c.getInteractionPropertiesForEvent(n),unique:!y})}y||k(!0)}function q(n){return n.replace(/{{([^}]+)}}/g,(i,r)=>c.evaluate({code:r,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function _({url:n,key:i}){c.fetch(n).then(r=>r.json()).then(r=>{var u,f;const d={...e.builderContextSignal.rootState,[i]:r};(f=(u=e.builderContextSignal).rootSetState)==null||f.call(u,d),s[i]=!0}).catch(r=>{console.error("error fetching dynamic data",n,r)})}function C(){var i,r;const n=((r=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:r.httpRequests)??{};Object.entries(n).forEach(([d,u])=>{if(u&&(!s[d]||c.isEditing())){const f=q(u);_({url:f,key:d})}})}function E(){c.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:c.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function j(n){S(g+1),window.addEventListener("message",b),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 d;const r=c.createRegisterComponentMessage(i);(d=window.parent)==null||d.postMessage(r,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",E)}function w(n){const i=new URL(location.href).searchParams,r=i.get("builder.preview"),d=i.get(`builder.preview.${r}`),u=i.get("apiKey")||i.get("builder.space");r===e.model&&u===e.apiKey&&(!e.content||d===e.content.id)&&c.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(f=>{f&&o(f)})}const z=V.useRouter();return l.useEffect(()=>{var n;return(n=a.current)==null||n.addEventListener("initeditingbldr",j),()=>{var i;return(i=a.current)==null?void 0:i.removeEventListener("initeditingbldr",j)}},[]),l.useEffect(()=>{var n;return(n=a.current)==null||n.addEventListener("initpreviewingbldr",w),()=>{var i;return(i=a.current)==null?void 0:i.removeEventListener("initpreviewingbldr",w)}},[]),l.useEffect(()=>{var n,i;if(c.isBrowser()){if(c.isEditing()&&a.current&&a.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&c.getDefaultCanTrack(e.canTrack)){const d=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,u=(i=e.builderContextSignal.content)==null?void 0:i.id,f=e.apiKey;c._track({type:"impression",canTrack:!0,contentId:u,apiKey:f,variationId:d!==u?d:void 0})}c.isPreviewing()&&a.current}},[]),l.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."),m(),C(),E()},[]),l.useEffect(()=>{},[e.content]),l.useEffect(()=>{c.isBrowser()&&(window.removeEventListener("message",b),window.addEventListener("message",b))},[h]),l.useEffect(()=>{m()},[(I=(R=e.builderContextSignal.content)==null?void 0:R.data)==null?void 0:I.jsCode,e.builderContextSignal.rootState]),l.useEffect(()=>{C()},[(F=(P=e.builderContextSignal.content)==null?void 0:P.data)==null?void 0:F.httpRequests]),l.useEffect(()=>{E()},[e.builderContextSignal.rootState]),l.useEffect(()=>()=>{c.isBrowser()&&(window.removeEventListener("message",b),window.removeEventListener("builder:component:stateChangeListenerActivated",E))},[]),t.jsx(Y.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(t.Fragment,{children:l.createElement("div",{key:g,ref:a,onClick:n=>K(n),"builder-content-id":(B=e.builderContextSignal.content)==null?void 0:B.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},className:`variant-${((T=e.content)==null?void 0:T.testVariationId)||((N=e.content)==null?void 0:N.id)}`},e.children)}):null})}exports.BlockWrapper=A;exports.BlocksWrapper=U;exports.Button=W;exports.CustomCode=$;exports.Embed=G;exports.EnableEditor=Z;exports.FragmentComponent=H;exports.Image=O;exports.ImgComponent=Q;exports.InteractiveElement=D;exports.SectionComponent=J;exports.Video=X;
@@ -1,23 +0,0 @@
1
- "use client";"use strict";const t=require("react/jsx-runtime"),c=require("./bundle-a1501121.cjs"),l=require("react"),M=require("./USE_SERVER_BUNDLE-70f5e4b2.cjs"),V=require("next/navigation");function W(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-5294b10c",children:e.text})}),t.jsx("style",{children:`.button-5294b10c {
2
- all: unset;
3
- }`})]})}function A(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 D(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:{...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 U(e){function a(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function g(){var o,h;c.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((h=window.parent)==null||h.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var o,h;c.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((h=window.parent)==null||h.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:a()+" div-02c7a115","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>g(),onMouseEnter:o=>S(),onKeyPress:o=>g(),children:e.children}),t.jsx("style",{children:`.div-02c7a115 {
4
- display: flex;
5
- flex-direction: column;
6
- align-items: stretch;
7
- }`})]})}function H(e){return t.jsx("span",{children:e.children})}function O(e){var o,h,v,b;function a(){var x;const s=e.image||e.src;if(!s||!(s.match(/builder\.io/)||s.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((x=e.image)!=null&&x.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),c.getSrcSet(s)}else if(e.image&&!e.srcset)return c.getSrcSet(s);return c.getSrcSet(s)}function g(){var m;return(m=a==null?void 0:a())!=null&&m.match(/builder\.io/)&&!e.noWebp?a().replace(/\?/g,"?format=webp&"):""}function S(){const m={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?m: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-dbab4030",src:e.image,srcSet:a(),sizes:e.sizes})]}),e.aspectRatio&&!((h=(o=e.builderBlock)==null?void 0:o.children)!=null&&h.length&&e.fitContent)?t.jsx(t.Fragment,{children:t.jsx("div",{className:"builder-image-sizer div-dbab4030",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(b=(v=e.builderBlock)==null?void 0:v.children)!=null&&b.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-dbab4030-2",children:e.children})}):null]}),t.jsx("style",{children:`.img-dbab4030 {
8
- opacity: 1;
9
- transition: opacity 0.2s ease-in-out;
10
- }.div-dbab4030 {
11
- width: 100%;
12
- pointer-events: none;
13
- font-size: 0;
14
- }.div-dbab4030-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 J(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 $(e){const a=l.useRef(null),[g,S]=l.useState(()=>[]),[o,h]=l.useState(()=>[]);return l.useEffect(()=>{var b;if(!((b=a.current)!=null&&b.getElementsByTagName)||typeof window>"u")return;const v=a.current.getElementsByTagName("script");for(let m=0;m<v.length;m++){const s=v[m];if(s.src){if(g.includes(s.src))continue;g.push(s.src);const x=document.createElement("script");x.async=!0,x.src=s.src,document.head.appendChild(x)}else if(!s.type||["text/javascript","application/javascript","application/ecmascript"].includes(s.type)){if(o.includes(s.innerText))continue;try{o.push(s.innerText),new Function(s.innerText)()}catch(x){console.warn("`CustomCode`: Error running script:",x)}}}},[]),t.jsx("div",{ref:a,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function G(e){const a=l.useRef(null),[g,S]=l.useState(()=>[]),[o,h]=l.useState(()=>[]),[v,b]=l.useState(()=>!1);function m(){if(!a.current||!a.current.getElementsByTagName)return;const s=a.current.getElementsByTagName("script");for(let x=0;x<s.length;x++){const y=s[x];if(y.src&&!g.includes(y.src)){g.push(y.src);const k=document.createElement("script");k.async=!0,k.src=y.src,document.head.appendChild(k)}else if(c.isJsScript(y)&&!o.includes(y.innerText))try{o.push(y.innerText),new Function(y.innerText)()}catch(k){console.warn("`Embed`: Error running script:",k)}}}return l.useEffect(()=>{a.current&&!v&&(b(!0),m())},[a.current,v]),t.jsx("div",{className:"builder-embed",ref:a,dangerouslySetInnerHTML:{__html:e.content}})}function Q(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 X(e){var S,o,h,v,b,m,s;function a(){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{...a()}}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&&((h=(o=e.builderBlock)==null?void 0:o.children)!=null&&h.length))?t.jsx(t.Fragment,{children:t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}})}):null,(b=(v=e.builderBlock)==null?void 0:v.children)!=null&&b.length&&e.fitContent?t.jsx(t.Fragment,{children:t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children})}):null,(s=(m=e.builderBlock)==null?void 0:m.children)!=null&&s.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 Y=l.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{}});function Z(e){var R,I,P,F,B,T,N;const a=l.useRef(null),[g,S]=l.useState(()=>0);function o(n){var r,d,u,f,L;const i={...e.builderContextSignal.content,...n,data:{...(r=e.builderContextSignal.content)==null?void 0:r.data,...n==null?void 0:n.data},meta:{...(d=e.builderContextSignal.content)==null?void 0:d.meta,...n==null?void 0:n.meta,breakpoints:((u=n==null?void 0:n.meta)==null?void 0:u.breakpoints)||((L=(f=e.builderContextSignal.content)==null?void 0:f.meta)==null?void 0:L.breakpoints)}};M.postPreviewContent({value:i,key:i.id}).then(()=>{z.refresh()})}l.useState(()=>0);const[h,v]=l.useState(()=>!1);function b(n){var r;const{data:i}=n;if(i)switch(i.type){case"builder.configureSdk":{const d=i.data,{breakpoints:u,contentId:f}=d;if(!f||f!==((r=e.builderContextSignal.content)==null?void 0:r.id))return;u&&o({meta:{breakpoints:u}}),S(g+1);break}case"builder.contentUpdate":{const d=i.data,u=d.key||d.alias||d.entry||d.modelName,f=d.data;u===e.model&&(o(f),S(g+1));break}}}function m(){var i,r;const n=(r=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:r.jsCode;n&&c.evaluate({code:n,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[s,x]=l.useState(()=>({})),[y,k]=l.useState(()=>!1);function K(n){var i,r;if(e.builderContextSignal.content){const d=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(r=e.builderContextSignal.content)==null?void 0:r.id;c._track({type:"click",canTrack:c.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:d!==u?d:void 0,...c.getInteractionPropertiesForEvent(n),unique:!y})}y||k(!0)}function q(n){return n.replace(/{{([^}]+)}}/g,(i,r)=>c.evaluate({code:r,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function _({url:n,key:i}){c.fetch(n).then(r=>r.json()).then(r=>{var u,f;const d={...e.builderContextSignal.rootState,[i]:r};(f=(u=e.builderContextSignal).rootSetState)==null||f.call(u,d),s[i]=!0}).catch(r=>{console.error("error fetching dynamic data",n,r)})}function C(){var i,r;const n=((r=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:r.httpRequests)??{};Object.entries(n).forEach(([d,u])=>{if(u&&(!s[d]||c.isEditing())){const f=q(u);_({url:f,key:d})}})}function E(){c.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:c.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function j(n){S(g+1),window.addEventListener("message",b),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 d;const r=c.createRegisterComponentMessage(i);(d=window.parent)==null||d.postMessage(r,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",E)}function w(n){const i=new URL(location.href).searchParams,r=i.get("builder.preview"),d=i.get(`builder.preview.${r}`),u=i.get("apiKey")||i.get("builder.space");r===e.model&&u===e.apiKey&&(!e.content||d===e.content.id)&&c.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(f=>{f&&o(f)})}const z=V.useRouter();return l.useEffect(()=>{var n;return(n=a.current)==null||n.addEventListener("initeditingbldr",j),()=>{var i;return(i=a.current)==null?void 0:i.removeEventListener("initeditingbldr",j)}},[]),l.useEffect(()=>{var n;return(n=a.current)==null||n.addEventListener("initpreviewingbldr",w),()=>{var i;return(i=a.current)==null?void 0:i.removeEventListener("initpreviewingbldr",w)}},[]),l.useEffect(()=>{var n,i;if(c.isBrowser()){if(c.isEditing()&&a.current&&a.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&c.getDefaultCanTrack(e.canTrack)){const d=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,u=(i=e.builderContextSignal.content)==null?void 0:i.id,f=e.apiKey;c._track({type:"impression",canTrack:!0,contentId:u,apiKey:f,variationId:d!==u?d:void 0})}c.isPreviewing()&&a.current}},[]),l.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."),m(),C(),E()},[]),l.useEffect(()=>{},[e.content]),l.useEffect(()=>{c.isBrowser()&&(window.removeEventListener("message",b),window.addEventListener("message",b))},[h]),l.useEffect(()=>{m()},[(I=(R=e.builderContextSignal.content)==null?void 0:R.data)==null?void 0:I.jsCode,e.builderContextSignal.rootState]),l.useEffect(()=>{C()},[(F=(P=e.builderContextSignal.content)==null?void 0:P.data)==null?void 0:F.httpRequests]),l.useEffect(()=>{E()},[e.builderContextSignal.rootState]),l.useEffect(()=>()=>{c.isBrowser()&&(window.removeEventListener("message",b),window.removeEventListener("builder:component:stateChangeListenerActivated",E))},[]),t.jsx(Y.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(t.Fragment,{children:l.createElement("div",{key:g,ref:a,onClick:n=>K(n),"builder-content-id":(B=e.builderContextSignal.content)==null?void 0:B.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},className:`variant-${((T=e.content)==null?void 0:T.testVariationId)||((N=e.content)==null?void 0:N.id)}`},e.children)}):null})}exports.BlockWrapper=A;exports.BlocksWrapper=U;exports.Button=W;exports.CustomCode=$;exports.Embed=G;exports.EnableEditor=Z;exports.FragmentComponent=H;exports.Image=O;exports.ImgComponent=Q;exports.InteractiveElement=D;exports.SectionComponent=J;exports.Video=X;
@@ -1,23 +0,0 @@
1
- "use client";"use strict";const t=require("react/jsx-runtime"),c=require("./bundle-ef482315.cjs"),l=require("react"),M=require("./USE_SERVER_BUNDLE-de4b4ff0.cjs"),V=require("next/navigation");function W(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-5294b10c",children:e.text})}),t.jsx("style",{children:`.button-5294b10c {
2
- all: unset;
3
- }`})]})}function A(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 D(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:{...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 U(e){function a(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function g(){var o,h;c.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((h=window.parent)==null||h.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var o,h;c.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((h=window.parent)==null||h.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:a()+" div-02c7a115","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>g(),onMouseEnter:o=>S(),onKeyPress:o=>g(),children:e.children}),t.jsx("style",{children:`.div-02c7a115 {
4
- display: flex;
5
- flex-direction: column;
6
- align-items: stretch;
7
- }`})]})}function H(e){return t.jsx("span",{children:e.children})}function O(e){var o,h,v,b;function a(){var x;const s=e.image||e.src;if(!s||!(s.match(/builder\.io/)||s.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((x=e.image)!=null&&x.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),c.getSrcSet(s)}else if(e.image&&!e.srcset)return c.getSrcSet(s);return c.getSrcSet(s)}function g(){var m;return(m=a==null?void 0:a())!=null&&m.match(/builder\.io/)&&!e.noWebp?a().replace(/\?/g,"?format=webp&"):""}function S(){const m={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?m: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-dbab4030",src:e.image,srcSet:a(),sizes:e.sizes})]}),e.aspectRatio&&!((h=(o=e.builderBlock)==null?void 0:o.children)!=null&&h.length&&e.fitContent)?t.jsx(t.Fragment,{children:t.jsx("div",{className:"builder-image-sizer div-dbab4030",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(b=(v=e.builderBlock)==null?void 0:v.children)!=null&&b.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-dbab4030-2",children:e.children})}):null]}),t.jsx("style",{children:`.img-dbab4030 {
8
- opacity: 1;
9
- transition: opacity 0.2s ease-in-out;
10
- }.div-dbab4030 {
11
- width: 100%;
12
- pointer-events: none;
13
- font-size: 0;
14
- }.div-dbab4030-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 J(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 $(e){const a=l.useRef(null),[g,S]=l.useState(()=>[]),[o,h]=l.useState(()=>[]);return l.useEffect(()=>{var b;if(!((b=a.current)!=null&&b.getElementsByTagName)||typeof window>"u")return;const v=a.current.getElementsByTagName("script");for(let m=0;m<v.length;m++){const s=v[m];if(s.src){if(g.includes(s.src))continue;g.push(s.src);const x=document.createElement("script");x.async=!0,x.src=s.src,document.head.appendChild(x)}else if(!s.type||["text/javascript","application/javascript","application/ecmascript"].includes(s.type)){if(o.includes(s.innerText))continue;try{o.push(s.innerText),new Function(s.innerText)()}catch(x){console.warn("`CustomCode`: Error running script:",x)}}}},[]),t.jsx("div",{ref:a,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function G(e){const a=l.useRef(null),[g,S]=l.useState(()=>[]),[o,h]=l.useState(()=>[]),[v,b]=l.useState(()=>!1);function m(){if(!a.current||!a.current.getElementsByTagName)return;const s=a.current.getElementsByTagName("script");for(let x=0;x<s.length;x++){const y=s[x];if(y.src&&!g.includes(y.src)){g.push(y.src);const k=document.createElement("script");k.async=!0,k.src=y.src,document.head.appendChild(k)}else if(c.isJsScript(y)&&!o.includes(y.innerText))try{o.push(y.innerText),new Function(y.innerText)()}catch(k){console.warn("`Embed`: Error running script:",k)}}}return l.useEffect(()=>{a.current&&!v&&(b(!0),m())},[a.current,v]),t.jsx("div",{className:"builder-embed",ref:a,dangerouslySetInnerHTML:{__html:e.content}})}function Q(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 X(e){var S,o,h,v,b,m,s;function a(){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{...a()}}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&&((h=(o=e.builderBlock)==null?void 0:o.children)!=null&&h.length))?t.jsx(t.Fragment,{children:t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}})}):null,(b=(v=e.builderBlock)==null?void 0:v.children)!=null&&b.length&&e.fitContent?t.jsx(t.Fragment,{children:t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children})}):null,(s=(m=e.builderBlock)==null?void 0:m.children)!=null&&s.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 Y=l.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{}});function Z(e){var R,I,P,F,B,T,N;const a=l.useRef(null),[g,S]=l.useState(()=>0);function o(n){var r,d,u,f,L;const i={...e.builderContextSignal.content,...n,data:{...(r=e.builderContextSignal.content)==null?void 0:r.data,...n==null?void 0:n.data},meta:{...(d=e.builderContextSignal.content)==null?void 0:d.meta,...n==null?void 0:n.meta,breakpoints:((u=n==null?void 0:n.meta)==null?void 0:u.breakpoints)||((L=(f=e.builderContextSignal.content)==null?void 0:f.meta)==null?void 0:L.breakpoints)}};M.postPreviewContent({value:i,key:i.id}).then(()=>{z.refresh()})}l.useState(()=>0);const[h,v]=l.useState(()=>!1);function b(n){var r;const{data:i}=n;if(i)switch(i.type){case"builder.configureSdk":{const d=i.data,{breakpoints:u,contentId:f}=d;if(!f||f!==((r=e.builderContextSignal.content)==null?void 0:r.id))return;u&&o({meta:{breakpoints:u}}),S(g+1);break}case"builder.contentUpdate":{const d=i.data,u=d.key||d.alias||d.entry||d.modelName,f=d.data;u===e.model&&(o(f),S(g+1));break}}}function m(){var i,r;const n=(r=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:r.jsCode;n&&c.evaluate({code:n,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[s,x]=l.useState(()=>({})),[y,k]=l.useState(()=>!1);function K(n){var i,r;if(e.builderContextSignal.content){const d=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(r=e.builderContextSignal.content)==null?void 0:r.id;c._track({type:"click",canTrack:c.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:d!==u?d:void 0,...c.getInteractionPropertiesForEvent(n),unique:!y})}y||k(!0)}function q(n){return n.replace(/{{([^}]+)}}/g,(i,r)=>c.evaluate({code:r,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function _({url:n,key:i}){c.fetch(n).then(r=>r.json()).then(r=>{var u,f;const d={...e.builderContextSignal.rootState,[i]:r};(f=(u=e.builderContextSignal).rootSetState)==null||f.call(u,d),s[i]=!0}).catch(r=>{console.error("error fetching dynamic data",n,r)})}function C(){var i,r;const n=((r=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:r.httpRequests)??{};Object.entries(n).forEach(([d,u])=>{if(u&&(!s[d]||c.isEditing())){const f=q(u);_({url:f,key:d})}})}function E(){c.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:c.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function j(n){S(g+1),window.addEventListener("message",b),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 d;const r=c.createRegisterComponentMessage(i);(d=window.parent)==null||d.postMessage(r,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",E)}function w(n){const i=new URL(location.href).searchParams,r=i.get("builder.preview"),d=i.get(`builder.preview.${r}`),u=i.get("apiKey")||i.get("builder.space");r===e.model&&u===e.apiKey&&(!e.content||d===e.content.id)&&c.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(f=>{f&&o(f)})}const z=V.useRouter();return l.useEffect(()=>{var n;return(n=a.current)==null||n.addEventListener("initeditingbldr",j),()=>{var i;return(i=a.current)==null?void 0:i.removeEventListener("initeditingbldr",j)}},[]),l.useEffect(()=>{var n;return(n=a.current)==null||n.addEventListener("initpreviewingbldr",w),()=>{var i;return(i=a.current)==null?void 0:i.removeEventListener("initpreviewingbldr",w)}},[]),l.useEffect(()=>{var n,i;if(c.isBrowser()){if(c.isEditing()&&a.current&&a.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&c.getDefaultCanTrack(e.canTrack)){const d=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,u=(i=e.builderContextSignal.content)==null?void 0:i.id,f=e.apiKey;c._track({type:"impression",canTrack:!0,contentId:u,apiKey:f,variationId:d!==u?d:void 0})}c.isPreviewing()&&a.current}},[]),l.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."),m(),C(),E()},[]),l.useEffect(()=>{},[e.content]),l.useEffect(()=>{c.isBrowser()&&(window.removeEventListener("message",b),window.addEventListener("message",b))},[h]),l.useEffect(()=>{m()},[(I=(R=e.builderContextSignal.content)==null?void 0:R.data)==null?void 0:I.jsCode,e.builderContextSignal.rootState]),l.useEffect(()=>{C()},[(F=(P=e.builderContextSignal.content)==null?void 0:P.data)==null?void 0:F.httpRequests]),l.useEffect(()=>{E()},[e.builderContextSignal.rootState]),l.useEffect(()=>()=>{c.isBrowser()&&(window.removeEventListener("message",b),window.removeEventListener("builder:component:stateChangeListenerActivated",E))},[]),t.jsx(Y.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(t.Fragment,{children:l.createElement("div",{key:g,ref:a,onClick:n=>K(n),"builder-content-id":(B=e.builderContextSignal.content)==null?void 0:B.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},className:`variant-${((T=e.content)==null?void 0:T.testVariationId)||((N=e.content)==null?void 0:N.id)}`},e.children)}):null})}exports.BlockWrapper=A;exports.BlocksWrapper=U;exports.Button=W;exports.CustomCode=$;exports.Embed=G;exports.EnableEditor=Z;exports.FragmentComponent=H;exports.Image=O;exports.ImgComponent=Q;exports.InteractiveElement=D;exports.SectionComponent=J;exports.Video=X;
@@ -1,7 +0,0 @@
1
- import type { BuilderContextInterface } from '../context/types.js';
2
- import type { BuilderBlock } from '../types/builder-block.js';
3
- export declare function getReactNativeBlockStyles({ block, context, blockStyles }: {
4
- block: BuilderBlock;
5
- context: BuilderContextInterface;
6
- blockStyles: any;
7
- }): CSSStyleDeclaration | Record<string, string | undefined>;
@@ -1,3 +0,0 @@
1
- type Styles = Record<string, string | number>;
2
- export declare const sanitizeReactNativeBlockStyles: (styles: Styles) => Styles;
3
- export {};
@@ -1,7 +0,0 @@
1
- import type { BuilderContextInterface } from '../context/types.js';
2
- import type { BuilderBlock } from '../types/builder-block.js';
3
- export declare function getReactNativeBlockStyles({ block, context, blockStyles }: {
4
- block: BuilderBlock;
5
- context: BuilderContextInterface;
6
- blockStyles: any;
7
- }): CSSStyleDeclaration | Record<string, string | undefined>;
@@ -1,3 +0,0 @@
1
- type Styles = Record<string, string | number>;
2
- export declare const sanitizeReactNativeBlockStyles: (styles: Styles) => Styles;
3
- export {};