@builder.io/sdk-react 1.0.23 → 1.0.25
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 +31 -31
- package/lib/browser/blocks-exports.mjs +1042 -826
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/init.cjs +8 -1
- package/lib/browser/init.mjs +37 -2
- package/lib/browser/{server-entry-4ca9f249.js → server-entry-d15ee928.js} +2 -1
- package/lib/browser/{server-entry-f69e2b2a.cjs → server-entry-f28ec73b.cjs} +2 -2
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{blocks-93608689.js → blocks-7c1422af.js} +682 -685
- package/lib/edge/blocks-8c31869c.cjs +32 -0
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/button-3439cb1b.js +31 -0
- package/lib/edge/button-96857fcf.cjs +1 -0
- package/lib/edge/columns-0d152875.js +163 -0
- package/lib/edge/columns-930c3d9a.cjs +28 -0
- package/lib/edge/{content-variants-f416bff5.js → content-variants-1ff6980e.js} +404 -262
- package/lib/edge/content-variants-d62785c6.cjs +134 -0
- package/lib/edge/{form-8526db32.js → form-1dbd32d7.js} +3 -3
- package/lib/edge/{form-44ceed15.cjs → form-69ed6cc5.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-e85bf7a3.js → get-class-prop-name-58140fb7.js} +2 -1
- package/lib/edge/get-class-prop-name-c793129b.cjs +1 -0
- package/lib/edge/image-764070f8.cjs +17 -0
- package/lib/edge/{image-0008c792.js → image-9d24a962.js} +24 -24
- package/lib/edge/{img-a5802e2b.cjs → img-305b1676.cjs} +1 -1
- package/lib/edge/{img-5ef224a8.js → img-d4b1130f.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/init.cjs +8 -1
- package/lib/edge/init.mjs +37 -2
- package/lib/edge/{input-f1aa0191.cjs → input-28dd9b60.cjs} +1 -1
- package/lib/edge/{input-3f85283b.js → input-a7054c28.js} +1 -1
- package/lib/edge/{select-d4c018c0.cjs → select-57b6e444.cjs} +1 -1
- package/lib/edge/{select-4fe889b6.js → select-dd83a040.js} +1 -1
- package/lib/edge/{server-entry-e1e18fd2.js → server-entry-cb8ad418.js} +2 -1
- package/lib/edge/{server-entry-c4b7844d.cjs → server-entry-d9413c6f.cjs} +2 -2
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-2a11e808.cjs → slot-3f6aff1b.cjs} +1 -1
- package/lib/edge/{slot-97599025.js → slot-7dbe2bcb.js} +3 -3
- package/lib/edge/symbol-63f3b56e.cjs +1 -0
- package/lib/edge/{symbol-a90a41a3.js → symbol-a20aae0e.js} +32 -26
- package/lib/edge/tabs-f559c3bf.cjs +1 -0
- package/lib/edge/tabs-f5fd67a5.js +69 -0
- package/lib/node/blocks-exports.cjs +32 -32
- package/lib/node/blocks-exports.mjs +1158 -942
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +2 -2
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +8 -6
- package/lib/node/node-runtime-79a56b80.cjs +48 -0
- package/lib/node/{node-runtime-8062cfb8.js → node-runtime-def43b7b.js} +49 -47
- package/lib/node/{server-entry-3e54c767.js → server-entry-28bf4f4c.js} +1 -1
- package/lib/node/{server-entry-461bfaf9.cjs → server-entry-c4d16d70.cjs} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -1
- package/types/blocks/columns/columns.types.d.ts +1 -1
- package/types/blocks/columns/helpers.d.ts +1 -0
- package/types/blocks/tabs/component-info.d.ts +2 -0
- package/types/blocks/tabs/index.d.ts +1 -0
- package/types/blocks/tabs/tabs.d.ts +4 -0
- package/types/blocks/tabs/tabs.types.d.ts +13 -0
- package/types/blocks/text/text.types.d.ts +2 -1
- package/types/components/block/block.helpers.d.ts +4 -2
- package/types/components/content/components/styles.helpers.d.ts +1 -0
- package/types/components/dynamic-div.d.ts +15 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/evaluate/node-runtime/init.d.ts +4 -1
- package/types/functions/evaluate/node-runtime/node-runtime.d.ts +4 -1
- package/types/types/targets.d.ts +1 -1
- package/lib/edge/blocks-5539f58f.cjs +0 -32
- package/lib/edge/button-7e98d8f3.cjs +0 -1
- package/lib/edge/button-8816ab35.js +0 -28
- package/lib/edge/columns-8db639b5.cjs +0 -28
- package/lib/edge/columns-d065e3c4.js +0 -156
- package/lib/edge/content-variants-44d061f2.cjs +0 -134
- package/lib/edge/get-class-prop-name-7b951501.cjs +0 -1
- package/lib/edge/image-ee3dd857.cjs +0 -17
- package/lib/edge/symbol-dbb5c95e.cjs +0 -1
- package/lib/node/node-runtime-11a8cdfe.cjs +0 -48
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use client";"use strict";var
|
|
2
|
-
`),
|
|
3
|
-
${
|
|
1
|
+
"use client";"use strict";var Ae=Object.defineProperty;var We=(e,t,n)=>t in e?Ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var J=(e,t,n)=>(We(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),f=require("./server-entry-f28ec73b.cjs"),h=require("react"),Ne=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),$e=e=>typeof e=="string"&&Ne.has(e.toLowerCase());function Z(e){return a.jsx(a.Fragment,{children:$e(e.TagName)?a.jsx(a.Fragment,{children:a.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):a.jsx(a.Fragment,{children:typeof e.TagName=="string"?a.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):a.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}const M=()=>{switch(f.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,[M()]:`${e.link?"":"builder-button"} ${e.attributes[M()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}}}return a.jsx(Z,{attributes:t(),TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}const z=h.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}}),ue=h.createContext({registeredComponents:{}});function De(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const Le=({builder:e,context:t,event:n,state:i})=>Object.entries({state:i,Builder:e,builder:e,context:t,event:n}),Me=()=>({isEditing:f.isEditing(),isBrowser:f.isBrowser(),isServer:!f.isBrowser(),getUserAttributes:()=>f.getUserAttributes()}),Oe=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,ne=({code:e,builder:t,context:n,event:i,localState:o,rootSetState:r,rootState:s})=>{const l=Le({builder:t,context:n,event:i,state:me({rootState:s,localState:o,rootSetState:r})});return new Function(...l.map(([c])=>c),e)(...l.map(([,c])=>c))};function me({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(i,o)=>{if(t&&o in t)return t[o];const r=i[o];return typeof r=="object"&&r!==null?me({rootState:r,localState:void 0,rootSetState:n?s=>{i[o]=s,n(i)}:void 0}):r},set:(i,o,r)=>{if(t&&o in t)throw new Error("Writing to local state is not allowed as it is read-only.");return i[o]=r,n==null||n(i),!0}})}function Ue(){var e;return typeof process!="undefined"&&f.checkIsDefined((e=process==null?void 0:process.versions)==null?void 0:e.node)}const He=()=>{var i;if(!Ue())return!1;const e=process.arch==="arm64",t=process.version.startsWith("v20"),n=(i=process.env.NODE_OPTIONS)==null?void 0:i.includes("--no-node-snapshot");return e&&t&&!n?(f.logger.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "),!0):!1},Ke=e=>(f.isBrowser()||He(),ne(e)),A=class A{static getCacheKey(t){return JSON.stringify({...t,event:t.event?Math.random():void 0})}static getCachedValue(t){return A.cache.get(t)}static setCachedValue(t,n){A.cache.size>20&&A.cache.delete(A.cache.keys().next().value),A.cache.set(t,{value:n})}};J(A,"cacheLimit",20),J(A,"cache",new Map);let D=A;function O({code:e,context:t,localState:n,rootState:i,rootSetState:o,event:r,isExpression:s=!0,enableCache:l}){if(e==="")return;const c={code:Oe(e,{isExpression:s}),builder:Me(),context:t,event:r,rootSetState:o,rootState:i,localState:n};if(l){const d=D.getCacheKey(c),m=D.getCachedValue(d);if(m)return m.value}try{const d=Ke(c);if(l){const m=D.getCacheKey(c);D.setCachedValue(m,d)}return d}catch(d){f.logger.error("Failed code evaluation: "+d.message,{code:e});return}}const fe=(e,t,n)=>{if(Object(e)!==e)return e;const i=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return i.slice(0,-1).reduce((o,r,s)=>Object(o[r])===o[r]?o[r]:o[r]=Math.abs(Number(i[s+1]))>>0===+i[s+1]?[]:{},e)[i[i.length-1]]=n,e};const qe=({block:e,context:t,localState:n,rootState:i,rootSetState:o})=>{if(!e.bindings)return e;const r=f.fastClone(e),s={...r,properties:{...r.properties},actions:{...r.actions}};for(const l in e.bindings){const c=e.bindings[l],d=O({code:c,localState:n,rootState:i,rootSetState:o,context:t,enableCache:!0});fe(s,l,d)}return s};function q({block:e,context:t,shouldEvaluateBindings:n,localState:i,rootState:o,rootSetState:r}){const s=e;return n?qe({block:s,localState:i,rootState:o,rootSetState:r,context:t}):s}function ze(e,t,n={}){let i,o,r,s=null,l=0;const c=function(){l=n.leading===!1?0:Date.now(),s=null,r=e.apply(i,o),s||(i=o=null)};return function(){const d=Date.now();!l&&n.leading===!1&&(l=d);const m=t-(d-l);return i=this,o=arguments,m<=0||m>t?(s&&(clearTimeout(s),s=null),l=d,r=e.apply(i,o),s||(i=o=null)):!s&&n.trailing!==!1&&(s=setTimeout(c,m)),r}}function L(e,...t){const n=Object(e);for(let i=1;i<arguments.length;i++){const o=arguments[i];if(o!=null)for(const r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])}return n}const ee=e=>e?e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`):"";function _e(e){for(const t of e)switch(t.trigger){case"pageLoad":be(t);break;case"scrollInView":Ye(t);break}}function he(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function ge(e,t){const n=Je(e),i=getComputedStyle(t),o=e.steps[0].styles,r=e.steps[e.steps.length-1].styles,s=[o,r];for(const l of s)for(const c of n)c in l||(l[c]=i[c])}function Je(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 be(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=>{ge(e,n),n.style.transition="none",n.style.transitionDelay="0",L(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${ee(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),L(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}function Ye(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=>{ge(e,n);let i=!1,o=!1;function r(){!i&&l(n)?(i=!0,o=!0,setTimeout(()=>{L(n.style,e.steps[1].styles),e.repeat||document.removeEventListener("scroll",s),setTimeout(()=>{o=!1,e.repeat||(n.style.transition="",n.style.transitionDelay="")},(e.duration+(e.delay||0))*1e3+100)})):e.repeat&&i&&!o&&!l(n)&&(i=!1,L(n.style,e.steps[0].styles))}const s=ze(r,200,{leading:!1});function l(m){const u=m.getBoundingClientRect(),x=window.innerHeight,k=(e.thresholdPercent||0)/100*x;return u.bottom>k&&u.top<x-k}const c=e.steps[0].styles;function d(){L(n.style,c)}d(),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${ee(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")}),document.addEventListener("scroll",s,{capture:!0,passive:!0}),r()})}const Ge=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),xe=e=>Object.entries(e).map(([n,i])=>{if(typeof i=="string")return`${Ge(n)}: ${i};`}).filter(f.checkIsDefined),Qe=e=>xe(e).join(`
|
|
2
|
+
`),H=({mediaQuery:e,className:t,styles:n})=>{const i=`.${t} {
|
|
3
|
+
${Qe(n)}
|
|
4
4
|
}`;return e?`${e} {
|
|
5
5
|
${i}
|
|
6
|
-
}`:i};function
|
|
6
|
+
}`:i};function Xe({style:e}){return e}const Ze=({block:e,context:t})=>ye(Xe({style:e.style||{},context:t,block:e}));function ye(e){switch(f.TARGET){case"svelte":case"vue":case"solid":case"angular":return xe(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const et=({block:e,context:t,registeredComponents:n})=>{var r;const i=(r=q({block:e,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,shouldEvaluateBindings:!1}).component)==null?void 0:r.name;if(!i)return null;const o=n[i];if(o)return o;console.warn(`
|
|
7
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?`)},
|
|
8
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`)},tt=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const o=O({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,enableCache:!0});if(!Array.isArray(o))return;const r=n.collection.split(".").pop(),s=n.itemName||(r?r+"Item":"item");return o.map((c,d)=>({context:{...t,localState:{...t.localState,$index:d,$item:c,[s]:c,[`$${s}Index`]:d}},block:i}))},nt=e=>e&&(e.isRSC||["Core:Button","Symbol","Columns","Form:Form","Builder: Tabs"].includes(e.name)),it=e=>e&&(e.isRSC||["Symbol","Columns","Form:Form","Builder: Tabs"].includes(e.name)),pe={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},ie=(e,t=pe)=>`@media (max-width: ${t[e].max}px)`,Se=({small:e,medium:t})=>{const n=f.fastClone(pe);if(!e||!t)return n;const i=Math.floor(e/2);n.small={max:e,min:i,default:i+1};const o=n.small.max+1;n.medium={max:t,min:o,default:o+1};const r=n.medium.max+1;return n.large={max:2e3,min:r,default:r+1},n};function _(e){return a.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id})}function ot(e){function t(){const i=q({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return f.checkIsDefined(i.hide)?!i.hide:f.checkIsDefined(i.show)?i.show:!0}function n(){var E,j,P;const i=q({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),o=i.responsiveStyles,r=e.context.content,s=Se(((E=r==null?void 0:r.meta)==null?void 0:E.breakpoints)||{}),l=o==null?void 0:o.large,c=o==null?void 0:o.medium,d=o==null?void 0:o.small,m=i.id;if(!m)return"";const u=l?H({className:m,styles:l}):"",x=c?H({className:m,styles:c,mediaQuery:ie("medium",s)}):"",p=d?H({className:m,styles:d,mediaQuery:ie("small",s)}):"",k=i.animations&&i.animations.find(V=>V.trigger==="hover");let I="";if(k){const V=((P=(j=k.steps)==null?void 0:j[1])==null?void 0:P.styles)||{};I=H({className:`${m}:hover`,styles:{...V,transition:`all ${k.duration}s ${ee(k.easing)}`,transitionDelay:k.delay?`${k.delay}s`:"0s"}})||""}return[u,x,p,I].join(" ")}return a.jsx(a.Fragment,{children:n()&&t()?a.jsx(a.Fragment,{children:a.jsx(_,{id:"builderio-block",styles:n()})}):null})}function at(e){return e.charAt(0).toUpperCase()+e.slice(1)}const rt=e=>`on${at(e)}`,st=(e,t)=>n=>O({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1,enableCache:!0});function ve(e){var i;const t={},n=(i=e.block.actions)!=null?i:{};for(const o in n){if(!n.hasOwnProperty(o))continue;const r=n[o];let s=rt(o);if(e.stripPrefix)switch(f.TARGET){case"vue":s=s.replace("v-on:","");break;case"svelte":s=s.replace("on:","");break}t[s]=st(r,e)}return t}function lt({properties:e}){return e}const ct=e=>({href:e.href});function te({block:e,context:t}){var i;const n={...ct(e),...e.properties,"builder-id":e.id,style:Ze({block:e,context:t}),[M()]:[e.id,"builder-block",e.class,(i=e.properties)==null?void 0:i.class].filter(Boolean).join(" ")};return lt({properties:n,context:t,block:e})}function dt(e){return a.jsx(Z,{TagName:e.Wrapper,attributes:te({block:e.block,context:e.context}),actionAttributes:ve({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 ut(e){function t(){return e.includeBlockProps?{...te({block:e.block,context:e.context}),...ve({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{}}return a.jsx(e.Wrapper,{...e.wrapperProps,attributes:t(),children:e.children})}const mt=({componentOptions:e,builderBlock:t,context:n,componentRef:i,includeBlockProps:o,isInteractive:r,contextValue:s})=>{const l={...e,...o?{attributes:te({block:t,context:s})}:{}};return r?{Wrapper:i,block:t,context:n,wrapperProps:e,includeBlockProps:o}:l};function oe(e){var i;const[t,n]=h.useState(()=>e.isInteractive?ut:e.componentRef);return a.jsx(a.Fragment,{children:e.componentRef?a.jsx(a.Fragment,{children:a.jsx(t,{...mt({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(i=e.blockChildren)==null?void 0:i.map(o=>a.jsx(U,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}function ft(e){const[t,n]=h.useState(()=>e.repeatContext);return a.jsx(z.Provider,{value:t,children:a.jsx(U,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})})}function U(e){var c,d,m;function t(){return et({block:e.block,context:e.context,registeredComponents:e.registeredComponents})}function n(){return tt({block:e.block,context:e.context})}function i(){var u;return(u=e.block.repeat)!=null&&u.collection?e.block:q({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})}function o(){var x;return e.block.tagName==="a"||((x=i().properties)==null?void 0:x.href)||i().href?e.linkComponent||"a":e.block.tagName||"div"}function r(){var p,k;if((p=e.block.repeat)!=null&&p.collection)return!!((k=n==null?void 0:n())!=null&&k.length);const u="hide"in i()?i().hide:!1;return("show"in i()?i().show:!0)&&!u}function s(){var x,p;return!((x=t==null?void 0:t())!=null&&x.component)&&!n()?(p=i().children)!=null?p:[]:[]}function l(){var u,x,p,k;return{blockChildren:(u=i().children)!=null?u:[],componentRef:(x=t==null?void 0:t())==null?void 0:x.component,componentOptions:{...De(i()),builderContext:e.context,...nt(t())?{builderLinkComponent:e.linkComponent}:{},...it(t())?{builderComponents:e.registeredComponents}:{}},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:i(),includeBlockProps:((p=t==null?void 0:t())==null?void 0:p.noWrap)===!0,isInteractive:!((k=t==null?void 0:t())!=null&&k.isRSC)}}return h.useEffect(()=>{const u=i().id,x=i().animations;x&&u&&_e(x.map(p=>({...p,elementId:u})))},[]),a.jsx(a.Fragment,{children:r()?a.jsxs(a.Fragment,{children:[a.jsx(ot,{block:e.block,context:e.context}),(c=t==null?void 0:t())!=null&&c.noWrap?a.jsx(a.Fragment,{children:a.jsx(oe,{componentRef:l().componentRef,componentOptions:l().componentOptions,blockChildren:l().blockChildren,context:l().context,registeredComponents:l().registeredComponents,linkComponent:l().linkComponent,builderBlock:l().builderBlock,includeBlockProps:l().includeBlockProps,isInteractive:l().isInteractive})}):a.jsx(a.Fragment,{children:n()?a.jsx(a.Fragment,{children:(m=n())==null?void 0:m.map((u,x)=>a.jsx(ft,{repeatContext:u.context,block:u.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},x))}):a.jsxs(dt,{Wrapper:o(),block:i(),context:e.context,linkComponent:e.linkComponent,children:[a.jsx(oe,{componentRef:l().componentRef,componentOptions:l().componentOptions,blockChildren:l().blockChildren,context:l().context,registeredComponents:l().registeredComponents,linkComponent:l().linkComponent,builderBlock:l().builderBlock,includeBlockProps:l().includeBlockProps,isInteractive:l().isInteractive}),(d=s())==null?void 0:d.map(u=>a.jsx(U,{block:u,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},u.id))]})})]}):null})}function ht(e){function t(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function n(){var o,r;f.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((r=window.parent)==null||r.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function i(){var o,r;f.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((r=window.parent)==null||r.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return a.jsxs(a.Fragment,{children:[a.jsx(e.BlocksWrapper,{className:t()+" props-blocks-wrapper-7cd1560e","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>n(),onMouseEnter:o=>i(),onKeyPress:o=>n(),...e.BlocksWrapperProps,children:e.children}),a.jsx("style",{children:`.props-blocks-wrapper-7cd1560e {
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
align-items: stretch;
|
|
12
|
-
}`})]})}function W(e){var i,
|
|
13
|
-
@media (max-width: ${
|
|
12
|
+
}`})]})}function W(e){var i,o,r;const t=h.useContext(z),n=h.useContext(ue);return a.jsx(ht,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,BlocksWrapper:((i=e.context)==null?void 0:i.BlocksWrapper)||t.BlocksWrapper,BlocksWrapperProps:((o=e.context)==null?void 0:o.BlocksWrapperProps)||t.BlocksWrapperProps,children:e.blocks?a.jsx(a.Fragment,{children:(r=e.blocks)==null?void 0:r.map(s=>a.jsx(U,{block:s,linkComponent:e.linkComponent,context:e.context||t,registeredComponents:e.registeredComponents||n.registeredComponents},s.id))}):null})}const gt=e=>`builder-columns ${e}-breakpoints`;function ke(e){var V,N;const[t,n]=h.useState(()=>typeof e.space=="number"?e.space||0:20),[i,o]=h.useState(()=>e.columns||[]),[r,s]=h.useState(()=>e.stackColumnsAt||"tablet");function l(v){return v.link?e.builderLinkComponent||"a":"div"}function c(v){var w;return((w=i[v])==null?void 0:w.width)||100/i.length}function d(v){const w=t*(i.length-1)/i.length;return`calc(${c(v)}% - ${w}px)`}function m({stackedStyle:v,desktopStyle:w}){return r==="tablet"?v:w}function u({stackedStyle:v,desktopStyle:w}){return r==="never"?w:v}const[x,p]=h.useState(()=>e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column");function k(){return{"--flex-dir":x,"--flex-dir-tablet":m({stackedStyle:x,desktopStyle:"row"})}}function I(v){const w=v===0?0:t,B=d(v),b=`${w}px`,g="100%",y=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:B,["marginLeft"]:b,"--column-width-mobile":u({stackedStyle:g,desktopStyle:B}),"--column-margin-left-mobile":u({stackedStyle:y,desktopStyle:b}),"--column-width-tablet":m({stackedStyle:g,desktopStyle:B}),"--column-margin-left-tablet":m({stackedStyle:y,desktopStyle:b})}}function E(v){var B,b;return Se(((b=(B=e.builderContext.content)==null?void 0:B.meta)==null?void 0:b.breakpoints)||{})[v].max}function j(){return`
|
|
13
|
+
@media (max-width: ${E("medium")}px) {
|
|
14
14
|
.${e.builderBlock.id}-breakpoints {
|
|
15
15
|
flex-direction: var(--flex-dir-tablet);
|
|
16
16
|
align-items: stretch;
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
@media (max-width: ${
|
|
25
|
+
@media (max-width: ${E("small")}px) {
|
|
26
26
|
.${e.builderBlock.id}-breakpoints {
|
|
27
27
|
flex-direction: var(--flex-dir);
|
|
28
28
|
align-items: stretch;
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
`}return
|
|
36
|
+
`}function P(v,w){return{...v.link?{href:v.link}:{},[M()]:"builder-column",style:ye(I(w))}}return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:gt((V=e.builderBlock)==null?void 0:V.id)+" div-00cb97e2",style:k(),children:[a.jsx(_,{id:"builderio-columns",styles:j()}),(N=e.columns)==null?void 0:N.map((v,w)=>a.jsx(Z,{TagName:l(v),actionAttributes:{},attributes:P(v,w),children:a.jsx(W,{path:`component.options.columns.${w}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:v.blocks})},w))]}),a.jsx("style",{children:`.div-00cb97e2 {
|
|
37
37
|
display: flex;
|
|
38
38
|
line-height: normal;
|
|
39
|
-
}`})]})}function
|
|
39
|
+
}`})]})}function Ce(e){return a.jsx("span",{children:e.children})}function ae(e){return e.replace(/http(s)?:/,"")}function bt(e="",t,n){const i=new RegExp("([?&])"+t+"=.*?(&|$)","i"),o=e.indexOf("?")!==-1?"&":"?";return e.match(i)?e.replace(i,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+o+t+"="+encodeURIComponent(n)}function xt(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]),o=n[3],r=t.match("x")?t:`${t}x`;return ae(`${i[0]}_${r}${o}`)}return null}function Y(e){if(!e)return e;const t=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let n=e;const i=Number(e.split("?width=")[1]);return isNaN(i)||(n=`${n} ${i}w`),t.filter(o=>o!==i).map(o=>`${bt(e,"width",o)} ${o}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[xt(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,i])=>`${n} ${i}w`).concat([e]).join(", "):e}function Te(e){var o,r,s,l,c,d;function t(){var x;const u=e.image||e.src;if(!u||!(u.match(/builder\.io/)||u.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((x=e.image)!=null&&x.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),Y(u)}else if(e.image&&!e.srcset)return Y(u);return Y(u)}function n(){var m;return(m=t==null?void 0:t())!=null&&m.match(/builder\.io/)&&!e.noWebp?t().replace(/\?/g,"?format=webp&"):""}function i(){const m={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?m:void 0}return a.jsxs(a.Fragment,{children:[a.jsxs(a.Fragment,{children:[a.jsxs("picture",{children:[n()?a.jsx("source",{type:"image/webp",srcSet:n()}):null,a.jsx("img",{loading:"lazy",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-3ac67dd4",src:e.image,srcSet:t(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(o=e.builderBlock)==null?void 0:o.children)!=null&&r.length&&e.fitContent)?a.jsx("div",{className:"builder-image-sizer div-3ac67dd4",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(l=(s=e.builderBlock)==null?void 0:s.children)!=null&&l.length&&e.fitContent?a.jsx(a.Fragment,{children:e.children}):null,!e.fitContent&&((d=(c=e.builderBlock)==null?void 0:c.children)!=null&&d.length)?a.jsx("div",{className:"div-3ac67dd4-2",children:e.children}):null]}),a.jsx("style",{children:`.img-3ac67dd4 {
|
|
40
40
|
opacity: 1;
|
|
41
41
|
transition: opacity 0.2s ease-in-out;
|
|
42
|
-
}.div-
|
|
42
|
+
}.div-3ac67dd4 {
|
|
43
43
|
width: 100%;
|
|
44
44
|
pointer-events: none;
|
|
45
45
|
font-size: 0;
|
|
46
|
-
}.div-
|
|
46
|
+
}.div-3ac67dd4-2 {
|
|
47
47
|
display: flex;
|
|
48
48
|
flex-direction: column;
|
|
49
49
|
align-items: stretch;
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
left: 0;
|
|
53
53
|
width: 100%;
|
|
54
54
|
height: 100%;
|
|
55
|
-
}`})]})}function ke(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 mt={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},ft={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(r=>!r.get("width"))||n.reduce((l,d)=>l+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}]},ht={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},gt={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(s,l=6e4){return new Promise((d,c)=>{const m=document.createElement("img");let g=!1;m.onload=()=>{g=!0,d(m)},m.addEventListener("error",x=>{console.warn("Image load failed",x.error),c(x.error)}),m.src=s,setTimeout(()=>{g||c(new Error("Image load timed out"))},l)})}function i(s){return Math.round(s*1e3)/1e3}const a=e.get("image"),r=e.get("aspectRatio");if(fetch(a).then(s=>s.blob()).then(s=>{s.type.includes("svg")&&e.set("noWebp",!0)}),a&&(!r||r===.7041))return n(a).then(s=>{const l=e.get("aspectRatio");e.get("image")===a&&(!l||l===.7041)&&s.width&&s.height&&(e.set("aspectRatio",i(s.height/s.width)),e.set("height",s.height),e.set("width",s.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:"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}]},bt={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>"}}}]},xt={name:"Slot",isRSC:!0,description:"Allow child blocks to be inserted into this content when used as a Symbol",docsLink:"https://www.builder.io/c/docs/symbols-with-blocks",image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",inputs:[{name:"name",type:"string",required:!0,defaultValue:"children"}]};function yt(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(W,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(i=e.builderContext.rootState)==null?void 0:i[e.name]})})}const pt={name:"Symbol",noWrap:!0,static:!0,isRSC:!0,inputs:[{name:"symbol",type:"uiSymbol"},{name:"dataOnly",helperText:"Make this a data symbol that doesn't display any UI",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"inheritState",helperText:"Inherit the parent component state and data",type:"boolean",defaultValue:!1,advanced:!0},{name:"renderToLiquid",helperText:"Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"useChildren",hideFromUI:!0,type:"boolean"}]},St={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 Ce(e){var t;return o.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const vt={name:"Custom Code",static:!0,requiredPermissions:["editCode"],inputs:[{name:"code",type:"html",required:!0,defaultValue:"<p>Hello there, I am custom HTML code!</p>",code:!0},{name:"replaceNodes",type:"boolean",helperText:"Preserve server rendered dom nodes",advanced:!0},{name:"scriptsClientOnly",type:"boolean",defaultValue:!1,helperText:"Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",advanced:!0}]};function kt(e){const t=h.useRef(null),[n,i]=h.useState(()=>[]),[a,r]=h.useState(()=>[]);return h.useEffect(()=>{var l;if(!((l=t.current)!=null&&l.getElementsByTagName)||typeof window=="undefined")return;const s=t.current.getElementsByTagName("script");for(let d=0;d<s.length;d++){const c=s[d];if(c.src){if(n.includes(c.src))continue;n.push(c.src);const m=document.createElement("script");m.async=!0,m.src=c.src,document.head.appendChild(m)}else if(!c.type||["text/javascript","application/javascript","application/ecmascript"].includes(c.type)){if(a.includes(c.innerText))continue;try{a.push(c.innerText),new Function(c.innerText)()}catch(m){console.warn("`CustomCode`: Error running script:",m)}}}},[]),o.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const Ct={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc",onChange:e=>{const t=e.get("url");if(t)return e.set("content","Loading..."),fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then(i=>i.json()).then(i=>{e.get("url")===t&&(i.html?e.set("content",i.html):e.set("content","Invalid url, please try another"))}).catch(i=>{e.set("content","There was an error embedding this URL, please try again or another URL")});e.delete("content")}},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},wt=["text/javascript","application/javascript","application/ecmascript"],It=e=>wt.includes(e.type);function Tt(e){const t=h.useRef(null),[n,i]=h.useState(()=>[]),[a,r]=h.useState(()=>[]),[s,l]=h.useState(()=>!1);function d(){if(!t.current||!t.current.getElementsByTagName)return;const c=t.current.getElementsByTagName("script");for(let m=0;m<c.length;m++){const g=c[m];if(g.src&&!n.includes(g.src)){n.push(g.src);const x=document.createElement("script");x.async=!0,x.src=g.src,document.head.appendChild(x)}else if(It(g)&&!a.includes(g.innerText))try{a.push(g.innerText),new Function(g.innerText)()}catch(x){console.warn("`Embed`: Error running script:",x)}}}return h.useEffect(()=>{t.current&&!s&&(l(!0),d())},[t.current,s]),o.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const Et={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"}}}]},jt=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],Rt=()=>{const e=process.env.NODE_ENV||"production";return jt.includes(e)?e:"production"},Pt=(e,t,n)=>{const i=String.prototype.split.call(t,/[,[\].]+?/).filter(Boolean).reduce((a,r)=>a!=null?a[r]:a,e);return i===void 0||i===e?n:i};function Vt(e){var g,x;const t=h.useRef(null),[n,i]=h.useState(()=>"unsubmitted"),[a,r]=h.useState(()=>null),[s,l]=h.useState(()=>"");function d(p){var w,T;const v={...e.builderContext.rootState,...p};e.builderContext.rootSetState?(T=(w=e.builderContext).rootSetState)==null||T.call(w,v):e.builderContext.rootState=v}function c(){return f.isEditing()&&e.previewState||n}function m(p){var w;const v=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")p.preventDefault();else if(v){if(!(e.action||e.sendSubmissionsTo==="email")){p.preventDefault();return}p.preventDefault();const T=p.currentTarget,E=e.customHeaders||{};let S;const C=new FormData(T),R=Array.from(p.currentTarget.querySelectorAll("input,select,textarea")).filter(u=>!!u.name).map(u=>{let b;const I=u.name;if(u instanceof HTMLInputElement)if(u.type==="radio"){if(u.checked)return b=u.name,{key:I,value:b}}else if(u.type==="checkbox")b=u.checked;else if(u.type==="number"||u.type==="range"){const y=u.valueAsNumber;isNaN(y)||(b=y)}else u.type==="file"?b=u.files:b=u.value;else b=u.value;return{key:I,value:b}});let j=e.contentType;if(e.sendSubmissionsTo==="email"&&(j="multipart/form-data"),Array.from(R).forEach(({value:u})=>{(u instanceof File||Array.isArray(u)&&u[0]instanceof File||u instanceof FileList)&&(j="multipart/form-data")}),j!=="application/json")S=C;else{const u={};Array.from(R).forEach(({value:b,key:I})=>{de(u,I,b)}),S=JSON.stringify(u)}j&&j!=="multipart/form-data"&&(v&&((w=e.action)!=null&&w.includes("zapier.com"))||(E["content-type"]=j));const B=new CustomEvent("presubmit",{detail:{body:S}});if(t.current&&(t.current.dispatchEvent(B),B.defaultPrevented))return;i("sending");const A=`${Rt()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`;fetch(e.sendSubmissionsTo==="email"?A:e.action,{body:S,headers:E,method:e.method||"post"}).then(async u=>{let b;const I=u.headers.get("content-type");if(I&&I.indexOf("application/json")!==-1?b=await u.json():b=await u.text(),!u.ok&&e.errorMessagePath){let y=Pt(b,e.errorMessagePath);y&&(typeof y!="string"&&(y=JSON.stringify(y)),l(y),d({formErrorMessage:y}))}if(r(b),i(u.ok?"success":"error"),u.ok){const y=new CustomEvent("submit:success",{detail:{res:u,body:b}});if(t.current){if(t.current.dispatchEvent(y),y.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const k=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(k),k.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},u=>{const b=new CustomEvent("submit:error",{detail:{error:u}});t.current&&(t.current.dispatchEvent(b),b.defaultPrevented)||(r(u),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:p=>m(p),...e.attributes,children:[e.builderBlock&&e.builderBlock.children?o.jsx(o.Fragment,{children:(x=(g=e.builderBlock)==null?void 0:g.children)==null?void 0:x.map((p,v)=>o.jsx(O,{block:p,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${v}`))}):null,c()==="error"?o.jsx(W,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,c()==="sending"?o.jsx(W,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,c()==="error"&&a?o.jsx("pre",{className:"builder-form-error-text pre-31bf8a14",children:JSON.stringify(a,null,2)}):null,c()==="success"?o.jsx(W,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",o.jsx("style",{children:".pre-31bf8a14 { padding: 10px; color: red; text-align: center; }"})," "]})}const Ft={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 Bt(e){return h.createElement("input",{...e.attributes,key:f.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 At={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 Wt(e){var t;return h.createElement("select",{...e.attributes,value:e.value,key:f.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name},(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 Nt={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 $t(e){return o.jsx("button",{type:"submit",...e.attributes,children:e.text})}const Dt={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:["jpeg","jpg","png","svg","gif","webp"],required:!0}],noWrap:!0,static:!0};function Lt(e){return o.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},f.isEditing()&&e.imgSrc||"default-key")}const Mt={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}]};function we(e){var i,a,r,s,l,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 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&&((r=(a=e.builderBlock)==null?void 0:a.children)!=null&&r.length))?o.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(l=(s=e.builderBlock)==null?void 0:s.children)!=null&&l.length&&e.fitContent?o.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?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 Ot=()=>[{component:kt,...vt},{component:Tt,...Ct},{component:Vt,...Et},{component:Bt,...Ft},{component:$t,...Nt},{component:Wt,...At},{component:Lt,...Dt},{component:we,...Mt}],ie=()=>[{component:se,...mt},{component:pe,...ft},{component:Se,...ht},{component:ve,...gt},{component:ke,...bt},{component:yt,...xt},{component:Re,...pt},{component:Ce,...St},...Ot()],Ut=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
55
|
+
}`})]})}function we(e){return a.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}const yt={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},pt={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){n.forEach(i=>{i.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(o=>o.get("width"))&&(n.find(r=>!r.get("width"))||n.reduce((l,c)=>l+c.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}]},St={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},vt={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(s,l=6e4){return new Promise((c,d)=>{const m=document.createElement("img");let u=!1;m.onload=()=>{u=!0,c(m)},m.addEventListener("error",x=>{console.warn("Image load failed",x.error),d(x.error)}),m.src=s,setTimeout(()=>{u||d(new Error("Image load timed out"))},l)})}function i(s){return Math.round(s*1e3)/1e3}const o=e.get("image"),r=e.get("aspectRatio");if(fetch(o).then(s=>s.blob()).then(s=>{s.type.includes("svg")&&e.set("noWebp",!0)}),o&&(!r||r===.7041))return n(o).then(s=>{const l=e.get("aspectRatio");e.get("image")===o&&(!l||l===.7041)&&s.width&&s.height&&(e.set("aspectRatio",i(s.height/s.width)),e.set("height",s.height),e.set("width",s.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:"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}]},kt={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>"}}}]},Ct={name:"Slot",isRSC:!0,description:"Allow child blocks to be inserted into this content when used as a Symbol",docsLink:"https://www.builder.io/c/docs/symbols-with-blocks",image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",inputs:[{name:"name",type:"string",required:!0,defaultValue:"children"}]};function Tt(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(W,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(i=e.builderContext.rootState)==null?void 0:i[e.name]})})}const 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"}]},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"}}},Q={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{height:"200px",display:"flex",marginTop:"20px",flexDirection:"column"}},component:{name:"Text",options:{text:"New tab content "}}},It={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:[Q]}],defaultValue:[{label:[{...G,component:{name:"Text",options:{text:"Tab 1"}}}],content:[{...Q,component:{name:"Text",options:{text:"Tab 1 content"}}}]},{label:[{...G,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"}]}]};function Et(e){var r;const[t,n]=h.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function i(s){return e.tabs&&e.tabs[s].content}function o(s){return t===s?e.activeTabStyle:{}}return a.jsxs("div",{children:[a.jsx("div",{className:"builder-tabs-wrap",style:{display:"flex",flexDirection:"row",justifyContent:e.tabHeaderLayout||"flex-start",overflow:"auto"},children:(r=e.tabs)==null?void 0:r.map((s,l)=>a.jsx("span",{className:`builder-tab-wrap ${t===l?"builder-tab-active":""}`,style:o(l),onClick:c=>{l===t&&e.collapsible?n(-1):n(l)},children:a.jsx(W,{parent:e.builderBlock.id,path:`component.options.tabs.${l}.label`,blocks:s.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},l))}),i(t)?a.jsx("div",{children:a.jsx(W,{parent:e.builderBlock.id,path:`component.options.tabs.${t}.content`,blocks:i(t),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}const jt={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 Ie(e){var t;return a.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const Rt={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 Pt(e){const t=h.useRef(null),[n,i]=h.useState(()=>[]),[o,r]=h.useState(()=>[]);return h.useEffect(()=>{var l;if(!((l=t.current)!=null&&l.getElementsByTagName)||typeof window=="undefined")return;const s=t.current.getElementsByTagName("script");for(let c=0;c<s.length;c++){const d=s[c];if(d.src){if(n.includes(d.src))continue;n.push(d.src);const m=document.createElement("script");m.async=!0,m.src=d.src,document.head.appendChild(m)}else if(!d.type||["text/javascript","application/javascript","application/ecmascript"].includes(d.type)){if(o.includes(d.innerText))continue;try{o.push(d.innerText),new Function(d.innerText)()}catch(m){console.warn("`CustomCode`: Error running script:",m)}}}},[]),a.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const Vt={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc",onChange:e=>{const t=e.get("url");if(t)return e.set("content","Loading..."),fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then(i=>i.json()).then(i=>{e.get("url")===t&&(i.html?e.set("content",i.html):e.set("content","Invalid url, please try another"))}).catch(i=>{e.set("content","There was an error embedding this URL, please try again or another URL")});e.delete("content")}},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},Bt=["text/javascript","application/javascript","application/ecmascript"],Ft=e=>Bt.includes(e.type);function At(e){const t=h.useRef(null),[n,i]=h.useState(()=>[]),[o,r]=h.useState(()=>[]),[s,l]=h.useState(()=>!1);function c(){if(!t.current||!t.current.getElementsByTagName)return;const d=t.current.getElementsByTagName("script");for(let m=0;m<d.length;m++){const u=d[m];if(u.src&&!n.includes(u.src)){n.push(u.src);const x=document.createElement("script");x.async=!0,x.src=u.src,document.head.appendChild(x)}else if(Ft(u)&&!o.includes(u.innerText))try{o.push(u.innerText),new Function(u.innerText)()}catch(x){console.warn("`Embed`: Error running script:",x)}}}return h.useEffect(()=>{t.current&&!s&&(l(!0),c())},[t.current,s]),a.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const Wt={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"}}}]},Nt=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],$t=()=>{const e=process.env.NODE_ENV||"production";return Nt.includes(e)?e:"production"},Dt=(e,t,n)=>{const i=String.prototype.split.call(t,/[,[\].]+?/).filter(Boolean).reduce((o,r)=>o!=null?o[r]:o,e);return i===void 0||i===e?n:i};function Lt(e){var u,x;const t=h.useRef(null),[n,i]=h.useState(()=>"unsubmitted"),[o,r]=h.useState(()=>null),[s,l]=h.useState(()=>"");function c(p){var I,E;const k={...e.builderContext.rootState,...p};e.builderContext.rootSetState?(E=(I=e.builderContext).rootSetState)==null||E.call(I,k):e.builderContext.rootState=k}function d(){return f.isEditing()&&e.previewState||n}function m(p){var I;const k=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")p.preventDefault();else if(k){if(!(e.action||e.sendSubmissionsTo==="email")){p.preventDefault();return}p.preventDefault();const E=p.currentTarget,j=e.customHeaders||{};let P;const V=new FormData(E),N=Array.from(p.currentTarget.querySelectorAll("input,select,textarea")).filter(b=>!!b.name).map(b=>{let g;const y=b.name;if(b instanceof HTMLInputElement)if(b.type==="radio"){if(b.checked)return g=b.name,{key:y,value:g}}else if(b.type==="checkbox")g=b.checked;else if(b.type==="number"||b.type==="range"){const S=b.valueAsNumber;isNaN(S)||(g=S)}else b.type==="file"?g=b.files:g=b.value;else g=b.value;return{key:y,value:g}});let v=e.contentType;if(e.sendSubmissionsTo==="email"&&(v="multipart/form-data"),Array.from(N).forEach(({value:b})=>{(b instanceof File||Array.isArray(b)&&b[0]instanceof File||b instanceof FileList)&&(v="multipart/form-data")}),v!=="application/json")P=V;else{const b={};Array.from(N).forEach(({value:g,key:y})=>{fe(b,y,g)}),P=JSON.stringify(b)}v&&v!=="multipart/form-data"&&(k&&((I=e.action)!=null&&I.includes("zapier.com"))||(j["content-type"]=v));const w=new CustomEvent("presubmit",{detail:{body:P}});if(t.current&&(t.current.dispatchEvent(w),w.defaultPrevented))return;i("sending");const B=`${$t()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`;fetch(e.sendSubmissionsTo==="email"?B:e.action,{body:P,headers:j,method:e.method||"post"}).then(async b=>{let g;const y=b.headers.get("content-type");if(y&&y.indexOf("application/json")!==-1?g=await b.json():g=await b.text(),!b.ok&&e.errorMessagePath){let S=Dt(g,e.errorMessagePath);S&&(typeof S!="string"&&(S=JSON.stringify(S)),l(S),c({formErrorMessage:S}))}if(r(g),i(b.ok?"success":"error"),b.ok){const S=new CustomEvent("submit:success",{detail:{res:b,body:g}});if(t.current){if(t.current.dispatchEvent(S),S.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const C=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(C),C.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},b=>{const g=new CustomEvent("submit:error",{detail:{error:b}});t.current&&(t.current.dispatchEvent(g),g.defaultPrevented)||(r(b),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:p=>m(p),...e.attributes,children:[e.builderBlock&&e.builderBlock.children?a.jsx(a.Fragment,{children:(x=(u=e.builderBlock)==null?void 0:u.children)==null?void 0:x.map((p,k)=>a.jsx(U,{block:p,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${k}`))}):null,d()==="error"?a.jsx(W,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,d()==="sending"?a.jsx(W,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,d()==="error"&&o?a.jsx("pre",{className:"builder-form-error-text pre-31bf8a14",children:JSON.stringify(o,null,2)}):null,d()==="success"?a.jsx(W,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",a.jsx("style",{children:".pre-31bf8a14 { padding: 10px; color: red; text-align: center; }"})," "]})}const Mt={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 Ot(e){return h.createElement("input",{...e.attributes,key:f.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 Ut={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 Ht(e){var t;return h.createElement("select",{...e.attributes,value:e.value,key:f.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name},(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 Kt={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 qt(e){return a.jsx("button",{type:"submit",...e.attributes,children:e.text})}const zt={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:["jpeg","jpg","png","svg","gif","webp"],required:!0}],noWrap:!0,static:!0};function _t(e){return a.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},f.isEditing()&&e.imgSrc||"default-key")}const Jt={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}]};function Ee(e){var i,o,r,s,l,c,d;function t(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function n(){return{...t()}}return a.jsxs("div",{style:{position:"relative"},children:[a.jsx("video",{className:"builder-video",...n(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(i=e.attributes)==null?void 0:i.style,objectFit:e.fit,objectPosition:e.position,zIndex:2,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},src:e.video||"no-src",poster:e.posterImage,children:e.lazyLoad?null:a.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((r=(o=e.builderBlock)==null?void 0:o.children)!=null&&r.length))?a.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(l=(s=e.builderBlock)==null?void 0:s.children)!=null&&l.length&&e.fitContent?a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(d=(c=e.builderBlock)==null?void 0:c.children)!=null&&d.length&&!e.fitContent?a.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children}):null]})}const Yt=()=>[{component:Pt,...Rt},{component:At,...Vt},{component:Lt,...Wt},{component:Ot,...Mt},{component:qt,...Kt},{component:Ht,...Ut},{component:_t,...zt},{component:Ee,...Jt}],re=()=>[{component:de,...yt},{component:ke,...pt},{component:Ce,...St},{component:Te,...vt},{component:we,...kt},{component:Tt,...Ct},{component:Be,...wt},{component:Ie,...jt},{component:Et,...It},...Yt()],Gt=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
56
56
|
function getAndSetVariantId() {
|
|
57
57
|
function setCookie(name, value, days) {
|
|
58
58
|
let expires = '';
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
}).join('');
|
|
109
109
|
styleEl.innerHTML = newStyleStr;
|
|
110
110
|
}
|
|
111
|
-
}`,
|
|
111
|
+
}`,Qt=`function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
112
112
|
if (!navigator.cookieEnabled) {
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
@@ -142,29 +142,29 @@
|
|
|
142
142
|
thisScriptEl?.remove();
|
|
143
143
|
}
|
|
144
144
|
return;
|
|
145
|
-
}`,
|
|
146
|
-
window.${
|
|
147
|
-
window.${
|
|
148
|
-
`,
|
|
149
|
-
window.${
|
|
150
|
-
"${t}",${JSON.stringify(e)}, ${
|
|
151
|
-
)`,
|
|
152
|
-
"${t}", "${e}", ${
|
|
153
|
-
)`;function
|
|
145
|
+
}`,je="builderIoAbTest",Re="builderIoRenderContent",K=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),Xt=({canTrack:e,content:t})=>!(!(K(t).length>0)||!e||f.isBrowser()),Zt=e=>e==="react"||e==="reactNative",Pe=Zt(f.TARGET),en=()=>`
|
|
146
|
+
window.${je} = ${Gt}
|
|
147
|
+
window.${Re} = ${Qt}
|
|
148
|
+
`,tn=(e,t)=>`
|
|
149
|
+
window.${je}(
|
|
150
|
+
"${t}",${JSON.stringify(e)}, ${Pe}
|
|
151
|
+
)`,nn=({contentId:e,variationId:t})=>`window.${Re}(
|
|
152
|
+
"${t}", "${e}", ${Pe}
|
|
153
|
+
)`;function X(e){return a.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id})}function se(e){return Math.round(e*1e3)/1e3}const on=(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},an=e=>on(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,o=e.clientY-n.top,r=se(i/n.width),s=se(o/n.height);return{x:r,y:s}},rn=e=>{const t=e.target,n=t&&an(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}}},sn=e=>{var r,s;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],i=(s=e.fileUrl)!=null?s:(r=e==null?void 0:e.files)==null?void 0:r.regular;let o="";if(i&&t&&n&&(o+=`
|
|
154
154
|
@font-face {
|
|
155
155
|
font-family: "${t}";
|
|
156
156
|
src: local("${n}"), url('${i}') format('woff2');
|
|
157
157
|
font-display: fallback;
|
|
158
158
|
font-weight: 400;
|
|
159
159
|
}
|
|
160
|
-
`.trim()),e.files)for(const l in e.files){if(!(String(Number(l))===l))continue;const
|
|
160
|
+
`.trim()),e.files)for(const l in e.files){if(!(String(Number(l))===l))continue;const d=e.files[l];d&&d!==i&&(o+=`
|
|
161
161
|
@font-face {
|
|
162
162
|
font-family: "${t}";
|
|
163
|
-
src: url('${
|
|
163
|
+
src: url('${d}') format('woff2');
|
|
164
164
|
font-display: fallback;
|
|
165
165
|
font-weight: ${l};
|
|
166
166
|
}
|
|
167
|
-
`.trim())}return
|
|
167
|
+
`.trim())}return o},ln=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(n=>sn(n)))==null?void 0:t.join(" "))||""},cn=({cssCode:e,contentId:t})=>e?t?(e==null?void 0:e.replace(/&/g,`div[builder-content-id="${t}"]`))||"":e:"",dn=`
|
|
168
168
|
.builder-button {
|
|
169
169
|
all: unset;
|
|
170
170
|
}
|
|
@@ -181,8 +181,8 @@ font-weight: ${l};
|
|
|
181
181
|
text-align: inherit;
|
|
182
182
|
font-family: inherit;
|
|
183
183
|
}
|
|
184
|
-
`,
|
|
185
|
-
${
|
|
186
|
-
${
|
|
187
|
-
${
|
|
188
|
-
`.trim());return
|
|
184
|
+
`,un=e=>e?"":dn,mn=e=>`variant-${e}`;function fn(e){var P,V,N,v,w,B,b;const t=h.useRef(null);function n(g){var S,C;const y={...e.builderContextSignal.rootState,...g};e.builderContextSignal.rootSetState?(C=(S=e.builderContextSignal).rootSetState)==null||C.call(S,y):e.setBuilderContextSignal(T=>({...T,rootState:y}))}function i(g){var S,C,T,R,$;const y={...e.builderContextSignal.content,...g,data:{...(S=e.builderContextSignal.content)==null?void 0:S.data,...g==null?void 0:g.data},meta:{...(C=e.builderContextSignal.content)==null?void 0:C.meta,...g==null?void 0:g.meta,breakpoints:((T=g==null?void 0:g.meta)==null?void 0:T.breakpoints)||(($=(R=e.builderContextSignal.content)==null?void 0:R.meta)==null?void 0:$.breakpoints)}};e.setBuilderContextSignal(F=>({...F,content:y}))}function o(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[r,s]=h.useState(()=>e.contentWrapper||"div");function l(g){return f.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:y=>{var T;const{breakpoints:S,contentId:C}=y;!C||C!==((T=e.builderContextSignal.content)==null?void 0:T.id)||S&&i({meta:{breakpoints:S}})},animation:y=>{be(y)},contentUpdate:y=>{i(y)}}})(g)}function c(){var y,S;const g=(S=(y=e.builderContextSignal.content)==null?void 0:y.data)==null?void 0:S.jsCode;g&&O({code:g,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!1})}const[d,m]=h.useState(()=>({})),[u,x]=h.useState(()=>({})),[p,k]=h.useState(()=>!1);function I(g){var y,S;if(e.builderContextSignal.content){const C=(y=e.builderContextSignal.content)==null?void 0:y.testVariationId,T=(S=e.builderContextSignal.content)==null?void 0:S.id;f._track({type:"click",canTrack:f.getDefaultCanTrack(e.canTrack),contentId:T,apiKey:e.apiKey,variationId:C!==T?C:void 0,...rn(g),unique:!p})}p||k(!0)}function E(){var y,S,C;const g=(C=(S=(y=e.builderContextSignal.content)==null?void 0:y.data)==null?void 0:S.httpRequests)!=null?C:{};Object.entries(g).forEach(([T,R])=>{if(!R||u[T]||d[T]&&!f.isEditing())return;u[T]=!0;const $=R.replace(/{{([^}]+)}}/g,(F,Fe)=>String(O({code:Fe,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!0})));f.fetch($).then(F=>F.json()).then(F=>{n({[T]:F}),d[T]=!0}).catch(F=>{console.error("error fetching dynamic data",R,F)}).finally(()=>{u[T]=!1})})}function j(){f.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:f.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}return h.useEffect(()=>{var g,y;if(f.isBrowser()){if(f.isEditing()&&(window.addEventListener("message",l),f.registerInsertMenu(),f.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(C=>{var R;const T=f.createRegisterComponentMessage(C);(R=window.parent)==null||R.postMessage(T,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",j)),e.builderContextSignal.content&&f.getDefaultCanTrack(e.canTrack)){const C=(g=e.builderContextSignal.content)==null?void 0:g.testVariationId,T=(y=e.builderContextSignal.content)==null?void 0:y.id,R=e.apiKey;f._track({type:"impression",canTrack:!0,contentId:T,apiKey:R,variationId:C!==T?C:void 0})}if(f.isPreviewing()&&!f.isEditing()){const C=new URL(location.href).searchParams,T=C.get("builder.preview"),R=C.get(`builder.preview.${T}`),$=C.get("apiKey")||C.get("builder.space");T===e.model&&$===e.apiKey&&(!e.content||R===e.content.id)&&f.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(F=>{F&&i(F)})}}},[]),h.useEffect(()=>{e.apiKey||f.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),c(),E(),j()},[]),h.useEffect(()=>{e.content&&i(e.content)},[e.content]),h.useEffect(()=>{c()},[(V=(P=e.builderContextSignal.content)==null?void 0:P.data)==null?void 0:V.jsCode]),h.useEffect(()=>{E()},[(v=(N=e.builderContextSignal.content)==null?void 0:N.data)==null?void 0:v.httpRequests]),h.useEffect(()=>{j()},[e.builderContextSignal.rootState]),h.useEffect(()=>{e.data&&n(e.data)},[e.data]),h.useEffect(()=>{e.locale&&n({locale:e.locale})},[e.locale]),h.useEffect(()=>()=>{f.isBrowser()&&(window.removeEventListener("message",l),window.removeEventListener("builder:component:stateChangeListenerActivated",j))},[]),a.jsx(z.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?a.jsx(r,{ref:t,onClick:g=>I(g),"builder-content-id":(w=e.builderContextSignal.content)==null?void 0:w.id,"builder-model":e.model,...o(),...e.contentWrapperProps,className:mn(((B=e.content)==null?void 0:B.testVariationId)||((b=e.content)==null?void 0:b.id)),children:e.children}):null})}function hn(e){const[t,n]=h.useState(()=>`
|
|
185
|
+
${cn({cssCode:e.cssCode,contentId:e.contentId})}
|
|
186
|
+
${ln({customFonts:e.customFonts})}
|
|
187
|
+
${un(e.isNestedRender)}
|
|
188
|
+
`.trim());return a.jsx(_,{id:"builderio-content",styles:t})}const gn=({content:e,data:t,locale:n})=>{var r,s,l;const i={},o=((r=e==null?void 0:e.data)==null?void 0:r.state)||{};return(l=(s=e==null?void 0:e.data)==null?void 0:s.inputs)==null||l.forEach(c=>{c.name&&c.defaultValue!==void 0&&(i[c.name]=c.defaultValue)}),{...i,...o,...t,...n?{locale:n}:{}}},bn=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function ce(e){var c,d,m,u,x,p,k;const[t,n]=h.useState(()=>{var I,E;return nn({variationId:(I=e.content)==null?void 0:I.testVariationId,contentId:(E=e.content)==null?void 0:E.id})});function i(I){l(E=>({...E,rootState:I}))}const[o,r]=h.useState(()=>[...re(),...e.customComponents||[]].reduce((I,{component:E,...j})=>({...I,[j.name]:{component:E,...f.serializeComponentInfo(j)}}),{})),[s,l]=h.useState(()=>({content:bn({content:e.content,data:e.data}),localState:void 0,rootState:gn({content:e.content,data:e.data,locale:e.locale}),rootSetState:i,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...re(),...e.customComponents||[]].reduce((I,{component:E,...j})=>({...I,[j.name]:f.serializeComponentInfo(j)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}}));return a.jsx(ue.Provider,{value:{registeredComponents:o},children:a.jsxs(fn,{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:s,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,linkComponent:e.linkComponent,trustedHosts:e.trustedHosts,setBuilderContextSignal:l,children:[e.isSsrAbTest?a.jsx(X,{id:"builderio-variant-visibility",scriptStr:t}):null,a.jsx(hn,{isNestedRender:e.isNestedRender,contentId:(c=s.content)==null?void 0:c.id,cssCode:(m=(d=s.content)==null?void 0:d.data)==null?void 0:m.cssCode,customFonts:(x=(u=s.content)==null?void 0:u.data)==null?void 0:x.customFonts}),a.jsx(W,{blocks:(k=(p=s.content)==null?void 0:p.data)==null?void 0:k.blocks,context:s,registeredComponents:o,linkComponent:e.linkComponent})]})})}function Ve(e){var s;const[t,n]=h.useState(()=>Xt({canTrack:f.getDefaultCanTrack(e.canTrack),content:e.content}));function i(){var l;return tn(K(e.content).map(c=>({id:c.testVariationId,testRatio:c.testRatio})),((l=e.content)==null?void 0:l.id)||"")}function o(){return K(e.content).map(l=>`.variant-${l.testVariationId} { display: none; } `).join("")}function r(){var l;return t?{...e.content,testVariationId:(l=e.content)==null?void 0:l.id}:f.handleABTestingSync({item:e.content,canTrack:f.getDefaultCanTrack(e.canTrack)})}return h.useEffect(()=>{},[]),a.jsxs(a.Fragment,{children:[!e.isNestedRender&&f.TARGET!=="reactNative"?a.jsx(X,{id:"builderio-init-variants-fns",scriptStr:en()}):null,t?a.jsxs(a.Fragment,{children:[a.jsx(_,{id:"builderio-variants",styles:o()}),a.jsx(X,{id:"builderio-variants-visibility",scriptStr:i()}),(s=K(e.content))==null?void 0:s.map(l=>a.jsx(ce,{isNestedRender:e.isNestedRender,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,a.jsx(ce,{isNestedRender:e.isNestedRender,content:r(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const xn=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return f.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{f.logger.error("Could not fetch symbol content: ",n)})};function Be(e){var l,c,d,m;function t(){return"div"}function n(){return"div"}function i(){var u,x;return[e.attributes[M()],"builder-symbol",(u=e.symbol)!=null&&u.inline?"builder-inline-symbol":void 0,(x=e.symbol)!=null&&x.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[o,r]=h.useState(()=>{var u;return(u=e.symbol)==null?void 0:u.content});function s(){o||xn({symbol:e.symbol,builderContextValue:e.builderContext}).then(u=>{u&&r(u)})}return h.useEffect(()=>{},[]),h.useEffect(()=>{s()},[e.symbol]),a.jsx("div",{...e.attributes,className:i(),children:a.jsx(Ve,{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:{...(c=e.symbol)==null?void 0:c.data,...e.builderContext.localState,...(d=o==null?void 0:o.data)==null?void 0:d.state},model:(m=e.symbol)==null?void 0:m.model,content:o,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:n()})})}exports.Blocks=W;exports.BuilderContext=z;exports.Button=de;exports.Columns=ke;exports.Content=Ve;exports.Fragment=Ce;exports.Image=Te;exports.Section=we;exports.Symbol=Be;exports.Text=Ie;exports.Video=Ee;
|