import{a as w}from"https://app.framerstatic.com/chunk-R67VYHHT.mjs";import{a as rt,b as nt,c as dt,d as st}from"https://app.framerstatic.com/chunk-HXDP7QJZ.mjs";import{a as at,h as it}from"https://app.framerstatic.com/chunk-LLE5AZAR.mjs";import{a as tt}from"https://app.framerstatic.com/chunk-M7F4BWXH.mjs";import"https://app.framerstatic.com/chunk-WUHYMOND.mjs";import{A as et,B as ot,b as Ao,c as Ho,d as zo,f as Qo,h as qo,i as Go,j as Zo,l as Ko,r as _o,s as $o,t as jo,u as ce,v as Jo,w as Xo,x as Yo,y as me,z as ue}from"https://app.framerstatic.com/chunk-RRIXY7JO.mjs";import{a as Uo}from"https://app.framerstatic.com/chunk-L5BCEPO4.mjs";import"https://app.framerstatic.com/chunk-X4FB6NMR.mjs";import{a as xo,b as wo,h as Fo,p as Do,r as Eo,t as G}from"https://app.framerstatic.com/chunk-CFPWEMX5.mjs";import{b as le,c as pe,d as Vo,f as To}from"https://app.framerstatic.com/chunk-5ZPLZ5Y5.mjs";import{a as Lo,h as So}from"https://app.framerstatic.com/chunk-NWXZUV7M.mjs";import"https://app.framerstatic.com/chunk-PABHF7FN.mjs";import{Og as Mo,Pg as Po}from"https://app.framerstatic.com/chunk-N6T5M2U2.mjs";import{k as go}from"https://app.framerstatic.com/chunk-MTCSGQFI.mjs";import"https://app.framerstatic.com/chunk-XFNBDXCA.mjs";import"https://app.framerstatic.com/chunk-JRE74LV4.mjs";import"https://app.framerstatic.com/chunk-Y4KSD2WZ.mjs";import"https://app.framerstatic.com/chunk-SN5IIQ7X.mjs";import{a as ko,b as Wo,c as Bo}from"https://app.framerstatic.com/chunk-CTKJD4ES.mjs";import{k as Oo}from"https://app.framerstatic.com/chunk-LM2ZSXH3.mjs";import{Uh as Io,fd as yo,o as vo,q as bo}from"https://app.framerstatic.com/chunk-EBH5X5S4.mjs";import{$f as ro,Ag as co,Am as fo,B as F,Bd as B,Bn as se,Df as Q,Fd as ze,Gd as ie,Hd as z,I as xe,Id as Qe,Ie as Je,Jd as qe,K as Ve,Ka as te,Ld as Ge,Lf as Ye,Md as Ze,Nm as ho,Of as eo,Pf as oo,Sb as ke,Tc as H,Tf as to,V as Te,Vb as We,Yf as de,_k as mo,ae as Ke,ag as no,be as _e,bg as ao,cc as Be,ce as $e,cg as io,ec as ae,ev as q,it as Co,jg as so,jv as Ro,lb as ne,mb as De,mg as lo,ng as po,ol as uo,rd as Ue,re as je,uf as Xe,vd as Ae,wd as He}from"https://app.framerstatic.com/chunk-WDCEA3EQ.mjs";import"https://app.framerstatic.com/chunk-VXJAAVJQ.mjs";import"https://app.framerstatic.com/chunk-KD4H3DLZ.mjs";import"https://app.framerstatic.com/chunk-5DSVU7DA.mjs";import"https://app.framerstatic.com/chunk-4DUBS6C5.mjs";import"https://app.framerstatic.com/chunk-XFC6OVIX.mjs";import"https://app.framerstatic.com/chunk-2C4FJUEI.mjs";import"https://app.framerstatic.com/chunk-XFC6OVIX.mjs";import"https://app.framerstatic.com/chunk-LH43QRIB.mjs";import"https://app.framerstatic.com/chunk-4AQCMAAQ.mjs";import{e as No}from"https://app.framerstatic.com/chunk-FI7WGJHP.mjs";import"https://app.framerstatic.com/chunk-SSXQNR5C.mjs";import"https://app.framerstatic.com/chunk-4ZPMQ7AD.mjs";import"https://app.framerstatic.com/chunk-POQKH4YA.mjs";import{p as Lt}from"https://app.framerstatic.com/chunk-3PGDFP4U.mjs";import"https://app.framerstatic.com/chunk-AUNF3KWQ.mjs";import{d as oe,k as Le,p as Se}from"https://app.framerstatic.com/chunk-XFCQREKZ.mjs";import{p as Ee}from"https://app.framerstatic.com/chunk-3DFADFT7.mjs";import{b as T,e as Oe,f as Fe,i as re}from"https://app.framerstatic.com/chunk-ZQUNXESX.mjs";import{a as O,b as V,zc as we}from"https://app.framerstatic.com/chunk-NOOQGO4X.mjs";import{j as Ne}from"https://app.framerstatic.com/chunk-4CB4BQFV.mjs";import"https://app.framerstatic.com/chunk-ORIFM75E.mjs";import"https://app.framerstatic.com/chunk-66XIMNKS.mjs";import{B as Re,G as Ie,K as ge,O as Me,P as Pe,ca as A,i as be,l as W}from"https://app.framerstatic.com/chunk-IZV4HDYJ.mjs";import{a as h,b as ve}from"https://app.framerstatic.com/chunk-WNSBRACC.mjs";import{a as ye}from"https://app.framerstatic.com/chunk-LQILWJHN.mjs";import{e as M,j as s}from"https://app.framerstatic.com/chunk-AHQIRSXG.mjs";var lt=new WeakMap;function fe(r){let e=lt.get(r);if(e)return e;let o=new Set;if((vo(r)||bo(r))&&o.add(r),r.children)for(let t of r.children){let n=fe(t);for(let i of n)o.add(i)}return lt.set(r,o),o}var k=M(O()),gt=M(Lt());var Z=M(O()),ut=M(V()),pt=(0,Z.createContext)(void 0);function ct({children:r,nodeInTextEditor:e}){return(0,ut.jsx)(pt.Provider,{value:e,children:r})}function mt(){return(0,Z.useContext)(pt)}var I=M(O());var K=M(O()),D=M(V());function _({context:r,children:e,fallback:o}){return(0,D.jsx)(K.Suspense,{fallback:(0,D.jsx)(St,{context:r,children:o}),children:e})}function St({context:r,children:e}){return(0,K.useLayoutEffect)(()=>r.loadingStateTracker.trackSuspense(),[r]),(0,D.jsx)(D.Fragment,{children:e})}function U(r,e){let o=new Set;o.add(e);let t=q(r,e);if(t){let n=Yo(t);for(let i of n)o.add(i)}return o}var c=M(V());xe({target:Ve.canvas});function ht({context:r,webPageNode:e,collectionItemNode:o,breakpointNode:t,activeLocale:n,temporaryCollectionItemNodeId:i}){if(e&&t)return H(e)&&o?(0,c.jsx)(_,{context:r,children:(0,c.jsx)(xt,{context:r,webPageNode:e,collectionItemNode:o,breakpointNode:t,activeLocale:n,temporaryCollectionItemNodeId:i})}):(0,c.jsx)(Ct,{context:r,webPageNode:e,breakpointNode:t,combinedControlMap:void 0,combinedValueMap:void 0,placeholderVariableIds:void 0,activeLocale:n})}function xt({context:r,webPageNode:e,collectionItemNode:o,breakpointNode:t,activeLocale:n,temporaryCollectionItemNodeId:i}){let a=e.tree();h(a,"Must have a tree");let l=e.dataIdentifier,d=U(a,l);r.modulesRuntime.usePreloadedModules(...d);let[p,m]=r.modulesRuntime.useComponentLoader(),b=p.dataForIdentifier(l);h(b,"Data definition must exist after preloading module");let f=e.getVariableControlMap(a,p,m);h(f,"Control map must exist");let P=Xo(e,a,f,t,n,b,o.id,"public-and-private"),N=de(P);r.sandboxCollectionData.set(e.id,N,f);let R=e.getVariableValueMap(a,p,r.sandboxCollectionData,m);h(R,"Value map must exist");let g=q(a,l),{patchedValueMap:S,placeholderVariableIds:y}=(0,I.useMemo)(()=>!!g&&o.id===i?Vt(g,R):{patchedValueMap:R,placeholderVariableIds:new Set},[g,R,o.id,i]),u=(0,I.useMemo)(()=>{let v=new Map;return v.set(e.id,f),v},[f,e.id]),C=(0,I.useMemo)(()=>{let v=new Map;return v.set(e.id,S),v},[S,e.id]);return(0,c.jsx)(Ct,{context:r,webPageNode:e,breakpointNode:t,combinedControlMap:u,combinedValueMap:C,placeholderVariableIds:y,activeLocale:n})}function Vt(r,e){let o=new Map(e),t=new Set;for(let[n,i]of e){let a=r.getVariable(n);if(a){if(a.type==="string"){if(!(!i||T(i)&&i.trim()===""))continue;let d=a.options?.placeholder||a.description||a.name;o.set(n,d),t.add(n)}if(a.type==="richtext"){if(!(!i||T(i)&&So(i)))continue;o.set(n,`
${a.description||a.name}
`),t.add(n)}}}return{patchedValueMap:o,placeholderVariableIds:t}}function Ct({context:r,webPageNode:e,breakpointNode:o,combinedControlMap:t,combinedValueMap:n,placeholderVariableIds:i,activeLocale:a}){return se(e)?(0,c.jsx)(_,{context:r,children:(0,c.jsx)(wt,{context:r,webPageNode:e,breakpointNode:o,combinedControlMap:t,combinedValueMap:n,placeholderVariableIds:i,activeLocale:a})}):(0,c.jsx)(E,{context:r,parentRenderId:e.id,node:o,parent:e,combinedControlMap:t,combinedValueMap:n,placeholderVariableIds:i,activeLocale:a,nodePropOverrides:void 0})}var vt={minHeight:"100vh",width:"auto"},Tt=Go();function wt({context:r,webPageNode:e,breakpointNode:o,combinedControlMap:t,combinedValueMap:n,placeholderVariableIds:i,activeLocale:a}){let l=(0,I.useRef)(null),d=(0,I.useRef)(null);r.modulesRuntime.usePreloadedModules(e.layoutTemplateIdentifier);let[p]=r.modulesRuntime.useComponentLoader(),m=G(),b=$(r.fetchClient,e),f=e.getResolvedControlPropValues(p,m,n,a,b);f.style??={},Object.assign(f.style,vt);let P=p.reactComponentForIdentifier(e.layoutTemplateIdentifier);h(P,"Component definition not found");let N=P.class,R=fo(o)&&Je(o)?o.width:void 0,{activeVariant:g,className:S,selectors:y}=Zo(e.layoutTemplateIdentifier,R,Tt)||{};(0,I.useLayoutEffect)(()=>{if(!l.current||!d.current)return;let C=qo(d.current);if(r.layoutMeasureQueue.add(o.id,l.current,C),!!y)for(let v of y){let x=l.current.querySelector(v);x&&r.layoutMeasureQueue.add(o.id,x,[],v)}},[r.layoutMeasureQueue,o.id,y]);let u=(0,I.useMemo)(()=>({ref:d}),[]);return(0,c.jsx)("div",{ref:l,className:S,children:(0,c.jsx)(N,{...f,variant:g,children:(0,c.jsx)(E,{context:r,parentRenderId:e.id,node:o,parent:e,combinedControlMap:t,combinedValueMap:n,placeholderVariableIds:i,activeLocale:a,nodePropOverrides:u})})})}var E=(0,I.memo)(function({context:e,parentRenderId:o,node:t,parent:n,combinedControlMap:i,combinedValueMap:a,placeholderVariableIds:l,activeLocale:d,nodePropOverrides:p}){let m=le(o,t.id),b=t.tree();return t.cache.resetForRendering(),t.cache.setVariableValueAndControlMap(a,a,i,d),Fo(n,t),Co(t)||t.resolveValue("visible",a)===!1?(e.sandboxVisibility.setVisible(m,!1),null):(e.sandboxVisibility.setVisible(m,!0),(0,c.jsx)(_,{context:e,children:(0,c.jsx)(Ft,{context:e,renderId:m,tree:b,node:t,parent:n,combinedControlMap:i,combinedValueMap:a,placeholderVariableIds:l,activeLocale:d,nodePropOverrides:p})}))});function Ot(r,e,o,t,n,i,a){let l=$(r.fetchClient,o),d=o.getProps(n,i,l);if(B(t)&&(d.style??={},d.style.position="relative",d.style.width="100%",se(t)?(d.style.display="contents",d.style.position="relative",d._needsMeasure=!1,d["data-layout-template-root"]=!0):Object.assign(d.style,vt)),ie(o)){let p=ot(o,i);p&&(d.viewBox=p)}if(d.id=e,a)for(let p in a){let m=a[p];p==="style"&&d.style?Object.assign(d.style,m):d[p]=m}return d}function Ft({context:r,renderId:e,tree:o,node:t,parent:n,combinedControlMap:i,combinedValueMap:a,placeholderVariableIds:l,activeLocale:d,nodePropOverrides:p}){let m=Ot(r,e,t,n,a,d,p);if(qe(t))return(0,c.jsx)(lo,{...m});if(Ze(t))return ue(t),(0,c.jsx)(te,{...m,as:"svg",children:t.children.map(b=>{let f=le(e,b.id);return me(b,a,r.sandboxVisibility,f,!1)})});if(mo(t))return ue(t),me(t,a,r.sandboxVisibility,e,!0);if(ze(t))return(0,c.jsx)(po,{...m});if(ie(t))return(0,c.jsx)(Dt,{context:r,node:t,combinedValueMap:a,placeholderVariableIds:l,activeLocale:d,nodeProps:m,renderId:e});if(Ue(t)){let b=Ro(o,t);return(0,c.jsx)(te,{...m,children:t.getChildrenInVisualOrder().map(f=>f.id===b?.id?(0,c.jsx)(At,{context:r,parentRenderId:e,tree:o,node:f,parent:t,combinedControlMap:i,combinedValueMap:a,placeholderVariableIds:l,activeLocale:d},"repeated-child"):(0,c.jsx)(E,{context:r,parentRenderId:e,node:f,parent:t,combinedControlMap:i,combinedValueMap:a,placeholderVariableIds:l,activeLocale:d,nodePropOverrides:void 0},f.id))})}return Ke(t)?(0,c.jsx)(no,{...m}):$e(t)?(0,c.jsx)(io,{...m}):_e(t)?(0,c.jsx)(ao,{...m}):Qe(t)?null:z(t)?t.isVectorInstance?(0,c.jsx)(Wt,{node:t,context:r,nodeProps:m,combinedValueMap:a,activeLocale:d}):(0,c.jsx)(kt,{context:r,renderId:e,node:t,combinedControlMap:i,combinedValueMap:a,placeholderVariableIds:l,activeLocale:d,nodeProps:m}):(je(t),null)}var Dt=(0,I.memo)(function({context:e,node:o,combinedValueMap:t,placeholderVariableIds:n,activeLocale:i,nodeProps:a,renderId:l}){let d=o.getFontsForLoading();e.fontLoader.usePreloadedFonts(...d),a={...a},mt()===l&&(a.isEditable=!0),Et(o,n)&&(a.opacity=.3);let m=(0,I.useMemo)(()=>et(o,t,i),[o,t,i]);if(ae(o.htmlContent)&&o.getComponentPresets().size>0){let b=o.tree();return h(b,"Must have a tree"),(0,c.jsx)(Qo,{tree:b,node:o,...a,children:m})}return(0,c.jsx)(so,{...a,children:m})});function Et(r,e){return e?ft(r.htmlContent,e)||ft(r.textContent,e):!1}function ft(r,e){return ae(r)?e.has(r.id):!1}function kt({context:r,renderId:e,node:o,combinedControlMap:t,combinedValueMap:n,placeholderVariableIds:i,activeLocale:a,nodeProps:l}){let d=o.tree();h(d,"Must have a tree"),r.modulesRuntime.usePreloadedModules(o.codeComponentIdentifier);let[p]=r.modulesRuntime.useComponentLoader(),m=p.reactComponentForIdentifier(o.codeComponentIdentifier);h(m,"Component definition not found");let b=G(),f=$(r.fetchClient,o),P=o.getCodeComponentProps(p,b,n,a,f),N=Mo(d,o,p);N.children=Po(d,o,p);for(let u in N){let C=N[u];C&&(P[u]=C.map(v=>{let x=Vo(e,o.id,u,v.key);return(0,c.jsx)(E,{context:r,parentRenderId:x,node:v.node,parent:o,combinedControlMap:t,combinedValueMap:n,placeholderVariableIds:i,activeLocale:a,nodePropOverrides:Ut},v.key)}))}let R=o.getRichTextControlKeys(p);for(let u of R){let C=P[u];T(C)&&(P[u]=Oo(C))}let g=o.getComponentVectorSetChildren(p,n),S=new Set;for(let u in g){let C=g[u];re(C)||(S.add(C),r.modulesRuntime.preloadModule(C))}r.modulesRuntime.usePreloadedModules(...S);for(let u in g){let C=g[u];if(re(C))continue;let v=p.reactComponentForIdentifier(C);h(v,"Vector definition not found"),P[u]=v.class}let y=m.class;return(0,c.jsx)(Ko,{...l,children:(0,c.jsx)(y,{...P})})}function Wt({context:r,node:e,nodeProps:o,combinedValueMap:t,activeLocale:n}){let[i]=r.modulesRuntime.useComponentLoader(),a=G(),l=$(r.fetchClient,e);return _o({node:e,frameProps:o,getCodeComponentProps(){return e.getCodeComponentProps(i,a,t,n,l)},combinedValueMap:t,renderVectorWithIdentifier(d,p){return(0,c.jsx)(Bt,{context:r,identifier:d,getProps:p})}})}function Bt({context:r,identifier:e,getProps:o}){r.modulesRuntime.preloadModule(e),r.modulesRuntime.usePreloadedModules(e);let[t]=r.modulesRuntime.useComponentLoader(),n=t.reactComponentForIdentifier(e);h(n,"Component definition not found");let i=o(),a=n.class;return(0,c.jsx)(a,{...i})}var Ut={position:"relative"};function At({parent:r,...e}){if(Ae(r))return(0,c.jsx)(Ht,{...e,parent:r});if(He(r))return(0,c.jsx)(zt,{...e,parent:r});ve(r,"Unsupported repeater type")}function Ht({context:r,parentRenderId:e,tree:o,node:t,parent:n,combinedControlMap:i,combinedValueMap:a,placeholderVariableIds:l,activeLocale:d}){let p=U(o,n.dataIdentifier);r.modulesRuntime.usePreloadedModules(...p);let[m,b]=r.modulesRuntime.useComponentLoader(),f=n.getVariableControlMap(o,m,b);h(f,"Control map must exist");let P=Do(n,f,$o(o,n),y=>({type:"LiteralValue",value:t.cache.getVariableReferenceValue(y,a)}),y=>Jo(o,n,y,d));Io(n)&&jo(P,n);let N=de(P);r.sandboxCollectionData.set(e,N,f);let R=n.originalid??n.id,g=(0,I.useMemo)(()=>{let y=new Map(i);return y.set(R,f),y},[f,i,R]),S=(0,I.useMemo)(()=>N.map((y,u)=>{let C=new Map(a),v=ce(o,f,y,u);return C.set(R,v),C}),[o,f,a,R,N]);return N.map((y,u)=>{let C=T(y.id)?y.id:u,v=S[u],x=pe(e,n.id,C,u);return(0,c.jsx)(E,{context:r,parentRenderId:x,node:t,parent:n,combinedControlMap:g,combinedValueMap:v,placeholderVariableIds:l,activeLocale:d,nodePropOverrides:void 0},C)})}function zt({context:r,parentRenderId:e,tree:o,node:t,parent:n,combinedControlMap:i,combinedValueMap:a,placeholderVariableIds:l,activeLocale:d}){h(a,"Combined value map must exist");let[p,m]=r.modulesRuntime.useComponentLoader(),b=n.getVariableControlMap(o,p,m);h(b,"Control map must exist");let f=n.dataRepeaterArray,P=f.providerId;h(P,"Variable must have providerId");let N=a.get(P);h(N,"Provider value map must exist");let R=N.get(f.id);h(Fe(R)&&R.every(Oe),"Invalid array value");let g=n.originalid??n.id,S=(0,I.useMemo)(()=>{let u=new Map(i);return u.set(g,b),u},[b,i,g]),y=(0,I.useMemo)(()=>R.map((u,C)=>{let v=new Map(a),x=ce(o,b,u,C);return v.set(g,x),v}),[o,b,a,g,R]);return R.map((u,C)=>{let v=T(u.id)?u.id:C,x=y[C],Nt=pe(e,n.id,v,C);return(0,c.jsx)(E,{context:r,parentRenderId:Nt,node:t,parent:n,combinedControlMap:S,combinedValueMap:x,placeholderVariableIds:l,activeLocale:d,nodePropOverrides:void 0},v)})}function $(r,e){return o=>{let t=ke(o);if(!Ao(t))return Ho(e,t.controlProp);let n=We(t,l=>e.cache.getVariableReferenceValue(l)),i=Ye({url:n,credentials:t.credentials}),a=r.getValue(i);if(a)return zo(e,t,a);throw r.fetchWithCache({url:n,cacheDuration:t.cacheDuration,credentials:t.credentials})}}var j=M(O());var yt=M(V());function bt({tree:r,children:e}){let o=tt();(0,j.useLayoutEffect)(()=>{let n=o?"dark":"light";document.body.setAttribute("data-framer-theme",n)},[o]);let t=(0,j.useMemo)(()=>uo(r,o),[r,o]);return(0,yt.jsx)(ro,{customProperties:t,children:e})}var J=class{constructor(){s(this,"loaders",new Map)}preloadFonts(...e){for(let o of e){if(this.loaders.has(o))continue;let t=new Q(async()=>{await F.loadFonts([o])});t.preload(),this.loaders.set(o,t)}}usePreloadedFonts(...e){for(let o of e){let t=this.loaders.get(o);h(t,"Font not preloaded"),t.use()}}};var X=class{constructor(){s(this,"promises",new Set)}trackSuspense(){let e=new A;return this.promises.add(e),()=>{e.resolve(),this.promises.delete(e)}}async waitForSuspense(){this.promises.size!==0&&(await Promise.all(this.promises),await this.waitForSuspense())}};var It=M(O());var Ce=class{constructor(e,o){this.modulesRuntime=e;this.identifier=o;s(this,"loaderPromise",new A);s(this,"loader",new Q(()=>this.loaderPromise))}async evaluate(e){let o=await it(e),t=[],n=this.modulesRuntime.getLocales();await at(this.modulesRuntime.queryEngine,n,this.identifier,o,t,void 0,0),await this.modulesRuntime.updateComponentLoader(t),this.loaderPromise.resolve(),this.modulesRuntime.notifyReactComponents()}},Y=class{constructor(e){this.sandbox=e;s(this,"componentLoaderHash",0);s(this,"reactComponentListeners",new Set);s(this,"localModules",new Map);s(this,"loadedModules",new Map);s(this,"queryEngine",new to);s(this,"reactExternalStore",{subscribe:e=>(this.reactComponentListeners.add(e),()=>{this.reactComponentListeners.delete(e)}),getSnapshot:()=>this.componentLoaderHash})}getLocales(){return this.sandbox.getLocales()}useComponentLoader(){let e=(0,It.useSyncExternalStore)(this.reactExternalStore.subscribe,this.reactExternalStore.getSnapshot);return[ne,String(e)]}async updateComponentLoader(e){ne.updateModuleEntities(e),await this.sandbox.remoteComponentsStore.updateComponentLoader(dt(e),this.componentLoaderHash++)}notifyReactComponents(){for(let e of this.reactComponentListeners)e()}getLocalModuleURL(e){let o=this.localModules.get(e.localId);if(o)return o.moduleURL}getExternalModuleURL(e){return`${ye().modulesCDN}/${e.moduleId}/${e.saveId}/${e.file}`}getModuleURL(e){return Re(e)?this.getExternalModuleURL(e):this.getLocalModuleURL(e)}async loadModule(e){this.preloadModule(e),await this.getPreloadedModule(e).loader.readAsync()}preloadModule(e){let o=Rt(e);if(this.loadedModules.get(o.value))return;let n=new Ce(this,o);this.loadedModules.set(o.value,n);let i=this.getModuleURL(o);i&&n.evaluate(i).catch(W)}getPreloadedModule(e){let o=Rt(e),t=this.loadedModules.get(o.value);return h(t,"Module not preloaded"),t}usePreloadedModules(...e){let o=[];for(let t of e){let i=this.getPreloadedModule(t).loader.preload();i&&o.push(i)}if(o.length>0)throw Promise.all(o)}updateDependenciesModule(e){let o=JSON.parse(e.importMapContent);he(o,"framer-user-importmap")}updateLocalModules(e){let o=new Map,t=new Set;for(let[,n]of e){h(n.kind!=="fast-refresh","Fast-refresh is not supported");let i=n.localId;o.set(i,n),this.localModules.get(i)?.moduleURL!==n.moduleURL&&t.add(i)}this.localModules=o,this.updateLocalModulesImportMap();for(let n of t){let i=Ie(n),a=this.loadedModules.get(i.value);if(a){let l=this.getLocalModuleURL(i);l&&a.evaluate(l).catch(W)}}}updateLocalModulesImportMap(){let e={imports:{},scopes:{}};for(let[o,t]of this.localModules){let n=t.files.module;if(!n)continue;let i=Pe(o,n);e.imports[i]=t.moduleURL}he(e,"framer-local-modules")}insertTemporaryImportMap(e){let o=crypto.randomUUID();he(e,o)}};function Rt(r){let e=ge(r);return h(e,"Invalid module identifier"),Me(e)}function he(r,e){let o=document.createElement("script");o.type="importmap-shim",o.id=e,o.innerHTML=JSON.stringify(r);let t=document.getElementById(e);t?t.replaceWith(o):document.body.appendChild(o)}var L=M(V()),Qt=Be(r=>r?yo(r,{includeDrafts:!1}):be()),ee=class{constructor(e){this.container=e;s(this,"reactRoot");s(this,"needsRender",!1);s(this,"assetMap",new Le);s(this,"fontLoader",new J);s(this,"modulesRuntime",new Y(this));s(this,"fetchClient",new eo);s(this,"loadingStateTracker",new X);s(this,"sandboxCollectionData",new To("sandbox"));s(this,"sandboxVisibility",new wo("sandbox"));s(this,"partialTreeReceiver",new rt);s(this,"controlsVisibility",new xo(this.partialTreeReceiver));s(this,"presetsListNode");s(this,"webPageNodeId");s(this,"webPageNode");s(this,"collectionItemNodeId");s(this,"collectionItemNode");s(this,"breakpointNodeId");s(this,"breakpointNode");s(this,"activeLocale");s(this,"nodeInTextEditor");s(this,"temporaryCollectionItemNodeId");s(this,"remoteComponentsStore");s(this,"remoteSandboxStore");s(this,"remoteTreeStore");s(this,"layoutMeasureQueue",new st({shouldMeasureCallback:()=>{let e=this.measureLayout();e&&this.remoteTreeStore.onLayoutMeasure(e)},shouldMeasureCallbackDelayMs:0}));this.reactRoot=(0,gt.createRoot)(this.container);let o=new Lo(w);o.setLocal(w.channels.sandbox,this),o.setLocal(w.channels.controlsVisibility,this.controlsVisibility),o.setLocal(w.channels.modulesRuntime,this.modulesRuntime),this.remoteComponentsStore=o.getRemote(w.channels.componentsStore),this.remoteSandboxStore=o.getRemote(w.channels.sandboxStore),this.remoteTreeStore=o.getRemote(w.channels.treeStore),this.connectRpc(o).catch(W)}get tree(){return this.partialTreeReceiver.tree}getLocales(){return Qt(this.tree?.root?.locales)}async connectRpc(e){await e.connect({target:window.parent,url:No(document.referrer).origin}),new ResizeObserver(t=>{h(t.length===1,"Invalid length");let n=t[0];h(n,"Invalid entry"),h(n.target===this.container,"Invalid target"),this.breakpointNode&&this.layoutMeasureQueue.remeasureNode(this.breakpointNode),this.remoteSandboxStore.oneway.onHeightChange(n.contentRect.height)}).observe(this.container)}measureLayout(){if(!this.webPageNode||!this.breakpointNode)return;let e=new Set;e.add(this.breakpointNode.id);let o=this.layoutMeasureQueue.process({groundNodesInViewport:e,offsetX:0,offsetY:0,scopeId:this.webPageNode.id,tree:this.tree,zoom:1});if(o.length!==0)return o}scrollTo(e){if(window.scrollTo(e),this.breakpointNode){for(let o of fe(this.breakpointNode))this.layoutMeasureQueue.remeasureNode(o);this.layoutMeasureQueue.remeasureNode(this.breakpointNode)}}update(e){let o=e.partialTreeUpdate;o&&(this.partialTreeReceiver.update(o),this.preloadTree());let t=e.webPageNodeId;t&&(this.webPageNodeId=t);let n=e.collectionItemNodeId;n&&(this.collectionItemNodeId=n);let i=e.breakpointNodeId;i&&(this.breakpointNodeId=i);let a=e.stylePresetBreakpointClassNames;T(a)&&(this.container.className=a);let l=e.dependenciesModule;l&&this.modulesRuntime.updateDependenciesModule(l);let d=e.localModules;d&&this.modulesRuntime.updateLocalModules(d);let p=e.assets;p&&(this.assetMap.set(p),F.importCustomFonts(p,Ee.isOn("customFontImprovements"))),this.nodeInTextEditor!==e.nodeInTextEditor&&e.nodeInTextEditor!==void 0&&(this.nodeInTextEditor=e.nodeInTextEditor,this.needsRender=!0),this.temporaryCollectionItemNodeId!==e.temporaryCollectionItemNodeId&&e.temporaryCollectionItemNodeId!==void 0&&(this.temporaryCollectionItemNodeId=e.temporaryCollectionItemNodeId,this.needsRender=!0),this.updateWebPageNode(),this.updateCollectionItemNode(),this.updateBreakpointNode(),this.updatePresetsListNode(),this.render()}preloadWebPage(){if(this.webPageNode){for(let e of this.webPageNode.walk())if(z(e)&&this.modulesRuntime.preloadModule(e.codeComponentIdentifier),B(e)&&e.layoutTemplateIdentifier&&this.modulesRuntime.preloadModule(e.layoutTemplateIdentifier),H(e)&&this.modulesRuntime.preloadModule(e.dataIdentifier),nt(e)){let o=e.getFontsForLoading();this.fontLoader.preloadFonts(...o)}}}preloadTree(){let e=this.tree.getContentManagementNode()?.loaded;if(e)for(let t of e.children){let n=U(this.tree,t.instanceIdentifier);for(let i of n)this.modulesRuntime.preloadModule(i)}let o=this.tree.getPresetsListNode();if(o){for(let t of o.children)if(go(t)){let n=t.getFontsForCodeGeneration();this.fontLoader.preloadFonts(...n)}}}updateWebPageNode(){let e=this.tree.getNodeWithTrait(this.webPageNodeId,B)?.loaded;this.webPageNode!==e&&(this.needsRender=!0,this.webPageNode=e,this.preloadWebPage())}updateCollectionItemNode(){let e=this.tree.getNodeWithTrait(this.collectionItemNodeId,Ge)??void 0;this.collectionItemNode!==e&&(this.needsRender=!0,this.collectionItemNode=e)}updateBreakpointNode(){let e=this.tree.get(this.breakpointNodeId)??void 0;this.breakpointNode!==e&&(this.needsRender=!0,this.breakpointNode=e)}updatePresetsListNode(){let e=this.tree.getPresetsListNode()??void 0;this.presetsListNode!==e&&(this.needsRender=!0,this.presetsListNode=e)}async onRendered(e){await this.loadingStateTracker.waitForSuspense(),this.breakpointNode&&e&&this.remoteSandboxStore.onInitialLoadComplete(e),this.remoteTreeStore.onSandboxRendered({layoutMeasurements:this.measureLayout(),collectionUpdates:this.sandboxCollectionData.export(),visibilityUpdates:this.sandboxVisibility.export()})}render(){this.needsRender&&((0,k.startTransition)(()=>{this.reactRoot.render((0,L.jsx)(k.StrictMode,{children:(0,L.jsxs)(qt,{webPageNodeId:this.webPageNodeId,onRendered:this.onRendered.bind(this),children:[(0,L.jsx)(bt,{tree:this.tree,children:(0,L.jsx)(Xe,{children:(0,L.jsx)(we,{isStatic:!0,children:(0,L.jsx)(oo,{client:this.fetchClient,children:(0,L.jsx)(Te,{parentSize:1,children:(0,L.jsx)(ct,{nodeInTextEditor:this.nodeInTextEditor,children:(0,L.jsx)(ht,{context:this,webPageNode:this.webPageNode,collectionItemNode:this.collectionItemNode,breakpointNode:this.breakpointNode,activeLocale:this.activeLocale,temporaryCollectionItemNodeId:this.temporaryCollectionItemNodeId})})})})})})}),(0,L.jsx)(Uo,{presetsListNode:this.presetsListNode})]})}))}),this.needsRender=!1)}};function qt({children:r,webPageNodeId:e,onRendered:o}){return(0,k.useEffect)(()=>{o(e)}),(0,L.jsx)(L.Fragment,{children:r})}Object.assign(window,{Framer:co});Ne({name:"canvas",security:{}});var Mt=document.querySelector("main");h(Mt,"Container element not found");var Pt=new ee(Mt),Gt=Eo(Pt.assetMap);F.importFramerFonts(ho);De({isOnPageCanvas:!0,assetResolver:Gt,queueMeasureRequest(...r){Pt.layoutMeasureQueue.add(...r)},enableFontStore:!0,fetchGoogleFontsList:Bo,fetchFontshareFontsList:Wo,fetchBuiltInFontsList:ko,imagePlaceholderSvg:'',useImageSource(r){if(!r.src)return"";let e=Se(r.src);return e?oe(e.identifier):oe(r.src)}}); //# sourceMappingURL=https://app.framerstatic.com/canvas-sandbox-on-page.ISCNHGE3.mjs.map