@builder.io/sdk-react-nextjs 0.14.8 → 0.14.9

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 (30) hide show
  1. package/lib/{node/USE_CLIENT_BUNDLE-690f58c3.js → browser/USE_CLIENT_BUNDLE-07d1ba4b.js} +205 -212
  2. package/lib/browser/USE_CLIENT_BUNDLE-5b3511d0.cjs +21 -0
  3. package/lib/{edge/USE_SERVER_BUNDLE-2cb317bc.js → browser/USE_SERVER_BUNDLE-059335ee.js} +1 -1
  4. package/lib/{edge/USE_SERVER_BUNDLE-7cb08770.cjs → browser/USE_SERVER_BUNDLE-4e489369.cjs} +1 -1
  5. package/lib/browser/{bundle-d78727c9.js → bundle-53a4ab4a.js} +2 -2
  6. package/lib/browser/{bundle-eca4b0ba.cjs → bundle-9d3cdb5c.cjs} +2 -2
  7. package/lib/browser/index.cjs +1 -1
  8. package/lib/browser/index.mjs +3 -3
  9. package/lib/edge/USE_CLIENT_BUNDLE-0d437014.cjs +21 -0
  10. package/lib/{browser/USE_CLIENT_BUNDLE-78517750.js → edge/USE_CLIENT_BUNDLE-99299aaa.js} +205 -212
  11. package/lib/{node/USE_SERVER_BUNDLE-649f2942.js → edge/USE_SERVER_BUNDLE-2d91be32.js} +1 -1
  12. package/lib/{node/USE_SERVER_BUNDLE-e8d80664.cjs → edge/USE_SERVER_BUNDLE-37a2c2d3.cjs} +1 -1
  13. package/lib/edge/{bundle-7da386a2.js → bundle-d76be364.js} +2 -2
  14. package/lib/edge/{bundle-07c68bbe.cjs → bundle-da19475d.cjs} +2 -2
  15. package/lib/edge/index.cjs +1 -1
  16. package/lib/edge/index.mjs +3 -3
  17. package/lib/node/USE_CLIENT_BUNDLE-94a936b5.cjs +21 -0
  18. package/lib/{edge/USE_CLIENT_BUNDLE-01cf3cc1.js → node/USE_CLIENT_BUNDLE-aa4a4eb2.js} +205 -212
  19. package/lib/{browser/USE_SERVER_BUNDLE-29f23050.js → node/USE_SERVER_BUNDLE-91781c1b.js} +1 -1
  20. package/lib/{browser/USE_SERVER_BUNDLE-d3d0c3a5.cjs → node/USE_SERVER_BUNDLE-d58e151a.cjs} +1 -1
  21. package/lib/node/{bundle-001f0cdc.js → bundle-49817803.js} +2 -2
  22. package/lib/node/{bundle-77f045ce.cjs → bundle-955ea489.cjs} +2 -2
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +3 -3
  25. package/package.json +1 -1
  26. package/types/cjs/constants/sdk-version.d.ts +1 -1
  27. package/types/esm/constants/sdk-version.d.ts +1 -1
  28. package/lib/browser/USE_CLIENT_BUNDLE-2046b4f7.cjs +0 -21
  29. package/lib/edge/USE_CLIENT_BUNDLE-23418377.cjs +0 -21
  30. package/lib/node/USE_CLIENT_BUNDLE-f9317c5f.cjs +0 -21
@@ -1,5 +1,5 @@
1
1
  "use server";
2
- import { v as s } from "./bundle-d78727c9.js";
2
+ import { v as s } from "./bundle-49817803.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-eca4b0ba.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-955ea489.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,7 +1,7 @@
1
1
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { LRUCache } from "lru-cache";
4
- import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, D as DynamicRenderer, C as CustomCode, E as Embed, b as ImgComponent, V as Video, c as Button, F as FragmentComponent, d as Image, S as SectionComponent, e as EnableEditor } from "./USE_CLIENT_BUNDLE-690f58c3.js";
4
+ import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, D as DynamicRenderer, C as CustomCode, E as Embed, b as ImgComponent, V as Video, c as Button, F as FragmentComponent, d as Image, S as SectionComponent, e as EnableEditor } from "./USE_CLIENT_BUNDLE-aa4a4eb2.js";
5
5
  import "next/navigation";
