opencami 1.3.1 → 1.4.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.
Files changed (59) hide show
  1. package/dist/client/assets/_sessionKey-DB95zj1L.js +97 -0
  2. package/dist/client/assets/agents-LFrWe-HX.js +2 -0
  3. package/dist/client/assets/agents-screen-CEBBk1yO.js +1 -0
  4. package/dist/client/assets/bots-CxDwf_WK.js +2 -0
  5. package/dist/client/assets/bots-screen-D6qma1wK.js +1 -0
  6. package/dist/client/assets/button-Il3CHIzX.js +1 -0
  7. package/dist/client/assets/{connect-B8sfEQyb.js → connect-D3baVDFL.js} +1 -1
  8. package/dist/client/assets/file-explorer-screen-rtV6n-5_.js +1 -0
  9. package/dist/client/assets/files-DMemuq9D.js +2 -0
  10. package/dist/client/assets/{index-BfhiL2JN.js → index-ByIsZcHh.js} +1 -1
  11. package/dist/client/assets/index-CVV4XiZo.js +153 -0
  12. package/dist/client/assets/keyboard-shortcuts-dialog-DXC0YHoy.js +1 -0
  13. package/dist/client/assets/{main-BlX7CS2-.js → main-CkIF0soY.js} +9 -9
  14. package/dist/client/assets/opencami-logo-CIxSO1oo.js +1 -0
  15. package/dist/client/assets/{react-ONC2UaeC.js → react-BhVdgA5r.js} +1 -1
  16. package/dist/client/assets/search-dialog-I1jJplIh.js +1 -0
  17. package/dist/client/assets/session-export-dialog-CH5unryw.js +1 -0
  18. package/dist/client/assets/settings-dialog-B8v-GVJ8.js +1 -0
  19. package/dist/client/assets/styles-BaTVzdPa.css +1 -0
  20. package/dist/client/assets/switch-sQnv1YsK.js +1 -0
  21. package/dist/client/assets/tooltip-j_viC_EE.js +1 -0
  22. package/dist/client/assets/use-file-explorer-state-BUH-u7Jv.js +12 -0
  23. package/dist/client/assets/useButton-9VAzplAB.js +9 -0
  24. package/dist/client/assets/useControlled-Y306krcC.js +1 -0
  25. package/dist/client/assets/useMutation-0WgW4xQJ.js +1 -0
  26. package/dist/server/assets/{_sessionKey-ZF1_Jqbt.js → _sessionKey-BhFH4uWY.js} +360 -62
  27. package/dist/server/assets/_tanstack-start-manifest_v-BaIrL1VQ.js +4 -0
  28. package/dist/server/assets/bots-6ryCIgKh.js +11 -0
  29. package/dist/server/assets/bots-screen-DS_ZF9Ec.js +417 -0
  30. package/dist/server/assets/{connect-CIDOw12K.js → connect-B8jpGQGK.js} +1 -1
  31. package/dist/server/assets/{file-explorer-screen-BzvgvV8m.js → file-explorer-screen-DCfS_Ajx.js} +76 -20
  32. package/dist/server/assets/{files-BxvRDIWU.js → files-D2GIrPF4.js} +1 -1
  33. package/dist/server/assets/{index-CTTNe_Sf.js → index-B2JHn34C.js} +1 -1
  34. package/dist/server/assets/{index-CmbNTqa2.js → index-BNSsDaLb.js} +71 -35
  35. package/dist/server/assets/{keyboard-shortcuts-dialog-7OEtXUlW.js → keyboard-shortcuts-dialog-CqIm8aYF.js} +1 -1
  36. package/dist/server/assets/{router-D5D0udHV.js → router-Dme7USeO.js} +219 -74
  37. package/dist/server/assets/{search-dialog-C8Oy-FBs.js → search-dialog-DG0D9KRN.js} +97 -54
  38. package/dist/server/assets/{session-export-dialog-DRVbC8Q-.js → session-export-dialog-DLPZVlQV.js} +1 -1
  39. package/dist/server/assets/{settings-dialog-CQFuAt9B.js → settings-dialog-BaGT4e5l.js} +36 -7
  40. package/dist/server/assets/{use-file-explorer-state-DMHdtb7D.js → use-file-explorer-state-DfAKF2gZ.js} +12 -0
  41. package/dist/server/server.js +2 -2
  42. package/package.json +1 -1
  43. package/dist/client/assets/_sessionKey-CaDTbjXx.js +0 -97
  44. package/dist/client/assets/agents-CGtqdyBi.js +0 -2
  45. package/dist/client/assets/agents-screen-DzIMcmHe.js +0 -1
  46. package/dist/client/assets/button-BcnCTjUT.js +0 -1
  47. package/dist/client/assets/file-explorer-screen-hjggspl-.js +0 -1
  48. package/dist/client/assets/files-BHXmS1J5.js +0 -2
  49. package/dist/client/assets/index-CxJ4zG_W.js +0 -153
  50. package/dist/client/assets/keyboard-shortcuts-dialog-DEknElTu.js +0 -1
  51. package/dist/client/assets/opencami-logo-5KynvViW.js +0 -1
  52. package/dist/client/assets/search-dialog-40gW31ca.js +0 -1
  53. package/dist/client/assets/session-export-dialog-DSRWU2YO.js +0 -1
  54. package/dist/client/assets/settings-dialog-AsvYzSBc.js +0 -1
  55. package/dist/client/assets/styles-BGTCU8mq.css +0 -1
  56. package/dist/client/assets/switch-dAvZcYA-.js +0 -1
  57. package/dist/client/assets/use-file-explorer-state-C6lX-h0n.js +0 -12
  58. package/dist/client/assets/useButton-DhneLsMA.js +0 -9
  59. package/dist/server/assets/_tanstack-start-manifest_v-C2FijMus.js +0 -4
