@builder.io/sdk-react 0.7.0 → 0.7.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.
Files changed (37) hide show
  1. package/lib/browser/index.cjs +23 -23
  2. package/lib/browser/index.mjs +592 -560
  3. package/lib/browser/{server-entry-f341a184.mjs → server-entry-13b7e1e6.mjs} +200 -185
  4. package/lib/browser/server-entry-c98db16c.js +2 -0
  5. package/lib/browser/server-entry.cjs +1 -1
  6. package/lib/browser/server-entry.mjs +1 -1
  7. package/lib/edge/index.cjs +32 -32
  8. package/lib/edge/index.mjs +1122 -1062
  9. package/lib/{node/server-entry-f341a184.mjs → edge/server-entry-13b7e1e6.mjs} +200 -185
  10. package/lib/edge/server-entry-c98db16c.js +2 -0
  11. package/lib/edge/server-entry.cjs +1 -1
  12. package/lib/edge/server-entry.mjs +1 -1
  13. package/lib/index.cjs +14 -0
  14. package/lib/index.mjs +10 -0
  15. package/lib/node/index.cjs +68 -28
  16. package/lib/node/index.mjs +931 -802
  17. package/lib/{edge/server-entry-f341a184.mjs → node/server-entry-13b7e1e6.mjs} +200 -185
  18. package/lib/node/server-entry-c98db16c.js +2 -0
  19. package/lib/node/server-entry.cjs +1 -1
  20. package/lib/node/server-entry.mjs +1 -1
  21. package/package.json +4 -1
  22. package/types/blocks/image/image.d.ts +1 -1
  23. package/types/constants/sdk-version.d.ts +1 -1
  24. package/types/functions/evaluate/choose-eval.d.ts +6 -0
  25. package/types/functions/evaluate/evaluate.d.ts +1 -5
  26. package/types/functions/evaluate/helpers.d.ts +7 -1
  27. package/types/functions/evaluate/node-runtime/index.d.ts +1 -1
  28. package/types/functions/evaluate/node-runtime/node-runtime.d.ts +2 -0
  29. package/types/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +13 -0
  30. package/types/functions/get-content/types.d.ts +94 -3
  31. package/types/functions/is-node-runtime.d.ts +4 -0
  32. package/types/node-runtime/index.d.ts +1 -0
  33. package/types/node-runtime/node-runtime.d.ts +1 -0
  34. package/types/node-runtime.d.ts +1 -0
  35. package/lib/browser/server-entry-f668f903.js +0 -2
  36. package/lib/edge/server-entry-f668f903.js +0 -2
  37. package/lib/node/server-entry-f668f903.js +0 -2
