@builder.io/sdk-react 3.0.1 → 3.0.3-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/blocks-exports.cjs +169 -32
- package/lib/browser/blocks-exports.mjs +1331 -922
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +17 -16
- package/lib/browser/server-entry-c7bda8b5.cjs +2 -0
- package/lib/browser/server-entry-da1754bd.js +790 -0
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/accordion-388f5e60.cjs +1 -0
- package/lib/edge/{accordion-1572cb0d.js → accordion-50de133c.js} +17 -16
- package/lib/edge/blocks-5e476ddc.js +3534 -0
- package/lib/edge/blocks-a5193d52.cjs +30 -0
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +13 -12
- package/lib/edge/{button-0709893d.js → button-4261ae64.js} +2 -2
- package/lib/edge/{button-cf66cf8d.cjs → button-c6ec3aea.cjs} +1 -1
- package/lib/edge/{columns-e234acc6.js → columns-28e9fb0a.js} +14 -15
- package/lib/edge/columns-8c831c02.cjs +28 -0
- package/lib/edge/{content-variants-3ab9230f.js → content-variants-36ca4fe5.js} +297 -252
- package/lib/edge/content-variants-81713434.cjs +134 -0
- package/lib/edge/{custom-code-6d9730ff.cjs → custom-code-8119ea3f.cjs} +1 -1
- package/lib/edge/dynamic-blocks-exports.cjs +3 -1
- package/lib/edge/dynamic-blocks-exports.mjs +5 -2
- package/lib/edge/{form-27bcc23a.js → form-039fb5ff.js} +7 -8
- package/lib/edge/form-e7a1dec9.cjs +1 -0
- package/lib/edge/{get-class-prop-name-a3bd113c.js → get-class-prop-name-65d6824c.js} +1 -1
- package/lib/edge/{get-class-prop-name-0b3d48a4.cjs → get-class-prop-name-a86a3e60.cjs} +1 -1
- package/lib/edge/{image-5c9e156f.js → image-2a2b26d2.js} +6 -6
- package/lib/edge/{image-94922c87.cjs → image-4db81d72.cjs} +3 -3
- package/lib/edge/{img-80be6914.js → img-61d29fb3.js} +1 -1
- package/lib/edge/{img-e0c8f7f9.cjs → img-7de3a3de.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +18 -17
- package/lib/edge/{input-f5ba6b1e.cjs → input-bd5387a6.cjs} +1 -1
- package/lib/edge/{input-920922d5.js → input-c8539054.js} +1 -1
- package/lib/edge/personalization-container-3fda6014.cjs +138 -0
- package/lib/edge/personalization-container-c76e4fef.js +379 -0
- package/lib/edge/{select-673864b7.js → select-6b5cda00.js} +1 -1
- package/lib/edge/{select-2ced1aca.cjs → select-73accaf4.cjs} +1 -1
- package/lib/edge/server-entry-838c1f06.js +788 -0
- package/lib/edge/server-entry-ea2a8b0e.cjs +2 -0
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/slot-099112f1.cjs +1 -0
- package/lib/edge/{slot-68f2b177.js → slot-403c77da.js} +5 -6
- package/lib/edge/{symbol-7e260a70.js → symbol-97f456f4.js} +2 -2
- package/lib/edge/{symbol-ded9dba9.cjs → symbol-ffa6e6cd.cjs} +1 -1
- package/lib/edge/{tabs-5156494d.js → tabs-a7c94ead.js} +15 -16
- package/lib/edge/tabs-ad55c6a7.cjs +1 -0
- package/lib/edge/text-5915f038.js +17 -0
- package/lib/edge/text-e6dbb721.cjs +1 -0
- package/lib/node/blocks-exports.cjs +169 -32
- package/lib/node/blocks-exports.mjs +1359 -950
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +17 -16
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +3 -3
- package/lib/node/server-entry-51bc0b1d.js +791 -0
- package/lib/node/server-entry-d7316893.cjs +2 -0
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-8b303d4e.js → setIvm-575cf1f1.js} +1 -1
- package/lib/node/{setIvm-aba1bed8.cjs → setIvm-d912cf4d.cjs} +1 -1
- package/lib/node/setIvm.cjs +1 -1
- package/lib/node/setIvm.mjs +2 -2
- package/lib/node/{should-force-browser-runtime-in-node-491a9b55.cjs → should-force-browser-runtime-in-node-23225980.cjs} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-0a037bde.js → should-force-browser-runtime-in-node-66df4856.js} +1 -1
- package/package.json +1 -1
- package/types/blocks/index.d.ts +4 -0
- package/types/blocks/personalization-container/component-info.d.ts +2 -0
- package/types/blocks/personalization-container/helpers/index.d.ts +15 -0
- package/types/blocks/personalization-container/helpers/inlined-fns.d.ts +8 -0
- package/types/blocks/personalization-container/helpers.d.ts +27 -0
- package/types/blocks/personalization-container/index.d.ts +1 -0
- package/types/blocks/personalization-container/personalization-container.d.ts +4 -0
- package/types/blocks/personalization-container/personalization-container.types.d.ts +14 -0
- package/types/blocks/textarea/component-info.d.ts +2 -0
- package/types/blocks/textarea/index.d.ts +1 -0
- package/types/blocks/textarea/textarea.d.ts +14 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/filter-with-custom-targeting.d.ts +15 -0
- package/types/functions/get-block-component-options.d.ts +2 -1
- package/types/functions/get-processed-block.d.ts +1 -6
- package/types/helpers/flatten.d.ts +6 -0
- package/types/helpers/user-attributes.d.ts +17 -0
- package/types/index-helpers/blocks-exports.d.ts +1 -0
- package/types/server-index.d.ts +1 -1
- package/types/types/builder-content.d.ts +1 -0
- package/types/types/input.d.ts +11 -0
- package/lib/browser/server-entry-017b8439.js +0 -717
- package/lib/browser/server-entry-9f80066e.cjs +0 -2
- package/lib/edge/accordion-decb24cf.cjs +0 -1
- package/lib/edge/blocks-9c35be74.js +0 -916
- package/lib/edge/blocks-d3823063.cjs +0 -12
- package/lib/edge/columns-2fdf0656.cjs +0 -28
- package/lib/edge/content-variants-616a6c0f.cjs +0 -134
- package/lib/edge/evaluate-ccf1ad96.cjs +0 -19
- package/lib/edge/evaluate-f0b82ede.js +0 -2612
- package/lib/edge/form-7c61693d.cjs +0 -1
- package/lib/edge/server-entry-6c0047ea.js +0 -715
- package/lib/edge/server-entry-de142ee8.cjs +0 -2
- package/lib/edge/slot-cc8b4e5b.cjs +0 -1
- package/lib/edge/tabs-d422921f.cjs +0 -1
- package/lib/edge/text-27a917c0.js +0 -37
- package/lib/edge/text-5796f488.cjs +0 -1
- package/lib/node/server-entry-e91e06a3.cjs +0 -2
- package/lib/node/server-entry-fdedc1aa.js +0 -718
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`),
|
|
3
|
-
${
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./server-entry-d7316893.cjs"),o=require("react/jsx-runtime"),b=require("react"),A=require("./setIvm-d912cf4d.cjs"),Fe=require("./should-force-browser-runtime-in-node-23225980.cjs");function We(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const De=We(b),$e=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Oe=e=>typeof e=="string"&&$e.has(e.toLowerCase());function X(e){return o.jsx(o.Fragment,{children:Oe(e.TagName)?o.jsx(o.Fragment,{children:o.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):o.jsx(o.Fragment,{children:typeof e.TagName=="string"?o.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):o.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}const D=()=>{switch(p.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":case"angular":return"class"}};function de(e){function t(){return{...e.attributes,[D()]:`${e.link?"":"builder-button"} ${e.attributes[D()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}}}return o.jsx(X,{attributes:t(),TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}const H=b.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{},nonce:"",model:""}),me=b.createContext({registeredComponents:{}}),fe=(e,t,n)=>{const i=String.prototype.split.call(t,/[,[\].]+?/).filter(Boolean).reduce((a,s)=>a!=null?a[s]:a,e);return i===void 0||i===e?n:i},Le=({code:e,builder:t,context:n,event:i,localState:a,rootSetState:s,rootState:r})=>{const l=A.getFunctionArguments({builder:t,context:n,event:i,state:A.flattenState({rootState:r,localState:a,rootSetState:s})});return new Function(...l.map(([u])=>u),e)(...l.map(([,u])=>u))},_e=e=>p.isBrowser()||Fe.shouldForceBrowserRuntimeInNode({shouldLogWarning:!0})?Le(e):A.runInNode(e),Ue=/^(return )?(\s*)?state(?<getPath>(\.\w+)+)(\s*);?$/,qe=/(\s)*var(\s)+_virtual_index(\s)*=(\s)*state(?<getPath>(\.\w+)+)(\s*);?(\s)*return(\s)*_virtual_index(\s)*/,He=e=>{var t,n,i,a,s,r;return((i=(n=(t=Ue.exec(e.trim()))==null?void 0:t.groups)==null?void 0:n.getPath)==null?void 0:i.slice(1))||((r=(s=(a=qe.exec(e.trim()))==null?void 0:a.groups)==null?void 0:s.getPath)==null?void 0:r.slice(1))};function F({code:e,context:t,localState:n,rootState:i,rootSetState:a,event:s,isExpression:r=!0}){if(e.trim()==="")return;const l=He(e.trim());if(l)return fe({...i,...n},l);const u={code:A.parseCode(e,{isExpression:r}),builder:A.getBuilderGlobals(),context:t,event:s,rootSetState:a,rootState:i,localState:n};try{return _e(u)}catch(c){p.logger.error("Failed code evaluation: "+c.message,{code:e});return}}function Me(e,t){var n;return{...(n=e.component)==null?void 0:n.options,...e.options,...ze(e,t)}}const ze=(e,t)=>{var n,i;if(((n=e.component)==null?void 0:n.name)==="Text"&&((i=e.component.options)!=null&&i.text)&&typeof e.component.options.text=="string")return{...e.component.options,text:e.component.options.text.replace(/{{([^}]+)}}/g,(a,s)=>F({code:s,context:t,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState}))}};function Ke(e,...t){const n=Object.assign({},e);for(const i of t)delete n[i];return n}function U(e,t,n=null,i=null,a=new WeakSet){if(e==null||typeof e!="object"){t(e,s=>{n!==null&&i!==null&&(n[i]=s)});return}a.has(e)||(a.add(e),Array.isArray(e)?e.forEach((s,r)=>{t(s,u=>{e[r]=u}),U(s,t,e,r,a)}):Object.entries(e).forEach(([s,r])=>{t(r,u=>{e[s]=u}),U(r,t,e,s,a)}))}function ge(e){return e&&typeof e=="object"&&e["@type"]==="@builder.io/core:LocalizedValue"}function Ge(e){if(!e||!Object.getOwnPropertyNames(e).length)return!1;let t=!1;return U(e,n=>{if(ge(n)){t=!0;return}}),t}function Je(e,t){return!e||!Object.getOwnPropertyNames(e).length?{}:(U(e,(n,i)=>{var a;ge(n)&&i((a=n[t])!=null?a:void 0)}),e)}function Qe(e,t){var n,i;return(n=e.component)!=null&&n.options&&Ge((i=e.component)==null?void 0:i.options)&&(t||console.warn("[Builder.io] In order to use localized fields in Builder, you must pass a locale prop to the BuilderComponent or to options object while fetching the content to resolve localized fields. Learn more: https://www.builder.io/c/docs/localization-inline#targeting-and-inline-localization"),e.component.options=Je(e.component.options,t!=null?t:"Default")),e}function Y(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>Y(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]=Y(e[n]));return t}const Ye=["svelte","vue","angular","qwik","solid"].includes(p.TARGET),Xe=e=>{if(Ye){const t=A.fastClone(e);return{...t,properties:{...t.properties},actions:{...t.actions}}}else{const t=Y(Ke(e,"children","meta"));return{...t,properties:{...t.properties},actions:{...t.actions},children:e.children,meta:e.meta}}},Ze=({block:e,context:t,localState:n,rootState:i,rootSetState:a})=>{if(!e.bindings)return e;const s=Xe(e);for(const r in e.bindings){const l=e.bindings[r],u=F({code:l,localState:n,rootState:i,rootSetState:a,context:t});A.set(s,r,u)}return s};function et({block:e,context:t,localState:n,rootState:i,rootSetState:a}){let s=Qe(e,i.locale);return s=s,Ze({block:s,localState:n,rootState:i,rootSetState:a,context:t})}const M=e=>e?e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase():"";function tt(e,t,n={}){let i,a,s,r=null,l=0;const u=function(){l=n.leading===!1?0:Date.now(),r=null,s=e.apply(i,a),r||(i=a=null)};return function(){const c=Date.now();!l&&n.leading===!1&&(l=c);const g=t-(c-l);return i=this,a=arguments,g<=0||g>t?(r&&(clearTimeout(r),r=null),l=c,s=e.apply(i,a),r||(i=a=null)):!r&&n.trailing!==!1&&(r=setTimeout(u,g)),s}}function W(e,...t){const n=Object(e);for(let i=1;i<arguments.length;i++){const a=arguments[i];if(a!=null)for(const s in a)Object.prototype.hasOwnProperty.call(a,s)&&(n[s]=a[s])}return n}function nt(e){for(const t of e)switch(t.trigger){case"pageLoad":pe(t);break;case"scrollInView":at(t);break}}function he(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function be(e,t){const n=it(e),i=getComputedStyle(t),a=e.steps[0].styles,s=e.steps[e.steps.length-1].styles,r=[a,s];for(const l of r)for(const u of n)u in l||(l[u]=i[u])}function it(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 pe(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){he(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{be(e,n),n.style.transition="none",n.style.transitionDelay="0",W(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${M(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),W(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}function at(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){he(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{be(e,n);let i=!1,a=!1;function s(){!i&&l(n)?(i=!0,a=!0,setTimeout(()=>{W(n.style,e.steps[1].styles),e.repeat||document.removeEventListener("scroll",r),setTimeout(()=>{a=!1,e.repeat||(n.style.transition="",n.style.transitionDelay="")},(e.duration+(e.delay||0))*1e3+100)})):e.repeat&&i&&!a&&!l(n)&&(i=!1,W(n.style,e.steps[0].styles))}const r=tt(s,200,{leading:!1});function l(g){const y=g.getBoundingClientRect(),f=window.innerHeight,d=(e.thresholdPercent||0)/100*f;return y.bottom>d&&y.top<f-d}const u=e.steps[0].styles;function c(){W(n.style,u)}c(),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${M(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")}),document.addEventListener("scroll",r,{capture:!0,passive:!0}),s()})}const ye=e=>Object.entries(e).map(([n,i])=>{if(typeof i=="string")return`${M(n)}: ${i};`}).filter(p.checkIsDefined),ot=e=>ye(e).join(`
|
|
2
|
+
`),L=({mediaQuery:e,className:t,styles:n})=>{const i=`.${t} {
|
|
3
|
+
${ot(n)}
|
|
4
4
|
}`;return e?`${e} {
|
|
5
5
|
${i}
|
|
6
|
-
}`:i};function
|
|
6
|
+
}`:i};function rt({style:e}){return e}const st=({block:e,context:t})=>xe(rt({style:e.style||{},context:t,block:e}));function xe(e){switch(p.TARGET){case"svelte":case"vue":case"solid":case"angular":return ye(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const ve=(e,t)=>e?t?e.models&&e.models.length>0&&!e.models.includes(t):!1:!0,lt=({block:e,registeredComponents:t,model:n})=>{var s;const i=(s=e.component)==null?void 0:s.name;if(!i)return null;const a=t[i];if(!a||ve(a,n)){console.warn(`
|
|
7
7
|
Could not find a registered component named "${i}".
|
|
8
|
-
If you registered it, is the file that registered it imported by the file that needs to render it?`);return}else return
|
|
8
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`);return}else return a},ct=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const a=F({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context});if(!Array.isArray(a))return;const s=n.collection.split(".").pop(),r=n.itemName||(s?s+"Item":"item");return a.map((u,c)=>({context:{...t,localState:{...t.localState,$index:c,$item:u,[r]:u,[`$${r}Index`]:c}},block:i}))},ut=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderLinkComponent?{builderLinkComponent:t}:{}},dt=(e,t,n)=>{var i;return(i=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&i.builderComponents?{builderComponents:Object.fromEntries(Object.entries(t).filter(([s,r])=>!ve(r,n)))}:{}},mt=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderBlock?{builderBlock:t}:{}},ft=(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}},te=(e,t=Se)=>`@media (max-width: ${t[e].max}px)`,ke=({small:e,medium:t})=>{const n=A.fastClone(Se);if(!e||!t)return n;const i=Math.floor(e/2);n.small={max:e,min:i,default:i+1};const a=n.small.max+1;n.medium={max:t,min:a,default:a+1};const s=n.medium.max+1;return n.large={max:2e3,min:s,default:s+1},n};function $(e){return o.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id,nonce:e.nonce})}function gt(e){function t(){const i=e.block;return p.checkIsDefined(i.hide)?!i.hide:p.checkIsDefined(i.show)?i.show:!0}function n(){var S,v,k;const i=e.block,a=i.responsiveStyles,s=e.context.content,r=ke(((S=s==null?void 0:s.meta)==null?void 0:S.breakpoints)||{}),l=a==null?void 0:a.large,u=a==null?void 0:a.medium,c=a==null?void 0:a.small,g=i.id;if(!g)return"";const y=l?L({className:g,styles:l}):"",f=u?L({className:g,styles:u,mediaQuery:te("medium",r)}):"",x=c?L({className:g,styles:c,mediaQuery:te("small",r)}):"",d=i.animations&&i.animations.find(R=>R.trigger==="hover");let h="";if(d){const R=((k=(v=d.steps)==null?void 0:v[1])==null?void 0:k.styles)||{};h=L({className:`${g}:hover`,styles:{...R,transition:`all ${d.duration}s ${M(d.easing)}`,transitionDelay:d.delay?`${d.delay}s`:"0s"}})||""}return[y,f,x,h].join(" ")}return o.jsx(o.Fragment,{children:n()&&t()?o.jsx(o.Fragment,{children:o.jsx($,{id:"builderio-block",styles:n(),nonce:e.context.nonce})}):null})}function ht(e){return e.charAt(0).toUpperCase()+e.slice(1)}const bt=e=>`on${ht(e)}`,pt=(e,t)=>n=>F({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1});function Ce(e){var i;const t={},n=(i=e.block.actions)!=null?i:{};for(const a in n){if(!n.hasOwnProperty(a))continue;const s=n[a];let r=bt(a);if(e.stripPrefix)switch(p.TARGET){case"vue":r=r.replace("v-on:","");break;case"svelte":r=r.replace("on:","");break}t[r]=pt(s,e)}return t}function yt({properties:e}){return e}const xt=e=>({href:e.href});function Z({block:e,context:t}){var i;const n={...xt(e),...e.properties,"builder-id":e.id,style:st({block:e,context:t}),[D()]:[e.id,"builder-block",e.class,(i=e.properties)==null?void 0:i.class].filter(Boolean).join(" ")};return yt({properties:n,context:t,block:e})}function vt(e){return o.jsx(X,{TagName:e.Wrapper,attributes:Z({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 St(e){return b.useEffect(()=>{},[]),o.jsx(o.Fragment,{children:e.children})}function kt(e){function t(){return e.includeBlockProps?{...Z({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 o.jsx(o.Fragment,{children:e.Wrapper.load?o.jsx(o.Fragment,{children:o.jsx(St,{load:e.Wrapper.load,fallback:e.Wrapper.fallback,props:e.wrapperProps,attributes:t(),children:e.children})}):o.jsx(e.Wrapper,{...e.wrapperProps,attributes:t(),children:e.children})})}const Ct=({componentOptions:e,builderBlock:t,context:n,componentRef:i,includeBlockProps:a,isInteractive:s,contextValue:r})=>{const l={...e,...a?{attributes:Z({block:t,context:r})}:{}};return s?{Wrapper:i,block:t,context:n,wrapperProps:e,includeBlockProps:a}:l};function ne(e){var i;const[t,n]=b.useState(()=>e.isInteractive?kt:e.componentRef);return o.jsx(o.Fragment,{children:e.componentRef?o.jsx(o.Fragment,{children:o.jsx(t,{...Ct({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(i=e.blockChildren)==null?void 0:i.map(a=>o.jsx(O,{block:a,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},a.id))})}):null})}function ie(e){const[t,n]=b.useState(()=>e.repeatContext);return o.jsx(H.Provider,{value:t,children:o.jsx(O,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})})}function O(e){var g,y,f,x;function t(){return ct({block:e.block,context:e.context})}const[n,i]=b.useState(()=>({value:null,update:!1}));function a(){var h;if(n.value&&!n.update&&!p.isPreviewing())return n.value;const d=(h=e.block.repeat)!=null&&h.collection?e.block:et({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context});return n.value=d,n.update=!1,d}function s(){return lt({block:a(),registeredComponents:e.registeredComponents,model:e.context.model})}function r(){var h;return e.block.tagName==="a"||((h=a().properties)==null?void 0:h.href)||a().href?e.linkComponent||"a":e.block.tagName||"div"}function l(){var S,v;if((S=e.block.repeat)!=null&&S.collection)return!!((v=t==null?void 0:t())!=null&&v.length);const d="hide"in a()?a().hide:!1;return("show"in a()?a().show:!0)&&!d}function u(){var h,S;return!((h=s==null?void 0:s())!=null&&h.component)&&!t()?(S=a().children)!=null?S:[]:[]}function c(){var d,h,S,v;return{blockChildren:(d=a().children)!=null?d:[],componentRef:(h=s==null?void 0:s())==null?void 0:h.component,componentOptions:{...Me(a(),e.context),...mt(s(),a()),...ft(s(),e.context),...ut(s(),e.linkComponent),...dt(s(),e.registeredComponents,e.context.model)},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:a(),includeBlockProps:((S=s==null?void 0:s())==null?void 0:S.noWrap)===!0,isInteractive:!((v=s==null?void 0:s())!=null&&v.isRSC&&p.TARGET==="rsc")}}return b.useEffect(()=>{const d=a().id,h=a().animations;h&&d&&nt(h.map(S=>({...S,elementId:d})))},[]),b.useEffect(()=>{n.update=!0}),o.jsx(o.Fragment,{children:l()?o.jsxs(o.Fragment,{children:[o.jsx(gt,{block:a(),context:e.context}),(g=s==null?void 0:s())!=null&&g.noWrap?t()?o.jsx(o.Fragment,{children:(x=t())==null?void 0:x.map((d,h)=>o.jsx(ie,{repeatContext:d.context,block:d.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},h))}):o.jsx(ne,{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}):o.jsx(o.Fragment,{children:t()?o.jsx(o.Fragment,{children:(f=t())==null?void 0:f.map((d,h)=>o.jsx(ie,{repeatContext:d.context,block:d.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},h))}):o.jsxs(vt,{Wrapper:r(),block:a(),context:e.context,children:[o.jsx(ne,{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}),(y=u())==null?void 0:y.map(d=>o.jsx(O,{block:d,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},d.id))]})})]}):null})}function Tt(e){const t=b.useRef(null);function n(){var r;return["builder-blocks",(r=e.blocks)!=null&&r.length?"":"no-blocks",e.classNameProp].filter(Boolean).join(" ")}function i(){if(!e.path)return;const r="component.options.";return e.path.startsWith(r)?e.path:`${r}${e.path||""}`}function a(){var r,l;p.isEditing()&&!((r=e.blocks)!=null&&r.length)&&((l=window.parent)==null||l.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:i()}},"*"))}function s(){var r,l;p.isEditing()&&!((r=e.blocks)!=null&&r.length)&&((l=window.parent)==null||l.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:i()}},"*"))}return b.useEffect(()=>{},[]),o.jsxs(o.Fragment,{children:[o.jsx(e.BlocksWrapper,{ref:t,className:n()+" props-blocks-wrapper-2c6a6d88","builder-path":i(),"builder-parent-id":e.parent,style:e.styleProp,onClick:r=>a(),onMouseEnter:r=>s(),onKeyPress:r=>a(),...e.BlocksWrapperProps,children:e.children}),o.jsx("style",{children:`.props-blocks-wrapper-2c6a6d88 {
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
align-items: stretch;
|
|
12
|
-
}`})]})}function
|
|
13
|
-
@media (max-width: ${
|
|
12
|
+
}`})]})}function B(e){var i,a,s;const t=b.useContext(H),n=b.useContext(me);return o.jsx(Tt,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,classNameProp:e.className,BlocksWrapper:((i=e.context)==null?void 0:i.BlocksWrapper)||(t==null?void 0:t.BlocksWrapper),BlocksWrapperProps:((a=e.context)==null?void 0:a.BlocksWrapperProps)||(t==null?void 0:t.BlocksWrapperProps),children:e.blocks?o.jsx(o.Fragment,{children:(s=e.blocks)==null?void 0:s.map(r=>o.jsx(O,{block:r,linkComponent:e.linkComponent,context:e.context||t,registeredComponents:e.registeredComponents||(n==null?void 0:n.registeredComponents)},r.id))}):null})}const wt=e=>`builder-columns ${e}-breakpoints`;function Te(e){var h,S;function t(){return typeof e.space=="number"?e.space||0:20}function n(){return e.columns||[]}function i(){return e.stackColumnsAt||"tablet"}function a(v){return v.link?e.builderLinkComponent||"a":"div"}function s(v){var k;return((k=n()[v])==null?void 0:k.width)||100/n().length}function r(v){const k=s(v),R=t()*(n().length-1)*(k/100);return`calc(${k}% - ${R}px)`}function l({stackedStyle:v,desktopStyle:k}){return i()==="tablet"?v:k}function u({stackedStyle:v,desktopStyle:k}){return i()==="never"?k:v}function c(){return e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column"}function g(){return{"--flex-dir":c(),"--flex-dir-tablet":l({stackedStyle:c(),desktopStyle:"row"})}}function y(v){const k=v===0?0:t(),R=r(v),V=`${k}px`,w="100%",C=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:R,["marginLeft"]:V,"--column-width-mobile":u({stackedStyle:w,desktopStyle:R}),"--column-margin-left-mobile":u({stackedStyle:C,desktopStyle:V}),"--column-width-tablet":l({stackedStyle:w,desktopStyle:R}),"--column-margin-left-tablet":l({stackedStyle:C,desktopStyle:V})}}function f(v){var R,V;return ke(((V=(R=e.builderContext.content)==null?void 0:R.meta)==null?void 0:V.breakpoints)||{})[v].max}function x(){const v=`.${e.builderBlock.id}-breakpoints > .builder-column`;return`
|
|
13
|
+
@media (max-width: ${f("medium")}px) {
|
|
14
14
|
.${e.builderBlock.id}-breakpoints {
|
|
15
15
|
flex-direction: var(--flex-dir-tablet);
|
|
16
16
|
align-items: stretch;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
${
|
|
19
|
+
${v} {
|
|
20
20
|
width: var(--column-width-tablet) !important;
|
|
21
21
|
margin-left: var(--column-margin-left-tablet) !important;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
@media (max-width: ${
|
|
25
|
+
@media (max-width: ${f("small")}px) {
|
|
26
26
|
.${e.builderBlock.id}-breakpoints {
|
|
27
27
|
flex-direction: var(--flex-dir);
|
|
28
28
|
align-items: stretch;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
${
|
|
31
|
+
${v} {
|
|
32
32
|
width: var(--column-width-mobile) !important;
|
|
33
33
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
`}function
|
|
36
|
+
`}function d(v,k){return{...v.link?{href:v.link}:{},[D()]:"builder-column",style:xe(y(k))}}return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:wt((h=e.builderBlock)==null?void 0:h.id)+" div-d55bdf5c",style:g(),children:[o.jsx($,{id:"builderio-columns",styles:x(),nonce:e.builderContext.nonce}),(S=e.columns)==null?void 0:S.map((v,k)=>o.jsx(X,{TagName:a(v),actionAttributes:{},attributes:d(v,k),children:o.jsx(B,{path:`columns.${k}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:v.blocks})},k))]}),o.jsx("style",{children:`.div-d55bdf5c {
|
|
37
37
|
display: flex;
|
|
38
38
|
line-height: normal;
|
|
39
|
-
}`})]})}function
|
|
39
|
+
}`})]})}function we(e){return o.jsx("span",{children:e.children})}function ae(e){return e.replace(/http(s)?:/,"")}function It(e="",t,n){const i=new RegExp("([?&])"+t+"=.*?(&|$)","i"),a=e.indexOf("?")!==-1?"&":"?";return e.match(i)?e.replace(i,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+a+t+"="+encodeURIComponent(n)}function Et(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return ae(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]),a=n[3],s=t.match("x")?t:`${t}x`;return ae(`${i[0]}_${s}${a}`)}return null}function z(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(a=>a!==i).map(a=>`${It(e,"width",a)} ${a}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[Et(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,i])=>`${n} ${i}w`).concat([e]).join(", "):e}function Ie(e){var a,s,r,l,u,c;function t(){var f;const y=e.image||e.src;if(!y||!(typeof y=="string"&&(y.match(/builder\.io/)||y.match(/cdn\.shopify\.com/))))return e.srcset;if(!e.noWebp){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"),z(y)}else if(e.image&&!e.srcset)return z(y);return z(y)}}function n(){var g;return(g=t==null?void 0:t())!=null&&g.match(/builder\.io/)&&!e.noWebp?t().replace(/\?/g,"?format=webp&"):""}function i(){const g={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?g:void 0}return b.useEffect(()=>{},[]),o.jsxs(o.Fragment,{children:[o.jsxs(o.Fragment,{children:[o.jsxs("picture",{children:[n()?o.jsx("source",{type:"image/webp",srcSet:n()}):null,o.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-11a47ef4",src:e.image,srcSet:t(),sizes:e.sizes})]}),e.aspectRatio&&!((s=(a=e.builderBlock)==null?void 0:a.children)!=null&&s.length&&e.fitContent)?o.jsx("div",{className:"builder-image-sizer div-11a47ef4",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(l=(r=e.builderBlock)==null?void 0:r.children)!=null&&l.length&&e.fitContent?o.jsx(o.Fragment,{children:e.children}):null,!e.fitContent&&((c=(u=e.builderBlock)==null?void 0:u.children)!=null&&c.length)?o.jsx("div",{className:"div-11a47ef4-2",children:e.children}):null]}),o.jsx("style",{children:`.img-11a47ef4 {
|
|
40
40
|
opacity: 1;
|
|
41
41
|
transition: opacity 0.2s ease-in-out;
|
|
42
|
-
}.div-
|
|
42
|
+
}.div-11a47ef4 {
|
|
43
43
|
width: 100%;
|
|
44
44
|
pointer-events: none;
|
|
45
45
|
font-size: 0;
|
|
46
|
-
}.div-
|
|
46
|
+
}.div-11a47ef4-2 {
|
|
47
47
|
display: flex;
|
|
48
48
|
flex-direction: column;
|
|
49
49
|
align-items: stretch;
|
|
@@ -52,7 +52,144 @@
|
|
|
52
52
|
left: 0;
|
|
53
53
|
width: 100%;
|
|
54
54
|
height: 100%;
|
|
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 z={"@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!"}}}]},K={"@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!"}}}]},It={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:[z]},{name:"detail",type:"uiBlocks",hideFromUI:!0,defaultValue:[K]}],defaultValue:[{title:[z],detail:[K]},{title:[z],detail:[K]}],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}},ae=e=>e.toString();function wt(e){var b;const[t,n]=g.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 l(){const v={...{display:"flex",flexDirection:"column"},alignItems:"stretch",cursor:"pointer"};return Object.fromEntries(Object.entries(v).filter(([f,k])=>k!==void 0))}function r(m){return`builder-accordion-title builder-accordion-title-${t.includes(m)?"open":"closed"}`}function s(m){return`builder-accordion-detail builder-accordion-detail-${t.includes(m)?"open":"closed"}`}function d(){let m=null;if(e.grid&&t.length&&document){const f=t[0];let S=document.querySelector(`.builder-accordion-title[data-index="${f}"]`);if(m=f,S){let x=S.getBoundingClientRect();for(;S=S&&S.nextElementSibling;)if(S){if(S.classList.contains("builder-accordion-detail"))continue;const y=S.getBoundingClientRect();if(y.left>x.left){const I=parseInt(S.getAttribute("data-index")||"",10);isNaN(I)||(x=y,m=I)}else break}}}return typeof m=="number"&&(m=m+1),m}function c(){const m={order:typeof d()=="number"?d():void 0,...e.grid&&{width:"100%"}};return Object.fromEntries(Object.entries(m).filter(([v,f])=>f!==void 0))}function h(m){t.includes(m)?n(i()?[]:t.filter(v=>v!==m)):n(i()?[m]:t.concat(m))}return a.jsx("div",{className:"builder-accordion",style:o(),children:(b=e.items)==null?void 0:b.map((m,v)=>a.jsxs(a.Fragment,{children:[a.jsx("div",{className:r(v),style:{...l(),...e.grid&&{width:e.gridRowWidth,order:d()!==null?ae(v):ae(v+1)}},"data-index":v,onClick:f=>h(v),children:a.jsx(F,{blocks:m.title,path:`items.${v}.title`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}),t.includes(v)?a.jsx("div",{className:s(v),style:c(),children:a.jsx(F,{blocks:m.detail,path:`items.${v}.detail`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]}))})}const Et={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}},Rt={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(l=>!l.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}},jt={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},ee=["jpeg","jpg","png","svg","webp","gif","jfif","pjpeg","pjp","apng","avif","tif","tiff","heif","bmp","eps","raw","cr2","nef","orf","sr2","psd","heic","dib","ai"],Pt=["mp4","webm","mkv","flv","vob","ogv","ogg","drc","gif","gifv","mng","avi","mov","qt","mts","m2ts","ts","wmv","yuv","rm","rmvb","viv","asf","amv","m4p","mpeg","mpe","m2v","m4v","svi","3gp","3g2","mxf","roq","nsv","f4v","f4p","f4a","f4b"],Bt={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:ee,required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(r,s=6e4){return new Promise((d,c)=>{const h=document.createElement("img");let b=!1;h.onload=()=>{b=!0,d(h)},h.addEventListener("error",m=>{console.warn("Image load failed",m.error),c(m.error)}),h.src=r,setTimeout(()=>{b||c(new Error("Image load timed out"))},s)})}function i(r){return Math.round(r*1e3)/1e3}const o=e.get("image"),l=e.get("aspectRatio");if(fetch(o).then(r=>r.blob()).then(r=>{r.type.includes("svg")&&e.set("noWebp",!0)}),o&&(!l||l===.7041))return n(o).then(r=>{const s=e.get("aspectRatio");e.get("image")===o&&(!s||s===.7041)&&r.width&&r.height&&(e.set("aspectRatio",i(r.height/r.width)),e.set("height",r.height),e.set("width",r.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}},Ft={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>"}}}]},Vt={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,builderComponents:!0}};function At(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(F,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,registeredComponents:e.builderComponents,blocks:(i=e.builderContext.rootState)==null?void 0:i[e.name]})})}const Wt={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}},G={"@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"}}},J={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{height:"200px",display:"flex",marginTop:"20px",flexDirection:"column"}},component:{name:"Text",options:{text:"New tab content "}}},Nt={name:"Builder: Tabs",inputs:[{name:"tabs",type:"list",broadcast:!0,subFields:[{name:"label",type:"uiBlocks",hideFromUI:!0,defaultValue:[G]},{name:"content",type:"uiBlocks",hideFromUI:!0,defaultValue:[J]}],defaultValue:[{label:[{...G,component:{name:"Text",options:{text:"Tab 1"}}}],content:[{...J,component:{name:"Text",options:{text:"Tab 1 content"}}}]},{label:[{...G,component:{name:"Text",options:{text:"Tab 2"}}}],content:[{...J,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 $t(e){var l;const[t,n]=g.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function i(r){return e.tabs&&e.tabs[r].content}function o(r){r===t&&e.collapsible?n(-1):n(r)}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:(l=e.tabs)==null?void 0:l.map((r,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(F,{parent:e.builderBlock.id,path:`tabs.${s}.label`,blocks:r.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},s))}),i(t)?a.jsx("div",{children:a.jsx(F,{parent:e.builderBlock.id,path:`tabs.${t}.content`,blocks:i(t),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}const Lt={shouldReceiveBuilderProps:{builderBlock:!1,builderContext:!0},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){function t(){var s;const n=e.builderContext,{context:i,localState:o,rootState:l,rootSetState:r}=n;return String(((s=e.text)==null?void 0:s.toString())||"").replace(/{{([^}]+)}}/g,(d,c)=>A({code:c,context:i,localState:o,rootState:l,rootSetState:r}))}return a.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:t()},style:{outline:"none"}})}const Dt={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 Ot(e){const t=g.useRef(null),[n,i]=g.useState(()=>[]),[o,l]=g.useState(()=>[]);return g.useEffect(()=>{var s;if(!((s=t.current)!=null&&s.getElementsByTagName)||typeof window=="undefined")return;const r=t.current.getElementsByTagName("script");for(let d=0;d<r.length;d++){const c=r[d];if(c.src){if(n.includes(c.src))continue;n.push(c.src);const h=document.createElement("script");h.async=!0,h.src=c.src,document.head.appendChild(h)}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(h){console.warn("`CustomCode`: Error running script:",h)}}}},[]),a.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const Ut={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"],Ht=e=>_t.includes(e.type);function Mt(e){const t=g.useRef(null),[n,i]=g.useState(()=>[]),[o,l]=g.useState(()=>[]),[r,s]=g.useState(()=>!1);function d(){if(!t.current||!t.current.getElementsByTagName)return;const c=t.current.getElementsByTagName("script");for(let h=0;h<c.length;h++){const b=c[h];if(b.src&&!n.includes(b.src)){n.push(b.src);const m=document.createElement("script");m.async=!0,m.src=b.src,document.head.appendChild(m)}else if(Ht(b)&&!o.includes(b.innerText))try{o.push(b.innerText),new Function(b.innerText)()}catch(m){console.warn("`Embed`: Error running script:",m)}}}return g.useEffect(()=>{t.current&&!r&&(s(!0),d())},[t.current,r]),a.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const qt={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}},zt=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],Kt=()=>{const e=process.env.NODE_ENV||"production";return zt.includes(e)?e:"production"};function Gt(e){var b,m;const t=g.useRef(null),[n,i]=g.useState(()=>"unsubmitted"),[o,l]=g.useState(()=>null),[r,s]=g.useState(()=>"");function d(v){var k,S;const f={...e.builderContext.rootState,...v};e.builderContext.rootSetState?(S=(k=e.builderContext).rootSetState)==null||S.call(k,f):e.builderContext.rootState=f}function c(){return p.isEditing()&&e.previewState||n}function h(v){var k;const f=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")v.preventDefault();else if(f){if(!(e.action||e.sendSubmissionsTo==="email")){v.preventDefault();return}v.preventDefault();const S=v.currentTarget||v.target,x=e.customHeaders||{};let y;const I=new FormData(S),j=Array.from(S.querySelectorAll("input,select,textarea")).filter(u=>!!u.name).map(u=>{let T;const B=u.name;if(u instanceof HTMLInputElement)if(u.type==="radio"){if(u.checked)return T=u.name,{key:B,value:T}}else if(u.type==="checkbox")T=u.checked;else if(u.type==="number"||u.type==="range"){const R=u.valueAsNumber;isNaN(R)||(T=R)}else u.type==="file"?T=u.files:T=u.value;else T=u.value;return{key:B,value:T}});let C=e.contentType;if(e.sendSubmissionsTo==="email"&&(C="multipart/form-data"),Array.from(j).forEach(({value:u})=>{(u instanceof File||Array.isArray(u)&&u[0]instanceof File||u instanceof FileList)&&(C="multipart/form-data")}),C!=="application/json")y=I;else{const u={};Array.from(j).forEach(({value:T,key:B})=>{V.set(u,B,T)}),y=JSON.stringify(u)}C&&C!=="multipart/form-data"&&(f&&((k=e.action)!=null&&k.includes("zapier.com"))||(x["content-type"]=C));const E=new CustomEvent("presubmit",{detail:{body:y}});if(t.current&&(t.current.dispatchEvent(E),E.defaultPrevented))return;i("sending");const P=`${Kt()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`,w=e.sendSubmissionsTo==="email"?P:e.action;p.logFetch(w),fetch(w,{body:y,headers:x,method:e.method||"post"}).then(async u=>{let T;const B=u.headers.get("content-type");if(B&&B.indexOf("application/json")!==-1?T=await u.json():T=await u.text(),!u.ok&&e.errorMessagePath){let R=fe(T,e.errorMessagePath);R&&(typeof R!="string"&&(R=JSON.stringify(R)),s(R),d({formErrorMessage:R}))}if(l(T),i(u.ok?"success":"error"),u.ok){const R=new CustomEvent("submit:success",{detail:{res:u,body:T}});if(t.current){if(t.current.dispatchEvent(R),R.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const L=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(L),L.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},u=>{const T=new CustomEvent("submit:error",{detail:{error:u}});t.current&&(t.current.dispatchEvent(T),T.defaultPrevented)||(l(u),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:v=>h(v),...e.attributes,children:[e.builderBlock&&e.builderBlock.children?a.jsx(a.Fragment,{children:(m=(b=e.builderBlock)==null?void 0:b.children)==null?void 0:m.map((v,f)=>a.jsx($,{block:v,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${f}`))}):null,c()==="error"?a.jsx(F,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,c()==="sending"?a.jsx(F,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,c()==="error"&&o?a.jsx("pre",{className:"builder-form-error-text pre-135d4696",children:JSON.stringify(o,null,2)}):null,c()==="success"?a.jsx(F,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",a.jsx("style",{children:".pre-135d4696 { padding: 10px; color: red; text-align: center; }"})," "]})}const Jt={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 Yt(e){return g.createElement("input",{...e.attributes,key:p.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 Qt={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 Xt(e){var t;return g.createElement("select",{...e.attributes,value:e.value,key:p.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 en(e){return a.jsx("button",{type:"submit",...e.attributes,children:e.text})}const tn={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 nn(e){return a.jsx("textarea",{...e.attributes,placeholder:e.placeholder,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const on={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:ee,required:!0}],noWrap:!0,static:!0};function an(e){return a.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},p.isEditing()&&e.imgSrc||"default-key")}const rn={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:Pt,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:ee,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,l,r,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&&((l=(o=e.builderBlock)==null?void 0:o.children)!=null&&l.length))?a.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(s=(r=e.builderBlock)==null?void 0:r.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 ln=()=>[{component:Ot,...Dt},{component:Mt,...Ut},{component:Gt,...qt},{component:Yt,...Jt},{component:en,...Zt},{component:Xt,...Qt},{component:nn,...tn},{component:an,...on},{component:je,...rn}],re=()=>[{component:ue,...Et},{component:Te,...Rt},{component:Ie,...jt},{component:we,...Bt},{component:Ee,...Ft},{component:At,...Vt},{component:Ae,...Wt},{component:Re,...Lt},{component:$t,...Nt},{component:wt,...It},...ln()],sn=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
55
|
+
}`})]})}function Ee(e){return o.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 K={"@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!"}}}]},G={"@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!"}}}]},Rt={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:[K]},{name:"detail",type:"uiBlocks",hideFromUI:!0,defaultValue:[G]}],defaultValue:[{title:[K],detail:[G]},{title:[K],detail:[G]}],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}},oe=e=>e.toString();function jt(e){var y;const[t,n]=b.useState(()=>[]);function i(){return!!(e.grid||e.oneAtATime)}function a(){return{display:"flex",alignItems:"stretch",flexDirection:"column",...e.grid&&{flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap"}}}function s(){const x={...{display:"flex",flexDirection:"column"},alignItems:"stretch",cursor:"pointer"};return Object.fromEntries(Object.entries(x).filter(([d,h])=>h!==void 0))}function r(f){return`builder-accordion-title builder-accordion-title-${t.includes(f)?"open":"closed"}`}function l(f){return`builder-accordion-detail builder-accordion-detail-${t.includes(f)?"open":"closed"}`}function u(){let f=null;if(e.grid&&t.length&&document){const d=t[0];let S=document.querySelector(`.builder-accordion-title[data-index="${d}"]`);if(f=d,S){let v=S.getBoundingClientRect();for(;S=S&&S.nextElementSibling;)if(S){if(S.classList.contains("builder-accordion-detail"))continue;const k=S.getBoundingClientRect();if(k.left>v.left){const R=parseInt(S.getAttribute("data-index")||"",10);isNaN(R)||(v=k,f=R)}else break}}}return typeof f=="number"&&(f=f+1),f}function c(){const f={order:typeof u()=="number"?u():void 0,...e.grid&&{width:"100%"}};return Object.fromEntries(Object.entries(f).filter(([x,d])=>d!==void 0))}function g(f){t.includes(f)?n(i()?[]:t.filter(x=>x!==f)):n(i()?[f]:t.concat(f))}return o.jsx("div",{className:"builder-accordion",style:a(),children:(y=e.items)==null?void 0:y.map((f,x)=>o.jsxs(De.Fragment,{children:[o.jsx("div",{className:r(x),style:{...s(),...e.grid&&{width:e.gridRowWidth,order:u()!==null?oe(x):oe(x+1)}},"data-index":x,onClick:d=>g(x),children:o.jsx(B,{blocks:f.title,path:`items.${x}.title`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}),t.includes(x)?o.jsx("div",{className:l(x),style:c(),children:o.jsx(B,{blocks:f.detail,path:`items.${x}.detail`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]},x))})}const Pt={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}},Vt={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(a=>a.get("width"))&&(n.find(s=>!s.get("width"))||n.reduce((l,u)=>l+u.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}},Bt={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},ee=["jpeg","jpg","png","svg","webp","gif","jfif","pjpeg","pjp","apng","avif","tif","tiff","heif","bmp","eps","raw","cr2","nef","orf","sr2","psd","heic","dib","ai"],At=["mp4","webm","mkv","flv","vob","ogv","ogg","drc","gif","gifv","mng","avi","mov","qt","mts","m2ts","ts","wmv","yuv","rm","rmvb","viv","asf","amv","m4p","mpeg","mpe","m2v","m4v","svi","3gp","3g2","mxf","roq","nsv","f4v","f4p","f4a","f4b"],Nt={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:ee,required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(r,l=6e4){return new Promise((u,c)=>{const g=document.createElement("img");let y=!1;g.onload=()=>{y=!0,u(g)},g.addEventListener("error",f=>{console.warn("Image load failed",f.error),c(f.error)}),g.src=r,setTimeout(()=>{y||c(new Error("Image load timed out"))},l)})}function i(r){return Math.round(r*1e3)/1e3}const a=e.get("image"),s=e.get("aspectRatio");if(fetch(a).then(r=>r.blob()).then(r=>{r.type.includes("svg")&&e.set("noWebp",!0)}),a&&(!s||s===.7041))return n(a).then(r=>{const l=e.get("aspectRatio");e.get("image")===a&&(!l||l===.7041)&&r.width&&r.height&&(e.set("aspectRatio",i(r.height/r.width)),e.set("height",r.height),e.set("width",r.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}},Ft={name:"PersonalizationContainer",shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0},noWrap:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",canHaveChildren:!0,inputs:[{name:"variants",defaultValue:[],behavior:"personalizationVariantList",type:"list",subFields:[{name:"name",type:"text"},{name:"query",friendlyName:"Targeting rules",type:"BuilderQuery",defaultValue:[]},{name:"startDate",type:"date"},{name:"endDate",type:"date"},{name:"blocks",type:"uiBlocks",hideFromUI:!0,defaultValue:[]}]}]};function q(e){return o.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id,nonce:e.nonce||""})}function Wt(e,t,n,i){function a(c){return typeof c=="string"}function s(c){return typeof c=="number"}function r(c,g){return(()=>{const f=g.property,x=g.operator;let d=g.value;if(g&&g.property==="urlPath"&&g.value&&typeof g.value=="string"&&g.value!=="/"&&g.value.endsWith("/")&&(d=g.value.slice(0,-1)),!(f&&x))return!0;if(Array.isArray(d))return x==="isNot"?d.every(S=>r(c,{property:f,operator:x,value:S})):!!d.find(S=>r(c,{property:f,operator:x,value:S}));const h=c[f];if(Array.isArray(h))return h.includes(d);switch(x){case"is":return h===d;case"isNot":return h!==d;case"contains":return(a(h)||Array.isArray(h))&&h.includes(String(d));case"startsWith":return a(h)&&h.startsWith(String(d));case"endsWith":return a(h)&&h.endsWith(String(d));case"greaterThan":return s(h)&&s(d)&&h>d;case"lessThan":return s(h)&&s(d)&&h<d;case"greaterThanOrEqualTo":return s(h)&&s(d)&&h>=d;case"lessThanOrEqualTo":return s(h)&&s(d)&&h<=d;default:return!1}})()}const l={query:t,startDate:n,endDate:i},u=e.date&&new Date(e.date)||new Date;return l.startDate&&new Date(l.startDate)>u||l.endDate&&new Date(l.endDate)<u?!1:!l.query||!l.query.length?!0:l.query.every(c=>r(e,c))}const Dt=`function getPersonalizedVariant(variants, blockId, locale) {
|
|
56
|
+
if (!navigator.cookieEnabled) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
function getCookie(name) {
|
|
60
|
+
const nameEQ = name + '=';
|
|
61
|
+
const ca = document.cookie.split(';');
|
|
62
|
+
for (let i = 0; i < ca.length; i++) {
|
|
63
|
+
let c = ca[i];
|
|
64
|
+
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
|
65
|
+
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
function removeVariants() {
|
|
70
|
+
variants?.forEach(function (_, index) {
|
|
71
|
+
document.querySelector('template[data-variant-id="' + blockId + '-' + index + '"]')?.remove();
|
|
72
|
+
});
|
|
73
|
+
document.querySelector('script[data-id="variants-script-' + blockId + '"]')?.remove();
|
|
74
|
+
document.querySelector('style[data-id="variants-styles-' + blockId + '"]')?.remove();
|
|
75
|
+
}
|
|
76
|
+
const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
|
|
77
|
+
if (locale) {
|
|
78
|
+
attributes.locale = locale;
|
|
79
|
+
}
|
|
80
|
+
const winningVariantIndex = variants?.findIndex(function (variant) {
|
|
81
|
+
return filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
|
|
82
|
+
});
|
|
83
|
+
const isDebug = location.href.includes('builder.debug=true');
|
|
84
|
+
if (isDebug) {
|
|
85
|
+
console.debug('PersonalizationContainer', {
|
|
86
|
+
attributes,
|
|
87
|
+
variants,
|
|
88
|
+
winningVariantIndex
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
if (winningVariantIndex !== -1) {
|
|
92
|
+
const winningVariant = document.querySelector('template[data-variant-id="' + blockId + '-' + winningVariantIndex + '"]');
|
|
93
|
+
if (winningVariant) {
|
|
94
|
+
const parentNode = winningVariant.parentNode;
|
|
95
|
+
if (parentNode) {
|
|
96
|
+
const newParent = parentNode.cloneNode(false);
|
|
97
|
+
newParent.appendChild(winningVariant.content.firstChild);
|
|
98
|
+
newParent.appendChild(winningVariant.content.lastChild);
|
|
99
|
+
parentNode.parentNode?.replaceChild(newParent, parentNode);
|
|
100
|
+
}
|
|
101
|
+
if (isDebug) {
|
|
102
|
+
console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
} else if (variants && variants.length > 0) {
|
|
106
|
+
removeVariants();
|
|
107
|
+
}
|
|
108
|
+
}`,$t=`function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
|
|
109
|
+
function isString(val) {
|
|
110
|
+
return typeof val === 'string';
|
|
111
|
+
}
|
|
112
|
+
function isNumber(val) {
|
|
113
|
+
return typeof val === 'number';
|
|
114
|
+
}
|
|
115
|
+
function objectMatchesQuery(userattr, query) {
|
|
116
|
+
const result = (() => {
|
|
117
|
+
const property = query.property;
|
|
118
|
+
const operator = query.operator;
|
|
119
|
+
let testValue = query.value;
|
|
120
|
+
if (query && query.property === 'urlPath' && query.value && typeof query.value === 'string' && query.value !== '/' && query.value.endsWith('/')) {
|
|
121
|
+
testValue = query.value.slice(0, -1);
|
|
122
|
+
}
|
|
123
|
+
if (!(property && operator)) {
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
if (Array.isArray(testValue)) {
|
|
127
|
+
if (operator === 'isNot') {
|
|
128
|
+
return testValue.every(val => objectMatchesQuery(userattr, {
|
|
129
|
+
property,
|
|
130
|
+
operator,
|
|
131
|
+
value: val
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
return !!testValue.find(val => objectMatchesQuery(userattr, {
|
|
135
|
+
property,
|
|
136
|
+
operator,
|
|
137
|
+
value: val
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
const value = userattr[property];
|
|
141
|
+
if (Array.isArray(value)) {
|
|
142
|
+
return value.includes(testValue);
|
|
143
|
+
}
|
|
144
|
+
switch (operator) {
|
|
145
|
+
case 'is':
|
|
146
|
+
return value === testValue;
|
|
147
|
+
case 'isNot':
|
|
148
|
+
return value !== testValue;
|
|
149
|
+
case 'contains':
|
|
150
|
+
return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
|
|
151
|
+
case 'startsWith':
|
|
152
|
+
return isString(value) && value.startsWith(String(testValue));
|
|
153
|
+
case 'endsWith':
|
|
154
|
+
return isString(value) && value.endsWith(String(testValue));
|
|
155
|
+
case 'greaterThan':
|
|
156
|
+
return isNumber(value) && isNumber(testValue) && value > testValue;
|
|
157
|
+
case 'lessThan':
|
|
158
|
+
return isNumber(value) && isNumber(testValue) && value < testValue;
|
|
159
|
+
case 'greaterThanOrEqualTo':
|
|
160
|
+
return isNumber(value) && isNumber(testValue) && value >= testValue;
|
|
161
|
+
case 'lessThanOrEqualTo':
|
|
162
|
+
return isNumber(value) && isNumber(testValue) && value <= testValue;
|
|
163
|
+
default:
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
})();
|
|
167
|
+
return result;
|
|
168
|
+
}
|
|
169
|
+
const item = {
|
|
170
|
+
query,
|
|
171
|
+
startDate,
|
|
172
|
+
endDate
|
|
173
|
+
};
|
|
174
|
+
const now = userAttributes.date && new Date(userAttributes.date) || new Date();
|
|
175
|
+
if (item.startDate && new Date(item.startDate) > now) {
|
|
176
|
+
return false;
|
|
177
|
+
} else if (item.endDate && new Date(item.endDate) < now) {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
if (!item.query || !item.query.length) {
|
|
181
|
+
return true;
|
|
182
|
+
}
|
|
183
|
+
return item.query.every(filter => {
|
|
184
|
+
return objectMatchesQuery(userAttributes, filter);
|
|
185
|
+
});
|
|
186
|
+
}`;function Ot(e,t){return!(!(e&&e.length>0)||!t||p.isBrowser())}function Lt(e){const{variants:t,previewingIndex:n,isHydrated:i,filteredVariants:a,fallbackBlocks:s}=e;if(i&&p.isEditing()&&typeof n=="number"&&n<((t==null?void 0:t.length)||0)&&!(a!=null&&a.length))return{blocks:t[n].blocks,path:`component.options.variants.${n}.blocks`};const l=a==null?void 0:a[0];return l?{blocks:l.blocks,path:`component.options.variants.${t==null?void 0:t.indexOf(l)}.blocks`}:{blocks:s||[],path:void 0}}const _t=(e,t,n)=>`
|
|
187
|
+
(function() {
|
|
188
|
+
${$t}
|
|
189
|
+
${Dt}
|
|
190
|
+
getPersonalizedVariant(${JSON.stringify(e)}, "${t}"${n?`, "${n}"`:""})
|
|
191
|
+
})();
|
|
192
|
+
`;function Ut(e){var h,S,v,k,R,V,w;const t=b.useRef(null),[n,i]=b.useState(()=>p.userAttributesService.getUserAttributes()),[a,s]=b.useState(()=>{var C,E,I;return _t(e.variants,((C=e.builderBlock)==null?void 0:C.id)||"none",(I=(E=e.builderContext)==null?void 0:E.rootState)==null?void 0:I.locale)}),[r,l]=b.useState(()=>[]),[u,c]=b.useState(()=>{var C;return Ot(e.variants,p.getDefaultCanTrack((C=e.builderContext)==null?void 0:C.canTrack))}),[g,y]=b.useState(()=>!1);function f(){return(e.variants||[]).filter(C=>{var E,I,m,T;return Wt({...(I=(E=e.builderContext)==null?void 0:E.rootState)!=null&&I.locale?{locale:(T=(m=e.builderContext)==null?void 0:m.rootState)==null?void 0:T.locale}:{},...n},C.query,C.startDate,C.endDate)})}function x(){var C;return Lt({variants:e.variants,fallbackBlocks:(C=e.builderBlock)==null?void 0:C.children,isHydrated:g,filteredVariants:f(),previewingIndex:e.previewingIndex})}function d(){return(e.variants||[]).map((C,E)=>{var I;return`[data-variant-id="${(I=e.builderBlock)==null?void 0:I.id}-${E}"] { display: none; } `}).join("")}return b.useEffect(()=>{var E;y(!0);const C=p.userAttributesService.subscribeOnUserAttributesChange(I=>{i(I)});if(!(p.isEditing()||p.isPreviewing())){const I=f()[0];t.current&&(t.current.dispatchEvent(new CustomEvent("builder.variantLoaded",{detail:{variant:I||"default",content:(E=e.builderContext)==null?void 0:E.content},bubbles:!0})),new IntersectionObserver(T=>{T.forEach(P=>{var j;P.isIntersecting&&t.current&&t.current.dispatchEvent(new CustomEvent("builder.variantDisplayed",{detail:{variant:I||"default",content:(j=e.builderContext)==null?void 0:j.content},bubbles:!0}))})}).observe(t.current))}r.push(C)},[]),b.useEffect(()=>()=>{r.forEach(C=>C())},[]),o.jsxs("div",{ref:t,...e.attributes,className:`builder-personalization-container ${((h=e.attributes)==null?void 0:h.class)||""}`,children:[u?o.jsxs(o.Fragment,{children:[(S=e.variants)==null?void 0:S.map((C,E)=>{var I,m;return o.jsx("template",{"data-variant-id":`${(I=e.builderBlock)==null?void 0:I.id}-${E}`,children:o.jsx(B,{blocks:C.blocks,parent:(m=e.builderBlock)==null?void 0:m.id,path:`component.options.variants.${E}.blocks`})},E)}),o.jsx($,{nonce:((v=e.builderContext)==null?void 0:v.nonce)||"",styles:d(),id:`variants-styles-${(k=e.builderBlock)==null?void 0:k.id}`}),o.jsx(q,{nonce:((R=e.builderContext)==null?void 0:R.nonce)||"",scriptStr:a,id:`variants-script-${(V=e.builderBlock)==null?void 0:V.id}`})]}):null,o.jsx(B,{blocks:x().blocks,parent:(w=e.builderBlock)==null?void 0:w.id,path:x().path})]})}const qt={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>"}}}]},Ht={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,builderComponents:!0}};function Mt(e){var t,n,i;return o.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:o.jsx(B,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,registeredComponents:e.builderComponents,blocks:(i=e.builderContext.rootState)==null?void 0:i[e.name]})})}const zt={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}},J={"@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"}}},Q={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{height:"200px",display:"flex",marginTop:"20px",flexDirection:"column"}},component:{name:"Text",options:{text:"New tab content "}}},Kt={name:"Builder: Tabs",inputs:[{name:"tabs",type:"list",broadcast:!0,subFields:[{name:"label",type:"uiBlocks",hideFromUI:!0,defaultValue:[J]},{name:"content",type:"uiBlocks",hideFromUI:!0,defaultValue:[Q]}],defaultValue:[{label:[{...J,component:{name:"Text",options:{text:"Tab 1"}}}],content:[{...Q,component:{name:"Text",options:{text:"Tab 1 content"}}}]},{label:[{...J,component:{name:"Text",options:{text:"Tab 2"}}}],content:[{...Q,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 Gt(e){var s;const[t,n]=b.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function i(r){return e.tabs&&e.tabs[r].content}function a(r){r===t&&e.collapsible?n(-1):n(r)}return o.jsxs("div",{children:[o.jsx("div",{className:"builder-tabs-wrap",style:{display:"flex",flexDirection:"row",justifyContent:e.tabHeaderLayout||"flex-start",overflow:"auto"},children:(s=e.tabs)==null?void 0:s.map((r,l)=>o.jsx("span",{className:`builder-tab-wrap ${t===l?"builder-tab-active":""}`,style:{...t===l?e.activeTabStyle:{}},onClick:u=>a(l),children:o.jsx(B,{parent:e.builderBlock.id,path:`tabs.${l}.label`,blocks:r.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},l))}),i(t)?o.jsx("div",{children:o.jsx(B,{parent:e.builderBlock.id,path:`tabs.${t}.content`,blocks:i(t),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}const Jt={shouldReceiveBuilderProps:{builderBlock:!1,builderContext:!0},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 o.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const Qt={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 Yt(e){const t=b.useRef(null),[n,i]=b.useState(()=>[]),[a,s]=b.useState(()=>[]);return b.useEffect(()=>{var l;if(!((l=t.current)!=null&&l.getElementsByTagName)||typeof window=="undefined")return;const r=t.current.getElementsByTagName("script");for(let u=0;u<r.length;u++){const c=r[u];if(c.src){if(n.includes(c.src))continue;n.push(c.src);const g=document.createElement("script");g.async=!0,g.src=c.src,document.head.appendChild(g)}else if(!c.type||["text/javascript","application/javascript","application/ecmascript"].includes(c.type)){if(a.includes(c.innerText))continue;try{a.push(c.innerText),new Function(c.innerText)()}catch(g){console.warn("`CustomCode`: Error running script:",g)}}}},[]),o.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const Xt={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}]},Zt=["text/javascript","application/javascript","application/ecmascript"],en=e=>Zt.includes(e.type);function tn(e){const t=b.useRef(null),[n,i]=b.useState(()=>[]),[a,s]=b.useState(()=>[]),[r,l]=b.useState(()=>!1);function u(){if(!t.current||!t.current.getElementsByTagName)return;const c=t.current.getElementsByTagName("script");for(let g=0;g<c.length;g++){const y=c[g];if(y.src&&!n.includes(y.src)){n.push(y.src);const f=document.createElement("script");f.async=!0,f.src=y.src,document.head.appendChild(f)}else if(en(y)&&!a.includes(y.innerText))try{a.push(y.innerText),new Function(y.innerText)()}catch(f){console.warn("`Embed`: Error running script:",f)}}}return b.useEffect(()=>{t.current&&!r&&(l(!0),u())},[t.current,r]),o.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const nn={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}},an=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],on=()=>{const e=process.env.NODE_ENV||"production";return an.includes(e)?e:"production"};function rn(e){var y,f;const t=b.useRef(null),[n,i]=b.useState(()=>"unsubmitted"),[a,s]=b.useState(()=>null),[r,l]=b.useState(()=>"");function u(x){var h,S;const d={...e.builderContext.rootState,...x};e.builderContext.rootSetState?(S=(h=e.builderContext).rootSetState)==null||S.call(h,d):e.builderContext.rootState=d}function c(){return p.isEditing()&&e.previewState||n}function g(x){var h;const d=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")x.preventDefault();else if(d){if(!(e.action||e.sendSubmissionsTo==="email")){x.preventDefault();return}x.preventDefault();const S=x.currentTarget||x.target,v=e.customHeaders||{};let k;const R=new FormData(S),V=Array.from(S.querySelectorAll("input,select,textarea")).filter(m=>!!m.name).map(m=>{let T;const P=m.name;if(m instanceof HTMLInputElement)if(m.type==="radio"){if(m.checked)return T=m.name,{key:P,value:T}}else if(m.type==="checkbox")T=m.checked;else if(m.type==="number"||m.type==="range"){const j=m.valueAsNumber;isNaN(j)||(T=j)}else m.type==="file"?T=m.files:T=m.value;else T=m.value;return{key:P,value:T}});let w=e.contentType;if(e.sendSubmissionsTo==="email"&&(w="multipart/form-data"),Array.from(V).forEach(({value:m})=>{(m instanceof File||Array.isArray(m)&&m[0]instanceof File||m instanceof FileList)&&(w="multipart/form-data")}),w!=="application/json")k=R;else{const m={};Array.from(V).forEach(({value:T,key:P})=>{A.set(m,P,T)}),k=JSON.stringify(m)}w&&w!=="multipart/form-data"&&(d&&((h=e.action)!=null&&h.includes("zapier.com"))||(v["content-type"]=w));const C=new CustomEvent("presubmit",{detail:{body:k}});if(t.current&&(t.current.dispatchEvent(C),C.defaultPrevented))return;i("sending");const E=`${on()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`,I=e.sendSubmissionsTo==="email"?E:e.action;p.logFetch(I),fetch(I,{body:k,headers:v,method:e.method||"post"}).then(async m=>{let T;const P=m.headers.get("content-type");if(P&&P.indexOf("application/json")!==-1?T=await m.json():T=await m.text(),!m.ok&&e.errorMessagePath){let j=fe(T,e.errorMessagePath);j&&(typeof j!="string"&&(j=JSON.stringify(j)),l(j),u({formErrorMessage:j}))}if(s(T),i(m.ok?"success":"error"),m.ok){const j=new CustomEvent("submit:success",{detail:{res:m,body:T}});if(t.current){if(t.current.dispatchEvent(j),j.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const N=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(N),N.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},m=>{const T=new CustomEvent("submit:error",{detail:{error:m}});t.current&&(t.current.dispatchEvent(T),T.defaultPrevented)||(s(m),i("error"))})}}return o.jsxs(o.Fragment,{children:[" ",o.jsxs("form",{validate:e.validate,ref:t,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:x=>g(x),...e.attributes,children:[e.builderBlock&&e.builderBlock.children?o.jsx(o.Fragment,{children:(f=(y=e.builderBlock)==null?void 0:y.children)==null?void 0:f.map((x,d)=>o.jsx(O,{block:x,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${d}`))}):null,c()==="error"?o.jsx(B,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,c()==="sending"?o.jsx(B,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,c()==="error"&&a?o.jsx("pre",{className:"builder-form-error-text pre-3f9754fe",children:JSON.stringify(a,null,2)}):null,c()==="success"?o.jsx(B,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",o.jsx("style",{children:".pre-3f9754fe { padding: 10px; color: red; text-align: center; }"})," "]})}const sn={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 ln(e){return b.createElement("input",{...e.attributes,key:p.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 cn={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 un(e){var t;return b.createElement("select",{...e.attributes,value:e.value,key:p.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)=>o.jsx("option",{value:n.value,children:n.name||n.value},`${n.name}-${i}`)))}const dn={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 mn(e){return o.jsx("button",{type:"submit",...e.attributes,children:e.text})}const fn={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 gn(e){return o.jsx("textarea",{...e.attributes,placeholder:e.placeholder,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const hn={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:ee,required:!0}],noWrap:!0,static:!0};function bn(e){return o.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},p.isEditing()&&e.imgSrc||"default-key")}const pn={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:At,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:ee,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,a,s,r,l,u,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 o.jsxs("div",{style:{position:"relative"},children:[o.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:o.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((s=(a=e.builderBlock)==null?void 0:a.children)!=null&&s.length))?o.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(l=(r=e.builderBlock)==null?void 0:r.children)!=null&&l.length&&e.fitContent?o.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(c=(u=e.builderBlock)==null?void 0:u.children)!=null&&c.length&&!e.fitContent?o.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 yn=()=>[{component:Yt,...Qt},{component:tn,...Xt},{component:rn,...nn},{component:ln,...sn},{component:mn,...dn},{component:un,...cn},{component:gn,...fn},{component:bn,...hn},{component:je,...pn}],re=()=>[{component:de,...Pt},{component:Te,...Vt},{component:we,...Bt},{component:Ie,...Nt},{component:Ee,...qt},{component:Mt,...Ht},{component:Ne,...zt},{component:Re,...Jt},{component:Ut,...Ft},{component:Gt,...Kt},{component:jt,...Rt},...yn()],xn=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
56
193
|
function getAndSetVariantId() {
|
|
57
194
|
function setCookie(name, value, days) {
|
|
58
195
|
let expires = '';
|
|
@@ -108,7 +245,7 @@
|
|
|
108
245
|
}).join('');
|
|
109
246
|
styleEl.innerHTML = newStyleStr;
|
|
110
247
|
}
|
|
111
|
-
}`,
|
|
248
|
+
}`,vn=`function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
112
249
|
if (!navigator.cookieEnabled) {
|
|
113
250
|
return;
|
|
114
251
|
}
|
|
@@ -142,29 +279,29 @@
|
|
|
142
279
|
thisScriptEl?.remove();
|
|
143
280
|
}
|
|
144
281
|
return;
|
|
145
|
-
}`,Pe="builderIoAbTest",
|
|
146
|
-
window.${Pe} = ${
|
|
147
|
-
window.${
|
|
148
|
-
`,
|
|
282
|
+
}`,Pe="builderIoAbTest",Ve="builderIoRenderContent",_=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),Sn=({canTrack:e,content:t})=>!(!(_(t).length>0)||!e||p.isBrowser()),kn=e=>e==="react"||e==="reactNative",Be=kn(p.TARGET),Cn=()=>`
|
|
283
|
+
window.${Pe} = ${xn}
|
|
284
|
+
window.${Ve} = ${vn}
|
|
285
|
+
`,Tn=(e,t)=>`
|
|
149
286
|
window.${Pe}(
|
|
150
|
-
"${t}",${JSON.stringify(e)}, ${
|
|
151
|
-
)`,
|
|
152
|
-
"${t}", "${e}", ${
|
|
153
|
-
)`;function
|
|
287
|
+
"${t}",${JSON.stringify(e)}, ${Be}
|
|
288
|
+
)`,wn=({contentId:e,variationId:t})=>`window.${Ve}(
|
|
289
|
+
"${t}", "${e}", ${Be}
|
|
290
|
+
)`;function se(e){return Math.round(e*1e3)/1e3}const In=(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},En=e=>In(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),le=({event:e,target:t})=>{const n=t.getBoundingClientRect(),i=e.clientX-n.left,a=e.clientY-n.top,s=se(i/n.width),r=se(a/n.height);return{x:s,y:r}},Rn=e=>{const t=e.target,n=t&&En(t),i=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:i||void 0,metadata:{targetOffset:t?le({event:e,target:t}):void 0,builderTargetOffset:n?le({event:e,target:n}):void 0,builderElementIndex:n&&i?[].slice.call(document.getElementsByClassName(i)).indexOf(n):void 0}}},jn=["svelte","qwik","vue"],ce=()=>jn.includes(p.TARGET)&&(p.isEditing()||p.isPreviewing()),Pn=e=>{var s,r;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],i=(r=e.fileUrl)!=null?r:(s=e==null?void 0:e.files)==null?void 0:s.regular;let a="";if(i&&t&&n&&(a+=`
|
|
154
291
|
@font-face {
|
|
155
292
|
font-family: "${t}";
|
|
156
293
|
src: local("${n}"), url('${i}') format('woff2');
|
|
157
294
|
font-display: fallback;
|
|
158
295
|
font-weight: 400;
|
|
159
296
|
}
|
|
160
|
-
`.trim()),e.files)for(const
|
|
297
|
+
`.trim()),e.files)for(const l in e.files){if(!(String(Number(l))===l))continue;const c=e.files[l];c&&c!==i&&(a+=`
|
|
161
298
|
@font-face {
|
|
162
299
|
font-family: "${t}";
|
|
163
300
|
src: url('${c}') format('woff2');
|
|
164
301
|
font-display: fallback;
|
|
165
|
-
font-weight: ${
|
|
302
|
+
font-weight: ${l};
|
|
166
303
|
}
|
|
167
|
-
`.trim())}return
|
|
304
|
+
`.trim())}return a},Vn=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(n=>Pn(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:"",An=`
|
|
168
305
|
.builder-button {
|
|
169
306
|
all: unset;
|
|
170
307
|
}
|
|
@@ -181,8 +318,8 @@ font-weight: ${s};
|
|
|
181
318
|
text-align: inherit;
|
|
182
319
|
font-family: inherit;
|
|
183
320
|
}
|
|
184
|
-
`,
|
|
185
|
-
${
|
|
186
|
-
${
|
|
187
|
-
${
|
|
188
|
-
`.trim());return
|
|
321
|
+
`,Nn=e=>e?"":An,Fn=e=>`variant-${e}`;function Wn(e){var k,R,V;const t=b.useRef(null);function n(w){var E,I;const C={...e.builderContextSignal.rootState,...w};e.builderContextSignal.rootSetState?(I=(E=e.builderContextSignal).rootSetState)==null||I.call(E,C):e.setBuilderContextSignal(m=>({...m,rootState:C}))}function i(w){var E,I,m,T,P;const C={...e.builderContextSignal.content,...w,data:{...(E=e.builderContextSignal.content)==null?void 0:E.data,...w==null?void 0:w.data},meta:{...(I=e.builderContextSignal.content)==null?void 0:I.meta,...w==null?void 0:w.meta,breakpoints:((m=w==null?void 0:w.meta)==null?void 0:m.breakpoints)||((P=(T=e.builderContextSignal.content)==null?void 0:T.meta)==null?void 0:P.breakpoints)}};e.setBuilderContextSignal(j=>({...j,content:C}))}function a(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[s,r]=b.useState(()=>e.contentWrapper||"div");function l(w){return p.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:C=>{var m;const{breakpoints:E,contentId:I}=C;!I||I!==((m=e.builderContextSignal.content)==null?void 0:m.id)||E&&i({meta:{breakpoints:E}})},animation:C=>{pe(C)},contentUpdate:C=>{i(C)}}})(w)}const[u,c]=b.useState(()=>({})),[g,y]=b.useState(()=>({})),[f,x]=b.useState(()=>!1);function d(w){var C,E;if(e.builderContextSignal.content){const I=(C=e.builderContextSignal.content)==null?void 0:C.testVariationId,m=(E=e.builderContextSignal.content)==null?void 0:E.id;p._track({apiHost:e.apiHost,type:"click",canTrack:p.getDefaultCanTrack(e.canTrack),contentId:m,apiKey:e.apiKey,variationId:I!==m?I:void 0,...Rn(w),unique:!f})}f||x(!0)}function h(){var C,E,I;const w=(I=(E=(C=e.builderContextSignal.content)==null?void 0:C.data)==null?void 0:E.httpRequests)!=null?I:{};Object.entries(w).forEach(([m,T])=>{if(!T||g[m]||u[m]&&!p.isEditing())return;g[m]=!0;const P=T.replace(/{{([^}]+)}}/g,(j,N)=>String(F({code:N,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})));p.logFetch(P),fetch(P).then(j=>j.json()).then(j=>{n({[m]:j}),u[m]=!0}).catch(j=>{console.error("error fetching dynamic data",T,j)}).finally(()=>{g[m]=!1})})}function S(){p.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:A.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}const v=b.useRef(!1);return v.current||(h(),S(),v.current=!0),b.useEffect(()=>{var w,C,E;if(p.isBrowser()){if(p.isEditing()&&!e.isNestedRender&&(window.addEventListener("message",l),p.registerInsertMenu(),p.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(m=>{var T,P;if(!e.model||!((T=m.models)!=null&&T.length)||m.models.includes(e.model)){const j=p.createRegisterComponentMessage(m);(P=window.parent)==null||P.postMessage(j,"*")}}),window.addEventListener("builder:component:stateChangeListenerActivated",S)),e.builderContextSignal.content&&p.getDefaultCanTrack(e.canTrack)){const m=(w=e.builderContextSignal.content)==null?void 0:w.testVariationId,T=(C=e.builderContextSignal.content)==null?void 0:C.id,P=e.apiKey;p._track({apiHost:e.apiHost,type:"impression",canTrack:!0,contentId:T,apiKey:P,variationId:m!==T?m:void 0})}if(p.isPreviewing()&&!p.isEditing()){const m=new URL(location.href).searchParams,T=m.get("builder.preview"),P=m.get(`builder.overrides.${T}`),j=m.get("apiKey")||m.get("builder.space");(T==="BUILDER_STUDIO"||T===e.model&&j===e.apiKey&&(!e.content||P===e.content.id))&&p.fetchOneEntry({model:e.model||"",apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion,...T==="BUILDER_STUDIO"&&((E=e.context)!=null&&E.symbolId)?{query:{id:e.context.symbolId}}:{}}).then(N=>{N&&i(N)})}}},[]),b.useEffect(()=>{e.content&&i(e.content)},[e.content]),b.useEffect(()=>{S()},[e.builderContextSignal.rootState]),b.useEffect(()=>{e.data&&n(e.data)},[e.data]),b.useEffect(()=>{e.locale&&n({locale:e.locale})},[e.locale]),b.useEffect(()=>()=>{p.isBrowser()&&(window.removeEventListener("message",l),window.removeEventListener("builder:component:stateChangeListenerActivated",S))},[]),o.jsx(H.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content||ce()?o.jsx(s,{ref:t,onClick:w=>d(w),"builder-content-id":(k=e.builderContextSignal.content)==null?void 0:k.id,"builder-model":e.model,className:Fn(((R=e.content)==null?void 0:R.testVariationId)||((V=e.content)==null?void 0:V.id)),style:{display:!e.builderContextSignal.content&&ce()?"none":void 0},...a(),...e.contentWrapperProps,children:e.children}):null})}function Dn(e){const[t,n]=b.useState(()=>`
|
|
322
|
+
${Bn({cssCode:e.cssCode,contentId:e.contentId})}
|
|
323
|
+
${Vn({customFonts:e.customFonts})}
|
|
324
|
+
${Nn(e.isNestedRender)}
|
|
325
|
+
`.trim());return o.jsx($,{id:"builderio-content",styles:t,nonce:e.nonce})}const $n=({content:e,data:t,locale:n})=>{var s,r,l;const i={},a=((s=e==null?void 0:e.data)==null?void 0:s.state)||{};return(l=(r=e==null?void 0:e.data)==null?void 0:r.inputs)==null||l.forEach(u=>{u.name&&u.defaultValue!==void 0&&(i[u.name]=u.defaultValue)}),{...i,...a,...t,...n?{locale:n}:{}}},On=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function ue(e){var c,g,y,f,x,d,h,S,v;const[t,n]=b.useState(()=>{var k,R;return wn({variationId:(k=e.content)==null?void 0:k.testVariationId,contentId:(R=e.content)==null?void 0:R.id})});function i(k){l(R=>({...R,rootState:k}))}const[a,s]=b.useState(()=>[...re(),...e.customComponents||[]].reduce((k,{component:R,...V})=>({...k,[V.name]:{component:R,...p.serializeIncludingFunctions(V)}}),{})),[r,l]=b.useState(()=>({content:On({content:e.content,data:e.data}),localState:void 0,rootState:$n({content:e.content,data:e.data,locale:e.locale}),rootSetState:i,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...re(),...e.customComponents||[]].reduce((k,{component:R,...V})=>({...k,[V.name]:p.serializeIncludingFunctions(V)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{},nonce:e.nonce||"",model:e.model||""})),u=b.useRef(!1);if(!u.current){e.apiKey||p.logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");const k=(g=(c=r.content)==null?void 0:c.data)==null?void 0:g.jsCode;k&&F({code:k,context:e.context||{},localState:void 0,rootState:r.rootState,rootSetState:R=>{Object.assign(r.rootState,R)},isExpression:!1}),u.current=!0}return o.jsx(me.Provider,{value:{registeredComponents:a},children:o.jsxs(Wn,{apiHost:e.apiHost,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:r,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts,isNestedRender:e.isNestedRender,setBuilderContextSignal:l,children:[e.isSsrAbTest?o.jsx(q,{id:"builderio-variant-visibility",scriptStr:t,nonce:e.nonce||""}):null,o.jsx(Dn,{nonce:e.nonce||"",isNestedRender:e.isNestedRender,contentId:(y=r.content)==null?void 0:y.id,cssCode:(x=(f=r.content)==null?void 0:f.data)==null?void 0:x.cssCode,customFonts:(h=(d=r.content)==null?void 0:d.data)==null?void 0:h.customFonts}),o.jsx(B,{blocks:(v=(S=r.content)==null?void 0:S.data)==null?void 0:v.blocks,context:r,registeredComponents:a,linkComponent:e.linkComponent})]})})}function Ae(e){var r;const[t,n]=b.useState(()=>Sn({canTrack:p.getDefaultCanTrack(e.canTrack),content:e.content}));function i(){var l;return Tn(_(e.content).map(u=>({id:u.testVariationId,testRatio:u.testRatio})),((l=e.content)==null?void 0:l.id)||"")}function a(){return _(e.content).map(l=>`.variant-${l.testVariationId} { display: none; } `).join("")}function s(){var l;return t?{...e.content,testVariationId:(l=e.content)==null?void 0:l.id}:p.handleABTestingSync({item:e.content,canTrack:p.getDefaultCanTrack(e.canTrack)})}return b.useEffect(()=>{},[]),o.jsxs(o.Fragment,{children:[!e.isNestedRender&&p.TARGET!=="reactNative"?o.jsx(q,{id:"builderio-init-variants-fns",scriptStr:Cn(),nonce:e.nonce||""}):null,t?o.jsxs(o.Fragment,{children:[o.jsx($,{id:"builderio-variants",styles:a(),nonce:e.nonce||""}),o.jsx(q,{id:"builderio-variants-visibility",scriptStr:i(),nonce:e.nonce||""}),(r=_(e.content))==null?void 0:r.map(l=>o.jsx(ue,{apiHost:e.apiHost,isNestedRender:e.isNestedRender,nonce:e.nonce,content:l,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},l.testVariationId))]}):null,o.jsx(ue,{apiHost:e.apiHost,nonce:e.nonce,isNestedRender:e.isNestedRender,content:s(),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 Ln=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return p.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{p.logger.error("Could not fetch symbol content: ",n)})};function Ne(e){var l,u,c,g;function t(){return"div"}function n(){return"div"}function i(){var y,f;return[e.attributes[D()],"builder-symbol",(y=e.symbol)!=null&&y.inline?"builder-inline-symbol":void 0,(f=e.symbol)!=null&&f.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[a,s]=b.useState(()=>{var y;return(y=e.symbol)==null?void 0:y.content});function r(){a||Ln({symbol:e.symbol,builderContextValue:e.builderContext}).then(y=>{y&&s(y)})}return b.useEffect(()=>{},[]),b.useEffect(()=>{r()},[e.symbol]),o.jsx("div",{...e.attributes,className:i(),children:o.jsx(Ae,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(l=e.builderBlock)==null?void 0:l.id},customComponents:Object.values(e.builderComponents),data:{...(u=e.symbol)==null?void 0:u.data,...e.builderContext.localState,...(c=a==null?void 0:a.data)==null?void 0:c.state},canTrack:e.builderContext.canTrack,model:(g=e.symbol)==null?void 0:g.model,content:a,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:n()})})}exports.setClientUserAttributes=p.setClientUserAttributes;exports.Blocks=B;exports.BuilderContext=H;exports.Button=de;exports.Columns=Te;exports.Content=Ae;exports.Fragment=we;exports.Image=Ie;exports.Section=Ee;exports.Symbol=Ne;exports.Text=Re;exports.Video=je;
|