@@ -1,9 +0,0 @@
1
- import{S as su,p as wr,k as Lt,s as Ns,l as Ke,f as js,m as Us,o as Sr,t as iu,q as bn,v as ru,w as ou,x as Er,n as ha,r as p,i as pa,u as au,j as X,y as ma,a as pe,z as cu,A as lu}from"./main-BlX7CS2-.js";import{f as De,u as se,a3 as we,a as es,a5 as uu,a6 as fu,c as ga,a7 as du,ab as Rr}from"./button-BcnCTjUT.js";var hu=class extends su{constructor(t,e){super(),this.options=e,this.#n=t,this.#i=null,this.#s=wr(),this.bindMethods(),this.setOptions(e)}#n;#t=void 0;#p=void 0;#e=void 0;#o;#u;#s;#i;#m;#f;#d;#a;#c;#r;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Cr(this.#t,this.options)?this.#l():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ws(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ws(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#T(),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 Lt(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),e._defaulted&&!Ns(this.options,e)&&this.#n.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&Pr(this.#t,n,this.options,e)&&this.#l(),this.updateResult(),s&&(this.#t!==n||Lt(this.options.enabled,this.#t)!==Lt(e.enabled,this.#t)||Ke(this.options.staleTime,this.#t)!==Ke(e.staleTime,this.#t))&&this.#g();const i=this.#y();s&&(this.#t!==n||Lt(this.options.enabled,this.#t)!==Lt(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 mu(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.#h.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.#l({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#e))}#l(t){this.#w();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(js)),e}#g(){this.#x();const t=Ke(this.options.staleTime,this.#t);if(Us||this.#e.isStale||!Sr(t))return;const n=iu(this.#e.dataUpdatedAt,t)+1;this.#a=bn.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.#T(),this.#r=t,!(Us||Lt(this.options.enabled,this.#t)===!1||!Sr(this.#r)||this.#r===0)&&(this.#c=bn.setInterval(()=>{(this.options.refetchIntervalInBackground||ru.isFocused())&&this.#l()},this.#r))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#a&&(bn.clearTimeout(this.#a),this.#a=void 0)}#T(){this.#c&&(bn.clearInterval(this.#c),this.#c=void 0)}createResult(t,e){const n=this.#t,s=this.options,i=this.#e,o=this.#o,r=this.#u,c=t!==n?t.state:this.#p,{state:l}=t;let u={...l},f=!1,d;if(e._optimisticResults){const S=this.hasListeners(),D=!S&&Cr(t,e),O=S&&Pr(t,n,e,s);(D||O)&&(u={...u,...ou(l.data,t.options)}),e._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:h,errorUpdatedAt:m,status:g}=u;d=u.data;let v=!1;if(e.placeholderData!==void 0&&d===void 0&&g==="pending"){let S;i?.isPlaceholderData&&e.placeholderData===r?.placeholderData?(S=i.data,v=!0):S=typeof e.placeholderData=="function"?e.placeholderData(this.#d?.state.data,this.#d):e.placeholderData,S!==void 0&&(g="success",d=Er(i?.data,S,e),f=!0)}if(e.select&&d!==void 0&&!v)if(i&&d===o?.data&&e.select===this.#m)d=this.#f;else try{this.#m=e.select,d=e.select(d),d=Er(i?.data,d,e),this.#f=d,this.#i=null}catch(S){this.#i=S}this.#i&&(h=this.#i,d=this.#f,m=Date.now(),g="error");const y=u.fetchStatus==="fetching",b=g==="pending",x=g==="error",T=b&&y,w=d!==void 0,R={status:g,fetchStatus:u.fetchStatus,isPending:b,isSuccess:g==="success",isError:x,isInitialLoading:T,isLoading:T,data:d,dataUpdatedAt:u.dataUpdatedAt,error:h,errorUpdatedAt:m,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!b,isLoadingError:x&&!w,isPaused:u.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:x&&w,isStale:wi(t,e),refetch:this.refetch,promise:this.#s,isEnabled:Lt(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const S=R.data!==void 0,D=R.status==="error"&&!S,O=C=>{D?C.reject(R.error):S&&C.resolve(R.data)},k=()=>{const C=this.#s=R.promise=wr();O(C)},M=this.#s;switch(M.status){case"pending":t.queryHash===n.queryHash&&O(M);break;case"fulfilled":(D||R.data!==M.value)&&k();break;case"rejected":(!D||R.error!==M.reason)&&k();break}}return R}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.#d=this.#t),Ns(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.#h.size)return!0;const o=new Set(i??this.#h);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.#S({listeners:n()})}#w(){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.#b()}#S(t){ha.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#e)}),this.#n.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function pu(t,e){return Lt(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Cr(t,e){return pu(t,e)||t.state.data!==void 0&&Ws(t,e,e.refetchOnMount)}function Ws(t,e,n){if(Lt(e.enabled,t)!==!1&&Ke(e.staleTime,t)!=="static"){const s=typeof n=="function"?n(t):n;return s==="always"||s!==!1&&wi(t,e)}return!1}function Pr(t,e,n,s){return(t!==e||Lt(s.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&wi(t,n)}function wi(t,e){return Lt(e.enabled,t)!==!1&&t.isStaleByTime(Ke(e.staleTime,t))}function mu(t,e){return!Ns(t.getCurrentResult(),e)}var ya=p.createContext(!1),gu=()=>p.useContext(ya);ya.Provider;function yu(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var vu=p.createContext(yu()),bu=()=>p.useContext(vu),xu=(t,e,n)=>{const s=n?.state.error&&typeof t.throwOnError=="function"?pa(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||s)&&(e.isReset()||(t.retryOnMount=!1))},Tu=t=>{p.useEffect(()=>{t.clearReset()},[t])},wu=({result:t,errorResetBoundary:e,throwOnError:n,query:s,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&s&&(i&&t.data===void 0||pa(n,[t.error,s])),Su=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))}},Eu=(t,e)=>t.isLoading&&t.isFetching&&!e,Ru=(t,e)=>t?.suspense&&e.isPending,Ar=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function Cu(t,e,n){const s=gu(),i=bu(),o=au(),r=o.defaultQueryOptions(t);o.getDefaultOptions().queries?._experimental_beforeQuery?.(r);const a=o.getQueryCache().get(r.queryHash);r._optimisticResults=s?"isRestoring":"optimistic",Su(r),xu(r,i,a),Tu(i);const c=!o.getQueryCache().get(r.queryHash),[l]=p.useState(()=>new e(o,r)),u=l.getOptimisticResult(r),f=!s&&t.subscribed!==!1;if(p.useSyncExternalStore(p.useCallback(d=>{const h=f?l.subscribe(ha.batchCalls(d)):js;return l.updateResult(),h},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),p.useEffect(()=>{l.setOptions(r)},[r,l]),Ru(r,u))throw Ar(r,l,i);if(wu({result:u,errorResetBoundary:i,throwOnError:r.throwOnError,query:a,suspense:r.suspense}))throw u.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(r,u),r.experimental_prefetchInRender&&!Us&&Eu(u,s)&&(c?Ar(r,l,i):a?.promise)?.catch(js).finally(()=>{l.updateResult()}),r.notifyOnChangeProps?u:l.trackResult(u)}function Kv(t,e){return Cu(t,hu)}const zv=500,Yv=500,Pu={style:{transition:"none"}},Xv="data-base-ui-click-trigger",Gv={fallbackAxisSide:"none"},Au={fallbackAxisSide:"end"},Mu={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Bn={isSidebarCollapsed:!1},va=["chat","ui"];function qv(t){const e=t.getQueryData(va);return e&&typeof e=="object"?{...Bn,...e}:Bn}function Qv(t,e){t.setQueryData(va,function(s){const i=s&&typeof s=="object"?{...Bn,...s}:Bn;return e(i)})}const Si=p.createContext({});function Ei(t){const e=p.useRef(null);return e.current===null&&(e.current=t()),e.current}const ba=typeof window<"u",xa=ba?p.useLayoutEffect:p.useEffect,ns=p.createContext(null);function Ri(t,e){t.indexOf(e)===-1&&t.push(e)}function Ci(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Wt=(t,e,n)=>n>e?e:n<t?t:n;let Pi=()=>{};const Yt={},Ta=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function wa(t){return typeof t=="object"&&t!==null}const Sa=t=>/^0[^.\s]+$/u.test(t);function Ai(t){let e;return()=>(e===void 0&&(e=t()),e)}const Mt=t=>t,Du=(t,e)=>n=>e(t(n)),on=(...t)=>t.reduce(Du),Ze=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class Mi{constructor(){this.subscriptions=[]}add(e){return Ri(this.subscriptions,e),()=>Ci(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 Kt=t=>t*1e3,Pt=t=>t/1e3;function Ea(t,e){return e?t*(1e3/e):0}const Ra=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Ou=1e-7,Iu=12;function Vu(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=Ra(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>Ou&&++a<Iu);return r}function an(t,e,n,s){if(t===e&&n===s)return Mt;const i=o=>Vu(o,0,1,t,n);return o=>o===0||o===1?o:Ra(i(o),e,s)}const Ca=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Pa=t=>e=>1-t(1-e),Aa=an(.33,1.53,.69,.99),Di=Pa(Aa),Ma=Ca(Di),Da=t=>(t*=2)<1?.5*Di(t):.5*(2-Math.pow(2,-10*(t-1))),Oi=t=>1-Math.sin(Math.acos(t)),Oa=Pa(Oi),Ia=Ca(Oi),Lu=an(.42,0,1,1),ku=an(0,0,.58,1),Va=an(.42,0,.58,1),Fu=t=>Array.isArray(t)&&typeof t[0]!="number",La=t=>Array.isArray(t)&&typeof t[0]=="number",Bu={linear:Mt,easeIn:Lu,easeInOut:Va,easeOut:ku,circIn:Oi,circInOut:Ia,circOut:Oa,backIn:Di,backInOut:Ma,backOut:Aa,anticipate:Da},Nu=t=>typeof t=="string",Mr=t=>{if(La(t)){Pi(t.length===4);const[e,n,s,i]=t;return an(e,n,s,i)}else if(Nu(t))return Bu[t];return t},xn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function ju(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 c(u){r.has(u)&&(l.schedule(u),t()),u(a)}const l={schedule:(u,f=!1,d=!1)=>{const m=d&&i?n:s;return f&&r.add(u),m.has(u)||m.add(u),u},cancel:u=>{s.delete(u),r.delete(u)},process:u=>{if(a=u,i){o=!0;return}i=!0,[n,s]=[s,n],n.forEach(c),n.clear(),i=!1,o&&(o=!1,l.process(u))}};return l}const Uu=40;function ka(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=xn.reduce((x,T)=>(x[T]=ju(o),x),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:f,preRender:d,render:h,postRender:m}=r,g=()=>{const x=Yt.useManualTiming?i.timestamp:performance.now();n=!1,Yt.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(x-i.timestamp,Uu),1)),i.timestamp=x,i.isProcessing=!0,a.process(i),c.process(i),l.process(i),u.process(i),f.process(i),d.process(i),h.process(i),m.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))},v=()=>{n=!0,s=!0,i.isProcessing||t(g)};return{schedule:xn.reduce((x,T)=>{const w=r[T];return x[T]=(E,R=!1,S=!1)=>(n||v(),w.schedule(E,R,S)),x},{}),cancel:x=>{for(let T=0;T<xn.length;T++)r[xn[T]].cancel(x)},state:i,steps:r}}const{schedule:Q,cancel:ee,state:ft,steps:ms}=ka(typeof requestAnimationFrame<"u"?requestAnimationFrame:Mt,!0);let Mn;function Wu(){Mn=void 0}const bt={now:()=>(Mn===void 0&&bt.set(ft.isProcessing||Yt.useManualTiming?ft.timestamp:performance.now()),Mn),set:t=>{Mn=t,queueMicrotask(Wu)}},Fa=t=>e=>typeof e=="string"&&e.startsWith(t),Ba=Fa("--"),$u=Fa("var(--"),Ii=t=>$u(t)?Hu.test(t.split("/*")[0].trim()):!1,Hu=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Dr(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Oe={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Je={...Oe,transform:t=>Wt(0,1,t)},Tn={...Oe,default:1},ze=t=>Math.round(t*1e5)/1e5,Vi=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function _u(t){return t==null}const Ku=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Li=(t,e)=>n=>!!(typeof n=="string"&&Ku.test(n)&&n.startsWith(t)||e&&!_u(n)&&Object.prototype.hasOwnProperty.call(n,e)),Na=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,o,r,a]=s.match(Vi);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},zu=t=>Wt(0,255,t),gs={...Oe,transform:t=>Math.round(zu(t))},ue={test:Li("rgb","red"),parse:Na("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+gs.transform(t)+", "+gs.transform(e)+", "+gs.transform(n)+", "+ze(Je.transform(s))+")"};function Yu(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 $s={test:Li("#"),parse:Yu,transform:ue.transform},cn=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Zt=cn("deg"),jt=cn("%"),V=cn("px"),Xu=cn("vh"),Gu=cn("vw"),Or={...jt,parse:t=>jt.parse(t)/100,transform:t=>jt.transform(t*100)},ve={test:Li("hsl","hue"),parse:Na("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+jt.transform(ze(e))+", "+jt.transform(ze(n))+", "+ze(Je.transform(s))+")"},rt={test:t=>ue.test(t)||$s.test(t)||ve.test(t),parse:t=>ue.test(t)?ue.parse(t):ve.test(t)?ve.parse(t):$s.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ue.transform(t):ve.transform(t),getAnimatableNone:t=>{const e=rt.parse(t);return e.alpha=0,rt.transform(e)}},qu=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Qu(t){return isNaN(t)&&typeof t=="string"&&(t.match(Vi)?.length||0)+(t.match(qu)?.length||0)>0}const ja="number",Ua="color",Zu="var",Ju="var(",Ir="${}",tf=/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 tn(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(tf,c=>(rt.test(c)?(s.color.push(o),i.push(Ua),n.push(rt.parse(c))):c.startsWith(Ju)?(s.var.push(o),i.push(Zu),n.push(c)):(s.number.push(o),i.push(ja),n.push(parseFloat(c))),++o,Ir)).split(Ir);return{values:n,split:a,indexes:s,types:i}}function Wa(t){return tn(t).values}function $a(t){const{split:e,types:n}=tn(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===ja?o+=ze(i[r]):a===Ua?o+=rt.transform(i[r]):o+=i[r]}return o}}const ef=t=>typeof t=="number"?0:rt.test(t)?rt.getAnimatableNone(t):t;function nf(t){const e=Wa(t);return $a(t)(e.map(ef))}const ne={test:Qu,parse:Wa,createTransformer:$a,getAnimatableNone:nf};function ys(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 sf({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,c=2*n-a;i=ys(c,a,t+1/3),o=ys(c,a,t),r=ys(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}function Nn(t,e){return n=>n>0?e:t}const J=(t,e,n)=>t+(e-t)*n,vs=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},rf=[$s,ue,ve],of=t=>rf.find(e=>e.test(t));function Vr(t){const e=of(t);if(!e)return!1;let n=e.parse(t);return e===ve&&(n=sf(n)),n}const Lr=(t,e)=>{const n=Vr(t),s=Vr(e);if(!n||!s)return Nn(t,e);const i={...n};return o=>(i.red=vs(n.red,s.red,o),i.green=vs(n.green,s.green,o),i.blue=vs(n.blue,s.blue,o),i.alpha=J(n.alpha,s.alpha,o),ue.transform(i))},Hs=new Set(["none","hidden"]);function af(t,e){return Hs.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function cf(t,e){return n=>J(t,e,n)}function ki(t){return typeof t=="number"?cf:typeof t=="string"?Ii(t)?Nn:rt.test(t)?Lr:ff:Array.isArray(t)?Ha:typeof t=="object"?rt.test(t)?Lr:lf:Nn}function Ha(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>ki(o)(o,e[r]));return o=>{for(let r=0;r<s;r++)n[r]=i[r](o);return n}}function lf(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=ki(t[i])(t[i],e[i]));return i=>{for(const o in s)n[o]=s[o](i);return n}}function uf(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 ff=(t,e)=>{const n=ne.createTransformer(e),s=tn(t),i=tn(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?Hs.has(t)&&!i.values.length||Hs.has(e)&&!s.values.length?af(t,e):on(Ha(uf(s,i),i.values),n):Nn(t,e)};function _a(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?J(t,e,n):ki(t)(t,e)}const df=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Q.update(e,n),stop:()=>ee(e),now:()=>ft.isProcessing?ft.timestamp:bt.now()}},Ka=(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)})`},jn=2e4;function Fi(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<jn;)e+=n,s=t.next(e);return e>=jn?1/0:e}function hf(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Fi(s),jn);return{type:"keyframes",ease:o=>s.next(i*o).value/e,duration:Pt(i)}}const pf=5;function za(t,e,n){const s=Math.max(e-pf,0);return Ea(n-t(s),e-s)}const et={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},bs=.001;function mf({duration:t=et.duration,bounce:e=et.bounce,velocity:n=et.velocity,mass:s=et.mass}){let i,o,r=1-e;r=Wt(et.minDamping,et.maxDamping,r),t=Wt(et.minDuration,et.maxDuration,Pt(t)),r<1?(i=l=>{const u=l*r,f=u*t,d=u-n,h=_s(l,r),m=Math.exp(-f);return bs-d/h*m},o=l=>{const f=l*r*t,d=f*n+n,h=Math.pow(r,2)*Math.pow(l,2)*t,m=Math.exp(-f),g=_s(Math.pow(l,2),r);return(-i(l)+bs>0?-1:1)*((d-h)*m)/g}):(i=l=>{const u=Math.exp(-l*t),f=(l-n)*t+1;return-bs+u*f},o=l=>{const u=Math.exp(-l*t),f=(n-l)*(t*t);return u*f});const a=5/t,c=yf(i,o,a);if(t=Kt(t),isNaN(c))return{stiffness:et.stiffness,damping:et.damping,duration:t};{const l=Math.pow(c,2)*s;return{stiffness:l,damping:r*2*Math.sqrt(s*l),duration:t}}}const gf=12;function yf(t,e,n){let s=n;for(let i=1;i<gf;i++)s=s-t(s)/e(s);return s}function _s(t,e){return t*Math.sqrt(1-e*e)}const vf=["duration","bounce"],bf=["stiffness","damping","mass"];function kr(t,e){return e.some(n=>t[n]!==void 0)}function xf(t){let e={velocity:et.velocity,stiffness:et.stiffness,damping:et.damping,mass:et.mass,isResolvedFromDuration:!1,...t};if(!kr(t,bf)&&kr(t,vf))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,o=2*Wt(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:et.mass,stiffness:i,damping:o}}else{const n=mf(t);e={...e,...n,mass:et.mass},e.isResolvedFromDuration=!0}return e}function Un(t=et.visualDuration,e=et.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:c,damping:l,mass:u,duration:f,velocity:d,isResolvedFromDuration:h}=xf({...n,velocity:-Pt(n.velocity||0)}),m=d||0,g=l/(2*Math.sqrt(c*u)),v=r-o,y=Pt(Math.sqrt(c/u)),b=Math.abs(v)<5;s||(s=b?et.restSpeed.granular:et.restSpeed.default),i||(i=b?et.restDelta.granular:et.restDelta.default);let x;if(g<1){const w=_s(y,g);x=E=>{const R=Math.exp(-g*y*E);return r-R*((m+g*y*v)/w*Math.sin(w*E)+v*Math.cos(w*E))}}else if(g===1)x=w=>r-Math.exp(-y*w)*(v+(m+y*v)*w);else{const w=y*Math.sqrt(g*g-1);x=E=>{const R=Math.exp(-g*y*E),S=Math.min(w*E,300);return r-R*((m+g*y*v)*Math.sinh(S)+w*v*Math.cosh(S))/w}}const T={calculatedDuration:h&&f||null,next:w=>{const E=x(w);if(h)a.done=w>=f;else{let R=w===0?m:0;g<1&&(R=w===0?Kt(m):za(x,w,E));const S=Math.abs(R)<=s,D=Math.abs(r-E)<=i;a.done=S&&D}return a.value=a.done?r:E,a},toString:()=>{const w=Math.min(Fi(T),jn),E=Ka(R=>T.next(w*R).value,w,30);return w+"ms "+E},toTransition:()=>{}};return T}Un.applyToOptions=t=>{const e=hf(t,100,Un);return t.ease=e.ease,t.duration=Kt(e.duration),t.type="keyframes",t};function Ks({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:c,restDelta:l=.5,restSpeed:u}){const f=t[0],d={done:!1,value:f},h=S=>a!==void 0&&S<a||c!==void 0&&S>c,m=S=>a===void 0?c:c===void 0||Math.abs(a-S)<Math.abs(c-S)?a:c;let g=n*e;const v=f+g,y=r===void 0?v:r(v);y!==v&&(g=y-f);const b=S=>-g*Math.exp(-S/s),x=S=>y+b(S),T=S=>{const D=b(S),O=x(S);d.done=Math.abs(D)<=l,d.value=d.done?y:O};let w,E;const R=S=>{h(d.value)&&(w=S,E=Un({keyframes:[d.value,m(d.value)],velocity:za(x,S,d.value),damping:i,stiffness:o,restDelta:l,restSpeed:u}))};return R(0),{calculatedDuration:null,next:S=>{let D=!1;return!E&&w===void 0&&(D=!0,T(S),R(S)),w!==void 0&&S>=w?E.next(S-w):(!D&&T(S),d)}}}function Tf(t,e,n){const s=[],i=n||Yt.mix||_a,o=t.length-1;for(let r=0;r<o;r++){let a=i(t[r],t[r+1]);if(e){const c=Array.isArray(e)?e[r]||Mt:e;a=on(c,a)}s.push(a)}return s}function wf(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(Pi(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=Tf(e,s,i),c=a.length,l=u=>{if(r&&u<t[0])return e[0];let f=0;if(c>1)for(;f<t.length-2&&!(u<t[f+1]);f++);const d=Ze(t[f],t[f+1],u);return a[f](d)};return n?u=>l(Wt(t[0],t[o-1],u)):l}function Sf(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Ze(0,e,s);t.push(J(n,1,i))}}function Ef(t){const e=[0];return Sf(e,t.length-1),e}function Rf(t,e){return t.map(n=>n*e)}function Cf(t,e){return t.map(()=>e||Va).splice(0,t.length-1)}function Ye({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Fu(s)?s.map(Mr):Mr(s),o={done:!1,value:e[0]},r=Rf(n&&n.length===e.length?n:Ef(e),t),a=wf(r,e,{ease:Array.isArray(i)?i:Cf(e,i)});return{calculatedDuration:t,next:c=>(o.value=a(c),o.done=c>=t,o)}}const Pf=t=>t!==null;function Bi(t,{repeat:e,repeatType:n="loop"},s,i=1){const o=t.filter(Pf),a=i<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!a||s===void 0?o[a]:s}const Af={decay:Ks,inertia:Ks,tween:Ye,keyframes:Ye,spring:Un};function Ya(t){typeof t.type=="string"&&(t.type=Af[t.type])}class Ni{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 Mf=t=>t/100;class ji extends Ni{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!==bt.now()&&this.tick(bt.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;Ya(e);const{type:n=Ye,repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=e;let{keyframes:a}=e;const c=n||Ye;c!==Ye&&typeof a[0]!="number"&&(this.mixKeyframes=on(Mf,_a(a[0],a[1])),a=[0,100]);const l=c({...e,keyframes:a});o==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...a].reverse(),velocity:-r})),l.calculatedDuration===null&&(l.calculatedDuration=Fi(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=l}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:c}=this;if(this.startTime===null)return s.next(0);const{delay:l=0,keyframes:u,repeat:f,repeatType:d,repeatDelay:h,type:m,onUpdate:g,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 y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let x=this.currentTime,T=s;if(f){const S=Math.min(this.currentTime,i)/a;let D=Math.floor(S),O=S%1;!O&&S>=1&&(O=1),O===1&&D--,D=Math.min(D,f+1),D%2&&(d==="reverse"?(O=1-O,h&&(O-=h/a)):d==="mirror"&&(T=r)),x=Wt(0,1,O)*a}const w=b?{done:!1,value:u[0]}:T.next(x);o&&(w.value=o(w.value));let{done:E}=w;!b&&c!==null&&(E=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return R&&m!==Ks&&(w.value=Bi(u,this.options,v,this.speed)),g&&g(w.value),R&&this.finish(),w}then(e,n){return this.finished.then(e,n)}get duration(){return Pt(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Pt(e)}get time(){return Pt(this.currentTime)}set time(e){e=Kt(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(bt.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=Pt(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=df,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(bt.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 Df(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const fe=t=>t*180/Math.PI,zs=t=>{const e=fe(Math.atan2(t[1],t[0]));return Ys(e)},Of={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:zs,rotateZ:zs,skewX:t=>fe(Math.atan(t[1])),skewY:t=>fe(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ys=t=>(t=t%360,t<0&&(t+=360),t),Fr=zs,Br=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Nr=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),If={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Br,scaleY:Nr,scale:t=>(Br(t)+Nr(t))/2,rotateX:t=>Ys(fe(Math.atan2(t[6],t[5]))),rotateY:t=>Ys(fe(Math.atan2(-t[2],t[0]))),rotateZ:Fr,rotate:Fr,skewX:t=>fe(Math.atan(t[4])),skewY:t=>fe(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Xs(t){return t.includes("scale")?1:0}function Gs(t,e){if(!t||t==="none")return Xs(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=If,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Of,i=a}if(!i)return Xs(e);const o=s[e],r=i[1].split(",").map(Lf);return typeof o=="function"?o(r):r[o]}const Vf=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Gs(n,e)};function Lf(t){return parseFloat(t.trim())}const Ie=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ve=new Set(Ie),jr=t=>t===Oe||t===V,kf=new Set(["x","y","z"]),Ff=Ie.filter(t=>!kf.has(t));function Bf(t){const e=[];return Ff.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const Jt={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})=>Gs(e,"x"),y:(t,{transform:e})=>Gs(e,"y")};Jt.translateX=Jt.x;Jt.translateY=Jt.y;const de=new Set;let qs=!1,Qs=!1,Zs=!1;function Xa(){if(Qs){const t=Array.from(de).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Bf(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)})}Qs=!1,qs=!1,de.forEach(t=>t.complete(Zs)),de.clear()}function Ga(){de.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Qs=!0)})}function Nf(){Zs=!0,Ga(),Xa(),Zs=!1}class Ui{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?(de.add(this),qs||(qs=!0,Q.read(Ga),Q.resolveKeyframes(Xa))):(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])}Df(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),de.delete(this)}cancel(){this.state==="scheduled"&&(de.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const jf=t=>t.startsWith("--");function Uf(t,e,n){jf(e)?t.style.setProperty(e,n):t.style[e]=n}const Wf=Ai(()=>window.ScrollTimeline!==void 0),$f={};function Hf(t,e){const n=Ai(t);return()=>$f[e]??n()}const qa=Hf(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),He=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Ur={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:He([0,.65,.55,1]),circOut:He([.55,0,1,.45]),backIn:He([.31,.01,.66,-.59]),backOut:He([.33,1.53,.69,.99])};function Qa(t,e){if(t)return typeof t=="function"?qa()?Ka(t,e):"ease-out":La(t)?He(t):Array.isArray(t)?t.map(n=>Qa(n,e)||Ur.easeOut):Ur[t]}function _f(t,e,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[e]:n};c&&(u.offset=c);const f=Qa(a,i);Array.isArray(f)&&(u.easing=f);const d={delay:s,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"};return l&&(d.pseudoElement=l),t.animate(u,d)}function Za(t){return typeof t=="function"&&"applyToOptions"in t}function Kf({type:t,...e}){return Za(t)&&qa()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class zf extends Ni{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:c}=e;this.isPseudoElement=!!o,this.allowFlatten=r,this.options=e,Pi(typeof e.type!="string");const l=Kf(e);this.animation=_f(n,s,i,l,o),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const u=Bi(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):Uf(n,s,u),this.animation.cancel()}c?.(),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 Pt(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Pt(e)}get time(){return Pt(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Kt(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&&Wf()?(this.animation.timeline=e,Mt):n(this)}}const Ja={anticipate:Da,backInOut:Ma,circInOut:Ia};function Yf(t){return t in Ja}function Xf(t){typeof t.ease=="string"&&Yf(t.ease)&&(t.ease=Ja[t.ease])}const xs=10;class Gf extends zf{constructor(e){Xf(e),Ya(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 ji({...r,autoplay:!1}),c=Math.max(xs,bt.now()-this.startTime),l=Wt(0,xs,c-xs);n.setWithVelocity(a.sample(Math.max(0,c-l)).value,a.sample(c).value,l),a.stop()}}const Wr=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(ne.test(t)||t==="0")&&!t.startsWith("url("));function qf(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 Qf(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=Wr(i,e),a=Wr(o,e);return!r||!a?!1:qf(t)||(n==="spring"||Za(n))&&s}function Js(t){t.duration=0,t.type="keyframes"}const Zf=new Set(["opacity","clipPath","filter","transform"]),Jf=Ai(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function td(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:c,transformTemplate:l}=e.owner.getProps();return Jf()&&n&&Zf.has(n)&&(n!=="transform"||!l)&&!c&&!s&&i!=="mirror"&&o!==0&&r!=="inertia"}const ed=40;class nd extends Ni{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",keyframes:a,name:c,motionValue:l,element:u,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=bt.now();const d={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,name:c,motionValue:l,element:u,...f},h=u?.KeyframeResolver||Ui;this.keyframeResolver=new h(a,(m,g,v)=>this.onKeyframesResolved(m,g,d,!v),c,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:c,isHandoff:l,onUpdate:u}=s;this.resolvedAt=bt.now(),Qf(e,o,r,a)||((Yt.instantAnimations||!c)&&u?.(Bi(e,s,n)),e[0]=e[e.length-1],Js(s),s.repeat=0);const d={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>ed?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},h=!l&&td(d),m=d.motionValue?.owner?.current,g=h?new Gf({...d,element:m}):new ji(d);g.finished.then(()=>{this.notifyFinished()}).catch(Mt),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}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(),Nf()),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 tc(t,e,n,s=0,i=1){const o=Array.from(t).sort((l,u)=>l.sortNodePosition(u)).indexOf(e),r=t.size,a=(r-1)*s;return typeof n=="function"?n(o,r):i===1?o*s:a-o*s}const sd=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function id(t){const e=sd.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function ec(t,e,n=1){const[s,i]=id(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return Ta(r)?parseFloat(r):r}return Ii(i)?ec(i,e,n+1):i}const rd={type:"spring",stiffness:500,damping:25,restSpeed:10},od=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),ad={type:"keyframes",duration:.8},cd={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ld=(t,{keyframes:e})=>e.length>2?ad:Ve.has(t)?t.startsWith("scale")?od(e[1]):rd:cd,ud=t=>t!==null;function fd(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(ud),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[o]}function Wi(t,e){return t?.[e]??t?.default??t}function dd({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const $i=(t,e,n,s={},i,o)=>r=>{const a=Wi(s,t)||{},c=a.delay||s.delay||0;let{elapsed:l=0}=s;l=l-Kt(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};dd(a)||Object.assign(u,ld(t,u)),u.duration&&(u.duration=Kt(u.duration)),u.repeatDelay&&(u.repeatDelay=Kt(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Js(u),u.delay===0&&(f=!0)),(Yt.instantAnimations||Yt.skipAnimations)&&(f=!0,Js(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!o&&e.get()!==void 0){const d=fd(u.keyframes,a);if(d!==void 0){Q.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new ji(u):new nd(u)};function $r(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function Hi(t,e,n,s){if(typeof e=="function"){const[i,o]=$r(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]=$r(s);e=e(n!==void 0?n:t.custom,i,o)}return e}function Se(t,e,n){const s=t.getProps();return Hi(s,e,n!==void 0?n:s.custom,t)}const nc=new Set(["width","height","top","left","right","bottom",...Ie]),Hr=30,hd=t=>!isNaN(parseFloat(t));class pd{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=bt.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=bt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=hd(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 Mi);const s=this.events[e].add(n);return e==="change"?()=>{s(),Q.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=bt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Hr)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Hr);return Ea(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 Ce(t,e){return new pd(t,e)}const ti=t=>Array.isArray(t);function md(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ce(n))}function gd(t){return ti(t)?t[t.length-1]||0:t}function yd(t,e){const n=Se(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=gd(o[r]);md(t,r,a)}}const pt=t=>!!(t&&t.getVelocity);function vd(t){return!!(pt(t)&&t.add)}function ei(t,e){const n=t.getValue("willChange");if(vd(n))return n.add(e);if(!n&&Yt.WillChange){const s=new Yt.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function _i(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const bd="framerAppearId",sc="data-"+_i(bd);function ic(t){return t.props[sc]}function xd({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function rc(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=e;const c=o?.reduceMotion;s&&(o=s);const l=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const f in a){const d=t.getValue(f,t.latestValues[f]??null),h=a[f];if(h===void 0||u&&xd(u,f))continue;const m={delay:n,...Wi(o||{},f)},g=d.get();if(g!==void 0&&!d.isAnimating&&!Array.isArray(h)&&h===g&&!m.velocity)continue;let v=!1;if(window.MotionHandoffAnimation){const x=ic(t);if(x){const T=window.MotionHandoffAnimation(x,f,Q);T!==null&&(m.startTime=T,v=!0)}}ei(t,f);const y=c??t.shouldReduceMotion;d.start($i(f,d,h,y&&nc.has(f)?{type:!1}:m,t,v));const b=d.animation;b&&l.push(b)}return r&&Promise.all(l).then(()=>{Q.update(()=>{r&&yd(t,r)})}),l}function ni(t,e,n={}){const s=Se(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(rc(t,s,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:l=0,staggerChildren:u,staggerDirection:f}=i;return Td(t,e,c,l,u,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,l]=a==="beforeChildren"?[o,r]:[r,o];return c().then(()=>l())}else return Promise.all([o(),r(n.delay)])}function Td(t,e,n=0,s=0,i=0,o=1,r){const a=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),a.push(ni(c,e,{...r,delay:n+(typeof s=="function"?0:s)+tc(t.variantChildren,c,s,i,o)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(a)}function wd(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>ni(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=ni(t,e,n);else{const i=typeof e=="function"?Se(t,e,n.custom):e;s=Promise.all(rc(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Sd={test:t=>t==="auto",parse:t=>t},oc=t=>e=>e.test(t),ac=[Oe,V,jt,Zt,Gu,Xu,Sd],_r=t=>ac.find(oc(t));function Ed(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Sa(t):!0}const Rd=new Set(["brightness","contrast","saturate","opacity"]);function Cd(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Vi)||[];if(!s)return t;const i=n.replace(s,"");let o=Rd.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const Pd=/\b([a-z-]*)\(.*?\)/gu,si={...ne,getAnimatableNone:t=>{const e=t.match(Pd);return e?e.map(Cd).join(" "):t}},Kr={...Oe,transform:Math.round},Ad={rotate:Zt,rotateX:Zt,rotateY:Zt,rotateZ:Zt,scale:Tn,scaleX:Tn,scaleY:Tn,scaleZ:Tn,skew:Zt,skewX:Zt,skewY:Zt,distance:V,translateX:V,translateY:V,translateZ:V,x:V,y:V,z:V,perspective:V,transformPerspective:V,opacity:Je,originX:Or,originY:Or,originZ:V},Ki={borderWidth:V,borderTopWidth:V,borderRightWidth:V,borderBottomWidth:V,borderLeftWidth:V,borderRadius:V,borderTopLeftRadius:V,borderTopRightRadius:V,borderBottomRightRadius:V,borderBottomLeftRadius:V,width:V,maxWidth:V,height:V,maxHeight:V,top:V,right:V,bottom:V,left:V,inset:V,insetBlock:V,insetBlockStart:V,insetBlockEnd:V,insetInline:V,insetInlineStart:V,insetInlineEnd:V,padding:V,paddingTop:V,paddingRight:V,paddingBottom:V,paddingLeft:V,paddingBlock:V,paddingBlockStart:V,paddingBlockEnd:V,paddingInline:V,paddingInlineStart:V,paddingInlineEnd:V,margin:V,marginTop:V,marginRight:V,marginBottom:V,marginLeft:V,marginBlock:V,marginBlockStart:V,marginBlockEnd:V,marginInline:V,marginInlineStart:V,marginInlineEnd:V,fontSize:V,backgroundPositionX:V,backgroundPositionY:V,...Ad,zIndex:Kr,fillOpacity:Je,strokeOpacity:Je,numOctaves:Kr},Md={...Ki,color:rt,backgroundColor:rt,outlineColor:rt,fill:rt,stroke:rt,borderColor:rt,borderTopColor:rt,borderRightColor:rt,borderBottomColor:rt,borderLeftColor:rt,filter:si,WebkitFilter:si},cc=t=>Md[t];function lc(t,e){let n=cc(t);return n!==si&&(n=ne),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Dd=new Set(["auto","none","0"]);function Od(t,e,n){let s=0,i;for(;s<t.length&&!i;){const o=t[s];typeof o=="string"&&!Dd.has(o)&&tn(o).values.length&&(i=t[s]),s++}if(i&&n)for(const o of e)t[o]=lc(n,i)}class Id extends Ui{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 u=0;u<e.length;u++){let f=e[u];if(typeof f=="string"&&(f=f.trim(),Ii(f))){const d=ec(f,n.current);d!==void 0&&(e[u]=d),u===e.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!nc.has(s)||e.length!==2)return;const[i,o]=e,r=_r(i),a=_r(o),c=Dr(i),l=Dr(o);if(c!==l&&Jt[s]){this.needsMeasurement=!0;return}if(r!==a)if(jr(r)&&jr(a))for(let u=0;u<e.length;u++){const f=e[u];typeof f=="string"&&(e[u]=parseFloat(f))}else Jt[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||Ed(e[i]))&&s.push(i);s.length&&Od(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=Jt[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]=Jt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,c])=>{e.getValue(a).set(c)}),this.resolveNoneKeyframes()}}function Vd(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 uc=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function ii(t){return wa(t)&&"offsetHeight"in t}const{schedule:zi}=ka(queueMicrotask,!1),Vt={x:!1,y:!1};function fc(){return Vt.x||Vt.y}function Ld(t){return t==="x"||t==="y"?Vt[t]?null:(Vt[t]=!0,()=>{Vt[t]=!1}):Vt.x||Vt.y?null:(Vt.x=Vt.y=!0,()=>{Vt.x=Vt.y=!1})}function dc(t,e){const n=Vd(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function zr(t){return!(t.pointerType==="touch"||fc())}function kd(t,e,n={}){const[s,i,o]=dc(t,n),r=a=>{if(!zr(a))return;const{target:c}=a,l=e(c,a);if(typeof l!="function"||!c)return;const u=f=>{zr(f)&&(l(f),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,i)};return s.forEach(a=>{a.addEventListener("pointerenter",r,i)}),o}const hc=(t,e)=>e?t===e?!0:hc(t,e.parentElement):!1,Yi=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Fd=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function pc(t){return Fd.has(t.tagName)||t.isContentEditable===!0}const Dn=new WeakSet;function Yr(t){return e=>{e.key==="Enter"&&t(e)}}function Ts(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Bd=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Yr(()=>{if(Dn.has(n))return;Ts(n,"down");const i=Yr(()=>{Ts(n,"up")}),o=()=>Ts(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 Xr(t){return Yi(t)&&!fc()}function Nd(t,e,n={}){const[s,i,o]=dc(t,n),r=a=>{const c=a.currentTarget;if(!Xr(a))return;Dn.add(c);const l=e(c,a),u=(h,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",d),Dn.has(c)&&Dn.delete(c),Xr(h)&&typeof l=="function"&&l(h,{success:m})},f=h=>{u(h,c===window||c===document||n.useGlobalTarget||hc(c,h.target))},d=h=>{u(h,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",d,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",r,i),ii(a)&&(a.addEventListener("focus",l=>Bd(l,i)),!pc(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function mc(t){return wa(t)&&"ownerSVGElement"in t}function jd(t){return mc(t)&&t.tagName==="svg"}const Ud=[...ac,rt,ne],Wd=t=>Ud.find(oc(t)),Gr=()=>({translate:0,scale:1,origin:0,originPoint:0}),be=()=>({x:Gr(),y:Gr()}),qr=()=>({min:0,max:0}),lt=()=>({x:qr(),y:qr()}),ri={current:null},gc={current:!1},$d=typeof window<"u";function Hd(){if(gc.current=!0,!!$d)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ri.current=t.matches;t.addEventListener("change",e),e()}else ri.current=!1}const _d=new WeakMap;function ss(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function en(t){return typeof t=="string"||Array.isArray(t)}const Xi=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Gi=["initial",...Xi];function is(t){return ss(t.animate)||Gi.some(e=>en(t[e]))}function yc(t){return!!(is(t)||t.variants)}function Kd(t,e,n){for(const s in e){const i=e[s],o=n[s];if(pt(i))t.addValue(s,i);else if(pt(o))t.addValue(s,Ce(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,Ce(r!==void 0?r:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const Qr=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Wn={};function vc(t){Wn=t}function zd(){return Wn}class Yd{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=Ui,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 d=bt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,Q.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=r;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,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=is(n),this.isVariantNode=yc(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:u,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const h=f[d];c[d]!==void 0&&pt(h)&&h.set(c[d])}}mount(e){this.current=e,_d.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:(gc.current||Hd(),this.shouldReduceMotion=ri.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),ee(this.notifyUpdate),ee(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=Ve.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",r=>{this.latestValues[e]=r,this.props.onUpdate&&Q.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 Wn){const n=Wn[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):lt()}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<Qr.length;s++){const i=Qr[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=Kd(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=Ce(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"&&(Ta(s)||Sa(s))?s=parseFloat(s):!Wd(s)&&ne.test(n)&&(s=lc(e,n)),this.setBaseTarget(e,pt(s)?s.get():s)),pt(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=Hi(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&&!pt(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 Mi),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){zi.render(this.render)}}class bc extends Yd{constructor(){super(...arguments),this.KeyframeResolver=Id}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;pt(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ie{constructor(e){this.isMounted=!1,this.node=e}update(){}}function xc({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Xd({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Gd(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 ws(t){return t===void 0||t===1}function oi({scale:t,scaleX:e,scaleY:n}){return!ws(t)||!ws(e)||!ws(n)}function le(t){return oi(t)||Tc(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Tc(t){return Zr(t.x)||Zr(t.y)}function Zr(t){return t&&t!=="0%"}function $n(t,e,n){const s=t-n,i=e*s;return n+i}function Jr(t,e,n,s,i){return i!==void 0&&(t=$n(t,i,s)),$n(t,n,s)+e}function ai(t,e=0,n=1,s,i){t.min=Jr(t.min,e,n,s,i),t.max=Jr(t.max,e,n,s,i)}function wc(t,{x:e,y:n}){ai(t.x,e.translate,e.scale,e.originPoint),ai(t.y,n.translate,n.scale,n.originPoint)}const to=.999999999999,eo=1.0000000000001;function qd(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:c}=o.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Te(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,wc(t,r)),s&&le(o.latestValues)&&Te(t,o.latestValues))}e.x<eo&&e.x>to&&(e.x=1),e.y<eo&&e.y>to&&(e.y=1)}function xe(t,e){t.min=t.min+e,t.max=t.max+e}function no(t,e,n,s,i=.5){const o=J(t.min,t.max,i);ai(t,e,n,o,s)}function Te(t,e){no(t.x,e.x,e.scaleX,e.scale,e.originX),no(t.y,e.y,e.scaleY,e.scale,e.originY)}function Sc(t,e){return xc(Gd(t.getBoundingClientRect(),e))}function Qd(t,e,n){const s=Sc(t,n),{scroll:i}=e;return i&&(xe(s.x,i.offset.x),xe(s.y,i.offset.y)),s}const Zd={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Jd=Ie.length;function th(t,e,n){let s="",i=!0;for(let o=0;o<Jd;o++){const r=Ie[o],a=t[r];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(r.startsWith("scale")?1:0);else{const l=parseFloat(a);c=r.startsWith("scale")?l===1:l===0}if(!c||n){const l=uc(a,Ki[r]);if(!c){i=!1;const u=Zd[r]||r;s+=`${u}(${l}) `}n&&(e[r]=l)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function qi(t,e,n){const{style:s,vars:i,transformOrigin:o}=t;let r=!1,a=!1;for(const c in e){const l=e[c];if(Ve.has(c)){r=!0;continue}else if(Ba(c)){i[c]=l;continue}else{const u=uc(l,Ki[c]);c.startsWith("origin")?(a=!0,o[c]=u):s[c]=u}}if(e.transform||(r||n?s.transform=th(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:u=0}=o;s.transformOrigin=`${c} ${l} ${u}`}}function Ec(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 so(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const We={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(V.test(t))t=parseFloat(t);else return t;const n=so(t,e.target.x),s=so(t,e.target.y);return`${n}% ${s}%`}},eh={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=ne.parse(t);if(i.length>5)return s;const o=ne.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=c;const l=J(a,c,.5);return typeof i[2+r]=="number"&&(i[2+r]/=l),typeof i[3+r]=="number"&&(i[3+r]/=l),o(i)}},ci={borderRadius:{...We,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:We,borderTopRightRadius:We,borderBottomLeftRadius:We,borderBottomRightRadius:We,boxShadow:eh};function Rc(t,{layout:e,layoutId:n}){return Ve.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!ci[t]||t==="opacity")}function Qi(t,e,n){const s=t.style,i=e?.style,o={};if(!s)return o;for(const r in s)(pt(s[r])||i&&pt(i[r])||Rc(r,t)||n?.getValue(r)?.liveStyle!==void 0)&&(o[r]=s[r]);return o}function nh(t){return window.getComputedStyle(t)}class sh extends bc{constructor(){super(...arguments),this.type="html",this.renderInstance=Ec}readValueFromInstance(e,n){if(Ve.has(n))return this.projection?.isProjecting?Xs(n):Vf(e,n);{const s=nh(e),i=(Ba(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Sc(e,n)}build(e,n,s){qi(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Qi(e,n,s)}}const ih={offset:"stroke-dashoffset",array:"stroke-dasharray"},rh={offset:"strokeDashoffset",array:"strokeDasharray"};function oh(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?ih:rh;t[o.offset]=`${-s}`,t[o.array]=`${e} ${n}`}const ah=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Cc(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:o=1,pathOffset:r=0,...a},c,l,u){if(qi(t,a,l),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:d}=t;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete f.transformBox);for(const h of ah)f[h]!==void 0&&(d[h]=f[h],delete f[h]);e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),s!==void 0&&(f.scale=s),i!==void 0&&oh(f,i,o,r,!1)}const Pc=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"]),Ac=t=>typeof t=="string"&&t.toLowerCase()==="svg";function ch(t,e,n,s){Ec(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Pc.has(i)?i:_i(i),e.attrs[i])}function Mc(t,e,n){const s=Qi(t,e,n);for(const i in t)if(pt(t[i])||pt(e[i])){const o=Ie.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}class lh extends bc{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=lt}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Ve.has(n)){const s=cc(n);return s&&s.default||0}return n=Pc.has(n)?n:_i(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Mc(e,n,s)}build(e,n,s){Cc(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){ch(e,n,s,i)}mount(e){this.isSVGTag=Ac(e.tagName),super.mount(e)}}const uh=Gi.length;function Dc(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Dc(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<uh;n++){const s=Gi[n],i=t.props[s];(en(i)||i===!1)&&(e[s]=i)}return e}function Oc(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 fh=[...Xi].reverse(),dh=Xi.length;function hh(t){return e=>Promise.all(e.map(({animation:n,options:s})=>wd(t,n,s)))}function ph(t){let e=hh(t),n=io(),s=!0;const i=c=>(l,u)=>{const f=Se(t,u,c==="exit"?t.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:h,...m}=f;l={...l,...m,...h}}return l};function o(c){e=c(t)}function r(c){const{props:l}=t,u=Dc(t.parent)||{},f=[],d=new Set;let h={},m=1/0;for(let v=0;v<dh;v++){const y=fh[v],b=n[y],x=l[y]!==void 0?l[y]:u[y],T=en(x),w=y===c?b.isActive:null;w===!1&&(m=v);let E=x===u[y]&&x!==l[y]&&T;if(E&&s&&t.manuallyAnimateOnMount&&(E=!1),b.protectedKeys={...h},!b.isActive&&w===null||!x&&!b.prevProp||ss(x)||typeof x=="boolean")continue;const R=mh(b.prevProp,x);let S=R||y===c&&b.isActive&&!E&&T||v>m&&T,D=!1;const O=Array.isArray(x)?x:[x];let k=O.reduce(i(y),{});w===!1&&(k={});const{prevResolvedValues:M={}}=b,C={...M,...k},B=I=>{S=!0,d.has(I)&&(D=!0,d.delete(I)),b.needsAnimating[I]=!0;const P=t.getValue(I);P&&(P.liveStyle=!1)};for(const I in C){const P=k[I],L=M[I];if(h.hasOwnProperty(I))continue;let _=!1;ti(P)&&ti(L)?_=!Oc(P,L):_=P!==L,_?P!=null?B(I):d.add(I):P!==void 0&&d.has(I)?B(I):b.protectedKeys[I]=!0}b.prevProp=x,b.prevResolvedValues=k,b.isActive&&(h={...h,...k}),s&&t.blockInitialAnimation&&(S=!1);const F=E&&R;S&&(!F||D)&&f.push(...O.map(I=>{const P={type:y};if(typeof I=="string"&&s&&!F&&t.manuallyAnimateOnMount&&t.parent){const{parent:L}=t,_=Se(L,I);if(L.enteringChildren&&_){const{delayChildren:W}=_.transition||{};P.delay=tc(L.enteringChildren,t,W)}}return{animation:I,options:P}}))}if(d.size){const v={};if(typeof l.initial!="boolean"){const y=Se(t,Array.isArray(l.initial)?l.initial[0]:l.initial);y&&y.transition&&(v.transition=y.transition)}d.forEach(y=>{const b=t.getBaseTarget(y),x=t.getValue(y);x&&(x.liveStyle=!0),v[y]=b??null}),f.push({animation:v})}let g=!!f.length;return s&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,g?e(f):Promise.resolve()}function a(c,l){if(n[c].isActive===l)return Promise.resolve();t.variantChildren?.forEach(f=>f.animationState?.setActive(c,l)),n[c].isActive=l;const u=r(c);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=io()}}}function mh(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Oc(e,t):!1}function ce(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function io(){return{animate:ce(!0),whileInView:ce(),whileHover:ce(),whileTap:ce(),whileDrag:ce(),whileFocus:ce(),exit:ce()}}function ro(t,e){t.min=e.min,t.max=e.max}function Ot(t,e){ro(t.x,e.x),ro(t.y,e.y)}function oo(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Ic=1e-4,gh=1-Ic,yh=1+Ic,Vc=.01,vh=0-Vc,bh=0+Vc;function xt(t){return t.max-t.min}function xh(t,e,n){return Math.abs(t-e)<=n}function ao(t,e,n,s=.5){t.origin=s,t.originPoint=J(e.min,e.max,t.origin),t.scale=xt(n)/xt(e),t.translate=J(n.min,n.max,t.origin)-t.originPoint,(t.scale>=gh&&t.scale<=yh||isNaN(t.scale))&&(t.scale=1),(t.translate>=vh&&t.translate<=bh||isNaN(t.translate))&&(t.translate=0)}function Xe(t,e,n,s){ao(t.x,e.x,n.x,s?s.originX:void 0),ao(t.y,e.y,n.y,s?s.originY:void 0)}function co(t,e,n){t.min=n.min+e.min,t.max=t.min+xt(e)}function Th(t,e,n){co(t.x,e.x,n.x),co(t.y,e.y,n.y)}function lo(t,e,n){t.min=e.min-n.min,t.max=t.min+xt(e)}function Hn(t,e,n){lo(t.x,e.x,n.x),lo(t.y,e.y,n.y)}function uo(t,e,n,s,i){return t-=e,t=$n(t,1/n,s),i!==void 0&&(t=$n(t,1/i,s)),t}function wh(t,e=0,n=1,s=.5,i,o=t,r=t){if(jt.test(e)&&(e=parseFloat(e),e=J(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=J(o.min,o.max,s);t===o&&(a-=e),t.min=uo(t.min,e,n,a,i),t.max=uo(t.max,e,n,a,i)}function fo(t,e,[n,s,i],o,r){wh(t,e[n],e[s],e[i],e.scale,o,r)}const Sh=["x","scaleX","originX"],Eh=["y","scaleY","originY"];function ho(t,e,n,s){fo(t.x,e,Sh,n?n.x:void 0,s?s.x:void 0),fo(t.y,e,Eh,n?n.y:void 0,s?s.y:void 0)}function po(t){return t.translate===0&&t.scale===1}function Lc(t){return po(t.x)&&po(t.y)}function mo(t,e){return t.min===e.min&&t.max===e.max}function Rh(t,e){return mo(t.x,e.x)&&mo(t.y,e.y)}function go(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function kc(t,e){return go(t.x,e.x)&&go(t.y,e.y)}function yo(t){return xt(t.x)/xt(t.y)}function vo(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Ct(t){return[t("x"),t("y")]}function Ch(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:l,rotate:u,rotateX:f,rotateY:d,skewX:h,skewY:m}=n;l&&(s=`perspective(${l}px) ${s}`),u&&(s+=`rotate(${u}deg) `),f&&(s+=`rotateX(${f}deg) `),d&&(s+=`rotateY(${d}deg) `),h&&(s+=`skewX(${h}deg) `),m&&(s+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(s+=`scale(${a}, ${c})`),s||"none"}const Fc=["TopLeft","TopRight","BottomLeft","BottomRight"],Ph=Fc.length,bo=t=>typeof t=="string"?parseFloat(t):t,xo=t=>typeof t=="number"||V.test(t);function Ah(t,e,n,s,i,o){i?(t.opacity=J(0,n.opacity??1,Mh(s)),t.opacityExit=J(e.opacity??1,0,Dh(s))):o&&(t.opacity=J(e.opacity??1,n.opacity??1,s));for(let r=0;r<Ph;r++){const a=`border${Fc[r]}Radius`;let c=To(e,a),l=To(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||xo(c)===xo(l)?(t[a]=Math.max(J(bo(c),bo(l),s),0),(jt.test(l)||jt.test(c))&&(t[a]+="%")):t[a]=l}(e.rotate||n.rotate)&&(t.rotate=J(e.rotate||0,n.rotate||0,s))}function To(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Mh=Bc(0,.5,Oa),Dh=Bc(.5,.95,Mt);function Bc(t,e,n){return s=>s<t?0:s>e?1:n(Ze(t,e,s))}function Oh(t,e,n){const s=pt(t)?t:Ce(t);return s.start($i("",s,e,n)),s.animation}function nn(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const Ih=(t,e)=>t.depth-e.depth;class Vh{constructor(){this.children=[],this.isDirty=!1}add(e){Ri(this.children,e),this.isDirty=!0}remove(e){Ci(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Ih),this.isDirty=!1,this.children.forEach(e)}}function Lh(t,e){const n=bt.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(ee(s),t(o-e))};return Q.setup(s,!0),()=>ee(s)}function On(t){return pt(t)?t.get():t}class kh{constructor(){this.members=[]}add(e){Ri(this.members,e),e.scheduleRender()}remove(e){if(Ci(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 In={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ss=["","X","Y","Z"],Fh=1e3;let Bh=0;function Es(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Nc(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=ic(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Q,!(i||o))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&Nc(s)}function jc({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e?.()){this.id=Bh++,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(Uh),this.nodes.forEach(_h),this.nodes.forEach(Kh),this.nodes.forEach(Wh)},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 c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Vh)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new Mi),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const c=this.eventHandlers.get(r);c&&c.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r){if(this.instance)return;this.isSVG=mc(r)&&!jd(r),this.instance=r;const{layoutId:a,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),t){let u,f=0;const d=()=>this.root.updateBlockedByResize=!1;Q.read(()=>{f=window.innerWidth}),t(r,()=>{const h=window.innerWidth;h!==f&&(f=h,this.root.updateBlockedByResize=!0,u&&u(),u=Lh(d,250),In.hasAnimatedSinceResize&&(In.hasAnimatedSinceResize=!1,this.nodes.forEach(Eo)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:d,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||l.getDefaultTransition()||qh,{onLayoutAnimationStart:g,onLayoutAnimationComplete:v}=l.getProps(),y=!this.targetLayout||!kc(this.targetLayout,h),b=!f&&d;if(this.options.layoutRoot||this.resumeFrom||b||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...Wi(m,"layout"),onPlay:g,onComplete:v};(l.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(u,b)}else f||Eo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}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(),ee(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(zh),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&&Nc(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(wo);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(So);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Hh),this.nodes.forEach(Nh),this.nodes.forEach(jh)):this.nodes.forEach(So),this.clearAllSnapshots();const a=bt.now();ft.delta=Wt(0,1e3/60,a-ft.timestamp),ft.timestamp=a,ft.isProcessing=!0,ms.update.process(ft),ms.preRender.process(ft),ms.render.process(ft),ft.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,zi.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach($h),this.sharedNodes.forEach(Yh)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Q.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Q.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!xt(this.snapshot.measuredBox.x)&&!xt(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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const r=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=lt(),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 c=s(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Lc(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;r&&this.instance&&(a||le(this.latestValues)||u)&&(i(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return r&&(c=this.removeTransform(c)),Qh(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:r}=this.options;if(!r)return lt();const a=r.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Zh))){const{scroll:l}=this.root;l&&(xe(a.x,l.offset.x),xe(a.y,l.offset.y))}return a}removeElementScroll(r){const a=lt();if(Ot(a,r),this.scroll?.wasRoot)return a;for(let c=0;c<this.path.length;c++){const l=this.path[c],{scroll:u,options:f}=l;l!==this.root&&u&&f.layoutScroll&&(u.wasRoot&&Ot(a,r),xe(a.x,u.offset.x),xe(a.y,u.offset.y))}return a}applyTransform(r,a=!1){const c=lt();Ot(c,r);for(let l=0;l<this.path.length;l++){const u=this.path[l];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Te(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),le(u.latestValues)&&Te(c,u.latestValues)}return le(this.latestValues)&&Te(c,this.latestValues),c}removeTransform(r){const a=lt();Ot(a,r);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!le(l.latestValues))continue;oi(l.latestValues)&&l.updateSnapshot();const u=lt(),f=l.measurePageBox();Ot(u,f),ho(a,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return le(this.latestValues)&&ho(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!==ft.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 c=!!this.resumingFrom||this!==a;if(!(r||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!this.layout||!(u||f))return;this.resolvedRelativeTargetAt=ft.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=lt(),this.targetWithTransforms=lt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Th(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ot(this.target,this.layout.layoutBox),wc(this.target,this.targetDelta)):Ot(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||oi(this.parent.latestValues)||Tc(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,c){this.relativeParent=r,this.linkedParentVersion=r.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=lt(),this.relativeTargetOrigin=lt(),Hn(this.relativeTargetOrigin,a,c),Ot(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const r=this.getLead(),a=!!this.resumingFrom||this!==r;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===ft.timestamp&&(c=!1),c)return;const{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;Ot(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;qd(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=lt());const{target:h}=r;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(oo(this.prevProjectionDelta.x,this.projectionDelta.x),oo(this.prevProjectionDelta.y,this.projectionDelta.y)),Xe(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!vo(this.projectionDelta.x,this.prevProjectionDelta.x)||!vo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}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=be(),this.projectionDelta=be(),this.projectionDeltaWithTransform=be()}setAnimationOrigin(r,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},f=be();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=lt(),h=c?c.source:void 0,m=this.layout?this.layout.source:void 0,g=h!==m,v=this.getStack(),y=!v||v.members.length<=1,b=!!(g&&!y&&this.options.crossfade===!0&&!this.path.some(Gh));this.animationProgress=0;let x;this.mixTargetDelta=T=>{const w=T/1e3;Ro(f.x,r.x,w),Ro(f.y,r.y,w),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Hn(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Xh(this.relativeTarget,this.relativeTargetOrigin,d,w),x&&Rh(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=lt()),Ot(x,this.relativeTarget)),g&&(this.animationValues=u,Ah(u,l,this.latestValues,w,b,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(ee(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Q.update(()=>{In.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ce(0)),this.currentAnimation=Oh(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(Fh),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=r;if(!(!a||!c||!l)){if(this!==r&&this.layout&&l&&Uc(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||lt();const f=xt(this.layout.layoutBox.x);c.x.min=r.target.x.min,c.x.max=c.x.min+f;const d=xt(this.layout.layoutBox.y);c.y.min=r.target.y.min,c.y.max=c.y.min+d}Ot(a,c),Te(a,u),Xe(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new kh),this.sharedNodes.get(r).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.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:c}={}){const l=this.getStack();l&&l.promote(this,c),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:c}=r;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&Es("z",r,l,this.animationValues);for(let u=0;u<Ss.length;u++)Es(`rotate${Ss[u]}`,r,l,this.animationValues),Es(`skew${Ss[u]}`,r,l,this.animationValues);r.render();for(const u in l)r.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);r.scheduleRender()}applyProjectionStyles(r,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){r.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,r.visibility="",r.opacity="",r.pointerEvents=On(a?.pointerEvents)||"",r.transform=c?c(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(r.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,r.pointerEvents=On(a?.pointerEvents)||""),this.hasProjected&&!le(this.latestValues)&&(r.transform=c?c({},""):"none",this.hasProjected=!1);return}r.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let f=Ch(this.projectionDeltaWithTransform,this.treeScale,u);c&&(f=c(u,f)),r.transform=f;const{x:d,y:h}=this.projectionDelta;r.transformOrigin=`${d.origin*100}% ${h.origin*100}% 0`,l.animationValues?r.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:r.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const m in ci){if(u[m]===void 0)continue;const{correct:g,applyTo:v,isCSSVariable:y}=ci[m],b=f==="none"?u[m]:g(u[m],l);if(v){const x=v.length;for(let T=0;T<x;T++)r[v[T]]=b}else y?this.options.visualElement.renderState.vars[m]=b:r[m]=b}this.options.layoutId&&(r.pointerEvents=l===this?On(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>r.currentAnimation?.stop()),this.root.nodes.forEach(wo),this.root.sharedNodes.clear()}}}function Nh(t){t.updateLayout()}function jh(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"?Ct(u=>{const f=o?e.measuredBox[u]:e.layoutBox[u],d=xt(f);f.min=n[u].min,f.max=f.min+d}):Uc(i,e.layoutBox,n)&&Ct(u=>{const f=o?e.measuredBox[u]:e.layoutBox[u],d=xt(n[u]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[u].max=t.relativeTarget[u].min+d)});const r=be();Xe(r,n,e.layoutBox);const a=be();o?Xe(a,t.applyTransform(s,!0),e.measuredBox):Xe(a,n,e.layoutBox);const c=!Lc(r);let l=!1;if(!t.resumeFrom){const u=t.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:f,layout:d}=u;if(f&&d){const h=lt();Hn(h,e.layoutBox,f.layoutBox);const m=lt();Hn(m,n,d.layoutBox),kc(h,m)||(l=!0),u.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=h,t.relativeParent=u)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function Uh(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 Wh(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function $h(t){t.clearSnapshot()}function wo(t){t.clearMeasurements()}function So(t){t.isLayoutDirty=!1}function Hh(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Eo(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function _h(t){t.resolveTargetDelta()}function Kh(t){t.calcProjection()}function zh(t){t.resetSkewAndRotation()}function Yh(t){t.removeLeadSnapshot()}function Ro(t,e,n){t.translate=J(e.translate,0,n),t.scale=J(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Co(t,e,n,s){t.min=J(e.min,n.min,s),t.max=J(e.max,n.max,s)}function Xh(t,e,n,s){Co(t.x,e.x,n.x,s),Co(t.y,e.y,n.y,s)}function Gh(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const qh={duration:.45,ease:[.4,0,.1,1]},Po=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ao=Po("applewebkit/")&&!Po("chrome/")?Math.round:Mt;function Mo(t){t.min=Ao(t.min),t.max=Ao(t.max)}function Qh(t){Mo(t.x),Mo(t.y)}function Uc(t,e,n){return t==="position"||t==="preserve-aspect"&&!xh(yo(e),yo(n),.2)}function Zh(t){return t!==t.root&&t.scroll?.wasRoot}const Jh=jc({attachResizeListener:(t,e)=>nn(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Rs={current:void 0},Wc=jc({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Rs.current){const t=new Jh({});t.mount(window),t.setOptions({layoutScroll:!0}),Rs.current=t}return Rs.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Zi=p.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Do(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function tp(...t){return e=>{let n=!1;const s=t.map(i=>{const o=Do(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():Do(t[i],null)}}}}function ep(...t){return p.useCallback(tp(...t),t)}class np extends p.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=n.offsetParent,i=ii(s)&&s.offsetWidth||0,o=ii(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 sp({children:t,isPresent:e,anchorX:n,anchorY:s,root:i}){const o=p.useId(),r=p.useRef(null),a=p.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=p.useContext(Zi),l=t.props?.ref??t?.ref,u=ep(r,l);return p.useInsertionEffect(()=>{const{width:f,height:d,top:h,left:m,right:g,bottom:v}=a.current;if(e||!r.current||!f||!d)return;const y=n==="left"?`left: ${m}`:`right: ${g}`,b=s==="bottom"?`bottom: ${v}`:`top: ${h}`;r.current.dataset.motionPopId=o;const x=document.createElement("style");c&&(x.nonce=c);const T=i??document.head;return T.appendChild(x),x.sheet&&x.sheet.insertRule(`
2
- [data-motion-pop-id="${o}"] {
3
- position: absolute !important;
4
- width: ${f}px !important;
5
- height: ${d}px !important;
6
- ${y}px !important;
7
- ${b}px !important;
8
- }
9
- `),()=>{T.contains(x)&&T.removeChild(x)}},[e]),X.jsx(np,{isPresent:e,childRef:r,sizeRef:a,children:p.cloneElement(t,{ref:u})})}const ip=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:o,mode:r,anchorX:a,anchorY:c,root:l})=>{const u=Ei(rp),f=p.useId();let d=!0,h=p.useMemo(()=>(d=!1,{id:f,initial:e,isPresent:n,custom:i,onExitComplete:m=>{u.set(m,!0);for(const g of u.values())if(!g)return;s&&s()},register:m=>(u.set(m,!1),()=>u.delete(m))}),[n,u,s]);return o&&d&&(h={...h}),p.useMemo(()=>{u.forEach((m,g)=>u.set(g,!1))},[n]),p.useEffect(()=>{!n&&!u.size&&s&&s()},[n]),r==="popLayout"&&(t=X.jsx(sp,{isPresent:n,anchorX:a,anchorY:c,root:l,children:t})),X.jsx(ns.Provider,{value:h,children:t})};function rp(){return new Map}function $c(t=!0){const e=p.useContext(ns);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,o=p.useId();p.useEffect(()=>{if(t)return i(o)},[t]);const r=p.useCallback(()=>t&&s&&s(o),[o,s,t]);return!n&&s?[!1,r]:[!0]}const wn=t=>t.key||"";function Oo(t){const e=[];return p.Children.forEach(t,n=>{p.isValidElement(n)&&e.push(n)}),e}const Jv=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:o="sync",propagate:r=!1,anchorX:a="left",anchorY:c="top",root:l})=>{const[u,f]=$c(r),d=p.useMemo(()=>Oo(t),[t]),h=r&&!u?[]:d.map(wn),m=p.useRef(!0),g=p.useRef(d),v=Ei(()=>new Map),y=p.useRef(new Set),[b,x]=p.useState(d),[T,w]=p.useState(d);xa(()=>{m.current=!1,g.current=d;for(let S=0;S<T.length;S++){const D=wn(T[S]);h.includes(D)?(v.delete(D),y.current.delete(D)):v.get(D)!==!0&&v.set(D,!1)}},[T,h.length,h.join("-")]);const E=[];if(d!==b){let S=[...d];for(let D=0;D<T.length;D++){const O=T[D],k=wn(O);h.includes(k)||(S.splice(D,0,O),E.push(O))}return o==="wait"&&E.length&&(S=E),w(Oo(S)),x(d),null}const{forceRender:R}=p.useContext(Si);return X.jsx(X.Fragment,{children:T.map(S=>{const D=wn(S),O=r&&!u?!1:d===T||h.includes(D),k=()=>{if(y.current.has(D))return;if(y.current.add(D),v.has(D))v.set(D,!0);else return;let M=!0;v.forEach(C=>{C||(M=!1)}),M&&(R?.(),w(g.current),r&&f?.(),s&&s())};return X.jsx(ip,{isPresent:O,initial:!m.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:o,root:l,onExitComplete:O?void 0:k,anchorX:a,anchorY:c,children:S},D)})})},Hc=p.createContext({strict:!1}),Io={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 Vo=!1;function op(){if(Vo)return;const t={};for(const e in Io)t[e]={isEnabled:n=>Io[e].some(s=>!!n[s])};vc(t),Vo=!0}function _c(){return op(),zd()}function ap(t){const e=_c();for(const n in t)e[n]={...e[n],...t[n]};vc(e)}const cp=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 _n(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||cp.has(t)}let Kc=t=>!_n(t);function lp(t){typeof t=="function"&&(Kc=e=>e.startsWith("on")?!_n(e):t(e))}try{lp(require("@emotion/is-prop-valid").default)}catch{}function up(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(Kc(i)||n===!0&&_n(i)||!e&&!_n(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const rs=p.createContext({});function fp(t,e){if(is(t)){const{initial:n,animate:s}=t;return{initial:n===!1||en(n)?n:void 0,animate:en(s)?s:void 0}}return t.inherit!==!1?e:{}}function dp(t){const{initial:e,animate:n}=fp(t,p.useContext(rs));return p.useMemo(()=>({initial:e,animate:n}),[Lo(e),Lo(n)])}function Lo(t){return Array.isArray(t)?t.join(" "):t}const Ji=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function zc(t,e,n){for(const s in e)!pt(e[s])&&!Rc(s,n)&&(t[s]=e[s])}function hp({transformTemplate:t},e){return p.useMemo(()=>{const n=Ji();return qi(n,e,t),Object.assign({},n.vars,n.style)},[e])}function pp(t,e){const n=t.style||{},s={};return zc(s,n,t),Object.assign(s,hp(t,e)),s}function mp(t,e){const n={},s=pp(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 Yc=()=>({...Ji(),attrs:{}});function gp(t,e,n,s){const i=p.useMemo(()=>{const o=Yc();return Cc(o,e,Ac(s),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};zc(o,t.style,t),i.style={...o,...i.style}}return i}const yp=["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 tr(t){return typeof t!="string"||t.includes("-")?!1:!!(yp.indexOf(t)>-1||/[A-Z]/u.test(t))}function vp(t,e,n,{latestValues:s},i,o=!1,r){const c=(r??tr(t)?gp:mp)(e,s,i,t),l=up(e,typeof t=="string",o),u=t!==p.Fragment?{...l,...c,ref:n}:{},{children:f}=e,d=p.useMemo(()=>pt(f)?f.get():f,[f]);return p.createElement(t,{...u,children:d})}function bp({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:xp(n,s,i,t),renderState:e()}}function xp(t,e,n,s){const i={},o=s(t,{});for(const d in o)i[d]=On(o[d]);let{initial:r,animate:a}=t;const c=is(t),l=yc(t);e&&l&&!c&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||r===!1;const f=u?a:r;if(f&&typeof f!="boolean"&&!ss(f)){const d=Array.isArray(f)?f:[f];for(let h=0;h<d.length;h++){const m=Hi(t,d[h]);if(m){const{transitionEnd:g,transition:v,...y}=m;for(const b in y){let x=y[b];if(Array.isArray(x)){const T=u?x.length-1:0;x=x[T]}x!==null&&(i[b]=x)}for(const b in g)i[b]=g[b]}}}return i}const Xc=t=>(e,n)=>{const s=p.useContext(rs),i=p.useContext(ns),o=()=>bp(t,e,s,i);return n?o():Ei(o)},Tp=Xc({scrapeMotionValuesFromProps:Qi,createRenderState:Ji}),wp=Xc({scrapeMotionValuesFromProps:Mc,createRenderState:Yc}),Sp=Symbol.for("motionComponentSymbol");function Ep(t,e,n){const s=p.useRef(n);p.useInsertionEffect(()=>{s.current=n});const i=p.useRef(null);return p.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 Gc=p.createContext({});function _e(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Rp(t,e,n,s,i,o){const{visualElement:r}=p.useContext(rs),a=p.useContext(Hc),c=p.useContext(ns),l=p.useContext(Zi).reducedMotion,u=p.useRef(null),f=p.useRef(!1);s=s||a.renderer,!u.current&&s&&(u.current=s(t,{visualState:e,parent:r,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:l,isSVG:o}),f.current&&u.current&&(u.current.manuallyAnimateOnMount=!0));const d=u.current,h=p.useContext(Gc);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&Cp(u.current,n,i,h);const m=p.useRef(!1);p.useInsertionEffect(()=>{d&&m.current&&d.update(n,c)});const g=n[sc],v=p.useRef(!!g&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return xa(()=>{f.current=!0,d&&(m.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),v.current&&d.animationState&&d.animationState.animateChanges())}),p.useEffect(()=>{d&&(!v.current&&d.animationState&&d.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),v.current=!1),d.enteringChildren=void 0)}),d}function Cp(t,e,n,s){const{layoutId:i,layout:o,drag:r,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:qc(t.parent)),t.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!r||a&&_e(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,crossfade:u,layoutScroll:c,layoutRoot:l})}function qc(t){if(t)return t.options.allowProjection!==!1?t.projection:qc(t.parent)}function Cs(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&ap(s);const o=n?n==="svg":tr(t),r=o?wp:Tp;function a(l,u){let f;const d={...p.useContext(Zi),...l,layoutId:Pp(l)},{isStatic:h}=d,m=dp(l),g=r(l,h);if(!h&&ba){Ap();const v=Mp(d);f=v.MeasureLayout,m.visualElement=Rp(t,g,d,i,v.ProjectionNode,o)}return X.jsxs(rs.Provider,{value:m,children:[f&&m.visualElement?X.jsx(f,{visualElement:m.visualElement,...d}):null,vp(t,l,Ep(g,m.visualElement,u),g,h,e,o)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=p.forwardRef(a);return c[Sp]=t,c}function Pp({layoutId:t}){const e=p.useContext(Si).id;return e&&t!==void 0?e+"-"+t:t}function Ap(t,e){p.useContext(Hc).strict}function Mp(t){const e=_c(),{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 Dp(t,e){if(typeof Proxy>"u")return Cs;const n=new Map,s=(o,r)=>Cs(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,Cs(r,void 0,t,e)),n.get(r))})}const Op=(t,e)=>e.isSVG??tr(t)?new lh(e):new sh(e,{allowProjection:t!==p.Fragment});class Ip extends ie{constructor(e){super(e),e.animationState||(e.animationState=ph(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();ss(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 Vp=0;class Lp extends ie{constructor(){super(...arguments),this.id=Vp++}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 kp={animation:{Feature:Ip},exit:{Feature:Lp}};function ln(t){return{point:{x:t.pageX,y:t.pageY}}}const Fp=t=>e=>Yi(e)&&t(e,ln(e));function Ge(t,e,n,s){return nn(t,e,Fp(n),s)}const Qc=({current:t})=>t?t.ownerDocument.defaultView:null,ko=(t,e)=>Math.abs(t-e);function Bp(t,e){const n=ko(t.x,e.x),s=ko(t.y,e.y);return Math.sqrt(n**2+s**2)}const Fo=new Set(["auto","scroll"]);class Zc{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=h=>{this.handleScroll(h.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=As(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=Bp(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:v}=h,{timestamp:y}=ft;this.history.push({...v,timestamp:y});const{onStart:b,onMove:x}=this.handlers;m||(b&&b(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,h)},this.handlePointerMove=(h,m)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=Ps(m,this.transformPagePoint),Q.update(this.updatePoint,!0)},this.handlePointerUp=(h,m)=>{this.end();const{onEnd:g,onSessionEnd:v,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=As(h.type==="pointercancel"?this.lastMoveEventInfo:Ps(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(h,b),v&&v(h,b)},!Yi(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=r,this.contextWindow=i||window;const c=ln(e),l=Ps(c,this.transformPagePoint),{point:u}=l,{timestamp:f}=ft;this.history=[{...u,timestamp:f}];const{onSessionStart:d}=n;d&&d(e,As(l,this.history)),this.removeListeners=on(Ge(this.contextWindow,"pointermove",this.handlePointerMove),Ge(this.contextWindow,"pointerup",this.handlePointerUp),Ge(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Fo.has(s.overflowX)||Fo.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),Q.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ee(this.updatePoint)}}function Ps(t,e){return e?{point:e(t.point)}:t}function Bo(t,e){return{x:t.x-e.x,y:t.y-e.y}}function As({point:t},e){return{point:t,delta:Bo(t,Jc(e)),offset:Bo(t,Np(e)),velocity:jp(e,.1)}}function Np(t){return t[0]}function Jc(t){return t[t.length-1]}function jp(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Jc(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>Kt(e)));)n--;if(!s)return{x:0,y:0};const o=Pt(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 Up(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?J(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?J(n,t,s.max):Math.min(t,n)),t}function No(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 Wp(t,{top:e,left:n,bottom:s,right:i}){return{x:No(t.x,n,i),y:No(t.y,e,s)}}function jo(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 $p(t,e){return{x:jo(t.x,e.x),y:jo(t.y,e.y)}}function Hp(t,e){let n=.5;const s=xt(t),i=xt(e);return i>s?n=Ze(e.min,e.max-s,t.min):s>i&&(n=Ze(t.min,t.max-i,e.min)),Wt(0,1,n)}function _p(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 li=.35;function Kp(t=li){return t===!1?t=0:t===!0&&(t=li),{x:Uo(t,"left","right"),y:Uo(t,"top","bottom")}}function Uo(t,e,n){return{min:Wo(t,e),max:Wo(t,n)}}function Wo(t,e){return typeof t=="number"?t:t[e]||0}const zp=new WeakMap;class Yp{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=lt(),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=f=>{n?(this.stopAnimation(),this.snapToCursor(ln(f).point)):this.pauseAnimation()},r=(f,d)=>{this.stopAnimation();const{drag:h,dragPropagation:m,onDragStart:g}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ld(h),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ct(y=>{let b=this.getAxisMotionValue(y).get()||0;if(jt.test(b)){const{projection:x}=this.visualElement;if(x&&x.layout){const T=x.layout.layoutBox[y];T&&(b=xt(T)*(parseFloat(b)/100))}}this.originPoint[y]=b}),g&&Q.postRender(()=>g(f,d)),ei(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d;const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:g,onDrag:v}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:y}=d;if(m&&this.currentDirection===null){this.currentDirection=Xp(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",d.point,y),this.updateAxis("y",d.point,y),this.visualElement.render(),v&&v(f,d)},c=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d,this.stop(f,d),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>Ct(f=>this.getAnimationState(f)==="paused"&&this.getAxisMotionValue(f).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Zc(e,{onSessionStart:o,onStart:r,onMove:a,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:s,contextWindow:Qc(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&&Q.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||!Sn(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=Up(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&&_e(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=Wp(s.layoutBox,e):this.constraints=!1,this.elastic=Kp(n),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Ct(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=_p(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!_e(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Qd(s,i.root,this.visualElement.getTransformPagePoint());let r=$p(i.layout.layoutBox,o);if(n){const a=n(Xd(r));this.hasMutatedConstraints=!!a,a&&(r=xc(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Ct(u=>{if(!Sn(u,n,this.currentDirection))return;let f=c&&c[u]||{};r&&(f={min:0,max:0});const d=i?200:1e6,h=i?40:1e7,m={type:"inertia",velocity:s?e[u]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...f};return this.startAxisValueAnimation(u,m)});return Promise.all(l).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return ei(this.visualElement,e),s.start($i(e,s,0,n,this.visualElement,!1))}stopAnimation(){Ct(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Ct(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){Ct(n=>{const{drag:s}=this.getProps();if(!Sn(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],c=o.get()||0;o.set(e[n]-J(r,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!_e(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ct(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const c=a.get();i[r]=Hp({min:c,max:c},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(),Ct(r=>{if(!Sn(r,e,null))return;const a=this.getAxisMotionValue(r),{min:c,max:l}=this.constraints[r];a.set(J(c,l,i[r]))})}addListeners(){if(!this.visualElement.current)return;zp.set(this.visualElement,this);const e=this.visualElement.current,n=Ge(e,"pointerdown",c=>{const{drag:l,dragListener:u=!0}=this.getProps(),f=c.target,d=f!==e&&pc(f);l&&u&&!d&&this.start(c)}),s=()=>{const{dragConstraints:c}=this.getProps();_e(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Q.read(s);const r=nn(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(Ct(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=c[u].translate,f.set(f.get()+c[u].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=li,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function Sn(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Xp(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Gp extends ie{constructor(e){super(e),this.removeGroupControls=Mt,this.removeListeners=Mt,this.controls=new Yp(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Mt}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 $o=t=>(e,n)=>{t&&Q.postRender(()=>t(e,n))};class qp extends ie{constructor(){super(...arguments),this.removePointerDownListener=Mt}onPointerDown(e){this.session=new Zc(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Qc(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:$o(e),onStart:$o(n),onMove:s,onEnd:(o,r)=>{delete this.session,i&&Q.postRender(()=>i(o,r))}}}mount(){this.removePointerDownListener=Ge(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 Ms=!1;class Qp extends p.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),Ms&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),In.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}),Ms=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==o?r.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?r.promote():r.relegate()||Q.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),zi.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;Ms=!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 tl(t){const[e,n]=$c(),s=p.useContext(Si);return X.jsx(Qp,{...t,layoutGroup:s,switchLayoutGroup:p.useContext(Gc),isPresent:e,safeToRemove:n})}const Zp={pan:{Feature:qp},drag:{Feature:Gp,ProjectionNode:Wc,MeasureLayout:tl}};function Ho(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&&Q.postRender(()=>o(e,ln(e)))}class Jp extends ie{mount(){const{current:e}=this.node;e&&(this.unmount=kd(e,(n,s)=>(Ho(this.node,s,"Start"),i=>Ho(this.node,i,"End"))))}unmount(){}}class tm extends ie{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=on(nn(this.node.current,"focus",()=>this.onFocus()),nn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function _o(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&&Q.postRender(()=>o(e,ln(e)))}class em extends ie{mount(){const{current:e}=this.node;e&&(this.unmount=Nd(e,(n,s)=>(_o(this.node,s,"Start"),(i,{success:o})=>_o(this.node,i,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ui=new WeakMap,Ds=new WeakMap,nm=t=>{const e=ui.get(t.target);e&&e(t)},sm=t=>{t.forEach(nm)};function im({root:t,...e}){const n=t||document;Ds.has(n)||Ds.set(n,{});const s=Ds.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(sm,{root:t,...e})),s[i]}function rm(t,e,n){const s=im(e);return ui.set(t,n),s.observe(t),()=>{ui.delete(t),s.unobserve(t)}}const om={some:0,all:1};class am extends ie{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:om[i]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,o&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),d=l?u:f;d&&d(c)};return rm(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(cm(e,n))&&this.startObserver()}unmount(){}}function cm({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const lm={inView:{Feature:am},tap:{Feature:em},focus:{Feature:tm},hover:{Feature:Jp}},um={layout:{ProjectionNode:Wc,MeasureLayout:tl}},fm={...kp,...lm,...Zp,...um},tb=Dp(fm,Op),dm=()=>{},G=typeof document<"u"?p.useLayoutEffect:dm,el=p.createContext(void 0);function os(t){const e=p.useContext(el);if(e===void 0&&!t)throw new Error(De(72));return e}const hm=[];function nl(t){p.useEffect(t,hm)}const $e=0;class Le{static create(){return new Le}currentId=$e;start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=$e,n()},e)}isStarted(){return this.currentId!==$e}clear=()=>{this.currentId!==$e&&(clearTimeout(this.currentId),this.currentId=$e)};disposeEffect=()=>this.clear}function Pe(){const t=se(Le.create).current;return nl(t.disposeEffect),t}function as(){return typeof window<"u"}function ke(t){return er(t)?(t.nodeName||"").toLowerCase():"#document"}function mt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function $t(t){var e;return(e=(er(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function er(t){return as()?t instanceof Node||t instanceof mt(t).Node:!1}function Y(t){return as()?t instanceof Element||t instanceof mt(t).Element:!1}function St(t){return as()?t instanceof HTMLElement||t instanceof mt(t).HTMLElement:!1}function fi(t){return!as()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof mt(t).ShadowRoot}const pm=new Set(["inline","contents"]);function un(t){const{overflow:e,overflowX:n,overflowY:s,display:i}=Dt(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&!pm.has(i)}const mm=new Set(["table","td","th"]);function gm(t){return mm.has(ke(t))}const ym=[":popover-open",":modal"];function cs(t){return ym.some(e=>{try{return t.matches(e)}catch{return!1}})}const vm=["transform","translate","scale","rotate","perspective"],bm=["transform","translate","scale","rotate","perspective","filter"],xm=["paint","layout","strict","content"];function nr(t){const e=ls(),n=Y(t)?Dt(t):t;return vm.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||bm.some(s=>(n.willChange||"").includes(s))||xm.some(s=>(n.contain||"").includes(s))}function Tm(t){let e=Xt(t);for(;St(e)&&!zt(e);){if(nr(e))return e;if(cs(e))return null;e=Xt(e)}return null}function ls(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const wm=new Set(["html","body","#document"]);function zt(t){return wm.has(ke(t))}function Dt(t){return mt(t).getComputedStyle(t)}function us(t){return Y(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Xt(t){if(ke(t)==="html")return t;const e=t.assignedSlot||t.parentNode||fi(t)&&t.host||$t(t);return fi(e)?e.host:e}function sl(t){const e=Xt(t);return zt(e)?t.ownerDocument?t.ownerDocument.body:t.body:St(e)&&un(e)?e:sl(e)}function te(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=sl(t),o=i===((s=t.ownerDocument)==null?void 0:s.body),r=mt(i);if(o){const a=di(r);return e.concat(r,r.visualViewport||[],un(i)?i:[],a&&n?te(a):[])}return e.concat(i,te(i,[],n))}function di(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ee(t){const e=se(Sm,t).current;return e.next=t,G(e.effect),e}function Sm(t){const e={current:t,next:t,effect:()=>{e.current=e.next}};return e}const Os=ma[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Em=Os&&Os!==p.useLayoutEffect?Os:t=>t();function U(t){const e=se(Rm).current;return e.next=t,Em(e.effect),e.trampoline}function Rm(){const t={next:void 0,callback:Cm,trampoline:(...e)=>t.callback?.(...e),effect:()=>{t.callback=t.next}};return t}function Cm(){}const Fe=typeof navigator<"u",Is=Am(),il=Dm(),rl=Mm(),eb=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),nb=Is.platform==="MacIntel"&&Is.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Is.platform),ol=Fe&&/apple/i.test(navigator.vendor),hi=Fe&&/android/i.test(il)||/android/i.test(rl),Pm=Fe&&il.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,al=rl.includes("jsdom/");function Am(){if(!Fe)return{platform:"",maxTouchPoints:-1};const t=navigator.userAgentData;return t?.platform?{platform:t.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Mm(){if(!Fe)return"";const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(({brand:e,version:n})=>`${e}/${n}`).join(" "):navigator.userAgent}function Dm(){if(!Fe)return"";const t=navigator.userAgentData;return t?.platform?t.platform:navigator.platform??""}const pi="data-base-ui-focusable",cl="active",ll="selected",ul="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",sb="ArrowLeft",ib="ArrowRight",rb="ArrowUp",ob="ArrowDown";function mi(t){let e=t.activeElement;for(;e?.shadowRoot?.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function dt(t,e){if(!t||!e)return!1;const n=e.getRootNode?.();if(t.contains(e))return!0;if(n&&fi(n)){let s=e;for(;s;){if(t===s)return!0;s=s.parentNode||s.host}}return!1}function Bt(t){return"composedPath"in t?t.composedPath()[0]:t.target}function It(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function Om(t){return t.matches("html,body")}function kt(t){return t?.ownerDocument||document}function fl(t){return St(t)&&t.matches(ul)}function ab(t){return t?t.getAttribute("role")==="combobox"&&fl(t):!1}function Im(t){if(!t||al)return!0;try{return t.matches(":focus-visible")}catch{return!0}}function cb(t){return t?t.hasAttribute(pi)?t:t.querySelector(`[${pi}]`)||t:null}function qe(t,e,n=!0){return t.filter(i=>i.parentId===e&&(!n||i.context?.open)).flatMap(i=>[i,...qe(t,i.id,n)])}function lb(t,e){let n=[],s=t.find(i=>i.id===e)?.parentId;for(;s;){const i=t.find(o=>o.id===s);s=i?.parentId,i&&(n=n.concat(i))}return n}function ub(t){t.preventDefault(),t.stopPropagation()}function Vm(t){return"nativeEvent"in t}function fb(t){return t.mozInputSource===0&&t.isTrusted?!0:hi&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function db(t){return al?!1:!hi&&t.width===0&&t.height===0||hi&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function sn(t,e){const n=["mouse","pen"];return e||n.push("",void 0),n.includes(t)}function Lm(t){const e=t.type;return e==="click"||e==="mousedown"||e==="keydown"||e==="keyup"}const km=["top","right","bottom","left"],Ae=Math.min,Et=Math.max,Kn=Math.round,En=Math.floor,Ut=t=>({x:t,y:t}),Fm={left:"right",right:"left",bottom:"top",top:"bottom"},Bm={start:"end",end:"start"};function gi(t,e,n){return Et(t,Ae(e,n))}function Gt(t,e){return typeof t=="function"?t(e):t}function wt(t){return t.split("-")[0]}function re(t){return t.split("-")[1]}function sr(t){return t==="x"?"y":"x"}function ir(t){return t==="y"?"height":"width"}const Nm=new Set(["top","bottom"]);function At(t){return Nm.has(wt(t))?"y":"x"}function rr(t){return sr(At(t))}function jm(t,e,n){n===void 0&&(n=!1);const s=re(t),i=rr(t),o=ir(i);let r=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(r=zn(r)),[r,zn(r)]}function Um(t){const e=zn(t);return[yi(t),e,yi(e)]}function yi(t){return t.replace(/start|end/g,e=>Bm[e])}const Ko=["left","right"],zo=["right","left"],Wm=["top","bottom"],$m=["bottom","top"];function Hm(t,e,n){switch(t){case"top":case"bottom":return n?e?zo:Ko:e?Ko:zo;case"left":case"right":return e?Wm:$m;default:return[]}}function _m(t,e,n,s){const i=re(t);let o=Hm(wt(t),n==="start",s);return i&&(o=o.map(r=>r+"-"+i),e&&(o=o.concat(o.map(yi)))),o}function zn(t){return t.replace(/left|right|bottom|top/g,e=>Fm[e])}function Km(t){return{top:0,right:0,bottom:0,left:0,...t}}function dl(t){return typeof t!="number"?Km(t):{top:t,right:t,bottom:t,left:t}}function Yn(t){const{x:e,y:n,width:s,height:i}=t;return{width:s,height:i,top:n,left:e,right:e+s,bottom:n+i,x:e,y:n}}var zm=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Xn=zm.join(","),hl=typeof Element>"u",Me=hl?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Gn=!hl&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},qn=function(e,n){var s;n===void 0&&(n=!0);var i=e==null||(s=e.getAttribute)===null||s===void 0?void 0:s.call(e,"inert"),o=i===""||i==="true",r=o||n&&e&&(typeof e.closest=="function"?e.closest("[inert]"):qn(e.parentNode));return r},Ym=function(e){var n,s=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return s===""||s==="true"},pl=function(e,n,s){if(qn(e))return[];var i=Array.prototype.slice.apply(e.querySelectorAll(Xn));return n&&Me.call(e,Xn)&&i.unshift(e),i=i.filter(s),i},Qn=function(e,n,s){for(var i=[],o=Array.from(e);o.length;){var r=o.shift();if(!qn(r,!1))if(r.tagName==="SLOT"){var a=r.assignedElements(),c=a.length?a:r.children,l=Qn(c,!0,s);s.flatten?i.push.apply(i,l):i.push({scopeParent:r,candidates:l})}else{var u=Me.call(r,Xn);u&&s.filter(r)&&(n||!e.includes(r))&&i.push(r);var f=r.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(r),d=!qn(f,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(r));if(f&&d){var h=Qn(f===!0?r.children:f.children,!0,s);s.flatten?i.push.apply(i,h):i.push({scopeParent:r,candidates:h})}else o.unshift.apply(o,r.children)}}return i},ml=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},gl=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Ym(e))&&!ml(e)?0:e.tabIndex},Xm=function(e,n){var s=gl(e);return s<0&&n&&!ml(e)?0:s},Gm=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},yl=function(e){return e.tagName==="INPUT"},qm=function(e){return yl(e)&&e.type==="hidden"},Qm=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(s){return s.tagName==="SUMMARY"});return n},Zm=function(e,n){for(var s=0;s<e.length;s++)if(e[s].checked&&e[s].form===n)return e[s]},Jm=function(e){if(!e.name)return!0;var n=e.form||Gn(e),s=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=s(window.CSS.escape(e.name));else try{i=s(e.name)}catch(r){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",r.message),!1}var o=Zm(i,e.form);return!o||o===e},tg=function(e){return yl(e)&&e.type==="radio"},eg=function(e){return tg(e)&&!Jm(e)},ng=function(e){var n,s=e&&Gn(e),i=(n=s)===null||n===void 0?void 0:n.host,o=!1;if(s&&s!==e){var r,a,c;for(o=!!((r=i)!==null&&r!==void 0&&(a=r.ownerDocument)!==null&&a!==void 0&&a.contains(i)||e!=null&&(c=e.ownerDocument)!==null&&c!==void 0&&c.contains(e));!o&&i;){var l,u,f;s=Gn(i),i=(l=s)===null||l===void 0?void 0:l.host,o=!!((u=i)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(i))}}return o},Yo=function(e){var n=e.getBoundingClientRect(),s=n.width,i=n.height;return s===0&&i===0},sg=function(e,n){var s=n.displayCheck,i=n.getShadowRoot;if(s==="full-native"&&"checkVisibility"in e){var o=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(e).visibility==="hidden")return!0;var r=Me.call(e,"details>summary:first-of-type"),a=r?e.parentElement:e;if(Me.call(a,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="full-native"||s==="legacy-full"){if(typeof i=="function"){for(var c=e;e;){var l=e.parentElement,u=Gn(e);if(l&&!l.shadowRoot&&i(l)===!0)return Yo(e);e.assignedSlot?e=e.assignedSlot:!l&&u!==e.ownerDocument?e=u.host:e=l}e=c}if(ng(e))return!e.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return Yo(e);return!1},ig=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var s=0;s<n.children.length;s++){var i=n.children.item(s);if(i.tagName==="LEGEND")return Me.call(n,"fieldset[disabled] *")?!0:!i.contains(e)}return!0}n=n.parentElement}return!1},vi=function(e,n){return!(n.disabled||qm(n)||sg(n,e)||Qm(n)||ig(n))},bi=function(e,n){return!(eg(n)||gl(n)<0||!vi(e,n))},rg=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},vl=function(e){var n=[],s=[];return e.forEach(function(i,o){var r=!!i.scopeParent,a=r?i.scopeParent:i,c=Xm(a,r),l=r?vl(i.candidates):a;c===0?r?n.push.apply(n,l):n.push(a):s.push({documentOrder:o,tabIndex:c,item:i,isScope:r,content:l})}),s.sort(Gm).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},or=function(e,n){n=n||{};var s;return n.getShadowRoot?s=Qn([e],n.includeContainer,{filter:bi.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:rg}):s=pl(e,n.includeContainer,bi.bind(null,n)),vl(s)},hb=function(e,n){n=n||{};var s;return n.getShadowRoot?s=Qn([e],n.includeContainer,{filter:vi.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=pl(e,n.includeContainer,vi.bind(null,n)),s},pb=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Me.call(e,Xn)===!1?!1:bi(n,e)};const ar=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function bl(t,e){const n=or(t,ar()),s=n.length;if(s===0)return;const i=mi(kt(t)),o=n.indexOf(i),r=o===-1?e===1?0:s-1:o+e;return n[r]}function og(t){return bl(kt(t).body,1)||t}function ag(t){return bl(kt(t).body,-1)||t}function xl(t,e){if(!t)return null;const n=or(kt(t).body,ar()),s=n.length;if(s===0)return null;const i=n.indexOf(t);if(i===-1)return null;const o=(i+e+s)%s;return n[o]}function mb(t){return xl(t,1)}function gb(t){return xl(t,-1)}function Vs(t,e){const n=e||t.currentTarget,s=t.relatedTarget;return!s||!dt(n,s)}function cg(t){or(t,ar()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Xo(t){t.querySelectorAll("[data-tabindex]").forEach(n=>{const s=n.dataset.tabindex;delete n.dataset.tabindex,s?n.setAttribute("tabindex",s):n.removeAttribute("tabindex")})}const lg={...ma};let Go=0;function ug(t,e="mui"){const[n,s]=p.useState(t),i=t||n;return p.useEffect(()=>{n==null&&(Go+=1,s(`${e}-${Go}`))},[n,e]),i}const qo=lg.useId;function fn(t,e){if(qo!==void 0){const n=qo();return t??(e?`${e}-${n}`:n)}return ug(t,e)}function Tl(){const t=new Map;return{emit(e,n){t.get(e)?.forEach(s=>s(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){t.get(e)?.delete(n)}}}class fg{nodesRef={current:[]};events=Tl();addNode(e){this.nodesRef.current.push(e)}removeNode(e){const n=this.nodesRef.current.findIndex(s=>s===e);n!==-1&&this.nodesRef.current.splice(n,1)}}const wl=p.createContext(null),Sl=p.createContext(null),dn=()=>p.useContext(wl)?.id||null,hn=t=>{const e=p.useContext(Sl);return t??e};function yb(t){const e=fn(),n=hn(t),s=dn();return G(()=>{if(!e)return;const i={id:e,parentId:s};return n?.addNode(i),()=>{n?.removeNode(i)}},[n,e,s]),e}function vb(t){const{children:e,id:n}=t,s=dn();return X.jsx(wl.Provider,{value:p.useMemo(()=>({id:n,parentId:s}),[n,s]),children:e})}function bb(t){const{children:e,externalTree:n}=t,s=se(()=>n??new fg).current;return X.jsx(Sl.Provider,{value:s,children:e})}const cr="none",Zn="trigger-press",Nt="trigger-hover",Vn="trigger-focus",dg="outside-press",xb="item-press",Tb="close-press",hg="focus-out",lr="escape-key",wb="list-navigation",Sb="cancel-open",Eb="sibling-open",pg="disabled",mg="imperative-action";function ot(t,e,n,s){let i=!1,o=!1;const r=s??we;return{reason:t,event:e??new Event("base-ui"),cancel(){i=!0},allowPropagation(){o=!0},get isCanceled(){return i},get isPropagationAllowed(){return o},trigger:n,...r}}function fs(t){return`data-base-ui-${t}`}function Ln(t,e,n){if(n&&!sn(n))return 0;if(typeof t=="number")return t;if(typeof t=="function"){const s=t();return typeof s=="number"?s:s?.[e]}return t?.[e]}const El=p.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Le,currentIdRef:{current:null},currentContextRef:{current:null}});function gg(t){const{children:e,delay:n,timeoutMs:s=0}=t,i=p.useRef(n),o=p.useRef(n),r=p.useRef(null),a=p.useRef(null),c=Pe();return X.jsx(El.Provider,{value:p.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:o,currentIdRef:r,timeoutMs:s,currentContextRef:a,timeout:c}),[s,c]),children:e})}function yg(t,e={open:!1}){const n="rootStore"in t?t.rootStore:t,s=n.useState("floatingId"),{enabled:i=!0,open:o}=e,r=p.useContext(El),{currentIdRef:a,delayRef:c,timeoutMs:l,initialDelayRef:u,currentContextRef:f,hasProvider:d,timeout:h}=r,[m,g]=p.useState(!1);return G(()=>{function v(){g(!1),f.current?.setIsInstantPhase(!1),a.current=null,f.current=null,c.current=u.current}if(i&&a.current&&!o&&a.current===s){if(g(!1),l){const y=s;return h.start(l,()=>{n.select("open")||a.current&&a.current!==y||v()}),()=>{h.clear()}}v()}},[i,o,s,a,c,l,u,f,h,n]),G(()=>{if(!i||!o)return;const v=f.current,y=a.current;h.clear(),f.current={onOpenChange:n.setOpen,setIsInstantPhase:g},a.current=s,c.current={open:0,close:Ln(u.current,"close")},y!==null&&y!==s?(g(!0),v?.setIsInstantPhase(!0),v?.onOpenChange(!1,ot(cr))):(g(!1),v?.setIsInstantPhase(!1))},[i,o,s,n,a,c,l,u,f,h]),G(()=>()=>{f.current=null},[f]),p.useMemo(()=>({hasProvider:d,delayRef:c,isInstantPhase:m}),[d,c,m])}const Rl={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},vg={...Rl,position:"fixed",top:0,left:0},Rb={...Rl,position:"absolute"},Rn=null;class bg{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;const n=this.callbacks,s=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,s>0)for(let i=0;i<n.length;i+=1)n[i]?.(e)};request(e){const n=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(e){const n=e-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Cn=new bg;class _t{static create(){return new _t}static request(e){return Cn.request(e)}static cancel(e){return Cn.cancel(e)}currentId=Rn;request(e){this.cancel(),this.currentId=Cn.request(()=>{this.currentId=Rn,e()})}cancel=()=>{this.currentId!==Rn&&(Cn.cancel(this.currentId),this.currentId=Rn)};disposeEffect=()=>this.cancel}function xg(){const t=se(_t.create).current;return nl(t.disposeEffect),t}function Cl(t){return t?.ownerDocument||document}const Qo=p.forwardRef(function(e,n){const[s,i]=p.useState();G(()=>{ol&&i("button")},[]);const o={tabIndex:0,role:s};return X.jsx("span",{...e,ref:n,style:vg,"aria-hidden":s?void 0:!0,...o,"data-base-ui-focus-guard":""})}),Pl=p.createContext(null),Tg=()=>p.useContext(Pl),wg=fs("portal");function Al(t={}){const{ref:e,container:n,componentProps:s=we,elementProps:i,elementState:o}=t,r=fn(),c=Tg()?.portalNode,[l,u]=p.useState(null),[f,d]=p.useState(null),h=U(y=>{y!==null&&d(y)}),m=p.useRef(null);G(()=>{if(n===null){m.current&&(m.current=null,d(null),u(null));return}if(r==null)return;const y=(n&&(er(n)?n:n.current))??c??document.body;if(y==null){m.current&&(m.current=null,d(null),u(null));return}m.current!==y&&(m.current=y,d(null),u(y))},[n,c,r]);const g=es("div",s,{ref:[e,h],state:o,props:[{id:r,[wg]:""},i]});return{portalNode:f,portalSubtree:l&&g?pe.createPortal(g,l):null}}const Cb=p.forwardRef(function(e,n){const{children:s,container:i,className:o,render:r,renderGuards:a,...c}=e,{portalNode:l,portalSubtree:u}=Al({container:i,ref:n,componentProps:e,elementProps:c}),f=p.useRef(null),d=p.useRef(null),h=p.useRef(null),m=p.useRef(null),[g,v]=p.useState(null),y=g?.modal,b=g?.open,x=typeof a=="boolean"?a:!!g&&!g.modal&&g.open&&!!l;p.useEffect(()=>{if(!l||y)return;function w(E){l&&E.relatedTarget&&Vs(E)&&(E.type==="focusin"?Xo:cg)(l)}return l.addEventListener("focusin",w,!0),l.addEventListener("focusout",w,!0),()=>{l.removeEventListener("focusin",w,!0),l.removeEventListener("focusout",w,!0)}},[l,y]),p.useEffect(()=>{!l||b||Xo(l)},[b,l]);const T=p.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:d,beforeInsideRef:h,afterInsideRef:m,portalNode:l,setFocusManagerState:v}),[l]);return X.jsxs(p.Fragment,{children:[u,X.jsxs(Pl.Provider,{value:T,children:[x&&l&&X.jsx(Qo,{"data-type":"outside",ref:f,onFocus:w=>{if(Vs(w,l))h.current?.focus();else{const E=g?g.domReference:null;ag(E)?.focus()}}}),x&&l&&X.jsx("span",{"aria-owns":l.id,style:Mu}),l&&pe.createPortal(s,l),x&&l&&X.jsx(Qo,{"data-type":"outside",ref:d,onFocus:w=>{if(Vs(w,l))m.current?.focus();else{const E=g?g.domReference:null;og(E)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,ot(hg,w.nativeEvent))}}})]})]})});function Sg(t){return t==null?t:"current"in t?t.current:t}function Eg(t,e){let n=null,s=null,i=!1;return{contextElement:t||void 0,getBoundingClientRect(){const o=t?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},r=e.axis==="x"||e.axis==="both",a=e.axis==="y"||e.axis==="both",c=["mouseenter","mousemove"].includes(e.dataRef.current.openEvent?.type||"")&&e.pointerType!=="touch";let l=o.width,u=o.height,f=o.x,d=o.y;return n==null&&e.x&&r&&(n=o.x-e.x),s==null&&e.y&&a&&(s=o.y-e.y),f-=n||0,d-=s||0,l=0,u=0,!i||c?(l=e.axis==="y"?o.width:0,u=e.axis==="x"?o.height:0,f=r&&e.x!=null?e.x:f,d=a&&e.y!=null?e.y:d):i&&!c&&(u=e.axis==="x"?o.height:u,l=e.axis==="y"?o.width:l),i=!0,{width:l,height:u,x:f,y:d,top:d,right:f+l,bottom:d+u,left:f}}}}function Zo(t){return t!=null&&t.clientX!=null}function Rg(t,e={}){const n="rootStore"in t?t.rootStore:t,s=n.useState("open"),i=n.useState("floatingElement"),o=n.useState("domReferenceElement"),r=n.context.dataRef,{enabled:a=!0,axis:c="both",x:l=null,y:u=null}=e,f=p.useRef(!1),d=p.useRef(null),[h,m]=p.useState(),[g,v]=p.useState([]),y=U((E,R,S)=>{f.current||r.current.openEvent&&!Zo(r.current.openEvent)||n.set("positionReference",Eg(S??o,{x:E,y:R,axis:c,dataRef:r,pointerType:h}))}),b=U(E=>{l!=null||u!=null||(s?d.current||v([]):y(E.clientX,E.clientY,E.currentTarget))}),x=sn(h)?i:s,T=p.useCallback(()=>{if(!x||!a||l!=null||u!=null)return;const E=mt(i);function R(S){const D=Bt(S);dt(i,D)?(E.removeEventListener("mousemove",R),d.current=null):y(S.clientX,S.clientY)}if(!r.current.openEvent||Zo(r.current.openEvent)){E.addEventListener("mousemove",R);const S=()=>{E.removeEventListener("mousemove",R),d.current=null};return d.current=S,S}n.set("positionReference",o)},[x,a,l,u,i,r,o,n,y]);p.useEffect(()=>T(),[T,g]),p.useEffect(()=>{a&&!i&&(f.current=!1)},[a,i]),p.useEffect(()=>{!a&&s&&(f.current=!0)},[a,s]),G(()=>{a&&(l!=null||u!=null)&&(f.current=!1,y(l,u))},[a,l,u,y]);const w=p.useMemo(()=>{function E(R){m(R.pointerType)}return{onPointerDown:E,onPointerEnter:E,onMouseMove:b,onMouseEnter:b}},[b]);return p.useMemo(()=>a?{reference:w,trigger:w}:{},[a,w])}function Jo(t,e,n){let{reference:s,floating:i}=t;const o=At(e),r=rr(e),a=ir(r),c=wt(e),l=o==="y",u=s.x+s.width/2-i.width/2,f=s.y+s.height/2-i.height/2,d=s[a]/2-i[a]/2;let h;switch(c){case"top":h={x:u,y:s.y-i.height};break;case"bottom":h={x:u,y:s.y+s.height};break;case"right":h={x:s.x+s.width,y:f};break;case"left":h={x:s.x-i.width,y:f};break;default:h={x:s.x,y:s.y}}switch(re(e)){case"start":h[r]-=d*(n&&l?-1:1);break;case"end":h[r]+=d*(n&&l?-1:1);break}return h}async function Cg(t,e){var n;e===void 0&&(e={});const{x:s,y:i,platform:o,rects:r,elements:a,strategy:c}=t,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Gt(e,t),m=dl(h),v=a[d?f==="floating"?"reference":"floating":f],y=Yn(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),b=f==="floating"?{x:s,y:i,width:r.floating.width,height:r.floating.height}:r.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),T=await(o.isElement==null?void 0:o.isElement(x))?await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1}:{x:1,y:1},w=Yn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:x,strategy:c}):b);return{top:(y.top-w.top+m.top)/T.y,bottom:(w.bottom-y.bottom+m.bottom)/T.y,left:(y.left-w.left+m.left)/T.x,right:(w.right-y.right+m.right)/T.x}}const Pg=async(t,e,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:o=[],platform:r}=n,a=o.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e));let l=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=Jo(l,s,c),d=s,h={},m=0;for(let v=0;v<a.length;v++){var g;const{name:y,fn:b}=a[v],{x,y:T,data:w,reset:E}=await b({x:u,y:f,initialPlacement:s,placement:d,strategy:i,middlewareData:h,rects:l,platform:{...r,detectOverflow:(g=r.detectOverflow)!=null?g:Cg},elements:{reference:t,floating:e}});u=x??u,f=T??f,h={...h,[y]:{...h[y],...w}},E&&m<=50&&(m++,typeof E=="object"&&(E.placement&&(d=E.placement),E.rects&&(l=E.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):E.rects),{x:u,y:f}=Jo(l,d,c)),v=-1)}return{x:u,y:f,placement:d,strategy:i,middlewareData:h}},Ag=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,s;const{placement:i,middlewareData:o,rects:r,initialPlacement:a,platform:c,elements:l}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...v}=Gt(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const y=wt(i),b=At(a),x=wt(a)===a,T=await(c.isRTL==null?void 0:c.isRTL(l.floating)),w=d||(x||!g?[zn(a)]:Um(a)),E=m!=="none";!d&&E&&w.push(..._m(a,g,m,T));const R=[a,...w],S=await c.detectOverflow(e,v),D=[];let O=((s=o.flip)==null?void 0:s.overflows)||[];if(u&&D.push(S[y]),f){const B=jm(i,r,T);D.push(S[B[0]],S[B[1]])}if(O=[...O,{placement:i,overflows:D}],!D.every(B=>B<=0)){var k,M;const B=(((k=o.flip)==null?void 0:k.index)||0)+1,F=R[B];if(F&&(!(f==="alignment"?b!==At(F):!1)||O.every(P=>At(P.placement)===b?P.overflows[0]>0:!0)))return{data:{index:B,overflows:O},reset:{placement:F}};let j=(M=O.filter(I=>I.overflows[0]<=0).sort((I,P)=>I.overflows[1]-P.overflows[1])[0])==null?void 0:M.placement;if(!j)switch(h){case"bestFit":{var C;const I=(C=O.filter(P=>{if(E){const L=At(P.placement);return L===b||L==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(L=>L>0).reduce((L,_)=>L+_,0)]).sort((P,L)=>P[1]-L[1])[0])==null?void 0:C[0];I&&(j=I);break}case"initialPlacement":j=a;break}if(i!==j)return{reset:{placement:j}}}return{}}}};function ta(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function ea(t){return km.some(e=>t[e]>=0)}const Mg=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:s}=e,{strategy:i="referenceHidden",...o}=Gt(t,e);switch(i){case"referenceHidden":{const r=await s.detectOverflow(e,{...o,elementContext:"reference"}),a=ta(r,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ea(a)}}}case"escaped":{const r=await s.detectOverflow(e,{...o,altBoundary:!0}),a=ta(r,n.floating);return{data:{escapedOffsets:a,escaped:ea(a)}}}default:return{}}}}},Ml=new Set(["left","top"]);async function Dg(t,e){const{placement:n,platform:s,elements:i}=t,o=await(s.isRTL==null?void 0:s.isRTL(i.floating)),r=wt(n),a=re(n),c=At(n)==="y",l=Ml.has(r)?-1:1,u=o&&c?-1:1,f=Gt(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),c?{x:h*u,y:d*l}:{x:d*l,y:h*u}}const Og=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,s;const{x:i,y:o,placement:r,middlewareData:a}=e,c=await Dg(e,t);return r===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:r}}}}},Ig=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:i,platform:o}=e,{mainAxis:r=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:b,y:x}=y;return{x:b,y:x}}},...l}=Gt(t,e),u={x:n,y:s},f=await o.detectOverflow(e,l),d=At(wt(i)),h=sr(d);let m=u[h],g=u[d];if(r){const y=h==="y"?"top":"left",b=h==="y"?"bottom":"right",x=m+f[y],T=m-f[b];m=gi(x,m,T)}if(a){const y=d==="y"?"top":"left",b=d==="y"?"bottom":"right",x=g+f[y],T=g-f[b];g=gi(x,g,T)}const v=c.fn({...e,[h]:m,[d]:g});return{...v,data:{x:v.x-n,y:v.y-s,enabled:{[h]:r,[d]:a}}}}}},Vg=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:s,placement:i,rects:o,middlewareData:r}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Gt(t,e),u={x:n,y:s},f=At(i),d=sr(f);let h=u[d],m=u[f];const g=Gt(a,e),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const x=d==="y"?"height":"width",T=o.reference[d]-o.floating[x]+v.mainAxis,w=o.reference[d]+o.reference[x]-v.mainAxis;h<T?h=T:h>w&&(h=w)}if(l){var y,b;const x=d==="y"?"width":"height",T=Ml.has(wt(i)),w=o.reference[f]-o.floating[x]+(T&&((y=r.offset)==null?void 0:y[f])||0)+(T?0:v.crossAxis),E=o.reference[f]+o.reference[x]+(T?0:((b=r.offset)==null?void 0:b[f])||0)-(T?v.crossAxis:0);m<w?m=w:m>E&&(m=E)}return{[d]:h,[f]:m}}}},Lg=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,s;const{placement:i,rects:o,platform:r,elements:a}=e,{apply:c=()=>{},...l}=Gt(t,e),u=await r.detectOverflow(e,l),f=wt(i),d=re(i),h=At(i)==="y",{width:m,height:g}=o.floating;let v,y;f==="top"||f==="bottom"?(v=f,y=d===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(y=f,v=d==="end"?"top":"bottom");const b=g-u.top-u.bottom,x=m-u.left-u.right,T=Ae(g-u[v],b),w=Ae(m-u[y],x),E=!e.middlewareData.shift;let R=T,S=w;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(S=x),(s=e.middlewareData.shift)!=null&&s.enabled.y&&(R=b),E&&!d){const O=Et(u.left,0),k=Et(u.right,0),M=Et(u.top,0),C=Et(u.bottom,0);h?S=m-2*(O!==0||k!==0?O+k:Et(u.left,u.right)):R=g-2*(M!==0||C!==0?M+C:Et(u.top,u.bottom))}await c({...e,availableWidth:S,availableHeight:R});const D=await r.getDimensions(a.floating);return m!==D.width||g!==D.height?{reset:{rects:!0}}:{}}}};function Dl(t){const e=Dt(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const i=St(t),o=i?t.offsetWidth:n,r=i?t.offsetHeight:s,a=Kn(n)!==o||Kn(s)!==r;return a&&(n=o,s=r),{width:n,height:s,$:a}}function ur(t){return Y(t)?t:t.contextElement}function Re(t){const e=ur(t);if(!St(e))return Ut(1);const n=e.getBoundingClientRect(),{width:s,height:i,$:o}=Dl(e);let r=(o?Kn(n.width):n.width)/s,a=(o?Kn(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const kg=Ut(0);function Ol(t){const e=mt(t);return!ls()||!e.visualViewport?kg:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Fg(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==mt(t)?!1:e}function he(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=ur(t);let r=Ut(1);e&&(s?Y(s)&&(r=Re(s)):r=Re(t));const a=Fg(o,n,s)?Ol(o):Ut(0);let c=(i.left+a.x)/r.x,l=(i.top+a.y)/r.y,u=i.width/r.x,f=i.height/r.y;if(o){const d=mt(o),h=s&&Y(s)?mt(s):s;let m=d,g=di(m);for(;g&&s&&h!==m;){const v=Re(g),y=g.getBoundingClientRect(),b=Dt(g),x=y.left+(g.clientLeft+parseFloat(b.paddingLeft))*v.x,T=y.top+(g.clientTop+parseFloat(b.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=x,l+=T,m=mt(g),g=di(m)}}return Yn({width:u,height:f,x:c,y:l})}function ds(t,e){const n=us(t).scrollLeft;return e?e.left+n:he($t(t)).left+n}function Il(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-ds(t,n),i=n.top+e.scrollTop;return{x:s,y:i}}function Bg(t){let{elements:e,rect:n,offsetParent:s,strategy:i}=t;const o=i==="fixed",r=$t(s),a=e?cs(e.floating):!1;if(s===r||a&&o)return n;let c={scrollLeft:0,scrollTop:0},l=Ut(1);const u=Ut(0),f=St(s);if((f||!f&&!o)&&((ke(s)!=="body"||un(r))&&(c=us(s)),St(s))){const h=he(s);l=Re(s),u.x=h.x+s.clientLeft,u.y=h.y+s.clientTop}const d=r&&!f&&!o?Il(r,c):Ut(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+d.x,y:n.y*l.y-c.scrollTop*l.y+u.y+d.y}}function Ng(t){return Array.from(t.getClientRects())}function jg(t){const e=$t(t),n=us(t),s=t.ownerDocument.body,i=Et(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),o=Et(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let r=-n.scrollLeft+ds(t);const a=-n.scrollTop;return Dt(s).direction==="rtl"&&(r+=Et(e.clientWidth,s.clientWidth)-i),{width:i,height:o,x:r,y:a}}const na=25;function Ug(t,e){const n=mt(t),s=$t(t),i=n.visualViewport;let o=s.clientWidth,r=s.clientHeight,a=0,c=0;if(i){o=i.width,r=i.height;const u=ls();(!u||u&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}const l=ds(s);if(l<=0){const u=s.ownerDocument,f=u.body,d=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,m=Math.abs(s.clientWidth-f.clientWidth-h);m<=na&&(o-=m)}else l<=na&&(o+=l);return{width:o,height:r,x:a,y:c}}const Wg=new Set(["absolute","fixed"]);function $g(t,e){const n=he(t,!0,e==="fixed"),s=n.top+t.clientTop,i=n.left+t.clientLeft,o=St(t)?Re(t):Ut(1),r=t.clientWidth*o.x,a=t.clientHeight*o.y,c=i*o.x,l=s*o.y;return{width:r,height:a,x:c,y:l}}function sa(t,e,n){let s;if(e==="viewport")s=Ug(t,n);else if(e==="document")s=jg($t(t));else if(Y(e))s=$g(e,n);else{const i=Ol(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Yn(s)}function Vl(t,e){const n=Xt(t);return n===e||!Y(n)||zt(n)?!1:Dt(n).position==="fixed"||Vl(n,e)}function Hg(t,e){const n=e.get(t);if(n)return n;let s=te(t,[],!1).filter(a=>Y(a)&&ke(a)!=="body"),i=null;const o=Dt(t).position==="fixed";let r=o?Xt(t):t;for(;Y(r)&&!zt(r);){const a=Dt(r),c=nr(r);!c&&a.position==="fixed"&&(i=null),(o?!c&&!i:!c&&a.position==="static"&&!!i&&Wg.has(i.position)||un(r)&&!c&&Vl(t,r))?s=s.filter(u=>u!==r):i=a,r=Xt(r)}return e.set(t,s),s}function _g(t){let{element:e,boundary:n,rootBoundary:s,strategy:i}=t;const r=[...n==="clippingAncestors"?cs(e)?[]:Hg(e,this._c):[].concat(n),s],a=r[0],c=r.reduce((l,u)=>{const f=sa(e,u,i);return l.top=Et(f.top,l.top),l.right=Ae(f.right,l.right),l.bottom=Ae(f.bottom,l.bottom),l.left=Et(f.left,l.left),l},sa(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Kg(t){const{width:e,height:n}=Dl(t);return{width:e,height:n}}function zg(t,e,n){const s=St(e),i=$t(e),o=n==="fixed",r=he(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const c=Ut(0);function l(){c.x=ds(i)}if(s||!s&&!o)if((ke(e)!=="body"||un(i))&&(a=us(e)),s){const h=he(e,!0,o,e);c.x=h.x+e.clientLeft,c.y=h.y+e.clientTop}else i&&l();o&&!s&&i&&l();const u=i&&!s&&!o?Il(i,a):Ut(0),f=r.left+a.scrollLeft-c.x-u.x,d=r.top+a.scrollTop-c.y-u.y;return{x:f,y:d,width:r.width,height:r.height}}function Ls(t){return Dt(t).position==="static"}function ia(t,e){if(!St(t)||Dt(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return $t(t)===n&&(n=n.ownerDocument.body),n}function Ll(t,e){const n=mt(t);if(cs(t))return n;if(!St(t)){let i=Xt(t);for(;i&&!zt(i);){if(Y(i)&&!Ls(i))return i;i=Xt(i)}return n}let s=ia(t,e);for(;s&&gm(s)&&Ls(s);)s=ia(s,e);return s&&zt(s)&&Ls(s)&&!nr(s)?n:s||Tm(t)||n}const Yg=async function(t){const e=this.getOffsetParent||Ll,n=this.getDimensions,s=await n(t.floating);return{reference:zg(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Xg(t){return Dt(t).direction==="rtl"}const Gg={convertOffsetParentRelativeRectToViewportRelativeRect:Bg,getDocumentElement:$t,getClippingRect:_g,getOffsetParent:Ll,getElementRects:Yg,getClientRects:Ng,getDimensions:Kg,getScale:Re,isElement:Y,isRTL:Xg};function kl(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function qg(t,e){let n=null,s;const i=$t(t);function o(){var a;clearTimeout(s),(a=n)==null||a.disconnect(),n=null}function r(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),o();const l=t.getBoundingClientRect(),{left:u,top:f,width:d,height:h}=l;if(a||e(),!d||!h)return;const m=En(f),g=En(i.clientWidth-(u+d)),v=En(i.clientHeight-(f+h)),y=En(u),x={rootMargin:-m+"px "+-g+"px "+-v+"px "+-y+"px",threshold:Et(0,Ae(1,c))||1};let T=!0;function w(E){const R=E[0].intersectionRatio;if(R!==c){if(!T)return r();R?r(!1,R):s=setTimeout(()=>{r(!1,1e-7)},1e3)}R===1&&!kl(l,t.getBoundingClientRect())&&r(),T=!1}try{n=new IntersectionObserver(w,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,x)}n.observe(t)}return r(!0),o}function ra(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,l=ur(t),u=i||o?[...l?te(l):[],...te(e)]:[];u.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const f=l&&a?qg(l,n):null;let d=-1,h=null;r&&(h=new ResizeObserver(y=>{let[b]=y;b&&b.target===l&&h&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(e)})),n()}),l&&!c&&h.observe(l),h.observe(e));let m,g=c?he(t):null;c&&v();function v(){const y=he(t);g&&!kl(g,y)&&n(),g=y,m=requestAnimationFrame(v)}return n(),()=>{var y;u.forEach(b=>{i&&b.removeEventListener("scroll",n),o&&b.removeEventListener("resize",n)}),f?.(),(y=h)==null||y.disconnect(),h=null,c&&cancelAnimationFrame(m)}}const Qg=Og,Zg=Ig,Jg=Ag,ty=Lg,ey=Mg,ny=Vg,sy=(t,e,n)=>{const s=new Map,i={platform:Gg,...n},o={...i.platform,_c:s};return Pg(t,e,{...i,platform:o})};var iy=typeof document<"u",ry=function(){},kn=iy?p.useLayoutEffect:ry;function Jn(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,s,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(s=n;s--!==0;)if(!Jn(t[s],e[s]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(e,i[s]))return!1;for(s=n;s--!==0;){const o=i[s];if(!(o==="_owner"&&t.$$typeof)&&!Jn(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function Fl(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function oa(t,e){const n=Fl(t);return Math.round(e*n)/n}function ks(t){const e=p.useRef(t);return kn(()=>{e.current=t}),e}function oy(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:s=[],platform:i,elements:{reference:o,floating:r}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[u,f]=p.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[d,h]=p.useState(s);Jn(d,s)||h(s);const[m,g]=p.useState(null),[v,y]=p.useState(null),b=p.useCallback(P=>{P!==E.current&&(E.current=P,g(P))},[]),x=p.useCallback(P=>{P!==R.current&&(R.current=P,y(P))},[]),T=o||m,w=r||v,E=p.useRef(null),R=p.useRef(null),S=p.useRef(u),D=c!=null,O=ks(c),k=ks(i),M=ks(l),C=p.useCallback(()=>{if(!E.current||!R.current)return;const P={placement:e,strategy:n,middleware:d};k.current&&(P.platform=k.current),sy(E.current,R.current,P).then(L=>{const _={...L,isPositioned:M.current!==!1};B.current&&!Jn(S.current,_)&&(S.current=_,pe.flushSync(()=>{f(_)}))})},[d,e,n,k,M]);kn(()=>{l===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[l]);const B=p.useRef(!1);kn(()=>(B.current=!0,()=>{B.current=!1}),[]),kn(()=>{if(T&&(E.current=T),w&&(R.current=w),T&&w){if(O.current)return O.current(T,w,C);C()}},[T,w,C,O,D]);const F=p.useMemo(()=>({reference:E,floating:R,setReference:b,setFloating:x}),[b,x]),j=p.useMemo(()=>({reference:T,floating:w}),[T,w]),I=p.useMemo(()=>{const P={position:n,left:0,top:0};if(!j.floating)return P;const L=oa(j.floating,u.x),_=oa(j.floating,u.y);return a?{...P,transform:"translate("+L+"px, "+_+"px)",...Fl(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:_}},[n,a,j.floating,u.x,u.y]);return p.useMemo(()=>({...u,update:C,refs:F,elements:j,floatingStyles:I}),[u,C,F,j,I])}const ay=(t,e)=>({...Qg(t),options:[t,e]}),cy=(t,e)=>({...Zg(t),options:[t,e]}),ly=(t,e)=>({...ny(t),options:[t,e]}),uy=(t,e)=>({...Jg(t),options:[t,e]}),fy=(t,e)=>({...ty(t),options:[t,e]}),dy=(t,e)=>({...ey(t),options:[t,e]}),hy={intentional:"onClick",sloppy:"onPointerDown"};function py(t){return{escapeKey:typeof t=="boolean"?t:t?.escapeKey??!1,outsidePress:typeof t=="boolean"?t:t?.outsidePress??!0}}function my(t,e={}){const n="rootStore"in t?t.rootStore:t,s=n.useState("open"),i=n.useState("floatingElement"),o=n.useState("referenceElement"),r=n.useState("domReferenceElement"),{onOpenChange:a,dataRef:c}=n.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:f=!0,outsidePressEvent:d="sloppy",referencePress:h=!1,referencePressEvent:m="sloppy",ancestorScroll:g=!1,bubbles:v,externalTree:y}=e,b=hn(y),x=U(typeof f=="function"?f:()=>!1),T=typeof f=="function"?x:f,w=p.useRef(!1),{escapeKey:E,outsidePress:R}=py(v),S=p.useRef(null),D=Pe(),O=Pe(),k=U(()=>{O.clear(),c.current.insideReactTree=!1}),M=p.useRef(!1),C=p.useRef(""),B=U(A=>{C.current=A.pointerType}),F=U(()=>{const A=C.current,K=A==="pen"||!A?"mouse":A,N=typeof d=="function"?d():d;return typeof N=="string"?N:N[K]}),j=U(A=>{if(!s||!l||!u||A.key!=="Escape"||M.current)return;const K=c.current.floatingContext?.nodeId,N=b?qe(b.nodesRef.current,K):[];if(!E&&N.length>0){let nt=!0;if(N.forEach(ct=>{ct.context?.open&&!ct.context.dataRef.current.__escapeKeyBubbles&&(nt=!1)}),!nt)return}const ht=Vm(A)?A.nativeEvent:A,H=ot(lr,ht);n.setOpen(!1,H),!E&&!H.isPropagationAllowed&&A.stopPropagation()}),I=U(A=>{const K=F();return K==="intentional"&&A.type!=="click"||K==="sloppy"&&A.type==="click"}),P=U(()=>{c.current.insideReactTree=!0,O.start(0,k)}),L=U((A,K=!1)=>{if(I(A)){k();return}if(c.current.insideReactTree){k();return}if(F()==="intentional"&&K||typeof T=="function"&&!T(A))return;const N=Bt(A),ht=`[${fs("inert")}]`,H=kt(n.select("floatingElement")).querySelectorAll(ht),nt=n.context.triggerElements;if(N&&(nt.hasElement(N)||nt.hasMatchingElement(ut=>dt(ut,N))))return;let ct=Y(N)?N:null;for(;ct&&!zt(ct);){const ut=Xt(ct);if(zt(ut)||!Y(ut))break;ct=ut}if(H.length&&Y(N)&&!Om(N)&&!dt(N,n.select("floatingElement"))&&Array.from(H).every(ut=>!dt(ct,ut)))return;if(St(N)&&!("touches"in A)){const ut=zt(N),Ht=Dt(N),Qt=/auto|scroll/,pn=ut||Qt.test(Ht.overflowX),mn=ut||Qt.test(Ht.overflowY),gn=pn&&N.clientWidth>0&&N.scrollWidth>N.clientWidth,je=mn&&N.clientHeight>0&&N.scrollHeight>N.clientHeight,yn=Ht.direction==="rtl",me=je&&(yn?A.offsetX<=N.offsetWidth-N.clientWidth:A.offsetX>N.clientWidth),ae=gn&&A.offsetY>N.clientHeight;if(me||ae)return}const Ne=c.current.floatingContext?.nodeId,qt=b&&qe(b.nodesRef.current,Ne).some(ut=>It(A,ut.context?.elements.floating));if(It(A,n.select("floatingElement"))||It(A,n.select("domReferenceElement"))||qt)return;const oe=b?qe(b.nodesRef.current,Ne):[];if(oe.length>0){let ut=!0;if(oe.forEach(Ht=>{Ht.context?.open&&!Ht.context.dataRef.current.__outsidePressBubbles&&(ut=!1)}),!ut)return}n.setOpen(!1,ot(dg,A)),k()}),_=U(A=>{F()!=="sloppy"||A.pointerType==="touch"||!n.select("open")||!l||It(A,n.select("floatingElement"))||It(A,n.select("domReferenceElement"))||L(A)}),W=U(A=>{if(F()!=="sloppy"||!n.select("open")||!l||It(A,n.select("floatingElement"))||It(A,n.select("domReferenceElement")))return;const K=A.touches[0];K&&(S.current={startTime:Date.now(),startX:K.clientX,startY:K.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{S.current&&(S.current.dismissOnTouchEnd=!1,S.current.dismissOnMouseDown=!1)}))}),at=U(A=>{const K=Bt(A);function N(){W(A),K?.removeEventListener(A.type,N)}K?.addEventListener(A.type,N)}),Z=U(A=>{const K=w.current;if(w.current=!1,D.clear(),A.type==="mousedown"&&S.current&&!S.current.dismissOnMouseDown)return;const N=Bt(A);function ht(){A.type==="pointerdown"?_(A):L(A,K),N?.removeEventListener(A.type,ht)}N?.addEventListener(A.type,ht)}),tt=U(A=>{if(F()!=="sloppy"||!S.current||It(A,n.select("floatingElement"))||It(A,n.select("domReferenceElement")))return;const K=A.touches[0];if(!K)return;const N=Math.abs(K.clientX-S.current.startX),ht=Math.abs(K.clientY-S.current.startY),H=Math.sqrt(N*N+ht*ht);H>5&&(S.current.dismissOnTouchEnd=!0),H>10&&(L(A),D.clear(),S.current=null)}),st=U(A=>{const K=Bt(A);function N(){tt(A),K?.removeEventListener(A.type,N)}K?.addEventListener(A.type,N)}),$=U(A=>{F()!=="sloppy"||!S.current||It(A,n.select("floatingElement"))||It(A,n.select("domReferenceElement"))||(S.current.dismissOnTouchEnd&&L(A),D.clear(),S.current=null)}),z=U(A=>{const K=Bt(A);function N(){$(A),K?.removeEventListener(A.type,N)}K?.addEventListener(A.type,N)});p.useEffect(()=>{if(!s||!l)return;c.current.__escapeKeyBubbles=E,c.current.__outsidePressBubbles=R;const A=new Le;function K(ct){n.setOpen(!1,ot(cr,ct))}function N(){A.clear(),M.current=!0}function ht(){A.start(ls()?5:0,()=>{M.current=!1})}const H=kt(i);H.addEventListener("pointerdown",B,!0),u&&(H.addEventListener("keydown",j),H.addEventListener("compositionstart",N),H.addEventListener("compositionend",ht)),T&&(H.addEventListener("click",Z,!0),H.addEventListener("pointerdown",Z,!0),H.addEventListener("touchstart",at,!0),H.addEventListener("touchmove",st,!0),H.addEventListener("touchend",z,!0),H.addEventListener("mousedown",Z,!0));let nt=[];return g&&(Y(r)&&(nt=te(r)),Y(i)&&(nt=nt.concat(te(i))),!Y(o)&&o&&o.contextElement&&(nt=nt.concat(te(o.contextElement)))),nt=nt.filter(ct=>ct!==H.defaultView?.visualViewport),nt.forEach(ct=>{ct.addEventListener("scroll",K,{passive:!0})}),()=>{H.removeEventListener("pointerdown",B,!0),u&&(H.removeEventListener("keydown",j),H.removeEventListener("compositionstart",N),H.removeEventListener("compositionend",ht)),T&&(H.removeEventListener("click",Z,!0),H.removeEventListener("pointerdown",Z,!0),H.removeEventListener("touchstart",at,!0),H.removeEventListener("touchmove",st,!0),H.removeEventListener("touchend",z,!0),H.removeEventListener("mousedown",Z,!0)),nt.forEach(ct=>{ct.removeEventListener("scroll",K)}),A.clear(),w.current=!1}},[c,i,o,r,u,T,s,a,g,l,E,R,j,L,Z,_,at,st,z,B,n]),p.useEffect(k,[T,k]);const gt=p.useMemo(()=>({onKeyDown:j,...h&&{[hy[m]]:A=>{n.setOpen(!1,ot(Zn,A.nativeEvent))},...m!=="intentional"&&{onClick(A){n.setOpen(!1,ot(Zn,A.nativeEvent))}}}}),[j,n,h,m]),yt=U(A=>{const K=Bt(A.nativeEvent);!dt(n.select("floatingElement"),K)||A.button!==0||(w.current=!0)}),vt=U(A=>{!s||!l||A.button!==0||(w.current=!0)}),Be=p.useMemo(()=>({onKeyDown:j,onPointerDown:yt,onMouseDown:yt,onMouseUp:yt,onClickCapture:P,onMouseDownCapture(A){P(),vt(A)},onPointerDownCapture(A){P(),vt(A)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[j,yt,P,vt]);return p.useMemo(()=>l?{reference:gt,floating:Be,trigger:gt}:{},[l,gt,Be])}var ts=Symbol("NOT_FOUND");function gy(t,e=`expected a function, instead received ${typeof t}`){if(typeof t!="function")throw new TypeError(e)}function yy(t,e=`expected an object, instead received ${typeof t}`){if(typeof t!="object")throw new TypeError(e)}function vy(t,e="expected all items to be functions, instead received the following types: "){if(!t.every(n=>typeof n=="function")){const n=t.map(s=>typeof s=="function"?`function ${s.name||"unnamed"}()`:typeof s).join(", ");throw new TypeError(`${e}[${n}]`)}}var aa=t=>Array.isArray(t)?t:[t];function by(t){const e=Array.isArray(t[0])?t[0]:t;return vy(e,"createSelector expects all input-selectors to be functions, but received the following types: "),e}function xy(t,e){const n=[],{length:s}=t;for(let i=0;i<s;i++)n.push(t[i].apply(null,e));return n}function Ty(t){let e;return{get(n){return e&&t(e.key,n)?e.value:ts},put(n,s){e={key:n,value:s}},getEntries(){return e?[e]:[]},clear(){e=void 0}}}function wy(t,e){let n=[];function s(a){const c=n.findIndex(l=>e(a,l.key));if(c>-1){const l=n[c];return c>0&&(n.splice(c,1),n.unshift(l)),l.value}return ts}function i(a,c){s(a)===ts&&(n.unshift({key:a,value:c}),n.length>t&&n.pop())}function o(){return n}function r(){n=[]}return{get:s,put:i,getEntries:o,clear:r}}var Sy=(t,e)=>t===e;function Ey(t){return function(n,s){if(n===null||s===null||n.length!==s.length)return!1;const{length:i}=n;for(let o=0;o<i;o++)if(!t(n[o],s[o]))return!1;return!0}}function Ry(t,e){const n=typeof e=="object"?e:{equalityCheck:e},{equalityCheck:s=Sy,maxSize:i=1,resultEqualityCheck:o}=n,r=Ey(s);let a=0;const c=i<=1?Ty(r):wy(i,r);function l(){let u=c.get(arguments);if(u===ts){if(u=t.apply(null,arguments),a++,o){const d=c.getEntries().find(h=>o(h.value,u));d&&(u=d.value,a!==0&&a--)}c.put(arguments,u)}return u}return l.clearCache=()=>{c.clear(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}var Cy=class{constructor(t){this.value=t}deref(){return this.value}},Py=typeof WeakRef<"u"?WeakRef:Cy,Ay=0,ca=1;function Pn(){return{s:Ay,v:void 0,o:null,p:null}}function Bl(t,e={}){let n=Pn();const{resultEqualityCheck:s}=e;let i,o=0;function r(){let a=n;const{length:c}=arguments;for(let f=0,d=c;f<d;f++){const h=arguments[f];if(typeof h=="function"||typeof h=="object"&&h!==null){let m=a.o;m===null&&(a.o=m=new WeakMap);const g=m.get(h);g===void 0?(a=Pn(),m.set(h,a)):a=g}else{let m=a.p;m===null&&(a.p=m=new Map);const g=m.get(h);g===void 0?(a=Pn(),m.set(h,a)):a=g}}const l=a;let u;if(a.s===ca)u=a.v;else if(u=t.apply(null,arguments),o++,s){const f=i?.deref?.()??i;f!=null&&s(f,u)&&(u=f,o!==0&&o--),i=typeof u=="object"&&u!==null||typeof u=="function"?new Py(u):u}return l.s=ca,l.v=u,u}return r.clearCache=()=>{n=Pn(),r.resetResultsCount()},r.resultsCount=()=>o,r.resetResultsCount=()=>{o=0},r}function Nl(t,...e){const n=typeof t=="function"?{memoize:t,memoizeOptions:e}:t,s=(...i)=>{let o=0,r=0,a,c={},l=i.pop();typeof l=="object"&&(c=l,l=i.pop()),gy(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const u={...n,...c},{memoize:f,memoizeOptions:d=[],argsMemoize:h=Bl,argsMemoizeOptions:m=[]}=u,g=aa(d),v=aa(m),y=by(i),b=f(function(){return o++,l.apply(null,arguments)},...g),x=h(function(){r++;const w=xy(y,arguments);return a=b.apply(null,w),a},...v);return Object.assign(x,{resultFunc:l,memoizedResultFunc:b,dependencies:y,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>a,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:f,argsMemoize:h})};return Object.assign(s,{withTypes:()=>s}),s}var My=Nl(Bl),Dy=Object.assign((t,e=My)=>{yy(t,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof t}`);const n=Object.keys(t),s=n.map(o=>t[o]);return e(s,(...o)=>o.reduce((r,a,c)=>(r[n[c]]=a,r),{}))},{withTypes:()=>Dy});Nl({memoize:Ry,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const q=(t,e,n,s,i,o,...r)=>{if(r.length>0)throw new Error(De(1));let a;if(t)a=t;else throw new Error("Missing arguments");return a};var Oy=cu();const Iy=uu(19),Vy=Iy?ky:Fy;function Ly(t,e,n,s,i){return Vy(t,e,n,s,i)}function ky(t,e,n,s,i){const o=p.useCallback(()=>e(t.getSnapshot(),n,s,i),[t,e,n,s,i]);return Oy.useSyncExternalStore(t.subscribe,o,o)}function Fy(t,e,n,s,i){return lu.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,o=>e(o,n,s,i))}class Qe{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const n=this.updateTick;for(const s of this.listeners){if(n!==this.updateTick)return;s(e)}}update(e){for(const n in e)if(!Object.is(this.state[n],e[n])){Qe.prototype.setState.call(this,{...this.state,...e});return}}set(e,n){Object.is(this.state[e],n)||Qe.prototype.setState.call(this,{...this.state,[e]:n})}notifyAll(){const e={...this.state};Qe.prototype.setState.call(this,e)}}class jl extends Qe{constructor(e,n={},s){super(e),this.context=n,this.selectors=s}controlledValues=new Map;useSyncedValue(e,n){p.useDebugValue(e),G(()=>{this.state[e]!==n&&this.set(e,n)},[e,n])}useSyncedValueWithCleanup(e,n){const s=this;G(()=>(s.state[e]!==n&&s.set(e,n),()=>{s.set(e,void 0)}),[s,e,n])}useSyncedValues(e){const n=this,s=Object.values(e);G(()=>{n.update(e)},[n,...s])}useControlledProp(e,n,s){p.useDebugValue(e);const i=this,o=n!==void 0;this.controlledValues.has(e)||(this.controlledValues.set(e,o),!o&&!Object.is(this.state[e],s)&&super.setState({...this.state,[e]:s})),G(()=>{o&&!Object.is(i.state[e],n)&&super.setState({...i.state,[e]:n})},[i,e,n,s,o])}set(e,n){this.controlledValues.get(e)!==!0&&super.set(e,n)}update(e){const n={...e};for(const s in n)if(Object.hasOwn(n,s)&&this.controlledValues.get(s)===!0){delete n[s];continue}super.update(n)}setState(e){const n={...e};for(const s in n)if(Object.hasOwn(n,s)&&this.controlledValues.get(s)===!0){delete n[s];continue}super.setState({...this.state,...n})}select=(e,n,s,i)=>{const o=this.selectors[e];return o(this.state,n,s,i)};useState=(e,n,s,i)=>{p.useDebugValue(e);const o=this.selectors[e];return Ly(this,o,n,s,i)};useContextCallback(e,n){p.useDebugValue(e);const s=U(n??fu);this.context[e]=s}useStateSetter(e){const n=p.useRef(void 0);return n.current===void 0&&(n.current=s=>{this.set(e,s)}),n.current}observe(e,n){let s;typeof e=="function"?s=e:s=this.selectors[e];let i=s(this.state);return n(i,i,this),this.subscribe(o=>{const r=s(o);if(!Object.is(i,r)){const a=i;i=r,n(r,a,this)}})}}const By={open:q(t=>t.open),domReferenceElement:q(t=>t.domReferenceElement),referenceElement:q(t=>t.positionReference??t.referenceElement),floatingElement:q(t=>t.floatingElement),floatingId:q(t=>t.floatingId)};class fr extends jl{constructor(e){const{nested:n,noEmit:s,onOpenChange:i,triggerElements:o,...r}=e;super({...r,positionReference:r.referenceElement,domReferenceElement:r.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:Tl(),nested:n,noEmit:s,triggerElements:o},By)}setOpen=(e,n)=>{if((!e||!this.state.open||Lm(n.event))&&(this.context.dataRef.current.openEvent=e?n.event:void 0),!this.context.noEmit){const s={open:e,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",s)}this.context.onOpenChange?.(e,n)}}function Ny(t,e=!1,n=!1){const[s,i]=p.useState(t&&e?"idle":void 0),[o,r]=p.useState(t);return t&&!o&&(r(!0),i("starting")),!t&&o&&s!=="ending"&&!n&&i("ending"),!t&&!o&&s==="ending"&&i(void 0),G(()=>{if(!t&&o&&s!=="ending"&&n){const a=_t.request(()=>{i("ending")});return()=>{_t.cancel(a)}}},[t,o,s,n]),G(()=>{if(!t||e)return;const a=_t.request(()=>{i(void 0)});return()=>{_t.cancel(a)}},[e,t]),G(()=>{if(!t||!e)return;t&&o&&s!=="idle"&&i("starting");const a=_t.request(()=>{i("idle")});return()=>{_t.cancel(a)}},[e,t,o,i,s]),p.useMemo(()=>({mounted:o,setMounted:r,transitionStatus:s}),[o,s])}let rn=(function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t})({});const jy={[rn.startingStyle]:""},Uy={[rn.endingStyle]:""},Wy={transitionStatus(t){return t==="starting"?jy:t==="ending"?Uy:null}};function $y(t,e=!1,n=!0){const s=xg();return U((i,o=null)=>{s.cancel();function r(){pe.flushSync(i)}const a=Sg(t);if(a==null)return;const c=a;if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{let l=function(){const f=rn.startingStyle;if(!c.hasAttribute(f)){s.request(u);return}const d=new MutationObserver(()=>{c.hasAttribute(f)||(d.disconnect(),u())});d.observe(c,{attributes:!0,attributeFilter:[f]}),o?.addEventListener("abort",()=>d.disconnect(),{once:!0})},u=function(){Promise.all(c.getAnimations().map(f=>f.finished)).then(()=>{o?.aborted||r()}).catch(()=>{const f=c.getAnimations();if(n){if(o?.aborted)return;r()}else f.length>0&&f.some(d=>d.pending||d.playState!=="finished")&&u()})};if(e){l();return}s.request(u)}})}function Ul(t){const{enabled:e=!0,open:n,ref:s,onComplete:i}=t,o=U(i),r=$y(s,n,!1);p.useEffect(()=>{if(!e)return;const a=new AbortController;return r(o,a.signal),()=>{a.abort()}},[e,n,o,r])}function Hy(t,e){const n=p.useRef(null),s=p.useRef(null);return p.useCallback(i=>{if(t!==void 0){if(n.current!==null){const o=n.current,r=s.current,a=e.context.triggerElements.getById(o);r&&a===r&&e.context.triggerElements.delete(o),n.current=null,s.current=null}i!==null&&(n.current=t,s.current=i,e.context.triggerElements.add(t,i))}},[e,t])}function _y(t,e,n,s){const i=n.useState("isMountedByTrigger",t),o=Hy(t,n),r=U(a=>{if(o(a),!a||!n.select("open"))return;const c=n.select("activeTriggerId");if(c===t){n.update({activeTriggerElement:a,...s});return}c==null&&n.update({activeTriggerId:t,activeTriggerElement:a,...s})});return G(()=>{i&&n.update({activeTriggerElement:e.current,...s})},[i,n,e,...Object.values(s)]),{registerTrigger:r,isMountedByThisTrigger:i}}function Ky(t){const e=t.useState("open");G(()=>{if(e&&!t.select("activeTriggerId")&&t.context.triggerElements.size===1){const n=t.context.triggerElements.entries().next();if(!n.done){const[s,i]=n.value;t.update({activeTriggerId:s,activeTriggerElement:i})}}},[e,t])}function zy(t,e,n){const{mounted:s,setMounted:i,transitionStatus:o}=Ny(t);e.useSyncedValues({mounted:s,transitionStatus:o});const r=U(()=>{i(!1),e.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),e.context.onOpenChangeComplete?.(!1)}),a=e.useState("preventUnmountingOnClose");return Ul({enabled:!a,open:t,ref:e.context.popupRef,onComplete(){t||r()}}),{forceUnmount:r,transitionStatus:o}}class dr{constructor(){this.elements=new Set,this.idMap=new Map}add(e,n){const s=this.idMap.get(e);s!==n&&(s!==void 0&&this.elements.delete(s),this.elements.add(n),this.idMap.set(e,n))}delete(e){const n=this.idMap.get(e);n&&(this.elements.delete(n),this.idMap.delete(e))}hasElement(e){return this.elements.has(e)}hasMatchingElement(e){for(const n of this.elements)if(e(n))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function Yy(){return new fr({open:!1,floatingElement:null,referenceElement:null,triggerElements:new dr,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Xy(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:Yy(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:we,inactiveTriggerProps:we,popupProps:we}}const Gy={open:q(t=>t.open),mounted:q(t=>t.mounted),transitionStatus:q(t=>t.transitionStatus),floatingRootContext:q(t=>t.floatingRootContext),preventUnmountingOnClose:q(t=>t.preventUnmountingOnClose),payload:q(t=>t.payload),activeTriggerId:q(t=>t.activeTriggerId),activeTriggerElement:q(t=>t.mounted?t.activeTriggerElement:null),isTriggerActive:q((t,e)=>e!==void 0&&t.activeTriggerId===e),isOpenedByTrigger:q((t,e)=>e!==void 0&&t.activeTriggerId===e&&t.open),isMountedByTrigger:q((t,e)=>e!==void 0&&t.activeTriggerId===e&&t.mounted),triggerProps:q((t,e)=>e?t.activeTriggerProps:t.inactiveTriggerProps),popupProps:q(t=>t.popupProps),popupElement:q(t=>t.popupElement),positionerElement:q(t=>t.positionerElement)};function qy(t){const{open:e=!1,onOpenChange:n,elements:s={}}=t,i=fn(),o=dn()!=null,r=se(()=>new fr({open:e,onOpenChange:n,referenceElement:s.reference??null,floatingElement:s.floating??null,triggerElements:s.triggers??new dr,floatingId:i,nested:o,noEmit:t.noEmit||!1})).current;return G(()=>{const a={open:e,floatingId:i};s.reference!==void 0&&(a.referenceElement=s.reference,a.domReferenceElement=Y(s.reference)?s.reference:null),s.floating!==void 0&&(a.floatingElement=s.floating),r.update(a)},[e,i,s.reference,s.floating,r]),r.context.onOpenChange=n,r.context.nested=o,r.context.noEmit=t.noEmit||!1,r}function Qy(t={}){const{nodeId:e,externalTree:n}=t,s=qy(t),i=t.rootContext||s,o={reference:i.useState("referenceElement"),floating:i.useState("floatingElement"),domReference:i.useState("domReferenceElement")},[r,a]=p.useState(null),c=p.useRef(null),l=hn(n);G(()=>{o.domReference&&(c.current=o.domReference)},[o.domReference]);const u=oy({...t,elements:{...o,...r&&{reference:r}}}),f=p.useCallback(R=>{const S=Y(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;a(S),u.refs.setReference(S)},[u.refs]),[d,h]=p.useState(null),[m,g]=p.useState(null);i.useSyncedValue("referenceElement",d),i.useSyncedValue("domReferenceElement",Y(d)?d:null),i.useSyncedValue("floatingElement",m);const v=p.useCallback(R=>{(Y(R)||R===null)&&(c.current=R,h(R)),(Y(u.refs.reference.current)||u.refs.reference.current===null||R!==null&&!Y(R))&&u.refs.setReference(R)},[u.refs,h]),y=p.useCallback(R=>{g(R),u.refs.setFloating(R)},[u.refs]),b=p.useMemo(()=>({...u.refs,setReference:v,setFloating:y,setPositionReference:f,domReference:c}),[u.refs,v,y,f]),x=p.useMemo(()=>({...u.elements,domReference:o.domReference}),[u.elements,o.domReference]),T=i.useState("open"),w=i.useState("floatingId"),E=p.useMemo(()=>({...u,dataRef:i.context.dataRef,open:T,onOpenChange:i.setOpen,events:i.context.events,floatingId:w,refs:b,elements:x,nodeId:e,rootStore:i}),[u,b,x,e,i,T,w]);return G(()=>{i.context.dataRef.current.floatingContext=E;const R=l?.nodesRef.current.find(S=>S.id===e);R&&(R.context=E)}),p.useMemo(()=>({...u,context:E,refs:b,elements:x,rootStore:i}),[u,b,x,E,i])}function Zy(t){const{popupStore:e,noEmit:n=!1,treatPopupAsFloatingElement:s=!1,onOpenChange:i}=t,o=fn(),r=dn()!=null,a=e.useState("open"),c=e.useState("activeTriggerElement"),l=e.useState(s?"popupElement":"positionerElement"),u=e.context.triggerElements,f=se(()=>new fr({open:a,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:i,floatingId:o,nested:r,noEmit:n})).current;return G(()=>{const d={open:a,floatingId:o,referenceElement:c,floatingElement:l};Y(c)&&(d.domReferenceElement=c),f.state.positionReference===f.state.referenceElement&&(d.positionReference=c),f.update(d)},[a,o,c,l,f]),f.context.onOpenChange=i,f.context.nested=r,f.context.noEmit=n,f}const Fs=Pm&&ol;function Jy(t,e={}){const n="rootStore"in t?t.rootStore:t,{events:s,dataRef:i}=n.context,{enabled:o=!0,visibleOnly:r=!0,delay:a}=e,c=p.useRef(!1),l=p.useRef(null),u=Pe(),f=p.useRef(!0);p.useEffect(()=>{const h=n.select("domReferenceElement");if(!o)return;const m=mt(h);function g(){const b=n.select("domReferenceElement");!n.select("open")&&St(b)&&b===mi(kt(b))&&(c.current=!0)}function v(){f.current=!0}function y(){f.current=!1}return m.addEventListener("blur",g),Fs&&(m.addEventListener("keydown",v,!0),m.addEventListener("pointerdown",y,!0)),()=>{m.removeEventListener("blur",g),Fs&&(m.removeEventListener("keydown",v,!0),m.removeEventListener("pointerdown",y,!0))}},[n,o]),p.useEffect(()=>{if(!o)return;function h(m){if(m.reason===Zn||m.reason===lr){const g=n.select("domReferenceElement");Y(g)&&(l.current=g,c.current=!0)}}return s.on("openchange",h),()=>{s.off("openchange",h)}},[s,o,n]);const d=p.useMemo(()=>({onMouseLeave(){c.current=!1,l.current=null},onFocus(h){const m=h.currentTarget;if(c.current){if(l.current===m)return;c.current=!1,l.current=null}const g=Bt(h.nativeEvent);if(r&&Y(g)){if(Fs&&!h.relatedTarget){if(!f.current&&!fl(g))return}else if(!Im(g))return}const v=h.relatedTarget&&n.context.triggerElements.hasElement(h.relatedTarget),{nativeEvent:y,currentTarget:b}=h,x=typeof a=="function"?a():a;if(n.select("open")&&v||x===0||x===void 0){n.setOpen(!0,ot(Vn,y,b));return}u.start(x,()=>{c.current||n.setOpen(!0,ot(Vn,y,b))})},onBlur(h){c.current=!1,l.current=null;const m=h.relatedTarget,g=h.nativeEvent,v=Y(m)&&m.hasAttribute(fs("focus-guard"))&&m.getAttribute("data-type")==="outside";u.start(0,()=>{const y=n.select("domReferenceElement"),b=mi(y?y.ownerDocument:document);if(!m&&b===y||dt(i.current.floatingContext?.refs.floating.current,b)||dt(y,b)||v)return;const x=m??b;if(Y(x)){const T=n.context.triggerElements;if(T.hasElement(x)||T.hasMatchingElement(w=>dt(w,x)))return}n.setOpen(!1,ot(Vn,g))})}}),[i,n,r,u,a]);return p.useMemo(()=>o?{reference:d,trigger:d}:{},[o,d])}const xi=fs("safe-polygon"),tv=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${ul}`;function ev(t){return t?!!t.closest(tv):!1}function Wl(t){const e=p.useRef(void 0),n=p.useRef(!1),s=p.useRef(void 0),i=p.useRef(!0),o=p.useRef(!1),r=p.useRef(()=>{}),a=p.useRef(!1),c=Pe(),l=Pe(),u=p.useRef(void 0);return p.useMemo(()=>{const f=t.context.dataRef.current;return f.hoverInteractionState||(f.hoverInteractionState={pointerTypeRef:e,interactedInsideRef:n,handlerRef:s,blockMouseMoveRef:i,performedPointerEventsMutationRef:o,unbindMouseMoveRef:r,restTimeoutPendingRef:a,openChangeTimeout:c,restTimeout:l,handleCloseOptionsRef:u}),f.hoverInteractionState},[t,e,n,s,i,o,r,a,c,l,u])}const nv=new Set(["click","mousedown"]);function sv(t,e={}){const n="rootStore"in t?t.rootStore:t,s=n.useState("open"),i=n.useState("floatingElement"),o=n.useState("domReferenceElement"),{dataRef:r}=n.context,{enabled:a=!0,closeDelay:c=0,externalTree:l}=e,{pointerTypeRef:u,interactedInsideRef:f,handlerRef:d,performedPointerEventsMutationRef:h,unbindMouseMoveRef:m,restTimeoutPendingRef:g,openChangeTimeout:v,handleCloseOptionsRef:y}=Wl(n),b=hn(l),x=dn(),T=U(()=>f.current?!0:r.current.openEvent?nv.has(r.current.openEvent.type):!1),w=U(()=>{const O=r.current.openEvent?.type;return O?.includes("mouse")&&O!=="mousedown"}),E=p.useCallback((O,k=!0)=>{const M=iv(c,u.current);M&&!d.current?v.start(M,()=>n.setOpen(!1,ot(Nt,O))):k&&(v.clear(),n.setOpen(!1,ot(Nt,O)))},[c,d,n,u,v]),R=U(()=>{m.current(),d.current=void 0}),S=U(()=>{if(h.current){const O=kt(i).body;O.style.pointerEvents="",O.removeAttribute(xi),h.current=!1}}),D=U(O=>{const k=Bt(O);if(!ev(k)){f.current=!1;return}f.current=!0});G(()=>{s||(u.current=void 0,g.current=!1,f.current=!1,R(),S())},[s,u,g,f,R,S]),p.useEffect(()=>()=>{R()},[R]),p.useEffect(()=>S,[S]),G(()=>{if(a&&s&&y.current?.blockPointerEvents&&w()&&Y(o)&&i){h.current=!0;const O=kt(i).body;O.setAttribute(xi,"");const k=o,M=i,C=b?.nodesRef.current.find(B=>B.id===x)?.context?.elements.floating;return C&&(C.style.pointerEvents=""),O.style.pointerEvents="none",k.style.pointerEvents="auto",M.style.pointerEvents="auto",()=>{O.style.pointerEvents="",k.style.pointerEvents="",M.style.pointerEvents=""}}},[a,s,o,i,y,w,b,x,h]),p.useEffect(()=>{if(!a)return;function O(B){if(T()||!r.current.floatingContext||!n.select("open"))return;const F=n.context.triggerElements;B.relatedTarget&&F.hasElement(B.relatedTarget)||(S(),R(),T()||E(B))}function k(B){v.clear(),S(),d.current?.(B),R()}function M(B){T()||E(B,!1)}const C=i;return C&&(C.addEventListener("mouseleave",O),C.addEventListener("mouseenter",k),C.addEventListener("mouseleave",M),C.addEventListener("pointerdown",D,!0)),()=>{C&&(C.removeEventListener("mouseleave",O),C.removeEventListener("mouseenter",k),C.removeEventListener("mouseleave",M),C.removeEventListener("pointerdown",D,!0))}})}function iv(t,e){return e&&!sn(e)?0:typeof t=="function"?t():t}function Bs(t){return typeof t=="function"?t():t}const rv={current:null};function ov(t,e={}){const n="rootStore"in t?t.rootStore:t,{dataRef:s,events:i}=n.context,{enabled:o=!0,delay:r=0,handleClose:a=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:f=rv,externalTree:d,isActiveTrigger:h=!0}=e,m=hn(d),{pointerTypeRef:g,interactedInsideRef:v,handlerRef:y,blockMouseMoveRef:b,performedPointerEventsMutationRef:x,unbindMouseMoveRef:T,restTimeoutPendingRef:w,openChangeTimeout:E,restTimeout:R,handleCloseOptionsRef:S}=Wl(n),D=Ee(a),O=Ee(r),k=Ee(l);h&&(S.current=D.current?.__options);const M=U(()=>v.current?!0:s.current.openEvent?["click","mousedown"].includes(s.current.openEvent.type):!1),C=p.useCallback((I,P=!0)=>{const L=Ln(O.current,"close",g.current);L&&!y.current?E.start(L,()=>n.setOpen(!1,ot(Nt,I))):P&&(E.clear(),n.setOpen(!1,ot(Nt,I)))},[O,y,n,g,E]),B=U(()=>{T.current(),y.current=void 0}),F=U(()=>{if(x.current){const I=kt(n.select("domReferenceElement")).body;I.style.pointerEvents="",I.removeAttribute(xi),x.current=!1}});p.useEffect(()=>{if(!o)return;function I(P){P.open||(E.clear(),R.clear(),b.current=!0,w.current=!1)}return i.on("openchange",I),()=>{i.off("openchange",I)}},[o,i,E,R,b,w]);const j=U(I=>{if(M()||!s.current.floatingContext)return;const P=n.context.triggerElements;if(I.relatedTarget&&P.hasElement(I.relatedTarget))return;const L=f.current;D.current?.({...s.current.floatingContext,tree:m,x:I.clientX,y:I.clientY,onClose(){F(),B(),!M()&&L===n.select("domReferenceElement")&&C(I)}})(I)});return p.useEffect(()=>{if(!o)return;const I=f.current??(h?n.select("domReferenceElement"):null);if(!Y(I))return;function P(W){if(E.clear(),b.current=!1,c&&!sn(g.current)||Bs(k.current)>0&&!Ln(O.current,"open"))return;const at=Ln(O.current,"open",g.current),Z=n.select("domReferenceElement"),tt=n.context.triggerElements,st=(tt.hasElement(W.target)||tt.hasMatchingElement(yt=>dt(yt,W.target)))&&(!Z||!dt(Z,W.target)),$=W.currentTarget??null,z=n.select("open"),gt=!z||st;st&&z?n.setOpen(!0,ot(Nt,W,$)):at?E.start(at,()=>{gt&&n.setOpen(!0,ot(Nt,W,$))}):gt&&n.setOpen(!0,ot(Nt,W,$))}function L(W){if(M()){F();return}T.current();const at=n.select("domReferenceElement"),Z=kt(at);R.clear(),w.current=!1;const tt=n.context.triggerElements;if(W.relatedTarget&&tt.hasElement(W.relatedTarget))return;if(D.current&&s.current.floatingContext){n.select("open")||E.clear();const $=f.current;y.current=D.current({...s.current.floatingContext,tree:m,x:W.clientX,y:W.clientY,onClose(){F(),B(),!M()&&$===n.select("domReferenceElement")&&C(W,!0)}});const z=y.current;z(W),Z.addEventListener("mousemove",z),T.current=()=>{Z.removeEventListener("mousemove",z)};return}(g.current!=="touch"||!dt(n.select("floatingElement"),W.relatedTarget))&&C(W)}function _(W){j(W)}return n.select("open")&&I.addEventListener("mouseleave",_),u&&I.addEventListener("mousemove",P,{once:!0}),I.addEventListener("mouseenter",P),I.addEventListener("mouseleave",L),()=>{I.removeEventListener("mouseleave",_),u&&I.removeEventListener("mousemove",P),I.removeEventListener("mouseenter",P),I.removeEventListener("mouseleave",L)}},[B,F,b,s,O,C,n,o,D,j,h,M,c,u,g,k,R,w,E,f,m,T,y]),p.useMemo(()=>{function I(P){g.current=P.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(P){const{nativeEvent:L}=P,_=P.currentTarget,W=n.select("domReferenceElement"),at=n.context.triggerElements,Z=n.select("open"),tt=(at.hasElement(P.target)||at.hasMatchingElement($=>dt($,P.target)))&&(!W||!dt(W,P.target));if(c&&!sn(g.current)||Z&&!tt||Bs(k.current)===0||!tt&&w.current&&P.movementX**2+P.movementY**2<2)return;R.clear();function st(){if(w.current=!1,M())return;const $=n.select("open");!b.current&&(!$||tt)&&n.setOpen(!0,ot(Nt,L,_))}g.current==="touch"?pe.flushSync(()=>{st()}):tt&&Z?st():(w.current=!0,R.start(Bs(k.current),st))}}},[b,M,c,n,g,k,R,w])}function av(t=[]){const e=t.map(l=>l?.reference),n=t.map(l=>l?.floating),s=t.map(l=>l?.item),i=t.map(l=>l?.trigger),o=p.useCallback(l=>An(l,t,"reference"),e),r=p.useCallback(l=>An(l,t,"floating"),n),a=p.useCallback(l=>An(l,t,"item"),s),c=p.useCallback(l=>An(l,t,"trigger"),i);return p.useMemo(()=>({getReferenceProps:o,getFloatingProps:r,getItemProps:a,getTriggerProps:c}),[o,r,a,c])}function An(t,e,n){const s=new Map,i=n==="item",o={};n==="floating"&&(o.tabIndex=-1,o[pi]="");for(const r in t)i&&t&&(r===cl||r===ll)||(o[r]=t[r]);for(let r=0;r<e.length;r+=1){let a;const c=e[r]?.[n];typeof c=="function"?a=t?c(t):null:a=c,a&&la(o,a,i,s)}return la(o,t,i,s),o}function la(t,e,n,s){for(const i in e){const o=e[i];n&&(i===cl||i===ll)||(i.startsWith("on")?(s.has(i)||s.set(i,[]),typeof o=="function"&&(s.get(i)?.push(o),t[i]=(...r)=>s.get(i)?.map(a=>a(...r)).find(a=>a!==void 0))):t[i]=o)}}function ua(t,e){const[n,s]=t;let i=!1;const o=e.length;for(let r=0,a=o-1;r<o;a=r++){const[c,l]=e[r]||[0,0],[u,f]=e[a]||[0,0];l>=s!=f>=s&&n<=(u-c)*(s-l)/(f-l)+c&&(i=!i)}return i}function cv(t,e){return t[0]>=e.x&&t[0]<=e.x+e.width&&t[1]>=e.y&&t[1]<=e.y+e.height}function lv(t={}){const{buffer:e=.5,blockPointerEvents:n=!1,requireIntent:s=!0}=t,i=new Le;let o=!1,r=null,a=null,c=typeof performance<"u"?performance.now():0;function l(f,d){const h=performance.now(),m=h-c;if(r===null||a===null||m===0)return r=f,a=d,c=h,null;const g=f-r,v=d-a,b=Math.sqrt(g*g+v*v)/m;return r=f,a=d,c=h,b}const u=({x:f,y:d,placement:h,elements:m,onClose:g,nodeId:v,tree:y})=>function(x){function T(){i.clear(),g()}if(i.clear(),!m.domReference||!m.floating||h==null||f==null||d==null)return;const{clientX:w,clientY:E}=x,R=[w,E],S=Bt(x),D=x.type==="mouseleave",O=dt(m.floating,S),k=dt(m.domReference,S),M=m.domReference.getBoundingClientRect(),C=m.floating.getBoundingClientRect(),B=h.split("-")[0],F=f>C.right-C.width/2,j=d>C.bottom-C.height/2,I=cv(R,M),P=C.width>M.width,L=C.height>M.height,_=(P?M:C).left,W=(P?M:C).right,at=(L?M:C).top,Z=(L?M:C).bottom;if(O&&(o=!0,!D))return;if(k&&(o=!1),k&&!D){o=!0;return}if(D&&Y(x.relatedTarget)&&dt(m.floating,x.relatedTarget)||y&&qe(y.nodesRef.current,v).some(({context:$})=>$?.open))return;if(B==="top"&&d>=M.bottom-1||B==="bottom"&&d<=M.top+1||B==="left"&&f>=M.right-1||B==="right"&&f<=M.left+1)return T();let tt=[];switch(B){case"top":tt=[[_,M.top+1],[_,C.bottom-1],[W,C.bottom-1],[W,M.top+1]];break;case"bottom":tt=[[_,C.top+1],[_,M.bottom-1],[W,M.bottom-1],[W,C.top+1]];break;case"left":tt=[[C.right-1,Z],[C.right-1,at],[M.left+1,at],[M.left+1,Z]];break;case"right":tt=[[M.right-1,Z],[M.right-1,at],[C.left+1,at],[C.left+1,Z]];break}function st([$,z]){switch(B){case"top":{const gt=[P?$+e/2:F?$+e*4:$-e*4,z+e+1],yt=[P?$-e/2:F?$+e*4:$-e*4,z+e+1],vt=[[C.left,F||P?C.bottom-e:C.top],[C.right,F?P?C.bottom-e:C.top:C.bottom-e]];return[gt,yt,...vt]}case"bottom":{const gt=[P?$+e/2:F?$+e*4:$-e*4,z-e],yt=[P?$-e/2:F?$+e*4:$-e*4,z-e],vt=[[C.left,F||P?C.top+e:C.bottom],[C.right,F?P?C.top+e:C.bottom:C.top+e]];return[gt,yt,...vt]}case"left":{const gt=[$+e+1,L?z+e/2:j?z+e*4:z-e*4],yt=[$+e+1,L?z-e/2:j?z+e*4:z-e*4];return[...[[j||L?C.right-e:C.left,C.top],[j?L?C.right-e:C.left:C.right-e,C.bottom]],gt,yt]}case"right":{const gt=[$-e,L?z+e/2:j?z+e*4:z-e*4],yt=[$-e,L?z-e/2:j?z+e*4:z-e*4],vt=[[j||L?C.left+e:C.right,C.top],[j?L?C.left+e:C.right:C.left+e,C.bottom]];return[gt,yt,...vt]}default:return[]}}if(!ua([w,E],tt)){if(o&&!I)return T();if(!D&&s){const $=l(x.clientX,x.clientY);if($!==null&&$<.1)return T()}ua([w,E],st([f,d]))?!o&&s&&i.start(40,T):T()}};return u.__options={blockPointerEvents:n},u}const uv={...Gy,disabled:q(t=>t.disabled),instantType:q(t=>t.instantType),isInstantPhase:q(t=>t.isInstantPhase),trackCursorAxis:q(t=>t.trackCursorAxis),disableHoverablePopup:q(t=>t.disableHoverablePopup),lastOpenChangeReason:q(t=>t.openChangeReason),closeDelay:q(t=>t.closeDelay),hasViewport:q(t=>t.hasViewport)};class hr extends jl{constructor(e){super({...fv(),...e},{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new dr},uv)}setOpen=(e,n)=>{const s=n.reason,i=s===Nt,o=e&&s===Vn,r=!e&&(s===Zn||s===lr);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,n),n.isCanceled)return;const a=()=>{const c={open:e,openChangeReason:s};o?c.instantType="focus":r?c.instantType="dismiss":s===Nt&&(c.instantType=void 0);const l=n.trigger?.id??null;(l||e)&&(c.activeTriggerId=l,c.activeTriggerElement=n.trigger??null),this.update(c)};i?pe.flushSync(a):a()};static useStore(e,n){const s=se(()=>new hr(n)).current,i=e??s,o=Zy({popupStore:i,onOpenChange:i.setOpen});return i.state.floatingRootContext=o,i}}function fv(){return{...Xy(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}function dv(t){const{disabled:e=!1,defaultOpen:n=!1,open:s,disableHoverablePopup:i=!1,trackCursorAxis:o="none",actionsRef:r,onOpenChange:a,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:f=null,children:d}=t,h=hr.useStore(l?.store,{open:s??n,activeTriggerId:u!==void 0?u:f});h.useControlledProp("open",s,n),h.useControlledProp("activeTriggerId",u,f),h.useContextCallback("onOpenChange",a),h.useContextCallback("onOpenChangeComplete",c);const m=h.useState("open"),g=!e&&m,v=h.useState("activeTriggerId"),y=h.useState("payload");h.useSyncedValues({trackCursorAxis:o,disableHoverablePopup:i}),G(()=>{m&&e&&h.setOpen(!1,ot(pg))},[m,e,h]),h.useSyncedValue("disabled",e),Ky(h);const{forceUnmount:b,transitionStatus:x}=zy(g,h),T=h.useState("isInstantPhase"),w=h.useState("instantType"),E=h.useState("lastOpenChangeReason"),R=p.useRef(null);G(()=>{x==="ending"&&E===cr||x!=="ending"&&T?(w!=="delay"&&(R.current=w),h.set("instantType","delay")):R.current!==null&&(h.set("instantType",R.current),R.current=null)},[x,T,E,w,h]),G(()=>{g&&v==null&&h.set("payload",void 0)},[h,v,g]);const S=p.useCallback(()=>{h.setOpen(!1,hv(h,mg))},[h]);p.useImperativeHandle(r,()=>({unmount:b,close:S}),[b,S]);const D=h.useState("floatingRootContext"),O=Jy(D,{enabled:!e}),k=my(D,{enabled:!e,referencePress:!0}),M=Rg(D,{enabled:!e&&o!=="none",axis:o==="none"?void 0:o}),{getReferenceProps:C,getFloatingProps:B,getTriggerProps:F}=av([O,k,M]),j=p.useMemo(()=>C(),[C]),I=p.useMemo(()=>F(),[F]),P=p.useMemo(()=>B(),[B]);return h.useSyncedValues({activeTriggerProps:j,inactiveTriggerProps:I,popupProps:P}),X.jsx(el.Provider,{value:h,children:typeof d=="function"?d({payload:y}):d})}function hv(t,e){const n=ot(e);return n.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},n}let pr=(function(t){return t.open="data-open",t.closed="data-closed",t[t.startingStyle=rn.startingStyle]="startingStyle",t[t.endingStyle=rn.endingStyle]="endingStyle",t.anchorHidden="data-anchor-hidden",t})({}),Ti=(function(t){return t.popupOpen="data-popup-open",t.pressed="data-pressed",t})({});const pv={[Ti.popupOpen]:""},mv={[Ti.popupOpen]:"",[Ti.pressed]:""},gv={[pr.open]:""},yv={[pr.closed]:""},vv={[pr.anchorHidden]:""},bv={open(t){return t?pv:null}},Pb={open(t){return t?mv:null}},$l={open(t){return t?gv:yv},anchorHidden(t){return t?vv:null}};function xv(t){return fn(t,"base-ui")}const Hl=p.createContext(void 0);function Tv(){return p.useContext(Hl)}const wv=600,Sv=p.forwardRef(function(e,n){const{className:s,render:i,handle:o,payload:r,disabled:a,delay:c,closeDelay:l,id:u,...f}=e,d=os(!0),h=o?.store??d;if(!h)throw new Error(De(82));const m=xv(u),g=h.useState("isTriggerActive",m),v=h.useState("isOpenedByTrigger",m),y=h.useState("floatingRootContext"),b=p.useRef(null),x=c??wv,T=l??0,{registerTrigger:w,isMountedByThisTrigger:E}=_y(m,b,h,{payload:r,closeDelay:T}),R=Tv(),{delayRef:S,isInstantPhase:D,hasProvider:O}=yg(y,{open:v});h.useSyncedValue("isInstantPhase",D);const k=h.useState("disabled"),M=a??k,C=h.useState("trackCursorAxis"),B=h.useState("disableHoverablePopup"),F=ov(y,{enabled:!M,mouseOnly:!0,move:!1,handleClose:!B&&C!=="both"?lv():null,restMs(){const L=R?.delay,_=typeof S.current=="object"?S.current.open:void 0;let W=x;return O&&(_!==0?W=c??L??x:W=0),W},delay(){const L=typeof S.current=="object"?S.current.close:void 0;let _=T;return l==null&&O&&(_=L),{close:_}},triggerElementRef:b,isActiveTrigger:g}),j=p.useMemo(()=>({open:v}),[v]),I=h.useState("triggerProps",E);return es("button",e,{state:j,ref:[n,w,b],props:[F,I,{id:m},f],stateAttributesMapping:bv})}),_l=p.createContext(void 0);function Ev(){const t=p.useContext(_l);if(t===void 0)throw new Error(De(70));return t}const Rv=p.forwardRef(function(e,n){const{children:s,container:i,className:o,render:r,...a}=e,{portalNode:c,portalSubtree:l}=Al({container:i,ref:n,componentProps:e,elementProps:a});return!l&&!c?null:X.jsxs(p.Fragment,{children:[l,c&&pe.createPortal(s,c)]})}),Cv=p.forwardRef(function(e,n){const{keepMounted:s=!1,...i}=e;return os().useState("mounted")||s?X.jsx(_l.Provider,{value:s,children:X.jsx(Rv,{ref:n,...i})}):null}),Kl=p.createContext(void 0);function Pv(){const t=p.useContext(Kl);if(t===void 0)throw new Error(De(71));return t}const Av=p.createContext(void 0);function Mv(){return p.useContext(Av)?.direction??"ltr"}const Dv=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:s,placement:i,rects:o,platform:r,elements:a,middlewareData:c}=e,{element:l,padding:u=0,offsetParent:f="real"}=Gt(t,e)||{};if(l==null)return{};const d=dl(u),h={x:n,y:s},m=rr(i),g=ir(m),v=await r.getDimensions(l),y=m==="y",b=y?"top":"left",x=y?"bottom":"right",T=y?"clientHeight":"clientWidth",w=o.reference[g]+o.reference[m]-h[m]-o.floating[g],E=h[m]-o.reference[m],R=f==="real"?await r.getOffsetParent?.(l):a.floating;let S=a.floating[T]||o.floating[g];(!S||!await r.isElement?.(R))&&(S=a.floating[T]||o.floating[g]);const D=w/2-E/2,O=S/2-v[g]/2-1,k=Math.min(d[b],O),M=Math.min(d[x],O),C=k,B=S-v[g]-M,F=S/2-v[g]/2+D,j=gi(C,F,B),I=!c.arrow&&re(i)!=null&&F!==j&&o.reference[g]/2-(F<C?k:M)-v[g]/2<0,P=I?F<C?F-C:F-B:0;return{[m]:h[m]+P,data:{[m]:j,centerOffset:F-j-P,...I&&{alignmentOffset:P}},reset:I}}}),Ov=(t,e)=>({...Dv(t),options:[t,e]}),Iv={name:"hide",async fn(t){const{width:e,height:n,x:s,y:i}=t.rects.reference,o=e===0&&n===0&&s===0&&i===0;return{data:{referenceHidden:(await dy().fn(t)).data?.referenceHidden||o}}}},Fn={sideX:"left",sideY:"top"},Vv={name:"adaptiveOrigin",async fn(t){const{x:e,y:n,rects:{floating:s},elements:{floating:i},platform:o,strategy:r,placement:a}=t,c=mt(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!=="0s"&&l.transitionDuration!==""))return{x:e,y:n,data:Fn};const f=await o.getOffsetParent?.(i);let d={width:0,height:0};if(r==="fixed"&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(f===c){const b=Cl(i);d={width:b.documentElement.clientWidth,height:b.documentElement.clientHeight}}else await o.isElement?.(f)&&(d=await o.getDimensions(f));const h=wt(a);let m=e,g=n;h==="left"&&(m=d.width-(e+s.width)),h==="top"&&(g=d.height-(n+s.height));const v=h==="left"?"right":Fn.sideX,y=h==="top"?"bottom":Fn.sideY;return{x:m,y:g,data:{sideX:v,sideY:y}}}};function zl(t,e,n){const s=t==="inline-start"||t==="inline-end";return{top:"top",right:s?n?"inline-start":"inline-end":"right",bottom:"bottom",left:s?n?"inline-end":"inline-start":"left"}[e]}function fa(t,e,n){const{rects:s,placement:i}=t;return{side:zl(e,wt(i),n),align:re(i)||"center",anchor:{width:s.reference.width,height:s.reference.height},positioner:{width:s.floating.width,height:s.floating.height}}}function Lv(t){const{anchor:e,positionMethod:n="absolute",side:s="bottom",sideOffset:i=0,align:o="center",alignOffset:r=0,collisionBoundary:a,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:f=!1,keepMounted:d=!1,floatingRootContext:h,mounted:m,collisionAvoidance:g,shiftCrossAxis:v=!1,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:T}=t,[w,E]=p.useState(null);!m&&w!==null&&E(null);const R=g.side||"flip",S=g.align||"flip",D=g.fallbackAxisSide||"end",O=typeof e=="function"?e:void 0,k=U(O),M=O?k:e,C=Ee(e),F=Mv()==="rtl",j=w||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":F?"left":"right","inline-start":F?"right":"left"}[s],I=o==="center"?j:`${j}-${o}`;let P=c;const L=1,_=s==="bottom"?L:0,W=s==="top"?L:0,at=s==="right"?L:0,Z=s==="left"?L:0;typeof P=="number"?P={top:P+_,right:P+Z,bottom:P+W,left:P+at}:P&&(P={top:(P.top||0)+_,right:(P.right||0)+Z,bottom:(P.bottom||0)+W,left:(P.left||0)+at});const tt={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:P},st=p.useRef(null),$=Ee(i),z=Ee(r),vt=[ay(it=>{const Tt=fa(it,s,F),Ft=typeof $.current=="function"?$.current(Tt):$.current,Rt=typeof z.current=="function"?z.current(Tt):z.current;return{mainAxis:Ft,crossAxis:Rt,alignmentAxis:Rt}},[typeof i!="function"?i:0,typeof r!="function"?r:0,F,s])],Be=S==="none"&&R!=="shift",A=!Be&&(l||v||R==="shift"),K=R==="none"?null:uy({...tt,padding:{top:P.top+L,right:P.right+L,bottom:P.bottom+L,left:P.left+L},mainAxis:!v&&R==="flip",crossAxis:S==="flip"?"alignment":!1,fallbackAxisSideDirection:D}),N=Be?null:cy(it=>{const Tt=Cl(it.elements.floating).documentElement;return{...tt,rootBoundary:v?{x:0,y:0,width:Tt.clientWidth,height:Tt.clientHeight}:void 0,mainAxis:S!=="none",crossAxis:A,limiter:l||v?void 0:ly(Ft=>{if(!st.current)return{};const{width:Rt,height:ge}=st.current.getBoundingClientRect(),ye=At(wt(Ft.placement)),vn=ye==="y"?Rt:ge,hs=ye==="y"?P.left+P.right:P.top+P.bottom;return{offset:vn/2+hs/2}})}},[tt,l,v,P,S]);R==="shift"||S==="shift"||o==="center"?vt.push(N,K):vt.push(K,N),vt.push(fy({...tt,apply({elements:{floating:it},rects:{reference:Tt},availableWidth:Ft,availableHeight:Rt}){Object.entries({"--available-width":`${Ft}px`,"--available-height":`${Rt}px`,"--anchor-width":`${Tt.width}px`,"--anchor-height":`${Tt.height}px`}).forEach(([ge,ye])=>{it.style.setProperty(ge,ye)})}}),Ov(()=>({element:st.current||document.createElement("div"),padding:u,offsetParent:"floating"}),[u]),{name:"transformOrigin",fn(it){const{elements:Tt,middlewareData:Ft,placement:Rt,rects:ge,y:ye}=it,vn=wt(Rt),hs=At(vn),xr=st.current,Xl=Ft.arrow?.x||0,Gl=Ft.arrow?.y||0,ql=xr?.clientWidth||0,Ql=xr?.clientHeight||0,ps=Xl+ql/2,Tr=Gl+Ql/2,Zl=Math.abs(Ft.shift?.y||0),Jl=ge.reference.height/2,Ue=typeof i=="function"?i(fa(it,s,F)):i,tu=Zl>Ue,eu={top:`${ps}px calc(100% + ${Ue}px)`,bottom:`${ps}px ${-Ue}px`,left:`calc(100% + ${Ue}px) ${Tr}px`,right:`${-Ue}px ${Tr}px`}[vn],nu=`${ps}px ${ge.reference.y+Jl-ye}px`;return Tt.floating.style.setProperty("--transform-origin",A&&hs==="y"&&tu?nu:eu),{}}},Iv,b),G(()=>{!m&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,h]);const ht=p.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:H,elements:nt,x:ct,y:Ne,middlewareData:qt,update:oe,placement:ut,context:Ht,isPositioned:Qt,floatingStyles:pn}=Qy({rootContext:h,placement:I,middleware:vt,strategy:n,whileElementsMounted:d?void 0:(...it)=>ra(...it,ht),nodeId:y,externalTree:T}),{sideX:mn,sideY:gn}=qt.adaptiveOrigin||Fn,je=Qt?n:"fixed",yn=p.useMemo(()=>b?{position:je,[mn]:ct,[gn]:Ne}:{position:je,...pn},[b,je,mn,ct,gn,Ne,pn]),me=p.useRef(null);G(()=>{if(!m)return;const it=C.current,Tt=typeof it=="function"?it():it,Rt=(da(Tt)?Tt.current:Tt)||null||null;Rt!==me.current&&(H.setPositionReference(Rt),me.current=Rt)},[m,H,M,C]),p.useEffect(()=>{if(!m)return;const it=C.current;typeof it!="function"&&da(it)&&it.current!==me.current&&(H.setPositionReference(it.current),me.current=it.current)},[m,H,M,C]),p.useEffect(()=>{if(d&&m&&nt.domReference&&nt.floating)return ra(nt.domReference,nt.floating,oe,ht)},[d,m,nt,oe,ht]);const ae=wt(ut),mr=zl(s,ae,F),gr=re(ut)||"center",yr=!!qt.hide?.referenceHidden;G(()=>{x&&m&&Qt&&E(ae)},[x,m,Qt,ae]);const vr=p.useMemo(()=>({position:"absolute",top:qt.arrow?.y,left:qt.arrow?.x}),[qt.arrow]),br=qt.arrow?.centerOffset!==0;return p.useMemo(()=>({positionerStyles:yn,arrowStyles:vr,arrowRef:st,arrowUncentered:br,side:mr,align:gr,physicalSide:ae,anchorHidden:yr,refs:H,context:Ht,isPositioned:Qt,update:oe}),[yn,vr,st,br,mr,gr,ae,yr,H,Ht,Qt,oe])}function da(t){return t!=null&&"current"in t}function Yl(t){return t==="starting"?Pu:we}const kv=p.forwardRef(function(e,n){const{render:s,className:i,anchor:o,positionMethod:r="absolute",side:a="top",align:c="center",sideOffset:l=0,alignOffset:u=0,collisionBoundary:f="clipping-ancestors",collisionPadding:d=5,arrowPadding:h=5,sticky:m=!1,disableAnchorTracking:g=!1,collisionAvoidance:v=Au,...y}=e,b=os(),x=Ev(),T=b.useState("open"),w=b.useState("mounted"),E=b.useState("trackCursorAxis"),R=b.useState("disableHoverablePopup"),S=b.useState("floatingRootContext"),D=b.useState("instantType"),O=b.useState("transitionStatus"),k=b.useState("hasViewport"),M=Lv({anchor:o,positionMethod:r,floatingRootContext:S,mounted:w,side:a,sideOffset:l,align:c,alignOffset:u,collisionBoundary:f,collisionPadding:d,sticky:m,arrowPadding:h,disableAnchorTracking:g,keepMounted:x,collisionAvoidance:v,adaptiveOrigin:k?Vv:void 0}),C=p.useMemo(()=>{const I={};return(!T||E==="both"||R)&&(I.pointerEvents="none"),{role:"presentation",hidden:!w,style:{...M.positionerStyles,...I}}},[T,E,R,w,M.positionerStyles]),B=p.useMemo(()=>({open:T,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:E!=="none"?"tracking-cursor":D}),[T,M.side,M.align,M.anchorHidden,E,D]),F=p.useMemo(()=>({...B,arrowRef:M.arrowRef,arrowStyles:M.arrowStyles,arrowUncentered:M.arrowUncentered}),[B,M.arrowRef,M.arrowStyles,M.arrowUncentered]),j=es("div",e,{state:B,props:[C,Yl(O),y],ref:[n,b.useStateSetter("positionerElement")],stateAttributesMapping:$l});return X.jsx(Kl.Provider,{value:F,children:j})}),Fv={...$l,...Wy},Bv=p.forwardRef(function(e,n){const{className:s,render:i,...o}=e,r=os(),{side:a,align:c}=Pv(),l=r.useState("open"),u=r.useState("instantType"),f=r.useState("transitionStatus"),d=r.useState("popupProps"),h=r.useState("floatingRootContext");Ul({open:l,ref:r.context.popupRef,onComplete(){l&&r.context.onOpenChangeComplete?.(!0)}});const m=r.useState("disabled"),g=r.useState("closeDelay");sv(h,{enabled:!m,closeDelay:g});const v=p.useMemo(()=>({open:l,side:a,align:c,instant:u,transitionStatus:f}),[l,a,c,u,f]);return es("div",e,{state:v,ref:[n,r.context.popupRef,r.useStateSetter("popupElement")],props:[d,Yl(f),o],stateAttributesMapping:Fv})}),Nv=function(e){const{delay:n,closeDelay:s,timeout:i=400}=e,o=p.useMemo(()=>({delay:n,closeDelay:s}),[n,s]),r=p.useMemo(()=>({open:n,close:s}),[n,s]);return X.jsx(Hl.Provider,{value:o,children:X.jsx(gg,{delay:r,timeoutMs:i,children:e.children})})};function Ab({children:t}){return X.jsx(Nv,{delay:0,closeDelay:0,timeout:0,children:t})}function Mb({children:t,...e}){return X.jsx(dv,{...e,children:t})}function Db({className:t,...e}){return X.jsx(Sv,{className:ga(t),...e})}function Ob({className:t,side:e="top",children:n}){return X.jsx(Cv,{children:X.jsx(kv,{side:e,children:X.jsx(Bv,{className:ga("rounded-md border border-primary-900 bg-primary-950 px-2 py-1 text-xs text-primary-50 shadow-sm",t),children:n})})})}const jv=p.createContext(void 0);function Uv(t=!1){const e=p.useContext(jv);if(e===void 0&&!t)throw new Error(De(16));return e}function Wv(t){const{focusableWhenDisabled:e,disabled:n,composite:s=!1,tabIndex:i=0,isNativeButton:o}=t,r=s&&e!==!1,a=s&&e===!1;return{props:p.useMemo(()=>{const l={onKeyDown(u){n&&e&&u.key!=="Tab"&&u.preventDefault()}};return s||(l.tabIndex=i,!o&&n&&(l.tabIndex=e?i:-1)),(o&&(e||r)||!o&&n)&&(l["aria-disabled"]=n),o&&(!e||a)&&(l.disabled=n),l},[s,n,e,r,a,o,i])}}function Ib(t={}){const{disabled:e=!1,focusableWhenDisabled:n,tabIndex:s=0,native:i=!0}=t,o=p.useRef(null),r=Uv(!0)!==void 0,a=U(()=>{const d=o.current;return!!(d?.tagName==="A"&&d?.href)}),{props:c}=Wv({focusableWhenDisabled:n,disabled:e,composite:r,tabIndex:s,isNativeButton:i}),l=p.useCallback(()=>{const d=o.current;$v(d)&&r&&e&&c.disabled===void 0&&d.disabled&&(d.disabled=!1)},[e,c.disabled,r]);G(l,[l]);const u=p.useCallback((d={})=>{const{onClick:h,onMouseDown:m,onKeyUp:g,onKeyDown:v,onPointerDown:y,...b}=d;return du({type:i?"button":void 0,onClick(T){if(e){T.preventDefault();return}h?.(T)},onMouseDown(T){e||m?.(T)},onKeyDown(T){if(e||(Rr(T),v?.(T)),T.baseUIHandlerPrevented)return;const w=T.target===T.currentTarget&&!i&&!a()&&!e,E=T.key==="Enter",R=T.key===" ";w&&((R||E)&&T.preventDefault(),E&&h?.(T))},onKeyUp(T){e||(Rr(T),g?.(T)),!T.baseUIHandlerPrevented&&T.target===T.currentTarget&&!i&&!e&&T.key===" "&&h?.(T)},onPointerDown(T){if(e){T.preventDefault();return}y?.(T)}},i?void 0:{role:"button"},c,b)},[e,c,i,a]),f=U(d=>{o.current=d,l()});return{getButtonProps:u,buttonRef:f}}function $v(t){return St(t)&&t.tagName==="BUTTON"}export{fb as $,_t as A,qv as B,rb as C,ub as D,ob as E,sb as F,ib as G,En as H,kt as I,ke as J,ab as K,Ee as L,hn as M,Tg as N,cb as O,or as P,ar as Q,St as R,fs as S,rn as T,lb as U,Sg as V,mi as W,vg as X,qe as Y,Nt as Z,dg as _,xv as a,Kn as a$,db as a0,Qo as a1,Vs as a2,og as a3,ag as a4,Bt as a5,hg as a6,pb as a7,mt as a8,Xv as a9,q as aA,xb as aB,sv as aC,Yl as aD,Gv as aE,Au as aF,Lv as aG,vb as aH,Eb as aI,fg as aJ,yb as aK,bb as aL,Vn as aM,lr as aN,zv as aO,Uv as aP,zt as aQ,Xt as aR,_y as aS,ov as aT,lv as aU,Jy as aV,Pb as aW,Sb as aX,Yv as aY,gb as aZ,mb as a_,hb as aa,Dt as ab,sn as ac,Lm as ad,fl as ae,dn as af,wb as ag,fn as ah,$l as ai,Tb as aj,pr as ak,Cb as al,Le as am,Cl as an,nb as ao,un as ap,Ky as aq,zy as ar,mg as as,Zy as at,my as au,av,jl as aw,dr as ax,Gy as ay,Xy as az,$y as b,jv as b0,Y as b1,Rb as b2,U as c,ot as d,G as e,Wy as f,Ib as g,xg as h,nl as i,Ul as j,Pe as k,dt as l,Mv as m,cr as n,eb as o,tb as p,Jv as q,Ab as r,Mb as s,Zn as t,Ny as u,Db as v,Ob as w,Kv as x,Qv as y,va as z};