@@ -0,0 +1,2 @@
1
+ "use strict";const v=t=>JSON.parse(JSON.stringify(t)),p="react",h="[Builder.io]: ",l={log:(...t)=>console.log(h,...t),error:(...t)=>console.error(h,...t),warn:(...t)=>console.warn(h,...t),debug:(...t)=>console.debug(h,...t)};function a(){return typeof window<"u"&&typeof document<"u"}function rt(){return a()&&window.self!==window.top}function I(){return rt()&&window.location.search.indexOf("builder.frameEditing=")!==-1}const ot=()=>{if(a()){const t=new URL(location.href);return t.pathname===""&&(t.pathname="/"),t}else return console.warn("Cannot get location for tracking in non-browser environment"),null},st=()=>typeof navigator=="object"&&navigator.userAgent||"",U=()=>{const t=st(),e={Android(){return t.match(/Android/i)},BlackBerry(){return t.match(/BlackBerry/i)},iOS(){return t.match(/iPhone|iPod/i)},Opera(){return t.match(/Opera Mini/i)},Windows(){return t.match(/IEMobile/i)||t.match(/WPDesktop/i)},any(){return e.Android()||e.BlackBerry()||e.iOS()||e.Opera()||e.Windows()||p==="reactNative"}},n=t.match(/Tablet|iPad/i),r=ot();return{urlPath:r==null?void 0:r.pathname,host:(r==null?void 0:r.host)||(r==null?void 0:r.hostname),device:n?"tablet":e.any()?"mobile":"desktop"}},d=t=>t!=null,it=[],at=t=>({type:"builder.registerComponent",data:F(t)}),ct=t=>{const e=t.toString().trim();return`return (${!e.startsWith("function")&&!e.startsWith("(")?"function ":""}${e}).apply(this, arguments)`},ut=t=>typeof t=="function"?ct(t):v(t),F=({inputs:t,...e})=>({...v(e),inputs:t==null?void 0:t.map(n=>Object.entries(n).reduce((r,[o,s])=>({...r,[o]:ut(s)}),{}))});function lt(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:globalThis}function dt(){const t=lt().fetch;if(typeof t>"u")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
2
+ For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return t}const M=dt(),ft=t=>{if(t==="localhost"||t==="127.0.0.1")return t;const e=t.split(".");return e.length>2?e.slice(1).join("."):t},D=({name:t,canTrack:e})=>{var n;try{return e?(n=document.cookie.split("; ").find(r=>r.startsWith(`${t}=`)))==null?void 0:n.split("=")[1]:void 0}catch(r){l.warn("[COOKIE] GET error: ",(r==null?void 0:r.message)||r);return}},K=async t=>D(t),ht=t=>t.map(([e,n])=>n?`${e}=${n}`:e).filter(d).join("; "),gt=[["secure",""],["SameSite","None"]],pt=({name:t,value:e,expires:n})=>{const o=(a()?location.protocol==="https:":!0)?gt:[[]],s=n?[["expires",n.toUTCString()]]:[[]],c=[[t,e],...s,["path","/"],["domain",ft(window.location.hostname)],...o];return ht(c)},_=async({name:t,value:e,expires:n,canTrack:r})=>{try{if(!r)return;const o=pt({name:t,value:e,expires:n});document.cookie=o}catch(o){l.warn("[COOKIE] SET error: ",(o==null?void 0:o.message)||o)}};function yt(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}function G(){return yt().replace(/-/g,"")}const W="builderSessionId",mt=async({canTrack:t})=>{if(!t)return;const e=await K({name:W,canTrack:t});if(d(e))return e;{const n=St();return wt({id:n,canTrack:t}),n}},St=()=>G(),wt=({id:t,canTrack:e})=>_({name:W,value:t,canTrack:e}),J=()=>a()&&typeof localStorage<"u"?localStorage:void 0,bt=({key:t,canTrack:e})=>{var n;try{return e?(n=J())==null?void 0:n.getItem(t):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},vt=({key:t,canTrack:e,value:n})=>{var r;try{e&&((r=J())==null||r.setItem(t,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},z="builderVisitorId",It=({canTrack:t})=>{if(!t)return;const e=bt({key:z,canTrack:t});if(d(e))return e;{const n=Ct();return kt({id:n,canTrack:t}),n}},Ct=()=>G(),kt=({id:t,canTrack:e})=>vt({key:z,value:t,canTrack:e}),Et=async({canTrack:t})=>{if(!t)return{visitorId:void 0,sessionId:void 0};const e=await mt({canTrack:t}),n=It({canTrack:t});return{sessionId:e,visitorId:n}},Ot=async({type:t,canTrack:e,apiKey:n,metadata:r,...o})=>({type:t,data:{...o,metadata:{url:location.href,...r},...await Et({canTrack:e}),userAttributes:U(),ownerId:n}});async function X(t){if(!t.apiKey){l.error("Missing API key for track call. Please provide your API key.");return}if(t.canTrack&&!I()&&(a()||p==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await Ot(t)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(e=>{console.error("Failed to track: ",e)})}const Pt=t=>X({...t,canTrack:!0}),L={};function At(t,e){let n=L[t];if(n||(n=L[t]=[]),n.push(e),a()){const r={type:"builder.register",data:{type:t,info:e}};try{parent.postMessage(r,"*"),parent!==window&&window.postMessage(r,"*")}catch(o){console.debug("Could not postmessage",o)}}}const xt="builder.tests",C=t=>`${xt}.${t}`,Tt=({contentId:t})=>K({name:C(t),canTrack:!0}),Rt=({contentId:t})=>D({name:C(t),canTrack:!0}),Bt=({contentId:t,value:e})=>_({name:C(t),value:e,canTrack:!0}),q=t=>d(t.id)&&d(t.variations)&&Object.keys(t.variations).length>0,Vt=({id:t,variations:e})=>{var o;let n=0;const r=Math.random();for(const s in e){const c=(o=e[s])==null?void 0:o.testRatio;if(n+=c,r<n)return s}return t},H=t=>{const e=Vt(t);return Bt({contentId:t.id,value:e}).catch(n=>{l.error("could not store A/B test variation: ",n)}),e},Y=({item:t,testGroupId:e})=>{const n=t.variations[e];return e===t.id||!n?{testVariationId:t.id,testVariationName:"Default"}:{data:n.data,testVariationId:n.id,testVariationName:n.name||(n.id===t.id?"Default":"")}},Lt=({item:t,canTrack:e})=>{if(!e)return t;if(!t)return;if(!q(t))return t;const n=Rt({contentId:t.id})||H({variations:t.variations,id:t.id}),r=Y({item:t,testGroupId:n});return{...t,...r}},Nt=async({item:t,canTrack:e})=>{if(!e||!q(t))return t;const r=await Tt({contentId:t.id})||H({variations:t.variations,id:t.id}),o=Y({item:t,testGroupId:r});return{...t,...o}},Q=t=>d(t)?t:!0;function g(t,e=null,n="."){return Object.keys(t).reduce((r,o)=>{const s=t[o],c=[e,o].filter(Boolean).join(n);return[typeof s=="object",s!==null,!(Array.isArray(s)&&s.length===0)].every(Boolean)?{...r,...g(s,c,n)}:{...r,[c]:s}},{})}const N="builder.",$t="options.",jt=t=>{const e={};return t.forEach((n,r)=>{e[r]=n}),e},k=t=>{if(!t)return{};const e=Z(t),n={};return Object.keys(e).forEach(r=>{if(r.startsWith(N)){const o=r.replace(N,"").replace($t,"");n[o]=e[r]}}),n},Ut=()=>{if(!a())return{};const t=new URLSearchParams(window.location.search);return k(t)},Z=t=>t instanceof URLSearchParams?jt(t):t,Ft="v3",$=t=>typeof t=="number"&&!isNaN(t)&&t>=0,E=t=>{let{noTraverse:e=!1}=t;const{limit:n=30,userAttributes:r,query:o,model:s,apiKey:c,includeRefs:y=!0,enrich:A,locale:x,apiVersion:m=Ft,fields:T,omit:et,offset:S,cacheSeconds:w,staleCacheSeconds:b,sort:R,includeUnpublished:B}=t;if(!c)throw new Error("Missing API key");if(!["v2","v3"].includes(m))throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${m}'`);(t.limit===void 0||t.limit>1)&&!("noTraverse"in t)&&(e=!0);const i=new URL(`https://cdn.builder.io/api/${m}/content/${s}?apiKey=${c}&limit=${n}&noTraverse=${e}&includeRefs=${y}${x?`&locale=${x}`:""}${A?`&enrich=${A}`:""}`);if(i.searchParams.set("omit",et||"meta.componentsUsed"),T&&i.searchParams.set("fields",T),Number.isFinite(S)&&S>-1&&i.searchParams.set("offset",String(Math.floor(S))),typeof B=="boolean"&&i.searchParams.set("includeUnpublished",String(B)),w&&$(w)&&i.searchParams.set("cacheSeconds",String(w)),b&&$(b)&&i.searchParams.set("staleCacheSeconds",String(b)),R){const u=g({sort:R});for(const f in u)i.searchParams.set(f,JSON.stringify(u[f]))}const nt={...Ut(),...Z(t.options||{})},V=g(nt);for(const u in V)i.searchParams.set(u,String(V[u]));if(r&&i.searchParams.set("userAttributes",JSON.stringify(r)),o){const u=g({query:o});for(const f in u)i.searchParams.set(f,JSON.stringify(u[f]))}return i},Mt=t=>"results"in t;async function O(t){const e=await P({...t,limit:1});return e&&e.results[0]||null}const Dt=O,Kt=async t=>{const e=E(t);return await(await M(e.href)).json()},tt=async(t,e,n=E(t))=>{const r=Q(t.canTrack);if(n.search.includes("preview="),!r||!(a()||p==="reactNative"))return e;try{const o=[];for(const s of e.results)o.push(await Nt({item:s,canTrack:r}));e.results=o}catch(o){l.error("Could not process A/B tests. ",o)}return e};async function P(t){try{const e=E(t),n=await Kt(t);return Mt(n)?tt(t,n):(l.error("Error fetching data. ",{url:e,content:n,options:t}),null)}catch(e){return l.error("Error fetching data. ",e),null}}const _t=P;function Gt(){return!a()||I()?!1:location.search.indexOf("builder.preview=")!==-1}const j={};function Wt(t){if(a()){Object.assign(j,t);const e={type:"builder.settingsChange",data:j};parent.postMessage(e,"*")}}const Jt=async t=>{var r,o,s;const e=t.path||((r=t.url)==null?void 0:r.pathname)||((o=t.userAttributes)==null?void 0:o.urlPath),n={...t,apiKey:t.apiKey,model:t.model||"page",userAttributes:{...t.userAttributes,...e?{urlPath:e}:{}},options:k(t.searchParams||((s=t.url)==null?void 0:s.searchParams)||t.options)};return{apiKey:n.apiKey,model:n.model,content:await O(n)}};exports.TARGET=p;exports._processContentResult=tt;exports._track=X;exports.checkIsDefined=d;exports.components=it;exports.createRegisterComponentMessage=at;exports.fastClone=v;exports.fetch=M;exports.fetchBuilderProps=Jt;exports.fetchEntries=P;exports.fetchOneEntry=O;exports.getAllContent=_t;exports.getBuilderSearchParams=k;exports.getContent=Dt;exports.getDefaultCanTrack=Q;exports.getUserAttributes=U;exports.handleABTestingSync=Lt;exports.isBrowser=a;exports.isEditing=I;exports.isPreviewing=Gt;exports.logger=l;exports.register=At;exports.serializeComponentInfo=F;exports.setEditorSettings=Wt;exports.track=Pt;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-f668f903.js");exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getAllContent=e.getAllContent;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.getContent=e.getContent;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.track=e.track;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-c98db16c.js");exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getAllContent=e.getAllContent;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.getContent=e.getContent;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.track=e.track;
@@ -1,4 +1,4 @@
1
- import { _ as t, c as a, h as r, f as i, b as n, g, e as o, d as c, i as d, a as f, r as h, s as l, t as p } from "./server-entry-f341a184.mjs";
1
+ import { _ as t, c as a, h as r, f as i, b as n, g, e as o, d as c, i as d, a as f, r as h, s as l, t as p } from "./server-entry-13b7e1e6.mjs";
2
2
  export {
3
3
  t as _processContentResult,
4
4
  a as createRegisterComponentMessage,
package/lib/index.cjs ADDED
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
+ const o = require('isolated-vm'),
4
+ s = (e) => {
5
+ const t = new o.Isolate({ memoryLimit: 128 })
6
+ .createContextSync()
7
+ .evalSync(e);
8
+ try {
9
+ return JSON.parse(t);
10
+ } catch {
11
+ return t;
12
+ }
13
+ };
14
+ exports.evaluator = s;
package/lib/index.mjs ADDED
@@ -0,0 +1,10 @@
1
+ import r from 'isolated-vm';
2
+ const c = (e) => {
3
+ const t = new r.Isolate({ memoryLimit: 128 }).createContextSync().evalSync(e);
4
+ try {
5
+ return JSON.parse(t);
6
+ } catch {
7
+ return t;
8
+ }
9
+ };
10
+ export { c as evaluator };
@@ -1,18 +1,58 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),f=require("react"),u=require("./server-entry-f668f903.js");function ie(e){return a.jsxs(a.Fragment,{children:[e.link?a.jsx(a.Fragment,{children:a.jsx("a",{role:"button",...e.attributes,href:e.link,target:e.openLinkInNewTab?"_blank":void 0,children:e.text})}):a.jsx(a.Fragment,{children:a.jsx("button",{...e.attributes,style:e.attributes.style,className:e.attributes.className+" button-3e7bc8b2",children:e.text})}),a.jsx("style",{children:`.button-3e7bc8b2 {
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jsxRuntime=require("react/jsx-runtime"),react=require("react"),serverEntry=require("./server-entry-c98db16c.js");function Button(e){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e.link?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("a",{role:"button",...e.attributes,href:e.link,target:e.openLinkInNewTab?"_blank":void 0,children:e.text})}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("button",{...e.attributes,style:e.attributes.style,className:e.attributes.className+" button-35669e6c",children:e.text})}),jsxRuntime.jsx("style",{children:`.button-35669e6c {
2
2
  all: unset;
3
- }`})]})}const ae={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},G=(e,t=ae)=>`@media (max-width: ${t[e].max}px)`,oe=({small:e,medium:t})=>{const n=u.fastClone(ae);if(!e||!t)return n;const i=Math.floor(e/2);n.small={max:e,min:i,default:i+1};const o=n.small.max+1;n.medium={max:t,min:o,default:o+1};const r=n.medium.max+1;return n.large={max:2e3,min:r,default:r+1},n},ye=({builder:e,context:t,event:n,state:i})=>Object.entries({state:i,Builder:e,builder:e,context:t,event:n}),ve=({code:e,builder:t,context:n,event:i,localState:o,rootSetState:r,rootState:l})=>{const d=ye({builder:t,context:n,event:i,state:ke(l,o,r)});return new Function(...d.map(([c])=>c),e)(...d.map(([,c])=>c))};function ke(e,t,n){if(e===t)throw new Error("rootState === localState");return new Proxy(e,{get:(i,o)=>t&&o in t?t[o]:e[o],set:(i,o,r)=>{if(t&&o in t)throw new Error("Writing to local state is not allowed as it is read-only.");return e[o]=r,n==null||n(e),!0}})}function $({code:e,context:t,localState:n,rootState:i,rootSetState:o,event:r,isExpression:l=!0}){if(e===""){u.logger.warn("Skipping evaluation of empty code block.");return}const d={isEditing:u.isEditing(),isBrowser:u.isBrowser(),isServer:!u.isBrowser(),getUserAttributes:()=>u.getUserAttributes()},m={code:l&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,builder:d,context:t,event:r,rootSetState:o,rootState:i,localState:n};try{return ve(m)}catch(g){u.logger.error("Failed code evaluation: "+g.message,{code:e});return}}const pe=(e,t,n)=>{if(Object(e)!==e)return e;const i=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return i.slice(0,-1).reduce((o,r,l)=>Object(o[r])===o[r]?o[r]:o[r]=Math.abs(Number(i[l+1]))>>0===+i[l+1]?[]:{},e)[i[i.length-1]]=n,e};const Ce=({block:e,context:t,localState:n,rootState:i,rootSetState:o})=>{if(!e.bindings)return e;const r=u.fastClone(e),l={...r,properties:{...r.properties},actions:{...r.actions}};for(const d in e.bindings){const c=e.bindings[d],s=$({code:c,localState:n,rootState:i,rootSetState:o,context:t});pe(l,d,s)}return l};function V({block:e,context:t,shouldEvaluateBindings:n,localState:i,rootState:o,rootSetState:r}){const l=e;return n?Ce({block:l,localState:i,rootState:o,rootSetState:r,context:t}):l}const we=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),re=e=>Object.entries(e).map(([n,i])=>{if(typeof i=="string")return`${we(n)}: ${i};`}).filter(u.checkIsDefined),je=e=>re(e).join(`
4
- `),_=({mediaQuery:e,className:t,styles:n})=>{const i=`.${t} {
5
- ${je(n)}
3
+ }`})]})}const SIZES={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},getMaxWidthQueryForSize=(e,t=SIZES)=>`@media (max-width: ${t[e].max}px)`,getSizesForBreakpoints=({small:e,medium:t})=>{const n=serverEntry.fastClone(SIZES);if(!e||!t)return n;const i=Math.floor(e/2);n.small={max:e,min:i,default:i+1};const r=n.small.max+1;n.medium={max:t,min:r,default:r+1};const o=n.medium.max+1;return n.large={max:2e3,min:o,default:o+1},n},getFunctionArguments=({builder:e,context:t,event:n,state:i})=>Object.entries({state:i,Builder:e,builder:e,context:t,event:n}),getBuilderGlobals=()=>({isEditing:serverEntry.isEditing(),isBrowser:serverEntry.isBrowser(),isServer:!serverEntry.isBrowser(),getUserAttributes:()=>serverEntry.getUserAttributes()}),parseCode=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,runInBrowser=({code:e,builder:t,context:n,event:i,localState:r,rootSetState:o,rootState:a})=>{const l=getFunctionArguments({builder:t,context:n,event:i,state:flattenState(a,r,o)});return new Function(...l.map(([s])=>s),e)(...l.map(([,s])=>s))};function flattenState(e,t,n){if(e===t)throw new Error("rootState === localState");return new Proxy(e,{get:(i,r)=>t&&r in t?t[r]:e[r],set:(i,r,o)=>{if(t&&r in t)throw new Error("Writing to local state is not allowed as it is read-only.");return e[r]=o,n==null||n(e),!0}})}const noop=()=>null;let safeDynamicRequire=noop;try{safeDynamicRequire=eval("require")}catch(e){}const set=(e,t,n)=>{if(Object(e)!==e)return e;const i=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return i.slice(0,-1).reduce((r,o,a)=>Object(r[o])===r[o]?r[o]:r[o]=Math.abs(Number(i[a+1]))>>0===+i[a+1]?[]:{},e)[i[i.length-1]]=n,e},ivm=safeDynamicRequire("isolated-vm"),getSyncValName=e=>`bldr_${e}_sync`,BUILDER_SET_STATE_NAME="BUILDER_SET_STATE",INJECTED_IVM_GLOBAL="BUILDER_IVM",REF_TO_PROXY_FN=`
4
+ var refToProxy = (obj) => {
5
+ if (typeof obj !== 'object' || obj === null) {
6
+ return obj;
7
+ }
8
+ return new Proxy({}, {
9
+ get(target, key) {
10
+ if (key === 'copySync') {
11
+ return () => obj.copySync();
12
+ }
13
+ const val = obj.getSync(key);
14
+ if (typeof val?.getSync === 'function') {
15
+ return refToProxy(val);
16
+ }
17
+ return val;
18
+ },
19
+ set(target, key, value) {
20
+ const v = typeof value === 'object' ? new ${INJECTED_IVM_GLOBAL}.Reference(value) : value;
21
+ obj.setSync(key, v);
22
+ ${BUILDER_SET_STATE_NAME}(key, value)
23
+ },
24
+ deleteProperty(target, key) {
25
+ obj.deleteSync(key);
26
+ }
27
+ })
28
+ }
29
+ `,processCode=({code:e,args:t})=>{const n=t.map(([i])=>`var ${i} = refToProxy(${getSyncValName(i)}); `).join("");return`
30
+ ${REF_TO_PROXY_FN}
31
+ ${n}
32
+ function theFunction() {
33
+ ${e}
34
+ }
35
+
36
+ let output = theFunction()
37
+
38
+ if (typeof output === 'object' && output !== null) {
39
+ output = JSON.stringify(output.copySync ? output.copySync() : output);
40
+ }
41
+
42
+ output;
43
+ `},getIsolateContext=()=>new ivm.Isolate({memoryLimit:128}).createContextSync(),runInNode=({code:e,builder:t,context:n,event:i,localState:r,rootSetState:o,rootState:a})=>{const l=serverEntry.fastClone({...a,...r}),s=getFunctionArguments({builder:t,context:n,event:i,state:l}),c=getIsolateContext(),u=c.global;u.setSync("global",u.derefInto()),u.setSync("log",function(...h){console.log(...h)}),u.setSync(BUILDER_SET_STATE_NAME,function(h,d){set(a,h,d),o==null||o(a)}),s.forEach(([h,d])=>{const b=typeof d=="object"?new ivm.Reference(h==="builder"?{...d,getUserAttributes:()=>d.getUserAttributes()}:d):null;u.setSync(getSyncValName(h),b)}),u.setSync(INJECTED_IVM_GLOBAL,ivm);const f=processCode({code:e,args:s}),x=c.evalSync(f);try{return JSON.parse(x)}catch{return x}},chooseBrowserOrServerEval=e=>serverEntry.isBrowser()?runInBrowser(e):runInNode(e);function evaluate({code:e,context:t,localState:n,rootState:i,rootSetState:r,event:o,isExpression:a=!0}){if(e===""){serverEntry.logger.warn("Skipping evaluation of empty code block.");return}const l={code:parseCode(e,{isExpression:a}),builder:getBuilderGlobals(),context:t,event:o,rootSetState:r,rootState:i,localState:n};try{return chooseBrowserOrServerEval(l)}catch(s){serverEntry.logger.error("Failed code evaluation: "+s.message,{code:e});return}}function transformBlock(e){return e}const evaluateBindings=({block:e,context:t,localState:n,rootState:i,rootSetState:r})=>{if(!e.bindings)return e;const o=serverEntry.fastClone(e),a={...o,properties:{...o.properties},actions:{...o.actions}};for(const l in e.bindings){const s=e.bindings[l],c=evaluate({code:s,localState:n,rootState:i,rootSetState:r,context:t});set(a,l,c)}return a};function getProcessedBlock({block:e,context:t,shouldEvaluateBindings:n,localState:i,rootState:r,rootSetState:o}){const a=e;return n?evaluateBindings({block:a,localState:i,rootState:r,rootSetState:o,context:t}):a}const camelToKebabCase=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),convertStyleMapToCSSArray=e=>Object.entries(e).map(([n,i])=>{if(typeof i=="string")return`${camelToKebabCase(n)}: ${i};`}).filter(serverEntry.checkIsDefined),convertStyleMapToCSS=e=>convertStyleMapToCSSArray(e).join(`
44
+ `),createCssClass=({mediaQuery:e,className:t,styles:n})=>{const i=`.${t} {
45
+ ${convertStyleMapToCSS(n)}
6
46
  }`;return e?`${e} {
7
47
  ${i}
8
- }`:i};function W(e){return a.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},id:e.id})}function z(e){function t(){const i=V({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return u.checkIsDefined(i.hide)?!i.hide:u.checkIsDefined(i.show)?i.show:!0}function n(){var h;const i=V({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),o=i.responsiveStyles,r=e.context.content,l=oe(((h=r==null?void 0:r.meta)==null?void 0:h.breakpoints)||{}),d=o==null?void 0:o.large,c=o==null?void 0:o.medium,s=o==null?void 0:o.small,m=i.id;if(!m)return"";const g=d?_({className:m,styles:d}):"",y=c?_({className:m,styles:c,mediaQuery:G("medium",l)}):"",p=s?_({className:m,styles:s,mediaQuery:G("small",l)}):"";return[g,y,p].join(" ")}return a.jsx(a.Fragment,{children:n()&&t()?a.jsx(a.Fragment,{children:a.jsx(W,{styles:n()})}):null})}function Te(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const Ie=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],U=e=>typeof e=="string"&&Ie.includes(e.toLowerCase()),Re=({block:e,context:t,registeredComponents:n})=>{var r;const i=(r=V({block:e,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,shouldEvaluateBindings:!1}).component)==null?void 0:r.name;if(!i)return null;const o=n[i];if(o)return o;console.warn(`
48
+ }`:i};function InlinedStyles(e){return jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},id:e.id})}function BlockStyles(e){function t(){const i=getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return serverEntry.checkIsDefined(i.hide)?!i.hide:serverEntry.checkIsDefined(i.show)?i.show:!0}function n(){var d;const i=getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),r=i.responsiveStyles,o=e.context.content,a=getSizesForBreakpoints(((d=o==null?void 0:o.meta)==null?void 0:d.breakpoints)||{}),l=r==null?void 0:r.large,s=r==null?void 0:r.medium,c=r==null?void 0:r.small,u=i.id;if(!u)return"";const f=l?createCssClass({className:u,styles:l}):"",x=s?createCssClass({className:u,styles:s,mediaQuery:getMaxWidthQueryForSize("medium",a)}):"",h=c?createCssClass({className:u,styles:c,mediaQuery:getMaxWidthQueryForSize("small",a)}):"";return[f,x,h].join(" ")}return jsxRuntime.jsx(jsxRuntime.Fragment,{children:n()&&t()?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(InlinedStyles,{styles:n()})}):null})}function getBlockComponentOptions(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const EMPTY_HTML_ELEMENTS=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],isEmptyHtmlElement=e=>typeof e=="string"&&EMPTY_HTML_ELEMENTS.includes(e.toLowerCase()),getComponent=({block:e,context:t,registeredComponents:n})=>{var o;const i=(o=getProcessedBlock({block:e,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,shouldEvaluateBindings:!1}).component)==null?void 0:o.name;if(!i)return null;const r=n[i];if(r)return r;console.warn(`
9
49
  Could not find a registered component named "${i}".
10
- If you registered it, is the file that registered it imported by the file that needs to render it?`)},Ee=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const o=$({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context});if(!Array.isArray(o))return;const r=n.collection.split(".").pop(),l=n.itemName||(r?r+"Item":"item");return o.map((c,s)=>({context:{...t,localState:{...t.localState,$index:s,$item:c,[l]:c,[`$${l}Index`]:s}},block:i}))},q=f.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{}});function Fe(e){const[t,n]=f.useState(()=>e.repeatContext);return a.jsx(q.Provider,{value:t,children:a.jsx(M,{block:e.block,context:t,registeredComponents:e.registeredComponents})})}function Pe(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Be=e=>`on${Pe(e)}`,$e=(e,t)=>n=>$({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1});function K(e){const t={},n=e.block.actions??{};for(const i in n){if(!n.hasOwnProperty(i))continue;const o=n[i];let r=Be(i);if(e.stripPrefix)switch(u.TARGET){case"vue2":case"vue3":r=r.replace("v-on:","");break;case"svelte":r=r.replace("on:","");break}t[r]=$e(o,e)}return t}function Ae(e){return e.className=e.class,delete e.class,e}const Ve=e=>({href:e.href});function N({block:e,context:t}){var i;const n={...Ve(e),...e.properties,"builder-id":e.id,style:e.style?Ne(e.style):void 0,class:[e.id,"builder-block",e.class,(i=e.properties)==null?void 0:i.class].filter(Boolean).join(" ")};return Ae(n)}function Ne(e){switch(u.TARGET){case"svelte":case"vue2":case"vue3":case"solid":return re(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}function We(e){return a.jsx(e.Wrapper,{...e.wrapperProps,attributes:{...N({block:e.block,context:e.context}),...K({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})},children:e.children})}const Me=({componentOptions:e,builderBlock:t,context:n,componentRef:i,includeBlockProps:o,isInteractive:r,contextValue:l})=>r?{Wrapper:i,block:t,context:n,wrapperProps:e}:{...e,...o?{attributes:N({block:t,context:l})}:{}};function J(e){var i,o;const[t,n]=f.useState(()=>e.isInteractive?We:e.componentRef);return a.jsx(a.Fragment,{children:e.componentRef?a.jsx(a.Fragment,{children:a.jsxs(t,{...Me({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:[(i=e.blockChildren)==null?void 0:i.map(r=>a.jsx(M,{block:r,context:e.context,registeredComponents:e.registeredComponents},"block-"+r.id)),(o=e.blockChildren)==null?void 0:o.map(r=>a.jsx(z,{block:r,context:e.context},"block-style-"+r.id))]})}):null})}function Y(e){return a.jsxs(a.Fragment,{children:[" ",e.hasChildren?a.jsx(a.Fragment,{children:a.jsxs(e.Wrapper,{...N({block:e.block,context:e.context}),...K({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:[" ",e.children," "]})}):a.jsx(a.Fragment,{children:a.jsx(e.Wrapper,{...N({block:e.block,context:e.context}),...K({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0})})})," "]})}function M(e){var m,g,y,p;function t(){return Re({block:e.block,context:e.context,registeredComponents:e.registeredComponents})}function n(){return Ee({block:e.block,context:e.context})}function i(){return n()?e.block:V({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})}function o(){return e.block.tagName||"div"}function r(){return"hide"in i()?!i().hide:"show"in i()?i().show:!0}function l(){var v;return!((v=t==null?void 0:t())!=null&&v.component)&&!n()?i().children??[]:[]}function d(){var h,v,C,w,b;return{blockChildren:i().children??[],componentRef:(h=t==null?void 0:t())==null?void 0:h.component,componentOptions:{...Te(i()),builderContext:e.context,...((v=t==null?void 0:t())==null?void 0:v.name)==="Symbol"||((C=t==null?void 0:t())==null?void 0:C.name)==="Columns"?{builderComponents:e.registeredComponents}:{}},context:c,registeredComponents:e.registeredComponents,builderBlock:i(),includeBlockProps:((w=t==null?void 0:t())==null?void 0:w.noWrap)===!0,isInteractive:!((b=t==null?void 0:t())!=null&&b.isRSC)}}const[c,s]=f.useState(()=>e.context);return a.jsx(a.Fragment,{children:r()?a.jsx(a.Fragment,{children:(m=t==null?void 0:t())!=null&&m.noWrap?a.jsx(a.Fragment,{children:a.jsx(J,{...d()})}):a.jsxs(a.Fragment,{children:[U(o())?a.jsx(a.Fragment,{children:a.jsx(Y,{Wrapper:o(),block:i(),context:e.context,hasChildren:!1})}):null,!U(o())&&n()?a.jsx(a.Fragment,{children:(g=n())==null?void 0:g.map((h,v)=>a.jsx(Fe,{repeatContext:h.context,block:h.block,registeredComponents:e.registeredComponents},v))}):null,!U(o())&&!n()?a.jsx(a.Fragment,{children:a.jsxs(Y,{Wrapper:o(),block:i(),context:e.context,hasChildren:!0,children:[a.jsx(J,{...d()}),(y=l())==null?void 0:y.map(h=>a.jsx(M,{block:h,context:c,registeredComponents:e.registeredComponents},"block-"+h.id)),(p=l())==null?void 0:p.map(h=>a.jsx(z,{block:h,context:c},"block-style-"+h.id))]})}):null]})}):null})}function Le(e){function t(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function n(){var o,r;u.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((r=window.parent)==null||r.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function i(){var o,r;u.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((r=window.parent)==null||r.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:t()+" div-5821bd52","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>n(),onMouseEnter:o=>i(),onKeyPress:o=>n(),children:e.children}),a.jsx("style",{children:`.div-5821bd52 {
50
+ If you registered it, is the file that registered it imported by the file that needs to render it?`)},getRepeatItemData=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const r=evaluate({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context});if(!Array.isArray(r))return;const o=n.collection.split(".").pop(),a=n.itemName||(o?o+"Item":"item");return r.map((s,c)=>({context:{...t,localState:{...t.localState,$index:c,$item:s,[a]:s,[`$${a}Index`]:c}},block:i}))},builderContext=react.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{}});function RepeatedBlock(e){const[t,n]=react.useState(()=>e.repeatContext);return jsxRuntime.jsx(builderContext.Provider,{value:t,children:jsxRuntime.jsx(Block,{block:e.block,context:t,registeredComponents:e.registeredComponents})})}function capitalizeFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1)}const getEventHandlerName=e=>`on${capitalizeFirstLetter(e)}`,createEventHandler=(e,t)=>n=>evaluate({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1});function getBlockActions(e){const t={},n=e.block.actions??{};for(const i in n){if(!n.hasOwnProperty(i))continue;const r=n[i];let o=getEventHandlerName(i);if(e.stripPrefix)switch(serverEntry.TARGET){case"vue2":case"vue3":o=o.replace("v-on:","");break;case"svelte":o=o.replace("on:","");break}t[o]=createEventHandler(r,e)}return t}function transformBlockProperties(e){return e.className=e.class,delete e.class,e}const extractRelevantRootBlockProperties=e=>({href:e.href});function getBlockProperties({block:e,context:t}){var i;const n={...extractRelevantRootBlockProperties(e),...e.properties,"builder-id":e.id,style:e.style?getStyleAttribute(e.style):void 0,class:[e.id,"builder-block",e.class,(i=e.properties)==null?void 0:i.class].filter(Boolean).join(" ")};return transformBlockProperties(n)}function getStyleAttribute(e){switch(serverEntry.TARGET){case"svelte":case"vue2":case"vue3":case"solid":return convertStyleMapToCSSArray(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}function InteractiveElement(e){return jsxRuntime.jsx(e.Wrapper,{...e.wrapperProps,attributes:{...getBlockProperties({block:e.block,context:e.context}),...getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})},children:e.children})}const getWrapperProps=({componentOptions:e,builderBlock:t,context:n,componentRef:i,includeBlockProps:r,isInteractive:o,contextValue:a})=>o?{Wrapper:i,block:t,context:n,wrapperProps:e}:{...e,...r?{attributes:getBlockProperties({block:t,context:a})}:{}};function ComponentRef(e){var i,r;const[t,n]=react.useState(()=>e.isInteractive?InteractiveElement:e.componentRef);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.componentRef?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(t,{...getWrapperProps({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:[(i=e.blockChildren)==null?void 0:i.map(o=>jsxRuntime.jsx(Block,{block:o,context:e.context,registeredComponents:e.registeredComponents},"block-"+o.id)),(r=e.blockChildren)==null?void 0:r.map(o=>jsxRuntime.jsx(BlockStyles,{block:o,context:e.context},"block-style-"+o.id))]})}):null})}function BlockWrapper(e){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" ",e.hasChildren?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(e.Wrapper,{...getBlockProperties({block:e.block,context:e.context}),...getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:[" ",e.children," "]})}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(e.Wrapper,{...getBlockProperties({block:e.block,context:e.context}),...getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0})})})," "]})}function Block(e){var u,f,x,h;function t(){return getComponent({block:e.block,context:e.context,registeredComponents:e.registeredComponents})}function n(){return getRepeatItemData({block:e.block,context:e.context})}function i(){return n()?e.block:getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})}function r(){return e.block.tagName||"div"}function o(){return"hide"in i()?!i().hide:"show"in i()?i().show:!0}function a(){var b;return!((b=t==null?void 0:t())!=null&&b.component)&&!n()?i().children??[]:[]}function l(){var d,b,p,R,y;return{blockChildren:i().children??[],componentRef:(d=t==null?void 0:t())==null?void 0:d.component,componentOptions:{...getBlockComponentOptions(i()),builderContext:e.context,...((b=t==null?void 0:t())==null?void 0:b.name)==="Symbol"||((p=t==null?void 0:t())==null?void 0:p.name)==="Columns"?{builderComponents:e.registeredComponents}:{}},context:s,registeredComponents:e.registeredComponents,builderBlock:i(),includeBlockProps:((R=t==null?void 0:t())==null?void 0:R.noWrap)===!0,isInteractive:!((y=t==null?void 0:t())!=null&&y.isRSC)}}const[s,c]=react.useState(()=>e.context);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:o()?jsxRuntime.jsx(jsxRuntime.Fragment,{children:(u=t==null?void 0:t())!=null&&u.noWrap?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(ComponentRef,{...l()})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[isEmptyHtmlElement(r())?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(BlockWrapper,{Wrapper:r(),block:i(),context:e.context,hasChildren:!1})}):null,!isEmptyHtmlElement(r())&&n()?jsxRuntime.jsx(jsxRuntime.Fragment,{children:(f=n())==null?void 0:f.map((d,b)=>jsxRuntime.jsx(RepeatedBlock,{repeatContext:d.context,block:d.block,registeredComponents:e.registeredComponents},b))}):null,!isEmptyHtmlElement(r())&&!n()?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(BlockWrapper,{Wrapper:r(),block:i(),context:e.context,hasChildren:!0,children:[jsxRuntime.jsx(ComponentRef,{...l()}),(x=a())==null?void 0:x.map(d=>jsxRuntime.jsx(Block,{block:d,context:s,registeredComponents:e.registeredComponents},"block-"+d.id)),(h=a())==null?void 0:h.map(d=>jsxRuntime.jsx(BlockStyles,{block:d,context:s},"block-style-"+d.id))]})}):null]})}):null})}function BlocksWrapper(e){function t(){var r;return"builder-blocks"+((r=e.blocks)!=null&&r.length?"":" no-blocks")}function n(){var r,o;serverEntry.isEditing()&&!((r=e.blocks)!=null&&r.length)&&((o=window.parent)==null||o.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function i(){var r,o;serverEntry.isEditing()&&!((r=e.blocks)!=null&&r.length)&&((o=window.parent)==null||o.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:t()+" div-02c7a115","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:r=>n(),onMouseEnter:r=>i(),onKeyPress:r=>n(),children:e.children}),jsxRuntime.jsx("style",{children:`.div-02c7a115 {
11
51
  display: flex;
12
52
  flex-direction: column;
13
53
  align-items: stretch;
14
- }`})]})}const le=f.createContext({registeredComponents:{}});function L(e){var i,o;const t=f.useContext(q),n=f.useContext(le);return a.jsxs(Le,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,children:[e.blocks?a.jsx(a.Fragment,{children:(i=e.blocks)==null?void 0:i.map(r=>a.jsx(M,{block:r,context:e.context||t,registeredComponents:e.registeredComponents||n.registeredComponents},"render-block-"+r.id))}):null,e.blocks?a.jsx(a.Fragment,{children:(o=e.blocks)==null?void 0:o.map(r=>a.jsx(z,{block:r,context:e.context||t},"block-style-"+r.id))}):null]})}function ce(e){var w;const[t,n]=f.useState(()=>typeof e.space=="number"?e.space||0:20),[i,o]=f.useState(()=>e.columns||[]),[r,l]=f.useState(()=>e.stackColumnsAt||"tablet");function d(b){var I;return((I=i[b])==null?void 0:I.width)||100/i.length}function c(b){const I=t*(i.length-1)/i.length;return`calc(${d(b)}% - ${I}px)`}function s({stackedStyle:b,desktopStyle:I}){return r==="tablet"?b:I}function m({stackedStyle:b,desktopStyle:I}){return r==="never"?I:b}const[g,y]=f.useState(()=>e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column");function p(){return{"--flex-dir":g,"--flex-dir-tablet":s({stackedStyle:g,desktopStyle:"row"})}}function h(b){const I=b===0?0:t,E=c(b),F=`${I}px`,P="100%",x=0;return{width:E,["marginLeft"]:F,"--column-width-mobile":m({stackedStyle:P,desktopStyle:E}),"--column-margin-left-mobile":m({stackedStyle:x,desktopStyle:F}),"--column-width-tablet":s({stackedStyle:P,desktopStyle:E}),"--column-margin-left-tablet":s({stackedStyle:x,desktopStyle:F})}}function v(b){var E,F;return oe(((F=(E=e.builderContext.content)==null?void 0:E.meta)==null?void 0:F.breakpoints)||{})[b].max}function C(){return`
15
- @media (max-width: ${v("medium")}px) {
54
+ }`})]})}const ComponentsContext=react.createContext({registeredComponents:{}});function Blocks(e){var i,r;const t=react.useContext(builderContext),n=react.useContext(ComponentsContext);return jsxRuntime.jsxs(BlocksWrapper,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,children:[e.blocks?jsxRuntime.jsx(jsxRuntime.Fragment,{children:(i=e.blocks)==null?void 0:i.map(o=>jsxRuntime.jsx(Block,{block:o,context:e.context||t,registeredComponents:e.registeredComponents||n.registeredComponents},"render-block-"+o.id))}):null,e.blocks?jsxRuntime.jsx(jsxRuntime.Fragment,{children:(r=e.blocks)==null?void 0:r.map(o=>jsxRuntime.jsx(BlockStyles,{block:o,context:e.context||t},"block-style-"+o.id))}):null]})}function Columns(e){var R;const[t,n]=react.useState(()=>typeof e.space=="number"?e.space||0:20),[i,r]=react.useState(()=>e.columns||[]),[o,a]=react.useState(()=>e.stackColumnsAt||"tablet");function l(y){var j;return((j=i[y])==null?void 0:j.width)||100/i.length}function s(y){const j=t*(i.length-1)/i.length;return`calc(${l(y)}% - ${j}px)`}function c({stackedStyle:y,desktopStyle:j}){return o==="tablet"?y:j}function u({stackedStyle:y,desktopStyle:j}){return o==="never"?j:y}const[f,x]=react.useState(()=>e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column");function h(){return{"--flex-dir":f,"--flex-dir-tablet":c({stackedStyle:f,desktopStyle:"row"})}}function d(y){const j=y===0?0:t,E=s(y),w=`${j}px`,I="100%",T=0;return{width:E,["marginLeft"]:w,"--column-width-mobile":u({stackedStyle:I,desktopStyle:E}),"--column-margin-left-mobile":u({stackedStyle:T,desktopStyle:w}),"--column-width-tablet":c({stackedStyle:I,desktopStyle:E}),"--column-margin-left-tablet":c({stackedStyle:T,desktopStyle:w})}}function b(y){var E,w;return getSizesForBreakpoints(((w=(E=e.builderContext.content)==null?void 0:E.meta)==null?void 0:w.breakpoints)||{})[y].max}function p(){return`
55
+ @media (max-width: ${b("medium")}px) {
16
56
  .${e.builderBlock.id}-breakpoints {
17
57
  flex-direction: var(--flex-dir-tablet);
18
58
  align-items: stretch;
@@ -24,7 +64,7 @@
24
64
  }
25
65
  }
26
66
 
27
- @media (max-width: ${v("small")}px) {
67
+ @media (max-width: ${b("small")}px) {
28
68
  .${e.builderBlock.id}-breakpoints {
29
69
  flex-direction: var(--flex-dir);
30
70
  align-items: stretch;
@@ -35,21 +75,21 @@
35
75
  margin-left: var(--column-margin-left-mobile) !important;
36
76
  }
37
77
  },
38
- `}return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`builder-columns ${e.builderBlock.id}-breakpoints div-d734ad62`,style:p(),children:[a.jsx(a.Fragment,{children:a.jsx(W,{styles:C()})}),(w=e.columns)==null?void 0:w.map((b,I)=>f.createElement("div",{className:"builder-column div-d734ad62-2",style:h(I),key:I},a.jsx(L,{path:`component.options.columns.${I}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,blocks:b.blocks})))]}),a.jsx("style",{children:`.div-d734ad62 {
78
+ `}return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:`builder-columns ${e.builderBlock.id}-breakpoints div-ac8f4142`,style:h(),children:[jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(InlinedStyles,{styles:p()})}),(R=e.columns)==null?void 0:R.map((y,j)=>react.createElement("div",{className:"builder-column div-ac8f4142-2",style:d(j),key:j},jsxRuntime.jsx(Blocks,{path:`component.options.columns.${j}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,blocks:y.blocks})))]}),jsxRuntime.jsx("style",{children:`.div-ac8f4142 {
39
79
  display: flex;
40
80
  line-height: normal;
41
- }.div-d734ad62-2 {
81
+ }.div-ac8f4142-2 {
42
82
  display: flex;
43
83
  flex-direction: column;
44
84
  align-items: stretch;
45
- }`})]})}function se(e){return a.jsx("span",{children:e.children})}function Q(e){return e.replace(/http(s)?:/,"")}function _e(e="",t,n){const i=new RegExp("([?&])"+t+"=.*?(&|$)","i"),o=e.indexOf("?")!==-1?"&":"?";return e.match(i)?e.replace(i,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+o+t+"="+encodeURIComponent(n)}function Ue(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return Q(e);const n=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(n){const i=e.split(n[0]),o=n[3],r=t.match("x")?t:`${t}x`;return Q(`${i[0]}_${r}${o}`)}return null}function O(e){if(!e)return e;const t=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let n=e;const i=Number(e.split("?width=")[1]);return isNaN(i)||(n=`${n} ${i}w`),t.filter(o=>o!==i).map(o=>`${_e(e,"width",o)} ${o}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[Ue(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,i])=>`${n} ${i}w`).concat([e]).join(", "):e}function de(e){var o,r,l,d;function t(){var m;const s=e.image||e.src;if(!s||!(s.match(/builder\.io/)||s.match(/cdn\.shopify\.com/)))return e.srcset;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"),O(s)}else if(e.image&&!e.srcset)return O(s);return O(s)}function n(){var c;return(c=t==null?void 0:t())!=null&&c.match(/builder\.io/)&&!e.noWebp?t().replace(/\?/g,"?format=webp&"):""}function i(){const c={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?c:void 0}return a.jsxs(a.Fragment,{children:[a.jsxs(a.Fragment,{children:[a.jsxs("picture",{children:[n()?a.jsx(a.Fragment,{children:a.jsx("source",{type:"image/webp",srcSet:n()})}):null,a.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?"presentation":void 0,style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...i()},className:"builder-image"+(e.className?" "+e.className:"")+" img-ef11a6be",src:e.image,srcSet:t(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(o=e.builderBlock)==null?void 0:o.children)!=null&&r.length&&e.fitContent)?a.jsx(a.Fragment,{children:a.jsx("div",{className:"builder-image-sizer div-ef11a6be",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(d=(l=e.builderBlock)==null?void 0:l.children)!=null&&d.length&&e.fitContent?a.jsx(a.Fragment,{children:e.children}):null,!e.fitContent&&e.children?a.jsx(a.Fragment,{children:a.jsx("div",{className:"div-ef11a6be-2",children:e.children})}):null]}),a.jsx("style",{children:`.img-ef11a6be {
85
+ }`})]})}function FragmentComponent(e){return jsxRuntime.jsx("span",{children:e.children})}function removeProtocol(e){return e.replace(/http(s)?:/,"")}function updateQueryParam(e="",t,n){const i=new RegExp("([?&])"+t+"=.*?(&|$)","i"),r=e.indexOf("?")!==-1?"&":"?";return e.match(i)?e.replace(i,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+r+t+"="+encodeURIComponent(n)}function getShopifyImageUrl(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return removeProtocol(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]),r=n[3],o=t.match("x")?t:`${t}x`;return removeProtocol(`${i[0]}_${o}${r}`)}return null}function getSrcSet(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(r=>r!==i).map(r=>`${updateQueryParam(e,"width",r)} ${r}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[getShopifyImageUrl(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,i])=>`${n} ${i}w`).concat([e]).join(", "):e}function Image(e){var r,o,a,l;function t(){var u;const c=e.image||e.src;if(!c||!(c.match(/builder\.io/)||c.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((u=e.image)!=null&&u.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),getSrcSet(c)}else if(e.image&&!e.srcset)return getSrcSet(c);return getSrcSet(c)}function n(){var s;return(s=t==null?void 0:t())!=null&&s.match(/builder\.io/)&&!e.noWebp?t().replace(/\?/g,"?format=webp&"):""}function i(){const s={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?s:void 0}return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("picture",{children:[n()?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("source",{type:"image/webp",srcSet:n()})}):null,jsxRuntime.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?"presentation":void 0,style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...i()},className:"builder-image"+(e.className?" "+e.className:"")+" img-497e0136",src:e.image,srcSet:t(),sizes:e.sizes})]}),e.aspectRatio&&!((o=(r=e.builderBlock)==null?void 0:r.children)!=null&&o.length&&e.fitContent)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("div",{className:"builder-image-sizer div-497e0136",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(l=(a=e.builderBlock)==null?void 0:a.children)!=null&&l.length&&e.fitContent?jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.children}):null,!e.fitContent&&e.children?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("div",{className:"div-497e0136-2",children:e.children})}):null]}),jsxRuntime.jsx("style",{children:`.img-497e0136 {
46
86
  opacity: 1;
47
87
  transition: opacity 0.2s ease-in-out;
48
- }.div-ef11a6be {
88
+ }.div-497e0136 {
49
89
  width: 100%;
50
90
  pointer-events: none;
51
91
  font-size: 0;
52
- }.div-ef11a6be-2 {
92
+ }.div-497e0136-2 {
53
93
  display: flex;
54
94
  flex-direction: column;
55
95
  align-items: stretch;
@@ -58,29 +98,29 @@
58
98
  left: 0;
59
99
  width: 100%;
60
100
  height: 100%;
61
- }`})]})}function ue(e){return a.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}const A=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),Oe=({canTrack:e,content:t})=>!(!(A(t).length>0)||!e||u.isBrowser());function Ke(e,t,n){var l;function i(){function d(h,v,C){let w="";if(C){const b=new Date;b.setTime(b.getTime()+C*24*60*60*1e3),w="; expires="+b.toUTCString()}document.cookie=h+"="+(v||"")+w+"; path=/; Secure; SameSite=None"}function c(h){const v=h+"=",C=document.cookie.split(";");for(let w=0;w<C.length;w++){let b=C[w];for(;b.charAt(0)===" ";)b=b.substring(1,b.length);if(b.indexOf(v)===0)return b.substring(v.length,b.length)}return null}const s=`builder.tests.${e}`,m=c(s),g=t.map(h=>h.id).concat(e);if(m&&g.includes(m))return m;let y=0;const p=Math.random();for(let h=0;h<t.length;h++){const v=t[h],C=v.testRatio;if(y+=C,p<y)return d(s,v.id),v.id}return d(s,e),e}const o=i(),r=(l=document.currentScript)==null?void 0:l.previousElementSibling;if(n){r.remove();const d=document.currentScript;d==null||d.remove()}else{const d=t.concat({id:e}).filter(c=>c.id!==o).map(c=>`.variant-${c.id} { display: none; }
62
- `).join("");r.innerHTML=d}}function He(e,t,n){var c;if(!navigator.cookieEnabled)return;function i(s){const m=s+"=",g=document.cookie.split(";");for(let y=0;y<g.length;y++){let p=g[y];for(;p.charAt(0)===" ";)p=p.substring(1,p.length);if(p.indexOf(m)===0)return p.substring(m.length,p.length)}return null}const o=`builder.tests.${t}`,r=i(o),l=(c=document.currentScript)==null?void 0:c.parentElement,d=e===t;if(r===e){if(d)return;l==null||l.removeAttribute("hidden"),l==null||l.removeAttribute("aria-hidden")}else{d&&(n?l==null||l.remove():(l==null||l.setAttribute("hidden","true"),l==null||l.setAttribute("aria-hidden","true")));return}}const ze=e=>e==="react"||e==="reactNative",me=ze(u.TARGET),fe="builderIoAbTest",ge="builderIoRenderContent",qe=()=>{const e=Ke.toString().replace(/\s+/g," "),t=He.toString().replace(/\s+/g," ");return`
63
- window.${fe} = ${e}
64
- window.${ge} = ${t}
65
- `},De=(e,t)=>`
66
- window.${fe}("${t}",${JSON.stringify(e)}, ${me})`,Ge=({contentId:e,variationId:t})=>`
67
- window.${ge}("${t}", "${e}", ${me})`,Je={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},Ye={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){n.forEach(i=>{i.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(o=>o.get("width"))&&(n.find(r=>!r.get("width"))||n.reduce((d,c)=>d+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}]},Qe={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},Xe={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(l,d=6e4){return new Promise((c,s)=>{const m=document.createElement("img");let g=!1;m.onload=()=>{g=!0,c(m)},m.addEventListener("error",y=>{console.warn("Image load failed",y.error),s(y.error)}),m.src=l,setTimeout(()=>{g||s(new Error("Image load timed out"))},d)})}function i(l){return Math.round(l*1e3)/1e3}const o=e.get("image"),r=e.get("aspectRatio");if(fetch(o).then(l=>l.blob()).then(l=>{l.type.includes("svg")&&e.set("noWebp",!0)}),o&&(!r||r===.7041))return n(o).then(l=>{const d=e.get("aspectRatio");e.get("image")===o&&(!d||d===.7041)&&l.width&&l.height&&(e.set("aspectRatio",i(l.height/l.width)),e.set("height",l.height),e.set("width",l.width))})}},{name:"backgroundSize",type:"text",defaultValue:"cover",enum:[{label:"contain",value:"contain",helperText:"The image should never get cropped"},{label:"cover",value:"cover",helperText:"The image should fill it's box, cropping when needed"}]},{name:"backgroundPosition",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"altText",type:"string",helperText:"Text to display when the user has images off"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"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}]},Ze={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>"}}}]},et={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"}]},tt={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 a.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const nt={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}]};function be(e){var i;function t(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function n(){return{...e.attributes,...t()}}return a.jsx("video",{...n(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(i=e.attributes)==null?void 0:i.style,objectFit:e.fit,objectPosition:e.position,borderRadius:1},src:e.video||"no-src",poster:e.posterImage})}const it={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc",onChange:e=>{const t=e.get("url");if(t)return e.set("content","Loading..."),fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then(i=>i.json()).then(i=>{e.get("url")===t&&(i.html?e.set("content",i.html):e.set("content","Invalid url, please try another"))}).catch(i=>{e.set("content","There was an error embedding this URL, please try again or another URL")});e.delete("content")}},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},at=["text/javascript","application/javascript","application/ecmascript"],ot=e=>at.includes(e.type);function rt(e){const t=f.useRef(null),[n,i]=f.useState(()=>[]),[o,r]=f.useState(()=>[]),[l,d]=f.useState(()=>!1);function c(){if(!t.current||!t.current.getElementsByTagName)return;const s=t.current.getElementsByTagName("script");for(let m=0;m<s.length;m++){const g=s[m];if(g.src&&!n.includes(g.src)){n.push(g.src);const y=document.createElement("script");y.async=!0,y.src=g.src,document.head.appendChild(y)}else if(ot(g)&&!o.includes(g.innerText))try{o.push(g.innerText),new Function(g.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return f.useEffect(()=>{t.current&&!l&&(d(!0),c())},[t.current,l]),a.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}function lt(e){return a.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},u.isEditing()&&e.imgSrc||"default-key")}const ct={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:["jpeg","jpg","png","svg","gif","webp"],required:!0}],noWrap:!0,static:!0};function st(e){const t=f.useRef(null),[n,i]=f.useState(()=>[]),[o,r]=f.useState(()=>[]);function l(){if(t.current&&t.current.getElementsByTagName&&typeof window<"u"){const d=t.current.getElementsByTagName("script");for(let c=0;c<d.length;c++){const s=d[c];if(s.src){if(n.includes(s.src))continue;n.push(s.src);const m=document.createElement("script");m.async=!0,m.src=s.src,document.head.appendChild(m)}else if(!s.type||["text/javascript","application/javascript","application/ecmascript"].includes(s.type)){if(o.includes(s.innerText))continue;try{o.push(s.innerText),new Function(s.innerText)()}catch(m){console.warn("`CustomCode`: Error running script:",m)}}}}}return f.useEffect(()=>{l()},[]),a.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const dt={name:"Custom Code",static:!0,requiredPermissions:["editCode"],inputs:[{name:"code",type:"html",required:!0,defaultValue:"<p>Hello there, I am custom HTML code!</p>",code:!0},{name:"replaceNodes",type:"boolean",helperText:"Preserve server rendered dom nodes",advanced:!0},{name:"scriptsClientOnly",type:"boolean",defaultValue:!1,helperText:"Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",advanced:!0}]},X=()=>[{component:ie,...Je},{component:ce,...Ye},{component:st,...dt},{component:rt,...it},{component:se,...Qe},{component:de,...Xe},{component:lt,...ct},{component:ue,...Ze},{component:xe,...et},{component:he,...tt},{component:be,...nt}],ut=e=>{var r;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],i=e.fileUrl??((r=e==null?void 0:e.files)==null?void 0:r.regular);let o="";if(i&&t&&n&&(o+=`
101
+ }`})]})}function SectionComponent(e){return jsxRuntime.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}const getVariants=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),checkShouldRunVariants=({canTrack:e,content:t})=>!(!(getVariants(t).length>0)||!e||serverEntry.isBrowser());function bldrAbTest(e,t,n){var a;function i(){function l(d,b,p){let R="";if(p){const y=new Date;y.setTime(y.getTime()+p*24*60*60*1e3),R="; expires="+y.toUTCString()}document.cookie=d+"="+(b||"")+R+"; path=/; Secure; SameSite=None"}function s(d){const b=d+"=",p=document.cookie.split(";");for(let R=0;R<p.length;R++){let y=p[R];for(;y.charAt(0)===" ";)y=y.substring(1,y.length);if(y.indexOf(b)===0)return y.substring(b.length,y.length)}return null}const c=`builder.tests.${e}`,u=s(c),f=t.map(d=>d.id).concat(e);if(u&&f.includes(u))return u;let x=0;const h=Math.random();for(let d=0;d<t.length;d++){const b=t[d],p=b.testRatio;if(x+=p,h<x)return l(c,b.id),b.id}return l(c,e),e}const r=i(),o=(a=document.currentScript)==null?void 0:a.previousElementSibling;if(n){o.remove();const l=document.currentScript;l==null||l.remove()}else{const l=t.concat({id:e}).filter(s=>s.id!==r).map(s=>`.variant-${s.id} { display: none; }
102
+ `).join("");o.innerHTML=l}}function bldrCntntScrpt(e,t,n){var s;if(!navigator.cookieEnabled)return;function i(c){const u=c+"=",f=document.cookie.split(";");for(let x=0;x<f.length;x++){let h=f[x];for(;h.charAt(0)===" ";)h=h.substring(1,h.length);if(h.indexOf(u)===0)return h.substring(u.length,h.length)}return null}const r=`builder.tests.${t}`,o=i(r),a=(s=document.currentScript)==null?void 0:s.parentElement,l=e===t;if(o===e){if(l)return;a==null||a.removeAttribute("hidden"),a==null||a.removeAttribute("aria-hidden")}else{l&&(n?a==null||a.remove():(a==null||a.setAttribute("hidden","true"),a==null||a.setAttribute("aria-hidden","true")));return}}const getIsHydrationTarget=e=>e==="react"||e==="reactNative",isHydrationTarget=getIsHydrationTarget(serverEntry.TARGET),AB_TEST_FN_NAME="builderIoAbTest",CONTENT_FN_NAME="builderIoRenderContent",getScriptString=()=>{const e=bldrAbTest.toString().replace(/\s+/g," "),t=bldrCntntScrpt.toString().replace(/\s+/g," ");return`
103
+ window.${AB_TEST_FN_NAME} = ${e}
104
+ window.${CONTENT_FN_NAME} = ${t}
105
+ `},getVariantsScriptString=(e,t)=>`
106
+ window.${AB_TEST_FN_NAME}("${t}",${JSON.stringify(e)}, ${isHydrationTarget})`,getRenderContentScriptString=({contentId:e,variationId:t})=>`
107
+ window.${CONTENT_FN_NAME}("${t}", "${e}", ${isHydrationTarget})`,componentInfo$a={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},componentInfo$9={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(r=>r.get("width"))&&(n.find(o=>!o.get("width"))||n.reduce((l,s)=>l+s.get("width"),0)!==100)&&t()}},{name:"space",type:"number",defaultValue:20,helperText:"Size of gap between columns",advanced:!0},{name:"stackColumnsAt",type:"string",defaultValue:"tablet",helperText:"Convert horizontal columns to vertical at what device size",enum:["tablet","mobile","never"],advanced:!0},{name:"reverseColumnsWhenStacked",type:"boolean",defaultValue:!1,helperText:"When stacking columns for mobile devices, reverse the ordering",advanced:!0}]},componentInfo$8={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},componentInfo$7={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(a,l=6e4){return new Promise((s,c)=>{const u=document.createElement("img");let f=!1;u.onload=()=>{f=!0,s(u)},u.addEventListener("error",x=>{console.warn("Image load failed",x.error),c(x.error)}),u.src=a,setTimeout(()=>{f||c(new Error("Image load timed out"))},l)})}function i(a){return Math.round(a*1e3)/1e3}const r=e.get("image"),o=e.get("aspectRatio");if(fetch(r).then(a=>a.blob()).then(a=>{a.type.includes("svg")&&e.set("noWebp",!0)}),r&&(!o||o===.7041))return n(r).then(a=>{const l=e.get("aspectRatio");e.get("image")===r&&(!l||l===.7041)&&a.width&&a.height&&(e.set("aspectRatio",i(a.height/a.width)),e.set("height",a.height),e.set("width",a.width))})}},{name:"backgroundSize",type:"text",defaultValue:"cover",enum:[{label:"contain",value:"contain",helperText:"The image should never get cropped"},{label:"cover",value:"cover",helperText:"The image should fill it's box, cropping when needed"}]},{name:"backgroundPosition",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"altText",type:"string",helperText:"Text to display when the user has images off"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"aspectRatio",type:"number",helperText:"This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",advanced:!0,defaultValue:.7041}]},componentInfo$6={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>"}}}]},componentInfo$5={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"}]},componentInfo$4={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 Text(e){var t;return jsxRuntime.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const componentInfo$3={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}]};function Video(e){var i;function t(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function n(){return{...e.attributes,...t()}}return jsxRuntime.jsx("video",{...n(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(i=e.attributes)==null?void 0:i.style,objectFit:e.fit,objectPosition:e.position,borderRadius:1},src:e.video||"no-src",poster:e.posterImage})}const componentInfo$2={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc",onChange:e=>{const t=e.get("url");if(t)return e.set("content","Loading..."),fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then(i=>i.json()).then(i=>{e.get("url")===t&&(i.html?e.set("content",i.html):e.set("content","Invalid url, please try another"))}).catch(i=>{e.set("content","There was an error embedding this URL, please try again or another URL")});e.delete("content")}},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},SCRIPT_MIME_TYPES=["text/javascript","application/javascript","application/ecmascript"],isJsScript=e=>SCRIPT_MIME_TYPES.includes(e.type);function Embed(e){const t=react.useRef(null),[n,i]=react.useState(()=>[]),[r,o]=react.useState(()=>[]),[a,l]=react.useState(()=>!1);function s(){if(!t.current||!t.current.getElementsByTagName)return;const c=t.current.getElementsByTagName("script");for(let u=0;u<c.length;u++){const f=c[u];if(f.src&&!n.includes(f.src)){n.push(f.src);const x=document.createElement("script");x.async=!0,x.src=f.src,document.head.appendChild(x)}else if(isJsScript(f)&&!r.includes(f.innerText))try{r.push(f.innerText),new Function(f.innerText)()}catch(x){console.warn("`Embed`: Error running script:",x)}}}return react.useEffect(()=>{t.current&&!a&&(l(!0),s())},[t.current,a]),jsxRuntime.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}function ImgComponent(e){return jsxRuntime.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},serverEntry.isEditing()&&e.imgSrc||"default-key")}const componentInfo$1={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:["jpeg","jpg","png","svg","gif","webp"],required:!0}],noWrap:!0,static:!0};function CustomCode(e){const t=react.useRef(null),[n,i]=react.useState(()=>[]),[r,o]=react.useState(()=>[]);return react.useEffect(()=>{var l;if(!((l=t.current)!=null&&l.getElementsByTagName)||typeof window>"u")return;const a=t.current.getElementsByTagName("script");for(let s=0;s<a.length;s++){const c=a[s];if(c.src){if(n.includes(c.src))continue;n.push(c.src);const u=document.createElement("script");u.async=!0,u.src=c.src,document.head.appendChild(u)}else if(!c.type||["text/javascript","application/javascript","application/ecmascript"].includes(c.type)){if(r.includes(c.innerText))continue;try{r.push(c.innerText),new Function(c.innerText)()}catch(u){console.warn("`CustomCode`: Error running script:",u)}}}},[]),jsxRuntime.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const componentInfo={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}]},getDefaultRegisteredComponents=()=>[{component:Button,...componentInfo$a},{component:Columns,...componentInfo$9},{component:CustomCode,...componentInfo},{component:Embed,...componentInfo$2},{component:FragmentComponent,...componentInfo$8},{component:Image,...componentInfo$7},{component:ImgComponent,...componentInfo$1},{component:SectionComponent,...componentInfo$6},{component:Symbol$1,...componentInfo$5},{component:Text,...componentInfo$4},{component:Video,...componentInfo$3}],getCssFromFont=e=>{var o;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],i=e.fileUrl??((o=e==null?void 0:e.files)==null?void 0:o.regular);let r="";if(i&&t&&n&&(r+=`
68
108
  @font-face {
69
109
  font-family: "${t}";
70
110
  src: local("${n}"), url('${i}') format('woff2');
71
111
  font-display: fallback;
72
112
  font-weight: 400;
73
113
  }
74
- `.trim()),e.files)for(const l in e.files){if(!(String(Number(l))===l))continue;const c=e.files[l];c&&c!==i&&(o+=`
114
+ `.trim()),e.files)for(const a in e.files){if(!(String(Number(a))===a))continue;const s=e.files[a];s&&s!==i&&(r+=`
75
115
  @font-face {
76
116
  font-family: "${t}";
77
- src: url('${c}') format('woff2');
117
+ src: url('${s}') format('woff2');
78
118
  font-display: fallback;
79
- font-weight: ${l};
119
+ font-weight: ${a};
80
120
  }
81
- `.trim())}return o},mt=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(n=>ut(n)))==null?void 0:t.join(" "))||""},ft=({cssCode:e,contentId:t})=>e?t?(e==null?void 0:e.replace(/&/g,`div[builder-content-id="${t}"]`))||"":e:"";function gt(e){const[t,n]=f.useState(()=>`
82
- ${ft({cssCode:e.cssCode,contentId:e.contentId})}
83
- ${mt({customFonts:e.customFonts})}
121
+ `.trim())}return r},getFontCss=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(n=>getCssFromFont(n)))==null?void 0:t.join(" "))||""},getCss=({cssCode:e,contentId:t})=>e?t?(e==null?void 0:e.replace(/&/g,`div[builder-content-id="${t}"]`))||"":e:"";function ContentStyles(e){const[t,n]=react.useState(()=>`
122
+ ${getCss({cssCode:e.cssCode,contentId:e.contentId})}
123
+ ${getFontCss({customFonts:e.customFonts})}
84
124
 
85
125
  .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
86
126
  margin: 0;
@@ -94,4 +134,4 @@ ${mt({customFonts:e.customFonts})}
94
134
  text-align: inherit;
95
135
  font-family: inherit;
96
136
  }
97
- `.trim());return a.jsx(W,{styles:t})}const ht=({content:e,data:t,locale:n})=>{var r,l,d;const i={};(l=(r=e==null?void 0:e.data)==null?void 0:r.inputs)==null||l.forEach(c=>{var s;c.name&&c.defaultValue!==void 0&&((s=e==null?void 0:e.data)!=null&&s.state)&&e.data.state[c.name]===void 0&&(i[c.name]=c.defaultValue)});const o={...(d=e==null?void 0:e.data)==null?void 0:d.state,...t,...n?{locale:n}:{}};return{...i,...o}},bt=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0,xt="0.7.0",St=()=>{u.register("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let Z=!1;const yt=(e={})=>{var t,n;Z||(Z=!0,u.isBrowser()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:u.TARGET,version:xt,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",({data:i})=>{var o,r;if(i!=null&&i.type)switch(i.type){case"builder.evaluate":{const l=i.data.text,d=i.data.arguments||[],c=i.data.id,s=new Function(l);let m,g=null;try{m=s.apply(null,d)}catch(y){g=y}g?(o=window.parent)==null||o.postMessage({type:"builder.evaluateError",data:{id:c,error:g.message}},"*"):m&&typeof m.then=="function"?m.then(y=>{var p;(p=window.parent)==null||p.postMessage({type:"builder.evaluateResult",data:{id:c,result:y}},"*")}).catch(console.error):(r=window.parent)==null||r.postMessage({type:"builder.evaluateResult",data:{result:m,id:c}},"*");break}}})))};function ee(e){return Math.round(e*1e3)/1e3}const vt=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let i=n?e:e.parentElement;do{if(!i)return null;if(t(i))return i}while(i=i.parentElement);return null},kt=e=>vt(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),te=({event:e,target:t})=>{const n=t.getBoundingClientRect(),i=e.clientX-n.left,o=e.clientY-n.top,r=ee(i/n.width),l=ee(o/n.height);return{x:r,y:l}},pt=e=>{const t=e.target,n=t&&kt(t),i=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:i||void 0,metadata:{targetOffset:t?te({event:e,target:t}):void 0,builderTargetOffset:n?te({event:e,target:n}):void 0,builderElementIndex:n&&i?[].slice.call(document.getElementsByClassName(i)).indexOf(n):void 0}}};function Ct(e){var b,I,E,F,P;const t=f.useRef(null),[n,i]=f.useState(()=>0);function o(x){var S,k,T,R,B;const j={...e.builderContextSignal.content,...x,data:{...(S=e.builderContextSignal.content)==null?void 0:S.data,...x==null?void 0:x.data},meta:{...(k=e.builderContextSignal.content)==null?void 0:k.meta,...x==null?void 0:x.meta,breakpoints:((T=x==null?void 0:x.meta)==null?void 0:T.breakpoints)||((B=(R=e.builderContextSignal.content)==null?void 0:R.meta)==null?void 0:B.breakpoints)}};e.setBuilderContextSignal(Se=>({...Se,content:j}))}f.useState(()=>0);const[r,l]=f.useState(()=>!1);function d(x){var S;const{data:j}=x;if(j)switch(j.type){case"builder.configureSdk":{const k=j.data,{breakpoints:T,contentId:R}=k;if(!R||R!==((S=e.builderContextSignal.content)==null?void 0:S.id))return;T&&o({meta:{breakpoints:T}}),i(n+1);break}case"builder.contentUpdate":{const k=j.data,T=k.key||k.alias||k.entry||k.modelName,R=k.data;T===e.model&&(o(R),i(n+1));break}}}function c(){var j,S;const x=(S=(j=e.builderContextSignal.content)==null?void 0:j.data)==null?void 0:S.jsCode;x&&$({code:x,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[s,m]=f.useState(()=>({})),[g,y]=f.useState(()=>!1);function p(x){var j,S;if(e.builderContextSignal.content){const k=(j=e.builderContextSignal.content)==null?void 0:j.testVariationId,T=(S=e.builderContextSignal.content)==null?void 0:S.id;u._track({type:"click",canTrack:u.getDefaultCanTrack(e.canTrack),contentId:T,apiKey:e.apiKey,variationId:k!==T?k:void 0,...pt(x),unique:!g})}g||y(!0)}function h(x){return x.replace(/{{([^}]+)}}/g,(j,S)=>$({code:S,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function v({url:x,key:j}){u.fetch(x).then(S=>S.json()).then(S=>{var T,R;const k={...e.builderContextSignal.rootState,[j]:S};(R=(T=e.builderContextSignal).rootSetState)==null||R.call(T,k),s[j]=!0}).catch(S=>{console.error("error fetching dynamic data",x,S)})}function C(){var j,S;const x=((S=(j=e.builderContextSignal.content)==null?void 0:j.data)==null?void 0:S.httpRequests)??{};Object.entries(x).forEach(([k,T])=>{if(T&&(!s[k]||u.isEditing())){const R=h(T);v({url:R,key:k})}})}function w(){u.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:u.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}return f.useEffect(()=>{var x,j;if(e.apiKey||u.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),u.isBrowser()){if(u.isEditing()&&(i(n+1),window.addEventListener("message",d),St(),yt({...e.locale?{locale:e.locale}:{},...e.includeRefs?{includeRefs:e.includeRefs}:{},...e.enrich?{enrich:e.enrich}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(S=>{var T;const k=u.createRegisterComponentMessage(S);(T=window.parent)==null||T.postMessage(k,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",w)),e.builderContextSignal.content){const S=(x=e.builderContextSignal.content)==null?void 0:x.testVariationId,k=(j=e.builderContextSignal.content)==null?void 0:j.id;u._track({type:"impression",canTrack:u.getDefaultCanTrack(e.canTrack),contentId:k,apiKey:e.apiKey,variationId:S!==k?S:void 0})}if(u.isPreviewing()){const S=new URL(location.href).searchParams,k=S.get("builder.preview"),T=S.get(`builder.preview.${k}`),R=S.get("apiKey")||S.get("builder.space");k===e.model&&R===e.apiKey&&(!e.content||T===e.content.id)&&u.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(B=>{B&&o(B)})}c(),C(),w()}},[]),f.useEffect(()=>{e.content&&o(e.content)},[e.content]),f.useEffect(()=>{},[r]),f.useEffect(()=>{c()},[(I=(b=e.builderContextSignal.content)==null?void 0:b.data)==null?void 0:I.jsCode,e.builderContextSignal.rootState]),f.useEffect(()=>{C()},[(F=(E=e.builderContextSignal.content)==null?void 0:E.data)==null?void 0:F.httpRequests]),f.useEffect(()=>{w()},[e.builderContextSignal.rootState]),f.useEffect(()=>()=>{u.isBrowser()&&(window.removeEventListener("message",d),window.removeEventListener("builder:component:stateChangeListenerActivated",w))},[]),a.jsx(q.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?a.jsx(a.Fragment,{children:a.jsx("div",{ref:t,onClick:x=>p(x),"builder-content-id":(P=e.builderContextSignal.content)==null?void 0:P.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},className:e.classNameProp,children:e.children},n)}):null})}function H(e){return a.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},id:e.id})}function ne(e){var c,s,m,g,y,p,h;const[t,n]=f.useState(()=>{var v,C;return Ge({variationId:(v=e.content)==null?void 0:v.testVariationId,contentId:(C=e.content)==null?void 0:C.id})});function i(v){d(C=>({...C,rootState:v}))}const[o,r]=f.useState(()=>[...X(),...u.components,...e.customComponents||[]].reduce((v,{component:C,...w})=>({...v,[w.name]:{component:C,...u.serializeComponentInfo(w)}}),{})),[l,d]=f.useState(()=>({content:bt({content:e.content,data:e.data}),localState:void 0,rootState:ht({content:e.content,data:e.data,locale:e.locale}),rootSetState:i,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...X(),...u.components,...e.customComponents||[]].reduce((v,{component:C,...w})=>({...v,[w.name]:u.serializeComponentInfo(w)}),{}),inheritedStyles:{}}));return a.jsx(le.Provider,{value:{registeredComponents:o},children:a.jsxs(Ct,{content:e.content,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,classNameProp:e.classNameProp,showContent:e.showContent,builderContextSignal:l,setBuilderContextSignal:d,children:[e.isSsrAbTest?a.jsx(a.Fragment,{children:a.jsx(H,{scriptStr:t})}):null,a.jsx(a.Fragment,{children:a.jsx(gt,{contentId:(c=l.content)==null?void 0:c.id,cssCode:(m=(s=l.content)==null?void 0:s.data)==null?void 0:m.cssCode,customFonts:(y=(g=l.content)==null?void 0:g.data)==null?void 0:y.customFonts})}),a.jsx(L,{blocks:(h=(p=l.content)==null?void 0:p.data)==null?void 0:h.blocks,context:l,registeredComponents:o})]})})}function D(e){var l,d,c;const[t,n]=f.useState(()=>Oe({canTrack:u.getDefaultCanTrack(e.canTrack),content:e.content}));function i(){var s;return De(A(e.content).map(m=>({id:m.testVariationId,testRatio:m.testRatio})),((s=e.content)==null?void 0:s.id)||"")}function o(){return A(e.content).map(s=>`.variant-${s.testVariationId} { display: none; } `).join("")}function r(){var s;return t?{...e.content,testVariationId:(s=e.content)==null?void 0:s.id}:u.handleABTestingSync({item:e.content,canTrack:u.getDefaultCanTrack(e.canTrack)})}return f.useEffect(()=>{},[]),a.jsxs(a.Fragment,{children:[!e.__isNestedRender&&u.TARGET!=="reactNative"?a.jsx(a.Fragment,{children:a.jsx(H,{scriptStr:qe()})}):null,t?a.jsxs(a.Fragment,{children:[a.jsx(W,{id:`variants-styles-${(l=e.content)==null?void 0:l.id}`,styles:o()}),a.jsx(H,{scriptStr:i()}),(d=A(e.content))==null?void 0:d.map(s=>a.jsx(ne,{content:s,showContent:!1,classNameProp:void 0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:t},s.testVariationId))]}):null,a.jsx(ne,{content:r(),classNameProp:`variant-${(c=e.content)==null?void 0:c.id}`,showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:t})]})}const wt=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return u.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{u.logger.error("Could not fetch symbol content: ",n)})};function xe(e){var r,l,d;function t(){var c,s;return[e.attributes.className,"builder-symbol",(c=e.symbol)!=null&&c.inline?"builder-inline-symbol":void 0,(s=e.symbol)!=null&&s.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[n,i]=f.useState(()=>{var c;return(c=e.symbol)==null?void 0:c.content});function o(){n||wt({symbol:e.symbol,builderContextValue:e.builderContext}).then(c=>{c&&i(c)})}return f.useEffect(()=>{o()},[]),f.useEffect(()=>{o()},[e.symbol]),a.jsx("div",{...e.attributes,className:t(),children:a.jsx(D,{__isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:e.builderContext.context,customComponents:Object.values(e.builderComponents),data:{...(r=e.symbol)==null?void 0:r.data,...e.builderContext.localState,...(l=n==null?void 0:n.data)==null?void 0:l.state},model:(d=e.symbol)==null?void 0:d.model,content:n})})}const jt=L,Tt=D;exports._processContentResult=u._processContentResult;exports.createRegisterComponentMessage=u.createRegisterComponentMessage;exports.fetchBuilderProps=u.fetchBuilderProps;exports.fetchEntries=u.fetchEntries;exports.fetchOneEntry=u.fetchOneEntry;exports.getAllContent=u.getAllContent;exports.getBuilderSearchParams=u.getBuilderSearchParams;exports.getContent=u.getContent;exports.isEditing=u.isEditing;exports.isPreviewing=u.isPreviewing;exports.register=u.register;exports.setEditorSettings=u.setEditorSettings;exports.track=u.track;exports.Blocks=L;exports.Button=ie;exports.Columns=ce;exports.Content=D;exports.Fragment=se;exports.Image=de;exports.RenderBlocks=jt;exports.RenderContent=Tt;exports.Section=ue;exports.Symbol=xe;exports.Text=he;exports.Video=be;
137
+ `.trim());return jsxRuntime.jsx(InlinedStyles,{styles:t})}const getContextStateInitialValue=({content:e,data:t,locale:n})=>{var o,a,l;const i={};(a=(o=e==null?void 0:e.data)==null?void 0:o.inputs)==null||a.forEach(s=>{var c;s.name&&s.defaultValue!==void 0&&((c=e==null?void 0:e.data)!=null&&c.state)&&e.data.state[s.name]===void 0&&(i[s.name]=s.defaultValue)});const r={...(l=e==null?void 0:e.data)==null?void 0:l.state,...t,...n?{locale:n}:{}};return{...i,...r}},getContentInitialValue=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0,SDK_VERSION="0.7.1-1",registerInsertMenu=()=>{serverEntry.register("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let isSetupForEditing=!1;const setupBrowserForEditing=(e={})=>{var t,n;isSetupForEditing||(isSetupForEditing=!0,serverEntry.isBrowser()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:serverEntry.TARGET,version:SDK_VERSION,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",({data:i})=>{var r,o;if(i!=null&&i.type)switch(i.type){case"builder.evaluate":{const a=i.data.text,l=i.data.arguments||[],s=i.data.id,c=new Function(a);let u,f=null;try{u=c.apply(null,l)}catch(x){f=x}f?(r=window.parent)==null||r.postMessage({type:"builder.evaluateError",data:{id:s,error:f.message}},"*"):u&&typeof u.then=="function"?u.then(x=>{var h;(h=window.parent)==null||h.postMessage({type:"builder.evaluateResult",data:{id:s,result:x}},"*")}).catch(console.error):(o=window.parent)==null||o.postMessage({type:"builder.evaluateResult",data:{result:u,id:s}},"*");break}}})))};function round(e){return Math.round(e*1e3)/1e3}const findParentElement=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let i=n?e:e.parentElement;do{if(!i)return null;if(t(i))return i}while(i=i.parentElement);return null},findBuilderParent=e=>findParentElement(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),computeOffset=({event:e,target:t})=>{const n=t.getBoundingClientRect(),i=e.clientX-n.left,r=e.clientY-n.top,o=round(i/n.width),a=round(r/n.height);return{x:o,y:a}},getInteractionPropertiesForEvent=e=>{const t=e.target,n=t&&findBuilderParent(t),i=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:i||void 0,metadata:{targetOffset:t?computeOffset({event:e,target:t}):void 0,builderTargetOffset:n?computeOffset({event:e,target:n}):void 0,builderElementIndex:n&&i?[].slice.call(document.getElementsByClassName(i)).indexOf(n):void 0}}};function EnableEditor(e){var E,w,I,T,B;const t=react.useRef(null),[n,i]=react.useState(()=>0);function r(m){var S,v,C,k,F;const g={...e.builderContextSignal.content,...m,data:{...(S=e.builderContextSignal.content)==null?void 0:S.data,...m==null?void 0:m.data},meta:{...(v=e.builderContextSignal.content)==null?void 0:v.meta,...m==null?void 0:m.meta,breakpoints:((C=m==null?void 0:m.meta)==null?void 0:C.breakpoints)||((F=(k=e.builderContextSignal.content)==null?void 0:k.meta)==null?void 0:F.breakpoints)}};e.setBuilderContextSignal(P=>({...P,content:g}))}react.useState(()=>0);const[o,a]=react.useState(()=>!1);function l(m){var S;const{data:g}=m;if(g)switch(g.type){case"builder.configureSdk":{const v=g.data,{breakpoints:C,contentId:k}=v;if(!k||k!==((S=e.builderContextSignal.content)==null?void 0:S.id))return;C&&r({meta:{breakpoints:C}}),i(n+1);break}case"builder.contentUpdate":{const v=g.data,C=v.key||v.alias||v.entry||v.modelName,k=v.data;C===e.model&&(r(k),i(n+1));break}}}function s(){var g,S;const m=(S=(g=e.builderContextSignal.content)==null?void 0:g.data)==null?void 0:S.jsCode;m&&evaluate({code:m,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[c,u]=react.useState(()=>({})),[f,x]=react.useState(()=>!1);function h(m){var g,S;if(e.builderContextSignal.content){const v=(g=e.builderContextSignal.content)==null?void 0:g.testVariationId,C=(S=e.builderContextSignal.content)==null?void 0:S.id;serverEntry._track({type:"click",canTrack:serverEntry.getDefaultCanTrack(e.canTrack),contentId:C,apiKey:e.apiKey,variationId:v!==C?v:void 0,...getInteractionPropertiesForEvent(m),unique:!f})}f||x(!0)}function d(m){return m.replace(/{{([^}]+)}}/g,(g,S)=>evaluate({code:S,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function b({url:m,key:g}){serverEntry.fetch(m).then(S=>S.json()).then(S=>{var C,k;const v={...e.builderContextSignal.rootState,[g]:S};(k=(C=e.builderContextSignal).rootSetState)==null||k.call(C,v),c[g]=!0}).catch(S=>{console.error("error fetching dynamic data",m,S)})}function p(){var g,S;const m=((S=(g=e.builderContextSignal.content)==null?void 0:g.data)==null?void 0:S.httpRequests)??{};Object.entries(m).forEach(([v,C])=>{if(C&&(!c[v]||serverEntry.isEditing())){const k=d(C);b({url:k,key:v})}})}function R(){serverEntry.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:serverEntry.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function y(m){i(n+1),window.addEventListener("message",l),registerInsertMenu(),setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.includeRefs?{includeRefs:e.includeRefs}:{},...e.enrich?{enrich:e.enrich}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(g=>{var v;const S=serverEntry.createRegisterComponentMessage(g);(v=window.parent)==null||v.postMessage(S,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",R)}function j(m){const g=new URL(location.href).searchParams,S=g.get("builder.preview"),v=g.get(`builder.preview.${S}`),C=g.get("apiKey")||g.get("builder.space");S===e.model&&C===e.apiKey&&(!e.content||v===e.content.id)&&serverEntry.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(k=>{k&&r(k)})}return react.useEffect(()=>{var m;return(m=t.current)==null||m.addEventListener("initeditingbldr",y),()=>{var g;return(g=t.current)==null?void 0:g.removeEventListener("initeditingbldr",y)}},[]),react.useEffect(()=>{var m;return(m=t.current)==null||m.addEventListener("initpreviewingbldr",j),()=>{var g;return(g=t.current)==null?void 0:g.removeEventListener("initpreviewingbldr",j)}},[]),react.useEffect(()=>{var m,g;if(serverEntry.isBrowser()){if(serverEntry.isEditing()&&t.current&&t.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&serverEntry.getDefaultCanTrack(e.canTrack)){const v=(m=e.builderContextSignal.content)==null?void 0:m.testVariationId,C=(g=e.builderContextSignal.content)==null?void 0:g.id,k=e.apiKey;serverEntry._track({type:"impression",canTrack:!0,contentId:C,apiKey:k,variationId:v!==C?v:void 0})}serverEntry.isPreviewing()&&t.current&&t.current.dispatchEvent(new CustomEvent("initpreviewingbldr"))}},[]),react.useEffect(()=>{e.apiKey||serverEntry.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),s(),p(),R()},[]),react.useEffect(()=>{e.content&&r(e.content)},[e.content]),react.useEffect(()=>{},[o]),react.useEffect(()=>{s()},[(w=(E=e.builderContextSignal.content)==null?void 0:E.data)==null?void 0:w.jsCode,e.builderContextSignal.rootState]),react.useEffect(()=>{p()},[(T=(I=e.builderContextSignal.content)==null?void 0:I.data)==null?void 0:T.httpRequests]),react.useEffect(()=>{R()},[e.builderContextSignal.rootState]),react.useEffect(()=>()=>{serverEntry.isBrowser()&&(window.removeEventListener("message",l),window.removeEventListener("builder:component:stateChangeListenerActivated",R))},[]),jsxRuntime.jsx(builderContext.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?jsxRuntime.jsx(jsxRuntime.Fragment,{children:react.createElement("div",{key:n,ref:t,onClick:m=>h(m),"builder-content-id":(B=e.builderContextSignal.content)==null?void 0:B.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},className:e.classNameProp},e.children)}):null})}function InlinedScript(e){return jsxRuntime.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},id:e.id})}function ContentComponent(e){var s,c,u,f,x,h,d;const[t,n]=react.useState(()=>{var b,p;return getRenderContentScriptString({variationId:(b=e.content)==null?void 0:b.testVariationId,contentId:(p=e.content)==null?void 0:p.id})});function i(b){l(p=>({...p,rootState:b}))}const[r,o]=react.useState(()=>[...getDefaultRegisteredComponents(),...serverEntry.components,...e.customComponents||[]].reduce((b,{component:p,...R})=>({...b,[R.name]:{component:p,...serverEntry.serializeComponentInfo(R)}}),{})),[a,l]=react.useState(()=>({content:getContentInitialValue({content:e.content,data:e.data}),localState:void 0,rootState:getContextStateInitialValue({content:e.content,data:e.data,locale:e.locale}),rootSetState:i,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...getDefaultRegisteredComponents(),...serverEntry.components,...e.customComponents||[]].reduce((b,{component:p,...R})=>({...b,[R.name]:serverEntry.serializeComponentInfo(R)}),{}),inheritedStyles:{}}));return jsxRuntime.jsx(ComponentsContext.Provider,{value:{registeredComponents:r},children:jsxRuntime.jsxs(EnableEditor,{content:e.content,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,classNameProp:e.classNameProp,showContent:e.showContent,builderContextSignal:a,setBuilderContextSignal:l,children:[e.isSsrAbTest?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(InlinedScript,{scriptStr:t})}):null,jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(ContentStyles,{contentId:(s=a.content)==null?void 0:s.id,cssCode:(u=(c=a.content)==null?void 0:c.data)==null?void 0:u.cssCode,customFonts:(x=(f=a.content)==null?void 0:f.data)==null?void 0:x.customFonts})}),jsxRuntime.jsx(Blocks,{blocks:(d=(h=a.content)==null?void 0:h.data)==null?void 0:d.blocks,context:a,registeredComponents:r})]})})}function ContentVariants(e){var a,l,s;const[t,n]=react.useState(()=>checkShouldRunVariants({canTrack:serverEntry.getDefaultCanTrack(e.canTrack),content:e.content}));function i(){var c;return getVariantsScriptString(getVariants(e.content).map(u=>({id:u.testVariationId,testRatio:u.testRatio})),((c=e.content)==null?void 0:c.id)||"")}function r(){return getVariants(e.content).map(c=>`.variant-${c.testVariationId} { display: none; } `).join("")}function o(){var c;return t?{...e.content,testVariationId:(c=e.content)==null?void 0:c.id}:serverEntry.handleABTestingSync({item:e.content,canTrack:serverEntry.getDefaultCanTrack(e.canTrack)})}return react.useEffect(()=>{},[]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!e.__isNestedRender&&serverEntry.TARGET!=="reactNative"?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(InlinedScript,{scriptStr:getScriptString()})}):null,t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(InlinedStyles,{id:`variants-styles-${(a=e.content)==null?void 0:a.id}`,styles:r()}),jsxRuntime.jsx(InlinedScript,{scriptStr:i()}),(l=getVariants(e.content))==null?void 0:l.map(c=>jsxRuntime.jsx(ContentComponent,{content:c,showContent:!1,classNameProp:void 0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:t},c.testVariationId))]}):null,jsxRuntime.jsx(ContentComponent,{content:o(),classNameProp:`variant-${(s=e.content)==null?void 0:s.id}`,showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:t})]})}const fetchSymbolContent=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return serverEntry.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{serverEntry.logger.error("Could not fetch symbol content: ",n)})};function Symbol$1(e){var o,a,l;function t(){var s,c;return[e.attributes.className,"builder-symbol",(s=e.symbol)!=null&&s.inline?"builder-inline-symbol":void 0,(c=e.symbol)!=null&&c.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[n,i]=react.useState(()=>{var s;return(s=e.symbol)==null?void 0:s.content});function r(){n||fetchSymbolContent({symbol:e.symbol,builderContextValue:e.builderContext}).then(s=>{s&&i(s)})}return react.useEffect(()=>{r()},[]),react.useEffect(()=>{r()},[e.symbol]),jsxRuntime.jsx("div",{...e.attributes,className:t(),children:jsxRuntime.jsx(ContentVariants,{__isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:e.builderContext.context,customComponents:Object.values(e.builderComponents),data:{...(o=e.symbol)==null?void 0:o.data,...e.builderContext.localState,...(a=n==null?void 0:n.data)==null?void 0:a.state},model:(l=e.symbol)==null?void 0:l.model,content:n})})}const RenderBlocks=Blocks,RenderContent=ContentVariants;exports._processContentResult=serverEntry._processContentResult;exports.createRegisterComponentMessage=serverEntry.createRegisterComponentMessage;exports.fetchBuilderProps=serverEntry.fetchBuilderProps;exports.fetchEntries=serverEntry.fetchEntries;exports.fetchOneEntry=serverEntry.fetchOneEntry;exports.getAllContent=serverEntry.getAllContent;exports.getBuilderSearchParams=serverEntry.getBuilderSearchParams;exports.getContent=serverEntry.getContent;exports.isEditing=serverEntry.isEditing;exports.isPreviewing=serverEntry.isPreviewing;exports.register=serverEntry.register;exports.setEditorSettings=serverEntry.setEditorSettings;exports.track=serverEntry.track;exports.Blocks=Blocks;exports.Button=Button;exports.Columns=Columns;exports.Content=ContentVariants;exports.Fragment=FragmentComponent;exports.Image=Image;exports.RenderBlocks=RenderBlocks;exports.RenderContent=RenderContent;exports.Section=SectionComponent;exports.Symbol=Symbol$1;exports.Text=Text;exports.Video=Video;