opencami 1.3.2 → 1.5.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/README.md +60 -0
- package/dist/client/assets/CSPContext-EgWK8bIJ.js +1 -0
- package/dist/client/assets/DirectionContext-DXtY05YF.js +1 -0
- package/dist/client/assets/_sessionKey-B89e7G3y.js +100 -0
- package/dist/client/assets/agents-screen-1BiEZ9od.js +1 -0
- package/dist/client/assets/agents-x54ocA9z.js +2 -0
- package/dist/client/assets/bots-screen-BNQciUeJ.js +1 -0
- package/dist/client/assets/bots-x86ZHG4b.js +2 -0
- package/dist/client/assets/button-nDcsaNPl.js +1 -0
- package/dist/client/assets/{connect-CtDn993i.js → connect-w4lLOqiJ.js} +1 -1
- package/dist/client/assets/file-explorer-screen-CAsjd3w8.js +1 -0
- package/dist/client/assets/files-Bype5Mnb.js +2 -0
- package/dist/client/assets/{index-N9-2R5hZ.js → index-36G0WCxU.js} +1 -1
- package/dist/client/assets/index-BXkRE220.js +153 -0
- package/dist/client/assets/keyboard-shortcuts-dialog-BdCeXRjD.js +1 -0
- package/dist/client/assets/{main-DrVY5UJU.js → main-B3N0eQFg.js} +129 -17
- package/dist/client/assets/opencami-logo-DD0DPFRQ.js +1 -0
- package/dist/client/assets/{react-CzqI3gbN.js → react-B16OrBeM.js} +1 -1
- package/dist/client/assets/search-dialog-BjTPceEl.js +1 -0
- package/dist/client/assets/session-export-dialog-DtHKG2zW.js +1 -0
- package/dist/client/assets/settings-dialog-hiqdk_UD.js +1 -0
- package/dist/client/assets/skills-DhwyFq3y.js +2 -0
- package/dist/client/assets/skills-panel-BLUjzfjJ.js +5 -0
- package/dist/client/assets/styles-CHP4l6vZ.css +1 -0
- package/dist/client/assets/switch-J6wLIVu2.js +1 -0
- package/dist/client/assets/tabs-DvPgTz5I.js +1 -0
- package/dist/client/assets/tooltip-C14vdXHK.js +1 -0
- package/dist/client/assets/use-file-explorer-state-BnaJEqRP.js +12 -0
- package/dist/client/assets/useButton-Bnnac1eR.js +1 -0
- package/dist/client/assets/useCompositeItem-BgiEMKAt.js +1 -0
- package/dist/client/assets/useControlled-BhUuiHAm.js +1 -0
- package/dist/client/assets/useMutation-CFmVaBag.js +1 -0
- package/dist/client/assets/visuallyHidden-DCCICp6T.js +9 -0
- package/dist/server/assets/{_sessionKey-DVNrEYFh.js → _sessionKey-tRze5NLR.js} +493 -92
- package/dist/server/assets/_tanstack-start-manifest_v-CyfoMvUa.js +4 -0
- package/dist/server/assets/{agents-Dz_i76VW.js → agents-CmQ4vvXm.js} +1 -1
- package/dist/server/assets/{agents-screen-CqQPJndp.js → agents-screen-bmrIyFbk.js} +43 -35
- package/dist/server/assets/bots-Byt6jv0a.js +11 -0
- package/dist/server/assets/bots-screen-C2TGFv42.js +474 -0
- package/dist/server/assets/{button-DtQ3rV1m.js → button-CwY2OHFj.js} +2 -2
- package/dist/server/assets/{connect-CIDOw12K.js → connect-d3AqjAqe.js} +2 -2
- package/dist/server/assets/{file-explorer-screen-Cx0jiLRU.js → file-explorer-screen-CVlFiAFu.js} +39 -40
- package/dist/server/assets/{files-Trs1M5ba.js → files-BIEcSPGp.js} +1 -1
- package/dist/server/assets/{index-CmbNTqa2.js → index-CNIATlJ9.js} +93 -38
- package/dist/server/assets/{index-Dv2RXDa2.js → index-CRfLKh30.js} +2 -1
- package/dist/server/assets/{keyboard-shortcuts-dialog-7OEtXUlW.js → keyboard-shortcuts-dialog-CsNP85q8.js} +2 -2
- package/dist/server/assets/{router-OoQe2c20.js → router-rn7pJO_D.js} +515 -78
- package/dist/server/assets/{search-dialog-Bq0Pnxdb.js → search-dialog-Bz4Cu0KW.js} +23 -6
- package/dist/server/assets/{session-export-dialog-DRVbC8Q-.js → session-export-dialog-CwclV0Aj.js} +2 -2
- package/dist/server/assets/{settings-dialog-BsJsnMiu.js → settings-dialog-BBM7jCjE.js} +409 -95
- package/dist/server/assets/skills-Cy8xclXY.js +11 -0
- package/dist/server/assets/skills-panel-BnRNb7u9.js +762 -0
- package/dist/server/assets/{switch-DnX0MjGS.js → switch-BbkUeVDV.js} +1 -1
- package/dist/server/assets/tabs-DDFZob0m.js +67 -0
- package/dist/server/assets/{tooltip-gbV6rEVv.js → tooltip-DgsSPocE.js} +1 -1
- package/dist/server/assets/{use-file-explorer-state-DMHdtb7D.js → use-file-explorer-state-Il1LlBAe.js} +13 -1
- package/dist/server/server.js +2 -2
- package/package.json +6 -2
- package/dist/client/assets/_sessionKey-Z6Wcnj0N.js +0 -97
- package/dist/client/assets/agents-D8ZHVQ1Z.js +0 -2
- package/dist/client/assets/agents-screen-BVK0QTRH.js +0 -1
- package/dist/client/assets/button-CuH8u1uR.js +0 -1
- package/dist/client/assets/file-explorer-screen-DMUuR1uG.js +0 -1
- package/dist/client/assets/files-CDMLoJ0u.js +0 -2
- package/dist/client/assets/index-IGP-Igwt.js +0 -153
- package/dist/client/assets/keyboard-shortcuts-dialog-DW--4YLF.js +0 -1
- package/dist/client/assets/opencami-logo-ChD2XR2j.js +0 -1
- package/dist/client/assets/search-dialog-DYyFYJmw.js +0 -1
- package/dist/client/assets/session-export-dialog-BFizBmGb.js +0 -1
- package/dist/client/assets/settings-dialog-UvgVi2It.js +0 -1
- package/dist/client/assets/styles-BGTCU8mq.css +0 -1
- package/dist/client/assets/switch-DxW2OWPG.js +0 -1
- package/dist/client/assets/use-file-explorer-state-Cii59H70.js +0 -12
- package/dist/client/assets/useButton-hZdvKtl_.js +0 -9
- package/dist/server/assets/_tanstack-start-manifest_v-PwRq_yJS.js +0 -4
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{S as Br,p as Rn,l as G,s as xe,m as wt,f as Se,o as Pe,q as Dn,t as jr,v as jt,x as Nr,y as Ur,z as En,n as Qs,r as y,i as qs,u as Wr,j as Q}from"./main-B3N0eQFg.js";var Kr=class extends Br{constructor(t,e){super(),this.options=e,this.#n=t,this.#i=null,this.#s=Rn(),this.bindMethods(),this.setOptions(e)}#n;#t=void 0;#p=void 0;#e=void 0;#o;#u;#s;#i;#m;#h;#f;#a;#l;#r;#d=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Ln(this.#t,this.options)?this.#c():this.updateResult(),this.#T())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return be(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return be(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,n=this.#t;if(this.options=this.#n.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof G(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#P(),this.#t.setOptions(this.options),e._defaulted&&!xe(this.options,e)&&this.#n.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&In(this.#t,n,this.options,e)&&this.#c(),this.updateResult(),s&&(this.#t!==n||G(this.options.enabled,this.#t)!==G(e.enabled,this.#t)||wt(this.options.staleTime,this.#t)!==wt(e.staleTime,this.#t))&&this.#g();const i=this.#y();s&&(this.#t!==n||G(this.options.enabled,this.#t)!==G(e.enabled,this.#t)||i!==this.#r)&&this.#v(i)}getOptimisticResult(t){const e=this.#n.getQueryCache().build(this.#n,t),n=this.createResult(e,t);return $r(this,n)&&(this.#e=n,this.#u=this.options,this.#o=this.#t.state),n}getCurrentResult(){return this.#e}trackResult(t,e){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),e?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){this.#d.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#n.defaultQueryOptions(t),n=this.#n.getQueryCache().build(this.#n,e);return n.fetch().then(()=>this.createResult(n,e))}fetch(t){return this.#c({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#e))}#c(t){this.#P();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(Se)),e}#g(){this.#x();const t=wt(this.options.staleTime,this.#t);if(Pe||this.#e.isStale||!Dn(t))return;const n=jr(this.#e.dataUpdatedAt,t)+1;this.#a=jt.setTimeout(()=>{this.#e.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(t){this.#S(),this.#r=t,!(Pe||G(this.options.enabled,this.#t)===!1||!Dn(this.#r)||this.#r===0)&&(this.#l=jt.setInterval(()=>{(this.options.refetchIntervalInBackground||Nr.isFocused())&&this.#c()},this.#r))}#T(){this.#g(),this.#v(this.#y())}#x(){this.#a&&(jt.clearTimeout(this.#a),this.#a=void 0)}#S(){this.#l&&(jt.clearInterval(this.#l),this.#l=void 0)}createResult(t,e){const n=this.#t,s=this.options,i=this.#e,o=this.#o,r=this.#u,l=t!==n?t.state:this.#p,{state:u}=t;let c={...u},h=!1,f;if(e._optimisticResults){const P=this.hasListeners(),C=!P&&Ln(t,e),R=P&&In(t,n,e,s);(C||R)&&(c={...c,...Ur(u.data,t.options)}),e._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:d,errorUpdatedAt:p,status:m}=c;f=c.data;let v=!1;if(e.placeholderData!==void 0&&f===void 0&&m==="pending"){let P;i?.isPlaceholderData&&e.placeholderData===r?.placeholderData?(P=i.data,v=!0):P=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,P!==void 0&&(m="success",f=En(i?.data,P,e),h=!0)}if(e.select&&f!==void 0&&!v)if(i&&f===o?.data&&e.select===this.#m)f=this.#h;else try{this.#m=e.select,f=e.select(f),f=En(i?.data,f,e),this.#h=f,this.#i=null}catch(P){this.#i=P}this.#i&&(d=this.#i,f=this.#h,p=Date.now(),m="error");const T=c.fetchStatus==="fetching",S=m==="pending",g=m==="error",w=S&&T,b=f!==void 0,V={status:m,fetchStatus:c.fetchStatus,isPending:S,isSuccess:m==="success",isError:g,isInitialLoading:w,isLoading:w,data:f,dataUpdatedAt:c.dataUpdatedAt,error:d,errorUpdatedAt:p,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:T,isRefetching:T&&!S,isLoadingError:g&&!b,isPaused:c.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:g&&b,isStale:ze(t,e),refetch:this.refetch,promise:this.#s,isEnabled:G(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const P=V.data!==void 0,C=V.status==="error"&&!P,R=J=>{C?J.reject(V.error):P&&J.resolve(V.data)},N=()=>{const J=this.#s=V.promise=Rn();R(J)},z=this.#s;switch(z.status){case"pending":t.queryHash===n.queryHash&&R(z);break;case"fulfilled":(C||V.data!==z.value)&&N();break;case"rejected":(!C||V.error!==z.reason)&&N();break}}return V}updateResult(){const t=this.#e,e=this.createResult(this.#t,this.options);if(this.#o=this.#t.state,this.#u=this.options,this.#o.data!==void 0&&(this.#f=this.#t),xe(e,t))return;this.#e=e;const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!this.#d.size)return!0;const o=new Set(i??this.#d);return this.options.throwOnError&&o.add("error"),Object.keys(this.#e).some(r=>{const a=r;return this.#e[a]!==t[a]&&o.has(a)})};this.#b({listeners:n()})}#P(){const t=this.#n.getQueryCache().build(this.#n,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#p=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#T()}#b(t){Qs.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#e)}),this.#n.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function _r(t,e){return G(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Ln(t,e){return _r(t,e)||t.state.data!==void 0&&be(t,e,e.refetchOnMount)}function be(t,e,n){if(G(e.enabled,t)!==!1&&wt(e.staleTime,t)!=="static"){const s=typeof n=="function"?n(t):n;return s==="always"||s!==!1&&ze(t,e)}return!1}function In(t,e,n,s){return(t!==e||G(s.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&ze(t,n)}function ze(t,e){return G(e.enabled,t)!==!1&&t.isStaleByTime(wt(e.staleTime,t))}function $r(t,e){return!xe(t.getCurrentResult(),e)}var Zs=y.createContext(!1),Hr=()=>y.useContext(Zs);Zs.Provider;function Gr(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var zr=y.createContext(Gr()),Xr=()=>y.useContext(zr),Yr=(t,e,n)=>{const s=n?.state.error&&typeof t.throwOnError=="function"?qs(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||s)&&(e.isReset()||(t.retryOnMount=!1))},Qr=t=>{y.useEffect(()=>{t.clearReset()},[t])},qr=({result:t,errorResetBoundary:e,throwOnError:n,query:s,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&s&&(i&&t.data===void 0||qs(n,[t.error,s])),Zr=t=>{if(t.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),s=t.staleTime;t.staleTime=typeof s=="function"?(...i)=>n(s(...i)):n(s),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},Jr=(t,e)=>t.isLoading&&t.isFetching&&!e,to=(t,e)=>t?.suspense&&e.isPending,kn=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function eo(t,e,n){const s=Hr(),i=Xr(),o=Wr(),r=o.defaultQueryOptions(t);o.getDefaultOptions().queries?._experimental_beforeQuery?.(r);const a=o.getQueryCache().get(r.queryHash);r._optimisticResults=s?"isRestoring":"optimistic",Zr(r),Yr(r,i,a),Qr(i);const l=!o.getQueryCache().get(r.queryHash),[u]=y.useState(()=>new e(o,r)),c=u.getOptimisticResult(r),h=!s&&t.subscribed!==!1;if(y.useSyncExternalStore(y.useCallback(f=>{const d=h?u.subscribe(Qs.batchCalls(f)):Se;return u.updateResult(),d},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),y.useEffect(()=>{u.setOptions(r)},[r,u]),to(r,c))throw kn(r,u,i);if(qr({result:c,errorResetBoundary:i,throwOnError:r.throwOnError,query:a,suspense:r.suspense}))throw c.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(r,c),r.experimental_prefetchInRender&&!Pe&&Jr(c,s)&&(l?kn(r,u,i):a?.promise)?.catch(Se).finally(()=>{u.updateResult()}),r.notifyOnChangeProps?c:u.trackResult(c)}function Uu(t,e){return eo(t,Kr)}const Xe=y.createContext({});function Ye(t){const e=y.useRef(null);return e.current===null&&(e.current=t()),e.current}const Js=typeof window<"u",ti=Js?y.useLayoutEffect:y.useEffect,te=y.createContext(null);function Qe(t,e){t.indexOf(e)===-1&&t.push(e)}function qe(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Y=(t,e,n)=>n>e?e:n<t?t:n;let Ze=()=>{};const Z={},ei=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function ni(t){return typeof t=="object"&&t!==null}const si=t=>/^0[^.\s]+$/u.test(t);function Je(t){let e;return()=>(e===void 0&&(e=t()),e)}const _=t=>t,no=(t,e)=>n=>e(t(n)),kt=(...t)=>t.reduce(no),Rt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class tn{constructor(){this.subscriptions=[]}add(e){return Qe(this.subscriptions,e),()=>qe(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let o=0;o<i;o++){const r=this.subscriptions[o];r&&r(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const q=t=>t*1e3,K=t=>t/1e3;function ii(t,e){return e?t*(1e3/e):0}const ri=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,so=1e-7,io=12;function ro(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=ri(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>so&&++a<io);return r}function Ft(t,e,n,s){if(t===e&&n===s)return _;const i=o=>ro(o,0,1,t,n);return o=>o===0||o===1?o:ri(i(o),e,s)}const oi=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ai=t=>e=>1-t(1-e),li=Ft(.33,1.53,.69,.99),en=ai(li),ci=oi(en),ui=t=>(t*=2)<1?.5*en(t):.5*(2-Math.pow(2,-10*(t-1))),nn=t=>1-Math.sin(Math.acos(t)),hi=ai(nn),fi=oi(nn),oo=Ft(.42,0,1,1),ao=Ft(0,0,.58,1),di=Ft(.42,0,.58,1),lo=t=>Array.isArray(t)&&typeof t[0]!="number",pi=t=>Array.isArray(t)&&typeof t[0]=="number",co={linear:_,easeIn:oo,easeInOut:di,easeOut:ao,circIn:nn,circInOut:fi,circOut:hi,backIn:en,backInOut:ci,backOut:li,anticipate:ui},uo=t=>typeof t=="string",Fn=t=>{if(pi(t)){Ze(t.length===4);const[e,n,s,i]=t;return Ft(e,n,s,i)}else if(uo(t))return co[t];return t},Nt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function ho(t,e){let n=new Set,s=new Set,i=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(c){r.has(c)&&(u.schedule(c),t()),c(a)}const u={schedule:(c,h=!1,f=!1)=>{const p=f&&i?n:s;return h&&r.add(c),p.has(c)||p.add(c),c},cancel:c=>{s.delete(c),r.delete(c)},process:c=>{if(a=c,i){o=!0;return}i=!0,[n,s]=[s,n],n.forEach(l),n.clear(),i=!1,o&&(o=!1,u.process(c))}};return u}const fo=40;function mi(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=Nt.reduce((g,w)=>(g[w]=ho(o),g),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:h,preRender:f,render:d,postRender:p}=r,m=()=>{const g=Z.useManualTiming?i.timestamp:performance.now();n=!1,Z.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,fo),1)),i.timestamp=g,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),f.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(m))},v=()=>{n=!0,s=!0,i.isProcessing||t(m)};return{schedule:Nt.reduce((g,w)=>{const b=r[w];return g[w]=(A,V=!1,P=!1)=>(n||v(),b.schedule(A,V,P)),g},{}),cancel:g=>{for(let w=0;w<Nt.length;w++)r[Nt[w]].cancel(g)},state:i,steps:r}}const{schedule:M,cancel:nt,state:F,steps:ie}=mi(typeof requestAnimationFrame<"u"?requestAnimationFrame:_,!0);let _t;function po(){_t=void 0}const B={now:()=>(_t===void 0&&B.set(F.isProcessing||Z.useManualTiming?F.timestamp:performance.now()),_t),set:t=>{_t=t,queueMicrotask(po)}},gi=t=>e=>typeof e=="string"&&e.startsWith(t),yi=gi("--"),mo=gi("var(--"),sn=t=>mo(t)?go.test(t.split("/*")[0].trim()):!1,go=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function On(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const vt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Dt={...vt,transform:t=>Y(0,1,t)},Ut={...vt,default:1},Ct=t=>Math.round(t*1e5)/1e5,rn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function yo(t){return t==null}const vo=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,on=(t,e)=>n=>!!(typeof n=="string"&&vo.test(n)&&n.startsWith(t)||e&&!yo(n)&&Object.prototype.hasOwnProperty.call(n,e)),vi=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,o,r,a]=s.match(rn);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},To=t=>Y(0,255,t),re={...vt,transform:t=>Math.round(To(t))},lt={test:on("rgb","red"),parse:vi("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+re.transform(t)+", "+re.transform(e)+", "+re.transform(n)+", "+Ct(Dt.transform(s))+")"};function xo(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const we={test:on("#"),parse:xo,transform:lt.transform},Ot=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),tt=Ot("deg"),X=Ot("%"),x=Ot("px"),So=Ot("vh"),Po=Ot("vw"),Bn={...X,parse:t=>X.parse(t)/100,transform:t=>X.transform(t*100)},ft={test:on("hsl","hue"),parse:vi("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+X.transform(Ct(e))+", "+X.transform(Ct(n))+", "+Ct(Dt.transform(s))+")"},L={test:t=>lt.test(t)||we.test(t)||ft.test(t),parse:t=>lt.test(t)?lt.parse(t):ft.test(t)?ft.parse(t):we.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?lt.transform(t):ft.transform(t),getAnimatableNone:t=>{const e=L.parse(t);return e.alpha=0,L.transform(e)}},bo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function wo(t){return isNaN(t)&&typeof t=="string"&&(t.match(rn)?.length||0)+(t.match(bo)?.length||0)>0}const Ti="number",xi="color",Co="var",Ao="var(",jn="${}",Vo=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Et(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(Vo,l=>(L.test(l)?(s.color.push(o),i.push(xi),n.push(L.parse(l))):l.startsWith(Ao)?(s.var.push(o),i.push(Co),n.push(l)):(s.number.push(o),i.push(Ti),n.push(parseFloat(l))),++o,jn)).split(jn);return{values:n,split:a,indexes:s,types:i}}function Si(t){return Et(t).values}function Pi(t){const{split:e,types:n}=Et(t),s=e.length;return i=>{let o="";for(let r=0;r<s;r++)if(o+=e[r],i[r]!==void 0){const a=n[r];a===Ti?o+=Ct(i[r]):a===xi?o+=L.transform(i[r]):o+=i[r]}return o}}const Mo=t=>typeof t=="number"?0:L.test(t)?L.getAnimatableNone(t):t;function Ro(t){const e=Si(t);return Pi(t)(e.map(Mo))}const st={test:wo,parse:Si,createTransformer:Pi,getAnimatableNone:Ro};function oe(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Do({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,o=0,r=0;if(!e)i=o=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=oe(l,a,t+1/3),o=oe(l,a,t),r=oe(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}function zt(t,e){return n=>n>0?e:t}const D=(t,e,n)=>t+(e-t)*n,ae=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Eo=[we,lt,ft],Lo=t=>Eo.find(e=>e.test(t));function Nn(t){const e=Lo(t);if(!e)return!1;let n=e.parse(t);return e===ft&&(n=Do(n)),n}const Un=(t,e)=>{const n=Nn(t),s=Nn(e);if(!n||!s)return zt(t,e);const i={...n};return o=>(i.red=ae(n.red,s.red,o),i.green=ae(n.green,s.green,o),i.blue=ae(n.blue,s.blue,o),i.alpha=D(n.alpha,s.alpha,o),lt.transform(i))},Ce=new Set(["none","hidden"]);function Io(t,e){return Ce.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function ko(t,e){return n=>D(t,e,n)}function an(t){return typeof t=="number"?ko:typeof t=="string"?sn(t)?zt:L.test(t)?Un:Bo:Array.isArray(t)?bi:typeof t=="object"?L.test(t)?Un:Fo:zt}function bi(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>an(o)(o,e[r]));return o=>{for(let r=0;r<s;r++)n[r]=i[r](o);return n}}function Fo(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=an(t[i])(t[i],e[i]));return i=>{for(const o in s)n[o]=s[o](i);return n}}function Oo(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],r=t.indexes[o][s[o]],a=t.values[r]??0;n[i]=a,s[o]++}return n}const Bo=(t,e)=>{const n=st.createTransformer(e),s=Et(t),i=Et(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Ce.has(t)&&!i.values.length||Ce.has(e)&&!s.values.length?Io(t,e):kt(bi(Oo(s,i),i.values),n):zt(t,e)};function wi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?D(t,e,n):an(t)(t,e)}const jo=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>M.update(e,n),stop:()=>nt(e),now:()=>F.isProcessing?F.timestamp:B.now()}},Ci=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let o=0;o<i;o++)s+=Math.round(t(o/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Xt=2e4;function ln(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<Xt;)e+=n,s=t.next(e);return e>=Xt?1/0:e}function No(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(ln(s),Xt);return{type:"keyframes",ease:o=>s.next(i*o).value/e,duration:K(i)}}const Uo=5;function Ai(t,e,n){const s=Math.max(e-Uo,0);return ii(n-t(s),e-s)}const E={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},le=.001;function Wo({duration:t=E.duration,bounce:e=E.bounce,velocity:n=E.velocity,mass:s=E.mass}){let i,o,r=1-e;r=Y(E.minDamping,E.maxDamping,r),t=Y(E.minDuration,E.maxDuration,K(t)),r<1?(i=u=>{const c=u*r,h=c*t,f=c-n,d=Ae(u,r),p=Math.exp(-h);return le-f/d*p},o=u=>{const h=u*r*t,f=h*n+n,d=Math.pow(r,2)*Math.pow(u,2)*t,p=Math.exp(-h),m=Ae(Math.pow(u,2),r);return(-i(u)+le>0?-1:1)*((f-d)*p)/m}):(i=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-le+c*h},o=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const a=5/t,l=_o(i,o,a);if(t=q(t),isNaN(l))return{stiffness:E.stiffness,damping:E.damping,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:r*2*Math.sqrt(s*u),duration:t}}}const Ko=12;function _o(t,e,n){let s=n;for(let i=1;i<Ko;i++)s=s-t(s)/e(s);return s}function Ae(t,e){return t*Math.sqrt(1-e*e)}const $o=["duration","bounce"],Ho=["stiffness","damping","mass"];function Wn(t,e){return e.some(n=>t[n]!==void 0)}function Go(t){let e={velocity:E.velocity,stiffness:E.stiffness,damping:E.damping,mass:E.mass,isResolvedFromDuration:!1,...t};if(!Wn(t,Ho)&&Wn(t,$o))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,o=2*Y(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:E.mass,stiffness:i,damping:o}}else{const n=Wo(t);e={...e,...n,mass:E.mass},e.isResolvedFromDuration=!0}return e}function Yt(t=E.visualDuration,e=E.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:u,mass:c,duration:h,velocity:f,isResolvedFromDuration:d}=Go({...n,velocity:-K(n.velocity||0)}),p=f||0,m=u/(2*Math.sqrt(l*c)),v=r-o,T=K(Math.sqrt(l/c)),S=Math.abs(v)<5;s||(s=S?E.restSpeed.granular:E.restSpeed.default),i||(i=S?E.restDelta.granular:E.restDelta.default);let g;if(m<1){const b=Ae(T,m);g=A=>{const V=Math.exp(-m*T*A);return r-V*((p+m*T*v)/b*Math.sin(b*A)+v*Math.cos(b*A))}}else if(m===1)g=b=>r-Math.exp(-T*b)*(v+(p+T*v)*b);else{const b=T*Math.sqrt(m*m-1);g=A=>{const V=Math.exp(-m*T*A),P=Math.min(b*A,300);return r-V*((p+m*T*v)*Math.sinh(P)+b*v*Math.cosh(P))/b}}const w={calculatedDuration:d&&h||null,next:b=>{const A=g(b);if(d)a.done=b>=h;else{let V=b===0?p:0;m<1&&(V=b===0?q(p):Ai(g,b,A));const P=Math.abs(V)<=s,C=Math.abs(r-A)<=i;a.done=P&&C}return a.value=a.done?r:A,a},toString:()=>{const b=Math.min(ln(w),Xt),A=Ci(V=>w.next(b*V).value,b,30);return b+"ms "+A},toTransition:()=>{}};return w}Yt.applyToOptions=t=>{const e=No(t,100,Yt);return t.ease=e.ease,t.duration=q(e.duration),t.type="keyframes",t};function Ve({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],f={done:!1,value:h},d=P=>a!==void 0&&P<a||l!==void 0&&P>l,p=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let m=n*e;const v=h+m,T=r===void 0?v:r(v);T!==v&&(m=T-h);const S=P=>-m*Math.exp(-P/s),g=P=>T+S(P),w=P=>{const C=S(P),R=g(P);f.done=Math.abs(C)<=u,f.value=f.done?T:R};let b,A;const V=P=>{d(f.value)&&(b=P,A=Yt({keyframes:[f.value,p(f.value)],velocity:Ai(g,P,f.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return V(0),{calculatedDuration:null,next:P=>{let C=!1;return!A&&b===void 0&&(C=!0,w(P),V(P)),b!==void 0&&P>=b?A.next(P-b):(!C&&w(P),f)}}}function zo(t,e,n){const s=[],i=n||Z.mix||wi,o=t.length-1;for(let r=0;r<o;r++){let a=i(t[r],t[r+1]);if(e){const l=Array.isArray(e)?e[r]||_:e;a=kt(l,a)}s.push(a)}return s}function Xo(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(Ze(o===e.length),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=zo(e,s,i),l=a.length,u=c=>{if(r&&c<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(c<t[h+1]);h++);const f=Rt(t[h],t[h+1],c);return a[h](f)};return n?c=>u(Y(t[0],t[o-1],c)):u}function Yo(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Rt(0,e,s);t.push(D(n,1,i))}}function Qo(t){const e=[0];return Yo(e,t.length-1),e}function qo(t,e){return t.map(n=>n*e)}function Zo(t,e){return t.map(()=>e||di).splice(0,t.length-1)}function At({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=lo(s)?s.map(Fn):Fn(s),o={done:!1,value:e[0]},r=qo(n&&n.length===e.length?n:Qo(e),t),a=Xo(r,e,{ease:Array.isArray(i)?i:Zo(e,i)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const Jo=t=>t!==null;function cn(t,{repeat:e,repeatType:n="loop"},s,i=1){const o=t.filter(Jo),a=i<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!a||s===void 0?o[a]:s}const ta={decay:Ve,inertia:Ve,tween:At,keyframes:At,spring:Yt};function Vi(t){typeof t.type=="string"&&(t.type=ta[t.type])}class un{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const ea=t=>t/100;class hn extends un{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==B.now()&&this.tick(B.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Vi(e);const{type:n=At,repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=e;let{keyframes:a}=e;const l=n||At;l!==At&&typeof a[0]!="number"&&(this.mixKeyframes=kt(ea,wi(a[0],a[1])),a=[0,100]);const u=l({...e,keyframes:a});o==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-r})),u.calculatedDuration===null&&(u.calculatedDuration=ln(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:f,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const T=this.currentTime-u*(this.playbackSpeed>=0?1:-1),S=this.playbackSpeed>=0?T<0:T>i;this.currentTime=Math.max(T,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let g=this.currentTime,w=s;if(h){const P=Math.min(this.currentTime,i)/a;let C=Math.floor(P),R=P%1;!R&&P>=1&&(R=1),R===1&&C--,C=Math.min(C,h+1),C%2&&(f==="reverse"?(R=1-R,d&&(R-=d/a)):f==="mirror"&&(w=r)),g=Y(0,1,R)*a}const b=S?{done:!1,value:c[0]}:w.next(g);o&&(b.value=o(b.value));let{done:A}=b;!S&&l!==null&&(A=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const V=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return V&&p!==Ve&&(b.value=cn(c,this.options,v,this.speed)),m&&m(b.value),V&&this.finish(),b}then(e,n){return this.finished.then(e,n)}get duration(){return K(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+K(e)}get time(){return K(this.currentTime)}set time(e){e=q(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(B.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=K(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=jo,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(B.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function na(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ct=t=>t*180/Math.PI,Me=t=>{const e=ct(Math.atan2(t[1],t[0]));return Re(e)},sa={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Me,rotateZ:Me,skewX:t=>ct(Math.atan(t[1])),skewY:t=>ct(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Re=t=>(t=t%360,t<0&&(t+=360),t),Kn=Me,_n=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),$n=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),ia={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:_n,scaleY:$n,scale:t=>(_n(t)+$n(t))/2,rotateX:t=>Re(ct(Math.atan2(t[6],t[5]))),rotateY:t=>Re(ct(Math.atan2(-t[2],t[0]))),rotateZ:Kn,rotate:Kn,skewX:t=>ct(Math.atan(t[4])),skewY:t=>ct(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function De(t){return t.includes("scale")?1:0}function Ee(t,e){if(!t||t==="none")return De(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=ia,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=sa,i=a}if(!i)return De(e);const o=s[e],r=i[1].split(",").map(oa);return typeof o=="function"?o(r):r[o]}const ra=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ee(n,e)};function oa(t){return parseFloat(t.trim())}const Tt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xt=new Set(Tt),Hn=t=>t===vt||t===x,aa=new Set(["x","y","z"]),la=Tt.filter(t=>!aa.has(t));function ca(t){const e=[];return la.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const et={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Ee(e,"x"),y:(t,{transform:e})=>Ee(e,"y")};et.translateX=et.x;et.translateY=et.y;const ut=new Set;let Le=!1,Ie=!1,ke=!1;function Mi(){if(Ie){const t=Array.from(ut).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=ca(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([o,r])=>{s.getValue(o)?.set(r)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Ie=!1,Le=!1,ut.forEach(t=>t.complete(ke)),ut.clear()}function Ri(){ut.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ie=!0)})}function ua(){ke=!0,Ri(),Mi(),ke=!1}class fn{constructor(e,n,s,i,o,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(ut.add(this),Le||(Le=!0,M.read(Ri),M.resolveKeyframes(Mi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const o=i?.get(),r=e[e.length-1];if(o!==void 0)e[0]=o;else if(s&&n){const a=s.readValue(n,r);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=r),i&&o===void 0&&i.set(e[0])}na(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ut.delete(this)}cancel(){this.state==="scheduled"&&(ut.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const ha=t=>t.startsWith("--");function fa(t,e,n){ha(e)?t.style.setProperty(e,n):t.style[e]=n}const da=Je(()=>window.ScrollTimeline!==void 0),pa={};function ma(t,e){const n=Je(t);return()=>pa[e]??n()}const Di=ma(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Pt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Gn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Pt([0,.65,.55,1]),circOut:Pt([.55,0,1,.45]),backIn:Pt([.31,.01,.66,-.59]),backOut:Pt([.33,1.53,.69,.99])};function Ei(t,e){if(t)return typeof t=="function"?Di()?Ci(t,e):"ease-out":pi(t)?Pt(t):Array.isArray(t)?t.map(n=>Ei(n,e)||Gn.easeOut):Gn[t]}function ga(t,e,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=Ei(a,i);Array.isArray(h)&&(c.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(c,f)}function Li(t){return typeof t=="function"&&"applyToOptions"in t}function ya({type:t,...e}){return Li(t)&&Di()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class va extends un{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!o,this.allowFlatten=r,this.options=e,Ze(typeof e.type!="string");const u=ya(e);this.animation=ga(n,s,i,u,o),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const c=cn(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(c):fa(n,s,c),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return K(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+K(e)}get time(){return K(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=q(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&da()?(this.animation.timeline=e,_):n(this)}}const Ii={anticipate:ui,backInOut:ci,circInOut:fi};function Ta(t){return t in Ii}function xa(t){typeof t.ease=="string"&&Ta(t.ease)&&(t.ease=Ii[t.ease])}const ce=10;class Sa extends va{constructor(e){xa(e),Vi(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:o,...r}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new hn({...r,autoplay:!1}),l=Math.max(ce,B.now()-this.startTime),u=Y(0,ce,l-ce);n.setWithVelocity(a.sample(Math.max(0,l-u)).value,a.sample(l).value,u),a.stop()}}const zn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(st.test(t)||t==="0")&&!t.startsWith("url("));function Pa(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function ba(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],r=zn(i,e),a=zn(o,e);return!r||!a?!1:Pa(t)||(n==="spring"||Li(n))&&s}function Fe(t){t.duration=0,t.type="keyframes"}const wa=new Set(["opacity","clipPath","filter","transform"]),Ca=Je(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Aa(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:o,type:r}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return Ca()&&n&&wa.has(n)&&(n!=="transform"||!u)&&!l&&!s&&i!=="mirror"&&o!==0&&r!=="inertia"}const Va=40;class Ma extends un{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",keyframes:a,name:l,motionValue:u,element:c,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=B.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,name:l,motionValue:u,element:c,...h},d=c?.KeyframeResolver||fn;this.keyframeResolver=new d(a,(p,m,v)=>this.onKeyframesResolved(p,m,f,!v),l,u,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:l,isHandoff:u,onUpdate:c}=s;this.resolvedAt=B.now(),ba(e,o,r,a)||((Z.instantAnimations||!l)&&c?.(cn(e,s,n)),e[0]=e[e.length-1],Fe(s),s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Va?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!u&&Aa(f),p=f.motionValue?.owner?.current,m=d?new Sa({...f,element:p}):new hn(f);m.finished.then(()=>{this.notifyFinished()}).catch(_),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ua()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function ki(t,e,n,s=0,i=1){const o=Array.from(t).sort((u,c)=>u.sortNodePosition(c)).indexOf(e),r=t.size,a=(r-1)*s;return typeof n=="function"?n(o,r):i===1?o*s:a-o*s}const Ra=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Da(t){const e=Ra.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Fi(t,e,n=1){const[s,i]=Da(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return ei(r)?parseFloat(r):r}return sn(i)?Fi(i,e,n+1):i}const Ea={type:"spring",stiffness:500,damping:25,restSpeed:10},La=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Ia={type:"keyframes",duration:.8},ka={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fa=(t,{keyframes:e})=>e.length>2?Ia:xt.has(t)?t.startsWith("scale")?La(e[1]):Ea:ka,Oa=t=>t!==null;function Ba(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Oa),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[o]}function dn(t,e){return t?.[e]??t?.default??t}function ja({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const pn=(t,e,n,s={},i,o)=>r=>{const a=dn(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-q(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};ja(a)||Object.assign(c,Fa(t,c)),c.duration&&(c.duration=q(c.duration)),c.repeatDelay&&(c.repeatDelay=q(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Fe(c),c.delay===0&&(h=!0)),(Z.instantAnimations||Z.skipAnimations)&&(h=!0,Fe(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!o&&e.get()!==void 0){const f=Ba(c.keyframes,a);if(f!==void 0){M.update(()=>{c.onUpdate(f),c.onComplete()});return}}return a.isSync?new hn(c):new Ma(c)};function Xn(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function mn(t,e,n,s){if(typeof e=="function"){const[i,o]=Xn(s);e=e(n!==void 0?n:t.custom,i,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,o]=Xn(s);e=e(n!==void 0?n:t.custom,i,o)}return e}function gt(t,e,n){const s=t.getProps();return mn(s,e,n!==void 0?n:s.custom,t)}const Oi=new Set(["width","height","top","left","right","bottom",...Tt]),Yn=30,Na=t=>!isNaN(parseFloat(t));class Ua{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=B.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=B.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Na(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new tn);const s=this.events[e].add(n);return e==="change"?()=>{s(),M.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=B.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Yn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Yn);return ii(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function yt(t,e){return new Ua(t,e)}const Oe=t=>Array.isArray(t);function Wa(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,yt(n))}function Ka(t){return Oe(t)?t[t.length-1]||0:t}function _a(t,e){const n=gt(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=Ka(o[r]);Wa(t,r,a)}}const O=t=>!!(t&&t.getVelocity);function $a(t){return!!(O(t)&&t.add)}function Be(t,e){const n=t.getValue("willChange");if($a(n))return n.add(e);if(!n&&Z.WillChange){const s=new Z.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function gn(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Ha="framerAppearId",Bi="data-"+gn(Ha);function ji(t){return t.props[Bi]}function Ga({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Ni(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=e;const l=o?.reduceMotion;s&&(o=s);const u=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const h in a){const f=t.getValue(h,t.latestValues[h]??null),d=a[h];if(d===void 0||c&&Ga(c,h))continue;const p={delay:n,...dn(o||{},h)},m=f.get();if(m!==void 0&&!f.isAnimating&&!Array.isArray(d)&&d===m&&!p.velocity)continue;let v=!1;if(window.MotionHandoffAnimation){const g=ji(t);if(g){const w=window.MotionHandoffAnimation(g,h,M);w!==null&&(p.startTime=w,v=!0)}}Be(t,h);const T=l??t.shouldReduceMotion;f.start(pn(h,f,d,T&&Oi.has(h)?{type:!1}:p,t,v));const S=f.animation;S&&u.push(S)}return r&&Promise.all(u).then(()=>{M.update(()=>{r&&_a(t,r)})}),u}function je(t,e,n={}){const s=gt(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(Ni(t,s,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:h}=i;return za(t,e,l,u,c,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[l,u]=a==="beforeChildren"?[o,r]:[r,o];return l().then(()=>u())}else return Promise.all([o(),r(n.delay)])}function za(t,e,n=0,s=0,i=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(je(l,e,{...r,delay:n+(typeof s=="function"?0:s)+ki(t.variantChildren,l,s,i,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function Xa(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>je(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=je(t,e,n);else{const i=typeof e=="function"?gt(t,e,n.custom):e;s=Promise.all(Ni(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Ya={test:t=>t==="auto",parse:t=>t},Ui=t=>e=>e.test(t),Wi=[vt,x,X,tt,Po,So,Ya],Qn=t=>Wi.find(Ui(t));function Qa(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||si(t):!0}const qa=new Set(["brightness","contrast","saturate","opacity"]);function Za(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(rn)||[];if(!s)return t;const i=n.replace(s,"");let o=qa.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const Ja=/\b([a-z-]*)\(.*?\)/gu,Ne={...st,getAnimatableNone:t=>{const e=t.match(Ja);return e?e.map(Za).join(" "):t}},qn={...vt,transform:Math.round},tl={rotate:tt,rotateX:tt,rotateY:tt,rotateZ:tt,scale:Ut,scaleX:Ut,scaleY:Ut,scaleZ:Ut,skew:tt,skewX:tt,skewY:tt,distance:x,translateX:x,translateY:x,translateZ:x,x,y:x,z:x,perspective:x,transformPerspective:x,opacity:Dt,originX:Bn,originY:Bn,originZ:x},yn={borderWidth:x,borderTopWidth:x,borderRightWidth:x,borderBottomWidth:x,borderLeftWidth:x,borderRadius:x,borderTopLeftRadius:x,borderTopRightRadius:x,borderBottomRightRadius:x,borderBottomLeftRadius:x,width:x,maxWidth:x,height:x,maxHeight:x,top:x,right:x,bottom:x,left:x,inset:x,insetBlock:x,insetBlockStart:x,insetBlockEnd:x,insetInline:x,insetInlineStart:x,insetInlineEnd:x,padding:x,paddingTop:x,paddingRight:x,paddingBottom:x,paddingLeft:x,paddingBlock:x,paddingBlockStart:x,paddingBlockEnd:x,paddingInline:x,paddingInlineStart:x,paddingInlineEnd:x,margin:x,marginTop:x,marginRight:x,marginBottom:x,marginLeft:x,marginBlock:x,marginBlockStart:x,marginBlockEnd:x,marginInline:x,marginInlineStart:x,marginInlineEnd:x,fontSize:x,backgroundPositionX:x,backgroundPositionY:x,...tl,zIndex:qn,fillOpacity:Dt,strokeOpacity:Dt,numOctaves:qn},el={...yn,color:L,backgroundColor:L,outlineColor:L,fill:L,stroke:L,borderColor:L,borderTopColor:L,borderRightColor:L,borderBottomColor:L,borderLeftColor:L,filter:Ne,WebkitFilter:Ne},Ki=t=>el[t];function _i(t,e){let n=Ki(t);return n!==Ne&&(n=st),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const nl=new Set(["auto","none","0"]);function sl(t,e,n){let s=0,i;for(;s<t.length&&!i;){const o=t[s];typeof o=="string"&&!nl.has(o)&&Et(o).values.length&&(i=t[s]),s++}if(i&&n)for(const o of e)t[o]=_i(n,i)}class il extends fn{constructor(e,n,s,i,o){super(e,n,s,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let h=e[c];if(typeof h=="string"&&(h=h.trim(),sn(h))){const f=Fi(h,n.current);f!==void 0&&(e[c]=f),c===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Oi.has(s)||e.length!==2)return;const[i,o]=e,r=Qn(i),a=Qn(o),l=On(i),u=On(o);if(l!==u&&et[s]){this.needsMeasurement=!0;return}if(r!==a)if(Hn(r)&&Hn(a))for(let c=0;c<e.length;c++){const h=e[c];typeof h=="string"&&(e[c]=parseFloat(h))}else et[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||Qa(e[i]))&&s.push(i);s.length&&sl(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=et[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,r=s[o];s[o]=et[n](e.measureViewportBox(),window.getComputedStyle(e.current)),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{e.getValue(a).set(l)}),this.resolveNoneKeyframes()}}function rl(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const $i=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Ue(t){return ni(t)&&"offsetHeight"in t}const{schedule:vn}=mi(queueMicrotask,!1),H={x:!1,y:!1};function Hi(){return H.x||H.y}function ol(t){return t==="x"||t==="y"?H[t]?null:(H[t]=!0,()=>{H[t]=!1}):H.x||H.y?null:(H.x=H.y=!0,()=>{H.x=H.y=!1})}function Gi(t,e){const n=rl(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Zn(t){return!(t.pointerType==="touch"||Hi())}function al(t,e,n={}){const[s,i,o]=Gi(t,n),r=a=>{if(!Zn(a))return;const{target:l}=a,u=e(l,a);if(typeof u!="function"||!l)return;const c=h=>{Zn(h)&&(u(h),l.removeEventListener("pointerleave",c))};l.addEventListener("pointerleave",c,i)};return s.forEach(a=>{a.addEventListener("pointerenter",r,i)}),o}const zi=(t,e)=>e?t===e?!0:zi(t,e.parentElement):!1,Tn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,ll=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Xi(t){return ll.has(t.tagName)||t.isContentEditable===!0}const $t=new WeakSet;function Jn(t){return e=>{e.key==="Enter"&&t(e)}}function ue(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const cl=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Jn(()=>{if($t.has(n))return;ue(n,"down");const i=Jn(()=>{ue(n,"up")}),o=()=>ue(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function ts(t){return Tn(t)&&!Hi()}function ul(t,e,n={}){const[s,i,o]=Gi(t,n),r=a=>{const l=a.currentTarget;if(!ts(a))return;$t.add(l);const u=e(l,a),c=(d,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),$t.has(l)&&$t.delete(l),ts(d)&&typeof u=="function"&&u(d,{success:p})},h=d=>{c(d,l===window||l===document||n.useGlobalTarget||zi(l,d.target))},f=d=>{c(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",r,i),Ue(a)&&(a.addEventListener("focus",u=>cl(u,i)),!Xi(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function Yi(t){return ni(t)&&"ownerSVGElement"in t}function hl(t){return Yi(t)&&t.tagName==="svg"}const fl=[...Wi,L,st],dl=t=>fl.find(Ui(t)),es=()=>({translate:0,scale:1,origin:0,originPoint:0}),dt=()=>({x:es(),y:es()}),ns=()=>({min:0,max:0}),I=()=>({x:ns(),y:ns()}),We={current:null},Qi={current:!1},pl=typeof window<"u";function ml(){if(Qi.current=!0,!!pl)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>We.current=t.matches;t.addEventListener("change",e),e()}else We.current=!1}const gl=new WeakMap;function ee(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Lt(t){return typeof t=="string"||Array.isArray(t)}const xn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Sn=["initial",...xn];function ne(t){return ee(t.animate)||Sn.some(e=>Lt(t[e]))}function qi(t){return!!(ne(t)||t.variants)}function yl(t,e,n){for(const s in e){const i=e[s],o=n[s];if(O(i))t.addValue(s,i);else if(O(o))t.addValue(s,yt(i,{owner:t}));else if(o!==i)if(t.hasValue(s)){const r=t.getValue(s);r.liveStyle===!0?r.jump(i):r.hasAnimated||r.set(i)}else{const r=t.getStaticValue(s);t.addValue(s,yt(r!==void 0?r:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const ss=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Qt={};function Zi(t){Qt=t}function vl(){return Qt}class Tl{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=fn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=B.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,M.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=ne(n),this.isVariantNode=qi(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const d=h[f];l[f]!==void 0&&O(d)&&d.set(l[f])}}mount(e){this.current=e,gl.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Qi.current||ml(),this.shouldReduceMotion=We.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),nt(this.notifyUpdate),nt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=xt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",r=>{this.latestValues[e]=r,this.props.onUpdate&&M.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Qt){const n=Qt[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):I()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<ss.length;s++){const i=ss[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,r=e[o];r&&(this.propEventSubscriptions[i]=this.on(i,r))}this.prevMotionValues=yl(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=yt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(ei(s)||si(s))?s=parseFloat(s):!dl(s)&&st.test(n)&&(s=_i(e,n)),this.setBaseTarget(e,O(s)?s.get():s)),O(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=mn(this.props,n,this.presenceContext?.custom);o&&(s=o[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!O(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new tn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){vn.render(this.render)}}class Ji extends Tl{constructor(){super(...arguments),this.KeyframeResolver=il}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;O(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class it{constructor(e){this.isMounted=!1,this.node=e}update(){}}function tr({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function xl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Sl(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function he(t){return t===void 0||t===1}function Ke({scale:t,scaleX:e,scaleY:n}){return!he(t)||!he(e)||!he(n)}function at(t){return Ke(t)||er(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function er(t){return is(t.x)||is(t.y)}function is(t){return t&&t!=="0%"}function qt(t,e,n){const s=t-n,i=e*s;return n+i}function rs(t,e,n,s,i){return i!==void 0&&(t=qt(t,i,s)),qt(t,n,s)+e}function _e(t,e=0,n=1,s,i){t.min=rs(t.min,e,n,s,i),t.max=rs(t.max,e,n,s,i)}function nr(t,{x:e,y:n}){_e(t.x,e.translate,e.scale,e.originPoint),_e(t.y,n.translate,n.scale,n.originPoint)}const os=.999999999999,as=1.0000000000001;function Pl(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&mt(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,nr(t,r)),s&&at(o.latestValues)&&mt(t,o.latestValues))}e.x<as&&e.x>os&&(e.x=1),e.y<as&&e.y>os&&(e.y=1)}function pt(t,e){t.min=t.min+e,t.max=t.max+e}function ls(t,e,n,s,i=.5){const o=D(t.min,t.max,i);_e(t,e,n,o,s)}function mt(t,e){ls(t.x,e.x,e.scaleX,e.scale,e.originX),ls(t.y,e.y,e.scaleY,e.scale,e.originY)}function sr(t,e){return tr(Sl(t.getBoundingClientRect(),e))}function bl(t,e,n){const s=sr(t,n),{scroll:i}=e;return i&&(pt(s.x,i.offset.x),pt(s.y,i.offset.y)),s}const wl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Cl=Tt.length;function Al(t,e,n){let s="",i=!0;for(let o=0;o<Cl;o++){const r=Tt[o],a=t[r];if(a===void 0)continue;let l=!0;if(typeof a=="number")l=a===(r.startsWith("scale")?1:0);else{const u=parseFloat(a);l=r.startsWith("scale")?u===1:u===0}if(!l||n){const u=$i(a,yn[r]);if(!l){i=!1;const c=wl[r]||r;s+=`${c}(${u}) `}n&&(e[r]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function Pn(t,e,n){const{style:s,vars:i,transformOrigin:o}=t;let r=!1,a=!1;for(const l in e){const u=e[l];if(xt.has(l)){r=!0;continue}else if(yi(l)){i[l]=u;continue}else{const c=$i(u,yn[l]);l.startsWith("origin")?(a=!0,o[l]=c):s[l]=c}}if(e.transform||(r||n?s.transform=Al(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=o;s.transformOrigin=`${l} ${u} ${c}`}}function ir(t,{style:e,vars:n},s,i){const o=t.style;let r;for(r in e)o[r]=e[r];i?.applyProjectionStyles(o,s);for(r in n)o.setProperty(r,n[r])}function cs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const St={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(x.test(t))t=parseFloat(t);else return t;const n=cs(t,e.target.x),s=cs(t,e.target.y);return`${n}% ${s}%`}},Vl={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=st.parse(t);if(i.length>5)return s;const o=st.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=l;const u=D(a,l,.5);return typeof i[2+r]=="number"&&(i[2+r]/=u),typeof i[3+r]=="number"&&(i[3+r]/=u),o(i)}},$e={borderRadius:{...St,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:St,borderTopRightRadius:St,borderBottomLeftRadius:St,borderBottomRightRadius:St,boxShadow:Vl};function rr(t,{layout:e,layoutId:n}){return xt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!$e[t]||t==="opacity")}function bn(t,e,n){const s=t.style,i=e?.style,o={};if(!s)return o;for(const r in s)(O(s[r])||i&&O(i[r])||rr(r,t)||n?.getValue(r)?.liveStyle!==void 0)&&(o[r]=s[r]);return o}function Ml(t){return window.getComputedStyle(t)}class Rl extends Ji{constructor(){super(...arguments),this.type="html",this.renderInstance=ir}readValueFromInstance(e,n){if(xt.has(n))return this.projection?.isProjecting?De(n):ra(e,n);{const s=Ml(e),i=(yi(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return sr(e,n)}build(e,n,s){Pn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return bn(e,n,s)}}const Dl={offset:"stroke-dashoffset",array:"stroke-dasharray"},El={offset:"strokeDashoffset",array:"strokeDasharray"};function Ll(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?Dl:El;t[o.offset]=`${-s}`,t[o.array]=`${e} ${n}`}const Il=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function or(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:o=1,pathOffset:r=0,...a},l,u,c){if(Pn(t,a,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=c?.transformBox??"fill-box",delete h.transformBox);for(const d of Il)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&Ll(h,i,o,r,!1)}const ar=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),lr=t=>typeof t=="string"&&t.toLowerCase()==="svg";function kl(t,e,n,s){ir(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(ar.has(i)?i:gn(i),e.attrs[i])}function cr(t,e,n){const s=bn(t,e,n);for(const i in t)if(O(t[i])||O(e[i])){const o=Tt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}class Fl extends Ji{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=I}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(xt.has(n)){const s=Ki(n);return s&&s.default||0}return n=ar.has(n)?n:gn(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return cr(e,n,s)}build(e,n,s){or(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){kl(e,n,s,i)}mount(e){this.isSVGTag=lr(e.tagName),super.mount(e)}}const Ol=Sn.length;function ur(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?ur(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Ol;n++){const s=Sn[n],i=t.props[s];(Lt(i)||i===!1)&&(e[s]=i)}return e}function hr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const Bl=[...xn].reverse(),jl=xn.length;function Nl(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Xa(t,n,s)))}function Ul(t){let e=Nl(t),n=us(),s=!0;const i=l=>(u,c)=>{const h=gt(t,c,l==="exit"?t.presenceContext?.custom:void 0);if(h){const{transition:f,transitionEnd:d,...p}=h;u={...u,...p,...d}}return u};function o(l){e=l(t)}function r(l){const{props:u}=t,c=ur(t.parent)||{},h=[],f=new Set;let d={},p=1/0;for(let v=0;v<jl;v++){const T=Bl[v],S=n[T],g=u[T]!==void 0?u[T]:c[T],w=Lt(g),b=T===l?S.isActive:null;b===!1&&(p=v);let A=g===c[T]&&g!==u[T]&&w;if(A&&s&&t.manuallyAnimateOnMount&&(A=!1),S.protectedKeys={...d},!S.isActive&&b===null||!g&&!S.prevProp||ee(g)||typeof g=="boolean")continue;const V=Wl(S.prevProp,g);let P=V||T===l&&S.isActive&&!A&&w||v>p&&w,C=!1;const R=Array.isArray(g)?g:[g];let N=R.reduce(i(T),{});b===!1&&(N={});const{prevResolvedValues:z={}}=S,J={...z,...N},Vn=k=>{P=!0,f.has(k)&&(C=!0,f.delete(k)),S.needsAnimating[k]=!0;const U=t.getValue(k);U&&(U.liveStyle=!1)};for(const k in J){const U=N[k],rt=z[k];if(d.hasOwnProperty(k))continue;let ht=!1;Oe(U)&&Oe(rt)?ht=!hr(U,rt):ht=U!==rt,ht?U!=null?Vn(k):f.add(k):U!==void 0&&f.has(k)?Vn(k):S.protectedKeys[k]=!0}S.prevProp=g,S.prevResolvedValues=N,S.isActive&&(d={...d,...N}),s&&t.blockInitialAnimation&&(P=!1);const Mn=A&&V;P&&(!Mn||C)&&h.push(...R.map(k=>{const U={type:T};if(typeof k=="string"&&s&&!Mn&&t.manuallyAnimateOnMount&&t.parent){const{parent:rt}=t,ht=gt(rt,k);if(rt.enteringChildren&&ht){const{delayChildren:Or}=ht.transition||{};U.delay=ki(rt.enteringChildren,t,Or)}}return{animation:k,options:U}}))}if(f.size){const v={};if(typeof u.initial!="boolean"){const T=gt(t,Array.isArray(u.initial)?u.initial[0]:u.initial);T&&T.transition&&(v.transition=T.transition)}f.forEach(T=>{const S=t.getBaseTarget(T),g=t.getValue(T);g&&(g.liveStyle=!0),v[T]=S??null}),h.push({animation:v})}let m=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(m=!1),s=!1,m?e(h):Promise.resolve()}function a(l,u){if(n[l].isActive===u)return Promise.resolve();t.variantChildren?.forEach(h=>h.animationState?.setActive(l,u)),n[l].isActive=u;const c=r(l);for(const h in n)n[h].protectedKeys={};return c}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=us()}}}function Wl(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!hr(e,t):!1}function ot(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function us(){return{animate:ot(!0),whileInView:ot(),whileHover:ot(),whileTap:ot(),whileDrag:ot(),whileFocus:ot(),exit:ot()}}function hs(t,e){t.min=e.min,t.max=e.max}function $(t,e){hs(t.x,e.x),hs(t.y,e.y)}function fs(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const fr=1e-4,Kl=1-fr,_l=1+fr,dr=.01,$l=0-dr,Hl=0+dr;function j(t){return t.max-t.min}function Gl(t,e,n){return Math.abs(t-e)<=n}function ds(t,e,n,s=.5){t.origin=s,t.originPoint=D(e.min,e.max,t.origin),t.scale=j(n)/j(e),t.translate=D(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Kl&&t.scale<=_l||isNaN(t.scale))&&(t.scale=1),(t.translate>=$l&&t.translate<=Hl||isNaN(t.translate))&&(t.translate=0)}function Vt(t,e,n,s){ds(t.x,e.x,n.x,s?s.originX:void 0),ds(t.y,e.y,n.y,s?s.originY:void 0)}function ps(t,e,n){t.min=n.min+e.min,t.max=t.min+j(e)}function zl(t,e,n){ps(t.x,e.x,n.x),ps(t.y,e.y,n.y)}function ms(t,e,n){t.min=e.min-n.min,t.max=t.min+j(e)}function Zt(t,e,n){ms(t.x,e.x,n.x),ms(t.y,e.y,n.y)}function gs(t,e,n,s,i){return t-=e,t=qt(t,1/n,s),i!==void 0&&(t=qt(t,1/i,s)),t}function Xl(t,e=0,n=1,s=.5,i,o=t,r=t){if(X.test(e)&&(e=parseFloat(e),e=D(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=D(o.min,o.max,s);t===o&&(a-=e),t.min=gs(t.min,e,n,a,i),t.max=gs(t.max,e,n,a,i)}function ys(t,e,[n,s,i],o,r){Xl(t,e[n],e[s],e[i],e.scale,o,r)}const Yl=["x","scaleX","originX"],Ql=["y","scaleY","originY"];function vs(t,e,n,s){ys(t.x,e,Yl,n?n.x:void 0,s?s.x:void 0),ys(t.y,e,Ql,n?n.y:void 0,s?s.y:void 0)}function Ts(t){return t.translate===0&&t.scale===1}function pr(t){return Ts(t.x)&&Ts(t.y)}function xs(t,e){return t.min===e.min&&t.max===e.max}function ql(t,e){return xs(t.x,e.x)&&xs(t.y,e.y)}function Ss(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function mr(t,e){return Ss(t.x,e.x)&&Ss(t.y,e.y)}function Ps(t){return j(t.x)/j(t.y)}function bs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function W(t){return[t("x"),t("y")]}function Zl(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((i||o||r)&&(s=`translate3d(${i}px, ${o}px, ${r}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:f,skewX:d,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),p&&(s+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const gr=["TopLeft","TopRight","BottomLeft","BottomRight"],Jl=gr.length,ws=t=>typeof t=="string"?parseFloat(t):t,Cs=t=>typeof t=="number"||x.test(t);function tc(t,e,n,s,i,o){i?(t.opacity=D(0,n.opacity??1,ec(s)),t.opacityExit=D(e.opacity??1,0,nc(s))):o&&(t.opacity=D(e.opacity??1,n.opacity??1,s));for(let r=0;r<Jl;r++){const a=`border${gr[r]}Radius`;let l=As(e,a),u=As(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Cs(l)===Cs(u)?(t[a]=Math.max(D(ws(l),ws(u),s),0),(X.test(u)||X.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=D(e.rotate||0,n.rotate||0,s))}function As(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const ec=yr(0,.5,hi),nc=yr(.5,.95,_);function yr(t,e,n){return s=>s<t?0:s>e?1:n(Rt(t,e,s))}function sc(t,e,n){const s=O(t)?t:yt(t);return s.start(pn("",s,e,n)),s.animation}function It(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const ic=(t,e)=>t.depth-e.depth;class rc{constructor(){this.children=[],this.isDirty=!1}add(e){Qe(this.children,e),this.isDirty=!0}remove(e){qe(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ic),this.isDirty=!1,this.children.forEach(e)}}function oc(t,e){const n=B.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(nt(s),t(o-e))};return M.setup(s,!0),()=>nt(s)}function Ht(t){return O(t)?t.get():t}class ac{constructor(){this.members=[]}add(e){Qe(this.members,e),e.scheduleRender()}remove(e){if(qe(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){s=o;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender();const i=s.options.layoutDependency,o=e.options.layoutDependency;i!==void 0&&o!==void 0&&i===o||(e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0));const{crossfade:a}=e.options;a===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Gt={hasAnimatedSinceResize:!0,hasEverUpdated:!1},fe=["","X","Y","Z"],lc=1e3;let cc=0;function de(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function vr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=ji(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",M,!(i||o))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&vr(s)}function Tr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e?.()){this.id=cc++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(fc),this.nodes.forEach(gc),this.nodes.forEach(yc),this.nodes.forEach(dc)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new rc)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new tn),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const l=this.eventHandlers.get(r);l&&l.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r){if(this.instance)return;this.isSVG=Yi(r)&&!hl(r),this.instance=r;const{layoutId:a,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let c,h=0;const f=()=>this.root.updateBlockedByResize=!1;M.read(()=>{h=window.innerWidth}),t(r,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,c&&c(),c=oc(f,250),Gt.hasAnimatedSinceResize&&(Gt.hasAnimatedSinceResize=!1,this.nodes.forEach(Rs)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||Pc,{onLayoutAnimationStart:m,onLayoutAnimationComplete:v}=u.getProps(),T=!this.targetLayout||!mr(this.targetLayout,d),S=!h&&f;if(this.options.layoutRoot||this.resumeFrom||S||h&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const g={...dn(p,"layout"),onPlay:m,onComplete:v};(u.shouldReduceMotion||this.options.layoutRoot)&&(g.delay=0,g.type=!1),this.startAnimation(g),this.setAnimationOrigin(c,S)}else h||Rs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),nt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(vc),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&vr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Vs);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ms);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(mc),this.nodes.forEach(uc),this.nodes.forEach(hc)):this.nodes.forEach(Ms),this.clearAllSnapshots();const a=B.now();F.delta=Y(0,1e3/60,a-F.timestamp),F.timestamp=a,F.isProcessing=!0,ie.update.process(F),ie.preRender.process(F),ie.render.process(F),F.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,vn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(pc),this.sharedNodes.forEach(Tc)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,M.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){M.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!j(this.snapshot.measuredBox.x)&&!j(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const r=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=I(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!pr(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;r&&this.instance&&(a||at(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return r&&(l=this.removeTransform(l)),bc(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:r}=this.options;if(!r)return I();const a=r.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(wc))){const{scroll:u}=this.root;u&&(pt(a.x,u.offset.x),pt(a.y,u.offset.y))}return a}removeElementScroll(r){const a=I();if($(a,r),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:c,options:h}=u;u!==this.root&&c&&h.layoutScroll&&(c.wasRoot&&$(a,r),pt(a.x,c.offset.x),pt(a.y,c.offset.y))}return a}applyTransform(r,a=!1){const l=I();$(l,r);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&mt(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),at(c.latestValues)&&mt(l,c.latestValues)}return at(this.latestValues)&&mt(l,this.latestValues),l}removeTransform(r){const a=I();$(a,r);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!at(u.latestValues))continue;Ke(u.latestValues)&&u.updateSnapshot();const c=I(),h=u.measurePageBox();$(c,h),vs(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return at(this.latestValues)&&vs(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==F.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(r||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!this.layout||!(c||h))return;this.resolvedRelativeTargetAt=F.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=I(),this.targetWithTransforms=I()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zl(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):$(this.target,this.layout.layoutBox),nr(this.target,this.targetDelta)):$(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Ke(this.parent.latestValues)||er(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(r,a,l){this.relativeParent=r,this.linkedParentVersion=r.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=I(),this.relativeTargetOrigin=I(),Zt(this.relativeTargetOrigin,a,l),$(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const r=this.getLead(),a=!!this.resumingFrom||this!==r;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===F.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;$(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;Pl(this.layoutCorrected,this.treeScale,this.path,a),r.layout&&!r.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(r.target=r.layout.layoutBox,r.targetWithTransforms=I());const{target:d}=r;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(fs(this.prevProjectionDelta.x,this.projectionDelta.x),fs(this.prevProjectionDelta.y,this.projectionDelta.y)),Vt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!bs(this.projectionDelta.x,this.prevProjectionDelta.x)||!bs(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){if(this.options.visualElement?.scheduleRender(),r){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=dt(),this.projectionDelta=dt(),this.projectionDeltaWithTransform=dt()}setAnimationOrigin(r,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=dt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=I(),d=l?l.source:void 0,p=this.layout?this.layout.source:void 0,m=d!==p,v=this.getStack(),T=!v||v.members.length<=1,S=!!(m&&!T&&this.options.crossfade===!0&&!this.path.some(Sc));this.animationProgress=0;let g;this.mixTargetDelta=w=>{const b=w/1e3;Ds(h.x,r.x,b),Ds(h.y,r.y,b),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Zt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),xc(this.relativeTarget,this.relativeTargetOrigin,f,b),g&&ql(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=I()),$(g,this.relativeTarget)),m&&(this.animationValues=c,tc(c,u,this.latestValues,b,S,T)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(nt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=M.update(()=>{Gt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=yt(0)),this.currentAnimation=sc(this.motionValue,[0,1e3],{...r,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),r.onUpdate&&r.onUpdate(a)},onStop:()=>{},onComplete:()=>{r.onComplete&&r.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(lc),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=r;if(!(!a||!l||!u)){if(this!==r&&this.layout&&u&&xr(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||I();const h=j(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+h;const f=j(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+f}$(a,l),mt(a,c),Vt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new ac),this.sharedNodes.get(r).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){const{layoutId:r}=this.options;return r?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:r}=this.options;return r?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&de("z",r,u,this.animationValues);for(let c=0;c<fe.length;c++)de(`rotate${fe[c]}`,r,u,this.animationValues),de(`skew${fe[c]}`,r,u,this.animationValues);r.render();for(const c in u)r.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);r.scheduleRender()}applyProjectionStyles(r,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){r.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,r.visibility="",r.opacity="",r.pointerEvents=Ht(a?.pointerEvents)||"",r.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(r.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,r.pointerEvents=Ht(a?.pointerEvents)||""),this.hasProjected&&!at(this.latestValues)&&(r.transform=l?l({},""):"none",this.hasProjected=!1);return}r.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=Zl(this.projectionDeltaWithTransform,this.treeScale,c);l&&(h=l(c,h)),r.transform=h;const{x:f,y:d}=this.projectionDelta;r.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,u.animationValues?r.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:r.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const p in $e){if(c[p]===void 0)continue;const{correct:m,applyTo:v,isCSSVariable:T}=$e[p],S=h==="none"?c[p]:m(c[p],u);if(v){const g=v.length;for(let w=0;w<g;w++)r[v[w]]=S}else T?this.options.visualElement.renderState.vars[p]=S:r[p]=S}this.options.layoutId&&(r.pointerEvents=u===this?Ht(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>r.currentAnimation?.stop()),this.root.nodes.forEach(Vs),this.root.sharedNodes.clear()}}}function uc(t){t.updateLayout()}function hc(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,o=e.source!==t.layout.source;i==="size"?W(c=>{const h=o?e.measuredBox[c]:e.layoutBox[c],f=j(h);h.min=n[c].min,h.max=h.min+f}):xr(i,e.layoutBox,n)&&W(c=>{const h=o?e.measuredBox[c]:e.layoutBox[c],f=j(n[c]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[c].max=t.relativeTarget[c].min+f)});const r=dt();Vt(r,n,e.layoutBox);const a=dt();o?Vt(a,t.applyTransform(s,!0),e.measuredBox):Vt(a,n,e.layoutBox);const l=!pr(r);let u=!1;if(!t.resumeFrom){const c=t.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:h,layout:f}=c;if(h&&f){const d=I();Zt(d,e.layoutBox,h.layoutBox);const p=I();Zt(p,n,f.layoutBox),mr(d,p)||(u=!0),c.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=d,t.relativeParent=c)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function fc(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function dc(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function pc(t){t.clearSnapshot()}function Vs(t){t.clearMeasurements()}function Ms(t){t.isLayoutDirty=!1}function mc(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Rs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function gc(t){t.resolveTargetDelta()}function yc(t){t.calcProjection()}function vc(t){t.resetSkewAndRotation()}function Tc(t){t.removeLeadSnapshot()}function Ds(t,e,n){t.translate=D(e.translate,0,n),t.scale=D(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Es(t,e,n,s){t.min=D(e.min,n.min,s),t.max=D(e.max,n.max,s)}function xc(t,e,n,s){Es(t.x,e.x,n.x,s),Es(t.y,e.y,n.y,s)}function Sc(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Pc={duration:.45,ease:[.4,0,.1,1]},Ls=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Is=Ls("applewebkit/")&&!Ls("chrome/")?Math.round:_;function ks(t){t.min=Is(t.min),t.max=Is(t.max)}function bc(t){ks(t.x),ks(t.y)}function xr(t,e,n){return t==="position"||t==="preserve-aspect"&&!Gl(Ps(e),Ps(n),.2)}function wc(t){return t!==t.root&&t.scroll?.wasRoot}const Cc=Tr({attachResizeListener:(t,e)=>It(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),pe={current:void 0},Sr=Tr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!pe.current){const t=new Cc({});t.mount(window),t.setOptions({layoutScroll:!0}),pe.current=t}return pe.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),wn=y.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Fs(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Ac(...t){return e=>{let n=!1;const s=t.map(i=>{const o=Fs(i,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<s.length;i++){const o=s[i];typeof o=="function"?o():Fs(t[i],null)}}}}function Vc(...t){return y.useCallback(Ac(...t),t)}class Mc extends y.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=n.offsetParent,i=Ue(s)&&s.offsetWidth||0,o=Ue(s)&&s.offsetHeight||0,r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft,r.right=i-r.width-r.left,r.bottom=o-r.height-r.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Rc({children:t,isPresent:e,anchorX:n,anchorY:s,root:i}){const o=y.useId(),r=y.useRef(null),a=y.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:l}=y.useContext(wn),u=t.props?.ref??t?.ref,c=Vc(r,u);return y.useInsertionEffect(()=>{const{width:h,height:f,top:d,left:p,right:m,bottom:v}=a.current;if(e||!r.current||!h||!f)return;const T=n==="left"?`left: ${p}`:`right: ${m}`,S=s==="bottom"?`bottom: ${v}`:`top: ${d}`;r.current.dataset.motionPopId=o;const g=document.createElement("style");l&&(g.nonce=l);const w=i??document.head;return w.appendChild(g),g.sheet&&g.sheet.insertRule(`
|
|
2
|
+
[data-motion-pop-id="${o}"] {
|
|
3
|
+
position: absolute !important;
|
|
4
|
+
width: ${h}px !important;
|
|
5
|
+
height: ${f}px !important;
|
|
6
|
+
${T}px !important;
|
|
7
|
+
${S}px !important;
|
|
8
|
+
}
|
|
9
|
+
`),()=>{w.contains(g)&&w.removeChild(g)}},[e]),Q.jsx(Mc,{isPresent:e,childRef:r,sizeRef:a,children:y.cloneElement(t,{ref:c})})}const Dc=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:o,mode:r,anchorX:a,anchorY:l,root:u})=>{const c=Ye(Ec),h=y.useId();let f=!0,d=y.useMemo(()=>(f=!1,{id:h,initial:e,isPresent:n,custom:i,onExitComplete:p=>{c.set(p,!0);for(const m of c.values())if(!m)return;s&&s()},register:p=>(c.set(p,!1),()=>c.delete(p))}),[n,c,s]);return o&&f&&(d={...d}),y.useMemo(()=>{c.forEach((p,m)=>c.set(m,!1))},[n]),y.useEffect(()=>{!n&&!c.size&&s&&s()},[n]),r==="popLayout"&&(t=Q.jsx(Rc,{isPresent:n,anchorX:a,anchorY:l,root:u,children:t})),Q.jsx(te.Provider,{value:d,children:t})};function Ec(){return new Map}function Pr(t=!0){const e=y.useContext(te);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,o=y.useId();y.useEffect(()=>{if(t)return i(o)},[t]);const r=y.useCallback(()=>t&&s&&s(o),[o,s,t]);return!n&&s?[!1,r]:[!0]}const Wt=t=>t.key||"";function Os(t){const e=[];return y.Children.forEach(t,n=>{y.isValidElement(n)&&e.push(n)}),e}const Ku=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:o="sync",propagate:r=!1,anchorX:a="left",anchorY:l="top",root:u})=>{const[c,h]=Pr(r),f=y.useMemo(()=>Os(t),[t]),d=r&&!c?[]:f.map(Wt),p=y.useRef(!0),m=y.useRef(f),v=Ye(()=>new Map),T=y.useRef(new Set),[S,g]=y.useState(f),[w,b]=y.useState(f);ti(()=>{p.current=!1,m.current=f;for(let P=0;P<w.length;P++){const C=Wt(w[P]);d.includes(C)?(v.delete(C),T.current.delete(C)):v.get(C)!==!0&&v.set(C,!1)}},[w,d.length,d.join("-")]);const A=[];if(f!==S){let P=[...f];for(let C=0;C<w.length;C++){const R=w[C],N=Wt(R);d.includes(N)||(P.splice(C,0,R),A.push(R))}return o==="wait"&&A.length&&(P=A),b(Os(P)),g(f),null}const{forceRender:V}=y.useContext(Xe);return Q.jsx(Q.Fragment,{children:w.map(P=>{const C=Wt(P),R=r&&!c?!1:f===w||d.includes(C),N=()=>{if(T.current.has(C))return;if(T.current.add(C),v.has(C))v.set(C,!0);else return;let z=!0;v.forEach(J=>{J||(z=!1)}),z&&(V?.(),b(m.current),r&&h?.(),s&&s())};return Q.jsx(Dc,{isPresent:R,initial:!p.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:o,root:u,onExitComplete:R?void 0:N,anchorX:a,anchorY:l,children:P},C)})})},br=y.createContext({strict:!1}),Bs={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let js=!1;function Lc(){if(js)return;const t={};for(const e in Bs)t[e]={isEnabled:n=>Bs[e].some(s=>!!n[s])};Zi(t),js=!0}function wr(){return Lc(),vl()}function Ic(t){const e=wr();for(const n in t)e[n]={...e[n],...t[n]};Zi(e)}const kc=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Jt(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||kc.has(t)}let Cr=t=>!Jt(t);function Fc(t){typeof t=="function"&&(Cr=e=>e.startsWith("on")?!Jt(e):t(e))}try{Fc(require("@emotion/is-prop-valid").default)}catch{}function Oc(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(Cr(i)||n===!0&&Jt(i)||!e&&!Jt(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const se=y.createContext({});function Bc(t,e){if(ne(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Lt(n)?n:void 0,animate:Lt(s)?s:void 0}}return t.inherit!==!1?e:{}}function jc(t){const{initial:e,animate:n}=Bc(t,y.useContext(se));return y.useMemo(()=>({initial:e,animate:n}),[Ns(e),Ns(n)])}function Ns(t){return Array.isArray(t)?t.join(" "):t}const Cn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ar(t,e,n){for(const s in e)!O(e[s])&&!rr(s,n)&&(t[s]=e[s])}function Nc({transformTemplate:t},e){return y.useMemo(()=>{const n=Cn();return Pn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Uc(t,e){const n=t.style||{},s={};return Ar(s,n,t),Object.assign(s,Nc(t,e)),s}function Wc(t,e){const n={},s=Uc(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const Vr=()=>({...Cn(),attrs:{}});function Kc(t,e,n,s){const i=y.useMemo(()=>{const o=Vr();return or(o,e,lr(s),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};Ar(o,t.style,t),i.style={...o,...i.style}}return i}const _c=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function An(t){return typeof t!="string"||t.includes("-")?!1:!!(_c.indexOf(t)>-1||/[A-Z]/u.test(t))}function $c(t,e,n,{latestValues:s},i,o=!1,r){const l=(r??An(t)?Kc:Wc)(e,s,i,t),u=Oc(e,typeof t=="string",o),c=t!==y.Fragment?{...u,...l,ref:n}:{},{children:h}=e,f=y.useMemo(()=>O(h)?h.get():h,[h]);return y.createElement(t,{...c,children:f})}function Hc({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:Gc(n,s,i,t),renderState:e()}}function Gc(t,e,n,s){const i={},o=s(t,{});for(const f in o)i[f]=Ht(o[f]);let{initial:r,animate:a}=t;const l=ne(t),u=qi(t);e&&u&&!l&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||r===!1;const h=c?a:r;if(h&&typeof h!="boolean"&&!ee(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const p=mn(t,f[d]);if(p){const{transitionEnd:m,transition:v,...T}=p;for(const S in T){let g=T[S];if(Array.isArray(g)){const w=c?g.length-1:0;g=g[w]}g!==null&&(i[S]=g)}for(const S in m)i[S]=m[S]}}}return i}const Mr=t=>(e,n)=>{const s=y.useContext(se),i=y.useContext(te),o=()=>Hc(t,e,s,i);return n?o():Ye(o)},zc=Mr({scrapeMotionValuesFromProps:bn,createRenderState:Cn}),Xc=Mr({scrapeMotionValuesFromProps:cr,createRenderState:Vr}),Yc=Symbol.for("motionComponentSymbol");function Qc(t,e,n){const s=y.useRef(n);y.useInsertionEffect(()=>{s.current=n});const i=y.useRef(null);return y.useCallback(o=>{o&&t.onMount?.(o),e&&(o?e.mount(o):e.unmount());const r=s.current;if(typeof r=="function")if(o){const a=r(o);typeof a=="function"&&(i.current=a)}else i.current?(i.current(),i.current=null):r(o);else r&&(r.current=o)},[e])}const Rr=y.createContext({});function bt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function qc(t,e,n,s,i,o){const{visualElement:r}=y.useContext(se),a=y.useContext(br),l=y.useContext(te),u=y.useContext(wn).reducedMotion,c=y.useRef(null),h=y.useRef(!1);s=s||a.renderer,!c.current&&s&&(c.current=s(t,{visualState:e,parent:r,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,isSVG:o}),h.current&&c.current&&(c.current.manuallyAnimateOnMount=!0));const f=c.current,d=y.useContext(Rr);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&Zc(c.current,n,i,d);const p=y.useRef(!1);y.useInsertionEffect(()=>{f&&p.current&&f.update(n,l)});const m=n[Bi],v=y.useRef(!!m&&!window.MotionHandoffIsComplete?.(m)&&window.MotionHasOptimisedAnimation?.(m));return ti(()=>{h.current=!0,f&&(p.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),v.current&&f.animationState&&f.animationState.animateChanges())}),y.useEffect(()=>{f&&(!v.current&&f.animationState&&f.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(m)}),v.current=!1),f.enteringChildren=void 0)}),f}function Zc(t,e,n,s){const{layoutId:i,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Dr(t.parent)),t.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!r||a&&bt(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,crossfade:c,layoutScroll:l,layoutRoot:u})}function Dr(t){if(t)return t.options.allowProjection!==!1?t.projection:Dr(t.parent)}function me(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&Ic(s);const o=n?n==="svg":An(t),r=o?Xc:zc;function a(u,c){let h;const f={...y.useContext(wn),...u,layoutId:Jc(u)},{isStatic:d}=f,p=jc(u),m=r(u,d);if(!d&&Js){tu();const v=eu(f);h=v.MeasureLayout,p.visualElement=qc(t,m,f,i,v.ProjectionNode,o)}return Q.jsxs(se.Provider,{value:p,children:[h&&p.visualElement?Q.jsx(h,{visualElement:p.visualElement,...f}):null,$c(t,u,Qc(m,p.visualElement,c),m,d,e,o)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=y.forwardRef(a);return l[Yc]=t,l}function Jc({layoutId:t}){const e=y.useContext(Xe).id;return e&&t!==void 0?e+"-"+t:t}function tu(t,e){y.useContext(br).strict}function eu(t){const e=wr(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n?.isEnabled(t)||s?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function nu(t,e){if(typeof Proxy>"u")return me;const n=new Map,s=(o,r)=>me(o,r,t,e),i=(o,r)=>s(o,r);return new Proxy(i,{get:(o,r)=>r==="create"?s:(n.has(r)||n.set(r,me(r,void 0,t,e)),n.get(r))})}const su=(t,e)=>e.isSVG??An(t)?new Fl(e):new Rl(e,{allowProjection:t!==y.Fragment});class iu extends it{constructor(e){super(e),e.animationState||(e.animationState=Ul(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();ee(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let ru=0;class ou extends it{constructor(){super(...arguments),this.id=ru++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const au={animation:{Feature:iu},exit:{Feature:ou}};function Bt(t){return{point:{x:t.pageX,y:t.pageY}}}const lu=t=>e=>Tn(e)&&t(e,Bt(e));function Mt(t,e,n,s){return It(t,e,lu(n),s)}const Er=({current:t})=>t?t.ownerDocument.defaultView:null,Us=(t,e)=>Math.abs(t-e);function cu(t,e){const n=Us(t.x,e.x),s=Us(t.y,e.y);return Math.sqrt(n**2+s**2)}const Ws=new Set(["auto","scroll"]);class Lr{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:r=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=ye(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=cu(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:v}=d,{timestamp:T}=F;this.history.push({...v,timestamp:T});const{onStart:S,onMove:g}=this.handlers;p||(S&&S(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,d)},this.handlePointerMove=(d,p)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=ge(p,this.transformPagePoint),M.update(this.updatePoint,!0)},this.handlePointerUp=(d,p)=>{this.end();const{onEnd:m,onSessionEnd:v,resumeAnimation:T}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&T&&T(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const S=ye(d.type==="pointercancel"?this.lastMoveEventInfo:ge(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(d,S),v&&v(d,S)},!Tn(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=r,this.contextWindow=i||window;const l=Bt(e),u=ge(l,this.transformPagePoint),{point:c}=u,{timestamp:h}=F;this.history=[{...c,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,ye(u,this.history)),this.removeListeners=kt(Mt(this.contextWindow,"pointermove",this.handlePointerMove),Mt(this.contextWindow,"pointerup",this.handlePointerUp),Mt(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Ws.has(s.overflowX)||Ws.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},o={x:i.x-n.x,y:i.y-n.y};o.x===0&&o.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(e,i),M.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),nt(this.updatePoint)}}function ge(t,e){return e?{point:e(t.point)}:t}function Ks(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ye({point:t},e){return{point:t,delta:Ks(t,Ir(e)),offset:Ks(t,uu(e)),velocity:hu(e,.1)}}function uu(t){return t[0]}function Ir(t){return t[t.length-1]}function hu(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Ir(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>q(e)));)n--;if(!s)return{x:0,y:0};const o=K(i.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function fu(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?D(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?D(n,t,s.max):Math.min(t,n)),t}function _s(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function du(t,{top:e,left:n,bottom:s,right:i}){return{x:_s(t.x,n,i),y:_s(t.y,e,s)}}function $s(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function pu(t,e){return{x:$s(t.x,e.x),y:$s(t.y,e.y)}}function mu(t,e){let n=.5;const s=j(t),i=j(e);return i>s?n=Rt(e.min,e.max-s,t.min):s>i&&(n=Rt(t.min,t.max-i,e.min)),Y(0,1,n)}function gu(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const He=.35;function yu(t=He){return t===!1?t=0:t===!0&&(t=He),{x:Hs(t,"left","right"),y:Hs(t,"top","bottom")}}function Hs(t,e,n){return{min:Gs(t,e),max:Gs(t,n)}}function Gs(t,e){return typeof t=="number"?t:t[e]||0}const vu=new WeakMap;class Tu{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=I(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const o=h=>{n?(this.stopAnimation(),this.snapToCursor(Bt(h).point)):this.pauseAnimation()},r=(h,f)=>{this.stopAnimation();const{drag:d,dragPropagation:p,onDragStart:m}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ol(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),W(T=>{let S=this.getAxisMotionValue(T).get()||0;if(X.test(S)){const{projection:g}=this.visualElement;if(g&&g.layout){const w=g.layout.layoutBox[T];w&&(S=j(w)*(parseFloat(S)/100))}}this.originPoint[T]=S}),m&&M.postRender(()=>m(h,f)),Be(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:m,onDrag:v}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:T}=f;if(p&&this.currentDirection===null){this.currentDirection=xu(T),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,T),this.updateAxis("y",f.point,T),this.visualElement.render(),v&&v(h,f)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>W(h=>this.getAnimationState(h)==="paused"&&this.getAxisMotionValue(h).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Lr(e,{onSessionStart:o,onStart:r,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:s,contextWindow:Er(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!s)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:a}=this.getProps();a&&M.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Kt(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=fu(r,this.constraints[e],this.elastic[e])),o.set(r)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&bt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=du(s.layoutBox,e):this.constraints=!1,this.elastic=yu(n),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&W(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=gu(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!bt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=bl(s,i.root,this.visualElement.getTransformPagePoint());let r=pu(i.layout.layoutBox,o);if(n){const a=n(xl(r));this.hasMutatedConstraints=!!a,a&&(r=tr(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=W(c=>{if(!Kt(c,n,this.currentDirection))return;let h=l&&l[c]||{};r&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[c]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Be(this.visualElement,e),s.start(pn(e,s,0,n,this.visualElement,!1))}stopAnimation(){W(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){W(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){W(n=>{const{drag:s}=this.getProps();if(!Kt(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:r,max:a}=i.layout.layoutBox[n],l=o.get()||0;o.set(e[n]-D(r,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!bt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};W(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const l=a.get();i[r]=mu({min:l,max:l},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),W(r=>{if(!Kt(r,e,null))return;const a=this.getAxisMotionValue(r),{min:l,max:u}=this.constraints[r];a.set(D(l,u,i[r]))})}addListeners(){if(!this.visualElement.current)return;vu.set(this.visualElement,this);const e=this.visualElement.current,n=Mt(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps(),h=l.target,f=h!==e&&Xi(h);u&&c&&!f&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();bt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),M.read(s);const r=It(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(W(c=>{const h=this.getAxisMotionValue(c);h&&(this.originPoint[c]+=l[c].translate,h.set(h.get()+l[c].translate))}),this.visualElement.render())}));return()=>{r(),n(),o(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=He,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function Kt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function xu(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Su extends it{constructor(e){super(e),this.removeGroupControls=_,this.removeListeners=_,this.controls=new Tu(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const zs=t=>(e,n)=>{t&&M.postRender(()=>t(e,n))};class Pu extends it{constructor(){super(...arguments),this.removePointerDownListener=_}onPointerDown(e){this.session=new Lr(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Er(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:zs(e),onStart:zs(n),onMove:s,onEnd:(o,r)=>{delete this.session,i&&M.postRender(()=>i(o,r))}}}mount(){this.removePointerDownListener=Mt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let ve=!1;class bu extends y.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=e;o&&(n.group&&n.group.add(o),s&&s.register&&i&&s.register(o),ve&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Gt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:o}=this.props,{projection:r}=s;return r&&(r.isPresent=o,e.layoutDependency!==n&&r.setOptions({...r.options,layoutDependency:n}),ve=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==o?r.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?r.promote():r.relegate()||M.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),vn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;ve=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function kr(t){const[e,n]=Pr(),s=y.useContext(Xe);return Q.jsx(bu,{...t,layoutGroup:s,switchLayoutGroup:y.useContext(Rr),isPresent:e,safeToRemove:n})}const wu={pan:{Feature:Pu},drag:{Feature:Su,ProjectionNode:Sr,MeasureLayout:kr}};function Xs(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=s[i];o&&M.postRender(()=>o(e,Bt(e)))}class Cu extends it{mount(){const{current:e}=this.node;e&&(this.unmount=al(e,(n,s)=>(Xs(this.node,s,"Start"),i=>Xs(this.node,i,"End"))))}unmount(){}}class Au extends it{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=kt(It(this.node.current,"focus",()=>this.onFocus()),It(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Ys(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=s[i];o&&M.postRender(()=>o(e,Bt(e)))}class Vu extends it{mount(){const{current:e}=this.node;e&&(this.unmount=ul(e,(n,s)=>(Ys(this.node,s,"Start"),(i,{success:o})=>Ys(this.node,i,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ge=new WeakMap,Te=new WeakMap,Mu=t=>{const e=Ge.get(t.target);e&&e(t)},Ru=t=>{t.forEach(Mu)};function Du({root:t,...e}){const n=t||document;Te.has(n)||Te.set(n,{});const s=Te.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Ru,{root:t,...e})),s[i]}function Eu(t,e,n){const s=Du(e);return Ge.set(t,n),s.observe(t),()=>{Ge.delete(t),s.unobserve(t)}}const Lu={some:0,all:1};class Iu extends it{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:o}=e,r={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Lu[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),f=u?c:h;f&&f(l)};return Eu(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(ku(e,n))&&this.startObserver()}unmount(){}}function ku({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Fu={inView:{Feature:Iu},tap:{Feature:Vu},focus:{Feature:Au},hover:{Feature:Cu}},Ou={layout:{ProjectionNode:Sr,MeasureLayout:kr}},Bu={...au,...Fu,...wu,...Ou},_u=nu(Bu,su),Fr={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},$u={...Fr,position:"fixed",top:0,left:0},Hu={...Fr,position:"absolute"};export{Ku as A,Hu as a,_u as m,Uu as u,$u as v};
|