@builder.io/sdk-react 2.0.2-0 → 2.0.2-2
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 +24 -24
- package/lib/browser/blocks-exports.mjs +326 -303
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/init.cjs +1 -1
- package/lib/browser/init.mjs +1 -1
- package/lib/browser/{server-entry-45c77a86.js → server-entry-441053ba.js} +3 -3
- package/lib/browser/{server-entry-69a4d3c9.cjs → server-entry-56e8004a.cjs} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-ddf18178.js → accordion-24b26431.js} +1 -1
- package/lib/edge/{accordion-7896cae6.cjs → accordion-f87e2b96.cjs} +1 -1
- package/lib/edge/{blocks-ab38d130.js → blocks-53095100.js} +460 -437
- package/lib/edge/{blocks-32559998.cjs → blocks-802e3770.cjs} +13 -13
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-cba5f3f8.js → button-73485ccc.js} +2 -2
- package/lib/edge/{button-91e0aec2.cjs → button-b0f515b1.cjs} +1 -1
- package/lib/edge/{columns-fef78a25.cjs → columns-1f80b3f3.cjs} +1 -1
- package/lib/edge/{columns-d0c6c772.js → columns-405f1d21.js} +3 -3
- package/lib/edge/{content-variants-95b6e700.js → content-variants-579677ec.js} +10 -10
- package/lib/edge/{content-variants-ccd386ed.cjs → content-variants-f380acc1.cjs} +1 -1
- package/lib/edge/{form-a156cc1d.cjs → form-2862b060.cjs} +1 -1
- package/lib/edge/{form-d460bf8a.js → form-c2684aa9.js} +3 -3
- package/lib/edge/{get-class-prop-name-237cd359.cjs → get-class-prop-name-2d695e7d.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-1928cf9f.js → get-class-prop-name-ade06415.js} +1 -1
- package/lib/edge/{img-86db320f.cjs → img-29a47783.cjs} +1 -1
- package/lib/edge/{img-f9ec8689.js → img-a605abb9.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/init.cjs +1 -1
- package/lib/edge/init.mjs +1 -1
- package/lib/edge/{input-394e72b8.js → input-24ab9912.js} +1 -1
- package/lib/edge/{input-953ef2fe.cjs → input-afb0eaae.cjs} +1 -1
- package/lib/edge/{select-9bb6b8c1.cjs → select-542f9b0e.cjs} +1 -1
- package/lib/edge/{select-3e25848f.js → select-b7b61dde.js} +1 -1
- package/lib/edge/{server-entry-771d1637.js → server-entry-042bd6f0.js} +1 -1
- package/lib/edge/{server-entry-6bd1c4bc.cjs → server-entry-b32a9c32.cjs} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-5441ba3a.cjs → slot-19716d77.cjs} +1 -1
- package/lib/edge/{slot-dea3a8f3.js → slot-d08698a2.js} +3 -3
- package/lib/edge/{symbol-faa97614.js → symbol-9aaa9700.js} +2 -2
- package/lib/edge/{symbol-58595a6d.cjs → symbol-be4081db.cjs} +1 -1
- package/lib/edge/{tabs-0240dafd.cjs → tabs-4cb2e700.cjs} +1 -1
- package/lib/edge/{tabs-8a95f30b.js → tabs-e32544a6.js} +3 -3
- package/lib/node/blocks-exports.cjs +24 -24
- package/lib/node/blocks-exports.mjs +307 -284
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +2 -2
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +2 -2
- package/lib/node/{node-runtime-55fc8cd4.cjs → node-runtime-9af386e9.cjs} +1 -1
- package/lib/node/{node-runtime-46d21495.js → node-runtime-df1706b0.js} +1 -1
- package/lib/node/{server-entry-11eee7d8.cjs → server-entry-1224f4f2.cjs} +1 -1
- package/lib/node/{server-entry-d45c1bf6.js → server-entry-f7ab9ed1.js} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/get-processed-block.d.ts +1 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use client";"use strict";var
|
|
1
|
+
"use client";"use strict";var We=Object.defineProperty;var $e=(e,t,n)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var G=(e,t,n)=>($e(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),x=require("./server-entry-1224f4f2.cjs"),h=require("react"),L=require("./node-runtime-9af386e9.cjs"),De=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Le=e=>typeof e=="string"&&De.has(e.toLowerCase());function ie(e){return a.jsx(a.Fragment,{children:Le(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 M=()=>{switch(x.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":case"angular":return"class"}};function fe(e){function t(){return{...e.attributes,[M()]:`${e.link?"":"builder-button"} ${e.attributes[M()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}}}return a.jsx(ie,{attributes:t(),TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}const _=h.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{},nonce:""}),he=h.createContext({registeredComponents:{}});function Oe(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options}}function Me(e,...t){const n=Object.assign({},e);for(const i of t)delete n[i];return n}const Ue=({code:e,builder:t,context:n,event:i,localState:o,rootSetState:r,rootState:l})=>{const s=L.getFunctionArguments({builder:t,context:n,event:i,state:ge({rootState:l,localState:o,rootSetState:r})});return new Function(...s.map(([d])=>d),e)(...s.map(([,d])=>d))};function ge({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?ge({rootState:r,localState:void 0,rootSetState:n?l=>{i[o]=l,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 He(){var e;return typeof process!="undefined"&&x.checkIsDefined((e=process==null?void 0:process.versions)==null?void 0:e.node)}const qe=()=>{var i;if(!He())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?(x.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},Ke=e=>x.isBrowser()||qe()?Ue(e):L.runInNode(e),N=class N{static getCacheKey(t){return JSON.stringify({...t,event:t.event?Math.random():void 0})}static getCachedValue(t){return N.cache.get(t)}static setCachedValue(t,n){N.cache.size>20&&N.cache.delete(N.cache.keys().next().value),N.cache.set(t,{value:n})}};G(N,"cacheLimit",20),G(N,"cache",new Map);let D=N;function U({code:e,context:t,localState:n,rootState:i,rootSetState:o,event:r,isExpression:l=!0,enableCache:s}){if(e==="")return;const d={code:L.parseCode(e,{isExpression:l}),builder:L.getBuilderGlobals(),context:t,event:r,rootSetState:o,rootState:i,localState:n};if(s){const c=D.getCacheKey(d),m=D.getCachedValue(c);if(m)return m.value}try{const c=Ke(d);if(s){const m=D.getCacheKey(d);D.setCachedValue(m,c)}return c}catch(c){x.logger.error("Failed code evaluation: "+c.message,{code:e});return}}function te(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>te(n));if(e["@type"]==="@builder.io/sdk:Element")return e;const t={};for(const n in e)n!=="meta"&&Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=te(e[n]));return t}const _e=({block:e,context:t,localState:n,rootState:i,rootSetState:o})=>{if(!e.bindings)return e;const r=te(Me(e,"children","meta")),l={...r,properties:{...r.properties},actions:{...r.actions},children:e.children,meta:e.meta};for(const s in e.bindings){const d=e.bindings[s],c=U({code:d,localState:n,rootState:i,rootSetState:o,context:t,enableCache:typeof window=="undefined"});L.set(l,s,c)}return l};function ze({block:e,context:t,shouldEvaluateBindings:n,localState:i,rootState:o,rootSetState:r}){const l=e;return n?_e({block:l,localState:i,rootState:o,rootSetState:r,context:t}):l}const z=e=>e?e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase():"";function Je(e,t,n={}){let i,o,r,l=null,s=0;const d=function(){s=n.leading===!1?0:Date.now(),l=null,r=e.apply(i,o),l||(i=o=null)};return function(){const c=Date.now();!s&&n.leading===!1&&(s=c);const m=t-(c-s);return i=this,o=arguments,m<=0||m>t?(l&&(clearTimeout(l),l=null),s=c,r=e.apply(i,o),l||(i=o=null)):!l&&n.trailing!==!1&&(l=setTimeout(d,m)),r}}function O(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 Ge(e){for(const t of e)switch(t.trigger){case"pageLoad":xe(t);break;case"scrollInView":Qe(t);break}}function be(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function pe(e,t){const n=Ye(e),i=getComputedStyle(t),o=e.steps[0].styles,r=e.steps[e.steps.length-1].styles,l=[o,r];for(const s of l)for(const d of n)d in s||(s[d]=i[d])}function Ye(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 xe(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){be(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{pe(e,n),n.style.transition="none",n.style.transitionDelay="0",O(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${z(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),O(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}function Qe(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){be(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{pe(e,n);let i=!1,o=!1;function r(){!i&&s(n)?(i=!0,o=!0,setTimeout(()=>{O(n.style,e.steps[1].styles),e.repeat||document.removeEventListener("scroll",l),setTimeout(()=>{o=!1,e.repeat||(n.style.transition="",n.style.transitionDelay="")},(e.duration+(e.delay||0))*1e3+100)})):e.repeat&&i&&!o&&!s(n)&&(i=!1,O(n.style,e.steps[0].styles))}const l=Je(r,200,{leading:!1});function s(m){const g=m.getBoundingClientRect(),f=window.innerHeight,b=(e.thresholdPercent||0)/100*f;return g.bottom>b&&g.top<f-b}const d=e.steps[0].styles;function c(){O(n.style,d)}c(),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${z(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")}),document.addEventListener("scroll",l,{capture:!0,passive:!0}),r()})}const ye=e=>Object.entries(e).map(([n,i])=>{if(typeof i=="string")return`${z(n)}: ${i};`}).filter(x.checkIsDefined),Xe=e=>ye(e).join(`
|
|
2
2
|
`),q=({mediaQuery:e,className:t,styles:n})=>{const i=`.${t} {
|
|
3
|
-
${
|
|
3
|
+
${Xe(n)}
|
|
4
4
|
}`;return e?`${e} {
|
|
5
5
|
${i}
|
|
6
|
-
}`:i};function
|
|
6
|
+
}`:i};function Ze({style:e}){return e}const et=({block:e,context:t})=>ve(Ze({style:e.style||{},context:t,block:e}));function ve(e){switch(x.TARGET){case"svelte":case"vue":case"solid":case"angular":return ye(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const tt=({block:e,registeredComponents:t})=>{var o;const n=(o=e.component)==null?void 0:o.name;if(!n)return null;const i=t[n];if(i)return i;console.warn(`
|
|
7
7
|
Could not find a registered component named "${n}".
|
|
8
|
-
If you registered it, is the file that registered it imported by the file that needs to render it?`)},
|
|
8
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`)},nt=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const o=U({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(),l=n.itemName||(r?r+"Item":"item");return o.map((d,c)=>({context:{...t,localState:{...t.localState,$index:c,$item:d,[l]:d,[`$${l}Index`]:c}},block:i}))},it=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderLinkComponent?{builderLinkComponent:t}:{}},ot=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderComponents?{builderComponents:t}:{}},at=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderBlock?{builderBlock:t}:{}},rt=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderContext?{builderContext:t}:{}},Se={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},ae=(e,t=Se)=>`@media (max-width: ${t[e].max}px)`,ke=({small:e,medium:t})=>{const n=x.fastClone(Se);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 J(e){return a.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id,nonce:e.nonce})}function lt(e){function t(){const i=e.block;return x.checkIsDefined(i.hide)?!i.hide:x.checkIsDefined(i.show)?i.show:!0}function n(){var v,R,j;const i=e.block,o=i.responsiveStyles,r=e.context.content,l=ke(((v=r==null?void 0:r.meta)==null?void 0:v.breakpoints)||{}),s=o==null?void 0:o.large,d=o==null?void 0:o.medium,c=o==null?void 0:o.small,m=i.id;if(!m)return"";const g=s?q({className:m,styles:s}):"",f=d?q({className:m,styles:d,mediaQuery:ae("medium",l)}):"",u=c?q({className:m,styles:c,mediaQuery:ae("small",l)}):"",b=i.animations&&i.animations.find(B=>B.trigger==="hover");let S="";if(b){const B=((j=(R=b.steps)==null?void 0:R[1])==null?void 0:j.styles)||{};S=q({className:`${m}:hover`,styles:{...B,transition:`all ${b.duration}s ${z(b.easing)}`,transitionDelay:b.delay?`${b.delay}s`:"0s"}})||""}return[g,f,u,S].join(" ")}return a.jsx(a.Fragment,{children:n()&&t()?a.jsx(a.Fragment,{children:a.jsx(J,{id:"builderio-block",styles:n(),nonce:e.context.nonce})}):null})}function st(e){return e.charAt(0).toUpperCase()+e.slice(1)}const ct=e=>`on${st(e)}`,dt=(e,t)=>n=>U({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1,enableCache:!0});function Ce(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 l=ct(o);if(e.stripPrefix)switch(x.TARGET){case"vue":l=l.replace("v-on:","");break;case"svelte":l=l.replace("on:","");break}t[l]=dt(r,e)}return t}function ut({properties:e}){return e}const mt=e=>({href:e.href});function oe({block:e,context:t}){var i;const n={...mt(e),...e.properties,"builder-id":e.id,style:et({block:e,context:t}),[M()]:[e.id,"builder-block",e.class,(i=e.properties)==null?void 0:i.class].filter(Boolean).join(" ")};return ut({properties:n,context:t,block:e})}function ft(e){return a.jsx(ie,{TagName:e.Wrapper,attributes:oe({block:e.block,context:e.context}),actionAttributes:Ce({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 ht(e){function t(){return e.includeBlockProps?{...oe({block:e.block,context:e.context}),...Ce({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 gt=({componentOptions:e,builderBlock:t,context:n,componentRef:i,includeBlockProps:o,isInteractive:r,contextValue:l})=>{const s={...e,...o?{attributes:oe({block:t,context:l})}:{}};return r?{Wrapper:i,block:t,context:n,wrapperProps:e,includeBlockProps:o}:s};function re(e){var i;const[t,n]=h.useState(()=>e.isInteractive?ht:e.componentRef);return a.jsx(a.Fragment,{children:e.componentRef?a.jsx(a.Fragment,{children:a.jsx(t,{...gt({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:(i=e.blockChildren)==null?void 0:i.map(o=>a.jsx(H,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}function bt(e){const[t,n]=h.useState(()=>e.repeatContext);return a.jsx(_.Provider,{value:t,children:a.jsx(H,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})})}function H(e){var m,g,f;function t(){return tt({block:r(),context:e.context,registeredComponents:e.registeredComponents})}function n(){return nt({block:e.block,context:e.context})}const[i,o]=h.useState(()=>({value:null,update:!1}));function r(){var b;if(i.value&&!i.update&&!x.isPreviewing())return i.value;const u=(b=e.block.repeat)!=null&&b.collection?e.block:ze({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return i.value=u,i.update=!1,u}function l(){var b;return e.block.tagName==="a"||((b=r().properties)==null?void 0:b.href)||r().href?e.linkComponent||"a":e.block.tagName||"div"}function s(){var S,v;if((S=e.block.repeat)!=null&&S.collection)return!!((v=n==null?void 0:n())!=null&&v.length);const u="hide"in r()?r().hide:!1;return("show"in r()?r().show:!0)&&!u}function d(){var b,S;return!((b=t==null?void 0:t())!=null&&b.component)&&!n()?(S=r().children)!=null?S:[]:[]}function c(){var u,b,S,v;return{blockChildren:(u=r().children)!=null?u:[],componentRef:(b=t==null?void 0:t())==null?void 0:b.component,componentOptions:{...Oe(r()),...at(t(),r()),...rt(t(),e.context),...it(t(),e.linkComponent),...ot(t(),e.registeredComponents)},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:r(),includeBlockProps:((S=t==null?void 0:t())==null?void 0:S.noWrap)===!0,isInteractive:!((v=t==null?void 0:t())!=null&&v.isRSC)}}return h.useEffect(()=>{const u=r().id,b=r().animations;b&&u&&Ge(b.map(S=>({...S,elementId:u})))},[]),h.useEffect(()=>{i.update=!0}),a.jsx(a.Fragment,{children:s()?a.jsxs(a.Fragment,{children:[a.jsx(lt,{block:r(),context:e.context}),(m=t==null?void 0:t())!=null&&m.noWrap?a.jsx(a.Fragment,{children:a.jsx(re,{componentRef:c().componentRef,componentOptions:c().componentOptions,blockChildren:c().blockChildren,context:c().context,registeredComponents:c().registeredComponents,linkComponent:c().linkComponent,builderBlock:c().builderBlock,includeBlockProps:c().includeBlockProps,isInteractive:c().isInteractive})}):a.jsx(a.Fragment,{children:n()?a.jsx(a.Fragment,{children:(f=n())==null?void 0:f.map((u,b)=>a.jsx(bt,{repeatContext:u.context,block:u.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},b))}):a.jsxs(ft,{Wrapper:l(),block:r(),context:e.context,children:[a.jsx(re,{componentRef:c().componentRef,componentOptions:c().componentOptions,blockChildren:c().blockChildren,context:c().context,registeredComponents:c().registeredComponents,linkComponent:c().linkComponent,builderBlock:c().builderBlock,includeBlockProps:c().includeBlockProps,isInteractive:c().isInteractive}),(g=d())==null?void 0:g.map(u=>a.jsx(H,{block:u,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},u.id))]})})]}):null})}function pt(e){function t(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function n(){var o,r;x.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;x.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
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
align-items: stretch;
|
|
12
|
-
}`})]})}function A(e){var i,o,r;const t=h.useContext(_),n=h.useContext(
|
|
12
|
+
}`})]})}function A(e){var i,o,r;const t=h.useContext(_),n=h.useContext(he);return a.jsx(pt,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,BlocksWrapper:((i=e.context)==null?void 0:i.BlocksWrapper)||t.BlocksWrapper,BlocksWrapperProps:((o=e.context)==null?void 0:o.BlocksWrapperProps)||t.BlocksWrapperProps,children:e.blocks?a.jsx(a.Fragment,{children:(r=e.blocks)==null?void 0:r.map(l=>a.jsx(H,{block:l,linkComponent:e.linkComponent,context:e.context||t,registeredComponents:e.registeredComponents||n.registeredComponents},l.id))}):null})}const xt=e=>`builder-columns ${e}-breakpoints`;function Te(e){var B,W;const[t,n]=h.useState(()=>typeof e.space=="number"?e.space||0:20),[i,o]=h.useState(()=>e.columns||[]),[r,l]=h.useState(()=>e.stackColumnsAt||"tablet");function s(T){return T.link?e.builderLinkComponent||"a":"div"}function d(T){var E;return((E=i[T])==null?void 0:E.width)||100/i.length}function c(T){const E=d(T),P=t*(i.length-1)*(E/100);return`calc(${E}% - ${P}px)`}function m({stackedStyle:T,desktopStyle:E}){return r==="tablet"?T:E}function g({stackedStyle:T,desktopStyle:E}){return r==="never"?E:T}const[f,u]=h.useState(()=>e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column");function b(){return{"--flex-dir":f,"--flex-dir-tablet":m({stackedStyle:f,desktopStyle:"row"})}}function S(T){const E=T===0?0:t,P=c(T),y=`${E}px`,p="100%",k=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:P,["marginLeft"]:y,"--column-width-mobile":g({stackedStyle:p,desktopStyle:P}),"--column-margin-left-mobile":g({stackedStyle:k,desktopStyle:y}),"--column-width-tablet":m({stackedStyle:p,desktopStyle:P}),"--column-margin-left-tablet":m({stackedStyle:k,desktopStyle:y})}}function v(T){var P,y;return ke(((y=(P=e.builderContext.content)==null?void 0:P.meta)==null?void 0:y.breakpoints)||{})[T].max}function R(){return`
|
|
13
13
|
@media (max-width: ${v("medium")}px) {
|
|
14
14
|
.${e.builderBlock.id}-breakpoints {
|
|
15
15
|
flex-direction: var(--flex-dir-tablet);
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
`}function j(T,E){return{...T.link?{href:T.link}:{},[M()]:"builder-column",style:
|
|
36
|
+
`}function j(T,E){return{...T.link?{href:T.link}:{},[M()]:"builder-column",style:ve(S(E))}}return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:xt((B=e.builderBlock)==null?void 0:B.id)+" div-fe220f58",style:b(),children:[a.jsx(J,{id:"builderio-columns",styles:R(),nonce:e.builderContext.nonce}),(W=e.columns)==null?void 0:W.map((T,E)=>a.jsx(ie,{TagName:s(T),actionAttributes:{},attributes:j(T,E),children:a.jsx(A,{path:`component.options.columns.${E}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:T.blocks})},E))]}),a.jsx("style",{children:`.div-fe220f58 {
|
|
37
37
|
display: flex;
|
|
38
38
|
line-height: normal;
|
|
39
|
-
}`})]})}function
|
|
39
|
+
}`})]})}function Ie(e){return a.jsx("span",{children:e.children})}function le(e){return e.replace(/http(s)?:/,"")}function yt(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 vt(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return le(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 le(`${i[0]}_${r}${o}`)}return null}function Y(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=>`${yt(e,"width",o)} ${o}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[vt(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,i])=>`${n} ${i}w`).concat([e]).join(", "):e}function we(e){var o,r,l,s,d,c;function t(){var f;const g=e.image||e.src;if(!g||!(g.match(/builder\.io/)||g.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((f=e.image)!=null&&f.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),Y(g)}else if(e.image&&!e.srcset)return Y(g);return Y(g)}function n(){var m;return(m=t==null?void 0:t())!=null&&m.match(/builder\.io/)&&!e.noWebp?t().replace(/\?/g,"?format=webp&"):""}function i(){const m={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?m: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,(s=(l=e.builderBlock)==null?void 0:l.children)!=null&&s.length&&e.fitContent?a.jsx(a.Fragment,{children:e.children}):null,!e.fitContent&&((c=(d=e.builderBlock)==null?void 0:d.children)!=null&&c.length)?a.jsx("div",{className:"div-ac3dff4a-2",children:e.children}):null]}),a.jsx("style",{children:`.img-ac3dff4a {
|
|
40
40
|
opacity: 1;
|
|
41
41
|
transition: opacity 0.2s ease-in-out;
|
|
42
42
|
}.div-ac3dff4a {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
left: 0;
|
|
53
53
|
width: 100%;
|
|
54
54
|
height: 100%;
|
|
55
|
-
}`})]})}function we(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 Q={"@type":"@builder.io/sdk:Element",layerName:"Accordion item title",responsiveStyles:{large:{marginTop:"10px",position:"relative",display:"flex",alignItems:"stretch",flexDirection:"column",paddingBottom:"10px"}},children:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"left",display:"flex",flexDirection:"column"}},component:{name:"Text",options:{text:"I am an accordion title. Click me!"}}}]},X={"@type":"@builder.io/sdk:Element",layerName:"Accordion item detail",responsiveStyles:{large:{position:"relative",display:"flex",alignItems:"stretch",flexDirection:"column",marginTop:"10px",paddingBottom:"10px"}},children:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{paddingTop:"50px",textAlign:"left",display:"flex",flexDirection:"column",paddingBottom:"50px"}},component:{name:"Text",options:{text:"I am an accordion detail, hello!"}}}]},yt={name:"Builder:Accordion",canHaveChildren:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",defaultStyles:{display:"flex",flexDirection:"column",alignItems:"stretch"},inputs:[{name:"items",type:"list",broadcast:!0,subFields:[{name:"title",type:"uiBlocks",hideFromUI:!0,defaultValue:[Q]},{name:"detail",type:"uiBlocks",hideFromUI:!0,defaultValue:[X]}],defaultValue:[{title:[Q],detail:[X]},{title:[Q],detail:[X]}],showIf:e=>!e.get("useChildrenForItems")},{name:"oneAtATime",helperText:"Only allow opening one at a time (collapse all others when new item openned)",type:"boolean",defaultValue:!1},{name:"grid",helperText:"Display as a grid",type:"boolean",defaultValue:!1},{name:"gridRowWidth",helperText:"Display as a grid",type:"string",showIf:e=>e.get("grid"),defaultValue:"25%"},{name:"useChildrenForItems",type:"boolean",helperText:"Use child elements for each slide, instead of the array. Useful for dynamically repeating items",advanced:!0,defaultValue:!1,onChange:e=>{e.get("useChildrenForItems")===!0&&e.set("items",[])}}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},le=e=>e.toString();function vt(e){var g;const[t,n]=h.useState(()=>[]);function i(){return!!(e.grid||e.oneAtATime)}function o(){return{display:"flex",alignItems:"stretch",flexDirection:"column",...e.grid&&{flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap"}}}function r(){const u={...{display:"flex",flexDirection:"column"},alignItems:"stretch",cursor:"pointer"};return Object.fromEntries(Object.entries(u).filter(([b,S])=>S!==void 0))}function l(f){return`builder-accordion-title builder-accordion-title-${t.includes(f)?"open":"closed"}`}function s(f){return`builder-accordion-detail builder-accordion-detail-${t.includes(f)?"open":"closed"}`}function d(){let f=null;if(e.grid&&t.length&&document){const b=t[0];let v=document.querySelector(`.builder-accordion-title[data-index="${b}"]`);if(f=b,v){let R=v.getBoundingClientRect();for(;v=v&&v.nextElementSibling;)if(v){if(v.classList.contains("builder-accordion-detail"))continue;const j=v.getBoundingClientRect();if(j.left>R.left){const B=parseInt(v.getAttribute("data-index")||"",10);isNaN(B)||(R=j,f=B)}else break}}}return typeof f=="number"&&(f=f+1),f}function c(){const f={order:typeof d()=="number"?d():void 0,...e.grid&&{width:"100%"}};return Object.fromEntries(Object.entries(f).filter(([u,b])=>b!==void 0))}function m(f){t.includes(f)?n(i()?[]:t.filter(u=>u!==f)):n(i()?[f]:t.concat(f))}return a.jsx("div",{className:"builder-accordion",style:o(),children:(g=e.items)==null?void 0:g.map((f,u)=>a.jsxs(a.Fragment,{children:[a.jsx("div",{className:l(u),style:{...r(),width:e.grid?e.gridRowWidth:void 0,order:d()!==null?le(u):le(u+1)},"data-index":u,onClick:b=>m(u),children:a.jsx(A,{blocks:f.title,path:`items.${u}.title`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}),t.includes(u)?a.jsx("div",{className:s(u),style:c(),children:a.jsx(A,{blocks:f.detail,path:`items.${u}.detail`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]}))})}const St={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,shouldReceiveBuilderProps:{builderLinkComponent:!0}},kt={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((s,d)=>s+d.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}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},Ct={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},Tt={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(l,s=6e4){return new Promise((d,c)=>{const m=document.createElement("img");let g=!1;m.onload=()=>{g=!0,d(m)},m.addEventListener("error",f=>{console.warn("Image load failed",f.error),c(f.error)}),m.src=l,setTimeout(()=>{g||c(new Error("Image load timed out"))},s)})}function i(l){return Math.round(l*1e3)/1e3}const o=e.get("image"),r=e.get("aspectRatio");if(fetch(o).then(l=>l.blob()).then(l=>{l.type.includes("svg")&&e.set("noWebp",!0)}),o&&(!r||r===.7041))return n(o).then(l=>{const s=e.get("aspectRatio");e.get("image")===o&&(!s||s===.7041)&&l.width&&l.height&&(e.set("aspectRatio",i(l.height/l.width)),e.set("height",l.height),e.set("width",l.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}],shouldReceiveBuilderProps:{builderBlock:!0}},It={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>"}}}]},wt={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"}],shouldReceiveBuilderProps:{builderContext:!0}};function Et(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(A,{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 Rt={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"}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},Z={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"10px",paddingBottom:"10px",minWidth:"100px",textAlign:"center",display:"flex",flexDirection:"column",cursor:"pointer",userSelect:"none"}},component:{name:"Text",options:{text:"New tab"}}},ee={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{height:"200px",display:"flex",marginTop:"20px",flexDirection:"column"}},component:{name:"Text",options:{text:"New tab content "}}},jt={name:"Builder: Tabs",inputs:[{name:"tabs",type:"list",broadcast:!0,subFields:[{name:"label",type:"uiBlocks",hideFromUI:!0,defaultValue:[Z]},{name:"content",type:"uiBlocks",hideFromUI:!0,defaultValue:[ee]}],defaultValue:[{label:[{...Z,component:{name:"Text",options:{text:"Tab 1"}}}],content:[{...ee,component:{name:"Text",options:{text:"Tab 1 content"}}}]},{label:[{...Z,component:{name:"Text",options:{text:"Tab 2"}}}],content:[{...ee,component:{name:"Text",options:{text:"Tab 2 content"}}}]}]},{name:"activeTabStyle",type:"uiStyle",helperText:"CSS styles for the active tab",defaultValue:{backgroundColor:"rgba(0, 0, 0, 0.1)"}},{name:"defaultActiveTab",type:"number",helperText:'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',defaultValue:1,advanced:!0},{name:"collapsible",type:"boolean",helperText:"If on, clicking an open tab closes it so no tabs are active",defaultValue:!1,advanced:!0},{name:"tabHeaderLayout",type:"enum",helperText:"Change the layout of the tab headers (uses justify-content)",defaultValue:"flex-start",enum:[{label:"Center",value:"center"},{label:"Space between",value:"space-between"},{label:"Space around",value:"space-around"},{label:"Left",value:"flex-start"},{label:"Right",value:"flex-end"}]}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}};function Bt(e){var r;const[t,n]=h.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function i(l){return e.tabs&&e.tabs[l].content}function o(l){l===t&&e.collapsible?n(-1):n(l)}return a.jsxs("div",{children:[a.jsx("div",{className:"builder-tabs-wrap",style:{display:"flex",flexDirection:"row",justifyContent:e.tabHeaderLayout||"flex-start",overflow:"auto"},children:(r=e.tabs)==null?void 0:r.map((l,s)=>a.jsx("span",{className:`builder-tab-wrap ${t===s?"builder-tab-active":""}`,style:{...t===s?e.activeTabStyle:{}},onClick:d=>o(s),children:a.jsx(A,{parent:e.builderBlock.id,path:`component.options.tabs.${s}.label`,blocks:l.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},s))}),i(t)?a.jsx("div",{children:a.jsx(A,{parent:e.builderBlock.id,path:`component.options.tabs.${t}.content`,blocks:i(t),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}const Pt={shouldReceiveBuilderProps:{builderBlock:!1},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 Ee(e){var t;return a.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const Vt={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 Ft(e){const t=h.useRef(null),[n,i]=h.useState(()=>[]),[o,r]=h.useState(()=>[]);return h.useEffect(()=>{var s;if(!((s=t.current)!=null&&s.getElementsByTagName)||typeof window=="undefined")return;const l=t.current.getElementsByTagName("script");for(let d=0;d<l.length;d++){const c=l[d];if(c.src){if(n.includes(c.src))continue;n.push(c.src);const m=document.createElement("script");m.async=!0,m.src=c.src,document.head.appendChild(m)}else if(!c.type||["text/javascript","application/javascript","application/ecmascript"].includes(c.type)){if(o.includes(c.innerText))continue;try{o.push(c.innerText),new Function(c.innerText)()}catch(m){console.warn("`CustomCode`: Error running script:",m)}}}},[]),a.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const At={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc"},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},Nt=["text/javascript","application/javascript","application/ecmascript"],Wt=e=>Nt.includes(e.type);function $t(e){const t=h.useRef(null),[n,i]=h.useState(()=>[]),[o,r]=h.useState(()=>[]),[l,s]=h.useState(()=>!1);function d(){if(!t.current||!t.current.getElementsByTagName)return;const c=t.current.getElementsByTagName("script");for(let m=0;m<c.length;m++){const g=c[m];if(g.src&&!n.includes(g.src)){n.push(g.src);const f=document.createElement("script");f.async=!0,f.src=g.src,document.head.appendChild(f)}else if(Wt(g)&&!o.includes(g.innerText))try{o.push(g.innerText),new Function(g.innerText)()}catch(f){console.warn("`Embed`: Error running script:",f)}}}return h.useEffect(()=>{t.current&&!l&&(s(!0),d())},[t.current,l]),a.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const Dt={name:"Form:Form",defaults:{responsiveStyles:{large:{marginTop:"15px",paddingBottom:"15px"}}},image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",inputs:[{name:"sendSubmissionsTo",type:"string",enum:[{label:"Send to email",value:"email",helperText:"Send form submissions to the email address of your choosing"},{label:"Custom",value:"custom",helperText:"Handle where the form requests go manually with a little code, e.g. to your own custom backend"}],defaultValue:"email"},{name:"sendSubmissionsToEmail",type:"string",required:!0,defaultValue:"your@email.com",showIf:'options.get("sendSubmissionsTo") === "email"'},{name:"sendWithJs",type:"boolean",helperText:"Set to false to use basic html form action",defaultValue:!0,showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"name",type:"string",defaultValue:"My form"},{name:"action",type:"string",helperText:"URL to send the form data to",showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"contentType",type:"string",defaultValue:"application/json",advanced:!0,enum:["application/json","multipart/form-data","application/x-www-form-urlencoded"],showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'},{name:"method",type:"string",showIf:'options.get("sendSubmissionsTo") === "custom"',defaultValue:"POST",advanced:!0},{name:"previewState",type:"string",enum:["unsubmitted","sending","success","error"],defaultValue:"unsubmitted",helperText:'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"successUrl",type:"url",helperText:"Optional URL to redirect the user to on form submission success",showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"resetFormOnSubmit",type:"boolean",showIf:"options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",advanced:!0},{name:"successMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Thanks!</span>"}}}]},{name:"validate",type:"boolean",defaultValue:!0,advanced:!0},{name:"errorMessagePath",type:"text",advanced:!0,helperText:'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'},{name:"errorMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},bindings:{"component.options.text":"state.formErrorMessage || block.component.options.text"},component:{name:"Text",options:{text:"<span>Form submission error :( Please check your answers and try again</span>"}}}]},{name:"sendingMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Sending...</span>"}}}]},{name:"customHeaders",type:"map",valueType:{type:"string"},advanced:!0,showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'}],noWrap:!0,canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your name</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"name",placeholder:"Jane Doe"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your email</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"email",placeholder:"jane@doe.com"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:SubmitButton",options:{text:"Submit"}}}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},Lt=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],Ot=()=>{const e=process.env.NODE_ENV||"production";return Lt.includes(e)?e:"production"},Mt=(e,t,n)=>{const i=String.prototype.split.call(t,/[,[\].]+?/).filter(Boolean).reduce((o,r)=>o!=null?o[r]:o,e);return i===void 0||i===e?n:i};function Ut(e){var g,f;const t=h.useRef(null),[n,i]=h.useState(()=>"unsubmitted"),[o,r]=h.useState(()=>null),[l,s]=h.useState(()=>"");function d(u){var S,v;const b={...e.builderContext.rootState,...u};e.builderContext.rootSetState?(v=(S=e.builderContext).rootSetState)==null||v.call(S,b):e.builderContext.rootState=b}function c(){return x.isEditing()&&e.previewState||n}function m(u){var S;const b=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")u.preventDefault();else if(b){if(!(e.action||e.sendSubmissionsTo==="email")){u.preventDefault();return}u.preventDefault();const v=u.currentTarget||u.target,R=e.customHeaders||{};let j;const B=new FormData(v),W=Array.from(v.querySelectorAll("input,select,textarea")).filter(y=>!!y.name).map(y=>{let p;const k=y.name;if(y instanceof HTMLInputElement)if(y.type==="radio"){if(y.checked)return p=y.name,{key:k,value:p}}else if(y.type==="checkbox")p=y.checked;else if(y.type==="number"||y.type==="range"){const C=y.valueAsNumber;isNaN(C)||(p=C)}else y.type==="file"?p=y.files:p=y.value;else p=y.value;return{key:k,value:p}});let T=e.contentType;if(e.sendSubmissionsTo==="email"&&(T="multipart/form-data"),Array.from(W).forEach(({value:y})=>{(y instanceof File||Array.isArray(y)&&y[0]instanceof File||y instanceof FileList)&&(T="multipart/form-data")}),T!=="application/json")j=B;else{const y={};Array.from(W).forEach(({value:p,key:k})=>{L.set(y,k,p)}),j=JSON.stringify(y)}T&&T!=="multipart/form-data"&&(b&&((S=e.action)!=null&&S.includes("zapier.com"))||(R["content-type"]=T));const E=new CustomEvent("presubmit",{detail:{body:j}});if(t.current&&(t.current.dispatchEvent(E),E.defaultPrevented))return;i("sending");const P=`${Ot()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`;fetch(e.sendSubmissionsTo==="email"?P:e.action,{body:j,headers:R,method:e.method||"post"}).then(async y=>{let p;const k=y.headers.get("content-type");if(k&&k.indexOf("application/json")!==-1?p=await y.json():p=await y.text(),!y.ok&&e.errorMessagePath){let C=Mt(p,e.errorMessagePath);C&&(typeof C!="string"&&(C=JSON.stringify(C)),s(C),d({formErrorMessage:C}))}if(r(p),i(y.ok?"success":"error"),y.ok){const C=new CustomEvent("submit:success",{detail:{res:y,body:p}});if(t.current){if(t.current.dispatchEvent(C),C.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const I=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(I),I.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},y=>{const p=new CustomEvent("submit:error",{detail:{error:y}});t.current&&(t.current.dispatchEvent(p),p.defaultPrevented)||(r(y),i("error"))})}}return a.jsxs(a.Fragment,{children:[" ",a.jsxs("form",{validate:e.validate,ref:t,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:u=>m(u),...e.attributes,children:[e.builderBlock&&e.builderBlock.children?a.jsx(a.Fragment,{children:(f=(g=e.builderBlock)==null?void 0:g.children)==null?void 0:f.map((u,b)=>a.jsx(H,{block:u,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${b}`))}):null,c()==="error"?a.jsx(A,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,c()==="sending"?a.jsx(A,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,c()==="error"&&o?a.jsx("pre",{className:"builder-form-error-text pre-3a20f614",children:JSON.stringify(o,null,2)}):null,c()==="success"?a.jsx(A,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",a.jsx("style",{children:".pre-3a20f614 { padding: 10px; color: red; text-align: center; }"})," "]})}const Ht={name:"Form:Input",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",inputs:[{name:"type",type:"text",enum:["text","number","email","url","checkbox","radio","range","date","datetime-local","search","tel","time","file","month","week","password","color","hidden"],defaultValue:"text"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it takes, e.g. "email"'},{name:"placeholder",type:"string",defaultValue:"Hello there",helperText:"Text to display when there is no value"},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",helperText:"Is this input required to be filled out to submit a form",defaultValue:!1}],noWrap:!0,static:!0,defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"}};function qt(e){return h.createElement("input",{...e.attributes,key:x.isEditing()&&e.defaultValue?e.defaultValue:"default-key",placeholder:e.placeholder,type:e.type,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const Kt={name:"Form:Select",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",defaultStyles:{alignSelf:"flex-start"},inputs:[{name:"options",type:"list",required:!0,subFields:[{name:"value",type:"text",required:!0},{name:"name",type:"text"}],defaultValue:[{value:"option 1"},{value:"option 2"}]},{name:"name",type:"string",required:!0,helperText:'Every select in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",defaultValue:!1}],static:!0,noWrap:!0};function _t(e){var t;return h.createElement("select",{...e.attributes,value:e.value,key:x.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name,required:e.required},(t=e.options)==null?void 0:t.map((n,i)=>a.jsx("option",{value:n.value,children:n.name||n.value},`${n.name}-${i}`)))}const zt={name:"Form:SubmitButton",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#3898EC",color:"white",borderRadius:"4px",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me"}],static:!0,noWrap:!0};function Jt(e){return a.jsx("button",{type:"submit",...e.attributes,children:e.text})}const Gt={name:"Form:TextArea",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",inputs:[{advanced:!0,name:"value",type:"string"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"placeholder",type:"string",defaultValue:"Hello there"},{name:"required",type:"boolean",defaultValue:!1}],defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"},static:!0,noWrap:!0};function Yt(e){return a.jsx("textarea",{...e.attributes,placeholder:e.placeholder,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const Qt={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 Xt(e){return a.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},x.isEditing()&&e.imgSrc||"default-key")}const Zt={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}],shouldReceiveBuilderProps:{builderBlock:!0}};function Re(e){var i,o,r,l,s,d,c;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,(s=(l=e.builderBlock)==null?void 0:l.children)!=null&&s.length&&e.fitContent?a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(c=(d=e.builderBlock)==null?void 0:d.children)!=null&&c.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 en=()=>[{component:Ft,...Vt},{component:$t,...At},{component:Ut,...Dt},{component:qt,...Ht},{component:Jt,...zt},{component:_t,...Kt},{component:Yt,...Gt},{component:Xt,...Qt},{component:Re,...Zt}],se=()=>[{component:me,...St},{component:Ce,...kt},{component:Te,...Ct},{component:Ie,...Tt},{component:we,...It},{component:Et,...wt},{component:Fe,...Rt},{component:Ee,...Pt},{component:Bt,...jt},{component:vt,...yt},...en()],tn=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
55
|
+
}`})]})}function Ee(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 Q={"@type":"@builder.io/sdk:Element",layerName:"Accordion item title",responsiveStyles:{large:{marginTop:"10px",position:"relative",display:"flex",alignItems:"stretch",flexDirection:"column",paddingBottom:"10px"}},children:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"left",display:"flex",flexDirection:"column"}},component:{name:"Text",options:{text:"I am an accordion title. Click me!"}}}]},X={"@type":"@builder.io/sdk:Element",layerName:"Accordion item detail",responsiveStyles:{large:{position:"relative",display:"flex",alignItems:"stretch",flexDirection:"column",marginTop:"10px",paddingBottom:"10px"}},children:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{paddingTop:"50px",textAlign:"left",display:"flex",flexDirection:"column",paddingBottom:"50px"}},component:{name:"Text",options:{text:"I am an accordion detail, hello!"}}}]},St={name:"Builder:Accordion",canHaveChildren:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",defaultStyles:{display:"flex",flexDirection:"column",alignItems:"stretch"},inputs:[{name:"items",type:"list",broadcast:!0,subFields:[{name:"title",type:"uiBlocks",hideFromUI:!0,defaultValue:[Q]},{name:"detail",type:"uiBlocks",hideFromUI:!0,defaultValue:[X]}],defaultValue:[{title:[Q],detail:[X]},{title:[Q],detail:[X]}],showIf:e=>!e.get("useChildrenForItems")},{name:"oneAtATime",helperText:"Only allow opening one at a time (collapse all others when new item openned)",type:"boolean",defaultValue:!1},{name:"grid",helperText:"Display as a grid",type:"boolean",defaultValue:!1},{name:"gridRowWidth",helperText:"Display as a grid",type:"string",showIf:e=>e.get("grid"),defaultValue:"25%"},{name:"useChildrenForItems",type:"boolean",helperText:"Use child elements for each slide, instead of the array. Useful for dynamically repeating items",advanced:!0,defaultValue:!1,onChange:e=>{e.get("useChildrenForItems")===!0&&e.set("items",[])}}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},se=e=>e.toString();function kt(e){var g;const[t,n]=h.useState(()=>[]);function i(){return!!(e.grid||e.oneAtATime)}function o(){return{display:"flex",alignItems:"stretch",flexDirection:"column",...e.grid&&{flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap"}}}function r(){const u={...{display:"flex",flexDirection:"column"},alignItems:"stretch",cursor:"pointer"};return Object.fromEntries(Object.entries(u).filter(([b,S])=>S!==void 0))}function l(f){return`builder-accordion-title builder-accordion-title-${t.includes(f)?"open":"closed"}`}function s(f){return`builder-accordion-detail builder-accordion-detail-${t.includes(f)?"open":"closed"}`}function d(){let f=null;if(e.grid&&t.length&&document){const b=t[0];let v=document.querySelector(`.builder-accordion-title[data-index="${b}"]`);if(f=b,v){let R=v.getBoundingClientRect();for(;v=v&&v.nextElementSibling;)if(v){if(v.classList.contains("builder-accordion-detail"))continue;const j=v.getBoundingClientRect();if(j.left>R.left){const B=parseInt(v.getAttribute("data-index")||"",10);isNaN(B)||(R=j,f=B)}else break}}}return typeof f=="number"&&(f=f+1),f}function c(){const f={order:typeof d()=="number"?d():void 0,...e.grid&&{width:"100%"}};return Object.fromEntries(Object.entries(f).filter(([u,b])=>b!==void 0))}function m(f){t.includes(f)?n(i()?[]:t.filter(u=>u!==f)):n(i()?[f]:t.concat(f))}return a.jsx("div",{className:"builder-accordion",style:o(),children:(g=e.items)==null?void 0:g.map((f,u)=>a.jsxs(a.Fragment,{children:[a.jsx("div",{className:l(u),style:{...r(),width:e.grid?e.gridRowWidth:void 0,order:d()!==null?se(u):se(u+1)},"data-index":u,onClick:b=>m(u),children:a.jsx(A,{blocks:f.title,path:`items.${u}.title`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}),t.includes(u)?a.jsx("div",{className:s(u),style:c(),children:a.jsx(A,{blocks:f.detail,path:`items.${u}.detail`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]}))})}const Ct={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,shouldReceiveBuilderProps:{builderLinkComponent:!0}},Tt={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((s,d)=>s+d.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}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},It={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},wt={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(l,s=6e4){return new Promise((d,c)=>{const m=document.createElement("img");let g=!1;m.onload=()=>{g=!0,d(m)},m.addEventListener("error",f=>{console.warn("Image load failed",f.error),c(f.error)}),m.src=l,setTimeout(()=>{g||c(new Error("Image load timed out"))},s)})}function i(l){return Math.round(l*1e3)/1e3}const o=e.get("image"),r=e.get("aspectRatio");if(fetch(o).then(l=>l.blob()).then(l=>{l.type.includes("svg")&&e.set("noWebp",!0)}),o&&(!r||r===.7041))return n(o).then(l=>{const s=e.get("aspectRatio");e.get("image")===o&&(!s||s===.7041)&&l.width&&l.height&&(e.set("aspectRatio",i(l.height/l.width)),e.set("height",l.height),e.set("width",l.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}],shouldReceiveBuilderProps:{builderBlock:!0}},Et={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>"}}}]},Rt={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"}],shouldReceiveBuilderProps:{builderContext:!0}};function jt(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(A,{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 Bt={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"}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},Z={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"10px",paddingBottom:"10px",minWidth:"100px",textAlign:"center",display:"flex",flexDirection:"column",cursor:"pointer",userSelect:"none"}},component:{name:"Text",options:{text:"New tab"}}},ee={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{height:"200px",display:"flex",marginTop:"20px",flexDirection:"column"}},component:{name:"Text",options:{text:"New tab content "}}},Pt={name:"Builder: Tabs",inputs:[{name:"tabs",type:"list",broadcast:!0,subFields:[{name:"label",type:"uiBlocks",hideFromUI:!0,defaultValue:[Z]},{name:"content",type:"uiBlocks",hideFromUI:!0,defaultValue:[ee]}],defaultValue:[{label:[{...Z,component:{name:"Text",options:{text:"Tab 1"}}}],content:[{...ee,component:{name:"Text",options:{text:"Tab 1 content"}}}]},{label:[{...Z,component:{name:"Text",options:{text:"Tab 2"}}}],content:[{...ee,component:{name:"Text",options:{text:"Tab 2 content"}}}]}]},{name:"activeTabStyle",type:"uiStyle",helperText:"CSS styles for the active tab",defaultValue:{backgroundColor:"rgba(0, 0, 0, 0.1)"}},{name:"defaultActiveTab",type:"number",helperText:'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',defaultValue:1,advanced:!0},{name:"collapsible",type:"boolean",helperText:"If on, clicking an open tab closes it so no tabs are active",defaultValue:!1,advanced:!0},{name:"tabHeaderLayout",type:"enum",helperText:"Change the layout of the tab headers (uses justify-content)",defaultValue:"flex-start",enum:[{label:"Center",value:"center"},{label:"Space between",value:"space-between"},{label:"Space around",value:"space-around"},{label:"Left",value:"flex-start"},{label:"Right",value:"flex-end"}]}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}};function Vt(e){var r;const[t,n]=h.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function i(l){return e.tabs&&e.tabs[l].content}function o(l){l===t&&e.collapsible?n(-1):n(l)}return a.jsxs("div",{children:[a.jsx("div",{className:"builder-tabs-wrap",style:{display:"flex",flexDirection:"row",justifyContent:e.tabHeaderLayout||"flex-start",overflow:"auto"},children:(r=e.tabs)==null?void 0:r.map((l,s)=>a.jsx("span",{className:`builder-tab-wrap ${t===s?"builder-tab-active":""}`,style:{...t===s?e.activeTabStyle:{}},onClick:d=>o(s),children:a.jsx(A,{parent:e.builderBlock.id,path:`component.options.tabs.${s}.label`,blocks:l.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},s))}),i(t)?a.jsx("div",{children:a.jsx(A,{parent:e.builderBlock.id,path:`component.options.tabs.${t}.content`,blocks:i(t),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}const Ft={shouldReceiveBuilderProps:{builderBlock:!1},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 Re(e){var t;return a.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const At={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 Nt(e){const t=h.useRef(null),[n,i]=h.useState(()=>[]),[o,r]=h.useState(()=>[]);return h.useEffect(()=>{var s;if(!((s=t.current)!=null&&s.getElementsByTagName)||typeof window=="undefined")return;const l=t.current.getElementsByTagName("script");for(let d=0;d<l.length;d++){const c=l[d];if(c.src){if(n.includes(c.src))continue;n.push(c.src);const m=document.createElement("script");m.async=!0,m.src=c.src,document.head.appendChild(m)}else if(!c.type||["text/javascript","application/javascript","application/ecmascript"].includes(c.type)){if(o.includes(c.innerText))continue;try{o.push(c.innerText),new Function(c.innerText)()}catch(m){console.warn("`CustomCode`: Error running script:",m)}}}},[]),a.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const Wt={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc"},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},$t=["text/javascript","application/javascript","application/ecmascript"],Dt=e=>$t.includes(e.type);function Lt(e){const t=h.useRef(null),[n,i]=h.useState(()=>[]),[o,r]=h.useState(()=>[]),[l,s]=h.useState(()=>!1);function d(){if(!t.current||!t.current.getElementsByTagName)return;const c=t.current.getElementsByTagName("script");for(let m=0;m<c.length;m++){const g=c[m];if(g.src&&!n.includes(g.src)){n.push(g.src);const f=document.createElement("script");f.async=!0,f.src=g.src,document.head.appendChild(f)}else if(Dt(g)&&!o.includes(g.innerText))try{o.push(g.innerText),new Function(g.innerText)()}catch(f){console.warn("`Embed`: Error running script:",f)}}}return h.useEffect(()=>{t.current&&!l&&(s(!0),d())},[t.current,l]),a.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const Ot={name:"Form:Form",defaults:{responsiveStyles:{large:{marginTop:"15px",paddingBottom:"15px"}}},image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",inputs:[{name:"sendSubmissionsTo",type:"string",enum:[{label:"Send to email",value:"email",helperText:"Send form submissions to the email address of your choosing"},{label:"Custom",value:"custom",helperText:"Handle where the form requests go manually with a little code, e.g. to your own custom backend"}],defaultValue:"email"},{name:"sendSubmissionsToEmail",type:"string",required:!0,defaultValue:"your@email.com",showIf:'options.get("sendSubmissionsTo") === "email"'},{name:"sendWithJs",type:"boolean",helperText:"Set to false to use basic html form action",defaultValue:!0,showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"name",type:"string",defaultValue:"My form"},{name:"action",type:"string",helperText:"URL to send the form data to",showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"contentType",type:"string",defaultValue:"application/json",advanced:!0,enum:["application/json","multipart/form-data","application/x-www-form-urlencoded"],showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'},{name:"method",type:"string",showIf:'options.get("sendSubmissionsTo") === "custom"',defaultValue:"POST",advanced:!0},{name:"previewState",type:"string",enum:["unsubmitted","sending","success","error"],defaultValue:"unsubmitted",helperText:'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"successUrl",type:"url",helperText:"Optional URL to redirect the user to on form submission success",showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"resetFormOnSubmit",type:"boolean",showIf:"options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",advanced:!0},{name:"successMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Thanks!</span>"}}}]},{name:"validate",type:"boolean",defaultValue:!0,advanced:!0},{name:"errorMessagePath",type:"text",advanced:!0,helperText:'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'},{name:"errorMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},bindings:{"component.options.text":"state.formErrorMessage || block.component.options.text"},component:{name:"Text",options:{text:"<span>Form submission error :( Please check your answers and try again</span>"}}}]},{name:"sendingMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Sending...</span>"}}}]},{name:"customHeaders",type:"map",valueType:{type:"string"},advanced:!0,showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'}],noWrap:!0,canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your name</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"name",placeholder:"Jane Doe"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your email</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"email",placeholder:"jane@doe.com"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:SubmitButton",options:{text:"Submit"}}}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},Mt=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],Ut=()=>{const e=process.env.NODE_ENV||"production";return Mt.includes(e)?e:"production"},Ht=(e,t,n)=>{const i=String.prototype.split.call(t,/[,[\].]+?/).filter(Boolean).reduce((o,r)=>o!=null?o[r]:o,e);return i===void 0||i===e?n:i};function qt(e){var g,f;const t=h.useRef(null),[n,i]=h.useState(()=>"unsubmitted"),[o,r]=h.useState(()=>null),[l,s]=h.useState(()=>"");function d(u){var S,v;const b={...e.builderContext.rootState,...u};e.builderContext.rootSetState?(v=(S=e.builderContext).rootSetState)==null||v.call(S,b):e.builderContext.rootState=b}function c(){return x.isEditing()&&e.previewState||n}function m(u){var S;const b=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")u.preventDefault();else if(b){if(!(e.action||e.sendSubmissionsTo==="email")){u.preventDefault();return}u.preventDefault();const v=u.currentTarget||u.target,R=e.customHeaders||{};let j;const B=new FormData(v),W=Array.from(v.querySelectorAll("input,select,textarea")).filter(y=>!!y.name).map(y=>{let p;const k=y.name;if(y instanceof HTMLInputElement)if(y.type==="radio"){if(y.checked)return p=y.name,{key:k,value:p}}else if(y.type==="checkbox")p=y.checked;else if(y.type==="number"||y.type==="range"){const C=y.valueAsNumber;isNaN(C)||(p=C)}else y.type==="file"?p=y.files:p=y.value;else p=y.value;return{key:k,value:p}});let T=e.contentType;if(e.sendSubmissionsTo==="email"&&(T="multipart/form-data"),Array.from(W).forEach(({value:y})=>{(y instanceof File||Array.isArray(y)&&y[0]instanceof File||y instanceof FileList)&&(T="multipart/form-data")}),T!=="application/json")j=B;else{const y={};Array.from(W).forEach(({value:p,key:k})=>{L.set(y,k,p)}),j=JSON.stringify(y)}T&&T!=="multipart/form-data"&&(b&&((S=e.action)!=null&&S.includes("zapier.com"))||(R["content-type"]=T));const E=new CustomEvent("presubmit",{detail:{body:j}});if(t.current&&(t.current.dispatchEvent(E),E.defaultPrevented))return;i("sending");const P=`${Ut()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`;fetch(e.sendSubmissionsTo==="email"?P:e.action,{body:j,headers:R,method:e.method||"post"}).then(async y=>{let p;const k=y.headers.get("content-type");if(k&&k.indexOf("application/json")!==-1?p=await y.json():p=await y.text(),!y.ok&&e.errorMessagePath){let C=Ht(p,e.errorMessagePath);C&&(typeof C!="string"&&(C=JSON.stringify(C)),s(C),d({formErrorMessage:C}))}if(r(p),i(y.ok?"success":"error"),y.ok){const C=new CustomEvent("submit:success",{detail:{res:y,body:p}});if(t.current){if(t.current.dispatchEvent(C),C.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const I=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(I),I.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},y=>{const p=new CustomEvent("submit:error",{detail:{error:y}});t.current&&(t.current.dispatchEvent(p),p.defaultPrevented)||(r(y),i("error"))})}}return a.jsxs(a.Fragment,{children:[" ",a.jsxs("form",{validate:e.validate,ref:t,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:u=>m(u),...e.attributes,children:[e.builderBlock&&e.builderBlock.children?a.jsx(a.Fragment,{children:(f=(g=e.builderBlock)==null?void 0:g.children)==null?void 0:f.map((u,b)=>a.jsx(H,{block:u,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${b}`))}):null,c()==="error"?a.jsx(A,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,c()==="sending"?a.jsx(A,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,c()==="error"&&o?a.jsx("pre",{className:"builder-form-error-text pre-3a20f614",children:JSON.stringify(o,null,2)}):null,c()==="success"?a.jsx(A,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",a.jsx("style",{children:".pre-3a20f614 { padding: 10px; color: red; text-align: center; }"})," "]})}const Kt={name:"Form:Input",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",inputs:[{name:"type",type:"text",enum:["text","number","email","url","checkbox","radio","range","date","datetime-local","search","tel","time","file","month","week","password","color","hidden"],defaultValue:"text"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it takes, e.g. "email"'},{name:"placeholder",type:"string",defaultValue:"Hello there",helperText:"Text to display when there is no value"},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",helperText:"Is this input required to be filled out to submit a form",defaultValue:!1}],noWrap:!0,static:!0,defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"}};function _t(e){return h.createElement("input",{...e.attributes,key:x.isEditing()&&e.defaultValue?e.defaultValue:"default-key",placeholder:e.placeholder,type:e.type,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const zt={name:"Form:Select",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",defaultStyles:{alignSelf:"flex-start"},inputs:[{name:"options",type:"list",required:!0,subFields:[{name:"value",type:"text",required:!0},{name:"name",type:"text"}],defaultValue:[{value:"option 1"},{value:"option 2"}]},{name:"name",type:"string",required:!0,helperText:'Every select in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",defaultValue:!1}],static:!0,noWrap:!0};function Jt(e){var t;return h.createElement("select",{...e.attributes,value:e.value,key:x.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name,required:e.required},(t=e.options)==null?void 0:t.map((n,i)=>a.jsx("option",{value:n.value,children:n.name||n.value},`${n.name}-${i}`)))}const Gt={name:"Form:SubmitButton",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#3898EC",color:"white",borderRadius:"4px",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me"}],static:!0,noWrap:!0};function Yt(e){return a.jsx("button",{type:"submit",...e.attributes,children:e.text})}const Qt={name:"Form:TextArea",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",inputs:[{advanced:!0,name:"value",type:"string"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"placeholder",type:"string",defaultValue:"Hello there"},{name:"required",type:"boolean",defaultValue:!1}],defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"},static:!0,noWrap:!0};function Xt(e){return a.jsx("textarea",{...e.attributes,placeholder:e.placeholder,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const Zt={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 en(e){return a.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},x.isEditing()&&e.imgSrc||"default-key")}const tn={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}],shouldReceiveBuilderProps:{builderBlock:!0}};function je(e){var i,o,r,l,s,d,c;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,(s=(l=e.builderBlock)==null?void 0:l.children)!=null&&s.length&&e.fitContent?a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(c=(d=e.builderBlock)==null?void 0:d.children)!=null&&c.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 nn=()=>[{component:Nt,...At},{component:Lt,...Wt},{component:qt,...Ot},{component:_t,...Kt},{component:Yt,...Gt},{component:Jt,...zt},{component:Xt,...Qt},{component:en,...Zt},{component:je,...tn}],ce=()=>[{component:fe,...Ct},{component:Te,...Tt},{component:Ie,...It},{component:we,...wt},{component:Ee,...Et},{component:jt,...Rt},{component:Ae,...Bt},{component:Re,...Ft},{component:Vt,...Pt},{component:kt,...St},...nn()],on=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
56
56
|
function getAndSetVariantId() {
|
|
57
57
|
function setCookie(name, value, days) {
|
|
58
58
|
let expires = '';
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
}).join('');
|
|
109
109
|
styleEl.innerHTML = newStyleStr;
|
|
110
110
|
}
|
|
111
|
-
}`,
|
|
111
|
+
}`,an=`function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
112
112
|
if (!navigator.cookieEnabled) {
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
@@ -142,15 +142,15 @@
|
|
|
142
142
|
thisScriptEl?.remove();
|
|
143
143
|
}
|
|
144
144
|
return;
|
|
145
|
-
}`,
|
|
146
|
-
window.${
|
|
147
|
-
window.${
|
|
148
|
-
`,
|
|
149
|
-
window.${
|
|
150
|
-
"${t}",${JSON.stringify(e)}, ${
|
|
151
|
-
)`,
|
|
152
|
-
"${t}", "${e}", ${
|
|
153
|
-
)`;function
|
|
145
|
+
}`,Be="builderIoAbTest",Pe="builderIoRenderContent",K=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),rn=({canTrack:e,content:t})=>!(!(K(t).length>0)||!e||x.isBrowser()),ln=e=>e==="react"||e==="reactNative",Ve=ln(x.TARGET),sn=()=>`
|
|
146
|
+
window.${Be} = ${on}
|
|
147
|
+
window.${Pe} = ${an}
|
|
148
|
+
`,cn=(e,t)=>`
|
|
149
|
+
window.${Be}(
|
|
150
|
+
"${t}",${JSON.stringify(e)}, ${Ve}
|
|
151
|
+
)`,dn=({contentId:e,variationId:t})=>`window.${Pe}(
|
|
152
|
+
"${t}", "${e}", ${Ve}
|
|
153
|
+
)`;function ne(e){return a.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id,nonce:e.nonce||""})}function de(e){return Math.round(e*1e3)/1e3}const un=(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},mn=e=>un(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),ue=({event:e,target:t})=>{const n=t.getBoundingClientRect(),i=e.clientX-n.left,o=e.clientY-n.top,r=de(i/n.width),l=de(o/n.height);return{x:r,y:l}},fn=e=>{const t=e.target,n=t&&mn(t),i=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:i||void 0,metadata:{targetOffset:t?ue({event:e,target:t}):void 0,builderTargetOffset:n?ue({event:e,target:n}):void 0,builderElementIndex:n&&i?[].slice.call(document.getElementsByClassName(i)).indexOf(n):void 0}}},hn=e=>{var r,l;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],i=(l=e.fileUrl)!=null?l:(r=e==null?void 0:e.files)==null?void 0:r.regular;let o="";if(i&&t&&n&&(o+=`
|
|
154
154
|
@font-face {
|
|
155
155
|
font-family: "${t}";
|
|
156
156
|
src: local("${n}"), url('${i}') format('woff2');
|
|
@@ -164,7 +164,7 @@ src: url('${c}') format('woff2');
|
|
|
164
164
|
font-display: fallback;
|
|
165
165
|
font-weight: ${s};
|
|
166
166
|
}
|
|
167
|
-
`.trim())}return o},
|
|
167
|
+
`.trim())}return o},gn=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(n=>hn(n)))==null?void 0:t.join(" "))||""},bn=({cssCode:e,contentId:t})=>e?t?(e==null?void 0:e.replace(/&/g,`div[builder-content-id="${t}"]`))||"":e:"",pn=`
|
|
168
168
|
.builder-button {
|
|
169
169
|
all: unset;
|
|
170
170
|
}
|
|
@@ -181,8 +181,8 @@ font-weight: ${s};
|
|
|
181
181
|
text-align: inherit;
|
|
182
182
|
font-family: inherit;
|
|
183
183
|
}
|
|
184
|
-
`,
|
|
185
|
-
${
|
|
186
|
-
${
|
|
187
|
-
${
|
|
188
|
-
`.trim());return a.jsx(J,{id:"builderio-content",styles:t,nonce:e.nonce})}const
|
|
184
|
+
`,xn=e=>e?"":pn,yn=e=>`variant-${e}`;function vn(e){var j,B,W,T,E,P,y;const t=h.useRef(null);function n(p){var C,I;const k={...e.builderContextSignal.rootState,...p};e.builderContextSignal.rootSetState?(I=(C=e.builderContextSignal).rootSetState)==null||I.call(C,k):e.setBuilderContextSignal(w=>({...w,rootState:k}))}function i(p){var C,I,w,V,$;const k={...e.builderContextSignal.content,...p,data:{...(C=e.builderContextSignal.content)==null?void 0:C.data,...p==null?void 0:p.data},meta:{...(I=e.builderContextSignal.content)==null?void 0:I.meta,...p==null?void 0:p.meta,breakpoints:((w=p==null?void 0:p.meta)==null?void 0:w.breakpoints)||(($=(V=e.builderContextSignal.content)==null?void 0:V.meta)==null?void 0:$.breakpoints)}};e.setBuilderContextSignal(F=>({...F,content:k}))}function o(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[r,l]=h.useState(()=>e.contentWrapper||"div");function s(p){return x.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:k=>{var w;const{breakpoints:C,contentId:I}=k;!I||I!==((w=e.builderContextSignal.content)==null?void 0:w.id)||C&&i({meta:{breakpoints:C}})},animation:k=>{xe(k)},contentUpdate:k=>{i(k)}}})(p)}function d(){var k,C;const p=(C=(k=e.builderContextSignal.content)==null?void 0:k.data)==null?void 0:C.jsCode;p&&U({code:p,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!1})}const[c,m]=h.useState(()=>({})),[g,f]=h.useState(()=>({})),[u,b]=h.useState(()=>!1);function S(p){var k,C;if(e.builderContextSignal.content){const I=(k=e.builderContextSignal.content)==null?void 0:k.testVariationId,w=(C=e.builderContextSignal.content)==null?void 0:C.id;x._track({type:"click",canTrack:x.getDefaultCanTrack(e.canTrack),contentId:w,apiKey:e.apiKey,variationId:I!==w?I:void 0,...fn(p),unique:!u})}u||b(!0)}function v(){var k,C,I;const p=(I=(C=(k=e.builderContextSignal.content)==null?void 0:k.data)==null?void 0:C.httpRequests)!=null?I:{};Object.entries(p).forEach(([w,V])=>{if(!V||g[w]||c[w]&&!x.isEditing())return;g[w]=!0;const $=V.replace(/{{([^}]+)}}/g,(F,Ne)=>String(U({code:Ne,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!0})));x.fetch($).then(F=>F.json()).then(F=>{n({[w]:F}),c[w]=!0}).catch(F=>{console.error("error fetching dynamic data",V,F)}).finally(()=>{g[w]=!1})})}function R(){x.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:x.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}return h.useEffect(()=>{var p,k;if(x.isBrowser()){if(x.isEditing()&&(window.addEventListener("message",s),x.registerInsertMenu(),x.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(I=>{var V;const w=x.createRegisterComponentMessage(I);(V=window.parent)==null||V.postMessage(w,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",R)),e.builderContextSignal.content&&x.getDefaultCanTrack(e.canTrack)){const I=(p=e.builderContextSignal.content)==null?void 0:p.testVariationId,w=(k=e.builderContextSignal.content)==null?void 0:k.id,V=e.apiKey;x._track({type:"impression",canTrack:!0,contentId:w,apiKey:V,variationId:I!==w?I:void 0})}if(x.isPreviewing()&&!x.isEditing()){const I=new URL(location.href).searchParams,w=I.get("builder.preview"),V=I.get(`builder.overrides.${w}`),$=I.get("apiKey")||I.get("builder.space");w===e.model&&$===e.apiKey&&(!e.content||V===e.content.id)&&x.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(F=>{F&&i(F)})}}},[]),h.useEffect(()=>{e.apiKey||x.logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."),d(),v(),R()},[]),h.useEffect(()=>{e.content&&i(e.content)},[e.content]),h.useEffect(()=>{d()},[(B=(j=e.builderContextSignal.content)==null?void 0:j.data)==null?void 0:B.jsCode]),h.useEffect(()=>{v()},[(T=(W=e.builderContextSignal.content)==null?void 0:W.data)==null?void 0:T.httpRequests]),h.useEffect(()=>{R()},[e.builderContextSignal.rootState]),h.useEffect(()=>{e.data&&n(e.data)},[e.data]),h.useEffect(()=>{e.locale&&n({locale:e.locale})},[e.locale]),h.useEffect(()=>()=>{x.isBrowser()&&(window.removeEventListener("message",s),window.removeEventListener("builder:component:stateChangeListenerActivated",R))},[]),a.jsx(_.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?a.jsx(r,{ref:t,onClick:p=>S(p),"builder-content-id":(E=e.builderContextSignal.content)==null?void 0:E.id,"builder-model":e.model,...o(),...e.contentWrapperProps,className:yn(((P=e.content)==null?void 0:P.testVariationId)||((y=e.content)==null?void 0:y.id)),children:e.children}):null})}function Sn(e){const[t,n]=h.useState(()=>`
|
|
185
|
+
${bn({cssCode:e.cssCode,contentId:e.contentId})}
|
|
186
|
+
${gn({customFonts:e.customFonts})}
|
|
187
|
+
${xn(e.isNestedRender)}
|
|
188
|
+
`.trim());return a.jsx(J,{id:"builderio-content",styles:t,nonce:e.nonce})}const kn=({content:e,data:t,locale:n})=>{var r,l,s;const i={},o=((r=e==null?void 0:e.data)==null?void 0:r.state)||{};return(s=(l=e==null?void 0:e.data)==null?void 0:l.inputs)==null||s.forEach(d=>{d.name&&d.defaultValue!==void 0&&(i[d.name]=d.defaultValue)}),{...i,...o,...t,...n?{locale:n}:{}}},Cn=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function me(e){var d,c,m,g,f,u,b;const[t,n]=h.useState(()=>{var S,v;return dn({variationId:(S=e.content)==null?void 0:S.testVariationId,contentId:(v=e.content)==null?void 0:v.id})});function i(S){s(v=>({...v,rootState:S}))}const[o,r]=h.useState(()=>[...ce(),...e.customComponents||[]].reduce((S,{component:v,...R})=>({...S,[R.name]:{component:v,...x.serializeComponentInfo(R)}}),{})),[l,s]=h.useState(()=>({content:Cn({content:e.content,data:e.data}),localState:void 0,rootState:kn({content:e.content,data:e.data,locale:e.locale}),rootSetState:i,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...ce(),...e.customComponents||[]].reduce((S,{component:v,...R})=>({...S,[R.name]:x.serializeComponentInfo(R)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{},nonce:e.nonce||""}));return a.jsx(he.Provider,{value:{registeredComponents:o},children:a.jsxs(vn,{nonce:e.nonce,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:l,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts,setBuilderContextSignal:s,children:[e.isSsrAbTest?a.jsx(ne,{id:"builderio-variant-visibility",scriptStr:t,nonce:e.nonce||""}):null,a.jsx(Sn,{nonce:e.nonce||"",isNestedRender:e.isNestedRender,contentId:(d=l.content)==null?void 0:d.id,cssCode:(m=(c=l.content)==null?void 0:c.data)==null?void 0:m.cssCode,customFonts:(f=(g=l.content)==null?void 0:g.data)==null?void 0:f.customFonts}),a.jsx(A,{blocks:(b=(u=l.content)==null?void 0:u.data)==null?void 0:b.blocks,context:l,registeredComponents:o,linkComponent:e.linkComponent})]})})}function Fe(e){var l;const[t,n]=h.useState(()=>rn({canTrack:x.getDefaultCanTrack(e.canTrack),content:e.content}));function i(){var s;return cn(K(e.content).map(d=>({id:d.testVariationId,testRatio:d.testRatio})),((s=e.content)==null?void 0:s.id)||"")}function o(){return K(e.content).map(s=>`.variant-${s.testVariationId} { display: none; } `).join("")}function r(){var s;return t?{...e.content,testVariationId:(s=e.content)==null?void 0:s.id}:x.handleABTestingSync({item:e.content,canTrack:x.getDefaultCanTrack(e.canTrack)})}return h.useEffect(()=>{},[]),h.useEffect(()=>{}),a.jsxs(a.Fragment,{children:[!e.isNestedRender&&x.TARGET!=="reactNative"?a.jsx(ne,{id:"builderio-init-variants-fns",scriptStr:sn(),nonce:e.nonce||""}):null,t?a.jsxs(a.Fragment,{children:[a.jsx(J,{id:"builderio-variants",styles:o(),nonce:e.nonce||""}),a.jsx(ne,{id:"builderio-variants-visibility",scriptStr:i(),nonce:e.nonce||""}),(l=K(e.content))==null?void 0:l.map(s=>a.jsx(me,{isNestedRender:e.isNestedRender,nonce:e.nonce,content:s,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},s.testVariationId))]}):null,a.jsx(me,{nonce:e.nonce,isNestedRender:e.isNestedRender,content:r(),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 Tn=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return x.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{x.logger.error("Could not fetch symbol content: ",n)})};function Ae(e){var s,d,c,m;function t(){return"div"}function n(){return"div"}function i(){var g,f;return[e.attributes[M()],"builder-symbol",(g=e.symbol)!=null&&g.inline?"builder-inline-symbol":void 0,(f=e.symbol)!=null&&f.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[o,r]=h.useState(()=>{var g;return(g=e.symbol)==null?void 0:g.content});function l(){o||Tn({symbol:e.symbol,builderContextValue:e.builderContext}).then(g=>{g&&r(g)})}return h.useEffect(()=>{},[]),h.useEffect(()=>{l()},[e.symbol]),a.jsx("div",{...e.attributes,className:i(),children:a.jsx(Fe,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(s=e.builderBlock)==null?void 0:s.id},customComponents:Object.values(e.builderComponents),data:{...(d=e.symbol)==null?void 0:d.data,...e.builderContext.localState,...(c=o==null?void 0:o.data)==null?void 0:c.state},canTrack:e.builderContext.canTrack,model:(m=e.symbol)==null?void 0:m.model,content:o,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:n()})})}exports.Blocks=A;exports.BuilderContext=_;exports.Button=fe;exports.Columns=Te;exports.Content=Fe;exports.Fragment=Ie;exports.Image=we;exports.Section=Ee;exports.Symbol=Ae;exports.Text=Re;exports.Video=je;
|