@builder.io/sdk-react 4.0.10 → 4.1.1
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 +9 -9
- package/lib/browser/blocks-exports.mjs +52 -45
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/server-entry-7291b0a0.cjs +2 -0
- package/lib/browser/{server-entry-a97b474c.js → server-entry-7fc3706d.js} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-39aaa10f.js → accordion-52165801.js} +1 -1
- package/lib/edge/{accordion-f19408f1.cjs → accordion-97979a98.cjs} +1 -1
- package/lib/edge/{blocks-bd4d19a4.cjs → blocks-b38b39ff.cjs} +1 -1
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{blocks-204bcb03.js → blocks-f69d48c0.js} +2 -2
- package/lib/edge/{button-eb4a1fce.js → button-3acce335.js} +2 -2
- package/lib/edge/{button-39adadab.cjs → button-c2b48e86.cjs} +1 -1
- package/lib/edge/{columns-d3cef236.js → columns-301795ee.js} +3 -3
- package/lib/edge/{columns-3954e4e2.cjs → columns-600ece77.cjs} +1 -1
- package/lib/edge/{content-variants-0c41aa3b.cjs → content-variants-cb452ad4.cjs} +2 -2
- package/lib/edge/{content-variants-68bbb30c.js → content-variants-d80a626a.js} +12 -12
- package/lib/edge/{custom-code-eded3b35.cjs → custom-code-381f399e.cjs} +1 -1
- package/lib/edge/{custom-code-f8374f7b.js → custom-code-38a0e487.js} +1 -1
- package/lib/edge/{embed-2b4ce9d5.js → embed-3e62c6c0.js} +1 -1
- package/lib/edge/{embed-44dee332.cjs → embed-57e9672d.cjs} +1 -1
- package/lib/edge/{form-9faf63c9.js → form-01ee1ef4.js} +3 -3
- package/lib/edge/{form-1493caf1.cjs → form-dfb33605.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-a9265175.cjs → get-class-prop-name-7a52ddda.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-cc48fc17.js → get-class-prop-name-ca3fff6a.js} +1 -1
- package/lib/edge/image-209835f4.js +94 -0
- package/lib/edge/image-87a4e006.cjs +17 -0
- package/lib/edge/image.helpers-3e926d47.js +33 -0
- package/lib/edge/image.helpers-dba8a869.cjs +1 -0
- package/lib/edge/img-35c030d0.js +28 -0
- package/lib/edge/img-ff08ac3a.cjs +1 -0
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-d988f887.cjs → input-bd84e8ab.cjs} +1 -1
- package/lib/edge/{input-a7c01b3a.js → input-d466ec13.js} +1 -1
- package/lib/edge/{personalization-container-9ae00624.js → personalization-container-87ff6375.js} +4 -4
- package/lib/edge/{personalization-container-2f2bfa1b.cjs → personalization-container-8b04de3e.cjs} +1 -1
- package/lib/edge/{select-4f03decc.js → select-5d4ffe3b.js} +1 -1
- package/lib/edge/{select-03b307f2.cjs → select-ef4ce171.cjs} +1 -1
- package/lib/edge/{server-entry-e13b9b35.cjs → server-entry-afc62633.cjs} +1 -1
- package/lib/edge/{server-entry-0fe1fd76.js → server-entry-db512751.js} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-125b0593.cjs → slot-78b8ee2b.cjs} +1 -1
- package/lib/edge/{slot-ff90c844.js → slot-d0cbcacf.js} +3 -3
- package/lib/edge/{symbol-7558aa24.js → symbol-2e54d716.js} +2 -2
- package/lib/edge/{symbol-da3ec542.cjs → symbol-6d9bb0a7.cjs} +1 -1
- package/lib/edge/{tabs-3cf7cfd3.cjs → tabs-3f775737.cjs} +1 -1
- package/lib/edge/{tabs-a9e56d82.js → tabs-b8c2b851.js} +3 -3
- package/lib/node/blocks-exports.cjs +9 -9
- package/lib/node/blocks-exports.mjs +275 -268
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +3 -3
- package/lib/node/server-entry-47ceca47.cjs +2 -0
- package/lib/node/{server-entry-23f9b44b.js → server-entry-b0a12b94.js} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-71bce8c3.cjs → setIvm-513e193d.cjs} +1 -1
- package/lib/node/{setIvm-b29cbc40.js → setIvm-f591fbda.js} +1 -1
- package/lib/node/setIvm.cjs +1 -1
- package/lib/node/setIvm.mjs +2 -2
- package/lib/node/{should-force-browser-runtime-in-node-e0147364.cjs → should-force-browser-runtime-in-node-0fb1bbdd.cjs} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-5a2ea9eb.js → should-force-browser-runtime-in-node-da05f5c3.js} +1 -1
- package/package.json +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/lib/browser/server-entry-6a0d3985.cjs +0 -2
- package/lib/edge/image-cce92f6c.cjs +0 -17
- package/lib/edge/image-d87761af.js +0 -123
- package/lib/edge/img-58c08dd4.js +0 -20
- package/lib/edge/img-b8d85bad.cjs +0 -1
- package/lib/node/server-entry-ceef853b.cjs +0 -2
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./server-entry-
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./server-entry-47ceca47.cjs"),r=require("react/jsx-runtime"),f=require("react"),D=require("./setIvm-513e193d.cjs"),Ye=require("./should-force-browser-runtime-in-node-0fb1bbdd.cjs");function Xe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Ze=Xe(f),et=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),tt=e=>typeof e=="string"&&et.has(e.toLowerCase());function ce(e){return r.jsx(r.Fragment,{children:tt(e.TagName)?r.jsx(r.Fragment,{children:r.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):r.jsx(r.Fragment,{children:typeof e.TagName=="string"?r.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):r.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}const _=()=>{switch(g.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":case"angular":return"class"}};function Ce(e){function t(){return{...e.attributes,[_()]:`${e.link?"":"builder-button"} ${e.attributes[_()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}}}return r.jsx(ce,{attributes:t(),TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}const ee=f.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{},nonce:"",model:""}),Te=f.createContext({registeredComponents:{}}),Ie=(e,t,n)=>{const i=String.prototype.split.call(t,/[,[\].]+?/).filter(Boolean).reduce((a,s)=>a!=null?a[s]:a,e);return i===void 0||i===e?n:i},nt=({code:e,builder:t,context:n,event:i,localState:a,rootSetState:s,rootState:o})=>{const l=D.getFunctionArguments({builder:t,context:n,event:i,state:D.flattenState({rootState:o,localState:a,rootSetState:s})});return new Function(...l.map(([c])=>c),e)(...l.map(([,c])=>c))},it=e=>g.isBrowser()||Ye.shouldForceBrowserRuntimeInNode({shouldLogWarning:!0})?nt(e):D.runInNode(e),at=/^(return )?(\s*)?state(?<getPath>(\.\w+)+)(\s*);?$/,rt=/(\s)*var(\s)+_virtual_index(\s)*=(\s)*state(?<getPath>(\.\w+)+)(\s*);?(\s)*return(\s)*_virtual_index(\s)*/,ot=e=>{var t,n,i,a,s,o;return((i=(n=(t=at.exec(e.trim()))==null?void 0:t.groups)==null?void 0:n.getPath)==null?void 0:i.slice(1))||((o=(s=(a=rt.exec(e.trim()))==null?void 0:a.groups)==null?void 0:s.getPath)==null?void 0:o.slice(1))};function q({code:e,context:t,localState:n,rootState:i,rootSetState:a,event:s,isExpression:o=!0}){if(e.trim()==="")return;const l=ot(e.trim());if(l)return Ie({...i,...n},l);const c={code:D.parseCode(e,{isExpression:o}),builder:D.getBuilderGlobals(),context:t,event:s,rootSetState:a,rootState:i,localState:n};try{return it(c)}catch(u){g.logger.error("Failed code evaluation: "+u.message,{code:e});return}}function st(e,t){var n;return{...(n=e.component)==null?void 0:n.options,...e.options,...lt(e,t)}}const lt=(e,t)=>{var n,i;if(((n=e.component)==null?void 0:n.name)==="Text"&&((i=e.component.options)!=null&&i.text)&&typeof e.component.options.text=="string")return{...e.component.options,text:e.component.options.text.replace(/{{([^}]+)}}/g,(a,s)=>q({code:s,context:t,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState}))}};function ct(e,...t){const n=Object.assign({},e);for(const i of t)delete n[i];return n}function Z(e,t,n=null,i=null,a=new WeakSet){if(e==null||typeof e!="object"){t(e,s=>{n!==null&&i!==null&&(n[i]=s)});return}a.has(e)||(a.add(e),Array.isArray(e)?e.forEach((s,o)=>{t(s,c=>{e[o]=c}),Z(s,t,e,o,a)}):Object.entries(e).forEach(([s,o])=>{t(o,c=>{e[s]=c}),Z(o,t,e,s,a)}))}function we(e){return e&&typeof e=="object"&&e["@type"]==="@builder.io/core:LocalizedValue"}function ut(e){if(!e||!Object.getOwnPropertyNames(e).length)return!1;let t=!1;return Z(e,n=>{if(we(n)){t=!0;return}}),t}function dt(e,t){return!e||!Object.getOwnPropertyNames(e).length?{}:(Z(e,(n,i)=>{var a;we(n)&&i((a=n[t])!=null?a:void 0)}),e)}function mt(e,t){var n,i;return(n=e.component)!=null&&n.options&&ut((i=e.component)==null?void 0:i.options)&&(t||console.warn("[Builder.io] In order to use localized fields in Builder, you must pass a locale prop to the BuilderComponent or to options object while fetching the content to resolve localized fields. Learn more: https://www.builder.io/c/docs/localization-inline#targeting-and-inline-localization"),e.component.options=dt(e.component.options,t!=null?t:"Default")),e}function le(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>le(n));if(e["@type"]==="@builder.io/sdk:Element")return e;const t={};for(const n in e)n!=="meta"&&Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=le(e[n]));return t}const ft=["svelte","vue","angular","qwik","solid"].includes(g.TARGET),gt=e=>{if(ft){const t=D.fastClone(e);return{...t,properties:{...t.properties},actions:{...t.actions}}}else{const t=le(ct(e,"children","meta"));return{...t,properties:{...t.properties},actions:{...t.actions},children:e.children,meta:e.meta}}},ht=({block:e,context:t,localState:n,rootState:i,rootSetState:a})=>{if(!e.bindings)return e;const s=gt(e);for(const o in e.bindings){const l=e.bindings[o],c=q({code:l,localState:n,rootState:i,rootSetState:a,context:t});D.set(s,o,c)}return s};function bt({block:e,context:t,localState:n,rootState:i,rootSetState:a}){let s=mt(e,i.locale);return s=s,ht({block:s,localState:n,rootState:i,rootSetState:a,context:t})}const te=e=>e?e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase():"";function yt(e,t,n={}){let i,a,s,o=null,l=0;const c=function(){l=n.leading===!1?0:Date.now(),o=null,s=e.apply(i,a),o||(i=a=null)};return function(){const u=Date.now();!l&&n.leading===!1&&(l=u);const h=t-(u-l);return i=this,a=arguments,h<=0||h>t?(o&&(clearTimeout(o),o=null),l=u,s=e.apply(i,a),o||(i=a=null)):!o&&n.trailing!==!1&&(o=setTimeout(c,h)),s}}function z(e,...t){const n=Object(e);for(let i=1;i<arguments.length;i++){const a=arguments[i];if(a!=null)for(const s in a)Object.prototype.hasOwnProperty.call(a,s)&&(n[s]=a[s])}return n}function pt(e){for(const t of e)switch(t.trigger){case"pageLoad":Pe(t);break;case"scrollInView":vt(t);break}}function Ee(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function Re(e,t){const n=xt(e),i=getComputedStyle(t),a=e.steps[0].styles,s=e.steps[e.steps.length-1].styles,o=[a,s];for(const l of o)for(const c of n)c in l||(l[c]=i[c])}function xt(e){const t=[];for(const n of e.steps)for(const i in n.styles)t.indexOf(i)===-1&&t.push(i);return t}function Pe(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){Ee(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{Re(e,n),n.style.transition="none",n.style.transitionDelay="0",z(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${te(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),z(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}function vt(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){Ee(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{Re(e,n);let i=!1,a=!1;function s(){!i&&l(n)?(i=!0,a=!0,setTimeout(()=>{z(n.style,e.steps[1].styles),e.repeat||document.removeEventListener("scroll",o),setTimeout(()=>{a=!1,e.repeat||(n.style.transition="",n.style.transitionDelay="")},(e.duration+(e.delay||0))*1e3+100)})):e.repeat&&i&&!a&&!l(n)&&(i=!1,z(n.style,e.steps[0].styles))}const o=yt(s,200,{leading:!1});function l(h){const p=h.getBoundingClientRect(),m=window.innerHeight,d=(e.thresholdPercent||0)/100*m;return p.bottom>d&&p.top<m-d}const c=e.steps[0].styles;function u(){z(n.style,c)}u(),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${te(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")}),document.addEventListener("scroll",o,{capture:!0,passive:!0}),s()})}const Ae=e=>Object.entries(e).map(([n,i])=>{if(typeof i=="string")return`${te(n)}: ${i};`}).filter(g.checkIsDefined),St=e=>Ae(e).join(`
|
|
2
2
|
`),M=({mediaQuery:e,className:t,styles:n})=>{const i=`.${t} {
|
|
3
3
|
${St(n)}
|
|
4
4
|
}`;return e?`${e} {
|
|
5
5
|
${i}
|
|
6
6
|
}`:i};function kt({style:e}){return e}const Ct=({block:e,context:t})=>Ve(kt({style:e.style||{},context:t,block:e}));function Ve(e){switch(g.TARGET){case"svelte":case"vue":case"solid":case"angular":return Ae(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const je=(e,t)=>e?t?e.models&&e.models.length>0&&!e.models.includes(t):!1:!0,Tt=({block:e,registeredComponents:t,model:n})=>{var s;const i=(s=e.component)==null?void 0:s.name;if(!i)return null;const a=t[i];if(!a||je(a,n)){console.warn(`
|
|
7
7
|
Could not find a registered component named "${i}".
|
|
8
|
-
If you registered it, is the file that registered it imported by the file that needs to render it?`);return}else return a},It=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const a=q({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context});if(!Array.isArray(a))return;const s=n.collection.split(".").pop(),o=n.itemName||(s?s+"Item":"item");return a.map((c,u)=>({context:{...t,localState:{...t.localState,$index:u,$item:c,[o]:c,[`$${o}Index`]:u}},block:i}))},wt=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderLinkComponent?{builderLinkComponent:t}:{}},Et=(e,t,n)=>{var i;return(i=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&i.builderComponents?{builderComponents:Object.fromEntries(Object.entries(t).filter(([s,o])=>!je(o,n)))}:{}},Rt=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderBlock?{builderBlock:t}:{}},Pt=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderContext?{builderContext:t}:{}},fe=e=>e.toString(),Be={xsmall:{min:0,default:160,max:320},small:{min:321,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},
|
|
8
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`);return}else return a},It=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const a=q({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context});if(!Array.isArray(a))return;const s=n.collection.split(".").pop(),o=n.itemName||(s?s+"Item":"item");return a.map((c,u)=>({context:{...t,localState:{...t.localState,$index:u,$item:c,[o]:c,[`$${o}Index`]:u}},block:i}))},wt=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderLinkComponent?{builderLinkComponent:t}:{}},Et=(e,t,n)=>{var i;return(i=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&i.builderComponents?{builderComponents:Object.fromEntries(Object.entries(t).filter(([s,o])=>!je(o,n)))}:{}},Rt=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderBlock?{builderBlock:t}:{}},Pt=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderContext?{builderContext:t}:{}},fe=e=>e.toString(),Be={xsmall:{min:0,default:160,max:320},small:{min:321,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},ie=(e,t=Be)=>`@media (max-width: ${t[e].max}px)`,Ne=e=>{const t=D.fastClone(Be);if(!e)return t;const{xsmall:n,small:i,medium:a}=e;if(n){const c=Math.floor(n/2);t.xsmall={max:n,min:c,default:c+1}}if(!i||!a)return t;const s=n?t.xsmall.max+1:Math.floor(i/2);t.small={max:i,min:s,default:s+1};const o=t.small.max+1;t.medium={max:a,min:o,default:o+1};const l=t.medium.max+1;return t.large={max:2e3,min:l,default:l+1},t};function K(e){return r.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id,nonce:e.nonce})}function At(e){function t(){const i=e.block;return g.checkIsDefined(i.hide)?!i.hide:g.checkIsDefined(i.show)?i.show:!0}function n(){var T,A,I,w,y;const i=e.block,a=i.responsiveStyles,s=e.context.content,o=Ne(((T=s==null?void 0:s.meta)==null?void 0:T.breakpoints)||{}),l=!!((I=(A=s==null?void 0:s.meta)==null?void 0:A.breakpoints)!=null&&I.xsmall),c=a==null?void 0:a.large,u=a==null?void 0:a.medium,h=a==null?void 0:a.small,p=a==null?void 0:a.xsmall,m=i.id;if(!m)return"";const S=c?M({className:m,styles:c}):"",d=u?M({className:m,styles:u,mediaQuery:ie("medium",o)}):"",b=h?M({className:m,styles:h,mediaQuery:ie("small",o)}):"",v=p&&l?M({className:m,styles:p,mediaQuery:ie("xsmall",o)}):"",x=i.animations&&i.animations.find(k=>k.trigger==="hover");let C="";if(x){const k=((y=(w=x.steps)==null?void 0:w[1])==null?void 0:y.styles)||{};C=M({className:`${m}:hover`,styles:{...k,transition:`all ${x.duration}s ${te(x.easing)}`,transitionDelay:x.delay?`${x.delay}s`:"0s"}})||""}return[S,d,b,v,C].join(" ")}return r.jsx(r.Fragment,{children:n()&&t()?r.jsx(r.Fragment,{children:r.jsx(K,{id:"builderio-block",styles:n(),nonce:e.context.nonce})}):null})}function Vt(e){return e.charAt(0).toUpperCase()+e.slice(1)}const jt=e=>`on${Vt(e)}`,Bt=(e,t)=>n=>q({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1});function Fe(e){var i;const t={},n=(i=e.block.actions)!=null?i:{};for(const a in n){if(!n.hasOwnProperty(a))continue;const s=n[a];let o=jt(a);if(e.stripPrefix)switch(g.TARGET){case"vue":o=o.replace("v-on:","");break;case"svelte":o=o.replace("on:","");break}t[o]=Bt(s,e)}return t}function Nt({properties:e}){return e}const Ft=e=>({href:e.href});function ue({block:e,context:t}){var i;const n={...Ft(e),...e.properties,"builder-id":e.id,style:Ct({block:e,context:t}),[_()]:[e.id,"builder-block",e.class,(i=e.properties)==null?void 0:i.class].filter(Boolean).join(" ")};return Nt({properties:n,context:t,block:e})}function $t(e){return r.jsx(ce,{TagName:e.Wrapper,attributes:ue({block:e.block,context:e.context}),actionAttributes:Fe({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 Wt(e){return f.useEffect(()=>{},[]),r.jsx(r.Fragment,{children:e.children})}function Dt(e){var i,a;f.useState(()=>0);function t(){return e.includeBlockProps?{...ue({block:e.block,context:e.context}),...Fe({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{}}function n(){return e.wrapperProps}return f.useEffect(()=>{},[e.wrapperProps,(a=(i=e.block)==null?void 0:i.component)==null?void 0:a.options]),r.jsx(r.Fragment,{children:e.Wrapper.load?r.jsx(r.Fragment,{children:r.jsx(Wt,{load:e.Wrapper.load,fallback:e.Wrapper.fallback,props:e.wrapperProps,attributes:t(),children:e.children})}):r.jsx(e.Wrapper,{...n(),attributes:t(),children:e.children})})}const Ot=({componentOptions:e,builderBlock:t,context:n,componentRef:i,includeBlockProps:a,isInteractive:s,contextValue:o})=>{const l={...e,...a?{attributes:ue({block:t,context:o})}:{}};return s?{Wrapper:i,block:t,context:n,wrapperProps:e,includeBlockProps:a}:l};function ge(e){var i;f.useState(()=>!1);const[t,n]=f.useState(()=>e.isInteractive?Dt:e.componentRef);return f.useEffect(()=>{},[e.componentOptions,e.blockChildren]),r.jsx(r.Fragment,{children:e.componentRef?r.jsx(r.Fragment,{children:r.jsx(t,{...Ot({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(i=e.blockChildren)==null?void 0:i.map(a=>r.jsx(ne,{block:a,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},a.id))})}):null})}function he(e){const[t,n]=f.useState(()=>e.repeatContext);return f.useEffect(()=>{n(e.repeatContext)},[e.repeatContext]),r.jsx(ee.Provider,{value:t,children:r.jsx(ne,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})})}function ne(e){var h,p,m,S;function t(){return It({block:e.block,context:e.context})}const[n,i]=f.useState(()=>({value:null,update:!1}));function a(){var b;if(n.value&&!n.update&&!g.isPreviewing())return n.value;const d=(b=e.block.repeat)!=null&&b.collection?e.block:bt({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context});return n.value=d,n.update=!1,d}function s(){return Tt({block:a(),registeredComponents:e.registeredComponents,model:e.context.model})}function o(){var b;return e.block.tagName==="a"||((b=a().properties)==null?void 0:b.href)||a().href?e.linkComponent||"a":e.block.tagName||"div"}function l(){var v,x;if((v=e.block.repeat)!=null&&v.collection)return!!((x=t==null?void 0:t())!=null&&x.length);const d="hide"in a()?a().hide:!1;return("show"in a()?a().show:!0)&&!d}function c(){var b,v;return!((b=s==null?void 0:s())!=null&&b.component)&&!t()?(v=a().children)!=null?v:[]:[]}function u(){var d,b,v,x;return{blockChildren:(d=a().children)!=null?d:[],componentRef:(b=s==null?void 0:s())==null?void 0:b.component,componentOptions:{...st(a(),e.context),...Rt(s(),a()),...Pt(s(),e.context),...wt(s(),e.linkComponent),...Et(s(),e.registeredComponents,e.context.model)},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:a(),includeBlockProps:((v=s==null?void 0:s())==null?void 0:v.noWrap)===!0,isInteractive:!((x=s==null?void 0:s())!=null&&x.isRSC&&g.TARGET==="rsc")}}return f.useEffect(()=>{const d=a().id,b=a().animations;b&&d&&pt(b.map(v=>({...v,elementId:d})))},[]),f.useEffect(()=>{n.update=!0}),r.jsx(r.Fragment,{children:l()?r.jsxs(r.Fragment,{children:[r.jsx(At,{block:a(),context:e.context}),(h=s==null?void 0:s())!=null&&h.noWrap?t()?r.jsx(r.Fragment,{children:(S=t())==null?void 0:S.map((d,b)=>r.jsx(he,{repeatContext:d.context,block:d.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},fe(b)))}):r.jsx(ge,{componentRef:u().componentRef,componentOptions:u().componentOptions,blockChildren:u().blockChildren,context:u().context,registeredComponents:u().registeredComponents,linkComponent:u().linkComponent,builderBlock:u().builderBlock,includeBlockProps:u().includeBlockProps,isInteractive:u().isInteractive}):r.jsx(r.Fragment,{children:t()?r.jsx(r.Fragment,{children:(m=t())==null?void 0:m.map((d,b)=>r.jsx(he,{repeatContext:d.context,block:d.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},fe(b)))}):r.jsxs($t,{Wrapper:o(),block:a(),context:e.context,children:[r.jsx(ge,{componentRef:u().componentRef,componentOptions:u().componentOptions,blockChildren:u().blockChildren,context:u().context,registeredComponents:u().registeredComponents,linkComponent:u().linkComponent,builderBlock:u().builderBlock,includeBlockProps:u().includeBlockProps,isInteractive:u().isInteractive}),(p=c())==null?void 0:p.map(d=>r.jsx(ne,{block:d,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},d.id))]})})]}):null})}function Lt(e){const t=f.useRef(null);f.useState(()=>!1);function n(){var o;return["builder-blocks",(o=e.blocks)!=null&&o.length?"":"no-blocks",e.classNameProp].filter(Boolean).join(" ")}function i(){if(!e.path)return;const o="this.",l="component.options.";return e.path.startsWith(o)?e.path.replace(o,""):e.path.startsWith(l)?e.path:`${l}${e.path||""}`}function a(){var o,l;g.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((l=window.parent)==null||l.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:i()}},"*"))}function s(){var o,l;g.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((l=window.parent)==null||l.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:i()}},"*"))}return f.useEffect(()=>{},[]),f.useEffect(()=>{},[e.blocks]),r.jsxs(r.Fragment,{children:[r.jsx("style",{children:`.props-blocks-wrapper-8834791c {
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
align-items: stretch;
|
|
12
|
-
}`}),r.jsx(e.BlocksWrapper,{ref:t,className:n()+" props-blocks-wrapper-8834791c","builder-path":i(),"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>a(),onMouseEnter:o=>s(),onKeyPress:o=>a(),...e.BlocksWrapperProps,children:e.children})]})}function $(e){var i,a,s;const t=f.useContext(
|
|
12
|
+
}`}),r.jsx(e.BlocksWrapper,{ref:t,className:n()+" props-blocks-wrapper-8834791c","builder-path":i(),"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>a(),onMouseEnter:o=>s(),onKeyPress:o=>a(),...e.BlocksWrapperProps,children:e.children})]})}function $(e){var i,a,s;const t=f.useContext(ee),n=f.useContext(Te);return r.jsxs(Lt,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,BlocksWrapperProps:e.BlocksWrapperProps||((i=e.context)==null?void 0:i.BlocksWrapperProps)||(t==null?void 0:t.BlocksWrapperProps),classNameProp:e.className,BlocksWrapper:((a=e.context)==null?void 0:a.BlocksWrapper)||(t==null?void 0:t.BlocksWrapper),children:[e.children,e.blocks?r.jsx(r.Fragment,{children:(s=e.blocks)==null?void 0:s.map(o=>r.jsx(ne,{block:o,linkComponent:e.linkComponent,context:e.context||t,registeredComponents:e.registeredComponents||(n==null?void 0:n.registeredComponents)},o.id))}):null]})}const _t=e=>`builder-columns ${e}-breakpoints`;function $e(e){var b,v;function t(){return typeof e.space=="number"?e.space||0:20}function n(){return e.columns||[]}function i(){return e.stackColumnsAt||"tablet"}function a(x){return x.link?e.builderLinkComponent||"a":"div"}function s(x){var C;return((C=n()[x])==null?void 0:C.width)||100/n().length}function o(x){const C=s(x),T=t()*(n().length-1)*(C/100);return`calc(${C}% - ${T}px)`}function l({stackedStyle:x,desktopStyle:C}){return i()==="tablet"?x:C}function c({stackedStyle:x,desktopStyle:C}){return i()==="never"?C:x}function u(){return e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column"}function h(){return{"--flex-dir":u(),"--flex-dir-tablet":l({stackedStyle:u(),desktopStyle:"row"})}}function p(x){const C=x===0?0:t(),T=o(x),A=`${C}px`,I="100%",w=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:T,["marginLeft"]:A,"--column-width-mobile":c({stackedStyle:I,desktopStyle:T}),"--column-margin-left-mobile":c({stackedStyle:w,desktopStyle:A}),"--column-width-tablet":l({stackedStyle:I,desktopStyle:T}),"--column-margin-left-tablet":l({stackedStyle:w,desktopStyle:A})}}function m(x){var T,A;return Ne(((A=(T=e.builderContext.content)==null?void 0:T.meta)==null?void 0:A.breakpoints)||{})[x].max}function S(){const x=`.${e.builderBlock.id}-breakpoints > .builder-column`;return`
|
|
13
13
|
@media (max-width: ${m("medium")}px) {
|
|
14
14
|
.${e.builderBlock.id}-breakpoints {
|
|
15
15
|
flex-direction: var(--flex-dir-tablet);
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
display: flex;
|
|
38
38
|
line-height: normal;
|
|
39
39
|
height: 100%;
|
|
40
|
-
}`}),r.jsxs("div",{className:_t((b=e.builderBlock)==null?void 0:b.id)+" div-0369db37",style:h(),children:[r.jsx(K,{id:"builderio-columns",styles:S(),nonce:e.builderContext.nonce}),(v=e.columns)==null?void 0:v.map((x,C)=>r.jsx(ce,{TagName:a(x),actionAttributes:{},attributes:d(x,C),children:r.jsx($,{path:`columns.${C}.blocks`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:x.blocks,styleProp:{flexGrow:"1"}})},C))]})]})}function We(e){return r.jsx("span",{children:e.children})}function be(e){return e.replace(/http(s)?:/,"")}function Ut(e="",t,n){const i=new RegExp("([?&])"+t+"=.*?(&|$)","i"),a=e.indexOf("?")!==-1?"&":"?";return e.match(i)?e.replace(i,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+a+t+"="+encodeURIComponent(n)}function qt(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return be(e);const n=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(n){const i=e.split(n[0]),a=n[3],s=t.match("x")?t:`${t}x`;return be(`${i[0]}_${s}${a}`)}return null}function
|
|
40
|
+
}`}),r.jsxs("div",{className:_t((b=e.builderBlock)==null?void 0:b.id)+" div-0369db37",style:h(),children:[r.jsx(K,{id:"builderio-columns",styles:S(),nonce:e.builderContext.nonce}),(v=e.columns)==null?void 0:v.map((x,C)=>r.jsx(ce,{TagName:a(x),actionAttributes:{},attributes:d(x,C),children:r.jsx($,{path:`columns.${C}.blocks`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:x.blocks,styleProp:{flexGrow:"1"}})},C))]})]})}function We(e){return r.jsx("span",{children:e.children})}function be(e){return e.replace(/http(s)?:/,"")}function Ut(e="",t,n){const i=new RegExp("([?&])"+t+"=.*?(&|$)","i"),a=e.indexOf("?")!==-1?"&":"?";return e.match(i)?e.replace(i,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+a+t+"="+encodeURIComponent(n)}function qt(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return be(e);const n=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(n){const i=e.split(n[0]),a=n[3],s=t.match("x")?t:`${t}x`;return be(`${i[0]}_${s}${a}`)}return null}function J(e){if(!e)return e;const t=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let n=e;const i=Number(e.split("?width=")[1]);return isNaN(i)||(n=`${n} ${i}w`),t.filter(a=>a!==i).map(a=>`${Ut(e,"width",a)} ${a}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[qt(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,i])=>`${n} ${i}w`).concat([e]).join(", "):e}function De(e){var a,s,o,l,c,u;function t(){var m;const p=e.image||e.src;if(!p||!(typeof p=="string"&&(p.match(/builder\.io/)||p.match(/cdn\.shopify\.com/))))return e.srcset;if(!e.noWebp){if(e.srcset&&((m=e.image)!=null&&m.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),J(p)}else if(e.image&&!e.srcset)return J(p);return J(p)}}function n(){var h;return(h=t==null?void 0:t())!=null&&h.match(/builder\.io/)&&!e.noWebp?t().replace(/\?/g,"?format=webp&"):""}function i(){const h={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?h:void 0}return f.useEffect(()=>{},[]),r.jsxs(r.Fragment,{children:[r.jsx("style",{children:`.img-3cc22d08 {
|
|
41
41
|
opacity: 1;
|
|
42
42
|
transition: opacity 0.2s ease-in-out;
|
|
43
43
|
}.div-3cc22d08 {
|
|
@@ -214,11 +214,11 @@
|
|
|
214
214
|
visibilityStylesEl.innerHTML = newStyleStr;
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
}`,
|
|
217
|
+
}`,Q="default",Gt="filterWithCustomTargeting",Le="builderIoPersonalization",_e="updateVisibilityStylesScript",Ue=["react","vue","svelte","qwik"],Y=["vue","svelte","qwik"];function Jt(e,t){return!(e&&e.length>0)||!t?!1:Y.includes(g.TARGET)?!0:!g.isBrowser()}function Qt({variants:e,previewingIndex:t,isHydrated:n,filteredVariants:i,fallbackBlocks:a}){var o;const s={blocks:a!=null?a:[],path:"this.children",index:Q};if(n&&g.isEditing()){if(typeof t=="number"&&t<((o=e==null?void 0:e.length)!=null?o:0)){const l=e==null?void 0:e[t];if(l)return{blocks:l.blocks,path:`variants.${t}.blocks`,index:t}}return s}if(g.isBrowser()){const l=i==null?void 0:i[0];if(l&&e){const c=e.indexOf(l);if(c!==-1)return{blocks:l.blocks,path:`variants.${c}.blocks`,index:c}}}return s}const Yt=()=>`
|
|
218
218
|
window.${Gt} = ${zt}
|
|
219
219
|
window.${Le} = ${Mt}
|
|
220
220
|
window.${_e} = ${Kt}
|
|
221
|
-
`,qe=g.TARGET==="react",Xt=(e,t,n)=>`window.${Le}(${JSON.stringify(e)}, "${t}", ${qe}${n?`, "${n}"`:""})`,Zt=(e,t,n)=>`window.${_e}(${JSON.stringify(e)}, "${t}", ${qe}${n?`, "${n}"`:""})`,ae={"@type":"@builder.io/sdk:Element",layerName:"Accordion item title",responsiveStyles:{large:{marginTop:"10px",position:"relative",display:"flex",alignItems:"stretch",flexDirection:"column",paddingBottom:"10px"}},children:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"left",display:"flex",flexDirection:"column"}},component:{name:"Text",options:{text:"I am an accordion title. Click me!"}}}]},re={"@type":"@builder.io/sdk:Element",layerName:"Accordion item detail",responsiveStyles:{large:{position:"relative",display:"flex",alignItems:"stretch",flexDirection:"column",marginTop:"10px",paddingBottom:"10px"}},children:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{paddingTop:"50px",textAlign:"left",display:"flex",flexDirection:"column",paddingBottom:"50px"}},component:{name:"Text",options:{text:"I am an accordion detail, hello!"}}}]},en={name:"Builder:Accordion",canHaveChildren:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",defaultStyles:{display:"flex",flexDirection:"column",alignItems:"stretch"},inputs:[{name:"items",type:"list",broadcast:!0,subFields:[{name:"title",type:"uiBlocks",hideFromUI:!0,defaultValue:[ae]},{name:"detail",type:"uiBlocks",hideFromUI:!0,defaultValue:[re]}],defaultValue:[{title:[ae],detail:[re]},{title:[ae],detail:[re]}],showIf:e=>!e.get("useChildrenForItems")},{name:"oneAtATime",helperText:"Only allow opening one at a time (collapse all others when new item openned)",type:"boolean",defaultValue:!1},{name:"grid",helperText:"Display as a grid",type:"boolean",defaultValue:!1},{name:"gridRowWidth",helperText:"Display as a grid",type:"string",showIf:e=>e.get("grid"),defaultValue:"25%"},{name:"useChildrenForItems",type:"boolean",helperText:"Use child elements for each slide, instead of the array. Useful for dynamically repeating items",advanced:!0,defaultValue:!1,onChange:e=>{e.get("useChildrenForItems")===!0&&e.set("items",[])}}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},ye=e=>e.toString();function tn(e){var p;const[t,n]=f.useState(()=>[]);function i(){return!!(e.grid||e.oneAtATime)}function a(){return{display:"flex",alignItems:"stretch",flexDirection:"column",...e.grid&&{flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap"}}}function s(){const S={...{display:"flex",flexDirection:"column"},alignItems:"stretch",cursor:"pointer"};return Object.fromEntries(Object.entries(S).filter(([d,b])=>b!==void 0))}function o(m){return`builder-accordion-title builder-accordion-title-${t.includes(m)?"open":"closed"}`}function l(m){return`builder-accordion-detail builder-accordion-detail-${t.includes(m)?"open":"closed"}`}function c(){let m=null;if(e.grid&&t.length&&document){const d=t[0];let v=document.querySelector(`.builder-accordion-title[data-index="${d}"]`);if(m=d,v){let x=v.getBoundingClientRect();for(;v=v&&v.nextElementSibling;)if(v){if(v.classList.contains("builder-accordion-detail"))continue;const C=v.getBoundingClientRect();if(C.left>x.left){const T=parseInt(v.getAttribute("data-index")||"",10);isNaN(T)||(x=C,m=T)}else break}}}return typeof m=="number"&&(m=m+1),m}function u(){const m={order:typeof c()=="number"?c():void 0,...e.grid&&{width:"100%"}};return Object.fromEntries(Object.entries(m).filter(([S,d])=>d!==void 0))}function h(m){t.includes(m)?n(i()?[]:t.filter(S=>S!==m)):n(i()?[m]:t.concat(m))}return r.jsx("div",{className:"builder-accordion",style:a(),children:(p=e.items)==null?void 0:p.map((m,S)=>r.jsxs(Ze.Fragment,{children:[r.jsx("div",{className:o(S),style:{...s(),...e.grid&&{width:e.gridRowWidth,order:c()!==null?ye(S):ye(S+1)}},"data-index":S,onClick:d=>h(S),children:r.jsx($,{blocks:m.title,path:`items.${S}.title`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}),t.includes(S)?r.jsx("div",{className:l(S),style:u(),children:r.jsx($,{blocks:m.detail,path:`items.${S}.detail`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]},S))})}const nn={name:"Core:Button",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#000000",color:"white",borderRadius:"4px",textAlign:"center",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me!",bubble:!0},{name:"link",type:"url",bubble:!0},{name:"openLinkInNewTab",type:"boolean",defaultValue:!1,friendlyName:"Open link in new tab"}],static:!0,noWrap:!0,shouldReceiveBuilderProps:{builderLinkComponent:!0}},an={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){n.forEach(i=>{i.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(a=>a.get("width"))&&(n.find(s=>!s.get("width"))||n.reduce((l,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}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},rn={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},de=["jpeg","jpg","png","svg","webp","gif","jfif","pjpeg","pjp","apng","avif","tif","tiff","heif","bmp","eps","raw","cr2","nef","orf","sr2","psd","heic","dib","ai"],on=["mp4","webm","mkv","flv","vob","ogv","ogg","drc","gif","gifv","mng","avi","mov","qt","mts","m2ts","ts","wmv","yuv","rm","rmvb","viv","asf","amv","m4p","mpeg","mpe","m2v","m4v","svi","3gp","3g2","mxf","roq","nsv","f4v","f4p","f4a","f4b"],sn={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:de,required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(o,l=6e4){return new Promise((c,u)=>{const h=document.createElement("img");let p=!1;h.onload=()=>{p=!0,c(h)},h.addEventListener("error",m=>{console.warn("Image load failed",m.error),u(m.error)}),h.src=o,setTimeout(()=>{p||u(new Error("Image load timed out"))},l)})}function i(o){return Math.round(o*1e3)/1e3}const a=e.get("image"),s=e.get("aspectRatio");if(fetch(a).then(o=>o.blob()).then(o=>{o.type.includes("svg")&&e.set("noWebp",!0)}),a&&(!s||s===.7041))return n(a).then(o=>{const l=e.get("aspectRatio");e.get("image")===a&&(!l||l===.7041)&&o.width&&o.height&&(e.set("aspectRatio",i(o.height/o.width)),e.set("height",o.height),e.set("width",o.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:"title",type:"string",helperText:"Text to display when hovering over the asset"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"highPriority",type:"boolean",advanced:!0,helperText:"Mark this image as high priority compared to other images on the page. This prevents lazy loading of the image and tells the browser to load this image before others on the page."},{name:"aspectRatio",type:"number",helperText:"This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",advanced:!0,defaultValue:.7041}],shouldReceiveBuilderProps:{builderBlock:!0}},ln={name:"PersonalizationContainer",shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0},noWrap:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",canHaveChildren:!0,inputs:[{name:"variants",defaultValue:[],behavior:"personalizationVariantList",type:"list",subFields:[{name:"name",type:"text"},{name:"query",friendlyName:"Targeting rules",type:"BuilderQuery",defaultValue:[]},{name:"startDate",type:"date"},{name:"endDate",type:"date"},{name:"blocks",type:"uiBlocks",hideFromUI:!0,defaultValue:[]}]}]};function L(e){return r.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id,nonce:e.nonce||""})}function cn(e){var C,T,A,I,w,y,k,E,N,F,B,P,W;const t=f.useRef(null),[n,i]=f.useState(()=>g.userAttributesService.getUserAttributes()),[a,s]=f.useState(()=>{var R,V,j;return Xt(e.variants,((R=e.builderBlock)==null?void 0:R.id)||"none",(j=(V=e.builderContext)==null?void 0:V.rootState)==null?void 0:j.locale)}),[o,l]=f.useState(()=>{var R,V,j;return Zt(e.variants,((R=e.builderBlock)==null?void 0:R.id)||"none",(j=(V=e.builderContext)==null?void 0:V.rootState)==null?void 0:j.locale)}),[c,u]=f.useState(()=>[]),[h,p]=f.useState(()=>{var R;return Jt(e.variants,g.getDefaultCanTrack((R=e.builderContext)==null?void 0:R.canTrack))}),[m,S]=f.useState(()=>!1);function d(){return{...e.attributes,[_()]:`builder-personalization-container ${e.attributes[_()]||""}`}}function b(){return(e.variants||[]).filter(R=>{var V,j,U,O;return Ht({...(j=(V=e.builderContext)==null?void 0:V.rootState)!=null&&j.locale?{locale:(O=(U=e.builderContext)==null?void 0:U.rootState)==null?void 0:O.locale}:{},...n},R.query,R.startDate,R.endDate)})}function v(){var R;return Qt({variants:e.variants,fallbackBlocks:(R=e.builderBlock)==null?void 0:R.children,isHydrated:m,filteredVariants:b(),previewingIndex:e.previewingIndex})}function x(){return(e.variants||[]).map((R,V)=>{var j;return`div[data-variant-id="${(j=e.builderBlock)==null?void 0:j.id}-${V}"] { display: none !important; } `}).join("")}return f.useEffect(()=>{var V;S(!0);const R=g.userAttributesService.subscribeOnUserAttributesChange(j=>{i(j)},{fireImmediately:g.TARGET==="qwik"});if(!(g.isEditing()||g.isPreviewing())){const j=b()[0];t.current&&(t.current.dispatchEvent(new CustomEvent("builder.variantLoaded",{detail:{variant:j||J,content:(V=e.builderContext)==null?void 0:V.content},bubbles:!0})),new IntersectionObserver(O=>{O.forEach(G=>{var H;G.isIntersecting&&t.current&&t.current.dispatchEvent(new CustomEvent("builder.variantDisplayed",{detail:{variant:j||J,content:(H=e.builderContext)==null?void 0:H.content},bubbles:!0}))})}).observe(t.current))}c.push(R)},[]),f.useEffect(()=>()=>{c.forEach(R=>R())},[]),r.jsxs("div",{ref:t,...d(),children:[m&&Q.includes(g.TARGET)?r.jsx($,{blocks:v().blocks,parent:(C=e.builderBlock)==null?void 0:C.id,path:v().path,context:e.builderContext,registeredComponents:e.builderComponents,BlocksWrapperProps:{...(T=e.builderContext)==null?void 0:T.BlocksWrapperProps,"data-variant-id":`${(A=e.builderBlock)==null?void 0:A.id}-${v().index}`}}):null,!m&&Q.includes(g.TARGET)||!Q.includes(g.TARGET)?r.jsxs(r.Fragment,{children:[h?r.jsxs(r.Fragment,{children:[r.jsx(K,{nonce:((I=e.builderContext)==null?void 0:I.nonce)||"",styles:x(),id:`variants-styles-${(w=e.builderBlock)==null?void 0:w.id}`}),r.jsx(L,{nonce:((y=e.builderContext)==null?void 0:y.nonce)||"",scriptStr:o,id:`variants-visibility-script-${(k=e.builderBlock)==null?void 0:k.id}`}),(E=e.variants)==null?void 0:E.map((R,V)=>{var j,U,O,G,H,me;return r.jsx($,{BlocksWrapperProps:{...(j=e.builderContext)==null?void 0:j.BlocksWrapperProps,"aria-hidden":!0,hidden:!0,"data-variant-id":`${(U=e.builderBlock)==null?void 0:U.id}-${V}`},blocks:R.blocks,parent:(O=e.builderBlock)==null?void 0:O.id,path:`component.options.variants.${V}.blocks`,context:e.builderContext,registeredComponents:e.builderComponents,children:r.jsx(L,{nonce:((G=e.builderContext)==null?void 0:G.nonce)||"",scriptStr:a,id:`variants-script-${(H=e.builderBlock)==null?void 0:H.id}-${V}`})},`${(me=e.builderBlock)==null?void 0:me.id}-${V}`)})]}):null,r.jsx($,{blocks:v().blocks,parent:(N=e.builderBlock)==null?void 0:N.id,path:v().path,context:e.builderContext,registeredComponents:e.builderComponents,BlocksWrapperProps:{...(F=e.builderContext)==null?void 0:F.BlocksWrapperProps,"data-variant-id":`${(B=e.builderBlock)==null?void 0:B.id}-${v().index}`},children:h?r.jsx(L,{nonce:((P=e.builderContext)==null?void 0:P.nonce)||"",scriptStr:a,id:`variants-script-${(W=e.builderBlock)==null?void 0:W.id}-${J}`}):null})]}):null]})}const un={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>"}}}]},dn={name:"Slot",isRSC:!0,description:"Allow child blocks to be inserted into this content when used as a Symbol",docsLink:"https://www.builder.io/c/docs/symbols-with-blocks",image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",inputs:[{name:"name",type:"string",required:!0,defaultValue:"children"}],shouldReceiveBuilderProps:{builderContext:!0,builderComponents:!0}};function mn(e){var t,n,i;return r.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:r.jsx($,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,registeredComponents:e.builderComponents,blocks:(i=e.builderContext.rootState)==null?void 0:i[e.name]})})}const fn={name:"Symbol",noWrap:!0,static:!0,isRSC:!0,inputs:[{name:"symbol",type:"uiSymbol"},{name:"dataOnly",helperText:"Make this a data symbol that doesn't display any UI",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"inheritState",helperText:"Inherit the parent component state and data",type:"boolean",defaultValue:!1,advanced:!0},{name:"renderToLiquid",helperText:"Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"useChildren",hideFromUI:!0,type:"boolean"}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},oe={"@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"}}},se={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{height:"200px",display:"flex",marginTop:"20px",flexDirection:"column"}},component:{name:"Text",options:{text:"New tab content "}}},gn={name:"Builder: Tabs",inputs:[{name:"tabs",type:"list",broadcast:!0,subFields:[{name:"label",type:"uiBlocks",hideFromUI:!0,defaultValue:[oe]},{name:"content",type:"uiBlocks",hideFromUI:!0,defaultValue:[se]}],defaultValue:[{label:[{...oe,component:{name:"Text",options:{text:"Tab 1"}}}],content:[{...se,component:{name:"Text",options:{text:"Tab 1 content"}}}]},{label:[{...oe,component:{name:"Text",options:{text:"Tab 2"}}}],content:[{...se,component:{name:"Text",options:{text:"Tab 2 content"}}}]}]},{name:"activeTabStyle",type:"uiStyle",helperText:"CSS styles for the active tab",defaultValue:{backgroundColor:"rgba(0, 0, 0, 0.1)"}},{name:"defaultActiveTab",type:"number",helperText:'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',defaultValue:1,advanced:!0},{name:"collapsible",type:"boolean",helperText:"If on, clicking an open tab closes it so no tabs are active",defaultValue:!1,advanced:!0},{name:"tabHeaderLayout",type:"enum",helperText:"Change the layout of the tab headers (uses justify-content)",defaultValue:"flex-start",enum:[{label:"Center",value:"center"},{label:"Space between",value:"space-between"},{label:"Space around",value:"space-around"},{label:"Left",value:"flex-start"},{label:"Right",value:"flex-end"}]}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}};function hn(e){var s;const[t,n]=f.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function i(o){return e.tabs&&e.tabs[o].content}function a(o){o===t&&e.collapsible?n(-1):n(o)}return r.jsxs("div",{children:[r.jsx("div",{className:"builder-tabs-wrap",style:{display:"flex",flexDirection:"row",justifyContent:e.tabHeaderLayout||"flex-start",overflow:"auto"},children:(s=e.tabs)==null?void 0:s.map((o,l)=>r.jsx("span",{className:`builder-tab-wrap ${t===l?"builder-tab-active":""}`,style:{...t===l?e.activeTabStyle:{}},onClick:c=>a(l),children:r.jsx($,{parent:e.builderBlock.id,path:`tabs.${l}.label`,blocks:o.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},l))}),i(t)?r.jsx("div",{children:r.jsx($,{parent:e.builderBlock.id,path:`tabs.${t}.content`,blocks:i(t),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}const bn={shouldReceiveBuilderProps:{},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 He(e){var t;return r.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const yn={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 pn(e){const t=f.useRef(null),[n,i]=f.useState(()=>[]),[a,s]=f.useState(()=>[]);function o(){var c;if(!t.current||!((c=t.current)!=null&&c.getElementsByTagName)||typeof window=="undefined")return;const l=t.current.getElementsByTagName("script");for(let u=0;u<l.length;u++){const h=l[u];if(h.src){if(n.includes(h.src))continue;n.push(h.src);const p=document.createElement("script");p.async=!0,p.src=h.src,document.head.appendChild(p)}else if(!h.type||["text/javascript","application/javascript","application/ecmascript"].includes(h.type)){if(a.includes(h.innerText))continue;try{a.push(h.innerText),new Function(h.innerText)()}catch(p){g.logger.warn("[BUILDER.IO] `CustomCode`: Error running script:",p)}}}}return f.useEffect(()=>{o()},[]),f.useEffect(()=>{g.isEditing()&&o()},[e.code]),r.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const xn={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc"},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},vn=["text/javascript","application/javascript","application/ecmascript"],Sn=e=>vn.includes(e.type);function kn(e){const t=f.useRef(null),[n,i]=f.useState(()=>[]),[a,s]=f.useState(()=>[]),[o,l]=f.useState(()=>!1);function c(){if(!t.current||!t.current.getElementsByTagName)return;const u=t.current.getElementsByTagName("script");for(let h=0;h<u.length;h++){const p=u[h];if(p.src&&!n.includes(p.src)){n.push(p.src);const m=document.createElement("script");m.async=!0,m.src=p.src,document.head.appendChild(m)}else if(Sn(p)&&!a.includes(p.innerText))try{a.push(p.innerText),new Function(p.innerText)()}catch(m){g.logger.warn("[BUILDER.IO] `Embed`: Error running script:",m)}}}return f.useEffect(()=>{t.current&&!o&&(l(!0),c())},[t.current,o]),r.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const Cn={name:"Form:Form",defaults:{responsiveStyles:{large:{marginTop:"15px",paddingBottom:"15px"}}},image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",inputs:[{name:"sendSubmissionsTo",type:"string",enum:[{label:"Send to email",value:"email",helperText:"Send form submissions to the email address of your choosing"},{label:"Custom",value:"custom",helperText:"Handle where the form requests go manually with a little code, e.g. to your own custom backend"}],defaultValue:"email"},{name:"sendSubmissionsToEmail",type:"string",required:!0,defaultValue:"your@email.com",showIf:'options.get("sendSubmissionsTo") === "email"'},{name:"sendWithJs",type:"boolean",helperText:"Set to false to use basic html form action",defaultValue:!0,showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"name",type:"string",defaultValue:"My form"},{name:"action",type:"string",helperText:"URL to send the form data to",showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"contentType",type:"string",defaultValue:"application/json",advanced:!0,enum:["application/json","multipart/form-data","application/x-www-form-urlencoded"],showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'},{name:"method",type:"string",showIf:'options.get("sendSubmissionsTo") === "custom"',defaultValue:"POST",advanced:!0},{name:"previewState",type:"string",enum:["unsubmitted","sending","success","error"],defaultValue:"unsubmitted",helperText:'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"successUrl",type:"url",helperText:"Optional URL to redirect the user to on form submission success",showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"resetFormOnSubmit",type:"boolean",showIf:"options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",advanced:!0},{name:"successMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Thanks!</span>"}}}]},{name:"validate",type:"boolean",defaultValue:!0,advanced:!0},{name:"errorMessagePath",type:"text",advanced:!0,helperText:'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'},{name:"errorMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},bindings:{"component.options.text":"state.formErrorMessage || block.component.options.text"},component:{name:"Text",options:{text:"<span>Form submission error :( Please check your answers and try again</span>"}}}]},{name:"sendingMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Sending...</span>"}}}]},{name:"customHeaders",type:"map",valueType:{type:"string"},advanced:!0,showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'}],noWrap:!0,canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your name</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"name",placeholder:"Jane Doe"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your email</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"email",placeholder:"jane@doe.com"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:SubmitButton",options:{text:"Submit"}}}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},Tn=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],In=()=>{const e=process.env.NODE_ENV||"production";return Tn.includes(e)?e:"production"};function wn(e){const t=f.useRef(null),[n,i]=f.useState(()=>"unsubmitted"),[a,s]=f.useState(()=>null),[o,l]=f.useState(()=>"");function c(p){var S,d;const m={...e.builderContext.rootState,...p};e.builderContext.rootSetState?(d=(S=e.builderContext).rootSetState)==null||d.call(S,m):e.builderContext.rootState=m}function u(){return g.isEditing()&&e.previewState||n}function h(p){var S;const m=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")p.preventDefault();else if(m){if(!(e.action||e.sendSubmissionsTo==="email")){p.preventDefault();return}p.preventDefault();const d=p.currentTarget||p.target,b=e.customHeaders||{};let v;const x=new FormData(d),C=Array.from(d.querySelectorAll("input,select,textarea")).filter(y=>!!y.name).map(y=>{let k;const E=y.name;if(y instanceof HTMLInputElement)if(y.type==="radio"){if(y.checked)return k=y.name,{key:E,value:k}}else if(y.type==="checkbox")k=y.checked;else if(y.type==="number"||y.type==="range"){const N=y.valueAsNumber;isNaN(N)||(k=N)}else y.type==="file"?k=y.files:k=y.value;else k=y.value;return{key:E,value:k}});let T=e.contentType;if(e.sendSubmissionsTo==="email"&&(T="multipart/form-data"),Array.from(C).forEach(({value:y})=>{(y instanceof File||Array.isArray(y)&&y[0]instanceof File||y instanceof FileList)&&(T="multipart/form-data")}),T!=="application/json")v=x;else{const y={};Array.from(C).forEach(({value:k,key:E})=>{D.set(y,E,k)}),v=JSON.stringify(y)}T&&T!=="multipart/form-data"&&(m&&((S=e.action)!=null&&S.includes("zapier.com"))||(b["content-type"]=T));const A=new CustomEvent("presubmit",{detail:{body:v}});if(t.current&&(t.current.dispatchEvent(A),A.defaultPrevented))return;if(i("sending"),e.sendSubmissionsTo==="email"&&(e.sendSubmissionsToEmail==="your@email.com"||!e.sendSubmissionsToEmail)){const y="SubmissionsToEmail is required when sendSubmissionsTo is set to email";console.error(y),i("error"),c({formErrorMessage:y});return}const I=`${In()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`,w=e.sendSubmissionsTo==="email"?I:e.action;g.logFetch(w),fetch(w,{body:v,headers:b,method:e.method||"post"}).then(async y=>{var N,F;let k;const E=y.headers.get("content-type");if(E&&E.indexOf("application/json")!==-1?k=await y.json():k=await y.text(),!y.ok){const B=new CustomEvent("submit:error",{detail:{error:k,status:y.status}});if((N=t.current)!=null&&N.nativeElement&&((F=t.current)==null||F.nativeElement.dispatchEvent(B),B.defaultPrevented))return;s(k),i("error");let P=e.errorMessagePath?Ie(k,e.errorMessagePath):k.message||k.error||k;typeof P!="string"&&(P=JSON.stringify(P)),l(P),c({formErrorMessage:P});return}if(s(k),i(y.ok?"success":"error"),y.ok){const B=new CustomEvent("submit:success",{detail:{res:y,body:k}});if(t.current){if(t.current.dispatchEvent(B),B.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const P=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(P),P.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},y=>{const k=new CustomEvent("submit:error",{detail:{error:y}});t.current&&(t.current.dispatchEvent(k),k.defaultPrevented)||(s(y),i("error"))})}}return r.jsxs(r.Fragment,{children:[" ",r.jsx("style",{children:".pre-7c90c93e { padding: 10px; color: red; text-align: center; }"})," ",r.jsxs("form",{validate:e.validate,ref:t,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:p=>h(p),...e.attributes,children:[e.children,u()==="error"?r.jsx($,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,u()==="sending"?r.jsx($,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,u()==="error"&&a?r.jsx("pre",{className:"builder-form-error-text pre-7c90c93e",children:JSON.stringify(a,null,2)}):null,u()==="success"?r.jsx($,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," "]})}const En={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 Rn(e){return f.createElement("input",{...e.attributes,key:g.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 Pn={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 An(e){var t;return f.createElement("select",{...e.attributes,value:e.value,key:g.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name,required:e.required},(t=e.options)==null?void 0:t.map((n,i)=>r.jsx("option",{value:n.value,children:n.name||n.value},`${n.name}-${i}`)))}const Vn={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 jn(e){return r.jsx("button",{type:"submit",...e.attributes,children:e.text})}const Bn={name:"Form:TextArea",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",inputs:[{advanced:!0,name:"value",type:"string"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"placeholder",type:"string",defaultValue:"Hello there"},{name:"required",type:"boolean",defaultValue:!1}],defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"},static:!0,noWrap:!0};function Nn(e){return r.jsx("textarea",{...e.attributes,placeholder:e.placeholder,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const Fn={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:de,required:!0}],noWrap:!0,static:!0};function $n(e){return r.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},g.isEditing()&&e.imgSrc||"default-key")}const Wn={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:on,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:de,helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}],shouldReceiveBuilderProps:{builderBlock:!0}};function Me(e){var o,l,c,u,h,p,m;const t=f.useRef(null);function n(){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 i(){return{...n()}}const[a,s]=f.useState(()=>{});return f.useEffect(()=>{if(e.lazyLoad){const S=new IntersectionObserver(function(d){d.forEach(function(b){if(!b.isIntersecting)return;const v=b.target;try{Array.from(v.children).filter(x=>x instanceof HTMLElement&&x.tagName==="SOURCE").forEach(x=>{const C=x.dataset.src;C&&(x.src=C)}),v.load(),S.unobserve(v)}catch(x){console.error("Error loading lazy video:",x)}})});t.current&&S.observe(t.current),s(S)}},[]),f.useEffect(()=>()=>{a&&a.disconnect()},[]),r.jsxs("div",{style:{position:"relative"},children:[r.jsx("video",{className:"builder-video",...i(),ref:t,preload:e.lazyLoad?"none":e.preload||"metadata",style:{width:"100%",height:"100%",...(o=e.attributes)==null?void 0:o.style,objectFit:e.fit,objectPosition:e.position,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},poster:e.posterImage,children:r.jsx("source",{type:"video/mp4",...e.lazyLoad?{"data-src":e.video}:{src:e.video}})}),e.aspectRatio&&!(e.fitContent&&((c=(l=e.builderBlock)==null?void 0:l.children)!=null&&c.length))?r.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(h=(u=e.builderBlock)==null?void 0:u.children)!=null&&h.length&&e.fitContent?r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(m=(p=e.builderBlock)==null?void 0:p.children)!=null&&m.length&&!e.fitContent?r.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 Dn=()=>[{component:pn,...yn},{component:kn,...xn},{component:wn,...Cn},{component:Rn,...En},{component:jn,...Vn},{component:An,...Pn},{component:Nn,...Bn},{component:$n,...Fn},{component:Me,...Wn}],pe=()=>[{component:Ce,...nn},{component:$e,...an},{component:We,...rn},{component:De,...sn},{component:Oe,...un},{component:mn,...dn},{component:Qe,...fn},{component:He,...bn},...Ue.includes(g.TARGET)?[{component:cn,...ln}]:[],{component:hn,...gn},{component:tn,...en},...Dn()],On=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget, isAngularSDK) {
|
|
221
|
+
`,qe=g.TARGET==="react",Xt=(e,t,n)=>`window.${Le}(${JSON.stringify(e)}, "${t}", ${qe}${n?`, "${n}"`:""})`,Zt=(e,t,n)=>`window.${_e}(${JSON.stringify(e)}, "${t}", ${qe}${n?`, "${n}"`:""})`,ae={"@type":"@builder.io/sdk:Element",layerName:"Accordion item title",responsiveStyles:{large:{marginTop:"10px",position:"relative",display:"flex",alignItems:"stretch",flexDirection:"column",paddingBottom:"10px"}},children:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"left",display:"flex",flexDirection:"column"}},component:{name:"Text",options:{text:"I am an accordion title. Click me!"}}}]},re={"@type":"@builder.io/sdk:Element",layerName:"Accordion item detail",responsiveStyles:{large:{position:"relative",display:"flex",alignItems:"stretch",flexDirection:"column",marginTop:"10px",paddingBottom:"10px"}},children:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{paddingTop:"50px",textAlign:"left",display:"flex",flexDirection:"column",paddingBottom:"50px"}},component:{name:"Text",options:{text:"I am an accordion detail, hello!"}}}]},en={name:"Builder:Accordion",canHaveChildren:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",defaultStyles:{display:"flex",flexDirection:"column",alignItems:"stretch"},inputs:[{name:"items",type:"list",broadcast:!0,subFields:[{name:"title",type:"uiBlocks",hideFromUI:!0,defaultValue:[ae]},{name:"detail",type:"uiBlocks",hideFromUI:!0,defaultValue:[re]}],defaultValue:[{title:[ae],detail:[re]},{title:[ae],detail:[re]}],showIf:e=>!e.get("useChildrenForItems")},{name:"oneAtATime",helperText:"Only allow opening one at a time (collapse all others when new item openned)",type:"boolean",defaultValue:!1},{name:"grid",helperText:"Display as a grid",type:"boolean",defaultValue:!1},{name:"gridRowWidth",helperText:"Display as a grid",type:"string",showIf:e=>e.get("grid"),defaultValue:"25%"},{name:"useChildrenForItems",type:"boolean",helperText:"Use child elements for each slide, instead of the array. Useful for dynamically repeating items",advanced:!0,defaultValue:!1,onChange:e=>{e.get("useChildrenForItems")===!0&&e.set("items",[])}}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},ye=e=>e.toString();function tn(e){var p;const[t,n]=f.useState(()=>[]);function i(){return!!(e.grid||e.oneAtATime)}function a(){return{display:"flex",alignItems:"stretch",flexDirection:"column",...e.grid&&{flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap"}}}function s(){const S={...{display:"flex",flexDirection:"column"},alignItems:"stretch",cursor:"pointer"};return Object.fromEntries(Object.entries(S).filter(([d,b])=>b!==void 0))}function o(m){return`builder-accordion-title builder-accordion-title-${t.includes(m)?"open":"closed"}`}function l(m){return`builder-accordion-detail builder-accordion-detail-${t.includes(m)?"open":"closed"}`}function c(){let m=null;if(e.grid&&t.length&&document){const d=t[0];let v=document.querySelector(`.builder-accordion-title[data-index="${d}"]`);if(m=d,v){let x=v.getBoundingClientRect();for(;v=v&&v.nextElementSibling;)if(v){if(v.classList.contains("builder-accordion-detail"))continue;const C=v.getBoundingClientRect();if(C.left>x.left){const T=parseInt(v.getAttribute("data-index")||"",10);isNaN(T)||(x=C,m=T)}else break}}}return typeof m=="number"&&(m=m+1),m}function u(){const m={order:typeof c()=="number"?c():void 0,...e.grid&&{width:"100%"}};return Object.fromEntries(Object.entries(m).filter(([S,d])=>d!==void 0))}function h(m){t.includes(m)?n(i()?[]:t.filter(S=>S!==m)):n(i()?[m]:t.concat(m))}return r.jsx("div",{className:"builder-accordion",style:a(),children:(p=e.items)==null?void 0:p.map((m,S)=>r.jsxs(Ze.Fragment,{children:[r.jsx("div",{className:o(S),style:{...s(),...e.grid&&{width:e.gridRowWidth,order:c()!==null?ye(S):ye(S+1)}},"data-index":S,onClick:d=>h(S),children:r.jsx($,{blocks:m.title,path:`items.${S}.title`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}),t.includes(S)?r.jsx("div",{className:l(S),style:u(),children:r.jsx($,{blocks:m.detail,path:`items.${S}.detail`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]},S))})}const nn={name:"Core:Button",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#000000",color:"white",borderRadius:"4px",textAlign:"center",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me!",bubble:!0},{name:"link",type:"url",bubble:!0},{name:"openLinkInNewTab",type:"boolean",defaultValue:!1,friendlyName:"Open link in new tab"}],static:!0,noWrap:!0,shouldReceiveBuilderProps:{builderLinkComponent:!0}},an={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){n.forEach(i=>{i.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(a=>a.get("width"))&&(n.find(s=>!s.get("width"))||n.reduce((l,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}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},rn={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},de=["jpeg","jpg","png","svg","webp","gif","jfif","pjpeg","pjp","apng","avif","tif","tiff","heif","bmp","eps","raw","cr2","nef","orf","sr2","psd","heic","dib","ai"],on=["mp4","webm","mkv","flv","vob","ogv","ogg","drc","gif","gifv","mng","avi","mov","qt","mts","m2ts","ts","wmv","yuv","rm","rmvb","viv","asf","amv","m4p","mpeg","mpe","m2v","m4v","svi","3gp","3g2","mxf","roq","nsv","f4v","f4p","f4a","f4b"],sn={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:de,required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(o,l=6e4){return new Promise((c,u)=>{const h=document.createElement("img");let p=!1;h.onload=()=>{p=!0,c(h)},h.addEventListener("error",m=>{console.warn("Image load failed",m.error),u(m.error)}),h.src=o,setTimeout(()=>{p||u(new Error("Image load timed out"))},l)})}function i(o){return Math.round(o*1e3)/1e3}const a=e.get("image"),s=e.get("aspectRatio");if(fetch(a).then(o=>o.blob()).then(o=>{o.type.includes("svg")&&e.set("noWebp",!0)}),a&&(!s||s===.7041))return n(a).then(o=>{const l=e.get("aspectRatio");e.get("image")===a&&(!l||l===.7041)&&o.width&&o.height&&(e.set("aspectRatio",i(o.height/o.width)),e.set("height",o.height),e.set("width",o.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:"title",type:"string",helperText:"Text to display when hovering over the asset"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"highPriority",type:"boolean",advanced:!0,helperText:"Mark this image as high priority compared to other images on the page. This prevents lazy loading of the image and tells the browser to load this image before others on the page."},{name:"aspectRatio",type:"number",helperText:"This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",advanced:!0,defaultValue:.7041}],shouldReceiveBuilderProps:{builderBlock:!0}},ln={name:"PersonalizationContainer",shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0},noWrap:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",canHaveChildren:!0,inputs:[{name:"variants",defaultValue:[],behavior:"personalizationVariantList",type:"list",subFields:[{name:"name",type:"text"},{name:"query",friendlyName:"Targeting rules",type:"BuilderQuery",defaultValue:[]},{name:"startDate",type:"date"},{name:"endDate",type:"date"},{name:"blocks",type:"uiBlocks",hideFromUI:!0,defaultValue:[]}]}]};function L(e){return r.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id,nonce:e.nonce||""})}function cn(e){var C,T,A,I,w,y,k,E,N,F,B,P,W;const t=f.useRef(null),[n,i]=f.useState(()=>g.userAttributesService.getUserAttributes()),[a,s]=f.useState(()=>{var R,V,j;return Xt(e.variants,((R=e.builderBlock)==null?void 0:R.id)||"none",(j=(V=e.builderContext)==null?void 0:V.rootState)==null?void 0:j.locale)}),[o,l]=f.useState(()=>{var R,V,j;return Zt(e.variants,((R=e.builderBlock)==null?void 0:R.id)||"none",(j=(V=e.builderContext)==null?void 0:V.rootState)==null?void 0:j.locale)}),[c,u]=f.useState(()=>[]),[h,p]=f.useState(()=>{var R;return Jt(e.variants,g.getDefaultCanTrack((R=e.builderContext)==null?void 0:R.canTrack))}),[m,S]=f.useState(()=>!1);function d(){return{...e.attributes,[_()]:`builder-personalization-container ${e.attributes[_()]||""}`}}function b(){return(e.variants||[]).filter(R=>{var V,j,U,O;return Ht({...(j=(V=e.builderContext)==null?void 0:V.rootState)!=null&&j.locale?{locale:(O=(U=e.builderContext)==null?void 0:U.rootState)==null?void 0:O.locale}:{},...n},R.query,R.startDate,R.endDate)})}function v(){var R;return Qt({variants:e.variants,fallbackBlocks:(R=e.builderBlock)==null?void 0:R.children,isHydrated:m,filteredVariants:b(),previewingIndex:e.previewingIndex})}function x(){return(e.variants||[]).map((R,V)=>{var j;return`div[data-variant-id="${(j=e.builderBlock)==null?void 0:j.id}-${V}"] { display: none !important; } `}).join("")}return f.useEffect(()=>{var V;S(!0);const R=g.userAttributesService.subscribeOnUserAttributesChange(j=>{i(j)},{fireImmediately:g.TARGET==="qwik"});if(!(g.isEditing()||g.isPreviewing())){const j=b()[0];t.current&&(t.current.dispatchEvent(new CustomEvent("builder.variantLoaded",{detail:{variant:j||Q,content:(V=e.builderContext)==null?void 0:V.content},bubbles:!0})),new IntersectionObserver(O=>{O.forEach(G=>{var H;G.isIntersecting&&t.current&&t.current.dispatchEvent(new CustomEvent("builder.variantDisplayed",{detail:{variant:j||Q,content:(H=e.builderContext)==null?void 0:H.content},bubbles:!0}))})}).observe(t.current))}c.push(R)},[]),f.useEffect(()=>()=>{c.forEach(R=>R())},[]),r.jsxs("div",{ref:t,...d(),children:[m&&Y.includes(g.TARGET)?r.jsx($,{blocks:v().blocks,parent:(C=e.builderBlock)==null?void 0:C.id,path:v().path,context:e.builderContext,registeredComponents:e.builderComponents,BlocksWrapperProps:{...(T=e.builderContext)==null?void 0:T.BlocksWrapperProps,"data-variant-id":`${(A=e.builderBlock)==null?void 0:A.id}-${v().index}`}}):null,!m&&Y.includes(g.TARGET)||!Y.includes(g.TARGET)?r.jsxs(r.Fragment,{children:[h?r.jsxs(r.Fragment,{children:[r.jsx(K,{nonce:((I=e.builderContext)==null?void 0:I.nonce)||"",styles:x(),id:`variants-styles-${(w=e.builderBlock)==null?void 0:w.id}`}),r.jsx(L,{nonce:((y=e.builderContext)==null?void 0:y.nonce)||"",scriptStr:o,id:`variants-visibility-script-${(k=e.builderBlock)==null?void 0:k.id}`}),(E=e.variants)==null?void 0:E.map((R,V)=>{var j,U,O,G,H,me;return r.jsx($,{BlocksWrapperProps:{...(j=e.builderContext)==null?void 0:j.BlocksWrapperProps,"aria-hidden":!0,hidden:!0,"data-variant-id":`${(U=e.builderBlock)==null?void 0:U.id}-${V}`},blocks:R.blocks,parent:(O=e.builderBlock)==null?void 0:O.id,path:`component.options.variants.${V}.blocks`,context:e.builderContext,registeredComponents:e.builderComponents,children:r.jsx(L,{nonce:((G=e.builderContext)==null?void 0:G.nonce)||"",scriptStr:a,id:`variants-script-${(H=e.builderBlock)==null?void 0:H.id}-${V}`})},`${(me=e.builderBlock)==null?void 0:me.id}-${V}`)})]}):null,r.jsx($,{blocks:v().blocks,parent:(N=e.builderBlock)==null?void 0:N.id,path:v().path,context:e.builderContext,registeredComponents:e.builderComponents,BlocksWrapperProps:{...(F=e.builderContext)==null?void 0:F.BlocksWrapperProps,"data-variant-id":`${(B=e.builderBlock)==null?void 0:B.id}-${v().index}`},children:h?r.jsx(L,{nonce:((P=e.builderContext)==null?void 0:P.nonce)||"",scriptStr:a,id:`variants-script-${(W=e.builderBlock)==null?void 0:W.id}-${Q}`}):null})]}):null]})}const un={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>"}}}]},dn={name:"Slot",isRSC:!0,description:"Allow child blocks to be inserted into this content when used as a Symbol",docsLink:"https://www.builder.io/c/docs/symbols-with-blocks",image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",inputs:[{name:"name",type:"string",required:!0,defaultValue:"children"}],shouldReceiveBuilderProps:{builderContext:!0,builderComponents:!0}};function mn(e){var t,n,i;return r.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:r.jsx($,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,registeredComponents:e.builderComponents,blocks:(i=e.builderContext.rootState)==null?void 0:i[e.name]})})}const fn={name:"Symbol",noWrap:!0,static:!0,isRSC:!0,inputs:[{name:"symbol",type:"uiSymbol"},{name:"dataOnly",helperText:"Make this a data symbol that doesn't display any UI",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"inheritState",helperText:"Inherit the parent component state and data",type:"boolean",defaultValue:!1,advanced:!0},{name:"renderToLiquid",helperText:"Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"useChildren",hideFromUI:!0,type:"boolean"}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},oe={"@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"}}},se={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{height:"200px",display:"flex",marginTop:"20px",flexDirection:"column"}},component:{name:"Text",options:{text:"New tab content "}}},gn={name:"Builder: Tabs",inputs:[{name:"tabs",type:"list",broadcast:!0,subFields:[{name:"label",type:"uiBlocks",hideFromUI:!0,defaultValue:[oe]},{name:"content",type:"uiBlocks",hideFromUI:!0,defaultValue:[se]}],defaultValue:[{label:[{...oe,component:{name:"Text",options:{text:"Tab 1"}}}],content:[{...se,component:{name:"Text",options:{text:"Tab 1 content"}}}]},{label:[{...oe,component:{name:"Text",options:{text:"Tab 2"}}}],content:[{...se,component:{name:"Text",options:{text:"Tab 2 content"}}}]}]},{name:"activeTabStyle",type:"uiStyle",helperText:"CSS styles for the active tab",defaultValue:{backgroundColor:"rgba(0, 0, 0, 0.1)"}},{name:"defaultActiveTab",type:"number",helperText:'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',defaultValue:1,advanced:!0},{name:"collapsible",type:"boolean",helperText:"If on, clicking an open tab closes it so no tabs are active",defaultValue:!1,advanced:!0},{name:"tabHeaderLayout",type:"enum",helperText:"Change the layout of the tab headers (uses justify-content)",defaultValue:"flex-start",enum:[{label:"Center",value:"center"},{label:"Space between",value:"space-between"},{label:"Space around",value:"space-around"},{label:"Left",value:"flex-start"},{label:"Right",value:"flex-end"}]}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}};function hn(e){var s;const[t,n]=f.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function i(o){return e.tabs&&e.tabs[o].content}function a(o){o===t&&e.collapsible?n(-1):n(o)}return r.jsxs("div",{children:[r.jsx("div",{className:"builder-tabs-wrap",style:{display:"flex",flexDirection:"row",justifyContent:e.tabHeaderLayout||"flex-start",overflow:"auto"},children:(s=e.tabs)==null?void 0:s.map((o,l)=>r.jsx("span",{className:`builder-tab-wrap ${t===l?"builder-tab-active":""}`,style:{...t===l?e.activeTabStyle:{}},onClick:c=>a(l),children:r.jsx($,{parent:e.builderBlock.id,path:`tabs.${l}.label`,blocks:o.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},l))}),i(t)?r.jsx("div",{children:r.jsx($,{parent:e.builderBlock.id,path:`tabs.${t}.content`,blocks:i(t),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}const bn={shouldReceiveBuilderProps:{},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 He(e){var t;return r.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const yn={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 pn(e){const t=f.useRef(null),[n,i]=f.useState(()=>[]),[a,s]=f.useState(()=>[]);function o(){var c;if(!t.current||!((c=t.current)!=null&&c.getElementsByTagName)||typeof window=="undefined")return;const l=t.current.getElementsByTagName("script");for(let u=0;u<l.length;u++){const h=l[u];if(h.src){if(n.includes(h.src))continue;n.push(h.src);const p=document.createElement("script");p.async=!0,p.src=h.src,document.head.appendChild(p)}else if(!h.type||["text/javascript","application/javascript","application/ecmascript"].includes(h.type)){if(a.includes(h.innerText))continue;try{a.push(h.innerText),new Function(h.innerText)()}catch(p){g.logger.warn("[BUILDER.IO] `CustomCode`: Error running script:",p)}}}}return f.useEffect(()=>{o()},[]),f.useEffect(()=>{g.isEditing()&&o()},[e.code]),r.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const xn={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc"},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},vn=["text/javascript","application/javascript","application/ecmascript"],Sn=e=>vn.includes(e.type);function kn(e){const t=f.useRef(null),[n,i]=f.useState(()=>[]),[a,s]=f.useState(()=>[]),[o,l]=f.useState(()=>!1);function c(){if(!t.current||!t.current.getElementsByTagName)return;const u=t.current.getElementsByTagName("script");for(let h=0;h<u.length;h++){const p=u[h];if(p.src&&!n.includes(p.src)){n.push(p.src);const m=document.createElement("script");m.async=!0,m.src=p.src,document.head.appendChild(m)}else if(Sn(p)&&!a.includes(p.innerText))try{a.push(p.innerText),new Function(p.innerText)()}catch(m){g.logger.warn("[BUILDER.IO] `Embed`: Error running script:",m)}}}return f.useEffect(()=>{t.current&&!o&&(l(!0),c())},[t.current,o]),r.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const Cn={name:"Form:Form",defaults:{responsiveStyles:{large:{marginTop:"15px",paddingBottom:"15px"}}},image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",inputs:[{name:"sendSubmissionsTo",type:"string",enum:[{label:"Send to email",value:"email",helperText:"Send form submissions to the email address of your choosing"},{label:"Custom",value:"custom",helperText:"Handle where the form requests go manually with a little code, e.g. to your own custom backend"}],defaultValue:"email"},{name:"sendSubmissionsToEmail",type:"string",required:!0,defaultValue:"your@email.com",showIf:'options.get("sendSubmissionsTo") === "email"'},{name:"sendWithJs",type:"boolean",helperText:"Set to false to use basic html form action",defaultValue:!0,showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"name",type:"string",defaultValue:"My form"},{name:"action",type:"string",helperText:"URL to send the form data to",showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"contentType",type:"string",defaultValue:"application/json",advanced:!0,enum:["application/json","multipart/form-data","application/x-www-form-urlencoded"],showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'},{name:"method",type:"string",showIf:'options.get("sendSubmissionsTo") === "custom"',defaultValue:"POST",advanced:!0},{name:"previewState",type:"string",enum:["unsubmitted","sending","success","error"],defaultValue:"unsubmitted",helperText:'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"successUrl",type:"url",helperText:"Optional URL to redirect the user to on form submission success",showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"resetFormOnSubmit",type:"boolean",showIf:"options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",advanced:!0},{name:"successMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Thanks!</span>"}}}]},{name:"validate",type:"boolean",defaultValue:!0,advanced:!0},{name:"errorMessagePath",type:"text",advanced:!0,helperText:'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'},{name:"errorMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},bindings:{"component.options.text":"state.formErrorMessage || block.component.options.text"},component:{name:"Text",options:{text:"<span>Form submission error :( Please check your answers and try again</span>"}}}]},{name:"sendingMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Sending...</span>"}}}]},{name:"customHeaders",type:"map",valueType:{type:"string"},advanced:!0,showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'}],noWrap:!0,canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your name</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"name",placeholder:"Jane Doe"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your email</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"email",placeholder:"jane@doe.com"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:SubmitButton",options:{text:"Submit"}}}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},Tn=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],In=()=>{const e=process.env.NODE_ENV||"production";return Tn.includes(e)?e:"production"};function wn(e){const t=f.useRef(null),[n,i]=f.useState(()=>"unsubmitted"),[a,s]=f.useState(()=>null),[o,l]=f.useState(()=>"");function c(p){var S,d;const m={...e.builderContext.rootState,...p};e.builderContext.rootSetState?(d=(S=e.builderContext).rootSetState)==null||d.call(S,m):e.builderContext.rootState=m}function u(){return g.isEditing()&&e.previewState||n}function h(p){var S;const m=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")p.preventDefault();else if(m){if(!(e.action||e.sendSubmissionsTo==="email")){p.preventDefault();return}p.preventDefault();const d=p.currentTarget||p.target,b=e.customHeaders||{};let v;const x=new FormData(d),C=Array.from(d.querySelectorAll("input,select,textarea")).filter(y=>!!y.name).map(y=>{let k;const E=y.name;if(y instanceof HTMLInputElement)if(y.type==="radio"){if(y.checked)return k=y.name,{key:E,value:k}}else if(y.type==="checkbox")k=y.checked;else if(y.type==="number"||y.type==="range"){const N=y.valueAsNumber;isNaN(N)||(k=N)}else y.type==="file"?k=y.files:k=y.value;else k=y.value;return{key:E,value:k}});let T=e.contentType;if(e.sendSubmissionsTo==="email"&&(T="multipart/form-data"),Array.from(C).forEach(({value:y})=>{(y instanceof File||Array.isArray(y)&&y[0]instanceof File||y instanceof FileList)&&(T="multipart/form-data")}),T!=="application/json")v=x;else{const y={};Array.from(C).forEach(({value:k,key:E})=>{D.set(y,E,k)}),v=JSON.stringify(y)}T&&T!=="multipart/form-data"&&(m&&((S=e.action)!=null&&S.includes("zapier.com"))||(b["content-type"]=T));const A=new CustomEvent("presubmit",{detail:{body:v}});if(t.current&&(t.current.dispatchEvent(A),A.defaultPrevented))return;if(i("sending"),e.sendSubmissionsTo==="email"&&(e.sendSubmissionsToEmail==="your@email.com"||!e.sendSubmissionsToEmail)){const y="SubmissionsToEmail is required when sendSubmissionsTo is set to email";console.error(y),i("error"),c({formErrorMessage:y});return}const I=`${In()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`,w=e.sendSubmissionsTo==="email"?I:e.action;g.logFetch(w),fetch(w,{body:v,headers:b,method:e.method||"post"}).then(async y=>{var N,F;let k;const E=y.headers.get("content-type");if(E&&E.indexOf("application/json")!==-1?k=await y.json():k=await y.text(),!y.ok){const B=new CustomEvent("submit:error",{detail:{error:k,status:y.status}});if((N=t.current)!=null&&N.nativeElement&&((F=t.current)==null||F.nativeElement.dispatchEvent(B),B.defaultPrevented))return;s(k),i("error");let P=e.errorMessagePath?Ie(k,e.errorMessagePath):k.message||k.error||k;typeof P!="string"&&(P=JSON.stringify(P)),l(P),c({formErrorMessage:P});return}if(s(k),i(y.ok?"success":"error"),y.ok){const B=new CustomEvent("submit:success",{detail:{res:y,body:k}});if(t.current){if(t.current.dispatchEvent(B),B.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const P=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(P),P.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},y=>{const k=new CustomEvent("submit:error",{detail:{error:y}});t.current&&(t.current.dispatchEvent(k),k.defaultPrevented)||(s(y),i("error"))})}}return r.jsxs(r.Fragment,{children:[" ",r.jsx("style",{children:".pre-7c90c93e { padding: 10px; color: red; text-align: center; }"})," ",r.jsxs("form",{validate:e.validate,ref:t,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:p=>h(p),...e.attributes,children:[e.children,u()==="error"?r.jsx($,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,u()==="sending"?r.jsx($,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,u()==="error"&&a?r.jsx("pre",{className:"builder-form-error-text pre-7c90c93e",children:JSON.stringify(a,null,2)}):null,u()==="success"?r.jsx($,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," "]})}const En={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 Rn(e){return f.createElement("input",{...e.attributes,key:g.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 Pn={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 An(e){var t;return f.createElement("select",{...e.attributes,value:e.value,key:g.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name,required:e.required},(t=e.options)==null?void 0:t.map((n,i)=>r.jsx("option",{value:n.value,children:n.name||n.value},`${n.name}-${i}`)))}const Vn={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 jn(e){return r.jsx("button",{type:"submit",...e.attributes,children:e.text})}const Bn={name:"Form:TextArea",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",inputs:[{advanced:!0,name:"value",type:"string"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"placeholder",type:"string",defaultValue:"Hello there"},{name:"required",type:"boolean",defaultValue:!1}],defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"},static:!0,noWrap:!0};function Nn(e){return r.jsx("textarea",{...e.attributes,placeholder:e.placeholder,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const Fn={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:de,required:!0}],noWrap:!0,static:!0};function $n(e){function t(){const n=e.imgSrc||e.image;if(!(!n||typeof n!="string")&&n.match(/builder\.io/))return J(n)}return r.jsx("img",{loading:"lazy",style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,srcSet:t(),...e.attributes},g.isEditing()&&e.imgSrc||"default-key")}const Wn={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:on,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:de,helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}],shouldReceiveBuilderProps:{builderBlock:!0}};function Me(e){var o,l,c,u,h,p,m;const t=f.useRef(null);function n(){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 i(){return{...n()}}const[a,s]=f.useState(()=>{});return f.useEffect(()=>{if(e.lazyLoad){const S=new IntersectionObserver(function(d){d.forEach(function(b){if(!b.isIntersecting)return;const v=b.target;try{Array.from(v.children).filter(x=>x instanceof HTMLElement&&x.tagName==="SOURCE").forEach(x=>{const C=x.dataset.src;C&&(x.src=C)}),v.load(),S.unobserve(v)}catch(x){console.error("Error loading lazy video:",x)}})});t.current&&S.observe(t.current),s(S)}},[]),f.useEffect(()=>()=>{a&&a.disconnect()},[]),r.jsxs("div",{style:{position:"relative"},children:[r.jsx("video",{className:"builder-video",...i(),ref:t,preload:e.lazyLoad?"none":e.preload||"metadata",style:{width:"100%",height:"100%",...(o=e.attributes)==null?void 0:o.style,objectFit:e.fit,objectPosition:e.position,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},poster:e.posterImage,children:r.jsx("source",{type:"video/mp4",...e.lazyLoad?{"data-src":e.video}:{src:e.video}})}),e.aspectRatio&&!(e.fitContent&&((c=(l=e.builderBlock)==null?void 0:l.children)!=null&&c.length))?r.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(h=(u=e.builderBlock)==null?void 0:u.children)!=null&&h.length&&e.fitContent?r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(m=(p=e.builderBlock)==null?void 0:p.children)!=null&&m.length&&!e.fitContent?r.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 Dn=()=>[{component:pn,...yn},{component:kn,...xn},{component:wn,...Cn},{component:Rn,...En},{component:jn,...Vn},{component:An,...Pn},{component:Nn,...Bn},{component:$n,...Fn},{component:Me,...Wn}],pe=()=>[{component:Ce,...nn},{component:$e,...an},{component:We,...rn},{component:De,...sn},{component:Oe,...un},{component:mn,...dn},{component:Qe,...fn},{component:He,...bn},...Ue.includes(g.TARGET)?[{component:cn,...ln}]:[],{component:hn,...gn},{component:tn,...en},...Dn()],On=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget, isAngularSDK) {
|
|
222
222
|
function getAndSetVariantId() {
|
|
223
223
|
function setCookie(name, value, days) {
|
|
224
224
|
let expires = '';
|
|
@@ -311,7 +311,7 @@
|
|
|
311
311
|
thisScriptEl?.remove();
|
|
312
312
|
}
|
|
313
313
|
return;
|
|
314
|
-
}`,ze="builderIoAbTest",Ke="builderIoRenderContent",
|
|
314
|
+
}`,ze="builderIoAbTest",Ke="builderIoRenderContent",X=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),_n=({canTrack:e,content:t})=>!(!(X(t).length>0)||!e||g.isBrowser()),Un=e=>e==="react"||e==="reactNative",qn=g.TARGET==="angular",Ge=Un(g.TARGET),Hn=()=>`
|
|
315
315
|
window.${ze} = ${On}
|
|
316
316
|
window.${Ke} = ${Ln}
|
|
317
317
|
`,Mn=(e,t)=>`
|
|
@@ -350,8 +350,8 @@ font-weight: ${l};
|
|
|
350
350
|
text-align: inherit;
|
|
351
351
|
font-family: inherit;
|
|
352
352
|
}
|
|
353
|
-
`,ti=e=>e?"":ei,ni=e=>`variant-${e}`;function ii(e){var C,T,A;const t=f.useRef(null);f.useState(()=>!1);function n(I){var y,k;const w={...e.builderContextSignal.rootState,...I};e.builderContextSignal.rootSetState?(k=(y=e.builderContextSignal).rootSetState)==null||k.call(y,w):e.setBuilderContextSignal(E=>({...E,rootState:w}))}function i(I){var y,k,E,N,F;const w={...e.builderContextSignal.content,...I,data:{...(y=e.builderContextSignal.content)==null?void 0:y.data,...I==null?void 0:I.data},meta:{...(k=e.builderContextSignal.content)==null?void 0:k.meta,...I==null?void 0:I.meta,breakpoints:((E=I==null?void 0:I.meta)==null?void 0:E.breakpoints)||((F=(N=e.builderContextSignal.content)==null?void 0:N.meta)==null?void 0:F.breakpoints)}};e.setBuilderContextSignal(B=>({...B,content:w}))}function a(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[s,o]=f.useState(()=>e.contentWrapper||"div");function l(I){return g.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:w=>{var E;const{breakpoints:y,contentId:k}=w;!k||k!==((E=e.builderContextSignal.content)==null?void 0:E.id)||y&&i({meta:{breakpoints:y}})},animation:w=>{Pe(w)},contentUpdate:w=>{i(w)},stateUpdate:w=>{n(w)}}})(I)}const[c,u]=f.useState(()=>({})),[h,p]=f.useState(()=>({})),[m,S]=f.useState(()=>!1);function d(I){var w,y;if(e.builderContextSignal.content){const k=(w=e.builderContextSignal.content)==null?void 0:w.testVariationId,E=(y=e.builderContextSignal.content)==null?void 0:y.id;g._track({apiHost:e.apiHost,type:"click",canTrack:g.getDefaultCanTrack(e.canTrack),contentId:E,apiKey:e.apiKey,variationId:k!==E?k:void 0,...Jn(I),unique:!m})}m||S(!0)}function b(){var w,y,k;const I=(k=(y=(w=e.builderContextSignal.content)==null?void 0:w.data)==null?void 0:y.httpRequests)!=null?k:{};Object.entries(I).forEach(([E,N])=>{if(!N||h[E]||c[E]&&!g.isEditing())return;h[E]=!0;const F=N.replace(/{{([^}]+)}}/g,(B,P)=>String(q({code:P,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})));g.logFetch(F),fetch(F).then(B=>B.json()).then(B=>{n({[E]:B}),c[E]=!0}).catch(B=>{console.error("error fetching dynamic data",N,B)}).finally(()=>{h[E]=!1})})}function v(){g.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:D.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}const x=f.useRef(!1);return x.current||(b(),v(),x.current=!0),f.useEffect(()=>{var I,w,y,k,E;if(g.isBrowser()){g.isEditing()&&!e.isNestedRender&&(window.addEventListener("message",l),g.registerInsertMenu(),g.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{},modelName:(I=e.model)!=null?I:"",apiKey:e.apiKey}),Object.values(e.builderContextSignal.componentInfos).forEach(P=>{var W,R;if(!((W=P.models)!=null&&W.length)||P.models.includes(e.model)){const V=g.createRegisterComponentMessage(P);(R=window.parent)==null||R.postMessage(V,"*")}}),window.addEventListener("builder:component:stateChangeListenerActivated",v));const N=e.builderContextSignal.content&&g.getDefaultCanTrack(e.canTrack),F=g.getCookieSync({name:`builder.tests.${(w=e.builderContextSignal.content)==null?void 0:w.id}`,canTrack:!0}),B=(y=e.builderContextSignal.content)==null?void 0:y.testVariationId;if(N&&B===F){const P=(k=e.builderContextSignal.content)==null?void 0:k.id,W=e.apiKey;g._track({apiHost:e.apiHost,type:"impression",canTrack:!0,contentId:P,apiKey:W,variationId:F!==P?F:void 0})}if(g.isPreviewing()&&!g.isEditing()){const P=new URL(location.href).searchParams,W=P.get("builder.preview"),R=P.get(`builder.overrides.${W}`),V=P.get("apiKey")||P.get("builder.space");(W==="BUILDER_STUDIO"||W===e.model&&V===e.apiKey&&(!e.content||R===e.content.id))&&g.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion,...W==="BUILDER_STUDIO"&&((E=e.context)!=null&&E.symbolId)?{query:{id:e.context.symbolId}}:{}}).then(j=>{j&&i(j)})}}},[]),f.useEffect(()=>{e.content&&i(e.content)},[e.content]),f.useEffect(()=>{v()},[e.builderContextSignal.rootState]),f.useEffect(()=>{e.data&&n(e.data)},[e.data]),f.useEffect(()=>{e.locale&&n({locale:e.locale})},[e.locale]),f.useEffect(()=>()=>{g.isBrowser()&&(window.removeEventListener("message",l),window.removeEventListener("builder:component:stateChangeListenerActivated",v))},[]),r.jsx(
|
|
353
|
+
`,ti=e=>e?"":ei,ni=e=>`variant-${e}`;function ii(e){var C,T,A;const t=f.useRef(null);f.useState(()=>!1);function n(I){var y,k;const w={...e.builderContextSignal.rootState,...I};e.builderContextSignal.rootSetState?(k=(y=e.builderContextSignal).rootSetState)==null||k.call(y,w):e.setBuilderContextSignal(E=>({...E,rootState:w}))}function i(I){var y,k,E,N,F;const w={...e.builderContextSignal.content,...I,data:{...(y=e.builderContextSignal.content)==null?void 0:y.data,...I==null?void 0:I.data},meta:{...(k=e.builderContextSignal.content)==null?void 0:k.meta,...I==null?void 0:I.meta,breakpoints:((E=I==null?void 0:I.meta)==null?void 0:E.breakpoints)||((F=(N=e.builderContextSignal.content)==null?void 0:N.meta)==null?void 0:F.breakpoints)}};e.setBuilderContextSignal(B=>({...B,content:w}))}function a(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[s,o]=f.useState(()=>e.contentWrapper||"div");function l(I){return g.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:w=>{var E;const{breakpoints:y,contentId:k}=w;!k||k!==((E=e.builderContextSignal.content)==null?void 0:E.id)||y&&i({meta:{breakpoints:y}})},animation:w=>{Pe(w)},contentUpdate:w=>{i(w)},stateUpdate:w=>{n(w)}}})(I)}const[c,u]=f.useState(()=>({})),[h,p]=f.useState(()=>({})),[m,S]=f.useState(()=>!1);function d(I){var w,y;if(e.builderContextSignal.content){const k=(w=e.builderContextSignal.content)==null?void 0:w.testVariationId,E=(y=e.builderContextSignal.content)==null?void 0:y.id;g._track({apiHost:e.apiHost,type:"click",canTrack:g.getDefaultCanTrack(e.canTrack),contentId:E,apiKey:e.apiKey,variationId:k!==E?k:void 0,...Jn(I),unique:!m})}m||S(!0)}function b(){var w,y,k;const I=(k=(y=(w=e.builderContextSignal.content)==null?void 0:w.data)==null?void 0:y.httpRequests)!=null?k:{};Object.entries(I).forEach(([E,N])=>{if(!N||h[E]||c[E]&&!g.isEditing())return;h[E]=!0;const F=N.replace(/{{([^}]+)}}/g,(B,P)=>String(q({code:P,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})));g.logFetch(F),fetch(F).then(B=>B.json()).then(B=>{n({[E]:B}),c[E]=!0}).catch(B=>{console.error("error fetching dynamic data",N,B)}).finally(()=>{h[E]=!1})})}function v(){g.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:D.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}const x=f.useRef(!1);return x.current||(b(),v(),x.current=!0),f.useEffect(()=>{var I,w,y,k,E;if(g.isBrowser()){g.isEditing()&&!e.isNestedRender&&(window.addEventListener("message",l),g.registerInsertMenu(),g.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{},modelName:(I=e.model)!=null?I:"",apiKey:e.apiKey}),Object.values(e.builderContextSignal.componentInfos).forEach(P=>{var W,R;if(!((W=P.models)!=null&&W.length)||P.models.includes(e.model)){const V=g.createRegisterComponentMessage(P);(R=window.parent)==null||R.postMessage(V,"*")}}),window.addEventListener("builder:component:stateChangeListenerActivated",v));const N=e.builderContextSignal.content&&g.getDefaultCanTrack(e.canTrack),F=g.getCookieSync({name:`builder.tests.${(w=e.builderContextSignal.content)==null?void 0:w.id}`,canTrack:!0}),B=(y=e.builderContextSignal.content)==null?void 0:y.testVariationId;if(N&&B===F){const P=(k=e.builderContextSignal.content)==null?void 0:k.id,W=e.apiKey;g._track({apiHost:e.apiHost,type:"impression",canTrack:!0,contentId:P,apiKey:W,variationId:F!==P?F:void 0})}if(g.isPreviewing()&&!g.isEditing()){const P=new URL(location.href).searchParams,W=P.get("builder.preview"),R=P.get(`builder.overrides.${W}`),V=P.get("apiKey")||P.get("builder.space");(W==="BUILDER_STUDIO"||W===e.model&&V===e.apiKey&&(!e.content||R===e.content.id))&&g.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion,...W==="BUILDER_STUDIO"&&((E=e.context)!=null&&E.symbolId)?{query:{id:e.context.symbolId}}:{}}).then(j=>{j&&i(j)})}}},[]),f.useEffect(()=>{e.content&&i(e.content)},[e.content]),f.useEffect(()=>{v()},[e.builderContextSignal.rootState]),f.useEffect(()=>{e.data&&n(e.data)},[e.data]),f.useEffect(()=>{e.locale&&n({locale:e.locale})},[e.locale]),f.useEffect(()=>()=>{g.isBrowser()&&(window.removeEventListener("message",l),window.removeEventListener("builder:component:stateChangeListenerActivated",v))},[]),r.jsx(ee.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content||Se()?r.jsx(s,{ref:t,onClick:I=>d(I),"builder-content-id":(C=e.builderContextSignal.content)==null?void 0:C.id,"builder-model":e.model,className:ni(((T=e.content)==null?void 0:T.testVariationId)||((A=e.content)==null?void 0:A.id)),style:{display:!e.builderContextSignal.content&&Se()?"none":void 0},...a(),...e.contentWrapperProps,children:e.children}):null})}function ai(e){const[t,n]=f.useState(()=>`
|
|
354
354
|
${Zn({cssCode:e.cssCode,contentId:e.contentId})}
|
|
355
355
|
${Xn({customFonts:e.customFonts})}
|
|
356
356
|
${ti(e.isNestedRender)}
|
|
357
|
-
`.trim());return r.jsx(K,{id:"builderio-content",styles:t,nonce:e.nonce})}const ri=({content:e,data:t,locale:n})=>{var s,o,l;const i={},a=((s=e==null?void 0:e.data)==null?void 0:s.state)||{};return(l=(o=e==null?void 0:e.data)==null?void 0:o.inputs)==null||l.forEach(c=>{c.name&&c.defaultValue!==void 0&&(i[c.name]=c.defaultValue)}),{...i,...a,...t,...n?{locale:n}:{}}},oi=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function ke(e){var u,h,p,m,S,d,b,v,x;const[t,n]=f.useState(()=>{var C,T;return zn({variationId:(C=e.content)==null?void 0:C.testVariationId,contentId:(T=e.content)==null?void 0:T.id})});function i(C){l(T=>({...T,rootState:C}))}const[a,s]=f.useState(()=>[...pe(),...e.customComponents||[]].reduce((C,{component:T,...A})=>({...C,[A.name]:{component:T,...g.serializeIncludingFunctions(A)}}),{})),[o,l]=f.useState(()=>({content:oi({content:e.content,data:e.data}),localState:void 0,rootState:ri({content:e.content,data:e.data,locale:e.locale}),rootSetState:i,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...pe(),...e.customComponents||[]].reduce((C,{component:T,...A})=>({...C,[A.name]:g.serializeIncludingFunctions(A)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{},nonce:e.nonce||"",model:e.model})),c=f.useRef(!1);if(!c.current){e.apiKey||g.logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");const C=(h=(u=o.content)==null?void 0:u.data)==null?void 0:h.jsCode;C&&q({code:C,context:e.context||{},localState:void 0,rootState:o.rootState,rootSetState:T=>{Object.assign(o.rootState,T)},isExpression:!1}),c.current=!0}return r.jsx(Te.Provider,{value:{registeredComponents:a},children:r.jsxs(ii,{apiHost:e.apiHost,nonce:e.nonce,content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:o,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts,isNestedRender:e.isNestedRender,setBuilderContextSignal:l,children:[e.isSsrAbTest?r.jsx(L,{id:"builderio-variant-visibility",scriptStr:t,nonce:e.nonce||""}):null,r.jsx(ai,{nonce:e.nonce||"",isNestedRender:e.isNestedRender,contentId:(p=o.content)==null?void 0:p.id,cssCode:(S=(m=o.content)==null?void 0:m.data)==null?void 0:S.cssCode,customFonts:(b=(d=o.content)==null?void 0:d.data)==null?void 0:b.customFonts}),r.jsx($,{blocks:(x=(v=o.content)==null?void 0:v.data)==null?void 0:x.blocks,context:o,registeredComponents:a,linkComponent:e.linkComponent})]})})}function Je(e){var o;const[t,n]=f.useState(()=>_n({canTrack:g.getDefaultCanTrack(e.canTrack),content:e.content}));function i(){var l;return Mn(
|
|
357
|
+
`.trim());return r.jsx(K,{id:"builderio-content",styles:t,nonce:e.nonce})}const ri=({content:e,data:t,locale:n})=>{var s,o,l;const i={},a=((s=e==null?void 0:e.data)==null?void 0:s.state)||{};return(l=(o=e==null?void 0:e.data)==null?void 0:o.inputs)==null||l.forEach(c=>{c.name&&c.defaultValue!==void 0&&(i[c.name]=c.defaultValue)}),{...i,...a,...t,...n?{locale:n}:{}}},oi=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function ke(e){var u,h,p,m,S,d,b,v,x;const[t,n]=f.useState(()=>{var C,T;return zn({variationId:(C=e.content)==null?void 0:C.testVariationId,contentId:(T=e.content)==null?void 0:T.id})});function i(C){l(T=>({...T,rootState:C}))}const[a,s]=f.useState(()=>[...pe(),...e.customComponents||[]].reduce((C,{component:T,...A})=>({...C,[A.name]:{component:T,...g.serializeIncludingFunctions(A)}}),{})),[o,l]=f.useState(()=>({content:oi({content:e.content,data:e.data}),localState:void 0,rootState:ri({content:e.content,data:e.data,locale:e.locale}),rootSetState:i,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...pe(),...e.customComponents||[]].reduce((C,{component:T,...A})=>({...C,[A.name]:g.serializeIncludingFunctions(A)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{},nonce:e.nonce||"",model:e.model})),c=f.useRef(!1);if(!c.current){e.apiKey||g.logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");const C=(h=(u=o.content)==null?void 0:u.data)==null?void 0:h.jsCode;C&&q({code:C,context:e.context||{},localState:void 0,rootState:o.rootState,rootSetState:T=>{Object.assign(o.rootState,T)},isExpression:!1}),c.current=!0}return r.jsx(Te.Provider,{value:{registeredComponents:a},children:r.jsxs(ii,{apiHost:e.apiHost,nonce:e.nonce,content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:o,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts,isNestedRender:e.isNestedRender,setBuilderContextSignal:l,children:[e.isSsrAbTest?r.jsx(L,{id:"builderio-variant-visibility",scriptStr:t,nonce:e.nonce||""}):null,r.jsx(ai,{nonce:e.nonce||"",isNestedRender:e.isNestedRender,contentId:(p=o.content)==null?void 0:p.id,cssCode:(S=(m=o.content)==null?void 0:m.data)==null?void 0:S.cssCode,customFonts:(b=(d=o.content)==null?void 0:d.data)==null?void 0:b.customFonts}),r.jsx($,{blocks:(x=(v=o.content)==null?void 0:v.data)==null?void 0:x.blocks,context:o,registeredComponents:a,linkComponent:e.linkComponent})]})})}function Je(e){var o;const[t,n]=f.useState(()=>_n({canTrack:g.getDefaultCanTrack(e.canTrack),content:e.content}));function i(){var l;return Mn(X(e.content).map(c=>({id:c.testVariationId,testRatio:c.testRatio})),((l=e.content)==null?void 0:l.id)||"")}function a(){return X(e.content).map(l=>`.variant-${l.testVariationId} { display: none; } `).join("")}function s(){var l;return t?{...e.content,testVariationId:(l=e.content)==null?void 0:l.id}:g.handleABTestingSync({item:e.content,canTrack:g.getDefaultCanTrack(e.canTrack)})}return f.useEffect(()=>{},[]),r.jsxs(r.Fragment,{children:[!e.isNestedRender&&g.TARGET!=="reactNative"?r.jsxs(r.Fragment,{children:[r.jsx(L,{id:"builderio-init-variants-fns",scriptStr:Hn(),nonce:e.nonce||""}),Ue.includes(g.TARGET)?r.jsx(L,{id:"builderio-init-personalization-variants-fns",nonce:e.nonce||"",scriptStr:Yt()}):null]}):null,t?r.jsxs(r.Fragment,{children:[r.jsx(K,{id:"builderio-variants",styles:a(),nonce:e.nonce||""}),r.jsx(L,{id:"builderio-variants-visibility",scriptStr:i(),nonce:e.nonce||""}),(o=X(e.content))==null?void 0:o.map(l=>r.jsx(ke,{apiHost:e.apiHost,isNestedRender:e.isNestedRender,nonce:e.nonce,content:l,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},l.testVariationId))]}):null,r.jsx(ke,{apiHost:e.apiHost,nonce:e.nonce,isNestedRender:e.isNestedRender,content:s(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const si=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return g.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{g.logger.error("Could not fetch symbol content: ",n)})};function Qe(e){var u,h,p,m,S;function t(){return"div"}function n(){return"div"}function i(){var d,b;return[e.attributes[_()],"builder-symbol",(d=e.symbol)!=null&&d.inline?"builder-inline-symbol":void 0,(b=e.symbol)!=null&&b.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[a,s]=f.useState(()=>{var d;return(d=e.symbol)==null?void 0:d.content}),[o,l]=f.useState(()=>{var d;return(d=e.symbol)==null?void 0:d.entry});function c(){var d;a&&o===((d=e.symbol)==null?void 0:d.entry)||si({symbol:e.symbol,builderContextValue:e.builderContext}).then(b=>{var v;b&&(s(b),l((v=e.symbol)==null?void 0:v.entry))})}return f.useEffect(()=>{},[]),f.useEffect(()=>{c()},[e.symbol]),r.jsx("div",{...e.attributes,className:i(),children:r.jsx(Je,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(u=e.builderBlock)==null?void 0:u.id},customComponents:Object.values(e.builderComponents),data:{...(h=e.symbol)==null?void 0:h.data,...e.builderContext.localState,...(p=a==null?void 0:a.data)==null?void 0:p.state},canTrack:e.builderContext.canTrack,model:(S=(m=e.symbol)==null?void 0:m.model)!=null?S:"",content:a,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:n()})})}exports.setClientUserAttributes=g.setClientUserAttributes;exports.Blocks=$;exports.BuilderContext=ee;exports.Button=Ce;exports.Columns=$e;exports.Content=Je;exports.Fragment=We;exports.Image=De;exports.Section=Oe;exports.Symbol=Qe;exports.Text=He;exports.Video=Me;
|