@builder.io/sdk-react-nextjs 0.14.10 → 0.14.11

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 (34) hide show
  1. package/README.md +50 -38
  2. package/lib/browser/{USE_CLIENT_BUNDLE-23f56a7a.js → USE_CLIENT_BUNDLE-3b942ae2.js} +2 -2
  3. package/lib/{node/USE_CLIENT_BUNDLE-d7df2675.cjs → browser/USE_CLIENT_BUNDLE-4cb813ce.cjs} +1 -1
  4. package/lib/{edge/USE_SERVER_BUNDLE-d7280e1d.js → browser/USE_SERVER_BUNDLE-0fe135ea.js} +1 -1
  5. package/lib/{edge/USE_SERVER_BUNDLE-87f6dbbe.cjs → browser/USE_SERVER_BUNDLE-ec83933e.cjs} +1 -1
  6. package/lib/browser/{bundle-8b50c7b8.cjs → bundle-260ced55.cjs} +10 -10
  7. package/lib/browser/{bundle-53becb42.js → bundle-76453d46.js} +155 -131
  8. package/lib/browser/index.cjs +1 -1
  9. package/lib/browser/index.mjs +3 -3
  10. package/lib/{node/USE_CLIENT_BUNDLE-1dd54b7e.js → edge/USE_CLIENT_BUNDLE-42619af6.js} +2 -2
  11. package/lib/{browser/USE_CLIENT_BUNDLE-eacd2786.cjs → edge/USE_CLIENT_BUNDLE-dfe5c354.cjs} +1 -1
  12. package/lib/{node/USE_SERVER_BUNDLE-3c851565.cjs → edge/USE_SERVER_BUNDLE-812e699d.cjs} +1 -1
  13. package/lib/{node/USE_SERVER_BUNDLE-df48fc17.js → edge/USE_SERVER_BUNDLE-ef053564.js} +1 -1
  14. package/lib/edge/{bundle-9f94b090.js → bundle-19c1b23d.js} +363 -339
  15. package/lib/edge/{bundle-3db41e4c.cjs → bundle-c186261f.cjs} +13 -13
  16. package/lib/edge/index.cjs +1 -1
  17. package/lib/edge/index.mjs +3 -3
  18. package/lib/{edge/USE_CLIENT_BUNDLE-fa4982fd.js → node/USE_CLIENT_BUNDLE-64c45aac.js} +2 -2
  19. package/lib/{edge/USE_CLIENT_BUNDLE-47f68f73.cjs → node/USE_CLIENT_BUNDLE-7dfe38c5.cjs} +1 -1
  20. package/lib/{browser/USE_SERVER_BUNDLE-e0504825.cjs → node/USE_SERVER_BUNDLE-299ebfe7.cjs} +1 -1
  21. package/lib/{browser/USE_SERVER_BUNDLE-e89c8b6f.js → node/USE_SERVER_BUNDLE-ed1c8346.js} +1 -1
  22. package/lib/node/{bundle-6a6e07b9.js → bundle-1a5c4f3c.js} +135 -111
  23. package/lib/node/{bundle-ece0becd.cjs → bundle-b5555d47.cjs} +9 -9
  24. package/lib/node/index.cjs +1 -1
  25. package/lib/node/index.mjs +3 -3
  26. package/package.json +1 -1
  27. package/types/cjs/components/content-variants/helpers.d.ts +1 -1
  28. package/types/cjs/components/inlined-script.d.ts +1 -1
  29. package/types/cjs/components/inlined-styles.d.ts +1 -1
  30. package/types/cjs/constants/sdk-version.d.ts +1 -1
  31. package/types/esm/components/content-variants/helpers.d.ts +1 -1
  32. package/types/esm/components/inlined-script.d.ts +1 -1
  33. package/types/esm/components/inlined-styles.d.ts +1 -1
  34. package/types/esm/constants/sdk-version.d.ts +1 -1
package/README.md CHANGED
@@ -1,71 +1,83 @@
1
- # Builder.io React NextJS SDK (EXPERIMENTAL)
1
+ ## When should I use this SDK (please read carefully)
2
2
 
