@builder.io/sdk-react-nextjs 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{node/USE_CLIENT_BUNDLE-fcb61de5.cjs → browser/USE_CLIENT_BUNDLE-edb9d9fb.cjs} +3 -3
- package/lib/browser/{USE_CLIENT_BUNDLE-8a469a88.js → USE_CLIENT_BUNDLE-f0aeb87c.js} +4 -4
- package/lib/{edge/USE_SERVER_BUNDLE-da7c49b1.js → browser/USE_SERVER_BUNDLE-0ea3e848.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-b5ccb43b.cjs → browser/USE_SERVER_BUNDLE-3ae19308.cjs} +1 -1
- package/lib/browser/{bundle-6593f46a.cjs → bundle-48159788.cjs} +3 -3
- package/lib/browser/{bundle-f23172a5.js → bundle-9c29c9d1.js} +4 -6
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/{node/USE_CLIENT_BUNDLE-39759ac3.js → edge/USE_CLIENT_BUNDLE-1cacf6c8.js} +4 -4
- package/lib/{browser/USE_CLIENT_BUNDLE-bd42f34e.cjs → edge/USE_CLIENT_BUNDLE-97438f67.cjs} +3 -3
- package/lib/{node/USE_SERVER_BUNDLE-9a538e9b.cjs → edge/USE_SERVER_BUNDLE-3783d376.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-9cade0d5.js → edge/USE_SERVER_BUNDLE-668b44ba.js} +1 -1
- package/lib/edge/{bundle-bd18331d.js → bundle-28c9300c.js} +4 -6
- package/lib/edge/{bundle-7c571d18.cjs → bundle-b154d2ce.cjs} +3 -3
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-474e3242.js → node/USE_CLIENT_BUNDLE-674c3a2b.js} +4 -4
- package/lib/{edge/USE_CLIENT_BUNDLE-2ee2538b.cjs → node/USE_CLIENT_BUNDLE-da39207d.cjs} +3 -3
- package/lib/{browser/USE_SERVER_BUNDLE-b0fcc116.js → node/USE_SERVER_BUNDLE-1b907ae9.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-608eb1c6.cjs → node/USE_SERVER_BUNDLE-3c56bf9c.cjs} +1 -1
- package/lib/node/{bundle-49222e30.js → bundle-24b5f3b0.js} +9 -11
- package/lib/node/{bundle-ad89090d.cjs → bundle-a7c78519.cjs} +3 -3
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/types/targets.d.ts +1 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/types/targets.d.ts +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use client";"use strict";const t=require("react/jsx-runtime"),c=require("./bundle-
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),c=require("./bundle-48159788.cjs"),l=require("react"),V=require("./USE_SERVER_BUNDLE-3ae19308.cjs"),A=require("next/navigation");function D(e){return t.jsxs(t.Fragment,{children:[e.link?t.jsx(t.Fragment,{children:t.jsx("a",{...e.attributes,href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"button",children:e.text})}):t.jsx(t.Fragment,{children:t.jsx("button",{...e.attributes,style:e.attributes.style,className:e.attributes.className+" button-3ecc5438",children:e.text})}),t.jsx("style",{children:`.button-3ecc5438 {
|
|
2
2
|
all: unset;
|
|
3
3
|
}`})]})}function U(e){return t.jsxs(t.Fragment,{children:[" ",e.hasChildren?t.jsx(t.Fragment,{children:t.jsxs(e.Wrapper,{...c.getBlockProperties({block:e.block,context:e.context}),...c.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," "]})}):t.jsx(t.Fragment,{children:t.jsx(e.Wrapper,{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0})})})," "]})}function H(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:{...c.getBlockProperties({block:e.block,context:e.context}),...c.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 a(){var s;return"builder-blocks"+((s=e.blocks)!=null&&s.length?"":" no-blocks")}function g(){var s,f;c.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((f=window.parent)==null||f.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function x(){var s,f;c.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((f=window.parent)==null||f.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:a()+" props-blocks-wrapper-4f2c12d8","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:s=>g(),onMouseEnter:s=>x(),onKeyPress:s=>g(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-4f2c12d8 {
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: column;
|
|
6
6
|
align-items: stretch;
|
|
7
|
-
}`})]})}function J(e){return t.jsx("span",{children:e.children})}function $(e){var s,f,S,v;function a(){var
|
|
7
|
+
}`})]})}function J(e){return t.jsx("span",{children:e.children})}function $(e){var s,f,S,v;function a(){var b;const r=e.image||e.src;if(!r||!(r.match(/builder\.io/)||r.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((b=e.image)!=null&&b.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),c.getSrcSet(r)}else if(e.image&&!e.srcset)return c.getSrcSet(r);return c.getSrcSet(r)}function g(){var h;return(h=a==null?void 0:a())!=null&&h.match(/builder\.io/)&&!e.noWebp?a().replace(/\?/g,"?format=webp&"):""}function x(){const h={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?h:void 0}return t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[g()?t.jsx(t.Fragment,{children:t.jsx("source",{type:"image/webp",srcSet:g()})}):null,t.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?"presentation":void 0,style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...x()},className:"builder-image"+(e.className?" "+e.className:"")+" img-dbab4030",src:e.image,srcSet:a(),sizes:e.sizes})]}),e.aspectRatio&&!((f=(s=e.builderBlock)==null?void 0:s.children)!=null&&f.length&&e.fitContent)?t.jsx(t.Fragment,{children:t.jsx("div",{className:"builder-image-sizer div-dbab4030",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(v=(S=e.builderBlock)==null?void 0:S.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&e.children?t.jsx(t.Fragment,{children:t.jsx("div",{className:"div-dbab4030-2",children:e.children})}):null]}),t.jsx("style",{children:`.img-dbab4030 {
|
|
8
8
|
opacity: 1;
|
|
9
9
|
transition: opacity 0.2s ease-in-out;
|
|
10
10
|
}.div-dbab4030 {
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
left: 0;
|
|
21
21
|
width: 100%;
|
|
22
22
|
height: 100%;
|
|
23
|
-
}`})]})}function G(e){return t.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 Q(e){const a=l.useRef(null),[g,x]=l.useState(()=>[]),[s,f]=l.useState(()=>[]);return l.useEffect(()=>{var v;if(!((v=a.current)!=null&&v.getElementsByTagName)||typeof window>"u")return;const S=a.current.getElementsByTagName("script");for(let
|
|
23
|
+
}`})]})}function G(e){return t.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 Q(e){const a=l.useRef(null),[g,x]=l.useState(()=>[]),[s,f]=l.useState(()=>[]);return l.useEffect(()=>{var v;if(!((v=a.current)!=null&&v.getElementsByTagName)||typeof window>"u")return;const S=a.current.getElementsByTagName("script");for(let h=0;h<S.length;h++){const r=S[h];if(r.src){if(g.includes(r.src))continue;g.push(r.src);const b=document.createElement("script");b.async=!0,b.src=r.src,document.head.appendChild(b)}else if(!r.type||["text/javascript","application/javascript","application/ecmascript"].includes(r.type)){if(s.includes(r.innerText))continue;try{s.push(r.innerText),new Function(r.innerText)()}catch(b){console.warn("`CustomCode`: Error running script:",b)}}}},[]),t.jsx("div",{ref:a,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function X(e){const a=l.useRef(null),[g,x]=l.useState(()=>[]),[s,f]=l.useState(()=>[]),[S,v]=l.useState(()=>!1);function h(){if(!a.current||!a.current.getElementsByTagName)return;const r=a.current.getElementsByTagName("script");for(let b=0;b<r.length;b++){const k=r[b];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(c.isJsScript(k)&&!s.includes(k.innerText))try{s.push(k.innerText),new Function(k.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return l.useEffect(()=>{a.current&&!S&&(v(!0),h())},[a.current,S]),t.jsx("div",{className:"builder-embed",ref:a,dangerouslySetInnerHTML:{__html:e.content}})}function Y(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},c.isEditing()&&e.imgSrc||"default-key")}function Z(e){var x,s,f,S,v,h,r;function a(){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{...a()}}return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("video",{className:"builder-video",...g(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(x=e.attributes)==null?void 0:x.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:t.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((f=(s=e.builderBlock)==null?void 0:s.children)!=null&&f.length))?t.jsx(t.Fragment,{children:t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}})}):null,(v=(S=e.builderBlock)==null?void 0:S.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children:t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children})}):null,(r=(h=e.builderBlock)==null?void 0:h.children)!=null&&r.length&&!e.fitContent?t.jsx(t.Fragment,{children:t.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 p=l.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function ee(e){var I,P,B,F,T,N,L;const a=l.useRef(null),[g,x]=l.useState(()=>0);function s(n){var o,d,u,m,W;const i={...e.builderContextSignal.content,...n,data:{...(o=e.builderContextSignal.content)==null?void 0:o.data,...n==null?void 0:n.data},meta:{...(d=e.builderContextSignal.content)==null?void 0:d.meta,...n==null?void 0:n.meta,breakpoints:((u=n==null?void 0:n.meta)==null?void 0:u.breakpoints)||((W=(m=e.builderContextSignal.content)==null?void 0:m.meta)==null?void 0:W.breakpoints)}};V.postPreviewContent({value:i,key:i.id}).then(()=>{M.refresh()})}l.useState(()=>0);const[f,S]=l.useState(()=>!1),[v,h]=l.useState(()=>e.contentWrapper||"div");function r(n){var o;const{data:i}=n;if(i)switch(i.type){case"builder.configureSdk":{const d=i.data,{breakpoints:u,contentId:m}=d;if(!m||m!==((o=e.builderContextSignal.content)==null?void 0:o.id))return;u&&s({meta:{breakpoints:u}}),x(g+1);break}case"builder.contentUpdate":{const d=i.data,u=d.key||d.alias||d.entry||d.modelName,m=d.data;u===e.model&&(s(m),x(g+1));break}}}function b(){var i,o;const n=(o=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:o.jsCode;n&&c.evaluate({code:n,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[k,y]=l.useState(()=>({})),[E,K]=l.useState(()=>!1);function q(n){var i,o;if(e.builderContextSignal.content){const d=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(o=e.builderContextSignal.content)==null?void 0:o.id;c._track({type:"click",canTrack:c.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:d!==u?d:void 0,...c.getInteractionPropertiesForEvent(n),unique:!E})}E||K(!0)}function _(n){return n.replace(/{{([^}]+)}}/g,(i,o)=>c.evaluate({code:o,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function z({url:n,key:i}){c.fetch(n).then(o=>o.json()).then(o=>{var u,m;const d={...e.builderContextSignal.rootState,[i]:o};(m=(u=e.builderContextSignal).rootSetState)==null||m.call(u,d),k[i]=!0}).catch(o=>{console.error("error fetching dynamic data",n,o)})}function j(){var i,o;const n=((o=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:o.httpRequests)??{};Object.entries(n).forEach(([d,u])=>{if(u&&(!k[d]||c.isEditing())){const m=_(u);z({url:m,key:d})}})}function C(){c.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:c.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function w(n){x(g+1),window.addEventListener("message",r),c.registerInsertMenu(),c.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.includeRefs?{includeRefs:e.includeRefs}:{},...e.enrich?{enrich:e.enrich}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(i=>{var d;const o=c.createRegisterComponentMessage(i);(d=window.parent)==null||d.postMessage(o,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",C)}function R(n){const i=new URL(location.href).searchParams,o=i.get("builder.preview"),d=i.get(`builder.preview.${o}`),u=i.get("apiKey")||i.get("builder.space");o===e.model&&u===e.apiKey&&(!e.content||d===e.content.id)&&c.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(m=>{m&&s(m)})}const M=A.useRouter();return l.useEffect(()=>{var n;return(n=a.current)==null||n.addEventListener("initeditingbldr",w),()=>{var i;return(i=a.current)==null?void 0:i.removeEventListener("initeditingbldr",w)}},[]),l.useEffect(()=>{var n;return(n=a.current)==null||n.addEventListener("initpreviewingbldr",R),()=>{var i;return(i=a.current)==null?void 0:i.removeEventListener("initpreviewingbldr",R)}},[]),l.useEffect(()=>{var n,i;if(c.isBrowser()){if(c.isEditing()&&a.current&&a.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&c.getDefaultCanTrack(e.canTrack)){const d=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,u=(i=e.builderContextSignal.content)==null?void 0:i.id,m=e.apiKey;c._track({type:"impression",canTrack:!0,contentId:u,apiKey:m,variationId:d!==u?d:void 0})}c.isPreviewing()&&a.current}},[]),l.useEffect(()=>{e.apiKey||c.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),b(),j(),C()},[]),l.useEffect(()=>{},[e.content]),l.useEffect(()=>{c.isBrowser()&&(window.removeEventListener("message",r),window.addEventListener("message",r))},[f]),l.useEffect(()=>{b()},[(P=(I=e.builderContextSignal.content)==null?void 0:I.data)==null?void 0:P.jsCode,e.builderContextSignal.rootState]),l.useEffect(()=>{j()},[(F=(B=e.builderContextSignal.content)==null?void 0:B.data)==null?void 0:F.httpRequests]),l.useEffect(()=>{C()},[e.builderContextSignal.rootState]),l.useEffect(()=>()=>{c.isBrowser()&&(window.removeEventListener("message",r),window.removeEventListener("builder:component:stateChangeListenerActivated",C))},[]),t.jsx(p.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(t.Fragment,{children:l.createElement(v,{key:g,ref:a,onClick:n=>q(n),"builder-content-id":(T=e.builderContextSignal.content)==null?void 0:T.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((N=e.content)==null?void 0:N.testVariationId)||((L=e.content)==null?void 0:L.id)}`},e.children)}):null})}exports.BlockWrapper=U;exports.BlocksWrapper=O;exports.Button=D;exports.CustomCode=Q;exports.Embed=X;exports.EnableEditor=ee;exports.FragmentComponent=J;exports.Image=$;exports.ImgComponent=Y;exports.InteractiveElement=H;exports.SectionComponent=G;exports.Video=Z;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as C, Fragment as m, jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import { g as T, a as B, i as E, b as R, c as Y, d as P, e as U, _ as H, f as Z, l as p, h as O, j as ee, k as te, r as ne, s as ie, m as ae, n as ce, o as re } from "./bundle-
|
|
3
|
+
import { g as T, a as B, i as E, b as R, c as Y, d as P, e as U, _ as H, f as Z, l as p, h as O, j as ee, k as te, r as ne, s as ie, m as ae, n as ce, o as re } from "./bundle-9c29c9d1.js";
|
|
4
4
|
import { useRef as N, useState as k, useEffect as v, createContext as oe, createElement as le } from "react";
|
|
5
|
-
import { p as de } from "./USE_SERVER_BUNDLE-
|
|
5
|
+
import { p as de } from "./USE_SERVER_BUNDLE-0ea3e848.js";
|
|
6
6
|
import { useRouter as se } from "next/navigation";
|
|
7
7
|
function Se(e) {
|
|
8
8
|
return /* @__PURE__ */ C(m, { children: [
|
|
@@ -20,11 +20,11 @@ function Se(e) {
|
|
|
20
20
|
{
|
|
21
21
|
...e.attributes,
|
|
22
22
|
style: e.attributes.style,
|
|
23
|
-
className: e.attributes.className + " button-
|
|
23
|
+
className: e.attributes.className + " button-3ecc5438",
|
|
24
24
|
children: e.text
|
|
25
25
|
}
|
|
26
26
|
) }),
|
|
27
|
-
/* @__PURE__ */ i("style", { children: `.button-
|
|
27
|
+
/* @__PURE__ */ i("style", { children: `.button-3ecc5438 {
|
|
28
28
|
all: unset;
|
|
29
29
|
}` })
|
|
30
30
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use server";"use strict";const n=require("./bundle-
|
|
1
|
+
"use server";"use strict";const n=require("./bundle-48159788.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,11 +1,11 @@
|
|
|
1
|
-
"use strict";const Ne=require("lru-cache"),s=require("react/jsx-runtime"),_e=require("react"),S=require("./USE_CLIENT_BUNDLE-
|
|
1
|
+
"use strict";const Ne=require("lru-cache"),s=require("react/jsx-runtime"),_e=require("react"),S=require("./USE_CLIENT_BUNDLE-edb9d9fb.cjs");require("next/navigation");function Le(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const B="[Builder.io]: ",k={log:(...e)=>console.log(B,...e),error:(...e)=>console.error(B,...e),warn:(...e)=>console.warn(B,...e),debug:(...e)=>console.debug(B,...e)};function x(){return typeof window<"u"&&typeof document<"u"}const I="rsc";function Ue(){return x()&&window.self!==window.top}function $(){return Ue()&&window.location.search.indexOf("builder.frameEditing=")!==-1}const Me=()=>{if(x()){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},De=()=>typeof navigator=="object"&&navigator.userAgent||"",ue=()=>{const e=De(),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()||I==="reactNative"}},n=e.match(/Tablet|iPad/i),o=Me();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"}},Ke=({builder:e,context:t,event:n,state:o})=>Object.entries({state:o,Builder:e,builder:e,context:t,event:n}),He=()=>({isEditing:$(),isBrowser:x(),isServer:!x(),getUserAttributes:()=>ue()}),ze=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,Q=({code:e,builder:t,context:n,event:o,localState:i,rootSetState:r,rootState:a})=>{const c=Ke({builder:t,context:n,event:o,state:qe(a,i,r)});return new Function(...c.map(([l])=>l),e)(...c.map(([,l])=>l))};function qe(e,t,n){if(e===t)throw new Error("rootState === localState");return new Proxy(e,{get:(o,i)=>t&&i in t?t[i]:e[i],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 e[i]=r,n==null||n(e),!0}})}const Ge=e=>(x(),Q(e));function F({code:e,context:t,localState:n,rootState:o,rootSetState:i,event:r,isExpression:a=!0}){if(e===""){k.warn("Skipping evaluation of empty code block.");return}const c={code:ze(e,{isExpression:a}),builder:He(),context:t,event:r,rootSetState:i,rootState:o,localState:n};try{return Ge(c)}catch(l){k.error("Failed code evaluation: "+l.message,{code:e});return}}const R=e=>JSON.parse(JSON.stringify(e)),Je=(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 Ye=({block:e,context:t,localState:n,rootState:o,rootSetState:i})=>{if(!e.bindings)return e;const r=R(e),a={...r,properties:{...r.properties},actions:{...r.actions}};for(const c in e.bindings){const l=e.bindings[c],m=F({code:l,localState:n,rootState:o,rootSetState:i,context:t});Je(a,c,m)}return a};function j({block:e,context:t,shouldEvaluateBindings:n,localState:o,rootState:i,rootSetState:r}){const a=e;return n?Ye({block:a,localState:o,rootState:i,rootSetState:r,context:t}):a}const Qe=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],U=e=>typeof e=="string"&&Qe.includes(e.toLowerCase()),Xe=({block:e,context:t,registeredComponents:n})=>{var r;const o=(r=j({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(`
|
|
2
2
|
Could not find a registered component named "${o}".
|
|
3
3
|
If you registered it, is the file that registered it imported by the file that needs to render it?`)},Ze=({block:e,context:t})=>{const{repeat:n,...o}=e;if(!(n!=null&&n.collection))return;const i=F({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context});if(!Array.isArray(i))return;const r=n.collection.split(".").pop(),a=n.itemName||(r?r+"Item":"item");return i.map((l,m)=>({context:{...t,localState:{...t.localState,$index:m,$item:l,[a]:l,[`$${a}Index`]:m}},block:o}))},me={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},X=(e,t=me)=>`@media (max-width: ${t[e].max}px)`,fe=({small:e,medium:t})=>{const n=R(me);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},et=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),w=e=>e!=null,he=e=>Object.entries(e).map(([n,o])=>{if(typeof o=="string")return`${et(n)}: ${o};`}).filter(w),tt=e=>he(e).join(`
|
|
4
4
|
`),M=({mediaQuery:e,className:t,styles:n})=>{const o=`.${t} {
|
|
5
5
|
${tt(n)}
|
|
6
6
|
}`;return e?`${e} {
|
|
7
7
|
${o}
|
|
8
|
-
}`:o};function O(e){return s.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},id:e.id})}function H(e){const t=function(){const i=j({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 d;const i=j({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,c=fe(((d=a==null?void 0:a.meta)==null?void 0:d.breakpoints)||{}),l=r==null?void 0:r.large,m=r==null?void 0:r.medium,h=r==null?void 0:r.small,g=i.id;if(!g)return"";const y=l?M({className:g,styles:l}):"",u=m?M({className:g,styles:m,mediaQuery:X("medium",c)}):"",f=h?M({className:g,styles:h,mediaQuery:X("small",c)}):"";return[y,u,f].join(" ")};return s.jsx(s.Fragment,{children:n()&&t()?s.jsx(s.Fragment,{children:s.jsx(O,{styles:n()})}):null})}function nt(e){return e.charAt(0).toUpperCase()+e.slice(1)}const ot=e=>`on${nt(e)}`,it=(e,t)=>n=>F({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1});function rt(e){const t={},n=e.block.actions??{};for(const o in n){if(!n.hasOwnProperty(o))continue;const i=n[o];let r=ot(o);if(e.stripPrefix)switch(I){case"
|
|
8
|
+
}`:o};function O(e){return s.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},id:e.id})}function H(e){const t=function(){const i=j({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 d;const i=j({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,c=fe(((d=a==null?void 0:a.meta)==null?void 0:d.breakpoints)||{}),l=r==null?void 0:r.large,m=r==null?void 0:r.medium,h=r==null?void 0:r.small,g=i.id;if(!g)return"";const y=l?M({className:g,styles:l}):"",u=m?M({className:g,styles:m,mediaQuery:X("medium",c)}):"",f=h?M({className:g,styles:h,mediaQuery:X("small",c)}):"";return[y,u,f].join(" ")};return s.jsx(s.Fragment,{children:n()&&t()?s.jsx(s.Fragment,{children:s.jsx(O,{styles:n()})}):null})}function nt(e){return e.charAt(0).toUpperCase()+e.slice(1)}const ot=e=>`on${nt(e)}`,it=(e,t)=>n=>F({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1});function rt(e){const t={},n=e.block.actions??{};for(const o in n){if(!n.hasOwnProperty(o))continue;const i=n[o];let r=ot(o);if(e.stripPrefix)switch(I){case"vue":r=r.replace("v-on:","");break;case"svelte":r=r.replace("on:","");break}t[r]=it(i,e)}return t}function at({properties:e}){return e.className=e.class,delete e.class,e}const st=e=>({href:e.href});function ge({block:e,context:t}){var o;const n={...st(e),...e.properties,"builder-id":e.id,style:e.style?ct(e.style):void 0,class:[e.id,"builder-block",e.class,(o=e.properties)==null?void 0:o.class].filter(Boolean).join(" ")};return at({properties:n,context:t,block:e})}function ct(e){switch(I){case"svelte":case"vue":case"solid":return he(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const lt=({componentOptions:e,builderBlock:t,context:n,componentRef:o,includeBlockProps:i,isInteractive:r,contextValue:a})=>r?{Wrapper:o,block:t,context:n,wrapperProps:e}:{...e,...i?{attributes:ge({block:t,context:a})}:{}};function Z(e){var n,o;const t=e.isInteractive?S.InteractiveElement:e.componentRef;return s.jsx(s.Fragment,{children:e.componentRef?s.jsx(s.Fragment,{children:s.jsxs(t,{...lt({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:[(n=e.blockChildren)==null?void 0:n.map(i=>s.jsx(N,{block:i,context:e.context,registeredComponents:e.registeredComponents},"block-"+i.id)),(o=e.blockChildren)==null?void 0:o.map(i=>s.jsx(H,{block:i,context:e.context},"block-style-"+i.id))]})}):null})}function dt(e){const t=e.repeatContext;return s.jsx(N,{block:e.block,context:t,registeredComponents:e.registeredComponents})}function N(e){var m,h,g,y;const t=function(){return Xe({block:e.block,context:e.context,registeredComponents:e.registeredComponents})},n=function(){return Ze({block:e.block,context:e.context})},o=function(){var f;return(f=e.block.repeat)!=null&&f.collection?e.block:j({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})},i=function(){return e.block.tagName||"div"},r=function(){var b,v;if((b=e.block.repeat)!=null&&b.collection)return!!((v=n())!=null&&v.length);const f="hide"in o()?o().hide:!1;return("show"in o()?o().show:!0)&&!f},a=function(){var d;return!((d=t())!=null&&d.component)&&!n()?o().children??[]:[]},c=function(){var f,d,b,v,p;return{blockChildren:o().children??[],componentRef:(f=t())==null?void 0:f.component,componentOptions:{...Le(o()),builderContext:e.context,...((d=t())==null?void 0:d.name)==="Symbol"||((b=t())==null?void 0:b.name)==="Columns"?{builderComponents:e.registeredComponents}:{}},context:l,registeredComponents:e.registeredComponents,builderBlock:o(),includeBlockProps:((v=t())==null?void 0:v.noWrap)===!0,isInteractive:!((p=t())!=null&&p.isRSC)}},l=e.context;return s.jsx(s.Fragment,{children:r()?s.jsx(s.Fragment,{children:(m=t())!=null&&m.noWrap?s.jsx(s.Fragment,{children:s.jsx(Z,{componentRef:c().componentRef,componentOptions:c().componentOptions,blockChildren:c().blockChildren,context:c().context,registeredComponents:c().registeredComponents,builderBlock:c().builderBlock,includeBlockProps:c().includeBlockProps,isInteractive:c().isInteractive})}):s.jsxs(s.Fragment,{children:[U(i())?s.jsx(s.Fragment,{children:s.jsx(S.BlockWrapper,{Wrapper:i(),block:o(),context:e.context,hasChildren:!1})}):null,!U(i())&&n()?s.jsx(s.Fragment,{children:(h=n())==null?void 0:h.map((u,f)=>s.jsx(dt,{repeatContext:u.context,block:u.block,registeredComponents:e.registeredComponents},f))}):null,!U(i())&&!n()?s.jsx(s.Fragment,{children:s.jsxs(S.BlockWrapper,{Wrapper:i(),block:o(),context:e.context,hasChildren:!0,children:[s.jsx(Z,{componentRef:c().componentRef,componentOptions:c().componentOptions,blockChildren:c().blockChildren,context:c().context,registeredComponents:c().registeredComponents,builderBlock:c().builderBlock,includeBlockProps:c().includeBlockProps,isInteractive:c().isInteractive}),(g=a())==null?void 0:g.map(u=>s.jsx(N,{block:u,context:l,registeredComponents:e.registeredComponents},"block-"+u.id)),(y=a())==null?void 0:y.map(u=>s.jsx(H,{block:u,context:l},"block-style-"+u.id))]})}):null]})}):null})}function _(e){var t,n,o,i;return s.jsxs(S.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?s.jsx(s.Fragment,{children:(o=e.blocks)==null?void 0:o.map(r=>s.jsx(N,{block:r,context:e.context,registeredComponents:e.registeredComponents},"render-block-"+r.id))}):null,e.blocks?s.jsx(s.Fragment,{children:(i=e.blocks)==null?void 0:i.map(r=>s.jsx(H,{block:r,context:e.context},"block-style-"+r.id))}):null]})}function pe(e){var u;const t=typeof e.space=="number"?e.space||0:20,n=e.columns||[],o=e.stackColumnsAt||"tablet",i=function(d){var b;return((b=n[d])==null?void 0:b.width)||100/n.length},r=function(d){const b=t*(n.length-1)/n.length;return`calc(${i(d)}% - ${b}px)`},a=function({stackedStyle:d,desktopStyle:b}){return o==="tablet"?d:b},c=function({stackedStyle:d,desktopStyle:b}){return o==="never"?b:d},l=e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column",m=function(){return{"--flex-dir":l,"--flex-dir-tablet":a({stackedStyle:l,desktopStyle:"row"})}},h=function(d){const b=d===0?0:t,v=r(d),p=`${b}px`,P="100%",E=0;return{width:v,["marginLeft"]:p,"--column-width-mobile":c({stackedStyle:P,desktopStyle:v}),"--column-margin-left-mobile":c({stackedStyle:E,desktopStyle:p}),"--column-width-tablet":a({stackedStyle:P,desktopStyle:v}),"--column-margin-left-tablet":a({stackedStyle:E,desktopStyle:p})}},g=function(d){var v,p;return fe(((p=(v=e.builderContext.content)==null?void 0:v.meta)==null?void 0:p.breakpoints)||{})[d].max},y=function(){return`
|
|
9
9
|
@media (max-width: ${g("medium")}px) {
|
|
10
10
|
.${e.builderBlock.id}-breakpoints {
|
|
11
11
|
flex-direction: var(--flex-dir-tablet);
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
)`,qt=({contentId:e,variationId:t})=>`window.${Ie}(
|
|
136
136
|
"${t}", "${e}", ${Ee}
|
|
137
137
|
)`;function K(e){return s.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},id:e.id||""})}const Gt=e=>{const t=e.get("preview"),n=e.get("overrides."+t);return n||k.warn("No previewed ID found in search params."),n};function Te(){globalThis._BUILDER_PREVIEW_LRU_CACHE||(globalThis._BUILDER_PREVIEW_LRU_CACHE=new Ne.LRUCache({max:500,ttl:1e3*60*5}))}function Jt(e){Te();const t=Gt(e);return typeof t=="string"?globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t):void 0}function Yt(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:globalThis}function Qt(){const e=Yt().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.
|
|
138
|
-
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 Re=Qt();function V(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,...V(r,a,n)}:{...o,[a]:r}},{})}const Xt="v3",oe="builder.",Zt="options.",en=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},q=e=>{if(!e)return{};const t=Pe(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(oe)){const i=o.replace(oe,"").replace(Zt,"");n[i]=t[o]}}),n},tn=()=>{if(!x())return{};const e=new URLSearchParams(window.location.search);return q(e)},Pe=e=>e instanceof URLSearchParams?en(e):e,ie=e=>typeof e=="number"&&!isNaN(e)&&e>=0,G=e=>{let{noTraverse:t=!1}=e;const{limit:n=30,userAttributes:o,query:i,model:r,apiKey:a,includeRefs:c=!0,enrich:l,locale:m,apiVersion:h=Xt,fields:g,omit:y,offset:u,cacheSeconds:f,staleCacheSeconds:d,sort:b,includeUnpublished:v}=e;if(!a)throw new Error("Missing API key");if(!["v2","v3"].includes(h))throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${h}'`);(e.limit===void 0||e.limit>1)&&!("noTraverse"in e)&&(t=!0);const p=new URL(`https://cdn.builder.io/api/${h}/content/${r}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${c}${m?`&locale=${m}`:""}${l?`&enrich=${l}`:""}`);if(p.searchParams.set("omit",y||"meta.componentsUsed"),g&&p.searchParams.set("fields",g),Number.isFinite(u)&&u>-1&&p.searchParams.set("offset",String(Math.floor(u))),typeof v=="boolean"&&p.searchParams.set("includeUnpublished",String(v)),f&&ie(f)&&p.searchParams.set("cacheSeconds",String(f)),d&&ie(d)&&p.searchParams.set("staleCacheSeconds",String(d)),b){const C=V({sort:b});for(const T in C)p.searchParams.set(T,JSON.stringify(C[T]))}const P={...tn(),...Pe(e.options||{})},E=V(P);for(const C in E)p.searchParams.set(C,String(E[C]));if(o&&p.searchParams.set("userAttributes",JSON.stringify(o)),i){const C=V({query:i});for(const T in C)p.searchParams.set(T,JSON.stringify(C[T]))}return p},nn=e=>"results"in e;async function L(e){const t=await J({...e,limit:1});return t&&t[0]||null}const on=L,rn=async e=>{const t=G(e);return await(await Re(t.href)).json()},Be=async(e,t,n=G(e))=>{const o=W(e.canTrack);if(n.search.includes("preview=")){const r=[];for(const a of t.results){const c=Jt(n.searchParams);r.push(c||a)}t.results=r}if(!o||!(x()||I==="reactNative"))return t.results;try{const r=[];for(const a of t.results)r.push(await wt({item:a,canTrack:o}));t.results=r}catch(r){k.error("Could not process A/B tests. ",r)}return t.results};async function J(e){try{const t=G(e),n=await rn(e);return nn(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}}const an=J;function sn(){return!x()||$()?!1:location.search.indexOf("builder.preview=")!==-1}function cn(){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 Ae(){return cn().replace(/-/g,"")}const Ve="builderSessionId",ln=async({canTrack:e})=>{if(!e)return;const t=await ye({name:Ve,canTrack:e});if(w(t))return t;{const n=dn();return un({id:n,canTrack:e}),n}},dn=()=>Ae(),un=({id:e,canTrack:t})=>xe({name:Ve,value:e,canTrack:t}),je=()=>x()&&typeof localStorage<"u"?localStorage:void 0,mn=({key:e,canTrack:t})=>{var n;try{return t?(n=je())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},fn=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=je())==null||o.setItem(e,n))}catch(i){console.debug("[LocalStorage] SET error: ",i)}},We="builderVisitorId",hn=({canTrack:e})=>{if(!e)return;const t=mn({key:We,canTrack:e});if(w(t))return t;{const n=gn();return pn({id:n,canTrack:e}),n}},gn=()=>Ae(),pn=({id:e,canTrack:t})=>fn({key:We,value:e,canTrack:t}),bn=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await ln({canTrack:e}),n=hn({canTrack:e});return{sessionId:t,visitorId:n}},yn=async({type:e,canTrack:t,apiKey:n,metadata:o,...i})=>({type:e,data:{...i,metadata:{url:location.href,...o},...await bn({canTrack:t}),userAttributes:ue(),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&&!$()&&(x()||I==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await yn(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const xn=e=>$e({...e,canTrack:!0});function re(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},Sn=e=>vn(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),ae=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,i=e.clientY-n.top,r=re(o/n.width),a=re(i/n.height);return{x:r,y:a}},kn=e=>{const t=e.target,n=t&&Sn(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?ae({event:e,target:t}):void 0,builderTargetOffset:n?ae({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},Cn="0.
|
|
138
|
+
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 Re=Qt();function V(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,...V(r,a,n)}:{...o,[a]:r}},{})}const Xt="v3",oe="builder.",Zt="options.",en=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},q=e=>{if(!e)return{};const t=Pe(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(oe)){const i=o.replace(oe,"").replace(Zt,"");n[i]=t[o]}}),n},tn=()=>{if(!x())return{};const e=new URLSearchParams(window.location.search);return q(e)},Pe=e=>e instanceof URLSearchParams?en(e):e,ie=e=>typeof e=="number"&&!isNaN(e)&&e>=0,G=e=>{let{noTraverse:t=!1}=e;const{limit:n=30,userAttributes:o,query:i,model:r,apiKey:a,includeRefs:c=!0,enrich:l,locale:m,apiVersion:h=Xt,fields:g,omit:y,offset:u,cacheSeconds:f,staleCacheSeconds:d,sort:b,includeUnpublished:v}=e;if(!a)throw new Error("Missing API key");if(!["v2","v3"].includes(h))throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${h}'`);(e.limit===void 0||e.limit>1)&&!("noTraverse"in e)&&(t=!0);const p=new URL(`https://cdn.builder.io/api/${h}/content/${r}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${c}${m?`&locale=${m}`:""}${l?`&enrich=${l}`:""}`);if(p.searchParams.set("omit",y||"meta.componentsUsed"),g&&p.searchParams.set("fields",g),Number.isFinite(u)&&u>-1&&p.searchParams.set("offset",String(Math.floor(u))),typeof v=="boolean"&&p.searchParams.set("includeUnpublished",String(v)),f&&ie(f)&&p.searchParams.set("cacheSeconds",String(f)),d&&ie(d)&&p.searchParams.set("staleCacheSeconds",String(d)),b){const C=V({sort:b});for(const T in C)p.searchParams.set(T,JSON.stringify(C[T]))}const P={...tn(),...Pe(e.options||{})},E=V(P);for(const C in E)p.searchParams.set(C,String(E[C]));if(o&&p.searchParams.set("userAttributes",JSON.stringify(o)),i){const C=V({query:i});for(const T in C)p.searchParams.set(T,JSON.stringify(C[T]))}return p},nn=e=>"results"in e;async function L(e){const t=await J({...e,limit:1});return t&&t[0]||null}const on=L,rn=async e=>{const t=G(e);return await(await Re(t.href)).json()},Be=async(e,t,n=G(e))=>{const o=W(e.canTrack);if(n.search.includes("preview=")){const r=[];for(const a of t.results){const c=Jt(n.searchParams);r.push(c||a)}t.results=r}if(!o||!(x()||I==="reactNative"))return t.results;try{const r=[];for(const a of t.results)r.push(await wt({item:a,canTrack:o}));t.results=r}catch(r){k.error("Could not process A/B tests. ",r)}return t.results};async function J(e){try{const t=G(e),n=await rn(e);return nn(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}}const an=J;function sn(){return!x()||$()?!1:location.search.indexOf("builder.preview=")!==-1}function cn(){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 Ae(){return cn().replace(/-/g,"")}const Ve="builderSessionId",ln=async({canTrack:e})=>{if(!e)return;const t=await ye({name:Ve,canTrack:e});if(w(t))return t;{const n=dn();return un({id:n,canTrack:e}),n}},dn=()=>Ae(),un=({id:e,canTrack:t})=>xe({name:Ve,value:e,canTrack:t}),je=()=>x()&&typeof localStorage<"u"?localStorage:void 0,mn=({key:e,canTrack:t})=>{var n;try{return t?(n=je())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},fn=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=je())==null||o.setItem(e,n))}catch(i){console.debug("[LocalStorage] SET error: ",i)}},We="builderVisitorId",hn=({canTrack:e})=>{if(!e)return;const t=mn({key:We,canTrack:e});if(w(t))return t;{const n=gn();return pn({id:n,canTrack:e}),n}},gn=()=>Ae(),pn=({id:e,canTrack:t})=>fn({key:We,value:e,canTrack:t}),bn=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await ln({canTrack:e}),n=hn({canTrack:e});return{sessionId:t,visitorId:n}},yn=async({type:e,canTrack:t,apiKey:n,metadata:o,...i})=>({type:e,data:{...i,metadata:{url:location.href,...o},...await bn({canTrack:t}),userAttributes:ue(),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&&!$()&&(x()||I==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await yn(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const xn=e=>$e({...e,canTrack:!0});function re(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},Sn=e=>vn(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),ae=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,i=e.clientY-n.top,r=re(o/n.width),a=re(i/n.height);return{x:r,y:a}},kn=e=>{const t=e.target,n=t&&Sn(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?ae({event:e,target:t}):void 0,builderTargetOffset:n?ae({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},Cn="0.11.0",se={};function Fe(e,t){let n=se[e];if(n||(n=se[e]=[]),n.push(t),x()){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 wn=()=>{Fe("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 ce=!1;const In=(e={})=>{var t,n;ce||(ce=!0,x()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:I,version:Cn,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",({data:o})=>{var i,r;if(o!=null&&o.type)switch(o.type){case"builder.evaluate":{const a=o.data.text,c=o.data.arguments||[],l=o.data.id,m=new Function(a);let h,g=null;try{h=m.apply(null,c)}catch(y){g=y}g?(i=window.parent)==null||i.postMessage({type:"builder.evaluateError",data:{id:l,error:g.message}},"*"):h&&typeof h.then=="function"?h.then(y=>{var u;(u=window.parent)==null||u.postMessage({type:"builder.evaluateResult",data:{id:l,result:y}},"*")}).catch(console.error):(r=window.parent)==null||r.postMessage({type:"builder.evaluateResult",data:{result:h,id:l}},"*");break}}})))},En=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+=`
|
|
139
139
|
@font-face {
|
|
140
140
|
font-family: "${t}";
|
|
141
141
|
src: local("${n}"), url('${o}') format('woff2');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LRUCache as Ve } from "lru-cache";
|
|
2
2
|
import { jsx as l, Fragment as y, jsxs as w } from "react/jsx-runtime";
|
|
3
3
|
import { createElement as Be } from "react";
|
|
4
|
-
import { I as We, B as Y, a as $e, b as Oe, C as Fe, E as Ne, F as _e, c as Le, d as Ue, S as Me, V as De, e as je } from "./USE_CLIENT_BUNDLE-
|
|
4
|
+
import { I as We, B as Y, a as $e, b as Oe, C as Fe, E as Ne, F as _e, c as Le, d as Ue, S as Me, V as De, e as je } from "./USE_CLIENT_BUNDLE-f0aeb87c.js";
|
|
5
5
|
import "next/navigation";
|
|
6
6
|
function Ke(e) {
|
|
7
7
|
var t;
|
|
@@ -381,8 +381,7 @@ function Un(e) {
|
|
|
381
381
|
let r = st(o);
|
|
382
382
|
if (e.stripPrefix)
|
|
383
383
|
switch (T) {
|
|
384
|
-
case "
|
|
385
|
-
case "vue3":
|
|
384
|
+
case "vue":
|
|
386
385
|
r = r.replace("v-on:", "");
|
|
387
386
|
break;
|
|
388
387
|
case "svelte":
|
|
@@ -422,8 +421,7 @@ function ut({
|
|
|
422
421
|
function mt(e) {
|
|
423
422
|
switch (T) {
|
|
424
423
|
case "svelte":
|
|
425
|
-
case "
|
|
426
|
-
case "vue3":
|
|
424
|
+
case "vue":
|
|
427
425
|
case "solid":
|
|
428
426
|
return fe(e).join(" ");
|
|
429
427
|
case "qwik":
|
|
@@ -2050,7 +2048,7 @@ const Cn = (e, t, n = !0) => {
|
|
|
2050
2048
|
builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
|
|
2051
2049
|
}
|
|
2052
2050
|
};
|
|
2053
|
-
}, In = "0.
|
|
2051
|
+
}, In = "0.11.0", ae = {};
|
|
2054
2052
|
function Tn(e, t) {
|
|
2055
2053
|
let n = ae[e];
|
|
2056
2054
|
if (n || (n = ae[e] = []), n.push(t), S()) {
|
package/lib/browser/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bundle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bundle-48159788.cjs"),t=require("./USE_CLIENT_BUNDLE-edb9d9fb.cjs");require("lru-cache");require("react/jsx-runtime");require("react");require("next/navigation");require("./USE_SERVER_BUNDLE-3ae19308.cjs");exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.RenderBlocks=e.RenderBlocks;exports.RenderContent=e.RenderContent;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.getAllContent=e.getAllContent;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.getContent=e.getContent;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.track=e.track;exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;
|
package/lib/browser/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { B as i, t as m, C as c, R as g, q as p, S as l, T as C, w as d, m as f, E as u, x as B, n as S, y as E, A as R, z as h, i as x, f as k, u as y, v as P, D as b } from "./bundle-
|
|
2
|
-
import { b as w, F as A, c as F, S as T, V } from "./USE_CLIENT_BUNDLE-
|
|
1
|
+
import { B as i, t as m, C as c, R as g, q as p, S as l, T as C, w as d, m as f, E as u, x as B, n as S, y as E, A as R, z as h, i as x, f as k, u as y, v as P, D as b } from "./bundle-9c29c9d1.js";
|
|
2
|
+
import { b as w, F as A, c as F, S as T, V } from "./USE_CLIENT_BUNDLE-f0aeb87c.js";
|
|
3
3
|
import "lru-cache";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
6
|
import "next/navigation";
|
|
7
|
-
import "./USE_SERVER_BUNDLE-
|
|
7
|
+
import "./USE_SERVER_BUNDLE-0ea3e848.js";
|
|
8
8
|
export {
|
|
9
9
|
i as Blocks,
|
|
10
10
|
w as Button,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as C, Fragment as m, jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import { g as T, a as B, i as E, b as R, c as Y, d as P, e as U, _ as H, f as Z, l as p, h as O, j as ee, k as te, r as ne, s as ie, m as ae, n as ce, o as re } from "./bundle-
|
|
3
|
+
import { g as T, a as B, i as E, b as R, c as Y, d as P, e as U, _ as H, f as Z, l as p, h as O, j as ee, k as te, r as ne, s as ie, m as ae, n as ce, o as re } from "./bundle-28c9300c.js";
|
|
4
4
|
import { useRef as N, useState as k, useEffect as v, createContext as oe, createElement as le } from "react";
|
|
5
|
-
import { p as de } from "./USE_SERVER_BUNDLE-
|
|
5
|
+
import { p as de } from "./USE_SERVER_BUNDLE-668b44ba.js";
|
|
6
6
|
import { useRouter as se } from "next/navigation";
|
|
7
7
|
function Se(e) {
|
|
8
8
|
return /* @__PURE__ */ C(m, { children: [
|
|
@@ -20,11 +20,11 @@ function Se(e) {
|
|
|
20
20
|
{
|
|
21
21
|
...e.attributes,
|
|
22
22
|
style: e.attributes.style,
|
|
23
|
-
className: e.attributes.className + " button-
|
|
23
|
+
className: e.attributes.className + " button-3ecc5438",
|
|
24
24
|
children: e.text
|
|
25
25
|
}
|
|
26
26
|
) }),
|
|
27
|
-
/* @__PURE__ */ i("style", { children: `.button-
|
|
27
|
+
/* @__PURE__ */ i("style", { children: `.button-3ecc5438 {
|
|
28
28
|
all: unset;
|
|
29
29
|
}` })
|
|
30
30
|
] });
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use client";"use strict";const t=require("react/jsx-runtime"),c=require("./bundle-
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),c=require("./bundle-b154d2ce.cjs"),l=require("react"),V=require("./USE_SERVER_BUNDLE-3783d376.cjs"),A=require("next/navigation");function D(e){return t.jsxs(t.Fragment,{children:[e.link?t.jsx(t.Fragment,{children:t.jsx("a",{...e.attributes,href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"button",children:e.text})}):t.jsx(t.Fragment,{children:t.jsx("button",{...e.attributes,style:e.attributes.style,className:e.attributes.className+" button-3ecc5438",children:e.text})}),t.jsx("style",{children:`.button-3ecc5438 {
|
|
2
2
|
all: unset;
|
|
3
3
|
}`})]})}function U(e){return t.jsxs(t.Fragment,{children:[" ",e.hasChildren?t.jsx(t.Fragment,{children:t.jsxs(e.Wrapper,{...c.getBlockProperties({block:e.block,context:e.context}),...c.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," "]})}):t.jsx(t.Fragment,{children:t.jsx(e.Wrapper,{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0})})})," "]})}function H(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:{...c.getBlockProperties({block:e.block,context:e.context}),...c.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 a(){var s;return"builder-blocks"+((s=e.blocks)!=null&&s.length?"":" no-blocks")}function g(){var s,f;c.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((f=window.parent)==null||f.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function x(){var s,f;c.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((f=window.parent)==null||f.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:a()+" props-blocks-wrapper-4f2c12d8","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:s=>g(),onMouseEnter:s=>x(),onKeyPress:s=>g(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-4f2c12d8 {
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: column;
|
|
6
6
|
align-items: stretch;
|
|
7
|
-
}`})]})}function J(e){return t.jsx("span",{children:e.children})}function $(e){var s,f,S,v;function a(){var
|
|
7
|
+
}`})]})}function J(e){return t.jsx("span",{children:e.children})}function $(e){var s,f,S,v;function a(){var b;const r=e.image||e.src;if(!r||!(r.match(/builder\.io/)||r.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((b=e.image)!=null&&b.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),c.getSrcSet(r)}else if(e.image&&!e.srcset)return c.getSrcSet(r);return c.getSrcSet(r)}function g(){var h;return(h=a==null?void 0:a())!=null&&h.match(/builder\.io/)&&!e.noWebp?a().replace(/\?/g,"?format=webp&"):""}function x(){const h={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?h:void 0}return t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[g()?t.jsx(t.Fragment,{children:t.jsx("source",{type:"image/webp",srcSet:g()})}):null,t.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?"presentation":void 0,style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...x()},className:"builder-image"+(e.className?" "+e.className:"")+" img-dbab4030",src:e.image,srcSet:a(),sizes:e.sizes})]}),e.aspectRatio&&!((f=(s=e.builderBlock)==null?void 0:s.children)!=null&&f.length&&e.fitContent)?t.jsx(t.Fragment,{children:t.jsx("div",{className:"builder-image-sizer div-dbab4030",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(v=(S=e.builderBlock)==null?void 0:S.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&e.children?t.jsx(t.Fragment,{children:t.jsx("div",{className:"div-dbab4030-2",children:e.children})}):null]}),t.jsx("style",{children:`.img-dbab4030 {
|
|
8
8
|
opacity: 1;
|
|
9
9
|
transition: opacity 0.2s ease-in-out;
|
|
10
10
|
}.div-dbab4030 {
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
left: 0;
|
|
21
21
|
width: 100%;
|
|
22
22
|
height: 100%;
|
|
23
|
-
}`})]})}function G(e){return t.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 Q(e){const a=l.useRef(null),[g,x]=l.useState(()=>[]),[s,f]=l.useState(()=>[]);return l.useEffect(()=>{var v;if(!((v=a.current)!=null&&v.getElementsByTagName)||typeof window>"u")return;const S=a.current.getElementsByTagName("script");for(let
|
|
23
|
+
}`})]})}function G(e){return t.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 Q(e){const a=l.useRef(null),[g,x]=l.useState(()=>[]),[s,f]=l.useState(()=>[]);return l.useEffect(()=>{var v;if(!((v=a.current)!=null&&v.getElementsByTagName)||typeof window>"u")return;const S=a.current.getElementsByTagName("script");for(let h=0;h<S.length;h++){const r=S[h];if(r.src){if(g.includes(r.src))continue;g.push(r.src);const b=document.createElement("script");b.async=!0,b.src=r.src,document.head.appendChild(b)}else if(!r.type||["text/javascript","application/javascript","application/ecmascript"].includes(r.type)){if(s.includes(r.innerText))continue;try{s.push(r.innerText),new Function(r.innerText)()}catch(b){console.warn("`CustomCode`: Error running script:",b)}}}},[]),t.jsx("div",{ref:a,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function X(e){const a=l.useRef(null),[g,x]=l.useState(()=>[]),[s,f]=l.useState(()=>[]),[S,v]=l.useState(()=>!1);function h(){if(!a.current||!a.current.getElementsByTagName)return;const r=a.current.getElementsByTagName("script");for(let b=0;b<r.length;b++){const k=r[b];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(c.isJsScript(k)&&!s.includes(k.innerText))try{s.push(k.innerText),new Function(k.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return l.useEffect(()=>{a.current&&!S&&(v(!0),h())},[a.current,S]),t.jsx("div",{className:"builder-embed",ref:a,dangerouslySetInnerHTML:{__html:e.content}})}function Y(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},c.isEditing()&&e.imgSrc||"default-key")}function Z(e){var x,s,f,S,v,h,r;function a(){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{...a()}}return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("video",{className:"builder-video",...g(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(x=e.attributes)==null?void 0:x.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:t.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((f=(s=e.builderBlock)==null?void 0:s.children)!=null&&f.length))?t.jsx(t.Fragment,{children:t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}})}):null,(v=(S=e.builderBlock)==null?void 0:S.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children:t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children})}):null,(r=(h=e.builderBlock)==null?void 0:h.children)!=null&&r.length&&!e.fitContent?t.jsx(t.Fragment,{children:t.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 p=l.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function ee(e){var I,P,B,F,T,N,L;const a=l.useRef(null),[g,x]=l.useState(()=>0);function s(n){var o,d,u,m,W;const i={...e.builderContextSignal.content,...n,data:{...(o=e.builderContextSignal.content)==null?void 0:o.data,...n==null?void 0:n.data},meta:{...(d=e.builderContextSignal.content)==null?void 0:d.meta,...n==null?void 0:n.meta,breakpoints:((u=n==null?void 0:n.meta)==null?void 0:u.breakpoints)||((W=(m=e.builderContextSignal.content)==null?void 0:m.meta)==null?void 0:W.breakpoints)}};V.postPreviewContent({value:i,key:i.id}).then(()=>{M.refresh()})}l.useState(()=>0);const[f,S]=l.useState(()=>!1),[v,h]=l.useState(()=>e.contentWrapper||"div");function r(n){var o;const{data:i}=n;if(i)switch(i.type){case"builder.configureSdk":{const d=i.data,{breakpoints:u,contentId:m}=d;if(!m||m!==((o=e.builderContextSignal.content)==null?void 0:o.id))return;u&&s({meta:{breakpoints:u}}),x(g+1);break}case"builder.contentUpdate":{const d=i.data,u=d.key||d.alias||d.entry||d.modelName,m=d.data;u===e.model&&(s(m),x(g+1));break}}}function b(){var i,o;const n=(o=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:o.jsCode;n&&c.evaluate({code:n,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[k,y]=l.useState(()=>({})),[E,K]=l.useState(()=>!1);function q(n){var i,o;if(e.builderContextSignal.content){const d=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(o=e.builderContextSignal.content)==null?void 0:o.id;c._track({type:"click",canTrack:c.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:d!==u?d:void 0,...c.getInteractionPropertiesForEvent(n),unique:!E})}E||K(!0)}function _(n){return n.replace(/{{([^}]+)}}/g,(i,o)=>c.evaluate({code:o,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function z({url:n,key:i}){c.fetch(n).then(o=>o.json()).then(o=>{var u,m;const d={...e.builderContextSignal.rootState,[i]:o};(m=(u=e.builderContextSignal).rootSetState)==null||m.call(u,d),k[i]=!0}).catch(o=>{console.error("error fetching dynamic data",n,o)})}function j(){var i,o;const n=((o=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:o.httpRequests)??{};Object.entries(n).forEach(([d,u])=>{if(u&&(!k[d]||c.isEditing())){const m=_(u);z({url:m,key:d})}})}function C(){c.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:c.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function w(n){x(g+1),window.addEventListener("message",r),c.registerInsertMenu(),c.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.includeRefs?{includeRefs:e.includeRefs}:{},...e.enrich?{enrich:e.enrich}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(i=>{var d;const o=c.createRegisterComponentMessage(i);(d=window.parent)==null||d.postMessage(o,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",C)}function R(n){const i=new URL(location.href).searchParams,o=i.get("builder.preview"),d=i.get(`builder.preview.${o}`),u=i.get("apiKey")||i.get("builder.space");o===e.model&&u===e.apiKey&&(!e.content||d===e.content.id)&&c.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(m=>{m&&s(m)})}const M=A.useRouter();return l.useEffect(()=>{var n;return(n=a.current)==null||n.addEventListener("initeditingbldr",w),()=>{var i;return(i=a.current)==null?void 0:i.removeEventListener("initeditingbldr",w)}},[]),l.useEffect(()=>{var n;return(n=a.current)==null||n.addEventListener("initpreviewingbldr",R),()=>{var i;return(i=a.current)==null?void 0:i.removeEventListener("initpreviewingbldr",R)}},[]),l.useEffect(()=>{var n,i;if(c.isBrowser()){if(c.isEditing()&&a.current&&a.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&c.getDefaultCanTrack(e.canTrack)){const d=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,u=(i=e.builderContextSignal.content)==null?void 0:i.id,m=e.apiKey;c._track({type:"impression",canTrack:!0,contentId:u,apiKey:m,variationId:d!==u?d:void 0})}c.isPreviewing()&&a.current}},[]),l.useEffect(()=>{e.apiKey||c.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),b(),j(),C()},[]),l.useEffect(()=>{},[e.content]),l.useEffect(()=>{c.isBrowser()&&(window.removeEventListener("message",r),window.addEventListener("message",r))},[f]),l.useEffect(()=>{b()},[(P=(I=e.builderContextSignal.content)==null?void 0:I.data)==null?void 0:P.jsCode,e.builderContextSignal.rootState]),l.useEffect(()=>{j()},[(F=(B=e.builderContextSignal.content)==null?void 0:B.data)==null?void 0:F.httpRequests]),l.useEffect(()=>{C()},[e.builderContextSignal.rootState]),l.useEffect(()=>()=>{c.isBrowser()&&(window.removeEventListener("message",r),window.removeEventListener("builder:component:stateChangeListenerActivated",C))},[]),t.jsx(p.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(t.Fragment,{children:l.createElement(v,{key:g,ref:a,onClick:n=>q(n),"builder-content-id":(T=e.builderContextSignal.content)==null?void 0:T.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((N=e.content)==null?void 0:N.testVariationId)||((L=e.content)==null?void 0:L.id)}`},e.children)}):null})}exports.BlockWrapper=U;exports.BlocksWrapper=O;exports.Button=D;exports.CustomCode=Q;exports.Embed=X;exports.EnableEditor=ee;exports.FragmentComponent=J;exports.Image=$;exports.ImgComponent=Y;exports.InteractiveElement=H;exports.SectionComponent=G;exports.Video=Z;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use server";"use strict";const n=require("./bundle-
|
|
1
|
+
"use server";"use strict";const n=require("./bundle-b154d2ce.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 { LRUCache as Qr } from "lru-cache";
|
|
2
2
|
import { jsx as C, Fragment as D, jsxs as ue } from "react/jsx-runtime";
|
|
3
3
|
import { createElement as eo } from "react";
|
|
4
|
-
import { I as to, B as $n, a as no, b as ro, C as oo, E as io, F as ao, c as so, d as lo, S as co, V as uo, e as fo } from "./USE_CLIENT_BUNDLE-
|
|
4
|
+
import { I as to, B as $n, a as no, b as ro, C as oo, E as io, F as ao, c as so, d as lo, S as co, V as uo, e as fo } from "./USE_CLIENT_BUNDLE-1cacf6c8.js";
|
|
5
5
|
import "next/navigation";
|
|
6
6
|
function po(e) {
|
|
7
7
|
var t;
|
|
@@ -2854,8 +2854,7 @@ function Ea(e) {
|
|
|
2854
2854
|
let i = Xo(r);
|
|
2855
2855
|
if (e.stripPrefix)
|
|
2856
2856
|
switch (be) {
|
|
2857
|
-
case "
|
|
2858
|
-
case "vue3":
|
|
2857
|
+
case "vue":
|
|
2859
2858
|
i = i.replace("v-on:", "");
|
|
2860
2859
|
break;
|
|
2861
2860
|
case "svelte":
|
|
@@ -2895,8 +2894,7 @@ function qo({
|
|
|
2895
2894
|
function Zo(e) {
|
|
2896
2895
|
switch (be) {
|
|
2897
2896
|
case "svelte":
|
|
2898
|
-
case "
|
|
2899
|
-
case "vue3":
|
|
2897
|
+
case "vue":
|
|
2900
2898
|
case "solid":
|
|
2901
2899
|
return br(e).join(" ");
|
|
2902
2900
|
case "qwik":
|
|
@@ -4523,7 +4521,7 @@ const la = (e, t, n = !0) => {
|
|
|
4523
4521
|
builderElementIndex: n && r ? [].slice.call(document.getElementsByClassName(r)).indexOf(n) : void 0
|
|
4524
4522
|
}
|
|
4525
4523
|
};
|
|
4526
|
-
}, ua = "0.
|
|
4524
|
+
}, ua = "0.11.0", ir = {};
|
|
4527
4525
|
function fa(e, t) {
|
|
4528
4526
|
let n = ir[e];
|
|
4529
4527
|
if (n || (n = ir[e] = []), n.push(t), G()) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const ao=require("lru-cache"),m=require("react/jsx-runtime"),so=require("react"),q=require("./USE_CLIENT_BUNDLE-
|
|
1
|
+
"use strict";const ao=require("lru-cache"),m=require("react/jsx-runtime"),so=require("react"),q=require("./USE_CLIENT_BUNDLE-97438f67.cjs");require("next/navigation");function lo(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const at="[Builder.io]: ",Y={log:(...e)=>console.log(at,...e),error:(...e)=>console.error(at,...e),warn:(...e)=>console.warn(at,...e),debug:(...e)=>console.debug(at,...e)};function K(){return typeof window<"u"&&typeof document<"u"}const ve="rsc";function co(){return K()&&window.self!==window.top}function ft(){return co()&&window.location.search.indexOf("builder.frameEditing=")!==-1}const uo=()=>{if(K()){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},fo=()=>typeof navigator=="object"&&navigator.userAgent||"",ur=()=>{const e=fo(),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()||ve==="reactNative"}},n=e.match(/Tablet|iPad/i),r=uo();return{urlPath:r==null?void 0:r.pathname,host:(r==null?void 0:r.host)||(r==null?void 0:r.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},fr=({builder:e,context:t,event:n,state:r})=>Object.entries({state:r,Builder:e,builder:e,context:t,event:n}),po=()=>({isEditing:ft(),isBrowser:K(),isServer:!K(),getUserAttributes:()=>ur()}),ho=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,mo=({code:e,builder:t,context:n,event:r,localState:o,rootSetState:i,rootState:s})=>{const u=fr({builder:t,context:n,event:r,state:go(s,o,i)});return new Function(...u.map(([d])=>d),e)(...u.map(([,d])=>d))};function go(e,t,n){if(e===t)throw new Error("rootState === localState");return new Proxy(e,{get:(r,o)=>t&&o in t?t[o]:e[o],set:(r,o,i)=>{if(t&&o in t)throw new Error("Writing to local state is not allowed as it is read-only.");return e[o]=i,n==null||n(e),!0}})}const pr=(e,t,n)=>{if(Object(e)!==e)return e;const r=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return r.slice(0,-1).reduce((o,i,s)=>Object(o[i])===o[i]?o[i]:o[i]=Math.abs(Number(r[s+1]))>>0===+r[s+1]?[]:{},e)[r[r.length-1]]=n,e};var P,yo=function(e){function t(a){return 48>a?a===36:58>a?!0:65>a?!1:91>a?!0:97>a?a===95:123>a?!0:170<=a&&oo.test(String.fromCharCode(a))}function n(a){return 65>a?a===36:91>a?!0:97>a?a===95:123>a?!0:170<=a&&Hn.test(String.fromCharCode(a))}function r(a,l){for(var c=y,p=1,j=0;;){it.lastIndex=j;var L=it.exec(c);if(L&&L.index<a)++p,j=L.index+L[0].length;else break}throw c={line:p,ab:a-j},l+=" ("+c.line+":"+c.ab+")",l=new SyntaxError(l),l.j=a,l.X=c,l.o=f,l}function o(a){a=a.split(" ");for(var l=Object.create(null),c=0;c<a.length;c++)l[a[c]]=!0;return function(p){return l[p]||!1}}function i(){this.line=be,this.ab=f-oe}function s(a,l){ke=f,O.C&&(Tt=new i),I=a,d(),Q=l,Be=a.m}function u(){for(var a=f,l=O.va&&O.C&&new i,c=y.charCodeAt(f+=2);f<we&&c!==10&&c!==13&&c!==8232&&c!==8233;)++f,c=y.charCodeAt(f);O.va&&O.va(!1,y.slice(a+2,f),a,f,l,O.C&&new i)}function d(){for(;f<we;){var a=y.charCodeAt(f);if(a===32)++f;else if(a===13)++f,a=y.charCodeAt(f),a===10&&++f,O.C&&(++be,oe=f);else if(a===10||a===8232||a===8233)++f,O.C&&(++be,oe=f);else if(8<a&&14>a)++f;else if(a===47)if(a=y.charCodeAt(f+1),a===42){a=void 0;var l=O.va&&O.C&&new i,c=f,p=y.indexOf("*/",f+=2);if(p===-1&&r(f-2,"Unterminated comment"),f=p+2,O.C)for(it.lastIndex=c;(a=it.exec(y))&&a.index<f;)++be,oe=a.index+a[0].length;O.va&&O.va(!0,y.slice(c+2,p),c,f,l,O.C&&new i)}else if(a===47)u();else break;else if(a===160)++f;else if(5760<=a&&ro.test(String.fromCharCode(a)))++f;else break}}function E(a){switch(a){case 46:a=y.charCodeAt(f+1),48<=a&&57>=a?k(!0):(++f,s(Mn));return;case 40:return++f,s(ie);case 41:return++f,s(te);case 59:return++f,s(ae);case 44:return++f,s(ge);case 91:return++f,s(Vt);case 93:return++f,s(_t);case 123:return++f,s(Ve);case 125:return++f,s(Ee);case 58:return++f,s(_e);case 63:return++f,s(Un);case 48:if(a=y.charCodeAt(f+1),a===120||a===88){f+=2,a=A(16),a===null&&r(D+2,"Expected hexadecimal number"),n(y.charCodeAt(f))&&r(f,"Identifier directly after number"),s(Ue,a);return}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return k(!1);case 34:case 39:f++;for(var l="";;){f>=we&&r(D,"Unterminated string constant");var c=y.charCodeAt(f);if(c===a){++f,s(tt,l);break}if(c===92){c=y.charCodeAt(++f);var p=/^[0-7]+/.exec(y.slice(f,f+3));for(p&&(p=p[0]);p&&255<parseInt(p,8);)p=p.slice(0,-1);if(p==="0"&&(p=null),++f,p)z&&r(f-2,"Octal literal in strict mode"),l+=String.fromCharCode(parseInt(p,8)),f+=p.length-1;else switch(c){case 110:l+=`
|
|
2
2
|
`;break;case 114:l+="\r";break;case 120:l+=String.fromCharCode(b(2));break;case 117:l+=String.fromCharCode(b(4));break;case 85:l+=String.fromCharCode(b(8));break;case 116:l+=" ";break;case 98:l+="\b";break;case 118:l+="\v";break;case 102:l+="\f";break;case 48:l+="\0";break;case 13:y.charCodeAt(f)===10&&++f;case 10:O.C&&(oe=f,++be);break;default:l+=String.fromCharCode(c)}}else c!==13&&c!==10&&c!==8232&&c!==8233||r(D,"Unterminated string constant"),l+=String.fromCharCode(c),++f}return;case 47:a=y.charCodeAt(f+1),Be?(++f,F()):a===61?w(Se,2):w(Vn,1);return;case 37:case 42:y.charCodeAt(f+1)===61?w(Se,2):w(eo,1);return;case 124:case 38:l=y.charCodeAt(f+1),l===a?w(a===124?Ln:Wn,2):l===61?w(Se,2):w(a===124?Xr:Yr,1);return;case 94:y.charCodeAt(f+1)===61?w(Se,2):w(Jr,1);return;case 43:case 45:l=y.charCodeAt(f+1),l===a?l===45&&y.charCodeAt(f+2)===62&&ot.test(y.slice(me,f))?(f+=3,u(),d(),C()):w(Gr,2):l===61?w(Se,2):w(Qr,1);return;case 60:case 62:l=y.charCodeAt(f+1),c=1,l===a?(c=a===62&&y.charCodeAt(f+2)===62?3:2,y.charCodeAt(f+c)===61?w(Se,c+1):w(Zr,c)):l===33&&a===60&&y.charCodeAt(f+2)===45&&y.charCodeAt(f+3)===45?(f+=4,u(),d(),C()):(l===61&&(c=y.charCodeAt(f+2)===61?3:2),w(qr,c));return;case 61:case 33:y.charCodeAt(f+1)===61?w(zr,y.charCodeAt(f+2)===61?3:2):w(a===61?_n:Dn,1);return;case 126:return w(Dn,1)}return!1}function C(a){if(a?f=D+1:D=f,O.C&&(jt=new i),a)return F();if(f>=we)return s(Rt);if(a=y.charCodeAt(f),n(a)||a===92)return U();if(E(a)===!1){if(a=String.fromCharCode(a),a==="\\"||Hn.test(a))return U();r(f,"Unexpected character '"+a+"'")}}function w(a,l){var c=y.slice(f,f+l);f+=l,s(a,c)}function F(){for(var a,l,c=f;;){f>=we&&r(c,"Unterminated regexp");var p=y.charAt(f);if(ot.test(p)&&r(c,"Unterminated regexp"),a)a=!1;else{if(p==="[")l=!0;else if(p==="]"&&l)l=!1;else if(p==="/"&&!l)break;a=p==="\\"}++f}a=y.slice(c,f),++f,(l=N())&&!/^[gmi]*$/.test(l)&&r(c,"Invalid regexp flag");try{var j=new RegExp(a,l)}catch(L){throw L instanceof SyntaxError&&r(c,L.message),L}s(yn,j)}function A(a,l){for(var c=f,p=0,j=l===void 0?1/0:l,L=0;L<j;++L){var G=y.charCodeAt(f);if(G=97<=G?G-97+10:65<=G?G-65+10:48<=G&&57>=G?G-48:1/0,G>=a)break;++f,p=p*a+G}return f===c||l!==void 0&&f-c!==l?null:p}function k(a){var l=f,c=!1,p=y.charCodeAt(f)===48;a||A(10)!==null||r(l,"Invalid number"),y.charCodeAt(f)===46&&(++f,A(10),c=!0),a=y.charCodeAt(f),(a===69||a===101)&&(a=y.charCodeAt(++f),a!==43&&a!==45||++f,A(10)===null&&r(l,"Invalid number"),c=!0),n(y.charCodeAt(f))&&r(f,"Identifier directly after number"),a=y.slice(l,f);var j;c?j=parseFloat(a):p&&a.length!==1?/[89]/.test(a)||z?r(l,"Invalid number"):j=parseInt(a,8):j=parseInt(a,10),s(Ue,j)}function b(a){return a=A(16,a),a===null&&r(D,"Bad character escape sequence"),a}function N(){Ie=!1;for(var a,l=!0,c=f;;){var p=y.charCodeAt(f);if(t(p))Ie&&(a+=y.charAt(f)),++f;else if(p===92){Ie||(a=y.slice(c,f)),Ie=!0,y.charCodeAt(++f)!==117&&r(f,"Expecting Unicode escape sequence \\uXXXX"),++f,p=b(4);var j=String.fromCharCode(p);j||r(f-1,"Invalid Unicode escape"),(l?n(p):t(p))||r(f-4,"Invalid Unicode escape"),a+=j}else break;l=!1}return Ie?a:y.slice(c,f)}function U(){var a=N(),l=Ce;!Ie&&no(a)&&(l=Kr[a]),s(l,a)}function g(){At=D,me=ke,Ot=Tt,C()}function pe(a){if(z=a,f=D,O.C)for(;f<oe;)oe=y.lastIndexOf(`
|
|
3
3
|
`,oe-2)+1,--be;d(),C()}function de(){this.type=null,this.start=D,this.end=null}function Z(){this.start=jt,this.end=null,It&&(this.source=It)}function B(){var a=new de;return O.C&&(a.X=new Z),O.vb&&(a.sourceFile=O.vb),O.Xa&&(a.j=[D,0]),a}function he(a){var l=new de;return l.start=a.start,O.C&&(l.X=new Z,l.X.start=a.X.start),O.Xa&&(l.j=[a.j[0],0]),l}function T(a,l){return a.type=l,a.end=me,O.C&&(a.X.end=Ot),O.Xa&&(a.j[1]=me),a}function xt(a){return a.type==="ExpressionStatement"&&a.la.type==="Literal"&&a.la.value==="use strict"}function M(a){return I===a?(g(),!0):!1}function Ze(){return!O.fc&&(I===Rt||I===Ee||ot.test(y.slice(me,D)))}function xe(){M(ae)||Ze()||ne()}function V(a){I===a?g():ne()}function ne(){r(D,"Unexpected token")}function Qe(a){a.type!=="Identifier"&&a.type!=="MemberExpression"&&r(a.start,"Assigning to rvalue"),z&&a.type==="Identifier"&&rt(a.name)&&r(a.start,"Assigning to "+a.name+" in strict mode")}function ee(){(I===Vn||I===Se&&Q==="/=")&&C(!0);var a=I,l=B();switch(a){case Pt:case xn:g();var c=a===Pt;M(ae)||Ze()?l.label=null:I!==Ce?ne():(l.label=re(),xe());for(var p=0;p<_.length;++p){var j=_[p];if((l.label===null||j.name===l.label.name)&&(j.kind!==null&&(c||j.kind==="loop")||l.label&&c))break}return p===_.length&&r(l.start,"Unsyntactic "+a.l),T(l,c?"BreakStatement":"ContinueStatement");case bn:return g(),xe(),T(l,"DebuggerStatement");case wn:return g(),_.push(Dt),l.body=ee(),_.pop(),V(Ut),l.test=Pe(),xe(),T(l,"DoWhileStatement");case En:return g(),_.push(Dt),V(ie),I===ae?bt(l,null):I===Mt?(a=B(),g(),mn(a,!0),T(a,"VariableDeclaration"),a.fa.length===1&&M(nt)?hn(l,a):bt(l,a)):(a=H(!1,!0),M(nt)?(Qe(a),hn(l,a)):bt(l,a));case Ft:return g(),Ct(l,!0);case In:return g(),l.test=Pe(),l.da=ee(),l.alternate=M(kn)?ee():null,T(l,"IfStatement");case jn:return Me||O.Ib||r(D,"'return' outside of function"),g(),M(ae)||Ze()?l.K=null:(l.K=H(),xe()),T(l,"ReturnStatement");case Bt:for(g(),l.Qb=Pe(),l.tb=[],V(Ve),_.push(io);I!==Ee;)I===Nt||I===Sn?(a=I===Nt,p&&T(p,"SwitchCase"),l.tb.push(p=B()),p.da=[],g(),a?p.test=H():(c&&r(At,"Multiple default clauses"),c=!0,p.test=null),V(_e)):(p||ne(),p.da.push(ee()));return p&&T(p,"SwitchCase"),g(),_.pop(),T(l,"SwitchStatement");case Tn:return g(),ot.test(y.slice(me,D))&&r(me,"Illegal newline after throw"),l.K=H(),xe(),T(l,"ThrowStatement");case An:return g(),l.block=Ne(),l.Ea=null,I===vn&&(a=B(),g(),V(ie),a.Ua=re(),z&&rt(a.Ua.name)&&r(a.Ua.start,"Binding "+a.Ua.name+" in strict mode"),V(te),a.body=Ne(),l.Ea=T(a,"CatchClause")),l.fb=M(Cn)?Ne():null,l.Ea||l.fb||r(l.start,"Missing catch or finally clause"),T(l,"TryStatement");case Mt:return g(),mn(l),xe(),T(l,"VariableDeclaration");case Ut:return g(),l.test=Pe(),_.push(Dt),l.body=ee(),_.pop(),T(l,"WhileStatement");case On:return z&&r(D,"'with' in strict mode"),g(),l.object=Pe(),l.body=ee(),T(l,"WithStatement");case Ve:return Ne();case ae:return g(),T(l,"EmptyStatement");default:if(c=Q,j=H(),a===Ce&&j.type==="Identifier"&&M(_e)){for(p=0;p<_.length;++p)_[p].name===c&&r(j.start,"Label '"+c+"' is already declared");return _.push({name:c,kind:I.W?"loop":I===Bt?"switch":null}),l.body=ee(),_.pop(),l.label=j,T(l,"LabeledStatement")}return l.la=j,xe(),T(l,"ExpressionStatement")}}function Pe(){V(ie);var a=H();return V(te),a}function Ne(a){var l=B(),c=!0,p=!1;for(l.body=[],V(Ve);!M(Ee);){var j=ee();if(l.body.push(j),c&&a&&xt(j)){var L=p;pe(p=!0)}c=!1}return p&&!L&&pe(!1),T(l,"BlockStatement")}function bt(a,l){return a.ua=l,V(ae),a.test=I===ae?null:H(),V(ae),a.update=I===te?null:H(),V(te),a.body=ee(),_.pop(),T(a,"ForStatement")}function hn(a,l){return a.left=l,a.right=H(),V(te),a.body=ee(),_.pop(),T(a,"ForInStatement")}function mn(a,l){for(a.fa=[],a.kind="var";;){var c=B();if(c.id=re(),z&&rt(c.id.name)&&r(c.id.start,"Binding "+c.id.name+" in strict mode"),c.ua=M(_n)?H(!0,l):null,a.fa.push(T(c,"VariableDeclarator")),!M(ge))break}}function H(a,l){var c=St(l);if(!a&&I===ge){for(a=he(c),a.xb=[c];M(ge);)a.xb.push(St(l));return T(a,"SequenceExpression")}return c}function St(a){var l=wt(kt(),-1,a);if(M(Un)){var c=he(l);c.test=l,c.da=H(!0),V(_e),c.alternate=H(!0,a),l=T(c,"ConditionalExpression")}return I.Cb?(c=he(l),c.operator=Q,c.left=l,g(),c.right=St(a),Qe(l),T(c,"AssignmentExpression")):l}function wt(a,l,c){var p=I.L;if(p!==null&&(!c||I!==nt)&&p>l){var j=he(a);return j.left=a,j.operator=Q,a=I,g(),j.right=wt(kt(),p,c),p=T(j,a===Ln||a===Wn?"LogicalExpression":"BinaryExpression"),wt(p,l,c)}return a}function kt(){if(I.prefix){var a=B(),l=I.$b;return a.operator=Q,Be=a.prefix=!0,g(),a.K=kt(),l?Qe(a.K):z&&a.operator==="delete"&&a.K.type==="Identifier"&&r(a.start,"Deleting local variable in strict mode"),T(a,l?"UpdateExpression":"UnaryExpression")}for(l=Fe(et());I.cc&&!Ze();)a=he(l),a.operator=Q,a.prefix=!1,a.K=l,Qe(l),g(),l=T(a,"UpdateExpression");return l}function Fe(a,l){if(M(Mn)){var c=he(a);return c.object=a,c.Wa=re(!0),c.bb=!1,Fe(T(c,"MemberExpression"),l)}return M(Vt)?(c=he(a),c.object=a,c.Wa=H(),c.bb=!0,V(_t),Fe(T(c,"MemberExpression"),l)):!l&&M(ie)?(c=he(a),c.callee=a,c.arguments=Et(te,!1),Fe(T(c,"CallExpression"),l)):a}function et(){switch(I){case Pn:var a=B();return g(),T(a,"ThisExpression");case Ce:return re();case Ue:case tt:case yn:return a=B(),a.value=Q,a.raw=y.slice(D,ke),g(),T(a,"Literal");case Nn:case Fn:case Bn:return a=B(),a.value=I.$a,a.raw=I.l,g(),T(a,"Literal");case ie:a=jt;var l=D;g();var c=H();return c.start=l,c.end=ke,O.C&&(c.X.start=a,c.X.end=Tt),O.Xa&&(c.j=[l,ke]),V(te),c;case Vt:return a=B(),g(),a.elements=Et(_t,!0,!0),T(a,"ArrayExpression");case Ve:for(a=B(),l=!0,c=!1,a.h=[],g();!M(Ee);){if(l)l=!1;else if(V(ge),O.sb&&M(Ee))break;var p={key:I===Ue||I===tt?et():re(!0)},j=!1;if(M(_e)){p.value=H(!0);var L=p.kind="init"}else p.key.type!=="Identifier"||p.key.name!=="get"&&p.key.name!=="set"?ne():(j=c=!0,L=p.kind=p.key.name,p.key=I===Ue||I===tt?et():re(!0),I!==ie&&ne(),p.value=Ct(B(),!1));if(p.key.type==="Identifier"&&(z||c))for(var G=0;G<a.h.length;++G){var je=a.h[G];if(je.key.name===p.key.name){var Lt=L===je.kind||j&&je.kind==="init"||L==="init"&&(je.kind==="get"||je.kind==="set");Lt&&!z&&L==="init"&&je.kind==="init"&&(Lt=!1),Lt&&r(p.key.start,"Redefinition of property")}}a.h.push(p)}return T(a,"ObjectExpression");case Ft:return a=B(),g(),Ct(a,!1);case Rn:return a=B(),g(),a.callee=Fe(et(),!0),a.arguments=M(ie)?Et(te,!1):Hr,T(a,"NewExpression")}ne()}function Ct(a,l){I===Ce?a.id=re():l?ne():a.id=null,a.oa=[];var c=!0;for(V(ie);!M(te);)c?c=!1:V(ge),a.oa.push(re());c=Me;var p=_;if(Me=!0,_=[],a.body=Ne(!0),Me=c,_=p,z||a.body.body.length&&xt(a.body.body[0])){for(c=a.id?-1:0;c<a.oa.length;++c)if(p=0>c?a.id:a.oa[c],($n(p.name)||rt(p.name))&&r(p.start,"Defining '"+p.name+"' in strict mode"),0<=c)for(var j=0;j<c;++j)p.name===a.oa[j].name&&r(p.start,"Argument name clash in strict mode")}return T(a,l?"FunctionDeclaration":"FunctionExpression")}function Et(a,l,c){for(var p=[],j=!0;!M(a);){if(j)j=!1;else if(V(ge),l&&O.sb&&M(a))break;p.push(c&&I===ge?null:H(!0))}return p}function re(a){var l=B();return a&&O.yb==="everywhere"&&(a=!1),I===Ce?(!a&&(O.yb&&to(Q)||z&&$n(Q))&&y.slice(D,ke).indexOf("\\")===-1&&r(D,"The keyword '"+Q+"' is reserved"),l.name=Q):a&&I.l?l.name=I.l:ne(),Be=!1,g(),T(l,"Identifier")}e.version="0.5.0";var O,y="",we,It;e.parse=function(a,l){y=String(a),we=y.length,O=l||{};for(var c in gn)Object.prototype.hasOwnProperty.call(O,c)||(O[c]=gn[c]);for(It=O.sourceFile,be=1,f=oe=0,Be=!0,d(),c=O.dc,At=me=f,O.C&&(Ot=new i),Me=z=!1,_=[],C(),a=c||B(),l=!0,c||(a.body=[]);I!==Rt;)c=ee(),a.body.push(c),l&&xt(c)&&pe(!0),l=!1;return T(a,"Program")};var gn={fc:!1,sb:!0,yb:!1,Ib:!1,C:!1,va:null,Xa:!1,dc:null,sourceFile:null,vb:null},f=0,D=0,ke=0,jt,Tt,I,Q,Be,be,oe,At=0,me=0,Ot,Me,_,z,Hr=[],Ue={type:"num"},yn={type:"regexp"},tt={type:"string"},Ce={type:"name"},Rt={type:"eof"},Pt={l:"break"},Nt={l:"case",m:!0},vn={l:"catch"},xn={l:"continue"},bn={l:"debugger"},Sn={l:"default"},wn={l:"do",W:!0},kn={l:"else",m:!0},Cn={l:"finally"},En={l:"for",W:!0},Ft={l:"function"},In={l:"if"},jn={l:"return",m:!0},Bt={l:"switch"},Tn={l:"throw",m:!0},An={l:"try"},Mt={l:"var"},Ut={l:"while",W:!0},On={l:"with"},Rn={l:"new",m:!0},Pn={l:"this"},Nn={l:"null",$a:null},Fn={l:"true",$a:!0},Bn={l:"false",$a:!1},nt={l:"in",L:7,m:!0},Kr={break:Pt,case:Nt,catch:vn,continue:xn,debugger:bn,default:Sn,do:wn,else:kn,finally:Cn,for:En,function:Ft,if:In,return:jn,switch:Bt,throw:Tn,try:An,var:Mt,while:Ut,with:On,null:Nn,true:Fn,false:Bn,new:Rn,in:nt,instanceof:{l:"instanceof",L:7,m:!0},this:Pn,typeof:{l:"typeof",prefix:!0,m:!0},void:{l:"void",prefix:!0,m:!0},delete:{l:"delete",prefix:!0,m:!0}},Vt={type:"[",m:!0},_t={type:"]"},Ve={type:"{",m:!0},Ee={type:"}"},ie={type:"(",m:!0},te={type:")"},ge={type:",",m:!0},ae={type:";",m:!0},_e={type:":",m:!0},Mn={type:"."},Un={type:"?",m:!0},Vn={L:10,m:!0},_n={Cb:!0,m:!0},Se={Cb:!0,m:!0},Gr={cc:!0,prefix:!0,$b:!0},Dn={prefix:!0,m:!0},Ln={L:1,m:!0},Wn={L:2,m:!0},Xr={L:3,m:!0},Jr={L:4,m:!0},Yr={L:5,m:!0},zr={L:6,m:!0},qr={L:7,m:!0},Zr={L:8,m:!0},Qr={L:9,prefix:!0,m:!0},eo={L:10,m:!0},to=o("class enum extends super const export import"),$n=o("implements interface let package private protected public static yield"),rt=o("eval arguments"),no=o("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"),ro=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Hn=RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),oo=RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_]"),ot=/[\n\r\u2028\u2029]/,it=/\r\n|[\n\r\u2028\u2029]/g,Ie,Dt={kind:"loop"},io={kind:"switch"}},Kt=Kt=typeof globalThis>"u"?void 0:globalThis;yo(Kt.j||(Kt.j={}));function h(e,t){typeof e=="string"&&(e=Ae(e,"code"));var n=e.constructor;this.ya=function(){return new n({options:{}})};var r=this.ya(),o;for(o in e)r[o]=o==="body"?e[o].slice():e[o];this.ra=r,this.ca=[],this.qb=t,this.za=!1,this.ba=[],this.Ya=0,this.rb=Object.create(null),e=/^step([A-Z]\w*)$/;var i,s;for(s in this)typeof this[s]=="function"&&(i=s.match(e))&&(this.rb[i[1]]=this[s].bind(this));this.N=Xt(this,this.ra,null),this.Na=this.N.object,this.ra=Ae(this.ba.join(`
|
|
4
4
|
`),"polyfills"),this.ba=void 0,pt(this.ra),i=new x(this.ra,this.N),i.done=!1,this.o=[i],this.Eb(),this.value=void 0,this.ra=r,i=new x(this.ra,this.N),i.done=!1,this.o.length=0,this.o[0]=i}var Kn={C:!0,kc:5},zt={configurable:!0,enumerable:!0,writable:!1},v={configurable:!0,enumerable:!1,writable:!0},J={configurable:!0,enumerable:!1,writable:!1},De={configurable:!1,enumerable:!1,writable:!1},Gn={configurable:!1,enumerable:!0,writable:!0},dr={STEP_ERROR:!0},Re={SCOPE_REFERENCE:!0},Xe={VALUE_IN_DESCRIPTOR:!0},Te={REGEXP_TIMEOUT:!0},Xn=[],le=null,Ke=null,ye=typeof globalThis>"u"?void 0:globalThis,vo=["onmessage = function(e) {","var result;","var data = e.data;","switch (data[0]) {","case 'split':","result = data[1].split(data[2], data[3]);","break;","case 'match':","result = data[1].match(data[2]);","break;","case 'search':","result = data[1].search(data[2]);","break;","case 'replace':","result = data[1].replace(data[2], data[3]);","break;","case 'exec':","var regexp = data[1];","regexp.lastIndex = data[2];","result = [regexp.exec(data[3]), data[1].lastIndex];","break;","default:","throw Error('Unknown RegExp operation: ' + data[0]);","}","postMessage(result);","close();","};"];function qt(e){var t=e>>>0;return t===Number(e)?t:NaN}function Ge(e){var t=e>>>0;return String(t)===String(e)&&t!==4294967295?t:NaN}function pt(e,t,n){t?e.start=t:delete e.start,n?e.end=n:delete e.end;for(var r in e)if(r!=="loc"&&e.hasOwnProperty(r)){var o=e[r];o&&typeof o=="object"&&pt(o,t,n)}}h.prototype.REGEXP_MODE=2;h.prototype.REGEXP_THREAD_TIMEOUT=1e3;h.prototype.POLYFILL_TIMEOUT=1e3;P=h.prototype;P.P=!1;P.Ka=!1;P.Kb=0;P.ic=0;function Ae(e,t){var n={},r;for(r in Kn)n[r]=Kn[r];return n.sourceFile=t,ye.j.parse(e,n)}P.Jb=function(e){var t=this.o[0];if(!t||t.node.type!=="Program")throw Error("Expecting original AST to start with a Program node");if(typeof e=="string"&&(e=Ae(e,"appendCode"+this.Kb++)),!e||e.type!=="Program")throw Error("Expecting new AST to start with a Program node");Je(this,e,t.scope),Array.prototype.push.apply(t.node.body,e.body),t.node.body.jb=null,t.done=!1};P.lb=function(){var e=this.o,t;do{var n=e[e.length-1];if(this.za)break;if(!n||n.node.type==="Program"&&n.done){if(!this.ca.length)return!1;if(n=this.ca[0],!n||n.time>Date.now())n=null;else{this.ca.shift(),0<=n.interval&&gr(this,n,n.interval);var r=new x(n.node,n.scope);n.zb&&(r.ia=2,r.B=this.Na,r.U=n.zb,r.Qa=!0,r.F=n.Lb),n=r}if(!n)break}r=n.node;var o=Ke;Ke=this;try{var i=this.rb[r.type](e,n,r)}catch(s){if(s!==dr)throw this.value!==s&&(this.value=void 0),s}finally{Ke=o}if(i&&e.push(i),this.P)throw this.value=void 0,Error("Getter not supported in this context");if(this.Ka)throw this.value=void 0,Error("Setter not supported in this context");t||r.end||(t=Date.now()+this.POLYFILL_TIMEOUT)}while(!r.end&&t>Date.now());return!0};P.Eb=function(){for(;!this.za&&this.lb(););return this.za};function xo(e,t){e.g(t,"NaN",NaN,De),e.g(t,"Infinity",1/0,De),e.g(t,"undefined",void 0,De),e.g(t,"window",t,zt),e.g(t,"this",t,De),e.g(t,"self",t),e.M=new R(null),e.Z=new R(e.M),bo(e,t),So(e,t),t.xa=e.M,e.g(t,"constructor",e.v,v),wo(e,t),ko(e,t),Co(e,t),Eo(e,t),Io(e,t),jo(e,t),To(e,t),Ao(e,t),Oo(e,t);var n=e.i(function(){throw EvalError("Can't happen")},!1);n.eval=!0,e.g(t,"eval",n,v),e.g(t,"parseInt",e.i(parseInt,!1),v),e.g(t,"parseFloat",e.i(parseFloat,!1),v),e.g(t,"isNaN",e.i(isNaN,!1),v),e.g(t,"isFinite",e.i(isFinite,!1),v);for(var r=[[escape,"escape"],[unescape,"unescape"],[decodeURI,"decodeURI"],[decodeURIComponent,"decodeURIComponent"],[encodeURI,"encodeURI"],[encodeURIComponent,"encodeURIComponent"]],o=0;o<r.length;o++)n=function(i){return function(s){try{return i(s)}catch(u){S(e,e.Gb,u.message)}}}(r[o][0]),e.g(t,r[o][1],e.i(n,!1),v);n=function(i){return Jn(e,!1,arguments)},e.g(t,"setTimeout",e.i(n,!1),v),n=function(i){return Jn(e,!0,arguments)},e.g(t,"setInterval",e.i(n,!1),v),n=function(i){Yn(e,i)},e.g(t,"clearTimeout",e.i(n,!1),v),n=function(i){Yn(e,i)},e.g(t,"clearInterval",e.i(n,!1),v),e.OBJECT=e.v,e.OBJECT_PROTO=e.M,e.FUNCTION=e.O,e.FUNCTION_PROTO=e.Z,e.ARRAY=e.qa,e.ARRAY_PROTO=e.La,e.REGEXP=e.I,e.REGEXP_PROTO=e.Ma,e.DATE=e.$,e.DATE_PROTO=e.nb,e.qb&&e.qb(e,t)}P.Wb=0;function bo(e,t){var n=/^[A-Za-z_$][\w$]*$/,r=function(o){var i=arguments.length?String(arguments[arguments.length-1]):"",s=Array.prototype.slice.call(arguments,0,-1).join(",").trim();if(s){s=s.split(/\s*,\s*/);for(var u=0;u<s.length;u++){var d=s[u];n.test(d)||S(e,e.T,"Invalid function argument: "+d)}s=s.join(", ")}try{var E=Ae("(function("+s+") {"+i+"})","function"+e.Wb++)}catch(C){S(e,e.T,"Invalid code: "+C.message)}return E.body.length!==1&&S(e,e.T,"Invalid code in function body"),en(e,E.body[0].la,e.N,"anonymous")};e.O=e.i(r,!0),e.g(t,"Function",e.O,v),e.g(e.O,"prototype",e.Z,v),e.g(e.Z,"constructor",e.O,v),e.Z.Ta=function(){},e.Z.Ta.id=e.Ya++,e.Z.Ab=!0,e.g(e.Z,"length",0,J),e.Z.H="Function",r=function(o,i){var s=e.o[e.o.length-1];s.U=this,s.B=o,s.F=[],i!=null&&(i instanceof R?s.F=hr(e,i):S(e,e.j,"CreateListFromArrayLike called on non-object")),s.eb=!1},W(e,e.O,"apply",r),r=function(o){var i=e.o[e.o.length-1];i.U=this,i.B=o,i.F=[];for(var s=1;s<arguments.length;s++)i.F.push(arguments[s]);i.eb=!1},W(e,e.O,"call",r),e.ba.push("Object.defineProperty(Function.prototype, 'bind',","{configurable: true, writable: true, value:","function bind(oThis) {","if (typeof this !== 'function') {","throw TypeError('What is trying to be bound is not callable');","}","var aArgs = Array.prototype.slice.call(arguments, 1),","fToBind = this,","fNOP = function() {},","fBound = function() {","return fToBind.apply(this instanceof fNOP","? this",": oThis,","aArgs.concat(Array.prototype.slice.call(arguments)));","};","if (this.prototype) {","fNOP.prototype = this.prototype;","}","fBound.prototype = new fNOP();","return fBound;","}","});",""),r=function(){return String(this)},W(e,e.O,"toString",r),e.g(e.O,"toString",e.i(r,!1),v),r=function(){return this.valueOf()},W(e,e.O,"valueOf",r),e.g(e.O,"valueOf",e.i(r,!1),v)}function So(e,t){function n(o){o!=null||S(e,e.j,"Cannot convert '"+o+"' to object")}var r=function(o){if(o==null)return ue(e)?this:e.s(e.M);if(!(o instanceof R)){var i=e.s(ce(e,o));return i.data=o,i}return o};e.v=e.i(r,!0),e.g(e.v,"prototype",e.M,v),e.g(e.M,"constructor",e.v,v),e.g(t,"Object",e.v,v),r=function(o){return n(o),se(e,Object.getOwnPropertyNames(o instanceof R?o.h:o))},e.g(e.v,"getOwnPropertyNames",e.i(r,!1),v),r=function(o){return n(o),o instanceof R&&(o=o.h),se(e,Object.keys(o))},e.g(e.v,"keys",e.i(r,!1),v),r=function(o){return o===null?e.s(null):(o instanceof R||S(e,e.j,"Object prototype may only be an Object or null, not "+o),e.s(o))},e.g(e.v,"create",e.i(r,!1),v),e.ba.push("(function() {","var create_ = Object.create;","Object.create = function create(proto, props) {","var obj = create_(proto);","props && Object.defineProperties(obj, props);","return obj;","};","})();",""),r=function(o,i,s){return i=String(i),o instanceof R||S(e,e.j,"Object.defineProperty called on non-object: "+o),s instanceof R||S(e,e.j,"Property description must be an object"),!o.preventExtensions||i in o.h||S(e,e.j,"Can't define property '"+i+"', object is not extensible"),e.g(o,i,Xe,s.h),o},e.g(e.v,"defineProperty",e.i(r,!1),v),e.ba.push("(function() {","var defineProperty_ = Object.defineProperty;","Object.defineProperty = function defineProperty(obj, prop, d1) {","var d2 = {};","if ('configurable' in d1) d2.configurable = d1.configurable;","if ('enumerable' in d1) d2.enumerable = d1.enumerable;","if ('writable' in d1) d2.writable = d1.writable;","if ('value' in d1) d2.value = d1.value;","if ('get' in d1) d2.get = d1.get;","if ('set' in d1) d2.set = d1.set;","return defineProperty_(obj, prop, d2);","};","})();","Object.defineProperty(Object, 'defineProperties',","{configurable: true, writable: true, value:","function defineProperties(obj, props) {","var keys = Object.keys(props);","for (var i = 0; i < keys.length; i++) {","Object.defineProperty(obj, keys[i], props[keys[i]]);","}","return obj;","}","});",""),r=function(o,i){if(o instanceof R||S(e,e.j,"Object.getOwnPropertyDescriptor called on non-object: "+o),i=String(i),i in o.h){var s=Object.getOwnPropertyDescriptor(o.h,i),u=o.V[i];return o=o.Y[i],i=e.s(e.M),u||o?(e.g(i,"get",u),e.g(i,"set",o)):(e.g(i,"value",s.value),e.g(i,"writable",s.writable)),e.g(i,"configurable",s.configurable),e.g(i,"enumerable",s.enumerable),i}},e.g(e.v,"getOwnPropertyDescriptor",e.i(r,!1),v),r=function(o){return n(o),ce(e,o)},e.g(e.v,"getPrototypeOf",e.i(r,!1),v),r=function(o){return!!o&&!o.preventExtensions},e.g(e.v,"isExtensible",e.i(r,!1),v),r=function(o){return o instanceof R&&(o.preventExtensions=!0),o},e.g(e.v,"preventExtensions",e.i(r,!1),v),W(e,e.v,"toString",R.prototype.toString),W(e,e.v,"toLocaleString",R.prototype.toString),W(e,e.v,"valueOf",R.prototype.valueOf),r=function(o){return n(this),this instanceof R?String(o)in this.h:this.hasOwnProperty(o)},W(e,e.v,"hasOwnProperty",r),r=function(o){return n(this),this instanceof R?Object.prototype.propertyIsEnumerable.call(this.h,o):this.propertyIsEnumerable(o)},W(e,e.v,"propertyIsEnumerable",r),r=function(o){for(;;){if(o=ce(e,o),!o)return!1;if(o===this)return!0}},W(e,e.v,"isPrototypeOf",r)}function wo(e,t){var n=function(r){var o=ue(e)?this:Oe(e),i=arguments[0];if(arguments.length===1&&typeof i=="number")isNaN(qt(i))&&S(e,e.ob,"Invalid array length: "+i),o.h.length=i;else{for(i=0;i<arguments.length;i++)o.h[i]=arguments[i];o.h.length=i}return o};e.qa=e.i(n,!0),e.La=e.qa.h.prototype,e.g(t,"Array",e.qa,v),n=function(r){return r&&r.H==="Array"},e.g(e.qa,"isArray",e.i(n,!1),v),e.g(e.La,"length",0,{configurable:!1,enumerable:!1,writable:!0}),e.La.H="Array",e.ba.push("(function() {","function createArrayMethod_(f) {","Object.defineProperty(Array.prototype, f.name,","{configurable: true, writable: true, value: f});","}","createArrayMethod_(","function pop() {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","if (!len || len < 0) {","o.length = 0;","return undefined;","}","len--;","var x = o[len];","delete o[len];","o.length = len;","return x;","}",");","createArrayMethod_(","function push(var_args) {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","for (var i = 0; i < arguments.length; i++) {","o[len] = arguments[i];","len++;","}","o.length = len;","return len;","}",");","createArrayMethod_(","function shift() {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","if (!len || len < 0) {","o.length = 0;","return undefined;","}","var value = o[0];","for (var i = 0; i < len - 1; i++) {","if ((i + 1) in o) {","o[i] = o[i + 1];","} else {","delete o[i];","}","}","delete o[i];","o.length = len - 1;","return value;","}",");","createArrayMethod_(","function unshift(var_args) {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","if (!len || len < 0) {","len = 0;","}","for (var i = len - 1; i >= 0; i--) {","if (i in o) {","o[i + arguments.length] = o[i];","} else {","delete o[i + arguments.length];","}","}","for (var i = 0; i < arguments.length; i++) {","o[i] = arguments[i];","}","return (o.length = len + arguments.length);","}",");","createArrayMethod_(","function reverse() {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","if (!len || len < 2) {","return o;","}","for (var i = 0; i < len / 2 - 0.5; i++) {","var x = o[i];","var hasX = i in o;","if ((len - i - 1) in o) {","o[i] = o[len - i - 1];","} else {","delete o[i];","}","if (hasX) {","o[len - i - 1] = x;","} else {","delete o[len - i - 1];","}","}","return o;","}",");","createArrayMethod_(","function indexOf(searchElement, fromIndex) {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","var n = fromIndex | 0;","if (!len || n >= len) {","return -1;","}","var i = Math.max(n >= 0 ? n : len - Math.abs(n), 0);","while (i < len) {","if (i in o && o[i] === searchElement) {","return i;","}","i++;","}","return -1;","}",");","createArrayMethod_(","function lastIndexOf(searchElement, fromIndex) {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","if (!len) {","return -1;","}","var n = len - 1;","if (arguments.length > 1) {","n = fromIndex | 0;","if (n) {","n = (n > 0 || -1) * Math.floor(Math.abs(n));","}","}","var i = n >= 0 ? Math.min(n, len - 1) : len - Math.abs(n);","while (i >= 0) {","if (i in o && o[i] === searchElement) {","return i;","}","i--;","}","return -1;","}",");","createArrayMethod_(","function slice(start, end) {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","start |= 0;","start = (start >= 0) ? start : Math.max(0, len + start);","if (typeof end !== 'undefined') {","if (end !== Infinity) {","end |= 0;","}","if (end < 0) {","end = len + end;","} else {","end = Math.min(end, len);","}","} else {","end = len;","}","var size = end - start;","var cloned = new Array(size);","for (var i = 0; i < size; i++) {","if ((start + i) in o) {","cloned[i] = o[start + i];","}","}","return cloned;","}",");","createArrayMethod_(","function splice(start, deleteCount, var_args) {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","start |= 0;","if (start < 0) {","start = Math.max(len + start, 0);","} else {","start = Math.min(start, len);","}","if (arguments.length < 1) {","deleteCount = len - start;","} else {","deleteCount |= 0;","deleteCount = Math.max(0, Math.min(deleteCount, len - start));","}","var removed = [];","for (var i = start; i < start + deleteCount; i++) {","if (i in o) {","removed.push(o[i]);","} else {","removed.length++;","}","if ((i + deleteCount) in o) {","o[i] = o[i + deleteCount];","} else {","delete o[i];","}","}","for (var i = start + deleteCount; i < len - deleteCount; i++) {","if ((i + deleteCount) in o) {","o[i] = o[i + deleteCount];","} else {","delete o[i];","}","}","for (var i = len - deleteCount; i < len; i++) {","delete o[i];","}","len -= deleteCount;","var arl = arguments.length - 2;","for (var i = len - 1; i >= start; i--) {","if (i in o) {","o[i + arl] = o[i];","} else {","delete o[i + arl];","}","}","len += arl;","for (var i = 2; i < arguments.length; i++) {","o[start + i - 2] = arguments[i];","}","o.length = len;","return removed;","}",");","createArrayMethod_(","function concat(var_args) {","if (!this) throw TypeError();","var o = Object(this);","var cloned = [];","for (var i = -1; i < arguments.length; i++) {","var value = (i === -1) ? o : arguments[i];","if (Array.isArray(value)) {","for (var j = 0, l = value.length; j < l; j++) {","if (j in value) {","cloned.push(value[j]);","} else {","cloned.length++;","}","}","} else {","cloned.push(value);","}","}","return cloned;","}",");","createArrayMethod_(","function join(opt_separator) {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","var sep = typeof opt_separator === 'undefined' ?","',' : ('' + opt_separator);","var str = '';","for (var i = 0; i < len; i++) {","if (i && sep) str += sep;","str += (o[i] === null || o[i] === undefined) ? '' : o[i];","}","return str;","}",");","createArrayMethod_(","function every(callbackfn, thisArg) {","if (!this || typeof callbackfn !== 'function') throw TypeError();","var t, k = 0;","var o = Object(this), len = o.length >>> 0;","if (arguments.length > 1) t = thisArg;","while (k < len) {","if (k in o && !callbackfn.call(t, o[k], k, o)) return false;","k++;","}","return true;","}",");","createArrayMethod_(","function filter(fun, var_args) {","if (this === void 0 || this === null || typeof fun !== 'function') throw TypeError();","var o = Object(this), len = o.length >>> 0;","var res = [];","var thisArg = arguments.length >= 2 ? arguments[1] : void 0;","for (var i = 0; i < len; i++) {","if (i in o) {","var val = o[i];","if (fun.call(thisArg, val, i, o)) res.push(val);","}","}","return res;","}",");","createArrayMethod_(","function forEach(callback, thisArg) {","if (!this || typeof callback !== 'function') throw TypeError();","var t, k = 0;","var o = Object(this), len = o.length >>> 0;","if (arguments.length > 1) t = thisArg;","while (k < len) {","if (k in o) callback.call(t, o[k], k, o);","k++;","}","}",");","createArrayMethod_(","function map(callback, thisArg) {","if (!this || typeof callback !== 'function') throw TypeError();","var t, k = 0;","var o = Object(this), len = o.length >>> 0;","if (arguments.length > 1) t = thisArg;","var a = new Array(len);","while (k < len) {","if (k in o) a[k] = callback.call(t, o[k], k, o);","k++;","}","return a;","}",");","createArrayMethod_(","function reduce(callback /*, initialValue*/) {","if (!this || typeof callback !== 'function') throw TypeError();","var o = Object(this), len = o.length >>> 0;","var k = 0, value;","if (arguments.length === 2) {","value = arguments[1];","} else {","while (k < len && !(k in o)) k++;","if (k >= len) {","throw TypeError('Reduce of empty array with no initial value');","}","value = o[k++];","}","for (; k < len; k++) {","if (k in o) value = callback(value, o[k], k, o);","}","return value;","}",");","createArrayMethod_(","function reduceRight(callback /*, initialValue*/) {","if (null === this || 'undefined' === typeof this || 'function' !== typeof callback) throw TypeError();","var o = Object(this), len = o.length >>> 0;","var k = len - 1, value;","if (arguments.length >= 2) {","value = arguments[1];","} else {","while (k >= 0 && !(k in o)) k--;","if (k < 0) {","throw TypeError('Reduce of empty array with no initial value');","}","value = o[k--];","}","for (; k >= 0; k--) {","if (k in o) value = callback(value, o[k], k, o);","}","return value;","}",");","createArrayMethod_(","function some(fun/*, thisArg*/) {","if (!this || typeof fun !== 'function') throw TypeError();","var o = Object(this), len = o.length >>> 0;","var thisArg = arguments.length >= 2 ? arguments[1] : void 0;","for (var i = 0; i < len; i++) {","if (i in o && fun.call(thisArg, o[i], i, o)) return true;","}","return false;","}",");","createArrayMethod_(","function sort(opt_comp) {","if (!this) throw TypeError();","if (typeof opt_comp !== 'function') {","opt_comp = undefined;","}","for (var i = 0; i < this.length; i++) {","var changes = 0;","for (var j = 0; j < this.length - i - 1; j++) {","if (opt_comp ? (opt_comp(this[j], this[j + 1]) > 0) :","(String(this[j]) > String(this[j + 1]))) {","var swap = this[j];","var hasSwap = j in this;","if ((j + 1) in this) {","this[j] = this[j + 1];","} else {","delete this[j];","}","if (hasSwap) {","this[j + 1] = swap;","} else {","delete this[j + 1];","}","changes++;","}","}","if (!changes) break;","}","return this;","}",");","createArrayMethod_(","function toLocaleString() {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","var out = [];","for (var i = 0; i < len; i++) {","out[i] = (o[i] === null || o[i] === undefined) ? '' : o[i].toLocaleString();","}","return out.join(',');","}",");","})();","")}function ko(e,t){var n=function(r){return r=arguments.length?ye.String(r):"",ue(e)?(this.data=r,this):r};for(e.J=e.i(n,!0),e.g(t,"String",e.J,v),e.g(e.J,"fromCharCode",e.i(String.fromCharCode,!1),v),t="charAt charCodeAt concat indexOf lastIndexOf slice substr substring toLocaleLowerCase toLocaleUpperCase toLowerCase toUpperCase trim".split(" "),n=0;n<t.length;n++)W(e,e.J,t[n],String.prototype[t[n]]);n=function(r,o,i){o=e.R(o),i=e.R(i);try{return String(this).localeCompare(r,o,i)}catch(s){S(e,e.D,"localeCompare: "+s.message)}},W(e,e.J,"localeCompare",n),n=function(r,o,i){var s=String(this);if(o=o?Number(o):void 0,$(e,r,e.I)&&(r=r.data,We(e,r,i),e.REGEXP_MODE===2)){if(le)r=Le(e,"string.split(separator, limit)",{string:s,separator:r,limit:o},r,i),r!==Te&&i(se(e,r));else{var u=e.ha(),d=$e(e,r,u,i);u.onmessage=function(E){clearTimeout(d),i(se(e,E.data))},u.postMessage(["split",s,r,o])}return}r=s.split(r,o),i(se(e,r))},He(e,e.J,"split",n),n=function(r,o){var i=String(this);if(r=$(e,r,e.I)?r.data:new RegExp(r),We(e,r,o),e.REGEXP_MODE===2)if(le)r=Le(e,"string.match(regexp)",{string:i,regexp:r},r,o),r!==Te&&o(r&&se(e,r));else{var s=e.ha(),u=$e(e,r,s,o);s.onmessage=function(d){clearTimeout(u),o(d.data&&se(e,d.data))},s.postMessage(["match",i,r])}else r=i.match(r),o(r&&se(e,r))},He(e,e.J,"match",n),n=function(r,o){var i=String(this);if($(e,r,e.I)?r=r.data:r=new RegExp(r),We(e,r,o),e.REGEXP_MODE===2)if(le)r=Le(e,"string.search(regexp)",{string:i,regexp:r},r,o),r!==Te&&o(r);else{var s=e.ha(),u=$e(e,r,s,o);s.onmessage=function(d){clearTimeout(u),o(d.data)},s.postMessage(["search",i,r])}else o(i.search(r))},He(e,e.J,"search",n),n=function(r,o,i){var s=String(this);if(o=String(o),$(e,r,e.I)&&(r=r.data,We(e,r,i),e.REGEXP_MODE===2)){if(le)r=Le(e,"string.replace(substr, newSubstr)",{string:s,substr:r,newSubstr:o},r,i),r!==Te&&i(r);else{var u=e.ha(),d=$e(e,r,u,i);u.onmessage=function(E){clearTimeout(d),i(E.data)},u.postMessage(["replace",s,r,o])}return}i(s.replace(r,o))},He(e,e.J,"replace",n),e.ba.push("(function() {","var replace_ = String.prototype.replace;","String.prototype.replace = function replace(substr, newSubstr) {","if (typeof newSubstr !== 'function') {","return replace_.call(this, substr, newSubstr);","}","var str = this;","if (substr instanceof RegExp) {","var subs = [];","var m = substr.exec(str);","while (m) {","m.push(m.index, str);","var inject = newSubstr.apply(null, m);","subs.push([m.index, m[0].length, inject]);","m = substr.global ? substr.exec(str) : null;","}","for (var i = subs.length - 1; i >= 0; i--) {","str = str.substring(0, subs[i][0]) + subs[i][2] + str.substring(subs[i][0] + subs[i][1]);","}","} else {","var i = str.indexOf(substr);","if (i !== -1) {","var inject = newSubstr(str.substr(i, substr.length), i, str);","str = str.substring(0, i) + inject + str.substring(i + substr.length);","}","}","return str;","};","})();","")}function Co(e,t){e.mb=e.i(function(n){return n=ye.Boolean(n),ue(e)?(this.data=n,this):n},!0),e.g(t,"Boolean",e.mb,v)}function Eo(e,t){var n=function(r){return r=arguments.length?ye.Number(r):0,ue(e)?(this.data=r,this):r};for(e.aa=e.i(n,!0),e.g(t,"Number",e.aa,v),t=["MAX_VALUE","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"],n=0;n<t.length;n++)e.g(e.aa,t[n],Number[t[n]],De);n=function(r){try{return Number(this).toExponential(r)}catch(o){S(e,e.D,o.message)}},W(e,e.aa,"toExponential",n),n=function(r){try{return Number(this).toFixed(r)}catch(o){S(e,e.D,o.message)}},W(e,e.aa,"toFixed",n),n=function(r){try{return Number(this).toPrecision(r)}catch(o){S(e,e.D,o.message)}},W(e,e.aa,"toPrecision",n),n=function(r){try{return Number(this).toString(r)}catch(o){S(e,e.D,o.message)}},W(e,e.aa,"toString",n),n=function(r,o){r=r?e.R(r):void 0,o=o?e.R(o):void 0;try{return Number(this).toLocaleString(r,o)}catch(i){S(e,e.D,"toLocaleString: "+i.message)}},W(e,e.aa,"toLocaleString",n)}function Io(e,t){var n=function(o,i){if(!ue(e))return ye.Date();var s=[null].concat(Array.from(arguments));return this.data=new(Function.prototype.bind.apply(ye.Date,s)),this};e.$=e.i(n,!0),e.nb=e.$.h.prototype,e.g(t,"Date",e.$,v),e.g(e.$,"now",e.i(Date.now,!1),v),e.g(e.$,"parse",e.i(Date.parse,!1),v),e.g(e.$,"UTC",e.i(Date.UTC,!1),v),t="getDate getDay getFullYear getHours getMilliseconds getMinutes getMonth getSeconds getTime getTimezoneOffset getUTCDate getUTCDay getUTCFullYear getUTCHours getUTCMilliseconds getUTCMinutes getUTCMonth getUTCSeconds getYear setDate setFullYear setHours setMilliseconds setMinutes setMonth setSeconds setTime setUTCDate setUTCFullYear setUTCHours setUTCMilliseconds setUTCMinutes setUTCMonth setUTCSeconds setYear toDateString toISOString toJSON toGMTString toLocaleDateString toLocaleString toLocaleTimeString toTimeString toUTCString".split(" ");for(var r=0;r<t.length;r++)n=function(o){return function(i){var s=this.data;s instanceof Date||S(e,e.j,o+" not called on a Date");for(var u=[],d=0;d<arguments.length;d++)u[d]=e.R(arguments[d]);return s[o].apply(s,u)}}(t[r]),W(e,e.$,t[r],n)}function jo(e,t){var n=function(r,o){if(ue(e))var i=this;else{if(o===void 0&&$(e,r,e.I))return r;i=e.s(e.Ma)}r=r===void 0?"":String(r),o=o?String(o):"",/^[gmi]*$/.test(o)||S(e,e.T,"Invalid regexp flag: "+o);try{var s=new ye.RegExp(r,o)}catch(u){S(e,e.T,u.message)}return Zt(e,i,s),i};e.I=e.i(n,!0),e.Ma=e.I.h.prototype,e.g(t,"RegExp",e.I,v),e.g(e.I.h.prototype,"global",void 0,J),e.g(e.I.h.prototype,"ignoreCase",void 0,J),e.g(e.I.h.prototype,"multiline",void 0,J),e.g(e.I.h.prototype,"source","(?:)",J),e.ba.push("Object.defineProperty(RegExp.prototype, 'test',","{configurable: true, writable: true, value:","function test(str) {","return !!this.exec(str);","}","});"),n=function(r,o){function i(C){if(C){var w=se(e,C);return e.g(w,"index",C.index),e.g(w,"input",C.input),w}return null}var s=this.data;if(r=String(r),s.lastIndex=Number(e.G(this,"lastIndex")),We(e,s,o),e.REGEXP_MODE===2)if(le)r=Le(e,"regexp.exec(string)",{string:r,regexp:s},s,o),r!==Te&&(e.g(this,"lastIndex",s.lastIndex),o(i(r)));else{var u=e.ha(),d=$e(e,s,u,o),E=this;u.onmessage=function(C){clearTimeout(d),e.g(E,"lastIndex",C.data[1]),o(i(C.data[0]))},u.postMessage(["exec",s,s.lastIndex,r])}else r=s.exec(r),e.g(this,"lastIndex",s.lastIndex),o(i(r))},He(e,e.I,"exec",n)}function To(e,t){function n(r){var o=e.i(function(i){var s=ue(e)?this:e.Aa(o);return Gt(e,s,i),s},!0);return e.g(o,"prototype",e.Aa(e.D),v),e.g(o.h.prototype,"name",r,v),e.g(t,r,o,v),o}e.D=e.i(function(r){var o=ue(e)?this:e.Aa(e.D);return Gt(e,o,r),o},!0),e.g(t,"Error",e.D,v),e.g(e.D.h.prototype,"message","",v),e.g(e.D.h.prototype,"name","Error",v),n("EvalError"),e.ob=n("RangeError"),e.pb=n("ReferenceError"),e.T=n("SyntaxError"),e.j=n("TypeError"),e.Gb=n("URIError")}function Ao(e,t){var n=e.s(e.M);e.g(t,"Math",n,v);var r="E LN2 LN10 LOG2E LOG10E PI SQRT1_2 SQRT2".split(" ");for(t=0;t<r.length;t++)e.g(n,r[t],Math[r[t]],J);for(r="abs acos asin atan atan2 ceil cos exp floor log max min pow random round sin sqrt tan".split(" "),t=0;t<r.length;t++)e.g(n,r[t],e.i(Math[r[t]],!1),v)}function Oo(e,t){var n=e.s(e.M);e.g(t,"JSON",n,v),t=function(r){try{var o=JSON.parse(String(r))}catch(i){S(e,e.T,i.message)}return e.Ia(o)},e.g(n,"parse",e.i(t,!1)),t=function(r,o,i){o&&o.H==="Function"?S(e,e.j,"Function replacer on JSON.stringify not supported"):o&&o.H==="Array"?(o=hr(e,o),o=o.filter(function(u){return typeof u=="string"||typeof u=="number"})):o=null,typeof i!="string"&&typeof i!="number"&&(i=void 0),r=e.R(r);try{var s=JSON.stringify(r,o,i)}catch(u){S(e,e.j,u.message)}return s},e.g(n,"stringify",e.i(t,!1))}function $(e,t,n){if(t==null||!n)return!1;if(n=n.h.prototype,t===n)return!0;for(t=ce(e,t);t;){if(t===n)return!0;t=t.xa}return!1}function Zt(e,t,n){t.data=new RegExp(n.source,n.flags),e.g(t,"lastIndex",n.lastIndex,v),e.g(t,"source",n.source,J),e.g(t,"global",n.global,J),e.g(t,"ignoreCase",n.ignoreCase,J),e.g(t,"multiline",n.multiline,J)}function Gt(e,t,n){n&&e.g(t,"message",String(n),v),n=[];for(var r=e.o.length-1;0<=r;r--){var o=e.o[r],i=o.node;i.type==="CallExpression"&&(o=o.U)&&n.length&&(n[n.length-1].Ob=e.G(o,"name")),!i.X||n.length&&i.type!=="CallExpression"||n.push({Nb:i.X})}for(r=String(e.G(t,"name")),i=String(e.G(t,"message")),i=r+": "+i+`
|
|
@@ -25,7 +25,7 @@ theFunction();
|
|
|
25
25
|
${Lo(n)}
|
|
26
26
|
}`;return e?`${e} {
|
|
27
27
|
${r}
|
|
28
|
-
}`:r};function mt(e){return m.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},id:e.id})}function ln(e){const t=function(){const o=ct({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return fe(o.hide)?!o.hide:fe(o.show)?o.show:!0},n=function(){var b;const o=ct({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),i=o.responsiveStyles,s=e.context.content,u=xr(((b=s==null?void 0:s.meta)==null?void 0:b.breakpoints)||{}),d=i==null?void 0:i.large,E=i==null?void 0:i.medium,C=i==null?void 0:i.small,w=o.id;if(!w)return"";const F=d?Ht({className:w,styles:d}):"",A=E?Ht({className:w,styles:E,mediaQuery:qn("medium",u)}):"",k=C?Ht({className:w,styles:C,mediaQuery:qn("small",u)}):"";return[F,A,k].join(" ")};return m.jsx(m.Fragment,{children:n()&&t()?m.jsx(m.Fragment,{children:m.jsx(mt,{styles:n()})}):null})}function Wo(e){return e.charAt(0).toUpperCase()+e.slice(1)}const $o=e=>`on${Wo(e)}`,Ho=(e,t)=>n=>ht({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1});function Ko(e){const t={},n=e.block.actions??{};for(const r in n){if(!n.hasOwnProperty(r))continue;const o=n[r];let i=$o(r);if(e.stripPrefix)switch(ve){case"
|
|
28
|
+
}`:r};function mt(e){return m.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},id:e.id})}function ln(e){const t=function(){const o=ct({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return fe(o.hide)?!o.hide:fe(o.show)?o.show:!0},n=function(){var b;const o=ct({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),i=o.responsiveStyles,s=e.context.content,u=xr(((b=s==null?void 0:s.meta)==null?void 0:b.breakpoints)||{}),d=i==null?void 0:i.large,E=i==null?void 0:i.medium,C=i==null?void 0:i.small,w=o.id;if(!w)return"";const F=d?Ht({className:w,styles:d}):"",A=E?Ht({className:w,styles:E,mediaQuery:qn("medium",u)}):"",k=C?Ht({className:w,styles:C,mediaQuery:qn("small",u)}):"";return[F,A,k].join(" ")};return m.jsx(m.Fragment,{children:n()&&t()?m.jsx(m.Fragment,{children:m.jsx(mt,{styles:n()})}):null})}function Wo(e){return e.charAt(0).toUpperCase()+e.slice(1)}const $o=e=>`on${Wo(e)}`,Ho=(e,t)=>n=>ht({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1});function Ko(e){const t={},n=e.block.actions??{};for(const r in n){if(!n.hasOwnProperty(r))continue;const o=n[r];let i=$o(r);if(e.stripPrefix)switch(ve){case"vue":i=i.replace("v-on:","");break;case"svelte":i=i.replace("on:","");break}t[i]=Ho(o,e)}return t}function Go({properties:e}){return e.className=e.class,delete e.class,e}const Xo=e=>({href:e.href});function Sr({block:e,context:t}){var r;const n={...Xo(e),...e.properties,"builder-id":e.id,style:e.style?Jo(e.style):void 0,class:[e.id,"builder-block",e.class,(r=e.properties)==null?void 0:r.class].filter(Boolean).join(" ")};return Go({properties:n,context:t,block:e})}function Jo(e){switch(ve){case"svelte":case"vue":case"solid":return br(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const Yo=({componentOptions:e,builderBlock:t,context:n,componentRef:r,includeBlockProps:o,isInteractive:i,contextValue:s})=>i?{Wrapper:r,block:t,context:n,wrapperProps:e}:{...e,...o?{attributes:Sr({block:t,context:s})}:{}};function Zn(e){var n,r;const t=e.isInteractive?q.InteractiveElement:e.componentRef;return m.jsx(m.Fragment,{children:e.componentRef?m.jsx(m.Fragment,{children:m.jsxs(t,{...Yo({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:[(n=e.blockChildren)==null?void 0:n.map(o=>m.jsx(gt,{block:o,context:e.context,registeredComponents:e.registeredComponents},"block-"+o.id)),(r=e.blockChildren)==null?void 0:r.map(o=>m.jsx(ln,{block:o,context:e.context},"block-style-"+o.id))]})}):null})}function zo(e){const t=e.repeatContext;return m.jsx(gt,{block:e.block,context:t,registeredComponents:e.registeredComponents})}function gt(e){var E,C,w,F;const t=function(){return Vo({block:e.block,context:e.context,registeredComponents:e.registeredComponents})},n=function(){return _o({block:e.block,context:e.context})},r=function(){var k;return(k=e.block.repeat)!=null&&k.collection?e.block:ct({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})},o=function(){return e.block.tagName||"div"},i=function(){var N,U;if((N=e.block.repeat)!=null&&N.collection)return!!((U=n())!=null&&U.length);const k="hide"in r()?r().hide:!1;return("show"in r()?r().show:!0)&&!k},s=function(){var b;return!((b=t())!=null&&b.component)&&!n()?r().children??[]:[]},u=function(){var k,b,N,U,g;return{blockChildren:r().children??[],componentRef:(k=t())==null?void 0:k.component,componentOptions:{...lo(r()),builderContext:e.context,...((b=t())==null?void 0:b.name)==="Symbol"||((N=t())==null?void 0:N.name)==="Columns"?{builderComponents:e.registeredComponents}:{}},context:d,registeredComponents:e.registeredComponents,builderBlock:r(),includeBlockProps:((U=t())==null?void 0:U.noWrap)===!0,isInteractive:!((g=t())!=null&&g.isRSC)}},d=e.context;return m.jsx(m.Fragment,{children:i()?m.jsx(m.Fragment,{children:(E=t())!=null&&E.noWrap?m.jsx(m.Fragment,{children:m.jsx(Zn,{componentRef:u().componentRef,componentOptions:u().componentOptions,blockChildren:u().blockChildren,context:u().context,registeredComponents:u().registeredComponents,builderBlock:u().builderBlock,includeBlockProps:u().includeBlockProps,isInteractive:u().isInteractive})}):m.jsxs(m.Fragment,{children:[$t(o())?m.jsx(m.Fragment,{children:m.jsx(q.BlockWrapper,{Wrapper:o(),block:r(),context:e.context,hasChildren:!1})}):null,!$t(o())&&n()?m.jsx(m.Fragment,{children:(C=n())==null?void 0:C.map((A,k)=>m.jsx(zo,{repeatContext:A.context,block:A.block,registeredComponents:e.registeredComponents},k))}):null,!$t(o())&&!n()?m.jsx(m.Fragment,{children:m.jsxs(q.BlockWrapper,{Wrapper:o(),block:r(),context:e.context,hasChildren:!0,children:[m.jsx(Zn,{componentRef:u().componentRef,componentOptions:u().componentOptions,blockChildren:u().blockChildren,context:u().context,registeredComponents:u().registeredComponents,builderBlock:u().builderBlock,includeBlockProps:u().includeBlockProps,isInteractive:u().isInteractive}),(w=s())==null?void 0:w.map(A=>m.jsx(gt,{block:A,context:d,registeredComponents:e.registeredComponents},"block-"+A.id)),(F=s())==null?void 0:F.map(A=>m.jsx(ln,{block:A,context:d},"block-style-"+A.id))]})}):null]})}):null})}function yt(e){var t,n,r,o;return m.jsxs(q.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?m.jsx(m.Fragment,{children:(r=e.blocks)==null?void 0:r.map(i=>m.jsx(gt,{block:i,context:e.context,registeredComponents:e.registeredComponents},"render-block-"+i.id))}):null,e.blocks?m.jsx(m.Fragment,{children:(o=e.blocks)==null?void 0:o.map(i=>m.jsx(ln,{block:i,context:e.context},"block-style-"+i.id))}):null]})}function wr(e){var A;const t=typeof e.space=="number"?e.space||0:20,n=e.columns||[],r=e.stackColumnsAt||"tablet",o=function(b){var N;return((N=n[b])==null?void 0:N.width)||100/n.length},i=function(b){const N=t*(n.length-1)/n.length;return`calc(${o(b)}% - ${N}px)`},s=function({stackedStyle:b,desktopStyle:N}){return r==="tablet"?b:N},u=function({stackedStyle:b,desktopStyle:N}){return r==="never"?N:b},d=e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column",E=function(){return{"--flex-dir":d,"--flex-dir-tablet":s({stackedStyle:d,desktopStyle:"row"})}},C=function(b){const N=b===0?0:t,U=i(b),g=`${N}px`,pe="100%",de=0;return{width:U,["marginLeft"]:g,"--column-width-mobile":u({stackedStyle:pe,desktopStyle:U}),"--column-margin-left-mobile":u({stackedStyle:de,desktopStyle:g}),"--column-width-tablet":s({stackedStyle:pe,desktopStyle:U}),"--column-margin-left-tablet":s({stackedStyle:de,desktopStyle:g})}},w=function(b){var U,g;return xr(((g=(U=e.builderContext.content)==null?void 0:U.meta)==null?void 0:g.breakpoints)||{})[b].max},F=function(){return`
|
|
29
29
|
@media (max-width: ${w("medium")}px) {
|
|
30
30
|
.${e.builderBlock.id}-breakpoints {
|
|
31
31
|
flex-direction: var(--flex-dir-tablet);
|
|
@@ -155,7 +155,7 @@ theFunction();
|
|
|
155
155
|
)`,Ni=({contentId:e,variationId:t})=>`window.${Rr}(
|
|
156
156
|
"${t}", "${e}", ${Pr}
|
|
157
157
|
)`;function Yt(e){return m.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},id:e.id||""})}const Fi=e=>{const t=e.get("preview"),n=e.get("overrides."+t);return n||Y.warn("No previewed ID found in search params."),n};function Nr(){globalThis._BUILDER_PREVIEW_LRU_CACHE||(globalThis._BUILDER_PREVIEW_LRU_CACHE=new ao.LRUCache({max:500,ttl:1e3*60*5}))}function Bi(e){Nr();const t=Fi(e);return typeof t=="string"?globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t):void 0}function Mi(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:globalThis}function Ui(){const e=Mi().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.
|
|
158
|
-
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 Fr=Ui();function lt(e,t=null,n="."){return Object.keys(e).reduce((r,o)=>{const i=e[o],s=[t,o].filter(Boolean).join(n);return[typeof i=="object",i!==null,!(Array.isArray(i)&&i.length===0)].every(Boolean)?{...r,...lt(i,s,n)}:{...r,[s]:i}},{})}const Vi="v3",nr="builder.",_i="options.",Di=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},un=e=>{if(!e)return{};const t=Br(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(nr)){const o=r.replace(nr,"").replace(_i,"");n[o]=t[r]}}),n},Li=()=>{if(!K())return{};const e=new URLSearchParams(window.location.search);return un(e)},Br=e=>e instanceof URLSearchParams?Di(e):e,rr=e=>typeof e=="number"&&!isNaN(e)&&e>=0,fn=e=>{let{noTraverse:t=!1}=e;const{limit:n=30,userAttributes:r,query:o,model:i,apiKey:s,includeRefs:u=!0,enrich:d,locale:E,apiVersion:C=Vi,fields:w,omit:F,offset:A,cacheSeconds:k,staleCacheSeconds:b,sort:N,includeUnpublished:U}=e;if(!s)throw new Error("Missing API key");if(!["v2","v3"].includes(C))throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${C}'`);(e.limit===void 0||e.limit>1)&&!("noTraverse"in e)&&(t=!0);const g=new URL(`https://cdn.builder.io/api/${C}/content/${i}?apiKey=${s}&limit=${n}&noTraverse=${t}&includeRefs=${u}${E?`&locale=${E}`:""}${d?`&enrich=${d}`:""}`);if(g.searchParams.set("omit",F||"meta.componentsUsed"),w&&g.searchParams.set("fields",w),Number.isFinite(A)&&A>-1&&g.searchParams.set("offset",String(Math.floor(A))),typeof U=="boolean"&&g.searchParams.set("includeUnpublished",String(U)),k&&rr(k)&&g.searchParams.set("cacheSeconds",String(k)),b&&rr(b)&&g.searchParams.set("staleCacheSeconds",String(b)),N){const Z=lt({sort:N});for(const B in Z)g.searchParams.set(B,JSON.stringify(Z[B]))}const pe={...Li(),...Br(e.options||{})},de=lt(pe);for(const Z in de)g.searchParams.set(Z,String(de[Z]));if(r&&g.searchParams.set("userAttributes",JSON.stringify(r)),o){const Z=lt({query:o});for(const B in Z)g.searchParams.set(B,JSON.stringify(Z[B]))}return g},Wi=e=>"results"in e;async function vt(e){const t=await pn({...e,limit:1});return t&&t[0]||null}const $i=vt,Hi=async e=>{const t=fn(e);return await(await Fr(t.href)).json()},Mr=async(e,t,n=fn(e))=>{const r=ut(e.canTrack);if(n.search.includes("preview=")){const i=[];for(const s of t.results){const u=Bi(n.searchParams);i.push(u||s)}t.results=i}if(!r||!(K()||ve==="reactNative"))return t.results;try{const i=[];for(const s of t.results)i.push(await ui({item:s,canTrack:r}));t.results=i}catch(i){Y.error("Could not process A/B tests. ",i)}return t.results};async function pn(e){try{const t=fn(e),n=await Hi(e);return Wi(n)?Mr(e,n):(Y.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return Y.error("Error fetching data. ",t),null}}const Ki=pn;function Gi(){return!K()||ft()?!1:location.search.indexOf("builder.preview=")!==-1}function Xi(){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 Ur(){return Xi().replace(/-/g,"")}const Vr="builderSessionId",Ji=async({canTrack:e})=>{if(!e)return;const t=await Cr({name:Vr,canTrack:e});if(fe(t))return t;{const n=Yi();return zi({id:n,canTrack:e}),n}},Yi=()=>Ur(),zi=({id:e,canTrack:t})=>Er({name:Vr,value:e,canTrack:t}),_r=()=>K()&&typeof localStorage<"u"?localStorage:void 0,qi=({key:e,canTrack:t})=>{var n;try{return t?(n=_r())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},Zi=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=_r())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},Dr="builderVisitorId",Qi=({canTrack:e})=>{if(!e)return;const t=qi({key:Dr,canTrack:e});if(fe(t))return t;{const n=ea();return ta({id:n,canTrack:e}),n}},ea=()=>Ur(),ta=({id:e,canTrack:t})=>Zi({key:Dr,value:e,canTrack:t}),na=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await Ji({canTrack:e}),n=Qi({canTrack:e});return{sessionId:t,visitorId:n}},ra=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await na({canTrack:t}),userAttributes:ur(),ownerId:n}});async function Lr(e){if(!e.apiKey){Y.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!ft()&&(K()||ve==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await ra(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const oa=e=>Lr({...e,canTrack:!0});function or(e){return Math.round(e*1e3)/1e3}const ia=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let r=n?e:e.parentElement;do{if(!r)return null;if(t(r))return r}while(r=r.parentElement);return null},aa=e=>ia(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),ir=({event:e,target:t})=>{const n=t.getBoundingClientRect(),r=e.clientX-n.left,o=e.clientY-n.top,i=or(r/n.width),s=or(o/n.height);return{x:i,y:s}},sa=e=>{const t=e.target,n=t&&aa(t),r=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:r||void 0,metadata:{targetOffset:t?ir({event:e,target:t}):void 0,builderTargetOffset:n?ir({event:e,target:n}):void 0,builderElementIndex:n&&r?[].slice.call(document.getElementsByClassName(r)).indexOf(n):void 0}}},la="0.
|
|
158
|
+
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 Fr=Ui();function lt(e,t=null,n="."){return Object.keys(e).reduce((r,o)=>{const i=e[o],s=[t,o].filter(Boolean).join(n);return[typeof i=="object",i!==null,!(Array.isArray(i)&&i.length===0)].every(Boolean)?{...r,...lt(i,s,n)}:{...r,[s]:i}},{})}const Vi="v3",nr="builder.",_i="options.",Di=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},un=e=>{if(!e)return{};const t=Br(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(nr)){const o=r.replace(nr,"").replace(_i,"");n[o]=t[r]}}),n},Li=()=>{if(!K())return{};const e=new URLSearchParams(window.location.search);return un(e)},Br=e=>e instanceof URLSearchParams?Di(e):e,rr=e=>typeof e=="number"&&!isNaN(e)&&e>=0,fn=e=>{let{noTraverse:t=!1}=e;const{limit:n=30,userAttributes:r,query:o,model:i,apiKey:s,includeRefs:u=!0,enrich:d,locale:E,apiVersion:C=Vi,fields:w,omit:F,offset:A,cacheSeconds:k,staleCacheSeconds:b,sort:N,includeUnpublished:U}=e;if(!s)throw new Error("Missing API key");if(!["v2","v3"].includes(C))throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${C}'`);(e.limit===void 0||e.limit>1)&&!("noTraverse"in e)&&(t=!0);const g=new URL(`https://cdn.builder.io/api/${C}/content/${i}?apiKey=${s}&limit=${n}&noTraverse=${t}&includeRefs=${u}${E?`&locale=${E}`:""}${d?`&enrich=${d}`:""}`);if(g.searchParams.set("omit",F||"meta.componentsUsed"),w&&g.searchParams.set("fields",w),Number.isFinite(A)&&A>-1&&g.searchParams.set("offset",String(Math.floor(A))),typeof U=="boolean"&&g.searchParams.set("includeUnpublished",String(U)),k&&rr(k)&&g.searchParams.set("cacheSeconds",String(k)),b&&rr(b)&&g.searchParams.set("staleCacheSeconds",String(b)),N){const Z=lt({sort:N});for(const B in Z)g.searchParams.set(B,JSON.stringify(Z[B]))}const pe={...Li(),...Br(e.options||{})},de=lt(pe);for(const Z in de)g.searchParams.set(Z,String(de[Z]));if(r&&g.searchParams.set("userAttributes",JSON.stringify(r)),o){const Z=lt({query:o});for(const B in Z)g.searchParams.set(B,JSON.stringify(Z[B]))}return g},Wi=e=>"results"in e;async function vt(e){const t=await pn({...e,limit:1});return t&&t[0]||null}const $i=vt,Hi=async e=>{const t=fn(e);return await(await Fr(t.href)).json()},Mr=async(e,t,n=fn(e))=>{const r=ut(e.canTrack);if(n.search.includes("preview=")){const i=[];for(const s of t.results){const u=Bi(n.searchParams);i.push(u||s)}t.results=i}if(!r||!(K()||ve==="reactNative"))return t.results;try{const i=[];for(const s of t.results)i.push(await ui({item:s,canTrack:r}));t.results=i}catch(i){Y.error("Could not process A/B tests. ",i)}return t.results};async function pn(e){try{const t=fn(e),n=await Hi(e);return Wi(n)?Mr(e,n):(Y.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return Y.error("Error fetching data. ",t),null}}const Ki=pn;function Gi(){return!K()||ft()?!1:location.search.indexOf("builder.preview=")!==-1}function Xi(){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 Ur(){return Xi().replace(/-/g,"")}const Vr="builderSessionId",Ji=async({canTrack:e})=>{if(!e)return;const t=await Cr({name:Vr,canTrack:e});if(fe(t))return t;{const n=Yi();return zi({id:n,canTrack:e}),n}},Yi=()=>Ur(),zi=({id:e,canTrack:t})=>Er({name:Vr,value:e,canTrack:t}),_r=()=>K()&&typeof localStorage<"u"?localStorage:void 0,qi=({key:e,canTrack:t})=>{var n;try{return t?(n=_r())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},Zi=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=_r())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},Dr="builderVisitorId",Qi=({canTrack:e})=>{if(!e)return;const t=qi({key:Dr,canTrack:e});if(fe(t))return t;{const n=ea();return ta({id:n,canTrack:e}),n}},ea=()=>Ur(),ta=({id:e,canTrack:t})=>Zi({key:Dr,value:e,canTrack:t}),na=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await Ji({canTrack:e}),n=Qi({canTrack:e});return{sessionId:t,visitorId:n}},ra=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await na({canTrack:t}),userAttributes:ur(),ownerId:n}});async function Lr(e){if(!e.apiKey){Y.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!ft()&&(K()||ve==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await ra(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const oa=e=>Lr({...e,canTrack:!0});function or(e){return Math.round(e*1e3)/1e3}const ia=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let r=n?e:e.parentElement;do{if(!r)return null;if(t(r))return r}while(r=r.parentElement);return null},aa=e=>ia(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),ir=({event:e,target:t})=>{const n=t.getBoundingClientRect(),r=e.clientX-n.left,o=e.clientY-n.top,i=or(r/n.width),s=or(o/n.height);return{x:i,y:s}},sa=e=>{const t=e.target,n=t&&aa(t),r=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:r||void 0,metadata:{targetOffset:t?ir({event:e,target:t}):void 0,builderTargetOffset:n?ir({event:e,target:n}):void 0,builderElementIndex:n&&r?[].slice.call(document.getElementsByClassName(r)).indexOf(n):void 0}}},la="0.11.0",ar={};function Wr(e,t){let n=ar[e];if(n||(n=ar[e]=[]),n.push(t),K()){const r={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(r,"*"),parent!==window&&window.postMessage(r,"*")}catch(o){console.debug("Could not postmessage",o)}}}const ca=()=>{Wr("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 sr=!1;const ua=(e={})=>{var t,n;sr||(sr=!0,K()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:ve,version:la,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",({data:r})=>{var o,i;if(r!=null&&r.type)switch(r.type){case"builder.evaluate":{const s=r.data.text,u=r.data.arguments||[],d=r.data.id,E=new Function(s);let C,w=null;try{C=E.apply(null,u)}catch(F){w=F}w?(o=window.parent)==null||o.postMessage({type:"builder.evaluateError",data:{id:d,error:w.message}},"*"):C&&typeof C.then=="function"?C.then(F=>{var A;(A=window.parent)==null||A.postMessage({type:"builder.evaluateResult",data:{id:d,result:F}},"*")}).catch(console.error):(i=window.parent)==null||i.postMessage({type:"builder.evaluateResult",data:{result:C,id:d}},"*");break}}})))},fa=e=>{var i;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],r=e.fileUrl??((i=e==null?void 0:e.files)==null?void 0:i.regular);let o="";if(r&&t&&n&&(o+=`
|
|
159
159
|
@font-face {
|
|
160
160
|
font-family: "${t}";
|
|
161
161
|
src: local("${n}"), url('${r}') format('woff2');
|
package/lib/edge/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bundle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bundle-b154d2ce.cjs"),t=require("./USE_CLIENT_BUNDLE-97438f67.cjs");require("lru-cache");require("react/jsx-runtime");require("react");require("next/navigation");require("./USE_SERVER_BUNDLE-3783d376.cjs");exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.RenderBlocks=e.RenderBlocks;exports.RenderContent=e.RenderContent;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.getAllContent=e.getAllContent;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.getContent=e.getContent;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.track=e.track;exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;
|
package/lib/edge/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { B as i, t as m, C as c, R as g, q as p, S as l, T as C, w as d, m as f, E as u, x as B, n as S, y as E, A as R, z as h, i as x, f as k, u as y, v as P, D as b } from "./bundle-
|
|
2
|
-
import { b as w, F as A, c as F, S as T, V } from "./USE_CLIENT_BUNDLE-
|
|
1
|
+
import { B as i, t as m, C as c, R as g, q as p, S as l, T as C, w as d, m as f, E as u, x as B, n as S, y as E, A as R, z as h, i as x, f as k, u as y, v as P, D as b } from "./bundle-28c9300c.js";
|
|
2
|
+
import { b as w, F as A, c as F, S as T, V } from "./USE_CLIENT_BUNDLE-1cacf6c8.js";
|
|
3
3
|
import "lru-cache";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
6
|
import "next/navigation";
|
|
7
|
-
import "./USE_SERVER_BUNDLE-
|
|
7
|
+
import "./USE_SERVER_BUNDLE-668b44ba.js";
|
|
8
8
|
export {
|
|
9
9
|
i as Blocks,
|
|
10
10
|
w as Button,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as C, Fragment as m, jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import { g as T, a as B, i as E, b as R, c as Y, d as P, e as U, _ as H, f as Z, l as p, h as O, j as ee, k as te, r as ne, s as ie, m as ae, n as ce, o as re } from "./bundle-
|
|
3
|
+
import { g as T, a as B, i as E, b as R, c as Y, d as P, e as U, _ as H, f as Z, l as p, h as O, j as ee, k as te, r as ne, s as ie, m as ae, n as ce, o as re } from "./bundle-24b5f3b0.js";
|
|
4
4
|
import { useRef as N, useState as k, useEffect as v, createContext as oe, createElement as le } from "react";
|
|
5
|
-
import { p as de } from "./USE_SERVER_BUNDLE-
|
|
5
|
+
import { p as de } from "./USE_SERVER_BUNDLE-1b907ae9.js";
|
|
6
6
|
import { useRouter as se } from "next/navigation";
|
|
7
7
|
function Se(e) {
|
|
8
8
|
return /* @__PURE__ */ C(m, { children: [
|
|
@@ -20,11 +20,11 @@ function Se(e) {
|
|
|
20
20
|
{
|
|
21
21
|
...e.attributes,
|
|
22
22
|
style: e.attributes.style,
|
|
23
|
-
className: e.attributes.className + " button-
|
|
23
|
+
className: e.attributes.className + " button-3ecc5438",
|
|
24
24
|
children: e.text
|
|
25
25
|
}
|
|
26
26
|
) }),
|
|
27
|
-
/* @__PURE__ */ i("style", { children: `.button-
|
|
27
|
+
/* @__PURE__ */ i("style", { children: `.button-3ecc5438 {
|
|
28
28
|
all: unset;
|
|
29
29
|
}` })
|
|
30
30
|
] });
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use client";"use strict";const t=require("react/jsx-runtime"),c=require("./bundle-
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),c=require("./bundle-a7c78519.cjs"),l=require("react"),V=require("./USE_SERVER_BUNDLE-3c56bf9c.cjs"),A=require("next/navigation");function D(e){return t.jsxs(t.Fragment,{children:[e.link?t.jsx(t.Fragment,{children:t.jsx("a",{...e.attributes,href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"button",children:e.text})}):t.jsx(t.Fragment,{children:t.jsx("button",{...e.attributes,style:e.attributes.style,className:e.attributes.className+" button-3ecc5438",children:e.text})}),t.jsx("style",{children:`.button-3ecc5438 {
|
|
2
2
|
all: unset;
|
|
3
3
|
}`})]})}function U(e){return t.jsxs(t.Fragment,{children:[" ",e.hasChildren?t.jsx(t.Fragment,{children:t.jsxs(e.Wrapper,{...c.getBlockProperties({block:e.block,context:e.context}),...c.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," "]})}):t.jsx(t.Fragment,{children:t.jsx(e.Wrapper,{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0})})})," "]})}function H(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:{...c.getBlockProperties({block:e.block,context:e.context}),...c.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 a(){var s;return"builder-blocks"+((s=e.blocks)!=null&&s.length?"":" no-blocks")}function g(){var s,f;c.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((f=window.parent)==null||f.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function x(){var s,f;c.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((f=window.parent)==null||f.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:a()+" props-blocks-wrapper-4f2c12d8","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:s=>g(),onMouseEnter:s=>x(),onKeyPress:s=>g(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-4f2c12d8 {
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: column;
|
|
6
6
|
align-items: stretch;
|
|
7
|
-
}`})]})}function J(e){return t.jsx("span",{children:e.children})}function $(e){var s,f,S,v;function a(){var
|
|
7
|
+
}`})]})}function J(e){return t.jsx("span",{children:e.children})}function $(e){var s,f,S,v;function a(){var b;const r=e.image||e.src;if(!r||!(r.match(/builder\.io/)||r.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((b=e.image)!=null&&b.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),c.getSrcSet(r)}else if(e.image&&!e.srcset)return c.getSrcSet(r);return c.getSrcSet(r)}function g(){var h;return(h=a==null?void 0:a())!=null&&h.match(/builder\.io/)&&!e.noWebp?a().replace(/\?/g,"?format=webp&"):""}function x(){const h={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?h:void 0}return t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[g()?t.jsx(t.Fragment,{children:t.jsx("source",{type:"image/webp",srcSet:g()})}):null,t.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?"presentation":void 0,style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...x()},className:"builder-image"+(e.className?" "+e.className:"")+" img-dbab4030",src:e.image,srcSet:a(),sizes:e.sizes})]}),e.aspectRatio&&!((f=(s=e.builderBlock)==null?void 0:s.children)!=null&&f.length&&e.fitContent)?t.jsx(t.Fragment,{children:t.jsx("div",{className:"builder-image-sizer div-dbab4030",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(v=(S=e.builderBlock)==null?void 0:S.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&e.children?t.jsx(t.Fragment,{children:t.jsx("div",{className:"div-dbab4030-2",children:e.children})}):null]}),t.jsx("style",{children:`.img-dbab4030 {
|
|
8
8
|
opacity: 1;
|
|
9
9
|
transition: opacity 0.2s ease-in-out;
|
|
10
10
|
}.div-dbab4030 {
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
left: 0;
|
|
21
21
|
width: 100%;
|
|
22
22
|
height: 100%;
|
|
23
|
-
}`})]})}function G(e){return t.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 Q(e){const a=l.useRef(null),[g,x]=l.useState(()=>[]),[s,f]=l.useState(()=>[]);return l.useEffect(()=>{var v;if(!((v=a.current)!=null&&v.getElementsByTagName)||typeof window>"u")return;const S=a.current.getElementsByTagName("script");for(let
|
|
23
|
+
}`})]})}function G(e){return t.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 Q(e){const a=l.useRef(null),[g,x]=l.useState(()=>[]),[s,f]=l.useState(()=>[]);return l.useEffect(()=>{var v;if(!((v=a.current)!=null&&v.getElementsByTagName)||typeof window>"u")return;const S=a.current.getElementsByTagName("script");for(let h=0;h<S.length;h++){const r=S[h];if(r.src){if(g.includes(r.src))continue;g.push(r.src);const b=document.createElement("script");b.async=!0,b.src=r.src,document.head.appendChild(b)}else if(!r.type||["text/javascript","application/javascript","application/ecmascript"].includes(r.type)){if(s.includes(r.innerText))continue;try{s.push(r.innerText),new Function(r.innerText)()}catch(b){console.warn("`CustomCode`: Error running script:",b)}}}},[]),t.jsx("div",{ref:a,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function X(e){const a=l.useRef(null),[g,x]=l.useState(()=>[]),[s,f]=l.useState(()=>[]),[S,v]=l.useState(()=>!1);function h(){if(!a.current||!a.current.getElementsByTagName)return;const r=a.current.getElementsByTagName("script");for(let b=0;b<r.length;b++){const k=r[b];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(c.isJsScript(k)&&!s.includes(k.innerText))try{s.push(k.innerText),new Function(k.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return l.useEffect(()=>{a.current&&!S&&(v(!0),h())},[a.current,S]),t.jsx("div",{className:"builder-embed",ref:a,dangerouslySetInnerHTML:{__html:e.content}})}function Y(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},c.isEditing()&&e.imgSrc||"default-key")}function Z(e){var x,s,f,S,v,h,r;function a(){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{...a()}}return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("video",{className:"builder-video",...g(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(x=e.attributes)==null?void 0:x.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:t.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((f=(s=e.builderBlock)==null?void 0:s.children)!=null&&f.length))?t.jsx(t.Fragment,{children:t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}})}):null,(v=(S=e.builderBlock)==null?void 0:S.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children:t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children})}):null,(r=(h=e.builderBlock)==null?void 0:h.children)!=null&&r.length&&!e.fitContent?t.jsx(t.Fragment,{children:t.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 p=l.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function ee(e){var I,P,B,F,T,N,L;const a=l.useRef(null),[g,x]=l.useState(()=>0);function s(n){var o,d,u,m,W;const i={...e.builderContextSignal.content,...n,data:{...(o=e.builderContextSignal.content)==null?void 0:o.data,...n==null?void 0:n.data},meta:{...(d=e.builderContextSignal.content)==null?void 0:d.meta,...n==null?void 0:n.meta,breakpoints:((u=n==null?void 0:n.meta)==null?void 0:u.breakpoints)||((W=(m=e.builderContextSignal.content)==null?void 0:m.meta)==null?void 0:W.breakpoints)}};V.postPreviewContent({value:i,key:i.id}).then(()=>{M.refresh()})}l.useState(()=>0);const[f,S]=l.useState(()=>!1),[v,h]=l.useState(()=>e.contentWrapper||"div");function r(n){var o;const{data:i}=n;if(i)switch(i.type){case"builder.configureSdk":{const d=i.data,{breakpoints:u,contentId:m}=d;if(!m||m!==((o=e.builderContextSignal.content)==null?void 0:o.id))return;u&&s({meta:{breakpoints:u}}),x(g+1);break}case"builder.contentUpdate":{const d=i.data,u=d.key||d.alias||d.entry||d.modelName,m=d.data;u===e.model&&(s(m),x(g+1));break}}}function b(){var i,o;const n=(o=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:o.jsCode;n&&c.evaluate({code:n,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[k,y]=l.useState(()=>({})),[E,K]=l.useState(()=>!1);function q(n){var i,o;if(e.builderContextSignal.content){const d=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(o=e.builderContextSignal.content)==null?void 0:o.id;c._track({type:"click",canTrack:c.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:d!==u?d:void 0,...c.getInteractionPropertiesForEvent(n),unique:!E})}E||K(!0)}function _(n){return n.replace(/{{([^}]+)}}/g,(i,o)=>c.evaluate({code:o,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function z({url:n,key:i}){c.fetch(n).then(o=>o.json()).then(o=>{var u,m;const d={...e.builderContextSignal.rootState,[i]:o};(m=(u=e.builderContextSignal).rootSetState)==null||m.call(u,d),k[i]=!0}).catch(o=>{console.error("error fetching dynamic data",n,o)})}function j(){var i,o;const n=((o=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:o.httpRequests)??{};Object.entries(n).forEach(([d,u])=>{if(u&&(!k[d]||c.isEditing())){const m=_(u);z({url:m,key:d})}})}function C(){c.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:c.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function w(n){x(g+1),window.addEventListener("message",r),c.registerInsertMenu(),c.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.includeRefs?{includeRefs:e.includeRefs}:{},...e.enrich?{enrich:e.enrich}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(i=>{var d;const o=c.createRegisterComponentMessage(i);(d=window.parent)==null||d.postMessage(o,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",C)}function R(n){const i=new URL(location.href).searchParams,o=i.get("builder.preview"),d=i.get(`builder.preview.${o}`),u=i.get("apiKey")||i.get("builder.space");o===e.model&&u===e.apiKey&&(!e.content||d===e.content.id)&&c.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(m=>{m&&s(m)})}const M=A.useRouter();return l.useEffect(()=>{var n;return(n=a.current)==null||n.addEventListener("initeditingbldr",w),()=>{var i;return(i=a.current)==null?void 0:i.removeEventListener("initeditingbldr",w)}},[]),l.useEffect(()=>{var n;return(n=a.current)==null||n.addEventListener("initpreviewingbldr",R),()=>{var i;return(i=a.current)==null?void 0:i.removeEventListener("initpreviewingbldr",R)}},[]),l.useEffect(()=>{var n,i;if(c.isBrowser()){if(c.isEditing()&&a.current&&a.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&c.getDefaultCanTrack(e.canTrack)){const d=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,u=(i=e.builderContextSignal.content)==null?void 0:i.id,m=e.apiKey;c._track({type:"impression",canTrack:!0,contentId:u,apiKey:m,variationId:d!==u?d:void 0})}c.isPreviewing()&&a.current}},[]),l.useEffect(()=>{e.apiKey||c.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),b(),j(),C()},[]),l.useEffect(()=>{},[e.content]),l.useEffect(()=>{c.isBrowser()&&(window.removeEventListener("message",r),window.addEventListener("message",r))},[f]),l.useEffect(()=>{b()},[(P=(I=e.builderContextSignal.content)==null?void 0:I.data)==null?void 0:P.jsCode,e.builderContextSignal.rootState]),l.useEffect(()=>{j()},[(F=(B=e.builderContextSignal.content)==null?void 0:B.data)==null?void 0:F.httpRequests]),l.useEffect(()=>{C()},[e.builderContextSignal.rootState]),l.useEffect(()=>()=>{c.isBrowser()&&(window.removeEventListener("message",r),window.removeEventListener("builder:component:stateChangeListenerActivated",C))},[]),t.jsx(p.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(t.Fragment,{children:l.createElement(v,{key:g,ref:a,onClick:n=>q(n),"builder-content-id":(T=e.builderContextSignal.content)==null?void 0:T.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((N=e.content)==null?void 0:N.testVariationId)||((L=e.content)==null?void 0:L.id)}`},e.children)}):null})}exports.BlockWrapper=U;exports.BlocksWrapper=O;exports.Button=D;exports.CustomCode=Q;exports.Embed=X;exports.EnableEditor=ee;exports.FragmentComponent=J;exports.Image=$;exports.ImgComponent=Y;exports.InteractiveElement=H;exports.SectionComponent=G;exports.Video=Z;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use server";"use strict";const n=require("./bundle-
|
|
1
|
+
"use server";"use strict";const n=require("./bundle-a7c78519.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 { LRUCache } from "lru-cache";
|
|
2
2
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { createElement } from "react";
|
|
4
|
-
import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, b as Button, C as CustomCode, E as Embed, F as FragmentComponent, c as Image, d as ImgComponent, S as SectionComponent, V as Video, e as EnableEditor } from "./USE_CLIENT_BUNDLE-
|
|
4
|
+
import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, b as Button, C as CustomCode, E as Embed, F as FragmentComponent, c as Image, d as ImgComponent, S as SectionComponent, V as Video, e as EnableEditor } from "./USE_CLIENT_BUNDLE-674c3a2b.js";
|
|
5
5
|
import "next/navigation";
|
|
6
6
|
function getBlockComponentOptions(e) {
|
|
7
7
|
var t;
|
|
@@ -479,8 +479,7 @@ function getBlockActions(e) {
|
|
|
479
479
|
let i = getEventHandlerName(o);
|
|
480
480
|
if (e.stripPrefix)
|
|
481
481
|
switch (TARGET) {
|
|
482
|
-
case "
|
|
483
|
-
case "vue3":
|
|
482
|
+
case "vue":
|
|
484
483
|
i = i.replace("v-on:", "");
|
|
485
484
|
break;
|
|
486
485
|
case "svelte":
|
|
@@ -520,8 +519,7 @@ function getBlockProperties({
|
|
|
520
519
|
function getStyleAttribute(e) {
|
|
521
520
|
switch (TARGET) {
|
|
522
521
|
case "svelte":
|
|
523
|
-
case "
|
|
524
|
-
case "vue3":
|
|
522
|
+
case "vue":
|
|
525
523
|
case "solid":
|
|
526
524
|
return convertStyleMapToCSSArray(e).join(" ");
|
|
527
525
|
case "qwik":
|
|
@@ -792,12 +790,12 @@ function Columns(e) {
|
|
|
792
790
|
})
|
|
793
791
|
};
|
|
794
792
|
}, f = function(d) {
|
|
795
|
-
const b = d === 0 ? 0 : t, y = i(d), h = `${b}px`,
|
|
793
|
+
const b = d === 0 ? 0 : t, y = i(d), h = `${b}px`, k = "100%", x = 0;
|
|
796
794
|
return {
|
|
797
795
|
width: y,
|
|
798
796
|
["marginLeft"]: h,
|
|
799
797
|
"--column-width-mobile": s({
|
|
800
|
-
stackedStyle:
|
|
798
|
+
stackedStyle: k,
|
|
801
799
|
desktopStyle: y
|
|
802
800
|
}),
|
|
803
801
|
"--column-margin-left-mobile": s({
|
|
@@ -805,7 +803,7 @@ function Columns(e) {
|
|
|
805
803
|
desktopStyle: h
|
|
806
804
|
}),
|
|
807
805
|
"--column-width-tablet": a({
|
|
808
|
-
stackedStyle:
|
|
806
|
+
stackedStyle: k,
|
|
809
807
|
desktopStyle: y
|
|
810
808
|
}),
|
|
811
809
|
"--column-margin-left-tablet": a({
|
|
@@ -1898,10 +1896,10 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
1898
1896
|
for (const C in S)
|
|
1899
1897
|
h.searchParams.set(C, JSON.stringify(S[C]));
|
|
1900
1898
|
}
|
|
1901
|
-
const
|
|
1899
|
+
const k = {
|
|
1902
1900
|
...getBuilderSearchParamsFromWindow(),
|
|
1903
1901
|
...normalizeSearchParams(e.options || {})
|
|
1904
|
-
}, x = flatten(
|
|
1902
|
+
}, x = flatten(k);
|
|
1905
1903
|
for (const S in x)
|
|
1906
1904
|
h.searchParams.set(S, String(x[S]));
|
|
1907
1905
|
if (o && h.searchParams.set("userAttributes", JSON.stringify(o)), r) {
|
|
@@ -2148,7 +2146,7 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2148
2146
|
builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
|
|
2149
2147
|
}
|
|
2150
2148
|
};
|
|
2151
|
-
}, SDK_VERSION = "0.
|
|
2149
|
+
}, SDK_VERSION = "0.11.0", registry = {};
|
|
2152
2150
|
function register(e, t) {
|
|
2153
2151
|
let n = registry[e];
|
|
2154
2152
|
if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const lruCache=require("lru-cache"),jsxRuntime=require("react/jsx-runtime"),react=require("react"),USE_CLIENT_BUNDLE=require("./USE_CLIENT_BUNDLE-
|
|
1
|
+
"use strict";const lruCache=require("lru-cache"),jsxRuntime=require("react/jsx-runtime"),react=require("react"),USE_CLIENT_BUNDLE=require("./USE_CLIENT_BUNDLE-da39207d.cjs");require("next/navigation");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 TARGET="rsc";function isIframe(){return isBrowser()&&window.self!==window.top}function isEditing(){return isIframe()&&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(a,r,i)});return new Function(...s.map(([c])=>c),e)(...s.map(([,c])=>c))};function flattenState(e,t,n){if(e===t)throw new Error("rootState === localState");return new Proxy(e,{get:(o,r)=>t&&r in t?t[r]:e[r],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 e[r]=i,n==null||n(e),!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 ivm=safeDynamicRequire("isolated-vm"),getSyncValName=e=>`bldr_${e}_sync`,BUILDER_SET_STATE_NAME="BUILDER_SET_STATE",INJECTED_IVM_GLOBAL="BUILDER_IVM",REF_TO_PROXY_FN=`
|
|
2
2
|
var refToProxy = (obj) => {
|
|
3
3
|
if (typeof obj !== 'object' || obj === null) {
|
|
4
4
|
return obj;
|
|
@@ -45,7 +45,7 @@ output;
|
|
|
45
45
|
${convertStyleMapToCSS(n)}
|
|
46
46
|
}`;return e?`${e} {
|
|
47
47
|
${o}
|
|
48
|
-
}`:o};function InlinedStyles(e){return jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},id:e.id})}function BlockStyles(e){const t=function(){const r=getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return checkIsDefined(r.hide)?!r.hide:checkIsDefined(r.show)?r.show:!0},n=function(){var u;const r=getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),i=r.responsiveStyles,a=e.context.content,s=getSizesForBreakpoints(((u=a==null?void 0:a.meta)==null?void 0:u.breakpoints)||{}),c=i==null?void 0:i.large,m=i==null?void 0:i.medium,f=i==null?void 0:i.small,g=r.id;if(!g)return"";const p=c?createCssClass({className:g,styles:c}):"",l=m?createCssClass({className:g,styles:m,mediaQuery:getMaxWidthQueryForSize("medium",s)}):"",d=f?createCssClass({className:g,styles:f,mediaQuery:getMaxWidthQueryForSize("small",s)}):"";return[p,l,d].join(" ")};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:n()&&t()?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(InlinedStyles,{styles:n()})}):null})}function capitalizeFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1)}const getEventHandlerName=e=>`on${capitalizeFirstLetter(e)}`,createEventHandler=(e,t)=>n=>evaluate({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1});function getBlockActions(e){const t={},n=e.block.actions??{};for(const o in n){if(!n.hasOwnProperty(o))continue;const r=n[o];let i=getEventHandlerName(o);if(e.stripPrefix)switch(TARGET){case"
|
|
48
|
+
}`:o};function InlinedStyles(e){return jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},id:e.id})}function BlockStyles(e){const t=function(){const r=getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return checkIsDefined(r.hide)?!r.hide:checkIsDefined(r.show)?r.show:!0},n=function(){var u;const r=getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),i=r.responsiveStyles,a=e.context.content,s=getSizesForBreakpoints(((u=a==null?void 0:a.meta)==null?void 0:u.breakpoints)||{}),c=i==null?void 0:i.large,m=i==null?void 0:i.medium,f=i==null?void 0:i.small,g=r.id;if(!g)return"";const p=c?createCssClass({className:g,styles:c}):"",l=m?createCssClass({className:g,styles:m,mediaQuery:getMaxWidthQueryForSize("medium",s)}):"",d=f?createCssClass({className:g,styles:f,mediaQuery:getMaxWidthQueryForSize("small",s)}):"";return[p,l,d].join(" ")};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:n()&&t()?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(InlinedStyles,{styles:n()})}):null})}function capitalizeFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1)}const getEventHandlerName=e=>`on${capitalizeFirstLetter(e)}`,createEventHandler=(e,t)=>n=>evaluate({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1});function getBlockActions(e){const t={},n=e.block.actions??{};for(const o in n){if(!n.hasOwnProperty(o))continue;const r=n[o];let i=getEventHandlerName(o);if(e.stripPrefix)switch(TARGET){case"vue":i=i.replace("v-on:","");break;case"svelte":i=i.replace("on:","");break}t[i]=createEventHandler(r,e)}return t}function transformBlockProperties({properties:e}){return e.className=e.class,delete e.class,e}const extractRelevantRootBlockProperties=e=>({href:e.href});function getBlockProperties({block:e,context:t}){var o;const n={...extractRelevantRootBlockProperties(e),...e.properties,"builder-id":e.id,style:e.style?getStyleAttribute(e.style):void 0,class:[e.id,"builder-block",e.class,(o=e.properties)==null?void 0:o.class].filter(Boolean).join(" ")};return transformBlockProperties({properties:n,context:t,block:e})}function getStyleAttribute(e){switch(TARGET){case"svelte":case"vue":case"solid":return convertStyleMapToCSSArray(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const getWrapperProps=({componentOptions:e,builderBlock:t,context:n,componentRef:o,includeBlockProps:r,isInteractive:i,contextValue:a})=>i?{Wrapper:o,block:t,context:n,wrapperProps:e}:{...e,...r?{attributes:getBlockProperties({block:t,context:a})}:{}};function ComponentRef(e){var n,o;const t=e.isInteractive?USE_CLIENT_BUNDLE.InteractiveElement:e.componentRef;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.componentRef?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(t,{...getWrapperProps({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:[(n=e.blockChildren)==null?void 0:n.map(r=>jsxRuntime.jsx(Block,{block:r,context:e.context,registeredComponents:e.registeredComponents},"block-"+r.id)),(o=e.blockChildren)==null?void 0:o.map(r=>jsxRuntime.jsx(BlockStyles,{block:r,context:e.context},"block-style-"+r.id))]})}):null})}function RepeatedBlock(e){const t=e.repeatContext;return jsxRuntime.jsx(Block,{block:e.block,context:t,registeredComponents:e.registeredComponents})}function Block(e){var m,f,g,p;const t=function(){return getComponent({block:e.block,context:e.context,registeredComponents:e.registeredComponents})},n=function(){return getRepeatItemData({block:e.block,context:e.context})},o=function(){var d;return(d=e.block.repeat)!=null&&d.collection?e.block:getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})},r=function(){return e.block.tagName||"div"},i=function(){var x,b;if((x=e.block.repeat)!=null&&x.collection)return!!((b=n())!=null&&b.length);const d="hide"in o()?o().hide:!1;return("show"in o()?o().show:!0)&&!d},a=function(){var u;return!((u=t())!=null&&u.component)&&!n()?o().children??[]:[]},s=function(){var d,u,x,b,h;return{blockChildren:o().children??[],componentRef:(d=t())==null?void 0:d.component,componentOptions:{...getBlockComponentOptions(o()),builderContext:e.context,...((u=t())==null?void 0:u.name)==="Symbol"||((x=t())==null?void 0:x.name)==="Columns"?{builderComponents:e.registeredComponents}:{}},context:c,registeredComponents:e.registeredComponents,builderBlock:o(),includeBlockProps:((b=t())==null?void 0:b.noWrap)===!0,isInteractive:!((h=t())!=null&&h.isRSC)}},c=e.context;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:i()?jsxRuntime.jsx(jsxRuntime.Fragment,{children:(m=t())!=null&&m.noWrap?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(ComponentRef,{componentRef:s().componentRef,componentOptions:s().componentOptions,blockChildren:s().blockChildren,context:s().context,registeredComponents:s().registeredComponents,builderBlock:s().builderBlock,includeBlockProps:s().includeBlockProps,isInteractive:s().isInteractive})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[isEmptyHtmlElement(r())?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(USE_CLIENT_BUNDLE.BlockWrapper,{Wrapper:r(),block:o(),context:e.context,hasChildren:!1})}):null,!isEmptyHtmlElement(r())&&n()?jsxRuntime.jsx(jsxRuntime.Fragment,{children:(f=n())==null?void 0:f.map((l,d)=>jsxRuntime.jsx(RepeatedBlock,{repeatContext:l.context,block:l.block,registeredComponents:e.registeredComponents},d))}):null,!isEmptyHtmlElement(r())&&!n()?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(USE_CLIENT_BUNDLE.BlockWrapper,{Wrapper:r(),block:o(),context:e.context,hasChildren:!0,children:[jsxRuntime.jsx(ComponentRef,{componentRef:s().componentRef,componentOptions:s().componentOptions,blockChildren:s().blockChildren,context:s().context,registeredComponents:s().registeredComponents,builderBlock:s().builderBlock,includeBlockProps:s().includeBlockProps,isInteractive:s().isInteractive}),(g=a())==null?void 0:g.map(l=>jsxRuntime.jsx(Block,{block:l,context:c,registeredComponents:e.registeredComponents},"block-"+l.id)),(p=a())==null?void 0:p.map(l=>jsxRuntime.jsx(BlockStyles,{block:l,context:c},"block-style-"+l.id))]})}):null]})}):null})}function Blocks(e){var t,n,o,r;return jsxRuntime.jsxs(USE_CLIENT_BUNDLE.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?jsxRuntime.jsx(jsxRuntime.Fragment,{children:(o=e.blocks)==null?void 0:o.map(i=>jsxRuntime.jsx(Block,{block:i,context:e.context,registeredComponents:e.registeredComponents},"render-block-"+i.id))}):null,e.blocks?jsxRuntime.jsx(jsxRuntime.Fragment,{children:(r=e.blocks)==null?void 0:r.map(i=>jsxRuntime.jsx(BlockStyles,{block:i,context:e.context},"block-style-"+i.id))}):null]})}function Columns(e){var l;const t=typeof e.space=="number"?e.space||0:20,n=e.columns||[],o=e.stackColumnsAt||"tablet",r=function(u){var x;return((x=n[u])==null?void 0:x.width)||100/n.length},i=function(u){const x=t*(n.length-1)/n.length;return`calc(${r(u)}% - ${x}px)`},a=function({stackedStyle:u,desktopStyle:x}){return o==="tablet"?u:x},s=function({stackedStyle:u,desktopStyle:x}){return o==="never"?x:u},c=e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column",m=function(){return{"--flex-dir":c,"--flex-dir-tablet":a({stackedStyle:c,desktopStyle:"row"})}},f=function(u){const x=u===0?0:t,b=i(u),h=`${x}px`,I="100%",S=0;return{width:b,["marginLeft"]:h,"--column-width-mobile":s({stackedStyle:I,desktopStyle:b}),"--column-margin-left-mobile":s({stackedStyle:S,desktopStyle:h}),"--column-width-tablet":a({stackedStyle:I,desktopStyle:b}),"--column-margin-left-tablet":a({stackedStyle:S,desktopStyle:h})}},g=function(u){var b,h;return getSizesForBreakpoints(((h=(b=e.builderContext.content)==null?void 0:b.meta)==null?void 0:h.breakpoints)||{})[u].max},p=function(){return`
|
|
49
49
|
@media (max-width: ${g("medium")}px) {
|
|
50
50
|
.${e.builderBlock.id}-breakpoints {
|
|
51
51
|
flex-direction: var(--flex-dir-tablet);
|
|
@@ -175,7 +175,7 @@ output;
|
|
|
175
175
|
)`,getUpdateVariantVisibilityScript=({contentId:e,variationId:t})=>`window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
176
176
|
"${t}", "${e}", ${isHydrationTarget}
|
|
177
177
|
)`;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.
|
|
178
|
-
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.",convertSearchParamsToQueryObject=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},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)},normalizeSearchParams=e=>e instanceof URLSearchParams?convertSearchParamsToQueryObject(e):e,isPositiveNumber=e=>typeof e=="number"&&!isNaN(e)&&e>=0,generateContentUrl=e=>{let{noTraverse:t=!1}=e;const{limit:n=30,userAttributes:o,query:r,model:i,apiKey:a,includeRefs:s=!0,enrich:c,locale:m,apiVersion:f=DEFAULT_API_VERSION,fields:g,omit:p,offset:l,cacheSeconds:d,staleCacheSeconds:u,sort:x,includeUnpublished:b}=e;if(!a)throw new Error("Missing API key");if(!["v2","v3"].includes(f))throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${f}'`);(e.limit===void 0||e.limit>1)&&!("noTraverse"in e)&&(t=!0);const h=new URL(`https://cdn.builder.io/api/${f}/content/${i}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${s}${m?`&locale=${m}`:""}${c?`&enrich=${c}`:""}`);if(h.searchParams.set("omit",p||"meta.componentsUsed"),g&&h.searchParams.set("fields",g),Number.isFinite(l)&&l>-1&&h.searchParams.set("offset",String(Math.floor(l))),typeof b=="boolean"&&h.searchParams.set("includeUnpublished",String(b)),d&&isPositiveNumber(d)&&h.searchParams.set("cacheSeconds",String(d)),u&&isPositiveNumber(u)&&h.searchParams.set("staleCacheSeconds",String(u)),x){const y=flatten({sort:x});for(const C in y)h.searchParams.set(C,JSON.stringify(y[C]))}const I={...getBuilderSearchParamsFromWindow(),...normalizeSearchParams(e.options||{})},S=flatten(I);for(const y in S)h.searchParams.set(y,String(S[y]));if(o&&h.searchParams.set("userAttributes",JSON.stringify(o)),r){const y=flatten({query:r});for(const C in y)h.searchParams.set(C,JSON.stringify(y[C]))}return h},checkContentHasResults=e=>"results"in e;async function fetchOneEntry(e){const t=await fetchEntries({...e,limit:1});return t&&t[0]||null}const getContent=fetchOneEntry,_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}}const getAllContent=fetchEntries;function isPreviewing(){return!isBrowser()||isEditing()?!1:location.search.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}}},SDK_VERSION="0.
|
|
178
|
+
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.",convertSearchParamsToQueryObject=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},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)},normalizeSearchParams=e=>e instanceof URLSearchParams?convertSearchParamsToQueryObject(e):e,isPositiveNumber=e=>typeof e=="number"&&!isNaN(e)&&e>=0,generateContentUrl=e=>{let{noTraverse:t=!1}=e;const{limit:n=30,userAttributes:o,query:r,model:i,apiKey:a,includeRefs:s=!0,enrich:c,locale:m,apiVersion:f=DEFAULT_API_VERSION,fields:g,omit:p,offset:l,cacheSeconds:d,staleCacheSeconds:u,sort:x,includeUnpublished:b}=e;if(!a)throw new Error("Missing API key");if(!["v2","v3"].includes(f))throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${f}'`);(e.limit===void 0||e.limit>1)&&!("noTraverse"in e)&&(t=!0);const h=new URL(`https://cdn.builder.io/api/${f}/content/${i}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${s}${m?`&locale=${m}`:""}${c?`&enrich=${c}`:""}`);if(h.searchParams.set("omit",p||"meta.componentsUsed"),g&&h.searchParams.set("fields",g),Number.isFinite(l)&&l>-1&&h.searchParams.set("offset",String(Math.floor(l))),typeof b=="boolean"&&h.searchParams.set("includeUnpublished",String(b)),d&&isPositiveNumber(d)&&h.searchParams.set("cacheSeconds",String(d)),u&&isPositiveNumber(u)&&h.searchParams.set("staleCacheSeconds",String(u)),x){const y=flatten({sort:x});for(const C in y)h.searchParams.set(C,JSON.stringify(y[C]))}const I={...getBuilderSearchParamsFromWindow(),...normalizeSearchParams(e.options||{})},S=flatten(I);for(const y in S)h.searchParams.set(y,String(S[y]));if(o&&h.searchParams.set("userAttributes",JSON.stringify(o)),r){const y=flatten({query:r});for(const C in y)h.searchParams.set(C,JSON.stringify(y[C]))}return h},checkContentHasResults=e=>"results"in e;async function fetchOneEntry(e){const t=await fetchEntries({...e,limit:1});return t&&t[0]||null}const getContent=fetchOneEntry,_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}}const getAllContent=fetchEntries;function isPreviewing(){return!isBrowser()||isEditing()?!1:location.search.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}}},SDK_VERSION="0.11.0",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",({data:o})=>{var r,i;if(o!=null&&o.type)switch(o.type){case"builder.evaluate":{const a=o.data.text,s=o.data.arguments||[],c=o.data.id,m=new Function(a);let f,g=null;try{f=m.apply(null,s)}catch(p){g=p}g?(r=window.parent)==null||r.postMessage({type:"builder.evaluateError",data:{id:c,error:g.message}},"*"):f&&typeof f.then=="function"?f.then(p=>{var l;(l=window.parent)==null||l.postMessage({type:"builder.evaluateResult",data:{id:c,result:p}},"*")}).catch(console.error):(i=window.parent)==null||i.postMessage({type:"builder.evaluateResult",data:{result:f,id:c}},"*");break}}})))},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+=`
|
|
179
179
|
@font-face {
|
|
180
180
|
font-family: "${t}";
|
|
181
181
|
src: local("${n}"), url('${o}') format('woff2');
|
package/lib/node/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bundle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bundle-a7c78519.cjs"),t=require("./USE_CLIENT_BUNDLE-da39207d.cjs");require("lru-cache");require("react/jsx-runtime");require("react");require("next/navigation");require("./USE_SERVER_BUNDLE-3c56bf9c.cjs");exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.RenderBlocks=e.RenderBlocks;exports.RenderContent=e.RenderContent;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.getAllContent=e.getAllContent;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.getContent=e.getContent;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.track=e.track;exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;
|
package/lib/node/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { B as i, t as m, C as c, R as g, q as p, S as l, T as C, w as d, m as f, E as u, x as B, n as S, y as E, A as R, z as h, i as x, f as k, u as y, v as P, D as b } from "./bundle-
|
|
2
|
-
import { b as w, F as A, c as F, S as T, V } from "./USE_CLIENT_BUNDLE-
|
|
1
|
+
import { B as i, t as m, C as c, R as g, q as p, S as l, T as C, w as d, m as f, E as u, x as B, n as S, y as E, A as R, z as h, i as x, f as k, u as y, v as P, D as b } from "./bundle-24b5f3b0.js";
|
|
2
|
+
import { b as w, F as A, c as F, S as T, V } from "./USE_CLIENT_BUNDLE-674c3a2b.js";
|
|
3
3
|
import "lru-cache";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
6
|
import "next/navigation";
|
|
7
|
-
import "./USE_SERVER_BUNDLE-
|
|
7
|
+
import "./USE_SERVER_BUNDLE-1b907ae9.js";
|
|
8
8
|
export {
|
|
9
9
|
i as Blocks,
|
|
10
10
|
w as Button,
|
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.
|
|
4
|
+
"version": "0.11.0",
|
|
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.
|
|
1
|
+
export declare const SDK_VERSION = "0.11.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type Target = '
|
|
1
|
+
export type Target = 'vue' | 'reactNative' | 'svelte' | 'qwik' | 'react' | 'solid' | 'rsc';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.11.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type Target = '
|
|
1
|
+
export type Target = 'vue' | 'reactNative' | 'svelte' | 'qwik' | 'react' | 'solid' | 'rsc';
|