@builder.io/sdk-react-nextjs 0.14.28 → 0.14.30-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.
- package/lib/browser/blocks-exports.cjs +188 -0
- package/lib/browser/blocks-exports.mjs +2812 -0
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +25 -26
- package/lib/browser/init.cjs +8 -0
- package/lib/browser/init.mjs +60 -0
- package/lib/browser/server-entry-5cac64f5.js +720 -0
- package/lib/browser/server-entry-c9d4cfc0.cjs +2 -0
- package/lib/browser/server-entry.cjs +1 -0
- package/lib/browser/server-entry.mjs +16 -0
- package/lib/edge/blocks-exports.cjs +208 -0
- package/lib/edge/{bundle-c67d25d8.js → blocks-exports.mjs} +2388 -2405
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +25 -26
- package/lib/edge/init.cjs +8 -0
- package/lib/edge/init.mjs +60 -0
- package/lib/edge/server-entry-5cac64f5.js +720 -0
- package/lib/edge/server-entry-c9d4cfc0.cjs +2 -0
- package/lib/edge/server-entry.cjs +1 -0
- package/lib/edge/server-entry.mjs +16 -0
- package/lib/node/blocks-exports.cjs +188 -0
- package/lib/node/blocks-exports.mjs +2788 -0
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +23 -23
- package/lib/node/init.cjs +1 -0
- package/lib/node/init.mjs +13 -0
- package/lib/node/node-runtime-591c4640.cjs +48 -0
- package/lib/node/node-runtime-8d503570.js +167 -0
- package/lib/node/server-entry-00baa89f.js +720 -0
- package/lib/node/server-entry-1c6e06e6.cjs +2 -0
- package/lib/node/server-entry.cjs +1 -0
- package/lib/node/server-entry.mjs +16 -0
- package/package.json +14 -9
- package/types/cjs/blocks/BaseText.d.ts +6 -0
- package/types/cjs/blocks/form/component-info.d.ts +2 -0
- package/types/cjs/blocks/form/form.d.ts +33 -0
- package/types/cjs/blocks/input/component-info.d.ts +2 -0
- package/types/cjs/blocks/input/input.d.ts +15 -0
- package/types/cjs/blocks/raw-text/component-info.d.ts +2 -0
- package/types/cjs/blocks/raw-text/index.d.ts +1 -0
- package/types/cjs/blocks/raw-text/raw-text.d.ts +7 -0
- package/types/cjs/blocks/submit-button/component-info.d.ts +2 -0
- package/types/cjs/blocks/submit-button/submit-button.d.ts +10 -0
- package/types/cjs/blocks/textarea/component-info.d.ts +2 -0
- package/types/cjs/blocks/textarea/index.d.ts +1 -0
- package/types/cjs/blocks/textarea/textarea.d.ts +13 -0
- package/types/cjs/components/content/index.d.ts +1 -0
- package/types/cjs/components/error-boundary.d.ts +11 -0
- package/types/cjs/constants/sdk-name.d.ts +1 -0
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/apply-patch-with-mutation.d.ts +10 -0
- package/types/cjs/functions/evaluate/edge-runtime/acorn-interpreter.d.ts +2 -0
- package/types/cjs/functions/evaluate/edge-runtime/edge-runtime.d.ts +2 -0
- package/types/cjs/functions/evaluate/edge-runtime/index.d.ts +1 -0
- package/types/cjs/functions/evaluate/node-runtime/index.d.ts +1 -0
- package/types/cjs/functions/evaluate/node-runtime/init.d.ts +13 -0
- package/types/cjs/functions/evaluate/node-runtime/node-runtime.d.ts +11 -0
- package/types/cjs/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +8 -0
- package/types/cjs/functions/evaluate/placeholder-runtime.d.ts +2 -0
- package/types/cjs/functions/extract-css-var-default-value.d.ts +1 -0
- package/types/cjs/functions/get-react-native-block-styles.d.ts +15 -0
- package/types/cjs/functions/is-edge-runtime.d.ts +4 -0
- package/types/cjs/functions/on-change.d.ts +7 -0
- package/types/cjs/functions/sanitize-react-native-block-styles.d.ts +3 -0
- package/types/cjs/functions/sanitize-rn-allowed-css.d.ts +8 -0
- package/types/cjs/helpers/omit.d.ts +1 -0
- package/types/cjs/helpers/time.d.ts +1 -0
- package/types/esm/blocks/BaseText.d.ts +6 -0
- package/types/esm/blocks/form/component-info.d.ts +2 -0
- package/types/esm/blocks/form/form.d.ts +33 -0
- package/types/esm/blocks/input/component-info.d.ts +2 -0
- package/types/esm/blocks/input/input.d.ts +15 -0
- package/types/esm/blocks/raw-text/component-info.d.ts +2 -0
- package/types/esm/blocks/raw-text/index.d.ts +1 -0
- package/types/esm/blocks/raw-text/raw-text.d.ts +7 -0
- package/types/esm/blocks/submit-button/component-info.d.ts +2 -0
- package/types/esm/blocks/submit-button/submit-button.d.ts +10 -0
- package/types/esm/blocks/textarea/component-info.d.ts +2 -0
- package/types/esm/blocks/textarea/index.d.ts +1 -0
- package/types/esm/blocks/textarea/textarea.d.ts +13 -0
- package/types/esm/components/content/index.d.ts +1 -0
- package/types/esm/components/error-boundary.d.ts +11 -0
- package/types/esm/constants/sdk-name.d.ts +1 -0
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/apply-patch-with-mutation.d.ts +10 -0
- package/types/esm/functions/evaluate/edge-runtime/acorn-interpreter.d.ts +2 -0
- package/types/esm/functions/evaluate/edge-runtime/edge-runtime.d.ts +2 -0
- package/types/esm/functions/evaluate/edge-runtime/index.d.ts +1 -0
- package/types/esm/functions/evaluate/node-runtime/index.d.ts +1 -0
- package/types/esm/functions/evaluate/node-runtime/init.d.ts +13 -0
- package/types/esm/functions/evaluate/node-runtime/node-runtime.d.ts +11 -0
- package/types/esm/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +8 -0
- package/types/esm/functions/evaluate/placeholder-runtime.d.ts +2 -0
- package/types/esm/functions/extract-css-var-default-value.d.ts +1 -0
- package/types/esm/functions/get-react-native-block-styles.d.ts +15 -0
- package/types/esm/functions/is-edge-runtime.d.ts +4 -0
- package/types/esm/functions/on-change.d.ts +7 -0
- package/types/esm/functions/sanitize-react-native-block-styles.d.ts +3 -0
- package/types/esm/functions/sanitize-rn-allowed-css.d.ts +8 -0
- package/types/esm/helpers/omit.d.ts +1 -0
- package/types/esm/helpers/time.d.ts +1 -0
- package/lib/browser/USE_CLIENT_BUNDLE-1c35fc0a.js +0 -703
- package/lib/browser/USE_CLIENT_BUNDLE-65950ed4.cjs +0 -21
- package/lib/browser/USE_SERVER_BUNDLE-3ea7f606.cjs +0 -1
- package/lib/browser/USE_SERVER_BUNDLE-812dfc95.js +0 -11
- package/lib/browser/bundle-763c7cf6.js +0 -2829
- package/lib/browser/bundle-aff841a2.cjs +0 -169
- package/lib/edge/USE_CLIENT_BUNDLE-cf0350f7.js +0 -703
- package/lib/edge/USE_CLIENT_BUNDLE-fc025b97.cjs +0 -21
- package/lib/edge/USE_SERVER_BUNDLE-8e198f44.cjs +0 -1
- package/lib/edge/USE_SERVER_BUNDLE-ded4dbdc.js +0 -11
- package/lib/edge/bundle-05000fd3.cjs +0 -189
- package/lib/node/USE_CLIENT_BUNDLE-0fda6fd8.js +0 -703
- package/lib/node/USE_CLIENT_BUNDLE-c57c9376.cjs +0 -21
- package/lib/node/USE_SERVER_BUNDLE-15a235fc.js +0 -11
- package/lib/node/USE_SERVER_BUNDLE-5472e997.cjs +0 -1
- package/lib/node/bundle-40b09581.js +0 -2950
- package/lib/node/bundle-acffe20a.cjs +0 -216
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use client";"use strict";var Be=Object.defineProperty;var Pe=(e,t,n)=>t in e?Be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var q=(e,t,n)=>(Pe(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),u=require("./server-entry-c9d4cfc0.cjs"),y=require("react"),Ae=require("next/navigation");require("lru-cache");const We=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Ne=e=>typeof e=="string"&&We.has(e.toLowerCase());function J(e){return a.jsx(a.Fragment,{children:Ne(e.TagName)?a.jsx(a.Fragment,{children:a.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):a.jsx(a.Fragment,{children:typeof e.TagName=="string"?a.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):a.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}const F=()=>{switch(u.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":case"angular":return"class"}};function de(e){function t(){return{...e.attributes,[F()]:`${e.link?"":"builder-button"} ${e.attributes[F()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}}}return a.jsx(J,{attributes:t(),TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}function Ve(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options}}const Fe=({builder:e,context:t,event:n,state:i})=>Object.entries({state:i,Builder:e,builder:e,context:t,event:n}),$e=()=>({isEditing:u.isEditing(),isBrowser:u.isBrowser(),isServer:!u.isBrowser(),getUserAttributes:()=>u.getUserAttributes()}),Le=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,te=({code:e,builder:t,context:n,event:i,localState:o,rootSetState:r,rootState:c})=>{const l=Fe({builder:t,context:n,event:i,state:ue({rootState:c,localState:o,rootSetState:r})});return new Function(...l.map(([s])=>s),e)(...l.map(([,s])=>s))};function ue({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(i,o)=>{if(t&&o in t)return t[o];const r=i[o];return typeof r=="object"&&r!==null?ue({rootState:r,localState:void 0,rootSetState:n?c=>{i[o]=c,n(i)}:void 0}):r},set:(i,o,r)=>{if(t&&o in t)throw new Error("Writing to local state is not allowed as it is read-only.");return i[o]=r,n==null||n(i),!0}})}function De(){var e;return typeof process!="undefined"&&u.checkIsDefined((e=process==null?void 0:process.versions)==null?void 0:e.node)}const Oe=()=>{var i;if(!De())return!1;const e=process.arch==="arm64",t=process.version.startsWith("v20"),n=(i=process.env.NODE_OPTIONS)==null?void 0:i.includes("--no-node-snapshot");return e&&t&&!n?(u.logger.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "),!0):!1},Ue=e=>(u.isBrowser()||Oe(),te(e)),B=class B{static getCacheKey(t){return JSON.stringify({...t,event:t.event?Math.random():void 0})}static getCachedValue(t){return B.cache.get(t)}static setCachedValue(t,n){B.cache.size>20&&B.cache.delete(B.cache.keys().next().value),B.cache.set(t,{value:n})}};q(B,"cacheLimit",20),q(B,"cache",new Map);let W=B;function $({code:e,context:t,localState:n,rootState:i,rootSetState:o,event:r,isExpression:c=!0,enableCache:l}){if(e==="")return;const s={code:Le(e,{isExpression:c}),builder:$e(),context:t,event:r,rootSetState:o,rootState:i,localState:n};if(l){const d=W.getCacheKey(s),f=W.getCachedValue(d);if(f)return f.value}try{const d=Ue(s);if(l){const f=W.getCacheKey(s);W.setCachedValue(f,d)}return d}catch(d){u.logger.error("Failed code evaluation: "+d.message,{code:e});return}}const Me=(e,t,n)=>{if(Object(e)!==e)return e;const i=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return i.slice(0,-1).reduce((o,r,c)=>Object(o[r])===o[r]?o[r]:o[r]=Math.abs(Number(i[c+1]))>>0===+i[c+1]?[]:{},e)[i[i.length-1]]=n,e};const He=({block:e,context:t,localState:n,rootState:i,rootSetState:o})=>{if(!e.bindings)return e;const r=u.fastClone(e),c={...r,properties:{...r.properties},actions:{...r.actions}};for(const l in e.bindings){const s=e.bindings[l],d=$({code:s,localState:n,rootState:i,rootSetState:o,context:t,enableCache:!0});Me(c,l,d)}return c};function U({block:e,context:t,shouldEvaluateBindings:n,localState:i,rootState:o,rootSetState:r}){const c=e;return n?He({block:c,localState:i,rootState:o,rootSetState:r,context:t}):c}const Q=e=>e?e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase():"",me=e=>Object.entries(e).map(([n,i])=>{if(typeof i=="string")return`${Q(n)}: ${i};`}).filter(u.checkIsDefined),_e=e=>me(e).join(`
|
|
2
|
+
`),D=({mediaQuery:e,className:t,styles:n})=>{const i=`.${t} {
|
|
3
|
+
${_e(n)}
|
|
4
|
+
}`;return e?`${e} {
|
|
5
|
+
${i}
|
|
6
|
+
}`:i};function Ke({style:e}){return e}const ze=({block:e,context:t})=>fe(Ke({style:e.style||{},context:t,block:e}));function fe(e){switch(u.TARGET){case"svelte":case"vue":case"solid":case"angular":return me(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const qe=({block:e,context:t,registeredComponents:n})=>{var r;const i=(r=U({block:e,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,shouldEvaluateBindings:!1}).component)==null?void 0:r.name;if(!i)return null;const o=n[i];if(o)return o;console.warn(`
|
|
7
|
+
Could not find a registered component named "${i}".
|
|
8
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`)},Ge=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const o=$({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,enableCache:!0});if(!Array.isArray(o))return;const r=n.collection.split(".").pop(),c=n.itemName||(r?r+"Item":"item");return o.map((s,d)=>({context:{...t,localState:{...t.localState,$index:d,$item:s,[c]:s,[`$${c}Index`]:d}},block:i}))},Ye=(e,t)=>e&&(e.isRSC&&u.TARGET==="rsc"||["Core:Button","Symbol","Columns","Form:Form","Builder: Tabs","Builder:Accordion"].includes(e.name))?{builderLinkComponent:t}:{},Je=(e,t)=>e&&(e.isRSC&&u.TARGET==="rsc"||["Symbol","Columns","Form:Form","Builder: Tabs","Builder:Accordion"].includes(e.name))?{builderComponents:t}:{},Qe=(e,t)=>e&&(e.isRSC&&u.TARGET==="rsc"||u.TARGET==="reactNative"||["Builder:Accordion","Columns","Form:Form","Builder: Tabs","Symbol","Image","Video"].includes(e.name))?{builderBlock:t}:{},Xe=(e,t)=>e&&(e.isRSC&&u.TARGET==="rsc"||["Builder:Accordion","Columns","Form:Form","Builder: Tabs","Symbol","Slot"].includes(e.name))?{builderContext:t}:{},he={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},ne=(e,t=he)=>`@media (max-width: ${t[e].max}px)`,ge=({small:e,medium:t})=>{const n=u.fastClone(he);if(!e||!t)return n;const i=Math.floor(e/2);n.small={max:e,min:i,default:i+1};const o=n.small.max+1;n.medium={max:t,min:o,default:o+1};const r=n.medium.max+1;return n.large={max:2e3,min:r,default:r+1},n};function M(e){return a.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id})}function Ze(e){const t=function(){const o=U({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return u.checkIsDefined(o.hide)?!o.hide:u.checkIsDefined(o.show)?o.show:!0},n=function(){var k,x,w;const o=U({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),r=o.responsiveStyles,c=e.context.content,l=ge(((k=c==null?void 0:c.meta)==null?void 0:k.breakpoints)||{}),s=r==null?void 0:r.large,d=r==null?void 0:r.medium,f=r==null?void 0:r.small,m=o.id;if(!m)return"";const g=s?D({className:m,styles:s}):"",C=d?D({className:m,styles:d,mediaQuery:ne("medium",l)}):"",T=f?D({className:m,styles:f,mediaQuery:ne("small",l)}):"",S=o.animations&&o.animations.find(E=>E.trigger==="hover");let P="";if(S){const E=((w=(x=S.steps)==null?void 0:x[1])==null?void 0:w.styles)||{};P=D({className:`${m}:hover`,styles:{...E,transition:`all ${S.duration}s ${Q(S.easing)}`,transitionDelay:S.delay?`${S.delay}s`:"0s"}})||""}return[g,C,T,P].join(" ")};return a.jsx(a.Fragment,{children:n()&&t()?a.jsx(a.Fragment,{children:a.jsx(M,{id:"builderio-block",styles:n()})}):null})}function et(e){return e.charAt(0).toUpperCase()+e.slice(1)}const tt=e=>`on${et(e)}`,nt=(e,t)=>n=>$({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1,enableCache:!0});function be(e){var i;const t={},n=(i=e.block.actions)!=null?i:{};for(const o in n){if(!n.hasOwnProperty(o))continue;const r=n[o];let c=tt(o);if(e.stripPrefix)switch(u.TARGET){case"vue":c=c.replace("v-on:","");break;case"svelte":c=c.replace("on:","");break}t[c]=nt(r,e)}return t}function it({properties:e}){return e}const ot=e=>({href:e.href});function X({block:e,context:t}){var i;const n={...ot(e),...e.properties,"builder-id":e.id,style:ze({block:e,context:t}),[F()]:[e.id,"builder-block",e.class,(i=e.properties)==null?void 0:i.class].filter(Boolean).join(" ")};return it({properties:n,context:t,block:e})}function at(e){return a.jsx(J,{TagName:e.Wrapper,attributes:X({block:e.block,context:e.context}),actionAttributes:be({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:e.children})}function rt(e){function t(){return e.includeBlockProps?{...X({block:e.block,context:e.context}),...be({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{}}return a.jsx(e.Wrapper,{...e.wrapperProps,attributes:t(),children:e.children})}const ct=({componentOptions:e,builderBlock:t,context:n,componentRef:i,includeBlockProps:o,isInteractive:r,contextValue:c})=>{const l={...e,...o?{attributes:X({block:t,context:c})}:{}};return r?{Wrapper:i,block:t,context:n,wrapperProps:e,includeBlockProps:o}:l};function ie(e){var n;const t=e.isInteractive?rt:e.componentRef;return a.jsx(a.Fragment,{children:e.componentRef?a.jsx(a.Fragment,{children:a.jsx(t,{...ct({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(n=e.blockChildren)==null?void 0:n.map(i=>a.jsx(H,{block:i,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},i.id))})}):null})}function lt(e){const t=e.repeatContext;return a.jsx(H,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})}function H(e){var s,d,f;const t=function(){return qe({block:e.block,context:e.context,registeredComponents:e.registeredComponents})},n=function(){return Ge({block:e.block,context:e.context})},i=function(){var g;return(g=e.block.repeat)!=null&&g.collection?e.block:U({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})},o=function(){var C;return e.block.tagName==="a"||((C=i().properties)==null?void 0:C.href)||i().href?e.linkComponent||"a":e.block.tagName||"div"},r=function(){var T,S;if((T=e.block.repeat)!=null&&T.collection)return!!((S=n())!=null&&S.length);const g="hide"in i()?i().hide:!1;return("show"in i()?i().show:!0)&&!g},c=function(){var C,T;return!((C=t())!=null&&C.component)&&!n()?(T=i().children)!=null?T:[]:[]},l=function(){var g,C,T,S;return{blockChildren:(g=i().children)!=null?g:[],componentRef:(C=t())==null?void 0:C.component,componentOptions:{...Ve(i()),...Qe(t(),i()),...Xe(t(),e.context),...Ye(t(),e.linkComponent),...Je(t(),e.registeredComponents)},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:i(),includeBlockProps:((T=t())==null?void 0:T.noWrap)===!0,isInteractive:!((S=t())!=null&&S.isRSC)}};return a.jsx(a.Fragment,{children:r()?a.jsxs(a.Fragment,{children:[a.jsx(Ze,{block:e.block,context:e.context}),(s=t())!=null&&s.noWrap?a.jsx(a.Fragment,{children:a.jsx(ie,{componentRef:l().componentRef,componentOptions:l().componentOptions,blockChildren:l().blockChildren,context:l().context,registeredComponents:l().registeredComponents,linkComponent:l().linkComponent,builderBlock:l().builderBlock,includeBlockProps:l().includeBlockProps,isInteractive:l().isInteractive})}):a.jsx(a.Fragment,{children:n()?a.jsx(a.Fragment,{children:(f=n())==null?void 0:f.map((m,g)=>a.jsx(lt,{repeatContext:m.context,block:m.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},g))}):a.jsxs(at,{Wrapper:o(),block:i(),context:e.context,children:[a.jsx(ie,{componentRef:l().componentRef,componentOptions:l().componentOptions,blockChildren:l().blockChildren,context:l().context,registeredComponents:l().registeredComponents,linkComponent:l().linkComponent,builderBlock:l().builderBlock,includeBlockProps:l().includeBlockProps,isInteractive:l().isInteractive}),(d=c())==null?void 0:d.map(m=>a.jsx(H,{block:m,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},m.id))]})})]}):null})}function st(e){function t(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function n(){var o,r;u.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((r=window.parent)==null||r.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function i(){var o,r;u.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((r=window.parent)==null||r.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return a.jsxs(a.Fragment,{children:[a.jsx(e.BlocksWrapper,{className:t()+" props-blocks-wrapper-7cd1560e","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>n(),onMouseEnter:o=>i(),onKeyPress:o=>n(),...e.BlocksWrapperProps,children:e.children}),a.jsx("style",{children:`.props-blocks-wrapper-7cd1560e {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
align-items: stretch;
|
|
12
|
+
}`})]})}function _(e){var t,n,i;return a.jsx(st,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,BlocksWrapper:(t=e.context)==null?void 0:t.BlocksWrapper,BlocksWrapperProps:(n=e.context)==null?void 0:n.BlocksWrapperProps,children:e.blocks?a.jsx(a.Fragment,{children:(i=e.blocks)==null?void 0:i.map(o=>a.jsx(H,{block:o,linkComponent:e.linkComponent,context:e.context,registeredComponents:e.registeredComponents},o.id))}):null})}const dt=e=>`builder-columns ${e}-breakpoints`;function xe(e){var S,P;const t=typeof e.space=="number"?e.space||0:20,n=e.columns||[],i=e.stackColumnsAt||"tablet",o=function(x){return x.link?e.builderLinkComponent||"a":"div"},r=function(x){var w;return((w=n[x])==null?void 0:w.width)||100/n.length},c=function(x){const w=t*(n.length-1)/n.length;return`calc(${r(x)}% - ${w}px)`},l=function({stackedStyle:x,desktopStyle:w}){return i==="tablet"?x:w},s=function({stackedStyle:x,desktopStyle:w}){return i==="never"?w:x},d=e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column",f=function(){return{"--flex-dir":d,"--flex-dir-tablet":l({stackedStyle:d,desktopStyle:"row"})}},m=function(x){const w=x===0?0:t,E=c(x),j=`${w}px`,N="100%",V=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:E,["marginLeft"]:j,"--column-width-mobile":s({stackedStyle:N,desktopStyle:E}),"--column-margin-left-mobile":s({stackedStyle:V,desktopStyle:j}),"--column-width-tablet":l({stackedStyle:N,desktopStyle:E}),"--column-margin-left-tablet":l({stackedStyle:V,desktopStyle:j})}},g=function(x){var E,j;return ge(((j=(E=e.builderContext.content)==null?void 0:E.meta)==null?void 0:j.breakpoints)||{})[x].max},C=function(){return`
|
|
13
|
+
@media (max-width: ${g("medium")}px) {
|
|
14
|
+
.${e.builderBlock.id}-breakpoints {
|
|
15
|
+
flex-direction: var(--flex-dir-tablet);
|
|
16
|
+
align-items: stretch;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.${e.builderBlock.id}-breakpoints > .builder-column {
|
|
20
|
+
width: var(--column-width-tablet) !important;
|
|
21
|
+
margin-left: var(--column-margin-left-tablet) !important;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@media (max-width: ${g("small")}px) {
|
|
26
|
+
.${e.builderBlock.id}-breakpoints {
|
|
27
|
+
flex-direction: var(--flex-dir);
|
|
28
|
+
align-items: stretch;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.${e.builderBlock.id}-breakpoints > .builder-column {
|
|
32
|
+
width: var(--column-width-mobile) !important;
|
|
33
|
+
margin-left: var(--column-margin-left-mobile) !important;
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
`},T=function(x,w){return{...x.link?{href:x.link}:{},[F()]:"builder-column",style:fe(m(w))}};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:dt((S=e.builderBlock)==null?void 0:S.id)+" div-eeca3604",style:f(),children:[a.jsx(M,{id:"builderio-columns",styles:C()}),(P=e.columns)==null?void 0:P.map((k,x)=>a.jsx(J,{TagName:o(k),actionAttributes:{},attributes:T(k,x),children:a.jsx(_,{path:`component.options.columns.${x}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:k.blocks})},x))]}),a.jsx("style",{children:`.div-eeca3604 {
|
|
37
|
+
display: flex;
|
|
38
|
+
line-height: normal;
|
|
39
|
+
}`})]})}function ye(e){return a.jsx("span",{children:e.children})}function oe(e){return e.replace(/http(s)?:/,"")}function ut(e="",t,n){const i=new RegExp("([?&])"+t+"=.*?(&|$)","i"),o=e.indexOf("?")!==-1?"&":"?";return e.match(i)?e.replace(i,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+o+t+"="+encodeURIComponent(n)}function mt(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return oe(e);const n=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(n){const i=e.split(n[0]),o=n[3],r=t.match("x")?t:`${t}x`;return oe(`${i[0]}_${r}${o}`)}return null}function G(e){if(!e)return e;const t=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let n=e;const i=Number(e.split("?width=")[1]);return isNaN(i)||(n=`${n} ${i}w`),t.filter(o=>o!==i).map(o=>`${ut(e,"width",o)} ${o}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[mt(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,i])=>`${n} ${i}w`).concat([e]).join(", "):e}function Se(e){var o,r,c,l,s,d;function t(){var g;const m=e.image||e.src;if(!m||!(m.match(/builder\.io/)||m.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((g=e.image)!=null&&g.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),G(m)}else if(e.image&&!e.srcset)return G(m);return G(m)}function n(){var f;return(f=t==null?void 0:t())!=null&&f.match(/builder\.io/)&&!e.noWebp?t().replace(/\?/g,"?format=webp&"):""}function i(){const f={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?f:void 0}return a.jsxs(a.Fragment,{children:[a.jsxs(a.Fragment,{children:[a.jsxs("picture",{children:[n()?a.jsx("source",{type:"image/webp",srcSet:n()}):null,a.jsx("img",{loading:e.highPriority?"eager":"lazy",fetchPriority:e.highPriority?"high":"auto",alt:e.altText,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...i()},className:"builder-image"+(e.className?" "+e.className:"")+" img-ac3dff4a",src:e.image,srcSet:t(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(o=e.builderBlock)==null?void 0:o.children)!=null&&r.length&&e.fitContent)?a.jsx("div",{className:"builder-image-sizer div-ac3dff4a",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(l=(c=e.builderBlock)==null?void 0:c.children)!=null&&l.length&&e.fitContent?a.jsx(a.Fragment,{children:e.children}):null,!e.fitContent&&((d=(s=e.builderBlock)==null?void 0:s.children)!=null&&d.length)?a.jsx("div",{className:"div-ac3dff4a-2",children:e.children}):null]}),a.jsx("style",{children:`.img-ac3dff4a {
|
|
40
|
+
opacity: 1;
|
|
41
|
+
transition: opacity 0.2s ease-in-out;
|
|
42
|
+
}.div-ac3dff4a {
|
|
43
|
+
width: 100%;
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
font-size: 0;
|
|
46
|
+
}.div-ac3dff4a-2 {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
align-items: stretch;
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: 0;
|
|
52
|
+
left: 0;
|
|
53
|
+
width: 100%;
|
|
54
|
+
height: 100%;
|
|
55
|
+
}`})]})}function pe(e){return a.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})}const ft={name:"Core:Button",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#000000",color:"white",borderRadius:"4px",textAlign:"center",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me!",bubble:!0},{name:"link",type:"url",bubble:!0},{name:"openLinkInNewTab",type:"boolean",defaultValue:!1,friendlyName:"Open link in new tab"}],static:!0,noWrap:!0},ht={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){n.forEach(i=>{i.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(o=>o.get("width"))&&(n.find(r=>!r.get("width"))||n.reduce((l,s)=>l+s.get("width"),0)!==100)&&t()}},{name:"space",type:"number",defaultValue:20,helperText:"Size of gap between columns",advanced:!0},{name:"stackColumnsAt",type:"string",defaultValue:"tablet",helperText:"Convert horizontal columns to vertical at what device size",enum:["tablet","mobile","never"],advanced:!0},{name:"reverseColumnsWhenStacked",type:"boolean",defaultValue:!1,helperText:"When stacking columns for mobile devices, reverse the ordering",advanced:!0}]},gt={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},bt={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg","webp"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(c,l=6e4){return new Promise((s,d)=>{const f=document.createElement("img");let m=!1;f.onload=()=>{m=!0,s(f)},f.addEventListener("error",g=>{console.warn("Image load failed",g.error),d(g.error)}),f.src=c,setTimeout(()=>{m||d(new Error("Image load timed out"))},l)})}function i(c){return Math.round(c*1e3)/1e3}const o=e.get("image"),r=e.get("aspectRatio");if(fetch(o).then(c=>c.blob()).then(c=>{c.type.includes("svg")&&e.set("noWebp",!0)}),o&&(!r||r===.7041))return n(o).then(c=>{const l=e.get("aspectRatio");e.get("image")===o&&(!l||l===.7041)&&c.width&&c.height&&(e.set("aspectRatio",i(c.height/c.width)),e.set("height",c.height),e.set("width",c.width))})}},{name:"backgroundSize",type:"text",defaultValue:"cover",enum:[{label:"contain",value:"contain",helperText:"The image should never get cropped"},{label:"cover",value:"cover",helperText:"The image should fill it's box, cropping when needed"}]},{name:"backgroundPosition",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"altText",type:"string",helperText:"Text to display when the user has images off"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"highPriority",type:"boolean",advanced:!0,helperText:"Mark this image as high priority compared to other images on the page. This prevents lazy loading of the image and tells the browser to load this image before others on the page."},{name:"aspectRatio",type:"number",helperText:"This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",advanced:!0,defaultValue:.7041}]},xt={name:"Core:Section",static:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",inputs:[{name:"maxWidth",type:"number",defaultValue:1200},{name:"lazyLoad",type:"boolean",defaultValue:!1,advanced:!0,description:"Only render this section when in view"}],defaultStyles:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"50px",paddingBottom:"50px",marginTop:"0px",width:"100vw",marginLeft:"calc(50% - 50vw)"},canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"center"}},component:{name:"Text",options:{text:"<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"}}}]},yt={name:"Slot",isRSC:!0,description:"Allow child blocks to be inserted into this content when used as a Symbol",docsLink:"https://www.builder.io/c/docs/symbols-with-blocks",image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",inputs:[{name:"name",type:"string",required:!0,defaultValue:"children"}]};function St(e){var t,n,i;return a.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:a.jsx(_,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(i=e.builderContext.rootState)==null?void 0:i[e.name]})})}const pt={name:"Symbol",noWrap:!0,static:!0,isRSC:!0,inputs:[{name:"symbol",type:"uiSymbol"},{name:"dataOnly",helperText:"Make this a data symbol that doesn't display any UI",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"inheritState",helperText:"Inherit the parent component state and data",type:"boolean",defaultValue:!1,advanced:!0},{name:"renderToLiquid",helperText:"Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"useChildren",hideFromUI:!0,type:"boolean"}]},vt={name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}};function ve(e){var t;return a.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const kt={name:"Custom Code",static:!0,requiredPermissions:["editCode"],inputs:[{name:"code",type:"html",required:!0,defaultValue:"<p>Hello there, I am custom HTML code!</p>",code:!0},{name:"replaceNodes",type:"boolean",helperText:"Preserve server rendered dom nodes",advanced:!0},{name:"scriptsClientOnly",type:"boolean",defaultValue:!1,helperText:"Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",advanced:!0}]};function Ct(e){const t=y.useRef(null),[n,i]=y.useState(()=>[]),[o,r]=y.useState(()=>[]);return y.useEffect(()=>{var l;if(!((l=t.current)!=null&&l.getElementsByTagName)||typeof window=="undefined")return;const c=t.current.getElementsByTagName("script");for(let s=0;s<c.length;s++){const d=c[s];if(d.src){if(n.includes(d.src))continue;n.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(o.includes(d.innerText))continue;try{o.push(d.innerText),new Function(d.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),a.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const It={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc",onChange:e=>{const t=e.get("url");if(t){e.set("content","Loading...");const n=_iframelyApiKey;return fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=${n}`).then(i=>i.json()).then(i=>{e.get("url")===t&&(i.html?e.set("content",i.html):e.set("content","Invalid url, please try another"))}).catch(i=>{e.set("content","There was an error embedding this URL, please try again or another URL")})}else e.delete("content")}},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},wt=["text/javascript","application/javascript","application/ecmascript"],Tt=e=>wt.includes(e.type);function Et(e){const t=y.useRef(null),[n,i]=y.useState(()=>[]),[o,r]=y.useState(()=>[]),[c,l]=y.useState(()=>!1);function s(){if(!t.current||!t.current.getElementsByTagName)return;const d=t.current.getElementsByTagName("script");for(let f=0;f<d.length;f++){const m=d[f];if(m.src&&!n.includes(m.src)){n.push(m.src);const g=document.createElement("script");g.async=!0,g.src=m.src,document.head.appendChild(g)}else if(Tt(m)&&!o.includes(m.innerText))try{o.push(m.innerText),new Function(m.innerText)()}catch(g){console.warn("`Embed`: Error running script:",g)}}}return y.useEffect(()=>{t.current&&!c&&(l(!0),s())},[t.current,c]),a.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const Rt={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:["jpeg","jpg","png","svg","gif","webp"],required:!0}],noWrap:!0,static:!0};function jt(e){return a.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},u.isEditing()&&e.imgSrc||"default-key")}const Bt={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}]};function ke(e){var i,o,r,c,l,s,d;function t(){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 n(){return{...t()}}return a.jsxs("div",{style:{position:"relative"},children:[a.jsx("video",{className:"builder-video",...n(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(i=e.attributes)==null?void 0:i.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:a.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((r=(o=e.builderBlock)==null?void 0:o.children)!=null&&r.length))?a.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(l=(c=e.builderBlock)==null?void 0:c.children)!=null&&l.length&&e.fitContent?a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(d=(s=e.builderBlock)==null?void 0:s.children)!=null&&d.length&&!e.fitContent?a.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 Pt=()=>[{component:Ct,...kt},{component:Et,...It},{component:jt,...Rt},{component:ke,...Bt}],ae=()=>[{component:de,...ft},{component:xe,...ht},{component:ye,...gt},{component:Se,...bt},{component:pe,...xt},{component:St,...yt},{component:Re,...pt},{component:ve,...vt},...Pt()],At=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
56
|
+
function getAndSetVariantId() {
|
|
57
|
+
function setCookie(name, value, days) {
|
|
58
|
+
let expires = '';
|
|
59
|
+
if (days) {
|
|
60
|
+
const date = new Date();
|
|
61
|
+
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
|
|
62
|
+
expires = '; expires=' + date.toUTCString();
|
|
63
|
+
}
|
|
64
|
+
document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';
|
|
65
|
+
}
|
|
66
|
+
function getCookie(name) {
|
|
67
|
+
const nameEQ = name + '=';
|
|
68
|
+
const ca = document.cookie.split(';');
|
|
69
|
+
for (let i = 0; i < ca.length; i++) {
|
|
70
|
+
let c = ca[i];
|
|
71
|
+
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
|
72
|
+
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
const cookieName = \`builder.tests.\${contentId}\`;
|
|
77
|
+
const variantInCookie = getCookie(cookieName);
|
|
78
|
+
const availableIDs = variants.map(vr => vr.id).concat(contentId);
|
|
79
|
+
if (variantInCookie && availableIDs.includes(variantInCookie)) {
|
|
80
|
+
return variantInCookie;
|
|
81
|
+
}
|
|
82
|
+
let n = 0;
|
|
83
|
+
const random = Math.random();
|
|
84
|
+
for (let i = 0; i < variants.length; i++) {
|
|
85
|
+
const variant = variants[i];
|
|
86
|
+
const testRatio = variant.testRatio;
|
|
87
|
+
n += testRatio;
|
|
88
|
+
if (random < n) {
|
|
89
|
+
setCookie(cookieName, variant.id);
|
|
90
|
+
return variant.id;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
setCookie(cookieName, contentId);
|
|
94
|
+
return contentId;
|
|
95
|
+
}
|
|
96
|
+
const winningVariantId = getAndSetVariantId();
|
|
97
|
+
const styleEl = document.currentScript?.previousElementSibling;
|
|
98
|
+
if (isHydrationTarget) {
|
|
99
|
+
styleEl.remove();
|
|
100
|
+
const thisScriptEl = document.currentScript;
|
|
101
|
+
thisScriptEl?.remove();
|
|
102
|
+
} else {
|
|
103
|
+
const newStyleStr = variants.concat({
|
|
104
|
+
id: contentId
|
|
105
|
+
}).filter(variant => variant.id !== winningVariantId).map(value => {
|
|
106
|
+
return \`.variant-\${value.id} { display: none; }
|
|
107
|
+
\`;
|
|
108
|
+
}).join('');
|
|
109
|
+
styleEl.innerHTML = newStyleStr;
|
|
110
|
+
}
|
|
111
|
+
}`,Wt=`function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
112
|
+
if (!navigator.cookieEnabled) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
function getCookie(name) {
|
|
116
|
+
const nameEQ = name + '=';
|
|
117
|
+
const ca = document.cookie.split(';');
|
|
118
|
+
for (let i = 0; i < ca.length; i++) {
|
|
119
|
+
let c = ca[i];
|
|
120
|
+
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
|
121
|
+
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
122
|
+
}
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
const cookieName = \`builder.tests.\${defaultContentId}\`;
|
|
126
|
+
const winningVariant = getCookie(cookieName);
|
|
127
|
+
const parentDiv = document.currentScript?.parentElement;
|
|
128
|
+
const isDefaultContent = variantContentId === defaultContentId;
|
|
129
|
+
const isWinningVariant = winningVariant === variantContentId;
|
|
130
|
+
if (isWinningVariant && !isDefaultContent) {
|
|
131
|
+
parentDiv?.removeAttribute('hidden');
|
|
132
|
+
parentDiv?.removeAttribute('aria-hidden');
|
|
133
|
+
} else if (!isWinningVariant && isDefaultContent) {
|
|
134
|
+
parentDiv?.setAttribute('hidden', 'true');
|
|
135
|
+
parentDiv?.setAttribute('aria-hidden', 'true');
|
|
136
|
+
}
|
|
137
|
+
if (isHydrationTarget) {
|
|
138
|
+
if (!isWinningVariant) {
|
|
139
|
+
parentDiv?.remove();
|
|
140
|
+
}
|
|
141
|
+
const thisScriptEl = document.currentScript;
|
|
142
|
+
thisScriptEl?.remove();
|
|
143
|
+
}
|
|
144
|
+
return;
|
|
145
|
+
}`,Ce="builderIoAbTest",Ie="builderIoRenderContent",O=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),Nt=({canTrack:e,content:t})=>!(!(O(t).length>0)||!e||u.isBrowser()),Vt=e=>e==="react"||e==="reactNative",we=Vt(u.TARGET),Ft=()=>`
|
|
146
|
+
window.${Ce} = ${At}
|
|
147
|
+
window.${Ie} = ${Wt}
|
|
148
|
+
`,$t=(e,t)=>`
|
|
149
|
+
window.${Ce}(
|
|
150
|
+
"${t}",${JSON.stringify(e)}, ${we}
|
|
151
|
+
)`,Lt=({contentId:e,variationId:t})=>`window.${Ie}(
|
|
152
|
+
"${t}", "${e}", ${we}
|
|
153
|
+
)`;function Y(e){return a.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id})}const Te=y.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function re(e){return Math.round(e*1e3)/1e3}const Dt=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let i=n?e:e.parentElement;do{if(!i)return null;if(t(i))return i}while(i=i.parentElement);return null},Ot=e=>Dt(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),ce=({event:e,target:t})=>{const n=t.getBoundingClientRect(),i=e.clientX-n.left,o=e.clientY-n.top,r=re(i/n.width),c=re(o/n.height);return{x:r,y:c}},Ut=e=>{const t=e.target,n=t&&Ot(t),i=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:i||void 0,metadata:{targetOffset:t?ce({event:e,target:t}):void 0,builderTargetOffset:n?ce({event:e,target:n}):void 0,builderElementIndex:n&&i?[].slice.call(document.getElementsByClassName(i)).indexOf(n):void 0}}};async function Mt({key:e,value:t}){return u.init(),globalThis._BUILDER_PREVIEW_LRU_CACHE.set(e,t),{[e]:t}}function le(e,...t){const n=Object(e);for(let i=1;i<arguments.length;i++){const o=arguments[i];if(o!=null)for(const r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])}return n}function Ht(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function _t(e,t){const n=Kt(e),i=getComputedStyle(t),o=e.steps[0].styles,r=e.steps[e.steps.length-1].styles,c=[o,r];for(const l of c)for(const s of n)s in l||(l[s]=i[s])}function Kt(e){const t=[];for(const n of e.steps)for(const i in n.styles)t.indexOf(i)===-1&&t.push(i);return t}function zt(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){Ht(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{_t(e,n),n.style.transition="none",n.style.transitionDelay="0",le(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${Q(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),le(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}const qt=e=>{var r,c;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],i=(c=e.fileUrl)!=null?c:(r=e==null?void 0:e.files)==null?void 0:r.regular;let o="";if(i&&t&&n&&(o+=`
|
|
154
|
+
@font-face {
|
|
155
|
+
font-family: "${t}";
|
|
156
|
+
src: local("${n}"), url('${i}') format('woff2');
|
|
157
|
+
font-display: fallback;
|
|
158
|
+
font-weight: 400;
|
|
159
|
+
}
|
|
160
|
+
`.trim()),e.files)for(const l in e.files){if(!(String(Number(l))===l))continue;const d=e.files[l];d&&d!==i&&(o+=`
|
|
161
|
+
@font-face {
|
|
162
|
+
font-family: "${t}";
|
|
163
|
+
src: url('${d}') format('woff2');
|
|
164
|
+
font-display: fallback;
|
|
165
|
+
font-weight: ${l};
|
|
166
|
+
}
|
|
167
|
+
`.trim())}return o},Gt=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(n=>qt(n)))==null?void 0:t.join(" "))||""},Yt=({cssCode:e,contentId:t})=>e?t?(e==null?void 0:e.replace(/&/g,`div[builder-content-id="${t}"]`))||"":e:"",Jt=`
|
|
168
|
+
.builder-button {
|
|
169
|
+
all: unset;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
173
|
+
margin: 0;
|
|
174
|
+
}
|
|
175
|
+
.builder-text > p, .builder-text > .builder-paragraph {
|
|
176
|
+
color: inherit;
|
|
177
|
+
line-height: inherit;
|
|
178
|
+
letter-spacing: inherit;
|
|
179
|
+
font-weight: inherit;
|
|
180
|
+
font-size: inherit;
|
|
181
|
+
text-align: inherit;
|
|
182
|
+
font-family: inherit;
|
|
183
|
+
}
|
|
184
|
+
`,Qt=e=>e?"":Jt,Xt=e=>`variant-${e}`;function Zt(e){var j,N,V,K,z,Z,ee;const t=y.useRef(null);function n(b){var p,v;const h={...e.builderContextSignal.rootState,...b};e.builderContextSignal.rootSetState?(v=(p=e.builderContextSignal).rootSetState)==null||v.call(p,h):e.builderContextSignal.rootState=h}function i(b){var p,v,I,R,L;const h={...e.builderContextSignal.content,...b,data:{...(p=e.builderContextSignal.content)==null?void 0:p.data,...b==null?void 0:b.data},meta:{...(v=e.builderContextSignal.content)==null?void 0:v.meta,...b==null?void 0:b.meta,breakpoints:((I=b==null?void 0:b.meta)==null?void 0:I.breakpoints)||((L=(R=e.builderContextSignal.content)==null?void 0:R.meta)==null?void 0:L.breakpoints)}};Mt({value:h,key:h.id}).then(()=>{E.refresh()})}function o(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[r,c]=y.useState(()=>e.contentWrapper||"div");function l(b){return u.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:h=>{var I;const{breakpoints:p,contentId:v}=h;!v||v!==((I=e.builderContextSignal.content)==null?void 0:I.id)||p&&i({meta:{breakpoints:p}})},animation:h=>{zt(h)},contentUpdate:h=>{i(h)}}})(b)}function s(){var h,p;const b=(p=(h=e.builderContextSignal.content)==null?void 0:h.data)==null?void 0:p.jsCode;b&&$({code:b,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!1})}const[d,f]=y.useState(()=>({})),[m,g]=y.useState(()=>({})),[C,T]=y.useState(()=>!1);function S(b){var h,p;if(e.builderContextSignal.content){const v=(h=e.builderContextSignal.content)==null?void 0:h.testVariationId,I=(p=e.builderContextSignal.content)==null?void 0:p.id;u._track({type:"click",canTrack:u.getDefaultCanTrack(e.canTrack),contentId:I,apiKey:e.apiKey,variationId:v!==I?v:void 0,...Ut(b),unique:!C})}C||T(!0)}function P(){var h,p,v;const b=(v=(p=(h=e.builderContextSignal.content)==null?void 0:h.data)==null?void 0:p.httpRequests)!=null?v:{};Object.entries(b).forEach(([I,R])=>{if(!R||m[I]||d[I]&&!u.isEditing())return;m[I]=!0;const L=R.replace(/{{([^}]+)}}/g,(A,je)=>String($({code:je,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!0})));u.fetch(L).then(A=>A.json()).then(A=>{n({[I]:A}),d[I]=!0}).catch(A=>{console.error("error fetching dynamic data",R,A)}).finally(()=>{m[I]=!1})})}function k(){u.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:u.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function x(b){window.addEventListener("message",l),u.registerInsertMenu(),u.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(h=>{var v;const p=u.createRegisterComponentMessage(h);(v=window.parent)==null||v.postMessage(p,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",k)}function w(b){const h=new URL(location.href).searchParams,p=h.get("builder.preview"),v=h.get(`builder.overrides.${p}`),I=h.get("apiKey")||h.get("builder.space");p===e.model&&I===e.apiKey&&(!e.content||v===e.content.id)&&u.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(R=>{R&&i(R)})}const E=Ae.useRouter();return y.useEffect(()=>{var b;return(b=t.current)==null||b.addEventListener("initeditingbldr",x),()=>{var h;return(h=t.current)==null?void 0:h.removeEventListener("initeditingbldr",x)}},[]),y.useEffect(()=>{var b;return(b=t.current)==null||b.addEventListener("initpreviewingbldr",w),()=>{var h;return(h=t.current)==null?void 0:h.removeEventListener("initpreviewingbldr",w)}},[]),y.useEffect(()=>{var b,h;if(u.isBrowser()){if(u.isEditing()&&t.current&&t.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&u.getDefaultCanTrack(e.canTrack)){const v=(b=e.builderContextSignal.content)==null?void 0:b.testVariationId,I=(h=e.builderContextSignal.content)==null?void 0:h.id,R=e.apiKey;u._track({type:"impression",canTrack:!0,contentId:I,apiKey:R,variationId:v!==I?v:void 0})}u.isPreviewing()&&u.isEditing()}},[]),y.useEffect(()=>{e.apiKey||u.logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."),s(),P(),k()},[]),y.useEffect(()=>{},[e.content]),y.useEffect(()=>{s()},[(N=(j=e.builderContextSignal.content)==null?void 0:j.data)==null?void 0:N.jsCode]),y.useEffect(()=>{P()},[(K=(V=e.builderContextSignal.content)==null?void 0:V.data)==null?void 0:K.httpRequests]),y.useEffect(()=>{k()},[e.builderContextSignal.rootState]),y.useEffect(()=>{e.data&&n(e.data)},[e.data]),y.useEffect(()=>{e.locale&&n({locale:e.locale})},[e.locale]),y.useEffect(()=>()=>{u.isBrowser()&&(window.removeEventListener("message",l),window.removeEventListener("builder:component:stateChangeListenerActivated",k))},[]),a.jsx(Te.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?a.jsx(r,{ref:t,onClick:b=>S(b),"builder-content-id":(z=e.builderContextSignal.content)==null?void 0:z.id,"builder-model":e.model,...o(),...e.contentWrapperProps,className:Xt(((Z=e.content)==null?void 0:Z.testVariationId)||((ee=e.content)==null?void 0:ee.id)),children:e.children}):null})}function en(e){const t=`
|
|
185
|
+
${Yt({cssCode:e.cssCode,contentId:e.contentId})}
|
|
186
|
+
${Gt({customFonts:e.customFonts})}
|
|
187
|
+
${Qt(e.isNestedRender)}
|
|
188
|
+
`.trim();return a.jsx(M,{id:"builderio-content",styles:t})}const tn=({content:e,data:t,locale:n})=>{var r,c,l;const i={},o=((r=e==null?void 0:e.data)==null?void 0:r.state)||{};return(l=(c=e==null?void 0:e.data)==null?void 0:c.inputs)==null||l.forEach(s=>{s.name&&s.defaultValue!==void 0&&(i[s.name]=s.defaultValue)}),{...i,...o,...t,...n?{locale:n}:{}}},nn=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function se(e){var o,r,c,l,s,d,f,m,g;const t=Lt({variationId:(o=e.content)==null?void 0:o.testVariationId,contentId:(r=e.content)==null?void 0:r.id}),n=[...ae(),...e.customComponents||[]].reduce((C,{component:T,...S})=>({...C,[S.name]:{component:T,...u.serializeComponentInfo(S)}}),{}),i={content:nn({content:e.content,data:e.data}),localState:void 0,rootState:tn({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...ae(),...e.customComponents||[]].reduce((C,{component:T,...S})=>({...C,[S.name]:u.serializeComponentInfo(S)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}};return a.jsxs(Zt,{content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:i,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts,children:[e.isSsrAbTest?a.jsx(Y,{id:"builderio-variant-visibility",scriptStr:t}):null,a.jsx(en,{isNestedRender:e.isNestedRender,contentId:(c=i.content)==null?void 0:c.id,cssCode:(s=(l=i.content)==null?void 0:l.data)==null?void 0:s.cssCode,customFonts:(f=(d=i.content)==null?void 0:d.data)==null?void 0:f.customFonts}),a.jsx(_,{blocks:(g=(m=i.content)==null?void 0:m.data)==null?void 0:g.blocks,context:i,registeredComponents:n,linkComponent:e.linkComponent})]})}function Ee(e){var r;const t=Nt({canTrack:u.getDefaultCanTrack(e.canTrack),content:e.content}),n=function(){var l;return $t(O(e.content).map(s=>({id:s.testVariationId,testRatio:s.testRatio})),((l=e.content)==null?void 0:l.id)||"")},i=function(){return O(e.content).map(l=>`.variant-${l.testVariationId} { display: none; } `).join("")},o=function(){var l;return t?{...e.content,testVariationId:(l=e.content)==null?void 0:l.id}:u.handleABTestingSync({item:e.content,canTrack:u.getDefaultCanTrack(e.canTrack)})};return a.jsxs(a.Fragment,{children:[!e.isNestedRender&&u.TARGET!=="reactNative"?a.jsx(Y,{id:"builderio-init-variants-fns",scriptStr:Ft()}):null,t?a.jsxs(a.Fragment,{children:[a.jsx(M,{id:"builderio-variants",styles:i()}),a.jsx(Y,{id:"builderio-variants-visibility",scriptStr:n()}),(r=O(e.content))==null?void 0:r.map(c=>a.jsx(se,{isNestedRender:e.isNestedRender,content:c,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},c.testVariationId))]}):null,a.jsx(se,{isNestedRender:e.isNestedRender,content:o(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const on=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return u.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{u.logger.error("Could not fetch symbol content: ",n)})};async function Re(e){var r,c,l,s,d;const t=function(){return"div"},n=function(){return"div"},i=function(){var m,g;return[e.attributes[F()],"builder-symbol",(m=e.symbol)!=null&&m.inline?"builder-inline-symbol":void 0,(g=e.symbol)!=null&&g.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},o=((r=e.symbol)==null?void 0:r.content)||await on({symbol:e.symbol,builderContextValue:e.builderContext});return a.jsx("div",{...e.attributes,className:i(),children:a.jsx(Ee,{isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(c=e.builderBlock)==null?void 0:c.id},customComponents:Object.values(e.builderComponents),data:{...(l=e.symbol)==null?void 0:l.data,...e.builderContext.localState,...(s=o==null?void 0:o.data)==null?void 0:s.state},canTrack:e.builderContext.canTrack,model:(d=e.symbol)==null?void 0:d.model,content:o,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:n()})})}exports.Blocks=_;exports.BuilderContext=Te;exports.Button=de;exports.Columns=xe;exports.Content=Ee;exports.Fragment=ye;exports.Image=Se;exports.Section=pe;exports.Symbol=Re;exports.Text=ve;exports.Video=ke;
|