3
- This is the Builder NextJS SDK, `@builder.io/sdk-react-nextjs`. It is intended to be used _only_ with NextJS's app directory, and has hard dependencies on NextJS-specific functionality that only works in the app directory.
3
+ - you should ONLY use this SDK if you are trying to [register](https://www.builder.io/c/docs/custom-components-setup) your RSCs (react server components) in Builder. That is its only advantage over our standard React SDKs.
4
+ - our [Gen1](../../../react/) and [Gen2](../react/) React SDKs work perfectly well with all versions of Next.js. The only feature they do not support is registration of RSCs.
5
+ - this SDK only works in the NextJS App Directory.
4
6
 
5
- ## Note
7
+ To allow registering RSCs, this SDK must make compromises. Most notably:
6
8
 
7
- You can use _any_ Builder React SDK with Next.js. Our [Gen1](../../../react/) and [Gen2](../react/) SDKs both work with Next.js (pages router or app router).
9
+ - it does not support interactive Builder features within the rendered content (such as updating dynamic bindings, state, actions etc.). As of today, there are no workarounds around these limitations, due to how RSCs work. See the [features grid](https://github.com/BuilderIO/builder/tree/main/packages/sdks#features) for more information.
10
+ - the visual editor experience is laggy, as it requires network roundtrips to the customer's servers for each edit. We are working on improving this.
8
11
 
9
- This NextJS SDK, though, is the only one that supports [registering](https://www.builder.io/c/docs/custom-components-setup) RSCs (react server components) as custom components in Builder, and also includes nearly 0 client side JS runtime. Our other SDKs only support registering React client components in Builder, due to how RSC's runtime works.
12
+ this SDK is marked as "Beta" due to the missing features mentioned above. It is however actively maintained and developed alongside all other SDKs.
10
13
 
11
- To allow registering RSCS, this SDK makes compromises on Builder features: most notably, it does not support interactivity within the rendered content. See the [features grid](https://github.com/BuilderIO/builder/tree/main/packages/sdks#features) for more information.
14
+ # Builder.io React NextJS SDK (BETA)
12
15
 
13
- ## API Reference
16
+ This is the Builder NextJS SDK, `@builder.io/sdk-react-nextjs`. It is intended to be used _only_ with NextJS's app directory, and has hard dependencies on NextJS-specific functionality that only works in the app directory.
14
17
 
15
- To use the SDK, you need to:
18
+ ## Usage
16
19
 
17
- - fetch the builder data using `getContent`: you can see how to use it here https://www.builder.io/c/docs/content-api, and how it differs from the React V1 SDK's `builder.get()` function.
20
+ When registering a custom component, you will need to add the `isRSC: true` option to the component. For example:
18
21
 
19
- - pass that data to the `RenderContent` component, along with the following properties:
22
+ ```tsx
23
+ // CatFacts.tsx
24
+ async function CatFacts() {
25
+ const catFacts = await fetch('https://cat-fact.herokuapp.com/facts').then(
26
+ (x) => x.json()
27
+ );
28
+ return (
29
+ <div>
30
+ Here are some cat facts from an RSC:
31
+ <ul>
32
+ {catFacts.slice(3).map((fact) => (
33
+ <li key={fact._id}>{fact.text}</li>
34
+ ))}
35
+ </ul>
36
+ </div>
37
+ );
38
+ }
20
39
 
21
- ```ts
22
- type RenderContentProps = {
23
- content?: Nullable<BuilderContent>;
24
- model?: string;
25
- data?: { [key: string]: any };
26
- context?: BuilderRenderContext;
27
- apiKey: string;
28
- apiVersion?: ApiVersion;
29
- customComponents?: RegisteredComponent[];
30
- canTrack?: boolean;
31
- locale?: string;
32
- includeRefs?: boolean;
40
+ export const CatFactsInfo = {
41
+ name: 'CatFacts',
42
+ component: CatFacts,
43
+ // You must add the below option or the SDK will fail to render.
44
+ isRSC: true,
33
45
  };
34
46
  ```
35
47
 
36
- Here is a simplified example showing how you would use both. This needs to be created created with the name `app/[[...slug]]/page.tsx`, so it catches all routes:
48
+ And in your `page.tsx`, you can use the custom component like this:
37
49
 
38
50
  ```tsx
51
+ // page.tsx
39
52
  import {
40
- RenderContent,
53
+ Content,
54
+ fetchOneEntry,
41
55
  getBuilderSearchParams,
42
- getContent,
43
56
  } from '@builder.io/sdk-react-nextjs';
57
+ import { CatFactsInfo } from './CatFacts';
44
58
 
45
- interface MyPageProps {
46
- params: {
47
- slug: string[];
48
- };
49
- searchParams: Record<string, string>;
50
- }
51
-
52
- const apiKey = 'YOUR_API_KEY_HERE';
53
-
54
- export default async function Page(props: MyPageProps) {
59
+ export default async function Page(props) {
55
60
  const urlPath = '/' + (props.params?.slug?.join('/') || '');
56
61
 
57
- const content = await getContent({
62
+ const content = await fetchOneEntry({
58
63
  model: 'page',
59
64
  apiKey,
60
65
  options: getBuilderSearchParams(props.searchParams),
61
66
  userAttributes: { urlPath },
62
67
  });
63
68
 
64
- return <RenderContent content={content} model="page" apiKey={apiKey} />;
69
+ return (
70
+ <Content
71
+ content={content}
72
+ model="page"
73
+ apiKey={apiKey}
74
+ customComponents={[CatFactsInfo]}
75
+ />
76
+ );
65
77
  }
66
78
  ```
67
79
 
68
- Look at the [examples](#examples) for more information.
80
+ For more usage information, look at the [examples](#examples).
69
81
 
70
82
  ## Mitosis
71
83
 
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsx as a, Fragment as C, jsxs as w } from "react/jsx-runtime";
3
- import { i as X, g as _, a as U, b as $, c as E, d as P, e as Y, f as q, h as H, _ as V, j as Z, l as p, k as ee, t as te, m as D, n as ne, o as ie, r as ae, s as ce, p as re, q as le, u as oe } from "./bundle-53becb42.js";
3
+ import { i as X, g as _, a as U, b as $, c as E, d as P, e as Y, f as q, h as H, _ as V, j as Z, l as p, k as ee, t as te, m as D, n as ne, o as ie, r as ae, s as ce, p as re, q as le, u as oe } from "./bundle-76453d46.js";
4
4
  import { useRef as R, useState as y, useEffect as f, createContext as de } from "react";
5
- import { p as se } from "./USE_SERVER_BUNDLE-e89c8b6f.js";
5
+ import { p as se } from "./USE_SERVER_BUNDLE-0fe135ea.js";
6
6
  import { useRouter as ue } from "next/navigation";
7
7
  function O(e) {
8
8
  return /* @__PURE__ */ a(C, { children: X(e.TagName) ? /* @__PURE__ */ a(C, { children: /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ a(C, { children: typeof e.TagName == "string" ? /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
@@ -1,4 +1,4 @@
1
- "use client";"use strict";const t=require("react/jsx-runtime"),a=require("./bundle-ece0becd.cjs"),o=require("react"),_=require("./USE_SERVER_BUNDLE-3c851565.cjs"),z=require("next/navigation");function E(e){return t.jsx(t.Fragment,{children:a.isEmptyElement(e.TagName)?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):t.jsx(t.Fragment,{children:typeof e.TagName=="string"?t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}function M(e){return t.jsx(E,{attributes:{...e.attributes,[a.getClassPropName()]:`${e.link?"":"builder-button"} ${e.attributes[a.getClassPropName()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}},TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}function D(e){return t.jsx(E,{TagName:e.Wrapper,attributes:a.getBlockProperties({block:e.block,context:e.context}),actionAttributes:a.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})}function V(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...a.getBlockProperties({block:e.block,context:e.context}),...a.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{},children:e.children})}function H(e){function r(){var l;return"builder-blocks"+((l=e.blocks)!=null&&l.length?"":" no-blocks")}function m(){var l,b;a.isEditing()&&!((l=e.blocks)!=null&&l.length)&&((b=window.parent)==null||b.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var l,b;a.isEditing()&&!((l=e.blocks)!=null&&l.length)&&((b=window.parent)==null||b.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:r()+" props-blocks-wrapper-7cd1560e","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:l=>m(),onMouseEnter:l=>S(),onKeyPress:l=>m(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-7cd1560e {
1
+ "use client";"use strict";const t=require("react/jsx-runtime"),a=require("./bundle-260ced55.cjs"),o=require("react"),_=require("./USE_SERVER_BUNDLE-ec83933e.cjs"),z=require("next/navigation");function E(e){return t.jsx(t.Fragment,{children:a.isEmptyElement(e.TagName)?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):t.jsx(t.Fragment,{children:typeof e.TagName=="string"?t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}function M(e){return t.jsx(E,{attributes:{...e.attributes,[a.getClassPropName()]:`${e.link?"":"builder-button"} ${e.attributes[a.getClassPropName()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}},TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}function D(e){return t.jsx(E,{TagName:e.Wrapper,attributes:a.getBlockProperties({block:e.block,context:e.context}),actionAttributes:a.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})}function V(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...a.getBlockProperties({block:e.block,context:e.context}),...a.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{},children:e.children})}function H(e){function r(){var l;return"builder-blocks"+((l=e.blocks)!=null&&l.length?"":" no-blocks")}function m(){var l,b;a.isEditing()&&!((l=e.blocks)!=null&&l.length)&&((b=window.parent)==null||b.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var l,b;a.isEditing()&&!((l=e.blocks)!=null&&l.length)&&((b=window.parent)==null||b.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:r()+" props-blocks-wrapper-7cd1560e","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:l=>m(),onMouseEnter:l=>S(),onKeyPress:l=>m(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-7cd1560e {
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: stretch;
@@ -1,5 +1,5 @@
1
1
  "use server";
2
- import { v as s } from "./bundle-9f94b090.js";
2
+ import { v as s } from "./bundle-76453d46.js";
3
3
  async function n({
4
4
  key: t,
5
5
  value: r
@@ -1 +1 @@
1
- "use server";"use strict";const n=require("./bundle-3db41e4c.cjs");async function s({key:e,value:t}){return n.init(),globalThis._BUILDER_PREVIEW_LRU_CACHE.set(e,t),{[e]:t}}exports.postPreviewContent=s;
1
+ "use server";"use strict";const n=require("./bundle-260ced55.cjs");async function s({key:e,value:t}){return n.init(),globalThis._BUILDER_PREVIEW_LRU_CACHE.set(e,t),{[e]:t}}exports.postPreviewContent=s;
@@ -1,12 +1,12 @@
1
- "use strict";const c=require("react/jsx-runtime");require("react");const Ke=require("lru-cache"),v=require("./USE_CLIENT_BUNDLE-eacd2786.cjs");require("next/navigation");const ze=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),qe=e=>typeof e=="string"&&ze.has(e.toLowerCase()),E="rsc",O=()=>{switch(E){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":return"class"}};function Je(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const A="[Builder.io]: ",k={log:(...e)=>console.log(A,...e),error:(...e)=>console.error(A,...e),warn:(...e)=>console.warn(A,...e),debug:(...e)=>console.debug(A,...e)};function y(){return typeof window<"u"&&typeof document<"u"}const Ye=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},de=e=>e instanceof URLSearchParams?Ye(e):e,ue=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function Ge(){return y()&&window.self!==window.top}function N(e){return Ge()&&ue(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const Qe=()=>{if(y()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},Xe=()=>typeof navigator=="object"&&navigator.userAgent||"",me=()=>{const e=Xe(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||E==="reactNative"}},n=e.match(/Tablet|iPad/i),o=Qe();return{urlPath:o==null?void 0:o.pathname,host:(o==null?void 0:o.host)||(o==null?void 0:o.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},Ze=({builder:e,context:t,event:n,state:o})=>Object.entries({state:o,Builder:e,builder:e,context:t,event:n}),et=()=>({isEditing:N(),isBrowser:y(),isServer:!y(),getUserAttributes:()=>me()}),tt=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,G=({code:e,builder:t,context:n,event:o,localState:i,rootSetState:r,rootState:a})=>{const s=Ze({builder:t,context:n,event:o,state:fe({rootState:a,localState:i,rootSetState:r})});return new Function(...s.map(([l])=>l),e)(...s.map(([,l])=>l))};function fe({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(o,i)=>{if(t&&i in t)return t[i];const r=o[i];return typeof r=="object"&&r!==null?fe({rootState:r,localState:void 0,rootSetState:n?a=>{o[i]=a,n(o)}:void 0}):r},set:(o,i,r)=>{if(t&&i in t)throw new Error("Writing to local state is not allowed as it is read-only.");return o[i]=r,n==null||n(o),!0}})}const w=e=>e!=null;function nt(){var e;return typeof process<"u"&&w((e=process==null?void 0:process.versions)==null?void 0:e.node)}const ot=()=>{var o;if(!nt())return!1;const e=process.arch==="arm64",t=process.version.startsWith("v20"),n=(o=process.env.NODE_OPTIONS)==null?void 0:o.includes("--no-node-snapshot");return e&&t&&!n?(k.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "),!0):!1},it=e=>(y()||ot(),G(e)),K=class R{static getCacheKey(t){return JSON.stringify({...t,event:t.event?Math.random():void 0})}static getCachedValue(t){return R.cache.get(t)}static setCachedValue(t,n){R.cache.size>20&&R.cache.delete(R.cache.keys().next().value),R.cache.set(t,{value:n})}};K.cacheLimit=20;K.cache=new Map;let B=K;function $({code:e,context:t,localState:n,rootState:o,rootSetState:i,event:r,isExpression:a=!0,enableCache:s}){if(e===""){k.warn("Skipping evaluation of empty code block.");return}const l={code:tt(e,{isExpression:a}),builder:et(),context:t,event:r,rootSetState:i,rootState:o,localState:n};if(s){const d=B.getCacheKey(l),p=B.getCachedValue(d);if(p)return p.value}try{const d=it(l);if(s){const p=B.getCacheKey(l);B.setCachedValue(p,d)}return d}catch(d){k.error("Failed code evaluation: "+d.message,{code:e});return}}const P=e=>JSON.parse(JSON.stringify(e)),rt=(e,t,n)=>{if(Object(e)!==e)return e;const o=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return o.slice(0,-1).reduce((i,r,a)=>Object(i[r])===i[r]?i[r]:i[r]=Math.abs(Number(o[a+1]))>>0===+o[a+1]?[]:{},e)[o[o.length-1]]=n,e};const at=({block:e,context:t,localState:n,rootState:o,rootSetState:i})=>{if(!e.bindings)return e;const r=P(e),a={...r,properties:{...r.properties},actions:{...r.actions}};for(const s in e.bindings){const l=e.bindings[s],d=$({code:l,localState:n,rootState:o,rootSetState:i,context:t,enableCache:!0});rt(a,s,d)}return a};function W({block:e,context:t,shouldEvaluateBindings:n,localState:o,rootState:i,rootSetState:r}){const a=e;return n?at({block:a,localState:o,rootState:i,rootSetState:r,context:t}):a}const st=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),he=e=>Object.entries(e).map(([n,o])=>{if(typeof o=="string")return`${st(n)}: ${o};`}).filter(w),ct=e=>he(e).join(`
1
+ "use strict";const c=require("react/jsx-runtime");require("react");const Ke=require("lru-cache"),v=require("./USE_CLIENT_BUNDLE-4cb813ce.cjs");require("next/navigation");const ze=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),qe=e=>typeof e=="string"&&ze.has(e.toLowerCase()),E="rsc",O=()=>{switch(E){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":return"class"}};function Je(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const A="[Builder.io]: ",k={log:(...e)=>console.log(A,...e),error:(...e)=>console.error(A,...e),warn:(...e)=>console.warn(A,...e),debug:(...e)=>console.debug(A,...e)};function y(){return typeof window<"u"&&typeof document<"u"}const Ye=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},de=e=>e instanceof URLSearchParams?Ye(e):e,ue=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function Ge(){return y()&&window.self!==window.top}function N(e){return Ge()&&ue(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const Qe=()=>{if(y()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},Xe=()=>typeof navigator=="object"&&navigator.userAgent||"",me=()=>{const e=Xe(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||E==="reactNative"}},n=e.match(/Tablet|iPad/i),o=Qe();return{urlPath:o==null?void 0:o.pathname,host:(o==null?void 0:o.host)||(o==null?void 0:o.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},Ze=({builder:e,context:t,event:n,state:o})=>Object.entries({state:o,Builder:e,builder:e,context:t,event:n}),et=()=>({isEditing:N(),isBrowser:y(),isServer:!y(),getUserAttributes:()=>me()}),tt=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,G=({code:e,builder:t,context:n,event:o,localState:i,rootSetState:r,rootState:a})=>{const s=Ze({builder:t,context:n,event:o,state:fe({rootState:a,localState:i,rootSetState:r})});return new Function(...s.map(([l])=>l),e)(...s.map(([,l])=>l))};function fe({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(o,i)=>{if(t&&i in t)return t[i];const r=o[i];return typeof r=="object"&&r!==null?fe({rootState:r,localState:void 0,rootSetState:n?a=>{o[i]=a,n(o)}:void 0}):r},set:(o,i,r)=>{if(t&&i in t)throw new Error("Writing to local state is not allowed as it is read-only.");return o[i]=r,n==null||n(o),!0}})}const w=e=>e!=null;function nt(){var e;return typeof process<"u"&&w((e=process==null?void 0:process.versions)==null?void 0:e.node)}const ot=()=>{var o;if(!nt())return!1;const e=process.arch==="arm64",t=process.version.startsWith("v20"),n=(o=process.env.NODE_OPTIONS)==null?void 0:o.includes("--no-node-snapshot");return e&&t&&!n?(k.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "),!0):!1},it=e=>(y()||ot(),G(e)),K=class R{static getCacheKey(t){return JSON.stringify({...t,event:t.event?Math.random():void 0})}static getCachedValue(t){return R.cache.get(t)}static setCachedValue(t,n){R.cache.size>20&&R.cache.delete(R.cache.keys().next().value),R.cache.set(t,{value:n})}};K.cacheLimit=20;K.cache=new Map;let V=K;function $({code:e,context:t,localState:n,rootState:o,rootSetState:i,event:r,isExpression:a=!0,enableCache:s}){if(e===""){k.warn("Skipping evaluation of empty code block.");return}const l={code:tt(e,{isExpression:a}),builder:et(),context:t,event:r,rootSetState:i,rootState:o,localState:n};if(s){const u=V.getCacheKey(l),p=V.getCachedValue(u);if(p)return p.value}try{const u=it(l);if(s){const p=V.getCacheKey(l);V.setCachedValue(p,u)}return u}catch(u){k.error("Failed code evaluation: "+u.message,{code:e});return}}const P=e=>JSON.parse(JSON.stringify(e)),rt=(e,t,n)=>{if(Object(e)!==e)return e;const o=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return o.slice(0,-1).reduce((i,r,a)=>Object(i[r])===i[r]?i[r]:i[r]=Math.abs(Number(o[a+1]))>>0===+o[a+1]?[]:{},e)[o[o.length-1]]=n,e};const at=({block:e,context:t,localState:n,rootState:o,rootSetState:i})=>{if(!e.bindings)return e;const r=P(e),a={...r,properties:{...r.properties},actions:{...r.actions}};for(const s in e.bindings){const l=e.bindings[s],u=$({code:l,localState:n,rootState:o,rootSetState:i,context:t,enableCache:!0});rt(a,s,u)}return a};function W({block:e,context:t,shouldEvaluateBindings:n,localState:o,rootState:i,rootSetState:r}){const a=e;return n?at({block:a,localState:o,rootState:i,rootSetState:r,context:t}):a}const st=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),he=e=>Object.entries(e).map(([n,o])=>{if(typeof o=="string")return`${st(n)}: ${o};`}).filter(w),ct=e=>he(e).join(`
2
2
  `),D=({mediaQuery:e,className:t,styles:n})=>{const o=`.${t} {
3
3
  ${ct(n)}
4
4
  }`;return e?`${e} {
5
5
  ${o}
6
6
  }`:o};function lt({style:e}){return e}const dt=({block:e,context:t})=>pe(lt({style:e.style||{},context:t,block:e}));function pe(e){switch(E){case"svelte":case"vue":case"solid":return he(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const ut=({block:e,context:t,registeredComponents:n})=>{var r;const o=(r=W({block:e,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,shouldEvaluateBindings:!1}).component)==null?void 0:r.name;if(!o)return null;const i=n[o];if(i)return i;console.warn(`
7
7
  Could not find a registered component named "${o}".
8
- If you registered it, is the file that registered it imported by the file that needs to render it?`)},mt=({block:e,context:t})=>{const{repeat:n,...o}=e;if(!(n!=null&&n.collection))return;const i=$({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,enableCache:!0});if(!Array.isArray(i))return;const r=n.collection.split(".").pop(),a=n.itemName||(r?r+"Item":"item");return i.map((l,d)=>({context:{...t,localState:{...t.localState,$index:d,$item:l,[a]:l,[`$${a}Index`]:d}},block:o}))},ge={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},Q=(e,t=ge)=>`@media (max-width: ${t[e].max}px)`,be=({small:e,medium:t})=>{const n=P(ge);if(!e||!t)return n;const o=Math.floor(e/2);n.small={max:e,min:o,default:o+1};const i=n.small.max+1;n.medium={max:t,min:i,default:i+1};const r=n.medium.max+1;return n.large={max:2e3,min:r,default:r+1},n};function L(e){return c.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},id:e.id})}function ft(e){const t=function(){const i=W({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return w(i.hide)?!i.hide:w(i.show)?i.show:!0},n=function(){var m;const i=W({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),r=i.responsiveStyles,a=e.context.content,s=be(((m=a==null?void 0:a.meta)==null?void 0:m.breakpoints)||{}),l=r==null?void 0:r.large,d=r==null?void 0:r.medium,p=r==null?void 0:r.small,u=i.id;if(!u)return"";const f=l?D({className:u,styles:l}):"",b=d?D({className:u,styles:d,mediaQuery:Q("medium",s)}):"",h=p?D({className:u,styles:p,mediaQuery:Q("small",s)}):"";return[f,b,h].join(" ")};return c.jsx(c.Fragment,{children:n()&&t()?c.jsx(c.Fragment,{children:c.jsx(L,{styles:n()})}):null})}function ht(e){return e.charAt(0).toUpperCase()+e.slice(1)}const pt=e=>`on${ht(e)}`,gt=(e,t)=>n=>$({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1,enableCache:!0});function bt(e){const t={},n=e.block.actions??{};for(const o in n){if(!n.hasOwnProperty(o))continue;const i=n[o];let r=pt(o);if(e.stripPrefix)switch(E){case"vue":r=r.replace("v-on:","");break;case"svelte":r=r.replace("on:","");break}t[r]=gt(i,e)}return t}function yt({properties:e}){return e}const St=e=>({href:e.href});function ye({block:e,context:t}){var o;const n={...St(e),...e.properties,"builder-id":e.id,style:dt({block:e,context:t}),[O()]:[e.id,"builder-block",e.class,(o=e.properties)==null?void 0:o.class].filter(Boolean).join(" ")};return yt({properties:n,context:t,block:e})}const xt=({componentOptions:e,builderBlock:t,context:n,componentRef:o,includeBlockProps:i,isInteractive:r,contextValue:a})=>{const s={...e,...i?{attributes:ye({block:t,context:a})}:{}};return r?{Wrapper:o,block:t,context:n,wrapperProps:e,includeBlockProps:i}:s};function X(e){var n;const t=e.isInteractive?v.InteractiveElement:e.componentRef;return c.jsx(c.Fragment,{children:e.componentRef?c.jsx(c.Fragment,{children:c.jsx(t,{...xt({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(n=e.blockChildren)==null?void 0:n.map(o=>c.jsx(U,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}function kt(e){const t=e.repeatContext;return c.jsx(U,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})}function U(e){var l,d,p;const t=function(){return ut({block:e.block,context:e.context,registeredComponents:e.registeredComponents})},n=function(){return mt({block:e.block,context:e.context})},o=function(){var f;return(f=e.block.repeat)!=null&&f.collection?e.block:W({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})},i=function(){var b;return e.block.tagName==="a"||((b=o().properties)==null?void 0:b.href)||o().href?e.linkComponent||"a":e.block.tagName||"div"},r=function(){var h,m;if((h=e.block.repeat)!=null&&h.collection)return!!((m=n())!=null&&m.length);const f="hide"in o()?o().hide:!1;return("show"in o()?o().show:!0)&&!f},a=function(){var b;return!((b=t())!=null&&b.component)&&!n()?o().children??[]:[]},s=function(){var f,b,h,m,S,g,C,T,x,I;return{blockChildren:o().children??[],componentRef:(f=t())==null?void 0:f.component,componentOptions:{...Je(o()),builderContext:e.context,...((b=t())==null?void 0:b.name)==="Core:Button"||((h=t())==null?void 0:h.name)==="Symbol"||((m=t())==null?void 0:m.name)==="Columns"||((S=t())==null?void 0:S.name)==="Form:Form"?{builderLinkComponent:e.linkComponent}:{},...((g=t())==null?void 0:g.name)==="Symbol"||((C=t())==null?void 0:C.name)==="Columns"||((T=t())==null?void 0:T.name)==="Form:Form"?{builderComponents:e.registeredComponents}:{}},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:o(),includeBlockProps:((x=t())==null?void 0:x.noWrap)===!0,isInteractive:!((I=t())!=null&&I.isRSC)}};return c.jsx(c.Fragment,{children:r()?c.jsxs(c.Fragment,{children:[c.jsx(ft,{block:e.block,context:e.context}),(l=t())!=null&&l.noWrap?c.jsx(c.Fragment,{children:c.jsx(X,{componentRef:s().componentRef,componentOptions:s().componentOptions,blockChildren:s().blockChildren,context:s().context,registeredComponents:s().registeredComponents,linkComponent:s().linkComponent,builderBlock:s().builderBlock,includeBlockProps:s().includeBlockProps,isInteractive:s().isInteractive})}):c.jsx(c.Fragment,{children:n()?c.jsx(c.Fragment,{children:(p=n())==null?void 0:p.map((u,f)=>c.jsx(kt,{repeatContext:u.context,block:u.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},f))}):c.jsxs(v.BlockWrapper,{Wrapper:i(),block:o(),context:e.context,linkComponent:e.linkComponent,children:[c.jsx(X,{componentRef:s().componentRef,componentOptions:s().componentOptions,blockChildren:s().blockChildren,context:s().context,registeredComponents:s().registeredComponents,linkComponent:s().linkComponent,builderBlock:s().builderBlock,includeBlockProps:s().includeBlockProps,isInteractive:s().isInteractive}),(d=a())==null?void 0:d.map(u=>c.jsx(U,{block:u,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},u.id))]})})]}):null})}function _(e){var t,n,o;return c.jsx(v.BlocksWrapper,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,BlocksWrapper:(t=e.context)==null?void 0:t.BlocksWrapper,BlocksWrapperProps:(n=e.context)==null?void 0:n.BlocksWrapperProps,children:e.blocks?c.jsx(c.Fragment,{children:(o=e.blocks)==null?void 0:o.map(i=>c.jsx(U,{block:i,linkComponent:e.linkComponent,context:e.context,registeredComponents:e.registeredComponents},i.id))}):null})}function Se(e){var b;const t=typeof e.space=="number"?e.space||0:20,n=e.columns||[],o=e.stackColumnsAt||"tablet",i=function(m){var S;return((S=n[m])==null?void 0:S.width)||100/n.length},r=function(m){const S=t*(n.length-1)/n.length;return`calc(${i(m)}% - ${S}px)`},a=function({stackedStyle:m,desktopStyle:S}){return o==="tablet"?m:S},s=function({stackedStyle:m,desktopStyle:S}){return o==="never"?S:m},l=e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column",d=function(){return{"--flex-dir":l,"--flex-dir-tablet":a({stackedStyle:l,desktopStyle:"row"})}},p=function(m){const S=m===0?0:t,g=r(m),C=`${S}px`,T="100%",x=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:g,["marginLeft"]:C,"--column-width-mobile":s({stackedStyle:T,desktopStyle:g}),"--column-margin-left-mobile":s({stackedStyle:x,desktopStyle:C}),"--column-width-tablet":a({stackedStyle:T,desktopStyle:g}),"--column-margin-left-tablet":a({stackedStyle:x,desktopStyle:C})}},u=function(m){var g,C;return be(((C=(g=e.builderContext.content)==null?void 0:g.meta)==null?void 0:C.breakpoints)||{})[m].max},f=function(){return`
9
- @media (max-width: ${u("medium")}px) {
8
+ If you registered it, is the file that registered it imported by the file that needs to render it?`)},mt=({block:e,context:t})=>{const{repeat:n,...o}=e;if(!(n!=null&&n.collection))return;const i=$({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,enableCache:!0});if(!Array.isArray(i))return;const r=n.collection.split(".").pop(),a=n.itemName||(r?r+"Item":"item");return i.map((l,u)=>({context:{...t,localState:{...t.localState,$index:u,$item:l,[a]:l,[`$${a}Index`]:u}},block:o}))},ge={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},Q=(e,t=ge)=>`@media (max-width: ${t[e].max}px)`,be=({small:e,medium:t})=>{const n=P(ge);if(!e||!t)return n;const o=Math.floor(e/2);n.small={max:e,min:o,default:o+1};const i=n.small.max+1;n.medium={max:t,min:i,default:i+1};const r=n.medium.max+1;return n.large={max:2e3,min:r,default:r+1},n};function L(e){return c.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id})}function ft(e){const t=function(){const i=W({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return w(i.hide)?!i.hide:w(i.show)?i.show:!0},n=function(){var m;const i=W({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),r=i.responsiveStyles,a=e.context.content,s=be(((m=a==null?void 0:a.meta)==null?void 0:m.breakpoints)||{}),l=r==null?void 0:r.large,u=r==null?void 0:r.medium,p=r==null?void 0:r.small,d=i.id;if(!d)return"";const f=l?D({className:d,styles:l}):"",b=u?D({className:d,styles:u,mediaQuery:Q("medium",s)}):"",h=p?D({className:d,styles:p,mediaQuery:Q("small",s)}):"";return[f,b,h].join(" ")};return c.jsx(c.Fragment,{children:n()&&t()?c.jsx(c.Fragment,{children:c.jsx(L,{id:"builderio-block",styles:n()})}):null})}function ht(e){return e.charAt(0).toUpperCase()+e.slice(1)}const pt=e=>`on${ht(e)}`,gt=(e,t)=>n=>$({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1,enableCache:!0});function bt(e){const t={},n=e.block.actions??{};for(const o in n){if(!n.hasOwnProperty(o))continue;const i=n[o];let r=pt(o);if(e.stripPrefix)switch(E){case"vue":r=r.replace("v-on:","");break;case"svelte":r=r.replace("on:","");break}t[r]=gt(i,e)}return t}function yt({properties:e}){return e}const St=e=>({href:e.href});function ye({block:e,context:t}){var o;const n={...St(e),...e.properties,"builder-id":e.id,style:dt({block:e,context:t}),[O()]:[e.id,"builder-block",e.class,(o=e.properties)==null?void 0:o.class].filter(Boolean).join(" ")};return yt({properties:n,context:t,block:e})}const xt=({componentOptions:e,builderBlock:t,context:n,componentRef:o,includeBlockProps:i,isInteractive:r,contextValue:a})=>{const s={...e,...i?{attributes:ye({block:t,context:a})}:{}};return r?{Wrapper:o,block:t,context:n,wrapperProps:e,includeBlockProps:i}:s};function X(e){var n;const t=e.isInteractive?v.InteractiveElement:e.componentRef;return c.jsx(c.Fragment,{children:e.componentRef?c.jsx(c.Fragment,{children:c.jsx(t,{...xt({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(n=e.blockChildren)==null?void 0:n.map(o=>c.jsx(U,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}function kt(e){const t=e.repeatContext;return c.jsx(U,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})}function U(e){var l,u,p;const t=function(){return ut({block:e.block,context:e.context,registeredComponents:e.registeredComponents})},n=function(){return mt({block:e.block,context:e.context})},o=function(){var f;return(f=e.block.repeat)!=null&&f.collection?e.block:W({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})},i=function(){var b;return e.block.tagName==="a"||((b=o().properties)==null?void 0:b.href)||o().href?e.linkComponent||"a":e.block.tagName||"div"},r=function(){var h,m;if((h=e.block.repeat)!=null&&h.collection)return!!((m=n())!=null&&m.length);const f="hide"in o()?o().hide:!1;return("show"in o()?o().show:!0)&&!f},a=function(){var b;return!((b=t())!=null&&b.component)&&!n()?o().children??[]:[]},s=function(){var f,b,h,m,S,g,C,T,x,I;return{blockChildren:o().children??[],componentRef:(f=t())==null?void 0:f.component,componentOptions:{...Je(o()),builderContext:e.context,...((b=t())==null?void 0:b.name)==="Core:Button"||((h=t())==null?void 0:h.name)==="Symbol"||((m=t())==null?void 0:m.name)==="Columns"||((S=t())==null?void 0:S.name)==="Form:Form"?{builderLinkComponent:e.linkComponent}:{},...((g=t())==null?void 0:g.name)==="Symbol"||((C=t())==null?void 0:C.name)==="Columns"||((T=t())==null?void 0:T.name)==="Form:Form"?{builderComponents:e.registeredComponents}:{}},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:o(),includeBlockProps:((x=t())==null?void 0:x.noWrap)===!0,isInteractive:!((I=t())!=null&&I.isRSC)}};return c.jsx(c.Fragment,{children:r()?c.jsxs(c.Fragment,{children:[c.jsx(ft,{block:e.block,context:e.context}),(l=t())!=null&&l.noWrap?c.jsx(c.Fragment,{children:c.jsx(X,{componentRef:s().componentRef,componentOptions:s().componentOptions,blockChildren:s().blockChildren,context:s().context,registeredComponents:s().registeredComponents,linkComponent:s().linkComponent,builderBlock:s().builderBlock,includeBlockProps:s().includeBlockProps,isInteractive:s().isInteractive})}):c.jsx(c.Fragment,{children:n()?c.jsx(c.Fragment,{children:(p=n())==null?void 0:p.map((d,f)=>c.jsx(kt,{repeatContext:d.context,block:d.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},f))}):c.jsxs(v.BlockWrapper,{Wrapper:i(),block:o(),context:e.context,linkComponent:e.linkComponent,children:[c.jsx(X,{componentRef:s().componentRef,componentOptions:s().componentOptions,blockChildren:s().blockChildren,context:s().context,registeredComponents:s().registeredComponents,linkComponent:s().linkComponent,builderBlock:s().builderBlock,includeBlockProps:s().includeBlockProps,isInteractive:s().isInteractive}),(u=a())==null?void 0:u.map(d=>c.jsx(U,{block:d,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},d.id))]})})]}):null})}function _(e){var t,n,o;return c.jsx(v.BlocksWrapper,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,BlocksWrapper:(t=e.context)==null?void 0:t.BlocksWrapper,BlocksWrapperProps:(n=e.context)==null?void 0:n.BlocksWrapperProps,children:e.blocks?c.jsx(c.Fragment,{children:(o=e.blocks)==null?void 0:o.map(i=>c.jsx(U,{block:i,linkComponent:e.linkComponent,context:e.context,registeredComponents:e.registeredComponents},i.id))}):null})}function Se(e){var b;const t=typeof e.space=="number"?e.space||0:20,n=e.columns||[],o=e.stackColumnsAt||"tablet",i=function(m){var S;return((S=n[m])==null?void 0:S.width)||100/n.length},r=function(m){const S=t*(n.length-1)/n.length;return`calc(${i(m)}% - ${S}px)`},a=function({stackedStyle:m,desktopStyle:S}){return o==="tablet"?m:S},s=function({stackedStyle:m,desktopStyle:S}){return o==="never"?S:m},l=e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column",u=function(){return{"--flex-dir":l,"--flex-dir-tablet":a({stackedStyle:l,desktopStyle:"row"})}},p=function(m){const S=m===0?0:t,g=r(m),C=`${S}px`,T="100%",x=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:g,["marginLeft"]:C,"--column-width-mobile":s({stackedStyle:T,desktopStyle:g}),"--column-margin-left-mobile":s({stackedStyle:x,desktopStyle:C}),"--column-width-tablet":a({stackedStyle:T,desktopStyle:g}),"--column-margin-left-tablet":a({stackedStyle:x,desktopStyle:C})}},d=function(m){var g,C;return be(((C=(g=e.builderContext.content)==null?void 0:g.meta)==null?void 0:C.breakpoints)||{})[m].max},f=function(){return`
9
+ @media (max-width: ${d("medium")}px) {
10
10
  .${e.builderBlock.id}-breakpoints {
11
11
  flex-direction: var(--flex-dir-tablet);
12
12
  align-items: stretch;
@@ -18,7 +18,7 @@
18
18
  }
19
19
  }
20
20
 
21
- @media (max-width: ${u("small")}px) {
21
+ @media (max-width: ${d("small")}px) {
22
22
  .${e.builderBlock.id}-breakpoints {
23
23
  flex-direction: var(--flex-dir);
24
24
  align-items: stretch;
@@ -29,10 +29,10 @@
29
29
  margin-left: var(--column-margin-left-mobile) !important;
30
30
  }
31
31
  },
32
- `};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`builder-columns ${e.builderBlock.id}-breakpoints div-7e6263b2`,style:d(),children:[c.jsx(L,{styles:f()}),(b=e.columns)==null?void 0:b.map((h,m)=>c.jsx(v.DynamicRenderer,{TagName:h.link?e.builderLinkComponent||"a":"div",actionAttributes:{},attributes:{...h.link?{href:h.link}:{},[O()]:"builder-column",style:pe(p(m))},children:c.jsx(_,{path:`component.options.columns.${m}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:h.blocks})},m))]}),c.jsx("style",{children:`.div-7e6263b2 {
32
+ `};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`builder-columns ${e.builderBlock.id}-breakpoints div-664216e4`,style:u(),children:[c.jsx(L,{id:"builderio-columns",styles:f()}),(b=e.columns)==null?void 0:b.map((h,m)=>c.jsx(v.DynamicRenderer,{TagName:h.link?e.builderLinkComponent||"a":"div",actionAttributes:{},attributes:{...h.link?{href:h.link}:{},[O()]:"builder-column",style:pe(p(m))},children:c.jsx(_,{path:`component.options.columns.${m}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:h.blocks})},m))]}),c.jsx("style",{children:`.div-664216e4 {
33
33
  display: flex;
34
34
  line-height: normal;
35
- }`})]})}function Z(e){return e.replace(/http(s)?:/,"")}function vt(e="",t,n){const o=new RegExp("([?&])"+t+"=.*?(&|$)","i"),i=e.indexOf("?")!==-1?"&":"?";return e.match(o)?e.replace(o,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+i+t+"="+encodeURIComponent(n)}function Ct(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return Z(e);const n=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(n){const o=e.split(n[0]),i=n[3],r=t.match("x")?t:`${t}x`;return Z(`${o[0]}_${r}${i}`)}return null}function wt(e){if(!e)return e;const t=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let n=e;const o=Number(e.split("?width=")[1]);return isNaN(o)||(n=`${n} ${o}w`),t.filter(i=>i!==o).map(i=>`${vt(e,"width",i)} ${i}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[Ct(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,o])=>`${n} ${o}w`).concat([e]).join(", "):e}const It=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},xe=({name:e,canTrack:t})=>{var n;try{return t?(n=document.cookie.split("; ").find(o=>o.startsWith(`${e}=`)))==null?void 0:n.split("=")[1]:void 0}catch(o){k.warn("[COOKIE] GET error: ",(o==null?void 0:o.message)||o);return}},ke=async e=>xe(e),Et=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(w).join("; "),Tt=[["secure",""],["SameSite","None"]],Rt=({name:e,value:t,expires:n})=>{const i=(y()?location.protocol==="https:":!0)?Tt:[[]],r=n?[["expires",n.toUTCString()]]:[[]],a=[[e,t],...r,["path","/"],["domain",It(window.location.hostname)],...i];return Et(a)},ve=async({name:e,value:t,expires:n,canTrack:o})=>{try{if(!o)return;const i=Rt({name:e,value:t,expires:n});document.cookie=i}catch(i){k.warn("[COOKIE] SET error: ",(i==null?void 0:i.message)||i)}},Pt="builder.tests",z=e=>`${Pt}.${e}`,At=({contentId:e})=>ke({name:z(e),canTrack:!0}),Bt=({contentId:e})=>xe({name:z(e),canTrack:!0}),Vt=({contentId:e,value:t})=>ve({name:z(e),value:t,canTrack:!0}),Ce=e=>w(e.id)&&w(e.variations)&&Object.keys(e.variations).length>0,jt=({id:e,variations:t})=>{var i;let n=0;const o=Math.random();for(const r in t){const a=(i=t[r])==null?void 0:i.testRatio;if(n+=a,o<n)return r}return e},we=e=>{const t=jt(e);return Vt({contentId:e.id,value:t}).catch(n=>{k.error("could not store A/B test variation: ",n)}),t},Ie=({item:e,testGroupId:t})=>{const n=e.variations[t];return t===e.id||!n?{testVariationId:e.id,testVariationName:"Default"}:{data:n.data,testVariationId:n.id,testVariationName:n.name||(n.id===e.id?"Default":"")}},Wt=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!Ce(e))return e;const n=Bt({contentId:e.id})||we({variations:e.variations,id:e.id}),o=Ie({item:e,testGroupId:n});return{...e,...o}},Ft=async({item:e,canTrack:t})=>{if(!t||!Ce(e))return e;const o=await At({contentId:e.id})||we({variations:e.variations,id:e.id}),i=Ie({item:e,testGroupId:o});return{...e,...i}},F=e=>w(e)?e:!0,Ot={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},Nt={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(o=>{o.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(i=>i.get("width"))&&(n.find(r=>!r.get("width"))||n.reduce((s,l)=>s+l.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}]},$t={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},Lt={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,s=6e4){return new Promise((l,d)=>{const p=document.createElement("img");let u=!1;p.onload=()=>{u=!0,l(p)},p.addEventListener("error",f=>{console.warn("Image load failed",f.error),d(f.error)}),p.src=a,setTimeout(()=>{u||d(new Error("Image load timed out"))},s)})}function o(a){return Math.round(a*1e3)/1e3}const i=e.get("image"),r=e.get("aspectRatio");if(fetch(i).then(a=>a.blob()).then(a=>{a.type.includes("svg")&&e.set("noWebp",!0)}),i&&(!r||r===.7041))return n(i).then(a=>{const s=e.get("aspectRatio");e.get("image")===i&&(!s||s===.7041)&&a.width&&a.height&&(e.set("aspectRatio",o(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}]},Ut={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>"}}}]},_t={name:"Slot",isRSC:!0,description:"Allow child blocks to be inserted into this content when used as a Symbol",docsLink:"https://www.builder.io/c/docs/symbols-with-blocks",image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",inputs:[{name:"name",type:"string",required:!0,defaultValue:"children"}]};function Dt(e){var t,n,o;return c.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:c.jsx(_,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(o=e.builderContext.rootState)==null?void 0:o[e.name]})})}const Mt={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"}]},Ht={name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}};function Ee(e){var t;return c.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const Kt={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}]},zt={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(o=>o.json()).then(o=>{e.get("url")===t&&(o.html?e.set("content",o.html):e.set("content","Invalid url, please try another"))}).catch(o=>{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}]},qt=["text/javascript","application/javascript","application/ecmascript"],Jt=e=>qt.includes(e.type),Yt={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},Gt={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}]},Qt=()=>[{component:v.CustomCode,...Kt},{component:v.Embed,...zt},{component:v.ImgComponent,...Yt},{component:v.Video,...Gt}],ee=()=>[{component:v.Button,...Ot},{component:Se,...Nt},{component:v.FragmentComponent,...$t},{component:v.Image,...Lt},{component:v.SectionComponent,...Ut},{component:Dt,..._t},{component:He,...Mt},{component:Ee,...Ht},...Qt()],Xt=e=>({type:"builder.registerComponent",data:M(e)}),Zt=e=>{const t=e.toString().trim();return`return (${!t.startsWith("function")&&!t.startsWith("(")?"function ":""}${t}).apply(this, arguments)`},en=e=>typeof e=="function"?Zt(e):P(e),M=({inputs:e,...t})=>({...P(t),inputs:e==null?void 0:e.map(n=>Object.entries(n).reduce((o,[i,r])=>({...o,[i]:en(r)}),{}))}),tn=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
35
+ }`})]})}function Z(e){return e.replace(/http(s)?:/,"")}function vt(e="",t,n){const o=new RegExp("([?&])"+t+"=.*?(&|$)","i"),i=e.indexOf("?")!==-1?"&":"?";return e.match(o)?e.replace(o,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+i+t+"="+encodeURIComponent(n)}function Ct(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return Z(e);const n=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(n){const o=e.split(n[0]),i=n[3],r=t.match("x")?t:`${t}x`;return Z(`${o[0]}_${r}${i}`)}return null}function wt(e){if(!e)return e;const t=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let n=e;const o=Number(e.split("?width=")[1]);return isNaN(o)||(n=`${n} ${o}w`),t.filter(i=>i!==o).map(i=>`${vt(e,"width",i)} ${i}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[Ct(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,o])=>`${n} ${o}w`).concat([e]).join(", "):e}const It=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},xe=({name:e,canTrack:t})=>{var n;try{return t?(n=document.cookie.split("; ").find(o=>o.startsWith(`${e}=`)))==null?void 0:n.split("=")[1]:void 0}catch(o){k.warn("[COOKIE] GET error: ",(o==null?void 0:o.message)||o);return}},ke=async e=>xe(e),Et=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(w).join("; "),Tt=[["secure",""],["SameSite","None"]],Rt=({name:e,value:t,expires:n})=>{const i=(y()?location.protocol==="https:":!0)?Tt:[[]],r=n?[["expires",n.toUTCString()]]:[[]],a=[[e,t],...r,["path","/"],["domain",It(window.location.hostname)],...i];return Et(a)},ve=async({name:e,value:t,expires:n,canTrack:o})=>{try{if(!o)return;const i=Rt({name:e,value:t,expires:n});document.cookie=i}catch(i){k.warn("[COOKIE] SET error: ",(i==null?void 0:i.message)||i)}},Pt="builder.tests",z=e=>`${Pt}.${e}`,At=({contentId:e})=>ke({name:z(e),canTrack:!0}),Vt=({contentId:e})=>xe({name:z(e),canTrack:!0}),Bt=({contentId:e,value:t})=>ve({name:z(e),value:t,canTrack:!0}),Ce=e=>w(e.id)&&w(e.variations)&&Object.keys(e.variations).length>0,jt=({id:e,variations:t})=>{var i;let n=0;const o=Math.random();for(const r in t){const a=(i=t[r])==null?void 0:i.testRatio;if(n+=a,o<n)return r}return e},we=e=>{const t=jt(e);return Bt({contentId:e.id,value:t}).catch(n=>{k.error("could not store A/B test variation: ",n)}),t},Ie=({item:e,testGroupId:t})=>{const n=e.variations[t];return t===e.id||!n?{testVariationId:e.id,testVariationName:"Default"}:{data:n.data,testVariationId:n.id,testVariationName:n.name||(n.id===e.id?"Default":"")}},Wt=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!Ce(e))return e;const n=Vt({contentId:e.id})||we({variations:e.variations,id:e.id}),o=Ie({item:e,testGroupId:n});return{...e,...o}},Ft=async({item:e,canTrack:t})=>{if(!t||!Ce(e))return e;const o=await At({contentId:e.id})||we({variations:e.variations,id:e.id}),i=Ie({item:e,testGroupId:o});return{...e,...i}},F=e=>w(e)?e:!0,Ot={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},Nt={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(o=>{o.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(i=>i.get("width"))&&(n.find(r=>!r.get("width"))||n.reduce((s,l)=>s+l.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}]},$t={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},Lt={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,s=6e4){return new Promise((l,u)=>{const p=document.createElement("img");let d=!1;p.onload=()=>{d=!0,l(p)},p.addEventListener("error",f=>{console.warn("Image load failed",f.error),u(f.error)}),p.src=a,setTimeout(()=>{d||u(new Error("Image load timed out"))},s)})}function o(a){return Math.round(a*1e3)/1e3}const i=e.get("image"),r=e.get("aspectRatio");if(fetch(i).then(a=>a.blob()).then(a=>{a.type.includes("svg")&&e.set("noWebp",!0)}),i&&(!r||r===.7041))return n(i).then(a=>{const s=e.get("aspectRatio");e.get("image")===i&&(!s||s===.7041)&&a.width&&a.height&&(e.set("aspectRatio",o(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}]},Ut={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>"}}}]},_t={name:"Slot",isRSC:!0,description:"Allow child blocks to be inserted into this content when used as a Symbol",docsLink:"https://www.builder.io/c/docs/symbols-with-blocks",image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",inputs:[{name:"name",type:"string",required:!0,defaultValue:"children"}]};function Dt(e){var t,n,o;return c.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:c.jsx(_,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(o=e.builderContext.rootState)==null?void 0:o[e.name]})})}const Mt={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"}]},Ht={name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}};function Ee(e){var t;return c.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const Kt={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}]},zt={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(o=>o.json()).then(o=>{e.get("url")===t&&(o.html?e.set("content",o.html):e.set("content","Invalid url, please try another"))}).catch(o=>{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}]},qt=["text/javascript","application/javascript","application/ecmascript"],Jt=e=>qt.includes(e.type),Yt={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},Gt={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}]},Qt=()=>[{component:v.CustomCode,...Kt},{component:v.Embed,...zt},{component:v.ImgComponent,...Yt},{component:v.Video,...Gt}],ee=()=>[{component:v.Button,...Ot},{component:Se,...Nt},{component:v.FragmentComponent,...$t},{component:v.Image,...Lt},{component:v.SectionComponent,...Ut},{component:Dt,..._t},{component:He,...Mt},{component:Ee,...Ht},...Qt()],Xt=e=>({type:"builder.registerComponent",data:M(e)}),Zt=e=>{const t=e.toString().trim();return`return (${!t.startsWith("function")&&!t.startsWith("(")?"function ":""}${t}).apply(this, arguments)`},en=e=>typeof e=="function"?Zt(e):P(e),M=({inputs:e,...t})=>({...P(t),inputs:e==null?void 0:e.map(n=>Object.entries(n).reduce((o,[i,r])=>({...o,[i]:en(r)}),{}))}),tn=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
36
36
  function getAndSetVariantId() {
37
37
  function setCookie(name, value, days) {
38
38
  let expires = '';
@@ -122,7 +122,7 @@
122
122
  thisScriptEl?.remove();
123
123
  }
124
124
  return;
125
- }`,Te="builderIoAbTest",Re="builderIoRenderContent",V=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),on=({canTrack:e,content:t})=>!(!(V(t).length>0)||!e||y()),rn=e=>e==="react"||e==="reactNative",Pe=rn(E),an=()=>`
125
+ }`,Te="builderIoAbTest",Re="builderIoRenderContent",B=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),on=({canTrack:e,content:t})=>!(!(B(t).length>0)||!e||y()),rn=e=>e==="react"||e==="reactNative",Pe=rn(E),an=()=>`
126
126
  window.${Te} = ${tn}
127
127
  window.${Re} = ${nn}
128
128
  `,sn=(e,t)=>`
@@ -130,8 +130,8 @@
130
130
  "${t}",${JSON.stringify(e)}, ${Pe}
131
131
  )`,cn=({contentId:e,variationId:t})=>`window.${Re}(
132
132
  "${t}", "${e}", ${Pe}
133
- )`;function H(e){return c.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},id:e.id||""})}const ln=e=>{const t=e.get("preview"),n=e.get("overrides."+t);return n||k.warn("No previewed ID found in search params."),n};function Ae(){globalThis._BUILDER_PREVIEW_LRU_CACHE||(globalThis._BUILDER_PREVIEW_LRU_CACHE=new Ke.LRUCache({max:500,ttl:1e3*60*5}))}function dn(e){Ae();const t=ln(e);return typeof t=="string"?globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t):void 0}function un(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:globalThis}function mn(){const e=un().fetch;if(typeof e>"u")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
134
- For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const Be=mn();function j(e,t=null,n="."){return Object.keys(e).reduce((o,i)=>{const r=e[i],a=[t,i].filter(Boolean).join(n);return[typeof r=="object",r!==null,!(Array.isArray(r)&&r.length===0)].every(Boolean)?{...o,...j(r,a,n)}:{...o,[a]:r}},{})}const fn="v3",te="builder.",hn="options.",q=e=>{if(!e)return{};const t=de(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(te)){const i=o.replace(te,"").replace(hn,"");n[i]=t[o]}}),n},pn=()=>{if(!y())return{};const e=new URLSearchParams(window.location.search);return q(e)},ne=e=>typeof e=="number"&&!isNaN(e)&&e>=0,J=e=>{const{limit:t=30,userAttributes:n,query:o,model:i,apiKey:r,enrich:a,locale:s,apiVersion:l=fn,fields:d,omit:p,offset:u,cacheSeconds:f,staleCacheSeconds:b,sort:h,includeUnpublished:m}=e;if(!r)throw new Error("Missing API key");if(!["v3"].includes(l))throw new Error(`Invalid apiVersion: expected 'v3', received '${l}'`);const S=t!==1,g=new URL(`https://cdn.builder.io/api/${l}/content/${i}`);if(g.searchParams.set("apiKey",r),g.searchParams.set("limit",String(t)),g.searchParams.set("noTraverse",String(S)),g.searchParams.set("includeRefs",String(!0)),s&&g.searchParams.set("locale",s),a&&g.searchParams.set("enrich",String(a)),g.searchParams.set("omit",p||"meta.componentsUsed"),d&&g.searchParams.set("fields",d),Number.isFinite(u)&&u>-1&&g.searchParams.set("offset",String(Math.floor(u))),typeof m=="boolean"&&g.searchParams.set("includeUnpublished",String(m)),f&&ne(f)&&g.searchParams.set("cacheSeconds",String(f)),b&&ne(b)&&g.searchParams.set("staleCacheSeconds",String(b)),h){const x=j({sort:h});for(const I in x)g.searchParams.set(I,JSON.stringify(x[I]))}const C={...pn(),...de(e.options||{})},T=j(C);for(const x in T)g.searchParams.set(x,String(T[x]));if(n&&g.searchParams.set("userAttributes",JSON.stringify(n)),o){const x=j({query:o});for(const I in x)g.searchParams.set(I,JSON.stringify(x[I]))}return g},gn=e=>"results"in e;async function Y(e){const t=await je({...e,limit:1});return t&&t[0]||null}const bn=async e=>{const t=J(e);return await(await(e.fetch??Be)(t.href,e.fetchOptions)).json()},Ve=async(e,t,n=J(e))=>{const o=F(e.canTrack);if(n.search.includes("preview=")){const r=[];for(const a of t.results){const s=dn(n.searchParams);r.push(s||a)}t.results=r}if(!o||!(y()||E==="reactNative"))return t.results;try{const r=[];for(const a of t.results)r.push(await Ft({item:a,canTrack:o}));t.results=r}catch(r){k.error("Could not process A/B tests. ",r)}return t.results};async function je(e){try{const t=J(e),n=await bn(e);return gn(n)?Ve(e,n):(k.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return k.error("Error fetching data. ",t),null}}function yn(e){if(!y())return!1;const t=ue(e||window.location.search);return N(t)?!1:t.indexOf("builder.preview=")!==-1}function Sn(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function We(){return Sn().replace(/-/g,"")}const Fe="builderSessionId",xn=async({canTrack:e})=>{if(!e)return;const t=await ke({name:Fe,canTrack:e});if(w(t))return t;{const n=kn();return vn({id:n,canTrack:e}),n}},kn=()=>We(),vn=({id:e,canTrack:t})=>ve({name:Fe,value:e,canTrack:t}),Oe=()=>y()&&typeof localStorage<"u"?localStorage:void 0,Cn=({key:e,canTrack:t})=>{var n;try{return t?(n=Oe())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},wn=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=Oe())==null||o.setItem(e,n))}catch(i){console.debug("[LocalStorage] SET error: ",i)}},Ne="builderVisitorId",In=({canTrack:e})=>{if(!e)return;const t=Cn({key:Ne,canTrack:e});if(w(t))return t;{const n=En();return Tn({id:n,canTrack:e}),n}},En=()=>We(),Tn=({id:e,canTrack:t})=>wn({key:Ne,value:e,canTrack:t}),Rn=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await xn({canTrack:e}),n=In({canTrack:e});return{sessionId:t,visitorId:n}},Pn=async({type:e,canTrack:t,apiKey:n,metadata:o,...i})=>({type:e,data:{...i,metadata:{url:location.href,...o},...await Rn({canTrack:t}),userAttributes:me(),ownerId:n}});async function $e(e){if(!e.apiKey){k.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!N()&&(y()||E==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await Pn(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const An=e=>$e({...e,canTrack:!0});function oe(e){return Math.round(e*1e3)/1e3}const Bn=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let o=n?e:e.parentElement;do{if(!o)return null;if(t(o))return o}while(o=o.parentElement);return null},Vn=e=>Bn(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),ie=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,i=e.clientY-n.top,r=oe(o/n.width),a=oe(i/n.height);return{x:r,y:a}},jn=e=>{const t=e.target,n=t&&Vn(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?ie({event:e,target:t}):void 0,builderTargetOffset:n?ie({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},Wn=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function Le(e,t){const n=new URL(t.origin),o=n.hostname;return(e||Wn).findIndex(i=>i.startsWith("*.")?o.endsWith(i.slice(1)):i===o)>-1}const Fn="0.14.10",re={};function Ue(e,t){let n=re[e];if(n||(n=re[e]=[]),n.push(t),y()){const o={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(o,"*"),parent!==window&&window.postMessage(o,"*")}catch(i){console.debug("Could not postmessage",i)}}}const On=()=>{Ue("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 ae=!1;const _e=(e={})=>{var t,n;ae||(ae=!0,y()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:E,version:Fn,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",o=>{var r,a;if(!Le(e.trustedHosts,o))return;const{data:i}=o;if(i!=null&&i.type)switch(i.type){case"builder.evaluate":{const s=i.data.text,l=i.data.arguments||[],d=i.data.id,p=new Function(s);let u,f=null;try{u=p.apply(null,l)}catch(b){f=b}f?(r=window.parent)==null||r.postMessage({type:"builder.evaluateError",data:{id:d,error:f.message}},"*"):u&&typeof u.then=="function"?u.then(b=>{var h;(h=window.parent)==null||h.postMessage({type:"builder.evaluateResult",data:{id:d,result:b}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:u,id:d}},"*");break}}})))},De=({model:e,trustedHosts:t,callbacks:n})=>o=>{if(!Le(t,o))return;const{data:i}=o;if(i)switch(i.type){case"builder.configureSdk":{n.configureSdk(i.data);break}case"builder.triggerAnimation":{n.animation(i.data);break}case"builder.contentUpdate":{const r=i.data,a=r.key||r.alias||r.entry||r.modelName,s=r.data;a===e&&n.contentUpdate(s);break}}},Nn=(e,t,n)=>{if(!y)return k.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};_e();const o=De({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",o),()=>{window.removeEventListener("message",o)}};function se(e,...t){const n=Object(e);for(let o=1;o<arguments.length;o++){const i=arguments[o];if(i!=null)for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n}const $n=e=>e?e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`):"";function Ln(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function Un(e,t){const n=_n(e),o=getComputedStyle(t),i=e.steps[0].styles,r=e.steps[e.steps.length-1].styles,a=[i,r];for(const s of a)for(const l of n)l in s||(s[l]=o[l])}function _n(e){const t=[];for(const n of e.steps)for(const o in n.styles)t.indexOf(o)===-1&&t.push(o);return t}function Dn(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){Ln(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{Un(e,n),n.style.transition="none",n.style.transitionDelay="0",se(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${$n(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),se(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}const Mn=e=>{var r;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],o=e.fileUrl??((r=e==null?void 0:e.files)==null?void 0:r.regular);let i="";if(o&&t&&n&&(i+=`
133
+ )`;function H(e){return c.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id})}const ln=e=>{const t=e.get("preview"),n=e.get("overrides."+t);return n||k.warn("No previewed ID found in search params."),n};function Ae(){globalThis._BUILDER_PREVIEW_LRU_CACHE||(globalThis._BUILDER_PREVIEW_LRU_CACHE=new Ke.LRUCache({max:500,ttl:1e3*60*5}))}function dn(e){Ae();const t=ln(e);return typeof t=="string"?globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t):void 0}function un(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:globalThis}function mn(){const e=un().fetch;if(typeof e>"u")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
134
+ For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const Ve=mn();function j(e,t=null,n="."){return Object.keys(e).reduce((o,i)=>{const r=e[i],a=[t,i].filter(Boolean).join(n);return[typeof r=="object",r!==null,!(Array.isArray(r)&&r.length===0)].every(Boolean)?{...o,...j(r,a,n)}:{...o,[a]:r}},{})}const fn="v3",te="builder.",hn="options.",q=e=>{if(!e)return{};const t=de(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(te)){const i=o.replace(te,"").replace(hn,"");n[i]=t[o]}}),n},pn=()=>{if(!y())return{};const e=new URLSearchParams(window.location.search);return q(e)},ne=e=>typeof e=="number"&&!isNaN(e)&&e>=0,J=e=>{const{limit:t=30,userAttributes:n,query:o,model:i,apiKey:r,enrich:a,locale:s,apiVersion:l=fn,fields:u,omit:p,offset:d,cacheSeconds:f,staleCacheSeconds:b,sort:h,includeUnpublished:m}=e;if(!r)throw new Error("Missing API key");if(!["v3"].includes(l))throw new Error(`Invalid apiVersion: expected 'v3', received '${l}'`);const S=t!==1,g=new URL(`https://cdn.builder.io/api/${l}/content/${i}`);if(g.searchParams.set("apiKey",r),g.searchParams.set("limit",String(t)),g.searchParams.set("noTraverse",String(S)),g.searchParams.set("includeRefs",String(!0)),s&&g.searchParams.set("locale",s),a&&g.searchParams.set("enrich",String(a)),g.searchParams.set("omit",p||"meta.componentsUsed"),u&&g.searchParams.set("fields",u),Number.isFinite(d)&&d>-1&&g.searchParams.set("offset",String(Math.floor(d))),typeof m=="boolean"&&g.searchParams.set("includeUnpublished",String(m)),f&&ne(f)&&g.searchParams.set("cacheSeconds",String(f)),b&&ne(b)&&g.searchParams.set("staleCacheSeconds",String(b)),h){const x=j({sort:h});for(const I in x)g.searchParams.set(I,JSON.stringify(x[I]))}const C={...pn(),...de(e.options||{})},T=j(C);for(const x in T)g.searchParams.set(x,String(T[x]));if(n&&g.searchParams.set("userAttributes",JSON.stringify(n)),o){const x=j({query:o});for(const I in x)g.searchParams.set(I,JSON.stringify(x[I]))}return g},gn=e=>"results"in e;async function Y(e){const t=await je({...e,limit:1});return t&&t[0]||null}const bn=async e=>{const t=J(e);return await(await(e.fetch??Ve)(t.href,e.fetchOptions)).json()},Be=async(e,t,n=J(e))=>{const o=F(e.canTrack);if(n.search.includes("preview=")){const r=[];for(const a of t.results){const s=dn(n.searchParams);r.push(s||a)}t.results=r}if(!o||!(y()||E==="reactNative"))return t.results;try{const r=[];for(const a of t.results)r.push(await Ft({item:a,canTrack:o}));t.results=r}catch(r){k.error("Could not process A/B tests. ",r)}return t.results};async function je(e){try{const t=J(e),n=await bn(e);return gn(n)?Be(e,n):(k.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return k.error("Error fetching data. ",t),null}}function yn(e){if(!y())return!1;const t=ue(e||window.location.search);return N(t)?!1:t.indexOf("builder.preview=")!==-1}function Sn(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function We(){return Sn().replace(/-/g,"")}const Fe="builderSessionId",xn=async({canTrack:e})=>{if(!e)return;const t=await ke({name:Fe,canTrack:e});if(w(t))return t;{const n=kn();return vn({id:n,canTrack:e}),n}},kn=()=>We(),vn=({id:e,canTrack:t})=>ve({name:Fe,value:e,canTrack:t}),Oe=()=>y()&&typeof localStorage<"u"?localStorage:void 0,Cn=({key:e,canTrack:t})=>{var n;try{return t?(n=Oe())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},wn=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=Oe())==null||o.setItem(e,n))}catch(i){console.debug("[LocalStorage] SET error: ",i)}},Ne="builderVisitorId",In=({canTrack:e})=>{if(!e)return;const t=Cn({key:Ne,canTrack:e});if(w(t))return t;{const n=En();return Tn({id:n,canTrack:e}),n}},En=()=>We(),Tn=({id:e,canTrack:t})=>wn({key:Ne,value:e,canTrack:t}),Rn=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await xn({canTrack:e}),n=In({canTrack:e});return{sessionId:t,visitorId:n}},Pn=async({type:e,canTrack:t,apiKey:n,metadata:o,...i})=>({type:e,data:{...i,metadata:{url:location.href,...o},...await Rn({canTrack:t}),userAttributes:me(),ownerId:n}});async function $e(e){if(!e.apiKey){k.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!N()&&(y()||E==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await Pn(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const An=e=>$e({...e,canTrack:!0});function oe(e){return Math.round(e*1e3)/1e3}const Vn=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let o=n?e:e.parentElement;do{if(!o)return null;if(t(o))return o}while(o=o.parentElement);return null},Bn=e=>Vn(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),ie=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,i=e.clientY-n.top,r=oe(o/n.width),a=oe(i/n.height);return{x:r,y:a}},jn=e=>{const t=e.target,n=t&&Bn(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?ie({event:e,target:t}):void 0,builderTargetOffset:n?ie({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},Wn=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function Le(e,t){const n=new URL(t.origin),o=n.hostname;return(e||Wn).findIndex(i=>i.startsWith("*.")?o.endsWith(i.slice(1)):i===o)>-1}const Fn="0.14.11",re={};function Ue(e,t){let n=re[e];if(n||(n=re[e]=[]),n.push(t),y()){const o={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(o,"*"),parent!==window&&window.postMessage(o,"*")}catch(i){console.debug("Could not postmessage",i)}}}const On=()=>{Ue("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 ae=!1;const _e=(e={})=>{var t,n;ae||(ae=!0,y()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:E,version:Fn,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",o=>{var r,a;if(!Le(e.trustedHosts,o))return;const{data:i}=o;if(i!=null&&i.type)switch(i.type){case"builder.evaluate":{const s=i.data.text,l=i.data.arguments||[],u=i.data.id,p=new Function(s);let d,f=null;try{d=p.apply(null,l)}catch(b){f=b}f?(r=window.parent)==null||r.postMessage({type:"builder.evaluateError",data:{id:u,error:f.message}},"*"):d&&typeof d.then=="function"?d.then(b=>{var h;(h=window.parent)==null||h.postMessage({type:"builder.evaluateResult",data:{id:u,result:b}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:d,id:u}},"*");break}}})))},De=({model:e,trustedHosts:t,callbacks:n})=>o=>{if(!Le(t,o))return;const{data:i}=o;if(i)switch(i.type){case"builder.configureSdk":{n.configureSdk(i.data);break}case"builder.triggerAnimation":{n.animation(i.data);break}case"builder.contentUpdate":{const r=i.data,a=r.key||r.alias||r.entry||r.modelName,s=r.data;a===e&&n.contentUpdate(s);break}}},Nn=(e,t,n)=>{if(!y)return k.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};_e();const o=De({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",o),()=>{window.removeEventListener("message",o)}};function se(e,...t){const n=Object(e);for(let o=1;o<arguments.length;o++){const i=arguments[o];if(i!=null)for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n}const $n=e=>e?e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`):"";function Ln(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function Un(e,t){const n=_n(e),o=getComputedStyle(t),i=e.steps[0].styles,r=e.steps[e.steps.length-1].styles,a=[i,r];for(const s of a)for(const l of n)l in s||(s[l]=o[l])}function _n(e){const t=[];for(const n of e.steps)for(const o in n.styles)t.indexOf(o)===-1&&t.push(o);return t}function Dn(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){Ln(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{Un(e,n),n.style.transition="none",n.style.transitionDelay="0",se(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${$n(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),se(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}const Mn=e=>{var r;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],o=e.fileUrl??((r=e==null?void 0:e.files)==null?void 0:r.regular);let i="";if(o&&t&&n&&(i+=`
135
135
  @font-face {
136
136
  font-family: "${t}";
137
137
  src: local("${n}"), url('${o}') format('woff2');
@@ -166,4 +166,4 @@ font-weight: ${a};
166
166
  ${Kn({cssCode:e.cssCode,contentId:e.contentId})}
167
167
  ${Hn({customFonts:e.customFonts})}
168
168
  ${qn(e.isNestedRender)}
169
- `.trim();return c.jsx(L,{styles:t})}const Yn=({content:e,data:t,locale:n})=>{var r,a,s;const o={},i=((r=e==null?void 0:e.data)==null?void 0:r.state)||{};return(s=(a=e==null?void 0:e.data)==null?void 0:a.inputs)==null||s.forEach(l=>{l.name&&l.defaultValue!==void 0&&(o[l.name]=l.defaultValue)}),{...o,...i,...t,...n?{locale:n}:{}}},Gn=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function ce(e){var i,r,a,s,l,d,p,u,f;const t=cn({variationId:(i=e.content)==null?void 0:i.testVariationId,contentId:(r=e.content)==null?void 0:r.id}),n=[...ee(),...e.customComponents||[]].reduce((b,{component:h,...m})=>({...b,[m.name]:{component:h,...M(m)}}),{}),o={content:Gn({content:e.content,data:e.data}),localState:void 0,rootState:Yn({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...ee(),...e.customComponents||[]].reduce((b,{component:h,...m})=>({...b,[m.name]:M(m)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}};return c.jsxs(v.EnableEditor,{content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:o,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,linkComponent:e.linkComponent,trustedHosts:e.trustedHosts,children:[e.isSsrAbTest?c.jsx(H,{scriptStr:t}):null,c.jsx(Jn,{isNestedRender:e.isNestedRender,contentId:(a=o.content)==null?void 0:a.id,cssCode:(l=(s=o.content)==null?void 0:s.data)==null?void 0:l.cssCode,customFonts:(p=(d=o.content)==null?void 0:d.data)==null?void 0:p.customFonts}),c.jsx(_,{blocks:(f=(u=o.content)==null?void 0:u.data)==null?void 0:f.blocks,context:o,registeredComponents:n,linkComponent:e.linkComponent})]})}function Me(e){var r,a;const t=on({canTrack:F(e.canTrack),content:e.content}),n=function(){var l;return sn(V(e.content).map(d=>({id:d.testVariationId,testRatio:d.testRatio})),((l=e.content)==null?void 0:l.id)||"")},o=function(){return V(e.content).map(l=>`.variant-${l.testVariationId} { display: none; } `).join("")},i=function(){var l;return t?{...e.content,testVariationId:(l=e.content)==null?void 0:l.id}:Wt({item:e.content,canTrack:F(e.canTrack)})};return c.jsxs(c.Fragment,{children:[!e.isNestedRender&&E!=="reactNative"?c.jsx(H,{scriptStr:an()}):null,t?c.jsxs(c.Fragment,{children:[c.jsx(L,{id:`variants-styles-${(r=e.content)==null?void 0:r.id}`,styles:o()}),c.jsx(H,{scriptStr:n()}),(a=V(e.content))==null?void 0:a.map(s=>c.jsx(ce,{isNestedRender:e.isNestedRender,content:s,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},s.testVariationId))]}):null,c.jsx(ce,{isNestedRender:e.isNestedRender,content:i(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const Qn=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return Y({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{k.error("Could not fetch symbol content: ",n)})};async function He(e){var o,i,r,a,s;const t=function(){var d,p;return[e.attributes[O()],"builder-symbol",(d=e.symbol)!=null&&d.inline?"builder-inline-symbol":void 0,(p=e.symbol)!=null&&p.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},n=((o=e.symbol)==null?void 0:o.content)||await Qn({symbol:e.symbol,builderContextValue:e.builderContext});return c.jsx("div",{...e.attributes,className:t(),children:c.jsx(Me,{isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(i=e.builderBlock)==null?void 0:i.id},customComponents:Object.values(e.builderComponents),data:{...(r=e.symbol)==null?void 0:r.data,...e.builderContext.localState,...(a=n==null?void 0:n.data)==null?void 0:a.state},model:(s=e.symbol)==null?void 0:s.model,content:n,linkComponent:e.builderLinkComponent,blocksWrapper:"div",contentWrapper:"div"})})}const le={};function Xn(e){if(y()){Object.assign(le,e);const t={type:"builder.settingsChange",data:le};parent.postMessage(t,"*")}}const Zn=async e=>{var o,i,r;const t=e.path||((o=e.url)==null?void 0:o.pathname)||((i=e.userAttributes)==null?void 0:i.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:q(e.searchParams||((r=e.url)==null?void 0:r.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await Y(n)}};exports.Blocks=_;exports.Columns=Se;exports.ContentVariants=Me;exports.Symbol=He;exports.Text=Ee;exports._processContentResult=Ve;exports._track=$e;exports.createEditorListener=De;exports.createRegisterComponentMessage=Xt;exports.evaluate=$;exports.fastClone=P;exports.fetch=Be;exports.fetchBuilderProps=Zn;exports.fetchEntries=je;exports.fetchOneEntry=Y;exports.getBlockActions=bt;exports.getBlockProperties=ye;exports.getBuilderSearchParams=q;exports.getClassPropName=O;exports.getDefaultCanTrack=F;exports.getInteractionPropertiesForEvent=jn;exports.getSrcSet=wt;exports.init=Ae;exports.isBrowser=y;exports.isEditing=N;exports.isEmptyElement=qe;exports.isJsScript=Jt;exports.isPreviewing=yn;exports.logger=k;exports.register=Ue;exports.registerInsertMenu=On;exports.setEditorSettings=Xn;exports.setupBrowserForEditing=_e;exports.subscribeToEditor=Nn;exports.track=An;exports.triggerAnimation=Dn;
169
+ `.trim();return c.jsx(L,{id:"builderio-content",styles:t})}const Yn=({content:e,data:t,locale:n})=>{var r,a,s;const o={},i=((r=e==null?void 0:e.data)==null?void 0:r.state)||{};return(s=(a=e==null?void 0:e.data)==null?void 0:a.inputs)==null||s.forEach(l=>{l.name&&l.defaultValue!==void 0&&(o[l.name]=l.defaultValue)}),{...o,...i,...t,...n?{locale:n}:{}}},Gn=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function ce(e){var i,r,a,s,l,u,p,d,f;const t=cn({variationId:(i=e.content)==null?void 0:i.testVariationId,contentId:(r=e.content)==null?void 0:r.id}),n=[...ee(),...e.customComponents||[]].reduce((b,{component:h,...m})=>({...b,[m.name]:{component:h,...M(m)}}),{}),o={content:Gn({content:e.content,data:e.data}),localState:void 0,rootState:Yn({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...ee(),...e.customComponents||[]].reduce((b,{component:h,...m})=>({...b,[m.name]:M(m)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}};return c.jsxs(v.EnableEditor,{content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:o,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,linkComponent:e.linkComponent,trustedHosts:e.trustedHosts,children:[e.isSsrAbTest?c.jsx(H,{id:"builderio-variant-visibility",scriptStr:t}):null,c.jsx(Jn,{isNestedRender:e.isNestedRender,contentId:(a=o.content)==null?void 0:a.id,cssCode:(l=(s=o.content)==null?void 0:s.data)==null?void 0:l.cssCode,customFonts:(p=(u=o.content)==null?void 0:u.data)==null?void 0:p.customFonts}),c.jsx(_,{blocks:(f=(d=o.content)==null?void 0:d.data)==null?void 0:f.blocks,context:o,registeredComponents:n,linkComponent:e.linkComponent})]})}function Me(e){var r;const t=on({canTrack:F(e.canTrack),content:e.content}),n=function(){var s;return sn(B(e.content).map(l=>({id:l.testVariationId,testRatio:l.testRatio})),((s=e.content)==null?void 0:s.id)||"")},o=function(){return B(e.content).map(s=>`.variant-${s.testVariationId} { display: none; } `).join("")},i=function(){var s;return t?{...e.content,testVariationId:(s=e.content)==null?void 0:s.id}:Wt({item:e.content,canTrack:F(e.canTrack)})};return c.jsxs(c.Fragment,{children:[!e.isNestedRender&&E!=="reactNative"?c.jsx(H,{id:"builderio-init-variants-fns",scriptStr:an()}):null,t?c.jsxs(c.Fragment,{children:[c.jsx(L,{id:"builderio-variants",styles:o()}),c.jsx(H,{id:"builderio-variants-visibility",scriptStr:n()}),(r=B(e.content))==null?void 0:r.map(a=>c.jsx(ce,{isNestedRender:e.isNestedRender,content:a,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},a.testVariationId))]}):null,c.jsx(ce,{isNestedRender:e.isNestedRender,content:i(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const Qn=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return Y({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{k.error("Could not fetch symbol content: ",n)})};async function He(e){var o,i,r,a,s;const t=function(){var u,p;return[e.attributes[O()],"builder-symbol",(u=e.symbol)!=null&&u.inline?"builder-inline-symbol":void 0,(p=e.symbol)!=null&&p.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},n=((o=e.symbol)==null?void 0:o.content)||await Qn({symbol:e.symbol,builderContextValue:e.builderContext});return c.jsx("div",{...e.attributes,className:t(),children:c.jsx(Me,{isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(i=e.builderBlock)==null?void 0:i.id},customComponents:Object.values(e.builderComponents),data:{...(r=e.symbol)==null?void 0:r.data,...e.builderContext.localState,...(a=n==null?void 0:n.data)==null?void 0:a.state},model:(s=e.symbol)==null?void 0:s.model,content:n,linkComponent:e.builderLinkComponent,blocksWrapper:"div",contentWrapper:"div"})})}const le={};function Xn(e){if(y()){Object.assign(le,e);const t={type:"builder.settingsChange",data:le};parent.postMessage(t,"*")}}const Zn=async e=>{var o,i,r;const t=e.path||((o=e.url)==null?void 0:o.pathname)||((i=e.userAttributes)==null?void 0:i.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:q(e.searchParams||((r=e.url)==null?void 0:r.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await Y(n)}};exports.Blocks=_;exports.Columns=Se;exports.ContentVariants=Me;exports.Symbol=He;exports.Text=Ee;exports._processContentResult=Be;exports._track=$e;exports.createEditorListener=De;exports.createRegisterComponentMessage=Xt;exports.evaluate=$;exports.fastClone=P;exports.fetch=Ve;exports.fetchBuilderProps=Zn;exports.fetchEntries=je;exports.fetchOneEntry=Y;exports.getBlockActions=bt;exports.getBlockProperties=ye;exports.getBuilderSearchParams=q;exports.getClassPropName=O;exports.getDefaultCanTrack=F;exports.getInteractionPropertiesForEvent=jn;exports.getSrcSet=wt;exports.init=Ae;exports.isBrowser=y;exports.isEditing=N;exports.isEmptyElement=qe;exports.isJsScript=Jt;exports.isPreviewing=yn;exports.logger=k;exports.register=Ue;exports.registerInsertMenu=On;exports.setEditorSettings=Xn;exports.setupBrowserForEditing=_e;exports.subscribeToEditor=Nn;exports.track=An;exports.triggerAnimation=Dn;