import{a as T}from"https://app.framerstatic.com/chunk-DVMC7PLY.mjs";import{a as rt,b as nt,c as dt,d as st}from"https://app.framerstatic.com/chunk-6DGJ5YLP.mjs";import{a as at,h as it}from"https://app.framerstatic.com/chunk-EHPCZ4VW.mjs";import{a as tt}from"https://app.framerstatic.com/chunk-OMA2HNXY.mjs";import"https://app.framerstatic.com/chunk-IE6AATEJ.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 pe,v as Jo,w as Xo,x as Yo,y as ue,z as me}from"https://app.framerstatic.com/chunk-P7PJWOOW.mjs";import{a as Uo}from"https://app.framerstatic.com/chunk-PQ54O4WE.mjs";import"https://app.framerstatic.com/chunk-VB64W4N5.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-S3SVHSG6.mjs";import{b as le,c as ce,d as Vo,f as To}from"https://app.framerstatic.com/chunk-JPNAQZSJ.mjs";import{a as So}from"https://app.framerstatic.com/chunk-GIYTXA5R.mjs";import"https://app.framerstatic.com/chunk-PABHF7FN.mjs";import{Qg as Mo,Rg as No,kb as Po}from"https://app.framerstatic.com/chunk-UUKPZHP4.mjs";import{k as Io}from"https://app.framerstatic.com/chunk-F4QYVBGQ.mjs";import"https://app.framerstatic.com/chunk-UJZ2TDVM.mjs";import"https://app.framerstatic.com/chunk-CYY6DDN4.mjs";import"https://app.framerstatic.com/chunk-V4TANWPK.mjs";import"https://app.framerstatic.com/chunk-7FRK6ZG4.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-LOJT7XUZ.mjs";import{Zc as go,o as bo,q as Ro}from"https://app.framerstatic.com/chunk-ZJ3UG774.mjs";import{$b as ke,Af as Je,Bd as Ue,Cd as Ae,Dm as fo,Fn as se,Gf as Q,Gg as co,Hd as B,L as O,Ld as He,Md as ie,Mu as q,Nd as z,Od as ze,Oe as je,Pa as te,Pd as Qe,Qf as Xe,Qm as ho,Rd as qe,Ru as yo,S as xe,Sd as Ge,Tf as Ye,U as Ve,Uf as eo,Ws as Co,Xs as vo,Yb as Ee,Yf as oo,Zc as H,bg as de,ca as Te,cl as uo,eg as to,fg as ro,ge as Ze,gg as no,he as Ke,hg as ao,ic as We,ie as _e,kc as ae,og as io,rb as ne,sb as De,sg as so,sl as mo,tg as lo,xd as Be,xe as $e}from"https://app.framerstatic.com/chunk-AUPTWZB2.mjs";import"https://app.framerstatic.com/chunk-VXJAAVJQ.mjs";import"https://app.framerstatic.com/chunk-5DSVU7DA.mjs";import"https://app.framerstatic.com/chunk-KD4H3DLZ.mjs";import"https://app.framerstatic.com/chunk-4DUBS6C5.mjs";import"https://app.framerstatic.com/chunk-XX4R3RQ6.mjs";import"https://app.framerstatic.com/chunk-NQDVPV67.mjs";import"https://app.framerstatic.com/chunk-XFC6OVIX.mjs";import"https://app.framerstatic.com/chunk-4I3XDWXC.mjs";import"https://app.framerstatic.com/chunk-POQKH4YA.mjs";import"https://app.framerstatic.com/chunk-4AQCMAAQ.mjs";import{e as Lo}from"https://app.framerstatic.com/chunk-YK5ZO2IU.mjs";import{p as Lt}from"https://app.framerstatic.com/chunk-K7F4ESDY.mjs";import"https://app.framerstatic.com/chunk-AUNF3KWQ.mjs";import{I as po,d as oe,k as Le,n as Se}from"https://app.framerstatic.com/chunk-3H7BYZWZ.mjs";import{b as F,e as Oe,f as Fe,i as re}from"https://app.framerstatic.com/chunk-ZQUNXESX.mjs";import{a as w,b as V,zc as we}from"https://app.framerstatic.com/chunk-BWUNBOFS.mjs";import{i as Ne}from"https://app.framerstatic.com/chunk-PFHOMMMY.mjs";import"https://app.framerstatic.com/chunk-72P4HPJP.mjs";import"https://app.framerstatic.com/chunk-WIUFUKXG.mjs";import{A as ge,F as ye,J as Ie,N as Pe,O as Me,aa as A,i as be,k as W}from"https://app.framerstatic.com/chunk-GQILM44Y.mjs";import{a as f,b as ve}from"https://app.framerstatic.com/chunk-WNSBRACC.mjs";import{a as Re}from"https://app.framerstatic.com/chunk-LQILWJHN.mjs";import{e as P,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((bo(r)||Ro(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=P(w()),It=P(Lt());var Z=P(w()),mt=P(V()),ct=(0,Z.createContext)(void 0);function pt({children:r,nodeInTextEditor:e}){return(0,mt.jsx)(ct.Provider,{value:e,children:r})}function ut(){return(0,Z.useContext)(ct)}var I=P(w());var K=P(w()),D=P(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 l=P(V());xe({target:Ve.canvas});function ht({context:r,webPageNode:e,collectionItemNode:o,breakpointNode:t,activeLocale:n}){if(e&&t)return H(e)&&o?(0,l.jsx)(_,{context:r,children:(0,l.jsx)(xt,{context:r,webPageNode:e,collectionItemNode:o,breakpointNode:t,activeLocale:n})}):(0,l.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}){let i=e.tree();f(i,"Must have a tree");let a=e.dataIdentifier,c=U(i,a);r.modulesRuntime.usePreloadedModules(...c);let[d,p]=r.modulesRuntime.useComponentLoader(),u=d.dataForIdentifier(a);f(u,"Data definition must exist after preloading module");let h=e.getVariableControlMap(i,d,p);f(h,"Control map must exist");let v=Xo(e,i,h,t,n,u,o.id,"public-and-private"),M=de(v);r.sandboxCollectionData.set(e.id,M,h);let g=e.getVariableValueMap(i,d,r.sandboxCollectionData,p);f(g,"Value map must exist");let y=q(i,a),N=!!o.privateToUserId,{patchedValueMap:S,placeholderVariableIds:R}=(0,I.useMemo)(()=>!N||!y?{patchedValueMap:g,placeholderVariableIds:new Set}:Vt(y,g),[y,N,g]),m=(0,I.useMemo)(()=>{let b=new Map;return b.set(e.id,h),b},[h,e.id]),C=(0,I.useMemo)(()=>{let b=new Map;return b.set(e.id,S),b},[S,e.id]);return(0,l.jsx)(Ct,{context:r,webPageNode:e,breakpointNode:t,combinedControlMap:m,combinedValueMap:C,placeholderVariableIds:R,activeLocale:n})}function Vt(r,e){let o=new Map(e),t=new Set;for(let[n,i]of e){if(i)continue;let a=r.getVariable(n);if(a){if(a.type==="string"){let c=a.options?.placeholder||a.description||a.name;o.set(n,c),t.add(n)}a.type==="richtext"&&(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,l.jsx)(_,{context:r,children:(0,l.jsx)(wt,{context:r,webPageNode:e,breakpointNode:o,combinedControlMap:t,combinedValueMap:n,placeholderVariableIds:i,activeLocale:a})}):(0,l.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 c=(0,I.useRef)(null),d=(0,I.useRef)(null);r.modulesRuntime.usePreloadedModules(e.layoutTemplateIdentifier);let[p]=r.modulesRuntime.useComponentLoader(),u=G(),h=$(r.fetchClient,e),v=e.getResolvedControlPropValues(p,u,n,a,h);v.style??={},Object.assign(v.style,vt);let M=p.reactComponentForIdentifier(e.layoutTemplateIdentifier);f(M,"Component definition not found");let g=M.class,y=fo(o)&&je(o)?o.width:void 0,{activeVariant:N,className:S,selectors:R}=Zo(e.layoutTemplateIdentifier,y,Tt)||{};(0,I.useLayoutEffect)(()=>{if(!c.current||!d.current)return;let C=qo(d.current);if(r.layoutMeasureQueue.add(o.id,c.current,C),!!R)for(let b of R){let x=c.current.querySelector(b);x&&r.layoutMeasureQueue.add(o.id,x,[],b)}},[r.layoutMeasureQueue,o.id,R]);let m=(0,I.useMemo)(()=>({ref:d}),[]);return(0,l.jsx)("div",{ref:c,className:S,children:(0,l.jsx)(g,{...v,variant:N,children:(0,l.jsx)(E,{context:r,parentRenderId:e.id,node:o,parent:e,combinedControlMap:t,combinedValueMap:n,placeholderVariableIds:i,activeLocale:a,nodePropOverrides:m})})})}var E=(0,I.memo)(function({context:e,parentRenderId:o,node:t,parent:n,combinedControlMap:i,combinedValueMap:a,placeholderVariableIds:c,activeLocale:d,nodePropOverrides:p}){let u=le(o,t.id),h=t.tree();return t.cache.resetForRendering(),t.cache.setVariableValueAndControlMap(a,a,i,d),Fo(n,t),vo(t)&&Co(t,h)||t.resolveValue("visible",a)===!1?(e.sandboxVisibility.setVisible(u,!1),null):(e.sandboxVisibility.setVisible(u,!0),(0,l.jsx)(_,{context:e,children:(0,l.jsx)(Ft,{context:e,renderId:u,tree:h,node:t,parent:n,combinedControlMap:i,combinedValueMap:a,placeholderVariableIds:c,activeLocale:d,nodePropOverrides:p})}))});function Ot(r,e,o,t,n,i,a){let c=$(r.fetchClient,o),d=o.getProps(n,i,c);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 u=a[p];p==="style"&&d.style?Object.assign(d.style,u):d[p]=u}return d}function Ft({context:r,renderId:e,tree:o,node:t,parent:n,combinedControlMap:i,combinedValueMap:a,placeholderVariableIds:c,activeLocale:d,nodePropOverrides:p}){let u=Ot(r,e,t,n,a,d,p);if(Qe(t))return(0,l.jsx)(so,{...u});if(Ge(t))return me(t),(0,l.jsx)(te,{...u,as:"svg",children:t.children.map(h=>{let v=le(e,h.id);return ue(h,a,r.sandboxVisibility,v,!1)})});if(uo(t))return me(t),ue(t,a,r.sandboxVisibility,e,!0);if(He(t))return(0,l.jsx)(lo,{...u});if(ie(t))return(0,l.jsx)(Dt,{context:r,node:t,combinedValueMap:a,placeholderVariableIds:c,activeLocale:d,nodeProps:u,renderId:e});if(Be(t)){let h=yo(o,t);return(0,l.jsx)(te,{...u,children:t.getChildrenInVisualOrder().map(v=>v.id===h?.id?(0,l.jsx)(At,{context:r,parentRenderId:e,tree:o,node:v,parent:t,combinedControlMap:i,combinedValueMap:a,placeholderVariableIds:c,activeLocale:d},"repeated-child"):(0,l.jsx)(E,{context:r,parentRenderId:e,node:v,parent:t,combinedControlMap:i,combinedValueMap:a,placeholderVariableIds:c,activeLocale:d,nodePropOverrides:void 0},v.id))})}return Ze(t)?(0,l.jsx)(ro,{...u}):_e(t)?(0,l.jsx)(ao,{...u}):Ke(t)?(0,l.jsx)(no,{...u}):ze(t)?null:z(t)?t.isVectorInstance?(0,l.jsx)(Wt,{node:t,context:r,nodeProps:u,combinedValueMap:a,activeLocale:d}):(0,l.jsx)(kt,{context:r,renderId:e,node:t,combinedControlMap:i,combinedValueMap:a,placeholderVariableIds:c,activeLocale:d,nodeProps:u}):($e(t),null)}var Dt=(0,I.memo)(function({context:e,node:o,combinedValueMap:t,placeholderVariableIds:n,activeLocale:i,nodeProps:a,renderId:c}){let d=o.getFontsForLoading();e.fontLoader.usePreloadedFonts(...d),a={...a},ut()===c&&(a.isEditable=!0),Et(o,n)&&(a.opacity=.3);let u=(0,I.useMemo)(()=>et(o,t,i),[o,t,i]);if(ae(o.htmlContent)&&o.getComponentPresets().size>0){let h=o.tree();return f(h,"Must have a tree"),(0,l.jsx)(Qo,{tree:h,node:o,...a,children:u})}return(0,l.jsx)(io,{...a,children:u})});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:c}){let d=o.tree();f(d,"Must have a tree"),r.modulesRuntime.usePreloadedModules(o.codeComponentIdentifier);let[p]=r.modulesRuntime.useComponentLoader(),u=p.reactComponentForIdentifier(o.codeComponentIdentifier);f(u,"Component definition not found");let h=G(),v=$(r.fetchClient,o),M=o.getCodeComponentProps(p,h,n,a,v),g=Mo(d,o,p);g.children=No(d,o,p);for(let m in g){let C=g[m];C&&(M[m]=C.map(b=>{let x=Vo(e,o.id,m,b.key);return(0,l.jsx)(E,{context:r,parentRenderId:x,node:b.node,parent:o,combinedControlMap:t,combinedValueMap:n,placeholderVariableIds:i,activeLocale:a,nodePropOverrides:Ut},b.key)}))}let y=o.getRichTextControlKeys(p);for(let m of y){let C=M[m];F(C)&&(M[m]=Oo(C))}let N=o.getComponentVectorSetChildren(p,n),S=new Set;for(let m in N){let C=N[m];re(C)||(S.add(C),r.modulesRuntime.preloadModule(C))}r.modulesRuntime.usePreloadedModules(...S);for(let m in N){let C=N[m];if(re(C))continue;let b=p.reactComponentForIdentifier(C);f(b,"Vector definition not found"),M[m]=b.class}let R=u.class;return(0,l.jsx)(Ko,{...c,children:(0,l.jsx)(R,{...M})})}function Wt({context:r,node:e,nodeProps:o,combinedValueMap:t,activeLocale:n}){let[i]=r.modulesRuntime.useComponentLoader(),a=G(),c=$(r.fetchClient,e);return _o({node:e,frameProps:o,getCodeComponentProps(){return e.getCodeComponentProps(i,a,t,n,c)},combinedValueMap:t,renderVectorWithIdentifier(d,p){return(0,l.jsx)(Bt,{context:r,identifier:d,vectorProps:p})}})}function Bt({context:r,identifier:e,vectorProps:o}){r.modulesRuntime.preloadModule(e),r.modulesRuntime.usePreloadedModules(e);let[t]=r.modulesRuntime.useComponentLoader(),n=t.reactComponentForIdentifier(e);f(n,"Component definition not found");let i=n.class;return(0,l.jsx)(i,{...o})}var Ut={position:"relative"};function At({parent:r,...e}){if(Ue(r))return(0,l.jsx)(Ht,{...e,parent:r});if(Ae(r))return(0,l.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:c,activeLocale:d}){let p=U(o,n.dataIdentifier);r.modulesRuntime.usePreloadedModules(...p);let[u,h]=r.modulesRuntime.useComponentLoader(),v=n.getVariableControlMap(o,u,h);f(v,"Control map must exist");let M=Do(n,v,$o(o,n),R=>({type:"LiteralValue",value:t.cache.getVariableReferenceValue(R,a)}),R=>Jo(o,n,R,d));Po(n)&&jo(M,n);let g=de(M);r.sandboxCollectionData.set(e,g,v);let y=n.originalid??n.id,N=(0,I.useMemo)(()=>{let R=new Map(i);return R.set(y,v),R},[v,i,y]),S=(0,I.useMemo)(()=>g.map((R,m)=>{let C=new Map(a),b=pe(o,v,R,m);return C.set(y,b),C}),[o,v,a,y,g]);return g.map((R,m)=>{let C=F(R.id)?R.id:m,b=S[m],x=ce(e,n.id,C,m);return(0,l.jsx)(E,{context:r,parentRenderId:x,node:t,parent:n,combinedControlMap:N,combinedValueMap:b,placeholderVariableIds:c,activeLocale:d,nodePropOverrides:void 0},C)})}function zt({context:r,parentRenderId:e,tree:o,node:t,parent:n,combinedControlMap:i,combinedValueMap:a,placeholderVariableIds:c,activeLocale:d}){f(a,"Combined value map must exist");let[p,u]=r.modulesRuntime.useComponentLoader(),h=n.getVariableControlMap(o,p,u);f(h,"Control map must exist");let v=n.dataRepeaterArray,M=v.providerId;f(M,"Variable must have providerId");let g=a.get(M);f(g,"Provider value map must exist");let y=g.get(v.id);f(Fe(y)&&y.every(Oe),"Invalid array value");let N=n.originalid??n.id,S=(0,I.useMemo)(()=>{let m=new Map(i);return m.set(N,h),m},[h,i,N]),R=(0,I.useMemo)(()=>y.map((m,C)=>{let b=new Map(a),x=pe(o,h,m,C);return b.set(N,x),b}),[o,h,a,N,y]);return y.map((m,C)=>{let b=F(m.id)?m.id:C,x=R[C],Nt=ce(e,n.id,b,C);return(0,l.jsx)(E,{context:r,parentRenderId:Nt,node:t,parent:n,combinedControlMap:S,combinedValueMap:x,placeholderVariableIds:c,activeLocale:d,nodePropOverrides:void 0},b)})}function $(r,e){return o=>{let t=Ee(o);if(!Ao(t))return Ho(e,t.controlProp);let n=ke(t,c=>e.cache.getVariableReferenceValue(c)),i=Xe({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=P(w());var Rt=P(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)(()=>mo(r,o),[r,o]);return(0,Rt.jsx)(to,{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 O.loadFonts([o])});t.preload(),this.loaders.set(o,t)}}usePreloadedFonts(...e){for(let o of e){let t=this.loaders.get(o);f(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 yt=P(w());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 oo);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,yt.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`${Re().modulesCDN}/${e.moduleId}/${e.saveId}/${e.file}`}getModuleURL(e){return ge(e)?this.getExternalModuleURL(e):this.getLocalModuleURL(e)}async loadModule(e){this.preloadModule(e),await this.getPreloadedModule(e).loader.readAsync()}preloadModule(e){let o=gt(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=gt(e),t=this.loadedModules.get(o.value);return f(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){f(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=ye(n),a=this.loadedModules.get(i.value);if(a){let c=this.getLocalModuleURL(i);c&&a.evaluate(c).catch(W)}}}updateLocalModulesImportMap(){let e={imports:{},scopes:{}};for(let[o,t]of this.localModules){let n=t.files.module;if(!n)continue;let i=Me(o,n);e.imports[i]=t.moduleURL}he(e,"framer-local-modules")}insertTemporaryImportMap(e){let o=crypto.randomUUID();he(e,o)}};function gt(r){let e=Ie(r);return f(e,"Invalid module identifier"),Pe(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=P(V()),Qt=We(r=>r?go(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 Ye);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,"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,It.createRoot)(this.container);let o=new So(T);o.setLocal(T.channels.sandbox,this),o.setLocal(T.channels.controlsVisibility,this.controlsVisibility),o.setLocal(T.channels.modulesRuntime,this.modulesRuntime),this.remoteComponentsStore=o.getRemote(T.channels.componentsStore),this.remoteSandboxStore=o.getRemote(T.channels.sandboxStore),this.remoteTreeStore=o.getRemote(T.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:Lo(document.referrer).origin}),new ResizeObserver(t=>{f(t.length===1,"Invalid length");let n=t[0];f(n,"Invalid entry"),f(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;F(a)&&(this.container.className=a);let c=e.dependenciesModule;c&&this.modulesRuntime.updateDependenciesModule(c);let d=e.localModules;d&&this.modulesRuntime.updateLocalModules(d);let p=e.assets;p&&(this.assetMap.set(p),O.importCustomFonts(p,po.isOn("customFontImprovements"))),this.nodeInTextEditor!==e.nodeInTextEditor&&e.nodeInTextEditor!==void 0&&(this.nodeInTextEditor=e.nodeInTextEditor,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(Io(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,qe)??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)(Je,{children:(0,L.jsx)(we,{isStatic:!0,children:(0,L.jsx)(eo,{client:this.fetchClient,children:(0,L.jsx)(Te,{parentSize:1,children:(0,L.jsx)(pt,{nodeInTextEditor:this.nodeInTextEditor,children:(0,L.jsx)(ht,{context:this,webPageNode:this.webPageNode,collectionItemNode:this.collectionItemNode,breakpointNode:this.breakpointNode,activeLocale:this.activeLocale})})})})})})}),(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 Pt=document.querySelector("main");f(Pt,"Container element not found");var Mt=new ee(Pt),Gt=Eo(Mt.assetMap);O.importFramerFonts(ho);De({isOnPageCanvas:!0,assetResolver:Gt,queueMeasureRequest(...r){Mt.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.CO52Q6NN.mjs.map