6
6
  const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), isEmptyElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.has(e.toLowerCase()), TARGET = "rsc", getClassPropName = () => {
7
7
  switch (TARGET) {
@@ -2272,7 +2272,7 @@ function isFromTrustedHost(e, t) {
2272
2272
  const n = new URL(t.origin), o = n.hostname;
2273
2273
  return (e || DEFAULT_TRUSTED_HOSTS).findIndex((r) => r.startsWith("*.") ? o.endsWith(r.slice(1)) : r === o) > -1;
2274
2274
  }
2275
- const SDK_VERSION = "0.14.8", registry = {};
2275
+ const SDK_VERSION = "0.14.9", registry = {};
2276
2276
  function register(e, t) {
2277
2277
  let n = registry[e];
2278
2278
  if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
@@ -1,4 +1,4 @@
1
- "use strict";const jsxRuntime=require("react/jsx-runtime");require("react");const lruCache=require("lru-cache"),USE_CLIENT_BUNDLE=require("./USE_CLIENT_BUNDLE-f9317c5f.cjs");require("next/navigation");const EMPTY_HTML_ELEMENTS=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),isEmptyElement=e=>typeof e=="string"&&EMPTY_HTML_ELEMENTS.has(e.toLowerCase()),TARGET="rsc",getClassPropName=()=>{switch(TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":return"class"}};function getBlockComponentOptions(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const MSG_PREFIX="[Builder.io]: ",logger={log:(...e)=>console.log(MSG_PREFIX,...e),error:(...e)=>console.error(MSG_PREFIX,...e),warn:(...e)=>console.warn(MSG_PREFIX,...e),debug:(...e)=>console.debug(MSG_PREFIX,...e)};function isBrowser(){return typeof window<"u"&&typeof document<"u"}const convertSearchParamsToQueryObject=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},normalizeSearchParams=e=>e instanceof URLSearchParams?convertSearchParamsToQueryObject(e):e,getSearchString=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function isIframe(){return isBrowser()&&window.self!==window.top}function isEditing(e){return isIframe()&&getSearchString(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const getLocation=()=>{if(isBrowser()){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},getUserAgent=()=>typeof navigator=="object"&&navigator.userAgent||"",getUserAttributes=()=>{const e=getUserAgent(),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()||TARGET==="reactNative"}},n=e.match(/Tablet|iPad/i),o=getLocation();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"}},getFunctionArguments=({builder:e,context:t,event:n,state:o})=>Object.entries({state:o,Builder:e,builder:e,context:t,event:n}),getBuilderGlobals=()=>({isEditing:isEditing(),isBrowser:isBrowser(),isServer:!isBrowser(),getUserAttributes:()=>getUserAttributes()}),parseCode=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,runInBrowser=({code:e,builder:t,context:n,event:o,localState:r,rootSetState:i,rootState:a})=>{const s=getFunctionArguments({builder:t,context:n,event:o,state:flattenState({rootState:a,localState:r,rootSetState:i})});return new Function(...s.map(([c])=>c),e)(...s.map(([,c])=>c))};function flattenState({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(o,r)=>{if(t&&r in t)return t[r];const i=o[r];return typeof i=="object"&&i!==null?flattenState({rootState:i,localState:void 0,rootSetState:n?a=>{o[r]=a,n(o)}:void 0}):i},set:(o,r,i)=>{if(t&&r in t)throw new Error("Writing to local state is not allowed as it is read-only.");return o[r]=i,n==null||n(o),!0}})}const fastClone=e=>JSON.parse(JSON.stringify(e)),set=(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((r,i,a)=>Object(r[i])===r[i]?r[i]:r[i]=Math.abs(Number(o[a+1]))>>0===+o[a+1]?[]:{},e)[o[o.length-1]]=n,e},noop=()=>{};let safeDynamicRequire=noop;try{safeDynamicRequire=eval("require")}catch(e){}const getSyncValName=e=>`bldr_${e}_sync`,BUILDER_SET_STATE_NAME="BUILDER_SET_STATE",INJECTED_IVM_GLOBAL="BUILDER_IVM",REF_TO_PROXY_FN=`
1
+ "use strict";const jsxRuntime=require("react/jsx-runtime");require("react");const lruCache=require("lru-cache"),USE_CLIENT_BUNDLE=require("./USE_CLIENT_BUNDLE-94a936b5.cjs");require("next/navigation");const EMPTY_HTML_ELEMENTS=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),isEmptyElement=e=>typeof e=="string"&&EMPTY_HTML_ELEMENTS.has(e.toLowerCase()),TARGET="rsc",getClassPropName=()=>{switch(TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":return"class"}};function getBlockComponentOptions(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const MSG_PREFIX="[Builder.io]: ",logger={log:(...e)=>console.log(MSG_PREFIX,...e),error:(...e)=>console.error(MSG_PREFIX,...e),warn:(...e)=>console.warn(MSG_PREFIX,...e),debug:(...e)=>console.debug(MSG_PREFIX,...e)};function isBrowser(){return typeof window<"u"&&typeof document<"u"}const convertSearchParamsToQueryObject=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},normalizeSearchParams=e=>e instanceof URLSearchParams?convertSearchParamsToQueryObject(e):e,getSearchString=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function isIframe(){return isBrowser()&&window.self!==window.top}function isEditing(e){return isIframe()&&getSearchString(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const getLocation=()=>{if(isBrowser()){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},getUserAgent=()=>typeof navigator=="object"&&navigator.userAgent||"",getUserAttributes=()=>{const e=getUserAgent(),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()||TARGET==="reactNative"}},n=e.match(/Tablet|iPad/i),o=getLocation();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"}},getFunctionArguments=({builder:e,context:t,event:n,state:o})=>Object.entries({state:o,Builder:e,builder:e,context:t,event:n}),getBuilderGlobals=()=>({isEditing:isEditing(),isBrowser:isBrowser(),isServer:!isBrowser(),getUserAttributes:()=>getUserAttributes()}),parseCode=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,runInBrowser=({code:e,builder:t,context:n,event:o,localState:r,rootSetState:i,rootState:a})=>{const s=getFunctionArguments({builder:t,context:n,event:o,state:flattenState({rootState:a,localState:r,rootSetState:i})});return new Function(...s.map(([c])=>c),e)(...s.map(([,c])=>c))};function flattenState({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(o,r)=>{if(t&&r in t)return t[r];const i=o[r];return typeof i=="object"&&i!==null?flattenState({rootState:i,localState:void 0,rootSetState:n?a=>{o[r]=a,n(o)}:void 0}):i},set:(o,r,i)=>{if(t&&r in t)throw new Error("Writing to local state is not allowed as it is read-only.");return o[r]=i,n==null||n(o),!0}})}const fastClone=e=>JSON.parse(JSON.stringify(e)),set=(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((r,i,a)=>Object(r[i])===r[i]?r[i]:r[i]=Math.abs(Number(o[a+1]))>>0===+o[a+1]?[]:{},e)[o[o.length-1]]=n,e},noop=()=>{};let safeDynamicRequire=noop;try{safeDynamicRequire=eval("require")}catch(e){}const getSyncValName=e=>`bldr_${e}_sync`,BUILDER_SET_STATE_NAME="BUILDER_SET_STATE",INJECTED_IVM_GLOBAL="BUILDER_IVM",REF_TO_PROXY_FN=`
2
2
  var refToProxy = (obj) => {
3
3
  if (typeof obj !== 'object' || obj === null) {
4
4
  return obj;
@@ -171,7 +171,7 @@ output;
171
171
  )`,getUpdateVariantVisibilityScript=({contentId:e,variationId:t})=>`window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
172
172
  "${t}", "${e}", ${isHydrationTarget}
173
173
  )`;function InlinedScript(e){return jsxRuntime.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},id:e.id||""})}const getIdFromSearchParams=e=>{const t=e.get("preview"),n=e.get("overrides."+t);return n||logger.warn("No previewed ID found in search params."),n};function init(){globalThis._BUILDER_PREVIEW_LRU_CACHE||(globalThis._BUILDER_PREVIEW_LRU_CACHE=new lruCache.LRUCache({max:500,ttl:1e3*60*5}))}function getPreviewContent(e){init();const t=getIdFromSearchParams(e);return typeof t=="string"?globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t):void 0}function getGlobalThis(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:globalThis}function getFetch(){const e=getGlobalThis().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.
174
- 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 fetch$1=getFetch();function flatten(e,t=null,n="."){return Object.keys(e).reduce((o,r)=>{const i=e[r],a=[t,r].filter(Boolean).join(n);return[typeof i=="object",i!==null,!(Array.isArray(i)&&i.length===0)].every(Boolean)?{...o,...flatten(i,a,n)}:{...o,[a]:i}},{})}const DEFAULT_API_VERSION="v3",BUILDER_SEARCHPARAMS_PREFIX="builder.",BUILDER_OPTIONS_PREFIX="options.",getBuilderSearchParams=e=>{if(!e)return{};const t=normalizeSearchParams(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(BUILDER_SEARCHPARAMS_PREFIX)){const r=o.replace(BUILDER_SEARCHPARAMS_PREFIX,"").replace(BUILDER_OPTIONS_PREFIX,"");n[r]=t[o]}}),n},getBuilderSearchParamsFromWindow=()=>{if(!isBrowser())return{};const e=new URLSearchParams(window.location.search);return getBuilderSearchParams(e)},isPositiveNumber=e=>typeof e=="number"&&!isNaN(e)&&e>=0,generateContentUrl=e=>{const{limit:t=30,userAttributes:n,query:o,model:r,apiKey:i,enrich:a,locale:s,apiVersion:c=DEFAULT_API_VERSION,fields:u,omit:g,offset:l,cacheSeconds:f,staleCacheSeconds:p,sort:m,includeUnpublished:d}=e;if(!i)throw new Error("Missing API key");if(!["v3"].includes(c))throw new Error(`Invalid apiVersion: expected 'v3', received '${c}'`);const y=t!==1,h=new URL(`https://cdn.builder.io/api/${c}/content/${r}`);if(h.searchParams.set("apiKey",i),h.searchParams.set("limit",String(t)),h.searchParams.set("noTraverse",String(y)),h.searchParams.set("includeRefs",String(!0)),s&&h.searchParams.set("locale",s),a&&h.searchParams.set("enrich",String(a)),h.searchParams.set("omit",g||"meta.componentsUsed"),u&&h.searchParams.set("fields",u),Number.isFinite(l)&&l>-1&&h.searchParams.set("offset",String(Math.floor(l))),typeof d=="boolean"&&h.searchParams.set("includeUnpublished",String(d)),f&&isPositiveNumber(f)&&h.searchParams.set("cacheSeconds",String(f)),p&&isPositiveNumber(p)&&h.searchParams.set("staleCacheSeconds",String(p)),m){const b=flatten({sort:m});for(const x in b)h.searchParams.set(x,JSON.stringify(b[x]))}const S={...getBuilderSearchParamsFromWindow(),...normalizeSearchParams(e.options||{})},C=flatten(S);for(const b in C)h.searchParams.set(b,String(C[b]));if(n&&h.searchParams.set("userAttributes",JSON.stringify(n)),o){const b=flatten({query:o});for(const x in b)h.searchParams.set(x,JSON.stringify(b[x]))}return h},checkContentHasResults=e=>"results"in e;async function fetchOneEntry(e){const t=await fetchEntries({...e,limit:1});return t&&t[0]||null}const _fetchContent=async e=>{const t=generateContentUrl(e);return await(await fetch$1(t.href)).json()},_processContentResult=async(e,t,n=generateContentUrl(e))=>{const o=getDefaultCanTrack(e.canTrack);if(n.search.includes("preview=")){const i=[];for(const a of t.results){const s=getPreviewContent(n.searchParams);i.push(s||a)}t.results=i}if(!o||!(isBrowser()||TARGET==="reactNative"))return t.results;try{const i=[];for(const a of t.results)i.push(await handleABTesting({item:a,canTrack:o}));t.results=i}catch(i){logger.error("Could not process A/B tests. ",i)}return t.results};async function fetchEntries(e){try{const t=generateContentUrl(e),n=await _fetchContent(e);return checkContentHasResults(n)?_processContentResult(e,n):(logger.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return logger.error("Error fetching data. ",t),null}}function isPreviewing(e){if(!isBrowser())return!1;const t=getSearchString(e||window.location.search);return isEditing(t)?!1:t.indexOf("builder.preview=")!==-1}function uuidv4(){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 uuid(){return uuidv4().replace(/-/g,"")}const SESSION_LOCAL_STORAGE_KEY="builderSessionId",getSessionId=async({canTrack:e})=>{if(!e)return;const t=await getCookie({name:SESSION_LOCAL_STORAGE_KEY,canTrack:e});if(checkIsDefined(t))return t;{const n=createSessionId();return setSessionId({id:n,canTrack:e}),n}},createSessionId=()=>uuid(),setSessionId=({id:e,canTrack:t})=>setCookie({name:SESSION_LOCAL_STORAGE_KEY,value:e,canTrack:t}),getLocalStorage=()=>isBrowser()&&typeof localStorage<"u"?localStorage:void 0,getLocalStorageItem=({key:e,canTrack:t})=>{var n;try{return t?(n=getLocalStorage())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},setLocalStorageItem=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=getLocalStorage())==null||o.setItem(e,n))}catch(r){console.debug("[LocalStorage] SET error: ",r)}},VISITOR_LOCAL_STORAGE_KEY="builderVisitorId",getVisitorId=({canTrack:e})=>{if(!e)return;const t=getLocalStorageItem({key:VISITOR_LOCAL_STORAGE_KEY,canTrack:e});if(checkIsDefined(t))return t;{const n=createVisitorId();return setVisitorId({id:n,canTrack:e}),n}},createVisitorId=()=>uuid(),setVisitorId=({id:e,canTrack:t})=>setLocalStorageItem({key:VISITOR_LOCAL_STORAGE_KEY,value:e,canTrack:t}),getTrackingEventData=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await getSessionId({canTrack:e}),n=getVisitorId({canTrack:e});return{sessionId:t,visitorId:n}},createEvent=async({type:e,canTrack:t,apiKey:n,metadata:o,...r})=>({type:e,data:{...r,metadata:{url:location.href,...o},...await getTrackingEventData({canTrack:t}),userAttributes:getUserAttributes(),ownerId:n}});async function _track(e){if(!e.apiKey){logger.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!isEditing()&&(isBrowser()||TARGET==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await createEvent(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const track=e=>_track({...e,canTrack:!0});function round(e){return Math.round(e*1e3)/1e3}const findParentElement=(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},findBuilderParent=e=>findParentElement(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),computeOffset=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,r=e.clientY-n.top,i=round(o/n.width),a=round(r/n.height);return{x:i,y:a}},getInteractionPropertiesForEvent=e=>{const t=e.target,n=t&&findBuilderParent(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?computeOffset({event:e,target:t}):void 0,builderTargetOffset:n?computeOffset({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},DEFAULT_TRUSTED_HOSTS=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function isFromTrustedHost(e,t){const n=new URL(t.origin),o=n.hostname;return(e||DEFAULT_TRUSTED_HOSTS).findIndex(r=>r.startsWith("*.")?o.endsWith(r.slice(1)):r===o)>-1}const SDK_VERSION="0.14.8",registry={};function register(e,t){let n=registry[e];if(n||(n=registry[e]=[]),n.push(t),isBrowser()){const o={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(o,"*"),parent!==window&&window.postMessage(o,"*")}catch(r){console.debug("Could not postmessage",r)}}}const registerInsertMenu=()=>{register("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let isSetupForEditing=!1;const setupBrowserForEditing=(e={})=>{var t,n;isSetupForEditing||(isSetupForEditing=!0,isBrowser()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:TARGET,version:SDK_VERSION,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",o=>{var i,a;if(!isFromTrustedHost(e.trustedHosts,o))return;const{data:r}=o;if(r!=null&&r.type)switch(r.type){case"builder.evaluate":{const s=r.data.text,c=r.data.arguments||[],u=r.data.id,g=new Function(s);let l,f=null;try{l=g.apply(null,c)}catch(p){f=p}f?(i=window.parent)==null||i.postMessage({type:"builder.evaluateError",data:{id:u,error:f.message}},"*"):l&&typeof l.then=="function"?l.then(p=>{var m;(m=window.parent)==null||m.postMessage({type:"builder.evaluateResult",data:{id:u,result:p}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:l,id:u}},"*");break}}})))},createEditorListener=({model:e,trustedHosts:t,callbacks:n})=>o=>{if(!isFromTrustedHost(t,o))return;const{data:r}=o;if(r)switch(r.type){case"builder.configureSdk":{n.configureSdk(r.data);break}case"builder.triggerAnimation":{n.animation(r.data);break}case"builder.contentUpdate":{const i=r.data,a=i.key||i.alias||i.entry||i.modelName,s=i.data;a===e&&n.contentUpdate(s);break}}},subscribeToEditor=(e,t,n)=>{if(!isBrowser)return logger.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};setupBrowserForEditing();const o=createEditorListener({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",o),()=>{window.removeEventListener("message",o)}};function assign(e,...t){const n=Object(e);for(let o=1;o<arguments.length;o++){const r=arguments[o];if(r!=null)for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])}return n}const camelCaseToKebabCase=e=>e?e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`):"";function warnElementNotPresent(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function augmentAnimation(e,t){const n=getAllStylesUsed(e),o=getComputedStyle(t),r=e.steps[0].styles,i=e.steps[e.steps.length-1].styles,a=[r,i];for(const s of a)for(const c of n)c in s||(s[c]=o[c])}function getAllStylesUsed(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 triggerAnimation(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){warnElementNotPresent(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{augmentAnimation(e,n),n.style.transition="none",n.style.transitionDelay="0",assign(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),assign(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}const getCssFromFont=e=>{var i;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],o=e.fileUrl??((i=e==null?void 0:e.files)==null?void 0:i.regular);let r="";if(o&&t&&n&&(r+=`
174
+ 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 fetch$1=getFetch();function flatten(e,t=null,n="."){return Object.keys(e).reduce((o,r)=>{const i=e[r],a=[t,r].filter(Boolean).join(n);return[typeof i=="object",i!==null,!(Array.isArray(i)&&i.length===0)].every(Boolean)?{...o,...flatten(i,a,n)}:{...o,[a]:i}},{})}const DEFAULT_API_VERSION="v3",BUILDER_SEARCHPARAMS_PREFIX="builder.",BUILDER_OPTIONS_PREFIX="options.",getBuilderSearchParams=e=>{if(!e)return{};const t=normalizeSearchParams(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(BUILDER_SEARCHPARAMS_PREFIX)){const r=o.replace(BUILDER_SEARCHPARAMS_PREFIX,"").replace(BUILDER_OPTIONS_PREFIX,"");n[r]=t[o]}}),n},getBuilderSearchParamsFromWindow=()=>{if(!isBrowser())return{};const e=new URLSearchParams(window.location.search);return getBuilderSearchParams(e)},isPositiveNumber=e=>typeof e=="number"&&!isNaN(e)&&e>=0,generateContentUrl=e=>{const{limit:t=30,userAttributes:n,query:o,model:r,apiKey:i,enrich:a,locale:s,apiVersion:c=DEFAULT_API_VERSION,fields:u,omit:g,offset:l,cacheSeconds:f,staleCacheSeconds:p,sort:m,includeUnpublished:d}=e;if(!i)throw new Error("Missing API key");if(!["v3"].includes(c))throw new Error(`Invalid apiVersion: expected 'v3', received '${c}'`);const y=t!==1,h=new URL(`https://cdn.builder.io/api/${c}/content/${r}`);if(h.searchParams.set("apiKey",i),h.searchParams.set("limit",String(t)),h.searchParams.set("noTraverse",String(y)),h.searchParams.set("includeRefs",String(!0)),s&&h.searchParams.set("locale",s),a&&h.searchParams.set("enrich",String(a)),h.searchParams.set("omit",g||"meta.componentsUsed"),u&&h.searchParams.set("fields",u),Number.isFinite(l)&&l>-1&&h.searchParams.set("offset",String(Math.floor(l))),typeof d=="boolean"&&h.searchParams.set("includeUnpublished",String(d)),f&&isPositiveNumber(f)&&h.searchParams.set("cacheSeconds",String(f)),p&&isPositiveNumber(p)&&h.searchParams.set("staleCacheSeconds",String(p)),m){const b=flatten({sort:m});for(const x in b)h.searchParams.set(x,JSON.stringify(b[x]))}const S={...getBuilderSearchParamsFromWindow(),...normalizeSearchParams(e.options||{})},C=flatten(S);for(const b in C)h.searchParams.set(b,String(C[b]));if(n&&h.searchParams.set("userAttributes",JSON.stringify(n)),o){const b=flatten({query:o});for(const x in b)h.searchParams.set(x,JSON.stringify(b[x]))}return h},checkContentHasResults=e=>"results"in e;async function fetchOneEntry(e){const t=await fetchEntries({...e,limit:1});return t&&t[0]||null}const _fetchContent=async e=>{const t=generateContentUrl(e);return await(await fetch$1(t.href)).json()},_processContentResult=async(e,t,n=generateContentUrl(e))=>{const o=getDefaultCanTrack(e.canTrack);if(n.search.includes("preview=")){const i=[];for(const a of t.results){const s=getPreviewContent(n.searchParams);i.push(s||a)}t.results=i}if(!o||!(isBrowser()||TARGET==="reactNative"))return t.results;try{const i=[];for(const a of t.results)i.push(await handleABTesting({item:a,canTrack:o}));t.results=i}catch(i){logger.error("Could not process A/B tests. ",i)}return t.results};async function fetchEntries(e){try{const t=generateContentUrl(e),n=await _fetchContent(e);return checkContentHasResults(n)?_processContentResult(e,n):(logger.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return logger.error("Error fetching data. ",t),null}}function isPreviewing(e){if(!isBrowser())return!1;const t=getSearchString(e||window.location.search);return isEditing(t)?!1:t.indexOf("builder.preview=")!==-1}function uuidv4(){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 uuid(){return uuidv4().replace(/-/g,"")}const SESSION_LOCAL_STORAGE_KEY="builderSessionId",getSessionId=async({canTrack:e})=>{if(!e)return;const t=await getCookie({name:SESSION_LOCAL_STORAGE_KEY,canTrack:e});if(checkIsDefined(t))return t;{const n=createSessionId();return setSessionId({id:n,canTrack:e}),n}},createSessionId=()=>uuid(),setSessionId=({id:e,canTrack:t})=>setCookie({name:SESSION_LOCAL_STORAGE_KEY,value:e,canTrack:t}),getLocalStorage=()=>isBrowser()&&typeof localStorage<"u"?localStorage:void 0,getLocalStorageItem=({key:e,canTrack:t})=>{var n;try{return t?(n=getLocalStorage())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},setLocalStorageItem=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=getLocalStorage())==null||o.setItem(e,n))}catch(r){console.debug("[LocalStorage] SET error: ",r)}},VISITOR_LOCAL_STORAGE_KEY="builderVisitorId",getVisitorId=({canTrack:e})=>{if(!e)return;const t=getLocalStorageItem({key:VISITOR_LOCAL_STORAGE_KEY,canTrack:e});if(checkIsDefined(t))return t;{const n=createVisitorId();return setVisitorId({id:n,canTrack:e}),n}},createVisitorId=()=>uuid(),setVisitorId=({id:e,canTrack:t})=>setLocalStorageItem({key:VISITOR_LOCAL_STORAGE_KEY,value:e,canTrack:t}),getTrackingEventData=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await getSessionId({canTrack:e}),n=getVisitorId({canTrack:e});return{sessionId:t,visitorId:n}},createEvent=async({type:e,canTrack:t,apiKey:n,metadata:o,...r})=>({type:e,data:{...r,metadata:{url:location.href,...o},...await getTrackingEventData({canTrack:t}),userAttributes:getUserAttributes(),ownerId:n}});async function _track(e){if(!e.apiKey){logger.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!isEditing()&&(isBrowser()||TARGET==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await createEvent(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const track=e=>_track({...e,canTrack:!0});function round(e){return Math.round(e*1e3)/1e3}const findParentElement=(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},findBuilderParent=e=>findParentElement(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),computeOffset=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,r=e.clientY-n.top,i=round(o/n.width),a=round(r/n.height);return{x:i,y:a}},getInteractionPropertiesForEvent=e=>{const t=e.target,n=t&&findBuilderParent(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?computeOffset({event:e,target:t}):void 0,builderTargetOffset:n?computeOffset({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},DEFAULT_TRUSTED_HOSTS=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function isFromTrustedHost(e,t){const n=new URL(t.origin),o=n.hostname;return(e||DEFAULT_TRUSTED_HOSTS).findIndex(r=>r.startsWith("*.")?o.endsWith(r.slice(1)):r===o)>-1}const SDK_VERSION="0.14.9",registry={};function register(e,t){let n=registry[e];if(n||(n=registry[e]=[]),n.push(t),isBrowser()){const o={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(o,"*"),parent!==window&&window.postMessage(o,"*")}catch(r){console.debug("Could not postmessage",r)}}}const registerInsertMenu=()=>{register("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let isSetupForEditing=!1;const setupBrowserForEditing=(e={})=>{var t,n;isSetupForEditing||(isSetupForEditing=!0,isBrowser()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:TARGET,version:SDK_VERSION,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",o=>{var i,a;if(!isFromTrustedHost(e.trustedHosts,o))return;const{data:r}=o;if(r!=null&&r.type)switch(r.type){case"builder.evaluate":{const s=r.data.text,c=r.data.arguments||[],u=r.data.id,g=new Function(s);let l,f=null;try{l=g.apply(null,c)}catch(p){f=p}f?(i=window.parent)==null||i.postMessage({type:"builder.evaluateError",data:{id:u,error:f.message}},"*"):l&&typeof l.then=="function"?l.then(p=>{var m;(m=window.parent)==null||m.postMessage({type:"builder.evaluateResult",data:{id:u,result:p}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:l,id:u}},"*");break}}})))},createEditorListener=({model:e,trustedHosts:t,callbacks:n})=>o=>{if(!isFromTrustedHost(t,o))return;const{data:r}=o;if(r)switch(r.type){case"builder.configureSdk":{n.configureSdk(r.data);break}case"builder.triggerAnimation":{n.animation(r.data);break}case"builder.contentUpdate":{const i=r.data,a=i.key||i.alias||i.entry||i.modelName,s=i.data;a===e&&n.contentUpdate(s);break}}},subscribeToEditor=(e,t,n)=>{if(!isBrowser)return logger.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};setupBrowserForEditing();const o=createEditorListener({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",o),()=>{window.removeEventListener("message",o)}};function assign(e,...t){const n=Object(e);for(let o=1;o<arguments.length;o++){const r=arguments[o];if(r!=null)for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])}return n}const camelCaseToKebabCase=e=>e?e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`):"";function warnElementNotPresent(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function augmentAnimation(e,t){const n=getAllStylesUsed(e),o=getComputedStyle(t),r=e.steps[0].styles,i=e.steps[e.steps.length-1].styles,a=[r,i];for(const s of a)for(const c of n)c in s||(s[c]=o[c])}function getAllStylesUsed(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 triggerAnimation(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){warnElementNotPresent(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{augmentAnimation(e,n),n.style.transition="none",n.style.transitionDelay="0",assign(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),assign(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}const getCssFromFont=e=>{var i;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],o=e.fileUrl??((i=e==null?void 0:e.files)==null?void 0:i.regular);let r="";if(o&&t&&n&&(r+=`
175
175
  @font-face {
176
176
  font-family: "${t}";
177
177
  src: local("${n}"), url('${o}') format('woff2');
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./USE_CLIENT_BUNDLE-f9317c5f.cjs"),e=require("./bundle-77f045ce.cjs");require("react/jsx-runtime");require("react");require("./USE_SERVER_BUNDLE-e8d80664.cjs");require("next/navigation");require("lru-cache");exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.Symbol=e.Symbol;exports.Text=e.Text;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./USE_CLIENT_BUNDLE-94a936b5.cjs"),e=require("./bundle-955ea489.cjs");require("react/jsx-runtime");require("react");require("./USE_SERVER_BUNDLE-d58e151a.cjs");require("next/navigation");require("lru-cache");exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.Symbol=e.Symbol;exports.Text=e.Text;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
@@ -1,8 +1,8 @@
1
- import { c as n, F as m, d as c, S as p, V as g } from "./USE_CLIENT_BUNDLE-690f58c3.js";
2
- import { B as l, C as u, w as E, S, T as f, F as B, p as C, E as h, G as x, q as b, z as y, c as F, j as P, x as T, y as k, D as w, A as R } from "./bundle-001f0cdc.js";
1
+ import { c as n, F as m, d as c, S as p, V as g } from "./USE_CLIENT_BUNDLE-aa4a4eb2.js";
2
+ import { B as l, C as u, w as E, S, T as f, F as B, p as C, E as h, G as x, q as b, z as y, c as F, j as P, x as T, y as k, D as w, A as R } from "./bundle-49817803.js";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
- import "./USE_SERVER_BUNDLE-649f2942.js";
5
+ import "./USE_SERVER_BUNDLE-91781c1b.js";
6
6
  import "next/navigation";
7
7
  import "lru-cache";
8
8
  export {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-react-nextjs",
3
3
  "description": "Builder.io RSC SDK for NextJS App Directory",
4
- "version": "0.14.8",
4
+ "version": "0.14.9",
5
5
  "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/nextjs",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.14.8";
1
+ export declare const SDK_VERSION = "0.14.9";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.14.8";
1
+ export declare const SDK_VERSION = "0.14.9";
@@ -1,21 +0,0 @@
1
- "use client";"use strict";const n=require("react/jsx-runtime"),a=require("./bundle-eca4b0ba.cjs"),r=require("react"),D=require("./USE_SERVER_BUNDLE-d3d0c3a5.cjs"),V=require("next/navigation");function E(e){return n.jsx(n.Fragment,{children:a.isEmptyElement(e.TagName)?n.jsx(n.Fragment,{children:n.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):n.jsx(n.Fragment,{children:typeof e.TagName=="string"?n.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):n.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}function H(e){return n.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 U(e){return n.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 $(e){return n.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 O(e){function o(){var l;return"builder-blocks"+((l=e.blocks)!=null&&l.length?"":" no-blocks")}function g(){var l,m;a.isEditing()&&!((l=e.blocks)!=null&&l.length)&&((m=window.parent)==null||m.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var l,m;a.isEditing()&&!((l=e.blocks)!=null&&l.length)&&((m=window.parent)==null||m.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return n.jsxs(n.Fragment,{children:[n.jsx(e.BlocksWrapper,{className:o()+" props-blocks-wrapper-7cd1560e","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:l=>g(),onMouseEnter:l=>S(),onKeyPress:l=>g(),...e.BlocksWrapperProps,children:e.children}),n.jsx("style",{children:`.props-blocks-wrapper-7cd1560e {
2
- display: flex;
3
- flex-direction: column;
4
- align-items: stretch;
5
- }`})]})}function J(e){return n.jsx("span",{children:e.children})}function G(e){var l,m,h,v;function o(){var f;const s=e.image||e.src;if(!s||!(s.match(/builder\.io/)||s.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((f=e.image)!=null&&f.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),a.getSrcSet(s)}else if(e.image&&!e.srcset)return a.getSrcSet(s);return a.getSrcSet(s)}function g(){var b;return(b=o==null?void 0:o())!=null&&b.match(/builder\.io/)&&!e.noWebp?o().replace(/\?/g,"?format=webp&"):""}function S(){const b={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?b:void 0}return n.jsxs(n.Fragment,{children:[n.jsxs(n.Fragment,{children:[n.jsxs("picture",{children:[g()?n.jsx("source",{type:"image/webp",srcSet:g()}):null,n.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...S()},className:"builder-image"+(e.className?" "+e.className:"")+" img-a0c95e8c",src:e.image,srcSet:o(),sizes:e.sizes})]}),e.aspectRatio&&!((m=(l=e.builderBlock)==null?void 0:l.children)!=null&&m.length&&e.fitContent)?n.jsx("div",{className:"builder-image-sizer div-a0c95e8c",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(v=(h=e.builderBlock)==null?void 0:h.children)!=null&&v.length&&e.fitContent?n.jsx(n.Fragment,{children:e.children}):null,!e.fitContent&&e.children?n.jsx("div",{className:"div-a0c95e8c-2",children:e.children}):null]}),n.jsx("style",{children:`.img-a0c95e8c {
6
- opacity: 1;
7
- transition: opacity 0.2s ease-in-out;
8
- }.div-a0c95e8c {
9
- width: 100%;
10
- pointer-events: none;
11
- font-size: 0;
12
- }.div-a0c95e8c-2 {
13
- display: flex;
14
- flex-direction: column;
15
- align-items: stretch;
16
- position: absolute;
17
- top: 0;
18
- left: 0;
19
- width: 100%;
20
- height: 100%;
21
- }`})]})}function Q(e){return n.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}function X(e){const o=r.useRef(null),[g,S]=r.useState(()=>[]),[l,m]=r.useState(()=>[]);return r.useEffect(()=>{var v;if(!((v=o.current)!=null&&v.getElementsByTagName)||typeof window>"u")return;const h=o.current.getElementsByTagName("script");for(let b=0;b<h.length;b++){const s=h[b];if(s.src){if(g.includes(s.src))continue;g.push(s.src);const f=document.createElement("script");f.async=!0,f.src=s.src,document.head.appendChild(f)}else if(!s.type||["text/javascript","application/javascript","application/ecmascript"].includes(s.type)){if(l.includes(s.innerText))continue;try{l.push(s.innerText),new Function(s.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),n.jsx("div",{ref:o,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function Y(e){const o=r.useRef(null),[g,S]=r.useState(()=>[]),[l,m]=r.useState(()=>[]),[h,v]=r.useState(()=>!1);function b(){if(!o.current||!o.current.getElementsByTagName)return;const s=o.current.getElementsByTagName("script");for(let f=0;f<s.length;f++){const k=s[f];if(k.src&&!g.includes(k.src)){g.push(k.src);const y=document.createElement("script");y.async=!0,y.src=k.src,document.head.appendChild(y)}else if(a.isJsScript(k)&&!l.includes(k.innerText))try{l.push(k.innerText),new Function(k.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return r.useEffect(()=>{o.current&&!h&&(v(!0),b())},[o.current,h]),n.jsx("div",{className:"builder-embed",ref:o,dangerouslySetInnerHTML:{__html:e.content}})}function Z(e){return n.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},a.isEditing()&&e.imgSrc||"default-key")}function p(e){var S,l,m,h,v,b,s;function o(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function g(){return{...o()}}return n.jsxs("div",{style:{position:"relative"},children:[n.jsx("video",{className:"builder-video",...g(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(S=e.attributes)==null?void 0:S.style,objectFit:e.fit,objectPosition:e.position,zIndex:2,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},src:e.video||"no-src",poster:e.posterImage,children:e.lazyLoad?null:n.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((m=(l=e.builderBlock)==null?void 0:l.children)!=null&&m.length))?n.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(v=(h=e.builderBlock)==null?void 0:h.children)!=null&&v.length&&e.fitContent?n.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(s=(b=e.builderBlock)==null?void 0:b.children)!=null&&s.length&&!e.fitContent?n.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children}):null]})}const ee=r.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function te(e){var P,T,B,N,L,F,W;const o=r.useRef(null),[g,S]=r.useState(()=>0);r.useState(()=>!0);function l(i){var c,d;const t={...e.builderContextSignal.rootState,...i};e.builderContextSignal.rootSetState?(d=(c=e.builderContextSignal).rootSetState)==null||d.call(c,t):e.builderContextSignal.rootState=t}function m(i){var c,d,u,x,A;const t={...e.builderContextSignal.content,...i,data:{...(c=e.builderContextSignal.content)==null?void 0:c.data,...i==null?void 0:i.data},meta:{...(d=e.builderContextSignal.content)==null?void 0:d.meta,...i==null?void 0:i.meta,breakpoints:((u=i==null?void 0:i.meta)==null?void 0:u.breakpoints)||((A=(x=e.builderContextSignal.content)==null?void 0:x.meta)==null?void 0:A.breakpoints)}};D.postPreviewContent({value:t,key:t.id}).then(()=>{M.refresh()})}r.useState(()=>0);const[h,v]=r.useState(()=>!1),[b,s]=r.useState(()=>e.contentWrapper||"div");function f(i){return a.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:t=>{var u;const{breakpoints:c,contentId:d}=t;!d||d!==((u=e.builderContextSignal.content)==null?void 0:u.id)||c&&(m({meta:{breakpoints:c}}),S(g+1))},animation:t=>{a.triggerAnimation(t)},contentUpdate:t=>{m(t),S(g+1)}}})(i)}function k(){var t,c;const i=(c=(t=e.builderContextSignal.content)==null?void 0:t.data)==null?void 0:c.jsCode;i&&a.evaluate({code:i,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!1})}const[y,ne]=r.useState(()=>({})),[w,K]=r.useState(()=>!1);function q(i){var t,c;if(e.builderContextSignal.content){const d=(t=e.builderContextSignal.content)==null?void 0:t.testVariationId,u=(c=e.builderContextSignal.content)==null?void 0:c.id;a._track({type:"click",canTrack:a.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:d!==u?d:void 0,...a.getInteractionPropertiesForEvent(i),unique:!w})}w||K(!0)}function _(i){return i.replace(/{{([^}]+)}}/g,(t,c)=>String(a.evaluate({code:c,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!0})))}function z({url:i,key:t}){a.fetch(i).then(c=>c.json()).then(c=>{var u,x;const d={...e.builderContextSignal.rootState,[t]:c};(x=(u=e.builderContextSignal).rootSetState)==null||x.call(u,d),y[t]=!0}).catch(c=>{console.error("error fetching dynamic data",i,c)})}function j(){var t,c;const i=((c=(t=e.builderContextSignal.content)==null?void 0:t.data)==null?void 0:c.httpRequests)??{};Object.entries(i).forEach(([d,u])=>{if(u&&(!y[d]||a.isEditing())){const x=_(u);z({url:x,key:d})}})}function C(){a.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:a.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function R(i){S(g+1),window.addEventListener("message",f),a.registerInsertMenu(),a.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(t=>{var d;const c=a.createRegisterComponentMessage(t);(d=window.parent)==null||d.postMessage(c,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",C)}function I(i){const t=new URL(location.href).searchParams,c=t.get("builder.preview"),d=t.get(`builder.preview.${c}`),u=t.get("apiKey")||t.get("builder.space");c===e.model&&u===e.apiKey&&(!e.content||d===e.content.id)&&a.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(x=>{x&&m(x)})}const M=V.useRouter();return r.useEffect(()=>{var i;return(i=o.current)==null||i.addEventListener("initeditingbldr",R),()=>{var t;return(t=o.current)==null?void 0:t.removeEventListener("initeditingbldr",R)}},[]),r.useEffect(()=>{var i;return(i=o.current)==null||i.addEventListener("initpreviewingbldr",I),()=>{var t;return(t=o.current)==null?void 0:t.removeEventListener("initpreviewingbldr",I)}},[]),r.useEffect(()=>{var i,t;if(a.isBrowser()){if(a.isEditing()&&o.current&&o.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&a.getDefaultCanTrack(e.canTrack)){const d=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(t=e.builderContextSignal.content)==null?void 0:t.id,x=e.apiKey;a._track({type:"impression",canTrack:!0,contentId:u,apiKey:x,variationId:d!==u?d:void 0})}a.isPreviewing()}},[]),r.useEffect(()=>{e.apiKey||a.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),k(),j(),C()},[]),r.useEffect(()=>{},[e.content]),r.useEffect(()=>{a.isBrowser()&&(window.removeEventListener("message",f),window.addEventListener("message",f))},[h]),r.useEffect(()=>{k()},[(T=(P=e.builderContextSignal.content)==null?void 0:P.data)==null?void 0:T.jsCode]),r.useEffect(()=>{j()},[(N=(B=e.builderContextSignal.content)==null?void 0:B.data)==null?void 0:N.httpRequests]),r.useEffect(()=>{C()},[e.builderContextSignal.rootState]),r.useEffect(()=>{e.data&&l(e.data)},[e.data]),r.useEffect(()=>{e.locale&&l({locale:e.locale})},[e.locale]),r.useEffect(()=>()=>{a.isBrowser()&&(window.removeEventListener("message",f),window.removeEventListener("builder:component:stateChangeListenerActivated",C))},[]),n.jsx(ee.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?r.createElement(b,{key:g,ref:o,onClick:i=>q(i),"builder-content-id":(L=e.builderContextSignal.content)==null?void 0:L.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((F=e.content)==null?void 0:F.testVariationId)||((W=e.content)==null?void 0:W.id)}`},e.children):null})}exports.BlockWrapper=U;exports.BlocksWrapper=O;exports.Button=H;exports.CustomCode=X;exports.DynamicRenderer=E;exports.Embed=Y;exports.EnableEditor=te;exports.FragmentComponent=J;exports.Image=G;exports.ImgComponent=Z;exports.InteractiveElement=$;exports.SectionComponent=Q;exports.Video=p;
@@ -1,21 +0,0 @@
1
- "use client";"use strict";const n=require("react/jsx-runtime"),a=require("./bundle-07c68bbe.cjs"),r=require("react"),D=require("./USE_SERVER_BUNDLE-7cb08770.cjs"),V=require("next/navigation");function E(e){return n.jsx(n.Fragment,{children:a.isEmptyElement(e.TagName)?n.jsx(n.Fragment,{children:n.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):n.jsx(n.Fragment,{children:typeof e.TagName=="string"?n.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):n.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}function H(e){return n.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 U(e){return n.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 $(e){return n.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 O(e){function o(){var l;return"builder-blocks"+((l=e.blocks)!=null&&l.length?"":" no-blocks")}function g(){var l,m;a.isEditing()&&!((l=e.blocks)!=null&&l.length)&&((m=window.parent)==null||m.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var l,m;a.isEditing()&&!((l=e.blocks)!=null&&l.length)&&((m=window.parent)==null||m.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return n.jsxs(n.Fragment,{children:[n.jsx(e.BlocksWrapper,{className:o()+" props-blocks-wrapper-7cd1560e","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:l=>g(),onMouseEnter:l=>S(),onKeyPress:l=>g(),...e.BlocksWrapperProps,children:e.children}),n.jsx("style",{children:`.props-blocks-wrapper-7cd1560e {
2
- display: flex;
3
- flex-direction: column;
4
- align-items: stretch;
5
- }`})]})}function J(e){return n.jsx("span",{children:e.children})}function G(e){var l,m,h,v;function o(){var f;const s=e.image||e.src;if(!s||!(s.match(/builder\.io/)||s.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((f=e.image)!=null&&f.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),a.getSrcSet(s)}else if(e.image&&!e.srcset)return a.getSrcSet(s);return a.getSrcSet(s)}function g(){var b;return(b=o==null?void 0:o())!=null&&b.match(/builder\.io/)&&!e.noWebp?o().replace(/\?/g,"?format=webp&"):""}function S(){const b={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?b:void 0}return n.jsxs(n.Fragment,{children:[n.jsxs(n.Fragment,{children:[n.jsxs("picture",{children:[g()?n.jsx("source",{type:"image/webp",srcSet:g()}):null,n.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...S()},className:"builder-image"+(e.className?" "+e.className:"")+" img-a0c95e8c",src:e.image,srcSet:o(),sizes:e.sizes})]}),e.aspectRatio&&!((m=(l=e.builderBlock)==null?void 0:l.children)!=null&&m.length&&e.fitContent)?n.jsx("div",{className:"builder-image-sizer div-a0c95e8c",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(v=(h=e.builderBlock)==null?void 0:h.children)!=null&&v.length&&e.fitContent?n.jsx(n.Fragment,{children:e.children}):null,!e.fitContent&&e.children?n.jsx("div",{className:"div-a0c95e8c-2",children:e.children}):null]}),n.jsx("style",{children:`.img-a0c95e8c {
6
- opacity: 1;
7
- transition: opacity 0.2s ease-in-out;
8
- }.div-a0c95e8c {
9
- width: 100%;
10
- pointer-events: none;
11
- font-size: 0;
12
- }.div-a0c95e8c-2 {
13
- display: flex;
14
- flex-direction: column;
15
- align-items: stretch;
16
- position: absolute;
17
- top: 0;
18
- left: 0;
19
- width: 100%;
20
- height: 100%;
21
- }`})]})}function Q(e){return n.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}function X(e){const o=r.useRef(null),[g,S]=r.useState(()=>[]),[l,m]=r.useState(()=>[]);return r.useEffect(()=>{var v;if(!((v=o.current)!=null&&v.getElementsByTagName)||typeof window>"u")return;const h=o.current.getElementsByTagName("script");for(let b=0;b<h.length;b++){const s=h[b];if(s.src){if(g.includes(s.src))continue;g.push(s.src);const f=document.createElement("script");f.async=!0,f.src=s.src,document.head.appendChild(f)}else if(!s.type||["text/javascript","application/javascript","application/ecmascript"].includes(s.type)){if(l.includes(s.innerText))continue;try{l.push(s.innerText),new Function(s.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),n.jsx("div",{ref:o,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function Y(e){const o=r.useRef(null),[g,S]=r.useState(()=>[]),[l,m]=r.useState(()=>[]),[h,v]=r.useState(()=>!1);function b(){if(!o.current||!o.current.getElementsByTagName)return;const s=o.current.getElementsByTagName("script");for(let f=0;f<s.length;f++){const k=s[f];if(k.src&&!g.includes(k.src)){g.push(k.src);const y=document.createElement("script");y.async=!0,y.src=k.src,document.head.appendChild(y)}else if(a.isJsScript(k)&&!l.includes(k.innerText))try{l.push(k.innerText),new Function(k.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return r.useEffect(()=>{o.current&&!h&&(v(!0),b())},[o.current,h]),n.jsx("div",{className:"builder-embed",ref:o,dangerouslySetInnerHTML:{__html:e.content}})}function Z(e){return n.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},a.isEditing()&&e.imgSrc||"default-key")}function p(e){var S,l,m,h,v,b,s;function o(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function g(){return{...o()}}return n.jsxs("div",{style:{position:"relative"},children:[n.jsx("video",{className:"builder-video",...g(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(S=e.attributes)==null?void 0:S.style,objectFit:e.fit,objectPosition:e.position,zIndex:2,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},src:e.video||"no-src",poster:e.posterImage,children:e.lazyLoad?null:n.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((m=(l=e.builderBlock)==null?void 0:l.children)!=null&&m.length))?n.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(v=(h=e.builderBlock)==null?void 0:h.children)!=null&&v.length&&e.fitContent?n.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(s=(b=e.builderBlock)==null?void 0:b.children)!=null&&s.length&&!e.fitContent?n.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children}):null]})}const ee=r.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function te(e){var P,T,B,N,L,F,W;const o=r.useRef(null),[g,S]=r.useState(()=>0);r.useState(()=>!0);function l(i){var c,d;const t={...e.builderContextSignal.rootState,...i};e.builderContextSignal.rootSetState?(d=(c=e.builderContextSignal).rootSetState)==null||d.call(c,t):e.builderContextSignal.rootState=t}function m(i){var c,d,u,x,A;const t={...e.builderContextSignal.content,...i,data:{...(c=e.builderContextSignal.content)==null?void 0:c.data,...i==null?void 0:i.data},meta:{...(d=e.builderContextSignal.content)==null?void 0:d.meta,...i==null?void 0:i.meta,breakpoints:((u=i==null?void 0:i.meta)==null?void 0:u.breakpoints)||((A=(x=e.builderContextSignal.content)==null?void 0:x.meta)==null?void 0:A.breakpoints)}};D.postPreviewContent({value:t,key:t.id}).then(()=>{M.refresh()})}r.useState(()=>0);const[h,v]=r.useState(()=>!1),[b,s]=r.useState(()=>e.contentWrapper||"div");function f(i){return a.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:t=>{var u;const{breakpoints:c,contentId:d}=t;!d||d!==((u=e.builderContextSignal.content)==null?void 0:u.id)||c&&(m({meta:{breakpoints:c}}),S(g+1))},animation:t=>{a.triggerAnimation(t)},contentUpdate:t=>{m(t),S(g+1)}}})(i)}function k(){var t,c;const i=(c=(t=e.builderContextSignal.content)==null?void 0:t.data)==null?void 0:c.jsCode;i&&a.evaluate({code:i,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!1})}const[y,ne]=r.useState(()=>({})),[w,K]=r.useState(()=>!1);function q(i){var t,c;if(e.builderContextSignal.content){const d=(t=e.builderContextSignal.content)==null?void 0:t.testVariationId,u=(c=e.builderContextSignal.content)==null?void 0:c.id;a._track({type:"click",canTrack:a.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:d!==u?d:void 0,...a.getInteractionPropertiesForEvent(i),unique:!w})}w||K(!0)}function _(i){return i.replace(/{{([^}]+)}}/g,(t,c)=>String(a.evaluate({code:c,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!0})))}function z({url:i,key:t}){a.fetch(i).then(c=>c.json()).then(c=>{var u,x;const d={...e.builderContextSignal.rootState,[t]:c};(x=(u=e.builderContextSignal).rootSetState)==null||x.call(u,d),y[t]=!0}).catch(c=>{console.error("error fetching dynamic data",i,c)})}function j(){var t,c;const i=((c=(t=e.builderContextSignal.content)==null?void 0:t.data)==null?void 0:c.httpRequests)??{};Object.entries(i).forEach(([d,u])=>{if(u&&(!y[d]||a.isEditing())){const x=_(u);z({url:x,key:d})}})}function C(){a.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:a.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function R(i){S(g+1),window.addEventListener("message",f),a.registerInsertMenu(),a.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(t=>{var d;const c=a.createRegisterComponentMessage(t);(d=window.parent)==null||d.postMessage(c,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",C)}function I(i){const t=new URL(location.href).searchParams,c=t.get("builder.preview"),d=t.get(`builder.preview.${c}`),u=t.get("apiKey")||t.get("builder.space");c===e.model&&u===e.apiKey&&(!e.content||d===e.content.id)&&a.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(x=>{x&&m(x)})}const M=V.useRouter();return r.useEffect(()=>{var i;return(i=o.current)==null||i.addEventListener("initeditingbldr",R),()=>{var t;return(t=o.current)==null?void 0:t.removeEventListener("initeditingbldr",R)}},[]),r.useEffect(()=>{var i;return(i=o.current)==null||i.addEventListener("initpreviewingbldr",I),()=>{var t;return(t=o.current)==null?void 0:t.removeEventListener("initpreviewingbldr",I)}},[]),r.useEffect(()=>{var i,t;if(a.isBrowser()){if(a.isEditing()&&o.current&&o.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&a.getDefaultCanTrack(e.canTrack)){const d=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(t=e.builderContextSignal.content)==null?void 0:t.id,x=e.apiKey;a._track({type:"impression",canTrack:!0,contentId:u,apiKey:x,variationId:d!==u?d:void 0})}a.isPreviewing()}},[]),r.useEffect(()=>{e.apiKey||a.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),k(),j(),C()},[]),r.useEffect(()=>{},[e.content]),r.useEffect(()=>{a.isBrowser()&&(window.removeEventListener("message",f),window.addEventListener("message",f))},[h]),r.useEffect(()=>{k()},[(T=(P=e.builderContextSignal.content)==null?void 0:P.data)==null?void 0:T.jsCode]),r.useEffect(()=>{j()},[(N=(B=e.builderContextSignal.content)==null?void 0:B.data)==null?void 0:N.httpRequests]),r.useEffect(()=>{C()},[e.builderContextSignal.rootState]),r.useEffect(()=>{e.data&&l(e.data)},[e.data]),r.useEffect(()=>{e.locale&&l({locale:e.locale})},[e.locale]),r.useEffect(()=>()=>{a.isBrowser()&&(window.removeEventListener("message",f),window.removeEventListener("builder:component:stateChangeListenerActivated",C))},[]),n.jsx(ee.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?r.createElement(b,{key:g,ref:o,onClick:i=>q(i),"builder-content-id":(L=e.builderContextSignal.content)==null?void 0:L.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((F=e.content)==null?void 0:F.testVariationId)||((W=e.content)==null?void 0:W.id)}`},e.children):null})}exports.BlockWrapper=U;exports.BlocksWrapper=O;exports.Button=H;exports.CustomCode=X;exports.DynamicRenderer=E;exports.Embed=Y;exports.EnableEditor=te;exports.FragmentComponent=J;exports.Image=G;exports.ImgComponent=Z;exports.InteractiveElement=$;exports.SectionComponent=Q;exports.Video=p;
@@ -1,21 +0,0 @@
1
- "use client";"use strict";const n=require("react/jsx-runtime"),a=require("./bundle-77f045ce.cjs"),r=require("react"),D=require("./USE_SERVER_BUNDLE-e8d80664.cjs"),V=require("next/navigation");function E(e){return n.jsx(n.Fragment,{children:a.isEmptyElement(e.TagName)?n.jsx(n.Fragment,{children:n.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):n.jsx(n.Fragment,{children:typeof e.TagName=="string"?n.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):n.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}function H(e){return n.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 U(e){return n.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 $(e){return n.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 O(e){function o(){var l;return"builder-blocks"+((l=e.blocks)!=null&&l.length?"":" no-blocks")}function g(){var l,m;a.isEditing()&&!((l=e.blocks)!=null&&l.length)&&((m=window.parent)==null||m.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var l,m;a.isEditing()&&!((l=e.blocks)!=null&&l.length)&&((m=window.parent)==null||m.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return n.jsxs(n.Fragment,{children:[n.jsx(e.BlocksWrapper,{className:o()+" props-blocks-wrapper-7cd1560e","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:l=>g(),onMouseEnter:l=>S(),onKeyPress:l=>g(),...e.BlocksWrapperProps,children:e.children}),n.jsx("style",{children:`.props-blocks-wrapper-7cd1560e {
2
- display: flex;
3
- flex-direction: column;
4
- align-items: stretch;
5
- }`})]})}function J(e){return n.jsx("span",{children:e.children})}function G(e){var l,m,h,v;function o(){var f;const s=e.image||e.src;if(!s||!(s.match(/builder\.io/)||s.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((f=e.image)!=null&&f.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),a.getSrcSet(s)}else if(e.image&&!e.srcset)return a.getSrcSet(s);return a.getSrcSet(s)}function g(){var b;return(b=o==null?void 0:o())!=null&&b.match(/builder\.io/)&&!e.noWebp?o().replace(/\?/g,"?format=webp&"):""}function S(){const b={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?b:void 0}return n.jsxs(n.Fragment,{children:[n.jsxs(n.Fragment,{children:[n.jsxs("picture",{children:[g()?n.jsx("source",{type:"image/webp",srcSet:g()}):null,n.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...S()},className:"builder-image"+(e.className?" "+e.className:"")+" img-a0c95e8c",src:e.image,srcSet:o(),sizes:e.sizes})]}),e.aspectRatio&&!((m=(l=e.builderBlock)==null?void 0:l.children)!=null&&m.length&&e.fitContent)?n.jsx("div",{className:"builder-image-sizer div-a0c95e8c",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(v=(h=e.builderBlock)==null?void 0:h.children)!=null&&v.length&&e.fitContent?n.jsx(n.Fragment,{children:e.children}):null,!e.fitContent&&e.children?n.jsx("div",{className:"div-a0c95e8c-2",children:e.children}):null]}),n.jsx("style",{children:`.img-a0c95e8c {
6
- opacity: 1;
7
- transition: opacity 0.2s ease-in-out;
8
- }.div-a0c95e8c {
9
- width: 100%;
10
- pointer-events: none;
11
- font-size: 0;
12
- }.div-a0c95e8c-2 {
13
- display: flex;
14
- flex-direction: column;
15
- align-items: stretch;
16
- position: absolute;
17
- top: 0;
18
- left: 0;
19
- width: 100%;
20
- height: 100%;
21
- }`})]})}function Q(e){return n.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}function X(e){const o=r.useRef(null),[g,S]=r.useState(()=>[]),[l,m]=r.useState(()=>[]);return r.useEffect(()=>{var v;if(!((v=o.current)!=null&&v.getElementsByTagName)||typeof window>"u")return;const h=o.current.getElementsByTagName("script");for(let b=0;b<h.length;b++){const s=h[b];if(s.src){if(g.includes(s.src))continue;g.push(s.src);const f=document.createElement("script");f.async=!0,f.src=s.src,document.head.appendChild(f)}else if(!s.type||["text/javascript","application/javascript","application/ecmascript"].includes(s.type)){if(l.includes(s.innerText))continue;try{l.push(s.innerText),new Function(s.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),n.jsx("div",{ref:o,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function Y(e){const o=r.useRef(null),[g,S]=r.useState(()=>[]),[l,m]=r.useState(()=>[]),[h,v]=r.useState(()=>!1);function b(){if(!o.current||!o.current.getElementsByTagName)return;const s=o.current.getElementsByTagName("script");for(let f=0;f<s.length;f++){const k=s[f];if(k.src&&!g.includes(k.src)){g.push(k.src);const y=document.createElement("script");y.async=!0,y.src=k.src,document.head.appendChild(y)}else if(a.isJsScript(k)&&!l.includes(k.innerText))try{l.push(k.innerText),new Function(k.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return r.useEffect(()=>{o.current&&!h&&(v(!0),b())},[o.current,h]),n.jsx("div",{className:"builder-embed",ref:o,dangerouslySetInnerHTML:{__html:e.content}})}function Z(e){return n.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},a.isEditing()&&e.imgSrc||"default-key")}function p(e){var S,l,m,h,v,b,s;function o(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function g(){return{...o()}}return n.jsxs("div",{style:{position:"relative"},children:[n.jsx("video",{className:"builder-video",...g(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(S=e.attributes)==null?void 0:S.style,objectFit:e.fit,objectPosition:e.position,zIndex:2,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},src:e.video||"no-src",poster:e.posterImage,children:e.lazyLoad?null:n.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((m=(l=e.builderBlock)==null?void 0:l.children)!=null&&m.length))?n.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(v=(h=e.builderBlock)==null?void 0:h.children)!=null&&v.length&&e.fitContent?n.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(s=(b=e.builderBlock)==null?void 0:b.children)!=null&&s.length&&!e.fitContent?n.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children}):null]})}const ee=r.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function te(e){var P,T,B,N,L,F,W;const o=r.useRef(null),[g,S]=r.useState(()=>0);r.useState(()=>!0);function l(i){var c,d;const t={...e.builderContextSignal.rootState,...i};e.builderContextSignal.rootSetState?(d=(c=e.builderContextSignal).rootSetState)==null||d.call(c,t):e.builderContextSignal.rootState=t}function m(i){var c,d,u,x,A;const t={...e.builderContextSignal.content,...i,data:{...(c=e.builderContextSignal.content)==null?void 0:c.data,...i==null?void 0:i.data},meta:{...(d=e.builderContextSignal.content)==null?void 0:d.meta,...i==null?void 0:i.meta,breakpoints:((u=i==null?void 0:i.meta)==null?void 0:u.breakpoints)||((A=(x=e.builderContextSignal.content)==null?void 0:x.meta)==null?void 0:A.breakpoints)}};D.postPreviewContent({value:t,key:t.id}).then(()=>{M.refresh()})}r.useState(()=>0);const[h,v]=r.useState(()=>!1),[b,s]=r.useState(()=>e.contentWrapper||"div");function f(i){return a.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:t=>{var u;const{breakpoints:c,contentId:d}=t;!d||d!==((u=e.builderContextSignal.content)==null?void 0:u.id)||c&&(m({meta:{breakpoints:c}}),S(g+1))},animation:t=>{a.triggerAnimation(t)},contentUpdate:t=>{m(t),S(g+1)}}})(i)}function k(){var t,c;const i=(c=(t=e.builderContextSignal.content)==null?void 0:t.data)==null?void 0:c.jsCode;i&&a.evaluate({code:i,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!1})}const[y,ne]=r.useState(()=>({})),[w,K]=r.useState(()=>!1);function q(i){var t,c;if(e.builderContextSignal.content){const d=(t=e.builderContextSignal.content)==null?void 0:t.testVariationId,u=(c=e.builderContextSignal.content)==null?void 0:c.id;a._track({type:"click",canTrack:a.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:d!==u?d:void 0,...a.getInteractionPropertiesForEvent(i),unique:!w})}w||K(!0)}function _(i){return i.replace(/{{([^}]+)}}/g,(t,c)=>String(a.evaluate({code:c,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!0})))}function z({url:i,key:t}){a.fetch(i).then(c=>c.json()).then(c=>{var u,x;const d={...e.builderContextSignal.rootState,[t]:c};(x=(u=e.builderContextSignal).rootSetState)==null||x.call(u,d),y[t]=!0}).catch(c=>{console.error("error fetching dynamic data",i,c)})}function j(){var t,c;const i=((c=(t=e.builderContextSignal.content)==null?void 0:t.data)==null?void 0:c.httpRequests)??{};Object.entries(i).forEach(([d,u])=>{if(u&&(!y[d]||a.isEditing())){const x=_(u);z({url:x,key:d})}})}function C(){a.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:a.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function R(i){S(g+1),window.addEventListener("message",f),a.registerInsertMenu(),a.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(t=>{var d;const c=a.createRegisterComponentMessage(t);(d=window.parent)==null||d.postMessage(c,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",C)}function I(i){const t=new URL(location.href).searchParams,c=t.get("builder.preview"),d=t.get(`builder.preview.${c}`),u=t.get("apiKey")||t.get("builder.space");c===e.model&&u===e.apiKey&&(!e.content||d===e.content.id)&&a.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(x=>{x&&m(x)})}const M=V.useRouter();return r.useEffect(()=>{var i;return(i=o.current)==null||i.addEventListener("initeditingbldr",R),()=>{var t;return(t=o.current)==null?void 0:t.removeEventListener("initeditingbldr",R)}},[]),r.useEffect(()=>{var i;return(i=o.current)==null||i.addEventListener("initpreviewingbldr",I),()=>{var t;return(t=o.current)==null?void 0:t.removeEventListener("initpreviewingbldr",I)}},[]),r.useEffect(()=>{var i,t;if(a.isBrowser()){if(a.isEditing()&&o.current&&o.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&a.getDefaultCanTrack(e.canTrack)){const d=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(t=e.builderContextSignal.content)==null?void 0:t.id,x=e.apiKey;a._track({type:"impression",canTrack:!0,contentId:u,apiKey:x,variationId:d!==u?d:void 0})}a.isPreviewing()}},[]),r.useEffect(()=>{e.apiKey||a.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),k(),j(),C()},[]),r.useEffect(()=>{},[e.content]),r.useEffect(()=>{a.isBrowser()&&(window.removeEventListener("message",f),window.addEventListener("message",f))},[h]),r.useEffect(()=>{k()},[(T=(P=e.builderContextSignal.content)==null?void 0:P.data)==null?void 0:T.jsCode]),r.useEffect(()=>{j()},[(N=(B=e.builderContextSignal.content)==null?void 0:B.data)==null?void 0:N.httpRequests]),r.useEffect(()=>{C()},[e.builderContextSignal.rootState]),r.useEffect(()=>{e.data&&l(e.data)},[e.data]),r.useEffect(()=>{e.locale&&l({locale:e.locale})},[e.locale]),r.useEffect(()=>()=>{a.isBrowser()&&(window.removeEventListener("message",f),window.removeEventListener("builder:component:stateChangeListenerActivated",C))},[]),n.jsx(ee.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?r.createElement(b,{key:g,ref:o,onClick:i=>q(i),"builder-content-id":(L=e.builderContextSignal.content)==null?void 0:L.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((F=e.content)==null?void 0:F.testVariationId)||((W=e.content)==null?void 0:W.id)}`},e.children):null})}exports.BlockWrapper=U;exports.BlocksWrapper=O;exports.Button=H;exports.CustomCode=X;exports.DynamicRenderer=E;exports.Embed=Y;exports.EnableEditor=te;exports.FragmentComponent=J;exports.Image=G;exports.ImgComponent=Z;exports.InteractiveElement=$;exports.SectionComponent=Q;exports.Video=p;